linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: mark.rutland@arm.com (Mark Rutland)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/2] drivers: net: xgene: fix: Derive prefetch number from irq
Date: Mon, 7 Mar 2016 19:07:06 +0000	[thread overview]
Message-ID: <20160307190705.GA27101@svinekod> (raw)
In-Reply-To: <1457502577-2606-2-git-send-email-isubramanian@apm.com>

On Tue, Mar 08, 2016 at 09:49:36PM -0800, Iyappan Subramanian wrote:
> Prefetch buffer numbers are mapped to hardware irqs. Currently
> they are statically assigned to match with firmware irqs.
> 
> If the irq on firmware changes, prefetch buffer number on the driver
> also needs to be updated to match with the firmware.
> 
> This patch removes this static association between firmware and the
> driver by deriving the prefetch buffer number from the Linux irq.

This driver should neither care about the Linux IRQ number nor the interrupt
controller's physical IRQ number. Neither of the two are properties of the
device.

What you actually care about is the index of the interrupt pin _out_ of the
device, not _into_ the interrupt controller. As with other drivers, that should
described explicitly in the device binding. Either the interrupts should be
listed in a fixed order, or they should be given names.

> +static u8 xgene_start_cpu_bufnum(struct xgene_enet_pdata *pdata)
> +{
> +	struct irq_desc *desc;
> +	int hwirq;
> +
> +	desc = irq_to_desc(pdata->irqs[0]);
> +	hwirq = desc->irq_data.hwirq;
> +
> +	return hwirq - XGENE2_RM0_START_IRQ;
> +}

No device driver should be doing this.

Mark.

  reply	other threads:[~2016-03-07 19:07 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-09  5:49 [PATCH 0/2] drivers: net: xgene: fix irq related issues Iyappan Subramanian
2016-03-09  5:49 ` [PATCH 1/2] drivers: net: xgene: fix: Derive prefetch number from irq Iyappan Subramanian
2016-03-07 19:07   ` Mark Rutland [this message]
2016-03-09  5:49 ` [PATCH 2/2] drivers: net: xgene: fix: Remove IRQF_SHARED flag Iyappan Subramanian

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=20160307190705.GA27101@svinekod \
    --to=mark.rutland@arm.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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).