Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp439930iog; Mon, 13 Jun 2022 06:03:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzbHH8AAv3MrPOQDC7p8ODMufnhvEeA6CbERWZtd6XXTrrgYsoW7QYD5idvZ5vG/Z7TNHs8 X-Received: by 2002:a17:907:2d0c:b0:711:e835:f80c with SMTP id gs12-20020a1709072d0c00b00711e835f80cmr27551043ejc.257.1655125428833; Mon, 13 Jun 2022 06:03:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655125428; cv=none; d=google.com; s=arc-20160816; b=Naz4oIIq5wj0nJZ+MEvbsv94N+K2DhkhhWpFTUirUzpl9uNByh/b6IwLIOO2uen09P nGCHxgXQNG6etLylyPtez7f8aZXY7KDo1eUX49f61JRIv/oc5GBFZeGfKKhFtXbrAxZd pPTd9Pw272FnsJYx5w6sSmr7XSmHRP30K3alpt2ZYHxDOBb9VjxbpA0lIw2OiJYJShWb YleDMurtkmMA8MFaVoQptw5+C2WWVAQkxifxvexbBNfYc73N7XIA5p4RWrW6Nqyn+F+7 evYogX5Rjrok9s1dGQY7v0CkHtEbgSz/2XaiSHTMzVtEYAvr3s4FqDerEvEaGHLTtAUz c1tA== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=d1MbLb3AyuN/Fv7+oLejqp+969pEWgv+qLJExtghR9g=; b=g+bQNTxXV9cjv9FTHebosS/fjgHDRpbwYu29w9nYy/ITblBO6DYeslB4NJY2nrNxT4 OvAG1qRXwuXyRuKp98zs++IZxPiQ7nFGyfHxP/kDHeVndPldg2h8XpCkkCl0Ordqv8GT 0s5OgktYw4AxgFd0LXeZqxZ3dNTl8F0fBJbqUryUtMHYJ669kWKhv4JlPnRf791agWhK D3HTlXFFwByHPQ6YdeyWk+a7gKZyGDWw8H4ExdMlTIMecx2jcX5BgOAzDffVP9J/+fbF Q6OgXmOLc8fBberHnCd5tNtxy8dppsNNH9PzDI0unTnwuCxLG2tB3huicplltB3SZxxz HCJg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QnOsbDk6; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l10-20020a50c10a000000b0042df8161c98si6981729edf.244.2022.06.13.06.03.22; Mon, 13 Jun 2022 06:03:48 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=QnOsbDk6; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355010AbiFMLiF (ORCPT + 99 others); Mon, 13 Jun 2022 07:38:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355064AbiFMLa2 (ORCPT ); Mon, 13 Jun 2022 07:30:28 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5FAA2B240; Mon, 13 Jun 2022 03:46:25 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2F77360FDB; Mon, 13 Jun 2022 10:46:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3B4F4C34114; Mon, 13 Jun 2022 10:46:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1655117184; bh=aAA6hQIpGv3F1Y6sJQtvDmCD4JxsSlbLtBI+wfx5otg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QnOsbDk67zSnPWlBM8PzKgwQiEn/S26OC24TecK/F7IsTGWPqqcXsyl4qRaC+ZMLl yjkYOE7Vpj1AZjpvMMREicFMKtK56sIowSs0m0Gil5LobDHxR6/Xjzd7J4iMBgkxKY Q9QSrlMLuv0LSKm7tNeDFJXuQffpEL6DReZzj4ss= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Romain Naour , Tony Lindgren , Sasha Levin Subject: [PATCH 5.4 316/411] bus: ti-sysc: Fix warnings for unbind for serial Date: Mon, 13 Jun 2022 12:09:49 +0200 Message-Id: <20220613094938.216549236@linuxfoundation.org> X-Mailer: git-send-email 2.36.1 In-Reply-To: <20220613094928.482772422@linuxfoundation.org> References: <20220613094928.482772422@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,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 From: Tony Lindgren [ Upstream commit c337125b8834f9719dfda0e40b25eaa266f1b8cf ] 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. Fixes: 76f0f772e469 ("bus: ti-sysc: Improve handling for no-reset-on-init and no-idle-on-init") Cc: Romain Naour Reviewed-by: Romain Naour Signed-off-by: Tony Lindgren Link: https://lore.kernel.org/r/20220512053021.61650-1-tony@atomide.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- 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 index 469ca73de4ce..44aeceaccfa4 100644 --- a/drivers/bus/ti-sysc.c +++ b/drivers/bus/ti-sysc.c @@ -2724,7 +2724,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_get_sync(ddata->dev); if (error < 0) { -- 2.35.1