Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp2585835ybg; Fri, 31 Jul 2020 04:35:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxV8p2yu0YBZCYzEzoaR5I5HUIfN46SsoMfWz+BShezy1ZaTjy9h2wE2UnHcfG3nrazovzb X-Received: by 2002:a17:906:95d4:: with SMTP id n20mr3729422ejy.485.1596195338608; Fri, 31 Jul 2020 04:35:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596195338; cv=none; d=google.com; s=arc-20160816; b=C5KeTB8kxCP4aqGUTDjciqBZRs7IvP1VclpmXhYuZbOsvBRaQvz3UNzqj26h3eQ2Ly Wxa8viI4jwYdJd7sef4O7SuzBbw0EAAyBNMITvQETYYnS17g3IRPwWFVO3J2andvsdvL gP3ZXtqk3mfYbaoHl53LVGV221mm6dzF8e6Zz9GaFDfyCGEg2Rxg8MJ7xIOGZOiFiO7R LmZLnlXQjovG5AnD6I1szSE8SBCsT8zJAV3u6ii8yal1/zHayMnLTwpRJ06+6B67Mydv P4cZgnQs0D/eBPk2Lb6bJPNLdJwNykAFvhhj5Xc0rnEtU4/7+SXxi0H1ovJQwY96+XpB rGig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=MyyGz7ALNm3bJoK/iO5FLxfNNAxUhHT9P8TZhRFRzAg=; b=PGQE81pJNjIQSNmyzevThhGNHmICPL4ydKmHDcsnqTxdzH6xcHZuRWo4Cqwkgg+8vx +DyVOuU54qzoFgh8+W1aAT4BIco2hML0AXl22AVjvglYoDg4wKaPAkdz9xboOko01pXC tGd10Y2hLl+5dYqWdfjghejbiNqD7vz8FUkuqUspMC0Wz0PYFFWo8wMifGNh0u0jOKym hGpjnLluKedWPeDou5ehTA/YAPaV4p7SamF9OLa0ak0osBeXAJqmkpf9eJ+7983qkv17 o8tNu3abZxdmQhOVPru0iiViYe8GEQAizcqioO+PDrlkAtNXBwqlbs7tGq+B8sGGQlNB D2uQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gh13si4770229ejb.3.2020.07.31.04.35.14; Fri, 31 Jul 2020 04:35:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732689AbgGaLcM (ORCPT + 99 others); Fri, 31 Jul 2020 07:32:12 -0400 Received: from foss.arm.com ([217.140.110.172]:55506 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732104AbgGaLcL (ORCPT ); Fri, 31 Jul 2020 07:32:11 -0400 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 Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, mike.leach@linaro.org, coresight@lists.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-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 >>