From patchwork Mon Aug 7 12:22:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yicong Yang X-Patchwork-Id: 13344079 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3C864EB64DD for ; Mon, 7 Aug 2023 12:25:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=VNYrcSEXJV4MkBm//BhwOuRVg7i+dh78jM3yjw5HIAQ=; b=BjVgfMNv3lUSAQ jPKtdsZ7tO7XQjFfVlGQ4/vQWmeTmdskt0KSfP1XkB/5JJH7AXwX/btexlpuzr38ZVMJtldKxRstT RKIJjSEp67ahhQlxw1OAufeTHE+pQ/7ZxUKx+sxdFocS4uJr142ujd8uJreXOALd4Fy8kvN9pgRfy kxn8DrXKOI28Ub3osA1Ft/LYZXzmjCC+ksqOS5DH2J4ijpB1ce3JVUyfbikAPWKPTOA1xgIPZxuAG ho5Tl3k92EJkvZFWcJJH6z5N5MWjWJpfhHfGGrISgQLr+9qXEYCRvsoHfYHdKJgFsPLfuzWDwqcHs KMswYbXVoju8xQ7vjoVQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qSzIE-00HC0d-2J; Mon, 07 Aug 2023 12:25:02 +0000 Received: from szxga01-in.huawei.com ([45.249.212.187]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qSzIC-00HBun-1I for linux-arm-kernel@lists.infradead.org; Mon, 07 Aug 2023 12:25:01 +0000 Received: from canpemm500009.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4RKFpw280wzfbnT; Mon, 7 Aug 2023 20:23:36 +0800 (CST) Received: from localhost.localdomain (10.50.163.32) by canpemm500009.china.huawei.com (7.192.105.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Mon, 7 Aug 2023 20:24:45 +0800 From: Yicong Yang To: , , , CC: , , Subject: [PATCH] perf/smmuv3: Add platform id table for module auto loading Date: Mon, 7 Aug 2023 20:22:33 +0800 Message-ID: <20230807122233.28563-1-yangyicong@huawei.com> X-Mailer: git-send-email 2.31.0 MIME-Version: 1.0 X-Originating-IP: [10.50.163.32] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To canpemm500009.china.huawei.com (7.192.105.203) X-CFilter-Loop: Reflected X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230807_052500_650779_DF38E3B0 X-CRM114-Status: GOOD ( 11.42 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Yicong Yang On ACPI based system the device is probed by the name directly. If the driver is configured as module it can only be loaded manually. Add the platform id table as well as the module alias then the driver will be loaded automatically by the udev or others once the device added. Signed-off-by: Yicong Yang --- drivers/perf/arm_smmuv3_pmu.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/perf/arm_smmuv3_pmu.c b/drivers/perf/arm_smmuv3_pmu.c index 25a269d431e4..f27c5f585524 100644 --- a/drivers/perf/arm_smmuv3_pmu.c +++ b/drivers/perf/arm_smmuv3_pmu.c @@ -946,7 +946,14 @@ static const struct of_device_id smmu_pmu_of_match[] = { MODULE_DEVICE_TABLE(of, smmu_pmu_of_match); #endif +static const struct platform_device_id smmu_pmu_platform_match[] = { + { "arm-smmu-v3-pmcg", 0 }, + {} +}; +MODULE_DEVICE_TABLE(platform, smmu_pmu_platform_match); + static struct platform_driver smmu_pmu_driver = { + .id_table = smmu_pmu_platform_match, .driver = { .name = "arm-smmu-v3-pmcg", .of_match_table = of_match_ptr(smmu_pmu_of_match),