public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] i2c-ismt: add Initialize DMA buffer code ismt_access()
@ 2013-09-24 23:47 James Ralston
  2013-09-26  8:40 ` Wolfram Sang
  0 siblings, 1 reply; 4+ messages in thread
From: James Ralston @ 2013-09-24 23:47 UTC (permalink / raw)
  To: Wolfram Sang, Neil Horman
  Cc: Seth Heasley, James Ralston, linux-i2c, linux-kernel

This patch adds code to Initialize the DMA buffer to compensate for possible hardware data corruption.

Signed-off-by: James Ralston <james.d.ralston@intel.com>
---
 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);
-- 
1.7.7.6


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] i2c-ismt: add Initialize DMA buffer code ismt_access()
  2013-09-24 23:47 [PATCH 1/1] i2c-ismt: add Initialize DMA buffer code ismt_access() James Ralston
@ 2013-09-26  8:40 ` Wolfram Sang
  2013-09-26 14:41   ` Neil Horman
  0 siblings, 1 reply; 4+ messages in thread
From: Wolfram Sang @ 2013-09-26  8:40 UTC (permalink / raw)
  To: James Ralston; +Cc: Neil Horman, Seth Heasley, linux-i2c, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 978 bytes --]

On Tue, Sep 24, 2013 at 04:47:55PM -0700, James Ralston wrote:
> This patch adds code to Initialize the DMA buffer to compensate for possible hardware data corruption.

Take care of the line width here.

> Signed-off-by: James Ralston <james.d.ralston@intel.com>
> ---
>  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));

sizeof()?

> +
>  	/* Initialize the descriptor */
>  	memset(desc, 0, sizeof(struct ismt_desc));
>  	desc->tgtaddr_rw = ISMT_DESC_ADDR_RW(addr, read_write);
> -- 
> 1.7.7.6
> 

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] i2c-ismt: add Initialize DMA buffer code ismt_access()
  2013-09-26  8:40 ` Wolfram Sang
@ 2013-09-26 14:41   ` Neil Horman
  2013-09-28 13:10     ` Wolfram Sang
  0 siblings, 1 reply; 4+ messages in thread
From: Neil Horman @ 2013-09-26 14:41 UTC (permalink / raw)
  To: Wolfram Sang; +Cc: James Ralston, Seth Heasley, linux-i2c, linux-kernel

On Thu, Sep 26, 2013 at 10:40:32AM +0200, Wolfram Sang wrote:
> On Tue, Sep 24, 2013 at 04:47:55PM -0700, James Ralston wrote:
> > This patch adds code to Initialize the DMA buffer to compensate for possible hardware data corruption.
> 
> Take care of the line width here.
> 
> > Signed-off-by: James Ralston <james.d.ralston@intel.com>
> > ---
> >  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));
> 
> sizeof()?
> 
Agreed.
Neil

> > +
> >  	/* Initialize the descriptor */
> >  	memset(desc, 0, sizeof(struct ismt_desc));
> >  	desc->tgtaddr_rw = ISMT_DESC_ADDR_RW(addr, read_write);
> > -- 
> > 1.7.7.6
> > 



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/1] i2c-ismt: add Initialize DMA buffer code ismt_access()
  2013-09-26 14:41   ` Neil Horman
@ 2013-09-28 13:10     ` Wolfram Sang
  0 siblings, 0 replies; 4+ messages in thread
From: Wolfram Sang @ 2013-09-28 13:10 UTC (permalink / raw)
  To: Neil Horman; +Cc: James Ralston, Seth Heasley, linux-i2c, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1106 bytes --]

On Thu, Sep 26, 2013 at 10:41:15AM -0400, Neil Horman wrote:
> On Thu, Sep 26, 2013 at 10:40:32AM +0200, Wolfram Sang wrote:
> > On Tue, Sep 24, 2013 at 04:47:55PM -0700, James Ralston wrote:
> > > This patch adds code to Initialize the DMA buffer to compensate for possible hardware data corruption.
> > 
> > Take care of the line width here.
> > 
> > > Signed-off-by: James Ralston <james.d.ralston@intel.com>
> > > ---
> > >  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));
> > 
> > sizeof()?
> > 
> Agreed.

Fixed that myself so it can be in my pull-request to Linus today.


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2013-09-28 13:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-24 23:47 [PATCH 1/1] i2c-ismt: add Initialize DMA buffer code ismt_access() James Ralston
2013-09-26  8:40 ` Wolfram Sang
2013-09-26 14:41   ` Neil Horman
2013-09-28 13:10     ` Wolfram Sang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox