Message ID | 20220920-resend-v4l2-compliance-v3-3-598d33a15815@chromium.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp4654942wrt; Tue, 3 Jan 2023 06:44:21 -0800 (PST) X-Google-Smtp-Source: AMrXdXv/2qcG6XQHAmzd3EyeZU66tk9RQXMdjYdx7KKj/ZbZPvHqXY/vkIuQVtR3/Rr2aK835uCu X-Received: by 2002:a62:1704:0:b0:581:e3db:3b56 with SMTP id 4-20020a621704000000b00581e3db3b56mr16952433pfx.32.1672757061105; Tue, 03 Jan 2023 06:44:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672757061; cv=none; d=google.com; s=arc-20160816; b=oNrpvaNPUyUsU5oJ5A9h7PFbITtOU/ddqqGafKBADI8xvWjvNbOqLuugZ7ZAyVz2Lo /7ji5hhruwubhk3FiYpHR+rGycSppbCRmfTNMbfiERgkc6Cus24HVlJrdOoySrmjdYHF l99hxh/ifQ7ZvA77g+GO91oFvzxPKwCoiqIFyaasFxGUjvyefNZD1LeHdl35BovZc7Q2 MQ++FN8kFWGf5Rw+TbfKShZVMqYRlifTcixXA6OYZXm2VTg+NMA61zXOQJh3OwI+LCHN TizWnn+1epKtHA14xw0B7JzABYzB+wAmwXN3Tlhtlibl2wbpQQJ9nOy1Rz+6ty3KEBhP tK4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=qJf+h2f2R0607iPBKTi3aOdsbu1qoQNWuR3plbe+zVU=; b=pmrSfOM82hCabj5jj4wFWWDn4BTY7QpP+EkfeICVAlGjz4mufVAntwjM1Bqxz87vAj nxEqxnNPYR++AS1E+NeiDL7nNh3Aw/TqjorlI5pwjC6jL7QfLLIqBEe9jS16K5Kylk2S yYVEB/NZqsnojxfzszVj6Fc4CBzdu1V3ZAUgJDqhsDPAQCyA0XgZiaKovZ3/bv6HDsFc TKPpOGBK2W1UX1ZM6F+2yZBr8V/fdvOZ5JBGWTkicfsLbCCq9Pt4Mto3PM+rDsY2FI8h y1zDuTgQz2WxwRamgW3eMdDPwYvUR5/07urjpCLSeWvU5bwkzLoygDs/x4HqF2TviG6D GzyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=DORFtksW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o3-20020a056a001bc300b005816eb19ee2si20103003pfw.162.2023.01.03.06.44.09; Tue, 03 Jan 2023 06:44:21 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=DORFtksW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S233541AbjACOhY (ORCPT <rfc822;tmhikaru@gmail.com> + 99 others); Tue, 3 Jan 2023 09:37:24 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48566 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237817AbjACOgs (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 3 Jan 2023 09:36:48 -0500 Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 86B7E1146B for <linux-kernel@vger.kernel.org>; Tue, 3 Jan 2023 06:36:47 -0800 (PST) Received: by mail-ed1-x52d.google.com with SMTP id i9so44030934edj.4 for <linux-kernel@vger.kernel.org>; Tue, 03 Jan 2023 06:36:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=qJf+h2f2R0607iPBKTi3aOdsbu1qoQNWuR3plbe+zVU=; b=DORFtksWSOAqwT83xzT791DCgSBLtY4QkVrt8RDWSezJ0Zzr3fxsYJjXA8m5j8JzSx D7fUA+MI4PnroF7PXK2faRne8PvsK8CqZxfi8AKDe6AqMe5FPpK6/8D3I7vMBSZYQpUJ EAT/1RabDaErRpWq/ydEfXK54MtXH/ianXzgc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qJf+h2f2R0607iPBKTi3aOdsbu1qoQNWuR3plbe+zVU=; b=aaBG+9U+MdUGalQdLiG+d5Qwkcd7meUrgY2Oju703XIerzt6MZcUn0L0Z4MqF5rTvj pnio8MhaScZpfe7Td2ps8VHDG/D3cK+GyaF/eScSgw4/3n5eEcE7bJXkNFk7rGREBXm5 NgRIVFJaGIlJ54h1mXy+4NX9l7VIf/dlqMJ5edFkKqdFSTbT+UAUZ8jSeO+Sor7I3kj1 5dI2ehYGA5hXbsKyN0G/nVVYNuUm5ZEGFArKdBQQk0k7EUNloe1TVOA8IyWrW/b2vOOD vVk0dWhU+zGklqixD9MWwoqa+l9DK7su/lIQ0UKka3QEfMn6b2j0mRig+Bjc4izrjnbI RGqQ== X-Gm-Message-State: AFqh2kpqQcyZPzh1mjOTMdcI/vlB2v1sZBNqdw42/KCuKEL+zGvyDUVu dA2dp5fJiKF8dQ0fbOyE7Jc/XA== X-Received: by 2002:a05:6402:14d6:b0:479:6bf2:a9bb with SMTP id f22-20020a05640214d600b004796bf2a9bbmr35770781edx.15.1672756606094; Tue, 03 Jan 2023 06:36:46 -0800 (PST) Received: from alco.roam.corp.google.com ([2620:0:1059:10:9789:8e2b:74ac:a9a0]) by smtp.gmail.com with ESMTPSA id p14-20020a05640243ce00b0048ebf8a5736sm877245edc.21.2023.01.03.06.36.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Jan 2023 06:36:45 -0800 (PST) From: Ricardo Ribalda <ribalda@chromium.org> Date: Tue, 03 Jan 2023 15:36:21 +0100 Subject: [PATCH v3 3/8] media: uvcvideo: Return -EACCES for Wrong state error MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20220920-resend-v4l2-compliance-v3-3-598d33a15815@chromium.org> References: <20220920-resend-v4l2-compliance-v3-0-598d33a15815@chromium.org> In-Reply-To: <20220920-resend-v4l2-compliance-v3-0-598d33a15815@chromium.org> To: Mauro Carvalho Chehab <mchehab@kernel.org>, Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: Hans Verkuil <hverkuil@xs4all.nl>, linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Ricardo Ribalda <ribalda@chromium.org>, Hans Verkuil <hans.verkuil@cisco.com>, Hans Verkuil <hverkuil-cisco@xs4all.nl> X-Mailer: b4 0.11.0-dev-696ae X-Developer-Signature: v=1; a=openpgp-sha256; l=1494; i=ribalda@chromium.org; h=from:subject:message-id; bh=sEdvpc4Bk0VAM3TYxG5czBefJfH6Gr4ihACOSTYlAUo=; b=owEBbQKS/ZANAwAKAdE30T7POsSIAcsmYgBjtD1vAXIWeI4gUm0GA0hIn8dST/3ChZRkz+xJCg47 FeLEYjGJAjMEAAEKAB0WIQREDzjr+/4oCDLSsx7RN9E+zzrEiAUCY7Q9bwAKCRDRN9E+zzrEiGS0D/ 4hVkfk3RSkYUUFd1IJWWUGPZbi+dKG41xyvSqchdNJcO2eHDgfpa5JXTQDnPIxg+OkW/wV7q4eE5kf xsGSHI7nSs5ZY7aYxgisLTea27DJrhAqCqRKDVX/oXucirOFyOHUwGNijn6YlIjW0v72rxWWfjB00b kJJr0dNLrFmnchDcTIH54rb+1qNTrzrqceCNMezZ0OjNak90RHchQtnizV8oi5OMNHlt274fjwMOhd 4lZwz33wVOFopez5y8qlUE5EukTYzd9vFeuBGWoK8No9P0Y27oKWB6VcmFIc2BAt+31SmA9HmlShwR 4w2QNOR80PzrQbBl4gNoFF6ddEYf6eBXuyQGYjf5TSRkCCRIJGVV+hf1a34/XAVszMUkKu5FZKKRjt eiD7g74cXIHyIvFHd9eOroN5l+WLdS/W5x7ETRUQWwE2hYyo9iyJ91Sj3v3eD/QRC033A8fZGn2qx8 cTDdI/754jIuYXP4Q+FQm0xuwFHUMptUzGB1qwJUFO5X/hHy7JPHJ5QkyXjo9w4Tr2/SYfnl3bXLwG d+T1IqsyQaU4ftJrWDG6I56sfhUGq/H+iUWvA62flRzfXTmdmDt6HiWg1t1jEy8VTXFF7mZ6JMduu9 DVHLBP7lDdEOJ1XcArye038zZkIAsPGZUmkeDdfFgPnl0LBWv3W1X6QWFoPw== X-Developer-Key: i=ribalda@chromium.org; a=openpgp; fpr=9EC3BB66E2FC129A6F90B39556A0D81F9F782DA9 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754012907677972950?= X-GMAIL-MSGID: =?utf-8?q?1754012907677972950?= |
Series |
Follow-up patches for uvc v4l2-compliance
|
|
Commit Message
Ricardo Ribalda
Jan. 3, 2023, 2:36 p.m. UTC
Error 2 is defined by UVC as: Wrong State: The device is in a state that disallows the specific request. The device will remain in this state until a specific action from the host or the user is completed. This is documented as happening when attempting to set the value of a manual control when the device is in auto mode. While V4L2 allows this, the closest error code defined by VIDIOC_S_CTRL is indeed EACCES: EACCES: Attempt to set a read-only control or to get a write-only control. Or if there is an attempt to set an inactive control and the driver is not capable of caching the new value until the control is active again. Replace EILSEQ with EACCES. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Suggested-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> --- drivers/media/usb/uvc/uvc_video.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/uvc_video.c index 6b20a23bc3cf..e56ccde9bd10 100644 --- a/drivers/media/usb/uvc/uvc_video.c +++ b/drivers/media/usb/uvc/uvc_video.c @@ -108,7 +108,7 @@ int uvc_query_ctrl(struct uvc_device *dev, u8 query, u8 unit, case 1: /* Not ready */ return -EBUSY; case 2: /* Wrong state */ - return -EILSEQ; + return -EACCES; case 3: /* Power */ return -EREMOTE; case 4: /* Out of range */