Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp188320rdb; Thu, 30 Nov 2023 01:58:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IGyUFbFQCUyMDXky2C3svw7KgSmGYk/cWkdUDmoY2pIZgh6N6L6n3SAlXQgoAqybULFygCV X-Received: by 2002:a17:903:246:b0:1cf:6c5d:f0c6 with SMTP id j6-20020a170903024600b001cf6c5df0c6mr25816280plh.10.1701338279736; Thu, 30 Nov 2023 01:57:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701338279; cv=none; d=google.com; s=arc-20160816; b=hYnuK+MgscEkMtEpeUVPCB3A05WYgHTXzllSkXUoE+zTy8hIJSK7u4CW1SM2CQ2nE+ oPtE7GwdQ7M/UzcSznt2X2Ah/Qs5JGqk2EGcN6DNJB9rY/OCTY5P13YN9ru20ilCSiiV Ze7Wc/f0fHEXMFlvycUXfOUQ1p9pUFN0aOQk5F59pjt3hAgbhxpnnSM9p5Vi/V+E50Nz UU40e2/SdteOPeqUVomcpcZA0pRtLrW5e3p2r/j3VcXOiaEqCZyI04hb9BXmXUTNcl36 Pxfq3NekErkFiy+E2tEWKm8aFI9Dfq49aX9VnzcCZBCbR53xDa8GViq0ToUTvDyg7WLN 6XOw== 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=0GKUjDUfFZBuJDqMk9wIf5InzkGujvf/hhx2Me3pUVQ=; fh=70d/2pvmmfKw7V9XsDrwn+eYf7PcUwcKXbUpuH4flng=; b=YYJsAOixQRsp7PsibD8Kpd49shB2RiDnHwGD9RB/lAJXNQoVUwuT86Mz80dngNguZd 1rzXFMeOt+DInDaRWFkS1iyCE1J3n9rM7uqsE64xWeKkAZdCA/TdloGaxoI5gJaWT2ht RPgZf9IiR/9YRZ8sEQoyp0dVao6ia8owOX8/zFq5x/o2J54HQAqn+nHy2D1CbYWbbYDh WaWkytU4hw669lstHUggs4O3ixyyPCgzCV7uVsFh2vxEiJ/8ubafoaOQ2Ka6GQ7lTOcD iBJ94TH02mR3Gj56niNTJeFTiajGSS9iSK0F+LUwg3s9vAE+JKyYdYNNUZG6wOy4nQfD ickw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=txRT9eUa; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id q20-20020a170902789400b001cfb2ab4cf6si844559pll.163.2023.11.30.01.57.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 01:57:59 -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; dkim=pass header.i=@linaro.org header.s=google header.b=txRT9eUa; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 249F180C4784; Thu, 30 Nov 2023 01:57:57 -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 S235063AbjK3J5i (ORCPT + 99 others); Thu, 30 Nov 2023 04:57:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231755AbjK3J5h (ORCPT ); Thu, 30 Nov 2023 04:57:37 -0500 Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60CBCD7F for ; Thu, 30 Nov 2023 01:57:43 -0800 (PST) Received: by mail-ej1-x62c.google.com with SMTP id a640c23a62f3a-9fa45e75ed9so99686466b.1 for ; Thu, 30 Nov 2023 01:57:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1701338262; x=1701943062; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=0GKUjDUfFZBuJDqMk9wIf5InzkGujvf/hhx2Me3pUVQ=; b=txRT9eUazb/LNZD1dzq52jBzCMPdwKERBADBkpNSpWV2E7KuZwU6EduBTDZzCuWgPM sEPE9qYxG/3KHQELtTCdw5f69wNSJ6ujfG4qOYx6a2qTZTjwDGAu/kLkitvZjbrYW6hL 8cw7avpJ0Dc9K3a715tgdgsN0OTnKmJzHxolyCrpByti3Bgci1WPZ2SJOjcx5GTjLP6K XMs42w3/RQHnbTW79kxeromhoSERuLh3QfyGIViNvALL/73TGIcpQz6zb9hiPXEA0rDb soSb1oitnBblVgsjjKZMtVssXziSKNeGABBGSs7yagF+neVtIJvLZgrDe70tMeZv6Iqv HaOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701338262; x=1701943062; 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=0GKUjDUfFZBuJDqMk9wIf5InzkGujvf/hhx2Me3pUVQ=; b=bqy5SawSTg3BQQFgfkuE7D9xLdNAvN8B3V/iwGzZh1cC3D4jqLBGAjYtOJJvNxN5I1 OSAfwUWNgaeurff9bsK5LOcY491NW/L7ej3xW06WY1aGYpfopj0NxD4h1TXXbs7ngvUo Uq1Eb/3WOaiF9oTlkbXTNeQUFwCGBMR/Ck7kOweXSN9cOtYeMOWfOwONk8Dwo1lgZ4ND ZgMYR3TmppftGd+oHo+BQz1NcYXfLRldSECS38kCPO5ZLI45zj81Su1oaIqbCX5EK0eX X4qEHqB7x0tfmwbjWCZT+GdyvPwlHKogDw17+NvFDQVTnxepJxKtCr2vhyhXnmR3/54U UXZw== X-Gm-Message-State: AOJu0YwRmdcFQElLaUEe36ATNAWdCRSDLg1IGK0xKIRsggLklYrLBbaR PZbBgKWISZq+rrg6z2ZhmJitv80Dax7v8DaGDOw2ZA== X-Received: by 2002:a17:906:680a:b0:a19:1a0b:edb8 with SMTP id k10-20020a170906680a00b00a191a0bedb8mr134151ejr.67.1701338260873; Thu, 30 Nov 2023 01:57:40 -0800 (PST) MIME-Version: 1.0 References: <20231124145338.3112416-1-o.rempel@pengutronix.de> In-Reply-To: <20231124145338.3112416-1-o.rempel@pengutronix.de> From: Ulf Hansson Date: Thu, 30 Nov 2023 10:57:03 +0100 Message-ID: Subject: Re: [PATCH v1 0/3] introduce priority-based shutdown support To: Oleksij Rempel Cc: Greg Kroah-Hartman , "Rafael J. Wysocki" , Mark Brown , kernel@pengutronix.de, linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, linux-pm@vger.kernel.org, =?UTF-8?Q?S=C3=B8ren_Andersen?= Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,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]); Thu, 30 Nov 2023 01:57:57 -0800 (PST) On Fri, 24 Nov 2023 at 15:53, Oleksij Rempel wrote: > > Hi, > > This patch series introduces support for prioritized device shutdown. > The main goal is to enable prioritization for shutting down specific > devices, particularly crucial in scenarios like power loss where > hardware damage can occur if not handled properly. > > Oleksij Rempel (3): > driver core: move core part of device_shutdown() to a separate > function > driver core: introduce prioritized device shutdown sequence > mmc: core: increase shutdown priority for MMC devices > > drivers/base/core.c | 157 +++++++++++++++++++++++++++-------------- > drivers/mmc/core/bus.c | 2 + > include/linux/device.h | 51 ++++++++++++- > kernel/reboot.c | 4 +- > 4 files changed, 157 insertions(+), 57 deletions(-) > Sorry for joining the discussions a bit late! Besides the valuable feedback that you already received from others (which indicates that we have quite some work to do in the commit messages to better explain and justify these changes), I wanted to share my overall thoughts around this. So, I fully understand the reason behind the $subject series, as we unfortunately can't rely on flash-based (NAND/NOR) storage devices being 100% tolerant to sudden-power failures. Besides for the reasons already discussed in the thread, the robustness simply depends on the "quality" of the FTL (flash translation layer) and the NAND/NOR/etc device it runs. For example, back in the days when Android showed up, we were testing YAFFS and UBIFS on rawNAND, which failed miserably after just a few thousands of power-cycles. It was even worse with ext3/4 on the early variants of eMMC devices, as those survived only a few hundreds of power-cycles. Now, I assume this has improved a lot over the years, but I haven't really verified this myself. That said, for eMMC and other flash-based storage devices, industrial or not, I think it would make sense to try to notify the device about the power-failure, if possible. This would add another level of mitigation, I think. From an implementation point of view, it looks to me that the approach in the $subject series has some potential. Although, rather than diving into the details, I will defer to review the next version. Kind regards Uffe