From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Luis Henriques <luis.henriques@canonical.com>
Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org,
Gavin Shan <shangw@linux.vnet.ibm.com>,
"David S. Miller" <davem@davemloft.net>
Subject: Re: [ 07/13] net/tg3: Avoid delay during MMIO access
Date: Wed, 3 Jul 2013 10:53:49 -0700 [thread overview]
Message-ID: <20130703175349.GA21995@kroah.com> (raw)
In-Reply-To: <87d2r1jpp7.fsf@canonical.com>
On Tue, Jul 02, 2013 at 10:06:44AM +0100, Luis Henriques wrote:
> Greg Kroah-Hartman <gregkh@linuxfoundation.org> writes:
>
> > 3.4-stable review patch. If anyone has any objections, please let me know.
> >
> > ------------------
> >
> > From: Gavin Shan <shangw@linux.vnet.ibm.com>
> >
> > commit 6d446ec32f169c6a5d9bc90684a8082a6cbe90f6 upstream.
> >
> > When the EEH error is the result of a fenced host bridge, MMIO accesses
> > can be very slow (milliseconds) to timeout and return all 1's,
> > thus causing the driver various timeout loops to take way too long and
> > trigger soft-lockup warnings (in addition to taking minutes to recover).
> >
> > It might be worthwhile to check if for any of these cases, ffffffff is
> > a valid possible value, and if not, bail early since that means the HW
> > is either gone or isolated. In the meantime, checking that the PCI channel
> > is offline would be workaround of the problem.
> >
> > Signed-off-by: Gavin Shan <shangw@linux.vnet.ibm.com>
> > Signed-off-by: David S. Miller <davem@davemloft.net>
> > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> >
> > ---
> > drivers/net/ethernet/broadcom/tg3.c | 36 ++++++++++++++++++++++++++++++++++++
> > 1 file changed, 36 insertions(+)
> >
> > --- a/drivers/net/ethernet/broadcom/tg3.c
> > +++ b/drivers/net/ethernet/broadcom/tg3.c
> > @@ -689,6 +689,9 @@ static int tg3_ape_lock(struct tg3 *tp,
> > status = tg3_ape_read32(tp, gnt + off);
> > if (status == bit)
> > break;
> > + if (pci_channel_offline(tp->pdev))
> > + break;
> > +
> > udelay(10);
> > }
> >
> > @@ -1466,6 +1469,9 @@ static void tg3_wait_for_event_ack(struc
> > for (i = 0; i < delay_cnt; i++) {
> > if (!(tr32(GRC_RX_CPU_EVENT) & GRC_RX_CPU_DRIVER_EVENT))
> > break;
> > + if (pci_channel_offline(tp->pdev))
> > + break;
> > +
> > udelay(8);
> > }
> > }
> > @@ -1636,6 +1642,9 @@ static int tg3_poll_fw(struct tg3 *tp)
> > for (i = 0; i < 200; i++) {
> > if (tr32(VCPU_STATUS) & VCPU_STATUS_INIT_DONE)
> > return 0;
> > + if (pci_channel_offline(tp->pdev))
> > + return -ENODEV;
> > +
> > udelay(100);
> > }
> > return -ENODEV;
> > @@ -1646,6 +1655,15 @@ static int tg3_poll_fw(struct tg3 *tp)
> > tg3_read_mem(tp, NIC_SRAM_FIRMWARE_MBOX, &val);
> > if (val == ~NIC_SRAM_FIRMWARE_MBOX_MAGIC1)
> > break;
> > + if (pci_channel_offline(tp->pdev)) {
> > + if (!tg3_flag(tp, NO_FWARE_REPORTED)) {
> > + tg3_flag_set(tp, NO_FWARE_REPORTED);
> > + netdev_info(tp->dev, "No firmware running\n");
> > + }
> > +
> > + break;
> > + }
> > +
> > udelay(10);
> > }
> >
> > @@ -3204,6 +3222,8 @@ static int tg3_nvram_write_block_buffere
> > ret = tg3_nvram_exec_cmd(tp, nvram_cmd);
> > if (ret)
> > break;
> > + if (pci_channel_offline(tp->pdev))
> > + return -EBUSY;
> > }
> > return ret;
> > }
>
> As I referred in a previous email, I'm not sure about the correctness
> of this backport. The original commit modifies function tg3_pause_cpu
> (and not tg3_nvram_write_block_buffered).
>
> My backport to the 3.5 kernel modifies tg3_halt_cpu code which
> contains the code that has been moved into tg3_pause_cpu in mainline
> (by commit 837c45bb4eaf367ac738c8d746990da33b3402ee).
You're right, same thing happens for the 3.9 backport of this patch as
well.
Gavin, if you want this patch to be applied to the stable kernel trees,
please provide a working backported patch to stable@vger.kernel.org so
that I can apply it properly.
I'll go drop this patch from both 3.9 and 3.4-stable.
thanks,
greg k-h
next prev parent reply other threads:[~2013-07-03 17:53 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-01 20:10 [ 00/13] 3.4.52-stable review Greg Kroah-Hartman
2013-07-01 20:10 ` [ 01/13] ARM: 7755/1: handle user space mapped pages in flush_kernel_dcache_page Greg Kroah-Hartman
2013-07-01 20:10 ` [ 02/13] ARM: 7772/1: Fix missing flush_kernel_dcache_page() for noMMU Greg Kroah-Hartman
2013-07-01 20:10 ` [ 03/13] Bluetooth: Fix crash in l2cap_build_cmd() with small MTU Greg Kroah-Hartman
2013-07-01 20:10 ` [ 04/13] hw_breakpoint: Use cpu_possible_mask in {reserve,release}_bp_slot() Greg Kroah-Hartman
2013-07-01 20:10 ` [ 05/13] dlci: acquire rtnl_lock before calling __dev_get_by_name() Greg Kroah-Hartman
2013-07-01 20:10 ` [ 06/13] dlci: validate the net device in dlci_del() Greg Kroah-Hartman
2013-07-01 20:10 ` [ 07/13] net/tg3: Avoid delay during MMIO access Greg Kroah-Hartman
2013-07-02 9:06 ` Luis Henriques
2013-07-03 17:53 ` Greg Kroah-Hartman [this message]
2013-07-01 20:10 ` [ 08/13] perf: Disable monitoring on setuid processes for regular users Greg Kroah-Hartman
2013-07-01 20:10 ` [ 09/13] UBIFS: prepare to fix a horrid bug Greg Kroah-Hartman
2013-07-01 20:10 ` [ 10/13] UBIFS: " Greg Kroah-Hartman
2013-07-01 20:10 ` [ 11/13] pch_uart: fix a deadlock when pch_uart as console Greg Kroah-Hartman
2013-07-01 20:10 ` [ 12/13] perf: Fix perf mmap bugs Greg Kroah-Hartman
2013-07-01 20:10 ` [ 13/13] perf: Fix mmap() accounting hole Greg Kroah-Hartman
2013-07-02 14:39 ` [ 00/13] 3.4.52-stable review Guenter Roeck
2013-07-02 18:55 ` Greg Kroah-Hartman
2013-07-02 21:25 ` Guenter Roeck
2013-07-02 18:47 ` Shuah Khan
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=20130703175349.GA21995@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=luis.henriques@canonical.com \
--cc=shangw@linux.vnet.ibm.com \
--cc=stable@vger.kernel.org \
/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 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).