2008-01-17 20:53:52

by Daniel Walker

[permalink] [raw]
Subject: [PATCH] fix wrong sized spinlock flags argument

Correct wrong sized spinlock flags, form int to unsigned long.

Signed-off-by: Daniel Walker <[email protected]>

---
drivers/media/video/saa7134/saa7134-core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6.23/drivers/media/video/saa7134/saa7134-core.c
===================================================================
--- linux-2.6.23.orig/drivers/media/video/saa7134/saa7134-core.c
+++ linux-2.6.23/drivers/media/video/saa7134/saa7134-core.c
@@ -1212,7 +1212,7 @@ static int saa7134_resume(struct pci_dev
{

struct saa7134_dev *dev = pci_get_drvdata(pci_dev);
- unsigned int flags;
+ unsigned long flags;

pci_set_power_state(pci_dev, PCI_D0);
pci_restore_state(pci_dev);
--

--


2008-01-17 23:49:27

by Linus Torvalds

[permalink] [raw]
Subject: Re: [PATCH] fix wrong sized spinlock flags argument


Applied.

However, the patch itself didn't apply cleanly, because in my souce tree,
these two lines are in a different order:

On Thu, 17 Jan 2008, Daniel Walker wrote:
>
> pci_set_power_state(pci_dev, PCI_D0);
> pci_restore_state(pci_dev);

but I actually think your order is the *correct* one (because I'm not at
all sure that config space writes are even guaranteed to make a difference
when in D3cold).

So I wonder, did you have some other fix applied to your "original" tree
(it sure isn't original 2.6.23, since that whole suspend/resume code was
added later.

Maxim? Mauro? Pretty much all other drivers do

pci_set_power_state(pdev, PCI_D0);
pci_restore_state(pdev);

in that order, and I really do think that D3cold is allowed to not
actually react fully to all config space accesses (ie we have to re-write
them after bringing it out of D3)

Linus

2008-01-18 00:08:26

by Daniel Walker

[permalink] [raw]
Subject: Re: [PATCH] fix wrong sized spinlock flags argument


On Thu, 2008-01-17 at 15:48 -0800, Linus Torvalds wrote:
> Applied.
>
> However, the patch itself didn't apply cleanly, because in my souce tree,
> these two lines are in a different order:
>
> On Thu, 17 Jan 2008, Daniel Walker wrote:
> >
> > pci_set_power_state(pci_dev, PCI_D0);
> > pci_restore_state(pci_dev);
>
> but I actually think your order is the *correct* one (because I'm not at
> all sure that config space writes are even guaranteed to make a difference
> when in D3cold).

I was actually using 2.6.24-rc8-mm1 . The code looked similar enough,
but I must have overlooked the fact that the lines above got switched..

Daniel

2008-01-18 10:14:09

by Mauro Carvalho Chehab

[permalink] [raw]
Subject: Re: [PATCH] fix wrong sized spinlock flags argument

On Thu, 17 Jan 2008 16:05:06 -0800
Daniel Walker <[email protected]> wrote:

>
> On Thu, 2008-01-17 at 15:48 -0800, Linus Torvalds wrote:
> > Applied.
> >
> > However, the patch itself didn't apply cleanly, because in my souce tree,
> > these two lines are in a different order:
> >
> > On Thu, 17 Jan 2008, Daniel Walker wrote:
> > >
> > > pci_set_power_state(pci_dev, PCI_D0);
> > > pci_restore_state(pci_dev);
> >
> > but I actually think your order is the *correct* one (because I'm not at
> > all sure that config space writes are even guaranteed to make a difference
> > when in D3cold).
>
> I was actually using 2.6.24-rc8-mm1 . The code looked similar enough,
> but I must have overlooked the fact that the lines above got switched..

There were lots of change on saa7134, including the implementation of S1/S3.
I'll run some tests here fixing the order and apply Daniel's patch.

Cheers,
Mauro