From patchwork Fri Jun 4 14:03:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 454036 Delivered-To: patch@linaro.org Received: by 2002:a02:735a:0:0:0:0:0 with SMTP id a26csp448410jae; Fri, 4 Jun 2021 07:06:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyHfQ5piFklOjQyQfILySHCV8dI5AY2Q61wLnmAsuaazNGZW0Tf8zwXbhiFsRYR8+xGTBSM X-Received: by 2002:adf:efca:: with SMTP id i10mr4142842wrp.139.1622815564204; Fri, 04 Jun 2021 07:06:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622815564; cv=none; d=google.com; s=arc-20160816; b=jIWNBHjedCOiRJKPkXR6huTsf5kahtmQEofY98jEqm/bXfDv3JSqZt+Sp3i1QXOEjj oIo98fYNg6/7OmN0zhWCcZcjAqvuRmupO1d5/Fkr0pt33SWIouJNs9yhK9hqibNdj0r1 DjZkyvnSSg78YoLgbqc2um5soO7HAjtPUnukJYVF/rRcNB5tdXKLVnngbuIz1/xb+D4K vbnnjXvhjzQd0CFD07AzTs7a4v6/Ij9HXENcbgDeQ0t0Uav+UZnKLImf6pL/jz7fIGL1 Yq2cUiTADpyxe1+HY8TiFX3V7PrLLsW1vdbF3RBeU9tnyhpHtUW04FwpcNbRsRXhodta lXwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:sender:precedence :errors-to:list-subscribe:list-help:list-post:list-unsubscribe :list-id; bh=9vD7NkGDkc+IVLjUtVKL1KzFVVpDAskIEMoj4foPPh0=; b=R7z0f7OT3s7T8Hi2SVJazQ9y4eiu/WqsMkSVf34cC08up/EaN13AyTW1ZzFf9L5XVv ZrX384lDsBr3PjcgtqElPVhY8eivDEWVNBclL+I3+vVJE5XF7VULZ4GRU49GIFG0gxMY StI5+AkGIFxdOcqVNF/5nEcEX9tanoU8TH38flmUObYuqf0s+iA0vMuHYFO2nIAH2FeA UGIlloTRnSWjuQRnLMFKWiPl84nmMcQhWCjhOy1QyWHFZdt0J2WsF1Mftf1oYF7h154c 4AsSNEBfVx+mtoY5+g3+kFi0G9d+fwVdkoedGXyGueVFdoFx6p1+KuYvpG8s+50J9K6d 3l7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=akY05cjV; spf=pass (google.com: domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org. [192.237.175.120]) by mx.google.com with ESMTPS id n2si5988498ejl.693.2021.06.04.07.06.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Jun 2021 07:06:04 -0700 (PDT) Received-SPF: pass (google.com: domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=akY05cjV; spf=pass (google.com: domain of xen-devel-bounces@lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from list by lists.xenproject.org with outflank-mailman.136861.253632 (Exim 4.92) (envelope-from ) id 1lpAQi-0005IG-T7; Fri, 04 Jun 2021 14:04:08 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 136861.253632; Fri, 04 Jun 2021 14:04:08 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lpAQi-0005I9-Ob; Fri, 04 Jun 2021 14:04:08 +0000 Received: by outflank-mailman (input) for mailman id 136861; Fri, 04 Jun 2021 14:04:08 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1lpAQi-0004yR-09 for xen-devel@lists.xenproject.org; Fri, 04 Jun 2021 14:04:08 +0000 Received: from mail-wr1-x434.google.com (unknown [2a00:1450:4864:20::434]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 510db9ae-62bd-4175-9c5b-26835265215a; Fri, 04 Jun 2021 14:04:03 +0000 (UTC) Received: by mail-wr1-x434.google.com with SMTP id f2so9408605wri.11 for ; Fri, 04 Jun 2021 07:04:03 -0700 (PDT) Received: from dell.default ([91.110.221.214]) by smtp.gmail.com with ESMTPSA id m11sm5422559wmq.33.2021.06.04.07.04.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Jun 2021 07:04:01 -0700 (PDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 510db9ae-62bd-4175-9c5b-26835265215a DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9vD7NkGDkc+IVLjUtVKL1KzFVVpDAskIEMoj4foPPh0=; b=akY05cjVG2u0Mf/Ur1k9G+ijD85MCVBcTS5cQxoMRHReBqD1UUr5+rTusPSJUjBFcQ xJ5eN+t/caaW7VWfSKfSEp9tAOxtYnT7wP4gt0PBctHI71FMDBhIJElbtcRHq0RZXIqj NxjnAOMorjqeNIdAFe72j34/dxhsIEZWYFc8liIEyolGby0H9wUp9V8daZmdeVX1FZ0B 5SeriQykexYzYAk2IbdrrdTOG9zKvdQJXFBJgXPKvzkZZrm/S0Ymv4tV6g+9IRQBLFvQ UPN+cQH55smlaQ153ZgRX0rZF83RKMv1yYNN5C6hN2iKku845JUpznvi7dzmQSIaEGCJ OzBA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9vD7NkGDkc+IVLjUtVKL1KzFVVpDAskIEMoj4foPPh0=; b=EOQd5XlNE3Shcz5WfApF2JDw01RGvITNRDp1FAgBLCXhxkWZNc9qv79T8WUXw+x9s+ ngSUl51hHweDOS7P4YGZawLU6Yw5T2ytHjI8BllrlXfI1wIjsqyL2CReXcdzKVfBy+A8 b9eYo1ksgZIwf/XkFfb7lMrJjBIKVYcKrjqud5rUnjtAZC1ksrPWRJE/7ZGD5phbGEA/ b+WicZ9XM1m5oi9z9IG1/GC5r0WLB3VRCL3uWoOEiHBfelIfxvAAhztF5BH22LKKK5zQ LUvq94BOAWfbLMW3Wu5j1nNc2W4Dd47Um9XXm38qqpmDa006LoZW+vlxcx8hlMypuI62 ELNQ== X-Gm-Message-State: AOAM532Y3UNqqEhtsKzHjfBuVEy1jjR47Po02fk5T5PmJJg/Aun/gcnw xBAHwDzxmUIWlOvyUqiCx6dKlA== X-Received: by 2002:a05:6000:6:: with SMTP id h6mr4149822wrx.24.1622815442389; Fri, 04 Jun 2021 07:04:02 -0700 (PDT) From: Lee Jones To: lee.jones@linaro.org, linux@armlinux.org.uk, catalin.marinas@arm.com, will@kernel.org, mark.rutland@arm.com, lorenzo.pieralisi@arm.com, sstabellini@kernel.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, wsa+renesas@sang-engineering.com, linux@roeck-us.net, treding@nvidia.com, arnd@arndb.de, xen-devel@lists.xenproject.org, patches@armlinux.org.uk, Stefano Stabellini Subject: [PATCH 1/5] ARM: xen: Register with kernel restart handler Date: Fri, 4 Jun 2021 15:03:53 +0100 Message-Id: <20210604140357.2602028-2-lee.jones@linaro.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210604140357.2602028-1-lee.jones@linaro.org> References: <20210604140357.2602028-1-lee.jones@linaro.org> MIME-Version: 1.0 From: Guenter Roeck Register with kernel restart handler instead of setting arm_pm_restart directly. Select a high priority of 192 to ensure that default restart handlers are replaced if Xen is running. Acked-by: Arnd Bergmann Reviewed-by: Wolfram Sang Reviewed-by: Stefano Stabellini Signed-off-by: Guenter Roeck Signed-off-by: Thierry Reding Signed-off-by: Lee Jones --- arch/arm/xen/enlighten.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) -- 2.31.1 diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c index 8ad576ecd0f1d..7f1c106b746f8 100644 --- a/arch/arm/xen/enlighten.c +++ b/arch/arm/xen/enlighten.c @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -181,11 +182,18 @@ void xen_reboot(int reason) BUG_ON(rc); } -static void xen_restart(enum reboot_mode reboot_mode, const char *cmd) +static int xen_restart(struct notifier_block *nb, unsigned long action, + void *data) { xen_reboot(SHUTDOWN_reboot); + + return NOTIFY_DONE; } +static struct notifier_block xen_restart_nb = { + .notifier_call = xen_restart, + .priority = 192, +}; static void xen_power_off(void) { @@ -404,7 +412,7 @@ static int __init xen_pm_init(void) return -ENODEV; pm_power_off = xen_power_off; - arm_pm_restart = xen_restart; + register_restart_handler(&xen_restart_nb); if (!xen_initial_domain()) { struct timespec64 ts; xen_read_wallclock(&ts);