Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 68092
b: refs/heads/master
c: 539cc7c
h: refs/heads/master
v: v3
  • Loading branch information
Jeff Garzik committed Oct 12, 2007
1 parent a692fdd commit ef0bd08
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 11 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: ec300d99ef8699a6f383889b8f8c0d0ebadc2a74
refs/heads/master: 539cc7c70c12fbdad4ee11f901cd7a0d7f52b186
32 changes: 22 additions & 10 deletions trunk/drivers/ata/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -3814,16 +3814,11 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
/* http://thread.gmane.org/gmane.linux.ide/14907 */
{ "FUJITSU MHT2060BH", NULL, ATA_HORKAGE_NONCQ },
/* NCQ is broken */
{ "Maxtor 6L250S0", "BANC1G10", ATA_HORKAGE_NONCQ },
{ "Maxtor 6B200M0", "BANC1BM0", ATA_HORKAGE_NONCQ },
{ "Maxtor 6B200M0", "BANC1B10", ATA_HORKAGE_NONCQ },
{ "Maxtor 7B250S0", "BANC1B70", ATA_HORKAGE_NONCQ, },
{ "Maxtor 7B300S0", "BANC1B70", ATA_HORKAGE_NONCQ },
{ "Maxtor *", "BANC*", ATA_HORKAGE_NONCQ },
{ "Maxtor 7V300F0", "VA111630", ATA_HORKAGE_NONCQ },
{ "HITACHI HDS7250SASUN500G 0621KTAWSD", "K2AOAJ0AHITACHI",
ATA_HORKAGE_NONCQ },
/* NCQ hard hangs device under heavier load, needs hard power cycle */
{ "Maxtor 6B250S0", "BANC1B70", ATA_HORKAGE_NONCQ },
ATA_HORKAGE_NONCQ },

/* Blacklist entries taken from Silicon Image 3124/3132
Windows driver .inf file - also several Linux problem reports */
{ "HTS541060G9SA00", "MB3OC60D", ATA_HORKAGE_NONCQ, },
Expand All @@ -3849,6 +3844,23 @@ static const struct ata_blacklist_entry ata_device_blacklist [] = {
{ }
};

int strn_pattern_cmp(const char *patt, const char *name, int wildchar)
{
const char *p;
int len;

/*
* check for trailing wildcard: *\0
*/
p = strchr(patt, wildchar);
if (p && ((*(p + 1)) == 0))
len = p - patt;
else
len = strlen(name);

return strncmp(patt, name, len);
}

static unsigned long ata_dev_blacklisted(const struct ata_device *dev)
{
unsigned char model_num[ATA_ID_PROD_LEN + 1];
Expand All @@ -3859,10 +3871,10 @@ static unsigned long ata_dev_blacklisted(const struct ata_device *dev)
ata_id_c_string(dev->id, model_rev, ATA_ID_FW_REV, sizeof(model_rev));

while (ad->model_num) {
if (!strcmp(ad->model_num, model_num)) {
if (!strn_pattern_cmp(ad->model_num, model_num, '*')) {
if (ad->model_rev == NULL)
return ad->horkage;
if (!strcmp(ad->model_rev, model_rev))
if (!strn_pattern_cmp(ad->model_rev, model_rev, '*'))
return ad->horkage;
}
ad++;
Expand Down

0 comments on commit ef0bd08

Please sign in to comment.