From patchwork Tue Mar 19 20:57:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Petr_=C5=A0tetiar?= X-Patchwork-Id: 1058672 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=true.cz Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="GGdl0/O0"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 44P54D3ZFSz9s55 for ; Wed, 20 Mar 2019 07:58:20 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Subject:MIME-Version:Message-Id:Date:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=C4aHuoHeef3eNwt3bmI7Gc71/ptt+vJ7/Zzuc+9ZEMg=; b=GGdl0/O0CoWYaN Lho+i9g9wdL3Y4jMiLsJqHhMhUmuAUWiM/yak32eo7vZNbYTv/qlmUKL6+YgJNC2pAhF1pdNN7ULl 5xPtVVavcYAZwhF8DkxpBfBHEQaRaNeU5H2K9HUPq6i0iXP1mxHJ0/1dGDyoUQv5vz9RZ6zahnm0w TbbmgnjzfV/hApxVYDnXD+1snY2gOgRxJ44tOLDAx38y3CtpRpF7aOxqSJ6q4xgJ/z+n9xk3C6snN k9YwrQgAKRvKyjg7c803HsABYK27PZCmPeskhYyMjI1/FwBw7feikaWgq6Nat+Ko4ZUKNsonqL8Es UIph8n8esaxXVKiv02vQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1h6LoB-0006x1-Q8; Tue, 19 Mar 2019 20:58:03 +0000 Received: from smtp-out.xnet.cz ([178.217.244.18]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1h6Lo8-0006wY-ML for openwrt-devel@lists.openwrt.org; Tue, 19 Mar 2019 20:58:02 +0000 Received: from meh.true.cz (meh.true.cz [108.61.167.218]) (Authenticated sender: petr@true.cz) by smtp-out.xnet.cz (Postfix) with ESMTPSA id 50DDC47E0; Tue, 19 Mar 2019 21:57:59 +0100 (CET) Received: by meh.true.cz (OpenSMTPD) with ESMTP id 305b0b1b; Tue, 19 Mar 2019 21:57:57 +0100 (CET) From: =?utf-8?q?Petr_=C5=A0tetiar?= To: openwrt-devel@lists.openwrt.org Date: Tue, 19 Mar 2019 21:57:56 +0100 Message-Id: <1553029076-17102-1-git-send-email-ynezz@true.cz> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190319_135801_035332_18DCBC90 X-CRM114-Status: GOOD ( 13.84 ) X-Spam-Score: 0.0 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [178.217.244.18 listed in list.dnswl.org] Subject: [OpenWrt-Devel] [PATCH] kernel: Backport ar933x_uart build fix (fixes FS#2152) X-BeenThere: openwrt-devel@lists.openwrt.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Petr_=C5=A0tetiar?= Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org Andrey has reported on OpenWrt's bug tracking system[1], that he currently can't use ar93xx_uart as pure serial UART without console (CONFIG_SERIAL_8250_CONSOLE and CONFIG_SERIAL_AR933X_CONSOLE undefined), because compilation ends with following error: ar933x_uart.c: In function 'ar933x_uart_console_write': ar933x_uart.c:550:14: error: 'struct uart_port' has no member named 'sysrq' 1. https://bugs.openwrt.org/index.php?do=details&task_id=2152 Signed-off-by: Petr Štetiar --- ...3x_uart-Fix-build-failure-with-disabled-c.patch | 99 ++++++++++++++++++++++ ...3x_uart-Fix-build-failure-with-disabled-c.patch | 99 ++++++++++++++++++++++ 2 files changed, 198 insertions(+) create mode 100644 target/linux/generic/backport-4.14/060-v5.1-serial-ar933x_uart-Fix-build-failure-with-disabled-c.patch create mode 100644 target/linux/generic/backport-4.19/060-v5.1-serial-ar933x_uart-Fix-build-failure-with-disabled-c.patch diff --git a/target/linux/generic/backport-4.14/060-v5.1-serial-ar933x_uart-Fix-build-failure-with-disabled-c.patch b/target/linux/generic/backport-4.14/060-v5.1-serial-ar933x_uart-Fix-build-failure-with-disabled-c.patch new file mode 100644 index 0000000..cb65317 --- /dev/null +++ b/target/linux/generic/backport-4.14/060-v5.1-serial-ar933x_uart-Fix-build-failure-with-disabled-c.patch @@ -0,0 +1,99 @@ +From 72ff51d8dd262d1fef25baedc2ac35116435be47 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20=C5=A0tetiar?= +Date: Wed, 6 Mar 2019 17:54:03 +0100 +Subject: [PATCH] serial: ar933x_uart: Fix build failure with disabled console +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Andrey has reported on OpenWrt's bug tracking system[1], that he +currently can't use ar93xx_uart as pure serial UART without console +(CONFIG_SERIAL_8250_CONSOLE and CONFIG_SERIAL_AR933X_CONSOLE undefined), +because compilation ends with following error: + + ar933x_uart.c: In function 'ar933x_uart_console_write': + ar933x_uart.c:550:14: error: 'struct uart_port' has no + member named 'sysrq' + +So this patch moves all the code related to console handling behind +series of CONFIG_SERIAL_AR933X_CONSOLE ifdefs. + +1. https://bugs.openwrt.org/index.php?do=details&task_id=2152 + +Cc: Greg Kroah-Hartman +Cc: Jiri Slaby +Cc: Andrey Batyiev +Reported-by: Andrey Batyiev +Tested-by: Andrey Batyiev +Signed-off-by: Petr Štetiar +Signed-off-by: Greg Kroah-Hartman +--- + drivers/tty/serial/ar933x_uart.c | 24 ++++++++---------------- + 1 file changed, 8 insertions(+), 16 deletions(-) + +diff --git a/drivers/tty/serial/ar933x_uart.c b/drivers/tty/serial/ar933x_uart.c +index db5df3d..3bdd56a 100644 +--- a/drivers/tty/serial/ar933x_uart.c ++++ b/drivers/tty/serial/ar933x_uart.c +@@ -49,11 +49,6 @@ struct ar933x_uart_port { + struct clk *clk; + }; + +-static inline bool ar933x_uart_console_enabled(void) +-{ +- return IS_ENABLED(CONFIG_SERIAL_AR933X_CONSOLE); +-} +- + static inline unsigned int ar933x_uart_read(struct ar933x_uart_port *up, + int offset) + { +@@ -508,6 +503,7 @@ static int ar933x_uart_verify_port(struct uart_port *port, + .verify_port = ar933x_uart_verify_port, + }; + ++#ifdef CONFIG_SERIAL_AR933X_CONSOLE + static struct ar933x_uart_port * + ar933x_console_ports[CONFIG_SERIAL_AR933X_NR_UARTS]; + +@@ -604,14 +600,7 @@ static int ar933x_uart_console_setup(struct console *co, char *options) + .index = -1, + .data = &ar933x_uart_driver, + }; +- +-static void ar933x_uart_add_console_port(struct ar933x_uart_port *up) +-{ +- if (!ar933x_uart_console_enabled()) +- return; +- +- ar933x_console_ports[up->port.line] = up; +-} ++#endif /* CONFIG_SERIAL_AR933X_CONSOLE */ + + static struct uart_driver ar933x_uart_driver = { + .owner = THIS_MODULE, +@@ -700,7 +689,9 @@ static int ar933x_uart_probe(struct platform_device *pdev) + baud = ar933x_uart_get_baud(port->uartclk, 0, AR933X_UART_MAX_STEP); + up->max_baud = min_t(unsigned int, baud, AR933X_UART_MAX_BAUD); + +- ar933x_uart_add_console_port(up); ++#ifdef CONFIG_SERIAL_AR933X_CONSOLE ++ ar933x_console_ports[up->port.line] = up; ++#endif + + ret = uart_add_one_port(&ar933x_uart_driver, &up->port); + if (ret) +@@ -749,8 +740,9 @@ static int __init ar933x_uart_init(void) + { + int ret; + +- if (ar933x_uart_console_enabled()) +- ar933x_uart_driver.cons = &ar933x_uart_console; ++#ifdef CONFIG_SERIAL_AR933X_CONSOLE ++ ar933x_uart_driver.cons = &ar933x_uart_console; ++#endif + + ret = uart_register_driver(&ar933x_uart_driver); + if (ret) +-- +1.9.1 + diff --git a/target/linux/generic/backport-4.19/060-v5.1-serial-ar933x_uart-Fix-build-failure-with-disabled-c.patch b/target/linux/generic/backport-4.19/060-v5.1-serial-ar933x_uart-Fix-build-failure-with-disabled-c.patch new file mode 100644 index 0000000..cb65317 --- /dev/null +++ b/target/linux/generic/backport-4.19/060-v5.1-serial-ar933x_uart-Fix-build-failure-with-disabled-c.patch @@ -0,0 +1,99 @@ +From 72ff51d8dd262d1fef25baedc2ac35116435be47 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20=C5=A0tetiar?= +Date: Wed, 6 Mar 2019 17:54:03 +0100 +Subject: [PATCH] serial: ar933x_uart: Fix build failure with disabled console +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Andrey has reported on OpenWrt's bug tracking system[1], that he +currently can't use ar93xx_uart as pure serial UART without console +(CONFIG_SERIAL_8250_CONSOLE and CONFIG_SERIAL_AR933X_CONSOLE undefined), +because compilation ends with following error: + + ar933x_uart.c: In function 'ar933x_uart_console_write': + ar933x_uart.c:550:14: error: 'struct uart_port' has no + member named 'sysrq' + +So this patch moves all the code related to console handling behind +series of CONFIG_SERIAL_AR933X_CONSOLE ifdefs. + +1. https://bugs.openwrt.org/index.php?do=details&task_id=2152 + +Cc: Greg Kroah-Hartman +Cc: Jiri Slaby +Cc: Andrey Batyiev +Reported-by: Andrey Batyiev +Tested-by: Andrey Batyiev +Signed-off-by: Petr Štetiar +Signed-off-by: Greg Kroah-Hartman +--- + drivers/tty/serial/ar933x_uart.c | 24 ++++++++---------------- + 1 file changed, 8 insertions(+), 16 deletions(-) + +diff --git a/drivers/tty/serial/ar933x_uart.c b/drivers/tty/serial/ar933x_uart.c +index db5df3d..3bdd56a 100644 +--- a/drivers/tty/serial/ar933x_uart.c ++++ b/drivers/tty/serial/ar933x_uart.c +@@ -49,11 +49,6 @@ struct ar933x_uart_port { + struct clk *clk; + }; + +-static inline bool ar933x_uart_console_enabled(void) +-{ +- return IS_ENABLED(CONFIG_SERIAL_AR933X_CONSOLE); +-} +- + static inline unsigned int ar933x_uart_read(struct ar933x_uart_port *up, + int offset) + { +@@ -508,6 +503,7 @@ static int ar933x_uart_verify_port(struct uart_port *port, + .verify_port = ar933x_uart_verify_port, + }; + ++#ifdef CONFIG_SERIAL_AR933X_CONSOLE + static struct ar933x_uart_port * + ar933x_console_ports[CONFIG_SERIAL_AR933X_NR_UARTS]; + +@@ -604,14 +600,7 @@ static int ar933x_uart_console_setup(struct console *co, char *options) + .index = -1, + .data = &ar933x_uart_driver, + }; +- +-static void ar933x_uart_add_console_port(struct ar933x_uart_port *up) +-{ +- if (!ar933x_uart_console_enabled()) +- return; +- +- ar933x_console_ports[up->port.line] = up; +-} ++#endif /* CONFIG_SERIAL_AR933X_CONSOLE */ + + static struct uart_driver ar933x_uart_driver = { + .owner = THIS_MODULE, +@@ -700,7 +689,9 @@ static int ar933x_uart_probe(struct platform_device *pdev) + baud = ar933x_uart_get_baud(port->uartclk, 0, AR933X_UART_MAX_STEP); + up->max_baud = min_t(unsigned int, baud, AR933X_UART_MAX_BAUD); + +- ar933x_uart_add_console_port(up); ++#ifdef CONFIG_SERIAL_AR933X_CONSOLE ++ ar933x_console_ports[up->port.line] = up; ++#endif + + ret = uart_add_one_port(&ar933x_uart_driver, &up->port); + if (ret) +@@ -749,8 +740,9 @@ static int __init ar933x_uart_init(void) + { + int ret; + +- if (ar933x_uart_console_enabled()) +- ar933x_uart_driver.cons = &ar933x_uart_console; ++#ifdef CONFIG_SERIAL_AR933X_CONSOLE ++ ar933x_uart_driver.cons = &ar933x_uart_console; ++#endif + + ret = uart_register_driver(&ar933x_uart_driver); + if (ret) +-- +1.9.1 +