Linux USB
 help / color / mirror / Atom feed
From: Oliver Neukum <oneukum@suse.com>
To: Keshav Verma <iganschel@gmail.com>, Greg KH <gregkh@linuxfoundation.org>
Cc: johan@kernel.org, kees@kernel.org, o.bock@fh-wolfenbuettel.de,
	linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] usb: misc: cypress_cy7c63: check control transfer status
Date: Fri, 10 Jul 2026 11:53:31 +0200	[thread overview]
Message-ID: <58b55e55-652a-498a-8f36-145d9ad58e9e@suse.com> (raw)
In-Reply-To: <CAPE_3z+DKGJ6yKGD=E5_T+9HCMeUnFBpWdjnB12Mt8UpU4Kquw@mail.gmail.com>

On 10.07.26 01:30, Keshav Verma wrote:
> read_port() currently ignores errors from vendor_command() and always
> returns the cached port value. This can report stale data when the USB
> control transfer fails or returns a short response.
> 
> Convert vendor_command() to usb_control_msg_recv(), which returns 0 on
> success and a negative errno on failure, and propagate transport errors
> from read_port() instead of returning cached data.

Hi,

Thank you for making a patch for this issue.
I am sorry, but this approach mixes issues that are real with something
that is not a problem.
  
> Fixes: 9189bfc2df0f ("[PATCH] USB: rename Cypress CY7C63xxx driver to
> proper name and fix up some tiny things")
> Signed-off-by: Keshav Verma <iganschel@gmail.com>
> ---
> v2:

> -       retval = usb_control_msg(dev->udev, pipe, request,
> -                                USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_OTHER,
> -                                address, data, iobuf, CYPRESS_MAX_REQSIZE,
> -                                USB_CTRL_GET_TIMEOUT);

This does return errors.

> -       /* we must not process garbage */
> -       if (retval < 2)
> +       dev_dbg(&dev->udev->dev, "Sending usb_control_msg_recv (data:
> %d)\n", data);
> +
> +       retval = usb_control_msg_recv(dev->udev, 0, request,

There is no point in this change. You just allocate yet another
buffer for no gain.

	Regards
		Oliver


  reply	other threads:[~2026-07-10  9:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-18 20:30 [PATCH] usb: misc: cypress_cy7c63: check control transfer status Keshav Verma
2026-07-08 15:15 ` Greg KH
2026-07-08 18:04   ` Keshav Verma
2026-07-09 23:30     ` Keshav Verma
2026-07-10  9:53       ` Oliver Neukum [this message]
2026-07-10 12:01         ` Keshav Verma
2026-07-10 12:06         ` Greg KH

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=58b55e55-652a-498a-8f36-145d9ad58e9e@suse.com \
    --to=oneukum@suse.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=iganschel@gmail.com \
    --cc=johan@kernel.org \
    --cc=kees@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=o.bock@fh-wolfenbuettel.de \
    /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