i.MX6 Quad PCI-E hang issue

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

i.MX6 Quad PCI-E hang issue

1,027 Views
bentales
Contributor I

Hi,

We have encountered a hang issue regarding PCI-E initialization/enumeration using our i.MX6 Quad custom board.

This is the part where we encounter the issue.

imx6q-pcie 1ffc000.pcie: PCI host bridge to bus 0000:00
pci_bus 0000:00: root bus resource [io  0x1000-0xffff]
pci_bus 0000:00: root bus resource [mem 0x01000000-0x01efffff]
pci_bus 0000:00: root bus resource [bus 00-ff]
PCI: bus0: Fast back to back transfers disabled‍‍‍‍‍

Just after the last line, the unit hanged.

I have also attached a file in which a kernel panic was experienced right after the PCI-E initialization was done. I don't know if this was related, but I hope it may help.

Thank you.

Regards,

Ben

Labels (2)
Tags (2)
0 Kudos
3 Replies

918 Views
igorpadykov
NXP Employee
NXP Employee

Hi Benedick

from log, seems image was wrongly built:

"Kernel panic - not syncing: No working init found.  Try passing init= option to kernel"

One can try nxp linux from  source.codeaurora.org/external/imx/linux-imx  repository

linux-imx - i.MX Linux kernel

Documentation

also one can test hardware with :

https://community.nxp.com/docs/DOC-95014 

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

918 Views
bentales
Contributor I

Hi Igor,

Thanks for the quick response.

I'll give you some details regarding the patch we did on our part.

After investigating the kernel driver source code of PCI, we found out the hang issue occurs in the probe.c file located at <kernel_source_code>/drivers/pci. See the below code for the part where we see the hang issue.

struct pci_dev *pci_scan_single_device(struct pci_bus *bus, int devfn)
{
 struct pci_dev *dev;

 dev = pci_get_slot(bus, devfn);
 if (dev) {
  pci_dev_put(dev);
  return dev;
 }

 mdelay(5);

 dev = pci_scan_device(bus, devfn);
 if (!dev)
  return NULL;

 mdelay(5);

 pci_device_add(dev, bus);

 return dev;
}
EXPORT_SYMBOL(pci_scan_single_device);
‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍

As you can see on lines 11 and 17, we added a delay of approx. 5 milliseconds. We come up with this solution because we observed that adding more printk()'s to the code solves the issue, so instead of printk(), we used mdelay().

This patch solves our issue, but can you recommend us a better way of solving this problem?

It might also be noted that we transitioned from i.MX6 DualLite to i.MX6 Quad.

Regards,

Ben

0 Kudos

918 Views
igorpadykov
NXP Employee
NXP Employee

Hi Ben

yes this may be reasonable, for similar delay fixes one can look at

pci: mx6: fix occasional link failures (5a82e1a2) · Commits · U-Boot / U-Boot · GitLab 

Best regards
igor

0 Kudos