Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1489488pxf; Fri, 19 Mar 2021 08:13:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx9ec+y1+diXQsEAiOSrCt5f0rIL4RnefNQY8lzAhp02aG9vnv9qt29nHs8MFwtn8yhxyq9 X-Received: by 2002:a05:6402:46:: with SMTP id f6mr10174801edu.252.1616166792211; Fri, 19 Mar 2021 08:13:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616166792; cv=none; d=google.com; s=arc-20160816; b=ev6oGcMfblkm7b8Tt8opOz437X/gclD3qlD/t0B+VbeOZOTibp2rjbaHmcXHHGLggB 98SCwh+4PNG1p5vO4WjJCsWhBfAlVTGjpcf2FqiZCGEvRHzcc5vAZq/7zqcNlwi2vIrM MRNgMQxZflfJZ2m73tuE51KZdqKZ6Wu2nBC/tmYRDpHj1z7eKX8Ke0wqQq2/Z7aBp6Ir Tsbth77k6YjhcuhaAu559PiK2pEHkaUifEl5mxjRnMUxE/PDcM5gODz04NX6Urxa24RX vvxEMGEhYYsR31L7L+Dpi4BGjXTkRajliQm2KZDCEHzkFchEeicSLz9SInpqBm0oMp0U 2TBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dmarc-filter:sender:dkim-signature; bh=er9VP5xtbj1RcZoesk+6RSiuR+svOzZFsLimRNPx0Ig=; b=05BgOJle4Rur+2DOWfRBChPw/wIL1Ml/Y4J8MrRX1dmqAqHxfm9Lbwb025iP2oGhj2 Wb62NBTlJDU+jVcszwoSU7SnpirnVYXKVKX8gm82Nn1DSDVjBl1DAloRfaDLuLz8MME8 9PV2xng+qsxtZ44eFK+ZyGGX1O9kgNLfSdK7vO8x9vR5epQAraj2nm4R7FwkgbkeYhqu TiwrAwFT0aXCQrjiPkOH2+pW3SPDR6MCYvrYhfDlrNtX+dOBzhG/xsLT3AbS4tGCF+wF gjMbs29P98J9Zd+IC5Sd55ez11USKQn/qh/B1wQMr3Z+66pUqGn+MIYrRinZ3pwsMoY+ m8BQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=FDxQ0mcG; 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 c11si5414847ejz.595.2021.03.19.08.12.44; Fri, 19 Mar 2021 08:13:12 -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=FDxQ0mcG; 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 S230378AbhCSPJr (ORCPT + 99 others); Fri, 19 Mar 2021 11:09:47 -0400 Received: from m43-7.mailgun.net ([69.72.43.7]:24966 "EHLO m43-7.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231154AbhCSPJQ (ORCPT ); Fri, 19 Mar 2021 11:09:16 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1616166556; h=Content-Transfer-Encoding: Content-Type: In-Reply-To: MIME-Version: Date: Message-ID: From: References: Cc: To: Subject: Sender; bh=er9VP5xtbj1RcZoesk+6RSiuR+svOzZFsLimRNPx0Ig=; b=FDxQ0mcGPKdLOrpGXBykFWUG4/Iy7+S75bPXJEtkuwr/INlLOEVbs8ZC3D/jvw6JyijKTqkc sCnvJbqKhvwKlbHxlNjUqsyHfxazPxqpp5j5MplkkAHIYLMRlNZgsOFkI2JXSKV2EqyBxf44 T0qCsOt/XDjMfRSVVOUTRtOMyUA= X-Mailgun-Sending-Ip: 69.72.43.7 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 6054be78c32ceb3a91998f7c (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Fri, 19 Mar 2021 15:08:40 GMT Sender: asutoshd=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 564C2C4346A; Fri, 19 Mar 2021 15:08:40 +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, NICE_REPLY_A,SPF_FAIL autolearn=no autolearn_force=no version=3.4.0 Received: from [192.168.8.168] (cpe-70-95-149-85.san.res.rr.com [70.95.149.85]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: asutoshd) by smtp.codeaurora.org (Postfix) with ESMTPSA id 8A7E5C433C6; Fri, 19 Mar 2021 15:08:36 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 8A7E5C433C6 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=asutoshd@codeaurora.org Subject: Re: [PATCH v12 1/2] scsi: ufs: Enable power management for wlun To: Bart Van Assche , cang@codeaurora.org, martin.petersen@oracle.com, adrian.hunter@intel.com, linux-scsi@vger.kernel.org Cc: linux-arm-msm@vger.kernel.org, Alim Akhtar , Avri Altman , "James E.J. Bottomley" , Pedro Sousa , Krzysztof Kozlowski , Stanley Chu , Andy Gross , Bjorn Andersson , Steven Rostedt , Ingo Molnar , Matthias Brugger , Bean Huo , Kiwoong Kim , Wei Yongjun , Lee Jones , Dan Carpenter , Dinghao Liu , "Gustavo A. R. Silva" , Jaegeuk Kim , Satya Tangirala , open list , "moderated list:ARM/SAMSUNG S3C, S5P AND EXYNOS ARM ARCHITECTURES" , "open list:ARM/SAMSUNG S3C, S5P AND EXYNOS ARM ARCHITECTURES" , "moderated list:UNIVERSAL FLASH STORAGE HOST CONTROLLER DRIVER..." References: <56662082b6a17b448f40d87df7e52b45a5998c2a.1616113283.git.asutoshd@codeaurora.org> From: "Asutosh Das (asd)" Message-ID: <45101050-83de-6488-7b17-271e0acea87b@codeaurora.org> Date: Fri, 19 Mar 2021 08:08:35 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/18/2021 8:12 PM, Bart Van Assche wrote: > On 3/18/21 5:35 PM, Asutosh Das wrote: >> During runtime-suspend of ufs host, the scsi devices are >> already suspended and so are the queues associated with them. >> But the ufs host sends SSU to wlun during its runtime-suspend. >> During the process blk_queue_enter checks if the queue is not in >> suspended state. If so, it waits for the queue to resume, and never >> comes out of it. >> The commit >> (d55d15a33: scsi: block: Do not accept any requests while suspended) >> adds the check if the queue is in suspended state in blk_queue_enter(). > Hi Bart, Thanks for the review comments. > What is the role of the WLUN during runtime suspend and why does a > command need to be sent to the WLUN during runtime suspend? Although it > is possible to derive this from the source code, please explain this in > the patch description. > Ok. Will explain it in the next version. > What does the acronym SSU stand for? This doesn't seem like a commonly > used kernel acronym to me so please expand that acronym. > START STOP UNIT. Anyway, I'll expand it in the next version. >> Fix this by registering ufs device wlun as a scsi driver and >> registering it for block runtime-pm. Also make this as a >> supplier for all other luns. That way, this device wlun >> suspends after all the consumers and resumes after >> hba resumes. > > That's an interesting solution. > >> -void __exit ufs_debugfs_exit(void) >> +void ufs_debugfs_exit(void) > > Is the above change related to the rest of this patch? > Yes, it's used to handle an error in ufshcd_core_init() function. >> static struct platform_driver ufs_qcom_pltform = { >> diff --git a/drivers/scsi/ufs/ufs_bsg.c b/drivers/scsi/ufs/ufs_bsg.c >> index 5b2bc1a..cbb5a90 100644 >> --- a/drivers/scsi/ufs/ufs_bsg.c >> +++ b/drivers/scsi/ufs/ufs_bsg.c >> @@ -97,7 +97,7 @@ static int ufs_bsg_request(struct bsg_job *job) >> >> bsg_reply->reply_payload_rcv_len = 0; >> >> - pm_runtime_get_sync(hba->dev); >> + scsi_autopm_get_device(hba->sdev_ufs_device); > > Can the pm_runtime_get_sync() to scsi_autopm_get_device() changes be > moved into a separate patch? > I guess so. But then this patch would have issues when used independently. >> +static inline bool is_rpmb_wlun(struct scsi_device *sdev) >> +{ >> + return (sdev->lun == ufshcd_upiu_wlun_to_scsi_wlun(UFS_UPIU_RPMB_WLUN)); >> +} > > Has this patch been verified with checkpatch? Checkpatch should have > reported the following for the above code: > > return is not a function, parentheses are not required > Yes, it has been verified. But I didn't see any error reports. Below is the o/p of checkpatch: $ ./scripts/checkpatch.pl /tmp/up/ufs-pm-v12/* ------------------------------------------ /tmp/up/ufs-pm-v12/0000-cover-letter.patch ------------------------------------------ WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line) #107: Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project. total: 0 errors, 1 warnings, 0 lines checked NOTE: For some of the reported defects, checkpatch may be able to mechanically convert to the typical style using --fix or --fix-inplace. /tmp/up/ufs-pm-v12/0000-cover-letter.patch has style problems, please review. ----------------------------------------------------------------------- /tmp/up/ufs-pm-v12/0001-scsi-ufs-Enable-power-management-for-wlun.patch ----------------------------------------------------------------------- total: 0 errors, 0 warnings, 1180 lines checked /tmp/up/ufs-pm-v12/0001-scsi-ufs-Enable-power-management-for-wlun.patch has no obvious style problems and is ready for submission. --------------------------------------------------------------------- /tmp/up/ufs-pm-v12/0002-ufs-sysfs-Resume-the-proper-scsi-device.patch --------------------------------------------------------------------- total: 0 errors, 0 warnings, 91 lines checked /tmp/up/ufs-pm-v12/0002-ufs-sysfs-Resume-the-proper-scsi-device.patch has no obvious style problems and is ready for submission. NOTE: If any of the errors are false positives, please report them to the maintainer, see CHECKPATCH in MAINTAINERS. >> +static inline bool is_device_wlun(struct scsi_device *sdev) >> +{ >> + return (sdev->lun == >> + ufshcd_upiu_wlun_to_scsi_wlun(UFS_UPIU_UFS_DEVICE_WLUN)); >> +} > > Same comment here. > >> /* >> - * Don't assume anything of pm_runtime_get_sync(), if >> + * Don't assume anything of resume, if >> * resume fails, irq and clocks can be OFF, and powers >> * can be OFF or in LPM. >> */ > > Please make better use of the horizontal space in the above comment by > making comment lines longer. > Ok Sure. > Thanks, > > Bart. > -asd -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, Linux Foundation Collaborative Project