Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1385472lqp; Mon, 15 Apr 2024 05:14:08 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWu4xMXe38LcaQMWCL7ZDoooa89RjLW+v7fIzHZ2Sb6pa12yv6p1a017ViPxx6TlNYwdRdgp2yhayxn29KnDAos6WDruiJzcq+pv2Os8g== X-Google-Smtp-Source: AGHT+IFWhr4PC5tAR3U/n1tWr4JQa/WqKhGGMVaZS8D/aNGPoM3qtR/9Kh1naXC9/ZHizwkxrBO5 X-Received: by 2002:a05:6808:ab8:b0:3c6:eeb7:fded with SMTP id r24-20020a0568080ab800b003c6eeb7fdedmr9784891oij.23.1713183248315; Mon, 15 Apr 2024 05:14:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713183248; cv=pass; d=google.com; s=arc-20160816; b=YAyvcE4HFLp7nw686OfWbF3Opb2B0GJ2sXz5XvF6eY2y/P+r2KgNkkT4T78WeNcL43 z1LCV4cISQ/VWggFAbT+Fc68MzGIMzSZRjg9TYyg1iYGLr36XoKkBF3Hk1wgoiCbNZgT yj76jmjnx541+AIjSS04zW62I9g3KQ3RXZtw9gh2Hz1tMfC68WVKs4UKtIp1l7LXcZst pmn2b5gzfqE3GgN0lXF8vcaYo1TZ/FHbfOqQXuDsrhkJuVcqA7GClBR1bJTOy81erhBb RoStiE9D2qKZOE6TpQwmrzco7yDGPFlkCLDGMlaJEB2tI143KK2idn/sp9gTQrauQC/G Bpbg== 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=0mq8B2Y6QndEDg7ovK+Rf6E2FOwt86MMHDQrr4rZ0qA=; fh=VfhvmrCr/l3qDubg67EvG+CYJZ9EltRqvVFF1HgGHgI=; b=a3rF31l9OCkipy4hbr5SAXh9FlKBX/APFXtF1yESQyj0E8SzentyvRpveCgWGQiaZd MwA5ywH5yOsKrUuE569cxBeSTsyb/9Wux8VK78dXUd+wklKlsKTiVXSJcUjZGFfJXZpM s9W58popQuGzFAaLOoVBMKyCx7Gy+R+gkylE1HOhNHHB0VbhO3SjWMOHB9AEVqoCwoZc nfVaEqWUA5UTlSjNgr7wU3Y54oV5F8MkikrVQVLs5kgi3cZxqTB9G3OTdEpWoH1QG7XI 1FaT0g840vk9q35HXihQ5y/SLr26GpZh7VuOPMe5dbe+fl/bIxFalSbVaoCw6HfgWt9T Xsgw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=qreG0MaU; 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-145047-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145047-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id v30-20020a05622a189e00b00434ae31ed72si10291700qtc.540.2024.04.15.05.14.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 05:14:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-145047-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=qreG0MaU; 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-145047-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145047-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 0C78A1C20F9D for ; Mon, 15 Apr 2024 12:14:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1B66967C43; Mon, 15 Apr 2024 12:14:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="qreG0MaU" Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) (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 B92303BBCE for ; Mon, 15 Apr 2024 12:13:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713183241; cv=none; b=ILvuTtQ3f5rDUCBHdwB7IT4dlSMegaHPUJ+oCu5XSW1hxNANjL0qCmEEy2/vbrp9QQtICwSoAK+00u8D1lBJWzby689FWWeea/EV7M0ZlJ5iaQ6Un44cWPL2yyiUkpsx1R+pTfmQAb8VUpUguQBdrBejuwW8RvLw9YzRbW+lLpI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713183241; c=relaxed/simple; bh=0mq8B2Y6QndEDg7ovK+Rf6E2FOwt86MMHDQrr4rZ0qA=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=aiTw/UaAGSJxAYHkpTtE/EURjqVkaZUNVHchQK3quFgrY2M1cudmeKm8+Y52teQ2Y+jwJjloh2saYfITCK+VwhNjvnWG1BnY3PYgvc3iZQ3EM6a/E8l41IpOmqj2qYWo3+XNoZ8gjriadDUS26XUKN89V0dKecAeI4kkWR8MHGg= 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=qreG0MaU; arc=none smtp.client-ip=209.85.221.52 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-wr1-f52.google.com with SMTP id ffacd0b85a97d-343c7fae6e4so2641318f8f.1 for ; Mon, 15 Apr 2024 05:13:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1713183238; x=1713788038; 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=0mq8B2Y6QndEDg7ovK+Rf6E2FOwt86MMHDQrr4rZ0qA=; b=qreG0MaUbE5pypZsKg4u6HWqg3SHF/N4leQztjml0Mo/p3u8BVRFkQxNCLB3l1V0G/ YWdRli9GwiDEhZHArcuDhvnxKNOzdJc30Gs3xBbkxuqN3n0mylzOgzuJ/VQE0l4tl3SY azaGEuEllFlzOmQzTWB6342YlNgtcFtJKxYBJP0iROivMi5M9f1ywpvDGRAz1odAq5TM HiA9oUvDcxueC/d7DHsLPY25KeNHJQBimXMAPGNn2nYS1VXdeBwuA1RPdW5Qa/dsum9x SBGtCvKb9+nB0cpCkmnP03mg7QaEz+6W+1zL9SJlt4FPb7oF7V5WTKUJfK6jR3SSGWsy UHUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713183238; x=1713788038; 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=0mq8B2Y6QndEDg7ovK+Rf6E2FOwt86MMHDQrr4rZ0qA=; b=eMI8lEymhIoylPqfC1zIv4jgx2mawpy+RgXTes4rEO81Vy7zLupG67arATdGLQXFkl NYVjTFoQyY4VdfJR3kHGlc7cbinuy0iqgYfFZI7egB31BGVjksp/gCae2vECUfkciiHK qtIyeNv32bwlSAl2F3meWB+5zYDWttVKCk7pk4LIdOKnrxeCbmg5KiNryBfdri95SQ1I r1gRimVjDS1GyrekAD1Tmi+W/eEtqyTb3jBwFEUo7i+Q5mZO0pnb5ZNhSdQxNUkubhc3 oZ2Y0uAKaPQN5c3m20/EBFjnGtsPZFUXm6JWfb0sQcZUOY71R2tfuT3Sf5l07hLyguXL mhyA== X-Forwarded-Encrypted: i=1; AJvYcCXVmfmpVy05Hu1PGFm/03nfHim/h00RH74M+8O0EC5XBiIXfZY5Vfi4srHAJiyYh8Irq1Ij8mk9ZK0sST2fBTknl0nRZVcWtjIgGyDb X-Gm-Message-State: AOJu0YxxUls6UxdLZVsBeJwvUfSVE3wfETOa0SkHqdjXmb5lgGfHYCVS aODBC7kONuIhdXhB+SVgT0zV8vEhY03A+q5yB4+kjqPlq4rcIDDUaydEQaXazruurnUZ8keRxnp TM2PBOf0Q/MGOXvrRajGi+oZSoJAjdA0ca7Kv X-Received: by 2002:adf:e343:0:b0:343:772d:9349 with SMTP id n3-20020adfe343000000b00343772d9349mr6384118wrj.50.1713183237981; Mon, 15 Apr 2024 05:13:57 -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: From: Radoslaw Biernacki Date: Mon, 15 Apr 2024 14:13:22 +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 ps: "without knowing if the device is, or is not on the bus ..." On Mon, Apr 15, 2024 at 2:10=E2=80=AFPM Radoslaw Biernacki wrote: > > 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 t= o > > sleep from inactivity. These places would also need EREMOTEIO retry log= ic. > > It does not enter deep-sleep arbitrarily and therefore it is not a proble= m 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 a= ny > > 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 > >