These patches try to improve dw-apb-ictl irqchip driver a bit.
The first patch does a bit clean up work -- unify the register access usage.
The two dw-apb-ictl's irq_chip_type instances have separate mask registers, so the second patch enables IRQ_GC_MASK_CACHE_PER_TYPE.
The last patch adds suspend/resume support to the driver.
Tested on Marvell BG2Q-DMP board.
Jisheng Zhang (3):
irqchip: dw-apb-ictl: always use use {readl|writel}_relaxed
irqchip: dw-apb-ictl: enable IRQ_GC_MASK_CACHE_PER_TYPE
irqchip: dw-apb-ictl: add PM support
drivers/irqchip/irq-dw-apb-ictl.c | 32 ++++++++++++++++++++++++++------
1 file changed, 26 insertions(+), 6 deletions(-)
--
2.1.0
This patch adds in support for S2R for dw-apb-ictl irqchip driver.
Signed-off-by: Jisheng Zhang <redacted>
---
drivers/irqchip/irq-dw-apb-ictl.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
relaxed version and non-relaxed version are mixed, this patch always
use the relaxed version to unify the memory access usage.
Signed-off-by: Jisheng Zhang <redacted>
---
drivers/irqchip/irq-dw-apb-ictl.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
The irq_chip_type instances have separate mask registers, so we need to
enable IRQ_GC_MASK_CACHE_PER_TYPE to actually handle separate mask registers.
Signed-off-by: Jisheng Zhang <redacted>
---
drivers/irqchip/irq-dw-apb-ictl.c | 1 +
1 file changed, 1 insertion(+)
From: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Date: 2014-09-30 12:26:09
On 09/23/2014 08:34 AM, Jisheng Zhang wrote:
relaxed version and non-relaxed version are mixed, this patch always
use the relaxed version to unify the memory access usage.
Signed-off-by: Jisheng Zhang <redacted>
While I don't agree with the above reason (unification) for this
change, I agree with the patch because it _can_ be changed, so
Acked-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
From: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Date: 2014-09-30 12:28:21
On 09/23/2014 08:34 AM, Jisheng Zhang wrote:
The irq_chip_type instances have separate mask registers, so we need to
enable IRQ_GC_MASK_CACHE_PER_TYPE to actually handle separate mask registers.
Signed-off-by: Jisheng Zhang <redacted>
Acked-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
From: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Date: 2014-09-30 12:34:06
On 09/23/2014 08:35 AM, Jisheng Zhang wrote:
quoted hunk
This patch adds in support for S2R for dw-apb-ictl irqchip driver.
Signed-off-by: Jisheng Zhang <redacted>
---
drivers/irqchip/irq-dw-apb-ictl.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
I agree with the overall change, but may this also be suited for a
generic irq_chip helper instead of being a driver specific one?
Maybe Thomas or Jason can comment on this.
Also, now that you are using writel_relaxed, I understand that both
writes above can happen in any order? Are there any implication we
have to consider, i.e. do we require any of the registers above to
be written first?
Sebastian
From: Thomas Gleixner <hidden> Date: 2014-09-30 21:50:50
On Tue, 30 Sep 2014, Sebastian Hesselbarth wrote:
On 09/23/2014 08:34 AM, Jisheng Zhang wrote:
quoted
relaxed version and non-relaxed version are mixed, this patch always
use the relaxed version to unify the memory access usage.
Signed-off-by: Jisheng Zhang <redacted>
While I don't agree with the above reason (unification) for this
Then we want a proper changelog for it, really.
Thanks,
tglx
From: Thomas Gleixner <hidden> Date: 2014-09-30 21:53:06
On Tue, 30 Sep 2014, Sebastian Hesselbarth wrote:
On 09/23/2014 08:35 AM, Jisheng Zhang wrote:
quoted
This patch adds in support for S2R for dw-apb-ictl irqchip driver.
Signed-off-by: Jisheng Zhang <redacted>
---
drivers/irqchip/irq-dw-apb-ictl.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/drivers/irqchip/irq-dw-apb-ictl.c
b/drivers/irqchip/irq-dw-apb-ictl.c
index c136b67..53bb732 100644
I agree with the overall change, but may this also be suited for a
generic irq_chip helper instead of being a driver specific one?
Maybe Thomas or Jason can comment on this.
If we have enough similar resume callbacks, yes.
Also, now that you are using writel_relaxed, I understand that both
writes above can happen in any order? Are there any implication we
have to consider, i.e. do we require any of the registers above to
be written first?
Hi Thomas, Sebastian,
On Tue, 30 Sep 2014 14:52:54 -0700
Thomas Gleixner [off-list ref] wrote:
On Tue, 30 Sep 2014, Sebastian Hesselbarth wrote:
quoted
On 09/23/2014 08:35 AM, Jisheng Zhang wrote:
quoted
This patch adds in support for S2R for dw-apb-ictl irqchip driver.
Signed-off-by: Jisheng Zhang <redacted>
---
drivers/irqchip/irq-dw-apb-ictl.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/drivers/irqchip/irq-dw-apb-ictl.c
b/drivers/irqchip/irq-dw-apb-ictl.c
index c136b67..53bb732 100644
I agree with the overall change, but may this also be suited for a
generic irq_chip helper instead of being a driver specific one?
Maybe Thomas or Jason can comment on this.
If we have enough similar resume callbacks, yes.
quoted
Also, now that you are using writel_relaxed, I understand that both
writes above can happen in any order? Are there any implication we
have to consider, i.e. do we require any of the registers above to
be written first?
The registers sits at device type memory, the writes should happen in the same
order as before.
Thanks for reviewing,
Jisheng
From: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Date: 2014-10-08 11:44:56
On 10/08/2014 01:31 PM, Jisheng Zhang wrote:
Hi Thomas, Sebastian,
On Tue, 30 Sep 2014 14:52:54 -0700
Thomas Gleixner [off-list ref] wrote:
quoted
On Tue, 30 Sep 2014, Sebastian Hesselbarth wrote:
quoted
On 09/23/2014 08:35 AM, Jisheng Zhang wrote:
quoted
This patch adds in support for S2R for dw-apb-ictl irqchip driver.
Signed-off-by: Jisheng Zhang <redacted>
---
drivers/irqchip/irq-dw-apb-ictl.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/drivers/irqchip/irq-dw-apb-ictl.c
b/drivers/irqchip/irq-dw-apb-ictl.c
index c136b67..53bb732 100644
I agree with the overall change, but may this also be suited for a
generic irq_chip helper instead of being a driver specific one?
Maybe Thomas or Jason can comment on this.
If we have enough similar resume callbacks, yes.
quoted
Also, now that you are using writel_relaxed, I understand that both
writes above can happen in any order? Are there any implication we
have to consider, i.e. do we require any of the registers above to
be written first?
The registers sits at device type memory, the writes should happen in the same
order as before.
Jisheng,
it is not about the location of the register but, as far as I
understand, when using {readl,writel}_relaxed the compiler is
free to reorder the calls. So, if there is a strict order we
want to ensure, we have to use non-relaxed {readl,writel}.
The performance penalty of non-relaxed calls can be ignored anyway
as it is done only once after resume.
Sebastian
Hi Sebastian,
On Wed, 8 Oct 2014 04:44:49 -0700
Sebastian Hesselbarth [off-list ref] wrote:
On 10/08/2014 01:31 PM, Jisheng Zhang wrote:
quoted
Hi Thomas, Sebastian,
On Tue, 30 Sep 2014 14:52:54 -0700
Thomas Gleixner [off-list ref] wrote:
quoted
On Tue, 30 Sep 2014, Sebastian Hesselbarth wrote:
quoted
On 09/23/2014 08:35 AM, Jisheng Zhang wrote:
quoted
This patch adds in support for S2R for dw-apb-ictl irqchip driver.
Signed-off-by: Jisheng Zhang <redacted>
---
drivers/irqchip/irq-dw-apb-ictl.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/drivers/irqchip/irq-dw-apb-ictl.c
b/drivers/irqchip/irq-dw-apb-ictl.c
index c136b67..53bb732 100644
I agree with the overall change, but may this also be suited for a
generic irq_chip helper instead of being a driver specific one?
Maybe Thomas or Jason can comment on this.
If we have enough similar resume callbacks, yes.
quoted
Also, now that you are using writel_relaxed, I understand that both
writes above can happen in any order? Are there any implication we
have to consider, i.e. do we require any of the registers above to
be written first?
The registers sits at device type memory, the writes should happen in the
same order as before.
Jisheng,
it is not about the location of the register but, as far as I
understand, when using {readl,writel}_relaxed the compiler is
free to reorder the calls. So, if there is a strict order we
The "volatile" in readl/writel relaxed implementations should prevent the
compiler to do reorder. Or I misunderstand something?
Thanks,
Jisheng
want to ensure, we have to use non-relaxed {readl,writel}.
The performance penalty of non-relaxed calls can be ignored anyway
as it is done only once after resume.
Sebastian
Hi Sebastian,
On Wed, 8 Oct 2014 04:50:53 -0700
Jisheng Zhang [off-list ref] wrote:
Hi Sebastian,
On Wed, 8 Oct 2014 04:44:49 -0700
Sebastian Hesselbarth [off-list ref] wrote:
quoted
On 10/08/2014 01:31 PM, Jisheng Zhang wrote:
quoted
Hi Thomas, Sebastian,
On Tue, 30 Sep 2014 14:52:54 -0700
Thomas Gleixner [off-list ref] wrote:
quoted
On Tue, 30 Sep 2014, Sebastian Hesselbarth wrote:
quoted
On 09/23/2014 08:35 AM, Jisheng Zhang wrote:
quoted
This patch adds in support for S2R for dw-apb-ictl irqchip driver.
Signed-off-by: Jisheng Zhang <redacted>
---
drivers/irqchip/irq-dw-apb-ictl.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/drivers/irqchip/irq-dw-apb-ictl.c
b/drivers/irqchip/irq-dw-apb-ictl.c
index c136b67..53bb732 100644
I agree with the overall change, but may this also be suited for a
generic irq_chip helper instead of being a driver specific one?
Maybe Thomas or Jason can comment on this.
If we have enough similar resume callbacks, yes.
quoted
Also, now that you are using writel_relaxed, I understand that both
writes above can happen in any order? Are there any implication we
have to consider, i.e. do we require any of the registers above to
be written first?
The registers sits at device type memory, the writes should happen in
the same order as before.
Jisheng,
it is not about the location of the register but, as far as I
understand, when using {readl,writel}_relaxed the compiler is
free to reorder the calls. So, if there is a strict order we
The "volatile" in readl/writel relaxed implementations should prevent the
compiler to do reorder. Or I misunderstand something?
My understanding is that the relaxed version imply compiler barriers.
I'm not sure I understand the real/writel relaxed implementations correctly. But
one obvious example which shows the relaxed version won't have the compiler
reorder issue is drivers/irqchip/irq-gic.c, all the configurations must be done
before enable the GIC which is done by "writel_relaxed(1, cpu_base + GIC_CPU_CTRL);"
However, we didn't see any explicit compiler barriers.
Thanks,
Jisheng
Thanks,
Jisheng
quoted
want to ensure, we have to use non-relaxed {readl,writel}.
The performance penalty of non-relaxed calls can be ignored anyway
as it is done only once after resume.
Sebastian
From: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Date: 2014-10-08 18:19:58
On 10/08/2014 01:58 PM, Jisheng Zhang wrote:
Hi Sebastian,
On Wed, 8 Oct 2014 04:50:53 -0700
Jisheng Zhang [off-list ref] wrote:
quoted
Hi Sebastian,
On Wed, 8 Oct 2014 04:44:49 -0700
Sebastian Hesselbarth [off-list ref] wrote:
quoted
On 10/08/2014 01:31 PM, Jisheng Zhang wrote:
quoted
Hi Thomas, Sebastian,
On Tue, 30 Sep 2014 14:52:54 -0700
Thomas Gleixner [off-list ref] wrote:
quoted
On Tue, 30 Sep 2014, Sebastian Hesselbarth wrote:
quoted
On 09/23/2014 08:35 AM, Jisheng Zhang wrote:
quoted
This patch adds in support for S2R for dw-apb-ictl irqchip driver.
Signed-off-by: Jisheng Zhang <redacted>
---
drivers/irqchip/irq-dw-apb-ictl.c | 19 +++++++++++++++++++
1 file changed, 19 insertions(+)
diff --git a/drivers/irqchip/irq-dw-apb-ictl.c
b/drivers/irqchip/irq-dw-apb-ictl.c
index c136b67..53bb732 100644
I agree with the overall change, but may this also be suited for a
generic irq_chip helper instead of being a driver specific one?
Maybe Thomas or Jason can comment on this.
If we have enough similar resume callbacks, yes.
quoted
Also, now that you are using writel_relaxed, I understand that both
writes above can happen in any order? Are there any implication we
have to consider, i.e. do we require any of the registers above to
be written first?
The registers sits at device type memory, the writes should happen in
the same order as before.
it is not about the location of the register but, as far as I
understand, when using {readl,writel}_relaxed the compiler is
free to reorder the calls. So, if there is a strict order we
The "volatile" in readl/writel relaxed implementations should prevent the
compiler to do reorder. Or I misunderstand something?
My understanding is that the relaxed version imply compiler barriers.
I'm not sure I understand the real/writel relaxed implementations correctly. But
one obvious example which shows the relaxed version won't have the compiler
reorder issue is drivers/irqchip/irq-gic.c, all the configurations must be done
before enable the GIC which is done by "writel_relaxed(1, cpu_base + GIC_CPU_CTRL);"
However, we didn't see any explicit compiler barriers.
Dear Thomas, Jason,
Is there any potential issue with this patch serials I need to resolve?
Thanks in advance,
Jisheng
On Mon, 22 Sep 2014 23:34:57 -0700
Jisheng Zhang [off-list ref] wrote:
These patches try to improve dw-apb-ictl irqchip driver a bit.
The first patch does a bit clean up work -- unify the register access usage.
The two dw-apb-ictl's irq_chip_type instances have separate mask registers,
so the second patch enables IRQ_GC_MASK_CACHE_PER_TYPE.
The last patch adds suspend/resume support to the driver.
Tested on Marvell BG2Q-DMP board.
Jisheng Zhang (3):
irqchip: dw-apb-ictl: always use use {readl|writel}_relaxed
irqchip: dw-apb-ictl: enable IRQ_GC_MASK_CACHE_PER_TYPE
irqchip: dw-apb-ictl: add PM support
drivers/irqchip/irq-dw-apb-ictl.c | 32 ++++++++++++++++++++++++++------
1 file changed, 26 insertions(+), 6 deletions(-)
From: Jason Cooper <hidden> Date: 2014-11-11 13:45:55
On Tue, Nov 11, 2014 at 01:59:47PM +0800, Jisheng Zhang wrote:
Dear Thomas, Jason,
Is there any potential issue with this patch serials I need to resolve?
Please send a v2 with Sebastian's Acks. Also, please update the commit
log on #1 as requested. For #3, Please add a summary of the discussion
to its commit log. eg: "We can used relaxed variants here because..."
thx,
Jason.