diff mbox

IGMP issue with Davinci kernel 2.6.31

Message ID C70A636B101FD44999B82525C3E92AFA03A512BC@otis.burlington.evertz.tv (mailing list archive)
State New, archived
Headers show

Commit Message

Junfeng Feng May 2, 2014, 9:05 p.m. UTC
Hello there,

Right now, I try to support the IGMP functionality on Davinci. I have
configured the option CONFIG_IP_MULTICAST.
But when I try to join or leave one multicast group, I did not see the
multicast traffic. For comparison, I have tried the same test program on
Netra chip with kernel 2.6.37 and there is multicast message there.

Have anyone encountered the same issue before? Thanks.

Regards,
Junfeng


-----Original Message-----
From:
davinci-linux-open-source-bounces+jfeng=evertz.com@linux.davincidsp.com
[mailto:davinci-linux-open-source-bounces+jfeng=evertz.com@linux.davinci
dsp.com] On Behalf Of
davinci-linux-open-source-request@linux.davincidsp.com
Sent: Friday, May 02, 2014 1:00 PM
To: davinci-linux-open-source@linux.davincidsp.com
Subject: Davinci-linux-open-source Digest, Vol 101, Issue 1

Send Davinci-linux-open-source mailing list submissions to
	davinci-linux-open-source@linux.davincidsp.com

To subscribe or unsubscribe via the World Wide Web, visit
	
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source

or, via email, send a message with subject or body 'help' to
	davinci-linux-open-source-request@linux.davincidsp.com

You can reach the person managing the list at
	davinci-linux-open-source-owner@linux.davincidsp.com

When replying, please edit your Subject line so it is more specific than
"Re: Contents of Davinci-linux-open-source digest..."


Today's Topics:

   1. [PATCH] i2c: davinci: Add block read functionality for IPMI
      (Murali Karicheri)


----------------------------------------------------------------------

Message: 1
Date: Thu, 1 May 2014 14:49:46 -0400
From: Murali Karicheri <m-karicheri2@ti.com>
To: <davinci-linux-open-source@linux.davincidsp.com>,
	<linux-i2c@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Cc: Wolfram Sang <wsa@the-dreams.de>,	Kevin Hilman
	<khilman@deeprootsystems.com>,	Santosh Shilimkar
	<santosh.shilimkar@ti.com>, Garrett Ding <g-ding@ti.com>
Subject: [PATCH] i2c: davinci: Add block read functionality for IPMI
Message-ID: <1398970186-12204-1-git-send-email-m-karicheri2@ti.com>
Content-Type: text/plain

Intelligent Plaform Management Interface (IPMI) requires I2C driver to
support block read, where the first byte received from slave is the
length of following data:-  Added length check if the read type is block
read (I2C_M_RECV_LEN)  Send NACK/STOP bits before last byte is received

Signed-off-by: Garrett Ding <g-ding@ti.com>
Signed-off-by: Murali Karicheri <m-karicheri2@ti.com>
Tested-by: Garrett Ding <g-ding@ti.com>
CC: Sekhar Nori <nsekhar@ti.com>
CC: Kevin Hilman <khilman@deeprootsystems.com>
CC: Wolfram Sang <wsa@the-dreams.de>
CC: Santosh Shilimkar <santosh.shilimkar@ti.com>
---
 Tested on a customer board based on K2HK SoC
 drivers/i2c/busses/i2c-davinci.c |   42
+++++++++++++++++++++++++++++++++-----
 1 file changed, 37 insertions(+), 5 deletions(-)

 
 	davinci_i2c_write_reg(dev, DAVINCI_I2C_CNT_REG, dev->buf_len);
@@ -456,7 +466,7 @@ i2c_davinci_xfer(struct i2c_adapter *adap, struct
i2c_msg msgs[], int num)
 
 static u32 i2c_davinci_func(struct i2c_adapter *adap)  {
-	return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL;
+	return I2C_CAPABILITIES;
 }
 
 static void terminate_read(struct davinci_i2c_dev *dev) @@ -528,10
+538,32 @@ static irqreturn_t i2c_davinci_isr(int this_irq, void
*dev_id)
 
 		case DAVINCI_I2C_IVR_RDR:
 			if (dev->buf_len) {
-				*dev->buf++ =
-				    davinci_i2c_read_reg(dev,
-
DAVINCI_I2C_DRR_REG);
+				*dev->buf++ = davinci_i2c_read_reg(dev,
+
DAVINCI_I2C_DRR_REG);
+				/*
+				 * check if the first received byte is
message
+				 * length, i.e, I2C_M_RECV_LEN
+				 */
+				if (dev->buf_len == 0xffff)
+					dev->buf_len = *(dev->buf - 1) +
1;
+
 				dev->buf_len--;
+				/*
+				 * send NACK/STOP bits BEFORE last byte
is
+				 * received
+				 */
+				if (dev->buf_len == 1) {
+					w = davinci_i2c_read_reg(dev,
+
DAVINCI_I2C_MDR_REG);
+					w |= DAVINCI_I2C_MDR_NACK;
+					davinci_i2c_write_reg(dev,
+
DAVINCI_I2C_MDR_REG, w);
+
+					w |= DAVINCI_I2C_MDR_STP;
+					davinci_i2c_write_reg(dev,
+
DAVINCI_I2C_MDR_REG, w);
+				}
+
 				if (dev->buf_len)
 					continue;
 
--
1.7.9.5



------------------------------

Comments

Sekhar Nori May 6, 2014, 8:52 a.m. UTC | #1
On Saturday 03 May 2014 02:35 AM, Junfeng Feng wrote:
> Hello there,
> 
> Right now, I try to support the IGMP functionality on Davinci. I have
> configured the option CONFIG_IP_MULTICAST.
> But when I try to join or leave one multicast group, I did not see the
> multicast traffic. For comparison, I have tried the same test program on
> Netra chip with kernel 2.6.37 and there is multicast message there.
> 
> Have anyone encountered the same issue before? Thanks.

This could be some issue in the mainline driver patched for in the TI
tree. If you have not done so already, can you please send a mail to
netdev list preferably after testing with latest mainline. You can also
cc Mugunthan V N <mugunthanvnm@ti.com>

Thanks,
Sekhar
Christian Riesch May 6, 2014, 11:38 a.m. UTC | #2
Hi,

--On May 06, 2014 14:22 +0530 Sekhar Nori <nsekhar@ti.com> wrote:

> On Saturday 03 May 2014 02:35 AM, Junfeng Feng wrote:
>> Hello there,
>>
>> Right now, I try to support the IGMP functionality on Davinci. I have
>> configured the option CONFIG_IP_MULTICAST.
>> But when I try to join or leave one multicast group, I did not see the
>> multicast traffic. For comparison, I have tried the same test program on
>> Netra chip with kernel 2.6.37 and there is multicast message there.
>>
>> Have anyone encountered the same issue before? Thanks.
>
> This could be some issue in the mainline driver patched for in the TI
> tree. If you have not done so already, can you please send a mail to
> netdev list preferably after testing with latest mainline. You can also
> cc Mugunthan V N <mugunthanvnm@ti.com>

I never tried it with such old kernels, but I am using multicast on the 
AM1808 (DA850) with kernels 3.1 and 3.4. IGMP works fine here with 
CONFIG_IP_MULTICAST enabled. Could you try again with a more recent kernel?
Best regards,
Christian
Junfeng Feng May 6, 2014, 8:22 p.m. UTC | #3
The problem is that it is hard for us to switch to another kernel
version. We have other things depending on the kernel 2.6.31.
Anyone on the list have tried the multicast functionality with 2.6.31?

By the way, what is the netdev list address?

Thanks,
Junfeng


-----Original Message-----
From: Christian Riesch [mailto:christian.riesch@gmail.com] 
Sent: Tuesday, May 06, 2014 7:38 AM
To: Sekhar Nori; Junfeng Feng;
davinci-linux-open-source@linux.davincidsp.com
Subject: Re: IGMP issue with Davinci kernel 2.6.31

Hi,

--On May 06, 2014 14:22 +0530 Sekhar Nori <nsekhar@ti.com> wrote:

> On Saturday 03 May 2014 02:35 AM, Junfeng Feng wrote:
>> Hello there,
>>
>> Right now, I try to support the IGMP functionality on Davinci. I have

>> configured the option CONFIG_IP_MULTICAST.
>> But when I try to join or leave one multicast group, I did not see 
>> the multicast traffic. For comparison, I have tried the same test 
>> program on Netra chip with kernel 2.6.37 and there is multicast
message there.
>>
>> Have anyone encountered the same issue before? Thanks.
>
> This could be some issue in the mainline driver patched for in the TI 
> tree. If you have not done so already, can you please send a mail to 
> netdev list preferably after testing with latest mainline. You can 
> also cc Mugunthan V N <mugunthanvnm@ti.com>

I never tried it with such old kernels, but I am using multicast on the
AM1808 (DA850) with kernels 3.1 and 3.4. IGMP works fine here with
CONFIG_IP_MULTICAST enabled. Could you try again with a more recent
kernel?
Best regards,
Christian
Christian Riesch May 7, 2014, 5:50 a.m. UTC | #4
--On May 06, 2014 16:22 -0400 Junfeng Feng <jfeng@evertz.com> wrote:

> By the way, what is the netdev list address?

netdev@vger.kernel.org
diff mbox

Patch

diff --git a/drivers/i2c/busses/i2c-davinci.c
b/drivers/i2c/busses/i2c-davinci.c
index 389bc68..cd97920 100644
--- a/drivers/i2c/busses/i2c-davinci.c
+++ b/drivers/i2c/busses/i2c-davinci.c
@@ -97,6 +97,10 @@ 
 #define DAVINCI_I2C_IMR_NACK	BIT(1)
 #define DAVINCI_I2C_IMR_AL	BIT(0)
 
+/* capabilities */
+#define I2C_CAPABILITIES	(I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL | \
+				 I2C_FUNC_SMBUS_READ_BLOCK_DATA)
+
 struct davinci_i2c_dev {
 	struct device           *dev;
 	void __iomem		*base;
@@ -318,7 +322,13 @@  i2c_davinci_xfer_msg(struct i2c_adapter *adap,
struct i2c_msg *msg, int stop)
 	davinci_i2c_write_reg(dev, DAVINCI_I2C_SAR_REG, msg->addr);
 
 	dev->buf = msg->buf;
-	dev->buf_len = msg->len;
+
+	 /* if first received byte is length, set buf_len = 0xffff as
flag */
+	if (msg->flags & I2C_M_RECV_LEN)
+		dev->buf_len = 0xffff;
+	else
+		dev->buf_len = msg->len;
+
 	dev->stop = stop;