<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/drivers/tty, branch v6.5</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>serial: core: Fix serial core port id, including multiport devices</title>
<updated>2023-08-11T19:19:22+00:00</updated>
<author>
<name>Tony Lindgren</name>
<email>tony@atomide.com</email>
</author>
<published>2023-08-11T10:36:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=04c7f60ca477ffbf7b7910320482335050f0d23a'/>
<id>04c7f60ca477ffbf7b7910320482335050f0d23a</id>
<content type='text'>
We want to fix the serial core port DEVNAME to use a port id of the
hardware specific controller port instance instead of the port-&gt;line.

For example, the 8250 driver sets up a number of serial8250 ports
initially that can be inherited by the hardware specific driver. At that
the port-&gt;line no longer decribes the port's relation to the serial core
controller instance.

Let's fix the issue by assigning port-&gt;port_id for each serial core
controller port instance.

Fixes: 7d695d83767c ("serial: core: Fix serial_base_match() after fixing controller port name")
Tested-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Reviewed-by: Dhruva Gole &lt;d-gole@ti.com&gt;
Signed-off-by: Tony Lindgren &lt;tony@atomide.com&gt;
Reviewed-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20230811103648.2826-1-tony@atomide.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We want to fix the serial core port DEVNAME to use a port id of the
hardware specific controller port instance instead of the port-&gt;line.

For example, the 8250 driver sets up a number of serial8250 ports
initially that can be inherited by the hardware specific driver. At that
the port-&gt;line no longer decribes the port's relation to the serial core
controller instance.

Let's fix the issue by assigning port-&gt;port_id for each serial core
controller port instance.

Fixes: 7d695d83767c ("serial: core: Fix serial_base_match() after fixing controller port name")
Tested-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Reviewed-by: Dhruva Gole &lt;d-gole@ti.com&gt;
Signed-off-by: Tony Lindgren &lt;tony@atomide.com&gt;
Reviewed-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20230811103648.2826-1-tony@atomide.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>serial: 8250: drop lockdep annotation from serial8250_clear_IER()</title>
<updated>2023-08-11T19:19:18+00:00</updated>
<author>
<name>Jiri Slaby (SUSE)</name>
<email>jirislaby@kernel.org</email>
</author>
<published>2023-08-11T06:43:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=3d9e6f556e235ddcdc9f73600fdd46fe1736b090'/>
<id>3d9e6f556e235ddcdc9f73600fdd46fe1736b090</id>
<content type='text'>
The port lock is not always held when calling serial8250_clear_IER().
When an oops is in progress, the lock is tried to be taken and when it
is not, a warning is issued:
 WARNING: CPU: 0 PID: 1 at drivers/tty/serial/8250/8250_port.c:707 	+0x57/0x60
 Modules linked in:
 CPU: 0 PID: 1 Comm: init Not tainted 6.5.0-rc5-1.g225bfb7-default+ #774 00f1be860db663ed29479b8255d3b01ab1135bd3
 Hardware name: QEMU Standard PC ...
 RIP: 0010:serial8250_clear_IER+0x57/0x60
...
 Call Trace:
  &lt;TASK&gt;
  serial8250_console_write+0x9e/0x4b0
  console_flush_all+0x217/0x5f0
...

Therefore, remove the annotation as it doesn't hold for all invocations.

The other option would be to make the lockdep test conditional on
'oops_in_progress' or pass 'locked' from serial8250_console_write(). I
don't think, that is worth it.

Signed-off-by: "Jiri Slaby (SUSE)" &lt;jirislaby@kernel.org&gt;
Reported-by: Vlastimil Babka &lt;vbabka@suse.cz&gt;
Cc: John Ogness &lt;john.ogness@linutronix.de&gt;
Fixes: d0b309a5d3f4 (serial: 8250: synchronize and annotate UART_IER access)
Link: https://lore.kernel.org/r/20230811064340.13400-1-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The port lock is not always held when calling serial8250_clear_IER().
When an oops is in progress, the lock is tried to be taken and when it
is not, a warning is issued:
 WARNING: CPU: 0 PID: 1 at drivers/tty/serial/8250/8250_port.c:707 	+0x57/0x60
 Modules linked in:
 CPU: 0 PID: 1 Comm: init Not tainted 6.5.0-rc5-1.g225bfb7-default+ #774 00f1be860db663ed29479b8255d3b01ab1135bd3
 Hardware name: QEMU Standard PC ...
 RIP: 0010:serial8250_clear_IER+0x57/0x60
...
 Call Trace:
  &lt;TASK&gt;
  serial8250_console_write+0x9e/0x4b0
  console_flush_all+0x217/0x5f0
...

Therefore, remove the annotation as it doesn't hold for all invocations.

The other option would be to make the lockdep test conditional on
'oops_in_progress' or pass 'locked' from serial8250_console_write(). I
don't think, that is worth it.

Signed-off-by: "Jiri Slaby (SUSE)" &lt;jirislaby@kernel.org&gt;
Reported-by: Vlastimil Babka &lt;vbabka@suse.cz&gt;
Cc: John Ogness &lt;john.ogness@linutronix.de&gt;
Fixes: d0b309a5d3f4 (serial: 8250: synchronize and annotate UART_IER access)
Link: https://lore.kernel.org/r/20230811064340.13400-1-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>tty: n_gsm: fix the UAF caused by race condition in gsm_cleanup_mux</title>
<updated>2023-08-11T19:17:02+00:00</updated>
<author>
<name>Yi Yang</name>
<email>yiyang13@huawei.com</email>
</author>
<published>2023-08-11T03:11:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=3c4f8333b582487a2d1e02171f1465531cde53e3'/>
<id>3c4f8333b582487a2d1e02171f1465531cde53e3</id>
<content type='text'>
In commit 9b9c8195f3f0 ("tty: n_gsm: fix UAF in gsm_cleanup_mux"), the UAF
problem is not completely fixed. There is a race condition in
gsm_cleanup_mux(), which caused this UAF.

The UAF problem is triggered by the following race:
task[5046]                     task[5054]
-----------------------        -----------------------
gsm_cleanup_mux();
dlci = gsm-&gt;dlci[0];
mutex_lock(&amp;gsm-&gt;mutex);
                               gsm_cleanup_mux();
			       dlci = gsm-&gt;dlci[0]; //Didn't take the lock
gsm_dlci_release(gsm-&gt;dlci[i]);
gsm-&gt;dlci[i] = NULL;
mutex_unlock(&amp;gsm-&gt;mutex);
                               mutex_lock(&amp;gsm-&gt;mutex);
			       dlci-&gt;dead = true; //UAF

Fix it by assigning values after mutex_lock().

Link: https://syzkaller.appspot.com/text?tag=CrashReport&amp;x=176188b5a80000
Cc: stable &lt;stable@kernel.org&gt;
Fixes: 9b9c8195f3f0 ("tty: n_gsm: fix UAF in gsm_cleanup_mux")
Fixes: aa371e96f05d ("tty: n_gsm: fix restart handling via CLD command")
Signed-off-by: Yi Yang &lt;yiyang13@huawei.com&gt;
Co-developed-by: Qiumiao Zhang &lt;zhangqiumiao1@huawei.com&gt;
Signed-off-by: Qiumiao Zhang &lt;zhangqiumiao1@huawei.com&gt;
Link: https://lore.kernel.org/r/20230811031121.153237-1-yiyang13@huawei.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In commit 9b9c8195f3f0 ("tty: n_gsm: fix UAF in gsm_cleanup_mux"), the UAF
problem is not completely fixed. There is a race condition in
gsm_cleanup_mux(), which caused this UAF.

The UAF problem is triggered by the following race:
task[5046]                     task[5054]
-----------------------        -----------------------
gsm_cleanup_mux();
dlci = gsm-&gt;dlci[0];
mutex_lock(&amp;gsm-&gt;mutex);
                               gsm_cleanup_mux();
			       dlci = gsm-&gt;dlci[0]; //Didn't take the lock
gsm_dlci_release(gsm-&gt;dlci[i]);
gsm-&gt;dlci[i] = NULL;
mutex_unlock(&amp;gsm-&gt;mutex);
                               mutex_lock(&amp;gsm-&gt;mutex);
			       dlci-&gt;dead = true; //UAF

Fix it by assigning values after mutex_lock().

Link: https://syzkaller.appspot.com/text?tag=CrashReport&amp;x=176188b5a80000
Cc: stable &lt;stable@kernel.org&gt;
Fixes: 9b9c8195f3f0 ("tty: n_gsm: fix UAF in gsm_cleanup_mux")
Fixes: aa371e96f05d ("tty: n_gsm: fix restart handling via CLD command")
Signed-off-by: Yi Yang &lt;yiyang13@huawei.com&gt;
Co-developed-by: Qiumiao Zhang &lt;zhangqiumiao1@huawei.com&gt;
Signed-off-by: Qiumiao Zhang &lt;zhangqiumiao1@huawei.com&gt;
Link: https://lore.kernel.org/r/20230811031121.153237-1-yiyang13@huawei.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>serial: core: Revert port_id use</title>
<updated>2023-08-09T12:12:43+00:00</updated>
<author>
<name>Tony Lindgren</name>
<email>tony@atomide.com</email>
</author>
<published>2023-08-06T06:20:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=a4a79e03bab57729bd8046d22bf3666912e586fb'/>
<id>a4a79e03bab57729bd8046d22bf3666912e586fb</id>
<content type='text'>
Guenter reports boot issues with duplicate sysfs entries for multiport
drivers. Let's go back to using port-&gt;line for now to fix the regression.

With this change, the serial core port device names are not correct for the
hardware specific 8250 single port drivers, but that's a cosmetic issue for
now.

Fixes: d962de6ae51f ("serial: core: Fix serial core port id to not use port-&gt;line")
Reported-by: Guenter Roeck &lt;groeck7@gmail.com&gt;
Signed-off-by: Tony Lindgren &lt;tony@atomide.com&gt;
Tested-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Link: https://lore.kernel.org/r/20230806062052.47737-1-tony@atomide.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Guenter reports boot issues with duplicate sysfs entries for multiport
drivers. Let's go back to using port-&gt;line for now to fix the regression.

With this change, the serial core port device names are not correct for the
hardware specific 8250 single port drivers, but that's a cosmetic issue for
now.

Fixes: d962de6ae51f ("serial: core: Fix serial core port id to not use port-&gt;line")
Reported-by: Guenter Roeck &lt;groeck7@gmail.com&gt;
Signed-off-by: Tony Lindgren &lt;tony@atomide.com&gt;
Tested-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Link: https://lore.kernel.org/r/20230806062052.47737-1-tony@atomide.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>TIOCSTI: Document CAP_SYS_ADMIN behaviour in Kconfig</title>
<updated>2023-08-09T12:12:39+00:00</updated>
<author>
<name>Günther Noack</name>
<email>gnoack3000@gmail.com</email>
</author>
<published>2023-08-08T20:11:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=3f29d9ee323ae5cda59d144d1f8b0b10ea065be0'/>
<id>3f29d9ee323ae5cda59d144d1f8b0b10ea065be0</id>
<content type='text'>
Clarifies that the LEGACY_TIOCSTI setting is safe to turn off even
when running BRLTTY, as it was introduced in commit 690c8b804ad2
("TIOCSTI: always enable for CAP_SYS_ADMIN").

Signed-off-by: Günther Noack &lt;gnoack3000@gmail.com&gt;
Reviewed-by: Samuel Thibault &lt;samuel.thibault@ens-lyon.org&gt;
Link: https://lore.kernel.org/r/20230808201115.23993-1-gnoack3000@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Clarifies that the LEGACY_TIOCSTI setting is safe to turn off even
when running BRLTTY, as it was introduced in commit 690c8b804ad2
("TIOCSTI: always enable for CAP_SYS_ADMIN").

Signed-off-by: Günther Noack &lt;gnoack3000@gmail.com&gt;
Reviewed-by: Samuel Thibault &lt;samuel.thibault@ens-lyon.org&gt;
Link: https://lore.kernel.org/r/20230808201115.23993-1-gnoack3000@gmail.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>serial: 8250: Fix oops for port-&gt;pm on uart_change_pm()</title>
<updated>2023-08-04T15:14:38+00:00</updated>
<author>
<name>Tony Lindgren</name>
<email>tony@atomide.com</email>
</author>
<published>2023-08-04T13:15:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=dfe2aeb226fd5e19b0ee795f4f6ed8bc494c1534'/>
<id>dfe2aeb226fd5e19b0ee795f4f6ed8bc494c1534</id>
<content type='text'>
Unloading a hardware specific 8250 driver can produce error "Unable to
handle kernel paging request at virtual address" about ten seconds after
unloading the driver. This happens on uart_hangup() calling
uart_change_pm().

Turns out commit 04e82793f068 ("serial: 8250: Reinit port-&gt;pm on port
specific driver unbind") was only a partial fix. If the hardware specific
driver has initialized port-&gt;pm function, we need to clear port-&gt;pm too.
Just reinitializing port-&gt;ops does not do this. Otherwise serial8250_pm()
will call port-&gt;pm() instead of serial8250_do_pm().

Fixes: 04e82793f068 ("serial: 8250: Reinit port-&gt;pm on port specific driver unbind")
Signed-off-by: Tony Lindgren &lt;tony@atomide.com&gt;
Link: https://lore.kernel.org/r/20230804131553.52927-1-tony@atomide.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Unloading a hardware specific 8250 driver can produce error "Unable to
handle kernel paging request at virtual address" about ten seconds after
unloading the driver. This happens on uart_hangup() calling
uart_change_pm().

Turns out commit 04e82793f068 ("serial: 8250: Reinit port-&gt;pm on port
specific driver unbind") was only a partial fix. If the hardware specific
driver has initialized port-&gt;pm function, we need to clear port-&gt;pm too.
Just reinitializing port-&gt;ops does not do this. Otherwise serial8250_pm()
will call port-&gt;pm() instead of serial8250_do_pm().

Fixes: 04e82793f068 ("serial: 8250: Reinit port-&gt;pm on port specific driver unbind")
Signed-off-by: Tony Lindgren &lt;tony@atomide.com&gt;
Link: https://lore.kernel.org/r/20230804131553.52927-1-tony@atomide.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>serial: 8250: Reinit port_id when adding back serial8250_isa_devs</title>
<updated>2023-08-04T13:11:59+00:00</updated>
<author>
<name>Tony Lindgren</name>
<email>tony@atomide.com</email>
</author>
<published>2023-08-04T12:35:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=bbb4abb1bcfb5c25bc022ccecfea919286093b5d'/>
<id>bbb4abb1bcfb5c25bc022ccecfea919286093b5d</id>
<content type='text'>
After fixing the serial core port device to use port-&gt;port_id instead of
port-&gt;line, unloading a hardware specific 8250 port driver started
producing an error for "sysfs: cannot create duplicate filename".

This is happening as we are wrongly initializing port-&gt;port_id to zero
when adding back serial8250_isa_devs instances, and the serial8250:0.0
sysfs entry may already exist. For serial8250 devices, we typically have
multiple devices mapped to a single driver instance. For the
serial8250_isa_devs instances, the port-&gt;port_id is the same as port-&gt;line.

Let's fix the issue by re-initializing port_id when adding back the
serial8250_isa_devs instances in serial8250_unregister_port().

Fixes: d962de6ae51f ("serial: core: Fix serial core port id to not use port-&gt;line")
Signed-off-by: Tony Lindgren &lt;tony@atomide.com&gt;
Link: https://lore.kernel.org/r/20230804123546.25293-1-tony@atomide.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
After fixing the serial core port device to use port-&gt;port_id instead of
port-&gt;line, unloading a hardware specific 8250 port driver started
producing an error for "sysfs: cannot create duplicate filename".

This is happening as we are wrongly initializing port-&gt;port_id to zero
when adding back serial8250_isa_devs instances, and the serial8250:0.0
sysfs entry may already exist. For serial8250 devices, we typically have
multiple devices mapped to a single driver instance. For the
serial8250_isa_devs instances, the port-&gt;port_id is the same as port-&gt;line.

Let's fix the issue by re-initializing port_id when adding back the
serial8250_isa_devs instances in serial8250_unregister_port().

Fixes: d962de6ae51f ("serial: core: Fix serial core port id to not use port-&gt;line")
Signed-off-by: Tony Lindgren &lt;tony@atomide.com&gt;
Link: https://lore.kernel.org/r/20230804123546.25293-1-tony@atomide.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>serial: core: Fix kmemleak issue for serial core device remove</title>
<updated>2023-08-04T13:11:36+00:00</updated>
<author>
<name>Tony Lindgren</name>
<email>tony@atomide.com</email>
</author>
<published>2023-08-04T09:09:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=6be1a8d50b381ca022a79e47f2dc0d3aa698af14'/>
<id>6be1a8d50b381ca022a79e47f2dc0d3aa698af14</id>
<content type='text'>
Kmemleak reports issues for serial8250 ports after the hardware specific
driver takes over on boot as noted by Tomi.

The kerneldoc for device_initialize() says we must call device_put()
after calling device_initialize(). We are calling device_put() on the
error path, but are missing it from the device remove path. This causes
release() to never get called for the devices on remove.

Let's add the missing put_device() calls for both serial ctrl and
port devices.

Fixes: 84a9582fd203 ("serial: core: Start managing serial controllers to enable runtime PM")
Reported-by: Tomi Valkeinen &lt;tomi.valkeinen@ideasonboard.com&gt;
Signed-off-by: Tony Lindgren &lt;tony@atomide.com&gt;
Tested-by: Tomi Valkeinen &lt;tomi.valkeinen@ideasonboard.com&gt;
Link: https://lore.kernel.org/r/20230804090909.51529-1-tony@atomide.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Kmemleak reports issues for serial8250 ports after the hardware specific
driver takes over on boot as noted by Tomi.

The kerneldoc for device_initialize() says we must call device_put()
after calling device_initialize(). We are calling device_put() on the
error path, but are missing it from the device remove path. This causes
release() to never get called for the devices on remove.

Let's add the missing put_device() calls for both serial ctrl and
port devices.

Fixes: 84a9582fd203 ("serial: core: Start managing serial controllers to enable runtime PM")
Reported-by: Tomi Valkeinen &lt;tomi.valkeinen@ideasonboard.com&gt;
Signed-off-by: Tony Lindgren &lt;tony@atomide.com&gt;
Tested-by: Tomi Valkeinen &lt;tomi.valkeinen@ideasonboard.com&gt;
Link: https://lore.kernel.org/r/20230804090909.51529-1-tony@atomide.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>serial: core: Fix serial_base_match() after fixing controller port name</title>
<updated>2023-08-03T07:48:56+00:00</updated>
<author>
<name>Tony Lindgren</name>
<email>tony@atomide.com</email>
</author>
<published>2023-08-03T07:10:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=7d695d83767cdb4288b101affef6d1d1bcf44d31'/>
<id>7d695d83767cdb4288b101affef6d1d1bcf44d31</id>
<content type='text'>
While fixing DEVNAME to be more usable, I broke serial_base_match() as the
ctrl and port prefix for device names seemed unnecessary.

The prefixes are still needed by serial_base_match() to probe the serial
base controller port, and serial tx is now broken.

Let's fix the issue by checking against dev-&gt;type and drv-&gt;name instead
of the prefixes that are no longer in the DEVNAME.

Fixes: 1ef2c2df1199 ("serial: core: Fix serial core controller port name to show controller id")
Reported-by: kernel test robot &lt;oliver.sang@intel.com&gt;
Closes: https://lore.kernel.org/oe-lkp/202308021529.35b3ad6c-oliver.sang@intel.com
Signed-off-by: Tony Lindgren &lt;tony@atomide.com&gt;
Reviewed-by: Jiri Slaby &lt;jirislaby@kernel.org&gt;
Link: https://lore.kernel.org/r/20230803071034.25571-1-tony@atomide.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
While fixing DEVNAME to be more usable, I broke serial_base_match() as the
ctrl and port prefix for device names seemed unnecessary.

The prefixes are still needed by serial_base_match() to probe the serial
base controller port, and serial tx is now broken.

Let's fix the issue by checking against dev-&gt;type and drv-&gt;name instead
of the prefixes that are no longer in the DEVNAME.

Fixes: 1ef2c2df1199 ("serial: core: Fix serial core controller port name to show controller id")
Reported-by: kernel test robot &lt;oliver.sang@intel.com&gt;
Closes: https://lore.kernel.org/oe-lkp/202308021529.35b3ad6c-oliver.sang@intel.com
Signed-off-by: Tony Lindgren &lt;tony@atomide.com&gt;
Reviewed-by: Jiri Slaby &lt;jirislaby@kernel.org&gt;
Link: https://lore.kernel.org/r/20230803071034.25571-1-tony@atomide.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>serial: core: Fix serial core controller port name to show controller id</title>
<updated>2023-08-01T05:48:55+00:00</updated>
<author>
<name>Tony Lindgren</name>
<email>tony@atomide.com</email>
</author>
<published>2023-07-25T05:42:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=1ef2c2df11997b8135f34adcf2c200d3b4aacbe9'/>
<id>1ef2c2df11997b8135f34adcf2c200d3b4aacbe9</id>
<content type='text'>
We are missing the serial core controller id for the serial core port
name. Let's fix the issue for sane sysfs output, and to avoid issues
addressing serial ports later on.

And as we're now showing the controller id, the "ctrl" and "port" prefix
for the DEVNAME become useless, we can just drop them. Let's standardize on
DEVNAME:0 for controller name, where 0 is the controller id. And
DEVNAME:0.0 for port name, where 0.0 are the controller id and port id.

This makes the sysfs output nicer, on qemu for example:

$ ls /sys/bus/serial-base/devices
00:04:0         serial8250:0    serial8250:0.2
00:04:0.0       serial8250:0.1  serial8250:0.3

Fixes: 84a9582fd203 ("serial: core: Start managing serial controllers to enable runtime PM")
Reported-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Reviewed-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Signed-off-by: Tony Lindgren &lt;tony@atomide.com&gt;
Acked-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20230725054216.45696-4-tony@atomide.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We are missing the serial core controller id for the serial core port
name. Let's fix the issue for sane sysfs output, and to avoid issues
addressing serial ports later on.

And as we're now showing the controller id, the "ctrl" and "port" prefix
for the DEVNAME become useless, we can just drop them. Let's standardize on
DEVNAME:0 for controller name, where 0 is the controller id. And
DEVNAME:0.0 for port name, where 0.0 are the controller id and port id.

This makes the sysfs output nicer, on qemu for example:

$ ls /sys/bus/serial-base/devices
00:04:0         serial8250:0    serial8250:0.2
00:04:0.0       serial8250:0.1  serial8250:0.3

Fixes: 84a9582fd203 ("serial: core: Start managing serial controllers to enable runtime PM")
Reported-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Reviewed-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Signed-off-by: Tony Lindgren &lt;tony@atomide.com&gt;
Acked-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Link: https://lore.kernel.org/r/20230725054216.45696-4-tony@atomide.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
