public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Manu Abraham <abraham.manu@gmail.com>
To: Roland Dreier <rdreier@cisco.com>
Cc: Greg KH <greg@kroah.com>,
	linux-pci@atrey.karlin.mff.cuni.cz,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: PCIE
Date: Thu, 24 May 2007 02:11:28 +0400	[thread overview]
Message-ID: <4654BC10.2000808@gmail.com> (raw)
In-Reply-To: <adaejl79rh0.fsf@cisco.com>

Roland Dreier wrote:
>>> Uncompressing Linux .. Ok, booting the kernel.
>>> BIOS bug, no explicit IRQ entries, using default mptable. (tell your hw vendor)
>>> PCI: Failed to allocate mem resource #6:20000@30000000 for 0000:01:00.0
> 
> This message is about device 01:00.0 as it says (your nvidia video
> card based on later lspci output).
> 
>  > The device is a new DTV bridge from NXP (SAA7162E) with a PCIe interface.
>  > 
>  > 06:00.0 Multimedia controller: Philips Semiconductors Unknown device
>  > 7162 (rev 01)
>  >         Subsystem: Twinhan Technology Co. Ltd Unknown device 0027
> 
> This is device 06:00.0, so it's not related to that earlier message at
> all.  You didn't say what problem you're having with your driver for
> this device... 


If i uncomment the saa716x_read or write, what i get is a solid freeze
on module load. If i leave it commented out, the module loads fine.

static irqreturn_t saa716x_pcie_irq(int irq, void *dev_id)
{
	struct saa716x *saa716x;
	u32 stat, mask;

	if (unlikely((saa716x = (struct saa716x *) dev_id) == NULL)) {
		printk(KERN_ERR "%s: Aeie NULL ptr\n", __func__);
		return IRQ_NONE;
	}
//	stat = saa716x_read(0x500);
	dprintk(verbose, SAA716x_DEBUG, 0, "=== Interrupts[%04x] [", stat);

	dprintk(verbose, SAA716x_DEBUG, 0, "] ==\n");

	return IRQ_HANDLED;
}

int saa716x_pcie_init(struct saa716x *saa716x)
{
	struct pci_dev *pdev = saa716x->pdev;
	int err = 0;
	u8 latency, revision;

	printk(KERN_INFO "%s: found a %s device\n", __func__,
saa716x->hwconfig->model_name);
	pci_set_drvdata(pdev, saa716x);

	if ((err = pci_enable_device(pdev)) != 0) {
		printk(KERN_ERR "%s ERROR: pci enable failed (%i)\n", __func__, err);
		goto fail0;
	}
	if (request_mem_region(pci_resource_start(pdev, 0),
			       pci_resource_len(pdev, 0), DRIVER_NAME) == NULL) {

		printk(KERN_ERR "%s ERROR: mem region request failed\n", __func__);
		err = -ENOMEM;
		goto fail1;
	}

	saa716x->mmio = ioremap(pci_resource_start(pdev, 0), 0x1000); // FIXME:
check this size

	if ((err = request_irq(pdev->irq, saa716x_pcie_irq, IRQF_SHARED |
IRQF_DISABLED,
			       DRIVER_NAME, (void *) saa716x)) != 0) {
		printk(KERN_ERR "%s ERROR: irq request failed (%i)\n", err, __func__);
		goto fail2;
	}
	pci_set_master(pdev);
	pci_read_config_byte(pdev, PCI_LATENCY_TIMER, &latency);
	pci_read_config_byte(pdev, PCI_CLASS_REVISION, &revision);

	dprintk(verbose, SAA716x_ERROR, 0, "     SAA7160/1/2 Rev %d [%04x:%04x], ",
		revision,
		saa716x->pdev->subsystem_vendor, saa716x->pdev->subsystem_device);

	dprintk(verbose, SAA716x_ERROR, 0,
		"irq: %d, latency: %d\n     memory: 0x%04x, mmio: 0x%p\n",
		saa716x->pdev->irq, latency, pci_resource_start(pdev, 0), saa716x->mmio);

	saa716x->verbose = verbose;
//	init_waitqueue_head(&saa716x->i2c_queue);
	/* Disable all interrupts here */
//	saa716x_write(0, 0x500);
	return 0;

fail2:
	iounmap(saa716x->mmio);
	release_mem_region(pci_resource_start(saa716x->pdev, 0),
			   pci_resource_len(saa716x->pdev, 0));
fail1:
	pci_disable_device(pdev);
fail0:
	pci_set_drvdata(pdev, NULL);
	return err;
}
EXPORT_SYMBOL_GPL(saa716x_pcie_init);



> but all standard PCI stuff should work fine for PCIe
> devices -- the normal PCI driver stuff is all you should need for
> everything but exotic cases.

That part is then fine. Does MSI require any special tinkering ?


Thanks,
Manu

  reply	other threads:[~2007-05-23 22:11 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-23 12:15 PCIE Manu Abraham
2007-05-23 15:59 ` PCIE Greg KH
2007-05-23 20:59   ` PCIE Manu Abraham
2007-05-23 21:10     ` PCIE Roland Dreier
2007-05-23 22:11       ` Manu Abraham [this message]
2007-05-23 22:23         ` PCIE Roland Dreier
2007-05-23 23:03           ` PCIE Manu Abraham
2007-05-23 23:51             ` PCIE Roland Dreier
2007-05-24  0:07               ` PCIE Manu Abraham
2007-05-24 22:32               ` PCIE Manu Abraham
2007-05-25  3:25                 ` PCIE Roland Dreier
2007-05-26 15:03                   ` PCIE Manu Abraham
2007-05-26 18:28                     ` PCIE Grant Grundler
2007-05-26 19:27                       ` PCIE Manu Abraham
2007-05-28  1:15                         ` PCIE Roland Dreier
2007-05-28  1:25                           ` PCIE Manu Abraham
2007-05-28  2:04                           ` PCIE Manu Abraham
2007-05-28  2:24                             ` PCIE Roland Dreier
2007-05-28  2:47                               ` PCIE Manu Abraham
2007-05-26 22:49                     ` PCIE David Miller
2007-05-26 22:57                       ` PCIE Manu Abraham
2007-05-26 23:55                       ` PCIE Grant Grundler
2007-05-27  0:00                         ` PCIE David Miller
2007-05-27  0:16                           ` PCIE Grant Grundler
2007-05-27  0:30                             ` PCIE David Miller
2007-05-27  1:01                               ` PCIE Manu Abraham
2007-05-27  1:49                                 ` PCIE Grant Grundler
2007-05-27 20:28                                   ` PCIE Manu Abraham
2007-05-28  1:10                           ` PCIE Roland Dreier
2007-05-27  2:34                       ` PCIE H. Peter Anvin
2007-05-27  7:40                         ` PCIE David Miller
2007-05-27 20:31                           ` PCIE Manu Abraham
2007-05-28  1:05                         ` PCIE Roland Dreier
2007-05-28  1:03                       ` PCIE Roland Dreier
2007-05-28  2:54                         ` PCIE David Miller
2007-05-28  4:18                         ` PCIE Grant Grundler
2007-05-28  5:23                           ` PCIE H. Peter Anvin
2007-05-28  5:22                         ` PCIE H. Peter Anvin

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=4654BC10.2000808@gmail.com \
    --to=abraham.manu@gmail.com \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@atrey.karlin.mff.cuni.cz \
    --cc=rdreier@cisco.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