From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=192.198.163.10 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796407808; b=syj626AqIYo9xvnDe0XOZnA93vZ27DGaLuumd+hu+35a6gPOwxkqtFV+AZft+oKCUCVg wTVhB3fkHFg/laLOjfK1r+xW2tNSrdhUgllvy5f5zE8CGOwKqpveYtLFmEeRoqrQpMjZI s09ASFJyr0gFPVhK9LSqZCIeWSKlCVYeEv8Vwhgk2iUpy0sgZNdg33eiZQ60Uw/GwElcr 6EB7eg83zCt0gxBg9GD2HroV8OR31LNsu0Nyb1n1PezImAePOqjNcs4pPvBheA81OEbFh EJmPRka+An9k+AbW0r8SK33ov+EdOVpI9A9n0i827vkK3E13s4Ah/iTrRr9kh3IhBaw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796407808; h=DMARC-Filter:DKIM-Signature:X-CSE-ConnectionGUID:X-CSE-MsgGUID: X-IronPort-AV:X-IronPort-AV:Received:X-CSE-ConnectionGUID: X-CSE-MsgGUID:X-ExtLoop1:X-IronPort-AV:Received:Date:From:To:Cc: Subject:Message-ID:References:MIME-Version:Content-Type: Content-Disposition:In-Reply-To:Organization; bh=vJvIalezEB0ojCM8EAKSJhJ/dhMm9bPFioILTHkZuHg=; b=HtUxonJbD0ofZQ7jTWUaxF+VOup0WEr3l51AUBCMPd5zUJoy/g9F5FrKdyN0j6xq2MKG ZI6LqJh28U/E1KH+C+omY9wxN+v4W+u8XbUOK6wqeJyf4seYcIDUAkcEgI/GXmGujjuHj 08oBbL0lqzlnInqune+nrYQW4OoG1eU/1Ytna1ZySlSl+H6/LQuJXgUWNxPr3YHwoAIlS Q2BFovsCsH+TBUcK+pDbm7Nfb5iA+qCcAKBFhOwW2jm5f4DYU94Ud4CZVO0BDqbKpsoJe JNDjiEd7UxYhfILaWDAWxhY7oQuiAbjLSKfcp+UwtKghGwwumFnettpiDPF/mLPm2Zg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.intel.com; spf=pass smtp.mailfrom=linux.intel.com; dkim=pass header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=YN8zKQFf; arc=none smtp.remote-ip=192.198.163.10 Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.10]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3A7C0606A330 for ; Fri, 4 Dec 2026 18:10:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 3A7C0606A330 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.a=rsa-sha256 header.s=Intel header.b=YN8zKQFf DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796407809; x=1827943809; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=vJvIalezEB0ojCM8EAKSJhJ/dhMm9bPFioILTHkZuHg=; b=YN8zKQFfyiLFBpdITjfj9bGgRDvTDwjerHQOm/kBfTc+ZspEjcQAssgk DUBg/YCgkydJuRYhAxLzkz7Vew6d+vN5M5XbNVP8ik2LASqGbb1hryS5q nj53IkZvqooyBVxB5YuFTmw8lx4Ieps3xk0/uB103EEuDDMSUpkTmGqab 0TfIsDPNPuEu6nFFOt4KARTzxZcdkkuDHJ+rtyLD+mrrfN6Tnl4+9msdv NhrFlzCEspZ4SK+/c8YMDiHSTXv8i6Hirdm5fnYJvd/id9x5k9Du8pMKc jRcvYn0Kx76zOLJVa/tc5ukFoTNGSXVjqFr/+YBvhmQNjHxZ2otFrw+Ws Q==; X-CSE-ConnectionGUID: /bLzt5kGTqSlFeNvapBlng== X-CSE-MsgGUID: NzcdbQamT4SV1m9N/21wZA== X-IronPort-AV: E=McAfee;i="6800,10657,11986"; a="5282992" X-IronPort-AV: E=Sophos;i="6.29,78,1794902400"; d="scan'208";a="5282992" Received: from orviesa004.jf.intel.com ([10.64.159.144]) by fmvoesa104.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2026 10:10:08 -0800 X-CSE-ConnectionGUID: ZDh7khEfTMu//kfjRY8OJA== X-CSE-MsgGUID: ptkRERa9SA28nQKhpUGRPA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.29,78,1794902400"; d="scan'208";a="13959942" Received: from alekseim-mobl.ger.corp.intel.com (HELO localhost) ([10.245.245.10]) by smtpauth.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2026 10:10:03 -0800 Date: Fri, 4 Dec 2026 20:10:00 +0200 From: Andy Shevchenko To: Lorenzo Pieralisi Cc: "Rafael J. Wysocki" , Mark Rutland , Marc Zyngier , Daniel Lezcano , Thomas Gleixner , Greg Kroah-Hartman , Danilo Krummrich , Hanjun Guo , Sudeep Holla , Robin Murphy , Catalin Marinas , Will Deacon , Bartosz Golaszewski , Leo Yan , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, driver-core@lists.linux.dev Subject: Re: [PATCH RFC v2 2/9] ACPI: Introduce IRQ methods for static fwnodes Message-ID: References: <20261130-acpi-static-table-irq-probe-defer-v2-0-7e854fe7aecd@kernel.org> <20261130-acpi-static-table-irq-probe-defer-v2-2-7e854fe7aecd@kernel.org> X-Mailing-List: driver-core@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261130-acpi-static-table-irq-probe-defer-v2-2-7e854fe7aecd@kernel.org> Organization: Intel Finland Oy - BIC 0357606-4 - c/o Alberga Business Park, 6 krs, Bertel Jungin Aukio 5, 02600 Espoo On Mon, Nov 30, 2026 at 09:54:34AM +0100, Lorenzo Pieralisi wrote: > To describe and map GSIs for firmware nodes created out of ACPI static > table entries in a uniform way later than at static tables parsing time, > it is required to store GSI data (number, trigger/polarity and name) in > the ACPI static fwnode for late retrieval. > > Define an ACPI static fwnode structure and add to it data that can store > GSI number/flag/names to describe GSIs and their trigger mode/polarity, > and implement irq_get()/property_read_string_array() callbacks for static > fwnodes so that core code can retrieve and map IRQs for ACPI static fwnodes > in standard manner. ... > +static int acpi_static_fwnode_read_string_array(const struct fwnode_handle *fwnode, > + const char *propname, > + const char **val, size_t nval) > +{ > + const struct acpi_static_fwnode *node = container_of(fwnode, > + struct acpi_static_fwnode, fwnode); I find the following style slightly better to follow const struct acpi_static_fwnode *node = container_of(fwnode, struct acpi_static_fwnode, fwnode); > + unsigned int i; > + if (strcmp(propname, "interrupt-names") || !node->irq_count || !node->irqs[0].name) > + return -EINVAL; Okay, so it's stricly limited to IRQs for now. > + if (!val) > + return node->irq_count; > + > + nval = min_t(size_t, nval, node->irq_count); Can we avoid _t variant of min() please? > + for (i = 0; i < nval; i++) for (size_t i = 0; i < nval; i++) > + val[i] = node->irqs[i].name; > + > + return nval; > +} ... > +struct acpi_static_irq { > + u32 gsi; > + u8 trigger; > + u8 polarity; > + const char *name; > +}; I see a big potential of reusing this data type elsewhere in the kernel. Can we have it somewhere in acpi.h or close enough and name like struct acpi_gsi? -- With Best Regards, Andy Shevchenko