public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Boris Brezillon <boris.brezillon@free-electrons.com>
To: Milo Kim <milo.kim@ti.com>
Cc: <tglx@linutronix.de>, <jason@lakedaemon.net>,
	<marc.zyngier@arm.com>, <alexandre.belloni@free-electrons.com>,
	<ludovic.desroches@atmel.com>, <nicolas.ferre@atmel.com>,
	<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 02/19] irqchip: atmel-aic: clean up RTC interrupt code
Date: Mon, 4 Jan 2016 09:16:49 +0100	[thread overview]
Message-ID: <20160104091649.339060d7@bbrezillon> (raw)
In-Reply-To: <1451881723-2478-3-git-send-email-milo.kim@ti.com>

Hi Milo,

On Mon, 4 Jan 2016 13:28:26 +0900
Milo Kim <milo.kim@ti.com> wrote:

> Atmel AIC disables RTC interrupt on initialization. However, the controller
> doesn't need to do it. There are two reasons.
> 
> * RTC driver disables interrupts on _probe()
>   RTC_IDR is set to 0x1f which means all RTC interrupts are disabled.
>   (drivers/rtc/rtc-at91rm9200.c)
>   at91_rtc_write_idr(AT91_RTC_ACKUPD | AT91_RTC_ALARM |
> 		AT91_RTC_SECEV | AT91_RTC_TIMEV |
> 		AT91_RTC_CALEV);
> 
> * All RTC interrupts are disabled by default.
>   If we try to read RTC_IMR(interrup mask status), then read value is 0
>   by default. It means all RTC interrupts are disabled by default.
>   We can also check the default status in the datasheet. Please note that
>   all devices have same RTC registers.
>   AT91RM9200
>   AT91SAM9N12
>   AT91SAM9X5
>   AT91SAM9G45
>   AT91SAM9RL
>   SAMA5D3
>   SAMA5D4
> 
> So, aic_common_rtc_irq_fixup() helper can be removed.

Please read b2f579b58e93 ("irqchip: atmel-aic: Add irq fixup
infrastructure") and 3d61467f9bab ("irqchip: atmel-aic: Implement RTC
irq fixup") messages before assuming you can simply remove these
functions.

There's a good reason behind this irq fixup infrastructure, and you're
blindly removing those functions without asking why we were doing that.

Best Regards,

Boris

> 
> Cc: Thomas Gleixner <tglx@linutronix.de>
> Cc: Jason Cooper <jason@lakedaemon.net>
> Cc: Marc Zyngier <marc.zyngier@arm.com>
> Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>
> Cc: Boris BREZILLON <boris.brezillon@free-electrons.com>
> Cc: Ludovic Desroches <ludovic.desroches@atmel.com>
> Cc: Nicolas Ferre <nicolas.ferre@atmel.com>
> Cc: linux-kernel@vger.kernel.org
> Signed-off-by: Milo Kim <milo.kim@ti.com>
> ---
>  drivers/irqchip/irq-atmel-aic-common.c | 28 ----------------------------
>  drivers/irqchip/irq-atmel-aic-common.h |  2 --
>  drivers/irqchip/irq-atmel-aic.c        |  9 ---------
>  drivers/irqchip/irq-atmel-aic5.c       | 13 -------------
>  4 files changed, 52 deletions(-)
> 
> diff --git a/drivers/irqchip/irq-atmel-aic-common.c b/drivers/irqchip/irq-atmel-aic-common.c
> index 37199b9..f8261be 100644
> --- a/drivers/irqchip/irq-atmel-aic-common.c
> +++ b/drivers/irqchip/irq-atmel-aic-common.c
> @@ -139,34 +139,6 @@ static void __init aic_common_ext_irq_of_init(struct irq_domain *domain)
>  	}
>  }
>  
> -#define AT91_RTC_IDR           0x24
> -#define AT91_RTC_IMR           0x28
> -#define AT91_RTC_IRQ_MASK      0x1f
> -
> -void __init aic_common_rtc_irq_fixup(struct device_node *root)
> -{
> -	struct device_node *np;
> -	void __iomem *regs;
> -
> -	np = of_find_compatible_node(root, NULL, "atmel,at91rm9200-rtc");
> -	if (!np)
> -		np = of_find_compatible_node(root, NULL,
> -					     "atmel,at91sam9x5-rtc");
> -
> -	if (!np)
> -		return;
> -
> -	regs = of_iomap(np, 0);
> -	of_node_put(np);
> -
> -	if (!regs)
> -		return;
> -
> -	writel(AT91_RTC_IRQ_MASK, regs + AT91_RTC_IDR);
> -
> -	iounmap(regs);
> -}
> -
>  #define AT91_RTT_MR		0x00			/* Real-time Mode Register */
>  #define AT91_RTT_ALMIEN		(1 << 16)		/* Alarm Interrupt Enable */
>  #define AT91_RTT_RTTINCIEN	(1 << 17)		/* Real Time Timer Increment Interrupt Enable */
> diff --git a/drivers/irqchip/irq-atmel-aic-common.h b/drivers/irqchip/irq-atmel-aic-common.h
> index 603f0a9..9027f15 100644
> --- a/drivers/irqchip/irq-atmel-aic-common.h
> +++ b/drivers/irqchip/irq-atmel-aic-common.h
> @@ -32,8 +32,6 @@ struct irq_domain *__init aic_common_of_init(struct device_node *node,
>  					     const struct irq_domain_ops *ops,
>  					     const char *name, int nirqs);
>  
> -void __init aic_common_rtc_irq_fixup(struct device_node *root);
> -
>  void __init aic_common_rtt_irq_fixup(struct device_node *root);
>  
>  void __init aic_common_irq_fixup(const struct of_device_id *matches);
> diff --git a/drivers/irqchip/irq-atmel-aic.c b/drivers/irqchip/irq-atmel-aic.c
> index 8a0c7f2..4c60224 100644
> --- a/drivers/irqchip/irq-atmel-aic.c
> +++ b/drivers/irqchip/irq-atmel-aic.c
> @@ -209,11 +209,6 @@ static const struct irq_domain_ops aic_irq_ops = {
>  	.xlate	= aic_irq_domain_xlate,
>  };
>  
> -static void __init at91rm9200_aic_irq_fixup(struct device_node *root)
> -{
> -	aic_common_rtc_irq_fixup(root);
> -}
> -
>  static void __init at91sam9260_aic_irq_fixup(struct device_node *root)
>  {
>  	aic_common_rtt_irq_fixup(root);
> @@ -221,16 +216,12 @@ static void __init at91sam9260_aic_irq_fixup(struct device_node *root)
>  
>  static void __init at91sam9g45_aic_irq_fixup(struct device_node *root)
>  {
> -	aic_common_rtc_irq_fixup(root);
>  	aic_common_rtt_irq_fixup(root);
>  }
>  
>  static const struct of_device_id aic_irq_fixups[] __initconst = {
> -	{ .compatible = "atmel,at91rm9200", .data = at91rm9200_aic_irq_fixup },
>  	{ .compatible = "atmel,at91sam9g45", .data = at91sam9g45_aic_irq_fixup },
> -	{ .compatible = "atmel,at91sam9n12", .data = at91rm9200_aic_irq_fixup },
>  	{ .compatible = "atmel,at91sam9rl", .data = at91sam9g45_aic_irq_fixup },
> -	{ .compatible = "atmel,at91sam9x5", .data = at91rm9200_aic_irq_fixup },
>  	{ .compatible = "atmel,at91sam9260", .data = at91sam9260_aic_irq_fixup },
>  	{ .compatible = "atmel,at91sam9261", .data = at91sam9260_aic_irq_fixup },
>  	{ .compatible = "atmel,at91sam9263", .data = at91sam9260_aic_irq_fixup },
> diff --git a/drivers/irqchip/irq-atmel-aic5.c b/drivers/irqchip/irq-atmel-aic5.c
> index 62bb840..8b8f5e2 100644
> --- a/drivers/irqchip/irq-atmel-aic5.c
> +++ b/drivers/irqchip/irq-atmel-aic5.c
> @@ -285,17 +285,6 @@ static const struct irq_domain_ops aic5_irq_ops = {
>  	.xlate	= aic5_irq_domain_xlate,
>  };
>  
> -static void __init sama5d3_aic_irq_fixup(struct device_node *root)
> -{
> -	aic_common_rtc_irq_fixup(root);
> -}
> -
> -static const struct of_device_id aic5_irq_fixups[] __initconst = {
> -	{ .compatible = "atmel,sama5d3", .data = sama5d3_aic_irq_fixup },
> -	{ .compatible = "atmel,sama5d4", .data = sama5d3_aic_irq_fixup },
> -	{ /* sentinel */ },
> -};
> -
>  static int __init aic5_of_init(struct device_node *node,
>  			       struct device_node *parent,
>  			       int nirqs)
> @@ -316,8 +305,6 @@ static int __init aic5_of_init(struct device_node *node,
>  	if (IS_ERR(domain))
>  		return PTR_ERR(domain);
>  
> -	aic_common_irq_fixup(aic5_irq_fixups);
> -
>  	aic5_domain = domain;
>  	nchips = aic5_domain->revmap_size / 32;
>  	for (i = 0; i < nchips; i++) {



-- 
Boris Brezillon, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

  reply	other threads:[~2016-01-04  8:16 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-04  4:28 [PATCH 00/19] irqchip: atmel-aic: make unified AIC driver Milo Kim
2016-01-04  4:28 ` [PATCH 01/19] irqchip: atmel-aic: fix wrong bit operation for IRQ priority Milo Kim
2016-01-04  8:11   ` Boris Brezillon
2016-01-04  4:28 ` [PATCH 02/19] irqchip: atmel-aic: clean up RTC interrupt code Milo Kim
2016-01-04  8:16   ` Boris Brezillon [this message]
2016-01-04  4:28 ` [PATCH 03/19] irqchip: atmel-aic: clean up RTT " Milo Kim
2016-01-04  8:17   ` Boris Brezillon
2016-01-04  4:28 ` [PATCH 04/19] irqchip: atmel-aic: replace magic numbers with named constant Milo Kim
2016-01-04  8:29   ` Boris Brezillon
2016-01-04  4:28 ` [PATCH 05/19] irqchip: atmel-aic: use simple constant to get number of interrupts per chip Milo Kim
2016-01-04  8:33   ` Boris Brezillon
2016-01-04  4:28 ` [PATCH 06/19] irqchip: atmel-aic: introduce register data structure Milo Kim
2016-01-04  8:53   ` Boris Brezillon
2016-01-06  8:30     ` Milo Kim
2016-01-04  4:28 ` [PATCH 07/19] irqchip: atmel-aic: make common IRQ domain translate function Milo Kim
2016-01-04  4:28 ` [PATCH 08/19] irqchip: atmel-aic: add common mask and unmask functions Milo Kim
2016-01-04  8:48   ` Boris Brezillon
2016-01-04  4:28 ` [PATCH 09/19] irqchip: atmel-aic: add common retrigger function Milo Kim
2016-01-04  4:28 ` [PATCH 10/19] irqchip: atmel-aic: add common set_type function Milo Kim
2016-01-04  4:28 ` [PATCH 11/19] irqchip: atmel-aic: add common PM IRQ chip operation Milo Kim
2016-01-04  4:28 ` [PATCH 12/19] irqchip: atmel-aic: use EOI register data in aic_reg_data Milo Kim
2016-01-04  4:28 ` [PATCH 13/19] irqchip: atmel-aic: clean up irq_chip_generic Milo Kim
2016-01-04  4:28 ` [PATCH 14/19] irqchip: atmel-aic: add common HW init function Milo Kim
2016-01-04  4:28 ` [PATCH 15/19] irqchip: atmel-aic: add common interrupt handler Milo Kim
2016-01-04  4:28 ` [PATCH 16/19] irqchip: atmel-aic: get total number of IRQs from device node Milo Kim
2016-01-04  4:28 ` [PATCH 17/19] irqchip: atmel-aic: use unified IRQ chip initialization function Milo Kim
2016-01-04  4:28 ` [PATCH 18/19] irqchip: atmel-aic: use unified AIC driver Milo Kim
2016-01-04  4:28 ` [PATCH 19/19] irqchip: atmel-aic: rename AIC driver and fix Kconfig Milo Kim
2016-01-04  9:02 ` [PATCH 00/19] irqchip: atmel-aic: make unified AIC driver Boris Brezillon
2016-01-04  9:37   ` Nicolas Ferre
2016-01-06  7:55     ` Milo Kim
2016-01-06  7:48   ` Milo Kim
2016-01-06  9:07     ` Boris Brezillon
2016-01-06 14:49       ` Jason Cooper
2016-01-07  7:48       ` Milo Kim

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=20160104091649.339060d7@bbrezillon \
    --to=boris.brezillon@free-electrons.com \
    --cc=alexandre.belloni@free-electrons.com \
    --cc=jason@lakedaemon.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ludovic.desroches@atmel.com \
    --cc=marc.zyngier@arm.com \
    --cc=milo.kim@ti.com \
    --cc=nicolas.ferre@atmel.com \
    --cc=tglx@linutronix.de \
    /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