Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp671485ybz; Fri, 1 May 2020 06:33:35 -0700 (PDT) X-Google-Smtp-Source: APiQypKZ3XQ0nYQJX5yP09f0G1dpK/+44a1OL76Kz8W79c6XYiVxWgnRFriP6l5R7mgxBszRxWqq X-Received: by 2002:a17:906:468c:: with SMTP id a12mr3256601ejr.149.1588340014890; Fri, 01 May 2020 06:33:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588340014; cv=none; d=google.com; s=arc-20160816; b=X4RfsNcB3IbNBfsGca1WLufQEmIW5WLDUsNfLD2GFdzuf1sfL5pugpjrPfwUcS9PHu b+/gvyuwJvpJEn3Bwf4aO8dWKC7pD8UC5pd7IZxu0WoHKA61IVM5gmpg+EgG8q5lwGJ/ Gv7yxIdO5oKI31mjqSydj6Io5YLeWaxWlxWrnnqXpsjgLWQO0E3aRfIyjyHC7UiXYaYi neKRZi7OdHFCbaUNlke6Guqb+MpFTvjUzGdRGZpnAxuZHwQkTyWhjGjLyloxjhZgNkdZ rp/kLTtBBXBGV9aBUUlHlNM/GS9UIPIJp5BCinuuJ5rA+xQF811gxDTL+QZf+49iu3zi 7sPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=H8OT6DsJHUKjla+dEsaPRFiQlZHTZnI8IHDIBICPTzs=; b=X22Ofon0FRlvbJRoFuigiR6+kyslDZaHvbBiK3wZHSTbYhjkHpG9/m9lGPHXtguJ7x XgvXCAfk5fgklu9cY+ZE6s7w/lbIWQ77/CKslT1XoeskN6PdBhj0b4yQTShtM5SRWvcw NqfyAb2PHAsOeosnmApDs/z649/DtjYOegmx1YzlwxgVyKcJ/7hYqcCHV9O7plPTi9/M u8VOmXDxygREmH4/pD1zx98zbjyF+r+Vd/e9a3qoFCpF7x1mZQj3kKOrVk2RJrYVAH1k 70uYvwpcMfwcGn1AtIpp5TGZOGmeDccOBpZWsnUPLW4zzo7MSbIWhJ6vDwkpbIdbHCot W2Kg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Z6BOEG5Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x17si2057549edi.378.2020.05.01.06.33.11; Fri, 01 May 2020 06:33:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Z6BOEG5Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729635AbgEAN2e (ORCPT + 99 others); Fri, 1 May 2020 09:28:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:51530 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729619AbgEAN21 (ORCPT ); Fri, 1 May 2020 09:28:27 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4E10A2166E; Fri, 1 May 2020 13:28:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1588339706; bh=klBkbq68mGyRT+2KtEwZLVT96VkD8jSmhCqVYrAke5I=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Z6BOEG5Q/1uhI2OyfmCdzScsJlhrlxEvcP3yLIRZBL1gWe46dWxPBLDRrBOcc5/uA xpzNqX/8QtTlcyOolsmjBq6m2DePUnGgOz4ABVMv9FhC6UTk22bQveEsNh9NooGT8m jUTEDwBaElk1VJxji4fn16srf+CwGHrMYRvRAZcc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Boris Fiuczynski , Peter Oberparleiter , Cornelia Huck , Vasily Gorbik , Sasha Levin Subject: [PATCH 4.9 16/80] s390/cio: avoid duplicated ADD uevents Date: Fri, 1 May 2020 15:21:10 +0200 Message-Id: <20200501131519.033209634@linuxfoundation.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200501131513.810761598@linuxfoundation.org> References: <20200501131513.810761598@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Cornelia Huck [ 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 Reviewed-by: Peter Oberparleiter Reviewed-by: Boris Fiuczynski Signed-off-by: Cornelia Huck Signed-off-by: Vasily Gorbik Signed-off-by: Sasha Levin --- 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