diff options
| author | Stefan Richter <stefanr@s5r6.in-berlin.de> | 2006-05-15 16:08:09 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-05-18 00:32:22 -0400 |
| commit | 679c0cd2dd61c825ab910fdbf347a8b7d1dddec4 (patch) | |
| tree | 01fc830a4e2e799de61afdb986d0a6c3d5270841 | |
| parent | e9a1c52c7b19d10342226c12f170d7ab644427e2 (diff) | |
[PATCH] sbp2: add ability to override hardwired blacklist
In case the blacklist with workarounds for device bugs yields a false
positive, the module load parameter can now also be used as an override
instead of an addition to the blacklist.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
| -rw-r--r-- | drivers/ieee1394/sbp2.c | 29 | ||||
| -rw-r--r-- | drivers/ieee1394/sbp2.h | 1 |
2 files changed, 19 insertions, 11 deletions
diff --git a/drivers/ieee1394/sbp2.c b/drivers/ieee1394/sbp2.c index 09e9291f1848..73555806c483 100644 --- a/drivers/ieee1394/sbp2.c +++ b/drivers/ieee1394/sbp2.c | |||
| @@ -156,6 +156,11 @@ MODULE_PARM_DESC(exclusive_login, "Exclusive login to sbp2 device (default = 1)" | |||
| 156 | * Tell sd_mod to correct the last sector number reported by read_capacity. | 156 | * Tell sd_mod to correct the last sector number reported by read_capacity. |
| 157 | * Avoids access beyond actual disk limits on devices with an off-by-one bug. | 157 | * Avoids access beyond actual disk limits on devices with an off-by-one bug. |
| 158 | * Don't use this with devices which don't have this bug. | 158 | * Don't use this with devices which don't have this bug. |
| 159 | * | ||
| 160 | * - override internal blacklist | ||
| 161 | * Instead of adding to the built-in blacklist, use only the workarounds | ||
| 162 | * specified in the module load parameter. | ||
| 163 | * Useful if a blacklist entry interfered with a non-broken device. | ||
| 159 | */ | 164 | */ |
| 160 | static int sbp2_default_workarounds; | 165 | static int sbp2_default_workarounds; |
| 161 | module_param_named(workarounds, sbp2_default_workarounds, int, 0644); | 166 | module_param_named(workarounds, sbp2_default_workarounds, int, 0644); |
| @@ -164,6 +169,7 @@ MODULE_PARM_DESC(workarounds, "Work around device bugs (default = 0" | |||
| 164 | ", 36 byte inquiry = " __stringify(SBP2_WORKAROUND_INQUIRY_36) | 169 | ", 36 byte inquiry = " __stringify(SBP2_WORKAROUND_INQUIRY_36) |
| 165 | ", skip mode page 8 = " __stringify(SBP2_WORKAROUND_MODE_SENSE_8) | 170 | ", skip mode page 8 = " __stringify(SBP2_WORKAROUND_MODE_SENSE_8) |
| 166 | ", fix capacity = " __stringify(SBP2_WORKAROUND_FIX_CAPACITY) | 171 | ", fix capacity = " __stringify(SBP2_WORKAROUND_FIX_CAPACITY) |
| 172 | ", override internal blacklist = " __stringify(SBP2_WORKAROUND_OVERRIDE) | ||
| 167 | ", or a combination)"); | 173 | ", or a combination)"); |
| 168 | 174 | ||
| 169 | /* legacy parameter */ | 175 | /* legacy parameter */ |
| @@ -1587,17 +1593,18 @@ static void sbp2_parse_unit_directory(struct scsi_id_instance_data *scsi_id, | |||
| 1587 | workarounds |= SBP2_WORKAROUND_INQUIRY_36; | 1593 | workarounds |= SBP2_WORKAROUND_INQUIRY_36; |
| 1588 | } | 1594 | } |
| 1589 | 1595 | ||
| 1590 | for (i = 0; i < ARRAY_SIZE(sbp2_workarounds_table); i++) { | 1596 | if (!(workarounds & SBP2_WORKAROUND_OVERRIDE)) |
| 1591 | if (sbp2_workarounds_table[i].firmware_revision && | 1597 | for (i = 0; i < ARRAY_SIZE(sbp2_workarounds_table); i++) { |
| 1592 | sbp2_workarounds_table[i].firmware_revision != | 1598 | if (sbp2_workarounds_table[i].firmware_revision && |
| 1593 | (firmware_revision & 0xffff00)) | 1599 | sbp2_workarounds_table[i].firmware_revision != |
| 1594 | continue; | 1600 | (firmware_revision & 0xffff00)) |
| 1595 | if (sbp2_workarounds_table[i].model_id && | 1601 | continue; |
| 1596 | sbp2_workarounds_table[i].model_id != ud->model_id) | 1602 | if (sbp2_workarounds_table[i].model_id && |
| 1597 | continue; | 1603 | sbp2_workarounds_table[i].model_id != ud->model_id) |
| 1598 | workarounds |= sbp2_workarounds_table[i].workarounds; | 1604 | continue; |
| 1599 | break; | 1605 | workarounds |= sbp2_workarounds_table[i].workarounds; |
| 1600 | } | 1606 | break; |
| 1607 | } | ||
| 1601 | 1608 | ||
| 1602 | if (workarounds) | 1609 | if (workarounds) |
| 1603 | SBP2_INFO("Workarounds for node " NODE_BUS_FMT ": 0x%x " | 1610 | SBP2_INFO("Workarounds for node " NODE_BUS_FMT ": 0x%x " |
diff --git a/drivers/ieee1394/sbp2.h b/drivers/ieee1394/sbp2.h index 3af2710f1858..f4ccc9d0fba4 100644 --- a/drivers/ieee1394/sbp2.h +++ b/drivers/ieee1394/sbp2.h | |||
| @@ -239,6 +239,7 @@ struct sbp2_status_block { | |||
| 239 | #define SBP2_WORKAROUND_INQUIRY_36 0x2 | 239 | #define SBP2_WORKAROUND_INQUIRY_36 0x2 |
| 240 | #define SBP2_WORKAROUND_MODE_SENSE_8 0x4 | 240 | #define SBP2_WORKAROUND_MODE_SENSE_8 0x4 |
| 241 | #define SBP2_WORKAROUND_FIX_CAPACITY 0x8 | 241 | #define SBP2_WORKAROUND_FIX_CAPACITY 0x8 |
| 242 | #define SBP2_WORKAROUND_OVERRIDE 0x100 | ||
| 242 | 243 | ||
| 243 | /* This is the two dma types we use for cmd_dma below */ | 244 | /* This is the two dma types we use for cmd_dma below */ |
| 244 | enum cmd_dma_types { | 245 | enum cmd_dma_types { |
