Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1031972imu; Fri, 25 Jan 2019 16:01:49 -0800 (PST) X-Google-Smtp-Source: ALg8bN4mrSiokKT1Y2gmanPskSAk03UJdqcQQ36zfiRsKY2M8DbABnRWy8+aRbi9AWMB0qXWK6mj X-Received: by 2002:a62:c613:: with SMTP id m19mr13043821pfg.207.1548460909033; Fri, 25 Jan 2019 16:01:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548460909; cv=none; d=google.com; s=arc-20160816; b=tXPQ8IvG2rR4F8/PphwUcZxmWVWAW5XA4OnNFkf9q3NHbHJKaSEN8WAlZcyI1RJUdk Wzquuuv/bQP1Gqcs7sFbufL6y8bPPebn6ST4QjHbStyafPik4AkJ0DyVkGitEIIt2ry7 kZgwXZs+KkS9gnwyJgvRYdr1LYLuPGJI3yn3tvB6e6nQBbFwvSskQcG5Jr0/Ea0j/VoY 6qfgX/Ui8VBICgtmhXi7o48M6pY31d0UvINg6Kadurj/2BFC/E8GDBCeDRBWzvoeCy6E 7H4NjPfaryu2HXQPuqvMgD0cDlblShTgQ9DiDxgVBZZcfcSdTlGB8uAjBjSqstgL9S4k FcLQ== 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=bivZF+N5UQBK8QlBWBWjTitl9qn7GkzcyFvvnhd7MCs=; b=ZS2GgPJwXPacrhU0vQMAhz2TsnBtCXwoGe/zN8m9pt9N+W3XZfiwvXGBNnMUNyq7rg plhUJEYrDfaz9w7b4Y3sSu2Dh4Z0kCc3e84uDdwPMEl0yONmbiaecTUhoIfkz70XjKa8 eTD/6JysRZ0f+KFgm6hbT/xgAr0XsMc70GfoexQqPib9qPCphFDCrCIbfqnJVTi0m+Kr VY2nqxkinoshz2YjTTqXNqJb9OZx/Wulx3vXlPWudtR0680x9Cx2VHYnQ1cAc71hVvoH Wpy5B8JpkQpxvdOFpSlgcQq+PDgCi+g8J15rYMxEKrSAI0accym5Nk7Gy7LgG2ARaBS1 i7fg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=QRAMv4pt; 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 n34si10678429pld.381.2019.01.25.16.01.33; Fri, 25 Jan 2019 16:01:48 -0800 (PST) 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=QRAMv4pt; 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 S1729485AbfAZABV (ORCPT + 99 others); Fri, 25 Jan 2019 19:01:21 -0500 Received: from mail-lj1-f193.google.com ([209.85.208.193]:35866 "EHLO mail-lj1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726218AbfAZABU (ORCPT ); Fri, 25 Jan 2019 19:01:20 -0500 Received: by mail-lj1-f193.google.com with SMTP id g11-v6so9801596ljk.3 for ; Fri, 25 Jan 2019 16:01:18 -0800 (PST) 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=bivZF+N5UQBK8QlBWBWjTitl9qn7GkzcyFvvnhd7MCs=; b=QRAMv4pt2wTw41Xy606JFLtBQ/Tzuun7yaXzkdy58rK1o7QtdzeUSY8XDAQYSicxsR BM92IpzsANL7rWyV/Iyr2xtH644hOohv3nCQ8RmH0uEELReZdPnLqSaXmb/xJcuosCKo /0t3S4WlVMeSC8Qb7DzJBljcsJ4NrbOK5JNQ0= 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=bivZF+N5UQBK8QlBWBWjTitl9qn7GkzcyFvvnhd7MCs=; b=bdI1/lnwueYd3BGfF8eASNRNbXQkWV9tPVJZ4nd7IXJw9MzHKstYDQhfSge8kzMbE4 47ETRfY9O0NaoOTg3Hy0N2kub/P31NfKNm9gaHQYpWKZ5Zco3g9H168MHGZOCp32QGot EhX2P1CfZpQ4YjXavUXJoCy4XYkxReGaBzdHJmTNVaEAtvE8F4yrwOpcFwnNBVwDzZJA my2/nl/eRjrwEkkZm0UpZIte6aOkXuxbdesPRcvnmAmMIdHaHtZtoxuf35zdiz9vghrc Diav+O6A+KPCDPBcjGIUpGzFTUROcXT3KtRaAi/AhNc9WzYjkTQA5+kgENzyfBoO+rrr EPuw== X-Gm-Message-State: AJcUukdCTM8cV37TvhOLMcqwTs8Tr9i4aLz7XpYwtZ8pBBnayCwZNxHW KvXyogegmDGxREa5W0QvB8b3cmNavMk= X-Received: by 2002:a2e:3012:: with SMTP id w18-v6mr10215653ljw.75.1548460877760; Fri, 25 Jan 2019 16:01:17 -0800 (PST) Received: from mail-lj1-f173.google.com (mail-lj1-f173.google.com. [209.85.208.173]) by smtp.gmail.com with ESMTPSA id s127sm1776108lfe.8.2019.01.25.16.01.15 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 25 Jan 2019 16:01:16 -0800 (PST) Received: by mail-lj1-f173.google.com with SMTP id k15-v6so9764211ljc.8 for ; Fri, 25 Jan 2019 16:01:15 -0800 (PST) X-Received: by 2002:a2e:7e04:: with SMTP id z4-v6mr10925579ljc.97.1548460875218; Fri, 25 Jan 2019 16:01:15 -0800 (PST) MIME-Version: 1.0 References: <926d2232-67f2-bd3a-ab79-87bbca3a1add@codeaurora.org> In-Reply-To: <926d2232-67f2-bd3a-ab79-87bbca3a1add@codeaurora.org> From: Evan Green Date: Fri, 25 Jan 2019 16:00:38 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [ 1/1] scsi: qcom-ufs: Add support for bus voting using ICB framework To: "Asutosh Das (asd)" Cc: subhashj@codeaurora.org, cang@codeaurora.org, vivek.gautam@codeaurora.org, Rajendra Nayak , Vinayak Holikatti , jejb@linux.vnet.ibm.com, "Martin K. Petersen" , linux-scsi@vger.kernel.org, linux-arm-msm , Rob Herring , Mark Rutland , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , open list 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 On Fri, Jan 25, 2019 at 2:29 AM Asutosh Das (asd) wrote: > > On 1/24/2019 10:22 PM, Evan Green wrote: > > On Wed, Jan 23, 2019 at 11:02 PM Asutosh Das wrote: > >> > >> Adapt to the new ICB framework for bus bandwidth voting. > >> > >> This requires the source/destination port ids. > >> Also this requires a tuple of values. > >> > >> The tuple is for two different paths - from UFS master > >> to BIMC slave. The other is from CPU master to UFS slave. > >> This tuple consists of the average and peak bandwidth. > >> > >> Signed-off-by: Asutosh Das > >> --- > >> .../devicetree/bindings/ufs/ufshcd-pltfrm.txt | 12 ++ > >> drivers/scsi/ufs/ufs-qcom.c | 234 ++++++++++++++++----- > >> drivers/scsi/ufs/ufs-qcom.h | 20 ++ > >> 3 files changed, 218 insertions(+), 48 deletions(-) > >> > >> diff --git a/Documentation/devicetree/bindings/ufs/ufshcd-pltfrm.txt b/Documentation/devicetree/bindings/ufs/ufshcd-pltfrm.txt > >> index a99ed55..94249ef 100644 > >> --- a/Documentation/devicetree/bindings/ufs/ufshcd-pltfrm.txt > >> +++ b/Documentation/devicetree/bindings/ufs/ufshcd-pltfrm.txt > >> @@ -45,6 +45,18 @@ Optional properties: > >> Note: If above properties are not defined it can be assumed that the supply > >> regulators or clocks are always on. > >> > >> +* Following bus parameters are required: > >> +interconnects > >> +interconnect-names > >> +- Please refer to Documentation/devicetree/bindings/interconnect/ > >> + for more details on the above. > >> +qcom,msm-bus,name - string describing the bus path > >> +qcom,msm-bus,num-cases - number of configurations in which ufs can operate in > >> +qcom,msm-bus,num-paths - number of paths to vote for > >> +qcom,msm-bus,vectors-KBps - Takes a tuple , (2 tuples for 2 num-paths) > >> + The number of these entries *must* be same as > >> + num-cases. > > > > I think we can do away with all of the qcom* ones, right? This should > > be achievable with just interconnects and interconnect-names. > Let me give that a bit more thought - though I'm not sure how that'd work. From the downstream kernel that I have, it looks like these are basically used to define the bandwidth values for each gear/mode in UFS. My understanding is that the DT folks generally balk at having configuration data in the device tree. I'm hopeful that we can have a snippet of code that actually computes the required bandwidth for a certain combination of gear speed and lanes. But if that is somehow not possible, this can at worst be a table in code of bandwidths[gear]. But let's try for the computation first. > > > > > Also, is this patch based on a downstream tree? I don't recognize a > > lot of the context. We'll need a patch that's based on an upstream > > tree. > This was developed on the internal Chrome AU and ported to ufs-next. > Let me check internally on this anyway. > Whoops, you're right, the context I was confused about does appear to be upstream. I was unaware there was dangling code to the old downstream bus scaling stuff in the upstream kernel. I think we should get rid of all of that and start fresh. Also, like the dangling downstream code was, the new stuff should probably be surrounded by ifdefs for the new interconnect core. I also think we don't really need the max_bus_bw thing, so when we rip out all the downstream leftovers we don't need to put that back in. -Evan