Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1126301imm; Tue, 3 Jul 2018 06:04:28 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcCLQOqtJ+zzsWSMmcpXijiPoMna6+ceHoHC3AYgcn2NiN/RuOG61LtewhFzZjsd0PVFvzd X-Received: by 2002:a63:db05:: with SMTP id e5-v6mr16403821pgg.152.1530623068269; Tue, 03 Jul 2018 06:04:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530623068; cv=none; d=google.com; s=arc-20160816; b=SApZ5224KDsPkhQ6VGDDtd2tK2eX46P2zkpurst3MOb+4lXPD4g6F88Y3OsptphvLb GVEIuzHWOvUnALryIb/OCjH9jZdP+EV0EvRIGhofMuAMrtkdUEd0Jb35chNu4pbDbzFB +wRGHe47RWvpaiGvm4NCs3qAb668qxex1N61bwbpoP51DYy3g1DWZXlZ86/lG6aFuQZW qUgJfLNkWXRNdnZTGc8j9Y8FFlV90nSscNTAFsEqOYxHI8af8BiVPkleHEVOd36E/9Zy BfqhkZq1xpbHkYX8+OmP5oeoG2f7Q7GgzvjcNtVQW7y3OiS13TpSggN6m5yWIHoOH4i2 2oOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:date:cc:to:from:subject :message-id:arc-authentication-results; bh=HoMJbMOFofaovIG/9tIlavLp2foGMT3W1GlVdjt33Kc=; b=1J2GGdy0wmr18lVOKyJHuA5zYCAtRG2OZ06jNAPH6ylYjWsmG8M6ar/RnV+c3aThob 67R+KPzRbOY2V5CdYiJOVxTnzssAY394t9G98dCC1JmXcx6wW2Tbi/Ps8WY3XdtvOj7O XI8/Cuh9fP67EVl+eexV83XoU+Oe1u3l3hjD/05nywxTH0QZTeGI3BItHHC1PSoDQslE EQyctHv265FH9j9nFh5CPruNUVXsUQ631czwzWqQiJFv9ZTSwM4qBr8SLjackIHvLgqy vMWbUWRZDxCSfE/GAoLbRAFWdQAKVVdCo9TgHbZIgnLcI3l1AUeqrWm3BDrlvf1BiK+d 9SFA== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t1-v6si1177638plj.334.2018.07.03.06.04.07; Tue, 03 Jul 2018 06:04:28 -0700 (PDT) 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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753346AbeGCNDF (ORCPT + 99 others); Tue, 3 Jul 2018 09:03:05 -0400 Received: from mga11.intel.com ([192.55.52.93]:7805 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752494AbeGCNDD (ORCPT ); Tue, 3 Jul 2018 09:03:03 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Jul 2018 06:03:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,303,1526367600"; d="scan'208";a="53741311" Received: from smile.fi.intel.com (HELO smile) ([10.237.72.86]) by orsmga007.jf.intel.com with ESMTP; 03 Jul 2018 06:02:58 -0700 Message-ID: Subject: Re: [PATCH 0/2] serial: 8250_dw: add fractional divisor support From: Andy Shevchenko To: Jisheng Zhang Cc: Greg Kroah-Hartman , Jiri Slaby , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Date: Tue, 03 Jul 2018 16:02:57 +0300 In-Reply-To: <20180703102257.678db6a8@xhacker.debian> References: <20180702180428.331b36c5@xhacker.debian> <59b14f97234271a7d859fa07f27bd66ec252ccc9.camel@linux.intel.com> <20180703102257.678db6a8@xhacker.debian> Organization: Intel Finland Oy Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.1-2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2018-07-03 at 10:22 +0800, Jisheng Zhang wrote: > Hi, > > On Mon, 2 Jul 2018 14:51:03 +0300 Andy Shevchenko wrote: > > > On Mon, 2018-07-02 at 13:18 +0300, Andy Shevchenko wrote: > > > On Mon, 2018-07-02 at 18:04 +0800, Jisheng Zhang wrote: > > > > For Synopsys DesignWare 8250 uart which version >= 4.00a, > > > > there's a > > > > valid divisor latch fraction register. The fractional divisor > > > > width > > > > is > > > > 4bits ~ 6bits. > > > > > > > > > > There are several serial IPs that have fractional divider built- > > > in. > > > None > > > is using any specific hooks. Why do you need in your case, esp. > > > taking > > > into consideration that we have a custom ->set_termios() > > > callback? > > > > Okay, I see that in 8250 we have hooks embedded into 8250_port.c > > which > > is not the best solution. > > > > For example it prevents better splitting Exar code. > > So, we would need these hooks, but better to integrate them in the > > same > > way like it's done for the rest of 8250 ones, i.e. > > - rename existing to have a "do" word > > - create new functions which would be a replacement that choose > > between > > "do" variant and custom one > > - not sure if we need to export "do" variants (at least for now) > > So you mean add the support as following: > > 1.rename current serial8250_set_divisor as serial8250_do_set_divisor > Yes > 2.add a new serial8250_set_divisor which will be as simple as Yes and no. > > static void serial8250_set_divisor(struct uart_port *port, ...) > { > struct uart_8250_port *up = up_to_u8250p(port); > > if (up->set_divisor) port-> > up->set_divisor(...); port-> > else > serial8250_do_set_divisor(...); > } > > could you please confirm? Yes. > > Another issue is I'm not sure which struct to add the hook, > struct uart_port or struct uart_8250_port? Currently, it seems that > only > uart_8250_port needs this hook, Define "needs". 8250 _uses_ it, the rest which I easy grepped would be able to use it if we provide such a possibility. lantiq.c is one example (currently they don't use it), or drivers/tty/serial/digicolor-usart.c limits baud rate choice b/c of absence of a common way. > sure, adding the hook to struct uart_port > is fine either. Could you please kindly give some suggestions? See above. Thanks for doing this! > > Thanks, > Jisheng -- Andy Shevchenko Intel Finland Oy