From nobody Fri Apr 3 11:10:05 2026 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 387BE1EB5F8 for ; Fri, 20 Feb 2026 19:47:31 +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=1771616852; cv=none; b=usJ39bZSeKFjnOddWg+KHMAZe6iLEc4nWJK5H2ijeQHJSfQKHmnc+VURk34JAwW0+bGTOtkurI5VMZKJzG7L299O6Z54+v06gOOPEVQfn5yXq0w5FnrvC6x+J4G/yBD+xWINNLQUZemQ49WkOXtRi9ZRBwInWt0vGRg0w7UWgu8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771616852; c=relaxed/simple; bh=0G4KFfYK1+YXwVEigy9PGfxDtl6ONA/O/odMVh65a1w=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=JBGy7IMXerJ7sx6ZS80e0B0DVGeuetzCc7LW5cGiaqDTRTEF+Llxz5OagmUyChnZrsupExAjqnjNWYyB0YI3xhv2U9ptKXCuVXEvFmTD7vI1yE/QyL2EuOchobrNj1so7Or/HLvVMtV6huJXaHRaR4l2sIAd9rFTLDdeCmqPf4Y= 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=aov4icyP; 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="aov4icyP" Received: by mail-lf1-f41.google.com with SMTP id 2adb3069b0e04-59e63b427aaso2643390e87.2 for ; Fri, 20 Feb 2026 11:47:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1771616849; x=1772221649; 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=5Owyf7V4DSAu+UKDutdINA5uU1OgJ5uFzzkQ0lvvCGc=; b=aov4icyPIQ25wscXvqYR8XSzT8nshExy7O5xamJCJLp5zqPWCvhw7uMzd0cnO0vB9C l7IbyKFuD1aubDGsRPDTsEP9aUTOtV/b5kuZq2rc/ngxuiHgYl4H2luoISUqlnXbbXoK 5VC9iFcTGShDw7SiLRvQIhc/tYO5YOZuQ5Ph/pIlQJHjcjJcLsrLp7RFBSvQ/OnGDJvh BSslnuMKIPRsttx0GAVOm5uhJ3iw+TSEVvNJhdXgABqEIq5c2Gpnk2LrjCxVWjQwC4y8 AVu9IAvKXsFft/IFaU3Bd0qL6XpfpCcVfbosHGgVIbxym2EL+B1NkdZvZffU0jOiEPMU 9uFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771616849; x=1772221649; 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=5Owyf7V4DSAu+UKDutdINA5uU1OgJ5uFzzkQ0lvvCGc=; b=aPbTbj4Hnuhv+XRAQAgc2NYrCm5MLZ8J96SuT9hhZUCIjY9EBKnbpqc+Qn+YQf78bu qcAH3EoamLEEj87hPwvdPO6azPA7GkcbeHt6UDazFA0wceLDq/f1vxJafdgTeWOk0lzg x1MH6zbBXoBMthQ7Eu4jJPTDw1werbhoyneX/DYqrr0XudB5dYLDfV7Y7kmFJ9ZLxV0p mrlVycDnXGk07ajAMy5pNp3Z91zqLfoy//BYEjQnTce9c3UwG0i8uZVawYhqhROmowxt CHbBls6hkZ8qeTUCjJ3D1NZ6JbrbF14209LoPgEMtyf5RUMhYw0s3XX7oKxRTSkJ2Gs1 bftw== X-Forwarded-Encrypted: i=1; AJvYcCWXcNBtbdWEqKP7a1fjZ2X/tlFN6lwCH4bcq6vN6S3aQpPuOEEh5oH/E8Wt2fmDEx8/Kj6gUWfNoRnphNw=@vger.kernel.org X-Gm-Message-State: AOJu0YxqO1Dy1Bjdx7SD2KE53mcEpHwA9Jijuhk/kr7TbjF/0ybV+wfe 4mRG8XSG+3QVQt7vh3OMiI1W/L6qscoWUft/++QzkpO9btc5gzWs9PWk X-Gm-Gg: AZuq6aKVGndVTI1W96jbC5GR7Vwg0MEb9MGBMO/3HJhJ2Xibbn0XsxwEEX6S5UjmzwO le9vi4FLxHUsFYAVlBdLPfchNu3pDMmfHXRM5TPyB9ATGyj51290yDgDATt4nFd99/BePRuIa17 fG2mnT5KkANSCbQb5hrc/qGxZWlG6DszQROb1gGoiDAyApg6FeZflj62b4qYzCzuBt/DHFlO818 9DFdNx5rrL0i+Z4WslS+QsUiBkLrE8F+XJ4p3SyKKP9Q+FmRc25z+4b3OVzjzmtUYBBQzIJRys6 bBc+lXjvyKwEyyxVhL/2TUr5QNvGUoQI8skDj/ak+q5RP+hNpzfzKic3/+jyamaqfApmWL4xw8r AJS8mAfsj/Pd202T9o75gAXwhjxsWKEp413l4ywkPfOZm8rp7vguvFiXbYM5VkRIS4lAtpdKa1K HbIs2Va/rB2T8cj8lSaVfx43wGQ+Gdx5bjO9UP1V4= X-Received: by 2002:a05:6512:aca:b0:59e:5d0d:c1dc with SMTP id 2adb3069b0e04-5a0ed9c21ddmr157115e87.48.1771616849140; Fri, 20 Feb 2026 11:47:29 -0800 (PST) Received: from localhost ([2a00:1e88:4473:5f00:3201:1ad1:d6d0:d47d]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-5a0eeb3ea50sm15968e87.57.2026.02.20.11.47.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Feb 2026 11:47:28 -0800 (PST) From: Sergey Suloev To: ulf.hansson@linaro.org Cc: catalin.popescu@leica-geosystems.com, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Sergey Suloev Subject: [PATCH] mmc: pwrseq_simple: fix probe failure when CONFIG_RESET_GPIO is enabled Date: Fri, 20 Feb 2026 22:47:25 +0300 Message-ID: <20260220194725.1341281-1-sergey.suloev@gmail.com> X-Mailer: git-send-email 2.43.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: quoted-printable The driver uses a heuristic =E2=80=94 checking if exactly one entry exists = in 'reset-gpios' =E2=80=94 to decide whether to attempt reset controller API u= sage via devm_reset_control_get_optional_shared(). This is semantically incorrect and causes a permanent probe failure when CONFIG_RESET_GPIO is enabled. When CONFIG_RESET_GPIO=3Dy, __of_reset_control_get() intercepts the 'reset-gpios' DT property and attempts to register the GPIO as a reset controller via __reset_add_reset_gpio_device(). If the GPIO controller is not yet fully initialized at probe time, this returns -ENOENT instead of -EPROBE_DEFER, and the error path does not respect the 'optional' flag, causing pwrseq_simple to fail permanently rather than defer. This prevents mmc1 from probing on boards that use 'reset-gpios' for WiFi power sequencing, such as BananaPi M2 Magic with AP6212/BCM43430 on Allwinner R16. The correct indicator of reset controller intent is the explicit presence of a 'resets' property in the device tree node, not the count of 'reset-gpios' entries. A single 'reset-gpios' entry is just as likely to be a plain GPIO as multiple entries. Replace the ngpio =3D=3D 1 heuristic with an explicit check for the 'resets' DT property, making the behavior unambiguous and immune to CONFIG_RESET_GPIO interference. Fixes: 73bf4b7381f7 ("mmc: pwrseq_simple: add support for one reset control= ") Signed-off-by: Sergey Suloev --- drivers/mmc/core/pwrseq_simple.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/mmc/core/pwrseq_simple.c b/drivers/mmc/core/pwrseq_sim= ple.c index 4b47e6c3b04b..780c8818a273 100644 --- a/drivers/mmc/core/pwrseq_simple.c +++ b/drivers/mmc/core/pwrseq_simple.c @@ -124,7 +124,6 @@ static int mmc_pwrseq_simple_probe(struct platform_devi= ce *pdev) { struct mmc_pwrseq_simple *pwrseq; struct device *dev =3D &pdev->dev; - int ngpio; =20 pwrseq =3D devm_kzalloc(dev, sizeof(*pwrseq), GFP_KERNEL); if (!pwrseq) @@ -134,8 +133,7 @@ static int mmc_pwrseq_simple_probe(struct platform_devi= ce *pdev) if (IS_ERR(pwrseq->ext_clk) && PTR_ERR(pwrseq->ext_clk) !=3D -ENOENT) return dev_err_probe(dev, PTR_ERR(pwrseq->ext_clk), "external clock not = ready\n"); =20 - ngpio =3D of_count_phandle_with_args(dev->of_node, "reset-gpios", "#gpio-= cells"); - if (ngpio =3D=3D 1) { + if (device_property_present(dev, "resets")) { pwrseq->reset_ctrl =3D devm_reset_control_get_optional_shared(dev, NULL); if (IS_ERR(pwrseq->reset_ctrl)) return dev_err_probe(dev, PTR_ERR(pwrseq->reset_ctrl), --=20 2.43.0