Subject: ahd0: failed to create DMA map
To: None <current-users@netbsd.org>
From: Kurt Schreiner <ks@ub.uni-mainz.de>
List: current-users
Date: 12/19/2007 11:10:31
Hi,

following up to http://mail-index.netbsd.org/current-users/2007/12/17/0002.html:

looks like I get "ahd0: failed to create DMA map for ..." now every
night. As "atrun" is running (see output of ps /l below), I suspect
this problem is triggered by /etc/nightly.
With an older kernel (from Dec. 7.) the machine is running w/o
problems.
Is there anything I can do to help tracking this down? Should I
send-pr? Relevant output from db> provided below (lines marked
"***" inserted by me)...

Kurt

ahd0: failed to create DMA map for SG data structures, error = 12
ahd_createdmamem error (2)
ahd0: failed to create DMA map for Sense Data structures, error = 12
ahd_createdmamem error (2)
ahd0: failed to create DMA map for hardware SCB structures, error = 12
ahd_createdmamem error (2)
ahd0: failed to create DMA map for SG data structures, error = 12
ahd_createdmamem error (2)
ahd0: failed to create DMA map for Sense Data structures, error = 12
ahd_createdmamem error (2)
uvm_fault(0xffffffff805f97c0, 0xffff80005430f000, 2) -> e
kernel: page fault trap, code=0
Stopped in pid 0.27 (system) at netbsd:ahd_alloc_scbs+0x1ed:    repe stosq      %
es:(%rdi)
db{0}> bt
ahd_alloc_scbs() at netbsd:ahd_alloc_scbs+0x1ed
ahd_action() at netbsd:ahd_action+0x1c3
scsipi_completion_thread() at netbsd:scsipi_completion_thread+0x10d
db{0}> mach cpu 1
using CPU 1
db{0}> bt
x86_stihlt() at netbsd:x86_stihlt+0x6
idle_loop() at netbsd:idle_loop+0xa8
Bad frame pointer: 0xffff80004f0ea2e0
db{0}> ps
db{0}> ps /l
 PID         LID S     FLAGS       STRUCT LWP *               NAME WAIT
 25299         1 3         4   ffff800085183c00              atrun tstile
 6755          1 3        84   ffff8000851770e0                 sh wait
 14869         1 3        84   ffff8000851773a0               cron pipe
 26360         1 3         0   ffff800085177660              atrun vnlock
 19090         1 3        80   ffff800085177920                 sh wait
 26975         1 3        80   ffff800085177be0               cron pipe
 5526          1 3         0   ffff800063354cc0                 cp uvn_fp2
 15676         1 3        80   ffff800063354480           postdrop netio
 26312         1 3        80   ffff800063354a00           sendmail pipe
 9029          1 3        80   ffff8000633541c0                tee pipe
 8521          1 3        80   ffff800063354740                 sh wait
 2128          1 3        80   ffff8000524c0420                 sh wait
 12642         1 3        80   ffff8000524c0160               cron pipe
 1542          1 3        80   ffff8000523bc140             pickup kqread
 401           1 3        80   ffff8000524c06e0               tcsh tty
 391           1 3        80   ffff8000524c09a0               sshd select
 380           1 3        80   ffff8000524c0c60               sshd netio
 340           1 3        80   ffff8000523bc400              getty tty
 378           1 3        80   ffff8000510f5660              getty tty
 393           1 3        80   ffff8000510f5920              getty tty
 389           1 3        80   ffff8000510f5be0              getty tty
 382           1 3        84   ffff8000523bc6c0               cron nanoslp
 374           1 3        80   ffff8000523bc980               qmgr kqread
 358           1 3        80   ffff8000523bcc40             master kqread
 260           1 3        80   ffff8000522383e0               sshd select
 243           1 3        84   ffff800052238120               ntpd pause
 157           1 3        80   ffff8000511a23c0       lfs_cleanerd segment
 111           1 3        84   ffff8000511a2940            rpcbind select
 104           1 3         4   ffff8000510f53a0            syslogd biowait
 1             1 3        80   ffff80004f0f7360               init wait
>0            42 3       204   ffff8000511a2c00          acctwatch tstile
              41 3       204   ffff8000522386a0              nfsio nfsiod
              40 3       204   ffff800052238960              nfsio nfsiod
              39 3       204   ffff800052238c20              nfsio nfsiod
              38 3       204   ffff8000511a2100              nfsio nfsiod
              37 3       204   ffff8000511a2680         lfs_writer lfswriter
              36 3       204   ffff8000510f50e0            physiod physiod
              35 3       204   ffff8000510e10c0        vmem_rehash vmem_rehash
              34 3       204   ffff8000510e1380           aiodoned aiodoned
              33 3       204   ffff8000510e1640            ioflush drainvp
              32 3       204   ffff8000510e1900           pgdaemon pgdaemon
              31 3       204   ffff8000510e1bc0          atapibus0 sccomp
              30 3       204   ffff80004f0f70a0            acpitz0 acpitz0
              29 3       204   ffff80004f0f7620          cryptoret crypto_wait
              28 3       204   ffff80004f0f78e0           scsibus1 sccomp
           >  27 7  20000204   ffff80004f0f7ba0           scsibus0
              26 3       204   ffff80004f0f6080               iic0 iicintr
              25 3       204   ffff80004f0f6340            atabus1 atath
              24 3       204   ffff80004f0f6600            atabus0 atath
              23 3       284   ffff80004f0f68c0          fw0_probe -
              22 3       204   ffff80004f0f6b80               usb4 usbevt
              21 3       204   ffff80004f0f5060               usb3 usbevt
              20 3       204   ffff80004f0f5320               usb2 usbevt
              19 3       204   ffff80004f0f55e0               usb1 usbevt
              18 3       204   ffff80004f0f58a0         usbtask-dr usbtsk
              17 3       204   ffff80004f0f5b60         usbtask-hc usbtsk
              16 3       204   ffff80004f0f0040               usb0 usbevt
              15 3  80000204   ffff80004f0f0300            xcall/1 xcall
              14 1  80000204   ffff80004f0f05c0          softser/1
              13 1  80000204   ffff80004f0f0880          softclk/1
              12 1  80000204   ffff80004f0f0b40          softbio/1
              11 1  80000204   ffff80004f0ea020          softnet/1
              10 7  a0000205   ffff80004f0ea2e0             idle/1
               9 3       204   ffff80004f0ea5a0             sysmon smtaskq
               8 3       204   ffff80004f0ea860           pmfevent pmfevent
               7 3  80000204   ffff80004f0eab20            xcall/0 xcall
               6 1  80000204   ffff80004f0e8000          softser/0
               5 1  80000204   ffff80004f0e82c0          softclk/0
               4 1  80000204   ffff80004f0e8580          softbio/0
               3 1  80000204   ffff80004f0e8840          softnet/0
               2 1  80000205   ffff80004f0e8b00             idle/0
               1 3       204   ffffffff805d4a60            swapper schedule
db{0}> reboot 0x104

dump to dev 4,1 not possible
Devices without power management support: com2 com3 hpet0 viaide0 amdpm0 aapic0 aapic1 ahd0 ahd1
ahd1: board is not responding
cmd fail
ahd1: ahd_timeout
ahd1:SCB 0xf - timed out
>>>>>>>>>>>>>>>>>> Dump Card State Begins <<<<<<<<<<<<<<<<<
ahd1: Dumping Card State at program address 0x27 Mode 0x11
Card was paused
HS_MAILBOX[0x0] INTCTL[0x0] SEQINTSTAT[0x0] SAVED_MODE[0x11] 
DFFSTAT[0x30] SCSISIGI[0x0] SCSIPHASE[0x0] SCSIBUS[0x0] 
LASTPHASE[0x1] SCSISEQ0[0x0] SCSISEQ1[0x0] SEQCTL0[0xa0] 
SEQINTCTL[0x0] SEQ_FLAGS[0x0] SEQ_FLAGS2[0x0] SSTAT0[0x0] 
SSTAT1[0x8] SSTAT2[0x0] SSTAT3[0x0] PERRDIAG[0x0] 
SIMODE1[0x0] LQISTAT0[0x0] LQISTAT1[0x0] LQISTAT2[0x0] 
LQOSTAT0[0x0] LQOSTAT1[0x0] LQOSTAT2[0x0] 

SCB Count = 48 CMDS_PENDING = 0 LASTSCB 0xffff CURRSCB 0x0 NEXTSCB 0x0
qinstart = 0x0 qinfifonext = 0x2206
 0xf 0xf 0xf 0xf 0xf 0xf
WAITING_TID_QUEUES:
Pending list:
 15 FIFO_USE[0x0] SCB_CONTROL[0x68] SCB_SCSIID[0xf7] 
Total 1
Kernel Free SCB list: 18 25 5 47 10 12 3 26 9 27 30 23 1 13 20 21 24 16 31 14 6 8 2 7 19 11 22 4 29 17 28 46 45 44 43 42 41 40 39 38 37 36 35 34 33 32 0 
Sequencer Complete DMA-inprog list: 
Sequencer Complete list: 
Sequencer DMA-Up and Complete list: 

ahd1: FIFO0 Free, LONGJMP == 0x8252, SCB 0x0
SEQIMODE[0x0] SEQINTSRC[0x0] DFCNTRL[0x0] DFSTATUS[0x89] 
SG_CACHE_SHADOW[0x2] SG_STATE[0x0] DFFSXFRCTL[0x0] 
SOFFCNT[0x0] MDFFSTAT[0x5] 
SHADDR = 0x00, SHCNT = 0x0 HADDR = 0x00, HCNT = 0x0 
CCSGCTL[0x10] 
ahd1: FIFO1 Free, LONGJMP == 0x8063, SCB 0x0
SEQIMODE[0x0] SEQINTSRC[0x0] DFCNTRL[0x0] DFSTATUS[0x89] 
SG_CACHE_SHADOW[0x2] SG_STATE[0x0] DFFSXFRCTL[0x0] 
SOFFCNT[0x0] MDFFSTAT[0x5] 
SHADDR = 0x00, SHCNT = 0x0 HADDR = 0x00, HCNT = 0x0 
CCSGCTL[0x10] 
LQIN: 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 0x0 
ahd1: LQISTATE = 0x0, LQOSTATE = 0x0, OPTIONMODE = 0x7
ahd1: OS_SPACE_CNT = 0x20 MAXCMDCNT = 0x0
SIMODE0[0x0] 
ahd1: REG0 == 0xf, SINDEX = 0x0, DINDEX = 0x0
ahd1: SCBPTR == 0x0, SCB_NEXT == 0xff00, SCB_NEXT2 == 0x0
CDB 0 0 0 0 0 0
STACK: 0x14 0x0 0x0 0x0 0x0 0x0 0x0 0x0
<<<<<<<<<<<<<<<<< Dump Card State Ends >>>>>>>>>>>>>>>>>>
panic: Loop 1

Stopped in pid 0.27 (system) at netbsd:breakpoint+0x1:  ret
db{0}> reboot
syncing disks... Stopped in pid 0.27 (system) at netbsd:breakpoint+0x1:  ret
***
***wait a minute or so, then hit BREAK on serial console
***
db{0}> reboot
Devices without power management support: com2 com3 hpet0 viaide0 amdpm0 aapic0 aapic1 ahd0 ahd1
sd0(ahd0:0:0:0): should have flushed queue?
sd0: cache synchronization failed
Stopped in pid 0.27 (system) at netbsd:breakpoint+0x1:  ret
***
***wait a minute or so, then hit BREAK on serial console
***
db{0}> reboot
Devices without power management support: com2 com3 hpet0 viaide0 amdpm0 aapic0 aapic1 ahd0 ahd1
rebooting...