lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 11 May 2011 13:23:21 -0700
From:	Yinghai Lu <>
To:	Jesse Barnes <>
CC:	Jeff Kirsher <>,
	Jesse Brandeburg <>,
	Bruce Allan <>,
	Carolyn Wyborny <>,
	Don Skidmore <>,
	Greg Rose <>,
	PJ Waskiewicz <>,
	Alex Duyck <>,
	John Ronciak <>,
	"Rafael J. Wysocki" <>,
	Kenji Kaneshige <>,
	Matthew Garrett <>,
	Naga Chumbalkar <>,,,,,
	Andrew Morton <>
Subject: Re: [PATCH] pci, e1000e: Add and use __pci_disable_link_state

On 05/09/2011 02:35 PM, Jesse Barnes wrote:
> On Sun, 08 May 2011 11:54:32 -0700
> Yinghai Lu <> wrote:
>> Need to use it in _e1000e_disable_aspm.
>> when aer happens,
>> pci_walk_bus already have down_read(&pci_bus_sem)...
>> then report_slot_reset
>>         ==> e1000_io_slot_reset
>>                 ==> e1000e_disable_aspm
>>                         ==> pci_disable_link_state...
>> We can not use pci_disable_link_state, and it will try to hold pci_bus_sem again.
>> Try to have __pci_disable_link_state that will not need to hold pci_bus_sem.
> What about the other callers of e1000e_disable_aspm?  Do they already
> have the lock held or is it just reset that needs the already locked
> version?


there is another version when aspm is not defined. and it does not use any lock. 

static void __e1000e_disable_aspm(struct pci_dev *pdev, u16 state)
        pci_disable_link_state(pdev, state);
static void __e1000e_disable_aspm(struct pci_dev *pdev, u16 state)
        int pos;
        u16 reg16;

         * Both device and parent should have the same ASPM setting.
         * Disable ASPM in downstream component first and then upstream.
        pos = pci_pcie_cap(pdev);
        pci_read_config_word(pdev, pos + PCI_EXP_LNKCTL, &reg16);
        reg16 &= ~state;
        pci_write_config_word(pdev, pos + PCI_EXP_LNKCTL, reg16);

        if (!pdev->bus->self)

        pos = pci_pcie_cap(pdev->bus->self);
        pci_read_config_word(pdev->bus->self, pos + PCI_EXP_LNKCTL, &reg16);
        reg16 &= ~state;
        pci_write_config_word(pdev->bus->self, pos + PCI_EXP_LNKCTL, reg16);

>> +extern void __pci_disable_link_state(struct pci_dev *pdev, int state);
>>  extern void pcie_clear_aspm(void);
>>  extern void pcie_no_aspm(void);
>>  #else
> pci_disable_link_state_locked would be more descriptive and would match
> other usage in the kernel.



To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to
More majordomo info at

Powered by blists - more mailing lists