diff options
author | Takashi Iwai <tiwai@suse.de> | 2009-02-05 01:34:28 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-02-05 01:41:04 -0500 |
commit | e8c0ee5d77ec0f144c753a622c67dd96fa195d50 (patch) | |
tree | 3d1e086956db36b12f003fc6f583a5278757e9d1 | |
parent | f67d8176ba9a3dbc33454cd67057184b2ef5ee31 (diff) |
ALSA: hda - Fix misc workqueue issues
Some fixes regarding snd-hda-intel workqueue:
- Use create_singlethread_workqueue() instead of create_workqueue()
as per-CPU work isn't required.
- Allocate workq name string properly
- Renamed the workq name to "hd-audio*" to be more obvious.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/pci/hda/hda_codec.c | 9 | ||||
-rw-r--r-- | sound/pci/hda/hda_codec.h | 1 |
2 files changed, 6 insertions, 4 deletions
diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c index b7bba7dc7cf1..0b708134d12f 100644 --- a/sound/pci/hda/hda_codec.c +++ b/sound/pci/hda/hda_codec.c | |||
@@ -487,7 +487,6 @@ int /*__devinit*/ snd_hda_bus_new(struct snd_card *card, | |||
487 | { | 487 | { |
488 | struct hda_bus *bus; | 488 | struct hda_bus *bus; |
489 | int err; | 489 | int err; |
490 | char qname[8]; | ||
491 | static struct snd_device_ops dev_ops = { | 490 | static struct snd_device_ops dev_ops = { |
492 | .dev_register = snd_hda_bus_dev_register, | 491 | .dev_register = snd_hda_bus_dev_register, |
493 | .dev_free = snd_hda_bus_dev_free, | 492 | .dev_free = snd_hda_bus_dev_free, |
@@ -517,10 +516,12 @@ int /*__devinit*/ snd_hda_bus_new(struct snd_card *card, | |||
517 | mutex_init(&bus->cmd_mutex); | 516 | mutex_init(&bus->cmd_mutex); |
518 | INIT_LIST_HEAD(&bus->codec_list); | 517 | INIT_LIST_HEAD(&bus->codec_list); |
519 | 518 | ||
520 | snprintf(qname, sizeof(qname), "hda%d", card->number); | 519 | snprintf(bus->workq_name, sizeof(bus->workq_name), |
521 | bus->workq = create_workqueue(qname); | 520 | "hd-audio%d", card->number); |
521 | bus->workq = create_singlethread_workqueue(bus->workq_name); | ||
522 | if (!bus->workq) { | 522 | if (!bus->workq) { |
523 | snd_printk(KERN_ERR "cannot create workqueue %s\n", qname); | 523 | snd_printk(KERN_ERR "cannot create workqueue %s\n", |
524 | bus->workq_name); | ||
524 | kfree(bus); | 525 | kfree(bus); |
525 | return -ENOMEM; | 526 | return -ENOMEM; |
526 | } | 527 | } |
diff --git a/sound/pci/hda/hda_codec.h b/sound/pci/hda/hda_codec.h index 5810ef588402..09a332ada0c6 100644 --- a/sound/pci/hda/hda_codec.h +++ b/sound/pci/hda/hda_codec.h | |||
@@ -614,6 +614,7 @@ struct hda_bus { | |||
614 | 614 | ||
615 | /* unsolicited event queue */ | 615 | /* unsolicited event queue */ |
616 | struct hda_bus_unsolicited *unsol; | 616 | struct hda_bus_unsolicited *unsol; |
617 | char workq_name[16]; | ||
617 | struct workqueue_struct *workq; /* common workqueue for codecs */ | 618 | struct workqueue_struct *workq; /* common workqueue for codecs */ |
618 | 619 | ||
619 | /* assigned PCMs */ | 620 | /* assigned PCMs */ |