Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EBE6AC433F5 for ; Wed, 15 Sep 2021 06:24:13 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 42CF460F5B for ; Wed, 15 Sep 2021 06:24:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 42CF460F5B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.ozlabs.org Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4H8VY72BsHz2ymw for ; Wed, 15 Sep 2021 16:24:11 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ellerman.id.au header.i=@ellerman.id.au header.a=rsa-sha256 header.s=201909 header.b=J32fU4DM; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=ellerman.id.au (client-ip=2401:3900:2:1::2; helo=ozlabs.org; envelope-from=mpe@ellerman.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ellerman.id.au header.i=@ellerman.id.au header.a=rsa-sha256 header.s=201909 header.b=J32fU4DM; dkim-atps=neutral Received: from ozlabs.org (ozlabs.org [IPv6:2401:3900:2:1::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4H8VXQ5qD4z2xtg for ; Wed, 15 Sep 2021 16:23:34 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ellerman.id.au; s=201909; t=1631687007; bh=OX7xdhXw/LWS+De8xHfJMHgXWTkdXqPckzGpuA4qs94=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=J32fU4DM+haP8inBOJO9ih1/rd27GQR5D6yNMUYCOF36iYFoPOiUNXIauZQV7ZTq0 LmHJIQMsGh2uc1qwUSaOjHtJAgInyGlLdbNmJ26A6alj8ep0XJvVOuSBExGtnDcKC6 EyZA7LSrlouE6pxSTHlEA1TBEePxzHFfIPxXY4oXo/sJquXoYpChcTsNPoR92/LFDI KjSKRhCU+JyMZL5CffwEkHE+o0dwYoP53Hdwl5qK0+PDYX2TKSkEzCsAe009iJWAku KVTIctSoo5isdkg84mMJnOjhvKjTg3kS19gbcRuV+bKtBfzmreGMXloRR1lQv0vnQB oiqrPw/WcK2qA== Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4H8VXH63QRz9sQt; Wed, 15 Sep 2021 16:23:27 +1000 (AEST) From: Michael Ellerman To: Vasant Hegde , linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH] powerpc/powernv/flash: Check OPAL flash calls exist before using In-Reply-To: <20210914101630.30613-1-hegdevasant@linux.vnet.ibm.com> References: <20210914101630.30613-1-hegdevasant@linux.vnet.ibm.com> Date: Wed, 15 Sep 2021 16:23:24 +1000 Message-ID: <87ilz2jr1f.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Vasant Hegde Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" Vasant Hegde writes: > Currently only FSP based powernv systems supports firmware update > interfaces. Hence check that the token OPAL_FLASH_VALIDATE exists > before initalising the flash driver. > > Signed-off-by: Vasant Hegde > --- > arch/powerpc/platforms/powernv/opal-flash.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/arch/powerpc/platforms/powernv/opal-flash.c b/arch/powerpc/platforms/powernv/opal-flash.c > index 7e7d38b17420..05490fc22fae 100644 > --- a/arch/powerpc/platforms/powernv/opal-flash.c > +++ b/arch/powerpc/platforms/powernv/opal-flash.c > @@ -520,6 +520,10 @@ void __init opal_flash_update_init(void) > { > int ret; > > + /* Firmware update is not supported by firmware */ > + if (!opal_check_token(OPAL_FLASH_VALIDATE)) > + return; > + That will mean the following files no longer appear on BMC systems: /sys/firmware/opal/image /sys/firmware/opal/validate_flash /sys/firmware/opal/manage_flash /sys/firmware/opal/update_flash Presumably those files don't actually work correctly, but are we sure their mere existence isn't used by anything at all? We've had trouble in the past where removing sysfs files breaks tools unexpectedly, see smt_snooze_delay. cheers