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=-23.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_IN_DEF_DKIM_WL autolearn=unavailable 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 85A5BC43381 for ; Wed, 20 Jan 2021 19:11:48 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 589F923403 for ; Wed, 20 Jan 2021 19:11:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387842AbhATTGm (ORCPT ); Wed, 20 Jan 2021 14:06:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55628 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2392491AbhATTDb (ORCPT ); Wed, 20 Jan 2021 14:03:31 -0500 Received: from mail-yb1-xb33.google.com (mail-yb1-xb33.google.com [IPv6:2607:f8b0:4864:20::b33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B6511C061757 for ; Wed, 20 Jan 2021 11:02:46 -0800 (PST) Received: by mail-yb1-xb33.google.com with SMTP id p185so9297614ybg.8 for ; Wed, 20 Jan 2021 11:02:46 -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=4jPdyf7csnEaOrlNIT9kHyquVjGEOb/saDEg+4JUVFI=; b=GXWFrxlW7h7Ccmu201AlJ0i3zH1OBGX+7ae3c3xwAWHnytEgwmULkgdT9ivGOV4N3F L5Njok/YfcvBy02xWpQNLVptMjt3KQvO8okfsEtEXTMkSMs15F0nYXZmNn9wcec51ji4 66V/7pr1yu8QvpomFS2ibuYwdDG8sa7Dml2etoWNFBwL8OebfYisV/7V9tFeLjxSfviC 6I2CXzmWij7eF1JAfdSM6wfZm4/igyKLHyQTmiNBc6X3x7T6A1TolCWg9TKgTZFkIS3/ 2Z6V4pdzyuA4lZ83mPPwb+hNfSssNo0ub+6pk41DMJOuPUc4wUZ8q/9Pv3WnNyEvG6Ef 2esw== 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=4jPdyf7csnEaOrlNIT9kHyquVjGEOb/saDEg+4JUVFI=; b=TQ34iPvmtersgD2re+O2pirstGEIP9SIwvynDlg7vM0sVG5gwW+6QQDdzUUFiP7Hqw a5AXdglfnh5rkIY4y+SsBd4GpA1h85AAKODwtnmWtpr2pkEzmTHbnKVder3yDqj5q+ba 4BsTIweBzK0nzItCocIQikHU3Ui9bMULuK2dw7sHDPPIxQsPrW4VWqt7t/4aJ6iGe0dz v42seYZFn+iqf5RDZEydXjC9JS7V2TMVKgxxPZZ8yIJBwIhFnWCvLTZxlA907Ja6309k P8VL+4ED4rKEWtkWSZABBi1PuzTI0pkY4+hQuN1ccOfT0YotvRDopB/OF6aKGej5QWnb R9Xg== X-Gm-Message-State: AOAM531PxhH01rnUntzEInh05VUKgzbE38Wn3hA4MVgo4ydKl2a/ta/7 dsX2aDLKE8XlW89OlX3PauWYKvjItzSEXAFFdidbYg== X-Google-Smtp-Source: ABdhPJzcly2us+ps4x0SHFbK9AkNe9Kxkb2EVg9MufyFhzozTWNWq2AL/VmZLGwjG1JqDdlEE2kPiCmt4PWNKJ7P4/Y= X-Received: by 2002:a25:c343:: with SMTP id t64mr15290558ybf.228.1611169365754; Wed, 20 Jan 2021 11:02:45 -0800 (PST) MIME-Version: 1.0 References: <20210120105246.23218-1-michael@walle.cc> In-Reply-To: From: Saravana Kannan Date: Wed, 20 Jan 2021 11:02:09 -0800 Message-ID: Subject: Re: [PATCH] PCI: dwc: layerscape: convert to builtin_platform_driver() To: Rob Herring Cc: Michael Walle , linuxppc-dev , PCI , linux-arm-kernel , "linux-kernel@vger.kernel.org" , Minghuan Lian , Mingkai Hu , Roy Zang , Lorenzo Pieralisi , Bjorn Helgaas , Greg Kroah-Hartman Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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()? -Saravana > Then we're not fixing drivers later > when folks start caring about deferred probe and devlink. > > I'd really prefer if we convert this to a module instead. (And all the > other PCI host drivers.) > > > Fixes: e590474768f1 ("driver core: Set fw_devlink=on by default") > > This happened!? > > > Signed-off-by: Michael Walle > > --- > > drivers/pci/controller/dwc/pci-layerscape.c | 5 +++-- > > 1 file changed, 3 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/pci/controller/dwc/pci-layerscape.c b/drivers/pci/controller/dwc/pci-layerscape.c > > index 44ad34cdc3bc..5b9c625df7b8 100644 > > --- a/drivers/pci/controller/dwc/pci-layerscape.c > > +++ b/drivers/pci/controller/dwc/pci-layerscape.c > > @@ -232,7 +232,7 @@ static const struct of_device_id ls_pcie_of_match[] = { > > { }, > > }; > > > > -static int __init ls_pcie_probe(struct platform_device *pdev) > > +static int ls_pcie_probe(struct platform_device *pdev) > > { > > struct device *dev = &pdev->dev; > > struct dw_pcie *pci; > > @@ -271,10 +271,11 @@ static int __init ls_pcie_probe(struct platform_device *pdev) > > } > > > > static struct platform_driver ls_pcie_driver = { > > + .probe = ls_pcie_probe, > > .driver = { > > .name = "layerscape-pcie", > > .of_match_table = ls_pcie_of_match, > > .suppress_bind_attrs = true, > > }, > > }; > > -builtin_platform_driver_probe(ls_pcie_driver, ls_pcie_probe); > > +builtin_platform_driver(ls_pcie_driver); > > -- > > 2.20.1 > > 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=-13.6 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=unavailable 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 95D31C433DB for ; Wed, 20 Jan 2021 20:56:13 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F107B233FC for ; Wed, 20 Jan 2021 20:56:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F107B233FC Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4DLd963lhDzDqmh for ; Thu, 21 Jan 2021 07:56:10 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=google.com (client-ip=2607:f8b0:4864:20::b35; helo=mail-yb1-xb35.google.com; envelope-from=saravanak@google.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.a=rsa-sha256 header.s=20161025 header.b=GXWFrxlW; dkim-atps=neutral Received: from mail-yb1-xb35.google.com (mail-yb1-xb35.google.com [IPv6:2607:f8b0:4864:20::b35]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4DLZfT3M4yzDqgS for ; Thu, 21 Jan 2021 06:02:49 +1100 (AEDT) Received: by mail-yb1-xb35.google.com with SMTP id z1so20470553ybr.4 for ; Wed, 20 Jan 2021 11:02:49 -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=4jPdyf7csnEaOrlNIT9kHyquVjGEOb/saDEg+4JUVFI=; b=GXWFrxlW7h7Ccmu201AlJ0i3zH1OBGX+7ae3c3xwAWHnytEgwmULkgdT9ivGOV4N3F L5Njok/YfcvBy02xWpQNLVptMjt3KQvO8okfsEtEXTMkSMs15F0nYXZmNn9wcec51ji4 66V/7pr1yu8QvpomFS2ibuYwdDG8sa7Dml2etoWNFBwL8OebfYisV/7V9tFeLjxSfviC 6I2CXzmWij7eF1JAfdSM6wfZm4/igyKLHyQTmiNBc6X3x7T6A1TolCWg9TKgTZFkIS3/ 2Z6V4pdzyuA4lZ83mPPwb+hNfSssNo0ub+6pk41DMJOuPUc4wUZ8q/9Pv3WnNyEvG6Ef 2esw== 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=4jPdyf7csnEaOrlNIT9kHyquVjGEOb/saDEg+4JUVFI=; b=pcf0tDtZQr14a+R4qObaWbdDRn2kqoyt1ALlUhdYN58mflSXobedYjzigxrTGZYJLt uj2lAD06Yuby/BuJvYuV3otKCNo1Ern7DNb3PVk7b3BmOTWpFf5QrUJtIXzW0m67AIjI Gvt4kSm+WqozKEcru8QeXr0ZeWNWDSQHffQZNIaXW6MeIDUhb5faafw3a9/T4VEYB+ZD /uRmVOkUcmKk0vhUWjyXdZD1XGr1pD7VMT259NnLcQxW5RRA9nzYFADr0o+YSeGJP25f xrzor+3p1PGhXA7NNY9TvXumlJPAbX7PJ3D6mc+PbP4YIlNt0Bhydtg/ROMuh2UGgslN Ti/g== X-Gm-Message-State: AOAM530n3XabuFIGiWzhKLE7yXG7md4M7R+higuWIUCIZNOUrn5Lzmdt 5bnF6uMyxmGYDl44PmsVHlhG8Qh3siLeaLVJLxP6Cw== X-Google-Smtp-Source: ABdhPJzcly2us+ps4x0SHFbK9AkNe9Kxkb2EVg9MufyFhzozTWNWq2AL/VmZLGwjG1JqDdlEE2kPiCmt4PWNKJ7P4/Y= X-Received: by 2002:a25:c343:: with SMTP id t64mr15290558ybf.228.1611169365754; Wed, 20 Jan 2021 11:02:45 -0800 (PST) MIME-Version: 1.0 References: <20210120105246.23218-1-michael@walle.cc> In-Reply-To: From: Saravana Kannan Date: Wed, 20 Jan 2021 11:02:09 -0800 Message-ID: Subject: Re: [PATCH] PCI: dwc: layerscape: convert to builtin_platform_driver() To: Rob Herring Content-Type: text/plain; charset="UTF-8" X-Mailman-Approved-At: Thu, 21 Jan 2021 07:49:58 +1100 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Roy Zang , Lorenzo Pieralisi , PCI , "linux-kernel@vger.kernel.org" , Minghuan Lian , Michael Walle , Mingkai Hu , Greg Kroah-Hartman , Bjorn Helgaas , linuxppc-dev , linux-arm-kernel Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" 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()? -Saravana > Then we're not fixing drivers later > when folks start caring about deferred probe and devlink. > > I'd really prefer if we convert this to a module instead. (And all the > other PCI host drivers.) > > > Fixes: e590474768f1 ("driver core: Set fw_devlink=on by default") > > This happened!? > > > Signed-off-by: Michael Walle > > --- > > drivers/pci/controller/dwc/pci-layerscape.c | 5 +++-- > > 1 file changed, 3 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/pci/controller/dwc/pci-layerscape.c b/drivers/pci/controller/dwc/pci-layerscape.c > > index 44ad34cdc3bc..5b9c625df7b8 100644 > > --- a/drivers/pci/controller/dwc/pci-layerscape.c > > +++ b/drivers/pci/controller/dwc/pci-layerscape.c > > @@ -232,7 +232,7 @@ static const struct of_device_id ls_pcie_of_match[] = { > > { }, > > }; > > > > -static int __init ls_pcie_probe(struct platform_device *pdev) > > +static int ls_pcie_probe(struct platform_device *pdev) > > { > > struct device *dev = &pdev->dev; > > struct dw_pcie *pci; > > @@ -271,10 +271,11 @@ static int __init ls_pcie_probe(struct platform_device *pdev) > > } > > > > static struct platform_driver ls_pcie_driver = { > > + .probe = ls_pcie_probe, > > .driver = { > > .name = "layerscape-pcie", > > .of_match_table = ls_pcie_of_match, > > .suppress_bind_attrs = true, > > }, > > }; > > -builtin_platform_driver_probe(ls_pcie_driver, ls_pcie_probe); > > +builtin_platform_driver(ls_pcie_driver); > > -- > > 2.20.1 > > 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=-13.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=ham 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 4AC18C433DB for ; Wed, 20 Jan 2021 19:04:40 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E2F1F233F6 for ; Wed, 20 Jan 2021 19:04:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E2F1F233F6 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=M8NaSmY86QvQ+U28tg1z84Ep9llTUQJUriuCfnju84U=; b=jOnAty4fD3iRfSlzVUeVGJrhW hx1ALUmJeASrTUl3jXvX7b/xEXNb/qQ/f3pknHJx6KYfTG94qQXvzuY6o6yb/V+lp6YuG1+mMcFui n8jNOWA0MXyTvkX7lhtFsrbWvO8WMO9rW+7yDm/DBQKDOWklHTfizdZnHfPuIKy/yRnqmd3k0NL/G FKgW6exrfQi0RFiDaZ3kHxWuP8w5yyRrz9cuhALXFnPMwcFxA3RUYKqDOs56V2PxcYP626dm8Wvax jvgXL7BnEclyInR2Rb6tHiGT7l+P58wzwQseXgR6EG2JjO500rHgP1POVOtZIg1Ms0CKZ4RpniFFz FEdipOe2g==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1l2Ikl-0006xV-Tr; Wed, 20 Jan 2021 19:02:51 +0000 Received: from mail-yb1-xb2b.google.com ([2607:f8b0:4864:20::b2b]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1l2Iki-0006ux-2M for linux-arm-kernel@lists.infradead.org; Wed, 20 Jan 2021 19:02:49 +0000 Received: by mail-yb1-xb2b.google.com with SMTP id i141so12980111yba.0 for ; Wed, 20 Jan 2021 11:02:47 -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=4jPdyf7csnEaOrlNIT9kHyquVjGEOb/saDEg+4JUVFI=; b=GXWFrxlW7h7Ccmu201AlJ0i3zH1OBGX+7ae3c3xwAWHnytEgwmULkgdT9ivGOV4N3F L5Njok/YfcvBy02xWpQNLVptMjt3KQvO8okfsEtEXTMkSMs15F0nYXZmNn9wcec51ji4 66V/7pr1yu8QvpomFS2ibuYwdDG8sa7Dml2etoWNFBwL8OebfYisV/7V9tFeLjxSfviC 6I2CXzmWij7eF1JAfdSM6wfZm4/igyKLHyQTmiNBc6X3x7T6A1TolCWg9TKgTZFkIS3/ 2Z6V4pdzyuA4lZ83mPPwb+hNfSssNo0ub+6pk41DMJOuPUc4wUZ8q/9Pv3WnNyEvG6Ef 2esw== 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=4jPdyf7csnEaOrlNIT9kHyquVjGEOb/saDEg+4JUVFI=; b=YTL6AAC+W+mav+bo5IKOnncOpEvCBf/gH7s1MV6/QVygWZlEf8jXNRAs+3yj72kxHQ gbAJpkvKNxY1EkNfGaE297u2u+TEukgYpN5BadwQS4p/OZ+Uz3glLUMqXyepBr1UG7ZW 7Ame9jdlw+OMYCOnqyQhtMilzmllKoX0bRxVjIzC+EbnSXnRFVxEk5bLx4r3sR6OwCuv 9EHpQVYq9jRjHVINv5BP5fMT+EvrKe5gJfnFxvoYVniTPYdr6olNNnwlmtdYXcqvaD8N pGFnuBQfzpB5iktM2HGoi4lWSJXnPoDQNF/0VMGJQD52NOB0mxz+ZVuXBR1rFWg5e/4Y 33mA== X-Gm-Message-State: AOAM5330rU7Z111O9F9JbAyyd2FhV/d9OyVhf1B3tzOUxDRpNe4gK6mR mm+gnh2aT7zLSlZ1QlKhXkjcZ4Ya8PtB0bx9GL2bUA== X-Google-Smtp-Source: ABdhPJzcly2us+ps4x0SHFbK9AkNe9Kxkb2EVg9MufyFhzozTWNWq2AL/VmZLGwjG1JqDdlEE2kPiCmt4PWNKJ7P4/Y= X-Received: by 2002:a25:c343:: with SMTP id t64mr15290558ybf.228.1611169365754; Wed, 20 Jan 2021 11:02:45 -0800 (PST) MIME-Version: 1.0 References: <20210120105246.23218-1-michael@walle.cc> In-Reply-To: From: Saravana Kannan Date: Wed, 20 Jan 2021 11:02:09 -0800 Message-ID: Subject: Re: [PATCH] PCI: dwc: layerscape: convert to builtin_platform_driver() To: Rob Herring X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210120_140248_188115_1BF12FD7 X-CRM114-Status: GOOD ( 24.89 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Roy Zang , Lorenzo Pieralisi , PCI , "linux-kernel@vger.kernel.org" , Minghuan Lian , Michael Walle , Mingkai Hu , Greg Kroah-Hartman , Bjorn Helgaas , linuxppc-dev , linux-arm-kernel Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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()? -Saravana > Then we're not fixing drivers later > when folks start caring about deferred probe and devlink. > > I'd really prefer if we convert this to a module instead. (And all the > other PCI host drivers.) > > > Fixes: e590474768f1 ("driver core: Set fw_devlink=on by default") > > This happened!? > > > Signed-off-by: Michael Walle > > --- > > drivers/pci/controller/dwc/pci-layerscape.c | 5 +++-- > > 1 file changed, 3 insertions(+), 2 deletions(-) > > > > diff --git a/drivers/pci/controller/dwc/pci-layerscape.c b/drivers/pci/controller/dwc/pci-layerscape.c > > index 44ad34cdc3bc..5b9c625df7b8 100644 > > --- a/drivers/pci/controller/dwc/pci-layerscape.c > > +++ b/drivers/pci/controller/dwc/pci-layerscape.c > > @@ -232,7 +232,7 @@ static const struct of_device_id ls_pcie_of_match[] = { > > { }, > > }; > > > > -static int __init ls_pcie_probe(struct platform_device *pdev) > > +static int ls_pcie_probe(struct platform_device *pdev) > > { > > struct device *dev = &pdev->dev; > > struct dw_pcie *pci; > > @@ -271,10 +271,11 @@ static int __init ls_pcie_probe(struct platform_device *pdev) > > } > > > > static struct platform_driver ls_pcie_driver = { > > + .probe = ls_pcie_probe, > > .driver = { > > .name = "layerscape-pcie", > > .of_match_table = ls_pcie_of_match, > > .suppress_bind_attrs = true, > > }, > > }; > > -builtin_platform_driver_probe(ls_pcie_driver, ls_pcie_probe); > > +builtin_platform_driver(ls_pcie_driver); > > -- > > 2.20.1 > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel