* [PATCH v2] bnx2: Reset device during driver initialization
@ 2016-09-09 14:43 Baoquan He
2016-09-13 15:25 ` David Miller
0 siblings, 1 reply; 3+ messages in thread
From: Baoquan He @ 2016-09-09 14:43 UTC (permalink / raw)
To: netdev
Cc: sony.chacko, Dept-HSGLinuxNICDev, linux-kernel, kexec, joro,
dyoung, Baoquan He
When system enters into kdump kernel because of kernel panic, it won't
shutdown devices. On-flight DMA will continue transferring data until
device driver initializes. All devices are supposed to reset during
driver initialization. And this property is used to fix the kdump
failure in system with intel iommu. Other systems with hardware iommu
should be similar. Please check commit 091d42e ("iommu/vt-d: Copy
translation tables from old kernel") and those commits around.
But bnx2 driver doesn't reset device during driver initialization. The
device resetting is deferred to net device up stage. This will cause
hardware iommu handling failure on bnx2 device. And its resetting relies
on firmware. So in this patch move the firmware requesting code to earlier
bnx2_init_one(), then next call bnx2_reset_chip to reset device.
Signed-off-by: Baoquan He <bhe@redhat.com>
---
v1->v2:
Forget removing bnx2_release_firmware which is used for error handling
of bnx2_request_firmware.
drivers/net/ethernet/broadcom/bnx2.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/drivers/net/ethernet/broadcom/bnx2.c b/drivers/net/ethernet/broadcom/bnx2.c
index 8fc3f3c..505ceaf 100644
--- a/drivers/net/ethernet/broadcom/bnx2.c
+++ b/drivers/net/ethernet/broadcom/bnx2.c
@@ -6356,10 +6356,6 @@ bnx2_open(struct net_device *dev)
struct bnx2 *bp = netdev_priv(dev);
int rc;
- rc = bnx2_request_firmware(bp);
- if (rc < 0)
- goto out;
-
netif_carrier_off(dev);
bnx2_disable_int(bp);
@@ -6428,7 +6424,6 @@ open_err:
bnx2_free_irq(bp);
bnx2_free_mem(bp);
bnx2_del_napi(bp);
- bnx2_release_firmware(bp);
goto out;
}
@@ -8575,6 +8570,12 @@ bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
pci_set_drvdata(pdev, dev);
+ rc = bnx2_request_firmware(bp);
+ if (rc < 0)
+ goto error;
+
+
+ bnx2_reset_chip(bp, BNX2_DRV_MSG_CODE_RESET);
memcpy(dev->dev_addr, bp->mac_addr, ETH_ALEN);
dev->hw_features = NETIF_F_IP_CSUM | NETIF_F_SG |
@@ -8607,6 +8608,7 @@ bnx2_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
return 0;
error:
+ bnx2_release_firmware(bp);
pci_iounmap(pdev, bp->regview);
pci_release_regions(pdev);
pci_disable_device(pdev);
--
2.5.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] bnx2: Reset device during driver initialization
2016-09-09 14:43 [PATCH v2] bnx2: Reset device during driver initialization Baoquan He
@ 2016-09-13 15:25 ` David Miller
2016-09-13 23:50 ` Baoquan He
0 siblings, 1 reply; 3+ messages in thread
From: David Miller @ 2016-09-13 15:25 UTC (permalink / raw)
To: bhe
Cc: netdev, sony.chacko, Dept-HSGLinuxNICDev, linux-kernel, kexec,
joro, dyoung
Just to be clear, I did actually apply this v2 of the patch
rather than the initial version.:)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] bnx2: Reset device during driver initialization
2016-09-13 15:25 ` David Miller
@ 2016-09-13 23:50 ` Baoquan He
0 siblings, 0 replies; 3+ messages in thread
From: Baoquan He @ 2016-09-13 23:50 UTC (permalink / raw)
To: David Miller
Cc: netdev, sony.chacko, Dept-HSGLinuxNICDev, linux-kernel, kexec,
joro, dyoung
On 09/13/16 at 11:25am, David Miller wrote:
>
> Just to be clear, I did actually apply this v2 of the patch
> rather than the initial version.:)
Thanks a lot!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-09-13 23:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-09 14:43 [PATCH v2] bnx2: Reset device during driver initialization Baoquan He
2016-09-13 15:25 ` David Miller
2016-09-13 23:50 ` Baoquan He
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).