Re: ac97 maintenance

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2006-06-12 at 20:44 +0100, Jaroslav Kysela wrote:
> On Wed, 6 Dec 2006, Randy Cushman wrote:
> 
> > I also have posted a patch, and I am testing another.
> > 
> > The impression I've gotten from reading bugtracker postings is that 
> > Takashi Iwai might be the person to accept our patches.  He/she is
on 
> > vacation, according to a message posted last week.
> 
> Please, post your patches to this mailing list for review or try 
> ALSA BTS again (there was a smtp setup problem, but it should be ok
now).
> We have more than one developer accepting patches.
> 
>                                       Thanks,
>                                               Jaroslav
> 
Ok, yeah, my login failed ten minutes ago, but it's working now. Thanks
to whoever fixed that.

Here's my patch again, in case the old post got lost somehow:

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Summary: trivial fix for bit update functions.

This patch fixes a couple of bit update functions in
alsa-kernel/pci/ac97/ac97_codec.c, which could possibly corrupt bits not
in the given mask.

Specifically, it'll clobber unset bits in the target that are not in the
mask, when the corresponding bit in the given new value is set.

Signed-off-by: James C Georgas <jgeorgas@xxxxxxxxxx>

diff -r bc7ef767d0cf pci/ac97/ac97_codec.c
--- a/pci/ac97/ac97_codec.c     Wed Nov 29 15:29:40 2006 +0100
+++ b/pci/ac97/ac97_codec.c     Fri Dec  1 02:04:30 2006 -0500
@@ -389,7 +389,7 @@ int snd_ac97_update_bits_nolock(struct s
        unsigned short old, new;

        old = snd_ac97_read_cache(ac97, reg);
-       new = (old & ~mask) | value;
+       new = (old & ~mask) | (value & mask);
        change = old != new;
        if (change) {
                ac97->regs[reg] = new;
@@ -406,7 +406,7 @@ static int snd_ac97_ad18xx_update_pcm_bi

        mutex_lock(&ac97->page_mutex);
        old = ac97->spec.ad18xx.pcmreg[codec];
-       new = (old & ~mask) | value;
+       new = (old & ~mask) | (value & mask);
        change = old != new;
        if (change) {
                mutex_lock(&ac97->reg_mutex);


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Alsa-devel mailing list
Alsa-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-devel

[Index of Archives]     [ALSA User]     [Linux Audio Users]     [Kernel Archive]     [Asterisk PBX]     [Photo Sharing]     [Linux Sound]     [Video 4 Linux]     [Gimp]     [Yosemite News]

  Powered by Linux