<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/tty/serial/pch_uart.c, branch linux-5.10.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.10.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.10.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2025-08-28T14:22:27Z</updated>
<entry>
<title>pch_uart: Fix dma_sync_sg_for_device() nents value</title>
<updated>2025-08-28T14:22:27Z</updated>
<author>
<name>Thomas Fourier</name>
</author>
<published>2025-07-01T11:34:52Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=955440488eb76991c1f0d8733ad64315b1b4318d'/>
<id>urn:sha1:955440488eb76991c1f0d8733ad64315b1b4318d</id>
<content type='text'>
commit 6c0e9f05c9d7875995b0e92ace71be947f280bbd upstream.

The dma_sync_sg_for_device() functions should be called with the same
nents as the dma_map_sg(), not the value the map function returned
according to the documentation in Documentation/core-api/dma-api.rst:450:
	With the sync_sg API, all the parameters must be the same
	as those passed into the sg mapping API.

Fixes: da3564ee027e ("pch_uart: add multi-scatter processing")
Cc: stable &lt;stable@kernel.org&gt;
Signed-off-by: Thomas Fourier &lt;fourier.thomas@gmail.com&gt;
Reviewed-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20250701113452.18590-2-fourier.thomas@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serial: pch_uart: Pass correct sg to dma_unmap_sg()</title>
<updated>2023-01-24T06:20:00Z</updated>
<author>
<name>Ilpo Järvinen</name>
</author>
<published>2023-01-03T09:34:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c9da2cb968ea9604ab0e742b523b997fb05b4994'/>
<id>urn:sha1:c9da2cb968ea9604ab0e742b523b997fb05b4994</id>
<content type='text'>
commit e8914b52e5b024e4af3d810a935fe0805eee8a36 upstream.

A local variable sg is used to store scatterlist pointer in
pch_dma_tx_complete(). The for loop doing Tx byte accounting before
dma_unmap_sg() alters sg in its increment statement. Therefore, the
pointer passed into dma_unmap_sg() won't match to the one given to
dma_map_sg().

To fix the problem, use priv-&gt;sg_tx_p directly in dma_unmap_sg()
instead of the local variable.

Fixes: da3564ee027e ("pch_uart: add multi-scatter processing")
Cc: stable@vger.kernel.org
Signed-off-by: Ilpo Järvinen &lt;ilpo.jarvinen@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20230103093435.4396-1-ilpo.jarvinen@linux.intel.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serial: pch: Fix PCI device refcount leak in pch_request_dma()</title>
<updated>2023-01-14T09:15:56Z</updated>
<author>
<name>Xiongfeng Wang</name>
</author>
<published>2022-11-22T11:45:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=07f4ca68b0f6bf84b6b391c14b59fd179fcde9c5'/>
<id>urn:sha1:07f4ca68b0f6bf84b6b391c14b59fd179fcde9c5</id>
<content type='text'>
[ Upstream commit 8be3a7bf773700534a6e8f87f6ed2ed111254be5 ]

As comment of pci_get_slot() says, it returns a pci_device with its
refcount increased. The caller must decrement the reference count by
calling pci_dev_put().

Since 'dma_dev' is only used to filter the channel in filter(), we can
call pci_dev_put() before exiting from pch_request_dma(). Add the
missing pci_dev_put() for the normal and error path.

Fixes: 3c6a483275f4 ("Serial: EG20T: add PCH_UART driver")
Signed-off-by: Xiongfeng Wang &lt;wangxiongfeng2@huawei.com&gt;
Link: https://lore.kernel.org/r/20221122114559.27692-1-wangxiongfeng2@huawei.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>serial: pch: don't overwrite xmit-&gt;buf[0] by x_char</title>
<updated>2022-06-09T08:21:28Z</updated>
<author>
<name>Jiri Slaby</name>
</author>
<published>2022-05-03T08:08:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=10c5088a312dd5311da9e13370629972fe42da88'/>
<id>urn:sha1:10c5088a312dd5311da9e13370629972fe42da88</id>
<content type='text'>
commit d9f3af4fbb1d955bbaf872d9e76502f6e3e803cb upstream.

When x_char is to be sent, the TX path overwrites whatever is in the
circular buffer at offset 0 with x_char and sends it using
pch_uart_hal_write(). I don't understand how this was supposed to work
if xmit-&gt;buf[0] already contained some character. It must have been
lost.

Remove this whole pop_tx_x() concept and do the work directly in the
callers. (Without printing anything using dev_dbg().)

Cc: &lt;stable@vger.kernel.org&gt;
Fixes: 3c6a483275f4 (Serial: EG20T: add PCH_UART driver)
Signed-off-by: Jiri Slaby &lt;jslaby@suse.cz&gt;
Link: https://lore.kernel.org/r/20220503080808.28332-1-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>pch_uart: drop double zeroing</title>
<updated>2020-09-27T12:17:43Z</updated>
<author>
<name>Julia Lawall</name>
</author>
<published>2020-09-20T11:26:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=290ff182e92a3de286440c33990c98569ac329f4'/>
<id>urn:sha1:290ff182e92a3de286440c33990c98569ac329f4</id>
<content type='text'>
sg_init_table zeroes its first argument, so the allocation of that argument
doesn't have to.

the semantic patch that makes this change is as follows:
(http://coccinelle.lip6.fr/)

// &lt;smpl&gt;
@@
expression x,n,flags;
@@

x =
- kcalloc
+ kmalloc_array
  (n,sizeof(struct scatterlist),flags)
...
sg_init_table(x,n)
// &lt;/smpl&gt;

Signed-off-by: Julia Lawall &lt;Julia.Lawall@inria.fr&gt;

Link: https://lore.kernel.org/r/1600601186-7420-2-git-send-email-Julia.Lawall@inria.fr
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>serial: pch_uart: use generic power management</title>
<updated>2020-07-21T18:04:54Z</updated>
<author>
<name>Vaibhav Gupta</name>
</author>
<published>2020-07-20T12:04:15Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=23a98b6eb808e2080d6d4acba931b5db3aac9a16'/>
<id>urn:sha1:23a98b6eb808e2080d6d4acba931b5db3aac9a16</id>
<content type='text'>
Drivers using legacy PM have to manage PCI states and device's PM states
themselves. They also need to take care of configuration registers.

With improved and powerful support of generic PM, PCI Core takes care of
above mentioned, device-independent, jobs.

This driver makes use of PCI helper functions like
pci_save/restore_state(), pci_enable_device() and pci_set_power_state()
to do required operations. In generic mode, they are no longer needed.

Change function parameter in both .suspend() and .resume() to
"struct device*" type. Use dev_get_drvdata() to get drv data.

Compile-tested only.

Signed-off-by: Vaibhav Gupta &lt;vaibhavgupta40@gmail.com&gt;
Link: https://lore.kernel.org/r/20200720120414.399961-1-vaibhavgupta40@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty: serial: pch_uart: Use scnprintf() for avoiding potential buffer overflow</title>
<updated>2020-03-18T11:59:29Z</updated>
<author>
<name>Takashi Iwai</name>
</author>
<published>2020-03-11T09:29:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e39c0ffe8cc3cce212928168236bfd0c22965235'/>
<id>urn:sha1:e39c0ffe8cc3cce212928168236bfd0c22965235</id>
<content type='text'>
Since snprintf() returns the would-be-output size instead of the
actual output size, the succeeding calls may go beyond the given
buffer limit.  Fix it by replacing with scnprintf().

Signed-off-by: Takashi Iwai &lt;tiwai@suse.de&gt;
Link: https://lore.kernel.org/r/20200311092930.24433-1-tiwai@suse.de
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty/serial: pmac_zilog: Don't check port-&gt;sysrq</title>
<updated>2019-12-18T14:04:56Z</updated>
<author>
<name>Dmitry Safonov</name>
</author>
<published>2019-12-13T00:06:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=eff0a31d4b08797197718d2ecfa34f5f088e085c'/>
<id>urn:sha1:eff0a31d4b08797197718d2ecfa34f5f088e085c</id>
<content type='text'>
uart_handle_sysrq_char() already handles it.

Signed-off-by: Dmitry Safonov &lt;dima@arista.com&gt;
Link: https://lore.kernel.org/r/20191213000657.931618-31-dima@arista.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty/serial: Migrate pch_uart to use has_sysrq</title>
<updated>2019-12-18T14:04:55Z</updated>
<author>
<name>Dmitry Safonov</name>
</author>
<published>2019-12-13T00:06:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bb3ecd968b356f7a1399a7fe1fe98f3ab61632a9'/>
<id>urn:sha1:bb3ecd968b356f7a1399a7fe1fe98f3ab61632a9</id>
<content type='text'>
The SUPPORT_SYSRQ ifdeffery is not nice as:
- May create misunderstanding about sizeof(struct uart_port) between
  different objects
- Prevents moving functions from serial_core.h
- Reduces readability (well, it's ifdeffery - it's hard to follow)

In order to remove SUPPORT_SYSRQ, has_sysrq variable has been added.
Initialise it in driver's probe and remove ifdeffery.

Signed-off-by: Dmitry Safonov &lt;dima@arista.com&gt;
Link: https://lore.kernel.org/r/20191213000657.931618-30-dima@arista.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tty: serial: pch_uart: correct usage of dma_unmap_sg</title>
<updated>2019-11-13T13:54:15Z</updated>
<author>
<name>Peng Fan</name>
</author>
<published>2019-11-13T05:37:42Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=74887542fdcc92ad06a48c0cca17cdf09fc8aa00'/>
<id>urn:sha1:74887542fdcc92ad06a48c0cca17cdf09fc8aa00</id>
<content type='text'>
Per Documentation/DMA-API-HOWTO.txt,
To unmap a scatterlist, just call:
	dma_unmap_sg(dev, sglist, nents, direction);

.. note::

	The 'nents' argument to the dma_unmap_sg call must be
	the _same_ one you passed into the dma_map_sg call,
	it should _NOT_ be the 'count' value _returned_ from the
	dma_map_sg call.

However in the driver, priv-&gt;nent is directly assigned with value
returned from dma_map_sg, and dma_unmap_sg use priv-&gt;nent for unmap,
this breaks the API usage.

So introduce a new entry orig_nent to remember 'nents'.

Fixes: da3564ee027e ("pch_uart: add multi-scatter processing")
Signed-off-by: Peng Fan &lt;peng.fan@nxp.com&gt;
Link: https://lore.kernel.org/r/1573623259-6339-1-git-send-email-peng.fan@nxp.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
