Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1886885imu; Thu, 24 Jan 2019 03:47:54 -0800 (PST) X-Google-Smtp-Source: ALg8bN6YBD6Crs2FxVshlW1PZNeMA7XNiF++h0jyspjy4r0beEFbrgj5WHPF1ttFlqKAEcQGYZ0P X-Received: by 2002:a17:902:264:: with SMTP id 91mr6286827plc.108.1548330474336; Thu, 24 Jan 2019 03:47:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548330474; cv=none; d=google.com; s=arc-20160816; b=ye7ulwdsiUo8y3mu4imR/mbUZtfwUt3a9DcXpitEK/IUkDp0jhyKxjPuCcPITK2slS UuChk+w6zAr6yCSgVcG6kWZwFGiznBlz4sh9fypkImIULymq9PNKVtLL8Bn6oBmnuT3N AbsA2Wt7HbRXBFUudhGJd7yo8Xq4ko7DsZ8trsEUOKajSO6C0/p7X08zwnTrdE0lSQ8g AIZa2EOFtKnb7uWyoI/PAbRuXTOYTc0M7+JU3jMOQ50n8cTVgAsrWtGWm3JJV8m3j0hw WU/rH3triTL/Amg9rIcikgFDKPZ8n11R2+U4XRaEi0dBGOFbDsTlyg3EhCUqT8imTkhQ vn4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:date:message-id:autocrypt :openpgp:from:references:cc:to:subject:dkim-signature; bh=u/hxwd3aLudVCV+7dHhBf5Fuo0S7UsIZLFxfnhMLOnI=; b=0aD9T3iQFLaYWf3pHStvaqWu71WJUk2UahN5GG2ErjoBGjeL5O13EU2rJO6IIjUM2/ rjtTTkwBjwFn5ohpEzTw/lbuRX+PCLFWuYXHo+uGfB1qVWAElBDqOaf3o7RFalKnbA3H TPGCPA/sX2nGsOYyDgk7DluH7uE5FVfBajUYG5UQvlXjGmAgecDJ0jyHYLoBhO4kCUXo 4B31Qa/ishLv3xy3fQbbO8Ya4S/Cux5PKZE7RQOz8wt8OUlODKRCQP4znSn+VIocDRJ3 GyAcY+OgDOdtvxMUyT45grEXcD5DLa+UkOdSOPuqAsNANJJiG6I6qN3rVX/HlKav53qH 8QcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Oix5Mh0I; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 37si23239571plq.210.2019.01.24.03.47.39; Thu, 24 Jan 2019 03:47:54 -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=@linaro.org header.s=google header.b=Oix5Mh0I; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727709AbfAXLq3 (ORCPT + 99 others); Thu, 24 Jan 2019 06:46:29 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:43299 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727664AbfAXLq2 (ORCPT ); Thu, 24 Jan 2019 06:46:28 -0500 Received: by mail-wr1-f65.google.com with SMTP id r10so6096742wrs.10 for ; Thu, 24 Jan 2019 03:46:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:openpgp:autocrypt:message-id:date :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=u/hxwd3aLudVCV+7dHhBf5Fuo0S7UsIZLFxfnhMLOnI=; b=Oix5Mh0IGcA9Wp4PBSavHuqpSeZY+PLlcWk1F8Lxr89vLWeICRkMvrhrl469jdkXh7 Mq5ggON62cYoGvH8WLgvT71sp4T33WLm6YoalHcg7CA0ccCxxRoTX7AYa5VlgwMZ6oD/ PlI5z7DbMSJOl2H8WIrEObjVngS0IyiqAmmWw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:openpgp:autocrypt :message-id:date:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=u/hxwd3aLudVCV+7dHhBf5Fuo0S7UsIZLFxfnhMLOnI=; b=dXAInhhAuDgARLLVLcON9gVisoswhBjC7G69hQVcJMUAtNuBRNRhE0Fty/a4oGp77j IR0Gjhwq7vnB5qRU0vSYZnNXo+g4gzUzRi7XkHeS01L52680zgNmnjV1jrwr/P++c+4U K+MmeTE3x4Lc59K8aIGg7+EI/Q8QwHCz3azNBLhtIf5frh3kgakd1xsHZuTXoKJPfXWM I5Ox4ast+eAQ6oBCEZBm7T63x7pWN9Mc18XFCkYnss+I2XN605VE0cFWS1ReIK/EaqJA X7zQDtuTFStxrql/+t0+P1qxLfsl+2tFtTKJNtinoUyw6qVgus6HWhhDBkWrxcBfx2h4 UlhQ== X-Gm-Message-State: AJcUukeVbXcmuD3KJNIfhRld8P+BvEZXPDs45+Kr+Q0HEs6edB+QHWh4 FiWtle8qvvLQAo4QTpqit/6a4EB8kEY= X-Received: by 2002:adf:b201:: with SMTP id u1mr6731423wra.165.1548330384549; Thu, 24 Jan 2019 03:46:24 -0800 (PST) Received: from [10.44.66.8] ([212.45.67.2]) by smtp.googlemail.com with ESMTPSA id x10sm124994257wrn.29.2019.01.24.03.46.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 24 Jan 2019 03:46:23 -0800 (PST) Subject: Re: [ 1/1] scsi: qcom-ufs: Add support for bus voting using ICB framework To: Asutosh Das , subhashj@codeaurora.org, cang@codeaurora.org, vivek.gautam@codeaurora.org, rnayak@codeaurora.org, vinholikatti@gmail.com, jejb@linux.vnet.ibm.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org Cc: linux-arm-msm@vger.kernel.org, Rob Herring , Mark Rutland , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , open list References: From: Georgi Djakov Openpgp: preference=signencrypt Autocrypt: addr=georgi.djakov@linaro.org; prefer-encrypt=mutual; keydata= mQINBFjTuRcBEACyAOVzghvyN19Sa/Nit4LPBWkICi5W20p6bwiZvdjhtuh50H5q4ktyxJtp 1+s8dMSa/j58hAWhrc2SNL3fttOCo+MM1bQWwe8uMBQJP4swgXf5ZUYkSssQlXxGKqBSbWLB uFHOOBTzaQBaNgsdXo+mQ1h8UCgM0zQOmbs2ort8aHnH2i65oLs5/Xgv/Qivde/FcFtvEFaL 0TZ7odM67u+M32VetH5nBVPESmnEDjRBPw/DOPhFBPXtal53ZFiiRr6Bm1qKVu3dOEYXHHDt nF13gB+vBZ6x5pjl02NUEucSHQiuCc2Aaavo6xnuBc3lnd4z/xk6GLBqFP3P/eJ56eJv4d0B 0LLgQ7c1T3fU4/5NDRRCnyk6HJ5+HSxD4KVuluj0jnXW4CKzFkKaTxOp7jE6ZD/9Sh74DM8v etN8uwDjtYsM07I3Szlh/I+iThxe/4zVtUQsvgXjwuoOOBWWc4m4KKg+W4zm8bSCqrd1DUgL f67WiEZgvN7tPXEzi84zT1PiUOM98dOnmREIamSpKOKFereIrKX2IcnZn8jyycE12zMkk+Sc ASMfXhfywB0tXRNmzsywdxQFcJ6jblPNxscnGMh2VlY2rezmqJdcK4G4Lprkc0jOHotV/6oJ mj9h95Ouvbq5TDHx+ERn8uytPygDBR67kNHs18LkvrEex/Z1cQARAQABtChHZW9yZ2kgRGph a292IDxnZW9yZ2kuZGpha292QGxpbmFyby5vcmc+iQI+BBMBAgAoBQJY07kXAhsDBQkHhM4A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vdOUxvh1bNNmXh7OlBL1MpJYY/ydIm3B KEmKjLDvB0pePJkdTw== Message-ID: Date: Thu, 24 Jan 2019 13:46:22 +0200 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Asutosh, Thanks for the patch! On 1/24/19 09:01, Asutosh Das wrote: > Adapt to the new ICB framework for bus bandwidth voting. It's actually called interconnect API or interconnect framework. > 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 > --- You can put here (below the --- line) the text from the cover letter. Usually people do not add separate cover letters for single patches. > .../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 Is the above really required? Are the interconnect bandwidth requests required to enable something critical to UFS functionality? Would UFS still work without any bandwidth scaling, although for example slower? Could you please clarify. > +- 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. DT bindings should be submitted as a separate patch. Anyway, people frown upon putting configuration data in DT. Could we put this data into the driver as a static table instead of DT? Also maybe use ab/pb for average/peak bandwidth. > + > Example: > ufshc@0xfc598000 { > compatible = "jedec,ufs-1.1"; > diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c > index 2b38db2..213e975 100644 > --- a/drivers/scsi/ufs/ufs-qcom.c > +++ b/drivers/scsi/ufs/ufs-qcom.c > @@ -16,6 +16,7 @@ > #include > #include > #include > +#include > #include Alphabetical order? > > #include "ufshcd.h" > @@ -27,6 +28,10 @@ > #define UFS_QCOM_DEFAULT_DBG_PRINT_EN \ > (UFS_QCOM_DBG_PRINT_REGS_EN | UFS_QCOM_DBG_PRINT_TEST_BUS_EN) > > +#define UFS_DDR "ufs-ddr" > +#define CPU_UFS "cpu-ufs" Not sure if it's really useful to have them as #defines. Also maybe use "ufs-mem" instead of "ufs-ddr" to be more consistent with other users. > + > + > enum { > TSTBUS_UAWM, > TSTBUS_UARM, > @@ -714,7 +719,6 @@ static int ufs_qcom_get_pwr_dev_param(struct ufs_qcom_dev_params *qcom_param, > return 0; > } > > -#ifdef CONFIG_MSM_BUS_SCALING > static int ufs_qcom_get_bus_vote(struct ufs_qcom_host *host, > const char *speed_mode) > { > @@ -768,24 +772,83 @@ static void ufs_qcom_get_speed_mode(struct ufs_pa_layer_attr *p, char *result) > } > } > > +static int ufs_qcom_get_ib_ab(struct ufs_qcom_host *host, int index, > + struct qcom_bus_vectors *ufs_ddr_vec, > + struct qcom_bus_vectors *cpu_ufs_vec) > +{ > + struct qcom_bus_path *usecase; > + > + if (!host->qbsd) > + return -EINVAL; > + > + if (index > host->qbsd->num_usecase) > + return -EINVAL; > + > + usecase = host->qbsd->usecase; > + > + /* > + * > + * usecase:0 usecase:0 > + * ufs->ddr cpu->ufs > + * |vec[0&1] | vec[2&3]| > + * +----+----+----+----+ > + * | ab | ib | ab | ib | > + * |----+----+----+----+ > + * . > + * . > + * . > + * usecase:n usecase:n > + * ufs->ddr cpu->ufs > + * |vec[0&1] | vec[2&3]| > + * +----+----+----+----+ > + * | ab | ib | ab | ib | > + * |----+----+----+----+ > + */ > + > + /* index refers to offset in usecase */ > + ufs_ddr_vec->ab = usecase[index].vec[0].ab; > + ufs_ddr_vec->ib = usecase[index].vec[0].ib; > + > + cpu_ufs_vec->ab = usecase[index].vec[1].ab; > + cpu_ufs_vec->ib = usecase[index].vec[1].ib; > + > + return 0; > +} > + > static int ufs_qcom_set_bus_vote(struct ufs_qcom_host *host, int vote) > { > int err = 0; > + struct qcom_bus_scale_data *d = host->qbsd; > + struct qcom_bus_vectors path0, path1; > + struct device *dev = host->hba->dev; > > - if (vote != host->bus_vote.curr_vote) { > - err = msm_bus_scale_client_update_request( > - host->bus_vote.client_handle, vote); > - if (err) { > - dev_err(host->hba->dev, > - "%s: msm_bus_scale_client_update_request() failed: bus_client_handle=0x%x, vote=%d, err=%d\n", > - __func__, host->bus_vote.client_handle, > - vote, err); > - goto out; > - } > + err = ufs_qcom_get_ib_ab(host, vote, &path0, &path1); > + if (err) { > + dev_err(dev, "Error: failed (%d) to get ib/ab\n", > + err); > + return err; > + } > > - host->bus_vote.curr_vote = vote; > + dev_dbg(dev, "Setting vote: %d: ufs-ddr: ab: %llu ib: %llu\n", vote, > + path0.ab, path0.ib); > + err = icc_set_bw(d->ufs_ddr, path0.ab, path0.ib); > + if (err) { > + dev_err(dev, "Error: (%d) failed setting (%s) bus vote\n", err, > + UFS_DDR); > + return err; > } > -out: > + > + dev_dbg(dev, "Setting: cpu-ufs: ab: %llu ib: %llu\n", path1.ab, > + path1.ib); > + err = icc_set(d->cpu_ufs, path1.ab, path1.ib); > + if (err) { > + dev_err(dev, "Error: (%d) failed setting (%s) bus vote\n", err, > + CPU_UFS); > + return err; > + } > + > + host->bus_vote.curr_vote = vote; > + > return err; > } > > @@ -807,6 +870,7 @@ static int ufs_qcom_update_bus_bw_vote(struct ufs_qcom_host *host) > dev_err(host->hba->dev, "%s: failed %d\n", __func__, err); > else > host->bus_vote.saved_vote = vote; > + > return err; > } > > @@ -837,34 +901,114 @@ static int ufs_qcom_update_bus_bw_vote(struct ufs_qcom_host *host) > return count; > } > > +static struct qcom_bus_scale_data *ufs_qcom_get_bus_scale_data(struct device > + *dev) > + > +{ > + struct platform_device *pdev = to_platform_device(dev); > + struct device_node *of_node = dev->of_node; > + struct qcom_bus_scale_data *qsd; > + struct qcom_bus_path *usecase = NULL; > + int ret = 0, i = 0, j, num_paths, len; > + const uint32_t *vec_arr = NULL; Please use u32 instead of uint32_t. > + bool mem_err = false; > + > + if (!pdev) { > + dev_err(dev, "Null platform device!\n"); > + return NULL; > + } > + > + qsd = devm_kzalloc(dev, sizeof(struct qcom_bus_scale_data), GFP_KERNEL); > + if (!qsd) > + return NULL; > + > + ret = of_property_read_string(of_node, "qcom,msm-bus,name", &qsd->name); > + if (ret) { > + dev_err(dev, "Error: (%d) Bus name missing!\n", ret); > + return NULL; > + } > + > + ret = of_property_read_u32(of_node, "qcom,msm-bus,num-cases", > + &qsd->num_usecase); > + if (ret) { > + pr_err("Error: num-usecases not found\n"); > + goto err; > + } > + > + usecase = devm_kzalloc(dev, (sizeof(struct qcom_bus_path) * > + qsd->num_usecase), GFP_KERNEL); > + if (!usecase) > + return NULL; > + > + ret = of_property_read_u32(of_node, "qcom,msm-bus,num-paths", > + &num_paths); > + if (ret) { > + pr_err("Error: num_paths not found\n"); > + return NULL; > + } > + > + vec_arr = of_get_property(of_node, "qcom,msm-bus,vectors-KBps", &len); > + if (vec_arr == NULL) { > + pr_err("Error: Vector array not found\n"); > + return NULL; > + } > + > + for (i = 0; i < qsd->num_usecase; i++) { > + usecase[i].num_paths = num_paths; > + usecase[i].vec = devm_kzalloc(dev, num_paths * > + sizeof(struct qcom_bus_vectors), > + GFP_KERNEL); > + if (!usecase[i].vec) { > + mem_err = true; > + dev_err(dev, "Error: Failed to alloc mem for vectors\n"); > + goto err; > + } > + > + for (j = 0; j < num_paths; j++) { > + int idx = ((i * num_paths) + j) * 2; > + > + usecase[i].vec[j].ab = (uint64_t) > + be32_to_cpu(vec_arr[idx]); > + usecase[i].vec[j].ib = (uint64_t) > + be32_to_cpu(vec_arr[idx + 1]); > + } > + } > + > + qsd->usecase = usecase; > + return qsd; > +err: > + if (mem_err) { > + for (; i > 0; i--) > + kfree(usecase[i].vec); > + } > + return NULL; > +} We wouldn't need all the above DT parsing if we add a sdm845 bandwidth usecase table. Could you give it a try? Thanks, Georgi