Received: by 10.192.165.156 with SMTP id m28csp1567582imm; Wed, 11 Apr 2018 22:52:07 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+Qi30kTssu1iv9btaGYavgOIlysD5pDaRxX0LAtTa43cC+os/qtLbrdggkFgSE8yhULykN X-Received: by 2002:a17:902:3001:: with SMTP id u1-v6mr8401279plb.164.1523512327124; Wed, 11 Apr 2018 22:52:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523512327; cv=none; d=google.com; s=arc-20160816; b=Mu/elhPYBl7c/CllxHJCevEA2uEdpVIc2sdhyFlDBX84RajoiAoUeq4tsuER6kc0bB j3Y3QSLHGb+WXh+S2AvHx6Ec6tFOILlRQ7IjECDfgsyPnio5Ku0mXTy/ZvErzfSj9XuT 8uCz+jZBF1L3VTPw0jKHjbHVZPDqWRMlAQZVw43ahtm8bR3JEOmx1E+6u2BcqkQ8fARV OE8nhizQIxf16xw4SU/AsViceUXQyc1m0lhD2Ty8NVbYzphZ1nMX/FrTi3wT92L6BZkq FSknSEsnGFDyh6CwvElBeDGlPXJpr2DOGN3xoOxpcOTOaFAC2GfKxv0vIbVfkQoKnlrU 9CBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature:dkim-signature :arc-authentication-results; bh=GBGTeNjfys5DLBCO0nuXXBe0BN0L6ILvsqGmRCiwpRo=; b=G3meX3r+HeybSZIAspsohm/l96k7YdHXY4RvsikDMIj/iRc4peLhdS/eJ4qVaoLR/P 8hTL57EM91dNKWQYPs3Kj8DNDVRFAI7areYQv0QjEgxda8HwOUqMpT6VdT5evt70mBQm 0Iwie0JrxeaY1X6rC6kCLbNzacDbTJlP7SbgbkavoHFyizkDYmFpUFoT3Hw8QdrNEM52 rm7JejH68SUvVvaG2wsLNm3Rlhpt6VfWrTH2jbC6AaRjSe4Jbl5ZWxu3oScas/HL4nKZ 0FuJeIWJbuCDCUgcevajk+TSTMl4Kg/IxKW94ccuBYQGML3LLRAqOSTHd+kpNG37FhZ9 bRcw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=J2u0Zw3D; dkim=pass header.i=@codeaurora.org header.s=default header.b=TX/57hzl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j88si2049444pfe.334.2018.04.11.22.51.22; Wed, 11 Apr 2018 22:52:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=J2u0Zw3D; dkim=pass header.i=@codeaurora.org header.s=default header.b=TX/57hzl; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752341AbeDLFsV (ORCPT + 99 others); Thu, 12 Apr 2018 01:48:21 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:56094 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751771AbeDLFsT (ORCPT ); Thu, 12 Apr 2018 01:48:19 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 5B37260F90; Thu, 12 Apr 2018 05:48:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1523512099; bh=r2rdo+HQXuJinty0tuugMQzc8e3Lu98pJ7pEiZffcZw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=J2u0Zw3DVnF2J5oYp9UfaTlm4Qd+Yt06OXr9mRQOWdMi20VucI9XhRhm6RJKpxj6r 5OB5TlCjr/hi4eXWE/vkzpIVxfQqwYBkOZsvxVZmTqFr4rRUMFxuk39wj5BXAaiPog gZj6hjoHL5gCZiObjiIMjf1uGHYUaIegSKG3gsRw= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id ADF3F6076A; Thu, 12 Apr 2018 05:48:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1523512098; bh=r2rdo+HQXuJinty0tuugMQzc8e3Lu98pJ7pEiZffcZw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=TX/57hzl2J4qLkUFE+Qzw0tjGUx5YC7YBhH5TM4f4O6gv0EuFVbuljfuktUAdLWkA lKBJ3M33C8ZhXkBD3dZk9vlrnhbQ7OohbWIqK46R/E5tHwe/uDOFyXw5z9I8z2uRkj xQERFTaurCNWur+2jDqYjeQDwDrk/4cmM5i+PRxI= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 12 Apr 2018 13:48:18 +0800 From: cang@codeaurora.org To: Vivek Gautam Cc: subhashj@codeaurora.org, asutoshd@codeaurora.org, rnayak@codeaurora.org, vinholikatti@gmail.com, jejb@linux.vnet.ibm.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, Venkat Gopalakrishnan , open list Subject: Re: [PATCH v1] scsi: ufs: add 2 lane support In-Reply-To: <2af3023d-caaf-4b62-e2ba-fc3cb56b331c@codeaurora.org> References: <20180302082346.8188-1-cang@codeaurora.org> <2af3023d-caaf-4b62-e2ba-fc3cb56b331c@codeaurora.org> Message-ID: <37eafb7dad5926029b5d9993c6749c2d@codeaurora.org> X-Sender: cang@codeaurora.org User-Agent: Roundcube Webmail/1.2.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-04-02 18:00, Vivek Gautam wrote: > Hi Can, > > > On 3/2/2018 1:48 PM, Can Guo wrote: >> From: Venkat Gopalakrishnan >> >> Qcom ufs controller v3.1.0 supports 2 lanes, add support >> to configure 2 lanes during phy initialization. >> >> Signed-off-by: Venkat Gopalakrishnan >> Signed-off-by: Subhash Jadavani >> Signed-off-by: Can Guo >> --- >> drivers/scsi/ufs/ufs-qcom.c | 20 +++++++++----------- >> 1 file changed, 9 insertions(+), 11 deletions(-) >> >> diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c >> index 2b38db2..51889ad 100644 >> --- a/drivers/scsi/ufs/ufs-qcom.c >> +++ b/drivers/scsi/ufs/ufs-qcom.c >> @@ -113,10 +113,10 @@ static void ufs_qcom_disable_lane_clks(struct >> ufs_qcom_host *host) >> if (!host->is_lane_clks_enabled) >> return; >> - if (host->hba->lanes_per_direction > 1) >> + if (host->tx_l1_sync_clk) >> clk_disable_unprepare(host->tx_l1_sync_clk); >> clk_disable_unprepare(host->tx_l0_sync_clk); >> - if (host->hba->lanes_per_direction > 1) >> + if (host->rx_l1_sync_clk) >> clk_disable_unprepare(host->rx_l1_sync_clk); >> clk_disable_unprepare(host->rx_l0_sync_clk); >> @@ -147,18 +147,15 @@ static int ufs_qcom_enable_lane_clks(struct >> ufs_qcom_host *host) >> if (err) >> goto disable_tx_l0; >> - err = ufs_qcom_host_clk_enable(dev, "tx_lane1_sync_clk", >> - host->tx_l1_sync_clk); >> - if (err) >> - goto disable_rx_l1; >> + /* The tx lane1 clk could be muxed, hence keep this optional */ > > You need a similar change for "rx_l1_sync_clk" also. > And also get rid of 'lanes_per_direction' flag as well for > ufs_qcom_enable_lane_clks() > and ufs_qcom_init_lane_clks() too, as you are doing in > ufs_qcom_disable_lane_clks(). > Sure, got it. Thanks Can >> + if (host->tx_l1_sync_clk) >> + ufs_qcom_host_clk_enable(dev, "tx_lane1_sync_clk", >> + host->tx_l1_sync_clk); >> } >> host->is_lane_clks_enabled = true; >> goto out; >> -disable_rx_l1: >> - if (host->hba->lanes_per_direction > 1) >> - clk_disable_unprepare(host->rx_l1_sync_clk); >> disable_tx_l0: >> clk_disable_unprepare(host->tx_l0_sync_clk); >> disable_rx_l0: >> @@ -189,8 +186,9 @@ static int ufs_qcom_init_lane_clks(struct >> ufs_qcom_host *host) >> if (err) >> goto out; >> - err = ufs_qcom_host_clk_get(dev, "tx_lane1_sync_clk", >> - &host->tx_l1_sync_clk); >> + /* The tx lane1 clk could be muxed, hence keep this optional */ >> + ufs_qcom_host_clk_get(dev, "tx_lane1_sync_clk", >> + &host->tx_l1_sync_clk); > > same here. > > Best regards > Vivek > Shall do as well. Thanks Can >> } >> out: >> return err;