Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp4453237pxy; Tue, 27 Apr 2021 05:34:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyiinuR4MHJgGbIAuN8rSf7T0lGlLcyWAoPB3DoMOCeEcm83LMdkFm9UrG2cw/rTDxxWc6o X-Received: by 2002:a05:6402:2219:: with SMTP id cq25mr3927679edb.60.1619526855781; Tue, 27 Apr 2021 05:34:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619526855; cv=none; d=google.com; s=arc-20160816; b=GloPc7cZndNhvoJHJqmCNYY4CATcw1T3v1s0swU1oUvghRouKMj8Fxck824exytNSV r+DDxkSNfm+2VxuLsoJHolOsE6b/10A+/Mshf97T16DvHsTlTzqJ3lnvwoOrtzJ16MWX Pb/1oI7hx8Qg+BJgCay/p+PbOVd+cahsa2c/Bleki3KoGx8rY4usxfTrZexFtT6LE8yf L7+aDs9E/dGOc8p9FM6VLNUHMh/RwPgnQCOE1vph7aU0jiqXDXybaT8+WTy8dzlTTRZt ywAC5ZuxTd+ZdU25g7FiIPVCl9lhpH9OvXfIiCz8/fijJSk6OsP4WSbEg+k/wgQgoDQd bJpw== 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=QoqLRr+aBAhBLXs2bOiQg54r0/pLAQWcjhb0pY1kwgc=; b=rIRg7J13ALcxsBbJTJ6L5Ibpjg3sEKPHW7VL+P8hUqQTwwQtJE69oRHx/yE/prv7mZ nV9zB0wlj1/KyaWQ6Hh1bGETGubi0XEg2W3H3EUfOxgTIEumoRzGEz33AdIG+6rdoLYV Kqof9IhelRCQ/VHK1CANDEdaSQD2NysVoawhDhZ6sBJbxMOBlLRBBN9fIEq1WvRzd6R4 P0yr2z2NG+S8rO+BJMYQEdaxwk7h0IU5FQfRDxt6Ba+vi97fOCVxU52eScuB/0d3nmi8 GV7AsularfnpPd5aVCpv9rVMNSsmpMwQzoyKgCsLfaZpNJefRQDMSxdfQRbMSo4ISLAv bxRw== 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 s8si16042162ejq.612.2021.04.27.05.33.51; Tue, 27 Apr 2021 05:34:15 -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 S235489AbhD0Mdk (ORCPT + 99 others); Tue, 27 Apr 2021 08:33:40 -0400 Received: from foss.arm.com ([217.140.110.172]:52338 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235410AbhD0Mdj (ORCPT ); Tue, 27 Apr 2021 08:33:39 -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 A544331B; Tue, 27 Apr 2021 05:32:56 -0700 (PDT) Received: from [10.57.61.101] (unknown [10.57.61.101]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 809803F70D; Tue, 27 Apr 2021 05:32:55 -0700 (PDT) Subject: Re: dma-api debugfs directory is not created since debugfs is not initialized To: Greg KH , Corentin Labbe Cc: rafael@kernel.org, hch@lst.de, m.szyprowski@samsung.com, iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org References: From: Robin Murphy Message-ID: <22f268bb-9b96-1208-0292-68c9b50422a1@arm.com> Date: Tue, 27 Apr 2021 13:32:50 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:78.0) Gecko/20100101 Thunderbird/78.10.0 MIME-Version: 1.0 In-Reply-To: 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-04-27 12:39, Greg KH wrote: > On Tue, Apr 27, 2021 at 01:34:27PM +0200, Corentin Labbe wrote: >> Hello >> >> I try to debug some DMA problem on next-20210427, and so I have enabled CONFIG_DMA_API_DEBUG=y. >> But the dma-api directory does show up in debugfs, but lot of other directory exists in it. > > Does it show up properly in 5.12? > >> After debugging it seems due to commit 56348560d495 ("debugfs: do not attempt to create a new file before the filesystem is initalized") >> Reverting the commit permit to "dma-api" debugfs to be found. (but seems not the right way to fix it). > > We have had some odd start-up ordering issues that the above commit has > caused to show. Given that this commit is now in stable kernels, with > no report of this issue so far, I'm worried that maybe this is a dma > subsystem ordering issue? Both debugfs_init() and dma_debug_init() do run at core_initcall level, and disassembling the vmlinux from my current working tree does indeed suggest that they somehow end up in the wrong relative order: [...] ffff80001160d0c8 <__initcall__kmod_debug__325_918_dma_debug_init1>: ffff80001160d0c8: feb0d528 .word 0xfeb0d528 [...] ffff80001160d108 <__initcall__kmod_debugfs__357_848_debugfs_init1>: ffff80001160d108: fff4326c .word 0xfff4326c [...] I always had the impression that initcall ordering tended to work out roughly alphabetical, such that entries from fs/* might come before kernel/*, but I guess it's at the whims of the linker in the end :/ Perhaps the easiest thing to do is split out dma_debug_fs_init() and run that at a later level? We do want the dma-debug infrastructure itself to be up as early as possible, but I think the debugfs view of its internals can happily wait until closer to the time that there's actually a userspace to be able to look at it. Robin.