Microsemi / switchtec-kernel

A kernel module for the Microsemi PCIe switch
GNU General Public License v2.0
45 stars 31 forks source link

Fix a doorbell issue in the crosslink mode #115

Closed kelvin-cao closed 2 years ago

kelvin-cao commented 2 years ago

It was reported by a user that the on a crosslink platform where the local/crosslink partition ID are not 0/1, the link couldn't be brought up.

It turns out that the doorbell message registers MMAP on the crosslink partition were not programmed. The target partitions of messages of crosslink partition are defined in the MMAP register. Without programming, it happens to map to partition 0 which is normally the host partition ID.

To resolve this, we need to program the MMAP register of the crosslink partition. An intuitive approach is to let the host driver on the local switch to program the MMAP register of the corsslink partition. Unluckily, the driver is prohibited from accessing this register of other partitions on the same switch.

However, the driver is able to program the MMAP register on the other side of a crosslink. To get the partition info of the remote switch which is necessary for the programming, a new reserved LUT was added. And as some remote NT info can only be retrieved when the remote switch is ready (up and initialized by the driver), some reserved LUTs setup cannot be done during probing and are deferred to link negotiation.

kelvin-cao commented 2 years ago

Updated. Will update other forward declarations in another PR.

kelvin-cao commented 2 years ago

Updated per the review comments, thanks!