From patchwork Tue Apr 2 07:11:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wojciech Macek X-Patchwork-Id: 13613451 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5C859CD1284 for ; Tue, 2 Apr 2024 07:11:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=Wvbp5PcSeS5eb8HhJf/9y5ND98f+/f2/LwT69L0Ifg8=; b=4ZCdNMu2JG3ixA 0TTDQn0D7lDJYofiKwRMmSSnRDKJRidIQJirjDFGkqiekWqZLwMvAecsab3YyH2yXcM8xgMDaumHS 7Nl4rjVpG6ThvAyJ1os5iatR9a0ze2w88Xbrvs6qg0rpcfT1o1W9NeSgROPOlyuhnvHLAJl5Si5TN YNjo3tuFtm/eeM5x12IRLdrkFZkc4si4Y6bJTy4U4RqbFzxnlZUA8QyE9PEg5l39k0cDoA3CgczLr aYaxN5tLrGIb0+9ZFMR/r8VbKgzY0I09LvttsXRmNI3XDZH5wvNRwyUUBBOmA+qCeS6YHHXV7Qy7E +mKEyUy67tNIhbfbdMmg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rrYIo-0000000A1uW-0PZq; Tue, 02 Apr 2024 07:11:27 +0000 Received: from mail-ej1-x641.google.com ([2a00:1450:4864:20::641]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rrYIk-0000000A1t2-3xcN for linux-arm-kernel@lists.infradead.org; Tue, 02 Apr 2024 07:11:24 +0000 Received: by mail-ej1-x641.google.com with SMTP id a640c23a62f3a-a4e79d7d21dso66194166b.1 for ; Tue, 02 Apr 2024 00:11:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1712041879; x=1712646679; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ZnIWTbeR2GXQXE2WKV9Ap/wvI2y5jKr9SDTIrGO5fgY=; b=QJe5/s2cKv7hgHtpPFMVb3mIX0i0kZq8wSKZ2PHMS3Q6gOVzHAnoNqaZV4U5XMd0+I YldY2yp/1mRryxkhvRjOitiWDm0Ajr3A3bf6CK5ZWZbkzNPyrYMb63NJQr2gGvZoJtZ1 zXjoirw2G3x3vd2KpauJcEvYW2HxhCcL3S3C0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712041879; x=1712646679; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ZnIWTbeR2GXQXE2WKV9Ap/wvI2y5jKr9SDTIrGO5fgY=; b=YNnSgn+DCVSLAyf1YrvyfC4fPbikkYZMMW4G5UCys9O/HXxsV9CkmdUIYk6oq6TP01 2C1xkypH3GgvNGetHQBZU0oW4CP7iYd5OfqobyUYviqE1P5YDY3KydwlVMaK7VyJQmqQ xQxQ3g7EgRpLd9nUONgw7lNrsgkLbmjNA/ZdbOoLKaauK5VQN6c5va3HVjtXUWGBSSNy 7zk9mZGT6zzIY8crtFbAdk7N54LFxF8WjWEXGqf1IBndwv0HEecnEOhlJoAWDVW3N607 Q121TZzX02v+gGZa5daJrRcmLkRKBQHKObYvhXNYX3adsOycTepKkGGqaYKJXWGSh2MX yI7w== X-Forwarded-Encrypted: i=1; AJvYcCUjKcsSo4iNVTD9SlUZXE1bVS6mzb3/1qImXskqR4zJ+r+oCg5ZC/9ubkugHE3W7LI2HLEaAzkSSCe1rxbFqMAFCif1IzI9eoIRx5LDS2/FdvEt0es= X-Gm-Message-State: AOJu0YwrMy2xoUzNkZLEdz0OoX+Xsn1pz2iOPvVIZnz19gzFfB6iH4Bo 1YJ1glZVo36jZPsY+Eb8FJA3oo7oE81VplTCfHjT3QpEhnF1AvOPnQUhpmjY/g== X-Google-Smtp-Source: AGHT+IGUOjA6NKyVT/+ELVqwwCceZpb+FILLMln0YYk0jw8k+fwEMqxkgdfJr/x+JyjJ3SCGlsnvew== X-Received: by 2002:a50:f603:0:b0:56d:e947:dd52 with SMTP id c3-20020a50f603000000b0056de947dd52mr471101edn.26.1712041879594; Tue, 02 Apr 2024 00:11:19 -0700 (PDT) Received: from orzel7.c.googlers.com.com (229.112.91.34.bc.googleusercontent.com. [34.91.112.229]) by smtp.gmail.com with ESMTPSA id g28-20020a056402321c00b0056c1c2b851esm6395171eda.0.2024.04.02.00.11.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 00:11:19 -0700 (PDT) From: Wojciech Macek To: Chun-Kuang Hu , Philipp Zabel , David Airlie , Daniel Vetter , Matthias Brugger , AngeloGioacchino Del Regno , dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, chrome-platform@lists.linux.dev Cc: Wojciech Macek Subject: [PATCH] drm/mediatek/dp: fix mtk_dp_aux_transfer return value Date: Tue, 2 Apr 2024 07:11:13 +0000 Message-ID: <20240402071113.3135903-1-wmacek@chromium.org> X-Mailer: git-send-email 2.44.0.478.gd926399ef9-goog MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240402_001122_991197_633D107F X-CRM114-Status: GOOD ( 13.05 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Wojciech Macek In case there is no DP device attached to the port the transfer function should return IO error, similar to what other drivers do. In case EAGAIN is returned then any read from /dev/drm_dp_aux device ends up in an infinite loop as the upper layers constantly repeats the transfer request. Signed-off-by: Wojciech Macek --- drivers/gpu/drm/mediatek/mtk_dp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/mediatek/mtk_dp.c b/drivers/gpu/drm/mediatek/mtk_dp.c index 0ba72102636a..536366956447 100644 --- a/drivers/gpu/drm/mediatek/mtk_dp.c +++ b/drivers/gpu/drm/mediatek/mtk_dp.c @@ -2104,7 +2104,7 @@ static ssize_t mtk_dp_aux_transfer(struct drm_dp_aux *mtk_aux, if (mtk_dp->bridge.type != DRM_MODE_CONNECTOR_eDP && !mtk_dp->train_info.cable_plugged_in) { - ret = -EAGAIN; + ret = -EIO; goto err; }