Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp679998lqp; Wed, 12 Jun 2024 12:53:01 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXkYKk0gZbyudwpKX17fZTW/G1mqdMRlTFqvmBe4k40sTbQSgNSyLiDUl1xUK63YCGRqMNhkzQj+iHZz3jwofTyKoMBrc0b9+9pK/Z7EQ== X-Google-Smtp-Source: AGHT+IEU0zGRa8NO2w6xHrfvYtoh1P2aLIJu8ecRjL4+R8A/Gth8UhwhG+4nufderrCVuFwY7gVT X-Received: by 2002:a17:903:2cf:b0:1f6:92f1:b01c with SMTP id d9443c01a7336-1f83b799d99mr39749555ad.69.1718221981215; Wed, 12 Jun 2024 12:53:01 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718221981; cv=pass; d=google.com; s=arc-20160816; b=YS7iFFNfFMfCVR9uBLfbiQlzS7jMGCk6+QDlfnzmnvlzPVs6bfhnsVzDXo5Btlx6IP bu78glskj+dMmFmPZRlXUzF8osEW+RZk14mD0GmSavIehqi8lym4G/6NwKoG0f78y13D 6v+NuDRimltVClp3fKntIKDAiWQ9ur1v2L32OFxd4ewabympqO6jHdMmOyHCYSEo5o0J jlFkF4kEg+2k8vE5XR6SOeUDqopGljTU2dQWjpYTSG71tCLbcDLn3jtWD3ANzyB4thCi Dxyov8WkpjyzqTWswP69euUL7rGiwRv3EGfkG7eZpT5kLIsJzrJabgTMlE/jrvdHIyFF AVOw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:mail-followup-to:message-id:subject:cc:to:from:date :dkim-signature; bh=aB2lXUipFe+ilhQGDKfy5yRSSxNAEcN/w1KJXQoXXRo=; fh=Ga/1yiMK27SGtf3mpamXHuz2qjCluEoknY7UsbzpQD8=; b=DTnwPw6Udjjolpt/vs5iWqtu3uqBuLtzWBI9vnPnUdIyPBiWKTmOD9GElGIBen9IS6 1AXHsqJiX0y17VBpC35uMgrCN27Z9yT42SiFIKT7TMemfkC6LH13FQ1k3uFg20b1Bflu EWR4kt4WmF47K2p9bze5Xs3rsZDDeQtKpDZ5rd1Ag/bPpvuzwcjkxxky9eRh5j/pdL5X rQZbiZnBP8hSqcBROA2VkBKlekynZ7ov8p5RvNl4E0wCOGreuhuDYgonoezIaaa7JQCn Up03TnLERANG8t38rf8+Kf21DJBRg3w2GJ8jsUV0TicpJnYEzxs/BH0ZvS3cjOYql2/F ViJw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=hkOcCANq; arc=pass (i=1 dkim=pass dkdomain=ffwll.ch); spf=pass (google.com: domain of linux-kernel+bounces-211770-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211770-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id d9443c01a7336-1f6efd9c1d5si86480225ad.66.2024.06.12.12.53.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 12:53:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-211770-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=hkOcCANq; arc=pass (i=1 dkim=pass dkdomain=ffwll.ch); spf=pass (google.com: domain of linux-kernel+bounces-211770-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-211770-linux.lists.archive=gmail.com@vger.kernel.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 33CD4B2910D for ; Wed, 12 Jun 2024 15:14:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8DA51181323; Wed, 12 Jun 2024 15:13:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b="hkOcCANq" Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) (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 DC06D18131C for ; Wed, 12 Jun 2024 15:13:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718205189; cv=none; b=VlWOnKulYrHpwzwGEbFZMql/fV9JgiSSt459/ZQzu5ktKGmkFoDBw1ydERDSH1gTdDmixccvFj/hytjwJKzWwAPE5bqS2bwGr463RGYIxJd5024/9vlb+HddHy+A1JXjYdfGGNBHDaRxHJiBP4Lm0S1D734Obz/qlNeYHmhshOo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718205189; c=relaxed/simple; bh=flfZFIJ3Ruh9pFgp4NIRcL7v+Dq+/bgpsa+cad/DG4E=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=tHNpFaoBkYA0Js1+Y7tggIXAX6a3wQzhbSRAH9hyobIsFp5ZIRaKaGQYCiO/b0AvSCjsOYctnfmp9Dgs4/1fWPOBRvTN8jn/6crSAAT6c9BDsHJURWhH44fjhGPXiHtLWEh0krkrZK2kv+BJE9F6/mb2qM+KvOGLxNGPqv6v2p4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch; spf=none smtp.mailfrom=ffwll.ch; dkim=pass (1024-bit key) header.d=ffwll.ch header.i=@ffwll.ch header.b=hkOcCANq; arc=none smtp.client-ip=209.85.221.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ffwll.ch Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ffwll.ch Received: by mail-wr1-f48.google.com with SMTP id ffacd0b85a97d-35f1c7d1286so435796f8f.3 for ; Wed, 12 Jun 2024 08:13:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; t=1718205186; x=1718809986; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:mail-followup-to:message-id:subject:cc:to :from:date:from:to:cc:subject:date:message-id:reply-to; bh=aB2lXUipFe+ilhQGDKfy5yRSSxNAEcN/w1KJXQoXXRo=; b=hkOcCANqv0cbobXuBGHYwCXJcUQG8y3qU1cKfG/pp7Z6bQ15vN0b+Fzt1RTPo/hQMZ qbUZJlUkKBmO7jmhWzkiSRuZ5W01nq2Pf1s3lTS6X9NwkPurpkh1JbPs8B1Zp3lnSR/t gLEap5rVXHmT2usLvPy01MkDT9KZgnwYyl7/0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718205186; x=1718809986; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:mail-followup-to:message-id:subject:cc:to :from:date:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=aB2lXUipFe+ilhQGDKfy5yRSSxNAEcN/w1KJXQoXXRo=; b=uv/6J7rojbuQZ7kDzGqWYai4u3NxGTiOHY3owVMLh00S/pM9xpNU1B51HSN7wQ6Fp4 6TtQ3ZBBd0VLpiJpdjrtPAgJix0DqX8ojX097FsJm+D73r8Hv7ahdjhxfpVFfo550llR 3SS3tct0NFmpInqNBzlDEZkoouWGjoEkFr0Oc5GWpqSu2adtM+J4WcbOp24bID6sXHui 11efy900Nung1mXVx/V+f78wM681PrgLApef5SCEN4Bl8d0Rk/mcTfC2EfdyXcr2EuUE co2xfq1PcMnigANawFjxbOTZtzLOrZvK+lqgkxfwUfeMDTB12xBsSgL7U7OuxVkbPjKo T3CQ== X-Forwarded-Encrypted: i=1; AJvYcCWsEhTE48ARFPLyrYjhJuMzkKcEUrg3WRctW4zGYjZhQJJLXoUQ9gdaq4V6EtWWz9V1NMalU55QHzIEAdbH/k3Y6AL2aJIkaAXDz6Jy X-Gm-Message-State: AOJu0YwmC5hYNnpY94R64H3UvQ106DCdwwZBEDbw06BYjpXjCuHqeM9M sSGODDZLDu6VDq7HBsZY+V7rHKl+YCDU/KimAmStfka/bdcsKDs2M3BCKiFtLzM= X-Received: by 2002:a05:6000:1445:b0:354:e03c:b39a with SMTP id ffacd0b85a97d-35fe88fe708mr1617633f8f.6.1718205186150; Wed, 12 Jun 2024 08:13:06 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-35f30c04d63sm3301375f8f.110.2024.06.12.08.13.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 08:13:05 -0700 (PDT) Date: Wed, 12 Jun 2024 17:13:03 +0200 From: Daniel Vetter To: Doug Anderson Cc: Maxime Ripard , dri-devel@lists.freedesktop.org, Neil Armstrong , Linus Walleij , Yuran Pereira , Chris Morgan , Daniel Vetter , David Airlie , Jessica Zhang , Maarten Lankhorst , Thomas Zimmermann , linux-kernel@vger.kernel.org Subject: Re: [PATCH] drm/panel: Avoid warnings w/ panel-simple/panel-edp at shutdown Message-ID: Mail-Followup-To: Doug Anderson , Maxime Ripard , dri-devel@lists.freedesktop.org, Neil Armstrong , Linus Walleij , Yuran Pereira , Chris Morgan , David Airlie , Jessica Zhang , Maarten Lankhorst , Thomas Zimmermann , linux-kernel@vger.kernel.org References: <20240611074846.1.Ieb287c2c3ee3f6d3b0d5f49b29f746b93621749c@changeid> <20240612-garnet-condor-from-saturn-1c51bb@houat> 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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Operating-System: Linux phenom 6.8.9-amd64 On Wed, Jun 12, 2024 at 07:39:01AM -0700, Doug Anderson wrote: > Hi, > > On Wed, Jun 12, 2024 at 1:09 AM Maxime Ripard wrote: > > > > Hi, > > > > On Tue, Jun 11, 2024 at 07:48:51AM GMT, Douglas Anderson wrote: > > > At shutdown if you've got a _properly_ coded DRM modeset driver then > > > you'll get these two warnings at shutdown time: > > > > > > Skipping disable of already disabled panel > > > Skipping unprepare of already unprepared panel > > > > > > These warnings are ugly and sound concerning, but they're actually a > > > sign of a properly working system. That's not great. > > > > > > It's not easy to get rid of these warnings. Until we know that all DRM > > > modeset drivers used with panel-simple and panel-edp are properly > > > calling drm_atomic_helper_shutdown() or drm_helper_force_disable_all() > > > then the panel drivers _need_ to disable/unprepare themselves in order > > > to power off the panel cleanly. However, there are lots of DRM modeset > > > drivers used with panel-edp and panel-simple and it's hard to know > > > when we've got them all. Since the warning happens only on the drivers > > > that _are_ updated there's nothing to encourage broken DRM modeset > > > drivers to get fixed. > > > > > > In order to flip the warning to the proper place, we need to know > > > which modeset drivers are going to shutdown properly. Though ugly, do > > > this by creating a list of everyone that shuts down properly. This > > > allows us to generate a warning for the correct case and also lets us > > > get rid of the warning for drivers that are shutting down properly. > > > > > > Maintaining this list is ugly, but the idea is that it's only short > > > term. Once everyone is converted we can delete the list and call it > > > done. The list is ugly enough and adding to it is annoying enough that > > > people should push to make this happen. > > > > > > Implement this all in a shared "header" file included by the two panel > > > drivers that need it. This avoids us adding an new exports while still > > > allowing the panel drivers to be modules. The code waste should be > > > small and, as per above, the whole solution is temporary. > > > > > > Signed-off-by: Douglas Anderson > > > --- > > > I came up with this idea to help us move forward since otherwise I > > > couldn't see how we were ever going to fix panel-simple and panel-edp > > > since they're used by so many DRM Modeset drivers. It's a bit ugly but > > > I don't hate it. What do others think? > > > > I don't think it's the right approach, even more so since we're so close > > now to having it in every driver. > > > > I ran the coccinelle script we started with, and here are the results: > > > > ./drivers/gpu/drm/vmwgfx/vmwgfx_drv.c:1640:25-39: ERROR: KMS driver vmw_pci_driver is missing shutdown implementation > > ./drivers/gpu/drm/kmb/kmb_drv.c:621:30-49: ERROR: KMS driver kmb_platform_driver is missing shutdown implementation > > ./drivers/gpu/drm/tiny/arcpgu.c:422:30-52: ERROR: KMS driver arcpgu_platform_driver is missing shutdown implementation > > Sure, although I think we agreed even back when we talked about this > last that your coccinelle script wasn't guaranteed to catch every > driver. ...so I guess the question is: are we willing to accept that > we'll stop disabling panels at shutdown for any drivers that might > were missed. For instance, looking at it by hand (which also could > miss things), I previously thought that we also might need: > > * nouveau > * tegra > * amdgpu > * sprd > * gma500 > * radeon > > I sent patches for those drivers but they don't go through drm-misc > and some of the drivers had a lot of abstraction layers and were hard > to reason about. I'm also not 100% confident that all of those drivers > really are affected--they'd have to be used with panel-simple or > panel-edp... Aside from amdgpu and radeon they're all in -misc now, and Alex is generally fairly responsive. > In any case, having some sort of warning that would give us a > definitive answer would be nice. My proposed patch would give us that > warning. I could even jump to a WARN_ON right from the start. Yeah we defo want some warning to at least check this at runtime. > My proposed patch is self-admittedly super ugly and is also designed > to be temporary, so I don't think of this as giving up right before > crossing the finish line but instead accepting a tiny bit of temporary > ugliness to make sure that we don't accidentally regress anyone. I > would really hope it would be obvious to anyone writing / reviewing > drivers that the function I introduced isn't intended for anyone but > panel-simple and panel-edp. See my other reply for the proper design fix, and my apologies for what you stepped into here :-/ -Sima -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch