All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Gunthorpe <jgg@ziepe.ca>
To: sharmaajay@linuxonhyperv.com
Cc: Long Li <longli@microsoft.com>, Leon Romanovsky <leon@kernel.org>,
	Dexuan Cui <decui@microsoft.com>, Wei Liu <wei.liu@kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	linux-rdma@vger.kernel.org, linux-hyperv@vger.kernel.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Ajay Sharma <sharmaajay@microsoft.com>
Subject: Re: [Patch v7 2/5] RDMA/mana_ib: Register Mana IB  device with Management SW
Date: Mon, 23 Oct 2023 15:19:18 -0300	[thread overview]
Message-ID: <20231023181918.GJ691768@ziepe.ca> (raw)
In-Reply-To: <1697494322-26814-3-git-send-email-sharmaajay@linuxonhyperv.com>

On Mon, Oct 16, 2023 at 03:11:59PM -0700, sharmaajay@linuxonhyperv.com wrote:

> diff --git a/drivers/infiniband/hw/mana/device.c b/drivers/infiniband/hw/mana/device.c
> index 083f27246ba8..ea4c8c8fc10d 100644
> --- a/drivers/infiniband/hw/mana/device.c
> +++ b/drivers/infiniband/hw/mana/device.c
> @@ -78,22 +78,34 @@ static int mana_ib_probe(struct auxiliary_device *adev,
>  	mib_dev->ib_dev.num_comp_vectors = 1;
>  	mib_dev->ib_dev.dev.parent = mdev->gdma_context->dev;
>  
> -	ret = ib_register_device(&mib_dev->ib_dev, "mana_%d",
> -				 mdev->gdma_context->dev);
> +	ret = mana_gd_register_device(&mib_dev->gc->mana_ib);
>  	if (ret) {
> -		ib_dealloc_device(&mib_dev->ib_dev);
> -		return ret;
> +		ibdev_err(&mib_dev->ib_dev, "Failed to register device, ret %d",
> +			  ret);
> +		goto free_ib_device;
>  	}
>  
> +	ret = ib_register_device(&mib_dev->ib_dev, "mana_%d",
> +				 mdev->gdma_context->dev);
> +	if (ret)
> +		goto deregister_device;
> +
>  	dev_set_drvdata(&adev->dev, mib_dev);
>  
>  	return 0;
> +
> +deregister_device:
> +	mana_gd_deregister_device(&mib_dev->gc->mana_ib);
> +free_ib_device:
> +	ib_dealloc_device(&mib_dev->ib_dev);
> +	return ret;
>  }
>  
>  static void mana_ib_remove(struct auxiliary_device *adev)
>  {
>  	struct mana_ib_dev *mib_dev = dev_get_drvdata(&adev->dev);
>  
> +	mana_gd_deregister_device(&mib_dev->gc->mana_ib);
>  	ib_unregister_device(&mib_dev->ib_dev);
>  	ib_dealloc_device(&mib_dev->ib_dev);
>  }

That's definitely in the wrong order

Are you shure these things should just be part of
ops->enable_driver/dealloc_driver?

> diff --git a/drivers/infiniband/hw/mana/main.c b/drivers/infiniband/hw/mana/main.c
> index 189e774cdab6..2c4e3c496644 100644
> --- a/drivers/infiniband/hw/mana/main.c
> +++ b/drivers/infiniband/hw/mana/main.c
> @@ -8,7 +8,7 @@
>  void mana_ib_uncfg_vport(struct mana_ib_dev *mib_dev, struct mana_ib_pd *pd,
>  			 u32 port)
>  {
> -	struct gdma_dev *gd = mib_dev->gdma_dev;
> +	struct gdma_dev *gd = &mib_dev->gc->mana;

What is this stuff doing in this patch? Make another patch if you want
to remove gdma_dev

Jason

  reply	other threads:[~2023-10-23 18:19 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-16 22:11 [Patch v7 0/5] RDMA/mana_ib sharmaajay
2023-10-16 22:11 ` [Patch v7 1/5] RDMA/mana_ib: Rename all mana_ib_dev type variables to mib_dev sharmaajay
2023-10-23 18:14   ` Jason Gunthorpe
2023-10-27 22:00     ` Long Li
2023-10-16 22:11 ` [Patch v7 2/5] RDMA/mana_ib: Register Mana IB device with Management SW sharmaajay
2023-10-23 18:19   ` Jason Gunthorpe [this message]
2023-10-27 21:59     ` Long Li
2023-10-16 22:12 ` [Patch v7 3/5] RDMA/mana_ib: Create adapter and Add error eq sharmaajay
2023-10-23 18:21   ` Jason Gunthorpe
2023-10-16 22:12 ` [Patch v7 4/5] RDMA/mana_ib: Query adapter capabilities sharmaajay
2023-10-17  4:31   ` Kalesh Anakkur Purayil
     [not found]     ` <87330A78-CDF0-4B49-8192-DBDF006DB8A7@microsoft.com>
2023-10-18  4:10       ` [EXTERNAL] " Kalesh Anakkur Purayil
     [not found]         ` <MN0PR21MB360603822A844951D3400C1AD6D5A@MN0PR21MB3606.namprd21.prod.outlook.com>
2023-10-18 17:25           ` Kalesh Anakkur Purayil
2023-10-16 22:12 ` [Patch v7 5/5] RDMA/mana_ib: Send event to qp sharmaajay
2023-10-23 18:23   ` Jason Gunthorpe
2023-10-25 19:59     ` [EXTERNAL] " Ajay Sharma
2023-10-27 21:35       ` Long Li
2023-10-30 12:42         ` Jason Gunthorpe

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=20231023181918.GJ691768@ziepe.ca \
    --to=jgg@ziepe.ca \
    --cc=davem@davemloft.net \
    --cc=decui@microsoft.com \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=leon@kernel.org \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=longli@microsoft.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=sharmaajay@linuxonhyperv.com \
    --cc=sharmaajay@microsoft.com \
    --cc=wei.liu@kernel.org \
    /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.