linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sasha Levin <sashal@kernel.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Cornelia Huck <cohuck@redhat.com>,
	Boris Fiuczynski <fiuczy@linux.ibm.com>,
	Peter Oberparleiter <oberpar@linux.ibm.com>,
	Vasily Gorbik <gor@linux.ibm.com>,
	Sasha Levin <sashal@kernel.org>,
	linux-s390@vger.kernel.org
Subject: [PATCH AUTOSEL 4.9 13/23] s390/cio: avoid duplicated 'ADD' uevents
Date: Sat, 18 Apr 2020 10:43:55 -0400	[thread overview]
Message-ID: <20200418144405.10565-13-sashal@kernel.org> (raw)
In-Reply-To: <20200418144405.10565-1-sashal@kernel.org>

From: Cornelia Huck <cohuck@redhat.com>

[ Upstream commit 05ce3e53f375295c2940390b2b429e506e07655c ]

The common I/O layer delays the ADD uevent for subchannels and
delegates generating this uevent to the individual subchannel
drivers. The io_subchannel driver will do so when the associated
ccw_device has been registered -- but unconditionally, so more
ADD uevents will be generated if a subchannel has been unbound
from the io_subchannel driver and later rebound.

To fix this, only generate the ADD event if uevents were still
suppressed for the device.

Fixes: fa1a8c23eb7d ("s390: cio: Delay uevents for subchannels")
Message-Id: <20200327124503.9794-2-cohuck@redhat.com>
Reported-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Reviewed-by: Peter Oberparleiter <oberpar@linux.ibm.com>
Reviewed-by: Boris Fiuczynski <fiuczy@linux.ibm.com>
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/s390/cio/device.c | 13 +++++++++----
 1 file changed, 9 insertions(+), 4 deletions(-)

diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c
index 6a58bc8f46e2a..1e97d1a034675 100644
--- a/drivers/s390/cio/device.c
+++ b/drivers/s390/cio/device.c
@@ -868,8 +868,10 @@ static void io_subchannel_register(struct ccw_device *cdev)
 	 * Now we know this subchannel will stay, we can throw
 	 * our delayed uevent.
 	 */
-	dev_set_uevent_suppress(&sch->dev, 0);
-	kobject_uevent(&sch->dev.kobj, KOBJ_ADD);
+	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 = ccw_device_add(cdev);
 	if (ret) {
@@ -1077,8 +1079,11 @@ static int io_subchannel_probe(struct subchannel *sch)
 		 * Throw the delayed uevent for the subchannel, register
 		 * the ccw_device and exit.
 		 */
-		dev_set_uevent_suppress(&sch->dev, 0);
-		kobject_uevent(&sch->dev.kobj, KOBJ_ADD);
+		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);
+		}
 		cdev = sch_get_cdev(sch);
 		rc = ccw_device_add(cdev);
 		if (rc) {
-- 
2.20.1


  parent reply	other threads:[~2020-04-18 14:44 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-18 14:43 [PATCH AUTOSEL 4.9 01/23] iommu/amd: Fix the configuration of GCR3 table root pointer Sasha Levin
2020-04-18 14:43 ` [PATCH AUTOSEL 4.9 02/23] watchdog: reset last_hw_keepalive time at start Sasha Levin
2020-04-18 14:43 ` [PATCH AUTOSEL 4.9 03/23] scsi: lpfc: Fix kasan slab-out-of-bounds error in lpfc_unreg_login Sasha Levin
2020-04-18 14:43 ` [PATCH AUTOSEL 4.9 04/23] ceph: return ceph_mdsc_do_request() errors from __get_parent() Sasha Levin
2020-04-18 14:43 ` [PATCH AUTOSEL 4.9 05/23] ceph: don't skip updating wanted caps when cap is stale Sasha Levin
2020-04-18 14:43 ` [PATCH AUTOSEL 4.9 06/23] pwm: rcar: Fix late Runtime PM enablement Sasha Levin
2020-04-18 14:43 ` [PATCH AUTOSEL 4.9 07/23] ASoC: dpcm: allow start or stop during pause for backend Sasha Levin
2020-04-18 14:43 ` [PATCH AUTOSEL 4.9 08/23] scsi: iscsi: Report unbind session event when the target has been removed Sasha Levin
2020-04-18 14:43 ` [PATCH AUTOSEL 4.9 09/23] ASoC: Intel: atom: Take the drv->lock mutex before calling sst_send_slot_map() Sasha Levin
2020-04-18 14:43 ` [PATCH AUTOSEL 4.9 10/23] kernel/gcov/fs.c: gcov_seq_next() should increase position index Sasha Levin
2020-04-18 14:43 ` [PATCH AUTOSEL 4.9 11/23] ipc/util.c: sysvipc_find_ipc() " Sasha Levin
2020-04-18 14:43 ` [PATCH AUTOSEL 4.9 12/23] KVM: s390: vsie: Fix possible race when shadowing region 3 tables Sasha Levin
2020-04-18 14:43 ` Sasha Levin [this message]
2020-04-18 14:43 ` [PATCH AUTOSEL 4.9 14/23] pwm: renesas-tpu: Fix late Runtime PM enablement Sasha Levin
2020-04-18 14:43 ` [PATCH AUTOSEL 4.9 15/23] pwm: bcm2835: Dynamically allocate base Sasha Levin
2020-04-18 14:43 ` [PATCH AUTOSEL 4.9 16/23] iommu/vt-d: Silence RCU-list debugging warning in dmar_find_atsr() Sasha Levin
2020-04-18 14:43 ` [PATCH AUTOSEL 4.9 17/23] libnvdimm: Out of bounds read in __nd_ioctl() Sasha Levin
2020-04-18 14:44 ` [PATCH AUTOSEL 4.9 18/23] ocfs2: no need try to truncate file beyond i_size Sasha Levin
2020-04-18 14:44 ` [PATCH AUTOSEL 4.9 19/23] hfsplus: fix crash and filesystem corruption when deleting files Sasha Levin
2020-04-18 14:44 ` [PATCH AUTOSEL 4.9 20/23] libata: Return correct status in sata_pmp_eh_recover_pm() when ATA_DFLAG_DETACH is set Sasha Levin
2020-04-18 14:44 ` [PATCH AUTOSEL 4.9 21/23] ALSA: ice1724: Fix invalid access for enumerated ctl items Sasha Levin
2020-04-18 14:44 ` [PATCH AUTOSEL 4.9 22/23] ALSA: hda: Fix potential access overflow in beep helper Sasha Levin
2020-04-18 14:44 ` [PATCH AUTOSEL 4.9 23/23] KVM: s390: vsie: Fix delivery of addressing exceptions Sasha Levin

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=20200418144405.10565-13-sashal@kernel.org \
    --to=sashal@kernel.org \
    --cc=cohuck@redhat.com \
    --cc=fiuczy@linux.ibm.com \
    --cc=gor@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=oberpar@linux.ibm.com \
    --cc=stable@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).