[PATCH] parport: Mark daisy slave ports as announced

From: Guangshuo Li

Date: Sat Jul 04 2026 - 23:24:30 EST


Client drivers that register after a port has been announced only match
ports with PARPORT_ANNOUNCED set. parport_announce_port() sets this flag
for the master port, but it also announces daisy slave ports through
attach_driver_chain() without setting the flag on them.

As a result, slave ports can be matched by drivers that are already
registered when the port is announced, but they are skipped by drivers
that register later and discover existing ports through port_check().

Set PARPORT_ANNOUNCED for daisy slave ports when they are announced.

Fixes: ef15ccbb3e86 ("parport: Fix race between port and client registration")
Signed-off-by: Guangshuo Li <lgs201920130244@xxxxxxxxx>
---
drivers/parport/share.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/parport/share.c b/drivers/parport/share.c
index eb0977ca1605..ecae059dee59 100644
--- a/drivers/parport/share.c
+++ b/drivers/parport/share.c
@@ -533,8 +533,10 @@ void parport_announce_port(struct parport *port)
attach_driver_chain(port);
for (i = 1; i < 3; i++) {
struct parport *slave = port->slaves[i-1];
- if (slave)
+ if (slave) {
attach_driver_chain(slave);
+ set_bit(PARPORT_ANNOUNCED, &slave->devflags);
+ }
}
set_bit(PARPORT_ANNOUNCED, &port->devflags);
mutex_unlock(&registration_lock);
--
2.43.0