From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thor Thayer Subject: SPI: dw-mmio: spidev with devicetree on 3.16. Date: Fri, 29 Aug 2014 11:27:46 -0500 Message-ID: <5400AA02.3070201@opensource.altera.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Cc: , To: Return-path: Sender: linux-spi-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: Hi, I'm having problems getting spidev to show up in /dev. I'm using the device tree on the 3.16 kernel using spi-dw-mmio. Without the of_node addition shown below, spidev doesn't show up in /sys/class or in the /dev directory. Unfortunately, adding this line causes a slowpath_null warning. The 2nd probe of spidev causes the warning [line 286 of drivers/base/dd.c] because the linked list is not empty (it was created in the initial spidev probe). master->max_speed_hz = dws->max_freq; (line 669 of spi-dw.c) + master->dev.of_node = dev->of_node; The spi0.0 device shows up under /sys/devices/fff00000.spi/spi_master/spi0/ whether the of_node is defined or undefined, so I believe the issue is with spidev. I have also tried compiling spidev as a module without the above of_node addition and then doing an insmod but it still doesn't show up under /dev. I noticed that Leroy Christophe mentioned a similar warning issue with this line but his Warning log is significantly different and a different driver. Any thoughts on how to debug this or what to look for? Thanks, Thor ~~~~~My device tree entry ~~~~~~~~~~~~~~~~~~~~~~~~ spi0: spi@fff00000 { compatible = "snps,dw-apb-ssi"; #address-cells = <1>; #size-cells = <0>; reg = <0xfff00000 0x1000>; interrupts = <0 154 4>; num-chipselect = <4>; bus-num = <0>; tx-dma-channel = <&pdma 16>; rx-dma-channel = <&pdma 17>; clocks = <&per_base_clk>; spidev@0 { compatible = "spidev"; reg = <0>; /* chip select */ spi-max-frequency = <100000000>; enable-dma = <1>; }; }; ~~~~~~~startup log ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Booting Linux on physical CPU 0x0 Initializing cgroup subsys cpuset Linux version 3.16.0-10474-g835c90b-dirty (tthayer@dinh-ubuntu) (gcc version 4.7.3 20121106 (prerelease) (crosstool-NG linaro-1.13.1-4.7-2012.11-20121123 - Linaro GCC 2012.11) ) #160 SMP Thu Aug 28 18:21:10 CDT 2014 CPU: ARMv7 Processor [413fc090] revision 0 (ARMv7), cr=10c5387d CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache Machine model: Altera SOCFPGA Cyclone V SoC Development Kit Truncating RAM at 0x00000000-0x40000000 to -0x2f800000 Memory policy: Data cache writealloc bus: 'spi': registered device class 'spi_master': registering bus: 'i2c': registered bus: 'spi': registered device class 'spi_master': registering PM: Adding info for platform:fffec600.timer bus: 'platform': add driver denali-nand-dt device class 'spidev': registering bus: 'spi': add driver spidev bus: 'platform': add driver dw_spi_mmio bus: 'platform': driver_probe_device: matched device fff00000.spi with driver dw_spi_mmio bus: 'platform': really_probe: probing driver dw_spi_mmio with device fff00000.spi device: 'spi0': device_add PM: Adding info for No Bus:spi0 dw_spi_mmio fff00000.spi: registered master spi0 spi spi0.0: setup mode 0, 8 bits/w, 100000000 Hz max --> 0 device: 'spi0.0': device_add bus: 'spi': add device spi0.0 PM: Adding info for spi:spi0.0 bus: 'spi': driver_probe_device: matched device spi0.0 with driver spidev bus: 'spi': really_probe: probing driver spidev with device spi0.0 ------------[ cut here ]------------ WARNING: CPU: 1 PID: 1 at drivers/base/dd.c:286 driver_probe_device+0x2b4/0x2f4() Modules linked in: CPU: 1 PID: 1 Comm: swapper/0 Not tainted 3.16.0-10474-g835c90b-dirty #160 [] (unwind_backtrace) from [] (show_stack+0x20/0x24) [] (show_stack) from [] (dump_stack+0x7c/0x98) [] (dump_stack) from [] (warn_slowpath_common+0x78/0x9c) [] (warn_slowpath_common) from [] (warn_slowpath_null+0x2c/0x34) [] (warn_slowpath_null) from [] (driver_probe_device+0x2b4/0x2f4) [] (driver_probe_device) from [] (__device_attach+0x50/0x54) [] (__device_attach) from [] (bus_for_each_drv+0x54/0x9c) [] (bus_for_each_drv) from [] (device_attach+0x84/0x90) [] (device_attach) from [] (bus_probe_device+0x94/0xb8) [] (bus_probe_device) from [] (device_add+0x434/0x4fc) [] (device_add) from [] (spi_add_device+0x98/0x164) [] (spi_add_device) from [] (spi_register_master+0x598/0x768) [] (spi_register_master) from [] (devm_spi_register_master+0x40/0x80) [] (devm_spi_register_master) from [] (dw_spi_add_host+0x1a8/0x258) [] (dw_spi_add_host) from [] (dw_spi_mmio_probe+0x1d4/0x294) [] (dw_spi_mmio_probe) from [] (platform_drv_probe+0x3c/0x6c) [] (platform_drv_probe) from [] (driver_probe_device+0xec/0x2f4) [] (driver_probe_device) from [] (__driver_attach+0x9c/0xa0) [] (__driver_attach) from [] (bus_for_each_dev+0x64/0x98) [] (bus_for_each_dev) from [] (driver_attach+0x2c/0x30) [] (driver_attach) from [] (bus_add_driver+0xdc/0x1f4) [] (bus_add_driver) from [] (driver_register+0x88/0x104) [] (driver_register) from [] (__platform_driver_register+0x58/0x6c) [] (__platform_driver_register) from [] (dw_spi_mmio_driver_init+0x18/0x20) [] (dw_spi_mmio_driver_init) from [] (do_one_initcall+0x90/0x1d4) [] (do_one_initcall) from [] (kernel_init_freeable+0x178/0x248) [] (kernel_init_freeable) from [] (kernel_init+0x18/0xfc) [] (kernel_init) from [] (ret_from_fork+0x14/0x20) ---[ end trace f9c390ec7153bfd3 ]--- device: 'spidev0.0': device_add PM: Adding info for No Bus:spidev0.0 driver: 'spidev': driver_bound: bound to device 'spi0.0' bus: 'spi': really_probe: bound device spi0.0 to driver spidev dw_spi_mmio fff00000.spi: registered child spi0.0 driver: 'dw_spi_mmio': driver_bound: bound to device 'fff00000.spi' bus: 'platform': really_probe: bound device fff00000.spi to driver dw_spi_mmio bus: 'mdio_bus': add driver Micrel KS8737 -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html