From patchwork Sun Dec 13 16:31:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Can Guo X-Patchwork-Id: 11970879 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=-11.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,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 71AD6C433FE for ; Sun, 13 Dec 2020 16:32:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 37FBE23382 for ; Sun, 13 Dec 2020 16:32:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405606AbgLMQc0 (ORCPT ); Sun, 13 Dec 2020 11:32:26 -0500 Received: from labrats.qualcomm.com ([199.106.110.90]:2557 "EHLO labrats.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405576AbgLMQcZ (ORCPT ); Sun, 13 Dec 2020 11:32:25 -0500 IronPort-SDR: D+ryK2bcyldT3OdscZpGC3NlRozQMJKuDviBSTv2wdd3OM8d1rdGblVjYI357ZeoLvvzd100dm FP3L9nrAAwfmLPfvnlSOw+4jOvGrLcflEyJ1ge05KasWTDO1sKSYzc6vSblGKLYVh5D+iXXpmc 2XLkmVegX7DxELU5ouGQxzrCROsUcVx91aLzaaO+9d2KHlDTXwG0gCiwXOcxcBV9eumTVCMHqn vYVZ6TeID1t07pljq9CU+RQPwd79jS5L5lIrQL4JmHLuOfPc50gRdkp+muxqsra8Mke8u+3MZS 4Cg= X-IronPort-AV: E=Sophos;i="5.78,416,1599548400"; d="scan'208";a="47580283" Received: from unknown (HELO ironmsg04-sd.qualcomm.com) ([10.53.140.144]) by labrats.qualcomm.com with ESMTP; 13 Dec 2020 08:31:46 -0800 X-QCInternal: smtphost Received: from wsp769891wss.qualcomm.com (HELO stor-presley.qualcomm.com) ([192.168.140.85]) by ironmsg04-sd.qualcomm.com with ESMTP; 13 Dec 2020 08:31:45 -0800 Received: by stor-presley.qualcomm.com (Postfix, from userid 359480) id 1E0DB2171F; Sun, 13 Dec 2020 08:31:45 -0800 (PST) From: Can Guo To: asutoshd@codeaurora.org, nguyenb@codeaurora.org, hongwus@codeaurora.org, rnayak@codeaurora.org, linux-scsi@vger.kernel.org, kernel-team@android.com, saravanak@google.com, salyzyn@google.com, cang@codeaurora.org Subject: [PATCH v4 0/3] Three changes related with UFS clock scaling Date: Sun, 13 Dec 2020 08:31:41 -0800 Message-Id: <1607877104-8916-1-git-send-email-cang@codeaurora.org> X-Mailer: git-send-email 2.7.4 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org This series is made based on 5.10/scsi-fixes branch. Current devfreq framework allows sysfs nodes like governor, min_freq and max_freq to be changed even after devfreq device is suspended. Meanwhile, devfreq_suspend_device() cannot/wouldn't synchronize ongoing execution invoked through sysfs nodes menitioned above either. It means that UFS clock scaling can be invoked at any time (clkscale_enable is same) regardless of the state of UFS host and/or device. The 1st change allows contexts to prevent clock scaling from being invoked through sysfs nodes like clkscale_enable. The 2nd change is just a minor code cleanup. The 3rd change reverts one old change which can be covered by the 1st change. For branches which do not have this change yet, it can be ignored. Change since v3: - Slightly updated the 1st change Change since v2: - Split the 1st change to two changes, which become the 1st change and the 3rd change Change since v1: - Updated the 2nd change Can Guo (3): scsi: ufs: Protect some contexts from unexpected clock scaling scsi: ufs: Clean up ufshcd_exit_clk_scaling/gating() scsi: ufs: Revert "Make sure clk scaling happens only when HBA is runtime ACTIVE" drivers/scsi/ufs/ufshcd.c | 120 ++++++++++++++++++++++++++-------------------- drivers/scsi/ufs/ufshcd.h | 6 +++ 2 files changed, 75 insertions(+), 51 deletions(-)