Subject: PCIe driver not working properly after upgrading to linux 3.8.13

From: Gokul C G <[email-masked]>
Date: Tue, 19 Aug 2014 20:13:38 +0530

HI,

I am facing problem with PCIE driver in new Linux kernel compiled for 
powerpc architecture (Big endian) ,freescales P2040 processor.I was 
using old kernel Linux version 3.0.48 previously and now updated to 
Linux version 3.8.13-rt9.After updating to the new kernel, PCIe device 
drivers not working properly and i am getting some error messages in the 
boot-up .My intention is to use   EXAR PCIe Multiport serial driver and 
add 8 serial ports in addition to 4 built in serial ports provided by 
P2040 processor. The PCIe driver form EXAR is compiled and  loaded as 
kernel module . The same was working with linux kernel 3.0.48 and 
following prints observed while loading kernel module.

linux 3.0.48 ,working insmod log

========================

Exar PCIe (XR17V35x) serial driver Revision: 1.2

0000:01:00.0: ttyXR0 at MMIO 0xc20000000 (irq = 41) is a XR17v35x

0000:01:00.0: ttyXR1 at MMIO 0xc20000400 (irq = 41) is a XR17v35x

0000:01:00.0: ttyXR2 at MMIO 0xc20000800 (irq = 41) is a XR17v35x

0000:01:00.0: ttyXR3 at MMIO 0xc20000c00 (irq = 41) is a XR17v35x

0000:01:00.0: ttyXR4 at MMIO 0xc20001000 (irq = 41) is a XR17v35x

0000:01:00.0: ttyXR5 at MMIO 0xc20001400 (irq = 41) is a XR17v35x

0000:01:00.0: ttyXR6 at MMIO 0xc20001800 (irq = 41) is a XR17v35x

0000:01:00.0: ttyXR7 at MMIO 0xc20001c00 (irq = 41) is a XR17v35x

After that  ttyXR0 to ttyXR7 (7 serial devices) will be displayed 
under*/dev*directory .

And following PCIe driver messages in*dmesg*(linux 3.0.48 ,working )

----------------------------------------------------------------------

EDAC PCI0: Giving out device to module 'MPC85xx_edac' controller 
'mpc85xx_pci_err': DEV 'ffe201000.pcie' (INTERRUPT)

MPC85xx_edac acquired irq 493 for PCI Err

MPC85xx_edac PCI err registered

PCI: Probing PCI hardware

pci 0000:00:00.0: ignoring class b20 (doesn't match header type 01)

PCIE error(s) detected

pci 0000:00:00.0: PCI bridge to [bus 01-ff]

PCIE ERR_DR register: 0x80020000

PCIE ERR_CAP_STAT register: 0x80000001

PCIE ERR_CAP_R0 register: 0x00000800

PCIE ERR_CAP_R1 register: 0x00000000

PCIE ERR_CAP_R2 register: 0x00000000

PCIE ERR_CAP_R3 register: 0x00000000

pci 0000:00:00.0: PCI bridge to [bus 01-01]

pci 0000:00:00.0:   bridge window [io 0xfdfea000-0xfdff9fff]

pci 0000:00:00.0:   bridge window [mem 0xc20000000-0xc3fffffff]

pci 0000:00:00.0:   bridge window [mem pref disabled]

bio: create slab <bio-0> at 0

But after upgrading kernel to 3.8.13 while inserting kernel module only 
following messages displayed and no ttyXR devices displayed under /dev 
directory .

Exar PCIe (XR17V35x) serial driver Revision: 1.2

no other messages

And following PCIe driver messages in*dmesg*(linux 3.8.13 ,not working )

----------------------------------------------------------------------

EDAC PCI0: Giving out device to module 'MPC85xx_edac' controller 
'mpc85xx_pci_err': DEV 'ffe201000.pcie' (INTERRUPT)

MPC85xx_edac acquired irq 481 for PCI Err

MPC85xx_edac PCI err registered

PCI: Probing PCI hardware

fsl-pci ffe201000.pcie: PCI host bridge to bus 0000:00

pci_bus 0000:00: root bus resource [io  0x0000-0xffff]

pci_bus 0000:00: root bus resource [mem 0xc20000000-0xc3fffffff] (bus 
address [0xe0000000-0xffffffff])

pci_bus 0000:00: root bus resource [bus 00-ff]

PCIE error(s) detected

PCIE ERR_DR register: 0x80020000

PCIE ERR_CAP_STAT register: 0x80000001

PCIE ERR_CAP_R0 register: 0x00000800

pci 0000:00:00.0: PCI bridge to [bus 01-ff]

PCIE ERR_CAP_R1 register: 0x00000000

PCIE ERR_CAP_R2 register: 0x00000000

PCIE ERR_CAP_R3 register: 0x00000000

PCI: Cannot allocate resource region 0 of device 0000:00:00.0, will remap

pci 0000:00:00.0: BAR 0: can't assign mem (size 0x1000000)

pci 0000:00:00.0: BAR 9: can't assign mem pref (size 0x200000)

pci 0000:00:00.0: PCI bridge to [bus 01]

pci 0000:00:00.0:   bridge window [io  0x0000-0xffff]

pci 0000:00:00.0:   bridge window [mem 0xc20000000-0xc3fffffff]

=========================

-----------

following lines are there in dts related to pci

   pcie@ffe200000 {

   reg = <0xf 0xfe200000 0x0 0x1000>;

   ranges = <0x2000000 0x0 0xe0000000 0xc 0x0 0x0 0x20000000 0x1000000 
0x0 0x0 0xf 0xf8000000 0x0 0x10000>;

   compatible = "fsl,p2041-pcie", "fsl,qoriq-pcie-v2.2";

   device_type = "pci";

   #size-cells = <0x2>;

   #address-cells = <0x3>;

   bus-range = <0x0 0xff>;

   clock-frequency = <0x1fca055>;

   interrupts = <0x10 0x2 0x1 0xf>;

          pcie@0 {

          ranges = <0x2000000 0x0 0xe0000000 0x2000000 0x0 0xe0000000 
0x0 0x20000000 0x1000000 0x0 0x0 0x1000000 0x0 0x0 0x0 0x10000>;

          reg = <0x0 0x0 0x0 0x0 0x0>;

          #interrupt-cells = <0x1>;

          #size-cells = <0x2>;

          #address-cells = <0x3>;

          device_type = "pci";

          interrupts = <0x10 0x2 0x1 0xf>;

          interrupt-map-mask = <0xf800 0x0 0x0 0x7>;

          interrupt-map = <0x0 0x0 0x0 0x1 0x1 0x28 0x1 0x0 0x0 0x0 0x0 
0x0 0x2 0x1 0x1 0x1 0x0 0x0 0x0 0x0 0x0 0x3 0x1 0x2 0x1 0x0 0x0 0x0 0x0 
0x0 0x4 0x1 0x3 0x1 0x0 0x0>;

          };

   };

   pcie@ffe201000 {

   reg = <0xf 0xfe201000 0x0 0x1000>;

   ranges = <0x2000000 0x0 0xe0000000 0xc 0x20000000 0x0 0x20000000 
0x1000000 0x0 0x0 0xf 0xf8010000 0x0 0x10000>;

   compatible = "fsl,p2041-pcie", "fsl,qoriq-pcie-v2.2";

   device_type = "pci";

   #size-cells = <0x2>;

   #address-cells = <0x3>;

   bus-range = <0x0 0xff>;

   clock-frequency = <0x1fca055>;

   interrupts = <0x10 0x2 0x1 0xe>;

       pcie@0 {

       ranges = <0x2000000 0x0 0xe0000000 0x2000000 0x0 0xe0000000 0x0 
0x20000000 0x1000000 0x0 0x0 0x1000000 0x0 0x0 0x0 0x10000>;

       reg = <0x0 0x0 0x0 0x0 0x0>;

       #interrupt-cells = <0x1>;

       #size-cells = <0x2>;

      #address-cells = <0x3>;

      device_type = "pci";

      interrupts = <0x10 0x2 0x1 0xe>;

      interrupt-map-mask = <0xf800 0x0 0x0 0x7>;

      interrupt-map = <0x0 0x0 0x0 0x1 0x1 0x29 0x1 0x0 0x0 0x0 0x0 0x0 
0x2 0x1 0x5 0x1 0x0 0x0 0x0 0x0 0x0 0x3 0x1 0x6 0x1 0x0 0x0 0x0 0x0 0x0 
0x4 0x1 0x7 0x1 0x0 0x0>;

      };

   };

   pcie@ffe202000 {

   reg = <0xf 0xfe202000 0x0 0x1000>;

   ranges = <0x2000000 0x0 0xe0000000 0xc 0x40000000 0x0 0x20000000 
0x1000000 0x0 0x0 0xf 0xf8020000 0x0 0x10000>;

   compatible = "fsl,p2041-pcie", "fsl,qoriq-pcie-v2.2";

   device_type = "pci";

   #size-cells = <0x2>;

   #address-cells = <0x3>;

   bus-range = <0x0 0xff>;

   clock-frequency = <0x1fca055>;

   interrupts = <0x10 0x2 0x1 0xd>;

      pcie@0 {

      ranges = <0x2000000 0x0 0xe0000000 0x2000000 0x0 0xe0000000 0x0 
0x20000000 0x1000000 0x0 0x0 0x1000000 0x0 0x0 0x0 0x10000>;

      reg = <0x0 0x0 0x0 0x0 0x0>;

      #interrupt-cells = <0x1>;

      #size-cells = <0x2>;

      #address-cells = <0x3>;

      device_type = "pci";

      interrupts = <0x10 0x2 0x1 0xd>;

      interrupt-map-mask = <0xf800 0x0 0x0 0x7>;

      interrupt-map = <0x0 0x0 0x0 0x1 0x1 0x2a 0x1 0x0 0x0 0x0 0x0 0x0 
0x2 0x1 0x9 0x1 0x0 0x0 0x0 0x0 0x0 0x3 0x1 0xa 0x1 0x0 0x0 0x0 0x0 0x0 
0x4 0x1 0xb 0x1 0x0 0x0>;

      };

   };

*
*

only address ffe201000 have PCIe card connected.

====================

here is the lspci output

---------------------------------

root@root:~#  lspci -vvv

00:00.0 Class 0604: 1957:0411

01:00.0 Class 0700: 13a8:0358

root@root:~#

make menuconfig compile time options for linux  :

---------------------------------------------------------------------

-*- Freescale Local Bus support

   ? ?                                           [ ] Enable stashing of 
FMAN write transactions for ethernet ports

   ? ?                                           -*- Datapath 
Acceleration Queue and Buffer management

   ? ?                                           [*] PCI support

   ? ?                                           [*] PCI Express support

   ? ?                                           < > PCI Express Hotplug 
driver

   ? ?                                           [*]   Root Port 
Advanced Error Reporting support

   ? ?                                           [ ]     PCI Express 
ECRC settings control

   ? ?                                           < >     PCIe AER error 
injector support

   ? ?                                           [ ]   PCI Express ASPM 
control

   ? ?                                           [*] Message Signaled 
Interrupts (MSI and MSI-X)

   ? ?                                           [*] PCI Debugging

   ? ?                                           [ ] Enable PCI resource 
re-allocation detection

   ? ?                                           < > PCI Stub driver

   ? ?                                           [ ] PCI IOV support

   ? ?                                           [ ] PCI PRI support

   ? ?                                           [ ] PCI PASID support

   ? ?                                           < > PCCard 
(PCMCIA/CardBus) support --->

   ? ?                                           <*> Support for PCI 
Hotplug --->

   ? ?                                           [ ] RapidIO support

I am using same device tree that i used with linux 3.0.48 .

I doubt there is basic problem with PCie driver provided with linux 3.8.x .

When I searched in this Google, I Could find that some people 
experienced some problem with PCIe driver in linux 3.8 after 
up-gradation of kernel.

Can anyone help me to get out this issue ?

Did any one faced same issue before?

-- 
Thanks & Regards
*Gokul C G *
Engineer Product Development

Phone 	 : +91-484 2861900
Mobile 	 :
Fax 	 : +91-484 2861900
Email 	 : [email-masked] <mailto:[email-masked]>
Web 	 : www.kalkitech.com <http://www.kalkitech.com>

<http://www.kalkitech.com>

"Disclaimer: This message is being sent from Kalki Communication Technologies
Pvt Ltd (KALKITECH). and may contain information which is confidential or 

privileged. If you are not the intended recipient, please advise the sender
immediately by reply e-mail and delete this message and any attachments 

without retaining a copy. Any unauthorized use of the content of this message
can expose the responsible party to civil and/or criminal penalties, 

and may constitute a more serious offense. Further the company does not accept
liability for any errors, omissions, viruses or computer problems 

experienced as a result of this transmission. If you have received this
message in error, notice is hereby given that no representation, contract or 

other binding obligation shall be created by this e-mail."