lkml.org 
[lkml]   [2017]   [Oct]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 8/8] PCI: pciehp: Check that the device is really present before touching it
On Fri, Oct 20, 2017 at 04:15:02PM -0500, Bjorn Helgaas wrote:
> > +
> > + /* Check if the device is really there anymore */
> > + present = presence ? pci_device_is_present(dev) : false;
> > +
> > + if (dev->hdr_type == PCI_HEADER_TYPE_BRIDGE && present) {
> > pci_read_config_byte(dev, PCI_BRIDGE_CONTROL, &bctl);
>
> I don't like this fix because it's still racy. We always have to be deal
> with a config read that returns 0xffffffff, even if we previously checked
> pci_device_is_present(). The device might have disappeared in the interim.

That's a fair point. I guess it is better just to check if bctl holds
0xffff before we decide it is a display device.

I'll rework this patch and send an updated version separately.

\
 
 \ /
  Last update: 2017-10-23 13:14    [W:0.037 / U:4.540 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site