From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9C823C433F5 for ; Wed, 9 Feb 2022 09:35:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=au7XoxhTM87QDLyNJQbwNpm3/4d6M5vDpkPQnqpgvVo=; b=0IKnj/MgwosdC9 kydmbUCwZffUUTSeCW19KEw+1gtclJGlNfSQqyVKTOTlTHEHrQU2LwBhdj6UMEU09qzVr2UZYklFy PECRsJy+nwLsBeEPE0jO1ffC2cb8+IUncB0aKoMTL2eIivan2uz/spWnKVGHJ7wyeThGJDkcUnzM8 dc++iRQpWNncvNvK0xGO7xwzzlOAjyPXaAv41U4AiMlcXsMgLjBgUnhtrqaNTruwOtFbk46xQwP9S llSX+RR+5I1rdA6Gum3fleCK4LkApOqnSpLZIe3FsttCnXdHec4hQDk/715LIhgFBFcA23d2bTQ+M +JtzbhIC5TTGzLayCf6w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nHjLy-00GwMt-QW; Wed, 09 Feb 2022 09:33:35 +0000 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nHjLa-00GwFq-Im for linux-arm-kernel@lists.infradead.org; Wed, 09 Feb 2022 09:33:12 +0000 Received: by mail-ej1-x630.google.com with SMTP id s21so5381630ejx.12 for ; Wed, 09 Feb 2022 01:33:10 -0800 (PST) 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; bh=ZL5nsQJzlN6imps4+YiPtBhsGzf6yOFUap6AeTuCeNA=; b=w6PJpjf74O74HjyL1Gj6ROIaBJicmTqsiYlGYWEZsKsyUkNTjPNiEpbRnjVh+P4NeF WlM66ApstCsJi6ZyBn3sXMuPEvWWu9hqIoq0CHsKjOhhmk57u11PUNb7Tc641bueGcUk 9LLibEfyVfbOUR+kUcZK4aJ2ZuYGTKgO5jIEs7s8SfOBSP23gnWBPPukSS/QDNq35+Hk Xq7tL8k+texo1S/u6BHcgF26AT61xhUe1vSg/e0Bv2U0318F4dDfkPTQpCDm6PuvVX+B z8YMPepM9hBcUvms1dGNM9hVicB4rzQ4GmkI4EUXUw9gjUO/BEJg/RmlFoakrfEac+4H s7AQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=ZL5nsQJzlN6imps4+YiPtBhsGzf6yOFUap6AeTuCeNA=; b=aWmPOZjS3i0w5bZ8xdeupOKqyi7+TzVv5HKNzPadHgKNFeNmFuot0E0+80O8bXsBjT X025tn4yX7r9B3ST6AvOI39gE+K6uFfcWwmRH+Em0UWFS/y11JYG9bWW9Ylacu/9EeAg 9222LIyR79ZsFk8cwI8I5P4cPjDOZKi5o8hKrxbXGwl08De3vb8O8LKzL+IkzjCTazQA E2cWFJlmnMcFIzUZwhD+MHYrSpMTbcY6hcTj5WfPH8YtkOzbwf4VdB76I79w/q8t/Y+t MbNeCOBufdUO15EaiSz7qgdmvSgbz/afOf+ikV8xqhHUtSR3yM831keEcjk1f6f4JHsS IgZQ== X-Gm-Message-State: AOAM531DZhWhLo5iS0YpF+Dgk5IJlqQmsWcEmVU6OroOCJlXZakXfAMa rbI2BWeCFKp5XmJs85LqQ7s4kw== X-Google-Smtp-Source: ABdhPJwj2ogtAm01Cn4fpJI3qhVdtBFd94vapf/jKbUe9O7RLyxnsCzDlZd5IAM4WWK17xSSvSr2/A== X-Received: by 2002:a17:906:7948:: with SMTP id l8mr1126088ejo.636.1644399188930; Wed, 09 Feb 2022 01:33:08 -0800 (PST) Received: from leoy-ThinkPad-X240s ([104.245.96.65]) by smtp.gmail.com with ESMTPSA id g9sm5796897ejm.152.2022.02.09.01.33.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 01:33:08 -0800 (PST) Date: Wed, 9 Feb 2022 17:33:04 +0800 From: Leo Yan To: Suzuki K Poulose Cc: Mathieu Poirier , Mike Leach , Alexander Shishkin , coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 RESEND 1/4] coresight: etm4x: Add lock for reading virtual context ID comparator Message-ID: <20220209093304.GA334894@leoy-ThinkPad-X240s> References: <20220204152403.71775-1-leo.yan@linaro.org> <20220204152403.71775-2-leo.yan@linaro.org> <6b91293a-1149-2c77-04a4-421a45d4e1e0@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <6b91293a-1149-2c77-04a4-421a45d4e1e0@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220209_013310_662699_20E49393 X-CRM114-Status: GOOD ( 20.92 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Suzuki, On Wed, Feb 09, 2022 at 05:47:24AM +0000, Suzuki Kuruppassery Poulose wrote: > Hi Leo > > On 04/02/2022 15:24, Leo Yan wrote: > > Updates to the values and the index are protected via the spinlock. > > Ensure we use the same lock to read the value safely. > > > > Signed-off-by: Leo Yan > > Reviewed-by: Suzuki K Poulose > > --- > > drivers/hwtracing/coresight/coresight-etm4x-sysfs.c | 2 ++ > > 1 file changed, 2 insertions(+) > > > > diff --git a/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c b/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c > > index 10ef2a29006e..2f3b4eef8261 100644 > > --- a/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c > > +++ b/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c > > @@ -2111,7 +2111,9 @@ static ssize_t vmid_val_show(struct device *dev, > > struct etmv4_drvdata *drvdata = dev_get_drvdata(dev->parent); > > struct etmv4_config *config = &drvdata->config; > > + spin_lock(&drvdata->spinlock); > > val = (unsigned long)config->vmid_val[config->vmid_idx]; > > + spin_unlock(&drvdata->spinlock); > > return scnprintf(buf, PAGE_SIZE, "%#lx\n", val); > > } > > > I have queued this patch. Thanks! > For the rest, we would need to wait until the helper lands in the rc. The helper function patch has been landed on the mainline kernel, it would be safe to merge the rest patches. https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d7e4f8545b497b3f5687e592f1c355cbaee64c8c BTW, I think you could pick another two refactoring patches: https://lore.kernel.org/lkml/20220204135051.60639-2-leo.yan@linaro.org/ https://lore.kernel.org/lkml/20220204135051.60639-3-leo.yan@linaro.org/ Thanks, Leo _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel