Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp639632imm; Mon, 2 Jul 2018 19:26:23 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcEzrdvczZwXUfimOPS7A7EluQyRGPzw0xshm+qXSUXcGmGy+rBNi7lU5m5AjpMrDTuM2kL X-Received: by 2002:a17:902:18a:: with SMTP id b10-v6mr16516637plb.62.1530584783164; Mon, 02 Jul 2018 19:26:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530584783; cv=none; d=google.com; s=arc-20160816; b=bSdPlemhW31+syrUf1gpq0ooRFQkGrnKdBXbR5Fme2vggiwYCxftSW+FaL7GK//D2I dkwTRXbFEHGo+dLXm8puXiB+Z1cewtPSHxvJoaieH0nvFV/qtIcVVqXt8kcmpl+IZzkM Uey86EpNCp5EjyaxoSdB2l6cz9U/Ls4Mm2pbR/mkfafa/EOFGlq1aeNh0sISObGWe0Al 6e8aGtVPVREB0z1nxsIUXl+fGY8RAavhmfv4j2UcSDdkLqA1uArKXo3Xoi9ANM/i9tQJ LuftrTFK5u3nLCQMWaKL7hZWP36JZDSncKpsSH4ADRGfVkTLpEszb3zXbANrrAQPudG+ 0WLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature:arc-authentication-results; bh=V+1ZQEgibWUz+h9zxGjJ+Q9BQb2HVzZ0dVeTgdhnzPU=; b=iVoe1/P5bRCPK6t+rEiR+2r0EN7IXmOe/duYlcyhEZ4oFC2xFEm97LSH8VsNuV2J1c jk+BcqZYsk7fv9dvECBxcc5xSgeetBmWdAxkWc9YOvv9iHYTmTZjIxhUtnFKnvX3H3fk tYYaFXTl9xAKPhGx4I4Y1MplGbZv9KHmqtJf8IbmnQA5I6J83SISYZUXu1108O8FU3O1 WrPuY2lvDzrKnGzfnp0cvVkO5SuZBgCyIlsmz4C9vbWdkIHiJ3Nb4X9+vVAOwzNssWQ0 9sPHX0BGFB555EymQdTSMerow7ULiSv15RWzIiV+lDvHnmmgB+kcdCAtk8TvnHh1eKyP 1fRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@Synaptics.onmicrosoft.com header.s=selector1-synaptics-com header.b=v+Lu6DKl; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k3-v6si27723pld.39.2018.07.02.19.26.08; Mon, 02 Jul 2018 19:26:23 -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; dkim=pass header.i=@Synaptics.onmicrosoft.com header.s=selector1-synaptics-com header.b=v+Lu6DKl; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753852AbeGCCZW (ORCPT + 99 others); Mon, 2 Jul 2018 22:25:22 -0400 Received: from mail-dm3nam03on0069.outbound.protection.outlook.com ([104.47.41.69]:5310 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753835AbeGCCZS (ORCPT ); Mon, 2 Jul 2018 22:25:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Synaptics.onmicrosoft.com; s=selector1-synaptics-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=V+1ZQEgibWUz+h9zxGjJ+Q9BQb2HVzZ0dVeTgdhnzPU=; b=v+Lu6DKlQUcj441usm3NyUuo3T53Gu0TZ3e+Z5w4jgs752RbEdQrgcHXeRAmy480WE+KwANg3aZDARjhzp1XhyEBBmthbxpVvuL4sFOO9m0OWfzHqJ5xvw+lF4pe1w2RskZ1x5a3HxKWgju6m0I9PkEV4rSafZPMo72K1VoLyKk= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jisheng.Zhang@synaptics.com; Received: from xhacker.debian (124.74.246.114) by MWHPR03MB2640.namprd03.prod.outlook.com (2603:10b6:300:46::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.906.25; Tue, 3 Jul 2018 02:25:12 +0000 Date: Tue, 3 Jul 2018 10:22:57 +0800 From: Jisheng Zhang To: Andy Shevchenko Cc: Greg Kroah-Hartman , Jiri Slaby , , , Subject: Re: [PATCH 0/2] serial: 8250_dw: add fractional divisor support Message-ID: <20180703102257.678db6a8@xhacker.debian> In-Reply-To: <59b14f97234271a7d859fa07f27bd66ec252ccc9.camel@linux.intel.com> References: <20180702180428.331b36c5@xhacker.debian> <59b14f97234271a7d859fa07f27bd66ec252ccc9.camel@linux.intel.com> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Originating-IP: [124.74.246.114] X-ClientProxiedBy: TY2PR01CA0001.jpnprd01.prod.outlook.com (2603:1096:404:a::13) To MWHPR03MB2640.namprd03.prod.outlook.com (2603:10b6:300:46::10) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9ba2a934-37ba-47a0-6a49-08d5e08c35e3 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652040)(8989117)(5600053)(711020)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020);SRVR:MWHPR03MB2640; X-Microsoft-Exchange-Diagnostics: 1;MWHPR03M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ddFD8gWe2gO5nd3MexPrngiq0pCsrT3msnEIhq2QatMeEulfUT6KZyn9KzdJ7FWKZQ70po4JbXIwEVZAYR2wHYln9Y259W0S9YDZyd0232kcIhepisZxeV+D8B1UY+AbPBeaFLztG0nC8xSjiwFkEEoqx9E8+IFw8+0IUhuGUj2jW/3mu4FlqVE1fW9K33KxxcgvQO07Oi5aeNWV68cQ52Y0xXV7UnGlb42G3RtPCemFKCHpfbN8Td6LOZWd4bvzfTAaZARPssqb4VyrTI43aA/r9a9LqB+5y4IIX2KVvcFCxvnubvnobH7yTQ+/B4+r+bC4v+NbzRMrXIx7zo;4:PH6ck1mca/WkypnByyZxu58JqXfklthmjt8xW4E5SQUX6tKbpnewmwxCGVozhHyc8j3BuJep+f8g38mfC+KaQMnh7gGfdq7YWAdrY0mK26sLqgY9NzZ/TQCjgmZ6T3ZuHGhvoQtoU9db0+yvpIBMcJRK39wcSPUiv7M7SrmLPYUYZBc0lW82yLtv9WolefxmcQW+o4JA9xWQgrVS/accdD7gJwv5tub9WDOw9m66Fqb2u5yBesxw2RKBorm63LjUTL41SOSCdBXINCd5fU242g== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(5005006)(8121501046)(93006095)(93001095)(10201501046)(3002001)(3231254)(944501410)(52105095)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123558120)(20161123562045)(20161123564045)(6072148)(201708071742011)(7699016);SRVR:MWHPR03MB2640;BCL:0;PCL:0;RULEID:;SRVR:MWHPR03MB2640; X-Forefront-PRVS: 0722981D2A X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(396003)(136003)(346002)(376002)(366004)(39860400002)(189003)(199004)(6246003)(25786009)(486006)(105586002)(4326008)(956004)(53936002)(446003)(1076002)(305945005)(47776003)(7736002)(66066001)(8936002)(97736004)(3846002)(23726003)(6116002)(230700001)(81156014)(8676002)(81166006)(476003)(11346002)(478600001)(9686003)(72206003)(5660300001)(386003)(33896004)(54906003)(6506007)(76176011)(316002)(86362001)(52116002)(7696005)(229853002)(68736007)(50466002)(16526019)(106356001)(50226002)(55016002)(14444005)(186003)(6666003)(6916009)(2906002)(26005)(39210200001);DIR:OUT;SFP:1101;SCL:1;SRVR:MWHPR03MB2640;H:xhacker.debian;FPR:;SPF:None;LANG:en;PTR:InfoNoRecords;MX:1;A:1; Received-SPF: None (protection.outlook.com: synaptics.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;MWHPR03MB2640;23:ugfl934r3Lwwk6LAL9tCH20KwuCGTL/cTS4vH/moZ?= =?us-ascii?Q?1cTPbQV5SQKCA/7nSg1mPcWuwFLFdB5R2PvFxtm6H2eNztCoC45VNbOO4TeZ?= =?us-ascii?Q?D67GF6pKOGZVJHMHxfv/XP351pbiBmG0Pij6ul2YQ6AKkKcXMSA8mHjX/ozB?= =?us-ascii?Q?br5BkIIq9mYSBY8QJYte39sZv5tNs/NbI7n4Jxq4pPVjEyfjhbWRiLtqllxi?= =?us-ascii?Q?oqiiFqCJuw5dbXwZnRHLhiE+EpYsFCXX1XOGna5jx1B3bK+TrZzrFt9FKy5/?= =?us-ascii?Q?fzyYtA2Gw0qy30CDrEeaqlqdrKVcab4IAVdj0Jmt4Vuce/8rU/43o3NWNW94?= =?us-ascii?Q?96MhDov3RpGE41yk1R97WMMSrGf/rrOn24bbJRMiOLPCDCP4dsaSpr4pgoIn?= =?us-ascii?Q?ofmihlPQkVvbgLF6pwQlVWm5XlBpbt7MLumZSxuIj1HBQzLOvZHl2EJsHrjI?= =?us-ascii?Q?BnViEvv2dRoXFxP8jY9T6XRPiglrf6WGvWC/E0FEwLgbSYD1dM+leCMqTA7h?= =?us-ascii?Q?DUCl/FXBLngFKreYxcn3XRGJZd7oPTptcugdwCkE2GriGlV8eyv3m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SQWcgfWBqMfWZGkM/Mr80OnKGFvRgFUoHDhZBl8m6NwiR7wYoLrss6QU4uGdS20GDpRtsAddstCEINKMnXLH/zuLlpv7zcXg79tarbHGHsDtPECQz01bCWJE/h148axgE7iWMcEK/4drlftykNZOCu8Rw2jbIeTYA6un59EIcUx8/L416eJ5T0+jZSnk+oifeT8BpyB6z9WKBal7Q24YvbUw= X-Microsoft-Exchange-Diagnostics: 1;MWHPR03MB2640;6:xdlKMPB4kKJKUnTy6HXCOE/F9gPZ+WlwEs1/ZSV1LZ68dtXJ06YoUp+4M4z+2XVtAL1IV5TwyWb//b/yDb8h6PG5+p2VZYrBCchN5Ngkouq1asuCq9z5MTFctWv+t+oa616XDUY/aBBd/ox61Txm1UtrbKc5SyT6fVKFqfSQ6my3aoJRrTUvG6EkrRYQKQN0cpuuSaKLiHN7xrii6sL51DALakZz8v9zAtqf+EtJpa73QGfJo7Rplr5v4J3wn0a8wOvzs/clrC/AGkR8SCfCveoNFAfYYOgR6DVJPPaaHtgVlEWO8gyN5loncmQyBv8ICvWfa/OXpakHF4mouOsPzEYo+/qrC+CTPHXzDHBSPPdbW2UcNx+oxnxat0lpBStq9j8PMl33CZtdEZLWVtsu94AaTsb/a63livhXcbumUFxWd8zHJKcDZeWEfBQX9fOT62SP3gMTxPD9R97GjD2tlg==;5:xq0uk+A0/M2oaWxdMQzXwmR5lv5984V8A9LKgm0JGh7Zj0tFgjSWeqvzLd1vowA+otMviRsuLuVebOxZHdzcXKtffcAOPjJtjHMcmc4vfG0jLxbMntl4Ueo8farV00aH3ZbUY+cUhbIgkc7stpakepeNfZqSRfnjGgP3rotY9Og=;24:FEKKRb2y0jihMg9zr7PVsLpb6e/Wm7wLCOuCAIpHCkl96oYidP2BuuYy6OvuyC+VuQp1HUkAswnM+DDBzvUXJdph/2JYBYWW/n1rg0s6nVE= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;MWHPR03MB2640;7:TbgJZwXWsjRKQ/4emLsixVmdbJQR/MRukQ6m2taTmL3bp4lFYOlUTBTdOXW4riFbb4l8sqZz0hiOefRPS/IuXTYYXXp1p29YzWMAXajIC6aeGqq0L1pl7M5DhkOe8XA2843L0iFrjtlcwmkihyXRNLQC1tWv1uWcXoSwaQerip4mkpJa31dE2jM4Tgo2tuaZj7b7ZJ7LhPzEmiIUoY4bXd8kgM0Y2rSGZJfOzjDyHKvXhRZFcXfoK+fp/TIJu/bc X-OriginatorOrg: synaptics.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Jul 2018 02:25:12.8867 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9ba2a934-37ba-47a0-6a49-08d5e08c35e3 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335d1fbc-2124-4173-9863-17e7051a2a0e X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR03MB2640 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 2.add a new serial8250_set_divisor which will be as simple as static void serial8250_set_divisor(struct uart_port *port, ...) { struct uart_8250_port *up = up_to_u8250p(port); if (up->set_divisor) up->set_divisor(...); else serial8250_do_set_divisor(...); } could you please confirm? 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, sure, adding the hook to struct uart_port is fine either. Could you please kindly give some suggestions? Thanks, Jisheng