linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mchehab@kernel.org>
To: Takashi Iwai <tiwai@suse.de>
Cc: "Hans Verkuil" <hverkuil-cisco@xs4all.nl>,
	"Josef Möllers" <josef.moellers@suse.com>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] media: go7007: Fix URB type for interrupt handling
Date: Fri, 7 Feb 2020 09:49:09 +0100	[thread overview]
Message-ID: <20200207094909.7d5b744d@kernel.org> (raw)
In-Reply-To: <20200206154527.18171-1-tiwai@suse.de>

Em Thu,  6 Feb 2020 16:45:27 +0100
Takashi Iwai <tiwai@suse.de> escreveu:

> Josef reported that his old-and-good Plextor ConvertX M402U video
> converter spews lots of WARNINGs on the recent kernels, and it turned
> out that the device uses a bulk endpoint for interrupt handling just
> like 2250 board.
> 
> For fixing it, generalize the check with the proper verification of
> the endpoint instead of hard-coded board type check.
> 
> Fixes: 7e5219d18e93 ("[media] go7007: Fix 2250 urb type")
> Reported-and-tested-by: Josef Möllers <josef.moellers@suse.com>
> BugLink: https://bugzilla.suse.com/show_bug.cgi?id=1162583
> BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=206427
> Signed-off-by: Takashi Iwai <tiwai@suse.de>
> 
> ---
>  drivers/media/usb/go7007/go7007-usb.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/media/usb/go7007/go7007-usb.c b/drivers/media/usb/go7007/go7007-usb.c
> index ff2aa057c1fb..f889c9d740cd 100644
> --- a/drivers/media/usb/go7007/go7007-usb.c
> +++ b/drivers/media/usb/go7007/go7007-usb.c
> @@ -1044,6 +1044,7 @@ static int go7007_usb_probe(struct usb_interface *intf,
>  	struct go7007_usb *usb;
>  	const struct go7007_usb_board *board;
>  	struct usb_device *usbdev = interface_to_usbdev(intf);
> +	struct usb_host_endpoint *ep;
>  	unsigned num_i2c_devs;
>  	char *name;
>  	int video_pipe, i, v_urb_len;
> @@ -1140,7 +1141,8 @@ static int go7007_usb_probe(struct usb_interface *intf,
>  	if (usb->intr_urb->transfer_buffer == NULL)
>  		goto allocfail;
>  
> -	if (go->board_id == GO7007_BOARDID_SENSORAY_2250)
> +	ep = usb->usbdev->ep_in[4];

Hmm... why [4] above?

I mean, what other drivers do is something like:

	for (i = 0; i < intf->num_altsetting; i++) {
	   for (j = 0; j < intf->altsetting[i].desc.bNumEndpoints; j++) {
		ep = &intf->altsetting[i].endpoint[j].desc;
		/* some logic to check ep and change alt if needed */
	   }
        }

> +	if (usb_endpoint_type(&ep->desc) == USB_ENDPOINT_XFER_BULK)
>  		usb_fill_bulk_urb(usb->intr_urb, usb->usbdev,
>  			usb_rcvbulkpipe(usb->usbdev, 4),
>  			usb->intr_urb->transfer_buffer, 2*sizeof(u16),




Cheers,
Mauro

  reply	other threads:[~2020-02-07  8:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-06 15:45 [PATCH] media: go7007: Fix URB type for interrupt handling Takashi Iwai
2020-02-07  8:49 ` Mauro Carvalho Chehab [this message]
2020-02-07  8:55   ` Takashi Iwai

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=20200207094909.7d5b744d@kernel.org \
    --to=mchehab@kernel.org \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=josef.moellers@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=tiwai@suse.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;
as well as URLs for NNTP newsgroup(s).