netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@gmail.com>
To: Ding Tianhong <dingtianhong@huawei.com>
Cc: leedom@chelsio.com, ashok.raj@intel.com, bhelgaas@google.com,
	helgaas@kernel.org, werner@chelsio.com, ganeshgr@chelsio.com,
	asit.k.mallick@intel.com, patrick.j.cramer@intel.com,
	Suravee.Suthikulpanit@amd.com, Bob.Shaw@amd.com,
	l.stach@pengutronix.de, amira@mellanox.com,
	gabriele.paoloni@huawei.com, David.Laight@aculab.com,
	jeffrey.t.kirsher@intel.com, catalin.marinas@arm.com,
	will.deacon@arm.com, mark.rutland@arm.com, robin.murphy@arm.com,
	davem@davemloft.net, alexander.duyck@gmail.com,
	eric.dumazet@gmail.com, linux-arm-kernel@lists.infradead.org,
	netdev@vger.kernel.org, linux-pci@vger.kernel.org,
	linux-kernel@vger.kernel.org, linuxarm@huawei.com
Subject: Re: [PATCH net] PCI: fix the return value for the pci_find_pcie_root_port()
Date: Thu, 17 Aug 2017 15:30:12 +0200	[thread overview]
Message-ID: <20170817133012.GC6854@ulmo> (raw)
In-Reply-To: <ea83e7a8-39a4-5b94-1148-5bf4ae4ed214@huawei.com>

[-- Attachment #1: Type: text/plain, Size: 2188 bytes --]

On Thu, Aug 17, 2017 at 08:40:16PM +0800, Ding Tianhong wrote:
> 
> 
> On 2017/8/17 18:51, Thierry Reding wrote:
> > On Thu, Aug 17, 2017 at 10:25:30AM +0800, Ding Tianhong wrote:
> >> The pci_find_pcie_root_port() would return NULL if the given
> >> dev is already a Root Port, it looks like unfriendly to the
> >> PCIe Root Port device, Thierry and Bjorn suggest to let this
> >> function return the given dev under this circumstances.
> >>
> >> Fixes: 0e405232871d6 ("PCI: fix oops when try to find Root Port for a PCI device")
> >> Suggested-by: Thierry Reding <thierry.reding@gmail.com>
> >> Suggested-by: Bjorn Helgaas <helgaas@kernel.org>
> >> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
> >> Signed-off-by: Ding Tianhong <dingtianhong@huawei.com>
> >> ---
> >>  drivers/pci/pci.c | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
> >> index 7e2022f..352bb53 100644
> >> --- a/drivers/pci/pci.c
> >> +++ b/drivers/pci/pci.c
> >> @@ -514,7 +514,7 @@ struct resource *pci_find_resource(struct pci_dev *dev, struct resource *res)
> >>   */
> >>  struct pci_dev *pci_find_pcie_root_port(struct pci_dev *dev)
> >>  {
> >> -	struct pci_dev *bridge, *highest_pcie_bridge = NULL;
> >> +	struct pci_dev *bridge, *highest_pcie_bridge = dev;
> >>  
> >>  	bridge = pci_upstream_bridge(dev);
> >>  	while (bridge && pci_is_pcie(bridge)) {
> > 
> > I think this should actually be this change on top of a revert of commit
> > 0e405232871d6 ("PCI: fix oops when try to find Root Port for a PCI
> > device"). After the above change, the previous fix will have a redundant
> > check because highest_pcie_bridge will never be NULL.
> > 
> > Let me send out that version to clarify what I mean.
> > 
> 
> Hi Thierry:
> 
> The patch ("PCI: fix oops when try to find Root Port for a PCI device")
> has been merge to the linus mainline tree before you found this deficiencies....

I understand that. I'm just saying that there's no point keeping that
change around because it no longer makes sense after we initialize the
highest_pcie_bridge variable to dev.

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2017-08-17 13:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-17  2:25 [PATCH net] PCI: fix the return value for the pci_find_pcie_root_port() Ding Tianhong
2017-08-17  2:42 ` David Miller
2017-08-17 10:51 ` Thierry Reding
2017-08-17 12:40   ` Ding Tianhong
2017-08-17 13:30     ` Thierry Reding [this message]
2017-08-17 13:38       ` Ding Tianhong
2017-08-17 11:06 ` [PATCH] PCI: Allow PCI express root ports to find themselves Thierry Reding
2017-08-17 16:58   ` Bjorn Helgaas
2017-08-18  1:29   ` Shawn Lin
2017-08-18  4:32   ` Michael Ellerman
2017-08-18 23:14   ` David Miller

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=20170817133012.GC6854@ulmo \
    --to=thierry.reding@gmail.com \
    --cc=Bob.Shaw@amd.com \
    --cc=David.Laight@aculab.com \
    --cc=Suravee.Suthikulpanit@amd.com \
    --cc=alexander.duyck@gmail.com \
    --cc=amira@mellanox.com \
    --cc=ashok.raj@intel.com \
    --cc=asit.k.mallick@intel.com \
    --cc=bhelgaas@google.com \
    --cc=catalin.marinas@arm.com \
    --cc=davem@davemloft.net \
    --cc=dingtianhong@huawei.com \
    --cc=eric.dumazet@gmail.com \
    --cc=gabriele.paoloni@huawei.com \
    --cc=ganeshgr@chelsio.com \
    --cc=helgaas@kernel.org \
    --cc=jeffrey.t.kirsher@intel.com \
    --cc=l.stach@pengutronix.de \
    --cc=leedom@chelsio.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linuxarm@huawei.com \
    --cc=mark.rutland@arm.com \
    --cc=netdev@vger.kernel.org \
    --cc=patrick.j.cramer@intel.com \
    --cc=robin.murphy@arm.com \
    --cc=werner@chelsio.com \
    --cc=will.deacon@arm.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 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).