Re: Why there is a refcnt check when we change configfs property

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Peter,


W dniu 04.04.2019 o 09:35, Peter Chen pisze:

Peter Chen <peter.chen@xxxxxxx> writes:
Hi Felipe,

Do you know why? In that case, I can't change property, eg changing
qmult at NCM like below:

mkdir functions/ncm.0
ln -s functions/ncm.0 configs/c.1
echo 10 > functions/ncm.0/qmult


<snip>


That check looks wrong to me. I think, we should prevent changes after cable is
already plugged, but if gadget state is NOTATTACHED, we should be able to
change qmult, mac address, etc.
Add Andrzej.

Andrzej, would you tell us why you introduce refcnt for driver's configfs opts? And why
it is needed to judge for "store" operation?


The reason is that a function can be linked to more than one
configuration. Imagine this sequence: you create a function,
set its parameters and then create a configuration. Then you
declare "I want this function in my configuration". You can
decide that you want that particular function instance because
you already know how it is configured and are fine with that
state. Think of it as a contract between the function and the
configuration.

Now, suppose some other configuration is created and in that
configuration a similar function is needed. The creator of that
other configuration might be tempted to modify the existing
and already used function (linked to a configuration), thus
breaking the contract between the function and the first
configuration.



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux