linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bjorn Helgaas <bhelgaas@google.com>
To: Ben Hutchings <ben@decadent.org.uk>
Cc: Gavin Shan <gwshan@linux.vnet.ibm.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>,
	Alex Williamson <alex.williamson@gmail.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-pci <linux-pci@vger.kernel.org>
Subject: Re: [PATCH 3.14 186/228] PCI: Wrong register used to check pending traffic
Date: Wed, 11 Jun 2014 15:15:41 -0600	[thread overview]
Message-ID: <CAErSpo6UcObn6HVKpw82Ncfgr64w2Ws120P2WfSLqAqaROsDTw@mail.gmail.com> (raw)
In-Reply-To: <1402196538.23860.24.camel@deadeye.wl.decadent.org.uk>

On Sat, Jun 7, 2014 at 9:02 PM, Ben Hutchings <ben@decadent.org.uk> wrote:
> On Wed, 2014-06-04 at 16:23 -0700, Greg Kroah-Hartman wrote:
>> 3.14-stable review patch.  If anyone has any objections, please let me know.
>>
>> ------------------
>>
>> From: Gavin Shan <gwshan@linux.vnet.ibm.com>
>>
>> commit d0b4cc4e32705ff00d90d32da7783c266c702c04 upstream.
>>
>> The incorrect register offset is passed to pci_wait_for_pending(), which is
>> caused by commit 157e876ffe ("PCI: Add pci_wait_for_pending() (refactor
>> pci_wait_for_pending_transaction())").
>>
>> Fixes: 157e876ffe ("PCI: Add pci_wait_for_pending() (refactor pci_wait_for_pending_transaction())
>> Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com>
>> Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
>> Acked-by: Alex Williamson <alex.williamson@gmail.com>
>> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>>
>> ---
>>  drivers/pci/pci.c |    5 +++--
>>  1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> --- a/drivers/pci/pci.c
>> +++ b/drivers/pci/pci.c
>> @@ -3043,7 +3043,8 @@ int pci_wait_for_pending_transaction(str
>>       if (!pci_is_pcie(dev))
>>               return 1;
>>
>> -     return pci_wait_for_pending(dev, PCI_EXP_DEVSTA, PCI_EXP_DEVSTA_TRPND);
>> +     return pci_wait_for_pending(dev, pci_pcie_cap(dev) + PCI_EXP_DEVSTA,
>> +                                 PCI_EXP_DEVSTA_TRPND);
>>  }
>>  EXPORT_SYMBOL(pci_wait_for_pending_transaction);
>>
>> @@ -3085,7 +3086,7 @@ static int pci_af_flr(struct pci_dev *de
>>               return 0;
>>
>>       /* Wait for Transaction Pending bit clean */
>> -     if (pci_wait_for_pending(dev, PCI_AF_STATUS, PCI_AF_STATUS_TP))
>> +     if (pci_wait_for_pending(dev, pos + PCI_AF_STATUS, PCI_AF_STATUS_TP))
>>               goto clear;
>>
>>       dev_err(&dev->dev, "transaction is not cleared; "
>
> This still seems to be broken because pci_wait_for_pending() does
> pci_read_config_word() but PCI_AF_STATUS is not word-aligned.

I agree; this does seem broken.  I think pci_read_config_word() will
return PCIBIOS_BAD_REGISTER_NUMBER without updating the value
returned, so I think we'll test garbage from the stack.

What do you think, Alex?

Bjorn

  reply	other threads:[~2014-06-11 21:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20140604232347.966798903@linuxfoundation.org>
     [not found] ` <20140604232354.004988520@linuxfoundation.org>
2014-06-08  3:02   ` [PATCH 3.14 186/228] PCI: Wrong register used to check pending traffic Ben Hutchings
2014-06-11 21:15     ` Bjorn Helgaas [this message]
2014-06-11 22:07       ` Alex Williamson
2014-06-12  0:24         ` Gavin Shan

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=CAErSpo6UcObn6HVKpw82Ncfgr64w2Ws120P2WfSLqAqaROsDTw@mail.gmail.com \
    --to=bhelgaas@google.com \
    --cc=alex.williamson@gmail.com \
    --cc=ben@decadent.org.uk \
    --cc=gregkh@linuxfoundation.org \
    --cc=gwshan@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --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).