Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp5818460rwl; Sun, 8 Jan 2023 23:31:27 -0800 (PST) X-Google-Smtp-Source: AMrXdXtwIAF5eGY7XC3GzHR0UUcEyTd7hUoUpFflbDxdoUCHeJ/UBSAS5cRzz1RUxaqwpt471Y4I X-Received: by 2002:aa7:c597:0:b0:499:b53f:1c56 with SMTP id g23-20020aa7c597000000b00499b53f1c56mr2129710edq.38.1673249487491; Sun, 08 Jan 2023 23:31:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673249487; cv=none; d=google.com; s=arc-20160816; b=HdVdVoS8DiKX6gMpZV1r2PFwr7daiOzwLUCCYYXUMF3GBEsB+U/XqdOLdzE+3/eOn+ MWudn8LDT124UHD7WLvo4c74KQLp/owFinT3x8d2Ktx0+VDJ5nMEZ3zv7x2uPro3HL9R 1eNyoL6a7wyjUNa5+DCUAHKjCMNaX6WVu4T3eJmvYcjcdewZqoHxxp+YWBndekgVO6T5 DoDw+Jd3OtGwrn/k1OYcC3sBT/dlplats39eP1N/zjo7mUVmfUDJtCf6t7OkjkcJd8kA CZtZ9+LuD/ltXD9VEzxmhijSkv9/bBJMgRD/pL/UWHE7KMSVlO8aM6knew0k0kz98gYi g8ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :content-language:references:cc:to:subject:mime-version:date :dkim-signature:message-id; bh=qi7XWMTLxe25hXbTV7C8cWw5otw2UzqwTCA5OnSGc/o=; b=mpr9MbzM2+wNHZhzQP0EP86iP38v1QCwh9IVVuW1l8ocd1B2HX2uCWy8wWIxCpuBoa BlHe79D2artRrmgYX/58hpccJfoogvg4co26LheIBQeDO8AdGABgqIqyQ2guoj+JDYFt Fq14QgZoardXRc7BFr3TsPPHvtxa/4CHBN/XEs12A8Ia2S/a57Q4z5uNNcMk3IxK3X7N VrxeQhkbsELhB+tgtb+PG2Fllo1wMbpFy4LrmCXGIkaQUARWvlOzqYdQMnCqLAoHZFKP MVfoY1uzEf3gWOPDsctahJK6G4FsbTeYZG7QCa0PI3R7G0jkuTC3ldTqE4urfmTDAzRW ZljA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@manjaro.org header.s=2021 header.b=IFGV2d8O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=manjaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g10-20020a1709067c4a00b007add6be8c86si6509052ejp.762.2023.01.08.23.31.14; Sun, 08 Jan 2023 23:31:27 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@manjaro.org header.s=2021 header.b=IFGV2d8O; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=manjaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236336AbjAIHXI (ORCPT + 54 others); Mon, 9 Jan 2023 02:23:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37806 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236406AbjAIHWw (ORCPT ); Mon, 9 Jan 2023 02:22:52 -0500 Received: from mail.manjaro.org (mail.manjaro.org [IPv6:2a01:4f8:c0c:51f3::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 73A8F12767; Sun, 8 Jan 2023 23:22:48 -0800 (PST) Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=manjaro.org; s=2021; t=1673248967; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qi7XWMTLxe25hXbTV7C8cWw5otw2UzqwTCA5OnSGc/o=; b=IFGV2d8OYWAVr5WNLmQfhlTKLgFIGxz4gTkJePFN1wAInQBqCX0n0qLWoyzCGO4yzOhy+Y bt310m//7Bo5tKdMsG8tH48MISPE55ZfXiylbrOrpVAR8mYSJi6dTwVun7B79GEOheett1 b9MrEel8Lj1dCDHw05JtemGD/5PzCqsyO2Sk3Ny+En9CZByKmDs2HZQhk7LXJ9fT4NfaLA b771/cMsKUTylApcASC4EAlzKnOOHIqBYoWPglVciJS8RWcWP5NlTzJNRC4Of6dSehvbKl z1NDFQj7pua++x2Iavqxe3zEVOL8l3oKs7TRiULzarpCWWxNzw1xWWdyxyTzwQ== Date: Mon, 9 Jan 2023 08:22:36 +0100 MIME-Version: 1.0 Subject: Re: [PATCH] serial: atmel: fix incorrect baudrate setup To: Greg Kroah-Hartman Cc: Richard Genoud , Jiri Slaby , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org References: <20230109070200.200181-1-t.schramm@manjaro.org> Content-Language: en-US-large From: Tobias Schramm In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Authentication-Results: ORIGINATING; auth=pass smtp.auth=t.schramm@manjaro.org smtp.mailfrom=t.schramm@manjaro.org X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 09.01.23 um 08:07 schrieb Greg Kroah-Hartman: > On Mon, Jan 09, 2023 at 08:02:00AM +0100, Tobias Schramm wrote: >> Commit ba47f97a18f2 ("serial: core: remove baud_rates when serial console >> setup") changed uart_set_options to select the correct baudrate >> configuration based on the absolute error between requested baudrate and >> available standard baudrate settings. >> Prior to that commit the baudrate was selected based on which predefined >> standard baudrate did not exceed the requested baudrate. >> This change of selection logic was never reflected in the atmel serial >> driver. Thus the comment left in the atmel serial driver is no longer >> accurate. >> Additionally the manual rounding up described in that comment and applied >> via (quot - 1) requests an incorrect baudrate. Since uart_set_options uses >> tty_termios_encode_baud_rate to determine the appropriate baudrate flags >> this can cause baudrate selection to fail entirely because >> tty_termios_encode_baud_rate will only select a baudrate if relative error >> between requested and selected baudrate does not exceed +/-2%. >> Fix that by requesting actual, exact baudrate used by the serial. >> >> Signed-off-by: Tobias Schramm >> --- > What commit id does this fix? Please list that as a the "Fixes:" tag. Commit ba47f97a18f2 ("serial: core: remove baud_rates when serial console setup") is the one that breaks the assumptions made in the driver. I'll send a v2 and include that. > > Also, does this need to go to older/stable kernels? Yep,  this should go to older kernels as a fix, too. > > thanks, > > greg k-h