Skip to contentSkip to conversation

net: bgmac: Couple of small bgmac changes

PATCH In review Florian Fainelli 2 participants 4 messages Mar 27, 2018 – Mar 29, 2018

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover net: bgmac: Couple of small bgmac changes

Hi all,

This patch series addresses two minor issues with the bgmac driver:

- provides the interface name through /proc/interrupts rather than "bgmac"
- makes sure the interrupts are masked during probe, in case the block was not properly reset

Florian Fainelli (2):
net: bgmac: Use interface name to request interrupt
net: bgmac: Mask interrupts during probe

 drivers/net/ethernet/broadcom/bgmac.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Signature · 1 line
2.14.1
#1 lore raw

PATCH 1/2 net: bgmac: Use interface name to request interrupt

When the system contains several BGMAC adapters, it is nice to be able to tell which one is which by looking at /proc/interrupts. Use the network device name as a name to request_irq() with.

---
 drivers/net/ethernet/broadcom/bgmac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/broadcom/bgmac.c +1 -1
index 8eef9fb6b1fe..46d7b8068425 100644
@@ -1190,7 +1190,7 @@ static int bgmac_open(struct net_device *net_dev)
 	bgmac_chip_init(bgmac);
 
 	err = request_irq(bgmac->irq, bgmac_interrupt, IRQF_SHARED,
-			  KBUILD_MODNAME, net_dev);
+			  net_dev->name, net_dev);
 	if (err < 0) {
 		dev_err(bgmac->dev, "IRQ request error: %d!\n", err);
 		bgmac_dma_cleanup(bgmac);
Signature · 1 line
2.14.1
#2 lore raw

PATCH 2/2 net: bgmac: Mask interrupts during probe

In reply to Florian Fainelli

We can have interrupts left enabled form e.g: the bootloader which used the network device for network boot. Make sure we have those disabled as early as possible to avoid spurious interrupts.

---
 drivers/net/ethernet/broadcom/bgmac.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/ethernet/broadcom/bgmac.c +2 -0
index 46d7b8068425..2326cc219c46 100644
@@ -1492,6 +1492,8 @@ int bgmac_enet_probe(struct bgmac *bgmac)
 	struct net_device *net_dev = bgmac->net_dev;
 	int err;
 
+	bgmac_chip_intrs_off(bgmac);
+
 	net_dev->irq = bgmac->irq;
 	SET_NETDEV_DEV(net_dev, bgmac->dev);
 	dev_set_drvdata(bgmac->dev, bgmac);
Signature · 1 line
2.14.1
maintainer
#3 lore raw
In reply to Florian Fainelli

From: Florian Fainelli <[email protected]>
Date: Tue, 27 Mar 2018 16:20:00 -0700

Quoted 5 lines

This patch series addresses two minor issues with the bgmac driver:

- provides the interface name through /proc/interrupts rather than "bgmac"
- makes sure the interrupts are masked during probe, in case the block was not properly reset

Series applied, thanks Florian.