From nobody Wed Nov 27 04:38:18 2024 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AA69D84A2F; Mon, 14 Oct 2024 05:50:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728885029; cv=none; b=nwakcY3ix+L8z0TCRp+HOFHpBkAPRIzAM94uFLrpRdKwUrI3x1ZduXFp5jbzLMz71wFLkwEo49EMcbNhLsNjdb+2g4N3B1Heravt8lsMDUELGAUWQorGSwSHsk3vin5OFfp+6u2yqcxRYq+sUDZ3XtX/qwfvdXigsgjuCwf/z6Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728885029; c=relaxed/simple; bh=g34NTi7BBFOiMr07nkao8FQYjEaAA2Lpy9px4Le9YSs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=e+Pm8CbNtzh13g1Hy+cYZY5KfyUZ8dwmbK4NGpP7XYlaZY6bRWB2uzPuAGAShMeK7N89eNFpVmA4w1sQgMm1mHBroAeoqDCRMkiBbJM4N9Hg7pVTYXDDBvriFolmiTGJRzKW52rP+ASTPCSU8SZKp82j5K/bMbV5cHPxs6soPCg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=ngnQux4b; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=XYvk6PS6; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="ngnQux4b"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="XYvk6PS6" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1728885025; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bVR1HXOpKM8GhGNQSQfDyXEpXah9awzsBuZahyVEE2A=; b=ngnQux4b3Ppr5x1KEZezYl2Ezhl5M5ySDeAzvcwqfPZmj8/PUl+y2w4/7A4KrdT8x4rXM0 69/pVbAMfxniQhrLgQOwnAXEttkcpGDTBE0FRi0BQUuu+BxaU5Gw+PWcauhxDhHAbUP3YL SVdrAlGmy9DzKtPTH5Rz6bAcY0hZv+jaFClvXu6aYbMm0+dnPb2lS5jbpBTsVtRap/lswK az+SbMBwuBxwlhoE9BrhImFkFeJyfY6xaKdFtgO2P+/7MWLBl6YhnbJwizo3fzVePFOv3g yMDMN5P9us40U5HTa6fJaFt9nfoaBmZPEZiD2YtcsmDyEfvE33fVnLNQM4xKMw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1728885025; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=bVR1HXOpKM8GhGNQSQfDyXEpXah9awzsBuZahyVEE2A=; b=XYvk6PS64lVx1onEiUXi8jqZJK+RtRiqp7Jp6mbLoPdoPUrqyn3LjmT56MmbC0Ephk5xpW 69RnOmiW0hQZClAQ== Date: Mon, 14 Oct 2024 07:50:06 +0200 Subject: [PATCH 1/2] s390/sclp: deactivate sclp after all its users Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241014-s390-kunit-v1-1-941defa765a6@linutronix.de> References: <20241014-s390-kunit-v1-0-941defa765a6@linutronix.de> In-Reply-To: <20241014-s390-kunit-v1-0-941defa765a6@linutronix.de> To: Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , "Guilherme G. Piccoli" Cc: linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= , stable@vger.kernel.org X-Developer-Signature: v=1; a=ed25519-sha256; t=1728885023; l=1299; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=g34NTi7BBFOiMr07nkao8FQYjEaAA2Lpy9px4Le9YSs=; b=zas6keCWN0kU6LW6lBcmnH4oLgegs3QdVQK9ceFA0wmgKQJpzQxAFVqPjFKaxPvbFNoG5rPtS UblB7aXXWzrBt/yTmR+Nkmnc1YWd/AwXZfgGA0IogWrIt3syQYaaQRb X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= On reboot the SCLP interface is deactivated through a reboot notifier. This happens before other components using SCLP have the chance to run their own reboot notifiers. Two of those components are the SCLP console and tty drivers which try to flush the last outstanding messages. At that point the SCLP interface is already unusable and the messages are discarded. Execute sclp_deactivate() as late as possible to avoid this issue. Fixes: 4ae46db99cd8 ("s390/consoles: improve panic notifiers reliability") Cc: stable@vger.kernel.org Signed-off-by: Thomas Wei=C3=9Fschuh Reviewed-by: Sven Schnelle --- drivers/s390/char/sclp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/s390/char/sclp.c b/drivers/s390/char/sclp.c index f3621adbd5debc59d2b71fc1be2790e0cbd31f76..fbffd451031fdb526d9b802da50= df7f3eba5c48e 100644 --- a/drivers/s390/char/sclp.c +++ b/drivers/s390/char/sclp.c @@ -1195,7 +1195,8 @@ sclp_reboot_event(struct notifier_block *this, unsign= ed long event, void *ptr) } =20 static struct notifier_block sclp_reboot_notifier =3D { - .notifier_call =3D sclp_reboot_event + .notifier_call =3D sclp_reboot_event, + .priority =3D INT_MIN, }; =20 static ssize_t con_pages_show(struct device_driver *dev, char *buf) --=20 2.47.0 From nobody Wed Nov 27 04:38:18 2024 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4D70612CD96; Mon, 14 Oct 2024 05:50:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728885030; cv=none; b=LYk63/hH2u6MlDGAJ3HbeKxLISumYYNfLC3wjF/zgIHDOSZVUOzjrRtvqzeXLiVaBDBTWyUKGeOnILc48GLCEDeOfze67AsW1blBNJYcBK8kkw673aI9Qw2kAbT42Muun++/hxOhXGP059jNyhekU19wKQSvUyaEIjWhRDNIxy0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728885030; c=relaxed/simple; bh=Dyt5MhyhGO3SmoG98QeDPkLBBgT90CECW97RdNnY04o=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=pIWFkUo8lo5ckzX4CaAaLTwy314Q8bjN2BePPF2bqk+zdt6TGmoZIKsEMnkH0RHmSWvRY3XIi/q4U6N4AtQtDlFjVsbvz7ZW9nWkygHzsqmZ1qdanIgPj4vd9TldWY/kqCfH2/ITDG5xal/7ypx6ZZ2Sa+WdJ+px78XWxT8tUNA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=LKbf2Vbe; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=eviwaudt; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="LKbf2Vbe"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="eviwaudt" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1728885026; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+Wki/ePTip/6Lw7Wb59eoC1rHv1cVXfkYZvGNooR6cA=; b=LKbf2VbeKd7Xb7KITtZuTctd97tWcKc6xD1vhLNT3JxZPZt2bG5N9jSGS98rtdEruMYImn wKVmy2uxIRY5oLcBg+jG45p5Znf3KFoIlB/BTqCkWIBzykp0rrHxdFDrSrUcdCt68H5VKF VfPUuOHJmW7wYh7rTmumtokFULNklxWKO9cwkh9rZGncCYKhjIcKWUGZYQKwy2lR9Dup6S wVCNtZ75GSgXaYkHFyb6d9OrAC7I0o1RkcIqQD1Q+r3dYEUjGf22FpfE67i4E05OA9sdaL uO/G0GdoTR5fhgdmIX6ql+M+f8kUOpnTzHmk/GedPaMG9EPH7oO6KvMVYJYT+Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1728885026; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=+Wki/ePTip/6Lw7Wb59eoC1rHv1cVXfkYZvGNooR6cA=; b=eviwaudtk9ZGiCKUt0q+vKCPbQuetfuWPjrfwerBnM8hNh6ftIaEd/yD3CxxhajxLdYsSw jhcKnrXwgCn6yWBg== Date: Mon, 14 Oct 2024 07:50:07 +0200 Subject: [PATCH 2/2] s390/sclp_vt220: convert newlines to CRLF instead of LFCR Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20241014-s390-kunit-v1-2-941defa765a6@linutronix.de> References: <20241014-s390-kunit-v1-0-941defa765a6@linutronix.de> In-Reply-To: <20241014-s390-kunit-v1-0-941defa765a6@linutronix.de> To: Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , "Guilherme G. Piccoli" Cc: linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, =?utf-8?q?Thomas_Wei=C3=9Fschuh?= , stable@vger.kernel.org X-Developer-Signature: v=1; a=ed25519-sha256; t=1728885023; l=1942; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=Dyt5MhyhGO3SmoG98QeDPkLBBgT90CECW97RdNnY04o=; b=dReodt8GrF5+C/WpiDGzIM9YCn8UUHcNnZP1tfgHw1+H/BVQ1+3pLLrCJqslX0F3CqVOC1T+i NNX1puWNbrDAYT7ZXj4ujjrm55pLSMgYiAwsFQ6VxXvaOK16VDvv3XJ X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= According to the VT220 specification the possible character combinations sent on RETURN are only CR or CRLF [0]. The Return key sends either a CR character (0/13) or a CR character (0/13) and an LF character (0/10), depending on the set/reset state of line feed/new line mode (LNM). The sclip/vt220 driver however uses LFCR. This can confuse tools, for example the kunit runner. Link: https://vt100.net/docs/vt220-rm/chapter3.html#S3.2 Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2") Cc: stable@vger.kernel.org Signed-off-by: Thomas Wei=C3=9Fschuh Reviewed-by: Sven Schnelle --- I'm not entirely sure that SCLP is meant to follow the VT220 standard here. The only other reference observation I found is the QEMU code and they are doing "what Linux does". It would also be possible to hack around this in the kunit runner. --- drivers/s390/char/sclp_vt220.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/s390/char/sclp_vt220.c b/drivers/s390/char/sclp_vt220.c index 218ae604f737ff9e20764ebce857ce427e4a7c44..33b9c968dbcba6584015d70a850= 0f9f5f70227db 100644 --- a/drivers/s390/char/sclp_vt220.c +++ b/drivers/s390/char/sclp_vt220.c @@ -319,7 +319,7 @@ sclp_vt220_add_msg(struct sclp_vt220_request *request, buffer =3D (void *) ((addr_t) sccb + sccb->header.length); =20 if (convertlf) { - /* Perform Linefeed conversion (0x0a -> 0x0a 0x0d)*/ + /* Perform Linefeed conversion (0x0a -> 0x0d 0x0a)*/ for (from=3D0, to=3D0; (from < count) && (to < sclp_vt220_space_left(request)); from++) { @@ -328,8 +328,8 @@ sclp_vt220_add_msg(struct sclp_vt220_request *request, /* Perform conversion */ if (c =3D=3D 0x0a) { if (to + 1 < sclp_vt220_space_left(request)) { - ((unsigned char *) buffer)[to++] =3D c; ((unsigned char *) buffer)[to++] =3D 0x0d; + ((unsigned char *) buffer)[to++] =3D c; } else break; =20 --=20 2.47.0