Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp1424081yba; Thu, 4 Apr 2019 10:25:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqwREAIqwg0RzFVoTzIPIvoOZeeSPKKmJDbhFeU3+WV4AHDqiAcCgzUKRYTJajmB2+LqKLvh X-Received: by 2002:a62:6842:: with SMTP id d63mr7360100pfc.9.1554398741664; Thu, 04 Apr 2019 10:25:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1554398741; cv=none; d=google.com; s=arc-20160816; b=z2QiM8/7M6wEyOkDB3dkNDgyKCvjpQqiqf2ExS8xtynDnPkquj9SrtoiyCGEEs9FZ3 FTXP5tGXE2DxDryMggB9gT9/V1T7iBLfA8xA9YNWvk1N50heaX69c9Z1OIUTWXAiq3ZW ymwc5YVxN8L9/vhsddrbcdYo7ZtyObGSGXYW315AFr43jB+MOoVV/0Q1CAdYCmv+h5JY OmTB3tbJgLc3tVufoEoFKgzjQDx1ixV+yi81tZtMSFxRt0sqeS2H2uMOmsOAuTDaGlGQ HX0lksuwpLW176dc5MPANmDcw8rAD0Np+UMJ8gyWGysw43e5ZhKtFgqSETcl1+o/fpDx m8qg== 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=sOGpCZLLzzbPvN3++GhRU4OmX7OWnWsv4BcZpjNDnoc=; b=oeunBStUPMi73aAZ3V+dyR8TZab0jwzqIwfFJe5cHn9fH2ZbrkEd3iMQRYpouCcd6W niDK+d6hlIrhaSjhexZ+t4hAh5lLxQxx4A7zN3qKXX1UviJQQhqnlioTZq46IFcLdX4c UpXgIFin5lh+XIWywHp3qjX3gOPai9RvFhYKJAy0NCemfR66fSqbaxpJvM+WHmxpOgEV /6IRB4r65+zpSLL3ZUz3HpqF6A4dv9JzmTT8wRbv67IpM0r3FXMmfR4yrmJLisyn7qg7 QW0jjQY7gMO+EiolcbFyTw/+xewgG7kCtgNEHC7QZYAIF3HXg+mbjKcbEj4C5kq3VpO1 lH+Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l13si12630026pgp.54.2019.04.04.10.25.26; Thu, 04 Apr 2019 10:25:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729275AbfDDRYq (ORCPT + 99 others); Thu, 4 Apr 2019 13:24:46 -0400 Received: from foss.arm.com ([217.140.101.70]:36444 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728663AbfDDRYq (ORCPT ); Thu, 4 Apr 2019 13:24:46 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A4292169E; Thu, 4 Apr 2019 10:24:45 -0700 (PDT) Received: from [192.168.100.242] (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id C4B923F557; Thu, 4 Apr 2019 10:24:41 -0700 (PDT) Subject: Re: [PATCH 4/4] perf: arm_spe: Enable ACPI/Platform automatic module loading To: Will Deacon Cc: linux-arm-kernel@lists.infradead.org, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, catalin.marinas@arm.com, rjw@rjwysocki.net, lenb@kernel.org, mark.rutland@arm.com, sudeep.holla@arm.com, james.morse@arm.com, lorenzo.pieralisi@arm.com, linuxarm@huawei.com References: <20190326223938.5365-1-jeremy.linton@arm.com> <20190326223938.5365-5-jeremy.linton@arm.com> <20190404170423.GC28932@fuggles.cambridge.arm.com> From: Jeremy Linton Message-ID: <065cc8ae-f2c0-e493-b0a6-5c7340db37f5@arm.com> Date: Thu, 4 Apr 2019 12:24:38 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <20190404170423.GC28932@fuggles.cambridge.arm.com> 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 Hi, On 4/4/19 12:04 PM, Will Deacon wrote: > On Tue, Mar 26, 2019 at 05:39:38PM -0500, Jeremy Linton wrote: >> Lets add the MODULE_TABLE and platform id_table entries so that >> the SPE driver can attach to the ACPI platform device created by >> the core pmu code. >> >> Signed-off-by: Jeremy Linton >> Reviewed-by: Sudeep Holla >> --- >> drivers/perf/arm_spe_pmu.c | 11 +++++++++-- >> 1 file changed, 9 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/perf/arm_spe_pmu.c b/drivers/perf/arm_spe_pmu.c >> index 7cb766dafe85..ffa2c76c08bb 100644 >> --- a/drivers/perf/arm_spe_pmu.c >> +++ b/drivers/perf/arm_spe_pmu.c >> @@ -1176,7 +1176,13 @@ static const struct of_device_id arm_spe_pmu_of_match[] = { >> }; >> MODULE_DEVICE_TABLE(of, arm_spe_pmu_of_match); >> >> -static int arm_spe_pmu_device_dt_probe(struct platform_device *pdev) >> +static const struct platform_device_id arm_spe_match[] = { >> + { "arm,spe-v1", 0}, > > It would be nice if we could avoid duplicating this string from the ACPI > parsing code. Ok sure, I just need to find a good common place for it. > >> + { } >> +}; >> +MODULE_DEVICE_TABLE(platform, arm_spe_match); >> + >> +static int arm_spe_pmu_device_probe(struct platform_device *pdev) >> { >> int ret; >> struct arm_spe_pmu *spe_pmu; >> @@ -1236,11 +1242,12 @@ static int arm_spe_pmu_device_remove(struct platform_device *pdev) >> } >> >> static struct platform_driver arm_spe_pmu_driver = { >> + .id_table = arm_spe_match, >> .driver = { >> .name = DRVNAME, >> .of_match_table = of_match_ptr(arm_spe_pmu_of_match), > > Hmm, so some other drivers don't hook .id_table like you do, but instead > hook .acpi_match_table in the driver structure. Is that not better? This isn't actually an ACPI device, (aka not defined in the namespace), so its missing much of the ACPI functionality. I think that also means its needs to be declared this way. > > Will >