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


Groups > linux.kernel > #1328892

Re: [PATCH 1/6] irqchip: add the Alpine MSIX interrupt controller

From Antoine Tenart <antoine.tenart@free-electrons.com>
Newsgroups linux.kernel
Subject Re: [PATCH 1/6] irqchip: add the Alpine MSIX interrupt controller
Date 2016-02-08 11:30 +0100
Message-ID <qZReW-3Ut-19@gated-at.bofh.it> (permalink)
References <qZQ9b-3eh-3@gated-at.bofh.it> <qZQ9d-3eh-39@gated-at.bofh.it> <qZQCe-3pM-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


[Multipart message — attachments visible in raw view] - view raw

Hi Marc,

On Mon, Feb 08, 2016 at 09:44:49AM +0000, Marc Zyngier wrote:
> On 08/02/16 09:16, Antoine Tenart wrote:
> > +
> > +/* MSIX message address format: local GIC target */
> > +#define ALPINE_MSIX_SPI_TARGET_CLUSTER0		BIT(16)
> > +
> > +struct alpine_msix_data {
> > +	spinlock_t msi_map_lock;
> > +	u32 addr_high;
> > +	u32 addr_low;
> 
> As this looks to be a physical address, please consider using phys_addr_t.

Sure.

[…]

> > +static int alpine_msix_init(struct device_node *node,
> > +			    struct device_node *parent)
> > +{
> > +	struct alpine_msix_data *priv;
> > +	struct resource res;
> > +	int ret;
> > +
> > +	priv = kzalloc(sizeof(*priv), GFP_KERNEL);
> > +	if (!priv)
> > +		return -ENOMEM;
> > +
> > +	spin_lock_init(&priv->msi_map_lock);
> > +
> > +	ret = of_address_to_resource(node, 0, &res);
> > +	if (ret) {
> > +		pr_err("Failed to allocate resource\n");
> > +		goto err_priv;
> > +	}
> > +
> > +	priv->addr_high = upper_32_bits((u64)res.start);
> > +	priv->addr_low = lower_32_bits(res.start) + ALPINE_MSIX_SPI_TARGET_CLUSTER0;
> 
> This is a bit odd. If you always set bit 16, why isn't that reflected in
> the base address coming from the DT?

The 20 least significant bits of addr_low provide direct information
regarding the interrupt destination, so I thought it would be clearer
to have this explicitly in the driver so that we know what those bits
mean.

What do you think?


Thanks for the review!

Antoine

-- 
Antoine Ténart, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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


Thread

[PATCH 0/6] irqchip: introduce the Alpine MSIX driver Antoine Tenart <antoine.tenart@free-electrons.com> - 2016-02-08 10:20 +0100
  [PATCH 1/6] irqchip: add the Alpine MSIX interrupt controller Antoine Tenart <antoine.tenart@free-electrons.com> - 2016-02-08 10:20 +0100
    Re: [PATCH 1/6] irqchip: add the Alpine MSIX interrupt controller Marc Zyngier <marc.zyngier@arm.com> - 2016-02-08 10:50 +0100
      Re: [PATCH 1/6] irqchip: add the Alpine MSIX interrupt controller Thomas Petazzoni <thomas.petazzoni@free-electrons.com> - 2016-02-08 11:00 +0100
        Re: [PATCH 1/6] irqchip: add the Alpine MSIX interrupt controller Marc Zyngier <marc.zyngier@arm.com> - 2016-02-08 11:10 +0100
      Re: [PATCH 1/6] irqchip: add the Alpine MSIX interrupt controller Antoine Tenart <antoine.tenart@free-electrons.com> - 2016-02-08 11:30 +0100
        Re: [PATCH 1/6] irqchip: add the Alpine MSIX interrupt controller Marc Zyngier <marc.zyngier@arm.com> - 2016-02-08 11:40 +0100
          Re: [PATCH 1/6] irqchip: add the Alpine MSIX interrupt controller Antoine Tenart <antoine.tenart@free-electrons.com> - 2016-02-08 11:50 +0100
            Re: [PATCH 1/6] irqchip: add the Alpine MSIX interrupt controller Marc Zyngier <marc.zyngier@arm.com> - 2016-02-08 12:00 +0100
              Re: [PATCH 1/6] irqchip: add the Alpine MSIX interrupt controller Antoine Tenart <antoine.tenart@free-electrons.com> - 2016-02-08 12:10 +0100
      Re: [PATCH 1/6] irqchip: add the Alpine MSIX interrupt controller Antoine Tenart <antoine.tenart@free-electrons.com> - 2016-02-08 15:10 +0100
        Re: [PATCH 1/6] irqchip: add the Alpine MSIX interrupt controller Marc Zyngier <marc.zyngier@arm.com> - 2016-02-08 15:20 +0100
    Re: [PATCH 1/6] irqchip: add the Alpine MSIX interrupt controller Thomas Gleixner <tglx@linutronix.de> - 2016-02-08 11:40 +0100
      Re: [PATCH 1/6] irqchip: add the Alpine MSIX interrupt controller Antoine Tenart <antoine.tenart@free-electrons.com> - 2016-02-08 15:20 +0100
        Re: [PATCH 1/6] irqchip: add the Alpine MSIX interrupt controller Marc Zyngier <marc.zyngier@arm.com> - 2016-02-08 15:30 +0100
          Re: [PATCH 1/6] irqchip: add the Alpine MSIX interrupt controller Antoine Tenart <antoine.tenart@free-electrons.com> - 2016-02-08 15:50 +0100
            Re: [PATCH 1/6] irqchip: add the Alpine MSIX interrupt controller Marc Zyngier <marc.zyngier@arm.com> - 2016-02-08 16:10 +0100
  [PATCH 4/6] ARM: dts: alpine: add the MSIX node Antoine Tenart <antoine.tenart@free-electrons.com> - 2016-02-08 10:20 +0100

csiph-web