Received: by 2002:a05:7412:2a91:b0:fc:a2b0:25d7 with SMTP id u17csp8570rdh; Tue, 13 Feb 2024 07:58:21 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUUVqn1G7Niw8pAIVhwmjEj/iqqQQDM569hMY20Ny/u1wbVXv3o1bRMP5xWcERwoPyw/eBgzrrhxpReNV6ZUACmco84dFr+kj7gPOCT1Q== X-Google-Smtp-Source: AGHT+IGqz0iMPTSm8coCiv3fqrl1Hx6ONgcbhc4CnomVhd18wrGWwJxTJOIBum4Yzr6DEYU192ik X-Received: by 2002:a05:6402:31e4:b0:562:1365:34cc with SMTP id dy4-20020a05640231e400b00562136534ccmr36296edb.33.1707839900919; Tue, 13 Feb 2024 07:58:20 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707839900; cv=pass; d=google.com; s=arc-20160816; b=q6x4F4V4UWVRbqEcrT3yjiEwio4U9gW52Rcyx+Iw4JkVOLnsUyQTebUYuE6hBvNsmE i4Cnd9tIcKNstaq4wseh6lNL1rMyxvsiGOXbZht+Hv7dDLO5fSgwxIsGgTGtAMIuVqWh ExvK6roqqYVvPVxEJzS5tYVpvEn+Gvt/yNDCXUWriJGjTCegESiaImqlK51f64nXf6PO A97oPmfpy4JN1SUcXYa9OFPLLn8+VAwfzzrpLAWPSG2CPAktScdPk0o86NqK/ysqQ4Gq EUeA42gFdyRofRtCS8UEzPI7Xb0SvMZtg3Ln6a7RLYeFZihQ6jf6tlUeJcnHi4AbwAqJ Dsog== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=ZbboQjtqJl0kRKVmT9324agg2n3TuIJm0CfegMAaP2Q=; fh=/QrqDFMlwmfmbcBNXA63umrRtWrBkZA3awGPHUWD3jo=; b=xV3K8O+Ds/6duoVMcK3gavA+Ovc1y7xqYQdhbp//evdXa7Q10SDXZDD5OE6mbJqmV1 q2vOqm7tTVkEG41yGSkWYrvlW24ceONO9zgMCNALWtUy8NNmyIaa4wR2x0eOZxI+c6i1 Srtf651gewDWe10qslxmpAL1dBswZpoNaKdcj7xD8IHbqW9Uzws/Z1Y1vIMN6i8FtFxO nlFvuRR8ddd+7/PtA4x6mTeSvNrtOaz2L+c8UjnzAyrp51rDLSJjOP8JehbyaTiJOzrl fxmqjN0SV4CIzrm6pEeH0NDhcXaMPGyvd9ZznQs4BcUnnnDMiJosrBuONGeH8qBm0KCf x+VA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Y9lcql66; 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-63847-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63847-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org X-Forwarded-Encrypted: i=2; AJvYcCX+tWHjVRpKFzeL6IFkz+XbPxL6CLbh1xaTJ0MhhAF8CTZqB2TdPEFjs30YA9aZTP0/607XaROWqT41eZZ+oYFZKKMcwi4CA6mVHr8ugQ== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id s17-20020a05640217d100b0056154e4a2e8si3831685edy.322.2024.02.13.07.58.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Feb 2024 07:58:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-63847-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Y9lcql66; 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-63847-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-63847-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 am.mirrors.kernel.org (Postfix) with ESMTPS id AA3A71F22129 for ; Tue, 13 Feb 2024 15:58:20 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1C77C5F54E; Tue, 13 Feb 2024 15:58:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="Y9lcql66" Received: from mail-yb1-f173.google.com (mail-yb1-f173.google.com [209.85.219.173]) (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 A79145F476 for ; Tue, 13 Feb 2024 15:58:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707839893; cv=none; b=D9XYDD9v8SsUE8XGRF89wsaIned83gN5dbXwN57J0VCF26bT/CpTo7iu+X8x7Oy/M9foXy/dRTU90t4XJVvKY/zm23bhgnCTZ59nwW/iDlj9puI0moBIYFTSAGdYqF7Z6obt3IVCsnFRZnMHii9dV2SNTk632rNIXVjqiPTFFwc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707839893; c=relaxed/simple; bh=kLvA9F8Q8hMJy8VB32vgxuqt0GnA5jwxo56+WSiABbA=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=m1D8iyiSRjSLml8Pub7zdCHAWDA/cePsCEFdCtQK1jhs1KsLWJErNko4yfIem0RlOmuEateEzLZUE+rGiRpIrmEVzm5puWUBnNryrjTpimDK6IWf81jS37qY/oPxMyadJEEJUXDURbPHsZXlE0pHgsAgXJglxPmQ5lVSe/YyOnc= 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=Y9lcql66; arc=none smtp.client-ip=209.85.219.173 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-yb1-f173.google.com with SMTP id 3f1490d57ef6-dc742543119so3801194276.0 for ; Tue, 13 Feb 2024 07:58:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1707839890; x=1708444690; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=ZbboQjtqJl0kRKVmT9324agg2n3TuIJm0CfegMAaP2Q=; b=Y9lcql661sbMjDGa1J4VNDPMHa3OqwV0NJ0l4RT+Fug1giYT5C39RgXKjSM7nBmV26 lFA8NJAQ+5TQrnRYhV/FgZlY9lrrEiRO7EbduznIxV7N5q82uqkYbrckg8yGset1EXJL ug/PkKjvyHoTQRijxxwdLJVPeYVEWVd5S9afU4hlqerhK3pzLqSs8qIQLfEuaps4OMlD rBtreWa9urLgmQK6Xz4JmyTKKH230MKCBJs9k3UWr32P8byL9b25vMBKiCiZ0WoDI6Lv q+qm/Fiqzq71S8vPomx2weRZ4OfZrdUii7aU/8gztK3e+Hf3Ss6wc5xr/dHhbv71fEah XUQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707839890; x=1708444690; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=ZbboQjtqJl0kRKVmT9324agg2n3TuIJm0CfegMAaP2Q=; b=GQs/T1mrFqSarAwLbdUPpsnr4ag97Wvt83/iyjEAApOqItCPqgMtqe36il+G5WeQxz 5eGgroDtOfMSAiQY2jleG1SFut/HXbG+7suci34QAAPIRLDlhvXbpG3jnips/1sd5PXi dPLHjG7ii0eCM4HOvsiB690YQmnmS6jcn8L7hTUeOzLQZmYjuMC+4tU4uv0d/tHSyyAC imRsT5FXyPX0O6xfIKz+qz2T3SXgJZPA2ohGtM4Xm00Myb0IvqqWLrNtgz3mbmadkH5Y uyEkeccfkHslSWxyUjQQ4srKRkwGJPSVr2KhMR5NnEO9iSmV5b6W3jxGe/xT5zXq013O 44vg== X-Forwarded-Encrypted: i=1; AJvYcCVxGHt3QNPgBE8HoWYfxkagieEGZKHa9caVLOt+/wo1vIwIl8D1UD9vI3lXQBC+Gy3wu7wvrvIb+Z4s1jyBfKrpauXkVKApNIN/bPpR X-Gm-Message-State: AOJu0YyteKUGaaU6JohW0ThTK0QqT2Vog7bhrrC0N/N5Sf6WIgYSh9JY nSSoZaRFFd7+UQPILHv4k4MBLxfm7dEaxc/2/KCpWGTyBVGOmPUcvfrFLCsL1Wfz9sZBHDRx/LF SmscDSNmwZaI0vKmikP55B89cVguBJq7ZZP0GrmOX5OzOOjLkLbo= X-Received: by 2002:a5b:c4a:0:b0:dc6:e75d:d828 with SMTP id d10-20020a5b0c4a000000b00dc6e75dd828mr6861944ybr.18.1707839890663; Tue, 13 Feb 2024 07:58:10 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240212215534.190682-1-robdclark@gmail.com> In-Reply-To: From: Dmitry Baryshkov Date: Tue, 13 Feb 2024 17:57:59 +0200 Message-ID: Subject: Re: [PATCH] drm/crtc: fix uninitialized variable use even harder To: Rob Clark Cc: dri-devel@lists.freedesktop.org, Rob Clark , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Jani Nikula , open list Content-Type: text/plain; charset="UTF-8" On Tue, 13 Feb 2024 at 15:50, Dmitry Baryshkov wrote: > > On Mon, 12 Feb 2024 at 23:55, Rob Clark wrote: > > > > From: Rob Clark > > > > DRM_MODESET_LOCK_ALL_BEGIN() has a hidden trap-door (aka retry loop), > > which means we can't rely too much on variable initializers. > > > > Fixes: 6e455f5dcdd1 ("drm/crtc: fix uninitialized variable use") > > Signed-off-by: Rob Clark > > --- > > I have mixed feelings about DRM_MODESET_LOCK_ALL_BEGIN() (and friends) > > magic. On one hand it simplifies the deadlock/back dance. OTOH it > > conceals a nasty sharp edge. Maybe it is better to have the complicated > > restart path a bit more explicit, like it was originally. > > > > drivers/gpu/drm/drm_crtc.c | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/drivers/gpu/drm/drm_crtc.c b/drivers/gpu/drm/drm_crtc.c > > index cb90e70d85e8..65f9f66933bb 100644 > > --- a/drivers/gpu/drm/drm_crtc.c > > +++ b/drivers/gpu/drm/drm_crtc.c > > @@ -904,6 +904,7 @@ int drm_mode_setcrtc(struct drm_device *dev, void *data, > > connector_set = NULL; > > fb = NULL; > > mode = NULL; > > + num_connectors = 0; > > Nit: I think we should move all this next to the > DRM_MODESET_LOCK_ALL_BEGIN() and drop initialisation from the prologue > of the function, but it's definitely a separate and more intrusive > story. > > Reviewed-by: Dmitry Baryshkov After running this through CI: Tested-by: Dmitry Baryshkov #sc7180, sdm845 > > DRM_MODESET_LOCK_ALL_END(dev, ctx, ret); > > > -- > With best wishes > Dmitry -- With best wishes Dmitry