Page MenuHomeFreeBSD

sound: Stop building midi as a module
ClosedPublic

Authored by christos on Mon, Dec 8, 2:38 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Dec 29, 8:33 AM
Unknown Object (File)
Sun, Dec 28, 3:51 PM
Unknown Object (File)
Sat, Dec 27, 9:23 PM
Unknown Object (File)
Fri, Dec 26, 4:01 AM
Unknown Object (File)
Thu, Dec 25, 7:32 PM
Unknown Object (File)
Sat, Dec 20, 1:59 AM
Unknown Object (File)
Fri, Dec 19, 10:24 AM
Unknown Object (File)
Thu, Dec 18, 7:30 AM

Details

Summary

There is no reason for this. The midi functions are used by drivers
on-demand anyway. Use SYSINIT(9) instead to do the appropriate
(de-)initilizations.

Sponsored by: The FreeBSD Foundation
MFC after: 1 week

Diff Detail

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

Event Timeline

But now unload errors can't be reported.

But now unload errors can't be reported.

They will be reported by the driver or sound(4). This here functions essentially like pcm/sndstat.c, we just offer some functions to the drivers, this is not supposed to be a separate module, at least at this state.

I don't think it is a good idea to not build this as a module because this code will not be used by a large majority of hosts (although personally I'll appreciate to use MIDI on FreeBSD!).

Loading and unloading soundcard modules is convenient. Furthermore, using OSS modules requires to build "sound" as a module only, so why not doing the same for MIDI?

But now unload errors can't be reported.

They will be reported by the driver or sound(4). This here functions essentially like pcm/sndstat.c, we just offer some functions to the drivers, this is not supposed to be a separate module, at least at this state.

Are you saying that the EBUSY case in midi_sysuninit() can't happen? If so, it should be an assertion, if not then the change looks wrong since we are leaking objects in midi_devs.

But now unload errors can't be reported.

They will be reported by the driver or sound(4). This here functions essentially like pcm/sndstat.c, we just offer some functions to the drivers, this is not supposed to be a separate module, at least at this state.

Are you saying that the EBUSY case in midi_sysuninit() can't happen? If so, it should be an assertion, if not then the change looks wrong since we are leaking objects in midi_devs.

I eventually remove this in D54126, I just didn't want to make this a single patch because D54126 includes other changes which are not really related to this one.

I don't think it is a good idea to not build this as a module because this code will not be used by a large majority of hosts (although personally I'll appreciate to use MIDI on FreeBSD!).

Not building it as a module does not mean it will now be used more. In fact, it is right now now that this code is "used" without reason, because it gets automatically loaded with sound(4). Whereas, with this change, it will be executed only by the devices that support MIDI.

But now unload errors can't be reported.

They will be reported by the driver or sound(4). This here functions essentially like pcm/sndstat.c, we just offer some functions to the drivers, this is not supposed to be a separate module, at least at this state.

Are you saying that the EBUSY case in midi_sysuninit() can't happen? If so, it should be an assertion, if not then the change looks wrong since we are leaking objects in midi_devs.

I eventually remove this in D54126, I just didn't want to make this a single patch because D54126 includes other changes which are not really related to this one.

Ok, please consider though that patches should be self-contained. This patch introduces a bug and the next one fixes it. It would be better to just combine them.

This revision is now accepted and ready to land.Fri, Dec 12, 3:18 PM

But now unload errors can't be reported.

They will be reported by the driver or sound(4). This here functions essentially like pcm/sndstat.c, we just offer some functions to the drivers, this is not supposed to be a separate module, at least at this state.

Are you saying that the EBUSY case in midi_sysuninit() can't happen? If so, it should be an assertion, if not then the change looks wrong since we are leaking objects in midi_devs.

I eventually remove this in D54126, I just didn't want to make this a single patch because D54126 includes other changes which are not really related to this one.

Ok, please consider though that patches should be self-contained. This patch introduces a bug and the next one fixes it. It would be better to just combine them.

I know, the only reason was that I didn't want to create one big patch that does a bunch of things unrelated to each other. That being said, I can update the patch to handle the EBUSY case, do you think an assertion would be desirable here?

But now unload errors can't be reported.

They will be reported by the driver or sound(4). This here functions essentially like pcm/sndstat.c, we just offer some functions to the drivers, this is not supposed to be a separate module, at least at this state.

Are you saying that the EBUSY case in midi_sysuninit() can't happen? If so, it should be an assertion, if not then the change looks wrong since we are leaking objects in midi_devs.

I eventually remove this in D54126, I just didn't want to make this a single patch because D54126 includes other changes which are not really related to this one.

Ok, please consider though that patches should be self-contained. This patch introduces a bug and the next one fixes it. It would be better to just combine them.

I know, the only reason was that I didn't want to create one big patch that does a bunch of things unrelated to each other. That being said, I can update the patch to handle the EBUSY case, do you think an assertion would be desirable here?

I don't think it's worth the effort, presumably you plan to commit everything together? Mine was more of a general comment.

I don't think it's worth the effort, presumably you plan to commit everything together? Mine was more of a general comment.

Yes, they'll all get committed at once.

This revision was automatically updated to reflect the committed changes.