Message ID | 20220920-resend-v4l2-compliance-v2-3-b0ceb15353ac@chromium.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp981729wrr; Fri, 2 Dec 2022 09:25:35 -0800 (PST) X-Google-Smtp-Source: AA0mqf7NvgslhJmMm51pxYTuztGEsdmJ3BCGfb52/LJR5BuocYajqShAw/EWJ5oPdFF56uw10wq4 X-Received: by 2002:a63:f510:0:b0:478:1020:b1e6 with SMTP id w16-20020a63f510000000b004781020b1e6mr23829784pgh.561.1670001935092; Fri, 02 Dec 2022 09:25:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670001935; cv=none; d=google.com; s=arc-20160816; b=RV6El+ZB8EZoAzgCVUIr0ipr5EKdmHE1gXhB63lEbYvyV6M/2RbfCXP/urp+yVfeDc DP6jZUSNfZ+Gzq+o1pku4bsp+uYKtmXSps/1Vrj3ND4Q74H7pntAXe5Zu04A3C1yQVfU gKDteIyEink00mTDjWYK8gGJHRr5tBIH6qfd7WucsoMMrTxA+w+NXV4Rll2ys/+v/jLy N7SNrXuxGBEkQMrMpA+tfTvbaUAQIW1M6jZkp7CWYEIadI0LlK1c5c1obpM46IzLQXtx kuvLjufUW4wFM3fgDK8vaFtV18Q9gX2TV39QkhJIpQ84IJhASiJVJrASbta3YYqrY53E N6zg== 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=bxw2Ty4M46rsTuihUXRiS/Nyvg7teTU6EvDgGOU8X18=; b=Ce2XGJpL4OAWwnlH0XxSsxMq+QXJjl7u2aCfzRNvotfdoJQ9/NSGCnwl5nV+qZTt0O 7sEOTUj+YkcDJANiWtYMt3VqeF152CwqtCWD7nRI+KGwGENCwurzq5TMcCuT8WS/0lUs AHeHc768mARIXVNdlO9hRUoVAu+DCcKWMOoGObcK8iuVC17EgMNyPVuoCyOmXmx4al8K 0XJ9eVTGRvS7N3ezXLqgjde0M0cOepODEJ+ztlGptifknb6XMuXtuo75TWjKge9zPDxV baXZso1mCDWXjVy0gExmWsb61AFMD2zxX9iFkZzsSV56h/N0ChzedkqNF6cu2mZydGNO Facw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=jJEVHDdl; 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 l18-20020a170902e2d200b00189bcf8c18fsi1656870plc.231.2022.12.02.09.25.20; Fri, 02 Dec 2022 09:25:35 -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=jJEVHDdl; 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 S233802AbiLBRWI (ORCPT <rfc822;lhua1029@gmail.com> + 99 others); Fri, 2 Dec 2022 12:22:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233809AbiLBRVy (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 2 Dec 2022 12:21:54 -0500 Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF6A2E7879 for <linux-kernel@vger.kernel.org>; Fri, 2 Dec 2022 09:21:53 -0800 (PST) Received: by mail-ej1-x630.google.com with SMTP id bj12so13034889ejb.13 for <linux-kernel@vger.kernel.org>; Fri, 02 Dec 2022 09:21:53 -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=bxw2Ty4M46rsTuihUXRiS/Nyvg7teTU6EvDgGOU8X18=; b=jJEVHDdlvpUPCZhRaERran9eUhOM2qlOOFnRvqqedej3zPhgq021ZTuEjKL2vx3Out b4kvxDCjksOswC5RpRzF5475S3alzk2VfBobREeil0g6d3/kqEjadY7zGkArNg7AirEA lZs9jbuWvXKaDNHErwa1oINVxV5f3Y8fHla3I= 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=bxw2Ty4M46rsTuihUXRiS/Nyvg7teTU6EvDgGOU8X18=; b=qFKH+7/XvwGibP4KvoUM4WG39+VNgqamLbQrz68OsIMg6IiEF5w5jPJkzBbD2gJvT7 pEhN66RCGr/Gxiaccz0APVsr4vi6qzey4zW7PggHDhxPBJUr2wYSNwNq3Oe49ImiLRkZ 8jD2S3jDYTcMsDlpM0FnYDlK1pi8/emLoys/6YIgYiQUQHdYwr11nfwDe32TC/jzxI7b F7ndY9Tr2LyNatHgjzmTOddjQkmhO9MU2sosIyewnhCsuVIop54+QQqKI3DCM5H38UUB lK4kkE2RPK/88DNn6eUKoi3ITq5MVCznvK2w5bW5TRjYav4fRYHE5ipUA2y72kjsNPme FSOg== X-Gm-Message-State: ANoB5plwx7OLGJWu7MK5uwWyrqviVcEjeb/NIctK7//e8s6D8fVCfctX FVpgm3lmKeMKxDHBwW+0GqUs7A== X-Received: by 2002:a17:906:a019:b0:7be:e774:5aad with SMTP id p25-20020a170906a01900b007bee7745aadmr11360543ejy.426.1670001712399; Fri, 02 Dec 2022 09:21:52 -0800 (PST) Received: from alco.roam.corp.google.com (80.71.134.83.ipv4.parknet.dk. [80.71.134.83]) by smtp.gmail.com with ESMTPSA id fe17-20020a1709072a5100b007be301a1d51sm3206685ejc.211.2022.12.02.09.21.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Dec 2022 09:21:52 -0800 (PST) From: Ricardo Ribalda <ribalda@chromium.org> Date: Fri, 02 Dec 2022 18:21:37 +0100 Subject: [PATCH RESEND v2 3/7] 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-v2-3-b0ceb15353ac@chromium.org> References: <20220920-resend-v4l2-compliance-v2-0-b0ceb15353ac@chromium.org> In-Reply-To: <20220920-resend-v4l2-compliance-v2-0-b0ceb15353ac@chromium.org> To: Mauro Carvalho Chehab <mchehab@kernel.org>, Laurent Pinchart <laurent.pinchart@ideasonboard.com> Cc: Hans Verkuil <hverkuil@xs4all.nl>, Hans Verkuil <hverkuil-cisco@xs4all.nl>, linux-media@vger.kernel.org, Ricardo Ribalda <ribalda@chromium.org>, linux-kernel@vger.kernel.org, Hans Verkuil <hans.verkuil@cisco.com> X-Mailer: b4 0.11.0-dev-696ae X-Developer-Signature: v=1; a=openpgp-sha256; l=982; i=ribalda@chromium.org; h=from:subject:message-id; bh=0oIT1Gw1hO0u+7q6An7Ai/dJe13xUDjVNu6Ry1clGFI=; b=owEBbQKS/ZANAwAKAdE30T7POsSIAcsmYgBjijQmpIoIjFr3y9ZZLwbmXpabLfWEY4uztWa1E3R0 pSoPKi2JAjMEAAEKAB0WIQREDzjr+/4oCDLSsx7RN9E+zzrEiAUCY4o0JgAKCRDRN9E+zzrEiAbNEA CaYQocLmpu+Q7+j7T3rRhdnpqASN9EbtMtNzOxii2/ubnfHq8sWhoBFOqlh5IlyN5ItBymGP5ZUzVQ F9Jm+m2UXqvIMvNJAFdDpMyh39BGX53KocfkJJz1w3OO6q0uD/owPRd0P30tC0c6PTIunSLHguVnDz m3bP+NxPjJth125jxjTCyBPG416uvP3gRcAYT/nH61IDmaMMutBFgBkxTMhdRCkCc0iQ1notbaFR4c M5jXlHqroH9o1iYVed2w69/mTRUJSXkv/u06WKGmr3VLD/WhQ/WjkaPbO9eGUEOdrHBuGC1/nUWGik LEWOvGvOpYV/3QWlbs0ThkJDeqy5ZhPuVLAepKGLSEI722isfSbCt2gH8mdawjwS5rFEfM4glXY77g 8FzLCNdn9/CPEyoyH9+mDzSPmx/zl4Rojhbygg3inwSyvkZIZMpkGOk6J9hM83bX79TsxiJgq1bv3A DwZAR4Tz5YlrCsGQYCmcjQb0k3VnP32Iszz/y9nFMfW1dQVZO2ed71fvMK1QStR2CNXtLeAcPTXL87 5agpKQmlJA7QANvJRYHbu9ftRXFAhOC2FjTe9ZoqclTupa/XTX8GCyY15ibV+a65ueo2Xe6weBxJtO Q4ofJX028Tnd37JPaCN+e71KmtbiqLQMFPa449J5eeoUuW083H9WX/Tk2fww== 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=ham 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?1751123949195172723?= X-GMAIL-MSGID: =?utf-8?q?1751123949195172723?= |
Series |
Follow-up patches for uvc v4l2-compliance
|
|
Commit Message
Ricardo Ribalda
Dec. 2, 2022, 5:21 p.m. UTC
For error 2 (Wrong state) return -EACCES instead of -EILSEQ.
EACCES is a much more appropriate error code. EILSEQ will return
"Invalid or incomplete multibyte or wide character." in strerror(),
which is a *very* confusing message.
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(-)
Comments
Hi Ricardo, Thank you for the patch. On Fri, Dec 02, 2022 at 06:21:37PM +0100, Ricardo Ribalda wrote: > For error 2 (Wrong state) return -EACCES instead of -EILSEQ. > EACCES is a much more appropriate error code. EILSEQ will return > "Invalid or incomplete multibyte or wide character." in strerror(), > which is a *very* confusing message. Unless there's an objection, I'd like to use the following text to replace the commit message to provide more information: 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 happen 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 EACCESS. > Suggested-by: Hans Verkuil <hans.verkuil@cisco.com> > Signed-off-by: Ricardo Ribalda <ribalda@chromium.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > --- > 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 2cf7f692c0bb..497073a50194 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 */ >
diff --git a/drivers/media/usb/uvc/uvc_video.c b/drivers/media/usb/uvc/uvc_video.c index 2cf7f692c0bb..497073a50194 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 */