From patchwork Fri Dec 18 07:09:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Can Guo X-Patchwork-Id: 345819 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, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable 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 30301C2BBCF for ; Fri, 18 Dec 2020 07:11:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EBE8423A79 for ; Fri, 18 Dec 2020 07:11:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732850AbgLRHLC (ORCPT ); Fri, 18 Dec 2020 02:11:02 -0500 Received: from labrats.qualcomm.com ([199.106.110.90]:12527 "EHLO labrats.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726520AbgLRHLC (ORCPT ); Fri, 18 Dec 2020 02:11:02 -0500 IronPort-SDR: AaqVtQcEG+nlKOClR9xzNc2NAzNYv/0VbvX6kiMOE2ZjVC54mcajKxVIJDft5nPDCZQ7uiT0eb ycH6PASneIYKF4WE1ygIqakgHmZ0eEkbFJYQjjHGmZtstGt5a5Y94171bLJ3UQtxtUN6wY06q9 SLa3M5A4PTa335uTmChDbWeS5NLynwJI690GGvI3tndBGYX5BcRHPcnuZkotpqxmfo9j+Izjv+ kDbzwjT9diBl1Bg622JVQMLvH+2kJXvbLmZhHRj466XBaXW5AMLGLMNqtsBAXP6lNQ6E/TmFL5 RPE= X-IronPort-AV: E=Sophos;i="5.78,429,1599548400"; d="scan'208";a="29385187" Received: from unknown (HELO ironmsg02-sd.qualcomm.com) ([10.53.140.142]) by labrats.qualcomm.com with ESMTP; 17 Dec 2020 23:10:08 -0800 X-QCInternal: smtphost Received: from stor-presley.qualcomm.com ([192.168.140.85]) by ironmsg02-sd.qualcomm.com with ESMTP; 17 Dec 2020 23:10:07 -0800 Received: by stor-presley.qualcomm.com (Postfix, from userid 359480) id 45426211C2; Thu, 17 Dec 2020 23:10:07 -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 Cc: Alim Akhtar , Avri Altman , "James E.J. Bottomley" , "Martin K. Petersen" , Matthias Brugger , Stanley Chu , Bean Huo , Bart Van Assche , linux-kernel@vger.kernel.org (open list), linux-arm-kernel@lists.infradead.org (moderated list:ARM/Mediatek SoC support), linux-mediatek@lists.infradead.org (moderated list:ARM/Mediatek SoC support) Subject: [PATCH v5 3/3] scsi: ufs: Revert "Make sure clk scaling happens only when HBA is runtime ACTIVE" Date: Thu, 17 Dec 2020 23:09:45 -0800 Message-Id: <1608275387-26183-4-git-send-email-cang@codeaurora.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1608275387-26183-1-git-send-email-cang@codeaurora.org> References: <1608275387-26183-1-git-send-email-cang@codeaurora.org> Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Commit 73cc291c27024 ("Make sure clk scaling happens only when HBA is runtime ACTIVE") is no longer needed since commit f7a42540928a8 ("scsi: ufs: Protect some contexts from unexpected clock scaling") is a more mature fix to protect UFS LLD stability from clock scaling invoked through sysfs nodes by users. Reviewed-by: Stanley Chu Signed-off-by: Can Guo --- drivers/scsi/ufs/ufshcd.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 80f82cb..052479a 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -1300,15 +1300,8 @@ static int ufshcd_devfreq_target(struct device *dev, } spin_unlock_irqrestore(hba->host->host_lock, irq_flags); - pm_runtime_get_noresume(hba->dev); - if (!pm_runtime_active(hba->dev)) { - pm_runtime_put_noidle(hba->dev); - ret = -EAGAIN; - goto out; - } start = ktime_get(); ret = ufshcd_devfreq_scale(hba, scale_up); - pm_runtime_put(hba->dev); trace_ufshcd_profile_clk_scaling(dev_name(hba->dev), (scale_up ? "up" : "down"),