All of lore.kernel.org
 help / color / mirror / Atom feed
* [Query] PCIe power management with designware
@ 2015-05-04 16:24 Kishon Vijay Abraham I
  2015-05-05 13:03 ` Pratyush Anand
  0 siblings, 1 reply; 3+ messages in thread
From: Kishon Vijay Abraham I @ 2015-05-04 16:24 UTC (permalink / raw)
  To: arnd, Bjorn Helgaas, Pratyush Anand, linux-pci, linux-kernel,
	jg1.han, Mohit Kumar, kishon

Hi,

I'm planning to add power management (suspend/resume) support for DRA7xx and 
have a query.

The pci_pm_suspend_noirq callback being a bus pm_ops gets invoked late i.e 
after the suspend hooks of the pci devices (including the RC driver). The 
problem is after the 'suspend' of the RC driver, the clocks are disabled. Now 
pci_pm_suspend_noirq has a call to pci_save_state() which tries to access the
configuration space registers. Since the clocks are disabled by now, this 
results in an abort. Shouldn't we do save_state() earlier?

After working around the above problem, I face one more issue with broadcom 
BCM95721 A211 card. After resuming, I'm unable to access the memory space. I'm 
not sure if that is specific to that particular card, since I have no problems 
with USB cards.

Cheers
Kishon

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Query] PCIe power management with designware
  2015-05-04 16:24 [Query] PCIe power management with designware Kishon Vijay Abraham I
@ 2015-05-05 13:03 ` Pratyush Anand
  2015-05-05 13:23   ` Kishon Vijay Abraham I
  0 siblings, 1 reply; 3+ messages in thread
From: Pratyush Anand @ 2015-05-05 13:03 UTC (permalink / raw)
  To: Kishon Vijay Abraham I
  Cc: Arnd Bergmann, Bjorn Helgaas, linux-pci, linux-kernel,
	Jingoo Han, Mohit ST

Hi Kishon,

Correcting Mohit's ID

On Mon, May 4, 2015 at 9:54 PM, Kishon Vijay Abraham I <kishon@ti.com> wrote:
>
> Hi,
>
> I'm planning to add power management (suspend/resume) support for DRA7xx and have a query.
>
> The pci_pm_suspend_noirq callback being a bus pm_ops gets invoked late i.e after the suspend hooks of the pci devices (including the RC driver). The problem is after the 'suspend' of the RC driver, the clocks are disabled. Now

I think, clocks should not be disabled at this point.

pci_pm_suspend_noirq has a call to pci_save_state() which tries to access the
> configuration space registers. Since the clocks are disabled by now, this results in an abort. Shouldn't we do save_state() earlier?

So, RC driver should need to implement a pm->suspend_noirq() where it
can handle all these.

>
> After working around the above problem, I face one more issue with broadcom BCM95721 A211 card. After resuming, I'm unable to access the memory space. I'm not sure if that is specific to that particular card, since I have no problems with USB cards.

If you are able to access configuration space and  not able to access
memory space then that seems strange.
If cfg is also not accessible then can you check if link training with
BCM95721 A211 card was successful?

~Pratyush

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Query] PCIe power management with designware
  2015-05-05 13:03 ` Pratyush Anand
@ 2015-05-05 13:23   ` Kishon Vijay Abraham I
  0 siblings, 0 replies; 3+ messages in thread
From: Kishon Vijay Abraham I @ 2015-05-05 13:23 UTC (permalink / raw)
  To: Pratyush Anand
  Cc: Arnd Bergmann, Bjorn Helgaas, linux-pci, linux-kernel,
	Jingoo Han, Mohit ST

Hi Pratyush,

On Tuesday 05 May 2015 06:33 PM, Pratyush Anand wrote:

Thank you for responding.
> Hi Kishon,
>
> Correcting Mohit's ID
>
> On Mon, May 4, 2015 at 9:54 PM, Kishon Vijay Abraham I <kishon@ti.com> wrote:
>>
>> Hi,
>>
>> I'm planning to add power management (suspend/resume) support for DRA7xx and have a query.
>>
>> The pci_pm_suspend_noirq callback being a bus pm_ops gets invoked late i.e after the suspend hooks of the pci devices (including the RC driver). The problem is after the 'suspend' of the RC driver, the clocks are disabled. Now
>
> I think, clocks should not be disabled at this point.
>
> pci_pm_suspend_noirq has a call to pci_save_state() which tries to access the
>> configuration space registers. Since the clocks are disabled by now, this results in an abort. Shouldn't we do save_state() earlier?
>
> So, RC driver should need to implement a pm->suspend_noirq() where it
> can handle all these.

okay.. let me try that.
>
>>
>> After working around the above problem, I face one more issue with broadcom BCM95721 A211 card. After resuming, I'm unable to access the memory space. I'm not sure if that is specific to that particular card, since I have no problems with USB cards.
>
> If you are able to access configuration space and  not able to access
> memory space then that seems strange.
> If cfg is also not accessible then can you check if link training with
> BCM95721 A211 card was successful?

I'm able to access the configuration space. The pci core writes D0 to the pmcsr 
register of the card and I get

"tg3 0000:01:00.0: Refused to change power state, currently in D3".

After that in the resume callback of the card, when it tries to access the 
ethernet registers it hangs.

Thanks
Kishon

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-05-05 13:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-05-04 16:24 [Query] PCIe power management with designware Kishon Vijay Abraham I
2015-05-05 13:03 ` Pratyush Anand
2015-05-05 13:23   ` Kishon Vijay Abraham I

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.