Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3309084imm; Mon, 8 Oct 2018 01:35:21 -0700 (PDT) X-Google-Smtp-Source: ACcGV62lS4O6nnrcGiIdnw5+R/jcrXrOvPtU0ydpaV7XNiBbKNT9XQp0//bYvuGWV1suOsGUADl0 X-Received: by 2002:a17:902:722:: with SMTP id 31-v6mr22566602pli.207.1538987721768; Mon, 08 Oct 2018 01:35:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538987721; cv=none; d=google.com; s=arc-20160816; b=eiX1/Eg7Z7BDr/Myr4tC0A6Rjjkff9Dnq3GqxgnxYRMXj6yXQM5uiESUhXL1qjLBYI X11NMn0l0xj+Qfy/mxOxERny/UTJ/VjZ4xt/jcq1FXxpjS2F4RUmAtI8Ab7uzWRGE8hJ xAO6Gg37M4VqVGPqFTQ5je2ux1tKqgZbFLQ1Li/CfU+ndOrBNQu5hIC4YwCNNSMQdw2h 4actoNgpb+HLe6yzwWzOPSchO19GfP7XeK1XYy6g3k+potkP7rTYfbKQDvTyNmYUa/we UFRjg9mfNZSPJ6Y9qeu/nqcDM0hTCbPSEz5uJ/Rg3brM68jz9gVWPfkV7yNxjjDzUIvX ECZw== 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; bh=UfBjtYn4hHos+Gps4TYKw6NNt/pOjwfZWH9GL4sp2K0=; b=R+fiAbhvYbEjHHd3p9cfJoVy9Sp7m3VlnpEADLJHYuqeBID1mPFZK3lox/HahyTHQ+ srvLV9IyiBBjMAOWoUdd0c/eetVzBdKe6YLa4tHNhaiGqR1NZWkFroTdJWLMsWs6hzs+ V5KOXcRai8jS+O2nqz8kGOwhDj1yybcgbA3vT0cA0f+qrR70gjw21mz1YprPDgdjilTm Vltlc5BbkqQsac2UKjvcb4XFDOL1pkMFoBOh64FdhYGuoZ7ZRba8w4BDEJTLC1dvI3Ct Q4BXLRtC+E5Y3jgm5bnufARIh1J050RuCdPFTUXdpKsoXlzxGzulNHJswHbtqvnA7ttf /BsQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=GJnbox1J; dkim=pass header.i=@codeaurora.org header.s=default header.b="nI/8b8TD"; 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 q24-v6si16327985pgb.11.2018.10.08.01.35.06; Mon, 08 Oct 2018 01:35:21 -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=GJnbox1J; dkim=pass header.i=@codeaurora.org header.s=default header.b="nI/8b8TD"; 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 S1727148AbeJHPoE (ORCPT + 99 others); Mon, 8 Oct 2018 11:44:04 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:49030 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726096AbeJHPoE (ORCPT ); Mon, 8 Oct 2018 11:44:04 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 6FF8B60392; Mon, 8 Oct 2018 08:33:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1538987610; bh=yCvLsCKl6xjpt6Oj4UhUGdaAvsYIL9B0kPQOBlZyIxs=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=GJnbox1JQZaFUJbfg63+AzOplXusnyQWtQXB6onbROOh8AgPrcYEOOOl24Un1t3/G p0q/3VRrEhNJ0VuMt6Tyn5PWE13VUm8wqMwhLPhoYGWbXUCaPXCmAETpOJIosmgNag QKqf+LjsOoy20ZaFvfojQ+49eD+1wqWA6He6/UGM= 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.7 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_INVALID,DKIM_SIGNED 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 81CC860392; Mon, 8 Oct 2018 08:33:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1538987609; bh=yCvLsCKl6xjpt6Oj4UhUGdaAvsYIL9B0kPQOBlZyIxs=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=nI/8b8TDOmsDtw8IfazSmC07xMq/l6IxLLEcaY8vVC7GZ2yP1vFZL9zBdlZfrcVkq STCJ4zL5Z34LLRcv+UPFN7vLhco4P1otUI7aOD17/J1gtPmaNDEXHo+uSLYvG+G+Rm 6AH/nY5+osUFBHf2XPGdmWVBm1SrFGr/7O3uo1fQ= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Mon, 08 Oct 2018 16:33:29 +0800 From: cang@codeaurora.org To: Evan Green Cc: subhashj@codeaurora.org, asutoshd@codeaurora.org, vivek.gautam@codeaurora.org, Rajendra Nayak , Vinayak Holikatti , jejb@linux.vnet.ibm.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, venkatg@codeaurora.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1] scsi: ufs: add 2 lane support In-Reply-To: References: <20180302082346.8188-1-cang@codeaurora.org> Message-ID: <480df72b1fd00b2c1eacb8955cf60032@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-10-04 02:34, Evan Green wrote: > Hi, > > On Wed, Oct 3, 2018 at 11:19 AM Can Guo wrote: >> >> From: Venkat Gopalakrishnan >> >> Qcom ufs controller v3.1.0 supports 2 lanes, add support >> to configure 2 lanes during phy initialization. > > I'm reviving this old chestnut, sorry I missed it initially. This > description is a little terse, and I'm actually confused about it. The > description makes it sounds like this patch is adding support for > 2-lane UFS controllers, but the patch itself appears to only make the > UFS controller tolerant of a missing lane (or more specifically, a > missing lane clock). Can you describe a little more about what's going > on here, and perhaps fix the description? > > I notice that the global clock controller has clocks for TX symbol 0, > and RX symbol 1, but seems to be missing GCC_UFS_PHY_TX_SYMBOL_1_CLK. > Was that an oversight, or is it really not there? > >> >> 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 */ > > I'm confused by this comment. What do you mean the clock could be > muxed? > Hi Evan, sorry for the late response, I totally missed this mail. Here it means Tx Lane1 clock can be muxed with Tx Lane0 clock. As by design, Tx Lane1 clock derives from Tx Lane0 clock. I pushed a new change of it as I change the commit name. Please help review the new patch. Sorry for the inconveience. >> + 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); >> } >> out: >> return err;