mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Chris Metcalf <cmetcalf@tilera.com>
Cc: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org,
	Bjorn Helgaas <bhelgaas@google.com>,
	Jesse Barnes <jbarnes@virtuousgeek.org>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	Myron Stowe <myron.stowe@redhat.com>,
	Jiri Kosina <jkosina@suse.cz>, Joe Perches <joe@perches.com>,
	David Howells <dhowells@redhat.com>
Subject: Re: [PATCH 3/3] arch/tile: tilegx PCI root complex support
Date: Mon, 9 Apr 2012 13:59:12 +0000	[thread overview]
Message-ID: <201204091359.13059.arnd@arndb.de> (raw)
In-Reply-To: <201204072319.q37NJlNp019384@farm-0023.internal.tilera.com>

On Saturday 07 April 2012, Chris Metcalf wrote:
> This change implements PCIe root complex support for tilegx using
> the kernel support layer for accessing the TRIO hardware shim.
> 
> Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>

Hi Chris,

I don't know if we discussed it during the initial merge, but I notice that the PIO
accessors (inb/outb and friends) are still not implemented in this patch. Normally
PIO can just be mapped into the MMIO address space, so that inb() becomes
a call to readb() with an offset on the address.

> +/*
> + * Second PCI initialization entry point, called by subsys_initcall.
> + *
> + * The controllers have been set up by the time we get here, by a call to
> + * tile_pci_init.
> + */
> +int __devinit pcibios_init(void)
> +{
> +	resource_size_t offset;
> +	int i;
> +
> +        if (num_rc_controllers == 0 && num_ep_controllers == 0)
> +		return 0;
> +
> +	pr_info("PCI: Probing PCI hardware\n");
> +
> +	/*
> +	 * We loop over all the TRIO shims and set up the MMIO mappings.
> +	 * This step can't be done in tile_pci_init because the MM subsystem
> +	 * hasn't been initialized then.
> +	 */
> +	for (i = 0; i < TILEGX_NUM_TRIO; i++) {
> +		gxio_trio_context_t *context = &trio_contexts[i];
> +
> +		if (context->fd < 0)
> +			continue;
> +
> +		/*
> +		 * Map in the MMIO space for the MAC.
> +                 */
> +		offset = 0;
> +		context->mmio_base_mac =
> +			iorpc_ioremap(context->fd, offset,
> +				      HV_TRIO_CONFIG_IOREMAP_SIZE);
> +		if (context->mmio_base_mac == NULL) {
> +			pr_err("PCI: MAC map failure on TRIO %d\n", i);
> +
> +			hv_dev_close(context->fd);
> +			context->fd = -1;
> +			continue;
> +		}
> +	}
> +
> +	/*
> +	 * Delay a bit in case devices aren't ready.  Some devices are
> +	 * known to require at least 20ms here, but we use a more
> +	 * conservative value.
> +	 */
> +	mdelay(250);

Using mdelay is generally considered very rude. Since you are not in atomic
context here, just use msleep() instead.

	Arnd

  reply	other threads:[~2012-04-09 13:59 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-07 20:53 [PATCH 0/3] arch/tile: provide PCIe support for tilegx Chris Metcalf
2012-04-07 19:58 ` [PATCH 2/3] arch/tile: mark TILEGX as not EXPERIMENTAL Chris Metcalf
2012-04-07 20:53 ` [PATCH 1/3] arch/tile: provide kernel support for the tilegx TRIO shim Chris Metcalf
2012-04-07 23:39   ` Jesper Juhl
2012-04-08  0:21     ` Chris Metcalf
2012-04-07 21:10 ` [PATCH 3/3] arch/tile: tilegx PCI root complex support Chris Metcalf
2012-04-09 13:59   ` Arnd Bergmann [this message]
2012-04-09 21:38     ` Chris Metcalf
2012-04-10  9:14       ` Arnd Bergmann
2012-05-08 20:53         ` [PATCH v2 0/2] arch/tile: " Chris Metcalf
2012-05-08 20:53           ` [PATCH v2 1/2] arch/tile: provide kernel support for the tilegx TRIO shim Chris Metcalf
2012-05-08 21:10           ` [PATCH v2 2/2] arch/tile: tilegx PCI root complex support Chris Metcalf
2012-05-09 16:58             ` Michael S. Tsirkin
2012-04-10  0:01   ` [PATCH 3/3] " Bjorn Helgaas
2012-04-10  9:15     ` Arnd Bergmann
2012-04-15 23:09     ` Chris Metcalf
2012-06-19 19:50   ` Geert Uytterhoeven
2012-06-19 20:07     ` Yinghai Lu
2012-06-19 20:40       ` Chris Metcalf

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=201204091359.13059.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=bhelgaas@google.com \
    --cc=cmetcalf@tilera.com \
    --cc=dhowells@redhat.com \
    --cc=jbarnes@virtuousgeek.org \
    --cc=jkosina@suse.cz \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=mst@redhat.com \
    --cc=myron.stowe@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

Powered by JetHome