Page 1 of 1

Transfer mode not working?

Posted: 15 Aug 2013 08:48
by alexey123
I use CF card connected to IDE slot as system disk for working NAS4Free server.
# dmesg | grep ada0
ada0 at ata0 bus 0 scbus0 target 0 lun 0
ada0: <SILICON POWER 20110927> ATA-7 device
ada0: 100.000MB/s transfers (UDMA5, PIO 512bytes)
ada0: 3831MB (7847280 512 byte sectors: 16H 63S/T 7785C)
My system
NAS4Free 9.1.0.1 (revision 804) x86-embedded
KM400 AWRDACPI AMD Sempron(tm) 2200+ 992MiB RAM

bus=1 hubaddr=1 port=0 devaddr=2 interface=0 bus=1 hubaddr=1 port=0 devaddr=2 interface=1 Generic IEEE 802.3u media interface VIA VT6202 USB 2.0 controller VIA 83C572 USB controller PLIP network interface VIA 8235 UDMA133 controller RTL8169S/8110S/8211 1000BASE-T media interface

But, transfer speed on tab Disks|Management|Disk|Edit not limit transfer speed.
<disk>
<uuid>866c201e-2697-4ba9-8c3e-01194fdfcc6e</uuid>
<name>ada0</name>
<devicespecialfile>/dev/ada0</devicespecialfile>
<harddiskstandby>0</harddiskstandby>
<acoustic>0</acoustic>
<fstype>ufs</fstype>
<apm>0</apm>
<transfermode>PIO1</transfermode>
<type>IDE</type>
<desc>SILICON POWER 20110927</desc>
<size>3832MB</size>
<serial>20090410</serial>
<smart>
<extraoptions/>
</smart>
</disk>
I need limit my transfer speed, because this is compact flash
Write test
# dd if=/dev/zero of=/mnt/flash/test.bin bs=512 count=10000
10000+0 records in
10000+0 records out
5120000 bytes transferred in 1.114443 secs (4594223 bytes/sec)
Read test
# dd of=/dev/zero if=/mnt/flash/test.bin
10000+0 records in
10000+0 records out
5120000 bytes transferred in 0.036192 secs (141467029 bytes/sec)

Re: Transfer mode not working?

Posted: 15 Aug 2013 13:07
by RedAntz
alexey123 wrote: I need limit my transfer speed, because this is compact flash
If I read this correctly, I do not know how to limit your CF card transfer speed.

Re: Transfer mode not working?

Posted: 15 Aug 2013 14:47
by raulfg3
Use a 40 pin old flat IDE cable to limit transfer speed.
Use short cable that You have.

Re: Transfer mode not working?

Posted: 15 Aug 2013 15:16
by alexey123
raulfg3 wrote:Use a 40 pin old flat IDE cable to limit transfer speed.
Use short cable that You have.
I not use cable, I use direct connected adapter such as
Image

Power supply repaired by July, motherboard capasitors replaced by March.. I replace full version to embedded, because full version was freeze.
Currently: sometimes I have message such in this post, from new CF card.
Sometimes = one week without messages, yesterday I receive more then 100 times, today without mesages

Code: Select all

(ada0:ata0:0:0:0): READ_DMA. ACB: c8 00 5f ba 01 40 00 00 00 00 20 00
(ada0:ata0:0:0:0): CAM status: Command timeout
(ada0:ata0:0:0:0): Retrying command
Such messages I received from old 2.5 inch disks.
-------------------------------
Camcontrol for CF

Code: Select all

# camcontrol identify ada0
pass0: <SILICON POWER 20110927> ATA-7 device
pass0: 100.000MB/s transfers (UDMA5, PIO 512bytes)

protocol              ATA/ATAPI-7
device model          SILICON POWER
firmware revision     20110927
serial number         20090410
cylinders             7785
heads                 16
sectors/track         63
sector size           logical 512, physical 512, offset 0
CFA supported
LBA supported         7847280 sectors
LBA48 not supported
PIO supported         PIO4
DMA supported         WDMA2 UDMA5

Feature                      Support  Enabled   Value           Vendor
read ahead                     no       no
write cache                    yes      yes
flush cache                    yes      no
overlap                        no
Tagged Command Queuing (TCQ)   no       no
Native Command Queuing (NCQ)   no
SMART                          no       no
microcode download             no       no
security                       no       no
power management               yes      no
advanced power management      yes      no      0/0x00
automatic acoustic management  no       no
media status notification      no       no
power-up in Standby            no       no
write-read-verify              no       no
unload                         no       no
free-fall                      no       no
data set management (TRIM)     no
I think such behavior because CF card not have ram buffer, as hard disk, it need reduce speed.

Re: Transfer mode not working?

Posted: 15 Aug 2013 19:07
by alexey123
I find solution. If I add to loader.conf (loader.conf.local) :D string

Code: Select all

hw.ata.ata_dma=0
I swich CF to PIO4 mode.
If I define

Code: Select all

hw.ata.ata_dma=1
swich it to UDMA 5 mode
Result
$ dmesg | grep ada0
ada0 at ata0 bus 0 scbus0 target 0 lun 0
ada0: <SILICON POWER 20110927> ATA-7 device
ada0: 16.700MB/s transfers (PIO4, PIO 512bytes)
ada0: 3831MB (7847280 512 byte sectors: 16H 63S/T 7785C)
ada0: Previously was known as ad0
GEOM: ada0s1: media size does not match label.
Hmmm, transfer mode over webgui realy not work :!:

Re: Transfer mode not working?

Posted: 19 Jan 2014 12:26
by alexey123
:cry: :evil:
FreeBSD 9.2 - removed last chance reduce IDE Speed!
hw.ata.ata_dma - not working
:evil:

Re: Transfer mode not working?

Posted: 19 Jan 2014 12:47
by apollo567
How about moving to a spare usb stick (of course this is not internal then) ?

Re: Transfer mode not working?

Posted: 19 Jan 2014 12:55
by alexey123
apollo567 wrote:How about moving to a spare usb stick (of course this is not internal then) ?
Not good idea for my HP D530. It have usb1 during boot stage, ~15 minutes for boot.

Re: Transfer mode not working?

Posted: 19 Jan 2014 17:16
by lux
@ alexey123

try 40pin IDE Flash Module --> http://uk.transcend-info.com/industry/p ... &Func1No=1

few Years ago i used CF to IDE Adapter, too & ran into some problems from time to time :evil:

no more problems after switching to IDE 40pin Flash Module ;)

Re: Transfer mode not working?

Posted: 19 Jan 2014 17:29
by apollo567
lux wrote:
try 40pin IDE Flash Module --> http://uk.transcend-info.com/industry/p ... &Func1No=1
Thought about this one also, but decided then for a Pico-USB stick. Might be an good idea.
How about a USB 2.0 extention card (check Hardware compatibility of the chipset!) ?

Regards
apollo

Re: Transfer mode not working?

Posted: 20 Jan 2014 16:55
by alexey123
I wan't pay any cent!!!
I add to /cf/boot/device.hints value (for my config) :

Code: Select all

hint.ata.1.dev0.mode="PIO4"
And have result ( on FreeBSD )
ada0 at ata1 bus 0 scbus1 target 0 lun 0
ada0: <Hitachi HDS721680PLAT80 P21OA85A> ATA-7 device
ada0: 16.700MB/s transfers (PIO4, PIO 8192bytes)
I go to check NAS4Free - It work
Before
$ dmesg | grep ada0
ada0 at ata1 bus 0 scbus1 target 0 lun 0
ada0: <Hitachi HDS721680PLAT80 P21OA85A> ATA-7 device
ada0: 133.000MB/s transfers (UDMA6, PIO 8192bytes)
ada0: 78533MB (160836480 512 byte sectors: 16H 63S/T 16383C)
ada0: Previously was known as ad2
After
$ dmesg | grep ada0
ada0 at ata1 bus 0 scbus1 target 0 lun 0
ada0: <Hitachi HDS721680PLAT80 P21OA85A> ATA-7 device
ada0: 16.700MB/s transfers (PIO4, PIO 8192bytes)
ada0: 78533MB (160836480 512 byte sectors: 16H 63S/T 16383C)
ada0: Previously was known as ad2
How to check CF ( or old 2.5 inch disk) , connected to IDE:

Code: Select all

camcontrol identify adaN
Check supported modes, for my tested disk :
PIO supported PIO4
DMA supported WDMA2 UDMA6
And find adress for ata device

Code: Select all

dmesg | grep adaN
Look result
adaN at ataX bus 0 scbus1 target Y lun 0
And compose device hint
hint.ata.X.devY.mode="<supported mode>"
Supported mode is mode, when CF or ide disk not make faults