USB Oops Problem with AT91SAM9G45 using Linux 2.6.33.20

Discussion around AT91RM9200 and SAM9 Series Products.

Moderator: nferre

oldAT91admin
Posts: 6
Joined: Tue Sep 24, 2019 9:45 am

USB Oops Problem with AT91SAM9G45 using Linux 2.6.33.20

Tue Sep 24, 2019 10:02 am

Hello!
I have a problem with older AT91SAM9G45 boards.
During read/write from/to USB-Stick the kernel (linux 2.6.33.20) crashes and different Internal errors occur.
This is reproducable with different boards, so I exclude a hardware defect. (Voltages are ok)
It seems the error occurs when larger datablocks are transfered...

Example, this works:
# dd if=/dev/sda of=/dev/null count=10000 bs=1000
10000+0 records in
10000+0 records out
10000000 bytes (9.5MB) copied, 0.216677 seconds, 44.0MB/s


But this will mostly generate an error:
# dd if=/dev/sda of=/dev/null count=10000 bs=10000
Internal error: Oops - undefined instruction: 0 [#1] PREEMPT
last sysfs file: /sys/block/sda/dev
Modules linked in:
CPU: 0 Not tainted (2.6.33.20 #1)
PC is at elv_merge+0x1c/0x17c
LR is at __make_request+0x88/0x420
pc : [<c0155800>] lr : [<c015884c>] psr: a0000093
sp : c79c5cb8 ip : 00000000 fp : 00000200
r10: 00000200 r9 : 0000e23f r8 : c797ef20
r7 : c79c5cd4 r6 : c792a000 r5 : c5da6ca0 r4 : c7931518
r3 : 00000000 r2 : c5da6ca0 r1 : c79c5cd4 r0 : c792a000
Flags: NzCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment user
Control: 0005317f Table: 76d6c000 DAC: 00000015
Process dd (pid: 412, stack limit = 0xc79c4270)


Has anyone an Idea ? :?:
blue_z
Location: USA
Posts: 1988
Joined: Thu Apr 19, 2007 10:15 pm

Re: USB Oops Problem with AT91SAM9G45 using Linux 2.6.33.20

Fri Sep 27, 2019 11:34 pm

oldAT91admin wrote: But this will mostly generate an error:
What is "mostly" supposed to mean? What is the rate of occurrence?

Have you used more than one "USB-Stick" in your testing?
You're using a block size that is not a multiple of the physical block size. Have you tested with multiples of the physical block size (i.e. N*512)?

FWIW those commands perform without issue on 2.6.39.

Regards
oldAT91admin
Posts: 6
Joined: Tue Sep 24, 2019 9:45 am

Re: USB Oops Problem with AT91SAM9G45 using Linux 2.6.33.20

Mon Sep 30, 2019 7:50 am

Thank you for reply!

Could be, that it is not a software problem, but hardware.
The DRAM device was changed without bootloader customization.
After the verification I will write here again ...
oldAT91admin
Posts: 6
Joined: Tue Sep 24, 2019 9:45 am

Re: USB Oops Problem with AT91SAM9G45 using Linux 2.6.33.20

Mon Oct 07, 2019 4:38 pm

Hello all together,
next results of my investigations:

Error occurs only on newer boards with a marginal change in layout data.

Error doesn't occure when kernel is started with parameter "mem=64m"
(The pcb has 128m Memeory)

Starting the kernel with "mem=128m" or "mem=96m" leads to the described error.

A simple memory-test which gets blocks of 1MB works in all cases with no segmentation-error.

simple memory-test getting memory-blocks of 1MB size:

Code: Select all

kernel commandline mem=...	/proc/sys/vm/overcommit_memory		result
--------------------------	-------------------------------		-----------------
	128 MB					0									115 blocks
	128 MB					2									54 blocks
	96 MB					0									85 blocks (invoked oom-killer)
	96 MB					2									38 blocks
	64 MB					0									52 blocks (invoked oom-killer)
	64 MB					2									23 blocks
Maybe a problem with DMA ?

Any idea ?
blue_z
Location: USA
Posts: 1988
Joined: Thu Apr 19, 2007 10:15 pm

Re: USB Oops Problem with AT91SAM9G45 using Linux 2.6.33.20

Wed Oct 09, 2019 1:52 am

oldAT91admin wrote: A simple memory-test which gets blocks of 1MB works in all cases with no segmentation-error.
...
Maybe a problem with DMA ?
You're not clear at all as what this "memory test" does, but if it executes with virtual memory, then IMO the test is a waste of time.
Why are you suspecting DMA when your "memory test" does not seem to utilize any DMA operations?

Seems like you need to run comprehensive memory test(s) on your boards.
Testing with Linux on unstable hardware is a waste of time.

Regards
oldAT91admin
Posts: 6
Joined: Tue Sep 24, 2019 9:45 am

Re: USB Oops Problem with AT91SAM9G45 using Linux 2.6.33.20

Mon Oct 14, 2019 8:08 am

Hello,
I suggest it is a problem with USB.

Because reading from NAND-Flash doesn't leads to an error:

Code: Select all

# dd if=/dev/ubi0_5 of=/dev/null bs=10M
7+1 records in
7+1 records out
73414656 bytes (70.0MB) copied, 1.455426 seconds, 48.1MB/s
# dd if=/dev/ubi0_5 of=/dev/null bs=10M
7+1 records in
7+1 records out
73414656 bytes (70.0MB) copied, 1.454416 seconds, 48.1MB/s
# dd if=/dev/ubi0_5 of=/dev/null bs=10M
7+1 records in
7+1 records out
73414656 bytes (70.0MB) copied, 1.454361 seconds, 48.1MB/s
# dd if=/dev/ubi0_5 of=/dev/null bs=10M
7+1 records in
7+1 records out
73414656 bytes (70.0MB) copied, 1.453893 seconds, 48.2MB/s
Doing the same with USB, I get different errors:

Code: Select all

Internal error: Oops - undefined instruction: 0 [#1] PREEMPT
last sysfs file: /sys/block/sda/dev
Modules linked in:
CPU: 0    Not tainted  (2.6.33.20 #1)
PC is at bio_put+0x3c/0x58
LR is at submit_bh+0x188/0x1ac
pc : [<c00b7c74>]    lr : [<c00b3130>]    psr: 20000093
sp : c7b93d48  ip : c7bb4f04  fp : 0000e08f
r10: 00000008  r9 : 00000200  r8 : c7402c08
r7 : c7b92000  r6 : 00000000  r5 : 00000000  r4 : 00000000
r3 : c78c6640  r2 : 20000093  r1 : 20000013  r0 : 00000000
Flags: nzCv  IRQs off  FIQs on  Mode SVC_32  ISA ARM  Segment user
Control: 0005317f  Table: 77bec000  DAC: 00000015
Process dd (pid: 394, stack limit = 0xc7b92270)
Stack: (0xc7b93d48 to 0xc7b94000)
...

And why doesn't occure the error, if i start the kernel with only 64m of RAM... ?
blue_z
Location: USA
Posts: 1988
Joined: Thu Apr 19, 2007 10:15 pm

Re: USB Oops Problem with AT91SAM9G45 using Linux 2.6.33.20

Wed Oct 16, 2019 12:21 am

oldAT91admin wrote: I suggest it is a problem with USB.
You're just speculating, like your previous post on DMA.
oldAT91admin wrote: And why doesn't occure the error, if i start the kernel with only 64m of RAM... ?
I already suggested what you need to test, but you just ignore me and respond with a recycled guess.
I should do likewise.
oldAT91admin
Posts: 6
Joined: Tue Sep 24, 2019 9:45 am

Re: USB Oops Problem with AT91SAM9G45 using Linux 2.6.33.20

Mon Oct 21, 2019 2:42 pm

Sorry, I don't know how to test this item...
blue_z
Location: USA
Posts: 1988
Joined: Thu Apr 19, 2007 10:15 pm

Re: USB Oops Problem with AT91SAM9G45 using Linux 2.6.33.20

Tue Oct 22, 2019 11:32 pm

There's memory test code in U-Boot.
But executing a DRAM test from the SRAM would be better/best, i.e. hack AT91Bootstrap.
Be aware that AT91Bootstrap has limited console output capabilities, e.g. printf() formats.

But first you need to learn what hardware you have and need to test.
The Atmel reference design for the AT91SAM9G45 split 128MB between two DRAM controllers, so there was memory at 0x20000000 and 0x70000000.
Warning: support in Linux4SAM for dual memory banks and noncontiguous memory has been spotty.
How do your original and "newer" boards differ, and what patches (e.g. Nicu Pavel's or Daniel Palmer's) do you have to support it ?
oldAT91admin
Posts: 6
Joined: Tue Sep 24, 2019 9:45 am

Re: USB Oops Problem with AT91SAM9G45 using Linux 2.6.33.20

Wed Oct 23, 2019 1:53 pm

Thank you for the hints!

There is only a small bootloader in EEPROM (without RAM test), no U-Boot.

128 MB RAM ist not splitted, only controller EBI0 is used for SDRAM.

Difference between (old) work / (newer) not work:
SAMSUNG K4T51083QQ-BCE6 / NANYA NT5TU64M8FE-AC

(2 RAM chips for D0..D7 and D8..D15)

Return to “SAM9 ARM9 MPU”

Who is online

Users browsing this forum: No registered users and 1 guest