linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* What happened to SUSPEND_SAVE_STATE?
@ 2003-09-10 20:11 Pavel Machek
  2003-09-10 20:49 ` Pavel Machek
  2003-09-10 22:22 ` Russell King
  0 siblings, 2 replies; 7+ messages in thread
From: Pavel Machek @ 2003-09-10 20:11 UTC (permalink / raw)
  To: Patrick Mochel, kernel list

Hi!

What happened to SUSPEND_SAVE_STATE?

pcmcia_socket_dev_suspend() still expects to receive it, but I do not
see any place where it is generated. Should it be killed from
device.h? And these 6 places fixed?

pavel@amd:/usr/src/linux$ grep SUSPEND_SAVE_STATE `find . -name "*.c"`
./arch/ppc/ocp/ocp-driver.c:            if (level == SUSPEND_SAVE_STATE && ocp_dev->driver->save_state)
./arch/arm/mach-sa1100/neponset.c:      if (level == SUSPEND_SAVE_STATE ||
./drivers/pcmcia/i82092.c:      return pcmcia_socket_dev_suspend(&dev->dev, state, SUSPEND_SAVE_STATE);
./drivers/pcmcia/sa1111_generic.c:      return pcmcia_socket_dev_suspend(&dev->dev, state, SUSPEND_SAVE_STATE);
./drivers/serial/8250_pci.c:                    serial8250_suspend_port(priv->line[i], SUSPEND_SAVE_STATE);
./drivers/serial/core.c:        case SUSPEND_SAVE_STATE:
pavel@amd:/usr/src/linux$

							Pavel
-- 
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: What happened to SUSPEND_SAVE_STATE?
  2003-09-10 20:11 What happened to SUSPEND_SAVE_STATE? Pavel Machek
@ 2003-09-10 20:49 ` Pavel Machek
  2003-09-10 22:25   ` Russell King
  2003-09-10 22:22 ` Russell King
  1 sibling, 1 reply; 7+ messages in thread
From: Pavel Machek @ 2003-09-10 20:49 UTC (permalink / raw)
  To: Pavel Machek; +Cc: Patrick Mochel, kernel list

Hi!

> What happened to SUSPEND_SAVE_STATE?

SUSPEND_NOTIFY seems dead, too. Should I simply ignore level parameter
in pcmcia_socket_dev_suspend?
								Pavel
-- 
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: What happened to SUSPEND_SAVE_STATE?
  2003-09-10 20:11 What happened to SUSPEND_SAVE_STATE? Pavel Machek
  2003-09-10 20:49 ` Pavel Machek
@ 2003-09-10 22:22 ` Russell King
  1 sibling, 0 replies; 7+ messages in thread
From: Russell King @ 2003-09-10 22:22 UTC (permalink / raw)
  To: Pavel Machek; +Cc: Patrick Mochel, kernel list

On Wed, Sep 10, 2003 at 10:11:26PM +0200, Pavel Machek wrote:
> pcmcia_socket_dev_suspend() still expects to receive it, but I do not
> see any place where it is generated. Should it be killed from
> device.h? And these 6 places fixed?

I've already fixed many of them, but I've introduced some others.

PPC people need to answer this:

> ./arch/ppc/ocp/ocp-driver.c:            if (level == SUSPEND_SAVE_STATE && ocp_dev->driver->save_state)

Fix pending merging:

> ./arch/arm/mach-sa1100/neponset.c:      if (level == SUSPEND_SAVE_STATE ||

These two will be gone shortly:

> ./drivers/pcmcia/i82092.c:      return pcmcia_socket_dev_suspend(&dev->dev, state, SUSPEND_SAVE_STATE);
> ./drivers/pcmcia/sa1111_generic.c:      return pcmcia_socket_dev_suspend(&dev->dev, state, SUSPEND_SAVE_STATE);

These two are already gone:

> ./drivers/serial/8250_pci.c:                    serial8250_suspend_port(priv->line[i], SUSPEND_SAVE_STATE);
> ./drivers/serial/core.c:        case SUSPEND_SAVE_STATE:

-- 
Russell King (rmk@arm.linux.org.uk)	http://www.arm.linux.org.uk/personal/
Linux kernel maintainer of:
  2.6 ARM Linux   - http://www.arm.linux.org.uk/
  2.6 PCMCIA      - http://pcmcia.arm.linux.org.uk/
  2.6 Serial core

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: What happened to SUSPEND_SAVE_STATE?
  2003-09-10 20:49 ` Pavel Machek
@ 2003-09-10 22:25   ` Russell King
  2003-09-10 22:36     ` Pavel Machek
  0 siblings, 1 reply; 7+ messages in thread
From: Russell King @ 2003-09-10 22:25 UTC (permalink / raw)
  To: Pavel Machek; +Cc: Patrick Mochel, kernel list

On Wed, Sep 10, 2003 at 10:49:43PM +0200, Pavel Machek wrote:
> Hi!
> 
> > What happened to SUSPEND_SAVE_STATE?
> 
> SUSPEND_NOTIFY seems dead, too. Should I simply ignore level parameter
> in pcmcia_socket_dev_suspend?

No.  Apply this patch (it's cut down from the stuff which is pending
for Linus - I hope I didn't make any mistakes doing that 8))

diff -Nru a/drivers/pcmcia/cs.c b/drivers/pcmcia/cs.c
--- a/drivers/pcmcia/cs.c	Wed Sep 10 23:18:32 2003
+++ b/drivers/pcmcia/cs.c	Wed Sep 10 23:18:32 2003
@@ -244,13 +244,10 @@
 static int socket_resume(struct pcmcia_socket *skt);
 static int socket_suspend(struct pcmcia_socket *skt);
 
-int pcmcia_socket_dev_suspend(struct device *dev, u32 state, u32 level)
+int pcmcia_socket_dev_suspend(struct device *dev, u32 state)
 {
 	struct pcmcia_socket *socket;
 
-	if (level != SUSPEND_SAVE_STATE)
-		return 0;
-
 	down_read(&pcmcia_socket_list_rwsem);
 	list_for_each_entry(socket, &pcmcia_socket_list, socket_list) {
 		if (socket->dev.dev != dev)
@@ -265,13 +262,10 @@
 }
 EXPORT_SYMBOL(pcmcia_socket_dev_suspend);
 
-int pcmcia_socket_dev_resume(struct device *dev, u32 level)
+int pcmcia_socket_dev_resume(struct device *dev)
 {
 	struct pcmcia_socket *socket;
 
-	if (level != RESUME_RESTORE_STATE)
-		return 0;
-
 	down_read(&pcmcia_socket_list_rwsem);
 	list_for_each_entry(socket, &pcmcia_socket_list, socket_list) {
 		if (socket->dev.dev != dev)
diff -Nru a/drivers/pcmcia/hd64465_ss.c b/drivers/pcmcia/hd64465_ss.c
--- a/drivers/pcmcia/hd64465_ss.c	Wed Sep 10 23:18:33 2003
+++ b/drivers/pcmcia/hd64465_ss.c	Wed Sep 10 23:18:33 2003
@@ -867,19 +867,32 @@
 	local_irq_restore(flags);
 }
 
+static int hd64465_suspend(struct device *dev, u32 state, u32 level)
+{
+	int ret = 0;
+	if (level == SUSPEND_SAVE_STATE)
+		ret = pcmcia_socket_dev_suspend(dev, state);
+	return ret;
+}
+
+static int hd64465_resume(struct device *dev, u32 level)
+{
+	int ret = 0;
+	if (level == RESUME_RESTORE_STATE)
+		ret = pcmcia_socket_dev_resume(dev);
+	return ret;
+}
+
 static struct device_driver hd64465_driver = {
 	.name = "hd64465-pcmcia",
 	.bus = &platform_bus_type,
-	.suspend = pcmcia_socket_dev_suspend,
-	.resume = pcmcia_socket_dev_resume,
+	.suspend = hd64465_suspend,
+	.resume = hd64465_resume,
 };
 
 static struct platform_device hd64465_device = {
 	.name = "hd64465-pcmcia",
 	.id = 0,
-	.dev = {
-		.name = "hd64465-pcmcia",
-	},
 };
 
 static int __init init_hs(void)
diff -Nru a/drivers/pcmcia/i82092.c b/drivers/pcmcia/i82092.c
--- a/drivers/pcmcia/i82092.c	Wed Sep 10 23:18:34 2003
+++ b/drivers/pcmcia/i82092.c	Wed Sep 10 23:18:34 2003
@@ -44,12 +44,12 @@
 
 static int i82092aa_socket_suspend (struct pci_dev *dev, u32 state)
 {
-	return pcmcia_socket_dev_suspend(&dev->dev, state, SUSPEND_SAVE_STATE);
+	return pcmcia_socket_dev_suspend(&dev->dev, state);
 }
 
 static int i82092aa_socket_resume (struct pci_dev *dev)
 {
-	return pcmcia_socket_dev_resume(&dev->dev, RESUME_RESTORE_STATE);
+	return pcmcia_socket_dev_resume(&dev->dev);
 }
 
 static struct pci_driver i82092aa_pci_drv = {
diff -Nru a/drivers/pcmcia/i82365.c b/drivers/pcmcia/i82365.c
--- a/drivers/pcmcia/i82365.c	Wed Sep 10 23:18:34 2003
+++ b/drivers/pcmcia/i82365.c	Wed Sep 10 23:18:34 2003
@@ -1351,11 +1351,27 @@
 
 /*====================================================================*/
 
+static int i82365_suspend(struct device *dev, u32 state, u32 level)
+{
+	int ret = 0;
+	if (level == SUSPEND_SAVE_STATE)
+		ret = pcmcia_socket_dev_suspend(dev, state);
+	return ret;
+}
+
+static int i82365_resume(struct device *dev, u32 level)
+{
+	int ret = 0;
+	if (level == RESUME_RESTORE_STATE)
+		ret = pcmcia_socket_dev_resume(dev);
+	return ret;
+}
+
 static struct device_driver i82365_driver = {
 	.name = "i82365",
 	.bus = &platform_bus_type,
-	.suspend = pcmcia_socket_dev_suspend,
-	.resume = pcmcia_socket_dev_resume,
+	.suspend = i82365_suspend,
+	.resume = i82365_resume,
 };
 
 static struct platform_device i82365_device = {
diff -Nru a/drivers/pcmcia/sa1100_generic.c b/drivers/pcmcia/sa1100_generic.c
--- a/drivers/pcmcia/sa1100_generic.c	Wed Sep 10 23:18:33 2003
+++ b/drivers/pcmcia/sa1100_generic.c	Wed Sep 10 23:18:33 2003
@@ -100,13 +100,29 @@
 	return ret;
 }
 
+static int sa11x0_drv_pcmcia_suspend(struct device *dev, u32 state, u32 level)
+{
+	int ret = 0;
+	if (level == SUSPEND_SAVE_STATE)
+		ret = pcmcia_socket_dev_suspend(dev, state);
+	return ret;
+}
+
+static int sa11x0_drv_pcmcia_resume(struct device *dev, u32 level)
+{
+	int ret = 0;
+	if (level == RESUME_RESTORE_STATE)
+		ret = pcmcia_socket_dev_resume(dev);
+	return ret;
+}
+
 static struct device_driver sa11x0_pcmcia_driver = {
 	.probe		= sa11x0_drv_pcmcia_probe,
 	.remove		= sa11xx_drv_pcmcia_remove,
 	.name		= "sa11x0-pcmcia",
 	.bus		= &platform_bus_type,
-	.suspend 	= pcmcia_socket_dev_suspend,
-	.resume 	= pcmcia_socket_dev_resume,
+	.suspend 	= sa11x0_drv_pcmcia_suspend,
+	.resume 	= sa11x0_drv_pcmcia_resume,
 };
 
 /* sa11x0_pcmcia_init()
diff -Nru a/drivers/pcmcia/sa1111_generic.c b/drivers/pcmcia/sa1111_generic.c
--- a/drivers/pcmcia/sa1111_generic.c	Wed Sep 10 23:18:32 2003
+++ b/drivers/pcmcia/sa1111_generic.c	Wed Sep 10 23:18:32 2003
@@ -171,12 +171,12 @@
 
 static int pcmcia_suspend(struct sa1111_dev *dev, u32 state)
 {
-	return pcmcia_socket_dev_suspend(&dev->dev, state, SUSPEND_SAVE_STATE);
+	return pcmcia_socket_dev_suspend(&dev->dev, state);
 }
 
 static int pcmcia_resume(struct sa1111_dev *dev)
 {
-	return pcmcia_socket_dev_resume(&dev->dev, RESUME_RESTORE_STATE);
+	return pcmcia_socket_dev_resume(&dev->dev);
 }
 
 static struct sa1111_driver pcmcia_driver = {
diff -Nru a/drivers/pcmcia/tcic.c b/drivers/pcmcia/tcic.c
--- a/drivers/pcmcia/tcic.c	Wed Sep 10 23:18:33 2003
+++ b/drivers/pcmcia/tcic.c	Wed Sep 10 23:18:33 2003
@@ -362,11 +362,27 @@
 
 /*====================================================================*/
 
+static int tcic_drv_suspend(struct device *dev, u32 state, u32 level)
+{
+	int ret = 0;
+	if (level == SUSPEND_SAVE_STATE)
+		ret = pcmcia_socket_dev_suspend(dev, state);
+	return ret;
+}
+
+static int tcic_drv_resume(struct device *dev, u32 level)
+{
+	int ret = 0;
+	if (level == RESUME_RESTORE_STATE)
+		ret = pcmcia_socket_dev_resume(dev);
+	return ret;
+}
+
 static struct device_driver tcic_driver = {
 	.name = "tcic-pcmcia",
 	.bus = &platform_bus_type,
-	.suspend = pcmcia_socket_dev_suspend,
-	.resume = pcmcia_socket_dev_resume,
+	.suspend = tcic_drv_suspend,
+	.resume = tcic_drv_resume,
 };
 
 static struct platform_device tcic_device = {
diff -Nru a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c
--- a/drivers/pcmcia/yenta_socket.c	Wed Sep 10 23:18:33 2003
+++ b/drivers/pcmcia/yenta_socket.c	Wed Sep 10 23:18:33 2003
@@ -937,7 +933,7 @@
 	struct yenta_socket *socket = pci_get_drvdata(dev);
 	int ret;
 
-	ret = pcmcia_socket_dev_suspend(&dev->dev, state, SUSPEND_SAVE_STATE);
+	ret = pcmcia_socket_dev_suspend(&dev->dev, state);
 
 	if (socket) {
 		if (socket->type && socket->type->save_state)
@@ -969,7 +965,7 @@
 			socket->type->restore_state(socket);
 	}
 
-	return pcmcia_socket_dev_resume(&dev->dev, RESUME_RESTORE_STATE);
+	return pcmcia_socket_dev_resume(&dev->dev);
 }
 
 
diff -Nru a/include/pcmcia/ss.h b/include/pcmcia/ss.h
--- a/include/pcmcia/ss.h	Wed Sep 10 23:18:34 2003
+++ b/include/pcmcia/ss.h	Wed Sep 10 23:18:34 2003
@@ -249,7 +249,7 @@
 extern struct class pcmcia_socket_class;
 
 /* socket drivers are expected to use these callbacks in their .drv struct */
-extern int pcmcia_socket_dev_suspend(struct device *dev, u32 state, u32 level);
-extern int pcmcia_socket_dev_resume(struct device *dev, u32 level);
+extern int pcmcia_socket_dev_suspend(struct device *dev, u32 state);
+extern int pcmcia_socket_dev_resume(struct device *dev);
 
 #endif /* _LINUX_SS_H */


-- 
Russell King (rmk@arm.linux.org.uk)	http://www.arm.linux.org.uk/personal/
Linux kernel maintainer of:
  2.6 ARM Linux   - http://www.arm.linux.org.uk/
  2.6 PCMCIA      - http://pcmcia.arm.linux.org.uk/
  2.6 Serial core

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: What happened to SUSPEND_SAVE_STATE?
  2003-09-10 22:25   ` Russell King
@ 2003-09-10 22:36     ` Pavel Machek
  2003-09-10 22:41       ` Russell King
  0 siblings, 1 reply; 7+ messages in thread
From: Pavel Machek @ 2003-09-10 22:36 UTC (permalink / raw)
  To: Russell King; +Cc: kernel list

Hi!

> > > What happened to SUSPEND_SAVE_STATE?
> > 
> > SUSPEND_NOTIFY seems dead, too. Should I simply ignore level parameter
> > in pcmcia_socket_dev_suspend?
> 
> No.  Apply this patch (it's cut down from the stuff which is pending
> for Linus - I hope I didn't make any mistakes doing that 8))

Thanks, but:

> diff -Nru a/drivers/pcmcia/i82365.c b/drivers/pcmcia/i82365.c
> --- a/drivers/pcmcia/i82365.c	Wed Sep 10 23:18:34 2003
> +++ b/drivers/pcmcia/i82365.c	Wed Sep 10 23:18:34 2003
> @@ -1351,11 +1351,27 @@
>  
>  /*====================================================================*/
>  
> +static int i82365_suspend(struct device *dev, u32 state, u32 level)
> +{
> +	int ret = 0;
> +	if (level == SUSPEND_SAVE_STATE)
> +		ret = pcmcia_socket_dev_suspend(dev, state);
> +	return ret;
> +}
> +
> +static int i82365_resume(struct device *dev, u32 level)
> +{
> +	int ret = 0;
> +	if (level == RESUME_RESTORE_STATE)
> +		ret = pcmcia_socket_dev_resume(dev);
> +	return ret;
> +}
> +
>  static struct device_driver i82365_driver = {
>  	.name = "i82365",
>  	.bus = &platform_bus_type,
> -	.suspend = pcmcia_socket_dev_suspend,
> -	.resume = pcmcia_socket_dev_resume,
> +	.suspend = i82365_suspend,
> +	.resume = i82365_resume,
>  };
>  
>  static struct platform_device i82365_device = {

I was not able to find *any* place in the tree that would call suspend
with SUSPEND_SAVE_STATE as level. Maybe just my grep was wrong?

								Pavel
-- 
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: What happened to SUSPEND_SAVE_STATE?
  2003-09-10 22:36     ` Pavel Machek
@ 2003-09-10 22:41       ` Russell King
  2003-09-10 23:06         ` Pavel Machek
  0 siblings, 1 reply; 7+ messages in thread
From: Russell King @ 2003-09-10 22:41 UTC (permalink / raw)
  To: Pavel Machek; +Cc: kernel list

On Thu, Sep 11, 2003 at 12:36:40AM +0200, Pavel Machek wrote:
> > diff -Nru a/drivers/pcmcia/i82365.c b/drivers/pcmcia/i82365.c
> > --- a/drivers/pcmcia/i82365.c	Wed Sep 10 23:18:34 2003
> > +++ b/drivers/pcmcia/i82365.c	Wed Sep 10 23:18:34 2003
> > @@ -1351,11 +1351,27 @@
> >  
> >  /*====================================================================*/
> >  
> > +static int i82365_suspend(struct device *dev, u32 state, u32 level)
> > +{
> > +	int ret = 0;
> > +	if (level == SUSPEND_SAVE_STATE)
> > +		ret = pcmcia_socket_dev_suspend(dev, state);
> > +	return ret;
> > +}
> > +
> > +static int i82365_resume(struct device *dev, u32 level)
> > +{
> > +	int ret = 0;
> > +	if (level == RESUME_RESTORE_STATE)
> > +		ret = pcmcia_socket_dev_resume(dev);
> > +	return ret;
> > +}
> > +
> >  static struct device_driver i82365_driver = {
> >  	.name = "i82365",
> >  	.bus = &platform_bus_type,
> > -	.suspend = pcmcia_socket_dev_suspend,
> > -	.resume = pcmcia_socket_dev_resume,
> > +	.suspend = i82365_suspend,
> > +	.resume = i82365_resume,
> >  };
> >  
> >  static struct platform_device i82365_device = {
> 
> I was not able to find *any* place in the tree that would call suspend
> with SUSPEND_SAVE_STATE as level. Maybe just my grep was wrong?

It is correct for the time being.  Well, as far as the ARM tree goes.
At the moment, the attitude towards platform devices seems to be "tough,
live with it."  So, I have my own work-arounds, and until such time that
mainline comes up with a solution, I'm happy.

-- 
Russell King (rmk@arm.linux.org.uk)	http://www.arm.linux.org.uk/personal/
Linux kernel maintainer of:
  2.6 ARM Linux   - http://www.arm.linux.org.uk/
  2.6 PCMCIA      - http://pcmcia.arm.linux.org.uk/
  2.6 Serial core

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: What happened to SUSPEND_SAVE_STATE?
  2003-09-10 22:41       ` Russell King
@ 2003-09-10 23:06         ` Pavel Machek
  0 siblings, 0 replies; 7+ messages in thread
From: Pavel Machek @ 2003-09-10 23:06 UTC (permalink / raw)
  To: kernel list, Patrick Mochel

Hi!

> > > diff -Nru a/drivers/pcmcia/i82365.c b/drivers/pcmcia/i82365.c
> > > --- a/drivers/pcmcia/i82365.c	Wed Sep 10 23:18:34 2003
> > > +++ b/drivers/pcmcia/i82365.c	Wed Sep 10 23:18:34 2003
> > > @@ -1351,11 +1351,27 @@
> > >  
> > >  /*====================================================================*/
> > >  
> > > +static int i82365_suspend(struct device *dev, u32 state, u32 level)
> > > +{
> > > +	int ret = 0;
> > > +	if (level == SUSPEND_SAVE_STATE)
> > > +		ret = pcmcia_socket_dev_suspend(dev, state);
> > > +	return ret;
> > > +}
> > > +
> > > +static int i82365_resume(struct device *dev, u32 level)
> > > +{
> > > +	int ret = 0;
> > > +	if (level == RESUME_RESTORE_STATE)
> > > +		ret = pcmcia_socket_dev_resume(dev);
> > > +	return ret;
> > > +}
> > > +
> > >  static struct device_driver i82365_driver = {
> > >  	.name = "i82365",
> > >  	.bus = &platform_bus_type,
> > > -	.suspend = pcmcia_socket_dev_suspend,
> > > -	.resume = pcmcia_socket_dev_resume,
> > > +	.suspend = i82365_suspend,
> > > +	.resume = i82365_resume,
> > >  };
> > >  
> > >  static struct platform_device i82365_device = {
> > 
> > I was not able to find *any* place in the tree that would call suspend
> > with SUSPEND_SAVE_STATE as level. Maybe just my grep was wrong?
> 
> It is correct for the time being.  Well, as far as the ARM tree goes.
> At the moment, the attitude towards platform devices seems to be "tough,
> live with it."  So, I have my own work-arounds, and until such time that
> mainline comes up with a solution, I'm happy.

Ok, it probably means I should not try to fix pcmcia tonight. Patrick,
what is the goal with "u32 level" in struct device_driver? Should the
code be fixed to call it with SUSPEND_SAVE_STATE etc? Or is there some
other plan?
								Pavel

-- 
When do you have a heart between your knees?
[Johanka's followup: and *two* hearts?]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2003-09-10 23:06 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-09-10 20:11 What happened to SUSPEND_SAVE_STATE? Pavel Machek
2003-09-10 20:49 ` Pavel Machek
2003-09-10 22:25   ` Russell King
2003-09-10 22:36     ` Pavel Machek
2003-09-10 22:41       ` Russell King
2003-09-10 23:06         ` Pavel Machek
2003-09-10 22:22 ` Russell King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).