From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 811C4C47096 for ; Thu, 3 Jun 2021 20:00:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 652C9613FF for ; Thu, 3 Jun 2021 20:00:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229675AbhFCUBw (ORCPT ); Thu, 3 Jun 2021 16:01:52 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:52746 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229576AbhFCUBu (ORCPT ); Thu, 3 Jun 2021 16:01:50 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: aratiu) with ESMTPSA id 155A81F434F7 From: Adrian Ratiu To: Greg Kroah-Hartman Cc: "Rafael J. Wysocki" , Andrew Morton , kernel@collabora.com, linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 0/1] Initialize debugfs/ksysfs earlier? In-Reply-To: References: <20210603125534.638672-1-adrian.ratiu@collabora.com> Date: Thu, 03 Jun 2021 23:00:00 +0300 Message-ID: <87y2bqwwfz.fsf@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; format=flowed Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi and thank you for the quick response! On Thu, 03 Jun 2021, Greg Kroah-Hartman wrote: > On Thu, Jun 03, 2021 at 03:55:33PM +0300, Adrian Ratiu wrote: >> Hi Greg & all, I would like to add a new debugfs file like in >> the next patch but I'm having a problem with commit >> 56348560d495 ("debugfs: do not attempt to create a new file >> before the filesystem is initalized"). > > You should have had a problem before that commit happened as > well, right? > Actually no, it works without problems before commit 56348560d495 and also works if I revert that commit or move the debugfs_init() and its dependency ksysfs_init() before the driver core init. All these 3 cases work without issues while testing, but none of them seem to be viable ideas and especially moving debugfs init earlier just to add this new attr file to the driver core is some thin reasoning, so that's why I asked via this RFC. :) >> The problem is debugfs is initialized after the driver core, >> during the core initcall, so I get an -ENOENT failure due to >> the above commit. My first reaction is to move the >> ksysfs_init() and debugfs_init() calls before the driver core >> init which works. Would that be ok? An alternative would be >> to create the new debugfs file somewhere else than the driver >> core, but I'm not sure where would be a good location, maybe in >> debugfs_init()? Doesn't seem right. > > I don't really want the driver core to be messing with debugfs > at all, why is that needed? I'll respond on your patch... KernelCI maintainers asked me to add some tests for driver probe() results similar to how the -EPROBE_DEFER is tested via the existing debugfs devices_deferred and at the same time to add a new debugfs interface similar to devices_deferred to avoid parsing the printk buffer for non-EPROBE_DEFER results. If you think adding such an interface is a bad idea, please just tell me so and I will use it as amunition to push back and get the info from printk. :) > > thanks, > > greg k-h