Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp258822imu; Tue, 27 Nov 2018 11:59:13 -0800 (PST) X-Google-Smtp-Source: AFSGD/XoDGWg7XlKjAf5YyiN8d3hEyP0w/2h1HkSn+pzQWME3NKnuN2Rn/Zg1xo1SJQB4FtuFlag X-Received: by 2002:a17:902:47aa:: with SMTP id r39mr11400794pld.219.1543348753936; Tue, 27 Nov 2018 11:59:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543348753; cv=none; d=google.com; s=arc-20160816; b=ew4XokI3/8UZyHXCEFuit3p2Thuy+tNVh3j9dSI9KirjyyhwyZqPPZsG9KTWbFIcdI GfZkf4FzRAbPO8z7dQf+nSENdptUs+EjQ2pVLcIgCK60me9XvP6CKQBsmBZWO2nmMucY 9LzBRf+/95UxGO3fYT8Nc7EpCAPCdNIjUGKUSTn0ZrbTfO0q8yHO22iUA0polcylNOkx qZ0C8RdEvd74nloURxJzIMjGh2Eozz6aoKpo1RFvKDHah/AG2IzBs3609di/0Vm56BPg qz7mU2gp3HcxzcrCwVzQhNKZ8jwEtLBd8UqDeBeHZch1phW7B4KWKTxSl0DYCSy+HxZB +2vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :content-id:content-language:accept-language:in-reply-to:references :message-id:date:thread-index:thread-topic:subject:cc:to:from :dkim-signature; bh=Od4A213TLQ3NhGU9HgRrDPyQ1IY8kxAUf1tTzfP3fmU=; b=NG3bETGFVUySUCKI5lr0I3nx3zl+NUIRVoHNlx55KGT83Aw9HmO3I5xdoJ+Icht8nW oTcjJzSXnVQISyaoAgPPlVq8F1kOpiWyDXpqlaOW+BQIpYmLE1N40quY8JhhYQIkZEex Blq6BYIRpRdLQpuV2eWdTV6fjZd/h1WGBt8B8vKhaIo2RlDpYcfyK52bz88VG7KK7Y+1 VIIr0wO203Ifnpn5q0yCh7qx44yekC1C/0g8ExMPOX1dHcr9z5PW+XVDVMoT+d63y50e cxmqSSnuXGQLiNNd/IJqVm62wfBNZkGFMCBNXznxxjYg/yrttoLtdVO3F6ryBqvKYQn/ z4tg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alliedtelesis.co.nz header.s=mail181024 header.b=hzNMbkAc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alliedtelesis.co.nz Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s17si4537377pgi.513.2018.11.27.11.58.58; Tue, 27 Nov 2018 11:59:13 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@alliedtelesis.co.nz header.s=mail181024 header.b=hzNMbkAc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alliedtelesis.co.nz Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726559AbeK1G5W (ORCPT + 99 others); Wed, 28 Nov 2018 01:57:22 -0500 Received: from gate2.alliedtelesis.co.nz ([202.36.163.20]:45052 "EHLO gate2.alliedtelesis.co.nz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726288AbeK1G5U (ORCPT ); Wed, 28 Nov 2018 01:57:20 -0500 Received: from mmarshal3.atlnz.lc (mmarshal3.atlnz.lc [10.32.18.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by gate2.alliedtelesis.co.nz (Postfix) with ESMTPS id 6F39D8365A for ; Wed, 28 Nov 2018 08:58:18 +1300 (NZDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alliedtelesis.co.nz; s=mail181024; t=1543348698; bh=Od4A213TLQ3NhGU9HgRrDPyQ1IY8kxAUf1tTzfP3fmU=; h=From:To:CC:Subject:Date:References:In-Reply-To; b=hzNMbkAc81lBAjmsuGpngun67cHNHPpsDuPAdDCDqOmVaap64j3I77j1ACcssAe0s TyLSJPR5Oem5Vay/4ka2khrFKv3TSUhIkZpOTKFX5dTNpfjcd75fR5ZZzdYxQLBbgZ w2s9L8l3sf5x9jkQHYGRiXaGiAXMpNgXkQUMqUgJO6TptLJWvRad50oo/9rwpyKokW bDzWbRaf4u4UKXBcD0rpx1BUlu/YY2ug3kLWejBQJcW5BS+iRjNVjt8N59uAB9fCWQ Srf9Ag6IGZUNkkR29B25zlshrct/FcF2BGtkehUkFepDuM19kz2mR4iV51JK2UhA1P c5GqsOdDQSwcQ== Received: from svr-chch-ex1.atlnz.lc (Not Verified[10.32.16.77]) by mmarshal3.atlnz.lc with Trustwave SEG (v7,5,8,10121) id ; Wed, 28 Nov 2018 08:58:17 +1300 Received: from svr-chch-ex1.atlnz.lc (2001:df5:b000:bc8:409d:36f5:8899:92e8) by svr-chch-ex1.atlnz.lc (2001:df5:b000:bc8:409d:36f5:8899:92e8) with Microsoft SMTP Server (TLS) id 15.0.1156.6; Wed, 28 Nov 2018 08:58:18 +1300 Received: from svr-chch-ex1.atlnz.lc ([fe80::409d:36f5:8899:92e8]) by svr-chch-ex1.atlnz.lc ([fe80::409d:36f5:8899:92e8%12]) with mapi id 15.00.1156.000; Wed, 28 Nov 2018 08:58:18 +1300 From: Mark Tomlinson To: Greg KH CC: "linux-kernel@vger.kernel.org" Subject: Re: [PATCH RESEND] tty/sysrq: Do not call sync directly from sysrq_do_reset() Thread-Topic: [PATCH RESEND] tty/sysrq: Do not call sync directly from sysrq_do_reset() Thread-Index: AQHUhcqxsQOYM6dIbkaK+PjfzFnZzKVijaSAgACj7IA= Date: Tue, 27 Nov 2018 19:58:17 +0000 Message-ID: <6d069b48-da59-911b-19cc-cc24d3136c48@alliedtelesis.co.nz> References: <20181126205723.14478-1-mark.tomlinson@alliedtelesis.co.nz> <20181127101135.GA15856@kroah.com> In-Reply-To: <20181127101135.GA15856@kroah.com> Accept-Language: en-NZ, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-messagesentrepresentingtype: 1 x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.32.16.78] Content-Type: text/plain; charset="Windows-1252" Content-ID: <3E2C62F5D2440C419F1EED802E708020@atlnz.lc> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 27/11/18 11:11 PM, Greg KH wrote: > On Tue, Nov 27, 2018 at 09:57:23AM +1300, Mark Tomlinson wrote: >> sysrq_do_reset() is called in softirq context, so it cannot call >> sync() directly. Instead, call orderly_reboot(), which creates a work >> item to run /sbin/reboot, or do emergency_sync and restart if the >> command fails. >> >> Signed-off-by: Mark Tomlinson >> --- >> drivers/tty/sysrq.c | 3 +-- >> 1 file changed, 1 insertion(+), 2 deletions(-) >> >> diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c >> index ad1ee5d01b53..f2ca32c1ad7c 100644 >> --- a/drivers/tty/sysrq.c >> +++ b/drivers/tty/sysrq.c >> @@ -660,8 +660,7 @@ static void sysrq_do_reset(struct timer_list *t) >> =20 >> state->reset_requested =3D true; >> =20 >> - ksys_sync(); >> - kernel_restart(NULL); >> + orderly_reboot(); >=20 > Is this something new? Why haven't we had reports of this failing in > the past? Or has something changed recently to cause this to now be > needed? >=20 > thanks, >=20 > greg k-h >=20 As far as I can tell, sysrq_do_reset() is only used when setting the=20 "keyset" property in "/chosen/linux,sysrq-reset-seq" (which is what I=20 want to do). No DTS file in the kernel tree sets this, so I don't know=20 if anyone else is using this. I am wondering whether it ever worked. A=20 reboot does occur after a kernel panic, so if the console is not=20 available, it may appear to have worked. Pressing the standard 'sysrq' key followed by 'b'(reboot) instead calls=20 sysrq_handle_reboot(), which does not call sync at all, but=20 emergency_restart(). Also, the 's'(sync) key calls emergency_sync(),=20 which performs the sync via a work queue.=