public inbox for linux-s390@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Farman <farman@linux.ibm.com>
To: "Tian, Kevin" <kevin.tian@intel.com>,
	Matthew Rosato <mjrosato@linux.ibm.com>,
	Alex Williamson <alex.williamson@redhat.com>,
	Cornelia Huck <cohuck@redhat.com>,
	Jason Gunthorpe <jgg@nvidia.com>,
	"Liu, Yi L" <yi.l.liu@intel.com>
Cc: Zhenyu Wang <zhenyuw@linux.intel.com>,
	"Wang, Zhi A" <zhi.a.wang@intel.com>,
	Jani Nikula <jani.nikula@linux.intel.com>,
	Joonas Lahtinen <joonas.lahtinen@linux.intel.com>,
	"Vivi, Rodrigo" <rodrigo.vivi@intel.com>,
	Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>,
	David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
	Halil Pasic <pasic@linux.ibm.com>,
	Vineeth Vijayan <vneethv@linux.ibm.com>,
	Peter Oberparleiter <oberpar@linux.ibm.com>,
	Heiko Carstens <hca@linux.ibm.com>,
	Vasily Gorbik <gor@linux.ibm.com>,
	Alexander Gordeev <agordeev@linux.ibm.com>,
	Christian Borntraeger <borntraeger@linux.ibm.com>,
	Sven Schnelle <svens@linux.ibm.com>,
	Tony Krowiak <akrowiak@linux.ibm.com>,
	Jason Herne <jjherne@linux.ibm.com>,
	Harald Freudenberger <freude@linux.ibm.com>,
	Diana Craciun <diana.craciun@oss.nxp.com>,
	Eric Auger <eric.auger@redhat.com>,
	Kirti Wankhede <kwankhede@nvidia.com>,
	Abhishek Sahu <abhsahu@nvidia.com>,
	Yishai Hadas <yishaih@nvidia.com>,
	"intel-gvt-dev@lists.freedesktop.org" 
	<intel-gvt-dev@lists.freedesktop.org>,
	"intel-gfx@lists.freedesktop.org"
	<intel-gfx@lists.freedesktop.org>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-s390@vger.kernel.org" <linux-s390@vger.kernel.org>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>
Subject: Re: [PATCH v1 4/7] vfio/ccw: move private to mdev lifecycle
Date: Tue, 01 Nov 2022 10:05:54 -0400	[thread overview]
Message-ID: <079b2810baecce3eff38cc7961271b287823e800.camel@linux.ibm.com> (raw)
In-Reply-To: <BN9PR11MB527698B0A9E039268916AA018C369@BN9PR11MB5276.namprd11.prod.outlook.com>

On Tue, 2022-11-01 at 09:08 +0000, Tian, Kevin wrote:
> > From: Eric Farman <farman@linux.ibm.com>
> > Sent: Thursday, October 20, 2022 12:22 AM
> > 
> > @@ -101,15 +101,20 @@ static int vfio_ccw_mdev_probe(struct
> > mdev_device *mdev)
> >  {
> >         struct subchannel *sch = to_subchannel(mdev->dev.parent);
> >         struct vfio_ccw_parent *parent = dev_get_drvdata(&sch-
> > >dev);
> > -       struct vfio_ccw_private *private = dev_get_drvdata(&parent-
> > >dev);
> > +       struct vfio_ccw_private *private;
> >         int ret;
> > 
> > -       if (private->state == VFIO_CCW_STATE_NOT_OPER)
> > -               return -ENODEV;
> 
> Not familiar with ccw but just want to double confirm this removal
> is intentional w/o side-effect?

Right, it's intentional and fine. The concern previously was re-probing
the mdev when a device had gone into a non-recoverable state and the
private data was left hanging around. With the private now being
cleaned up in mdev_remove instead of the subchannel side, that's no
longer an issue.

> 
> > +       private = vfio_ccw_alloc_private(sch);
> > +       if (!private)
> > +               return -ENOMEM;
> > 
> >         ret = vfio_init_device(&private->vdev, &mdev->dev,
> > &vfio_ccw_dev_ops);
> > -       if (ret)
> > +       if (ret) {
> > +               kfree(private);
> >                 return ret;
> > +       }
> > +
> > +       dev_set_drvdata(&parent->dev, private);
> > 
> >         VFIO_CCW_MSG_EVENT(2, "sch %x.%x.%04x: create\n",
> >                            sch->schid.cssid,
> > @@ -123,6 +128,7 @@ static int vfio_ccw_mdev_probe(struct
> > mdev_device
> > *mdev)
> >         return 0;
> > 
> >  err_put_vdev:
> > +       dev_set_drvdata(&parent->dev, NULL);
> 
> No need to set drvdata to NULL, iiuc

Fair.

  reply	other threads:[~2022-11-01 14:06 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-19 16:21 [PATCH v1 0/7] vfio-ccw parent rework Eric Farman
2022-10-19 16:21 ` [PATCH v1 1/7] vfio/ccw: create a parent struct Eric Farman
2022-10-27 20:32   ` Eric Farman
2022-10-28 16:51   ` Matthew Rosato
2022-10-28 17:21     ` Eric Farman
2022-10-19 16:21 ` [PATCH v1 2/7] vfio/ccw: remove private->sch Eric Farman
2022-10-28 18:43   ` Matthew Rosato
2022-10-19 16:21 ` [PATCH v1 3/7] vfio/ccw: move private initialization to callback Eric Farman
2022-10-28 18:52   ` Matthew Rosato
2022-10-28 19:18     ` Eric Farman
2022-10-19 16:21 ` [PATCH v1 4/7] vfio/ccw: move private to mdev lifecycle Eric Farman
2022-11-01  9:08   ` Tian, Kevin
2022-11-01 14:05     ` Eric Farman [this message]
2022-10-19 16:21 ` [PATCH v1 5/7] vfio/ccw: remove release completion Eric Farman
2022-11-01  9:09   ` Tian, Kevin
2022-10-19 16:21 ` [PATCH v1 6/7] vfio/ccw: replace vfio_init_device with _alloc_ Eric Farman
2022-10-19 17:15   ` Jason Gunthorpe
2022-10-19 17:57     ` Eric Farman
2022-10-20 12:26       ` Jason Gunthorpe
2022-11-01  9:10   ` Tian, Kevin
2022-10-19 16:21 ` [PATCH v1 7/7] vfio: Remove vfio_free_device Eric Farman
2022-10-19 17:16   ` Jason Gunthorpe
2022-11-01  9:11   ` Tian, Kevin
2022-10-19 17:18 ` [PATCH v1 0/7] vfio-ccw parent rework 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=079b2810baecce3eff38cc7961271b287823e800.camel@linux.ibm.com \
    --to=farman@linux.ibm.com \
    --cc=abhsahu@nvidia.com \
    --cc=agordeev@linux.ibm.com \
    --cc=airlied@gmail.com \
    --cc=akrowiak@linux.ibm.com \
    --cc=alex.williamson@redhat.com \
    --cc=borntraeger@linux.ibm.com \
    --cc=cohuck@redhat.com \
    --cc=daniel@ffwll.ch \
    --cc=diana.craciun@oss.nxp.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=eric.auger@redhat.com \
    --cc=freude@linux.ibm.com \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-gvt-dev@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=jgg@nvidia.com \
    --cc=jjherne@linux.ibm.com \
    --cc=joonas.lahtinen@linux.intel.com \
    --cc=kevin.tian@intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=kwankhede@nvidia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=mjrosato@linux.ibm.com \
    --cc=oberpar@linux.ibm.com \
    --cc=pasic@linux.ibm.com \
    --cc=rodrigo.vivi@intel.com \
    --cc=svens@linux.ibm.com \
    --cc=tvrtko.ursulin@linux.intel.com \
    --cc=vneethv@linux.ibm.com \
    --cc=yi.l.liu@intel.com \
    --cc=yishaih@nvidia.com \
    --cc=zhenyuw@linux.intel.com \
    --cc=zhi.a.wang@intel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox