Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp176929pxj; Wed, 23 Jun 2021 19:07:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxB+ZgKvB07Oaz6DlULyh9W2POdsHA+P8qF3UamJqhN/Zr5wwijSsChyxL+gzFibllzlh8e X-Received: by 2002:a05:6402:3458:: with SMTP id l24mr3660365edc.320.1624500427252; Wed, 23 Jun 2021 19:07:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624500427; cv=none; d=google.com; s=arc-20160816; b=fNnIKVVLk03KZQzliU6RkxQDbw+mazxyIMye5jCF2y8rE6sath2nvPmCnRLmHvQv6f xYd5+JJgCrX57HqOWjaAmzqMy1dEvKhWw77ahV9ePRpvTgzfIvXuY8su0QSAHydC6t1r 83Dk6yVezSaQaqDigRrvqqMooysiilJ23/mA3yufuMiVygYHEMwsfTqDyHKkT7wUu0w3 BCn0uUGZvHA/zZUQyjd0o3902wa06WUn2EXybRCsoP77Hw15MXN99JzEwI1lFBQLCSXD kc0vlyRLDzjcnRRVEMDQJee5eZXnxoeHVsR2sx50UQSDujqc0fruY/lcFmWkxTsX3cBw ZWdA== 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=1YslBV6zwqXGoo89CZFNs7iiJ19vamy07dhhq7zxnvY=; b=zG6vgHAuExM880cPzYRzsT+T43yp1hJTq90fDCuL8fVBXWCdi14qwyAFR7rYD6/DQV jOin2HQEWuxdP41qUvNbq++86YbbJw6XcZgz8OIjpXolRFdnflAMqQgV0Paur/wSC887 Z29iGbG0TM7TYygzyvxuNHjQBU6DQFHqXaw+vjfZvL88gvYP38ftjoVcngyaqw8kfGxG di4mvxEXWk/LLka99x9fIApa0fClISAX1WvVl/i4MiLHIPkN01ECutradfQTIyhLTJcW FzyD3OyBPQ16GCc2+5yjLzeseK1+3cWF/tNaQBex1MLReZ64RqsFs+yRI1hFVKfFk/X1 KnmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b="wki1zQT/"; 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 n8si1556183edy.347.2021.06.23.19.06.34; Wed, 23 Jun 2021 19:07:07 -0700 (PDT) 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="wki1zQT/"; 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 S229881AbhFXCF3 (ORCPT + 99 others); Wed, 23 Jun 2021 22:05:29 -0400 Received: from so254-9.mailgun.net ([198.61.254.9]:46636 "EHLO so254-9.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229822AbhFXCF3 (ORCPT ); Wed, 23 Jun 2021 22:05:29 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1624500191; h=Message-ID: References: In-Reply-To: Subject: Cc: To: From: Date: Content-Transfer-Encoding: Content-Type: MIME-Version: Sender; bh=1YslBV6zwqXGoo89CZFNs7iiJ19vamy07dhhq7zxnvY=; b=wki1zQT/vMxUlc9nr/C0aLYu2szOHgUmwOcMGM+ThlI3/FI4r1wRmwV0ctG2Len06MEKq2QX k29W8xyvEEkFC2e3DcScsCTvyneaidBxCQfi7iItqlc2zNvM+lFKZyjfAK/l72KBnQwyRUST SCl/ZNRRgf+PuTdM58W2XcHNfMw= X-Mailgun-Sending-Ip: 198.61.254.9 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-n05.prod.us-west-2.postgun.com with SMTP id 60d3e7c85d0d101e383ed426 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Thu, 24 Jun 2021 02:02:48 GMT Sender: cang=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 0FF24C43145; Thu, 24 Jun 2021 02:02:47 +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 E3E42C433D3; Thu, 24 Jun 2021 02:02:46 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 24 Jun 2021 10:02:46 +0800 From: Can Guo To: Bart Van Assche Cc: asutoshd@codeaurora.org, nguyenb@codeaurora.org, hongwus@codeaurora.org, ziqichen@codeaurora.org, linux-scsi@vger.kernel.org, kernel-team@android.com, Andy Gross , Bjorn Andersson , Alim Akhtar , Avri Altman , "James E.J. Bottomley" , "Martin K. Petersen" , Stanley Chu , Bean Huo , Jaegeuk Kim , Adrian Hunter , Kiwoong Kim , Satya Tangirala , "open list:ARM/QUALCOMM SUPPORT" , open list Subject: Re: [PATCH v4 01/10] scsi: ufs: Rename flags pm_op_in_progress and is_sys_suspended In-Reply-To: References: <1624433711-9339-1-git-send-email-cang@codeaurora.org> <1624433711-9339-2-git-send-email-cang@codeaurora.org> <1c5db457-ee87-2308-15f5-5dad49508f10@acm.org> Message-ID: <932ce816be805e4cca2c5beee8627918@codeaurora.org> X-Sender: cang@codeaurora.org User-Agent: Roundcube Webmail/1.3.9 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Bart, On 2021-06-24 04:57, Bart Van Assche wrote: > On 6/23/21 1:05 PM, Bart Van Assche wrote: >> On 6/23/21 12:35 AM, Can Guo wrote: >>> Rename pm_op_in_progress and is_sys_suspended to >>> wlu_pm_op_in_progress and >>> is_wlu_sys_suspended accordingly. >> >> My understanding is that power management operations must be submitted >> to one particular UFS WLUN (hba->sdev_ufs_device). That makes the >> "wlu_" >> part of the new names redundant. In other words, I like the current >> names better than the new names. Unless if I missed something, >> consider >> dropping this patch. > > Hi Can, > > Reviewing later patches in this series made me realize that there are > two families of suspend/resume functions. One family of functions > operates at the platform level while the other family operates at the > SCSI LUN level. My comments about the suspend/resume functions are as > follows: > - It seems redundant to me to have system suspend support at the SCSI > LUN level (__ufshcd_wl_suspend(hba, UFS_SYSTEM_PM)) and also at the > platform level. Since the platform device is a parent of the SCSI > WLUN, can system suspend/resume support be left out from > ufshcd_wl_pm_ops (or in other words, remove the .freeze and .thaw > callbacks)? Do we really need two calls from the power management > subsystem into the UFS driver for every system suspend and every > system resume? Asutosh and Adrian should be the right persons to answer this, since they've been working together on that huge change for 4 months - https://lore.kernel.org/patchwork/patch/1417696/ In short, we need a dedicated suspend/resume ops for the UFS device W-LU because one cannot send requests (not even PM requests) after the device is runtime suspended - sending SSU cmds in hba suspend/resume cannot pass through blk_queue_enter() as SSU cmd is sent to the UFS device W-LU scsi device (by now it is runtime suspended) but not the hba device. Of course we can keep the old way and send the SSU cmd through a request queue without block layer PM initialized (hba->cmd_queue for example, by pointing cmd_queue->dev to the UFS device W-LU scsi device), but that would look like a hack. > - Because of the device links (device_link_add()), the ufschd_wl_*() > RPM callbacks are invoked after all LUNs have been suspended. I would > appreciate it if the "ufshcd_wl_" prefix would be changed into > "ufshcd_lun_" since that would make it more clear that these > callbacks > are associated with all LUNs and not only with the WLUN through which > power management commands are submitted. > Sure, we will do that later. Thanks, Can Guo. > Thanks, > > Bart.