Merge branch 'urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6
* 'urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6: pcmcia: fix compilation after 16bit state locking changes pcmcia: order userspace suspend and resume requests pcmcia: avoid pccard_validate_cis failure in resume callpath
This commit is contained in:
commit
2c32b1dab5
|
@ -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)) {
|
||||||
|
|
|
@ -1283,6 +1283,7 @@ static int ds_event(struct pcmcia_socket *skt, event_t event, int priority)
|
||||||
destroy_cis_cache(skt);
|
destroy_cis_cache(skt);
|
||||||
kfree(skt->fake_cis);
|
kfree(skt->fake_cis);
|
||||||
skt->fake_cis = NULL;
|
skt->fake_cis = NULL;
|
||||||
|
s->functions = 0;
|
||||||
mutex_unlock(&s->ops_mutex);
|
mutex_unlock(&s->ops_mutex);
|
||||||
/* now, add the new card */
|
/* now, add the new card */
|
||||||
ds_event(skt, CS_EVENT_CARD_INSERTION,
|
ds_event(skt, CS_EVENT_CARD_INSERTION,
|
||||||
|
|
|
@ -711,7 +711,7 @@ static int ds_open(struct inode *inode, struct file *file)
|
||||||
warning_printed = 1;
|
warning_printed = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (s->pcmcia_state.present)
|
if (atomic_read(&s->present))
|
||||||
queue_event(user, CS_EVENT_CARD_INSERTION);
|
queue_event(user, CS_EVENT_CARD_INSERTION);
|
||||||
out:
|
out:
|
||||||
unlock_kernel();
|
unlock_kernel();
|
||||||
|
@ -770,9 +770,6 @@ static ssize_t ds_read(struct file *file, char __user *buf,
|
||||||
return -EIO;
|
return -EIO;
|
||||||
|
|
||||||
s = user->socket;
|
s = user->socket;
|
||||||
if (s->pcmcia_state.dead)
|
|
||||||
return -EIO;
|
|
||||||
|
|
||||||
ret = wait_event_interruptible(s->queue, !queue_empty(user));
|
ret = wait_event_interruptible(s->queue, !queue_empty(user));
|
||||||
if (ret == 0)
|
if (ret == 0)
|
||||||
ret = put_user(get_queued_event(user), (int __user *)buf) ? -EFAULT : 4;
|
ret = put_user(get_queued_event(user), (int __user *)buf) ? -EFAULT : 4;
|
||||||
|
@ -838,8 +835,6 @@ static int ds_ioctl(struct inode *inode, struct file *file,
|
||||||
return -EIO;
|
return -EIO;
|
||||||
|
|
||||||
s = user->socket;
|
s = user->socket;
|
||||||
if (s->pcmcia_state.dead)
|
|
||||||
return -EIO;
|
|
||||||
|
|
||||||
size = (cmd & IOCSIZE_MASK) >> IOCSIZE_SHIFT;
|
size = (cmd & IOCSIZE_MASK) >> IOCSIZE_SHIFT;
|
||||||
if (size > sizeof(ds_ioctl_arg_t))
|
if (size > sizeof(ds_ioctl_arg_t))
|
||||||
|
|
Loading…
Reference in New Issue