Page MenuHomeFreeBSD

mtw: Fix firmware loading and memory leaks
ClosedPublic

Authored by guest-seuros on Mon, Jun 15, 1:46 PM.
Referenced Files
F160164826: D57597.id179926.diff
Sun, Jun 21, 8:41 PM
F160057054: D57597.id179926.diff
Sat, Jun 20, 11:14 PM
Unknown Object (File)
Thu, Jun 18, 10:35 AM
Unknown Object (File)
Wed, Jun 17, 2:17 PM
Unknown Object (File)
Tue, Jun 16, 4:22 AM

Details

Summary
  • Skip firmware reload if MCU already initialized
  • Fix firmware_put() memory leaks on error paths
  • Increase MCU init timeout to 15 seconds
  • Use debug macros instead of device_printf for verbose output
  • Remove unused 'ret' variable
  • Fix space indentation to tabs per style(9)

Diff Detail

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

Event Timeline

Thanks for tagging me! I really only review docs side of things. The improvements in error messages looks good though! :P

I tagged you because of the style(9) changes. Some lines are pure indentation change.

Oh, thanks! Pure whitespace changes are very hard on downstreams, I think they prefer for us to separate them into a separate commit. @adrian, does that make sense here?

Got it, i will avoid doing them in other diffs.

PS: Those lines are going to be refactored in a followup, but i was good to get the feedback in this small change, than in a bigger one.

bz added inline comments.
sys/dev/usb/wlan/if_mtw.c
643–647

Given you mention style.9 I believe the | should go to the end of the previous line:

If you have to wrap a long statement, put the operator at the end of the
line.

In general I do understand why we write them this way though.

sys/dev/usb/wlan/if_mtw.c
643–647

Ah i see line 632.

Actually it's better, let me edit it.

adrian added a subscriber: drivers.

interesting, is there no way to force a firmware reload without just power cycling the device?
eg if i wanted to test two different firmware images by unloading and reloading the driver?

You can eject the usb via software, that will init a reset.

However this fix the usage of normal users that keep their wifi connected to an always powered usb port or hub.

This revision is now accepted and ready to land.Wed, Jun 17, 2:29 PM
This revision was automatically updated to reflect the committed changes.