[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ba0380b1-e8d1-890a-82e2-61d0ab6e9cae@kernel.org>
Date: Sun, 18 Aug 2019 22:28:13 -0400
From: Sinan Kaya <okaya@...nel.org>
To: Mika Westerberg <mika.westerberg@...ux.intel.com>,
Bjorn Helgaas <bhelgaas@...gle.com>,
"Rafael J. Wysocki" <rjw@...ysocki.net>
Cc: Lukas Wunner <lukas@...ner.de>,
Keith Busch <keith.busch@...el.com>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Frederick Lawler <fred@...dlawl.com>,
"Gustavo A . R . Silva" <gustavo@...eddedor.com>,
Kai-Heng Feng <kai.heng.feng@...onical.com>,
linux-pci@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 2/2] PCI: pciehp: Prevent deadlock on disconnect
On 8/12/2019 10:31 AM, Mika Westerberg wrote:
> +int pciehp_card_present_or_link_active(struct controller *ctrl)
> {
> - return pciehp_card_present(ctrl) || pciehp_check_link_active(ctrl);
> + int ret;
> +
> + ret = pciehp_card_present(ctrl);
> + if (ret)
> + return ret;
> +
> + return pciehp_check_link_active(ctrl);
The semantics of this function changed here. Before it was checking for
either presence detect bit or link active bit. Now, it is looking to
have both set.
There are PCI controllers that won't report presence detect correctly,
but still report link active.
I think you want
if (ret < 0)
return ret;
here to match the previous behavior while still handling device removal.
Powered by blists - more mailing lists