From patchwork Sat Feb 22 01:40:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saravana Kannan X-Patchwork-Id: 204441 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.4 required=3.0 tests=DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 95B8DC35641 for ; Sat, 22 Feb 2020 01:40:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6ADC924656 for ; Sat, 22 Feb 2020 01:40:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="ud1xUGHO" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727950AbgBVBkt (ORCPT ); Fri, 21 Feb 2020 20:40:49 -0500 Received: from mail-pf1-f202.google.com ([209.85.210.202]:54003 "EHLO mail-pf1-f202.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727910AbgBVBkr (ORCPT ); Fri, 21 Feb 2020 20:40:47 -0500 Received: by mail-pf1-f202.google.com with SMTP id c17so2331198pfi.20 for ; Fri, 21 Feb 2020 17:40:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=sbjXfIRqNbN+zO5bw0TFE0zoSgbZ1QQ5aagCM5afePc=; b=ud1xUGHOBKvb/hZaryVaI0jhkYzz5PMsiqucgi7KvMFeX2D1rSak9aqlz2JV4MfsgI pJbYlLQNDo2dsKJEc9w0UdWn5OkznacQzkYXVWHl90VuF0fsvPkoR3nquTTE1GsB4MQm YAjxBeEEt7lWKTHfucFlkjRcz0SATmBBngwVsozp9aYIuHPNtonVoPndgLcoQREA/smt 9G0k9UU9LmKNVjRSlwiQ1TgsSxURjQTvJks4xUdDTpOZRjuHkRVGVhehKQ2T8djuWzyt AUb8BWrZi4JAcse07+7XxAOmwWyrDwx+gJWak2I03A+RyDpRqhNZqdm8xpLBMwtrHxhX obOQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=sbjXfIRqNbN+zO5bw0TFE0zoSgbZ1QQ5aagCM5afePc=; b=T1UV8CB1S5liiupE13BYqjiPVfD5bEcbjW/vKniNAx4LficflNLg5EGhZmOhkPZ1ec LMy9w+DNk6dhCOME9Z/tR0yyWSPCYhWCte9uWaj3s43BBunL98OKd3Kqob8K9Trv0YdR KeRzgm31jF2/3sx4dik2YrUt1Z7OkQMM71Zc1oP/BaK23gZxeOhfuICOVyC1jlpUxdEU iPrWWr2FDdF+byfP+TuJC+D5GVzp9WMaZCMTeq3PJ7qgR8tQPcktYW9dTh6ViQoV99zk 56BUuf5xiPY8YO7fVMf7ZPcfIfCU+QLzR9UqoWdrWIWuKctHakclW3PwnVnCp1pe6rAy F0fQ== X-Gm-Message-State: APjAAAWZGAGc/OHi9nPDNyX4hqZ+yHvZmUGMFsVnff082zH0wQTfp+u5 8IAB603Bluv2rP3vgWhjW6d7gNo+6RbChl4= X-Google-Smtp-Source: APXvYqxDQk1BSfiJ4Um6agz42N01VWAX3UFH/JG2+Be5e7QkaImHOBKwFc8btIvgsRytF/5NFRyY8vpitPM8CIY= X-Received: by 2002:a63:8ac7:: with SMTP id y190mr41772483pgd.68.1582335645920; Fri, 21 Feb 2020 17:40:45 -0800 (PST) Date: Fri, 21 Feb 2020 17:40:34 -0800 In-Reply-To: <20200222014038.180923-1-saravanak@google.com> Message-Id: <20200222014038.180923-2-saravanak@google.com> Mime-Version: 1.0 References: <20200222014038.180923-1-saravanak@google.com> X-Mailer: git-send-email 2.25.0.265.gbab2e86ba0-goog Subject: [PATCH v1 1/5] driver core: Reevaluate dev->links.need_for_probe as suppliers are added From: Saravana Kannan To: Jonathan Corbet , Greg Kroah-Hartman , "Rafael J. Wysocki" , Ard Biesheuvel , Rob Herring , Frank Rowand , Len Brown , Saravana Kannan Cc: kernel-team@android.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org, devicetree@vger.kernel.org, linux-acpi@vger.kernel.org Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org A previous patch 03324507e66c ("driver core: Allow fwnode_operations.add_links to differentiate errors") forgot to update all call sites to fwnode_operations.add_links. This patch fixes that. Legend: -> Denotes RHS is an optional/potential supplier for LHS => Denotes RHS is a mandatory supplier for LHS Example: Device A => Device X Device A -> Device Y Before this patch: 1. Device A is added. 2. Device A is marked as waiting for mandatory suppliers 3. Device X is added 4. Device A is left marked as waiting for mandatory suppliers Step 4 is wrong since all mandatory suppliers of Device A have been added. After this patch: 1. Device A is added. 2. Device A is marked as waiting for mandatory suppliers 3. Device X is added 4. Device A is no longer considered as waiting for mandatory suppliers This is the correct behavior. Fixes: 03324507e66c ("driver core: Allow fwnode_operations.add_links to differentiate errors") Signed-off-by: Saravana Kannan --- drivers/base/core.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/base/core.c b/drivers/base/core.c index dbb0f9130f42..d32a3aefff32 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c @@ -523,9 +523,13 @@ static void device_link_add_missing_supplier_links(void) mutex_lock(&wfs_lock); list_for_each_entry_safe(dev, tmp, &wait_for_suppliers, - links.needs_suppliers) - if (!fwnode_call_int_op(dev->fwnode, add_links, dev)) + links.needs_suppliers) { + int ret = fwnode_call_int_op(dev->fwnode, add_links, dev); + if (!ret) list_del_init(&dev->links.needs_suppliers); + else if (ret != -ENODEV) + dev->links.need_for_probe = false; + } mutex_unlock(&wfs_lock); } From patchwork Sat Feb 22 01:40:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saravana Kannan X-Patchwork-Id: 204439 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.4 required=3.0 tests=DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 69B3EC35673 for ; Sat, 22 Feb 2020 01:41:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3F2922072C for ; Sat, 22 Feb 2020 01:41:08 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="tiWAct/l" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727957AbgBVBky (ORCPT ); Fri, 21 Feb 2020 20:40:54 -0500 Received: from mail-pf1-f201.google.com ([209.85.210.201]:36807 "EHLO mail-pf1-f201.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727954AbgBVBkw (ORCPT ); Fri, 21 Feb 2020 20:40:52 -0500 Received: by mail-pf1-f201.google.com with SMTP id 6so2349927pfv.3 for ; Fri, 21 Feb 2020 17:40:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=KcPp0gP7GELHPbQmhvOuNvrhkif2qUrzumcvFBDOK9U=; b=tiWAct/lW1qWhKwT1NraZmKOl/hogEF7BkErGRXVit1viyco6ajvbC9mz3kiFMua6i TXNq2t+i0wPehD/a08VL1JQQH9Rnr9VR2NEKeEmZ8FLJhmSFDZ0rVirUFv3+tELLG6Gp 1Odhw8Q7qlUlkq1pZqeqAMwP3dTqnrHwG/aPULh9Zktd5pHO30UGcf0fGZWZPZ85s0Y6 g5vruuy+o5NmhnAq1Bi7z5UhTM9KxLDhHYWDSFQ31yZ5D0g/dNjltCGyIjGVEk50kOv0 /sABPtof6x7ACZaNTuqAWywFBrRPUIP1zVHm1SpMLSbhEsUJQJhGbghszJjbeEqYP4d+ zPkg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=KcPp0gP7GELHPbQmhvOuNvrhkif2qUrzumcvFBDOK9U=; b=LEk/C4zj5hl6YQQfIUoTZWTbAmZlu4Rlw1l/QbueogcW5Faily/PwD9sHdwksDba2X XnQgj0EK092t3vR3P3nOhW1WzdreFjpkos1y3A+i1titqsB6bnoo0ixlYy0Ne7kGs2MQ 2Qm2K6OjrNRnXBKq0LwOOo6m7LtXbJ7DcgmyJtUjXqjOtJtbl9+jcHRFgC2rGH36yokV CCO2D6yPlyqS5ypqFqT3fP7heEXyvjUJunzqZd2wuKY/V/U6DXmrhu4l4pIHHewTj0E7 xw0zYPrvcYXbiGqCA8uor6wh/1bZBMQfrSVQSrgfqx0QrAzKEtt6sSGt1eKAGEX5yC+D n0ng== X-Gm-Message-State: APjAAAX3Bco+gOlhhWrwXM+S3c5RmUNF0nBUJ3I9D/4ANYsz4G/bQ+rN +ZTbkV5Iu85SU8YojRBakNFvI3IGiN68ItA= X-Google-Smtp-Source: APXvYqzPdWRjgeOkhSTiaxyK4n8nsnHWWk0aEfT3lTbN5PVbLfvLNibYxGOnd/zAFy69mSlFb3/Z8610AQaog60= X-Received: by 2002:a63:ec49:: with SMTP id r9mr41310425pgj.445.1582335652146; Fri, 21 Feb 2020 17:40:52 -0800 (PST) Date: Fri, 21 Feb 2020 17:40:36 -0800 In-Reply-To: <20200222014038.180923-1-saravanak@google.com> Message-Id: <20200222014038.180923-4-saravanak@google.com> Mime-Version: 1.0 References: <20200222014038.180923-1-saravanak@google.com> X-Mailer: git-send-email 2.25.0.265.gbab2e86ba0-goog Subject: [PATCH v1 3/5] efi/arm: Start using fw_devlink_get_flags() From: Saravana Kannan To: Jonathan Corbet , Greg Kroah-Hartman , "Rafael J. Wysocki" , Ard Biesheuvel , Rob Herring , Frank Rowand , Len Brown Cc: Saravana Kannan , kernel-team@android.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org, devicetree@vger.kernel.org, linux-acpi@vger.kernel.org Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The fw_devlink_get_flags() provides the right flags to use when creating mandatory device links derived from information provided by the firmware. So, use that. Signed-off-by: Saravana Kannan --- drivers/firmware/efi/arm-init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/firmware/efi/arm-init.c b/drivers/firmware/efi/arm-init.c index d99f5b0c8a09..6703bedfa9e1 100644 --- a/drivers/firmware/efi/arm-init.c +++ b/drivers/firmware/efi/arm-init.c @@ -349,7 +349,7 @@ static int efifb_add_links(const struct fwnode_handle *fwnode, * If this fails, retrying this function at a later point won't * change anything. So, don't return an error after this. */ - if (!device_link_add(dev, sup_dev, 0)) + if (!device_link_add(dev, sup_dev, fw_devlink_get_flags())) dev_warn(dev, "device_link_add() failed\n"); put_device(sup_dev); From patchwork Sat Feb 22 01:40:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Saravana Kannan X-Patchwork-Id: 204440 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.4 required=3.0 tests=DKIMWL_WL_MED, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E8B8DC35671 for ; Sat, 22 Feb 2020 01:41:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id BCEE82072C for ; Sat, 22 Feb 2020 01:41:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="Q+ZW5zte" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728003AbgBVBlA (ORCPT ); Fri, 21 Feb 2020 20:41:00 -0500 Received: from mail-pg1-f201.google.com ([209.85.215.201]:46014 "EHLO mail-pg1-f201.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728010AbgBVBk7 (ORCPT ); Fri, 21 Feb 2020 20:40:59 -0500 Received: by mail-pg1-f201.google.com with SMTP id c2so2125697pga.12 for ; Fri, 21 Feb 2020 17:40:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=KJExBCe79TvbDWBtLAIAPlDU0zRERHckO2kWsYTv978=; b=Q+ZW5zteZDu1FNYEMvKTjgWjf9TVSuk16yWcCy2JweJvkq+lTHDxx786967t+KpMC4 WrYcOnyyCjG511w+00j/x8XY7e26b2TsnE4kgWSZWOu2mqXMNa4nKltDIZEpyts40fte lFqRTRmjS84KOl/C+eXYSKbGlWvz3Gd//g5GAHgn0aO4ANiawlYoLTBfCMF4SiV0na5K le4v19xzzHsWvOo6HvWOoFfzUVYAS9DL8Q/vlnOOT1FwrUxBu+HkYHMl42BYYcyqchtQ ViLRU0kcaRQfGqeLQ4KYUhyqKl7rdiLM2cX6tOiClI1uGnFefdSz/2HsMYabeyxF/Who Bv0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=KJExBCe79TvbDWBtLAIAPlDU0zRERHckO2kWsYTv978=; b=grXw7HaSxAEzNvjofrGTqXGsNijqkOxWUVsI7sh6QzHaq+ZdoAZim4luQlnNcmas96 anDkxrxFVCD4I4i4jwCofeVR+VIJyBas4Z7x4WYYRNUrxaN3b2nSeDXV706OMatnytZO /4k9SWK6PW5yOtDJQM9X4Ilg4PH0e7oSbnhVLfdgxGufBoFFSbK1kkfbY4dmZqDy1dX5 sUCMI2X4HWaYvwi/nhzdNYFik/vaUYD4cZiqcCN2DaGTF4mV6Kv/MsBtaSvXoRG99G5z cBkhHq1nxL1MWhKr8XEJQm9EsuIhvFkbeWvG0NxOyvQbEXqcF8sXVBlqpCGgzK9ud7BT HokQ== X-Gm-Message-State: APjAAAXgVtfP6tLsVjURVVc48b69jdhj16e1uEOGMoCa/A+wJdmf74Gl PZpIhFEXyJ3KzlBGe8iD0dDpICk1irfPzxU= X-Google-Smtp-Source: APXvYqzeslKuPNzcFs1IbK32oZCNMmy4nVP9Y84HztkmAh6Tdl4LyaoiuujEisOnVrevdJg+wGWCL5JtzXjW6PI= X-Received: by 2002:a63:4804:: with SMTP id v4mr40448137pga.373.1582335658427; Fri, 21 Feb 2020 17:40:58 -0800 (PST) Date: Fri, 21 Feb 2020 17:40:38 -0800 In-Reply-To: <20200222014038.180923-1-saravanak@google.com> Message-Id: <20200222014038.180923-6-saravanak@google.com> Mime-Version: 1.0 References: <20200222014038.180923-1-saravanak@google.com> X-Mailer: git-send-email 2.25.0.265.gbab2e86ba0-goog Subject: [PATCH v1 5/5] of: property: Delete of_devlink kernel commandline option From: Saravana Kannan To: Jonathan Corbet , Greg Kroah-Hartman , "Rafael J. Wysocki" , Ard Biesheuvel , Rob Herring , Frank Rowand , Len Brown Cc: Saravana Kannan , kernel-team@android.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-efi@vger.kernel.org, devicetree@vger.kernel.org, linux-acpi@vger.kernel.org Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org With the addition of fw_devlink kernel commandline option, of_devlink is redundant and not useful anymore. So, delete it. Signed-off-by: Saravana Kannan --- Documentation/admin-guide/kernel-parameters.txt | 6 ------ drivers/of/property.c | 6 ------ 2 files changed, 12 deletions(-) diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt index 29985152b66d..6692b2aa6140 100644 --- a/Documentation/admin-guide/kernel-parameters.txt +++ b/Documentation/admin-guide/kernel-parameters.txt @@ -3299,12 +3299,6 @@ This can be set from sysctl after boot. See Documentation/admin-guide/sysctl/vm.rst for details. - of_devlink [OF, KNL] Create device links between consumer and - supplier devices by scanning the devictree to infer the - consumer/supplier relationships. A consumer device - will not be probed until all the supplier devices have - probed successfully. - ohci1394_dma=early [HW] enable debugging via the ohci1394 driver. See Documentation/debugging-via-ohci1394.txt for more info. diff --git a/drivers/of/property.c b/drivers/of/property.c index 15fc9315f1a7..f104f15b57fb 100644 --- a/drivers/of/property.c +++ b/drivers/of/property.c @@ -1299,15 +1299,9 @@ static int of_link_to_suppliers(struct device *dev, return ret; } -static bool of_devlink; -core_param(of_devlink, of_devlink, bool, 0); - static int of_fwnode_add_links(const struct fwnode_handle *fwnode, struct device *dev) { - if (!of_devlink) - return 0; - if (unlikely(!is_of_node(fwnode))) return 0;