kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Gordeev <agordeev@redhat.com>
To: Andrew Jones <drjones@redhat.com>
Cc: kvm@vger.kernel.org, Thomas Huth <thuth@redhat.com>,
	Peter Xu <peterx@redhat.com>
Subject: Re: [kvm-unit-tests PATCH v10 10/12] pci: Add generic ECAM host support
Date: Mon, 7 Nov 2016 09:03:07 +0100	[thread overview]
Message-ID: <20161107080307.GF10472@agordeev.lab.eng.brq.redhat.com> (raw)
In-Reply-To: <20161105172006.GA27776@dhcp-27-118.brq.redhat.com>

On Sat, Nov 05, 2016 at 06:20:06PM +0100, Alexander Gordeev wrote:
> +bool pci_probe(void)
> +{
> +	pcidevaddr_t dev;
> +	u8 header;
> +	u32 cmd;
> +	int i;
> +
> +	assert(!pci_host_bridge);
> +	pci_host_bridge = pci_dt_probe();
> +	if (!pci_host_bridge)
> +		return false;
> +
> +	for (dev = 0; dev < 256; dev++) {
> +		if (!pci_dev_exists(dev))
> +			continue;
> +
> +		/* We are only interested in normal PCI devices */
> +		header = pci_config_readb(dev, PCI_HEADER_TYPE);
> +		if ((header & PCI_HEADER_TYPE_MASK) != PCI_HEADER_TYPE_NORMAL)
> +			continue;
> +
> +		cmd = PCI_COMMAND_SERR;

Sigh. Please, ignore this patch.
I forgot to add PCI_COMMAND_PARITY here, as intended.

> +		for (i = 0; i < 6; i++) {
> +			u64 addr;
> +
> +			if (pci_alloc_resource(dev, i, &addr)) {
> +				pci_bar_set_addr(dev, i, addr);
> +
> +				if (pci_bar_is_memory(dev, i))
> +					cmd |= PCI_COMMAND_MEMORY;
> +				else
> +					cmd |= PCI_COMMAND_IO;
> +			}
> +
> +			if (pci_bar_is64(dev, i))
> +				i++;
> +		}
> +
> +		pci_config_writel(dev, PCI_COMMAND, cmd);
> +	}
> +
> +	return true;
> +}

  reply	other threads:[~2016-11-07  7:55 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-03 16:19 [kvm-unit-tests PATCH v9 00/12] PCI bus support Alexander Gordeev
2016-11-03 16:19 ` [kvm-unit-tests PATCH v9 01/12] pci: Fix coding style in generic PCI files Alexander Gordeev
2016-11-03 16:19 ` [kvm-unit-tests PATCH v9 02/12] pci: x86: Rename pci_config_read() to pci_config_readl() Alexander Gordeev
2016-11-03 16:19 ` [kvm-unit-tests PATCH v9 03/12] pci: Add 'extern' to public function declarations Alexander Gordeev
2016-11-03 20:30   ` Christoph Hellwig
2016-11-04  7:36     ` Thomas Huth
2016-11-04  8:18       ` Andrew Jones
2016-11-03 16:19 ` [kvm-unit-tests PATCH v9 04/12] pci: x86: Add remaining PCI configuration space accessors Alexander Gordeev
2016-11-03 16:19 ` [kvm-unit-tests PATCH v9 05/12] pci: Factor out pci_bar_get() Alexander Gordeev
2016-11-03 16:19 ` [kvm-unit-tests PATCH v9 06/12] pci: Rework pci_bar_addr() Alexander Gordeev
2016-11-03 16:19 ` [kvm-unit-tests PATCH v9 07/12] pci: Add pci_bar_set_addr() Alexander Gordeev
2016-11-03 16:19 ` [kvm-unit-tests PATCH v9 08/12] pci: Add pci_dev_exists() Alexander Gordeev
2016-11-03 16:19 ` [kvm-unit-tests PATCH v9 09/12] pci: Add pci_print() Alexander Gordeev
2016-11-04 14:25   ` Andrew Jones
2016-11-03 16:19 ` [kvm-unit-tests PATCH v9 10/12] pci: Add generic ECAM host support Alexander Gordeev
2016-11-04 14:33   ` Andrew Jones
2016-11-04 17:07     ` Andrew Jones
2016-11-05 17:25       ` Alexander Gordeev
2016-11-07  8:44         ` Andrew Jones
2016-11-07 15:43           ` Peter Xu
2016-11-05  9:56     ` Alexander Gordeev
2016-11-05 17:20       ` [kvm-unit-tests PATCH v10 " Alexander Gordeev
2016-11-07  8:03         ` Alexander Gordeev [this message]
2016-11-07  7:56           ` Alexander Gordeev
2016-11-07  8:52             ` Andrew Jones
2016-11-07  9:32               ` Andrew Jones
2016-11-03 16:19 ` [kvm-unit-tests PATCH v9 11/12] pci: Add pci-testdev PCI bus test device Alexander Gordeev
2016-11-03 16:19 ` [kvm-unit-tests PATCH v9 12/12] arm/arm64: pci: Add pci-testdev PCI device operation test Alexander Gordeev
2016-11-04 15:44 ` [kvm-unit-tests PATCH v9 00/12] PCI bus support Andrew Jones
2016-11-05 17:30   ` Alexander Gordeev

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=20161107080307.GF10472@agordeev.lab.eng.brq.redhat.com \
    --to=agordeev@redhat.com \
    --cc=drjones@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=peterx@redhat.com \
    --cc=thuth@redhat.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).