Re: [PATCH] e1000: fix IRQx nobody cared for shared irq with INTx

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Jeff Garzik <jeff@...>
Cc: Andrew Morton <akpm@...>, David Miller <davem@...>, Greg KH <greg@...>, Ingo Molnar <mingo@...>, kernel list <linux-kernel@...>, <netdev@...>, <linux-pci@...>
Date: Saturday, March 29, 2008 - 7:50 pm

On Sat, Mar 29, 2008 at 2:15 PM, Jeff Garzik <jeff@garzik.org> wrote:

pci_intx should be safe.

void
pci_intx(struct pci_dev *pdev, int enable)
{
        u16 pci_command, new;

        pci_read_config_word(pdev, PCI_COMMAND, &pci_command);

        if (enable) {
                new = pci_command & ~PCI_COMMAND_INTX_DISABLE;
        } else {
                new = pci_command | PCI_COMMAND_INTX_DISABLE;
        }

        if (new != pci_command) {
                struct pci_devres *dr;

                pci_write_config_word(pdev, PCI_COMMAND, new);

                dr = find_pci_dr(pdev);
                if (dr && !dr->restore_intx) {
                        dr->restore_intx = 1;
                        dr->orig_intx = !enable;
                }
        }
}

static struct pci_devres * find_pci_dr(struct pci_dev *pdev)
{
        if (pci_is_managed(pdev))
                return devres_find(&pdev->dev, pcim_release, NULL, NULL);
        return NULL;
}


YH
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: [PATCH] e1000: fix IRQx nobody cared for shared irq with..., Yinghai Lu, (Sat Mar 29, 7:50 pm)