Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp45551imm; Wed, 3 Oct 2018 11:36:29 -0700 (PDT) X-Google-Smtp-Source: ACcGV6015mQ6xx/4TiXsiKjHcGS69mltJT/7w0Pw3UugA7s4go4KRz9HvmMqMmqBe2vykx2F72Zj X-Received: by 2002:a62:75c7:: with SMTP id q190-v6mr2974438pfc.137.1538591789721; Wed, 03 Oct 2018 11:36:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538591789; cv=none; d=google.com; s=arc-20160816; b=SYSG5kQpkqq4kO9lkxCZGDmy6J4IDKkW/Y/jhXZeBWy2f9X3ivW2BgdO36mBaClvHZ l/wypsQ+ty3GO1Ap+OdMPMFI7bwYehRjmTNvsJqtZ8SX/v4BbAySf8d9SNaYXmtpHPKj sVF5tVTkdMnHfPjMBUe0WEQsWTzmofxD07THANT6R0IAYTIF42LfpFyiFXowrZTrHqfY PPKKHezfRq7l1pyjHdK4OBzvy+eqZbeaptX3fueRb8rBxKOCsLKLKJCJDIEkP48BkShI XspKfW1Quba6MCxvyuc/7cCQYD7kaBoRzlF4msdINbMMaYGxe07sYi2szdbTFTsElavq z9Xw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=S/QQfgeI7gMJ87qFDqYzQYt/IQk9532qxo7Ub3/wYao=; b=CSOw++RZR3958BnQUFnZ4aBoilKfli3gOWsm3qtNQZJtRogHFHKNB23FbwmLK/uQgp a0ToTKkFrfZ0Pt6wsXlfSuI/yVDl8aMAwJsByEtaaZAdCTAb6Qqelh1JSe27QkSYVIiY 6+Q+SAiLxgPH9Owm2syX6KtqSooQESU+2JC+V3M1whsM/Vwqrd+7cxT40ubcPvK3tEOu FUa4i+/H1Pg9AifWvKbE/dRKp+oTer3DzFD8mqA0MWLxiHeROEWG685zFDwFWn0i2Ro4 Fean0Lf4CAZ6fGYlJZ6IyHajwNqFQxIqEsx7XWiMWZJ/BO8aAnxqYBQeBHme/k+WeLJk PMbw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=aajN8PnI; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d7-v6si2316776plo.418.2018.10.03.11.36.05; Wed, 03 Oct 2018 11:36:29 -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=@chromium.org header.s=google header.b=aajN8PnI; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727128AbeJDBY4 (ORCPT + 99 others); Wed, 3 Oct 2018 21:24:56 -0400 Received: from mail-lf1-f67.google.com ([209.85.167.67]:34711 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726884AbeJDBY4 (ORCPT ); Wed, 3 Oct 2018 21:24:56 -0400 Received: by mail-lf1-f67.google.com with SMTP id y10-v6so4903486lfj.1 for ; Wed, 03 Oct 2018 11:35:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=S/QQfgeI7gMJ87qFDqYzQYt/IQk9532qxo7Ub3/wYao=; b=aajN8PnIIJNYZ/XWGwReUiarKTUHUx4mn0SCbiTgfLLFGfEAV+5Rn8k/rWbehPq0jz 8BBFFdNH3M4TXEXTE4i78gd8Ua65a6sI5ZqV9dMZ4TzHagAp6Thcvc5feGZCvc5wT7i+ k7z0G+9kJJe3abzaLjcGzEc9l9OfFxDRFHh+o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=S/QQfgeI7gMJ87qFDqYzQYt/IQk9532qxo7Ub3/wYao=; b=MsV9mBjx35IdweZ7OdlyemULkt5LS3LLR963nI/LykdZ6UhpEskAtox7q0oclvP9hD 1qZZg1yb8LKD7kYKF+UG9aHpss7sbr5nYzb1tEb74ZsoFwk8vXIFd1Imi+QedLkAOT/X F+3TVV8myx3pjUp7BaTQA8pzoEOfp8s8BOYT+ZCKrPv0bkXJEIeVK80ku7PO0Zdq9WeE 1UVak+WmO4GrhhO1t/5GbmUohmy2Z0AccfcQYzkAq2F8mNPMjqmBpRFqVLO1pgiqPq1F FA5SUjaKUZEywzGd68bfn++hGRho+rL5WucZyXZewVQjVK3LALzZB271ZEnuSNKQmzYI JxUg== X-Gm-Message-State: ABuFfoiLbEq8jZe9qXxY0aInxZF/CEC9470lAkhbYYAtx9FaFKZDRHS1 pDP0+7/Uai3MAYJYc2cycSjrE6JIXbM= X-Received: by 2002:a19:d8d1:: with SMTP id r78-v6mr1854708lfi.146.1538591720525; Wed, 03 Oct 2018 11:35:20 -0700 (PDT) Received: from mail-lj1-f179.google.com (mail-lj1-f179.google.com. [209.85.208.179]) by smtp.gmail.com with ESMTPSA id f81-v6sm531454lfi.50.2018.10.03.11.35.19 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 Oct 2018 11:35:19 -0700 (PDT) Received: by mail-lj1-f179.google.com with SMTP id r8-v6so6031829ljc.10 for ; Wed, 03 Oct 2018 11:35:19 -0700 (PDT) X-Received: by 2002:a2e:9b88:: with SMTP id z8-v6mr1924135lji.112.1538591718944; Wed, 03 Oct 2018 11:35:18 -0700 (PDT) MIME-Version: 1.0 References: <20180302082346.8188-1-cang@codeaurora.org> In-Reply-To: <20180302082346.8188-1-cang@codeaurora.org> From: Evan Green Date: Wed, 3 Oct 2018 11:34:42 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v1] scsi: ufs: add 2 lane support To: subhashj@codeaurora.org, asutoshd@codeaurora.org, vivek.gautam@codeaurora.org, Rajendra Nayak , Vinayak Holikatti , jejb@linux.vnet.ibm.com, martin.petersen@oracle.com Cc: linux-scsi@vger.kernel.org, venkatg@codeaurora.org, cang@codeaurora.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? > + 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;