From patchwork Thu Jan 13 12:09:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Aditya Garg X-Patchwork-Id: 532641 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D5D49C433F5 for ; Thu, 13 Jan 2022 12:09:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234016AbiAMMJF (ORCPT ); Thu, 13 Jan 2022 07:09:05 -0500 Received: from mail-ma1ind01olkn0157.outbound.protection.outlook.com ([104.47.100.157]:26592 "EHLO IND01-MA1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S230310AbiAMMJE (ORCPT ); Thu, 13 Jan 2022 07:09:04 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VgVFu300qQaNd/vGol1vfEAdd4VOIuVBKNCywI0l/pFkY2uSb84oH9z+jRJFE/D0d9hXNzvHobK2dTWYvea9vXmhyNYbTgwL4ZUaqOwDmHafXxp/3Hfb17CKiFshds61ZuwEOM9hXWP8bTWg0UpxZ0DtLtbhmeOEjKC5PmurSsFui0kgll6C7BD+Q064WOyxBbeoD7/MUVQAf2PHkFuWDtfyld/chG9vqUWfrRsyY0X8Ax9kZCVEsXKgEZt6Z2gMETD1JNkjtIxiPhNv0iy3AzRrI06imU5HzJKMU+Sjs45/WLCjMuyXUWs+s4hE5nqXZZM3mMDij5gUztgB1U5hyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=WPxf5f+WEbvFXLzG2MLUgWVWJnMFnJfcz8aBayiMvj8=; b=UWUm8yhEV9vpCxxnDAI6liM3m8pKJsTkJdug1m5M2rxPQ0kFerJ4r+XqqZ0hsSzViVcIfbx0j3AtzZumpQIVeDkHXkX/47F1ORTa5u04DI+aq4mEImK+hESBcQBQ0w7NRWd+epkdV0xiLOeMUFQS+KOx3czc3yfQ7DpaTG109KeRrTFU/LQfpPPZcsPoZt4pU9hI5Ke6r84e9+z4op7Gg+/PJG8dqr9JxRCuaSEjub8FAiBL0Stl8SRMzfRO056HU4NS5a3Z9qE9U0Z+QAnEJosVUowhSdtcQqiHvaEc+c06OjbAcGg0Fsw9E1hme0tdtltp2lXHfDtjpB/9FDVXfQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=live.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WPxf5f+WEbvFXLzG2MLUgWVWJnMFnJfcz8aBayiMvj8=; b=K38qJGYdwhbEieRy8hWqmflYUUQ3TODLTiTAVZM7EGBUCJ9omUohe4NkSClJKgbOiGK6uw82kY1h1/b5mgEvsPx3HoBTy7yAKNv47w8rAESOcdqK7ohnNFWS0cNMQVImFy6qQSyr7bGxY14zXgo0NAcRFndVz15WwWDx/SPqrdovAVBPVJDItRNL9S8TZkONJc/oA2zDVtLflLKWC/xXyl/FWMIVQoWOSz9fKQ8jw2L7xjKZ8p5u4LY2APGWuSD1TNOXsqC4RMB2itBjSq0wI0/yu2N43zk40NOGosTs+TR/HEsedHmBOBpX8l+tBhuJx8n895jJQ0196JN2A4IYHA== Received: from PNZPR01MB4415.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:1b::13) by PN2PR01MB4715.INDPRD01.PROD.OUTLOOK.COM (2603:1096:c01:9::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4867.11; Thu, 13 Jan 2022 12:09:01 +0000 Received: from PNZPR01MB4415.INDPRD01.PROD.OUTLOOK.COM ([fe80::7ca6:9165:19ec:4cd7]) by PNZPR01MB4415.INDPRD01.PROD.OUTLOOK.COM ([fe80::7ca6:9165:19ec:4cd7%8]) with mapi id 15.20.4867.012; Thu, 13 Jan 2022 12:09:01 +0000 From: Aditya Garg To: "stable@vger.kernel.org" , Greg KH CC: Andy Shevchenko Subject: [PATCH][BACKPORT] mfd: intel-lpss: Fix too early PM enablement in the ACPI ->probe() Thread-Topic: [PATCH][BACKPORT] mfd: intel-lpss: Fix too early PM enablement in the ACPI ->probe() Thread-Index: AQHYCHZZxMvS2uQCuUufxFO7s9nbrA== Date: Thu, 13 Jan 2022 12:09:01 +0000 Message-ID: <450A01BA-8DFC-423E-8376-906C4FA9FF65@live.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-tmn: [pYTbqsuX8Uhy/agaqhYhLtIKntO2fMsz+q4DbZLD/3DxUGP7ptclEr98l084HoYh] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 1556f3a1-1ff8-4a2f-12ea-08d9d68d7c4a x-ms-traffictypediagnostic: PN2PR01MB4715:EE_ x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: VXGjxYixbYrie/y1dr8sUl3XXSnskL1TqqdTiOt4+olLtmKLQRK+foQFvFoui/EboHoEZNUuJ//CdB+3ObJXPP3uU0MDWnFv3qMZVEqFzpfBH1QauY/l3t5vFPapO87ocizI1OkJBp8Q2CgJFrPvUdZEXlPCaMY+72j7LxbClKVPsmcYEvf9V62LzB7k3H3/OIDobwZr/iQqwDX/WTou1WgQlewur1sS4vKVUnTeGCJ2EOUksWYSMLJIRFdkPSpIwSVhZX+NNjOKhORmtUu8w5kXQHyZwNac6Ava6rrzC2YmW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GtlwZQC9gNltDwOrCbKMNqIQBI9a6XWioYWUD21w/K?= =?utf-8?q?uUBloiIBzIZw3wVAyzCYhmfrZJB6sjfOJSmlJHZO8XmQl5t2hbn5L7e5e19kyei9Z?= =?utf-8?q?39gCJZ47q/xybaQx2tHKTJ6SgW6qnaruDFVUw91mGPoDKhXrvfyFK+fq+WoNvoUe2?= =?utf-8?q?UUJ5z4iSoqgQv3Qo9dWhbjoWMFPTFCu+7g3KEa7sCQHADS9fmwwep+JNrTyJzw8PG?= =?utf-8?q?o5LjZ9YMZesbgg2zUhKKnHKQlLWqDLncg6XteOmhhutG5s/PYjtJ7Z+hdUgvWx0Rp?= =?utf-8?q?sH9dZQ8ipDvD6JqPxq83Zu4VkamoU+UPj9pgIiwA3eZcyWv2JZ0dt8xTSMTmIsdTL?= =?utf-8?q?b0gXqoTOCsNnqBsYFjRnna0wofLCKrm3z3Kg8TM2qfiFGXuVQng5G9CEYaCpcxhxZ?= =?utf-8?q?1UhC1WLNrprNt4JnYsTWkjdG8uoZpeT9aG9Vc/UsC0Q=3D=3D?= Content-ID: <8B54BD843AC2A743A451ED13F14893DD@INDPRD01.PROD.OUTLOOK.COM> MIME-Version: 1.0 X-OriginatorOrg: sct-15-20-4755-11-msonline-outlook-42ed3.templateTenant X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PNZPR01MB4415.INDPRD01.PROD.OUTLOOK.COM X-MS-Exchange-CrossTenant-RMS-PersistedConsumerOrg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-CrossTenant-Network-Message-Id: 1556f3a1-1ff8-4a2f-12ea-08d9d68d7c4a X-MS-Exchange-CrossTenant-originalarrivaltime: 13 Jan 2022 12:09:01.2532 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 84df9e7f-e9f6-40af-b435-aaaaaaaaaaaa X-MS-Exchange-CrossTenant-rms-persistedconsumerorg: 00000000-0000-0000-0000-000000000000 X-MS-Exchange-Transport-CrossTenantHeadersStamped: PN2PR01MB4715 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org The patch below has been upstreamed but I believe has not been back ported to stable. The patch fixes a bug which arose in kernel 5.15, thus I request you to back port it to 5.15 and 5.16 as well Original commit in Linus’ tree :- c9e143084d1a602f829115612e1ec79df3727c8b From: Andy Shevchenko The runtime PM callback may be called as soon as the runtime PM facility is enabled and activated. It means that ->suspend() may be called before we finish probing the device in the ACPI case. Hence, NULL pointer dereference: intel-lpss INT34BA:00: IRQ index 0 not found BUG: kernel NULL pointer dereference, address: 0000000000000030 ... Workqueue: pm pm_runtime_work RIP: 0010:intel_lpss_suspend+0xb/0x40 [intel_lpss] To fix this, first try to register the device and only after that enable runtime PM facility. Fixes: 4b45efe ("mfd: Add support for Intel Sunrisepoint LPSS devices") Reported-by: Orlando Chamberlain Reported-by: Aditya Garg Signed-off-by: Andy Shevchenko Tested-by: Aditya Garg Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20211101190008.86473-1-andriy.shevchenko@linux.intel.com --- drivers/mfd/intel-lpss-acpi.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/mfd/intel-lpss-acpi.c b/drivers/mfd/intel-lpss-acpi.c index 3f1d976eb67cb7..f2ea6540a01e14 100644 --- a/drivers/mfd/intel-lpss-acpi.c +++ b/drivers/mfd/intel-lpss-acpi.c @@ -136,6 +136,7 @@ static int intel_lpss_acpi_probe(struct platform_device *pdev) { struct intel_lpss_platform_info *info; const struct acpi_device_id *id; + int ret; id = acpi_match_device(intel_lpss_acpi_ids, &pdev->dev); if (!id) @@ -149,10 +150,14 @@ static int intel_lpss_acpi_probe(struct platform_device *pdev) info->mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); info->irq = platform_get_irq(pdev, 0); + ret = intel_lpss_probe(&pdev->dev, info); + if (ret) + return ret; + pm_runtime_set_active(&pdev->dev); pm_runtime_enable(&pdev->dev); - return intel_lpss_probe(&pdev->dev, info); + return 0; } static int intel_lpss_acpi_remove(struct platform_device *pdev)