public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Zang Roy-r61911 <tie-fei.zang@freescale•com>
To: Benjamin Herrenschmidt <benh@kernel•crashing.org>
Cc: linuxppc-dev list <linuxppc-dev@ozlabs•org>
Subject: Re: MPC7448_HPC2 question
Date: 25 Oct 2006 13:31:46 +0800	[thread overview]
Message-ID: <1161754306.31407.3.camel@localhost.localdomain> (raw)
In-Reply-To: <1161753605.22582.42.camel@localhost.localdomain>

On Wed, 2006-10-25 at 13:20, Benjamin Herrenschmidt wrote:
> Any reason why that:
> 
> void mpc7448_hpc2_fixup_irq(struct pci_dev *dev)
> {
>         struct pci_controller *hose;
>         struct device_node *node;
>         const unsigned int *interrupt;
>         int busnr;
>         int len;
>         u8 slot;
>         u8 pin;
> 
>         /* Lookup the hose */
>         busnr = dev->bus->number;
>         hose = pci_bus_to_hose(busnr);
>         if (!hose)
>                 printk(KERN_ERR "No pci hose found\n");
> 
>         /* Check it has an OF node associated */
>         node = (struct device_node *) hose->arch_data;
>         if (!node)
>                 printk(KERN_ERR "No pci node found\n");
> 
>         interrupt = get_property(node, "interrupt-map", &len);
>         slot = find_slot_by_devfn(interrupt, dev->devfn);
>         pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin);
>         if (pin == 0 || pin > 4)
>                 pin = 1;
>         pin--;
>         dev->irq  = interrupt[slot*4*7 + pin*7 + 5];
>         DBG("TSI_PCI: dev->irq = 0x%x\n", dev->irq);
> }
> 
> Cannot be replaced by:
> 
>         pci_read_irq_line(dev);
> 
> I'm about to make pci_read_irq_line() called by default by the PCI
> code (with a new ppc_md.pci_irq_fixup for platforms that really need
> something else done) and so while "fixing" all platforms, I stumbled
> accross the code above which is a bit shocking :)
> 
> Cheers,
> 
> Ben.
> 
> 
> 

Ben, 
	Last week, I had tried to do the replacement. While, it did not work. I
had though some update of pci_read_irq_line() should be needed.
	Any way, I will investigate it and give the patch ASAP :-).

Roy

  reply	other threads:[~2006-10-25  5:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-25  5:20 MPC7448_HPC2 question Benjamin Herrenschmidt
2006-10-25  5:31 ` Zang Roy-r61911 [this message]
2006-10-25  9:31 ` Zang Roy-r61911
2006-10-25 13:45   ` Benjamin Herrenschmidt
2006-10-26  7:59     ` Zang Roy-r61911

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=1161754306.31407.3.camel@localhost.localdomain \
    --to=tie-fei.zang@freescale$(echo .)com \
    --cc=benh@kernel$(echo .)crashing.org \
    --cc=linuxppc-dev@ozlabs$(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