All of lore.kernel.org
 help / color / mirror / Atom feed
From: Baoquan He <bhe@redhat.com>
To: Michael Chan <michael.chan@broadcom.com>
Cc: Netdev <netdev@vger.kernel.org>,
	open list <linux-kernel@vger.kernel.org>,
	Dept-GELinuxNICDev@cavium.com, rasesh.mody@cavium.com,
	harish.patil@cavium.com, frank@undermydesk.org,
	jsr@dex.edzone.net, pmenzel@molgen.mpg.de, jroedel@suse.de,
	dyoung@redhat.com
Subject: Re: [PATCH 0/2] bnx2: Hard reset bnx2 chip at probe stage
Date: Sun, 13 Nov 2016 12:10:17 +0800	[thread overview]
Message-ID: <20161113041017.GE15325@x1> (raw)
In-Reply-To: <CACKFLimGyhzPY=0ehHGG7e0w58i7XfuTmAcsrjMwzc3weGNCjA@mail.gmail.com>

Hi Michael,


On 11/11/16 at 09:37am, Michael Chan wrote:
> On Fri, Nov 11, 2016 at 6:02 AM, Baoquan He <bhe@redhat.com> wrote:
> > On 11/11/16 at 09:46pm, Baoquan He wrote:
> >> 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.
> >
> > Here I changed to send BNX2_MISC_COMMAND_HD_RESET in BNX2_CHIP_5709
> > case.
> >
> 
> From my old 5709 Documentation:
> 
> Bit 6 HD_RESET:  Writing this bit as 1 will cause the chip to do a
> hard reset like bit 5 except the sticky bits in the PCI function are
> not reset.
> 
> Bit 5 POR_RESET: Writing this bit as 1 will cause the chip to do an
> internal reset exactly like a power-up reset.  There is no protection
> for this request and it may cause any current PCI cycle to lock up.
> This reset is intended for use under manufacturing conditions only.
> 
> So it sounds like doing HD_RESET can potentially cause a PCI bus lock up.
> 
> Why not just disable DMA gracefully as done at the beginning of
> bnx2_reset_chip()?

Thanks for your suggestion.

If what I undertand is correct, you meant waiting for the current PCI
transaction to complete, right? I tried and it also works. I like this
idea, will repost v2. Please help check if it meets your thoughts.

Thanks
Baoquan

      reply	other threads:[~2016-11-13  4:10 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-11 13:46 [PATCH 0/2] bnx2: Hard reset bnx2 chip at probe stage Baoquan He
2016-11-11 13:46 ` [PATCH 1/2] Revert "bnx2: Reset device during driver initialization" Baoquan He
2016-11-11 13:51   ` Paul Menzel
2016-11-11 13:46 ` [PATCH 2/2] bnx2: Hard reset bnx2 chip at probe stage 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
2016-11-11 14:02 ` [PATCH 0/2] bnx2: Hard reset bnx2 chip " Baoquan He
2016-11-11 17:37   ` Michael Chan
2016-11-13  4:10     ` Baoquan He [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161113041017.GE15325@x1 \
    --to=bhe@redhat.com \
    --cc=Dept-GELinuxNICDev@cavium.com \
    --cc=dyoung@redhat.com \
    --cc=frank@undermydesk.org \
    --cc=harish.patil@cavium.com \
    --cc=jroedel@suse.de \
    --cc=jsr@dex.edzone.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael.chan@broadcom.com \
    --cc=netdev@vger.kernel.org \
    --cc=pmenzel@molgen.mpg.de \
    --cc=rasesh.mody@cavium.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.