linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [media] solo6x10: avoid delayed register write
@ 2016-09-22  0:03 Andrey Utkin
  2016-10-17 19:52 ` Andrey Utkin
  0 siblings, 1 reply; 2+ messages in thread
From: Andrey Utkin @ 2016-09-22  0:03 UTC (permalink / raw)
  To: ismael, mchehab, linux-media, linux-kernel, hans.verkuil
  Cc: maintainers, andrey_utkin, Andrey Utkin

This fixes a lockup at device probing which happens on some solo6010
hardware samples. This is a regression introduced by commit e1ceb25a1569
("[media] SOLO6x10: remove unneeded register locking and barriers")

The observed lockup happens in solo_set_motion_threshold() called from
solo_motion_config().

This extra "flushing" is not fundamentally needed for every write, but
apparently the code in driver assumes such behaviour at last in some
places.

Actual fix was proposed by Hans Verkuil.

Signed-off-by: Andrey Utkin <andrey.utkin@corp.bluecherry.net>
---
 drivers/media/pci/solo6x10/solo6x10.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/media/pci/solo6x10/solo6x10.h b/drivers/media/pci/solo6x10/solo6x10.h
index 5bd4987..3f8da5e 100644
--- a/drivers/media/pci/solo6x10/solo6x10.h
+++ b/drivers/media/pci/solo6x10/solo6x10.h
@@ -284,7 +284,10 @@ static inline u32 solo_reg_read(struct solo_dev *solo_dev, int reg)
 static inline void solo_reg_write(struct solo_dev *solo_dev, int reg,
 				  u32 data)
 {
+	u16 val;
+
 	writel(data, solo_dev->reg_base + reg);
+	pci_read_config_word(solo_dev->pdev, PCI_STATUS, &val);
 }
 
 static inline void solo_irq_on(struct solo_dev *dev, u32 mask)
-- 
2.9.2


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

* Re: [PATCH] [media] solo6x10: avoid delayed register write
  2016-09-22  0:03 [PATCH] [media] solo6x10: avoid delayed register write Andrey Utkin
@ 2016-10-17 19:52 ` Andrey Utkin
  0 siblings, 0 replies; 2+ messages in thread
From: Andrey Utkin @ 2016-10-17 19:52 UTC (permalink / raw)
  To: mchehab, hverkuil
  Cc: ismael, linux-media, linux-kernel, maintainers, andrey.utkin

On Thu, Sep 22, 2016 at 03:03:31AM +0300, Andrey Utkin wrote:
> This fixes a lockup at device probing which happens on some solo6010
> hardware samples. This is a regression introduced by commit e1ceb25a1569
> ("[media] SOLO6x10: remove unneeded register locking and barriers")
> 
> The observed lockup happens in solo_set_motion_threshold() called from
> solo_motion_config().
> 
> This extra "flushing" is not fundamentally needed for every write, but
> apparently the code in driver assumes such behaviour at last in some
> places.
> 
> Actual fix was proposed by Hans Verkuil.
> 
> Signed-off-by: Andrey Utkin <andrey.utkin@corp.bluecherry.net>
> ---
>  drivers/media/pci/solo6x10/solo6x10.h | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/media/pci/solo6x10/solo6x10.h b/drivers/media/pci/solo6x10/solo6x10.h
> index 5bd4987..3f8da5e 100644
> --- a/drivers/media/pci/solo6x10/solo6x10.h
> +++ b/drivers/media/pci/solo6x10/solo6x10.h
> @@ -284,7 +284,10 @@ static inline u32 solo_reg_read(struct solo_dev *solo_dev, int reg)
>  static inline void solo_reg_write(struct solo_dev *solo_dev, int reg,
>  				  u32 data)
>  {
> +	u16 val;
> +
>  	writel(data, solo_dev->reg_base + reg);
> +	pci_read_config_word(solo_dev->pdev, PCI_STATUS, &val);
>  }
>  
>  static inline void solo_irq_on(struct solo_dev *dev, u32 mask)
> -- 
> 2.9.2
> 

Mauro, Hans,
Please pick this up. This has been around for a month, I expected it
would get to v4.9-rc1 easily.
Thanks.

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

end of thread, other threads:[~2016-10-17 18:53 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-22  0:03 [PATCH] [media] solo6x10: avoid delayed register write Andrey Utkin
2016-10-17 19:52 ` Andrey Utkin

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).