linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/2] bnx2: Wait for in-flight DMA to complete at probe stage
@ 2016-11-13  5:01 Baoquan He
  2016-11-13  5:01 ` [PATCH v2 1/2] Revert "bnx2: Reset device during driver initialization" Baoquan He
                   ` (3 more replies)
  0 siblings, 4 replies; 12+ messages in thread
From: Baoquan He @ 2016-11-13  5:01 UTC (permalink / raw)
  To: netdev, michael.chan, davem
  Cc: linux-kernel, Dept-GELinuxNICDev, rasesh.mody, harish.patil,
	frank, jsr, pmenzel, jroedel, dyoung, Baoquan He

This is v2 post.

In commit 3e1be7a ("bnx2: Reset device during driver initialization"),
firmware requesting code was moved from open stage to probe stage.
The reason is in kdump kernel hardware iommu need device be reset in
driver probe stage, otherwise those in-flight DMA from 1st kernel
will continue going and look up into the newly created io-page tables.
However bnx2 chip resetting involves firmware requesting issue, that
need be done in open stage. 

Michale Chan suggested we can just wait for the old in-flight DMA to
complete at probe stage, then though without device resetting, we
don't need to worry the old in-flight DMA could continue looking up 
the newly created io-page tables.

v1->v2:
    Michael suggested to wait for the in-flight DMA to complete at probe
    stage. So give up the old method of trying to reset chip at probe
    stage, take the new way accordingly.


Baoquan He (2):
  Revert "bnx2: Reset device during driver initialization"
  bnx2: Wait for in-flight DMA to complete at probe stage

 drivers/net/ethernet/broadcom/bnx2.c | 48 +++++++++++++++++++++++++++---------
 1 file changed, 36 insertions(+), 12 deletions(-)

-- 
2.5.5

^ permalink raw reply	[flat|nested] 12+ messages in thread
* [PATCH 0/2] bnx2: Hard reset bnx2 chip at probe stage
@ 2016-11-11 13:46 Baoquan He
  2016-11-11 13:46 ` [PATCH 2/2] " Baoquan He
  0 siblings, 1 reply; 12+ messages in thread
From: Baoquan He @ 2016-11-11 13:46 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, Dept-GELinuxNICDev, rasesh.mody, harish.patil,
	frank, jsr, pmenzel, jroedel, dyoung, Baoquan He

Hi bnx2 experts,

In commit 3e1be7a ("bnx2: Reset device during driver initialization"),
firmware requesting code was moved from open stage to probe stage.
The reason is in kdump kernel hardware iommu need device be reset in
driver probe stage, otherwise those in-flight DMA from 1st kernel
will continue going and look up into the newly created io-page tables.
So we need reset device to stop in-flight DMA as early as possibe.

But with commit 3e1be7a merged, people reported their bnx2 driver init
failed because of failed firmware loading. After discussion, it's found
that they built bnx2 driver into kernel, and that makes probe function
bnx2_init_one be called in do_initcalls(). But at this time the initramfs
has not been uncompressed yet and mounted, kernel can't detect firmware.

So there's only one way to cover both. Try to hard reset the bnx2 device
at probe stage, without involving firmware issues. I tried to add function
bnx2_hard_reset_chip() to do this and it's only called in kdump kernel.
The thing is I am not quite familiar with bnx2 chip spec, just abstract
code from bnx2_reset_chip, the testing result is good.

Any suggestions are welcomed and much appreciated!

Baoquan He (2):
  Revert "bnx2: Reset device during driver initialization"
  bnx2: Hard reset bnx2 chip at probe stage

 drivers/net/ethernet/broadcom/bnx2.c | 70 +++++++++++++++++++++++++++++++++---
 1 file changed, 65 insertions(+), 5 deletions(-)

-- 
2.5.5

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2016-11-14 21:21 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-13  5:01 [PATCH v2 0/2] bnx2: Wait for in-flight DMA to complete at probe stage Baoquan He
2016-11-13  5:01 ` [PATCH v2 1/2] Revert "bnx2: Reset device during driver initialization" Baoquan He
2016-11-13  5:01 ` [PATCH v2 2/2] bnx2: Wait for in-flight DMA to complete at probe stage Baoquan He
2016-11-13 19:02   ` Michael Chan
2016-11-14  8:25 ` [PATCH v2 0/2] " Paul Menzel
2016-11-14  9:10   ` Baoquan He
2016-11-14 17:28   ` David Miller
2016-11-14 17:35     ` Paul Menzel
2016-11-14 21:21 ` David Miller
  -- strict thread matches above, loose matches on Subject: below --
2016-11-11 13:46 [PATCH 0/2] bnx2: Hard reset bnx2 chip " Baoquan He
2016-11-11 13:46 ` [PATCH 2/2] " Baoquan He
2016-11-13  4:15   ` [PATCH v2 2/2] bnx2: Wait for in-flight DMA to complete " Baoquan He
2016-11-13  4:40     ` David Miller
2016-11-13  4:54       ` 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).