All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] irqchip/gic: Remove static irq_chip definition for eoimode1
@ 2015-12-21 14:13 Jon Hunter
  2015-12-21 14:13 ` [PATCH 2/2] irqchip/gic: Only populate set_affinity for the root controller Jon Hunter
  0 siblings, 1 reply; 4+ messages in thread
From: Jon Hunter @ 2015-12-21 14:13 UTC (permalink / raw)
  To: Thomas Gleixner, Jason Cooper, Marc Zyngier; +Cc: linux-kernel, Jon Hunter

There are only 3 differences (not including the name) in the definitions
of the gic_chip and gic_eoimode1_chip structures. Instead of statically
defining the gic_eoimode1_chip structure, remove it and populate the
eoimode1 functions dynamically for the appropriate GIC irqchips.

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
---
 drivers/irqchip/irq-gic.c | 26 +++++---------------------
 1 file changed, 5 insertions(+), 21 deletions(-)

diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c
index fcbe0b90870d..94ad60c424a7 100644
--- a/drivers/irqchip/irq-gic.c
+++ b/drivers/irqchip/irq-gic.c
@@ -394,23 +394,6 @@ static struct irq_chip gic_chip = {
 				  IRQCHIP_MASK_ON_SUSPEND,
 };
 
-static struct irq_chip gic_eoimode1_chip = {
-	.name			= "GICv2",
-	.irq_mask		= gic_eoimode1_mask_irq,
-	.irq_unmask		= gic_unmask_irq,
-	.irq_eoi		= gic_eoimode1_eoi_irq,
-	.irq_set_type		= gic_set_type,
-#ifdef CONFIG_SMP
-	.irq_set_affinity	= gic_set_affinity,
-#endif
-	.irq_get_irqchip_state	= gic_irq_get_irqchip_state,
-	.irq_set_irqchip_state	= gic_irq_set_irqchip_state,
-	.irq_set_vcpu_affinity	= gic_irq_set_vcpu_affinity,
-	.flags			= IRQCHIP_SET_TYPE_MASKED |
-				  IRQCHIP_SKIP_SET_WAKE |
-				  IRQCHIP_MASK_ON_SUSPEND,
-};
-
 void __init gic_cascade_irq(unsigned int gic_nr, unsigned int irq)
 {
 	BUG_ON(gic_nr >= CONFIG_ARM_GIC_MAX_NR);
@@ -1030,13 +1013,14 @@ static void __init __gic_init_bases(unsigned int gic_nr, int irq_start,
 	gic_check_cpu_features();
 
 	gic = &gic_data[gic_nr];
+	gic->chip = gic_chip;
+	gic->chip.name = kasprintf(GFP_KERNEL, "GIC-%d", gic_nr);
 
 	/* Initialize irq_chip */
 	if (static_key_true(&supports_deactivate) && gic_nr == 0) {
-		gic->chip = gic_eoimode1_chip;
-	} else {
-		gic->chip = gic_chip;
-		gic->chip.name = kasprintf(GFP_KERNEL, "GIC-%d", gic_nr);
+		gic->chip.irq_mask = gic_eoimode1_mask_irq;
+		gic->chip.irq_eoi = gic_eoimode1_eoi_irq;
+		gic->chip.irq_set_vcpu_affinity = gic_irq_set_vcpu_affinity;
 	}
 
 #ifdef CONFIG_GIC_NON_BANKED
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/2] irqchip/gic: Only populate set_affinity for the root controller
  2015-12-21 14:13 [PATCH 1/2] irqchip/gic: Remove static irq_chip definition for eoimode1 Jon Hunter
@ 2015-12-21 14:13 ` Jon Hunter
  2015-12-22  1:00   ` kbuild test robot
  0 siblings, 1 reply; 4+ messages in thread
From: Jon Hunter @ 2015-12-21 14:13 UTC (permalink / raw)
  To: Thomas Gleixner, Jason Cooper, Marc Zyngier; +Cc: linux-kernel, Jon Hunter

Setting the affinity of an IRQ, it only applicable for the root
interrupt controller and so only populate this operator for the root
controller.

Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
---
 drivers/irqchip/irq-gic.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)

diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c
index 94ad60c424a7..53b03f6038c1 100644
--- a/drivers/irqchip/irq-gic.c
+++ b/drivers/irqchip/irq-gic.c
@@ -384,9 +384,6 @@ static struct irq_chip gic_chip = {
 	.irq_unmask		= gic_unmask_irq,
 	.irq_eoi		= gic_eoi_irq,
 	.irq_set_type		= gic_set_type,
-#ifdef CONFIG_SMP
-	.irq_set_affinity	= gic_set_affinity,
-#endif
 	.irq_get_irqchip_state	= gic_irq_get_irqchip_state,
 	.irq_set_irqchip_state	= gic_irq_set_irqchip_state,
 	.flags			= IRQCHIP_SET_TYPE_MASKED |
@@ -1017,10 +1014,16 @@ static void __init __gic_init_bases(unsigned int gic_nr, int irq_start,
 	gic->chip.name = kasprintf(GFP_KERNEL, "GIC-%d", gic_nr);
 
 	/* Initialize irq_chip */
-	if (static_key_true(&supports_deactivate) && gic_nr == 0) {
-		gic->chip.irq_mask = gic_eoimode1_mask_irq;
-		gic->chip.irq_eoi = gic_eoimode1_eoi_irq;
-		gic->chip.irq_set_vcpu_affinity = gic_irq_set_vcpu_affinity;
+	if (gic_nr == 0) {
+		if (IS_ENABLED(CONFIG_SMP))
+			gic->chip.irq_set_affinity = gic_set_affinity;
+
+		if (static_key_true(&supports_deactivate)) {
+			gic->chip.irq_mask = gic_eoimode1_mask_irq;
+			gic->chip.irq_eoi = gic_eoimode1_eoi_irq;
+			gic->chip.irq_set_vcpu_affinity =
+				gic_irq_set_vcpu_affinity;
+		}
 	}
 
 #ifdef CONFIG_GIC_NON_BANKED
-- 
2.1.4


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] irqchip/gic: Only populate set_affinity for the root controller
  2015-12-21 14:13 ` [PATCH 2/2] irqchip/gic: Only populate set_affinity for the root controller Jon Hunter
@ 2015-12-22  1:00   ` kbuild test robot
  2015-12-22  9:21     ` Jon Hunter
  0 siblings, 1 reply; 4+ messages in thread
From: kbuild test robot @ 2015-12-22  1:00 UTC (permalink / raw)
  To: Jon Hunter
  Cc: kbuild-all, Thomas Gleixner, Jason Cooper, Marc Zyngier,
	linux-kernel, Jon Hunter

[-- Attachment #1: Type: text/plain, Size: 1570 bytes --]

Hi Jon,

[auto build test ERROR on tip/irq/core]
[also build test ERROR on next-20151221]
[cannot apply to v4.4-rc6]

url:    https://github.com/0day-ci/linux/commits/Jon-Hunter/irqchip-gic-Remove-static-irq_chip-definition-for-eoimode1/20151221-221639
config: arm-realview_defconfig (attached as .config)
reproduce:
        wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        make.cross ARCH=arm 

All errors (new ones prefixed by >>):

   drivers/irqchip/irq-gic.c: In function '__gic_init_bases':
>> drivers/irqchip/irq-gic.c:1019:33: error: 'gic_set_affinity' undeclared (first use in this function)
       gic->chip.irq_set_affinity = gic_set_affinity;
                                    ^
   drivers/irqchip/irq-gic.c:1019:33: note: each undeclared identifier is reported only once for each function it appears in

vim +/gic_set_affinity +1019 drivers/irqchip/irq-gic.c

  1013		gic->chip = gic_chip;
  1014		gic->chip.name = kasprintf(GFP_KERNEL, "GIC-%d", gic_nr);
  1015	
  1016		/* Initialize irq_chip */
  1017		if (gic_nr == 0) {
  1018			if (IS_ENABLED(CONFIG_SMP))
> 1019				gic->chip.irq_set_affinity = gic_set_affinity;
  1020	
  1021			if (static_key_true(&supports_deactivate)) {
  1022				gic->chip.irq_mask = gic_eoimode1_mask_irq;

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/octet-stream, Size: 13809 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 2/2] irqchip/gic: Only populate set_affinity for the root controller
  2015-12-22  1:00   ` kbuild test robot
@ 2015-12-22  9:21     ` Jon Hunter
  0 siblings, 0 replies; 4+ messages in thread
From: Jon Hunter @ 2015-12-22  9:21 UTC (permalink / raw)
  To: kbuild test robot
  Cc: kbuild-all, Thomas Gleixner, Jason Cooper, Marc Zyngier, linux-kernel


On 22/12/15 01:00, kbuild test robot wrote:
> Hi Jon,
> 
> [auto build test ERROR on tip/irq/core]
> [also build test ERROR on next-20151221]
> [cannot apply to v4.4-rc6]
> 
> url:    https://github.com/0day-ci/linux/commits/Jon-Hunter/irqchip-gic-Remove-static-irq_chip-definition-for-eoimode1/20151221-221639
> config: arm-realview_defconfig (attached as .config)
> reproduce:
>         wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
>         chmod +x ~/bin/make.cross
>         # save the attached .config to linux build tree
>         make.cross ARCH=arm 
> 
> All errors (new ones prefixed by >>):
> 
>    drivers/irqchip/irq-gic.c: In function '__gic_init_bases':
>>> drivers/irqchip/irq-gic.c:1019:33: error: 'gic_set_affinity' undeclared (first use in this function)
>        gic->chip.irq_set_affinity = gic_set_affinity;
>                                     ^
>    drivers/irqchip/irq-gic.c:1019:33: note: each undeclared identifier is reported only once for each function it appears in
> 
> vim +/gic_set_affinity +1019 drivers/irqchip/irq-gic.c
> 
>   1013		gic->chip = gic_chip;
>   1014		gic->chip.name = kasprintf(GFP_KERNEL, "GIC-%d", gic_nr);
>   1015	
>   1016		/* Initialize irq_chip */
>   1017		if (gic_nr == 0) {
>   1018			if (IS_ENABLED(CONFIG_SMP))
>> 1019				gic->chip.irq_set_affinity = gic_set_affinity;
>   1020	
>   1021			if (static_key_true(&supports_deactivate)) {
>   1022				gic->chip.irq_mask = gic_eoimode1_mask_irq;
> 

Thanks. Yes if CONFIG_SMP is not defined then I see this error. I had
naively assumed that IS_ENABLED() would handle this for me. I will fix this.

Cheers
Jon

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-12-22  9:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-21 14:13 [PATCH 1/2] irqchip/gic: Remove static irq_chip definition for eoimode1 Jon Hunter
2015-12-21 14:13 ` [PATCH 2/2] irqchip/gic: Only populate set_affinity for the root controller Jon Hunter
2015-12-22  1:00   ` kbuild test robot
2015-12-22  9:21     ` Jon Hunter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.