mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ayush Singh <ayush@beagleboard.org>
To: "Damien Riégel" <damien.riegel@silabs.com>,
	"moderated list:GREYBUS SUBSYSTEM" <greybus-dev@lists.linaro.org>,
	"open list" <linux-kernel@vger.kernel.org>,
	"Johan Hovold" <johan@kernel.org>,
	"Alex Elder" <elder@kernel.org>,
	linux-devel@silabs.com,
	"Jason Kridner" <jkridner@beagleboard.org>,
	"Deepak Khatri" <lorforlinux@beagleboard.org>
Subject: Re: [RFC] greybus: support combined Host + SVC
Date: Sat, 28 Mar 2026 09:05:40 +0530	[thread overview]
Message-ID: <10112f89-fbfd-4f1c-afe3-b68e56c9ba2c@beagleboard.org> (raw)
In-Reply-To: <f0b9f2d1-ffa8-4c22-b3be-8efde446dadf@beagleboard.org>

On 3/3/26 11:55 AM, Ayush Singh wrote:

> On 3/3/26 3:27 AM, Damien Riégel wrote:
>
>> On Sat Feb 28, 2026 at 8:47 AM EST, Ayush Singh wrote:
>>> 2. SVC per node
>>>
>>>      Each node implements its own SVC. Since an I²C slave cannot 
>>> initiate
>>> communication, the AP must already know the address of each SVC/module.
>>> This also seems inefficient when chaining multiple nodes.
>>>
>>> [...]
>>>
>>> 3. SVC/Bridge functionality inside the AP
>>>
>>>      For this use case, this seems to be the most practical option.
>>>
>>>      To clarify, I am not proposing any new data paths in the Greybus
>>> pipeline. The idea is to have a reusable an SVC/bridge implementation
>>> similar to what exists in greybus-zephyr [2][3], but hosted within 
>>> the AP.
>> We discussed internally at Silicon Labs of this solution to get rid of
>> the SVC on the device but haven't actually implemented it, good to know
>> that we were not alone. I think it's a great avenue to explore because
>> it keeps existing SVC code as is, so we keep a single data path in
>> Greybus' core while offering the capability to handle SVC requests on
>> the host.
>>
>> Just to help me get a better mental picture, in hd->message_send you
>> would either handle the message immediately if cport_id == 0, or convert
>> that cport_id to an (interface, intf_cport_id) and pass the message to
>> that interface's cport, something like that?
>>
>>      static int message_send(..., u16 cport_id, struct gb_message 
>> *msg, ...)
>>      {
>>          if (cport_id == GB_SVC_CPORT_ID) {
>>              return svc_bridge_handle_msg(msg);
>>          } else {
>>              struct connection *connection = 
>> svc_bridge_get_connection(cport_id);
>>              // ... or you could directly look up in hd->connections,
>>              // the whole list of connections is already there, so
>>         // no need to maintain another one separately
>>
>>              // somewhow convert connection->intf to an i2c address
>>              // and use connection->intf_cport_id to address the cport
>>              i2c_transfer(adap, msgs, 1);
>>          }
>>      }
>
> Yes, that's the basic idea. The APIs will probably look a bit 
> different, but let me see how much info linux greybus module already has.
>
>>>      ```
>>>          +-------------+                +-----------+
>>>          | AP / SVC    | <--- I2C --->  | Module    |
>>>          +-------------+                +-----------+
>>>                                          |
>>>                                          | +----------+
>>>                                          `-- I2C --->  | Module  |
>>> +----------+
>>>      ```
>> You mention in point 2 that i2c slaves cannot initiate communication, so
>> I wonder how you would emulate the "MODULE_INSERTED" that flows from SVC
>> to the AP. Would your HD poll the bus for connected modules and "send" a
>> MODULE_INSERTED for each of them?
>>
>> Besides that, I think it would work fine. I'll be happy to test and
>> review your patch when ready.
>>
>> Regards,
>> damien
>
>
> I am currently thinking of having a debugfs entry to manually add and 
> remove modules for the demo I am working on. Generally, I would prefer 
> not doing continuous polling on linux. But I am thinking of doing the 
> polling based discovery on the driver probe.
>
>
> Best Regards,
>
> Ayush Singh


I do have a working SVC kernel module now [0]. Need to brush up some 
things on I2C transport side, but the svc node code seems to be in good 
state. Tested with BeagleConnect Freedom running Greybus-Zephyr over I2C.


Best Regards,

Ayush Singh


[0]: 
https://github.com/Ayush1325/linux/blob/b4/gb-i2c-transport/drivers/greybus/svc_node.c


      reply	other threads:[~2026-03-28  3:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-28 13:47 Ayush Singh
2026-03-02 21:57 ` Damien Riégel
2026-03-03  6:25   ` Ayush Singh
2026-03-28  3:35     ` Ayush Singh [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=10112f89-fbfd-4f1c-afe3-b68e56c9ba2c@beagleboard.org \
    --to=ayush@beagleboard.org \
    --cc=damien.riegel@silabs.com \
    --cc=elder@kernel.org \
    --cc=greybus-dev@lists.linaro.org \
    --cc=jkridner@beagleboard.org \
    --cc=johan@kernel.org \
    --cc=linux-devel@silabs.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lorforlinux@beagleboard.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®