Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1506541 > unrolled thread

[PATCH v2] media: solo6x10: fix lockup by avoiding delayed register write

Started byAndrey Utkin <andrey.utkin@corp.bluecherry.net>
First post2016-10-22 16:40 +0200
Last post2016-10-24 09:20 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v2] media: solo6x10: fix lockup by avoiding delayed register write Andrey Utkin <andrey.utkin@corp.bluecherry.net> - 2016-10-22 16:40 +0200
    Re: [PATCH v2] media: solo6x10: fix lockup by avoiding delayed register write khalasa@piap.pl (Krzysztof Hałasa) - 2016-10-24 07:00 +0200
      Re: [PATCH v2] media: solo6x10: fix lockup by avoiding delayed  register write Andrey Utkin <andrey_utkin@fastmail.com> - 2016-10-24 09:20 +0200

#1506541 — [PATCH v2] media: solo6x10: fix lockup by avoiding delayed register write

FromAndrey Utkin <andrey.utkin@corp.bluecherry.net>
Date2016-10-22 16:40 +0200
Subject[PATCH v2] media: solo6x10: fix lockup by avoiding delayed register write
Message-ID<sv5CO-4Fd-19@gated-at.bofh.it>
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.

Fixes: e1ceb25a1569 ("[media] SOLO6x10: remove unneeded register locking and barriers")
Cc: stable@vger.kernel.org
Signed-off-by: Andrey Utkin <andrey.utkin@corp.bluecherry.net>
---
This is a second submission, the first one was
"[PATCH] [media] solo6x10: avoid delayed register write" from 22 Sep 2016,
with same content.

Dear maintainers - please take this at last into v4.9 if possible.

Changes since v1:
 - changed subject to show that this fixes a lockup
 - added Cc: stable
 - added Fixes: tag

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

[toc] | [next] | [standalone]


#1506896

Fromkhalasa@piap.pl (Krzysztof Hałasa)
Date2016-10-24 07:00 +0200
Message-ID<svFwB-2Mn-9@gated-at.bofh.it>
In reply to#1506541
Andrey Utkin <andrey.utkin@corp.bluecherry.net> writes:

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

This is ok for now. I hope I will find some to refine this, so not all
register writes are done with the penalty - eventually.
-- 
Krzysztof Halasa

Industrial Research Institute for Automation and Measurements PIAP
Al. Jerozolimskie 202, 02-486 Warsaw, Poland

[toc] | [prev] | [next] | [standalone]


#1506953 — Re: [PATCH v2] media: solo6x10: fix lockup by avoiding delayed register write

FromAndrey Utkin <andrey_utkin@fastmail.com>
Date2016-10-24 09:20 +0200
SubjectRe: [PATCH v2] media: solo6x10: fix lockup by avoiding delayed register write
Message-ID<svHI5-4mJ-7@gated-at.bofh.it>
In reply to#1506896
On Mon, Oct 24, 2016 at 06:57:25AM +0200, Krzysztof Hałasa wrote:
> Andrey Utkin <andrey.utkin@corp.bluecherry.net> writes:
> 
> > --- 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)
> 
> This is ok for now. I hope I will find some to refine this, so not all
> register writes are done with the penalty - eventually.

I'm afraid it'd be hard if you don't have a hardware sample which hangs.
I could in theory provide you with SSH access to my dev machine, but
currently I'm in another country so managing this is hard, too.

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web