From: David Matlack <dmatlack@google.com>
To: gregkh@linuxfoundation.org
Cc: liodot@gmail.com, charrer@alacritech.com,
linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org,
David Matlack <dmatlack@google.com>
Subject: [PATCH] staging: slicoss: fix occasionally writing out only half of a dma address
Date: Mon, 11 May 2015 20:40:36 -0700 [thread overview]
Message-ID: <1431402036-14193-2-git-send-email-dmatlack@google.com> (raw)
In-Reply-To: <1431402036-14193-1-git-send-email-dmatlack@google.com>
curaddrupper caches the last written upper 32-bits of a dma address
(the device has one register for the upper 32-bits of all dma
address registers). The problem is, not every dma address write
checks and sets curaddrupper. This causes the driver to occasionally
not write the upper 32-bits of a dma address to the device when it
really should.
I've seen this manifest particularly when the driver is trying to
read config data from the device (RCONFIG) in order to checksum the
device's eeprom. Since the device writes its config data to the
wrong DMA address the driver reads 0 as the eeprom size and the
eeprom checksum fails.
This patch fixes the issue by removing curaddrupper and always
writing the upper 32-bits of dma addresses.
Signed-off-by: David Matlack <dmatlack@google.com>
---
drivers/staging/slicoss/slic.h | 1 -
drivers/staging/slicoss/slicoss.c | 5 +----
2 files changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/staging/slicoss/slic.h b/drivers/staging/slicoss/slic.h
index 5b23254..67a8c9e 100644
--- a/drivers/staging/slicoss/slic.h
+++ b/drivers/staging/slicoss/slic.h
@@ -414,7 +414,6 @@ struct adapter {
u32 intrregistered;
uint isp_initialized;
uint gennumber;
- u32 curaddrupper;
struct slic_shmem *pshmem;
dma_addr_t phys_shmem;
u32 isrcopy;
diff --git a/drivers/staging/slicoss/slicoss.c b/drivers/staging/slicoss/slicoss.c
index 39c140c..5f34ebbf 100644
--- a/drivers/staging/slicoss/slicoss.c
+++ b/drivers/staging/slicoss/slicoss.c
@@ -147,10 +147,7 @@ static inline void slic_reg64_write(struct adapter *adapter, void __iomem *reg,
unsigned long flags;
spin_lock_irqsave(&adapter->bit64reglock, flags);
- if (paddrh != adapter->curaddrupper) {
- adapter->curaddrupper = paddrh;
- writel(paddrh, regh);
- }
+ writel(paddrh, regh);
writel(value, reg);
if (flush)
mb();
--
2.4.0
next prev parent reply other threads:[~2015-05-12 3:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-12 3:40 [PATCH] staging: slicoss: remove slic_spinlock wrapper David Matlack
2015-05-12 3:40 ` David Matlack [this message]
2015-05-12 8:36 ` Dan Carpenter
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=1431402036-14193-2-git-send-email-dmatlack@google.com \
--to=dmatlack@google.com \
--cc=charrer@alacritech.com \
--cc=devel@driverdev.osuosl.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liodot@gmail.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome