From patchwork Mon Oct 25 12:16:34 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 12581685 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0D671C433EF for ; Mon, 25 Oct 2021 12:17:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id ECCAD60FE8 for ; Mon, 25 Oct 2021 12:17:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233221AbhJYMT4 (ORCPT ); Mon, 25 Oct 2021 08:19:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:56316 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233066AbhJYMTn (ORCPT ); Mon, 25 Oct 2021 08:19:43 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id CC02A61027; Mon, 25 Oct 2021 12:17:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1635164239; bh=YFwLRyGwAZtnL++iA+D5m4TYup42zCL/qnKUOAkiau0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tcAem/Oa4ouXbgBwyvGsBAbDs3XORSwVwDp0O8C6aTMznlsQ1v+foKJw/G2kZhKx3 FT8hIhkgnWxgufgCUYXNdUQk598fw9axFjVbAbXjlR9lgeQPRdHt5LlvRrN4xjwG/s MBH2IxZtoM5CjIXsRhaA3OQbanNwgjGgTCfGj04yBeeoAq5l7NlvzUxkEbi4zxXdbB iUHB8Np6mH+yEnNU7R3u5/bcAkCiJW/hIPuQkOMnODnjFWY/+sog0Lmb4NqdBI4lLQ gXQfObHDDwx+wLwuqRJdkA+8N97b+7S8cjIVR21SwdksArZmu40r7r7hX40UKmHlf+ 2FnNUZDwkff9w== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1meyuU-0001mF-Eu; Mon, 25 Oct 2021 14:17:02 +0200 From: Johan Hovold To: Sean Young , Mauro Carvalho Chehab Cc: Mike Isely , Ezequiel Garcia , linux-media@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold , stable@vger.kernel.org Subject: [PATCH 1/8] media: mceusb: fix control-message timeouts Date: Mon, 25 Oct 2021 14:16:34 +0200 Message-Id: <20211025121641.6759-2-johan@kernel.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211025121641.6759-1-johan@kernel.org> References: <20211025121641.6759-1-johan@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org USB control-message timeouts are specified in milliseconds and should specifically not vary with CONFIG_HZ. Fixes: 66e89522aff7 ("V4L/DVB: IR: add mceusb IR receiver driver") Cc: stable@vger.kernel.org # 2.6.36 Signed-off-by: Johan Hovold --- drivers/media/rc/mceusb.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/media/rc/mceusb.c b/drivers/media/rc/mceusb.c index e03dd1f0144f..7a8a889d54a2 100644 --- a/drivers/media/rc/mceusb.c +++ b/drivers/media/rc/mceusb.c @@ -1429,7 +1429,7 @@ static void mceusb_gen1_init(struct mceusb_dev *ir) */ ret = usb_control_msg(ir->usbdev, usb_rcvctrlpipe(ir->usbdev, 0), USB_REQ_SET_ADDRESS, USB_TYPE_VENDOR, 0, 0, - data, USB_CTRL_MSG_SZ, HZ * 3); + data, USB_CTRL_MSG_SZ, 3000); dev_dbg(dev, "set address - ret = %d", ret); dev_dbg(dev, "set address - data[0] = %d, data[1] = %d", data[0], data[1]); @@ -1437,20 +1437,20 @@ static void mceusb_gen1_init(struct mceusb_dev *ir) /* set feature: bit rate 38400 bps */ ret = usb_control_msg(ir->usbdev, usb_sndctrlpipe(ir->usbdev, 0), USB_REQ_SET_FEATURE, USB_TYPE_VENDOR, - 0xc04e, 0x0000, NULL, 0, HZ * 3); + 0xc04e, 0x0000, NULL, 0, 3000); dev_dbg(dev, "set feature - ret = %d", ret); /* bRequest 4: set char length to 8 bits */ ret = usb_control_msg(ir->usbdev, usb_sndctrlpipe(ir->usbdev, 0), 4, USB_TYPE_VENDOR, - 0x0808, 0x0000, NULL, 0, HZ * 3); + 0x0808, 0x0000, NULL, 0, 3000); dev_dbg(dev, "set char length - retB = %d", ret); /* bRequest 2: set handshaking to use DTR/DSR */ ret = usb_control_msg(ir->usbdev, usb_sndctrlpipe(ir->usbdev, 0), 2, USB_TYPE_VENDOR, - 0x0000, 0x0100, NULL, 0, HZ * 3); + 0x0000, 0x0100, NULL, 0, 3000); dev_dbg(dev, "set handshake - retC = %d", ret); /* device resume */ From patchwork Mon Oct 25 12:16:35 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 12581671 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 28E1FC43217 for ; Mon, 25 Oct 2021 12:17:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0A6BD60FDA for ; Mon, 25 Oct 2021 12:17:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233099AbhJYMTo (ORCPT ); Mon, 25 Oct 2021 08:19:44 -0400 Received: from mail.kernel.org ([198.145.29.99]:56216 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232524AbhJYMTm (ORCPT ); Mon, 25 Oct 2021 08:19:42 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B99D360EBD; Mon, 25 Oct 2021 12:17:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1635164239; bh=jS/E7TE701X7VYlN/n3rI+F5Vhr2sWyu6YfHE1Lk9Hk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bBlfBKzRnTaPJY7B4Pv1Tt3LSxovYLiad/+hREXqzz0VrnoQ/+AQ1fX6wmmD5JZNp kPyJ5KuzVevXMryOv8qjrq7oOUFOFK6bzQTWphXf8H9KRE/NAYZmDFWUgy3KNip2Qc hVigLSfYKrshER7tnlh5KyL/2ig54m7hhvZcare/WqSkfDjKcXK+qjeJ7GHgjNkiYA o/tkBObAGL6Qc6euAgfSFYrrJ5zFJbsRJ5idfatbNshiS0enwFRAJzGIKOptWidkY4 BNCGFY1xX4YkT/MPjYGQ2DD3ZbnVWayZCk3efKHE29b5vssTRd+Xra2f3r9jaEO97x cMS85OMowLZpA== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1meyuU-0001mH-HR; Mon, 25 Oct 2021 14:17:02 +0200 From: Johan Hovold To: Sean Young , Mauro Carvalho Chehab Cc: Mike Isely , Ezequiel Garcia , linux-media@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold , stable@vger.kernel.org Subject: [PATCH 2/8] media: redrat3: fix control-message timeouts Date: Mon, 25 Oct 2021 14:16:35 +0200 Message-Id: <20211025121641.6759-3-johan@kernel.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211025121641.6759-1-johan@kernel.org> References: <20211025121641.6759-1-johan@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org USB control-message timeouts are specified in milliseconds and should specifically not vary with CONFIG_HZ. Fixes: 2154be651b90 ("[media] redrat3: new rc-core IR transceiver device driver") Cc: stable@vger.kernel.org # 3.0 Signed-off-by: Johan Hovold --- drivers/media/rc/redrat3.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/media/rc/redrat3.c b/drivers/media/rc/redrat3.c index ac85464864b9..cb22316b3f00 100644 --- a/drivers/media/rc/redrat3.c +++ b/drivers/media/rc/redrat3.c @@ -404,7 +404,7 @@ static int redrat3_send_cmd(int cmd, struct redrat3_dev *rr3) udev = rr3->udev; res = usb_control_msg(udev, usb_rcvctrlpipe(udev, 0), cmd, USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN, - 0x0000, 0x0000, data, sizeof(u8), HZ * 10); + 0x0000, 0x0000, data, sizeof(u8), 10000); if (res < 0) { dev_err(rr3->dev, "%s: Error sending rr3 cmd res %d, data %d", @@ -480,7 +480,7 @@ static u32 redrat3_get_timeout(struct redrat3_dev *rr3) pipe = usb_rcvctrlpipe(rr3->udev, 0); ret = usb_control_msg(rr3->udev, pipe, RR3_GET_IR_PARAM, USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN, - RR3_IR_IO_SIG_TIMEOUT, 0, tmp, len, HZ * 5); + RR3_IR_IO_SIG_TIMEOUT, 0, tmp, len, 5000); if (ret != len) dev_warn(rr3->dev, "Failed to read timeout from hardware\n"); else { @@ -510,7 +510,7 @@ static int redrat3_set_timeout(struct rc_dev *rc_dev, unsigned int timeoutus) ret = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), RR3_SET_IR_PARAM, USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT, RR3_IR_IO_SIG_TIMEOUT, 0, timeout, sizeof(*timeout), - HZ * 25); + 25000); dev_dbg(dev, "set ir parm timeout %d ret 0x%02x\n", be32_to_cpu(*timeout), ret); @@ -542,32 +542,32 @@ static void redrat3_reset(struct redrat3_dev *rr3) *val = 0x01; rc = usb_control_msg(udev, rxpipe, RR3_RESET, USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN, - RR3_CPUCS_REG_ADDR, 0, val, len, HZ * 25); + RR3_CPUCS_REG_ADDR, 0, val, len, 25000); dev_dbg(dev, "reset returned 0x%02x\n", rc); *val = length_fuzz; rc = usb_control_msg(udev, txpipe, RR3_SET_IR_PARAM, USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT, - RR3_IR_IO_LENGTH_FUZZ, 0, val, len, HZ * 25); + RR3_IR_IO_LENGTH_FUZZ, 0, val, len, 25000); dev_dbg(dev, "set ir parm len fuzz %d rc 0x%02x\n", *val, rc); *val = (65536 - (minimum_pause * 2000)) / 256; rc = usb_control_msg(udev, txpipe, RR3_SET_IR_PARAM, USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT, - RR3_IR_IO_MIN_PAUSE, 0, val, len, HZ * 25); + RR3_IR_IO_MIN_PAUSE, 0, val, len, 25000); dev_dbg(dev, "set ir parm min pause %d rc 0x%02x\n", *val, rc); *val = periods_measure_carrier; rc = usb_control_msg(udev, txpipe, RR3_SET_IR_PARAM, USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT, - RR3_IR_IO_PERIODS_MF, 0, val, len, HZ * 25); + RR3_IR_IO_PERIODS_MF, 0, val, len, 25000); dev_dbg(dev, "set ir parm periods measure carrier %d rc 0x%02x", *val, rc); *val = RR3_DRIVER_MAXLENS; rc = usb_control_msg(udev, txpipe, RR3_SET_IR_PARAM, USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_OUT, - RR3_IR_IO_MAX_LENGTHS, 0, val, len, HZ * 25); + RR3_IR_IO_MAX_LENGTHS, 0, val, len, 25000); dev_dbg(dev, "set ir parm max lens %d rc 0x%02x\n", *val, rc); kfree(val); @@ -585,7 +585,7 @@ static void redrat3_get_firmware_rev(struct redrat3_dev *rr3) rc = usb_control_msg(rr3->udev, usb_rcvctrlpipe(rr3->udev, 0), RR3_FW_VERSION, USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN, - 0, 0, buffer, RR3_FW_VERSION_LEN, HZ * 5); + 0, 0, buffer, RR3_FW_VERSION_LEN, 5000); if (rc >= 0) dev_info(rr3->dev, "Firmware rev: %s", buffer); @@ -825,14 +825,14 @@ static int redrat3_transmit_ir(struct rc_dev *rcdev, unsigned *txbuf, pipe = usb_sndbulkpipe(rr3->udev, rr3->ep_out->bEndpointAddress); ret = usb_bulk_msg(rr3->udev, pipe, irdata, - sendbuf_len, &ret_len, 10 * HZ); + sendbuf_len, &ret_len, 10000); dev_dbg(dev, "sent %d bytes, (ret %d)\n", ret_len, ret); /* now tell the hardware to transmit what we sent it */ pipe = usb_rcvctrlpipe(rr3->udev, 0); ret = usb_control_msg(rr3->udev, pipe, RR3_TX_SEND_SIGNAL, USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN, - 0, 0, irdata, 2, HZ * 10); + 0, 0, irdata, 2, 10000); if (ret < 0) dev_err(dev, "Error: control msg send failed, rc %d\n", ret); From patchwork Mon Oct 25 12:16:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 12581675 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2DF23C4332F for ; Mon, 25 Oct 2021 12:17:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1178560C49 for ; Mon, 25 Oct 2021 12:17:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233121AbhJYMTq (ORCPT ); Mon, 25 Oct 2021 08:19:46 -0400 Received: from mail.kernel.org ([198.145.29.99]:56240 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233050AbhJYMTm (ORCPT ); Mon, 25 Oct 2021 08:19:42 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C0C0A60C49; Mon, 25 Oct 2021 12:17:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1635164239; bh=7d3GsoZlk7VxSqbdvZGXBxZwrd/QRiQTPgUG8+Yg36Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=sJuFDCmMbtIHZTS6fpsu9QARRxvWZtDx2+Sy5BQO7MYqD3K7Ljjp3+Jk4u0bdnyFi aF/4YTxnI+nrKx4UUEdWw5ocP6anMD+KPCVeSDROndKEfZ/RCQJ9sKDaZcYFiSpWLq sOuUlUYgLzGPwI3QEbMPSieG8MWNL6N0cOvf2ADqai+PyMAo39DyMoBZWxH1cO63S0 VfXutzfrQgb/aRWySt9LVl3vfQ6zcndID/gfldXY2mJetEe1EaF4hh+Fw8xTAAulHw F3g422SPIRgiuK94U8pZ0Ludw0llSyBXaD9KldM6y/KEeM6zdeXP8wt7CVr7z9eQg3 hIDM3iArvkupw== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1meyuU-0001mJ-Jt; Mon, 25 Oct 2021 14:17:02 +0200 From: Johan Hovold To: Sean Young , Mauro Carvalho Chehab Cc: Mike Isely , Ezequiel Garcia , linux-media@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold , stable@vger.kernel.org Subject: [PATCH 3/8] media: flexcop-usb: fix control-message timeouts Date: Mon, 25 Oct 2021 14:16:36 +0200 Message-Id: <20211025121641.6759-4-johan@kernel.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211025121641.6759-1-johan@kernel.org> References: <20211025121641.6759-1-johan@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org USB control-message timeouts are specified in milliseconds and should specifically not vary with CONFIG_HZ. Note that the driver was multiplying some of the timeout values with HZ twice resulting in 3000-second timeouts with HZ=1000. Also note that two of the timeout defines are currently unused. Fixes: 2154be651b90 ("[media] redrat3: new rc-core IR transceiver device driver") Cc: stable@vger.kernel.org # 3.0 Signed-off-by: Johan Hovold --- drivers/media/usb/b2c2/flexcop-usb.c | 10 +++++----- drivers/media/usb/b2c2/flexcop-usb.h | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers/media/usb/b2c2/flexcop-usb.c b/drivers/media/usb/b2c2/flexcop-usb.c index 5d38171b7638..bfeb92d93de3 100644 --- a/drivers/media/usb/b2c2/flexcop-usb.c +++ b/drivers/media/usb/b2c2/flexcop-usb.c @@ -87,7 +87,7 @@ static int flexcop_usb_readwrite_dw(struct flexcop_device *fc, u16 wRegOffsPCI, 0, fc_usb->data, sizeof(u32), - B2C2_WAIT_FOR_OPERATION_RDW * HZ); + B2C2_WAIT_FOR_OPERATION_RDW); if (ret != sizeof(u32)) { err("error while %s dword from %d (%d).", read ? "reading" : @@ -155,7 +155,7 @@ static int flexcop_usb_v8_memory_req(struct flexcop_usb *fc_usb, wIndex, fc_usb->data, buflen, - nWaitTime * HZ); + nWaitTime); if (ret != buflen) ret = -EIO; @@ -248,13 +248,13 @@ static int flexcop_usb_i2c_req(struct flexcop_i2c_adapter *i2c, /* DKT 020208 - add this to support special case of DiSEqC */ case USB_FUNC_I2C_CHECKWRITE: pipe = B2C2_USB_CTRL_PIPE_OUT; - nWaitTime = 2; + nWaitTime = 2000; request_type |= USB_DIR_OUT; break; case USB_FUNC_I2C_READ: case USB_FUNC_I2C_REPEATREAD: pipe = B2C2_USB_CTRL_PIPE_IN; - nWaitTime = 2; + nWaitTime = 2000; request_type |= USB_DIR_IN; break; default: @@ -281,7 +281,7 @@ static int flexcop_usb_i2c_req(struct flexcop_i2c_adapter *i2c, wIndex, fc_usb->data, buflen, - nWaitTime * HZ); + nWaitTime); if (ret != buflen) ret = -EIO; diff --git a/drivers/media/usb/b2c2/flexcop-usb.h b/drivers/media/usb/b2c2/flexcop-usb.h index 2f230bf72252..c7cca1a5ee59 100644 --- a/drivers/media/usb/b2c2/flexcop-usb.h +++ b/drivers/media/usb/b2c2/flexcop-usb.h @@ -91,13 +91,13 @@ typedef enum { UTILITY_SRAM_TESTVERIFY = 0x16, } flexcop_usb_utility_function_t; -#define B2C2_WAIT_FOR_OPERATION_RW (1*HZ) -#define B2C2_WAIT_FOR_OPERATION_RDW (3*HZ) -#define B2C2_WAIT_FOR_OPERATION_WDW (1*HZ) +#define B2C2_WAIT_FOR_OPERATION_RW 1000 +#define B2C2_WAIT_FOR_OPERATION_RDW 3000 +#define B2C2_WAIT_FOR_OPERATION_WDW 1000 -#define B2C2_WAIT_FOR_OPERATION_V8READ (3*HZ) -#define B2C2_WAIT_FOR_OPERATION_V8WRITE (3*HZ) -#define B2C2_WAIT_FOR_OPERATION_V8FLASH (3*HZ) +#define B2C2_WAIT_FOR_OPERATION_V8READ 3000 +#define B2C2_WAIT_FOR_OPERATION_V8WRITE 3000 +#define B2C2_WAIT_FOR_OPERATION_V8FLASH 3000 typedef enum { V8_MEMORY_PAGE_DVB_CI = 0x20, From patchwork Mon Oct 25 12:16:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 12581679 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B43EAC43217 for ; Mon, 25 Oct 2021 12:17:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A26E860EBD for ; Mon, 25 Oct 2021 12:17:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233173AbhJYMTw (ORCPT ); Mon, 25 Oct 2021 08:19:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:56314 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233062AbhJYMTn (ORCPT ); Mon, 25 Oct 2021 08:19:43 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id D04906105A; Mon, 25 Oct 2021 12:17:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1635164239; bh=bHMyDNovNe9zehRCGFFe8UpbUFbhhC6sMj7mtZpO1qM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BmikNBtqhvCcR27Eb+ZkZ44xZ80+i+VWyTFaoTWyGxoEie0daNYfX+kfriVCzXgYx Cdq46dBQ31u1kdWPpNJPvgF1w8xDq1M+5rT7XcIzIOj7FEBf0qzDJ+kjdd9clPS10e epLD6Eb97oyy9WEj1c/jjYLIgfmHJUBheItJsjk6+FOU7TFNT3tDACXDJ7L2zHr4h5 +lyT7fA07dWTU9bPFLTx0e4lh67R2oklqd61TinbwQEjnHpP2p2JyDF/5VqrwCvZV/ A1xuqx0ukvV2VXGUwTSocPKavCTJ/o4wnjDH8VGp+zHFsCN0ug7ofvU3M8KPfI8HCx 0PaBkTR25Gv+A== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1meyuU-0001mM-MP; Mon, 25 Oct 2021 14:17:02 +0200 From: Johan Hovold To: Sean Young , Mauro Carvalho Chehab Cc: Mike Isely , Ezequiel Garcia , linux-media@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold , stable@vger.kernel.org Subject: [PATCH 4/8] media: cpia2: fix control-message timeouts Date: Mon, 25 Oct 2021 14:16:37 +0200 Message-Id: <20211025121641.6759-5-johan@kernel.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211025121641.6759-1-johan@kernel.org> References: <20211025121641.6759-1-johan@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org USB control-message timeouts are specified in milliseconds and should specifically not vary with CONFIG_HZ. Fixes: ab33d5071de7 ("V4L/DVB (3376): Add cpia2 camera support") Cc: stable@vger.kernel.org # 2.6.17 Signed-off-by: Johan Hovold --- drivers/media/usb/cpia2/cpia2_usb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/usb/cpia2/cpia2_usb.c b/drivers/media/usb/cpia2/cpia2_usb.c index 76aac06f9fb8..cba03b286473 100644 --- a/drivers/media/usb/cpia2/cpia2_usb.c +++ b/drivers/media/usb/cpia2/cpia2_usb.c @@ -550,7 +550,7 @@ static int write_packet(struct usb_device *udev, 0, /* index */ buf, /* buffer */ size, - HZ); + 1000); kfree(buf); return ret; @@ -582,7 +582,7 @@ static int read_packet(struct usb_device *udev, 0, /* index */ buf, /* buffer */ size, - HZ); + 1000); if (ret >= 0) memcpy(registers, buf, size); From patchwork Mon Oct 25 12:16:38 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 12581669 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1AAE2C433F5 for ; Mon, 25 Oct 2021 12:17:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F0A9060EBD for ; Mon, 25 Oct 2021 12:17:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233082AbhJYMTn (ORCPT ); Mon, 25 Oct 2021 08:19:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:56222 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232838AbhJYMTm (ORCPT ); Mon, 25 Oct 2021 08:19:42 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id BD1A060ED4; Mon, 25 Oct 2021 12:17:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1635164239; bh=L0WJ7+5+qewdB7If++5UO/OXlrBLv8K7CfrRjdsjZGM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=b0zhdSrm88MzrpZEGr47ltIFcbqARd7v3mGvuH+4Noqnnq4UfmCmzlFMeUGorDzBW G5DV0V/RKq9QB/NuvEtPhUDMlzORi/vRVVtIUW2sNuQyNfByhH3GFfHx16yJ0JCnRz p7VJJGYdayVmQR3KE0Y9eDJB+fiUY9gRC4qhwP/W8R1AlnvC19yGryLv3aEMHepsH2 W1NDrOKmK6kDoievkOhw0LWAlMcYmCU/mijoN66iHCQnuf08RJUysDKWz3LBblgFUb kQBR8I/wBJ6sNriOyUGB5Yw1TQ36pQ/pL8v1zCYgIm+gFU14TJf0f+Rv0gk5d42ewe OdpeaO5IlJboQ== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1meyuU-0001mP-Oa; Mon, 25 Oct 2021 14:17:02 +0200 From: Johan Hovold To: Sean Young , Mauro Carvalho Chehab Cc: Mike Isely , Ezequiel Garcia , linux-media@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold , stable@vger.kernel.org Subject: [PATCH 5/8] media: em28xx: fix control-message timeouts Date: Mon, 25 Oct 2021 14:16:38 +0200 Message-Id: <20211025121641.6759-6-johan@kernel.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211025121641.6759-1-johan@kernel.org> References: <20211025121641.6759-1-johan@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org USB control-message timeouts are specified in milliseconds and should specifically not vary with CONFIG_HZ. Fixes: a6c2ba283565 ("[PATCH] v4l: 716: support for em28xx board family") Cc: stable@vger.kernel.org # 2.6.16 Signed-off-by: Johan Hovold --- drivers/media/usb/em28xx/em28xx-core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/usb/em28xx/em28xx-core.c b/drivers/media/usb/em28xx/em28xx-core.c index 584fa400cd7d..f366bb47ec6d 100644 --- a/drivers/media/usb/em28xx/em28xx-core.c +++ b/drivers/media/usb/em28xx/em28xx-core.c @@ -89,7 +89,7 @@ int em28xx_read_reg_req_len(struct em28xx *dev, u8 req, u16 reg, mutex_lock(&dev->ctrl_urb_lock); ret = usb_control_msg(udev, pipe, req, USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, - 0x0000, reg, dev->urb_buf, len, HZ); + 0x0000, reg, dev->urb_buf, len, 1000); if (ret < 0) { em28xx_regdbg("(pipe 0x%08x): IN: %02x %02x %02x %02x %02x %02x %02x %02x failed with error %i\n", pipe, @@ -158,7 +158,7 @@ int em28xx_write_regs_req(struct em28xx *dev, u8 req, u16 reg, char *buf, memcpy(dev->urb_buf, buf, len); ret = usb_control_msg(udev, pipe, req, USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, - 0x0000, reg, dev->urb_buf, len, HZ); + 0x0000, reg, dev->urb_buf, len, 1000); mutex_unlock(&dev->ctrl_urb_lock); if (ret < 0) { From patchwork Mon Oct 25 12:16:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 12581673 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1FAD0C433F5 for ; Mon, 25 Oct 2021 12:17:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0AE4D60555 for ; Mon, 25 Oct 2021 12:17:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232838AbhJYMTp (ORCPT ); Mon, 25 Oct 2021 08:19:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:56208 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232455AbhJYMTm (ORCPT ); Mon, 25 Oct 2021 08:19:42 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B5C0460555; Mon, 25 Oct 2021 12:17:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1635164239; bh=UB12+Dycc6GEIdWE3BW/yQ4o2454bP5RnbmKCx2jaAY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=o14BBX8D0y4R5IVly34dWIXF7bWeZrdPavDEd/uGhfq/F4QY7aDHf6G4VTgud4/al wE1uOU4B+V5/pdT69qEWbwXQnlhBt4yKO4DI7HZkWLx01Iu3NSMO7hHptq9ol58YkO A9fiByuivwuIZyATw3Fev5vl85uaK6BIVcl4tf17iyam4RV5W1nA+jWIkfR9JwqRAq ml8Ohnm3NCEtKrv360kHOKsJLgNB0SUh/1WvTpuHOWuhO/IqAXcKsE6AusRpqFIajx vUjjd8n4rmVVk3kBxZYzzka6z6hktGZhb47rrZSjH2Ikpjhj2qVDdUFM4vAfWwMEZJ h39WoUhIuqLNQ== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1meyuU-0001mS-R8; Mon, 25 Oct 2021 14:17:02 +0200 From: Johan Hovold To: Sean Young , Mauro Carvalho Chehab Cc: Mike Isely , Ezequiel Garcia , linux-media@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold , stable@vger.kernel.org Subject: [PATCH 6/8] media: pvrusb2: fix control-message timeouts Date: Mon, 25 Oct 2021 14:16:39 +0200 Message-Id: <20211025121641.6759-7-johan@kernel.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211025121641.6759-1-johan@kernel.org> References: <20211025121641.6759-1-johan@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org USB control-message timeouts are specified in milliseconds and should specifically not vary with CONFIG_HZ. Fixes: d855497edbfb ("V4L/DVB (4228a): pvrusb2 to kernel 2.6.18") Cc: stable@vger.kernel.org # 2.6.18 Signed-off-by: Johan Hovold --- drivers/media/usb/pvrusb2/pvrusb2-hdw.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c index d38dee1792e4..3915d551d59e 100644 --- a/drivers/media/usb/pvrusb2/pvrusb2-hdw.c +++ b/drivers/media/usb/pvrusb2/pvrusb2-hdw.c @@ -1467,7 +1467,7 @@ static int pvr2_upload_firmware1(struct pvr2_hdw *hdw) for (address = 0; address < fwsize; address += 0x800) { memcpy(fw_ptr, fw_entry->data + address, 0x800); ret += usb_control_msg(hdw->usb_dev, pipe, 0xa0, 0x40, address, - 0, fw_ptr, 0x800, HZ); + 0, fw_ptr, 0x800, 1000); } trace_firmware("Upload done, releasing device's CPU"); @@ -1605,7 +1605,7 @@ int pvr2_upload_firmware2(struct pvr2_hdw *hdw) ((u32 *)fw_ptr)[icnt] = swab32(((u32 *)fw_ptr)[icnt]); ret |= usb_bulk_msg(hdw->usb_dev, pipe, fw_ptr,bcnt, - &actual_length, HZ); + &actual_length, 1000); ret |= (actual_length != bcnt); if (ret) break; fw_done += bcnt; @@ -3438,7 +3438,7 @@ void pvr2_hdw_cpufw_set_enabled(struct pvr2_hdw *hdw, 0xa0,0xc0, address,0, hdw->fw_buffer+address, - 0x800,HZ); + 0x800,1000); if (ret < 0) break; } @@ -3977,7 +3977,7 @@ void pvr2_hdw_cpureset_assert(struct pvr2_hdw *hdw,int val) /* Write the CPUCS register on the 8051. The lsb of the register is the reset bit; a 1 asserts reset while a 0 clears it. */ pipe = usb_sndctrlpipe(hdw->usb_dev, 0); - ret = usb_control_msg(hdw->usb_dev,pipe,0xa0,0x40,0xe600,0,da,1,HZ); + ret = usb_control_msg(hdw->usb_dev,pipe,0xa0,0x40,0xe600,0,da,1,1000); if (ret < 0) { pvr2_trace(PVR2_TRACE_ERROR_LEGS, "cpureset_assert(%d) error=%d",val,ret); From patchwork Mon Oct 25 12:16:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 12581681 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 66F58C433EF for ; Mon, 25 Oct 2021 12:17:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4DF0A60EBD for ; Mon, 25 Oct 2021 12:17:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233184AbhJYMTy (ORCPT ); Mon, 25 Oct 2021 08:19:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:56318 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233067AbhJYMTn (ORCPT ); Mon, 25 Oct 2021 08:19:43 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id CF6ED60FDA; Mon, 25 Oct 2021 12:17:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1635164239; bh=+dTGrFrFfzFxC5RMHG3/2ZpQrfugi52+1DYDtAvVEeo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=RIfsKSQLQP1dZ05cQkfZHeg0nxS58Qvb+URxY1sdA8VTasXl/Kes8SE4YcpwaYlRS XZYoOyBJPAaRkwfrlLDBiPp6YR4j/b6KE8+9pv/zWEyjDWgaEv1wNpwjl3OToNIlNP TUy3xx8l2dlm7+8MvSFwY3FxxAb+tbMQS7uoUAuPWnAovk2zO9qPKBkY4GgnhDfUta 9Wk3ZH3cKWkdl0mmujwSnxlOrgBCUlUijTVY84suinTpz1lgztRdfgR/oRKAdMb0U7 KA9YlLxLQ1drTinqh2Hf7ZjUmjoJwf+5YtiRAD2JOnmcaHSfTN1BhzyEJ7ZJ8Bx+Wr OBeeREaxi8O5A== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1meyuU-0001mW-Ty; Mon, 25 Oct 2021 14:17:02 +0200 From: Johan Hovold To: Sean Young , Mauro Carvalho Chehab Cc: Mike Isely , Ezequiel Garcia , linux-media@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold , stable@vger.kernel.org Subject: [PATCH 7/8] media: s2255: fix control-message timeouts Date: Mon, 25 Oct 2021 14:16:40 +0200 Message-Id: <20211025121641.6759-8-johan@kernel.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211025121641.6759-1-johan@kernel.org> References: <20211025121641.6759-1-johan@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org USB control-message timeouts are specified in milliseconds and should specifically not vary with CONFIG_HZ. Use the common control-message timeout define for the five-second timeouts. Fixes: 38f993ad8b1f ("V4L/DVB (8125): This driver adds support for the Sensoray 2255 devices.") Cc: stable@vger.kernel.org # 2.6.27 Signed-off-by: Johan Hovold --- drivers/media/usb/s2255/s2255drv.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/usb/s2255/s2255drv.c b/drivers/media/usb/s2255/s2255drv.c index 3b0e4ed75d99..acf18e2251a5 100644 --- a/drivers/media/usb/s2255/s2255drv.c +++ b/drivers/media/usb/s2255/s2255drv.c @@ -1882,7 +1882,7 @@ static long s2255_vendor_req(struct s2255_dev *dev, unsigned char Request, USB_TYPE_VENDOR | USB_RECIP_DEVICE | USB_DIR_IN, Value, Index, buf, - TransferBufferLength, HZ * 5); + TransferBufferLength, USB_CTRL_SET_TIMEOUT); if (r >= 0) memcpy(TransferBuffer, buf, TransferBufferLength); @@ -1891,7 +1891,7 @@ static long s2255_vendor_req(struct s2255_dev *dev, unsigned char Request, r = usb_control_msg(dev->udev, usb_sndctrlpipe(dev->udev, 0), Request, USB_TYPE_VENDOR | USB_RECIP_DEVICE, Value, Index, buf, - TransferBufferLength, HZ * 5); + TransferBufferLength, USB_CTRL_SET_TIMEOUT); } kfree(buf); return r; From patchwork Mon Oct 25 12:16:41 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 12581683 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EB3A4C433FE for ; Mon, 25 Oct 2021 12:17:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DA4FB60C49 for ; Mon, 25 Oct 2021 12:17:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233022AbhJYMT5 (ORCPT ); Mon, 25 Oct 2021 08:19:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:56320 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233070AbhJYMTn (ORCPT ); Mon, 25 Oct 2021 08:19:43 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id E477B6108C; Mon, 25 Oct 2021 12:17:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1635164240; bh=yeLLjKIkG2yxf3NFQJnoNHi8BdfnAnLKwOhTGVC/QpU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OwycEgIdGDVbktrnIz1VAXAi6iTQ0cmJb+s2STktxHn0zF3pZdhvVoKgIN8sYr/br +wWM2YuO/NnYh2v6154oqUMq4ZsKN5JhL1NBjLwLd+RivwFOyPDbT1dhUJa7031GLs bRuYvaYY6VdTRsyCbNFe3QRRKMtEywITulQBnp+HsWgHKy74bPTH8Kd59R+6Ps1Ep6 AcrKYQsuE9kACLLsxBmpyiuDp6nAoXtP+P9p16Low9QywVjtB+QOZDJUIFKflC0LDD bzTHPLcQt4PCCN9ZVUWXumKam3qh2aUSKWJjOFZzqGn62I2PYRxU4nSP/YtNVkKEl+ B961yX0lgIMfg== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1meyuV-0001mZ-0b; Mon, 25 Oct 2021 14:17:03 +0200 From: Johan Hovold To: Sean Young , Mauro Carvalho Chehab Cc: Mike Isely , Ezequiel Garcia , linux-media@vger.kernel.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold , stable@vger.kernel.org Subject: [PATCH 8/8] media: stk1160: fix control-message timeouts Date: Mon, 25 Oct 2021 14:16:41 +0200 Message-Id: <20211025121641.6759-9-johan@kernel.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211025121641.6759-1-johan@kernel.org> References: <20211025121641.6759-1-johan@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org USB control-message timeouts are specified in milliseconds and should specifically not vary with CONFIG_HZ. Fixes: 9cb2173e6ea8 ("[media] media: Add stk1160 new driver (easycap replacement)") Cc: stable@vger.kernel.org # 3.7 Signed-off-by: Johan Hovold --- drivers/media/usb/stk1160/stk1160-core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/media/usb/stk1160/stk1160-core.c b/drivers/media/usb/stk1160/stk1160-core.c index b4f8bc5db138..4e1698f78818 100644 --- a/drivers/media/usb/stk1160/stk1160-core.c +++ b/drivers/media/usb/stk1160/stk1160-core.c @@ -65,7 +65,7 @@ int stk1160_read_reg(struct stk1160 *dev, u16 reg, u8 *value) return -ENOMEM; ret = usb_control_msg(dev->udev, pipe, 0x00, USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE, - 0x00, reg, buf, sizeof(u8), HZ); + 0x00, reg, buf, sizeof(u8), 1000); if (ret < 0) { stk1160_err("read failed on reg 0x%x (%d)\n", reg, ret); @@ -85,7 +85,7 @@ int stk1160_write_reg(struct stk1160 *dev, u16 reg, u16 value) ret = usb_control_msg(dev->udev, pipe, 0x01, USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE, - value, reg, NULL, 0, HZ); + value, reg, NULL, 0, 1000); if (ret < 0) { stk1160_err("write failed on reg 0x%x (%d)\n", reg, ret);