Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp2699711rdb; Mon, 4 Dec 2023 05:20:27 -0800 (PST) X-Google-Smtp-Source: AGHT+IFaLXjEuUwTFpbYKmGfM06SW75IP1an1Zw2fm/Tz8TMhJIL7Uiznpj76fG3fAvqKlLRONUC X-Received: by 2002:a05:6a20:3d84:b0:18c:41cd:c74d with SMTP id s4-20020a056a203d8400b0018c41cdc74dmr25022577pzi.5.1701696026647; Mon, 04 Dec 2023 05:20:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701696026; cv=none; d=google.com; s=arc-20160816; b=gA1N5R5Eax/3QHknlZYdaxzfTUTwUjPlUMwTPdiqxaNiOO9BKgGUqf39jrUjgAyNyl Lf1IRyBF8QXGLB4ZKgsA5NLlgG07IQYH9en4xhoR9qAOvFUzoHhRawkvkpd6A/UL9OqR jBAs6VGeckOAGmSc4Rw99fuEb6CdzAtFpO14IS3yXSCgVDCOpi9/x50UI3QFEEUSqmKU jRZHimanwZEUQ3dNpiRbOcn//Updcjvo/uCmp5SptnfCQ8Khl4rR61HsaAxnlSJQnjwU cPKBx4onw5RbBId5Bp4Q6zKDRwVDwOUcrc+Xs3Mg5JQz7KSk5GLi2+LxoQwAu0WIn4wP H1mQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date:dkim-signature; bh=hESIu9RkhhcsxKghNo3LyHvq9w7lBDhr8ZR81Wq5K/w=; fh=JEplg3XoZ6T6Wf+HY0RK8VeaANuXjFfC3/kFEg0eOkg=; b=svviuvZ8zS/oectE+pT6u3+a20bIToHdgU9Hepzb1MmyAhh5ol0PjjCjluiXuTpWrv C41AMK6l+ekTa+JE9OCqCV1dSgvMyHH36yEpfQTg77e09Y7II3YXzHmG8pqY8fVvBwMH Sexum/GLehqzDTELJseFdxAtiIcG2G/okBfOup5C4QZ4Uf/2x9qXWM2ifmHnootzYQcr dW1kc+m5sXMcua7r/di2IrwaSxk37Td5s6t5xY7FbJRSmE/u+TbY884aE7Tx1K5L6Jrl Mnkb49CZSs9kvn/AyX+E03xa2UNvqRqjLHXGLmGpi7kpVASNPLpLKW2mBOVpFcG7pljf y+DQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Q8auie4n; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id f12-20020a631f0c000000b005c67dd98afesi2548961pgf.211.2023.12.04.05.20.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Dec 2023 05:20:26 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Q8auie4n; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 700468090F95; Mon, 4 Dec 2023 05:20:25 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233696AbjLDNUJ (ORCPT + 99 others); Mon, 4 Dec 2023 08:20:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233171AbjLDNUI (ORCPT ); Mon, 4 Dec 2023 08:20:08 -0500 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A7AFA1; Mon, 4 Dec 2023 05:20:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1701696015; x=1733232015; h=date:from:to:cc:subject:in-reply-to:message-id: references:mime-version; bh=4NPXnux+c7mfmuxeW1NdbPlpm/f/3Pww4CWNNGCbIWw=; b=Q8auie4nwj65b8xzmnA7s6ko+WGC/N2slbZg3Rl0xiM2XhFFDyBZZXUF Ip/1yz5WFIyp6Af5j3TIqBAzxa8gu49sM10h16+yaUKmlhrQDciY+j8jh fQVtWOUbjIPv93g2ZRhcsaLzbxPWTEAbCv1Fz/p/1bpkfPzLMr5XqiXZ4 JFCjxcz1kec9lOXqsqUIJ75VFftcOo3BuQGc8b4h86vaTN7oeCiBsiGne 2t6NklBRbV0NHrAMZk1flo+leysn4rMkUBPmordLb0FulMMUCoQB0ykWI DPi1mMH5B1zzdAfzKczTKsJ1NLd+DHf5zHauXpesbRlwGVBLjcf3+M7ph g==; X-IronPort-AV: E=McAfee;i="6600,9927,10913"; a="396535976" X-IronPort-AV: E=Sophos;i="6.04,249,1695711600"; d="scan'208";a="396535976" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2023 05:20:14 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10913"; a="770534305" X-IronPort-AV: E=Sophos;i="6.04,249,1695711600"; d="scan'208";a="770534305" Received: from malladhi-mobl.gar.corp.intel.com ([10.249.34.28]) by orsmga002-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2023 05:20:12 -0800 Date: Mon, 4 Dec 2023 15:20:09 +0200 (EET) From: =?ISO-8859-15?Q?Ilpo_J=E4rvinen?= To: Dawei Li cc: Greg Kroah-Hartman , Andy Shevchenko , Jiri Slaby , jszhang@kernel.org, LKML , linux-serial , set_pte_at@outlook.com, stable@kernel.org Subject: Re: [PATCH] serial: dw8250: Make DLF feature independent of ADDITIONAL_FEATURE In-Reply-To: <20231204130820.2823688-1-dawei.li@shingroup.cn> Message-ID: <48f6fcce-4b5-a7c0-2fc0-989b9a2fba8@linux.intel.com> References: <20231204130820.2823688-1-dawei.li@shingroup.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Mon, 04 Dec 2023 05:20:25 -0800 (PST) On Mon, 4 Dec 2023, Dawei Li wrote: > DW apb uart databook defines couples of configuration parameters of > dw8250 IP, among which there are 2 of them: > - ADDTIONAL_FEATURE > " Configure the peripheral to have the option to include FIFO status > registers, shadow registers and encoded parameter register. Also > configures the peripheral to have UART component version and the > peripheral ID registers. " > > - FRACTIONAL_BAUD_DIVISOR_EN > " Configures the peripheral to have Fractional Baud Rate Divisor. > .... " > > These two parameters are completely irrelevant, and supposed to be > independent of each other. However, in current dw8250 driver > implementation, they are hooked together. > > The bug was hit when we are bringing up dw8250 IP on our hardware > platform, in which parameters are configured in such combination: > - ADDTIONAL_FEATURE disabled; > - FRACTIONAL_BAUD_DIVISOR_EN enabled; > > Fixes: 701c5e73b296 ("serial: 8250_dw: add fractional divisor support") > Cc: stable@kernel.org > Signed-off-by: Dawei Li > --- > drivers/tty/serial/8250/8250_dwlib.c | 22 +++++++++++----------- > 1 file changed, 11 insertions(+), 11 deletions(-) > > diff --git a/drivers/tty/serial/8250/8250_dwlib.c b/drivers/tty/serial/8250/8250_dwlib.c > index 84843e204a5e..136ad093c5b6 100644 > --- a/drivers/tty/serial/8250/8250_dwlib.c > +++ b/drivers/tty/serial/8250/8250_dwlib.c > @@ -259,17 +259,6 @@ void dw8250_setup_port(struct uart_port *p) > } > up->capabilities |= UART_CAP_NOTEMT; > > - /* > - * If the Component Version Register returns zero, we know that > - * ADDITIONAL_FEATURES are not enabled. No need to go any further. > - */ > - reg = dw8250_readl_ext(p, DW_UART_UCV); > - if (!reg) > - return; > - > - dev_dbg(p->dev, "Designware UART version %c.%c%c\n", > - (reg >> 24) & 0xff, (reg >> 16) & 0xff, (reg >> 8) & 0xff); > - > /* Preserve value written by firmware or bootloader */ > old_dlf = dw8250_readl_ext(p, DW_UART_DLF); > dw8250_writel_ext(p, DW_UART_DLF, ~0U); > @@ -282,6 +271,17 @@ void dw8250_setup_port(struct uart_port *p) > p->set_divisor = dw8250_set_divisor; > } > > + /* > + * If the Component Version Register returns zero, we know that > + * ADDITIONAL_FEATURES are not enabled. No need to go any further. > + */ > + reg = dw8250_readl_ext(p, DW_UART_UCV); > + if (!reg) > + return; > + > + dev_dbg(p->dev, "Designware UART version %c.%c%c\n", > + (reg >> 24) & 0xff, (reg >> 16) & 0xff, (reg >> 8) & 0xff); > + > reg = dw8250_readl_ext(p, DW_UART_CPR); > if (!reg) { > reg = data->pdata->cpr_val; > The very same code change is already in tty-next (from another author). -- i.