From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from web8401.mail.in.yahoo.com (web8401.mail.in.yahoo.com [202.43.219.149]) by ozlabs.org (Postfix) with SMTP id 4920367E0D for ; Fri, 6 Oct 2006 07:58:50 +1000 (EST) Message-ID: <20061005215848.94147.qmail@web8401.mail.in.yahoo.com> Date: Fri, 6 Oct 2006 03:28:48 +0530 (IST) From: agnel juni Subject: Re: linux-2.6 system ACE driver - need help To: "Grenier, Jim" , linuxppc-embedded@ozlabs.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-993843009-1160085528=:93258" List-Id: Linux on Embedded PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , --0-993843009-1160085528=:93258 Content-Type: text/plain; charset=ascii Content-Transfer-Encoding: quoted-printable Hello Jim,=0A=0AThanks for your reply.=0A=0AI did try the option you have p= ropsed. Though didn't help me its good to know.=0A=0AThe driver behaves the= same way when put in polling mode also.=0A=0Athanks very much=0AJunita=0A= =0A----- Original Message ----=0AFrom: "Grenier, Jim" =0ATo: linuxppc-embedded@ozlabs.org=0ASent: Tuesday, 3 October, 2006 3:31= :03 PM=0ASubject: linux-2.6 system ACE driver - need help=0A=0A> Hi Jeff,= =0A> =0A> Thanks for your reply.=0A> =0A> > Does it work for you in polling= mode? If not, you probably have a=0A> problem with the way you are access= ing the system ace - cache,=0A> endianess, byte alignment, etc. If it does= work in polling, the usual=0A> suspects are interrupt masking errors or so= me low level problems with=0A> your IRQ signals. Since you know the size o= f a sector and the size of=0A> the sysace buffers, how many interrupts do y= ou get per sector read?=0ADo=0A> you see extras or not enough?=0A> =0A> I h= eard from Ameet Patil that this driver is not tested in poilling=0Amode and= it failed when we tried also.=0A> Thats when we moved to interrupt mode. = =0A> =0A> I did check for the endianess...byte alignment etc.It looks ok to= me.=0A> =0A> I am using a 64 MB flash. And the sector sice is 512K.When th= e kernel=0Aboots up I see 128 interrupts getting registered. (I think its f= rom=0Aalloc_disk(16) function in adapter.c )=0A> =0A> Seems like the driver= has issues with completing the request.=0A> =0A> We are having issues whil= e mouting the device. It is erratic, that=0Asometimes we are able to mount/= list files, copy files.=0A> =0A> But sometimes the kernel crashes and gives= a Ooops message like :=0A> =0A> /*****************************************= ****************/=0A> =0A> # ls /mnt/Oops: kernel access of bad area, sig: = 11 [#1]=0A> NIP: C00556B8 LR: C00557E4 CTR: 00000000=0A> REGS: dfec1e08 TRA= P: 0300 Not tainted (2.6.16.2)=0A> MSR: 00021000 CR: 22128828 XER= : 00000000=0A> DAR: 30303030, DSISR: 00800000=0A> TASK GPR00: 00100100 DFEC= 1EB8 DFF6C030 C0258C60 DFF7BE10 00000018=0ADF4E9000 C0256D60=0A> GPR08: 303= 03030 00200200 DF4E9154 30303030 22128888 00100400 1FFB9700=0A00000000=0A> = GPR16: 00000001 FFFFFFFF 00000000 007FFF00 1FFB3604 1FF63CE0 1FFCEF78=0AC01= F0000=0A> GPR24: C0240000 00100100 C0240000 00000000 DFF7BE10 00000018 0000= 0000=0AC0258C60=0A> NIP [C00556B8] free_block+0xa8/0x148=0A> LR [C00557E4] = drain_array_locked+0x8c/0xd8=0A> Call Trace:=0A> [DFEC1EB8] [DFCA9490] 0xdf= ca9490 (unreliable)=0A> [DFEC1ED8] [C00557E4] drain_array_locked+0x8c/0xd8= =0A> [DFEC1EF0] [C0056F80] cache_reap+0x74/0x18c=0A> [DFEC1F28] [C002B578] = run_workqueue+0x9c/0x110=0A> [DFEC1F48] [C002B6E4] worker_thread+0xf8/0x13c= =0A> [DFEC1FC0] [C002F6F0] kthread+0xf4/0x130=0A> [DFEC1FF0] [C000413C] ker= nel_thread+0x44/0x60=0A> Instruction dump:=0A> 7cfbfa14 3c000010 80e70014 3= d2a4000 60000100 5529c9f4 7d295a14=0A80c9001c=0A> 3d200020 61290200 8106000= 4 81660000 <91680000> 910b0004 3966001c=0A90060000=0A> BUG: events/0/4, loc= k held at task exit time!=0A> [c01f5d60] {cache_chain_mutex}=0A> .. held b= y: events/0: 4 [dff6c030, 110]=0A> ... acquired at: = cache_reap+0x1c/0x18c=0A> /*********************************************= **********************/=0A>=0A>=0A> We are able to do this after modiifying= the file=0Axsysace_compactflash.c and xsysace_intr.c to reset the control= ler( It=0Awas commented out by applying the patch).=0A> =0A> The data in th= e CF looks sane.=0A>=0A> Please advise.=0A>=0A> Thanks for your help.=0A>= =0A>=0A> Thanks=0A> Junita=0A=0AI have run into a problem with random crash= es with System ACE on a=0Acustom board.=0AIt turned out that sometimes the = System ACE chip would generate an extra=0Ainterrupt=0Aafter a write operati= on completed. The ISR in the driver is dumb and=0Aassumes a transfer=0Ajust= completed. This messed up the empty read/write queue for the=0Adevice.=0A= =0AI was working on a 2.4.17 kernel, so I don't know if it applies to you.= =0AThe quick fix was to ignore these extra interrupts. I changed the line= =0Ain xsysace_intr.c from:=0A=0A if (StatusReg & XSA_SR_DATABUFRDY_MASK)= {=0A=0Ato:=0A=0A if ( (StatusReg & XSA_SR_DATABUFRDY_MASK) &&=0A = (XSysAce_mGetControlReg(AcePtr->BaseAddress) &=0A = XSA_CR_DATARDYIRQ_MASK) ) {=0A=0AWith this change, the driver will = generate a transfer complete event=0Aonly if a transfer was in progress.=0A= =0AHope this helps.=0A=0AJim Grenier=0A=0A=0A______________________________= _________________=0ALinuxppc-embedded mailing list=0ALinuxppc-embedded@ozla= bs.org=0Ahttps://ozlabs.org/mailman/listinfo/linuxppc-embedded=0A=0A=0A=0A= =0A=0A=0A=0A=09=09=0A______________________________________________________= ____=0AYahoo! India Answers: Share what you know. Learn something new=0Ahtt= p://in.answers.yahoo.com/ --0-993843009-1160085528=:93258 Content-Type: text/html; charset=ascii Content-Transfer-Encoding: quoted-printable
Hello Jim,

Thanks for your reply.

I d= id try the option you have propsed. Though didn't help me its good to know.=

The driver behaves the same way when put in polling mode also.
<= br>thanks very much
Junita

----- Original Message ----From: "Grenier, Jim" <James.Grenier@adc.com>
To: linuxppc-embedde= d@ozlabs.org
Sent: Tuesday, 3 October, 2006 3:31:03 PM
Subject: linux= -2.6 system ACE driver - need help

> Hi Jeff,
>
&g= t; Thanks for your reply.
>
> > Does it work for you in pol= ling mode?  If not, you probably have a
> problem with the = way you are accessing the system ace - cache,
> endianess, byte alignment, etc.  = ;If it does work in polling, the usual
> suspects are interrupt maski= ng errors or some low level problems with
> your IRQ signals. &n= bsp;Since you know the size of a sector and the size of
> the sysace = buffers, how many interrupts do you get per sector read?
Do
> you = see extras or not enough?
>
> I heard from Ameet Patil that th= is driver is not tested in poilling
mode and it failed when we tried als= o.
> Thats when we moved to interrupt mode.
>
> I did c= heck for the endianess...byte alignment etc.It looks ok to me.
>
= > I am using a 64 MB flash. And the sector sice is 512K.When the kernel<= br>boots up I see 128 interrupts getting registered. (I think its from
a= lloc_disk(16) function in adapter.c )
>
> Seems like the drive= r has issues with completing the request.
>
> We are having is= sues while mouting the device. It is erratic, that
sometimes we are able to mount/= list files, copy files.
>
> But sometimes the kernel crashes a= nd gives a Ooops message like :
>
> /*************************= ********************************/
>
> # ls /mnt/Oops: kernel a= ccess of bad area, sig: 11 [#1]
> NIP: C00556B8 LR: C00557E4 CTR: 000= 00000
> REGS: dfec1e08 TRAP: 0300   Not tainted  = (2.6.16.2)
> MSR: 00021000 <ME>  CR: 22128828 &n= bsp;XER: 00000000
> DAR: 30303030, DSISR: 00800000
> TASK GPR00= : 00100100 DFEC1EB8 DFF6C030 C0258C60 DFF7BE10 00000018
DF4E9000 C0256D6= 0
> GPR08: 30303030 00200200 DF4E9154 30303030 22128888 00100400 1FFB= 9700
00000000
> GPR16: 00000001 FFFFFFFF 00000000 007FFF00 1FFB360= 4 1FF63CE0 1FFCEF78
C01F0000
> GPR24: C0240000 00100100 C0240000 0= 0000000 DFF7BE10 00000018 00000000
C0258C60
> NIP [C00556B8] free_block+0xa8/0x148
> LR [C00557E4] drain_array_locked+0x8c/0xd8> Call Trace:
> [DFEC1EB8] [DFCA9490] 0xdfca9490 (unreliable)> [DFEC1ED8] [C00557E4] drain_array_locked+0x8c/0xd8
> [DFEC1EF0]= [C0056F80] cache_reap+0x74/0x18c
> [DFEC1F28] [C002B578] run_workque= ue+0x9c/0x110
> [DFEC1F48] [C002B6E4] worker_thread+0xf8/0x13c
>= ; [DFEC1FC0] [C002F6F0] kthread+0xf4/0x130
> [DFEC1FF0] [C000413C] ke= rnel_thread+0x44/0x60
> Instruction dump:
> 7cfbfa14 3c000010 8= 0e70014 3d2a4000 60000100 5529c9f4 7d295a14
80c9001c
> 3d200020 61= 290200 81060004 81660000 <91680000> 910b0004 3966001c
90060000
= > BUG: events/0/4, lock held at task exit time!
>  [c01f= 5d60] {cache_chain_mutex}
> .. held by:     =      events/0:    4 [dff6c030,= 110]
> ... acquired at:            = ;   cache_reap+0x1c/0x18c
> /******************************= *************************************/
>
>
> We are able = to do this after modiifying the file
xsysace_compactflash.c and xsysace_= intr.c  to reset the controller( It
was commented out by apply= ing the patch).
>
> The data in the CF looks sane.
>
= > Please advise.
>
> Thanks for your help.
>
>> Thanks
> Junita

I have run into a problem with random c= rashes with System ACE on a
custom board.
It turned out that sometime= s the System ACE chip would generate an extra
interrupt
after a write= operation completed. The ISR in the driver is dumb and
assumes a transf= er
just completed. This messed up the empty read/write queue for the
= device.

I was working on a 2.4.17 kernel, so I don't know if it appl= ies to you.
The quick fix was to ignore these extra interrupts. I changed the = line
in xsysace_intr.c from:

    if (StatusRe= g & XSA_SR_DATABUFRDY_MASK) {

to:

    = ;if ( (StatusReg & XSA_SR_DATABUFRDY_MASK) &&
  &n= bsp;            = ;     (XSysAce_mGetControlReg(AcePtr->BaseAddre= ss) &
          &n= bsp;          XSA_CR_DATARDYIR= Q_MASK) ) {

With this change, the driver will generate a transfer co= mplete event
only if a transfer was in progress.

Hope this helps.=

Jim Grenier


____________________________________________= ___
Linuxppc-embedded mailing list
Linuxppc-embedded@ozlabs.org
https://ozl= abs.org/mailman/listinfo/linuxppc-embedded


=0A=09=0A=0A=09=0A=09=09
=0AFind out what India is= talking about on - Yahoo! Answers India
=0ASend FREE SMS = to your friend's mobile from Yahoo! Messenger Version 8. Ge= t it NOW --0-993843009-1160085528=:93258--