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 X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 89517C2D0C6 for ; Wed, 11 Dec 2019 15:44:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5748D2073B for ; Wed, 11 Dec 2019 15:44:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576079065; bh=+apFpkaZDwSpUqEzEbDAZkekxpk/M4D8c6QZn+sWc0M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=e3vrB1oMPwTRdShe05c5giJrDSsvWN0yRv4P2/k8dIrCGd9Y7j0cNLeQYwndUcSw0 qP57aMy4PhTZFq9ZYGtJ6x7jcNziZi0qtuVDUo9yL0TjZWAGUuJBzFZmCkC0xi4/MR qI4MtL6gpLwhYueC1RpeqhUC/sDhABlyNy1/lM/I= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388529AbfLKPoY (ORCPT ); Wed, 11 Dec 2019 10:44:24 -0500 Received: from mail.kernel.org ([198.145.29.99]:33098 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387424AbfLKP11 (ORCPT ); Wed, 11 Dec 2019 10:27:27 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 57BA9208C3; Wed, 11 Dec 2019 15:27:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1576078047; bh=+apFpkaZDwSpUqEzEbDAZkekxpk/M4D8c6QZn+sWc0M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pON9V1pfI6/5JS3Inu/yUUkQ0/FnamRAx60K3uar+j34lGKubwuJnAhBKk1E88Be+ wlD5vqVSCvEYH9aXVjEqqhUXX0sHt7mq0narYTlfiMNk8Xv+CFIY/4EHezvtDt+Zir 2tPQE44JoMsr0PyPKG+JZx/aveKSvIVJvavaIEtk= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Tyrel Datwyler , Bjorn Helgaas , Michael Ellerman , Sasha Levin , linux-pci@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 40/79] PCI: rpaphp: Don't rely on firmware feature to imply drc-info support Date: Wed, 11 Dec 2019 10:26:04 -0500 Message-Id: <20191211152643.23056-40-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191211152643.23056-1-sashal@kernel.org> References: <20191211152643.23056-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tyrel Datwyler [ Upstream commit 52e2b0f16574afd082cff0f0e8567b2d9f68c033 ] In the event that the partition is migrated to a platform with older firmware that doesn't support the ibm,drc-info property the device tree is modified to remove the ibm,drc-info property and replace it with the older style ibm,drc-* properties for types, names, indexes, and power-domains. One of the requirements of the drc-info firmware feature is that the client is able to handle both the new property, and old style properties at runtime. Therefore we can't rely on the firmware feature alone to dictate which property is currently present in the device tree. Fix this short coming by checking explicitly for the ibm,drc-info property, and falling back to the older ibm,drc-* properties if it doesn't exist. Signed-off-by: Tyrel Datwyler Acked-by: Bjorn Helgaas Signed-off-by: Michael Ellerman Link: https://lore.kernel.org/r/1573449697-5448-6-git-send-email-tyreld@linux.ibm.com Signed-off-by: Sasha Levin --- drivers/pci/hotplug/rpaphp_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/hotplug/rpaphp_core.c b/drivers/pci/hotplug/rpaphp_core.c index f56004243591f..ccc6deeb9ccf0 100644 --- a/drivers/pci/hotplug/rpaphp_core.c +++ b/drivers/pci/hotplug/rpaphp_core.c @@ -275,7 +275,7 @@ int rpaphp_check_drc_props(struct device_node *dn, char *drc_name, return -EINVAL; } - if (firmware_has_feature(FW_FEATURE_DRC_INFO)) + if (of_find_property(dn->parent, "ibm,drc-info", NULL)) return rpaphp_check_drc_props_v2(dn, drc_name, drc_type, *my_index); else -- 2.20.1