Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp7167081ybn; Mon, 30 Sep 2019 09:35:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqzHg5YsHeAvq3nRrZ8qDHi84iJ1xReSbE7L6f8cpiVH6Z91S2ymh/OmLKTbLzvLRI9SCInP X-Received: by 2002:a50:e691:: with SMTP id z17mr20785372edm.84.1569861344247; Mon, 30 Sep 2019 09:35:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569861344; cv=none; d=google.com; s=arc-20160816; b=tf7/oOIbiAT3rFVw4J4J7m5yhNSyiYesYbcl13KqOgFOVN4owJGoaP7l4RcuboSzQF 0nNv4nJz6MZ1JR20SRDMjTkEonGr0h9oOx3Er/asjdSnDvNVkq0fRP/bu3lDvtsunYl3 XO0g01k20Wj43WVS8p4KpShP3SMEgP+j2qLPF6uE20lnsZR6rbVe2hZhZAKRoUzUJhp/ LQfH9aP9hxVEO9n0Z64d5wUfhsSMFXylRykzcU7bUoFeqPEz5iwLkYNX7tjn/dz5XVWz fcLIqiiMpyHcDso1T01PhsjPD1ZmesJ+zT5GxjLa/TwgVzM5z4WXpvoEvdQG4Lzlp/25 h/zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=qZmq/vZ1uF91H9zblUBrI03dFEWUTL8yzpnf7lGHSRA=; b=oDHw7df0P3Q1JJdkAyKSf0jho6gVTC1rFWyAxBlqx/LaTG4SJ0lUSXqLpK8bb5SqeY Fl3WhQsJXKFw2pM6gZv1kfUwk+4Visji7z/RidThMZRGnOcllLwlEXfqAWWjWPdy8ba+ ZarCck00UGAMsC0X6oOmsexQ3K+YHC++m6f5h+JzR8Uo+iDwe6AiP/WJj0l+r68Qkszk SIN4sHjlgU1fv6SnQu0OLZV1rTzkhI+YOabIUWT3c+9DYjCRTfsLnDBJy3tokjGhc2DL BqVWIqv4y1j30z5/4N+7XzDTvcNkga9DUOEBKNYHcCCAwfm8Ds+i+rrPSqDoYj7KkazD Y2SQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@lunn.ch header.s=20171124 header.b=1YJGbspz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z7si8240767edi.318.2019.09.30.09.35.18; Mon, 30 Sep 2019 09:35:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@lunn.ch header.s=20171124 header.b=1YJGbspz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732244AbfI3QcN (ORCPT + 99 others); Mon, 30 Sep 2019 12:32:13 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:54770 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727767AbfI3QcN (ORCPT ); Mon, 30 Sep 2019 12:32:13 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=qZmq/vZ1uF91H9zblUBrI03dFEWUTL8yzpnf7lGHSRA=; b=1YJGbspzHZXDVLB+IPjixtBnBF 78wyiJv87Tac5ug/oS1uaZGWCAAU7IUysBIBn7IfosmXCBnwwLGZv5jV/3fVNxx5pzgcktZZwmvQ8 Buks5BBHmGfeAQGLrYVXGcDleNsAXg2DKjDwa/X6PzEOq2cyIvXWW/y5nDWXuj2A1+nI=; Received: from andrew by vps0.lunn.ch with local (Exim 4.92.2) (envelope-from ) id 1iEyah-0004oW-L2; Mon, 30 Sep 2019 18:32:03 +0200 Date: Mon, 30 Sep 2019 18:32:03 +0200 From: Andrew Lunn To: Oleksandr Suvorov Cc: "linux-kernel@vger.kernel.org" , Marcel Ziswiler , Jamie Lentin , "linux-pm@vger.kernel.org" , Igor Opaniuk , "devicetree@vger.kernel.org" , Sebastian Reichel , Rob Herring , Mark Rutland Subject: Re: [PATCH 0/2] This patch introduces a feature to force gpio-poweroff module Message-ID: <20190930163203.GC15343@lunn.ch> References: <20190930103531.13764-1-oleksandr.suvorov@toradex.com> <20190930121440.GC13301@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 30, 2019 at 02:11:59PM +0000, Oleksandr Suvorov wrote: > Hi Andrew, > > On Mon, Sep 30, 2019 at 3:16 PM Andrew Lunn wrote: > > > > On Mon, Sep 30, 2019 at 10:35:36AM +0000, Oleksandr Suvorov wrote: > > > to register its own pm_power_off handler even if someone has registered > > > this handler earlier. > > > Useful to change a way to power off the system using DT files. > > > > Hi Oleksandr > > > > I'm not sure this is a good idea. What happens when there are two > > drivers using forced mode? You then get which ever is register last. > > Non deterministic behaviour. > > You're right, we have to handle a case when gpio-poweroff fails to > power the system off. Please look at the > 2nd version of the patchset. > > There are 3 only drivers that forcibly register its own pm_power_off > handler even if it has been registered before. > > drivers/firmware/efi/reboot.c - supports chained call of next > pm_power_off handler if its own handler fails. > > arch/x86/platform/iris/iris.c, drivers/char/ipmi/ipmi_poweroff.c - > don't support calling of next pm_power_off handler. > Looks like these drivers should be fixed too. > > All other drivers don't change already initialized pm_power_off handler. > > > What is the other driver which is causing you problems? How is it > > getting probed? DT? > > There are several PMUs, RTCs, watchdogs that register their own pm_power_off. > Most of them, probably not all, are probed from DT. And which specific one is causing you problems. I don't like this forced parameter. No other driver is using it. Maybe we should change this driver to support chained pm_power_off handlers? Andrew