linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Matti Vaittinen <matti.vaittinen@fi.rohmeurope.com>,
	Matti Vaittinen <mazziesaccount@gmail.com>
Cc: kbuild-all@lists.01.org, clang-built-linux@googlegroups.com,
	Mark Brown <broonie@kernel.org>,
	Kees Cook <keescook@chromium.org>,
	Andy Shevchenko <andy.shevchenko@gmail.com>,
	Zhang Rui <rui.zhang@intel.com>,
	Guenter Roeck <linux@roeck-us.net>,
	"agross@kernel.org" <agross@kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	linux-power <linux-power@fi.rohmeurope.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v9 05/10] regulator: IRQ based event/error notification helpers
Date: Tue, 11 May 2021 01:35:37 +0800	[thread overview]
Message-ID: <202105110116.2KVffy45-lkp@intel.com> (raw)
In-Reply-To: <a22cf56239512f52ae5927f226e79d890d7a1240.1620645507.git.matti.vaittinen@fi.rohmeurope.com>

[-- Attachment #1: Type: text/plain, Size: 6079 bytes --]

Hi Matti,

I love your patch! Yet something to improve:

[auto build test ERROR on 6efb943b8616ec53a5e444193dccf1af9ad627b5]

url:    https://github.com/0day-ci/linux/commits/Matti-Vaittinen/Extend-regulator-notification-support/20210510-203125
base:   6efb943b8616ec53a5e444193dccf1af9ad627b5
config: x86_64-randconfig-a015-20210510 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 492173d42b32cb91d5d0d72d5ed84fcab80d059a)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install x86_64 cross compiling tool for clang build
        # apt-get install binutils-x86-64-linux-gnu
        # https://github.com/0day-ci/linux/commit/904edb46fa37ac86bc1e7a1629141e037f45ebed
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Matti-Vaittinen/Extend-regulator-notification-support/20210510-203125
        git checkout 904edb46fa37ac86bc1e7a1629141e037f45ebed
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

>> drivers/regulator/irq_helpers.c:244:4: error: implicit declaration of function 'pr_dbg' [-Werror,-Wimplicit-function-declaration]
                           pr_dbg("Sending regulator notification EVT 0x%lx\r\n",
                           ^
   1 error generated.


vim +/pr_dbg +244 drivers/regulator/irq_helpers.c

   153	
   154	static irqreturn_t regulator_notifier_isr(int irq, void *data)
   155	{
   156		struct regulator_irq *h = data;
   157		struct regulator_irq_desc *d;
   158		struct regulator_irq_data *rid;
   159		unsigned long rdev_map = 0;
   160		int num_rdevs;
   161		int ret, i, j;
   162	
   163		d = &h->desc;
   164		rid = &h->rdata;
   165		num_rdevs = rid->num_states;
   166	
   167		if (d->fatal_cnt)
   168			h->retry_cnt++;
   169	
   170		/*
   171		 * we spare a few cycles by not clearing statuses prior to this call.
   172		 * The IC driver must initialize the status buffers for rdevs
   173		 * which it indicates having active events via rdev_map.
   174		 *
   175		 * Maybe we should just to be on a safer side(?)
   176		 */
   177		ret = d->map_event(irq, rid, &rdev_map);
   178	
   179		/*
   180		 * If status reading fails (which is unlikely) we don't ack/disable
   181		 * IRQ but just increase fail count and retry when IRQ fires again.
   182		 * If retry_count exceeds the given safety limit we call IC specific die
   183		 * handler which can try disabling regulator(s).
   184		 *
   185		 * If no die handler is given we will just bug() as a last resort.
   186		 *
   187		 * We could try disabling all associated rdevs - but we might shoot
   188		 * ourselves in the head and leave the problematic regulator enabled. So
   189		 * if IC has no die-handler populated we just assume the regulator
   190		 * can't be disabled.
   191		 */
   192		if (unlikely(ret == REGULATOR_FAILED_RETRY))
   193			goto fail_out;
   194	
   195		h->retry_cnt = 0;
   196		/*
   197		 * Let's not disable IRQ if there were no status bits for us. We'd
   198		 * better leave spurious IRQ handling to genirq
   199		 */
   200		if (ret || !rdev_map)
   201			return IRQ_NONE;
   202	
   203		/*
   204		 * Some events are bogus if the regulator is disabled. Skip such events
   205		 * if all relevant regulators are disabled
   206		 */
   207		if (d->skip_off) {
   208			for_each_set_bit(i, &rdev_map, num_rdevs) {
   209				struct regulator_dev *rdev;
   210				const struct regulator_ops *ops;
   211	
   212				rdev = rid->states[i].rdev;
   213				ops = rdev->desc->ops;
   214	
   215				/*
   216				 * If any of the flagged regulators is enabled we do
   217				 * handle this
   218				 */
   219				if (ops->is_enabled(rdev))
   220					break;
   221			}
   222			if (i == num_rdevs)
   223				return IRQ_NONE;
   224		}
   225	
   226		/* Disable IRQ if HW keeps line asserted */
   227		if (d->irq_off_ms)
   228			disable_irq_nosync(irq);
   229	
   230		/*
   231		 * IRQ seems to be for us. Let's fire correct notifiers / store error
   232		 * flags
   233		 */
   234		for_each_set_bit(i, &rdev_map, num_rdevs) {
   235			unsigned long evt;
   236			struct regulator_err_state *stat;
   237			struct regulator_dev *rdev;
   238	
   239			stat = &rid->states[i];
   240			rdev = stat->rdev;
   241	
   242			for_each_set_bit(j, &stat->notifs, BITS_PER_TYPE(stat->notifs))
   243				evt =  BIT(j);
 > 244				pr_dbg("Sending regulator notification EVT 0x%lx\r\n",
   245				       stat->notifs, evt);
   246				regulator_notifier_call_chain(rdev, evt, NULL);
   247	
   248			rdev_flag_err(rdev, stat->errors);
   249		}
   250	
   251		if (d->irq_off_ms) {
   252			if (!d->high_prio)
   253				schedule_delayed_work(&h->isr_work,
   254						      msecs_to_jiffies(d->irq_off_ms));
   255			else
   256				mod_delayed_work(system_highpri_wq,
   257						 &h->isr_work,
   258						 msecs_to_jiffies(d->irq_off_ms));
   259		}
   260	
   261		return IRQ_HANDLED;
   262	
   263	fail_out:
   264		if (d->fatal_cnt && h->retry_cnt > d->fatal_cnt) {
   265			/* If we have no recovery, just try shut down straight away */
   266			if (!d->die) {
   267				hw_protection_shutdown("Regulator failure. Retry count exceeded",
   268						       REGULATOR_FORCED_SAFETY_SHUTDOWN_WAIT_MS);
   269			} else {
   270				ret = d->die(rid);
   271				/* If die() failed shut down as a last attempt to save the HW */
   272				if (ret)
   273					hw_protection_shutdown("Regulator failure. Recovery failed",
   274							       REGULATOR_FORCED_SAFETY_SHUTDOWN_WAIT_MS);
   275			}
   276		}
   277	
   278		return IRQ_NONE;
   279	}
   280	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 31016 bytes --]

  reply	other threads:[~2021-05-10 17:36 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-10 11:26 [PATCH v9 00/10] Extend regulator notification support Matti Vaittinen
2021-05-10 11:27 ` [PATCH v9 01/10] dt_bindings: Add protection limit properties Matti Vaittinen
2021-05-10 11:28 ` [PATCH v9 02/10] reboot: Add hardware protection power-off Matti Vaittinen
2021-05-12  8:20   ` Petr Mladek
2021-05-12 12:00     ` Vaittinen, Matti
2021-05-13  8:34       ` Petr Mladek
2021-05-17  4:57         ` Matti Vaittinen
2021-05-10 11:29 ` [PATCH v9 03/10] thermal: Use generic HW-protection shutdown API Matti Vaittinen
2021-05-10 11:29 ` [PATCH v9 04/10] regulator: add warning flags Matti Vaittinen
2021-05-10 11:29 ` [PATCH v9 05/10] regulator: IRQ based event/error notification helpers Matti Vaittinen
2021-05-10 17:35   ` kernel test robot [this message]
2021-05-10 20:15     ` Andy Shevchenko
2021-05-10 19:45   ` kernel test robot
2021-05-10 20:20     ` Andy Shevchenko
2021-05-11  3:24       ` Matti Vaittinen
2021-05-11  4:54   ` Matti Vaittinen
2021-05-10 11:30 ` [PATCH v9 06/10] regulator: add property parsing and callbacks to set protection limits Matti Vaittinen
2021-05-10 11:30 ` [PATCH v9 07/10] dt-bindings: regulator: bd9576 add FET ON-resistance for OCW Matti Vaittinen
2021-05-10 11:30 ` [PATCH v9 08/10] regulator: bd9576: Support error reporting Matti Vaittinen
2021-05-10 11:31 ` [PATCH v9 09/10] regulator: bd9576: Fix the driver name in id table Matti Vaittinen
2021-05-10 11:31 ` [PATCH v9 10/10] MAINTAINERS: Add reviewer for regulator irq_helpers Matti Vaittinen

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=202105110116.2KVffy45-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=agross@kernel.org \
    --cc=andy.shevchenko@gmail.com \
    --cc=broonie@kernel.org \
    --cc=clang-built-linux@googlegroups.com \
    --cc=devicetree@vger.kernel.org \
    --cc=kbuild-all@lists.01.org \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-power@fi.rohmeurope.com \
    --cc=linux@roeck-us.net \
    --cc=matti.vaittinen@fi.rohmeurope.com \
    --cc=mazziesaccount@gmail.com \
    --cc=rui.zhang@intel.com \
    /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;
as well as URLs for NNTP newsgroup(s).