Received: by 2002:ab2:788f:0:b0:1ee:8f2e:70ae with SMTP id b15csp364861lqi; Wed, 6 Mar 2024 22:10:24 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXDpQK5kRZQ9B3d4GRQ4BQZw1Mycr185le/QqGUmibve2eiJ2ELRR/Sf/bWLlt5Cr/Gy0e7cyHoRCwbPOx7lfyX/llHvoH4VY/U2PLo7Q== X-Google-Smtp-Source: AGHT+IEFrjBiWXEp4yyfUXTWOshU5CH7PNrsMsyUY2Y7E1jkPjvsZ64QzHYZz66/Vb3QnKoLMVCE X-Received: by 2002:a17:902:6909:b0:1dc:fc84:198 with SMTP id j9-20020a170902690900b001dcfc840198mr655799plk.29.1709791823844; Wed, 06 Mar 2024 22:10:23 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709791823; cv=pass; d=google.com; s=arc-20160816; b=tYankl6IA2quZZmL8Cwc00nHkPqRlGCz8w5hVyHM1rHu1TFFRFYttOMEXZOIqOkb8E /vLS0TD5ra08R6mzkYK056C8q2VQYU6vD2EXHEudjiX5MkOlVa//ci8S69M6O8EF3+uZ V6B/+2diYuHPkB0uO418GfUFfqjokMRo4TyuG7/9xn138JcG+jcYsjnkQvEQgjIUKBTD NaWIAmIGL9r2m66aSwHQZhQ+eYXUtrFAY+UuU8FcAIRb3cy0Du1ipN5tqArGm0Qn7Jp7 YAehPHdDz7fH6Qf0e4uUY00MEeLoevFSZJ4fwXXWpNrTOjnZppsDu6L5Cl+VtAggh8uG Nkvg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=sv7gSBco2v12IJQwALfu15utlzl36RbGVfgzUbWvX6g=; fh=o22QXyCgXge+iBg2T4J7ou+YOkWP3+dCY/EWl32blfs=; b=L13t2DyLvuH9/EXgxgBAPDkQ3cUhQVxU7P4XNFlcYhIBEvMGcxWe32WQiyE40+0AyX TXQuhONtcAXS+aQVcN7qyLPfNyDGXqAMuqpgYr/u/MHJ9mLAaPq+m7zfWbwYh9GHauQX FnxEaFp1KQKfcCDrJMxy6wDeB/molPZMwRzjoVrH7j2QmfWTTP25ZalLWlA19XNBCALp mlNkHffp9oLpC8SDcV1y89sxn2koXFLYC/d16hBhS3gLh7kubRlBwgPc+DuPGKkzXYCf Gt/fvy6sBn+HP3gE36ESkBrUXyjgQQ/zYHcnWZLFRRZ6IuaEe8iZUNOcdLW9XUQ+TLfV ENdA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=kpsk6wZP; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-94981-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-94981-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id e6-20020a17090301c600b001dbde8f8b6bsi13432900plh.147.2024.03.06.22.10.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Mar 2024 22:10:23 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-94981-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=kpsk6wZP; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-94981-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-94981-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 216EDB217CA for ; Thu, 7 Mar 2024 05:06:33 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 790031B947; Thu, 7 Mar 2024 05:06:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="kpsk6wZP" Received: from mgamail.intel.com (mgamail.intel.com [192.198.163.15]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0A82A81F; Thu, 7 Mar 2024 05:06:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=192.198.163.15 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709787983; cv=none; b=XJbjwshVFK1WKqf8q7DyM85TVEH2Fix8SPirnM79WWx3haZoe6btgzI7mn3H6hFo50B5ssdmUVwKUCkYAYPzT7awoOT5JAIyMkoVzn6BKjepI/5w9CgPZ0FbIP3hmehyceoQm/u3QiVialXYZrVGWH93MjxkUcfFqaMt/pBQfP0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709787983; c=relaxed/simple; bh=nhirl8E79VD7l3fSml+GRqae5Bq4nYEARjir2Aay5rQ=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=CVGh2UjL/DOR7OhV+pDjGXIYBsuT0q3o+9SEg2IAiq2Pq5ZC9peQtFoRDNgu4fbZQKnsKeG0IEdZ+xCXo+Uup6LpGxvl6HPegFJJiXihLNMw1uAFm7UmkxteF+FidCSqNl/X4OZg5xcIml4QO7HvExTpQX9d7Cw7E1O6fy4niLo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=kpsk6wZP; arc=none smtp.client-ip=192.198.163.15 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1709787982; x=1741323982; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=nhirl8E79VD7l3fSml+GRqae5Bq4nYEARjir2Aay5rQ=; b=kpsk6wZP2ZgFhPZstlrfAoVmWd4L99uTtuuHEC79rT3dY0lP422uXsUq vwxkHef5fIS2x7uUxZXGrGWmpmMYnQnRjLUk9iGj1Tg+pXQXGiP6p1ohR 212QB7GsUb09OZ4PJhacntnH65eP81J+SSo9CcmN4teKp8PGhjkKQwSka 0LGjN2oYpxMGQLklhuIj/lC4GEuNmI9uBVzE3eef2+9Py2VxoaTeTq8JK /eidO3LbmZNT4qfRtghaVBuBsCNEA9SybcazWFp5xphwbS0kyh5ZaBlPO fbZVFK9slKDjts0qdbLWzTaCZsas1e620nYJk6XiG1bLDHZle63mchO54 Q==; X-IronPort-AV: E=McAfee;i="6600,9927,11005"; a="4609016" X-IronPort-AV: E=Sophos;i="6.06,209,1705392000"; d="scan'208";a="4609016" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by fmvoesa109.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Mar 2024 21:06:21 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.06,209,1705392000"; d="scan'208";a="14547133" Received: from dpwomacx-mobl1.amr.corp.intel.com (HELO [10.209.25.153]) ([10.209.25.153]) by fmviesa003-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Mar 2024 21:06:21 -0800 Message-ID: <32ac2ee6-26b1-4f37-bd88-db1ef2a31267@linux.intel.com> Date: Wed, 6 Mar 2024 21:06:20 -0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH kernel v3] PCI/DOE: Support discovery version 2 Content-Language: en-US To: Alexey Kardashevskiy , linux-pci@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Bjorn Helgaas , Ira Weiny , Dan Williams , Jonathan Cameron , Lukas Wunner References: <20240307022006.3657433-1-aik@amd.com> From: Kuppuswamy Sathyanarayanan In-Reply-To: <20240307022006.3657433-1-aik@amd.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 3/6/24 6:20 PM, Alexey Kardashevskiy wrote: > PCIe r6.1, sec 6.30.1.1 defines a "DOE Discovery Version" field in > the DOE Discovery Request Data Object Contents (3rd DW) as: > > 15:8 DOE Discovery Version – must be 02h if the Capability Version in > the Data Object Exchange Extended Capability is 02h or greater. Does this change fix any functional issue? If yes, please add Fixes: tag and probably CC stable? > > Add support for the version on devices with the DOE v2 capability. > > Signed-off-by: Alexey Kardashevskiy > --- Change wise looks fine to me. Reviewed-by: Kuppuswamy Sathyanarayanan > Changes: > v3: > * updated subject line > * dropped "DISCOVER_" from the new field macro > > v2: > * added the section number to the commit log > --- > include/uapi/linux/pci_regs.h | 1 + > drivers/pci/doe.c | 11 ++++++++--- > 2 files changed, 9 insertions(+), 3 deletions(-) > > diff --git a/include/uapi/linux/pci_regs.h b/include/uapi/linux/pci_regs.h > index a39193213ff2..fbca743b2b86 100644 > --- a/include/uapi/linux/pci_regs.h > +++ b/include/uapi/linux/pci_regs.h > @@ -1144,6 +1144,7 @@ > #define PCI_DOE_DATA_OBJECT_HEADER_2_LENGTH 0x0003ffff > > #define PCI_DOE_DATA_OBJECT_DISC_REQ_3_INDEX 0x000000ff > +#define PCI_DOE_DATA_OBJECT_DISC_REQ_3_VER 0x0000ff00 > #define PCI_DOE_DATA_OBJECT_DISC_RSP_3_VID 0x0000ffff > #define PCI_DOE_DATA_OBJECT_DISC_RSP_3_PROTOCOL 0x00ff0000 > #define PCI_DOE_DATA_OBJECT_DISC_RSP_3_NEXT_INDEX 0xff000000 > diff --git a/drivers/pci/doe.c b/drivers/pci/doe.c > index 61f0531d2b1d..c94c2b0767f3 100644 > --- a/drivers/pci/doe.c > +++ b/drivers/pci/doe.c > @@ -381,11 +381,13 @@ static void pci_doe_task_complete(struct pci_doe_task *task) > complete(task->private); > } > > -static int pci_doe_discovery(struct pci_doe_mb *doe_mb, u8 *index, u16 *vid, > +static int pci_doe_discovery(struct pci_doe_mb *doe_mb, u8 capver, u8 *index, u16 *vid, > u8 *protocol) > { > u32 request_pl = FIELD_PREP(PCI_DOE_DATA_OBJECT_DISC_REQ_3_INDEX, > - *index); > + *index) | > + FIELD_PREP(PCI_DOE_DATA_OBJECT_DISC_REQ_3_VER, > + (capver >= 2) ? 2 : 0); > __le32 request_pl_le = cpu_to_le32(request_pl); > __le32 response_pl_le; > u32 response_pl; > @@ -419,13 +421,16 @@ static int pci_doe_cache_protocols(struct pci_doe_mb *doe_mb) > { > u8 index = 0; > u8 xa_idx = 0; > + u32 hdr = 0; > + > + pci_read_config_dword(doe_mb->pdev, doe_mb->cap_offset, &hdr); > > do { > int rc; > u16 vid; > u8 prot; > > - rc = pci_doe_discovery(doe_mb, &index, &vid, &prot); > + rc = pci_doe_discovery(doe_mb, PCI_EXT_CAP_VER(hdr), &index, &vid, &prot); > if (rc) > return rc; > -- Sathyanarayanan Kuppuswamy Linux Kernel Developer