Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2615512imu; Mon, 19 Nov 2018 03:29:13 -0800 (PST) X-Google-Smtp-Source: AJdET5fFUZebGb6sckkhoQZShMWBU0MbzGLv4bwtziPeuEi++gfdQ37zfT0zGOfebl5edluXyW/5 X-Received: by 2002:a65:65c9:: with SMTP id y9mr20273285pgv.438.1542626953229; Mon, 19 Nov 2018 03:29:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542626953; cv=none; d=google.com; s=arc-20160816; b=TBc3zj/HjNHRXfo0GoWyfEtbnaHnYrXrWV8XZL9fCtEgivYlNIhJ3aHiEO73ctnzlB E/lPpp/P4aDsCa/dwaqgHACoXQkklXc4FVVPMh7chActX6Yw6BPM8KMybHaBYib3lCLY DkYHVj7y8gErJbxPed8a/9/IhfE0jOWEiyOVnH59Macc80YqhvxTc38eoGj4GBWGtilM CrNG4mdsLZd6ufvHAeLbAILvrxgSTBCDixWhvZyRnb//IuZ7xTIPSQ6RYb+8EKiWeDSU QNBQ/VT5CxQtQNPqTIj1YLYz0df+Ald27PwOUqaD6Wzzpus20HmSB3CFtIekscaYDAdT er8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=nym7slM7z1nFS6+rLE9SlIQ07BeRqsziPuQZyqIwJnA=; b=ehw3RnGh4HpmMcG2STAkMYrrG8YNWIBxPIW1cqjWDF7dahhBpg6VzOveF06Ee72E9d 3UXWfMBS++Ss/UGuzFSskbemklS25DXtafbkWrSLaz/x1jrTEGpbddAvPIJfkaul+60J Cu35grdihdDkajawvmxhlsrQAV7zXYdDps+/CAiCz8s3fKkMdr9X8iplJJFZ114Dguh9 2lYOjngtsi1UesELVFQb5dXcOLQ4ptc5R4NTp+Fej4JP92jqTR9udk4LczAPWCBsuwxC reOpEUnTq8HqJJFD0ESeON06NNbdVAC8/V10+zO3LodQj0Z1wXdl9/pt/jcD3o47k5vM 6J4A== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@plaes.org header.s=mail header.b=nViARzlu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o27si39342388pgl.53.2018.11.19.03.28.58; Mon, 19 Nov 2018 03:29:13 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@plaes.org header.s=mail header.b=nViARzlu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728666AbeKSVvU (ORCPT + 99 others); Mon, 19 Nov 2018 16:51:20 -0500 Received: from plaes.org ([188.166.43.21]:46110 "EHLO plaes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728518AbeKSVvT (ORCPT ); Mon, 19 Nov 2018 16:51:19 -0500 Received: from plaes.org (localhost [127.0.0.1]) by plaes.org (Postfix) with ESMTPSA id 0657640282; Mon, 19 Nov 2018 11:27:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=plaes.org; s=mail; t=1542626877; bh=BejDCY+wpAWZKpndQTQdd4pESffLH2SRwnk73Phj/5U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=nViARzlumL2PEk3r29cMAyeGtzrQMOkn3O4/N21+sWrnIUTftIqQ8td7gbBwhuRIp V4xUXGJl5BVhcYBAtZpm2H6jHc31rLxdEv4mvRElwc0k4YdzFA4DuDHIsqyUG2BLkM 7hTyUTVIOUCRvhkqNB4vUVVZ+nLMHg31ISscq4ZX7+m/LXlfIpjWUAL5SoJbOzS7Y/ ERyQVHo92j5yj1Merbf7WOVkV1/gtT3nB0HgwhAB14pkuhdx2hDcc7dAjbJnSMj7ht ZT8c28X2VPSihfMQfHK95c7a6wA1dcY1f7xCc42X5Z1Ug8a9BjiueEyNw+XKOm/FVw QJg7+QRlGkDFw== Date: Mon, 19 Nov 2018 11:27:55 +0000 From: Priit Laes To: Larry Finger Cc: Kees Cook , Jia-Ju Bai , Kalle Valo , "Gustavo A. R. Silva" , Colin Ian King , Arend van Spriel , Varsha Rao , linux-wireless@vger.kernel.org, b43-dev@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 3/3] b43: Use cordic algorithm from kernel library Message-ID: <20181119112755.qtthenx54v3tnok3@plaes.org> References: <20181118082327.ttrz2nl5owi2hoqv@plaes.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Nov 18, 2018 at 01:35:57PM -0600, Larry Finger wrote: > On 11/18/18 2:23 AM, Priit Laes wrote: > > On Sat, Nov 17, 2018 at 09:31:35PM -0600, Larry Finger wrote: > > > On 11/14/18 12:27 PM, Priit Laes wrote: > > > > Kernel library has a common cordic algorithm which is identical > > > > to internally implementatd one, so use it and drop the duplicate > > > > implementation. > > > > > > My test setup has a hardware failure, thus I cannot test your patch, but I > now believe it to be correct. Thus your first and third patches may be > annotated with > ACKed-by: Larry Finger > > One thing that should be done is to fix the error in the b43 code for stable > as it was introduced in 2.6.34. I propose adding the attached patched to > your series placed between your current 2nd and 3rd patches so that the old > kernels get fixed. Of course, your 3rd patch will need to be revised. If all > 4 of the patches get submitted together there will be no problems with the > timing. My change will exist for seconds in the mainline kernel, but it will > get propagated back through stable. Thanks! > From b42ae73ef7505de93e4c66fb9f66930e3f3d969a Mon Sep 17 00:00:00 2001 > From: Larry Finger > Date: Sun, 18 Nov 2018 13:15:07 -0600 > Subject: [PATCH] b43: Fix error in cordic routine > MIME-Version: 1.0 > Content-Type: text/plain; charset=UTF-8 > Content-Transfer-Encoding: 8bit > To: kvalo@codeaurora.org > Cc: linux-wireless@vger.kernel.org > > The cordic routine for calculating sines and cosines that was added in > commit 986504540306 ("b43: make cordic common (LP-PHY and N-PHY need it)") > contains an error whereby a quantity declared u32 can in fact go negative. It seems to be different commit though: commit 6f98e62a9 ("b43: update cordic code to match current specs") > This problem was detected by Priit Laes who is switching b43 to use the > routine in the library functions of the kernel. > > Fixes: 986504540306 ("b43: make cordic common (LP-PHY and N-PHY need it)") > Reported-by: Priit Laes > Cc: Rafa?? Mi??ecki > Cc: Stable # 2.6.34 > Signed-off-by: Larry Finger > --- > drivers/net/wireless/broadcom/b43/phy_common.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/wireless/broadcom/b43/phy_common.c b/drivers/net/wireless/broadcom/b43/phy_common.c > index 85f2ca989565..ef3ffa5ad466 100644 > --- a/drivers/net/wireless/broadcom/b43/phy_common.c > +++ b/drivers/net/wireless/broadcom/b43/phy_common.c > @@ -616,7 +616,7 @@ struct b43_c32 b43_cordic(int theta) > u8 i; > s32 tmp; > s8 signx = 1; > - u32 angle = 0; > + s32 angle = 0; > struct b43_c32 ret = { .i = 39797, .q = 0, }; > > while (theta > (180 << 16)) > -- > 2.16.4 >