Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp431731imu; Mon, 26 Nov 2018 12:58:56 -0800 (PST) X-Google-Smtp-Source: AFSGD/UBMHMD1YmfuaH76kVYPPZRT3WJtQC13v9bxOuORYpGBinbwo62izyjhbeZMWAmwqdmj7ZO X-Received: by 2002:a17:902:b20e:: with SMTP id t14mr18950923plr.128.1543265936356; Mon, 26 Nov 2018 12:58:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543265936; cv=none; d=google.com; s=arc-20160816; b=ptE8mved4XgkZwt1OEJIhyrgZNcxtDoa1AyRY0ivwB+zDvAQ79ofNDM7B1UtsJJ6xx RoCmpS7ISQAwgysfE1Fef9pZOnfHU6PwPCNcmRHBvb/etly2fl4aWpewKU8nEw7VpkCM cFh/C1dc9+yrDU1f/5zJ1XB4vpH4q6Db6T36i4rz295oyLxaslMBLNAITdLVyfHZ4S1m WhbI/zhWwy364azk6Jepg8Co23J2HvYy6+A8iK3FNYgx29SB1WtBJ/lbuxj32T3/oEW4 eE3NCZW4yFv8qAUOlatyzt9g37aQ0btEnvHKqWb2PHTFo+9mB9R5JGkNfdA0dva2gY5P yoow== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=7SVxkwO39Zx6kpU0je3dtu+C3sldZhdQX6fdfmltJuo=; b=E2WDwN81E/QVq6C9jpzT78b1f4Rhl2qd1UheVOkUP7EPPz0Gf5RbVY6U3PA3GsLpAF ablharUQ0MJbVycGe0Fk7v+d9dD6naTHDKznhagiQIqXsUwFUN/YJqiy3q58gz7M2H8l TFosdoouOqrU1jToHPjVA9La/KgyRkreRx3G2NmyC6wZP9+smbCgtOez3P/nCQHMJN/U m46RpI12QSNjsi7rzdrLO22ayn8uL1Yg/KTTv1Z572SnFA9WJuh7y8nDp0AW54Mvm0v3 ctxXp6VHQscj4X0hL8sgOmnW3gdylPBF3IRkeo5XuNAO/p/x0siO/tnEIL4h8fBn+z2W ZG3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alliedtelesis.co.nz header.s=mail181024 header.b=ZvR726vz; 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 r18si1310090pgb.491.2018.11.26.12.58.39; Mon, 26 Nov 2018 12:58:55 -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=ZvR726vz; 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 S1727350AbeK0HxP (ORCPT + 99 others); Tue, 27 Nov 2018 02:53:15 -0500 Received: from gate2.alliedtelesis.co.nz ([202.36.163.20]:42996 "EHLO gate2.alliedtelesis.co.nz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727105AbeK0HxO (ORCPT ); Tue, 27 Nov 2018 02:53:14 -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 4FA038365B; Tue, 27 Nov 2018 09:57:50 +1300 (NZDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alliedtelesis.co.nz; s=mail181024; t=1543265870; bh=7SVxkwO39Zx6kpU0je3dtu+C3sldZhdQX6fdfmltJuo=; h=From:To:Cc:Subject:Date; b=ZvR726vzcaPee0RxUzC+ngleMtiQZ0vuXxwewP/cwtrDM/0AtTJChGHz/RGo0TrKW tx6g4vpHQ0QI4eZVou7V79PZUPwiZ+6I0rkqsm7NjwnqS2jENv5NIpG5h4/WEbyyEx BCO9n3GmF6yPBoNJZx2AJp699vEpY8qvTDfOvN+U5a03QRc/TEUD2cIyyjFlaS7Ulb s0Cx29re9t5+5fFPFJzciD389ifQuMEf4gZiZnSixZoVWwn4Der3JBWmsitCO3kZTm x6PO3saVOJZzbeVKwjQeJuBQbie8603LZUi5fWdlp0QkfWlYqZ4REaRLlBDEVNAOuS MAih65EFD+9hw== Received: from smtp (Not Verified[10.32.16.33]) by mmarshal3.atlnz.lc with Trustwave SEG (v7,5,8,10121) id ; Tue, 27 Nov 2018 09:57:49 +1300 Received: from markto-dl.ws.atlnz.lc (markto-dl.ws.atlnz.lc [10.33.23.31]) by smtp (Postfix) with ESMTP id 61E4713EEC9; Tue, 27 Nov 2018 09:57:55 +1300 (NZDT) Received: by markto-dl.ws.atlnz.lc (Postfix, from userid 1155) id DA255606DD; Tue, 27 Nov 2018 09:57:49 +1300 (NZDT) From: Mark Tomlinson To: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org Cc: Mark Tomlinson Subject: [PATCH RESEND] tty/sysrq: Do not call sync directly from sysrq_do_reset() Date: Tue, 27 Nov 2018 09:57:23 +1300 Message-Id: <20181126205723.14478-1-mark.tomlinson@alliedtelesis.co.nz> X-Mailer: git-send-email 2.19.2 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable x-atlnz-ls: pat Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- =20drivers/tty/sysrq.c | 3 +-- =201 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 =20 state->reset_requested =3D true; =20 - ksys_sync(); - kernel_restart(NULL); + orderly_reboot(); =20} =20 =20static void sysrq_handle_reset_request(struct sysrq_state *state) --=20 2.19.2