linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stuart Yoder <stuart.yoder@nxp.com>
To: Bharat Bhushan <bharat.bhushan@nxp.com>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>
Cc: "devel@driverdev.osuosl.org" <devel@driverdev.osuosl.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Bharat Bhushan <bharat.bhushan@nxp.com>
Subject: RE: [PATCH] fsl mc-bus: Move mc-io destroy to bus remove
Date: Mon, 20 Jun 2016 22:29:17 +0000	[thread overview]
Message-ID: <HE1PR04MB16414F03C61511225572B00A8D2A0@HE1PR04MB1641.eurprd04.prod.outlook.com> (raw)
In-Reply-To: <1466059903-4114-1-git-send-email-Bharat.Bhushan@nxp.com>



> -----Original Message-----
> From: Bharat Bhushan [mailto:Bharat.Bhushan@nxp.com]
> Sent: Thursday, June 16, 2016 1:52 AM
> To: gregkh@linuxfoundation.org; Stuart Yoder <stuart.yoder@nxp.com>
> Cc: devel@driverdev.osuosl.org; linux-kernel@vger.kernel.org; Bharat Bhushan <bharat.bhushan@nxp.com>
> Subject: [PATCH] fsl mc-bus: Move mc-io destroy to bus remove
> 
> fsl_mc_device_add() is called when a new mc device is added and
> fsl_mc_device_remove() is called when a mc device is removed.
> Now mc portals (fsl_create_mc_io) are not created during device
> addition i.e fsl_mc_device_add(). But mc portal are being destroyed
> when an mc device are removed i.e fsl_mc_device_remove(), which is
> not correct way of reverting what is done during device addition.
> 
> Now this leads to the problem with VFIO driver where we do not want
> the portal to be destroyed when an mc-device is removed. VFIO
> creates one mc-portal for all dprc-containers bound to it and it
> destroys the mc portal when driver itself is removed.
> 
> This change moves the mc-portal destroy part to bus-remove for
> mc-bus and dprc-driver remove for child DPRCs. This also makes
> fsl_mc_device_remove() exactly reverting what is done in
> fsl_mc_device_add() with respect to mc portal creation.

I think we need to improve and clarify this commit message.
This change is needed, but I don't think the message
makes it clear what is going on.

> Signed-off-by: Bharat Bhushan <Bharat.Bhushan@nxp.com>
> ---
>  drivers/staging/fsl-mc/bus/dprc-driver.c | 3 +++
>  drivers/staging/fsl-mc/bus/mc-bus.c      | 8 ++++----
>  2 files changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/fsl-mc/bus/dprc-driver.c b/drivers/staging/fsl-mc/bus/dprc-driver.c
> index 7fc4717..14f9c82 100644
> --- a/drivers/staging/fsl-mc/bus/dprc-driver.c
> +++ b/drivers/staging/fsl-mc/bus/dprc-driver.c
> @@ -801,6 +801,9 @@ static int dprc_remove(struct fsl_mc_device *mc_dev)
>  		dev_set_msi_domain(&mc_dev->dev, NULL);
>  	}
> 
> +	fsl_destroy_mc_io(mc_dev->mc_io);
> +	mc_dev->mc_io = NULL;
> +

We need to do the destroy here, but we need to add a check and
only do this for child containers.

Thanks,
Stuart

      reply	other threads:[~2016-06-20 23:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-16  6:51 [PATCH] fsl mc-bus: Move mc-io destroy to bus remove Bharat Bhushan
2016-06-20 22:29 ` Stuart Yoder [this message]

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=HE1PR04MB16414F03C61511225572B00A8D2A0@HE1PR04MB1641.eurprd04.prod.outlook.com \
    --to=stuart.yoder@nxp.com \
    --cc=bharat.bhushan@nxp.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).