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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7D417CD37B0 for ; Mon, 18 Sep 2023 20:52:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229881AbjIRUwH (ORCPT ); Mon, 18 Sep 2023 16:52:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229476AbjIRUwF (ORCPT ); Mon, 18 Sep 2023 16:52:05 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D36C111 for ; Mon, 18 Sep 2023 13:51:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695070271; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=THXh1C50UHURW8uY22mgz6II3159Rek3+k7Hf/FFQlY=; b=EmPOe33k40eFEaBgl+/2h2azwSVPnkuSYRmZuPMSqnyf2L6inyiUY5hb6OwVdFzQhCjCMH YgKirN8x1CDbLlC0AZfTPxxGfwJbW48CRoXIfVSXGh+XQ5eWx9CdCWAqw3X/gzWHTZfNVf Y3hHBb4ax64Ufl1rGt2inOOqRHwVGlA= Received: from mail-io1-f71.google.com (mail-io1-f71.google.com [209.85.166.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-75-JS4oNZLEOVC6NBZbi4v3-A-1; Mon, 18 Sep 2023 16:51:09 -0400 X-MC-Unique: JS4oNZLEOVC6NBZbi4v3-A-1 Received: by mail-io1-f71.google.com with SMTP id ca18e2360f4ac-79554d73bd6so459768639f.1 for ; Mon, 18 Sep 2023 13:51:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695070269; x=1695675069; h=content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=THXh1C50UHURW8uY22mgz6II3159Rek3+k7Hf/FFQlY=; b=vXN9A24Z3CkQS3YPXoXCJupaiwRxSKHuXYw69m2wa5zkQ6B/2ZEYghgSUoWAV1llBN UVNUsRqo/i7bGzWafCZbNFyS6ZSDhvY94FmC3DbhbB+jk+VsrN55ET9oXS5CI1pPDBSV ZR20gOGpg1K+yD4Zc8XVfynjt6yAvb+EKMr1O5575zQlfZIrO7N44f2JZGlmTzUgA/sz ggiXJJlq/Nb/Tw50vJOeeiakzbv0duHY+rkNNXapZMjH9GotSnwOY7W3xrHa63fttBRW +NL7QAHLCZ6UzDccCJzIsLzexIWexwxycqyS1JQphF4iuk0HE1bGeWbnQJ0Cpl6J/8zp hKfg== X-Gm-Message-State: AOJu0YzeGjxtrtR2BzhIgtSZQwlfEdqoqSgwt+G6UnQBr9sWdonpCZOb nvr4+zZ6cdo8NItkkXEddM7+iAULLwfhHzDqYAm+JSNDwrZJFT+jnAMxYX+Y6kgtnIceBwRLwTD fSbEp4nTsb1Bfs0C+C8K3H8NJ X-Received: by 2002:a5d:9557:0:b0:790:aedd:3e81 with SMTP id a23-20020a5d9557000000b00790aedd3e81mr11696527ios.8.1695070269174; Mon, 18 Sep 2023 13:51:09 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF9cmrUg9h2SneqkurK+T9MN62PPsrrL+PihFiMIDKne7N6HO9p7OIDQ1ghPfwUwqfSS/Bj8g== X-Received: by 2002:a5d:9557:0:b0:790:aedd:3e81 with SMTP id a23-20020a5d9557000000b00790aedd3e81mr11696518ios.8.1695070268957; Mon, 18 Sep 2023 13:51:08 -0700 (PDT) Received: from redhat.com ([38.15.60.12]) by smtp.gmail.com with ESMTPSA id c22-20020a5ea816000000b00786fe5039b8sm3010849ioa.46.2023.09.18.13.51.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Sep 2023 13:51:08 -0700 (PDT) Date: Mon, 18 Sep 2023 14:51:06 -0600 From: Alex Williamson To: oushixiong Cc: Jason Gunthorpe , Yishai Hadas , Shameer Kolothum , Kevin Tian , Brett Creeley , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] vfio/pds: Use proper PF device access helper Message-ID: <20230918145106.6d3c77fb.alex.williamson@redhat.com> In-Reply-To: <20230914021332.1929155-1-oushixiong@kylinos.cn> References: <20230914021332.1929155-1-oushixiong@kylinos.cn> Organization: Red Hat MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 14 Sep 2023 10:13:32 +0800 oushixiong wrote: > From: Shixiong Ou > > The pci_physfn() helper exists to support cases where the physfn > field may not be compiled into the pci_dev structure. We've > declared this driver dependent on PCI_IOV to avoid this problem, > but regardless we should follow the precedent not to access this > field directly. > > Signed-off-by: Shixiong Ou > --- > > This patch changes the subject line and commit log, and the previous > patch's links is: > https://patchwork.kernel.org/project/kvm/patch/20230911080828.635184-1-oushixiong@kylinos.cn/ > > drivers/vfio/pci/pds/vfio_dev.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) Applied to vfio for-linus branch for v6.6. Thanks, Alex > > diff --git a/drivers/vfio/pci/pds/vfio_dev.c b/drivers/vfio/pci/pds/vfio_dev.c > index b46174f5eb09..649b18ee394b 100644 > --- a/drivers/vfio/pci/pds/vfio_dev.c > +++ b/drivers/vfio/pci/pds/vfio_dev.c > @@ -162,7 +162,7 @@ static int pds_vfio_init_device(struct vfio_device *vdev) > pci_id = PCI_DEVID(pdev->bus->number, pdev->devfn); > dev_dbg(&pdev->dev, > "%s: PF %#04x VF %#04x vf_id %d domain %d pds_vfio %p\n", > - __func__, pci_dev_id(pdev->physfn), pci_id, vf_id, > + __func__, pci_dev_id(pci_physfn(pdev)), pci_id, vf_id, > pci_domain_nr(pdev->bus), pds_vfio); > > return 0;