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 X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 55F92C2D0A3 for ; Tue, 3 Nov 2020 18:05:31 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D5D0620735 for ; Tue, 3 Nov 2020 18:05:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="GB94Hg3L"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="kN3nTRqz" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D5D0620735 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject: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=qiJCtABtDs4ecEif06bPj1+F+W05jGXYGHzd/xlIW1o=; b=GB94Hg3LNoFSi2hs/IyyT3xpD 6Ul8w1WwURx3IU4D9MzOU7/6xAPlaDmPU/F21/r6B9ZFCnbIMCz9/5vc1gKlVq7yu9J9Lp87VmWQW B/P5JL/x8Dw523LsQgm/WMJzDY1Pb1XcCFa5nAxoou7ODLJ0QW359Ak3cXWGocQjpg3+MF8uB76uw k1zP3KJETBrJQX9p4eXHxXVBGxtj1EqLs6MEnP0jwpMolmw1q406WmXXhzQ4nCHO4CiZJD+kNow3B dMc0PcM2PhHb4+sgnYcWqPMVvHUE9sCpAftu+69Xlk1T0C9bmc7/FCdMDcJmImivYihErpZ8ELa1F GyXJdIMqQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1ka0f8-0007tO-SA; Tue, 03 Nov 2020 18:04:06 +0000 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1ka0f5-0007s5-PK for linux-arm-kernel@lists.infradead.org; Tue, 03 Nov 2020 18:04:04 +0000 Received: by mail-pf1-x442.google.com with SMTP id y14so14900333pfp.13 for ; Tue, 03 Nov 2020 10:04:02 -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=eYEcKeGaEtZ9zZmugfVVOA+TtHVoaqu4rWB1l432yS8=; b=kN3nTRqzozLcJv+vSGfDOB3MRpgY5uiFC+9Xvh7nSMexLfoLgnoxlWP1WSkoL/bcFM z/6N9fEFgW7vMaF096I8sr5KkE/de4r/Zhrfv49Ea5ZipVQufBl4O2HnLMfkmodXgHdJ VIR1XaQ+s9bdGCKd5xVDE31JdbbXMEmEcqgzD7fvloou0wcI2jaq75a16fjwhVEI2zis t0994ul7Vj35N4ybheOoPAUZzeggS0J7WTa432Y7FnM1eKpFbKOPSr14qXa1LLbcNgm1 FwJ4YtODOnLXMKkf2xBxJZ7Mm8GhO04a43dYPd6dE9gbzTJep25atbMn7wKGQoaUH/lb On9Q== 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; bh=eYEcKeGaEtZ9zZmugfVVOA+TtHVoaqu4rWB1l432yS8=; b=CCoKoflr4WB7oRxZGeOFle1B3uRICdL2/QHLZfyDoYVYDDsYIIE9pietONwkim+Nfk KNC7fFWZ2UR+w6VVbhwWsbSXByYXgzILpub1WTr2wzmkT/gUUt/C488nbq3/USgA6VPe 41zMiO/ht7fCGl1WnBed7Q4kmsMoMZtEaMgq5WzEyfhekMvWyZ6/LLKkdPcbLxVRSytp o1I2HB7MVx7fFstNNVUAF6FvwtKQ+fnWbRLFtyUtx+VjkuW7nNWsgDE1goVG0TVSXK4E 5YnibYTdl5dQCi6wmz+9+hNDhAw1AtLy3Z1o4jiCT9PwyDMSvqeWXmGVJTat7+0NGliT glXw== X-Gm-Message-State: AOAM532RiQD8FVK5beEgDvnqXGLpQlvz7Vw+/LDJ7utnYxNxhETkTBei DE7P1ZpJP/GGIqvDsaa9FU1v+A== X-Google-Smtp-Source: ABdhPJxJUwHsVoHb8HmtWX8jqU8vQFKcfwsrEIZSv27of9zYUNhYzy1IudadB/UAjQ9coNtX7Xud8g== X-Received: by 2002:a63:1d53:: with SMTP id d19mr18352187pgm.289.1604426641178; Tue, 03 Nov 2020 10:04:01 -0800 (PST) Received: from xps15 (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id n15sm17256727pgt.75.2020.11.03.10.04.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Nov 2020 10:04:00 -0800 (PST) Date: Tue, 3 Nov 2020 11:03:58 -0700 From: Mathieu Poirier To: Suzuki K Poulose Subject: Re: [PATCH v3 08/26] coresight: tpiu: Prepare for using coresight device access abstraction Message-ID: <20201103180358.GC2855763@xps15> References: <20201028220945.3826358-1-suzuki.poulose@arm.com> <20201028220945.3826358-10-suzuki.poulose@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201028220945.3826358-10-suzuki.poulose@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201103_130403_854062_0775C5B9 X-CRM114-Status: GOOD ( 24.74 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: coresight@lists.linaro.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, mike.leach@linaro.org 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 On Wed, Oct 28, 2020 at 10:09:27PM +0000, Suzuki K Poulose wrote: > Prepare the TPIU driver to make use of the CoreSight device access > abstraction layer. The driver touches the device even before the > coresight device is registered. Thus we could be accessing the > devices without a csdev. As we are about to use the abstraction > layer for accessing the device, pass in the access directly > to avoid having to deal with the un-initialised csdev. > > Cc: Mathieu Poirier > Cc: Mike Leach > Signed-off-by: Suzuki K Poulose > --- > drivers/hwtracing/coresight/coresight-tpiu.c | 30 +++++++++----------- > 1 file changed, 13 insertions(+), 17 deletions(-) Reviewed-by: Mathieu Poirier > > diff --git a/drivers/hwtracing/coresight/coresight-tpiu.c b/drivers/hwtracing/coresight/coresight-tpiu.c > index dfa3b91d0281..98c4a029854c 100644 > --- a/drivers/hwtracing/coresight/coresight-tpiu.c > +++ b/drivers/hwtracing/coresight/coresight-tpiu.c > @@ -60,49 +60,45 @@ struct tpiu_drvdata { > struct coresight_device *csdev; > }; > > -static void tpiu_enable_hw(struct tpiu_drvdata *drvdata) > +static void tpiu_enable_hw(struct csdev_access *csa) > { > - CS_UNLOCK(drvdata->base); > + CS_UNLOCK(csa->base); > > /* TODO: fill this up */ > > - CS_LOCK(drvdata->base); > + CS_LOCK(csa->base); > } > > static int tpiu_enable(struct coresight_device *csdev, u32 mode, void *__unused) > { > - struct tpiu_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent); > - > - tpiu_enable_hw(drvdata); > + tpiu_enable_hw(&csdev->access); > atomic_inc(csdev->refcnt); > dev_dbg(&csdev->dev, "TPIU enabled\n"); > return 0; > } > > -static void tpiu_disable_hw(struct tpiu_drvdata *drvdata) > +static void tpiu_disable_hw(struct csdev_access *csa) > { > - CS_UNLOCK(drvdata->base); > + CS_UNLOCK(csa->base); > > /* Clear formatter and stop on flush */ > - writel_relaxed(FFCR_STOP_FI, drvdata->base + TPIU_FFCR); > + csdev_access_relaxed_write32(csa, FFCR_STOP_FI, TPIU_FFCR); > /* Generate manual flush */ > - writel_relaxed(FFCR_STOP_FI | FFCR_FON_MAN, drvdata->base + TPIU_FFCR); > + csdev_access_relaxed_write32(csa, FFCR_STOP_FI | FFCR_FON_MAN, TPIU_FFCR); > /* Wait for flush to complete */ > - coresight_timeout(drvdata->base, TPIU_FFCR, FFCR_FON_MAN_BIT, 0); > + coresight_timeout(csa->base, TPIU_FFCR, FFCR_FON_MAN_BIT, 0); > /* Wait for formatter to stop */ > - coresight_timeout(drvdata->base, TPIU_FFSR, FFSR_FT_STOPPED_BIT, 1); > + coresight_timeout(csa->base, TPIU_FFSR, FFSR_FT_STOPPED_BIT, 1); > > - CS_LOCK(drvdata->base); > + CS_LOCK(csa->base); > } > > static int tpiu_disable(struct coresight_device *csdev) > { > - struct tpiu_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent); > - > if (atomic_dec_return(csdev->refcnt)) > return -EBUSY; > > - tpiu_disable_hw(drvdata); > + tpiu_disable_hw(&csdev->access); > > dev_dbg(&csdev->dev, "TPIU disabled\n"); > return 0; > @@ -152,7 +148,7 @@ static int tpiu_probe(struct amba_device *adev, const struct amba_id *id) > desc.access = CSDEV_ACCESS_IOMEM(base); > > /* Disable tpiu to support older devices */ > - tpiu_disable_hw(drvdata); > + tpiu_disable_hw(&desc.access); > > pdata = coresight_get_platform_data(dev); > if (IS_ERR(pdata)) > -- > 2.24.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel