From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f170.google.com (mail-pf1-f170.google.com [209.85.210.170]) (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 0D9C7382F34 for ; Tue, 3 Mar 2026 06:25:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772519140; cv=none; b=E5wwDCD2Bju42w3+STx9ijnCyb6x8jB3fjZjeQDHbC291j537TJvBpWnjcj7gqABaqL/PrZdOMWwfvjWb76QVIw6l4hOHmPTvi4Pfs3qbulfKszpgiXjUS0uU1BvWp6WfyKgAHHjQIhEKwg7xwkOsczcbKMIYXxviYIlZtrJ5ww= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1772519140; c=relaxed/simple; bh=dK+ebb0OCKam9KhnoBJWwe5bZzYkUi5zMvll7j1WeC8=; h=Message-ID:Date:MIME-Version:Subject:To:References:From: In-Reply-To:Content-Type; b=GvXPsw8Rz459E8OVlfYUJEOmRFnzOXWQOtoF//+QDABDhbL2Zn+Yg+monVe5P84B6Z84g4ul6OENyKAlN3JAohxlSfInjpMz04J45nbcfGhf+0mZDIW4EX0MK14DVTAQcsDC5cmygs2xibAjKn+sqr7hkxkiQaIoSXl5evCJdmg= 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=Xp3Upk3r; arc=none smtp.client-ip=209.85.210.170 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="Xp3Upk3r" Received: by mail-pf1-f170.google.com with SMTP id d2e1a72fcca58-8273e0fb87aso2847077b3a.1 for ; Mon, 02 Mar 2026 22:25:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=beagleboard-org.20230601.gappssmtp.com; s=20230601; t=1772519137; x=1773123937; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:user-agent:mime-version:date:message-id:from :to:cc:subject:date:message-id:reply-to; bh=awWvbxbqWZOi7iUXZcv03886VYfqd33I7rMD6sOXCcU=; b=Xp3Upk3rBIj6czq55iamJmDZnm5CpyjDSbQy0CzxpIo/DWq6V5JWYYEk40P6cvTQ3V XUHlqd5pG4yeVUaGNcdTJQrwAn6RcYNeTUE+KdP1dddXAJTtIAUgkwNJ+DAb9xsvEr+f iG4aa4maBFYzMK6j7GY9pQZmJVPLNL5bVZqWCP/5g2IWBufplAn37wcE66cZbyQYbKTR xXCwfbD25Nm70u+J8sQFU0CgelLvq2kKwTE43l2VWycFepOcEVT3LbXJoqaEBhsNwGNL T52sCOj1UGsOcUC+NVdM3vIceeXYgkcQfvKcQQwXimDRVPAQv0Vs0xBFEYuEgIEQNOTm QTMg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1772519137; x=1773123937; h=content-transfer-encoding:in-reply-to:from:content-language :references:to: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=awWvbxbqWZOi7iUXZcv03886VYfqd33I7rMD6sOXCcU=; b=D+8Vv8EM5yCCJarf/nuFUnFuR0H0jcDlbnHOvYD1QNEHpDO6bjoeljx5GgYoN7sjKo sm+0br85f1mS74b4l0LOARlWbiH3x6Fmnk+jK4AoFIB2XoyyNUEsAC68mvmVTOUO6Acf o0cFP2A+9LhM9TbGezhsGRooXD1GC7EGbPxw82pTveDbcJ2MwTTneSVkXZPhl8XGkQQE AVibXIo5a34Az8qz+EksND8x2sLPzNzPtj12uzBQrn8xATVuE6sUV9YELrq1mcuYjUjT 8TgPPRXui7QZbsE6mItOxxvKifn007u5yhN1n4G6YDc+z0Q3z3SgdDQq6lPpbXUfEOAg iQVA== X-Forwarded-Encrypted: i=1; AJvYcCXxILXzMwYsAGwDyygSznYIh3q07TlaZqVPHwNXMhn2IwxD8pSj12TorWJiSKNdr/DwR77OQXu693QzO0c=@vger.kernel.org X-Gm-Message-State: AOJu0Yxez+nyYYAHW8gJHosQeIPXZg4rvJ24g31Vy4w/21EVgNl8fQPG YjReuhstdg4Pk2Bw2NFqyfZtMI0CknEVy1LKjaaOT4pxT0J0tx96BZ/vIOkEP6BL/g== X-Gm-Gg: ATEYQzzUKaczTlPIy92FrWfrtoB/hfY4XnLYhabs6PjSIA1U9PFQXVo3CZN9L/x+zoC H7+8bx3qziV/V/5zC+9s1YgLzY1YjQlSyZQkKvOAs+otF4GkJTaiu1D9UmHkJI5BYg3DO68AaNu pLvGdly0LtWBUjoQTnugXXUTvt7itPfbgSkK0pwYEO/yaE6EOCebp+z0kyFX6qZATEok3VGPkAi Aj0iSeDHkp/Mg14RzrjbcG2pBLRpmJFRRdLl5WDywBMiYI34hyNrUd0ockonT/Bat9yhFS5pp4k qarvedT6tR1DEt9QrIumZx+TUH1nqNQw4TN6TsIzXQ0KsZlqZcXKnkqwZPKhiWgrPLcjXy2uXBQ Th7iPAjhCsSJin1sLNLD6P8GXzT3erBJsbuxJMcz0dyKcGGey7usV+SKy0DgYRGwq1bdosxxiCB zMAvYKYLzVemgZvJvbCjXsHsi72xxIQYE7yPGXWj/SwTzYSyZa1KDp01ji1f9IZA2iynkbbud16 A== X-Received: by 2002:a05:6a21:514:b0:387:dfb3:cd0a with SMTP id adf61e73a8af0-395c3b4e266mr15236439637.63.1772519137271; Mon, 02 Mar 2026 22:25:37 -0800 (PST) Received: from ?IPV6:2401:4900:8fef:99f2:f3b:1675:33cc:545a? ([2401:4900:8fef:99f2:f3b:1675:33cc:545a]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3599c3abb8dsm1147875a91.15.2026.03.02.22.25.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 02 Mar 2026 22:25:36 -0800 (PST) Message-ID: Date: Tue, 3 Mar 2026 11:55:33 +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 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 From: Ayush Singh In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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