From patchwork Wed Apr 17 10:38:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wojciech Macek X-Patchwork-Id: 13633160 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 F2CF9C4345F for ; Wed, 17 Apr 2024 10:38:45 +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=iJ0ZXNaeOyEHmrO4O0qFOGIuMcuDFMuZ+qO0MLm3g2g=; b=aaA+BIRG8I71ou AZrIwJgIey6FUvvq0H3Lpj9aegrwLsiaJvx1TzBQXjcacXQeZ3iofuHdB97PoRGxOyrJmKiFkeNN1 VXh0X+SgRezSEEWhVyhdbJbXA6Gqdwm3/gr+hMRT5irdvFo2NWgMbhtcLBnrDZmA7hYDv3yeS/nsj zuTXkgbM1PqrIs0TzTG3W46Hzv80Zzf02GxgmI69bfJvX4XCaowpJIwHeZ0Hu3qzy/L18n1JMEZwP FoGzJOXt6X8QjE98563fmmy15H7UsgoqP0WHGD7kYHb8E7d2tH7jFb3zfea9XV5n9EMeOoq34/FRX kJzl2XUAHq05h2pNLCoQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rx2gV-0000000FdX7-3qBq; Wed, 17 Apr 2024 10:38:35 +0000 Received: from mail-ed1-x544.google.com ([2a00:1450:4864:20::544]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rx2gR-0000000FdVn-48nX for linux-arm-kernel@lists.infradead.org; Wed, 17 Apr 2024 10:38:34 +0000 Received: by mail-ed1-x544.google.com with SMTP id 4fb4d7f45d1cf-56e1f3462caso7007914a12.3 for ; Wed, 17 Apr 2024 03:38:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1713350309; x=1713955109; 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=wGPAZakFv3tW+couZM/Hz58bGfETU82f69mf8+8G4OQ=; b=FOw3oD0zcguqf17oEEK1QHTnwICqDtN0yj9Rol5GHzhWXnmNE5DahLLEH95kpx+6wn dg9g4l+ODh4buJTjwJR9ir4AOqztlFMPFj6AGUi3SAupEElpchj2W+zRKxXR+bI3VxBJ J+kqtUUpZZSCn9qm70L8to1zc/NGZhosbBjqs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713350309; x=1713955109; 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=wGPAZakFv3tW+couZM/Hz58bGfETU82f69mf8+8G4OQ=; b=KPX0FSHF3MrzD+0Rwk7I3ufBnotQvA+fA7wt23e1N2khKUUykaXW3AOLwvg9O4J9RD oiR1GMXtRU9mHJNjN1I1cItUAE2bKG+iC0Dow6OevFAGlv5QdRKGZRjtxKjCnlqSKvTw CWK0PRaKbdTabY8SMr6wszM7yoMb5dG4a9dR6Mn2tYRoZlcCkgH4of3WEgBrfof68fEz EFfNs5XKclPGD3lks3jYkTLZy73XjO4zRuhzsxaGNlafQPBF67sTg1zCCbs4udcblUGq a/mKoZQ3VxcVtxnRelMKD4iC7Tj9oiwn54XsZY0URSy1MDh83UzL452etLLTQMh6TqzJ Yu8A== X-Forwarded-Encrypted: i=1; AJvYcCXr2pgtExR6rwbUDiHev2q738hA1xwoigeJB6Kli9TgsFsxptzmbZP7ysXHNMNtJjsOltT+nYhLwe7Ka3o2m4MqRNFatR6j5qiOtcoBZz184KOCf+E= X-Gm-Message-State: AOJu0YxUDxzt0Iq2Qju9IcHf90ZGUz4OMy+kAMH98xErJBODx/CUyTsR o+0mnrsD7OwFqXYykgxpFU7ZUYdfjXIAsEeQIke2W5dvKJIdYf+ZQOau7h0m+w== X-Google-Smtp-Source: AGHT+IFVcPG0J5A4OYw4wVn0Z7fkAtpovNHvVRNRPx9roE8nRmfmY11gcOt1EWpA8oZzc73jAWSbAg== X-Received: by 2002:a17:907:928b:b0:a52:54d5:7915 with SMTP id bw11-20020a170907928b00b00a5254d57915mr9533946ejc.74.1713350309663; Wed, 17 Apr 2024 03:38:29 -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 gf14-20020a170906e20e00b00a51e6222200sm7989488ejb.156.2024.04.17.03.38.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 17 Apr 2024 03:38:29 -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 v2] drm/mediatek/dp: fix mtk_dp_aux_transfer return value Date: Wed, 17 Apr 2024 10:38:19 +0000 Message-ID: <20240417103819.990512-1-wmacek@chromium.org> X-Mailer: git-send-email 2.44.0.683.g7961c838ac-goog MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240417_033832_113376_A29BFD95 X-CRM114-Status: GOOD ( 11.85 ) 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 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. Fixes: f70ac097a2cf ("drm/mediatek: Add MT8195 Embedded DisplayPort driver") Signed-off-by: Wojciech Macek Reviewed-by: AngeloGioacchino Del Regno Reviewed-by: CK Hu --- Changelog v2-v1: - added "Fixes" tag - corrected e-mail address V1: https://patchwork.kernel.org/project/linux-mediatek/patch/20240402071113.3135903-1-wmacek@chromium.org/ 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; }