From patchwork Wed Dec 13 02:25:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chanwoo Lee X-Patchwork-Id: 13490276 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="MREF7QEX" Received: from mailout4.samsung.com (mailout4.samsung.com [203.254.224.34]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10EB8AF for ; Tue, 12 Dec 2023 18:25:32 -0800 (PST) Received: from epcas1p3.samsung.com (unknown [182.195.41.47]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20231213022527epoutp04eca50866b28c815ee518fafc2687fe19~gQwA8MY2-2192321923epoutp04K for ; Wed, 13 Dec 2023 02:25:27 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20231213022527epoutp04eca50866b28c815ee518fafc2687fe19~gQwA8MY2-2192321923epoutp04K DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1702434327; bh=llvFRz0oCIQGbziuHlF3lamYUb4g/Mx7VDSl7Hr2w70=; h=From:To:Cc:Subject:Date:References:From; b=MREF7QEXKe+dQZ+lY1apYWdgC1csNidjjpTUwXMhX0irDESLtcqQrYmeHkRW8gJU4 yTSSXcfmrnAIX0xsH8g9ctcoYP5ZRBHnvcKAuUrMegg141wB3MUaZmxaxWGOFVbvb9 UYKfruGoJpFrwqVC0Z+jstWRx/1+2UGkcW4gfQWU= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas1p2.samsung.com (KnoxPortal) with ESMTP id 20231213022526epcas1p2768b522dbed430c04325c5b3cbf83748~gQwAMzc1f2140721407epcas1p2U; Wed, 13 Dec 2023 02:25:26 +0000 (GMT) Received: from epsmges1p1.samsung.com (unknown [182.195.36.222]) by epsnrtp3.localdomain (Postfix) with ESMTP id 4SqfTf1kQzz4x9Px; Wed, 13 Dec 2023 02:25:26 +0000 (GMT) Received: from epcas1p1.samsung.com ( [182.195.41.45]) by epsmges1p1.samsung.com (Symantec Messaging Gateway) with SMTP id C0.46.09744.61619756; Wed, 13 Dec 2023 11:25:26 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas1p2.samsung.com (KnoxPortal) with ESMTPA id 20231213022525epcas1p219483a7572a12394c5852cd53a367da4~gQv-VaPJX2004720047epcas1p2x; Wed, 13 Dec 2023 02:25:25 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20231213022525epsmtrp16b95d43d02cf2ec71c1652b30a3c6ee1~gQv-UfYN22117621176epsmtrp1m; Wed, 13 Dec 2023 02:25:25 +0000 (GMT) X-AuditID: b6c32a35-107fa70000002610-2a-657916166080 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id FD.34.08755.51619756; Wed, 13 Dec 2023 11:25:25 +0900 (KST) Received: from localhost.localdomain (unknown [10.253.100.232]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20231213022525epsmtip24ac15f90dc60a39a5845e2e7522a8a28~gQv-E9HGZ0163101631epsmtip27; Wed, 13 Dec 2023 02:25:25 +0000 (GMT) From: Chanwoo Lee To: mani@kernel.org, agross@kernel.org, andersson@kernel.org, konrad.dybcio@linaro.org, jejb@linux.ibm.com, martin.petersen@oracle.com, p.zabel@pengutronix.de, linux-arm-msm@vger.kernel.org, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: grant.jung@samsung.com, jt77.jang@samsung.com, dh0421.hwang@samsung.com, sh043.lee@samsung.com, ChanWoo Lee Subject: [PATCH] scsi: ufs: qcom: Re-fix for error handling Date: Wed, 13 Dec 2023 11:25:00 +0900 Message-Id: <20231213022500.9011-1-cw9316.lee@samsung.com> X-Mailer: git-send-email 2.29.0 Precedence: bulk X-Mailing-List: linux-scsi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrEJsWRmVeSWpSXmKPExsWy7bCmrq6YWGWqQccmbotzj3+zWGzrsLGY caqN1WLftZPsFr/+rme3WHRjG5PFjudn2C06Jm9nsZi4/yy7xeVdc9gsuq/vYLM48GEVo8Xy 4/+YLO7eO8Fi0fRnH4sDv8emVZ1sHneu7WHzmLDoAKPHx6e3WDz6/xp49G1ZxejxeZNcAHtU tk1GamJKapFCal5yfkpmXrqtkndwvHO8qZmBoa6hpYW5kkJeYm6qrZKLT4CuW2YO0NlKCmWJ OaVAoYDE4mIlfTubovzSklSFjPziElul1IKUnAKzAr3ixNzi0rx0vbzUEitDAwMjU6DChOyM tgXnWAue8lcsbJzB1MD4naeLkZNDQsBE4vShq8wgtpDADkaJ/y8luxi5gOxPjBL717UyQzjf GCWe/drHDNPxc1cnG0RiL6PE5nMLoZwvjBIrP58Hcjg42AS0JG4f8waJiwj8ZZRYfKaLEcRh FuhilPh1sIsFZJSwgLXEjLdr2UBsFgFViZYPjxlBbF4BK4l53x9CrZOX+HO/hxkiLihxcuYT sF5moHjz1tlg90kIzOSQ2N90mR2iwUXi3qMnbBC2sMSr41ug4lISL/vb2CEamhklFr45DtU9 gVHiy8fbUB32Es2tzWA/MAtoSqzfpQ8RVpTY+XsuI8RmPol3X3tYQUokBHglOtqEIEpUJOZ0 nWOD2fXxxmNWCNtD4s7vKeyQEI6V+Pi+l20Co/wsJP/MQvLPLITFCxiZVzGKpRYU56anFhsW GMLjNTk/dxMjOPFqme5gnPj2g94hRiYOxkOMEhzMSiK8J3eUpwrxpiRWVqUW5ccXleakFh9i NAWG8ERmKdHkfGDqzyuJNzSxNDAxMzKxMLY0NlMS5z1zpSxVSCA9sSQ1OzW1ILUIpo+Jg1Oq genEjS7nw9VHT1rcXReypvIqv0H0tdDNRWYGf+cc+l364sIu+WtvQxWtdtmsqXZ963dE3KvJ sr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wn/Xsc0mqfzFtqwxBaIvT+f67Kqu7FhXOufred 9iPz/VkL7/9eHmdyrqwz+bnqtIyZjvvdG3t8Nde4uVfOTvh//15zB49IeF7mI41j7D7Hvk5Y /ro4VVT7/U/m2qLADUtmnD0kaeYz88KCE0nnXCskHy1dwuIn3LvPOue/wcbpWZ2397zyLAwx j0sqOmu2MWVb2h+x1a/2n2Pcr8RSnJFoqMVcVJwIAD9GZU/yAgAA X-CMS-MailID: 20231213022525epcas1p219483a7572a12394c5852cd53a367da4 X-Msg-Generator: CA X-Sendblock-Type: SVC_REQ_APPROVE CMS-TYPE: 101P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20231213022525epcas1p219483a7572a12394c5852cd53a367da4 References: From: ChanWoo Lee I modified the code to handle errors. The error handling code has been changed from the patch below. -'commit 031312dbc695 ("scsi: ufs: ufs-qcom: Remove unnecessary goto statements")' What I have confirmed are three cases. 1) ufs_qcom_host_reset -> 'reset_control_deassert' error -> return 0; 2) ufs_qcom_clk_scale_notify -> 'ufs_qcom_clk_scale_up_/down_pre_change' error -> return 0; 3) ufs_qcom_init_lane_clks -> 'ufs_qcom_host_clk_get(tx_lane1_sync_clk)' error -> return 0; It is unknown whether the above commit was intended to change error handling. However, if it is not an intended fix, a patch may be needed. Signed-off-by: ChanWoo Lee --- drivers/ufs/host/ufs-qcom.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/ufs/host/ufs-qcom.c b/drivers/ufs/host/ufs-qcom.c index 96cb8b5b4e66..8a93d93ab08f 100644 --- a/drivers/ufs/host/ufs-qcom.c +++ b/drivers/ufs/host/ufs-qcom.c @@ -313,6 +313,8 @@ static int ufs_qcom_init_lane_clks(struct ufs_qcom_host *host) err = ufs_qcom_host_clk_get(dev, "tx_lane1_sync_clk", &host->tx_l1_sync_clk, true); + if (err) + return err; } return 0; @@ -404,9 +406,11 @@ static int ufs_qcom_host_reset(struct ufs_hba *hba) usleep_range(200, 210); ret = reset_control_deassert(host->core_reset); - if (ret) + if (ret) { dev_err(hba->dev, "%s: core_reset deassert failed, err = %d\n", __func__, ret); + return ret; + } usleep_range(1000, 1100); @@ -415,7 +419,7 @@ static int ufs_qcom_host_reset(struct ufs_hba *hba) hba->is_irq_enabled = true; } - return 0; + return ret; } static u32 ufs_qcom_get_hs_gear(struct ufs_hba *hba) @@ -1535,7 +1539,7 @@ static int ufs_qcom_clk_scale_notify(struct ufs_hba *hba, ufshcd_uic_hibern8_exit(hba); } - return 0; + return err; } static void ufs_qcom_enable_test_bus(struct ufs_qcom_host *host)