Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp18230861ybl; Thu, 2 Jan 2020 21:30:03 -0800 (PST) X-Google-Smtp-Source: APXvYqybT34EnI+L0pD8g69VdnGUhuDtvqJxB0fqUDaJNy9ol6OeyboVQjZnOQSrbBWAFW22QPYr X-Received: by 2002:a9d:68cc:: with SMTP id i12mr59351795oto.207.1578029403059; Thu, 02 Jan 2020 21:30:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578029403; cv=none; d=google.com; s=arc-20160816; b=SM1zxWnsfu228vtST8cApt+T5uqeXXlktXdI2b7+pQs3oiNoi0TzG4sJ5S4y5vhQ/S fsHcc3p1RPrlewewZHinKiJB717W8MrK40AWLx9F18CEpfI/tzIZQ0+ROiSYg0hEycxb hippDk8+mfH+1k1LLJjQJCAdzFB07ZkF8tvQGBzUJj3Ijnbeyay3uAapxjsYTKhvfLU6 ZA2EMnQwKlBvTIGQ/D8itcnbF63RQ+MzwTkEKAjhjm9+GvlIZUpyoq+/BH6YJyOMcbIy CRNyridHRzTYr7z4aCJiRE6HfkWb0aUsSo+AEuEDP6QNHTSqmNQnywNpTgiKyHnTpSob O87g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature; bh=QGQ3D1GyNhd0LAoBVLxbTbXL6/9pOn4Pwzlj2/BukcY=; b=wL0DTJ5rlltb4u9wKFf+cy49x+Ec1arnJs5zedGP+9ro/2EZ/o/0ufyBqkEPGn47RI 9QNBMhRmxcjk37fVO4mVqPiO6XEar0K13zq8raMHC0VUbQU0hVWkT/g3zvIa8MrzOLmq mDShSO0eeD4lF62mqGjmajn6KOJspzrht/1C7Jfaa0aLB5VwbqZsjPo9QVF28M5SWK8C fCyS+t1rkSYhmBwAuPrA3P5j+mWlEmno9yyJIzQ1B3o36MedFn3V1M0UsTmKpX7h3qqE 8rcUUFRAqNTG7IPVsPnxubbRdscipq406p+L7KsdeexW1CGcVzhKedOCQrtL7PWmT1c/ PdgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=oxebzTLg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l21si26343888oic.126.2020.01.02.21.29.51; Thu, 02 Jan 2020 21:30:03 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=oxebzTLg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726438AbgACF3C (ORCPT + 99 others); Fri, 3 Jan 2020 00:29:02 -0500 Received: from mail25.static.mailgun.info ([104.130.122.25]:10519 "EHLO mail25.static.mailgun.info" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726180AbgACF3C (ORCPT ); Fri, 3 Jan 2020 00:29:02 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1578029341; h=Message-ID: References: In-Reply-To: Subject: Cc: To: From: Date: Content-Transfer-Encoding: Content-Type: MIME-Version: Sender; bh=QGQ3D1GyNhd0LAoBVLxbTbXL6/9pOn4Pwzlj2/BukcY=; b=oxebzTLgZP9G6nl8Dx2hE0b3ch/Lh5ga69ChYyRMvNIPEl17ALMdC5cvWgFwqGhuO8F2sFTV VrW23NQxQW2sc0lx64efwnXq8lhslIKN8C7IuM3sOCjVWkBk9Q7rlu9R1BOveozZllvqBE1P 7/ZExnRqa5+lTZmYvV+0TAecRHY= X-Mailgun-Sending-Ip: 104.130.122.25 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 mxa.mailgun.org with ESMTP id 5e0ed11b.7fbab6fd77a0-smtp-out-n01; Fri, 03 Jan 2020 05:28:59 -0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 1001) id C551EC447A5; Fri, 3 Jan 2020 05:28:59 +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=-1.0 required=2.0 tests=ALL_TRUSTED 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 7B4A2C433CB; Fri, 3 Jan 2020 05:28:58 +0000 (UTC) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Fri, 03 Jan 2020 13:28:58 +0800 From: Can Guo To: Stanley Chu Cc: martin.petersen@oracle.com, linux-scsi@vger.kernel.org, andy.teng@mediatek.com, jejb@linux.ibm.com, chun-hung.wu@mediatek.com, kuohong.wang@mediatek.com, linux-kernel@vger.kernel.org, stable@vger.kernel.org, asutoshd@codeaurora.org, avri.altman@wdc.com, linux-mediatek@lists.infradead.org, peter.wang@mediatek.com, linux-scsi-owner@vger.kernel.org, subhashj@codeaurora.org, alim.akhtar@samsung.com, beanhuo@micron.com, pedrom.sousa@synopsys.com, bvanassche@acm.org, linux-arm-kernel@lists.infradead.org, matthias.bgg@gmail.com, ron.hsu@mediatek.com, cc.chou@mediatek.com Subject: Re: [PATCH v1 1/2] scsi: ufs: set device as default active power mode during initialization only In-Reply-To: <4888afd46a9065b7f298a5de039426c9@codeaurora.org> References: <1577693546-7598-1-git-send-email-stanley.chu@mediatek.com> <1577693546-7598-2-git-send-email-stanley.chu@mediatek.com> <1577754469.13164.5.camel@mtkswgap22> <836772092daffd8283a97d633e59fc34@codeaurora.org> <1577766179.13164.24.camel@mtkswgap22> <1577778290.13164.45.camel@mtkswgap22> <44393ed9ff3ba9878bae838307e7eec0@codeaurora.org> <1577947124.13164.75.camel@mtkswgap22> <4888afd46a9065b7f298a5de039426c9@codeaurora.org> Message-ID: X-Sender: cang@codeaurora.org User-Agent: Roundcube Webmail/1.3.9 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-01-03 09:51, Can Guo wrote: > On 2020-01-02 14:38, Stanley Chu wrote: >> Hi Can, >> >> On Tue, 2019-12-31 at 16:35 +0800, Can Guo wrote: >> >>> Hi Stanley, >>> >>> I missed this mail before I hit send. In current code, as per my >>> understanding, >>> UFS device's power state should be Active after ufshcd_link_startup() >>> returns. >>> If I am wrong, please feel free to correct me. >>> >> >> Yes, this assumption of ufshcd_probe_hba() is true so I will drop this >> patch. >> Thanks for remind. >> >>> Due to you are almost trying to revert commit 7caf489b99a42a, I am >>> just >>> wondering >>> if you encounter failure/error caused by it. >> >> Yes, we actually have some doubts from the commit message of "scsi: >> ufs: >> issue link startup 2 times if device isn't active" >> >> If we configured system suspend as device=PowerDown/Link=LinkDown >> mode, >> during resume, the 1st link startup will be successful, and after that >> device could be accessed normally so it shall be already in Active >> power >> mode. We did not find devices which need twice linkup for normal work. >> >> And because the 1st linkup is OK, the forced 2nd linkup by commit >> "scsi: >> ufs: issue link startup 2 times if device isn't active" leads to link >> lost and finally the 3rd linkup is made again by retry mechanism in >> ufshcd_link_startup() and be successful. So a linkup performance issue >> is introduced here: We actually need one-time linkup only but finally >> got 3 linkup operations. >> >> According to the UFS spec, all reset types (including POR and Host >> UniPro Warm Reset which both may happen in above configurations) other >> than LU reset, UFS device power mode shall return to Sleep mode or >> Active mode depending on bInitPowerMode, by default, it's Active mode. >> >> So we are curious that why enforcing twice linkup is necessary here? >> Could you kindly help us clarify this? >> >> If anything wrong in above description, please feel free to correct >> me. >> > > Hi Stanley, > > Above description is correct. The reason why the UFS device becomes > Active after the 1st link startup in your experiment is due to you > set spm_lvl to 5, during system suspend, UFS device is powered down. > When resume kicks start, the UFS device is power cycled once. > > Moreover, if you set rpm_lvl to 5, during runtime suspend, if bkops is > enabled, the UFS device will not be powered off, meaning when runtime > resume kicks start, the UFS device is not power cycled, in this case, > we need 3 times of link startup. > > Does above explain? > > Thanks, > > Can Guo. > Hi Stanley, Sorry, typo before. I meant if set rpm_lvl/spm_lvl to 5, during suspend, if is_lu_power_on_wp is set, the UFS device will not be fully powered off (only VCC is down), meaning when resume kicks start, the UFS device is not power cycled, in this case, we need 3 times of link startup. Regards, Can Guo. >>> >>> Happy new year to you too! >>> >>> Thanks, >>> >>> Can Guo >> >> Thanks, >> >> Stanley >> >>> >>> _______________________________________________ >>> Linux-mediatek mailing list >>> Linux-mediatek@lists.infradead.org >>> http://lists.infradead.org/mailman/listinfo/linux-mediatek