Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1164520pxu; Sat, 12 Dec 2020 04:15:10 -0800 (PST) X-Google-Smtp-Source: ABdhPJxbz5uF9Fuca98SsqaQPlLn/hjFBSxm8NgTlVpXTAq/1icIN+xvqZpcA4rVxLDtWwzOdjqu X-Received: by 2002:a17:906:354a:: with SMTP id s10mr15100195eja.335.1607775310009; Sat, 12 Dec 2020 04:15:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607775310; cv=none; d=google.com; s=arc-20160816; b=k40BaIhR71R23Gg1MAANbtVpn8DOpY+92GyXt349RsQkeeeYesOrAX/JIp/RcnPiQ1 fTqGw885anP537ujzu+Or3jdzc8rOvZlA7Ilb5uhs8MAchc+vFsMn+9xfcMpfsiHA1Oa B42ETXN15PuGQ8lV38TLgnqCWDKF+m/l7NevcEKV+kDWD67okYyQzdR3owN2MSHKr59S INB/5WHABnrJWc4M/ynO2TMD9i5yJBn9Vw/Afy87+/fBhXmF1dI/8wySvcx6XKkKw0MS UrHXwsFfhn1LBQ5CTMcnZZmjCQKJneEvu+ALdgDoKOWgIY7NrUMvhMmS1sJw/WdE8X42 0RRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:message-id:references:in-reply-to :subject:cc:to:from:date:content-transfer-encoding:mime-version :sender:dkim-signature; bh=PBY8aqnlVgCM7hbrorF7TMQ4B0ULW8YavEYCyNWzl3k=; b=uc6CBkOCmf4d/MOVaca9QAjcttdr6A6YHxfgmyk2a7TALQY93A+CnJlt33VQsy4OJ2 j0jDmnUSlcJL5enS/165BWfV9obKbjCjujWZCHsjdNXVoWHymJ0JUupPU+OMVYluCsMT YabByP2zl72JfIGWmyf4Io16DTWaredC44IKxBpa2mrWZqv4KyEH4aSPaLk/lXKb6FjL nB9DWY5eBPn3X8WdmPgCuethXs/+BnudFFDNhiu30yqPdBWVVJ895F0basQ9yFAfNptv 0xwKgaGJ9Y1naA1sX4/JlP8aO+yEZ/NRF/3pQiMc3s4KlShOZmUSJHh/PNsFsGKaaq41 7cDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=OKnFUNmV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d2si6914919ejm.675.2020.12.12.04.14.47; Sat, 12 Dec 2020 04:15:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=OKnFUNmV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728535AbgLKLOR (ORCPT + 99 others); Fri, 11 Dec 2020 06:14:17 -0500 Received: from so254-31.mailgun.net ([198.61.254.31]:45724 "EHLO so254-31.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727637AbgLKLNy (ORCPT ); Fri, 11 Dec 2020 06:13:54 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1607685210; h=Message-ID: References: In-Reply-To: Subject: Cc: To: From: Date: Content-Transfer-Encoding: Content-Type: MIME-Version: Sender; bh=PBY8aqnlVgCM7hbrorF7TMQ4B0ULW8YavEYCyNWzl3k=; b=OKnFUNmVPW2kg3j3FQYyGJSJCmY/h4mD6f3fA7osOxpJbtQ1ARwN2sPjosX97s7NQlQfWzuz 1GqEs4WkE0j4qq8zthOO6HV2JU1yCuH1vE0egHQW9FqUiAa7n6xGz5aEZYncYBYaLtYZPO9x 2XqHCKr/ayRNmbbcXbEBgIkw2PA= X-Mailgun-Sending-Ip: 198.61.254.31 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n09.prod.us-east-1.postgun.com with SMTP id 5fd3543f35a25d1b16a4ec42 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Fri, 11 Dec 2020 11:13:03 GMT Sender: cang=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 618B4C43464; Fri, 11 Dec 2020 11:13:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: cang) by smtp.codeaurora.org (Postfix) with ESMTPSA id 86718C433CA; Fri, 11 Dec 2020 11:13:01 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 11 Dec 2020 19:13:01 +0800 From: Can Guo To: Bean Huo Cc: 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, Alim Akhtar , Avri Altman , "James E.J. Bottomley" , "Martin K. Petersen" , Stanley Chu , Bean Huo , Bart Van Assche , Satya Tangirala , open list Subject: Re: [PATCH 1/2] scsi: ufs: Protect some contexts from unexpected clock scaling In-Reply-To: <48363aee8a746a43440f86f620d9d2e0@codeaurora.org> References: <1607520942-22254-1-git-send-email-cang@codeaurora.org> <1607520942-22254-2-git-send-email-cang@codeaurora.org> <48363aee8a746a43440f86f620d9d2e0@codeaurora.org> Message-ID: X-Sender: cang@codeaurora.org User-Agent: Roundcube Webmail/1.3.9 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-12-11 09:36, Can Guo wrote: > On 2020-12-11 01:34, Bean Huo wrote: >> Hi Can >> >> On Wed, 2020-12-09 at 05:35 -0800, Can Guo wrote: >>> >>> >>> @@ -1160,6 +1166,7 @@ static void >>> ufshcd_clock_scaling_unprepare(struct ufs_hba *hba) >>> { >>> up_write(&hba->clk_scaling_lock); >>> ufshcd_scsi_unblock_requests(hba); >>> + ufshcd_release(hba); >>> } >>> >>> /** >>> @@ -1175,12 +1182,9 @@ static int ufshcd_devfreq_scale(struct ufs_hba >>> *hba, bool scale_up) >>> { >>> int ret = 0; >>> >>> - /* let's not get into low power until clock scaling is >>> completed */ >>> - ufshcd_hold(hba, false); >>> - >>> ret = ufshcd_clock_scaling_prepare(hba); >>> if (ret) >>> - goto out; >>> + return ret; >>> >>> /* scale down the gear before scaling down clocks */ >>> if (!scale_up) { >>> @@ -1212,8 +1216,6 @@ static int ufshcd_devfreq_scale(struct ufs_hba >>> *hba, bool scale_up) >>> >>> out_unprepare: >>> ufshcd_clock_scaling_unprepare(hba); >>> -out: >>> - ufshcd_release(hba); >>> return ret; >>> } >> >> I didn't understand why moving ufshcd_hold/ufshcd_release into >> ufshcd_clock_scaling_prepare()/ufshcd_clock_scaling_unprepare(). >> >> >>> >>> @@ -1294,15 +1296,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); >>> >> >> which branch are you working on? I didn't see this part codes in the >> branch 5.11/scsi-queue and 5.11/scsi-staging. >> >> Bean > > As I mentioned in my cover-letter, this is based on 5.11/scsi-fixes. > These codes came from one of my earlier changes, but since this change > can cover the old change's functionality, so I removed the codes. > > Can Guo. Hi Bean, Sorry for the typo, it is branch 5.10/scsi-fixes. Thanks, Can Guo.