Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752618AbbELDkw (ORCPT ); Mon, 11 May 2015 23:40:52 -0400 Received: from mail-pa0-f46.google.com ([209.85.220.46]:34806 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752055AbbELDko (ORCPT ); Mon, 11 May 2015 23:40:44 -0400 From: David Matlack To: gregkh@linuxfoundation.org Cc: liodot@gmail.com, charrer@alacritech.com, linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org, David Matlack Subject: [PATCH] staging: slicoss: fix occasionally writing out only half of a dma address Date: Mon, 11 May 2015 20:40:36 -0700 Message-Id: <1431402036-14193-2-git-send-email-dmatlack@google.com> X-Mailer: git-send-email 2.4.0 In-Reply-To: <1431402036-14193-1-git-send-email-dmatlack@google.com> References: <1431402036-14193-1-git-send-email-dmatlack@google.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2183 Lines: 58 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 --- 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/