Bug 188221

Summary: bios startup block
Product: ACPI Reporter: lercoli4670
Component: OtherAssignee: Mika Westerberg (mika.westerberg)
Status: CLOSED UNREPRODUCIBLE    
Severity: normal CC: lercoli4670, rjw, rui.zhang, scrt.arc
Priority: P1    
Hardware: Intel   
OS: Linux   
Kernel Version: 4.9.0-rc6 Subsystem:
Regression: No Bisected commit-id:
Attachments: kernel_v4.8.9_config_file
kernel_v4.9.0-rc6_config_file
acpidump file
iomem file
ioport file
iomem.txt file
ioports.txt file
wdat_wdt debug patch

Description lercoli4670 2016-11-21 08:27:05 UTC
When I start my Toshiba Satellite Pro C850-147 (Intel® Core™ i5-3210M) 
with O.S. Ubuntu 16.04.1 LTS I get on BIOS screen :

[   1.138599] platform wdat_wdt :failed to claim resource 4
[   1.138605] ACPI : watchdog : Failed to create platform devices
Comment 1 Zhang Rui 2016-11-21 11:15:48 UTC
please attach the acpidump output

BTW, what makes you think this is a regression? is there any earlier kernel version that you don't see this message?
Comment 2 lercoli4670 2016-11-21 12:28:28 UTC
I'm using kernel v4.8.9 and before v4.4.30.
With these kernels I don't have this BIOS error message.
Comment 3 Zhang Rui 2016-11-21 12:34:16 UTC
(In reply to lercoli4670 from comment #2)
> I'm using kernel v4.8.9 and before v4.4.30.
> With these kernels I don't have this BIOS error message.

then it would be good if you can attach the kernel config file you're using for both 4.8.9 and 4.9.0-rc6
Comment 4 lercoli4670 2016-11-21 13:07:18 UTC
Created attachment 245251 [details]
kernel_v4.8.9_config_file
Comment 5 lercoli4670 2016-11-21 13:08:17 UTC
Created attachment 245261 [details]
kernel_v4.9.0-rc6_config_file
Comment 6 Rafael J. Wysocki 2016-11-21 22:26:02 UTC
The message comes from a driver that is new in 4.9-rc.

Please don't guess things, it isn't helpful.
Comment 7 lercoli4670 2016-11-22 07:55:24 UTC
I'm a Linux user not a Linux developer so my perspective is different of yours.
That's all.
However, to avoid misunderstandings, I'll never change the Regression listbox anymore.
Comment 8 Zhang Rui 2016-11-22 08:16:33 UTC
please attach the acpidump output, which is helpful to debug this issue
Comment 9 lercoli4670 2016-11-22 09:18:15 UTC
Created attachment 245551 [details]
acpidump file
Comment 10 Mika Westerberg 2016-11-22 09:20:13 UTC
Please also attach content of /proc/iomem and /proc/ioports.
Comment 11 lercoli4670 2016-11-22 10:26:54 UTC
Created attachment 245571 [details]
iomem file
Comment 12 lercoli4670 2016-11-22 10:27:18 UTC
Created attachment 245581 [details]
ioport file
Comment 13 Mika Westerberg 2016-11-22 10:40:24 UTC
Ah, you need to be root in order to see the offsets. Can you do something like this instead:

  $ sudo cat /proc/ioports > ioports.txt
  $ sudo cat /proc/iomem > iomem.txt

and attach those.
Comment 14 lercoli4670 2016-11-22 11:39:32 UTC
Created attachment 245591 [details]
iomem.txt file
Comment 15 lercoli4670 2016-11-22 11:40:00 UTC
Created attachment 245601 [details]
ioports.txt file
Comment 16 Mika Westerberg 2016-11-22 12:06:06 UTC
Created attachment 245611 [details]
wdat_wdt debug patch
Comment 17 Mika Westerberg 2016-11-22 12:07:46 UTC
Can you try the attached patch? It prints out all the watchdog resources so that we can see the actual conflict. Once you have the patch applied please attach dmesg to this bug.
Comment 18 lercoli4670 2016-11-22 12:29:49 UTC
Could you tell me how to try this attached path ?
Comment 19 Mika Westerberg 2016-11-22 12:39:59 UTC
Assuming you know how to build the kernel (since you are already using v4.9-rc6):

1. Save the patch somewhere under your Linux source tree
2. Run 'git apply path/to/wdat_wdt.diff'
3. Rebuild the kernel
4. Install the kernel
5. Reboot
Comment 20 lercoli4670 2016-11-22 12:45:55 UTC
I don't build the kernel because I use the .deb files of Ubuntu at http://kernel.ubuntu.com/~kernel-ppa/mainline/.
Comment 21 Mika Westerberg 2016-11-22 13:46:17 UTC
OK, I think I already know what happens here.

The WDAT table uses RTC SRAM (port 0x70 and 0x71) to hold one bit at byte 0x45. That bit is set to one when the watchdog is started, and cleared when it is stopped. That particular I/O region is reserved for RTC according /proc/ioports:

  0070-0077 : rtc0

This is the reason why we fail to request it for wdat_wdt.

I'm not sure if this can be fixed easily because we really should not touch the RTC registers (even if those are not related to the RTC core functionality) from WDAT driver behind the RTC driver's back.
Comment 22 Rafael J. Wysocki 2016-11-23 02:02:00 UTC
Well, this is a tough one.

The driver does the right thing IMO, except that the messages might be less confusing.
Comment 23 Mika Westerberg 2016-11-23 08:43:30 UTC
OK thanks.

I think I'll submit a patch changing 
[   1.138605] ACPI : watchdog : Failed to create platform devices

to something like

[   1.138605] ACPI : watchdog : WDAT device creation failed

or similar. Maybe it is worth printing the conflicting resource in platform_device_create() as well.
Comment 24 lercoli4670 2016-11-23 11:21:39 UTC
Is there a workaround for my Toshiba/Ubuntu to use kernel v4.9.x ?
Comment 25 Mika Westerberg 2016-11-23 11:31:47 UTC
It is just a warning. Your system should work just fine but you cannot use WDAT watchdog on that.
Comment 26 lercoli4670 2016-11-23 12:49:44 UTC
I've checked watchdog on terminal and it's not installed on my Ubuntu 
so it should work.
Comment 27 lercoli4670 2016-11-28 08:34:44 UTC
Ok, with kernel v4.9.0-rc7 it works.
Thank You.
Comment 28 Socrates Archer 2017-03-19 11:29:03 UTC
How is this closed it's still happening through 3.10.x
toshiba Satelite here too
Comment 29 Socrates Archer 2017-03-19 11:29:49 UTC
*4.10.3+
Comment 30 lercoli4670 2017-03-19 16:39:00 UTC
I've tested it on kernel v4.10.4 and it works(Ubuntu 16.10).