All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vinod Koul <vinod.koul@intel.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org, broonie@kernel.org,
	subhransu.s.prusty@intel.com, lgirdwood@gmail.com
Subject: Re: [PATCH 7/9] ASoC: Intel: move PCI probe to a seprate	file
Date: Thu, 30 Oct 2014 21:29:47 +0530	[thread overview]
Message-ID: <20141030155947.GF28745@intel.com> (raw)
In-Reply-To: <s5h7fzh4j3n.wl-tiwai@suse.de>

On Thu, Oct 30, 2014 at 05:29:00PM +0100, Takashi Iwai wrote:
> At Thu, 30 Oct 2014 21:07:19 +0530,
> Vinod Koul wrote:
> > 
> > On Thu, Oct 30, 2014 at 04:27:09PM +0100, Takashi Iwai wrote:
> > > > > The standard way is something like
> > > > > 
> > > > > snd-intel-sst-y := sst.o sst_ipc.o sst_stream.o sst_drv_interface.o sst_loader.o sst_pvt.o
> > > > > snd-intel-sst-$(CONFIG_SND_SST_IPC_PCI) += sst_pci.o
> > > > > 
> > > > > But, when looking at the later patch, you try to build ACPI stuff into
> > > > > snd-intel-sst, too, and both are implemented as exclusive.  This
> > > > > doesn't work well in general.
> > > > The hardware, firmware so the driver is pretty same. So either it gets probed
> > > > as PCI device is SFI platforms and as APCI device on ACPI ones.
> > > > Since the probe method is the only one differing, the machine will select
> > > > either PCI or ACPI. That one would get compiled in.
> > > 
> > > ... and this exclusion mechanism is missing in your patches.
> > > Your current code doesn't allow to mix them.
> > > 
> > > > Am okay to change if we have better method which works for both
> > > 
> > > In general, it's better to provide individual modules for different
> > > interfaces and a common module that is referred by them.  The
> > > selective build makes the build tests more difficult and is rather
> > > error-prone.
> > Hmmm, that makes me wonder why cant we do (based on your input above)
> > 
> > snd-intel-sst-y := sst.o sst_ipc.o sst_stream.o sst_drv_interface.o sst_loader.o sst_pvt.o
> > 
> > then either this:
> > snd-intel-sst-$(CONFIG_SND_SST_IPC_PCI) += sst_pci.o
> > snd-intel-sst-$(CONFIG_SND_SST_IPC_ACPI) += sst_acpi.o
> 
> This may compile both sst_pci.c and sst_acpi.c into snd-intel-sst
> module, so it doesn't work unless both Kconfigs are really exclusive.
> 
> > Or:
> > snd-intel-sst-pci-y += snd-intel-sst.o sst_pci.o
> > snd-intel-sst-acpi-y += snd-intel-sst.o sst_acpi.o
> 
> This is wrong in two ways.  First off, you can't link a module against
> another module.
> 
> Second, this causes the problem when user build one driver as a module
> and another as built-in.  Then you'll get the doubly symbols.
oh no, the core is not a module. the PCI and ACPI will be modules and
allowed to be selected.
Can we prevent the module/built-in by making depends. If one is built-in
other cant be module. That way it would be okay

> So, snd-intel-sst.o must be an individual module.
Since only probe and apci/pci resource setup code is different I would still
like to keep the core lib as same and PCI/ACPI as modules.

-- 
~Vinod

  reply	other threads:[~2014-10-30 16:40 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-30 10:51 [PATCH 0/9] ASoC: Intel: more modulartion of init and add ACPI Vinod Koul
2014-10-30 10:51 ` [PATCH 1/9] ASoC: Intel: mfld-pcm: Fix to Store device context in sst_data Vinod Koul
2014-10-30 10:51 ` [PATCH 2/9] ASoC: Intel: move the driver wq init to a routine Vinod Koul
2014-10-30 10:51 ` [PATCH 3/9] ASoC: Intel: move the lock and wq initialization to routine Vinod Koul
2014-10-30 10:51 ` [PATCH 4/9] ASoC: Intel: move the driver context allocation " Vinod Koul
2014-10-30 10:51 ` [PATCH 5/9] ASoC: Intel: modularize driver probe and remove Vinod Koul
2014-10-31 16:46   ` Mark Brown
2014-10-30 10:51 ` [PATCH 6/9] ASoC: Intel: more probe modularization for sst Vinod Koul
2014-10-30 10:51 ` [PATCH 7/9] ASoC: Intel: move PCI probe to a seprate file Vinod Koul
2014-10-30 15:03   ` Takashi Iwai
2014-10-30 14:34     ` Vinod Koul
2014-10-30 15:27       ` Takashi Iwai
2014-10-30 15:37         ` Vinod Koul
2014-10-30 16:28           ` Mark Brown
2014-10-30 16:29           ` Takashi Iwai
2014-10-30 15:59             ` Vinod Koul [this message]
2014-10-30 16:49               ` Takashi Iwai
2014-10-30 16:14                 ` Vinod Koul
2014-10-30 17:07                   ` Takashi Iwai
2014-10-30 17:31                     ` Mark Brown
2014-10-31  5:55                       ` Vinod Koul
2014-10-31 17:32                       ` Takashi Iwai
2014-10-30 10:51 ` [PATCH 8/9] ASoC: Intel: add shim save context and restore routines Vinod Koul
2014-10-31 16:58   ` Mark Brown
2014-10-30 10:51 ` [PATCH 9/9] ASoC: Intel: Add ACPI driver for SST Vinod Koul

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=20141030155947.GF28745@intel.com \
    --to=vinod.koul@intel.com \
    --cc=alsa-devel@alsa-project.org \
    --cc=broonie@kernel.org \
    --cc=lgirdwood@gmail.com \
    --cc=subhransu.s.prusty@intel.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.