From mboxrd@z Thu Jan 1 00:00:00 1970 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=-3.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no 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 3A296C48BC2 for ; Thu, 24 Jun 2021 02:03:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1567A6137D for ; Thu, 24 Jun 2021 02:03:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229850AbhFXCF3 (ORCPT ); Wed, 23 Jun 2021 22:05:29 -0400 Received: from so254-9.mailgun.net ([198.61.254.9]:22737 "EHLO so254-9.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229774AbhFXCF3 (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: WyI1MzIzYiIsICJsaW51eC1hcm0tbXNtQHZnZXIua2VybmVsLm9yZyIsICJiZTllNGEiXQ== 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 60d3e7c85d0d101e383ed425 (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) 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-arm-msm@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.