Re: [PATCH v2 3/4] ACPI / scan: Recognize Apple SPI and I2C slaves

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jun 29, 2017 at 10:34:20AM +0300, Mika Westerberg wrote:
> On Wed, Jun 28, 2017 at 07:20:19PM +0200, Lukas Wunner wrote:
> > --- a/drivers/acpi/scan.c
> > +++ b/drivers/acpi/scan.c
> > @@ -1444,6 +1444,12 @@ static bool acpi_is_spi_i2c_slave(struct acpi_device *device)
> >  	struct list_head resource_list;
> >  	bool is_spi_i2c_slave = false;
> >  
> > +	/* Macs use device properties in lieu of _CRS resources */
> > +	if (IS_ENABLED(CONFIG_X86) && dmi_match(DMI_SYS_VENDOR, "Apple Inc.") &&
> 
> Do we really need these checks?

With these checks present, searching for the properties can be optimized
away on ARM and skipped on x86 non-Macs.  (Each property query requires
decoding the _DSD Package and performing an O(n) search of the properties.)

So I'd say yes?

Thanks,

Lukas

> 
> > +	    (device_property_present(&device->dev, "spiSclkPeriod") ||
> > +	     device_property_present(&device->dev, "i2cAddress")))
> > +		return true;
> > +
> >  	INIT_LIST_HEAD(&resource_list);
> >  	acpi_dev_get_resources(device, &resource_list, acpi_check_spi_i2c_slave,
> >  			       &is_spi_i2c_slave);
> > -- 
> > 2.11.0
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux