From patchwork Thu May 14 00:39:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alim Akhtar X-Patchwork-Id: 11547609 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2FA3D138A for ; Thu, 14 May 2020 00:53:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 257FD20794 for ; Thu, 14 May 2020 00:53:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="DSfpMS2n" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729439AbgENAw7 (ORCPT ); Wed, 13 May 2020 20:52:59 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:46095 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727792AbgENAw7 (ORCPT ); Wed, 13 May 2020 20:52:59 -0400 Received: from epcas5p3.samsung.com (unknown [182.195.41.41]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20200514005257epoutp0490b71c14987a7489c9596ef3a08cd4d8~Ovt19fvtj0849708497epoutp04N for ; Thu, 14 May 2020 00:52:57 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20200514005257epoutp0490b71c14987a7489c9596ef3a08cd4d8~Ovt19fvtj0849708497epoutp04N DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1589417577; bh=aZlGHc5xTiWwAyuHWOUJ6KyldBblFcw6DUpelUfBEa8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DSfpMS2ndcpknIiMrCtxJivV32Az463RSVmQr16ub9DM2QC7f73URoOpWQMM6MHAH jWLDv72FcdGUr1TYcG0H0SxkJLZtW8ojog7ba3yewYNsek7Ah+hFo/KjoGyQEfQUPx sRNExHdYMybC5zSXKJOynJ9ChKu2ymZ8i5kh9I64= Received: from epsmges5p3new.samsung.com (unknown [182.195.42.75]) by epcas5p4.samsung.com (KnoxPortal) with ESMTP id 20200514005256epcas5p4b505d9649ce18325762618aec51307c7~Ovt1eyqxo0590005900epcas5p4C; Thu, 14 May 2020 00:52:56 +0000 (GMT) Received: from epcas5p2.samsung.com ( [182.195.41.40]) by epsmges5p3new.samsung.com (Symantec Messaging Gateway) with SMTP id 6F.6E.23389.8669CBE5; Thu, 14 May 2020 09:52:56 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas5p3.samsung.com (KnoxPortal) with ESMTPA id 20200514005256epcas5p3ccb5dcc7c96a5cdb9ee78baa8ec1e0d3~Ovt1MOmZ31579215792epcas5p3g; Thu, 14 May 2020 00:52:56 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200514005256epsmtrp2b62267b832bfb80b95da4fe730197dff~Ovt1LCi-a1517815178epsmtrp2P; Thu, 14 May 2020 00:52:56 +0000 (GMT) X-AuditID: b6c32a4b-797ff70000005b5d-de-5ebc9668bdcc Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id CD.C3.18461.8669CBE5; Thu, 14 May 2020 09:52:56 +0900 (KST) Received: from Jaguar.sa.corp.samsungelectronics.net (unknown [107.108.73.139]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200514005254epsmtip23012c0682b1f1e83ceeba407574e8b52~OvtzTUsvL0172201722epsmtip2M; Thu, 14 May 2020 00:52:54 +0000 (GMT) From: Alim Akhtar To: robh@kernel.org Cc: devicetree@vger.kernel.org, linux-scsi@vger.kernel.org, krzk@kernel.org, avri.altman@wdc.com, martin.petersen@oracle.com, kwmad.kim@samsung.com, stanley.chu@mediatek.com, cang@codeaurora.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Alim Akhtar Subject: [PATCH v9 02/10] scsi: ufs: add quirk to disallow reset of interrupt aggregation Date: Thu, 14 May 2020 06:09:06 +0530 Message-Id: <20200514003914.26052-3-alim.akhtar@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200514003914.26052-1-alim.akhtar@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpileLIzCtJLcpLzFFi42LZdlhTQzdj2p44g11bpSwezNvGZvHy51U2 i0/rl7FazD9yjtXi/PkN7BY3txxlsdj0+BqrxeVdc9gsZpzfx2TRfX0Hm8Xy4/+YLP7v2cFu sXTrTUYHXo/Lfb1MHptWdbJ5bF5S79Fycj+Lx8ent1g8+rasYvT4vEnOo/1AN1MARxSXTUpq TmZZapG+XQJXxrbd79gKbvFUTDh+i7mB8TJXFyMnh4SAicTHuRPYuhi5OIQEdjNKnG9ayAjh fGKUuPKtB8r5xihx4/pmZpiW9dvuMkEk9jJKHJs1iwUkISTQwiRx56geiM0moC1xd/oWJhBb REBY4si3NkYQm1ngBpPEg5UuILawQLTE13e32UFsFgFViVldrawgNq+AjcT9numsEMvkJVZv OAC2mFPAVmLLl2NQ8VYOifMtEhC2i8Ta2esYIWxhiVfHt7BD2FISn9/tBfqNA8jOlujZZQwR rpFYOu8YC4RtL3HgyhwWkBJmAU2J9bv0Ia7kk+j9/YQJopNXoqNNCKJaVaL53VWoTmmJid3d UMd4SCzddRMaiBMYJf7c+c42gVF2FsLUBYyMqxglUwuKc9NTi00LjPNSy/WKE3OLS/PS9ZLz czcxgpOJlvcOxkcPPugdYmTiYDzEKMHBrCTC67d+d5wQb0piZVVqUX58UWlOavEhRmkOFiVx 3seNW+KEBNITS1KzU1MLUotgskwcnFINTJyx7maZ5i8ecMzqZX/6PmvKS7WLGd26S96JeodM rDebP+mv51chLodDtS0349f/YTX4vdsh2Fd949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YzNGyWZH1+s7ec+cnDJ3XupWLrricav1k41/V2g/FX0db315dzLLz8 et+5rpY873nfLHf3Hj8Y2Bduf3PTP1eFCrEVn42D4zWvsIYol/dErL4+x1dqNs/NI7Mu2TU+ Omr2zLf40u7g/jmJ/T/iMn9ktPQGGdpVRp9eEizUvyHSrrdc/nsmn0isfb5o7MvesNuVmQ1c ZTpvlFiKMxINtZiLihMBecJRa9YCAAA= X-CMS-MailID: 20200514005256epcas5p3ccb5dcc7c96a5cdb9ee78baa8ec1e0d3 X-Msg-Generator: CA CMS-TYPE: 105P X-CMS-RootMailID: 20200514005256epcas5p3ccb5dcc7c96a5cdb9ee78baa8ec1e0d3 References: <20200514003914.26052-1-alim.akhtar@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org Some host controllers support interrupt aggregation but don't allow resetting counter and timer in software. Reviewed-by: Avri Altman Signed-off-by: Seungwon Jeon Signed-off-by: Alim Akhtar --- drivers/scsi/ufs/ufshcd.c | 3 ++- drivers/scsi/ufs/ufshcd.h | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 3655b88fc862..0e9704da58bd 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -4884,7 +4884,8 @@ static irqreturn_t ufshcd_transfer_req_compl(struct ufs_hba *hba) * false interrupt if device completes another request after resetting * aggregation and before reading the DB. */ - if (ufshcd_is_intr_aggr_allowed(hba)) + if (ufshcd_is_intr_aggr_allowed(hba) && + !(hba->quirks & UFSHCI_QUIRK_SKIP_RESET_INTR_AGGR)) ufshcd_reset_intr_aggr(hba); tr_doorbell = ufshcd_readl(hba, REG_UTP_TRANSFER_REQ_DOOR_BELL); diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h index 071f0edf3f64..53096642f9a8 100644 --- a/drivers/scsi/ufs/ufshcd.h +++ b/drivers/scsi/ufs/ufshcd.h @@ -523,6 +523,12 @@ enum ufshcd_quirks { * Clear handling for transfer/task request list is just opposite. */ UFSHCI_QUIRK_BROKEN_REQ_LIST_CLR = 1 << 6, + + /* + * This quirk needs to be enabled if host controller doesn't allow + * that the interrupt aggregation timer and counter are reset by s/w. + */ + UFSHCI_QUIRK_SKIP_RESET_INTR_AGGR = 1 << 7, }; enum ufshcd_caps {