From patchwork Mon Mar 7 02:43:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kiwoong Kim X-Patchwork-Id: 12771097 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4B4C0C433EF for ; Mon, 7 Mar 2022 02:44:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234847AbiCGCpg (ORCPT ); Sun, 6 Mar 2022 21:45:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55542 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234840AbiCGCpf (ORCPT ); Sun, 6 Mar 2022 21:45:35 -0500 Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5ED935F6E for ; Sun, 6 Mar 2022 18:44:42 -0800 (PST) Received: from epcas2p2.samsung.com (unknown [182.195.41.54]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20220307024440epoutp013bc29d2df05a5949b07751af19e58ba2~Z_SX94MkX1715117151epoutp01M for ; Mon, 7 Mar 2022 02:44:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20220307024440epoutp013bc29d2df05a5949b07751af19e58ba2~Z_SX94MkX1715117151epoutp01M DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1646621080; bh=/QqAj4sBooVJtWFQuaex7gP6M60iq909aZ1ni0qhM34=; h=From:To:Cc:Subject:Date:References:From; b=JiGxHoL4jXnkFfa4WSEMA9QKSRsAb9J4lvO2YdggRK2U/Y0V+1stXQXAcV3wuaXLY GUG8XjGJuI9Z3C/u1M7oOhTa7PbBy0EXaOwX1+/nt9dENrPKaUEGxYGJVgnsUi8Uxo oRGWeiAh1VwRqk+q+5oYuH1bkzZbLHTIeI2nrTt8= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas2p1.samsung.com (KnoxPortal) with ESMTP id 20220307024439epcas2p1cc2a030f46258e7245e759a752e28a0e~Z_SXZEBBx3136731367epcas2p1U; Mon, 7 Mar 2022 02:44:39 +0000 (GMT) Received: from epsmges2p1.samsung.com (unknown [182.195.36.102]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4KBjTw3ZTpz4x9Pv; Mon, 7 Mar 2022 02:44:36 +0000 (GMT) Received: from epcas2p3.samsung.com ( [182.195.41.55]) by epsmges2p1.samsung.com (Symantec Messaging Gateway) with SMTP id F4.92.51767.49175226; Mon, 7 Mar 2022 11:44:36 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas2p1.samsung.com (KnoxPortal) with ESMTPA id 20220307024436epcas2p1cb5b07d5149b37610819fa3d70af59ea~Z_ST-baMc3137231372epcas2p1D; Mon, 7 Mar 2022 02:44:36 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20220307024436epsmtrp24254fc720f43e0ffb41b96df539026e2~Z_ST_jWXB0107901079epsmtrp2I; Mon, 7 Mar 2022 02:44:36 +0000 (GMT) X-AuditID: b6c32a45-45dff7000000ca37-95-62257194e573 Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id 56.B7.29871.39175226; Mon, 7 Mar 2022 11:44:35 +0900 (KST) Received: from ubuntu.dsn.sec.samsung.com (unknown [12.36.155.120]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20220307024435epsmtip1566e26c09f85b0e6ea3de1a459ab92fc~Z_STyf5c12958629586epsmtip1R; Mon, 7 Mar 2022 02:44:35 +0000 (GMT) From: Kiwoong Kim To: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, alim.akhtar@samsung.com, avri.altman@wdc.com, jejb@linux.ibm.com, martin.petersen@oracle.com, beanhuo@micron.com, cang@codeaurora.org, adrian.hunter@intel.com, sc.suh@samsung.com, hy50.seo@samsung.com, sh425.lee@samsung.com, bhoon95.kim@samsung.com, vkumar.1997@samsung.com Cc: Kiwoong Kim Subject: [RESEND PATCH v1] scsi: ufs: exclude UECxx from SFR dump list Date: Mon, 7 Mar 2022 11:43:30 +0900 Message-Id: <1646621010-118886-1-git-send-email-kwmad.kim@samsung.com> X-Mailer: git-send-email 2.7.4 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpmk+LIzCtJLcpLzFFi42LZdljTXHdKoWqSwbzv0hYnn6xhs3gwbxub xcufV9ksDj7sZLH4uvQZq8Wn9ctYLVYvfsBisejGNiaLm1uOslhc3jWHzaL7+g42i+XH/zFZ dN29wWix9N9bFos79z+yOPB7XO7rZfJYvOclk8eERQcYPb6v72Dz+Pj0FotH35ZVjB6fN8l5 tB/oZgrgiMq2yUhNTEktUkjNS85PycxLt1XyDo53jjc1MzDUNbS0MFdSyEvMTbVVcvEJ0HXL zAG6XkmhLDGnFCgUkFhcrKRvZ1OUX1qSqpCRX1xiq5RakJJTYF6gV5yYW1yal66Xl1piZWhg YGQKVJiQndGz+wJbwU2uigevZzA2MB7n6GLk5JAQMJH4dWc+WxcjF4eQwA5GiRk7bzODJIQE PjFKrJvtA5H4xihx4c1jRpiOf3M/MEIk9jJKPP/0khnC+cEocfLAOyaQKjYBTYmnN6eC2SIC 15kk5m3PALGZBdQldk04ARYXFnCTuP2nnQXEZhFQlWhf+gRoEAcHL1D8whYfiGVyEjfPdTJD 2K0cEnffiEDYLhKPez+yQtjCEq+Ob2GHsKUkPr/bywYyRkKgWGLTPnmQ0yQEGhgllnzazAJR Yywx61k7I0gNM9CZ63fpQ5QrSxy5xQJxJJ9Ex+G/7BBhXomONiGIRmWJX5MmQ0NBUm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be4NC9dLzk/dxMjOGi1NHcwbl/1Qe8QIxMH4yFGCQ5m JRHe++dVkoR4UxIrq1KL8uOLSnNSiw8xSnOwKInzXug6GS8kkJ5YkpqdmlqQWgSTZeLglGpg qp6//ehT24NdO5p916ifPO5+Krgl/Y/L/qiAsrBzxduX392W/9J/yxfxug2Lwtf/vS4fUZld s0Hx3RdxL4/3Uns91iRuepXt8ezVBA399S2h+k/nyz22aLde+JL3+6N7077+U8xY57w+0Npx fsd1xfJvtlqHv741nSbx/7vEgTd/J7AGRm4pSVu88dnVrElTjuT+VQmTlTc29vu4ZMebv+nC fiZTthmE/tyxvfZMEd/pO5NVFsvN3eN3+dZ9TUVnrvpLqb0HdmopL8mPm7Dt4mGBf0rXS0+Y yDtv5JDplfxu0Ho1rKrx9bTtO0TtV+j/i49bbL9cYN+/hncF7LfvScRxyztvty9pD/5w8bTE E2MlluKMREMt5qLiRABJ1ZDZyQIAAA== X-CMS-MailID: 20220307024436epcas2p1cb5b07d5149b37610819fa3d70af59ea X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20220307024436epcas2p1cb5b07d5149b37610819fa3d70af59ea References: Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org These are ROC type things that means their values are cleared when the SFRs are read. They are usually read in ISR when an UIC error occur. Thus, their values would be zero at many cases. And there might be a little bit risky when they are read to be cleared before the ISR reads them, e.g. the case that a command is timed-out, ufshcd_dump_regs is called in ufshcd_abort and an UIC error occurs at the nearly same time. In this case, ISR will be called but UFS error handler will not be scheduled. This patch is to make UFS driver not read those SFRs in the dump function, i.e. ufshcd_dump_regs. Signed-off-by: Kiwoong Kim --- drivers/scsi/ufs/ufshcd.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 460d2b4..8b65c081 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -115,8 +115,12 @@ int ufshcd_dump_regs(struct ufs_hba *hba, size_t offset, size_t len, if (!regs) return -ENOMEM; - for (pos = 0; pos < len; pos += 4) + for (pos = 0; pos < len; pos += 4) { + if (pos >= REG_UIC_ERROR_CODE_PHY_ADAPTER_LAYER && + pos <= REG_UIC_ERROR_CODE_DME) + continue; regs[pos / 4] = ufshcd_readl(hba, offset + pos); + } ufshcd_hex_dump(prefix, regs, len); kfree(regs);