I'm not sure if you didn't add in another truncation with the=20
(pInstance->Size* 1024).
Paul L
________________________________
From: Kari Nalli [mailto:ka...@gm...]=20
Sent: Wednesday, July 18, 2007 1:41 AM
To: sdi...@li...
Subject: [Sdio-linux-devel] bug in sdio_memory_os.c?
Hi,
I had some problems with 128MB SD memory card=20
----------------clip from log--------------
[ 443.115173] +SDIO Memory Function: CreateDisk=20
[ 443.119995] SDIO Memory Function: block size 512=20
[ 443.124847 ] SDIO Memory Function: setting block size 512=20
[ 443.130615] SDIO Memory Function: setting up DMA=20
[ 443.135681] SDIO Memory Function: CreateDisk: size 245760 (Size=20
123008, FileSysBlockSize 512)=20
=2E.. and later...=20
[ 445.515045] -SDIO Memory Function: AsyncCompletionLast=20
[ 445.521118] p1=20
[ 445.522979] sdmem0: p1 exceeds device capacity
----------------clip from log--------------
Now looking at code on sdio_memory_os.c:=20
set_capacity(pInstance->Config.pGenDisk,pInstance->Size/pInstance-=20
>FileSysBlockSize*1024);
This causes rounding errors and disk size 245760
after changing code to
set_capacity(pInstance-> Config.pGenDisk , (pInstance->Size*=20
1024)/pInstance->FileSysBlockSize);
The 128 MB card is functional (card has only one partition) and=20
/sys/block/sdmem0/sdmem0p1# more size -> 245919 sectors which is bigger=20
than originally calculated (245760)=20
So is this bug on driver or is there some reason way calculation was=20
originally done way it was?
BR, Kari
|