ENC28J60 driver causes kernel to be unresponsive

Previous thread: ENC28J60 driver causes kernel to be unresponsive by Nicholas Kinar on Friday, March 6, 2009 - 9:23 am. (1 message)

Next thread: Query about skb scatter / gather by Amar Mudrankit on Friday, March 6, 2009 - 10:17 am. (3 messages)
From: Nicholas Kinar
Date: Friday, March 6, 2009 - 9:17 am

Hello--

I am testing the new ENC28J60 SPI-to-Ethernet driver on a custom AVR32 
embedded system running  Linux.  The kernel that I am using is 
2.6.27.6.atmel.1, and I have compiled the ENC28J60 as a module.  The SPI 
setup code in my setup.c file is:

static struct spi_board_info spi1_board_info[] __initdata = {
    /*SPI Atmel dataflash*/
    {
        .modalias    = "mtd_dataflash",
        .max_speed_hz    = 8000000,
        .chip_select    = 0,
    },

    /*Ethernet controller*/
    {
        .modalias         = "enc28j60",
        .controller_data    = (void*)GPIO_PIN_PB(3),
        .mode             = SPI_MODE_0,
        .irq            = (GPIO_PIN_PB(25) + GPIO_IRQ_BASE),
        .max_speed_hz        = 20000000,
        .chip_select        = 1,   
    },
};

At runtime, I load the module via modprobe, and there are no errors 
written to the kernel log when the driver loads.  However, the behavior 
of the driver is sporadic, and the embedded system often becomes 
unresponsive when:

(1) I plug in a cross-wired Ethernet cable;
(2) I run dropbear on the embedded system and try to SSH into the 
embedded system via telnet

In the case of dropbear, when I try to SSH, the dropbear version is 
sometimes displayed on the host system's telnet terminal, but the prompt 
never appears. 

I have noticed that the current consumption of the ENC28J60 chip goes up 
(and remains up) when the kernel becomes unresponsive.  The lights on 
the Ethernet connector continue to blink.  This leads me to think that 
something is happening in a loop, and never exits from the loop.

Sometimes, I cannot ping the embedded system from the host.  The ping is 
sporadic; sometimes it works, and sometimes it does not.

I am not certain if this is a problem related to improper setup of the 
spi_board_info struct, or whether I have to change some setting using 
ethtool.  I've tried to use ethtool to change the duplex from full to 
half, but the unresponsive behavior still continues.  I've ...
Previous thread: ENC28J60 driver causes kernel to be unresponsive by Nicholas Kinar on Friday, March 6, 2009 - 9:23 am. (1 message)

Next thread: Query about skb scatter / gather by Amar Mudrankit on Friday, March 6, 2009 - 10:17 am. (3 messages)