[alsa-devel] [PATCH] ak4642: show error if register write fails
tiwai at suse.de
Tue Mar 11 16:15:01 CET 2014
At Tue, 11 Mar 2014 14:21:38 +0000,
Mark Brown wrote:
> On Tue, Mar 11, 2014 at 02:59:55PM +0100, Lars-Peter Clausen wrote:
> > On 03/11/2014 12:21 PM, Mark Brown wrote:
> > >>If you think that changing the two snd_soc calls to print errors
> > >>when anything bad happens then that would also be a good idea then
> > >>I can send a patch for that.
> > >That would be better, yes.
> > In my opinion it's better to pass the error on to the upper levels.
> > E.g. if userspace opens the PCM device and there is an IO error in
> > the startup callback then that error should be passed on to the
> > userspace application rather than doing a out of band error
> > reporting and adding a entry to the kernel log.
> It would, overall, be much better to be passing errors back. However
> what's actually happening now is I/O errors are routinely ignored and
> our error handling is somewhat shaky (and realistically it's hard to
> know what to do a lot of the time when I/O with the device is failing).
> Given that improving the diagnostics seems like it's going in the right
> direction, we can always remove this later.
This should be decided for each case, and I agree with the usefulness
of error logging for this particular case. The I/O errors are
basically exceptions, and shouldn't happen in normal operations.
That said, if the driver behavior depends on such lowlevel errors,
its design is wrong, must be fixed in anyway.
Still an open question is whether it should be dev_err() or
dev_dbg(). Ideally speaking, dev_dbg() should be used, while
dev_err() would be more practical.
More information about the Alsa-devel