From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2492B23BCF1 for ; Thu, 3 Jul 2025 09:31:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751535078; cv=none; b=L82fsjMFXs/QK1xRPDtG3/NSa/AUmT3mu8Cak9ZoSpk1pQv0g4KLnhO39ZeZXLhOd8lXX3oAWmNB/nPvpGKcux8NnifzxSNh84T6vL6/JaD0qaubWm0QHG/epLQ4Vd5Z2GJ7/r0hVq/NN+Zds4ZoVd6Ds0XC+Vqr6+4vU3kLw/w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751535078; c=relaxed/simple; bh=TuOOe17TTK0GmQ0tDt79qSc+86xnI17yc0LFNt1uwAA=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=G1pRdCa7VufEpd/YJwh+DOWprBK5gXVFqy1aFToGSdaDDFjI0mP3IZp0AfuIGpDg5jsXUnsJghQT0ED/xDuovkf3XXfzGmSKFx3nGWvhS7d7BDAFhbHRoVFKXUSyxNn6/+0cpeu6UNCyrTBo7a7l8KiG2OjzzopQqjghf3ZTpKE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com; spf=pass smtp.mailfrom=ventanamicro.com; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b=ZJ0QpDZU; arc=none smtp.client-ip=209.85.214.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ventanamicro.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b="ZJ0QpDZU" Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-23633a6ac50so98106435ad.2 for ; Thu, 03 Jul 2025 02:31:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1751535076; x=1752139876; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=KYfn57qzkkmG/aFpndf/jcsizGLt8T7mJq7PMwyO3ks=; b=ZJ0QpDZU0gZw+/ekmPbtcgxXuNpf2zz0Rx+6g8GJIrKPOqQzRd4uBc5Gb1GVg9Wkof Syn2vpGr8bgHmi0PZWyaS7y+8x0OuobhmNzhE+fQDxEf1AI3b+MMDnFaszevYi4CuhRE TZDAUKySD90MyFkJMNzI0bSjoduBOh6G8u5+wVswIB75rtEqdlc2QS8c/23zvWVmMala P37UuXzFj1DpwHFnIcCPylCEBDid9nyuOZwXsfz9iCUa3JlXu0zpJ4h1xD67atgoOpiT QbxqQwNDJsA42+6V6u9f6yoglM8kWLpOMYh1sxRvucVmp1E14hIGE7UjhXDuFsrTe/Rx zWUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751535076; x=1752139876; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=KYfn57qzkkmG/aFpndf/jcsizGLt8T7mJq7PMwyO3ks=; b=a0UdFL1s7jn11a5bmppfnHKi6JRE5A37U9XyLmjPWnbmZ8bUTvgsGyTkCqgu00u1tB rLVf8Fr1wUXY4HP5Z23DIK70O77gmgvJ0Xk1OrsTuKIhQzqTr+F7Z7B4Ly/XJXVjna/E Kvx6FhFLCCpFSDc5oU+i/KQZGJvWiwPD/eDT0z8zAeWfuBzP9GiSk5OxZS8uyig13WpP c/YgzHnwOiTr9qDlGfaaLUBHEb5+hZuStyqRPx+oEp5CLCmetWK5lRWGgJKjio136HUu kNMSTGvXOF3thX1xvEy6zNEMQYbNmMBV5AlGpUxdH0XwEUS+NESFFp5YHIqGtwXqTpT2 H38A== X-Forwarded-Encrypted: i=1; AJvYcCW7/42Memupor3h7PTVH/pifNuZcwr6pF1C4g0eCSzfBwE2lDHqIKqtfg0CrFMuBxHLJGyxPLsEdko=@vger.kernel.org X-Gm-Message-State: AOJu0YxyMa6ovqhxx3pzMvSDJ0gi6CMtSJtX22RHvbyXJaai+XlJv4IH Eh0yp00nAUHf2XzMMQWXekkNvpc37W9JqQfnqZLeiaHEtR9FKz79/vaz/mcgN5/Fodk= X-Gm-Gg: ASbGncu8uA761ei0BGMzQ5B+J5SVWDLX/VZk7GoFKbmTF8SwdZkYhcdjk0xAWuuWjyU yJdmUiF1cXSYk1fgkYcfABYfWZsPzohjiDMiSBMKkKnhFe+Gq6v/iBiIQOaSTlfGSDZX81zqCmQ I9IeOs06jMgtxm35etd6v8dAhSeydOqsDV46pIubB9WUQGljVmM4nnARXyK5LbMbOvUFpIg4nPY Lx3wPUraPqV05cnkC/OS3NLIj6iqV6H75sLW00thkL0l/Cqym+xIYCLY/yjoGdWnIWcs4Xween/ WX2U+EOCQPsyc9RUbedO18Hm2aUBPEIJxaSzQzl3Oh+qiCLDwQ2Q220QymOnaQKTBKTMYQ== X-Google-Smtp-Source: AGHT+IHQ535n0QA2COW4KxgJhYDC5l8yNht6HeovLAUQ6LzoicprfT4zy9/VUUX2qQcf/7mXsoAJng== X-Received: by 2002:a17:903:19e7:b0:234:d292:be7a with SMTP id d9443c01a7336-23c6e4e4c8fmr85926675ad.1.1751535076424; Thu, 03 Jul 2025 02:31:16 -0700 (PDT) Received: from sunil-laptop ([103.97.166.196]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-23acb2f0babsm158604535ad.58.2025.07.03.02.31.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Jul 2025 02:31:15 -0700 (PDT) Date: Thu, 3 Jul 2025 15:01:00 +0530 From: Sunil V L To: "Rafael J. Wysocki" Cc: Andy Shevchenko , Anup Patel , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Jassi Brar , Thomas Gleixner , Mika Westerberg , Linus Walleij , Bartosz Golaszewski , Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= , Palmer Dabbelt , Paul Walmsley , Alexandre Ghiti , Len Brown , Rahul Pathak , Leyfoon Tan , Atish Patra , Andrew Jones , Samuel Holland , Anup Patel , linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-acpi@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v7 15/24] ACPI: property: Add support for cells property Message-ID: References: <20250702051345.1460497-1-apatel@ventanamicro.com> <20250702051345.1460497-16-apatel@ventanamicro.com> Precedence: bulk X-Mailing-List: linux-clk@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Wed, Jul 02, 2025 at 06:56:48PM +0200, Rafael J. Wysocki wrote: > On Wed, Jul 2, 2025 at 5:06 PM Sunil V L wrote: > > > > On Wed, Jul 02, 2025 at 02:39:30PM +0200, Rafael J. Wysocki wrote: > > > On Wed, Jul 2, 2025 at 1:38 PM Andy Shevchenko > > > wrote: > > > > > > > > On Wed, Jul 02, 2025 at 12:20:55PM +0200, Rafael J. Wysocki wrote: > > > > > On Wed, Jul 2, 2025 at 7:16 AM Anup Patel wrote: > > > > > > > > ... > > > > > > > > > > static int acpi_fwnode_get_reference_args(const struct fwnode_handle *fwnode, > > > > > > const char *propname, const char *nargs_prop, > > > > > > unsigned int args_count, unsigned int index, > > > > > > > > > > const struct acpi_device_data *data; > > > > > > struct fwnode_handle *ref_fwnode; > > > > > > struct acpi_device *device; > > > > > > + unsigned int nargs_count; > > > > > > int ret, idx = 0; > > > > > > > > > > + nargs_count = acpi_fwnode_get_args_count(device, nargs_prop); > > > > > > > > > > I think it should work the same way as it used to for the callers that > > > > > pass args_count, so maybe > > > > > > > > > > if (!args_count) > > > > > args_count = acpi_fwnode_get_args_count(device, nargs_prop); > > > > > > > > But this is different variable. > > > > > > Of course it is different. It is an acpi_fwnode_get_reference_args() parameter. > > > > > > > > > element++; > > > > > > - > > > > > > ret = acpi_get_ref_args(idx == index ? args : NULL, > > > > > > acpi_fwnode_handle(device), > > > > > > - &element, end, args_count); > > > > > > + &element, end, > > > > > > + nargs_count ? nargs_count : args_count); > > > > > > > > > > And this change would not be necessary? > > > > > > > > This is not the same check as proposed above. > > > > > > No, it is not. > > > > > > It just makes the function work the same way it did before the change > > > for the callers who passed nozero args_count and so they might be > > > forgiven expecting that it would be taken into account. > > > > But if we do like this, the expectation of > > fwnode_property_get_reference_args() will differ for DT and ACPI, right? > > I mean nargs_prop should take higher precedence than nargs. > > So you basically want acpi_fwnode_get_reference_args() to take > nargs_prop into account (which could be explained much cleaner in the > patch changelogs). > Sure. Let me improve the commit message in the next version. . > Also, your changes don't modify the behavior of > __acpi_node_get_property_reference() AFAICS, so this is OK. > That's correct. > Never mind then, but you could pass nargs_prop along with the > additional device parameter to acpi_get_ref_args() and make that > function obtain the nargs_prop value. In the patch, you need to get > the nargs_prop value before calling it anyway in both places in which > it is used. That's better. Let me update acpi_get_ref_args() itself in the next version. Thanks! Sunil