From patchwork Mon Nov 9 05:26:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alim Akhtar X-Patchwork-Id: 7580991 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9A7C49F1C2 for ; Mon, 9 Nov 2015 05:28:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B55EE2077F for ; Mon, 9 Nov 2015 05:28:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BB749204B0 for ; Mon, 9 Nov 2015 05:28:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751708AbbKIF2t (ORCPT ); Mon, 9 Nov 2015 00:28:49 -0500 Received: from mailout3.samsung.com ([203.254.224.33]:55096 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751419AbbKIF2s (ORCPT ); Mon, 9 Nov 2015 00:28:48 -0500 Received: from epcpsbgr3.samsung.com (u143.gpu120.samsung.co.kr [203.254.230.143]) by mailout3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NXJ02M8Y8JY79D0@mailout3.samsung.com>; Mon, 09 Nov 2015 14:28:46 +0900 (KST) Received: from epcpsbgm1new.samsung.com ( [172.20.52.124]) by epcpsbgr3.samsung.com (EPCPMTA) with SMTP id 9F.8A.05284.E0F20465; Mon, 9 Nov 2015 14:28:46 +0900 (KST) X-AuditID: cbfee68f-f796f6d0000014a4-1e-56402f0e7c77 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1new.samsung.com (EPCPMTA) with SMTP id D1.BB.23663.E0F20465; Mon, 9 Nov 2015 14:28:46 +0900 (KST) Received: from exypnos.sisodomain.com ([107.108.73.28]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0NXJ002ZM8DXYXP0@mmp1.samsung.com>; Mon, 09 Nov 2015 14:28:46 +0900 (KST) From: Alim Akhtar To: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: JBottomley@odin.com, vinholikatti@gmail.com, gautam.vivek@samsung.com, essuuj@gmail.com, devicetree@vger.kernel.org, kishon@ti.com Subject: [PATCH v5 05/11] scsi: ufs: add quirk not to allow reset of interrupt aggregation Date: Mon, 09 Nov 2015 10:56:21 +0530 Message-id: <1447046787-480-6-git-send-email-alim.akhtar@samsung.com> X-Mailer: git-send-email 1.7.10.4 In-reply-to: <1447046787-480-1-git-send-email-alim.akhtar@samsung.com> References: <1447046787-480-1-git-send-email-alim.akhtar@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrALMWRmVeSWpSXmKPExsWyRsSkRpdP3yHM4MwndYv5R86xWiy/sITJ ou3KQXaL/+tvs1hceNrDZnF51xw2i+7rO9gsdiyscuDw2DnrLrvH4R8/mD36tqxi9Dh+YzuT x+dNcgGsUVw2Kak5mWWpRfp2CVwZm7bfZy54zFPxsm0pSwPjDa4uRk4OCQETie7bM1ghbDGJ C/fWs3UxcnEICaxglLj3djI7TNGGte/YIRJLGSV+nX3OCuH8ZJSY/+YRG0gVm4C2xN3pW5hA bBEBG4nzNx8wgRQxC3QwSnSe2wJWJCwQI3H1ZRcLiM0ioCrxbN9lZhCbV8BVYufmq4wQ6xQl up9NAKvnFHCTODezAaxGCKim6/VJFoiaZewSB49EQ8wRkPg2+RBQnAMoLiux6QAzRImkxMEV N1gmMAovYGRYxSiaWpBcUJyUXmSsV5yYW1yal66XnJ+7iREY8Kf/PevfwXj3gPUhRgEORiUe 3oiZ9mFCrIllxZW5hxhNgTZMZJYSTc4HxlVeSbyhsZmR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fr1cROWLXy3YvK8pRIMbwMXdMzUZJj4689k7yw1qRMFAtNOfV0qe6V/kxJLcUaioRZzUXEi AGvo4cvBAgAA DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Seungwon Jeon Some host controller supports interrupt aggregation, but doesn't allow to reset counter and timer by s/w. 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 2b16eb363203..ca7483cd899e 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -3199,7 +3199,8 @@ static void 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 d625d01110b0..4ae32e9316de 100644 --- a/drivers/scsi/ufs/ufshcd.h +++ b/drivers/scsi/ufs/ufshcd.h @@ -479,6 +479,12 @@ struct ufs_hba { */ #define UFSHCI_QUIRK_BROKEN_REQ_LIST_CLR UFS_BIT(7) + /* + * This quirk needs to be enabled if host controller doesn't allow + * that the interrupt aggregation timer and counter are reset by s/w. + */ + #define UFSHCI_QUIRK_SKIP_RESET_INTR_AGGR UFS_BIT(8) + unsigned int quirks; /* Deviations from standard UFSHCI spec. */ wait_queue_head_t tm_wq;