Linux kernel staging patches
 help / color / mirror / Atom feed
From: Aditya Chari S <adi25charis@gmail.com>
To: Dan Carpenter <error27@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Johan Hovold <johan@kernel.org>, Alex Elder <elder@kernel.org>,
	greybus-dev@lists.linaro.org, linux-staging@lists.linux.dev,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] greybus: usb: fix response buffer size for fixed-length hub requests
Date: Tue,  4 Aug 2026 05:21:55 +0530	[thread overview]
Message-ID: <20260803235155.356199-1-adi25charis@gmail.com> (raw)
In-Reply-To: <anbmj5m_fiASaOzK@stanley.mountain>

Hi Dan,

Before I go through your questions point by point, I want to flag
something that affects the confidence of the whole patch.

My rationale for hardcoding fixed sizes per request type
(GetHubDescriptor/GetHubStatus/GetPortStatus) was based on reasoning
from rh_call_control() alone, without checking how the actual Project
Ara module-side firmware behaves. I went and found the firmware at
github.com/projectara/, and the relevant file at
github.com/projectara/nuttx/blob/master/nuttx/drivers/greybus/usb.c,
gb_usb_hub_control(). It doesn't support the assumption I was making.
The module allocates its own response buffer purely from wLength and
passes wLength straight through to the hardware call:

	response = gb_operation_alloc_response(operation,
						sizeof(*response) + wLength);
	...
	status = device_usb_hcd_hub_control(usbdev, typeReq, wValue,
					     wIndex, (char*) response->buf,
					     wLength);

So it's deferential to wLength on both ends. I don't see evidence here
that the module would ever send back more data than wLength implied,
which was the scenario I described as the "impact" of the original
FIXME.

Given that, and given this driver has been unreachable at runtime for
11 years per commit a96493560cd1, I'd rather get your read on whether
this is worth pursuing further before I go answer the rest of your
review and send a v2. Happy to keep digging if you think it's still
worthwhile, or fine leaving the FIXME as-is otherwise.

Thanks,
Aditya

      reply	other threads:[~2026-08-10  2:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-03  1:02 [PATCH] greybus: usb: fix response buffer size for fixed-length hub requests Aditya Chari S
2026-08-08  5:46 ` Greg Kroah-Hartman
2026-08-08  8:19 ` Dan Carpenter
2026-08-03 23:51   ` Aditya Chari S [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=20260803235155.356199-1-adi25charis@gmail.com \
    --to=adi25charis@gmail.com \
    --cc=elder@kernel.org \
    --cc=error27@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=greybus-dev@lists.linaro.org \
    --cc=johan@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    /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