User avatar
DougieLawson
Posts: 37133
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Linux kernel is now 3.18

Thu Jan 29, 2015 10:50 am

It looks like 3.18 with the DT has broken SPI.
http://www.raspberrypi.org/forums/viewt ... 44&t=97978

I've got

Code: Select all

device_tree_param=i2c1=on
device_tree_param=spi=on
I've run rpi-update this morning so it's the latest 3.18.4+ kernel (and I'm not using my own dtb on this Raspberry Pi).

The SPI driver loads OK

Code: Select all

[    6.511676] bcm2708_spi 20204000.spi: master is unqueued, this is deprecated
[    6.689637] bcm2708_spi 20204000.spi: SPI Controller at 0x20204000 (irq 80)

Code: Select all

[email protected] ~ # ls -la /dev/spi*
crw-rw---T 1 root spi 153, 0 Jan  1  1970 /dev/spidev0.0
crw-rw---T 1 root spi 153, 1 Jan  1  1970 /dev/spidev0.1
[email protected] ~ #
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2589
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Linux kernel is now 3.18

Thu Jan 29, 2015 11:06 am

What happens with device tree disabled?

User avatar
DougieLawson
Posts: 37133
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Linux kernel is now 3.18

Thu Jan 29, 2015 12:38 pm

PhilE wrote:What happens with device tree disabled?
Same result.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2589
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Linux kernel is now 3.18

Thu Jan 29, 2015 1:07 pm

Thanks - that's what I expected, but it's good to have it confirmed.

I'm not aware of anything having changed in this area, so it's time to go digging (time permitting). If you are at a loose end I would suggest looking at the ioctl interface in the driver to see where it returns -EINVAL. It does sound like an API issue - EINVAL is supposed to mean "invalid parameters" rather than "something went wrong".

notro
Posts: 695
Joined: Tue Oct 16, 2012 6:21 pm
Location: Drammen, Norway

Re: Linux kernel is now 3.18

Thu Jan 29, 2015 5:19 pm

I just tried a SPI loopback test on a custom 3.18 DT kernel with the SPI DMA driver:

Code: Select all

$ ./spitest/spidev_test -D /dev/spidev0.0
spi mode: 0
bits per word: 8
max speed: 500000 Hz (500 KHz)

FF FF FF FF FF FF
40 00 00 00 00 95
FF FF FF FF FF FF
FF FF FF FF FF FF
FF FF FF FF FF FF
DE AD BE EF BA AD
F0 0D

$ dmesg
[    1.563386] bcm2708_spi 20204000.spi: DMA channel 2 at address 0xf2007200 with irq 77
[    1.574711] bcm2708_spi 20204000.spi: DMA channel 4 at address 0xf2007400 with irq 20
[    1.589005] bcm2708_spi 20204000.spi: SPI Controller at 0x20204000 (irq 80)
[    1.597961] bcm2708_spi 20204000.spi: SPI Controller running in dma mode

I don't have time to test the vanilla kernel, but in principle it should be the same. None of the SPI master drivers have changed lately.

More info: http://www.raspberrypi.org/documentatio ... leshooting
Source: https://raw.githubusercontent.com/raspb ... dev_test.c

oklitz
Posts: 13
Joined: Sun Jul 07, 2013 10:26 am

Re: Linux kernel is now 3.18

Thu Jan 29, 2015 9:07 pm

Hello !

It is nothing broken with SPI in the kernel !
I have found the error.

I had forgotten to zero the struct spi_ioc_transfer before filling it with data.
spidev.h said that there are padding bytes (for future use) at the end of the structure wich is given to the kernel.
I think they put 2 uint8_t var at the end to the struct in the last time.

What happens i suggest is that the spi driver in the kernel checked for these two new variables.
So when you didn't clear the struct it reads random stuff, complaining it with EINVAL to the user.
The two variables seems to be new, so in past the spi driver didn't check these garbage bytes and all was fine.

The wiringPi library was updated by gordon, so the wiringPiSPIDataRW function makes a memset(&spi,0,sizeof(spi))
to guarantee there are zeros in the unused fields.

Thanx for all !


regards Marco Oklitz

User avatar
DougieLawson
Posts: 37133
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Linux kernel is now 3.18

Thu Jan 29, 2015 9:14 pm

Thanks Marco. I'll look for the same bug in the pifacecad library I'm using.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

User avatar
expandables
Posts: 654
Joined: Fri Jun 27, 2014 7:34 pm
Location: Neverland with Michael Jackson

Re: Linux kernel is now 3.18

Thu Jan 29, 2015 9:36 pm

New firmware sucks brakes omxplayer (video splashscreen at boot) in /etc/init.d/
Instead of asplashscreen i now have to use "nsplashscreen"
By thinking like an engineer you can create a raspberry pi.
Michael Jackson enthusiast.
I got the PI model B, B+ and PI 2 model B.
When will I get the A? I don't know.

User avatar
DougieLawson
Posts: 37133
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Linux kernel is now 3.18

Thu Jan 29, 2015 11:34 pm

I've written a patch for piface/libmcp23s17.c

Code: Select all

--- /shared/Raspi/libmcp23s17~/src/mcp23s17.c   2015-01-29 23:23:28.967496000 +0000
+++ mcp23s17.c  2015-01-29 22:33:48.777496000 +0000
@@ -72,6 +72,7 @@
     uint8_t rx_buf[sizeof tx_buf];

     struct spi_ioc_transfer spi;
+    memset (&spi, 0, sizeof(spi));
     spi.tx_buf = (unsigned long) tx_buf;
     spi.rx_buf = (unsigned long) rx_buf;
     spi.len = sizeof tx_buf;
@@ -98,6 +99,7 @@
     uint8_t rx_buf[sizeof tx_buf];

     struct spi_ioc_transfer spi;
+    memset (&spi, 0, sizeof(spi));
     spi.tx_buf = (unsigned long) tx_buf;
     spi.rx_buf = (unsigned long) rx_buf;
     spi.len = sizeof tx_buf;
and now my SPI device is working OK. Thanks Phil & Marco it was fun doing that.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

hugo_figueiredo
Posts: 13
Joined: Tue Jan 27, 2015 12:46 pm

Re: Linux kernel is now 3.18

Fri Jan 30, 2015 2:30 pm

I have a raspbian installed in HDD, and after update the firmware the raspberry randomly stops reading from hard drive and i have to reboot.

This problem are something to do with this update?

User avatar
expandables
Posts: 654
Joined: Fri Jun 27, 2014 7:34 pm
Location: Neverland with Michael Jackson

Re: Linux kernel is now 3.18

Fri Jan 30, 2015 3:54 pm

hugo_figueiredo wrote:I have a raspbian installed in HDD, and after update the firmware the raspberry randomly stops reading from hard drive and i have to reboot.

This problem are something to do with this update?
New firmware sucks i hope you back up before you upgraded. :lol:
By thinking like an engineer you can create a raspberry pi.
Michael Jackson enthusiast.
I got the PI model B, B+ and PI 2 model B.
When will I get the A? I don't know.

hugo_figueiredo
Posts: 13
Joined: Tue Jan 27, 2015 12:46 pm

Re: Linux kernel is now 3.18

Fri Jan 30, 2015 3:59 pm

expandables wrote:
hugo_figueiredo wrote:I have a raspbian installed in HDD, and after update the firmware the raspberry randomly stops reading from hard drive and i have to reboot.

This problem are something to do with this update?
New firmware sucks i hope you back up before you upgraded. :lol:
I didnt have nothing to special. But what i want to know, its how i can fix this? xD

PhilE
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 2589
Joined: Mon Sep 29, 2014 1:07 pm
Location: Cambridge

Re: Linux kernel is now 3.18

Fri Jan 30, 2015 4:00 pm

We're trying to locate the source of the problem, which is difficult when we've not seen it ourselves.

CapnBry
Posts: 28
Joined: Sun Jan 08, 2012 2:04 pm
Contact: Website

Re: Linux kernel is now 3.18

Wed Feb 04, 2015 3:32 am

I'm having issues with the 3.18 kernel on a B+ with an FTDI FT231X USB UART device. It simply stops receiving data after anywhere from 5 seconds to at most 60 seconds.

Code: Select all

$ stty -F /dev/ttyUSB0 38400 raw
$ cat /dev/ttyUSB0
..data for a few seconds...
If I hit Ctrl-C and then restart it, it works for a few more seconds then stops again. Each time there is a corresponding error-level event in the dmesg

Code: Select all

[  639.572322] ftdi_sio ttyUSB0: usb_serial_generic_read_bulk_callback - urb stopped: -32
[  677.097788] ftdi_sio ttyUSB0: usb_serial_generic_read_bulk_callback - urb stopped: -32
[  755.444690] ftdi_sio ttyUSB0: usb_serial_generic_read_bulk_callback - urb stopped: -32
[  760.558126] ftdi_sio ttyUSB0: usb_serial_generic_read_bulk_callback - urb stopped: -32
[ 1179.992243] ftdi_sio ttyUSB0: usb_serial_generic_read_bulk_callback - urb stopped: -32
[ 1181.666728] ftdi_sio ttyUSB0: usb_serial_generic_read_bulk_callback - urb stopped: -32
There is one message (EPIPE?) for each time it fails.

Code: Select all

$ lsusb
Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.
Bus 001 Device 004: ID 0403:6015 Future Technology Devices International, Ltd Bridge(I2C/SPI/UART/FIFO)
Bus 001 Device 005: ID 7392:7811 Edimax Technology Co., Ltd EW-7811Un 802.11n Wireless Adapter [Realtek RTL8188CUS]
Rolling back to the last 3.12 kernel works fine for at least 30 minutes (all I've tested). I can provide access to the device if it will help, it fails rather quickly every time. This of course could be just terrible FTDI driver updates that happened to come along with the 3.18 kernel upgrade.

EDIT: Tested with and without device tree enabled and also with dwc_otg.fiq_fsm_enable=0

Claggy
Posts: 16
Joined: Sun Jan 26, 2014 3:15 pm

Re: Linux kernel is now 3.18

Wed Feb 04, 2015 8:03 pm

The setiathome kernel problem introduced with kernel 3.12.x is still occuring on 3.18.5+,
this is still my self compiled app from the Seti_boinc source @r1924,
presently running the repository Boinc 7.0.27 on Raspbian Wheezy on a Model B Pi:
http://setiathome.berkeley.edu/show_hos ... id=7470252
at least on 3.18.x and later 3.12.x it no longer crashes the OS,
I've been suspending the app so it exits from memory, then resuming it after every stall,
I've also supplied the app to MarkJ, he's also had at least app stall,
he's running raspbian jessie, Boinc 7.4.23 from the repository, and kernel 3.12.35+:
http://setiathome.berkeley.edu/show_hos ... id=7482767

my last log:

Message from [email protected] at Feb 4 18:00:15 ...
kernel:[127730.482236] Internal error: Oops - undefined instruction: 0 [#5] PREEMPT ARM

Message from [email protected] at Feb 4 18:00:15 ...
kernel:[127730.573211] Process setiathome-7.0. (pid: 3593, stack limit = 0xda0a01b0)

Message from [email protected] at Feb 4 18:00:15 ...
kernel:[127730.580076] Stack: (0xda0a1e70 to 0xda0a2000)

Message from [email protected] at Feb 4 18:00:15 ...
kernel:[127730.584520] 1e60: bea00550 da0a0000 da0a1ea4 da0a1e88

Message from [email protected] at Feb 4 18:00:15 ...
kernel:[127730.592780] 1e80: c0009ad4 c0009840 00000120 00000000 bea00460 00000000 da0a1ebc da0a1ea8

Message from [email protected] at Feb 4 18:00:15 ...
kernel:[127730.601042] 1ea0: c0011874 c0009ab0 da0a1fb0 bea00460 da0a1f84 da0a1ec0 c0011cb8 c00116e0

Message from [email protected] at Feb 4 18:00:15 ...
kernel:[127730.609302] 1ec0: 000953f0 14000000 0023c060 00000000 00000000 0000000e 00000000 00000080

Message from [email protected] at Feb 4 18:00:15 ...
kernel:[127730.617561] 1ee0: 00000000 00000000 00000000 00000000 00000000 da0a1f00 c005f690 c0061a90

Message from [email protected] at Feb 4 18:00:15 ...
kernel:[127730.625821] 1f00: 0000ffff 42371200 c0026630 c0811200 0000000e c0811200 da0a0000 c080aac0

Message from [email protected] at Feb 4 18:00:15 ...
kernel:[127730.634082] 1f20: c0823388 60000193 00000000 00000000 da0a1f5c da0a1f40 c00694cc c00c3f34

Message from [email protected] at Feb 4 18:00:15 ...
kernel:[127730.642342] 1f40: c08104c0 da0a0000 c0837108 00000000 da0a1f74 0000000e c0026b00 da0a0008

Message from [email protected] at Feb 4 18:00:15 ...
kernel:[127730.650603] 1f60: da0a0000 00000000 da0a1fb0 00000000 da0a0000 bea007f8 da0a1fac da0a1f88

Message from [email protected] at Feb 4 18:00:15 ...
kernel:[127730.658866] 1f80: c0011fcc c0011a04 00c5387d 00000001 00019f24 20000010 f200b200 00c5387d

Message from [email protected] at Feb 4 18:00:15 ...
kernel:[127730.667127] 1fa0: 00000000 da0a1fb0 c000e918 c0011f18 00000001 00000040 0000003f 0188b7f8

Message from [email protected] at Feb 4 18:00:15 ...
kernel:[127730.675388] 1fc0: 00000040 00312d48 018fb758 00000004 0188b730 00000037 bea007f8 bea00864

Message from [email protected] at Feb 4 18:00:15 ...
kernel:[127730.683648] 1fe0: 0030cd20 bea00750 00019ed8 00019f24 20000010 ffffffff 00022236 014751e5

Message from [email protected] at Feb 4 18:00:15 ...
kernel:[127730.734397] Code: e12fff1e e1a0200d e1a0e009 eafffe76 (eca00b20)

Claggy

lahcejopa
Posts: 4
Joined: Mon Feb 09, 2015 7:39 am

Re: Linux kernel is now 3.18

Mon Feb 09, 2015 7:44 am

Hi,

3.18 kernel with no ipt_ULOG module available breaks ulogd.
ulogd2 which is capable of using xt_NFLOG instead is not available within Raspbian Wheezy.

Regards,
Lahc

messypotamia
Posts: 72
Joined: Tue Jan 27, 2015 12:12 am

Re: Linux kernel is now 3.18

Tue Feb 10, 2015 3:11 pm

3.18 has something broken which prevents cifs from working as expected.
On this Pi:
Linux raspberrypi 3.12.35+ #730 PREEMPT Fri Dec 19 18:31:24 GMT 2014 armv6l GNU/Linux
mount -t cifs //router1/USB_Storage /mnt/bkup -o guest
works like a charm.
On this Pi:
Linux raspberrypi2 3.18.6+ #753 PREEMPT Sun Feb 8 14:47:22 GMT 2015 armv6l GNU/Linux
the same command fails for authentication.
I compared the samba and cifs, and both outputs were the same.
I tried the "sec=ntlm" option on Pi#2 and the command didn't like it, makes no difference.
Several posts about not being able to mount shares with new kernel.
--
I found a 2014 wheezy (3.12.x), loaded it on a new sd card, booted, tested
"sudo mount -t cifs //192.168.2.1/USB_Storage /mnt/cifs -o guest" and it worked as I expected.
Then I did a complete apt-get update/install, rebooted, and it is now broke again:
Linux raspberrypi-2 3.18.5+ #744 PREEMPT Fri Jan 30 18:19:07 GMT 2015 armv6l

Please, I need "sudo mount -t cifs //someopenserver/usbstorage /mnt/bkup -o guest" to start working again.
Thank you.
mp

TommyJ
Posts: 1
Joined: Wed May 20, 2015 5:58 pm

Re: Linux kernel is now 3.18

Wed May 20, 2015 6:06 pm

For messypotamia and cifs not working: Run rpi-update, i.e. apt-get install rpi-update and then rpi-update as root. It solved similar problem for me.

dom
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5398
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge

Re: Linux kernel is now 3.18

Sun Jun 21, 2015 3:27 pm

Linux kernel is now 4.0
viewtopic.php?f=29&t=113753

Return to “Advanced users”