Skip to content

pcm512x 1-004d: Failed to reset device: -5 #662

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
maxnet opened this issue Aug 7, 2014 · 13 comments
Closed

pcm512x 1-004d: Failed to reset device: -5 #662

maxnet opened this issue Aug 7, 2014 · 13 comments

Comments

@maxnet
Copy link
Contributor

maxnet commented Aug 7, 2014

This probably won't show up on Raspbian because i2c is blacklisted by default there, but on other distributions, some errors are ruining previously quiet console output:

[ 19.315414] pcm512x 1-004d: Failed to reset device: -5
[ 19.322769] pcm512x 1-004c: Failed to reset device: -5

Seems udev is triggered to load the snd_soc_pcm512x module twice and snd_soc_wm8804 once, due to the i2c declarations here:

https://github.com/raspberrypi/linux/blob/rpi-3.12.y/arch/arm/mach-bcm2708/bcm2708.c#L663
https://github.com/raspberrypi/linux/blob/rpi-3.12.y/arch/arm/mach-bcm2708/bcm2708.c#L708
https://github.com/raspberrypi/linux/blob/rpi-3.12.y/arch/arm/mach-bcm2708/bcm2708.c#L677

Should there really be static declarations for hardware add-ons that may or may not be present?

@popcornmix
Copy link
Collaborator

Should there really be static declarations for hardware add-ons that may or may not be present?

No.
Suggestions for the best way to solve this are welcome.

@maxnet
Copy link
Contributor Author

maxnet commented Aug 8, 2014

I think the i2c codec can be registered in the init function of the module that actually wants to use the thing (hifiberry?)

Another module seems to be doing that by having i2c_get_adapter / i2c_new_device there, instead of having i2c_register_board_info in the mach file.
https://github.com/raspberrypi/linux/blob/rpi-3.12.y/sound/soc/pxa/magician.c#L491

Should be tested by someone that actually has that add-on board though.

@notro
Copy link
Contributor

notro commented Aug 8, 2014

This is a really good example of HAT coming to the rescue :-)

I see three solutions for this:

  1. as @maxnet suggests, let the driver/module itself take care of this
  2. Make a module that just loads the necessary device. Separation of concerns.
    This module can probe to see if the hardware is present before adding the device.
    (or add a module that handles all of these "can be present devices".)
  3. Add a kernel commandline argument to enable adding the device: bcm2708.hifiberry=1

@agherzan
Copy link
Contributor

agherzan commented Feb 5, 2015

Hi guys. So just to clarify this for me. pcm512x ti codec is only present on B+ and not on earlier version HW? Because this error is not seen on a B version.

@pelwell
Copy link
Contributor

pelwell commented Feb 5, 2015

The codec is not present on any Pi, unless you have added a board that includes one.

This is an example of Device Tree coming to the rescue. :-p

If you update to the latest releases, these errors will go away. The flip side is that if you want to use the i2c, i2s or spi interfaces then you have to enable them. Take a look at the new README in /boot/overlays for an introduction to the topic.

@agherzan
Copy link
Contributor

agherzan commented Feb 9, 2015

Cool stuff. Thanks.

@popcornmix
Copy link
Collaborator

@maxnet okay to close?
i assume you don't get this issue on 3.18/DT kernel.

@maxnet
Copy link
Contributor Author

maxnet commented Feb 9, 2015

Yes, this issue is not present when using the 3.18 kernel with a device tree.
(as long as one does not forget to run mkknlimg, or it will ruin quiet console output with messages about missing cpu node definitions instead)
So can be closed.

@maxnet maxnet closed this as completed Feb 9, 2015
agherzan pushed a commit to agherzan/meta-raspberrypi that referenced this issue May 17, 2015
Add basic support for Linux 3.14, cherry-pick changes from 3.18.y in
order to solve some debugfs warnings and get better support
for i2s for BCM2708.

- 3.14 lacks BCM2709 support and will not by default be able to use for
raspberry pi 2.

Below warnings still exists they are harmless and exists due to that
snd_soc_pcm512x is triggered to be loaded twice. The problem is solved
after device tree support for the driver was introduced in 3.18.y and no
easy solution exists to solve this problem on older kernel versions (see
raspberrypi/linux#662 for more info).

   pcm512x 1-004c: Failed to reset device: -5
   pcm512x: probe of 1-004c failed with error

Remove sl030raspberrypii2ckernel.patch since it will not apply anymore
and its content seems to be obsolite after cherry-picking
'558d0bf Fix grabbing lock from atomic context in i2c driver'.

[Support #57]

Signed-off-by: Petter Mabäcker <[email protected]>
Signed-off-by: Andrei Gherzan <[email protected]>
@Mausy5043
Copy link

I'm not sure I understand the above discussion, but I see the error on my Raspberries (all are on jessie).

  1. R-Pi model B (Linux rbelec 3.18.0-trunk-rpi #1 PREEMPT Debian 3.18.5-1~exp1+rpi19 (2015-08-08) armv6l GNU/Linux)

    Oct 18 16:31:17 rbelec kernel: pcm512x 1-004d: Failed to reset device: -5
    Oct 18 16:31:17 rbelec kernel: pcm512x: probe of 1-004d failed with error -5
    Oct 18 16:31:17 rbelec kernel: pcm512x 1-004c: Failed to reset device: -5
    Oct 18 16:31:17 rbelec kernel: pcm512x: probe of 1-004c failed with error -5
    
  2. R-Pi model B+ (Linux rbian 3.18.0-trunk-rpi #1 PREEMPT Debian 3.18.5-1~exp1+rpi19 (2015-08-08) armv6l GNU/Linux)

    Oct 18 16:19:42 rbian kernel: pcm512x 1-004d: Failed to reset device: -5
    Oct 18 16:19:42 rbian kernel: pcm512x: probe of 1-004d failed with error -5
    Oct 18 16:19:42 rbian kernel: pcm512x 1-004c: Failed to reset device: -5
    Oct 18 16:19:42 rbian kernel: pcm512x: probe of 1-004c failed with error -5
    

The config.txt files all look like this:

$ cat /boot/config.txt
[pi1]
kernel=vmlinuz-3.18.0-trunk-rpi
initramfs initrd.img-3.18.0-trunk-rpi followkernel
# to enable DeviceTree, comment out the next line
device_tree=
gpu_mem=16

arm_freq=950
core_freq=450
sdram_freq=450
over_voltage=6

arm_freq_min=700
core_freq_min=250
sdram_freq_min=400
over_voltage_min=0

force_turbo=0

How can I make the errors go away?

@pelwell
Copy link
Contributor

pelwell commented Oct 18, 2015

Enable Device Tree (comment out/delete the device_tree= line).

@Mausy5043
Copy link

@pelwell : That just makes the kernel panicky.
ref: #914 (comment)

Just tried it to make sure. Kernel panics at boot. Can't remove the device_tree= line

@pelwell
Copy link
Contributor

pelwell commented Oct 18, 2015

Upload your crash logs somewhere in case they say something useful.

If you have to keep DT disabled then you'll need to blacklist the modules you don't want.

@Mausy5043
Copy link

@pelwell : #914 documents the problem pretty well. There's already several logs attached to that issue.

I think there's a relation with that problem.

pfpacket pushed a commit to pfpacket/linux-rpi-rust that referenced this issue Apr 7, 2023
daregit pushed a commit to daregit/yocto-combined that referenced this issue May 22, 2024
Add basic support for Linux 3.14, cherry-pick changes from 3.18.y in
order to solve some debugfs warnings and get better support
for i2s for BCM2708.

- 3.14 lacks BCM2709 support and will not by default be able to use for
raspberry pi 2.

Below warnings still exists they are harmless and exists due to that
snd_soc_pcm512x is triggered to be loaded twice. The problem is solved
after device tree support for the driver was introduced in 3.18.y and no
easy solution exists to solve this problem on older kernel versions (see
raspberrypi/linux#662 for more info).

   pcm512x 1-004c: Failed to reset device: -5
   pcm512x: probe of 1-004c failed with error

Remove sl030raspberrypii2ckernel.patch since it will not apply anymore
and its content seems to be obsolite after cherry-picking
'558d0bf Fix grabbing lock from atomic context in i2c driver'.

[Support #57]

Signed-off-by: Petter Mabäcker <[email protected]>
Signed-off-by: Andrei Gherzan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants