Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp1852955ybc; Wed, 13 Nov 2019 05:25:55 -0800 (PST) X-Google-Smtp-Source: APXvYqxou9Qd16AYAodJ1nBoVH2JhJ9UnnVUZi90Qw2tmfEuTyNUWF06tQ2tpYYoHCT+cG8A0GFv X-Received: by 2002:a50:fd9a:: with SMTP id o26mr3478339edt.244.1573651555253; Wed, 13 Nov 2019 05:25:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573651555; cv=none; d=google.com; s=arc-20160816; b=n1+SPDs9pWS1CX2WafCV3Nn9/eCHJUTYnqmakQf7IjF7lZ1nK5ljfDoOYhtcGiOQmi t2+KTbsKguqI7Ty5b2lGWm0rzLJDZf5KzbearPqU93nc/dY14X6cKNbK0/fD+56V8j80 kCwKlOTrVfEodxw0m+25GRMStNYEDmGgC26OShrsCvbKFY/MPbpRLHvPCGLO+Yy1eZnt W/WFySOtAmnlrgyIuR8v7nqimtPoA9tGzMp1UCYEom/hXFVwxuqtqs9s9Uv3G9ebJEdU J+mlGsmNchY1HoUy+KbmWiUqktPxzYYaRO4xOfENH2Mzmv9zgttSw9IJCznZ4iD78qXv 1kVA== 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:openpgp :from:references:cc:to:subject:dkim-signature; bh=JRP/6EKOcSy60KLVoWb7jM1Tf5lS/OPVbKzG0KgZCIY=; b=tqj42k0K1ODHivLdqwX+w1hTdkIeUu12Sbe6TRMei5z7k1OPN+lmNbJp6hMiHNKl3k RxVwGhlSI654Hx704E5884C2EeCxQKxEQnrPH61Yx62d5raUpmoDGOCKjAVZuTzp3KUS oAAwpcFSqkKBGB8CPBdrsC96H4v3SaQ6XMs4xdgp1WU4qdbDVq/H5qOEPq7fzH2vj0sZ 29lCA/oEiYHFgpw3chhQL/FvydIWadRqCW8A87/Iv8IufdepWlSM6hxQRDO25LjxT5m/ HnL7R73Y8LsoTN7ZY7+YoevLJ6gSDPYY9sUkZ2pSmdU86l6YL4SaZXDYg0RCm05uJqK8 V3cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=uAo9yOmM; 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 r7si1208086edm.224.2019.11.13.05.25.30; Wed, 13 Nov 2019 05:25:55 -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=uAo9yOmM; 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 S1727129AbfKMNYX (ORCPT + 99 others); Wed, 13 Nov 2019 08:24:23 -0500 Received: from mail-ed1-f65.google.com ([209.85.208.65]:46551 "EHLO mail-ed1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726994AbfKMNYX (ORCPT ); Wed, 13 Nov 2019 08:24:23 -0500 Received: by mail-ed1-f65.google.com with SMTP id x11so1754608eds.13 for ; Wed, 13 Nov 2019 05:24:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=subject:to:cc:references:from:openpgp:message-id:date:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=JRP/6EKOcSy60KLVoWb7jM1Tf5lS/OPVbKzG0KgZCIY=; b=uAo9yOmMnM/3SrNHSnXryuXkoyxb7GED2KW+gIH19apn94zis9+gv/nx8PglsR6vpz qgtdeMAI+ooZ7/giFoQgpO9y5Lk6VE/AHCfSm/vZLHdwBv3H8neAZyQ9j9WyTEHri1Xa lJieaXHz3a86aDe6YDxtgc/RLaADka6P+E/kyDkiaBWNprpijul2teXVwERnh1LlT7pu roagxEM8zv0CKc08CIY7j5Cs6C7GbzXyRZRYcCm5++1/44kHTBy8c/SL2b6YN6AiyeVL m6zBIp5Yl0jCmcqa1K9N2gaDZWAPTq1WfzDTgAhUMawRzqwg8IJ1qNETtKIncMHKfqrM PGMw== 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:message-id :date:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=JRP/6EKOcSy60KLVoWb7jM1Tf5lS/OPVbKzG0KgZCIY=; b=KbxkLtNbNHTQOEe+aAOZ8gqaxT3mPNb0SR66hwf3KJey5ytKqAxGVLhk/cIyWAWHvr NCvgrbNNDcI+PgUiYOZ/6SFgwXHiD6w8ZMkFR5tJgAeX6ogfBJ2xBXDxHmg+O0C2hUTw RK5fcAMmK51u3Kyl9HlFHiNN4ZL3DZC5z+kpCZF600/oIHALiAUhUtkQqevGHFBD+bvR QdQ/34GBwMkBUQRTUPUHpgwaKboJOzLipM0c4+vMM2K/L4rfaoHfsuXiyjqHIDNzU+ie iho1i2sjkOEtSFZZSDArvhO7y9qG7Lq5YdPkKLohQWdp4jGAzIQ4w2GX6hXq32OFfXf4 GrhQ== X-Gm-Message-State: APjAAAWURGb5bAubz2RRVgeRBdKa0ZlmheMdxlc3aVmnpTtjvovCoubQ DKKszkU0cXM6y07aZQDthRzgGcJYkT8= X-Received: by 2002:a17:906:c797:: with SMTP id cw23mr2705388ejb.19.1573651461073; Wed, 13 Nov 2019 05:24:21 -0800 (PST) Received: from [192.168.27.135] ([37.157.136.206]) by smtp.googlemail.com with ESMTPSA id r12sm245953edm.85.2019.11.13.05.24.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Nov 2019 05:24:20 -0800 (PST) Subject: Re: [PATCH v10 2/3] interconnect: qcom: Add MSM8916 interconnect provider driver To: Dmitry Osipenko , robh+dt@kernel.org, linux-pm@vger.kernel.org Cc: agross@kernel.org, bjorn.andersson@linaro.org, evgreen@chromium.org, daidavid1@codeaurora.org, vincent.guittot@linaro.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org References: <20191030153904.8715-1-georgi.djakov@linaro.org> <20191030153904.8715-3-georgi.djakov@linaro.org> <88315b5a-1354-acf9-d57d-b301fb78cfa4@gmail.com> From: Georgi Djakov Openpgp: preference=signencrypt Message-ID: <95eb0a55-d36b-b66e-ae64-18aa5baafff7@linaro.org> Date: Wed, 13 Nov 2019 15:24:19 +0200 MIME-Version: 1.0 In-Reply-To: <88315b5a-1354-acf9-d57d-b301fb78cfa4@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Dmitry, On 13.11.19 г. 15:03 ч., Dmitry Osipenko wrote: > 30.10.2019 18:39, Georgi Djakov пишет: >> Add driver for the Qualcomm interconnect buses found in MSM8916 based >> platforms. The topology consists of three NoCs that are controlled by >> a remote processor that collects the aggregated bandwidth for each >> master-slave pairs. >> [..] >> +static int qnoc_remove(struct platform_device *pdev) >> +{ >> + struct qcom_icc_provider *qp = platform_get_drvdata(pdev); >> + struct icc_provider *provider = &qp->provider; >> + struct icc_node *n; >> + >> + list_for_each_entry(n, &provider->nodes, node_list) { >> + icc_node_del(n); >> + icc_node_destroy(n->id); >> + } > > Hello Georgi, > > While examining the interconnect API and current drivers' code, I > noticed that everybody are copying this chunk of code which should crash > kernel because removing node from a list during the traverse is allowed > only when list_for_each_entry_safe() is used. Nice catch. Thank you! > Seems the IMX driver (which is under review now on the ML) is the only > driver that does the removing procedure correctly. > > Maybe it won't hurt to factor out the removal of provider's nodes into a > common helper. > Yes, this is a very good idea. Will do it. Thanks, Georgi