Commit 679c0cd2 authored by Stefan Richter's avatar Stefan Richter Committed by Linus Torvalds

[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: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent e9a1c52c
...@@ -156,6 +156,11 @@ MODULE_PARM_DESC(exclusive_login, "Exclusive login to sbp2 device (default = 1)" ...@@ -156,6 +156,11 @@ MODULE_PARM_DESC(exclusive_login, "Exclusive login to sbp2 device (default = 1)"
* Tell sd_mod to correct the last sector number reported by read_capacity. * Tell sd_mod to correct the last sector number reported by read_capacity.
* Avoids access beyond actual disk limits on devices with an off-by-one bug. * Avoids access beyond actual disk limits on devices with an off-by-one bug.
* Don't use this with devices which don't have this bug. * Don't use this with devices which don't have this bug.
*
* - override internal blacklist
* Instead of adding to the built-in blacklist, use only the workarounds
* specified in the module load parameter.
* Useful if a blacklist entry interfered with a non-broken device.
*/ */
static int sbp2_default_workarounds; static int sbp2_default_workarounds;
module_param_named(workarounds, sbp2_default_workarounds, int, 0644); module_param_named(workarounds, sbp2_default_workarounds, int, 0644);
...@@ -164,6 +169,7 @@ MODULE_PARM_DESC(workarounds, "Work around device bugs (default = 0" ...@@ -164,6 +169,7 @@ MODULE_PARM_DESC(workarounds, "Work around device bugs (default = 0"
", 36 byte inquiry = " __stringify(SBP2_WORKAROUND_INQUIRY_36) ", 36 byte inquiry = " __stringify(SBP2_WORKAROUND_INQUIRY_36)
", skip mode page 8 = " __stringify(SBP2_WORKAROUND_MODE_SENSE_8) ", skip mode page 8 = " __stringify(SBP2_WORKAROUND_MODE_SENSE_8)
", fix capacity = " __stringify(SBP2_WORKAROUND_FIX_CAPACITY) ", fix capacity = " __stringify(SBP2_WORKAROUND_FIX_CAPACITY)
", override internal blacklist = " __stringify(SBP2_WORKAROUND_OVERRIDE)
", or a combination)"); ", or a combination)");
/* legacy parameter */ /* legacy parameter */
...@@ -1587,17 +1593,18 @@ static void sbp2_parse_unit_directory(struct scsi_id_instance_data *scsi_id, ...@@ -1587,17 +1593,18 @@ static void sbp2_parse_unit_directory(struct scsi_id_instance_data *scsi_id,
workarounds |= SBP2_WORKAROUND_INQUIRY_36; workarounds |= SBP2_WORKAROUND_INQUIRY_36;
} }
for (i = 0; i < ARRAY_SIZE(sbp2_workarounds_table); i++) { if (!(workarounds & SBP2_WORKAROUND_OVERRIDE))
if (sbp2_workarounds_table[i].firmware_revision && for (i = 0; i < ARRAY_SIZE(sbp2_workarounds_table); i++) {
sbp2_workarounds_table[i].firmware_revision != if (sbp2_workarounds_table[i].firmware_revision &&
(firmware_revision & 0xffff00)) sbp2_workarounds_table[i].firmware_revision !=
continue; (firmware_revision & 0xffff00))
if (sbp2_workarounds_table[i].model_id && continue;
sbp2_workarounds_table[i].model_id != ud->model_id) if (sbp2_workarounds_table[i].model_id &&
continue; sbp2_workarounds_table[i].model_id != ud->model_id)
workarounds |= sbp2_workarounds_table[i].workarounds; continue;
break; workarounds |= sbp2_workarounds_table[i].workarounds;
} break;
}
if (workarounds) if (workarounds)
SBP2_INFO("Workarounds for node " NODE_BUS_FMT ": 0x%x " SBP2_INFO("Workarounds for node " NODE_BUS_FMT ": 0x%x "
......
...@@ -239,6 +239,7 @@ struct sbp2_status_block { ...@@ -239,6 +239,7 @@ struct sbp2_status_block {
#define SBP2_WORKAROUND_INQUIRY_36 0x2 #define SBP2_WORKAROUND_INQUIRY_36 0x2
#define SBP2_WORKAROUND_MODE_SENSE_8 0x4 #define SBP2_WORKAROUND_MODE_SENSE_8 0x4
#define SBP2_WORKAROUND_FIX_CAPACITY 0x8 #define SBP2_WORKAROUND_FIX_CAPACITY 0x8
#define SBP2_WORKAROUND_OVERRIDE 0x100
/* This is the two dma types we use for cmd_dma below */ /* This is the two dma types we use for cmd_dma below */
enum cmd_dma_types { enum cmd_dma_types {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment