Microsemi / switchtec-kernel

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

Read out error code when FW return STATUS_ERROR for MRPC command #86

Closed xyan264 closed 4 years ago

xyan264 commented 4 years ago

If an error is encountered when executing the MRPC command, firmware will set SWITCHTEC_MRPC_STATUS_ERROR and return the error code in return value register. We return this error code along with error number -ECOMM.

This fix does the same as in switchtec_user PR#190, except in PR190, the fix applies to I2C and UART devices, while this fix is for In-Band device.

Note the new ECOMM error number, later switchtec-user will add check for this error code and read out the error number as well. -- See switchtec-user PR#191

xyan264 commented 4 years ago

Updated. @lsgunth please take a look.

kelvin-cao commented 4 years ago

We shouldn't return a new error code to the user code and update user code for it. Instead, we should treat the SWITCHTEC_MRPC_STATUS_ERROR status as a special case of complete which indicates user to check return value, which also keep the compatibility.

Please review patch #87

xyan264 commented 4 years ago

Superseded by PR#87. Closed.