Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp995770imi; Fri, 22 Jul 2022 14:33:28 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tn9BC8cu8yLjHdk3GQsADlTQD8tCU8sQRqt/TqsGaTV4J8vV3PJWKEd15AdnoLJxlgE1ph X-Received: by 2002:a17:90a:540c:b0:1f2:26f1:6a37 with SMTP id z12-20020a17090a540c00b001f226f16a37mr1701390pjh.68.1658525608329; Fri, 22 Jul 2022 14:33:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658525608; cv=none; d=google.com; s=arc-20160816; b=Lv6t4eqpPKWAJrMnETwzwDRKipLE7jVL8ZbPk6/xR9GI6TkEk9vmVbPAl7PRDqi8rI 7icWEdL+s4QCVLaUK4YFC/JVYs6lbO5AQN84mc8LWcOPzkZMEIudS0tdI+chEfCGZh4v lk9ecbV12idTd1g2KEHYQUlbn8KOmPRdO/MF29EnBdMHz5bbCF86hLIUpUjHrXiVb0oo r1PmS4UxPNgc8Wij7LLOM4Vtvt0xqWdzDqXAW4AFs4Bec1B5pqg/Guv8qaFgNa9pu27B tyNqGt06PszCDmbqQSiD0iXW1oENSS0ruYtjK70C08hVLQJ4ziiGZ6txe5XFzRlxN+aU Q3VQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :message-id:subject:cc:to:from:date:dkim-signature; bh=lmXZpk2/XJAi/pyLdEOIt83KnRTmxnuDbDpwyj/1ey4=; b=zxzYZUX744Wk9pJsLzVHBp5qH3Ow9zcHhv+gBDAXNr8eSqWFR/A1NBmo8/Q32bv0Dl KDU3tYlzXCFA4ypF/hSQQHKzV2CWodn5+odEB92N9Xay7SBXcG0Xd3F1cqSDWyjik1CS vkHXBZsXzVenLZ9PeK0rPh6q7Mu9uDZAKkru+eO0mmpe3LNCTKjA65BESlkrGAQtD6FT LHluBMLFUNU6IctnxO3EvXpepGIJryB6+ZKoD7BRoWjtAVFuvXyPvY+pyvS87ffxs5Be HESiiRgrGRoGbp+622PYNIqQCS5SXMpgX+01OqySgb9JZHHsfJnmzDAWdHiHuJ1Q0XHd yQqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ruDZgOs5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c7-20020a63ea07000000b00406fb6cc725si6616072pgi.94.2022.07.22.14.33.13; Fri, 22 Jul 2022 14:33:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ruDZgOs5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235386AbiGVVHi (ORCPT + 99 others); Fri, 22 Jul 2022 17:07:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229460AbiGVVHh (ORCPT ); Fri, 22 Jul 2022 17:07:37 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 601B29B56C; Fri, 22 Jul 2022 14:07:36 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EF2C4620DD; Fri, 22 Jul 2022 21:07:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2ED47C341C6; Fri, 22 Jul 2022 21:07:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1658524055; bh=BjE6WAFN8f+7PcLVzym80m/hAtGxPQSDC3WhNnOk+G0=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=ruDZgOs5bS6n57s1Z4ZCM8Gaa4i+Rbknj2eIDMdbL+yQ2jG/VrQXcHUAWiTYf/x1B Y2lIDYkvubc8UykDSDfJcJk84t3gBNbxr5jLuu2QxyeMf+5SFbPoX3xiR/AbqMc71v akXmZrInkgokuZqMIWBW4cIM1h+FcqP0VZtW05qn319FVKPZMgbIwdKtZVn1GDGexl kTyZ8uNeDJf0jRo+dqCEIYScE9l4Mzy+M0lL9Ti5IMvXV8tAfVKcMJdO/5LC7B9Dm+ YbBK4POBUV2yv4HnyO9xMJcNhxXEPofug4D1pZwpXWgWB9+WAo4xmYBWVfxxLuR6+d uB+REBQS4dSrQ== Date: Fri, 22 Jul 2022 16:07:33 -0500 From: Bjorn Helgaas To: Niklas Schnelle Cc: Bjorn Helgaas , Jan Kiszka , Matthew Rosato , Pierre Morel , linux-s390@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v6 0/5] PCI: Rework pci_scan_slot() and isolated PCI functions Message-ID: <20220722210733.GA1935162@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220628143100.3228092-1-schnelle@linux.ibm.com> X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 28, 2022 at 04:30:55PM +0200, Niklas Schnelle wrote: > Hi Bjorn, > > In an earlier version[0], I sought to apply the existing jailhouse special case > for isolated PCI functions to s390. As Bjorn noted in[1] there appears to be > some potential for cleaning things up and removing duplication. > > This series attempts to do this cleanup (Patches 1 through 3) followed by enabling > isolated PCI functions for s390 (Patches 4 and 5). > > Testing: > - On s390 with SR-IOV and a ConnectX NIC with PF 1 but not PF 0 passed throug > i.e. the isolated function case. Also of course with just VFs and an NVMe. > - On x86_64 on a desktop system where ARI is disabled and with an SR-IOV NIC > with non-contiguous VFs as well as the usual other PCI devices. > > Thanks, > Niklas > > [0] https://lore.kernel.org/linux-pci/20220404095346.2324666-1-schnelle@linux.ibm.com/ > [1] https://lore.kernel.org/linux-pci/20220408224514.GA353445@bhelgaas/ > > Changes v5 -> v6: > - Added a patch (2) which separates the ARI case into its own function > - Some whitespace changes to remove unnecesssary empty lines > Changes v4 -> v5: > - Remove unintended whitespace change in patch 1 > Changes v3 -> v4: > - Use a do {} while loop in pci_scan_slot() as it is simpler (Bjorn) > - Explicitly check "fn == 0" as it is not a pointer or bool (Bjorn) > - Keep the "!dev" check in the ARI branch of next_fn() (Bjorn) > - Moved the "fn == 0 && !dev" condition out of next_fn() into pci_scan_slot(). > This allows us to keep the "!dev" case in the ARI branch and means there are > no new conditions in next_fn() making it easier to verify that its behavior > is equivalent to the existing code. > - Guard the assignment of dev->multifunction with "fn > 0" > instead of "nr > 0". This matches the existing logic more closely and works > for the jailhouse case which unconditionally sets dev->multifunction for > "fn > 0". This also means fn == 0 is the single "first iteration" test. > - Remove some unneeded whitespace in patch 2 > > Changes v2 -> v3: > - Removed now unused nr_devs variable (kernel test robot) > > Niklas Schnelle (5): > PCI: Clean up pci_scan_slot() > PCI: Split out next_ari_fn() from next_fn() > PCI: Move jailhouse's isolated function handling to pci_scan_slot() > PCI: Extend isolated function probing to s390 > s390/pci: allow zPCI zbus without a function zero > > arch/s390/pci/pci_bus.c | 82 +++++++++--------------------------- > drivers/pci/probe.c | 86 ++++++++++++++++++-------------------- > include/linux/hypervisor.h | 8 ++++ > 3 files changed, 68 insertions(+), 108 deletions(-) Applied to pci/enumeration for v5.20, thanks!