pcmcia: move unbind/rebind into dev_pm_ops.complete
PATCH 2/6 pcmcia: move unbind/rebind into dev_pm_ops.complete
The idea of moving rebind procedure into pm.complete was taken from the usb-subsystem, which has similar problems with reattaching devices during/after resume.
---
Note: I'm not on the list; please keep the 'CC' if you have something to say :).
Regards,
Chr
--- drivers/pcmcia/cs.c | 22 ++++++++++++++++++---- 1 files changed, 18 insertions(+), 4 deletions(-)
drivers/pcmcia/cs.c +18 -4
@@ -512,6 +512,13 @@ static int socket_late_resume(struct pcmcia_socket *skt)return socket_insert (skt); } +if (!(skt->state &SOCKET_CARDBUS ) && (skt->callback)) + skt->callback->early_resume (skt); +return 0 ; +} + +static int socket_complete_resume (struct pcmcia_socket *skt) +{#ifdef CONFIG_CARDBUS if (skt->state &SOCKET_CARDBUS ) {/* We can't be sure the CardBus card is the same
@@ -519,11 +526,8 @@ static int socket_late_resume(struct pcmcia_socket *skt)* and re-add... */ cb_free (skt); cb_alloc(skt); - return 0; }#endif -if (!(skt->state &SOCKET_CARDBUS ) && (skt->callback)) - skt->callback->early_resume (skt);return 0 ; }
@@ -534,11 +538,15 @@ static int socket_late_resume(struct pcmcia_socket *skt)*/ static int socket_resume (struct pcmcia_socket *skt) { +int err;if (!(skt->state &SOCKET_SUSPEND ))return -EBUSY ;socket_early_resume (skt); -return socket_late_resume (skt); + err =socket_late_resume (skt); +if (!err) +socket_complete_resume (skt); +return err; }static void socket_remove (struct pcmcia_socket *skt)
@@ -849,6 +857,11 @@ static int __used pcmcia_socket_dev_resume(struct device *dev)return __pcmcia_pm_op (dev, socket_late_resume); } +static void __used pcmcia_socket_dev_complete (struct device *dev) +{ +__pcmcia_pm_op (dev, socket_complete_resume); +} +static const struct dev_pm_ops pcmcia_socket_pm_ops = {/* dev_resume may be called with IRQs enabled */ SET_SYSTEM_SLEEP_PM_OPS(NULL,
@@ -863,6 +876,7 @@ static const struct dev_pm_ops pcmcia_socket_pm_ops = { .resume_noirq = pcmcia_socket_dev_resume_noirq, .thaw_noirq = pcmcia_socket_dev_resume_noirq, .restore_noirq = pcmcia_socket_dev_resume_noirq, + .complete = pcmcia_socket_dev_complete, };#define PCMCIA_SOCKET_CLASS_PM_OPS (&pcmcia_socket_pm_ops)
Signature · 1 line
1.7.9.1
Dominik Brodowski
maintainerThis is patch 2/6 of which series? Does this depend upon other patches which are not yet in mainline?
Best,
Dominik
Quoted 91 lines · Christian Lamparter
The idea of moving rebind procedure into pm.complete was taken from the usb-subsystem, which has similar problems with reattaching devices during/after resume.
Signed-off-by Christian Lamparter <[email protected]>---
Note: I'm not on the list; please keep the 'CC' if you have something to say :).Regards,
Chr--- drivers/pcmcia/cs.c | 22 ++++++++++++++++++---- 1 files changed, 18 insertions(+), 4 deletions(-)drivers/pcmcia/cs.c +18
-4@@ -512,6 +512,13 @@ static int socket_late_resume(struct pcmcia_socket *skt)return socket_insert (skt); } +if (!(skt->state &SOCKET_CARDBUS ) && (skt->callback)) + skt->callback->early_resume (skt); +return 0 ; +} + +static int socket_complete_resume (struct pcmcia_socket *skt) +{#ifdef CONFIG_CARDBUS if (skt->state &SOCKET_CARDBUS ) {/* We can't be sure the CardBus card is the same @@ -519,11 +526,8 @@ static int socket_late_resume(struct pcmcia_socket *skt)* and re-add... */ cb_free (skt); cb_alloc(skt); - return 0; }#endif -if (!(skt->state &SOCKET_CARDBUS ) && (skt->callback)) - skt->callback->early_resume (skt);return 0 ; }@@ -534,11 +538,15 @@ static int socket_late_resume(struct pcmcia_socket *skt)*/ static int socket_resume (struct pcmcia_socket *skt) { +int err;if (!(skt->state &SOCKET_SUSPEND ))return -EBUSY ;socket_early_resume (skt); -return socket_late_resume (skt); + err =socket_late_resume (skt); +if (!err) +socket_complete_resume (skt); +return err; }static void socket_remove (struct pcmcia_socket *skt)@@ -849,6 +857,11 @@ static int __used pcmcia_socket_dev_resume(struct device *dev)return __pcmcia_pm_op (dev, socket_late_resume); } +static void __used pcmcia_socket_dev_complete (struct device *dev) +{ +__pcmcia_pm_op (dev, socket_complete_resume); +} +static const struct dev_pm_ops pcmcia_socket_pm_ops = {/* dev_resume may be called with IRQs enabled */ SET_SYSTEM_SLEEP_PM_OPS(NULL,@@ -863,6 +876,7 @@ static const struct dev_pm_ops pcmcia_socket_pm_ops = { .resume_noirq = pcmcia_socket_dev_resume_noirq, .thaw_noirq = pcmcia_socket_dev_resume_noirq, .restore_noirq = pcmcia_socket_dev_resume_noirq, + .complete = pcmcia_socket_dev_complete, };#define PCMCIA_SOCKET_CLASS_PM_OPS (&pcmcia_socket_pm_ops)Signature · 7 lines
1.7.9.1 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Quoted 2 lines · On Saturday 03 March 2012 23:01:17 Dominik Brodowski wrote:
This is patch 2/6 of which series? Does this depend upon other patches which are not yet in mainline?
please ignore the 2/6. I just haven't used git format-patch for a while ;).
But if you want to know, the other patches are not directly related to pcmcia.
"[RFC] firmware loader: retry _nowait requests when userhelper is not yet "
https://lkml.org/lkml/2012/3/3/102
[PATCH 1/2] p54: pass interface setup errors back to mac80211
http://marc.info/?l=linux-wireless&m=133080632610608
[PATCH 2/2] p54pci: use new driver.pm interface for suspend/resume
http://marc.info/?l=linux-wireless&m=133080636210610
[RFT 1/2] p54pci: convert driver to use asynchronous firmware loading
http://marc.info/?l=linux-wireless&m=133080766810882
[RFT 2/2] p54: only unregister ieee80211_hw when it has been registered
http://marc.info/?l=linux-wireless&m=133080767110883
Regards,
Christian
[keep cc]
Quoted 5 lines · On Saturday 03 March 2012 23:01:17 Dominik Brodowski wrote:
This is patch 2/6 of which series? Does this depend upon other patches which are not yet in mainline?
Best,
Dominik
Any news? Has somebody already queued the patch or has any comments? I would like to get this fixed so I can move on with p54.
Regards,
Christian