Commit fed56943 authored by Stefan Wahren's avatar Stefan Wahren Committed by Jakub Kicinski
Browse files

net: vertexcom: mse102x: Add warning about IRQ trigger type



The example of the initial DT binding of the Vertexcom MSE 102x suggested
a IRQ_TYPE_EDGE_RISING, which is wrong. So warn everyone to fix their
device tree to level based IRQ.

Signed-off-by: default avatarStefan Wahren <wahrenst@gmx.net>
Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
Link: https://patch.msgid.link/20250509120435.43646-3-wahrenst@gmx.net


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent a29a7286
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -8,6 +8,7 @@

#include <linux/if_vlan.h>
#include <linux/interrupt.h>
#include <linux/irq.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/netdevice.h>
@@ -522,10 +523,25 @@ static irqreturn_t mse102x_irq(int irq, void *_mse)

static int mse102x_net_open(struct net_device *ndev)
{
	struct irq_data *irq_data = irq_get_irq_data(ndev->irq);
	struct mse102x_net *mse = netdev_priv(ndev);
	struct mse102x_net_spi *mses = to_mse102x_spi(mse);
	int ret;

	if (!irq_data) {
		netdev_err(ndev, "Invalid IRQ: %d\n", ndev->irq);
		return -EINVAL;
	}

	switch (irqd_get_trigger_type(irq_data)) {
	case IRQ_TYPE_LEVEL_HIGH:
	case IRQ_TYPE_LEVEL_LOW:
		break;
	default:
		netdev_warn_once(ndev, "Only IRQ type level recommended, please update your device tree firmware.\n");
		break;
	}

	ret = request_threaded_irq(ndev->irq, NULL, mse102x_irq, IRQF_ONESHOT,
				   ndev->name, mse);
	if (ret < 0) {