Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2944280imm; Fri, 20 Jul 2018 07:34:22 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfqghRIuNvQ0Tlt7w+uYulBexqdh5h+QKTQOO4gXhvNglXotp16MO+YilAyGMHvDDPsvCuw X-Received: by 2002:a17:902:b608:: with SMTP id b8-v6mr2362752pls.312.1532097262206; Fri, 20 Jul 2018 07:34:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532097262; cv=none; d=google.com; s=arc-20160816; b=QG+VCVdNrMO3P4Utz72njJvNabbqm8CAUC2CMLzajaOxcHVqF5N4oqi2fnXpDlRwTX H73Y+IGO/FJISUlfSxyUMU/U+GzFUgMBPJN5dJeZ71ppMBqC+czfAzNnNz1tKd4Vy/i/ ysldwSb7OzTcJPz5LqsDa+mj5ZgA1vUe11IJc1l6g6S6iSclBsv33jSgo7/5Xi2rf1+a +fCFC1wPgLxf5FAS7sEmWc0/NvyDgFDHk8v67WNfEhAOLO7YD6u4Xw1tKkZEevy4nokz sxDGAd7sWY31S1h4mdFkH4Asct7r8/GGBXhIGrHhBD/3/TpPl5JHtcXfIzWKammBmzQ2 30bA== 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:references:cc:to:subject:from:dkim-signature :arc-authentication-results; bh=FFGDpEtJE4sASZ1pnS9lvqlutr7m5APjzto31bi2nu4=; b=T6jR9Vp5frhE39cconSaLpefzerUm1YtSEJS1hXcvomBcTtQiV+n1X5jqc48lHjys8 6tEmn90A3PAl4HAtkvgorQKvuN7yOu80pPr0IPEaqJabIhrdpcPvizPJ/PLhjfTR25Ay xSdsLmjWnhJ6YWK43sLpyEj94XI4NFRtE4ZsrxMczeB5jgwfd62ffMYWqZCHIp1vYn25 u0Lf6ZaL56zBzya61809ufNCB+T5gxdiKghcRYzS+LSlUWsqc7Nw9tgk/aSrm9PiNnFf sJFguEBP6a+QIK0T0Yh67X44qj9Ye9ooazsCKTNjzxlRddyfGXdO63MoSK5kV9WFfaf2 6NEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fPhYFJj2; 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 u10-v6si1772075plu.506.2018.07.20.07.34.07; Fri, 20 Jul 2018 07:34:22 -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=@linaro.org header.s=google header.b=fPhYFJj2; 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 S1731740AbeGTPVt (ORCPT + 99 others); Fri, 20 Jul 2018 11:21:49 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:33730 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731256AbeGTPVs (ORCPT ); Fri, 20 Jul 2018 11:21:48 -0400 Received: by mail-wm0-f67.google.com with SMTP id z6-v6so4399396wma.0 for ; Fri, 20 Jul 2018 07:33:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:subject:to:cc:references:openpgp:autocrypt:message-id:date :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=FFGDpEtJE4sASZ1pnS9lvqlutr7m5APjzto31bi2nu4=; b=fPhYFJj2GSxfkpFcj1N7myVBSiaIh4kgv9QD66brPm8F1rDgfxqLcWZgPWvPQSHfNW VNBhMWpsDuD6GC9kQQDP2VNwsAmODV9dPa5+AksNyZXCOux0zJ2guCP8Sb7R7AygIcz/ YChRpkw/a9U7FrfvPVMhYP9a6SpxRwxp+M4sU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:references:openpgp:autocrypt :message-id:date:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=FFGDpEtJE4sASZ1pnS9lvqlutr7m5APjzto31bi2nu4=; b=YyGGg18+IEhGf9BxQKEXP6jGJogC3RinuNVZoIE53XcLLe3gXkMQkTFaylZKRVQGa8 zumQbnSjGgOKaMYPieMisAQc2vm31y1DJVRtpWP109n7jNzlABKTBgzG8R3tZ5J/hmOf xosQAYnfCx5vSOJwiRTqxt/DbRxWj7GYGPV/ZseI7PvOpfBOlx0GAfWBo9GPtAecrNF8 aUgZz2UByZdLDGb3DphcGBtYcedRoYOUxOSXAoKmrWmwbB89+H+1S/xXIBxnyofTu+9p VvaWk5FZRYsEoJOjhcfn1wwSL7nttVDmS1NM3L+R4Xc/MipF027PwnLhay5XXcvQOfZo yiKw== X-Gm-Message-State: AOUpUlGWWNQZ2pw2nLd2HhzDk0qcWQZXibirDiDULE5v/+J2Lx0aZcuR lGfk4GXoDAXUgGiaQ/THTI4ILw== X-Received: by 2002:a1c:ec1b:: with SMTP id k27-v6mr1624065wmh.157.1532097193009; Fri, 20 Jul 2018 07:33:13 -0700 (PDT) Received: from [10.44.66.8] ([212.45.67.2]) by smtp.googlemail.com with ESMTPSA id t19-v6sm1650477wmi.42.2018.07.20.07.33.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 20 Jul 2018 07:33:12 -0700 (PDT) From: Georgi Djakov Subject: Re: [PATCH v6 1/8] interconnect: Add generic on-chip interconnect API To: Alexandre Bailon Cc: linux-pm@vger.kernel.org, gregkh@linuxfoundation.org, rjw@rjwysocki.net, robh+dt@kernel.org, mturquette@baylibre.com, khilman@baylibre.com, vincent.guittot@linaro.org, skannan@codeaurora.org, bjorn.andersson@linaro.org, amit.kucheria@linaro.org, seansw@qti.qualcomm.com, daidavid1@codeaurora.org, evgreen@chromium.org, mka@chromium.org, mark.rutland@arm.com, lorenzo.pieralisi@arm.com, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org References: <20180709155104.25528-1-georgi.djakov@linaro.org> <20180709155104.25528-2-georgi.djakov@linaro.org> <5ccc5117-4fff-b066-1309-139b7e874d0a@baylibre.com> Openpgp: preference=signencrypt Autocrypt: addr=georgi.djakov@linaro.org; prefer-encrypt=mutual; keydata= xsFNBFjTuRcBEACyAOVzghvyN19Sa/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 ASMfXhfywB0tXRNmzsywdxQFcJ6jblP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1omgEpjnFsPsyFebzcKGbdEr6vySGa3Cof+miX06hQXKe99a5+eHNhtZJcMAIO89wZmj 7ayYJIXFqjl/X0KBcCbiAl4vbdBw1bqFnO4zd1lMXKVoa29UHqby4MPbQhjWNVv9kqp8A39+ E9xw890l1xdERkjVKX6IEJu2hf7X3MMl9tOjBK6MvdOUxvh1bNNmXh7OlBL1MpJYY/ydIm3B KEmKjLDvB0pePJkdTw== Message-ID: Date: Fri, 20 Jul 2018 17:33:10 +0300 MIME-Version: 1.0 In-Reply-To: <5ccc5117-4fff-b066-1309-139b7e874d0a@baylibre.com> 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 Alexandre, On 07/11/2018 07:21 PM, Alexandre Bailon wrote: > On 07/09/2018 05:50 PM, Georgi Djakov wrote: >> This patch introduces a new API to get requirements and configure the >> interconnect buses across the entire chipset to fit with the current >> demand. >> >> The API is using a consumer/provider-based model, where the providers are >> the interconnect buses and the consumers could be various drivers. >> The consumers request interconnect resources (path) between endpoints and >> set the desired constraints on this data flow path. The providers receive >> requests from consumers and aggregate these requests for all master-slave >> pairs on that path. Then the providers configure each participating in the >> topology node according to the requested data flow path, physical links and >> constraints. The topology could be complicated and multi-tiered and is SoC >> specific. >> >> Signed-off-by: Georgi Djakov >> --- [..] >> +static int apply_constraints(struct icc_path *path) >> +{ >> + struct icc_node *next, *prev = NULL; >> + int ret; >> + int i; >> + >> + for (i = 0; i < path->num_nodes; i++, prev = next) { >> + struct icc_provider *p; >> + >> + next = path->reqs[i].node; >> + /* >> + * Both endpoints should be valid master-slave pairs of the >> + * same interconnect provider that will be configured. >> + */ >> + if (!prev || next->provider != prev->provider) >> + continue; >> + >> + p = next->provider; >> + >> + aggregate_provider(p); >> + >> + /* set the constraints */ >> + ret = p->set(prev, next, p->avg_bw, p->peak_bw); > I'm confuse here. > In path_init(), the first reqs' node takes the node. > But here, this same element is assigned to prev, which is used as src by > set(). For me this looks like prev and next have been inverted. Ok, right. Will change the order of reqs to go from the source to the destination. Thanks, Georgi >> + if (ret) >> + goto out; >> + } >> +out: >> + return ret; >> +} >> +