All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@nvidia.com>
To: Leon Romanovsky <leon@kernel.org>
Cc: Doug Ledford <dledford@redhat.com>,
	Leon Romanovsky <leonro@nvidia.com>,
	Devesh Sharma <devesh.sharma@broadcom.com>,
	linux-rdma@vger.kernel.org,
	Naresh Kumar PBS <nareshkumar.pbs@broadcom.com>,
	Selvin Xavier <selvin.xavier@broadcom.com>,
	Somnath Kotur <somnath.kotur@broadcom.com>,
	Sriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Subject: Re: [PATCH rdma-next] bnxt_re: Rely on Kconfig to keep module dependency
Date: Wed, 24 Mar 2021 12:07:59 -0300	[thread overview]
Message-ID: <20210324150759.GH2356281@nvidia.com> (raw)
In-Reply-To: <20210324142524.1135319-1-leon@kernel.org>

On Wed, Mar 24, 2021 at 04:25:24PM +0200, Leon Romanovsky wrote:
> From: Leon Romanovsky <leonro@nvidia.com>
> 
> Instead of manually messing with parent driver module reference
> counting, rely on "depends on" keyword to ensure that proper
> probe/remove chain is performed.

?? kconfig doesn't impact module ordering.

To have a proper remove chain there should be a symbol reference from
bnxt_re to whatever the other module is

> Signed-off-by: Leon Romanovsky <leonro@nvidia.com>
>  drivers/infiniband/hw/bnxt_re/Kconfig |  4 +---
>  drivers/infiniband/hw/bnxt_re/main.c  | 20 +++++---------------
>  2 files changed, 6 insertions(+), 18 deletions(-)
> 
> diff --git a/drivers/infiniband/hw/bnxt_re/Kconfig b/drivers/infiniband/hw/bnxt_re/Kconfig
> index 0feac5132ce1..b4779a6cd565 100644
> +++ b/drivers/infiniband/hw/bnxt_re/Kconfig
> @@ -2,9 +2,7 @@
>  config INFINIBAND_BNXT_RE
>  	tristate "Broadcom Netxtreme HCA support"
>  	depends on 64BIT
> -	depends on ETHERNET && NETDEVICES && PCI && INET && DCB
> -	select NET_VENDOR_BROADCOM
> -	select BNXT
> +	depends on ETHERNET && NETDEVICES && PCI && INET && DCB && BNXT

Though this is correct, BNXT is a 'tristate' so it should be
referenced with depends on select.

> diff --git a/drivers/infiniband/hw/bnxt_re/main.c b/drivers/infiniband/hw/bnxt_re/main.c
> index fdb8c2478258..a81adb07e5d9 100644
> +++ b/drivers/infiniband/hw/bnxt_re/main.c
> @@ -561,13 +561,6 @@ static struct bnxt_re_dev *bnxt_re_from_netdev(struct net_device *netdev)
>  	return container_of(ibdev, struct bnxt_re_dev, ibdev);
>  }
>  
> -static void bnxt_re_dev_unprobe(struct net_device *netdev,
> -				struct bnxt_en_dev *en_dev)
> -{
> -	dev_put(netdev);
> -	module_put(en_dev->pdev->driver->driver.owner);
> -}

And you are right to be wondering WTF is this

Jason

  reply	other threads:[~2021-03-24 15:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-24 14:25 [PATCH rdma-next] bnxt_re: Rely on Kconfig to keep module dependency Leon Romanovsky
2021-03-24 15:07 ` Jason Gunthorpe [this message]
2021-03-24 15:16   ` Leon Romanovsky
2021-03-24 16:30     ` Devesh Sharma
2021-03-24 16:56       ` Jason Gunthorpe
2021-03-24 17:24         ` Devesh Sharma
2021-03-24 17:35           ` Jason Gunthorpe
2021-03-25  8:40             ` Leon Romanovsky
2021-03-26  6:09               ` Devesh Sharma

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210324150759.GH2356281@nvidia.com \
    --to=jgg@nvidia.com \
    --cc=devesh.sharma@broadcom.com \
    --cc=dledford@redhat.com \
    --cc=leon@kernel.org \
    --cc=leonro@nvidia.com \
    --cc=linux-rdma@vger.kernel.org \
    --cc=nareshkumar.pbs@broadcom.com \
    --cc=selvin.xavier@broadcom.com \
    --cc=somnath.kotur@broadcom.com \
    --cc=sriharsha.basavapatna@broadcom.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.