From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 437E13D812C for ; Thu, 23 Apr 2026 23:04:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776985469; cv=none; b=cod7Y6D7aN0+IYzOAaeMOXai6UF5nIWoy/U5W29cP3qh8qIJLIeS/EnkDxXErbxYZxvErjUrIbnHdFaIiqzD6YVjc5cJMK56+/5I0AE0ejfEOlJAt66i69twBRh0t1i5pSGOY6mYQR+HFvEXEOTRqqPGYtvisvWJV2MeTH40njU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776985469; c=relaxed/simple; bh=2K5W+DeoSAgIGSXPuf5OIFDLzAS3TzoiorNSKxhGorI=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=DtFSSUgMYMrK1H2LMFq4eCpDpCDaTb0nkqillcS//DH/oBWm8WhkDgBLQL9zkgsLtkzYpSl5MhaZoSF4JMkALJnldqvhVCY2IkRhECF9JhGAELX/nr1wB5OcRHiI+GSW/gNLV9UQcnMuLLSs0xKLsW49lFA6U+lK+PHKRrh24M4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Z4OgTslK; arc=none smtp.client-ip=209.85.167.41 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.b="Z4OgTslK" Received: by mail-lf1-f41.google.com with SMTP id 2adb3069b0e04-5a402dea4a5so7711463e87.2 for ; Thu, 23 Apr 2026 16:04:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776985466; x=1777590266; 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; bh=w9RlDzCHwvVoLD/T1N26pKp2/i9mgbsKP9KFqAoWnRc=; b=Z4OgTslKEdqAZ9n7DvmNBaMjbNx8tN29ilbosYBtFHjoUC97Og85RS3TG+0K37QVtr GGYb6/f9a9bh/T0RDNW6WnIR953P6mofi/U/Rv0HK81G935pT6bCs1bcMrS4M+qFOAli mj3iklNkikHuF/Smfo4SXd8zawPugJ9d3JVkzG6/U8bjWqinnQDRW47rciA9+jlrUzj7 zF7cxvGCmLbk9vyeZ383lZRNFNyGccNz/HZqLpqeVmEyBOIub6fLkQG8aXDSPWl6+YpG YWP/BCu0hnU0m/2+eDOG/9TwmzbeXFCgMiGGRyiqHCf3QlIRF3kvScncjIoGAnv6KcJO jclg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776985466; x=1777590266; 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; bh=w9RlDzCHwvVoLD/T1N26pKp2/i9mgbsKP9KFqAoWnRc=; b=FCjZY4AYB7L8SuJiGqzhsZst1SB/5bVaw5RnrjiQwXk0AH1c4QsB6pZnougzJwBvN0 4sKfVlR7+Om5b7gyhE5FqOZobC6CW1j/OoVPOdGBVEWkIgo0ts30bc/FZ4vQs3QFukQD 086V7Qagmt3Bj+5lT3Vzraskxu1OC5cRryGBKK8nR5MgfZjFIH6c2zLwx+CHiLBYO397 zYLEQWsdOtzuPo11GL74j/nfIvieuEWj5abhPx9A7dc+Jr3H0AqcLCljaWcEkkxvUMfb /oRq9hZaC6O8wTWVo2CQBdobYvlKB8dKwElDQMTF5wnm4yaXlLHJXWOZNjYVlXErFPOv qr3g== X-Gm-Message-State: AOJu0YxJNc1ar1vhg1TASTn1Yeec23K0RLgQtb/cZUrrXuZyDkzkZBVw BeR1WYBnVMjiLUrd4Xr5AUoblJ4jSi7BYlzYNLfrDn5xnPMNuAWEHezv1mpBxZFj X-Gm-Gg: AeBDiesFwiq6EFcxLNHZ1zhjw6qcwzTwBTCUnEdxy1biPVIAz/U1ut9q4UQYc5WY8Wk Eal4+O/3qhF9Qa8epVXKGqaGVKWDNfvbzy0+lQHjXN1pqE5UA2xUQp9S/JuHvEDJwMZeHDtxk1D s1F9f/DcdHUHLdYtgZ1Ao28J/buNkuz84sq5xVVWSkDikx0LQSUrU1xJP7oLc1Pkx+wLp2GEqKR Z0Xkbv/PEDExpLIL3l28iYbULAD2oaJ/v66gacik3WV27udhiGj/btlHp1imqIgUbgO0rFQsrY9 nsGqOnpAhry9j8C+lrfbvtpNJBretfRS2rVNFllTUimXAxDiZFsW6e9B8ERiDeOMXmO2pp59hhZ XdJGWHgKEeqGCvSYe6mQe1/eOtGm6CHTUqy/kTceO/m1L6weVnWTdymxdDfu5OCUNPYpML4zW6S qhyRr2+464+NRIIO2b0am0Gaa7bdtqIXV9e5Bt70JvuLt7eXGEmvA/dxFQ X-Received: by 2002:a05:6512:1282:b0:5a4:6f5:6c4e with SMTP id 2adb3069b0e04-5a4172d389fmr11928940e87.19.1776985465575; Thu, 23 Apr 2026 16:04:25 -0700 (PDT) Received: from wpc (host-95-152-45-178.dsl.sura.ru. [95.152.45.178]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5a4185bc58fsm5567888e87.30.2026.04.23.16.04.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Apr 2026 16:04:25 -0700 (PDT) From: bigunclemax@gmail.com To: linux-kernel@vger.kernel.org Cc: Martin Botka , Andre Przywara , Krzysztof Kozlowski , Maksim Kiselev , Philipp Zabel , Yixun Lan , Linus Walleij , Bartosz Golaszewski , linux-riscv@lists.infradead.org, spacemit@lists.linux.dev, linux-gpio@vger.kernel.org Subject: [RFC PATCH 0/1] reset: gpio: Add support for GPIO providers with #gpio-cells=3 Date: Fri, 24 Apr 2026 02:03:34 +0300 Message-ID: <20260423230338.442497-1-bigunclemax@gmail.com> X-Mailer: git-send-email 2.51.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Maksim Kiselev Hello everyone, A little background. I have a BigTreeTech CB1 board based on the Allwinner H616. I decided to try upstream Linux v7.0 and ran into the following issue: [ 0.453297] pwrseq_simple wifi-pwrseq: error -ENOENT: reset control not ready [ 0.460472] pwrseq_simple wifi-pwrseq: probe with driver pwrseq_simple failed with error -2 This error prevents the WiFi chip from coming up. I started investigating and traced it down to the function __reset_add_reset_gpio_device() in drivers/reset/core.c: /* * @args: phandle to the GPIO provider with all the args like GPIO number */ static int __reset_add_reset_gpio_device(const struct of_phandle_args *args) { struct property_entry properties[3] = { }; unsigned int offset, of_flags, lflags; struct reset_gpio_lookup *rgpio_dev; struct device *parent; int id, ret, prop = 0; /* * Currently only #gpio-cells=2 is supported with the meaning of: * args[0]: GPIO number * args[1]: GPIO flags * TODO: Handle other cases. */ if (args->args_count != 2) return -ENOENT; As you can see, a GPIO from controller where #gpio-cells != 2 will cause an error. Unfortunately, the Allwinner pinctrl is one such GPIO controller. It uses three arguments to describe a GPIO line: bank, number, and flags. Here’s the DT fragment that describes wifi_pwrseq in arch/arm64/boot/dts/allwinner/sun50i-h616-bigtreetech-cb1.dtsi file: wifi_pwrseq: wifi-pwrseq { compatible = "mmc-pwrseq-simple"; clocks = <&rtc 1>; clock-names = "ext_clock"; reset-gpios = <&pio 6 18 GPIO_ACTIVE_LOW>; /* PG18 */ post-power-on-delay-ms = <200>; }; Potentially this problem could also be observed on other GPIO controllers: spacemit,k1-gpio, microchip,sparx5-sgpio, and many allwinner,___-pinctrl variants. I attempted to make a patch for reset/core.c (not pretty in my opinion) that adds support for three-args GPIO phandles. But it seems I’ve fallen down a rabbit hole, because next I hit the fact that gpiolib-swnode expects GPIOs to be described with exactly two arguments (swnode_gpio_get_reference()). I also did a git bisect to find when wifi_pwrseq broke for the BigTreeTech CB1. It turned out to be commit 73bf4b7381f7 ("mmc: pwrseq_simple: add support for one reset control") in v6.13-rc1. So, in theory, a patch to pwrseq_simple.c could be made to fix my issue, but that wouldn’t solve the underlying reset-gpio problem. I don’t know how to proceed from here and I’m asking for advice. Best regards Maksim Maksim Kiselev (1): reset: add support the GPIO provider with #gpio-cells=3 drivers/reset/core.c | 33 +++++++++++++++++++++++---------- 1 file changed, 23 insertions(+), 10 deletions(-) -- 2.51.0