From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D0741C433E1 for ; Thu, 13 Aug 2020 20:17:05 +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 9B5CC20791 for ; Thu, 13 Aug 2020 20:17:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="H+LzDbJQ"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="cG8wI8hu" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9B5CC20791 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+linux-arm-kernel=archiver.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:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=5mQC7yoZeMjlSG+9wkw6erX35HiPUzUfAafhI6dJ6V8=; b=H+LzDbJQkCbjd6XWiua9CG9uV FkhjFLcsR7ApxZCDO67G4aZmMsajsbLjoIyxemo7zfav3t0gaJj4qaiggkUkIWJ1vjcaEiPQmRmNM SVFgeZTXjASNxXqE0vK1VSBGUB8qWioEsmKtoV+xTNpx8Z+ekOPE00W8lS/h25XIveYuqmTLhJGYI ku3ilJjGTY3+KanbWue/W8h+TXmVirCRImTv5Qx9gm8Wh0bXHuR89Bo0k/TmyOSQhve5aTimrGDf8 WfrBqevIHX3gCZnxl0AbGEvU3h2g4d76HALxhYxGnMpzCtT4GOHemew76B97kmdROpOVafhltpLTL y3oUJ6buQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k6JdY-0002pi-Nn; Thu, 13 Aug 2020 20:15:44 +0000 Received: from mail-pf1-x443.google.com ([2607:f8b0:4864:20::443]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k6JdU-0002oW-Vy for linux-arm-kernel@lists.infradead.org; Thu, 13 Aug 2020 20:15:43 +0000 Received: by mail-pf1-x443.google.com with SMTP id 17so3378777pfw.9 for ; Thu, 13 Aug 2020 13:15:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=SviMcQr2K45qrelZ4IrZOPAk6JWq4adx3dLttxgZLqQ=; b=cG8wI8huHhK8jtNSnRr+vBkGC2Jwe+YGavje+FiZU9V9mhJCyLCbC3IzIDJPrFUujR WQStWO//OyIYdSp7N1VQz9bU3IXPMOOJKWiPI2pw2Rq4oFPOvEPH6NNHWf/dRuhlTdG1 +uVqWgCAMdNPn3AQ+6ZyCBFf4qIEH3XmAdLE5MrPbq+CP47aPa2bsM7GnoG9Q3oWm/Ci 87Qz3QXZOySwfDZRlaoMW+4/ryYePsNKG6PyF4SWG7LulxkSfPeMYJTGv9X92czkyl0P rdn1R38g/2C1L7SE3encMe5ZFeSYmlySU4drTmwXH6zE3p9gTKpWJAoVIMFYtI/DdTYi ndog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=SviMcQr2K45qrelZ4IrZOPAk6JWq4adx3dLttxgZLqQ=; b=DMZzJXl4d7kf8m0kgXwuz/j7fMbiVKtDK0qZlLVI5jL92ryqx9hy8ZPovLJhRadVxJ eNoAEj3pYjj87kBiN8fKmlAMVW6jjs3IYRQ6Wm2B0n3tiKoqC5uFr/78xEDYol4MpNUj iWx+99odsGWRhrW/lHiKbbYm1o9FNBve/gMAwbju/ubVpotMSptCFQjLl5khufDfDXdG FO+nqSfaTneIZU2FuDzyoreJlN7sn+4g9eSRDiQ01nliBv5/kkgS2Znk8J8BVvZlnJRm bIZbik5msCBnSipH8VMkF+lS+xt8Qaq2c7LfTvZRZ+x+2JhUYR5Bb61teoC0qHY3V0m2 jpYw== X-Gm-Message-State: AOAM530DCBngH2NDXmt0LTt7wy7HM1MFbzVxOP4+eF3sCFRGWSWWu0g5 wYsaovk40UU9D1bEq7MwlRy7NA== X-Google-Smtp-Source: ABdhPJxmGctsG7p7dYIlDaJJpFiX/ZnMoaqk59uuregC8sUY7qrX7gcU5UdvzC1kNs6Xv1Dq6APU7A== X-Received: by 2002:aa7:9301:: with SMTP id 1mr5706825pfj.305.1597349738630; Thu, 13 Aug 2020 13:15:38 -0700 (PDT) Received: from xps15 (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id m16sm5873865pjz.47.2020.08.13.13.15.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Aug 2020 13:15:38 -0700 (PDT) Date: Thu, 13 Aug 2020 14:15:35 -0600 From: Mathieu Poirier To: Tingwei Zhang Subject: Re: [PATCH v8 14/24] coresight: allow funnel driver to be built as module Message-ID: <20200813201535.GK3393195@xps15> References: <20200807111153.7784-1-tingwei@codeaurora.org> <20200807111153.7784-15-tingwei@codeaurora.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200807111153.7784-15-tingwei@codeaurora.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200813_161541_364303_391247A0 X-CRM114-Status: GOOD ( 26.61 ) 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: tsoni@codeaurora.org, Sai Prakash Ranjan , Kim Phillips , Mao Jinlong , Suzuki K Poulose , Alexander Shishkin , Greg Kroah-Hartman , coresight@lists.linaro.org, Randy Dunlap , Mian Yousaf Kaukab , Russell King , Leo Yan , linux-arm-kernel@lists.infradead.org, Mike Leach Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Aug 07, 2020 at 07:11:43PM +0800, Tingwei Zhang wrote: > From: Kim Phillips > > Allow to build coresight-funnel as module, for ease of development. > > - combine static and dynamic funnel init into single > module_init/exit call > - add funnel_remove functions, 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 > Co-developed-by: Mian Yousaf Kaukab > Signed-off-by: Mian Yousaf Kaukab > Signed-off-by: Kim Phillips > Signed-off-by: Tingwei Zhang > Tested-by: Mike Leach > --- > .../hwtracing/coresight/coresight-funnel.c | 62 ++++++++++++++++++- > 1 file changed, 60 insertions(+), 2 deletions(-) > > diff --git a/drivers/hwtracing/coresight/coresight-funnel.c b/drivers/hwtracing/coresight/coresight-funnel.c > index 900690a9f7f0..062694ef9879 100644 > --- a/drivers/hwtracing/coresight/coresight-funnel.c > +++ b/drivers/hwtracing/coresight/coresight-funnel.c > @@ -274,6 +274,15 @@ static int funnel_probe(struct device *dev, struct resource *res) > return ret; > } > > +static int __exit funnel_remove(struct device *dev) > +{ > + struct funnel_drvdata *drvdata = dev_get_drvdata(dev); > + > + coresight_unregister(drvdata->csdev); > + > + return 0; > +} > + > #ifdef CONFIG_PM > static int funnel_runtime_suspend(struct device *dev) > { > @@ -319,20 +328,31 @@ static int static_funnel_probe(struct platform_device *pdev) > return ret; > } > > +static int __exit static_funnel_remove(struct platform_device *pdev) > +{ > + funnel_remove(&pdev->dev); > + pm_runtime_disable(&pdev->dev); > + return 0; > +} > + > static const struct of_device_id static_funnel_match[] = { > {.compatible = "arm,coresight-static-funnel"}, > {} > }; > > +MODULE_DEVICE_TABLE(of, static_funnel_match); > + > #ifdef CONFIG_ACPI > static const struct acpi_device_id static_funnel_ids[] = { > {"ARMHC9FE", 0}, > {}, > }; Add extra line to be consistent with the rest of your patchset. With the that: Reviewed-by: Mathieu Poirier > +MODULE_DEVICE_TABLE(acpi, static_funnel_ids); > #endif > > static struct platform_driver static_funnel_driver = { > .probe = static_funnel_probe, > + .probe = static_funnel_remove, > .driver = { > .name = "coresight-static-funnel", > .of_match_table = static_funnel_match, > @@ -341,7 +361,6 @@ static struct platform_driver static_funnel_driver = { > .suppress_bind_attrs = true, > }, > }; > -builtin_platform_driver(static_funnel_driver); > > static int dynamic_funnel_probe(struct amba_device *adev, > const struct amba_id *id) > @@ -349,6 +368,11 @@ static int dynamic_funnel_probe(struct amba_device *adev, > return funnel_probe(&adev->dev, &adev->res); > } > > +static int __exit dynamic_funnel_remove(struct amba_device *adev) > +{ > + return funnel_remove(&adev->dev); > +} > + > static const struct amba_id dynamic_funnel_ids[] = { > { > .id = 0x000bb908, > @@ -362,6 +386,8 @@ static const struct amba_id dynamic_funnel_ids[] = { > { 0, 0}, > }; > > +MODULE_DEVICE_TABLE(amba, dynamic_funnel_ids); > + > static struct amba_driver dynamic_funnel_driver = { > .drv = { > .name = "coresight-dynamic-funnel", > @@ -370,6 +396,38 @@ static struct amba_driver dynamic_funnel_driver = { > .suppress_bind_attrs = true, > }, > .probe = dynamic_funnel_probe, > + .remove = dynamic_funnel_remove, > .id_table = dynamic_funnel_ids, > }; > -builtin_amba_driver(dynamic_funnel_driver); > + > +static int __init funnel_init(void) > +{ > + int ret; > + > + ret = platform_driver_register(&static_funnel_driver); > + if (ret) { > + pr_info("Error registering platform driver\n"); > + return ret; > + } > + > + ret = amba_driver_register(&dynamic_funnel_driver); > + if (ret) { > + pr_info("Error registering amba driver\n"); > + platform_driver_unregister(&static_funnel_driver); > + } > + > + return ret; > +} > + > +static void __exit funnel_exit(void) > +{ > + platform_driver_unregister(&static_funnel_driver); > + amba_driver_unregister(&dynamic_funnel_driver); > +} > + > +module_init(funnel_init); > +module_exit(funnel_exit); > + > +MODULE_AUTHOR("Mathieu Poirier "); > +MODULE_DESCRIPTION("Arm CoreSight Funnel Driver"); > +MODULE_LICENSE("GPL v2"); > -- > The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, > a Linux Foundation Collaborative Project > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel