diff options
Diffstat (limited to 'drivers/message')
| -rw-r--r-- | drivers/message/i2o/Kconfig | 22 | ||||
| -rw-r--r-- | drivers/message/i2o/debug.c | 134 | ||||
| -rw-r--r-- | drivers/message/i2o/device.c | 16 | ||||
| -rw-r--r-- | drivers/message/i2o/exec-osm.c | 10 | ||||
| -rw-r--r-- | drivers/message/i2o/i2o_block.c | 2 | ||||
| -rw-r--r-- | drivers/message/i2o/i2o_config.c | 62 | ||||
| -rw-r--r-- | drivers/message/i2o/iop.c | 2 |
7 files changed, 130 insertions, 118 deletions
diff --git a/drivers/message/i2o/Kconfig b/drivers/message/i2o/Kconfig index f4ac21e5771e..5afa0e393ecf 100644 --- a/drivers/message/i2o/Kconfig +++ b/drivers/message/i2o/Kconfig | |||
| @@ -1,9 +1,6 @@ | |||
| 1 | 1 | ||
| 2 | menu "I2O device support" | 2 | menuconfig I2O |
| 3 | depends on PCI | 3 | tristate "I2O device support" |
| 4 | |||
| 5 | config I2O | ||
| 6 | tristate "I2O support" | ||
| 7 | depends on PCI | 4 | depends on PCI |
| 8 | ---help--- | 5 | ---help--- |
| 9 | The Intelligent Input/Output (I2O) architecture allows hardware | 6 | The Intelligent Input/Output (I2O) architecture allows hardware |
| @@ -25,9 +22,10 @@ config I2O | |||
| 25 | 22 | ||
| 26 | If unsure, say N. | 23 | If unsure, say N. |
| 27 | 24 | ||
| 25 | if I2O | ||
| 26 | |||
| 28 | config I2O_LCT_NOTIFY_ON_CHANGES | 27 | config I2O_LCT_NOTIFY_ON_CHANGES |
| 29 | bool "Enable LCT notification" | 28 | bool "Enable LCT notification" |
| 30 | depends on I2O | ||
| 31 | default y | 29 | default y |
| 32 | ---help--- | 30 | ---help--- |
| 33 | Only say N here if you have a I2O controller from SUN. The SUN | 31 | Only say N here if you have a I2O controller from SUN. The SUN |
| @@ -39,7 +37,6 @@ config I2O_LCT_NOTIFY_ON_CHANGES | |||
| 39 | 37 | ||
| 40 | config I2O_EXT_ADAPTEC | 38 | config I2O_EXT_ADAPTEC |
| 41 | bool "Enable Adaptec extensions" | 39 | bool "Enable Adaptec extensions" |
| 42 | depends on I2O | ||
| 43 | default y | 40 | default y |
| 44 | ---help--- | 41 | ---help--- |
| 45 | Say Y for support of raidutils for Adaptec I2O controllers. You also | 42 | Say Y for support of raidutils for Adaptec I2O controllers. You also |
| @@ -57,7 +54,7 @@ config I2O_EXT_ADAPTEC_DMA64 | |||
| 57 | 54 | ||
| 58 | config I2O_CONFIG | 55 | config I2O_CONFIG |
| 59 | tristate "I2O Configuration support" | 56 | tristate "I2O Configuration support" |
| 60 | depends on I2O | 57 | depends on VIRT_TO_BUS |
| 61 | ---help--- | 58 | ---help--- |
| 62 | Say Y for support of the configuration interface for the I2O adapters. | 59 | Say Y for support of the configuration interface for the I2O adapters. |
| 63 | If you have a RAID controller from Adaptec and you want to use the | 60 | If you have a RAID controller from Adaptec and you want to use the |
| @@ -78,7 +75,6 @@ config I2O_CONFIG_OLD_IOCTL | |||
| 78 | 75 | ||
| 79 | config I2O_BUS | 76 | config I2O_BUS |
| 80 | tristate "I2O Bus Adapter OSM" | 77 | tristate "I2O Bus Adapter OSM" |
| 81 | depends on I2O | ||
| 82 | ---help--- | 78 | ---help--- |
| 83 | Include support for the I2O Bus Adapter OSM. The Bus Adapter OSM | 79 | Include support for the I2O Bus Adapter OSM. The Bus Adapter OSM |
| 84 | provides access to the busses on the I2O controller. The main purpose | 80 | provides access to the busses on the I2O controller. The main purpose |
| @@ -89,7 +85,7 @@ config I2O_BUS | |||
| 89 | 85 | ||
| 90 | config I2O_BLOCK | 86 | config I2O_BLOCK |
| 91 | tristate "I2O Block OSM" | 87 | tristate "I2O Block OSM" |
| 92 | depends on I2O && BLOCK | 88 | depends on BLOCK |
| 93 | ---help--- | 89 | ---help--- |
| 94 | Include support for the I2O Block OSM. The Block OSM presents disk | 90 | Include support for the I2O Block OSM. The Block OSM presents disk |
| 95 | and other structured block devices to the operating system. If you | 91 | and other structured block devices to the operating system. If you |
| @@ -102,7 +98,7 @@ config I2O_BLOCK | |||
| 102 | 98 | ||
| 103 | config I2O_SCSI | 99 | config I2O_SCSI |
| 104 | tristate "I2O SCSI OSM" | 100 | tristate "I2O SCSI OSM" |
| 105 | depends on I2O && SCSI | 101 | depends on SCSI |
| 106 | ---help--- | 102 | ---help--- |
| 107 | Allows direct SCSI access to SCSI devices on a SCSI or FibreChannel | 103 | Allows direct SCSI access to SCSI devices on a SCSI or FibreChannel |
| 108 | I2O controller. You can use both the SCSI and Block OSM together if | 104 | I2O controller. You can use both the SCSI and Block OSM together if |
| @@ -114,7 +110,6 @@ config I2O_SCSI | |||
| 114 | 110 | ||
| 115 | config I2O_PROC | 111 | config I2O_PROC |
| 116 | tristate "I2O /proc support" | 112 | tristate "I2O /proc support" |
| 117 | depends on I2O | ||
| 118 | ---help--- | 113 | ---help--- |
| 119 | If you say Y here and to "/proc file system support", you will be | 114 | If you say Y here and to "/proc file system support", you will be |
| 120 | able to read I2O related information from the virtual directory | 115 | able to read I2O related information from the virtual directory |
| @@ -123,5 +118,4 @@ config I2O_PROC | |||
| 123 | To compile this support as a module, choose M here: the | 118 | To compile this support as a module, choose M here: the |
| 124 | module will be called i2o_proc. | 119 | module will be called i2o_proc. |
| 125 | 120 | ||
| 126 | endmenu | 121 | endif # I2O |
| 127 | |||
diff --git a/drivers/message/i2o/debug.c b/drivers/message/i2o/debug.c index 8abe45e49ad7..ce62d8bfe1c8 100644 --- a/drivers/message/i2o/debug.c +++ b/drivers/message/i2o/debug.c | |||
| @@ -24,7 +24,7 @@ void i2o_report_status(const char *severity, const char *str, | |||
| 24 | if (cmd == I2O_CMD_UTIL_EVT_REGISTER) | 24 | if (cmd == I2O_CMD_UTIL_EVT_REGISTER) |
| 25 | return; // No status in this reply | 25 | return; // No status in this reply |
| 26 | 26 | ||
| 27 | printk(KERN_DEBUG "%s%s: ", severity, str); | 27 | printk("%s%s: ", severity, str); |
| 28 | 28 | ||
| 29 | if (cmd < 0x1F) // Utility cmd | 29 | if (cmd < 0x1F) // Utility cmd |
| 30 | i2o_report_util_cmd(cmd); | 30 | i2o_report_util_cmd(cmd); |
| @@ -32,7 +32,7 @@ void i2o_report_status(const char *severity, const char *str, | |||
| 32 | else if (cmd >= 0xA0 && cmd <= 0xEF) // Executive cmd | 32 | else if (cmd >= 0xA0 && cmd <= 0xEF) // Executive cmd |
| 33 | i2o_report_exec_cmd(cmd); | 33 | i2o_report_exec_cmd(cmd); |
| 34 | else | 34 | else |
| 35 | printk(KERN_DEBUG "Cmd = %0#2x, ", cmd); // Other cmds | 35 | printk("Cmd = %0#2x, ", cmd); // Other cmds |
| 36 | 36 | ||
| 37 | if (msg[0] & MSG_FAIL) { | 37 | if (msg[0] & MSG_FAIL) { |
| 38 | i2o_report_fail_status(req_status, msg); | 38 | i2o_report_fail_status(req_status, msg); |
| @@ -44,7 +44,7 @@ void i2o_report_status(const char *severity, const char *str, | |||
| 44 | if (cmd < 0x1F || (cmd >= 0xA0 && cmd <= 0xEF)) | 44 | if (cmd < 0x1F || (cmd >= 0xA0 && cmd <= 0xEF)) |
| 45 | i2o_report_common_dsc(detailed_status); | 45 | i2o_report_common_dsc(detailed_status); |
| 46 | else | 46 | else |
| 47 | printk(KERN_DEBUG " / DetailedStatus = %0#4x.\n", | 47 | printk(" / DetailedStatus = %0#4x.\n", |
| 48 | detailed_status); | 48 | detailed_status); |
| 49 | } | 49 | } |
| 50 | 50 | ||
| @@ -89,10 +89,10 @@ static void i2o_report_fail_status(u8 req_status, u32 * msg) | |||
| 89 | }; | 89 | }; |
| 90 | 90 | ||
| 91 | if (req_status == I2O_FSC_TRANSPORT_UNKNOWN_FAILURE) | 91 | if (req_status == I2O_FSC_TRANSPORT_UNKNOWN_FAILURE) |
| 92 | printk(KERN_DEBUG "TRANSPORT_UNKNOWN_FAILURE (%0#2x).\n", | 92 | printk("TRANSPORT_UNKNOWN_FAILURE (%0#2x).\n", |
| 93 | req_status); | 93 | req_status); |
| 94 | else | 94 | else |
| 95 | printk(KERN_DEBUG "TRANSPORT_%s.\n", | 95 | printk("TRANSPORT_%s.\n", |
| 96 | FAIL_STATUS[req_status & 0x0F]); | 96 | FAIL_STATUS[req_status & 0x0F]); |
| 97 | 97 | ||
| 98 | /* Dump some details */ | 98 | /* Dump some details */ |
| @@ -104,7 +104,7 @@ static void i2o_report_fail_status(u8 req_status, u32 * msg) | |||
| 104 | printk(KERN_ERR " FailingHostUnit = 0x%04X, FailingIOP = 0x%03X\n", | 104 | printk(KERN_ERR " FailingHostUnit = 0x%04X, FailingIOP = 0x%03X\n", |
| 105 | msg[5] >> 16, msg[5] & 0xFFF); | 105 | msg[5] >> 16, msg[5] & 0xFFF); |
| 106 | 106 | ||
| 107 | printk(KERN_ERR " Severity: 0x%02X ", (msg[4] >> 16) & 0xFF); | 107 | printk(KERN_ERR " Severity: 0x%02X\n", (msg[4] >> 16) & 0xFF); |
| 108 | if (msg[4] & (1 << 16)) | 108 | if (msg[4] & (1 << 16)) |
| 109 | printk(KERN_DEBUG "(FormatError), " | 109 | printk(KERN_DEBUG "(FormatError), " |
| 110 | "this msg can never be delivered/processed.\n"); | 110 | "this msg can never be delivered/processed.\n"); |
| @@ -142,9 +142,9 @@ static void i2o_report_common_status(u8 req_status) | |||
| 142 | }; | 142 | }; |
| 143 | 143 | ||
| 144 | if (req_status >= ARRAY_SIZE(REPLY_STATUS)) | 144 | if (req_status >= ARRAY_SIZE(REPLY_STATUS)) |
| 145 | printk(KERN_DEBUG "RequestStatus = %0#2x", req_status); | 145 | printk("RequestStatus = %0#2x", req_status); |
| 146 | else | 146 | else |
| 147 | printk(KERN_DEBUG "%s", REPLY_STATUS[req_status]); | 147 | printk("%s", REPLY_STATUS[req_status]); |
| 148 | } | 148 | } |
| 149 | 149 | ||
| 150 | /* | 150 | /* |
| @@ -187,10 +187,10 @@ static void i2o_report_common_dsc(u16 detailed_status) | |||
| 187 | }; | 187 | }; |
| 188 | 188 | ||
| 189 | if (detailed_status > I2O_DSC_DEVICE_NOT_AVAILABLE) | 189 | if (detailed_status > I2O_DSC_DEVICE_NOT_AVAILABLE) |
| 190 | printk(KERN_DEBUG " / DetailedStatus = %0#4x.\n", | 190 | printk(" / DetailedStatus = %0#4x.\n", |
| 191 | detailed_status); | 191 | detailed_status); |
| 192 | else | 192 | else |
| 193 | printk(KERN_DEBUG " / %s.\n", COMMON_DSC[detailed_status]); | 193 | printk(" / %s.\n", COMMON_DSC[detailed_status]); |
| 194 | } | 194 | } |
| 195 | 195 | ||
| 196 | /* | 196 | /* |
| @@ -200,49 +200,49 @@ static void i2o_report_util_cmd(u8 cmd) | |||
| 200 | { | 200 | { |
| 201 | switch (cmd) { | 201 | switch (cmd) { |
| 202 | case I2O_CMD_UTIL_NOP: | 202 | case I2O_CMD_UTIL_NOP: |
| 203 | printk(KERN_DEBUG "UTIL_NOP, "); | 203 | printk("UTIL_NOP, "); |
| 204 | break; | 204 | break; |
| 205 | case I2O_CMD_UTIL_ABORT: | 205 | case I2O_CMD_UTIL_ABORT: |
| 206 | printk(KERN_DEBUG "UTIL_ABORT, "); | 206 | printk("UTIL_ABORT, "); |
| 207 | break; | 207 | break; |
| 208 | case I2O_CMD_UTIL_CLAIM: | 208 | case I2O_CMD_UTIL_CLAIM: |
| 209 | printk(KERN_DEBUG "UTIL_CLAIM, "); | 209 | printk("UTIL_CLAIM, "); |
| 210 | break; | 210 | break; |
| 211 | case I2O_CMD_UTIL_RELEASE: | 211 | case I2O_CMD_UTIL_RELEASE: |
| 212 | printk(KERN_DEBUG "UTIL_CLAIM_RELEASE, "); | 212 | printk("UTIL_CLAIM_RELEASE, "); |
| 213 | break; | 213 | break; |
| 214 | case I2O_CMD_UTIL_CONFIG_DIALOG: | 214 | case I2O_CMD_UTIL_CONFIG_DIALOG: |
| 215 | printk(KERN_DEBUG "UTIL_CONFIG_DIALOG, "); | 215 | printk("UTIL_CONFIG_DIALOG, "); |
| 216 | break; | 216 | break; |
| 217 | case I2O_CMD_UTIL_DEVICE_RESERVE: | 217 | case I2O_CMD_UTIL_DEVICE_RESERVE: |
| 218 | printk(KERN_DEBUG "UTIL_DEVICE_RESERVE, "); | 218 | printk("UTIL_DEVICE_RESERVE, "); |
| 219 | break; | 219 | break; |
| 220 | case I2O_CMD_UTIL_DEVICE_RELEASE: | 220 | case I2O_CMD_UTIL_DEVICE_RELEASE: |
| 221 | printk(KERN_DEBUG "UTIL_DEVICE_RELEASE, "); | 221 | printk("UTIL_DEVICE_RELEASE, "); |
| 222 | break; | 222 | break; |
| 223 | case I2O_CMD_UTIL_EVT_ACK: | 223 | case I2O_CMD_UTIL_EVT_ACK: |
| 224 | printk(KERN_DEBUG "UTIL_EVENT_ACKNOWLEDGE, "); | 224 | printk("UTIL_EVENT_ACKNOWLEDGE, "); |
| 225 | break; | 225 | break; |
| 226 | case I2O_CMD_UTIL_EVT_REGISTER: | 226 | case I2O_CMD_UTIL_EVT_REGISTER: |
| 227 | printk(KERN_DEBUG "UTIL_EVENT_REGISTER, "); | 227 | printk("UTIL_EVENT_REGISTER, "); |
| 228 | break; | 228 | break; |
| 229 | case I2O_CMD_UTIL_LOCK: | 229 | case I2O_CMD_UTIL_LOCK: |
| 230 | printk(KERN_DEBUG "UTIL_LOCK, "); | 230 | printk("UTIL_LOCK, "); |
| 231 | break; | 231 | break; |
| 232 | case I2O_CMD_UTIL_LOCK_RELEASE: | 232 | case I2O_CMD_UTIL_LOCK_RELEASE: |
| 233 | printk(KERN_DEBUG "UTIL_LOCK_RELEASE, "); | 233 | printk("UTIL_LOCK_RELEASE, "); |
| 234 | break; | 234 | break; |
| 235 | case I2O_CMD_UTIL_PARAMS_GET: | 235 | case I2O_CMD_UTIL_PARAMS_GET: |
| 236 | printk(KERN_DEBUG "UTIL_PARAMS_GET, "); | 236 | printk("UTIL_PARAMS_GET, "); |
| 237 | break; | 237 | break; |
| 238 | case I2O_CMD_UTIL_PARAMS_SET: | 238 | case I2O_CMD_UTIL_PARAMS_SET: |
| 239 | printk(KERN_DEBUG "UTIL_PARAMS_SET, "); | 239 | printk("UTIL_PARAMS_SET, "); |
| 240 | break; | 240 | break; |
| 241 | case I2O_CMD_UTIL_REPLY_FAULT_NOTIFY: | 241 | case I2O_CMD_UTIL_REPLY_FAULT_NOTIFY: |
| 242 | printk(KERN_DEBUG "UTIL_REPLY_FAULT_NOTIFY, "); | 242 | printk("UTIL_REPLY_FAULT_NOTIFY, "); |
| 243 | break; | 243 | break; |
| 244 | default: | 244 | default: |
| 245 | printk(KERN_DEBUG "Cmd = %0#2x, ", cmd); | 245 | printk("Cmd = %0#2x, ", cmd); |
| 246 | } | 246 | } |
| 247 | } | 247 | } |
| 248 | 248 | ||
| @@ -253,106 +253,106 @@ static void i2o_report_exec_cmd(u8 cmd) | |||
| 253 | { | 253 | { |
| 254 | switch (cmd) { | 254 | switch (cmd) { |
| 255 | case I2O_CMD_ADAPTER_ASSIGN: | 255 | case I2O_CMD_ADAPTER_ASSIGN: |
| 256 | printk(KERN_DEBUG "EXEC_ADAPTER_ASSIGN, "); | 256 | printk("EXEC_ADAPTER_ASSIGN, "); |
| 257 | break; | 257 | break; |
| 258 | case I2O_CMD_ADAPTER_READ: | 258 | case I2O_CMD_ADAPTER_READ: |
| 259 | printk(KERN_DEBUG "EXEC_ADAPTER_READ, "); | 259 | printk("EXEC_ADAPTER_READ, "); |
| 260 | break; | 260 | break; |
| 261 | case I2O_CMD_ADAPTER_RELEASE: | 261 | case I2O_CMD_ADAPTER_RELEASE: |
| 262 | printk(KERN_DEBUG "EXEC_ADAPTER_RELEASE, "); | 262 | printk("EXEC_ADAPTER_RELEASE, "); |
| 263 | break; | 263 | break; |
| 264 | case I2O_CMD_BIOS_INFO_SET: | 264 | case I2O_CMD_BIOS_INFO_SET: |
| 265 | printk(KERN_DEBUG "EXEC_BIOS_INFO_SET, "); | 265 | printk("EXEC_BIOS_INFO_SET, "); |
| 266 | break; | 266 | break; |
| 267 | case I2O_CMD_BOOT_DEVICE_SET: | 267 | case I2O_CMD_BOOT_DEVICE_SET: |
| 268 | printk(KERN_DEBUG "EXEC_BOOT_DEVICE_SET, "); | 268 | printk("EXEC_BOOT_DEVICE_SET, "); |
| 269 | break; | 269 | break; |
| 270 | case I2O_CMD_CONFIG_VALIDATE: | 270 | case I2O_CMD_CONFIG_VALIDATE: |
| 271 | printk(KERN_DEBUG "EXEC_CONFIG_VALIDATE, "); | 271 | printk("EXEC_CONFIG_VALIDATE, "); |
| 272 | break; | 272 | break; |
| 273 | case I2O_CMD_CONN_SETUP: | 273 | case I2O_CMD_CONN_SETUP: |
| 274 | printk(KERN_DEBUG "EXEC_CONN_SETUP, "); | 274 | printk("EXEC_CONN_SETUP, "); |
| 275 | break; | 275 | break; |
| 276 | case I2O_CMD_DDM_DESTROY: | 276 | case I2O_CMD_DDM_DESTROY: |
| 277 | printk(KERN_DEBUG "EXEC_DDM_DESTROY, "); | 277 | printk("EXEC_DDM_DESTROY, "); |
| 278 | break; | 278 | break; |
| 279 | case I2O_CMD_DDM_ENABLE: | 279 | case I2O_CMD_DDM_ENABLE: |
| 280 | printk(KERN_DEBUG "EXEC_DDM_ENABLE, "); | 280 | printk("EXEC_DDM_ENABLE, "); |
| 281 | break; | 281 | break; |
| 282 | case I2O_CMD_DDM_QUIESCE: | 282 | case I2O_CMD_DDM_QUIESCE: |
| 283 | printk(KERN_DEBUG "EXEC_DDM_QUIESCE, "); | 283 | printk("EXEC_DDM_QUIESCE, "); |
| 284 | break; | 284 | break; |
| 285 | case I2O_CMD_DDM_RESET: | 285 | case I2O_CMD_DDM_RESET: |
| 286 | printk(KERN_DEBUG "EXEC_DDM_RESET, "); | 286 | printk("EXEC_DDM_RESET, "); |
| 287 | break; | 287 | break; |
| 288 | case I2O_CMD_DDM_SUSPEND: | 288 | case I2O_CMD_DDM_SUSPEND: |
| 289 | printk(KERN_DEBUG "EXEC_DDM_SUSPEND, "); | 289 | printk("EXEC_DDM_SUSPEND, "); |
| 290 | break; | 290 | break; |
| 291 | case I2O_CMD_DEVICE_ASSIGN: | 291 | case I2O_CMD_DEVICE_ASSIGN: |
| 292 | printk(KERN_DEBUG "EXEC_DEVICE_ASSIGN, "); | 292 | printk("EXEC_DEVICE_ASSIGN, "); |
| 293 | break; | 293 | break; |
| 294 | case I2O_CMD_DEVICE_RELEASE: | 294 | case I2O_CMD_DEVICE_RELEASE: |
| 295 | printk(KERN_DEBUG "EXEC_DEVICE_RELEASE, "); | 295 | printk("EXEC_DEVICE_RELEASE, "); |
| 296 | break; | 296 | break; |
| 297 | case I2O_CMD_HRT_GET: | 297 | case I2O_CMD_HRT_GET: |
| 298 | printk(KERN_DEBUG "EXEC_HRT_GET, "); | 298 | printk("EXEC_HRT_GET, "); |
| 299 | break; | 299 | break; |
| 300 | case I2O_CMD_ADAPTER_CLEAR: | 300 | case I2O_CMD_ADAPTER_CLEAR: |
| 301 | printk(KERN_DEBUG "EXEC_IOP_CLEAR, "); | 301 | printk("EXEC_IOP_CLEAR, "); |
| 302 | break; | 302 | break; |
| 303 | case I2O_CMD_ADAPTER_CONNECT: | 303 | case I2O_CMD_ADAPTER_CONNECT: |
| 304 | printk(KERN_DEBUG "EXEC_IOP_CONNECT, "); | 304 | printk("EXEC_IOP_CONNECT, "); |
| 305 | break; | 305 | break; |
| 306 | case I2O_CMD_ADAPTER_RESET: | 306 | case I2O_CMD_ADAPTER_RESET: |
| 307 | printk(KERN_DEBUG "EXEC_IOP_RESET, "); | 307 | printk("EXEC_IOP_RESET, "); |
| 308 | break; | 308 | break; |
| 309 | case I2O_CMD_LCT_NOTIFY: | 309 | case I2O_CMD_LCT_NOTIFY: |
| 310 | printk(KERN_DEBUG "EXEC_LCT_NOTIFY, "); | 310 | printk("EXEC_LCT_NOTIFY, "); |
| 311 | break; | 311 | break; |
| 312 | case I2O_CMD_OUTBOUND_INIT: | 312 | case I2O_CMD_OUTBOUND_INIT: |
| 313 | printk(KERN_DEBUG "EXEC_OUTBOUND_INIT, "); | 313 | printk("EXEC_OUTBOUND_INIT, "); |
| 314 | break; | 314 | break; |
| 315 | case I2O_CMD_PATH_ENABLE: | 315 | case I2O_CMD_PATH_ENABLE: |
| 316 | printk(KERN_DEBUG "EXEC_PATH_ENABLE, "); | 316 | printk("EXEC_PATH_ENABLE, "); |
| 317 | break; | 317 | break; |
| 318 | case I2O_CMD_PATH_QUIESCE: | 318 | case I2O_CMD_PATH_QUIESCE: |
| 319 | printk(KERN_DEBUG "EXEC_PATH_QUIESCE, "); | 319 | printk("EXEC_PATH_QUIESCE, "); |
| 320 | break; | 320 | break; |
| 321 | case I2O_CMD_PATH_RESET: | 321 | case I2O_CMD_PATH_RESET: |
| 322 | printk(KERN_DEBUG "EXEC_PATH_RESET, "); | 322 | printk("EXEC_PATH_RESET, "); |
| 323 | break; | 323 | break; |
| 324 | case I2O_CMD_STATIC_MF_CREATE: | 324 | case I2O_CMD_STATIC_MF_CREATE: |
| 325 | printk(KERN_DEBUG "EXEC_STATIC_MF_CREATE, "); | 325 | printk("EXEC_STATIC_MF_CREATE, "); |
| 326 | break; | 326 | break; |
| 327 | case I2O_CMD_STATIC_MF_RELEASE: | 327 | case I2O_CMD_STATIC_MF_RELEASE: |
| 328 | printk(KERN_DEBUG "EXEC_STATIC_MF_RELEASE, "); | 328 | printk("EXEC_STATIC_MF_RELEASE, "); |
| 329 | break; | 329 | break; |
| 330 | case I2O_CMD_STATUS_GET: | 330 | case I2O_CMD_STATUS_GET: |
| 331 | printk(KERN_DEBUG "EXEC_STATUS_GET, "); | 331 | printk("EXEC_STATUS_GET, "); |
| 332 | break; | 332 | break; |
| 333 | case I2O_CMD_SW_DOWNLOAD: | 333 | case I2O_CMD_SW_DOWNLOAD: |
| 334 | printk(KERN_DEBUG "EXEC_SW_DOWNLOAD, "); | 334 | printk("EXEC_SW_DOWNLOAD, "); |
| 335 | break; | 335 | break; |
| 336 | case I2O_CMD_SW_UPLOAD: | 336 | case I2O_CMD_SW_UPLOAD: |
| 337 | printk(KERN_DEBUG "EXEC_SW_UPLOAD, "); | 337 | printk("EXEC_SW_UPLOAD, "); |
| 338 | break; | 338 | break; |
| 339 | case I2O_CMD_SW_REMOVE: | 339 | case I2O_CMD_SW_REMOVE: |
| 340 | printk(KERN_DEBUG "EXEC_SW_REMOVE, "); | 340 | printk("EXEC_SW_REMOVE, "); |
| 341 | break; | 341 | break; |
| 342 | case I2O_CMD_SYS_ENABLE: | 342 | case I2O_CMD_SYS_ENABLE: |
| 343 | printk(KERN_DEBUG "EXEC_SYS_ENABLE, "); | 343 | printk("EXEC_SYS_ENABLE, "); |
| 344 | break; | 344 | break; |
| 345 | case I2O_CMD_SYS_MODIFY: | 345 | case I2O_CMD_SYS_MODIFY: |
| 346 | printk(KERN_DEBUG "EXEC_SYS_MODIFY, "); | 346 | printk("EXEC_SYS_MODIFY, "); |
| 347 | break; | 347 | break; |
| 348 | case I2O_CMD_SYS_QUIESCE: | 348 | case I2O_CMD_SYS_QUIESCE: |
| 349 | printk(KERN_DEBUG "EXEC_SYS_QUIESCE, "); | 349 | printk("EXEC_SYS_QUIESCE, "); |
| 350 | break; | 350 | break; |
| 351 | case I2O_CMD_SYS_TAB_SET: | 351 | case I2O_CMD_SYS_TAB_SET: |
| 352 | printk(KERN_DEBUG "EXEC_SYS_TAB_SET, "); | 352 | printk("EXEC_SYS_TAB_SET, "); |
| 353 | break; | 353 | break; |
| 354 | default: | 354 | default: |
| 355 | printk(KERN_DEBUG "Cmd = %#02x, ", cmd); | 355 | printk("Cmd = %#02x, ", cmd); |
| 356 | } | 356 | } |
| 357 | } | 357 | } |
| 358 | 358 | ||
| @@ -361,28 +361,28 @@ void i2o_debug_state(struct i2o_controller *c) | |||
| 361 | printk(KERN_INFO "%s: State = ", c->name); | 361 | printk(KERN_INFO "%s: State = ", c->name); |
| 362 | switch (((i2o_status_block *) c->status_block.virt)->iop_state) { | 362 | switch (((i2o_status_block *) c->status_block.virt)->iop_state) { |
| 363 | case 0x01: | 363 | case 0x01: |
| 364 | printk(KERN_DEBUG "INIT\n"); | 364 | printk("INIT\n"); |
| 365 | break; | 365 | break; |
| 366 | case 0x02: | 366 | case 0x02: |
| 367 | printk(KERN_DEBUG "RESET\n"); | 367 | printk("RESET\n"); |
| 368 | break; | 368 | break; |
| 369 | case 0x04: | 369 | case 0x04: |
| 370 | printk(KERN_DEBUG "HOLD\n"); | 370 | printk("HOLD\n"); |
| 371 | break; | 371 | break; |
| 372 | case 0x05: | 372 | case 0x05: |
| 373 | printk(KERN_DEBUG "READY\n"); | 373 | printk("READY\n"); |
| 374 | break; | 374 | break; |
| 375 | case 0x08: | 375 | case 0x08: |
| 376 | printk(KERN_DEBUG "OPERATIONAL\n"); | 376 | printk("OPERATIONAL\n"); |
| 377 | break; | 377 | break; |
| 378 | case 0x10: | 378 | case 0x10: |
| 379 | printk(KERN_DEBUG "FAILED\n"); | 379 | printk("FAILED\n"); |
| 380 | break; | 380 | break; |
| 381 | case 0x11: | 381 | case 0x11: |
| 382 | printk(KERN_DEBUG "FAULTED\n"); | 382 | printk("FAULTED\n"); |
| 383 | break; | 383 | break; |
| 384 | default: | 384 | default: |
| 385 | printk(KERN_DEBUG "%x (unknown !!)\n", | 385 | printk("%x (unknown !!)\n", |
| 386 | ((i2o_status_block *) c->status_block.virt)->iop_state); | 386 | ((i2o_status_block *) c->status_block.virt)->iop_state); |
| 387 | } | 387 | } |
| 388 | }; | 388 | }; |
diff --git a/drivers/message/i2o/device.c b/drivers/message/i2o/device.c index 611adc3c0f74..489d7c5c4965 100644 --- a/drivers/message/i2o/device.c +++ b/drivers/message/i2o/device.c | |||
| @@ -62,7 +62,7 @@ int i2o_device_claim(struct i2o_device *dev) | |||
| 62 | { | 62 | { |
| 63 | int rc = 0; | 63 | int rc = 0; |
| 64 | 64 | ||
| 65 | down(&dev->lock); | 65 | mutex_lock(&dev->lock); |
| 66 | 66 | ||
| 67 | rc = i2o_device_issue_claim(dev, I2O_CMD_UTIL_CLAIM, I2O_CLAIM_PRIMARY); | 67 | rc = i2o_device_issue_claim(dev, I2O_CMD_UTIL_CLAIM, I2O_CLAIM_PRIMARY); |
| 68 | if (!rc) | 68 | if (!rc) |
| @@ -72,7 +72,7 @@ int i2o_device_claim(struct i2o_device *dev) | |||
| 72 | pr_debug("i2o: claim of device %d failed %d\n", | 72 | pr_debug("i2o: claim of device %d failed %d\n", |
| 73 | dev->lct_data.tid, rc); | 73 | dev->lct_data.tid, rc); |
| 74 | 74 | ||
| 75 | up(&dev->lock); | 75 | mutex_unlock(&dev->lock); |
| 76 | 76 | ||
| 77 | return rc; | 77 | return rc; |
| 78 | } | 78 | } |
| @@ -96,7 +96,7 @@ int i2o_device_claim_release(struct i2o_device *dev) | |||
| 96 | int tries; | 96 | int tries; |
| 97 | int rc = 0; | 97 | int rc = 0; |
| 98 | 98 | ||
| 99 | down(&dev->lock); | 99 | mutex_lock(&dev->lock); |
| 100 | 100 | ||
| 101 | /* | 101 | /* |
| 102 | * If the controller takes a nonblocking approach to | 102 | * If the controller takes a nonblocking approach to |
| @@ -118,7 +118,7 @@ int i2o_device_claim_release(struct i2o_device *dev) | |||
| 118 | pr_debug("i2o: claim release of device %d failed %d\n", | 118 | pr_debug("i2o: claim release of device %d failed %d\n", |
| 119 | dev->lct_data.tid, rc); | 119 | dev->lct_data.tid, rc); |
| 120 | 120 | ||
| 121 | up(&dev->lock); | 121 | mutex_unlock(&dev->lock); |
| 122 | 122 | ||
| 123 | return rc; | 123 | return rc; |
| 124 | } | 124 | } |
| @@ -198,7 +198,7 @@ static struct i2o_device *i2o_device_alloc(void) | |||
| 198 | return ERR_PTR(-ENOMEM); | 198 | return ERR_PTR(-ENOMEM); |
| 199 | 199 | ||
| 200 | INIT_LIST_HEAD(&dev->list); | 200 | INIT_LIST_HEAD(&dev->list); |
| 201 | init_MUTEX(&dev->lock); | 201 | mutex_init(&dev->lock); |
| 202 | 202 | ||
| 203 | dev->device.bus = &i2o_bus_type; | 203 | dev->device.bus = &i2o_bus_type; |
| 204 | dev->device.release = &i2o_device_release; | 204 | dev->device.release = &i2o_device_release; |
| @@ -326,7 +326,7 @@ int i2o_device_parse_lct(struct i2o_controller *c) | |||
| 326 | u16 table_size; | 326 | u16 table_size; |
| 327 | u32 buf; | 327 | u32 buf; |
| 328 | 328 | ||
| 329 | down(&c->lct_lock); | 329 | mutex_lock(&c->lct_lock); |
| 330 | 330 | ||
| 331 | kfree(c->lct); | 331 | kfree(c->lct); |
| 332 | 332 | ||
| @@ -335,7 +335,7 @@ int i2o_device_parse_lct(struct i2o_controller *c) | |||
| 335 | 335 | ||
| 336 | lct = c->lct = kmalloc(table_size * 4, GFP_KERNEL); | 336 | lct = c->lct = kmalloc(table_size * 4, GFP_KERNEL); |
| 337 | if (!lct) { | 337 | if (!lct) { |
| 338 | up(&c->lct_lock); | 338 | mutex_unlock(&c->lct_lock); |
| 339 | return -ENOMEM; | 339 | return -ENOMEM; |
| 340 | } | 340 | } |
| 341 | 341 | ||
| @@ -408,7 +408,7 @@ int i2o_device_parse_lct(struct i2o_controller *c) | |||
| 408 | i2o_device_remove(dev); | 408 | i2o_device_remove(dev); |
| 409 | } | 409 | } |
| 410 | 410 | ||
| 411 | up(&c->lct_lock); | 411 | mutex_unlock(&c->lct_lock); |
| 412 | 412 | ||
| 413 | return 0; | 413 | return 0; |
| 414 | } | 414 | } |
diff --git a/drivers/message/i2o/exec-osm.c b/drivers/message/i2o/exec-osm.c index 5278aad92bc4..8c83ee3b0920 100644 --- a/drivers/message/i2o/exec-osm.c +++ b/drivers/message/i2o/exec-osm.c | |||
| @@ -131,8 +131,10 @@ int i2o_msg_post_wait_mem(struct i2o_controller *c, struct i2o_message *msg, | |||
| 131 | int rc = 0; | 131 | int rc = 0; |
| 132 | 132 | ||
| 133 | wait = i2o_exec_wait_alloc(); | 133 | wait = i2o_exec_wait_alloc(); |
| 134 | if (!wait) | 134 | if (!wait) { |
| 135 | i2o_msg_nop(c, msg); | ||
| 135 | return -ENOMEM; | 136 | return -ENOMEM; |
| 137 | } | ||
| 136 | 138 | ||
| 137 | if (tcntxt == 0xffffffff) | 139 | if (tcntxt == 0xffffffff) |
| 138 | tcntxt = 0x80000000; | 140 | tcntxt = 0x80000000; |
| @@ -337,6 +339,8 @@ static int i2o_exec_probe(struct device *dev) | |||
| 337 | rc = device_create_file(dev, &dev_attr_product_id); | 339 | rc = device_create_file(dev, &dev_attr_product_id); |
| 338 | if (rc) goto err_vid; | 340 | if (rc) goto err_vid; |
| 339 | 341 | ||
| 342 | i2o_dev->iop->exec = i2o_dev; | ||
| 343 | |||
| 340 | return 0; | 344 | return 0; |
| 341 | 345 | ||
| 342 | err_vid: | 346 | err_vid: |
| @@ -537,7 +541,7 @@ static int i2o_exec_lct_notify(struct i2o_controller *c, u32 change_ind) | |||
| 537 | struct device *dev; | 541 | struct device *dev; |
| 538 | struct i2o_message *msg; | 542 | struct i2o_message *msg; |
| 539 | 543 | ||
| 540 | down(&c->lct_lock); | 544 | mutex_lock(&c->lct_lock); |
| 541 | 545 | ||
| 542 | dev = &c->pdev->dev; | 546 | dev = &c->pdev->dev; |
| 543 | 547 | ||
| @@ -561,7 +565,7 @@ static int i2o_exec_lct_notify(struct i2o_controller *c, u32 change_ind) | |||
| 561 | 565 | ||
| 562 | i2o_msg_post(c, msg); | 566 | i2o_msg_post(c, msg); |
| 563 | 567 | ||
| 564 | up(&c->lct_lock); | 568 | mutex_unlock(&c->lct_lock); |
| 565 | 569 | ||
| 566 | return 0; | 570 | return 0; |
| 567 | }; | 571 | }; |
diff --git a/drivers/message/i2o/i2o_block.c b/drivers/message/i2o/i2o_block.c index b17c4b2bc9ef..64a52bd7544a 100644 --- a/drivers/message/i2o/i2o_block.c +++ b/drivers/message/i2o/i2o_block.c | |||
| @@ -215,7 +215,7 @@ static int i2o_block_device_lock(struct i2o_device *dev, u32 media_id) | |||
| 215 | struct i2o_message *msg; | 215 | struct i2o_message *msg; |
| 216 | 216 | ||
| 217 | msg = i2o_msg_get_wait(dev->iop, I2O_TIMEOUT_MESSAGE_GET); | 217 | msg = i2o_msg_get_wait(dev->iop, I2O_TIMEOUT_MESSAGE_GET); |
| 218 | if (IS_ERR(msg) == I2O_QUEUE_EMPTY) | 218 | if (IS_ERR(msg)) |
| 219 | return PTR_ERR(msg); | 219 | return PTR_ERR(msg); |
| 220 | 220 | ||
| 221 | msg->u.head[0] = cpu_to_le32(FIVE_WORD_MSG_SIZE | SGL_OFFSET_0); | 221 | msg->u.head[0] = cpu_to_le32(FIVE_WORD_MSG_SIZE | SGL_OFFSET_0); |
diff --git a/drivers/message/i2o/i2o_config.c b/drivers/message/i2o/i2o_config.c index 8ba275a12773..84e046e94f5f 100644 --- a/drivers/message/i2o/i2o_config.c +++ b/drivers/message/i2o/i2o_config.c | |||
| @@ -554,8 +554,6 @@ static int i2o_cfg_passthru32(struct file *file, unsigned cmnd, | |||
| 554 | return -ENXIO; | 554 | return -ENXIO; |
| 555 | } | 555 | } |
| 556 | 556 | ||
| 557 | msg = i2o_msg_get_wait(c, I2O_TIMEOUT_MESSAGE_GET); | ||
| 558 | |||
| 559 | sb = c->status_block.virt; | 557 | sb = c->status_block.virt; |
| 560 | 558 | ||
| 561 | if (get_user(size, &user_msg[0])) { | 559 | if (get_user(size, &user_msg[0])) { |
| @@ -573,24 +571,30 @@ static int i2o_cfg_passthru32(struct file *file, unsigned cmnd, | |||
| 573 | 571 | ||
| 574 | size <<= 2; // Convert to bytes | 572 | size <<= 2; // Convert to bytes |
| 575 | 573 | ||
| 574 | msg = i2o_msg_get_wait(c, I2O_TIMEOUT_MESSAGE_GET); | ||
| 575 | if (IS_ERR(msg)) | ||
| 576 | return PTR_ERR(msg); | ||
| 577 | |||
| 578 | rcode = -EFAULT; | ||
| 576 | /* Copy in the user's I2O command */ | 579 | /* Copy in the user's I2O command */ |
| 577 | if (copy_from_user(msg, user_msg, size)) { | 580 | if (copy_from_user(msg, user_msg, size)) { |
| 578 | osm_warn("unable to copy user message\n"); | 581 | osm_warn("unable to copy user message\n"); |
| 579 | return -EFAULT; | 582 | goto out; |
| 580 | } | 583 | } |
| 581 | i2o_dump_message(msg); | 584 | i2o_dump_message(msg); |
| 582 | 585 | ||
| 583 | if (get_user(reply_size, &user_reply[0]) < 0) | 586 | if (get_user(reply_size, &user_reply[0]) < 0) |
| 584 | return -EFAULT; | 587 | goto out; |
| 585 | 588 | ||
| 586 | reply_size >>= 16; | 589 | reply_size >>= 16; |
| 587 | reply_size <<= 2; | 590 | reply_size <<= 2; |
| 588 | 591 | ||
| 592 | rcode = -ENOMEM; | ||
| 589 | reply = kzalloc(reply_size, GFP_KERNEL); | 593 | reply = kzalloc(reply_size, GFP_KERNEL); |
| 590 | if (!reply) { | 594 | if (!reply) { |
| 591 | printk(KERN_WARNING "%s: Could not allocate reply buffer\n", | 595 | printk(KERN_WARNING "%s: Could not allocate reply buffer\n", |
| 592 | c->name); | 596 | c->name); |
| 593 | return -ENOMEM; | 597 | goto out; |
| 594 | } | 598 | } |
| 595 | 599 | ||
| 596 | sg_offset = (msg->u.head[0] >> 4) & 0x0f; | 600 | sg_offset = (msg->u.head[0] >> 4) & 0x0f; |
| @@ -661,13 +665,14 @@ static int i2o_cfg_passthru32(struct file *file, unsigned cmnd, | |||
| 661 | } | 665 | } |
| 662 | 666 | ||
| 663 | rcode = i2o_msg_post_wait(c, msg, 60); | 667 | rcode = i2o_msg_post_wait(c, msg, 60); |
| 668 | msg = NULL; | ||
| 664 | if (rcode) { | 669 | if (rcode) { |
| 665 | reply[4] = ((u32) rcode) << 24; | 670 | reply[4] = ((u32) rcode) << 24; |
| 666 | goto sg_list_cleanup; | 671 | goto sg_list_cleanup; |
| 667 | } | 672 | } |
| 668 | 673 | ||
| 669 | if (sg_offset) { | 674 | if (sg_offset) { |
| 670 | u32 msg[I2O_OUTBOUND_MSG_FRAME_SIZE]; | 675 | u32 rmsg[I2O_OUTBOUND_MSG_FRAME_SIZE]; |
| 671 | /* Copy back the Scatter Gather buffers back to user space */ | 676 | /* Copy back the Scatter Gather buffers back to user space */ |
| 672 | u32 j; | 677 | u32 j; |
| 673 | // TODO 64bit fix | 678 | // TODO 64bit fix |
| @@ -675,7 +680,7 @@ static int i2o_cfg_passthru32(struct file *file, unsigned cmnd, | |||
| 675 | int sg_size; | 680 | int sg_size; |
| 676 | 681 | ||
| 677 | // re-acquire the original message to handle correctly the sg copy operation | 682 | // re-acquire the original message to handle correctly the sg copy operation |
| 678 | memset(&msg, 0, I2O_OUTBOUND_MSG_FRAME_SIZE * 4); | 683 | memset(&rmsg, 0, I2O_OUTBOUND_MSG_FRAME_SIZE * 4); |
| 679 | // get user msg size in u32s | 684 | // get user msg size in u32s |
| 680 | if (get_user(size, &user_msg[0])) { | 685 | if (get_user(size, &user_msg[0])) { |
| 681 | rcode = -EFAULT; | 686 | rcode = -EFAULT; |
| @@ -684,7 +689,7 @@ static int i2o_cfg_passthru32(struct file *file, unsigned cmnd, | |||
| 684 | size = size >> 16; | 689 | size = size >> 16; |
| 685 | size *= 4; | 690 | size *= 4; |
| 686 | /* Copy in the user's I2O command */ | 691 | /* Copy in the user's I2O command */ |
| 687 | if (copy_from_user(msg, user_msg, size)) { | 692 | if (copy_from_user(rmsg, user_msg, size)) { |
| 688 | rcode = -EFAULT; | 693 | rcode = -EFAULT; |
| 689 | goto sg_list_cleanup; | 694 | goto sg_list_cleanup; |
| 690 | } | 695 | } |
| @@ -692,7 +697,7 @@ static int i2o_cfg_passthru32(struct file *file, unsigned cmnd, | |||
| 692 | (size - sg_offset * 4) / sizeof(struct sg_simple_element); | 697 | (size - sg_offset * 4) / sizeof(struct sg_simple_element); |
| 693 | 698 | ||
| 694 | // TODO 64bit fix | 699 | // TODO 64bit fix |
| 695 | sg = (struct sg_simple_element *)(msg + sg_offset); | 700 | sg = (struct sg_simple_element *)(rmsg + sg_offset); |
| 696 | for (j = 0; j < sg_count; j++) { | 701 | for (j = 0; j < sg_count; j++) { |
| 697 | /* Copy out the SG list to user's buffer if necessary */ | 702 | /* Copy out the SG list to user's buffer if necessary */ |
| 698 | if (! | 703 | if (! |
| @@ -714,7 +719,7 @@ static int i2o_cfg_passthru32(struct file *file, unsigned cmnd, | |||
| 714 | } | 719 | } |
| 715 | } | 720 | } |
| 716 | 721 | ||
| 717 | sg_list_cleanup: | 722 | sg_list_cleanup: |
| 718 | /* Copy back the reply to user space */ | 723 | /* Copy back the reply to user space */ |
| 719 | if (reply_size) { | 724 | if (reply_size) { |
| 720 | // we wrote our own values for context - now restore the user supplied ones | 725 | // we wrote our own values for context - now restore the user supplied ones |
| @@ -723,7 +728,6 @@ static int i2o_cfg_passthru32(struct file *file, unsigned cmnd, | |||
| 723 | "%s: Could not copy message context FROM user\n", | 728 | "%s: Could not copy message context FROM user\n", |
| 724 | c->name); | 729 | c->name); |
| 725 | rcode = -EFAULT; | 730 | rcode = -EFAULT; |
| 726 | goto sg_list_cleanup; | ||
| 727 | } | 731 | } |
| 728 | if (copy_to_user(user_reply, reply, reply_size)) { | 732 | if (copy_to_user(user_reply, reply, reply_size)) { |
| 729 | printk(KERN_WARNING | 733 | printk(KERN_WARNING |
| @@ -731,12 +735,14 @@ static int i2o_cfg_passthru32(struct file *file, unsigned cmnd, | |||
| 731 | rcode = -EFAULT; | 735 | rcode = -EFAULT; |
| 732 | } | 736 | } |
| 733 | } | 737 | } |
| 734 | |||
| 735 | for (i = 0; i < sg_index; i++) | 738 | for (i = 0; i < sg_index; i++) |
| 736 | i2o_dma_free(&c->pdev->dev, &sg_list[i]); | 739 | i2o_dma_free(&c->pdev->dev, &sg_list[i]); |
| 737 | 740 | ||
| 738 | cleanup: | 741 | cleanup: |
| 739 | kfree(reply); | 742 | kfree(reply); |
| 743 | out: | ||
| 744 | if (msg) | ||
| 745 | i2o_msg_nop(c, msg); | ||
| 740 | return rcode; | 746 | return rcode; |
| 741 | } | 747 | } |
| 742 | 748 | ||
| @@ -793,8 +799,6 @@ static int i2o_cfg_passthru(unsigned long arg) | |||
| 793 | return -ENXIO; | 799 | return -ENXIO; |
| 794 | } | 800 | } |
| 795 | 801 | ||
| 796 | msg = i2o_msg_get_wait(c, I2O_TIMEOUT_MESSAGE_GET); | ||
| 797 | |||
| 798 | sb = c->status_block.virt; | 802 | sb = c->status_block.virt; |
| 799 | 803 | ||
| 800 | if (get_user(size, &user_msg[0])) | 804 | if (get_user(size, &user_msg[0])) |
| @@ -810,12 +814,17 @@ static int i2o_cfg_passthru(unsigned long arg) | |||
| 810 | 814 | ||
| 811 | size <<= 2; // Convert to bytes | 815 | size <<= 2; // Convert to bytes |
| 812 | 816 | ||
| 817 | msg = i2o_msg_get_wait(c, I2O_TIMEOUT_MESSAGE_GET); | ||
| 818 | if (IS_ERR(msg)) | ||
| 819 | return PTR_ERR(msg); | ||
| 820 | |||
| 821 | rcode = -EFAULT; | ||
| 813 | /* Copy in the user's I2O command */ | 822 | /* Copy in the user's I2O command */ |
| 814 | if (copy_from_user(msg, user_msg, size)) | 823 | if (copy_from_user(msg, user_msg, size)) |
| 815 | return -EFAULT; | 824 | goto out; |
| 816 | 825 | ||
| 817 | if (get_user(reply_size, &user_reply[0]) < 0) | 826 | if (get_user(reply_size, &user_reply[0]) < 0) |
| 818 | return -EFAULT; | 827 | goto out; |
| 819 | 828 | ||
| 820 | reply_size >>= 16; | 829 | reply_size >>= 16; |
| 821 | reply_size <<= 2; | 830 | reply_size <<= 2; |
| @@ -824,7 +833,8 @@ static int i2o_cfg_passthru(unsigned long arg) | |||
| 824 | if (!reply) { | 833 | if (!reply) { |
| 825 | printk(KERN_WARNING "%s: Could not allocate reply buffer\n", | 834 | printk(KERN_WARNING "%s: Could not allocate reply buffer\n", |
| 826 | c->name); | 835 | c->name); |
| 827 | return -ENOMEM; | 836 | rcode = -ENOMEM; |
| 837 | goto out; | ||
| 828 | } | 838 | } |
| 829 | 839 | ||
| 830 | sg_offset = (msg->u.head[0] >> 4) & 0x0f; | 840 | sg_offset = (msg->u.head[0] >> 4) & 0x0f; |
| @@ -891,13 +901,14 @@ static int i2o_cfg_passthru(unsigned long arg) | |||
| 891 | } | 901 | } |
| 892 | 902 | ||
| 893 | rcode = i2o_msg_post_wait(c, msg, 60); | 903 | rcode = i2o_msg_post_wait(c, msg, 60); |
| 904 | msg = NULL; | ||
| 894 | if (rcode) { | 905 | if (rcode) { |
| 895 | reply[4] = ((u32) rcode) << 24; | 906 | reply[4] = ((u32) rcode) << 24; |
| 896 | goto sg_list_cleanup; | 907 | goto sg_list_cleanup; |
| 897 | } | 908 | } |
| 898 | 909 | ||
| 899 | if (sg_offset) { | 910 | if (sg_offset) { |
| 900 | u32 msg[128]; | 911 | u32 rmsg[128]; |
| 901 | /* Copy back the Scatter Gather buffers back to user space */ | 912 | /* Copy back the Scatter Gather buffers back to user space */ |
| 902 | u32 j; | 913 | u32 j; |
| 903 | // TODO 64bit fix | 914 | // TODO 64bit fix |
| @@ -905,7 +916,7 @@ static int i2o_cfg_passthru(unsigned long arg) | |||
| 905 | int sg_size; | 916 | int sg_size; |
| 906 | 917 | ||
| 907 | // re-acquire the original message to handle correctly the sg copy operation | 918 | // re-acquire the original message to handle correctly the sg copy operation |
| 908 | memset(&msg, 0, I2O_OUTBOUND_MSG_FRAME_SIZE * 4); | 919 | memset(&rmsg, 0, I2O_OUTBOUND_MSG_FRAME_SIZE * 4); |
| 909 | // get user msg size in u32s | 920 | // get user msg size in u32s |
| 910 | if (get_user(size, &user_msg[0])) { | 921 | if (get_user(size, &user_msg[0])) { |
| 911 | rcode = -EFAULT; | 922 | rcode = -EFAULT; |
| @@ -914,7 +925,7 @@ static int i2o_cfg_passthru(unsigned long arg) | |||
| 914 | size = size >> 16; | 925 | size = size >> 16; |
| 915 | size *= 4; | 926 | size *= 4; |
| 916 | /* Copy in the user's I2O command */ | 927 | /* Copy in the user's I2O command */ |
| 917 | if (copy_from_user(msg, user_msg, size)) { | 928 | if (copy_from_user(rmsg, user_msg, size)) { |
| 918 | rcode = -EFAULT; | 929 | rcode = -EFAULT; |
| 919 | goto sg_list_cleanup; | 930 | goto sg_list_cleanup; |
| 920 | } | 931 | } |
| @@ -922,7 +933,7 @@ static int i2o_cfg_passthru(unsigned long arg) | |||
| 922 | (size - sg_offset * 4) / sizeof(struct sg_simple_element); | 933 | (size - sg_offset * 4) / sizeof(struct sg_simple_element); |
| 923 | 934 | ||
| 924 | // TODO 64bit fix | 935 | // TODO 64bit fix |
| 925 | sg = (struct sg_simple_element *)(msg + sg_offset); | 936 | sg = (struct sg_simple_element *)(rmsg + sg_offset); |
| 926 | for (j = 0; j < sg_count; j++) { | 937 | for (j = 0; j < sg_count; j++) { |
| 927 | /* Copy out the SG list to user's buffer if necessary */ | 938 | /* Copy out the SG list to user's buffer if necessary */ |
| 928 | if (! | 939 | if (! |
| @@ -944,7 +955,7 @@ static int i2o_cfg_passthru(unsigned long arg) | |||
| 944 | } | 955 | } |
| 945 | } | 956 | } |
| 946 | 957 | ||
| 947 | sg_list_cleanup: | 958 | sg_list_cleanup: |
| 948 | /* Copy back the reply to user space */ | 959 | /* Copy back the reply to user space */ |
| 949 | if (reply_size) { | 960 | if (reply_size) { |
| 950 | // we wrote our own values for context - now restore the user supplied ones | 961 | // we wrote our own values for context - now restore the user supplied ones |
| @@ -964,8 +975,11 @@ static int i2o_cfg_passthru(unsigned long arg) | |||
| 964 | for (i = 0; i < sg_index; i++) | 975 | for (i = 0; i < sg_index; i++) |
| 965 | kfree(sg_list[i]); | 976 | kfree(sg_list[i]); |
| 966 | 977 | ||
| 967 | cleanup: | 978 | cleanup: |
| 968 | kfree(reply); | 979 | kfree(reply); |
| 980 | out: | ||
| 981 | if (msg) | ||
| 982 | i2o_msg_nop(c, msg); | ||
| 969 | return rcode; | 983 | return rcode; |
| 970 | } | 984 | } |
| 971 | #endif | 985 | #endif |
diff --git a/drivers/message/i2o/iop.c b/drivers/message/i2o/iop.c index 3305c12372a2..a1ec16a075c6 100644 --- a/drivers/message/i2o/iop.c +++ b/drivers/message/i2o/iop.c | |||
| @@ -1067,7 +1067,7 @@ struct i2o_controller *i2o_iop_alloc(void) | |||
| 1067 | 1067 | ||
| 1068 | INIT_LIST_HEAD(&c->devices); | 1068 | INIT_LIST_HEAD(&c->devices); |
| 1069 | spin_lock_init(&c->lock); | 1069 | spin_lock_init(&c->lock); |
| 1070 | init_MUTEX(&c->lct_lock); | 1070 | mutex_init(&c->lct_lock); |
| 1071 | 1071 | ||
| 1072 | device_initialize(&c->device); | 1072 | device_initialize(&c->device); |
| 1073 | 1073 | ||
