From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (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 0DFF427B35F for ; Wed, 30 Sep 2026 00:38:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790728693; cv=none; b=ZXSSp0rg1fn0J6AXhTyEPOVV9Td1fmE58jbyEZgSthy8+z5ez5ej+/VT3Wa2cYxbqkWsnq/D4EYowDkHuaFnLvHuoFs5nzmVk2jpgYORW+UeheapTZAdr9QXyVyVjTbB1GtoHY/tERjTrXhCCtV/9jCnr0HZogtXlXOCJGl5kPI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1790728693; c=relaxed/simple; bh=lDQv8VNO6G/soX/VtU2MWJkebNPtrgeVeBYGPflNv8c=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=qFDHLCr590UsS3YrDRNPsYjJmzoZMb0b727YzrMU5yw4vM0K5i02jUcTKL48BeCZGWTKTTqWw8E1xkoDXIUPQFwK9MmnSNm02Vy6Oq0eClsWFy4VjbxF731Fqcq8jVFoTAj9s36XycWos0XcedVIrFaA9zhcMXRPOHfM867EWOE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=a5CGJ63s; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=DMgrflcf; arc=none smtp.client-ip=205.220.180.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="a5CGJ63s"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="DMgrflcf" Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 68TNPmMf1592582 for ; Wed, 30 Sep 2026 00:38:09 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to; s=qcppdkim1; bh=DihlMyvHEyVrVer9hDXtw89b IAPj1z5S1SGkXU3ZFzU=; b=a5CGJ63sjO8ovHEMsXAudd/im6jBlkmBPClNu3/A 3DUskr40A0eTyQkOcUh/Qvn2KJ/9P8JF2DOHpoySV5rmce3213gAGsfFPfYctJqN ck8RXSvaGxPSc88VpB/6g6v4xePBeD7hqrslAwaXG8HyW0f9kscfOK+fO3Cnp0il iw1LBbaH09sPHRJhBqkQWIIX2rV/IouRt0JHAew80kEHFeEhsRpPv8nl2MY2qJvB I2RYLgM8BJ4D7EFq+ryaNsHt/jzGuOEI3jmHote/9Wue4mVPlC8nD43zVNfm6c8M jFQW/g9La5zqpIVvFL2sP5Alm1lxkKdHgrSvXSL1xvI8Cg== Received: from mail-dl1-f72.google.com (mail-dl1-f72.google.com [74.125.82.72]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4h0hsh1et4-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 30 Sep 2026 00:38:08 +0000 (GMT) Received: by mail-dl1-f72.google.com with SMTP id a92af1059eb24-139b62317d0so1529547c88.0 for ; Tue, 29 Sep 2026 17:38:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1790728688; x=1791333488; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=DihlMyvHEyVrVer9hDXtw89bIAPj1z5S1SGkXU3ZFzU=; b=DMgrflcfec/kN5X8OGPHdrFh50XcVsDLvtT22ZNdzMU5+UVUqlAuOPkZQM8zUNCsGm VNmQp7zbQGfn75u7oJTxbpfm36ESf7G0m51Ayrjmh5sBUU8BeJY3iv2ydi/BpU+ZmLYn fRzzygHfKTjA8FX0PN0FFhH/fFD+xcnMGLDLMV2CsoY5qvT2GARgsJjXfxUhl8IHtTug GQw1uMNHWIg4cbUYawd/M1eGpCY9Fw12rg3uq5KaLFYcs8pEvs8wQ7ZyS+/KJwyqkL/y 2yx05OFEaCSc4tYMJM7MjPB4Bj5xEXMN7Go+NOMl9EOTRZsGDSmF4sq2lGBpRFe2SKgz mDaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1790728688; x=1791333488; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=DihlMyvHEyVrVer9hDXtw89bIAPj1z5S1SGkXU3ZFzU=; b=VBnGC4M0BHh34BzibM1eWdm11AupkSgxotNyFpIl3q/LkIG9nGnNqgiO07tthWb+4/ pxfUdLwSJkYTcREGFy+GMu+4THp67goAPgQD7onawOC6gYcoMdBnmzyzTMB1AspU0VEO /Acj9+AVGve/SNuUxKZHCCFQha4yDUBWtBT+fNYkrsF7ud0Ms9+rcF2oP4i0H7FJGEXm rvmjF54xZ09OrBbMy+LFSolvy1SXNMU8ez8iTsSfbOFXXWNsmf68q5OSqTjbXHX92g8l y8jmXT8SuYOxCgtVDs/e30Hx+C7iF+7TXgDBB3pUJaFn3aLGAaBUQUVcjVGxnMOBCQVX 8AaA== X-Forwarded-Encrypted: i=1; AKwUvBwAYcnjNciSdDSwIEWBkZmpAOEw+eorIDmRNy/bFHa0DE8a8XhIBzLcGYszo9OPE9TRwy6DqMYmZ6TuvwM=@vger.kernel.org X-Gm-Message-State: AFuF++lBnjNmwbNEZEWmKI96K9VaKmOzUJ7iLSIXjIrDP5Erf3Pcq2vu pBS9/dOm6p3EuaBgPYCWOK1mPVd/zYTWaJ8blAhSnXcJeq18obnGBQe6Si0bCSup+QMJzuP4JvG kKf83kvZzWgPtET5vSiYtk/rxEX3V1aCSPUfoioxDESm2xQp+iXhZYYfBqzGVnXTIJow= X-Gm-Gg: AYBFou3DxxAjigOO4KyoZWs6ve7KsVhyPFeZPPgEIY8/WL6c3PuLvzGgKVG7pBLlb9n pRJwAg3kQcgCsbPGQlI+WL5zjIxPGkgWHsuzfJ+5uHdOHVd8Dz2FZG1lEWZFGpSSRTWdGZPLP/i PaoYPI8/m+830P9MY1VEPmbpP/jCp/B3PVRgOCPeAADcQvO+xsDIVNxKI8rB6zVIXR9IzrqsU2o BJNld01y0BNUDeK7tAGJae8iS3INx6TZfvrdfDozgDecjSoo8ywGOUMT+nBq0Ca3GEl6y8TuCxs 82MjQ4/uwGZdK4UvgoYdXqqox46kblWx+/4hqdFfiUlQ/4Tq3AFAz2NVlAbWWK8Hh05mzThMtN+ Oxhxar5gMVYWHfkgrh13W6E0pTRMHSIFNI6/rGI/Xlv1JS4Rl X-Received: by 2002:a05:7022:f401:b0:143:868a:20c1 with SMTP id a92af1059eb24-14ca00a17c2mr1398038c88.46.1790728687718; Tue, 29 Sep 2026 17:38:07 -0700 (PDT) X-Received: by 2002:a05:7022:f401:b0:143:868a:20c1 with SMTP id a92af1059eb24-14ca00a17c2mr1397989c88.46.1790728686996; Tue, 29 Sep 2026 17:38:06 -0700 (PDT) Received: from hu-ashoraj-lv.qualcomm.com (Global_NAT1.qualcomm.com. [129.46.96.20]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-14c60c55d41sm1917754c88.1.2026.09.29.17.38.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Sep 2026 17:38:06 -0700 (PDT) Date: Tue, 29 Sep 2026 17:38:04 -0700 From: Ashok Raj To: Lorenzo Pieralisi Cc: "Rafael J. Wysocki" , Mark Rutland , Marc Zyngier , Daniel Lezcano , Thomas Gleixner , Greg Kroah-Hartman , Danilo Krummrich , Hanjun Guo , Sudeep Holla , Wim Van Sebroeck , Guenter Roeck , Robin Murphy , Catalin Marinas , Will Deacon , Bartosz Golaszewski , Andy Shevchenko , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, driver-core@lists.linux.dev, linux-watchdog@vger.kernel.org, Ashok Raj Subject: Re: [PATCH RFC 02/11] ACPI: Introduce irq_get() for static fwnodes Message-ID: References: <20260925-acpi-static-table-irq-probe-defer-v1-0-2c62125d0085@kernel.org> <20260925-acpi-static-table-irq-probe-defer-v1-2-2c62125d0085@kernel.org> 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=utf-8 Content-Disposition: inline In-Reply-To: X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwOTMwMDAwMSBTYWx0ZWRfX7DAH1qAiR26A +0r0N3tTShBxGvoZxN1v1pI2/nkXk+Xz5zh4+XeueDz4iqsfWDw8i0FSH3XI0dwL4MFhRYTehP/ LXQFVhR1ldH3g/oQzKc/tQQf2tbIiJ073WfRnzmrar6ON27yvMTArYIGzp6BNJ53OqfnjxhayAs lONIjtfHrGBP5wkVp0wRkwH4kZ5vo8NAAhVB8T+VlBzt4rXG5eUzzcbx1/OI+S2TaeFIY37o3BT KawSUTraR33RxUSokKdk1jofjInNFoLl2lSGczp3KawPyhIR7wFKDNfyR4yI2poR0b2dtfUMmRu w7Wcsr7zfxmvS5Ddw8gxn+ijN+ukN/+rmothQ5QNP7z+J9+4XuCswHV/sgJlHTUEoV0yWlWw2IB 861C13xnwStOVsRMb8YqhtDCoqgE4Xjr4jJgre4EtbHqd/Nful+a3GQa4t9wv0HWZVvwnWVhzQd ZJupSMqKEfXeCgsVASA== X-Proofpoint-GUID: j4Ko7YScFGXeTr00cVncDuVG1jNJp6lM X-Proofpoint-ORIG-GUID: j4Ko7YScFGXeTr00cVncDuVG1jNJp6lM X-Proofpoint-Spam-Info: AW1haW4tMjYwOTMwMDAwMSBTYWx0ZWRfX0e9cKtoweMqi Fbkq091bG4bIwGV8vmUIorIM8CABVuoZ/C0aLCGaGk5XC9vC25RcwZNCVe1Do3/Ahe1Sn1JXnXm AlYKTv7DSUQs5t8wG/Pc9RVUd3Vk81I= X-Authority-Analysis: v=2.4 cv=cZZHPXDM c=1 sm=1 tr=0 ts=6abc59f0 cx=c_pps a=bS7HVuBVfinNPG3f6cIo3Q==:117 a=ouPCqIW2jiPt+lZRy3xVPw==:17 a=IkcTkHD0fZMA:10 a=VdqzKS8jKosA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=ZpdpYltYx_vBUK5n70dp:22 a=VwQbUJbxAAAA:8 a=QyXUC8HyAAAA:8 a=EUspDBNiAAAA:8 a=p-kz3MFidYKym44KqwAA:9 a=QEXdDO2ut3YA:10 a=vBUdepa8ALXHeOFLBtFW:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-09-29_05,2026-09-21_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 priorityscore=1501 phishscore=0 impostorscore=0 lowpriorityscore=0 spamscore=0 adultscore=0 bulkscore=0 malwarescore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2609040000 definitions=main-2609300001 On Tue, Sep 29, 2026 at 10:40:59AM +0200, Lorenzo Pieralisi wrote: > On Mon, Sep 28, 2026 at 04:24:18PM -0700, Ashok Raj wrote: > > > > On Fri, Sep 25, 2026 at 09:48:01AM +0200, Lorenzo Pieralisi wrote: > > > To describe and map GSIs for firmware nodes created out of ACPI static > > > table entries in a uniform way it is required to define some standard > > > properties and attach them to ACPI static fwnode as secondary nodes. > > > > > > Define properties names to describe GSIs and their trigger-mode/polarity, > > > and implement an irq_get() callback for static fwnodes so that core code > > > can retrieve and map IRQs for ACPI static fwnodes in standard manner. > > > > > > An empty stub for property_read_string_array() is also added, so that > > > the fwnode_irq_get_byname() interface falls back (through > > > fwnode_property_read_string_array()) to the secondary > > > fwnode to grab the "interrupt-names" property. > > > > > > Signed-off-by: Lorenzo Pieralisi > > > Cc: Bartosz Golaszewski > > > Cc: Andy Shevchenko > > > Cc: "Rafael J. Wysocki" > > > --- > > > drivers/acpi/property.c | 69 ++++++++++++++++++++++++++++++++++++++++++++++++- > > > include/linux/acpi.h | 4 +++ > > > 2 files changed, 72 insertions(+), 1 deletion(-) > > > > > > diff --git a/drivers/acpi/property.c b/drivers/acpi/property.c > > > index 8ee5a1f0eb48..c609100c08db 100644 > > > --- a/drivers/acpi/property.c > > > +++ b/drivers/acpi/property.c > > > @@ -1766,7 +1766,74 @@ static int acpi_fwnode_irq_get(const struct fwnode_handle *fwnode, > > > > > > DECLARE_ACPI_FWNODE_OPS(acpi_device_fwnode_ops); > > > DECLARE_ACPI_FWNODE_OPS(acpi_data_fwnode_ops); > > > -const struct fwnode_operations acpi_static_fwnode_ops; > > > + > > > +static int acpi_static_fwnode_read_u32_prop_index(const struct fwnode_handle *fwnode, > > > + const char *propname, > > > + unsigned int index, u32 *value) > > > +{ > > > + u32 *values; > > > + int ret, count; > > > + > > > + count = fwnode_property_count_u32(fwnode, propname); > > > + if (count < 0) > > > + return count; > > > + > > > + if (index >= count) > > > + return -ENOENT; > > > + > > > + values = kcalloc(count, sizeof(*values), GFP_KERNEL); > > > + if (!values) > > > + return -ENOMEM; > > > + > > > + ret = fwnode_property_read_u32_array(fwnode, propname, values, count); > > > + if (!ret) > > > + *value = values[index]; > > > + > > > > You lookup with a propname, and then qualify with and index? is it > > possible to have the different index but same propname? > > What is the question :) ? It is to retrieve a property value at a specific > index. Gah... I'm wondering what was my question as well :-) See below: acpi_static_fwnode_irq_get() calls this read_string_array() multiple times from within the same function.. Sorry for the terse message, apologies. > > > Alternately you can send the list to caller and they can use the ones > > they need? > > > > > > > + kfree(values); > > > + return ret; > > > +} > > > + > > > +static int acpi_static_fwnode_read_string_array(const struct fwnode_handle *fwnode, > > > + const char *propname, > > > + const char **val, size_t nval) > > > +{ > > > + /* Route string handling to secondary software nodes */ > > > + return -EINVAL; > > > +} > > > + > > > +static int acpi_static_fwnode_irq_get(const struct fwnode_handle *fwnode, > > > + unsigned int index) > > > +{ > > > + u32 gsi, trigger, polarity; > > > + int ret; > > > + > > > + if (!fwnode->secondary) > > > + return -ENODEV; > > > + > > > + fwnode = fwnode->secondary; > > > + > > > + ret = acpi_static_fwnode_read_u32_prop_index(fwnode, ACPI_IRQ_PROP_GSI, > > > + index, &gsi); > > > + if (ret) > > > + return ret == -ENOENT ? -ENXIO : ret; > > > + > > > + ret = acpi_static_fwnode_read_u32_prop_index(fwnode, ACPI_IRQ_PROP_GSI_TRIGGER, > > > + index, &trigger); > > > + if (ret) > > > + return ret == -ENOENT ? -ENXIO : ret; > > > + > > > + ret = acpi_static_fwnode_read_u32_prop_index(fwnode, ACPI_IRQ_PROP_GSI_POLARITY, > > > + index, &polarity); For each of the above calls for read_u32_prop_index() the allocation, copy a value and does free it. Instead you could read the whole array, and just get each value and discard it once? > > > + if (ret) > > > + return ret == -ENOENT ? -ENXIO : ret; > > > > Consolidate return to one place? > > Yes it can (and trigger and polarity can be just one property "flags", FWIW), > if we agree that's what will do, which I doubt. > > Thanks, > Lorenzo -- /ashok.raj ashok.raj@oss.qualcomm.com Qualcomm Inc