Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp853456ybz; Fri, 17 Apr 2020 11:13:02 -0700 (PDT) X-Google-Smtp-Source: APiQypI8i2HYGzP0hdeV8x92+CkIuKRo4o8zBdu8ezIixyccTZLMf8L4mmKitGtgps2+ZSEKCxFY X-Received: by 2002:a50:d987:: with SMTP id w7mr4213251edj.276.1587147182037; Fri, 17 Apr 2020 11:13:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587147182; cv=none; d=google.com; s=arc-20160816; b=ekeMng676m1nZiZx0SC5lNJ3iQ/d/lBpVYhU3+9+wUDsYh6ifh//Eu1TI8+g30EhjE WztPunDEZjYvd7iMdrNqaxLGDZ98tcPNgv8W0Niq/Pwig8hfGTHTsce5OZpNXfklsdbS ESDShQJxwSK5j3UDSsW2e7Xv4f+szaKSeE/+CbX8HyT6QKP2TrkyBd3wbBlNxmvcHpgh O3oUZgvUIgSQqVlmQS6ibqjiHachbx5gV+YNwZmxBm1LlzPR1OaothV5ffBIsPR68+VP p1rSBZZFP0vWmyDeF0njTluo/OLpKLPXGGrm1z2nIxP6Z+9arfcjodUrIv+kWno2LZtU JScg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:dkim-filter; bh=RGpDjOip8NxrtFUkwIRsldggJ3prXwHbaBTjKYt8Ygc=; b=tZvX7iK9gpNVJBzV1BkmBg6lC1eKa/9d28lmtSWr/dGflOidMz6xEZ207THVRzPu33 fh9/6Gv5p0M3+ehGpd5Z+RG8L4jg9rSXLD0aEYfihbL5noNXkUaLdrR9JPyx7Tvm6KmC CKOrnXzN/qljC3Se02FOaz3z0QKbbxt1fyPSNEcwp48bduTiDGf7NXYrSj6TaEUQzJ2L 1Hx7U3NYMouFse3MhJKufEdbK3sJIY/WwpEiIfAENJgQbiJaPJyhhGm0bqsO5WAUOvlQ UynaungaXqzB5Mo9Aya5eXljaCqoqSGGrrnj2JxjNy4wyX8pe3V8o4iV2xwRkxmdXHUa dTkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=NcF8kzSR; 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 w16si13496242ejb.521.2020.04.17.11.12.38; Fri, 17 Apr 2020 11:13:02 -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=NcF8kzSR; 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 S1730565AbgDQSKV (ORCPT + 99 others); Fri, 17 Apr 2020 14:10:21 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:11666 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730322AbgDQSKR (ORCPT ); Fri, 17 Apr 2020 14:10:17 -0400 Received: from epcas5p2.samsung.com (unknown [182.195.41.40]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20200417181010epoutp037fc66836b1334229279c48ab9b672122~Grcwj2uKy0173901739epoutp03w for ; Fri, 17 Apr 2020 18:10:10 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20200417181010epoutp037fc66836b1334229279c48ab9b672122~Grcwj2uKy0173901739epoutp03w DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1587147011; bh=RGpDjOip8NxrtFUkwIRsldggJ3prXwHbaBTjKYt8Ygc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NcF8kzSRfcRHUrBFnP8NWvppwMQcxB8Lr3IUOUQfthP4bfGHVgVgAJvER+7mWxu53 acHoe4mWs2VRTAvNUV+PoLqhzi0SWGTj6XRVw/Fqe9S/gj+nfmmoe8gfQR2v72W9fh FaHLd2uTy1sVhoyMUTRHUTl+WxYfOYZ8i4VLJTQQ= Received: from epsmges5p2new.samsung.com (unknown [182.195.42.74]) by epcas5p4.samsung.com (KnoxPortal) with ESMTP id 20200417181010epcas5p4a10985d225b7584ed00c2145a64271f2~GrcwHwD7Q1060310603epcas5p4p; Fri, 17 Apr 2020 18:10:10 +0000 (GMT) Received: from epcas5p1.samsung.com ( [182.195.41.39]) by epsmges5p2new.samsung.com (Symantec Messaging Gateway) with SMTP id CE.16.04778.201F99E5; Sat, 18 Apr 2020 03:10:10 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas5p2.samsung.com (KnoxPortal) with ESMTPA id 20200417181010epcas5p23cb018eee5b7ae0eba87d81dbaaec3ce~Grcv0msIw2908329083epcas5p20; Fri, 17 Apr 2020 18:10:10 +0000 (GMT) Received: from epsmgms1p2new.samsung.com (unknown [182.195.42.42]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200417181010epsmtrp24978e105a8b2faae4cb769500324dd65~Grcvz1gql1697716977epsmtrp2j; Fri, 17 Apr 2020 18:10:10 +0000 (GMT) X-AuditID: b6c32a4a-33bff700000012aa-17-5e99f102e28d Received: from epsmtip1.samsung.com ( [182.195.34.30]) by epsmgms1p2new.samsung.com (Symantec Messaging Gateway) with SMTP id 53.DE.04158.101F99E5; Sat, 18 Apr 2020 03:10:10 +0900 (KST) Received: from Jaguar.sa.corp.samsungelectronics.net (unknown [107.108.73.139]) by epsmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200417181008epsmtip115c231bb619ac7f04509b08173b6dbf4~Grct9rDqd2094920949epsmtip1F; Fri, 17 Apr 2020 18:10:08 +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 v6 02/10] scsi: ufs: add quirk to disallow reset of interrupt aggregation Date: Fri, 17 Apr 2020 23:29:36 +0530 Message-Id: <20200417175944.47189-3-alim.akhtar@samsung.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200417175944.47189-1-alim.akhtar@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFupnleLIzCtJLcpLzFFi42LZdlhTXZfp48w4g9c7pC0ezNvGZvHy51U2 i0/rl7FazD9yjtXi/PkN7BY3txxlsdj0+BqrxeVdc9gsZpzfx2TRfX0Hm8Xy4/+YLP7v2cFu sXTrTUYHXo/Lfb1MHptWdbJ5bF5S79Fycj+Lx8ent1g8+rasYvT4vEnOo/1AN1MARxSXTUpq TmZZapG+XQJXxq6+1ywFq3gqzh27ytbAuIKri5GTQ0LARGLO3r9sXYxcHEICuxkl2idfYIZw PjFK3F54nQWkSkjgG5AzJR6mY/LhaSwQRXsZJeb1PWKEcFqYJM4+OMQKUsUmoC1xd/oWJhBb REBY4si3NkYQm1ngBpPEg5UuILawQLTErj+bwDawCKhKvJ61E6yGV8BGYt/PY8wQ2+QlVm84 AGZzCthKtLUsZQJZJiFwm01i/nyIoRICLhJbls1gg7CFJV4d38IOYUtJfH63FyjOAWRnS/Ts MoYI10gsnXeMBcK2lzhwZQ4LSAmzgKbE+l36EGfySfT+fsIE0ckr0dEmBFGtKtH87ipUp7TE xO5uVogSD4mv8/MgoTCBUeL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OW5vFjgm8UheF/qavvZXn1nRf1Pl9XkqnX6dVfxvNGOKdMVjfXN2 nnPhZZ8ayF/Ps5M7auEMW6agwrZkxbcLcxJO/N4crVcRPDsieGZXgtMMGyWW4oxEQy3mouJE AFIhEJtiAgAA X-CMS-MailID: 20200417181010epcas5p23cb018eee5b7ae0eba87d81dbaaec3ce X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" CMS-TYPE: 105P X-CMS-RootMailID: 20200417181010epcas5p23cb018eee5b7ae0eba87d81dbaaec3ce References: <20200417175944.47189-1-alim.akhtar@samsung.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Some host controllers support interrupt aggregation but don't allow resetting counter and timer in software. 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 { -- 2.17.1