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 342C8C433F5 for ; Thu, 7 Oct 2021 09:11:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 12A11600CD for ; Thu, 7 Oct 2021 09:11:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233489AbhJGJNJ (ORCPT ); Thu, 7 Oct 2021 05:13:09 -0400 Received: from mga03.intel.com ([134.134.136.65]:9876 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231661AbhJGJNH (ORCPT ); Thu, 7 Oct 2021 05:13:07 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10129"; a="226156583" X-IronPort-AV: E=Sophos;i="5.85,354,1624345200"; d="scan'208";a="226156583" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 02:11:13 -0700 X-IronPort-AV: E=Sophos;i="5.85,354,1624345200"; d="scan'208";a="590075333" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by orsmga004-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Oct 2021 02:11:09 -0700 Received: from andy by smile with local (Exim 4.95) (envelope-from ) id 1mYPQg-009Tan-2D; Thu, 07 Oct 2021 12:11:06 +0300 Date: Thu, 7 Oct 2021 12:11:06 +0300 From: Andy Shevchenko To: Dmitry Osipenko Cc: Thierry Reding , Jonathan Hunter , Lee Jones , "Rafael J . Wysocki" , Mark Brown , Andrew Morton , Guenter Roeck , Russell King , Daniel Lezcano , Ulf Hansson , Linux PM , Linux Kernel Mailing List , linux-tegra Subject: Re: [PATCH v1 0/6] Introduce power off call chain API Message-ID: References: <20211007060253.17049-1-digetx@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org On Thu, Oct 07, 2021 at 11:52:46AM +0300, Dmitry Osipenko wrote: > 07.10.2021 10:18, Andy Shevchenko пишет: > > On Thu, Oct 7, 2021 at 9:05 AM Dmitry Osipenko wrote: ... > >> This > >> is a somewhat simplified version which doesn't try to convert whole kernel > >> to the new API at once, but solves immediate practical problem that we > > > > problems > > > >> have on Nexus 7 Android tablet where device needs to chain power off > > > > tablets where the device > > Thank you for the corrections, so far there is one problem and one tablet :) Then use "the Nexus 7 Android tablet" :-) > > Immediate question here is how do you see the plan of spreading this. > > I.o.w. can you put an explanation that you have checked, let's say > >> 80% current users, and they may be converted like [example > > placeholder] without any special tricks? > > The rough plan is: > > 1. Add new API. > 2. Convert drivers to the new API per subsystem. I would suggest to show that you are actually into it by converting a couple of the subsystems for the starter. > 3. Expose do_kernel_restart(). > 4. Replace pm_power_off() with do_kernel_poweroff() per arch/, making > power off similar to the restart that uses do_kernel_restart(). > 5. Remove do_kernel_restart() from kernel/reboot.c > > Majority of pm_power_off() users shouldn't need the chaining and > pm_power_off() doesn't conflict with the new API, so there is no need to > rush the conversion. > > The single-link chain users could be converted to the new API directly, > this will remove some global variables. But at first should be better to > gain more users who actually need the chained power off since they may > have very specific requirements not covered by the current variant of > the API and will be easier to evolve API with less users. All above in one or another form should be in cover letter. -- With Best Regards, Andy Shevchenko