Giter Club home page Giter Club logo

Comments (13)

amery avatar amery commented on September 7, 2024

strange... it works fine here, but I don't get the [sw_hcd0]: platform is usb host line.

~$ zcat /proc/config.gz | grep HCD
CONFIG_USB_ARCH_HAS_HCD=y
# CONFIG_USB_C67X00_HCD is not set
CONFIG_USB_EHCI_HCD=y
# CONFIG_USB_OXU210HP_HCD is not set
# CONFIG_USB_ISP116X_HCD is not set
# CONFIG_USB_ISP1362_HCD is not set
CONFIG_USB_OHCI_HCD=y
# CONFIG_USB_SL811_HCD is not set
# CONFIG_USB_R8A66597_HCD is not set
CONFIG_USB_SW_SUN4I_HCD=y
CONFIG_USB_SW_SUN4I_HCD0=y
# CONFIG_USB_GADGET_DUMMY_HCD is not set

and

$ dmesg | grep -e hci -e hcd
[    0.340000] [sw_hcd0]: usb host driver initialize........
[    1.270000] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.280000] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    1.290000] [sw-ehci1]: probe, pdev->name: sw-ehci, pdev->id: 1, sw_ehci: 0xc081098c
[    1.310000] [sw-ehci1]: open clock
[    1.330000] [sw-ehci1]: Set USB Power ON
[    1.340000] sw-ehci sw-ehci.1: SW USB2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.350000] sw-ehci sw-ehci.1: new USB bus registered, assigned bus number 1
[    1.370000] sw-ehci sw-ehci.1: irq 39, io mem 0xf1c14000
[    1.400000] sw-ehci sw-ehci.1: USB 0.0 started, EHCI 1.00
[    1.400000] ehci_irq: port change detect
[    1.430000] [sw-ohci1]: probe, pdev->name: sw-ohci, pdev->id: 1, sw_ohci: 0xc0810a9c
[    1.440000] [sw-ohci1]: open clock
[    1.470000] sw-ohci sw-ohci.1: SW USB2.0 'Open' Host Controller (OHCI) Driver
[    1.480000] sw-ohci sw-ohci.1: new USB bus registered, assigned bus number 2
[    1.490000] sw-ohci sw-ohci.1: irq 64, io mem 0xf1c14400
[    1.570000] [sw-ehci2]: probe, pdev->name: sw-ehci, pdev->id: 2, sw_ehci: 0xc0810bac
[    1.590000] [sw-ehci2]: open clock
[    1.610000] [sw-ehci2]: Set USB Power ON
[    1.620000] sw-ehci sw-ehci.2: SW USB2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.630000] sw-ehci sw-ehci.2: new USB bus registered, assigned bus number 3
[    1.650000] sw-ehci sw-ehci.2: irq 40, io mem 0xf1c1c000
[    1.750000] usb 1-1: new high speed USB device number 2 using sw-ehci
[    1.780000] sw-ehci sw-ehci.2: USB 0.0 started, EHCI 1.00
[    1.780000] ehci_irq: port change detect
[    1.810000] [sw-ehci2]: sw_usb_disable_ehci
[    1.810000] [sw-ehci2]: remove, pdev->name: sw-ehci, pdev->id: 2, sw_ehci: 0xc0810bac
[    1.830000] sw-ehci sw-ehci.2: remove, state 1
[    1.850000] sw-ehci sw-ehci.2: USB bus 3 deregistered
[    1.850000] [sw-ehci2]: Set USB Power OFF
[    1.860000] [sw-ehci2]: close clock
[    1.870000] [sw-ohci2]: probe, pdev->name: sw-ohci, pdev->id: 2, sw_ohci: 0xc0810cbc
[    1.880000] [sw-ohci2]: open clock
[    1.910000] [sw-ohci2]: Set USB Power ON
[    1.910000] sw-ohci sw-ohci.2: SW USB2.0 'Open' Host Controller (OHCI) Driver
[    1.930000] sw-ohci sw-ohci.2: new USB bus registered, assigned bus number 3
[    1.940000] sw-ohci sw-ohci.2: irq 65, io mem 0xf1c1c400
[    2.020000] [sw-ohci2]: sw_usb_disable_ohci
[    2.030000] [sw-ohci2]: remove, pdev->name: sw-ohci, pdev->id: 2, sw_ohci: 0xc0810cbc
[    2.040000] sw-ohci sw-ohci.2: remove, state 1
[    2.060000] sw-ohci sw-ohci.2: USB bus 3 deregistered
[    2.070000] [sw-ohci2]: Set USB Power OFF
[    2.080000] [sw-ohci2]: close clock
[   52.570000] usb 1-1.3: new low speed USB device number 3 using sw-ehci
[   52.770000] input:   USB Keyboard as /devices/platform/sw-ehci.1/usb1/1-1/1-1.3/1-1.3:1.0/input/input1
[   52.790000] generic-usb 0003:04D9:1603.0001: input: USB HID v1.10 Keyboard [  USB Keyboard] on usb-sw-ehci-1.3/input0
[   52.880000] input:   USB Keyboard as /devices/platform/sw-ehci.1/usb1/1-1/1-1.3/1-1.3:1.1/input/input2
[   52.900000] generic-usb 0003:04D9:1603.0002: input: USB HID v1.10 Device [  USB Keyboard] on usb-sw-ehci-1.3/input1

using linaro's gcc 4.6.3

from linux-sunxi.

xlab avatar xlab commented on September 7, 2024

I'm doing that on a default config.

make ARCH=arm sun4i_crane_defconfig
make ARCH=arm menuconfig
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- -j3 uImage

But the only difference was I set CONFIG_EARLY_PRINTK=y in menu, otherwise kernel fails silently.
Using linaro's gcc 4.7.1

from linux-sunxi.

hno avatar hno commented on September 7, 2024

Which script.bin are you using?

from linux-sunxi.

xlab avatar xlab commented on September 7, 2024

It fails right there -- drivers/usb/sun4i_usb/hcd/hcd0/sw_hcd0.c.

At INIT_WORK call:

static int sw_hcd_init_controller(struct device *dev, int nIrq, void __iomem *ctrl)
{
// ..........................

    /* Init IRQ workqueue before request_irq */
    INIT_WORK(&sw_hcd->irq_work, sw_hcd_irq_work);

    /* attach to the IRQ */
    if (request_irq(nIrq, sw_hcd->isr, 0, dev_name(dev), sw_hcd)) {
        DMSG_PANIC("ERR: request_irq %d failed!\n", nIrq);
        status = -ENODEV;
        goto fail2;
    }

    sw_hcd->nIrq = nIrq;

    /* FIXME this handles wakeup irqs wrong */
    if (enable_irq_wake(nIrq) == 0) {
        sw_hcd->irq_wake = 1;
        device_init_wakeup(dev, 1);
    } else {
        sw_hcd->irq_wake = 0;
    }

// ..........................

from linux-sunxi.

xlab avatar xlab commented on September 7, 2024

hno wrote:

Which script.bin are you using?

Original script.bin from Novo7 Elf firmware (passed with bin2fex > fex2bin).
3.0.8+ pre-compiled kernel from steev (from flashmydroid) works fine.

from linux-sunxi.

turl avatar turl commented on September 7, 2024

I'm using _OTG to get both usb host and client and I'm not seeing any such failure with my defconfig. I've used an usb mouse successfully.

from linux-sunxi.

 avatar commented on September 7, 2024

I also see a panic in sw_hcd_init_controller. Using Linaro gcc 4.7.1, original script.bin; non-default config, but with the same USB options.

[usb_manager]: CONFIG_USB_SW_SUN4I_USB0_OTG
[sw_hcd0]: usb host driver initialize........
[sw_hcd0]: open_usb_clock                    
[sw_hcd0]: host_init_state = 0
[sw_hcd0]: platform is usb host
[sw_hcd0]: sw_hcd_init_controller: sw_hcd_host0: USB Host mode controller at f1c13000 using PIO, IRQ 38
<1>Unable to handle kernel paging request at virtual address 0038007b                                  
<1>pgd = c0004000                                                    
<1>[0038007b] *pgd=00000000
<0>Internal error: Oops: 5 [#1] PREEMPT

...

[<c029dea0>] (dev_driver_string+0x0/0x38) from [<c029df64>] (__dev_printk+0x20/0x64)
[<c029df64>] (__dev_printk+0x20/0x64) from [<c029dfdc>] (_dev_info+0x34/0x44)       
[<c029dfdc>] (_dev_info+0x34/0x44) from [<c02f819c>] (usb_add_hcd+0x24/0x6ac)
[<c02f819c>] (usb_add_hcd+0x24/0x6ac) from [<c043cd50>] (sw_hcd_init_controller.constprop.8+0x394/0x470)
[<c043cd50>] (sw_hcd_init_controller.constprop.8+0x394/0x470) from [<c001ce64>] (sw_hcd_probe+0xdc/0x178)
[<c001ce64>] (sw_hcd_probe+0xdc/0x178) from [<c02a2630>] (platform_drv_probe+0x14/0x18)                  
[<c02a2630>] (platform_drv_probe+0x14/0x18) from [<c02a1220>] (driver_probe_device+0xac/0x288)
[<c02a1220>] (driver_probe_device+0xac/0x288) from [<c02a1488>] (__driver_attach+0x8c/0x90)   
[<c02a1488>] (__driver_attach+0x8c/0x90) from [<c02a0058>] (bus_for_each_dev+0x44/0x8c)    
[<c02a0058>] (bus_for_each_dev+0x44/0x8c) from [<c02a0b08>] (bus_add_driver+0x188/0x278)
[<c02a0b08>] (bus_add_driver+0x188/0x278) from [<c02a1964>] (driver_register+0x78/0x148)
[<c02a1964>] (driver_register+0x78/0x148) from [<c02a29c4>] (platform_driver_probe+0x18/0x9c)
[<c02a29c4>] (platform_driver_probe+0x18/0x9c) from [<c002a458>] (do_one_initcall+0xfc/0x164)
[<c002a458>] (do_one_initcall+0xfc/0x164) from [<c0008a54>] (kernel_init+0xac/0x14c)         
[<c0008a54>] (kernel_init+0xac/0x14c) from [<c003191c>] (kernel_thread_exit+0x0/0x8)

from linux-sunxi.

amery avatar amery commented on September 7, 2024

can you check with bin2fex if you script.bin isn't corrupted?

from linux-sunxi.

 avatar commented on September 7, 2024

bin2fex script.bin | fex2bin | diff - script.bin works as expected (fex for perusal.)

from linux-sunxi.

hno avatar hno commented on September 7, 2024

Looiking at the trace from nil-- and looks like there may be some device descriptive information missing, and also looks like a very different issue than Xlab is having.

dev_driver_string() is

    drv = ACCESS_ONCE(dev->driver);
    return drv ? drv->name :
                    (dev->bus ? dev->bus->name :
                    (dev->class ? dev->class->name : ""));

called from __dev_printk (via define_dev_printk_level macro definition of _dev_info)

    return printk("%s%s %s: %pV",
                  KERN_INFO, dev_driver_string(dev), dev_name(dev), vaf);

called from usb_add_hdc()

    dev_info(hcd->self.controller, "%s\n", hcd->product_desc);

nil--, what is your USB_SW_SUN4I_USB0_* kernel .config setting? CONFIG_USB_SW_SUN4I_USB0_HOST_ONLY? (default is OTG)

from linux-sunxi.

 avatar commented on September 7, 2024

All CONFIG_USB_SW_ are default, so yes, it's OTG. The oops is from chasing a wild pointer?

from linux-sunxi.

jfreedom avatar jfreedom commented on September 7, 2024

I'm running into a somewhat similar issue. I think I'm duplicating another build pretty closely (the one from http://blog.kernelpicnic.net/), but using the sunxi-3.0 branch on an mk802. The kernel doesn't seem to be panicing, but I do get an error when sw_hcd0.c requests an IRQ it returns an error, and then USB doesn't work. I'll probably try using v3.0.39, but then the only real difference will be the GCC version I'm using (4.7.2) and the fact that I'm building it.

from linux-sunxi.

techn avatar techn commented on September 7, 2024

Could someone test this with latest kernel?

from linux-sunxi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.