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=-6.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no 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 67631C433E0 for ; Fri, 31 Jul 2020 11:33:49 +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 2E48722B40 for ; Fri, 31 Jul 2020 11:33:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="0BX9sS3s" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2E48722B40 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=arm.com 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-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Date:Message-ID:From: References:To:Subject:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=z/oQfbcUni9KGjAsFk0zVb9Z3I7shxHakIJiBk76SCU=; b=0BX9sS3skBmC6HYJHnIXX9NpS HmohtHVovuqDh97cCiqylIIKDSy3OdAPI4IsPyaaHhancaFZ1KlxhJCcXeDEviruQmf4BXJWtNfXr x4fEKtwFaxFu3gszJLaBlf9DhOxuMmLDQW3dIFTGH+c2cb8I4VApqMr91jpnlm1JIF72lhZfgVOZ0 s1dQ/XaUJ3a9tzk1GbDEPnlIjVKl12Fk+Wh4v7thQeqN7N8BeaBrqqPjY7mVm4jdON3PBoHWQNHwt 5iAO4/EF6aHSA8NIJiibQr+ZZDqxW3cKjtLDiWuPvRx/hnXPE3EYgTIhygDtIvn+w5fxxugmupTlj Nq/eCjczA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k1TGt-0006Va-7E; Fri, 31 Jul 2020 11:32:19 +0000 Received: from foss.arm.com ([217.140.110.172]) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k1TGq-0006Uy-HA for linux-arm-kernel@lists.infradead.org; Fri, 31 Jul 2020 11:32:17 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0F6951FB; Fri, 31 Jul 2020 04:32:11 -0700 (PDT) Received: from [10.37.12.83] (unknown [10.37.12.83]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 33C213F71F; Fri, 31 Jul 2020 04:32:09 -0700 (PDT) Subject: Re: [RFC PATCH 03/14] coresight: tpiu: Use coresight device access abstraction To: mathieu.poirier@linaro.org References: <20200722172040.1299289-1-suzuki.poulose@arm.com> <20200722172040.1299289-4-suzuki.poulose@arm.com> <20200729210105.GC3073178@xps15> From: Suzuki K Poulose Message-ID: <02f28b5f-d3d6-755f-066d-88b90aa35eef@arm.com> Date: Fri, 31 Jul 2020 12:36:55 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: <20200729210105.GC3073178@xps15> Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200731_073216_674281_2C1034F9 X-CRM114-Status: GOOD ( 27.41 ) 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 07/29/2020 10:01 PM, Mathieu Poirier wrote: > On Wed, Jul 22, 2020 at 06:20:29PM +0100, Suzuki K Poulose wrote: >> TPIU driver access the device before the coresight device >> is registered. In other words, before the drvdata->csdev >> is valid. Thus, we need to make sure that the csdev_access >> is valid for both the invocations. Switch to using the >> csdev_access directly instead of relying on availability >> of drvdata->csdev. > > I'm not sure all of the above is needed and based on the wording I could easily > see this patch being selected for stable backport, which would be a mistak. > > The gist of this patch is that we are moving to the access abstraction and the > changelog should reflect that. True, I will make it something like : "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. >> >> 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.base = base; > > Any reason for introducing the above in patch 02? I would have done that as > part of this patch... Also part of this patch I would remove drvdata::base > since it is no longer needed. The patch 02 is not touching how the individual drivers access the device, yet. It only sets the way by introducing the layer. As per the proposed change, this is a preparation of the TPIU driver, so that we can convert the generic helper functions ( coresight_timeout()) more easily and keep the patch 05 easier for review (just like the Patch 4, which prepares the ETM driver). Cheers Suzuki > > I'm out of time for today - I will continue tomorrow. > > Regards, > Mathieu > >> >> /* 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