Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Input: psmouse - set up dependency between PS/2 and SMBus companions

When we switch from emulated PS/2 to native (RMI4 or Elan) protocols, we
create SMBus companion devices that are attached to I2C/SMBus controllers.
However, when suspending and resuming, we also need to make sure that we
take into account the PS/2 device they are associated with, so that PS/2
device is suspended after the companion and resumed before it, otherwise
companions will not work properly. Before I2C devices were marked for
asynchronous suspend/resume, this ordering happened naturally, but now we
need to enforce it by establishing device links, with PS/2 devices being
suppliers and SMBus companions being consumers.

Fixes: 172d931910e1 ("i2c: enable async suspend/resume on i2c client devices")
Reported-and-tested-by: Hugh Dickins <hughd@google.com>
Tested-by: Jarkko Nikula <jarkko.nikula@linux.intel.com>
Link: https://lore.kernel.org/r/89456fcd-a113-4c82-4b10-a9bcaefac68f@google.com
Link: https://lore.kernel.org/r/YgwQN8ynO88CPMju@google.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

+10
+10
drivers/input/mouse/psmouse-smbus.c
··· 75 75 "Marking SMBus companion %s as gone\n", 76 76 dev_name(&smbdev->client->dev)); 77 77 smbdev->dead = true; 78 + device_link_remove(&smbdev->client->dev, 79 + &smbdev->psmouse->ps2dev.serio->dev); 78 80 serio_rescan(smbdev->psmouse->ps2dev.serio); 79 81 } else { 80 82 list_del(&smbdev->node); ··· 176 174 kfree(smbdev); 177 175 } else { 178 176 smbdev->dead = true; 177 + device_link_remove(&smbdev->client->dev, 178 + &psmouse->ps2dev.serio->dev); 179 179 psmouse_dbg(smbdev->psmouse, 180 180 "posting removal request for SMBus companion %s\n", 181 181 dev_name(&smbdev->client->dev)); ··· 274 270 275 271 if (smbdev->client) { 276 272 /* We have our companion device */ 273 + if (!device_link_add(&smbdev->client->dev, 274 + &psmouse->ps2dev.serio->dev, 275 + DL_FLAG_STATELESS)) 276 + psmouse_warn(psmouse, 277 + "failed to set up link with iSMBus companion %s\n", 278 + dev_name(&smbdev->client->dev)); 277 279 return 0; 278 280 } 279 281