Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp2163443rbb; Tue, 27 Feb 2024 12:41:46 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWxvQU59wWuVlWH/X/iurux0udcpZhuettRN6jh8qjk5w0wOG5PHJGFil8KMZq4UAiqLpsu1Y9IWEOk6DJyDclkzV0PBEE1uhWxi+CSQw== X-Google-Smtp-Source: AGHT+IHcjs6FWLhnwA4U35girmfoOIgcUsbEgZunWhUtwX+QWRSHREGAjfWiA6OUfag0PlUQlayL X-Received: by 2002:a05:6a20:d90f:b0:19c:6a60:b433 with SMTP id jd15-20020a056a20d90f00b0019c6a60b433mr3962540pzb.3.1709066505869; Tue, 27 Feb 2024 12:41:45 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1709066505; cv=pass; d=google.com; s=arc-20160816; b=Z9G2QR9/ufoDuZzJMiEtALPzm47/5hwUOdckGfjt+Hqh666ZeFtavEd8PomWvP8SnW d+AHSZ/EB10KbwAN6amux1VmxagxKrSdf8frc8IYlIpkjlEeePCv8lqrlzyxFuU9W+Sz XhTqV5JUEv46BnNho31KcatLJx1nF9N+ADZP4/0zunSrqRcIC2C6dRjSAkLYMkyTNM8P RZyQfd/XyppdjCkSLcw2kAD9hwTCC4bsX045/ogPcgstvbshPrg/Bb0Gwqy8Zwm+MvLZ K4z5tYXddwbCU7xJIGrs5tFIbf8Jru60fNuWH3Ydt9O5o1S4Aj7iuXvYdA4Oz9VJmrOG plsg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=user-agent:in-reply-to:content-disposition:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:references :message-id:subject:cc:to:from:date; bh=lnDv1O6WTkhuftG0De7yzLQsWiRzBGGLdDEgZH+v2xw=; fh=d6XhAzkkotYACpF8czipeQPTt3SxsHdxv69MIp0kwPo=; b=ZJQ3WOsDnd842P3eVEA8kn880Sc3ZUA2s2jhXmzh2wQbPsgmbp/4riKjUWFd5AFceq Hdy9/35Gfr+Ps7YX54tBmTSHbBpl5B3M3a3H1cUmNNdV889qJGH6/bcyNDaeakup7Aj2 BJuVcmRuPSd6DWpuTdk/kcuEr0adVSLuJkEM4rKL6YAGY8NYWM38fg8NTJi/xdGChgTL eQy8HwCIQNbWnGaIh7sOTpaNRCq526Qu4EFn5zmwl5ne4GrY1Uxd/XzLUSg5mGPlmlw2 ARWzaRswbI06p6tSFwU6zWn5/6Hn8k9Mn59vYDl9CvHASyl8M4sKhby5ST3W72Irvz0d 1mRA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-83985-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83985-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id x20-20020a631714000000b005dc956c2c09si6135797pgl.147.2024.02.27.12.41.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Feb 2024 12:41:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-83985-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-83985-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-83985-linux.lists.archive=gmail.com@vger.kernel.org" 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 90C5D28AA7F for ; Tue, 27 Feb 2024 20:41:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 362A614EFEF; Tue, 27 Feb 2024 20:41:27 +0000 (UTC) Received: from bmailout2.hostsharing.net (bmailout2.hostsharing.net [83.223.78.240]) (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 A7D9414DFFD; Tue, 27 Feb 2024 20:41:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=83.223.78.240 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709066486; cv=none; b=fYxvDy7vDDjuaewkQHBhNMivF/2ZhJ9Mp0pLQET3mgYn/FuAmCQ1bz1GUkeKMtAn1QqEtG7sDKYQFAGMle1SXqoqOAsrTpnaSR+5Pt5NnEvETRJQqhozUcS3jAVyW+bdGxRdR9Oh1X9r9Awo2/a2LPrvlUMePi00nwpS7I+yHSI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1709066486; c=relaxed/simple; bh=jAqu3eZCLfAw08fyoxhcQMIAzo4phS5xxsvpvRyTAAw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=D/VQL5cC14TzM1eF/fBub6HLA7Z+Q11XBpv18CQz6xagEnmcRgNGKLmGBDbjS4MHH81Kbnnd8fMXeoK+7ODnEXFgVA33KirEFek+ooT00Fv6J5XFublZzkXc7DsWa2afwHMWReU+1psf5Fv81l+TxL4TkMQctgdYMmp6X4g/Ndc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=wunner.de; spf=none smtp.mailfrom=h08.hostsharing.net; arc=none smtp.client-ip=83.223.78.240 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=wunner.de Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=h08.hostsharing.net Received: from h08.hostsharing.net (h08.hostsharing.net [83.223.95.28]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "*.hostsharing.net", Issuer "RapidSSL TLS RSA CA G1" (verified OK)) by bmailout2.hostsharing.net (Postfix) with ESMTPS id 3DBAE2800B49D; Tue, 27 Feb 2024 21:41:16 +0100 (CET) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 307815D825B; Tue, 27 Feb 2024 21:41:16 +0100 (CET) Date: Tue, 27 Feb 2024 21:41:16 +0100 From: Lukas Wunner To: Alexey Kardashevskiy Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Bjorn Helgaas , Dan Williams , Jonathan Cameron , Ira Weiny Subject: Re: [PATCH kernel v2] pci/doe: Support discovery version Message-ID: <20240227204116.GA30259@wunner.de> References: <20240226033114.3100118-1-aik@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240226033114.3100118-1-aik@amd.com> User-Agent: Mutt/1.10.1 (2018-07-13) On Mon, Feb 26, 2024 at 02:31:14PM +1100, Alexey Kardashevskiy wrote: > Does PCI_DOE_DATA_OBJECT_DISC_REQ_3_DISCOVER_VER need to be in pci-regs.h? Yes that's fine. > --- 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_DISCOVER_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 "DISCOVER" duplicates the preceding "DISC", maybe just "PCI_DOE_DATA_OBJECT_DISC_REQ_3_VERSION" for simplicity? > -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 disver = FIELD_PREP(PCI_DOE_DATA_OBJECT_DISC_REQ_3_DISCOVER_VER, > + (capver >= 2) ? 2 : 0); > u32 request_pl = FIELD_PREP(PCI_DOE_DATA_OBJECT_DISC_REQ_3_INDEX, > - *index); > + *index) | disver; Hm, why use a separate "disver" variable? This could be combined into a single statement. Subject should probably be "PCI/DOE: Support discovery version 2". Otherwise LGTM. Thanks, Lukas