Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3382832pxb; Mon, 25 Jan 2021 14:47:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJwKSNCEd4fY8K1Kqv1rqPyOTClA3XepwCzItF+jB7DJHSJDNdjnm7qCi6CHAUmlV9Jfnu6H X-Received: by 2002:a17:906:7689:: with SMTP id o9mr1749357ejm.324.1611614870853; Mon, 25 Jan 2021 14:47:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611614870; cv=none; d=google.com; s=arc-20160816; b=pKD98MGabbfs29BhNnYW4JgGwH8+/TRpT2/YJD2C6G5RJsTTmvmr8xoZIj6lCwFHW6 kUWpyg4aRSdxXi8BKYn8oMzec9p4rE0vq+hZ4kOzuplKjOIwrVjfR5lJkJ1uwkEEs3hC +KpXZ9pW1WBvjBj/TynTK86OwxFAaB2qYJ393zKb2lhqqTB3fPr0akpbLeTFBIO6sq8W ho8AbYGRpoEnj/Fqlp9YGfb+QKDQpvOqIAJATkneSBf4+S5W0HBUPFTyc25geiPZTqla 8sqxgS9pNn6dGh/PsEps66woxpUMtrQBPuj9CudYvP6/K7LjIMeC11qYnbV0OpeTJBWh XI7A== 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:dkim-signature; bh=uUoNf9BBFKkgh2ppnaejSB621RRoaZzYwArQ/+nGs5I=; b=djKm5iyl9883KOgj2CuDy3FbGQ6YqetKwLFUiQM4KDt4CEQt7EAloeiNABW8np7EmX 8/CW8aHE8fVRWpTWvskOiXdORXnj3azMbYAhdt2lsTuOz7b9C1v5DvkCmvJ4s/D2gVzQ ENIw8onGzmI0CaV2khQ4EMKLfICkaWamGsLOfl77sZhboVbbRucLcl+LeUsao4rouUaN /I96QyMmcWYVT9LOZmchaaGb4XhDvCQg9C+Wtb5iLkBcxkkk8k63Y57R0w3MUTO4D57n UU9KyKSsWgy39YOXPS1Fh2nnH98fBnSHl3Og8hti17R28/aHeugryDX26z6yhpIxOFMu s4sQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=v0CUYdsf; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u10si6454221ejr.222.2021.01.25.14.47.27; Mon, 25 Jan 2021 14:47:50 -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; dkim=pass header.i=@google.com header.s=20161025 header.b=v0CUYdsf; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732651AbhAYWpA (ORCPT + 99 others); Mon, 25 Jan 2021 17:45:00 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39224 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732693AbhAYWnE (ORCPT ); Mon, 25 Jan 2021 17:43:04 -0500 Received: from mail-yb1-xb35.google.com (mail-yb1-xb35.google.com [IPv6:2607:f8b0:4864:20::b35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C15A7C061574 for ; Mon, 25 Jan 2021 14:42:23 -0800 (PST) Received: by mail-yb1-xb35.google.com with SMTP id v200so539440ybe.1 for ; Mon, 25 Jan 2021 14:42:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=uUoNf9BBFKkgh2ppnaejSB621RRoaZzYwArQ/+nGs5I=; b=v0CUYdsfdi78E2T5lQL29cB54rzB1CtEtGaQywaH8ndp/fK0k15CDrNwlYXhEyXGnP 6Y0DHhTk81aGdBor3d8zkKCVoBmT7D/aXbgN9n3yrbsMPRuS2Rkmo8oNkhOz/3Ki0RfW SmbaFODL6ySPYtok39wzAJVIjIvR/s2vbkntxDz+Ej1rnJsMqqury3SsKXGmeviI1BDH SoD+MDozlVTb89r7Zm2Gf6P18wk2T4ZUw7OavjOg7m/kq5cQNSvN+NKHXZvv9HhVNZlq tEI6rOU7qvZuDYFGdHCnakyn8Y0+1yJrwo3rRs/OdJZ0ScW7WullbDpbVzq35Aa+PxTR lj4A== 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=uUoNf9BBFKkgh2ppnaejSB621RRoaZzYwArQ/+nGs5I=; b=JFJy2cE8y78JWWPyZANvlSC2oyHuf+FeO4lSmdobeFsJ3UjnrMido3Ik64Y4Vc7r2F H8CvvSWPIvBQlHhfTvcJZgBuIsWlb4D2QLdBhFB6l9S5e87TIS4byDeRYDMYBjgJx8sa jz8IZiF6sgHWMf/rWYqERhMuYnkNKlNjSoRoUdKQz0D1V1lzeULb0HlDxsZsourphL8x LvO0QPCQr/WrhvGzWgwek/21+ZjCcuvHFw8Rzg+Ubu08r8ttT70+PUzYz8Y1ufYbEQHU Si9am668j4oxUixQW7AllUDqYxRG2UKaQTF8t7SCxFaivnfVCn2LR3kht0pyzEs+9Otu RxJw== X-Gm-Message-State: AOAM53044t2VUdD1Z5OQ0qvw7DByp1g36iqsn+zlYyqIfwnjMREo4dCZ 3vtTacv9D+Yvp1389tZO9O7Qk/XbvLhBS0kOpvyr9w== X-Received: by 2002:a25:3345:: with SMTP id z66mr4179764ybz.466.1611614542807; Mon, 25 Jan 2021 14:42:22 -0800 (PST) MIME-Version: 1.0 References: <20210120105246.23218-1-michael@walle.cc> In-Reply-To: From: Saravana Kannan Date: Mon, 25 Jan 2021 14:41:46 -0800 Message-ID: Subject: Re: [PATCH] PCI: dwc: layerscape: convert to builtin_platform_driver() To: Michael Walle Cc: Geert Uytterhoeven , 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 On Mon, Jan 25, 2021 at 11:49 AM Michael Walle wrote: > > Am 2021-01-21 12:01, schrieb Geert Uytterhoeven: > > Hi Saravana, > > > > 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, I doubt if any of these probe functions even take up 4KB of memory. -Saravana