RE: [PATCH v3 4/8] pciehp: Don't disable the link permanently,during removal

From: Rajat Jain
Date: Wed Dec 18 2013 - 01:18:09 EST



> -----Original Message-----
> From: yhlu.kernel@xxxxxxxxx [mailto:yhlu.kernel@xxxxxxxxx] On Behalf Of
>
> On Tue, Dec 17, 2013 at 7:20 PM, Rajat Jain <rajatjain@xxxxxxxxxxx>
> wrote:
> >
> > Actually I did not understand the original problem and the solution in
> > the first place (so I also do not understand how might disabling of
> > presence detect notification help). If you can give more details on
> > the original problem that shall be great. Here is what I understood
> from the commit log:
> >
> > The believe the HW looks like this:
> >
> > PCIe port <----> Repeater <----> Device.
> >
> > An in addition there is the presence detect pin that is connected
> > directly from The port to the device. Now, when the device is plugged
> > out, the pin indicates No presence. But are you saying the PCIe link
> from port to repeater is still up?
>
> After the card is removed from the slot.
>
> PCIe port try to retrain the link to repeater, like the link will keep
> up and down.

I still did not understand the why would the PCIe port try to do so. Are you
Saying the repeater keeps on flapping the link? Nevertheless, I assume it is
due to some repeater bug (that you mention below) that I do not need to
understand.

>
> so the presence bit will keep report one card present and not present.
> that present bit should be OR of inband input and outband input.
> We check the outband input and it always report correctly.

Just a suggestion for a work around. I checked the manual of the PCIe switch
we use in our system (IDT 89HPES48H12G2), and it is possible at least in this
switch to control whether or not in-band is considered. An internal configuration
register says:

Presence Detect Control. This field controls the manner in which
presence of an adapter in a slot is reported to the hot-plug controller
associated with a downstream switch port.
0x0 - (both) Presence of an adapter in the slot is reported as the
logical âORâ of the receiver detect mechanism and the hotplug
presence detect input (PxPDN).
0x1 - (signal) Presence of an adapter in the slot is reported as the
state of the hot-plug presence detect input (PxPDN).
0x2 - (always) When selected, this mode always informs the hotplug
controller that an adapter is present.
0x3 - (never) When selected, this mode always informs the hotplug
controller that an adapter is not present.

May be some similar config may be present in the switch or the CPU that you use.

Just a random thought.

>
> According to HW guys and Intel, that should be bug of repeater.

Well, in that case I doubt if the patch will solve the problem. I think
Most likely the "card present / not present" messages may be replaced
By "link-up / link-down" messages. But I'd appreciate your testing.

Thanks,

Rajat

>
> Disable the link from pcie to repeater, likely to reset the repeater....
>
> Thanks
>
> Yinghai
>

èº{.nÇ+‰·Ÿ®‰­†+%ŠËlzwm…ébëæìr¸›zX§»®w¥Š{ayºÊÚë,j­¢f£¢·hš‹àz¹®w¥¢¸ ¢·¦j:+v‰¨ŠwèjØm¶Ÿÿ¾«‘êçzZ+ƒùšŽŠÝj"ú!¶iO•æ¬z·švØ^¶m§ÿðà nÆàþY&—