Received: by 2002:ab2:3c46:0:b0:1f5:f2ab:c469 with SMTP id x6csp48294lqf; Thu, 25 Apr 2024 21:39:35 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXIxNaS2JRu7ogwthpmi35hO0wY3AwNjch7AUUV353f6iy0SlOXHV3PAuBs9xGM2RozXiXp5eSsr2Z1SZYoXPCcdVyUWBJyOhZUiqOmyQ== X-Google-Smtp-Source: AGHT+IFpIiq9Uu5wpyPvXvF9WpRVDzc90N4QXTEE9wgr5kl6Vhh+mQ//Q4/9bDXDmQhw6Tn69MDj X-Received: by 2002:a05:6a00:1788:b0:6ea:e2d2:5e68 with SMTP id s8-20020a056a00178800b006eae2d25e68mr2407647pfg.27.1714106375444; Thu, 25 Apr 2024 21:39:35 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714106375; cv=pass; d=google.com; s=arc-20160816; b=twjbYO1FgtnWXVIvKbvC30kZJjL3UdB8yS+kpqi+wRP8F4nFVE9qJwpa75g8mGmR86 hBhjwd5yGDLK23WOceGJbf49fRripZq4s6+Jk4FgMLLem/6NAlODR0q9cEBQwbryUQv8 DGqjTZmPsujNiuDbtrno7V1Vdcs+Rq5vyitBARQZZ1OP/uPfTW16o9f7Tj4YIOItm5Iw KbLDaf0ZpxHH1NyTV/w6LXjLWcGPe+hLrcEkWM0N0a6xJxA7z15jXII0aUW9PcpfBuwY sgrWJcyqQJqFlBo6gbSJTDMGLnNQejuyrb9wkSPWLlTL0F45DwcLxWX/1N8cQmdJU0ms iADw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=uXnKV55MjcszWznSwH1C4YUcHGlfs+xTpRg1jC9GBzU=; fh=dubqQrtP75a9qMWswZmxJw/pje8FKjNTv563u2IeXl4=; b=fFpUNoVa9XJvZe8+v009YlpgFVFismf6100v7uzMkCX4R75joSBhcEHtSYok7qoZ9D nHyle8z5gpVUkdQ3VL0sCabMd4Mmpb1FxKs4lFLa54dmOmbUQUiPsXGyMtHHfn75WuTS Jpkp/a1sdPkZ00AyuB4CkCOA7svgQaHp/eb0gc6PVBX4wPm4vql1zxduoHsvBiOsSPIj CLT8gZsf2rU5cz6Zw3PZenliq9uTvDi3OrKEsc6/natABmz0X68v4IGHaI2s1YWuyqwm nr6iVri5n8bBgGW6GwkTmJHKcAelAdndO0PiHP2/tunQgIXYfuW1p2FLPkm1vNW3jud3 9m+Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=po0R7TXx; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-159502-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-159502-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id jo35-20020a056a0090a300b006ee35162770si15053030pfb.69.2024.04.25.21.39.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Apr 2024 21:39:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-159502-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=po0R7TXx; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-159502-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-159502-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 19920B226BC for ; Fri, 26 Apr 2024 04:37:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 9C356139D13; Fri, 26 Apr 2024 04:37:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="po0R7TXx" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 B5B7343ADC; Fri, 26 Apr 2024 04:37:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714106247; cv=none; b=EcBybhQTY8T2+yimx1ZNmFqyK7K8UyXkPJ/l4iwQFG+RMvdDclcwRfsf50Tjwv4w9zeI5SrCoECyPlwpBPgfAHUHxJhIwUOyWPkRTPB60bEUS2V6+BHjMmBoasCzzpMUJTPg/oomfldg/ytGH2ejw1ApskJxdLRTq+ygAHTH1JI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714106247; c=relaxed/simple; bh=HVslDCGQSbVxPzywsWFcgvSyrBbXdafmwApe57VI3ao=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Yaq9aTFNP1K2tjYuzcczgVPLFjaaX5RM5FXOJVQosNtLwIOG4zcW5yn9XsDeP2WLy9LanQ0HUo9aN8Bpg0EVD2lpR6bMnCRGN4wYnmVOfeilgT0cN8w/DOH/KtY3EYUX6afyk1n0akF1FsoDZqPPTo294UZ/88yz6UrJrHOanfs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=po0R7TXx; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 26742C113CD; Fri, 26 Apr 2024 04:37:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714106247; bh=HVslDCGQSbVxPzywsWFcgvSyrBbXdafmwApe57VI3ao=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=po0R7TXxkdSTICIkaevplkiueulozFOGYC9wdnalQ6KKq1TZM4XsQCyW0GyzxtBtM kzBbF353pydHiLuXMrRoA/3VIGVIsQhdGYmZTfUUWjXqlPxCqfi9G9s277dX00+4lB SaKf2zDv5gXC6qKbc97kfO2IjLRtnCwJ/0cQ4mRvihY0y0MnzuYiFaDN+36tl1z1TG XDVdEL+sGvonJP/ZNJiiQbtyvABCu9AafdprYLokZe5V21GkG7cybmNc8cR8hhfYS9 2ZdSlpTnJFvxXvNBBBAcUo+K5pqg6EP+zMRY69u9PwgcjaESFDyzxZ5W/VOOyjWs7B Mt0oEegd2ZQXQ== Date: Fri, 26 Apr 2024 12:37:24 +0800 From: Tzung-Bi Shih To: Karthikeyan Ramasubramanian Cc: LKML , stable@vger.kernel.org, Lalith Rajendran , chrome-platform@lists.linux.dev, Benson Leung , Guenter Roeck Subject: Re: [PATCH v1] chrome/cros_ec: Handle events during suspend after resume completion Message-ID: References: <20240425143710.v1.1.If2e0cef959f1f6df9f4d1ab53a97c54aa54208af@changeid> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240425143710.v1.1.If2e0cef959f1f6df9f4d1ab53a97c54aa54208af@changeid> On Thu, Apr 25, 2024 at 02:37:11PM -0600, Karthikeyan Ramasubramanian wrote: > On boards where EC IRQ is not wake capable, EC does not trigger IRQ to > signal any non-wake events until EC receives host resume event. The sentence looks irrelevant to the fix. Presumably, EC should send those pending non-wake events after it receives host resume event. > Commit 47ea0ddb1f56 ("platform/chrome: cros_ec_lpc: Separate host > command and irq disable") separated enabling IRQ and sending resume > event host command into early_resume and resume_complete stages > respectively. This separation leads to host not handling certain events > posted during a small time window between early_resume and > resume_complete stages. This change moves handling all events that > happened during suspend after sending host resume event. The regression you see is probably not due to the "separation" but an unwanted code reorder. Before 47ea0ddb1f56[1], a resume is: 1) Enable IRQ. 2) Send resume event. 3) Handle pending events. After 47ea0ddb1f56[2], a resume is: 1) Enable IRQ. 2) Handle pending events. 3) Send resume event. If there are some more events pending between 2) and 3), they would be handled further late. [1]: https://elixir.bootlin.com/linux/v6.6/source/drivers/platform/chrome/cros_ec.c#L381 [2]: https://elixir.bootlin.com/linux/v6.7/source/drivers/platform/chrome/cros_ec.c#L438 I see what the patch tries to fix but the commit message makes less sense to me. Please fix accordingly.