Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3488855pxf; Mon, 15 Mar 2021 10:38:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzqVMvcjee2Pi6SrJwB9bl/XkBkFydQFVwEm3f91GgnWDeZpg5VjoZsLEbZ4xGlCmJ/fnFn X-Received: by 2002:a17:906:73cd:: with SMTP id n13mr24431029ejl.535.1615829909788; Mon, 15 Mar 2021 10:38:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615829909; cv=none; d=google.com; s=arc-20160816; b=wnkDvWr90+t55f4ztCNobUBVuQMvWbxALFUIkOOs+VElWprndjrs9N5ACm5tf1+T3/ XNMxX9TDcYrPYQjU4itIdffomDcUBPOyGXGge6X80iWcXTyum6S+Us7ZOWIDIzBJDocH IOllWF06qARM+DrRjQwrQupIYU+QBeodHLQduPxDLxKtpauehJtt5uFs6Ni9Id8eVYNv IJvQrB5TQBC0BQOm2pZrfDJ4vJn6o4GrleyVmJTLvqbXPPj/B/FS1mkkWikZVP5IB1eN 93awBMRnu+F64JmcC35I0CC716WjYeIqW1UrxzQwZbtyow/blvKRd0cSRAT/k5I+qsn2 u9RA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=x7BfbRkZgKvyDVm8Db9Jrgj8gcrrUGA9hBYKQf9MVsw=; b=PifT0786Z4+FuCyf7DYRQ4t7mob9Vic9YXfh/SwU8h0Y4LoLkpRmVzg0HqI78OvGOs /7KXm6pJ6IC4a+Wg0hKeYBDhAtFWVoANRKFDDEVNHzIGThXx+oUEwuBGWweTwAscb66f QCijpIm+WZIrvskuqqDcyRWcu0S85LIDK1iYVW7nLfTEDPV9K5pMeY9ZaxhXOoGTizms Kja3/IV5CSuMu6nSU8zgnJ8Peiiq/2Q6gssuzrZ/JLC+tTk+zcxTPyMqsysiB9cU2/eH nH7Uci9ZepXyqHz2EmBfllVyhi7R3t7OD+4LwI4R5YBACqaP6DbK+rM4dw6oqHhnMhxX nzxQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=HB2rH7KY; 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=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g26si11612695edr.573.2021.03.15.10.38.07; Mon, 15 Mar 2021 10:38:29 -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=@chromium.org header.s=google header.b=HB2rH7KY; 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=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236481AbhCORgq (ORCPT + 99 others); Mon, 15 Mar 2021 13:36:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234049AbhCORgP (ORCPT ); Mon, 15 Mar 2021 13:36:15 -0400 Received: from mail-ej1-x62e.google.com (mail-ej1-x62e.google.com [IPv6:2a00:1450:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0A63C06175F for ; Mon, 15 Mar 2021 10:36:14 -0700 (PDT) Received: by mail-ej1-x62e.google.com with SMTP id r17so67649292ejy.13 for ; Mon, 15 Mar 2021 10:36:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=x7BfbRkZgKvyDVm8Db9Jrgj8gcrrUGA9hBYKQf9MVsw=; b=HB2rH7KYWc4GsuOr6kxXutXDTsRCb/BilDokuuyTS0h47VLCATbclVjABf9VT6oNKA /IMwjyy9GZnNSDmAUbClt8nlqOsFWb4GBMMUaWrkguNxPAQp+cYFlleeG6LtFGZ+mt/f La7BotmmMZHnKuIeToQ4JX4G2ywj72eDtY8lA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=x7BfbRkZgKvyDVm8Db9Jrgj8gcrrUGA9hBYKQf9MVsw=; b=qrC+5dxhkEaW83VsWZgDCFWMP0yGz7ocrbYn1kWyxjf+0f8ZFztA62Up52FE7LOWtQ N3dGcU9w6s8LO3BFzxL9mpbBNgiMyshQFk4xYQgvA4IFQEgtNoRQjrmGZOjrUEn6IQ1Y Q6wqPZS+joT5txBJmDjc0ibI9Bn2Dh8b3TFPsQd1rwwY7jaLOkmtjsgn1LpFZWkSeqpF a+N5sj3SAeCi77qCMdVsCZUnbEE35HoznAU9GiXNN8VlDt1GFZC4k5FE7EfXJxYaAf+f RiAQWuBJw+lUz54ht0mI7pCQa8sgswRjuXjeT5HfFFDo4o2MeXKe2oR8HTu8Iow6825Z 31cg== X-Gm-Message-State: AOAM530zCoKT6TVRywZSj9qLaPZar8W3uRUDOGDK9yNM19WEOBcveVGh zGApF/MlX8jLIsXxRoLttPNv7w== X-Received: by 2002:a17:906:1dc2:: with SMTP id v2mr25191961ejh.350.1615829773512; Mon, 15 Mar 2021 10:36:13 -0700 (PDT) Received: from alco.lan ([80.71.134.83]) by smtp.gmail.com with ESMTPSA id a3sm8109239ejv.40.2021.03.15.10.36.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Mar 2021 10:36:13 -0700 (PDT) From: Ricardo Ribalda To: Laurent Pinchart , Mauro Carvalho Chehab , Hans Verkuil , Sergey Senozhatsky , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Ricardo Ribalda Subject: [PATCH v4 03/11] media: uvcvideo: Return -EIO for control errors Date: Mon, 15 Mar 2021 18:36:01 +0100 Message-Id: <20210315173609.1547857-4-ribalda@chromium.org> X-Mailer: git-send-email 2.31.0.rc2.261.g7f71774620-goog In-Reply-To: <20210315173609.1547857-1-ribalda@chromium.org> References: <20210315173609.1547857-1-ribalda@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The device is doing something unspected 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: Laurent Pinchart Reviewed-by: Hans Verkuil Signed-off-by: Ricardo Ribalda --- 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 f2f565281e63..25fd8aa23529 100644 --- a/drivers/media/usb/uvc/uvc_video.c +++ b/drivers/media/usb/uvc/uvc_video.c @@ -112,6 +112,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.31.0.rc2.261.g7f71774620-goog