From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lee Jones Subject: Re: [PATCH 02/11] ASoC: ab8500: Revert back to find_next_bit() Date: Fri, 20 Dec 2013 14:02:11 +0000 Message-ID: <20131220140211.GG3709@lee--X1> References: <1387468508-12286-1-git-send-email-lee.jones@linaro.org> <1387468508-12286-3-git-send-email-lee.jones@linaro.org> <20131219164824.GA16145@lee--X1> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org To: Takashi Iwai Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linus.walleij@linaro.org, broonie@kernel.org, alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org > > > > Commit '166a34d ASoC: ab8500: Fix invalid cast to long pointer' > > > > rather carelessly converts find_next_bit() to fls() (find last > > > > bit set), which are not the same. > > >=20 > > > Does it break on the real machines? > >=20 > > It does, that's how I found the bug. > >=20 > > > fls() behaves differently from find_next_bit(), of course, but in= this > > > case, it should work same in the end, since there are at most two > > > bits. > >=20 > > Unfortunately it doesn't work at all. This patch brings audio back = to > > a working state. It took me the best part of a day to track down th= e > > issue. :( >=20 > Hmm, then isn't the original code rather buggy? >=20 > Check the values set there by ffs(), fls() and the original > find_next_bit(), especially whether find_next_bit() gives a valid > value fitting with the mask bits. I wish I had the time to delve into exactly what's happening. All I can tell you is your patch broke audio and this one fixes it again. If you have time for a deep dive and produce a permanent solution I'd be much obliged and will of course test anything you send me. In the mean time, this patch should definitely be applied, as sound is crippled without it.=20 --=20 Lee Jones Linaro STMicroelectronics Landing Team Lead Linaro.org =E2=94=82 Open source software for ARM SoCs =46ollow Linaro: Facebook | Twitter | Blog