From mboxrd@z Thu Jan 1 00:00:00 1970 From: Zhang Rui Subject: [PATCH V7 00/11] ACPI: ACPI enumeration rework Date: Fri, 23 May 2014 02:02:22 +0800 Message-ID: <1400781753-2682-1-git-send-email-rui.zhang@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Received: from mga02.intel.com ([134.134.136.20]:39528 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751057AbaEVSCk (ORCPT ); Thu, 22 May 2014 14:02:40 -0400 Sender: linux-acpi-owner@vger.kernel.org List-Id: linux-acpi@vger.kernel.org To: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: bhelgaas@google.com, matthew.garrett@nebula.com, rafael.j.wysocki@intel.com, dmitry.torokhov@gmail.com, mika.westerberg@linux.intel.com, Zhang Rui Hi, all, Currently, PNP bus is used as the default bus for for enumerating ACPI devices with _HID/_CID. =46or a device that needs to be enumerated to platform bus, we need to = add its id string to the platform scan handler white list explicitly. This becomes a problem as more and more _HID devices need to be enumerated to platform bus nowadays, thus the list is continuously grow= ing. So, a solution that uses platform bus for _HID enumeration by default is preferred. In order to do this, this patch set =46irst (Patch 1~4), changes the way of enumerating PNP devices. We introduce a white list to create PNP devices instead. The white list= contains all the pnp_device_id strings in all the pnp drivers, thus this change = is transparent to PNP core and all the PNP drivers. Second (Patch 5~11), changes the code to enumerate ACPI _HID devices to= platform bus by default. Tis patch set has been tested on my desktop machine, and a TOSHIBA PORTEGE Z830 ultrabook. Clarification: Although it seems that we are introducing a much bigger white list to r= eplace a small one, the benefit is that 1. without the patch, the acpi_platform scan handler white list is =C2=A0=C2=A0 continuously growing. 2. with the patch set, the PNPACPI scan handler white list will become =C2=A0=C2=A0 smaller and smaller by =C2=A0=C2=A0 a) remove the ids from the PNPACPI white list, for the dev= ices =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 that are never enumerated via ACPI =C2=A0=C2=A0 b) remove the ids from the PNPACPI whilte list and convert= the drivers to =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 platform bus drivers, for the devices th= at are not PNP devices in nature. =C2=A0=C2=A0 which will be done later. Known Issue: PNP bus does not check the device resources when adding a new PNP devic= e, while Platform bus does by invoking insert_resource() in platform_devic= e_add(). This results in failure when creating platform device node for some ACP= I device objects in case there is resource conflict. In my desktop, I can see that Creating PNP0C02:02 fails because its resource (IO: 0x72 ~ 0x7f) conflicts with "0070-0077 : PNP0B00:00" (CMOS RTC). Known Issue: Currently, we can't enumerate devices with _CID PNP0C01/PNP0C02 to plat= form bus because we need them in PNP bus in order to reserve mother board resour= ces. thanks, rui ---------------------------------------------------------------- Changes in V7: 1. always registering the same scan handler, but with an optional NULL = =2Eattach() callback instead of registering a dummy handler. 2. avoid enumerting SPB slave devices by checking the SPB resources instead of introduing & setting & checking a flag in the SPB master = device. Changes in V6: 1. Patch re-ordering to avoid bisect breakage. 2. rework the patch for fixing the "redudent platform devices created f= or lpss slaves" issue according to Rafael' comments. Changes in V5: 1. fix a problem that ACPI tries to enumerate lpss slaves to platform b= us 2. rebased on 3.14 kernel Changes in V4: 1. coding style cleanups, fix checkpatch warnings/errors. Changes in V3: 1. rename enumerable_id to platform_id according to Rafael' suggestion. 2. drop two patches to handle devices with _CID PNP0C01/PNP0C02 enumera= tion =C2=A0=C2=A0 because the code in drivers/pnp/system.c is still under di= scussion. 3. make cmos rtc scan handler return 1 so that the device will not be =C2=A0=C2=A0 enumerated to platform bus. Changes in V2: 1.move acpi pnp scan handler from drivers/pnp/pnpacpi/core.c to =C2=A0 drivers/acpi/acpi-pnp.c, because the scan handler needs to be al= ways built =C2=A0 in to prevent platform devices from being created for those ACPI= devices. 2.remove the __init tag for the acpi pnp scan handler because the scan =C2=A0 handler is still needed after system initialization, for hotplug= =2E 3.introduce enumerable_id flag for devices that can be enumerated to pl= atform =C2=A0 bus. 4.introduce excluded id list for creating platform devices, because som= e =C2=A0 devices have _HID but they will never be associated with a platf= orm driver. 5.introduce dummy lpss/container/memory_hotplug scan handler to prevent =C2=A0 platform devices from being created for those ACPI device object= s. ---------------------------------------------------------------- Zhang Rui (11): ACPI: introduce .match() callback for ACPI scan handler PNPACPI: use whilte list for pnpacpi device enumeration ACPI: remove ids that does not comply with the ACPI PNP id rule ACPI: remove unsupported serial PNP ids from acpi pnp scan handle= r id lsit ACPI: allow scan handlers without .attach() callback ACPI: always register container scan handler even if CONFIG_ACPI_= CONTAINER is cleared ACPI: always register memory hotplug scan handler even if CONFIG_= ACPI_HOTPLUG_MEMORY is cleared ACPI: always register memory hotplug scan handler even if CONFIG_= X86_INTEL_LPSS is cleared ACPI: introduce platform_id flag ACPI: use platform bus as the default bus for _HID enumeration ACPI: introduce acpi platform exclude id list drivers/acpi/Makefile | 7 ++-- drivers/acpi/acpi_cmos_rtc.c | 2 +- drivers/acpi/acpi_lpss.c | 63 ++++++++++++++++++---------- drivers/acpi/acpi_memhotplug.c | 46 ++++++++++---------- drivers/acpi/acpi_platform.c | 39 ++++++----------- drivers/acpi/acpi_pnp.c | 382 +++++++++++++++++++++++++++++++++= +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++= ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ drivers/acpi/container.c | 18 +++++--- drivers/acpi/internal.h | 15 +------ drivers/acpi/scan.c | 83 +++++++++++++++++++++++++++++++--= --- drivers/pnp/pnpacpi/core.c | 28 ++----------- include/acpi/acpi_bus.h | 4 +- include/linux/acpi.h | 2 + 12 files changed, 560 insertions(+), 129 deletions(-) create mode 100644 drivers/acpi/acpi_pnp.c -- To unsubscribe from this list: send the line "unsubscribe linux-acpi" i= n the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html