All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wei Xu <xuwei5@hisilicon.com>
To: Jan Beulich <jbeulich@suse.com>, Julien Grall <julien@xen.org>
Cc: Stefano Stabellini <sstabellini@kernel.org>, 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>,
	"Zengtao \(B\)" <prime.zeng@hisilicon.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: [Xen-devel] [PATCH v4] ns16550: Add ACPI support for ARM only
Date: Mon, 24 Feb 2020 09:06:44 +0800	[thread overview]
Message-ID: <5E5321A4.4080408@hisilicon.com> (raw)
In-Reply-To: <63a33275-3aca-3bb1-3028-c890e1474d07@suse.com>

Hi Jan,

On 2020/2/21 23:07, Jan Beulich wrote:
> On 21.02.2020 15:57, Julien Grall wrote:
>> On 21/02/2020 14:02, Jan Beulich wrote:
>>> On 21.02.2020 03:22, Wei Xu wrote:
>>>> --- a/xen/drivers/char/ns16550.c
>>>> +++ b/xen/drivers/char/ns16550.c
>>>> @@ -1620,6 +1620,85 @@ DT_DEVICE_START(ns16550, "NS16550 UART", DEVICE_SERIAL)
>>>>   DT_DEVICE_END
>>>>
>>>>   #endif /* HAS_DEVICE_TREE */
>>>> +
>>>> +#if defined(CONFIG_ACPI) && defined(CONFIG_ARM)
>>>> +#include <xen/acpi.h>
>>>> +
>>>> +static int __init ns16550_acpi_uart_init(const void *data)
>>>> +{
>>>> +    struct acpi_table_header *table;
>>>> +    struct acpi_table_spcr *spcr;
>>>> +    acpi_status status;
>>>> +    /*
>>>> +     * Same as the DT part.
>>>> +     * Only support one UART on ARM which happen to be ns16550_com[0].
>>>> +     */
>>>> +    struct ns16550 *uart = &ns16550_com[0];
>>>> +
>>>> +    status = acpi_get_table(ACPI_SIG_SPCR, 0, &table);
>>>> +    if ( ACPI_FAILURE(status) )
>>>> +    {
>>>> +        printk("ns16550: Failed to get SPCR table\n");
>>>> +        return -EINVAL;
>>>> +    }
>>>> +
>>>> +    spcr = container_of(table, struct acpi_table_spcr, header);
>>>> +
>>>> +    /*
>>>> +     * The serial port address may be 0 for example
>>>> +     * if the console redirection is disabled.
>>>> +     */
>>>> +    if ( unlikely(!spcr->serial_port.address) )
>>>> +    {
>>>> +        printk("ns16550: Console redirection is disabled\n");
>>>> +        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;
>>>> +    }
>>>
>>> The space_id field qualifies the address one, i.e. whether a value of
>>> zero can sensibly mean "disabled" depends on the address space. Hence
>>> logically the address space check should come first.
>>>
>>> This is the last thing I'd like to see changed. I won't give the
>>> patch my ack though, as I think it should be an Arm maintainer to ack
>>> it.
>>
>> Acked-by: Julien Grall <julien@xen.org>
>>
>> Although, a reviewed-by tag from you would be nice as you did most of 
>> the review for this patch.
> 
> Well, to clarify - this is one of the very few (afaict) cases where our
> R-b implying A-b (when people are entitled to ack the respective code)
> gets in the way. If this wasn't the case, I'd have given the former,
> making it clear (also later from just looking at the resulting commit)
> that the (only) ack came from an Arm person.

I will check the address space in the v5 and add your R-b.
Thanks!

Best Regards,
Wei

> 
> Jan
> 
> .
> 


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

  reply	other threads:[~2020-02-24  1:07 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-21  2:22 [Xen-devel] [PATCH v4] ns16550: Add ACPI support for ARM only Wei Xu
2020-02-21 14:02 ` Jan Beulich
2020-02-21 14:57   ` Julien Grall
2020-02-21 15:07     ` Jan Beulich
2020-02-24  1:06       ` Wei Xu [this message]
2020-02-25 12:25         ` Jan Beulich
2020-02-26  0:40           ` Wei Xu
2020-02-24  1:04     ` 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=5E5321A4.4080408@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.