enc28J60 driver causing Kernel Panic Crash

61 views
Skip to first unread message

Dan Howell

unread,
Jul 17, 2018, 8:38:48 PM7/17/18
to BeagleBoard

I am getting the following trace when using the enc28J60.  Can anyone help me figure out why?


Thanx



beaglebone login: OPOP[  115.791804] Unable to handle kernel NULL pointer dereference at virtual address 0000005c

[  115.799996] pgd = c0004000

[  115.802752] [0000005c] *pgd=00000000

[  115.806357] Internal error: Oops: 17 [#1] THUMB2

[  115.810995] Modules linked in: pvrsrvkm(O) sg ftdi_sio usbserial evdev uio_pdrv_genirq uio usb_f_mass_storage usb_f_acm u_serial usb_f_ecm usb_f_rndis u_ether libcomposite spidev tieqep ip_tables x_tables uas

[  115.829722] CPU: 0 PID: 89 Comm: kworker/0:2 Tainted: G           O    4.4.115-bone21 #1

[  115.837846] Hardware name: Generic AM33XX (Flattened Device Tree)

[  115.843990] Workqueue: events enc28j60_tx_work_handler

[  115.849154] task: dc3126c0 ti: dc33a000 task.ti: dc33a000

[  115.854579] PC is at enc28j60_tx_work_handler+0x34/0xe0

[  115.859834] LR is at process_one_work+0xed/0x29c

[  115.864472] pc : [<c047ef6c>]    lr : [<c003bbd9>]    psr: 00000033

[  115.864472] sp : dc33bef8  ip : 00000000  fp : 00000000

[  115.875998] r10: ddaba4dc  r9 : 00000000  r8 : de344100

[  115.881244] r7 : ddaba4c8  r6 : c0b639c8  r5 : ddaba4c0  r4 : ddaba4d8

[  115.887798] r3 : 00000000  r2 : c0b639d8  r1 : 01b00000  r0 : ddaba4c8

[  115.894355] Flags: nzcv  IRQs on  FIQs on  Mode SVC_32  ISA Thumb  Segment none

[  115.901695] Control: 50c5387d  Table: 9dbd8019  DAC: 00000051

[  115.907464] Process kworker/0:2 (pid: 89, stack limit = 0xdc33a210)

[  115.913758] Stack: (0xdc33bef8 to 0xdc33c000)

[  115.918134] bee0:                                                       ddaba4d8 dc2f5400

[  115.926353] bf00: c0b639c8 00000000 de344100 c003bbd9 dc33a000 c0b639c8 dc33bf30 dc2f5400

[  115.934572] bf20: dc2f5418 c0b639c8 00000008 c0b639d8 dc33a000 c0b639c8 00000000 c003c5ef

[  115.942790] bf40: dc33a000 ffffe000 dc33bf60 00000000 dc323cc0 dc33a000 dc2f5400 c003c539

[  115.951008] bf60: 00000000 00000000 00000000 c003fba1 00000000 dc323cc0 dc2f5400 00000000

[  115.959227] bf80: dc33bf80 dc33bf80 00000000 dc33bf8c dc33bf8c 01e6d284 dc323cc0 c003fae9

[  115.967445] bfa0: 00000000 00000000 00000000 c000eac5 00000000 00000000 00000000 00000000

[  115.975663] bfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

[  115.983881] bfe0: 00000000 00000000 00000000 00000000 00000013 00000000 efbff35b 6f7fdfff

[  115.992111] [<c047ef6c>] (enc28j60_tx_work_handler) from [<c003bbd9>] (process_one_work+0xed/0x29c)

[  116.001206] [<c003bbd9>] (process_one_work) from [<c003c5ef>] (worker_thread+0xb7/0x374)

[  116.009342] [<c003c5ef>] (worker_thread) from [<c003fba1>] (kthread+0xb9/0xcc)

[  116.016610] [<c003fba1>] (kthread) from [<c000eac5>] (ret_from_fork+0x11/0x2c)

[  116.023870] Code: 3c04 f1a4 0710 4638 (6dde) f8d3

[  116.028753] ---[ end trace 794b457ee9aa6f3c ]---


.

.

. Fixing recursive fault but reboot is needed!

[  142.445214] Kernel panic - not syncing: corrupted stack end detected inside scheduler

[  142.445214]

[  144.650075] ---[ end Kernel panic - not syncing: corrupted stack end detected inside scheduler


I am using Linux beaglebone 4.4.115-bone21


/boot/uEnv.txt is as follows:


#Docs: http://elinux.org/Beagleboard:U-boot_partitioning_layout_2.0

   

uname_r=4.4.115-bone21

#uuid=

#dtb=


   

###U-Boot Overlays###

###Documentation: http://elinux.org/Beagleboard:BeagleBoneBlack_Debian#U-Boot_Overlays

###Master Enable

enable_uboot_overlays=1

###


###Overide capes with eeprom

#uboot_overlay_addr0=/lib/firmware/<file0>.dtbo

uboot_overlay_addr1=/lib/firmware/BB-UART2-00A0.dtbo

###

###Additional custom capes

uboot_overlay_addr4=/lib/firmware/enc28j60-00A0.dtbo

uboot_overlay_addr6=/lib/firmware/BB-I2C1-00A0.dtbo


###

###Custom Cape

###

###Disable auto loading of virtual capes (emmc/video/wireless/adc)

disable_uboot_overlay_video=1

disable_uboot_overlay_audio=1


cmdline=coherent_pool=1M net.ifnames=0 quiet


#In the event of edid real failures, uncomment this next line:

#cmdline=coherent_pool=1M net.ifnames=0 quiet video=HDMI-A-1:1024x768@60e



##Example v4.1.x

cape_enable=bone_capemgr.enable_partno=BB-I2C1-00A0,BB-UART2,enc28j60



dmesg output:


root@beaglebone:~# dmesg | grep spi

[    3.905875] omap2_mcspi 481a0000.spi: chipselect 0 already in use

[    3.912063] spi_master spi1: spi_device register error /ocp/spi@481a0000/chan

nel@0

[    3.919689] spi_master spi1: Failed to create SPI device for /ocp/spi@481a000

0/channel@0

[    3.920887] enc28j60 spi1.0: enc28j60 Ethernet driver 1.01 loaded


enc28j60.dts:


/*

* Copyright (C) 2017 Robert Nelson <robert...@gmail.com>

*

* This program is free software; you can redistribute it and/or modify

* it under the terms of the GNU General Public License version 2 as

* published by the Free Software Foundation.

*/


/dts-v1/;

/plugin/;


#include <dt-bindings/board/am335x-bbw-bbb-base.h>

#include <dt-bindings/gpio/gpio.h>

#include <dt-bindings/pinctrl/am33xx.h>

#include <dt-bindings/interrupt-controller/irq.h>


/ {



/* state the resources this cape uses */

   exclusive-use =

        /* the pin header uses */

        "P9.25",    /* INT */

        "P9.27",    /* RESET */


        /* D1 <==> MOSI output and D0 <==> MISO input - as corrected by Chris on 4 Apr 2018 */


        "P9.31",    /* spi1_sclk */

        "P9.29",    /* spi1_d0 */

        "P9.30",    /* spi1_d1 */

        "P9.28",    /* spi1_cs0 */

        // "P9.42", /* spi1_cs1 */

        /* the hardware ip uses */

        "spi1";


fragment@0 {

            target = <&am33xx_pinmux>;

            __overlay__ {


         enc28j60_pins: pinmux_enc28j60_pins {

                pinctrl-single,pins = <

                

                AM33XX_IOPAD(0x09ac, PIN_INPUT_PULLUP | MUX_MODE7 ) /* aka P9_25 GPIO3[21], INPUT_PULLUP | MODE7  INT */

                AM33XX_IOPAD(0x09a4, PIN_INPUT_PULLUP | MUX_MODE7 ) /* aka P9_27 GPIO3[19], INPUT_PULLUP | MODE7  RESET */

                >;

            };


            bb_spi1_pins: pinmux_bb_spi1_pins {

                pinctrl-single,pins = <

                 AM33XX_IOPAD(0x0990, PIN_INPUT_PULLUP | MUX_MODE3 )/* aka P9_31 mcasp0_aclkx.spi1_sclk, INPUT_PULLUP | MODE3 */

                AM33XX_IOPAD(0x0994, PIN_INPUT_PULLUP | MUX_MODE3 )/* aka P9_29 mcasp0_fsx.spi1_d0, INPUT_PULLUP | MODE3 */

                AM33XX_IOPAD(0x0998, PIN_OUTPUT_PULLUP | MUX_MODE3 )/* aka P9_30 mcasp0_axr0.spi1_d1, OUTPUT_PULLUP | MODE3 */

                AM33XX_IOPAD(0x099c, PIN_OUTPUT_PULLUP | MUX_MODE3 )/* aka P9_28 mcasp0_ahclkr.spi1_cs0, OUTPUT_PULLUP | MODE3 */

                >;

            };

        };

    };


fragment@1 {

target = <&spi1>;

__overlay__ {


#address-cells = <1>;

#size-cells = <0>;

status = "okay";

pinctrl-names = "default";

pinctrl-0 = <&bb_spi1_pins>;


/* may not need this */

ti,pio-mode; /* disable dma when used as an overlay, dma gets stuck at 160 bits... */


channel@0 {

#address-cells = <1>;

#size-cells = <0>;

compatible = "spidev";

reg = <0>;

spi-max-frequency = <16000000>;

spi-cpha;

};

channel@1 {

status = "disabled";

};

enc28j60: ethernet@1 {

compatible = "microchip,enc28j60";

pinctrl-names = "default";

pinctrl-0 = <&enc28j60_pins>;

reg = <0x0>;

interrupt-parent = <&gpio3>;

interrupts = <21 IRQ_TYPE_EDGE_FALLING>;

spi-max-frequency = <16000000>;

};

};

};

};



Reply all
Reply to author
Forward
0 new messages