diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-22 10:47:24 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-22 10:47:24 -0800 |
commit | 2152f8536668a957ea3214735b4761e7b22ef7d8 (patch) | |
tree | 56723fc51445b1bc930c6400d4c00fd6fc831f88 /drivers/scsi | |
parent | 7cae7e26f245151b9ccad868bf2edf8c8048d307 (diff) | |
parent | 30afc84cf7325e88fb9746340eba3c161080ff49 (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (138 commits)
[SCSI] libata: implement minimal transport template for ->eh_timed_out
[SCSI] eliminate rphy allocation in favour of expander/end device allocation
[SCSI] convert mptsas over to end_device/expander allocations
[SCSI] allow displaying and setting of cache type via sysfs
[SCSI] add scsi_mode_select to scsi_lib.c
[SCSI] 3ware 9000 add big endian support
[SCSI] qla2xxx: update MAINTAINERS
[SCSI] scsi: move target_destroy call
[SCSI] fusion - bump version
[SCSI] fusion - expander hotplug suport in mptsas module
[SCSI] fusion - exposing raid components in mptsas
[SCSI] fusion - memory leak, and initializing fields
[SCSI] fusion - exclosure misspelled
[SCSI] fusion - cleanup mptsas event handling functions
[SCSI] fusion - removing target_id/bus_id from the VirtDevice structure
[SCSI] fusion - static fix's
[SCSI] fusion - move some debug firmware event debug msgs to verbose level
[SCSI] fusion - loginfo header update
[SCSI] add scsi_reprobe_device
[SCSI] megaraid_sas: fix extended timeout handling
...
Diffstat (limited to 'drivers/scsi')
104 files changed, 33690 insertions, 39858 deletions
diff --git a/drivers/scsi/3w-9xxx.c b/drivers/scsi/3w-9xxx.c index d9152d02088..0ab26d01877 100644 --- a/drivers/scsi/3w-9xxx.c +++ b/drivers/scsi/3w-9xxx.c @@ -2,8 +2,9 @@ 3w-9xxx.c -- 3ware 9000 Storage Controller device driver for Linux. Written By: Adam Radford <linuxraid@amcc.com> + Modifications By: Tom Couch <linuxraid@amcc.com> - Copyright (C) 2004-2005 Applied Micro Circuits Corporation. + Copyright (C) 2004-2006 Applied Micro Circuits Corporation. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -62,6 +63,8 @@ 2.26.02.003 - Correctly handle single sgl's with use_sg=1. 2.26.02.004 - Add support for 9550SX controllers. 2.26.02.005 - Fix use_sg == 0 mapping on systems with 4GB or higher. + 2.26.02.006 - Fix 9550SX pchip reset timeout. + Add big endian support. */ #include <linux/module.h> @@ -85,7 +88,7 @@ #include "3w-9xxx.h" /* Globals */ -#define TW_DRIVER_VERSION "2.26.02.005" +#define TW_DRIVER_VERSION "2.26.02.006" static TW_Device_Extension *twa_device_extension_list[TW_MAX_SLOT]; static unsigned int twa_device_extension_count; static int twa_major = -1; @@ -208,7 +211,7 @@ static int twa_aen_complete(TW_Device_Extension *tw_dev, int request_id) header = (TW_Command_Apache_Header *)tw_dev->generic_buffer_virt[request_id]; tw_dev->posted_request_count--; - aen = header->status_block.error; + aen = le16_to_cpu(header->status_block.error); full_command_packet = tw_dev->command_packet_virt[request_id]; command_packet = &full_command_packet->command.oldcommand; @@ -305,7 +308,7 @@ static int twa_aen_drain_queue(TW_Device_Extension *tw_dev, int no_check_reset) tw_dev->posted_request_count--; header = (TW_Command_Apache_Header *)tw_dev->generic_buffer_virt[request_id]; - aen = header->status_block.error; + aen = le16_to_cpu(header->status_block.error); queue = 0; count++; @@ -365,7 +368,7 @@ static void twa_aen_queue_event(TW_Device_Extension *tw_dev, TW_Command_Apache_H tw_dev->aen_clobber = 1; } - aen = header->status_block.error; + aen = le16_to_cpu(header->status_block.error); memset(event, 0, sizeof(TW_Event)); event->severity = TW_SEV_OUT(header->status_block.severity__reserved); @@ -382,7 +385,7 @@ static void twa_aen_queue_event(TW_Device_Extension *tw_dev, TW_Command_Apache_H header->err_specific_desc[sizeof(header->err_specific_desc) - 1] = '\0'; event->parameter_len = strlen(header->err_specific_desc); - memcpy(event->parameter_data, header->err_specific_desc, event->parameter_len); + memcpy(event->parameter_data, header->err_specific_desc, event->parameter_len + (error_str[0] == '\0' ? 0 : (1 + strlen(error_str)))); if (event->severity != TW_AEN_SEVERITY_DEBUG) printk(KERN_WARNING "3w-9xxx:%s AEN: %s (0x%02X:0x%04X): %s:%s.\n", host, @@ -462,24 +465,24 @@ static void twa_aen_sync_time(TW_Device_Extension *tw_dev, int request_id) command_packet = &full_command_packet->command.oldcommand; command_packet->opcode__sgloffset = TW_OPSGL_IN(2, TW_OP_SET_PARAM); command_packet->request_id = request_id; - command_packet->byte8_offset.param.sgl[0].address = tw_dev->generic_buffer_phys[request_id]; - command_packet->byte8_offset.param.sgl[0].length = TW_SECTOR_SIZE; + command_packet->byte8_offset.param.sgl[0].address = TW_CPU_TO_SGL(tw_dev->generic_buffer_phys[request_id]); + command_packet->byte8_offset.param.sgl[0].length = cpu_to_le32(TW_SECTOR_SIZE); command_packet->size = TW_COMMAND_SIZE; - command_packet->byte6_offset.parameter_count = 1; + command_packet->byte6_offset.parameter_count = cpu_to_le16(1); /* Setup the param */ param = (TW_Param_Apache *)tw_dev->generic_buffer_virt[request_id]; memset(param, 0, TW_SECTOR_SIZE); - param->table_id = TW_TIMEKEEP_TABLE | 0x8000; /* Controller time keep table */ - param->parameter_id = 0x3; /* SchedulerTime */ - param->parameter_size_bytes = 4; + param->table_id = cpu_to_le16(TW_TIMEKEEP_TABLE | 0x8000); /* Controller time keep table */ + param->parameter_id = cpu_to_le16(0x3); /* SchedulerTime */ + param->parameter_size_bytes = cpu_to_le16(4); /* Convert system time in UTC to local time seconds since last Sunday 12:00AM */ do_gettimeofday(&utc); local_time = (u32)(utc.tv_sec - (sys_tz.tz_minuteswest * 60)); schedulertime = local_time - (3 * 86400); - schedulertime = schedulertime % 604800; + schedulertime = cpu_to_le32(schedulertime % 604800); memcpy(param->data, &schedulertime, sizeof(u32)); @@ -931,26 +934,19 @@ out: /* This function will clear the pchip/response queue on 9550SX */ static int twa_empty_response_queue_large(TW_Device_Extension *tw_dev) { - u32 status_reg_value, response_que_value; - int count = 0, retval = 1; + u32 response_que_value = 0; + unsigned long before; + int retval = 1; if (tw_dev->tw_pci_dev->device == PCI_DEVICE_ID_3WARE_9550SX) { - status_reg_value = readl(TW_STATUS_REG_ADDR(tw_dev)); - - while (((status_reg_value & TW_STATUS_RESPONSE_QUEUE_EMPTY) == 0) && (count < TW_MAX_RESPONSE_DRAIN)) { + before = jiffies; + while ((response_que_value & TW_9550SX_DRAIN_COMPLETED) != TW_9550SX_DRAIN_COMPLETED) { response_que_value = readl(TW_RESPONSE_QUEUE_REG_ADDR_LARGE(tw_dev)); - if ((response_que_value & TW_9550SX_DRAIN_COMPLETED) == TW_9550SX_DRAIN_COMPLETED) { - /* P-chip settle time */ - msleep(500); - retval = 0; + if (time_after(jiffies, before + HZ * 30)) goto out; - } - status_reg_value = readl(TW_STATUS_REG_ADDR(tw_dev)); - count++; } - if (count == TW_MAX_RESPONSE_DRAIN) - goto out; - + /* P-chip settle time */ + msleep(500); retval = 0; } else retval = 0; @@ -972,7 +968,7 @@ static int twa_fill_sense(TW_Device_Extension *tw_dev, int request_id, int copy_ error_str = &(full_command_packet->header.err_specific_desc[strlen(full_command_packet->header.err_specific_desc) + 1]); /* Don't print error for Logical unit not supported during rollcall */ - error = full_command_packet->header.status_block.error; + error = le16_to_cpu(full_command_packet->header.status_block.error); if ((error != TW_ERROR_LOGICAL_UNIT_NOT_SUPPORTED) && (error != TW_ERROR_UNIT_OFFLINE)) { if (print_host) printk(KERN_WARNING "3w-9xxx: scsi%d: ERROR: (0x%02X:0x%04X): %s:%s.\n", @@ -1047,18 +1043,18 @@ static void *twa_get_param(TW_Device_Extension *tw_dev, int request_id, int tabl command_packet->opcode__sgloffset = TW_OPSGL_IN(2, TW_OP_GET_PARAM); command_packet->size = TW_COMMAND_SIZE; command_packet->request_id = request_id; - command_packet->byte6_offset.block_count = 1; + command_packet->byte6_offset.block_count = cpu_to_le16(1); /* Now setup the param */ param = (TW_Param_Apache *)tw_dev->generic_buffer_virt[request_id]; memset(param, 0, TW_SECTOR_SIZE); - param->table_id = table_id | 0x8000; - param->parameter_id = parameter_id; - param->parameter_size_bytes = parameter_size_bytes; + param->table_id = cpu_to_le16(table_id | 0x8000); + param->parameter_id = cpu_to_le16(parameter_id); + param->parameter_size_bytes = cpu_to_le16(parameter_size_bytes); param_value = tw_dev->generic_buffer_phys[request_id]; - command_packet->byte8_offset.param.sgl[0].address = param_value; - command_packet->byte8_offset.param.sgl[0].length = TW_SECTOR_SIZE; + command_packet->byte8_offset.param.sgl[0].address = TW_CPU_TO_SGL(param_value); + command_packet->byte8_offset.param.sgl[0].length = cpu_to_le32(TW_SECTOR_SIZE); /* Post the command packet to the board */ twa_post_command_packet(tw_dev, request_id, 1); @@ -1107,18 +1103,20 @@ static int twa_initconnection(TW_Device_Extension *tw_dev, int message_credits, tw_initconnect = (TW_Initconnect *)&full_command_packet->command.oldcommand; tw_initconnect->opcode__reserved = TW_OPRES_IN(0, TW_OP_INIT_CONNECTION); tw_initconnect->request_id = request_id; - tw_initconnect->message_credits = message_credits; + tw_initconnect->message_credits = cpu_to_le16(message_credits); tw_initconnect->features = set_features; /* Turn on 64-bit sgl support if we need to */ tw_initconnect->features |= sizeof(dma_addr_t) > 4 ? 1 : 0; + tw_initconnect->features = cpu_to_le32(tw_initconnect->features); + if (set_features & TW_EXTENDED_INIT_CONNECT) { tw_initconnect->size = TW_INIT_COMMAND_PACKET_SIZE_EXTENDED; - tw_initconnect->fw_srl = current_fw_srl; - tw_initconnect->fw_arch_id = current_fw_arch_id; - tw_initconnect->fw_branch = current_fw_branch; - tw_initconnect->fw_build = current_fw_build; + tw_initconnect->fw_srl = cpu_to_le16(current_fw_srl); + tw_initconnect->fw_arch_id = cpu_to_le16(current_fw_arch_id); + tw_initconnect->fw_branch = cpu_to_le16(current_fw_branch); + tw_initconnect->fw_build = cpu_to_le16 |