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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3E43FC433F5 for ; Sun, 7 Nov 2021 17:33:33 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (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 DEDB26139E for ; Sun, 7 Nov 2021 17:33:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org DEDB26139E Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.222857.385254 (Exim 4.92) (envelope-from ) id 1mjm2W-0007aj-GN; Sun, 07 Nov 2021 17:33:08 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 222857.385254; Sun, 07 Nov 2021 17:33: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 1mjm2W-0007ac-DS; Sun, 07 Nov 2021 17:33:08 +0000 Received: by outflank-mailman (input) for mailman id 222857; Sun, 07 Nov 2021 17:33:07 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mjm2V-0007aW-2U for xen-devel@lists.xenproject.org; Sun, 07 Nov 2021 17:33:07 +0000 Received: from mail-oi1-x230.google.com (mail-oi1-x230.google.com [2607:f8b0:4864:20::230]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id c32ab10d-3ff0-11ec-9787-a32c541c8605; Sun, 07 Nov 2021 18:33:05 +0100 (CET) Received: by mail-oi1-x230.google.com with SMTP id bk14so1028934oib.7 for ; Sun, 07 Nov 2021 09:33:04 -0800 (PST) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id c18sm4840649otr.32.2021.11.07.09.32.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 07 Nov 2021 09:33:03 -0800 (PST) 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 X-Inumbo-ID: c32ab10d-3ff0-11ec-9787-a32c541c8605 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:to:cc:references:from:subject:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=tMVMvSELY54S0UdLfdOcY9hXGDCgRpBmnCTKjFa8UlE=; b=QIfw+m72ItgaApqkAoLUYKEHkpy+eMpUCLymo2SVE2e06bxlhsvsGBIpx80FAFL6zX lQmhx5vWsnqdO5AzfRwzYmC9JyeI+x703tpvfwQKurLg2VtZOzsNtJVqgO0A8u3N2B9I BYJElUmFFKGlmNuNH1pVTHbG46IPWj2FGkpJks4IWHqhA3hkwgU7q4GC5oDjmilXskFD oTKdooszpWu854bZrRMH7UW0QrvSFFnK9cGOfGPg2b3g5hqd+nvAec6GccpfULS1MyoN kwidN5WRwT1FH2PsDPsfoM+Wt2eEwiLbpjLKm84c+sezJpyJvFv7kmoqDjei75CdMOoF bVbQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:to:cc:references:from:subject:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=tMVMvSELY54S0UdLfdOcY9hXGDCgRpBmnCTKjFa8UlE=; b=76p0t7He7dT9JLX3C9xs+YdA9Lo6Z7zmxZ6AR0GhxaT+SuoJXfVtz5a5ZJwRIcxNcC LkYsuabNZ3jQd1YchAfdD484MGiomR12l6c9RQ40Uqm4/8/Q2LVE8DnDZFQfiW4DKN4B fG/rIUen9XOwyVmF6zDnUzCRUbhCGszI1JwywLeDjZhlAAcaZmdar3xOCvH6jKC2QWsO CvUuZU6G60stjg3XRdnE7VIW7gYidMQt4fl9v/4Z5lXCwyNYJ6JQf716LfB1+pjo8Xcg a2n2vtPuByS8UPTot8eH4rqbzda08vVCLFBwEtT7XYET4KVY1h7Nmffqvg38l1Xbdq1B bk7A== X-Gm-Message-State: AOAM5310RNJC3o8Dti527E9mmhmifftNs7+HeBxawBC48bYaCm8MVIqv FLbBehAoH4aIbY9OHjOTgWI= X-Google-Smtp-Source: ABdhPJygB0wkAZr+IyDwhIXD/1Ky9Z1d16PhZAI/x4npp+2qcv9Jc+QXaxpUDgRoNUJ2QI01eNmjeA== X-Received: by 2002:aca:650d:: with SMTP id m13mr16262607oim.42.1636306383620; Sun, 07 Nov 2021 09:33:03 -0800 (PST) Sender: Guenter Roeck To: Dmitry Osipenko , =?UTF-8?Q?Jonathan_Neusch=c3=a4fer?= Cc: Thierry Reding , Jonathan Hunter , Lee Jones , "Rafael J . Wysocki" , Mark Brown , Andrew Morton , Russell King , Daniel Lezcano , Andy Shevchenko , Ulf Hansson , Catalin Marinas , Will Deacon , Guo Ren , Geert Uytterhoeven , Greg Ungerer , Joshua Thompson , Thomas Bogendoerfer , Nick Hu , Greentime Hu , Vincent Chen , Helge Deller , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Paul Walmsley , Palmer Dabbelt , Albert Ou , Yoshinori Sato , Rich Felker , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Boris Ostrovsky , Juergen Gross , Stefano Stabellini , Len Brown , Santosh Shilimkar , Krzysztof Kozlowski , Linus Walleij , Chen-Yu Tsai , Tony Lindgren , Liam Girdwood , Philipp Zabel , Vladimir Zapolskiy , Avi Fishman , Tomer Maimon , Tali Perry , Patrick Venture , Nancy Yuen , Benjamin Fair , Pavel Machek , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-csky@vger.kernel.org, linux-ia64@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-sh@vger.kernel.org, xen-devel@lists.xenproject.org, linux-acpi@vger.kernel.org, linux-omap@vger.kernel.org, openbmc@lists.ozlabs.org, linux-tegra@vger.kernel.org, linux-pm@vger.kernel.org References: <20211027211715.12671-1-digetx@gmail.com> <20211027211715.12671-28-digetx@gmail.com> <9a22c22d-94b1-f519-27a2-ae0b8bbf6e99@roeck-us.net> <658cf796-e3b1-f816-1e15-9e9e08b8ade0@gmail.com> From: Guenter Roeck Subject: Re: [PATCH v2 27/45] mfd: ntxec: Use devm_register_power_handler() Message-ID: <5a17fee3-4214-c2b9-abc1-ab9d6071591b@roeck-us.net> Date: Sun, 7 Nov 2021 09:32:56 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <658cf796-e3b1-f816-1e15-9e9e08b8ade0@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit On 11/7/21 9:16 AM, Dmitry Osipenko wrote: > 07.11.2021 20:08, Guenter Roeck пишет: >> On 11/7/21 8:53 AM, Dmitry Osipenko wrote: >>> 06.11.2021 23:54, Jonathan Neuschäfer пишет: >>>> Hi, >>>> >>>> On Thu, Oct 28, 2021 at 12:16:57AM +0300, Dmitry Osipenko wrote: >>>>> Use devm_register_power_handler() that replaces global pm_power_off >>>>> variable and allows to register multiple power-off handlers. It also >>>>> provides restart-handler support, i.e. all in one API. >>>>> >>>>> Signed-off-by: Dmitry Osipenko >>>>> --- >>>> >>>> When I boot with (most of) this patchset applied, I get the warning at >>>> kernel/reboot.c:187: >>>> >>>>     /* >>>>      * Handler must have unique priority. Otherwise call order is >>>>      * determined by registration order, which is unreliable. >>>>      */ >>>>     WARN_ON(!atomic_notifier_has_unique_priority(&restart_handler_list, >>>> nb)); >>>> >>>> As the NTXEC driver doesn't specify a priority, I think this is an issue >>>> to be fixed elsewhere. >>>> >>>> Other than that, it works and looks good, as far as I can tell. >>>> >>>> >>>> For this patch: >>>> >>>> Reviewed-by: Jonathan Neuschäfer >>>> Tested-by: Jonathan Neuschäfer >>> >>> Thank you. You have conflicting restart handlers, apparently NTXEC >>> driver should have higher priority than the watchdog driver. It should >>> be a common problem for the watchdog drivers, I will lower watchdog's >>> default priority to fix it. >>> >> >> The watchdog subsystem already uses "0" as default priority, which was >> intended as priority of last resort for restart handlers. I do not see >> a reason to change that. > > Right, I meant that watchdog drivers which use restart handler set the > level to the default 128 [1]. Although, maybe it's a problem only for > i.MX drivers in practice, I'll take a closer look at the other drivers. > They don't have to do that. The default is priority 0. It is the decision of the driver author to set the watchdog's restart priority. So it is wrong to claim that this would be "a common problem for the watchdog drivers", because it isn't. Presumably there was a reason for the driver author to select the default priority of 128. If there is a platform which has a better means to restart the system, it should select a priority of 129 or higher instead of affecting _all_ platforms using the imx watchdog to reset the system. Sure, you can negotiate that with the driver author, but the default should really be to change the priority for less affected platforms. Guenter