pcmcia: order userspace suspend and resume requests
Assert that userspace suspend and resume requests appearing (almost) immediately are executed in the following order: suspend, resume. This should result in "pccardctl reset" behaving the same as before. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
This commit is contained in:
parent
cc83b08fc7
commit
4382124207
|
@ -671,20 +671,22 @@ static int pccardd(void *__skt)
|
||||||
socket_remove(skt);
|
socket_remove(skt);
|
||||||
if (sysfs_events & PCMCIA_UEVENT_INSERT)
|
if (sysfs_events & PCMCIA_UEVENT_INSERT)
|
||||||
socket_insert(skt);
|
socket_insert(skt);
|
||||||
if ((sysfs_events & PCMCIA_UEVENT_RESUME) &&
|
|
||||||
!(skt->state & SOCKET_CARDBUS)) {
|
|
||||||
ret = socket_resume(skt);
|
|
||||||
if (!ret && skt->callback)
|
|
||||||
skt->callback->resume(skt);
|
|
||||||
}
|
|
||||||
if ((sysfs_events & PCMCIA_UEVENT_SUSPEND) &&
|
if ((sysfs_events & PCMCIA_UEVENT_SUSPEND) &&
|
||||||
!(skt->state & SOCKET_CARDBUS)) {
|
!(skt->state & SOCKET_CARDBUS)) {
|
||||||
if (skt->callback)
|
if (skt->callback)
|
||||||
ret = skt->callback->suspend(skt);
|
ret = skt->callback->suspend(skt);
|
||||||
else
|
else
|
||||||
ret = 0;
|
ret = 0;
|
||||||
if (!ret)
|
if (!ret) {
|
||||||
socket_suspend(skt);
|
socket_suspend(skt);
|
||||||
|
msleep(100);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ((sysfs_events & PCMCIA_UEVENT_RESUME) &&
|
||||||
|
!(skt->state & SOCKET_CARDBUS)) {
|
||||||
|
ret = socket_resume(skt);
|
||||||
|
if (!ret && skt->callback)
|
||||||
|
skt->callback->resume(skt);
|
||||||
}
|
}
|
||||||
if ((sysfs_events & PCMCIA_UEVENT_REQUERY) &&
|
if ((sysfs_events & PCMCIA_UEVENT_REQUERY) &&
|
||||||
!(skt->state & SOCKET_CARDBUS)) {
|
!(skt->state & SOCKET_CARDBUS)) {
|
||||||
|
|
Loading…
Reference in New Issue