Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1313767pxu; Sat, 12 Dec 2020 08:40:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJytDYgPQLd2ctoikAGn3q2sp22zFmUTb7WN5AucWkQQRKaeAsBZmZDqI+eK0MV5rgHnd1RB X-Received: by 2002:aa7:c0c2:: with SMTP id j2mr14461733edp.343.1607791251601; Sat, 12 Dec 2020 08:40:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607791251; cv=none; d=google.com; s=arc-20160816; b=rSh3BjeL3an4trky3PNVijTTQuh5+mKixk8/3qnBowJQ39ozVkMEmtVWe/f/oveXFY YVGT5n1yODRy2qjTCgr6P0ebGaLx+yDKeci5dVkAlbCyWp/YA3MyAvTSf32HL+KOpedn wLcrihIq532ZeGPa56FRcCqV6t63sdBBUHV4gyOoiG3bcfOZJP34XV+xyu+Vkp0zgopx cElgHQjvMnHMe/lPasoPwZ0i0tk/ni4wX/2QacoZxSTbGmKdcHoxgB7HoPhsVBZ9svz6 5YBQaUKu3lGT1FyyeNnt7+65xm5ezaqyQ9Q/DP7VGryzdVnkBrRwfdeyEv68ZnSRZgQE CE7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=2Q09SnWNYOGRP1aNUnVwFGO3MFQmvVcctUwsQU76BGc=; b=ruuvgpyJsZP2rbi6LN1cnhDVTpZbkfTz/n/G9alSW05ZG3bBg1USyOyPSJej/re0ay tOlelgjtGE0t3yNhRT47iLOxE6pb8wF3AxTLWHOIlbtjb9vncS7IgaBzjyQu1wdxIl8T Mh2nM2BZtMuMPZsl+FOMionOJTopvuNBk5565ZkcoQ5i81Hy2UlQEAOKzMreMXJ9lLHq HBdafWSV428chABaJ+lHwdQBUy7vkH8N+gpEK9ZBOod1RwExQDtvO8Jhdev7exKH9GIk BBHGhM+zeFlckkzbDcKz5f6QGd6Xa1oBMLLAaa4DfBx7cd+kNr0Fhh5py7WnjO/UXzjX 4vOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=nByrL7+1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a73si7681319edf.23.2020.12.12.08.40.27; Sat, 12 Dec 2020 08:40:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=nByrL7+1; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2436597AbgLKRxj (ORCPT + 99 others); Fri, 11 Dec 2020 12:53:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2436661AbgLKRwg (ORCPT ); Fri, 11 Dec 2020 12:52:36 -0500 Received: from mail-yb1-xb43.google.com (mail-yb1-xb43.google.com [IPv6:2607:f8b0:4864:20::b43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10ED4C061794 for ; Fri, 11 Dec 2020 09:51:56 -0800 (PST) Received: by mail-yb1-xb43.google.com with SMTP id k78so8757150ybf.12 for ; Fri, 11 Dec 2020 09:51:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=2Q09SnWNYOGRP1aNUnVwFGO3MFQmvVcctUwsQU76BGc=; b=nByrL7+1KjFw3I/zYNYfdITtVIH2sUB1nu7ab1NWcdA8d9RUIyx3D8ncYGF2AQay/M gZvQUoqxfz9zh+IHsxoksiXUA5dFkwt5KAvxAUnLd6gy5d+CrNVkPijTcZjVlGNGyX12 /AUf58EyclUw/MN+Qp6b0kBjAtntMdSfoEARdDqo/Do4IkOnsHjBjHRdWk7+5sygM4TM Qu/hkTyBUPqKMXpOddtqNqpI8SmmG1/OEbIRBFOkTSEDxkldAzLD9nL/heWiE6PVjHMs gKmMpbyDBiSyz241Lc0PPj1/J2FzTyEanWMyfoa0d0y8c8T8cuS6n4LxO2jz+72KORc/ 7g1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=2Q09SnWNYOGRP1aNUnVwFGO3MFQmvVcctUwsQU76BGc=; b=cmaN61bLIdheC7JeW5imrpRWpcZzqV5dXgMohSuMz7RpK4ZNaiEBoOzU2vXRNe3PvJ I3/QIGwc0+HFqEYXWbOABhwxO/qjhEXWf5GGpnYWIH95i2XNDHm4vAOohavbRr142r2p vO1nKfhJXQtv1eDM3BREnHP31N2ZqCDYLlW6NgnFyV3FURjQvnEko7k6rMaL84sWpUsr e5jqmHu4jMHoe12PrAK9Rl2afg+3EL8X6ozXIIbUqgWUwDcgk+8iE4N9Es6926lZWDxV 8Epro4+CUaajNwo7JwqSPLDvSWGQlDdtypjd01omT8tWX/xmyVJ5GxDR4Vh8sgwrgmyL pGNA== X-Gm-Message-State: AOAM530XD7QA/2WRMYuxv3jPGjaaK04ISJzT5s1S6TmVv85ttO1dHAQN HRavbWGNpAWWF3z25IlVRgFG8NaelIFZ56pPC9oYtg== X-Received: by 2002:a25:6604:: with SMTP id a4mr21355396ybc.412.1607709114755; Fri, 11 Dec 2020 09:51:54 -0800 (PST) MIME-Version: 1.0 References: <20201121020232.908850-1-saravanak@google.com> <20201121020232.908850-17-saravanak@google.com> <02e7047071f0b54b046ac472adeeb3fafabc643c.camel@redhat.com> <788ee1c7-0ea2-33ec-658e-50707f7515a6@arm.com> In-Reply-To: <788ee1c7-0ea2-33ec-658e-50707f7515a6@arm.com> From: Saravana Kannan Date: Fri, 11 Dec 2020 09:51:18 -0800 Message-ID: Subject: Re: [PATCH v2 16/17] driver core: Refactor fw_devlink feature To: Robin Murphy Cc: Qian Cai , "Rafael J. Wysocki" , "Rafael J. Wysocki" , Len Brown , Greg Kroah-Hartman , Ard Biesheuvel , Rob Herring , Frank Rowand , Marc Zyngier , Thomas Gleixner , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Grygorii Strashko , Stephen Rothwell , linux-efi , LKML , ACPI Devel Maling List , Tomi Valkeinen , Laurent Pinchart , Android Kernel Team , Linux Next Mailing List , linux-arm-kernel Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 11, 2020 at 8:34 AM Robin Murphy wrote: > > On 2020-12-11 14:11, Qian Cai wrote: > > On Fri, 2020-11-20 at 18:02 -0800, Saravana Kannan wrote: > >> The current implementation of fw_devlink is very inefficient because it > >> tries to get away without creating fwnode links in the name of saving > >> memory usage. Past attempts to optimize runtime at the cost of memory > >> usage were blocked with request for data showing that the optimization > >> made significant improvement for real world scenarios. > >> > >> We have those scenarios now. There have been several reports of boot > >> time increase in the order of seconds in this thread [1]. Several OEMs > >> and SoC manufacturers have also privately reported significant > >> (350-400ms) increase in boot time due to all the parsing done by > >> fw_devlink. > >> > >> So this patch uses all the setup done by the previous patches in this > >> series to refactor fw_devlink to be more efficient. Most of the code has > >> been moved out of firmware specific (DT mostly) code into driver core. > >> > >> This brings the following benefits: > >> - Instead of parsing the device tree multiple times during bootup, > >> fw_devlink parses each fwnode node/property only once and creates > >> fwnode links. The rest of the fw_devlink code then just looks at these > >> fwnode links to do rest of the work. > >> > >> - Makes it much easier to debug probe issue due to fw_devlink in the > >> future. fw_devlink=on blocks the probing of devices if they depend on > >> a device that hasn't been added yet. With this refactor, it'll be very > >> easy to tell what that device is because we now have a reference to > >> the fwnode of the device. > >> > >> - Much easier to add fw_devlink support to ACPI and other firmware > >> types. A refactor to move the common bits from DT specific code to > >> driver core was in my TODO list as a prerequisite to adding ACPI > >> support to fw_devlink. This series gets that done. > >> > >> [1] - https://lore.kernel.org/linux-omap/ea02f57e-871d-cd16-4418-c1da4bbc4696@ti.com/ > >> Signed-off-by: Saravana Kannan > >> Tested-by: Laurent Pinchart > >> Tested-by: Grygorii Strashko > > > > Reverting this commit and its dependency: > > > > 2d09e6eb4a6f driver core: Delete pointless parameter in fwnode_operations.add_links > > > > from today's linux-next fixed a boot crash on an arm64 Thunder X2 server. > > Since the call stack implicates the platform-device-wrangling we do in > IORT code I took a quick look; AFAICS my guess would be it's blowing up > trying to walk a zeroed list head since "driver core: Add fwnode_init()" > missed acpi_alloc_fwnode_static(). Thanks Robin. I'm pretty sure this is the reason. I thought I fixed all ACPI cases, but clearly I missed this one. I'll send out a patch for this today. If you think there are any other places I missed please let me know. I'll try some git grep foo to see if I missed any other instances of fwnode ops being set. -Saravana