notaz
Certified Guru
Yup that helps. I then uncommented it again to confirm it's not something else and it locked up the system on the very first iteration just after printing 'start test_cycle_idx=0, testcase=1 ("TC_TESTMSG")' and before printing "OK.".Since you already found out that removing the dsp_close() call seems to improve the situation, could you please comment out line 933 in kmod/dev.c (dsp_poweroff()) and re-run the stresstest on your 3530 ?
Edit: ugh I just noticed you ioremap before every register read/write, any reason for that? That doesn't look like a smart thing to do for performance, as it has to modify page tables each time and flush TLB caches. Although ioremap() might be giving you some static mapping, I'm not sure..
Edit2: I've added lots of prints in dsp_poweroff() (almost after every line), and it seems the lockup happens after the function returns, I guess it makes the SoC unstable and it dies somewhere else, perhaps on next poweron?
Edit3: OK found it, I don't know line number since I messed up the file, but it's this line in dsp_c64.c after which the system dies:
reg32_bit_clear(IVA2_MMU2_CNTL, 1);
.. and I don't really understand what you're doing here, clearing some reserved bit? [edit, edit... the arg is bit number, so it's fine, I see it now].It looks like you should avoid writing to this register if it doesn't have that bit set as it seems to be dangerous for whatever reason. The verbose comments around it also suggest you had trouble with it before.
Edit4: It looked like commenting IVA2_MMU2_CNTL line out helped and things worked, but as soon as I removed debug prints it hanged later in dsp_poweron_and_reset(), somewhere before this function returns. So it looks like some timing issue (something that needs to be waited for is not waited enough, I guess OMAP3 takes longer that DM3730 to finish something before you can talk to it again).
Edit5: You should take spinlock and disable interrupts during these critical register programming code sections, otherwise Linux can context switch to another program while you are in the middle of it, and it might for example access file system (NAND) which will hit OMAP while it's not ready. You already use mutex, but that only protects from 2 simultaneous c64_tools users..
Code:
static DEFINE_SPINLOCK(my_lock);
...
unsigned long flags;
spin_lock_irqsave(&my_lock, flags);
// some critical register programming here..
spin_unlock_irqrestore(&my_lock, flags);
Last edited by a moderator: