From patchwork Tue Nov 24 08:52:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Clark Wang X-Patchwork-Id: 11927449 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=-16.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT 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 0CDF3C63777 for ; Tue, 24 Nov 2020 08:52:29 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 8DEBD2075A for ; Tue, 24 Nov 2020 08:52:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="vuZF5A7+"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="R6TzJJXG" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8DEBD2075A Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=RrkhMAeCCNNcqHJ74LO1gd0mFvdov+38rD6EZvbFwvs=; b=vuZF5A7+Ccno8o8FNfBS2FeRyi Xrh+C/Mg3qfr6MzsLRLFTc57VNLFB/kq+r/+rpysYji2nUjjZDJ3BoyCrthufg/U/nNIX0DmDDfv/ zTU9+8ZRqv3UTdus87vzUDVkX7Thc2yStyLugHVAlgcNTdQU+gp+rkS9qybGgh7T5k/ONrp4CB4d6 y76g3X3zkhskYOdGml96dmxZ4hH/FBdJ4h7w6LMunOBxejMTrcGQLf9IgjeoZdkqjA2yTcfqM4GFQ VYUwBkerLLLDNqMNgPyazaLhm2GQuKM+xT7jBB7vDaBJ7M8mEACHD+OBdPafQljqrOi4nyZhu8pUJ a4564YIg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1khU3P-00079D-0C; Tue, 24 Nov 2020 08:52:03 +0000 Received: from mail-eopbgr70047.outbound.protection.outlook.com ([40.107.7.47] helo=EUR04-HE1-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1khU3E-000752-Ho for linux-arm-kernel@lists.infradead.org; Tue, 24 Nov 2020 08:51:54 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UTQVlZ/xQ/bOVmR0cy5qUYLAwZ8HPbpl0GmFLD2A9y/kDmSK699P6vpUHEc5ighBITu8arM6WmkAB35P2r+4kPMdik6JfPFyISg3cH5RldIshNZBkvgt1SbGJ7w9lawlcPCeknlvYO7uXBA5bcmh5+EaBCoJh2aWJ92hwbsTOybb0Ll+Z36bK3Y237UtC301C5F7fV3/SbZY8zkZOiOirSpE3yaslCvCFdoRVJKrfQT0cgxz2ti2OcdzSknhjUK9+dKAdGaLkZzWmzjueN6fZKIc++GWYr0ZxW4Vt3TQvRvalmYN/EJe9/IBY5To/y2px4ACx1z9B8BJXwL9oXCvMA== 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-SenderADCheck; bh=cRoSuKKuImbStl8mlY0dTj6a/2C8lzBsCFpTlxRonFo=; b=Hdj8K7G0wRWCNJRQ3/qGEbf6wXQCpFJnaMijqVEIUskWYNbVjTXcG5nFIWaUNYOi6fBbb65cpKTe3Id9vQUSY5onlzPk4wBVP32EuWj5MGSXQM74ugnj/lxYvjK9Ukgq+ZMDe1oEZPFdQAiSfRUJLHP5iB8piiPLITPM9yrNyqJTUsDIV1AHrLPF7I7ODXlylthbkvlbFhjVpt+SM6wWqW27P3P1mBtYwobTgFMIkCTv0IBhb1zdhMQpPvUPof4YGlSxU8bD3QWNMed/b4sgy2wcU2pS8sOc2bq++Nr4t/BQ3+nfbjc1VSxpECnFrUdge9KWrG/Me7bBBsPDssDhZg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cRoSuKKuImbStl8mlY0dTj6a/2C8lzBsCFpTlxRonFo=; b=R6TzJJXGrapFfZI3UU3kiF5W4Z02PTtG2lfQHg9PR81acdfiMaHhIHRvw/CCRyivlGWINlWIPK8VvCOyfxqsK9PiM3C5ALRW0YPcplk7jlH7/9LwoORi0yIIrgJ8YSJ8uH9gXZJzteTKzUMgxYlwwrWrbzZDCYP83EolgLkJyKE= Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=none action=none header.from=nxp.com; Received: from AM6PR04MB5623.eurprd04.prod.outlook.com (2603:10a6:20b:a9::13) by AM7PR04MB7077.eurprd04.prod.outlook.com (2603:10a6:20b:11c::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3611.20; Tue, 24 Nov 2020 08:51:47 +0000 Received: from AM6PR04MB5623.eurprd04.prod.outlook.com ([fe80::a533:3a5b:d525:d784]) by AM6PR04MB5623.eurprd04.prod.outlook.com ([fe80::a533:3a5b:d525:d784%6]) with mapi id 15.20.3589.022; Tue, 24 Nov 2020 08:51:47 +0000 From: Clark Wang To: broonie@kernel.org, shawnguo@kernel.org, s.hauer@pengutronix.de, nikita.shubin@maquefel.me Subject: [PATCH] spi: imx: fix the unbalanced spi runtime pm management Date: Tue, 24 Nov 2020 16:52:47 +0800 Message-Id: <20201124085247.18025-1-xiaoning.wang@nxp.com> X-Mailer: git-send-email 2.17.1 X-Originating-IP: [119.31.174.71] X-ClientProxiedBy: SG2PR01CA0156.apcprd01.prod.exchangelabs.com (2603:1096:4:8f::36) To AM6PR04MB5623.eurprd04.prod.outlook.com (2603:10a6:20b:a9::13) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.71) by SG2PR01CA0156.apcprd01.prod.exchangelabs.com (2603:1096:4:8f::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3611.20 via Frontend Transport; Tue, 24 Nov 2020 08:51:44 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: b9978c8d-01f1-4ed8-ed14-08d890562d09 X-MS-TrafficTypeDiagnostic: AM7PR04MB7077: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3968; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Y05zh95MNhohjOfLLnAzYx1tbjpAXHnIRsr/yuHRB3dVT5x0OnDl50xZb8KHL/de1Jyzkbeh8KSMgQdnsZqqKPWyI6AV6jnQn23ASmDxP/4s3xwB2LPl1TwNFyo/qWZT1CjY5FFkJGQsOoGG8+UV3nJnw56UOBe1LV5gPfImxdALrqCfrP9iGAR8ZDvarWtP+qgQMQWRStZSGRxfXhMmVtGk/KDQ2TfxYfDabQA6IorbgzWs1IJ7yei4C0FIXqdYiY7jWyciz17ITlwzSphi3his2dUsoWM1TmH+DKL7F1wSCaOJejYejIKVmUvdWdTWC3k50+y+fUYRjVvLEQRV4v8iy2yVTr8jXNLSTfQH4gMAWLeRtKGxxfOZTTUq7R7P X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AM6PR04MB5623.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(39860400002)(376002)(136003)(366004)(346002)(396003)(6512007)(8936002)(8676002)(69590400008)(52116002)(2906002)(86362001)(6506007)(1076003)(16526019)(26005)(186003)(66946007)(66556008)(956004)(2616005)(316002)(6486002)(4326008)(66476007)(83380400001)(478600001)(5660300002)(36756003); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData: lCH1KhPddAy7raz/nG54xbf7xcVHmfluLHu3xrotSoZnmd08J2Qe3FMCWKxkKqVeQ7h0B3Cup+lfABPSpSSmikcN83PwYOupTrSJ4GtlURfG96Qh+PfJYYlnKymcj6h4rxGjcPIpHPeq3/C1Hg3PEcC2XASu8EPTDPpALiU3lEGbvAXe2/KBntcy8BCf3lYrXMGAgFBnxbUzVE/CIZGhJJr0/HQ+/w7r9KCPAro1z64bnscOUv4v3ZWg2HfdWd/KtEGKaiOgCOmiQ9RpdAgiCteWBEt4UZQfg70xSnEqw5hp+0nNIYKL6OJB+ZPqdVLYOpZCGkkfzjXlVRqtVE+mw4MfSt0c8EWs0JD3Uh+Yj8vWDLkXF59OxCrMSkWZY2e1VzQHMKHO8zAw3C7uibp2MzJxqddlxd403niewrMB+UrvktPTxvvYtkzAZT/n4FfM0Tjqz0dwL3YGW90NQQ07X1ebQulGOvXzcxkKM2l3bPJehxd7Iz+KYVahbkUrIAl2cN6quDQL+mp6SiItSa5v3R9XTqxv8X02hbfdVrk3iE/Dag6s5OW+I3Sl9v86ukD0SvRjJYcaAEm1gtT4lplW8F4DR9KeVUNGHUvLNaWpQMdSfe8HP58xAZf0/vbS3+f2h8voC1mMxywbAajrBqcmHmn53ao6Jg/IJCt5i12JfAQUiJCKKuwI7KIlOLCYtFIBYyfEIZtvjTen+q8zqvgzEZQ/xKBObKZPbzdZrD0T91jrA/7H/Y0nViNVpApZ21aXbSP6EBa53g+boLI2HTBXSE98h6oH8CaDk9PfOQKZDziDtkj7klkVzk8i6mgKm8sglOfsQ15bK/RHL4Jd2CMSlIy9uungUeL30jkOIlOB/JbBGb4BZwqJMOskX0Ky51N/kxENMm1R/VQ2KX3rIklIQA== X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: b9978c8d-01f1-4ed8-ed14-08d890562d09 X-MS-Exchange-CrossTenant-AuthSource: AM6PR04MB5623.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Nov 2020 08:51:47.3755 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: j7OveCDPINtIsi7QgEnCGFU6hiWw/m2P8kHHjh+KYJQac0KrL+f0dcCQozYxM5PTEhrN8BUoHvA/lfN7AjtZEw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR04MB7077 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201124_035152_818487_38B847B3 X-CRM114-Status: GOOD ( 14.85 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org, linux-imx@nxp.com, kernel@pengutronix.de, festevam@gmail.com, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org If set active without increase the usage count of pm, the dont use autosuspend function will call the suspend callback to close the two clocks of spi because the usage count is reduced to -1. This will cause the warning dump below when the defer-probe occurs. [ 129.379701] ecspi2_root_clk already disabled [ 129.384005] WARNING: CPU: 1 PID: 33 at drivers/clk/clk.c:952 clk_core_disable+0xa4/0xb0 So add the get noresume function before set active. Fixes: 43b6bf406cd0 spi: imx: fix runtime pm support for !CONFIG_PM Signed-off-by: Clark Wang --- drivers/spi/spi-imx.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c index 7513ef552d79..73ca821763d6 100644 --- a/drivers/spi/spi-imx.c +++ b/drivers/spi/spi-imx.c @@ -1659,6 +1659,7 @@ static int spi_imx_probe(struct platform_device *pdev) pm_runtime_set_autosuspend_delay(spi_imx->dev, MXC_RPM_TIMEOUT); pm_runtime_use_autosuspend(spi_imx->dev); + pm_runtime_get_noresume(spi_imx->dev); pm_runtime_set_active(spi_imx->dev); pm_runtime_enable(spi_imx->dev);