From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-dy1-f174.google.com (mail-dy1-f174.google.com [74.125.82.174]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0CB27283FCF for ; Wed, 3 Jun 2026 01:00:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=74.125.82.174 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780448411; cv=none; b=U85Vz42RzP4YUlYT6PoIQjNAnxm2qpesd+8gxaMYq+EPmIVm/2ekrrwxQisYVrX7TgVWZtrmScmRH8D5jDd0ifUk9EhYSgSqBcjYwIFJ/t/6UW8iUZLkX9S1Se5eI+Wn0HMdr4Fu0jAxIMow2v3GXZHcnm9cXvOS9eXVbnTHu1A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780448411; c=relaxed/simple; bh=NukCw9t72hgYvil/R0gblf5Arsw/bmFSoTQ6ROmLpa0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=RGJvZAhqN22txrd1c3cEfc++JUielrY+BXZXHEwHZ4KVdlY6z+At9kFvNQ1SXOKUBLCG4S5UZprQrG6OOaLJISI94aQ/wCymNR29gihoUp4QBIzZGljFm+Pf590H0K7qInGwibzl9X0horOdmojF6Z+VhL6Z1zXe8QETTSv+hSM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=DyKk7CFz; arc=none smtp.client-ip=74.125.82.174 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="DyKk7CFz" Received: by mail-dy1-f174.google.com with SMTP id 5a478bee46e88-304c520fe9aso1499379eec.0 for ; Tue, 02 Jun 2026 18:00:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1780448409; x=1781053209; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=u1boD0i29cvw/FIchBYnDDoFVtHAicV6De2EffESY14=; b=DyKk7CFz+60VUf9xFkq2dR+WbDKig3qYbcCH26uYDJGoJrXIMS3cZ8hQb2Z15r3htz Xab1l3OHtB9FiOJFtQqHQIsW5fk5vuEmcbGE0PFvBsSii8BdtIlhjhvbHAB7JOwJJFwN 1F3wazMjt7xiY9Jbhr7ltDsk21lhDjZTVFA7RB0zTC47A4TDn3x6nHvYLNXreQfNLwyt V0kyn7Kd+uUkFL3wI4zOxE4zO+59MOv51aloxvl0ycGvoBoXBzgS1NPSgP7iKzhiGqV9 XWeMzBE0/WeIF0yHki1R1z52I86pmnR9rx2a11+MzDA1s1ufWF7UGbt8FjDZTY0imKAS NEpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780448409; x=1781053209; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=u1boD0i29cvw/FIchBYnDDoFVtHAicV6De2EffESY14=; b=Abj7a0ZNLWuq7ngmptrzlg2VXfIy22qYjQfsseDwhQ8/qZU88Th2i15Iqis/4CqIb6 xGiDHBt46iDTsHVZGkuF0jMigizduWehCztBV8cx4HBJtoD5C6G4vuQCmHjJo0uTzklO C1/140q8VVALxSR/wC/9k2H/A9Tgr28JBEhQJkZUhsIyJe0odeWFpSIs4lJYLYjxlZ9a OqZzYvFgbPZb4kEzxSOyRq6oJkh+Zs/bpqhQ3ML+7eWVBGUZXlJT+LbJdEY14nbHriFk nHlO5yt4dMEfJn5FrW7D1eshUw02tleFefdpzIVV/S8QOb77XrqbHv/KKVG3Fk3GBpt9 /C8A== X-Forwarded-Encrypted: i=1; AFNElJ+O1FgFSf/Lge3ludJXrk02hNTQAoU6kP+ITY5merIjD/Cjn5LBf07JIMoLVbLm8IbP/wnIbXX5x/iF/TI=@vger.kernel.org X-Gm-Message-State: AOJu0YwckcpCxPrTSXMAbBV8nWIOI6iV9O2mXou9bT57BrtVrSmryNuw /YxPliZgrXE3wodNSRhhF58znf4unYXSpXij+rQ3xYfMa8Ylgj0Ls8ly X-Gm-Gg: Acq92OHMNmz059nY2EP3hUbGdUr8XweF+/1HP2LiXZx1/KBOPlUJ6w8BR9g5MzTE3Ti vtPxcB+EHTdMwPp7gzDKx5yQ7Uj5mS9fixk8jFAN6+XssbDBKawOEFo7MAE9JQ2UM6meCw7Z28S WkKmGkirJh7K7lmfdjUOXe00tR2O3811Sq2IwV4VqEzDSQvKGEIUhWm7ciALsYWrmrEUX+B+ruo IsB3/ZCscr8ymLfdwj2/bkip0hmWX5Sp32TTFd+wPMvu57i93hJvmhM8TTCt/m/BqbpQKrU5KNF iChLNtTHXfzighb2/m28l3apqc3BH/jxjaK6tasTBBQsh+Z5b3IOY1cxR1pKDrneTQqVmTTWo9P zQRz+cVYifd5BrI8D0oNMitjUg0fpmm5PefndgbUkkxtrGenDMrpHKIgzcQkhzWDwIDnRIs8Uov zam0t7IHxVaWYZh9vIDUNyLAM4e1b4QbGLI0obvkQYAhv+7M1VG7Nag2c8G17nYccP/42d50f7i w8= X-Received: by 2002:a05:693c:37c8:b0:304:59cc:aee8 with SMTP id 5a478bee46e88-3074fbbd4e3mr585418eec.18.1780448408879; Tue, 02 Jun 2026 18:00:08 -0700 (PDT) Received: from google.com ([2a00:79e0:2ebe:8:c4f4:520b:1304:b259]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-3074dcbe995sm1371181eec.13.2026.06.02.18.00.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 18:00:08 -0700 (PDT) Date: Tue, 2 Jun 2026 18:00:05 -0700 From: Dmitry Torokhov To: =?utf-8?Q?Rapha=C3=ABl?= Larocque Cc: linux-input@vger.kernel.org, kees@kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] Input: synaptics - retry SMBus intertouch setup when companion is not ready Message-ID: References: <20260603002046.10697-1-rlarocque@disroot.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20260603002046.10697-1-rlarocque@disroot.org> Hi Raphaël, On Tue, Jun 02, 2026 at 08:20:46PM -0400, Raphaël Larocque wrote: > On some machines (here: Lenovo ThinkPad T440p 20AWS0H800), > the SMBus companion device is not ready > by the time psmouse probes the Synaptics touchpad > during early boot. synaptics_setup_intertouch() returns -EAGAIN in > this situation, but synaptics_init() previously treated this the same > as any other error and fell through immediately to PS/2 mode. As a > result, the touchpad and TrackPoint were unresponsive for several > minutes after a cold boot, until an internal reconnect cycle (which > already carries retry logic in synaptics_reconnect()) eventually > succeeded. > > Fix this by adding an exponential back-off retry loop in synaptics_init() > when synaptics_setup_intertouch() returns -EAGAIN: clean up the failed > state, sleep for 500 ms on the first attempt doubling each time up to > 4000 ms, then retry. The worst-case added latency at boot is ~7.5 s > (500 + 1000 + 2000 + 4000 ms), and only for hardware that actually > reports SYN_CAP_INTERTOUCH. The pattern mirrors what > synaptics_reconnect() already does after resume. > > Tested-by: Raphaël Larocque > Signed-off-by: Raphaël Larocque > --- > drivers/input/mouse/synaptics.c | 17 +++++++++++++++++ > 1 file changed, 17 insertions(+) > > diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c > index c70502e24031..5c1bfff2b16c 100644 > --- a/drivers/input/mouse/synaptics.c > +++ b/drivers/input/mouse/synaptics.c > @@ -1918,6 +1918,23 @@ int synaptics_init(struct psmouse *psmouse) > } > > error = synaptics_setup_intertouch(psmouse, &info, true); > + if (error == -EAGAIN) { > + /* > + * On some systems (e.g. ThinkPad T440p) the SMBus > + * companion device is not yet ready at boot time. > + * Clean up and retry with exponential back-off, > + * mirroring synaptics_reconnect(). > + */ > + unsigned int delay = 500; > + > + do { > + psmouse_smbus_cleanup(psmouse); > + msleep(delay); > + error = synaptics_setup_intertouch(psmouse, &info, true); > + delay *= 2; > + } while (error == -EAGAIN && delay <= 4000); > + } > + The idea here is that if adapter/device is not ready we leave enuough "breadcumbs" for it to recognize when SMBus companion appears and complete the initialization without repeatedly cleaning up and retrying initialization anew. Could you enable logging and see where the logic fails for you? I am not too keen on simply adding up to 8 seconds delay to the boot time. Thanks. -- Dmitry