Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp406125pxv; Thu, 22 Jul 2021 03:13:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJySyYQNJsul1uAprcdJxTLRvkq0g2lIJbUWPtEE9y07PJXl0isVyH/A14j+RY6EEwArlNrf X-Received: by 2002:a92:dc4a:: with SMTP id x10mr26681353ilq.166.1626948801781; Thu, 22 Jul 2021 03:13:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626948801; cv=none; d=google.com; s=arc-20160816; b=VDLA5rOJlyxJ0iB46ZFAKI5IcZ8A+DeLaerz/jSMwIRv3whIhgmI7sM5F2QmK6Zf5w LbgpWwj19RWDBmHkaeMbCr8gFIw167DFrY3S8OmEJE4ilkXHOcT74gUYXlJ4PQjiZYa4 YaobvIawa9rXyUPKXOVxRwlIn0xrHedm19Iy9L08TKqvmshVWpi96tUGGnXJZu1kKGgP /RMBAtaS8FEXGnXQn597DveyGBYUQWBOBpmO8AmuvfhCHvJ1KT/u6J/ujbzey07Q60b+ fUmRzOVps9BmDx+7x4c5cttlbOA6sELEjSt4sSdw5qs8sSvNXni4GZ+sk7o/NtAsxdOc u0hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=4o/qOb3SXY38G76bOERz3GM/wpF+xBpwDdzulSU0PmQ=; b=OnmKAY0EhoeEmohaCxmJa+HSSFYPjgcfC8D2uck4KSYftGKG2I2eAZoh/SMIgT66rj zLSYguUF8FsB+ZP9RlJyRVRGvjKm6BV2GTZKblClpMbv1ah9hrsu+myF3Lk1VxmD2bNP AO56qKdkfyMIZnm7WtISczdRy2cnZ5CKA7GvVQPQNF43PHmVjqfhXIo/ot6gCFJqdAVo ebCa9ud2Hsa44umviENFXrB6tzzbCa5inKd2MSpyCb1Icw3drVH6w/1KScZq7F8Oamh/ m+HGYvjMSmC5HoK9W5Hbu802BoAScI/M5aJhvn0VH8aqYwdYRjnbNYuA/2++hp7TTgiB 9A1g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p10si22588833iov.66.2021.07.22.03.13.04; Thu, 22 Jul 2021 03:13:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S231633AbhGVJaC (ORCPT + 99 others); Thu, 22 Jul 2021 05:30:02 -0400 Received: from foss.arm.com ([217.140.110.172]:49630 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231573AbhGVJ34 (ORCPT ); Thu, 22 Jul 2021 05:29:56 -0400 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 56BBC106F; Thu, 22 Jul 2021 03:10:31 -0700 (PDT) Received: from [10.57.36.146] (unknown [10.57.36.146]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6DF3C3F73D; Thu, 22 Jul 2021 03:10:30 -0700 (PDT) Subject: Re: [PATCH] dma-debug: fix debugfs initialization order To: Anthony Iliopoulos , Christoph Hellwig , Marek Szyprowski Cc: iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org References: <20210722091818.13434-1-ailiop@suse.com> From: Robin Murphy Message-ID: <1ea36b32-9bbc-a611-402d-9fa196eda166@arm.com> Date: Thu, 22 Jul 2021 11:10:24 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: <20210722091818.13434-1-ailiop@suse.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2021-07-22 10:18, Anthony Iliopoulos wrote: > Due to link order, dma_debug_init is called before debugfs has a chance > to initialize (via debugfs_init which also happens in the core initcall > stage), so the directories for dma-debug are never created. > > Move the dma_debug_init initcall from core to postcore stage so that > debugfs will already be initialized by the time this is called, making > it oblivious to link-ordering. Playing initcall chicken here doesn't work so well - the later you initialise dma-debug itself, the more chance it has to miss early mappings and raise false positives later. As discussed previously[1] the better solution would be to decouple the debugfs setup so that just that part can be deferred until core_initcall_sync or later. Robin. [1] https://lore.kernel.org/linux-iommu/YIgGa6yF%2Fadg8OSN@kroah.com/ > Fixes: 15b28bbcd567 ("dma-debug: move initialization to common code") > Signed-off-by: Anthony Iliopoulos > --- > kernel/dma/debug.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/kernel/dma/debug.c b/kernel/dma/debug.c > index 14de1271463f..49d80ef7f995 100644 > --- a/kernel/dma/debug.c > +++ b/kernel/dma/debug.c > @@ -915,7 +915,7 @@ static int dma_debug_init(void) > pr_info("debugging enabled by kernel config\n"); > return 0; > } > -core_initcall(dma_debug_init); > +postcore_initcall(dma_debug_init); > > static __init int dma_debug_cmdline(char *str) > { >