From: "Derrick, Jonathan" <jonathan.derrick@intel.com>
To: "lorenzo.pieralisi@arm.com" <lorenzo.pieralisi@arm.com>
Cc: "kbusch@kernel.org" <kbusch@kernel.org>,
"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>,
"helgaas@kernel.org" <helgaas@kernel.org>
Subject: Re: [PATCH v2 1/2] PCI: vmd: Add bus 224-255 restriction decode
Date: Wed, 20 Nov 2019 17:00:03 +0000 [thread overview]
Message-ID: <5f8820ad2c545d21c21e5e95429227ba2a35fef5.camel@intel.com> (raw)
In-Reply-To: <20191120164710.GB3279@e121166-lin.cambridge.arm.com>
On Wed, 2019-11-20 at 16:47 +0000, Lorenzo Pieralisi wrote:
> On Tue, Nov 12, 2019 at 05:47:52AM -0700, Jon Derrick wrote:
> > VMD bus restrictions are required when IO fabric is multiplexed such
> > that VMD cannot use the entire bus range. This patch adds another bus
> > restriction decode bit that can be set by firmware to restrict the VMD
> > bus range to between 224-255.
> >
> > Signed-off-by: Jon Derrick <jonathan.derrick@intel.com>
> > ---
> > drivers/pci/controller/vmd.c | 30 ++++++++++++++++++++++--------
> > 1 file changed, 22 insertions(+), 8 deletions(-)
> >
> > diff --git a/drivers/pci/controller/vmd.c b/drivers/pci/controller/vmd.c
> > index a35d3f3..15302a1 100644
> > --- a/drivers/pci/controller/vmd.c
> > +++ b/drivers/pci/controller/vmd.c
> > @@ -602,16 +602,30 @@ static int vmd_enable_domain(struct vmd_dev *vmd, unsigned long features)
> >
> > /*
> > * Certain VMD devices may have a root port configuration option which
> > - * limits the bus range to between 0-127 or 128-255
> > + * limits the bus range to between 0-127, 128-255, or 224-255
> > */
> > if (features & VMD_FEAT_HAS_BUS_RESTRICTIONS) {
> > - u32 vmcap, vmconfig;
> > -
> > - pci_read_config_dword(vmd->dev, PCI_REG_VMCAP, &vmcap);
> > - pci_read_config_dword(vmd->dev, PCI_REG_VMCONFIG, &vmconfig);
> > - if (BUS_RESTRICT_CAP(vmcap) &&
> > - (BUS_RESTRICT_CFG(vmconfig) == 0x1))
> > - vmd->busn_start = 128;
> > + u16 reg16;
> > +
> > + pci_read_config_word(vmd->dev, PCI_REG_VMCAP, ®16);
> > + if (BUS_RESTRICT_CAP(reg16)) {
> > + pci_read_config_word(vmd->dev, PCI_REG_VMCONFIG,
> > + ®16);
> > +
> > + switch (BUS_RESTRICT_CFG(reg16)) {
> > + case 1:
> > + vmd->busn_start = 128;
> > + break;
> > + case 2:
> > + vmd->busn_start = 224;
> > + break;
> > + case 3:
> > + pci_err(vmd->dev, "Unknown Bus Offset Setting\n");
>
> Technically this error+message should be present in the current kernel
> as well but anyway, I have applied the series to pci/vmd.
Agreed. It was an ambiguous definition in a previous spec.
>
> Thanks,
> Lorenzo
Thank you
>
> > + return -ENODEV;
> > + default:
> > + break;
> > + }
> > + }
> > }
> >
> > res = &vmd->dev->resource[VMD_CFGBAR];
> > --
> > 1.8.3.1
> >
next prev parent reply other threads:[~2019-11-20 17:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-12 12:47 [PATCH v2 0/2] VMD support for 8086:9A0B Jon Derrick
2019-11-12 12:47 ` [PATCH v2 1/2] PCI: vmd: Add bus 224-255 restriction decode Jon Derrick
2019-11-20 16:47 ` Lorenzo Pieralisi
2019-11-20 17:00 ` Derrick, Jonathan [this message]
2019-11-12 12:47 ` [PATCH v2 2/2] PCI: vmd: Add device id for VMD device 8086:9A0B Jon Derrick
2019-11-20 16:16 ` [PATCH v2 0/2] VMD support for 8086:9A0B Derrick, Jonathan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5f8820ad2c545d21c21e5e95429227ba2a35fef5.camel@intel.com \
--to=jonathan.derrick@intel.com \
--cc=helgaas@kernel.org \
--cc=kbusch@kernel.org \
--cc=linux-pci@vger.kernel.org \
--cc=lorenzo.pieralisi@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).