From mboxrd@z Thu Jan 1 00:00:00 1970 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F3DF3C433FE for ; Wed, 24 Nov 2021 12:57:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347444AbhKXNBD (ORCPT ); Wed, 24 Nov 2021 08:01:03 -0500 Received: from mail.kernel.org ([198.145.29.99]:33440 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347179AbhKXM6S (ORCPT ); Wed, 24 Nov 2021 07:58:18 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4764E610F7; Wed, 24 Nov 2021 12:33:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1637757218; bh=Z3ct+PXhYfibFj8MIozC60owx8+WE18i9w1P3KpE2z4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N1ZAcivKR/2ZHwEyTi+ToJKFp+Ua0F0gBCsA4CJbVaNAaywDp6B3J/CshqbBPQ7zS b3B76RWk3VgbYatnujnQNCDz6pgJGqLo0awKot4r0qbzTb8X6tUTXF8annaB36CnWT nUQJoc/XlacEuj1uDqoLPKou7p3Eu/CgHD3hcyUE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hans Verkuil , Ricardo Ribalda , Laurent Pinchart , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 4.19 097/323] media: uvcvideo: Return -EIO for control errors Date: Wed, 24 Nov 2021 12:54:47 +0100 Message-Id: <20211124115722.243777251@linuxfoundation.org> X-Mailer: git-send-email 2.34.0 In-Reply-To: <20211124115718.822024889@linuxfoundation.org> References: <20211124115718.822024889@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: stable@vger.kernel.org From: Ricardo Ribalda [ Upstream commit ffccdde5f0e17d2f0d788a9d831a027187890eaa ] The device is doing something unexpected with the control. Either because the protocol is not properly implemented or there has been a HW error. Fixes v4l2-compliance: Control ioctls (Input 0): fail: v4l2-test-controls.cpp(448): s_ctrl returned an error (22) test VIDIOC_G/S_CTRL: FAIL fail: v4l2-test-controls.cpp(698): s_ext_ctrls returned an error (22) test VIDIOC_G/S/TRY_EXT_CTRLS: FAIL Reviewed-by: Hans Verkuil Signed-off-by: Ricardo Ribalda Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/usb/uvc/uvc_video.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/uvc_video.c index 56b058d60a0dc..9c26e586bb01d 100644 --- a/drivers/media/usb/uvc/uvc_video.c +++ b/drivers/media/usb/uvc/uvc_video.c @@ -117,6 +117,11 @@ int uvc_query_ctrl(struct uvc_device *dev, u8 query, u8 unit, case 5: /* Invalid unit */ case 6: /* Invalid control */ case 7: /* Invalid Request */ + /* + * The firmware has not properly implemented + * the control or there has been a HW error. + */ + return -EIO; case 8: /* Invalid value within range */ return -EINVAL; default: /* reserved or unknown */ -- 2.33.0