All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH v10 3/9] mux: Add helper functions for getting optional and selected mux-state
@ 2026-02-25 15:48 kernel test robot
  0 siblings, 0 replies; 5+ messages in thread
From: kernel test robot @ 2026-02-25 15:48 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp, Julia Lawall

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <20260225-rz-sdio-mux-v10-3-1ee44f2ea112@solid-run.com>
References: <20260225-rz-sdio-mux-v10-3-1ee44f2ea112@solid-run.com>
TO: Josua Mayer <josua@solid-run.com>
TO: "Marc Kleine-Budde" <mkl@pengutronix.de>
TO: Vincent Mailhol <mailhol@kernel.org>
TO: Vinod Koul <vkoul@kernel.org>
TO: Neil Armstrong <neil.armstrong@linaro.org>
TO: Peter Rosin <peda@axentia.se>
TO: Aaro Koskinen <aaro.koskinen@iki.fi>
TO: Andreas Kemnade <andreas@kemnade.info>
TO: Kevin Hilman <khilman@baylibre.com>
TO: Roger Quadros <rogerq@kernel.org>
TO: Tony Lindgren <tony@atomide.com>
TO: Janusz Krzysztofik <jmkrzyszt@gmail.com>
TO: Vignesh R <vigneshr@ti.com>
TO: Andi Shyti <andi.shyti@kernel.org>
TO: Ulf Hansson <ulf.hansson@linaro.org>
TO: Rob Herring <robh@kernel.org>
TO: Krzysztof Kozlowski <krzk@kernel.org>
TO: Conor Dooley <conor+dt@kernel.org>
TO: Geert Uytterhoeven <geert+renesas@glider.be>
TO: Magnus Damm <magnus.damm@gmail.com>
TO: Wolfram Sang <wsa-dev@sang-engineering.com>
TO: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
CC: Yazan Shhady <yazan.shhady@solid-run.com>
CC: Jon Nettleton <jon@solid-run.com>
CC: Vladimir Oltean <olteanv@gmail.com>
CC: Mikhail Anikin <mikhail.anikin@solid-run.com>
CC: linux-can@vger.kernel.org
CC: linux-phy@lists.infradead.org
CC: linux-kernel@vger.kernel.org
CC: linux-omap@vger.kernel.org
CC: linux-i2c@vger.kernel.org

Hi Josua,

kernel test robot noticed the following build warnings:

[auto build test WARNING on 6de23f81a5e08be8fbf5e8d7e9febc72a5b5f27f]

url:    https://github.com/intel-lab-lkp/linux/commits/Josua-Mayer/phy-can-transceiver-rename-temporary-helper-function-to-avoid-conflict/20260225-194325
base:   6de23f81a5e08be8fbf5e8d7e9febc72a5b5f27f
patch link:    https://lore.kernel.org/r/20260225-rz-sdio-mux-v10-3-1ee44f2ea112%40solid-run.com
patch subject: [PATCH v10 3/9] mux: Add helper functions for getting optional and selected mux-state
:::::: branch date: 4 hours ago
:::::: commit date: 4 hours ago
config: sparc-randconfig-r053-20260225 (https://download.01.org/0day-ci/archive/20260225/202602252310.2cVbnvYP-lkp@intel.com/config)
compiler: sparc-linux-gcc (GCC) 13.4.0

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Julia Lawall <julia.lawall@inria.fr>
| Closes: https://lore.kernel.org/r/202602252310.2cVbnvYP-lkp@intel.com/

cocci warnings: (new ones prefixed by >>)
>> drivers/mux/core.c:733:18-24: ERROR: reference preceded by free on line 732

vim +733 drivers/mux/core.c

a3b02a9c6591ce drivers/mux/mux-core.c Peter Rosin    2017-05-14  712  
a67ef2fe0fda72 drivers/mux/core.c     Josua Mayer    2026-02-25  713  /**
6632866df852bd drivers/mux/core.c     Peter Rosin    2022-01-07  714   * mux_state_get() - Get the mux-state for a device.
6632866df852bd drivers/mux/core.c     Peter Rosin    2022-01-07  715   * @dev: The device that needs a mux-state.
6632866df852bd drivers/mux/core.c     Peter Rosin    2022-01-07  716   * @mux_name: The name identifying the mux-state.
a67ef2fe0fda72 drivers/mux/core.c     Josua Mayer    2026-02-25  717   * @optional: Whether to return NULL and silence errors when mux doesn't exist.
6632866df852bd drivers/mux/core.c     Peter Rosin    2022-01-07  718   *
a67ef2fe0fda72 drivers/mux/core.c     Josua Mayer    2026-02-25  719   * Return: Pointer to the mux-state on success, an ERR_PTR with a negative errno on error,
a67ef2fe0fda72 drivers/mux/core.c     Josua Mayer    2026-02-25  720   * or NULL if optional is true and mux doesn't exist.
6632866df852bd drivers/mux/core.c     Peter Rosin    2022-01-07  721   */
a67ef2fe0fda72 drivers/mux/core.c     Josua Mayer    2026-02-25  722  static struct mux_state *mux_state_get(struct device *dev, const char *mux_name, bool optional)
6632866df852bd drivers/mux/core.c     Peter Rosin    2022-01-07  723  {
6632866df852bd drivers/mux/core.c     Peter Rosin    2022-01-07  724  	struct mux_state *mstate;
6632866df852bd drivers/mux/core.c     Peter Rosin    2022-01-07  725  
bf4afc53b77aea drivers/mux/core.c     Linus Torvalds 2026-02-21  726  	mstate = kzalloc_obj(*mstate);
6632866df852bd drivers/mux/core.c     Peter Rosin    2022-01-07  727  	if (!mstate)
6632866df852bd drivers/mux/core.c     Peter Rosin    2022-01-07  728  		return ERR_PTR(-ENOMEM);
6632866df852bd drivers/mux/core.c     Peter Rosin    2022-01-07  729  
a67ef2fe0fda72 drivers/mux/core.c     Josua Mayer    2026-02-25  730  	mstate->mux = mux_get(dev, mux_name, &mstate->state, optional);
6632866df852bd drivers/mux/core.c     Peter Rosin    2022-01-07  731  	if (IS_ERR(mstate->mux)) {
6632866df852bd drivers/mux/core.c     Peter Rosin    2022-01-07 @732  		kfree(mstate);
a67ef2fe0fda72 drivers/mux/core.c     Josua Mayer    2026-02-25 @733  		return ERR_CAST(mstate->mux);
a67ef2fe0fda72 drivers/mux/core.c     Josua Mayer    2026-02-25  734  	} else if (optional && !mstate->mux) {
a67ef2fe0fda72 drivers/mux/core.c     Josua Mayer    2026-02-25  735  		kfree(mstate);
a67ef2fe0fda72 drivers/mux/core.c     Josua Mayer    2026-02-25  736  		return NULL;
a67ef2fe0fda72 drivers/mux/core.c     Josua Mayer    2026-02-25  737  	} else if (!mstate->mux) {
a67ef2fe0fda72 drivers/mux/core.c     Josua Mayer    2026-02-25  738  		kfree(mstate);
a67ef2fe0fda72 drivers/mux/core.c     Josua Mayer    2026-02-25  739  		return ERR_PTR(-ENOENT);
6632866df852bd drivers/mux/core.c     Peter Rosin    2022-01-07  740  	}
6632866df852bd drivers/mux/core.c     Peter Rosin    2022-01-07  741  
6632866df852bd drivers/mux/core.c     Peter Rosin    2022-01-07  742  	return mstate;
6632866df852bd drivers/mux/core.c     Peter Rosin    2022-01-07  743  }
6632866df852bd drivers/mux/core.c     Peter Rosin    2022-01-07  744  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 5+ messages in thread
* [PATCH v10 0/9] mmc: host: renesas_sdhi_core: support configuring an optional sdio mux
@ 2026-02-25 11:34 Josua Mayer
  2026-02-25 11:34   ` Josua Mayer
  0 siblings, 1 reply; 5+ messages in thread
From: Josua Mayer @ 2026-02-25 11:34 UTC (permalink / raw)
  To: Marc Kleine-Budde, Vincent Mailhol, Vinod Koul, Neil Armstrong,
	Peter Rosin, Aaro Koskinen, Andreas Kemnade, Kevin Hilman,
	Roger Quadros, Tony Lindgren, Janusz Krzysztofik, Vignesh R,
	Andi Shyti, Ulf Hansson, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Geert Uytterhoeven, Magnus Damm, Wolfram Sang,
	Yoshihiro Shimoda
  Cc: Yazan Shhady, Jon Nettleton, Vladimir Oltean, Mikhail Anikin,
	linux-can, linux-phy, linux-kernel, linux-omap, linux-i2c,
	linux-mmc, devicetree, linux-renesas-soc, Josua Mayer

This series has evolved over time from adding generic mux support for
renesas sdhi driver, to partial rewrite of the mux framework.

Several drivers have started implementing driver-local managed and
unmanaged helper functions for getting and selecting a mux-state object.

mmc maintainers have requested that new code shall intreoduce and use
generic helper functions that can be shared by all drivers, avoiding
code duplication.

This series is structured in 5 parts, each of which is self-sufficient
depending only on the previous patches. This shall allow the first N
patches to be applied even if the last ones need further discussion.

1. Rename driver-local helper functions to avoid name collision with
   global version to be introduced later.

2. Implement generic device-managed helper functions in mux core.

3. Convert driver local code from similar patterns to use the newly
   added global helpers.

4. Change mux-core Kconfig so that it can be enabled through menuconfig,
   without an explicit "select" dependency from other drivers.

5. add dt bindings and driver support for mux in renesas sdhi driver.

Signed-off-by: Josua Mayer <josua@solid-run.com>
---
Changes in v10:
- added renesas-sdhi Kconfig dependency for MULTIPLEXER, avoiding build
  errors in case setting SDHI=y and MULTIPLEXER=m is attempted.
  Trailers were dropped on this patch to encourage fresh review.
- renamed phy-can-transceiver driver-local helper function to be
  consistent with other driver-local functions, and dropped all trailers
  for this particular patch.
- reconsidered the Kconfig changes due to inputs from mux core author
- handle newly-added mux usage in rcar-gen3-usb2 introduced with
  v7.0-rc1
- streamline patch sequence
- rebase on v7.0-rc1
- Link to v9: https://lore.kernel.org/r/20260208-rz-sdio-mux-v9-0-9a3be13c1280@solid-run.com

Changes in v9:
- compile-tested on x86 with MULTIPLEXER=m/y/unset.
- fixed Kconfig changes so that CONFIG_MULTIPLEXER can be selected.
  through menuconfig / .config as intended.
- updated trailers
- document null return value for mux_control_get_optional.
- fix build error for CONFIG_MULTIPLEXER=m, found with x86_64
  allmodconfig: replaced ifdef ... with if IS_ENABLED(...).
  (Reported-by: Mark Brown <broonie@kernel.org>)
- Link to v8: https://lore.kernel.org/r/20260203-rz-sdio-mux-v8-0-024ea405863e@solid-run.com

Changes in v8:
- Add defensive null checks for all non-optional calls to internal
  mux_get function.
- Document NULL return value on applicable functions.
- Avoid IS_ERR_OR_NULL and ERR_PTR(0) to disarm smatch errors.
- Link to v7: https://lore.kernel.org/r/20260128-rz-sdio-mux-v7-0-92ebb6da0df8@solid-run.com

Changes in v7:
- picked up reviewed-tags
- fix Kconfig change to add the missing prompt for CONFIG_MULTIPLEXER,
  and enable it by default when COMPILE_TEST is set.
  (Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>)
- fix another kernel build robot warning: undocumented C struct member
- Link to v6: https://lore.kernel.org/r/20260121-rz-sdio-mux-v6-0-38aa39527928@solid-run.com

Changes in v6:
- replaced /* with /** for devm_mux_state_state function description.
- collected review tags.
- fixed checkpatch warnings (space-before-tab, void-return).
  (Reported-by: Geert Uytterhoeven)
- fixed use-after-free in mux core mux_get function.
  (Reported-by: Geert Uytterhoeven)
- fix mux helper error path uninitialised return code variable.
  (Reported-by: kernel test robot <lkp@intel.com>)
- Link to v5: https://lore.kernel.org/r/20260118-rz-sdio-mux-v5-0-3c37e8872683@solid-run.com

Changes in v5:
- implemented automatic mux deselect for devm_*_selected.
  (Reported-by: Wolfram Sang <wsa+renesas@sang-engineering.com>)
- because of semantic changes I dropped reviewed and acks from omap-i2c
  patch (Andreas Kemnade / Wolfram Sang).
- fix invalid return value in void function for mux helper stubs
  (Reported-by: kernel test robot <lkp@intel.com>)
- Link to v4: https://lore.kernel.org/r/20251229-rz-sdio-mux-v4-0-a023e55758fe@solid-run.com

Changes in v4:
- added MULTIPLEXER Kconfig help text.
- removed "select MULTIPLEXER" from renesas sdhi Kconfig, as it is
  not required for all devices using this driver.
- added stubs for all symbols exported by mux core.
  (Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>)
- refactored mux core logic to silence ENOENT errors only on optional
  code paths, keeping error printing unchanged otherwise.
  (Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>)
- picked up various reviewed- and acked-by tags
- Link to v3: https://lore.kernel.org/r/20251210-rz-sdio-mux-v3-0-ca628db56d60@solid-run.com

Changes in v3:
- updated omap-i2c and phy-can-transceiver to use new helpers.
- created generic helper functions for getting managed optional mux-state.
  (Reported-by: Rob Herring <robh@kernel.org>)
- picked up binding ack by Rob Herring.
- replaced use of "SDIO" with "SD/SDIO/eMMC" in binding document and
  commit descriptions.
  (Reported-by: Ulf Hansson <ulf.hansson@linaro.org>)
- Link to v2: https://lore.kernel.org/r/20251201-rz-sdio-mux-v2-0-bcb581b88dd7@solid-run.com

Changes in v2:
- dropped mux-controller node from dt binding example
  (Reported-by: Conor Dooley <conor@kernel.org>
   Reported-by: Krzysztof Kozlowski <krzk@kernel.org>)
- Link to v1: https://lore.kernel.org/r/20251128-rz-sdio-mux-v1-0-1ede318d160f@solid-run.com

---
Josua Mayer (9):
      phy: can-transceiver: rename temporary helper function to avoid conflict
      phy: renesas: rcar-gen3-usb2: rename local mux helper to avoid conflict
      mux: Add helper functions for getting optional and selected mux-state
      phy: can-transceiver: drop temporary helper getting optional mux-state
      phy: renesas: rcar-gen3-usb2: drop helper getting optional mux-state
      i2c: omap: switch to new generic helper for getting selected mux-state
      dt-bindings: mmc: renesas,sdhi: Add mux-states property
      mux: add prompt and help text to CONFIG_MULTIPLEXER making it visible
      mmc: host: renesas_sdhi_core: support selecting an optional mux

 .../devicetree/bindings/mmc/renesas,sdhi.yaml      |   6 +
 drivers/i2c/busses/i2c-omap.c                      |  24 +--
 drivers/mmc/host/Kconfig                           |   1 +
 drivers/mmc/host/renesas_sdhi_core.c               |   6 +
 drivers/mux/Kconfig                                |   9 +-
 drivers/mux/core.c                                 | 206 +++++++++++++++++----
 drivers/phy/phy-can-transceiver.c                  |  10 -
 drivers/phy/renesas/phy-rcar-gen3-usb2.c           |  30 +--
 include/linux/mux/consumer.h                       | 108 ++++++++++-
 9 files changed, 307 insertions(+), 93 deletions(-)
---
base-commit: 6de23f81a5e08be8fbf5e8d7e9febc72a5b5f27f
change-id: 20251128-rz-sdio-mux-acc5137f1618

Best regards,
-- 
Josua Mayer <josua@solid-run.com>


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-02-26 10:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-25 15:48 [PATCH v10 3/9] mux: Add helper functions for getting optional and selected mux-state kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2026-02-25 11:34 [PATCH v10 0/9] mmc: host: renesas_sdhi_core: support configuring an optional sdio mux Josua Mayer
2026-02-25 11:34 ` [PATCH v10 3/9] mux: Add helper functions for getting optional and selected mux-state Josua Mayer
2026-02-25 11:34   ` Josua Mayer
2026-02-26 10:46   ` Josua Mayer
2026-02-26 10:46     ` Josua Mayer

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.