Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3732849pxb; Tue, 26 Jan 2021 03:25:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJzx6w87EbCvTmzTWt3xSe3o5dEqJ5E0imwH2E9RcqXnwWjK09CqmWVOgiX9Ylffg7CFNiB2 X-Received: by 2002:a50:fd12:: with SMTP id i18mr4267583eds.220.1611660333735; Tue, 26 Jan 2021 03:25:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611660333; cv=none; d=google.com; s=arc-20160816; b=cixS6t45nNCEly/pjiAcDWA6OvLAKMNSa5XOXdwihaZmMoWKOwUim28GKEz1vjgWSy Fm6Zym9J+vJXteV3eOEjt0WWAOXC19RVREujxwn6GeBcHxcLVnkaa/oK4g4TYeD++dTe l7LTiz+JX7WHlOyDu4m0W+CBjpUgAw/FVnLvpyfaJ3qzQXTaoH6Hbr06Ik3Zou7wnVT5 I1XbFYx3drpeWh3p0dznStPVE7+MUAxjI34a86yk+SR0qnbMIOTG09QmuKg+vs1u1Qj3 mSzYO7KuvMXu8RtpoNEXTGuwnut4YYZ7VyC97YzDn68djwdecKhXqQWo+n9qyziGAPrm uXLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=dQS05gAa+WfDRZQbLeXyiyoUlWSeuuqlrJ0M+LF4pGw=; b=WymylRObLs/25xsmgvt1RV5mHS1C6QOH23QWtWlWWEQwpf4IIu/2wFYd2DhS9iw5fs oZ1ca3p39jTynqksDDIXCnURUP1S8AQL8To40JW4EtZ0NFxkDow1GLKz49QUSNN+bAcw 1WBI/G/eVET5GSP++nr2YigaVZDwKunSjZgEk7lfIsG3M21doJAUKwpFbJHnlgnRPCvy 4L6vngKG3htSZth/o6iZHh1RrcGJRbKXd8iqg9Tv4YIdHZZ5F0KsY68f34urUP4LHbZw ALKzMWESazZjrPmBwHPbfyjzWwj988ZHm3/x8ehQzjiE4V4Dh4CYfoplPo4iMV8wK2b4 W+pQ== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h18si7108901ejk.90.2021.01.26.03.25.09; Tue, 26 Jan 2021 03:25:33 -0800 (PST) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2392262AbhAZLWP (ORCPT + 99 others); Tue, 26 Jan 2021 06:22:15 -0500 Received: from mail-ot1-f49.google.com ([209.85.210.49]:39077 "EHLO mail-ot1-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390427AbhAZIvG (ORCPT ); Tue, 26 Jan 2021 03:51:06 -0500 Received: by mail-ot1-f49.google.com with SMTP id i30so15537498ota.6; Tue, 26 Jan 2021 00:50:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=dQS05gAa+WfDRZQbLeXyiyoUlWSeuuqlrJ0M+LF4pGw=; b=kSa/7qtt5aHXOir55Yn9tnMtiNUqcBdzhYRFuZSyWVQDhDsnb8c/WNWxUqp0w3pREp to5Yu3gs5YAElhZgQdbgAV8KW5CeBC3pyxSa/pmiAe+p5acsQoWpmt6VelV+Nn1fcgL/ LFF4zDc4abObMqnnkPv6gbCOJs6Bmq7obdtk8brj1ImutIoD8wkK+XJHSMOmJyWqXW1h mCIgaRPUTao+nBpOvx4sbR5bMJA0EMtgOHwOiwacLGggXB6fxNP0axNC33O+FOcP3v9K GIcQ9Q2sk9ng98EJaMlPusg8fTnLv3Lj90PTHqVNESAXWZLixhA1eVg6fvuT0dudGL2X dRBQ== X-Gm-Message-State: AOAM533Xw2u3K5yz4UZwo/CJMTIb0slPBM028V0iDdqTMu0l5uil9Qpl CYwloAjTufzTReBKQPq0DHZe5S6NAaQBqvg7hj0= X-Received: by 2002:a05:6830:15cc:: with SMTP id j12mr3278439otr.145.1611651025336; Tue, 26 Jan 2021 00:50:25 -0800 (PST) MIME-Version: 1.0 References: <20210120105246.23218-1-michael@walle.cc> In-Reply-To: From: Geert Uytterhoeven Date: Tue, 26 Jan 2021 09:50:14 +0100 Message-ID: Subject: Re: [PATCH] PCI: dwc: layerscape: convert to builtin_platform_driver() To: Saravana Kannan Cc: Michael Walle , Lorenzo Pieralisi , Roy Zang , PCI , LKML , Minghuan Lian , Mingkai Hu , Greg Kroah-Hartman , Bjorn Helgaas , linuxppc-dev , linux-arm-kernel Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Saravana, On Mon, Jan 25, 2021 at 11:42 PM Saravana Kannan wrote: > On Mon, Jan 25, 2021 at 11:49 AM Michael Walle wrote: > > Am 2021-01-21 12:01, schrieb Geert Uytterhoeven: > > > On Thu, Jan 21, 2021 at 1:05 AM Saravana Kannan > > > wrote: > > >> On Wed, Jan 20, 2021 at 3:53 PM Michael Walle > > >> wrote: > > >> > Am 2021-01-20 20:47, schrieb Saravana Kannan: > > >> > > On Wed, Jan 20, 2021 at 11:28 AM Michael Walle > > >> > > wrote: > > >> > >> > > >> > >> [RESEND, fat-fingered the buttons of my mail client and converted > > >> > >> all CCs to BCCs :(] > > >> > >> > > >> > >> Am 2021-01-20 20:02, schrieb Saravana Kannan: > > >> > >> > On Wed, Jan 20, 2021 at 6:24 AM Rob Herring wrote: > > >> > >> >> > > >> > >> >> On Wed, Jan 20, 2021 at 4:53 AM Michael Walle > > >> > >> >> wrote: > > >> > >> >> > > > >> > >> >> > fw_devlink will defer the probe until all suppliers are ready. We can't > > >> > >> >> > use builtin_platform_driver_probe() because it doesn't retry after probe > > >> > >> >> > deferral. Convert it to builtin_platform_driver(). > > >> > >> >> > > >> > >> >> If builtin_platform_driver_probe() doesn't work with fw_devlink, then > > >> > >> >> shouldn't it be fixed or removed? > > >> > >> > > > >> > >> > I was actually thinking about this too. The problem with fixing > > >> > >> > builtin_platform_driver_probe() to behave like > > >> > >> > builtin_platform_driver() is that these probe functions could be > > >> > >> > marked with __init. But there are also only 20 instances of > > >> > >> > builtin_platform_driver_probe() in the kernel: > > >> > >> > $ git grep ^builtin_platform_driver_probe | wc -l > > >> > >> > 20 > > >> > >> > > > >> > >> > So it might be easier to just fix them to not use > > >> > >> > builtin_platform_driver_probe(). > > >> > >> > > > >> > >> > Michael, > > >> > >> > > > >> > >> > Any chance you'd be willing to help me by converting all these to > > >> > >> > builtin_platform_driver() and delete builtin_platform_driver_probe()? > > >> > >> > > >> > >> If it just moving the probe function to the _driver struct and > > >> > >> remove the __init annotations. I could look into that. > > >> > > > > >> > > Yup. That's pretty much it AFAICT. > > >> > > > > >> > > builtin_platform_driver_probe() also makes sure the driver doesn't ask > > >> > > for async probe, etc. But I doubt anyone is actually setting async > > >> > > flags and still using builtin_platform_driver_probe(). > > >> > > > >> > Hasn't module_platform_driver_probe() the same problem? And there > > >> > are ~80 drivers which uses that. > > >> > > >> Yeah. The biggest problem with all of these is the __init markers. > > >> Maybe some familiar with coccinelle can help? > > > > > > And dropping them will increase memory usage. > > > > Although I do have the changes for the builtin_platform_driver_probe() > > ready, I don't think it makes much sense to send these unless we agree > > on the increased memory footprint. While there are just a few > > builtin_platform_driver_probe() and memory increase _might_ be > > negligible, there are many more module_platform_driver_probe(). > > While it's good to drop code that'll not be used past kernel init, the > module_platform_driver_probe() is going even more extreme. It doesn't > even allow deferred probe (well before kernel init is done). I don't > think that behavior is right and that's why we should delete it. Also, This construct is typically used for builtin hardware for which the dependencies are registered very early, and thus known to probe at first try (if present). > I doubt if any of these probe functions even take up 4KB of memory. How many 4 KiB pages do you have in a system with 10 MiB of SRAM? How many can you afford to waste? Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds