Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp3067166lqp; Mon, 25 Mar 2024 19:48:10 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU1mIQY877zccO/2gl5MVbXpxMaDgq3B5MrtuulRZ+7oG+O9uaPZWElADDFZ7GdLFhLYRhO0WOFh/Iyaa4094qbv4hpBz+uhuc4+5209A== X-Google-Smtp-Source: AGHT+IEM0xsR+crToTfDzyQfn6CqV3jqfmkidRxXqZxI246I7rCG7sdDD1KzfqHpnacOjePE4eCE X-Received: by 2002:a05:620a:f0c:b0:78a:5c9e:b606 with SMTP id v12-20020a05620a0f0c00b0078a5c9eb606mr3147033qkl.49.1711421290524; Mon, 25 Mar 2024 19:48:10 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711421290; cv=pass; d=google.com; s=arc-20160816; b=IH3UtNZZgq8VHarExcch4G/Om9HU2OnGn9NzjKE6UUSyOtK2BkLtovpsUPidVbNny5 64GEutWQxP6FUu2dXAyj5BSy9AfBiFUYIUJgQxstmIP3N/S4Q2aNoDCmoSkplT8NnzpC hYoroy9YW5Y1Pg/hlyEZbRDfYI4HYm5xNLaAjkyBGyz1GbHuH1BE+bEzQIrFRzTDqeyB 64mDXbG/vgu4M/sd7J6Z+wEw0zc2jdV559LLxk0Cj6Fk/pExc39y7/rt6XQjSUo4B6Ul 3hfRtrVTOpn5jNmPxzCPFakMf+CKtkP0kJVPuSI5DdZjbEVZCmLgNFDTNLHvCAbg5m9W SGUw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=W3RHnlDNM7ucEGSanjOfjX8tJ7kAUHNm5z9LD1vv6sw=; fh=1z/4mFxsJQ283lb/GasQqwWbI2pN8hZ+T194e3RiTBo=; b=ytWWcJL9RH0O2P3N5vu0NRJAi40ChHgQ8wVBhR00X4E3DjO7i8gpWMSs5Wy+Zcz81A hDr6hV4xnWdTjCaCuRw3uqr7+A7u8IyGwVNL9VX4rsRIRWKgl1aw4xg2nIgMCA5YC+7u wcCsN181ui+T2EaDasRUJQ50F3YmytxqZZBveaHtBVMszqSGKFnellL7ZMst6bXk2CnQ Aa2pt7UorqoROCvEJcRVgWDhnT/zWiqi84g/eeCdV2mCyEfm3AR67p2+kG0LdS9F32W5 MSP5W3vyd1M7C4+k+Amy/+wxQ2f6PPOSS50+6JkXzAZymF9bPioGRQlzsXxvwS0jIljs hSog==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@g.clemson.edu header.s=google header.b=VIQqYONb; arc=pass (i=1 spf=pass spfdomain=g.clemson.edu dkim=pass dkdomain=g.clemson.edu dmarc=pass fromdomain=g.clemson.edu); spf=pass (google.com: domain of linux-kernel+bounces-118313-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-118313-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=clemson.edu Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id m19-20020ae9e713000000b00789dcdb32cdsi6557325qka.605.2024.03.25.19.48.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 19:48:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-118313-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=@g.clemson.edu header.s=google header.b=VIQqYONb; arc=pass (i=1 spf=pass spfdomain=g.clemson.edu dkim=pass dkdomain=g.clemson.edu dmarc=pass fromdomain=g.clemson.edu); spf=pass (google.com: domain of linux-kernel+bounces-118313-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-118313-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=clemson.edu 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 30D3A1C32CAF for ; Tue, 26 Mar 2024 02:48:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E83CA128394; Tue, 26 Mar 2024 02:48:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=g.clemson.edu header.i=@g.clemson.edu header.b="VIQqYONb" Received: from mail-yw1-f172.google.com (mail-yw1-f172.google.com [209.85.128.172]) (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 60C435788E for ; Tue, 26 Mar 2024 02:47:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711421281; cv=none; b=Lm7h2xoaLK2vfi+8MKhEiw1K3RITLnyBKNK3eewxhivIEuHoXwrQeqHzpXhAgNJNpzX1KbYpBtfJMQ6ADlc5jYT1lLP0reREwRCO+yzqpWaBBU0YxvEDRFIOnL6fRTrkaad9GlGjaI3u3N9H3mvMpjX+8NpP22IgBxsF/PNiYAw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711421281; c=relaxed/simple; bh=Oz5SfiUn38KPjwELQvPN+f6pJLJZcXGZfnQ4jIzvh84=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=uazNQYbGRny9NOGMjjxEtAwsEtvpCOyG4k6OZgcT1wYykQeveoUM4+gMSUx5gtH1/+txyA33tQJUNid23TWHkDtEG3h7GFNMB0pUii+RmXcivkbR9lxVbyAiNVO3fY2HzHyZ8/cUuMTbdMxhQQGUMmDmYr4iptwEEB1aA8g5eR4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=g.clemson.edu; spf=pass smtp.mailfrom=g.clemson.edu; dkim=pass (2048-bit key) header.d=g.clemson.edu header.i=@g.clemson.edu header.b=VIQqYONb; arc=none smtp.client-ip=209.85.128.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=g.clemson.edu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=g.clemson.edu Received: by mail-yw1-f172.google.com with SMTP id 00721157ae682-60a0579a968so53830287b3.3 for ; Mon, 25 Mar 2024 19:47:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=g.clemson.edu; s=google; t=1711421278; x=1712026078; darn=vger.kernel.org; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=W3RHnlDNM7ucEGSanjOfjX8tJ7kAUHNm5z9LD1vv6sw=; b=VIQqYONbOy0nqycclRJSrqvHvKjWNthS7JAOlgYfZX3ZWb6/SlIxzyW1WMMyK5NLEf SsghV6HAawAPZXMAcULkjFjhHUf+J6dCE55BVIrXHGQk8OUlKeV8vmzE5sjWiRhUlAx5 ytOjPoQ/duPVKR2QEl4wexk26U7MUcps6YO9Ol/NpBxGN859rI2gqjao1UbZDdIOGHRe eyo1yfVtiaHG91Cj0ZOo02PGfEMd5IHvUlpWsvsHKT65VCTfAJ71oqBZIMy0nKlXqR6x rhoBz9Iokq0JNXq+HQewvgvq+KipLkgC2iZFOvJBBa6BtkoyC94QZ8xO3VGkksJ2y3H8 Jp6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711421278; x=1712026078; h=mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=W3RHnlDNM7ucEGSanjOfjX8tJ7kAUHNm5z9LD1vv6sw=; b=cixalikxpnGtTP6z9lRpblBNtsO2H2OtjdY0CR51ibryn/gyjEGkJZugUomhg7jyIG 3qXKjTgoGJKsHI/41ZuPCkj6tGmE5l+IbGH91sgq+L02/Iift+tg/lqNn8yVXm6P654i rW19ojLaO0aqd34Y56eDfQYaD6WVo5LhEkOMTubIoFogb/kKfJ6s0h3wEz39sv7QVeht llPU3xxGAVGUl+dU0/7EYon+89THicnwYnmB57oU6KVw5ZE+PYpniJh3bR9Jaf3dH/Kg g8m/n/F4H2adtH4Ca1WiDwYBB+VhfmN5NhHlevXmgkeV92TEn4puZgjno69LzgxuAC+Q 6x8w== X-Forwarded-Encrypted: i=1; AJvYcCUFiAEoMLzRm1DHD7oDi55x77zLmjcrA0RwqyJh3r2fgx5gavICx30bAcQGp1C4m89vikANPF6vBW6WK67veUt2F4wgbsFh/G+WVat2 X-Gm-Message-State: AOJu0YzbNbKEHv1P+q+CDOmB5xwl7npj9dNZA9PsBtGLaDzsbE4tUf/E wUrxEYcJvztzxqEciN7lHl0SxW5zZbqK/s4EMZwMkKBt/cVFkhyTUkPvQSbEwXSTtw9Ao6NzQ1k xMQ== X-Received: by 2002:a0d:cc16:0:b0:610:f5db:697f with SMTP id o22-20020a0dcc16000000b00610f5db697fmr8826026ywd.11.1711421278201; Mon, 25 Mar 2024 19:47:58 -0700 (PDT) Received: from mephi-laptop.localnet (130-127-40-81.lever.resnet.clemson.edu. [130.127.40.81]) by smtp.gmail.com with ESMTPSA id i189-20020a0df8c6000000b00610ba2e251dsm1285688ywf.119.2024.03.25.19.47.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Mar 2024 19:47:57 -0700 (PDT) From: Emilio Mendoza Reyes To: Doug Anderson , Doug Anderson Cc: neil.armstrong@linaro.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, neil.armstrong@linaro.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: Re: [PATCH 1/2] drm/panel: Remove redundant checks in multiple panels Date: Mon, 25 Mar 2024 22:47:57 -0400 Message-ID: <3454518.e9J7NaK4W3@mephi-laptop> In-Reply-To: References: <12472820.O9o76ZdvQC@mephi-laptop> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart3807596.aeNJFYEL58"; micalg="pgp-sha512"; protocol="application/pgp-signature" --nextPart3807596.aeNJFYEL58 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8"; protected-headers="v1" From: Emilio Mendoza Reyes Date: Mon, 25 Mar 2024 22:47:30 -0400 Message-ID: <3454518.e9J7NaK4W3@mephi-laptop> MIME-Version: 1.0 Hi, I'd like to first thank you for your time and for looking at my patch. On Monday, March 25, 2024 8:21:20=E2=80=AFPM EDT Doug Anderson wrote: > Aside from the formatting issues (several lines start with an extra > "-" and there is the PGP stuff), there are a few high-level issues > here: Yeah so sorry about the PGP stuff. Didn't realize my mail client did inline until after it sent. Whoops.=20 > For instance, look at the first panel here > ("panel-boe-himax8279d.c"). The panel_shutdown() function in that > driver _directly_ calls boe_panel_disable() and boe_panel_unprepare() > rather than calling the drm_panel equivalent function. That means that > they _won't_ get the benefit of the checking I added to drm_panel.c. Yeah I didn't notice that. Sorry, I am very new to kernel development. > 2. As much as possible, not only should you be removing the checks, > but you should also be removing all the code that tracks the state of > prepared/enabled in the panel drivers and then removing the "prepared" > / "enabled" members from the structs. If the panel driver needs to > track prepared/enabled for something else, you might need to keep it > though. One example would be sony-acx565akm, as per my previous > attempt [1]. I see, yeah I noticed some of these panels also checked for prepared/ enabled in other functions that don't have to do with preparing/enabling them so those would probs be some that would have to keep the check or would need more thorough refactoring. =20 > In general, maybe a good approach would be to actually start with > patches #5 - #9 in my previous series [2] but instead of calling > drm_panel_helper_shutdown() just do: > drm_panel_disable(...); > drm_panel_unprepare(...); Alright I will look into that.=20 > Feel free to take my patches, change them, and post them. If you want, > you could add a Co-Developed-by (see submitting-patches.rst). Thanks I will start with that then.=20 > Leaving the drm_panel_disable() / drm_panel_unprepare() in the panel > driver shutdown/remove code is not an ideal long term solution, but it > at least moves us on the right path and at least lets us get rid of > most of the prepared / enabled tracking. IMO that should be landable, > though perhaps others would have different opinions. >=20 > After doing all that, then you could submit patches that simply get > rid of the drm_panel_disable() / drm_panel_unprepare() for any panel > drivers if you know that those panels are only used by DRM drivers > that properly call the DRM shutdown code. See my series that tried to > add that to a bunch of DRM drivers [3]. Not everything landed, but > quite a bit of it did. As Maxime and I talked about [4] that _should_ > be as simple as tracking down the panel's compatible string, seeing > which device trees use it, and then seeing if the associated DRM > driver is properly shutting things down. Alright I'll keep this in mind.=20 > Finally, after you've removed the calls to drm_panel_disable() / > drm_panel_unprepare() from the majority of the panel drivers then you > could go forward with your patch #2 where you change this to a WARN(). > Personally, I'd be a little hesitant to land that change, though, > until at least panel-simple and panel-edp got rid of the calls since > that would add WARN for A LOT of people. Unfortunately, those two > panels drivers are also among the hardest to validate since they're > used with nearly all DRM drivers out there. However, IMO even if we > aren't ready to convert to a full WARN all the rest of the stuff I've > talked about here is worth doing. Yeah, that makes sense. I can see how making it a full WARN would result in a bunch of bug reports and wasted time with the current state of the panels.=20 > Hopefully that's not too overwhelming. We'll see. I'll see what I can do. Thanks again for all this usefull info. Hopefully, I'll have a draft of a more complete patch soon. Thanks, EMR --nextPart3807596.aeNJFYEL58 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQTcaZbABwnECYA0cZI0LAN3EqikFgUCZgI3QgAKCRA0LAN3Eqik FhXFAP4o225efxCCysV0GZmUPS2Q6rfuH4B+TKszU8o3WpKvaAD+J/qOGqAeIs4J u0DgW5XLyj22Jwyb79TZ9WR9SYLfZwg= =8iip -----END PGP SIGNATURE----- --nextPart3807596.aeNJFYEL58--