From: Wu Fengguang <fengguang.wu@intel.com>
To: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org, Jaroslav Kysela <jkysela@redhat.com>
Subject: [PATCH] hda: read CORBWP inside reg_lock
Date: Sat, 1 Aug 2009 18:48:12 +0800 [thread overview]
Message-ID: <20090801104812.GB4012@localhost> (raw)
In-Reply-To: <20090801104516.GA3741@localhost>
This converts the last CORBWP access outside of reg_lock.
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
---
sound/pci/hda/hda_intel.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
--- sound-2.6.orig/sound/pci/hda/hda_intel.c
+++ sound-2.6/sound/pci/hda/hda_intel.c
@@ -595,15 +595,17 @@ static int azx_corb_send_cmd(struct hda_
unsigned int addr = azx_command_addr(val);
unsigned int wp;
+ spin_lock_irq(&chip->reg_lock);
+
/* add command to corb */
wp = azx_readb(chip, CORBWP);
wp++;
wp %= ICH6_MAX_CORB_ENTRIES;
- spin_lock_irq(&chip->reg_lock);
chip->rirb.cmds[addr]++;
chip->corb.buf[wp] = cpu_to_le32(val);
azx_writel(chip, CORBWP, wp);
+
spin_unlock_irq(&chip->reg_lock);
return 0;
next prev parent reply other threads:[~2009-08-01 10:48 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-08-01 10:45 [RFC][PATCH] hda: track CIRB/CORB command/response states for each codec Wu Fengguang
2009-08-01 10:46 ` [PATCH] hda: take cmd_mutex in probe_codec() Wu Fengguang
2009-08-01 10:47 ` [PATCH] hda: take reg_lock in azx_init_cmd_io/azx_free_cmd_io Wu Fengguang
2009-08-01 10:48 ` Wu Fengguang [this message]
2009-08-01 11:17 ` [PATCH] hda: remember last command for each codec Wu Fengguang
2009-08-01 11:18 ` [PATCH] hda: warn on spurious response Wu Fengguang
2009-08-03 6:50 ` [RFC][PATCH] hda: track CIRB/CORB command/response states for each codec Takashi Iwai
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=20090801104812.GB4012@localhost \
--to=fengguang.wu@intel.com \
--cc=alsa-devel@alsa-project.org \
--cc=jkysela@redhat.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox