Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp176710lqo; Thu, 16 May 2024 03:01:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWR53oVwIRKMiJ4+vWueTwXXDhhog8Q34Jlcll6d5Ex+T1+0IpWiw6oQ+eZlIjM+rS1KKkfZ2TX7cMVDCUJ3r/ro+nSFdMXlW0HpbgQZQ== X-Google-Smtp-Source: AGHT+IGenLMiYGydDSCBTG5ZHmGQfYec7Oe2VIHItlVzZxkCu8+ZyrtjP6JoDm++Dxaf384jic95 X-Received: by 2002:a05:6214:4497:b0:6a0:b3eb:5626 with SMTP id 6a1803df08f44-6a1681a167cmr229678266d6.39.1715853710879; Thu, 16 May 2024 03:01:50 -0700 (PDT) Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id 6a1803df08f44-6a15f1d745csi164303066d6.49.2024.05.16.03.01.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 May 2024 03:01:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-180879-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@nxp.com header.s=selector2 header.b=gQEx10Ks; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-180879-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-180879-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nxp.com 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 8D0191C2292C for ; Thu, 16 May 2024 10:01:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4EF23143887; Thu, 16 May 2024 10:01:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b="gQEx10Ks" Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2069.outbound.protection.outlook.com [40.107.21.69]) (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 126AB143754 for ; Thu, 16 May 2024 10:01:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.21.69 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715853704; cv=fail; b=HqoxOhAYIf7a/tBY+M7TKgWZhGOhuY0oppmKDAyk53bhd3lmDOKKaZAxUKYbn4aGoVM35JSnKdTOie1LJcShELtC8jnyJAjCArG2jm2mM/ksjcUlsjZHyDvGKdB2nNb5xaWJXqV1yeTWB27Ax7zC09gChPA6OX4p9LI7BlNNbHg= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715853704; c=relaxed/simple; bh=QFrScN0l1VuI+Rh4cj0oVoNbWlruiE7yuNHc2KfE/fk=; h=From:To:Cc:Subject:Date:Message-Id:Content-Type:MIME-Version; b=rmfdEWzLevgXbt95krKLacgGEpcFU3tsjGWY9v2tBGgmkVYgWr3oftjU33l/Q+ZEYrmcEYi7kVGcJo6zfTj8p/TPHhULTYLkDBphgE0LrliGTO0+RTWQ6iWXFUpfLofyqIC1d0fF3rpatQSr0QhxmlJBWgpuTe4dwHo4KCmOqmw= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com; spf=pass smtp.mailfrom=nxp.com; dkim=pass (1024-bit key) header.d=nxp.com header.i=@nxp.com header.b=gQEx10Ks; arc=fail smtp.client-ip=40.107.21.69 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nxp.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IE8meJojtAr9r+A3f1G+GDgQdinv81JkfJNmnxgaS3VL1WVEwGYo2ZkuWbFzUTKQe/wioqKMzpavayn0UO5/G1CuT/rNmYvQLCFBnL8WIiKJ9sg/dhA0Sq9im/HtvNLc/UzFPDR7duw6H3qXnZ3GD4Tr4tJ1ljqY4EKgeKRThZGLNb9aGCn4XQ6uqZYMPmMjT/Qhhk1k/OMEN2f3alVHLNFr5GyieGq7BWQkbhiUSOp0p1YRSCSPHznqRKKQ1EUahPw+0G6iuccrusRPK2/yOMp42plIOvzp1zfSiO7RwNrTsMPL6yX+iTpQCLjhGzJS7JD4FuGxiyPhashLMYclAQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=9ymfew+mbBrL2SXJHCFkAqeivGXDN8OSDVGpwMbLmEk=; b=VFeC/ax8is671sl6szmUrKCbdJc1tPwW0boHjvNNz2ZjGwIgJsk9WfrA4+QsvFWT4QjOoWGlro+T0MWzvKuUVsToF62a8puOcxrsYLe7wMw+4CtqM1YHeR2CiJlsqpdsOLldl78Y6zfLwOTMNO/K1gR9S7pw3/b2oGl6wNWv1g7luOkmYobu3WFjaj2lNTzqH53tCkWA1XjN9XEaHwiLUBS5YI4PjHTaG0Eof+5SGvgHy+e0JXF7qynVklgq4VabunhPBWCDtfIurXtfPU4r/JSlOe8U+P2n9Chq6iKvxtEBX7i3IpM92LfVIuAYcsxVfxQXezd5AXA9f6owT1eRiA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=9ymfew+mbBrL2SXJHCFkAqeivGXDN8OSDVGpwMbLmEk=; b=gQEx10Ks8eiWYD+WXSd59BKrTY5r8JgKGStGCyXmljaDadiPA/AXZrZNupP+2607yROEzwILhR+tl8UbYyJ6Ym1z3WkBU0CkofUhazVOIiq8TvfbWlcB3wMBpqPePEo+k6MY3YlJV7/Xqb90DVtWB9CdYYgU7pqImeCPy/5vEwc= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) by VE1PR04MB7232.eurprd04.prod.outlook.com (2603:10a6:800:1af::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7587.27; Thu, 16 May 2024 10:01:36 +0000 Received: from AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::d1ce:ea15:6648:6f90]) by AM7PR04MB7046.eurprd04.prod.outlook.com ([fe80::d1ce:ea15:6648:6f90%3]) with mapi id 15.20.7587.028; Thu, 16 May 2024 10:01:36 +0000 From: Liu Ying To: 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, sui.jingfeng@linux.dev Subject: [PATCH] drm/bridge: adv7511: Exit interrupt handling when necessary Date: Thu, 16 May 2024 18:10:06 +0800 Message-Id: <20240516101006.2388767-1-victor.liu@nxp.com> X-Mailer: git-send-email 2.37.1 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: SI2PR02CA0014.apcprd02.prod.outlook.com (2603:1096:4:194::19) To AM7PR04MB7046.eurprd04.prod.outlook.com (2603:10a6:20b:113::22) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM7PR04MB7046:EE_|VE1PR04MB7232:EE_ X-MS-Office365-Filtering-Correlation-Id: ad8f8066-b1f0-4c66-cc54-08dc758f2bf2 X-LD-Processed: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230031|376005|7416005|1800799015|52116005|366007|38350700005; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?FkWqmwiHa763nOx5AtIetT9ZH/qenOcv26zEGRLmkz9UT0iJ/qhpZnPAelOp?= =?us-ascii?Q?PLDMGYPieZpm8MQW2ah2zN/S78XIbDHX3qjjB9Z8pzq6HJmHvlByYcswzfUz?= =?us-ascii?Q?qNqAp+yN+w359+eeJB8tj25pUvPu5kbD0QWdiI+96U15DMV4B12HH/m9QXm/?= =?us-ascii?Q?jKsFUzMuRNSIFpHXleTA3C4JoQvFYN9BPajhcZU3CRBU9Fi9XvfsJgAvf4ov?= =?us-ascii?Q?AtyMszXM7dvLwLQYdeA83ih0Jj4S+un0tRPiJJ355e61uvTcZ5hb53BPtzQo?= =?us-ascii?Q?EPRRaoJiv5P55HHv3frMYFi33tdIbWPGzr+wzrVMAQAk2z+So0sx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CpPJFonxunbI9ys92Bgw1kHIwO0535PxkE?= =?us-ascii?Q?E/VkXW20Xzx8xeO80GPzaJ+sOYtESxfka40AK0AWWO3Jxv2XVXxLU465qytm?= =?us-ascii?Q?neteIhzwQ2YfmUdOAoLn3brYfC1C09MfSagyGTzeRryCew=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM7PR04MB7046.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376005)(7416005)(1800799015)(52116005)(366007)(38350700005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?YGjgpN0Ze4IhwlWZZjuVCD1VF4bRvE5P9sVqDRPu4yxS+4MfAHmhoq3d+7dJ?= =?us-ascii?Q?36Dyyaa+/KVkF9cmswFjlKKaDFjbS1+hSAZnss4GOeYCVC/+QS8sw9ZsAnFN?= =?us-ascii?Q?AVtx/o5h2iEBT6WI1BtlkvFMVe8ZpQ0Ry5CzxJIEwGpqeboWhJS1/aECkNYf?= =?us-ascii?Q?J74ohEHrdp7+DlcO8Fxr33+7OANVRuI4WXSCSGP1kZLBr+Kmp8x0FNl+052Z?= =?us-ascii?Q?daUXpPuJf5iFweJFqgaoXMq0DN+zY7r7QkGMwFsLJE1/nBerZLJfYZ6aEL2k?= =?us-ascii?Q?Wlf+yPuOlCqd7iKEyzBYa+uDQCSGI+cYn02SVyXwKRHJ0x/GMll+PbuDwH2/?= =?us-ascii?Q?mOvvOrx8TL1d2DtBvRfez4Wbkp1Y+hYjnkf630ixjT59+ia5aWv5So5AbWvC?= =?us-ascii?Q?P++Oe/xONX8yBIj428UT7jjj3OGBaK6umigGR3KQetHA+gzu/ulUAXy78BHd?= =?us-ascii?Q?ttU3x6+xHDKhEnx4Olsz6wJ4DZILfUhQBnAuAcR69yroNDEtPf/dtz894W5M?= =?us-asc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qGGuThAUl+e4/zb3WUh07Np03e?= =?us-ascii?Q?JpPTEe2urX/G1++WHH8GobTwl6xmWB0XOAV/NC3cl0sw3NkT9Wd37BOj4IrG?= =?us-ascii?Q?8oR/Py18enNDjI71Ug+w0QVRPTIDL1QkTk64n3DaFfumLy0gdJQtYUHsNeSC?= =?us-ascii?Q?TEpOmhnhE778dWxSkxHel2QOwLWUzrQemHTXF3fL?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: ad8f8066-b1f0-4c66-cc54-08dc758f2bf2 X-MS-Exchange-CrossTenant-AuthSource: AM7PR04MB7046.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 May 2024 10:01:36.0542 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: jdPEP+GC8qduQeyYelVsFZzYhG4isVvLk4nzNuLiruZfWWjjBCh8KFE0dZF5kGa3VMRKmobZ9SpDZ/abFi52UQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: VE1PR04MB7232 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; -- 2.37.1