Problems with ATA_CAM support in RELENG_8

2010-06-30 Thread Paul Mather
I am running FreeBSD/amd64 RELENG_8 on a Dell Optiplex 745.  The hard drive in 
the system is SATA and I have "Normal", not "Legacy" SATA support enabled in 
the BIOS.  (BIOS is V2.6.4.)  I am assuming this will enable native AHCI mode 
for the drive.

I built a kernel with ATA_CAM support, but for some reason the SATA drive is 
probing at slow, UDMA2, speeds:

ada0 at ata2 bus 0 scbus0 target 0 lun 0
ada0:  ATA-7 SATA 2.x device
ada0: 33.300MB/s transfers (UDMA2, PIO 8192bytes)
ada0: 152587MB (31250 512 byte sectors: 16H 63S/T 16383C)

When I run "camcontrol identify" on the drive, it states the drive is capable 
of UDMA6 speeds:

backup# camcontrol identify ada0
pass0:  ATA-7 SATA 2.x device
pass0: 33.300MB/s transfers (UDMA2, PIO 8192bytes)

protocol  ATA/ATAPI-7 SATA 2.x
device model  ST3160812AS
firmware revision 3.ADJ
serial number 5LS8PPDD
cylinders 16383
heads 16
sectors/track 63
sector size   logical 512, physical 512, offset 0
LBA supported 268435455 sectors
LBA48 supported   31250 sectors
PIO supported PIO4
DMA supported WDMA2 UDMA6 

Feature  Support  EnableValue   Vendor
read ahead yes  yes
write cacheyes  yes
flush cacheyes  yes
overlapno
Tagged Command Queuing (TCQ)   no   no
Native Command Queuing (NCQ)   yes  32 tags
SMART  yes  yes
microcode download yes  yes
security   yes  no
power management   yes  yes
advanced power management  no   no  65278/0xFEFE
automatic acoustic management  yes  yes 254/0xFE208/0xD0
media status notification  no   no
power-up in Standbyno   no
write-read-verify  no   no  0/0x0
unload no   no
free-fall  no   no
data set management (TRIM) no


So, why the slower speed?  Also, "camcontrol identify" states the drive 
supports NCQ with up to 32 tags supported, yet "camcontrol tags ada0" reports 
only 1 device opening, not 32 as I would expect:

backup# camcontrol tags ada0
(pass0:ata2:0:0:0): device openings: 1

To enable ATA_CAM AHCI support, I included this in my kernel config file:

# ATA and ATAPI devices
options ATA_CAM
device  ahci
device  atacore
device  atapci
options ATA_STATIC_ID   # Static device numbering

Is this the correct way to enable ATA_CAM AHCI support?  I tried initially 
including just "options ATA_CAM" and "device ahci" but the resultant kernel 
would not probe my disk drive as ada0.

Does my problem lie with my kernel config or is the Dell Optiplex 745 BIOS 
brain dead when it comes to AHCI native support?  The only option it appears to 
have in the BIOS is "Normal" and "Legacy" when it comes to the SATA controller 
mode.

I've attached my full kernel config and dmesg at the end of this e-mail.

Cheers,

Paul.

Kernel config:

#
# GENERIC -- Generic kernel configuration file for FreeBSD/amd64
#
# For more information on this file, please read the config(5) manual page,
# and/or the handbook section on Kernel Configuration Files:
#
#
http://www.FreeBSD.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig-config.html
#
# The handbook is also available locally in /usr/share/doc/handbook
# if you've installed the doc distribution, otherwise always see the
# FreeBSD World Wide Web server (http://www.FreeBSD.org/) for the
# latest information.
#
# An exhaustive list of options and more detailed explanations of the
# device lines is also present in the ../../conf/NOTES and NOTES files.
# If you are in doubt as to the purpose or necessity of a line, check first
# in NOTES.
#
# $FreeBSD: src/sys/amd64/conf/GENERIC,v 1.531.2.13 2010/05/02 06:24:17 imp Exp 
$

cpu HAMMER
ident   VPN

# To statically compile in device wiring instead of /boot/device.hints
#hints  "GENERIC.hints" # Default places to look for devices.

# Use the following to compile in values accessible to the kernel
# through getenv() (or kenv(1) in userland). The format of the file
# is 'variable=value', see kenv(1)
#
# env   "GENERIC.env"

#makeoptionsDEBUG=-g# Build kernel with gdb(1) debug symbols

options SCHED_ULE   # ULE scheduler
options PREEMPTION  # Enable kernel thread preemption
options INET# InterNETworking
options INET6   # IPv6 communications protocols
options SCTP# Stream Control Transmission Protocol
options FFS # Berkeley Fast Filesystem
options SOFTUPDATES # Enable FFS soft updates support
options UFS_ACL # Support for 

Re: Problems with ATA_CAM support in RELENG_8

2010-06-30 Thread Jeremy Chadwick
On Wed, Jun 30, 2010 at 12:07:54PM -0400, Paul Mather wrote:
> I am running FreeBSD/amd64 RELENG_8 on a Dell Optiplex 745.  The hard drive 
> in the system is SATA and I have "Normal", not "Legacy" SATA support enabled 
> in the BIOS.  (BIOS is V2.6.4.)  I am assuming this will enable native AHCI 
> mode for the drive.

That isn't correct.  Some Dell OptiPlex systems explicitly have an AHCI
option in their BIOS for enabling/disabling AHCI.  I do not believe the
745 offers this capability, which means no AHCI is available.  (We use
these OptiPlex models at my workplace so I'm familiar with them)

> I built a kernel with ATA_CAM support, but for some reason the SATA drive is 
> probing at slow, UDMA2, speeds:

I don't know anything about this option, but the "common" way to get ATA
to utilise SCSI CAM is to enable AHCI in one's system BIOS and load the
ahci.ko (not ataahci.ko) driver using /boot/loader.conf
(ahci_load="yes") or "load ahci" from the loader "OK" prompt.  That's
literally all you need.

In your case since you don't have AHCI available, you're probably going
to have to stick to using standard ata(4) (read: remove ATA_CAM and ahci
from your kernel configuration).

Be aware ahci.ko IS NOT the same thing as ataahci.ko.  The latter adds
AHCI support but via the classic ata(4) layer (meaning: AHCI without
SCSI CAM.  This also lacks NCQ support, but does gain you hot-swap
capability).

> Does my problem lie with my kernel config or is the Dell Optiplex 745
> BIOS brain dead when it comes to AHCI native support?  The only option
> it appears to have in the BIOS is "Normal" and "Legacy" when it comes
> to the SATA controller mode.

It's not "brain dead".  "Normal" is not the same thing as AHCI.
"Normal" tells the controller to run in standard SATA mode, "Legacy"
causes the controller to emulate classic PATA (literally you'll see PATA
controllers show up on IRQs 14 and 15, etc.).

Validation that your system doesn't have AHCI enabled/doesn't have AHCI
available is here:

> atapci0:  port 
> 0xfe00-0xfe07,0xfe10-0xfe13,0xfe20-0xfe27,0xfe30-0xfe33,0xfec0-0xfecf,0xecc0-0xeccf
>  irq 20 at device 31.2 on pci0
> atapci0: [ITHREAD]
> ata2:  on atapci0
> ata2: [ITHREAD]
> ata3:  on atapci0
> ata3: [ITHREAD]
> atapci1:  port 
> 0xfe40-0xfe47,0xfe50-0xfe53,0xfe60-0xfe67,0xfe70-0xfe73,0xfed0-0xfedf,0xecd0-0xecdf
>  irq 20 at device 31.5 on pci0
> atapci1: [ITHREAD]
> ata4:  on atapci1
> ata4: [ITHREAD]
> ata5:  on atapci1
> ata5: [ITHREAD]

An AHCI-enabled controller, with a system using ahci.ko, will look like
this:

ahci0:  port 
0x1c50-0x1c57,0x1c44-0x1c47,0x1c48-0x1c4f,0x1c40-0x1c43,0x18e0-0x18ff mem 
0xdc000800-0xdc000fff irq 17 at device 31.2 on pci0
ahci0: [ITHREAD]
ahci0: AHCI v1.20 with 6 3Gbps ports, Port Multiplier supported
ahcich0:  at channel 0 on ahci0
ahcich0: [ITHREAD]
ahcich1:  at channel 1 on ahci0
ahcich1: [ITHREAD]
ahcich2:  at channel 2 on ahci0
ahcich2: [ITHREAD]
ahcich3:  at channel 3 on ahci0
ahcich3: [ITHREAD]
ahcich4:  at channel 4 on ahci0
ahcich4: [ITHREAD]
ahcich5:  at channel 5 on ahci0
ahcich5: [ITHREAD]

-- 
| Jeremy Chadwick   j...@parodius.com |
| Parodius Networking   http://www.parodius.com/ |
| UNIX Systems Administrator  Mountain View, CA, USA |
| Making life hard for others since 1977.  PGP: 4BD6C0CB |

___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"


Re: Problems with ATA_CAM support in RELENG_8

2010-06-30 Thread Paul Mather
On Jun 30, 2010, at 1:38 PM, Alexander Motin wrote:

>> To enable ATA_CAM AHCI support, I included this in my kernel config file:
>> 
>> # ATA and ATAPI devices
>> options ATA_CAM
>> device  ahci
>> device  atacore
>> device  atapci
>> options ATA_STATIC_ID   # Static device numbering
>> 
>> Is this the correct way to enable ATA_CAM AHCI support?  I tried
>> initially including just "options ATA_CAM" and "device ahci" but the
>> resultant kernel would not probe my disk drive as ada0.
> 
> Your controller seems to not report AHCI support. In such case legacy
> mode driver attaches to it. But as soon as you have no `device ataintel`
> line, only generic driver was there, limited by UDMA2 mode.
> 
> PS: ATA_STATIC_ID is useless when ATA_CAM option enabled.

Thank you (and Jeremy Chadwick) for the help and information.  The kernel 
configuration options I used above were taken from a VirtualBox FreeBSD/amd64 
install I have that I converted over to ATA_CAM when the code first went into 
RELENG_8 and it wasn't exactly clear at the time what options were absolutely 
required.  (I'm not even sure that "options ATA_CAM" is needed any more, given 
"device ahci" implies it.)

>> Does my problem lie with my kernel config or is the Dell Optiplex 745
>> BIOS brain dead when it comes to AHCI native support?  The only option
>> it appears to have in the BIOS is "Normal" and "Legacy" when it comes
>> to the SATA controller mode.
> 
> Your controller is not identified as AHCI:
> 
>> atapci0:  port
>> 0xfe00-0xfe07,0xfe10-0xfe13,0xfe20-0xfe27,0xfe30-0xfe33,0xfec0-0xfecf,0xecc0-0xeccf
>> irq 20 at device 31.2 on pci0
>> atapci0: [ITHREAD]
>> ata2:  on atapci0
>> ata2: [ITHREAD]
>> ata3:  on atapci0
>> ata3: [ITHREAD]
>> atapci1:  port
>> 0xfe40-0xfe47,0xfe50-0xfe53,0xfe60-0xfe67,0xfe70-0xfe73,0xfed0-0xfedf,0xecd0-0xecdf
>> irq 20 at device 31.5 on pci0
>> atapci1: [ITHREAD]
>> ata4:  on atapci1
>> ata4: [ITHREAD]
>> ata5:  on atapci1
>> ata5: [ITHREAD]
> 
> You may check `pciconf -lvcb` output. For ICH8 with AHCI you should see
> there something like:
> ah...@pci0:0:31:2:  class=0x010601 card=0xa00c14ff chip=0x28298086
> rev=0x03 hdr=0x00
>vendor = 'Intel Corporation'
>device = 'Mobile SATA AHCI Controller'
>class  = mass storage
>subclass   = SATA
>bar   [10] = type I/O Port, range 32, base 0xe880, size  8, enabled
>bar   [14] = type I/O Port, range 32, base 0xe800, size  4, enabled
>bar   [18] = type I/O Port, range 32, base 0xe480, size  8, enabled
>bar   [1c] = type I/O Port, range 32, base 0xe400, size  4, enabled
>bar   [20] = type I/O Port, range 32, base 0xe080, size 32, enabled
>bar   [24] = type Memory, range 32, base 0xfeaff800, size 2048, enabled
>cap 05[80] = MSI supports 4 messages enabled with 4 messages
>cap 01[70] = powerspec 3  supports D0 D3  current D0
>cap 12[a8] = SATA Index-Data Pair
> 
> Pay attention to "subclass = SATA".

Then that's where my problem lies:

atap...@pci0:0:31:2:class=0x01018f card=0x01da1028 chip=0x28208086 rev=0x02 
hdr=0x00
vendor = 'Intel Corporation'
device = 'SATA IDE Controller:4 port (82801HB/HR/HH/HO)'
class  = mass storage
subclass   = ATA
bar   [10] = type I/O Port, range 32, base 0xfe00, size  8, enabled
bar   [14] = type I/O Port, range 32, base 0xfe10, size  4, enabled
bar   [18] = type I/O Port, range 32, base 0xfe20, size  8, enabled
bar   [1c] = type I/O Port, range 32, base 0xfe30, size  4, enabled
bar   [20] = type I/O Port, range 32, base 0xfec0, size 16, enabled
bar   [24] = type I/O Port, range 32, base 0xecc0, size 16, enabled
cap 01[70] = powerspec 3  supports D0 D3  current D0

atap...@pci0:0:31:5:class=0x010185 card=0x01da1028 chip=0x28258086 rev=0x02 
hdr=0x00
vendor = 'Intel Corporation'
device = '82801H (ICH8 Family) 2 port SATA Controller'
class  = mass storage
subclass   = ATA
bar   [10] = type I/O Port, range 32, base 0xfe40, size  8, enabled
bar   [14] = type I/O Port, range 32, base 0xfe50, size  4, enabled
bar   [18] = type I/O Port, range 32, base 0xfe60, size  8, enabled
bar   [1c] = type I/O Port, range 32, base 0xfe70, size  4, enabled
bar   [20] = type I/O Port, range 32, base 0xfed0, size 16, enabled
bar   [24] = type I/O Port, range 32, base 0xecd0, size 16, enabled
cap 01[70] = powerspec 3  supports D0 D3  current D0


I thought ICH8 supported AHCI, but maybe it's only ICH8R that does?  I'm 
assuming that "subclass = ATA" means the controller can't operate in AHCI mode. 
 The BIOS setting is also confusing.  It has two options, "Normal" and 
"Legacy."  "Normal" mode says, "The hard drive controller is configured for 
native mode.  This mode provides the highest drive performance and most 
flexibility."  I guess I misinterpreted "native mode" to be AHCI mode.

Thanks again for the help and for clearing things up.

Cheer

Re: Problems with ATA_CAM support in RELENG_8

2010-06-30 Thread Alexander Motin
Paul Mather wrote:
>> PS: ATA_STATIC_ID is useless when ATA_CAM option enabled.
> 
> Thank you (and Jeremy Chadwick) for the help and information.  The kernel 
> configuration options I used above were taken from a VirtualBox FreeBSD/amd64 
> install I have that I converted over to ATA_CAM when the code first went into 
> RELENG_8 and it wasn't exactly clear at the time what options were absolutely 
> required.  (I'm not even sure that "options ATA_CAM" is needed any more, 
> given "device ahci" implies it.)

`options ATA_CAM` enables CAM wrapper for legacy drivers, which gave you
adaX devices instead of adX. It doesn't give major benefits, just
unifies behavior.

> I thought ICH8 supported AHCI, but maybe it's only ICH8R that does? 

All ICH8 support AHCI, though not all BIOSes initialize them
respectively. The only benefit of ICH8R is a port multipliers support,
though it also seems to be artificial limitation - I've seen BIOS
allowing it on regular ICH8.

> I'm assuming that "subclass = ATA" means the controller can't operate in AHCI 
> mode. 

Yes. At least it is not configured to do so.

> The BIOS setting is also confusing.  It has two options, "Normal" and 
> "Legacy."  "Normal" mode says, "The hard drive controller is configured for 
> native mode.  This mode provides the highest drive performance and most 
> flexibility."  I guess I misinterpreted "native mode" to be AHCI mode.

"Native" mode means that ATA controllers works as normal PCI device. In
"Legacy" mode controller uses legacy ISA I/O ports and IRQs.

-- 
Alexander Motin
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"


Re: Problems with ATA_CAM support in RELENG_8

2010-06-30 Thread Jeremy Chadwick
On Wed, Jun 30, 2010 at 04:52:22PM -0400, Paul Mather wrote:
> I thought ICH8 supported AHCI, but maybe it's only ICH8R that does?

No, not necessarily.  There are ICHxx (non-ICHxxR) models which
definitely provide AHCI (ex. ICHxxM for their Mobile chipsets; yes, many
laptops do have AHCI capability).  Thus there are many different
sub-models of ICH8, in addition to different perf/chip revisions of
ICH8.  Specification details:

http://www.intel.com/assets/pdf/datasheet/313056.pdf
http://www.intel.com/design/chipsets/specupdt/313057.htm

Dell very likely chose not to engineer this particular motherboard to
not provide AHCI capability (Option ROM space (usually included with the
system BIOS), PCI and ICH8 register setups (done by the BIOS), etc.)).
I know Gigabyte has done this with some of their boards as well.

If you have concerns that your motherboard provides features that you
can't use, you need to contact Dell.

> I'm assuming that "subclass = ATA" means the controller can't operate
> in AHCI mode.  The BIOS setting is also confusing.  It has two
> options, "Normal" and "Legacy."  "Normal" mode says, "The hard drive
> controller is configured for native mode.  This mode provides the
> highest drive performance and most flexibility."  I guess I
> misinterpreted "native mode" to be AHCI mode.

"Native", "Normal", and "Enhanced" are all terms used to describe the
controller operating in standard SATA (non-AHCI) fashion.  Dell's
in-BIOS description is nothing but schmooze; it's not the same as AHCI.
"Legacy" just means the controller appears and operates purely in
PATA-esque mode, so that you can use SATA drives on systems which don't
have SATA chipset drivers (ex. MS-DOS).

To get an idea of what an AHCI-capable board offers via the BIOS, you
should review the following manual for a Supermicro ICH7-based system.
This chipset is older than yours, chosen for sake of example.  See
Chapter 7-3, section "Main Setup Features":

http://www.supermicro.com/manuals/superserver/1U/MNL-0813.pdf

Furthermore, I can assure you that the Dell OptiPlex 745 Mini-Tower
offers AHCI capability, and toggling its use via the system BIOS.  You
won't find it mentioned in Dell's "Tech Specs" PDF about this though.  I
realise this is not the system you have, but I'm simply pointing out
that it's a board manufacturer decision whether or not to provide the
capability, and that their decision obviously changed over the years.

-- 
| Jeremy Chadwick   j...@parodius.com |
| Parodius Networking   http://www.parodius.com/ |
| UNIX Systems Administrator  Mountain View, CA, USA |
| Making life hard for others since 1977.  PGP: 4BD6C0CB |

___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"


Re: Problems with ATA_CAM support in RELENG_8

2010-06-30 Thread Akihiko Taniguchi
xc
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"


Re: Problems with ATA_CAM support in RELENG_8

2010-07-01 Thread Paul Mather
On Jun 30, 2010, at 5:18 PM, Alexander Motin wrote:

> Paul Mather wrote:
>>> PS: ATA_STATIC_ID is useless when ATA_CAM option enabled.
>> 
>> Thank you (and Jeremy Chadwick) for the help and information.  The kernel 
>> configuration options I used above were taken from a VirtualBox 
>> FreeBSD/amd64 install I have that I converted over to ATA_CAM when the code 
>> first went into RELENG_8 and it wasn't exactly clear at the time what 
>> options were absolutely required.  (I'm not even sure that "options ATA_CAM" 
>> is needed any more, given "device ahci" implies it.)
> 
> `options ATA_CAM` enables CAM wrapper for legacy drivers, which gave you
> adaX devices instead of adX. It doesn't give major benefits, just
> unifies behavior.

So, does that mean if you omit "options ATA_CAM" and have "device ahci" you 
will get adX devices, not adaX devices?  In other words, if you have "device 
ahci" (or "device siis" or "device mvs") will you will always get adaX devices, 
whether or not you have "options ATA_CAM" in your kernel config file?

Does "options ATA_CAM" work with "device ata" or the modular ATA subsystem?  Is 
that the intended use of "options ATA_CAM": to provide adaX devices and a CAM 
interface for accessing ATA devices?

Cheers,

Paul.___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"


Re: Problems with ATA_CAM support in RELENG_8

2010-07-01 Thread Jeremy Chadwick
On Thu, Jul 01, 2010 at 08:26:31AM -0400, Paul Mather wrote:
> On Jun 30, 2010, at 5:21 PM, Jeremy Chadwick wrote:
> >> I'm assuming that "subclass = ATA" means the controller can't operate
> >> in AHCI mode.  The BIOS setting is also confusing.  It has two
> >> options, "Normal" and "Legacy."  "Normal" mode says, "The hard drive
> >> controller is configured for native mode.  This mode provides the
> >> highest drive performance and most flexibility."  I guess I
> >> misinterpreted "native mode" to be AHCI mode.
> > 
> > "Native", "Normal", and "Enhanced" are all terms used to describe the
> > controller operating in standard SATA (non-AHCI) fashion.  Dell's
> > in-BIOS description is nothing but schmooze; it's not the same as AHCI.
> > "Legacy" just means the controller appears and operates purely in
> > PATA-esque mode, so that you can use SATA drives on systems which don't
> > have SATA chipset drivers (ex. MS-DOS).
> 
> Thank you for helping clear that up.  I have a Supermicro
> X8ST3-F-based server here, and it offers three choices for drive mode:
> IDE, RAID, and AHCI.  I think it's much clearer, there, what you're
> getting.  Dell could learn a thing or two from them. :-)

It's a matter of demographic -- Dell often caters to home/residential
users, while Supermicro caters to engineers, SAs, and other highly
technical folk.  The latter excludes "gamers" or "tech forum freaks";
these two rarely, if ever, actually program or interface with the
devices or chips they're talking about.  Speculation on my part, but I'm
sure if you Google for "ICH8 ACHI" you'll find hundreds of posts on
random forums, and most of these posts will do nothing but confuse.  :-)

Dell started adding more technically-savvy options to their later
models, probably because of pressure from the above two groups, or
competitive pressure.  Hard to say.

> > Furthermore, I can assure you that the Dell OptiPlex 745 Mini-Tower
> > offers AHCI capability, and toggling its use via the system BIOS.  You
> > won't find it mentioned in Dell's "Tech Specs" PDF about this though.  I
> > realise this is not the system you have, but I'm simply pointing out
> > that it's a board manufacturer decision whether or not to provide the
> > capability, and that their decision obviously changed over the years.
> 
> Oddly enough, it *is* a Dell OptiPlex 745 in Mini-Tower configuration.
> This is the manual I'm led to via the service tag:
> http://support.dell.com/support/edocs/systems/op745/en/UG_en/mtindex.htm
> 
> Are you saying there is an option in the BIOS to enable AHCI on these
> systems?

Sorry for inducing confusion -- I meant the Dell OptiPlex 760.

At my workplace we literally have 4 different Dell OptiPlex models in
use as workstations.  I often mix up the model numbers, case in point.

I'm re-CC'ing the mailing list here, because I want to make sure my
mistake gets noted in case someone ends up searching the lists ("Hey! I
have a 745, what is this guy talking about?!?")

-- 
| Jeremy Chadwick   j...@parodius.com |
| Parodius Networking   http://www.parodius.com/ |
| UNIX Systems Administrator  Mountain View, CA, USA |
| Making life hard for others since 1977.  PGP: 4BD6C0CB |

___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"


Re: Problems with ATA_CAM support in RELENG_8

2010-07-01 Thread Alexander Motin
Paul Mather wrote:
> On Jun 30, 2010, at 5:18 PM, Alexander Motin wrote:
>> Paul Mather wrote:
 PS: ATA_STATIC_ID is useless when ATA_CAM option enabled.
>>> Thank you (and Jeremy Chadwick) for the help and information.  The kernel 
>>> configuration options I used above were taken from a VirtualBox 
>>> FreeBSD/amd64 install I have that I converted over to ATA_CAM when the code 
>>> first went into RELENG_8 and it wasn't exactly clear at the time what 
>>> options were absolutely required.  (I'm not even sure that "options 
>>> ATA_CAM" is needed any more, given "device ahci" implies it.)
>> `options ATA_CAM` enables CAM wrapper for legacy drivers, which gave you
>> adaX devices instead of adX. It doesn't give major benefits, just
>> unifies behavior.
> 
> So, does that mean if you omit "options ATA_CAM" and have "device ahci" you 
> will get adX devices, not adaX devices?  In other words, if you have "device 
> ahci" (or "device siis" or "device mvs") will you will always get adaX 
> devices, whether or not you have "options ATA_CAM" in your kernel config file?

If you have ahci, siis and mvs drivers in kernel, but no "options
ATA_CAM", you will get adaX devices for native SATA controllers,
supported by these three drivers and adX for other (legacy) ones.

> Does "options ATA_CAM" work with "device ata" or the modular ATA subsystem? 

Both. It is an option of "device atacore", which is part of "device ata"

> Is that the intended use of "options ATA_CAM": to provide adaX devices and a 
> CAM interface for accessing ATA devices?

Yes. It disables ATA peripheral drivers and bus management code,
allowing CAM ones to be used on top of the ATA controller drivers.

-- 
Alexander Motin
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"


Re: Fwd: Problems with ATA_CAM support in RELENG_8

2010-06-30 Thread Alexander Motin
Garrett Cooper wrote:
> I am running FreeBSD/amd64 RELENG_8 on a Dell Optiplex 745.  The hard
> drive in the system is SATA and I have "Normal", not "Legacy" SATA
> support enabled in the BIOS.  (BIOS is V2.6.4.)  I am assuming this
> will enable native AHCI mode for the drive.
> 
> I built a kernel with ATA_CAM support, but for some reason the SATA
> drive is probing at slow, UDMA2, speeds:
> 
> ada0 at ata2 bus 0 scbus0 target 0 lun 0
> ada0:  ATA-7 SATA 2.x device
> ada0: 33.300MB/s transfers (UDMA2, PIO 8192bytes)
> ada0: 152587MB (31250 512 byte sectors: 16H 63S/T 16383C)

> When I run "camcontrol identify" on the drive, it states the drive is
> capable of UDMA6 speeds:
> 
> backup# camcontrol identify ada0
> PIO supported PIO4
> DMA supported WDMA2 UDMA6
> Native Command Queuing (NCQ)   yes  32 tags
> 
> So, why the slower speed?  Also, "camcontrol identify" states the
> drive supports NCQ with up to 32 tags supported, yet "camcontrol tags
> ada0" reports only 1 device opening, not 32 as I would expect:
> 
> backup# camcontrol tags ada0
> (pass0:ata2:0:0:0): device openings: 1

Speed, number of tags and other options limited by lowest of device and
controller capabilities.

> To enable ATA_CAM AHCI support, I included this in my kernel config file:
> 
> # ATA and ATAPI devices
> options ATA_CAM
> device  ahci
> device  atacore
> device  atapci
> options ATA_STATIC_ID   # Static device numbering
> 
> Is this the correct way to enable ATA_CAM AHCI support?  I tried
> initially including just "options ATA_CAM" and "device ahci" but the
> resultant kernel would not probe my disk drive as ada0.

Your controller seems to not report AHCI support. In such case legacy
mode driver attaches to it. But as soon as you have no `device ataintel`
line, only generic driver was there, limited by UDMA2 mode.

PS: ATA_STATIC_ID is useless when ATA_CAM option enabled.

> Does my problem lie with my kernel config or is the Dell Optiplex 745
> BIOS brain dead when it comes to AHCI native support?  The only option
> it appears to have in the BIOS is "Normal" and "Legacy" when it comes
> to the SATA controller mode.

Your controller is not identified as AHCI:

> atapci0:  port
> 0xfe00-0xfe07,0xfe10-0xfe13,0xfe20-0xfe27,0xfe30-0xfe33,0xfec0-0xfecf,0xecc0-0xeccf
> irq 20 at device 31.2 on pci0
> atapci0: [ITHREAD]
> ata2:  on atapci0
> ata2: [ITHREAD]
> ata3:  on atapci0
> ata3: [ITHREAD]
> atapci1:  port
> 0xfe40-0xfe47,0xfe50-0xfe53,0xfe60-0xfe67,0xfe70-0xfe73,0xfed0-0xfedf,0xecd0-0xecdf
> irq 20 at device 31.5 on pci0
> atapci1: [ITHREAD]
> ata4:  on atapci1
> ata4: [ITHREAD]
> ata5:  on atapci1
> ata5: [ITHREAD]

You may check `pciconf -lvcb` output. For ICH8 with AHCI you should see
there something like:
ah...@pci0:0:31:2:  class=0x010601 card=0xa00c14ff chip=0x28298086
rev=0x03 hdr=0x00
vendor = 'Intel Corporation'
device = 'Mobile SATA AHCI Controller'
class  = mass storage
subclass   = SATA
bar   [10] = type I/O Port, range 32, base 0xe880, size  8, enabled
bar   [14] = type I/O Port, range 32, base 0xe800, size  4, enabled
bar   [18] = type I/O Port, range 32, base 0xe480, size  8, enabled
bar   [1c] = type I/O Port, range 32, base 0xe400, size  4, enabled
bar   [20] = type I/O Port, range 32, base 0xe080, size 32, enabled
bar   [24] = type Memory, range 32, base 0xfeaff800, size 2048, enabled
cap 05[80] = MSI supports 4 messages enabled with 4 messages
cap 01[70] = powerspec 3  supports D0 D3  current D0
cap 12[a8] = SATA Index-Data Pair

Pay attention to "subclass = SATA".

-- 
Alexander Motin
___
freebsd-stable@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"