Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp5828819rwl; Sun, 8 Jan 2023 23:44:58 -0800 (PST) X-Google-Smtp-Source: AMrXdXu2vV344nAVK4k4o06c2ZFJKsU7ZJUtyIJgL6gpZcfELN7YjoRM7ddsVQ0JEzzl3PPBFxoO X-Received: by 2002:a17:907:8b89:b0:7c1:6f86:eeb with SMTP id tb9-20020a1709078b8900b007c16f860eebmr51621111ejc.7.1673250297978; Sun, 08 Jan 2023 23:44:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673250297; cv=none; d=google.com; s=arc-20160816; b=gTdfhxKI0B9RIV3Jth1LrmTmUPQw1s9l4KnHBJHVLbhLpIxnTaWH2SAudgkDDVlvYf ZT8EOXb728eSFWwtY8qpQ0N5vKWH5HbKuG1WEU9rTpDWRaLmN7uKCipNXF/NQyhaKfzS xpDLS+4CdGe9QCOLS141k/5vlYvJaMGugvPNNdVoeRFOvR8FbsISEdfOg8Zxfi9ewQRH NSZjeCMI11Cjugil9KXNJfR1m8HZjmc1FMC7rUUS0KQns9nk50JdkPawcK30vw3U7lws zCTndXNLd2TIiSOndUD7ajil777+PQHbQBMYDr/9xyigWzVGI/CxNmda6ZTQ0B/34kNs Ffuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=O5l50gIssWtFq3u4b8fy5kw9om6Ddg3dRlJfgWYh6a8=; b=OkSD8ORppKslU5YYjB0dL4otBK5GnWIj/2qLpcHB70KWY2MBQ3e33cyS4DE2WBHfdk QIqhXgwUjkho05SjlQRLlnnBxpgLxv3Ka9/Tp0hREKaBOh1iqac17cGsUUEl5CNZ1etA xCY/lX+/w21pyIHX1dSMrerTGMAEIKFuxEvrfwQffZjZYMBzciPHXk4Nqhryw3sZ1urD NnLQQ1dt0lURRM9bx+E7KKvjWp+9Eew/tumfCBodM64i+hLP1evDGEeGrdExILlw9Hcf o+IyZKRM/TwEry5JBlMATO65z6CM4xy236oPiDJmNMi29Mp1gNfajom8uZ+FPip/QRDM XXLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=I3zMiOBP; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nd30-20020a170907629e00b007330c08fe49si8569473ejc.206.2023.01.08.23.44.44; Sun, 08 Jan 2023 23:44:57 -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=@linuxfoundation.org header.s=korg header.b=I3zMiOBP; 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=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233505AbjAIHIQ (ORCPT + 54 others); Mon, 9 Jan 2023 02:08:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233682AbjAIHIA (ORCPT ); Mon, 9 Jan 2023 02:08:00 -0500 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5F4061157; Sun, 8 Jan 2023 23:07:59 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id C06F9CE0E95; Mon, 9 Jan 2023 07:07:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 001ACC433F0; Mon, 9 Jan 2023 07:07:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1673248075; bh=Zwa/0Kc9RycNQnqCv0qfKsVWUve+AEFePq/i81NsDEY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=I3zMiOBPFIu23E6+s5kU6iMY1QAgTfsXd/W2nB40wUjffSrgdl1xdlnUPfcdq539z sR8cX8glQzBoUdDdR87J3aQETNpL3xAOCp+ZhAcYyl19hKv9dXZgQW24Al20mZzV2a sVwtWQzw+wCf3u99Gvag9CKunlSPbaPQ2pM4SJuI= Date: Mon, 9 Jan 2023 08:07:52 +0100 From: Greg Kroah-Hartman To: Tobias Schramm Cc: Richard Genoud , Jiri Slaby , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] serial: atmel: fix incorrect baudrate setup Message-ID: References: <20230109070200.200181-1-t.schramm@manjaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230109070200.200181-1-t.schramm@manjaro.org> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, 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 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. Also, does this need to go to older/stable kernels? thanks, greg k-h