mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* drivers/watchdog/rave-sp-wdt.c:278: undefined reference to `nvmem_cell_get'
@ 2018-02-13  9:19 kbuild test robot
  2018-02-13  9:30 ` Lee Jones
  0 siblings, 1 reply; 5+ messages in thread
From: kbuild test robot @ 2018-02-13  9:19 UTC (permalink / raw)
  To: Andrey Smirnov
  Cc: kbuild-all, linux-kernel, Lee Jones, Guenter Roeck, Nikita Yushchenko

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   178e834c47b0d01352c48730235aae69898fbc02
commit: c3bb333457218ca4ed9553be47c0f567b4ef8a38 watchdog: Add RAVE SP watchdog driver
date:   5 weeks ago
config: x86_64-randconfig-u0-02131401 (attached as .config)
compiler: gcc-5 (Debian 5.5.0-3) 5.4.1 20171010
reproduce:
        git checkout c3bb333457218ca4ed9553be47c0f567b4ef8a38
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All errors (new ones prefixed by >>):

   drivers/watchdog/rave-sp-wdt.o: In function `rave_sp_wdt_probe':
>> drivers/watchdog/rave-sp-wdt.c:278: undefined reference to `nvmem_cell_get'
>> drivers/watchdog/rave-sp-wdt.c:281: undefined reference to `nvmem_cell_read'
>> drivers/watchdog/rave-sp-wdt.c:287: undefined reference to `nvmem_cell_put'
   make[2]: *** [vmlinux] Error 1

vim +278 drivers/watchdog/rave-sp-wdt.c

   252	
   253	static int rave_sp_wdt_probe(struct platform_device *pdev)
   254	{
   255		struct device *dev = &pdev->dev;
   256		struct watchdog_device *wdd;
   257		struct rave_sp_wdt *sp_wd;
   258		struct nvmem_cell *cell;
   259		__le16 timeout = 0;
   260		int ret;
   261	
   262		sp_wd = devm_kzalloc(dev, sizeof(*sp_wd), GFP_KERNEL);
   263		if (!sp_wd)
   264			return -ENOMEM;
   265	
   266		sp_wd->variant = of_device_get_match_data(dev);
   267		sp_wd->sp      = dev_get_drvdata(dev->parent);
   268	
   269		wdd              = &sp_wd->wdd;
   270		wdd->parent      = dev;
   271		wdd->info        = &rave_sp_wdt_info;
   272		wdd->ops         = &rave_sp_wdt_ops;
   273		wdd->min_timeout = sp_wd->variant->min_timeout;
   274		wdd->max_timeout = sp_wd->variant->max_timeout;
   275		wdd->status      = WATCHDOG_NOWAYOUT_INIT_STATUS;
   276		wdd->timeout     = 60;
   277	
 > 278		cell = nvmem_cell_get(dev, "wdt-timeout");
   279		if (!IS_ERR(cell)) {
   280			size_t len;
 > 281			void *value = nvmem_cell_read(cell, &len);
   282	
   283			if (!IS_ERR(value)) {
   284				memcpy(&timeout, value, min(len, sizeof(timeout)));
   285				kfree(value);
   286			}
 > 287			nvmem_cell_put(cell);
   288		}
   289		watchdog_init_timeout(wdd, le16_to_cpu(timeout), dev);
   290		watchdog_set_restart_priority(wdd, 255);
   291		watchdog_stop_on_unregister(wdd);
   292	
   293		sp_wd->reboot_notifier.notifier_call = rave_sp_wdt_reboot_notifier;
   294		ret = devm_register_reboot_notifier(dev, &sp_wd->reboot_notifier);
   295		if (ret) {
   296			dev_err(dev, "Failed to register reboot notifier\n");
   297			return ret;
   298		}
   299	
   300		/*
   301		 * We don't know if watchdog is running now. To be sure, let's
   302		 * start it and depend on watchdog core to ping it
   303		 */
   304		wdd->max_hw_heartbeat_ms = wdd->max_timeout * 1000;
   305		ret = rave_sp_wdt_start(wdd);
   306		if (ret) {
   307			dev_err(dev, "Watchdog didn't start\n");
   308			return ret;
   309		}
   310	
   311		ret = devm_watchdog_register_device(dev, wdd);
   312		if (ret) {
   313			dev_err(dev, "Failed to register watchdog device\n");
   314			rave_sp_wdt_stop(wdd);
   315			return ret;
   316		}
   317	
   318		return 0;
   319	}
   320	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

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

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

* Re: drivers/watchdog/rave-sp-wdt.c:278: undefined reference to `nvmem_cell_get'
  2018-02-13  9:19 drivers/watchdog/rave-sp-wdt.c:278: undefined reference to `nvmem_cell_get' kbuild test robot
@ 2018-02-13  9:30 ` Lee Jones
  2018-02-13 14:20   ` Andrey Smirnov
  0 siblings, 1 reply; 5+ messages in thread
From: Lee Jones @ 2018-02-13  9:30 UTC (permalink / raw)
  To: kbuild test robot
  Cc: Andrey Smirnov, kbuild-all, linux-kernel, Guenter Roeck,
	Nikita Yushchenko

On Tue, 13 Feb 2018, kbuild test robot wrote:

> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head:   178e834c47b0d01352c48730235aae69898fbc02
> commit: c3bb333457218ca4ed9553be47c0f567b4ef8a38 watchdog: Add RAVE SP watchdog driver
> date:   5 weeks ago
> config: x86_64-randconfig-u0-02131401 (attached as .config)
> compiler: gcc-5 (Debian 5.5.0-3) 5.4.1 20171010
> reproduce:
>         git checkout c3bb333457218ca4ed9553be47c0f567b4ef8a38
>         # save the attached .config to linux build tree
>         make ARCH=x86_64 
> 
> All errors (new ones prefixed by >>):
> 
>    drivers/watchdog/rave-sp-wdt.o: In function `rave_sp_wdt_probe':
> >> drivers/watchdog/rave-sp-wdt.c:278: undefined reference to `nvmem_cell_get'
> >> drivers/watchdog/rave-sp-wdt.c:281: undefined reference to `nvmem_cell_read'
> >> drivers/watchdog/rave-sp-wdt.c:287: undefined reference to `nvmem_cell_put'
>    make[2]: *** [vmlinux] Error 1

Looks like the RAVE Watchdog driver should select NVMEM?

> vim +278 drivers/watchdog/rave-sp-wdt.c
> 
>    252	
>    253	static int rave_sp_wdt_probe(struct platform_device *pdev)
>    254	{
>    255		struct device *dev = &pdev->dev;
>    256		struct watchdog_device *wdd;
>    257		struct rave_sp_wdt *sp_wd;
>    258		struct nvmem_cell *cell;
>    259		__le16 timeout = 0;
>    260		int ret;
>    261	
>    262		sp_wd = devm_kzalloc(dev, sizeof(*sp_wd), GFP_KERNEL);
>    263		if (!sp_wd)
>    264			return -ENOMEM;
>    265	
>    266		sp_wd->variant = of_device_get_match_data(dev);
>    267		sp_wd->sp      = dev_get_drvdata(dev->parent);
>    268	
>    269		wdd              = &sp_wd->wdd;
>    270		wdd->parent      = dev;
>    271		wdd->info        = &rave_sp_wdt_info;
>    272		wdd->ops         = &rave_sp_wdt_ops;
>    273		wdd->min_timeout = sp_wd->variant->min_timeout;
>    274		wdd->max_timeout = sp_wd->variant->max_timeout;
>    275		wdd->status      = WATCHDOG_NOWAYOUT_INIT_STATUS;
>    276		wdd->timeout     = 60;
>    277	
>  > 278		cell = nvmem_cell_get(dev, "wdt-timeout");
>    279		if (!IS_ERR(cell)) {
>    280			size_t len;
>  > 281			void *value = nvmem_cell_read(cell, &len);
>    282	
>    283			if (!IS_ERR(value)) {
>    284				memcpy(&timeout, value, min(len, sizeof(timeout)));
>    285				kfree(value);
>    286			}
>  > 287			nvmem_cell_put(cell);
>    288		}
>    289		watchdog_init_timeout(wdd, le16_to_cpu(timeout), dev);
>    290		watchdog_set_restart_priority(wdd, 255);
>    291		watchdog_stop_on_unregister(wdd);
>    292	
>    293		sp_wd->reboot_notifier.notifier_call = rave_sp_wdt_reboot_notifier;
>    294		ret = devm_register_reboot_notifier(dev, &sp_wd->reboot_notifier);
>    295		if (ret) {
>    296			dev_err(dev, "Failed to register reboot notifier\n");
>    297			return ret;
>    298		}
>    299	
>    300		/*
>    301		 * We don't know if watchdog is running now. To be sure, let's
>    302		 * start it and depend on watchdog core to ping it
>    303		 */
>    304		wdd->max_hw_heartbeat_ms = wdd->max_timeout * 1000;
>    305		ret = rave_sp_wdt_start(wdd);
>    306		if (ret) {
>    307			dev_err(dev, "Watchdog didn't start\n");
>    308			return ret;
>    309		}
>    310	
>    311		ret = devm_watchdog_register_device(dev, wdd);
>    312		if (ret) {
>    313			dev_err(dev, "Failed to register watchdog device\n");
>    314			rave_sp_wdt_stop(wdd);
>    315			return ret;
>    316		}
>    317	
>    318		return 0;
>    319	}
>    320	
> 
> ---
> 0-DAY kernel test infrastructure                Open Source Technology Center
> https://lists.01.org/pipermail/kbuild-all                   Intel Corporation



-- 
Lee Jones
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* Re: drivers/watchdog/rave-sp-wdt.c:278: undefined reference to `nvmem_cell_get'
  2018-02-13  9:30 ` Lee Jones
@ 2018-02-13 14:20   ` Andrey Smirnov
  2018-02-13 14:37     ` Guenter Roeck
  2018-02-13 14:42     ` Guenter Roeck
  0 siblings, 2 replies; 5+ messages in thread
From: Andrey Smirnov @ 2018-02-13 14:20 UTC (permalink / raw)
  To: Lee Jones
  Cc: kbuild test robot, kbuild-all, linux-kernel, Guenter Roeck,
	Nikita Yushchenko

On Tue, Feb 13, 2018 at 1:30 AM, Lee Jones <lee.jones@linaro.org> wrote:
> On Tue, 13 Feb 2018, kbuild test robot wrote:
>
>> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
>> head:   178e834c47b0d01352c48730235aae69898fbc02
>> commit: c3bb333457218ca4ed9553be47c0f567b4ef8a38 watchdog: Add RAVE SP watchdog driver
>> date:   5 weeks ago
>> config: x86_64-randconfig-u0-02131401 (attached as .config)
>> compiler: gcc-5 (Debian 5.5.0-3) 5.4.1 20171010
>> reproduce:
>>         git checkout c3bb333457218ca4ed9553be47c0f567b4ef8a38
>>         # save the attached .config to linux build tree
>>         make ARCH=x86_64
>>
>> All errors (new ones prefixed by >>):
>>
>>    drivers/watchdog/rave-sp-wdt.o: In function `rave_sp_wdt_probe':
>> >> drivers/watchdog/rave-sp-wdt.c:278: undefined reference to `nvmem_cell_get'
>> >> drivers/watchdog/rave-sp-wdt.c:281: undefined reference to `nvmem_cell_read'
>> >> drivers/watchdog/rave-sp-wdt.c:287: undefined reference to `nvmem_cell_put'
>>    make[2]: *** [vmlinux] Error 1
>
> Looks like the RAVE Watchdog driver should select NVMEM?
>

AFAICT, this is happening when RAVE SP core and watchdog drivers are
built as built-in and NVMEM is selected as module. Looking at other
users on NVMEM in the kernel is seems that the pattern to prevent this
problem is to add "depends on NVMEM || !NVMEM" line to consumer's
Kconfig entry.

I'll submit a patch to that effect shortly.

Thanks,
Andrey Smirnov

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

* Re: drivers/watchdog/rave-sp-wdt.c:278: undefined reference to `nvmem_cell_get'
  2018-02-13 14:20   ` Andrey Smirnov
@ 2018-02-13 14:37     ` Guenter Roeck
  2018-02-13 14:42     ` Guenter Roeck
  1 sibling, 0 replies; 5+ messages in thread
From: Guenter Roeck @ 2018-02-13 14:37 UTC (permalink / raw)
  To: Andrey Smirnov, Lee Jones
  Cc: kbuild test robot, kbuild-all, linux-kernel, Nikita Yushchenko

On 02/13/2018 06:20 AM, Andrey Smirnov wrote:
> On Tue, Feb 13, 2018 at 1:30 AM, Lee Jones <lee.jones@linaro.org> wrote:
>> On Tue, 13 Feb 2018, kbuild test robot wrote:
>>
>>> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
>>> head:   178e834c47b0d01352c48730235aae69898fbc02
>>> commit: c3bb333457218ca4ed9553be47c0f567b4ef8a38 watchdog: Add RAVE SP watchdog driver
>>> date:   5 weeks ago
>>> config: x86_64-randconfig-u0-02131401 (attached as .config)
>>> compiler: gcc-5 (Debian 5.5.0-3) 5.4.1 20171010
>>> reproduce:
>>>          git checkout c3bb333457218ca4ed9553be47c0f567b4ef8a38
>>>          # save the attached .config to linux build tree
>>>          make ARCH=x86_64
>>>
>>> All errors (new ones prefixed by >>):
>>>
>>>     drivers/watchdog/rave-sp-wdt.o: In function `rave_sp_wdt_probe':
>>>>> drivers/watchdog/rave-sp-wdt.c:278: undefined reference to `nvmem_cell_get'
>>>>> drivers/watchdog/rave-sp-wdt.c:281: undefined reference to `nvmem_cell_read'
>>>>> drivers/watchdog/rave-sp-wdt.c:287: undefined reference to `nvmem_cell_put'
>>>     make[2]: *** [vmlinux] Error 1
>>
>> Looks like the RAVE Watchdog driver should select NVMEM?
>>
> 
> AFAICT, this is happening when RAVE SP core and watchdog drivers are
> built as built-in and NVMEM is selected as module. Looking at other
> users on NVMEM in the kernel is seems that the pattern to prevent this
> problem is to add "depends on NVMEM || !NVMEM" line to consumer's
> Kconfig entry.
> 
Makes sense, since the driver still works if NVMEM is not enabled at all.

> I'll submit a patch to that effect shortly.
> 
Thanks,
Guenter

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

* Re: drivers/watchdog/rave-sp-wdt.c:278: undefined reference to `nvmem_cell_get'
  2018-02-13 14:20   ` Andrey Smirnov
  2018-02-13 14:37     ` Guenter Roeck
@ 2018-02-13 14:42     ` Guenter Roeck
  1 sibling, 0 replies; 5+ messages in thread
From: Guenter Roeck @ 2018-02-13 14:42 UTC (permalink / raw)
  To: Andrey Smirnov, Lee Jones
  Cc: kbuild test robot, kbuild-all, linux-kernel, Nikita Yushchenko

On 02/13/2018 06:20 AM, Andrey Smirnov wrote:
> On Tue, Feb 13, 2018 at 1:30 AM, Lee Jones <lee.jones@linaro.org> wrote:
>> On Tue, 13 Feb 2018, kbuild test robot wrote:
>>
>>> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
>>> head:   178e834c47b0d01352c48730235aae69898fbc02
>>> commit: c3bb333457218ca4ed9553be47c0f567b4ef8a38 watchdog: Add RAVE SP watchdog driver
>>> date:   5 weeks ago
>>> config: x86_64-randconfig-u0-02131401 (attached as .config)
>>> compiler: gcc-5 (Debian 5.5.0-3) 5.4.1 20171010
>>> reproduce:
>>>          git checkout c3bb333457218ca4ed9553be47c0f567b4ef8a38
>>>          # save the attached .config to linux build tree
>>>          make ARCH=x86_64
>>>
>>> All errors (new ones prefixed by >>):
>>>
>>>     drivers/watchdog/rave-sp-wdt.o: In function `rave_sp_wdt_probe':
>>>>> drivers/watchdog/rave-sp-wdt.c:278: undefined reference to `nvmem_cell_get'
>>>>> drivers/watchdog/rave-sp-wdt.c:281: undefined reference to `nvmem_cell_read'
>>>>> drivers/watchdog/rave-sp-wdt.c:287: undefined reference to `nvmem_cell_put'
>>>     make[2]: *** [vmlinux] Error 1
>>
>> Looks like the RAVE Watchdog driver should select NVMEM?
>>
> 
> AFAICT, this is happening when RAVE SP core and watchdog drivers are
> built as built-in and NVMEM is selected as module. Looking at other
> users on NVMEM in the kernel is seems that the pattern to prevent this
> problem is to add "depends on NVMEM || !NVMEM" line to consumer's
> Kconfig entry.
> 
> I'll submit a patch to that effect shortly.
> 

Actually, no need to send it. Arnd Bergmann sent the patch already back in January,
only for some reason it got lost in the commit window. I'll discuss with Wim how
to send it upstream.

Guenter

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

end of thread, other threads:[~2018-02-13 14:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-02-13  9:19 drivers/watchdog/rave-sp-wdt.c:278: undefined reference to `nvmem_cell_get' kbuild test robot
2018-02-13  9:30 ` Lee Jones
2018-02-13 14:20   ` Andrey Smirnov
2018-02-13 14:37     ` Guenter Roeck
2018-02-13 14:42     ` Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®