All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrey Utkin <andrey.utkin@corp.bluecherry.net>
To: mchehab@kernel.org
Cc: stable@vger.kernel.org, linux-media@vger.kernel.org,
	linux-kernel@vger.kernel.org, maintainers@bluecherrydvr.com,
	andrey_utkin@fastmail.com, ismael@iodev.co.uk,
	hverkuil@xs4all.nl, hans.verkuil@cisco.com, khalasa@piap.pl,
	Andrey Utkin <andrey.utkin@corp.bluecherry.net>
Subject: [PATCH v2] media: solo6x10: fix lockup by avoiding delayed register write
Date: Sat, 22 Oct 2016 16:34:36 +0100	[thread overview]
Message-ID: <20161022153436.12076-1-andrey.utkin@corp.bluecherry.net> (raw)

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

             reply	other threads:[~2016-10-22 14:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-22 15:34 Andrey Utkin [this message]
2016-10-24  4:57 ` [PATCH v2] media: solo6x10: fix lockup by avoiding delayed register write Krzysztof Hałasa
2016-10-24  7:17   ` Andrey Utkin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161022153436.12076-1-andrey.utkin@corp.bluecherry.net \
    --to=andrey.utkin@corp.bluecherry.net \
    --cc=andrey_utkin@fastmail.com \
    --cc=hans.verkuil@cisco.com \
    --cc=hverkuil@xs4all.nl \
    --cc=ismael@iodev.co.uk \
    --cc=khalasa@piap.pl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=maintainers@bluecherrydvr.com \
    --cc=mchehab@kernel.org \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.