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=OsQ+0+eibiWaiC95JzI/CLrW2Av6jEO7EK4N0JR7X70y7wS0K/PVy+s3ybfayGua2dJ1 ET98oP+pdma8EMS/4zUd62a4x/Y4+dy0d1pbhBrPp6C3uID1jP1dCbaC/DytQKJIDe3JJ HkQH2jy2cHRxc7knDbEJbdEkegXc/gclP/S6QyoHgdoou5av3plR9OFl974PrON9u/nbq xhgiaPB8xio/O7AI/3nZvy+9bChx6VLJwdhFRpJ91IaFeMY/T9PiGaU8gX1YmIOOGwHoQ zuA4USV5k46KiLf4kRBOkjD8YbOPnkgJnLXvIwrRwt2exu5wxYCAoAbfC50AZkRfEGg== 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=SuG9wJ0GEFyaRg3Rrtc5dQwR+tIpOBe/OLqaDFYsDPAeic9oXVz+ugL5ooAjMzEuNBDu 5elz8t5JZzFLmox9rpzeRsp+HJQ8DF5yIhYnGYB0VV3mnDHlRlPtsXO/dRA9xX8QI00r6 y2i0B+dxxC/oFwlLbauL2KbWTO1Flq5M3RM5FYtomwgm+smBVQBxvUKPGIl4mgoq+e7O7 2SSbbMC+DwFywuEmY1Am6ooaR/ZT2fgQmuUsiJIUCHA2O9PDGsiZpyI7K2LHMX4jSa6Wu QOiVqcrGgwEUwiEI9ZIrlz5OwUcBSH6WUsxjQEy1M0rMrAC7tZG2bxWUie89kkucblA== 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 3A7A3606A32D; Fri, 4 Dec 2026 18:10:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 3A7A3606A32D 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: hoVUMbcYTk+uI8EzZNhupw== X-CSE-MsgGUID: cou/lwjoRuC5A2+2ghuIjQ== X-IronPort-AV: E=McAfee;i="6800,10657,11986"; a="5282991" X-IronPort-AV: E=Sophos;i="6.29,78,1794902400"; d="scan'208";a="5282991" 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: linux-acpi@vger.kernel.org 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