From patchwork Tue Nov 13 23:10:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mark Tomlinson X-Patchwork-Id: 10681589 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B6E8C109C for ; Tue, 13 Nov 2018 23:10:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A954C2B253 for ; Tue, 13 Nov 2018 23:10:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9D4322B1FC; Tue, 13 Nov 2018 23:10:50 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BF57B2B1C3 for ; Tue, 13 Nov 2018 23:10:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726950AbeKNJLP (ORCPT ); Wed, 14 Nov 2018 04:11:15 -0500 Received: from gate2.alliedtelesis.co.nz ([202.36.163.20]:51933 "EHLO gate2.alliedtelesis.co.nz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726022AbeKNJLP (ORCPT ); Wed, 14 Nov 2018 04:11:15 -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 1204C8066C; Wed, 14 Nov 2018 12:10:45 +1300 (NZDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alliedtelesis.co.nz; s=mail181024; t=1542150645; bh=0jm/hZ1WFiLHqj1+94TDFhUq+ykd2NHVqnX2tCsJrUk=; h=From:To:Cc:Subject:Date; b=lMO9t4N4v0CJVQUuVNJp11fK3nw1MY1dvIqoqZQSYIpqZo3GRp+CzhxCoBuQ7LFfE hJB/d39333vkO9IZaMefVFiWSfDyzFrGzbADmJerueor2sO7NN48CdENs/TtRsODnz qs8+MCxOvoLZLx6ofbiFwQFg8DGxvJDR94Gnqf7pVthEmdgMwkzIIG0BYeriD3DLBJ eLbRu/pmkTyyH0aGOD4m074dajI2Ja1KQbUuCt/bCRqMnYSN6BtEsE0f3PduwrIVJO 0QV/5QzxbXxiYuQnIQpJdCvQFRWicLWwHEW4yQ24dKImQmDYWodaeyemrVHqrlymzv jdgg6vR92ntTA== Received: from smtp (Not Verified[10.32.16.33]) by mmarshal3.atlnz.lc with Trustwave SEG (v7,5,8,10121) id ; Wed, 14 Nov 2018 12:10:44 +1300 Received: from markto-dl.ws.atlnz.lc (markto-dl.ws.atlnz.lc [10.33.23.31]) by smtp (Postfix) with ESMTP id CD82113ED56; Wed, 14 Nov 2018 12:10:49 +1300 (NZDT) Received: by markto-dl.ws.atlnz.lc (Postfix, from userid 1155) id 91A66604AA; Wed, 14 Nov 2018 12:10:44 +1300 (NZDT) From: Mark Tomlinson To: linux-input@vger.kernel.org Cc: gregkh@linuxfoundation.org, Mark Tomlinson Subject: [PATCH] tty/sysrq: Do not call sync directly from sysrq_do_reset() Date: Wed, 14 Nov 2018 12:10:12 +1300 Message-Id: <20181113231012.14184-1-mark.tomlinson@alliedtelesis.co.nz> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 x-atlnz-ls: pat Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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) state->reset_requested = true; - ksys_sync(); - kernel_restart(NULL); + orderly_reboot(); } static void sysrq_handle_reset_request(struct sysrq_state *state)