Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp1735386rdh; Sat, 25 Nov 2023 00:51:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IHRbC3eP6L0Jcukf11Ow143YBiMHoVcepsH7IwjGC5XULKbQOZOzjYsMJNy09Edb+3Ludkd X-Received: by 2002:a17:902:f7c6:b0:1cf:5c9b:5c27 with SMTP id h6-20020a170902f7c600b001cf5c9b5c27mr4536726plw.63.1700902273353; Sat, 25 Nov 2023 00:51:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700902273; cv=none; d=google.com; s=arc-20160816; b=jHrs2ICMZ/xEbC0Gh/U4VTNZLmUjw9Y2gkEFmPxURHZhDr3x8IM0wb0stw3+EG/+aH 07pZ1vO5S9JC/EmWPJKy2uJo6Xkt+AKwUVbyx95yUGN/GEJODbJMk6dukbfOs2BmT+9H uviZUVevaZvE6xAKzSyo4ax08fgzjqMIYycjF1XQVp54Ec9V/lUDq7j4odKQSW2VvrRm YH9RtiYVpXKkCxstZYU2+z6fs9sesK85dc292s0M7vJvhu0cos0tW+DCEcuqEVg6Oify 2A4DHdlZwiwvK6QqzG1OB8P/N3wxU0stzOgezNhJZ0k0/8HXPV8LlnwV9GekIkxLoh7l RIBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=Iic6PfyGrp6m8QbXN1Y/ui0eVZTywgputxmqtKR3wdE=; fh=JuSpOt0/tuwyrnJR/DsvvXmjDF7zf36ufFYBMSIItmw=; b=ENIsKWQMS/6+XSH8dk5l4WGPDyjbbdyAqny6r8yKERRgExjb8Ox5DhXlPMFi8OIpUp ETd2xEftWpgWKSOF3ZGUrrO8+OpS9Rl5BQAgYzyuc3CWAkZ++i5kWuzvS5qI883LmCaC 2v5vD8HuGVqa1HT+cWspsugxpPL0RKs0jRftFPs6SW+GkMs92/mTX5+mjaBcEuClu0Cm 05j18THzvr+kIz0gpA45E8u/i/mmV6L0RYHkGbkKQLFVlQ1Ov5fOC7CmUmz9cYln1vDG yICHXT4eVf8sNhplzeiep8Qv74cqxHDVX/EzepfkPdOVzw5XcPnzRBNPoJwvlVmdTiZx yftQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id t8-20020a17090340c800b001cf9a4c9c90si4586194pld.307.2023.11.25.00.51.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Nov 2023 00:51:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 4E695807A5A8; Sat, 25 Nov 2023 00:51:10 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229503AbjKYIut (ORCPT + 99 others); Sat, 25 Nov 2023 03:50:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43574 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231841AbjKYIun (ORCPT ); Sat, 25 Nov 2023 03:50:43 -0500 Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [IPv6:2a0a:edc0:2:b01:1d::104]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A65DE6 for ; Sat, 25 Nov 2023 00:50:48 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1r6oN6-0005Vm-TH; Sat, 25 Nov 2023 09:50:40 +0100 Received: from [2a0a:edc0:2:b01:1d::c0] (helo=ptx.whiteo.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r6oN4-00BS6U-Du; Sat, 25 Nov 2023 09:50:38 +0100 Received: from ore by ptx.whiteo.stw.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1r6oN4-003lCE-Aq; Sat, 25 Nov 2023 09:50:38 +0100 Date: Sat, 25 Nov 2023 09:50:38 +0100 From: Oleksij Rempel To: Greg Kroah-Hartman Cc: Mark Brown , "Rafael J. Wysocki" , Ulf Hansson , kernel@pengutronix.de, linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, linux-pm@vger.kernel.org, =?utf-8?B?U8O4cmVu?= Andersen Subject: Re: [PATCH v1 0/3] introduce priority-based shutdown support Message-ID: <20231125085038.GA877872@pengutronix.de> References: <20231124145338.3112416-1-o.rempel@pengutronix.de> <2023112403-laxative-lustiness-6a7f@gregkh> <2023112458-stature-commuting-c66f@gregkh> <2023112435-dazzler-crisped-04a6@gregkh> <20231124163234.GC819414@pengutronix.de> <2023112453-flagstick-bullring-8511@gregkh> <20231124185725.GA872366@pengutronix.de> <2023112520-paper-image-ef5d@gregkh> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <2023112520-paper-image-ef5d@gregkh> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-Accept-Language: de,en X-Accept-Content-Type: text/plain User-Agent: Mutt/1.10.1 (2018-07-13) X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Sat, 25 Nov 2023 00:51:10 -0800 (PST) On Sat, Nov 25, 2023 at 06:51:55AM +0000, Greg Kroah-Hartman wrote: > On Fri, Nov 24, 2023 at 07:57:25PM +0100, Oleksij Rempel wrote: > > On Fri, Nov 24, 2023 at 05:26:30PM +0000, Greg Kroah-Hartman wrote: > > > On Fri, Nov 24, 2023 at 05:32:34PM +0100, Oleksij Rempel wrote: > > > > On Fri, Nov 24, 2023 at 03:56:19PM +0000, Greg Kroah-Hartman wrote: > > > > > On Fri, Nov 24, 2023 at 03:49:46PM +0000, Mark Brown wrote: > > > > > > On Fri, Nov 24, 2023 at 03:27:48PM +0000, Greg Kroah-Hartman wrote: > > > > > > > On Fri, Nov 24, 2023 at 03:21:40PM +0000, Mark Brown wrote: > > > > > > > > > > > > > > This came out of some discussions about trying to handle emergency power > > > > > > > > failure notifications. > > > > > > > > > > > > > I'm sorry, but I don't know what that means. Are you saying that the > > > > > > > kernel is now going to try to provide a hard guarantee that some devices > > > > > > > are going to be shut down in X number of seconds when asked? If so, why > > > > > > > not do this in userspace? > > > > > > > > > > > > No, it was initially (or when I initially saw it anyway) handling of > > > > > > notifications from regulators that they're in trouble and we have some > > > > > > small amount of time to do anything we might want to do about it before > > > > > > we expire. > > > > > > > > > > So we are going to guarantee a "time" in which we are going to do > > > > > something? Again, if that's required, why not do it in userspace using > > > > > a RT kernel? > > > > > > > > For the HW in question I have only 100ms time before power loss. By > > > > doing it over use space some we will have even less time to react. > > > > > > Why can't userspace react that fast? Why will the kernel be somehow > > > faster? Speed should be the same, just get the "power is cut" signal > > > and have userspace flush and unmount the disk before power is gone. Why > > > can the kernel do this any differently? > > > > > > > In fact, this is not a new requirement. It exist on different flavors of > > > > automotive Linux for about 10 years. Linux in cars should be able to > > > > handle voltage drops for example on ignition and so on. The only new thing is > > > > the attempt to mainline it. > > > > > > But your patch is not guaranteeing anything, it's just doing a "I want > > > this done before the other devices are handled", that's it. There is no > > > chance that 100ms is going to be a requirement, or that some other > > > device type is not going to come along and demand to be ahead of your > > > device in the list. > > > > > > So you are going to have a constant fight among device types over the > > > years, and people complaining that the kernel is now somehow going to > > > guarantee that a device is shutdown in a set amount of time, which > > > again, the kernel can not guarantee here. > > > > > > This might work as a one-off for a specific hardware platform, which is > > > odd, but not anything you really should be adding for anyone else to use > > > here as your reasoning for it does not reflect what the code does. > > > > I see. Good point. > > > > In my case umount is not needed, there is not enough time to write down > > the data. We should send a shutdown command to the eMMC ASAP. > > If you don't care about the data, why is a shutdown command to the > hardware needed? What does that do that makes anything "safe" if your > data is lost. It prevents HW damage. In a typical automotive under-voltage labor it is usually possible to reproduce X amount of bricked eMMCs or NANDs on Y amount of under-voltage cycles (I do not have exact numbers right now). Even if the numbers not so high in the labor tests (sometimes something like one bricked device in a month of tests), the field returns are significant enough to care about software solution for this problem. Same problem was seen not only in automotive devices, but also in industrial or agricultural. With other words, it is important enough to bring some kind of solution mainline. -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |