Page MenuHomeFreeBSD

mpi3mr: Adding FreeBSD OS Type to Fault/Reset Reason Code
ClosedPublic

Authored by chandrakanth.patil_broadcom.com on Mar 19 2024, 11:37 AM.
Tags
None
Referenced Files
Unknown Object (File)
Oct 18 2024, 8:45 PM
Unknown Object (File)
Oct 3 2024, 7:19 AM
Unknown Object (File)
Oct 2 2024, 10:28 PM
Unknown Object (File)
Sep 30 2024, 5:38 PM
Unknown Object (File)
Sep 30 2024, 11:44 AM
Unknown Object (File)
Sep 30 2024, 9:27 AM
Unknown Object (File)
Sep 30 2024, 4:46 AM
Unknown Object (File)
Sep 15 2024, 2:57 AM
Subscribers
None

Details

Summary

The driver is modified to add FreeBSD OS type in the upper nibble of the
fault/reset reason code for appropriate qualification of the reason code.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Mar 21 2024, 8:18 AM
sys/dev/mpi3mr/mpi3mr.c
1182โ€“1185

As I see, ioc_num is 8 bit, so I worry that shifting it by 20 bits may result in undefined behavior. BTW why 20 if reset_reason is 16 bit?

sys/dev/mpi3mr/mpi3mr.c
1182โ€“1185

If the LHS is 8 bits variable or if the value of ioc_num itself is assigned after shifting its value by 20 bits, then there would be an
undefined value. Here, ioc_num variable is RHS so shifting its value by 20 bits and assigning it to scratchpad_0, which is 32 bits is
fine right (the compiler will take care of typecasting it internally so no need to typecast it explicitly). The firmware requirement specifies
that bits 28-31 are reserved for the OS type (supporting up to 16 OSes), bits 20-27 are reserved for ioc_num (8 bits), bits 0-15 are reserved
for reset_reason, and bits 16-19 may be reserved for future use.