From patchwork Sat Nov 21 20:30:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 11923623 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9BD85C388F9 for ; Sat, 21 Nov 2020 20:31:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5BF1821D7E for ; Sat, 21 Nov 2020 20:31:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="HkrT/Ciu" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728503AbgKUUar (ORCPT ); Sat, 21 Nov 2020 15:30:47 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:39138 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728402AbgKUUar (ORCPT ); Sat, 21 Nov 2020 15:30:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605990646; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=/nTqVVP0uahNJ0Vi39exTUckgy0BekWuMmxre6Vsres=; b=HkrT/Ciu5xzotOIaB61Mht6EEOJTM35499NDo0n1g/evJ1FEsy6/ifwKBB0hSrhkT6E3aJ kPzqblMPDsdnTzGAfPuKFfgcp/JU06prSlADSJ+Bwx8v0AdH5FFUomthGT9c8HtrSJwqv1 EGA3McCG05L4xnAOFytViKJPrk8FmfU= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-299-kLbre_OuMU655pTZoK3Yww-1; Sat, 21 Nov 2020 15:30:44 -0500 X-MC-Unique: kLbre_OuMU655pTZoK3Yww-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id AEDFE51DE; Sat, 21 Nov 2020 20:30:43 +0000 (UTC) Received: from x1.localdomain (ovpn-112-24.ams2.redhat.com [10.36.112.24]) by smtp.corp.redhat.com (Postfix) with ESMTP id B733718E4F; Sat, 21 Nov 2020 20:30:42 +0000 (UTC) From: Hans de Goede To: "Rafael J . Wysocki" , Len Brown Cc: Hans de Goede , linux-acpi@vger.kernel.org Subject: [PATCH 1/7] ACPI: scan: Add an acpi_info_matches_hids() helper Date: Sat, 21 Nov 2020 21:30:34 +0100 Message-Id: <20201121203040.146252-2-hdegoede@redhat.com> In-Reply-To: <20201121203040.146252-1-hdegoede@redhat.com> References: <20201121203040.146252-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org acpi_device_dep_initialize() skips _DEPS with a HID of "INT3396" and checks this using an acpi_device_info struct. The upcoming changes splitting the scanning of the root into 2 steps, deferring the addition of some devices which need access to OpRegions of other devices during scanning to the second step, need to extend the HIDs to skip during _DEP checking to a list of HIDs; and need to check an acpi_device_info struct against a list of HIDs in more places. Add an acpi_info_matches_hids() helper which checks a list of HIDs for this and switch acpi_device_dep_initialize() over to this helper. Signed-off-by: Hans de Goede --- drivers/acpi/scan.c | 30 +++++++++++++++++++++++------- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index bc6a79e33220..e949265d5667 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -719,6 +719,28 @@ int acpi_device_add(struct acpi_device *device, /* -------------------------------------------------------------------------- Device Enumeration -------------------------------------------------------------------------- */ +static bool acpi_info_matches_hids(struct acpi_device_info *info, + const char * const hids[]) +{ + int i; + + if (!(info->valid & ACPI_VALID_HID)) + return false; + + for (i = 0; hids[i]; i++) { + if (!strcmp(info->hardware_id.string, hids[i])) + return true; + } + + return false; +} + +/* List of HIDs for which we ignore matching ACPI devices, when checking _DEP lists. */ +static const char * const acpi_ignore_dep_hids[] = { + "INT3396", /* Windows System Power Management Controller */ + NULL +}; + static struct acpi_device *acpi_bus_get_parent(acpi_handle handle) { struct acpi_device *device = NULL; @@ -1833,13 +1855,7 @@ static void acpi_device_dep_initialize(struct acpi_device *adev) continue; } - /* - * Skip the dependency of Windows System Power - * Management Controller - */ - skip = info->valid & ACPI_VALID_HID && - !strcmp(info->hardware_id.string, "INT3396"); - + skip = acpi_info_matches_hids(info, acpi_ignore_dep_hids); kfree(info); if (skip) From patchwork Sat Nov 21 20:30:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 11923629 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E3076C5519F for ; Sat, 21 Nov 2020 20:31:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AB5EB21D7E for ; Sat, 21 Nov 2020 20:31:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="hIY4dXNG" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728456AbgKUUat (ORCPT ); Sat, 21 Nov 2020 15:30:49 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:27229 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728402AbgKUUat (ORCPT ); Sat, 21 Nov 2020 15:30:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605990647; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=M8Me/ZKPPF3zHjqioJTPV/mhYjuAHDncmz5kt3IdLmo=; b=hIY4dXNGpp0DRok1JGASwP4j0bm7eMwt148yRzrna3uv3NlRNK0bInlN8cL404qBNhazPF cg9p97039NcStVzaIuBFP4rK38XLTQDnvclrdU9PzO/oyqZqKI5f9jYORIdGnbSHG5n0SN XTTvMxycNt9pU7Zm69ijlyBAdwi20To= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-20-kO15xLITPMGmTchSb3TNPA-1; Sat, 21 Nov 2020 15:30:46 -0500 X-MC-Unique: kO15xLITPMGmTchSb3TNPA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E658E1005D70; Sat, 21 Nov 2020 20:30:44 +0000 (UTC) Received: from x1.localdomain (ovpn-112-24.ams2.redhat.com [10.36.112.24]) by smtp.corp.redhat.com (Postfix) with ESMTP id 016841C936; Sat, 21 Nov 2020 20:30:43 +0000 (UTC) From: Hans de Goede To: "Rafael J . Wysocki" , Len Brown Cc: Hans de Goede , linux-acpi@vger.kernel.org Subject: [PATCH 2/7] ACPI: scan: Call acpi_get_object_info() from acpi_add_single_object() Date: Sat, 21 Nov 2020 21:30:35 +0100 Message-Id: <20201121203040.146252-3-hdegoede@redhat.com> In-Reply-To: <20201121203040.146252-1-hdegoede@redhat.com> References: <20201121203040.146252-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Call acpi_get_object_info() from acpi_add_single_object() instead of calling it from acpi_set_pnp_ids() and pass the result down to the acpi_set_pnp_ids() call. This is a preparation patch for splitting the scanning of the root into 2 steps, deferring the addition of some devices which need access to OpRegions of other devices during scanning to the second step. Having the acpi_device_info available earlier is useful for making the decision on whether to defer the device addition or not, without needing to make a second acpi_get_object_info() call. Signed-off-by: Hans de Goede --- drivers/acpi/internal.h | 3 ++- drivers/acpi/power.c | 2 +- drivers/acpi/scan.c | 22 ++++++++++++---------- 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/drivers/acpi/internal.h b/drivers/acpi/internal.h index e3638bafb941..cb229e24c563 100644 --- a/drivers/acpi/internal.h +++ b/drivers/acpi/internal.h @@ -105,7 +105,8 @@ struct acpi_device_bus_id { int acpi_device_add(struct acpi_device *device, void (*release)(struct device *)); void acpi_init_device_object(struct acpi_device *device, acpi_handle handle, - int type, unsigned long long sta); + int type, unsigned long long sta, + struct acpi_device_info *info); int acpi_device_setup_files(struct acpi_device *dev); void acpi_device_remove_files(struct acpi_device *dev); void acpi_device_add_finalize(struct acpi_device *device); diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c index 8048da85b7e0..189a0d4c6d06 100644 --- a/drivers/acpi/power.c +++ b/drivers/acpi/power.c @@ -939,7 +939,7 @@ int acpi_add_power_resource(acpi_handle handle) device = &resource->device; acpi_init_device_object(device, handle, ACPI_BUS_TYPE_POWER, - ACPI_STA_DEFAULT); + ACPI_STA_DEFAULT, NULL); mutex_init(&resource->resource_lock); INIT_LIST_HEAD(&resource->list_node); INIT_LIST_HEAD(&resource->dependents); diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index e949265d5667..25a46ae24229 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -1258,10 +1258,8 @@ static bool acpi_object_is_system_bus(acpi_handle handle) } static void acpi_set_pnp_ids(acpi_handle handle, struct acpi_device_pnp *pnp, - int device_type) + int device_type, struct acpi_device_info *info) { - acpi_status status; - struct acpi_device_info *info; struct acpi_pnp_device_id_list *cid_list; int i; @@ -1272,8 +1270,7 @@ static void acpi_set_pnp_ids(acpi_handle handle, struct acpi_device_pnp *pnp, break; } - status = acpi_get_object_info(handle, &info); - if (ACPI_FAILURE(status)) { + if (!info) { pr_err(PREFIX "%s: Error reading device info\n", __func__); return; @@ -1298,8 +1295,6 @@ static void acpi_set_pnp_ids(acpi_handle handle, struct acpi_device_pnp *pnp, if (info->valid & ACPI_VALID_CLS) acpi_add_id(pnp, info->class_code.string); - kfree(info); - /* * Some devices don't reliably have _HIDs & _CIDs, so add * synthetic HIDs to make sure drivers can find them. @@ -1605,7 +1600,8 @@ static bool acpi_device_enumeration_by_parent(struct acpi_device *device) } void acpi_init_device_object(struct acpi_device *device, acpi_handle handle, - int type, unsigned long long sta) + int type, unsigned long long sta, + struct acpi_device_info *info) { INIT_LIST_HEAD(&device->pnp.ids); device->device_type = type; @@ -1614,7 +1610,7 @@ void acpi_init_device_object(struct acpi_device *device, acpi_handle handle, device->fwnode.ops = &acpi_device_fwnode_ops; acpi_set_device_status(device, sta); acpi_device_get_busid(device); - acpi_set_pnp_ids(handle, &device->pnp, type); + acpi_set_pnp_ids(handle, &device->pnp, type, info); acpi_init_properties(device); acpi_bus_get_flags(device); device->flags.match_driver = false; @@ -1642,14 +1638,20 @@ static int acpi_add_single_object(struct acpi_device **child, int result; struct acpi_device *device; struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; + struct acpi_device_info *info = NULL; + + if (handle != ACPI_ROOT_OBJECT && type == ACPI_BUS_TYPE_DEVICE) + acpi_get_object_info(handle, &info); device = kzalloc(sizeof(struct acpi_device), GFP_KERNEL); if (!device) { printk(KERN_ERR PREFIX "Memory allocation error\n"); + kfree(info); return -ENOMEM; } - acpi_init_device_object(device, handle, type, sta); + acpi_init_device_object(device, handle, type, sta, info); + kfree(info); /* * For ACPI_BUS_TYPE_DEVICE getting the status is delayed till here so * that we can call acpi_bus_get_status() and use its quirk handling. From patchwork Sat Nov 21 20:30:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 11923625 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 22E29C63798 for ; Sat, 21 Nov 2020 20:31:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D389D22202 for ; Sat, 21 Nov 2020 20:31:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="ETQ3AGAO" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728507AbgKUUav (ORCPT ); Sat, 21 Nov 2020 15:30:51 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:39600 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728402AbgKUUau (ORCPT ); Sat, 21 Nov 2020 15:30:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605990649; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=GMA0+aUZIGfOOiA4v/mEkuZjI6/I2qCtVstIf9X8elo=; b=ETQ3AGAOtyICnQk0BPopgYSVf2jd09G/8n43u2T+liYn43gjeG1qZxaNdXnplBfEG/Jh9P Ks/uRbcKobW4MdiVWwG+qGwMCcJ+uZ2WfvErmJhwfdYwyY1cuyB+zWN6s2TMdgueQI7px1 07vmkeObLAStnmco461e5x0QWeeuQ/w= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-382-cJpGY8PnMpq-l9QFVUxiYQ-1; Sat, 21 Nov 2020 15:30:47 -0500 X-MC-Unique: cJpGY8PnMpq-l9QFVUxiYQ-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 46B17803F48; Sat, 21 Nov 2020 20:30:46 +0000 (UTC) Received: from x1.localdomain (ovpn-112-24.ams2.redhat.com [10.36.112.24]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3A2BA18E4F; Sat, 21 Nov 2020 20:30:45 +0000 (UTC) From: Hans de Goede To: "Rafael J . Wysocki" , Len Brown Cc: Hans de Goede , linux-acpi@vger.kernel.org Subject: [PATCH 3/7] ACPI: scan: Add a separate cleanup exit-path to acpi_scan_init() Date: Sat, 21 Nov 2020 21:30:36 +0100 Message-Id: <20201121203040.146252-4-hdegoede@redhat.com> In-Reply-To: <20201121203040.146252-1-hdegoede@redhat.com> References: <20201121203040.146252-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Add a separate cleanup exit-path to acpi_scan_init(). This is a preparation patch for splitting the scanning of the root into 2 steps, deferring the addition of some devices which need access to OpRegions of other devices during scanning to the second step. Signed-off-by: Hans de Goede --- drivers/acpi/scan.c | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 25a46ae24229..7dde66222648 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -2250,27 +2250,31 @@ int __init acpi_scan_init(void) */ result = acpi_bus_scan(ACPI_ROOT_OBJECT); if (result) - goto out; + goto cleanup; result = acpi_bus_get_device(ACPI_ROOT_OBJECT, &acpi_root); if (result) - goto out; + goto cleanup; /* Fixed feature devices do not exist on HW-reduced platform */ if (!acpi_gbl_reduced_hardware) { result = acpi_bus_scan_fixed(); - if (result) { - acpi_detach_data(acpi_root->handle, - acpi_scan_drop_device); - acpi_device_del(acpi_root); - put_device(&acpi_root->dev); - goto out; - } + if (result) + goto cleanup; } acpi_scan_initialized = true; - out: + mutex_unlock(&acpi_scan_lock); + return 0; + +cleanup: + if (acpi_root) { + acpi_detach_data(acpi_root->handle, acpi_scan_drop_device); + acpi_device_del(acpi_root); + put_device(&acpi_root->dev); + } + mutex_unlock(&acpi_scan_lock); return result; } From patchwork Sat Nov 21 20:30:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 11923627 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 405BDC6379D for ; Sat, 21 Nov 2020 20:31:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0843121D7E for ; Sat, 21 Nov 2020 20:31:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="TDP5vhc/" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728512AbgKUUay (ORCPT ); Sat, 21 Nov 2020 15:30:54 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:27375 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728402AbgKUUay (ORCPT ); Sat, 21 Nov 2020 15:30:54 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605990652; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=NS6++THCjQt8F/nyZ7tB/jnyYNnDzYzVyxOVUprHeKU=; b=TDP5vhc/0NYTWWygWm9puQZbb2YA0Ived5Q97gH+SJMLPdaWq5fmWSFH6rURA8/bplLSrs gEWG4s8zxJ9LWARLSG8ZcNCFlOlLxn8saDffzV+LvRj5U4i0KId8LDyPyUEJcBw3zk73Y6 Oy+Cn6lbr33KZKjk8Vi7XWu3AMypIX4= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-103-mdN7A9DWPS2MZGZh6oPhGA-1; Sat, 21 Nov 2020 15:30:50 -0500 X-MC-Unique: mdN7A9DWPS2MZGZh6oPhGA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8B99F809DCC; Sat, 21 Nov 2020 20:30:49 +0000 (UTC) Received: from x1.localdomain (ovpn-112-24.ams2.redhat.com [10.36.112.24]) by smtp.corp.redhat.com (Postfix) with ESMTP id 7457C18E4F; Sat, 21 Nov 2020 20:30:46 +0000 (UTC) From: Hans de Goede To: "Rafael J . Wysocki" , Len Brown Cc: Hans de Goede , linux-acpi@vger.kernel.org Subject: [PATCH 4/7] ACPI: scan: Split root scanning into 2 steps Date: Sat, 21 Nov 2020 21:30:37 +0100 Message-Id: <20201121203040.146252-5-hdegoede@redhat.com> In-Reply-To: <20201121203040.146252-1-hdegoede@redhat.com> References: <20201121203040.146252-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org The ACPI scan code currently does not honor _DEP lists, except for ACPI battery nodes. This is an issue on some devices, where some of the methods used during device-addition may rely on OpRegions of other devices. An example of this is the Acer Switch 10E SW3-016 model. The _HID method of the ACPI node for the UART attached Bluetooth, reads GPIOs to detect the installed wifi chip and update the _HID for the Bluetooth's ACPI node accordingly. The current ACPI scan code calls _HID before the GPIO controller's OpRegions are available, leading to the wrong _HID being used and Bluetooth not working. This splits the scanning into 2 steps, deferring the addition of some devices which need access to OpRegions of other devices during scanning to the second step. This initial implementation takes a very simple approach to identify which devices need to have their device-addition deferred. It uses a static lists of HIDs for this. This list is initially populated with the HID reported for the Bluetooth on the Acer SW3-016. This uses the HID reported when the GPIO OpRegions are not yet available! A more elaborate approach, which actually looks at the _DEP list will be added by a follow up patch. This other approach has a big chance of causing regressions, so for now it will be hidden behind a kernel commandline option. Which is why the KISS approach chosen here is needed to fix the issue at hand, so that things will work OOTB on affected devices. BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=1665610 Signed-off-by: Hans de Goede --- drivers/acpi/scan.c | 65 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 65 insertions(+) diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 7dde66222648..407c8536568b 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -42,6 +42,15 @@ DEFINE_MUTEX(acpi_device_lock); LIST_HEAD(acpi_wakeup_device_list); static DEFINE_MUTEX(acpi_hp_context_lock); +/* + * Variables for the new 2 step scan scheme: + * Step 1. Add all devices for which acpi_should_defer_add() returns false + * Step 2. Add devices deferred during phase 1. + * These are protected by the acpi_scan_lock. + */ +static bool acpi_check_defer_add; +static LIST_HEAD(acpi_deferred_devices); + /* * The UART device described by the SPCR table is the only object which needs * special-casing. Everything else is covered by ACPI namespace paths in STAO @@ -55,6 +64,11 @@ struct acpi_dep_data { acpi_handle slave; }; +struct acpi_deferred_dev { + struct list_head node; + acpi_handle handle; +}; + void acpi_scan_lock_acquire(void) { mutex_lock(&acpi_scan_lock); @@ -741,6 +755,16 @@ static const char * const acpi_ignore_dep_hids[] = { NULL }; +/* + * List of HIDs for which we defer adding them to the second step of the + * scanning of the root, because some of their methods used during addition + * depend on OpRegions registered by the drivers for other ACPI devices. + */ +static const char * const acpi_defer_add_hids[] = { + "BCM2E5B", /* Acer SW3-016 bluetooth HID when GPIO OpRegs or not available yet */ + NULL +}; + static struct acpi_device *acpi_bus_get_parent(acpi_handle handle) { struct acpi_device *device = NULL; @@ -1631,18 +1655,42 @@ void acpi_device_add_finalize(struct acpi_device *device) kobject_uevent(&device->dev.kobj, KOBJ_ADD); } +static bool acpi_should_defer_add(acpi_handle handle, struct acpi_device_info *info) +{ + if (!acpi_check_defer_add || !info) + return false; + + if (acpi_info_matches_hids(info, acpi_defer_add_hids)) + return true; + + return false; +} + static int acpi_add_single_object(struct acpi_device **child, acpi_handle handle, int type, unsigned long long sta) { int result; struct acpi_device *device; + struct acpi_deferred_dev *deferred_dev; struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; struct acpi_device_info *info = NULL; if (handle != ACPI_ROOT_OBJECT && type == ACPI_BUS_TYPE_DEVICE) acpi_get_object_info(handle, &info); + if (acpi_should_defer_add(handle, info)) { + kfree(info); + + deferred_dev = kzalloc(sizeof(*deferred_dev), GFP_KERNEL); + if (!deferred_dev) + return -ENOMEM; + + deferred_dev->handle = handle; + list_add_tail(&deferred_dev->node, &acpi_deferred_devices); + return -EPROBE_DEFER; + } + device = kzalloc(sizeof(struct acpi_device), GFP_KERNEL); if (!device) { printk(KERN_ERR PREFIX "Memory allocation error\n"); @@ -2201,6 +2249,7 @@ int __init acpi_scan_init(void) int result; acpi_status status; struct acpi_table_stao *stao_ptr; + struct acpi_deferred_dev *deferred_dev, *tmp; acpi_pci_root_init(); acpi_pci_link_init(); @@ -2248,7 +2297,9 @@ int __init acpi_scan_init(void) /* * Enumerate devices in the ACPI namespace. */ + acpi_check_defer_add = true; result = acpi_bus_scan(ACPI_ROOT_OBJECT); + acpi_check_defer_add = false; if (result) goto cleanup; @@ -2256,6 +2307,15 @@ int __init acpi_scan_init(void) if (result) goto cleanup; + list_for_each_entry_safe(deferred_dev, tmp, &acpi_deferred_devices, node) { + result = acpi_bus_scan(deferred_dev->handle); + if (result) + goto cleanup; + + list_del(&deferred_dev->node); + kfree(deferred_dev); + } + /* Fixed feature devices do not exist on HW-reduced platform */ if (!acpi_gbl_reduced_hardware) { result = acpi_bus_scan_fixed(); @@ -2275,6 +2335,11 @@ int __init acpi_scan_init(void) put_device(&acpi_root->dev); } + list_for_each_entry_safe(deferred_dev, tmp, &acpi_deferred_devices, node) { + list_del(&deferred_dev->node); + kfree(deferred_dev); + } + mutex_unlock(&acpi_scan_lock); return result; } From patchwork Sat Nov 21 20:30:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 11923631 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6625CC6379F for ; Sat, 21 Nov 2020 20:31:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2FC2122201 for ; Sat, 21 Nov 2020 20:31:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="SWzVfoZ6" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728402AbgKUUaz (ORCPT ); Sat, 21 Nov 2020 15:30:55 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:28787 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728511AbgKUUaz (ORCPT ); Sat, 21 Nov 2020 15:30:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605990653; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qIFpuxY58mNlSwyojr2EBGs0nBeW01lQD7+vcwPzDfk=; b=SWzVfoZ6zNLlOkk9fJwK0aNxLZvRXbCRBDT6GO0Gs/49hx4LchCIIzu0+hEE6sYb+Rkjy0 k81cOs8bRfd+zeJ3TcGXGN6FJ8CsidKrXhWCw9s34JB2bI/BvckyEHQBONsajgNw9BprTZ cHNulgCFbqpsrQR4QcktdoriAK00ZhM= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-522-WQ4DSXzMN_2V04SP7tlOfA-1; Sat, 21 Nov 2020 15:30:51 -0500 X-MC-Unique: WQ4DSXzMN_2V04SP7tlOfA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id C0CDD803F41; Sat, 21 Nov 2020 20:30:50 +0000 (UTC) Received: from x1.localdomain (ovpn-112-24.ams2.redhat.com [10.36.112.24]) by smtp.corp.redhat.com (Postfix) with ESMTP id D164818E4F; Sat, 21 Nov 2020 20:30:49 +0000 (UTC) From: Hans de Goede To: "Rafael J . Wysocki" , Len Brown Cc: Hans de Goede , linux-acpi@vger.kernel.org Subject: [PATCH 5/7] ACPI: scan: Add support for deferring adding devices to the second scan phase based on the _DEP list Date: Sat, 21 Nov 2020 21:30:38 +0100 Message-Id: <20201121203040.146252-6-hdegoede@redhat.com> In-Reply-To: <20201121203040.146252-1-hdegoede@redhat.com> References: <20201121203040.146252-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org The current solution, of deferring adding of some devices because they need access during the OpRegions of other devices while they are added, is not very generic. And support for making the decision to defer adding a device based on its _DEP list, instead of the device's HID being in a fixed list of HIDs to defer, which should be a more generic way to deal with this. Since this is likely to cause issues on some hardware, this new method will only be used if the new acpi.defer_scan_based_on_dep kernel commandline option is set to 1. Signed-off-by: Hans de Goede --- drivers/acpi/scan.c | 45 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 407c8536568b..9927036bfe77 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -31,6 +31,11 @@ extern struct acpi_device *acpi_root; #define INVALID_ACPI_HANDLE ((acpi_handle)empty_zero_page) +static int defer_scan_based_on_dep = -1; +module_param(defer_scan_based_on_dep, int, 0444); +MODULE_PARM_DESC(defer_scan_based_on_dep, + "Use new scan-scheme deferring addition of devices with non empty _DEP list (-1=auto, 0=no, 1=yes)"); + static const char *dummy_hid = "device"; static LIST_HEAD(acpi_dep_list); @@ -1657,11 +1662,45 @@ void acpi_device_add_finalize(struct acpi_device *device) static bool acpi_should_defer_add(acpi_handle handle, struct acpi_device_info *info) { + struct acpi_handle_list dep_devices; + acpi_status status; + int i; + if (!acpi_check_defer_add || !info) return false; - if (acpi_info_matches_hids(info, acpi_defer_add_hids)) + if (!defer_scan_based_on_dep) + return acpi_info_matches_hids(info, acpi_defer_add_hids); + + /* + * We check for _ADR here to avoid deferring the adding of the following: + * 1. PCI devices + * 2. ACPI nodes describing USB ports + * Note checking for _ADR catches more then just these cases... + */ + if (info->valid & ACPI_VALID_ADR) + return false; + + status = acpi_evaluate_reference(handle, "_DEP", NULL, &dep_devices); + if (ACPI_FAILURE(status)) + return false; + + for (i = 0; i < dep_devices.count; i++) { + struct acpi_device_info *dep_info; + bool ignore; + + status = acpi_get_object_info(dep_devices.handles[i], &dep_info); + if (ACPI_FAILURE(status)) + continue; + + ignore = acpi_info_matches_hids(dep_info, acpi_ignore_dep_hids); + kfree(dep_info); + + if (ignore) + continue; + return true; + } return false; } @@ -2251,6 +2290,10 @@ int __init acpi_scan_init(void) struct acpi_table_stao *stao_ptr; struct acpi_deferred_dev *deferred_dev, *tmp; + /* Currently no devices are known which need _dep based scan deferral */ + if (defer_scan_based_on_dep == -1) + defer_scan_based_on_dep = 0; + acpi_pci_root_init(); acpi_pci_link_init(); acpi_processor_init(); From patchwork Sat Nov 21 20:30:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 11923637 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C6D17C64E69 for ; Sat, 21 Nov 2020 20:31:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7CF5D22201 for ; Sat, 21 Nov 2020 20:31:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="d/+14aWH" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728511AbgKUUa6 (ORCPT ); Sat, 21 Nov 2020 15:30:58 -0500 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:29978 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728513AbgKUUa6 (ORCPT ); Sat, 21 Nov 2020 15:30:58 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605990657; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=dyjf7FFerAvyZSPO4iKB95U5xXwVD361EL2BnSebQWM=; b=d/+14aWHyBq2YdTSvFxfOuhuWLxrAvwPN0Xpbvyk01pdYbQmRLuVO+bGwZdMZTvjrbgOnn ljU+1Q/CyFaSWLPFU+r743+hxTO3cY3ezYt0m3sck7f+Qzm5b8fkZVmiWocoNKYREgsmu4 SFJgHoTjyCqVm81AeWkQTPkmBVnM0lk= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-21-ihjPTvcUNcyREoSM24Jdlg-1; Sat, 21 Nov 2020 15:30:53 -0500 X-MC-Unique: ihjPTvcUNcyREoSM24Jdlg-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 094CF1005D6B; Sat, 21 Nov 2020 20:30:52 +0000 (UTC) Received: from x1.localdomain (ovpn-112-24.ams2.redhat.com [10.36.112.24]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1734318E4F; Sat, 21 Nov 2020 20:30:50 +0000 (UTC) From: Hans de Goede To: "Rafael J . Wysocki" , Len Brown Cc: Hans de Goede , linux-acpi@vger.kernel.org Subject: [PATCH 6/7] ACPI: scan: Fix battery devices not working with acpi.defer_scan_based_on_dep=1 Date: Sat, 21 Nov 2020 21:30:39 +0100 Message-Id: <20201121203040.146252-7-hdegoede@redhat.com> In-Reply-To: <20201121203040.146252-1-hdegoede@redhat.com> References: <20201121203040.146252-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org When battery devices get added during the second step of the now 2 step scan-process, then acpi_walk_dep_device_list() may have already been called for some deps during the first step. In this case acpi_device_dep_initialize() should not add these deps to the acpi_dep_list; and it should not increase adev->dep_unmet. Add a check for already registered (and bound to a driver) devices to acpi_device_dep_initialize(). This fixes battery devices (which honor the dep_unmet value) not working with acpi.defer_scan_based_on_dep=1. Signed-off-by: Hans de Goede --- drivers/acpi/scan.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 9927036bfe77..44001610f6a4 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -17,6 +17,8 @@ #include #include +#include "acpica/accommon.h" +#include "acpica/acnamesp.h" #include "internal.h" #define _COMPONENT ACPI_BUS_COMPONENT @@ -1935,7 +1937,10 @@ static void acpi_device_dep_initialize(struct acpi_device *adev) } for (i = 0; i < dep_devices.count; i++) { + struct acpi_device *dep_adev = NULL; + struct acpi_namespace_node *node; struct acpi_device_info *info; + struct device *dep_dev; int skip; status = acpi_get_object_info(dep_devices.handles[i], &info); @@ -1950,6 +1955,30 @@ static void acpi_device_dep_initialize(struct acpi_device *adev) if (skip) continue; + /* + * Skip devices which already have a driver bound + * and thus are already available for use. + * We only need to do this during the second scan step, + * when acpi_check_defer_add == false. + */ + if (!acpi_check_defer_add) { + /* + * Cannot call acpi_bus_get_device here as we are called + * with ACPI_MTX_NAMESPACE held. + */ + node = acpi_ns_validate_handle(dep_devices.handles[i]); + if (!node) + continue; /* Should never happen */ + + status = acpi_ns_get_attached_data(node, acpi_scan_drop_device, + (void **)&dep_adev); + if (ACPI_SUCCESS(status) && dep_adev) { + dep_dev = acpi_get_first_physical_node(dep_adev); + if (dep_dev && dep_dev->driver) + continue; + } + } + dep = kzalloc(sizeof(struct acpi_dep_data), GFP_KERNEL); if (!dep) return; From patchwork Sat Nov 21 20:30:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 11923633 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8EA29C64E75 for ; Sat, 21 Nov 2020 20:31:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 59C2C21D7E for ; Sat, 21 Nov 2020 20:31:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="ge+90bAE" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728514AbgKUUa6 (ORCPT ); Sat, 21 Nov 2020 15:30:58 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:20214 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728511AbgKUUa5 (ORCPT ); Sat, 21 Nov 2020 15:30:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1605990656; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Fep8DCqOArUWxlXgL6bYOBw/BAGxDrrFI4it7tfDd1Y=; b=ge+90bAEOTKkCL1djAkAoJN2jn0yKqeGjC44v2tFwXZiDqhsF7szB/VxuFCIOQt2Wr2N7P A2anuuw5RmD/uQ1ac0MvCpOiRGzCnXAov3wXmqRSdfz9CL6BDzrDatm6L7G1Ig2wv9soaQ UutLQxFmNL+EtJgykMMJKBLRvIyjGMc= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-510-4MKHtsUOPU60XzWs0JKAyA-1; Sat, 21 Nov 2020 15:30:54 -0500 X-MC-Unique: 4MKHtsUOPU60XzWs0JKAyA-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 40B6B1005D65; Sat, 21 Nov 2020 20:30:53 +0000 (UTC) Received: from x1.localdomain (ovpn-112-24.ams2.redhat.com [10.36.112.24]) by smtp.corp.redhat.com (Postfix) with ESMTP id 4EFC01C959; Sat, 21 Nov 2020 20:30:52 +0000 (UTC) From: Hans de Goede To: "Rafael J . Wysocki" , Len Brown Cc: Hans de Goede , linux-acpi@vger.kernel.org Subject: [PATCH 7/7] ACPI: scan: Add some HIDs which are never bound on Cherry Trail devices to acpi_ignore_dep_hids Date: Sat, 21 Nov 2020 21:30:40 +0100 Message-Id: <20201121203040.146252-8-hdegoede@redhat.com> In-Reply-To: <20201121203040.146252-1-hdegoede@redhat.com> References: <20201121203040.146252-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Add some HIDs which are found on Cherry Trail devices and which Linux never bounds to acpi_ignore_dep_hids. This allows all root level ACPI devices to be instantiated during step one of scanning the ACPI root. Note this is not strictly necessary, at least not on the one Cherry Trail device this has been tested on so far. Signed-off-by: Hans de Goede --- drivers/acpi/scan.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 44001610f6a4..218a6e9e560e 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -759,6 +759,8 @@ static bool acpi_info_matches_hids(struct acpi_device_info *info, /* List of HIDs for which we ignore matching ACPI devices, when checking _DEP lists. */ static const char * const acpi_ignore_dep_hids[] = { "INT3396", /* Windows System Power Management Controller */ + "INT33A4", /* Windows System Power Management Controller */ + "INT33BD", /* Intel Baytrail Mailbox Device */ NULL };