Bug 97731 - Resume does not power up the second drive.
Summary: Resume does not power up the second drive.
Status: CLOSED DOCUMENTED
Alias: None
Product: ACPI
Classification: Unclassified
Component: BIOS (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: Rafael J. Wysocki
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-05 08:35 UTC by Marian Marinov
Modified: 2015-07-15 01:12 UTC (History)
4 users (show)

See Also:
Kernel Version: 3.15+
Subsystem:
Regression: Yes
Bisected commit-id:


Attachments
dmesg OK (55.77 KB, text/plain)
2015-05-05 21:16 UTC, Marian Marinov
Details
dmesg FAIL (56.27 KB, text/plain)
2015-05-05 21:17 UTC, Marian Marinov
Details
Add debug prints in ata hotplug function (553 bytes, patch)
2015-05-06 05:42 UTC, Aaron Lu
Details | Diff
dmesg FAIL2 (58.13 KB, text/plain)
2015-05-06 06:54 UTC, Marian Marinov
Details
acpidump (321.22 KB, application/octet-stream)
2015-05-06 07:41 UTC, Marian Marinov
Details
set is_dock_station flag for ACPI device node in scan (1.90 KB, patch)
2015-05-08 02:13 UTC, Aaron Lu
Details | Diff

Description Marian Marinov 2015-05-05 08:35:46 UTC
I have Lenovo T520 with one SSD and one SATA drive.

I tried to upgrade to Linux 4.0 and found that after suspend and resume I can't access the second (SATA) drive. I see I/O errors.
Both drives have bios encryption enabled.

I did a bisect and found that the following patch causes the issue:
commit 5d5132059a1f652de9dc2d62a8ff15561e648d11
Author: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Date:   Sat Feb 22 00:48:31 2014 +0100

    ACPI / ATA: Add hotplug contexts to ACPI companions of SATA devices
   
    Modify the SATA subsystem to add hotplug contexts to ACPI companions
    of SATA devices and ports instead of registering special ACPI dock
    operations using register_hotplug_dock_device().
   
    That change will allow the entire code handling those special ACPI
    dock operations to be dropped in the next commit.
   
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Reviewed-by: Aaron Lu <aaron.lu@intel.com>
    Acked-by: Tejun Heo <tj@kernel.org>

What other information would you need. I'm not sure what debug info to provide.
Comment 1 Rafael J. Wysocki 2015-05-05 11:03:54 UTC
First, please attach dmesg including a suspend-resume cycle from both the good and the failing kernels.
Comment 2 Marian Marinov 2015-05-05 21:16:33 UTC
Created attachment 175951 [details]
dmesg OK
Comment 3 Marian Marinov 2015-05-05 21:17:42 UTC
Created attachment 175961 [details]
dmesg FAIL

hackman@terion:~$ ll /storage/
ls: /storage/: Input/output error
ls: reading directory /storage/: Input/output error

These are the actual mounts.
/dev/sdb6 on /sdb type ext4 (rw,noatime,nodiratime)
/sdb/storage on /storage type none (rw,bind)
Comment 4 Marian Marinov 2015-05-05 21:19:15 UTC
sdb is the SATA drive. sda is the SSD(also the main drive of the machine).
If you want I can test what will happen if I boot from the SATA instead of the SSD.
Comment 5 Aaron Lu 2015-05-06 05:42:50 UTC
Created attachment 175971 [details]
Add debug prints in ata hotplug function

dmesg_fail:
... ...
PM: resume of devices complete after 621.025 msecs
Restarting tasks ... done.
video LNXVIDEO:00: Restoring backlight state
video LNXVIDEO:01: Restoring backlight state
ata2.00: disabled
ata2.00: detaching (SCSI 1:0:0:0)
... ...

Somehow, the SATA drive is detached, I suppose it received an eject event but that should be also true for pre v3.15 kernels. Anyway, I prepared a debug patch to see if it is really the case, please apply it and attach the dmesg after resume. Thanks.
Comment 6 Marian Marinov 2015-05-06 06:50:47 UTC
Here is my bisect log:
((no):~/Projects/linux-stable$ git bi log
git bisect start
# bad: [41b67d8f304f0c414b41eee2ede98caf897012a8] Linux 3.15.1
git bisect bad 41b67d8f304f0c414b41eee2ede98caf897012a8
# good: [387df1bd3fc46bc695b317dda38b3254f4409036] Linux 3.14.1
git bisect good 387df1bd3fc46bc695b317dda38b3254f4409036
# good: [455c6fdbd219161bd09b1165f11699d6d73de11c] Linux 3.14
git bisect good 455c6fdbd219161bd09b1165f11699d6d73de11c
# bad: [c96d6660dc65b0a90aea9834bfd8be1d5656da18] kernel: audit/fix non-modular users of module_init in core code
git bisect bad c96d6660dc65b0a90aea9834bfd8be1d5656da18
# bad: [c12e69c6aaf785fd307d05cb6f36ca0e7577ead7] Merge tag 'staging-3.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
git bisect bad c12e69c6aaf785fd307d05cb6f36ca0e7577ead7
# bad: [4b1779c2cf030c68aefe939d946475e4136c1895] Merge tag 'pci-v3.15-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci
git bisect bad 4b1779c2cf030c68aefe939d946475e4136c1895
# good: [683b6c6f82a60fabf47012581c2cfbf1b037ab95] Merge branch 'irq-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
git bisect good 683b6c6f82a60fabf47012581c2cfbf1b037ab95
# bad: [3786075b5ebc8c4eaefd9e3ebf72883934fb64b3] Merge tag 'regulator-v3.15' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator
git bisect bad 3786075b5ebc8c4eaefd9e3ebf72883934fb64b3
# bad: [d64b3932531cbc0c9d6bdb744446934435e9d6af] Merge tag 'pinctrl-v3.15-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl
git bisect bad d64b3932531cbc0c9d6bdb744446934435e9d6af
# bad: [36cc86e8ec1a0ab309052bc9b25e48a31288b8a5] Merge branches 'pm-runtime' and 'pm-sleep'
git bisect bad 36cc86e8ec1a0ab309052bc9b25e48a31288b8a5
# bad: [e25c5abf4125526d62417f8b5a314e743eefe900] Merge branches 'acpi-cleanup', 'acpi-thermal', 'acpi-pci', 'acpi-lpss' and 'acpi-button'
git bisect bad e25c5abf4125526d62417f8b5a314e743eefe900
# good: [3b52b21fa1f44c8956e21dfba645eda959111b5e] ACPI / dock: Use ACPI device object pointers instead of ACPI handles
git bisect good 3b52b21fa1f44c8956e21dfba645eda959111b5e
# bad: [75c44eddcb4989b85826143bc09fd3ad120abd4e] Merge branch 'acpi-config'
git bisect bad 75c44eddcb4989b85826143bc09fd3ad120abd4e
# bad: [1e3bcb596c6b1cf6db93f8f506e2de260e771bad] ACPI / hotplug: Rework deferred execution of acpi_device_hotplug()
git bisect bad 1e3bcb596c6b1cf6db93f8f506e2de260e771bad
# bad: [5d5132059a1f652de9dc2d62a8ff15561e648d11] ACPI / ATA: Add hotplug contexts to ACPI companions of SATA devices
git bisect bad 5d5132059a1f652de9dc2d62a8ff15561e648d11
# good: [be27b3dcb02335ec093b81053fc8c84b32d3106e] ACPI / dock: Add .uevent() callback to struct acpi_hotplug_context
git bisect good be27b3dcb02335ec093b81053fc8c84b32d3106e
# first bad commit: [5d5132059a1f652de9dc2d62a8ff15561e648d11] ACPI / ATA: Add hotplug contexts to ACPI companions of SATA devices

dmesg with debug info is comming in :)
Comment 7 Marian Marinov 2015-05-06 06:54:50 UTC
Created attachment 175981 [details]
dmesg FAIL2
Comment 8 Aaron Lu 2015-05-06 07:08:44 UTC
So the SATA device node really gets an eject event for some reason. acpidump please:
# acpidump > acpidump.txt
Thanks.
Comment 9 Marian Marinov 2015-05-06 07:41:14 UTC
Created attachment 175991 [details]
acpidump
Comment 10 Aaron Lu 2015-05-06 09:06:21 UTC
Is the SATA drive attached to an ejectable place or just a normal SATA port?
Comment 11 Marian Marinov 2015-05-06 09:12:04 UTC
It is in the removable bay. I've replaced the CD with the SATA drive.
Comment 12 Aaron Lu 2015-05-07 07:32:29 UTC
Did you have CONFIG_ACPI_DOCK set?
Comment 13 Marian Marinov 2015-05-07 10:35:22 UTC
No I did not, because I'm not using a dock ;)

I rebuild the kernel with ACPI_DOCK and it FIXED the problem.

Tonight I'll check if it will work with 4.0 kernel as well.

Thank you very much!
Comment 14 Aaron Lu 2015-05-08 02:13:24 UTC
Created attachment 176171 [details]
set is_dock_station flag for ACPI device node in scan

Marian,

Please test this patch with CONFIG_ACPI_DOCK unselected(as you have done before), it should fix your problem. I think we need such a patch, or we may have another bug report of the same problem in the future.

Thanks.
Comment 15 Aaron Lu 2015-05-25 01:54:18 UTC
ping?
Comment 16 Marian Marinov 2015-05-25 02:12:15 UTC
Sorry, I'll send you results within the next 24hours.

Note You need to log in before you can comment on or make changes to this bug.