alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Russell King - ARM Linux <linux@arm.linux.org.uk>
Cc: tiwai@suse.de, alsa-devel@alsa-project.org, lgirdwood@gmail.com,
	Nicolin Chen <Guangyu.Chen@freescale.com>
Subject: Re: [PATCH] ASoC: imx-spdif: Use module_init() to handle platform_device_register()
Date: Mon, 16 Dec 2013 22:17:10 +0000	[thread overview]
Message-ID: <20131216221710.GH3185@sirena.org.uk> (raw)
In-Reply-To: <20131216211958.GS4360@n2100.arm.linux.org.uk>


[-- Attachment #1.1: Type: text/plain, Size: 2211 bytes --]

On Mon, Dec 16, 2013 at 09:19:58PM +0000, Russell King - ARM Linux wrote:
> On Mon, Dec 16, 2013 at 07:47:17PM +0000, Mark Brown wrote:

> > The crucial bit of information here is what the "inappropriate
> > condition" is - what is this trying to fix?  The code doesn't look
> > obviously wrong though it does rely on the platform device registration
> > taking effect immediately to actually probe which is a bit of an

> It's an exact copy-n-paste of the same problem which Kirkwood stuff had
> when I first looked at spdif there (presumably because Kirkwood had copied
> it from somewhere.)  The basic problem is this:

Indeed - that was a comment on the qualty of the changelog as much as
anything.

> > What should work right now is for the module to ensure that the S/PDIF
> > CODEC drivers are loaded before it is by linking to some symbol from
> > there.  This is a total hack though.  Nicer would be for the machine
> > driver to either directly register S/PDIF DAIs (rather than devices that
> > then register the DAIs) or to create a card subdevice in parallel with
> > the S/PDIF ones and hook the card registration off that.

> That creates much more complexity though, and adds yet more possibility
> for unreliability into this.  "Keep it simple" is well worth following.

I don't see registering the DAIs directly as adding complexity here;
it's essentially what the current code is trying to do and doesn't
change the normal device registration flow at all.  I do agree that the
card subdevice is more complex, I don't particularly like that idea
myself.

> The simple thing here is to declare the codec device in the module init,
> before registering the card driver, and cleaning it up at the appropriate
> moment.  That way, the card platform driver gets registered and it can

It's certainly simple and it's definitely what I'd recommend for non-DT
systems.  For DT systems it'll cause issues if two drivers both try to
register the same device on module load and the second one to get loaded
checks for errors.  Another way is just to do that in the core so we
don't need to worry about individual drivers conflicting and convert all
the drivers that do this to reference the core copies.

[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

[-- Attachment #2: Type: text/plain, Size: 0 bytes --]



  reply	other threads:[~2013-12-16 22:17 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-16 10:36 [PATCH] ASoC: imx-spdif: Use module_init() to handle platform_device_register() Nicolin Chen
2013-12-16 19:47 ` Mark Brown
2013-12-16 21:19   ` Russell King - ARM Linux
2013-12-16 22:17     ` Mark Brown [this message]
2013-12-17  3:05       ` Nicolin Chen
2013-12-17 10:31       ` Nicolin Chen
2013-12-18 13:04         ` Mark Brown
2013-12-20  7:02           ` Nicolin Chen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131216221710.GH3185@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=Guangyu.Chen@freescale.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=lgirdwood@gmail.com \
    --cc=linux@arm.linux.org.uk \
    --cc=tiwai@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).