Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3586203pxb; Mon, 24 Jan 2022 12:53:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJz8sW6t2NQOW3+o0Ji1gsQR6KQA9bZEVj7rvYrSiZzaTrQz3FANT0p+jsIFOVgkBryCjMzR X-Received: by 2002:a17:902:6b05:b0:14a:b331:d07b with SMTP id o5-20020a1709026b0500b0014ab331d07bmr16042078plk.172.1643057597707; Mon, 24 Jan 2022 12:53:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643057597; cv=none; d=google.com; s=arc-20160816; b=E/yNx966f7qJIKMWSwmMyLLJ2QYc2arQ4M3O0cvcZZKqtPPnEt71ZRFkscANCXun4C QRZWaKiVLdvgbzrzjIfdTqWuQL6yq04lPOnayIz5UCQMyfLHafFf3x6c6CpRTVK7T6g4 811vR+yuq4Fr6w5bAvd+7cQvMwEZI8NAG+BKcjeYgDLZfZZn5si2JqRP4vpzi20TXu/G 9Z32eYvSEgqU0CvM2EVBrcFnfceHxRVJdUhMfARl238/jcAFE6gQBIyqeXt+m9KNDL8Y /8UM2mm7WxQ3ctoKkeL0n7Y8YrjG1leCKqvKkfTuS87TZYDTQy4OK42WTWyUCFSi83zL Xigg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=qYmOnFcNUYqSakXWOoqn84f/8gBVbfMrnKm5sMU9/GE=; b=vwLSS2ItaLlsZus44rcYxt95Q3/ahf7u/mTueomd2Qf6GvfhYG3iOlgAk1ZFoI/B09 ZTdfHWX34UX8SskUepW6KCuZUK07gCMSesbFPgON4CR6yXf2pcShngpeNPveX/SjyxF0 5H19Fg71gWFbRWjkAme0yjmpSYrZI/Z4bjoOQaMSSSbMWvId0F2F72KpLdsppUuM7Th+ q+QzBflaBxTJxdzx2WzVqG9a7m1tNnvqCelX9DB9IlxWULHIhdoMh079sDQhftsU0g/R /krI2QNHHjEoHoJCfmf5CuYpyR26z2UeTLNRZdRq7g0SY5ZK9JW9mdSbrzTnMTwqZ1yV lYkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="0RKhU/D0"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w10si328525pjk.113.2022.01.24.12.53.04; Mon, 24 Jan 2022 12:53:17 -0800 (PST) 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=@linuxfoundation.org header.s=korg header.b="0RKhU/D0"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378907AbiAXUKD (ORCPT + 99 others); Mon, 24 Jan 2022 15:10:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1351619AbiAXTwN (ORCPT ); Mon, 24 Jan 2022 14:52:13 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9378AC0617A4; Mon, 24 Jan 2022 11:25:04 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 32F4561317; Mon, 24 Jan 2022 19:25:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EFFBDC340E5; Mon, 24 Jan 2022 19:25:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643052303; bh=NK+mLdWP7UGRRHa1nOQH/HEHr/3rropPGAQJvjrO/bs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0RKhU/D0JG6p1U04dqz3xEOnZWSLqfsgz0hqqNT7cxu+r3ltiMUQimv+eJYAbdzIi a+4UsmLjNE0DH5yVVlZ5rm/gClDK4pghmKP2SUt3cdoZlF1yWibadAhUSYfbYfnC/x xr2zWOoJC+sHGr5/pi/GtqhmLLz65ji8uZrZejQc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Johan Hovold , Hans Verkuil , Mauro Carvalho Chehab Subject: [PATCH 5.4 015/320] media: flexcop-usb: fix control-message timeouts Date: Mon, 24 Jan 2022 19:39:59 +0100 Message-Id: <20220124183954.272091221@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183953.750177707@linuxfoundation.org> References: <20220124183953.750177707@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Johan Hovold commit cd1798a387825cc4a51282f5a611ad05bb1ad75f upstream. 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 Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Greg Kroah-Hartman --- drivers/media/usb/b2c2/flexcop-usb.c | 10 +++++----- drivers/media/usb/b2c2/flexcop-usb.h | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) --- 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(stru 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(str wIndex, fc_usb->data, buflen, - nWaitTime * HZ); + nWaitTime); if (ret != buflen) ret = -EIO; @@ -249,13 +249,13 @@ static int flexcop_usb_i2c_req(struct fl /* 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: @@ -282,7 +282,7 @@ static int flexcop_usb_i2c_req(struct fl wIndex, fc_usb->data, buflen, - nWaitTime * HZ); + nWaitTime); if (ret != buflen) ret = -EIO; --- 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,