Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2597820lqz; Wed, 3 Apr 2024 03:01:11 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUISut/9OilgWvUIeWjpKtmgvk/1LOA2M5Ac5dKdvPhiz1zezqra1i15+Rkpb+SaPTDCxJLErQaz7ylHap6Hr848TczpEHRDCAKktoLdA== X-Google-Smtp-Source: AGHT+IEsbIXHYNUKy7dDSYx+JQaq8FeRNHYfstHhbbbgmpuVyYUyJKnjs/vZi3PWHWGQ4qrrVp+M X-Received: by 2002:ac5:cb08:0:b0:4d0:36e3:40c3 with SMTP id r8-20020ac5cb08000000b004d036e340c3mr10299267vkl.13.1712138470996; Wed, 03 Apr 2024 03:01:10 -0700 (PDT) Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id em12-20020a056122380c00b004d41dd5031esi1907759vkb.263.2024.04.03.03.01.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 03 Apr 2024 03:01:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-129469-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@intel.com header.s=Intel header.b="Qfl3/8Iw"; arc=fail (body hash mismatch); spf=pass (google.com: domain of linux-kernel+bounces-129469-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-129469-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id B030F1C25B39 for ; Wed, 3 Apr 2024 10:01:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0A328135A46; Wed, 3 Apr 2024 10:01:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Qfl3/8Iw" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.16]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 985D1134CD4; Wed, 3 Apr 2024 10:01:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712138463; cv=none; b=dXXiGJ7CT0oSUDHgj3mQFk9CImzb1qasNiS8oM++JVpI/Lcp1RHIyBQZN7xVKC4gUr1v+Rayfn5SE9PsFDzYrJTGm+WrKvqul0ygL6JBsbABInfn1V1rOtBzIhZUcZrFZkqDWMmzbeRecqV2t0hY/iP7L2uQaQuNtmoaW+meVAQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712138463; c=relaxed/simple; bh=v2WLwND+C3+F4xObkTQOEyrUO8eg3Ifk/UecczhzRQE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=F84f42tSwFu3uk4BUoq7jr6b2/16C+9a0+/+SPu3PLj51YrpUkiD/i0cIHAuJy8N/+9ULKPKh5hs+n4dWGGH0Uhk8uzjn8tFtHRUz/jAVYh886fDlBadyt7lZMtrsmVokkLSO2ixFY+J92QuciENel+EzcBaOzm5YdfgbkTIMKQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Qfl3/8Iw; arc=none smtp.client-ip=198.175.65.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1712138461; x=1743674461; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=v2WLwND+C3+F4xObkTQOEyrUO8eg3Ifk/UecczhzRQE=; b=Qfl3/8IwqDiTabaECD6XRqlHSxxdyTa9HDorZi7w1sLpisYAp7DJoidi rH1gvDZ5BDe3PonOA6Or1Tb3RIuQs2Yp3hDrNlIPOaKs7zxzxAB8iyJ+x USrcZ0ii7EM+ICampd+7P3uM9uE8QykMIuyV8KrB+uK+k5ulqBZEYDIPF kJMGLDWxCjrlnMjA2hHB0wZzpnBpIgVvX3bYf3R/uUWOWUUFkzOYYgqHB /joq9V/qSkenLzYO0RAneSNccBH7PgOb5GhJ8drZt9dqqDIVAok189pCk CvEINzJIbzaGn8ZEW9+uJgDC7mX1jft09mgvUKJeWAMl5hJCLdrmm1QDj g==; X-CSE-ConnectionGUID: bqoUeFrdS7W9qLp+DcDVgA== X-CSE-MsgGUID: DEFo5Q62QumpDhM6n6341w== X-IronPort-AV: E=McAfee;i="6600,9927,11032"; a="7485036" X-IronPort-AV: E=Sophos;i="6.07,177,1708416000"; d="scan'208";a="7485036" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orvoesa108.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Apr 2024 03:00:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,11032"; a="915177057" X-IronPort-AV: E=Sophos;i="6.07,177,1708416000"; d="scan'208";a="915177057" Received: from smile.fi.intel.com (HELO smile) ([10.237.72.54]) by fmsmga002.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Apr 2024 03:00:44 -0700 Received: from andy by smile with local (Exim 4.97) (envelope-from ) id 1rrxQA-000000015CA-1Iup; Wed, 03 Apr 2024 13:00:42 +0300 Date: Wed, 3 Apr 2024 13:00:42 +0300 From: Andy Shevchenko To: Guanbing Huang Cc: gregkh@linuxfoundation.org, rafael.j.wysocki@intel.com, linux-acpi@vger.kernel.org, tony@atomide.com, john.ogness@linutronix.de, yangyicong@hisilicon.com, jirislaby@kernel.org, linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, lvjianmin@loongson.cn, albanhuang@tencent.com, tombinfan@tencent.com Subject: Re: [PATCH v4 3/3] serial: 8250_pnp: Support configurable reg shift property Message-ID: References: <20240403074130.93811-1-albanhuang@outlook.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo On Wed, Apr 03, 2024 at 03:41:30PM +0800, Guanbing Huang wrote: > From: Guanbing Huang > > The 16550a serial port based on the ACPI table requires obtaining the > reg-shift attribute. In the ACPI scenario, If the reg-shift property > is not configured like in DTS, the 16550a serial driver cannot read or > write controller registers properly during initialization. .. > uart.port.mapbase = pnp_mem_start(dev, 0); > + uart.port.mapsize = pnp_mem_end(dev, 0) - pnp_mem_start(dev, 0); pnp_mem_len() .. Add a comment here to explain that /* * The previous call may not set iotype correctly when reg-io-width * property is absent and it doesn't support IO port resource. */ > + uart.port.iotype = iotype; > uart.port.flags |= UPF_SKIP_TEST | UPF_BOOT_AUTOCONF; > if (pnp_irq_flags(dev, 0) & IORESOURCE_IRQ_SHAREABLE) > uart.port.flags |= UPF_SHARE_IRQ; > - uart.port.uartclk = 1843200; > - device_property_read_u32(&dev->dev, "clock-frequency", &uart.port.uartclk); > - uart.port.dev = &dev->dev; > + else > + uart.port.flags &= ~UPF_SHARE_IRQ; This is not needed, just move uart.port.flags |= UPF_SKIP_TEST | UPF_BOOT_AUTOCONF; to be before uart_read_properties(). -- With Best Regards, Andy Shevchenko