Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1597377imw; Tue, 5 Jul 2022 12:07:56 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vYUnncbzI/gJCO8BzWht0hm5T0G7otZuyYQfVPK4Ckjjdhpl1ikQTem1ur/tFOdMLLTmyQ X-Received: by 2002:a05:6a00:451c:b0:525:b802:bc3d with SMTP id cw28-20020a056a00451c00b00525b802bc3dmr43189064pfb.43.1657048075980; Tue, 05 Jul 2022 12:07:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657048075; cv=none; d=google.com; s=arc-20160816; b=xwWMJS+GgkOjUpvkugfFPGushqE87kVy9GqIylAY77GWcbWMDWpTF2jslo9NdX4wZH 3//MEPDTwxxg1XqHzD2dWyon0Qs/8IkiZIGy9jdDd+nE25nf+QyVBPjxPUUBDu+n+Fid ut2Oy5++QsZiKKzTJhGGoCkka2p8QKd8uh9mrqpZtRFcXEMNLQOkuZVDy/eprhElcsIF ekVOGhVEEjELyq4ImHbM43ZtdOPFvFeR5cpnNWOZUQZydq71fqansIxL9k/ofD7dm8Ed j7VJWJa85zwijJ3xDrZWNJnDVVwavbRSKAsgt7rggX0GSX35h4pFdH5LDUrRxYAoLzgw axOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=yDaZJQ1t7WZXHXc1sh5v+s4p6BMcgf4NLI5GY92Hi9Y=; b=wEjKO07CNAzZitLUxEbbmK2+NZw2xNX5IZPq7MBnMadYtkIcErJ0Oe85momR6UJXXt o+Lz4kc6wnr4mpGy4cRk+CBUKN326Dq7m/TA8tLsoRDifYf2mh+u91pAd5XaET8WpE6G 7PlfPm4LbYjnxS0PGQ32I6eZ5mRoKEflDE9jO6I1mJ3VTxBqYRT6O8lUVtAGk5XdXbPN +pvDWVuxTgkmRj/XwqhfiKPFiwgxQtvGvn29XOxmf9at0e/+/KF60CGHPkZ7QGE3TTLK NKpo9Dialtw9q5rxiJEiiBgMRujjyjEfZ5m7mNGhbyDyzB6EelhLGLHzKb0OwfO1hZZQ DWHw== ARC-Authentication-Results: i=1; mx.google.com; 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 me11-20020a17090b17cb00b001ef89711b3fsi10008209pjb.109.2022.07.05.12.07.43; Tue, 05 Jul 2022 12:07:55 -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; 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 S231578AbiGES1e (ORCPT + 99 others); Tue, 5 Jul 2022 14:27:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229866AbiGES1c (ORCPT ); Tue, 5 Jul 2022 14:27:32 -0400 Received: from mail-yw1-f171.google.com (mail-yw1-f171.google.com [209.85.128.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80BE319C11; Tue, 5 Jul 2022 11:27:31 -0700 (PDT) Received: by mail-yw1-f171.google.com with SMTP id 00721157ae682-31c8a1e9e33so65425277b3.5; Tue, 05 Jul 2022 11:27:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=yDaZJQ1t7WZXHXc1sh5v+s4p6BMcgf4NLI5GY92Hi9Y=; b=YsLj+FjEE1wSWWBoTPNMdiuwSAUjEG2B/SFnSxUDY3eE2cXGua+WJo1hRfPvizR+Z+ hE7QY+UA5krJBwM4vffjArMX6jOsQI7uZ0iZZPFQKr3tvyfOk1156Rft/RnTM9NZynHW GPNmCILG0L0rdE5N0NWs8Om7Pr+UkByWS9tdbxgBwq0QBsu3oGSNs46JTPXnLBAv3If6 ozw4wR0fflfR1lADEh0++0d6le0Ayjmot/fzAIdpFdffTuIzrPPaGs8Pm2n+xaiiKOyU I+XvVwfOPrD0KibIzRYsRZL2dpJmZog6WuhQeWWdcHg12ZAmLRTLSNZ4OhnkixZLw6kk AyiA== X-Gm-Message-State: AJIora8YulmCp9WZuQp84ruYVqewIxoT6dbjpFkS8OsvLtuYS2aSPtQ9 UyQrhjXKkBaPHykD3n96KwQhg39Zw/4j9BfmQbE= X-Received: by 2002:a0d:d8c8:0:b0:31c:92b1:5dec with SMTP id a191-20020a0dd8c8000000b0031c92b15decmr14867269ywe.19.1657045650713; Tue, 05 Jul 2022 11:27:30 -0700 (PDT) MIME-Version: 1.0 References: <20220630094059.1204283-1-eric.auger@redhat.com> In-Reply-To: From: "Rafael J. Wysocki" Date: Tue, 5 Jul 2022 20:27:19 +0200 Message-ID: Subject: Re: [PATCH v2] ACPI: VIOT: Fix ACS setup To: Jean-Philippe Brucker , Eric Auger Cc: eric.auger.pro@gmail.com, Joerg Roedel , ACPI Devel Maling List , "open list:AMD IOMMU (AMD-VI)" , "Rafael J. Wysocki" , Len Brown , Linux Kernel Mailing List , iommu@lists.linux.dev, jinl@redhat.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no 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 Thu, Jun 30, 2022 at 11:59 AM Jean-Philippe Brucker wrote: > > On Thu, Jun 30, 2022 at 11:40:59AM +0200, Eric Auger wrote: > > Currently acpi_viot_init() gets called after the pci > > device has been scanned and pci_enable_acs() has been called. > > So pci_request_acs() fails to be taken into account leading > > to wrong single iommu group topologies when dealing with > > multi-function root ports for instance. > > > > We cannot simply move the acpi_viot_init() earlier, similarly > > as the IORT init because the VIOT parsing relies on the pci > > scan. However we can detect VIOT is present earlier and in > > such a case, request ACS. Introduce a new acpi_viot_early_init() > > routine that allows to call pci_request_acs() before the scan. > > > > While at it, guard the call to pci_request_acs() with #ifdef > > CONFIG_PCI. > > > > Fixes: 3cf485540e7b ("ACPI: Add driver for the VIOT table") > > Signed-off-by: Eric Auger > > Reported-by: Jin Liu > > Reviewed-by: Jean-Philippe Brucker > Tested-by: Jean-Philippe Brucker Applied as 5.20 material, thanks!