jdb
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2070
Joined: Thu Jul 11, 2013 2:37 pm

Re: Call for beta testers: FIQ_FSM USB driver rewrite

Fri Mar 14, 2014 11:10 am

dsc3507 wrote:I would like to try this out but I need to compile some local code against the kernel to do that. Is the kernel source available for the rewrite or is there a patch I can apply to what I am currently using. I have the kernel source and I am currently compiled for 3.10.25+ from Jan 7, 2014.
If you do a git clone https://github.com/raspberrypi/linux.git then git checkout rpi-3.10.y-next you will be on the branch that contains fiq_fsm.

You can then do a make headers_install.

Alternatively you can take the commits on the top of that branch as a patch and apply it to your own repository.
Rockets are loud.
https://astro-pi.org

MattF
Posts: 55
Joined: Tue Feb 12, 2013 10:01 am

Re: Call for beta testers: FIQ_FSM USB driver rewrite

Fri Mar 14, 2014 11:34 pm

I've hand applied this to my 3.13 aufs tree and it looks very promising after short testing.
May have cured the hci0 TX timeouts that I occasionally see at USB2 speeds.

ajoburg
Posts: 12
Joined: Thu Feb 14, 2013 1:16 am

Re: Call for beta testers: FIQ_FSM USB driver rewrite

Sat Mar 15, 2014 5:48 pm

Thanks for all the hard work that has gone into this rewrite. With this latest change I'm able to run smoothly for many days with no crashes. However, there is one thing I've noticed that seems very strange. Here is my system configuration:

Raspberry Pi: Model B rev 2
Power: New Trent NT90C 10W 5V/2A Dual USB Ports high-speed AC Wall Charger http://www.amazon.com/gp/product/B009RX ... UTF8&psc=1
SD Card: 8GB Sandisk Extreme 45mb/s
USB Flash Stick: Sandisk Cruzer 64 GB in a Belkin Hi-Speed USB 2.0 4-Port Hub F5U234v1
Wifi: Edimax EW-7811un

When I have both the USB flash stick and WiFi dongle plugged into the powered hub, the WiFi dongle often silently stops working...typically only when there is heavy load as far as I can tell. In many cases, ifconfig will even show an IP address, but the device is unreachable on the network and cannot reach any other hosts. When I have the USB stick plugged into the powered hub and the WiFi dongle plugged in directly to the Raspberry Pi, this never happens and the system runs happily for many days at a time.

Any ideas what might be happening? I'd like to be able to have WiFi (and a BT dongle) added to the powered hub...and it doesn't make sense to me why they wouldn't work when plugged into the powered hub but would work when plugged directly into the Pi.

Some system/log info below:

Code: Select all

[email protected] ~ $ uname -a
Linux raspberrypi 3.10.30+ #652 PREEMPT Thu Mar 6 18:47:35 GMT 2014 armv6l GNU/Linux

Code: Select all

[email protected] ~ $ vcgencmd version
Mar  6 2014 19:03:55 
Copyright (c) 2012 Broadcom
version c96cb035fdc907d28db836bbb1606aea2a8e73d9 (clean) (release)

Code: Select all

[email protected] ~ $ cat /proc/cmdline
dma.dmachans=0x7f35 bcm2708_fb.fbwidth=1920 bcm2708_fb.fbheight=1080 bcm2708.boardrev=0xe bcm2708.serial=0x6edb2594 smsc95xx.macaddr=B8:27:EB:DB:25:94 sdhci-bcm2708.emmc_clock_freq=250000000 vc_mem.mem_base=0x1ec00000 vc_mem.mem_size=0x20000000  smsc95xx.turbo_mode=N dwc_otg.dma_enable=1 dwc_otg.dma_burst_size=256 dwc_otg.fiq_enable=1 dwc_otg.fiq_fsm_enable=1 dwc_otg.fiq_fsm_mask=0x3 dwc_otg.lpm_enable=0 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait
There doesn't seem to be much in /var/log/syslog. I had written a script that runs via cron to check every ten minutes if we've lost a wifi connection and if so reset the usb port (I found ifdown/ifup doesn't always work), so this is what you see in the syslog. When I plugged a keyboard into the usb hub and ran

Code: Select all

sudo ifdown wlan0
and then

Code: Select all

sudo ifup wlan0
it was fixed.

Code: Select all

Mar 15 09:52:22 raspberrypi dhclient: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 7
Mar 15 09:52:29 raspberrypi dhclient: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 8
Mar 15 09:52:37 raspberrypi dhclient: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 13
Mar 15 09:52:50 raspberrypi dhclient: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 15
Mar 15 09:53:05 raspberrypi dhclient: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 18
Mar 15 09:53:23 raspberrypi dhclient: No DHCPOFFERS received.
Mar 15 09:53:23 raspberrypi dhclient: No working leases in persistent database - sleeping.
Mar 15 10:00:01 raspberrypi /USR/SBIN/CRON[24228]: (pi) CMD (/home/pi/petrol-slideshow/usbreset/check_wifi.sh)
Mar 15 10:00:04 raspberrypi /USR/SBIN/CRON[24227]: (CRON) info (No MTA installed, discarding output)
Mar 15 10:00:40 raspberrypi dhclient: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 7
Mar 15 10:00:47 raspberrypi dhclient: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 8
Mar 15 10:00:55 raspberrypi dhclient: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 15
Mar 15 10:01:10 raspberrypi dhclient: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 9
Mar 15 10:01:19 raspberrypi dhclient: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 14
Mar 15 10:01:33 raspberrypi dhclient: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 8
Mar 15 10:01:41 raspberrypi dhclient: No DHCPOFFERS received.
Mar 15 10:01:41 raspberrypi dhclient: No working leases in persistent database - sleeping.
Mar 15 10:08:45 raspberrypi dhclient: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 5
Mar 15 10:08:50 raspberrypi dhclient: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 12
Mar 15 10:09:02 raspberrypi dhclient: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 7
Mar 15 10:09:09 raspberrypi dhclient: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 15
Mar 15 10:09:24 raspberrypi dhclient: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 8
Mar 15 10:09:32 raspberrypi dhclient: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 9
Mar 15 10:09:41 raspberrypi dhclient: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 5
Mar 15 10:09:46 raspberrypi dhclient: No DHCPOFFERS received.
Mar 15 10:09:46 raspberrypi dhclient: No working leases in persistent database - sleeping.
Mar 15 10:10:01 raspberrypi /USR/SBIN/CRON[24448]: (pi) CMD (/home/pi/petrol-slideshow/usbreset/check_wifi.sh)
Mar 15 10:10:04 raspberrypi /USR/SBIN/CRON[24447]: (CRON) info (No MTA installed, discarding output)
Mar 15 10:13:17 raspberrypi dhclient: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 7
Mar 15 10:13:24 raspberrypi dhclient: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 14
Mar 15 10:13:38 raspberrypi dhclient: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 15
Mar 15 10:13:53 raspberrypi dhclient: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 20
Mar 15 10:14:13 raspberrypi dhclient: DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 5
Last edited by ajoburg on Tue Mar 18, 2014 3:22 am, edited 1 time in total.

ajoburg
Posts: 12
Joined: Thu Feb 14, 2013 1:16 am

Re: Call for beta testers: FIQ_FSM USB driver rewrite

Sat Mar 15, 2014 6:02 pm

I thought this would be useful too:

Code: Select all

[email protected] ~ $ sudo lsusb -v

Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. 
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            9 Hub
  bDeviceSubClass         0 Unused
  bDeviceProtocol         2 TT per port
  bMaxPacketSize0        64
  idVendor           0x0424 Standard Microsystems Corp.
  idProduct          0x9514 
  bcdDevice            2.00
  iManufacturer           0 
  iProduct                0 
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           41
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower                2mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0 Unused
      bInterfaceProtocol      1 Single TT
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0001  1x 1 bytes
        bInterval              12
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       1
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0 Unused
      bInterfaceProtocol      2 TT per port
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0001  1x 1 bytes
        bInterval              12
Hub Descriptor:
  bLength               9
  bDescriptorType      41
  nNbrPorts             5
  wHubCharacteristic 0x000d
    Per-port power switching
    Compound device
    Per-port overcurrent protection
    TT think time 8 FS bits
  bPwrOn2PwrGood       50 * 2 milli seconds
  bHubContrCurrent      1 milli Ampere
  DeviceRemovable    0x02
  PortPwrCtrlMask    0xff
 Hub Port Status:
   Port 1: 0000.0503 highspeed power enable connect
   Port 2: 0000.0100 power
   Port 3: 0000.0503 highspeed power enable connect
   Port 4: 0000.0100 power
   Port 5: 0000.0100 power
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass            9 Hub
  bDeviceSubClass         0 Unused
  bDeviceProtocol         0 Full speed (or root) hub
  bMaxPacketSize0        64
  bNumConfigurations      1
Device Status:     0x0001
  Self Powered

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            9 Hub
  bDeviceSubClass         0 Unused
  bDeviceProtocol         1 Single TT
  bMaxPacketSize0        64
  idVendor           0x1d6b Linux Foundation
  idProduct          0x0002 2.0 root hub
  bcdDevice            3.10
  iManufacturer           3 Linux 3.10.30+ dwc_otg_hcd
  iProduct                2 DWC OTG Controller
  iSerial                 1 bcm2708_usb
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           25
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower                0mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0 Unused
      bInterfaceProtocol      0 Full speed (or root) hub
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0004  1x 4 bytes
        bInterval              12
Hub Descriptor:
  bLength               9
  bDescriptorType      41
  nNbrPorts             1
  wHubCharacteristic 0x0008
    Ganged power switching
    Per-port overcurrent protection
    TT think time 8 FS bits
  bPwrOn2PwrGood        1 * 2 milli seconds
  bHubContrCurrent      0 milli Ampere
  DeviceRemovable    0x00
  PortPwrCtrlMask    0xff
 Hub Port Status:
   Port 1: 0000.0503 highspeed power enable connect
Device Status:     0x0001
  Self Powered

Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. 
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass          255 Vendor Specific Class
  bDeviceSubClass         0 
  bDeviceProtocol         1 
  bMaxPacketSize0        64
  idVendor           0x0424 Standard Microsystems Corp.
  idProduct          0xec00 
  bcdDevice            2.00
  iManufacturer           0 
  iProduct                0 
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           39
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower                2mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass      0 
      bInterfaceProtocol    255 
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0010  1x 16 bytes
        bInterval               4
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass          255 Vendor Specific Class
  bDeviceSubClass         0 
  bDeviceProtocol         1 
  bMaxPacketSize0        64
  bNumConfigurations      1
Device Status:     0x0001
  Self Powered

Bus 001 Device 005: ID 050d:0234 Belkin Components F5U234 USB 2.0 4-Port Hub
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            9 Hub
  bDeviceSubClass         0 Unused
  bDeviceProtocol         2 TT per port
  bMaxPacketSize0        64
  idVendor           0x050d Belkin Components
  idProduct          0x0234 F5U234 USB 2.0 4-Port Hub
  bcdDevice           32.98
  iManufacturer           0 
  iProduct                0 
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           41
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0 Unused
      bInterfaceProtocol      1 Single TT
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0001  1x 1 bytes
        bInterval              12
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       1
      bNumEndpoints           1
      bInterfaceClass         9 Hub
      bInterfaceSubClass      0 Unused
      bInterfaceProtocol      2 TT per port
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0001  1x 1 bytes
        bInterval              12
Hub Descriptor:
  bLength               9
  bDescriptorType      41
  nNbrPorts             4
  wHubCharacteristic 0x00e9
    Per-port power switching
    Per-port overcurrent protection
    TT think time 32 FS bits
    Port indicators
  bPwrOn2PwrGood       50 * 2 milli seconds
  bHubContrCurrent    100 milli Ampere
  DeviceRemovable    0x00
  PortPwrCtrlMask    0xff
 Hub Port Status:
   Port 1: 0000.0503 highspeed power enable connect
   Port 2: 0000.0103 power enable connect
   Port 3: 0000.0100 power
   Port 4: 0000.0503 highspeed power enable connect
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass            9 Hub
  bDeviceSubClass         0 Unused
  bDeviceProtocol         0 Full speed (or root) hub
  bMaxPacketSize0        64
  bNumConfigurations      1
Device Status:     0x0001
  Self Powered

Bus 001 Device 009: ID 0bda:8176 Realtek Semiconductor Corp. RTL8188CUS 802.11n WLAN Adapter
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x0bda Realtek Semiconductor Corp.
  idProduct          0x8176 RTL8188CUS 802.11n WLAN Adapter
  bcdDevice            2.00
  iManufacturer           1 Realtek
  iProduct                2 802.11n WLAN Adapter
  iSerial                 3 00e04c000001
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           46
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              500mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           4
      bInterfaceClass       255 Vendor Specific Class
      bInterfaceSubClass    255 Vendor Specific Subclass
      bInterfaceProtocol    255 Vendor Specific Protocol
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x84  EP 4 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  bNumConfigurations      1
Device Status:     0x0000
  (Bus Powered)

Bus 001 Device 006: ID 0a12:0001 Cambridge Silicon Radio, Ltd Bluetooth Dongle (HCI mode)
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass          224 Wireless
  bDeviceSubClass         1 Radio Frequency
  bDeviceProtocol         1 Bluetooth
  bMaxPacketSize0        64
  idVendor           0x0a12 Cambridge Silicon Radio, Ltd
  idProduct          0x0001 Bluetooth Dongle (HCI mode)
  bcdDevice           88.91
  iManufacturer           0 
  iProduct                2 CSR8510 A10
  iSerial                 0 
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength          177
    bNumInterfaces          2
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0xe0
      Self Powered
      Remote Wakeup
    MaxPower              100mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           3
      bInterfaceClass       224 Wireless
      bInterfaceSubClass      1 Radio Frequency
      bInterfaceProtocol      1 Bluetooth
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0010  1x 16 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x82  EP 2 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0040  1x 64 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass       224 Wireless
      bInterfaceSubClass      1 Radio Frequency
      bInterfaceProtocol      1 Bluetooth
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0000  1x 0 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0000  1x 0 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       1
      bNumEndpoints           2
      bInterfaceClass       224 Wireless
      bInterfaceSubClass      1 Radio Frequency
      bInterfaceProtocol      1 Bluetooth
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0009  1x 9 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0009  1x 9 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       2
      bNumEndpoints           2
      bInterfaceClass       224 Wireless
      bInterfaceSubClass      1 Radio Frequency
      bInterfaceProtocol      1 Bluetooth
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0011  1x 17 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0011  1x 17 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       3
      bNumEndpoints           2
      bInterfaceClass       224 Wireless
      bInterfaceSubClass      1 Radio Frequency
      bInterfaceProtocol      1 Bluetooth
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0019  1x 25 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0019  1x 25 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       4
      bNumEndpoints           2
      bInterfaceClass       224 Wireless
      bInterfaceSubClass      1 Radio Frequency
      bInterfaceProtocol      1 Bluetooth
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0021  1x 33 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0021  1x 33 bytes
        bInterval               1
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        1
      bAlternateSetting       5
      bNumEndpoints           2
      bInterfaceClass       224 Wireless
      bInterfaceSubClass      1 Radio Frequency
      bInterfaceProtocol      1 Bluetooth
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x03  EP 3 OUT
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0031  1x 49 bytes
        bInterval               1
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x83  EP 3 IN
        bmAttributes            1
          Transfer Type            Isochronous
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0031  1x 49 bytes
        bInterval               1
Device Status:     0x0001
  Self Powered

Bus 001 Device 007: ID 0781:5530 SanDisk Corp. Cruzer
Device Descriptor:
  bLength                18
  bDescriptorType         1
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  idVendor           0x0781 SanDisk Corp.
  idProduct          0x5530 Cruzer
  bcdDevice            1.26
  iManufacturer           1 SanDisk
  iProduct                2 Cruzer
  iSerial                 3 200517380307AB5277A9
  bNumConfigurations      1
  Configuration Descriptor:
    bLength                 9
    bDescriptorType         2
    wTotalLength           32
    bNumInterfaces          1
    bConfigurationValue     1
    iConfiguration          0 
    bmAttributes         0x80
      (Bus Powered)
    MaxPower              200mA
    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        0
      bAlternateSetting       0
      bNumEndpoints           2
      bInterfaceClass         8 Mass Storage
      bInterfaceSubClass      6 SCSI
      bInterfaceProtocol     80 Bulk-Only
      iInterface              0 
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x81  EP 1 IN
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               0
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x02  EP 2 OUT
        bmAttributes            2
          Transfer Type            Bulk
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0200  1x 512 bytes
        bInterval               1
Device Qualifier (for other device speed):
  bLength                10
  bDescriptorType         6
  bcdUSB               2.00
  bDeviceClass            0 (Defined at Interface level)
  bDeviceSubClass         0 
  bDeviceProtocol         0 
  bMaxPacketSize0        64
  bNumConfigurations      1
Device Status:     0x0000
  (Bus Powered)

MattF
Posts: 55
Joined: Tue Feb 12, 2013 10:01 am

Re: Call for beta testers: FIQ_FSM USB driver rewrite

Sat Mar 15, 2014 10:50 pm

I've been stressing this for a day now with airodump-ng in a pretty busy wifi environment and very few complaints in dmesg.

Looking very solid.

GrayShade
Posts: 39
Joined: Fri Jul 05, 2013 6:13 am

Re: Call for beta testers: FIQ_FSM USB driver rewrite

Sun Mar 16, 2014 8:22 pm

Do you think these might indicate a problem? I just got home and my Pi was frozen (no pun intended, network at least since it's headless).

Code: Select all

Mar 16 19:53:28 raspberrypi kernel: [441694.837978] Transfer to device 5 endpoint 0x5 failed - FIQ reported NYET. Data may have been lost.
Mar 16 19:55:29 raspberrypi kernel: [441815.821280] Transfer to device 5 endpoint 0x5 failed - FIQ reported NYET. Data may have been lost.
Mar 16 19:56:11 raspberrypi kernel: [441857.812633] Transfer to device 5 endpoint 0x5 failed - FIQ reported NYET. Data may have been lost.
Mar 16 19:56:16 raspberrypi kernel: [441863.132004] smsc95xx 1-1.1:1.0 eth0: Failed to read reg index 0x00000114: -110
Mar 16 19:56:16 raspberrypi kernel: [441863.142882] smsc95xx 1-1.1:1.0 eth0: Error reading MII_ACCESS
Mar 16 19:56:16 raspberrypi kernel: [441863.151361] smsc95xx 1-1.1:1.0 eth0: MII is busy in smsc95xx_mdio_read
Mar 16 19:56:21 raspberrypi kernel: [441868.152143] smsc95xx 1-1.1:1.0 eth0: Failed to read reg index 0x00000114: -110
Mar 16 19:56:21 raspberrypi kernel: [441868.163192] smsc95xx 1-1.1:1.0 eth0: Error reading MII_ACCESS
Mar 16 19:56:21 raspberrypi kernel: [441868.171629] smsc95xx 1-1.1:1.0 eth0: MII is busy in smsc95xx_mdio_read
Mar 16 19:56:27 raspberrypi kernel: [441874.282328] smsc95xx 1-1.1:1.0 eth0: Failed to read reg index 0x00000114: -110
Mar 16 19:56:27 raspberrypi kernel: [441874.292071] smsc95xx 1-1.1:1.0 eth0: Error reading MII_ACCESS
Mar 16 19:56:27 raspberrypi kernel: [441874.301555] smsc95xx 1-1.1:1.0 eth0: MII is busy in smsc95xx_mdio_read
Mar 16 19:56:32 raspberrypi kernel: [441879.302478] smsc95xx 1-1.1:1.0 eth0: Failed to read reg index 0x00000114: -110
Mar 16 19:56:32 raspberrypi kernel: [441879.312246] smsc95xx 1-1.1:1.0 eth0: Error reading MII_ACCESS
Mar 16 19:56:32 raspberrypi kernel: [441879.321200] smsc95xx 1-1.1:1.0 eth0: MII is busy in smsc95xx_mdio_read
Mar 16 19:56:33 raspberrypi kernel: [441880.192506] smsc95xx 1-1.1:1.0 eth0: hardware isn't capable of remote wakeup
Mar 16 19:56:38 raspberrypi kernel: [441885.232624] smsc95xx 1-1.1:1.0 eth0: Failed to write reg index 0x00000014: -110
Mar 16 19:56:44 raspberrypi kernel: [441891.242787] smsc95xx 1-1.1:1.0 eth0: Failed to write reg index 0x00000014: -110
Mar 16 19:56:50 raspberrypi kernel: [441897.252949] smsc95xx 1-1.1:1.0 eth0: Failed to write reg index 0x00000014: -110
Mar 16 19:56:56 raspberrypi kernel: [441903.263107] smsc95xx 1-1.1:1.0 eth0: Failed to write reg index 0x00000014: -110
Mar 16 19:57:02 raspberrypi kernel: [441909.273285] smsc95xx 1-1.1:1.0 eth0: Failed to write reg index 0x00000014: -110
Mar 16 19:57:08 raspberrypi kernel: [441915.283444] smsc95xx 1-1.1:1.0 eth0: Failed to write reg index 0x00000014: -110
Mar 16 19:57:14 raspberrypi kernel: [441921.293615] smsc95xx 1-1.1:1.0 eth0: Failed to write reg index 0x00000014: -110
Mar 16 19:57:20 raspberrypi kernel: [441927.303780] smsc95xx 1-1.1:1.0 eth0: Failed to write reg index 0x00000014: -110
Mar 16 19:57:26 raspberrypi kernel: [441933.313929] smsc95xx 1-1.1:1.0 eth0: Failed to write reg index 0x00000014: -110
Mar 16 19:57:32 raspberrypi kernel: [441939.324099] smsc95xx 1-1.1:1.0 eth0: Failed to write reg index 0x00000014: -110
Mar 16 19:57:38 raspberrypi kernel: [441945.334256] smsc95xx 1-1.1:1.0 eth0: Failed to write reg index 0x00000014: -110
Mar 16 19:57:44 raspberrypi kernel: [441951.344436] smsc95xx 1-1.1:1.0 eth0: Failed to write reg index 0x00000014: -110
Mar 16 19:57:50 raspberrypi kernel: [441957.354600] smsc95xx 1-1.1:1.0 eth0: Failed to write reg index 0x00000014: -110
Mar 16 19:57:56 raspberrypi kernel: [441963.364759] smsc95xx 1-1.1:1.0 eth0: Failed to write reg index 0x00000014: -110

jdb
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2070
Joined: Thu Jul 11, 2013 2:37 pm

Re: Call for beta testers: FIQ_FSM USB driver rewrite

Mon Mar 17, 2014 5:05 pm

USB falling over like that is Bad (tm). It could be that the FIQ stopped communicating to the IRQ which results in the timeout messages.

What does that Pi do normally? I.e. what services or programs are nomally active?
Rockets are loud.
https://astro-pi.org

GrayShade
Posts: 39
Joined: Fri Jul 05, 2013 6:13 am

Re: Call for beta testers: FIQ_FSM USB driver rewrite

Mon Mar 17, 2014 5:35 pm

On the USB side, it's got transmission-daemon, an external hard-drive connected through a hub and a USB sound card outputting continuously. On the CPU side, there's an app that polls a GPIO pin quite often and rrdtool making some graphs.

I mention that I never got a crash like this before.

jdb
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2070
Joined: Thu Jul 11, 2013 2:37 pm

Re: Call for beta testers: FIQ_FSM USB driver rewrite

Mon Mar 17, 2014 11:53 pm

jdb wrote:
milhouse wrote:I'm using this build with the latest FIQ FSM patches from rpi-3.13.y-next on OpenELEC, and I'm seeing quite a few of these in dmesg (100 messages logged in 1.5 hours of uptime):

Code: Select all

[  172.056247] Transfer to device 4 endpoint 0x2 failed - FIQ reported NYET. Data may have been lost.

[ 1402.764156] Transfer to device 4 endpoint 0x1 failed - FIQ reported NYET. Data may have been lost.
These messages are being printed because timing got screwed up somehow. The issue is under investigation: it appears that using GPU interfaces makes this far more likely to happen.
The underlying bug causing a vast majority of "FIQ reported NYET" failure cases is that Linux is accidentally disabling FIQs due to an odd combination of several things - namely stale processor state that was saved when a thread that was started before USB was brought up (i.e. early in boot) went to sleep.

Restoring the stale state squashes our FIQ enable bit which causes no end of trouble.
Rockets are loud.
https://astro-pi.org

dsc3507
Posts: 40
Joined: Sun Apr 28, 2013 5:08 am

Re: Call for beta testers: FIQ_FSM USB driver rewrite

Tue Mar 18, 2014 5:07 am

>If you do a git clone https://github.com/raspberrypi/linux.git then git checkout rpi-3.10.y-next you will be on the branch that >contains fiq_fsm.

>You can then do a make headers_install.

>Alternatively you can take the commits on the top of that branch as a patch and apply it to your own repository.

Ok I need a little more help. I checked out the rpi-3.10.y-next branch with git and I checked in -

arch/arm/mach-bcm2708/bcm2708.c for the changed code but it was not there. Is there something else I need to do?

Here is what I did -

git fetch git://github.com/raspberrypi/linux.git rpi-3.10.y-next:refs/remotes/origin/rpi-3.10.y-next
git checkout rpi-3.10.y-next

I would like to get the entire kernel with changes.

GrayShade
Posts: 39
Joined: Fri Jul 05, 2013 6:13 am

Re: Call for beta testers: FIQ_FSM USB driver rewrite

Tue Mar 18, 2014 6:26 am

jdb wrote:The underlying bug causing a vast majority of "FIQ reported NYET" failure cases is that Linux is accidentally disabling FIQs due to an odd combination of several things - namely stale processor state that was saved when a thread that was started before USB was brought up (i.e. early in boot) went to sleep.

Restoring the stale state squashes our FIQ enable bit which causes no end of trouble.
Could it also make the network card stop working?

ajoburg
Posts: 12
Joined: Thu Feb 14, 2013 1:16 am

Re: Call for beta testers: FIQ_FSM USB driver rewrite

Wed Mar 19, 2014 4:32 am

I've run for about 5 hours with a usb bluetooth device running as an iBeacon under bluez with the following messages (though my app seemed ok):

Code: Select all

Mar 18 21:10:06 raspberrypi kernel: [21287.081303] Transfer to device 6 endpoint 0x1 failed - FIQ reported NYET. Data may have been lost.
Mar 18 21:10:06 raspberrypi kernel: [21287.431261] Transfer to device 6 endpoint 0x1 failed - FIQ reported NYET. Data may have been lost.
Mar 18 21:10:07 raspberrypi kernel: [21287.764277] Transfer to device 6 endpoint 0x1 failed - FIQ reported NYET. Data may have been lost.
Mar 18 21:10:07 raspberrypi kernel: [21287.831372] Transfer to device 6 endpoint 0x1 failed - FIQ reported NYET. Data may have been lost.
Mar 18 21:10:08 raspberrypi kernel: [21288.546745] Transfer to device 6 endpoint 0x1 failed - FIQ reported NYET. Data may have been lost.
Mar 18 21:10:08 raspberrypi kernel: [21288.664518] Transfer to device 6 endpoint 0x1 failed - FIQ reported NYET. Data may have been lost.
Mar 18 21:10:08 raspberrypi kernel: [21288.815113] Transfer to device 6 endpoint 0x1 failed - FIQ reported NYET. Data may have been lost.
Mar 18 21:10:08 raspberrypi kernel: [21289.380026] Transfer to device 6 endpoint 0x1 failed - FIQ reported NYET. Data may have been lost.
Mar 18 21:10:08 raspberrypi kernel: [21289.450013] Transfer to device 6 endpoint 0x1 failed - FIQ reported NYET. Data may have been lost.
Mar 18 21:10:09 raspberrypi kernel: [21289.581609] Transfer to device 6 endpoint 0x1 failed - FIQ reported NYET. Data may have been lost.
Then, I got the following and my app stopped working. Might this be related to FIQ_FSM?

Code: Select all

Mar 18 21:10:12 raspberrypi kernel: [21292.637283] dwc_otg_hcd_handle_hc_fsm: 5 callbacks suppressed
Mar 18 21:10:12 raspberrypi kernel: [21292.637325] Transfer to device 6 endpoint 0x1 failed - FIQ reported NYET. Data may have been lost.
Mar 18 21:15:21 raspberrypi kernel: [21602.209668] INFO: task kworker/0:2:7654 blocked for more than 120 seconds.
Mar 18 21:15:21 raspberrypi kernel: [21602.209701] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
Mar 18 21:15:21 raspberrypi kernel: [21602.209718] kworker/0:2     D c0403c5c     0  7654      2 0x00000000
Mar 18 21:15:21 raspberrypi kernel: [21602.209812] Workqueue: events od_dbs_timer
Mar 18 21:15:21 raspberrypi kernel: [21602.209891] [<c0403c5c>] (__schedule+0x278/0x558) from [<c04029d8>] (schedule_timeout+0x170/0x200)
Mar 18 21:15:21 raspberrypi kernel: [21602.209969] [<c04029d8>] (schedule_timeout+0x170/0x200) from [<c04036d8>] (__down+0x88/0xc0)
Mar 18 21:15:21 raspberrypi kernel: [21602.210026] [<c04036d8>] (__down+0x88/0xc0) from [<c0041a4c>] (down+0x60/0x64)
Mar 18 21:15:21 raspberrypi kernel: [21602.210105] [<c0041a4c>] (down+0x60/0x64) from [<c001aa28>] (bcm_mailbox_read+0x60/0x98)
Mar 18 21:15:21 raspberrypi kernel: [21602.210143] [<c001aa28>] (bcm_mailbox_read+0x60/0x98) from [<c001ab24>] (bcm_mailbox_property+0xc4/0x15c)
Mar 18 21:15:21 raspberrypi kernel: [21602.210187] [<c001ab24>] (bcm_mailbox_property+0xc4/0x15c) from [<c030a55c>] (bcm2835_cpufreq_driver_target+0x84/0x114)
Mar 18 21:15:21 raspberrypi kernel: [21602.210223] [<c030a55c>] (bcm2835_cpufreq_driver_target+0x84/0x114) from [<c0306478>] (__cpufreq_driver_target+0x50/0x74)
Mar 18 21:15:21 raspberrypi kernel: [21602.210260] [<c0306478>] (__cpufreq_driver_target+0x50/0x74) from [<c0309aac>] (dbs_check_cpu+0xf4/0x144)
Mar 18 21:15:21 raspberrypi kernel: [21602.210289] [<c0309aac>] (dbs_check_cpu+0xf4/0x144) from [<c0308f2c>] (od_dbs_timer+0x60/0xec)
Mar 18 21:15:21 raspberrypi kernel: [21602.210330] [<c0308f2c>] (od_dbs_timer+0x60/0xec) from [<c0036d0c>] (process_one_work+0x10c/0x360)
Mar 18 21:15:21 raspberrypi kernel: [21602.210360] [<c0036d0c>] (process_one_work+0x10c/0x360) from [<c00373c0>] (worker_thread+0x138/0x3ac)
Mar 18 21:15:21 raspberrypi kernel: [21602.210436] [<c00373c0>] (worker_thread+0x138/0x3ac) from [<c003cb9c>] (kthread+0xa4/0xb0)
Mar 18 21:15:21 raspberrypi kernel: [21602.210482] [<c003cb9c>] (kthread+0xa4/0xb0) from [<c000db58>] (ret_from_fork+0x14/0x3c)
Mar 18 21:17:01 raspberrypi /USR/SBIN/CRON[7766]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)
Mar 18 21:17:21 raspberrypi kernel: [21722.215280] INFO: task kworker/0:2:7654 blocked for more than 120 seconds.
Mar 18 21:17:21 raspberrypi kernel: [21722.215364] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
Mar 18 21:17:21 raspberrypi kernel: [21722.215387] kworker/0:2     D c0403c5c     0  7654      2 0x00000000
Mar 18 21:17:21 raspberrypi kernel: [21722.215457] Workqueue: events od_dbs_timer
Mar 18 21:17:21 raspberrypi kernel: [21722.215565] [<c0403c5c>] (__schedule+0x278/0x558) from [<c04029d8>] (schedule_timeout+0x170/0x200)
Mar 18 21:17:21 raspberrypi kernel: [21722.215603] [<c04029d8>] (schedule_timeout+0x170/0x200) from [<c04036d8>] (__down+0x88/0xc0)
Mar 18 21:17:21 raspberrypi kernel: [21722.215654] [<c04036d8>] (__down+0x88/0xc0) from [<c0041a4c>] (down+0x60/0x64)
Mar 18 21:17:21 raspberrypi kernel: [21722.215696] [<c0041a4c>] (down+0x60/0x64) from [<c001aa28>] (bcm_mailbox_read+0x60/0x98)
Mar 18 21:17:21 raspberrypi kernel: [21722.215763] [<c001aa28>] (bcm_mailbox_read+0x60/0x98) from [<c001ab24>] (bcm_mailbox_property+0xc4/0x15c)
Mar 18 21:17:21 raspberrypi kernel: [21722.215814] [<c001ab24>] (bcm_mailbox_property+0xc4/0x15c) from [<c030a55c>] (bcm2835_cpufreq_driver_target+0x84/0x114)
Mar 18 21:17:21 raspberrypi kernel: [21722.215851] [<c030a55c>] (bcm2835_cpufreq_driver_target+0x84/0x114) from [<c0306478>] (__cpufreq_driver_target+0x50/0x74)
Mar 18 21:17:21 raspberrypi kernel: [21722.215883] [<c0306478>] (__cpufreq_driver_target+0x50/0x74) from [<c0309aac>] (dbs_check_cpu+0xf4/0x144)
Mar 18 21:17:21 raspberrypi kernel: [21722.215912] [<c0309aac>] (dbs_check_cpu+0xf4/0x144) from [<c0308f2c>] (od_dbs_timer+0x60/0xec)
Mar 18 21:17:21 raspberrypi kernel: [21722.215954] [<c0308f2c>] (od_dbs_timer+0x60/0xec) from [<c0036d0c>] (process_one_work+0x10c/0x360)
Mar 18 21:17:21 raspberrypi kernel: [21722.215986] [<c0036d0c>] (process_one_work+0x10c/0x360) from [<c00373c0>] (worker_thread+0x138/0x3ac)
Mar 18 21:17:21 raspberrypi kernel: [21722.216014] [<c00373c0>] (worker_thread+0x138/0x3ac) from [<c003cb9c>] (kthread+0xa4/0xb0)
Mar 18 21:17:21 raspberrypi kernel: [21722.216055] [<c003cb9c>] (kthread+0xa4/0xb0) from [<c000db58>] (ret_from_fork+0x14/0x3c)


jdb
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2070
Joined: Thu Jul 11, 2013 2:37 pm

Re: Call for beta testers: FIQ_FSM USB driver rewrite

Wed Mar 19, 2014 5:24 pm

Update:

The BRANCH=next firmware now has a fix for one of the potential sources of the "FIQ reported NYET" messages seen when using a heavily loaded system. It may also fix cases where network devices suddenly stop responding.

Please test and report back any changes.
Rockets are loud.
https://astro-pi.org

dsc3507
Posts: 40
Joined: Sun Apr 28, 2013 5:08 am

Re: Call for beta testers: FIQ_FSM USB driver rewrite

Wed Mar 19, 2014 6:33 pm

OK got this compiled up I should have listened to the original instructions.

Anyhow I see marked improvement but I am still seeing breakup on my DAC and a serious problem with bits being set on the CM119 that are used for control.

Are there any cmdline settings I can change to check further. I am using -

dwc_otg.fiq_enable=1 dwc_otg.fiq_fsm_enable=1 dwc_otg.fiq_fsm_mask=0x3

The application is VOIP to a CM119. Also some additional bits being set in the CM119 are not working properly.

I am not seeing any messages or errors in /var/log/messages but my application gives the following errors -

soundcard_writeframe: sound device write buffer overflow

which also appear before using this fix when in usb2.0

jdb
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2070
Joined: Thu Jul 11, 2013 2:37 pm

Re: Call for beta testers: FIQ_FSM USB driver rewrite

Wed Mar 19, 2014 6:44 pm

What are these "bits being set"?

How are you measuring/testing them?
Rockets are loud.
https://astro-pi.org

dsc3507
Posts: 40
Joined: Sun Apr 28, 2013 5:08 am

Re: Call for beta testers: FIQ_FSM USB driver rewrite

Wed Mar 19, 2014 7:10 pm

The CM119 has gpio pins. In my application one bit is used for PTT on a radio circuit. It is not responding correctly. At times it hangs in the on state. I suspect this is because in general output to the CM119 is missing data and therefore the distorted audio.

Before the fiq_fix using 3.10.25+ I had much more distortion when using USB2.0 but I did not seem to have the bit hangup.

Are there other masks I can try or cmdline settings? Unfortunately the way it is is not going to work for me.

Should I try USB 1.1 with the fix. That worked for me in the old code although I did not like the reduced Ethernet speed.

The A/D side has always worked fine with the old and new code.

GrayShade
Posts: 39
Joined: Fri Jul 05, 2013 6:13 am

Re: Call for beta testers: FIQ_FSM USB driver rewrite

Wed Mar 19, 2014 8:01 pm

I'm still getting the NYET messages:

Code: Select all

[  234.993492] Transfer to device 5 endpoint 0x5 failed - FIQ reported NYET. Data may have been lost.
[  614.983463] Transfer to device 5 endpoint 0x5 failed - FIQ reported NYET. Data may have been lost.
[ 1099.845692] Transfer to device 5 endpoint 0x5 failed - FIQ reported NYET. Data may have been lost.
[ 1345.579322] Transfer to device 5 endpoint 0x5 failed - FIQ reported NYET. Data may have been lost.
[ 1554.080848] Transfer to device 5 endpoint 0x5 failed - FIQ reported NYET. Data may have been lost.
[ 1623.822030] Transfer to device 5 endpoint 0x5 failed - FIQ reported NYET. Data may have been lost.
[ 1687.403190] Transfer to device 5 endpoint 0x5 failed - FIQ reported NYET. Data may have been lost.
[ 1753.344361] Transfer to device 5 endpoint 0x5 failed - FIQ reported NYET. Data may have been lost.
[ 1753.534349] Transfer to device 5 endpoint 0x5 failed - FIQ reported NYET. Data may have been lost.
[ 1754.284359] Transfer to device 5 endpoint 0x5 failed - FIQ reported NYET. Data may have been lost.
[ 1999.138986] Transfer to device 5 endpoint 0x5 failed - FIQ reported NYET. Data may have been lost.
[ 1999.168978] Transfer to device 5 endpoint 0x5 failed - FIQ reported NYET. Data may have been lost.

Code: Select all

          RX bytes:18975949 (18.0 MiB)  TX bytes:991956910 (946.0 MiB)
Apparently, device 5 is my USB DAC. I'll update this later.

jdb
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2070
Joined: Thu Jul 11, 2013 2:37 pm

Re: Call for beta testers: FIQ_FSM USB driver rewrite

Wed Mar 19, 2014 8:59 pm

In your case you may be hitting the "other" bug that causes this.

Host channels (conceptual hardware resources that perform USB transactions) are nominated on a per-transaction basis to perform the entirety of a split transaction. The FSM relies on timely reporting of state (i.e. interrupts) from these host channels to properly decide as to what to do next.

There's a fairly serious bug in the method that these host channels use to report "channel halted" interrupts, which are used to advance the FSM state. These interrupts can be delayed because of an unknown cause and occur much later than when they should fire. A host channel cannot be re-used until it has halted and the interrupt has been serviced.

It seems that the delay is broadly correlated with the amount of other traffic on USB: more things happening = more likely that interrupts occur out-of-order. The FSM can tolerate at most 1 microframe of delay: any more and things get broken (and are impossible to fix). In these cases you end up with NYET messages which are the default response from a hub when you ask it for something it wasn't expecting.

There's a particularly insane workaround for this that I haven't even contemplated implementing: reserving a host channel for use in case of emergency. It seems that the raw interrupts reporting packet identifiers (ACK, NAK, NYET, whatever) trigger instantaneously and it is only the channel halt interrupts that get delayed. If one were to monitor the PID interrupts in the case where we know that bad things can happen, catch the bad case and then use the reserved channel, we could complete the transaction correctly.

The reason that this is an insane hack is because there are a limited number of host channels. There are 8 on the OTG hardware inside the Pi: reserving one "just in case" would hobble bandwidth in the case where you have lots of other well-behaved devices active.
Rockets are loud.
https://astro-pi.org

GrayShade
Posts: 39
Joined: Fri Jul 05, 2013 6:13 am

Re: Call for beta testers: FIQ_FSM USB driver rewrite

Wed Mar 19, 2014 9:48 pm

Thank you for the detailed description. I'm not familiar with the USB protocol, but my understanding is that:
  1. NYET packets are used to report transaction completion and to temporarily cork the other device when data can no longer be processed for a while.
  2. In my case, the second type of NYET packet either gets delayed, or arrives at the right time, but the interrupt is delivered too late.
  3. If the NYET is not delivered right away, new data might be sent in the meanwhile, possibly at a time when the device is not able to process it.
  4. When the packet finally arrives, there is not much that can be done with it, so it is logged, but this does not lead to things like a resource leak.
In this case, I'm wondering:
  1. Is there a way to find out who is responsible for this issue (my USB DAC, the Raspberry Pi hardware, the Linux kernel)?
  2. Would it be possible to delay the new transactions until the NYET arrives and a channel gets freed? I assume not, for isochronous transfers like mine.
  3. If you implement the workaround of reserving a channel, is there any guarantee that it will be enough?
  4. Are there any things I could fiddle with to find out more information? Perhaps disconnecting my external hard-drive or changing the ALSA fragment size (right now it's 10 ms, I think)?

jdb
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2070
Joined: Thu Jul 11, 2013 2:37 pm

Re: Call for beta testers: FIQ_FSM USB driver rewrite

Wed Mar 19, 2014 10:28 pm

In the context of talking to a hub (which is the end address for all USB2.0 high-speed packets when talking to a full-speed device behind it), the NYET response packet literally means "not yet". In the periodic transfer case, it either means that the hub has not yet started the transmission request, or it has no data in the receive buffer from the device that can fulfill the request. It is also the default response when you ask it for something out of turn: i.e. your timing is all messed up and you ask it for something that it didn't expect.

I can see the transaction in/out responses happening on the USB analyzer - on a packet-by-packet basis on both the high-speed bus and the low-speed bus simultaneously - which when coupled with precise timestamps provided by the FIQ allows me to determine the delta between something happening and something being reported as happened.

In this case the following happens:
1) Request sent to the hub to start a transfer on the full-speed port (start-split IN)
2) We wait for 1 microframe for the hub to do its thing
-- Here is where things can go wrong. Our definition of "wait" can be screwed up by the interrupt from the start-split transaction being delayed --
3) We ask the hub for the result of the transaction
-- We are too late. Hubs will drop inbound packets from the full-speed device if we don't ask for them in time. --
4) Hub responds NYET because it has no data in the receive buffer. All is lost, we must retry the transaction from the start.

One thing that tends to increase the stress level is multiple transfers in the same frame to the same device. USB DACs are notorious for specifying HID endpoints: e.g. for volume or mute/unmute buttons. I've seen cases where devices specify this endpoint but don't actually have any buttons (lol). What's worse is that many of these have bogus service intervals, usually 1 every frame (I bet you can't push the Vol+ button once per millisecond).

You could try unbinding the USBHID module from your DAC and see if that improves matters.
Rockets are loud.
https://astro-pi.org

Chris_Reynolds
Posts: 72
Joined: Mon May 14, 2012 7:25 am

Re: Call for beta testers: FIQ_FSM USB driver rewrite

Wed Mar 19, 2014 10:53 pm

jdb wrote:Update:

The BRANCH=next firmware now has a fix for one of the potential sources of the "FIQ reported NYET" messages seen when using a heavily loaded system. It may also fix cases where network devices suddenly stop responding.

Please test and report back any changes.
I wasn't seeing the NYET messages (I don't see anything that looks like a problem in dmesg) but tested the new firmware on the PM3 anyway and can report that it still just times out on all calls. Offers of logs etc still stand.
Thanks for all the work that is going into this.

jdb
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2070
Joined: Thu Jul 11, 2013 2:37 pm

Re: Call for beta testers: FIQ_FSM USB driver rewrite

Wed Mar 19, 2014 11:01 pm

Chris_Reynolds wrote: I wasn't seeing the NYET messages (I don't see anything that looks like a problem in dmesg) but tested the new firmware on the PM3 anyway and can report that it still just times out on all calls. Offers of logs etc still stand.
Thanks for all the work that is going into this.
Replicating your issue requires access to Eben's rowing machine (or at least the intelligent bit stuck to the top of it). I shall put the request in after filing the necessary forms.
Rockets are loud.
https://astro-pi.org

Chris_Reynolds
Posts: 72
Joined: Mon May 14, 2012 7:25 am

Re: Call for beta testers: FIQ_FSM USB driver rewrite

Thu Mar 20, 2014 10:52 am

That's fine, I appreciate the update. Once Eben realises that a Pi+7"touchscreen+PM3 will make the ideal rowing coach he'll let you have the gadget for as long as you need. He can then have the Pi detect when he's rowing hard and use GPIO to turn a fan on, as he nears the end of the row it can SMS Liz to get the beer out.

Cheers

Chris

GrayShade
Posts: 39
Joined: Fri Jul 05, 2013 6:13 am

Re: Call for beta testers: FIQ_FSM USB driver rewrite

Thu Mar 20, 2014 4:09 pm

jdb wrote:You could try unbinding the USBHID module from your DAC and see if that improves matters.
This seems to do it. I'm not getting any more NYET warnings (although I've not tried stressing it too much). It's using an interval of 10 ms, which is equal to my ALSA fragment size.

Code: Select all

    Interface Descriptor:
      bLength                 9
      bDescriptorType         4
      bInterfaceNumber        3
      bAlternateSetting       0
      bNumEndpoints           1
      bInterfaceClass         3 Human Interface Device
      bInterfaceSubClass      0 No Subclass
      bInterfaceProtocol      0 None
      iInterface              0
        HID Device Descriptor:
          bLength                 9
          bDescriptorType        33
          bcdHID               1.00
          bCountryCode            0 Not supported
          bNumDescriptors         1
          bDescriptorType        34 Report
          wDescriptorLength      31
         Report Descriptors:
           ** UNAVAILABLE **
      Endpoint Descriptor:
        bLength                 7
        bDescriptorType         5
        bEndpointAddress     0x85  EP 5 IN
        bmAttributes            3
          Transfer Type            Interrupt
          Synch Type               None
          Usage Type               Data
        wMaxPacketSize     0x0001  1x 1 bytes
        bInterval              10
However, doesn't this break setting the hardware volume?

jdb
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2070
Joined: Thu Jul 11, 2013 2:37 pm

Re: Call for beta testers: FIQ_FSM USB driver rewrite

Thu Mar 20, 2014 4:13 pm

Setting the volume via alsamixer or similar will still work. It uses a separate interface to set controls on the audio device.
Rockets are loud.
https://astro-pi.org

Return to “Troubleshooting”