Received: by 2002:a05:6358:16cd:b0:dc:6189:e246 with SMTP id r13csp1242066rwl; Fri, 4 Nov 2022 11:26:54 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7/bLhncjO15bfoNncaf2ItiVvwvTEM32iK+9gA18XTh5Ue/Bw3Kf2463Iyz8y4QE8xQ7xE X-Received: by 2002:aa7:d791:0:b0:463:7478:c54c with SMTP id s17-20020aa7d791000000b004637478c54cmr26864195edq.140.1667586413938; Fri, 04 Nov 2022 11:26:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667586413; cv=none; d=google.com; s=arc-20160816; b=XeKivc7URdJyFWr4jb/z1aumxXydXgpCQc//ZkSYNPPGEB5emhOd0gNykgHhspGlQE t7UuAl1JH39RwusqDWen2nEBgnWPjrw52wpKssldbNMC4IiaJ4RxhOi/NpKVHjSnpBHM Rty22RmzWQwi0py86N0H0KHmCnERcdOkVeqf3uI5zmnwdiTB2qW2dGZNTYrTvf9dlpZ3 xKoW2AbLs7DL51SrabGDAeXxQeXX/M/yU0Va3nNE+BNAIyc03eDZhAx96AVwqpEL1ZZO e/MwlAKqG6StqtxzBEu9DsgN0FGyVTEtebGRajD8kaaD14uKZUYkRsthdbsaGNUG4wGu GC8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=xxUI6Ee/MGswKnlr5gie7/PqQlI2ta+dUOXcnbwuaRc=; b=K9mYlZpJtuwqGPPgiekwXys5/Sz6Q/I7ppYhgpvRCoHl59rZhfgWFOId2QDIJOYI4S ni52bqtYc+reMzuj/nGdpitX5vyYZxxc/qgBgYfboLOig1+LfGHaQ0flqK+6iuhizb1L FIyAfpWOLThQXM3dsdCk/Gm+WR1/uBw7j3UlBZ2P4lqqWJNRqf2sszxHp0PRrmqVTd/q J1ikZZbWnuQuYqdFrcapIomP8fqmxYUMnj3RUAjWub/9P2U8SqeajAZ9eiocZAbk89LG 7C+avPI5SHC/2zO462KoI0j2uJ01NfPwqOn4JEXrVzdYwS1/KIpuuCm+PHtIpj/YL9ge pIZg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id sg13-20020a170907a40d00b007adb2862222si6256370ejc.828.2022.11.04.11.26.29; Fri, 04 Nov 2022 11:26:53 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231309AbiKDSVS (ORCPT + 96 others); Fri, 4 Nov 2022 14:21:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231607AbiKDSUp (ORCPT ); Fri, 4 Nov 2022 14:20:45 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 487E610C for ; Fri, 4 Nov 2022 11:20:44 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id BA3D51FB for ; Fri, 4 Nov 2022 11:20:49 -0700 (PDT) Received: from e110455-lin.cambridge.arm.com (usa-sjc-imap-foss1.foss.arm.com [10.121.207.14]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 6982F3F5A1 for ; Fri, 4 Nov 2022 11:20:43 -0700 (PDT) Date: Fri, 4 Nov 2022 18:20:36 +0000 From: Liviu Dudau To: Danilo Krummrich Cc: daniel@ffwll.ch, airlied@linux.ie, tzimmermann@suse.de, mripard@kernel.org, brian.starkey@arm.com, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH drm-misc-next v4 0/4] drm/arm/hdlcd: use drm managed resources Message-ID: References: <20221026153431.72033-1-dakr@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20221026153431.72033-1-dakr@redhat.com> X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, 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: X-Mailing-List: linux-kernel@vger.kernel.org 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 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 > -- ==================== | I would like to | | fix the world, | | but they're not | | giving me the | \ source code! / --------------- ¯\_(ツ)_/¯