public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Benjamin Herrenschmidt <benh@kernel•crashing.org>
To: Linus Torvalds <torvalds@osdl•org>
Cc: linuxppc-dev list <linuxppc-dev@ozlabs•org>
Subject: Re: [POWERPC] Don't get PCI IRQ from OF for devices with no IRQ
Date: Mon, 09 Oct 2006 06:53:23 +1000	[thread overview]
Message-ID: <1160340803.5926.2.camel@localhost.localdomain> (raw)
In-Reply-To: <200610071959.k97JxIK9026331@hera.kernel.org>

On Sat, 2006-10-07 at 19:59 +0000, Linux Kernel Mailing List wrote:
> commit 41550c5128150175197257b6ceab2cd50dea7b51
> tree 9406c5680e5e7fd49804fe95104453b272533f28
> parent c998de146061db17787c1a31a3db1989f1341fdf
> author Benjamin Herrenschmidt <benh@kernel•crashing.org> 1160030441 +1000
> committer Paul Mackerras <paulus@samba•org> 1160133041 +1000
> 
> [POWERPC] Don't get PCI IRQ from OF for devices with no IRQ

Hi Linus !

Please revert this one for now. It seems to break G5s :( Looks like PCI
cells inside Apple IO ASICs don't have a PCI_INTERRUPT_LINE set. I need
to figure out a better fix.

Cheers,
Ben.

> This patch adds checking of the PCI_INTERRUPT_PIN register before
> using standard OF parsing to retreive PCI interrupts. The reason is
> that some PCI devices may have no PCI interrupt, though they may have
> interrupts attached via other means. In this case, we shall not use
> irq->pdev, but device-specific code can later retreive those interrupts
> instead.
> 
> Without that patch, Maple and derivatives don't get the right interrupt
> for the second IDE channel as the linux IDE code fallsback to the PCI
> irq instead of trying to use the legacy ones for the on-board controller
> (which has no PCI_INTERRUPT_PIN). Having no PCI IRQ assign to it (as it
> doesn't request any) fixes it.
> 
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel•crashing.org>
> Signed-off-by: Paul Mackerras <paulus@samba•org>
> 
>  arch/powerpc/kernel/prom_parse.c |   17 +++++++++++------
>  1 file changed, 11 insertions(+), 6 deletions(-)
> 
> diff --git a/arch/powerpc/kernel/prom_parse.c b/arch/powerpc/kernel/prom_parse.c
> index 603dff3..17fcb48 100644
> --- a/arch/powerpc/kernel/prom_parse.c
> +++ b/arch/powerpc/kernel/prom_parse.c
> @@ -914,6 +914,17 @@ int of_irq_map_pci(struct pci_dev *pdev,
>  	u8 pin;
>  	int rc;
>  
> +	/* We need to first check if the PCI device has a PCI interrupt at all
> +	 * since we have cases where the device-node might expose non-PCI
> +	 * interrupts, but the device has no PCI interrupt to it
> +	 */
> +	rc = pci_read_config_byte(pdev, PCI_INTERRUPT_PIN, &pin);
> +	if (rc != 0)
> +		return rc;
> +	/* No pin, exit */
> +	if (pin == 0)
> +		return -ENODEV;
> +
>  	/* Check if we have a device node, if yes, fallback to standard OF
>  	 * parsing
>  	 */
> @@ -925,12 +936,6 @@ int of_irq_map_pci(struct pci_dev *pdev,
>  	 * interrupt spec.  we assume #interrupt-cells is 1, which is standard
>  	 * for PCI. If you do different, then don't use that routine.
>  	 */
> -	rc = pci_read_config_byte(pdev, PCI_INTERRUPT_PIN, &pin);
> -	if (rc != 0)
> -		return rc;
> -	/* No pin, exit */
> -	if (pin == 0)
> -		return -ENODEV;
>  
>  	/* Now we walk up the PCI tree */
>  	lspec = pin;
> -
> To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
> the body of a message to majordomo@vger•kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

           reply	other threads:[~2006-10-08 20:53 UTC|newest]

Thread overview: expand[flat|nested]  mbox.gz  Atom feed
 [parent not found: <200610071959.k97JxIK9026331@hera.kernel.org>]

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=1160340803.5926.2.camel@localhost.localdomain \
    --to=benh@kernel$(echo .)crashing.org \
    --cc=linuxppc-dev@ozlabs$(echo .)org \
    --cc=torvalds@osdl$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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