* USB enumeration post-resume NOT persistent yet "persist" --> swapped devices nodes --> root partition reference broken
@ 2012-07-19 4:09 Andreas Mohr
2012-07-19 15:11 ` Alan Stern
0 siblings, 1 reply; 4+ messages in thread
From: Andreas Mohr @ 2012-07-19 4:09 UTC (permalink / raw)
To: linux-kernel, linux-usb
Hi,
Yesterday I was surprised to see that with *another* external USB disk
happening to be connected before boot,
the system booted with root partition device sdb1 assigned rather than sda1.
Not thinking much, I then proceeded putting the system into suspend,
only to be even more surprised to then end up with swapped device nodes
post-resume and the system killed
(I *know* that device nodes ended up jumbled since the root device contains
"root" plus "swap" partition device node, whereas the "other" USB device
contains one partition only,
and the set of partition device nodes as still successfully looked up via
ls -l /dev/sd*
ended up exactly reversed after system resume).
I attempted to get dmesg off this system, however not even plain sector writing
of my /tmp/dmesg.log to a new USB device worked since "dd" segfaulted.
Also, no network access of course.
http://lists.linux-foundation.org/pipermail/linux-pm/2009-November/023101.html
talks about this case, and mentions Documentation/usb/persist.txt
as the most authoritative document.
The thing is, /sys persist nodes *are* all set to 1 for any affected
device (at least as observed after the subsequent fresh boot).
The plausibility of the previous killed boot having had "persist"
attribute set as well for all devices is VERY high
(there were no changes/updates in system software configuration done,
thus settings should have been identical).
Thus I'm highly puzzled as to why with USB persistence *activated*
it still decided to jumble device nodes on this system resume.
Content of the pathological dmesg log didn't contain any mentioning
of any "persistence" mechanism activity, BTW, AFAIR.
Device identification *is* as unique as it gets:
# lsusb
Bus 001 Device 005: ID 174c:55aa ASMedia Technology Inc.
Bus 001 Device 002: ID 152d:0601 JMicron Technology Corp. / JMicron USA Technology Corp.
Bus 001 Device 004: ID 064e:d101 Suyin Corp. Acer CrystalEye Webcam
Bus 003 Device 002: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
andinet sys # find . -name "*persist*"
./devices/pci0000:00/0000:00:1c.2/0000:03:00.0/ieee80211/phy0/rfkill1/persistent
./devices/pci0000:00/0000:00:1d.1/usb3/3-2/3-2:1.0/bluetooth/hci0/rfkill0/persistent
./devices/pci0000:00/0000:00:1d.1/usb3/3-2/power/persist
./devices/pci0000:00/0000:00:1d.7/usb1/1-1/power/persist
./devices/pci0000:00/0000:00:1d.7/usb1/1-2/power/persist
./devices/pci0000:00/0000:00:1d.7/usb1/1-5/power/persist
andinet sys # cat ./devices/pci0000:00/0000:00:1d.7/usb1/1-2/product
TS32GSSD18M-M
andinet sys # cat ./devices/pci0000:00/0000:00:1d.7/usb1/1-2/power/persist
1
andinet sys # cat ./devices/pci0000:00/0000:00:1d.7/usb1/1-5/product
Acer Crystal Eye webcam
andinet sys # cat ./devices/pci0000:00/0000:00:1d.7/usb1/1-5/power/persist
1
andinet sys # cat ./devices/pci0000:00/0000:00:1d.7/usb1/1-1/product
MEDION HDDrive-n-GO
andinet sys # cat ./devices/pci0000:00/0000:00:1d.7/usb1/1-1/power/persist
1
(TS32GSSD18M-M is USB-connected root partition SSD)
Netbook Acer Aspire One A110L.
Running 3.5.0-rc7+ here (yes ma'am, bleeding edge tester :).
Was the first time to attempt resume with an additional device remaining
connected, IIRC - that -rc7 thing likely doesn't play much of a role here.
A bit hesitant to (dis-)prove the bug's "regression flag" with another version
since random possibly succeeding I/O accesses to incompatible devices
are not necessarily my thing (or is this safe to attempt again? Any more
specific session info one would need?).
So, again, possibly USB persistence is bug-broken?
Posted to linux-usb (discussion) and lkml (kernel bug?).
Thanks,
Andreas Mohr
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: USB enumeration post-resume NOT persistent yet "persist" --> swapped devices nodes --> root partition reference broken
2012-07-19 4:09 USB enumeration post-resume NOT persistent yet "persist" --> swapped devices nodes --> root partition reference broken Andreas Mohr
@ 2012-07-19 15:11 ` Alan Stern
2012-07-19 17:30 ` Andreas Mohr
0 siblings, 1 reply; 4+ messages in thread
From: Alan Stern @ 2012-07-19 15:11 UTC (permalink / raw)
To: Andreas Mohr; +Cc: linux-kernel, linux-usb
On Thu, 19 Jul 2012, Andreas Mohr wrote:
> Hi,
>
> Yesterday I was surprised to see that with *another* external USB disk
> happening to be connected before boot,
> the system booted with root partition device sdb1 assigned rather than sda1.
> Not thinking much, I then proceeded putting the system into suspend,
Do you mean "suspend" or "hibernate"?
> only to be even more surprised to then end up with swapped device nodes
> post-resume and the system killed
> (I *know* that device nodes ended up jumbled since the root device contains
> "root" plus "swap" partition device node, whereas the "other" USB device
> contains one partition only,
> and the set of partition device nodes as still successfully looked up via
> ls -l /dev/sd*
> ended up exactly reversed after system resume).
That shouldn't happen in any case, but it seems more likely to happen
after hibernation than after suspend.
> I attempted to get dmesg off this system, however not even plain sector writing
> of my /tmp/dmesg.log to a new USB device worked since "dd" segfaulted.
> Also, no network access of course.
Can you reproduce the problem?
> http://lists.linux-foundation.org/pipermail/linux-pm/2009-November/023101.html
> talks about this case, and mentions Documentation/usb/persist.txt
> as the most authoritative document.
>
> The thing is, /sys persist nodes *are* all set to 1 for any affected
> device (at least as observed after the subsequent fresh boot).
>
> The plausibility of the previous killed boot having had "persist"
> attribute set as well for all devices is VERY high
> (there were no changes/updates in system software configuration done,
> thus settings should have been identical).
>
> Thus I'm highly puzzled as to why with USB persistence *activated*
> it still decided to jumble device nodes on this system resume.
> Content of the pathological dmesg log didn't contain any mentioning
> of any "persistence" mechanism activity, BTW, AFAIR.
>
> Device identification *is* as unique as it gets:
>
> # lsusb
> Bus 001 Device 005: ID 174c:55aa ASMedia Technology Inc.
> Bus 001 Device 002: ID 152d:0601 JMicron Technology Corp. / JMicron USA Technology Corp.
> Bus 001 Device 004: ID 064e:d101 Suyin Corp. Acer CrystalEye Webcam
> Bus 003 Device 002: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
> Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
> Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
> Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
> Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
> Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
...
> Netbook Acer Aspire One A110L.
> Running 3.5.0-rc7+ here (yes ma'am, bleeding edge tester :).
> Was the first time to attempt resume with an additional device remaining
> connected, IIRC - that -rc7 thing likely doesn't play much of a role here.
> A bit hesitant to (dis-)prove the bug's "regression flag" with another version
> since random possibly succeeding I/O accesses to incompatible devices
> are not necessarily my thing (or is this safe to attempt again? Any more
> specific session info one would need?).
Well, the dmesg log would help. If you still think the USB layer is at
fault then you should enable CONFIG_USB_DEBUG.
> So, again, possibly USB persistence is bug-broken?
You don't have any good evidence to suggest that. None of the
information you provided indicates that any USB device nodes (such as
/dev/bus/usb/001/002) got mixed up. All you know is that the
block-layer device nodes (such as /dev/sda2) got changed.
Furthermore, if USB persist were broken then the symptoms would be
different. Instead of starting with a root partition at sdb1 and then
finding it at sda1, you would have found it gone completely and there
would be _new_ devices labelled sdc and sdd.
Alan Stern
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: USB enumeration post-resume NOT persistent yet "persist" --> swapped devices nodes --> root partition reference broken
2012-07-19 15:11 ` Alan Stern
@ 2012-07-19 17:30 ` Andreas Mohr
2012-07-19 19:03 ` Alan Stern
0 siblings, 1 reply; 4+ messages in thread
From: Andreas Mohr @ 2012-07-19 17:30 UTC (permalink / raw)
To: Alan Stern; +Cc: Andreas Mohr, linux-kernel, linux-usb
Hi,
On Thu, Jul 19, 2012 at 11:11:50AM -0400, Alan Stern wrote:
> On Thu, 19 Jul 2012, Andreas Mohr wrote:
>
> > Hi,
> >
> > Yesterday I was surprised to see that with *another* external USB disk
> > happening to be connected before boot,
> > the system booted with root partition device sdb1 assigned rather than sda1.
> > Not thinking much, I then proceeded putting the system into suspend,
>
> Do you mean "suspend" or "hibernate"?
Doh - S2R. I don't do persistent hibernate here (writing some 1GB of data
to flash-based storage each time possibly isn't all too healthy anyway).
> Can you reproduce the problem?
Will retry soonish.
> > http://lists.linux-foundation.org/pipermail/linux-pm/2009-November/023101.html
> > Netbook Acer Aspire One A110L.
> > Running 3.5.0-rc7+ here (yes ma'am, bleeding edge tester :).
> > Was the first time to attempt resume with an additional device remaining
> > connected, IIRC - that -rc7 thing likely doesn't play much of a role here.
> > A bit hesitant to (dis-)prove the bug's "regression flag" with another version
> > since random possibly succeeding I/O accesses to incompatible devices
> > are not necessarily my thing (or is this safe to attempt again? Any more
> > specific session info one would need?).
>
> Well, the dmesg log would help. If you still think the USB layer is at
> fault then you should enable CONFIG_USB_DEBUG.
Maybe I can get this successfully off the machine next time,
by pre-caching required binaries prior to initiating a non-working resume.
> > So, again, possibly USB persistence is bug-broken?
>
> You don't have any good evidence to suggest that. None of the
> information you provided indicates that any USB device nodes (such as
> /dev/bus/usb/001/002) got mixed up. All you know is that the
> block-layer device nodes (such as /dev/sda2) got changed.
OK - so you're trying in vain to tell dense me that I'm supposed to
take note of the *non-changing* (i.e., correctly "persistent")
USB device ID scheme rather than the roguely changing device nodes.
To which I say that unfortunately I don't have a pre/post comparison
at this moment yet.
> Furthermore, if USB persist were broken then the symptoms would be
> different. Instead of starting with a root partition at sdb1 and then
> finding it at sda1, you would have found it gone completely and there
> would be _new_ devices labelled sdc and sdd.
Ah, yeah - I tend to know *this* other effect, too...
> Alan Stern
Thanks a ton for your reply!
Now I know that there's a tendency to better look on the other side
(block device layer etc.) and analyze things there,
once it's established that USB topology ID numbering in fact did persist.
Andreas Mohr
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: USB enumeration post-resume NOT persistent yet "persist" --> swapped devices nodes --> root partition reference broken
2012-07-19 17:30 ` Andreas Mohr
@ 2012-07-19 19:03 ` Alan Stern
0 siblings, 0 replies; 4+ messages in thread
From: Alan Stern @ 2012-07-19 19:03 UTC (permalink / raw)
To: Andreas Mohr; +Cc: linux-kernel, linux-usb
On Thu, 19 Jul 2012, Andreas Mohr wrote:
> Hi,
>
> On Thu, Jul 19, 2012 at 11:11:50AM -0400, Alan Stern wrote:
> > On Thu, 19 Jul 2012, Andreas Mohr wrote:
> >
> > > Hi,
> > >
> > > Yesterday I was surprised to see that with *another* external USB disk
> > > happening to be connected before boot,
> > > the system booted with root partition device sdb1 assigned rather than sda1.
> > > Not thinking much, I then proceeded putting the system into suspend,
> >
> > Do you mean "suspend" or "hibernate"?
>
> Doh - S2R. I don't do persistent hibernate here (writing some 1GB of data
> to flash-based storage each time possibly isn't all too healthy anyway).
>
> > Can you reproduce the problem?
>
> Will retry soonish.
It's understandable that you might not want to risk corrupting an
important filesystem. Some systems allow you to run with a read-only
root and no swap; you could try that. Or run entirely from within an
initramfs image, the way a Rescue CD does.
> > > http://lists.linux-foundation.org/pipermail/linux-pm/2009-November/023101.html
> > > Netbook Acer Aspire One A110L.
> > > Running 3.5.0-rc7+ here (yes ma'am, bleeding edge tester :).
> > > Was the first time to attempt resume with an additional device remaining
> > > connected, IIRC - that -rc7 thing likely doesn't play much of a role here.
> > > A bit hesitant to (dis-)prove the bug's "regression flag" with another version
> > > since random possibly succeeding I/O accesses to incompatible devices
> > > are not necessarily my thing (or is this safe to attempt again? Any more
> > > specific session info one would need?).
> >
> > Well, the dmesg log would help. If you still think the USB layer is at
> > fault then you should enable CONFIG_USB_DEBUG.
>
> Maybe I can get this successfully off the machine next time,
> by pre-caching required binaries prior to initiating a non-working resume.
Running within an initramfs image would probably avoid this problem.
> > > So, again, possibly USB persistence is bug-broken?
> >
> > You don't have any good evidence to suggest that. None of the
> > information you provided indicates that any USB device nodes (such as
> > /dev/bus/usb/001/002) got mixed up. All you know is that the
> > block-layer device nodes (such as /dev/sda2) got changed.
>
> OK - so you're trying in vain to tell dense me that I'm supposed to
> take note of the *non-changing* (i.e., correctly "persistent")
> USB device ID scheme rather than the roguely changing device nodes.
> To which I say that unfortunately I don't have a pre/post comparison
> at this moment yet.
That's one of the reasons why reproducing the problem is important.
> > Furthermore, if USB persist were broken then the symptoms would be
> > different. Instead of starting with a root partition at sdb1 and then
> > finding it at sda1, you would have found it gone completely and there
> > would be _new_ devices labelled sdc and sdd.
>
> Ah, yeah - I tend to know *this* other effect, too...
Not recently, I hope!
> > Alan Stern
>
> Thanks a ton for your reply!
> Now I know that there's a tendency to better look on the other side
> (block device layer etc.) and analyze things there,
> once it's established that USB topology ID numbering in fact did persist.
What you described does sound very weird. The relation between block
devices and the underlying physical devices is determined entirely by
software data structures, which should not change over the course of a
suspend. I don't understand how it could have happened.
Alan Stern
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-07-19 19:04 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-19 4:09 USB enumeration post-resume NOT persistent yet "persist" --> swapped devices nodes --> root partition reference broken Andreas Mohr
2012-07-19 15:11 ` Alan Stern
2012-07-19 17:30 ` Andreas Mohr
2012-07-19 19:03 ` Alan Stern
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®