From: Kim Phillips <kim.phillips@arm.com>
To: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Alexander Shishkin <alexander.shishkin@linux.intel.com>,
Alex Williamson <alex.williamson@redhat.com>,
Andrew Morton <akpm@linux-foundation.org>,
David Howells <dhowells@redhat.com>,
Eric Auger <eric.auger@redhat.com>,
Eric Biederman <ebiederm@xmission.com>,
Gargi Sharma <gs051095@gmail.com>,
Geert Uytterhoeven <geert+renesas@glider.be>,
Kefeng Wang <wangkefeng.wang@huawei.com>,
Kirill Tkhai <ktkhai@virtuozzo.com>,
Mike Rapoport <rppt@linux.vnet.ibm.com>,
Oleg Nesterov <oleg@redhat.com>,
Pavel Tatashin <pasha.tatashin@oracle.com>,
Rik van Riel <riel@redhat.com>,
Robin Murphy <robin.murphy@arm.com>,
Russell King <linux@armlinux.org.uk>,
Thierry Reding <treding@nvidia.com>, Todd Kjos <tkjos@google.com>,
Randy Dunlap <rdunlap@infradead.org>,
linux-arm-kernel@lists.infradead.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 6/6] coresight: allow to build as modules
Date: Thu, 24 May 2018 18:49:08 -0500 [thread overview]
Message-ID: <20180524184908.3648cf67456510261a1afe16@arm.com> (raw)
In-Reply-To: <20180522213906.GC25658@xps15>
On Tue, 22 May 2018 15:39:06 -0600
Mathieu Poirier <mathieu.poirier@linaro.org> wrote:
> On Thu, May 17, 2018 at 08:20:24PM -0500, Kim Phillips wrote:
> > Allow to build coresight as modules. This greatly enhances developer
> > efficiency by allowing the development to take place exclusively on the
> > target, and without needing to reboot in between changes.
> >
> > - Kconfig bools become tristates, to allow =m
> >
> > - use -objs to denote merge object directives in Makefile, adds a
> > coresight-core nomenclature for the base module.
> >
> > - Export core functions so as to be able to be used by
> > non-core modules.
> >
> > - add a coresight_exit() that unregisters the coresight bus, add
> > remove fns for most others.
> >
> > - fix up modules with ID tables for autoloading on boot
> >
> > Cc: Mathieu Poirier <mathieu.poirier@linaro.org>
> > Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
> > Cc: Randy Dunlap <rdunlap@infradead.org>
> > Signed-off-by: Kim Phillips <kim.phillips@arm.com>
> > ---
> > drivers/hwtracing/coresight/Kconfig | 48 +++++++++++++++----
> > drivers/hwtracing/coresight/Makefile | 28 +++++++----
> > .../hwtracing/coresight/coresight-cpu-debug.c | 2 +
> > .../coresight/coresight-dynamic-replicator.c | 26 ++++++++--
> > drivers/hwtracing/coresight/coresight-etb10.c | 27 +++++++++--
> > .../hwtracing/coresight/coresight-etm-perf.c | 9 +++-
> > .../coresight/coresight-etm3x-sysfs.c | 1 +
> > drivers/hwtracing/coresight/coresight-etm3x.c | 32 +++++++++++--
> > .../coresight/coresight-etm4x-sysfs.c | 1 +
> > drivers/hwtracing/coresight/coresight-etm4x.c | 33 +++++++++++--
> > .../hwtracing/coresight/coresight-funnel.c | 26 ++++++++--
> > drivers/hwtracing/coresight/coresight-priv.h | 1 -
> > .../coresight/coresight-replicator.c | 28 +++++++++--
> > drivers/hwtracing/coresight/coresight-stm.c | 23 ++++++++-
> > drivers/hwtracing/coresight/coresight-tmc.c | 18 ++++++-
> > drivers/hwtracing/coresight/coresight-tpiu.c | 26 ++++++++--
> > drivers/hwtracing/coresight/coresight.c | 14 ++++++
> > 17 files changed, 299 insertions(+), 44 deletions(-)
>
> For the next revision please split the work based on files.
If I read that literally, one file-by-one would break build
bisectability. Do you mean split by source files depending on the
logical modules they belong to, e.g., etm3x, etm4x, etb10, etc.? If
so, I think it would look like the coresight-core would be first,
followed by the rest, but I also think there are cross-dependencies.
Hmm, OK, I'll have a look, but there's also one more thing: I think
the Makefile obj '-core' nomenclature was to change the name of the
module to not be the same as the core source file, so what do you think
about renaming the core source file instead of the module name? e.g.:
Instead of this:
obj-$(CONFIG_CORESIGHT) += coresight-core.o
coresight-core-objs := coresight.o \
of_coresight.o
we have this:
obj-$(CONFIG_CORESIGHT) += coresight.o
coresight-objs := coresight-core.o \
of_coresight.o
and e.g., instead of this:
obj-$(CONFIG_CORESIGHT_SOURCE_ETM3X) += coresight-etm3x-core.o
coresight-etm3x-core-objs := coresight-etm3x.o \
coresight-etm-cp14.o \
coresight-etm3x-sysfs.o
we have this:
obj-$(CONFIG_CORESIGHT_SOURCE_ETM3X) += coresight-etm3x.o
coresight-etm3x-objs := coresight-etm3x-core.o \
coresight-etm-cp14.o \
coresight-etm3x-sysfs.o
?
> > +static int __exit tmc_remove(struct amba_device *adev)
> > +{
> > + struct tmc_drvdata *drvdata = dev_get_drvdata(&adev->dev);
> > +
> > + /* free ETB/ETF or ETR memory */
> > + tmc_read_unprepare(drvdata);
> > +
> > + misc_deregister(&drvdata->miscdev);
> > + coresight_unregister(drvdata->csdev);
> > +
> > + return 0;
> > +}
> > +
>
> Right now I can remove the module for a TMC link or sink when part of an active
> session, something I pointed out during an earlier revision.
Right, I missed that :(
So would the first thing tmc_remove does is this:
if (drvdata->reading)
return -EBUSY;
work, or would we need to introduce a new sentinel?
> I also think we need to deal with driver removal cases when the TMC buffer
> (ETR or ETF) is being read from sysFS.
OK, I thought the:
struct file_operations tmc_fops = {
.owner = THIS_MODULE,
would prevent module unload whilst sysfs access was being performed,
but I'll double check.
Thanks,
Kim
next prev parent reply other threads:[~2018-05-24 23:49 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-08 19:06 [PATCH 3/4] " Kim Phillips
2018-05-08 19:31 ` Randy Dunlap
2018-05-08 20:37 ` Kim Phillips
2018-05-09 6:01 ` Randy Dunlap
2018-05-16 19:33 ` [PATCH v2 " Kim Phillips
2018-05-17 7:06 ` Greg Kroah-Hartman
2018-05-18 1:20 ` [PATCH 1/6] coresight: remove CORESIGHT_LINKS_AND_SINKS dependencies and selections Kim Phillips
2018-05-18 1:20 ` [PATCH 2/6] coresight: fix CORESIGHT_STM -- STM dependency Kim Phillips
2018-05-18 1:20 ` [PATCH 3/6] coresight: use IS_ENABLED for CONFIGs that may be modules Kim Phillips
2018-05-18 1:20 ` [PATCH 4/6] coresight: move shared barrier_pkt[] to coresight_priv.h Kim Phillips
2018-05-18 1:20 ` [PATCH 5/6] coresight: populate MODULE_AUTHOR, DESCRIPTION, and LICENSEs Kim Phillips
2018-05-22 17:53 ` Mathieu Poirier
2018-05-18 1:20 ` [PATCH 6/6] coresight: allow to build as modules Kim Phillips
2018-05-22 21:39 ` Mathieu Poirier
2018-05-24 23:49 ` Kim Phillips [this message]
2018-05-25 17:21 ` Mathieu Poirier
2018-05-25 17:12 ` Suzuki K Poulose
2018-05-25 17:27 ` Mathieu Poirier
2018-05-22 17:31 ` [PATCH 1/6] coresight: remove CORESIGHT_LINKS_AND_SINKS dependencies and selections Mathieu Poirier
2018-05-23 19:51 ` Kim Phillips
2018-05-24 15:32 ` Mathieu Poirier
2018-05-24 23:30 ` Kim Phillips
2018-05-25 15:27 ` Mathieu Poirier
2018-05-25 18:52 ` Kim Phillips
2018-05-25 19:09 ` Mathieu Poirier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180524184908.3648cf67456510261a1afe16@arm.com \
--to=kim.phillips@arm.com \
--cc=akpm@linux-foundation.org \
--cc=alex.williamson@redhat.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=dhowells@redhat.com \
--cc=ebiederm@xmission.com \
--cc=eric.auger@redhat.com \
--cc=geert+renesas@glider.be \
--cc=gregkh@linuxfoundation.org \
--cc=gs051095@gmail.com \
--cc=ktkhai@virtuozzo.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=mathieu.poirier@linaro.org \
--cc=oleg@redhat.com \
--cc=pasha.tatashin@oracle.com \
--cc=rdunlap@infradead.org \
--cc=riel@redhat.com \
--cc=robin.murphy@arm.com \
--cc=rppt@linux.vnet.ibm.com \
--cc=tkjos@google.com \
--cc=treding@nvidia.com \
--cc=wangkefeng.wang@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®