* [PATCH AUTOSEL 4.9 24/90] dmaengine: zynqmp_dma: fix burst length configuration [not found] <20200918021455.2067301-1-sashal@kernel.org> @ 2020-09-18 2:13 ` Sasha Levin 2020-09-18 2:14 ` [PATCH AUTOSEL 4.9 64/90] serial: uartps: Wait for tx_empty in console setup Sasha Levin 1 sibling, 0 replies; 6+ messages in thread From: Sasha Levin @ 2020-09-18 2:13 UTC (permalink / raw) To: linux-kernel, stable Cc: Sasha Levin, Matthias Fend, Vinod Koul, dmaengine, linux-arm-kernel From: Matthias Fend <matthias.fend@wolfvision.net> [ Upstream commit cc88525ebffc757e00cc5a5d61da6271646c7f5f ] Since the dma engine expects the burst length register content as power of 2 value, the burst length needs to be converted first. Additionally add a burst length range check to avoid corrupting unrelated register bits. Signed-off-by: Matthias Fend <matthias.fend@wolfvision.net> Link: https://lore.kernel.org/r/20200115102249.24398-1-matthias.fend@wolfvision.net Signed-off-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org> --- drivers/dma/xilinx/zynqmp_dma.c | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/drivers/dma/xilinx/zynqmp_dma.c b/drivers/dma/xilinx/zynqmp_dma.c index 9069fb8543196..514763dcc3758 100644 --- a/drivers/dma/xilinx/zynqmp_dma.c +++ b/drivers/dma/xilinx/zynqmp_dma.c @@ -125,10 +125,12 @@ /* Max transfer size per descriptor */ #define ZYNQMP_DMA_MAX_TRANS_LEN 0x40000000 +/* Max burst lengths */ +#define ZYNQMP_DMA_MAX_DST_BURST_LEN 32768U +#define ZYNQMP_DMA_MAX_SRC_BURST_LEN 32768U + /* Reset values for data attributes */ #define ZYNQMP_DMA_AXCACHE_VAL 0xF -#define ZYNQMP_DMA_ARLEN_RST_VAL 0xF -#define ZYNQMP_DMA_AWLEN_RST_VAL 0xF #define ZYNQMP_DMA_SRC_ISSUE_RST_VAL 0x1F @@ -527,17 +529,19 @@ static void zynqmp_dma_handle_ovfl_int(struct zynqmp_dma_chan *chan, u32 status) static void zynqmp_dma_config(struct zynqmp_dma_chan *chan) { - u32 val; + u32 val, burst_val; val = readl(chan->regs + ZYNQMP_DMA_CTRL0); val |= ZYNQMP_DMA_POINT_TYPE_SG; writel(val, chan->regs + ZYNQMP_DMA_CTRL0); val = readl(chan->regs + ZYNQMP_DMA_DATA_ATTR); + burst_val = __ilog2_u32(chan->src_burst_len); val = (val & ~ZYNQMP_DMA_ARLEN) | - (chan->src_burst_len << ZYNQMP_DMA_ARLEN_OFST); + ((burst_val << ZYNQMP_DMA_ARLEN_OFST) & ZYNQMP_DMA_ARLEN); + burst_val = __ilog2_u32(chan->dst_burst_len); val = (val & ~ZYNQMP_DMA_AWLEN) | - (chan->dst_burst_len << ZYNQMP_DMA_AWLEN_OFST); + ((burst_val << ZYNQMP_DMA_AWLEN_OFST) & ZYNQMP_DMA_AWLEN); writel(val, chan->regs + ZYNQMP_DMA_DATA_ATTR); } @@ -551,8 +555,10 @@ static int zynqmp_dma_device_config(struct dma_chan *dchan, { struct zynqmp_dma_chan *chan = to_chan(dchan); - chan->src_burst_len = config->src_maxburst; - chan->dst_burst_len = config->dst_maxburst; + chan->src_burst_len = clamp(config->src_maxburst, 1U, + ZYNQMP_DMA_MAX_SRC_BURST_LEN); + chan->dst_burst_len = clamp(config->dst_maxburst, 1U, + ZYNQMP_DMA_MAX_DST_BURST_LEN); return 0; } @@ -968,8 +974,8 @@ static int zynqmp_dma_chan_probe(struct zynqmp_dma_device *zdev, return PTR_ERR(chan->regs); chan->bus_width = ZYNQMP_DMA_BUS_WIDTH_64; - chan->dst_burst_len = ZYNQMP_DMA_AWLEN_RST_VAL; - chan->src_burst_len = ZYNQMP_DMA_ARLEN_RST_VAL; + chan->dst_burst_len = ZYNQMP_DMA_MAX_DST_BURST_LEN; + chan->src_burst_len = ZYNQMP_DMA_MAX_SRC_BURST_LEN; err = of_property_read_u32(node, "xlnx,bus-width", &chan->bus_width); if (err < 0) { dev_err(&pdev->dev, "missing xlnx,bus-width property\n"); -- 2.25.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH AUTOSEL 4.9 64/90] serial: uartps: Wait for tx_empty in console setup [not found] <20200918021455.2067301-1-sashal@kernel.org> 2020-09-18 2:13 ` [PATCH AUTOSEL 4.9 24/90] dmaengine: zynqmp_dma: fix burst length configuration Sasha Levin @ 2020-09-18 2:14 ` Sasha Levin 2020-09-28 20:11 ` Naresh Kamboju 1 sibling, 1 reply; 6+ messages in thread From: Sasha Levin @ 2020-09-18 2:14 UTC (permalink / raw) To: linux-kernel, stable Cc: Raviteja Narayanam, Sasha Levin, Greg Kroah-Hartman, Shubhrajyoti Datta, linux-serial, linux-arm-kernel From: Raviteja Narayanam <raviteja.narayanam@xilinx.com> [ Upstream commit 42e11948ddf68b9f799cad8c0ddeab0a39da33e8 ] On some platforms, the log is corrupted while console is being registered. It is observed that when set_termios is called, there are still some bytes in the FIFO to be transmitted. So, wait for tx_empty inside cdns_uart_console_setup before calling set_termios. Signed-off-by: Raviteja Narayanam <raviteja.narayanam@xilinx.com> Reviewed-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com> Link: https://lore.kernel.org/r/1586413563-29125-2-git-send-email-raviteja.narayanam@xilinx.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Sasha Levin <sashal@kernel.org> --- drivers/tty/serial/xilinx_uartps.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c index eb61a07fcbbc3..07ea71a611678 100644 --- a/drivers/tty/serial/xilinx_uartps.c +++ b/drivers/tty/serial/xilinx_uartps.c @@ -1268,6 +1268,7 @@ static int cdns_uart_console_setup(struct console *co, char *options) int bits = 8; int parity = 'n'; int flow = 'n'; + unsigned long time_out; if (co->index < 0 || co->index >= CDNS_UART_NR_PORTS) return -EINVAL; @@ -1281,6 +1282,13 @@ static int cdns_uart_console_setup(struct console *co, char *options) if (options) uart_parse_options(options, &baud, &parity, &bits, &flow); + /* Wait for tx_empty before setting up the console */ + time_out = jiffies + usecs_to_jiffies(TX_TIMEOUT); + + while (time_before(jiffies, time_out) && + cdns_uart_tx_empty(port) != TIOCSER_TEMT) + cpu_relax(); + return uart_set_options(port, co, baud, parity, bits, flow); } -- 2.25.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH AUTOSEL 4.9 64/90] serial: uartps: Wait for tx_empty in console setup 2020-09-18 2:14 ` [PATCH AUTOSEL 4.9 64/90] serial: uartps: Wait for tx_empty in console setup Sasha Levin @ 2020-09-28 20:11 ` Naresh Kamboju 2020-09-28 20:13 ` Naresh Kamboju 0 siblings, 1 reply; 6+ messages in thread From: Naresh Kamboju @ 2020-09-28 20:11 UTC (permalink / raw) To: Sasha Levin, Raviteja Narayanam Cc: Greg Kroah-Hartman, Shubhrajyoti Datta, open list, linux- stable, lkft-triage, linux-serial, Linux ARM On Fri, 18 Sep 2020 at 07:55, Sasha Levin <sashal@kernel.org> wrote: > > From: Raviteja Narayanam <raviteja.narayanam@xilinx.com> > > [ Upstream commit 42e11948ddf68b9f799cad8c0ddeab0a39da33e8 ] > > On some platforms, the log is corrupted while console is being > registered. It is observed that when set_termios is called, there > are still some bytes in the FIFO to be transmitted. > > So, wait for tx_empty inside cdns_uart_console_setup before calling > set_termios. > > Signed-off-by: Raviteja Narayanam <raviteja.narayanam@xilinx.com> > Reviewed-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com> > Link: https://lore.kernel.org/r/1586413563-29125-2-git-send-email-raviteja.narayanam@xilinx.com > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> > Signed-off-by: Sasha Levin <sashal@kernel.org> stable rc 4.9 arm64 build broken. drivers/tty/serial/xilinx_uartps.c: In function 'cdns_uart_console_setup': drivers/tty/serial/xilinx_uartps.c:1286:40: error: 'TX_TIMEOUT' undeclared (first use in this function); did you mean 'ETIMEDOUT'? time_out = jiffies + usecs_to_jiffies(TX_TIMEOUT); ^~~~~~~~~~ ETIMEDOUT drivers/tty/serial/xilinx_uartps.c:1286:40: note: each undeclared identifier is reported only once for each function it appears in CC drivers/usb/core/port.o scripts/Makefile.build:304: recipe for target 'drivers/tty/serial/xilinx_uartps.o' failed make[5]: *** [drivers/tty/serial/xilinx_uartps.o] Error 1 Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org> full test log link, https://ci.linaro.org/view/lkft/job/openembedded-lkft-linux-stable-rc-4.9/DISTRO=lkft,MACHINE=hikey,label=docker-lkft/996/consoleText > --- > drivers/tty/serial/xilinx_uartps.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c > index eb61a07fcbbc3..07ea71a611678 100644 > --- a/drivers/tty/serial/xilinx_uartps.c > +++ b/drivers/tty/serial/xilinx_uartps.c > @@ -1268,6 +1268,7 @@ static int cdns_uart_console_setup(struct console *co, char *options) > int bits = 8; > int parity = 'n'; > int flow = 'n'; > + unsigned long time_out; > > if (co->index < 0 || co->index >= CDNS_UART_NR_PORTS) > return -EINVAL; > @@ -1281,6 +1282,13 @@ static int cdns_uart_console_setup(struct console *co, char *options) > if (options) > uart_parse_options(options, &baud, &parity, &bits, &flow); > > + /* Wait for tx_empty before setting up the console */ > + time_out = jiffies + usecs_to_jiffies(TX_TIMEOUT); > + > + while (time_before(jiffies, time_out) && > + cdns_uart_tx_empty(port) != TIOCSER_TEMT) > + cpu_relax(); > + > return uart_set_options(port, co, baud, parity, bits, flow); > } > > -- > 2.25.1 > -- Linaro LKFT https://lkft.linaro.org _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH AUTOSEL 4.9 64/90] serial: uartps: Wait for tx_empty in console setup 2020-09-28 20:11 ` Naresh Kamboju @ 2020-09-28 20:13 ` Naresh Kamboju 2020-09-29 6:59 ` Greg Kroah-Hartman 0 siblings, 1 reply; 6+ messages in thread From: Naresh Kamboju @ 2020-09-28 20:13 UTC (permalink / raw) To: Sasha Levin, Raviteja Narayanam Cc: Greg Kroah-Hartman, Shubhrajyoti Datta, open list, linux- stable, lkft-triage, linux-serial, Linux ARM On Tue, 29 Sep 2020 at 01:41, Naresh Kamboju <naresh.kamboju@linaro.org> wrote: > > On Fri, 18 Sep 2020 at 07:55, Sasha Levin <sashal@kernel.org> wrote: > > > > From: Raviteja Narayanam <raviteja.narayanam@xilinx.com> > > > > [ Upstream commit 42e11948ddf68b9f799cad8c0ddeab0a39da33e8 ] > > > > On some platforms, the log is corrupted while console is being > > registered. It is observed that when set_termios is called, there > > are still some bytes in the FIFO to be transmitted. > > > > So, wait for tx_empty inside cdns_uart_console_setup before calling > > set_termios. > > > > Signed-off-by: Raviteja Narayanam <raviteja.narayanam@xilinx.com> > > Reviewed-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com> > > Link: https://lore.kernel.org/r/1586413563-29125-2-git-send-email-raviteja.narayanam@xilinx.com > > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> > > Signed-off-by: Sasha Levin <sashal@kernel.org> > > stable rc 4.9 arm64 build broken. and stable rc 4.9 arm build broken. > > drivers/tty/serial/xilinx_uartps.c: In function 'cdns_uart_console_setup': > drivers/tty/serial/xilinx_uartps.c:1286:40: error: 'TX_TIMEOUT' > undeclared (first use in this function); did you mean 'ETIMEDOUT'? > time_out = jiffies + usecs_to_jiffies(TX_TIMEOUT); > ^~~~~~~~~~ > ETIMEDOUT > drivers/tty/serial/xilinx_uartps.c:1286:40: note: each undeclared > identifier is reported only once for each function it appears in > CC drivers/usb/core/port.o > scripts/Makefile.build:304: recipe for target > 'drivers/tty/serial/xilinx_uartps.o' failed > make[5]: *** [drivers/tty/serial/xilinx_uartps.o] Error 1 > > Reported-by: Naresh Kamboju <naresh.kamboju@linaro.org> > > full test log link, > https://ci.linaro.org/view/lkft/job/openembedded-lkft-linux-stable-rc-4.9/DISTRO=lkft,MACHINE=hikey,label=docker-lkft/996/consoleText > > > > --- > > drivers/tty/serial/xilinx_uartps.c | 8 ++++++++ > > 1 file changed, 8 insertions(+) > > > > diff --git a/drivers/tty/serial/xilinx_uartps.c b/drivers/tty/serial/xilinx_uartps.c > > index eb61a07fcbbc3..07ea71a611678 100644 > > --- a/drivers/tty/serial/xilinx_uartps.c > > +++ b/drivers/tty/serial/xilinx_uartps.c > > @@ -1268,6 +1268,7 @@ static int cdns_uart_console_setup(struct console *co, char *options) > > int bits = 8; > > int parity = 'n'; > > int flow = 'n'; > > + unsigned long time_out; > > > > if (co->index < 0 || co->index >= CDNS_UART_NR_PORTS) > > return -EINVAL; > > @@ -1281,6 +1282,13 @@ static int cdns_uart_console_setup(struct console *co, char *options) > > if (options) > > uart_parse_options(options, &baud, &parity, &bits, &flow); > > > > + /* Wait for tx_empty before setting up the console */ > > + time_out = jiffies + usecs_to_jiffies(TX_TIMEOUT); > > + > > + while (time_before(jiffies, time_out) && > > + cdns_uart_tx_empty(port) != TIOCSER_TEMT) > > + cpu_relax(); > > + > > return uart_set_options(port, co, baud, parity, bits, flow); > > } > > > > -- > > 2.25.1 > > > > > -- > Linaro LKFT > https://lkft.linaro.org _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH AUTOSEL 4.9 64/90] serial: uartps: Wait for tx_empty in console setup 2020-09-28 20:13 ` Naresh Kamboju @ 2020-09-29 6:59 ` Greg Kroah-Hartman 2020-09-29 17:39 ` Sasha Levin 0 siblings, 1 reply; 6+ messages in thread From: Greg Kroah-Hartman @ 2020-09-29 6:59 UTC (permalink / raw) To: Naresh Kamboju Cc: Sasha Levin, Raviteja Narayanam, Shubhrajyoti Datta, open list, linux- stable, lkft-triage, linux-serial, Linux ARM On Tue, Sep 29, 2020 at 01:43:22AM +0530, Naresh Kamboju wrote: > On Tue, 29 Sep 2020 at 01:41, Naresh Kamboju <naresh.kamboju@linaro.org> wrote: > > > > On Fri, 18 Sep 2020 at 07:55, Sasha Levin <sashal@kernel.org> wrote: > > > > > > From: Raviteja Narayanam <raviteja.narayanam@xilinx.com> > > > > > > [ Upstream commit 42e11948ddf68b9f799cad8c0ddeab0a39da33e8 ] > > > > > > On some platforms, the log is corrupted while console is being > > > registered. It is observed that when set_termios is called, there > > > are still some bytes in the FIFO to be transmitted. > > > > > > So, wait for tx_empty inside cdns_uart_console_setup before calling > > > set_termios. > > > > > > Signed-off-by: Raviteja Narayanam <raviteja.narayanam@xilinx.com> > > > Reviewed-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com> > > > Link: https://lore.kernel.org/r/1586413563-29125-2-git-send-email-raviteja.narayanam@xilinx.com > > > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> > > > Signed-off-by: Sasha Levin <sashal@kernel.org> > > > > stable rc 4.9 arm64 build broken. > > and stable rc 4.9 arm build broken. Thanks, I've queued up the dependant patch, somehow Sasha's builders must have missed this :) greg k-h _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH AUTOSEL 4.9 64/90] serial: uartps: Wait for tx_empty in console setup 2020-09-29 6:59 ` Greg Kroah-Hartman @ 2020-09-29 17:39 ` Sasha Levin 0 siblings, 0 replies; 6+ messages in thread From: Sasha Levin @ 2020-09-29 17:39 UTC (permalink / raw) To: Greg Kroah-Hartman Cc: Raviteja Narayanam, Naresh Kamboju, Shubhrajyoti Datta, open list, linux- stable, lkft-triage, linux-serial, Linux ARM On Tue, Sep 29, 2020 at 08:59:02AM +0200, Greg Kroah-Hartman wrote: >On Tue, Sep 29, 2020 at 01:43:22AM +0530, Naresh Kamboju wrote: >> On Tue, 29 Sep 2020 at 01:41, Naresh Kamboju <naresh.kamboju@linaro.org> wrote: >> > >> > On Fri, 18 Sep 2020 at 07:55, Sasha Levin <sashal@kernel.org> wrote: >> > > >> > > From: Raviteja Narayanam <raviteja.narayanam@xilinx.com> >> > > >> > > [ Upstream commit 42e11948ddf68b9f799cad8c0ddeab0a39da33e8 ] >> > > >> > > On some platforms, the log is corrupted while console is being >> > > registered. It is observed that when set_termios is called, there >> > > are still some bytes in the FIFO to be transmitted. >> > > >> > > So, wait for tx_empty inside cdns_uart_console_setup before calling >> > > set_termios. >> > > >> > > Signed-off-by: Raviteja Narayanam <raviteja.narayanam@xilinx.com> >> > > Reviewed-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com> >> > > Link: https://lore.kernel.org/r/1586413563-29125-2-git-send-email-raviteja.narayanam@xilinx.com >> > > Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> >> > > Signed-off-by: Sasha Levin <sashal@kernel.org> >> > >> > stable rc 4.9 arm64 build broken. >> >> and stable rc 4.9 arm build broken. > >Thanks, I've queued up the dependant patch, somehow Sasha's builders >must have missed this :) Because it doesn't fail here with an allmodconfig :( sasha@sasha-builder:~/data/linux$ git checkout queue-4.9 HEAD is now at 77d58b1b4d54 kprobes: Fix to check probe enabled before disarm_kprobe_ftrace() sasha@sasha-builder:~/data/linux$ make ARCH=arm64 CROSS_COMPILE="/home/sasha/x-tools/aarch64-unknown-linux-android/bin/aarch64-unknown-linux-android-" allmodconfig scripts/kconfig/conf --allmodconfig Kconfig # # configuration written to .config # sasha@sasha-builder:~/data/linux$ make ARCH=arm64 CROSS_COMPILE="/home/sasha/x-tools/aarch64-unknown-linux-gnu/bin/aarch64-unknown-linux-gnu-" drivers/tty/serial/xilinx_uartps.o CHK include/config/kernel.release CHK include/generated/uapi/linux/version.h CHK include/generated/utsrelease.h CHK include/generated/bounds.h CHK include/generated/timeconst.h CHK include/generated/asm-offsets.h CALL scripts/checksyscalls.sh CHK scripts/mod/devicetable-offsets.h CC [M] drivers/tty/serial/xilinx_uartps.o -- Thanks, Sasha _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2020-09-29 17:40 UTC | newest] Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- [not found] <20200918021455.2067301-1-sashal@kernel.org> 2020-09-18 2:13 ` [PATCH AUTOSEL 4.9 24/90] dmaengine: zynqmp_dma: fix burst length configuration Sasha Levin 2020-09-18 2:14 ` [PATCH AUTOSEL 4.9 64/90] serial: uartps: Wait for tx_empty in console setup Sasha Levin 2020-09-28 20:11 ` Naresh Kamboju 2020-09-28 20:13 ` Naresh Kamboju 2020-09-29 6:59 ` Greg Kroah-Hartman 2020-09-29 17:39 ` Sasha Levin
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).