Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp209918lqo; Thu, 16 May 2024 04:14:00 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU7Zeu5/VUtuX9w2LvLF7G+Tus8alXJK9ELDaXXnB9TTPWAvwnyW+nInWbA8cKF+XvPRWlhQP6765l1FJ7+vkgD08EQ5O+ZXyt8c6DGwg== X-Google-Smtp-Source: AGHT+IH4aLfWOjG43Y44doQvCUJXXSrzYCQChjuw8RSEs0YR5nty2Xs/vz70fGqqQQoFyE0ho4Wr X-Received: by 2002:a17:90a:c8d:b0:2aa:8130:e3eb with SMTP id 98e67ed59e1d1-2b65fb18488mr32606401a91.11.1715858040701; Thu, 16 May 2024 04:14:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715858040; cv=pass; d=google.com; s=arc-20160816; b=Ohps3ZVfDLbuf6sGiLprFrAucfChtTwwOAkkb/4sD9dQJlsEpcB56zT9sE+ftMB5hs HiC0mmlT+HQJCkcmRu/vBtyOU+pGmaaeWX+7NRFwAbHZevMzUuX5HQ4jr26TJqFKLeip eAB2FpbKtxvJrU6sI0qVr25LdBAXjjo8yWi9lYE6xcEC153Dv9klqg0Fejt/MiR8+oSR uUKc8YXn0OOquqJLdOedoLCDC4yAyjTL7xc31heO60XUrMA/FEqyDt0gmfftd5EMPAMF rWKfbEN6eexyk9pgMtVcn5/cTgCTeUb7qjP2xE0pcWSmDGZy6Y0vrt4im4WPAV9CQPTj ouow== 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=BFIHxeP9M+LmvRKzSaSABRLWtsMlPkWTGAKIdrDLly8=; fh=oJgrcVn5bM2LYAMlYxBEH4toQIkMhw1syUW4hIO+uzg=; b=f8bS0ky3ZX/H3tMpw6srxKjJWHQY2RQx8AItpNIhJ5Kf/HGs6So2Q6DTrwhdzebdmd PTrd2faN2yLBdinncL0X66tn0SliKDuAR68y5EbmP1PupAhmJBFbzheZtc1hhCKe3P0B j60QGlC4ZMY3ETA6n5sNlApSCCLsZRgx4IPHg0RWmdtuH2+cbz3XaRbhdIFwk0TD8YH6 rUmXmTlmNq/OSxqucYrzPxX0KgJUOkqmYcBD3jrm66v8UM7+Xgr/1NuxHnqpGnuAdY27 qyfLKAQ4zkdmy6Eh9H3UMdHazXRWEXf96eQGE0MV2mx6hx4fTc16kjrWc0UvTpJg5HJ3 DMrw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=V3QLOFjn; 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-180929-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-180929-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id 41be03b00d2f7-63412a4e0b4si15383557a12.697.2024.05.16.04.14.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 May 2024 04:14:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-180929-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=V3QLOFjn; 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-180929-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-180929-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 191D3B2308A for ; Thu, 16 May 2024 11:08:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1296C1459E8; Thu, 16 May 2024 11:07:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="V3QLOFjn" Received: from out-177.mta1.migadu.com (out-177.mta1.migadu.com [95.215.58.177]) (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 45032145349 for ; Thu, 16 May 2024 11:07:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=95.215.58.177 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715857673; cv=none; b=koGyUkmoq7lTMzXrFcSeyh70RVCXgwOZ+ohlddQLLjK75PJQh1CP71GLn3tXKoiKdeykxM4zrNuUlNcF8WEzk/vsIG+/7Y4UtBBQAkz4/uGv/QOH+Bt5K2MuhVczYU218Cn7Qs7tDgv9gs6niiCJ8HeRAJAOMyIBHPdcekuBG2Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715857673; c=relaxed/simple; bh=gB+RPtrAuYH3wBSkxeLUb6QdyugdGBCAugKEKXqfFI4=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=WKTTTPzkp0BMjnt/lYCJgZ8ODNHZbTPxv7WiFD95ZnlftiWXTDRYTO9xlyyQXClqHwnpwMZea70anSfIXTBW9diSO6xvOkDpQKrashcTexCv/sSeHruIAyCPr6ifVccz1c+XTC7GA+nWtncmrEl6V5J1KDsHelab7fSRjhr2y9c= 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=V3QLOFjn; arc=none smtp.client-ip=95.215.58.177 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: victor.liu@nxp.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1715857670; 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=BFIHxeP9M+LmvRKzSaSABRLWtsMlPkWTGAKIdrDLly8=; b=V3QLOFjnOS2kYE0zTuy6tvxGcsj+0CGXSiyOwMide0cs2H/kJ3N+C3vkmgNKLYb7vSVlHb +3PRTkyVw38DzQoLmy4x4uo1w1lBkyRRu5eu4/tPRFcQ1VqMjuYhq6sM8GS89k2jNwZtkW IvSks78CXOkxPEbRNmexG96GxdpIX90= 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: dmitry.baryshkov@linaro.org 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: <0ae84b3c-9935-4cb5-9ed5-3fc87a416857@linux.dev> Date: Thu, 16 May 2024 19:07:43 +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: Liu Ying , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: 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, dmitry.baryshkov@linaro.org, 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: <20240516101006.2388767-1-victor.liu@nxp.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT Hi, On 5/16/24 18:10, 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 && Maybe you could use 'if (process_hpd)' here. > + !(irq0 & (ADV7511_INT0_HPD | ADV7511_INT0_EDID_READY)) && > !(irq1 & ADV7511_INT1_DDC_ERROR)) > return -ENODATA; > -- Best regards Sui