Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1269024

Re: [PATCH] clocksource/drivers/tango-xtal: Replace code by clocksource_mmio_init

From Marc Gonzalez <marc_gonzalez@sigmadesigns.com>
Newsgroups linux.kernel
Subject Re: [PATCH] clocksource/drivers/tango-xtal: Replace code by clocksource_mmio_init
Date 2015-11-13 16:40 +0100
Message-ID <quoCd-8cf-15@gated-at.bofh.it> (permalink)
References <qukfh-5kp-33@gated-at.bofh.it> <qulEl-6kY-5@gated-at.bofh.it> <qunmO-7uR-19@gated-at.bofh.it> <qunGa-7Bq-19@gated-at.bofh.it> <quosy-88l-13@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 13/11/2015 16:26, Thomas Gleixner wrote:
> On Fri, 13 Nov 2015, Marc Gonzalez wrote:
>> On 13/11/2015 15:16, Daniel Lezcano wrote:
>>> For example:
>>>
>>> struct clockcommon {
>>> 	u32 mult;
>>> 	u32 shift;
>>> 	int rating;
>>> 	void __iomem *base;
>>> 	char *name;
>>> 	int irq;
>>> };
>>>
>>> struct clocksource {
>>> 	struct clockcommon common; /* MUST be the first field */
>>> 	cycle_t (*read)(struct clocksource *cs);
>>> 	cycle_t mask;
>>> 	...
>>> };
>>
>> According to my notes, commit 369db4c952 grouped hot-path data
>> into a single cache line (hence ____cacheline_aligned).
>>
>> (AFAIR, ARMv7 ARCH_MULTIPLATFORM assumes CACHE_LINE=64)
>>
>> Not sure how to make the two concepts (common base struct and
>> grouping hot data) play nicely, without wasting a lot of space
>> on padding.
> 
> It wont play well. We are not going to change the layout of struct
> clocksource because it will hurt the sane use cases for no reason.

You are referring to Daniel's proposed reorg, right?

What about my proposal? I inserted reg after maxadj, but it may be
inserted anywhere in the struct.


diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
index 278dd279a7a8..03807ca0d54e 100644
--- a/include/linux/clocksource.h
+++ b/include/linux/clocksource.h
@@ -74,6 +74,9 @@ struct clocksource {
 	u32 shift;
 	u64 max_idle_ns;
 	u32 maxadj;
+#ifdef CONFIG_CLKSRC_MMIO
+	void __iomem *reg;
+#endif
 #ifdef CONFIG_ARCH_CLOCKSOURCE_DATA
 	struct arch_clocksource_data archdata;
 #endif

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] clocksource/drivers/tango-xtal: Replace code by clocksource_mmio_init Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-11-13 12:00 +0100
  Re: [PATCH] clocksource/drivers/tango-xtal: Replace code by  clocksource_mmio_init Marc Gonzalez <marc_gonzalez@sigmadesigns.com> - 2015-11-13 13:30 +0100
    Re: [PATCH] clocksource/drivers/tango-xtal: Replace code by  clocksource_mmio_init Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-11-13 15:20 +0100
      Re: [PATCH] clocksource/drivers/tango-xtal: Replace code by  clocksource_mmio_init Marc Gonzalez <marc_gonzalez@sigmadesigns.com> - 2015-11-13 15:40 +0100
        Re: [PATCH] clocksource/drivers/tango-xtal: Replace code by  clocksource_mmio_init Thomas Gleixner <tglx@linutronix.de> - 2015-11-13 16:30 +0100
          Re: [PATCH] clocksource/drivers/tango-xtal: Replace code by  clocksource_mmio_init Marc Gonzalez <marc_gonzalez@sigmadesigns.com> - 2015-11-13 16:40 +0100
  Re: [PATCH] clocksource/drivers/tango-xtal: Replace code by  clocksource_mmio_init Marc Gonzalez <marc_gonzalez@sigmadesigns.com> - 2015-11-13 14:40 +0100
    Re: [PATCH] clocksource/drivers/tango-xtal: Replace code by  clocksource_mmio_init Daniel Lezcano <daniel.lezcano@linaro.org> - 2015-11-13 15:20 +0100

csiph-web