Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp1161112ybt; Wed, 1 Jul 2020 21:12:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxk80qdR86kg01HARgvjnSBPp2nu8iyFsJJaXU1k4LUgBjyDpbiaUNkpRq+zIwpOrwfgD2c X-Received: by 2002:a17:906:1751:: with SMTP id d17mr9470162eje.140.1593663147289; Wed, 01 Jul 2020 21:12:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593663147; cv=none; d=google.com; s=arc-20160816; b=lvkCDtywyAnJJ1QeXmVhyh7QDVx+A2k/2kG2yI4SO56pBPaF6NelbIu8s0pBQxjV+0 BPCp0rOQMoiDPjb48m7puidYg1Asy3bsNMV9iu1gU2iNrQIXHAXCLlgxVlbQux7FFQKw /2B8Y+04xmX6HU80F8N4y6NQ45hExWANAh7UHbm1imAPsz6a8o5I7LxZwTcP3woR1OD0 3ldI9PkNOP8JbQyErY5XHNBXQyOJdT7gO8BpMQIItStURnHe4PxBdJP/uNRTT1ioYpTb VfSItXTu6EXwMz4Iga1u4442oSoqJ1JEDZ236hGj/ZgA581OrWXxkvjDpbUqe5sk1L+b j++Q== 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; bh=yl79Jecx+erY3hhTc7G6OdJsBYsVXr3SMCrpJGa54L0=; b=0JKlbYA1/vEeyGnCb071RUaMG7mSR54cUZKkvtm/VZgTQg/n/z7hMepmQPtwHi+ue5 4Kk7cx5FDLDgvsj2E2MuLGZVXzVtyjWJclC/VBPHAQSgMxtINv/mwlYCAnHrbzo4+8RT 8kcvQvX0j6QNflGweVhky4pAwJY3thQepcd0F7DHN1iANAneaUHbXT0hbSwFqI04RFKY qeHRViUwEsDcMdYQ3/lIuehVxc7iRQZXjL3CRpD6Y8Br+ea7unhYEael2XgwtzIMC61L NXhhRj6K5KAxndIi3IpejN3lcukkaUYaHMoK3ueZ21ZAjIUEi/OraAXLSTAef/OM+Tho hdIQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v10si5025976edy.595.2020.07.01.21.12.04; Wed, 01 Jul 2020 21:12:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726273AbgGBEL4 (ORCPT + 99 others); Thu, 2 Jul 2020 00:11:56 -0400 Received: from bmailout1.hostsharing.net ([83.223.95.100]:45731 "EHLO bmailout1.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725857AbgGBEL4 (ORCPT ); Thu, 2 Jul 2020 00:11:56 -0400 Received: from h08.hostsharing.net (h08.hostsharing.net [IPv6:2a01:37:1000::53df:5f1c:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.hostsharing.net", Issuer "COMODO RSA Domain Validation Secure Server CA" (not verified)) by bmailout1.hostsharing.net (Postfix) with ESMTPS id 07030300011B9; Thu, 2 Jul 2020 06:11:53 +0200 (CEST) Received: by h08.hostsharing.net (Postfix, from userid 100393) id BC3492ED3E2; Thu, 2 Jul 2020 06:11:52 +0200 (CEST) Date: Thu, 2 Jul 2020 06:11:52 +0200 From: Lukas Wunner To: Serge Semin Cc: Daniel Winkler , Serge Semin , linux-serial@vger.kernel.org, linux-mediatek@lists.infradead.org, Alexey Malahov , BlueZ , chromeos-bluetooth-upstreaming , stable@vger.kernel.org, abhishekpandit@chromium.org, Aaron Sierra , Andy Shevchenko , Greg Kroah-Hartman , Jiri Slaby , Vignesh Raghavendra , linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 0/1] Revert "serial: 8250: Fix max baud limit in generic 8250 port" Message-ID: <20200702041152.e5csvbodojzwnagx@wunner.de> References: <20200701211337.3027448-1-danielwinkler@google.com> <20200701223713.gavale4aramu3xnb@mobilestation> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200701223713.gavale4aramu3xnb@mobilestation> 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 Thu, Jul 02, 2020 at 01:37:13AM +0300, Serge Semin wrote: > 1) Add a new capability like UART_CAP_NO16DIV and take it into account > in the serial8250_get_baud_rate() method. > > I don't have a documentation for the Mediatek UART port, but it seems to me > that that controller calculates the baud rate differently from the standard > 8250 port. A standard 8250 port does that by the next formulae: > baud = uartclk / (16 * divisor). > While it seems to me that the Mediatek port uses the formulae like: > baud = uartclk / divisor. (Please, correct me if I'm wrong) 8250_bcm2835aux.c seems to suffer from a similar issue and solves it like this in the ->probe hook: /* the HW-clock divider for bcm2835aux is 8, * but 8250 expects a divider of 16, * so we have to multiply the actual clock by 2 * to get identical baudrates. */ up.port.uartclk = clk_get_rate(data->clk) * 2; > 2) Manually call serial8250_do_set_divisor() in the custom set_termios() > callback. > > Just add the uart_update_timeout() and serial8250_do_set_divisor() methods > invocation into the mtk8250_set_termios() function, which the original commit > 81bb549fdf14 ("serial: 8250_mtk: support big baud rate") author should have > done in the first place. That sound preferable as adding new quirks into core code feels like a case of midlayer fallacy: https://blog.ffwll.ch/2016/12/midlayers-once-more-with-feeling.html Thanks, Lukas