Skip to content

Commit 5116901

Browse files
Karl Reltongregkh
authored andcommitted
usb-storage: Correct adjust_quirks to include latest flags
Commits ae38c78 and 0091402 added quirk flags US_FL_NO_READ_DISC_INFO and US_FL_NO_READ_CAPACITY_16 to the usb-storage driver. However they did not add the corresponding flags to adjust_quirks() in usb.c, so there was no facility for a user to over-ride/add them via the quirks module parameter. Signed-off-by: Karl Relton <karllinuxtest.relton@ntlworld.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
1 parent d05b6ec commit 5116901

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

‎Documentation/kernel-parameters.txt‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2581,6 +2581,10 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
25812581
bytes of sense data);
25822582
c = FIX_CAPACITY (decrease the reported
25832583
device capacity by one sector);
2584+
d = NO_READ_DISC_INFO (don't use
2585+
READ_DISC_INFO command);
2586+
e = NO_READ_CAPACITY_16 (don't use
2587+
READ_CAPACITY_16 command);
25842588
h = CAPACITY_HEURISTICS (decrease the
25852589
reported device capacity by one
25862590
sector if the number is odd);

‎drivers/usb/storage/usb.c‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,7 +439,8 @@ static void adjust_quirks(struct us_data *us)
439439
US_FL_CAPACITY_HEURISTICS | US_FL_IGNORE_DEVICE |
440440
US_FL_NOT_LOCKABLE | US_FL_MAX_SECTORS_64 |
441441
US_FL_CAPACITY_OK | US_FL_IGNORE_RESIDUE |
442-
US_FL_SINGLE_LUN | US_FL_NO_WP_DETECT);
442+
US_FL_SINGLE_LUN | US_FL_NO_WP_DETECT |
443+
US_FL_NO_READ_DISC_INFO | US_FL_NO_READ_CAPACITY_16);
443444

444445
p = quirks;
445446
while (*p) {
@@ -471,6 +472,12 @@ static void adjust_quirks(struct us_data *us)
471472
case 'c':
472473
f |= US_FL_FIX_CAPACITY;
473474
break;
475+
case 'd':
476+
f |= US_FL_NO_READ_DISC_INFO;
477+
break;
478+
case 'e':
479+
f |= US_FL_NO_READ_CAPACITY_16;
480+
break;
474481
case 'h':
475482
f |= US_FL_CAPACITY_HEURISTICS;
476483
break;

0 commit comments

Comments
 (0)