Received: by 2002:a89:2c3:0:b0:1ed:23cc:44d1 with SMTP id d3csp553159lqs; Tue, 5 Mar 2024 09:18:17 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVW0P1AZhnOWouXXXLwFjMGSf+5sVewi7FqRQ7TpX+LS6IcdW6XSdryyrRh3wNHkfwkJigxGhUamw3Hnv0Migt5o+w9tbtx6/m9hhjqHw== X-Google-Smtp-Source: AGHT+IHbH/BfxEGKOL7zhc4z2CycEue+yg84/HZeUQkW/DMpzSdg3BzyX7R4SHKiZ4PCBjCMpNYG X-Received: by 2002:a17:906:f2d2:b0:a45:9578:c1e9 with SMTP id gz18-20020a170906f2d200b00a459578c1e9mr2552571ejb.11.1709659097656; Tue, 05 Mar 2024 09:18:17 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709659097; cv=pass; d=google.com; s=arc-20160816; b=XKOxcslyJvSA1fiuh07kwqR3w6U1TtGc1Qq0Id4xZJOU9o7blIzuVp6CAao3H+VRjm uJNODu1h4YXgc2Qdi/4fTbi5JZA1P1uHgPvnwt6UakqB33JrGge4jdyraTeZIoUBIoZd drpSHhsJx8I1DwZh6KkUdcRQPNrziZ9kwu1m7FAMXVKKwr1kze2+z91h2SQqFkBik2H4 sz5o6ZtSzcVasDUTevJFSlplbWYDZDkujP1dlhWVF51VXTXc/jliZ19c+1tuxtybvsgq KF3VqK/PDByxd/CVmJo3QvH31R8lSx/uV4VaYGHdi7WnK2qYvNGR2oYHHwBOgQJ6RVNO 4jyQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=subject:cc:to:from:date:references:in-reply-to:message-id :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:feedback-id:dkim-signature:dkim-signature; bh=w++g7aHIMZLdmtuh1Wj3Mc3nyL1x07JT54IB2NOuQNQ=; fh=LsoZXFf92gwSiSvU1iU7uRG+PbhGGHeztCSRTtDe6jU=; b=jaNoxAVyro8nF/DdFLw6cIxPHX1c2Xunfo0bPb6wjxXE8Js9k58cFGxoMyj7EWr4n9 ScijkW6xYwQjYoUqx6i2j5VBk/9qF2oqd7+g+cpcjU2aagSBrICDmPZqzEJ9w1w8K+kB Ct9cMvMfQf1fStN2vS00hD2/HSxJyhNXVANWd9mu7D0VBDGnShe0iMLlDcTULQ5vrMa0 EQ7blMmUhi+ClJVhIe5ob9l1+tzHrIsqOsGGxtHTmD/u7InjupuCSd4mkP5FwJHuHfUn d3y75gH0mWmxVyTB7OdmfJ6QwJuy5GZloKfFm23n/bEpqwHJKA+F5yPSm6tWvcr7gzu1 3NuA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm3 header.b=YhMrLrNY; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=Z34JRypL; arc=pass (i=1 spf=pass spfdomain=arndb.de dkim=pass dkdomain=arndb.de dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=arndb.de); spf=pass (google.com: domain of linux-kernel+bounces-92751-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-92751-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arndb.de Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id h15-20020a170906260f00b00a448a9c4671si4270797ejc.30.2024.03.05.09.18.17 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Mar 2024 09:18:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-92751-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=@arndb.de header.s=fm3 header.b=YhMrLrNY; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=Z34JRypL; arc=pass (i=1 spf=pass spfdomain=arndb.de dkim=pass dkdomain=arndb.de dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=arndb.de); spf=pass (google.com: domain of linux-kernel+bounces-92751-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-92751-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arndb.de 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 668951F21D7B for ; Tue, 5 Mar 2024 17:18:17 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 407C714A9F; Tue, 5 Mar 2024 17:18:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b="YhMrLrNY"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="Z34JRypL" Received: from fout6-smtp.messagingengine.com (fout6-smtp.messagingengine.com [103.168.172.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0F4A913FE0 for ; Tue, 5 Mar 2024 17:18:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.149 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709659091; cv=none; b=iXWAS5IA35w4RKu1dEKfA1VdsStoTzBUy4AuoDLoZh/zGqEIr/R1oaVje2HqUULqV7QWrviOKV+knnJhl4lrMS2ol4LT9jyAqcDTro553YGogTK0vjBafdECS+I7gUJ3EoAa8w3IylagR0qWxiQVl5EBGXST+VO4ZO9JY4ofvhw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709659091; c=relaxed/simple; bh=qKGXNp6adDAyRl3esXjlOtVPpPC6y+p2J82LI4SlQi0=; h=MIME-Version:Message-Id:In-Reply-To:References:Date:From:To:Cc: Subject:Content-Type; b=Kb+6AWIbjQepq0RXfb0WUeDBXch4gj26k7v+J7vXD1g7cTHkm45JAXBxOJ8V7NnlhGeVHm4t1wNUFPD82xsKR7GyH65V54Pvzq4qfE2pfCkWGqah6T4bO3pdoVlwUkZ9Xn8q1BXN4U5cw76MAK3NGRS606d0Hbwdfr9rPNBJ1Lk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de; spf=pass smtp.mailfrom=arndb.de; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b=YhMrLrNY; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=Z34JRypL; arc=none smtp.client-ip=103.168.172.149 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arndb.de Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfout.nyi.internal (Postfix) with ESMTP id 18D1713800CB; Tue, 5 Mar 2024 12:18:08 -0500 (EST) Received: from imap51 ([10.202.2.101]) by compute5.internal (MEProxy); Tue, 05 Mar 2024 12:18:08 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1709659088; x=1709745488; bh=w++g7aHIMZ Ldmtuh1Wj3Mc3nyL1x07JT54IB2NOuQNQ=; b=YhMrLrNYorhuGEkGQr9tWJ9KPE t7WrHITfCKs4clrG6zHpekssVU8lxQjqWKWOSjTChoDS+a+zWfFtSs6bgpHlWkqF ufJb+CyIfkxJNnwOIsBmCxooyLnxijKcgH4Zo1UOm1MPlxlyUzzsVSOadgFwBstl vwW14xZepbTV5twjB3rtLECUZaxZ9y7WV+ihjWoHDFYXvF9FMaKtlWDSFIpJpuWt c+sLzTsalZH5Yx3P0UHb3TVolfpyaEkAqw2x9aBKymYhd73q15WRt6lp7ox1xtea M7/0wHY/qcf3Gm3OxVeMiX08Cg1JmiCz0I34wyeOnD1UWY+yQan/DW6Y2lxg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1709659088; x=1709745488; bh=w++g7aHIMZLdmtuh1Wj3Mc3nyL1x 07JT54IB2NOuQNQ=; b=Z34JRypLDsegQrtgLXZBgyxel8X7gvZbeO2+P4hix7BT JfHou4jGIXSaq+Na/wGGqnkCYmmyIR8dFw83jssLtb3T2swTrNQi08qmiBowTxoe vn0NfFkiSFJNHzSiXPZcK5g6WfmQhrf8OIZ/KJoP72RqCumCzbQ+l/noSJGS5M3a J3XR4NMdR3LcRQjpJC66QebO+Y6VsstqUlhXus1Um11oW//jJkAbEtLN2mujNtsg Ph+/trG3PDP3XHn/TZVvuW0gnOOYeWOXF9ntHirxTwxdER7fCBaXP7gm8zRETaW2 f2K+LAICQ59gBTwdMgTnVCoF6my7OclO0ttAQU2Ekg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrheelgdelgecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefofgggkfgjfhffhffvvefutgesthdtredtreertdenucfhrhhomhepfdetrhhn ugcuuegvrhhgmhgrnhhnfdcuoegrrhhnugesrghrnhgusgdruggvqeenucggtffrrghtth gvrhhnpeffheeugeetiefhgeethfejgfdtuefggeejleehjeeutefhfeeggefhkedtkeet ffenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrrh hnugesrghrnhgusgdruggv X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 512B6B60093; Tue, 5 Mar 2024 12:18:07 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-208-g3f1d79aedb-fm-20240301.002-g3f1d79ae Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <4de9e676-74e7-4bd0-b821-4e3270487dbb@app.fastmail.com> In-Reply-To: References: <20240219195807.517742-1-sakari.ailus@linux.intel.com> <20240219195807.517742-3-sakari.ailus@linux.intel.com> Date: Tue, 05 Mar 2024 18:17:46 +0100 From: "Arnd Bergmann" To: "Andy Shevchenko" , "Sakari Ailus" Cc: linux-kernel@vger.kernel.org, "Hans de Goede" , "Tomas Winkler" , "Wentong Wu" , "Greg Kroah-Hartman" Subject: Re: [PATCH v2 2/3] mei: vsc: Don't use sleeping condition in wait_event_timeout() Content-Type: text/plain On Tue, Mar 5, 2024, at 18:11, Andy Shevchenko wrote: > On Mon, Feb 19, 2024 at 09:58:06PM +0200, Sakari Ailus wrote: >> vsc_tp_wakeup_request() called wait_event_timeout() with >> gpiod_get_value_cansleep() which may sleep, and does so as the >> implementation is that of gpio-ljca. >> >> Move the GPIO state check outside the call. > > ... > >> +#define VSC_TP_WAIT_FW_POLL_TIMEOUT (2 * HZ) >> +#define VSC_TP_WAIT_FW_POLL_DELAY_US (20 * USEC_PER_MSEC) > > ... > >> ret = wait_event_timeout(tp->xfer_wait, >> - atomic_read(&tp->assert_cnt) && >> - gpiod_get_value_cansleep(tp->wakeuphost), >> - VSC_TP_WAIT_FW_ASSERTED_TIMEOUT); >> + atomic_read(&tp->assert_cnt), >> + VSC_TP_WAIT_FW_POLL_TIMEOUT); > > First of all, there is an API for such cases (wait_woken_up() IIRC). I think wait_for_completion_timeout() would be the obvious replacement if the wait_event is no longer waiting for the gpio but only for the irq handler to complete. Arnd