Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 133598
b: refs/heads/master
c: e18086d
h: refs/heads/master
v: v3
  • Loading branch information
Mark Lord authored and Jeff Garzik committed Mar 25, 2009
1 parent e391b79 commit be2bb06
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 000b344f4ca7828ee43940255c8bbb32e2c7dbec
refs/heads/master: e18086d69cb5bb864749a0637f6ac573aa89d5ea
13 changes: 11 additions & 2 deletions trunk/drivers/ata/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
#include <linux/scatterlist.h>
#include <linux/io.h>
#include <linux/async.h>
#include <linux/log2.h>
#include <scsi/scsi.h>
#include <scsi/scsi_cmnd.h>
#include <scsi/scsi_host.h>
Expand Down Expand Up @@ -2389,6 +2390,7 @@ int ata_dev_configure(struct ata_device *dev)
dev->cylinders = 0;
dev->heads = 0;
dev->sectors = 0;
dev->multi_count = 0;

/*
* common ATA, ATAPI feature tests
Expand Down Expand Up @@ -2426,8 +2428,15 @@ int ata_dev_configure(struct ata_device *dev)

dev->n_sectors = ata_id_n_sectors(id);

if (dev->id[59] & 0x100)
dev->multi_count = dev->id[59] & 0xff;
/* get current R/W Multiple count setting */
if ((dev->id[47] >> 8) == 0x80 && (dev->id[59] & 0x100)) {
unsigned int max = dev->id[47] & 0xff;
unsigned int cnt = dev->id[59] & 0xff;
/* only recognize/allow powers of two here */
if (is_power_of_2(max) && is_power_of_2(cnt))
if (cnt <= max)
dev->multi_count = cnt;
}

if (ata_id_has_lba(id)) {
const char *lba_desc;
Expand Down

0 comments on commit be2bb06

Please sign in to comment.