Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 354634 Details for
Bug 478698
sys-kernel/gentoo-sources-3.10.3-r1 can't mount USB disks
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
revert_scsi_sd_update_write_same_heuristics.patch
revert_scsi_sd_update_write_same_heuristics.patch (text/plain), 4.22 KB, created by
Jouni Kosonen
on 2013-07-30 16:41:03 UTC
(
hide
)
Description:
revert_scsi_sd_update_write_same_heuristics.patch
Filename:
MIME Type:
Creator:
Jouni Kosonen
Created:
2013-07-30 16:41:03 UTC
Size:
4.22 KB
patch
obsolete
>diff -Npaur a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c >--- a/drivers/scsi/scsi.c 2013-07-28 00:22:12.277987607 +0300 >+++ b/drivers/scsi/scsi.c 2013-07-30 05:15:13.229242830 +0300 >@@ -1070,8 +1070,8 @@ EXPORT_SYMBOL_GPL(scsi_get_vpd_page); > * @opcode: opcode for command to look up > * > * Uses the REPORT SUPPORTED OPERATION CODES to look up the given >- * opcode. Returns -EINVAL if RSOC fails, 0 if the command opcode is >- * unsupported and 1 if the device claims to support the command. >+ * opcode. Returns 0 if RSOC fails or if the command opcode is >+ * unsupported. Returns 1 if the device claims to support the command. > */ > int scsi_report_opcode(struct scsi_device *sdev, unsigned char *buffer, > unsigned int len, unsigned char opcode) >@@ -1081,7 +1081,7 @@ int scsi_report_opcode(struct scsi_devic > int result; > > if (sdev->no_report_opcodes || sdev->scsi_level < SCSI_SPC_3) >- return -EINVAL; >+ return 0; > > memset(cmd, 0, 16); > cmd[0] = MAINTENANCE_IN; >@@ -1097,7 +1097,7 @@ int scsi_report_opcode(struct scsi_devic > if (result && scsi_sense_valid(&sshdr) && > sshdr.sense_key == ILLEGAL_REQUEST && > (sshdr.asc == 0x20 || sshdr.asc == 0x24) && sshdr.ascq == 0x00) >- return -EINVAL; >+ return 0; > > if ((buffer[1] & 3) == 3) /* Command supported */ > return 1; >diff -Npaur a/drivers/scsi/sd.c b/drivers/scsi/sd.c >--- a/drivers/scsi/sd.c 2013-07-28 00:22:12.277987607 +0300 >+++ b/drivers/scsi/sd.c 2013-07-30 05:15:13.230242827 +0300 >@@ -442,10 +442,8 @@ sd_store_write_same_blocks(struct device > > if (max == 0) > sdp->no_write_same = 1; >- else if (max <= SD_MAX_WS16_BLOCKS) { >- sdp->no_write_same = 0; >+ else if (max <= SD_MAX_WS16_BLOCKS) > sdkp->max_ws_blocks = max; >- } > > sd_config_write_same(sdkp); > >@@ -742,6 +740,7 @@ static void sd_config_write_same(struct > { > struct request_queue *q = sdkp->disk->queue; > unsigned int logical_block_size = sdkp->device->sector_size; >+ unsigned int blocks = 0; > > if (sdkp->device->no_write_same) { > sdkp->max_ws_blocks = 0; >@@ -753,20 +752,18 @@ static void sd_config_write_same(struct > * blocks per I/O unless the device explicitly advertises a > * bigger limit. > */ >- if (sdkp->max_ws_blocks > SD_MAX_WS10_BLOCKS) >- sdkp->max_ws_blocks = min_not_zero(sdkp->max_ws_blocks, >- (u32)SD_MAX_WS16_BLOCKS); >- else if (sdkp->ws16 || sdkp->ws10 || sdkp->device->no_report_opcodes) >- sdkp->max_ws_blocks = min_not_zero(sdkp->max_ws_blocks, >- (u32)SD_MAX_WS10_BLOCKS); >- else { >- sdkp->device->no_write_same = 1; >- sdkp->max_ws_blocks = 0; >- } >+ if (sdkp->max_ws_blocks == 0) >+ sdkp->max_ws_blocks = SD_MAX_WS10_BLOCKS; >+ >+ if (sdkp->ws16 || sdkp->max_ws_blocks > SD_MAX_WS10_BLOCKS) >+ blocks = min_not_zero(sdkp->max_ws_blocks, >+ (u32)SD_MAX_WS16_BLOCKS); >+ else >+ blocks = min_not_zero(sdkp->max_ws_blocks, >+ (u32)SD_MAX_WS10_BLOCKS); > > out: >- blk_queue_max_write_same_sectors(q, sdkp->max_ws_blocks * >- (logical_block_size >> 9)); >+ blk_queue_max_write_same_sectors(q, blocks * (logical_block_size >> 9)); > } > > /** >@@ -2638,24 +2635,9 @@ static void sd_read_block_provisioning(s > > static void sd_read_write_same(struct scsi_disk *sdkp, unsigned char *buffer) > { >- struct scsi_device *sdev = sdkp->device; >- >- if (scsi_report_opcode(sdev, buffer, SD_BUF_SIZE, INQUIRY) < 0) { >- sdev->no_report_opcodes = 1; >- >- /* Disable WRITE SAME if REPORT SUPPORTED OPERATION >- * CODES is unsupported and the device has an ATA >- * Information VPD page (SAT). >- */ >- if (!scsi_get_vpd_page(sdev, 0x89, buffer, SD_BUF_SIZE)) >- sdev->no_write_same = 1; >- } >- >- if (scsi_report_opcode(sdev, buffer, SD_BUF_SIZE, WRITE_SAME_16) == 1) >+ if (scsi_report_opcode(sdkp->device, buffer, SD_BUF_SIZE, >+ WRITE_SAME_16)) > sdkp->ws16 = 1; >- >- if (scsi_report_opcode(sdev, buffer, SD_BUF_SIZE, WRITE_SAME) == 1) >- sdkp->ws10 = 1; > } > > static int sd_try_extended_inquiry(struct scsi_device *sdp) >diff -Npaur a/drivers/scsi/sd.h b/drivers/scsi/sd.h >--- a/drivers/scsi/sd.h 2013-07-28 00:22:12.278987605 +0300 >+++ b/drivers/scsi/sd.h 2013-07-30 05:15:13.230242827 +0300 >@@ -84,7 +84,6 @@ struct scsi_disk { > unsigned lbpws : 1; > unsigned lbpws10 : 1; > unsigned lbpvpd : 1; >- unsigned ws10 : 1; > unsigned ws16 : 1; > }; > #define to_scsi_disk(obj) container_of(obj,struct scsi_disk,dev)
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 478698
: 354634 |
354772