From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Sudhakar Rajashekhara" Subject: RE: [PATCH 1/6] i2c: davinci: Fix smbus Oops with AIC33 usage Date: Thu, 28 Jan 2010 09:35:47 +0530 Message-ID: <9237.59707152403$1264652093@news.gmane.org> References: <1264549293-25556-1-git-send-email-khilman@deeprootsystems.com> <1264549293-25556-2-git-send-email-khilman@deeprootsystems.com> <026601ca9f54$17a18110$46e48330$@raj@ti.com> <87k4v3y53z.fsf@deeprootsystems.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <87k4v3y53z.fsf-1D3HCaltpLuhEniVeURVKkEOCMrvLtNR@public.gmane.org> Content-Language: en-us List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: davinci-linux-open-source-bounces-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/@public.gmane.org Errors-To: davinci-linux-open-source-bounces-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/@public.gmane.org To: 'Kevin Hilman' Cc: 'Alexander Vasiliev' , davinci-linux-open-source-VycZQUHpC/PFrsHnngEfi1aTQe2KTcn/@public.gmane.org, 'Dirk Behme' , 'Ben Dooks' , linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-Id: linux-i2c@vger.kernel.org On Wed, Jan 27, 2010 at 20:20:08, Kevin Hilman wrote: > "Sudhakar Rajashekhara" writes: > > > Hi, > > > > On Wed, Jan 27, 2010 at 05:11:28, Kevin Hilman wrote: > >> From: Dirk Behme > >> > >> This fixes Oops at kernel startup while "scanning" for TLV320AIC23IDx > >> addresses. > >> > >> Signed-off-by: Alexander Vasiliev > >> Signed-off-by: Brad Griffis > >> Signed-off-by: Dirk Behme > >> Acked-by: Kevin Hilman > >> --- > >> drivers/i2c/busses/i2c-davinci.c | 29 +++++++++++++++++++++++++---- > >> 1 files changed, 25 insertions(+), 4 deletions(-) > >> > >> diff --git a/drivers/i2c/busses/i2c-davinci.c b/drivers/i2c/busses/i2c-davinci.c > >> index c89687a..444a9f2 100644 > >> --- a/drivers/i2c/busses/i2c-davinci.c > >> +++ b/drivers/i2c/busses/i2c-davinci.c > > > > [...] > > > >> @@ -290,6 +293,16 @@ i2c_davinci_xfer_msg(struct i2c_adapter *adap, struct i2c_msg *msg, int stop) > >> davinci_i2c_write_reg(dev, DAVINCI_I2C_IMR_REG, w); > >> > >> dev->terminate = 0; > >> + > >> + /* First byte should be set here, not after interrupt, > >> + * because transmit-data-ready interrupt can come before > >> + * NACK-interrupt during sending of previous message and > >> + * ICDXR may have wrong data */ > >> + if ((!(msg->flags & I2C_M_RD)) && dev->buf_len) { > >> + davinci_i2c_write_reg(dev, DAVINCI_I2C_DXR_REG, *dev->buf++); > >> + dev->buf_len--; > >> + } > >> + > > > > I found an issue on DA850 while using this patch. > > ok, I'll drop this one for 2.6.34 until we figure this out. > > > I think the above code should come after the > > below lines because an I2C transaction is being carried out before configuring the I2C mode > > register (which has bits to configure Master, Start condition etc), which causes undefined > > behavior. > > hmm, are you seeing this behavior on davinci git too? This is the same > patch that has been in davinci git for some time? > Yes, I am seeing this issue on davinci git. Regards, Sudhakar