Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp3186315lqp; Tue, 26 Mar 2024 01:59:03 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCW1o8K1wLvJoi7lBXp72PoOrp06yw1RhANhua3fqt/79BFzXHXqcqIkbeiMwv0xN3dixCtyFSzp94DGcLMk6vLNk8IGJWHOK93k/h6cJw== X-Google-Smtp-Source: AGHT+IHPnaoAERhdpcnU/P5SPSqHGsqxIS/MZr9lUY6sPJgUu5Ob4CU103gMSadQaOYbX2LIrqar X-Received: by 2002:a17:906:134e:b0:a4a:aa3b:8002 with SMTP id x14-20020a170906134e00b00a4aaa3b8002mr381241ejb.15.1711443543705; Tue, 26 Mar 2024 01:59:03 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711443543; cv=pass; d=google.com; s=arc-20160816; b=Hw1rCa+vZwfL+8i3mc2E5+AdlELbZamWIG8KV5K3QUJ531ih6VeQUnxSPd8eZ3a3xu /L3LaGNEFyMSGEtmDdRXr2mnOoTCUjnuj8hbWN2s6kmQvBqdZv91heuGtZVhmrEtZj81 VWGWeDMLiUuR4v2m6FCBkBpgqGun37DMimXXRmTMNs+/YB8ZfBgMDnR78r14vgHXatDg aXO2aaGJueakfvXZDfNG2rA4EF2tALwc15SaGbYkrEFZX8uFsvDSONd44C+5Cnq/GJk8 jTt20KZblhp0fbqWTaesmRkEYl1Q+bi1WWNmkP+b0iDxIa0wPKqifbN1FL3RC+mBDU7P mmCw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=2pPV8N1R6vzmSjl6Uwoo/hXMqUFTVOsFF3LrLWnsiMo=; fh=ZrKBIT/deFHauQiwWye9muF/d+9GfhcFpuR+rGtmzjU=; b=sRGxIZlt9myz7cqmRHdWQTuQCcQDyLs6ABZD2OfY0nFO6fBzVmQihAFhigEnIhSbLw CK4cH+JdF3A432aSRQ3Gq5rfs4OQRJJtVszOQqudLlC/4k6B6czH7oohrLB3WcFE8R/T vkmoqxHVrZ4e9wUj8Bp+tntF62Jwc2scuWwSNTll9DYQVhU1FGDmqEDwQNFbGLKNjc5d wnMZ/16+I/BkV5KfDtYQSOCmK7OsCEpNDf/pr5/yEHcV9da8BfGxLQ/dtlnBM0fIUyGu 47NHk+Nsp27NUV/gPGC5mhyP4kCWNz+Es+c4WEZR9xjjA03bh+z7yAXvep0d2iAPWYYp yvDg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=L2s3b6qV; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-118591-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-118591-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id u13-20020a17090626cd00b00a46b2c3db39si3258198ejc.923.2024.03.26.01.59.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 01:59:03 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-118591-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=@chromium.org header.s=google header.b=L2s3b6qV; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-118591-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-118591-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org 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 71A8B1F3BEC1 for ; Tue, 26 Mar 2024 08:59:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 38FE01CD1B; Tue, 26 Mar 2024 08:58:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="L2s3b6qV" Received: from mail-lj1-f179.google.com (mail-lj1-f179.google.com [209.85.208.179]) (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 9B4221B948 for ; Tue, 26 Mar 2024 08:58:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711443508; cv=none; b=usWLCNkTjLxAIXdJ0ZAuJL4UX97aLiOVi1vjfqnHMSiVJ/rHifsAtj2yeoyvsGRTeevTN/pRqXnEl7JdsdXCFvsiAJZKoTHrPhb1lMRkOV9nAISIV/aHqbxyOn1AH+MaL5xPAhDiqwWOMk2OmLuK2lCGWtQvhUw6HEeqY9CH1rE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711443508; c=relaxed/simple; bh=n4G3Pxgl7Q9i82J6sK8SAiR5VfV6Vmb7zW7/xd8y8hk=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=rWzeZwMLQ60HC0UxitY5hZhvt/Ih20yCviL4q3ip34KY2NbJtnMjuvdnivTdZ7rKPsK+illIruZ3+1hpU/DiOg/MIM/reXsffe1qzE+SpuUC1Hdfxio9p7zP2dsZS+iqpFPhl41veoBV6ESbNrye3q9tLQNHXg/7hU4/gQxnc1I= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=L2s3b6qV; arc=none smtp.client-ip=209.85.208.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-lj1-f179.google.com with SMTP id 38308e7fff4ca-2d4541bf57eso73098961fa.2 for ; Tue, 26 Mar 2024 01:58:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1711443505; x=1712048305; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=2pPV8N1R6vzmSjl6Uwoo/hXMqUFTVOsFF3LrLWnsiMo=; b=L2s3b6qVLx74juqMfvpYQSLrUPMczmGo2C9MvY5HTcVFAGq0CIOvmdOYEOw0K2p6kS D/MI5GE9DOvMUdBtiH8Ku4PZVrmxQ7Ql3il5/F3zf3oF5zduinUBiUhrp8gtgqnmpvE/ fgzDiX3Qu0xkauPYrZCR7SKvcaospsYSnuLgM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711443505; x=1712048305; h=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=2pPV8N1R6vzmSjl6Uwoo/hXMqUFTVOsFF3LrLWnsiMo=; b=dxMySa0f0jWbXyePt3vdiiK/pCKc5v3cng7/lCC9JMKdll5dC/0nxDPiRbahaax5Xg OM3c+jYAM3OZA9EtP+4Xt5O5gV7EfYLfn2g0ucABAdT8CPBxDKVqx29zPCPtgEdMg3Fd cblkeajYpPjWOMS543YYlhKp/SDHngIuwL/uRrV7LIzMUifKu0T4y6vvHtpomhQzJjfF +LJhVDdkVgTSY+Kws36+U2RuFn7udEoQGhlp3j4Pqt08nIzUd8uYfYvUvSP7hB/gFB2l mlTGi8wRePUWKmJWVHGbuWezZnk0zkhjwEpfaAH6F875fZFLgbRUBGAFhK8ByHkrryaY tHUA== X-Forwarded-Encrypted: i=1; AJvYcCXTiQrjOUev98tMzKTTLe+tehq/VjlM0tXtFS3q+ZfypMaz/MQfSQSTx/qHkwJxjccAXc26fueOYXwis9X34SUAM5oXtyr5YX18q7rd X-Gm-Message-State: AOJu0YwlmwNNYfOE5DDfcq7VIg/cdepKd+6uzb+aEilMffeleXGiJzkZ 44TVZYBy90oq3jj0eQKMQ/jeV5l5CnQdBe/Pv/ddEutgLyS0Vnkzc/54H4XzNg8cU33yufLXIZJ 7J9T3m4PCw7c9qAV32LSJhQbDAW+Ax7VeHAw/DNIpzAUPLU7abyMV X-Received: by 2002:a2e:834e:0:b0:2d4:3c32:814d with SMTP id l14-20020a2e834e000000b002d43c32814dmr461489ljh.26.1711443504690; Tue, 26 Mar 2024 01:58:24 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240325105452.529921-1-lma@chromium.org> In-Reply-To: From: =?UTF-8?Q?=C5=81ukasz_Majczak?= Date: Tue, 26 Mar 2024 09:58:12 +0100 Message-ID: Subject: Re: [PATCH] HID: i2c-hid: wait for i2c touchpad deep-sleep to power-up transition To: Doug Anderson Cc: Jiri Kosina , Dmitry Torokhov , Benjamin Tissoires , 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" > nit: checkpatch should have yelled at you saying that you should > specify a commit in the format: > > commit b3a81b6c4fc6 ("HID: i2c-hid: check if device is there before > really probing") > I will do it, but I did run the checkpatch (with --strict option) and it didn't complain about anything. > > nit: I believe your sign off should be last. It's also unclear why two > signoffs. Did Radoslaw author it and you changed it? ...or was it > Co-Developed-by, or ...? You'll probably need to adjust your tags a > bit depending on the answers. > Yes, we've discussed this patch together and the original investigation was done by Rad. > Having both ends of the usleep be 400 is iffy. In this case it's at > probe time so I wonder if udelay() is better? If not, maybe give at > least _some_ margin? > > > > + } while (tries-- > 0 && ret < 0); > According to Documentation/timers/timers-howto.rst: " SLEEPING FOR ~USECS OR SMALL MSECS ( 10us - 20ms): * Use usleep_range" It was also pointed out by checkpath (when I initially used msleep). I think giving some margin (eg. 400,500) would be ok. > I'm not a huge fan of having to check "tries" and "ret" twice. > Personally I'd rather see a "while (true)" loop and test the condition > once to break out. AKA: > > while (true) { > ret = i2c_... > tries--; > if (tries == 0 || ret >= 0) > break; > udelay(400); > } > > ...if you feel very strongly about the way you have coded it, though, > I won't stand in your way. I don't have emotional bond to this code ;), thanks. > > Pretty much all my comments are just nits and, since I'm not the > maintainer here, my opinion is just an opinion. I'd wait at least a > little while for the maintainers to comment before posting v2. I'm > happy to give a Reviewed-by tag when some of the nits are fixed. > > -Doug Thank you Doug for all your input. Best regards, Lukasz