alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* Need help with failed driver initialization
@ 2012-09-10 16:04 Timur Tabi
  2012-09-10 20:47 ` Timur Tabi
  2012-09-11  3:43 ` Mark Brown
  0 siblings, 2 replies; 4+ messages in thread
From: Timur Tabi @ 2012-09-10 16:04 UTC (permalink / raw)
  To: Alsa-devel

Every 6-12 months it seems, my audio drivers break because of some update to the ASoC.  It's that time again.

It appears that support for deferred probing isn't working for me.  I turned on debug printks (and added a few of my own to my drivers), and here's the log:

It looks like everything is registering, but the audio device still doesn't exist.  Can anyone give me a clue what's wrong?

bus: 'i2c': driver_probe_device: matched device 0-004f with driver cs4270
bus: 'i2c': really_probe: probing driver cs4270 with device 0-004f
cs4270 0-004f: found device at i2c address 4F
cs4270 0-004f: hardware revision 3
cs4270 0-004f: codec register 0-004f
cs4270 0-004f: dai register 0-004f #1
cs4270 0-004f: Mapped DAI cs4270-hifi to CODEC cs4270.0-004f
Registered DAI 'cs4270-hifi'
Registered codec 'cs4270.0-004f'
driver: '0-004f': driver_bound: bound to device 'cs4270'
bus: 'i2c': really_probe: bound device 0-004f to driver cs4270
Freescale MPC8610 HPCD ALSA SoC machine driver
bus: 'platform': driver_probe_device: matched device e0016000.ssi with driver fsl-ssi-dai
bus: 'platform': really_probe: probing driver fsl-ssi-dai with device e0016000.ssi
fsl-ssi-dai e0016000.ssi: probing
fsl-ssi-dai e0016000.ssi: registering with ASoC
fsl-ssi-dai e0016000.ssi: dai register e0016000.ssi
Registered DAI 'e0016000.ssi'
fsl-ssi-dai e0016000.ssi: AsoC registration complete
fsl-ssi-dai e0016000.ssi: platform registration 'snd-soc-mpc8610hpcd'
bus: 'platform': driver_probe_device: matched device snd-soc-mpc8610hpcd.0 with driver snd-soc-mpc8610hpcd
bus: 'platform': really_probe: probing driver snd-soc-mpc8610hpcd with device snd-soc-mpc8610hpcd.0
bus: 'platform': driver_probe_device: matched device soc-audio with driver soc-audio
bus: 'platform': really_probe: probing driver soc-audio with device soc-audio
soc-audio soc-audio: ASoC machine snd-soc-mpc8610hpcd should use snd_soc_register_card()
soc-audio soc-audio: binding playback at idx 0
soc-audio soc-audio: platform e0021100.dma-channel not registered
platform soc-audio: Driver soc-audio requests probe deferral
platform soc-audio: Added to deferred list
driver: 'snd-soc-mpc8610hpcd.0': driver_bound: bound to device 'snd-soc-mpc8610hpcd'
bus: 'platform': really_probe: bound device snd-soc-mpc8610hpcd.0 to driver snd-soc-mpc8610hpcd
fsl-ssi-dai e0016000.ssi: probe successful
driver: 'e0016000.ssi': driver_bound: bound to device 'fsl-ssi-dai'
bus: 'platform': really_probe: bound device e0016000.ssi to driver fsl-ssi-dai
bus: 'platform': driver_probe_device: matched device e0021100.dma-channel with driver fsl-pcm-audio
bus: 'platform': really_probe: probing driver fsl-pcm-audio with device e0021100.dma-channel
fsl-pcm-audio e0021100.dma-channel: probing
fsl-pcm-audio e0021100.dma-channel: platform register e0021100.dma-channel
Registered platform 'e0021100.dma-channel'
fsl-pcm-audio e0021100.dma-channel: probe successful
driver: 'e0021100.dma-channel': driver_bound: bound to device 'fsl-pcm-audio'
bus: 'platform': really_probe: bound device e0021100.dma-channel to driver fsl-pcm-audio
bus: 'platform': driver_probe_device: matched device e0021180.dma-channel with driver fsl-pcm-audio
bus: 'platform': really_probe: probing driver fsl-pcm-audio with device e0021180.dma-channel
fsl-pcm-audio e0021180.dma-channel: probing
fsl-pcm-audio e0021180.dma-channel: platform register e0021180.dma-channel
Registered platform 'e0021180.dma-channel'
fsl-pcm-audio e0021180.dma-channel: probe successful
driver: 'e0021180.dma-channel': driver_bound: bound to device 'fsl-pcm-audio'
bus: 'platform': really_probe: bound device e0021180.dma-channel to driver fsl-pcm-audio
...
ALSA device list:
  No soundcards found.
platform soc-audio: Retrying from deferred list
bus: 'platform': driver_probe_device: matched device soc-audio with driver soc-audio
bus: 'platform': really_probe: probing driver soc-audio with device soc-audio
soc-audio: probe of soc-audio failed with error -22

When I use speaker-test, I get this:

# speaker-test -t sine -c 2 -r 48000

speaker-test 1.0.11rc2

Playback device is default
Stream parameters are 48000Hz, S16_BE, 2 channels
Sine wave rate is 440.0000Hz
ALSA lib confmisc.c:768:(parse_card) cannot find card '0'
ALSA lib conf.c:3513:(_snd_config_evaluate) function snd_func_card_driver returned error: No such file or directory
ALSA lib confmisc.c:392:(snd_func_concat) error evaluating strings
ALSA lib conf.c:3513:(_snd_config_evaluate) function snd_func_concat returned error: No such file or directory
ALSA lib confmisc.c:1251:(snd_func_refer) error evaluating name
ALSA lib conf.c:3513:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:3985:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2202:(snd_pcm_open_noupdate) Unknown PCM default
Playback open error: -2,No such file or directory


-- 
Timur Tabi
Linux kernel developer at Freescale

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

* Re: Need help with failed driver initialization
  2012-09-10 16:04 Need help with failed driver initialization Timur Tabi
@ 2012-09-10 20:47 ` Timur Tabi
  2012-09-11  3:55   ` Mark Brown
  2012-09-11  3:43 ` Mark Brown
  1 sibling, 1 reply; 4+ messages in thread
From: Timur Tabi @ 2012-09-10 20:47 UTC (permalink / raw)
  To: Alsa-devel

Timur Tabi wrote:
> It appears that support for deferred probing isn't working for me.  I
> turned on debug printks (and added a few of my own to my drivers), and
> here's the log:

So it appears that platform_device_alloc("soc-audio", -1) no longer works
for me.  When I replace that code with a call to snd_soc_register_card(),
my driver works again.

I noticed that a lot of drivers still use platform_device_alloc(), so I
don't know if this problem specific to my drivers, or everyone else is
broken but they don't know it yet.  Either way, I'll post a patch soon.

-- 
Timur Tabi
Linux kernel developer at Freescale

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

* Re: Need help with failed driver initialization
  2012-09-10 16:04 Need help with failed driver initialization Timur Tabi
  2012-09-10 20:47 ` Timur Tabi
@ 2012-09-11  3:43 ` Mark Brown
  1 sibling, 0 replies; 4+ messages in thread
From: Mark Brown @ 2012-09-11  3:43 UTC (permalink / raw)
  To: Timur Tabi; +Cc: Alsa-devel

On Mon, Sep 10, 2012 at 11:04:33AM -0500, Timur Tabi wrote:
> Every 6-12 months it seems, my audio drivers break because of some
> update to the ASoC.  It's that time again.

It would really help if your drivers, especially the probing stuff, were
more mainstream.  The fact that your device registration is entirely in
code rather than using structures makes things especially fragile as 
it's not even particularly visible what the code is doing.  If you could
move over to more standard code that'd help a lot.

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

* Re: Need help with failed driver initialization
  2012-09-10 20:47 ` Timur Tabi
@ 2012-09-11  3:55   ` Mark Brown
  0 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2012-09-11  3:55 UTC (permalink / raw)
  To: Timur Tabi; +Cc: Alsa-devel

On Mon, Sep 10, 2012 at 03:47:54PM -0500, Timur Tabi wrote:

> So it appears that platform_device_alloc("soc-audio", -1) no longer works
> for me.  When I replace that code with a call to snd_soc_register_card(),
> my driver works again.

> I noticed that a lot of drivers still use platform_device_alloc(), so I
> don't know if this problem specific to my drivers, or everyone else is
> broken but they don't know it yet.  Either way, I'll post a patch soon.

It's nothing to do with that - it'd break with any driver.  The problem
is that you're passing data into your driver using dev_set_drvdata()
instead of using platform data.  This has never been supported by the
driver core (driver data is exclusively for use by the bound driver) and
recently the driver core was changed to clear the driver data every time
a driver was unbound (like happens during a deferred probe).  Which
unfortunately soc-core relies on, but it should always have been using
platform data.

In any case, all drivers are supposed to be being converted to use
snd_soc_register_card() so converting is a good thing.

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

end of thread, other threads:[~2012-09-11  3:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-09-10 16:04 Need help with failed driver initialization Timur Tabi
2012-09-10 20:47 ` Timur Tabi
2012-09-11  3:55   ` Mark Brown
2012-09-11  3:43 ` Mark Brown

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).