DMA errors prevent first boot from CF card
-
Earlier today I was trying to install pfSense on my Watchguard x700 using a 2GB Sandisk Ultra CF card and I ran in to a few problems.
First, it seems CF shrinkage continues as the 2GB image overran the card. I installed the 1GB image and moved on, as I really don't have a reason to care between the two.
Second and to the point of this thread, once I got past that and had the system booting it started spewing ATA errors when it tried to mount the CF card and eventually dropped me in to a mountroot prompt.
The error was
ata0: error issuing READ_DMA command ata0: timeout waiting to issue command
A bit of Google led me to a blog post discussing this error on some CF installs of FreeBSD (http://www.bramschoenmakers.nl/en/node/85) and a thread here discussing another Watchguard install (http://forum.pfsense.org/index.php?topic=47209.0). Both noted disabling DMA via hw.ata.ata_dma="0" as a possible solution and the thread here claimed that this was set by default on the nanoBSD images like I was using (pfSense-2.1-BETA1-1g-i386-nanobsd_vga-20130215-1543.img).
I checked, and sure enough this was not set in loader.conf in the image I was using.
Setting it also turned out to be a pain. Apparently UFS is unfamiliar to all my Linux boxes, Ubuntu doesn't support UFS read/write without a kernel recompile and it couldn't even mount this read-only. Obviously Windows boxes aren't helpful here either, though I'm kicking myself now in hindsight for not trying my MBP since I recall OS X supporting UFS at some point. No idea whether it still does. Anyways after failing to get straight FreeBSD to boot in VirtualBox I just used a pfSense VM and attached my card reader via USB. A bit of futzing around from the console to add that DMA line and I finally had a bootable CF card.
It seems this is not being set properly in these images for whatever reason. It looks like it's been in the source for the good part of a decade based on Github, so why that's not making it through the image build process is probably the question here.
-
http://doc.pfsense.org/index.php/Boot_Troubleshooting#NanoBSD_on_Newer_Hardware has some info on how to set those values at the loader prompt so you can boot and then edit them into the correct file.
Which exact image did you use? (nanobsd? nanobsd+vga? from snapshots or somewhere else?)
As far as I know the images do have the correct values in them (check /boot/loader.conf and /boot/loader.conf.local ) but I'd have to check the exact image you used to confirm it for sure.
-
http://doc.pfsense.org/index.php/Boot_Troubleshooting#NanoBSD_on_Newer_Hardware has some info on how to set those values at the loader prompt so you can boot and then edit them into the correct file.
Which exact image did you use? (nanobsd? nanobsd+vga? from snapshots or somewhere else?)
As far as I know the images do have the correct values in them (check /boot/loader.conf and /boot/loader.conf.local ) but I'd have to check the exact image you used to confirm it for sure.
I used this file from snapshots: pfSense-2.1-BETA1-1g-i386-nanobsd_vga-20130215-1543.img
I incorrectly selected the VGA version, obviously on a Firebox I didn't really want that, but that's not really related to the issue in this case.
Unfortunately this device doesn't do POST or bootloader on serial, so boot messages after the loader are the first things I see. Changing anything in the loader is a no-go.
-
The VGA images don't have that in loader.conf because the VGA images are meant for devices that can support those things.
If you don't have VGA, then reload with a non-VGA nanobsd image. -
Jim, surely the fact that those devices have VGA hardware does not necessarily mean they support DMA for CF cards though? :-
The problem as I understand it is that the DMA lines to the CF card are physically missing in many adapters or on board slots yet the card still reports itself as being DMA enabled.
Here's a good explaination: http://www.fccps.cz/download/adv/frr/cf.html
This isn't the first report of DMA problems on Nano+VGA I've read.
In this particular case it is simply the wrong image being used though. ;)Steve
-
It's not 1:1 but it's close enough. The other direction is the decider though:
Serial console only means it's more likely to not support DMA. At least for things like ALIX, WRAP, older Soekris (net5xxx and older), and so on.
-
Ok. Is there any issue with disabling DMA on Nano+VGA though?
I would have thought the performance decsrease would be minimal and mostly at boot time anyway.Steve
-
It depends on the hardware (VGA or no VGA doesn't really matter there)
Soekris net6501 behaves really erratically with DMA off. It won't even boot on certain disks, especially mSATA. That's why I made the doc wiki entry linked earlier in the thread.
-
Ah, fair enough.
Steve