Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E97ADC5475B for ; Mon, 11 Mar 2024 13:36:54 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4BC0D112A62; Mon, 11 Mar 2024 13:36:54 +0000 (UTC) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by gabe.freedesktop.org (Postfix) with ESMTP id 20989112A62 for ; Mon, 11 Mar 2024 13:36:52 +0000 (UTC) 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 4619FFEC; Mon, 11 Mar 2024 06:37:29 -0700 (PDT) Received: from [10.57.49.244] (unknown [10.57.49.244]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 470A43F64C; Mon, 11 Mar 2024 06:36:51 -0700 (PDT) Message-ID: <6bb76bfe-2be8-4724-a5db-34a779e571ad@arm.com> Date: Mon, 11 Mar 2024 13:36:49 +0000 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 3/3] drm/panthor: Fix undefined panthor_device_suspend/resume symbol issue Content-Language: en-GB To: Boris Brezillon Cc: Jani Nikula , Steven Price , Liviu Dudau , dri-devel@lists.freedesktop.org, kernel@collabora.com, kernel test robot References: <20240304090812.3941084-1-boris.brezillon@collabora.com> <20240304090812.3941084-4-boris.brezillon@collabora.com> <87il1tt4f6.fsf@intel.com> <20240311124634.2ee63052@collabora.com> <87frwxt2cb.fsf@intel.com> <20240311125259.6bf317a5@collabora.com> <20240311142236.05139059@collabora.com> From: Robin Murphy In-Reply-To: <20240311142236.05139059@collabora.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On 2024-03-11 1:22 pm, Boris Brezillon wrote: > On Mon, 11 Mar 2024 13:11:28 +0000 > Robin Murphy wrote: > >> On 2024-03-11 11:52 am, Boris Brezillon wrote: >>> On Mon, 11 Mar 2024 13:49:56 +0200 >>> Jani Nikula wrote: >>> >>>> On Mon, 11 Mar 2024, Boris Brezillon wrote: >>>>> On Mon, 11 Mar 2024 13:05:01 +0200 >>>>> Jani Nikula wrote: >>>>> >>>>>> This breaks the config for me: >>>>>> >>>>>> SYNC include/config/auto.conf.cmd >>>>>> GEN Makefile >>>>>> drivers/iommu/Kconfig:14:error: recursive dependency detected! >>>>>> drivers/iommu/Kconfig:14: symbol IOMMU_SUPPORT is selected by DRM_PANTHOR >>>>>> drivers/gpu/drm/panthor/Kconfig:3: symbol DRM_PANTHOR depends on PM >>>>>> kernel/power/Kconfig:183: symbol PM is selected by PM_SLEEP >>>>>> kernel/power/Kconfig:117: symbol PM_SLEEP depends on HIBERNATE_CALLBACKS >>>>>> kernel/power/Kconfig:35: symbol HIBERNATE_CALLBACKS is selected by XEN_SAVE_RESTORE >>>>>> arch/x86/xen/Kconfig:67: symbol XEN_SAVE_RESTORE depends on XEN >>>>>> arch/x86/xen/Kconfig:6: symbol XEN depends on PARAVIRT >>>>>> arch/x86/Kconfig:781: symbol PARAVIRT is selected by HYPERV >>>>>> drivers/hv/Kconfig:5: symbol HYPERV depends on X86_LOCAL_APIC >>>>>> arch/x86/Kconfig:1106: symbol X86_LOCAL_APIC depends on X86_UP_APIC >>>>>> arch/x86/Kconfig:1081: symbol X86_UP_APIC prompt is visible depending on PCI_MSI >>>>>> drivers/pci/Kconfig:39: symbol PCI_MSI is selected by AMD_IOMMU >>>>>> drivers/iommu/amd/Kconfig:3: symbol AMD_IOMMU depends on IOMMU_SUPPORT >>>>> >>>>> Uh, I guess we want a "depends on IOMMU_SUPPORT" instead of "select >>>>> IOMMU_SUPPORT" in panthor then. >>>> >>>> That works for me. >>> >>> Let's revert the faulty commit first. We'll see if Steve has a >>> different solution for the original issue. >> >> FWIW, the reasoning in the offending commit seems incredibly tenuous. >> There are far more practical reasons for building an arm/arm64 kernel >> without PM - for debugging or whatever, and where one may even still >> want a usable GPU, let alone just a non-broken build - than there are >> for building this driver for x86. Using pm_ptr() is trivial, and if you >> want to support COMPILE_TEST then there's really no justifiable excuse >> not to. > > The problem is not just about using pm_ptr(), but also making sure > panthor_device_resume/suspend() are called called in the init/unplug > path when !PM, as I don't think the PM helpers automate that for us. I > was just aiming for a simple fix that wouldn't force me to test the !PM > case... Fair enough, at worst we could always have a runtime check and refuse to probe in conditions we don't think are worth the bother of implementing fully-functional support for. However if we want to make an argument for only supporting "realistic" configs at build time then that is an argument for dropping COMPILE_TEST as well. Thanks, Robin.