Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp368897pxb; Mon, 13 Sep 2021 22:15:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJKvNK53zRxDEbFW4lAyWcNo49kSK3mZWWUKXTjEpB0KZZIyoUK++oPE6av/hl0HiJOhl4 X-Received: by 2002:a05:6602:1493:: with SMTP id a19mr12085393iow.55.1631596507629; Mon, 13 Sep 2021 22:15:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631596507; cv=none; d=google.com; s=arc-20160816; b=JBCiGg/N1ETIawcayrt//7zKgEJImxTk0FK0BC4HzU+LgR5oxpt0XxV1L74QClSNr9 nbPko8FfWfzPnZQ2wKCTw0Wwz5Z2uqswZDA+eO1B6jKIj2WK9ATIb8VB4s5wf2lVra0W RzbwYi7O3EWcuILsLVbIMF+HH0CE4Il3wG6MvClmhp+AfHDDmwHoTT3CAK9/evk/qJFq sDtPqGl4zQhzyZ8NNfgkAOvCdw6sHoWO9dLXxBVBCnswENoxrELre3aWNoGgsAyQ36/1 iC5Vt84scMXTUwUpdNsoJQYs1SW9/1u2HcBfGdj0YqEPhNTnVFCr6SnKFaXS4MaVHmuD 6mtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:dlp-filter:cms-type:content-language :thread-index:content-transfer-encoding:mime-version:message-id:date :subject:in-reply-to:to:from:dkim-signature:dkim-filter; bh=JLuq6AO/ksQvXrLNL6IREO3MRAbg4xmAgIuiG+kBEVY=; b=s2dAxGboI9146OSk0M5L73JuLrrrPO3EFhPobtNdSxe+Zifqg5FtIdcI5x5PlrVj1S XdNak1KTfAaUNfgnLERM5TN6yvKoZieRlrOguaC6cMedSITve2sOWcUV+Bp3cXAEypMm OGIN4y4pErD6WpQ+7HGB93zB2eSqQ3rgiz83XhJjdNlhpvEdcRTuOsPM5KSDOaPZVb+t JRR/4TiK4IvbbL07WowRZOfiTIIdD8gpfiKbZOjoM75x9TTtwXk7YREVx9VK5o4QS/h8 whz7T0/B4FJoI6/OQ4ELH/y1KnnuOJv81zd72Ef6p8b4duNwIo0clzs7aUo0RplGEMrd eDkw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=BHPPChJv; 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 f46si8542737jaa.87.2021.09.13.22.14.56; Mon, 13 Sep 2021 22:15:07 -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=BHPPChJv; 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 S239429AbhINFOP (ORCPT + 99 others); Tue, 14 Sep 2021 01:14:15 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:62006 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239265AbhINFON (ORCPT ); Tue, 14 Sep 2021 01:14:13 -0400 Received: from epcas2p4.samsung.com (unknown [182.195.41.56]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20210914051255epoutp03d8b390b258a030a539c67db3c3bf1f67~kmEI98pDd1074710747epoutp03e for ; Tue, 14 Sep 2021 05:12:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20210914051255epoutp03d8b390b258a030a539c67db3c3bf1f67~kmEI98pDd1074710747epoutp03e DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1631596375; bh=JLuq6AO/ksQvXrLNL6IREO3MRAbg4xmAgIuiG+kBEVY=; h=From:To:In-Reply-To:Subject:Date:References:From; b=BHPPChJvWx/Ppd3HA63+vqg9oK9Orr/lsx5z6CIOHvfKupbzW3hYnVi19x/Vq1tj3 0EWtNExEUFFmd0O52iv2YxuvkRrd/LxCvFlyXh05LWbkePcZwoCuXs0MzVySiVM8ed PYYs3Blq3JzfaKLOCQwJtbETQ+7pqAVX+7VVrepc= Received: from epsnrtp4.localdomain (unknown [182.195.42.165]) by epcas2p3.samsung.com (KnoxPortal) with ESMTP id 20210914051248epcas2p35b4a42880a304db80e92f36b7997c675~kmECyqXyj2605426054epcas2p3x; Tue, 14 Sep 2021 05:12:48 +0000 (GMT) Received: from epsmges2p4.samsung.com (unknown [182.195.40.189]) by epsnrtp4.localdomain (Postfix) with ESMTP id 4H7s192tyhz4x9QX; Tue, 14 Sep 2021 05:12:45 +0000 (GMT) Received: from epcas2p2.samsung.com ( [182.195.41.54]) by epsmges2p4.samsung.com (Symantec Messaging Gateway) with SMTP id 3B.D1.09472.C4F20416; Tue, 14 Sep 2021 14:12:44 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas2p3.samsung.com (KnoxPortal) with ESMTPA id 20210914051242epcas2p3f63bdaf828a4f376517111ef7af1a786~kmD9HR6Ao0381203812epcas2p3w; Tue, 14 Sep 2021 05:12:42 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20210914051242epsmtrp1a411ce978d33a6b181ac2ce7591f404e~kmD9GaHxL1880618806epsmtrp1K; Tue, 14 Sep 2021 05:12:42 +0000 (GMT) X-AuditID: b6c32a48-d5fff70000002500-f1-61402f4c5c98 Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id 36.2D.08750.A4F20416; Tue, 14 Sep 2021 14:12:42 +0900 (KST) Received: from KORCO011456 (unknown [12.36.185.54]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20210914051242epsmtip1fc4037ce5d4520028ae48515847e189b~kmD80cAu21693416934epsmtip1L; Tue, 14 Sep 2021 05:12:42 +0000 (GMT) From: "Kiwoong Kim" To: "'Bart Van Assche'" , , , , , , , , , , , , , In-Reply-To: Subject: RE: [PATCH v2 3/3] scsi: ufs: ufs-exynos: implement exynos isr Date: Tue, 14 Sep 2021 14:12:41 +0900 Message-ID: <000001d7a927$252e77e0$6f8b67a0$@samsung.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQFyn/7MkbxYHt33UvraYb1f3WYrLgHrEvTlAh5z/LMCMoADnqw7Jm5w Content-Language: ko X-Brightmail-Tracker: H4sIAAAAAAAAA01TfUwTZxjfe3c9CqPu1uJ412VLd8RkuAEt2HKMj5CMwC3AZNmWZc6lHvQC zH6tVzacRsnAUkFAMLIJbmOA3bTEJsgYdloZoIiKLKITHWLdqJEiwiCmIELWW2vGf7/3eX8f z/N+CFHxFVwqLNabWZOe0ZJ4GNbdH62KyYlLZ+SjVjE1NNmBU+7vunFqauk6Tv12dx9GPTp6 T0A1zi2h1LzDJqDsbW6Mah3rRqhR5xGcqr7Rg1M/Dq4iVNXtMUAdXZ3B0tfRo9ey6dHaGoRu Oz2F0AdaewHtc1hx+h/PLYyu7ToO6IXOV+jK3mokL3SLNqWIZTSsScbqCwyaYn1hKpn9nvot tVIlV8QokqhEUqZndGwqmZGTF5NZrPU3T8o+Z7Ql/lIew3FkXFqKyVBiZmVFBs6cSrJGjdao UBhjOUbHlegLYwsMujcVcnm80s/cpi1qaKzHjddh6cSNh6AMDEuqQKgQEpug93QlXgXChGKi B0B31SUssJgH8GLjSSSwWACw49xZwVPJk6sngywngO31NUH9fQAHV5ZD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YOTkkBEwk/lzazNLFyMUh JLCDUWLO36WsEAlJiRM7nzNC2MIS91uOsEIUPWOUOLj/MjtIgk1AW2Law91gCRGBKcwSd64d ZYOo6mSSaL/wBGguBwengLXEsa16IA3CAu4Sc5b8AJvKIqAqsWJnAxOIzStgKTGp4x8rhC0o cXImSCsnBzPQgqc3n8LZyxa+Zoa4SEHi59NlrCDjRQTcJL4/SoEoEZGY3dnGPIFRaBaSSbOQ TJqFZNIsJC0LGFlWMUqmFhTnpucWGxYY5aWW6xUn5haX5qXrJefnbmIEx6iW1g7GPas+6B1i ZOJgPMQowcGsJMK77Y1tohBvSmJlVWpRfnxRaU5q8SFGaQ4WJXHeC10n44UE0hNLUrNTUwtS i2CyTBycUg1M/gu0uM8eSZrLnxS7Qmlu+QyfSTs2S1zddTDDxqvXOSoiZU329z9GCnXTdQP7 GY8/f/nzY+l9biMJg3n7+WOmsuhxabGxri60j/meE/UrnqH8U87r/l9Ts05HCRSr8iUwPHr9 cs/cjxf2XHjE/Ktm5VePJNbFEQLZ/2qX36ycytP06elhxiV7W3sOF4R+8Z1frV+dyb+9MeJ/ YMUkYyftGr9Jpflx87ozN/0yzJt40YLzusNOhe2pG7h74xhf+upselrfM+Wj8+f6B8qR2x5X 7Xhn8WzNa6F7Rx6wfI3k2xlh8FL/0WRhdZP0yPj3MV/iZNblreLLf6whvnnDJ/OW3K97DsTX t/9zk0tWj/JTYinOSDTUYi4qTgQA2kZgukADAAA= X-CMS-MailID: 20210914051242epcas2p3f63bdaf828a4f376517111ef7af1a786 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20210913081152epcas2p2eac4a8dbef33164a150dccf2e282dcce References: <746e059782953fca6c21945297151d2bb73d3370.1631519695.git.kwmad.kim@samsung.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On 9/13/21 12:55 AM, Kiwoong Kim wrote: > > This patch is to raise recovery in some abnormal conditions using an > > vendor specific interrupt for some cases, such as a situation that > > some contexts of a pending request in the host isn't the same with > > those of its corresponding UPIUs if they should have been the same > > exactly. > > > > The representative case is shown like below. > > In the case, a broken UTRD entry, for internal coherent problem or > > whatever, that had smaller value of PRDT length than expected was > > transferred to the host. > > So, the host raised an interrupt of transfer complete even if device > > didn't finish its data transfer because the host sees a fetched > > version of UTRD to determine if data tranfer is over or not. Then the > > application level seemed to recogize this as a sort of corruption and > > this symptom led to boot failure. >=20 > How can a UTRD entry be broken? Does that perhaps indicate memory > corruption at the host side? Working around host-side memory corruption i= n > a driver seems wrong to me. I think the root cause of the memory > corruption should be fixed. For SoC internal problems, yes, of course, they should be fixed. But I don't think the causes always come from inside the system. They could be outside the system or a device, such as sending DATA IN with a tag that a host has ever submitted a command with because of some bugs of the device. You might think putting this sort of code doesn't make sense but there could be various events that can't be understood in th= e point of view of the spec. And chips that is already fab-outed can't be fix= ed. That's why I put the details into Exynos. I'm not talking about the spec. I think Exynos isn't required to contain only things related with the spec and it can have realistic part. >=20 > > +static irqreturn_t exynos_ufs_isr(struct ufs_hba *hba) =7B > > + struct exynos_ufs *ufs =3D ufshcd_get_variant(hba); > > + u32 status; > > + unsigned long flags; > > + > > + if (=21hba->priv) return IRQ_HANDLED; >=20 > Please verify patches with checkpatch before posting these on the linux- > scsi mailing list. The above if-statement does not follow the Linux kerne= l > coding style. >=20 > > + if (status & RX_UPIU_HIT_ERROR) =7B > > + pr_err(=22%s: status: 0x%08x=5Cn=22, __func__, status); > > + hba->force_reset =3D true; > > + hba->force_requeue =3D true; > > + scsi_schedule_eh(hba->host); > > + spin_unlock_irqrestore(hba->host->host_lock, flags); > > + return IRQ_HANDLED; > > + =7D > > + return IRQ_NONE; > > +=7D >=20 > So the above code unlocks the host_lock depending on whether or not statu= s > & RX_UPIU_HIT_ERROR is true? Yikes ... >=20 > Additionally, in the above code I found the following pattern: >=20 > unsigned long flags; > =5B ... =5D > spin_unlock_irqrestore(hba->host->host_lock, flags); >=20 > Such code is ALWAYS wrong. The value of the 'flags' argument passed to > spin_unlock_irqrestore() must come from spin_lock_irqsave(). >=20 > Bart. I missed for two things. Thanks, I'll look more carefully.