Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3564794pxb; Mon, 24 Jan 2022 12:19:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJya2P2b7WHQYgQC8S1MF0gbnzam+235JoG/0/Q9ZKDM2F9SBvJOKSHuggyNqDjokynsWBHz X-Received: by 2002:a17:902:8492:b0:149:7c77:7254 with SMTP id c18-20020a170902849200b001497c777254mr15749454plo.19.1643055476964; Mon, 24 Jan 2022 12:17:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643055476; cv=none; d=google.com; s=arc-20160816; b=AweHL3tWCKQPBqboDyRrjxpknNqoBsBf/tsbgsYOUrv/qLmzhwa7Jn1dhWREAJuCqv M+2/U6ENkpIJOssf3a2mL3ZLx1Vxt7ICjCYoHyTEw5f4WVx0YbWBK1qL8c/JWEiec39v UlDL8tgTe9sBXiDuwmyIxswdyyZeyw3sz5lms8CC1GJKcTzwrJKSSxJYdpZr+b7uW6fH Y20sqmzNZGUyv8py5Hn0f9kr8rfvQ7yY8SM/UkDcSJ1shzFW585/3im4PjhJoaMlLIWj wa1hGUutiQUA2Dbv/qTNMTiZsMDA1mWVK1TZFOVGb8j8B7AkS80q6zSLD75CP1s3gXtG fOsw== 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=SFOoakYwwZf58md/jCZXxLHz/90gcdMgGq3iB8oBm0o=; b=OFJ9/XyfernqaxGPDErBsPlxqYObbtzVOowXNW1DB42NcD2PsgThLxtalVhNKmQLeg oG5fF27tKRqcyTiE6JjnwVEYgfqx0lpTToI78AihyLxTTO3MUDMNygGRKL7Yq45V/Vam Tt3BvTqESN5TaL1FvojFoL/8kHQRD7OBdpcAqcmOSTWTyz+AtngdBZdYUo+P/bm2R9Aq DRQkYh9MzUJJAwX4PEKXCDlmtvPD7mUIErqu+mCF+2oRnILH9FEzIa1MMq2fC3F1Ox7F smo4nUgEX/1l5Vq7x2Or5zXEwBtgKhL73fJS3b4rRty8TWkPowbzY898Si7S4iRsXxgM WhEA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qtEoQNoS; 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 e11si272753pjj.25.2022.01.24.12.17.43; Mon, 24 Jan 2022 12:17:56 -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=qtEoQNoS; 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 S1348975AbiAXTT7 (ORCPT + 99 others); Mon, 24 Jan 2022 14:19:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344994AbiAXTLX (ORCPT ); Mon, 24 Jan 2022 14:11:23 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 563BCC061378; Mon, 24 Jan 2022 11:03:20 -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 ams.source.kernel.org (Postfix) with ESMTPS id 13AC3B81236; Mon, 24 Jan 2022 19:03:19 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ECEF2C340E5; Mon, 24 Jan 2022 19:03:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643050997; bh=mzOXgJWu4huwItt9Jb9pt1M7G82FlnWck1CgOhpFlsE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qtEoQNoSFaf9oLSWJ1BPMLli775ix9f50ryABUOrTKF5r5ccliVvYnfLm57a7t2dW W4vKPgFh2z/aaJyybNiWAbybRQXLLzoo447HuLpPKrcX8drPYNe+EbQGI7uzEt/jXU Rt8oUw+Q3Yf/dEOJj+HcktLzkGS0GBfTmmSMfUE8= 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 4.14 021/186] media: flexcop-usb: fix control-message timeouts Date: Mon, 24 Jan 2022 19:41:36 +0100 Message-Id: <20220124183937.802649871@linuxfoundation.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220124183937.101330125@linuxfoundation.org> References: <20220124183937.101330125@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 @@ -86,7 +86,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" : @@ -154,7 +154,7 @@ static int flexcop_usb_v8_memory_req(str wIndex, fc_usb->data, buflen, - nWaitTime * HZ); + nWaitTime); if (ret != buflen) ret = -EIO; @@ -248,13 +248,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: @@ -281,7 +281,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,