Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp13472519ybl; Sun, 29 Dec 2019 12:44:05 -0800 (PST) X-Google-Smtp-Source: APXvYqwQ/JzVuUjmct75ARFyX43vaw2L/tZllf/A14DQAofIY2iJS/SOIdQUEWYgiJcPLfFvjlVu X-Received: by 2002:a05:6830:1cd3:: with SMTP id p19mr53196320otg.70.1577652245395; Sun, 29 Dec 2019 12:44:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577652245; cv=none; d=google.com; s=arc-20160816; b=x2r3vPy5hqr7tlUpHM6DPj3Xl+HAEuYXKPOuhx3vlh2eC+gh22WbGzAKFdHtcp51ek sNJyIrHs+GxTZVb8RLxvSRu8dMOKwfMrJpyWYLqNZAAVA7KGpo58HpWibyozjmcHOLB0 h/ZnU1J3hSA1cHE6EUqh9prH4Qx0RGkeo9MkS1lA6R+nLRBsox7WeVyx2PJ/I6OUf6x6 Z82XoHmrJ0zrb+D4OsqGuOzBAB30AdTeSLUYPTxIyJpBANd4fuiBoEWpwznJO/L9gbbS hWl97iWqVL4g/caY26R6RoYQHsJNCjEuACA4EZLZmqk8R1YgaN1bcJmWzzr0OoyliA3J jfZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=jfchNVVE0fkjCY1YgnOyztT4CBsaWCl+vJWp3uqCc6g=; b=k69RGBteEfNhdc9Xr5E+ESIk64DbHmoyiU1ATXuezHlyOpzIYqnT2MhFSTbYMJKR1A s8dzTMiGeY3rFQKapdfF+r9n3U3vYU4rDqKpUTBhaQ7FDJmKmlAxvSVpyq+PXGhP4URN q1wYMjz/y7fM7COPz04JWHzRNP+tIj7kLzMrJrAnvOwGFzsYHSde/zHs73S570GxPyHs bFbRUGzohoz/LGz5bDt/CSE7M7yw8WL2WsqxdS2v6dEh3KS9Kr6DwGBm+WiLlf4PxsBw Sv4FM5IrY8YGGYJdYn8pJELRDXo3JXs3G8T2LO4HiEWZK4bfFrfhXBrr06mlApLRuYOU GRXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ew46ADav; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l18si21976959oth.236.2019.12.29.12.43.53; Sun, 29 Dec 2019 12:44:05 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ew46ADav; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730486AbfL2Rn3 (ORCPT + 99 others); Sun, 29 Dec 2019 12:43:29 -0500 Received: from mail.kernel.org ([198.145.29.99]:50610 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726741AbfL2RnW (ORCPT ); Sun, 29 Dec 2019 12:43:22 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 019AA208C4; Sun, 29 Dec 2019 17:43:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1577641401; bh=5d3QfDrXwgi9KKugVFag//9IUJqnFiwLYU7+XprSpko=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ew46ADavzu8m4Yi0GhPw+ipvu2PKfZntcMZLmDQmOUcOhYYRgLih+MFq/Ad2JVnD8 GsLwdDf1C/9fPJRnmpoaeN436zdy2Vm8ujiDCHcW7c6BtAJHyXnIJ0abHP+casv5cT TtV9lX0/TNhkP6/q3AnUUWCaR4xbdvc1u7X96UZg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?UTF-8?q?Jos=C3=A9=20Roberto=20de=20Souza?= , =?UTF-8?q?Noralf=20Tr=C3=B8nnes?= , Maarten Lankhorst , Maxime Ripard , Sean Paul , Alex Deucher , Andres Rodriguez , Daniel Vetter , Sasha Levin Subject: [PATCH 5.4 049/434] drm: Use EOPNOTSUPP, not ENOTSUPP Date: Sun, 29 Dec 2019 18:21:42 +0100 Message-Id: <20191229172705.220789182@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20191229172702.393141737@linuxfoundation.org> References: <20191229172702.393141737@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Daniel Vetter [ Upstream commit c7581a414d28413c1dd6d116d44859b5a52e0950 ] - it's what we recommend in our docs: https://dri.freedesktop.org/docs/drm/gpu/drm-uapi.html#recommended-ioctl-return-values - it's the overwhelmingly used error code for "operation not supported", at least in drm core (slightly less so in drivers): $ git grep EOPNOTSUPP -- drivers/gpu/drm/*c | wc -l 83 $ git grep ENOTSUPP -- drivers/gpu/drm/*c | wc -l 5 - include/linux/errno.h makes it fairly clear that these are for nfsv3 (plus they also have error codes above 512, which is the block with some special behaviour ...) /* Defined for the NFSv3 protocol */ If the above isn't reflecting current practice, then I guess we should at least update the docs. Noralf commented: Ben Hutchings made this comment[1] in a thread about use of ENOTSUPP in drivers: glibc's strerror() returns these strings for ENOTSUPP and EOPNOTSUPP respectively: "Unknown error 524" "Operation not supported" So at least for errors returned to userspace EOPNOTSUPP makes sense. José asked: > Hopefully this will not break any userspace None of the functions in drm_edid.c affected by this reach userspace, it's all driver internal. Same for the mipi function, that error code should be handled by drivers. Drivers are supposed to remap "the hw is on fire" to EIO when reporting up to userspace, but I think if a driver sees this it would be a driver bug. v2: Augment commit message with comments from Noralf and José Reviewed-by: José Roberto de Souza Acked-by: Noralf Trønnes Cc: José Roberto de Souza Cc: Maarten Lankhorst Cc: Maxime Ripard Cc: Sean Paul Cc: Alex Deucher Cc: Andres Rodriguez Cc: Noralf Trønnes Signed-off-by: Daniel Vetter Link: https://patchwork.freedesktop.org/patch/msgid/20190904143942.31756-1-daniel.vetter@ffwll.ch Signed-off-by: Sasha Levin --- drivers/gpu/drm/drm_edid.c | 6 +++--- drivers/gpu/drm/drm_mipi_dbi.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c index 6b0177112e18..3f50b8865db4 100644 --- a/drivers/gpu/drm/drm_edid.c +++ b/drivers/gpu/drm/drm_edid.c @@ -3722,7 +3722,7 @@ cea_db_offsets(const u8 *cea, int *start, int *end) if (*end < 4 || *end > 127) return -ERANGE; } else { - return -ENOTSUPP; + return -EOPNOTSUPP; } return 0; @@ -4191,7 +4191,7 @@ int drm_edid_to_sad(struct edid *edid, struct cea_sad **sads) if (cea_revision(cea) < 3) { DRM_DEBUG_KMS("SAD: wrong CEA revision\n"); - return -ENOTSUPP; + return -EOPNOTSUPP; } if (cea_db_offsets(cea, &start, &end)) { @@ -4252,7 +4252,7 @@ int drm_edid_to_speaker_allocation(struct edid *edid, u8 **sadb) if (cea_revision(cea) < 3) { DRM_DEBUG_KMS("SAD: wrong CEA revision\n"); - return -ENOTSUPP; + return -EOPNOTSUPP; } if (cea_db_offsets(cea, &start, &end)) { diff --git a/drivers/gpu/drm/drm_mipi_dbi.c b/drivers/gpu/drm/drm_mipi_dbi.c index c4ee2709a6f3..f8154316a3b0 100644 --- a/drivers/gpu/drm/drm_mipi_dbi.c +++ b/drivers/gpu/drm/drm_mipi_dbi.c @@ -955,7 +955,7 @@ static int mipi_dbi_typec1_command(struct mipi_dbi *dbi, u8 *cmd, int ret; if (mipi_dbi_command_is_read(dbi, *cmd)) - return -ENOTSUPP; + return -EOPNOTSUPP; MIPI_DBI_DEBUG_COMMAND(*cmd, parameters, num); -- 2.20.1