From patchwork Sun May 6 10:14:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alim Akhtar X-Patchwork-Id: 10382705 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3D32660318 for ; Sun, 6 May 2018 10:27:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2E7CE28C5D for ; Sun, 6 May 2018 10:27:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 234F328C68; Sun, 6 May 2018 10:27:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A905628C5D for ; Sun, 6 May 2018 10:27:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751814AbeEFK1b (ORCPT ); Sun, 6 May 2018 06:27:31 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:59774 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751563AbeEFK0n (ORCPT ); Sun, 6 May 2018 06:26:43 -0400 Received: from epcas2p1.samsung.com (unknown [182.195.41.53]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20180506102642epoutp03ed3f0e3853b4e05767281c03980fa24b~sB01Eih4N1710817108epoutp03U; Sun, 6 May 2018 10:26:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20180506102642epoutp03ed3f0e3853b4e05767281c03980fa24b~sB01Eih4N1710817108epoutp03U DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1525602402; bh=sVJ6pC1ipjhXLk9oeXNBjHgFvALAskFGmx/ORUW2/P0=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=X/lQgDyyjQk2Pntl/DYkihp7YGwGtmSfmxRUkDuCck4JlAS9uAObHHTy6SihoQFdw OLhGe1CjUcPPIZLkOPHwx6+3jk/9TJHgeqz49hNn8xwgx43rESWdOhO8q7Qo3IWvA9 kO9h4sv8QzYA298DWRzEeRc3Alf82LSbhTb/d+9A= Received: from epsmges2p4.samsung.com (unknown [182.195.42.72]) by epcas2p1.samsung.com (KnoxPortal) with ESMTP id 20180506102641epcas2p1b3bebb7a04b43ff599e63f897436496c~sB00Cowui2423624236epcas2p1K; Sun, 6 May 2018 10:26:41 +0000 (GMT) Received: from epcas2p3.samsung.com ( [182.195.41.55]) by epsmges2p4.samsung.com (Symantec Messaging Gateway) with SMTP id 72.7B.04079.068DEEA5; Sun, 6 May 2018 19:26:40 +0900 (KST) Received: from epsmgms2p2new.samsung.com (unknown [182.195.42.143]) by epcas2p1.samsung.com (KnoxPortal) with ESMTP id 20180506102639epcas2p13ac44966a64e539f611ccdc2479e1abb~sB0y99og00628906289epcas2p1C; Sun, 6 May 2018 10:26:39 +0000 (GMT) X-AuditID: b6c32a48-c49ff70000000fef-2e-5aeed860b599 Received: from epmmp2 ( [203.254.227.17]) by epsmgms2p2new.samsung.com (Symantec Messaging Gateway) with SMTP id 3B.59.03817.F58DEEA5; Sun, 6 May 2018 19:26:39 +0900 (KST) Received: from localhost.localdomain ([107.108.73.28]) by mmp2.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0P8A0043CYBXSQ60@mmp2.samsung.com>; Sun, 06 May 2018 19:26:39 +0900 (KST) From: Alim Akhtar To: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: jejb@linux.vnet.ibm.com, martin.petersen@oracle.com, vivek.gautam@codeaurora.org, subhashj@codeaurora.org, vinholikatti@gmail.com, olof@lixom.net, alim.akhtar@samsung.com Subject: [PATCH 2/4] scsi: ufs: add quirk not to allow reset of interrupt aggregation Date: Sun, 06 May 2018 15:44:16 +0530 Message-id: <1525601658-31989-3-git-send-email-alim.akhtar@samsung.com> X-Mailer: git-send-email 2.7.4 In-reply-to: <1525601658-31989-1-git-send-email-alim.akhtar@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrKIsWRmVeSWpSXmKPExsWy7bCmuW7CjXdRBku+21g8mLeNzWLVxDyL y7vmsFl0X9/BZrH8+D8mi1PXP7NZ3Fi8k81ix8IqixM/dzA7cHpc7utl8tg56y67x4NDm1k8 rpxoYvX4+PQWi0ffllWMHp83yQWwR3HZpKTmZJalFunbJXBlPLh8jbFgA0/FzOmPmBoYV3N1 MXJySAiYSHz/f4wdxBYS2MEo8fivZRcjF5D9nVHi7+z/zDBF57rvs0EkNjBKrD1wjRHC+cEo cWPRESaQKjYBbYm707eA2SICNhLnbz5gAiliFtjEKLFg4nI2kISwQLjEueNdYDaLgKrE9w0P WbsYOTh4BdwlHk3igNgmJ3HzXCfYZk4BD4kdpzvBNksIrGCTuPRqHgtEkYvEoqZ+VghbWOLV 8S3sELa0xLNVGxkh7GyJD8dPQr1QIzHrYi8bhG0vceDKHLA5zAJ8Eh2H/7KD3CAhwCvR0SYE UeIhcWTvcahVjhLPH11nh3h4NqPE9itvWCYwSi1gZFjFKJZaUJybnlpsVGCiV5yYW1yal66X nJ+7iREcuVoeOxgPnPM5xCjAwajEwzuB412UEGtiWXFl7iFGCQ5mJRHewPVAId6UxMqq1KL8 +KLSnNTiQ4zSHCxK4rwNvmeihATSE0tSs1NTC1KLYLJMHJxSDYyKXF9t7Ko/lDr+2c1w5FHc xs1T4ssNnT0mTzq1q/VJRUxslxab5FfuY23Jkud2y7BwBMVHzhRQ2Xji0h/GXMlXjxUMlk3q X6CQ5vz5xoY+oZi2zdrvVLTP/t7CKnjmlnHV4azJXlGeF+7dbj9oqBPgyjLhAVuasZjiLBah 6GPnTxwstMzpLFViKc5INNRiLipOBABWEC5n2AIAAA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprHLMWRmVeSWpSXmKPExsVy+t9jQd34G++iDA59M7V4MG8bm8WqiXkW l3fNYbPovr6DzWL58X9MFqeuf2azuLF4J5vFjoVVFid+7mB24PS43NfL5LFz1l12jweHNrN4 XDnRxOrx8ektFo++LasYPT5vkgtgj+KySUnNySxLLdK3S+DKeHD5GmPBBp6KmdMfMTUwrubq YuTkkBAwkTjXfZ+ti5GLQ0hgHaPEor9/2CGcH4wSD3Z8YAOpYhPQlrg7fQsTiC0iYCNx/uYD JpAiZoFNjBKzn55nAUkIC4RLnDveBdbAIqAq8X3DQ9YuRg4OXgF3iUeTOCC2yUncPNfJDGJz CnhI7DjdCVYuBFQy8fVt1gmMPAsYGVYxSqYWFOem5xYbFRjlpZbrFSfmFpfmpesl5+duYgSG 2rbDWv07GB8viT/EKMDBqMTDO4HjXZQQa2JZcWXuIUYJDmYlEd7A9UAh3pTEyqrUovz4otKc 1OJDjNIcLErivPz5xyKFBNITS1KzU1MLUotgskwcnFINjALx7Avmpoce+zLHfMfbLX1/TuTr G7rIze/4JBrAcWftx3LtqeVrClM/OL+7fnCes+oe5k/hy5JXOB99zS40Nd9C8NRFJefPJp6e m0+1StXrPe0/rqzTxNXw88D+rVZG06dXip0K1S+/tCxQWEH2WNkPhuVeLKVS5jZNp4W8Feof 3jXoX81rpsRSnJFoqMVcVJwIAM2HG1YxAgAA X-CMS-MailID: 20180506102639epcas2p13ac44966a64e539f611ccdc2479e1abb X-Msg-Generator: CA CMS-TYPE: 102P X-CMS-RootMailID: 20180506102639epcas2p13ac44966a64e539f611ccdc2479e1abb X-RootMTR: 20180506102639epcas2p13ac44966a64e539f611ccdc2479e1abb References: <1525601658-31989-1-git-send-email-alim.akhtar@samsung.com> Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Reviewed-by: Subhash Jadavani --- 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 9898ce5..253257c 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -4695,7 +4695,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 43035f8..5c91ff1 100644 --- a/drivers/scsi/ufs/ufshcd.h +++ b/drivers/scsi/ufs/ufshcd.h @@ -600,6 +600,12 @@ struct ufs_hba { */ #define UFSHCI_QUIRK_BROKEN_REQ_LIST_CLR 0x100 + /* + * 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 0x200 + unsigned int quirks; /* Deviations from standard UFSHCI spec. */ /* Device deviations from standard UFS device spec. */