Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 19085
b: refs/heads/master
c: 48bdc8e
h: refs/heads/master
i:
  19083: f87e710
v: v3
  • Loading branch information
Jens Axboe committed Jan 30, 2006
1 parent 502bdd9 commit cf7a023
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 2 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: dfcd77d16b5745fbfea7d5636f15fc80cc05fef8
refs/heads/master: 48bdc8ec4aa2ca04e339bf5c3a47677d8dd00bb6
27 changes: 26 additions & 1 deletion trunk/drivers/scsi/libata-scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -1700,6 +1700,31 @@ static unsigned int ata_msense_rw_recovery(u8 **ptr_io, const u8 *last)
return sizeof(def_rw_recovery_mpage);
}

/*
* We can turn this into a real blacklist if it's needed, for now just
* blacklist any Maxtor BANC1G10 revision firmware
*/
static int ata_dev_supports_fua(u16 *id)
{
unsigned char model[41], fw[9];

if (!ata_id_has_fua(id))
return 0;

model[40] = '\0';
fw[8] = '\0';

ata_dev_id_string(id, model, ATA_ID_PROD_OFS, sizeof(model) - 1);
ata_dev_id_string(id, fw, ATA_ID_FW_REV_OFS, sizeof(fw) - 1);

if (strncmp(model, "Maxtor", 6))
return 1;
if (strncmp(fw, "BANC1G10", 8))
return 1;

return 0; /* blacklisted */
}

/**
* ata_scsiop_mode_sense - Simulate MODE SENSE 6, 10 commands
* @args: device IDENTIFY data / SCSI command of interest.
Expand Down Expand Up @@ -1797,7 +1822,7 @@ unsigned int ata_scsiop_mode_sense(struct ata_scsi_args *args, u8 *rbuf,
return 0;

dpofua = 0;
if (ata_id_has_fua(args->id) && dev->flags & ATA_DFLAG_LBA48 &&
if (ata_dev_supports_fua(args->id) && dev->flags & ATA_DFLAG_LBA48 &&
(!(dev->flags & ATA_DFLAG_PIO) || dev->multi_count))
dpofua = 1 << 4;

Expand Down

0 comments on commit cf7a023

Please sign in to comment.