diff options
Diffstat (limited to 'drivers/s390/scsi/zfcp_scsi.c')
-rw-r--r-- | drivers/s390/scsi/zfcp_scsi.c | 64 |
1 files changed, 9 insertions, 55 deletions
diff --git a/drivers/s390/scsi/zfcp_scsi.c b/drivers/s390/scsi/zfcp_scsi.c index 4b0c85acb0f0..a96e5c3b9460 100644 --- a/drivers/s390/scsi/zfcp_scsi.c +++ b/drivers/s390/scsi/zfcp_scsi.c | |||
@@ -1,26 +1,11 @@ | |||
1 | /* | 1 | /* |
2 | * This file is part of the zfcp device driver for | 2 | * zfcp device driver |
3 | * FCP adapters for IBM System z9 and zSeries. | ||
4 | * | 3 | * |
5 | * (C) Copyright IBM Corp. 2002, 2006 | 4 | * Interface to Linux SCSI midlayer. |
6 | * | 5 | * |
7 | * This program is free software; you can redistribute it and/or modify | 6 | * Copyright IBM Corporation 2002, 2008 |
8 | * it under the terms of the GNU General Public License as published by | ||
9 | * the Free Software Foundation; either version 2, or (at your option) | ||
10 | * any later version. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
20 | */ | 7 | */ |
21 | 8 | ||
22 | #define ZFCP_LOG_AREA ZFCP_LOG_AREA_SCSI | ||
23 | |||
24 | #include "zfcp_ext.h" | 9 | #include "zfcp_ext.h" |
25 | #include <asm/atomic.h> | 10 | #include <asm/atomic.h> |
26 | 11 | ||
@@ -44,7 +29,7 @@ static struct device_attribute *zfcp_a_stats_attrs[]; | |||
44 | 29 | ||
45 | struct zfcp_data zfcp_data = { | 30 | struct zfcp_data zfcp_data = { |
46 | .scsi_host_template = { | 31 | .scsi_host_template = { |
47 | .name = ZFCP_NAME, | 32 | .name = "zfcp", |
48 | .module = THIS_MODULE, | 33 | .module = THIS_MODULE, |
49 | .proc_name = "zfcp", | 34 | .proc_name = "zfcp", |
50 | .slave_alloc = zfcp_scsi_slave_alloc, | 35 | .slave_alloc = zfcp_scsi_slave_alloc, |
@@ -64,7 +49,6 @@ struct zfcp_data zfcp_data = { | |||
64 | .max_sectors = ZFCP_MAX_SECTORS, | 49 | .max_sectors = ZFCP_MAX_SECTORS, |
65 | .shost_attrs = zfcp_a_stats_attrs, | 50 | .shost_attrs = zfcp_a_stats_attrs, |
66 | }, | 51 | }, |
67 | .driver_version = ZFCP_VERSION, | ||
68 | }; | 52 | }; |
69 | 53 | ||
70 | /* Find start of Response Information in FCP response unit*/ | 54 | /* Find start of Response Information in FCP response unit*/ |
@@ -181,16 +165,14 @@ zfcp_scsi_slave_alloc(struct scsi_device *sdp) | |||
181 | static void zfcp_scsi_slave_destroy(struct scsi_device *sdpnt) | 165 | static void zfcp_scsi_slave_destroy(struct scsi_device *sdpnt) |
182 | { | 166 | { |
183 | struct zfcp_unit *unit = (struct zfcp_unit *) sdpnt->hostdata; | 167 | struct zfcp_unit *unit = (struct zfcp_unit *) sdpnt->hostdata; |
184 | 168 | WARN_ON(!unit); | |
185 | if (unit) { | 169 | if (unit) { |
186 | atomic_clear_mask(ZFCP_STATUS_UNIT_REGISTERED, &unit->status); | 170 | atomic_clear_mask(ZFCP_STATUS_UNIT_REGISTERED, &unit->status); |
187 | sdpnt->hostdata = NULL; | 171 | sdpnt->hostdata = NULL; |
188 | unit->device = NULL; | 172 | unit->device = NULL; |
189 | zfcp_erp_unit_failed(unit, 12, NULL); | 173 | zfcp_erp_unit_failed(unit, 12, NULL); |
190 | zfcp_unit_put(unit); | 174 | zfcp_unit_put(unit); |
191 | } else | 175 | } |
192 | ZFCP_LOG_NORMAL("bug: no unit associated with SCSI device at " | ||
193 | "address %p\n", sdpnt); | ||
194 | } | 176 | } |
195 | 177 | ||
196 | /* | 178 | /* |
@@ -253,10 +235,6 @@ zfcp_scsi_command_async(struct zfcp_adapter *adapter, struct zfcp_unit *unit, | |||
253 | if (unlikely( | 235 | if (unlikely( |
254 | atomic_test_mask(ZFCP_STATUS_COMMON_ERP_FAILED, &unit->status) || | 236 | atomic_test_mask(ZFCP_STATUS_COMMON_ERP_FAILED, &unit->status) || |
255 | !atomic_test_mask(ZFCP_STATUS_COMMON_RUNNING, &unit->status))) { | 237 | !atomic_test_mask(ZFCP_STATUS_COMMON_RUNNING, &unit->status))) { |
256 | ZFCP_LOG_DEBUG("stopping SCSI I/O on unit 0x%016Lx on port " | ||
257 | "0x%016Lx on adapter %s\n", | ||
258 | unit->fcp_lun, unit->port->wwpn, | ||
259 | zfcp_get_busid_by_adapter(adapter)); | ||
260 | zfcp_scsi_command_fail(scpnt, DID_ERROR); | 238 | zfcp_scsi_command_fail(scpnt, DID_ERROR); |
261 | goto out; | 239 | goto out; |
262 | } | 240 | } |
@@ -264,18 +242,12 @@ zfcp_scsi_command_async(struct zfcp_adapter *adapter, struct zfcp_unit *unit, | |||
264 | tmp = zfcp_fsf_send_fcp_command_task(adapter, unit, scpnt, use_timer, | 242 | tmp = zfcp_fsf_send_fcp_command_task(adapter, unit, scpnt, use_timer, |
265 | ZFCP_REQ_AUTO_CLEANUP); | 243 | ZFCP_REQ_AUTO_CLEANUP); |
266 | if (unlikely(tmp == -EBUSY)) { | 244 | if (unlikely(tmp == -EBUSY)) { |
267 | ZFCP_LOG_DEBUG("adapter %s not ready or unit 0x%016Lx " | ||
268 | "on port 0x%016Lx in recovery\n", | ||
269 | zfcp_get_busid_by_unit(unit), | ||
270 | unit->fcp_lun, unit->port->wwpn); | ||
271 | zfcp_scsi_command_fail(scpnt, DID_NO_CONNECT); | 245 | zfcp_scsi_command_fail(scpnt, DID_NO_CONNECT); |
272 | goto out; | 246 | goto out; |
273 | } | 247 | } |
274 | 248 | ||
275 | if (unlikely(tmp < 0)) { | 249 | if (unlikely(tmp < 0)) |
276 | ZFCP_LOG_DEBUG("error: initiation of Send FCP Cmnd failed\n"); | ||
277 | retval = SCSI_MLQUEUE_HOST_BUSY; | 250 | retval = SCSI_MLQUEUE_HOST_BUSY; |
278 | } | ||
279 | 251 | ||
280 | out: | 252 | out: |
281 | return retval; | 253 | return retval; |
@@ -394,9 +366,6 @@ static int zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt) | |||
394 | adapter = (struct zfcp_adapter *) scsi_host->hostdata[0]; | 366 | adapter = (struct zfcp_adapter *) scsi_host->hostdata[0]; |
395 | unit = (struct zfcp_unit *) scpnt->device->hostdata; | 367 | unit = (struct zfcp_unit *) scpnt->device->hostdata; |
396 | 368 | ||
397 | ZFCP_LOG_INFO("aborting scsi_cmnd=%p on adapter %s\n", | ||
398 | scpnt, zfcp_get_busid_by_adapter(adapter)); | ||
399 | |||
400 | /* avoid race condition between late normal completion and abort */ | 369 | /* avoid race condition between late normal completion and abort */ |
401 | write_lock_irqsave(&adapter->abort_lock, flags); | 370 | write_lock_irqsave(&adapter->abort_lock, flags); |
402 | 371 | ||
@@ -420,7 +389,6 @@ static int zfcp_scsi_eh_abort_handler(struct scsi_cmnd *scpnt) | |||
420 | 389 | ||
421 | fsf_req = zfcp_fsf_abort_fcp_command(old_req_id, adapter, unit, 0); | 390 | fsf_req = zfcp_fsf_abort_fcp_command(old_req_id, adapter, unit, 0); |
422 | if (!fsf_req) { | 391 | if (!fsf_req) { |
423 | ZFCP_LOG_INFO("error: initiation of Abort FCP Cmnd failed\n"); | ||
424 | zfcp_scsi_dbf_event_abort("nres", adapter, scpnt, NULL, | 392 | zfcp_scsi_dbf_event_abort("nres", adapter, scpnt, NULL, |
425 | old_req_id); | 393 | old_req_id); |
426 | retval = FAILED; | 394 | retval = FAILED; |
@@ -485,10 +453,6 @@ zfcp_task_management_function(struct zfcp_unit *unit, u8 tm_flags, | |||
485 | fsf_req = zfcp_fsf_send_fcp_command_task_management | 453 | fsf_req = zfcp_fsf_send_fcp_command_task_management |
486 | (adapter, unit, tm_flags, 0); | 454 | (adapter, unit, tm_flags, 0); |
487 | if (!fsf_req) { | 455 | if (!fsf_req) { |
488 | ZFCP_LOG_INFO("error: creation of task management request " | ||
489 | "failed for unit 0x%016Lx on port 0x%016Lx on " | ||
490 | "adapter %s\n", unit->fcp_lun, unit->port->wwpn, | ||
491 | zfcp_get_busid_by_adapter(adapter)); | ||
492 | zfcp_scsi_dbf_event_devreset("nres", tm_flags, unit, scpnt); | 456 | zfcp_scsi_dbf_event_devreset("nres", tm_flags, unit, scpnt); |
493 | retval = -ENOMEM; | 457 | retval = -ENOMEM; |
494 | goto out; | 458 | goto out; |
@@ -524,12 +488,6 @@ static int zfcp_scsi_eh_host_reset_handler(struct scsi_cmnd *scpnt) | |||
524 | 488 | ||
525 | unit = (struct zfcp_unit*) scpnt->device->hostdata; | 489 | unit = (struct zfcp_unit*) scpnt->device->hostdata; |
526 | adapter = unit->port->adapter; | 490 | adapter = unit->port->adapter; |
527 | |||
528 | ZFCP_LOG_NORMAL("host reset because of problems with " | ||
529 | "unit 0x%016Lx on port 0x%016Lx, adapter %s\n", | ||
530 | unit->fcp_lun, unit->port->wwpn, | ||
531 | zfcp_get_busid_by_adapter(unit->port->adapter)); | ||
532 | |||
533 | zfcp_erp_adapter_reopen(adapter, 0, 141, scpnt); | 491 | zfcp_erp_adapter_reopen(adapter, 0, 141, scpnt); |
534 | zfcp_erp_wait(adapter); | 492 | zfcp_erp_wait(adapter); |
535 | 493 | ||
@@ -549,13 +507,11 @@ zfcp_adapter_scsi_register(struct zfcp_adapter *adapter) | |||
549 | adapter->scsi_host = scsi_host_alloc(&zfcp_data.scsi_host_template, | 507 | adapter->scsi_host = scsi_host_alloc(&zfcp_data.scsi_host_template, |
550 | sizeof (struct zfcp_adapter *)); | 508 | sizeof (struct zfcp_adapter *)); |
551 | if (!adapter->scsi_host) { | 509 | if (!adapter->scsi_host) { |
552 | ZFCP_LOG_NORMAL("error: registration with SCSI stack failed " | 510 | dev_err(&adapter->ccw_device->dev, |
553 | "for adapter %s ", | 511 | "registration with SCSI stack failed."); |
554 | zfcp_get_busid_by_adapter(adapter)); | ||
555 | retval = -EIO; | 512 | retval = -EIO; |
556 | goto out; | 513 | goto out; |
557 | } | 514 | } |
558 | ZFCP_LOG_DEBUG("host registered, scsi_host=%p\n", adapter->scsi_host); | ||
559 | 515 | ||
560 | /* tell the SCSI stack some characteristics of this adapter */ | 516 | /* tell the SCSI stack some characteristics of this adapter */ |
561 | adapter->scsi_host->max_id = 1; | 517 | adapter->scsi_host->max_id = 1; |
@@ -987,5 +943,3 @@ static struct device_attribute *zfcp_a_stats_attrs[] = { | |||
987 | &dev_attr_seconds_active, | 943 | &dev_attr_seconds_active, |
988 | NULL | 944 | NULL |
989 | }; | 945 | }; |
990 | |||
991 | #undef ZFCP_LOG_AREA | ||