From: David Daney <ddaney.cavm@gmail.com>
To: Alexander Sverdlin <alexander.sverdlin.ext@nsn.com>,
Ralf Baechle <ralf@linux-mips.org>,
John Crispin <blogic@openwrt.org>
Cc: linux-mips@linux-mips.org, david.daney@cavium.com
Subject: Re: [PATCH] octeon-irq: Fix GPIO number in IRQ chip private data
Date: Wed, 10 Apr 2013 09:03:37 -0700 [thread overview]
Message-ID: <51658D59.6070602@gmail.com> (raw)
In-Reply-To: <5139FA0A.8060908@nsn.com>
On 03/08/2013 06:47 AM, Alexander Sverdlin wrote:
> octeon-irq: Fix GPIO number in IRQ chip private data
>
> Current GPIO chip implementation in octeon-irq is still broken, even
> after upstream
> commit 87161ccdc61862c8b49e75c21209d7f79dc758e9 (MIPS: Octeon: Fix
> broken interrupt
> controller code). It works for GPIO IRQs that have reset-default
> configuration, but
> not for edge-triggered ones.
>
> The problem is in octeon_irq_gpio_map_common(), which passes modified
> "hw" variable
> (which has range of possible values 16..31) as "gpio_line" parameter to
> octeon_irq_set_ciu_mapping(), which saves it in private data of the IRQ
> chip. Later,
> neither octeon_irq_gpio_setup() is able to re-configure GPIOs
> (cvmx_write_csr() is
> writing to non-existent CVMX_GPIO_BIT_CFGX), nor
> octeon_irq_ciu_gpio_ack() is able
> to acknowledge such IRQ, because "mask" is incorrect.
>
> Fix is trivial and has been tested on Cavium Octeon II -based board,
> including
> both level-triggered and edge-triggered GPIO IRQs.
>
> Signed-off-by: Alexander Sverdlin <alexander.sverdlin.ext@nsn.com>
> Cc: David Daney <david.daney@cavium.com>
Yes, this patch is needed...
Acked-by: David Daney <david.daney@cavium.com>
> ---
> --- linux.orig/arch/mips/cavium-octeon/octeon-irq.c
> +++ linux/arch/mips/cavium-octeon/octeon-irq.c
> @@ -1034,9 +1034,8 @@ static int octeon_irq_gpio_map_common(st
> if (!octeon_irq_virq_in_range(virq))
> return -EINVAL;
>
> - hw += gpiod->base_hwirq;
> - line = hw >> 6;
> - bit = hw & 63;
> + line = (hw + gpiod->base_hwirq) >> 6;
> + bit = (hw + gpiod->base_hwirq) & 63;
> if (line > line_limit || octeon_irq_ciu_to_irq[line][bit] != 0)
> return -EINVAL;
>
>
>
>
prev parent reply other threads:[~2013-04-10 16:03 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-08 14:47 [PATCH] octeon-irq: Fix GPIO number in IRQ chip private data Alexander Sverdlin
2013-04-10 16:03 ` David Daney [this message]
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=51658D59.6070602@gmail.com \
--to=ddaney.cavm@gmail.com \
--cc=alexander.sverdlin.ext@nsn.com \
--cc=blogic@openwrt.org \
--cc=david.daney@cavium.com \
--cc=linux-mips@linux-mips.org \
--cc=ralf@linux-mips.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 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.