From patchwork Tue Aug 3 21:56:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 12417381 X-Patchwork-Delegate: bhelgaas@google.com 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.0 required=3.0 tests=BAYES_00,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham 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 E7374C4338F for ; Tue, 3 Aug 2021 21:57:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CF24F60EB9 for ; Tue, 3 Aug 2021 21:57:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231329AbhHCV5L (ORCPT ); Tue, 3 Aug 2021 17:57:11 -0400 Received: from mail-il1-f182.google.com ([209.85.166.182]:44589 "EHLO mail-il1-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230124AbhHCV5K (ORCPT ); Tue, 3 Aug 2021 17:57:10 -0400 Received: by mail-il1-f182.google.com with SMTP id i13so8963310ilm.11 for ; Tue, 03 Aug 2021 14:56:59 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=yn4O9xEl6ru3rpDSJ+8kj55TrJUZvu9sqWFIWkVC+Pg=; b=c12MSABvtrr4Uh6JRu8VRLw8ESgF2bNhcmnxOji28EA9RLXvkRUN7pQVFW1+38mpB5 I8BIkTHvRKZGKS0Nw76TDTRKDnGqgrlULvj75TbSbUWAGp8IQBgPIHrNtkwPnhgx2TlA +hO7nuuIylsqBNcvmYMm5nh3SQJfHXbOGhNRd+/PxjtSP6JWbUhwL/Se6wz+snEUoIoN hX3VjBJUU/R4XAYntGzVbIrW8Xl78d77oEuZf1ZUMt/i+0Ta1I1jU7Tsn2b73NGTDVUr GlreATlSMMN9K0EW3AI/EKuYnvyZqXgGazIFiA727ggHKmt651+mMtjNIlz4Rkl8gLL0 uGIA== X-Gm-Message-State: AOAM532W9+tOnwHpckl+rmHgDtIL5kYELfKqKdvb7Nv3bbumOTAU6DgD FowPJxEMgf5HxUJFs+3GbQ== X-Google-Smtp-Source: ABdhPJwNKianj0C+7zTvckxnhOj3b3Q0ZNocwW6PPcIY+xaavptFIG5JGlf3uP6IUcaPevqtQBZUPw== X-Received: by 2002:a92:ca8f:: with SMTP id t15mr1052313ilo.262.1628027819042; Tue, 03 Aug 2021 14:56:59 -0700 (PDT) Received: from xps15.herring.priv ([64.188.179.248]) by smtp.googlemail.com with ESMTPSA id r24sm221635ioa.31.2021.08.03.14.56.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Aug 2021 14:56:58 -0700 (PDT) From: Rob Herring To: =?utf-8?b?UmFmYcWCIE1pxYJlY2tp?= Cc: linux-pci@vger.kernel.org, Srinath Mannam , Roman Bacik , Bharat Gooty , Abhishek Shah , Jitendra Bhivare , Ray Jui , Florian Fainelli , BCM Kernel Feedback , Scott Branden , Bjorn Helgaas , Lorenzo Pieralisi Subject: [PATCH 1/2] PCI: of: Don't fail devm_pci_alloc_host_bridge() on missing 'ranges' Date: Tue, 3 Aug 2021 15:56:55 -0600 Message-Id: <20210803215656.3803204-1-robh@kernel.org> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Commit 669cbc708122 ("PCI: Move DT resource setup into devm_pci_alloc_host_bridge()") made devm_pci_alloc_host_bridge() fail on any DT resource parsing errors, but Broadcom iProc uses devm_pci_alloc_host_bridge() on BCMA bus devices that don't have DT resources. In particular, there is no 'ranges' property. Fix iProc by making 'ranges' optional. If 'ranges' is required by a platform, there's going to be more errors latter on if it is missing. Fixes: 669cbc708122 ("PCI: Move DT resource setup into devm_pci_alloc_host_bridge()") Reported-by: Rafał Miłecki Cc: Srinath Mannam Cc: Roman Bacik Cc: Bharat Gooty Cc: Abhishek Shah Cc: Jitendra Bhivare Cc: Ray Jui Cc: Florian Fainelli Cc: BCM Kernel Feedback Cc: Scott Branden Cc: Bjorn Helgaas Cc: Lorenzo Pieralisi Signed-off-by: Rob Herring Acked-by: Bjorn Helgaas Tested-by: Rafał Miłecki --- drivers/pci/of.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/of.c b/drivers/pci/of.c index a143b02b2dcd..d84381ce82b5 100644 --- a/drivers/pci/of.c +++ b/drivers/pci/of.c @@ -310,7 +310,7 @@ static int devm_of_pci_get_host_bridge_resources(struct device *dev, /* Check for ranges property */ err = of_pci_range_parser_init(&parser, dev_node); if (err) - goto failed; + return 0; dev_dbg(dev, "Parsing ranges property...\n"); for_each_of_pci_range(&parser, &range) {