Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1565761pxb; Tue, 26 Oct 2021 11:21:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzJHiKup9Q8YQXkLrxHEixJBaFzoxNncqtpx6ReBf8ylJWuf15K24VKrCTS07hWilr+Bv6w X-Received: by 2002:a05:6a00:1354:b0:44c:eb65:8570 with SMTP id k20-20020a056a00135400b0044ceb658570mr27842371pfu.34.1635272397039; Tue, 26 Oct 2021 11:19:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635272397; cv=none; d=google.com; s=arc-20160816; b=uy9Vhvw2SOXTrMerUeD/n4LYgMgHX9PS1oQNVnvqaBteIWXBI9Ta8NApD80s9OmH0h glOMEU/dyLrfbb3SyDRv73AYG+9s/gbgqeuKmcKOYBP6CwgARyu+7l7g+lIy485iC46j 43IqvkRmjjWzii8yDj1Cg46RuZZDGWdWu7CWOHngGlqIV1bt5z44Ty1uRTaydedaLKM/ DmbD+TvrYWBrdvR6i/DjDe++IClM9mSLlwQAmOR9gpOXxpRThQFJBG7oAfSgC4naPXlP ctYJUqZyuB/fOkq0F9H4gG4yV7HPFRB+QzNvtHa0u2wG02uhl4NtN/GpkT6dEsBddjc8 9UxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:organization :from:references:cc:to:subject:dkim-signature; bh=gyR6Y5zML/8XcUDh7lasBRDLMd8XPVpr28rgW41nJUc=; b=iDz/qnd5qoxGjzh5qz1oqgtl5SGDVXWfrYnZ9dlf8eTJb/eq+TqpapFULNLroqWupq 3wcSjTTbnGSnfZ7YeBw0M5kFtVb04hH5lQjs2zd7z5BxmbQjnnHQ4BvZ1ZcSBu3UlTMC egqpaGTTGAsZWEmybVP5BVpaRVKIsPQFyXX43+9yH9lhbAUlEZFLexVDWg9x5bM79iVx fF8ei/aXMfop4GrVdhNNm44EpqX+OCHzT6NYQlQ2EjfQay/4RMflcrG+1AJ0HvPl8k10 HhSQbPMIRyFfOjdgfwpArrI2FL1EAaAqjCUaGk8r/9BZpxT2ABMqzPfIrx5mQLyeKMUS qq7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mev.co.uk header.s=20190130-41we5z8j header.b=JpjX7COp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i3si11357728plr.144.2021.10.26.11.19.42; Tue, 26 Oct 2021 11:19:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@mev.co.uk header.s=20190130-41we5z8j header.b=JpjX7COp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236723AbhJZOi2 (ORCPT + 99 others); Tue, 26 Oct 2021 10:38:28 -0400 Received: from smtp122.ord1d.emailsrvr.com ([184.106.54.122]:44071 "EHLO smtp122.ord1d.emailsrvr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236737AbhJZOiK (ORCPT ); Tue, 26 Oct 2021 10:38:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mev.co.uk; s=20190130-41we5z8j; t=1635258945; bh=09DsGG934eAWsrYgTTEyogH6LDSB0Wo6kjXmpIsK7zo=; h=Subject:To:From:Date:From; b=JpjX7COpm49F29ojHTexC79WPHa556bgJ5jztCzQpSSC582AAjYzf2ZmZKKdHBw9Z svRdanUjfO+1Uo7MDJoKJFReOCwIIZdQ6wP4y8qp25/U8LE/G/rdPY2liRUPksdW8U Y5Aih6iGtHIgsYv08SkS+wlrY68w1s7buDSb5bNE= X-Auth-ID: abbotti@mev.co.uk Received: by smtp8.relay.ord1d.emailsrvr.com (Authenticated sender: abbotti-AT-mev.co.uk) with ESMTPSA id 05104C0184; Tue, 26 Oct 2021 10:35:44 -0400 (EDT) Subject: Re: [PATCH 5/5] comedi: vmk80xx: fix bulk and interrupt message timeouts To: Johan Hovold , H Hartley Sweeten Cc: Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org References: <20211025114532.4599-1-johan@kernel.org> <20211025114532.4599-6-johan@kernel.org> From: Ian Abbott Organization: MEV Ltd. Message-ID: Date: Tue, 26 Oct 2021 15:35:44 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <20211025114532.4599-6-johan@kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit X-Classification-ID: 2f3175d9-b0e8-4937-a8e3-a5d800e9b366-1-1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 25/10/2021 12:45, Johan Hovold wrote: > USB bulk and interrupt message timeouts are specified in milliseconds > and should specifically not vary with CONFIG_HZ. > > Note that the bulk-out transfer timeout was set to the endpoint > bInterval value, which should be ignored for bulk endpoints and is > typically set to zero. This meant that a failing bulk-out transfer > would never time out. > > Assume that the 10 second timeout used for all other transfers is more > than enough also for the bulk-out endpoint. > > Fixes: 985cafccbf9b ("Staging: Comedi: vmk80xx: Add k8061 support") > Fixes: 951348b37738 ("staging: comedi: vmk80xx: wait for URBs to complete") > Cc: stable@vger.kernel.org # 2.6.31 > Signed-off-by: Johan Hovold > --- > drivers/comedi/drivers/vmk80xx.c | 12 +++++++----- > 1 file changed, 7 insertions(+), 5 deletions(-) > > diff --git a/drivers/comedi/drivers/vmk80xx.c b/drivers/comedi/drivers/vmk80xx.c > index 9c56918e3b76..4b00a9ea611a 100644 > --- a/drivers/comedi/drivers/vmk80xx.c > +++ b/drivers/comedi/drivers/vmk80xx.c > @@ -91,6 +91,7 @@ enum { > #define IC6_VERSION BIT(1) > > #define MIN_BUF_SIZE 64 > +#define PACKET_TIMEOUT 10000 /* ms */ > > enum vmk80xx_model { > VMK8055_MODEL, > @@ -169,10 +170,11 @@ static void vmk80xx_do_bulk_msg(struct comedi_device *dev) > tx_size = usb_endpoint_maxp(devpriv->ep_tx); > rx_size = usb_endpoint_maxp(devpriv->ep_rx); > > - usb_bulk_msg(usb, tx_pipe, devpriv->usb_tx_buf, > - tx_size, NULL, devpriv->ep_tx->bInterval); > + usb_bulk_msg(usb, tx_pipe, devpriv->usb_tx_buf, tx_size, NULL, > + PACKET_TIMEOUT); > > - usb_bulk_msg(usb, rx_pipe, devpriv->usb_rx_buf, rx_size, NULL, HZ * 10); > + usb_bulk_msg(usb, rx_pipe, devpriv->usb_rx_buf, rx_size, NULL, > + PACKET_TIMEOUT); > } > > static int vmk80xx_read_packet(struct comedi_device *dev) > @@ -191,7 +193,7 @@ static int vmk80xx_read_packet(struct comedi_device *dev) > pipe = usb_rcvintpipe(usb, ep->bEndpointAddress); > return usb_interrupt_msg(usb, pipe, devpriv->usb_rx_buf, > usb_endpoint_maxp(ep), NULL, > - HZ * 10); > + PACKET_TIMEOUT); > } > > static int vmk80xx_write_packet(struct comedi_device *dev, int cmd) > @@ -212,7 +214,7 @@ static int vmk80xx_write_packet(struct comedi_device *dev, int cmd) > pipe = usb_sndintpipe(usb, ep->bEndpointAddress); > return usb_interrupt_msg(usb, pipe, devpriv->usb_tx_buf, > usb_endpoint_maxp(ep), NULL, > - HZ * 10); > + PACKET_TIMEOUT); > } > > static int vmk80xx_reset_device(struct comedi_device *dev) > Looks good, thanks! Reviewed-by: Ian Abbott -- -=( Ian Abbott || MEV Ltd. is a company )=- -=( registered in England & Wales. Regd. number: 02862268. )=- -=( Regd. addr.: S11 & 12 Building 67, Europa Business Park, )=- -=( Bird Hall Lane, STOCKPORT, SK3 0XA, UK. || www.mev.co.uk )=-