Commit 398a9db
serial: 8250_pci: Handle devices mapped above 4 GiB
Several init/setup functions passed the PCI BAR resource start address
to ioremap_nocache() via an unsigned long. This caused address truncation
for a 32-bit device mapped above 4 GiB (i.e. the CPU interacts with the
device via a translated address), which resulted in a kernel panic.
This patch replaces all of the instances of intermediate variable use
with pci_ioremap_bar() to ensure the full resource_size_t start address
is used and that ioremap_nocache() is still called.
The kernel panic (Exar XR17V358 PCIe device on a Freescale P2020 SBC):
Machine check in kernel mode.
Caused by (from MCSR=10008): Bus - Read Data Bus Error
Oops: Machine check, sig: 7 [#1]
SMP NR_CPUS=2 X-ES P2020
Modules linked in:
CPU: 1 PID: 1 Comm: swapper/0 Not tainted 3.14.15-xes_r2-00002-g560e401 #978
task: bf850000 ti: bffee000 task.ti: bf84c000
NIP: 80318e10 LR: 80319ecc CTR: 80318dfc
REGS: bffeff10 TRAP: 0204 Not tainted (3.14.15-xes_r2-00002-g560e401)
MSR: 00021000 <CE,ME> CR: 20adbe42 XER: 00000000
DEAR: c1058001 ESR: 00000000
GPR00: 00000000 bf84db30 bf850000 80cb4af8 00000001 00000000 80000007 80000000
GPR08: bf837c9c c1058001 00000001 00000000 80000007 00000000 80002a10 00000000
GPR16: 00000000 00000000 00000000 00000000 00000000 00000000 80cb0000 80c72dc4
GPR24: 80cb4900 fffffffe 00029000 00000001 bf8c11e8 ffffffea 80c72ce4 80cb4af8
NIP [80318e10] mem_serial_in+0x14/0x28
LR [80319ecc] serial8250_config_port+0x160/0xe38
Call Trace:
[bf84db30] [80319d94] serial8250_config_port+0x28/0xe38 (unreliable)
[bf84db60] [80315e3c] uart_add_one_port+0x148/0x3a4
[bf84dbf0] [8031bf40] serial8250_register_8250_port+0x2dc/0x3c8
[bf84dc20] [8032111c] pciserial_init_ports+0xd4/0x1c0
[bf84dd50] [803212f8] pciserial_init_one+0xf0/0x224
[bf84dd90] [802d8ff4] local_pci_probe+0x34/0x8c
[bf84dda0] [802d92c8] pci_device_probe+0x84/0xa0
[bf84ddc0] [80329ee0] driver_probe_device+0xac/0x26c
[bf84dde0] [8032a15c] __driver_attach+0xbc/0xc0
[bf84de00] [80328388] bus_for_each_dev+0x90/0xcc
[bf84de30] [80329cd0] driver_attach+0x24/0x34
[bf84de40] [80328e28] bus_add_driver+0x104/0x1fc
[bf84de60] [8032a8c8] driver_register+0x70/0x138
[bf84de70] [802d93c0] __pci_register_driver+0x48/0x58
[bf84de80] [8077e0e4] serial_pci_driver_init+0x24/0x34
[bf84de90] [80002228] do_one_initcall+0x34/0x1b0
[bf84df00] [80764294] kernel_init_freeable+0x138/0x1e8
[bf84df30] [80002a24] kernel_init+0x14/0x108
[bf84df40] [8000ef94] ret_from_kernel_thread+0x5c/0x64
Instruction dump:
800800c4 7d290214 39290001 7c0004ac 7ca049ae 7c0004ac 4e800020 88030035
81230008 7c840030 7d292214 7c0004ac <88690000> 0c030000 4c00012c 5463063e
---[ end trace e3c16443b5d573c6 ]---
Signed-off-by: Aaron Sierra <asierra@xes-inc.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent 08de101 commit 398a9db
1 file changed
+17
-30
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
79 | 79 | | |
80 | 80 | | |
81 | 81 | | |
82 | | - | |
83 | 82 | | |
84 | 83 | | |
85 | 84 | | |
86 | 85 | | |
87 | | - | |
88 | | - | |
89 | 86 | | |
90 | | - | |
91 | | - | |
92 | 87 | | |
93 | | - | |
| 88 | + | |
94 | 89 | | |
95 | 90 | | |
96 | 91 | | |
97 | 92 | | |
98 | 93 | | |
99 | | - | |
| 94 | + | |
100 | 95 | | |
101 | 96 | | |
102 | 97 | | |
103 | 98 | | |
104 | | - | |
| 99 | + | |
105 | 100 | | |
106 | 101 | | |
107 | 102 | | |
| |||
317 | 312 | | |
318 | 313 | | |
319 | 314 | | |
320 | | - | |
321 | 315 | | |
322 | 316 | | |
323 | 317 | | |
324 | 318 | | |
325 | 319 | | |
326 | 320 | | |
327 | 321 | | |
328 | | - | |
329 | | - | |
330 | | - | |
| 322 | + | |
331 | 323 | | |
332 | 324 | | |
333 | 325 | | |
| |||
349 | 341 | | |
350 | 342 | | |
351 | 343 | | |
352 | | - | |
353 | 344 | | |
354 | 345 | | |
355 | 346 | | |
356 | 347 | | |
357 | 348 | | |
358 | 349 | | |
359 | 350 | | |
360 | | - | |
361 | | - | |
362 | | - | |
| 351 | + | |
363 | 352 | | |
364 | 353 | | |
365 | 354 | | |
| |||
682 | 671 | | |
683 | 672 | | |
684 | 673 | | |
685 | | - | |
686 | 674 | | |
687 | 675 | | |
688 | 676 | | |
689 | 677 | | |
690 | 678 | | |
691 | 679 | | |
692 | 680 | | |
693 | | - | |
694 | | - | |
695 | | - | |
| 681 | + | |
696 | 682 | | |
697 | 683 | | |
698 | 684 | | |
| |||
714 | 700 | | |
715 | 701 | | |
716 | 702 | | |
717 | | - | |
| 703 | + | |
718 | 704 | | |
719 | 705 | | |
720 | 706 | | |
| |||
723 | 709 | | |
724 | 710 | | |
725 | 711 | | |
726 | | - | |
727 | | - | |
728 | | - | |
| 712 | + | |
729 | 713 | | |
730 | 714 | | |
731 | 715 | | |
732 | | - | |
733 | | - | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
734 | 723 | | |
735 | 724 | | |
736 | 725 | | |
| |||
757 | 746 | | |
758 | 747 | | |
759 | 748 | | |
| 749 | + | |
760 | 750 | | |
761 | | - | |
762 | 751 | | |
763 | 752 | | |
764 | 753 | | |
| |||
767 | 756 | | |
768 | 757 | | |
769 | 758 | | |
770 | | - | |
771 | | - | |
772 | | - | |
| 759 | + | |
773 | 760 | | |
774 | 761 | | |
775 | 762 | | |
| |||
0 commit comments