From patchwork Fri Aug 21 09:27:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alim Akhtar X-Patchwork-Id: 7050721 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 B2314C05AC for ; Fri, 21 Aug 2015 09:38:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9BE3E204E7 for ; Fri, 21 Aug 2015 09:38:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B9F67202FE for ; Fri, 21 Aug 2015 09:38:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753762AbbHUJh4 (ORCPT ); Fri, 21 Aug 2015 05:37:56 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:34317 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753740AbbHUJhy (ORCPT ); Fri, 21 Aug 2015 05:37:54 -0400 Received: from epcpsbgr1.samsung.com (u141.gpu120.samsung.co.kr [203.254.230.141]) by mailout3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0NTF02RXMER4SN20@mailout3.samsung.com>; Fri, 21 Aug 2015 18:37:52 +0900 (KST) Received: from epcpsbgm1new.samsung.com ( [172.20.52.124]) by epcpsbgr1.samsung.com (EPCPMTA) with SMTP id 0A.16.29324.071F6D55; Fri, 21 Aug 2015 18:37:52 +0900 (KST) X-AuditID: cbfee68d-f79106d00000728c-b8-55d6f170fa90 Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm1new.samsung.com (EPCPMTA) with SMTP id C2.F7.23663.071F6D55; Fri, 21 Aug 2015 18:37:52 +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 <0NTF008WKEOTM680@mmp1.samsung.com>; Fri, 21 Aug 2015 18:37:52 +0900 (KST) From: Alim Akhtar To: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: vinholikatti@gmail.com, JBottomley@odin.com, Seungwon Jeon Subject: [PATCH 04/10] scsi: ufs: add quirk not to allow reset of interrupt aggregation Date: Fri, 21 Aug 2015 14:57:55 +0530 Message-id: <1440149281-26336-5-git-send-email-alim.akhtar@samsung.com> X-Mailer: git-send-email 1.7.10.4 In-reply-to: <1440149281-26336-1-git-send-email-alim.akhtar@samsung.com> References: <1440149281-26336-1-git-send-email-alim.akhtar@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrFLMWRmVeSWpSXmKPExsWyRsSkRrfg47VQg8eLtCz+r7/NYnF51xw2 i+7rO9gsPty/yGyxY2GVA6vHzll32T0O//jB7NG3ZRWjx+dNcgEsUVw2Kak5mWWpRfp2CVwZ s3cfZiu4zVPx4fdL5gbGC1xdjBwcEgImEn0LlboYOYFMMYkL99azgdhCAisYJbb+yIeIm0is bFjJ3sXIBRRfyihx6ctpZgjnJ6PE9G3/2EGq2AS0Je5O38IEYosI2Eicv/kAzGYWCJe4tmE2 WI2wQKTE5rtdzCA2i4CqxK/ne8DivALuElN+TGWC2KYo0f1sAtgVnAIeEneb5rFAXOQucfny MVaQxRICzewSK/68gBokIPFt8iEWiG9kJTYdYIaYIylxcMUNlgmMwgsYGVYxiqYWJBcUJ6UX GeoVJ+YWl+al6yXn525iBAbx6X/Pencw3j5gfYhRgINRiYd3RuS1UCHWxLLiytxDjKZAGyYy S4km5wNjJa8k3tDYzMjC1MTU2Mjc0kxJnFdR6mewkEB6YklqdmpqQWpRfFFpTmrxIUYmDk6p Bsae63tWzFg95f0STu3NJ00azUrWM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-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.7 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 b441a39..35380aa 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_BROKEN_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 24245c9..7986a54 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_BROKEN_RESET_INTR_AGGR UFS_BIT(8) + unsigned int quirks; /* Deviations from standard UFSHCI spec. */ wait_queue_head_t tm_wq;