Page MenuHomeFreeBSD

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

Authored by chandrakanth.patil_broadcom.com on Mar 19 2024, 11:37 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, May 4, 6:25 PM
Unknown Object (File)
Sat, Apr 20, 4:06 PM
Unknown Object (File)
Fri, Apr 19, 4:39 PM
Unknown Object (File)
Apr 1 2024, 12:06 AM
Unknown Object (File)
Mar 21 2024, 6:16 PM
Unknown Object (File)
Mar 20 2024, 4:30 PM
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

Lint
Lint Skipped
Unit
Tests Skipped

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.