Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp478004rwo; Tue, 1 Aug 2023 21:59:17 -0700 (PDT) X-Google-Smtp-Source: APBJJlGne3e7runSz59FqK+U9IA0DaIhM7t/6DpyjeiQI4rTgnsUqQ04JJE2fWSWgm/28wMTmD60 X-Received: by 2002:a05:620a:2ee:b0:76c:b7e6:e628 with SMTP id a14-20020a05620a02ee00b0076cb7e6e628mr6493446qko.25.1690952357118; Tue, 01 Aug 2023 21:59:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690952357; cv=none; d=google.com; s=arc-20160816; b=CDfNxAkofxcQ+dr9z83ta8YWOXipx7TEn4HPX443WJeo52gjSnuu8MyTC+DQxXfvTR 6rlJZKXkR+ECE0KAtgfLjFasvDktCM28FszoMBTsO3EOhlnL6xg2KtrhnStwmhJGMy0p NvQT+P433O1xXDwOIHhaBZSVytjObVQJMtkTs/j2k9bJvERix7jFMLAXUiwbAiAsnDWI g4Vj2f9wAoAaD+8Tnq5UkXZEc/Ijo/OzU1poarAScvVnpYu7/ty3+LmhK6lQL2TBK6y8 Qjp3v8zciq9mG8TMWpv5Bpujn6kadfEnD4LLz1SDRgV8S96oyLfvJoL9I4T9a5H6jT37 FMZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=JWhvScFZvLWNx9f8lp1JhnHN/g3ZbyQ0m8JkxOc8EyE=; fh=E8+1R2oLTyM/hYoPpgaEo4f0oDwJmmQx5p2r1F8wQRM=; b=SSVi98ROcea9N5y9Ii7hkvD7gRS6PJu7qOdwiXPHOepKLw3M+Mdg04i8GN2SSz4XQO e/wjwKCqCSDn9hfnVZdLNmfPANwSwHdnLEMnI6pgt0ZB+PjQ8nvy6LQwwokIXOgRkWD0 3GvkmOkcEUgvyewkq0Ui65irpFejZvsk/gdAoFLON4pmyskcNIPl2G3nwrHieZPCZty8 FwqYOnHYxb/Ff4LDauqYMjtJX4iJI7s1xdBY6wwpYQ7HAxM+CFAP/jYIAM7GC6L+jKmx LuG18qI4ygR39pNnwNHsPuGPkYWL8AERmtrMdHKJk50K99D7tgfogxmpT3aM88PFuFfS hxPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=C6Fbde6D; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q79-20020a632a52000000b0055fe651e9cesi4920636pgq.796.2023.08.01.21.59.05; Tue, 01 Aug 2023 21:59:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=C6Fbde6D; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230409AbjHBEKx (ORCPT + 99 others); Wed, 2 Aug 2023 00:10:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232070AbjHBEKn (ORCPT ); Wed, 2 Aug 2023 00:10:43 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 99A7CFE; Tue, 1 Aug 2023 21:10:38 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6771D617B2; Wed, 2 Aug 2023 04:10:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 702DCC4160E; Wed, 2 Aug 2023 04:10:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690949436; bh=CW5MQD6wbPn2XWv3mTPcvjccKvbQtz4v/5O98VDOY8U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=C6Fbde6DnVnnKeIbxZkFR398Uc5YYsorRG01i6rljwGuuwOh6XPiPXfYFZkmCMpDv om6QeBWAYH3mM0cGcUpScnBQP4ZdEuR1osEmdtKV4MpHZeczTmDaDB0Ezgyg2ZhM7N y+7Da+lYC3ftEpMs+EjEL+dP5xOJv5Rqm4sIYmOfyIIWKV/kDSbWF12pQiQgVlR+9V 2gX1zzZUAu7Pnpoq6LcDtEtfM52GcfGPPzgWYzpoW7OnpYzxhZ4kK4DAepaIC66iIk 6N655rYDaz3/U+YsPCQvUaISJzh9mD14bR0/mWz67z70UW+AGAp7iPGh0o4f0pUslH mgEt/nLKPJ6ew== Date: Wed, 2 Aug 2023 09:40:19 +0530 From: Manivannan Sadhasivam To: Nitin Rawat Cc: powen.kao@mediatek.com, bvanassche@acm.org, alim.akhtar@samsung.com, adrian.hunter@intel.com, jejb@linux.ibm.com, stanley.chu@mediatek.com, asutoshd@codeaurora.org, quic_cang@quicinc.com, martin.petersen@oracle.com, beanhuo@micron.com, ebiggers@google.com, agross@kernel.org, Arthur.Simchaev@wdc.com, konrad.dybcio@linaro.org, quic_ziqichen@quicinc.com, quic_nguyenb@quicinc.com, quic_narepall@quicinc.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, Manish Pandey Subject: Re: [PATCH V2 2/2] scsi: ufs: ufs-qcom: check host controller state Message-ID: <20230802041019.GC2370@thinkpad> References: <20230726134140.7180-1-quic_nitirawa@quicinc.com> <20230726134140.7180-3-quic_nitirawa@quicinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230726134140.7180-3-quic_nitirawa@quicinc.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 26, 2023 at 07:11:40PM +0530, Nitin Rawat wrote: > Commit <52a518019ca1> (Fix missing clk change notification) added UFS > clock scaling notification to ufshcd_host_reset_and_restore. This > invokes hibern8 enter and exit on qualcomm platform which fails because > controller is in reset state. > > Fix this by checking the Host controller state before sending > hibern8 command. > > __ufshcd_wl_resume() > ufshcd_reset_and_restore() > ufshcd_host_reset_and_restore() > ufshcd_scale_clks() > ufshcd_vops_clk_scale_notify() > ufs_qcom_clk_scale_notify() > ufshcd_uic_hibern8_enter() > > Fixes: 52a518019ca1 ("scsi: ufs: core: Fix missing clk change notification on host reset") > Nit: No need of a newline here. > Co-developed-by: Manish Pandey > Signed-off-by: Manish Pandey > Signed-off-by: Nitin Rawat Acked-by: Manivannan Sadhasivam - Mani > --- > drivers/ufs/host/ufs-qcom.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c > index 8d6fd4c3324f..95412e98a598 100644 > --- a/drivers/ufs/host/ufs-qcom.c > +++ b/drivers/ufs/host/ufs-qcom.c > @@ -1254,6 +1254,10 @@ static int ufs_qcom_clk_scale_notify(struct ufs_hba *hba, > struct ufs_pa_layer_attr *dev_req_params = &host->dev_req_params; > int err = 0; > > + /* check the host controller state before sending hibern8 cmd */ > + if (!ufshcd_is_hba_active(hba)) > + return 0; > + > if (status == PRE_CHANGE) { > err = ufshcd_uic_hibern8_enter(hba); > if (err) > -- > 2.17.1 > -- மணிவண்ணன் சதாசிவம்