From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1888DC433F5 for ; Thu, 12 May 2022 10:10:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352346AbiELKKa (ORCPT ); Thu, 12 May 2022 06:10:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345766AbiELKK0 (ORCPT ); Thu, 12 May 2022 06:10:26 -0400 Received: from mail-pf1-x42c.google.com (mail-pf1-x42c.google.com [IPv6:2607:f8b0:4864:20::42c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A43B19C747; Thu, 12 May 2022 03:10:25 -0700 (PDT) Received: by mail-pf1-x42c.google.com with SMTP id x23so4352475pff.9; Thu, 12 May 2022 03:10:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=2IFiYfoIKlICTpTGvMOw6q9N3Q3vW+HIY5wMaOVljZc=; b=ZS9+8YiztFlMOzLkLRbd3S2QaIvchP0IYmkI4QwtS2UX5aWkOX3kW9v5luy05CeE5U m3Ns2rDEhxjuZj3AvCADV2PrDTS6u+zwRWkrdt4JoAAa1cIgRXTigPM9QSo48OnMdl0p 0N7VeiYFaOecenJjLxTl/Ai1cXGHxgfRhsvEHWREOlLCGAfMNL/g2FDT6TWF8r9VA1bi 2t9jjCvrYDZAckvV10bZhoYKhtEmh60T43DFvxQOdOddYLSfAZ2XBBMGnxzw6r//x2/1 RyuiMg6Vz1/MQ0jh7fKfvAuIhp1RnaHUHAxn6e22FzGfwp1tAMGKEcRU5+VrzHCErJbg mINw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=2IFiYfoIKlICTpTGvMOw6q9N3Q3vW+HIY5wMaOVljZc=; b=dhCpPNtZ4LBmD/74laIPNz1f9tNKGCAt2uObSrE3yzg6SPmJT2svk7vXqbxdoEsrcW m8pX9vZ2x4tve8nwZhCc+vvVTaYPvc3adixPCdyGa8PtRE7OX6kjs8xPmA5uqDplPCGY fI0mSdktmz82dHG4TM4NhkfdPVE9UfBjMwdtBi9eg/AkQd7mUz39Eh88am4kK/vO0wuX YITpNyAf4plKYZLkgG+Jo92jzw5GlaZ9vVQMe6cU72h7eni1k+NfyuxJB50LizUlOczs eFzCXTT3s+TDr+dhlJzljaPiOyp2dEJ9TYGRB4Ffy9MGQsGb7NzSwPXK4y6fQ6OGvJ5d xMiw== X-Gm-Message-State: AOAM532G4eRQt9y+5bizLETbBWMRvAYz/IE+qyItfMDSIgE0ytgJnqsg uBoAa2iI9ZIEq9uDe0+Luqc= X-Google-Smtp-Source: ABdhPJzDknA/eDpL7RTHehedtaKh6jrwFijU1Kxudu0qoCCpM9PmOpPk0MgEfMNQSrtTeIYg8P84dA== X-Received: by 2002:a62:61c6:0:b0:4bd:118:8071 with SMTP id v189-20020a6261c6000000b004bd01188071mr10719694pfb.28.1652350224466; Thu, 12 May 2022 03:10:24 -0700 (PDT) Received: from google.com ([2620:15c:202:201:ad76:8fc:e2ba:172]) by smtp.gmail.com with ESMTPSA id u1-20020a626001000000b0050dc76281aesm3336599pfb.136.2022.05.12.03.10.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 May 2022 03:10:23 -0700 (PDT) Date: Thu, 12 May 2022 03:10:20 -0700 From: Dmitry Torokhov To: Muhammad Usama Anjum Cc: "Rafael J. Wysocki" , Len Brown , Hans de Goede , Mark Gross , Benson Leung , Enric Balletbo i Serra , Greg Kroah-Hartman , Collabora Kernel ML , groeck@chromium.org, dtor@chromium.org, gwendal@chromium.org, vbendeb@chromium.org, andy@infradead.org, Ayman Bagabas , Benjamin Tissoires , =?utf-8?B?Qmxhxb4=?= Hrastnik , Darren Hart , Jeremy Soller , Mattias Jacobsson <2pi@mok.nu>, Mauro Carvalho Chehab , Rajat Jain , Srinivas Pandruvada , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, "Rafael J . Wysocki" , chrome-platform@lists.linux.dev Subject: Re: [PATCH v12] platform/chrome: Add ChromeOS ACPI device driver Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Muhammad, On Thu, May 12, 2022 at 10:34:29AM +0500, Muhammad Usama Anjum wrote: > +static int chromeos_acpi_device_probe(struct platform_device *pdev) > +{ > + chromeos_acpi_gpio_groups = get_gpio_pkg_num(&pdev->dev); > + > + /* > + * If the platform has more GPIO attribute groups than the number of > + * groups this driver supports, give out a warning message. > + */ > + if (chromeos_acpi_gpio_groups > ARRAY_SIZE(chromeos_acpi_all_groups) - 2) > + dev_warn(&pdev->dev, "Only %zu GPIO attr groups supported by the driver out of total %u.\n", > + ARRAY_SIZE(chromeos_acpi_all_groups) - 2, chromeos_acpi_gpio_groups); I know that we can bikeshed this until dawn of time, but we are dealing here with data coming from the system firmware and a singleton device, so it should be all available pretty early in boot sequence. I understand we want to solve the "race" even though it is purely theoretical, but we should be able to figure out what gpios are supported and construct the groups array(s) before registering the platform driver. Or do we see that runtime costs of constricting groups dynamically outweigh space wasted by unused groups? Thanks. -- Dmitry