Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp6218536rwp; Mon, 17 Jul 2023 17:46:00 -0700 (PDT) X-Google-Smtp-Source: APBJJlHgLP6fDmOJzfQz1kRvDwwA91nFJar24KmvHWtzbwNwv/EmVjBz7Jz/aoNC8+sSTfwIXTu4 X-Received: by 2002:a17:906:3f57:b0:94f:449e:75db with SMTP id f23-20020a1709063f5700b0094f449e75dbmr10089217ejj.52.1689641159915; Mon, 17 Jul 2023 17:45:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689641159; cv=none; d=google.com; s=arc-20160816; b=QiXdbiFxdKUtv/3R0tp7SwOGkQdnsxaHO7GU02zCYDjahOG5bTuNuXgROVPhUNivRz pmOBzqmuEsoJI1Uhk60o/DfIG+6HE9vwQG09gUZDuYtJcqwEIJ2ACX/cthJSg9s0fPJ4 FjiwGOyPYQBIkO66z6cxSQWP27t63mHog4noJYuKXmd7cr7TSoeUvjs54JZq76aEDH+X NqM+V4Th4WnUlLpoKBEmhr7U1QPpe0pOAWWenwcKEfK89e79K5FiYfby00B4S/q6l27D BZy0+CNAtPIn/G8dhBsFMApV81Y3yai3TqerjbMo89X8Ef6IeMysUDvyiR5QBkQEMMC+ OECw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=nDZgTVBOtrhe4zyB3l0viMZQTIRr5Hbt8Gnmm5i7wY8=; fh=4NUA3EU+ewPrTVhtHUaWhxyAZIZ31OnkuH01FrG8524=; b=jEBJjHynrZD9Me58kIUk4eZ76hsT9wr4CcrxEvO5ACsL3nPUHy10bR/Ysmcjf/XVAR i7woPVQWx2PjansRdc73v6bJWMCEisWcaBDUArPKolSV+XwxBGk5OID4/ICZtPI2FQOe UQBxUggJPnakZHP5Jlv+3ooLfCkXU8J+X3QFSNkvhD80c5HcZ5xdnujaPQB0ardNj9nS RVVWxr1CUT0JQBo1yU7q5fdB4Tz3EuALAL8SZSyxFJNmwnNCY/KwvM6HcrmiHF/EVuNd PQSCnMR67fEAFcmgCHAa/9/ZkksebZ4x40Dm0NcAqn0gK/NUNPE/7Cg3mpJIOAGl370n Zv/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=bqzqjgWX; 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=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p14-20020a17090628ce00b00991e6951c1bsi388878ejd.423.2023.07.17.17.45.36; Mon, 17 Jul 2023 17:45:59 -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=@chromium.org header.s=google header.b=bqzqjgWX; 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=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230264AbjGQXsl (ORCPT + 99 others); Mon, 17 Jul 2023 19:48:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230203AbjGQXsj (ORCPT ); Mon, 17 Jul 2023 19:48:39 -0400 Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 757F99D for ; Mon, 17 Jul 2023 16:48:34 -0700 (PDT) Received: by mail-ed1-x532.google.com with SMTP id 4fb4d7f45d1cf-51e55517de3so2708a12.1 for ; Mon, 17 Jul 2023 16:48:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1689637713; x=1692229713; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=nDZgTVBOtrhe4zyB3l0viMZQTIRr5Hbt8Gnmm5i7wY8=; b=bqzqjgWXG+sKHODPCAsrIzOXoVhSTwy8eIidM58WKz1RRXy8oGdhAx0HlptaSQD8ty JbQHOOJKm5IPoMTeVUVID8ijeDdlZkOgB9W4u/PhoyWEyzsMJreZbh/mh49nUd+TX/Nf AMwRVEJ8iiw/TwSvjVph4FV3V04JpMM3ABpmQ= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689637713; x=1692229713; h=content-transfer-encoding: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=nDZgTVBOtrhe4zyB3l0viMZQTIRr5Hbt8Gnmm5i7wY8=; b=Cv0kp8MxBwwBPWqleiG+aBR/O/9vDOp4FEza0j9eUJcEcbeXatQFVm9rQQVopDEOKt 0Ej1zGp9qvPFybshU0w9C2yjy1TLp82f8LdAl3wLsC/ZwG3AL2xNMQPyAuri3tePi7d8 FsuOq3Oz9iCCzJHxexuwIsQJ9UegJhdbQk1hlQr+oyboZf1kmcT4tl89UAwD2a9YxAOj Jfsy8tzMTHKVBg4BJ5V7hvhjN9D7NROok/+jNl3bhT6sz/w3ULBfPK+UP0X3kZTeyp5M I+RSxz8axWUrViIXd/aghO7unEB0vHBY5t0eRZ3CQXfpudVtj9IsD0mC63SLkqpj1CkT HFiA== X-Gm-Message-State: ABy/qLbcV549NpTFqQ0ewEIpmn9Y29z5Mkz2hhNRVEl/Y+UEu6f0P3PT lkyGJxtu8W7Urm4ufkmuKLkke1DyJMrN/oDzUH6oJg== X-Received: by 2002:a50:9fa3:0:b0:51d:e2d4:3d43 with SMTP id c32-20020a509fa3000000b0051de2d43d43mr22758edf.7.1689637712765; Mon, 17 Jul 2023 16:48:32 -0700 (PDT) MIME-Version: 1.0 References: <20230717232932.1.I361812b405bd07772f66660624188339ab158772@changeid> In-Reply-To: <20230717232932.1.I361812b405bd07772f66660624188339ab158772@changeid> From: Benson Leung Date: Mon, 17 Jul 2023 16:48:19 -0700 Message-ID: Subject: Re: [PATCH] drivers/cros_ec: Emergency sync filesystem on EC panic To: Rob Barnes Cc: pmalani@chromium.org, chrome-platform@lists.linux.dev, briannorris@chromium.org, Guenter Roeck , linux-kernel@vger.kernel.org, Tzung-Bi Shih Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-9.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_SPF_WL autolearn=no 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 Hi Rob, On Mon, Jul 17, 2023 at 4:29=E2=80=AFPM Rob Barnes w= rote: > > Perform an emergency filesystem sync when an EC panic is reported. An > emergency sync actually performs two syncs internally in case some > inodes or pages are temporarily locked. > > hw_protection_shutdown is replaced for a few reasons. It is unnecessary > because the EC will force reset either way. hw_protection_shutdown does > not reliably sync filesystem before shutting down. emergency_sync is not > synchronous so hw_protection_shutdown may interrupt emergency_sync. > > Signed-off-by: Rob Barnes Reviewed-by: Benson Leung > --- > > drivers/platform/chrome/cros_ec_lpc.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/platform/chrome/cros_ec_lpc.c b/drivers/platform/chr= ome/cros_ec_lpc.c > index 500a61b093e47..9652fc073c2a4 100644 > --- a/drivers/platform/chrome/cros_ec_lpc.c > +++ b/drivers/platform/chrome/cros_ec_lpc.c > @@ -327,8 +327,8 @@ static void cros_ec_lpc_acpi_notify(acpi_handle devic= e, u32 value, void *data) > dev_emerg(ec_dev->dev, "CrOS EC Panic Reported. Shutdown = is imminent!"); > blocking_notifier_call_chain(&ec_dev->panic_notifier, 0, = ec_dev); > kobject_uevent_env(&ec_dev->dev->kobj, KOBJ_CHANGE, (char= **)env); > - /* Begin orderly shutdown. Force shutdown after 1 second.= */ > - hw_protection_shutdown("CrOS EC Panic", 1000); > + /* Force sync the filesystem before EC resets */ > + emergency_sync(); > /* Do not query for other events after a panic is reporte= d */ > return; > } > -- > 2.41.0.255.g8b1d071c50-goog > --=20 Benson Leung Staff Software Engineer Chrome OS Kernel Google Inc. bleung@google.com Chromium OS Project bleung@chromium.org