From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.19]) (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 825F1154425; Wed, 29 Apr 2026 05:32:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.19 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777440771; cv=none; b=HiTsuO7bj9f4BwWsC32GsHKM+MvxfjBXugxZFNGvl9zK5rdXwMN6sYSMsl2Bh1JXhIlNSCFS2YLzgFFHAPBW4479pUTsFMtS/jinoKToEfcWRfpG3kDCgoSohNIAQzuqT95BwUCIZsgK13qtIR7Np2pnk6+YB2z24FavfNr63QY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777440771; c=relaxed/simple; bh=imCpF8OHGJq9FBotlmnXuxwdACVRuU6SJcf5BFUg3EU=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Of8p9bc809vxVY9i6WH/NPFWodwkaPdZvopW76w2fFQU4v063Q+nTgy/JvpUeONZKyN+EYSpu2knMPo3GzHVb7cTJ1EeWl5wU5Pnn1NNUvhfWjKon2X6Cc42K2+znIrW6vq2Yt4o8t0smcJMZZoj2xBv9A9yovnubNkPdwWWNmQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=Ubthj37M; arc=none smtp.client-ip=192.198.163.19 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="Ubthj37M" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1777440769; x=1808976769; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=imCpF8OHGJq9FBotlmnXuxwdACVRuU6SJcf5BFUg3EU=; b=Ubthj37MaQeyqNJfLrHv/mBSXFj0aIHiTLGvSvAvlKScStNkc0pOyz/1 QHw8oDPhOp3bnF2PUIqBc4ZA+cFwQ1HaR/rkwbH8g0mLgVOHCCT8ipN1j dVi6HvauGvyuMh3PHtPW3Wgc03RIWEKJnr+/oENqcSxsZ26xxwVuo3S8c AHWOEqX+EIjPo2dmZ/MVJito5YReO0Sr50vt5Mqr9adOcHsgHCzvgmW2u vIJCF2gVi5+XK+dq0Ufx2A6Jw55fQVK3GEqv3Ctd1YoGDb4StK2HWcQ2z zkH6GO0cIHIZ4NeZDvmmOBKRwtiWTp6YrOm7YGW9gjR4MJnn1/xWDrMhW g==; X-CSE-ConnectionGUID: Vh2oKDQuQzCLRBQ5Wqeclg== X-CSE-MsgGUID: W60KA3K5RTK6eKwMjX/vDw== X-IronPort-AV: E=McAfee;i="6800,10657,11770"; a="77391560" X-IronPort-AV: E=Sophos;i="6.23,205,1770624000"; d="scan'208";a="77391560" Received: from fmviesa002.fm.intel.com ([10.60.135.142]) by fmvoesa113.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Apr 2026 22:32:49 -0700 X-CSE-ConnectionGUID: 0RIj5XjQR6ub5LAWUwa3gA== X-CSE-MsgGUID: QD7Xf7pDQcmxrwfQiRL98g== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.23,205,1770624000"; d="scan'208";a="257479037" Received: from black.igk.intel.com ([10.91.253.5]) by fmviesa002.fm.intel.com with ESMTP; 28 Apr 2026 22:32:12 -0700 Received: by black.igk.intel.com (Postfix, from userid 1001) id 7142895; Wed, 29 Apr 2026 07:32:11 +0200 (CEST) Date: Wed, 29 Apr 2026 07:32:11 +0200 From: Mika Westerberg To: Mario Limonciello Cc: westeri@kernel.org, andriy.shevchenko@linux.intel.com, linusw@kernel.org, brgl@kernel.org, bentiss@kernel.org, hansg@kernel.org, Francesco Lauritano , Marco Scardovi , Armin Wolf , linux-gpio@vger.kernel.org, linux-acpi@vger.kernel.org Subject: Re: [PATCH] gpiolib: acpi: Only trigger ActiveBoth interrupts on boot Message-ID: <20260429053211.GA557136@black.igk.intel.com> References: <20260429025247.1372984-1-mario.limonciello@amd.com> Precedence: bulk X-Mailing-List: linux-acpi@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20260429025247.1372984-1-mario.limonciello@amd.com> On Tue, Apr 28, 2026 at 09:52:39PM -0500, Mario Limonciello wrote: > Commit ca876c7483b6 ("gpiolib-acpi: make sure we trigger edge events at > least once on boot") introduced logic to trigger edge-based GPIO > interrupts during initialization to ensure proper initial state setup > when firmware doesn't initialize it. > > However, according to the Microsoft GPIO documentation, triggering GPIO > interrupts during initialization should only happen for interrupts > marked as ActiveBoth (both IRQF_TRIGGER_RISING and IRQF_TRIGGER_FALLING) > and only when the associated GPIO line is already asserted (logic level > low). > > The current implementation incorrectly triggers: > 1. Any edge-triggered interrupt (RISING-only or FALLING-only) > 2. RISING interrupts when value is high and FALLING when value is low > > This causes problems at bootup for single-edge interrupts that > don't follow the ActiveBoth pattern. > > Fix this by: > - Only triggering when BOTH rising and falling edges are configured > - Only triggering when the GPIO line is asserted (value == 0) > > Reported-by: Francesco Lauritano > Closes: https://lore.kernel.org/all/6iFCwGH2vssb7NRUTWGpkubGMNbgIlBHSz40z8ZsezjxngXpoiiRiJaijviNvhiDAGIr43bfUmdxLmxYoHDjyft4DgwFc3Pnu5hzPguTa0s=@protonmail.com/ > Tested-by: Marco Scardovi > Fixes: ca876c7483b69 ("gpiolib-acpi: make sure we trigger edge events at least once on boot") > Link: https://learn.microsoft.com/en-us/windows-hardware/drivers/bringup/general-purpose-i-o--gpio- > Suggested-by: Armin Wolf > Signed-off-by: Mario Limonciello Reviewed-by: Mika Westerberg