diff options
author | Wu Fengguang <fengguang.wu@intel.com> | 2009-08-01 06:47:41 -0400 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2009-08-03 02:26:42 -0400 |
commit | cdb1fbf23181c133fb24f12ad14ccea7dc399599 (patch) | |
tree | 7bb40ad22516f51e31a8e4aa11db0facd75fd574 | |
parent | a678cdee25a387c8fc3b2754974695412baf1d85 (diff) |
ALSA: hda: take reg_lock in azx_init_cmd_io/azx_free_cmd_io
Just for safety. azx_init_cmd_io() and azx_free_cmd_io() may be
called when switching to single command mode.
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/pci/hda/hda_intel.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index ddabc827ac44..b6e6314d0069 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c | |||
@@ -513,6 +513,7 @@ static int azx_alloc_cmd_io(struct azx *chip) | |||
513 | 513 | ||
514 | static void azx_init_cmd_io(struct azx *chip) | 514 | static void azx_init_cmd_io(struct azx *chip) |
515 | { | 515 | { |
516 | spin_lock_irq(&chip->reg_lock); | ||
516 | /* CORB set up */ | 517 | /* CORB set up */ |
517 | chip->corb.addr = chip->rb.addr; | 518 | chip->corb.addr = chip->rb.addr; |
518 | chip->corb.buf = (u32 *)chip->rb.area; | 519 | chip->corb.buf = (u32 *)chip->rb.area; |
@@ -544,13 +545,16 @@ static void azx_init_cmd_io(struct azx *chip) | |||
544 | azx_writew(chip, RINTCNT, 1); | 545 | azx_writew(chip, RINTCNT, 1); |
545 | /* enable rirb dma and response irq */ | 546 | /* enable rirb dma and response irq */ |
546 | azx_writeb(chip, RIRBCTL, ICH6_RBCTL_DMA_EN | ICH6_RBCTL_IRQ_EN); | 547 | azx_writeb(chip, RIRBCTL, ICH6_RBCTL_DMA_EN | ICH6_RBCTL_IRQ_EN); |
548 | spin_unlock_irq(&chip->reg_lock); | ||
547 | } | 549 | } |
548 | 550 | ||
549 | static void azx_free_cmd_io(struct azx *chip) | 551 | static void azx_free_cmd_io(struct azx *chip) |
550 | { | 552 | { |
553 | spin_lock_irq(&chip->reg_lock); | ||
551 | /* disable ringbuffer DMAs */ | 554 | /* disable ringbuffer DMAs */ |
552 | azx_writeb(chip, RIRBCTL, 0); | 555 | azx_writeb(chip, RIRBCTL, 0); |
553 | azx_writeb(chip, CORBCTL, 0); | 556 | azx_writeb(chip, CORBCTL, 0); |
557 | spin_unlock_irq(&chip->reg_lock); | ||
554 | } | 558 | } |
555 | 559 | ||
556 | static unsigned int azx_command_addr(u32 cmd) | 560 | static unsigned int azx_command_addr(u32 cmd) |