27 November 2018, 17:13 | #21 | ||
Registered User
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,411
|
Quote:
Quote:
Anyway, I'll give some of the ideas here a try later tonight and let you know how it goes. Maybe I can find the problem with some renewed effort and a bag of tips and tricks. Still 99% sure I must be doing something silly somehow, somewhere. Now to find it! Last edited by roondar; 27 November 2018 at 17:22. |
||
27 November 2018, 17:45 | #22 |
Registered User
Join Date: Jun 2015
Location: Germany
Posts: 1,918
|
If it was just that the RTE came too soon after the IRQ-ACK, then how come the original Commodore devs found this problem and had the fix in the kickstart? I don't think it is likely that the OS interrupt handlers exit that fast after the IRQ-ACK. An 040 was fast but not that fast.
|
27 November 2018, 17:55 | #23 | |
Registered User
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,411
|
On the A4000/68040/68060/Vampire interrupt ACK problem, I remember a recent thread where Toni Wilen wrote about this. Here is what he had to say about it:
Quote:
IIRC he's made similar comments in the past, so I guess the problem really is Paula being slow and the second ACK is used just to delay the CPU long enough to not trigger this issue. |
|
27 November 2018, 21:34 | #24 |
Registered User
Join Date: Nov 2006
Location: Stockholm, Sweden
Posts: 237
|
This might be relevant: http://eab.abime.net/showthread.php?t=91412
Snippet from our blitter interrupt handler after that thread discussion: Code:
;---------------------------------------------------------------------------------- ; Level3 / blitter interrupt callback ; should be called by the level3 handler in order to trigger multiple consecutive blits InterruptDrivenStandardBlits_level3BlitterCallback ; Hack: Sometimes, some OS code can trigger a blitter interrupt. ; We have observed this happening on KS1.3 when the CIAB TOD counter ; triggers an alarm (when counter goes $fff -> $1000, a hardware glitch ; makes the counter read out as $000000 for a few cycles, and the comparison ; value is set to $000000 - this results in a Lev6 interrupt being signalled). ; The OS Lev6 interrupt handler does some work, and ends with ; writing $8040 to INTENA and INTREQ. ; It probably does this because it gets confused and thinks it is time ; to activate the QBlit blitter queue logic. ; It does this even if the application has called OwnBlitter. ; This can happen in the middle of an ongoing blit operation. ; To protect against such spurious interrupts, we will test whether there is ; a blit currently in-progress and, if so, not do anything blitter related ; within this interrupt handler. ; The BLTDONE bit is set while a blit is in-progress. btst #DMAB_BLTDONE-8,$dff000+dmaconr bne.s .blitInProgress ... .blitInProgress rts |
27 November 2018, 22:22 | #25 |
Registered User
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,411
|
@Kalms: that is a very interesting and partially scary bit of information... It wasn't what was going wrong, but thanks for the info!
@Thread: I fixed it This is in no small part due to all your hints and tips, so thanks all of you here at EAB - you've been very helpful! --- For those who want to know the final problem and solutions: There were two problems in my code. The first was the double acknowledge. It caused the Blitter queue to inevitably stop running after a random amount of time had passed by allowing higher level interrupts to run in between the two acknowledge writes. This code would take longer than the blit and thus, the queue would break. I had never noted this before, because my earlier blits were fairly big and thus even a relatively long higher level interrupt would fit in the time of the blit. The second problem was the Blitter interrupt being triggered while. Well, as it turns out, phx gave the conclusive hint here when he questioned whether or not that was triggered elsewhere in my code. I checked all my code and found a botched attempt at an atomic action in my non-interrupt code. During this bugged code, I disabled interrupts - but first read their state in INTREQR. Then when re-enabling interrupts, I also wrote back those earlier values. I have no idea why I did that, but it sure as <explicative> wasn't the right thing to do . That code could (and in indeed did) get interrupted right after the read of the interrupt status but before they were actually disabled. So, in rare situations, the CPU would read the INTREQ value containing the Blitter interrupt triggering just before the interrupt was actually serviced. And write this value back into INTREQ during a blit after the blitter interrupt rte'd. And boom was the result. It's all quite logical if you understand how the 68000 and Amiga deal with interrupts, but I clearly didn't when I wrote this code and it caused all this mayhem. In my defence, the bit of code that crashed was two years old As to why it didn't happen before? Well, that was just pure luck and nothing more. Sooner or later, this code would've crashed the machine. The above rarity is also why changing unrelated code would make the problem appear/reappear - as the timing changed, it became either more or less likely that the above situation could trigger. --- The fixes are: 1) disable interrupts and re-enable interrupts during the main program without reading and then afterwards writing the interrupt request value. 2) use one interrupt acknowledge write, at the start of the Blitter handler rather than at the end. I've done both and the program just works now. No more mysterious behaviour. Again, thanks to all who assisted - I learned some new things and now have better idea how to debug these things should they happen again. Should the code for the fixes be valuable, I'd be happy to share it - though it is fairly simple in the end. |
28 November 2018, 13:05 | #26 |
ex. demoscener "Bigmama"
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,624
|
I see a potential problem..
I think Code:
btst #6,intreq+1(a6) Code:
btst #6,intreqr+1(a6) |
28 November 2018, 14:44 | #27 |
Registered User
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,411
|
Ah, that is a typo in the copy I made for the thread. The actual code does indeed btst on intreqr+1
|
28 November 2018, 17:01 | #28 |
ex. demoscener "Bigmama"
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,624
|
|
28 November 2018, 17:54 | #29 |
Registered User
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,411
|
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
CIA interrupts... | bloodline | Coders. System | 6 | 18 January 2018 10:33 |
UAE on Smart TV Stick ?? | SkulleateR | support.OtherUAE | 4 | 02 February 2016 23:43 |
Interrupts and Multitasking: Examples? | tygre | Coders. General | 13 | 22 December 2015 04:56 |
smart file system | wilch | support.WinUAE | 5 | 07 March 2011 09:55 |
Advice on interrupts and jumps | alexh | Coders. General | 11 | 20 May 2008 09:42 |
|
|