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=-9.5 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, 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 8919DC433DF for ; Mon, 6 Jul 2020 02:12:23 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3A89420737 for ; Mon, 6 Jul 2020 02:12:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="V9TOmAbq" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3A89420737 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4B0Tbn10TjzDqYS for ; Mon, 6 Jul 2020 12:12:21 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2a00:1450:4864:20::342; helo=mail-wm1-x342.google.com; envelope-from=oohall@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=V9TOmAbq; dkim-atps=neutral Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4B0SqJ23wdzDqWL for ; Mon, 6 Jul 2020 11:37:16 +1000 (AEST) Received: by mail-wm1-x342.google.com with SMTP id q15so37590915wmj.2 for ; Sun, 05 Jul 2020 18:37:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=xUqXfzYE/7nGTfPXjR8nBzb8zuA7EdMsttd7VPsoTIU=; b=V9TOmAbqSOAFRJNcOxYM7b8HyXP025ZhInJ8L5f9H7TsrdsEaydkPPOaZlU0DV/00T ENQsV/fz2zBmKp5MfSxw4x5+ju/NbcnBllfoQ/O92PJ34EdiP0H761SmpKqJMGArQTVg BSTu+0DVSycdf7NjUJEs0RvdO7MSdum75Nv03v7xUXqfBb7OoGycLaChUSiPJh7HcbKh wzNioHZH9kZCw6wheiW++Ig4qJdJoNawmJSSNb4j+kh1oSAZ2L4pc1gGJGlbsdicNsBX /SxEXGxNGpTP0TRAFgcieXDMUqS4sKuIrk0ItZScSuI1uLhyLmGkUMpFZqtKFu9pr4bd EErQ== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=xUqXfzYE/7nGTfPXjR8nBzb8zuA7EdMsttd7VPsoTIU=; b=efFZN739hUJ9aPkNq7Zfe5GapqaLu/70I1/bdD6Ll/o+UP7R2J6VFz06DZedEusypP 8shqbHkxVb7E2WpBmC0cbH3UMi3/0LplMs9EuVM/Z8z9Zc4LTjetJxmZ5zmcY1O2YinM LvdboH0D5H1xYDkEITYIfLdIfQenSTiDQG6+NljDy2qtH3714j3yihuZDBAtLjcWiBdo 0hvYUPwPXtBRz3FtGfase8lvWKDIQQUKn4F/fMxf8gpm/DasECT8vWPZ6y+LiiaTtrcx zzFoGfQnpzrvOsWNxQZDx9wNBNr7CGCBzmPSA13HvrDPOsjHYBgt8rtcGkepfGK/hI8g Ffpg== X-Gm-Message-State: AOAM530jb+k0hYXMUA8LHVSXBuhuTEjFbeCsJZ4Ws18cOJ5naPPfKKvV 22xszZD5/Biy67aEKRc3uQPXzQ2fUIs= X-Google-Smtp-Source: ABdhPJyfQvFOpS2kGrlbLVJH/HTTQNe0u/I51ihxj6T/rTU2mM812+bimhX62QOF7ebA0x9/juVxxg== X-Received: by 2002:a1c:dd86:: with SMTP id u128mr46792350wmg.123.1593999431851; Sun, 05 Jul 2020 18:37:11 -0700 (PDT) Received: from 192-168-1-18.tpgi.com.au (59-102-73-59.tpgi.com.au. [59.102.73.59]) by smtp.gmail.com with ESMTPSA id v6sm9533392wrr.85.2020.07.05.18.37.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Jul 2020 18:37:11 -0700 (PDT) From: Oliver O'Halloran To: linuxppc-dev@lists.ozlabs.org Subject: [PATCH 13/14] powerpc/eeh: Drop pdn use in eeh_pe_tree_insert() Date: Mon, 6 Jul 2020 11:36:18 +1000 Message-Id: <20200706013619.459420-14-oohall@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200706013619.459420-1-oohall@gmail.com> References: <20200706013619.459420-1-oohall@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Oliver O'Halloran , mahesh@linux.ibm.com Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" This is mostly just to make the subsequent diffs less noisy. No functional changes. One thing that needs calling out is the removal of the "config_addr" variable and replacing it with edev->bdfn. The contents of edev->bdfn are the same, however it's worth pointing out that what RTAS calls a "config_addr" isn't the same as the bdfn. The config_addr is supposed to be: with each field being an 8 bit number. Various parts of the EEH code use BDFN and "config_addr" as interchangeable quantities even though they aren't really. Signed-off-by: Oliver O'Halloran --- arch/powerpc/kernel/eeh_pe.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/arch/powerpc/kernel/eeh_pe.c b/arch/powerpc/kernel/eeh_pe.c index 97bf09db2ecd..898205829a8f 100644 --- a/arch/powerpc/kernel/eeh_pe.c +++ b/arch/powerpc/kernel/eeh_pe.c @@ -366,9 +366,8 @@ static struct eeh_pe *eeh_pe_get_parent(struct eeh_dev *edev) */ int eeh_pe_tree_insert(struct eeh_dev *edev) { + struct pci_controller *hose = edev->controller; struct eeh_pe *pe, *parent; - struct pci_dn *pdn = eeh_dev_to_pdn(edev); - int config_addr = (pdn->busno << 8) | (pdn->devfn); /* Check if the PE number is valid */ if (!eeh_has_flag(EEH_VALID_PE_ZERO) && !edev->pe_config_addr) { @@ -382,7 +381,7 @@ int eeh_pe_tree_insert(struct eeh_dev *edev) * PE should be composed of PCI bus and its subordinate * components. */ - pe = eeh_pe_get(pdn->phb, edev->pe_config_addr, config_addr); + pe = eeh_pe_get(hose, edev->pe_config_addr, edev->bdfn); if (pe) { if (pe->type & EEH_PE_INVALID) { list_add_tail(&edev->entry, &pe->edevs); @@ -416,15 +415,15 @@ int eeh_pe_tree_insert(struct eeh_dev *edev) /* Create a new EEH PE */ if (edev->physfn) - pe = eeh_pe_alloc(pdn->phb, EEH_PE_VF); + pe = eeh_pe_alloc(hose, EEH_PE_VF); else - pe = eeh_pe_alloc(pdn->phb, EEH_PE_DEVICE); + pe = eeh_pe_alloc(hose, EEH_PE_DEVICE); if (!pe) { pr_err("%s: out of memory!\n", __func__); return -ENOMEM; } pe->addr = edev->pe_config_addr; - pe->config_addr = config_addr; + pe->config_addr = edev->bdfn; /* * Put the new EEH PE into hierarchy tree. If the parent @@ -434,10 +433,10 @@ int eeh_pe_tree_insert(struct eeh_dev *edev) */ parent = eeh_pe_get_parent(edev); if (!parent) { - parent = eeh_phb_pe_get(pdn->phb); + parent = eeh_phb_pe_get(hose); if (!parent) { pr_err("%s: No PHB PE is found (PHB Domain=%d)\n", - __func__, pdn->phb->global_number); + __func__, hose->global_number); edev->pe = NULL; kfree(pe); return -EEXIST; -- 2.26.2