From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 590D0322C99 for ; Sat, 28 Mar 2026 03:35:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774668946; cv=none; b=qYMUETFO8dg7fyQJjELdN1QSxmIGqlBhCNyPizMXusHVIo4IMr+FzqWmudKyndsAzdT3jqf/ruBWTGa7FAgW225544FchdzLHYRp1IVM9g2ZWfZsLi7G7RAb73Tjj3Ox0wD83qmy5anewpZ3Dtj7vaBLHmM+EVAZl0P3vM6asgY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774668946; c=relaxed/simple; bh=dpugFxMV6wH5jguSb6V/AT8S037qRs4eL4eil3FyzVA=; h=Message-ID:Date:MIME-Version:Subject:From:To:References: In-Reply-To:Content-Type; b=gks1lXd09tfWpyWgx9R2D+NxhnrbmEEM3WRYKYWJv3WdHFFGoDdNrOg2E1f+B6eJOW7tl78Wz+mOldt+t53BA941dgkcdpUMV+MKBmXYCNASx2SwYE6obit4w7/Plj++LhIhmAmdNbBILw6Qg2YsFjEYlsIhPk/SVysDiavOi1k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=beagleboard.org; spf=fail smtp.mailfrom=beagleboard.org; dkim=pass (2048-bit key) header.d=beagleboard-org.20230601.gappssmtp.com header.i=@beagleboard-org.20230601.gappssmtp.com header.b=3BP+lB2/; arc=none smtp.client-ip=209.85.214.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=beagleboard.org Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=beagleboard.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=beagleboard-org.20230601.gappssmtp.com header.i=@beagleboard-org.20230601.gappssmtp.com header.b="3BP+lB2/" Received: by mail-pl1-f177.google.com with SMTP id d9443c01a7336-2aecefc7503so18880695ad.1 for ; Fri, 27 Mar 2026 20:35:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=beagleboard-org.20230601.gappssmtp.com; s=20230601; t=1774668944; x=1775273744; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:references :to:from:subject:user-agent:mime-version:date:message-id:from:to:cc :subject:date:message-id:reply-to; bh=lWna6sVKl32nDxZHzGV9KUgrpYbWwTlBdvFmTQfz2NU=; b=3BP+lB2/a8HQbf4jTL0Apw8SSt0gUzPR37sQDF39nfExYh787Ru6uR7kFifI0mxoQy H9mRJxZL1wT4Bx+EQfFDX59e3ZtniNI4fxGf0gvrnLFjyEcWWWwMuPQXrM0wSJ8HvjSt PyRWXtZLo89F30OZg1yr1wZAZPgnpBFdDVu/niuqr0WB623DO8Ur48SwMXlYpBdkP5b2 bw3jxwhhdrKNSQisg12BnhqI0zMj7J6GHmYudGBtRoQCGrMXyK5Ad8eT5D//bQnwtprQ 17EcIpN+Ie0Kn7pbQguZd66c2vj697FZZpE6bzayioLtQkTxbJSFj+hb9OvoYt/6qwh7 ccng== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774668944; x=1775273744; h=content-transfer-encoding:in-reply-to:content-language:references :to:from:subject:user-agent:mime-version:date:message-id:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=lWna6sVKl32nDxZHzGV9KUgrpYbWwTlBdvFmTQfz2NU=; b=ltBwwn4MThogfNCuJgs787kUTlhMz7sVi1XGAKHux76kMgbkPFOad63I2kATwH7CCr 8DrFskDJpQshlOZBp0yeLIZUcKWLZ6iAmC+bR7tM6l9mw09+cc/r67IyJjREB8+5iHga F6DDFGcYBP+ddwNQr8+vJyeRFgIt/VEjsPZy68Oby+2Nsja+Giqr5khU+OG+3yKmoP2U f4gWvEWo/s92HocuWMnK3AMQsiTuB438fqjMl9fN64YmpJJWteyFpXvPiw9rE3LYJXBH YesqWxyMAHKvdRzZODoTd8TeE1xMNGWPW21Jm3LDZoP4/w7ftgYWgdnfCfCeNaQ6nXp8 mRhQ== X-Forwarded-Encrypted: i=1; AJvYcCUvQ0yyNjBFphafOI7JGgWA4VxaQrCwF9iyeboMvD8N6ijok8sDrW/P4abzWsRNFqvaVnkfyEE9I+nChgs=@vger.kernel.org X-Gm-Message-State: AOJu0YyuX40gHBUv6aepeirCQp77s+Qmcax8uX2xQhs1O+a4XFSULkSx ++lqP5afk0N4LA6EcRjtdieM+QMQVSQTL9+YPRSf9jn9o1VzMJb/A9DkXXgXUxoWfQ== X-Gm-Gg: ATEYQzyY1/S4RNW2scCiAaz4ET6fwEuJqW9KcfU8zlEUE3OHfW9FfGk7fDcCjOOrs5b 37p5Sf/3RRanspoR8mXr66rRCtqidL1KVmKG8ls7dlIZyHsBTgdZeNltuEdUE/4akgzcWwTZjAK wGd5PbChsL5IXWzqBkSHFBLNuJShMM+1Gj52WLZnnoXnK+55v2xRvCHkuVeoIbAhNQPQFyw/nuV gdL1M9lX82fk/MkevQvmcOeeDO5BZcrsCEmilgKnPdNdlYrWEIhiYGOXYGDWe2H955JmiTuUCfB B8b1PR/BqA41kpg8kYIA1WaGP7olbI1mcT9G928RwmY7C0iVIAWNnUrclt8flsMAkHyr9JAC1tm +TllED3xwpOT649G9L4bMwMcStNlWKJ/M43V4eVovLOIzZes+odMou3lQzNQIkkpDulrV49Jl2e Zr/f6GxofZ9Z7meBIly//3fC8hxknbyusEtch1d8TTeBCaefSQacHhvsm4vW9QNR+o3H9FnQdm/ mVtF7HlKecQ X-Received: by 2002:a17:902:f650:b0:2b0:65e8:4041 with SMTP id d9443c01a7336-2b0cdcb73e2mr52668905ad.36.1774668944507; Fri, 27 Mar 2026 20:35:44 -0700 (PDT) Received: from ?IPV6:2401:4900:8fec:e3ec:5a4:f3f9:d03a:d2e3? ([2401:4900:8fec:e3ec:5a4:f3f9:d03a:d2e3]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2b24264286fsm8543415ad.14.2026.03.27.20.35.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 27 Mar 2026 20:35:44 -0700 (PDT) Message-ID: <10112f89-fbfd-4f1c-afe3-b68e56c9ba2c@beagleboard.org> Date: Sat, 28 Mar 2026 09:05:40 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC] greybus: support combined Host + SVC From: Ayush Singh To: =?UTF-8?Q?Damien_Ri=C3=A9gel?= , "moderated list:GREYBUS SUBSYSTEM" , open list , Johan Hovold , Alex Elder , linux-devel@silabs.com, Jason Kridner , Deepak Khatri References: Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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