[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAKF3qh2xVfj0KNGj8MFC_Z+gOqNw7JD1uDbVy=OgLnkZ0t-0+Q@mail.gmail.com>
Date: Wed, 30 Sep 2020 10:20:50 +0800
From: Ethan Zhao <xerces.zhao@...il.com>
To: Lukas Wunner <lukas@...ner.de>
Cc: Sinan Kaya <okaya@...nel.org>, Ethan Zhao <haifeng.zhao@...el.com>,
Bjorn Helgaas <bhelgaas@...gle.com>, Oliver <oohall@...il.com>,
ruscur@...sell.cc,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Stuart Hayes <stuart.w.hayes@...il.com>,
Alexandru Gagniuc <mr.nuke.me@...il.com>,
Mika Westerberg <mika.westerberg@...ux.intel.com>,
Keith Busch <keith.busch@...el.com>,
linux-pci <linux-pci@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
"Jia, Pei P" <pei.p.jia@...el.com>, ashok.raj@...ux.intel.com,
Sathyanarayanan Kuppuswamy <sathyanarayanan.kuppuswamy@...el.com>
Subject: Re: [PATCH 2/5 V2] PCI: pciehp: check and wait port status out of DPC
before handling DLLSC and PDC
On Tue, Sep 29, 2020 at 6:08 PM Lukas Wunner <lukas@...ner.de> wrote:
>
> On Tue, Sep 29, 2020 at 05:46:41PM +0800, Ethan Zhao wrote:
> > On Tue, Sep 29, 2020 at 4:29 PM Lukas Wunner <lukas@...ner.de> wrote:
> > > On Sun, Sep 27, 2020 at 11:27:46AM -0400, Sinan Kaya wrote:
> > > > On 9/26/2020 11:28 PM, Ethan Zhao wrote:
> > > > > --- a/drivers/pci/hotplug/pciehp_hpc.c
> > > > > +++ b/drivers/pci/hotplug/pciehp_hpc.c
> > > > > @@ -710,8 +710,10 @@ static irqreturn_t pciehp_ist(int irq, void *dev_id)
> > > > > down_read(&ctrl->reset_lock);
> > > > > if (events & DISABLE_SLOT)
> > > > > pciehp_handle_disable_request(ctrl);
> > > > > - else if (events & (PCI_EXP_SLTSTA_PDC | PCI_EXP_SLTSTA_DLLSC))
> > > > > + else if (events & (PCI_EXP_SLTSTA_PDC | PCI_EXP_SLTSTA_DLLSC)) {
> > > > > + pci_wait_port_outdpc(pdev);
> > > > > pciehp_handle_presence_or_link_change(ctrl, events);
> > > > > + }
> > > > > up_read(&ctrl->reset_lock);
> > > >
> > > > This looks like a hack TBH.
> [...]
> > > > Why is device lock not protecting this situation?
> > > > Is there a lock missing in hotplug driver?
> > >
> > > According to Ethan's commit message, there are two issues here:
> > > One, that pciehp may remove a device even though DPC recovered the error,
> > > and two, that a null pointer deref occurs.
> > >
> > > The latter is most certainly not a locking issue but failure of DPC
> > > to hold a reference on the pci_dev.
> >
> > This is what patch 3/5 proposed to fix.
>
> Please reorder the series to fix the null pointer deref first,
> i.e. move patch 3 before patch 2. If the null pointer deref is
> fixed by patch 3, do not mention it in patch 2.
Make sense.
Thanks,
Ethan
>
> Thanks,
>
> Lukas
Powered by blists - more mailing lists