Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp2378399lqo; Mon, 20 May 2024 04:11:30 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU4limCfzV8QbEjjr1fzsJEIQ6qWbC+xmfXnARV8sloauoQ7FI3xTzjmdjQ6YSo2F7jJj/d9c3mwWEiLpznvgmBXueM3yAkdF/CZEpSzQ== X-Google-Smtp-Source: AGHT+IElMafmO0iFXwDR0+7CzCUGev6hpojfis+mNQcSOlf8llgVgdGCzl4BRIMrVsfHcXpt5sMR X-Received: by 2002:a05:6a20:7fa5:b0:1ad:6c5:4ea1 with SMTP id adf61e73a8af0-1afde1b6fcbmr35139037637.41.1716203489923; Mon, 20 May 2024 04:11:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716203489; cv=pass; d=google.com; s=arc-20160816; b=khAi6+/4qTHXx+Ex/s6Cz8siQ33SbUIt4Duyq4rdRb+71NxFSLRyzjCftDGQExbTKS Gj48uIeRwoCZG5f2qzbarksgwtbzFT8/mc06/zJ3NSa22bGmjAkZt2dqbmJRrwg/NsEi 8G5KVCNGRHd/n9DM5lEr5ot6vNv5oGR0moFoBvxQSTQTQq+1Rtt7tjyZO66Oq/uYhQlB U+RsBQ9ZsMk+Vl8nNFE7oTNw+i2w4GHwyNwcjVjtM1DA3AMNrmmcXiksWm5pqo9L/cnH orFsQbBNIp4eVVKVna+L9OY3IPt8NRblZYHZQxVEPBBUd6/TqAMcNf1K5lu7ebUjIEKY Rd9w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=eTAHXovdMrNnDX5CNIwPDo86fcFlzz9zi6EnBgBKmYI=; fh=WEMON4e1TuCgyDfxxMJb3TezT3apgRdA9UTBoVBFTTk=; b=mgdFsb7TlekW3sXl7gR4p+TN7Zxz5SNzudFt661ly+QmIAcjR++LcmWvwjJUZknPNX gk1X9AwcQiDdUPPGr9OrtNfMXswvpTcC0GKE6Lcjrl4rvvKeNTL0QaHu1j7rcfZ69hfO SoEoHmAjMnsrIB9kbv3BT98S7RpDKUb0GENIXYaVEB7pAFy2ad0bVsA8KPs0KC0FL1vo /UaZvKkhkhA/Rr8J7TXhqkN1Q4rh2ySNpLbr9CWZFcyV/rYLtw3ykxOelR0RWscb+EfE JfdpMvh0esUBslVjb636OdjLbudMFle/BWz4L/JtgDFr2YkrxSknts/jvERZV0VR2zgA ac+g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=L+IExyoC; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-183646-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-183646-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d2e1a72fcca58-6f4d2b198d2si3089222b3a.291.2024.05.20.04.11.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 20 May 2024 04:11:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-183646-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=L+IExyoC; arc=pass (i=1 spf=pass spfdomain=linux.dev dkim=pass dkdomain=linux.dev dmarc=pass fromdomain=linux.dev); spf=pass (google.com: domain of linux-kernel+bounces-183646-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-183646-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id B1F3F282FF5 for ; Mon, 20 May 2024 11:11:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E76EA535A6; Mon, 20 May 2024 11:11:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="L+IExyoC" Received: from out-182.mta0.migadu.com (out-182.mta0.migadu.com [91.218.175.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DBB78182DF for ; Mon, 20 May 2024 11:11:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716203484; cv=none; b=KBcSysSbDlNguP1XGLbYVkm8agD3X0VaDXfxtQMLwLD2q9XbwIZW/zhNln10gSj6uveIvsvLAZQ2LNmcH6yGRa4fYbGP31sukbC+IB327eurrVjRZTWQmpEe9riopgpKPVt+I599aZY+0ECPLwiFfqbUAkQsswxyuF0u978WuHI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716203484; c=relaxed/simple; bh=5jFqwLmq9tY3CQ4VXL1uWu//9MBwh4H1Ow9KZcCtLD4=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=CiRFnpLDcznHyKEo84bUoqVe+ieDqqdrXmiN8WUU7SMTTlxj5oAffY8epEMIXyai9P7j/PiAWRzAG/KP8gP5sMdvwCaceEb6GaoHOKBf48bhFoISfo/RFt0AbPQDrDT20QfTNEmU1q9a7p+Un2HLBQChOydQt4aowiVyobBouqk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=L+IExyoC; arc=none smtp.client-ip=91.218.175.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev X-Envelope-To: dmitry.baryshkov@linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1716203479; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=eTAHXovdMrNnDX5CNIwPDo86fcFlzz9zi6EnBgBKmYI=; b=L+IExyoCRf2audl+y/F/pxSEby+KilHy6ybQ/3eRbsJoKvj+RfSH97i+B5mHHq+8wdGhHH W+/LctJSgWUC1aQJ+dqn2RKySgnLqbfBmfUvTgOux5aH1N9tUkB3yBsoCE7B9stC7UtMRo famdbdf2KGjdOnrMEBs2FN5PxCGhMzA= X-Envelope-To: victor.liu@nxp.com X-Envelope-To: dri-devel@lists.freedesktop.org X-Envelope-To: linux-kernel@vger.kernel.org X-Envelope-To: andrzej.hajda@intel.com X-Envelope-To: neil.armstrong@linaro.org X-Envelope-To: rfoss@kernel.org X-Envelope-To: laurent.pinchart@ideasonboard.com X-Envelope-To: jonas@kwiboo.se X-Envelope-To: jernej.skrabec@gmail.com X-Envelope-To: maarten.lankhorst@linux.intel.com X-Envelope-To: mripard@kernel.org X-Envelope-To: tzimmermann@suse.de X-Envelope-To: airlied@gmail.com X-Envelope-To: daniel@ffwll.ch X-Envelope-To: biju.das.jz@bp.renesas.com X-Envelope-To: u.kleine-koenig@pengutronix.de X-Envelope-To: aford173@gmail.com X-Envelope-To: jani.nikula@intel.com X-Envelope-To: bli@bang-olufsen.dk Message-ID: Date: Mon, 20 May 2024 19:11:10 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Subject: Re: [PATCH] drm/bridge: adv7511: Exit interrupt handling when necessary To: Dmitry Baryshkov , Liu Ying Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, andrzej.hajda@intel.com, neil.armstrong@linaro.org, rfoss@kernel.org, Laurent.pinchart@ideasonboard.com, jonas@kwiboo.se, jernej.skrabec@gmail.com, maarten.lankhorst@linux.intel.com, mripard@kernel.org, tzimmermann@suse.de, airlied@gmail.com, daniel@ffwll.ch, biju.das.jz@bp.renesas.com, u.kleine-koenig@pengutronix.de, aford173@gmail.com, jani.nikula@intel.com, bli@bang-olufsen.dk References: <20240516101006.2388767-1-victor.liu@nxp.com> Content-Language: en-US, en-AU X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Sui Jingfeng In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT Hi, On 5/20/24 06:11, Dmitry Baryshkov wrote: > On Thu, May 16, 2024 at 06:10:06PM +0800, Liu Ying wrote: >> Commit f3d9683346d6 ("drm/bridge: adv7511: Allow IRQ to share GPIO pins") >> fails to consider the case where adv7511->i2c_main->irq is zero, i.e., >> no interrupt requested at all. >> >> Without interrupt, adv7511_wait_for_edid() could return -EIO sometimes, >> because it polls adv7511->edid_read flag by calling adv7511_irq_process() >> a few times, but adv7511_irq_process() happens to refuse to handle >> interrupt by returning -ENODATA. Hence, EDID retrieval fails randomly. >> >> Fix the issue by checking adv7511->i2c_main->irq before exiting interrupt >> handling from adv7511_irq_process(). >> >> Fixes: f3d9683346d6 ("drm/bridge: adv7511: Allow IRQ to share GPIO pins") >> Signed-off-by: Liu Ying >> --- >> drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 3 ++- >> 1 file changed, 2 insertions(+), 1 deletion(-) >> >> diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c >> index 6089b0bb9321..2074fa3c1b7b 100644 >> --- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c >> +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c >> @@ -479,7 +479,8 @@ static int adv7511_irq_process(struct adv7511 *adv7511, bool process_hpd) >> return ret; >> >> /* If there is no IRQ to handle, exit indicating no IRQ data */ >> - if (!(irq0 & (ADV7511_INT0_HPD | ADV7511_INT0_EDID_READY)) && >> + if (adv7511->i2c_main->irq && >> + !(irq0 & (ADV7511_INT0_HPD | ADV7511_INT0_EDID_READY)) && >> !(irq1 & ADV7511_INT1_DDC_ERROR)) >> return -ENODATA; > > I think it might be better to handle -ENODATA in adv7511_wait_for_edid() > instead. WDYT? > I think this is may deserve another patch. -- Best regards Sui