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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9914BC433F5 for ; Tue, 15 Feb 2022 14:32:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:Subject:From:References:Cc:To: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=BPazC0dDZueZEH0bs0mN/htqS/wxAVx7PdbFxEvRDOA=; b=RZ1x6bIeEnGCs+ zCPKbLH9bbmbVNIstsWx9bqQAh2U/N0+ycnsNeperqG09gg+W8p5H8JjvQ7wroOK7fkkKXRknyr+k G1NyfcXhbv5zT7HwCP2lrzdXsnFWb3pw8A/IRs49Qy3EgxmYAy4L3fB7hi7aWlL+YRpr94oefA3wC XxdKU2J3rjZborR14WevtCRFhEqaS+jrBG0tf4pZW2mQId4oyB1sK6NYYANEdkW6A+KOYp9nA3dLt 9CvdztsFBr8JQhjV20khU+856VGXEJuyV/oFFpA2BknvwA7+sWf6IFRv7kjvp9A/wPlIuvtK334Zu AkIroFisFAQdL2OSSgDA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nJyqy-0030Wg-DQ; Tue, 15 Feb 2022 14:30:52 +0000 Received: from mail-oi1-x236.google.com ([2607:f8b0:4864:20::236]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nJyqd-0030P4-8R for linux-arm-kernel@lists.infradead.org; Tue, 15 Feb 2022 14:30:33 +0000 Received: by mail-oi1-x236.google.com with SMTP id x193so20969815oix.0 for ; Tue, 15 Feb 2022 06:30:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:message-id:date:mime-version:user-agent:content-language:to :cc:references:from:subject:in-reply-to:content-transfer-encoding; bh=o8JsroBWHtIyrUhOn7dBaIXgVTUEl2NPmoZI9J5M7E4=; b=ifEIW3QyLIEZKOFGn1FWXIry5z0Qay9I8omD8m3/vwpHfFyn/gHzJv/UwFDjNCbHOy VO3/TxAvNOcLKNwOW0g44qaSAg/Y0X5hIzOy7p7RUsGHVxqxXpvGFhUpuCLGL7Ikt5kO hEfNdVggmT/piyRxBhNbeFU5rcnpi/lJyv2rpYOPfmCLvd1ECK58o9Xb1bQnNW4aAg7P 494In7Sosgo8F9jjLzFOZ712RSjGjA1/FgazyRROU/nZMfqB+/0rNDUcFqwjFZWZEG4W jCfhjvBgm6/lCZrdin3d84fC/Py4V3LOgv8HO0S/0r4087uvBxOidGkL7nTntuywYh9Q N+QA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:message-id:date:mime-version:user-agent :content-language:to:cc:references:from:subject:in-reply-to :content-transfer-encoding; bh=o8JsroBWHtIyrUhOn7dBaIXgVTUEl2NPmoZI9J5M7E4=; b=GFQ3V/+WrAzgm0fJAzX0ULy7MLdMWSIVkp6IwsYgNk19v+lMHf0amOmj6AFASHVvVa zeH2+NR7y6mPibOf3KEJ0a73EJO84ZBqAOolBYcjEDvnxBUnLVv0BwWeKOLU0PSPf2qk ghULqKimxfdYDuNk6OH2PEDvZeIy8T1imOsqlR3Ck1r45ij6gqXZYBqOWSqYSz6m7AyS GWb9C20pVMeYgI6e+KlOGExCSck+TpKwFRijmRzGZwEOpqzrXpZDQJN/TzQ9ByosycEV ZcgTpSapnSGz8F3M+paHvVk2QcQZDpyUS2fQ9eEo8HlwCuyW+0dd6dgjI56q63gPzqEB Y4cQ== X-Gm-Message-State: AOAM532GLhyZNwaFYgYRB4X1KI46UofVHid8pZjrM8tV8O8sSO6m8ch6 e20fgMmcY3gHU7BJCORU+VHlmPqjdBT2eA== X-Google-Smtp-Source: ABdhPJwgF72oQR19E3uWYYaiJfKoD2vkjQwg+o0A+S/ZSkYjnRF039u9W2p4p8TBAT9ywgIuTXH7OQ== X-Received: by 2002:a05:6808:1644:b0:2cd:6d80:9af1 with SMTP id az4-20020a056808164400b002cd6d809af1mr1709630oib.138.1644935429995; Tue, 15 Feb 2022 06:30:29 -0800 (PST) Received: from ?IPV6:2600:1700:e321:62f0:329c:23ff:fee3:9d7c? ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id l1sm13761263otd.18.2022.02.15.06.30.27 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 15 Feb 2022 06:30:29 -0800 (PST) Message-ID: <489b76f9-fbaf-dae0-c90d-c52ee0de92a4@roeck-us.net> Date: Tue, 15 Feb 2022 06:30:26 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Content-Language: en-US To: Alexander Sverdlin , Mark Rutland , Ard Biesheuvel Cc: Catalin Marinas , Will Deacon , Peter Collingbourne , Wolfram Sang , Matija Glavinic-Pecotic , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Krzysztof Adamski , linux-efi@vger.kernel.org References: <79bcce92-abb2-4c3e-7193-d18e144da8a0@nokia.com> From: Guenter Roeck Subject: Re: [PATCH v2] arm64: move efi_reboot to restart handler In-Reply-To: <79bcce92-abb2-4c3e-7193-d18e144da8a0@nokia.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220215_063031_407153_E7EABAAB X-CRM114-Status: GOOD ( 23.16 ) 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-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2/15/22 00:44, Alexander Sverdlin wrote: > Hello Mark, Ard, > > On 01/02/2022 14:58, Mark Rutland wrote: >>> You could argue that restart handlers were not created for that but they >>> suit this purpose ideally and it wouldn't make much sense (in my >>> opinion) to add yet another notifier chain that would run before reset >>> notifiers, for code that is not supposed to reset the whole system and >>> this is exacly what I would have to do if efi_reboot() is forced to be >>> called before all handlers. >> >> As above, I think that's just using the wrong interface, and the reboot >> notifier mechanism *already* exists, so I'm really confused here. >> >> Have I misunderstood what you're trying to achieve? >> >> Is there some problem with the reboot notifier mechanism that I am unaware of? >> e.g. do we bypass them in some case where you think they're needed? >> >> Are you simply unaware of reboot notifiers? > > Could you please check the simple case of pwrseq_emmc.c? > > While that's currently the only example of this kind upstream I can imagine > further use-cases, especially in storage area like above. > > Would you suggest it's illegal usage of register_restart_handler()? > Do we need to fix pwrseq_emmc.c by introducing new atomic notifier chain > which will be called before restart handlers, so that it works on > emergency_restart()? > Abuse isn't just about using an API for something it isn't originally intended for, abuse is also to intentionally _not_ use an API, as it is currently done by the EFI restart code for arm64. Also, keep in mind that the same argument (our restart handler _must_ be executed under all circumstances and does therefore not use the restart API) is likely going to be used again in the future. All it takes is for some other standard (or chip vendor, for that matter) to declare their restart handler mandatory if present. That means there will be other non-users of the restart API in the future, and you simply can not rely on it being used. That was clearly not the intention of the restart API - quite the opposite - but it is what it is. Given that, I'd suggest to cut your losses and try to find another solution for your problem. That may be to introduce yet another API, one that is called before the EFI restart handling but that is always called, unlike reboot notifiers, or simply stick with out-of-tree code. Guenter _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel