From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out-189.mta0.migadu.com (out-189.mta0.migadu.com [91.218.175.189]) (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 A47F63EB81D for ; Tue, 30 Jun 2026 10:47:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.189 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782816448; cv=none; b=AmlkkYSTAxOI7784qldWTMygMAoFblzvjlY/kE2qr3KSiIj4c6P+jqwDuof+LqT0OYNwJdqaF307rUnj7AcnHt66QmVOOEBByaEUpxDeP9vEeU6vhWqzn6cBEaLXOhvspMSt2XTiMzoLdPxelDUMy3p3CK8mql/uh+2SoOpthzY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782816448; c=relaxed/simple; bh=x97Eufeqk7SwiP1zIj7i7uolDOcyEVaPhG1f30iEYsA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QTLj/PZqfExSy5O0M5J79HPEtsqgswpTKAbDnrewICKCGA5DDHO8FnvXiM9cLrcyNuYVnry+0Gz6hLldC7N6DDgXBt5oSrs0zAXST0rMMsmlZyvdEcgstfwSpI98tc5gnSr6izL13s54plebp8EFNFnyEdQwv5DOTXwhIj/aRQc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=bntUOZi7; arc=none smtp.client-ip=91.218.175.189 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="bntUOZi7" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1782816440; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Mg6vsp/jK24M0FEVqH+xkBLaeeIIgHOWsIxywI1KcqE=; b=bntUOZi7IarhgzlK1BZ1WsLScyGM3Ae7GIpkJSQ0DNCM47DRQj0T0zeuRqkrFL8hWLf1Yc 6eamMcLRE3IL/ofX+gztk7Lkj9+HM/AKYSgtoqpLLSQ+TQ8Vo08WEKLhxaLmVXR48Ispxa 0ZC00rOhiTr53qqNw/6DwXeRSFCyDLs= From: Usama Arif To: Kiryl Shutsemau Cc: Usama Arif , Catalin Marinas , Will Deacon , James Morse , Mark Rutland , Marc Zyngier , Doug Anderson , Petr Mladek , Thomas Gleixner , Andrew Morton , Baoquan He , Puranjay Mohan , Breno Leitao , Julien Thierry , Lecopzer Chen , Sumit Garg , kernel-team@meta.com, kexec@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, "Kiryl Shutsemau (Meta)" Subject: Re: [PATCH v5 1/4] firmware: arm_sdei: add sdei_is_present() Date: Tue, 30 Jun 2026 03:47:11 -0700 Message-ID: <20260630104713.3847805-1-usama.arif@linux.dev> In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT On Mon, 29 Jun 2026 16:07:15 +0100 Kiryl Shutsemau wrote: > From: "Kiryl Shutsemau (Meta)" > > invoke_sdei_fn() returns -EIO when no SDEI conduit was probed, and the > core warns ("Failed to create event ...") on any registration that hits > that. An optional consumer that registers an event from an unconditional > initcall would therefore make every boot on a non-SDEI system emit that > warning for what is simply absent firmware. > > Expose whether SDEI firmware is present so such a consumer can skip > registration -- and the warning -- when there is nothing to talk to. > > Signed-off-by: Kiryl Shutsemau (Meta) > Reviewed-by: Douglas Anderson > --- Can this be merged in patch 3 where this function is actually used? > drivers/firmware/arm_sdei.c | 10 ++++++++++ > include/linux/arm_sdei.h | 3 +++ > 2 files changed, 13 insertions(+) > > diff --git a/drivers/firmware/arm_sdei.c b/drivers/firmware/arm_sdei.c > index f39ed7ba3a38..c161cf263547 100644 > --- a/drivers/firmware/arm_sdei.c > +++ b/drivers/firmware/arm_sdei.c > @@ -339,6 +339,16 @@ static void _ipi_unmask_cpu(void *ignored) > sdei_unmask_local_cpu(); > } > > +/* > + * Was SDEI firmware probed and is it usable? Lets optional consumers skip > + * registering an event -- and the warning a failed registration emits -- on > + * systems with no SDEI. > + */ > +bool sdei_is_present(void) > +{ > + return sdei_firmware_call; sdei_firmware_call is a function pointer. The above is correct, but can we make it sdei_firmware_call != NULL? I think that looks a lot better. > +} > + > static void _ipi_private_reset(void *ignored) > { > int err; > diff --git a/include/linux/arm_sdei.h b/include/linux/arm_sdei.h > index f652a5028b59..b07113eeeff7 100644 > --- a/include/linux/arm_sdei.h > +++ b/include/linux/arm_sdei.h > @@ -37,6 +37,9 @@ int sdei_event_unregister(u32 event_num); > int sdei_event_enable(u32 event_num); > int sdei_event_disable(u32 event_num); > > +/* Was SDEI firmware probed and usable? */ > +bool sdei_is_present(void); > + > /* GHES register/unregister helpers */ > int sdei_register_ghes(struct ghes *ghes, sdei_event_callback *normal_cb, > sdei_event_callback *critical_cb); > -- > 2.54.0 > >