15 Mar, 2011
1 commit
-
Most ata_id_XXX inlines are simple tests, so we should set
the return value to 'bool' here.Signed-off-by: Hannes Reinecke
Signed-off-by: Jeff Garzik
14 Mar, 2011
1 commit
-
As per SAT-3 the WWN ID should be included in the VPD page 0x83
(device identification) emulation.Signed-off-by: Hannes Reinecke
Acked-by: Tejun Heo
Signed-off-by: Jeff Garzik
22 Oct, 2010
1 commit
-
This change enables my x86 machine to recognize and talk to a
"Native 4K" SATA device.When I started working on this, I didn't know Matthew Wilcox had
posted a similar patch 2 years ago:
http://git.kernel.org/?p=linux/kernel/git/willy/ata.git;a=shortlog;h=refs/heads/ata-large-sectorsGwendal Grignou pointed me at the the above code and small portions of
this patch include Matthew's work. That's why Mathew is first on the
"Signed-off-by:". I've NOT included his use of a bitmap to determine
512 vs Native for ATA command block size - just used a simple table.
And bugs are almost certainly mine.Lastly, the patch has been tested with a native 4K 'Engineering
Sample' drive provided by Hitachi GST.Signed-off-by: Matthew Wilcox
Signed-off-by: Grant Grundler
Reviewed-by: Gwendal Grignou
Signed-off-by: Jeff Garzik
20 May, 2010
1 commit
-
struct ata_prd and ap->prd are BMDMA specific. Add bmdma_ prefix to
them and move them inside CONFIG_ATA_SFF.Signed-off-by: Tejun Heo
Signed-off-by: Jeff Garzik
09 Apr, 2010
1 commit
-
Most drives from Seagate, Hitachi, and possibly other brands,
do not allow LBA28 access to sector number 0x0fffffff (2^28 - 1).
So instead use LBA48 for such accesses.This bug could bite a lot of systems, especially when the user has
taken care to align partitions to 4KB boundaries. On misaligned systems,
it is less likely to be encountered, since a 4KB read would end at
0x10000000 rather than at 0x0fffffff.Signed-off-by: Mark Lord
Signed-off-by: Jeff Garzik
02 Mar, 2010
1 commit
-
I have a Delkin Devices compact flash card that isn't being recognized using the
SATA/PATA drivers.
The card is recognized and works with the deprecated ATA drivers.The error I am seeing is:
ata1.00: failed to IDENTIFY (device reports invalid type, err_mask=0x0)I tracked it down to ata_id_is_cfa() in include/linux/ata.h.
The Delkin card has id[0] set to 0x844a and id[83] set to 0.
This isn't what the kernel expects and is probably incorrect.The simplest work-around is to add a check for 0x844a to ata_id_is_cfa().
Signed-off-by: Ben Gardner
Signed-off-by: Jeff Garzik
04 Feb, 2010
1 commit
-
The value we get from the low byte of the ATA_ID_SECTOR_SIZE word is not not
a plain multiple, but the log of it, so fix the helper to give the correct
answer. Without this we'll get an incorrect minimal I/O size in the block
limits VPD page for 4k sector drives.Also change the return value of ata_id_logical_per_physical_sectors to u16
for the unlikely case of very large logical sectors.Signed-off-by: Christoph Hellwig
Signed-off-by: Jeff Garzik
04 Dec, 2009
2 commits
-
ata_set_lba_range_entries used the variable max for two different things
which was confusing. Make the function take a buffer size in bytes as
argument and return the used buffer size upon completion.Signed-off-by: Martin K. Petersen
Signed-off-by: Jeff Garzik -
Our current TRIM payload is a single sector that can accommodate 64 *
65535 blocks being unmapped. Report this value in the Block Limits
Maximum Unmap LBA count field.If a storage device supports TRIM and the DRAT and RZAT bits are set,
report TPRZ=1 in Read Capacity(16).Signed-off-by: Martin K. Petersen
Signed-off-by: Jeff Garzik
03 Dec, 2009
1 commit
-
Add support for the ATA TRIM command in libata. We translate a WRITE SAME 16
command with the unmap bit set into an ATA TRIM command and export enough
information in READ CAPACITY 16 and the block limits EVPD page so that the new
SCSI layer discard support will driver this for us.Note that I hardcode the WRITE_SAME_16 opcode for now as the patch to introduce
the symbolic is not in 2.6.32 yet but only in the SCSI tree - as soon as it is
merged we can fix it up to properly use the symbolic name.Signed-off-by: Christoph Hellwig
Signed-off-by: Jeff Garzik
06 Oct, 2009
2 commits
-
Currently libata-acpi can only filter DIPM among SATA feature enables
via _GTF. This patch adds the capability to filter out FPDMA non-zero
offset, in-order guarantee and auto-activation.Signed-off-by: Tejun Heo
Signed-off-by: Jeff Garzik -
We're about to add more SATA_* and ATA_ACPI_FILTER_* constants.
Reformat them in preparation.Signed-off-by: Tejun Heo
Signed-off-by: Jeff Garzik
02 Sep, 2009
2 commits
-
This patch improve libata's output for error/notification messages
to allow easier comprehension and debugging:When ATAPI commands issued through the SCSI layer fail, use SCSI
functions to print the CDB in human-readable form instead of just
dumping out the CDB in hex.Print out the name of the failed command (as defined by the ATA
specification) in error handling output along with the raw register
contents.When reporting status of ACPI taskfile commands executed on resume,
also output the names of the commands being executed (or not) in
readable form.Since the extra data for printing command names increases kernel
size slightly, a config option has been added to allow disabling
command name output (as well as some of the error register parsing)
for those highly sensitive to kernel text size.Signed-off-by: Robert Hancock
Signed-off-by: Jeff Garzik -
Hopefully results in fewer on-the-wire FIS's and no breakage. We'll see!
Signed-off-by: Shaohua Li
Signed-off-by: Jeff Garzik
16 Jun, 2009
1 commit
-
v2:
Minor fixes per Sergei's review.Cc: Sergei Shtylyov
Cc: Jeff Garzik
Signed-off-by: Bartlomiej Zolnierkiewicz
16 May, 2009
1 commit
-
This patch provides new heuristics for parsing both the form factor and
media rotation rate ATA IDENFITY words.The reported ATA version must be 7 or greater and the device must return
values defined as valid in the standard. Only then are the
characteristics reported to SCSI via the VPD B1 page.This seems like a reasonable compromise to me considering that we have
been shipping several kernel releases that key off the rotation rate bit
without any version checking whatsoever. With no complaints so far.Signed-off-by: Martin K. Petersen
Signed-off-by: Jeff Garzik
07 Apr, 2009
1 commit
-
This is common code shared between the IDE and libata implementations
Signed-off-by: David Woodhouse
Signed-off-by: Matthew Wilcox
Signed-off-by: Jeff Garzik
27 Mar, 2009
1 commit
-
* 'upstream-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/libata-dev: (35 commits)
[libata] Improve timeout handling
[libata] Drain data on errors
pata_sc1200: Activate secondary channel
pata_artop: Serializing support
[libata] ahci: correct enclosure LED state save
[libata] More robust parsing for IDENTIFY DEVICE multi_count field
sata_mv: fix LED blinking for SoC+NCQ
sata_mv: optimize IRQ coalescing for 8-port chips
sata_mv: implement IRQ coalescing (v2)
sata_mv: cosmetic preparations for IRQ coalescing
pata-rb532-cf: platform_get_irq() fix ignored failure
pata_efar: fix *dma_mask
pata_radisys: fix mwdma_mask to exclude mwdma0
[libata] convert drivers to use ata.h mode mask defines
include/linux/ata.h: add some more transfer masks
ahci: Blacklist HP Compaq 6720s that spins off disks during ACPI power off
[libata] sata_mv: Implement direct FIS transmission via mv_qc_issue_fis().
[libata] Export ata_pio_queue_task() so that it can be used from sata_mv.
[libata] sata_mv: Add a new mv_sff_check_status() function to sata_mv.
[libata] sata_mv: Tighten up interrupt masking in mv_qc_issue()
...
25 Mar, 2009
2 commits
-
Signed-off-by: Erik Inge Bolsø
Signed-off-by: Jeff Garzik -
do_identify() marks EXABYTENEST device as non-present and frees
drive->id so enable_nest() has absolutely no chance of working.The code was like this since at least 2.6.12-rc2 and nobody
has noticed so just remove broken EXABYTENEST support.Signed-off-by: Bartlomiej Zolnierkiewicz
06 Mar, 2009
1 commit
-
Declare CFA specific identify data words 162 and 163 for future use.
Signed-off-by: Sergei Shtylyov
Signed-off-by: Jeff Garzik
[bart: update patch summary/description]
Signed-off-by: Bartlomiej Zolnierkiewicz
03 Feb, 2009
1 commit
-
When checking for the CFA feature set support, ata_id_is_cfa() tests bit 2 in
word 82 of the identify data instead the word 83; it also checks the ATA/PI
version support in the word 80 (which the CompactFlash specifications have as
reserved), this having no slightest chance to work on the modern CF cards that
don't have 0x848A in the word 0...Signed-off-by: Sergei Shtylyov
Signed-off-by: Jeff Garzik
11 Oct, 2008
7 commits
-
Rename lba_capacity_is_ok() to ata_id_is_lba_capacity_ok()
and move it to (remove needless parens while at it).Cc: Jeff Garzik
Signed-off-by: Bartlomiej Zolnierkiewicz -
Rename ide_id_to_hd_driveid() to ata_id_to_hd_driveid()
and move it to .Cc: Jeff Garzik
Signed-off-by: Bartlomiej Zolnierkiewicz -
* Add ata_id_flush_ext_enabled() inline helper to .
* ide_id_has_flush_cache_ext() -> ata_id_flush_ext_enabled()
The latter one also checks if the command is marked as
supported in word 83 and validity of words 83 & 86.Cc: Jeff Garzik
Signed-off-by: Bartlomiej Zolnierkiewicz -
* Add ata_id_flush_enabled() inline helper to .
* ide_id_has_flush_cache() -> ata_id_flush_enabled()
The latter one also checks if the command is marked as
supported in word 83 and validity of words 83 & 86.Cc: Jeff Garzik
Signed-off-by: Bartlomiej Zolnierkiewicz -
* Add ata_id_lba48_enabled() inline helper to .
* idedisk_supports_lba48() -> ata_id_lba48_enabled()
The latter one also checks validity of words 83 & 86.
Cc: Jeff Garzik
Signed-off-by: Bartlomiej Zolnierkiewicz -
* Use optimized ATA version check from Sergei in ata_id_is_sata().
* ide_dev_is_sata() -> ata_id_is_sata()
Cc: Jeff Garzik
Cc: Sergei Shtylyov
Signed-off-by: Bartlomiej Zolnierkiewicz -
* 'for-2.6.28' of git://git.kernel.dk/linux-2.6-block: (132 commits)
doc/cdrom: Trvial documentation error, file not present
block_dev: fix kernel-doc in new functions
block: add some comments around the bio read-write flags
block: mark bio_split_pool static
block: Find bio sector offset given idx and offset
block: gendisk integrity wrapper
block: Switch blk_integrity_compare from bdev to gendisk
block: Fix double put in blk_integrity_unregister
block: Introduce integrity data ownership flag
block: revert part of d7533ad0e132f92e75c1b2eb7c26387b25a583c1
bio.h: Remove unused conditional code
block: remove end_{queued|dequeued}_request()
block: change elevator to use __blk_end_request()
gdrom: change to use __blk_end_request()
memstick: change to use __blk_end_request()
virtio_blk: change to use __blk_end_request()
blktrace: use BLKTRACE_BDEV_SIZE as the name size for setup structure
block: add lld busy state exporting interface
block: Fix blk_start_queueing() to not kick a stopped queue
include blktrace_api.h in headers_install
...
09 Oct, 2008
1 commit
-
SSD devices should give an RPM setting of 1 in word 217 of the ID
page. If we see such a device, tell the block layer about it.Signed-off-by: Jens Axboe
29 Sep, 2008
1 commit
-
Add a function to check an ATA device's id for head unload support as
specified in ATA-7.Signed-off-by: Elias Oltmanns
Signed-off-by: Jeff Garzik
14 Sep, 2008
1 commit
-
I recently bought 3 HGST P7K500-series 500GB SATA drives and
had trouble accessing the block right on the LBA28-LBA48 border.
Here's how it fails (same for all 3 drives):# dd if=/dev/sdc bs=512 count=1 skip=268435455 > /dev/null
dd: reading `/dev/sdc': Input/output error
0+0 records in
0+0 records out
0 bytes (0 B) copied, 0.288033 seconds, 0.0 kB/s
# dmesg
ata1.00: exception Emask 0x0 SAct 0x0 SErr 0x0 action 0x0
ata1.00: BMDMA stat 0x25
ata1.00: cmd c8/00:08:f8:ff:ff/00:00:00:00:00/ef tag 0 dma 4096 in
res 51/04:08:f8:ff:ff/00:00:00:00:00/ef Emask 0x1 (device error)
ata1.00: status: { DRDY ERR }
ata1.00: error: { ABRT }
ata1.00: configured for UDMA/33
ata1: EH complete
...After some investigations, it turned out this seems to be caused
by misinterpretation of the ATA specification on LBA28 access.
Following part is the code in question:=== include/linux/ata.h ===
static inline int lba_28_ok(u64 block, u32 n_block)
{
/* check the ending block number */
return ((block + n_block - 1) < ((u64)1 << 28)) && (n_block From the ATA specification:
(http://www.t13.org/Documents/UploadedDocuments/project/d1410r3b-ATA-ATAPI-6.pdf)8.15.29 Word (61:60): Total number of user addressable sectors
This field contains a value that is one greater than the total number
of user addressable sectors (see 6.2). The maximum value that shall
be placed in this field is 0FFFFFFFh.So the driver shouldn't use the value of 0xfffffff for LBA28 request
as this exceeds maximum user addressable sector. The logical maximum
value for LBA28 is 0xffffffe.The obvious fix is to cut "- 1" part, and the patch attached just do
that. I've been using the patched kernel for about a month now, and
the same fix is also floating on the net for some time. So I believe
this fix works reliably.Just FYI, many Windows/Intel platform users also seems to be struck
by this, and HGST has issued a note pointing to Intel ICH8/9 driver."28-bit LBA command is being used to access LBAs 29-bits in length"
http://www.hitachigst.com/hddt/knowtree.nsf/cffe836ed7c12018862565b000530c74/b531b8bce8745fb78825740f00580e23Also, *BSDs seems to have similar fix included sometime around ~2004,
through I have not checked out exact portion of the code.Signed-off-by: Taisuke Yamada
Signed-off-by: Jeff Garzik
19 Aug, 2008
3 commits
-
Add missing ATA_* defines to . Also add
ATAPI_{LFS,EOM,ILI,IO,CODE} defines while at it.Cc: Jeff Garzik
Signed-off-by: Bartlomiej Zolnierkiewicz -
Add missing ATA_CMD_* defines to . Also add
ATA_EXABYTE_ENABLE_NEST, SETFEATURES_AAM_* and ATA_SMART_*
defines while at it.Partially based on earlier work by Chris Wedgwood.
Acked-by: Chris Wedgwood
Acked-by: Jeff Garzik
Signed-off-by: Bartlomiej Zolnierkiewicz -
Add missing ATA_ID_* defines and update {ata,atapi}_*()
inlines accordingly. The currently unused defines are
needed for the forthcoming drivers/ide/ changes.v2:
Add ATA_ID_SPG.Acked-by: Jeff Garzik
Signed-off-by: Bartlomiej Zolnierkiewicz
24 Feb, 2008
1 commit
-
Back in 2.6.17-rc2, a libata module parameter was added for atapi_dmadir.
That's nice, but most SATA devices which need it will tell us about it
in their IDENTIFY PACKET response, as bit-15 of word-62 of the
returned data (as per ATA7, ATA8 specifications).So for those which specify it, we should automatically use the DMADIR bit.
Otherwise, disc writing will fail by default on many SATA-ATAPI drives.This patch adds ATA_DFLAG_DMADIR and make ata_dev_configure() set it
if atapi_dmadir is set or identify data indicates DMADIR is necessary.
atapi_xlat() is converted to check ATA_DFLAG_DMADIR before setting
DMADIR.Original patch is from Mark Lord.
Signed-off-by: Tejun Heo
Cc: Mark Lord
Signed-off-by: Jeff Garzik
23 Jan, 2008
4 commits
-
Signed-off-by: Al Viro
Signed-off-by: Jeff Garzik -
ATA_PROT_ATAPI_* are ugly and naming schemes between ATA_PROT_* and
ATA_PROT_ATAPI_* are inconsistent causing confusion. Rename them to
ATAPI_PROT_* and make them consistent with ATA counterpart.Signed-off-by: Tejun Heo
Signed-off-by: Jeff Garzik -
ATA_CBL_PATA_UNK indicates that the cable type can't be determined
from the host side and might be either 80c or 40c. libata applies
drive or other generic limit in this case. However, there are
controllers where both host and drive side detections are
misimplemented and the driver has to rely solely on private method -
peeking BIOS or ACPI configuration or using some other private
mechanism.This patch adds ATA_CBL_PATA_IGN which tells libata to ignore the
cable type completely and just let the LLD determine the transfer mode
via host transfer mode masks and ->mode_filter().Signed-off-by: Tejun Heo
Cc: Alan Cox
Signed-off-by: Jeff Garzik -
Implement protocol tests - ata_is_atapi(), ata_is_nodata(),
ata_is_pio(), ata_is_dma(), ata_is_ncq() and ata_is_data() and use
them to replace is_atapi_taskfile() and hard coded protocol tests.Signed-off-by: Tejun Heo
Signed-off-by: Jeff Garzik