Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1384384lqp; Mon, 15 Apr 2024 05:12:12 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUBUWq7LWFmJObhBvOnLWZUY1j9Va0NVF9QDJVxsEO/r+Lx+47sHuFybZwzNH0ipBH/U9mx6vZY0bN9j5BUGvidPNDpEGaluKld+t4oEw== X-Google-Smtp-Source: AGHT+IG95MBTdPtdZg4wHOS8dF0sgu/0oNjBE3iXJdc7Dsu9MPU3fxHmZ1FNVGFeYWZbtCd4Cplr X-Received: by 2002:a17:907:7d8c:b0:a52:44fa:3796 with SMTP id oz12-20020a1709077d8c00b00a5244fa3796mr7341284ejc.36.1713183132441; Mon, 15 Apr 2024 05:12:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713183132; cv=pass; d=google.com; s=arc-20160816; b=w1DeS/maVNVNO5GUqSoJgGr/5ngve4PnwocY4nYAv7csLIAI55T+u8WAr4SbB7id8v ZwF/GTn3PbGXbcGsqq0N4fjTRYsHWMEpwkBopE/2+yeyNLT3Aly8qWLmHIhDwma3PPL5 2l1Ou0UBxvEKRtd+4kAaV3Ke6S/dxuJ1MBKpXkDxl0I/WiUMQOuGoj6xu8Liz+6hMtkJ O45AeYDCPdIv2EwAeqo4tSjptHIHGkthNPkj6iEoK/eveQuAKOCariazIhQS2LNkAqqM WNx7rWCBixECcyWATlfp2IRny4T6DMEYvNpO2ySB2k97aYSPzyb/nkHWQK8qVcO/mIOx qjEQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=uZcPwUmPewYNTemFmRAkQ3TSjOKlDhuahQQ3LNghFA4=; fh=D1piF3aC+6vNQgqzsdla+dxk/NsqYzD5hC34uuTw63U=; b=iEpLLD8Ro/rhfOwVG2NtpsqD/h4loX+8B0rjK07CciyDvwbyQZNwmrxdKa+FYmYSIW Izk/U31twnmpllUsVbV4loFfhX2YRqh5wBb/rMGsRrzhb3tWpgLIs4eaRic/cFqJjyrc lA7nyloB2W/bWh1YYRxClh91fCUn2uVfCjt8mzbWRgTjfzf2zNdL9xcxTPS4WRToNA6F INSKzAYsbcP3TnBQ0I0FJKOLfDqxnM/tOBzJcA5j81/fbcVtEpvRhZ232fNy8xxuqSHD H2bBKhfVPn42Sb9uahUjV4F7Nwry3um/GzguP0B2t02vc0e7k0eQCTkS8mWgBErWX457 iIvA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=yAWmEK2q; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-145041-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145041-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id do4-20020a170906c10400b00a5211f83c2esi4686012ejc.662.2024.04.15.05.12.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 05:12:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-145041-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=yAWmEK2q; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-145041-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145041-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 218AB1F22537 for ; Mon, 15 Apr 2024 12:12:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1A8846AFB6; Mon, 15 Apr 2024 12:11:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="yAWmEK2q" Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42]) (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 ACDF169D2B for ; Mon, 15 Apr 2024 12:11:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713183062; cv=none; b=KyQZ24RdWn1hKy2T7rknL/PWNC343c4YQn8Fl/1to2HXexg5o7doORn5lbx2pOH30fpLOGMVlYWFMs3yobkWOYE3Jmp1+gRGBxvzjlkex9CHWnOgIIE2j1Xs+q5UgK5D8PkcsojLEbKs1CKurSYdqmD5OWvWmNvLyOP78jYGr3U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713183062; c=relaxed/simple; bh=uZcPwUmPewYNTemFmRAkQ3TSjOKlDhuahQQ3LNghFA4=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=eBJ0Jg9i70iGS7CeF5XYQsY3dd37JDTaVgE85l4yApjR7SrJH4Gr7fr4839FlAb1iIwhrk1/uMypJoyaulCEv4XtYz6U9h1jtQZW9T9+oDF5EL8ATtMVDPVWvLXLhxFA0ZTyr4PSA9iK0HSex8E6ZWuRzz1weYrfC/WB+a9ka1s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=yAWmEK2q; arc=none smtp.client-ip=209.85.167.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-lf1-f42.google.com with SMTP id 2adb3069b0e04-516d0c004b1so4009152e87.2 for ; Mon, 15 Apr 2024 05:11:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1713183059; x=1713787859; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=uZcPwUmPewYNTemFmRAkQ3TSjOKlDhuahQQ3LNghFA4=; b=yAWmEK2qZr9qTKpAjlHLCuayjYpVKGIZjYuP++ChFVkbzDHan4pJhIXER0SdhSOSBr 43ww4DEWP2DdmtLx1NZYxqlXY3b1urqQnNFcma3hZgOwGnjqwGVVU00eQnFHN2Lz5ss0 w4cf2cI1OrZlGPbOzbRbpq5NR5vZ/5E5yLzHDGrV7GmJqT3ky6vc+JLhQzaKN6nhDZfN 5rc0gTvAQ3r3Zb5ZRtIk2meVRgZG09MEuQ9X+VpMVGr6ey7b4jzjCMl/mXq2LCPltCEV WTmYG9f99zSDGXXIDd4m/GBzbydrWdViW+tUlG4YpmtDeN1tweWuuWQuAIp0AqFqmpxA MPKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713183059; x=1713787859; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uZcPwUmPewYNTemFmRAkQ3TSjOKlDhuahQQ3LNghFA4=; b=Q3lF9YU8j/9nqAGovWSk99h56/MgY8sLDOes0et9Wt2trsICHS2LeaUerChGAqHrXF 6FKpD+AJ+jZXU0Rd8YVWZxYL/EU4oIoTbcK0u2aO1Rq8LHzre5wodnQW35fSEBKoZ71V TqjT+cyDds4fbzvWQB43uh2SaRl5ff3nYoN/QsQHM6Aw/ez4/nvCD+3w81ryLXbCDnbA XOo+Mwr99bQHVz/up+d8anmjyA7uE7DTPz7eX70d0Wt0GdAJ8knV8qMMqnsdgP+VYGJs i4/+zp+zd8Gwlt9x6hSqEj8F8eX4PcXymDqqxyh7EVOhSC6AhdFiYd5x034Hnygru81d hNHg== X-Forwarded-Encrypted: i=1; AJvYcCUHq6o0uPu4XqwdQjAb6OPY260EPxLre2kLFZ76gd6w32A/k8hyV8mrBQnofig+INLyrDy+Ih5+pQC2rNP3g6AWRGbfxkZxppSUuuRi X-Gm-Message-State: AOJu0YzpypLv0i7eZc/ZjBTSo0EToEBVgWxmfmHSUleVvcEBP3ft5Ryo TUCTa8wzLUQs4UrbcItiuSOD+WcqGWZLskFUkyotBiljIDS/+SYWnhEZaEh0aiul5HN/i33pWrL 2x0mV86XhaIUr2EsqHDfj4H25kaVvKQ+UKjM+ X-Received: by 2002:ac2:4c9c:0:b0:516:d18b:eaed with SMTP id d28-20020ac24c9c000000b00516d18beaedmr8334452lfl.30.1713183058739; Mon, 15 Apr 2024 05:10:58 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <81e1b870-37f9-4ef2-9a3d-87015f32546b@kl.wtf> In-Reply-To: <81e1b870-37f9-4ef2-9a3d-87015f32546b@kl.wtf> From: Radoslaw Biernacki Date: Mon, 15 Apr 2024 14:10:41 +0200 Message-ID: Subject: Re: [PATCH v2] HID: i2c-hid: wait for i2c touchpad deep-sleep to power-up transition To: Kenny Levinsen Cc: lma@chromium.org, benjamin.tissoires@redhat.com, dianders@chromium.org, dtor@chromium.org, hdegoede@redhat.com, jikos@kernel.org, johan+linaro@kernel.org, johan@kernel.org, kai.heng.feng@canonical.com, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, mripard@kernel.org, rad@chromium.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Kenny, > If the device can enter deep-sleep arbitrarily, then we presumably also > have problems in i2c_hid_output_raw_report() and > i2c_hid_get_raw_report() which could happen after the device has gone to > sleep from inactivity. These places would also need EREMOTEIO retry logic= . It does not enter deep-sleep arbitrarily and therefore it is not a problem = with other communication patterns. The design which was chosen back in the day, to save the battery power is event based instead of level based (some HW line). Therefore to avoid power leak we need to request low power state (to prevent power leak in case the kernel will not boot up soon). Basically we need to take out the device from deep state logic by message, without knowing if the device is on the bus or it is on the bus but not responding. > > All these places should have the same sleeping behavior as they are > working around the same device glitch. I imagine the client ACK timeout > is longer than your required 400=C2=B5s, in which case you don't need any > sleep on retry at all, as is the case in the current i2c_hid_set_power() > implementation. > > However, as we litter retry-code all over the place, Johan's suggestion > about doing this in the I2C driver does become a bit more relevant... > > Best regards, > Kenny Levinsen >