]> www.infradead.org Git - users/willy/xarray.git/commitdiff
s390/cio: remove uevent suppress from cio driver
authorVineeth Vijayan <vneethv@linux.ibm.com>
Tue, 29 Jun 2021 07:38:22 +0000 (09:38 +0200)
committerHeiko Carstens <hca@linux.ibm.com>
Mon, 6 Dec 2021 13:42:24 +0000 (14:42 +0100)
commit fa1a8c23eb7d ("s390: cio: Delay uevents for subchannels")
introduced suppression of uevents for a subchannel until after it is
clear that the subchannel would not be unregistered again
immediately. This was done to avoid uevents being generated for I/O
subchannels with no valid device, which can happen on LPAR.

However, this also has some drawbacks: All subchannel drivers need to
manually remove the uevent suppression and generate an ADD uevent as
soon as they are sure that the subchannel will stay around. This misses
out on all uevents that are not the initial ADD uevent that would be
generated while uevents are suppressed; for example, all subchannels
were missing the BIND uevent.

As uevents being generated even for I/O subchannels without an
operational device turned out to be not as bad as missing uevents and
complicating the code flow, let's remove uevent suppression for
subchannels.

Signed-off-by: Vineeth Vijayan <vneethv@linux.ibm.com>
[cohuck@redhat.com: modified changelog]
Reviewed-by: Cornelia Huck <cohuck@redhat.com>
Reviewed-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Link: https://lore.kernel.org/r/20211122103756.352463-2-vneethv@linux.ibm.com
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
drivers/s390/cio/chsc_sch.c
drivers/s390/cio/css.c
drivers/s390/cio/device.c
drivers/s390/cio/eadm_sch.c
drivers/s390/cio/vfio_ccw_drv.c

index 684348d82f08520eb2a79b88c46c3e45749c4da4..962dfa25a310842633e818a002d4c9be520c359a 100644 (file)
@@ -91,11 +91,6 @@ static int chsc_subchannel_probe(struct subchannel *sch)
                         sch->schid.ssid, sch->schid.sch_no, ret);
                dev_set_drvdata(&sch->dev, NULL);
                kfree(private);
-       } else {
-               if (dev_get_uevent_suppress(&sch->dev)) {
-                       dev_set_uevent_suppress(&sch->dev, 0);
-                       kobject_uevent(&sch->dev.kobj, KOBJ_ADD);
-               }
        }
        return ret;
 }
index ce9e7517430f7f6fe14160a40bcf3323ad895869..fa829333507708f2bf13aa606d29ad5a060e45c8 100644 (file)
@@ -470,16 +470,6 @@ int css_register_subchannel(struct subchannel *sch)
        if (sch->st == SUBCHANNEL_TYPE_IO)
                sch->dev.type = &io_subchannel_type;
 
-       /*
-        * We don't want to generate uevents for I/O subchannels that don't
-        * have a working ccw device behind them since they will be
-        * unregistered before they can be used anyway, so we delay the add
-        * uevent until after device recognition was successful.
-        * Note that we suppress the uevent for all subchannel types;
-        * the subchannel driver can decide itself when it wants to inform
-        * userspace of its existence.
-        */
-       dev_set_uevent_suppress(&sch->dev, 1);
        css_update_ssd_info(sch);
        /* make it known to the system */
        ret = css_sch_device_register(sch);
@@ -488,15 +478,6 @@ int css_register_subchannel(struct subchannel *sch)
                              sch->schid.ssid, sch->schid.sch_no, ret);
                return ret;
        }
-       if (!sch->driver) {
-               /*
-                * No driver matched. Generate the uevent now so that
-                * a fitting driver module may be loaded based on the
-                * modalias.
-                */
-               dev_set_uevent_suppress(&sch->dev, 0);
-               kobject_uevent(&sch->dev.kobj, KOBJ_ADD);
-       }
        return ret;
 }
 
index 07a17613fab5878af0b016dc148cb62615a7a086..cd938a26b76c2396632edd5196b295dcddc4c7e5 100644 (file)
@@ -838,14 +838,6 @@ static void io_subchannel_register(struct ccw_device *cdev)
                adjust_init_count = 0;
                goto out;
        }
-       /*
-        * Now we know this subchannel will stay, we can throw
-        * our delayed uevent.
-        */
-       if (dev_get_uevent_suppress(&sch->dev)) {
-               dev_set_uevent_suppress(&sch->dev, 0);
-               kobject_uevent(&sch->dev.kobj, KOBJ_ADD);
-       }
        /* make it known to the system */
        ret = device_add(&cdev->dev);
        if (ret) {
@@ -1036,15 +1028,9 @@ static int io_subchannel_probe(struct subchannel *sch)
                                      "0.%x.%04x (rc=%d)\n",
                                      sch->schid.ssid, sch->schid.sch_no, rc);
                /*
-                * The console subchannel already has an associated ccw_device.
-                * Throw the delayed uevent for the subchannel, register
-                * the ccw_device and exit.
-                */
-               if (dev_get_uevent_suppress(&sch->dev)) {
-                       /* should always be the case for the console */
-                       dev_set_uevent_suppress(&sch->dev, 0);
-                       kobject_uevent(&sch->dev.kobj, KOBJ_ADD);
-               }
+               * The console subchannel already has an associated ccw_device.
+               * Register it and exit.
+               */
                cdev = sch_get_cdev(sch);
                rc = device_add(&cdev->dev);
                if (rc) {
index 15bdae5981ca71aca9a34bb6ce57395302a3acad..8b463681a14902f93a8aabbdf73556f4e4a1f512 100644 (file)
@@ -243,11 +243,6 @@ static int eadm_subchannel_probe(struct subchannel *sch)
        spin_lock_irq(&list_lock);
        list_add(&private->head, &eadm_list);
        spin_unlock_irq(&list_lock);
-
-       if (dev_get_uevent_suppress(&sch->dev)) {
-               dev_set_uevent_suppress(&sch->dev, 0);
-               kobject_uevent(&sch->dev.kobj, KOBJ_ADD);
-       }
 out:
        return ret;
 }
index 0407427770955d1f9959d2cf75d26cb752f1252d..ee182cfb467d141695b7a90f6f1f1345d61823eb 100644 (file)
@@ -244,11 +244,6 @@ static int vfio_ccw_sch_probe(struct subchannel *sch)
        if (ret)
                goto out_disable;
 
-       if (dev_get_uevent_suppress(&sch->dev)) {
-               dev_set_uevent_suppress(&sch->dev, 0);
-               kobject_uevent(&sch->dev.kobj, KOBJ_ADD);
-       }
-
        VFIO_CCW_MSG_EVENT(4, "bound to subchannel %x.%x.%04x\n",
                           sch->schid.cssid, sch->schid.ssid,
                           sch->schid.sch_no);