From: Wei Xu <xuwei5@hisilicon.com>
To: Julien Grall <julien@xen.org>,
"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: Stefano Stabellini <sstabellini@kernel.org>,
"Zengtao \(B\)" <prime.zeng@hisilicon.com>, Wei Liu <wl@xen.org>,
Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
George Dunlap <George.Dunlap@eu.citrix.com>,
Andrew Cooper <andrew.cooper3@citrix.com>,
Ian Jackson <ian.jackson@eu.citrix.com>,
Linuxarm <linuxarm@huawei.com>,
Shameerali Kolothum Thodi <shameerali.kolothum.thodi@huawei.com>,
Jan Beulich <jbeulich@suse.com>
Subject: Re: [Xen-devel] [PATCH] ns16550: Re-order the serial port address checking
Date: Tue, 25 Feb 2020 08:33:47 +0800 [thread overview]
Message-ID: <5E546B6B.70906@hisilicon.com> (raw)
In-Reply-To: <8bb7d100-0ca4-c0f9-b294-f2e7a173e1c9@xen.org>
Hi Julien,
On 2020/2/25 6:03, Julien Grall wrote:
> Hi Wei,
>
> Thank you for sending a follow-up.
>
> On 24/02/2020 11:30, Wei Xu wrote:
>> Check the serial port address space before checking the address.
>
> Could you explain in a sentence why you want to re-order?
Do you think is it OK to explain as following:
The serial port address space ID qualifies the address.
Whether a value of zero for the serial port address can sensibly
mean "disabled" depends on the address space ID. Hence check the
address space ID before checking the address.
Thanks!
Best Regards,
Wei
>
> Cheers,
>
>>
>> Signed-off-by: Wei Xu <xuwei5@hisilicon.com>
>> ---
>> xen/drivers/char/ns16550.c | 12 ++++++------
>> 1 file changed, 6 insertions(+), 6 deletions(-)
>>
>> diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c
>> index dc8ac4c..425e044 100644
>> --- a/xen/drivers/char/ns16550.c
>> +++ b/xen/drivers/char/ns16550.c
>> @@ -1644,6 +1644,12 @@ static int __init ns16550_acpi_uart_init(const void *data)
>>
>> spcr = container_of(table, struct acpi_table_spcr, header);
>>
>> + if ( unlikely(spcr->serial_port.space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY) )
>> + {
>> + printk("ns16550: Address space type is not mmio\n");
>> + return -EINVAL;
>> + }
>> +
>> /*
>> * The serial port address may be 0 for example
>> * if the console redirection is disabled.
>> @@ -1654,12 +1660,6 @@ static int __init ns16550_acpi_uart_init(const void *data)
>> return -EINVAL;
>> }
>>
>> - if ( unlikely(spcr->serial_port.space_id != ACPI_ADR_SPACE_SYSTEM_MEMORY) )
>> - {
>> - printk("ns16550: Address space type is not mmio\n");
>> - return -EINVAL;
>> - }
>> -
>> ns16550_init_common(uart);
>>
>> /*
>>
>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel
next prev parent reply other threads:[~2020-02-25 0:34 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-24 11:30 [Xen-devel] [PATCH] ns16550: Re-order the serial port address checking Wei Xu
2020-02-24 22:03 ` Julien Grall
2020-02-25 0:33 ` Wei Xu [this message]
2020-02-25 13:10 ` Jan Beulich
2020-02-26 0:41 ` Wei Xu
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=5E546B6B.70906@hisilicon.com \
--to=xuwei5@hisilicon.com \
--cc=George.Dunlap@eu.citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=jbeulich@suse.com \
--cc=julien@xen.org \
--cc=konrad.wilk@oracle.com \
--cc=linuxarm@huawei.com \
--cc=prime.zeng@hisilicon.com \
--cc=shameerali.kolothum.thodi@huawei.com \
--cc=sstabellini@kernel.org \
--cc=wl@xen.org \
--cc=xen-devel@lists.xenproject.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.