Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1312526iob; Thu, 12 May 2022 16:31:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyLa2ybF3ILSmB6hadsKKnTfVLaJ2SRm3ODrI8sU7OtM/M1R/Lki3mr/ypYkOI/6UPM8EBo X-Received: by 2002:a17:90a:f48e:b0:1dc:8ed1:f5ae with SMTP id bx14-20020a17090af48e00b001dc8ed1f5aemr1843142pjb.182.1652398291542; Thu, 12 May 2022 16:31:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652398291; cv=none; d=google.com; s=arc-20160816; b=OIVVx/u2HB7c36pGzjTyXsjOlC8GkKGLqrPXTrpoeb85itM4h6X5pS3czbbx7Xga3W 9CFQsJBFwNKTZ+YnEzM2M/nb/G83THSHTl1ViZVAyRV59E9Tualp7JxYDtsnjT8G3g0j WtLYoRRvAvTGtGAdY/h/+cDapQaCOvzUAuc5YQDL7+wn/91uE9hemR2Ts1p7eNkRgxQe 5frgOEGabnDQfhWg6PHRQaFvXh3kEepdcqTRvnMtSFhgA2jw+hJ+eVgar8N/ydieh6rh hKPhwK3BNW1QXJYO0bsdHi2EZIAmnurbfNWWJkyv9fM9Wz2OGDHBFO3IO3FTCayAcJ3a fbrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=imohrFADdLQKlgoUX5DVrXzqX0qeFGJB7AYmyGCs3BQ=; b=aqFAcdduNU9k7/2OMotIYSO5CEy8e5XnWHTHgIgyQbNbjXL27+TOX+hhQZPF0dX1pI 3lHHX8IqloZD6R3+9+6MgknPxUbSbV8JC+Sr0a44p5cxcz3sPHhnk1xYU0rljtsMnmPL YtHBFhQhah2RzmYWswBSK9/GZ3MWQud52jOv90DlQVo8UgLHQTtfQ2kAhTdfYqZM1nG4 y3jruRzk+z4BU99H+8/+q3EZ4uLicqPpUyqgYo+eqEhgNv6810LQyBU8HHT6L+oI/lJ8 QqWOGqTxKuId3ed30k/z8pP1axGJOXZreMWC4u9d1af2estVW/tW0Bn+MWFDWskY08zf lM1Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c15-20020a170903234f00b00153b2d16509si1375538plh.273.2022.05.12.16.31.17; Thu, 12 May 2022 16:31:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232913AbiELFak (ORCPT + 99 others); Thu, 12 May 2022 01:30:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231895AbiELFad (ORCPT ); Thu, 12 May 2022 01:30:33 -0400 Received: from muru.com (muru.com [72.249.23.125]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D650C2229EB; Wed, 11 May 2022 22:30:29 -0700 (PDT) Received: from hillo.muru.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTP id D6E958027; Thu, 12 May 2022 05:26:52 +0000 (UTC) From: Tony Lindgren To: linux-omap@vger.kernel.org Cc: Dave Gerlach , Faiz Abbas , Greg Kroah-Hartman , Grygorii Strashko , Keerthy , Kevin Hilman , Nishanth Menon , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Romain Naour Subject: [PATCH] bus: ti-sysc: Fix warnings for unbind for serial Date: Thu, 12 May 2022 08:30:21 +0300 Message-Id: <20220512053021.61650-1-tony@atomide.com> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We can get "failed to disable" clock_unprepare warnings on unbind at least for the serial console device if the unbind is done before the device has been idled. As some devices are using deferred idle, we must check the status for pending idle work to idle the device. Cc: Romain Naour Fixes: 76f0f772e469 ("bus: ti-sysc: Improve handling for no-reset-on-init and no-idle-on-init") Signed-off-by: Tony Lindgren --- drivers/bus/ti-sysc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c --- a/drivers/bus/ti-sysc.c +++ b/drivers/bus/ti-sysc.c @@ -3395,7 +3395,9 @@ static int sysc_remove(struct platform_device *pdev) struct sysc *ddata = platform_get_drvdata(pdev); int error; - cancel_delayed_work_sync(&ddata->idle_work); + /* Device can still be enabled, see deferred idle quirk in probe */ + if (cancel_delayed_work_sync(&ddata->idle_work)) + ti_sysc_idle(&ddata->idle_work.work); error = pm_runtime_resume_and_get(ddata->dev); if (error < 0) { -- 2.36.1