<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/tty/serial/msm_serial.c, branch linux-4.11.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.11.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.11.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2017-01-12T10:51:25Z</updated>
<entry>
<title>tty: serial: msm: Fix module autoload</title>
<updated>2017-01-12T10:51:25Z</updated>
<author>
<name>Javier Martinez Canillas</name>
</author>
<published>2017-01-02T14:57:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=abe81f3b8ed2996e1712d26d38ff6b73f582c616'/>
<id>urn:sha1:abe81f3b8ed2996e1712d26d38ff6b73f582c616</id>
<content type='text'>
If the driver is built as a module, autoload won't work because the module
alias information is not filled. So user-space can't match the registered
device with the corresponding module.

Export the module alias information using the MODULE_DEVICE_TABLE() macro.

Before this patch:

$ modinfo drivers/tty/serial/msm_serial.ko | grep alias
$

After this patch:

$ modinfo drivers/tty/serial/msm_serial.ko | grep alias
alias:          of:N*T*Cqcom,msm-uartdmC*
alias:          of:N*T*Cqcom,msm-uartdm
alias:          of:N*T*Cqcom,msm-uartC*
alias:          of:N*T*Cqcom,msm-uart

Signed-off-by: Javier Martinez Canillas &lt;javier@osg.samsung.com&gt;
Acked-by: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
Cc: stable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty: serial: msm: fix definition of msm_stop_dma</title>
<updated>2016-06-25T17:23:54Z</updated>
<author>
<name>Ben Dooks</name>
</author>
<published>2016-06-07T18:11:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9a3f5bf275e68b6651a2bc935beaac938cf27adc'/>
<id>urn:sha1:9a3f5bf275e68b6651a2bc935beaac938cf27adc</id>
<content type='text'>
The msm_stop_dma() is not exported from the driver, so make
it static to stop the following warning:

drivers/tty/serial/msm_serial.c:84:6: warning: symbol 'msm_stop_dma' was not declared. Should it be static?

Signed-off-by: Ben Dooks &lt;ben.dooks@codethink.co.uk&gt;
Acked-by: Andy Gross &lt;andy.gross@linaro.org&gt;
Reviewed-by: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
Reviewed-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty: serial: msm: Don't read off end of tx fifo</title>
<updated>2016-06-25T17:23:54Z</updated>
<author>
<name>Bjorn Andersson</name>
</author>
<published>2016-06-03T00:48:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=30acf549ca1e81859a67590ab9ecfce3d1050a0b'/>
<id>urn:sha1:30acf549ca1e81859a67590ab9ecfce3d1050a0b</id>
<content type='text'>
For dm uarts in pio mode tx data is transferred to the fifo register 4
bytes at a time, but care is not taken when these 4 bytes spans the end
of the xmit buffer so the loop might read up to 3 bytes past the buffer
and then skip the actual data at the beginning of the buffer.

Fix this by, analogous to the DMA case, make sure the chunk doesn't
wrap the xmit buffer.

Fixes: 3a878c430fd6 ("tty: serial: msm: Add TX DMA support")
Cc: Ivan Ivanov &lt;iivanov.xz@gmail.com&gt;
Cc: stable@vger.kernel.org
Reported-by: Frank Rowand &lt;frowand.list@gmail.com&gt;
Reported-by: Nicolas Dechesne &lt;nicolas.dechesne@linaro.org&gt;
Signed-off-by: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
Acked-by: Andy Gross &lt;andy.gross@linaro.org&gt;
Tested-by: Frank Rowand &lt;frank.rowand@am.sony.com&gt;
Reviewed-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty:serial:msm:Do not restore Rx interrupts in DMA</title>
<updated>2016-06-25T17:23:54Z</updated>
<author>
<name>Charanya Venkatraman</name>
</author>
<published>2016-06-07T10:28:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=002eb41f303e007011aecba25ea6de25a4ed475f'/>
<id>urn:sha1:002eb41f303e007011aecba25ea6de25a4ed475f</id>
<content type='text'>
Avoid data corruption issues that result in CRC errors during file
transfers over serial ports at higher baud rates.

The current msm_serial driver masks the FIFO Rx interrupts in
msm_start_rx_dma() since Rx FIFO interrupts are not required in DMA
mode. However, msm_complete_rx_dma() re-enables the Rx FIFO interrupts
which could cause RXSTALE event to be processed when a TXLEV interrupt
occurs.

The following is the sequence of events that could occur resulting in
data corruption.

msm_start_rx_dma -&gt; msm_complete_rx_dma --&gt;
spin_unlock_irqrestore(&amp;port-&gt;lock) --&gt;
msm_uart_irq()(For TXLEV interrupt) --&gt;  msm_handle_rx_dm() (Read from
FIFO resulting in data corruption)

The patch fixes the issue by not restoring the RXLEV and RXSTALE
interrupts in msm_complete_rx_dma(). These interrupts are required only
in FIFO mode.

Signed-off-by: Charanya Venkatraman &lt;charanya@codeaurora.org&gt;
Acked-by: Andy Gross &lt;andy.gross@linaro.org&gt;
Reviewed-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty: serial: msm: Cleanup include usage</title>
<updated>2016-06-25T17:23:54Z</updated>
<author>
<name>Stephen Boyd</name>
</author>
<published>2016-05-12T01:02:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e4276ff8a08116f22589b4f52974cf82cd3207db'/>
<id>urn:sha1:e4276ff8a08116f22589b4f52974cf82cd3207db</id>
<content type='text'>
The hrtimer include isn't used and neither is serial. Drop those
ones. The irq.h header really should be interrupt.h because this
is an interrupt user and not an interrupt chip. Finally add
wait.h for the wake_up*() usage in this driver and kernel.h for
container_of().

Signed-off-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
Acked-by: Andy Gross &lt;andy.gross@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty: serial: msm: Only configure MND registers on hw that has it</title>
<updated>2016-06-25T17:23:54Z</updated>
<author>
<name>Stephen Boyd</name>
</author>
<published>2016-05-12T01:02:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2a31f094553125e0353b9f7e7b6e9aeea752fed3'/>
<id>urn:sha1:2a31f094553125e0353b9f7e7b6e9aeea752fed3</id>
<content type='text'>
The registers that msm_serial_set_mnd_regs() writes only exist on
the non-uartdm hardware, so let's return early here if this
function is called on uartdm hardware. This also prevents us from
messing up the uartclk variable if the uartclk rate happens to be
19.2 or 4.8 MHz.

Signed-off-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
Acked-by: Andy Gross &lt;andy.gross@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty: serial: msm: Move header file into driver</title>
<updated>2016-06-25T17:23:54Z</updated>
<author>
<name>Stephen Boyd</name>
</author>
<published>2016-05-12T01:02:26Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=321737416c72dc3d3dd8753c3684c6eb86d0ea6c'/>
<id>urn:sha1:321737416c72dc3d3dd8753c3684c6eb86d0ea6c</id>
<content type='text'>
This header file is only used by the driver, so let's merge the
two together to reduce files and make it easier to see the whole
driver without flipping through two files. This also makes it
easier to use the structures defined in msm_serial.c in the
functions that are defined in msm_serial.h by placing them in the
proper locations.

Signed-off-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
Acked-by: Andy Gross &lt;andy.gross@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty: serial: msm: Support more bauds</title>
<updated>2016-04-30T16:26:55Z</updated>
<author>
<name>Stephen Boyd</name>
</author>
<published>2016-03-25T21:35:49Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=98952bf510d0c7cdfc284f098bbf4682dc47bc61'/>
<id>urn:sha1:98952bf510d0c7cdfc284f098bbf4682dc47bc61</id>
<content type='text'>
The msm_find_best_baud() function is written with the assumption
that the port-&gt;uartclk rate is fixed to a particular rate at boot
time, but now this driver changes that clk rate at runtime when
the baud is changed.

The way the hardware works is that an input clk rate comes from
the clk controller into the uart hw block. That rate is typically
1843200 or 3686400 Hz. That rate can then be divided by an
internal divider in the hw block to achieve a particular baud on
the serial wire. msm_find_best_baud() is looking for that divider
value.

A few things are wrong with the way the code is written. First,
it assumes that the maximum baud that the uart can support if the
clk rate is fixed at boot is 460800, which would correspond to an
input clk rate of 230400 * 16 == 3686400 Hz.  Except some devices
have a boot rate of 1843200 Hz or max baud of 115200, so
achieving 230400 on those devices doesn't work at all because we
don't increase the clk rate unless max baud is 460800.

Second, we can't achieve bauds higher than 460800 that require
anything besides a divisor of 1, because we always call
msm_find_best_baud() with a fixed port-&gt;uartclk rate that will
eventually be changed after we calculate the divisor. So if we
need to get a baud of 500000, we'll just multiply that by 16 and
hope that the clk can give us 500000 * 16 == 8000000 Hz, which it
typically can't do. To really achieve 500000 baud, we need to get
an input clk rate of 24000000 Hz and then divide that by 3 inside
the uart hardware.

Finally, we return success for bauds even when we can't actually
achieve them. This means that when the user asks for 500000 baud,
we actually get 921600 right now, but the user doesn't know that.

Fix all of this by searching through the divisor and clk rate
space with a combination of clk_round_rate() and baud
calculations, keeping track of the best clk rate and divisor we
find if we can't get an exact match. Typically we can get an
exact match with a divisor of 1, but sometimes we need to keep
track and try more frequencies. On my msm8916 device, this
results in all standard bauds in baud_table being supported
except for 1800, 576000, 1152000, and 4000000.

Fixes: 850b37a71bde ("tty: serial: msm: Remove 115.2 Kbps maximum baud rate limitation")
Cc: "Ivan T. Ivanov" &lt;iivanov.xz@gmail.com&gt;
Cc: Matthew McClintock &lt;mmcclint@codeaurora.org&gt;
Signed-off-by: Stephen Boyd &lt;stephen.boyd@linaro.org&gt;
Tested-by: Srinivas Kandagatla &lt;srinivas.kandagatla@linaro.org&gt;
Acked-by: Andy Gross &lt;andy.gross@linaro.org&gt;
Acked-by: Bjorn Andersson &lt;bjorn.andersson@linaro.org&gt;
Tested-by: Cristian Prundeanu &lt;cprundea@codeaurora.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty: msm_serial: remove static clk rate setting in probe</title>
<updated>2016-04-30T16:26:55Z</updated>
<author>
<name>Srinivas Kandagatla</name>
</author>
<published>2016-03-07T02:46:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=79c9473f115f99906b6ae443708b8ece480e2e88'/>
<id>urn:sha1:79c9473f115f99906b6ae443708b8ece480e2e88</id>
<content type='text'>
The issue with setting up a fixed clock rate at probe is that it would
overwrite the console rate set by the bootloader for its console device.
This would result in serial out corruption or missing log when we system
is booted with earlycon. This is not a issue if we boot system without
earlycon.

This setup is at least not required with the mainline driver, this code
used to be required because the clk_enable() call would fail if
clk_set_rate() wasn't called first.

Originally the issue was noticed on DB410c which is based on APQ8016
chipset.

Without this patch the console log with earlycon would look like:
...
[    0.000000] RCU: Adjusting geometry for rcu_fanout_leaf=64, nr_cpu_ids=1
[    0.000000] NR_IRQS:64 nr_irqs:64 0
����+HH��0.699378] console [ttyMSM0] enabled
[    0.699378] console [ttyMSM0] enabled
[    0.702003] bootconsole [uart0] disabled
[    0.702003] bootconsole [uart0] disabled
...

with this patch I can see all the skipped lines on the console

Reviewed-by: Stephen Boyd &lt;sboyd@codeaurora.org&gt;
Signed-off-by: Srinivas Kandagatla &lt;srinivas.kandagatla@linaro.org&gt;
Acked-by: Andy Gross &lt;andy.gross@linaro.org&gt;
Tested-by: Pramod Gurav &lt;gpramod@codeaurora.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>earlycon: Use common framework for earlycon declarations</title>
<updated>2016-02-07T06:07:37Z</updated>
<author>
<name>Peter Hurley</name>
</author>
<published>2016-01-16T23:23:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2eaa790989e03900298ad24f77f1086dbbc1aebd'/>
<id>urn:sha1:2eaa790989e03900298ad24f77f1086dbbc1aebd</id>
<content type='text'>
Use a single common table of struct earlycon_id for both command line
and devicetree. Re-define OF_EARLYCON_DECLARE() macro to instance a
unique earlycon declaration (the declaration is only guaranteed to be
unique within a compilation unit; separate compilation units must still
use unique earlycon names).

The semantics of OF_EARLYCON_DECLARE() is different; it declares an
earlycon which can matched either on the command line or by devicetree.
EARLYCON_DECLARE() is semantically unchanged; it declares an earlycon
which is matched by command line only. Remove redundant instances of
EARLYCON_DECLARE().

This enables all earlycons to properly initialize struct console
with the appropriate name and index, which improves diagnostics and
enables direct earlycon-to-console handoff.

Acked-by: Rob Herring &lt;robh@kernel.org&gt;
Signed-off-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
