From patchwork Fri Feb 2 06:42:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shradha Gupta X-Patchwork-Id: 19818 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:9bc1:b0:106:209c:c626 with SMTP id op1csp247718dyc; Thu, 1 Feb 2024 22:47:26 -0800 (PST) X-Google-Smtp-Source: AGHT+IG/HCwJETHc5ccieWxHC1hizmrebRSX5lc1qnAvzgkLVQcwQa6J0TlN2eT4XpMzRQ8YOKRl X-Received: by 2002:a05:622a:50:b0:42c:479:e68e with SMTP id y16-20020a05622a005000b0042c0479e68emr725489qtw.10.1706856445910; Thu, 01 Feb 2024 22:47:25 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706856445; cv=pass; d=google.com; s=arc-20160816; b=yFY4FJ9mPUgIxQ/WLIUCViKO8krclBpb019W2wqVP29Zc6R5uRjBzCZUjx5/oBPA7r FeGOG+OGuQ3y3Uu+zSBBWZoTdSekOhBffjn+o/u68ziGzREezakQQmVVsZbPTDpEOqWo P9A7giPgNF0sQJhGbw6IeBrH27THCFqV+Jcy5+j+jxTBbBgqgTOmMWi7QJV3fnZQtpXc DXPMDchL4LfTPI0PNXjgKXRr1NGileM3MzELl76HrMwcqkXrUw5vyVa92wZAkFd8Ywt4 QuTOdi8dg/eVTLa3MuQsmli45Zw5tMphAtwzhRrH8vzjwdWv+alPfJqZQh6vL7dMd6uK bq2w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-id:precedence:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=o0pt0AvQb9QH1NVN0Ep+6Z4WzLV/a6EZfES4iiGUlsM=; fh=BNQILlo5czBzHY+jEWD62ZtsoylDu/vozUIhFH7PZl8=; b=znqLAzZARVVnwym0KU7yXg8A7bf6z5ttutZ7JTy108akKY4yFnaEPeGVpwODyazKXE KgVKQsc5+JpU1CXEZRpUhDuVhBoJ25okRcshWMJgZpQy/n9WIPK6bwUXcl/lEbQSUBfX kaiGzpJXMATCMw43zagDCiFF90A8ht5QBvEs6c3pyuVm1iWZmqaLyrIXKRiYAwG4Mqid B1+kiOtEzfw1j6Jt8Z88+9F1Djv6zz+azINFgxpqhvYLH7hDN5N/Uf6ILa+SOWX+sUbT vISVdXSPYWpFFk4TKYsMDJWQdeuydcnrkTfuXhy5Dd09T06LzyZ72JqfiDvIJ13/7E9D AWuA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.microsoft.com header.s=default header.b=KmCC8OM2; arc=pass (i=1 spf=pass spfdomain=linux.microsoft.com dkim=pass dkdomain=linux.microsoft.com dmarc=pass fromdomain=linux.microsoft.com); spf=pass (google.com: domain of linux-kernel+bounces-49299-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49299-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.com X-Forwarded-Encrypted: i=1; AJvYcCVC5JBJ0xwKw1ig1TijibW0sQil9EoNtwcmgzMsZ9ByR/3PABDXRNjQqXdNy9No++qiSbjwL1FFHuqpJH0jLCxlI3Cuag== Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id y12-20020ac85f4c000000b0042ab59d82e3si1419540qta.475.2024.02.01.22.47.25 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Feb 2024 22:47:25 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-49299-ouuuleilei=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=@linux.microsoft.com header.s=default header.b=KmCC8OM2; arc=pass (i=1 spf=pass spfdomain=linux.microsoft.com dkim=pass dkdomain=linux.microsoft.com dmarc=pass fromdomain=linux.microsoft.com); spf=pass (google.com: domain of linux-kernel+bounces-49299-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-49299-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.microsoft.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 AF9DE1C24E6E for ; Fri, 2 Feb 2024 06:47:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 7938E1AAB1; Fri, 2 Feb 2024 06:43:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b="KmCC8OM2" Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4887C18639 for ; Fri, 2 Feb 2024 06:43:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=13.77.154.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706856186; cv=none; b=dPojef16b88IgJtRenJ4kRJXvWcrj4wKNQhMskU70dTRt2itmmEAOg4Pj9OeUhiIRlEqzi6maDojbWA/uHPwW07hJTWieHXa60ajvuj/ynrDOrffPbY1zCKtnsB37tX/jjSvLHa3ocOCXH/wVmEXYBpbQJuuowwsPANTJ33FoXY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706856186; c=relaxed/simple; bh=IeuTYvT2kSfyJRGh2TcyQfdT8Kl0+V+dExn2BrFG6SU=; h=From:To:Cc:Subject:Date:Message-Id; b=MsAsiUZas2JJbjE5y4AG49/oF/XleeJABZcSHp86G3093uhXL8e42pPuo6DWXeIA5V4RJceJAj+851A/twIp8rENvTaPeAw4G6SIlrn68TNs76XLJl8v2tLbBPkOG/NvyOWKFG9/oe0yC3MNSsNTrNn23J7OeBjG3BWqxmuUycM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com; spf=pass smtp.mailfrom=linux.microsoft.com; dkim=pass (1024-bit key) header.d=linux.microsoft.com header.i=@linux.microsoft.com header.b=KmCC8OM2; arc=none smtp.client-ip=13.77.154.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.microsoft.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.microsoft.com Received: by linux.microsoft.com (Postfix, from userid 1134) id C6F3F20B2000; Thu, 1 Feb 2024 22:43:04 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com C6F3F20B2000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1706856184; bh=o0pt0AvQb9QH1NVN0Ep+6Z4WzLV/a6EZfES4iiGUlsM=; h=From:To:Cc:Subject:Date:From; b=KmCC8OM2S7hF8N3oCUViQyTPIoi55pJb5EwGKN7K4YZ47h0ZEGrNIxp/xvusZqom8 1Lqtpe1qoUbzw5Y5PGkgmExh6VcK8kcOgymjVNH0g+/4wpgkI4SNCf/gsuLbK0Xfdq dZXHWtA1OOWy7ZaA4PlqFGbAw/8w8W3jRahWpn6I= From: Shradha Gupta To: linux-kernel@vger.kernel.org, Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, Saurabh Singh Sengar Cc: Shradha Gupta , Shradha Gupta Subject: [PATCH v4 0/2] drm: Check polling initialized before Date: Thu, 1 Feb 2024 22:42:56 -0800 Message-Id: <1706856176-9483-1-git-send-email-shradhagupta@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789768704487599462 X-GMAIL-MSGID: 1789768704487599462 This patchset consists of sanity checks before enabling/disabling output polling to make sure we do not call polling enable and disable functions when polling for the device is not initialized or is now uninitialized(by drm_kms_helper_poll_fini() function) The first patch consists of these checks in drm_kms_helper_poll_disable() and drm_kms_helper_poll_enable() calls. It further flags a warning if a caller violates this. It also adds these checks in drm_mode_config_helper_resume() and drm_mode_config_helper_suspend() calls to avoid this warning. The second patch adds a similar missing check in drm_helper_probe_single_connector_modes() function that is exposed by the new warning introduced in the first patch. Shradha Gupta (2): drm: Check output polling initialized before disabling drm: Check polling initialized before enabling in drm_helper_probe_single_connector_modes drivers/gpu/drm/drm_modeset_helper.c | 19 ++++++++++++++++--- drivers/gpu/drm/drm_probe_helper.c | 21 +++++++++++++++++---- 2 files changed, 33 insertions(+), 7 deletions(-) Reviewed-by: Daniel Vetter