Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2231921rdb; Thu, 21 Sep 2023 12:15:22 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEl1SKuFqSuZBIXbU7/iUHmDc4Sld8albNHsncpdBqUPbfissGDZrRNuRn1oGXpsLNP6RpQ X-Received: by 2002:a17:902:ef82:b0:1c5:bc83:556b with SMTP id iz2-20020a170902ef8200b001c5bc83556bmr4531288plb.52.1695323721566; Thu, 21 Sep 2023 12:15:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695323721; cv=none; d=google.com; s=arc-20160816; b=s/W5ZBO74vOwOHj7KxUPjraplEI+PQZM/MCTC7zDTpt3FzYHFS+WPITIjXp1Sh0DDp rNcVg8TpaCeafNqO+sE6xiFhapDY6PZTQLoRO2U42e+nfIttj13iANd7pnfLSg07oHf1 kAWECEIHOMHm9KJyqHQKUkMMiGkkBLbFSNnahJ/BXgEgeJy519tHkfUHIRM8Ae2+2jHs cq4sudPJe0HqewYmPvmFVMxJ5tjuaxcHvHs9qUQxKj5Jq/fkoFJtkXunAaDH9hsTKi0T rFsRZWqsqosW+1y8C1mCWxgHzJgMj1FO2sYHvpDRFPDbs6eNSv4pm32hwVCxPG9ZuiuP 5jGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=ozcv+tNcrjJTNVnx50veCSyyrwlXIHAIqy4hJ7iqZd4=; fh=w0MBxrBfKdD75OITs+2BXe9fGMyHa4s84H4ZMXCvMlY=; b=tshdiQ/jk2v5yDFd96OGoIQgYMSVnyaISfjskRNjEIzKj2pOAsFwQUhcYgcQyIB1SX f3KuIIu71Z2ZLYcF/Ggdvi3h7gw7wB66vBDxWw/d33sHVg6aQI6ZtQFVFV6k2auuoiEB xFmHMBiddg1cgG5BEGtJtxIFeNVssemamHE9ezztnuWXSb+SSv1zw//ShshpaPSj6L+w 7VaggYwqWw8UxWEvFChIMH3uZFDwAksYjiW5VDGK+AciyG5Iq3NulUlhEjJ+/Mix91fZ DuYr7RQ1bFuUaQvhrSZj6tE6iQOnMOP4QgI6nXTRm2evqfmUj/19idz9w4R6wA7N5Y/p pfiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=PdPD1QlV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id y15-20020a17090322cf00b001bb792749a2si2180073plg.146.2023.09.21.12.15.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Sep 2023 12:15:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=PdPD1QlV; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 8BF568328AE2; Thu, 21 Sep 2023 11:46:40 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229495AbjIUSqn (ORCPT + 99 others); Thu, 21 Sep 2023 14:46:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46296 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229493AbjIUSql (ORCPT ); Thu, 21 Sep 2023 14:46:41 -0400 Received: from mail-ed1-x52c.google.com (mail-ed1-x52c.google.com [IPv6:2a00:1450:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1820EE5BD for ; Thu, 21 Sep 2023 11:46:22 -0700 (PDT) Received: by mail-ed1-x52c.google.com with SMTP id 4fb4d7f45d1cf-53136a13cd4so1538399a12.1 for ; Thu, 21 Sep 2023 11:46:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1695321979; x=1695926779; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ozcv+tNcrjJTNVnx50veCSyyrwlXIHAIqy4hJ7iqZd4=; b=PdPD1QlVs15jhXTeDojbldVMm1gapUjEecI6NDpgul6yHF4IHyo1hpkHV3C3IbmpQU W0cbdrmNU6td1pJcOBYLLi8WXgJeJ+T8idJYvwaEFnVE8yM5nZz7EkrATS/eYct5it6+ 79shpPqDulv3buSE98QTLo+NywwQcLuu+Dbqg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695321979; x=1695926779; h=content-transfer-encoding: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=ozcv+tNcrjJTNVnx50veCSyyrwlXIHAIqy4hJ7iqZd4=; b=jGOYLOof+Kx/Bayc1iJ4IMZXg+I6EslxHhSGPLDX61gjr9q3v9G78Af371CdQDdyxi MdaSJjJJv00v8LhKEovguv+djDo7YEg4D9z0RjFCA/uvR9/tLJX39VJB3+s2+UzipiHO ljPrjUaJSL3MA0HkiWAojl+Dtym04LF6/IYXBOyYCTTKEvs0O6Wy+N3cNs7H2mGmYvY5 ILVefLOP9LSH6zeM1hRPJJFf4fNBxhdNfmsHLOa2tv8/lqFIDZuDB4eN/9bKMfqfQ88X p1P3EH1Ly+aYb5MR61vjsivwWDpku4klb8/jfHy35HnmCpPTuQgL44gAg0KEVGn8JZAw N7LA== X-Gm-Message-State: AOJu0YxJt5HSEEhX+8K17WbZiD+X0YIC5T+TcJkPb9IOePu3ARvhuPUj OzFX+pXrDtWMkp4Wya5TgW/z70dDsGkOtz5GSmnEIw== X-Received: by 2002:a17:906:53d9:b0:9ae:513d:de22 with SMTP id p25-20020a17090653d900b009ae513dde22mr4059885ejo.56.1695321979440; Thu, 21 Sep 2023 11:46:19 -0700 (PDT) Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com. [209.85.128.49]) by smtp.gmail.com with ESMTPSA id y9-20020a170906558900b009ad854daea6sm1419821ejp.132.2023.09.21.11.46.18 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 21 Sep 2023 11:46:19 -0700 (PDT) Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-4009fdc224dso20175e9.1 for ; Thu, 21 Sep 2023 11:46:18 -0700 (PDT) X-Received: by 2002:a05:600c:3ac9:b0:400:46db:1bf2 with SMTP id d9-20020a05600c3ac900b0040046db1bf2mr130799wms.2.1695321978276; Thu, 21 Sep 2023 11:46:18 -0700 (PDT) MIME-Version: 1.0 References: <20230901234202.566951-1-dianders@chromium.org> <20230901164111.RFT.1.I3d5598bd73a59b5ded71430736c93f67dc5dea61@changeid> In-Reply-To: From: Doug Anderson Date: Thu, 21 Sep 2023 11:46:02 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFT PATCH 01/15] drm/armada: Call drm_atomic_helper_shutdown() at shutdown time To: "Russell King (Oracle)" Cc: Maxime Ripard , dri-devel@lists.freedesktop.org, airlied@gmail.com, daniel@ffwll.ch, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Thu, 21 Sep 2023 11:46:40 -0700 (PDT) Hi, On Wed, Sep 20, 2023 at 11:58=E2=80=AFAM Russell King (Oracle) wrote: > > On Wed, Sep 20, 2023 at 11:03:32AM -0700, Doug Anderson wrote: > > Maxime, > > > > On Wed, Sep 13, 2023 at 8:34=E2=80=AFAM Doug Anderson wrote: > > > > > > Hi, > > > > > > On Tue, Sep 5, 2023 at 7:23=E2=80=AFAM Doug Anderson wrote: > > > > > > > > Hi, > > > > > > > > On Sun, Sep 3, 2023 at 8:53=E2=80=AFAM Russell King (Oracle) > > > > wrote: > > > > > > > > > > On Fri, Sep 01, 2023 at 04:41:12PM -0700, Douglas Anderson wrote: > > > > > > Based on grepping through the source code this driver appears t= o be > > > > > > missing a call to drm_atomic_helper_shutdown() at system shutdo= wn > > > > > > time. Among other things, this means that if a panel is in use = that it > > > > > > won't be cleanly powered off at system shutdown time. > > > > > > > > > > > > The fact that we should call drm_atomic_helper_shutdown() in th= e case > > > > > > of OS shutdown/restart comes straight out of the kernel doc "dr= iver > > > > > > instance overview" in drm_drv.c. > > > > > > > > > > > > This driver was fairly easy to update. The drm_device is stored= in the > > > > > > drvdata so we just have to make sure the drvdata is NULL whenev= er the > > > > > > device is not bound. > > > > > > > > > > ... and there I think you have a misunderstanding of the driver m= odel. > > > > > Please have a look at device_unbind_cleanup() which will be calle= d if > > > > > probe fails, or when the device is removed (in other words, when = it is > > > > > not bound to a driver.) > > > > > > > > ...and there I think you didn't read this patch closely enough and > > > > perhaps that you have a misunderstanding of the component model. > > > > Please have a look at the difference between armada_drm_unbind() an= d > > > > armada_drm_remove() and also check which of those two functions is > > > > being modified by my patch. Were this patch adding a call to > > > > "dev_set_drvdata(dev, NULL)" in armada_drm_remove() then your NAK > > > > would be justified. However, I am not aware of anything in the > > > > component unbind path nor in the failure case of component bind tha= t > > > > would NULL the drvdata. > > > > > > > > Kindly look at the patch a second time with this in mind. > > > > > > Since I didn't see any further response, I'll assume that my > > > explanation here has addressed your concerns. If not, I can re-post i= t > > > without NULLing the "drvdata". While I still believe this is unsafe i= n > > > some corner cases because of the component model used by this driver, > > > at least it would get the shutdown call in. > > > > > > In any case, what's the process for landing patches to this driver? > > > Running `./scripts/get_maintainer.pl --scm -f > > > drivers/gpu/drm/armada/armada_drv.c` seems to indicate that this > > > should go through the git tree: > > > > > > git git://git.armlinux.org.uk/~rmk/linux-arm.git drm-armada-devel > > > > > > ...but it doesn't appear that recent changes to this driver have gone > > > that way. Should this land through drm-misc? > > > > Do you have any advice here? Should I land this through drm-misc-next, > > put it on ice for a while, or resend without the calls to NULL our the > > drvdata? > > Sorry, I haven't had a chance to look at it, but I think you're probably > right, so I withdraw my objection. Please take it through drm-misc for > the time being. Thanks. Pushed to drm-misc-next: c478768ce807 drm/armada: Call drm_atomic_helper_shutdown() at shutdown time