Linux USB
 help / color / mirror / Atom feed
From: Oliver Neukum <oneukum@suse.com>
To: pawell@cadence.com,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Mathias Nyman <mathias.nyman@intel.com>
Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] usb: xhci: Add support for eUSB2v2 1024-byte bulk packet size
Date: Mon, 27 Jul 2026 14:54:07 +0200	[thread overview]
Message-ID: <22bdd65d-efbc-4229-a66e-62ecedd6c0f1@suse.com> (raw)
In-Reply-To: <20260717-eusb2v2-packet-size-v1-1-67c611bd0c5b@cadence.com>



On 17.07.26 12:44, Pawel Laszczak via B4 Relay wrote:
> From: Pawel Laszczak <pawell@cadence.com>

[..]
> index 75e2bfd744a9..3b4f7aedd381 100644
> --- a/drivers/usb/core/message.c
> +++ b/drivers/usb/core/message.c
> @@ -2007,6 +2007,65 @@ int usb_set_wireless_status(struct usb_interface *iface,
>   }
>   EXPORT_SYMBOL_GPL(usb_set_wireless_status);
>   
> +/*
> + * eusb_update_max_packet - set or restore max packet size
> + * @udev: target device
> + * @cp: if NULL restore MPS to 512 else set 1024
> + *
> + * This request is specific to eUSB2v2.
> + * An eUSB2v2 peripheral will revert the maximum packet size to 512
> + * for bulk endpoints after bus reset, disconnect and deconfiguration.
> + * This function allows updating the max packet size for BULK endpoints
> + * to 1024 after above events.
> + */
> +static void eusb_update_max_packet(struct usb_device *udev, struct usb_host_config *cp)

This has interesting implications for error handling. The command
has to be redone before reset_resume() and post_reset().
Hence if this fails in these cases you'll change the packet size
behind a driver's back. The same happens if it initially failed
but succeeds before these two operations, only in the other direction.

IMHO if this operation fails before post_reset() or reset_resume(),
the driver will have to be unbound. Likewise if it had failed before
binding a driver, the failure has to be recorded and the command omitted
before post_reset() or reset_resume().

In any case, this function has to return errors.

	Regards
		Oliver



  parent reply	other threads:[~2026-07-27 12:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-17 10:44 [PATCH 0/3] usb: Add support for eUSB2v2 1024-byte Bulk MaxPacketSize Pawel Laszczak via B4 Relay
2026-07-17 10:44 ` [PATCH 1/3] usb: xhci: Add support for eUSB2v2 1024-byte bulk packet size Pawel Laszczak via B4 Relay
2026-07-26 18:41   ` Michal Pecio
2026-07-27 12:54   ` Oliver Neukum [this message]
2026-07-17 10:44 ` [PATCH 2/3] usb: gadget: composite: Support eUSB2v2 bulk MPS update request Pawel Laszczak via B4 Relay
2026-07-17 10:44 ` [PATCH 3/3] usb: cdns3: cdnsp: Enable eUSB2v2 1KB bulk packet capability Pawel Laszczak via B4 Relay

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=22bdd65d-efbc-4229-a66e-62ecedd6c0f1@suse.com \
    --to=oneukum@suse.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mathias.nyman@intel.com \
    --cc=pawell@cadence.com \
    /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