Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp4469381ybz; Tue, 21 Apr 2020 00:54:47 -0700 (PDT) X-Google-Smtp-Source: APiQypL4p7iy2WjWT/CJYvEUuXyKEXIzE8s51G65mqOm5XU9/n6GwPvg4z8ygEToa7X904L2qny9 X-Received: by 2002:a17:906:6d95:: with SMTP id h21mr19905808ejt.66.1587455687648; Tue, 21 Apr 2020 00:54:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587455687; cv=none; d=google.com; s=arc-20160816; b=IglFxyYdA4ma7KXbu0pD6UxZ149ybmoy0uU7+cZ59qBlUMkYbUDQMLSAmLt+UiEMpA t1ZqlzIT+uRVHwOZ62UBVEkcdZRBow55E3uFARyNoGzf3yoLXoKT2BbtRS+VXuXHYFro bLxpdfHx2TN4p4A10zNantUDzqCt3UQdGmG/6E31iyZM5DrfPvfXeEYTAES52U3IpsQ9 27hQ/SAJzCrR51g+sUMsQCMm3CE3JBmjRLbmov3Hl9S98ENdx1daf4soQ+UG+79Xq39H Lhn4oyfp3Hp/ZNWT4coaeq9iK4/lEvyIHAnx62QE1s3pLSlouaRL9VUOZPaerMnYj+c3 R8Yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:dlp-filter:cms-type :content-language:thread-index:content-transfer-encoding :mime-version:message-id:date:subject:in-reply-to:cc:to:from :dkim-signature:dkim-filter; bh=+r0OP1H3iJ44Yz3O1PgyXWJYbt9pTQXZ6pMxnxpslHo=; b=YCk7fHLHWComVQBlHX+4vRd42SrTfTjXt2veJkVj67BPvdl3C32Ox7EL9K2gGfN0QC XJIjw8RTMRZyQL772nrn+IP/OnZ3s9HRSykdTRBBlz4rILkJImYjMkM7Z0GJ9keE0GCe /KTiXfhMiouU3Emt8B+Cq22WolcYDLjnklf9nO/Dtivh+npmLoesCkU1LchdmWxm8cXI c2tn9JdlB1rD9CdkFDR50TY5nHh6N4UPpMEOZcM0bUxl0RVXAmTmfr4sC37Y0XiSKG0R ccp3Gwj4d/Tsd8kqzqmQosUxJx8F0koU2If9Dtwa/3fUjgcaZMwp4YfkHU8njfI565d+ b14w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=tc+aNwHb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k16si1081018ejr.429.2020.04.21.00.54.24; Tue, 21 Apr 2020 00:54:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=tc+aNwHb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728082AbgDUHvq (ORCPT + 99 others); Tue, 21 Apr 2020 03:51:46 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:54168 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728023AbgDUHvq (ORCPT ); Tue, 21 Apr 2020 03:51:46 -0400 Received: from epcas2p1.samsung.com (unknown [182.195.41.53]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20200421075142epoutp04f64fe8d6bee5cd064d21470d8acf9b93~Hxl5kyOzP0064600646epoutp04I for ; Tue, 21 Apr 2020 07:51:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20200421075142epoutp04f64fe8d6bee5cd064d21470d8acf9b93~Hxl5kyOzP0064600646epoutp04I DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1587455502; bh=+r0OP1H3iJ44Yz3O1PgyXWJYbt9pTQXZ6pMxnxpslHo=; h=From:To:Cc:In-Reply-To:Subject:Date:References:From; b=tc+aNwHbhc5m520XsNZCCWwXswXTwjyTiTN9lZcj8u0NxzHu7Zodv9SqtpFmvlTJl pRZxf4MrunXrM81McOBZSaKFVzK9aI+o7OMuDe1Z5VjpRiFcC6Nzj/Ri2iZKvKDQXl jXYfwzrhVvP0HLi0GxLexhZV9EW/+lBV+m5UXXjo= Received: from epsnrtp3.localdomain (unknown [182.195.42.164]) by epcas2p2.samsung.com (KnoxPortal) with ESMTP id 20200421075141epcas2p26f29dddc42c4d73a3ea0956a97df7ab4~Hxl5GNyE53196431964epcas2p2W; Tue, 21 Apr 2020 07:51:41 +0000 (GMT) Received: from epsmges2p2.samsung.com (unknown [182.195.40.183]) by epsnrtp3.localdomain (Postfix) with ESMTP id 495wkL0ZTlzMqYkx; Tue, 21 Apr 2020 07:51:38 +0000 (GMT) Received: from epcas2p1.samsung.com ( [182.195.41.53]) by epsmges2p2.samsung.com (Symantec Messaging Gateway) with SMTP id 47.A7.04704.906AE9E5; Tue, 21 Apr 2020 16:51:37 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas2p2.samsung.com (KnoxPortal) with ESMTPA id 20200421075137epcas2p23b692423ff31029ea79b968eb9ade7e7~Hxl1AlqPN2296922969epcas2p2v; Tue, 21 Apr 2020 07:51:37 +0000 (GMT) Received: from epsmgms1p2new.samsung.com (unknown [182.195.42.42]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200421075137epsmtrp208a3eb3131f654d1b32a91bb3d91cacf~Hxl0-mDAR2553125531epsmtrp2f; Tue, 21 Apr 2020 07:51:37 +0000 (GMT) X-AuditID: b6c32a46-829ff70000001260-63-5e9ea609547f Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2new.samsung.com (Symantec Messaging Gateway) with SMTP id D6.04.04158.906AE9E5; Tue, 21 Apr 2020 16:51:37 +0900 (KST) Received: from KORCO011456 (unknown [12.36.185.54]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200421075137epsmtip2c02987a134833b7748371740e790f9a9~Hxl0vZmL70218802188epsmtip2a; Tue, 21 Apr 2020 07:51:37 +0000 (GMT) From: "Kiwoong Kim" To: "'Avri Altman'" , "'Alim Akhtar'" , , Cc: , , , , , , , In-Reply-To: Subject: RE: [PATCH v6 05/10] scsi: ufs: add quirk to fix abnormal ocs fatal error Date: Tue, 21 Apr 2020 16:51:37 +0900 Message-ID: <062001d617b1$af5f0aa0$0e1d1fe0$@samsung.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQJQDPill8kAmUENoj8JBCZ49rLenQIFk/WPAcfxkaoBmLD4p6dkF1Qg Content-Language: ko X-Brightmail-Tracker: H4sIAAAAAAAAA02Te0hTcRTH+e1ud1u1uk2zw6IY1x6ombvLratpT5FVQlJB9NSbuzhrr3a3 yCBcBb4qs6SwWZYaGgvTVsmwlLBIwspAy4qe5MqKCrUstaw7b5H/fc/v+zm/c87vIcOUt3GV LMvqZB1Wxkzi48QNNyN00fLq8q2a0x8S6FflDTj9fvAhTvfVVUvo9y0R9Jlb9yV0e3u9lPa9 eSShOxpP4XRpe7OIPtjlx+ma1hER/fu6X7pkgqGj6LDI4PMW4IbL53IMvYGnYkPRFS8y9Ptm GPJuHBSlSjeaE0wsY2QdataaYTNmWTMTyVVr05an6fQaKpqKoxeQaitjYRPJpJTU6OQsM98n qd7FmF38UirDcWTMogSHzeVk1SYb50wkWbvRbKco+zyOsXAua+a8DJslntJotDqeTDeb3vSe ldhrpu/uPjAsdqPGsEIklwERCy/7KvFCNE6mJPwIvtc/x4OGkuhD4PcZBWMAwUjrbdG/jH1H azDBaELw7U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9TECGELSpyc+QSslRloW+/DVkYY e9nC18wQ5ylI/Hy6jBXEFhFwk1h99gcbRI2IxOzONuYJjMKzkIyahWTULCSjZiFpWcDIsopR MrWgODc9t9iwwCgvtVyvODG3uDQvXS85P3cTIzgitbR2MJ44EX+IUYCDUYmHd4PYvDgh1sSy 4srcQ4wSHMxKIrwWWkAh3pTEyqrUovz4otKc1OJDjNIcLErivPL5xyKFBNITS1KzU1MLUotg skwcnFINjKbdtqoXtJZVLPOu7V5xecvG3Yobg3Z7Lg2t0TfPPKm1lmu3o3YP5zXVI74bFvyc 9D/9dNo59hdWE4X6F2pKpz57XTs7taxiQfXGxd9/PEiMkz6u9XPhQ8YchgNvnsksXGfyutKG zcAnR+186toNNYX3HiSkdc54WOzAf3RyxZQdX+xnNs0y+aXEUpyRaKjFXFScCABRJ6a3xAIA AA== X-CMS-MailID: 20200421075137epcas2p23b692423ff31029ea79b968eb9ade7e7 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: AUTO_CONFIDENTIAL X-CPGSPASS: Y CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20200417181016epcas5p2ee7ac86d743ceee9076690dc5b1e2f08 References: <20200417175944.47189-1-alim.akhtar@samsung.com> <20200417175944.47189-6-alim.akhtar@samsung.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > -----Original Message----- > From: Avri Altman > Sent: Monday, April 20, 2020 5:56 PM > To: Alim Akhtar ; robh=40kernel.org > Cc: devicetree=40vger.kernel.org; linux-scsi=40vger.kernel.org; > krzk=40kernel.org; martin.petersen=40oracle.com; kwmad.kim=40samsung.com; > stanley.chu=40mediatek.com; cang=40codeaurora.org; linux-samsung- > soc=40vger.kernel.org; linux-arm-kernel=40lists.infradead.org; linux- > kernel=40vger.kernel.org > Subject: RE: =5BPATCH v6 05/10=5D scsi: ufs: add quirk to fix abnormal oc= s > fatal error >=20 > > > > From: Kiwoong Kim > > > > Some architectures determines if fatal error for OCS occurrs to check > > status in response upiu. This patch > Typo - occurs >=20 > > is to prevent from reporting command results with that. > > > > Signed-off-by: Kiwoong Kim > > Signed-off-by: Alim Akhtar > > --- > > drivers/scsi/ufs/ufshcd.c =7C 6 ++++++ > > drivers/scsi/ufs/ufshcd.h =7C 6 ++++++ > > 2 files changed, 12 insertions(+) > > > > diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c > > index b32fcedcdcb9..8c07caff0a5c 100644 > > --- a/drivers/scsi/ufs/ufshcd.c > > +++ b/drivers/scsi/ufs/ufshcd.c > > =40=40 -4794,6 +4794,12 =40=40 ufshcd_transfer_rsp_status(struct ufs_hb= a *hba, > > struct ufshcd_lrb *lrbp) > > /* overall command status of utrd */ > > ocs =3D ufshcd_get_tr_ocs(lrbp); > > > > + if (hba->quirks & UFSHCD_QUIRK_BROKEN_OCS_FATAL_ERROR) =7B > > + if (be32_to_cpu(lrbp->ucd_rsp_ptr->header.dword_1) & > > + MASK_RSP_UPIU_RESULT) > > + ocs =3D OCS_SUCCESS; > > + =7D > > + > Not sure that I follow what this quirk is all about. > Your code overrides ocs by open coding ufshcd_get_rsp_upiu_result. >=20 > Normally OCS is in utp transfer req descriptor, dword 2, bits 0..7. > My understanding from your description, is that some fatal error might > occur, But the host controller does not report it, and it still needs to > be checked in the response upiu. > Evidently you are not doing so. > Please elaborate your description. >=20 > P.S. > The ocs is being evaluated in device management commands as well, Isn't > this something you need to attend? >=20 > Thanks, > Avri >=20 > > switch (ocs) =7B > > case OCS_SUCCESS: > > result =3D ufshcd_get_req_rsp(lrbp->ucd_rsp_ptr); > > diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h > > index a9b9ace9fc72..e1d09c2c4302 100644 > > --- a/drivers/scsi/ufs/ufshcd.h > > +++ b/drivers/scsi/ufs/ufshcd.h > > =40=40 -541,6 +541,12 =40=40 enum ufshcd_quirks =7B > > * resolution of the values of PRDTO and PRDTL in UTRD as byte. > > */ > > UFSHCD_QUIRK_PRDT_BYTE_GRAN =3D 1 << 9, > > + > > + /* > > + * This quirk needs to be enabled if the host controller report= s > > + * OCS FATAL ERROR with device error through sense data > > + */ > > + UFSHCD_QUIRK_BROKEN_OCS_FATAL_ERROR =3D 1 << 10, > > =7D; > > > > enum ufshcd_caps =7B > > -- > > 2.17.1 Avri As specified in the spec, OCS isn't supposed to refer to the contents of RE= SPONSE UPIU. But, Exynos host behaves like that in some cases, e.g. a value of 'state' i= n is isn't GOOD(00h). For QUERY RESPONSE, its offset, i.e. =22 dword_1=22 is reserved, so current= ly no impact, I think. But if you feel another condition is necessary to identify if this request = is QUERY REQEUST or not, we can add more. Thanks