Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp5319760imm; Tue, 19 Jun 2018 08:32:38 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKl5ZrXmuTb1EcvR7Yq1biUcy+V7fIRBdqeYGZkQfSmhLD7dpaDJY4PSfUUqMMhFRXVm1E2 X-Received: by 2002:a62:fcb:: with SMTP id 72-v6mr18564128pfp.231.1529422358849; Tue, 19 Jun 2018 08:32:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529422358; cv=none; d=google.com; s=arc-20160816; b=tsf2b2Qx6mGnl5CIL2biRou6vQmt2/xK0TUDvyC8a+VTtr+3RSmn7pDC5bwihnwyhZ eKMopg0gO6EAa5GAPW1ZufJYMnGVSwU5/sAcs/TfwHRkvoyMGmxNoH40IcNXRgI1oO3Z spbRDqn9ZzLGeXg4+2o1jYZryQZy/L9AMF6pjSoqo1+cbziXbggZRYrZGa1/rV+ggTsK 3j+PbKV6FSEH2aJ2PKaPvhF0Gc4n6z9a/5SsoR1BoXEEyhkAqSXn4FmincZhpHwOIwub jjZaZJcnh/gotU6SEvrpvpx4qPUE+WxhejRc/N4x2S7bS7pHHdDg8vl5vcIFFnCPw9Ee NdDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=wFXP/+G/y0CiXxzR5wEgHYdiVhVRrbzlGGv4Iu5z9Qw=; b=r6EXId24/+p1kGQ1+1fvoexPHR2h4B4FklV10iFHCxtoYTgnBPfUFoR253g7v6rUjo tPCmZRcUguwMY3UdouX9Qlti69G7o4w4k6Vs9jnr6OIX5LPqmfH2sLwC5tDVtlezpoaY nCy+3Nl1UKAbEgRM3CbdINZUy4yxQ8t0L6IgpkAhRbGhglnsImHvnbyKU1hIvKg6hFc2 ALFSHKa7oS3I96g2mHWzVnw4DZOKZMp3Y02zQTxclrhQygMyy6sj1f5n8pmUi9T/PnEo Qnuc3zyG2IsZ2nGNN+hLtpxQwHJn6YIKN968c/pXcQcpxUNUUWqMHWS3t3YkBGgby2AU JKEg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gpiccoli-net.20150623.gappssmtp.com header.s=20150623 header.b="e+CRUy/E"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m12-v6si17768727pll.461.2018.06.19.08.32.25; Tue, 19 Jun 2018 08:32:38 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gpiccoli-net.20150623.gappssmtp.com header.s=20150623 header.b="e+CRUy/E"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966805AbeFSPaZ (ORCPT + 99 others); Tue, 19 Jun 2018 11:30:25 -0400 Received: from mail-io0-f193.google.com ([209.85.223.193]:40571 "EHLO mail-io0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966591AbeFSPaW (ORCPT ); Tue, 19 Jun 2018 11:30:22 -0400 Received: by mail-io0-f193.google.com with SMTP id g22-v6so581878iob.7 for ; Tue, 19 Jun 2018 08:30:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gpiccoli-net.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=wFXP/+G/y0CiXxzR5wEgHYdiVhVRrbzlGGv4Iu5z9Qw=; b=e+CRUy/EgWc5KLGZhrzUwQNLC2YRD+92oM5Zhqx91Edz5SvwJ5IWEp+h7tU87UU802 keZVwJJSwGDBZUFJZ0DlsP6D5BMMkZZORAXyYztkwXbQ8IrDIgDhANMr3Ly+0xU0txGr VmGG8nCxC/Cxt/bJgcDwsyRxzqg08H3eG5YYvnN7CWldEimvum9qoeuda6U4PmOikjgG Greg7eF3yfyFlkKRYTJ5sjZVyKlPIRyy8uVfi1aw0ZLBy+2GPMPDT6WPzgwbllzXQG+Q cMDhe4tyfPJET748aIupEQoGMZXDexlO8krFsJ2dJRm0by7yt688UGpA93dvm/fCMHHA kxxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=wFXP/+G/y0CiXxzR5wEgHYdiVhVRrbzlGGv4Iu5z9Qw=; b=dldnTtCc9qoC/4cAY6dUvF6Sfa16AkcVpEGmJXiDMnzzUJ6+xU/CyeBkkB9KaweZeD l3LQ8eV6UsBVp1rxSYMTN4hRk/00s9fnm9NFQuoDHx2qSQsABnC4fRn+jouIdKpVtmS2 45VHUuCH7XUNlIj6dz9x7txsj+K39K/LEMvd1ivWBPbcMiZ4gS9aMxwMTDnGqb/z7I7h hs+CaPqG//qJzIhJDjUjS75PJ5RXJ/NoLvsMqyJOPHBADgRiEfYwWI+22JR04a2g0kLA IplsmuDTgXv9bdqQ23UYqXOSpZLIF2FrbZdbF2R6FJKXzwiHwn/vSuKA7R5WDtfGu4qt CB7g== X-Gm-Message-State: APt69E3SRru7YxvhxUM4cWcUAhkxHu2s9ajrjc0Em8fRDzHW6/e346vv 7Hl5ngScMJqzO8johvBqTBxVv6i/ZknihYlacKSwXw== X-Received: by 2002:a6b:f314:: with SMTP id m20-v6mr13790428ioh.253.1529422221730; Tue, 19 Jun 2018 08:30:21 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:ac0:9909:0:0:0:0:0 with HTTP; Tue, 19 Jun 2018 08:29:41 -0700 (PDT) X-Originating-IP: [189.0.91.59] In-Reply-To: <20180618165706.42679-1-danielwa@cisco.com> References: <20180618165706.42679-1-danielwa@cisco.com> From: Guilherme Piccoli Date: Tue, 19 Jun 2018 12:29:41 -0300 Message-ID: Subject: Re: [PATCH] arch: powerpc: pci-common: fix wrong return value check on phd_id To: Daniel Walker Cc: Andrew Morton , xe-kernel@external.cisco.com, Gavin Shan , linux-kernel@vger.kernel.org, Paul Mackerras , Ian Munsie , linuxppc-dev@lists.ozlabs.org, Mauro Rodrigues Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 18, 2018 at 1:57 PM, Daniel Walker wrote: > Cisco has a couple platforms which depend on the domain values getting > set a certain way. We discovered our machines not detecting the pci > devices, and traced it back to this commit, > > 63a7228 powerpc/pci: Assign fixed PHB number based on device-tree > properties > > It seems that the code is expecting the return value of of_property_read_u64() > to be the opposite of what it actually is.. It returns zero on success, and a > negative return value on error. So if you only check when it's non-zero your > going to set Opal for all platforms but Opal, which I assume is not what was > expected. Hi Daniel, thanks for exposing a potential issue and trying to fix. (And thanks Mauro to point this message, since my email changed). I disagree with your patch Daniel, I think it's wrong. Since the logic of my original patch is kind of convoluted, for improve (even my own) understanding, I tried to over-comment the logic here: https://pastebin.ubuntu.com/p/4DNvd9b2bY Please, take a look and see if you agree with the logic now. Regarding your issue, I'm interested - I think perhaps you have some FW flaw that might be exposing duplicated "reg" or "ibm,opal-phbid" properties. Or maybe you somehow rely on the old incremental PHB setting and your software stack is not working properly with the DT-based PHB values. Please, elaborate the issue a bit more in order we can try to figure out. And also, you could try reverting the below two patches and boot the kernel to be sure it works: 61e8a0d5a02 powerpc/pci: Fix endian bug in fixed PHB numbering 63a72284b15 powerpc/pci: Assign fixed PHB number based on device-tree properties *Notice* the first is a fix to my patch, and both should be tested together. Be sure your current kernel has _both or neither_ these patches! Cheers, Guilherme