PCI Bus Card Problems

Dominik Brodowski linux at dominikbrodowski.net
Thu Sep 1 05:15:42 EDT 2005


Hi,

On Thu, Sep 01, 2005 at 10:02:25AM +0100, Russell King wrote:
> Since ARM uses the generic PCI subsystem setup code, I was able to
> just #if 0...#endif out all the x86 specific code in yenta and have
> it work... IOW something like this:

yenta_allocate_res() contains a check whether the device was already set up:

	/* Already allocated? */
	if (res->parent)
		return 0;

On x86, this is the case since 2.6.13, as x86 switched to the generic PCI 
subsystem setup code, IIRC. Do you know why this doesn't handle the ARM case
correctly?

> +#if 0
>  	yenta_free_resources(sock);
> -
> +#endif

Also, even if the resources are "freed", 2.6.13 tries to re-use exactly the
same resources; only if it fails, it re-assigns:

	region.start = config_readl(socket, addr_start) & mask;
	region.end = config_readl(socket, addr_end) | ~mask;
	if (region.start && region.end > region.start && !override_bios) {
		pcibios_bus_to_resource(socket->dev, res, &region);
		root = pci_find_parent_resource(socket->dev, res);
		if (root && (request_resource(root, res) == 0))
			return 0;
		printk(KERN_INFO "yenta %s: Preassigned resource %d busy or not available, reconfiguring...\n",
				pci_name(socket->dev), nr);
	}

Note the pcibios_bus_to_resource(), which indeed was missing before...

> +#if 0
>  	config_writel(socket, PCI_BASE_ADDRESS_0, dev->resource[0].start);

Might this just miss a pcibus_resource_to_bus() conversion of dev->resource[0].start?

>  	config_writew(socket, PCI_COMMAND,
>  			PCI_COMMAND_IO |
> @@ -955,6 +959,7 @@
>  		(dev->subordinate->subordinate << 16) | /* subordinate bus */
>  		(dev->subordinate->secondary << 8) |  /* secondary bus */
>  		dev->subordinate->primary);		   /* primary bus */
> +#endif

Why the rest of it?

> +	pci_set_master(dev);

Is this ARM-specific? Should this go in unconditionally?


Also, to me it seems that the original poster had mostly a problem with the
IRQ not being allocated properly -- or is this a symptom rather than the
cause?

Thanks,
	Dominik



More information about the linux-pcmcia mailing list