public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@intel.com>
To: Guanbing Huang <albanhuang@outlook.com>
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
Date: Wed, 3 Apr 2024 13:00:42 +0300	[thread overview]
Message-ID: <Zg0oyldGmxbNnSLI@smile.fi.intel.com> (raw)
In-Reply-To: <PSAPR06MB495296BC1D96B42A60F7C230C93D2@PSAPR06MB4952.apcprd06.prod.outlook.com>

On Wed, Apr 03, 2024 at 03:41:30PM +0800, Guanbing Huang wrote:
> From: Guanbing Huang <albanhuang@tencent.com>
> 
> 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



      reply	other threads:[~2024-04-03 10:01 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20240403074130.93811-1-albanhuang@outlook.com>
2024-04-03  7:41 ` [PATCH v4 1/3] pnp: Add dev_is_pnp() macro Guanbing Huang
2024-04-03  9:54   ` Andy Shevchenko
2024-04-03  7:41 ` [PATCH v4 2/3] serial: 8250_port: Add support of pnp irq to __uart_read_properties() Guanbing Huang
2024-04-03  9:54   ` Andy Shevchenko
2024-04-03 10:06     ` Andy Shevchenko
2024-04-03  7:41 ` [PATCH v4 3/3] serial: 8250_pnp: Support configurable reg shift property Guanbing Huang
2024-04-03 10:00   ` Andy Shevchenko [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Zg0oyldGmxbNnSLI@smile.fi.intel.com \
    --to=andriy.shevchenko@intel.com \
    --cc=albanhuang@outlook.com \
    --cc=albanhuang@tencent.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jirislaby@kernel.org \
    --cc=john.ogness@linutronix.de \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=lvjianmin@loongson.cn \
    --cc=rafael.j.wysocki@intel.com \
    --cc=tombinfan@tencent.com \
    --cc=tony@atomide.com \
    --cc=yangyicong@hisilicon.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox