lkml.org 
[lkml]   [2012]   [Jul]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH v2 07/32] PCI/portdrv: use PCIe capabilities access functions to simplify implementation
>> 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



\
 
 \ /
  Last update: 2012-07-25 12:21    [W:0.074 / U:0.428 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site