Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp3324028rdb; Wed, 13 Sep 2023 08:41:32 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEBiD1TzGxX7ZBNpCDmqliTVwiQFtCmuNGvS0bNBsey6vVeMO+OlL4EDuZsbvjnoDBjf1bK X-Received: by 2002:a05:6a20:7488:b0:13e:9dba:ea43 with SMTP id p8-20020a056a20748800b0013e9dbaea43mr8257802pzd.2.1694619692216; Wed, 13 Sep 2023 08:41:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694619692; cv=none; d=google.com; s=arc-20160816; b=iSAAW1HelWkj1N7crurUkINKtFA4UP6W2F/PgJiaNCXP//qtgOPdK+TeLXvcT9nb5n gCAZ+Q1LTQxVUl9b920fD7VrH+nGtTes6MZM4yMiGjmp6cCgRU18E7cc1DK5VwhpoS8B OZPs6azljxB6pcWZYC0qNzOcDwhrTZoej/LLVm3pP5wiFHF/T+OidErocbi+kLRokKCV lRcUmk5owT2E7mO1o3qEdN/gnrPOiJcha6FYunHIX0QZtJRcXcL8E4d/GnSPv9M/yBuX 6cbLgJb5skQEXg693t7/siClm/HMY35FK7HRqqC4/wWYPFwegdSR0Wg4FLKprDEshTXg 4Ipg== 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=tQS1uLzGm/YC/GzivOaGJCClvgDA4y68ZbPZk06T4sQ=; fh=Gv5qfdsiathA/DIYEZaJmfVhTLaILzUXf3Qk8gzws10=; b=NQxNB/qiL/DxLrXN0i+hStgKrJqsLqtfbSF+R75xSqrdz1efs8JOZxHKbSmspBIVvb TZDCWmivirYS2ZEIek6gwjRElnjz6rN83xsaSTjlAb/pi1X35+rhtdZCmNLGWe3KpLwh /1ZrzJ/wopZqy8xaYeIYDsU38hw3aJSkfgdE+wXD4L3dl47+O1ZvvyTPBLqoEgFRp1mI Md59Pi9rVvOPI5Sxjl4uwd29mh6k7XbYaGWWirVhCicXBM32EHFOsSUwLu8xqUfHPZTI MDa6b0LCcrkPpPQRZfKmsvwA5gwhG/ysuEnRTsXs5ViNYqmo2MhJ8dCEzc1vaokwI534 OSfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=JeFzwbmI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id u12-20020a65670c000000b005641fc2684bsi10150516pgf.527.2023.09.13.08.41.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Sep 2023 08:41:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=JeFzwbmI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 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 fry.vger.email (Postfix) with ESMTP id 199A180324D6; Wed, 13 Sep 2023 08:35:20 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229705AbjIMPfL (ORCPT + 99 others); Wed, 13 Sep 2023 11:35:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229690AbjIMPfJ (ORCPT ); Wed, 13 Sep 2023 11:35:09 -0400 Received: from mail-ej1-x631.google.com (mail-ej1-x631.google.com [IPv6:2a00:1450:4864:20::631]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B7DB1990 for ; Wed, 13 Sep 2023 08:35:04 -0700 (PDT) Received: by mail-ej1-x631.google.com with SMTP id a640c23a62f3a-9a9d6b98845so246148666b.0 for ; Wed, 13 Sep 2023 08:35:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1694619302; x=1695224102; 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=tQS1uLzGm/YC/GzivOaGJCClvgDA4y68ZbPZk06T4sQ=; b=JeFzwbmIYaDZpQXB9ErYm8gocscixOjGIXDTDz1GHOQpvUBLheDs65u1B/wKvP9Pfi wlH81SM7Q9VrB+INRQySs3Ruo2Nt4LMivBZ/qJttGqaa1KdU5j3cn/4q8FAkgUr3W7dv sBSS+MtpCgyxMrdDJ6L3/48Z7tgpSIgd5qR5s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694619302; x=1695224102; 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=tQS1uLzGm/YC/GzivOaGJCClvgDA4y68ZbPZk06T4sQ=; b=sbfwlyZIcT7QB+7ILOiA0MfIH7QBLz8bUsqhEp40xLByESLPnt5/+3HGlvvPQghtIr 9n5nQlEHP0lKQo7FNTFkRk7jxjjf2LsywRudNoRpyErg/dgfk7+Tp610TtbH58Lv0c93 /D943DrnY6jH+1GgtO0nbq3j8I/4izcgHFrnbQHc0PGWN9Jk4D61LUw3E0uoA6QuVTzQ JXLWzN0auxAOgl0LegEsk/4ykrYL7v3VaMyTFrHBJhbficKaq3FLfusG6zvVru/EvyWq v36XQ3P7X+vqZWFrP+88ETTXz5woy3XSPAzRwrC3/XlNEmj6YJB0QzMwmEoKJEmlG+ZL 7Vcw== X-Gm-Message-State: AOJu0YzBr8hoA1sJixWrCJqVQ2HunEc4AADyEB6T+HUh+6EqPmmuuHsT efFVquU1M2RqDRKYlJH1qKeEcpIVf+2+I1NEBQx4Dg== X-Received: by 2002:a17:907:3e9e:b0:9a5:7d34:e68a with SMTP id hs30-20020a1709073e9e00b009a57d34e68amr8203281ejc.28.1694619301733; Wed, 13 Sep 2023 08:35:01 -0700 (PDT) Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com. [209.85.128.48]) by smtp.gmail.com with ESMTPSA id fx12-20020a170906b74c00b0099ccee57ac2sm8596987ejb.194.2023.09.13.08.35.01 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 13 Sep 2023 08:35:01 -0700 (PDT) Received: by mail-wm1-f48.google.com with SMTP id 5b1f17b1804b1-4005f0a6c2bso78075e9.1 for ; Wed, 13 Sep 2023 08:35:01 -0700 (PDT) X-Received: by 2002:a05:600c:34d4:b0:3f7:3e85:36a with SMTP id d20-20020a05600c34d400b003f73e85036amr122941wmq.7.1694619300711; Wed, 13 Sep 2023 08:35:00 -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: Wed, 13 Sep 2023 08:34:45 -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: dri-devel@lists.freedesktop.org, Maxime Ripard , airlied@gmail.com, daniel@ffwll.ch, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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 (fry.vger.email [0.0.0.0]); Wed, 13 Sep 2023 08:35:20 -0700 (PDT) X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email 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 to be > > > missing a call to drm_atomic_helper_shutdown() at system shutdown > > > time. Among other things, this means that if a panel is in use that i= t > > > won't be cleanly powered off at system shutdown time. > > > > > > The fact that we should call drm_atomic_helper_shutdown() in the case > > > of OS shutdown/restart comes straight out of the kernel doc "driver > > > instance overview" in drm_drv.c. > > > > > > This driver was fairly easy to update. The drm_device is stored in th= e > > > drvdata so we just have to make sure the drvdata is NULL whenever the > > > device is not bound. > > > > ... and there I think you have a misunderstanding of the driver model. > > Please have a look at device_unbind_cleanup() which will be called 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() and > 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 that > 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 it without NULLing the "drvdata". While I still believe this is unsafe in 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? -Doug