Thread (3 messages) 3 messages, 2 authors, 2019-05-24

Re: [PATCH RFC] firmware: arm_scmi: Allow for better protocol extensibility

From: Florian Fainelli <f.fainelli@gmail.com>
Date: 2019-05-23 17:18:05
Also in: linux-clk, linux-hwmon, linux-pm, lkml

On 5/21/19 1:01 PM, Florian Fainelli wrote:
The SCMI specific allows implementors to define their custom protocols
in the 0x80-0xFF space. The current scmi_handle structure requires us to
extend the structure with a set of operations and associated private
data in a way that is not quite scaling well.

Create a 255 bytes structure that contains an opaque pointer to a set of
operations and private data and create two helper functions to retrieve
those based on the protocol identifier. Several options were considered,
like using a linked list but since we could be performance sensitive in
some paths, using an array was faster and simpler.

Convert all call sites to use either scmi_protocol_get_ops() or
scmi_protocol_get_info().

Signed-off-by: Florian Fainelli <f.fainelli@gmail.com>
On second thought, what I really need is private storage to the scmi_dev
(the consumer side), and not so much the protocol (provider) side.
Therefore using dev_{set,get}_drvadata() against scmi_device::dev should
be working just fine, and if we are concerned about another part of the
SCMI stack making use of that storage, we can always extend struct
scmi_device with a private cookie.
-- 
Florian

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help