Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp2128491lqo; Sun, 19 May 2024 15:11:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUSD+qODddUFpVZmvKpaA+X/lANHMVabbJLtwVRrcopYHQVQjank8lkyn1DpvWig93GJBDfm0fgC3XafdIXNK0n34jq5viR4JGHB21TbA== X-Google-Smtp-Source: AGHT+IFdW89vo1WAvnQOzw1qy01f5m9NRQeBFrs//wTpLfL8oFr70woovbg7p9fNQYfaSG1BRa06 X-Received: by 2002:a05:6214:318b:b0:6aa:765b:c8d3 with SMTP id 6a1803df08f44-6aa765bc929mr18183516d6.36.1716156680284; Sun, 19 May 2024 15:11:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716156680; cv=pass; d=google.com; s=arc-20160816; b=uAce96WQDJnSxw+ZiSj3+Xgnco9gBTJwj7rsqCv6VaKQ/DNWlOz6cbHp1qkCmtD411 Ejjxbbg+BW6kG7IPcxXh2ZmoROt8M5L2o8YVy9bvCYNt8Lsv6wfX8yysNaWWO763v/yB pgwP/JT7L/ObC8Dd+xKo72v4oiIg2K8PuABCVHcDpp8wF+JO3X4bSU3nLpqXa1saL/Yk YMf/wiKQJncESKeoB/NsqkSQdxPQlLEDwmXrHKN2S0H9IUnjfgoDEDhZjoLgCOUjto/W zHm7bglE7nzsvZanQa0tCZCKVtBWcxX24yMpzLQbWngazS1KamunZkQXpCXVzVnjtn6I B1XQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=O1yu0CLdWydH2A7Dq3K6QV2l9Q/wS/S04PP8RXlFT9Y=; fh=J9IWAWS7GJND1W0dJ3AVrxM6E8GyeZ6n93Xam+H7FuE=; b=KPv/SpkSCLq7VVl6YN/etqQ/01zoF1dJHdQHCL5toP4zCu++62LlkzwSv9X/xF7Fl8 ZrBUDp5BrhjMgOHUdIUCvUaokx3hWWFj5KfJPOYrAfZ7pDP0p09t6BARktRoz/UEb8YC w8vY1IxMRkd408RW1NQNEh2sE7XWdR/cnIWdlBar5IkvrtrpkkNeJqVkEenJdkALHPeZ +18bwgaRf0LRMzBcLb8zUuZq9V1q9WuTsoJKglqJJOc3g9SuDbbTNwObTKjcuovAF4cY jlBRoNexk032PP9apdrGQdFzAX/Ywa/q9Zs0W2255lkNrGZZW5og4xl331yJQXz3hyyU JSrQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bUveik2i; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-183284-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-183284-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d75a77b69052e-43e011696a5si16920241cf.484.2024.05.19.15.11.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 May 2024 15:11:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-183284-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bUveik2i; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-183284-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-183284-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 085811C208CE for ; Sun, 19 May 2024 22:11:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 31A5D70CC9; Sun, 19 May 2024 22:11:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="bUveik2i" Received: from mail-lj1-f181.google.com (mail-lj1-f181.google.com [209.85.208.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 889FC12E6A for ; Sun, 19 May 2024 22:11:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716156674; cv=none; b=DwnE4cWeskTqJyzy4Q65n7RYBm4nAQhvAWIeSwc/ycufUFALfDicfSaYeKT0zXqkAXmxIcxNjPTjZ9n78Nd5qyQ0X6ZhKxAodDKoGK0uGQP3DrfzYnn4NaiQ99wcD+7VBnVYs2UYYTObOJSHB9WYuQ7SDR4lhi6YFgvxiVtJNok= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716156674; c=relaxed/simple; bh=cuNWaWioxQi1Xv8Pp9i+PgfovACt5mGV+R9zr6jl0CE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=DJ7kKqDN3jyrhvslJLFFo6VcPbNEi6BfV9knWeL1dsTIx6G0ufDyP3sOIhsmU9p5vsL4Ak9TCS4Vw4LSc+TNG8nC/Q+L2Opv7OLpLvncDuwgTMG2ana45IfVOb2Jkz6W+oPlGfs5OxqldPa3haM/8sodnz3PPTiHz3SVDS/Chcc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=bUveik2i; arc=none smtp.client-ip=209.85.208.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-lj1-f181.google.com with SMTP id 38308e7fff4ca-2e4939c5323so48770441fa.2 for ; Sun, 19 May 2024 15:11:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1716156671; x=1716761471; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=O1yu0CLdWydH2A7Dq3K6QV2l9Q/wS/S04PP8RXlFT9Y=; b=bUveik2i6bmN/y+Ue4c5UwToVrjezN3KnghGg7TZffgE3l4tT+4PK2X2XDPad28Kix dDIB9kevlAJwdcW28epmq8t4DLuZxI2LzJDijg0BsjsYeVIbMS37DxfGB0DJSfQ47XPU rZGPsVhrc64pZkjxPyrIRgtsVZcVgJOr0WbyaMvTy1L90igHGEiEyz9yGC/lJwp3F6aT aJsdNJWhD/PjlLDghkVBzXsek6kpoDD7UMMyFiF7knBP6bcHEqdnIq3hW+Xb0+fmqaY/ 5b0wCmMW7bVhQrJejEKG3uNmMq0wLxESLRGnRZNKCCucejh0UTggvw2Lhcm/50isUpi/ sB/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716156671; x=1716761471; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=O1yu0CLdWydH2A7Dq3K6QV2l9Q/wS/S04PP8RXlFT9Y=; b=uRc1HEY3oQLvgzIQGKEBFGjRjLXKFfRcTvAahY/Ah/yIrl9a8LRy6VfDfHQJIbe0Ik 9TT5STGpQPqCKZOfiTbCI00YENe6bo67xVZqkZSiIsp2wMDp75+wr5tSR2fosepD8R8f WF+HHTx4DjD6NPP4BYvR50bGwFUOqZroNjMYwRnnVadIki243yDu8e7NfP2fUqQ+w96F /6gdmE6papwsPl5NckA7m2EKaKD4kQ723hr1JxzsIPVPjWP7UYEcwR1ACURMiW02Bxp0 w64d3MD9oqaa2Y8kHBDndf6QukuynOfUMYi8ZLk2agneqKKj0KVTY5HmJsl9rtBxmi/F iHgg== X-Forwarded-Encrypted: i=1; AJvYcCVdx2KpBJXLkciQ7UPw5Y8yvVw1VIsqbPdAHeEKdkxR2Dd2lT47999748Kue9YkBsNqKyJz4MVykk08+/zJoGH5aCH55xokezEv4Z3E X-Gm-Message-State: AOJu0YzHUSR1MuVAzo3EJgo5sfMkqiuLRQ7CVDB71hLfr7y3NMiWldgZ XQG0udUbeoA/k9xHn2uq0sB7jhNj7hXIcH7VcAcH2oNErzrFMkkZAb/xqVfyMmk= X-Received: by 2002:a2e:9497:0:b0:2e5:59a:591b with SMTP id 38308e7fff4ca-2e56ea3aeb1mr220998471fa.0.1716156670718; Sun, 19 May 2024 15:11:10 -0700 (PDT) Received: from eriador.lumag.spb.ru (dzdbxzyyyyyyyyyyybcwt-3.rev.dnainternet.fi. [2001:14ba:a0c3:3a00::8a5]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-2e6fdd1089csm11801621fa.110.2024.05.19.15.11.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 May 2024 15:11:10 -0700 (PDT) Date: Mon, 20 May 2024 01:11:08 +0300 From: Dmitry Baryshkov To: 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, sui.jingfeng@linux.dev Subject: Re: [PATCH] drm/bridge: adv7511: Exit interrupt handling when necessary Message-ID: References: <20240516101006.2388767-1-victor.liu@nxp.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240516101006.2388767-1-victor.liu@nxp.com> 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? -- With best wishes Dmitry