Re: [PATCH 4/4] PCI: imx: Add PME_Turn_Off support

From: Leonard Crestez
Date: Thu Oct 04 2018 - 09:20:26 EST


On Thu, 2018-10-04 at 10:59 +0200, Lucas Stach wrote:
> Am Montag, den 01.10.2018, 22:53 +0300 schrieb Leonard Crestez:
> > When the root complex suspends it must send a PME_Turn_Off TLP.
> > Implement this by asserting the "turnoff" reset.
> >
> > +static void imx6_pcie_pm_turnoff(struct imx6_pcie *imx6_pcie)
> > +{
> > + reset_control_assert(imx6_pcie->turnoff_reset);
> > + reset_control_deassert(imx6_pcie->turnoff_reset);
>
> I'm a bit surprised to see no timing requirements here. I would have
> expected that there is a minimum time from asserting the reset, so the
> turnoff message gets transmitted to the EP before the clocks are
> stopped.

According to the PCI standard after PME_Turn_Off is sent all components
must respond with PME_TO_Ack. There doesn't seem to be any bit exposed
to check if acks were received but the standard recommends a 1-10ms
timeout after which you should proceed anyway.

It seems the NXP vendor tree has an udelay(1000) which I missed, it
seems like an acceptable solution. Or maybe it should be msleep(10)?

--
Regards,
Leonard