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: 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@huawei.com, shameerali.kolothum.thodi@huawei.com,
	prime.zeng@hisilicon.com, xen-devel@lists.xenproject.org
Subject: Re: [Xen-devel] [PATCH] ns16550: Add ACPI support
Date: Tue, 21 Jan 2020 11:28:49 +0800	[thread overview]
Message-ID: <5E266FF1.2060805@hisilicon.com> (raw)
In-Reply-To: <6d658434-0dfd-24bb-9b84-8ae365e1feac@suse.com>

Hi Jan, Julien,

On 2020/1/20 16:38, Jan Beulich wrote:
> On 18.01.2020 13:32, Julien Grall wrote:
>> On 17/01/2020 08:33, Jan Beulich wrote:
>>> On 17.01.2020 04:40, Wei Xu wrote:
>>>> --- a/xen/drivers/char/ns16550.c
>>>> +++ b/xen/drivers/char/ns16550.c
>>>> @@ -1620,6 +1620,61 @@ DT_DEVICE_START(ns16550, "NS16550 UART", DEVICE_SERIAL)
>>>>    DT_DEVICE_END
>>>>    
>>>>    #endif /* HAS_DEVICE_TREE */
>>>> +
>>>> +#ifdef CONFIG_ACPI
>>>> +#include <xen/acpi.h>
>>>> +
>>>> +static int __init ns16550_acpi_uart_init(const void *data)
>>>> +{
>>>> +    struct acpi_table_spcr *spcr = NULL;
>>>> +    acpi_status status;
>>>> +    struct ns16550 *uart;
>>>> +
>>>> +    status = acpi_get_table(ACPI_SIG_SPCR, 0,
>>>> +                            (struct acpi_table_header **)&spcr);
>>>> +
>>>> +    if ( ACPI_FAILURE(status) )
>>>> +    {
>>>> +        printk("ns16550: Failed to get SPCR table\n");
>>>> +        return -EINVAL;
>>>> +    }
>>>> +
>>>> +    uart = &ns16550_com[0];
>>> You want to justify the choice of what (on x86 at least= we'd call
>>> com1 in the patch description. Also this could be the initializer
>>> of the variable.
>> This is the same choice as we made for the DT binding (see
>> ns16550_uart()). We only support one UART on Arm which happen to be
>> ns16550_com[0] (but named diferrently).
>>
>> The code below is actually quite similar to the DT parsing, so maybe we
>> want to provide a common helper here.
> That's all fine, but doesn't eliminate the need to say so in the
> description.
>
>>>> +    /*  Register with generic serial driver. */
>>>> +    serial_register_uart(uart - ns16550_com, &ns16550_driver, uart);
>>>> +
>>>> +    return 0;
>>>> +}
>>>> +
>>>> +ACPI_DEVICE_START(ans16550, "NS16550 UART", DEVICE_SERIAL)
>>>> +    .class_type = ACPI_DBG2_16550_COMPATIBLE,
>>>> +    .init = ns16550_acpi_uart_init,
>>>> +ACPI_DEVICE_END
>>> I don't expect this to build on x86.
>> This is only meant to target Arm. So maybe we want to protect the whole
>> code with defined(CONFIG_ACPI) && defined(CONFIG_ARM).
> Indeed, that's what the remark was aiming at.
>
> Jan
>
> .
>

Thanks!
I will address the comments in V2.

Best Regards,
Wei



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

      reply	other threads:[~2020-01-21  3:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-17  3:40 [Xen-devel] [PATCH] ns16550: Add ACPI support Wei Xu
2020-01-17  8:33 ` Jan Beulich
2020-01-18 12:32   ` Julien Grall
2020-01-20  8:38     ` Jan Beulich
2020-01-21  3:28       ` Wei Xu [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=5E266FF1.2060805@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.