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=-12.7 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=ham 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 A8F5AC43463 for ; Fri, 18 Sep 2020 15:36:01 +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 3D09920848 for ; Fri, 18 Sep 2020 15:36:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="VhsD2uVA"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="EjSjgVt2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3D09920848 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:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ok0IExnFU0zeNddgDkDfshHdLxSqCHktmgBTnu9YIi0=; b=VhsD2uVA+4QBQWIzH/vIqv0Q9 h91qxsH6iYlAOHbt6FtkRqb+bHw0nYetjPObqDX5/lm2E3kRS7MoxRNywXwtUY8khdyC9wl5T5eDH auuNRJN8XEuSbGFyztln/yFqjdMZpRAp8NibLe6fQkoNDSKZ6WZ/53ai1FhblDp8Ng5SWtDgA7X2l 4uH5sBtlhf102QfQQpaebyBWhFWQtD69K9hvoVLZnNkMtXnTJlOFiT1URohNI50jFTt0LP9htZjWs ww346y23e05mBNrwmV28fBQ8Fda8QMs12H29JaBAYSQutjWeSFFCqdC8pysIgX2ccYOudDkz51qQX 2x8cUGGZA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kJIOx-00058U-TL; Fri, 18 Sep 2020 15:34:19 +0000 Received: from mail-ed1-x544.google.com ([2a00:1450:4864:20::544]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kJIOs-00056u-2O for linux-arm-kernel@lists.infradead.org; Fri, 18 Sep 2020 15:34:15 +0000 Received: by mail-ed1-x544.google.com with SMTP id k14so6556719edo.1 for ; Fri, 18 Sep 2020 08:34:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=vYq5g4vOvBIypLQ/mf0zucKFHlaPekzFnhSxvolwDNM=; b=EjSjgVt2IdxInTRE9p2TTwqtLOV9yNAn+pvjJ6QEQanKV/Y9M/lB+QXIXaDMv0FtPd Yj3s9RgXiJwUpjh5S8cAFY68meGJ9lR/zayASnOxQpkdoDCb3TbA9UwCTiIawwZsKMxD ClkQ3QUaq/m7P+v1fGY1ysf8EmI6kmJHZz3OT+x58b4z71EeTHIXDm49Ztsz84KyeNuv vqjH+Z3d6PWR3M/+ou2+mIvAQQPzgjpocVcbyr6umOzhEdr7mXPfqPqLejLfdmXCrDUc i1LFreAbXRWM+ERLYr1UQf7NepIWSbyhZKFfnEGMBldkvkMD6pWBsf2IMlmB4xvbkgfe 4a6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=vYq5g4vOvBIypLQ/mf0zucKFHlaPekzFnhSxvolwDNM=; b=RkM6QevnlVOa0Mek3hgFJ0RrRzjJYZwetG4VzEeuOGFqcvAZYXoXPux8VFHVA5nhGO gEmyhae0PkIXd6XrouFcJFgGvycp+caSGC1ksLvmdDfKzibHBeFQyAUVK+j4sSATTioh K8efWRfz/zsXXfXp1ZlLyqYZ/AuBu3jXb7Fg/rLWfIhhfGMYasAjoOwdaTDgvx/jnqgJ MvPYlR4JAW6VhP/GrLVMb3GOOl/gjE7qWFusntPkFRpav8xtWWuL9QF6evSHY4YwRCe4 WxSDMsvpQ7UmMVvaNmAWTU6uUbvpJv+Eibpah1uUUFrn0eAwpdj0MfBsDj8fTF2VO1IC elSA== X-Gm-Message-State: AOAM533dQvaxwbrzw1CzNJ0+o87ad/DSauQMAAfPbT2UCFHxgjbFs+LZ PY2K4oqj1/3JAa48cQKxd7xQ3XmMuOjpEK2g2PWOHQ== X-Google-Smtp-Source: ABdhPJyuyugn1PMkWQKR3kK+1ouGRbB3LueMxmn1ih2pLtNBFFRcvMJFdnJPO7iaeuyHAA+OedYV/7muFCqE9d3ONwE= X-Received: by 2002:a50:fa81:: with SMTP id w1mr38404267edr.122.1600443252534; Fri, 18 Sep 2020 08:34:12 -0700 (PDT) MIME-Version: 1.0 References: <20200911084119.1080694-1-suzuki.poulose@arm.com> <20200911084119.1080694-3-suzuki.poulose@arm.com> In-Reply-To: <20200911084119.1080694-3-suzuki.poulose@arm.com> From: Mike Leach Date: Fri, 18 Sep 2020 16:34:01 +0100 Message-ID: Subject: Re: [PATCH 02/19] coresight: tpiu: Prepare for using coresight device access abstraction To: Suzuki K Poulose X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200918_113414_178437_660346CC X-CRM114-Status: GOOD ( 22.54 ) 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 ML , Anshuman.Khandual@arm.com, Mathieu Poirier , linux-arm-kernel , Leo Yan 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 Reviewed-by: Mike Leach On Fri, 11 Sep 2020 at 09:41, 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(-) > > diff --git a/drivers/hwtracing/coresight/coresight-tpiu.c b/drivers/hwtracing/coresight/coresight-tpiu.c > index 4eb3f50618b6..cc7d7ed474f5 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 > -- Mike Leach Principal Engineer, ARM Ltd. Manchester Design Centre. UK _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel