From patchwork Fri Oct 16 06:02:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaegeuk Kim X-Patchwork-Id: 287125 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=-13.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,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 99E8FC433E7 for ; Fri, 16 Oct 2020 06:03:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DE66D207C4 for ; Fri, 16 Oct 2020 06:03:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602828187; bh=OU66uSLTVdDEsvXAQTU5DJ60ObUUefp/DVMyIGfoE3E=; h=From:To:Cc:Subject:Date:List-ID:From; b=q4u4+CbsM31yvFHbPwkyxtjs8VnKhvabDstLaSoeYNY+zKUi6vvaZfu1Ztew7L9M0 2qYT3ucpBEHSoz3JOvzIG5aksd01iQp95DVJMEL0BcD0rW7bkq453pQmTDOsPnPaF7 aTW8Ji7J3MZkhqekX3vfKdHGGMDAk29ASJOrqFuU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391090AbgJPGDE (ORCPT ); Fri, 16 Oct 2020 02:03:04 -0400 Received: from mail.kernel.org ([198.145.29.99]:54548 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730699AbgJPGDE (ORCPT ); Fri, 16 Oct 2020 02:03:04 -0400 Received: from localhost (unknown [104.132.1.66]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id DF307207C4; Fri, 16 Oct 2020 06:03:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602828184; bh=OU66uSLTVdDEsvXAQTU5DJ60ObUUefp/DVMyIGfoE3E=; h=From:To:Cc:Subject:Date:From; b=SlUKJwUGhRSfwWh17+WD9YoLpK37ohRCW0JUogPSvIuI3tc545c1BQEo0Im3a+qcH NHWLkYx8WXXFmXrS/0yhfD01BSGeynwtKPz/V1kX+t12LAHyGIZIb+v6c+s/xNkJUC 1RunAAzoAmJCFot+WW9XGKnY7MUWd83y2tRJbXCo= From: Jaegeuk Kim To: linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, kernel-team@android.com Cc: Jaegeuk Kim , Alim Akhtar , Avri Altman , Can Guo Subject: [PATCH] scsi: ufs: fix no clkgating due to tag being alive Date: Thu, 15 Oct 2020 23:02:59 -0700 Message-Id: <20201016060259.390029-1-jaegeuk@kernel.org> X-Mailer: git-send-email 2.29.0.rc1.297.gfa9743e501-goog MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org The below call stack prevents clk_gating at every IO completion. We can remove the condition, ufshcd_any_tag_in_use(), since clkgating_work will check it again. ufshcd_complete_requests(struct ufs_hba *hba) ufshcd_transfer_req_compl() __ufshcd_transfer_req_compl() __ufshcd_release(hba) if (ufshcd_any_tag_in_use() == 1) return; ufshcd_tmc_handler(hba); blk_mq_tagset_busy_iter(); Cc: Alim Akhtar Cc: Avri Altman Cc: Can Guo Signed-off-by: Jaegeuk Kim Signed-off-by: Jaegeuk Kim --- drivers/scsi/ufs/ufshcd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 1d157ff58d81..22fecb9a4ec2 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -1727,7 +1727,7 @@ static void __ufshcd_release(struct ufs_hba *hba) if (hba->clk_gating.active_reqs || hba->clk_gating.is_suspended || hba->ufshcd_state != UFSHCD_STATE_OPERATIONAL - || ufshcd_any_tag_in_use(hba) || hba->outstanding_tasks + || hba->outstanding_tasks || hba->active_uic_cmd || hba->uic_async_done || ufshcd_eh_in_progress(hba)) return;