0 day kernel build service
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: oe-kbuild@lists.linux.dev
Cc: lkp@intel.com, Dan Carpenter <error27@gmail.com>
Subject: [qcom:clk-for-7.3 13/20] drivers/clk/qcom/gdsc.c:505 gdsc_init() warn: missing unwind goto?
Date: Fri, 10 Jul 2026 09:18:41 +0800	[thread overview]
Message-ID: <202607100920.CUtNXkZl-lkp@intel.com> (raw)

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
TO: Herman van Hazendonk <github.com@herrie.org>
CC: Bjorn Andersson <andersson@kernel.org>
CC: Dmitry Baryshkov <lumag@kernel.org>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/qcom/linux clk-for-7.3
head:   d8638610e0c9ebab2800b7ad6c2c2a3737090da9
commit: eea55fc694e132aacbe2cf4be7f345115e3d1801 [13/20] clk: qcom: gdsc: propagate gdsc_enable() failure for ALWAYS_ON domains
:::::: branch date: 2 days ago
:::::: commit date: 2 days ago
config: arc-randconfig-r072-20260709 (https://download.01.org/0day-ci/archive/20260710/202607100920.CUtNXkZl-lkp@intel.com/config)
compiler: arc-linux-gcc (GCC) 8.5.0
smatch: v0.5.0-9185-gbcc58b9c

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: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202607100920.CUtNXkZl-lkp@intel.com/

smatch warnings:
drivers/clk/qcom/gdsc.c:505 gdsc_init() warn: missing unwind goto?

vim +505 drivers/clk/qcom/gdsc.c

f7ccdaad612a09 Jagadeesh Kona       2024-06-24  428  
45dd0e55317ccb Stephen Boyd         2015-08-06  429  static int gdsc_init(struct gdsc *sc)
45dd0e55317ccb Stephen Boyd         2015-08-06  430  {
45dd0e55317ccb Stephen Boyd         2015-08-06  431  	u32 mask, val;
45dd0e55317ccb Stephen Boyd         2015-08-06  432  	int on, ret;
45dd0e55317ccb Stephen Boyd         2015-08-06  433  
45dd0e55317ccb Stephen Boyd         2015-08-06  434  	/*
45dd0e55317ccb Stephen Boyd         2015-08-06  435  	 * Disable HW trigger: collapse/restore occur based on registers writes.
45dd0e55317ccb Stephen Boyd         2015-08-06  436  	 * Disable SW override: Use hardware state-machine for sequencing.
45dd0e55317ccb Stephen Boyd         2015-08-06  437  	 * Configure wait time between states.
45dd0e55317ccb Stephen Boyd         2015-08-06  438  	 */
45dd0e55317ccb Stephen Boyd         2015-08-06  439  	mask = HW_CONTROL_MASK | SW_OVERRIDE_MASK |
45dd0e55317ccb Stephen Boyd         2015-08-06  440  	       EN_REST_WAIT_MASK | EN_FEW_WAIT_MASK | CLK_DIS_WAIT_MASK;
4e7c4d3652f96f Taniya Das           2022-02-24  441  
4e7c4d3652f96f Taniya Das           2022-02-24  442  	if (!sc->en_rest_wait_val)
4e7c4d3652f96f Taniya Das           2022-02-24  443  		sc->en_rest_wait_val = EN_REST_WAIT_VAL;
4e7c4d3652f96f Taniya Das           2022-02-24  444  	if (!sc->en_few_wait_val)
4e7c4d3652f96f Taniya Das           2022-02-24  445  		sc->en_few_wait_val = EN_FEW_WAIT_VAL;
4e7c4d3652f96f Taniya Das           2022-02-24  446  	if (!sc->clk_dis_wait_val)
4e7c4d3652f96f Taniya Das           2022-02-24  447  		sc->clk_dis_wait_val = CLK_DIS_WAIT_VAL;
4e7c4d3652f96f Taniya Das           2022-02-24  448  
4e7c4d3652f96f Taniya Das           2022-02-24  449  	val = sc->en_rest_wait_val << EN_REST_WAIT_SHIFT |
4e7c4d3652f96f Taniya Das           2022-02-24  450  		sc->en_few_wait_val << EN_FEW_WAIT_SHIFT |
4e7c4d3652f96f Taniya Das           2022-02-24  451  		sc->clk_dis_wait_val << CLK_DIS_WAIT_SHIFT;
4e7c4d3652f96f Taniya Das           2022-02-24  452  
45dd0e55317ccb Stephen Boyd         2015-08-06  453  	ret = regmap_update_bits(sc->regmap, sc->gdscr, mask, val);
45dd0e55317ccb Stephen Boyd         2015-08-06  454  	if (ret)
45dd0e55317ccb Stephen Boyd         2015-08-06  455  		return ret;
45dd0e55317ccb Stephen Boyd         2015-08-06  456  
3c53f5e2179874 Rajendra Nayak       2015-08-06  457  	/* Force gdsc ON if only ON state is supported */
3c53f5e2179874 Rajendra Nayak       2015-08-06  458  	if (sc->pwrsts == PWRSTS_ON) {
8b6af3b58cafc2 Akhil P Oommen       2023-01-02  459  		ret = gdsc_toggle_logic(sc, GDSC_ON, false);
3c53f5e2179874 Rajendra Nayak       2015-08-06  460  		if (ret)
3c53f5e2179874 Rajendra Nayak       2015-08-06  461  			return ret;
3c53f5e2179874 Rajendra Nayak       2015-08-06  462  	}
3c53f5e2179874 Rajendra Nayak       2015-08-06  463  
88051f55de5028 Stephen Boyd         2018-05-01  464  	on = gdsc_check_status(sc, GDSC_ON);
45dd0e55317ccb Stephen Boyd         2015-08-06  465  	if (on < 0)
45dd0e55317ccb Stephen Boyd         2015-08-06  466  		return on;
45dd0e55317ccb Stephen Boyd         2015-08-06  467  
9711759a87a041 Bjorn Andersson      2021-07-21  468  	if (on) {
9711759a87a041 Bjorn Andersson      2021-07-21  469  		/* The regulator must be on, sync the kernel state */
9711759a87a041 Bjorn Andersson      2021-07-21  470  		if (sc->rsupply) {
9711759a87a041 Bjorn Andersson      2021-07-21  471  			ret = regulator_enable(sc->rsupply);
9711759a87a041 Bjorn Andersson      2021-07-21  472  			if (ret < 0)
9711759a87a041 Bjorn Andersson      2021-07-21  473  				return ret;
9711759a87a041 Bjorn Andersson      2021-07-21  474  		}
9711759a87a041 Bjorn Andersson      2021-07-21  475  
a823bb9fbefbac Rajendra Nayak       2015-12-01  476  		/*
a823bb9fbefbac Rajendra Nayak       2015-12-01  477  		 * Votable GDSCs can be ON due to Vote from other masters.
a823bb9fbefbac Rajendra Nayak       2015-12-01  478  		 * If a Votable GDSC is ON, make sure we have a Vote.
a823bb9fbefbac Rajendra Nayak       2015-12-01  479  		 */
9711759a87a041 Bjorn Andersson      2021-07-21  480  		if (sc->flags & VOTABLE) {
e73cb8527c5975 Johan Hovold         2022-05-20  481  			ret = gdsc_update_collapse_bit(sc, false);
9711759a87a041 Bjorn Andersson      2021-07-21  482  			if (ret)
4cc47e8add6354 Stephen Boyd         2022-11-03  483  				goto err_disable_supply;
9711759a87a041 Bjorn Andersson      2021-07-21  484  		}
9711759a87a041 Bjorn Andersson      2021-07-21  485  
fda48bf5c86d88 Stephen Boyd         2020-10-16  486  		/*
9711759a87a041 Bjorn Andersson      2021-07-21  487  		 * Make sure the retain bit is set if the GDSC is already on,
9711759a87a041 Bjorn Andersson      2021-07-21  488  		 * otherwise we end up turning off the GDSC and destroying all
9711759a87a041 Bjorn Andersson      2021-07-21  489  		 * the register contents that we thought we were saving.
fda48bf5c86d88 Stephen Boyd         2020-10-16  490  		 */
9711759a87a041 Bjorn Andersson      2021-07-21  491  		if (sc->flags & RETAIN_FF_ENABLE)
fda48bf5c86d88 Stephen Boyd         2020-10-16  492  			gdsc_retain_ff_on(sc);
25708f73ff171b Taniya Das           2025-02-14  493  
25708f73ff171b Taniya Das           2025-02-14  494  		/* Turn on HW trigger mode if supported */
25708f73ff171b Taniya Das           2025-02-14  495  		if (sc->flags & HW_CTRL) {
25708f73ff171b Taniya Das           2025-02-14  496  			ret = gdsc_hwctrl(sc, true);
25708f73ff171b Taniya Das           2025-02-14  497  			if (ret < 0)
25708f73ff171b Taniya Das           2025-02-14  498  				goto err_disable_supply;
25708f73ff171b Taniya Das           2025-02-14  499  		}
25708f73ff171b Taniya Das           2025-02-14  500  
9711759a87a041 Bjorn Andersson      2021-07-21  501  	} else if (sc->flags & ALWAYS_ON) {
fb55bea1fe436b Rajendra Nayak       2018-03-23  502  		/* If ALWAYS_ON GDSCs are not ON, turn them ON */
eea55fc694e132 Herman van Hazendonk 2026-06-02  503  		ret = gdsc_enable(&sc->pd);
eea55fc694e132 Herman van Hazendonk 2026-06-02  504  		if (ret)
eea55fc694e132 Herman van Hazendonk 2026-06-02 @505  			return ret;
fb55bea1fe436b Rajendra Nayak       2018-03-23  506  		on = true;
fb55bea1fe436b Rajendra Nayak       2018-03-23  507  	}
fb55bea1fe436b Rajendra Nayak       2018-03-23  508  
014e193ccd197d Rajendra Nayak       2015-08-06  509  	if (on || (sc->pwrsts & PWRSTS_RET))
014e193ccd197d Rajendra Nayak       2015-08-06  510  		gdsc_force_mem_on(sc);
014e193ccd197d Rajendra Nayak       2015-08-06  511  	else
014e193ccd197d Rajendra Nayak       2015-08-06  512  		gdsc_clear_mem_on(sc);
014e193ccd197d Rajendra Nayak       2015-08-06  513  
9711759a87a041 Bjorn Andersson      2021-07-21  514  	if (sc->flags & ALWAYS_ON)
9711759a87a041 Bjorn Andersson      2021-07-21  515  		sc->pd.flags |= GENPD_FLAG_ALWAYS_ON;
7895861a963cfa Jordan Crouse        2018-11-26  516  	if (!sc->pd.power_off)
45dd0e55317ccb Stephen Boyd         2015-08-06  517  		sc->pd.power_off = gdsc_disable;
7895861a963cfa Jordan Crouse        2018-11-26  518  	if (!sc->pd.power_on)
45dd0e55317ccb Stephen Boyd         2015-08-06  519  		sc->pd.power_on = gdsc_enable;
f7ccdaad612a09 Jagadeesh Kona       2024-06-24  520  	if (sc->flags & HW_CTRL_TRIGGER) {
f7ccdaad612a09 Jagadeesh Kona       2024-06-24  521  		sc->pd.set_hwmode_dev = gdsc_set_hwmode;
f7ccdaad612a09 Jagadeesh Kona       2024-06-24  522  		sc->pd.get_hwmode_dev = gdsc_get_hwmode;
f7ccdaad612a09 Jagadeesh Kona       2024-06-24  523  	}
eab4c1ebdd6579 Johan Hovold         2022-09-29  524  
eab4c1ebdd6579 Johan Hovold         2022-09-29  525  	ret = pm_genpd_init(&sc->pd, NULL, !on);
eab4c1ebdd6579 Johan Hovold         2022-09-29  526  	if (ret)
4cc47e8add6354 Stephen Boyd         2022-11-03  527  		goto err_disable_supply;
45dd0e55317ccb Stephen Boyd         2015-08-06  528  
45dd0e55317ccb Stephen Boyd         2015-08-06  529  	return 0;
eab4c1ebdd6579 Johan Hovold         2022-09-29  530  
eab4c1ebdd6579 Johan Hovold         2022-09-29  531  err_disable_supply:
eab4c1ebdd6579 Johan Hovold         2022-09-29  532  	if (on && sc->rsupply)
eab4c1ebdd6579 Johan Hovold         2022-09-29  533  		regulator_disable(sc->rsupply);
eab4c1ebdd6579 Johan Hovold         2022-09-29  534  
eab4c1ebdd6579 Johan Hovold         2022-09-29  535  	return ret;
45dd0e55317ccb Stephen Boyd         2015-08-06  536  }
45dd0e55317ccb Stephen Boyd         2015-08-06  537  

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

                 reply	other threads:[~2026-07-10  1:19 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202607100920.CUtNXkZl-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=error27@gmail.com \
    --cc=oe-kbuild@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox