devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Christian Ruppert <christian.ruppert@abilis.com>
Cc: Vineet Gupta <Vineet.Gupta1@synopsys.com>,
	Grant Likely <grant.likely@secretlab.ca>,
	Rob Herring <rob.herring@calxeda.com>,
	Rob Landley <rob@landley.net>,
	devicetree-discuss@lists.ozlabs.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Pierrick Hascoet <pierrick.hascoet@abilis.com>
Subject: Re: [PATCH REBASE] irqchip: Add TB10x interrupt controller driver
Date: Mon, 27 May 2013 14:26:36 +0200 (CEST)	[thread overview]
Message-ID: <alpine.LFD.2.02.1305271414270.4220@ionos> (raw)
In-Reply-To: <1367930258-27056-1-git-send-email-christian.ruppert@abilis.com>

On Tue, 7 May 2013, Christian Ruppert wrote:
> +#include <linux/interrupt.h>
> +#include <linux/irqdomain.h>
> +#include <linux/of_irq.h>
> +#include <linux/of_address.h>
> +#include <linux/of_platform.h>
> +#include <linux/io.h>
> +#include <linux/slab.h>
> +#include "../../drivers/irqchip/irqchip.h"

#include "irqchip.h" perhaps?

> +#define AB_IRQCTL_INT_ENABLE   (0x00)

What's the purpose of the parens? Decrease readability?

> +static void tb10x_irq_unmask(struct irq_data *data)
> +{
> +	struct tb10x_ictl *ictl = irq_data_get_irq_chip_data(data);
> +	unsigned int hwirq = irqd_to_hwirq(data);
> +
> +	ab_irqctl_writereg(ictl, AB_IRQCTL_INT_ENABLE,
> +		ab_irqctl_readreg(ictl, AB_IRQCTL_INT_ENABLE) | (1 << hwirq));

Another implementation of the generic interrupt chip functionality.

> +static int tb10x_irq_map(struct irq_domain *d, unsigned int irq,
> +				irq_hw_number_t hw)
> +{
> +	irq_set_chip_data(irq, d->host_data);
> +	irq_set_chip_and_handler(irq, &irq_tb10x_chip, handle_level_irq);
> +
> +	return 0;
> +}
> +
> +static int tb10x_irq_xlate(struct irq_domain *d, struct device_node *node,
> +			const u32 *intspec, unsigned int intsize,
> +			unsigned long *out_hwirq, unsigned int *out_type)
> +{
> +	static const unsigned int tb10x_xlate_types[] = {
> +		IRQ_TYPE_EDGE_RISING,
> +		IRQ_TYPE_LEVEL_LOW,
> +		IRQ_TYPE_LEVEL_HIGH,
> +		IRQ_TYPE_EDGE_FALLING,

Why do you need to introduce another format for specifying the
interrupt type instead of using the IRQ_TYPE values and
irq_domain_xlate_twocell()?

> +static void tb10x_irq_cascade(unsigned int irq, struct irq_desc *desc)
> +{
> +	struct tb10x_ictl *ictl = irq_desc_get_handler_data(desc);
> +
> +	generic_handle_irq(irq_find_mapping(ictl->domain, irq));
> +}
> +
> +static int __init of_tb10x_init_irq(struct device_node *ictl,
> +					struct device_node *parent)
> +{
> +	int i;
> +	int ret;
> +	int nrirqs = of_irq_count(ictl);

One line for all those ints please

> +	ic->domain = irq_domain_add_tree(ictl, &irq_tb10x_domain_ops, ic);

Why do you want a tree, if you require that the interrupts are mapped
1:1 to the hardware interrupt numbers? This doesn't make any sense at
all and makes the above cascade handler a pointless waste of cpu cycles.

Thanks,

	tglx

  parent reply	other threads:[~2013-05-27 12:26 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-11 13:17 [PATCH] irqchip: Add TB10x interrupt controller driver Christian Ruppert
2013-05-07 12:37 ` [PATCH REBASE] " Christian Ruppert
2013-05-27 10:06   ` Vineet Gupta
2013-05-27 12:26   ` Thomas Gleixner [this message]
2013-05-28 16:34     ` [PATCH V2] " Christian Ruppert
2013-05-30 21:19       ` Grant Likely
2013-05-31 15:32         ` [PATCH V3] " Christian Ruppert
     [not found]           ` <1370014348-21121-1-git-send-email-christian.ruppert-ux6zf3SgZrrQT0dZR+AlfA@public.gmane.org>
2013-05-31 17:32             ` Thomas Gleixner
2013-05-31 22:18               ` Grant Likely
2013-06-01 11:01                 ` Christian Ruppert
     [not found]                   ` <20130601110133.GA4051-7oYq3qWSd+k@public.gmane.org>
2013-06-03  5:33                     ` [PATCH V3] irqchip: Add TB10x interrupt controller driver (2) Vineet Gupta
2013-06-03  8:00                       ` Christian Ruppert
2013-06-13  8:26                   ` [PATCH V3] irqchip: Add TB10x interrupt controller driver Christian Ruppert
2013-06-03  4:05                 ` Vineet Gupta
2013-06-03  9:51                   ` Grant Likely
2013-06-25 13:29                     ` Christian Ruppert
2013-06-25 13:33                       ` Grant Likely
2013-06-25 13:58             ` Thomas Gleixner
2013-06-25 14:11               ` Christian Ruppert
2013-06-25 14:37                 ` Thomas Gleixner
2013-06-25 16:29                   ` [PATCH V4] " Christian Ruppert
2013-06-26  4:17                   ` [PATCH V3] " Vineet Gupta
2013-06-26 14:01                     ` [PATCH] ARC: [TB10x] Updates for irqchip driver Christian Ruppert
2013-06-27  2:33                       ` Vineet Gupta
2013-06-26  4:23                 ` [PATCH V3] irqchip: Add TB10x interrupt controller driver Vineet Gupta

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=alpine.LFD.2.02.1305271414270.4220@ionos \
    --to=tglx@linutronix.de \
    --cc=Vineet.Gupta1@synopsys.com \
    --cc=christian.ruppert@abilis.com \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=grant.likely@secretlab.ca \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pierrick.hascoet@abilis.com \
    --cc=rob.herring@calxeda.com \
    --cc=rob@landley.net \
    /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;
as well as URLs for NNTP newsgroup(s).