Skip to content

Commit

Permalink
mpr(4) would fail to initialize the controller in some cases, making the
Browse files Browse the repository at this point in the history
attached storage devices inaccessible.

Obtained from: FreeBSD
  • Loading branch information
laffer1 committed Jun 21, 2023
1 parent 2169db0 commit af00742
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions sys/dev/mpr/mpr.c
Original file line number Diff line number Diff line change
Expand Up @@ -2794,8 +2794,9 @@ mpr_update_events(struct mpr_softc *sc, struct mpr_event_handle *handle,
bcopy(fullmask, (uint8_t *)&evtreq->EventMasks, 16);
}
#else
bcopy(sc->event_mask, (uint8_t *)&evtreq->EventMasks, sizeof(sc->event_mask));
for (i = 0; i < MPI2_EVENT_NOTIFY_EVENTMASK_WORDS; i++)
evtreq->EventMasks[i] = htole32(sc->event_mask[i]);
evtreq->EventMasks[i] = htole32(evtreq->EventMasks[i]);
#endif
cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE;
cm->cm_data = NULL;
Expand Down Expand Up @@ -2849,8 +2850,9 @@ mpr_reregister_events(struct mpr_softc *sc)
bcopy(fullmask, (uint8_t *)&evtreq->EventMasks, 16);
}
#else
bcopy(sc->event_mask, (uint8_t *)&evtreq->EventMasks, sizeof(sc->event_mask));
for (i = 0; i < MPI2_EVENT_NOTIFY_EVENTMASK_WORDS; i++)
evtreq->EventMasks[i] = htole32(sc->event_mask[i]);
evtreq->EventMasks[i] = htole32(evtreq->EventMasks[i]);
#endif
cm->cm_desc.Default.RequestFlags = MPI2_REQ_DESCRIPT_FLAGS_DEFAULT_TYPE;
cm->cm_data = NULL;
Expand Down

0 comments on commit af00742

Please sign in to comment.