Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp440285lqs; Tue, 5 Mar 2024 06:36:48 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVsje7lJuNQRK2UGxa5U2lzT8oQ7BFW5JP/1Bg8hl9J1uQAiiuUT0BBSaALdJGBDqK1ytmtAbXB14zQnkNTbBAtUd1CNbku4FRg2vyGyA== X-Google-Smtp-Source: AGHT+IG/GJoYIcqYmlqRTpblqwtA6F4BpErOm++Fb0c5rdKJa6TuOM9d7LW4VEx9qD6kCdHRJTkP X-Received: by 2002:a05:6870:6128:b0:220:be17:9697 with SMTP id s40-20020a056870612800b00220be179697mr2170736oae.13.1709649408412; Tue, 05 Mar 2024 06:36:48 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709649408; cv=pass; d=google.com; s=arc-20160816; b=c822ePLZbj6AbbYlEbsh7JrGx3RuDsAqLq7u9oC+RT3KI59qvJhH1FYt2HEAysWkbL dwupgVIa2qpKbbgYlujibFrm1coM1lVbUI3irc1/tlJbHMfjC1ldk6VXnXTfCoznt6EW +bJGbRuC+lE+AzOFQ568UJMzId4TAyennTMC2DSKKkiSrxKgDonW3kc3HS952QwCBdyT 0rh/3HfsfA1CCrR10ctXIxyr5VQyrCrR00lTcEciIj3Aa1Ed04e1Q2O4pexoORK+9BwN 82StRyLIuRsMA1FA1ZG+hzU6Opje9mHgvHD6LTb7RnDEn607+sz8F6aCnfGKeioxGlXG JucA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id; bh=piVYZqRaIX0fdEc5/ru9UhQdZFC6FzbAN06+FRehANs=; fh=g2mEPVNxzd4a8oqHwT5hvHcTRdYlBGiX5Db6k3wbU0U=; b=XnsZZOeM2AL24Aq1j8JvHL30/O91E8vhbCwgZbjwllnqc8toQr/bgeMoadvXzphQNi 2ZXWN+K4/Ecz5OeHBOLAZdrNvZMKMJUTaWNxbpoi/TNosmEm7g7RhajiKoTVYnt7cEra KInHhhH1dLVeTePBjsWqvQaTKjJKJ/19QT+qsdYeDpsLYJ688tYNhxxG3PaVSnu+BYjQ q6V0Xh5/aWRaxSUCVpRKycx5ksq8Dqt/TNdpAu2bdjkcAyRSZzjkZmA+5Jf/8BusfTkh syiHXp/BRWpgWozeQFJlBXIcqprntvOTsVryb3yb/Thn1kz38bbk9JrTRKNBlftmIY94 MJnA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-92519-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-92519-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id qm1-20020a056214568100b0068f761b112esi12380518qvb.357.2024.03.05.06.36.48 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Mar 2024 06:36:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-92519-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=arm.com dmarc=pass fromdomain=arm.com); spf=pass (google.com: domain of linux-kernel+bounces-92519-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-92519-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id E261A1C21507 for ; Tue, 5 Mar 2024 14:36:47 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 658CC8665D; Tue, 5 Mar 2024 14:36:41 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4ECE737145; Tue, 5 Mar 2024 14:36:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.140.110.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709649400; cv=none; b=QiVvfgyCfCFkpFu+3njrf+BLOA44jpQhGgY31UlOFDnS941AwNZBGp3k1SF1IK7E5axN8mlDqdt2VH2qsqozKgimsPDDwiEqmXiWu7auCmbdzZaXowIdevLPXGaJP4VY6RjMdG5N8ebg7mkmooV7fs8s8XabjDHYGFMseGM5seU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709649400; c=relaxed/simple; bh=jT7+/bVUnT1ftVesYJZdiibrGkpzwQBiEa8HWicdv0I=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=M4GS54Ay30uzolXtaGU0rOQutdpWprYAl+3KVs5V1d2EPvgzZe3RxAYKWGEepmTcVFZy3ReOWcS8J5DtoX/XzjX74iWbTRD+plHYHZnH+P6U15RMHZdRXlGioj1NwN3AX00doGWyK0YTsxqgDhBoTdSN//1wgJ8LCAVYWPStiTo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com; spf=pass smtp.mailfrom=arm.com; arc=none smtp.client-ip=217.140.110.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arm.com 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 F22AC1FB; Tue, 5 Mar 2024 06:37:13 -0800 (PST) Received: from [10.1.197.1] (ewhatever.cambridge.arm.com [10.1.197.1]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 2177B3F73F; Tue, 5 Mar 2024 06:36:34 -0800 (PST) Message-ID: <921173d2-c996-4a0f-b3a5-b660036fa254@arm.com> Date: Tue, 5 Mar 2024 14:36:33 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH V5 03/11] coresight: tmc: Extract device properties from AMBA pid based table lookup Content-Language: en-US To: Anshuman Khandual , linux-arm-kernel@lists.infradead.org Cc: Lorenzo Pieralisi , Sudeep Holla , Mike Leach , James Clark , Maxime Coquelin , Alexandre Torgue , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, coresight@lists.linaro.org, linux-stm32@st-md-mailman.stormreply.com References: <20240222082142.3663983-1-anshuman.khandual@arm.com> <20240222082142.3663983-4-anshuman.khandual@arm.com> From: Suzuki K Poulose In-Reply-To: <20240222082142.3663983-4-anshuman.khandual@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 22/02/2024 08:21, Anshuman Khandual wrote: > This extracts device properties from AMBA pid based table lookup. But first > this modifies tmc_etr_setup_caps() to accept csdev access. > > Cc: Suzuki K Poulose > Cc: Mike Leach > Cc: James Clark > Cc: coresight@lists.linaro.org > Cc: linux-arm-kernel@lists.infradead.org > Cc: linux-kernel@vger.kernel.org > Reviewed-by: James Clark minor nit: Since there were significant changes from what James previously reviewed, it is a good idea to drop his Reviewed-by: Otherwise, the changes look good to me. Suzuki > Signed-off-by: Anshuman Khandual > --- > Changes in V5: > > - Modified tmc_etr_setup_caps() to accept struct csdev_access argument > - Reverted back tmc_etr_setup_caps() call site position in tmc_probe() > - Dropped custom mask TMC_AMBA_MASK > > drivers/hwtracing/coresight/coresight-tmc-core.c | 14 ++++++++++---- > 1 file changed, 10 insertions(+), 4 deletions(-) > > diff --git a/drivers/hwtracing/coresight/coresight-tmc-core.c b/drivers/hwtracing/coresight/coresight-tmc-core.c > index 7ec5365e2b64..43874fa4def0 100644 > --- a/drivers/hwtracing/coresight/coresight-tmc-core.c > +++ b/drivers/hwtracing/coresight/coresight-tmc-core.c > @@ -370,16 +370,23 @@ static inline bool tmc_etr_has_non_secure_access(struct tmc_drvdata *drvdata) > return (auth & TMC_AUTH_NSID_MASK) == 0x3; > } > > +static const struct amba_id tmc_ids[]; > + > /* Detect and initialise the capabilities of a TMC ETR */ > -static int tmc_etr_setup_caps(struct device *parent, u32 devid, void *dev_caps) > +static int tmc_etr_setup_caps(struct device *parent, u32 devid, > + struct csdev_access *access) > { > int rc; > - u32 dma_mask = 0; > + u32 tmc_pid, dma_mask = 0; > struct tmc_drvdata *drvdata = dev_get_drvdata(parent); > + void *dev_caps; > > if (!tmc_etr_has_non_secure_access(drvdata)) > return -EACCES; > > + tmc_pid = coresight_get_pid(access); > + dev_caps = coresight_get_uci_data_from_amba(tmc_ids, tmc_pid); > + > /* Set the unadvertised capabilities */ > tmc_etr_init_caps(drvdata, (u32)(unsigned long)dev_caps); > > @@ -497,8 +504,7 @@ static int tmc_probe(struct amba_device *adev, const struct amba_id *id) > desc.type = CORESIGHT_DEV_TYPE_SINK; > desc.subtype.sink_subtype = CORESIGHT_DEV_SUBTYPE_SINK_SYSMEM; > desc.ops = &tmc_etr_cs_ops; > - ret = tmc_etr_setup_caps(dev, devid, > - coresight_get_uci_data(id)); > + ret = tmc_etr_setup_caps(dev, devid, &desc.access); > if (ret) > goto out; > idr_init(&drvdata->idr);