Page MenuHomeFreeBSD

Add support for an array of hwresets
ClosedPublic

Authored by andrew on Nov 11 2022, 9:28 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Jan 24, 5:03 PM
Unknown Object (File)
Mon, Jan 23, 1:40 PM
Unknown Object (File)
Sun, Jan 8, 4:14 PM
Unknown Object (File)
Sat, Jan 7, 1:42 PM
Unknown Object (File)
Dec 13 2022, 3:58 AM
Unknown Object (File)
Dec 1 2022, 11:58 AM
Subscribers

Details

Summary

In some drivers we need to assert and deassert a group of hardware
resets in any order. To support this add a new hwreset_array that
manages all hwresets defined for a device.

Diff Detail

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

Event Timeline

sys/dev/extres/hwreset/hwreset_array.c
121

Wouldn't ENOMEM would be better ?

sys/dev/extres/hwreset/hwreset_array.c
121

It should be removed. I thought mallocarray could return NULL on overflow, but it calls panic.

manu added inline comments.
sys/dev/extres/hwreset/hwreset_array.c
121

Ok, good for me then.

This revision is now accepted and ready to land.Nov 11 2022, 9:51 AM

Remove unneeded NULL check

This revision now requires review to proceed.Nov 11 2022, 9:51 AM
This revision is now accepted and ready to land.Nov 11 2022, 10:00 AM
bz added a subscriber: bz.
bz added inline comments.
sys/dev/extres/hwreset/hwreset_array.c
129

You don't need the { } and you could just for (; i >= 0; i--) probably?

mmel added a subscriber: mmel.

LGTM

This revision was automatically updated to reflect the committed changes.