Received: by 2002:ab2:69cc:0:b0:1f4:be93:e15a with SMTP id n12csp1392084lqp; Mon, 15 Apr 2024 05:27:11 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUOdfR0c13XawzN8a1cPIWnIcGLlZxWchE6WuX6njF4tkuwQ+up+/N4q3dovd3kDeXYCtqfrOovpnt6XJ5T5sFDBR5Oh/g6fyX4FHF1Rg== X-Google-Smtp-Source: AGHT+IFmpZeTLwIuOV5lk5biVCxQMLtqss2DxUuaJZd1Cuva7fgY+nJT/b6XEDuz3IBY3RSepJf7 X-Received: by 2002:a50:baa7:0:b0:56e:2e10:7dad with SMTP id x36-20020a50baa7000000b0056e2e107dadmr7385945ede.35.1713184031182; Mon, 15 Apr 2024 05:27:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713184031; cv=pass; d=google.com; s=arc-20160816; b=Tszhml5Ek4ailp3IbMHb1NDDwjS1yeIJLypvhqcOcG/o83vSiVn//e7UcC2hWw3eti 7WlcJDdrtPBbMiFnAhrDWVYRMrUWmjbTk9KjcRNaBlmiV3CLBrR6q43AkLaQSw0Oc3VX LfvGodi9EqtV74DkH16K3n4YPu6dsxEMnglafm11NX5GjFOeKI5yYC1fOyhHnWn8cEve Pz1J1IHTL2ui6IkhzGTzKqprB5R/ynY0mqAVh3i4f4ceiu1Xcz1zHdXHSEO5f8e09fzo UzIWgIZybOWlUajDtCIOHTCSnYOzMqyzt1oMrxCc5wjesURA4Z/D4e2c9GwRuTSBvNbB jQdw== 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=H3v2/ReapnsmNml+xCOsOS5et4IKx39hTGT1CULoscU=; fh=yOgE34sDVTh718cGYgE1LmEu1NKOc4nZ3k97tlJ+zi0=; b=i9O7J/Ie1mLoYd1D0fnlqqb0CvNIAGK+HIF66M/5hf6QPcv8iPiYuHwt9r+vlN+Dko MVPsQS+2ogzU4QWohE88Ke4tcN0mr23KjvkdU9J9YDR3HBeXiN3ARVFBg5P3E1OKc3o3 iZ5AkoJWY3hF9gPWWgA2t0x3JXPYF9Syc/EWAKE9qVVyrg3cV4gsrgtYajjLcB/5Vv+T UhQMDeulO/3fPte24Aua4T+1+bhRW7q1wAmcp1ZBmkkhfsgY8RhpQvITWu5j+sgLi2eR FId2XVWmbwgUdAkHIuRrQco9I2yEeV3JLY3pDRtIqQ4hiAix1GqvL7xO2V8arKCzE5tu PJeg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="4s/Tua9d"; 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-145065-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145065-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. [147.75.80.249]) by mx.google.com with ESMTPS id t20-20020a508d54000000b0056ffb0b0307si3443735edt.147.2024.04.15.05.27.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 05:27:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-145065-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b="4s/Tua9d"; 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-145065-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-145065-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 E44551F21C46 for ; Mon, 15 Apr 2024 12:27:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 48D146BFA3; Mon, 15 Apr 2024 12:27:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="4s/Tua9d" Received: from mail-wr1-f43.google.com (mail-wr1-f43.google.com [209.85.221.43]) (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 E870B6A326 for ; Mon, 15 Apr 2024 12:26:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713184021; cv=none; b=k6ghXc3rgeScVk3Iw1PuljeXn9UYk9YdhlGFr2jN2ZK6HWnEbAlptXHtvbt8UyU7r3NeZIbB4rIJAD27kPJhJ0zhCF9zkPtuSsEqSg40eUeat3T2HXHKEjSKGRPZY1hmawgTTygufkz3SFxmF4POi99hOUAqIQzqAzoSAw/PPoA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713184021; c=relaxed/simple; bh=H3v2/ReapnsmNml+xCOsOS5et4IKx39hTGT1CULoscU=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=SURzdFtXFTxE7BK6gKhgSo2VP3qPUKGhRR0Uq00y6Ifg6iakLi+lLJaRdmLFKltZ1iAxtSscH6ERyn4CuSJhPuI7wtkNDDINdepU30Bz5hEQjo+1MZW14GtrvQfBdfS4Iuqka6/YPCKUs3FM6wYn70Ki7AMbIz+wY2AkIOxTUh0= 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=4s/Tua9d; arc=none smtp.client-ip=209.85.221.43 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-f43.google.com with SMTP id ffacd0b85a97d-343eb6cc46bso2198647f8f.2 for ; Mon, 15 Apr 2024 05:26:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1713184018; x=1713788818; 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=H3v2/ReapnsmNml+xCOsOS5et4IKx39hTGT1CULoscU=; b=4s/Tua9davglGUd6BIaZ4hRfUhb2Q8emwfPQ7U0CsGdUoWfyzSLV6K3mDmwkVYQHZV be9JzTcE02Mr9G4ab3PO7DQ21nZb2voji1LH6VgQIBi0qoVCetbHX5Ysw5X8L1zFn0lg sQ+oxnDOv0WLy4QCBELLnx0mFYQ+O3kxfFc8Okla7kBbyiypLWoad/YWmSZai5mKXIaw NF0tsgc6D3oEIBau1t2ubx/2ibS4T5nXwm+vQ9BHav1cnF09ouyHLfv+gcpGzmV/iVqn 3U+kwHNwncxsdj+l/BChNTN0AZRbjPf0qMxccYv/QYUAaiIKSKwhza35MRzcUdwOWufe OzVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713184018; x=1713788818; 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=H3v2/ReapnsmNml+xCOsOS5et4IKx39hTGT1CULoscU=; b=Ak39p42G9wev/T6bjz+dfiMOd7ZDnbxPTZ30h9iNI0Qy4EVtbuk2CaP6PLweO3gma/ Q6mdbJpYV8oR89iBBuJc9+urj+ttSqDEn80QHPQ2LsJVIwXCFKA6Fm8gYdMw7jel43Im CCaLtfAtQPnSpGD6kV5IReh2/RAao0icTTfI2FKWEk5gjUkP9HTg3i7ASyz4mOgbTal9 zyvgG3cFy9R/Q5rQ/H84lRWhdvCU82ccbigalbFQh0gxFFbUB39AN3o964PC8nSRPLFa 4vSZFpJdGe1hx3Me7ZBDa86By87oyIXPcnFlL65gCRZALgTSbW6Ac4xUfWHH/XViNGJe QOuQ== X-Forwarded-Encrypted: i=1; AJvYcCXUy7UyB6TTYunk6JC02DLLt6g09lonCAbiTSYr3RjNpBpOsrGAZZBovtMoguM6voP+n/ktL9QWQVpIA56pBwJDoRBpIA32IN3g1bI4 X-Gm-Message-State: AOJu0YxcBKsfqbEzoeQtwPbTqpqhFSss7K7yNovZeCnWdIUoiRt2hd6+ XHLt036/Lkx2zlmgFNAqmW6nEVGgcpcEwG3C44G6DefxauTzD8ppBJYgSPtU5nWJvXqCzRXMThE CL6KKBwUuiktXsiZwfJnwB7WfwW50a2RUFYH6 X-Received: by 2002:a5d:4d12:0:b0:346:c746:28a4 with SMTP id z18-20020a5d4d12000000b00346c74628a4mr6584761wrt.49.1713184018213; Mon, 15 Apr 2024 05:26:58 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240405102436.3479210-1-lma@chromium.org> In-Reply-To: From: Radoslaw Biernacki Date: Mon, 15 Apr 2024 14:26:42 +0200 Message-ID: Subject: Re: [PATCH v2] HID: i2c-hid: wait for i2c touchpad deep-sleep to power-up transition To: Johan Hovold Cc: =?UTF-8?Q?=C5=81ukasz_Majczak?= , Jiri Kosina , Dmitry Torokhov , Benjamin Tissoires , Douglas Anderson , Hans de Goede , Maxime Ripard , Kai-Heng Feng , Johan Hovold , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, Radoslaw Biernacki Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Johan, On Mon, Apr 15, 2024 at 11:08=E2=80=AFAM Johan Hovold wr= ote: > > On Thu, Apr 11, 2024 at 04:23:27PM +0200, =C5=81ukasz Majczak wrote: > > > Sure, but what about other transactions that are initiated by the hos= t > > > (e.g. SET_POWER)? > > > > > Somehow it is problematic only on reboot and works just fine on > > suspend/resume and > > set_power. > > I will dig more and try to find out what the difference is. > > Sounds like it may be related to the i2c_hid_set_power() on shutdown() > then as Kai-Heng pointed out. > > That function already handles a similar retry for I2C_HID_PWR_ON during > resume. > > > > Perhaps this hack at probe is enough for your use case, but is an > > > incomplete hack and at a minimum you'd need to add a comment explaini= ng > > > why it is there. > > > > > You mean a comment in the code ? > > Yes, if this turns out to be needed then there should be a comment > explaining why it is there (and currently also as the delays you used > seem specific for your particular platform). > > But hopefully you can find a generic solution to this. Yes, we might need a more generic solution though it is not yet clear for us which would be the cleanest one. As I wrote in the reply to Kenny, the design back in the day was made to use events rather than level driven IO line, to drive the power state of the device. Consequence is we need to request a low power state before the kernel goes down as there is no guarantee the kernel will wake up soon (prevent battery power leak). This event/level logic problem (event design for level type problem). Let us get back to you with more info as we look deeper into some newly found power sequence limitations of the second I2C node on this device. > > Johan