Skip to contentSkip to conversation

dmasound_pmac depends on pmac specific config options

PATCH In review Olaf Hering 3 participants 6 messages Oct 22, 2005 Sound

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dmasound_pmac depends on pmac specific config options

dmasound_pmac should depend on pmac specific .config options. Since PMAC is always defined, but PMAC wont boot without either CUDA or PMU, one of these options indicates that the kernel is for a PowerMac.
CONFIG_PM can be selected unconditionally.

sound/oss/dmasound/dmasound_awacs.c:262: warning: `struct pmu_sleep_notifier' declared inside parameter list sound/oss/dmasound/dmasound_awacs.c:262: warning: its scope is only this definition or declaration, which is probably not what you want sound/oss/dmasound/dmasound_awacs.c:263: error: variable `awacs_sleep_notifier' has initializer but incomplete type sound/oss/dmasound/dmasound_awacs.c:264: warning: excess elements in struct initializer sound/oss/dmasound/dmasound_awacs.c:264: warning: (near initialization for awacs_sleep_notifier') sound/oss/dmasound/dmasound_awacs.c:264: error: SLEEP_LEVEL_SOUND' undeclared here (not in a function) sound/oss/dmasound/dmasound_awacs.c:264: warning: excess elements in struct initializer sound/oss/dmasound/dmasound_awacs.c:264: warning: (near initialization for awacs_sleep_notifier') sound/oss/dmasound/dmasound_awacs.c: In function PMacIrqCleanup':
sound/oss/dmasound/dmasound_awacs.c:679: warning: implicit declaration of function `pmu_unregister_sleep_notifier' sound/oss/dmasound/dmasound_awacs.c: At top level:
sound/oss/dmasound/dmasound_awacs.c:1424: error: conflicting types for awacs_sleep_notify' sound/oss/dmasound/dmasound_awacs.c:262: error: previous declaration of awacs_sleep_notify' sound/oss/dmasound/dmasound_awacs.c: In function `awacs_sleep_notify':
sound/oss/dmasound/dmasound_awacs.c:1428: error: `PBOOK_SLEEP_NOW' undeclared (first use in this function) sound/oss/dmasound/dmasound_awacs.c:1428: error: (Each undeclared identifier is reported only once sound/oss/dmasound/dmasound_awacs.c:1428: error: for each function it appears in.) sound/oss/dmasound/dmasound_awacs.c:1481: error: PBOOK_WAKE' undeclared (first use in this function) sound/oss/dmasound/dmasound_awacs.c:1552: error: PBOOK_SLEEP_OK' undeclared (first use in this function) sound/oss/dmasound/dmasound_awacs.c: In function `dmasound_awacs_init':
sound/oss/dmasound/dmasound_awacs.c:3057: warning: implicit declaration of function `pmu_register_sleep_notifier' sound/oss/dmasound/dmasound_awacs.c: At top level:
sound/oss/dmasound/dmasound_awacs.c:263: error: storage size of `awacs_sleep_notifier' isn't known

 sound/oss/dmasound/Kconfig |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)
sound/oss/dmasound/Kconfig +1 -1
Index: linux-2.6.14-rc5/sound/oss/dmasound/Kconfig
===================================================================
@@ -14,7 +14,7 @@ config DMASOUND_ATARI
 
 config DMASOUND_PMAC
 	tristate "PowerMac DMA sound support"
-	depends on PPC32 && PPC_PMAC && SOUND && I2C
+	depends on PPC32 && PPC_PMAC && SOUND && I2C && (ADB_CUDA || ADB_PMU)
  	select DMASOUND
 	help
 	  If you want to use the internal audio of your PowerMac in Linux,
Signature · 2 lines
short story of a lazy sysadmin:
 alias appserv=wotan
#1 lore raw

PATCH 1/1 snd_powermac depends on pmac specific config options

snd_powermac should depend on pmac specific .config options. Since PMAC is always defined, but PMAC wont boot without either CUDA or PMU, one of these options indicates that the kernel is for a PowerMac.
CONFIG_PM can be selected unconditionally.

sound/ppc/pmac.c:1380: warning: `struct pmu_sleep_notifier' declared inside parameter list sound/ppc/pmac.c:1380: warning: its scope is only this definition or declaration, which is probably not what you want sound/ppc/pmac.c: In function `snd_pmac_sleep_notify':
sound/ppc/pmac.c:1388: error: `PBOOK_SLEEP_NOW' undeclared (first use in this function) sound/ppc/pmac.c:1388: error: (Each undeclared identifier is reported only once sound/ppc/pmac.c:1388: error: for each function it appears in.)
sound/ppc/pmac.c:1391: error: PBOOK_WAKE' undeclared (first use in this function) sound/ppc/pmac.c:1395: error: PBOOK_SLEEP_OK' undeclared (first use in this function) sound/ppc/pmac.c: At top level:
sound/ppc/pmac.c:1398: error: variable `snd_pmac_sleep_notifier' has initializer but incomplete type sound/ppc/pmac.c:1399: warning: excess elements in struct initializer
sound/ppc/pmac.c:1399: warning: (near initialization for snd_pmac_sleep_notifier') sound/ppc/pmac.c:1399: error: SLEEP_LEVEL_SOUND' undeclared here (not in a function) sound/ppc/pmac.c:1399: warning: excess elements in struct initializer
sound/ppc/pmac.c:1399: warning: (near initialization for snd_pmac_sleep_notifier') sound/ppc/pmac.c: In function snd_pmac_register_sleep_notifier':
sound/ppc/pmac.c:1407: warning: implicit declaration of function pmu_register_sleep_notifier' sound/ppc/pmac.c: In function snd_pmac_unregister_sleep_notifier':
sound/ppc/pmac.c:1415: warning: implicit declaration of function `pmu_unregister_sleep_notifier' sound/ppc/pmac.c: At top level:
sound/ppc/pmac.c:1398: error: storage size of `snd_pmac_sleep_notifier' isn't known
make[3]: *** [sound/ppc/pmac.o] Error 1

 sound/ppc/Kconfig |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)
sound/ppc/Kconfig +1 -1
Index: linux-2.6.14-rc5/sound/ppc/Kconfig
===================================================================
@@ -11,7 +11,7 @@ comment "ALSA PowerMac requires INPUT"
 
 config SND_POWERMAC
 	tristate "PowerMac (AWACS, DACA, Burgundy, Tumbler, Keywest)"
-	depends on SND && I2C && INPUT && PPC_PMAC
+	depends on SND && I2C && INPUT && PPC_PMAC && (ADB_CUDA || ADB_PMU)
 	select SND_PCM
 	select SND_GENERIC_DRIVER
 	help
Signature · 2 lines
short story of a lazy sysadmin:
 alias appserv=wotan
#2 lore raw
In reply to Olaf Hering
Quoted 6 lines · Olaf Hering

dmasound_pmac should depend on pmac specific .config options. Since PMAC is always defined, but PMAC wont boot without either CUDA or PMU, one of these options indicates that the kernel is for a PowerMac.
CONFIG_PM can be selected unconditionally.

I disagree. I think a much better solution would be to change the code to be conditionalized internally on PMU support, rather than having #ifdef CONFIG_PM since the functions being called inside that protection are actually out of the PMU code, not the generic power management system. By doing this, you could for example have a kernel compiled for a 1st gen PCI PowerMac without any extra drivers. In this case, you have CUDA and AWACS, but there is no PMU support and no need for sleep notifiers.

Similar comments on the other patch.

Brad Boyer
[email protected]

#3 lore raw
Quoted 8 lines · Brad Boyer

I disagree. I think a much better solution would be to change the code to be conditionalized internally on PMU support, rather than having #ifdef CONFIG_PM since the functions being called inside that protection are actually out of the PMU code, not the generic power management system. By doing this, you could for example have a kernel compiled for a 1st gen PCI PowerMac without any extra drivers. In this case, you have CUDA and AWACS, but there is no PMU support and no need for sleep notifiers.

May patch would allow that, you need either CUDA or PMU support.

Signature · 2 lines
short story of a lazy sysadmin:
 alias appserv=wotan
#4 lore raw
Quoted 11 lines · Olaf Hering
Quoted 8 lines · Brad Boyer

I disagree. I think a much better solution would be to change the code to be conditionalized internally on PMU support, rather than having #ifdef CONFIG_PM since the functions being called inside that protection are actually out of the PMU code, not the generic power management system. By doing this, you could for example have a kernel compiled for a 1st gen PCI PowerMac without any extra drivers. In this case, you have CUDA and AWACS, but there is no PMU support and no need for sleep notifiers.

Quoted 1 line

May patch would allow that, you need either CUDA or PMU support.

The problem is not that you need CUDA or PMU support. The real problem is that if you have CONFIG_PM set and do not have CONFIG_ADB_PMU set, the pmac sound drivers don't compile because they have calls into the pmu code protected by #ifdef CONFIG_PM, which isn't enough to ensure that those symbols actually exist. That code gets into the kernel only if you have CONFIG_PM and CONFIG_ADB_PMU both set. Your patch will still fail in the following case:

CONFIG_PM set
CONFIG_CUDA set
CONFIG_ADB_PMU not set

If you enable either of the pmac sound drivers with this setup, it will fail to compile with exactly the same error.

Brad Boyer
[email protected]

#5 lore raw
In reply to Brad Boyer
Quoted 8 lines · Brad Boyer
Quoted 6 lines · Olaf Hering

dmasound_pmac should depend on pmac specific .config options. Since PMAC is always defined, but PMAC wont boot without either CUDA or PMU, one of these options indicates that the kernel is for a PowerMac.
CONFIG_PM can be selected unconditionally.

Quoted 8 lines

I disagree. I think a much better solution would be to change the code to be conditionalized internally on PMU support, rather than having #ifdef CONFIG_PM since the functions being called inside that protection are actually out of the PMU code, not the generic power management system. By doing this, you could for example have a kernel compiled for a 1st gen PCI PowerMac without any extra drivers. In this case, you have CUDA and AWACS, but there is no PMU support and no need for sleep notifiers.

The fix is a longer term issue. dmasound should stop using PMU specific PM notifiers and those should finally be deprecated. Taht would require converting dmasound to be a proper macio device, which is a pain, and while we are at it, finally rewriting dmasound (and/or snd-powermac) properly which is on my todolist since nobody appears to be up to it.

Ben.