Received: by 10.192.165.148 with SMTP id m20csp576458imm; Wed, 25 Apr 2018 04:33:35 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqB6G0D0CymeIfWkPhTgSzj68ogtx7LxbzbiZTztRVO6C3ZTOooB1T3epCJs771AcAA5buT X-Received: by 10.98.194.5 with SMTP id l5mr3171892pfg.6.1524656015162; Wed, 25 Apr 2018 04:33:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524656015; cv=none; d=google.com; s=arc-20160816; b=Wf2fW5S+mdsvIJ/GE6Clb+ElBmkZgyNh4IJhNgVyNh8X/MaW/UMgUaCLyN7vbU2TTV 1vfYj30KZWL3j9Y+Xrd36Tl9qJyIjE1yNg3QyS4Bo/I1U+I1TfCO2uYnMBPG88K5Rwl+ T2vD/VDZONTJtRwkNF+Vn5GS5CPK1H9XIPcpHkR9iRmo1yDhzws4HH1JxBvYoqIcNBGL XaxKt3XCWyBzEjlsL6xOaugc7L7erQ8vKPN6uH3NPhEv8gCLlPEorkkfo7gl+T4onGM9 d9g0pl6Cy2RzGtOHgfznTux4lKg8HIBYnHatuRBLSL11vBjA8WHefuxeIxEntMw7R1X1 jb7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=GhwqjhESYwTtmY1NV0i62J0Ct7q7MctiQD/MTz+hWRY=; b=UF/W9VJiI8H11IvU1nnKmOQoeFyUYfUiqvbZTPJ6LUr0VRd1xaSEAhrnkuZv9aeun3 UL8bwsDEEc+YtBozj/HGdXnq7EJDz6gdwwADZVi6hi1b34NHR6YJGPkHjWCm7adswEda RUqa0pbx4NLgL6Rl24GHaol3jcc5wNyIcdKMkuR4tJ6B8tFVPWohFzKojt4Dn0V2qY54 j7WIlaTiqdMoIwsqMDKSmQwa2VwXpbo5qrH9XSw4CFN08FFI/k4T2mqhQJ0oJY53rE90 mjLIsAU8SA/2p9ml2//QkATeoLak1Qob3IZQxqO4mhgAzyxQgJ8Wad+xpma1xnsNi2/b JOpA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a22-v6si3466347pls.571.2018.04.25.04.33.20; Wed, 25 Apr 2018 04:33:35 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753041AbeDYLcU (ORCPT + 99 others); Wed, 25 Apr 2018 07:32:20 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:51140 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753043AbeDYKh3 (ORCPT ); Wed, 25 Apr 2018 06:37:29 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 05F7149B; Wed, 25 Apr 2018 10:37:28 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hans de Goede , Mika Westerberg , Andy Shevchenko , "Rafael J. Wysocki" , Sasha Levin Subject: [PATCH 4.14 019/183] ACPI / LPSS: Do not instiate platform_dev for devs without MMIO resources Date: Wed, 25 Apr 2018 12:33:59 +0200 Message-Id: <20180425103243.381826026@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180425103242.532713678@linuxfoundation.org> References: <20180425103242.532713678@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Hans de Goede [ Upstream commit e1681599345b8466786b6e54a2db2a00a068a3f3 ] acpi_lpss_create_device() skips handling LPSS devices which do not have a mmio resources in their resource list (typically these devices are disabled by the firmware). But since the LPSS code does not bind to the device, acpi_bus_attach() ends up still creating a platform device for it and the regular platform_driver for the ACPI HID still tries to bind to it. This happens e.g. on some boards which do not use the pwm-controller and have an empty or invalid resource-table for it. Currently this causes these error messages to get logged: [ 3.281966] pwm-lpss 80862288:00: invalid resource [ 3.287098] pwm-lpss: probe of 80862288:00 failed with error -22 This commit stops the undesirable creation of a platform_device for disabled LPSS devices by setting pnp.type.platform_id to 0. Note that acpi_scan_attach_handler() also sets pnp.type.platform_id to 0 when there is a matching handler for the device and that handler has no attach callback, so we simply behave as a handler without an attach function in this case. Signed-off-by: Hans de Goede Acked-by: Mika Westerberg Reviewed-by: Andy Shevchenko Signed-off-by: Rafael J. Wysocki Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/acpi/acpi_lpss.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/acpi/acpi_lpss.c +++ b/drivers/acpi/acpi_lpss.c @@ -465,6 +465,8 @@ static int acpi_lpss_create_device(struc acpi_dev_free_resource_list(&resource_list); if (!pdata->mmio_base) { + /* Avoid acpi_bus_attach() instantiating a pdev for this dev. */ + adev->pnp.type.platform_id = 0; /* Skip the device, but continue the namespace scan. */ ret = 0; goto err_out;