Re: [PATCH 1/2] PCI: save and restore device state during bus reset

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 9/13/2016 7:20 PM, Sinan Kaya wrote:
> On 9/13/2016 5:53 PM, Bjorn Helgaas wrote:
>>> +	pci_bus_restore(dev->bus);
>> This path eventually writes the Bridge Control register:
>>
>>   pci_reset_bridge_secondary_bus
>>     pcibios_reset_secondary_bus
>>       pci_reset_secondary_bus
>>         pci_write_config_word(dev, PCI_BRIDGE_CONTROL, ctrl)
>>
>> But I think it'd be easy to call this on a non-bridge device, and I
>> don't think there's anything in the path that checks whether this is
>> actually a bridge.  I wonder if we should check that somewhere, or
>> maybe even change the interface so it takes a struct pci_bus instead
>> of a pci_dev.
>>
> 
> I'll change it to pci_bus.
> 
>>>> +}
> 
> 

Changing the API seems to become a bigger mess. pcibios_reset_secondary_bus has
weaker friends in different architectures.

I can move the check in pci_parent_bus_reset 

         if (pci_is_root_bus(dev->bus) || dev->subordinate ||
             !dev->bus->self || dev->dev_flags & PCI_DEV_FLAGS_NO_BUS_RESET)
                 return -ENOTTY;

inside pci_reset_bridge_secondary_bus instead.

-- 
Sinan Kaya
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [Linux for Sparc]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux