Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp1338277imm; Tue, 5 Jun 2018 12:56:14 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKszKrdRg7+hGYxhoA5zqOEzlhA3sGRqgHbx96LAiliNCr8niMtDLxmp120k/XwBgNm3VI8 X-Received: by 2002:a63:7b4e:: with SMTP id k14-v6mr15140pgn.261.1528228574583; Tue, 05 Jun 2018 12:56:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528228574; cv=none; d=google.com; s=arc-20160816; b=qTC7ewSRp3J7MIXxfcvkEQGOyz5ZyZU1i089GSgRJQUeLT4lMGKcjJqG+MYstjNN67 Nu0m6y1oe6bHA462rKHyvwmDUiPQoxQIW/9oPpySGz7QfMrrD0JyiJGfWnak+AR9M4VR rNQxgqpjnRw90oz9BqDzXWj2IifKd/5hmKPpDHHjy0+ufihuJw/QdmUm/wGrmIu2Yj7I y5MTknrH+sH6ehTPM8oGJbHEyvP7Nx8ZCa/qkWXzrkGIhi9Upg0UfjaVyrdGPPN2Y7uX Q3UJXEaPZ3v/0B79gDb03KYRIxyGLmtbX9H3lRiusCcJqOFwD+0QOQEqsVESksCwkXjH AW7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=IR1+YXM1J7DqTFf1NqZ1apS7ftPcxZG30+1Ssl657kY=; b=uitYTXHU7g5CBhi17kvm6q7gWwDuAh/Hkwr3VoVi7JGqnTF7gSqL2V8gFBy5lTmacr TvtRMlR2pNjRyLEgi+ELm3IPEzoUSJlGlQMeUfPUskRzFpwsHiZ6zal81w8aWtvvTX32 D5nvHNv/RY/7odCBbd5F21qqs7rr5wcbPd/adbpLzjQLjhA7mFgU88QVlcbipU5/1J3W SbsQH++tNCcUEP2/knjcLEFyRBhXNGk9vAbB0ImFA9FJP8scQz4fQ70kQzD+2ruwjDI3 z430QXJaq42DEdbuJbNXo+Om/oFrWjSNUc5H/X1S/YeU6O4cj2wA86vxr1vjm+70oxrT OrEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=gORaq24F; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n8-v6si10685216pgr.437.2018.06.05.12.56.00; Tue, 05 Jun 2018 12:56:14 -0700 (PDT) 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=@linaro.org header.s=google header.b=gORaq24F; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752452AbeFETzT (ORCPT + 99 others); Tue, 5 Jun 2018 15:55:19 -0400 Received: from mail-io0-f194.google.com ([209.85.223.194]:32843 "EHLO mail-io0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752298AbeFETzR (ORCPT ); Tue, 5 Jun 2018 15:55:17 -0400 Received: by mail-io0-f194.google.com with SMTP id d185-v6so4863559ioe.0 for ; Tue, 05 Jun 2018 12:55:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=IR1+YXM1J7DqTFf1NqZ1apS7ftPcxZG30+1Ssl657kY=; b=gORaq24FjvxySbOVVUtDRPqUbDzHtTNUVX0seT7jekLA8iZOEuGuF6BuVnWkmnelHJ IXU7IjBeTYqCsmpLKPH6l6JUDmRB2Fq4r/r45pmXhcQTGNWh/zPljteUYBV17K0PRu/X 0x05/h8HFU9E06rEIrdbdQd0WcE0wLAvEG05A= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=IR1+YXM1J7DqTFf1NqZ1apS7ftPcxZG30+1Ssl657kY=; b=puLihj4wcW/Yc1mIoFM/jrDg/PNy9XRFzVQm9Zvq9rDD2dCM1i9y3Q8mV1OUepiK+l 5dQFnrrmvKANbzmKBdJsQSicbgw/I04TWvfLtNGp8+6kjA1nRzcosC1dSDKWNtGrUk/o q76rbI1qIZLvqRdy91lndwY4zdduNiBeKXNfjUsvITV1/Qvt0mQTV507g6jju/ly90iG pP/utI5HoK/xExMxAHh66Ozwb9DjqYjLB4bTRXyaNlhnfmtERosqKalo8poaxO7BLvWI nTHc4Cu8uCxyawRDGA5mMMTfDsQnPKOL5DXXND9JMTdZEnuE6uDe8/Ye4epo+/aGzf6j dcAA== X-Gm-Message-State: APt69E0gQ+QbN/PPG7xE4Xz7M10wqmmd/sAJwYQUDu1gfry2dLf17nOD Jn0qZEVc+aDg9hrER7b/SAxuHHfbHSNjoXb4lMGkUA== X-Received: by 2002:a6b:6709:: with SMTP id b9-v6mr54463ioc.170.1528228517097; Tue, 05 Jun 2018 12:55:17 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a6b:bb86:0:0:0:0:0 with HTTP; Tue, 5 Jun 2018 12:55:16 -0700 (PDT) In-Reply-To: References: <1527560464-19466-1-git-send-email-sai.praneeth.prakhya@intel.com> <1527560464-19466-4-git-send-email-sai.praneeth.prakhya@intel.com> From: Ard Biesheuvel Date: Tue, 5 Jun 2018 21:55:16 +0200 Message-ID: Subject: Re: [PATCH V5 3/3] efi: Use efi_rts_wq to invoke EFI Runtime Services To: "Prakhya, Sai Praneeth" Cc: linux-efi , Linux Kernel Mailing List , Lee Chun-Yi , Borislav Petkov , "Luck, Tony" , Will Deacon , "Hansen, Dave" , Mark Rutland , Bhupesh Sharma , Naresh Bhat , "Neri, Ricardo" , Peter Zijlstra , "Shankar, Ravi V" , Matt Fleming , "Williams, Dan J" , Miguel Ojeda Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5 June 2018 at 21:29, Prakhya, Sai Praneeth wrote: >> > + case RESET_SYSTEM: >> > + __efi_call_virt(reset_system, *(int *)arg1, >> > + *(efi_status_t *)arg2, >> > + *(unsigned long *)arg3, >> > + (efi_char16_t *)arg4); >> > + break; >> >> I noticed that -unsurprisingly- reboot no longer works with these changes. >> >> I will fix up the patch, and revert the efi_reset_system() change, both here and >> below. > > Could you please let me know what the bug is here? I am unable to see it right away :( > I have tested reboot on qemu x86_64 by passing "reboot=efi" as command line arg and > saw that reboot is working fine. > My arm64 hangs at reboot or power off, unless i revert the ResetSystem() part. But given that it is both risky (relying on a kthread running a workqueue in the shutdown path) and unnecessary (ResetSystem() is not supposed to return, and is only called by the kernel when the whole system has already been torn down), I think the main reason is simply that there is no reason to add it. >> > @@ -340,7 +441,8 @@ static void virt_efi_reset_system(int reset_type, >> > "could not get exclusive access to the firmware\n"); >> > return; >> > } >> > - __efi_call_virt(reset_system, reset_type, status, data_size, data); >> > + efi_queue_work(RESET_SYSTEM, &reset_type, &status, &data_size, data, >> > + NULL); >> > up(&efi_runtime_lock); >> > } > > Regards, > Sai