Diffs between our tree and upstream
Hi Guennadi,
I'm about to send our pull request.
While doing my last checks, I noticed a difference between our tree and upstream. I'm not sure what happens. Could you please check?
The enclosed patch is the diff from upstream to -hg.
Cheers,
Mauro
home/v4l/tokernel/wrk/linux-next/drivers/media/video/sh_mobile_ceu_camera.c renamed from drivers/media/video/sh_mobile_ceu_camera.c +23 -14
@@ -30,7 +30,7 @@#include <linux/device.h> #include <linux/platform_device.h> #include <linux/videodev2.h> -#include <linux/clk.h> +#include <linux/pm_runtime.h> #include <media/v4l2-common.h> #include <media/v4l2-dev.h>
@@ -93,7 +93,6 @@ struct sh_mobile_ceu_dev {unsigned int irq;void __iomem *base; -struct clk *clk;unsigned long video_limit;/* lock used to protect videobuf */
@@ -1649,7 +1648,6 @@ static int __devinit sh_mobile_ceu_probestruct sh_mobile_ceu_dev *pcdev;struct resource *res;void __iomem *base; -char clk_name[8 ];unsigned int irq;int err =0 ;
@@ -1713,13 +1711,9 @@ static int __devinit sh_mobile_ceu_probe goto exit_release_mem; } -snprintf (clk_name,sizeof (clk_name),"ceu%d" , pdev->id); - pcdev->clk =clk_get (&pdev->dev, clk_name); -if (IS_ERR (pcdev->clk)) { -dev_err (&pdev->dev,"cannot get clock \"%s\"\n" , clk_name); - err =PTR_ERR (pcdev->clk); - goto exit_free_irq; - } +pm_suspend_ignore_children (&pdev->dev, true); +pm_runtime_enable (&pdev->dev); +pm_runtime_resume (&pdev->dev); pcdev->ici.priv = pcdev; pcdev->ici.v4l2_dev.dev = &pdev->dev;
@@ -1729,12 +1723,10 @@ static int __devinit sh_mobile_ceu_probe err =soc_camera_host_register (&pcdev->ici);if (err) - goto exit_free_clk; + goto exit_free_irq;return 0 ; -exit_free_clk: -clk_put (pcdev->clk); exit_free_irq:free_irq (pcdev->irq, pcdev); exit_release_mem:
@@ -1755,7 +1747,6 @@ static int __devexit sh_mobile_ceu_remov struct sh_mobile_ceu_dev, ici);soc_camera_host_unregister (soc_host); -clk_put (pcdev->clk);free_irq (pcdev->irq, pcdev);if (platform_get_resource (pdev,IORESOURCE_MEM ,1 ))dma_release_declared_memory (&pdev->dev);
@@ -1764,9 +1755,27 @@ static int __devexit sh_mobile_ceu_removreturn 0 ; } +static int sh_mobile_ceu_runtime_nop (struct device *dev) +{ +/* Runtime PM callback shared between ->runtime_suspend() +* and ->runtime_resume(). Simply returns success. +* +* This driver re-initializes all registers after +* pm_runtime_get_sync() anyway so there is no need +* to save and restore registers here. +*/ +return 0 ; +} + +static struct dev_pm_ops sh_mobile_ceu_dev_pm_ops = { + .runtime_suspend = sh_mobile_ceu_runtime_nop, + .runtime_resume = sh_mobile_ceu_runtime_nop, +}; +static struct platform_driver sh_mobile_ceu_driver = { .driver = { .name ="sh_mobile_ceu" , + .pm = &sh_mobile_ceu_dev_pm_ops, }, .probe = sh_mobile_ceu_probe, .remove =__exit_p (sh_mobile_ceu_remove),
Em Sat, 19 Sep 2009 01:06:02 -0300
Mauro Carvalho Chehab <[email protected]> escreveu:
Quoted 8 lines
Hi Guennadi,
I'm about to send our pull request.
While doing my last checks, I noticed a difference between our tree and upstream. I'm not sure what happens. Could you please check?
The enclosed patch is the diff from upstream to -hg.
Ok, I discovered the cause of the conflict:
git patch 6d1386c6b8db54ac8d94c01194e0c27cd538532b were applied before the
soc_camera conversion to v4l dev/subdev.
I've applied the patch on our development tree. Still, we have a few diffs, probably meaning that I solved it at the wrong way at git.
Please let me know what would be the proper way to fix it: by keeping clk_enable/clk_disable (so reverting part of Magnus changes), or by using, instead pm_runtime_get_sync/pm_runtime_put_sync.
I guess the latter is the proper fix, but, as both use API's that are sh specific, the better is if you could point me the right way.
Cheers,
Mauro.
home/v4l/tokernel/wrk/linux-next/drivers/media/video/sh_mobile_ceu_camera.c renamed from drivers/media/video/sh_mobile_ceu_camera.c +2 -2
@@ -404,7 +404,7 @@ static int sh_mobile_ceu_add_device(stru"SuperH Mobile CEU driver attached to camera %d\n" , icd->devnum); -pm_runtime_get_sync (ici->dev); +clk_enable (pcdev->clk);ceu_write (pcdev,CAPSR ,1 <<16 );/* reset */ while (ceu_read (pcdev,CSTSR ) &1 )
@@ -438,7 +438,7 @@ static void sh_mobile_ceu_remove_device( }spin_unlock_irqrestore (&pcdev->lock, flags); -pm_runtime_put_sync (ici->dev); +clk_disable (pcdev->clk); dev_info(icd->dev.parent, "SuperH Mobile CEU driver detached from camera %d\n",
Cheers,
Mauro
Hi Mauro
Quoted 10 lines · Mauro Carvalho Chehab
Em Sat, 19 Sep 2009 01:06:02 -0300
Mauro Carvalho Chehab <[email protected]> escreveu:Quoted 7 lines
Hi Guennadi,
I'm about to send our pull request.
While doing my last checks, I noticed a difference between our tree and upstream. I'm not sure what happens. Could you please check?
Quoted 8 lines
Quoted 1 line
The enclosed patch is the diff from upstream to -hg.
Ok, I discovered the cause of the conflict:
git patch 6d1386c6b8db54ac8d94c01194e0c27cd538532b were applied before the
soc_cameraconversion to v4l dev/subdev.I've applied the patch on our development tree. Still, we have a few diffs, probably meaning that I solved it at the wrong way at git.
No, please, don't change anything in our trees. Pual should have pushed his tree after v4l to Linus, but he has done it before. The idea is we should push our tree as is and then solve the conflict on merge. That should be easy. But if you start patching the v4l tree, that can make things much more complicated. BTW, your patch below is not the correct fix.
Thanks
Guennadi
Quoted 38 lines
Please let me know what would be the proper way to fix it: by keeping clk_enable/clk_disable (so reverting part of Magnus changes), or by using, instead pm_runtime_get_sync/pm_runtime_put_sync.
I guess the latter is the proper fix, but, as both use API's that are sh specific, the better is if you could point me the right way.
Cheers,
Mauro.diff -upr
oldtree/drivers/media/video/sh_mobile_ceu_camera.c/home/v4l/tokernel/wrk/linux-next/drivers/media/video/sh_mobile_ceu_camera.chome/v4l/tokernel/wrk/linux-next/drivers/media/video/sh_mobile_ceu_camera.c renamed from drivers/media/video/sh_mobile_ceu_camera.c +2
-2@@ -404,7 +404,7 @@ static int sh_mobile_ceu_add_device(stru"SuperH Mobile CEU driver attached to camera %d\n" , icd->devnum); -pm_runtime_get_sync (ici->dev); +clk_enable (pcdev->clk);ceu_write (pcdev,CAPSR ,1 <<16 );/* reset */ while (ceu_read (pcdev,CSTSR ) &1 )@@ -438,7 +438,7 @@ static void sh_mobile_ceu_remove_device( }spin_unlock_irqrestore (&pcdev->lock, flags); -pm_runtime_put_sync (ici->dev); +clk_disable (pcdev->clk); dev_info(icd->dev.parent, "SuperH Mobile CEU driver detached from camera %d\n",
Quoted 3 lines
Cheers,
Mauro
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
Em Sun, 20 Sep 2009 10:57:34 +0200 (CEST) Guennadi Liakhovetski <[email protected]> escreveu:
Quoted 23 lines
Hi Mauro
Quoted 10 lines · Mauro Carvalho Chehab
Em Sat, 19 Sep 2009 01:06:02 -0300
Mauro Carvalho Chehab <[email protected]> escreveu:Quoted 7 lines
Hi Guennadi,
I'm about to send our pull request.
While doing my last checks, I noticed a difference between our tree and upstream. I'm not sure what happens. Could you please check?
Quoted 8 lines
Quoted 1 line
The enclosed patch is the diff from upstream to -hg.
Ok, I discovered the cause of the conflict:
git patch 6d1386c6b8db54ac8d94c01194e0c27cd538532b were applied before the
soc_cameraconversion to v4l dev/subdev.I've applied the patch on our development tree. Still, we have a few diffs, probably meaning that I solved it at the wrong way at git.
Quoted 6 lines
No, please, don't change anything in our trees. Pual should have pushed his tree after v4l to Linus, but he has done it before. The idea is we should push our tree as is and then solve the conflict on merge. That should be easy. But if you start patching the v4l tree, that can make things much more complicated. BTW, your patch below is not the correct fix.
That patch bellow is the diff between -hg tree and what we have at -git, after the conflict solve. If it is wrong, it shows that the conflict were solved in a wrong direction. Both your and Magnus patch touched at the same context lines of the code, making the resolution not trivial.
If that patch is not correct, we need to apply it on our tree and write a patch fixing it. The fix patch should be then added at another git push request.
Cheers,
Mauro