From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 763B2C433E0 for ; Fri, 5 Mar 2021 08:05:01 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 01C4564FEA for ; Fri, 5 Mar 2021 08:05:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 01C4564FEA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=s/M2BEyYYK83azhpaaEh8YIZMMQUfuWlKBLmIR+s8ek=; b=aJfjZgtGgTjVmE8Mbl5NpRXOG JyG0wGcDyWK2CryN2U5r5U7WXEBIhSIOVlgVSp6RX6NfLsG6z0627XhxG2ij185UpWiDV2ZSPf29+ 77UQb+LE9H0pui0r7SbMlHwKidvAkeq+sZyYqnH5neQBWCzHJ6tNVs8cX9HW1zjGNxqbUGraHhaYu ceRC1OGndnveI2/2TSMmhVhwEu4V0hDJ0p1cRC60+Lzoa5ZNWhdtzaEz8qgT16jPsROaHgLUbdyxQ ohSojb/yI0zGSF08vHofw7NWoO7BgJmfKDXpm7TQGTAe5fT/89m2vAESLEcAI8hC1gInspF8OXdY9 Zruzf2DxA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lI5QL-00DtEm-Av; Fri, 05 Mar 2021 08:03:01 +0000 Received: from mail-pj1-x1036.google.com ([2607:f8b0:4864:20::1036]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lI5QF-00DtDL-Q5 for linux-arm-kernel@lists.infradead.org; Fri, 05 Mar 2021 08:02:59 +0000 Received: by mail-pj1-x1036.google.com with SMTP id ch11so1466355pjb.4 for ; Fri, 05 Mar 2021 00:02:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=5242qZe1dQx2v+ceV/UsYai2bG9UNF18xwfWliabRhQ=; b=EwaCGlqzU61K0/wCtlOm/oXYh3kV1Aw/G38iUzbbMcjw+BkDb8+vPEuityxR80nd3W 5ZKwyTC7JurGYq2VEZAgrjnMcGrB7HgvbidKH77C5mqRhG88gTmgDXOwEEMtZXS8NdBD DUJFNHHbcndzSxF4kJ/ODhsCshvMc98BfRRQmlf5kCvwKWd2LZlSGDQwQ8daN2OZAxsp fcKKta1Pytn3SgtFMkehUf2HInU1C9O+I76tlu3iKRPb7WT6lM/fd2aRgTijWuzTUmJW EesNmXPu6YRy4iDYfK6UWTG4HrzP0G3Nr21nJ3aMvPs/6G50nOb9qpzdEd5cLSWIm0zC lcTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=5242qZe1dQx2v+ceV/UsYai2bG9UNF18xwfWliabRhQ=; b=tVaggkzNrMyShXLIZjQKPWKQ/sseiO7LLOwPDcDS1bBRiEhJQJ/e3vMOVb4aAo/OPQ n1gAsZaZKZoohdRJErcaph/8MQzziIEWv9Mi6P4rl92nXzDcBPt+jjVqRaQ2KOM4HeG3 4jCUSi2lF9UjNpZvtmI3bCfppE03vF5VbsBl3tJ/KhoRRY+0hQe+rdMSFWdpZdAVRHjS d15pF4+k7N1AJ4/Okq7P+ZBPPJ24s4S9lydqJl+Zh27GSqLz7etW3LuYk6qnw1ZkSh7O YlYsYw802fInvjVKm6Zzc4W8KseOcK6vC1YLALoVfgqB3WhRl3AsHyukVyexmDvZuMd2 7BSA== X-Gm-Message-State: AOAM5316ddC2hvVt6A6RPEI00SgykeirwMkIdw5yjrNIDYIQ8n3EXxHH DoXiGh6Bv4p6JtTt1H+j75hCWJpw+WxDyA== X-Google-Smtp-Source: ABdhPJy2CcxiT93477ZVvqAVyrPoTSaJ7CcR8UiWJZJ949CY9DZvO2SMjBZ2tUJjz6u/eaD5cWL4QQ== X-Received: by 2002:a17:902:10a:b029:e2:e8f7:2988 with SMTP id 10-20020a170902010ab02900e2e8f72988mr7709667plb.4.1614931373873; Fri, 05 Mar 2021 00:02:53 -0800 (PST) Received: from dragon (80.251.214.228.16clouds.com. [80.251.214.228]) by smtp.gmail.com with ESMTPSA id p190sm1508042pga.78.2021.03.05.00.02.51 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 05 Mar 2021 00:02:53 -0800 (PST) Date: Fri, 5 Mar 2021 16:02:47 +0800 From: Shawn Guo To: Ard Biesheuvel Cc: Catalin Marinas , Will Deacon , Jeffrey Hugo , Bjorn Andersson , linux-efi , Linux ARM , linux-arm-msm@vger.kernel.org Subject: Re: [PATCH] arm64: efi: add check for broken efi poweroff Message-ID: <20210305080245.GJ17424@dragon> References: <20210305065120.11355-1-shawn.guo@linaro.org> <20210305073151.GI17424@dragon> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210305_080257_220435_AFF8085E X-CRM114-Status: GOOD ( 40.11 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Mar 05, 2021 at 08:46:35AM +0100, Ard Biesheuvel wrote: > On Fri, 5 Mar 2021 at 08:32, Shawn Guo wrote: > > > > On Fri, Mar 05, 2021 at 08:01:02AM +0100, Ard Biesheuvel wrote: > > > On Fri, 5 Mar 2021 at 07:51, Shawn Guo wrote: > > > > > > > > Poweroff via UEFI Runtime Services doesn't always work on every single > > > > arm64 machine. For example, on Lenovo Flex 5G laptop, it results in > > > > a system reboot rather than shutdown. Add a DMI check to keep such > > > > system stay with the original poweroff method (PSCI). > > > > > > > > Signed-off-by: Shawn Guo > > > > > > What is the point of using EFI runtime services on this machine if > > > poweroff doesn't work either? > > > > Hmm, I'm not sure how many EFI runtime services are being used by > > kernel, but this is the only one broken I have seen. Not sure we want > > to disable the whole thing completely. Also, I'm looking at commit log > > of 0c5ed61adbdb ("efi/reboot: Allow powering off machines using EFI") > > below. > > > > Not only can EfiResetSystem() be used to reboot, it can also be used to > > power down machines. > > > > By and large, this functionality doesn't work very well across the range > > of EFI machines in the wild, so it should definitely only be used as a > > last resort. In an ideal world, this wouldn't be needed at all. > > > > Unfortunately, we're starting to see machines where EFI is the *only* > > reliable way to power down, and nothing else, not PCI, not ACPI, works. > > > > It seems poweroff via EFI runtime services is known not working for > > every machine, and was meant to be the last resort if nothing else can > > power off system. If we try PSCI first on arm64, you do not see my > > patch at all :) > > > > > Can't we just boot this thing with > > > efi=noruntime? > > > > We are trying to get arm64 laptop support into distros, and patching > > kernel cmdline with 'efi=novamap' is already a pain. We do not really > > want to have more of it. > > > > I suppose we have to rely on DtbLoader for these platforms anyway, > right? That means we should be able to rely on it to publish a RT_PROP > configuration table which tells the kernel which EFI runtime services > are usable and which are not. This way, we could get rid of > efi=novamap as well. Two things: - DtbLoader is loaded as an EFI driver. It works fine on Yoga C630, but it's not loaded by Flex 5G UEFI for some reason. So DtbLoader is not really working on Flex 5G at this point. - We are running not only DT kernel on these laptops but also ACPI kernel in which case DtbLoader shouldn't needed. > I'd prefer to rely on that than on DMI quirks - we have not used those > at all on arm64/ARM so far, and the DMI tables are parsed relatively > late, so in some cases, DMI quirks may not be reliable. I'm all ears in case there are other runtime mechanisms to get around it. Shawn _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel