Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3076926pxb; Mon, 24 Jan 2022 01:44:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJwE+D4LscZG/zzB6gv/GOEZrS+SENVD7Nh9FqK0p3gmZubWa6+colry0T4YemYpMH23HIcX X-Received: by 2002:a17:90b:3a8b:: with SMTP id om11mr1079742pjb.176.1643017442504; Mon, 24 Jan 2022 01:44:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643017442; cv=none; d=google.com; s=arc-20160816; b=05AboeqRgWPu89UR0LO6EplKxsH43cFscbGKuTiR/9nMNfyL9FdOrxBKPebqvalqmR Jgnineh/tTgoQV78HORLqJkdF6XTSVWD9x2KatDN0nGUpVUagTX15abxY+vQ+GJT4dwp TJPXipwWIMn2r4wiBBD3fdT2k3yxnCASazjztJkxPHOhPahUAsqoP7EwIZIHSZ4vRGI2 BK/6jNJWmA2+s2lw/aayg/M7VCUdTO6YchoXqceqqWnHTiKt8cElvU7F4oQG6fbwXRCZ PJpcT8xSpadpgBAM/b2p9/hO+A5yi1ljhqx7SRecPIUHc9hHVpCFxJrMlH5GL1omrPGe r59Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=eqfk7nAEFDYpzfZw9/C2PdZvMCAN2E4OZwrdSzMIfgc=; b=Uylu3dELiIsQg1v1tIyWTnZzf4mxGJJG3ICUy0UybM3HNGReOwvKi3zS5nOqxLns5i hckOH2gGJx1Hz2kfq76QlDy9DNpDwERb15Tz8xZMRATQaZo3Gy7Nlh87aROrFC7KhuUc /e7k8a5ZvShhNrxWXORESwfnRyi5eM7Y7utXNNgPzzYnX1TArlbLlDytni51wI+2pirG kTtcVjrHfOXLYSaWJ0e+3z4kjJR/9o7F+jp9gY9/O0B1cyhYFMVq+pbaifHapoFh1Mfv XfmSbfoVw9tfRxMfH4iA5AUJycJRY43knUdAPwJVcmX9d/0MbYg07fkMyntWOL6jdULy tMFw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l11si6901871pga.8.2022.01.24.01.43.51; Mon, 24 Jan 2022 01:44:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237896AbiAWPjh (ORCPT + 99 others); Sun, 23 Jan 2022 10:39:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237892AbiAWPjc (ORCPT ); Sun, 23 Jan 2022 10:39:32 -0500 Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::227]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 052F7C06173B for ; Sun, 23 Jan 2022 07:39:30 -0800 (PST) Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id CE7CA20004; Sun, 23 Jan 2022 15:39:24 +0000 (UTC) From: Miquel Raynal To: Patrick Williams , Tudor Ambarus , Michael Walle , Pratyush Yadav , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Joel Stanley , Andrew Jeffery Cc: Potin Lai , linux-mtd@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-aspeed@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mtd: aspeed-smc: improve probe resilience Date: Sun, 23 Jan 2022 16:39:24 +0100 Message-Id: <20220123153924.673172-1-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20211229143334.297305-1-patrick@stwcx.xyz> References: MIME-Version: 1.0 X-linux-mtd-patch-notification: thanks X-linux-mtd-patch-commit: b'7f852ec58af6ce8d7c6fc799b82d45d76e4bd994' Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2021-12-29 at 14:33:33 UTC, Patrick Williams wrote: > The aspeed-smc can have multiple SPI devices attached to it in the > device tree. If one of the devices is missing or failing the entire > probe will fail and all MTD devices under the controller will be > removed. On OpenBMC this results in a kernel panic due to missing > rootfs: > > [ 0.538774] aspeed-smc 1e620000.spi: Using 50 MHz SPI frequency > [ 0.540471] aspeed-smc 1e620000.spi: w25q01jv-iq (131072 Kbytes) > [ 0.540750] aspeed-smc 1e620000.spi: CE0 window [ 0x20000000 - 0x28000000 ] 128MB > [ 0.540943] aspeed-smc 1e620000.spi: CE1 window [ 0x28000000 - 0x2c000000 ] 64MB > [ 0.541143] aspeed-smc 1e620000.spi: read control register: 203b0041 > [ 0.581442] 5 fixed-partitions partitions found on MTD device bmc > [ 0.581625] Creating 5 MTD partitions on "bmc": > [ 0.581854] 0x000000000000-0x0000000e0000 : "u-boot" > [ 0.584472] 0x0000000e0000-0x000000100000 : "u-boot-env" > [ 0.586468] 0x000000100000-0x000000a00000 : "kernel" > [ 0.588465] 0x000000a00000-0x000006000000 : "rofs" > [ 0.590552] 0x000006000000-0x000008000000 : "rwfs" > [ 0.592605] aspeed-smc 1e620000.spi: Using 50 MHz SPI frequency > [ 0.592801] aspeed-smc 1e620000.spi: unrecognized JEDEC id bytes: 00 00 00 00 00 00 > [ 0.593039] Deleting MTD partitions on "bmc": > [ 0.593175] Deleting u-boot MTD partition > [ 0.637929] Deleting u-boot-env MTD partition > [ 0.829527] Deleting kernel MTD partition > [ 0.856902] Freeing initrd memory: 1032K > [ 0.866428] Deleting rofs MTD partition > [ 0.906264] Deleting rwfs MTD partition > [ 0.986628] aspeed-smc 1e620000.spi: Aspeed SMC probe failed -2 > [ 0.986929] aspeed-smc: probe of 1e620000.spi failed with error -2 > ... > [ 2.936719] /dev/mtdblock: Can't open blockdev > mount: mounting /dev/mtdblock on run/initramfs/ro failed: No such file or directory > [ 2.963030] MTD: Couldn't look up '/dev/mtdblock': -2 > mount: mounting /dev/mtdblock on run/initramfs/rw failed: No such file or directory > > Mounting read-write /dev/mtdblock filesystem failed. Please fix and run > mount /dev/mtdblock run/initramfs/rw -t jffs2 -o rw > or perform a factory reset with the clean-rwfs-filesystem option. > Fatal error, triggering kernel panic! > [ 3.013047] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000100 > > Many BMC designs have two flash chips so that they can handle a hardware > failure of one of them. If one chip failed, it doesn't do any good to > have redundancy if they all get removed anyhow. > > Improve the resilience of the probe function to handle one of the > children being missing or failed. Only in the case where all children > fail to probe should the controller be failed out. > > Signed-off-by: Patrick Williams Applied to https://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git mtd/next, thanks. Miquel