From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 63F41C56202 for ; Wed, 25 Nov 2020 21:29:11 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id DC979206E0 for ; Wed, 25 Nov 2020 21:29:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="assL+3Yi" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DC979206E0 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from list by lists.xenproject.org with outflank-mailman.38095.70732 (Exim 4.92) (envelope-from ) id 1ki2LQ-0003FL-15; Wed, 25 Nov 2020 21:28:56 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 38095.70732; Wed, 25 Nov 2020 21:28:56 +0000 X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ki2LP-0003FE-TP; Wed, 25 Nov 2020 21:28:55 +0000 Received: by outflank-mailman (input) for mailman id 38095; Wed, 25 Nov 2020 21:28:55 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ki2LP-0003F9-1D for xen-devel@lists.xenproject.org; Wed, 25 Nov 2020 21:28:55 +0000 Received: from mail.kernel.org (unknown [198.145.29.99]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 3685e01e-1c47-4abd-af2b-fb4066cce531; Wed, 25 Nov 2020 21:28:54 +0000 (UTC) Received: from sstabellini-ThinkPad-T480s (c-24-130-65-46.hsd1.ca.comcast.net [24.130.65.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B92BB206E0; Wed, 25 Nov 2020 21:28:52 +0000 (UTC) Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1ki2LP-0003F9-1D for xen-devel@lists.xenproject.org; Wed, 25 Nov 2020 21:28:55 +0000 X-Inumbo-ID: 3685e01e-1c47-4abd-af2b-fb4066cce531 Received: from mail.kernel.org (unknown [198.145.29.99]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 3685e01e-1c47-4abd-af2b-fb4066cce531; Wed, 25 Nov 2020 21:28:54 +0000 (UTC) Received: from sstabellini-ThinkPad-T480s (c-24-130-65-46.hsd1.ca.comcast.net [24.130.65.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B92BB206E0; Wed, 25 Nov 2020 21:28:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1606339733; bh=/Ysq6Vgj8EHb6KbamRFC3s2zGugtlI2n/1OSkfSGZ4s=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=assL+3Yi9bO8B9zPGFItUVzzA3j7agW0Ou5XWfof4AaTtUtIvxWYn1uufWfdVF5d9 gKdS2rwKLJpNQPRKwhREY4n4/yNHEVDy4zykMGkmP70Fa1e9GnzmqYwnaTsbMu51o8 +sjJCCxKBQvUvTFiZfpXj9y8WN9FbAeXUNnwCzwU= Date: Wed, 25 Nov 2020 13:28:51 -0800 (PST) From: Stefano Stabellini X-X-Sender: sstabellini@sstabellini-ThinkPad-T480s To: Rahul Singh cc: xen-devel@lists.xenproject.org, bertrand.marquis@arm.com, Andrew Cooper , George Dunlap , Ian Jackson , Jan Beulich , Julien Grall , Stefano Stabellini , Wei Liu Subject: Re: [PATCH v4 3/3] ns16550: Gate all PCI code with CONFIG_X86 In-Reply-To: <6d64bb35a6ce247faaa3df2ebae27b6bfa1d969e.1606326929.git.rahul.singh@arm.com> Message-ID: References: <6d64bb35a6ce247faaa3df2ebae27b6bfa1d969e.1606326929.git.rahul.singh@arm.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="8323329-250076586-1606339733=:7979" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-250076586-1606339733=:7979 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT On Wed, 25 Nov 2020, Rahul Singh wrote: > The NS16550 driver is assuming that NS16550 PCI card are usable if the > architecture supports PCI (i.e. CONFIG_HAS_PCI=y). However, the code is > very x86 focus and will fail to build on Arm (/!\ it is not all the > errors): > > ns16550.c: In function ‘ns16550_init_irq’: > ns16550.c:726:21: error: implicit declaration of function ‘create_irq’; > did you mean ‘release_irq’? [-Werror=implicit-function-declaration] > uart->irq = create_irq(0, false); > ^~~~~~~~~~ > release_irq > ns16550.c:726:21: error: nested extern declaration of ‘create_irq’ > [-Werror=nested-externs] > ns16550.c: In function ‘ns16550_init_postirq’: > ns16550.c:768:33: error: ‘mmio_ro_ranges’ undeclared (first use in this > function); did you mean ‘mmio_handler’? > rangeset_add_range(mmio_ro_ranges, uart->io_base, > ^~~~~~~~~~~~~~ > mmio_handler > ns16550.c:768:33: note: each undeclared identifier is reported only once > for each function it appears in > ns16550.c:780:20: error: variable ‘msi’ has initializer but incomplete > type > struct msi_info msi = { > ^~~~~~~~ > > Enabling support for NS16550 PCI card on Arm would require more plumbing > in addition to fixing the compilation error. > > Arm systems tend to have platform UART available such as NS16550, PL011. > So there are limited reasons to get NS16550 PCI support for now on Arm. > > Guard all remaining PCI code that is not under x86 flag with CONFIG_X86. > > No functional change intended. > > Signed-off-by: Rahul Singh Acked-by: Stefano Stabellini > --- > > Changes in v4: > - As per the discussion guard all remaining PCI code with CONFIG_X86 > > --- > xen/drivers/char/ns16550.c | 16 ++++++++-------- > 1 file changed, 8 insertions(+), 8 deletions(-) > > diff --git a/xen/drivers/char/ns16550.c b/xen/drivers/char/ns16550.c > index 9235d854fe..26e601857a 100644 > --- a/xen/drivers/char/ns16550.c > +++ b/xen/drivers/char/ns16550.c > @@ -16,7 +16,7 @@ > #include > #include > #include > -#ifdef CONFIG_HAS_PCI > +#if defined(CONFIG_X86) && defined(CONFIG_HAS_PCI) > #include > #include > #include > @@ -51,7 +51,7 @@ static struct ns16550 { > unsigned int timeout_ms; > bool_t intr_works; > bool_t dw_usr_bsy; > -#ifdef CONFIG_HAS_PCI > +#if defined(CONFIG_X86) && defined(CONFIG_HAS_PCI) > /* PCI card parameters. */ > bool_t pb_bdf_enable; /* if =1, pb-bdf effective, port behind bridge */ > bool_t ps_bdf_enable; /* if =1, ps_bdf effective, port on pci card */ > @@ -66,7 +66,7 @@ static struct ns16550 { > #endif > } ns16550_com[2] = { { 0 } }; > > -#ifdef CONFIG_HAS_PCI > +#if defined(CONFIG_X86) && defined(CONFIG_HAS_PCI) > struct ns16550_config { > u16 vendor_id; > u16 dev_id; > @@ -256,7 +256,7 @@ static int ns16550_getc(struct serial_port *port, char *pc) > > static void pci_serial_early_init(struct ns16550 *uart) > { > -#ifdef CONFIG_HAS_PCI > +#if defined(CONFIG_X86) && defined(CONFIG_HAS_PCI) > if ( !uart->ps_bdf_enable || uart->io_base >= 0x10000 ) > return; > > @@ -355,7 +355,7 @@ static void __init ns16550_init_preirq(struct serial_port *port) > > static void __init ns16550_init_irq(struct serial_port *port) > { > -#ifdef CONFIG_HAS_PCI > +#if defined(CONFIG_X86) && defined(CONFIG_HAS_PCI) > struct ns16550 *uart = port->uart; > > if ( uart->msi ) > @@ -397,7 +397,7 @@ static void __init ns16550_init_postirq(struct serial_port *port) > uart->timeout_ms = max_t( > unsigned int, 1, (bits * uart->fifo_size * 1000) / uart->baud); > > -#ifdef CONFIG_HAS_PCI > +#if defined(CONFIG_X86) && defined(CONFIG_HAS_PCI) > if ( uart->bar || uart->ps_bdf_enable ) > { > if ( uart->param && uart->param->mmio && > @@ -477,7 +477,7 @@ static void ns16550_suspend(struct serial_port *port) > > stop_timer(&uart->timer); > > -#ifdef CONFIG_HAS_PCI > +#if defined(CONFIG_X86) && defined(CONFIG_HAS_PCI) > if ( uart->bar ) > uart->cr = pci_conf_read16(PCI_SBDF(0, uart->ps_bdf[0], uart->ps_bdf[1], > uart->ps_bdf[2]), PCI_COMMAND); > @@ -486,7 +486,7 @@ static void ns16550_suspend(struct serial_port *port) > > static void _ns16550_resume(struct serial_port *port) > { > -#ifdef CONFIG_HAS_PCI > +#if defined(CONFIG_X86) && defined(CONFIG_HAS_PCI) > struct ns16550 *uart = port->uart; > > if ( uart->bar ) > -- > 2.17.1 > --8323329-250076586-1606339733=:7979--