linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* 6.8 SPI Chip Select Regression
@ 2024-04-02 21:32 Colin Foster
  2024-04-02 23:52 ` Mark Brown
  0 siblings, 1 reply; 5+ messages in thread
From: Colin Foster @ 2024-04-02 21:32 UTC (permalink / raw)
  To: Amit Kumar Mahapatra, linux-spi, linux-kernel; +Cc: Mark Brown

Hi Amit,

I finally got around to testing 6.9-rc2. I must've missed testing
6.8, however, because it seems there are issues - at least in my device
tree - with commit: 4d8ff6b0991d "spi: Add multi-cs memories support in SPI core"

I'm running on a BeagleBone Black, and have a single MFD attached to CS
0. At boot, I see the following:

[    3.459990] omap2_mcspi 48030000.spi: chipselect 0 already in use
[    3.466135] spi_master spi0: spi_device register error /ocp/interconnect@48000000/segment@0/target-module@30000/spi@0/soc@0
[    3.477495] spi_master spi0: Failed to create SPI device for /ocp/interconnect@48000000/segment@0/target-module@30000/spi@0/soc@0

Is this a known issue? Is there anything I either might need to do to a
device tree, or something you might suggest to help troubleshoot this?

Hardware name: Generic AM33XX (Flattened Device Tree)
Workqueue: events_unbound deferred_probe_work_func
Backtrace:
 dump_backtrace from show_stack+0x20/0x24
 show_stack from dump_stack_lvl+0x60/0x78
 dump_stack_lvl from dump_stack+0x18/0x1c
 dump_stack from __spi_add_device+0x190/0x224
 __spi_add_device from spi_add_device+0x50/0x64
 spi_add_device from of_register_spi_device+0x3d4/0x594
 of_register_spi_device from spi_register_controller+0x3b0/0x6b8
 spi_register_controller from devm_spi_register_controller+0x54/0x94
 devm_spi_register_controller from omap2_mcspi_probe+0x4c4/0x584
 omap2_mcspi_probe from platform_probe+0x6c/0xcc
 platform_probe from really_probe+0xd8/0x2e8


 Thank you.

 Colin Foster

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: 6.8 SPI Chip Select Regression
  2024-04-02 21:32 6.8 SPI Chip Select Regression Colin Foster
@ 2024-04-02 23:52 ` Mark Brown
  2024-04-03  2:14   ` Colin Foster
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Brown @ 2024-04-02 23:52 UTC (permalink / raw)
  To: Colin Foster; +Cc: Amit Kumar Mahapatra, linux-spi, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1472 bytes --]

On Tue, Apr 02, 2024 at 04:32:50PM -0500, Colin Foster wrote:
> Hi Amit,

Amit, please respond to these issues - you never replied to the mails
about the other regressions this introduced either...

> [    3.459990] omap2_mcspi 48030000.spi: chipselect 0 already in use
> [    3.466135] spi_master spi0: spi_device register error /ocp/interconnect@48000000/segment@0/target-module@30000/spi@0/soc@0
> [    3.477495] spi_master spi0: Failed to create SPI device for /ocp/interconnect@48000000/segment@0/target-module@30000/spi@0/soc@0

> Is this a known issue? Is there anything I either might need to do to a
> device tree, or something you might suggest to help troubleshoot this?

This is not known, and given that you say there's only one chip select
in use on the system seems clearly bogus.  There were some regressions
with trying to use more than the hard coded maximum number of chip
selects but they have a different error pattern.  It's late so I'll not
look properly right now but...

Do you know what chip select 0 is - if you add a WARN_ON() to
spi_set_chipselect() it should show a prior call to the function, or is
it some logic bug that somehow is not manifesting on other systems that
use chip select 0?  Though looking quickly there has been some factoring
out since that commit was merged...  just to confirm, did you bisect to
find the problematic commit?  If you could show the DT for your setup
that'd help, especially if this is a GPIO chip select.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: 6.8 SPI Chip Select Regression
  2024-04-02 23:52 ` Mark Brown
@ 2024-04-03  2:14   ` Colin Foster
  2024-04-03 21:24     ` Andy Shevchenko
  0 siblings, 1 reply; 5+ messages in thread
From: Colin Foster @ 2024-04-03  2:14 UTC (permalink / raw)
  To: Mark Brown; +Cc: Amit Kumar Mahapatra, linux-spi, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 16646 bytes --]

Hi Mark,

Thanks for the quick response.

On Wed, Apr 03, 2024 at 12:52:44AM +0100, Mark Brown wrote:
> On Tue, Apr 02, 2024 at 04:32:50PM -0500, Colin Foster wrote:
> > Hi Amit,
> 
> Amit, please respond to these issues - you never replied to the mails
> about the other regressions this introduced either...
> 
> > [    3.459990] omap2_mcspi 48030000.spi: chipselect 0 already in use
> > [    3.466135] spi_master spi0: spi_device register error /ocp/interconnect@48000000/segment@0/target-module@30000/spi@0/soc@0
> > [    3.477495] spi_master spi0: Failed to create SPI device for /ocp/interconnect@48000000/segment@0/target-module@30000/spi@0/soc@0
> 
> > Is this a known issue? Is there anything I either might need to do to a
> > device tree, or something you might suggest to help troubleshoot this?
> 
> This is not known, and given that you say there's only one chip select
> in use on the system seems clearly bogus.  There were some regressions
> with trying to use more than the hard coded maximum number of chip
> selects but they have a different error pattern.  It's late so I'll not
> look properly right now but...
> 
> Do you know what chip select 0 is - if you add a WARN_ON() to
> spi_set_chipselect() it should show a prior call to the function,

Log is below. There aren't any other SPI devices, so I'm not really sure
what is the issue just yet. It is also using the built-in chip select,
not a GPIO.

> or is
> it some logic bug that somehow is not manifesting on other systems that
> use chip select 0?  Though looking quickly there has been some factoring
> out since that commit was merged...  just to confirm, did you bisect to
> find the problematic commit? 

I bisected, and just confirmed again that the previous commit,
f05e2f61fe88: ("ALSA: hda/cs35l56: Use set/get APIs to access spi->chip_select")
does boot as expected.

I noticed the issue on 6.9-rc2, then jumped back to 6.8, then 6.7.
Bisected between 6.7 and 6.8.

> If you could show the DT for your setup
> that'd help, especially if this is a GPIO chip select.

It should be attached. It is really nothing more than the beaglebone
black with this SPI addition. The only things out-of-tree are some VLAN
and MTU tweaks I had to make for my DSA networking setup to work.




The boot log with WARN_ON(true) at spi_set_chipselect, as well as
dump_stack() before both "chipselect %d already in use" messages.


Linux version 6.7.0-rc1-00003-g4d8ff6b0991d-dirty (colin@euler) (arm-unknown-linux-gnueabi-gcc (crosstool-NG 1.25.0) 11.2.0, GNU ld (crosstool-NG 1.25.0) 2.38) #1375 SMP PREEMPT Tue Apr  2 20:36:28 CDT 2024

8<

at24 0-0050: using lookup tables for GPIO lookup
at24 0-0050: No GPIO consumer wp found
at24 0-0050: 32768 byte 24c256 EEPROM, writable, 1 bytes/write
omap_i2c 44e0b000.i2c: bus 0 rev0.11 at 400 kHz
------------[ cut here ]------------
WARNING: CPU: 0 PID: 25 at include/linux/spi/spi.h:299 of_register_spi_device+0x218/0x5f0
Modules linked in:
CPU: 0 PID: 25 Comm: kworker/u2:2 Not tainted 6.7.0-rc1-00003-g4d8ff6b0991d-dirty #1375
Hardware name: Generic AM33XX (Flattened Device Tree)
Workqueue: events_unbound deferred_probe_work_func
Backtrace: 
 dump_backtrace from show_stack+0x20/0x24
 show_stack from dump_stack_lvl+0x60/0x78
 dump_stack_lvl from dump_stack+0x18/0x1c
 dump_stack from __warn+0x88/0x160
 __warn from warn_slowpath_fmt+0x168/0x1f4
 warn_slowpath_fmt from of_register_spi_device+0x218/0x5f0
 of_register_spi_device from spi_register_controller+0x3b0/0x6b8
 spi_register_controller from devm_spi_register_controller+0x54/0x94
 devm_spi_register_controller from omap2_mcspi_probe+0x4c4/0x584
 omap2_mcspi_probe from platform_probe+0x6c/0xcc
 platform_probe from really_probe+0xd8/0x2e8
 really_probe from __driver_probe_device+0x98/0x1b0
 __driver_probe_device from driver_probe_device+0x40/0x114
 driver_probe_device from __device_attach_driver+0xa4/0x10c
 __device_attach_driver from bus_for_each_drv+0x94/0xec
 bus_for_each_drv from __device_attach+0xbc/0x1e0
 __device_attach from device_initial_probe+0x1c/0x20
 device_initial_probe from bus_probe_device+0x98/0x9c
 bus_probe_device from deferred_probe_work_func+0x88/0xb4
 deferred_probe_work_func from process_one_work+0x170/0x43c
 process_one_work from worker_thread+0x2c4/0x4ec
 worker_thread from kthread+0x114/0x148
 kthread from ret_from_fork+0x14/0x28
Exception stack(0xe006dfb0 to 0xe006dff8)
dfa0:                                     00000000 00000000 00000000 00000000
dfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
dfe0: 00000000 00000000 00000000 00000000 00000013 00000000
 r9:00000000 r8:00000000 r7:00000000 r6:00000000 r5:c037c070 r4:c21d6140
---[ end trace 0000000000000000 ]---
------------[ cut here ]------------
WARNING: CPU: 0 PID: 25 at include/linux/spi/spi.h:299 of_register_spi_device+0x218/0x5f0
Modules linked in:
CPU: 0 PID: 25 Comm: kworker/u2:2 Tainted: G        W          6.7.0-rc1-00003-g4d8ff6b0991d-dirty #1375
Hardware name: Generic AM33XX (Flattened Device Tree)
Workqueue: events_unbound deferred_probe_work_func
Backtrace: 
 dump_backtrace from show_stack+0x20/0x24
 show_stack from dump_stack_lvl+0x60/0x78
 dump_stack_lvl from dump_stack+0x18/0x1c
 dump_stack from __warn+0x88/0x160
 __warn from warn_slowpath_fmt+0x168/0x1f4
 warn_slowpath_fmt from of_register_spi_device+0x218/0x5f0
 of_register_spi_device from spi_register_controller+0x3b0/0x6b8
 spi_register_controller from devm_spi_register_controller+0x54/0x94
 devm_spi_register_controller from omap2_mcspi_probe+0x4c4/0x584
 omap2_mcspi_probe from platform_probe+0x6c/0xcc
 platform_probe from really_probe+0xd8/0x2e8
 really_probe from __driver_probe_device+0x98/0x1b0
 __driver_probe_device from driver_probe_device+0x40/0x114
 driver_probe_device from __device_attach_driver+0xa4/0x10c
 __device_attach_driver from bus_for_each_drv+0x94/0xec
 bus_for_each_drv from __device_attach+0xbc/0x1e0
 __device_attach from device_initial_probe+0x1c/0x20
 device_initial_probe from bus_probe_device+0x98/0x9c
 bus_probe_device from deferred_probe_work_func+0x88/0xb4
 deferred_probe_work_func from process_one_work+0x170/0x43c
 process_one_work from worker_thread+0x2c4/0x4ec
 worker_thread from kthread+0x114/0x148
 kthread from ret_from_fork+0x14/0x28
Exception stack(0xe006dfb0 to 0xe006dff8)
dfa0:                                     00000000 00000000 00000000 00000000
dfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
dfe0: 00000000 00000000 00000000 00000000 00000013 00000000
 r9:00000000 r8:00000000 r7:00000000 r6:00000000 r5:c037c070 r4:c21d6140
---[ end trace 0000000000000000 ]---
------------[ cut here ]------------
WARNING: CPU: 0 PID: 25 at include/linux/spi/spi.h:299 of_register_spi_device+0x218/0x5f0
Modules linked in:
CPU: 0 PID: 25 Comm: kworker/u2:2 Tainted: G        W          6.7.0-rc1-00003-g4d8ff6b0991d-dirty #1375
Hardware name: Generic AM33XX (Flattened Device Tree)
Workqueue: events_unbound deferred_probe_work_func
Backtrace: 
 dump_backtrace from show_stack+0x20/0x24
 show_stack from dump_stack_lvl+0x60/0x78
 dump_stack_lvl from dump_stack+0x18/0x1c
 dump_stack from __warn+0x88/0x160
 __warn from warn_slowpath_fmt+0x168/0x1f4
 warn_slowpath_fmt from of_register_spi_device+0x218/0x5f0
 of_register_spi_device from spi_register_controller+0x3b0/0x6b8
 spi_register_controller from devm_spi_register_controller+0x54/0x94
 devm_spi_register_controller from omap2_mcspi_probe+0x4c4/0x584
 omap2_mcspi_probe from platform_probe+0x6c/0xcc
 platform_probe from really_probe+0xd8/0x2e8
 really_probe from __driver_probe_device+0x98/0x1b0
 __driver_probe_device from driver_probe_device+0x40/0x114
 driver_probe_device from __device_attach_driver+0xa4/0x10c
 __device_attach_driver from bus_for_each_drv+0x94/0xec
 bus_for_each_drv from __device_attach+0xbc/0x1e0
 __device_attach from device_initial_probe+0x1c/0x20
 device_initial_probe from bus_probe_device+0x98/0x9c
 bus_probe_device from deferred_probe_work_func+0x88/0xb4
 deferred_probe_work_func from process_one_work+0x170/0x43c
 process_one_work from worker_thread+0x2c4/0x4ec
 worker_thread from kthread+0x114/0x148
 kthread from ret_from_fork+0x14/0x28
Exception stack(0xe006dfb0 to 0xe006dff8)
dfa0:                                     00000000 00000000 00000000 00000000
dfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
dfe0: 00000000 00000000 00000000 00000000 00000013 00000000
 r9:00000000 r8:00000000 r7:00000000 r6:00000000 r5:c037c070 r4:c21d6140
---[ end trace 0000000000000000 ]---
------------[ cut here ]------------
WARNING: CPU: 0 PID: 25 at include/linux/spi/spi.h:299 of_register_spi_device+0x218/0x5f0
Modules linked in:
CPU: 0 PID: 25 Comm: kworker/u2:2 Tainted: G        W          6.7.0-rc1-00003-g4d8ff6b0991d-dirty #1375
Hardware name: Generic AM33XX (Flattened Device Tree)
Workqueue: events_unbound deferred_probe_work_func
Backtrace: 
 dump_backtrace from show_stack+0x20/0x24
 show_stack from dump_stack_lvl+0x60/0x78
 dump_stack_lvl from dump_stack+0x18/0x1c
 dump_stack from __warn+0x88/0x160
 __warn from warn_slowpath_fmt+0x168/0x1f4
 warn_slowpath_fmt from of_register_spi_device+0x218/0x5f0
 of_register_spi_device from spi_register_controller+0x3b0/0x6b8
 spi_register_controller from devm_spi_register_controller+0x54/0x94
 devm_spi_register_controller from omap2_mcspi_probe+0x4c4/0x584
 omap2_mcspi_probe from platform_probe+0x6c/0xcc
 platform_probe from really_probe+0xd8/0x2e8
 really_probe from __driver_probe_device+0x98/0x1b0
 __driver_probe_device from driver_probe_device+0x40/0x114
 driver_probe_device from __device_attach_driver+0xa4/0x10c
 __device_attach_driver from bus_for_each_drv+0x94/0xec
 bus_for_each_drv from __device_attach+0xbc/0x1e0
 __device_attach from device_initial_probe+0x1c/0x20
 device_initial_probe from bus_probe_device+0x98/0x9c
 bus_probe_device from deferred_probe_work_func+0x88/0xb4
 deferred_probe_work_func from process_one_work+0x170/0x43c
 process_one_work from worker_thread+0x2c4/0x4ec
 worker_thread from kthread+0x114/0x148
 kthread from ret_from_fork+0x14/0x28
Exception stack(0xe006dfb0 to 0xe006dff8)
dfa0:                                     00000000 00000000 00000000 00000000
dfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
dfe0: 00000000 00000000 00000000 00000000 00000013 00000000
 r9:00000000 r8:00000000 r7:00000000 r6:00000000 r5:c037c070 r4:c21d6140
---[ end trace 0000000000000000 ]---
------------[ cut here ]------------
WARNING: CPU: 0 PID: 25 at include/linux/spi/spi.h:299 of_register_spi_device+0x2c0/0x5f0
Modules linked in:
CPU: 0 PID: 25 Comm: kworker/u2:2 Tainted: G        W          6.7.0-rc1-00003-g4d8ff6b0991d-dirty #1375
Hardware name: Generic AM33XX (Flattened Device Tree)
Workqueue: events_unbound deferred_probe_work_func
Backtrace: 
 dump_backtrace from show_stack+0x20/0x24
 show_stack from dump_stack_lvl+0x60/0x78
 dump_stack_lvl from dump_stack+0x18/0x1c
 dump_stack from __warn+0x88/0x160
 __warn from warn_slowpath_fmt+0x168/0x1f4
 warn_slowpath_fmt from of_register_spi_device+0x2c0/0x5f0
 of_register_spi_device from spi_register_controller+0x3b0/0x6b8
 spi_register_controller from devm_spi_register_controller+0x54/0x94
 devm_spi_register_controller from omap2_mcspi_probe+0x4c4/0x584
 omap2_mcspi_probe from platform_probe+0x6c/0xcc
 platform_probe from really_probe+0xd8/0x2e8
 really_probe from __driver_probe_device+0x98/0x1b0
 __driver_probe_device from driver_probe_device+0x40/0x114
 driver_probe_device from __device_attach_driver+0xa4/0x10c
 __device_attach_driver from bus_for_each_drv+0x94/0xec
 bus_for_each_drv from __device_attach+0xbc/0x1e0
 __device_attach from device_initial_probe+0x1c/0x20
 device_initial_probe from bus_probe_device+0x98/0x9c
 bus_probe_device from deferred_probe_work_func+0x88/0xb4
 deferred_probe_work_func from process_one_work+0x170/0x43c
 process_one_work from worker_thread+0x2c4/0x4ec
 worker_thread from kthread+0x114/0x148
 kthread from ret_from_fork+0x14/0x28
Exception stack(0xe006dfb0 to 0xe006dff8)
dfa0:                                     00000000 00000000 00000000 00000000
dfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
dfe0: 00000000 00000000 00000000 00000000 00000013 00000000
 r9:00000000 r8:00000000 r7:00000000 r6:00000000 r5:c037c070 r4:c21d6140
---[ end trace 0000000000000000 ]---
------------[ cut here ]------------
WARNING: CPU: 0 PID: 25 at include/linux/spi/spi.h:299 of_register_spi_device+0x2c0/0x5f0
Modules linked in:
CPU: 0 PID: 25 Comm: kworker/u2:2 Tainted: G        W          6.7.0-rc1-00003-g4d8ff6b0991d-dirty #1375
Hardware name: Generic AM33XX (Flattened Device Tree)
Workqueue: events_unbound deferred_probe_work_func
Backtrace: 
 dump_backtrace from show_stack+0x20/0x24
 show_stack from dump_stack_lvl+0x60/0x78
 dump_stack_lvl from dump_stack+0x18/0x1c
 dump_stack from __warn+0x88/0x160
 __warn from warn_slowpath_fmt+0x168/0x1f4
 warn_slowpath_fmt from of_register_spi_device+0x2c0/0x5f0
 of_register_spi_device from spi_register_controller+0x3b0/0x6b8
 spi_register_controller from devm_spi_register_controller+0x54/0x94
 devm_spi_register_controller from omap2_mcspi_probe+0x4c4/0x584
 omap2_mcspi_probe from platform_probe+0x6c/0xcc
 platform_probe from really_probe+0xd8/0x2e8
 really_probe from __driver_probe_device+0x98/0x1b0
 __driver_probe_device from driver_probe_device+0x40/0x114
 driver_probe_device from __device_attach_driver+0xa4/0x10c
 __device_attach_driver from bus_for_each_drv+0x94/0xec
 bus_for_each_drv from __device_attach+0xbc/0x1e0
 __device_attach from device_initial_probe+0x1c/0x20
 device_initial_probe from bus_probe_device+0x98/0x9c
 bus_probe_device from deferred_probe_work_func+0x88/0xb4
 deferred_probe_work_func from process_one_work+0x170/0x43c
 process_one_work from worker_thread+0x2c4/0x4ec
 worker_thread from kthread+0x114/0x148
 kthread from ret_from_fork+0x14/0x28
Exception stack(0xe006dfb0 to 0xe006dff8)
dfa0:                                     00000000 00000000 00000000 00000000
dfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
dfe0: 00000000 00000000 00000000 00000000 00000013 00000000
 r9:00000000 r8:00000000 r7:00000000 r6:00000000 r5:c037c070 r4:c21d6140
---[ end trace 0000000000000000 ]---
idx = 0, nw_idx = 1, cs = 0
CPU: 0 PID: 25 Comm: kworker/u2:2 Tainted: G        W          6.7.0-rc1-00003-g4d8ff6b0991d-dirty #1375
Hardware name: Generic AM33XX (Flattened Device Tree)
Workqueue: events_unbound deferred_probe_work_func
Backtrace: 
 dump_backtrace from show_stack+0x20/0x24
 show_stack from dump_stack_lvl+0x60/0x78
 dump_stack_lvl from dump_stack+0x18/0x1c
 dump_stack from __spi_add_device+0x190/0x224
 __spi_add_device from spi_add_device+0x50/0x64
 spi_add_device from of_register_spi_device+0x430/0x5f0
 of_register_spi_device from spi_register_controller+0x3b0/0x6b8
 spi_register_controller from devm_spi_register_controller+0x54/0x94
 devm_spi_register_controller from omap2_mcspi_probe+0x4c4/0x584
 omap2_mcspi_probe from platform_probe+0x6c/0xcc
 platform_probe from really_probe+0xd8/0x2e8
 really_probe from __driver_probe_device+0x98/0x1b0
 __driver_probe_device from driver_probe_device+0x40/0x114
 driver_probe_device from __device_attach_driver+0xa4/0x10c
 __device_attach_driver from bus_for_each_drv+0x94/0xec
 bus_for_each_drv from __device_attach+0xbc/0x1e0
 __device_attach from device_initial_probe+0x1c/0x20
 device_initial_probe from bus_probe_device+0x98/0x9c
 bus_probe_device from deferred_probe_work_func+0x88/0xb4
 deferred_probe_work_func from process_one_work+0x170/0x43c
 process_one_work from worker_thread+0x2c4/0x4ec
 worker_thread from kthread+0x114/0x148
 kthread from ret_from_fork+0x14/0x28
Exception stack(0xe006dfb0 to 0xe006dff8)
dfa0:                                     00000000 00000000 00000000 00000000
dfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
dfe0: 00000000 00000000 00000000 00000000 00000013 00000000
 r9:00000000 r8:00000000 r7:00000000 r6:00000000 r5:c037c070 r4:c21d6140
omap2_mcspi 48030000.spi: chipselect 0 already in use
spi_master spi0: spi_device register error /ocp/interconnect@48000000/segment@0/target-module@30000/spi@0/soc@0
spi_master spi0: Failed to create SPI device for /ocp/interconnect@48000000/segment@0/target-module@30000/spi@0/soc@0
sdhci-omap 48060000.mmc: using DT '/ocp/interconnect@48000000/segment@0/target-module@60000/mmc@0' for 'cd' GPIO lookup
of_get_named_gpiod_flags: parsed 'cd-gpios' property of node '/ocp/interconnect@48000000/segment@0/target-module@60000/mmc@0[0]' - status (0)

[-- Attachment #2: am335x-boneblack-vsc7512.dts --]
[-- Type: audio/vnd.dts, Size: 10773 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: 6.8 SPI Chip Select Regression
  2024-04-03  2:14   ` Colin Foster
@ 2024-04-03 21:24     ` Andy Shevchenko
  2024-04-11 16:02       ` Colin Foster
  0 siblings, 1 reply; 5+ messages in thread
From: Andy Shevchenko @ 2024-04-03 21:24 UTC (permalink / raw)
  To: Colin Foster; +Cc: Mark Brown, Amit Kumar Mahapatra, linux-spi, linux-kernel

Tue, Apr 02, 2024 at 09:14:46PM -0500, Colin Foster kirjoitti:
> Hi Mark,
> 
> Thanks for the quick response.
> 
> On Wed, Apr 03, 2024 at 12:52:44AM +0100, Mark Brown wrote:
> > On Tue, Apr 02, 2024 at 04:32:50PM -0500, Colin Foster wrote:
> > > Hi Amit,
> > 
> > Amit, please respond to these issues - you never replied to the mails
> > about the other regressions this introduced either...
> > 
> > > [    3.459990] omap2_mcspi 48030000.spi: chipselect 0 already in use
> > > [    3.466135] spi_master spi0: spi_device register error /ocp/interconnect@48000000/segment@0/target-module@30000/spi@0/soc@0
> > > [    3.477495] spi_master spi0: Failed to create SPI device for /ocp/interconnect@48000000/segment@0/target-module@30000/spi@0/soc@0
> > 
> > > Is this a known issue? Is there anything I either might need to do to a
> > > device tree, or something you might suggest to help troubleshoot this?
> > 
> > This is not known, and given that you say there's only one chip select
> > in use on the system seems clearly bogus.  There were some regressions
> > with trying to use more than the hard coded maximum number of chip
> > selects but they have a different error pattern.  It's late so I'll not
> > look properly right now but...
> > 
> > Do you know what chip select 0 is - if you add a WARN_ON() to
> > spi_set_chipselect() it should show a prior call to the function,
> 
> Log is below. There aren't any other SPI devices, so I'm not really sure
> what is the issue just yet. It is also using the built-in chip select,
> not a GPIO.
> 
> > or is
> > it some logic bug that somehow is not manifesting on other systems that
> > use chip select 0?  Though looking quickly there has been some factoring
> > out since that commit was merged...  just to confirm, did you bisect to
> > find the problematic commit? 
> 
> I bisected, and just confirmed again that the previous commit,
> f05e2f61fe88: ("ALSA: hda/cs35l56: Use set/get APIs to access spi->chip_select")
> does boot as expected.
> 
> I noticed the issue on 6.9-rc2, then jumped back to 6.8, then 6.7.
> Bisected between 6.7 and 6.8.
> 
> > If you could show the DT for your setup
> > that'd help, especially if this is a GPIO chip select.
> 
> It should be attached. It is really nothing more than the beaglebone
> black with this SPI addition. The only things out-of-tree are some VLAN
> and MTU tweaks I had to make for my DSA networking setup to work.

You have
addr cell = 1
sz cell = 0

At the same time you have 
reg <0 0>

AFAICT the SPI core behaves correctly. Am I wrong?

I.o.w. you either want to have reg = <0>, or <0 1> or something which has
different values.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: 6.8 SPI Chip Select Regression
  2024-04-03 21:24     ` Andy Shevchenko
@ 2024-04-11 16:02       ` Colin Foster
  0 siblings, 0 replies; 5+ messages in thread
From: Colin Foster @ 2024-04-11 16:02 UTC (permalink / raw)
  To: Andy Shevchenko; +Cc: Mark Brown, Amit Kumar Mahapatra, linux-spi, linux-kernel

Hi Andy,

On Thu, Apr 04, 2024 at 12:24:54AM +0300, Andy Shevchenko wrote:
> 
> You have
> addr cell = 1
> sz cell = 0
> 
> At the same time you have 
> reg <0 0>
> 
> AFAICT the SPI core behaves correctly. Am I wrong?
> 
> I.o.w. you either want to have reg = <0>, or <0 1> or something which has
> different values.

This email was snagged by my junk filter, so I just saw it.

Indeed, changing to reg = <0> solved the issue. Many, many thanks!

> 
> -- 
> With Best Regards,
> Andy Shevchenko
> 
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-04-11 16:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-02 21:32 6.8 SPI Chip Select Regression Colin Foster
2024-04-02 23:52 ` Mark Brown
2024-04-03  2:14   ` Colin Foster
2024-04-03 21:24     ` Andy Shevchenko
2024-04-11 16:02       ` Colin Foster

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).