Re: [PATCH v4 1/5] gadget: Introduce the notifier functions

From: Felipe Balbi
Date: Fri Oct 09 2015 - 17:19:35 EST



Hi,

Pavel Machek <pavel@xxxxxx> writes:
> HI!
>
>> > + int ret;
>> > +
>> > + mutex_lock(&gadget->lock);
>> > + ret = raw_notifier_chain_unregister(&gadget->nh, nb);
>>
>> Greg, this is the kind of thing I wanted to avoid adding more of.
>>
>> I was wondering if you would accept subsystems using kdbus for
>> this sort of notification. I'm okay waiting for kdbus for another
>> couple merge windows (if we have to) before that's merged, but
>> if we take this raw notifier approach now, we will end up having
>> to support it forever.
>>
>> Also, because soon enough we will have to support USB Power Delivery
>> with Type C connector, this is bound to change in the coming months.
>>
>> Frankly, I wanted all of this to be decided in userland with the
>> kernel just providing notification and basic safety checks (we don't
>> want to allow a bogus userspace daemon frying anybody's devices).
>>
>> How would you feel about that ?
>
> So init=/bin/bash boot no longer provides machine that charges itself?
>
> That would be bad. Traditionally, hardware controls battery charging,
> and if hardware needs some help, we should do it in kernel, to mask
> the difference from userspace.

this is a very valid point which I hadn't considered :-)

Seems like kernel it is, no matter how easy or how difficult it gets.

Mark, when can we try to have a discussion about how to get this
upstream ? It seems like designing everything in the mailing list will
just take forever. Any ideas ?

--
balbi

Attachment: signature.asc
Description: PGP signature