Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1378699
| From | Suzuki K Poulose <Suzuki.Poulose@arm.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH V2 12/15] coresight: tmc: keep track of memory width |
| Date | 2016-04-14 13:20 +0200 |
| Message-ID | <rnNtw-MQ-21@gated-at.bofh.it> (permalink) |
| References | <rnaLv-2Vr-3@gated-at.bofh.it> <rnaLy-2Vr-45@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 12/04/16 18:54, Mathieu Poirier wrote:
> Accessing the HW configuration register each time the memory
> width is needed simply doesn't make sense. It is much more
> efficient to read the value once and keep a reference for
> later use.
>
> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
> ---
> drivers/hwtracing/coresight/coresight-tmc-etf.c | 8 +++-----
> drivers/hwtracing/coresight/coresight-tmc.c | 1 +
> drivers/hwtracing/coresight/coresight-tmc.h | 2 ++
> 3 files changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/hwtracing/coresight/coresight-tmc-etf.c b/drivers/hwtracing/coresight/coresight-tmc-etf.c
> index 50d32e8ef4ea..a440784e3b27 100644
> --- a/drivers/hwtracing/coresight/coresight-tmc-etf.c
> +++ b/drivers/hwtracing/coresight/coresight-tmc-etf.c
> @@ -41,18 +41,16 @@ void tmc_etb_enable_hw(struct tmc_drvdata *drvdata)
>
> static void tmc_etb_dump_hw(struct tmc_drvdata *drvdata)
> {
> - enum tmc_mem_intf_width memwidth;
> u8 memwords;
> char *bufp;
> u32 read_data;
> int i;
>
> - memwidth = BMVAL(readl_relaxed(drvdata->base + CORESIGHT_DEVID), 8, 10);
> - if (memwidth == TMC_MEM_INTF_WIDTH_32BITS)
> + if (drvdata->memwidth == TMC_MEM_INTF_WIDTH_32BITS)
> memwords = 1;
> - else if (memwidth == TMC_MEM_INTF_WIDTH_64BITS)
> + else if (drvdata->memwidth == TMC_MEM_INTF_WIDTH_64BITS)
> memwords = 2;
> - else if (memwidth == TMC_MEM_INTF_WIDTH_128BITS)
> + else if (drvdata->memwidth == TMC_MEM_INTF_WIDTH_128BITS)
> memwords = 4;
> struct tmc_drvdata {
> @@ -118,6 +119,7 @@ struct tmc_drvdata {
> u32 size;
> local_t mode;
> enum tmc_config_type config_type;
> + enum tmc_mem_intf_width memwidth;
Could we not store the converted memwords here, instead of the enum value here
and convert it every time we access it ?
Cheers
Suzuki
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH V2 00/15] coresight: tmc: make driver usable by Perf Mathieu Poirier <mathieu.poirier@linaro.org> - 2016-04-12 20:00 +0200
[PATCH V2 02/15] coresight: tmc: waiting for TMCReady bit before programming Mathieu Poirier <mathieu.poirier@linaro.org> - 2016-04-12 20:00 +0200
Re: [PATCH V2 02/15] coresight: tmc: waiting for TMCReady bit before programming Suzuki K Poulose <Suzuki.Poulose@arm.com> - 2016-04-14 19:10 +0200
[PATCH V2 15/15] coresight: configuring ETF in FIFO mode when acting as link Mathieu Poirier <mathieu.poirier@linaro.org> - 2016-04-12 20:00 +0200
[PATCH V2 04/15] coresight: tmc: introducing new header file Mathieu Poirier <mathieu.poirier@linaro.org> - 2016-04-12 20:00 +0200
Re: [PATCH V2 04/15] coresight: tmc: introducing new header file Suzuki K Poulose <Suzuki.Poulose@arm.com> - 2016-04-14 19:40 +0200
Re: [PATCH V2 04/15] coresight: tmc: introducing new header file Mathieu Poirier <mathieu.poirier@linaro.org> - 2016-04-15 18:10 +0200
Re: [PATCH V2 04/15] coresight: tmc: introducing new header file Suzuki K Poulose <Suzuki.Poulose@arm.com> - 2016-04-15 18:10 +0200
Re: [PATCH V2 04/15] coresight: tmc: introducing new header file Mathieu Poirier <mathieu.poirier@linaro.org> - 2016-04-15 18:20 +0200
Re: [PATCH V2 04/15] coresight: tmc: introducing new header file Suzuki K Poulose <Suzuki.Poulose@arm.com> - 2016-04-15 18:20 +0200
[PATCH V2 05/15] coresight: tmc: splitting driver in ETB/ETF and ETR components Mathieu Poirier <mathieu.poirier@linaro.org> - 2016-04-12 20:00 +0200
[PATCH V2 08/15] coresight: tmc: getting the right read_count on tmc_open() Mathieu Poirier <mathieu.poirier@linaro.org> - 2016-04-12 20:00 +0200
[PATCH V2 12/15] coresight: tmc: keep track of memory width Mathieu Poirier <mathieu.poirier@linaro.org> - 2016-04-12 20:00 +0200
Re: [PATCH V2 12/15] coresight: tmc: keep track of memory width Suzuki K Poulose <Suzuki.Poulose@arm.com> - 2016-04-14 13:20 +0200
Re: [PATCH V2 12/15] coresight: tmc: keep track of memory width Mathieu Poirier <mathieu.poirier@linaro.org> - 2016-04-15 18:20 +0200
[PATCH V2 13/15] coresight: tmc: implementing TMC-ETF AUX space API Mathieu Poirier <mathieu.poirier@linaro.org> - 2016-04-12 20:00 +0200
csiph-web