From patchwork Sun Sep 13 14:52:48 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yaniv Gardi X-Patchwork-Id: 7169501 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 46F949F326 for ; Sun, 13 Sep 2015 14:54:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 56B1520692 for ; Sun, 13 Sep 2015 14:54:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 56AF120691 for ; Sun, 13 Sep 2015 14:54:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754915AbbIMOyE (ORCPT ); Sun, 13 Sep 2015 10:54:04 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:49052 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754719AbbIMOyD (ORCPT ); Sun, 13 Sep 2015 10:54:03 -0400 Received: from smtp.codeaurora.org (localhost [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id 5D5A71403EA; Sun, 13 Sep 2015 14:54:02 +0000 (UTC) Received: by smtp.codeaurora.org (Postfix, from userid 486) id 1A9411403F0; Sun, 13 Sep 2015 14:54:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from lx-ygardi.mea.qualcomm.com (unknown [185.23.60.4]) (using TLSv1.1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: ygardi@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 79C0D1403E0; Sun, 13 Sep 2015 14:53:58 +0000 (UTC) From: Yaniv Gardi To: James.Bottomley@HansenPartnership.com, pebolle@tiscali.nl, hch@infradead.org Cc: linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, linux-arm-msm@vger.kernel.org, santoshsy@gmail.com, linux-scsi-owner@vger.kernel.org, subhashj@codeaurora.org, ygardi@codeaurora.org, gbroner@codeaurora.org, draviv@codeaurora.org, Vinayak Holikatti , "James E.J. Bottomley" Subject: [PATCH v1 08/17] scsi: ufs: split broken LCC quirk Date: Sun, 13 Sep 2015 17:52:48 +0300 Message-Id: <1442155977-7686-9-git-send-email-ygardi@codeaurora.org> X-Mailer: git-send-email 1.8.5.2 In-Reply-To: <1442155977-7686-1-git-send-email-ygardi@codeaurora.org> References: <1442155977-7686-1-git-send-email-ygardi@codeaurora.org> X-Virus-Scanned: ClamAV using ClamSMTP 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 Currently when UFSHCD_BROKEN_LCC quirk is defined, LCC is getting disabled on both host and device side but there could be a need where we don't want to disable the LCC on both side hence this change splits the quirk in 2 parts one for host and one for device. Signed-off-by: Subhash Jadavani Signed-off-by: Yaniv Gardi --- drivers/scsi/ufs/ufshcd.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 0803a89..411ec17 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -3048,6 +3048,11 @@ static int ufshcd_disable_tx_lcc(struct ufs_hba *hba, bool peer) return err; } +static inline int ufshcd_disable_host_tx_lcc(struct ufs_hba *hba) +{ + return ufshcd_disable_tx_lcc(hba, false); +} + static inline int ufshcd_disable_device_tx_lcc(struct ufs_hba *hba) { return ufshcd_disable_tx_lcc(hba, true); @@ -3095,6 +3100,12 @@ static int ufshcd_link_startup(struct ufs_hba *hba) goto out; } + if (hba->dev_quirks & UFS_DEVICE_QUIRK_BROKEN_LCC) { + ret = ufshcd_disable_host_tx_lcc(hba); + if (ret) + goto out; + } + /* Include any host controller configuration via UIC commands */ ret = ufshcd_vops_link_startup_notify(hba, POST_CHANGE); if (ret)