From patchwork Mon Sep 28 16:35:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11804081 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2D3726CB for ; Mon, 28 Sep 2020 16:39:12 +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 B4D1F2080C for ; Mon, 28 Sep 2020 16:39:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="IPDgrkS5"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="wthzh4Pa" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B4D1F2080C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.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-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=nPcs5qK0g8gOQ8Fg422ddcvkkC6JC1i3NRxUuy87W20=; b=IPDgrkS5eeC4lpdPIQszMDUtm uuZI/VdpX81mQC9X0m5ug7Kfftck265oCLtXflCgCH6vMJUJQpSvi9ZPJohTwAPYVXEqRSEC0tsw3 9TdLvHSghCqwUqZti0ApjJnNWgxi454DVj3hIlQ6sLups9YNBjTunLrNAVxi4nLkOpVPQVI/oXv1j 0PG/3piDH6UGiC9Sl4S/RUncqItaAnR46AZhZvWDW7j0TBJR+nRbtbi8B5s3wQ7pDqXj6inabW67I anN4LXpNnutHJA3OwuQNTyKRuF8uC/SCIuEhj1j9giwQV1AjPqB4+DxGtNd2Ru60jOuJWPffvUUWV YBS6qhMsQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kMwAu-0001qy-3s; Mon, 28 Sep 2020 16:38:52 +0000 Received: from mail-pf1-x442.google.com ([2607:f8b0:4864:20::442]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kMw7d-0000a8-SI for linux-arm-kernel@lists.infradead.org; Mon, 28 Sep 2020 16:35:33 +0000 Received: by mail-pf1-x442.google.com with SMTP id k13so1537665pfg.1 for ; Mon, 28 Sep 2020 09:35:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XaJPe7K+ZjHgHfXIN2qEoYr/QyZph8mHXWNbLeRPwdw=; b=wthzh4Pad4X5FxEjptnGzLoiFt/kjnaJISlMrfOG4+cU0QLHDj4oI53F5kzusDUwmv 4RV1Gpx4+IAYC1x4tiXM99rEJUoh/JFQMkdGiNWRIWcC1RYbIunyeGOBz8yex6NCou1f wvmppI2n7plE3FY34fQ5TkD8L3Q9+UQzegByyl8N9uZueTHB3HS4rSiuc1vJLLCW9sCr Re+UytA4k2pB62HyLVEFSwJFu2By8B2r8AD4uMqiWTzJVZ879PCD4qVakWK4F2zffR/i r0P/pz7HIR0KcfQ9u+pPV3fvm+qxXW6BvVuz6z3jE4WY2e4tOJy/0657j5XFUVgDhT6h Tg6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=XaJPe7K+ZjHgHfXIN2qEoYr/QyZph8mHXWNbLeRPwdw=; b=iXVjygqP4T263L5IyiNjwHGbdN2Xyn/cy7P3+SJK/MsHxSo3IgEFGcp1K/EVVqj0nY sJ1jNflFd1M2ZMz2abEZxY3m7KklMmPp7q5i6bc8UhRS6M81XFU4JszTk0X0S6VVurc5 pbiea2W2NxMd3EllnicDR+lx23bqLUhrqkK7ohkM0zQNOHj9HUWgUN8yFexjMMAYdiuU r94pCnnOE5XbotbkJx3TiP1EUi7BrTQPpF+h45AaHmg1blD1EvT85o3lri3QMkeJ3sHV QVYgWhcqzPDunthcoqb/kUROqyajMJ8GmW4/D4efBE9CZFoB6qhl64wge8GaiR40RCeF 3O0Q== X-Gm-Message-State: AOAM532vIT/I5qfNzsd+ZjibT8BQRHgmPRi6NsNr5+GjAsVvSFXXyzvT bPvWr4GGgBhKZi95P4Fo/JuCug== X-Google-Smtp-Source: ABdhPJz/QrA7wRRqiwNKrbNLcc+XS4F92IDbxzxfrd+pLXb0loh+r/vzqzVXnakXoDlRdQ0NDSuIQA== X-Received: by 2002:a17:902:7e0d:b029:d2:8ceb:ea4b with SMTP id b13-20020a1709027e0db02900d28cebea4bmr303249plm.59.1601310927714; Mon, 28 Sep 2020 09:35:27 -0700 (PDT) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id f19sm2345640pfd.45.2020.09.28.09.35.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Sep 2020 09:35:27 -0700 (PDT) From: Mathieu Poirier To: gregkh@linuxfoundation.org Subject: [PATCH 12/25] coresight: tpiu: Allow tpiu to be built as a module Date: Mon, 28 Sep 2020 10:35:00 -0600 Message-Id: <20200928163513.70169-13-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200928163513.70169-1-mathieu.poirier@linaro.org> References: <20200928163513.70169-1-mathieu.poirier@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200928_123529_958511_80293C96 X-CRM114-Status: GOOD ( 20.49 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:442 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 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: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Kim Phillips Allow to build coresight-tpiu as a module, for ease of development. - Kconfig becomes a tristate, to allow =m - add a tpiu_remove function, for module unload - add a MODULE_DEVICE_TABLE for autoloading on boot Cc: Mathieu Poirier Cc: Leo Yan Cc: Alexander Shishkin Cc: Randy Dunlap Cc: Suzuki K Poulose Cc: Greg Kroah-Hartman Cc: Russell King Signed-off-by: Kim Phillips Signed-off-by: Tingwei Zhang Reviewed-by: Mike Leach Reviewed-by: Suzuki K Poulose Signed-off-by: Mathieu Poirier --- drivers/hwtracing/coresight/Kconfig | 5 ++++- drivers/hwtracing/coresight/coresight-tpiu.c | 20 +++++++++++++++++++- 2 files changed, 23 insertions(+), 2 deletions(-) diff --git a/drivers/hwtracing/coresight/Kconfig b/drivers/hwtracing/coresight/Kconfig index 996d84a1edb8..8fd9887fb03b 100644 --- a/drivers/hwtracing/coresight/Kconfig +++ b/drivers/hwtracing/coresight/Kconfig @@ -46,7 +46,7 @@ config CORESIGHT_CATU mode where the address is not translated. config CORESIGHT_SINK_TPIU - bool "Coresight generic TPIU driver" + tristate "Coresight generic TPIU driver" depends on CORESIGHT_LINKS_AND_SINKS help This enables support for the Trace Port Interface Unit driver, @@ -56,6 +56,9 @@ config CORESIGHT_SINK_TPIU connected to an external host for use case capturing more traces than the on-board coresight memory can handle. + To compile this driver as a module, choose M here: the + module will be called coresight-tpiu. + config CORESIGHT_SINK_ETBV10 tristate "Coresight ETBv1.0 driver" depends on CORESIGHT_LINKS_AND_SINKS diff --git a/drivers/hwtracing/coresight/coresight-tpiu.c b/drivers/hwtracing/coresight/coresight-tpiu.c index f8583e4032a6..566c57e03596 100644 --- a/drivers/hwtracing/coresight/coresight-tpiu.c +++ b/drivers/hwtracing/coresight/coresight-tpiu.c @@ -173,6 +173,15 @@ static int tpiu_probe(struct amba_device *adev, const struct amba_id *id) return PTR_ERR(drvdata->csdev); } +static int __exit tpiu_remove(struct amba_device *adev) +{ + struct tpiu_drvdata *drvdata = dev_get_drvdata(&adev->dev); + + coresight_unregister(drvdata->csdev); + + return 0; +} + #ifdef CONFIG_PM static int tpiu_runtime_suspend(struct device *dev) { @@ -216,6 +225,8 @@ static const struct amba_id tpiu_ids[] = { { 0, 0}, }; +MODULE_DEVICE_TABLE(amba, tpiu_ids); + static struct amba_driver tpiu_driver = { .drv = { .name = "coresight-tpiu", @@ -224,6 +235,13 @@ static struct amba_driver tpiu_driver = { .suppress_bind_attrs = true, }, .probe = tpiu_probe, + .remove = tpiu_remove, .id_table = tpiu_ids, }; -builtin_amba_driver(tpiu_driver); + +module_amba_driver(tpiu_driver); + +MODULE_AUTHOR("Pratik Patel "); +MODULE_AUTHOR("Mathieu Poirier "); +MODULE_DESCRIPTION("Arm CoreSight TPIU (Trace Port Interface Unit) driver"); +MODULE_LICENSE("GPL v2");