Received: by 2002:a05:6358:53a8:b0:117:f937:c515 with SMTP id z40csp111086rwe; Thu, 13 Apr 2023 23:17:04 -0700 (PDT) X-Google-Smtp-Source: AKy350Z9FImUv7iicz+LHSWDFNoq42R67TndPyUYLhmb4VZxG/eRORnGC0e4rr060Q2vC8hgcYP2 X-Received: by 2002:a17:902:ab09:b0:1a5:2757:d40a with SMTP id ik9-20020a170902ab0900b001a52757d40amr1384388plb.49.1681453024224; Thu, 13 Apr 2023 23:17:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681453024; cv=none; d=google.com; s=arc-20160816; b=p+MJzUVUq6XcqwKeEvGPAninJtPbjcgX/SC34PBCi7U6FK41qTTvRfDo67R47t42/3 U8omUo0bO17P1DK9AmmHcEyAOgQeZ8ELxGQtpiwv1R7bHO1+Os87vb4uFv/TY8R+lwSp LYLci5Z32qFCqAUHbVNFOXqNGQk4t3nF5szABJyYUy0m5SmgebXwc+9j9ObuVqARX5Z8 5gLS8SijcYSYjcbokHq+LuB9K0jzqdKX2v9mp73rSn01t64b8dKQCICObuQy8pJEqY+Y OpeAl9bevW+jxbYN2e/IU+E6UEeAwLrqD9WopVzT5AFyI3VwjuvwBFokJmn1xDO2a9Cs qgrA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=SbTsshoRiULEkzwBbQ+pYzOmV8qW1WFmOzv8hcmERH4=; b=zwPRidAcUYeHFWMVFf4uA8ofwj+A8prZwv1xDNlHKWiWoVNt+wzWBhqFEgshTiAsb+ nyeKL1BkDKYUb8fVTat+OtEcpQoRjn2+LUrt6f1hv1R1fKa6bY9alehe0Np3TSQqf9mP zzoy1NZA1WjNWpt2gAifesu1iDenNa2tMiWF7w45EDpbAjztuTR4iIMyDAPhjQCiB6SQ 9tvRaJTfsAk4P7vK/Nuh/Q6irZpNlkN1CvTDuneuQ/5mEryfS2qvf4Ls/YwU35bWYRtD Db8uAVWAYuM5qD0IMjXtyc5O+09JnwjqQNhXJwedI7YenWDU5mSTLMs3fzNvipMv3JXo 5gQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=R3bW5oFz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g4-20020a63e604000000b004ff73120afbsi4187969pgh.103.2023.04.13.23.16.50; Thu, 13 Apr 2023 23:17:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=R3bW5oFz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229895AbjDNGQN (ORCPT + 99 others); Fri, 14 Apr 2023 02:16:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229534AbjDNGQL (ORCPT ); Fri, 14 Apr 2023 02:16:11 -0400 Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 78A395271; Thu, 13 Apr 2023 23:16:07 -0700 (PDT) Received: by mail-ej1-x632.google.com with SMTP id z9so16001153ejx.11; Thu, 13 Apr 2023 23:16:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681452966; x=1684044966; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=SbTsshoRiULEkzwBbQ+pYzOmV8qW1WFmOzv8hcmERH4=; b=R3bW5oFzORH25LIWr6Rg5plNyiNJTBt4KgKmYoJ2EKV6Z+dvmvaGm8n9S60SRjxiYe b0piYWEFo8jkbjnCYJeyVAdQT21K26c65Db46czCaRbusEzE21ycT8kybD0/+A6ICrQc QXzGi2XvyBRZMYbV0yMV+MSz8e+bUcRT6HgInsxtuCnkkiqzu5aLzoNsCYRs0SFQANgW B68p7HMqK3NyvxFlclBgEgJpDgXjCuRbKVs57Mw036ArKdMKDA5DnpjJvO/HvN/nKhoi rJpiBvezc2+XVSeQBcGKAi1Ycowo9f8W27quGoR6wgSWG95ufD4PPs00f4P0Dv5BYmye dO7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681452966; x=1684044966; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=SbTsshoRiULEkzwBbQ+pYzOmV8qW1WFmOzv8hcmERH4=; b=ZWTz9B0CCtLca4zs4Ny5UtvcsHJxyxXjSSDn+UNDEhCApYucacE/0OpYkhWd39GOZw gdkOGvUqDz76F+NVWxQFwKIsf2vD4nALhzHwqwmJooFWt3ZTpsiOt2VPkIkZkq8SAp9D OaSfy9mbcwYgwAd1C+45Uu7rBlPO29bll1ce9J9GbG0gFzQ1Bk/Ho0RMAvULq8+1TIvB zZq5/wKVHjK3nZYaJl9lmu5m9oWZrwvxXvYjRwOnHteCJcXmrGyY1D0mD6VlKOvS5KhL iZDeFiJmUvSLRkkRJ160KDIi9H2w0zyifcDgY2ffDgNICHd4bHEHCGI6i6xXLv6LFUJO czQA== X-Gm-Message-State: AAQBX9fULy0NAnLCzKCpp4AGn3fb1CHm2mT5norJi8sGerEgECPFIG+b WWz1xiY5HN0RzOd9N/5OHLO2Vqg5awKEEumpyzY= X-Received: by 2002:a17:906:9b90:b0:947:9f2a:8ca0 with SMTP id dd16-20020a1709069b9000b009479f2a8ca0mr2583942ejc.10.1681452965680; Thu, 13 Apr 2023 23:16:05 -0700 (PDT) MIME-Version: 1.0 References: <20230327-tegra-pmic-reboot-v4-0-b24af219fb47@skidata.com> <20230327-tegra-pmic-reboot-v4-3-b24af219fb47@skidata.com> <2df6f002-dcf8-1073-d0b5-a9843103096a@collabora.com> In-Reply-To: <2df6f002-dcf8-1073-d0b5-a9843103096a@collabora.com> From: Benjamin Bara Date: Fri, 14 Apr 2023 08:15:54 +0200 Message-ID: Subject: Re: [PATCH v4 3/4] mfd: tps6586x: use devm-based power off handler To: Dmitry Osipenko Cc: Wolfram Sang , Lee Jones , rafael.j.wysocki@intel.com, peterz@infradead.org, jonathanh@nvidia.com, Richard Leitner , treding@nvidia.com, linux-kernel@vger.kernel.org, linux-i2c@vger.kernel.org, linux-tegra@vger.kernel.org, Benjamin Bara Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 13 Apr 2023, 22:37 Dmitry Osipenko, wrote: > Handlers must return NOTIFY_DONE or notifier_from_errno(). Sorry for > missing this previously. Thanks! AFAIU, notifier_from_errno() sets NOTIFY_STOP_MASK, which stops atomic_notifier_call_chain() immediately. So I think NOTIFY_DONE is the only valid return value for sys_off handlers, to not skip others. So I think letting sys_off_notify() [1] always return NOTIFY_DONE might be a good idea. If so, we could return a "notify return errno" (or also a "normal errno") from the handler, which is checked, but then replaced to NOTIFY_DONE, in [1]. This would enable us to have a common place to check for failed handlers. Handlers then should only return NOTIFY_DONE when they are skipped (e.g. when the requested reboot mode is not supported by the handler). Otherwise, I think ETIME, ENOSYS or ENOTSUPP might fit when the communication was successful, a possible delay awaited, but the return was still reached. What do you think? Thanks and best regards, Benjamin [1] https://elixir.bootlin.com/linux/v6.3-rc6/source/kernel/reboot.c#L327