From patchwork Mon Sep 28 16:35:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11804105 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 4CCAE139A for ; Mon, 28 Sep 2020 16:44:09 +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 F2234208FE for ; Mon, 28 Sep 2020 16:44:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="kslt5bRE"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Ic0DY+J4" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F2234208FE 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=QH5QPbZMszCQmY6qInyhQgbOWBWa8MEUv500OdiZrN4=; b=kslt5bRERXmS+mE5+58Ggt89f OS6PhhhucR5kPICVoZeS0xXnGHWyIGk3IptzlLOFY+6liKA/JznUREysMvVj/PxcOFKd20QN6HInA /McR7CNT0UJNVaQ2phHdSnDKUZN+K+7SLqBka09VoEosohxvrzhyEFsVVjsJoo6L0lTqHLqHoof1C ppur19yDfQXeSpLjGlJDk/XS51mPq4CHqGRVPRGprCWPAocYl6SyFLOR9qxZIDoZ3W8P8Qk2kD/Xk 1MahF99/4LKPodHQG7AIfDKv97aCn2nRGscFFpA6rzpkO1Q8FP2QLK9zVt5zKYUqjFdmUtLIBjS65 4wugQmd0g==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kMwFW-0004Dt-DV; Mon, 28 Sep 2020 16:43:38 +0000 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kMw7p-0000fj-Ea for linux-arm-kernel@lists.infradead.org; Mon, 28 Sep 2020 16:35:48 +0000 Received: by mail-pf1-x444.google.com with SMTP id d9so1531892pfd.3 for ; Mon, 28 Sep 2020 09:35:41 -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=a5qzpqB7NQwWfYWvXhPMQqYvIW0wXYJS9U1EnLj7ruo=; b=Ic0DY+J4C7T5LjPKaY4f1P+MKDv7vcA8G3ERrgMfjQdQKXKH7gg8XcteDcKNQVkb/w W9VzGFkFHpcqhT89hnbCjFlJz6ItgXaRng6EcxuiHJlSf2zZCRcpel3/YCZe3Rmokcxe 5QibuNLDGU5KGnebELfIs+xwqr6tfHNN1GPHadWuPJmVlMq+JuOE2x5bb7LX4JrzARNV Tr16VNkd6vwoB9pAvfU2/MKN4fmXBjJS0Abu5BCb3RgO7GtAXakSTeb8GFzi5oLqdI+o UAEjC6jnvLYLI0v4eMROP1ejo/1Id5iKjlUBnxFMxY+0tEm0bhPg/FxWBXEtzAjj+wn0 HZog== 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=a5qzpqB7NQwWfYWvXhPMQqYvIW0wXYJS9U1EnLj7ruo=; b=l0ZCq1L+1bPA0BQJXlBKXE0xvbGQBfW2+cT4Dw53ujX0a7DSpMIcotJPS7NMGuG/eV 6ZGcm3KzIcq4yCJYuXPLHfrDDnOx8i13s5/od31Sm9R7LYx/XebCJ4K7e6+FOiNna8zZ VJnM9hVUHlO2hRrTrsP+vgm2bKD20Vo9/7jUfalHoEjzO14uKmldOdHdJ3myATpiS6XI ivQ/dhSvt79S3Q4vXJrYSJPVz2r3wzgvpQ7qQKzCqvuC7QP5vhkBrKkfBm1cWXR2Hy09 MofJpamX2Wx4AmW1o1jGsGq+3FY7VCOBXDSKcQuHaipdr1omRmwVyEq2FZhTMVo8KWpq GVbQ== X-Gm-Message-State: AOAM533My+uGLvqb+aD7RtDH0/wYnbWEVvFRrKdR+y8JBoh7HNBGSYyQ 62LUhIdNw+wovPD041kYAoyTEQ== X-Google-Smtp-Source: ABdhPJyrfmcxHn6Dqmy7WiI9wq+pv73WPhJjs+7K6iNf57RwQrTXeHC+VngefGDNXBEVFF2emPaF1A== X-Received: by 2002:a62:7747:0:b029:13f:d779:5f95 with SMTP id s68-20020a6277470000b029013fd7795f95mr256880pfc.2.1601310939553; Mon, 28 Sep 2020 09:35:39 -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.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Sep 2020 09:35:38 -0700 (PDT) From: Mathieu Poirier To: gregkh@linuxfoundation.org Subject: [PATCH 23/25] coresight: catu: Allow catu drivers to be built as modules Date: Mon, 28 Sep 2020 10:35:11 -0600 Message-Id: <20200928163513.70169-24-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_123541_561682_AC5025BA X-CRM114-Status: GOOD ( 17.00 ) 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:444 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: Tingwei Zhang Allow to build coresight-catu as modules, for ease of development. - Kconfig becomes a tristate, to allow =m - add catu_remove functions, for module unload - add a MODULE_DEVICE_TABLE for autoloading on boot 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-catu.c | 15 +++++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/drivers/hwtracing/coresight/Kconfig b/drivers/hwtracing/coresight/Kconfig index b04aae2ceecc..dfe407cde262 100644 --- a/drivers/hwtracing/coresight/Kconfig +++ b/drivers/hwtracing/coresight/Kconfig @@ -42,7 +42,7 @@ config CORESIGHT_LINK_AND_SINK_TMC module will be called coresight-tmc. config CORESIGHT_CATU - bool "Coresight Address Translation Unit (CATU) driver" + tristate "Coresight Address Translation Unit (CATU) driver" depends on CORESIGHT_LINK_AND_SINK_TMC help Enable support for the Coresight Address Translation Unit (CATU). @@ -52,6 +52,9 @@ config CORESIGHT_CATU by looking up the provided table. CATU can also be used in pass-through mode where the address is not translated. + To compile this driver as a module, choose M here: the + module will be called coresight-catu. + config CORESIGHT_SINK_TPIU tristate "Coresight generic TPIU driver" depends on CORESIGHT_LINKS_AND_SINKS diff --git a/drivers/hwtracing/coresight/coresight-catu.c b/drivers/hwtracing/coresight/coresight-catu.c index 47696a7d24a7..99430f6cf5a5 100644 --- a/drivers/hwtracing/coresight/coresight-catu.c +++ b/drivers/hwtracing/coresight/coresight-catu.c @@ -567,11 +567,21 @@ static int catu_probe(struct amba_device *adev, const struct amba_id *id) return ret; } +static int __exit catu_remove(struct amba_device *adev) +{ + struct catu_drvdata *drvdata = dev_get_drvdata(&adev->dev); + + coresight_unregister(drvdata->csdev); + return 0; +} + static struct amba_id catu_ids[] = { CS_AMBA_ID(0x000bb9ee), {}, }; +MODULE_DEVICE_TABLE(amba, catu_ids); + static struct amba_driver catu_driver = { .drv = { .name = "coresight-catu", @@ -579,6 +589,7 @@ static struct amba_driver catu_driver = { .suppress_bind_attrs = true, }, .probe = catu_probe, + .remove = catu_remove, .id_table = catu_ids, }; @@ -601,3 +612,7 @@ static void __exit catu_exit(void) module_init(catu_init); module_exit(catu_exit); + +MODULE_AUTHOR("Suzuki K Poulose "); +MODULE_DESCRIPTION("Arm CoreSight Address Translation Unit (CATU) Driver"); +MODULE_LICENSE("GPL v2");