<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/tty/serial/samsung.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-05-20T12:49:49Z</updated>
<entry>
<title>serial: samsung: Add missing checks for dma_map_single failure</title>
<updated>2017-05-20T12:49:49Z</updated>
<author>
<name>Marek Szyprowski</name>
</author>
<published>2017-04-03T06:21:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=cd823aa0bc50184ae104bac88904ab843763c27c'/>
<id>urn:sha1:cd823aa0bc50184ae104bac88904ab843763c27c</id>
<content type='text'>
commit 500fcc08a32bfd54f11951ba81530775df15c474 upstream.

This patch adds missing checks for dma_map_single() failure and proper error
reporting. Although this issue was harmless on ARM architecture, it is always
good to use the DMA mapping API in a proper way. This patch fixes the following
DMA API debug warning:

WARNING: CPU: 1 PID: 3785 at lib/dma-debug.c:1171 check_unmap+0x8a0/0xf28
dma-pl330 121a0000.pdma: DMA-API: device driver failed to check map error[device address=0x000000006e0f9000] [size=4096 bytes] [mapped as single]
Modules linked in:
CPU: 1 PID: 3785 Comm: (agetty) Tainted: G        W       4.11.0-rc1-00137-g07ca963-dirty #59
Hardware name: SAMSUNG EXYNOS (Flattened Device Tree)
[&lt;c011aaa4&gt;] (unwind_backtrace) from [&lt;c01127c0&gt;] (show_stack+0x20/0x24)
[&lt;c01127c0&gt;] (show_stack) from [&lt;c06ba5d8&gt;] (dump_stack+0x84/0xa0)
[&lt;c06ba5d8&gt;] (dump_stack) from [&lt;c0139528&gt;] (__warn+0x14c/0x180)
[&lt;c0139528&gt;] (__warn) from [&lt;c01395a4&gt;] (warn_slowpath_fmt+0x48/0x50)
[&lt;c01395a4&gt;] (warn_slowpath_fmt) from [&lt;c072a114&gt;] (check_unmap+0x8a0/0xf28)
[&lt;c072a114&gt;] (check_unmap) from [&lt;c072a834&gt;] (debug_dma_unmap_page+0x98/0xc8)
[&lt;c072a834&gt;] (debug_dma_unmap_page) from [&lt;c0803874&gt;] (s3c24xx_serial_shutdown+0x314/0x52c)
[&lt;c0803874&gt;] (s3c24xx_serial_shutdown) from [&lt;c07f5124&gt;] (uart_port_shutdown+0x54/0x88)
[&lt;c07f5124&gt;] (uart_port_shutdown) from [&lt;c07f522c&gt;] (uart_shutdown+0xd4/0x110)
[&lt;c07f522c&gt;] (uart_shutdown) from [&lt;c07f6a8c&gt;] (uart_hangup+0x9c/0x208)
[&lt;c07f6a8c&gt;] (uart_hangup) from [&lt;c07c426c&gt;] (__tty_hangup+0x49c/0x634)
[&lt;c07c426c&gt;] (__tty_hangup) from [&lt;c07c78ac&gt;] (tty_ioctl+0xc88/0x16e4)
[&lt;c07c78ac&gt;] (tty_ioctl) from [&lt;c03b5f2c&gt;] (do_vfs_ioctl+0xc4/0xd10)
[&lt;c03b5f2c&gt;] (do_vfs_ioctl) from [&lt;c03b6bf4&gt;] (SyS_ioctl+0x7c/0x8c)
[&lt;c03b6bf4&gt;] (SyS_ioctl) from [&lt;c010b4a0&gt;] (ret_fast_syscall+0x0/0x3c)

Reported-by: Seung-Woo Kim &lt;sw0312.kim@samsung.com&gt;
Fixes: 62c37eedb74c8 ("serial: samsung: add dma reqest/release functions")
Signed-off-by: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Reviewed-by: Bartlomiej Zolnierkiewicz &lt;b.zolnierkie@samsung.com&gt;
Reviewed-by: Shuah Khan &lt;shuahkh@osg.samsung.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>serial: samsung: Use right device for DMA-mapping calls</title>
<updated>2017-05-20T12:49:49Z</updated>
<author>
<name>Marek Szyprowski</name>
</author>
<published>2017-04-03T06:20:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=43a1c1ff12c0662769b051ea06a19bdba165fccf'/>
<id>urn:sha1:43a1c1ff12c0662769b051ea06a19bdba165fccf</id>
<content type='text'>
commit 768d64f491a530062ddad50e016fb27125f8bd7c upstream.

Driver should provide its own struct device for all DMA-mapping calls instead
of extracting device pointer from DMA engine channel. Although this is harmless
from the driver operation perspective on ARM architecture, it is always good
to use the DMA mapping API in a proper way. This patch fixes following DMA API
debug warning:

WARNING: CPU: 0 PID: 0 at lib/dma-debug.c:1241 check_sync+0x520/0x9f4
samsung-uart 12c20000.serial: DMA-API: device driver tries to sync DMA memory it has not allocated [device address=0x000000006df0f580] [size=64 bytes]
Modules linked in:
CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.11.0-rc1-00137-g07ca963 #51
Hardware name: SAMSUNG EXYNOS (Flattened Device Tree)
[&lt;c011aaa4&gt;] (unwind_backtrace) from [&lt;c01127c0&gt;] (show_stack+0x20/0x24)
[&lt;c01127c0&gt;] (show_stack) from [&lt;c06ba5d8&gt;] (dump_stack+0x84/0xa0)
[&lt;c06ba5d8&gt;] (dump_stack) from [&lt;c0139528&gt;] (__warn+0x14c/0x180)
[&lt;c0139528&gt;] (__warn) from [&lt;c01395a4&gt;] (warn_slowpath_fmt+0x48/0x50)
[&lt;c01395a4&gt;] (warn_slowpath_fmt) from [&lt;c0729058&gt;] (check_sync+0x520/0x9f4)
[&lt;c0729058&gt;] (check_sync) from [&lt;c072967c&gt;] (debug_dma_sync_single_for_device+0x88/0xc8)
[&lt;c072967c&gt;] (debug_dma_sync_single_for_device) from [&lt;c0803c10&gt;] (s3c24xx_serial_start_tx_dma+0x100/0x2f8)
[&lt;c0803c10&gt;] (s3c24xx_serial_start_tx_dma) from [&lt;c0804338&gt;] (s3c24xx_serial_tx_chars+0x198/0x33c)

Reported-by: Seung-Woo Kim &lt;sw0312.kim@samsung.com&gt;
Fixes: 62c37eedb74c8 ("serial: samsung: add dma reqest/release functions")
Signed-off-by: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Reviewed-by: Bartlomiej Zolnierkiewicz &lt;b.zolnierkie@samsung.com&gt;
Reviewed-by: Krzysztof Kozlowski &lt;krzk@kernel.org&gt;
Reviewed-by: Shuah Khan &lt;shuahkh@osg.samsung.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>serial: samsung: Continue to work if DMA request fails</title>
<updated>2017-03-07T18:58:37Z</updated>
<author>
<name>Krzysztof Kozlowski</name>
</author>
<published>2017-02-25T16:36:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f98c7bce570bdbe344b74ff5daa7dfeef3f22929'/>
<id>urn:sha1:f98c7bce570bdbe344b74ff5daa7dfeef3f22929</id>
<content type='text'>
If DMA is not available (even when configured in DeviceTree), the driver
will fail the startup procedure thus making serial console not
available.

For example this causes boot failure on QEMU ARMv7 (Exynos4210, SMDKC210):
    [    1.302575] OF: amba_device_add() failed (-19) for /amba/pdma@12680000
    ...
    [   11.435732] samsung-uart 13800000.serial: DMA request failed
    [   72.963893] samsung-uart 13800000.serial: DMA request failed
    [   73.143361] Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000000

DMA is not necessary for serial to work, so continue with UART startup
after emitting a warning.

Fixes: 62c37eedb74c ("serial: samsung: add dma reqest/release functions")
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Krzysztof Kozlowski &lt;krzk@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serial: samsung: enable clock before accessing interrupt mask resister</title>
<updated>2017-02-03T09:12:16Z</updated>
<author>
<name>남영민</name>
</author>
<published>2017-02-01T10:25:46Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a8a1781b87266a1b006e2223581facd0517e555b'/>
<id>urn:sha1:a8a1781b87266a1b006e2223581facd0517e555b</id>
<content type='text'>
Ensure that the uart clock is enabled prior to writing to the
interrupt mask register in s3c24xx_serial_resume_noirq function.
Without enabing the uart clock, the uart register cannot be accessed.

Signed-off-by: Youngmin Nam &lt;youngmin.nam@samsung.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serial: samsung: Simplify DMA engine initialization code</title>
<updated>2017-01-12T10:51:24Z</updated>
<author>
<name>Marek Szyprowski</name>
</author>
<published>2016-12-16T09:56:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ba3d6f8f10c3897e0edde3069beb0bfbe81783a6'/>
<id>urn:sha1:ba3d6f8f10c3897e0edde3069beb0bfbe81783a6</id>
<content type='text'>
dma_request_slave_channel_compat() requires filter function and mask, which
are not needed on device tree based platforms, so simplify the code by
calling the more appropriate dma_request_chan() function. This additionally
gives us proper error handling, because the new function returns error
codes instead of NULL on failure.

Signed-off-by: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Reviewed-by: Sylwester Nawrocki &lt;s.nawrocki@samsung.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serial: samsung: Register cpufreq notifier only on S3C24xx</title>
<updated>2016-08-31T13:39:58Z</updated>
<author>
<name>Krzysztof Kozlowski</name>
</author>
<published>2016-06-27T11:59:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ebaa81c7287edd40dd4899e5d93a20e7a2b938e7'/>
<id>urn:sha1:ebaa81c7287edd40dd4899e5d93a20e7a2b938e7</id>
<content type='text'>
The Samsung serial driver registered for CPU frequency transitions to
recalculate its clock when ARM clock frequency changes.  This is needed
only on S3C24xx platform so limit the ifdef to respective cpufreq
driver.

On S3C24xx the ratio ratio between frequencies of UART's parent clock
(pclk) and ARM's parent clock (fclk) remains fixed.  Therefore when ARM
clock frequency goes down, the serial is also affected.

Suggested-by: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Signed-off-by: Krzysztof Kozlowski &lt;k.kozlowski@samsung.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty: serial: samsung: add byte-order aware bit functions</title>
<updated>2016-06-25T21:04:12Z</updated>
<author>
<name>Matthew Leach</name>
</author>
<published>2016-06-22T16:57:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bbb5ff91225dfbf3e5c27619552e41661048ed61'/>
<id>urn:sha1:bbb5ff91225dfbf3e5c27619552e41661048ed61</id>
<content type='text'>
This driver makes use of the __set_bit() and __clear_bit() functions.
When running under big-endian, these functions don't convert the bit
indexes when working with peripheral registers, leading to the
incorrect bits being set and cleared when running big-endian.

Add two new driver functions for setting and clearing bits that are
byte-order aware.

Signed-off-by: Matthew Leach &lt;matthew@mattleach.net&gt;
Reviewed-by: Krzysztof Kozlowski &lt;k.kozlowski@samsung.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serial: samsung: Fix possible out of bounds access on non-DT platform</title>
<updated>2016-06-25T20:50:53Z</updated>
<author>
<name>Krzysztof Kozlowski</name>
</author>
<published>2016-06-16T06:27:36Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=926b7b5122c96e1f18cd20e85a286c7ec8d18c97'/>
<id>urn:sha1:926b7b5122c96e1f18cd20e85a286c7ec8d18c97</id>
<content type='text'>
On non-DeviceTree platforms, the index of serial device is a static
variable incremented on each probe.  It is incremented even if deferred
probe happens when getting the clock in s3c24xx_serial_init_port().

This index is used for referencing elements of statically allocated
s3c24xx_serial_ports array.  In case of re-probe, the index will point
outside of this array leading to memory corruption.

Increment the index only on successful probe.

Reported-by: Bartlomiej Zolnierkiewicz &lt;b.zolnierkie@samsung.com&gt;
Fixes: b497549a035c ("[ARM] S3C24XX: Split serial driver into core and per-cpu drivers")
Signed-off-by: Krzysztof Kozlowski &lt;k.kozlowski@samsung.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serial: samsung: Fix ERR pointer dereference on deferred probe</title>
<updated>2016-06-25T20:50:53Z</updated>
<author>
<name>Krzysztof Kozlowski</name>
</author>
<published>2016-06-16T06:27:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e51e4d8a185de90424b03f30181b35f29c46a25a'/>
<id>urn:sha1:e51e4d8a185de90424b03f30181b35f29c46a25a</id>
<content type='text'>
When the clk_get() of "uart" clock returns EPROBE_DEFER, the next re-probe
finishes with success but uses invalid (ERR_PTR) values.  This leads to
dereferencing of ERR_PTR stored under ourport-&gt;clk:

	12c30000.serial: Controller clock not found
	(...)
	12c30000.serial: ttySAC3 at MMIO 0x12c30000 (irq = 61, base_baud = 0) is a S3C6400/10
	Unable to handle kernel paging request at virtual address fffffdfb

	(clk_prepare) from [&lt;c039f7d0&gt;] (s3c24xx_serial_pm+0x20/0x128)
	(s3c24xx_serial_pm) from [&lt;c0395414&gt;] (uart_change_pm+0x38/0x40)
	(uart_change_pm) from [&lt;c039689c&gt;] (uart_add_one_port+0x31c/0x44c)
	(uart_add_one_port) from [&lt;c03a035c&gt;] (s3c24xx_serial_probe+0x2a8/0x418)
	(s3c24xx_serial_probe) from [&lt;c03ee110&gt;] (platform_drv_probe+0x50/0xb0)
	(platform_drv_probe) from [&lt;c03ecb44&gt;] (driver_probe_device+0x1f4/0x2b0)
	(driver_probe_device) from [&lt;c03eb0c0&gt;] (bus_for_each_drv+0x44/0x8c)
	(bus_for_each_drv) from [&lt;c03ec8c8&gt;] (__device_attach+0x9c/0x100)
	(__device_attach) from [&lt;c03ebf54&gt;] (bus_probe_device+0x84/0x8c)
	(bus_probe_device) from [&lt;c03ec388&gt;] (deferred_probe_work_func+0x60/0x8c)
	(deferred_probe_work_func) from [&lt;c012fee4&gt;] (process_one_work+0x120/0x328)
	(process_one_work) from [&lt;c0130150&gt;] (worker_thread+0x2c/0x4ac)
	(worker_thread) from [&lt;c0135320&gt;] (kthread+0xd8/0xf4)
	(kthread) from [&lt;c0107978&gt;] (ret_from_fork+0x14/0x3c)

The first unsuccessful clk_get() causes s3c24xx_serial_init_port() to
exit with failure but the s3c24xx_uart_port is left half-configured
(e.g. port-&gt;mapbase is set, clk contains ERR_PTR).  On next re-probe,
the function s3c24xx_serial_init_port() will exit early with success
because of configured port-&gt;mapbase and driver will use old values,
including the ERR_PTR as clock.

Fix this by cleaning the port-&gt;mapbase on error path so each re-probe
will initialize all of the port settings.

Fixes: 60e93575476f ("serial: samsung: enable clock before clearing pending interrupts during init")
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Krzysztof Kozlowski &lt;k.kozlowski@samsung.com&gt;
Reviewed-by: Javier Martinez Canillas &lt;javier@osg.samsung.com&gt;
Tested-by: Javier Martinez Canillas &lt;javier@osg.samsung.com&gt;
Tested-by: Kevin Hilman &lt;khilman@baylibre.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serial: samsung: Reorder the sequence of clock control when call s3c24xx_serial_set_termios()</title>
<updated>2016-04-30T16:26:55Z</updated>
<author>
<name>Chanwoo Choi</name>
</author>
<published>2016-04-21T09:58:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=b8995f527aac143e83d3900ff39357651ea4e0f6'/>
<id>urn:sha1:b8995f527aac143e83d3900ff39357651ea4e0f6</id>
<content type='text'>
This patch fixes the broken serial log when changing the clock source
of uart device. Before disabling the original clock source, this patch
enables the new clock source to protect the clock off state for a split second.

Signed-off-by: Chanwoo Choi &lt;cw00.choi@samsung.com&gt;
Reviewed-by: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
