From patchwork Fri Aug 29 15:05:57 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 36308 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-pa0-f70.google.com (mail-pa0-f70.google.com [209.85.220.70]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2273F202DD for ; Fri, 29 Aug 2014 15:08:34 +0000 (UTC) Received: by mail-pa0-f70.google.com with SMTP id lf10sf36327861pab.5 for ; Fri, 29 Aug 2014 08:08:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id :in-reply-to:references:cc:precedence:list-id:list-unsubscribe :list-archive:list-post:list-help:list-subscribe:mime-version:sender :errors-to:x-original-sender:x-original-authentication-results :mailing-list:content-type:content-transfer-encoding; bh=eAzM6FGnfcKPR83XBmPtouAF+gWUS89SVJPI5uzPZmU=; b=jV+o+5glllxWqPW2eZe9lnwvGGx3d5O/1p7zC0HHRIZGgjVY196FJWMX5M6O79eB6o TnEMbF69v/Q6uxN3Cxjeui3Uumer37Mn9QbWdgaKVF5ix4J6w4txdnr4uRqNC9/JWXLn du7BgIPV5dQwmF61y9lS3uFDzptBuyPET/odbs1zHSWAQlmATJXQDZrOIEsVDTNvYpML H0iRMp+o6I0Ee310jptiyMBxpHCQQiuF81LwGer+R8tGdqk/UcFSlQ1XPeMOzpMiB63x Anq7pajRX5PhccxbMytv1bUpnzC4dBM+mYnCs3vbWQQORNVbCh/rxWqDhL9lVI9I2s46 n86w== X-Gm-Message-State: ALoCoQnITE+8uE4ebE4hXJGkBRbgSjeJ04E4oG5ZEjd8VH/n5YmddVQsRfdYBr3BcUxMauh6BglN X-Received: by 10.66.157.197 with SMTP id wo5mr5961302pab.43.1409324913380; Fri, 29 Aug 2014 08:08:33 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.48.35 with SMTP id n32ls747285qga.25.gmail; Fri, 29 Aug 2014 08:08:33 -0700 (PDT) X-Received: by 10.220.166.207 with SMTP id n15mr450414vcy.75.1409324913227; Fri, 29 Aug 2014 08:08:33 -0700 (PDT) Received: from mail-vc0-f172.google.com (mail-vc0-f172.google.com [209.85.220.172]) by mx.google.com with ESMTPS id xn5si279909vcb.95.2014.08.29.08.08.33 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 29 Aug 2014 08:08:33 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.172 as permitted sender) client-ip=209.85.220.172; Received: by mail-vc0-f172.google.com with SMTP id ij19so2609777vcb.31 for ; Fri, 29 Aug 2014 08:08:33 -0700 (PDT) X-Received: by 10.221.5.137 with SMTP id og9mr10884966vcb.18.1409324913123; Fri, 29 Aug 2014 08:08:33 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.45.67 with SMTP id uj3csp31154vcb; Fri, 29 Aug 2014 08:08:32 -0700 (PDT) X-Received: by 10.68.173.98 with SMTP id bj2mr16171526pbc.157.1409324912057; Fri, 29 Aug 2014 08:08:32 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id oo1si364630pdb.228.2014.08.29.08.08.21 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 29 Aug 2014 08:08:22 -0700 (PDT) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XNNl7-00018F-Jt; Fri, 29 Aug 2014 15:06:37 +0000 Received: from mail-we0-f182.google.com ([74.125.82.182]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XNNkx-00010y-M9 for linux-arm-kernel@lists.infradead.org; Fri, 29 Aug 2014 15:06:28 +0000 Received: by mail-we0-f182.google.com with SMTP id w62so2305329wes.41 for ; Fri, 29 Aug 2014 08:06:05 -0700 (PDT) X-Received: by 10.180.186.98 with SMTP id fj2mr4593115wic.32.1409324765180; Fri, 29 Aug 2014 08:06:05 -0700 (PDT) Received: from ards-macbook-pro.local (BSN-61-35-126.dial-up.dsl.siol.net. [86.61.35.126]) by mx.google.com with ESMTPSA id ll20sm761320wic.14.2014.08.29.08.06.03 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 29 Aug 2014 08:06:04 -0700 (PDT) From: Ard Biesheuvel To: linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, will.deacon@arm.com, leif.lindholm@linaro.org Subject: [PATCH 2/2] efi/arm64: use UEFI for system reset Date: Fri, 29 Aug 2014 17:05:57 +0200 Message-Id: <1409324757-12607-2-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1409324757-12607-1-git-send-email-ard.biesheuvel@linaro.org> References: <1409324757-12607-1-git-send-email-ard.biesheuvel@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140829_080627_871960_E56AE8DD X-CRM114-Status: GOOD ( 10.11 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [74.125.82.182 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [74.125.82.182 listed in wl.mailspike.net] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders Cc: roy.franz@linaro.org, Ard Biesheuvel , msalter@redhat.com X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ard.biesheuvel@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.220.172 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 If UEFI Runtime Services are available, they are preferred over direct PSCI calls or other methods to reset the system. For the reset case, we need to hook into machine_restart(), as the arm_pm_restart function pointer may be overwritten by modules. Signed-off-by: Ard Biesheuvel --- arch/arm64/kernel/process.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/arm64/kernel/process.c b/arch/arm64/kernel/process.c index 1309d64aa926..335a93da5eeb 100644 --- a/arch/arm64/kernel/process.c +++ b/arch/arm64/kernel/process.c @@ -177,6 +177,13 @@ void machine_restart(char *cmd) local_irq_disable(); smp_send_stop(); + /* + * arm_pm_restart is exported to modules, so the only way to supersede + * it with efi_reboot() is to call it here. + */ + if (IS_ENABLED(CONFIG_EFI) && efi_enabled(EFI_RUNTIME_SERVICES)) + efi_reboot(REBOOT_WARM, NULL); + /* Now call the architecture specific reboot code. */ if (arm_pm_restart) arm_pm_restart(reboot_mode, cmd);