Message ID | 20221026153431.72033-1-dakr@redhat.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp345185wru; Wed, 26 Oct 2022 08:49:16 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5+Uw2qPBkIBmaL6q7l3b16ZyD620HkRpRYHbvTMYXzlHI7eXBXgPNnPrenMr6fq0ES1aQC X-Received: by 2002:a17:907:2d0b:b0:78e:674:6b32 with SMTP id gs11-20020a1709072d0b00b0078e06746b32mr37661983ejc.226.1666799355819; Wed, 26 Oct 2022 08:49:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666799355; cv=none; d=google.com; s=arc-20160816; b=o4h3OveXUPTbrXgSZtEETTs1CyGiDNTsub5263duZsge+P4cCb9dGyPlS09b0CppLG QxITus0xPKwV7eKHDAejCBbDZMty3kdpU/8gYDwpUHudt9Z7ltprXQFxrys5I13G/E5c 225eh0Oc+XbMmlAFxL+m+9sgVLn0JOc/PXSIIPBFhfT2C90HLQ3MLzfWqG9fMnYMwDrQ jSOhmA8kktJmiXlRfnVAmrCT2PljSuIbfSO9l1Jyl9ur8fkSp31SB4AyVh4sF5OFftat b5mbfZPruNrJZYGfsH3Fg1mLDyWz0QqAHhKQpGGdrFJuSnRNyi5+XBDfiXOhpjZVSDEO o4rA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=Bk5/l1P1WJsBzjE+AIX4jodlD6n3+SoO3yq57seOT+g=; b=uvdXZv9th4qL4DwLut9nNQIMESMK4yOs8O05L3a2QB+pgiyIX3Sk0pVpZXMXHxxTCb hmRWJzCdVdq556YGVz/Q8y5v6KyZowL06oJXTvCiWw0IkuELMQgXJ94GsrW9IZIJrcG4 YPGNiH4sPnG48z8Bi7o1qgG9BllxFInDpM2J9gYxHLozXxQG4J/eYEJNiXtgq53hpcac 52alj51OtbZ+4p7Gc4WmYniI6B7LqUVsCI4rw3yaex320YRmZitSjSmcBmTsmnKtSbyq fSx7TWUVWWtGU6xM6HNAEmfzbZp3Ao/F8C2CcvO7VA0jKYVwVUdSSwApzJ9I7ldhfBuJ DZwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=JCfqsjCM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dd3-20020a1709069b8300b007707aab3171si523574ejc.848.2022.10.26.08.48.51; Wed, 26 Oct 2022 08:49:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=JCfqsjCM; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234580AbiJZPer (ORCPT <rfc822;pwkd43@gmail.com> + 99 others); Wed, 26 Oct 2022 11:34:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234545AbiJZPen (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 26 Oct 2022 11:34:43 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E718E26D0 for <linux-kernel@vger.kernel.org>; Wed, 26 Oct 2022 08:34:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666798481; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=Bk5/l1P1WJsBzjE+AIX4jodlD6n3+SoO3yq57seOT+g=; b=JCfqsjCMutkSY3IsifVc3OZI1O5gAD+vH1G0VB1oz40hkvG+rumtXtdLpoIFRSEYvhQQ1i dg5JDLS3AR9ho58cdspVMeM02hPAQTEF9SqiMwDMfymw3wOrhpwmz4CUiU3pzydiwHfScG nya30lUeybcK1MvpbEnec1sHa/DE2xs= Received: from mail-ej1-f71.google.com (mail-ej1-f71.google.com [209.85.218.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-115-joDZwGFbN2qj5BhMUkM4zQ-1; Wed, 26 Oct 2022 11:34:39 -0400 X-MC-Unique: joDZwGFbN2qj5BhMUkM4zQ-1 Received: by mail-ej1-f71.google.com with SMTP id qb12-20020a1709077e8c00b007a6c5a23a30so3641183ejc.12 for <linux-kernel@vger.kernel.org>; Wed, 26 Oct 2022 08:34:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Bk5/l1P1WJsBzjE+AIX4jodlD6n3+SoO3yq57seOT+g=; b=NoiU1qBVHdNjnVkq9roYHkrSM4HfJhZEYBrVueQO9WhQyoVTB5NkWmjebNw62N0qUk Il8wdU2aipIlRxwySAtvVBXvftWDbyPAmwwzxKNx5sBDtVZtNLP4IJvlAdU1et07Y8Pw WZinloksKZCMA9W8B4Lyi0QxwHNJX2L4q7mfY1UE2hGyripdV2mVqUAodX/tLKWG5ka1 5LnJUny7OuoH/Pq7Bwqy3unTEVV7HxNiu3NC0JQ92GvTviy9JBr7ICcore5ZKMs4Cu2W a9g1czmyCbntDv2rnU8UGTSLVZBf5hJWNFY1oOi26/jo3rCAvFWHu4sd1YK10oreCzZv lQbA== X-Gm-Message-State: ACrzQf1u5ttc4kQhAH8t8Kkp0Hp6SYWQREkBZkAV5mn3VI0iqJLOHIxI Rx8PmzCjDnNRauQjK0PGK61Ioi8rkHvJiMzqK4jxUtqcKc1SbtSLPYUJoCOGORjtEdGGvuUhOFW 2AD8E44oyF1Xuke2135/C2uVI X-Received: by 2002:a17:906:9bc8:b0:7ad:7e6a:50ac with SMTP id de8-20020a1709069bc800b007ad7e6a50acmr3060186ejc.66.1666798478391; Wed, 26 Oct 2022 08:34:38 -0700 (PDT) X-Received: by 2002:a17:906:9bc8:b0:7ad:7e6a:50ac with SMTP id de8-20020a1709069bc800b007ad7e6a50acmr3060174ejc.66.1666798478229; Wed, 26 Oct 2022 08:34:38 -0700 (PDT) Received: from pollux.. ([2a02:810d:4b40:2ee8:642:1aff:fe31:a15c]) by smtp.gmail.com with ESMTPSA id r1-20020a1709061ba100b007a9c3831409sm3125296ejg.137.2022.10.26.08.34.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Oct 2022 08:34:37 -0700 (PDT) From: Danilo Krummrich <dakr@redhat.com> To: daniel@ffwll.ch, airlied@linux.ie, tzimmermann@suse.de, mripard@kernel.org, liviu.dudau@arm.com, brian.starkey@arm.com Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Danilo Krummrich <dakr@redhat.com> Subject: [PATCH drm-misc-next v4 0/4] drm/arm/hdlcd: use drm managed resources Date: Wed, 26 Oct 2022 17:34:27 +0200 Message-Id: <20221026153431.72033-1-dakr@redhat.com> X-Mailer: git-send-email 2.37.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747765800953982745?= X-GMAIL-MSGID: =?utf-8?q?1747765800953982745?= |
Series |
drm/arm/hdlcd: use drm managed resources
|
|
Message
Danilo Krummrich
Oct. 26, 2022, 3:34 p.m. UTC
Hi, This patch series converts the driver to use drm managed resources to prevent potential use-after-free issues on driver unbind/rebind and to get rid of the usage of deprecated APIs. Changes in v2: - drop patch "drm/arm/hdlcd: crtc: use drmm_crtc_init_with_planes()" Changes in v3: - Fix alternate return paths in srcu read-side critical sections causing a stall when unregistering the driver. - Fix potential null pointer dereference in hdlcd_crtc_cleanup() introduced dropping the patch in v2. - Add a patch to remove explicit calls to drm_mode_config_cleanup(). Changes in v4: - Remove patches to protect platform device bound resources with drm_dev_{enter,exit}, since this would leave the hardware enabled when regularly unloading the driver e.g. via rmmod. Instead do this in a later series, once we got drm_dev_unplug() in place to deal with a regular driver shutdown. Danilo Krummrich (4): drm/arm/hdlcd: use drmm_* to allocate driver structures drm/arm/hdlcd: replace drm->dev_private with drm_to_hdlcd_priv() drm/arm/hdlcd: plane: use drm managed resources drm/arm/hdlcd: remove calls to drm_mode_config_cleanup() drivers/gpu/drm/arm/hdlcd_crtc.c | 24 +++++++------------ drivers/gpu/drm/arm/hdlcd_drv.c | 41 ++++++++++++++++---------------- drivers/gpu/drm/arm/hdlcd_drv.h | 2 ++ 3 files changed, 32 insertions(+), 35 deletions(-) base-commit: e1e7bc481d49c3e3ada11029ce0d9b85a0a539d7
Comments
On Wed, Oct 26, 2022 at 05:34:27PM +0200, Danilo Krummrich wrote: > Hi, Hi Danilo, > > This patch series converts the driver to use drm managed resources to prevent > potential use-after-free issues on driver unbind/rebind and to get rid of the > usage of deprecated APIs. > > Changes in v2: > - drop patch "drm/arm/hdlcd: crtc: use drmm_crtc_init_with_planes()" > > Changes in v3: > - Fix alternate return paths in srcu read-side critical sections causing a > stall when unregistering the driver. > - Fix potential null pointer dereference in hdlcd_crtc_cleanup() introduced > dropping the patch in v2. > - Add a patch to remove explicit calls to drm_mode_config_cleanup(). > > Changes in v4: > - Remove patches to protect platform device bound resources with > drm_dev_{enter,exit}, since this would leave the hardware enabled when > regularly unloading the driver e.g. via rmmod. > Instead do this in a later series, once we got drm_dev_unplug() in place > to deal with a regular driver shutdown. This series is in a much better shape compared to the existing status quo. rmmod works without any issue and I can re-insmod the driver again. The only issue that I'm seeing that is not critical is that at reboot/shutdown time I'm getting an "Unexpected global fault, this could be serious" from the smmu: [ 6893.467910] arm-smmu 7fb30000.iommu: disabling translation [ 6893.473550] ohci-platform 7ffb0000.usb: Removing from iommu group 1 [ 6893.479909] ehci-platform 7ffc0000.usb: Removing from iommu group 1 [ 6893.486931] arm-smmu 7fb10000.iommu: disabling translation [ 6893.492521] hdlcd 7ff50000.hdlcd: Removing from iommu group 3 [ 6893.492650] arm-smmu 7fb10000.iommu: Unexpected global fault, this could be serious [ 6893.505959] arm-smmu 7fb10000.iommu: GFSR 0x80000001, GFSYNR0 0x00000000, GFSYNR1 0x00000000, GFSYNR2 0x00000000 [ 6893.516511] arm-smmu 7fb00000.iommu: disabling translation [ 6893.522195] dma-pl330 7ff00000.dma-controller: Removing from iommu group 2 [ 6893.529607] arm-smmu 2b500000.iommu: disabling translation [ 6893.535221] pcieport 0000:00:00.0: Removing from iommu group 0 [ 6893.541135] pci 0000:01:00.0: Removing from iommu group 0 [ 6893.546604] pcieport 0000:02:01.0: Removing from iommu group 0 [ 6893.552511] pcieport 0000:02:02.0: Removing from iommu group 0 [ 6893.558418] pcieport 0000:02:03.0: Removing from iommu group 0 [ 6893.564329] pcieport 0000:02:0c.0: Removing from iommu group 0 [ 6893.570393] pcieport 0000:02:10.0: Removing from iommu group 0 [ 6893.576314] pcieport 0000:02:1f.0: Removing from iommu group 0 [ 6893.582214] sata_sil24 0000:03:00.0: Removing from iommu group 0 [ 6893.588270] sky2 0000:08:00.0: Removing from iommu group 0 [ 6893.594616] reboot: Power down The reboot/shutdown succeeds, so I'm not too worried about it for now, but hope that this is something you'll keep in mind in the later series when you do drm_dev_unplug(). With that, for the whole series: Acked-by: Liviu Dudau <liviu.dudau@arm.com> Thanks for the patience and going through the series iterations with me. I can pull this series into drm-misc-next on Monday if you don't have any other plans. Best regards, Liviu > > Danilo Krummrich (4): > drm/arm/hdlcd: use drmm_* to allocate driver structures > drm/arm/hdlcd: replace drm->dev_private with drm_to_hdlcd_priv() > drm/arm/hdlcd: plane: use drm managed resources > drm/arm/hdlcd: remove calls to drm_mode_config_cleanup() > > drivers/gpu/drm/arm/hdlcd_crtc.c | 24 +++++++------------ > drivers/gpu/drm/arm/hdlcd_drv.c | 41 ++++++++++++++++---------------- > drivers/gpu/drm/arm/hdlcd_drv.h | 2 ++ > 3 files changed, 32 insertions(+), 35 deletions(-) > > > base-commit: e1e7bc481d49c3e3ada11029ce0d9b85a0a539d7 > -- > 2.37.3 >
Hi Liviu, > The only issue that I'm seeing that is not critical is that at reboot/shutdown time > I'm getting an "Unexpected global fault, this could be serious" from the smmu: > > [ 6893.467910] arm-smmu 7fb30000.iommu: disabling translation > [ 6893.473550] ohci-platform 7ffb0000.usb: Removing from iommu group 1 > [ 6893.479909] ehci-platform 7ffc0000.usb: Removing from iommu group 1 > [ 6893.486931] arm-smmu 7fb10000.iommu: disabling translation > [ 6893.492521] hdlcd 7ff50000.hdlcd: Removing from iommu group 3 > [ 6893.492650] arm-smmu 7fb10000.iommu: Unexpected global fault, this could be serious > [ 6893.505959] arm-smmu 7fb10000.iommu: GFSR 0x80000001, GFSYNR0 0x00000000, GFSYNR1 0x00000000, GFSYNR2 0x00000000 > [ 6893.516511] arm-smmu 7fb00000.iommu: disabling translation > [ 6893.522195] dma-pl330 7ff00000.dma-controller: Removing from iommu group 2 > [ 6893.529607] arm-smmu 2b500000.iommu: disabling translation > [ 6893.535221] pcieport 0000:00:00.0: Removing from iommu group 0 > [ 6893.541135] pci 0000:01:00.0: Removing from iommu group 0 > [ 6893.546604] pcieport 0000:02:01.0: Removing from iommu group 0 > [ 6893.552511] pcieport 0000:02:02.0: Removing from iommu group 0 > [ 6893.558418] pcieport 0000:02:03.0: Removing from iommu group 0 > [ 6893.564329] pcieport 0000:02:0c.0: Removing from iommu group 0 > [ 6893.570393] pcieport 0000:02:10.0: Removing from iommu group 0 > [ 6893.576314] pcieport 0000:02:1f.0: Removing from iommu group 0 > [ 6893.582214] sata_sil24 0000:03:00.0: Removing from iommu group 0 > [ 6893.588270] sky2 0000:08:00.0: Removing from iommu group 0 > [ 6893.594616] reboot: Power down > > > The reboot/shutdown succeeds, so I'm not too worried about it for now, but hope that > this is something you'll keep in mind in the later series when you do drm_dev_unplug(). Yes, I'd expect this to be related to the missing protection of platform device bound resources. > > With that, for the whole series: > > Acked-by: Liviu Dudau <liviu.dudau@arm.com> > > Thanks for the patience and going through the series iterations with me. > > I can pull this series into drm-misc-next on Monday if you don't have any other plans. Thanks, I saw you already applied the series. Have you had a look on the same series for malidp? - Danilo > > Best regards, > Liviu
On Tue, Nov 08, 2022 at 08:57:55PM +0100, Danilo Krummrich wrote: > Hi Liviu, Hi, > > > The only issue that I'm seeing that is not critical is that at reboot/shutdown time > > I'm getting an "Unexpected global fault, this could be serious" from the smmu: > > > > [ 6893.467910] arm-smmu 7fb30000.iommu: disabling translation > > [ 6893.473550] ohci-platform 7ffb0000.usb: Removing from iommu group 1 > > [ 6893.479909] ehci-platform 7ffc0000.usb: Removing from iommu group 1 > > [ 6893.486931] arm-smmu 7fb10000.iommu: disabling translation > > [ 6893.492521] hdlcd 7ff50000.hdlcd: Removing from iommu group 3 > > [ 6893.492650] arm-smmu 7fb10000.iommu: Unexpected global fault, this could be serious > > [ 6893.505959] arm-smmu 7fb10000.iommu: GFSR 0x80000001, GFSYNR0 0x00000000, GFSYNR1 0x00000000, GFSYNR2 0x00000000 > > [ 6893.516511] arm-smmu 7fb00000.iommu: disabling translation > > [ 6893.522195] dma-pl330 7ff00000.dma-controller: Removing from iommu group 2 > > [ 6893.529607] arm-smmu 2b500000.iommu: disabling translation > > [ 6893.535221] pcieport 0000:00:00.0: Removing from iommu group 0 > > [ 6893.541135] pci 0000:01:00.0: Removing from iommu group 0 > > [ 6893.546604] pcieport 0000:02:01.0: Removing from iommu group 0 > > [ 6893.552511] pcieport 0000:02:02.0: Removing from iommu group 0 > > [ 6893.558418] pcieport 0000:02:03.0: Removing from iommu group 0 > > [ 6893.564329] pcieport 0000:02:0c.0: Removing from iommu group 0 > > [ 6893.570393] pcieport 0000:02:10.0: Removing from iommu group 0 > > [ 6893.576314] pcieport 0000:02:1f.0: Removing from iommu group 0 > > [ 6893.582214] sata_sil24 0000:03:00.0: Removing from iommu group 0 > > [ 6893.588270] sky2 0000:08:00.0: Removing from iommu group 0 > > [ 6893.594616] reboot: Power down > > > > > > The reboot/shutdown succeeds, so I'm not too worried about it for now, but hope that > > this is something you'll keep in mind in the later series when you do drm_dev_unplug(). > > Yes, I'd expect this to be related to the missing protection of platform > device bound resources. > > > > > With that, for the whole series: > > > > Acked-by: Liviu Dudau <liviu.dudau@arm.com> > > > > Thanks for the patience and going through the series iterations with me. > > > > I can pull this series into drm-misc-next on Monday if you don't have any other plans. > Thanks, I saw you already applied the series. > > Have you had a look on the same series for malidp? Yes, I've looked at the code and it looks reasonable, I just wanted to run it once through the minimum of tests that I use, which involves switching some FPGA images around. Hope to do that today or tomorrow. Best regards, Liviu > > - Danilo > > > > > Best regards, > > Liviu >