Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp1753718ybg; Sat, 19 Oct 2019 01:47:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqwXSBLU7fKl/op/Z8l6JLQsV3eD94qZJCD8+QrXHXpez6e04p6wvNJkKWnkKgD7+Oe0n/ja X-Received: by 2002:a17:906:54cf:: with SMTP id c15mr12693535ejp.202.1571474837124; Sat, 19 Oct 2019 01:47:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571474837; cv=none; d=google.com; s=arc-20160816; b=cpWzfEtz19fbC9o3qWtSbWyMr7HWGcBsMZuaT8pLrNOy4O1AINM3/YvXEm67/QKNOY OpN/KEZy/X2vOmBhIFejJUuzaLVp/OzmsmIswUZG8n5nn8y0ZUR6U5hnTGqTTV5aWAN+ miLpfprIBrNgp+R6n91hSawrZDK/w+YPxHjlfGZvhOTGV++qHW1XjPPjls2UCnTWqP0N zkAW7S+W9ZdRR968nJCspyqCVFaZqTeIVP9z26r5ryjnsKnLypIYotU5c1JHp/Azphul PaRKV96m8MB9muKQghTZzkd45ivf0YXmXZe+Yohox51jKIDDi8nByfmV4bkqVfkIubNw Ae3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=v+xlH4n34GpIF8eBLaea0CeqXTV/EF6VBM7h/r2d6pw=; b=hrl/ToF0UJqhHVqO3BvrQjR5jqqmnWNB6C4a0MXn9Ij8KXKdb1VT/QB9cedyd1Spy/ OOLGU9iMWOHBeErd9MN2ovSvoMEYsebb2lR7VuKYG9b+zjOOOWup6zVdAe4MZTxVLxft prIxM4t03PpSvxw/4/cZzhMIsaKR+qDQntkvevABd78L5yVH+68uVXnAPShpMH8FzwqE Grd2BazFkYyqJlyz94ERNUxN4MQ6nZB/SwMPxMSbxiVW0ASZshQlZmSm8s/VgsOUxxIK uzru/zjixTfmJ/3QIHlMPmHOxg2B+043Bbe5RqLCrOK56P4s/1q9eXRfHgDmxkRzFjfD 2chQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=De5hTX3J; 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 u24si205679edq.79.2019.10.19.01.46.53; Sat, 19 Oct 2019 01:47:17 -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=De5hTX3J; 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 S2502230AbfJRQtG (ORCPT + 99 others); Fri, 18 Oct 2019 12:49:06 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:34313 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2502179AbfJRQtG (ORCPT ); Fri, 18 Oct 2019 12:49:06 -0400 Received: by mail-pl1-f193.google.com with SMTP id k7so3132920pll.1 for ; Fri, 18 Oct 2019 09:49:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=v+xlH4n34GpIF8eBLaea0CeqXTV/EF6VBM7h/r2d6pw=; b=De5hTX3JBN8Q7ACyfo1u7clSDEwrCzdRy5Xr7tZu8/ZEeYl2SDXKBq4FZZE8ONBzRk tcHVTQhRFPYHeu0d0KYiDxfy3e598jTbMP8P+/D3K0XMBANSO28aweiVBVROm35frY39 7giwoc/mPVGMlgwGf30B9JImNpcjDajzm1X/6QzVlEX2sSg+lCxyXjSgWDkk5YPCwGp1 uLDTfR1vR5mG8EmKPbKIg282L12cq9MLmC20Srn8H78b6g5Qejh8GAyqu4Ovg/iIOzqj c5GHP7ZizTZX3/pxkTgAnEddZN6iBSO0AUuRd9xspOBOTo/jeNFSCsBF+BiNmex6gBF+ tXFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=v+xlH4n34GpIF8eBLaea0CeqXTV/EF6VBM7h/r2d6pw=; b=GuTE6avwkT9VPlPSgvlAUCVduJRXZb8W3hyloRO6O4G9xcgNdQTd7kyopJz1V/ifeF tjyILT9N0eDw9npyTmHVFXm9v9m30jydLlamEm0GmzdrDNn++xh2vvLUx39foNTnxdkd 7upMrXqSYE5/Ncm8f31h8B14CWDmdKc7fy764CynP1ZMzXw0HeR0ff/Kafw5uFnaerrO reo7p5A1G5atyReAviE4PwiK0l2fdmXT6npPsb1U2j6fFC4M+uQfqvBhVGb29bhH4lyf puxAxNnX+qkogV/82btUelHYMAZeZmCod/EtR557eTLswwzqoGCSjbP1TsNHrSOIZdEN tkYw== X-Gm-Message-State: APjAAAWoIVmJ1E8oxYJ8Mj0A7EjlPjCH1nW/xTRIRn8c1Q0MpTDFH18b K0rpLyp0bfw/ez0RcwINhXprFw== X-Received: by 2002:a17:902:d915:: with SMTP id c21mr3169206plz.264.1571417345139; Fri, 18 Oct 2019 09:49:05 -0700 (PDT) Received: from tuxbook-pro (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id v19sm7239550pff.46.2019.10.18.09.49.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Oct 2019 09:49:04 -0700 (PDT) Date: Fri, 18 Oct 2019 09:49:01 -0700 From: Bjorn Andersson To: Georgi Djakov Cc: linux-pm@vger.kernel.org, evgreen@chromium.org, daidavid1@codeaurora.org, vincent.guittot@linaro.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] interconnect: Add locking in icc_set_tag() Message-ID: <20191018164901.GC1669@tuxbook-pro> References: <20191018141750.17032-1-georgi.djakov@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191018141750.17032-1-georgi.djakov@linaro.org> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri 18 Oct 07:17 PDT 2019, Georgi Djakov wrote: > We must ensure that the tag is not changed while we aggregate the > requests. Currently the icc_set_tag() is not using any locks and this > may cause the values to be aggregated incorrectly. Fix this by acquiring > the icc_lock while we set the tag. > > Fixes: 127ab2cc5f19 ("interconnect: Add support for path tags") > Signed-off-by: Georgi Djakov Reviewed-by: Bjorn Andersson > --- > drivers/interconnect/core.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/interconnect/core.c b/drivers/interconnect/core.c > index e24092558c29..4940c0741d40 100644 > --- a/drivers/interconnect/core.c > +++ b/drivers/interconnect/core.c > @@ -408,8 +408,12 @@ void icc_set_tag(struct icc_path *path, u32 tag) > if (!path) > return; > > + mutex_lock(&icc_lock); > + > for (i = 0; i < path->num_nodes; i++) > path->reqs[i].tag = tag; > + > + mutex_unlock(&icc_lock); > } > EXPORT_SYMBOL_GPL(icc_set_tag); >