From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.41 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796124142; b=TU8ClOJZfHEWPMKO3z1Yixwx7C3bE/w9YEC4VXnmagt33Uwl3tCrIVQ5pJmv1ReIqXRQ a36GBkIShCehqg/U5xX3bYlcPAnWpe6a2p1RwyN5V+oXhHQNAdUnULSFEMNSaeTUEUXkt JtOt5fQ64XuYRciLx10RG/+8OVIU6QpqK5GgloZozp6cVw5MdLJTGZ+NhqbRk3snl41Hi 6vNaSc93nO3yKnbbXyDEnCoAjw0xKFQ6Lb43V8fgbmwL5fbJQXW7lhkX9Ius4lpLyf8ZX HIyKCh9lYqN1NvBTikxjyAF+C7k1hPJfY/Arb4wlPmHVOz7RqDnpYdYGuedxsFjf3Cw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796124142; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: From:To:Cc:Subject:Date:Message-ID:X-Mailer:MIME-Version: Content-Transfer-Encoding; bh=+c/+spyfA8XC1K+ixJlKCT6ZljaW8jbxmAckOTjfnA8=; b=4K+MLtRIh48FRx2zC83iJ5k4HqoM0UXxDeUcG4Ktlly0uaWveILTrEqn4xqOMSpL0DqM 5gsgFopVQciE7WS7S/+4ErmawdsO61p6k6sroYBiLnQ+kmLzFvaRI5OFw2JT/8xvifx1E rkxUaKywQCSNO68/dwMNKatC8q/yGa8bXXlpJ+VKd+ICEBAeZO/6bmonEU/WzWWuWKeVp +NzRbdPh6PjQOZuLk4H4ya3Is8ZYSQ0lcpQepNTQTlIusrXZnJNItpINm9PsXDX8vGQXz SO73iQp0o1IzRev3Zo7pUjttzQk/+7c9HzM6LuAvji2kXU3TDpEXq3cRgeu/IF/SaSQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=FkaBkq4R; arc=none smtp.remote-ip=209.85.128.41 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8E397606A327 for ; Tue, 1 Dec 2026 11:22:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 8E397606A327 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=FkaBkq4R Received: by mail-wm1-f41.google.com with SMTP id 5b1f17b1804b1-4a35a60499eso89988455e9.0 for ; Tue, 01 Dec 2026 03:22:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796124141; x=1796728941; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=+c/+spyfA8XC1K+ixJlKCT6ZljaW8jbxmAckOTjfnA8=; b=FkaBkq4R/tuIN0igib2ZCHRK8g18h12EMZHOgmLQSCBlsyg4oO/PRFbqBzatezs4/m O7kvsuawPM6/jCAvS+Y/AHPV5KHn5XWApfG3oKWA3W0Hol8xJzlax99pUUxehvJyIG5y w/X0KHmwXRE3Sn1Ds2k+SiPR0PsZZKOtfdveE+sHvTHy4sjIfPC8dg1mKDzka3cEcqbU VJNeikJ5ybNyMyauCbF/gLjjk//UpLTYyq/rGDgHBNbpRfrp1R70k48VyBnuHPT3yc05 OkrCytmxXgv3/lfNG8vznLuupcw8Y33ODShcOf+K4B3noxEA0uZiK79GZICJ6S6m7+0r a+1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796124141; x=1796728941; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=+c/+spyfA8XC1K+ixJlKCT6ZljaW8jbxmAckOTjfnA8=; b=gHafeorYLm0JXSR8xNX1/r3yUrWwmNsVEsgwtrd6WIa5aQQn4OA2jve+Cqf877BuZT mxCpPgBOItQWqdE5dr5YtkoVsG16kHdnmx23XNe30zKYJz2wi8oNi3pbUpn+BonjGPqt UBjpb4VeswK9a2CBpkMQg2b8Az7r5EH0XgUL0v1LJIs+X6ECuRPZG+iQkcy2iiX1a7Dg XGppkd9pf7JjgBVsbv8w67dcu9Vz0mDYPiCMHXmLnrC7xwlj5KDPi8J+0xl4NvHZOSVJ nW6aMK+gPBmuOzuSlKSSKVyb8JJi2Dp/14IdBY3IsxrLujnupcTYfUBO1IJY18FbUXYU IRFg== X-Forwarded-Encrypted: i=1; AL+hErGwuxInLnQxMOVg5Cpjf4wyixZNpccUluTrzQgrBvml7g6HjuJuapJjYrGARC1XgsqEb+uwsOB2ueKu5IA=@vger.kernel.org X-Gm-Message-State: APuU4Z+Vi9c69bC/wH9fOAstf1YOdznkrxCjUiI5QYkKHhQBZ552U2lw BMPpyUbXYVhucodWFxB8RFjOnNNUSTrO/PJW9nO+hGW9LgPJUmbdCd86u+Ypyg== X-Gm-Gg: AZFdTZeqkVW80DXBCFHVzLbXP4pixmH56UMdpdGmH9EOWGdKJp9dPANWafqCtFpvl8M 6zLdEayLUT7mR5jtGbbAavAxjfH5uR7jeP1GtL6A01GafPENDwJhjSVhw1q9zrfqYgDAxSnZeEK 5qblhqi4DXMBcLw2JktTE145sFxk9sFMWPxBiYmYSEqnfTX2n0QLTpNliPCalpuLVl1TOONNvJd cEuSb/G8ZBSF31NP/scBypkuX5Q629APP4fNvl5DLGzfM/xPA0jw8ZRtbv+7nwOzdNPTEOpKRtU KrKa8yMYhd+MDPz0GbJnu0aCdRGjYLyZiXHIUvq6MNR+zRAWj0K5gE0BOOrH1WV4hDgHI2otzOc fV2oEOmuDUkr1mWmxYJC1huI6/jNRiR6DhZKbkjYP9x232B4lNPCJZv1xJLEd01NeiU6T7oAUzF 41q1FJjqQEeOq0UZvHegYejbBXxv4QJ5nITJgg3AtRE1md9YYk2KvZOR5DweualkQl13vCpOYFT knXg/MYKBMbS9mKTFW7i9t/uRYTItZ2i+gzm41JIgBFsCN/q1CyAIYUUbtKSNWIsFYWkCCvE+Gb srPe4AXrTEXTM0j/KoGB9kPJ3drymZHmayYAwoVJb7kEH0M= X-Received: by 2002:a05:600c:4f4c:b0:4bb:8503:69f4 with SMTP id 5b1f17b1804b1-4bb888097a2mr887926765e9.5.1796124140901; Tue, 01 Dec 2026 03:22:20 -0800 (PST) Received: from localhost.localdomain ([2a04:ee41:4:b2de:1ac0:4dff:fe0f:3782]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bb884911e3sm1240269485e9.6.2026.12.01.03.22.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Dec 2026 03:22:20 -0800 (PST) From: Anton Protopopov To: =?UTF-8?q?Jonathan=20Neusch=C3=A4fer?= , Mark Brown , openbmc@lists.ozlabs.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Anton Protopopov , Bjorn Helgaas Subject: [PATCH] spi: wpcm-fiu: Check the error of the SHM syscon lookup Date: Tue, 1 Dec 2026 11:34:05 +0000 Message-ID: <20261201113408.342584-1-a.s.protopopov@gmail.com> X-Mailer: git-send-email 2.43.0 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The syscon_regmap_lookup_by_phandle_optional() function returns NULL only when the property is missing (-ENODEV). On other errors it returns an error pointer. The wpcm_fiu_probe() function stores it in fiu->shm_regmap and wpcm_fiu_stall_host() checks only for NULL. It passes the error pointer to regmap_update_bits(), which leads to an oops on the first operation. The lookup may fail with a correct device tree too: it returns -EPROBE_DEFER when the hwspinlock of the syscon or the driver which registers its regmap is not probed yet. Return the error from the probe, so that it is retried. Fixes: 1f8811a2613e ("spi: wpcm-fiu: Add driver for Nuvoton WPCM450 Flash Interface Unit (FIU)") Suggested-by: Bjorn Helgaas Signed-off-by: Anton Protopopov --- It's one of three related changes, but for different trees. See https://lore.kernel.org/linux-pci/20261127101915.1348807-1-a.s.protopopov@gmail.com/ This applies to the for-next and for-linus branches of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git drivers/spi/spi-wpcm-fiu.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/spi/spi-wpcm-fiu.c b/drivers/spi/spi-wpcm-fiu.c index 884e5042bad5..6dd77a8de00b 100644 --- a/drivers/spi/spi-wpcm-fiu.c +++ b/drivers/spi/spi-wpcm-fiu.c @@ -464,6 +464,9 @@ static int wpcm_fiu_probe(struct platform_device *pdev) fiu->memory_size = min_t(size_t, resource_size(res), MAX_MEMORY_SIZE_TOTAL); fiu->shm_regmap = syscon_regmap_lookup_by_phandle_optional(dev->of_node, "nuvoton,shm"); + if (IS_ERR(fiu->shm_regmap)) + return dev_err_probe(dev, PTR_ERR(fiu->shm_regmap), + "Failed to look up SHM syscon\n"); wpcm_fiu_hw_init(fiu);