From patchwork Tue Sep 24 23:47:55 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: james.d.ralston@intel.com X-Patchwork-Id: 277644 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 0CD5F2C00C5 for ; Wed, 25 Sep 2013 09:51:06 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754715Ab3IXXvE (ORCPT ); Tue, 24 Sep 2013 19:51:04 -0400 Received: from mga02.intel.com ([134.134.136.20]:32836 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754169Ab3IXXvD (ORCPT ); Tue, 24 Sep 2013 19:51:03 -0400 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 24 Sep 2013 16:51:02 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.90,974,1371106800"; d="scan'208";a="383070824" Received: from unknown (HELO localhost.jf.intel.com) ([10.7.232.71]) by orsmga001.jf.intel.com with ESMTP; 24 Sep 2013 16:51:02 -0700 From: James Ralston To: Wolfram Sang , Neil Horman Cc: Seth Heasley , James Ralston , linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/1] i2c-ismt: add Initialize DMA buffer code ismt_access() Date: Tue, 24 Sep 2013 16:47:55 -0700 Message-Id: <1380066475-2119-1-git-send-email-james.d.ralston@intel.com> X-Mailer: git-send-email 1.7.7.6 Sender: linux-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org This patch adds code to Initialize the DMA buffer to compensate for possible hardware data corruption. Signed-off-by: James Ralston --- drivers/i2c/busses/i2c-ismt.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/drivers/i2c/busses/i2c-ismt.c b/drivers/i2c/busses/i2c-ismt.c index 8ed79a0..d3f30ea 100644 --- a/drivers/i2c/busses/i2c-ismt.c +++ b/drivers/i2c/busses/i2c-ismt.c @@ -393,6 +393,9 @@ static int ismt_access(struct i2c_adapter *adap, u16 addr, desc = &priv->hw[priv->head]; + /* Initialize the DMA buffer */ + memset(priv->dma_buffer, 0, (I2C_SMBUS_BLOCK_MAX+1)); + /* Initialize the descriptor */ memset(desc, 0, sizeof(struct ismt_desc)); desc->tgtaddr_rw = ISMT_DESC_ADDR_RW(addr, read_write);