Skip to content

Commit 2c32b1d

Browse files
committed
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
2 parents 48fe37c + 15d0a87 commit 2c32b1d

File tree

3 files changed

+11
-13
lines changed

3 files changed

+11
-13
lines changed

drivers/pcmcia/cs.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -671,20 +671,22 @@ static int pccardd(void *__skt)
671671
socket_remove(skt);
672672
if (sysfs_events & PCMCIA_UEVENT_INSERT)
673673
socket_insert(skt);
674-
if ((sysfs_events & PCMCIA_UEVENT_RESUME) &&
675-
!(skt->state & SOCKET_CARDBUS)) {
676-
ret = socket_resume(skt);
677-
if (!ret && skt->callback)
678-
skt->callback->resume(skt);
679-
}
680674
if ((sysfs_events & PCMCIA_UEVENT_SUSPEND) &&
681675
!(skt->state & SOCKET_CARDBUS)) {
682676
if (skt->callback)
683677
ret = skt->callback->suspend(skt);
684678
else
685679
ret = 0;
686-
if (!ret)
680+
if (!ret) {
687681
socket_suspend(skt);
682+
msleep(100);
683+
}
684+
}
685+
if ((sysfs_events & PCMCIA_UEVENT_RESUME) &&
686+
!(skt->state & SOCKET_CARDBUS)) {
687+
ret = socket_resume(skt);
688+
if (!ret && skt->callback)
689+
skt->callback->resume(skt);
688690
}
689691
if ((sysfs_events & PCMCIA_UEVENT_REQUERY) &&
690692
!(skt->state & SOCKET_CARDBUS)) {

drivers/pcmcia/ds.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1283,6 +1283,7 @@ static int ds_event(struct pcmcia_socket *skt, event_t event, int priority)
12831283
destroy_cis_cache(skt);
12841284
kfree(skt->fake_cis);
12851285
skt->fake_cis = NULL;
1286+
s->functions = 0;
12861287
mutex_unlock(&s->ops_mutex);
12871288
/* now, add the new card */
12881289
ds_event(skt, CS_EVENT_CARD_INSERTION,

drivers/pcmcia/pcmcia_ioctl.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,7 @@ static int ds_open(struct inode *inode, struct file *file)
711711
warning_printed = 1;
712712
}
713713

714-
if (s->pcmcia_state.present)
714+
if (atomic_read(&s->present))
715715
queue_event(user, CS_EVENT_CARD_INSERTION);
716716
out:
717717
unlock_kernel();
@@ -770,9 +770,6 @@ static ssize_t ds_read(struct file *file, char __user *buf,
770770
return -EIO;
771771

772772
s = user->socket;
773-
if (s->pcmcia_state.dead)
774-
return -EIO;
775-
776773
ret = wait_event_interruptible(s->queue, !queue_empty(user));
777774
if (ret == 0)
778775
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,
838835
return -EIO;
839836

840837
s = user->socket;
841-
if (s->pcmcia_state.dead)
842-
return -EIO;
843838

844839
size = (cmd & IOCSIZE_MASK) >> IOCSIZE_SHIFT;
845840
if (size > sizeof(ds_ioctl_arg_t))

0 commit comments

Comments
 (0)