* Re: [PATCH 53/61] tty: serial: simplify getting .drvdata
From: Uwe Kleine-König @ 2018-04-19 16:23 UTC (permalink / raw)
To: Wolfram Sang
Cc: linux-kernel, linux-renesas-soc, kernel-janitors,
Greg Kroah-Hartman, Jiri Slaby, Patrice Chotard, Michal Simek,
linux-serial, linux-arm-kernel
In-Reply-To: <20180419140641.27926-54-wsa+renesas@sang-engineering.com>
Hello Wolfram,
On Thu, Apr 19, 2018 at 04:06:23PM +0200, Wolfram Sang wrote:
> We should get drvdata from struct device directly. Going via
> platform_device is an unneeded step back and forth.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> ---
>
> Build tested only. buildbot is happy. Please apply individually.
>
> drivers/tty/serial/imx.c | 18 ++++++------------
for serial/imx.c:
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Thanks Wolfram for going through this
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply
* Re: [PATCH v3] serial: imx: warn user when using unsupported configuration
From: Uwe Kleine-König @ 2018-04-19 16:26 UTC (permalink / raw)
To: Stefan Agner; +Cc: gregkh, lukas, jslaby, linux-serial, linux-kernel
In-Reply-To: <20180419153916.21898-1-stefan@agner.ch>
Hello Stefan,
On Thu, Apr 19, 2018 at 05:39:16PM +0200, Stefan Agner wrote:
> When using half-duplex mode (which disables receiver during txing)
> the RTS signal cannot be driven low during transmission when using
> i.MX UART RTS/CTS control. This seems to be a limitation of the
> i.MX UART IP: The RTS (CTS_B) signal is controlled by the receiver.
> When the receiver is disabled, the signal stays in UART logic idle
> state which is high...
>
> If SER_RS485_RTS_ON_SEND is used, RTS needs to be high active during
> transmission. Since this is the default state of the RTS (CTS_B)
> signal when the receiver is off, half-duplex mode in this
> configuration works fine.
>
> However, a low-active RTS signal (flag SER_RS485_RTS_ON_SEND not set)
> cannot be generated when the receiver is turned off.
>
> Print an error if the user selects this unsupported configuration
> (both SER_RS485_RTS_ON_SEND and SER_RS485_RX_DURING_TX unset) and
> configure the closest working configuration (set the
> SER_RS485_RX_DURING_TX flag).
>
> Signed-off-by: Stefan Agner <stefan@agner.ch>
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Thanks
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply
* Re: [PATCH v3 15/20] net: Remove depends on HAS_DMA in case of platform dependency
From: Kalle Valo @ 2018-04-19 16:41 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Ulf Hansson, Wolfram Sang, linux-iio, linux-wireless, linux-fpga,
linux-remoteproc, alsa-devel, Bjorn Andersson, Eric Anholt,
netdev, linux-mtd, linux-i2c, linux1394-devel, Christoph Hellwig,
Marek Szyprowski, Stefan Wahren, Boris Brezillon, Herbert Xu,
Richard Weinberger, Joerg Roedel, Jassi Brar, Marek Vasut,
linux-serial, Matias Bjorling, David Woodhouse
In-Reply-To: <1523987360-18760-16-git-send-email-geert@linux-m68k.org>
(adding linux-wireless)
Geert Uytterhoeven <geert@linux-m68k.org> writes:
> Remove dependencies on HAS_DMA where a Kconfig symbol depends on another
> symbol that implies HAS_DMA, and, optionally, on "|| COMPILE_TEST".
> In most cases this other symbol is an architecture or platform specific
> symbol, or PCI.
>
> Generic symbols and drivers without platform dependencies keep their
> dependencies on HAS_DMA, to prevent compiling subsystems or drivers that
> cannot work anyway.
>
> This simplifies the dependencies, and allows to improve compile-testing.
>
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
> Reviewed-by: Mark Brown <broonie@kernel.org>
> Acked-by: Robin Murphy <robin.murphy@arm.com>
> ---
> v3:
> - Rebase to v4.17-rc1,
> - Drop obsolete note about FSL_FMAN,
>
> v2:
> - Add Reviewed-by, Acked-by,
> - Drop RFC state,
> - Split per subsystem.
> ---
> drivers/net/ethernet/amd/Kconfig | 2 +-
> drivers/net/ethernet/apm/xgene-v2/Kconfig | 1 -
> drivers/net/ethernet/apm/xgene/Kconfig | 1 -
> drivers/net/ethernet/arc/Kconfig | 6 ++++--
> drivers/net/ethernet/broadcom/Kconfig | 2 --
> drivers/net/ethernet/calxeda/Kconfig | 2 +-
> drivers/net/ethernet/hisilicon/Kconfig | 2 +-
> drivers/net/ethernet/marvell/Kconfig | 8 +++-----
> drivers/net/ethernet/mellanox/mlxsw/Kconfig | 2 +-
> drivers/net/ethernet/renesas/Kconfig | 2 --
> drivers/net/wireless/broadcom/brcm80211/Kconfig | 1 -
> drivers/net/wireless/quantenna/qtnfmac/Kconfig | 2 +-
> 12 files changed, 12 insertions(+), 19 deletions(-)
For wireless:
Acked-by: Kalle Valo <kvalo@codeaurora.org>
Leaving the hunks for linux-wireless list to see:
> diff --git a/drivers/net/wireless/broadcom/brcm80211/Kconfig b/drivers/net/wireless/broadcom/brcm80211/Kconfig
> index 9d99eb42d9176f0f..6acba67bca07abd7 100644
> --- a/drivers/net/wireless/broadcom/brcm80211/Kconfig
> +++ b/drivers/net/wireless/broadcom/brcm80211/Kconfig
> @@ -60,7 +60,6 @@ config BRCMFMAC_PCIE
> bool "PCIE bus interface support for FullMAC driver"
> depends on BRCMFMAC
> depends on PCI
> - depends on HAS_DMA
> select BRCMFMAC_PROTO_MSGBUF
> select FW_LOADER
> ---help---
> diff --git a/drivers/net/wireless/quantenna/qtnfmac/Kconfig b/drivers/net/wireless/quantenna/qtnfmac/Kconfig
> index 025fa6018550895a..8d1492a90bd135c0 100644
> --- a/drivers/net/wireless/quantenna/qtnfmac/Kconfig
> +++ b/drivers/net/wireless/quantenna/qtnfmac/Kconfig
> @@ -7,7 +7,7 @@ config QTNFMAC
> config QTNFMAC_PEARL_PCIE
> tristate "Quantenna QSR10g PCIe support"
> default n
> - depends on HAS_DMA && PCI && CFG80211
> + depends on PCI && CFG80211
> select QTNFMAC
> select FW_LOADER
> select CRC32
--
Kalle Valo
^ permalink raw reply
* Re: [PATCH] serial: imx: fix cached UCR2 read on software reset
From: Stefan Agner @ 2018-04-19 21:37 UTC (permalink / raw)
To: u.kleine-koenig; +Cc: gregkh, jslaby, linux-serial, linux-kernel
In-Reply-To: <20180416153502.11814-1-stefan@agner.ch>
Hi Uwe,
On 16.04.2018 17:35, Stefan Agner wrote:
> To reset the UART the SRST needs be cleared (low active). According
> to the documentation the bit will remain active for 4 module clocks
> until it is cleared (set to 1).
>
> Hence the real register need to be read in case the cached register
> indcates that the SRST bit is zero.
>
> This bug lead to wrong baudrate because the baud rate register got
> restored before reset completed in imx_flush_buffer.
Given that you reviewed my other patch rather quickly, you might have
overlooked this one?
Since it is a regression, this should go into v4.17 still...
--
Stefan
>
> Fixes: 3a0ab62f43de ("serial: imx: implement shadow registers for UCRx
> and UFCR")
> Signed-off-by: Stefan Agner <stefan@agner.ch>
> ---
> drivers/tty/serial/imx.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
> index 91f3a1a5cb7f..4ff6bd6eb9ab 100644
> --- a/drivers/tty/serial/imx.c
> +++ b/drivers/tty/serial/imx.c
> @@ -316,7 +316,7 @@ static u32 imx_uart_readl(struct imx_port *sport,
> u32 offset)
> * differ from the value that was last written. As it only
> * clears after being set, reread conditionally.
> */
> - if (sport->ucr2 & UCR2_SRST)
> + if (!(sport->ucr2 & UCR2_SRST))
> sport->ucr2 = readl(sport->port.membase + offset);
> return sport->ucr2;
> break;
^ permalink raw reply
* Re: [PATCH] serial: imx: fix cached UCR2 read on software reset
From: Fabio Estevam @ 2018-04-19 22:15 UTC (permalink / raw)
To: Stefan Agner
Cc: Greg Kroah-Hartman, Uwe Kleine-König, Jiri Slaby,
linux-serial, linux-kernel
In-Reply-To: <20180416153502.11814-1-stefan@agner.ch>
On Mon, Apr 16, 2018 at 12:35 PM, Stefan Agner <stefan@agner.ch> wrote:
> To reset the UART the SRST needs be cleared (low active). According
> to the documentation the bit will remain active for 4 module clocks
> until it is cleared (set to 1).
>
> Hence the real register need to be read in case the cached register
> indcates that the SRST bit is zero.
s/indcates/indicates
> This bug lead to wrong baudrate because the baud rate register got
> restored before reset completed in imx_flush_buffer.
>
> Fixes: 3a0ab62f43de ("serial: imx: implement shadow registers for UCRx and UFCR")
> Signed-off-by: Stefan Agner <stefan@agner.ch>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
^ permalink raw reply
* [PATCH] serial: imx: enable IMX21_UCR3_RXDMUXSEL for non-dte-mode
From: Chris Ruehl @ 2018-04-20 1:07 UTC (permalink / raw)
To: Greg Kroah-Hartman, Jiri Slaby, linux-serial, linux-kernel; +Cc: Chris Ruehl
Fix a problem introduced with
commit e61c38d85b73 ("serial: imx: setup DCEDTE early and ensure DCD and RI irqs to be off")
result in non dte-mode imx-uart fail receive data.
By add back IMX21_UCR3_RXDMUXSEL the serial port works as expected.
Signed-off-by: Chris Ruehl <chris.ruehl@gtsys.com.hk>
---
drivers/tty/serial/imx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 91f3a1a..3d09933 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -1391,7 +1391,7 @@ static int imx_uart_startup(struct uart_port *port)
ucr3 = imx_uart_readl(sport, UCR3);
- ucr3 |= UCR3_DTRDEN | UCR3_RI | UCR3_DCD;
+ ucr3 |= IMX21_UCR3_RXDMUXSEL | UCR3_DTRDEN | UCR3_RI | UCR3_DCD;
if (sport->dte_mode)
/* disable broken interrupts */
--
2.1.4
^ permalink raw reply related
* Re: [PATCH] serial: imx: fix cached UCR2 read on software reset
From: Uwe Kleine-König @ 2018-04-20 6:03 UTC (permalink / raw)
To: Stefan Agner; +Cc: gregkh, jslaby, linux-serial, linux-kernel
In-Reply-To: <581f0f26d7191aa3355a6c63b531f876@agner.ch>
Hello Stefan,
On Thu, Apr 19, 2018 at 11:37:23PM +0200, Stefan Agner wrote:
> On 16.04.2018 17:35, Stefan Agner wrote:
> > To reset the UART the SRST needs be cleared (low active). According
> > to the documentation the bit will remain active for 4 module clocks
> > until it is cleared (set to 1).
> >
> > Hence the real register need to be read in case the cached register
> > indcates that the SRST bit is zero.
> >
> > This bug lead to wrong baudrate because the baud rate register got
> > restored before reset completed in imx_flush_buffer.
>
> Given that you reviewed my other patch rather quickly, you might have
> overlooked this one?
no I didn't, still the ping was justified. I didn't look into it at once
because I didn't feel like opening the refman.
> Since it is a regression, this should go into v4.17 still...
That's right,
Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
I wonder what is different on your side that made it break. I didn't see
any breakage and tested that on a handful of different machines.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply
* Re: [PATCH] serial: imx: enable IMX21_UCR3_RXDMUXSEL for non-dte-mode
From: Uwe Kleine-König @ 2018-04-20 6:13 UTC (permalink / raw)
To: Chris Ruehl; +Cc: Greg Kroah-Hartman, Jiri Slaby, linux-serial, linux-kernel
In-Reply-To: <1524186479-25315-1-git-send-email-chris.ruehl@gtsys.com.hk>
Hello Chris,
On Fri, Apr 20, 2018 at 09:07:59AM +0800, Chris Ruehl wrote:
> Fix a problem introduced with
> commit e61c38d85b73 ("serial: imx: setup DCEDTE early and ensure DCD and RI irqs to be off")
> result in non dte-mode imx-uart fail receive data.
> By add back IMX21_UCR3_RXDMUXSEL the serial port works as expected.
>
> Signed-off-by: Chris Ruehl <chris.ruehl@gtsys.com.hk>
> ---
> drivers/tty/serial/imx.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
> index 91f3a1a..3d09933 100644
> --- a/drivers/tty/serial/imx.c
> +++ b/drivers/tty/serial/imx.c
> @@ -1391,7 +1391,7 @@ static int imx_uart_startup(struct uart_port *port)
>
> ucr3 = imx_uart_readl(sport, UCR3);
>
> - ucr3 |= UCR3_DTRDEN | UCR3_RI | UCR3_DCD;
> + ucr3 |= IMX21_UCR3_RXDMUXSEL | UCR3_DTRDEN | UCR3_RI | UCR3_DCD;
>
> if (sport->dte_mode)
> /* disable broken interrupts */
Doesn't 6df765dca378bddf994cfd2044acafa501bd800f fix this for you?
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-König |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply
* Re: [PATCH 53/61] tty: serial: simplify getting .drvdata
From: Michal Simek @ 2018-04-20 7:23 UTC (permalink / raw)
To: Wolfram Sang, linux-kernel
Cc: linux-renesas-soc, kernel-janitors, Greg Kroah-Hartman,
Jiri Slaby, Patrice Chotard, Michal Simek, linux-serial,
linux-arm-kernel
In-Reply-To: <20180419140641.27926-54-wsa+renesas@sang-engineering.com>
On 19.4.2018 16:06, Wolfram Sang wrote:
> We should get drvdata from struct device directly. Going via
> platform_device is an unneeded step back and forth.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> ---
>
> Build tested only. buildbot is happy. Please apply individually.
>
> drivers/tty/serial/imx.c | 18 ++++++------------
> drivers/tty/serial/qcom_geni_serial.c | 6 ++----
> drivers/tty/serial/st-asc.c | 6 ++----
> drivers/tty/serial/xilinx_uartps.c | 6 ++----
Acked-by: Michal Simek <michal.simek@xilinx.com> (for xilinx)
Thanks,
Michal
^ permalink raw reply
* Re: [PATCH] serial: imx: fix cached UCR2 read on software reset
From: Stefan Agner @ 2018-04-20 8:22 UTC (permalink / raw)
To: Uwe Kleine-König; +Cc: gregkh, jslaby, linux-serial, linux-kernel
In-Reply-To: <20180420060315.ob6eygfcibwq7f24@pengutronix.de>
On 20.04.2018 08:03, Uwe Kleine-König wrote:
> Hello Stefan,
>
> On Thu, Apr 19, 2018 at 11:37:23PM +0200, Stefan Agner wrote:
>> On 16.04.2018 17:35, Stefan Agner wrote:
>> > To reset the UART the SRST needs be cleared (low active). According
>> > to the documentation the bit will remain active for 4 module clocks
>> > until it is cleared (set to 1).
>> >
>> > Hence the real register need to be read in case the cached register
>> > indcates that the SRST bit is zero.
>> >
>> > This bug lead to wrong baudrate because the baud rate register got
>> > restored before reset completed in imx_flush_buffer.
>>
>> Given that you reviewed my other patch rather quickly, you might have
>> overlooked this one?
>
> no I didn't, still the ping was justified. I didn't look into it at once
> because I didn't feel like opening the refman.
>
>> Since it is a regression, this should go into v4.17 still...
>
> That's right,
>
> Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
>
> I wonder what is different on your side that made it break. I didn't see
> any breakage and tested that on a handful of different machines.
I observed it on a i.MX 6DualLite, UART in DTE mode...
It did work on a i.MX 7Dual just fine for me too. Probably bus clock
etc. dependent...
--
Stefan
>
> Best regards
> Uwe
^ permalink raw reply
* Re: [PATCH 53/61] tty: serial: simplify getting .drvdata
From: Patrice CHOTARD @ 2018-04-20 8:46 UTC (permalink / raw)
To: Wolfram Sang, linux-kernel@vger.kernel.org
Cc: linux-renesas-soc@vger.kernel.org,
kernel-janitors@vger.kernel.org, Greg Kroah-Hartman, Jiri Slaby,
Michal Simek, linux-serial@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
In-Reply-To: <20180419140641.27926-54-wsa+renesas@sang-engineering.com>
Hi Wolfram
On 04/19/2018 04:06 PM, Wolfram Sang wrote:
> We should get drvdata from struct device directly. Going via
> platform_device is an unneeded step back and forth.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> ---
>
> Build tested only. buildbot is happy. Please apply individually.
>
> drivers/tty/serial/imx.c | 18 ++++++------------
> drivers/tty/serial/qcom_geni_serial.c | 6 ++----
> drivers/tty/serial/st-asc.c | 6 ++----
> drivers/tty/serial/xilinx_uartps.c | 6 ++----
> 4 files changed, 12 insertions(+), 24 deletions(-)
>
> diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
> index 91f3a1a5cb7f..f370c1cf4f27 100644
> --- a/drivers/tty/serial/imx.c
> +++ b/drivers/tty/serial/imx.c
> @@ -2408,8 +2408,7 @@ static void imx_uart_enable_wakeup(struct imx_port *sport, bool on)
>
> static int imx_uart_suspend_noirq(struct device *dev)
> {
> - struct platform_device *pdev = to_platform_device(dev);
> - struct imx_port *sport = platform_get_drvdata(pdev);
> + struct imx_port *sport = dev_get_drvdata(dev);
>
> imx_uart_save_context(sport);
>
> @@ -2420,8 +2419,7 @@ static int imx_uart_suspend_noirq(struct device *dev)
>
> static int imx_uart_resume_noirq(struct device *dev)
> {
> - struct platform_device *pdev = to_platform_device(dev);
> - struct imx_port *sport = platform_get_drvdata(pdev);
> + struct imx_port *sport = dev_get_drvdata(dev);
> int ret;
>
> ret = clk_enable(sport->clk_ipg);
> @@ -2435,8 +2433,7 @@ static int imx_uart_resume_noirq(struct device *dev)
>
> static int imx_uart_suspend(struct device *dev)
> {
> - struct platform_device *pdev = to_platform_device(dev);
> - struct imx_port *sport = platform_get_drvdata(pdev);
> + struct imx_port *sport = dev_get_drvdata(dev);
> int ret;
>
> uart_suspend_port(&imx_uart_uart_driver, &sport->port);
> @@ -2454,8 +2451,7 @@ static int imx_uart_suspend(struct device *dev)
>
> static int imx_uart_resume(struct device *dev)
> {
> - struct platform_device *pdev = to_platform_device(dev);
> - struct imx_port *sport = platform_get_drvdata(pdev);
> + struct imx_port *sport = dev_get_drvdata(dev);
>
> /* disable wakeup from i.MX UART */
> imx_uart_enable_wakeup(sport, false);
> @@ -2470,8 +2466,7 @@ static int imx_uart_resume(struct device *dev)
>
> static int imx_uart_freeze(struct device *dev)
> {
> - struct platform_device *pdev = to_platform_device(dev);
> - struct imx_port *sport = platform_get_drvdata(pdev);
> + struct imx_port *sport = dev_get_drvdata(dev);
>
> uart_suspend_port(&imx_uart_uart_driver, &sport->port);
>
> @@ -2480,8 +2475,7 @@ static int imx_uart_freeze(struct device *dev)
>
> static int imx_uart_thaw(struct device *dev)
> {
> - struct platform_device *pdev = to_platform_device(dev);
> - struct imx_port *sport = platform_get_drvdata(pdev);
> + struct imx_port *sport = dev_get_drvdata(dev);
>
> uart_resume_port(&imx_uart_uart_driver, &sport->port);
>
> diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c
> index 65ff669373d4..66558d42d980 100644
> --- a/drivers/tty/serial/qcom_geni_serial.c
> +++ b/drivers/tty/serial/qcom_geni_serial.c
> @@ -1085,8 +1085,7 @@ static int qcom_geni_serial_remove(struct platform_device *pdev)
>
> static int __maybe_unused qcom_geni_serial_sys_suspend_noirq(struct device *dev)
> {
> - struct platform_device *pdev = to_platform_device(dev);
> - struct qcom_geni_serial_port *port = platform_get_drvdata(pdev);
> + struct qcom_geni_serial_port *port = dev_get_drvdata(dev);
> struct uart_port *uport = &port->uport;
>
> uart_suspend_port(uport->private_data, uport);
> @@ -1095,8 +1094,7 @@ static int __maybe_unused qcom_geni_serial_sys_suspend_noirq(struct device *dev)
>
> static int __maybe_unused qcom_geni_serial_sys_resume_noirq(struct device *dev)
> {
> - struct platform_device *pdev = to_platform_device(dev);
> - struct qcom_geni_serial_port *port = platform_get_drvdata(pdev);
> + struct qcom_geni_serial_port *port = dev_get_drvdata(dev);
> struct uart_port *uport = &port->uport;
>
> if (console_suspend_enabled && uport->suspended) {
> diff --git a/drivers/tty/serial/st-asc.c b/drivers/tty/serial/st-asc.c
> index 5f9f01fac6dd..7971997cdead 100644
> --- a/drivers/tty/serial/st-asc.c
> +++ b/drivers/tty/serial/st-asc.c
> @@ -842,16 +842,14 @@ static int asc_serial_remove(struct platform_device *pdev)
> #ifdef CONFIG_PM_SLEEP
> static int asc_serial_suspend(struct device *dev)
> {
> - struct platform_device *pdev = to_platform_device(dev);
> - struct uart_port *port = platform_get_drvdata(pdev);
> + struct uart_port *port = dev_get_drvdata(dev);
>
> return uart_suspend_port(&asc_uart_driver, port);
> }
>
> static int asc_serial_resume(struct device *dev)
> {
> - struct platform_device *pdev = to_platform_device(dev);
> - struct uart_port *port = platform_get_drvdata(pdev);
> + struct uart_port *port = dev_get_drvdata(dev);
>
> return uart_resume_port(&asc_uart_driver, port);
> }
> diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
> index abcb4d09a2d8..3ec4efbf25a9 100644
> --- a/drivers/tty/serial/xilinx_uartps.c
> +++ b/drivers/tty/serial/xilinx_uartps.c
> @@ -1430,8 +1430,7 @@ static int cdns_uart_resume(struct device *device)
> #endif /* ! CONFIG_PM_SLEEP */
> static int __maybe_unused cdns_runtime_suspend(struct device *dev)
> {
> - struct platform_device *pdev = to_platform_device(dev);
> - struct uart_port *port = platform_get_drvdata(pdev);
> + struct uart_port *port = dev_get_drvdata(dev);
> struct cdns_uart *cdns_uart = port->private_data;
>
> clk_disable(cdns_uart->uartclk);
> @@ -1441,8 +1440,7 @@ static int __maybe_unused cdns_runtime_suspend(struct device *dev)
>
> static int __maybe_unused cdns_runtime_resume(struct device *dev)
> {
> - struct platform_device *pdev = to_platform_device(dev);
> - struct uart_port *port = platform_get_drvdata(pdev);
> + struct uart_port *port = dev_get_drvdata(dev);
> struct cdns_uart *cdns_uart = port->private_data;
>
> clk_enable(cdns_uart->pclk);
>
For st-asc:
Acked-by: Patrice Chotard <patrice.chotard@st.com>
Thanks
^ permalink raw reply
* Re: [PATCH] serial: imx: enable IMX21_UCR3_RXDMUXSEL for non-dte-mode
From: Chris Ruehl @ 2018-04-20 8:56 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Greg Kroah-Hartman, Jiri Slaby, linux-serial, linux-kernel
In-Reply-To: <20180420061316.sakoupltqxn2qhfr@pengutronix.de>
On Friday, April 20, 2018 02:13 PM, Uwe Kleine-König wrote:
> Hello Chris,
>
> On Fri, Apr 20, 2018 at 09:07:59AM +0800, Chris Ruehl wrote:
>> Fix a problem introduced with
>> commit e61c38d85b73 ("serial: imx: setup DCEDTE early and ensure DCD and RI irqs to be off")
>> result in non dte-mode imx-uart fail receive data.
>> By add back IMX21_UCR3_RXDMUXSEL the serial port works as expected.
>>
>> Signed-off-by: Chris Ruehl <chris.ruehl@gtsys.com.hk>
>> ---
>> drivers/tty/serial/imx.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
>> index 91f3a1a..3d09933 100644
>> --- a/drivers/tty/serial/imx.c
>> +++ b/drivers/tty/serial/imx.c
>> @@ -1391,7 +1391,7 @@ static int imx_uart_startup(struct uart_port *port)
>>
>> ucr3 = imx_uart_readl(sport, UCR3);
>>
>> - ucr3 |= UCR3_DTRDEN | UCR3_RI | UCR3_DCD;
>> + ucr3 |= IMX21_UCR3_RXDMUXSEL | UCR3_DTRDEN | UCR3_RI | UCR3_DCD;
>>
>> if (sport->dte_mode)
>> /* disable broken interrupts */
>
> Doesn't 6df765dca378bddf994cfd2044acafa501bd800f fix this for you?
>
> Best regards
> Uwe
>
Uwe,
the patch you point out would fix that problem from what I can see.
But it not yet at the linux-next and since the error persists for 4.9.89
to present I filed a patch simple patch which fix my system.
Let me apply your patch and see if all works well then I fine to drop my
one liner.
Chris
^ permalink raw reply
* [PATCH v2] serial: imx: fix cached UCR2 read on software reset
From: Stefan Agner @ 2018-04-20 12:44 UTC (permalink / raw)
To: gregkh
Cc: u.kleine-koenig, festevam, jslaby, linux-serial, linux-kernel,
Stefan Agner
To reset the UART the SRST needs be cleared (low active). According
to the documentation the bit will remain active for 4 module clocks
until it is cleared (set to 1).
Hence the real register need to be read in case the cached register
indicates that the SRST bit is zero.
This bug lead to wrong baudrate because the baud rate register got
restored before reset completed in imx_flush_buffer.
Fixes: 3a0ab62f43de ("serial: imx: implement shadow registers for UCRx and UFCR")
Signed-off-by: Stefan Agner <stefan@agner.ch>
Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com>
Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
Hi Greg,
Since this fixes a regression it should go into v4.17...
--
Stefan
drivers/tty/serial/imx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
index 91f3a1a5cb7f..4ff6bd6eb9ab 100644
--- a/drivers/tty/serial/imx.c
+++ b/drivers/tty/serial/imx.c
@@ -316,7 +316,7 @@ static u32 imx_uart_readl(struct imx_port *sport, u32 offset)
* differ from the value that was last written. As it only
* clears after being set, reread conditionally.
*/
- if (sport->ucr2 & UCR2_SRST)
+ if (!(sport->ucr2 & UCR2_SRST))
sport->ucr2 = readl(sport->port.membase + offset);
return sport->ucr2;
break;
--
2.17.0
^ permalink raw reply related
* Re: [PATCH v3 14/20] mtd: Remove depends on HAS_DMA in case of platform dependency
From: Boris Brezillon @ 2018-04-22 17:12 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Ulf Hansson, Wolfram Sang, linux-iio-u79uwXL29TY76Z2rM5mHXA,
linux-fpga-u79uwXL29TY76Z2rM5mHXA,
linux-remoteproc-u79uwXL29TY76Z2rM5mHXA,
alsa-devel-K7yf7f+aM1XWsZ/bQMPhNw, Bjorn Andersson, Eric Anholt,
netdev-u79uwXL29TY76Z2rM5mHXA,
linux-mtd-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r,
linux-i2c-u79uwXL29TY76Z2rM5mHXA,
linux1394-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f,
Christoph Hellwig, Stefan Wahren, Boris Brezillon, Herbert Xu,
Richard Weinberger, Jassi Brar, Marek Vasut,
linux-serial-u79uwXL29TY76Z2rM5mHXA, Matias Bjorling,
David Woodhouse, linux-media-u79uwXL29TY76Z2rM5mHXA,
Ohad Ben-Cohen, devel-gWbeCf7V1WCQmaza687I9mD2FQJk+8+b, Alan Tull
In-Reply-To: <1523987360-18760-15-git-send-email-geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org>
On Tue, 17 Apr 2018 19:49:14 +0200
Geert Uytterhoeven <geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org> wrote:
> Remove dependencies on HAS_DMA where a Kconfig symbol depends on another
> symbol that implies HAS_DMA, and, optionally, on "|| COMPILE_TEST".
> In most cases this other symbol is an architecture or platform specific
> symbol, or PCI.
>
> Generic symbols and drivers without platform dependencies keep their
> dependencies on HAS_DMA, to prevent compiling subsystems or drivers that
> cannot work anyway.
>
> This simplifies the dependencies, and allows to improve compile-testing.
>
> Signed-off-by: Geert Uytterhoeven <geert-Td1EMuHUCqxL1ZNQvxDV9g@public.gmane.org>
> Reviewed-by: Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
> Acked-by: Robin Murphy <robin.murphy-5wv7dgnIgG8@public.gmane.org>
Applied to mtd/next.
Thanks,
Boris
> ---
> v3:
> - Rebase to v4.17-rc1,
>
> v2:
> - Add Reviewed-by, Acked-by,
> - Drop RFC state,
> - Drop new dependency of MTD_NAND_MARVELL on HAS_DMA,
> - Split per subsystem.
> ---
> drivers/mtd/nand/raw/Kconfig | 8 ++------
> drivers/mtd/spi-nor/Kconfig | 2 +-
> 2 files changed, 3 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/mtd/nand/raw/Kconfig b/drivers/mtd/nand/raw/Kconfig
> index 19a2b283fbbe627e..6871ff0fd300bb81 100644
> --- a/drivers/mtd/nand/raw/Kconfig
> +++ b/drivers/mtd/nand/raw/Kconfig
> @@ -46,7 +46,7 @@ config MTD_NAND_DENALI
> config MTD_NAND_DENALI_PCI
> tristate "Support Denali NAND controller on Intel Moorestown"
> select MTD_NAND_DENALI
> - depends on HAS_DMA && PCI
> + depends on PCI
> help
> Enable the driver for NAND flash on Intel Moorestown, using the
> Denali NAND controller core.
> @@ -152,7 +152,6 @@ config MTD_NAND_S3C2410_CLKSTOP
> config MTD_NAND_TANGO
> tristate "NAND Flash support for Tango chips"
> depends on ARCH_TANGO || COMPILE_TEST
> - depends on HAS_DMA
> help
> Enables the NAND Flash controller on Tango chips.
>
> @@ -285,7 +284,7 @@ config MTD_NAND_MARVELL
> tristate "NAND controller support on Marvell boards"
> depends on PXA3xx || ARCH_MMP || PLAT_ORION || ARCH_MVEBU || \
> COMPILE_TEST
> - depends on HAS_IOMEM && HAS_DMA
> + depends on HAS_IOMEM
> help
> This enables the NAND flash controller driver for Marvell boards,
> including:
> @@ -447,7 +446,6 @@ config MTD_NAND_SH_FLCTL
> tristate "Support for NAND on Renesas SuperH FLCTL"
> depends on SUPERH || COMPILE_TEST
> depends on HAS_IOMEM
> - depends on HAS_DMA
> help
> Several Renesas SuperH CPU has FLCTL. This option enables support
> for NAND Flash using FLCTL.
> @@ -515,7 +513,6 @@ config MTD_NAND_SUNXI
> config MTD_NAND_HISI504
> tristate "Support for NAND controller on Hisilicon SoC Hip04"
> depends on ARCH_HISI || COMPILE_TEST
> - depends on HAS_DMA
> help
> Enables support for NAND controller on Hisilicon SoC Hip04.
>
> @@ -529,7 +526,6 @@ config MTD_NAND_QCOM
> config MTD_NAND_MTK
> tristate "Support for NAND controller on MTK SoCs"
> depends on ARCH_MEDIATEK || COMPILE_TEST
> - depends on HAS_DMA
> help
> Enables support for NAND controller on MTK SoCs.
> This controller is found on mt27xx, mt81xx, mt65xx SoCs.
> diff --git a/drivers/mtd/spi-nor/Kconfig b/drivers/mtd/spi-nor/Kconfig
> index 89da88e591215db1..c493b8230a38c059 100644
> --- a/drivers/mtd/spi-nor/Kconfig
> +++ b/drivers/mtd/spi-nor/Kconfig
> @@ -71,7 +71,7 @@ config SPI_FSL_QUADSPI
> config SPI_HISI_SFC
> tristate "Hisilicon SPI-NOR Flash Controller(SFC)"
> depends on ARCH_HISI || COMPILE_TEST
> - depends on HAS_IOMEM && HAS_DMA
> + depends on HAS_IOMEM
> help
> This enables support for hisilicon SPI-NOR flash controller.
>
^ permalink raw reply
* Re: [PATCH] Check for an error when the clock is enabled.
From: Greg Kroah-Hartman @ 2018-04-23 7:55 UTC (permalink / raw)
To: Stefan Potyra
Cc: Jiri Slaby, linux-serial, linux-kernel, ldv-project, sil2review
In-Reply-To: <20180419130228.rdee6hwsjcui5py7@agrajag.zerfleddert.de>
On Thu, Apr 19, 2018 at 03:02:28PM +0200, Stefan Potyra wrote:
> Found by Linux Driver Verification project (linuxtesting.org).
Please fix up your subject line to have something "real" in it, along
with the proper prefix.
And put more context here in the changelog, saying why you are doing
this, this "empty line" doesn't mean anything.
>
> Fixes: 0814e8d5da2b sc16is7xx: enable the clock
Fixes: 0814e8d5da2b ("sc16is7xx: enable the clock")
is the correct format.
> Signed-off-by: Stefan Potyra <Stefan.Potyra@elektrobit.com>
> ---
> drivers/tty/serial/sc16is7xx.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c
> index 65792a3539d0..243c96025053 100644
> --- a/drivers/tty/serial/sc16is7xx.c
> +++ b/drivers/tty/serial/sc16is7xx.c
> @@ -1168,7 +1168,10 @@ static int sc16is7xx_probe(struct device *dev,
> else
> return PTR_ERR(s->clk);
> } else {
> - clk_prepare_enable(s->clk);
> + ret = clk_prepare_enable(s->clk);
> + if (ret)
> + return ret;
> +
Please fix up the above and resend.
thanks,
greg k-h
^ permalink raw reply
* Re: [PATCH] tty: serial: xuartps: Setup early console when uartclk is also passed
From: Greg Kroah-Hartman @ 2018-04-23 8:06 UTC (permalink / raw)
To: Michal Simek
Cc: linux-kernel, monstr, Jiri Slaby, linux-serial, linux-arm-kernel
In-Reply-To: <2ef5ac478f8d32bc807ead758eb5d60744a44515.1523367208.git.michal.simek@xilinx.com>
On Tue, Apr 10, 2018 at 03:33:30PM +0200, Michal Simek wrote:
> Baudrate calculation depends on requested baudrate and uart clock.
> This patch is checking that uartclk is also passed.
>
> The same logic is used 8250_early.c/init_port function.
>
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---
>
> drivers/tty/serial/xilinx_uartps.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
> index b9b2bc76bcac..a654cda203c7 100644
> --- a/drivers/tty/serial/xilinx_uartps.c
> +++ b/drivers/tty/serial/xilinx_uartps.c
> @@ -1181,7 +1181,7 @@ static int __init cdns_early_console_setup(struct earlycon_device *device,
> /* only set baud if specified on command line - otherwise
> * assume it has been initialized by a boot loader.
> */
> - if (device->baud) {
> + if (port->uartclk && device->baud) {
> u32 cd = 0, bdiv = 0;
> u32 mr;
> int div8;
> --
> 1.9.1
This patch conflicts with the previous patch you sent: Subject: [PATCH]
serial: xuartps: Fix the early_console junk character issue
So, which one should I apply?
I've dropped both from my review queue now, please resend the one(s) you
want applied, in a patch series if needed.
thanks,
greg k-h
^ permalink raw reply
* Re: [PATCH] serial: 8250_of: Add IO space support
From: Greg KH @ 2018-04-23 8:14 UTC (permalink / raw)
To: John Garry
Cc: jslaby, joel, p.zabel, arnd, fcooper, sergei.shtylyov,
yamada.masahiro, khoroshilov, linux-serial, linux-kernel,
andriy.shevchenko, linuxarm
In-Reply-To: <1524152268-228631-1-git-send-email-john.garry@huawei.com>
On Thu, Apr 19, 2018 at 11:37:48PM +0800, John Garry wrote:
> Currently the 8250_of driver only supports MEM IO type
> accesses.
>
> Some development boards (Huawei D03, specifically) require
> IO space access for 8250-compatible OF driver support, so
> add it.
>
> The modification is quite simple: just set the port iotype
> and associated flags depending on the device address
> resource type.
>
> Signed-off-by: John Garry <john.garry@huawei.com>
This no longer applies to my tree due to a patch that was sent before
yours that conflicts in the same area. Can you rebase it against my
tty-testing branch and resend?
thanks,
greg k-h
^ permalink raw reply
* Re: [PATCH] tty: serial: xuartps: Setup early console when uartclk is also passed
From: Michal Simek @ 2018-04-23 8:37 UTC (permalink / raw)
To: Greg Kroah-Hartman, Michal Simek
Cc: linux-kernel, Jiri Slaby, linux-serial, linux-arm-kernel
In-Reply-To: <20180423080641.GA20149@kroah.com>
[-- Attachment #1.1: Type: text/plain, Size: 2414 bytes --]
On 23.4.2018 10:06, Greg Kroah-Hartman wrote:
> On Tue, Apr 10, 2018 at 03:33:30PM +0200, Michal Simek wrote:
>> Baudrate calculation depends on requested baudrate and uart clock.
>> This patch is checking that uartclk is also passed.
>>
>> The same logic is used 8250_early.c/init_port function.
>>
>> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
>> ---
>>
>> drivers/tty/serial/xilinx_uartps.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
>> index b9b2bc76bcac..a654cda203c7 100644
>> --- a/drivers/tty/serial/xilinx_uartps.c
>> +++ b/drivers/tty/serial/xilinx_uartps.c
>> @@ -1181,7 +1181,7 @@ static int __init cdns_early_console_setup(struct earlycon_device *device,
>> /* only set baud if specified on command line - otherwise
>> * assume it has been initialized by a boot loader.
>> */
>> - if (device->baud) {
>> + if (port->uartclk && device->baud) {
>> u32 cd = 0, bdiv = 0;
>> u32 mr;
>> int div8;
>> --
>> 1.9.1
>
> This patch conflicts with the previous patch you sent: Subject: [PATCH]
> serial: xuartps: Fix the early_console junk character issue
>
> So, which one should I apply?
>
> I've dropped both from my review queue now, please resend the one(s) you
> want applied, in a patch series if needed.
First of all thanks for dropping. I forget that I have sent it in past.
Both patches are targeting the same problem. The first one is more
destructive.
And this one is what 8250 is doing.
I have also sent
"[PATCH] earlycon: Initialize port->uartclk based on clock-frequency
property" which is filling uartclk based on DT to do proper divider
calculation.
It means when patch above is applied we can keep divider calculation in
the driver because it is using right values. If not we need to remove
that baudrate calculation because it is not correct (uartclk is
hardcoded to BASE_BAUD * 16 in of_setup_earlycon).
And it is really a question if "port->uartclk = BASE_BAUD * 16" should
be in of_setup_earlycon.
Thanks,
Michal
--
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Xilinx Microblaze
Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs
U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP SoCs
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply
* Re: [PATCH] tty: serial: xuartps: Setup early console when uartclk is also passed
From: Greg Kroah-Hartman @ 2018-04-23 8:48 UTC (permalink / raw)
To: Michal Simek
Cc: Michal Simek, linux-kernel, Jiri Slaby, linux-serial,
linux-arm-kernel
In-Reply-To: <ebc1b162-c5bf-3963-05ab-4b236f89966a@monstr.eu>
On Mon, Apr 23, 2018 at 10:37:12AM +0200, Michal Simek wrote:
> On 23.4.2018 10:06, Greg Kroah-Hartman wrote:
> > On Tue, Apr 10, 2018 at 03:33:30PM +0200, Michal Simek wrote:
> >> Baudrate calculation depends on requested baudrate and uart clock.
> >> This patch is checking that uartclk is also passed.
> >>
> >> The same logic is used 8250_early.c/init_port function.
> >>
> >> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> >> ---
> >>
> >> drivers/tty/serial/xilinx_uartps.c | 2 +-
> >> 1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
> >> index b9b2bc76bcac..a654cda203c7 100644
> >> --- a/drivers/tty/serial/xilinx_uartps.c
> >> +++ b/drivers/tty/serial/xilinx_uartps.c
> >> @@ -1181,7 +1181,7 @@ static int __init cdns_early_console_setup(struct earlycon_device *device,
> >> /* only set baud if specified on command line - otherwise
> >> * assume it has been initialized by a boot loader.
> >> */
> >> - if (device->baud) {
> >> + if (port->uartclk && device->baud) {
> >> u32 cd = 0, bdiv = 0;
> >> u32 mr;
> >> int div8;
> >> --
> >> 1.9.1
> >
> > This patch conflicts with the previous patch you sent: Subject: [PATCH]
> > serial: xuartps: Fix the early_console junk character issue
> >
> > So, which one should I apply?
> >
> > I've dropped both from my review queue now, please resend the one(s) you
> > want applied, in a patch series if needed.
>
> First of all thanks for dropping. I forget that I have sent it in past.
>
> Both patches are targeting the same problem. The first one is more
> destructive.
>
> And this one is what 8250 is doing.
>
> I have also sent
> "[PATCH] earlycon: Initialize port->uartclk based on clock-frequency
> property" which is filling uartclk based on DT to do proper divider
> calculation.
>
> It means when patch above is applied we can keep divider calculation in
> the driver because it is using right values. If not we need to remove
> that baudrate calculation because it is not correct (uartclk is
> hardcoded to BASE_BAUD * 16 in of_setup_earlycon).
> And it is really a question if "port->uartclk = BASE_BAUD * 16" should
> be in of_setup_earlycon.
Ok, but what should I do here? My patch queue for serial drivers is now
empty, so if you didn't get an automated email saying your patch was
applied, please resend what you think needs to be applied.
thanks,
greg k-h
^ permalink raw reply
* Re: [PATCH] tty: serial: xuartps: Setup early console when uartclk is also passed
From: Michal Simek @ 2018-04-23 8:52 UTC (permalink / raw)
To: Greg Kroah-Hartman
Cc: Michal Simek, linux-kernel, Jiri Slaby, linux-serial,
linux-arm-kernel
In-Reply-To: <20180423084810.GA11893@kroah.com>
[-- Attachment #1.1: Type: text/plain, Size: 2933 bytes --]
On 23.4.2018 10:48, Greg Kroah-Hartman wrote:
> On Mon, Apr 23, 2018 at 10:37:12AM +0200, Michal Simek wrote:
>> On 23.4.2018 10:06, Greg Kroah-Hartman wrote:
>>> On Tue, Apr 10, 2018 at 03:33:30PM +0200, Michal Simek wrote:
>>>> Baudrate calculation depends on requested baudrate and uart clock.
>>>> This patch is checking that uartclk is also passed.
>>>>
>>>> The same logic is used 8250_early.c/init_port function.
>>>>
>>>> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
>>>> ---
>>>>
>>>> drivers/tty/serial/xilinx_uartps.c | 2 +-
>>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>>
>>>> diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
>>>> index b9b2bc76bcac..a654cda203c7 100644
>>>> --- a/drivers/tty/serial/xilinx_uartps.c
>>>> +++ b/drivers/tty/serial/xilinx_uartps.c
>>>> @@ -1181,7 +1181,7 @@ static int __init cdns_early_console_setup(struct earlycon_device *device,
>>>> /* only set baud if specified on command line - otherwise
>>>> * assume it has been initialized by a boot loader.
>>>> */
>>>> - if (device->baud) {
>>>> + if (port->uartclk && device->baud) {
>>>> u32 cd = 0, bdiv = 0;
>>>> u32 mr;
>>>> int div8;
>>>> --
>>>> 1.9.1
>>>
>>> This patch conflicts with the previous patch you sent: Subject: [PATCH]
>>> serial: xuartps: Fix the early_console junk character issue
>>>
>>> So, which one should I apply?
>>>
>>> I've dropped both from my review queue now, please resend the one(s) you
>>> want applied, in a patch series if needed.
>>
>> First of all thanks for dropping. I forget that I have sent it in past.
>>
>> Both patches are targeting the same problem. The first one is more
>> destructive.
>>
>> And this one is what 8250 is doing.
>>
>> I have also sent
>> "[PATCH] earlycon: Initialize port->uartclk based on clock-frequency
>> property" which is filling uartclk based on DT to do proper divider
>> calculation.
>>
>> It means when patch above is applied we can keep divider calculation in
>> the driver because it is using right values. If not we need to remove
>> that baudrate calculation because it is not correct (uartclk is
>> hardcoded to BASE_BAUD * 16 in of_setup_earlycon).
>> And it is really a question if "port->uartclk = BASE_BAUD * 16" should
>> be in of_setup_earlycon.
>
> Ok, but what should I do here? My patch queue for serial drivers is now
> empty, so if you didn't get an automated email saying your patch was
> applied, please resend what you think needs to be applied.
I got that email and patch was applied. I will send proper version.
Thanks,
Michal
--
Michal Simek, Ing. (M.Eng), OpenPGP -> KeyID: FE3D1F91
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel - Xilinx Microblaze
Maintainer of Linux kernel - Xilinx Zynq ARM and ZynqMP ARM64 SoCs
U-Boot custodian - Xilinx Microblaze/Zynq/ZynqMP SoCs
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply
* [RESEND PATCH] tty: serial: xuartps: Setup early console when uartclk is also passed
From: Michal Simek @ 2018-04-23 8:55 UTC (permalink / raw)
To: linux-kernel, monstr
Cc: Jiri Slaby, linux-serial, Greg Kroah-Hartman, linux-arm-kernel
Baudrate calculation depends on requested baudrate and uart clock.
This patch is checking that uartclk is also passed.
The same logic is used 8250_early.c/init_port function.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---
drivers/tty/serial/xilinx_uartps.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c
index 19d370779767..0fc9de20843c 100644
--- a/drivers/tty/serial/xilinx_uartps.c
+++ b/drivers/tty/serial/xilinx_uartps.c
@@ -1142,7 +1142,7 @@ static int __init cdns_early_console_setup(struct earlycon_device *device,
/* only set baud if specified on command line - otherwise
* assume it has been initialized by a boot loader.
*/
- if (device->baud) {
+ if (port->uartclk && device->baud) {
u32 cd = 0, bdiv = 0;
u32 mr;
int div8;
--
2.17.0
^ permalink raw reply related
* [PATCH] serial: 8250_early: Setup divider when uartclk is passed
From: Michal Simek @ 2018-04-23 9:18 UTC (permalink / raw)
To: linux-kernel, monstr
Cc: stable, Matt Redfearn, Jiri Slaby, Douglas Anderson, linux-serial,
Greg Kroah-Hartman, Jeffy Chen
device->baud is always non zero value because it is checked already in
early_serial8250_setup() before init_port is called.
Fixes: 0ff3ab701963 ("serial: 8250_early: Only set divisor if valid clk & baud")
Cc: stable <stable@vger.kernel.org>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---
drivers/tty/serial/8250/8250_early.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/tty/serial/8250/8250_early.c b/drivers/tty/serial/8250/8250_early.c
index ae6a256524d8..5cd8c36c8fcc 100644
--- a/drivers/tty/serial/8250/8250_early.c
+++ b/drivers/tty/serial/8250/8250_early.c
@@ -122,7 +122,7 @@ static void __init init_port(struct earlycon_device *device)
serial8250_early_out(port, UART_FCR, 0); /* no fifo */
serial8250_early_out(port, UART_MCR, 0x3); /* DTR + RTS */
- if (port->uartclk && device->baud) {
+ if (port->uartclk) {
divisor = DIV_ROUND_CLOSEST(port->uartclk, 16 * device->baud);
c = serial8250_early_in(port, UART_LCR);
serial8250_early_out(port, UART_LCR, c | UART_LCR_DLAB);
--
2.17.0
^ permalink raw reply related
* Re: [PATCH] serial: 8250_of: Add IO space support
From: John Garry @ 2018-04-23 9:22 UTC (permalink / raw)
To: Greg KH
Cc: jslaby, joel, p.zabel, arnd, fcooper, sergei.shtylyov,
yamada.masahiro, khoroshilov, linux-serial, linux-kernel,
andriy.shevchenko, linuxarm
In-Reply-To: <20180423081402.GA19169@kroah.com>
On 23/04/2018 09:14, Greg KH wrote:
> On Thu, Apr 19, 2018 at 11:37:48PM +0800, John Garry wrote:
>> Currently the 8250_of driver only supports MEM IO type
>> accesses.
>>
>> Some development boards (Huawei D03, specifically) require
>> IO space access for 8250-compatible OF driver support, so
>> add it.
>>
>> The modification is quite simple: just set the port iotype
>> and associated flags depending on the device address
>> resource type.
>>
>> Signed-off-by: John Garry <john.garry@huawei.com>
>
> This no longer applies to my tree due to a patch that was sent before
> yours that conflicts in the same area. Can you rebase it against my
> tty-testing branch and resend?
>
Hi Greg,
OK, I'll do that. I will also make this small improvement to this patch:
+ if ((resource.flags & IORESOURCE_TYPE_BITS) == IORESOURCE_IO) {
+ port->iotype = UPIO_PORT;
|
V
+ if (resource_type(&resource) == IORESOURCE_IO) {
+ port->iotype = UPIO_PORT;
All the best,
John
> thanks,
>
> greg k-h
>
> .
>
^ permalink raw reply
* [RFC. PATCH] earlycon: Remove hardcoded port->uartclk initialization in of_setup_earlycon
From: Michal Simek @ 2018-04-23 9:27 UTC (permalink / raw)
To: linux-kernel, monstr, devicetree, Rob Herring, matt.redfearn
Cc: Greg Kroah-Hartman, linux-serial, Jiri Slaby
There is no reason to initialize uartclk to BASE_BAUD * 16 for DT based
systems.
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---
It looks like from history that portclk = BASE_BAUD * 16 was setup to
get on calculation on x86 (divisor = 1) but it shouldn't be needed on DT based
system. That's why I think that there is no DT based system which really
requires this line.
---
drivers/tty/serial/earlycon.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/drivers/tty/serial/earlycon.c b/drivers/tty/serial/earlycon.c
index a24278380fec..c12b1edcdd8e 100644
--- a/drivers/tty/serial/earlycon.c
+++ b/drivers/tty/serial/earlycon.c
@@ -244,7 +244,6 @@ int __init of_setup_earlycon(const struct earlycon_id *match,
return -ENXIO;
}
port->mapbase = addr;
- port->uartclk = BASE_BAUD * 16;
val = of_get_flat_dt_prop(node, "reg-offset", NULL);
if (val)
--
2.17.0
^ permalink raw reply related
* [PATCH 0/4] serial: uartps: Dynamic allocation
From: Michal Simek @ 2018-04-23 9:50 UTC (permalink / raw)
To: linux-kernel, monstr, Alan Cox, geert+renesas
Cc: Jiri Slaby, linux-serial, Greg Kroah-Hartman, linux-arm-kernel
Hi,
this is the initial version before next step which is move
uart_register_driver to probe function.
I was able to get rid of static array with uart_port structures.
It was wired with console which is also fixed.
And the next step is the most complicated one handle .nr in uart_driver
structure in more generic way.
I am sending these patches as v1. RFC was sent in past
(https://www.spinics.net/lists/linux-serial/msg27106.html)
and I promised to wait till Geert's
"serial: xuartps: Fix out-of-bounds access through DT
alias" (sha1: e7d75e18d0fc3f7193b65282b651f980c778d935) is applied.
Thanks,
Michal
Michal Simek (4):
serial: uartps: Remove console_initcall from the driver
serial: uartps: Use dynamic array for console port
serial: uartps: Move cnds_uart_get_port to probe
serial: uartps: Remove static port array
drivers/tty/serial/xilinx_uartps.c | 102 +++++++++++------------------
1 file changed, 40 insertions(+), 62 deletions(-)
--
2.17.0
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox