From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from web8415.mail.in.yahoo.com (web8415.mail.in.yahoo.com [202.43.219.103]) by ozlabs.org (Postfix) with SMTP id 19CBF67C23 for ; Tue, 7 Nov 2006 06:00:12 +1100 (EST) Message-ID: <20061106190010.58059.qmail@web8415.mail.in.yahoo.com> Date: Tue, 7 Nov 2006 00:30:10 +0530 (IST) From: agnel juni Subject: Re: System ACE driver - for 2.6 kernel - issue resolved To: Ameet Patil MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-499964483-1162839610=:56369" Cc: linuxppc-embedded@ozlabs.org List-Id: Linux on Embedded PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , --0-499964483-1162839610=:56369 Content-Type: text/plain; charset=ascii Content-Transfer-Encoding: quoted-printable Hi Ameet,=0A=0AWe were able to get over with the unstability in the driver = with the following fix in the code=0A=0AInstead of fixing the number of sec= tors to be 2 in the loop, we are actually doing a read based on the kernel = request like this :=0A=0A for(i =3D xsa_cur_req->current_nr_sectors; i > 0= ; i-=3Dxsa_cur_req->current_nr_sectors ){=0A xsa_dev= ice.req_done =3D 1;=0A while ((stat =3D cur_req(&Sys= Ace, sector,=0A xsa_cur_req->current= _nr_sectors ,=0A buffer)) =3D=3D XST= _DEVICE_BUSY)=0A xsa_short_delay();=0A=0A=0A= Now the driver is stable with all the filesystem commands.=0A=0APlease test= this out and if appropriate patch this to the driver code.=0A=0AThanks=0AJ= unita=0A=0A----- Original Message ----=0AFrom: Ameet Patil =0ATo: agnel juni =0ACc: linuxppc-embedded@ozla= bs.org=0ASent: Thursday, 26 October, 2006 1:00:48 AM=0ASubject: Re: System = ACE driver - for 2.6 kernel - need help to understand xsa_thread=0A=0AHi Ju= nita,=0A Its a hack really! When I was developing/porting the SysAce dri= ver =0Ato 2.6 I tried to maintain the code as is from the 2.4 kernel driver= . In =0Adoing so I found that there is a slight difference between the two = =0Akernels. i.e. I am not sure why, but the sysace device can only handle = =0Arequests for 2 sectors at a time. This was fine in the 2.4 as the kernel= =0Aalways requested 2 sectors. However, in 2.6 I found that this is =0Adif= ferent: the requests are 8 secs. or more. I tried to fix this in vain =0Aby= changing several parameters of the driver during initialization. =0AAnyway= , due to several issues I didn't try hard to fix it at that time.=0A=0AHenc= e this hack: No matter how many sec. req. I get from the kernel, I =0Ause a= loop to req. only 2 secs. at a time. The xsa_device.req_done is =0Aused as= a flag and reset in the XSA IRQ IIRC.=0A=0AIf you find a better approach, = please do update me. Hope this helps!=0A=0Acheers,=0A-Ameet=0A=0Aagnel juni= wrote:=0A> =0A> Hello all=0A> =0A> I am trying to understand the parameter= s that are sent through "cur_req" =0A> function used in funtion xsa_thread = in System ACE driver.=0A> =0A> In xsa_thread function in the System ACE dri= ver ,=0A> =0A> In 2.4 kernel:=0A> --------------------=0A> while ((stat =3D= cur_req(&SysAce, sector,=0A> CURREN= T->current_nr_sectors,=0A> CURRENT->= buffer)) =3D=3D XST_DEVICE_BUSY)=0A> xsa_short_dela= y();=0A> =0A> =0A> Where as in 2.6 kernel this is changed to=0A> ---------= ------------------------------------------------------=0A> =0A> for(i =3D x= sa_cur_req->current_nr_sectors; i > 0; i-=3D2){=0A> = xsa_device.req_done =3D 1;=0A> while ((stat =3D cu= r_req(&SysAce, sector,=0A> 2,=0A> = buffer)) =3D=3D XST_DEVICE_BUSY)=0A>= xsa_short_delay();=0A> #endif=0A> =0A> Ame= et , could you help me understand the impact of the parameters, =0A> especa= illy the 3rd paramter which is hardcoded in 2.6 kernel.It would be =0A> gre= at if you could clarify this in regard to 'mount' command.=0A> =0A> Thanks = in advance=0A> Junita=0A> =0A> =0A> =0A> ----------------------------------= --------------------------------------=0A> Find out what India is talking a= bout on - Yahoo! Answers India =0A> =0A> Send FREE SMS to your friend's mobile = from Yahoo! Messenger Version 8. =0A> Get it NOW =0A> =0A> =0A=0A=0A= =0A=0A=0A=0A=0A=09=09=0A___________________________________________________= _______=0AYahoo! India Answers: Share what you know. Learn something new=0A= http://in.answers.yahoo.com/ --0-499964483-1162839610=:56369 Content-Type: text/html; charset=ascii Content-Transfer-Encoding: quoted-printable
Hi Ameet,

We were able to get over with the = unstability in the driver with the following fix in the code

Instead= of fixing the number of sectors to be 2 in the loop, we are actually doing= a read based on the kernel request  like this :

 for(i = =3D xsa_cur_req->current_nr_sectors; i > 0; i-=3Dxsa_cur_req->current_nr_sectors ){
  =             &nb= sp;         xsa_device.req_done =3D= 1;
           &n= bsp;            whil= e ((stat =3D cur_req(&SysAce, sector,
       =             &nb= sp;            =         xsa_cur_req->current_nr_sectors ,
    &= nbsp;           &nbs= p;            &= nbsp;          buffer)) =3D=3D= XST_DEVICE_BUSY)
         =             &nb= sp;          xsa_short_delay()= ;


Now the driver is stable with all the filesystem commands.
=
Please test this out and if appropriate patch this to the driver code.

Thanks
Junita

----- Original Message ----From: Ameet Patil <ammubhai@gmail.com>
To: agnel juni <junijo= seph@yahoo.co.in>
Cc: linuxppc-embedded@ozlabs.org
Sent: Thursday,= 26 October, 2006 1:00:48 AM
Subject: Re: System ACE driver - for 2.6 ke= rnel - need help to understand xsa_thread

Hi Junita,
 &= nbsp;  Its a hack really! When I was developing/porting the SysAc= e driver
to 2.6 I tried to maintain the code as is from the 2.4 kernel = driver. In
doing so I found that there is a slight difference between t= he two
kernels. i.e. I am not sure why, but the sysace device can only = handle
requests for 2 sectors at a time. This was fine in the 2.4 as th= e kernel
always requested 2 sectors. However, in 2.6 I found that this = is
different: the requests are 8 secs. or more. I tried to fix this in = vain
by changing several parameters of the driver during initialization.
Anywa= y, due to several issues I didn't try hard to fix it at that time.

H= ence this hack: No matter how many sec. req. I get from the kernel, I
u= se a loop to req. only 2 secs. at a time. The xsa_device.req_done is
us= ed as a flag and reset in the XSA IRQ IIRC.

If you find a better app= roach, please do update me. Hope this helps!

cheers,
-Ameet
agnel juni wrote:
>
> Hello all
>
> I am trying= to understand the parameters that are sent through "cur_req"
> func= tion used in funtion xsa_thread in System ACE driver.
>
> In x= sa_thread function in the System ACE driver ,
>
> In 2.4 kerne= l:
> --------------------
> while ((stat =3D cur_req(&SysAc= e, sector,
>          = ;            &n= bsp;            = ;     CURRENT->current_nr_sectors,
> = ;            &n= bsp;            = ;            &n= bsp; CURRENT->buffer)) =3D=3D XST_DEVICE_BUSY)
>  &= nbsp;           &nbs= p;          xsa_short_delay();=
>
>  
> Where as in 2.6 kernel this is change= d to
> --------------------------------------------------------------= -
>
> for(i =3D xsa_cur_req->current_nr_sectors; i > 0; i-=3D2){
>         &nbs= p;            &= nbsp;  xsa_device.req_done =3D 1;
>     = ;            &n= bsp;       while ((stat =3D cur_req(&SysA= ce, sector,
>         &n= bsp;            = ;            &n= bsp;      2,
>     =             &nb= sp;            =            buffer)) =3D= =3D XST_DEVICE_BUSY)
>        &n= bsp;            = ;            xsa_sho= rt_delay();
> #endif
>
> Ameet , could you help me under= stand the impact of the parameters,
> especailly the 3rd paramter wh= ich is hardcoded in 2.6 kernel.It would be
> great if you could clar= ify this in regard to 'mount' command.
>
> Thanks in advance> Junita
>
>
>
> --------------------------= ----------------------------------------------
> Find out what India = is talking about on - Yahoo! Answers India
> <http://us.rd.yahoo.com/mail/in/yanswers/*http://in.answers.yahoo.com/= >
> Send FREE SMS to your friend's mobile from Yahoo! Messenge= r Version 8.
> Get it NOW
> <http://= us.rd.yahoo.com/mail/in/messengertagline/*http://in.messenger.yahoo.com= >
>


=0A=09=0A=0A=09=0A=09=09<= hr size=3D1> =0AFind out what India is talking about on - Yaho= o! Answers India
=0ASend FREE SMS to your friend's mobile from Yah= oo! Messenger Version 8. Get it NOW --0-499964483-1162839610=:56369--