ALSA: hda/cs35l56: same calibration condition logged at dev_info() and dev_err()
Documentation/sound/codecs/cs35l56.rst says "Failed to write calibration" has the "same meaning and cause as 'Calibration disabled due to missing firmware controls'". The latter is a dev_info(). The former is a dev_warn() with a dev_err() from cs_amp_write_cal_coeff() ahead of it.
Rebinding the HDA components without re-probing the i2c driver takes the loud path, 4 of 4 attempts here:
cs35l56-hda i2c-CSC3556:00-cs35l56-hda.0: Failed to write to 'CAL_R': -1
cs35l56-hda i2c-CSC3556:00-cs35l56-hda.0: Failed to write calibration: -1list_empty() is false because the controls cs_dsp_power_down() disabled at unbind are still on ctl_list, so the dev_info() branch is skipped.
The calibration is intact. CAL_CHECKSUM, CAL_STATUS, CAL_R and CAL_AMBIENT in DSP YM are unchanged across a failing rebind on both amps. On a speaker amplifier "Failed to write calibration" reads as a protection failure.
I lost around 5 hours chasing this down, believing this to be an actual bug.
Lenovo Yoga Pro 7 14IAH10 (83KF), kernel 7.2.4, two CS35L56 B0 on I2C behind CSC3556:00 over the HDA link.
Quoted 4 lines · Navon John Lukose
Documentation/sound/codecs/cs35l56.rstsays "Failed to write calibration" has the "same meaning and cause as 'Calibration disabled due to missing firmware controls'". The latter is adev_info(). The former is adev_warn()with adev_err()fromcs_amp_write_cal_coeff()ahead of it.
The documentation is giving advice about the *typical causes* of the errors that can usually by fixed by the end user (like missing firmware). However, I can reword this to say that in most cases they indicate the same problem, though not necessarily.
The former is a dev_warn() because the driver attempted to do something that should succeed, but it unexpectedly failed (though is not a fatal error).
The latter is a dev_info() because the driver skipped doing something that would fail, and is informing that it has skipped.
For most users, in most cases, the root cause will be one of the two listed in the documentation:
* The driver did not find a suitable wmfw for this hardware
or
* The amplifier has already been patched with firmware by something previously
Quoted 6 lines
Rebinding the HDA components without re-probing the i2c driver takes the loud path, 4 of 4 attempts here:
cs35l56-hda i2c-CSC3556:00-cs35l56-hda.0: Failed to write to 'CAL_R': -1 cs35l56-hda i2c-CSC3556:00-cs35l56-hda.0: Failed to write calibration: -1
Quoted 6 lines
list_empty()is false because the controlscs_dsp_power_down()disabled at unbind are still onctl_list, so thedev_info()branch is skipped.The calibration is intact.
CAL_CHECKSUM,CAL_STATUS,CAL_RandCAL_AMBIENTin DSP YM are unchanged across a failing rebind on both amps. On a speaker amplifier "Failed to write calibration" reads as a protection failure.
This is the second possible cause listed in the documentation:
* The amplifier has already been patched with firmware by something previously
Quoted 2 lines
I lost around 5 hours chasing this down, believing this to be an actual bug.
Warnings are warnings. They don't mean there is a bug in the code. Some interpretation of the meaning is usually required, and AI isn't always good at doing this.
The documentation does say that you can get this warning if the firmware was already patched.
Quoted 2 lines · Richard Fitzgerald
However, I can reword this to say that in most cases they indicate the same problem, though not necessarily.
That covers it, thanks!
Quoted 19 lines · Navon John Lukose
Documentation/sound/codecs/cs35l56.rstsays "Failed to write calibration" has the "same meaning and cause as 'Calibration disabled due to missing firmware controls'". The latter is adev_info(). The former is adev_warn()with adev_err()fromcs_amp_write_cal_coeff()ahead of it.Rebinding the HDA components without re-probing the i2c driver takes the loud path, 4 of 4 attempts here:
cs35l56-hda i2c-CSC3556:00-cs35l56-hda.0: Failed to write to 'CAL_R': -1 cs35l56-hda i2c-CSC3556:00-cs35l56-hda.0: Failed to write calibration: -1
list_empty()is false because the controlscs_dsp_power_down()disabled at unbind are still onctl_list, so thedev_info()branch is skipped.The calibration is intact.
CAL_CHECKSUM,CAL_STATUS,CAL_RandCAL_AMBIENTin DSP YM are unchanged across a failing rebind on both amps. On a speaker amplifier "Failed to write calibration" reads as a protection failure.
Quoted 7 lines
I lost around 5 hours chasing this down, believing this to be an actual bug.
Lenovo Yoga Pro 7 14IAH10 (83KF), kernel 7.2.4, two CS35L56 B0 on I2C behind CSC3556:00 over the HDA link.
Assisted-by LLM
The actual patch is missing?
thanks,
Takashi
Quoted 1 line · Takashi Iwai
The actual patch is missing?
Hi Takashi,
There is no patch, sorry for the confusion. This was a report about the cs35l56 documentation rather than a code change, and I should have made that clearer in the subject. Richard replied in this thread and will reword the doc text.
Thanks,
Navon
Quoted 5 lines · Navon John Lukose
Documentation/sound/codecs/cs35l56.rstsays "Failed to write calibration" has the "same meaning and cause as 'Calibration disabled due to missing firmware controls'". The latter is adev_info(). The former is adev_warn()with adev_err()fromcs_amp_write_cal_coeff()ahead of it.
Quoted 8 lines
Rebinding the HDA components without re-probing the i2c driver takes the loud path, 4 of 4 attempts here:
cs35l56-hda i2c-CSC3556:00-cs35l56-hda.0: Failed to write to 'CAL_R': -1 cs35l56-hda i2c-CSC3556:00-cs35l56-hda.0: Failed to write calibration: -1
list_empty()is false because the controlscs_dsp_power_down()disabled at unbind are still onctl_list, so thedev_info()branch is skipped.
I've been looking at what code changes would be needed to fix this. I'm not convinced that there is enough reason to fix this unbind-rebind problem. There are risks in trying to fix it.
I don't know of a reason why the driver needs to be unbound and rebound in normal operation. For debugging, the driver can be unloaded and reloaded to force a probe.
I'd prefer only a documentation update to note that this error could be caused by unbinding and rebinding the driver without reprobing.