Skip to content

Commit 3533a98

Browse files
pcercueiQuzarDC
authored andcommitted
maple: Unplug top device after all sub-devices
Sometimes, and in particular when using rumble, the top maple device on a port can get unresponsive for an unknown reason. Instead of considering it unplugged right away and unregistering it and all its children devices, unregister it only if all of its sub-devices have already been detected as unplugged. Signed-off-by: Paul Cercueil <paul@crapouillou.net>
1 parent f64b49e commit 3533a98

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

kernel/arch/dreamcast/hardware/maple/maple_irq.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -131,14 +131,8 @@ static void vbl_autodet_callback(maple_state_t *state, maple_frame_t *frm) {
131131
if(resp->response == MAPLE_RESPONSE_NONE) {
132132
/* No device, or not functioning properly; check for removal */
133133
if(u == 0) {
134-
if(dev) {
135-
/* Top-level device -- detach all sub-devices as well */
136-
for(u = 0; u < MAPLE_UNIT_COUNT; u++) {
137-
vbl_chk_disconnect(state, p, u);
138-
}
139-
140-
dev->dev_mask = 0;
141-
}
134+
if(dev && dev->dev_mask == 0)
135+
vbl_chk_disconnect(state, p, 0);
142136

143137
state->scan_ready_mask |= 1 << p;
144138
}

0 commit comments

Comments
 (0)