[PATCH] PCI: add MSI INTX_DISABLE quirks for AR8161/AR8162/AR8171/AR8172
Wei Yang
weiyang at linux.vnet.ibm.com
Thu Mar 7 20:22:36 EST 2013
On Thu, Mar 07, 2013 at 03:57:59PM +0000, Huang, Xiong wrote:
>> >+static void quirk_msi_intx_disable_qca_bug(struct pci_dev *dev) {
>> >+ static u16 qca_eth_devid[] = {
>> >+ PCI_DEVICE_ID_AR8161,
>> >+ PCI_DEVICE_ID_AR8162,
>> >+ PCI_DEVICE_ID_AR8171,
>> >+ PCI_DEVICE_ID_AR8172};
>> >+ struct pci_dev *p;
>> >+ int i;
>> >+
>> >+ /* AR816X/AR817X MSI is fixed at HW level from revision 0x18 */
>> >+ for (i = 0; i < ARRAY_SIZE(qca_eth_devid); i++) {
>> >+ p = pci_get_device(PCI_VENDOR_ID_ATTANSIC,
>> >+ qca_eth_devid[i],
>>
>> xiong,
>>
>> The "FINAL" fixup is called just in pci_apply_final_quirks(), if I am correct.
>>
>> In this function, it will go through all the pci devices which are registered in
>> the system. And try to invoke the fixup hook.
>>
>> Also, before invode the hook, in function pci_do_fixups() it will make sure
>> the hook just apply to the devices whose VendorID and DeviceID match what
>> you defined in DECLARE_PCI_FIXUP_FINAL.
>>
>> So I think there is no need to iterate on all those pci device, before you want
>> to change the pci_dev->dev_flags.
>>
>> >+ NULL);
>> >+ if (!p)
>> >+ return;
>> >+
>> >+ if (p->revision < 0x18)
>> >+ dev->dev_flags |=
>> PCI_DEV_FLAGS_MSI_INTX_DISABLE_BUG;
>> >+ pci_dev_put(p);
>> >+ }
>
>Wei, thanks for you feedback, this patch is just follow the function 'quirk_msi_intx_disable_ati_bug' in quirks.c
>Is it ok if I revise code as:
> static void quirk_msi_intx_disable_qca_bug(struct pci_dev *dev)
> {
> If (dev->revision < 0x18)
> dev->dev_flags |= PCI_DEV_FLAGS_MSI_INTX_DISABLE_BUG;
> }
I think it is ok. Have you tested it?
If your test passed, I think you can send out another version.
>
>Please advise, thanks !
>
>-Xiong
>
--
Richard Yang
Help you, Help me
More information about the unified-drivers
mailing list