From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751098AbeAOUaf (ORCPT + 1 other); Mon, 15 Jan 2018 15:30:35 -0500 Received: from mail-qt0-f193.google.com ([209.85.216.193]:38223 "EHLO mail-qt0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750777AbeAOUad (ORCPT ); Mon, 15 Jan 2018 15:30:33 -0500 X-Google-Smtp-Source: ACJfBovwD/woSG2fG/eMslRmB4g+FvzMElUo4UvIEgc6usUuETpdR0ZRhNmBQMTJUpmYhViLWZvGbqcnudydfkeVGCg= MIME-Version: 1.0 In-Reply-To: <20180112134507.9030-1-ed.blake@sondrel.com> References: <20180112134507.9030-1-ed.blake@sondrel.com> From: Andy Shevchenko Date: Mon, 15 Jan 2018 22:30:32 +0200 Message-ID: Subject: Re: [PATCH] serial: 8250_dw: Avoid overflow in dw8250_set_termios To: Ed Blake Cc: Greg Kroah-Hartman , nunojpg@gmail.com, Linux Kernel Mailing List , linux-serial@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Fri, Jan 12, 2018 at 3:45 PM, Ed Blake wrote: > When searching for an achievable input clock rate that is within > +/-1.6% of an integer multiple of the target baudx16 rate, there is the > potential to overflow the i * rate calculations. > > For example, on a 32-bit system with a baud rate of 4000000, the > i * max_rate calculation will overflow if i reaches 67 without finding > an acceptable rate. > > Fix this by setting the upper boundary of the loop appropriately to > avoid overflow. > It seems the change broke Bluetooth on some Intel platforms. I'm not sure yet, but see here: https://github.com/Dunedan/mbp-2016-linux/issues/29#issuecomment-357583782 And for me the change is odd. Why by the way neither Heikki, nor me had been Cc'ed with the change? Perhaps I need to submit something to maintainer data base. For now I would rather revert it and give another try. -- With Best Regards, Andy Shevchenko