Received: by 10.223.176.46 with SMTP id f43csp285001wra; Tue, 23 Jan 2018 21:03:52 -0800 (PST) X-Google-Smtp-Source: AH8x224LzvBmxBXFKOQt9dJ4XL2v6MYwqOYGm6MIUBlP99bZnGjEhNj84ODKeSdv/QfoLEiW6u/R X-Received: by 10.99.124.24 with SMTP id x24mr9838643pgc.351.1516770232284; Tue, 23 Jan 2018 21:03:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1516770232; cv=none; d=google.com; s=arc-20160816; b=krv2CzlA/YQN0sqkCCgAoC09f3b2qu+IbA49/moCTDkEyKyJr8EBGuFBckJhvZliCH 1MdyDjr0fJocsmXJi99HBzK/qZWG7Fv66AmD4EhgUfQn6K0fDv1LaAo8JEWbo6xiapN2 jsFrLxYqszCsU0MbIptXRCgMF2wYi2XmWQAZZ8eex7rkrkvcgCPXdWIj7LglzjMXr+NC tm8/gB6SYk6wBv5YgbpbGVoMf67X0aXXHPc+35z4Ht0o/xegX9kA5caJDAye7Yd3tqTj IMEtUEl2AB+6vaqUcBsueAtGuHTkWSoWOVuYDMDzgARTnOYVCcqZP+yZ7i0qfWYfE2ER i2rQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=8uIhMD3M2zeqLZQnqX0vj5zQXy5LW5pPLluRJuOADxk=; b=Venr8ogns1fFSj/kKXI/xj+NoLY4GlDmjRPtqWhszXJHH6O0vWnYR9MsSmGCQN3AVr Fp4FT6W6zEci09imRI3/xC/8/NyA8DKQLjOraeVH09z5JGj4N9uGckHcFUXyvMj1ofCp ZE08cVOUBAcShj8hjJCANjm1tcRjM6p2AsJEhyDmV+2h+o7ho4ZEWLlf78z8g12RfOA6 hfLYC4EeOs6e3WSeLHwRTvmoRvKs1Cxbqv3f4H8UiE8D3NQhgNHr7xHVNYOmztpjNmtR jANlDcuw6+wA/xMdovXUo/suos/xVX9jbHRGAPtRbIvHhDhLIIuEihnDqyTHVfP1cDh3 YFXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=j5yPnsTO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i135si15622526pgc.459.2018.01.23.21.03.38; Tue, 23 Jan 2018 21:03:52 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=j5yPnsTO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752622AbeAXFCc (ORCPT + 99 others); Wed, 24 Jan 2018 00:02:32 -0500 Received: from mail-sn1nam01on0126.outbound.protection.outlook.com ([104.47.32.126]:36640 "EHLO NAM01-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752703AbeAXEOh (ORCPT ); Tue, 23 Jan 2018 23:14:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=8uIhMD3M2zeqLZQnqX0vj5zQXy5LW5pPLluRJuOADxk=; b=j5yPnsTO0/k3nqk574SN/kHFxF0MLPREoGLK/mHSUm6J6sE5P/lO+I2x+tsnOj1c3expyfEj6prOD/6T/pmfR82feXsvm7l8EdzGQ0lqY7IUKHzLYLVhlzcjZKnOL1gnxTYBynKXgjJ8pjg5Pk0o30+b6nSeAk0u9i4YBxTKRHY= Received: from DM5PR2101MB1032.namprd21.prod.outlook.com (52.132.128.13) by DM5PR2101MB0998.namprd21.prod.outlook.com (52.132.133.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.464.0; Wed, 24 Jan 2018 04:14:35 +0000 Received: from DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::6485:b98:d15e:9da7]) by DM5PR2101MB1032.namprd21.prod.outlook.com ([fe80::6485:b98:d15e:9da7%2]) with mapi id 15.20.0464.000; Wed, 24 Jan 2018 04:14:35 +0000 From: Sasha Levin To: "linux-kernel@vger.kernel.org" , "stable@vger.kernel.org" CC: Hans de Goede , "Rafael J . Wysocki" , Sasha Levin Subject: [PATCH AUTOSEL for 4.14 025/100] ACPI / bus: Leave modalias empty for devices which are not present Thread-Topic: [PATCH AUTOSEL for 4.14 025/100] ACPI / bus: Leave modalias empty for devices which are not present Thread-Index: AQHTlMnX0l5Txhxyq0+FEwkxWtWf9g== Date: Wed, 24 Jan 2018 04:14:35 +0000 Message-ID: <20180124041414.32065-25-alexander.levin@microsoft.com> References: <20180124041414.32065-1-alexander.levin@microsoft.com> In-Reply-To: <20180124041414.32065-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;DM5PR2101MB0998;7:T7ulFVurZh/kXEPbDn1zDNOhqrcc7qawif6UXdkQuav2H+ePYArRPxIz0oypg48VM9fTAbQu2TDOc0TUyF/IJrnfj2lbj2gWmbCjy4SRYwHuSwvc93hZo5KOjkdqjmQtcYIug3nFKLtXdXpgbu/nHp5pkkmvcK0uoy4rZFhYv3JliLP2BYUHmE/AIntUqOR8g5Da0wxZfvl4q0xREg7XV7WSIqGGRSOX8N7k3dsq4mMIJ77qTacgj9x7mKKTz63K x-ms-exchange-antispam-srfa-diagnostics: SSOS;SSOR; x-ms-office365-filtering-correlation-id: 9bfeff32-3b6d-42db-a18c-08d562e0fa62 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(5600026)(4604075)(3008032)(4534165)(4627221)(201703031133081)(201702281549075)(48565401081)(2017052603307)(7193020);SRVR:DM5PR2101MB0998; x-ms-traffictypediagnostic: DM5PR2101MB0998: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(61425038)(6040501)(2401047)(8121501046)(5005006)(93006095)(93001095)(3231046)(2400081)(944501161)(10201501046)(3002001)(6055026)(61426038)(61427038)(6041288)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011);SRVR:DM5PR2101MB0998;BCL:0;PCL:0;RULEID:;SRVR:DM5PR2101MB0998; x-forefront-prvs: 056297E276 x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(366004)(39380400002)(346002)(39860400002)(396003)(376002)(199004)(189003)(14454004)(3660700001)(6346003)(10290500003)(105586002)(66066001)(6506007)(8676002)(22452003)(86612001)(54906003)(10090500001)(81166006)(81156014)(76176011)(110136005)(86362001)(68736007)(106356001)(8936002)(3280700002)(36756003)(25786009)(107886003)(2501003)(99286004)(2906002)(26005)(2950100002)(72206003)(102836004)(305945005)(6116002)(3846002)(5660300001)(4326008)(478600001)(316002)(53936002)(97736004)(575784001)(2900100001)(5250100002)(6512007)(6436002)(6486002)(1076002)(7736002)(22906009)(217873001);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR2101MB0998;H:DM5PR2101MB1032.namprd21.prod.outlook.com;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-message-info: OsaxSqjHMPvrpKpeP/fg0fCP4Qa7Nv/UMPBd9cQsC8SW6g5+gyGNjHcEph+fP91BBoGDfNub5NXeQjb2TayaAQ== spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9bfeff32-3b6d-42db-a18c-08d562e0fa62 X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Jan 2018 04:14:35.4466 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR2101MB0998 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hans de Goede [ Upstream commit 10809bb976648ac58194a629e3d7af99e7400297 ] Most Bay and Cherry Trail devices use a generic DSDT with all possible peripheral devices present in the DSDT, with their _STA returning 0x00 or 0x0f based on AML variables which describe what is actually present on the board. Since ACPI device objects with a 0x00 status (not present) still get an entry under /sys/bus/acpi/devices, and those entry had an acpi:PNPID modalias, userspace would end up loading modules for non present hardware. This commit fixes this by leaving the modalias empty for non present devices. This results in 10 modules less being loaded with a generic distro kernel config on my Cherry Trail test-device (a GPD pocket). Signed-off-by: Hans de Goede Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin --- drivers/acpi/device_sysfs.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/acpi/device_sysfs.c b/drivers/acpi/device_sysfs.c index 24418932612e..a041689e5701 100644 --- a/drivers/acpi/device_sysfs.c +++ b/drivers/acpi/device_sysfs.c @@ -146,6 +146,10 @@ static int create_pnp_modalias(struct acpi_device *acp= i_dev, char *modalias, int count; struct acpi_hardware_id *id; =20 + /* Avoid unnecessarily loading modules for non present devices. */ + if (!acpi_device_is_present(acpi_dev)) + return 0; + /* * Since we skip ACPI_DT_NAMESPACE_HID from the modalias below, 0 should * be returned if ACPI_DT_NAMESPACE_HID is the only ACPI/PNP ID in the --=20 2.11.0