Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'scsi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi

Pull final round of SCSI updates from James Bottomley:
"This is the remaining set of SCSI patches for the merge window. It's
mostly driver updates (scsi_debug, qla2xxx, storvsc, mp3sas). There
are also several bug fixes in fcoe, libfc, and megaraid_sas. We also
have a couple of core changes to try to make device destruction more
deterministic"

* tag 'scsi-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (46 commits)
[SCSI] scsi constants: command, sense key + additional sense strings
fcoe: Reduce number of sparse warnings
fcoe: Stop fc_rport_priv structure leak
libfcoe: Fix meaningless log statement
libfc: Differentiate echange timer cancellation debug statements
libfc: Remove extra space in fc_exch_timer_cancel definition
fcoe: fix the link error status block sparse warnings
fcoe: Fix smatch warning in fcoe_fdmi_info function
libfc: Reject PLOGI from nodes with incompatible role
[SCSI] enable destruction of blocked devices which fail LUN scanning
[SCSI] Fix race between starved list and device removal
[SCSI] megaraid_sas: fix a bug for 64 bit arches
[SCSI] scsi_debug: reduce duplication between prot_verify_read and prot_verify_write
[SCSI] scsi_debug: simplify offset calculation for dif_storep
[SCSI] scsi_debug: invalidate protection info for unmapped region
[SCSI] scsi_debug: fix NULL pointer dereference with parameters dif=0 dix=1
[SCSI] scsi_debug: fix incorrectly nested kmap_atomic()
[SCSI] scsi_debug: fix invalid address passed to kunmap_atomic()
[SCSI] mpt3sas: Bump driver version to v02.100.00.00
[SCSI] mpt3sas: when async scanning is enabled then while scanning, devices are removed but their transport layer entries are not removed
...

+827 -528
+187 -48
drivers/scsi/constants.c
··· 1 - /* 1 + /* 2 2 * ASCII values for a number of symbolic constants, printing functions, 3 3 * etc. 4 4 * Additions for SCSI 2 and Linux 2.2.x by D. Gilbert (990422) 5 5 * Additions for SCSI 3+ (SPC-3 T10/1416-D Rev 07 3 May 2002) 6 6 * by D. Gilbert and aeb (20020609) 7 - * Update to SPC-4 T10/1713-D Rev 20, 22 May 2009, D. Gilbert 20090624 7 + * Updated to SPC-4 T10/1713-D Rev 36g, D. Gilbert 20130701 8 8 */ 9 9 10 10 #include <linux/blkdev.h> ··· 21 21 22 22 23 23 /* Commands with service actions that change the command name */ 24 - #define MAINTENANCE_IN 0xa3 25 - #define MAINTENANCE_OUT 0xa4 26 24 #define SERVICE_ACTION_IN_12 0xab 27 25 #define SERVICE_ACTION_OUT_12 0xa9 26 + #define SERVICE_ACTION_BIDIRECTIONAL 0x9d 28 27 #define SERVICE_ACTION_IN_16 0x9e 29 28 #define SERVICE_ACTION_OUT_16 0x9f 29 + #define THIRD_PARTY_COPY_OUT 0x83 30 + #define THIRD_PARTY_COPY_IN 0x84 30 31 31 32 32 33 ··· 37 36 /* 04-07 */ "Format Unit/Medium", "Read Block Limits", NULL, 38 37 "Reassign Blocks", 39 38 /* 08-0d */ "Read(6)", NULL, "Write(6)", "Seek(6)", NULL, NULL, 40 - /* 0e-12 */ NULL, "Read Reverse", "Write Filemarks", "Space", "Inquiry", 39 + /* 0e-12 */ NULL, "Read Reverse", "Write Filemarks", "Space", "Inquiry", 41 40 /* 13-16 */ "Verify(6)", "Recover Buffered Data", "Mode Select(6)", 42 41 "Reserve(6)", 43 42 /* 17-1a */ "Release(6)", "Copy", "Erase", "Mode Sense(6)", 44 - /* 1b-1d */ "Start/Stop Unit", "Receive Diagnostic", "Send Diagnostic", 43 + /* 1b-1d */ "Start/Stop Unit", "Receive Diagnostic", "Send Diagnostic", 45 44 /* 1e-1f */ "Prevent/Allow Medium Removal", NULL, 46 45 /* 20-22 */ NULL, NULL, NULL, 47 46 /* 23-28 */ "Read Format Capacities", "Set Window", ··· 49 48 /* 29-2d */ "Read Generation", "Write(10)", "Seek(10)", "Erase(10)", 50 49 "Read updated block", 51 50 /* 2e-31 */ "Write Verify(10)", "Verify(10)", "Search High", "Search Equal", 52 - /* 32-34 */ "Search Low", "Set Limits", "Prefetch/Read Position", 51 + /* 32-34 */ "Search Low", "Set Limits", "Prefetch/Read Position", 53 52 /* 35-37 */ "Synchronize Cache(10)", "Lock/Unlock Cache(10)", 54 - "Read Defect Data(10)", 55 - /* 38-3c */ "Medium Scan", "Compare", "Copy Verify", "Write Buffer", 56 - "Read Buffer", 53 + "Read Defect Data(10)", 54 + /* 38-3c */ "Medium Scan", "Compare", "Copy Verify", "Write Buffer", 55 + "Read Buffer", 57 56 /* 3d-3f */ "Update Block", "Read Long(10)", "Write Long(10)", 58 57 /* 40-41 */ "Change Definition", "Write Same(10)", 59 58 /* 42-48 */ "Unmap/Read sub-channel", "Read TOC/PMA/ATIP", 60 59 "Read density support", "Play audio(10)", "Get configuration", 61 - "Play audio msf", "Play audio track/index", 60 + "Play audio msf", "Sanitize/Play audio track/index", 62 61 /* 49-4f */ "Play track relative(10)", "Get event status notification", 63 62 "Pause/resume", "Log Select", "Log Sense", "Stop play/scan", 64 63 NULL, ··· 73 72 /* 70-77 */ NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 74 73 /* 78-7f */ NULL, NULL, NULL, NULL, NULL, NULL, "Extended CDB", 75 74 "Variable length", 76 - /* 80-84 */ "Xdwrite(16)", "Rebuild(16)", "Regenerate(16)", "Extended copy", 77 - "Receive copy results", 75 + /* 80-84 */ "Xdwrite(16)", "Rebuild(16)", "Regenerate(16)", 76 + "Third party copy out", "Third party copy in", 78 77 /* 85-89 */ "ATA command pass through(16)", "Access control in", 79 - "Access control out", "Read(16)", "Memory Export Out(16)", 78 + "Access control out", "Read(16)", "Compare and Write", 80 79 /* 8a-8f */ "Write(16)", "ORWrite", "Read attributes", "Write attributes", 81 80 "Write and verify(16)", "Verify(16)", 82 81 /* 90-94 */ "Pre-fetch(16)", "Synchronize cache(16)", 83 82 "Lock/unlock cache(16)", "Write same(16)", NULL, 84 83 /* 95-99 */ NULL, NULL, NULL, NULL, NULL, 85 - /* 9a-9f */ NULL, NULL, NULL, NULL, "Service action in(16)", 86 - "Service action out(16)", 84 + /* 9a-9f */ NULL, NULL, NULL, "Service action bidirectional", 85 + "Service action in(16)", "Service action out(16)", 87 86 /* a0-a5 */ "Report luns", "ATA command pass through(12)/Blank", 88 87 "Security protocol in", "Maintenance in", "Maintenance out", 89 88 "Move medium/play audio(12)", ··· 123 122 {0x6, "Set identifying information"}, 124 123 {0xa, "Set target port groups"}, 125 124 {0xb, "Change aliases"}, 125 + {0xc, "Remove I_T nexus"}, 126 126 {0xe, "Set priority"}, 127 127 {0xf, "Set timestamp"}, 128 128 {0x10, "Management protocol out"}, ··· 140 138 }; 141 139 #define SERV_OUT12_SZ ARRAY_SIZE(serv_out12_arr) 142 140 141 + static const struct value_name_pair serv_bidi_arr[] = { 142 + {-1, "dummy entry"}, 143 + }; 144 + #define SERV_BIDI_SZ ARRAY_SIZE(serv_bidi_arr) 145 + 143 146 static const struct value_name_pair serv_in16_arr[] = { 144 147 {0x10, "Read capacity(16)"}, 145 148 {0x11, "Read long(16)"}, 146 149 {0x12, "Get LBA status"}, 150 + {0x13, "Report referrals"}, 147 151 }; 148 152 #define SERV_IN16_SZ ARRAY_SIZE(serv_in16_arr) 149 153 ··· 158 150 {0x1f, "Notify data transfer device(16)"}, 159 151 }; 160 152 #define SERV_OUT16_SZ ARRAY_SIZE(serv_out16_arr) 153 + 154 + static const struct value_name_pair pr_in_arr[] = { 155 + {0x0, "Persistent reserve in, read keys"}, 156 + {0x1, "Persistent reserve in, read reservation"}, 157 + {0x2, "Persistent reserve in, report capabilities"}, 158 + {0x3, "Persistent reserve in, read full status"}, 159 + }; 160 + #define PR_IN_SZ ARRAY_SIZE(pr_in_arr) 161 + 162 + static const struct value_name_pair pr_out_arr[] = { 163 + {0x0, "Persistent reserve out, register"}, 164 + {0x1, "Persistent reserve out, reserve"}, 165 + {0x2, "Persistent reserve out, release"}, 166 + {0x3, "Persistent reserve out, clear"}, 167 + {0x4, "Persistent reserve out, preempt"}, 168 + {0x5, "Persistent reserve out, preempt and abort"}, 169 + {0x6, "Persistent reserve out, register and ignore existing key"}, 170 + {0x7, "Persistent reserve out, register and move"}, 171 + }; 172 + #define PR_OUT_SZ ARRAY_SIZE(pr_out_arr) 173 + 174 + /* SPC-4 rev 34 renamed the Extended Copy opcode to Third Party Copy Out. 175 + LID1 (List Identifier length: 1 byte) is the Extended Copy found in SPC-2 176 + and SPC-3 */ 177 + static const struct value_name_pair tpc_out_arr[] = { 178 + {0x0, "Extended copy(LID1)"}, 179 + {0x1, "Extended copy(LID4)"}, 180 + {0x10, "Populate token"}, 181 + {0x11, "Write using token"}, 182 + {0x1c, "Copy operation abort"}, 183 + }; 184 + #define TPC_OUT_SZ ARRAY_SIZE(tpc_out_arr) 185 + 186 + static const struct value_name_pair tpc_in_arr[] = { 187 + {0x0, "Receive copy status(LID1)"}, 188 + {0x1, "Receive copy data(LID1)"}, 189 + {0x3, "Receive copy operating parameters"}, 190 + {0x4, "Receive copy failure details(LID1)"}, 191 + {0x5, "Receive copy status(LID4)"}, 192 + {0x6, "Receive copy data(LID4)"}, 193 + {0x7, "Receive ROD token information"}, 194 + {0x8, "Report all ROD tokens"}, 195 + }; 196 + #define TPC_IN_SZ ARRAY_SIZE(tpc_in_arr) 197 + 161 198 162 199 static const struct value_name_pair variable_length_arr[] = { 163 200 {0x1, "Rebuild(32)"}, ··· 260 207 static void print_opcode_name(unsigned char * cdbp, int cdb_len) 261 208 { 262 209 int sa, len, cdb0; 210 + int fin_name = 0; 263 211 const char * name; 264 212 265 213 cdb0 = cdbp[0]; ··· 273 219 break; 274 220 } 275 221 sa = (cdbp[8] << 8) + cdbp[9]; 276 - name = get_sa_name(variable_length_arr, VARIABLE_LENGTH_SZ, sa); 222 + name = get_sa_name(variable_length_arr, VARIABLE_LENGTH_SZ, 223 + sa); 277 224 if (name) 278 225 printk("%s", name); 279 226 else ··· 287 232 case MAINTENANCE_IN: 288 233 sa = cdbp[1] & 0x1f; 289 234 name = get_sa_name(maint_in_arr, MAINT_IN_SZ, sa); 290 - if (name) 291 - printk("%s", name); 292 - else 293 - printk("cdb[0]=0x%x, sa=0x%x", cdb0, sa); 235 + fin_name = 1; 294 236 break; 295 237 case MAINTENANCE_OUT: 296 238 sa = cdbp[1] & 0x1f; 297 239 name = get_sa_name(maint_out_arr, MAINT_OUT_SZ, sa); 298 - if (name) 299 - printk("%s", name); 300 - else 301 - printk("cdb[0]=0x%x, sa=0x%x", cdb0, sa); 240 + fin_name = 1; 241 + break; 242 + case PERSISTENT_RESERVE_IN: 243 + sa = cdbp[1] & 0x1f; 244 + name = get_sa_name(pr_in_arr, PR_IN_SZ, sa); 245 + fin_name = 1; 246 + break; 247 + case PERSISTENT_RESERVE_OUT: 248 + sa = cdbp[1] & 0x1f; 249 + name = get_sa_name(pr_out_arr, PR_OUT_SZ, sa); 250 + fin_name = 1; 302 251 break; 303 252 case SERVICE_ACTION_IN_12: 304 253 sa = cdbp[1] & 0x1f; 305 254 name = get_sa_name(serv_in12_arr, SERV_IN12_SZ, sa); 306 - if (name) 307 - printk("%s", name); 308 - else 309 - printk("cdb[0]=0x%x, sa=0x%x", cdb0, sa); 255 + fin_name = 1; 310 256 break; 311 257 case SERVICE_ACTION_OUT_12: 312 258 sa = cdbp[1] & 0x1f; 313 259 name = get_sa_name(serv_out12_arr, SERV_OUT12_SZ, sa); 314 - if (name) 315 - printk("%s", name); 316 - else 317 - printk("cdb[0]=0x%x, sa=0x%x", cdb0, sa); 260 + fin_name = 1; 261 + break; 262 + case SERVICE_ACTION_BIDIRECTIONAL: 263 + sa = cdbp[1] & 0x1f; 264 + name = get_sa_name(serv_bidi_arr, SERV_BIDI_SZ, sa); 265 + fin_name = 1; 318 266 break; 319 267 case SERVICE_ACTION_IN_16: 320 268 sa = cdbp[1] & 0x1f; 321 269 name = get_sa_name(serv_in16_arr, SERV_IN16_SZ, sa); 322 - if (name) 323 - printk("%s", name); 324 - else 325 - printk("cdb[0]=0x%x, sa=0x%x", cdb0, sa); 270 + fin_name = 1; 326 271 break; 327 272 case SERVICE_ACTION_OUT_16: 328 273 sa = cdbp[1] & 0x1f; 329 274 name = get_sa_name(serv_out16_arr, SERV_OUT16_SZ, sa); 330 - if (name) 331 - printk("%s", name); 332 - else 333 - printk("cdb[0]=0x%x, sa=0x%x", cdb0, sa); 275 + fin_name = 1; 276 + break; 277 + case THIRD_PARTY_COPY_IN: 278 + sa = cdbp[1] & 0x1f; 279 + name = get_sa_name(tpc_in_arr, TPC_IN_SZ, sa); 280 + fin_name = 1; 281 + break; 282 + case THIRD_PARTY_COPY_OUT: 283 + sa = cdbp[1] & 0x1f; 284 + name = get_sa_name(tpc_out_arr, TPC_OUT_SZ, sa); 285 + fin_name = 1; 334 286 break; 335 287 default: 336 288 if (cdb0 < 0xc0) { ··· 349 287 } else 350 288 printk("cdb[0]=0x%x (vendor)", cdb0); 351 289 break; 290 + } 291 + if (fin_name) { 292 + if (name) 293 + printk("%s", name); 294 + else 295 + printk("cdb[0]=0x%x, sa=0x%x", cdb0, sa); 352 296 } 353 297 } 354 298 ··· 380 312 break; 381 313 case MAINTENANCE_IN: 382 314 case MAINTENANCE_OUT: 315 + case PERSISTENT_RESERVE_IN: 316 + case PERSISTENT_RESERVE_OUT: 383 317 case SERVICE_ACTION_IN_12: 384 318 case SERVICE_ACTION_OUT_12: 319 + case SERVICE_ACTION_BIDIRECTIONAL: 385 320 case SERVICE_ACTION_IN_16: 386 321 case SERVICE_ACTION_OUT_16: 322 + case THIRD_PARTY_COPY_IN: 323 + case THIRD_PARTY_COPY_OUT: 387 324 sa = cdbp[1] & 0x1f; 388 325 printk("cdb[0]=0x%x, sa=0x%x", cdb0, sa); 389 326 break; ··· 400 327 break; 401 328 } 402 329 } 403 - #endif 330 + #endif 404 331 405 332 void __scsi_print_command(unsigned char *cdb) 406 333 { ··· 409 336 print_opcode_name(cdb, 0); 410 337 len = scsi_command_size(cdb); 411 338 /* print out all bytes in cdb */ 412 - for (k = 0; k < len; ++k) 339 + for (k = 0; k < len; ++k) 413 340 printk(" %02x", cdb[k]); 414 341 printk("\n"); 415 342 } ··· 477 404 478 405 /* 479 406 * The canonical list of T10 Additional Sense Codes is available at: 480 - * http://www.t10.org/lists/asc-num.txt 407 + * http://www.t10.org/lists/asc-num.txt [most recent: 20130605] 481 408 */ 409 + 482 410 static const struct error_info additional[] = 483 411 { 484 412 {0x0000, "No additional sense information"}, ··· 504 430 {0x001C, "Verify operation in progress"}, 505 431 {0x001D, "ATA pass through information available"}, 506 432 {0x001E, "Conflicting SA creation request"}, 433 + {0x001F, "Logical unit transitioning to another power condition"}, 434 + {0x0020, "Extended copy information available"}, 507 435 508 436 {0x0100, "No index/sector signal"}, 509 437 ··· 536 460 {0x0412, "Logical unit not ready, offline"}, 537 461 {0x0413, "Logical unit not ready, SA creation in progress"}, 538 462 {0x0414, "Logical unit not ready, space allocation in progress"}, 463 + {0x0415, "Logical unit not ready, robotics disabled"}, 464 + {0x0416, "Logical unit not ready, configuration required"}, 465 + {0x0417, "Logical unit not ready, calibration required"}, 466 + {0x0418, "Logical unit not ready, a door is open"}, 467 + {0x0419, "Logical unit not ready, operating in sequential mode"}, 468 + {0x041A, "Logical unit not ready, start stop unit command in " 469 + "progress"}, 470 + {0x041B, "Logical unit not ready, sanitize in progress"}, 471 + {0x041C, "Logical unit not ready, additional power use not yet " 472 + "granted"}, 473 + {0x041D, "Logical unit not ready, configuration in progress"}, 539 474 540 475 {0x0500, "Logical unit does not respond to selection"}, 541 476 ··· 577 490 {0x0B06, "Warning - non-volatile cache now volatile"}, 578 491 {0x0B07, "Warning - degraded power to non-volatile cache"}, 579 492 {0x0B08, "Warning - power loss expected"}, 493 + {0x0B09, "Warning - device statistics notification active"}, 580 494 581 495 {0x0C00, "Write error"}, 582 496 {0x0C01, "Write error - recovered with auto reallocation"}, ··· 593 505 {0x0C0B, "Auxiliary memory write error"}, 594 506 {0x0C0C, "Write error - unexpected unsolicited data"}, 595 507 {0x0C0D, "Write error - not enough unsolicited data"}, 508 + {0x0C0E, "Multiple write errors"}, 596 509 {0x0C0F, "Defects in error window"}, 597 510 598 511 {0x0D00, "Error detected by third party temporary initiator"}, ··· 612 523 {0x1001, "Logical block guard check failed"}, 613 524 {0x1002, "Logical block application tag check failed"}, 614 525 {0x1003, "Logical block reference tag check failed"}, 526 + {0x1004, "Logical block protection error on recover buffered data"}, 527 + {0x1005, "Logical block protection method error"}, 615 528 616 529 {0x1100, "Unrecovered read error"}, 617 530 {0x1101, "Read retries exhausted"}, ··· 636 545 {0x1112, "Auxiliary memory read error"}, 637 546 {0x1113, "Read error - failed retransmission request"}, 638 547 {0x1114, "Read error - lba marked bad by application client"}, 548 + {0x1115, "Write after sanitize required"}, 639 549 640 550 {0x1200, "Address mark not found for id field"}, 641 551 ··· 714 622 {0x2009, "Access denied - invalid LU identifier"}, 715 623 {0x200A, "Access denied - invalid proxy token"}, 716 624 {0x200B, "Access denied - ACL LUN conflict"}, 625 + {0x200C, "Illegal command when not in append-only mode"}, 717 626 718 627 {0x2100, "Logical block address out of range"}, 719 628 {0x2101, "Invalid element address"}, ··· 722 629 {0x2103, "Invalid write crossing layer jump"}, 723 630 724 631 {0x2200, "Illegal function (use 20 00, 24 00, or 26 00)"}, 632 + 633 + {0x2300, "Invalid token operation, cause not reportable"}, 634 + {0x2301, "Invalid token operation, unsupported token type"}, 635 + {0x2302, "Invalid token operation, remote token usage not supported"}, 636 + {0x2303, "Invalid token operation, remote rod token creation not " 637 + "supported"}, 638 + {0x2304, "Invalid token operation, token unknown"}, 639 + {0x2305, "Invalid token operation, token corrupt"}, 640 + {0x2306, "Invalid token operation, token revoked"}, 641 + {0x2307, "Invalid token operation, token expired"}, 642 + {0x2308, "Invalid token operation, token cancelled"}, 643 + {0x2309, "Invalid token operation, token deleted"}, 644 + {0x230A, "Invalid token operation, invalid token length"}, 725 645 726 646 {0x2400, "Invalid field in cdb"}, 727 647 {0x2401, "CDB decryption error"}, ··· 811 705 "event"}, 812 706 {0x2A13, "Data encryption key instance counter has changed"}, 813 707 {0x2A14, "SA creation capabilities data has changed"}, 708 + {0x2A15, "Medium removal prevention preempted"}, 814 709 815 710 {0x2B00, "Copy cannot execute since host cannot disconnect"}, 816 711 ··· 827 720 {0x2C09, "Previous reservation conflict status"}, 828 721 {0x2C0A, "Partition or collection contains user objects"}, 829 722 {0x2C0B, "Not reserved"}, 723 + {0x2C0C, "Orwrite generation does not match"}, 830 724 831 725 {0x2D00, "Overwrite error on update in place"}, 832 726 ··· 836 728 {0x2F00, "Commands cleared by another initiator"}, 837 729 {0x2F01, "Commands cleared by power loss notification"}, 838 730 {0x2F02, "Commands cleared by device server"}, 731 + {0x2F03, "Some commands cleared by queuing layer event"}, 839 732 840 733 {0x3000, "Incompatible medium installed"}, 841 734 {0x3001, "Cannot read medium - unknown format"}, ··· 854 745 {0x3010, "Medium not formatted"}, 855 746 {0x3011, "Incompatible volume type"}, 856 747 {0x3012, "Incompatible volume qualifier"}, 748 + {0x3013, "Cleaning volume expired"}, 857 749 858 750 {0x3100, "Medium format corrupted"}, 859 751 {0x3101, "Format command failed"}, 860 752 {0x3102, "Zoned formatting failed due to spare linking"}, 753 + {0x3103, "Sanitize command failed"}, 861 754 862 755 {0x3200, "No defect spare location available"}, 863 756 {0x3201, "Defect list update failure"}, ··· 920 809 {0x3B19, "Element enabled"}, 921 810 {0x3B1A, "Data transfer device removed"}, 922 811 {0x3B1B, "Data transfer device inserted"}, 812 + {0x3B1C, "Too many logical objects on partition to support " 813 + "operation"}, 923 814 924 815 {0x3D00, "Invalid bits in identify message"}, 925 816 ··· 952 839 {0x3F12, "iSCSI IP address added"}, 953 840 {0x3F13, "iSCSI IP address removed"}, 954 841 {0x3F14, "iSCSI IP address changed"}, 842 + {0x3F15, "Inspect referrals sense descriptors"}, 955 843 /* 956 844 * {0x40NN, "Ram failure"}, 957 845 * {0x40NN, "Diagnostic failure on component nn"}, ··· 962 848 {0x4300, "Message error"}, 963 849 964 850 {0x4400, "Internal target failure"}, 851 + {0x4401, "Persistent reservation information lost"}, 965 852 {0x4471, "ATA device failed set features"}, 966 853 967 854 {0x4500, "Select or reselect failure"}, ··· 991 876 {0x4B04, "Nak received"}, 992 877 {0x4B05, "Data offset error"}, 993 878 {0x4B06, "Initiator response timeout"}, 879 + {0x4B07, "Connection lost"}, 880 + {0x4B08, "Data-in buffer overflow - data buffer size"}, 881 + {0x4B09, "Data-in buffer overflow - data buffer descriptor area"}, 882 + {0x4B0A, "Data-in buffer error"}, 883 + {0x4B0B, "Data-out buffer overflow - data buffer size"}, 884 + {0x4B0C, "Data-out buffer overflow - data buffer descriptor area"}, 885 + {0x4B0D, "Data-out buffer error"}, 886 + {0x4B0E, "PCIe fabric error"}, 887 + {0x4B0F, "PCIe completion timeout"}, 888 + {0x4B10, "PCIe completer abort"}, 889 + {0x4B11, "PCIe poisoned tlp received"}, 890 + {0x4B12, "PCIe eCRC check failed"}, 891 + {0x4B13, "PCIe unsupported request"}, 892 + {0x4B14, "PCIe acs violation"}, 893 + {0x4B15, "PCIe tlp prefix blocked"}, 994 894 995 895 {0x4C00, "Logical unit failed self-configuration"}, 996 896 /* ··· 1027 897 {0x5302, "Medium removal prevented"}, 1028 898 {0x5303, "Medium removal prevented by data transfer element"}, 1029 899 {0x5304, "Medium thread or unthread failure"}, 900 + {0x5305, "Volume identifier invalid"}, 901 + {0x5306, "Volume identifier missing"}, 902 + {0x5307, "Duplicate volume identifier"}, 903 + {0x5308, "Element status unknown"}, 1030 904 1031 905 {0x5400, "Scsi to host system interface failure"}, 1032 906 ··· 1045 911 {0x5508, "Maximum number of supplemental decryption keys exceeded"}, 1046 912 {0x5509, "Medium auxiliary memory not accessible"}, 1047 913 {0x550A, "Data currently unavailable"}, 914 + {0x550B, "Insufficient power for operation"}, 915 + {0x550C, "Insufficient resources to create rod"}, 916 + {0x550D, "Insufficient resources to create rod token"}, 1048 917 1049 918 {0x5700, "Unable to recover table-of-contents"}, 1050 919 ··· 1206 1069 {0x670B, "ATA device feature not enabled"}, 1207 1070 1208 1071 {0x6800, "Logical unit not configured"}, 1072 + {0x6801, "Subsidiary logical unit not configured"}, 1209 1073 1210 1074 {0x6900, "Data loss on logical unit"}, 1211 1075 {0x6901, "Multiple logical unit failures"}, ··· 1323 1185 "Vendor Specific(9)", 1324 1186 "Copy Aborted", /* A: COPY or COMPARE was aborted */ 1325 1187 "Aborted Command", /* B: The target aborted the command */ 1326 - "Equal", /* C: A SEARCH DATA command found data equal */ 1188 + "Equal", /* C: A SEARCH DATA command found data equal, 1189 + reserved in SPC-4 rev 36 */ 1327 1190 "Volume Overflow", /* D: Medium full with still data to be written */ 1328 1191 "Miscompare", /* E: Source data and data on the medium 1329 1192 do not agree */ 1193 + "Completed", /* F: command completed sense data reported, 1194 + may occur for successful command */ 1330 1195 }; 1331 1196 #endif 1332 1197 ··· 1447 1306 struct scsi_sense_hdr *sshdr) 1448 1307 { 1449 1308 int k, num, res; 1450 - 1309 + 1451 1310 res = scsi_normalize_sense(sense_buffer, sense_len, sshdr); 1452 1311 if (0 == res) { 1453 1312 /* this may be SCSI-1 sense data */ ··· 1600 1459 scsi_show_result(cmd->result); 1601 1460 } 1602 1461 EXPORT_SYMBOL(scsi_print_result); 1603 - 1604 -
+15 -11
drivers/scsi/fcoe/fcoe.c
··· 774 774 struct fcoe_port *port; 775 775 struct net_device *realdev; 776 776 int rc; 777 - struct netdev_fcoe_hbainfo fdmi; 778 777 779 778 port = lport_priv(lport); 780 779 fcoe = port->priv; ··· 787 788 return; 788 789 789 790 if (realdev->netdev_ops->ndo_fcoe_get_hbainfo) { 790 - memset(&fdmi, 0, sizeof(fdmi)); 791 + struct netdev_fcoe_hbainfo *fdmi; 792 + fdmi = kzalloc(sizeof(*fdmi), GFP_KERNEL); 793 + if (!fdmi) 794 + return; 795 + 791 796 rc = realdev->netdev_ops->ndo_fcoe_get_hbainfo(realdev, 792 - &fdmi); 797 + fdmi); 793 798 if (rc) { 794 799 printk(KERN_INFO "fcoe: Failed to retrieve FDMI " 795 800 "information from netdev.\n"); ··· 803 800 snprintf(fc_host_serial_number(lport->host), 804 801 FC_SERIAL_NUMBER_SIZE, 805 802 "%s", 806 - fdmi.serial_number); 803 + fdmi->serial_number); 807 804 snprintf(fc_host_manufacturer(lport->host), 808 805 FC_SERIAL_NUMBER_SIZE, 809 806 "%s", 810 - fdmi.manufacturer); 807 + fdmi->manufacturer); 811 808 snprintf(fc_host_model(lport->host), 812 809 FC_SYMBOLIC_NAME_SIZE, 813 810 "%s", 814 - fdmi.model); 811 + fdmi->model); 815 812 snprintf(fc_host_model_description(lport->host), 816 813 FC_SYMBOLIC_NAME_SIZE, 817 814 "%s", 818 - fdmi.model_description); 815 + fdmi->model_description); 819 816 snprintf(fc_host_hardware_version(lport->host), 820 817 FC_VERSION_STRING_SIZE, 821 818 "%s", 822 - fdmi.hardware_version); 819 + fdmi->hardware_version); 823 820 snprintf(fc_host_driver_version(lport->host), 824 821 FC_VERSION_STRING_SIZE, 825 822 "%s", 826 - fdmi.driver_version); 823 + fdmi->driver_version); 827 824 snprintf(fc_host_optionrom_version(lport->host), 828 825 FC_VERSION_STRING_SIZE, 829 826 "%s", 830 - fdmi.optionrom_version); 827 + fdmi->optionrom_version); 831 828 snprintf(fc_host_firmware_version(lport->host), 832 829 FC_VERSION_STRING_SIZE, 833 830 "%s", 834 - fdmi.firmware_version); 831 + fdmi->firmware_version); 835 832 836 833 /* Enable FDMI lport states */ 837 834 lport->fdmi_enabled = 1; 835 + kfree(fdmi); 838 836 } else { 839 837 lport->fdmi_enabled = 0; 840 838 printk(KERN_INFO "fcoe: No FDMI support.\n");
+4
drivers/scsi/fcoe/fcoe_ctlr.c
··· 2090 2090 */ 2091 2091 static void fcoe_ctlr_disc_stop_locked(struct fc_lport *lport) 2092 2092 { 2093 + struct fc_rport_priv *rdata; 2094 + 2093 2095 mutex_lock(&lport->disc.disc_mutex); 2096 + list_for_each_entry_rcu(rdata, &lport->disc.rports, peers) 2097 + lport->tt.rport_logoff(rdata); 2094 2098 lport->disc.disc_callback = NULL; 2095 2099 mutex_unlock(&lport->disc.disc_mutex); 2096 2100 }
+12 -12
drivers/scsi/fcoe/fcoe_sysfs.c
··· 507 507 NULL, 508 508 }; 509 509 510 - struct bus_type fcoe_bus_type; 510 + static struct bus_type fcoe_bus_type; 511 511 512 512 static int fcoe_bus_match(struct device *dev, 513 513 struct device_driver *drv) ··· 541 541 kfree(fcf); 542 542 } 543 543 544 - struct device_type fcoe_ctlr_device_type = { 544 + static struct device_type fcoe_ctlr_device_type = { 545 545 .name = "fcoe_ctlr", 546 546 .groups = fcoe_ctlr_attr_groups, 547 547 .release = fcoe_ctlr_device_release, 548 548 }; 549 549 550 - struct device_type fcoe_fcf_device_type = { 550 + static struct device_type fcoe_fcf_device_type = { 551 551 .name = "fcoe_fcf", 552 552 .groups = fcoe_fcf_attr_groups, 553 553 .release = fcoe_fcf_device_release, 554 554 }; 555 555 556 - struct bus_attribute fcoe_bus_attr_group[] = { 556 + static struct bus_attribute fcoe_bus_attr_group[] = { 557 557 __ATTR(ctlr_create, S_IWUSR, NULL, fcoe_ctlr_create_store), 558 558 __ATTR(ctlr_destroy, S_IWUSR, NULL, fcoe_ctlr_destroy_store), 559 559 __ATTR_NULL 560 560 }; 561 561 562 - struct bus_type fcoe_bus_type = { 562 + static struct bus_type fcoe_bus_type = { 563 563 .name = "fcoe", 564 564 .match = &fcoe_bus_match, 565 565 .bus_attrs = fcoe_bus_attr_group, ··· 569 569 * fcoe_ctlr_device_flush_work() - Flush a FIP ctlr's workqueue 570 570 * @ctlr: Pointer to the FIP ctlr whose workqueue is to be flushed 571 571 */ 572 - void fcoe_ctlr_device_flush_work(struct fcoe_ctlr_device *ctlr) 572 + static void fcoe_ctlr_device_flush_work(struct fcoe_ctlr_device *ctlr) 573 573 { 574 574 if (!fcoe_ctlr_work_q(ctlr)) { 575 575 printk(KERN_ERR ··· 590 590 * Return value: 591 591 * 1 on success / 0 already queued / < 0 for error 592 592 */ 593 - int fcoe_ctlr_device_queue_work(struct fcoe_ctlr_device *ctlr, 594 - struct work_struct *work) 593 + static int fcoe_ctlr_device_queue_work(struct fcoe_ctlr_device *ctlr, 594 + struct work_struct *work) 595 595 { 596 596 if (unlikely(!fcoe_ctlr_work_q(ctlr))) { 597 597 printk(KERN_ERR ··· 609 609 * fcoe_ctlr_device_flush_devloss() - Flush a FIP ctlr's devloss workqueue 610 610 * @ctlr: Pointer to FIP ctlr whose workqueue is to be flushed 611 611 */ 612 - void fcoe_ctlr_device_flush_devloss(struct fcoe_ctlr_device *ctlr) 612 + static void fcoe_ctlr_device_flush_devloss(struct fcoe_ctlr_device *ctlr) 613 613 { 614 614 if (!fcoe_ctlr_devloss_work_q(ctlr)) { 615 615 printk(KERN_ERR ··· 631 631 * Return value: 632 632 * 1 on success / 0 already queued / < 0 for error 633 633 */ 634 - int fcoe_ctlr_device_queue_devloss_work(struct fcoe_ctlr_device *ctlr, 635 - struct delayed_work *work, 636 - unsigned long delay) 634 + static int fcoe_ctlr_device_queue_devloss_work(struct fcoe_ctlr_device *ctlr, 635 + struct delayed_work *work, 636 + unsigned long delay) 637 637 { 638 638 if (unlikely(!fcoe_ctlr_devloss_work_q(ctlr))) { 639 639 printk(KERN_ERR
+5 -21
drivers/scsi/fcoe/fcoe_transport.c
··· 180 180 { 181 181 struct fcoe_ctlr *fip = fcoe_ctlr_device_priv(ctlr_dev); 182 182 struct net_device *netdev = fcoe_get_netdev(fip->lp); 183 - struct fcoe_fc_els_lesb *fcoe_lesb; 184 - struct fc_els_lesb fc_lesb; 183 + struct fc_els_lesb *fc_lesb; 185 184 186 - __fcoe_get_lesb(fip->lp, &fc_lesb, netdev); 187 - fcoe_lesb = (struct fcoe_fc_els_lesb *)(&fc_lesb); 188 - 189 - ctlr_dev->lesb.lesb_link_fail = 190 - ntohl(fcoe_lesb->lesb_link_fail); 191 - ctlr_dev->lesb.lesb_vlink_fail = 192 - ntohl(fcoe_lesb->lesb_vlink_fail); 193 - ctlr_dev->lesb.lesb_miss_fka = 194 - ntohl(fcoe_lesb->lesb_miss_fka); 195 - ctlr_dev->lesb.lesb_symb_err = 196 - ntohl(fcoe_lesb->lesb_symb_err); 197 - ctlr_dev->lesb.lesb_err_block = 198 - ntohl(fcoe_lesb->lesb_err_block); 199 - ctlr_dev->lesb.lesb_fcs_error = 200 - ntohl(fcoe_lesb->lesb_fcs_error); 185 + fc_lesb = (struct fc_els_lesb *)(&ctlr_dev->lesb); 186 + __fcoe_get_lesb(fip->lp, fc_lesb, netdev); 201 187 } 202 188 EXPORT_SYMBOL_GPL(fcoe_ctlr_get_lesb); 203 189 ··· 707 721 { 708 722 struct net_device *netdev = NULL; 709 723 struct fcoe_transport *ft = NULL; 710 - struct fcoe_ctlr_device *ctlr_dev = NULL; 711 724 int rc = 0; 712 725 int err; 713 726 ··· 753 768 goto out_putdev; 754 769 } 755 770 756 - LIBFCOE_TRANSPORT_DBG("transport %s %s to create fcoe on %s.\n", 757 - ft->name, (ctlr_dev) ? "succeeded" : "failed", 758 - netdev->name); 771 + LIBFCOE_TRANSPORT_DBG("transport %s succeeded to create fcoe on %s.\n", 772 + ft->name, netdev->name); 759 773 760 774 out_putdev: 761 775 dev_put(netdev);
+2 -2
drivers/scsi/libfc/fc_exch.c
··· 337 337 * fc_exch_timer_cancel() - cancel exch timer 338 338 * @ep: The exchange whose timer to be canceled 339 339 */ 340 - static inline void fc_exch_timer_cancel(struct fc_exch *ep) 340 + static inline void fc_exch_timer_cancel(struct fc_exch *ep) 341 341 { 342 342 if (cancel_delayed_work(&ep->timeout_work)) { 343 343 FC_EXCH_DBG(ep, "Exchange timer canceled\n"); ··· 1567 1567 fc_exch_rctl_name(fh->fh_r_ctl)); 1568 1568 1569 1569 if (cancel_delayed_work_sync(&ep->timeout_work)) { 1570 - FC_EXCH_DBG(ep, "Exchange timer canceled\n"); 1570 + FC_EXCH_DBG(ep, "Exchange timer canceled due to ABTS response\n"); 1571 1571 fc_exch_release(ep); /* release from pending timer hold */ 1572 1572 } 1573 1573
+27
drivers/scsi/libfc/fc_rport.c
··· 926 926 kref_put(&rdata->kref, rdata->local_port->tt.rport_destroy); 927 927 } 928 928 929 + static bool 930 + fc_rport_compatible_roles(struct fc_lport *lport, struct fc_rport_priv *rdata) 931 + { 932 + if (rdata->ids.roles == FC_PORT_ROLE_UNKNOWN) 933 + return true; 934 + if ((rdata->ids.roles & FC_PORT_ROLE_FCP_TARGET) && 935 + (lport->service_params & FCP_SPPF_INIT_FCN)) 936 + return true; 937 + if ((rdata->ids.roles & FC_PORT_ROLE_FCP_INITIATOR) && 938 + (lport->service_params & FCP_SPPF_TARG_FCN)) 939 + return true; 940 + return false; 941 + } 942 + 929 943 /** 930 944 * fc_rport_enter_plogi() - Send Port Login (PLOGI) request 931 945 * @rdata: The remote port to send a PLOGI to ··· 951 937 { 952 938 struct fc_lport *lport = rdata->local_port; 953 939 struct fc_frame *fp; 940 + 941 + if (!fc_rport_compatible_roles(lport, rdata)) { 942 + FC_RPORT_DBG(rdata, "PLOGI suppressed for incompatible role\n"); 943 + fc_rport_state_enter(rdata, RPORT_ST_PLOGI_WAIT); 944 + return; 945 + } 954 946 955 947 FC_RPORT_DBG(rdata, "Port entered PLOGI state from %s state\n", 956 948 fc_rport_state(rdata)); ··· 1663 1643 fc_rport_state(rdata)); 1664 1644 mutex_unlock(&rdata->rp_mutex); 1665 1645 rjt_data.reason = ELS_RJT_BUSY; 1646 + rjt_data.explan = ELS_EXPL_NONE; 1647 + goto reject; 1648 + } 1649 + if (!fc_rport_compatible_roles(lport, rdata)) { 1650 + FC_RPORT_DBG(rdata, "Received PLOGI for incompatible role\n"); 1651 + mutex_unlock(&rdata->rp_mutex); 1652 + rjt_data.reason = ELS_RJT_LOGIC; 1666 1653 rjt_data.explan = ELS_EXPL_NONE; 1667 1654 goto reject; 1668 1655 }
+6 -4
drivers/scsi/megaraid/megaraid_sas_base.c
··· 4958 4958 sense, sense_handle); 4959 4959 } 4960 4960 4961 - for (i = 0; i < ioc->sge_count && kbuff_arr[i]; i++) { 4962 - dma_free_coherent(&instance->pdev->dev, 4963 - kern_sge32[i].length, 4964 - kbuff_arr[i], kern_sge32[i].phys_addr); 4961 + for (i = 0; i < ioc->sge_count; i++) { 4962 + if (kbuff_arr[i]) 4963 + dma_free_coherent(&instance->pdev->dev, 4964 + kern_sge32[i].length, 4965 + kbuff_arr[i], 4966 + kern_sge32[i].phys_addr); 4965 4967 } 4966 4968 4967 4969 megasas_return_cmd(instance, cmd);
+2 -2
drivers/scsi/megaraid/megaraid_sas_fp.c
··· 585 585 case 1: 586 586 /* start with logical arm */ 587 587 arm = get_arm_from_strip(instance, ld, stripe, map); 588 - if (arm != -1UL) 588 + if (arm != -1U) 589 589 arm *= 2; 590 590 break; 591 591 } ··· 637 637 638 638 if (raid->level == 6) { 639 639 logArm = get_arm_from_strip(instance, ld, stripRow, map); 640 - if (logArm == -1UL) 640 + if (logArm == -1U) 641 641 return FALSE; 642 642 rowMod = mega_mod64(row, SPAN_ROW_SIZE(map, ld, span)); 643 643 armQ = SPAN_ROW_SIZE(map, ld, span) - 1 - rowMod;
+1 -1
drivers/scsi/mpt3sas/Kconfig
··· 2 2 # Kernel configuration file for the MPT3SAS 3 3 # 4 4 # This code is based on drivers/scsi/mpt3sas/Kconfig 5 - # Copyright (C) 2012 LSI Corporation 5 + # Copyright (C) 2012-2013 LSI Corporation 6 6 # (mailto:DL-MPTFusionLinux@lsi.com) 7 7 8 8 # This program is free software; you can redistribute it and/or
+9 -3
drivers/scsi/mpt3sas/mpi/mpi2.h
··· 1 1 /* 2 - * Copyright (c) 2000-2012 LSI Corporation. 2 + * Copyright (c) 2000-2013 LSI Corporation. 3 3 * 4 4 * 5 5 * Name: mpi2.h ··· 8 8 * scatter/gather formats. 9 9 * Creation Date: June 21, 2006 10 10 * 11 - * mpi2.h Version: 02.00.26 11 + * mpi2.h Version: 02.00.29 12 12 * 13 13 * NOTE: Names (typedefs, defines, etc.) beginning with an MPI25 or Mpi25 14 14 * prefix are for use only on MPI v2.5 products, and must not be used ··· 82 82 * 03-29-12 02.00.25 Bumped MPI2_HEADER_VERSION_UNIT. 83 83 * Added Hard Reset delay timings. 84 84 * 07-10-12 02.00.26 Bumped MPI2_HEADER_VERSION_UNIT. 85 + * 07-26-12 02.00.27 Bumped MPI2_HEADER_VERSION_UNIT. 86 + * 11-27-12 02.00.28 Bumped MPI2_HEADER_VERSION_UNIT. 87 + * 12-20-12 02.00.29 Bumped MPI2_HEADER_VERSION_UNIT. 88 + * Added MPI25_SUP_REPLY_POST_HOST_INDEX_OFFSET. 85 89 * -------------------------------------------------------------------------- 86 90 */ 87 91 ··· 119 115 #define MPI2_VERSION_02_05 (0x0205) 120 116 121 117 /*Unit and Dev versioning for this MPI header set */ 122 - #define MPI2_HEADER_VERSION_UNIT (0x1A) 118 + #define MPI2_HEADER_VERSION_UNIT (0x1D) 123 119 #define MPI2_HEADER_VERSION_DEV (0x00) 124 120 #define MPI2_HEADER_VERSION_UNIT_MASK (0xFF00) 125 121 #define MPI2_HEADER_VERSION_UNIT_SHIFT (8) ··· 278 274 #define MPI2_REPLY_POST_HOST_INDEX_MASK (0x00FFFFFF) 279 275 #define MPI2_RPHI_MSIX_INDEX_MASK (0xFF000000) 280 276 #define MPI2_RPHI_MSIX_INDEX_SHIFT (24) 277 + #define MPI25_SUP_REPLY_POST_HOST_INDEX_OFFSET (0x0000030C) /*MPI v2.5 only*/ 278 + 281 279 282 280 /* 283 281 *Defines for the HCBSize and address
+13 -2
drivers/scsi/mpt3sas/mpi/mpi2_cnfg.h
··· 1 1 /* 2 - * Copyright (c) 2000-2011 LSI Corporation. 2 + * Copyright (c) 2000-2013 LSI Corporation. 3 3 * 4 4 * 5 5 * Name: mpi2_cnfg.h 6 6 * Title: MPI Configuration messages and pages 7 7 * Creation Date: November 10, 2006 8 8 * 9 - * mpi2_cnfg.h Version: 02.00.22 9 + * mpi2_cnfg.h Version: 02.00.24 10 10 * 11 11 * NOTE: Names (typedefs, defines, etc.) beginning with an MPI25 or Mpi25 12 12 * prefix are for use only on MPI v2.5 products, and must not be used ··· 155 155 * Added UEFIVersion field to BIOS Page 1 and defined new 156 156 * BiosOptions bits. 157 157 * Incorporating additions for MPI v2.5. 158 + * 11-27-12 02.00.23 Added MPI2_MANPAGE7_FLAG_EVENTREPLAY_SLOT_ORDER. 159 + * Added MPI2_BIOSPAGE1_OPTIONS_MASK_OEM_ID. 160 + * 12-20-12 02.00.24 Marked MPI2_SASIOUNIT1_CONTROL_CLEAR_AFFILIATION as 161 + * obsolete for MPI v2.5 and later. 162 + * Added some defines for 12G SAS speeds. 158 163 * -------------------------------------------------------------------------- 159 164 */ 160 165 ··· 719 714 #define MPI2_MANUFACTURING7_PAGEVERSION (0x01) 720 715 721 716 /*defines for the Flags field */ 717 + #define MPI2_MANPAGE7_FLAG_EVENTREPLAY_SLOT_ORDER (0x00000002) 722 718 #define MPI2_MANPAGE7_FLAG_USE_SLOT_INFO (0x00000001) 723 719 724 720 ··· 1316 1310 #define MPI2_BIOSPAGE1_PAGEVERSION (0x05) 1317 1311 1318 1312 /*values for BIOS Page 1 BiosOptions field */ 1313 + #define MPI2_BIOSPAGE1_OPTIONS_MASK_OEM_ID (0x000000F0) 1314 + #define MPI2_BIOSPAGE1_OPTIONS_LSI_OEM_ID (0x00000000) 1315 + 1319 1316 #define MPI2_BIOSPAGE1_OPTIONS_MASK_UEFI_HII_REGISTRATION (0x00000006) 1320 1317 #define MPI2_BIOSPAGE1_OPTIONS_ENABLE_UEFI_HII (0x00000000) 1321 1318 #define MPI2_BIOSPAGE1_OPTIONS_DISABLE_UEFI_HII (0x00000002) ··· 1893 1884 #define MPI2_SAS_PRATE_MAX_RATE_1_5 (0x80) 1894 1885 #define MPI2_SAS_PRATE_MAX_RATE_3_0 (0x90) 1895 1886 #define MPI2_SAS_PRATE_MAX_RATE_6_0 (0xA0) 1887 + #define MPI25_SAS_PRATE_MAX_RATE_12_0 (0xB0) 1896 1888 #define MPI2_SAS_PRATE_MIN_RATE_MASK (0x0F) 1897 1889 #define MPI2_SAS_PRATE_MIN_RATE_NOT_PROGRAMMABLE (0x00) 1898 1890 #define MPI2_SAS_PRATE_MIN_RATE_1_5 (0x08) ··· 1907 1897 #define MPI2_SAS_HWRATE_MAX_RATE_1_5 (0x80) 1908 1898 #define MPI2_SAS_HWRATE_MAX_RATE_3_0 (0x90) 1909 1899 #define MPI2_SAS_HWRATE_MAX_RATE_6_0 (0xA0) 1900 + #define MPI25_SAS_HWRATE_MAX_RATE_12_0 (0xB0) 1910 1901 #define MPI2_SAS_HWRATE_MIN_RATE_MASK (0x0F) 1911 1902 #define MPI2_SAS_HWRATE_MIN_RATE_1_5 (0x08) 1912 1903 #define MPI2_SAS_HWRATE_MIN_RATE_3_0 (0x09)
+1 -1
drivers/scsi/mpt3sas/mpi/mpi2_init.h
··· 1 1 /* 2 - * Copyright (c) 2000-2012 LSI Corporation. 2 + * Copyright (c) 2000-2013 LSI Corporation. 3 3 * 4 4 * 5 5 * Name: mpi2_init.h
+7 -3
drivers/scsi/mpt3sas/mpi/mpi2_ioc.h
··· 1 1 /* 2 - * Copyright (c) 2000-2012 LSI Corporation. 2 + * Copyright (c) 2000-2013 LSI Corporation. 3 3 * 4 4 * 5 5 * Name: mpi2_ioc.h 6 6 * Title: MPI IOC, Port, Event, FW Download, and FW Upload messages 7 7 * Creation Date: October 11, 2006 8 8 * 9 - * mpi2_ioc.h Version: 02.00.21 9 + * mpi2_ioc.h Version: 02.00.22 10 10 * 11 11 * NOTE: Names (typedefs, defines, etc.) beginning with an MPI25 or Mpi25 12 12 * prefix are for use only on MPI v2.5 products, and must not be used ··· 124 124 * Marked MPI2_PM_CONTROL_FEATURE_PCIE_LINK as obsolete. 125 125 * 11-18-11 02.00.20 Incorporating additions for MPI v2.5. 126 126 * 03-29-12 02.00.21 Added a product specific range to event values. 127 + * 07-26-12 02.00.22 Added MPI2_IOCFACTS_EXCEPT_PARTIAL_MEMORY_FAILURE. 128 + * Added ElapsedSeconds field to 129 + * MPI2_EVENT_DATA_IR_OPERATION_STATUS. 127 130 * -------------------------------------------------------------------------- 128 131 */ 129 132 ··· 286 283 #define MPI2_IOCFACTS_HDRVERSION_DEV_SHIFT (0) 287 284 288 285 /*IOCExceptions */ 286 + #define MPI2_IOCFACTS_EXCEPT_PARTIAL_MEMORY_FAILURE (0x0200) 289 287 #define MPI2_IOCFACTS_EXCEPT_IR_FOREIGN_CONFIG_MAX (0x0100) 290 288 291 289 #define MPI2_IOCFACTS_EXCEPT_BOOTSTAT_MASK (0x00E0) ··· 638 634 U8 RAIDOperation; /*0x04 */ 639 635 U8 PercentComplete; /*0x05 */ 640 636 U16 Reserved2; /*0x06 */ 641 - U32 Resereved3; /*0x08 */ 637 + U32 ElapsedSeconds; /*0x08 */ 642 638 } MPI2_EVENT_DATA_IR_OPERATION_STATUS, 643 639 *PTR_MPI2_EVENT_DATA_IR_OPERATION_STATUS, 644 640 Mpi2EventDataIrOperationStatus_t,
+7 -3
drivers/scsi/mpt3sas/mpi/mpi2_raid.h
··· 1 1 /* 2 - * Copyright (c) 2000-2012 LSI Corporation. 2 + * Copyright (c) 2000-2013 LSI Corporation. 3 3 * 4 4 * 5 5 * Name: mpi2_raid.h 6 6 * Title: MPI Integrated RAID messages and structures 7 7 * Creation Date: April 26, 2007 8 8 * 9 - * mpi2_raid.h Version: 02.00.08 9 + * mpi2_raid.h Version: 02.00.09 10 10 * 11 11 * Version History 12 12 * --------------- ··· 28 28 * Added product-specific range to RAID Action values. 29 29 * 11-18-11 02.00.07 Incorporating additions for MPI v2.5. 30 30 * 02-06-12 02.00.08 Added MPI2_RAID_ACTION_PHYSDISK_HIDDEN. 31 + * 07-26-12 02.00.09 Added ElapsedSeconds field to MPI2_RAID_VOL_INDICATOR. 32 + * Added MPI2_RAID_VOL_FLAGS_ELAPSED_SECONDS_VALID define. 31 33 * -------------------------------------------------------------------------- 32 34 */ 33 35 ··· 271 269 U64 TotalBlocks; /*0x00 */ 272 270 U64 BlocksRemaining; /*0x08 */ 273 271 U32 Flags; /*0x10 */ 272 + U32 ElapsedSeconds; /* 0x14 */ 274 273 } MPI2_RAID_VOL_INDICATOR, *PTR_MPI2_RAID_VOL_INDICATOR, 275 274 Mpi2RaidVolIndicator_t, *pMpi2RaidVolIndicator_t; 276 275 277 276 /*defines for RAID Volume Indicator Flags field */ 277 + #define MPI2_RAID_VOL_FLAGS_ELAPSED_SECONDS_VALID (0x80000000) 278 278 #define MPI2_RAID_VOL_FLAGS_OP_MASK (0x0000000F) 279 279 #define MPI2_RAID_VOL_FLAGS_OP_BACKGROUND_INIT (0x00000000) 280 280 #define MPI2_RAID_VOL_FLAGS_OP_ONLINE_CAP_EXPANSION (0x00000001) ··· 316 312 317 313 /*RAID Action Reply ActionData union */ 318 314 typedef union _MPI2_RAID_ACTION_REPLY_DATA { 319 - U32 Word[5]; 315 + U32 Word[6]; 320 316 MPI2_RAID_VOL_INDICATOR RaidVolumeIndicator; 321 317 U16 VolDevHandle; 322 318 U8 VolumeState;
+1 -1
drivers/scsi/mpt3sas/mpi/mpi2_sas.h
··· 1 1 /* 2 - * Copyright (c) 2000-2012 LSI Corporation. 2 + * Copyright (c) 2000-2013 LSI Corporation. 3 3 * 4 4 * 5 5 * Name: mpi2_sas.h
+6 -4
drivers/scsi/mpt3sas/mpi/mpi2_tool.h
··· 1 1 /* 2 - * Copyright (c) 2000-2012 LSI Corporation. 2 + * Copyright (c) 2000-2013 LSI Corporation. 3 3 * 4 4 * 5 5 * Name: mpi2_tool.h 6 6 * Title: MPI diagnostic tool structures and definitions 7 7 * Creation Date: March 26, 2007 8 8 * 9 - * mpi2_tool.h Version: 02.00.09 9 + * mpi2_tool.h Version: 02.00.10 10 10 * 11 11 * Version History 12 12 * --------------- ··· 30 30 * 11-18-11 02.00.08 Incorporating additions for MPI v2.5. 31 31 * 07-10-12 02.00.09 Add MPI v2.5 Toolbox Diagnostic CLI Tool Request 32 32 * message. 33 + * 07-26-12 02.00.10 Modified MPI2_TOOLBOX_DIAGNOSTIC_CLI_REQUEST so that 34 + * it uses MPI Chain SGE as well as MPI Simple SGE. 33 35 * -------------------------------------------------------------------------- 34 36 */ 35 37 ··· 281 279 U16 Reserved6; /*0x0E */ 282 280 U32 DataLength; /*0x10 */ 283 281 U8 DiagnosticCliCommand[MPI2_TOOLBOX_DIAG_CLI_CMD_LENGTH];/*0x14 */ 284 - MPI2_SGE_SIMPLE_UNION SGL; /*0x70 */ 282 + MPI2_MPI_SGE_IO_UNION SGL; /*0x70 */ 285 283 } MPI2_TOOLBOX_DIAGNOSTIC_CLI_REQUEST, 286 284 *PTR_MPI2_TOOLBOX_DIAGNOSTIC_CLI_REQUEST, 287 285 Mpi2ToolboxDiagnosticCliRequest_t, ··· 304 302 U32 Reserved5; /*0x0C */ 305 303 U32 DataLength; /*0x10 */ 306 304 U8 DiagnosticCliCommand[MPI2_TOOLBOX_DIAG_CLI_CMD_LENGTH];/*0x14 */ 307 - MPI25_SGE_IO_UNION SGL; /*0x70 */ 305 + MPI25_SGE_IO_UNION SGL; /* 0x70 */ 308 306 } MPI25_TOOLBOX_DIAGNOSTIC_CLI_REQUEST, 309 307 *PTR_MPI25_TOOLBOX_DIAGNOSTIC_CLI_REQUEST, 310 308 Mpi25ToolboxDiagnosticCliRequest_t,
+1 -1
drivers/scsi/mpt3sas/mpi/mpi2_type.h
··· 1 1 /* 2 - * Copyright (c) 2000-2007 LSI Corporation. 2 + * Copyright (c) 2000-2013 LSI Corporation. 3 3 * 4 4 * 5 5 * Name: mpi2_type.h
+14 -8
drivers/scsi/mpt3sas/mpt3sas_base.c
··· 3 3 * for access to MPT (Message Passing Technology) firmware. 4 4 * 5 5 * This code is based on drivers/scsi/mpt3sas/mpt3sas_base.c 6 - * Copyright (C) 2012 LSI Corporation 6 + * Copyright (C) 2012-2013 LSI Corporation 7 7 * (mailto:DL-MPTFusionLinux@lsi.com) 8 8 * 9 9 * This program is free software; you can redistribute it and/or ··· 4090 4090 writel(host_diagnostic | MPI2_DIAG_RESET_ADAPTER, 4091 4091 &ioc->chip->HostDiagnostic); 4092 4092 4093 - /* don't access any registers for 50 milliseconds */ 4094 - msleep(50); 4093 + /*This delay allows the chip PCIe hardware time to finish reset tasks*/ 4094 + if (sleep_flag == CAN_SLEEP) 4095 + msleep(MPI2_HARD_RESET_PCIE_FIRST_READ_DELAY_MICRO_SEC/1000); 4096 + else 4097 + mdelay(MPI2_HARD_RESET_PCIE_FIRST_READ_DELAY_MICRO_SEC/1000); 4095 4098 4096 - /* 300 second max wait */ 4097 - for (count = 0; count < 3000000 ; count++) { 4099 + /* Approximately 300 second max wait */ 4100 + for (count = 0; count < (300000000 / 4101 + MPI2_HARD_RESET_PCIE_SECOND_READ_DELAY_MICRO_SEC); count++) { 4098 4102 4099 4103 host_diagnostic = readl(&ioc->chip->HostDiagnostic); 4100 4104 ··· 4107 4103 if (!(host_diagnostic & MPI2_DIAG_RESET_ADAPTER)) 4108 4104 break; 4109 4105 4110 - /* wait 1 msec */ 4106 + /* Wait to pass the second read delay window */ 4111 4107 if (sleep_flag == CAN_SLEEP) 4112 - usleep_range(1000, 1500); 4108 + msleep(MPI2_HARD_RESET_PCIE_SECOND_READ_DELAY_MICRO_SEC 4109 + / 1000); 4113 4110 else 4114 - mdelay(1); 4111 + mdelay(MPI2_HARD_RESET_PCIE_SECOND_READ_DELAY_MICRO_SEC 4112 + / 1000); 4115 4113 } 4116 4114 4117 4115 if (host_diagnostic & MPI2_DIAG_HCB_MODE) {
+4 -4
drivers/scsi/mpt3sas/mpt3sas_base.h
··· 3 3 * for access to MPT (Message Passing Technology) firmware. 4 4 * 5 5 * This code is based on drivers/scsi/mpt3sas/mpt3sas_base.h 6 - * Copyright (C) 2012 LSI Corporation 6 + * Copyright (C) 2012-2013 LSI Corporation 7 7 * (mailto:DL-MPTFusionLinux@lsi.com) 8 8 * 9 9 * This program is free software; you can redistribute it and/or ··· 70 70 #define MPT3SAS_DRIVER_NAME "mpt3sas" 71 71 #define MPT3SAS_AUTHOR "LSI Corporation <DL-MPTFusionLinux@lsi.com>" 72 72 #define MPT3SAS_DESCRIPTION "LSI MPT Fusion SAS 3.0 Device Driver" 73 - #define MPT3SAS_DRIVER_VERSION "01.100.01.00" 74 - #define MPT3SAS_MAJOR_VERSION 1 73 + #define MPT3SAS_DRIVER_VERSION "02.100.00.00" 74 + #define MPT3SAS_MAJOR_VERSION 2 75 75 #define MPT3SAS_MINOR_VERSION 100 76 - #define MPT3SAS_BUILD_VERSION 1 76 + #define MPT3SAS_BUILD_VERSION 0 77 77 #define MPT3SAS_RELEASE_VERSION 00 78 78 79 79 /*
+1 -1
drivers/scsi/mpt3sas/mpt3sas_config.c
··· 2 2 * This module provides common API for accessing firmware configuration pages 3 3 * 4 4 * This code is based on drivers/scsi/mpt3sas/mpt3sas_base.c 5 - * Copyright (C) 2012 LSI Corporation 5 + * Copyright (C) 2012-2013 LSI Corporation 6 6 * (mailto:DL-MPTFusionLinux@lsi.com) 7 7 * 8 8 * This program is free software; you can redistribute it and/or
+1 -1
drivers/scsi/mpt3sas/mpt3sas_ctl.c
··· 3 3 * controllers 4 4 * 5 5 * This code is based on drivers/scsi/mpt3sas/mpt3sas_ctl.c 6 - * Copyright (C) 2012 LSI Corporation 6 + * Copyright (C) 2012-2013 LSI Corporation 7 7 * (mailto:DL-MPTFusionLinux@lsi.com) 8 8 * 9 9 * This program is free software; you can redistribute it and/or
+1 -1
drivers/scsi/mpt3sas/mpt3sas_ctl.h
··· 3 3 * controllers 4 4 * 5 5 * This code is based on drivers/scsi/mpt3sas/mpt3sas_ctl.h 6 - * Copyright (C) 2012 LSI Corporation 6 + * Copyright (C) 2012-2013 LSI Corporation 7 7 * (mailto:DL-MPTFusionLinux@lsi.com) 8 8 * 9 9 * This program is free software; you can redistribute it and/or
+1 -1
drivers/scsi/mpt3sas/mpt3sas_debug.h
··· 2 2 * Logging Support for MPT (Message Passing Technology) based controllers 3 3 * 4 4 * This code is based on drivers/scsi/mpt3sas/mpt3sas_debug.c 5 - * Copyright (C) 2012 LSI Corporation 5 + * Copyright (C) 2012-2013 LSI Corporation 6 6 * (mailto:DL-MPTFusionLinux@lsi.com) 7 7 * 8 8 * This program is free software; you can redistribute it and/or
+32 -22
drivers/scsi/mpt3sas/mpt3sas_scsih.c
··· 2 2 * Scsi Host Layer for MPT (Message Passing Technology) based controllers 3 3 * 4 4 * This code is based on drivers/scsi/mpt3sas/mpt3sas_scsih.c 5 - * Copyright (C) 2012 LSI Corporation 5 + * Copyright (C) 2012-2013 LSI Corporation 6 6 * (mailto:DL-MPTFusionLinux@lsi.com) 7 7 * 8 8 * This program is free software; you can redistribute it and/or ··· 675 675 * devices while scanning is turned on due to an oops in 676 676 * scsi_sysfs_add_sdev()->add_device()->sysfs_addrm_start() 677 677 */ 678 - if (!ioc->is_driver_loading) 678 + if (!ioc->is_driver_loading) { 679 679 mpt3sas_transport_port_remove(ioc, 680 680 sas_device->sas_address, 681 681 sas_device->sas_address_parent); 682 - _scsih_sas_device_remove(ioc, sas_device); 682 + _scsih_sas_device_remove(ioc, sas_device); 683 + } 683 684 } 684 685 } 685 686 ··· 1274 1273 struct MPT3SAS_DEVICE *sas_device_priv_data; 1275 1274 struct scsi_target *starget; 1276 1275 struct _raid_device *raid_device; 1276 + struct _sas_device *sas_device; 1277 1277 unsigned long flags; 1278 1278 1279 1279 sas_device_priv_data = kzalloc(sizeof(struct scsi_device), GFP_KERNEL); ··· 1301 1299 if (raid_device) 1302 1300 raid_device->sdev = sdev; /* raid is single lun */ 1303 1301 spin_unlock_irqrestore(&ioc->raid_device_lock, flags); 1302 + } 1303 + 1304 + if (!(sas_target_priv_data->flags & MPT_TARGET_FLAGS_VOLUME)) { 1305 + spin_lock_irqsave(&ioc->sas_device_lock, flags); 1306 + sas_device = mpt3sas_scsih_sas_device_find_by_sas_address(ioc, 1307 + sas_target_priv_data->sas_address); 1308 + if (sas_device && (sas_device->starget == NULL)) { 1309 + sdev_printk(KERN_INFO, sdev, 1310 + "%s : sas_device->starget set to starget @ %d\n", 1311 + __func__, __LINE__); 1312 + sas_device->starget = starget; 1313 + } 1314 + spin_unlock_irqrestore(&ioc->sas_device_lock, flags); 1304 1315 } 1305 1316 1306 1317 return 0; ··· 6407 6392 handle))) { 6408 6393 ioc_status = le16_to_cpu(mpi_reply.IOCStatus) & 6409 6394 MPI2_IOCSTATUS_MASK; 6410 - if (ioc_status == MPI2_IOCSTATUS_CONFIG_INVALID_PAGE) 6395 + if (ioc_status != MPI2_IOCSTATUS_SUCCESS) 6411 6396 break; 6412 6397 handle = le16_to_cpu(sas_device_pg0.DevHandle); 6413 6398 device_info = le32_to_cpu(sas_device_pg0.DeviceInfo); ··· 6509 6494 &volume_pg1, MPI2_RAID_VOLUME_PGAD_FORM_GET_NEXT_HANDLE, handle))) { 6510 6495 ioc_status = le16_to_cpu(mpi_reply.IOCStatus) & 6511 6496 MPI2_IOCSTATUS_MASK; 6512 - if (ioc_status == MPI2_IOCSTATUS_CONFIG_INVALID_PAGE) 6497 + if (ioc_status != MPI2_IOCSTATUS_SUCCESS) 6513 6498 break; 6514 6499 handle = le16_to_cpu(volume_pg1.DevHandle); 6515 6500 ··· 6533 6518 phys_disk_num))) { 6534 6519 ioc_status = le16_to_cpu(mpi_reply.IOCStatus) & 6535 6520 MPI2_IOCSTATUS_MASK; 6536 - if (ioc_status == MPI2_IOCSTATUS_CONFIG_INVALID_PAGE) 6521 + if (ioc_status != MPI2_IOCSTATUS_SUCCESS) 6537 6522 break; 6538 6523 phys_disk_num = pd_pg0.PhysDiskNum; 6539 6524 handle = le16_to_cpu(pd_pg0.DevHandle); ··· 6612 6597 6613 6598 ioc_status = le16_to_cpu(mpi_reply.IOCStatus) & 6614 6599 MPI2_IOCSTATUS_MASK; 6615 - if (ioc_status == MPI2_IOCSTATUS_CONFIG_INVALID_PAGE) 6600 + if (ioc_status != MPI2_IOCSTATUS_SUCCESS) 6616 6601 break; 6617 6602 6618 6603 handle = le16_to_cpu(expander_pg0.DevHandle); ··· 6757 6742 MPI2_SAS_EXPAND_PGAD_FORM_GET_NEXT_HNDL, handle))) { 6758 6743 ioc_status = le16_to_cpu(mpi_reply.IOCStatus) & 6759 6744 MPI2_IOCSTATUS_MASK; 6760 - if (ioc_status == MPI2_IOCSTATUS_CONFIG_INVALID_PAGE) 6761 - break; 6762 6745 if (ioc_status != MPI2_IOCSTATUS_SUCCESS) { 6763 6746 pr_info(MPT3SAS_FMT "\tbreak from expander scan: " \ 6764 6747 "ioc_status(0x%04x), loginfo(0x%08x)\n", ··· 6800 6787 phys_disk_num))) { 6801 6788 ioc_status = le16_to_cpu(mpi_reply.IOCStatus) & 6802 6789 MPI2_IOCSTATUS_MASK; 6803 - if (ioc_status == MPI2_IOCSTATUS_CONFIG_INVALID_PAGE) 6804 - break; 6805 6790 if (ioc_status != MPI2_IOCSTATUS_SUCCESS) { 6806 6791 pr_info(MPT3SAS_FMT "\tbreak from phys disk scan: "\ 6807 6792 "ioc_status(0x%04x), loginfo(0x%08x)\n", ··· 6865 6854 &volume_pg1, MPI2_RAID_VOLUME_PGAD_FORM_GET_NEXT_HANDLE, handle))) { 6866 6855 ioc_status = le16_to_cpu(mpi_reply.IOCStatus) & 6867 6856 MPI2_IOCSTATUS_MASK; 6868 - if (ioc_status == MPI2_IOCSTATUS_CONFIG_INVALID_PAGE) 6869 - break; 6870 6857 if (ioc_status != MPI2_IOCSTATUS_SUCCESS) { 6871 6858 pr_info(MPT3SAS_FMT "\tbreak from volume scan: " \ 6872 6859 "ioc_status(0x%04x), loginfo(0x%08x)\n", ··· 6923 6914 handle))) { 6924 6915 ioc_status = le16_to_cpu(mpi_reply.IOCStatus) & 6925 6916 MPI2_IOCSTATUS_MASK; 6926 - if (ioc_status == MPI2_IOCSTATUS_CONFIG_INVALID_PAGE) 6927 - break; 6928 6917 if (ioc_status != MPI2_IOCSTATUS_SUCCESS) { 6929 6918 pr_info(MPT3SAS_FMT "\tbreak from end device scan:"\ 6930 6919 " ioc_status(0x%04x), loginfo(0x%08x)\n", ··· 7532 7525 sas_address_parent)) { 7533 7526 _scsih_sas_device_remove(ioc, sas_device); 7534 7527 } else if (!sas_device->starget) { 7535 - if (!ioc->is_driver_loading) 7536 - mpt3sas_transport_port_remove(ioc, sas_address, 7528 + if (!ioc->is_driver_loading) { 7529 + mpt3sas_transport_port_remove(ioc, 7530 + sas_address, 7537 7531 sas_address_parent); 7538 - _scsih_sas_device_remove(ioc, sas_device); 7532 + _scsih_sas_device_remove(ioc, sas_device); 7533 + } 7539 7534 } 7540 7535 } 7541 7536 } ··· 7593 7584 * oops in scsi_sysfs_add_sdev()->add_device()-> 7594 7585 * sysfs_addrm_start() 7595 7586 */ 7596 - if (!ioc->is_driver_loading) 7587 + if (!ioc->is_driver_loading) { 7597 7588 mpt3sas_transport_port_remove(ioc, 7598 7589 sas_device->sas_address, 7599 7590 sas_device->sas_address_parent); 7600 - list_del(&sas_device->list); 7601 - kfree(sas_device); 7602 - continue; 7591 + list_del(&sas_device->list); 7592 + kfree(sas_device); 7593 + continue; 7594 + } 7603 7595 } 7604 7596 7605 7597 spin_lock_irqsave(&ioc->sas_device_lock, flags);
+1 -1
drivers/scsi/mpt3sas/mpt3sas_transport.c
··· 2 2 * SAS Transport Layer for MPT (Message Passing Technology) based controllers 3 3 * 4 4 * This code is based on drivers/scsi/mpt3sas/mpt3sas_transport.c 5 - * Copyright (C) 2012 LSI Corporation 5 + * Copyright (C) 2012-2013 LSI Corporation 6 6 * (mailto:DL-MPTFusionLinux@lsi.com) 7 7 * 8 8 * This program is free software; you can redistribute it and/or
+1 -1
drivers/scsi/mpt3sas/mpt3sas_trigger_diag.c
··· 3 3 * (Message Passing Technology) based controllers 4 4 * 5 5 * This code is based on drivers/scsi/mpt3sas/mpt3sas_trigger_diag.c 6 - * Copyright (C) 2012 LSI Corporation 6 + * Copyright (C) 2012-2013 LSI Corporation 7 7 * (mailto:DL-MPTFusionLinux@lsi.com) 8 8 * 9 9 * This program is free software; you can redistribute it and/or
+1 -1
drivers/scsi/mpt3sas/mpt3sas_trigger_diag.h
··· 4 4 * controllers 5 5 * 6 6 * This code is based on drivers/scsi/mpt3sas/mpt3sas_base.h 7 - * Copyright (C) 2012 LSI Corporation 7 + * Copyright (C) 2012-2013 LSI Corporation 8 8 * (mailto:DL-MPTFusionLinux@lsi.com) 9 9 * 10 10 * This program is free software; you can redistribute it and/or
+3 -4
drivers/scsi/pm8001/pm8001_init.c
··· 912 912 { 913 913 struct sas_ha_struct *sha = pci_get_drvdata(pdev); 914 914 struct pm8001_hba_info *pm8001_ha; 915 - int i , pos; 915 + int i; 916 916 u32 device_state; 917 917 pm8001_ha = sha->lldd_ha; 918 918 flush_workqueue(pm8001_wq); 919 919 scsi_block_requests(pm8001_ha->shost); 920 - pos = pci_find_capability(pdev, PCI_CAP_ID_PM); 921 - if (pos == 0) { 922 - printk(KERN_ERR " PCI PM not supported\n"); 920 + if (!pdev->pm_cap) { 921 + dev_err(&pdev->dev, " PCI PM not supported\n"); 923 922 return -ENODEV; 924 923 } 925 924 PM8001_CHIP_DISP->interrupt_disable(pm8001_ha, 0xFF);
+4 -1
drivers/scsi/qla2xxx/qla_attr.c
··· 1691 1691 if (unlikely(pci_channel_offline(ha->pdev))) 1692 1692 goto done; 1693 1693 1694 + if (qla2x00_reset_active(vha)) 1695 + goto done; 1696 + 1694 1697 stats = dma_pool_alloc(ha->s_dma_pool, GFP_KERNEL, &stats_dma); 1695 1698 if (stats == NULL) { 1696 1699 ql_log(ql_log_warn, vha, 0x707d, ··· 1706 1703 if (IS_FWI2_CAPABLE(ha)) { 1707 1704 rval = qla24xx_get_isp_stats(base_vha, stats, stats_dma); 1708 1705 } else if (atomic_read(&base_vha->loop_state) == LOOP_READY && 1709 - !qla2x00_reset_active(vha) && !ha->dpc_active) { 1706 + !ha->dpc_active) { 1710 1707 /* Must be in a 'READY' state for statistics retrieval. */ 1711 1708 rval = qla2x00_get_link_status(base_vha, base_vha->loop_id, 1712 1709 stats, stats_dma);
+11 -27
drivers/scsi/qla2xxx/qla_bsg.c
··· 269 269 type = "FC_BSG_HST_ELS_NOLOGIN"; 270 270 } 271 271 272 + if (!vha->flags.online) { 273 + ql_log(ql_log_warn, vha, 0x7005, "Host not online.\n"); 274 + rval = -EIO; 275 + goto done; 276 + } 277 + 272 278 /* pass through is supported only for ISP 4Gb or higher */ 273 279 if (!IS_FWI2_CAPABLE(ha)) { 274 280 ql_dbg(ql_dbg_user, vha, 0x7001, ··· 330 324 fcport->loop_id = 331 325 (fcport->d_id.b.al_pa == 0xFD) ? 332 326 NPH_FABRIC_CONTROLLER : NPH_F_PORT; 333 - } 334 - 335 - if (!vha->flags.online) { 336 - ql_log(ql_log_warn, vha, 0x7005, "Host not online.\n"); 337 - rval = -EIO; 338 - goto done; 339 327 } 340 328 341 329 req_sg_cnt = ··· 399 399 goto done_free_fcport; 400 400 401 401 done_free_fcport: 402 - if (bsg_job->request->msgcode == FC_BSG_HST_ELS_NOLOGIN) 402 + if (bsg_job->request->msgcode == FC_BSG_RPT_ELS) 403 403 kfree(fcport); 404 404 done: 405 405 return rval; ··· 1084 1084 return -EINVAL; 1085 1085 } 1086 1086 1087 - ql84_mgmt = (struct qla_bsg_a84_mgmt *)((char *)bsg_job->request + 1088 - sizeof(struct fc_bsg_request)); 1089 - if (!ql84_mgmt) { 1090 - ql_log(ql_log_warn, vha, 0x703b, 1091 - "MGMT header not provided, exiting.\n"); 1092 - return -EINVAL; 1093 - } 1094 - 1095 1087 mn = dma_pool_alloc(ha->s_dma_pool, GFP_KERNEL, &mn_dma); 1096 1088 if (!mn) { 1097 1089 ql_log(ql_log_warn, vha, 0x703c, ··· 1094 1102 memset(mn, 0, sizeof(struct access_chip_84xx)); 1095 1103 mn->entry_type = ACCESS_CHIP_IOCB_TYPE; 1096 1104 mn->entry_count = 1; 1097 - 1105 + ql84_mgmt = (void *)bsg_job->request + sizeof(struct fc_bsg_request); 1098 1106 switch (ql84_mgmt->mgmt.cmd) { 1099 1107 case QLA84_MGMT_READ_MEM: 1100 1108 case QLA84_MGMT_GET_INFO: ··· 1274 1282 return -EINVAL; 1275 1283 } 1276 1284 1277 - port_param = (struct qla_port_param *)((char *)bsg_job->request + 1278 - sizeof(struct fc_bsg_request)); 1279 - if (!port_param) { 1280 - ql_log(ql_log_warn, vha, 0x7047, 1281 - "port_param header not provided.\n"); 1282 - return -EINVAL; 1283 - } 1284 - 1285 + port_param = (void *)bsg_job->request + sizeof(struct fc_bsg_request); 1285 1286 if (port_param->fc_scsi_addr.dest_type != EXT_DEF_TYPE_WWPN) { 1286 1287 ql_log(ql_log_warn, vha, 0x7048, 1287 1288 "Invalid destination type.\n"); ··· 2138 2153 (sp->type == SRB_ELS_CMD_HST) || 2139 2154 (sp->type == SRB_FXIOCB_BCMD)) 2140 2155 && (sp->u.bsg_job == bsg_job)) { 2156 + req->outstanding_cmds[cnt] = NULL; 2141 2157 spin_unlock_irqrestore(&ha->hardware_lock, flags); 2142 2158 if (ha->isp_ops->abort_command(sp)) { 2143 2159 ql_log(ql_log_warn, vha, 0x7089, ··· 2166 2180 2167 2181 done: 2168 2182 spin_unlock_irqrestore(&ha->hardware_lock, flags); 2169 - if (bsg_job->request->msgcode == FC_BSG_HST_CT) 2170 - kfree(sp->fcport); 2171 - qla2x00_rel_sp(vha, sp); 2183 + sp->free(vha, sp); 2172 2184 return 0; 2173 2185 }
+7 -5
drivers/scsi/qla2xxx/qla_dbg.c
··· 12 12 * | Level | Last Value Used | Holes | 13 13 * ---------------------------------------------------------------------- 14 14 * | Module Init and Probe | 0x014f | 0x4b,0xba,0xfa | 15 - * | Mailbox commands | 0x1179 | 0x111a-0x111b | 15 + * | Mailbox commands | 0x117a | 0x111a-0x111b | 16 16 * | | | 0x1155-0x1158 | 17 17 * | Device Discovery | 0x2095 | 0x2020-0x2022, | 18 + * | | | 0x2011-0x2012, | 18 19 * | | | 0x2016 | 19 20 * | Queue Command and IO tracing | 0x3058 | 0x3006-0x300b | 20 21 * | | | 0x3027-0x3028 | ··· 36 35 * | | | 0x70a5,0x70a6, | 37 36 * | | | 0x70a8,0x70ab, | 38 37 * | | | 0x70ad-0x70ae, | 39 - * | | | 0x70d1-0x70da | 38 + * | | | 0x70d1-0x70da, | 39 + * | | | 0x7047,0x703b | 40 40 * | Task Management | 0x803c | 0x8025-0x8026 | 41 41 * | | | 0x800b,0x8039 | 42 42 * | AER/EEH | 0x9011 | | ··· 1470 1468 1471 1469 nxt = qla2xxx_copy_queues(ha, nxt); 1472 1470 1473 - nxt = qla24xx_copy_eft(ha, nxt); 1471 + qla24xx_copy_eft(ha, nxt); 1474 1472 1475 1473 /* Chain entries -- started with MQ. */ 1476 1474 nxt_chain = qla25xx_copy_fce(ha, nxt_chain, &last_chain); ··· 1789 1787 1790 1788 nxt = qla2xxx_copy_queues(ha, nxt); 1791 1789 1792 - nxt = qla24xx_copy_eft(ha, nxt); 1790 + qla24xx_copy_eft(ha, nxt); 1793 1791 1794 1792 /* Chain entries -- started with MQ. */ 1795 1793 nxt_chain = qla25xx_copy_fce(ha, nxt_chain, &last_chain); ··· 2291 2289 copy_queue: 2292 2290 nxt = qla2xxx_copy_queues(ha, nxt); 2293 2291 2294 - nxt = qla24xx_copy_eft(ha, nxt); 2292 + qla24xx_copy_eft(ha, nxt); 2295 2293 2296 2294 /* Chain entries -- started with MQ. */ 2297 2295 nxt_chain = qla25xx_copy_fce(ha, nxt_chain, &last_chain);
+17 -17
drivers/scsi/qla2xxx/qla_def.h
··· 323 323 uint32_t lun; 324 324 uint32_t data; 325 325 struct completion comp; 326 - uint32_t comp_status; 326 + __le16 comp_status; 327 327 } tmf; 328 328 struct { 329 329 #define SRB_FXDISC_REQ_DMA_VALID BIT_0 ··· 338 338 void *rsp_addr; 339 339 dma_addr_t req_dma_handle; 340 340 dma_addr_t rsp_dma_handle; 341 - uint32_t adapter_id; 342 - uint32_t adapter_id_hi; 343 - uint32_t req_func_type; 344 - uint32_t req_data; 345 - uint32_t req_data_extra; 346 - uint32_t result; 347 - uint32_t seq_number; 348 - uint32_t fw_flags; 341 + __le32 adapter_id; 342 + __le32 adapter_id_hi; 343 + __le16 req_func_type; 344 + __le32 req_data; 345 + __le32 req_data_extra; 346 + __le32 result; 347 + __le32 seq_number; 348 + __le16 fw_flags; 349 349 struct completion fxiocb_comp; 350 - uint32_t reserved_0; 350 + __le32 reserved_0; 351 351 uint8_t reserved_1; 352 352 } fxiocb; 353 353 struct { 354 354 uint32_t cmd_hndl; 355 - uint32_t comp_status; 355 + __le16 comp_status; 356 356 struct completion comp; 357 357 } abt; 358 358 } u; ··· 1196 1196 struct init_cb_fx { 1197 1197 uint16_t version; 1198 1198 uint16_t reserved_1[13]; 1199 - uint16_t request_q_outpointer; 1200 - uint16_t response_q_inpointer; 1199 + __le16 request_q_outpointer; 1200 + __le16 response_q_inpointer; 1201 1201 uint16_t reserved_2[2]; 1202 - uint16_t response_q_length; 1203 - uint16_t request_q_length; 1202 + __le16 response_q_length; 1203 + __le16 request_q_length; 1204 1204 uint16_t reserved_3[2]; 1205 - uint32_t request_q_address[2]; 1206 - uint32_t response_q_address[2]; 1205 + __le32 request_q_address[2]; 1206 + __le32 response_q_address[2]; 1207 1207 uint16_t reserved_4[4]; 1208 1208 uint8_t response_q_msivec; 1209 1209 uint8_t reserved_5[19];
+1 -1
drivers/scsi/qla2xxx/qla_gbl.h
··· 587 587 extern int qlafx00_fw_ready(scsi_qla_host_t *); 588 588 extern int qlafx00_configure_devices(scsi_qla_host_t *); 589 589 extern int qlafx00_reset_initialize(scsi_qla_host_t *); 590 - extern int qlafx00_fx_disc(scsi_qla_host_t *, fc_port_t *, uint8_t); 590 + extern int qlafx00_fx_disc(scsi_qla_host_t *, fc_port_t *, uint16_t); 591 591 extern int qlafx00_process_aen(struct scsi_qla_host *, struct qla_work_evt *); 592 592 extern int qlafx00_post_aenfx_work(struct scsi_qla_host *, uint32_t, 593 593 uint32_t *, int);
+40 -46
drivers/scsi/qla2xxx/qla_gs.c
··· 99 99 * Returns a pointer to the intitialized @ct_req. 100 100 */ 101 101 static inline struct ct_sns_req * 102 - qla2x00_prep_ct_req(struct ct_sns_req *ct_req, uint16_t cmd, uint16_t rsp_size) 102 + qla2x00_prep_ct_req(struct ct_sns_pkt *p, uint16_t cmd, uint16_t rsp_size) 103 103 { 104 - memset(ct_req, 0, sizeof(struct ct_sns_pkt)); 104 + memset(p, 0, sizeof(struct ct_sns_pkt)); 105 105 106 - ct_req->header.revision = 0x01; 107 - ct_req->header.gs_type = 0xFC; 108 - ct_req->header.gs_subtype = 0x02; 109 - ct_req->command = cpu_to_be16(cmd); 110 - ct_req->max_rsp_size = cpu_to_be16((rsp_size - 16) / 4); 106 + p->p.req.header.revision = 0x01; 107 + p->p.req.header.gs_type = 0xFC; 108 + p->p.req.header.gs_subtype = 0x02; 109 + p->p.req.command = cpu_to_be16(cmd); 110 + p->p.req.max_rsp_size = cpu_to_be16((rsp_size - 16) / 4); 111 111 112 - return (ct_req); 112 + return &p->p.req; 113 113 } 114 114 115 115 static int ··· 188 188 GA_NXT_RSP_SIZE); 189 189 190 190 /* Prepare CT request */ 191 - ct_req = qla2x00_prep_ct_req(&ha->ct_sns->p.req, GA_NXT_CMD, 191 + ct_req = qla2x00_prep_ct_req(ha->ct_sns, GA_NXT_CMD, 192 192 GA_NXT_RSP_SIZE); 193 193 ct_rsp = &ha->ct_sns->p.rsp; 194 194 ··· 284 284 gid_pt_rsp_size); 285 285 286 286 /* Prepare CT request */ 287 - ct_req = qla2x00_prep_ct_req(&ha->ct_sns->p.req, GID_PT_CMD, 288 - gid_pt_rsp_size); 287 + ct_req = qla2x00_prep_ct_req(ha->ct_sns, GID_PT_CMD, gid_pt_rsp_size); 289 288 ct_rsp = &ha->ct_sns->p.rsp; 290 289 291 290 /* Prepare CT arguments -- port_type */ ··· 358 359 GPN_ID_RSP_SIZE); 359 360 360 361 /* Prepare CT request */ 361 - ct_req = qla2x00_prep_ct_req(&ha->ct_sns->p.req, GPN_ID_CMD, 362 + ct_req = qla2x00_prep_ct_req(ha->ct_sns, GPN_ID_CMD, 362 363 GPN_ID_RSP_SIZE); 363 364 ct_rsp = &ha->ct_sns->p.rsp; 364 365 ··· 420 421 GNN_ID_RSP_SIZE); 421 422 422 423 /* Prepare CT request */ 423 - ct_req = qla2x00_prep_ct_req(&ha->ct_sns->p.req, GNN_ID_CMD, 424 + ct_req = qla2x00_prep_ct_req(ha->ct_sns, GNN_ID_CMD, 424 425 GNN_ID_RSP_SIZE); 425 426 ct_rsp = &ha->ct_sns->p.rsp; 426 427 ··· 494 495 RFT_ID_RSP_SIZE); 495 496 496 497 /* Prepare CT request */ 497 - ct_req = qla2x00_prep_ct_req(&ha->ct_sns->p.req, RFT_ID_CMD, 498 + ct_req = qla2x00_prep_ct_req(ha->ct_sns, RFT_ID_CMD, 498 499 RFT_ID_RSP_SIZE); 499 500 ct_rsp = &ha->ct_sns->p.rsp; 500 501 ··· 550 551 RFF_ID_RSP_SIZE); 551 552 552 553 /* Prepare CT request */ 553 - ct_req = qla2x00_prep_ct_req(&ha->ct_sns->p.req, RFF_ID_CMD, 554 + ct_req = qla2x00_prep_ct_req(ha->ct_sns, RFF_ID_CMD, 554 555 RFF_ID_RSP_SIZE); 555 556 ct_rsp = &ha->ct_sns->p.rsp; 556 557 ··· 605 606 RNN_ID_RSP_SIZE); 606 607 607 608 /* Prepare CT request */ 608 - ct_req = qla2x00_prep_ct_req(&ha->ct_sns->p.req, RNN_ID_CMD, 609 - RNN_ID_RSP_SIZE); 609 + ct_req = qla2x00_prep_ct_req(ha->ct_sns, RNN_ID_CMD, RNN_ID_RSP_SIZE); 610 610 ct_rsp = &ha->ct_sns->p.rsp; 611 611 612 612 /* Prepare CT arguments -- port_id, node_name */ ··· 674 676 ms_pkt = ha->isp_ops->prep_ms_iocb(vha, 0, RSNN_NN_RSP_SIZE); 675 677 676 678 /* Prepare CT request */ 677 - ct_req = qla2x00_prep_ct_req(&ha->ct_sns->p.req, RSNN_NN_CMD, 679 + ct_req = qla2x00_prep_ct_req(ha->ct_sns, RSNN_NN_CMD, 678 680 RSNN_NN_RSP_SIZE); 679 681 ct_rsp = &ha->ct_sns->p.rsp; 680 682 ··· 1260 1262 * Returns a pointer to the intitialized @ct_req. 1261 1263 */ 1262 1264 static inline struct ct_sns_req * 1263 - qla2x00_prep_ct_fdmi_req(struct ct_sns_req *ct_req, uint16_t cmd, 1265 + qla2x00_prep_ct_fdmi_req(struct ct_sns_pkt *p, uint16_t cmd, 1264 1266 uint16_t rsp_size) 1265 1267 { 1266 - memset(ct_req, 0, sizeof(struct ct_sns_pkt)); 1268 + memset(p, 0, sizeof(struct ct_sns_pkt)); 1267 1269 1268 - ct_req->header.revision = 0x01; 1269 - ct_req->header.gs_type = 0xFA; 1270 - ct_req->header.gs_subtype = 0x10; 1271 - ct_req->command = cpu_to_be16(cmd); 1272 - ct_req->max_rsp_size = cpu_to_be16((rsp_size - 16) / 4); 1270 + p->p.req.header.revision = 0x01; 1271 + p->p.req.header.gs_type = 0xFA; 1272 + p->p.req.header.gs_subtype = 0x10; 1273 + p->p.req.command = cpu_to_be16(cmd); 1274 + p->p.req.max_rsp_size = cpu_to_be16((rsp_size - 16) / 4); 1273 1275 1274 - return ct_req; 1276 + return &p->p.req; 1275 1277 } 1276 1278 1277 1279 /** ··· 1299 1301 ms_pkt = ha->isp_ops->prep_ms_fdmi_iocb(vha, 0, RHBA_RSP_SIZE); 1300 1302 1301 1303 /* Prepare CT request */ 1302 - ct_req = qla2x00_prep_ct_fdmi_req(&ha->ct_sns->p.req, RHBA_CMD, 1303 - RHBA_RSP_SIZE); 1304 + ct_req = qla2x00_prep_ct_fdmi_req(ha->ct_sns, RHBA_CMD, RHBA_RSP_SIZE); 1304 1305 ct_rsp = &ha->ct_sns->p.rsp; 1305 1306 1306 1307 /* Prepare FDMI command arguments -- attribute block, attributes. */ ··· 1367 1370 /* Model description. */ 1368 1371 eiter = (struct ct_fdmi_hba_attr *) (entries + size); 1369 1372 eiter->type = __constant_cpu_to_be16(FDMI_HBA_MODEL_DESCRIPTION); 1370 - if (ha->model_desc) 1371 - strncpy(eiter->a.model_desc, ha->model_desc, 80); 1373 + strncpy(eiter->a.model_desc, ha->model_desc, 80); 1372 1374 alen = strlen(eiter->a.model_desc); 1373 1375 alen += (alen & 3) ? (4 - (alen & 3)) : 4; 1374 1376 eiter->len = cpu_to_be16(4 + alen); ··· 1487 1491 DHBA_RSP_SIZE); 1488 1492 1489 1493 /* Prepare CT request */ 1490 - ct_req = qla2x00_prep_ct_fdmi_req(&ha->ct_sns->p.req, DHBA_CMD, 1491 - DHBA_RSP_SIZE); 1494 + ct_req = qla2x00_prep_ct_fdmi_req(ha->ct_sns, DHBA_CMD, DHBA_RSP_SIZE); 1492 1495 ct_rsp = &ha->ct_sns->p.rsp; 1493 1496 1494 1497 /* Prepare FDMI command arguments -- portname. */ ··· 1543 1548 ms_pkt = ha->isp_ops->prep_ms_fdmi_iocb(vha, 0, RPA_RSP_SIZE); 1544 1549 1545 1550 /* Prepare CT request */ 1546 - ct_req = qla2x00_prep_ct_fdmi_req(&ha->ct_sns->p.req, RPA_CMD, 1547 - RPA_RSP_SIZE); 1551 + ct_req = qla2x00_prep_ct_fdmi_req(ha->ct_sns, RPA_CMD, RPA_RSP_SIZE); 1548 1552 ct_rsp = &ha->ct_sns->p.rsp; 1549 1553 1550 1554 /* Prepare FDMI command arguments -- attribute block, attributes. */ ··· 1770 1776 GFPN_ID_RSP_SIZE); 1771 1777 1772 1778 /* Prepare CT request */ 1773 - ct_req = qla2x00_prep_ct_req(&ha->ct_sns->p.req, GFPN_ID_CMD, 1779 + ct_req = qla2x00_prep_ct_req(ha->ct_sns, GFPN_ID_CMD, 1774 1780 GFPN_ID_RSP_SIZE); 1775 1781 ct_rsp = &ha->ct_sns->p.rsp; 1776 1782 ··· 1837 1843 1838 1844 1839 1845 static inline struct ct_sns_req * 1840 - qla24xx_prep_ct_fm_req(struct ct_sns_req *ct_req, uint16_t cmd, 1846 + qla24xx_prep_ct_fm_req(struct ct_sns_pkt *p, uint16_t cmd, 1841 1847 uint16_t rsp_size) 1842 1848 { 1843 - memset(ct_req, 0, sizeof(struct ct_sns_pkt)); 1849 + memset(p, 0, sizeof(struct ct_sns_pkt)); 1844 1850 1845 - ct_req->header.revision = 0x01; 1846 - ct_req->header.gs_type = 0xFA; 1847 - ct_req->header.gs_subtype = 0x01; 1848 - ct_req->command = cpu_to_be16(cmd); 1849 - ct_req->max_rsp_size = cpu_to_be16((rsp_size - 16) / 4); 1851 + p->p.req.header.revision = 0x01; 1852 + p->p.req.header.gs_type = 0xFA; 1853 + p->p.req.header.gs_subtype = 0x01; 1854 + p->p.req.command = cpu_to_be16(cmd); 1855 + p->p.req.max_rsp_size = cpu_to_be16((rsp_size - 16) / 4); 1850 1856 1851 - return ct_req; 1857 + return &p->p.req; 1852 1858 } 1853 1859 1854 1860 /** ··· 1884 1890 GPSC_RSP_SIZE); 1885 1891 1886 1892 /* Prepare CT request */ 1887 - ct_req = qla24xx_prep_ct_fm_req(&ha->ct_sns->p.req, 1888 - GPSC_CMD, GPSC_RSP_SIZE); 1893 + ct_req = qla24xx_prep_ct_fm_req(ha->ct_sns, GPSC_CMD, 1894 + GPSC_RSP_SIZE); 1889 1895 ct_rsp = &ha->ct_sns->p.rsp; 1890 1896 1891 1897 /* Prepare CT arguments -- port_name */ ··· 1995 2001 GFF_ID_RSP_SIZE); 1996 2002 1997 2003 /* Prepare CT request */ 1998 - ct_req = qla2x00_prep_ct_req(&ha->ct_sns->p.req, GFF_ID_CMD, 2004 + ct_req = qla2x00_prep_ct_req(ha->ct_sns, GFF_ID_CMD, 1999 2005 GFF_ID_RSP_SIZE); 2000 2006 ct_rsp = &ha->ct_sns->p.rsp; 2001 2007
-8
drivers/scsi/qla2xxx/qla_init.c
··· 2309 2309 "Topology - %s, Host Loop address 0x%x.\n", 2310 2310 connect_type, vha->loop_id); 2311 2311 2312 - if (rval) { 2313 - ql_log(ql_log_warn, vha, 0x2011, 2314 - "%s FAILED\n", __func__); 2315 - } else { 2316 - ql_dbg(ql_dbg_disc, vha, 0x2012, 2317 - "%s success\n", __func__); 2318 - } 2319 - 2320 2312 return(rval); 2321 2313 } 2322 2314
+1 -1
drivers/scsi/qla2xxx/qla_inline.h
··· 83 83 host_to_adap(uint8_t *src, uint8_t *dst, uint32_t bsize) 84 84 { 85 85 uint32_t *isrc = (uint32_t *) src; 86 - uint32_t *odest = (uint32_t *) dst; 86 + __le32 *odest = (__le32 *) dst; 87 87 uint32_t iter = bsize >> 2; 88 88 89 89 for (; iter ; iter--)
+2 -4
drivers/scsi/qla2xxx/qla_iocb.c
··· 1189 1189 uint32_t *cur_dsd, *fcp_dl; 1190 1190 scsi_qla_host_t *vha; 1191 1191 struct scsi_cmnd *cmd; 1192 - struct scatterlist *cur_seg; 1193 1192 int sgc; 1194 1193 uint32_t total_bytes = 0; 1195 1194 uint32_t data_bytes; ··· 1395 1396 1396 1397 if (bundling && tot_prot_dsds) { 1397 1398 /* Walks dif segments */ 1398 - cur_seg = scsi_prot_sglist(cmd); 1399 1399 cmd_pkt->control_flags |= 1400 1400 __constant_cpu_to_le16(CF_DIF_SEG_DESCR_ENABLE); 1401 1401 cur_dsd = (uint32_t *) &crc_ctx_pkt->u.bundling.dif_address; ··· 1861 1863 pkt = req->ring_ptr; 1862 1864 memset(pkt, 0, REQUEST_ENTRY_SIZE); 1863 1865 if (IS_QLAFX00(ha)) { 1864 - WRT_REG_BYTE(&pkt->entry_count, req_cnt); 1865 - WRT_REG_WORD(&pkt->handle, handle); 1866 + WRT_REG_BYTE((void __iomem *)&pkt->entry_count, req_cnt); 1867 + WRT_REG_WORD((void __iomem *)&pkt->handle, handle); 1866 1868 } else { 1867 1869 pkt->entry_count = req_cnt; 1868 1870 pkt->handle = handle;
+1
drivers/scsi/qla2xxx/qla_isr.c
··· 2485 2485 if (rval == QLA_SUCCESS) 2486 2486 goto next_test; 2487 2487 2488 + rval = QLA_SUCCESS; 2488 2489 WRT_REG_DWORD(&reg->iobase_window, 0x0003); 2489 2490 for (cnt = 100; (RD_REG_DWORD(&reg->iobase_window) & BIT_0) == 0 && 2490 2491 rval == QLA_SUCCESS; cnt--) {
+12 -4
drivers/scsi/qla2xxx/qla_mbx.c
··· 177 177 WRT_REG_WORD(&reg->isp.hccr, HCCR_SET_HOST_INT); 178 178 spin_unlock_irqrestore(&ha->hardware_lock, flags); 179 179 180 - wait_for_completion_timeout(&ha->mbx_intr_comp, mcp->tov * HZ); 181 - 180 + if (!wait_for_completion_timeout(&ha->mbx_intr_comp, 181 + mcp->tov * HZ)) { 182 + ql_dbg(ql_dbg_mbx, vha, 0x117a, 183 + "cmd=%x Timeout.\n", command); 184 + spin_lock_irqsave(&ha->hardware_lock, flags); 185 + clear_bit(MBX_INTR_WAIT, &ha->mbx_cmd_flags); 186 + spin_unlock_irqrestore(&ha->hardware_lock, flags); 187 + } 182 188 } else { 183 189 ql_dbg(ql_dbg_mbx, vha, 0x1011, 184 190 "Cmd=%x Polling Mode.\n", command); ··· 281 275 282 276 /* 283 277 * Attempt to capture a firmware dump for further analysis 284 - * of the current firmware state 278 + * of the current firmware state. We do not need to do this 279 + * if we are intentionally generating a dump. 285 280 */ 286 - ha->isp_ops->fw_dump(vha, 0); 281 + if (mcp->mb[0] != MBC_GEN_SYSTEM_ERROR) 282 + ha->isp_ops->fw_dump(vha, 0); 287 283 288 284 rval = QLA_FUNCTION_TIMEOUT; 289 285 }
+87 -80
drivers/scsi/qla2xxx/qla_mr.c
··· 707 707 srb_t *sp = (srb_t *)data; 708 708 struct srb_iocb *tmf = &sp->u.iocb_cmd; 709 709 710 - tmf->u.tmf.comp_status = CS_TIMEOUT; 710 + tmf->u.tmf.comp_status = cpu_to_le16((uint16_t)CS_TIMEOUT); 711 711 complete(&tmf->u.tmf.comp); 712 712 } 713 713 ··· 1418 1418 pkt = rsp->ring_ptr; 1419 1419 for (cnt = 0; cnt < rsp->length; cnt++) { 1420 1420 pkt->signature = RESPONSE_PROCESSED; 1421 - WRT_REG_DWORD(&pkt->signature, RESPONSE_PROCESSED); 1421 + WRT_REG_DWORD((void __iomem *)&pkt->signature, 1422 + RESPONSE_PROCESSED); 1422 1423 pkt++; 1423 1424 } 1424 1425 } ··· 1734 1733 } 1735 1734 1736 1735 int 1737 - qlafx00_fx_disc(scsi_qla_host_t *vha, fc_port_t *fcport, uint8_t fx_type) 1736 + qlafx00_fx_disc(scsi_qla_host_t *vha, fc_port_t *fcport, uint16_t fx_type) 1738 1737 { 1739 1738 srb_t *sp; 1740 1739 struct srb_iocb *fdisc; ··· 1760 1759 fdisc->u.fxiocb.flags = 1761 1760 SRB_FXDISC_RESP_DMA_VALID | SRB_FXDISC_REQ_DWRD_VALID; 1762 1761 fdisc->u.fxiocb.rsp_len = QLAFX00_PORT_DATA_INFO; 1763 - fdisc->u.fxiocb.req_data = fcport->port_id; 1762 + fdisc->u.fxiocb.req_data = cpu_to_le32(fcport->port_id); 1764 1763 break; 1765 1764 case FXDISC_GET_TGT_NODE_INFO: 1766 1765 fdisc->u.fxiocb.flags = 1767 1766 SRB_FXDISC_RESP_DMA_VALID | SRB_FXDISC_REQ_DWRD_VALID; 1768 1767 fdisc->u.fxiocb.rsp_len = QLAFX00_TGT_NODE_INFO; 1769 - fdisc->u.fxiocb.req_data = fcport->tgt_id; 1768 + fdisc->u.fxiocb.req_data = cpu_to_le32(fcport->tgt_id); 1770 1769 break; 1771 1770 case FXDISC_GET_TGT_NODE_LIST: 1772 1771 fdisc->u.fxiocb.flags = ··· 1852 1851 sp->name = "fxdisc"; 1853 1852 qla2x00_init_timer(sp, FXDISC_TIMEOUT); 1854 1853 fdisc->timeout = qla2x00_fxdisc_iocb_timeout; 1855 - fdisc->u.fxiocb.req_func_type = fx_type; 1854 + fdisc->u.fxiocb.req_func_type = cpu_to_le16(fx_type); 1856 1855 sp->done = qla2x00_fxdisc_sp_done; 1857 1856 1858 1857 rval = qla2x00_start_sp(sp); ··· 1905 1904 (uint8_t *)pinfo, 16); 1906 1905 memcpy(vha->hw->gid_list, pinfo, QLAFX00_TGT_NODE_LIST_SIZE); 1907 1906 } 1908 - rval = fdisc->u.fxiocb.result; 1907 + rval = le32_to_cpu(fdisc->u.fxiocb.result); 1909 1908 1910 1909 done_unmap_dma: 1911 1910 if (fdisc->u.fxiocb.rsp_addr) ··· 1928 1927 srb_t *sp = (srb_t *)data; 1929 1928 struct srb_iocb *abt = &sp->u.iocb_cmd; 1930 1929 1931 - abt->u.abt.comp_status = CS_TIMEOUT; 1930 + abt->u.abt.comp_status = cpu_to_le16((uint16_t)CS_TIMEOUT); 1932 1931 complete(&abt->u.abt.comp); 1933 1932 } 1934 1933 ··· 2170 2169 static void 2171 2170 qlafx00_tm_iocb_entry(scsi_qla_host_t *vha, struct req_que *req, 2172 2171 struct tsk_mgmt_entry_fx00 *pkt, srb_t *sp, 2173 - uint16_t sstatus, uint16_t cpstatus) 2172 + __le16 sstatus, __le16 cpstatus) 2174 2173 { 2175 2174 struct srb_iocb *tmf; 2176 2175 2177 2176 tmf = &sp->u.iocb_cmd; 2178 - if (cpstatus != CS_COMPLETE || 2179 - (sstatus & SS_RESPONSE_INFO_LEN_VALID)) 2180 - cpstatus = CS_INCOMPLETE; 2177 + if (cpstatus != cpu_to_le16((uint16_t)CS_COMPLETE) || 2178 + (sstatus & cpu_to_le16((uint16_t)SS_RESPONSE_INFO_LEN_VALID))) 2179 + cpstatus = cpu_to_le16((uint16_t)CS_INCOMPLETE); 2181 2180 tmf->u.tmf.comp_status = cpstatus; 2182 2181 sp->done(vha, sp, 0); 2183 2182 } ··· 2195 2194 return; 2196 2195 2197 2196 abt = &sp->u.iocb_cmd; 2198 - abt->u.abt.comp_status = le32_to_cpu(pkt->tgt_id_sts); 2197 + abt->u.abt.comp_status = pkt->tgt_id_sts; 2199 2198 sp->done(vha, sp, 0); 2200 2199 } 2201 2200 ··· 2217 2216 2218 2217 if (sp->type == SRB_FXIOCB_DCMD) { 2219 2218 iocb_job = &sp->u.iocb_cmd; 2220 - iocb_job->u.fxiocb.seq_number = le32_to_cpu(pkt->seq_no); 2221 - iocb_job->u.fxiocb.fw_flags = le32_to_cpu(pkt->fw_iotcl_flags); 2222 - iocb_job->u.fxiocb.result = le32_to_cpu(pkt->status); 2219 + iocb_job->u.fxiocb.seq_number = pkt->seq_no; 2220 + iocb_job->u.fxiocb.fw_flags = pkt->fw_iotcl_flags; 2221 + iocb_job->u.fxiocb.result = pkt->status; 2223 2222 if (iocb_job->u.fxiocb.flags & SRB_FXDISC_RSP_DWRD_VALID) 2224 2223 iocb_job->u.fxiocb.req_data = 2225 - le32_to_cpu(pkt->dataword_r); 2224 + pkt->dataword_r; 2226 2225 } else { 2227 2226 bsg_job = sp->u.bsg_job; 2228 2227 ··· 2276 2275 fc_port_t *fcport; 2277 2276 struct scsi_cmnd *cp; 2278 2277 struct sts_entry_fx00 *sts; 2279 - uint16_t comp_status; 2280 - uint16_t scsi_status; 2278 + __le16 comp_status; 2279 + __le16 scsi_status; 2281 2280 uint16_t ox_id; 2282 - uint8_t lscsi_status; 2281 + __le16 lscsi_status; 2283 2282 int32_t resid; 2284 2283 uint32_t sense_len, par_sense_len, rsp_info_len, resid_len, 2285 2284 fw_resid_len; ··· 2293 2292 2294 2293 sts = (struct sts_entry_fx00 *) pkt; 2295 2294 2296 - comp_status = le16_to_cpu(sts->comp_status); 2297 - scsi_status = le16_to_cpu(sts->scsi_status) & SS_MASK; 2295 + comp_status = sts->comp_status; 2296 + scsi_status = sts->scsi_status & cpu_to_le16((uint16_t)SS_MASK); 2298 2297 hindex = sts->handle; 2299 2298 handle = LSW(hindex); 2300 2299 ··· 2340 2339 return; 2341 2340 } 2342 2341 2343 - lscsi_status = scsi_status & STATUS_MASK; 2342 + lscsi_status = scsi_status & cpu_to_le16((uint16_t)STATUS_MASK); 2344 2343 2345 2344 fcport = sp->fcport; 2346 2345 2347 2346 ox_id = 0; 2348 2347 sense_len = par_sense_len = rsp_info_len = resid_len = 2349 2348 fw_resid_len = 0; 2350 - if (scsi_status & SS_SENSE_LEN_VALID) 2351 - sense_len = le32_to_cpu(sts->sense_len); 2352 - if (scsi_status & (SS_RESIDUAL_UNDER | SS_RESIDUAL_OVER)) 2349 + if (scsi_status & cpu_to_le16((uint16_t)SS_SENSE_LEN_VALID)) 2350 + sense_len = sts->sense_len; 2351 + if (scsi_status & cpu_to_le16(((uint16_t)SS_RESIDUAL_UNDER 2352 + | (uint16_t)SS_RESIDUAL_OVER))) 2353 2353 resid_len = le32_to_cpu(sts->residual_len); 2354 - if (comp_status == CS_DATA_UNDERRUN) 2354 + if (comp_status == cpu_to_le16((uint16_t)CS_DATA_UNDERRUN)) 2355 2355 fw_resid_len = le32_to_cpu(sts->residual_len); 2356 2356 rsp_info = sense_data = sts->data; 2357 2357 par_sense_len = sizeof(sts->data); 2358 2358 2359 2359 /* Check for overrun. */ 2360 2360 if (comp_status == CS_COMPLETE && 2361 - scsi_status & SS_RESIDUAL_OVER) 2362 - comp_status = CS_DATA_OVERRUN; 2361 + scsi_status & cpu_to_le16((uint16_t)SS_RESIDUAL_OVER)) 2362 + comp_status = cpu_to_le16((uint16_t)CS_DATA_OVERRUN); 2363 2363 2364 2364 /* 2365 2365 * Based on Host and scsi status generate status code for Linux 2366 2366 */ 2367 - switch (comp_status) { 2367 + switch (le16_to_cpu(comp_status)) { 2368 2368 case CS_COMPLETE: 2369 2369 case CS_QUEUE_FULL: 2370 2370 if (scsi_status == 0) { 2371 2371 res = DID_OK << 16; 2372 2372 break; 2373 2373 } 2374 - if (scsi_status & (SS_RESIDUAL_UNDER | SS_RESIDUAL_OVER)) { 2374 + if (scsi_status & cpu_to_le16(((uint16_t)SS_RESIDUAL_UNDER 2375 + | (uint16_t)SS_RESIDUAL_OVER))) { 2375 2376 resid = resid_len; 2376 2377 scsi_set_resid(cp, resid); 2377 2378 ··· 2389 2386 break; 2390 2387 } 2391 2388 } 2392 - res = DID_OK << 16 | lscsi_status; 2389 + res = DID_OK << 16 | le16_to_cpu(lscsi_status); 2393 2390 2394 - if (lscsi_status == SAM_STAT_TASK_SET_FULL) { 2391 + if (lscsi_status == 2392 + cpu_to_le16((uint16_t)SAM_STAT_TASK_SET_FULL)) { 2395 2393 ql_dbg(ql_dbg_io, fcport->vha, 0x3051, 2396 2394 "QUEUE FULL detected.\n"); 2397 2395 break; 2398 2396 } 2399 2397 logit = 0; 2400 - if (lscsi_status != SS_CHECK_CONDITION) 2398 + if (lscsi_status != cpu_to_le16((uint16_t)SS_CHECK_CONDITION)) 2401 2399 break; 2402 2400 2403 2401 memset(cp->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE); 2404 - if (!(scsi_status & SS_SENSE_LEN_VALID)) 2402 + if (!(scsi_status & cpu_to_le16((uint16_t)SS_SENSE_LEN_VALID))) 2405 2403 break; 2406 2404 2407 2405 qlafx00_handle_sense(sp, sense_data, par_sense_len, sense_len, ··· 2416 2412 else 2417 2413 resid = resid_len; 2418 2414 scsi_set_resid(cp, resid); 2419 - if (scsi_status & SS_RESIDUAL_UNDER) { 2415 + if (scsi_status & cpu_to_le16((uint16_t)SS_RESIDUAL_UNDER)) { 2420 2416 if ((IS_FWI2_CAPABLE(ha) || IS_QLAFX00(ha)) 2421 2417 && fw_resid_len != resid_len) { 2422 2418 ql_dbg(ql_dbg_io, fcport->vha, 0x3052, ··· 2424 2420 "(0x%x of 0x%x bytes).\n", 2425 2421 resid, scsi_bufflen(cp)); 2426 2422 2427 - res = DID_ERROR << 16 | lscsi_status; 2423 + res = DID_ERROR << 16 | 2424 + le16_to_cpu(lscsi_status); 2428 2425 goto check_scsi_status; 2429 2426 } 2430 2427 ··· 2441 2436 res = DID_ERROR << 16; 2442 2437 break; 2443 2438 } 2444 - } else if (lscsi_status != SAM_STAT_TASK_SET_FULL && 2445 - lscsi_status != SAM_STAT_BUSY) { 2439 + } else if (lscsi_status != 2440 + cpu_to_le16((uint16_t)SAM_STAT_TASK_SET_FULL) && 2441 + lscsi_status != cpu_to_le16((uint16_t)SAM_STAT_BUSY)) { 2446 2442 /* 2447 2443 * scsi status of task set and busy are considered 2448 2444 * to be task not completed. ··· 2454 2448 "of 0x%x bytes).\n", resid, 2455 2449 scsi_bufflen(cp)); 2456 2450 2457 - res = DID_ERROR << 16 | lscsi_status; 2451 + res = DID_ERROR << 16 | le16_to_cpu(lscsi_status); 2458 2452 goto check_scsi_status; 2459 2453 } else { 2460 2454 ql_dbg(ql_dbg_io, fcport->vha, 0x3055, ··· 2462 2456 scsi_status, lscsi_status); 2463 2457 } 2464 2458 2465 - res = DID_OK << 16 | lscsi_status; 2459 + res = DID_OK << 16 | le16_to_cpu(lscsi_status); 2466 2460 logit = 0; 2467 2461 2468 2462 check_scsi_status: ··· 2471 2465 * Status. 2472 2466 */ 2473 2467 if (lscsi_status != 0) { 2474 - if (lscsi_status == SAM_STAT_TASK_SET_FULL) { 2468 + if (lscsi_status == 2469 + cpu_to_le16((uint16_t)SAM_STAT_TASK_SET_FULL)) { 2475 2470 ql_dbg(ql_dbg_io, fcport->vha, 0x3056, 2476 2471 "QUEUE FULL detected.\n"); 2477 2472 logit = 1; 2478 2473 break; 2479 2474 } 2480 - if (lscsi_status != SS_CHECK_CONDITION) 2475 + if (lscsi_status != 2476 + cpu_to_le16((uint16_t)SS_CHECK_CONDITION)) 2481 2477 break; 2482 2478 2483 2479 memset(cp->sense_buffer, 0, SCSI_SENSE_BUFFERSIZE); 2484 - if (!(scsi_status & SS_SENSE_LEN_VALID)) 2480 + if (!(scsi_status & 2481 + cpu_to_le16((uint16_t)SS_SENSE_LEN_VALID))) 2485 2482 break; 2486 2483 2487 2484 qlafx00_handle_sense(sp, sense_data, par_sense_len, ··· 2638 2629 uint32_t handle, hindex, handle_count, i; 2639 2630 uint16_t que; 2640 2631 struct req_que *req; 2641 - uint32_t *handle_ptr; 2632 + __le32 *handle_ptr; 2642 2633 2643 2634 stsmfx = (struct multi_sts_entry_fx00 *) pkt; 2644 2635 ··· 2652 2643 return; 2653 2644 } 2654 2645 2655 - handle_ptr = (uint32_t *) &stsmfx->handles[0]; 2646 + handle_ptr = &stsmfx->handles[0]; 2656 2647 2657 2648 for (i = 0; i < handle_count; i++) { 2658 2649 hindex = le32_to_cpu(*handle_ptr); ··· 2723 2714 if (!vha->flags.online) 2724 2715 return; 2725 2716 2726 - while (RD_REG_DWORD(&(rsp->ring_ptr->signature)) != 2717 + while (RD_REG_DWORD((void __iomem *)&(rsp->ring_ptr->signature)) != 2727 2718 RESPONSE_PROCESSED) { 2728 2719 lptr = rsp->ring_ptr; 2729 - memcpy_fromio(rsp->rsp_pkt, lptr, sizeof(rsp->rsp_pkt)); 2720 + memcpy_fromio(rsp->rsp_pkt, (void __iomem *)lptr, 2721 + sizeof(rsp->rsp_pkt)); 2730 2722 pkt = (struct sts_entry_fx00 *)rsp->rsp_pkt; 2731 2723 2732 2724 rsp->ring_index++; ··· 2778 2768 break; 2779 2769 } 2780 2770 next_iter: 2781 - WRT_REG_DWORD(&lptr->signature, RESPONSE_PROCESSED); 2771 + WRT_REG_DWORD((void __iomem *)&lptr->signature, 2772 + RESPONSE_PROCESSED); 2782 2773 wmb(); 2783 2774 } 2784 2775 ··· 2969 2958 cont_pkt = (cont_a64_entry_t *)req->ring_ptr; 2970 2959 2971 2960 /* Load packet defaults. */ 2972 - *((uint32_t *)(&lcont_pkt->entry_type)) = 2973 - __constant_cpu_to_le32(CONTINUE_A64_TYPE_FX00); 2961 + lcont_pkt->entry_type = CONTINUE_A64_TYPE_FX00; 2974 2962 2975 2963 return cont_pkt; 2976 2964 } ··· 2979 2969 uint16_t tot_dsds, struct cmd_type_7_fx00 *lcmd_pkt) 2980 2970 { 2981 2971 uint16_t avail_dsds; 2982 - uint32_t *cur_dsd; 2972 + __le32 *cur_dsd; 2983 2973 scsi_qla_host_t *vha; 2984 2974 struct scsi_cmnd *cmd; 2985 2975 struct scatterlist *sg; ··· 2996 2986 cont_pkt = NULL; 2997 2987 2998 2988 /* Update entry type to indicate Command Type 3 IOCB */ 2999 - *((uint32_t *)(&lcmd_pkt->entry_type)) = 3000 - __constant_cpu_to_le32(FX00_COMMAND_TYPE_7); 2989 + lcmd_pkt->entry_type = FX00_COMMAND_TYPE_7; 3001 2990 3002 2991 /* No data transfer */ 3003 2992 if (!scsi_bufflen(cmd) || cmd->sc_data_direction == DMA_NONE) { ··· 3015 3006 3016 3007 /* One DSD is available in the Command Type 3 IOCB */ 3017 3008 avail_dsds = 1; 3018 - cur_dsd = (uint32_t *)&lcmd_pkt->dseg_0_address; 3009 + cur_dsd = (__le32 *)&lcmd_pkt->dseg_0_address; 3019 3010 3020 3011 /* Load data segments */ 3021 3012 scsi_for_each_sg(cmd, sg, tot_dsds, i) { ··· 3030 3021 memset(&lcont_pkt, 0, REQUEST_ENTRY_SIZE); 3031 3022 cont_pkt = 3032 3023 qlafx00_prep_cont_type1_iocb(req, &lcont_pkt); 3033 - cur_dsd = (uint32_t *)lcont_pkt.dseg_0_address; 3024 + cur_dsd = (__le32 *)lcont_pkt.dseg_0_address; 3034 3025 avail_dsds = 5; 3035 3026 cont = 1; 3036 3027 } ··· 3233 3224 tm_iocb.timeout = cpu_to_le16(qla2x00_get_async_timeout(vha) + 2); 3234 3225 tm_iocb.tgt_id = cpu_to_le16(sp->fcport->tgt_id); 3235 3226 tm_iocb.control_flags = cpu_to_le32(fxio->u.tmf.flags); 3236 - if (tm_iocb.control_flags == TCF_LUN_RESET) { 3227 + if (tm_iocb.control_flags == cpu_to_le32((uint32_t)TCF_LUN_RESET)) { 3237 3228 int_to_scsilun(fxio->u.tmf.lun, &llun); 3238 3229 host_to_adap((uint8_t *)&llun, (uint8_t *)&tm_iocb.lun, 3239 3230 sizeof(struct scsi_lun)); 3240 3231 } 3241 3232 3242 - memcpy((void __iomem *)ptm_iocb, &tm_iocb, 3233 + memcpy((void *)ptm_iocb, &tm_iocb, 3243 3234 sizeof(struct tsk_mgmt_entry_fx00)); 3244 3235 wmb(); 3245 3236 } ··· 3261 3252 abt_iocb.tgt_id_sts = cpu_to_le16(sp->fcport->tgt_id); 3262 3253 abt_iocb.req_que_no = cpu_to_le16(req->id); 3263 3254 3264 - memcpy((void __iomem *)pabt_iocb, &abt_iocb, 3255 + memcpy((void *)pabt_iocb, &abt_iocb, 3265 3256 sizeof(struct abort_iocb_entry_fx00)); 3266 3257 wmb(); 3267 3258 } ··· 3282 3273 3283 3274 if (sp->type == SRB_FXIOCB_DCMD) { 3284 3275 fx_iocb.func_num = 3285 - cpu_to_le16(sp->u.iocb_cmd.u.fxiocb.req_func_type); 3286 - fx_iocb.adapid = cpu_to_le32(fxio->u.fxiocb.adapter_id); 3287 - fx_iocb.adapid_hi = cpu_to_le32(fxio->u.fxiocb.adapter_id_hi); 3288 - fx_iocb.reserved_0 = cpu_to_le32(fxio->u.fxiocb.reserved_0); 3289 - fx_iocb.reserved_1 = cpu_to_le32(fxio->u.fxiocb.reserved_1); 3290 - fx_iocb.dataword_extra = 3291 - cpu_to_le32(fxio->u.fxiocb.req_data_extra); 3276 + sp->u.iocb_cmd.u.fxiocb.req_func_type; 3277 + fx_iocb.adapid = fxio->u.fxiocb.adapter_id; 3278 + fx_iocb.adapid_hi = fxio->u.fxiocb.adapter_id_hi; 3279 + fx_iocb.reserved_0 = fxio->u.fxiocb.reserved_0; 3280 + fx_iocb.reserved_1 = fxio->u.fxiocb.reserved_1; 3281 + fx_iocb.dataword_extra = fxio->u.fxiocb.req_data_extra; 3292 3282 3293 3283 if (fxio->u.fxiocb.flags & SRB_FXDISC_REQ_DMA_VALID) { 3294 3284 fx_iocb.req_dsdcnt = cpu_to_le16(1); ··· 3314 3306 } 3315 3307 3316 3308 if (fxio->u.fxiocb.flags & SRB_FXDISC_REQ_DWRD_VALID) { 3317 - fx_iocb.dataword = 3318 - cpu_to_le32(fxio->u.fxiocb.req_data); 3309 + fx_iocb.dataword = fxio->u.fxiocb.req_data; 3319 3310 } 3320 3311 fx_iocb.flags = fxio->u.fxiocb.flags; 3321 3312 } else { ··· 3330 3323 fx_iocb.reserved_1 = piocb_rqst->reserved_1; 3331 3324 fx_iocb.dataword_extra = piocb_rqst->dataword_extra; 3332 3325 fx_iocb.dataword = piocb_rqst->dataword; 3333 - fx_iocb.req_xfrcnt = cpu_to_le16(piocb_rqst->req_len); 3334 - fx_iocb.rsp_xfrcnt = cpu_to_le16(piocb_rqst->rsp_len); 3326 + fx_iocb.req_xfrcnt = piocb_rqst->req_len; 3327 + fx_iocb.rsp_xfrcnt = piocb_rqst->rsp_len; 3335 3328 3336 3329 if (piocb_rqst->flags & SRB_FXDISC_REQ_DMA_VALID) { 3337 3330 int avail_dsds, tot_dsds; 3338 3331 cont_a64_entry_t lcont_pkt; 3339 3332 cont_a64_entry_t *cont_pkt = NULL; 3340 - uint32_t *cur_dsd; 3333 + __le32 *cur_dsd; 3341 3334 int index = 0, cont = 0; 3342 3335 3343 3336 fx_iocb.req_dsdcnt = 3344 3337 cpu_to_le16(bsg_job->request_payload.sg_cnt); 3345 3338 tot_dsds = 3346 - cpu_to_le32(bsg_job->request_payload.sg_cnt); 3347 - cur_dsd = (uint32_t *)&fx_iocb.dseg_rq_address[0]; 3339 + bsg_job->request_payload.sg_cnt; 3340 + cur_dsd = (__le32 *)&fx_iocb.dseg_rq_address[0]; 3348 3341 avail_dsds = 1; 3349 3342 for_each_sg(bsg_job->request_payload.sg_list, sg, 3350 3343 tot_dsds, index) { ··· 3362 3355 qlafx00_prep_cont_type1_iocb( 3363 3356 sp->fcport->vha->req, 3364 3357 &lcont_pkt); 3365 - cur_dsd = (uint32_t *) 3358 + cur_dsd = (__le32 *) 3366 3359 lcont_pkt.dseg_0_address; 3367 3360 avail_dsds = 5; 3368 3361 cont = 1; ··· 3400 3393 int avail_dsds, tot_dsds; 3401 3394 cont_a64_entry_t lcont_pkt; 3402 3395 cont_a64_entry_t *cont_pkt = NULL; 3403 - uint32_t *cur_dsd; 3396 + __le32 *cur_dsd; 3404 3397 int index = 0, cont = 0; 3405 3398 3406 3399 fx_iocb.rsp_dsdcnt = 3407 3400 cpu_to_le16(bsg_job->reply_payload.sg_cnt); 3408 - tot_dsds = cpu_to_le32(bsg_job->reply_payload.sg_cnt); 3409 - cur_dsd = (uint32_t *)&fx_iocb.dseg_rsp_address[0]; 3401 + tot_dsds = bsg_job->reply_payload.sg_cnt; 3402 + cur_dsd = (__le32 *)&fx_iocb.dseg_rsp_address[0]; 3410 3403 avail_dsds = 1; 3411 3404 3412 3405 for_each_sg(bsg_job->reply_payload.sg_list, sg, ··· 3425 3418 qlafx00_prep_cont_type1_iocb( 3426 3419 sp->fcport->vha->req, 3427 3420 &lcont_pkt); 3428 - cur_dsd = (uint32_t *) 3421 + cur_dsd = (__le32 *) 3429 3422 lcont_pkt.dseg_0_address; 3430 3423 avail_dsds = 5; 3431 3424 cont = 1; ··· 3460 3453 } 3461 3454 3462 3455 if (piocb_rqst->flags & SRB_FXDISC_REQ_DWRD_VALID) 3463 - fx_iocb.dataword = cpu_to_le32(piocb_rqst->dataword); 3456 + fx_iocb.dataword = piocb_rqst->dataword; 3464 3457 fx_iocb.flags = piocb_rqst->flags; 3465 3458 fx_iocb.entry_count = entry_cnt; 3466 3459 } ··· 3469 3462 sp->fcport->vha, 0x3047, 3470 3463 (uint8_t *)&fx_iocb, sizeof(struct fxdisc_entry_fx00)); 3471 3464 3472 - memcpy((void __iomem *)pfxiocb, &fx_iocb, 3465 + memcpy((void *)pfxiocb, &fx_iocb, 3473 3466 sizeof(struct fxdisc_entry_fx00)); 3474 3467 wmb(); 3475 3468 }
+49 -49
drivers/scsi/qla2xxx/qla_mr.h
··· 24 24 uint32_t handle; /* System handle. */ 25 25 uint32_t handle_hi; 26 26 27 - uint16_t tgt_idx; /* Target Idx. */ 27 + __le16 tgt_idx; /* Target Idx. */ 28 28 uint16_t timeout; /* Command timeout. */ 29 29 30 - uint16_t dseg_count; /* Data segment count. */ 30 + __le16 dseg_count; /* Data segment count. */ 31 31 uint16_t scsi_rsp_dsd_len; 32 32 33 33 struct scsi_lun lun; /* LUN (LE). */ ··· 41 41 uint8_t crn; 42 42 43 43 uint8_t fcp_cdb[MAX_CMDSZ]; /* SCSI command words. */ 44 - uint32_t byte_count; /* Total byte count. */ 44 + __le32 byte_count; /* Total byte count. */ 45 45 46 46 uint32_t dseg_0_address[2]; /* Data segment 0 address. */ 47 47 uint32_t dseg_0_len; /* Data segment 0 length. */ ··· 81 81 uint32_t handle; /* System handle. */ 82 82 uint32_t handle_hi; /* System handle. */ 83 83 84 - uint16_t comp_status; /* Completion status. */ 84 + __le16 comp_status; /* Completion status. */ 85 85 uint16_t reserved_0; /* OX_ID used by the firmware. */ 86 86 87 - uint32_t residual_len; /* FW calc residual transfer length. */ 87 + __le32 residual_len; /* FW calc residual transfer length. */ 88 88 89 89 uint16_t reserved_1; 90 90 uint16_t state_flags; /* State flags. */ 91 91 92 92 uint16_t reserved_2; 93 - uint16_t scsi_status; /* SCSI status. */ 93 + __le16 scsi_status; /* SCSI status. */ 94 94 95 95 uint32_t sense_len; /* FCP SENSE length. */ 96 96 uint8_t data[32]; /* FCP response/sense information. */ ··· 106 106 uint8_t handle_count; 107 107 uint8_t entry_status; 108 108 109 - uint32_t handles[MAX_HANDLE_COUNT]; 109 + __le32 handles[MAX_HANDLE_COUNT]; 110 110 }; 111 111 112 112 #define TSK_MGMT_IOCB_TYPE_FX00 0x05 ··· 116 116 uint8_t sys_define; 117 117 uint8_t entry_status; /* Entry Status. */ 118 118 119 - uint32_t handle; /* System handle. */ 119 + __le32 handle; /* System handle. */ 120 120 121 121 uint32_t handle_hi; /* System handle. */ 122 122 123 - uint16_t tgt_id; /* Target Idx. */ 123 + __le16 tgt_id; /* Target Idx. */ 124 124 125 125 uint16_t reserved_1; 126 126 127 127 uint16_t delay; /* Activity delay in seconds. */ 128 128 129 - uint16_t timeout; /* Command timeout. */ 129 + __le16 timeout; /* Command timeout. */ 130 130 131 131 struct scsi_lun lun; /* LUN (LE). */ 132 132 133 - uint32_t control_flags; /* Control Flags. */ 133 + __le32 control_flags; /* Control Flags. */ 134 134 135 135 uint8_t reserved_2[32]; 136 136 }; ··· 143 143 uint8_t sys_define; /* System defined. */ 144 144 uint8_t entry_status; /* Entry Status. */ 145 145 146 - uint32_t handle; /* System handle. */ 147 - uint32_t handle_hi; /* System handle. */ 146 + __le32 handle; /* System handle. */ 147 + __le32 handle_hi; /* System handle. */ 148 148 149 - uint16_t tgt_id_sts; /* Completion status. */ 150 - uint16_t options; 149 + __le16 tgt_id_sts; /* Completion status. */ 150 + __le16 options; 151 151 152 - uint32_t abort_handle; /* System handle. */ 153 - uint32_t abort_handle_hi; /* System handle. */ 152 + __le32 abort_handle; /* System handle. */ 153 + __le32 abort_handle_hi; /* System handle. */ 154 154 155 - uint16_t req_que_no; 155 + __le16 req_que_no; 156 156 uint8_t reserved_1[38]; 157 157 }; 158 158 ··· 167 167 uint32_t reserved_0; /* System handle. */ 168 168 169 169 uint16_t comp_func_num; 170 - uint16_t fw_iotcl_flags; 170 + __le16 fw_iotcl_flags; 171 171 172 - uint32_t dataword_r; /* Data word returned */ 172 + __le32 dataword_r; /* Data word returned */ 173 173 uint32_t adapid; /* Adapter ID */ 174 174 uint32_t adapid_hi; /* Adapter ID high */ 175 175 uint32_t reserved_1; 176 176 177 - uint32_t seq_no; 177 + __le32 seq_no; 178 178 uint8_t reserved_2[20]; 179 179 uint32_t residuallen; 180 - uint32_t status; 180 + __le32 status; 181 181 }; 182 182 183 183 #define STATUS_CONT_TYPE_FX00 0x04 ··· 189 189 uint8_t sys_define; /* System Defined. */ 190 190 uint8_t entry_status; /* Entry Status. */ 191 191 192 - uint32_t handle; /* System handle. */ 193 - uint32_t reserved_0; /* System handle. */ 192 + __le32 handle; /* System handle. */ 193 + __le32 reserved_0; /* System handle. */ 194 194 195 - uint16_t func_num; 196 - uint16_t req_xfrcnt; 197 - uint16_t req_dsdcnt; 198 - uint16_t rsp_xfrcnt; 199 - uint16_t rsp_dsdcnt; 195 + __le16 func_num; 196 + __le16 req_xfrcnt; 197 + __le16 req_dsdcnt; 198 + __le16 rsp_xfrcnt; 199 + __le16 rsp_dsdcnt; 200 200 uint8_t flags; 201 201 uint8_t reserved_1; 202 202 203 - uint32_t dseg_rq_address[2]; /* Data segment 0 address. */ 204 - uint32_t dseg_rq_len; /* Data segment 0 length. */ 205 - uint32_t dseg_rsp_address[2]; /* Data segment 1 address. */ 206 - uint32_t dseg_rsp_len; /* Data segment 1 length. */ 203 + __le32 dseg_rq_address[2]; /* Data segment 0 address. */ 204 + __le32 dseg_rq_len; /* Data segment 0 length. */ 205 + __le32 dseg_rsp_address[2]; /* Data segment 1 address. */ 206 + __le32 dseg_rsp_len; /* Data segment 1 length. */ 207 207 208 - uint32_t dataword; 209 - uint32_t adapid; 210 - uint32_t adapid_hi; 211 - uint32_t dataword_extra; 208 + __le32 dataword; 209 + __le32 adapid; 210 + __le32 adapid_hi; 211 + __le32 dataword_extra; 212 212 }; 213 213 214 214 struct qlafx00_tgt_node_info { ··· 421 421 WRT_REG_DWORD((ha)->cregbase + off, val) 422 422 423 423 struct qla_mt_iocb_rqst_fx00 { 424 - uint32_t reserved_0; 424 + __le32 reserved_0; 425 425 426 - uint16_t func_type; 426 + __le16 func_type; 427 427 uint8_t flags; 428 428 uint8_t reserved_1; 429 429 430 - uint32_t dataword; 430 + __le32 dataword; 431 431 432 - uint32_t adapid; 433 - uint32_t adapid_hi; 432 + __le32 adapid; 433 + __le32 adapid_hi; 434 434 435 - uint32_t dataword_extra; 435 + __le32 dataword_extra; 436 436 437 - uint32_t req_len; 437 + __le32 req_len; 438 438 439 - uint32_t rsp_len; 439 + __le32 rsp_len; 440 440 }; 441 441 442 442 struct qla_mt_iocb_rsp_fx00 { 443 443 uint32_t reserved_1; 444 444 445 445 uint16_t func_type; 446 - uint16_t ioctl_flags; 446 + __le16 ioctl_flags; 447 447 448 - uint32_t ioctl_data; 448 + __le32 ioctl_data; 449 449 450 450 uint32_t adapid; 451 451 uint32_t adapid_hi; 452 452 453 453 uint32_t reserved_2; 454 - uint32_t seq_number; 454 + __le32 seq_number; 455 455 456 456 uint8_t reserved_3[20]; 457 457 458 458 int32_t res_count; 459 459 460 - uint32_t status; 460 + __le32 status; 461 461 }; 462 462 463 463
+3 -7
drivers/scsi/qla2xxx/qla_os.c
··· 104 104 "Set to control shifting of command type processing " 105 105 "based on total number of SG elements."); 106 106 107 - static void qla2x00_free_device(scsi_qla_host_t *); 108 - 109 107 int ql2xfdmienable=1; 110 108 module_param(ql2xfdmienable, int, S_IRUGO); 111 109 MODULE_PARM_DESC(ql2xfdmienable, ··· 235 237 236 238 static int qla2x00_change_queue_depth(struct scsi_device *, int, int); 237 239 static int qla2x00_change_queue_type(struct scsi_device *, int); 240 + static void qla2x00_free_device(scsi_qla_host_t *); 238 241 239 242 struct scsi_host_template qla2xxx_driver_template = { 240 243 .module = THIS_MODULE, ··· 2839 2840 qla2x00_dfs_setup(base_vha); 2840 2841 2841 2842 ql_log(ql_log_info, base_vha, 0x00fb, 2842 - "QLogic %s - %s.\n", 2843 - ha->model_number, ha->model_desc ? ha->model_desc : ""); 2843 + "QLogic %s - %s.\n", ha->model_number, ha->model_desc); 2844 2844 ql_log(ql_log_info, base_vha, 0x00fc, 2845 2845 "ISP%04X: %s @ %s hdma%c host#=%ld fw=%s.\n", 2846 2846 pdev->device, ha->isp_ops->pci_info_str(base_vha, pci_info), ··· 2979 2981 set_bit(UNLOADING, &base_vha->dpc_flags); 2980 2982 mutex_lock(&ha->vport_lock); 2981 2983 while (ha->cur_vport_count) { 2982 - struct Scsi_Host *scsi_host; 2983 - 2984 2984 spin_lock_irqsave(&ha->vport_slock, flags); 2985 2985 2986 2986 BUG_ON(base_vha->list.next == &ha->vp_list); 2987 2987 /* This assumes first entry in ha->vp_list is always base vha */ 2988 2988 vha = list_first_entry(&base_vha->list, scsi_qla_host_t, list); 2989 - scsi_host = scsi_host_get(vha->host); 2989 + scsi_host_get(vha->host); 2990 2990 2991 2991 spin_unlock_irqrestore(&ha->vport_slock, flags); 2992 2992 mutex_unlock(&ha->vport_lock);
+70 -104
drivers/scsi/scsi_debug.c
··· 258 258 static struct sdebug_queued_cmd queued_arr[SCSI_DEBUG_CANQUEUE]; 259 259 260 260 static unsigned char * fake_storep; /* ramdisk storage */ 261 - static unsigned char *dif_storep; /* protection info */ 261 + static struct sd_dif_tuple *dif_storep; /* protection info */ 262 262 static void *map_storep; /* provisioning map */ 263 263 264 264 static unsigned long map_size; ··· 276 276 static char sdebug_proc_name[] = "scsi_debug"; 277 277 278 278 static struct bus_type pseudo_lld_bus; 279 - 280 - static inline sector_t dif_offset(sector_t sector) 281 - { 282 - return sector << 3; 283 - } 284 279 285 280 static struct device_driver sdebug_driverfs_driver = { 286 281 .name = sdebug_proc_name, ··· 1731 1736 return ret; 1732 1737 } 1733 1738 1739 + static u16 dif_compute_csum(const void *buf, int len) 1740 + { 1741 + u16 csum; 1742 + 1743 + switch (scsi_debug_guard) { 1744 + case 1: 1745 + csum = ip_compute_csum(buf, len); 1746 + break; 1747 + case 0: 1748 + csum = cpu_to_be16(crc_t10dif(buf, len)); 1749 + break; 1750 + } 1751 + return csum; 1752 + } 1753 + 1754 + static int dif_verify(struct sd_dif_tuple *sdt, const void *data, 1755 + sector_t sector, u32 ei_lba) 1756 + { 1757 + u16 csum = dif_compute_csum(data, scsi_debug_sector_size); 1758 + 1759 + if (sdt->guard_tag != csum) { 1760 + pr_err("%s: GUARD check failed on sector %lu rcvd 0x%04x, data 0x%04x\n", 1761 + __func__, 1762 + (unsigned long)sector, 1763 + be16_to_cpu(sdt->guard_tag), 1764 + be16_to_cpu(csum)); 1765 + return 0x01; 1766 + } 1767 + if (scsi_debug_dif == SD_DIF_TYPE1_PROTECTION && 1768 + be32_to_cpu(sdt->ref_tag) != (sector & 0xffffffff)) { 1769 + pr_err("%s: REF check failed on sector %lu\n", 1770 + __func__, (unsigned long)sector); 1771 + return 0x03; 1772 + } 1773 + if (scsi_debug_dif == SD_DIF_TYPE2_PROTECTION && 1774 + be32_to_cpu(sdt->ref_tag) != ei_lba) { 1775 + pr_err("%s: REF check failed on sector %lu\n", 1776 + __func__, (unsigned long)sector); 1777 + dif_errors++; 1778 + return 0x03; 1779 + } 1780 + return 0; 1781 + } 1782 + 1734 1783 static int prot_verify_read(struct scsi_cmnd *SCpnt, sector_t start_sec, 1735 1784 unsigned int sectors, u32 ei_lba) 1736 1785 { ··· 1787 1748 1788 1749 start_sec = do_div(tmp_sec, sdebug_store_sectors); 1789 1750 1790 - sdt = (struct sd_dif_tuple *)(dif_storep + dif_offset(start_sec)); 1751 + sdt = dif_storep + start_sec; 1791 1752 1792 1753 for (i = 0 ; i < sectors ; i++) { 1793 - u16 csum; 1754 + int ret; 1794 1755 1795 1756 if (sdt[i].app_tag == 0xffff) 1796 1757 continue; 1797 1758 1798 1759 sector = start_sec + i; 1799 1760 1800 - switch (scsi_debug_guard) { 1801 - case 1: 1802 - csum = ip_compute_csum(fake_storep + 1803 - sector * scsi_debug_sector_size, 1804 - scsi_debug_sector_size); 1805 - break; 1806 - case 0: 1807 - csum = crc_t10dif(fake_storep + 1808 - sector * scsi_debug_sector_size, 1809 - scsi_debug_sector_size); 1810 - csum = cpu_to_be16(csum); 1811 - break; 1812 - default: 1813 - BUG(); 1814 - } 1815 - 1816 - if (sdt[i].guard_tag != csum) { 1817 - printk(KERN_ERR "%s: GUARD check failed on sector %lu" \ 1818 - " rcvd 0x%04x, data 0x%04x\n", __func__, 1819 - (unsigned long)sector, 1820 - be16_to_cpu(sdt[i].guard_tag), 1821 - be16_to_cpu(csum)); 1761 + ret = dif_verify(&sdt[i], 1762 + fake_storep + sector * scsi_debug_sector_size, 1763 + sector, ei_lba); 1764 + if (ret) { 1822 1765 dif_errors++; 1823 - return 0x01; 1824 - } 1825 - 1826 - if (scsi_debug_dif == SD_DIF_TYPE1_PROTECTION && 1827 - be32_to_cpu(sdt[i].ref_tag) != (sector & 0xffffffff)) { 1828 - printk(KERN_ERR "%s: REF check failed on sector %lu\n", 1829 - __func__, (unsigned long)sector); 1830 - dif_errors++; 1831 - return 0x03; 1832 - } 1833 - 1834 - if (scsi_debug_dif == SD_DIF_TYPE2_PROTECTION && 1835 - be32_to_cpu(sdt[i].ref_tag) != ei_lba) { 1836 - printk(KERN_ERR "%s: REF check failed on sector %lu\n", 1837 - __func__, (unsigned long)sector); 1838 - dif_errors++; 1839 - return 0x03; 1766 + return ret; 1840 1767 } 1841 1768 1842 1769 ei_lba++; 1843 1770 } 1844 1771 1845 - resid = sectors * 8; /* Bytes of protection data to copy into sgl */ 1772 + /* Bytes of protection data to copy into sgl */ 1773 + resid = sectors * sizeof(*dif_storep); 1846 1774 sector = start_sec; 1847 1775 1848 1776 scsi_for_each_prot_sg(SCpnt, psgl, scsi_prot_sg_count(SCpnt), i) { 1849 1777 int len = min(psgl->length, resid); 1850 1778 1851 1779 paddr = kmap_atomic(sg_page(psgl)) + psgl->offset; 1852 - memcpy(paddr, dif_storep + dif_offset(sector), len); 1780 + memcpy(paddr, dif_storep + sector, len); 1853 1781 1854 - sector += len >> 3; 1782 + sector += len / sizeof(*dif_storep); 1855 1783 if (sector >= sdebug_store_sectors) { 1856 1784 /* Force wrap */ 1857 1785 tmp_sec = sector; ··· 1916 1910 sector_t tmp_sec = start_sec; 1917 1911 sector_t sector; 1918 1912 int ppage_offset; 1919 - unsigned short csum; 1920 1913 1921 1914 sector = do_div(tmp_sec, sdebug_store_sectors); 1922 1915 1923 1916 BUG_ON(scsi_sg_count(SCpnt) == 0); 1924 1917 BUG_ON(scsi_prot_sg_count(SCpnt) == 0); 1925 1918 1926 - paddr = kmap_atomic(sg_page(psgl)) + psgl->offset; 1927 1919 ppage_offset = 0; 1928 1920 1929 1921 /* For each data page */ 1930 1922 scsi_for_each_sg(SCpnt, dsgl, scsi_sg_count(SCpnt), i) { 1931 1923 daddr = kmap_atomic(sg_page(dsgl)) + dsgl->offset; 1924 + paddr = kmap_atomic(sg_page(psgl)) + psgl->offset; 1932 1925 1933 1926 /* For each sector-sized chunk in data page */ 1934 - for (j = 0 ; j < dsgl->length ; j += scsi_debug_sector_size) { 1927 + for (j = 0; j < dsgl->length; j += scsi_debug_sector_size) { 1935 1928 1936 1929 /* If we're at the end of the current 1937 1930 * protection page advance to the next one ··· 1946 1941 1947 1942 sdt = paddr + ppage_offset; 1948 1943 1949 - switch (scsi_debug_guard) { 1950 - case 1: 1951 - csum = ip_compute_csum(daddr, 1952 - scsi_debug_sector_size); 1953 - break; 1954 - case 0: 1955 - csum = cpu_to_be16(crc_t10dif(daddr, 1956 - scsi_debug_sector_size)); 1957 - break; 1958 - default: 1959 - BUG(); 1960 - ret = 0; 1961 - goto out; 1962 - } 1963 - 1964 - if (sdt->guard_tag != csum) { 1965 - printk(KERN_ERR 1966 - "%s: GUARD check failed on sector %lu " \ 1967 - "rcvd 0x%04x, calculated 0x%04x\n", 1968 - __func__, (unsigned long)sector, 1969 - be16_to_cpu(sdt->guard_tag), 1970 - be16_to_cpu(csum)); 1971 - ret = 0x01; 1972 - dump_sector(daddr, scsi_debug_sector_size); 1973 - goto out; 1974 - } 1975 - 1976 - if (scsi_debug_dif == SD_DIF_TYPE1_PROTECTION && 1977 - be32_to_cpu(sdt->ref_tag) 1978 - != (start_sec & 0xffffffff)) { 1979 - printk(KERN_ERR 1980 - "%s: REF check failed on sector %lu\n", 1981 - __func__, (unsigned long)sector); 1982 - ret = 0x03; 1983 - dump_sector(daddr, scsi_debug_sector_size); 1984 - goto out; 1985 - } 1986 - 1987 - if (scsi_debug_dif == SD_DIF_TYPE2_PROTECTION && 1988 - be32_to_cpu(sdt->ref_tag) != ei_lba) { 1989 - printk(KERN_ERR 1990 - "%s: REF check failed on sector %lu\n", 1991 - __func__, (unsigned long)sector); 1992 - ret = 0x03; 1993 - dump_sector(daddr, scsi_debug_sector_size); 1944 + ret = dif_verify(sdt, daddr + j, start_sec, ei_lba); 1945 + if (ret) { 1946 + dump_sector(daddr + j, scsi_debug_sector_size); 1994 1947 goto out; 1995 1948 } 1996 1949 ··· 1957 1994 * correctness we need to verify each sector 1958 1995 * before writing it to "stable" storage 1959 1996 */ 1960 - memcpy(dif_storep + dif_offset(sector), sdt, 8); 1997 + memcpy(dif_storep + sector, sdt, sizeof(*sdt)); 1961 1998 1962 1999 sector++; 1963 2000 ··· 1966 2003 1967 2004 start_sec++; 1968 2005 ei_lba++; 1969 - daddr += scsi_debug_sector_size; 1970 2006 ppage_offset += sizeof(struct sd_dif_tuple); 1971 2007 } 1972 2008 2009 + kunmap_atomic(paddr); 1973 2010 kunmap_atomic(daddr); 1974 2011 } 1975 - 1976 - kunmap_atomic(paddr); 1977 2012 1978 2013 dix_writes++; 1979 2014 ··· 1979 2018 1980 2019 out: 1981 2020 dif_errors++; 1982 - kunmap_atomic(daddr); 1983 2021 kunmap_atomic(paddr); 2022 + kunmap_atomic(daddr); 1984 2023 return ret; 1985 2024 } 1986 2025 ··· 2051 2090 memset(fake_storep + 2052 2091 lba * scsi_debug_sector_size, 0, 2053 2092 scsi_debug_sector_size * 2093 + scsi_debug_unmap_granularity); 2094 + } 2095 + if (dif_storep) { 2096 + memset(dif_storep + lba, 0xff, 2097 + sizeof(*dif_storep) * 2054 2098 scsi_debug_unmap_granularity); 2055 2099 } 2056 2100 } ··· 3366 3400 if (scsi_debug_num_parts > 0) 3367 3401 sdebug_build_parts(fake_storep, sz); 3368 3402 3369 - if (scsi_debug_dif) { 3403 + if (scsi_debug_dix) { 3370 3404 int dif_size; 3371 3405 3372 3406 dif_size = sdebug_store_sectors * sizeof(struct sd_dif_tuple);
+22 -5
drivers/scsi/scsi_lib.c
··· 434 434 list_splice_init(&shost->starved_list, &starved_list); 435 435 436 436 while (!list_empty(&starved_list)) { 437 + struct request_queue *slq; 438 + 437 439 /* 438 440 * As long as shost is accepting commands and we have 439 441 * starved queues, call blk_run_queue. scsi_request_fn ··· 458 456 continue; 459 457 } 460 458 461 - spin_unlock(shost->host_lock); 462 - spin_lock(sdev->request_queue->queue_lock); 463 - __blk_run_queue(sdev->request_queue); 464 - spin_unlock(sdev->request_queue->queue_lock); 465 - spin_lock(shost->host_lock); 459 + /* 460 + * Once we drop the host lock, a racing scsi_remove_device() 461 + * call may remove the sdev from the starved list and destroy 462 + * it and the queue. Mitigate by taking a reference to the 463 + * queue and never touching the sdev again after we drop the 464 + * host lock. Note: if __scsi_remove_device() invokes 465 + * blk_cleanup_queue() before the queue is run from this 466 + * function then blk_run_queue() will return immediately since 467 + * blk_cleanup_queue() marks the queue with QUEUE_FLAG_DYING. 468 + */ 469 + slq = sdev->request_queue; 470 + if (!blk_get_queue(slq)) 471 + continue; 472 + spin_unlock_irqrestore(shost->host_lock, flags); 473 + 474 + blk_run_queue(slq); 475 + blk_put_queue(slq); 476 + 477 + spin_lock_irqsave(shost->host_lock, flags); 466 478 } 467 479 /* put any unprocessed entries back */ 468 480 list_splice(&starved_list, &shost->starved_list); ··· 2193 2177 case SDEV_OFFLINE: 2194 2178 case SDEV_TRANSPORT_OFFLINE: 2195 2179 case SDEV_CANCEL: 2180 + case SDEV_CREATED_BLOCK: 2196 2181 break; 2197 2182 default: 2198 2183 goto illegal;
+134 -5
drivers/scsi/storvsc_drv.c
··· 326 326 */ 327 327 static int storvsc_timeout = 180; 328 328 329 - #define STORVSC_MAX_IO_REQUESTS 128 329 + #define STORVSC_MAX_IO_REQUESTS 200 330 + 331 + static void storvsc_on_channel_callback(void *context); 330 332 331 333 /* 332 334 * In Hyper-V, each port/path/target maps to 1 scsi host adapter. In ··· 366 364 367 365 bool destroy; 368 366 bool drain_notify; 367 + bool open_sub_channel; 369 368 atomic_t num_outstanding_req; 370 369 struct Scsi_Host *host; 371 370 ··· 758 755 return total_copied; 759 756 } 760 757 758 + static void handle_sc_creation(struct vmbus_channel *new_sc) 759 + { 760 + struct hv_device *device = new_sc->primary_channel->device_obj; 761 + struct storvsc_device *stor_device; 762 + struct vmstorage_channel_properties props; 763 + 764 + stor_device = get_out_stor_device(device); 765 + if (!stor_device) 766 + return; 767 + 768 + if (stor_device->open_sub_channel == false) 769 + return; 770 + 771 + memset(&props, 0, sizeof(struct vmstorage_channel_properties)); 772 + 773 + vmbus_open(new_sc, 774 + storvsc_ringbuffer_size, 775 + storvsc_ringbuffer_size, 776 + (void *)&props, 777 + sizeof(struct vmstorage_channel_properties), 778 + storvsc_on_channel_callback, new_sc); 779 + } 780 + 781 + static void handle_multichannel_storage(struct hv_device *device, int max_chns) 782 + { 783 + struct storvsc_device *stor_device; 784 + int num_cpus = num_online_cpus(); 785 + int num_sc; 786 + struct storvsc_cmd_request *request; 787 + struct vstor_packet *vstor_packet; 788 + int ret, t; 789 + 790 + num_sc = ((max_chns > num_cpus) ? num_cpus : max_chns); 791 + stor_device = get_out_stor_device(device); 792 + if (!stor_device) 793 + return; 794 + 795 + request = &stor_device->init_request; 796 + vstor_packet = &request->vstor_packet; 797 + 798 + stor_device->open_sub_channel = true; 799 + /* 800 + * Establish a handler for dealing with subchannels. 801 + */ 802 + vmbus_set_sc_create_callback(device->channel, handle_sc_creation); 803 + 804 + /* 805 + * Check to see if sub-channels have already been created. This 806 + * can happen when this driver is re-loaded after unloading. 807 + */ 808 + 809 + if (vmbus_are_subchannels_present(device->channel)) 810 + return; 811 + 812 + stor_device->open_sub_channel = false; 813 + /* 814 + * Request the host to create sub-channels. 815 + */ 816 + memset(request, 0, sizeof(struct storvsc_cmd_request)); 817 + init_completion(&request->wait_event); 818 + vstor_packet->operation = VSTOR_OPERATION_CREATE_SUB_CHANNELS; 819 + vstor_packet->flags = REQUEST_COMPLETION_FLAG; 820 + vstor_packet->sub_channel_count = num_sc; 821 + 822 + ret = vmbus_sendpacket(device->channel, vstor_packet, 823 + (sizeof(struct vstor_packet) - 824 + vmscsi_size_delta), 825 + (unsigned long)request, 826 + VM_PKT_DATA_INBAND, 827 + VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED); 828 + 829 + if (ret != 0) 830 + return; 831 + 832 + t = wait_for_completion_timeout(&request->wait_event, 10*HZ); 833 + if (t == 0) 834 + return; 835 + 836 + if (vstor_packet->operation != VSTOR_OPERATION_COMPLETE_IO || 837 + vstor_packet->status != 0) 838 + return; 839 + 840 + /* 841 + * Now that we created the sub-channels, invoke the check; this 842 + * may trigger the callback. 843 + */ 844 + stor_device->open_sub_channel = true; 845 + vmbus_are_subchannels_present(device->channel); 846 + } 847 + 761 848 static int storvsc_channel_init(struct hv_device *device) 762 849 { 763 850 struct storvsc_device *stor_device; 764 851 struct storvsc_cmd_request *request; 765 852 struct vstor_packet *vstor_packet; 766 853 int ret, t; 854 + int max_chns; 855 + bool process_sub_channels = false; 767 856 768 857 stor_device = get_out_stor_device(device); 769 858 if (!stor_device) ··· 950 855 vstor_packet->status != 0) 951 856 goto cleanup; 952 857 858 + /* 859 + * Check to see if multi-channel support is there. 860 + * Hosts that implement protocol version of 5.1 and above 861 + * support multi-channel. 862 + */ 863 + max_chns = vstor_packet->storage_channel_properties.max_channel_cnt; 864 + if ((vmbus_proto_version != VERSION_WIN7) && 865 + (vmbus_proto_version != VERSION_WS2008)) { 866 + if (vstor_packet->storage_channel_properties.flags & 867 + STORAGE_CHANNEL_SUPPORTS_MULTI_CHANNEL) 868 + process_sub_channels = true; 869 + } 870 + 953 871 memset(vstor_packet, 0, sizeof(struct vstor_packet)); 954 872 vstor_packet->operation = VSTOR_OPERATION_END_INITIALIZATION; 955 873 vstor_packet->flags = REQUEST_COMPLETION_FLAG; ··· 986 878 if (vstor_packet->operation != VSTOR_OPERATION_COMPLETE_IO || 987 879 vstor_packet->status != 0) 988 880 goto cleanup; 881 + 882 + if (process_sub_channels) 883 + handle_multichannel_storage(device, max_chns); 989 884 990 885 991 886 cleanup: ··· 1211 1100 1212 1101 static void storvsc_on_channel_callback(void *context) 1213 1102 { 1214 - struct hv_device *device = (struct hv_device *)context; 1103 + struct vmbus_channel *channel = (struct vmbus_channel *)context; 1104 + struct hv_device *device; 1215 1105 struct storvsc_device *stor_device; 1216 1106 u32 bytes_recvd; 1217 1107 u64 request_id; ··· 1220 1108 struct storvsc_cmd_request *request; 1221 1109 int ret; 1222 1110 1111 + if (channel->primary_channel != NULL) 1112 + device = channel->primary_channel->device_obj; 1113 + else 1114 + device = channel->device_obj; 1223 1115 1224 1116 stor_device = get_in_stor_device(device); 1225 1117 if (!stor_device) 1226 1118 return; 1227 1119 1228 1120 do { 1229 - ret = vmbus_recvpacket(device->channel, packet, 1121 + ret = vmbus_recvpacket(channel, packet, 1230 1122 ALIGN((sizeof(struct vstor_packet) - 1231 1123 vmscsi_size_delta), 8), 1232 1124 &bytes_recvd, &request_id); ··· 1271 1155 ring_size, 1272 1156 (void *)&props, 1273 1157 sizeof(struct vmstorage_channel_properties), 1274 - storvsc_on_channel_callback, device); 1158 + storvsc_on_channel_callback, device->channel); 1275 1159 1276 1160 if (ret != 0) 1277 1161 return ret; ··· 1323 1207 { 1324 1208 struct storvsc_device *stor_device; 1325 1209 struct vstor_packet *vstor_packet; 1210 + struct vmbus_channel *outgoing_channel; 1326 1211 int ret = 0; 1327 1212 1328 1213 vstor_packet = &request->vstor_packet; ··· 1334 1217 1335 1218 1336 1219 request->device = device; 1220 + /* 1221 + * Select an an appropriate channel to send the request out. 1222 + */ 1223 + 1224 + outgoing_channel = vmbus_get_outgoing_channel(device->channel); 1337 1225 1338 1226 1339 1227 vstor_packet->flags |= REQUEST_COMPLETION_FLAG; ··· 1356 1234 vstor_packet->operation = VSTOR_OPERATION_EXECUTE_SRB; 1357 1235 1358 1236 if (request->data_buffer.len) { 1359 - ret = vmbus_sendpacket_multipagebuffer(device->channel, 1237 + ret = vmbus_sendpacket_multipagebuffer(outgoing_channel, 1360 1238 &request->data_buffer, 1361 1239 vstor_packet, 1362 1240 (sizeof(struct vstor_packet) - ··· 1702 1580 enum { 1703 1581 SCSI_GUID, 1704 1582 IDE_GUID, 1583 + SFC_GUID, 1705 1584 }; 1706 1585 1707 1586 static const struct hv_vmbus_device_id id_table[] = { ··· 1713 1590 /* IDE guid */ 1714 1591 { HV_IDE_GUID, 1715 1592 .driver_data = IDE_GUID 1593 + }, 1594 + /* Fibre Channel GUID */ 1595 + { 1596 + HV_SYNTHFC_GUID, 1597 + .driver_data = SFC_GUID 1716 1598 }, 1717 1599 { }, 1718 1600 }; ··· 1771 1643 } 1772 1644 1773 1645 stor_device->destroy = false; 1646 + stor_device->open_sub_channel = false; 1774 1647 init_waitqueue_head(&stor_device->waiting_to_drain); 1775 1648 stor_device->device = device; 1776 1649 stor_device->host = host;