Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1060614ybl; Sat, 18 Jan 2020 17:48:52 -0800 (PST) X-Google-Smtp-Source: APXvYqyRimqoo0oxvq5sgyaedW43LSOrf0VSgbg/FvbtYgy9T8A1EChg+fO5we5FWksaknvNA9dM X-Received: by 2002:aca:cf58:: with SMTP id f85mr8713044oig.6.1579398532093; Sat, 18 Jan 2020 17:48:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579398532; cv=none; d=google.com; s=arc-20160816; b=0F2YZ+KZb4L7lBpH/8fUqba/hpXgnnGLbfah9WDsyLYbAnkExxSvPEe3qgcdgOakM7 DKW0Uc/zsbeGbqH0Q45JWyf/ZzWgKAIeI2U4j2evitdGlBF1seer2RwnBl1GoKr8G/0B btH+rSJEPKbLkHqtZrjXGbTLQ45dsHpES2ZVfFpToup8UoP04Ew/FUQkx+fSMbPyI82R rCNxKTp8gjaRM7aEPz6Vtp39vDh3XvYbZtD7MwSnOicw9A7oBZlOyLXEAeuKNlNeOMEH QCOB/fOAIaUUnEx6Q4FpPSi7v7Pqlrm/j+hIudeTYOF7b4wosTDMO/d1u+wg/VUBDZ8k tUkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=3v0B8Le5lxMadkMRa3e2JgX6hIzD2hcV6YftiYMITR8=; b=fu6guifmuwH/jHlh44EGao9ectARPW/pExYYICo7dU2P1wQYZ+KgXrcSIv/EA+VOwU R0lEPmZn8xA+psgZFpgwYjxq+mQLmPQTo/Cs46zd1/zlcq+ZXEP96GjMyEHNm6nhZjFG Xrj9yXS0dm62P1aq1EmiZMharecsQVF/c684tiXVGSilSND3lDd+LzbLlg6A9mFim8uU XWSAl/B8lG5VjiF0yxOGkhakocfvA4eSNZnwMMMWS84X2gtyJbxOM8pu0O3ldxHhRa3k 9ULRQXzGGsqjWdnGXCRbRbabj9xqeEEoUYbTrgTAiBBY7QtUMDKx4eR3uHlURr86VHvf g4uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=CWXTz14M; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q7si9054549oti.268.2020.01.18.17.48.40; Sat, 18 Jan 2020 17:48:52 -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=pass header.i=@gmail.com header.s=20161025 header.b=CWXTz14M; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728900AbgASBrq (ORCPT + 99 others); Sat, 18 Jan 2020 20:47:46 -0500 Received: from mail-ua1-f67.google.com ([209.85.222.67]:41454 "EHLO mail-ua1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728779AbgASBrp (ORCPT ); Sat, 18 Jan 2020 20:47:45 -0500 Received: by mail-ua1-f67.google.com with SMTP id f7so10312444uaa.8; Sat, 18 Jan 2020 17:47:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=3v0B8Le5lxMadkMRa3e2JgX6hIzD2hcV6YftiYMITR8=; b=CWXTz14MldaQ8NFRuPUDqtUwKNQEeAOc2ejaQcpc53fJW++zwkB2samiCA9ICBASEh XS8IeiYwSOxpmGFI6r77dezGAGgCdbdWujJZH4rQid80ZFdJbN3H49+lxC1eymoJ8J7O jnClshx2OdBSDvp+m1P0tnKOemgYDDJSlDQ93lUKbpAfUIIoH2A7bMeexQXzH2LkgZl+ B9KBE4AIglQhynZZgCAQEgJODjTFR2Lm6PHeslefFoGYJB45ODaqogzF0tlCwQnritdG oYWCYD8X4yctaHUW9kHH8tUZM+Zajd0E0lzDMWDj6H+xWSZkCgLSmsXuQ1tp71pnO+4b Y6fA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=3v0B8Le5lxMadkMRa3e2JgX6hIzD2hcV6YftiYMITR8=; b=jtTcGUMD7BBwHElcAil5aBsY6wkFgUNdcNcgpI/d2FbtWV3sjNENZGmCbxrWG8Qv/G vA8EK9BriW/b/A/VK5qRC6Ti7ib+U19zoiWxazd3ldzkvZ6zKynQ7UV1OBVc+KZQW9zV tkUyHn4d4vpcUAeqL0Vj7yR9hdL05z4oGcpvL1PIyiIwcl5v1E0mC8/S29tUmsrOXx4C qn172C2RepmwkSnXELsalkxaSQIjVYd7MC2DLfaLx1rZbFMVHVnL53dyoFVXTHweq0Wf rUIbpZtFpWkClcbChzxX8slILUJ1MWjYIw47fRUR/SwBK8yu7yCou88rOeKZ/aih1e3R C6bw== X-Gm-Message-State: APjAAAUGe5JVxnNxIwLAegoBk4RbZHpgg8KWD/cwAHQ3e2CpJJwxuVfS qJEuSfo0CsNrTKhSSoXBfwDOK4rkAs0yrRtRgMQ= X-Received: by 2002:ab0:7049:: with SMTP id v9mr6173663ual.95.1579398463653; Sat, 18 Jan 2020 17:47:43 -0800 (PST) MIME-Version: 1.0 References: <20200119001327.29155-1-huobean@gmail.com> <20200119001327.29155-5-huobean@gmail.com> In-Reply-To: <20200119001327.29155-5-huobean@gmail.com> From: Alim Akhtar Date: Sun, 19 Jan 2020 07:17:07 +0530 Message-ID: Subject: Re: [PATCH v3 4/8] scsi: ufs: move ufshcd_get_max_pwr_mode() to ufs_init_params() To: Bean Huo Cc: Alim Akhtar , Avri Altman , asutoshd@codeaurora.org, "James E.J. Bottomley" , "Martin K. Petersen" , Stanley Chu , "Bean Huo (beanhuo)" , Bart Van Assche , Tomas Winkler , Can Guo , linux-scsi@vger.kernel.org, open list Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jan 19, 2020 at 5:44 AM Bean Huo wrote: > > From: Bean Huo > > ufshcd_get_max_pwr_mode() only need to be called once while booting, > take it out from ufshcd_probe_hba() and inline into ufshcd_init_params(). > This can be safely squash with the previous patch which introduce ufshcd_init_params. > Signed-off-by: Bean Huo > --- > drivers/scsi/ufs/ufshcd.c | 12 +++++++----- > 1 file changed, 7 insertions(+), 5 deletions(-) > > diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c > index 54c127ef360b..925b31dc3110 100644 > --- a/drivers/scsi/ufs/ufshcd.c > +++ b/drivers/scsi/ufs/ufshcd.c > @@ -6959,6 +6959,11 @@ static int ufshcd_init_params(struct ufs_hba *hba) > QUERY_FLAG_IDN_PWR_ON_WPE, &flag)) > hba->dev_info.f_power_on_wp_en = flag; > > + /* Probe maximum power mode co-supported by both UFS host and device */ > + if (ufshcd_get_max_pwr_mode(hba)) > + dev_err(hba->dev, > + "%s: Failed getting max supported power mode\n", > + __func__); > out: > return ret; > } > @@ -7057,11 +7062,8 @@ static int ufshcd_probe_hba(struct ufs_hba *hba, bool async) > ufshcd_force_reset_auto_bkops(hba); > hba->wlun_dev_clr_ua = true; > > - if (ufshcd_get_max_pwr_mode(hba)) { > - dev_err(hba->dev, > - "%s: Failed getting max supported power mode\n", > - __func__); > - } else { > + /* Gear up to HS gear if supported */ > + if (hba->max_pwr_info.is_valid) { > /* > * Set the right value to bRefClkFreq before attempting to > * switch to HS gears. > -- > 2.17.1 > -- Regards, Alim