Re: [RFC PATCH v2 07/32] PCI/portdrv: use PCIe capabilities accessfunctions to simplify implementation

From: Jiang Liu
Date: Wed Jul 25 2012 - 05:46:18 EST


>> diff --git a/drivers/pci/pcie/portdrv_core.c
>> b/drivers/pci/pcie/portdrv_core.c
>> index bf320a9..37bff83 100644
>> --- a/drivers/pci/pcie/portdrv_core.c
>> +++ b/drivers/pci/pcie/portdrv_core.c
>> @@ -76,7 +76,6 @@ static int pcie_port_enable_msix(struct pci_dev *dev,
>> int *vectors, int mask)
>> struct msix_entry *msix_entries;
>> int idx[PCIE_PORT_DEVICE_MAXSERVICES];
>> int nr_entries, status, pos, i, nvec;
>> - u16 reg16;
>> u32 reg32;
>>
>> nr_entries = pci_msix_table_size(dev);
>> @@ -120,9 +119,7 @@ static int pcie_port_enable_msix(struct pci_dev *dev,
>> int *vectors, int mask)
>> * the value in this field indicates which MSI-X Table entry
>> is
>> * used to generate the interrupt message."
>> */
>> - pos = pci_pcie_cap(dev);
>> - pci_read_config_word(dev, pos + PCI_EXP_FLAGS, &reg16);
>> - entry = (reg16 & PCI_EXP_FLAGS_IRQ) >> 9;
>> + entry = (dev->pcie_flags_reg & PCI_EXP_FLAGS_IRQ) >> 9;
>> if (entry >= nr_entries)
>> goto Error;
>
> I think we need to use pci_read_config_word() for MSI setup.
>
> "Interrupt Message Number" in the PCIe capability register can vary depending
> on whether MSI or MSI-x is enabled. Please see PCIe spec for details.
>
> Could you double-check that?
>
> Regards,
> Kenji Kaneshige
Good catch, will revert this change.
Thanks!
Gerry

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/