From patchwork Thu Sep 17 09:45:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alim Akhtar X-Patchwork-Id: 7205131 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 7868ABEEC1 for ; Thu, 17 Sep 2015 09:57:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9C942206F4 for ; Thu, 17 Sep 2015 09:57:56 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id ADE2A207EF for ; Thu, 17 Sep 2015 09:57:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753566AbbIQJyz (ORCPT ); Thu, 17 Sep 2015 05:54:55 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:55923 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753515AbbIQJys (ORCPT ); Thu, 17 Sep 2015 05:54:48 -0400 Received: from epcpsbgr4.samsung.com (u144.gpu120.samsung.co.kr [203.254.230.144]) by mailout1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NUT00X1LFJAKV10@mailout1.samsung.com>; Thu, 17 Sep 2015 18:54:46 +0900 (KST) Received: from epcpsbgm2new.samsung.com ( [172.20.52.125]) by epcpsbgr4.samsung.com (EPCPMTA) with SMTP id B9.C1.20564.6ED8AF55; Thu, 17 Sep 2015 18:54:46 +0900 (KST) X-AuditID: cbfee690-f796f6d000005054-1b-55fa8de63949 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id 06.A3.18629.6ED8AF55; Thu, 17 Sep 2015 18:54: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 <0NUT000DPFIZ1D40@mmp1.samsung.com>; Thu, 17 Sep 2015 18:54:46 +0900 (KST) From: Alim Akhtar To: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: JBottomley@odin.com, vinholikatti@gmail.com, amit.daniel@samsung.com, essuuj@gmail.com, devicetree@vger.kernel.org Subject: [PATCH v2 04/11] scsi: ufs: add quirk not to allow reset of interrupt aggregation Date: Thu, 17 Sep 2015 15:15:30 +0530 Message-id: <1442483137-32376-5-git-send-email-alim.akhtar@samsung.com> X-Mailer: git-send-email 1.7.10.4 In-reply-to: <1442483137-32376-1-git-send-email-alim.akhtar@samsung.com> References: <1442483137-32376-1-git-send-email-alim.akhtar@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrELMWRmVeSWpSXmKPExsWyRsSkVvdZ769Qg1nXxS0aroZYzD9yjtVi +YUlTBb/199msbi8aw6bRff1HWwWOxZWObB77Jx1l93j8I8fzB59W1YxenzeJBfAEsVlk5Ka k1mWWqRvl8CVsfFSD3PBeZ6Kz8evMjcwHuHqYuTkkBAwkfiwtZ8dwhaTuHBvPVsXIxeHkMAK Rokr//uYYIqWHL/DCpFYyihxccc8JgjnJ6PEmu2X2UCq2AS0Je5O3wLWISJgI3H+5gMwm1mg QuLWmQksXYwcHMICMRJvFpuDhFkEVCVOfX/OChLmFXCXeLXVH2KXokT3swlgEzkFPCRe/V8E ViIEVHJ+Qy3IVgmBfnaJOyt2sUCMEZD4NvkQ2HQJAVmJTQeYIcZIShxccYNlAqPwAkaGVYyi qQXJBcVJ6UUmesWJucWleel6yfm5mxiBQX3637MJOxjvHbA+xCjAwajEw6vg8itUiDWxrLgy 9xCjKdCGicxSosn5wNjJK4k3NDYzsjA1MTU2Mrc0UxLnfS31M1hIID2xJDU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PDkosxRmJhlrMRcWJALBe1R6yAgAA 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=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_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 257bffc..7b87075 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -3204,7 +3204,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 ba38842..c59f8ae 100644 --- a/drivers/scsi/ufs/ufshcd.h +++ b/drivers/scsi/ufs/ufshcd.h @@ -471,6 +471,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;