From 3859f6a248cbdfbe7b41663f3a2b51f48e30b281 Mon Sep 17 00:00:00 2001 From: Andreas Herrmann Date: Sat, 27 Aug 2005 11:07:54 -0700 Subject: [PATCH] zfcp: add rports to enable scsi_add_device to work again This patch fixes a severe problem with 2.6.13-rc7. Due to recent SCSI changes it is not possible to add any LUNs to the zfcp device driver anymore. With registration of remote ports this is fixed. Signed-off-by: Andreas Herrmann Acked-by: James Bottomley Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/s390/scsi/zfcp_aux.c | 29 +++++++---------------------- 1 file changed, 7 insertions(+), 22 deletions(-) (limited to 'drivers/s390/scsi/zfcp_aux.c') diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c index e17b4d58a9f6..6fed4a532ca3 100644 --- a/drivers/s390/scsi/zfcp_aux.c +++ b/drivers/s390/scsi/zfcp_aux.c @@ -1299,13 +1299,10 @@ struct zfcp_port * zfcp_port_enqueue(struct zfcp_adapter *adapter, wwn_t wwpn, u32 status, u32 d_id) { - struct zfcp_port *port, *tmp_port; + struct zfcp_port *port; int check_wwpn; - scsi_id_t scsi_id; - int found; check_wwpn = !(status & ZFCP_STATUS_PORT_NO_WWPN); - /* * check that there is no port with this WWPN already in list */ @@ -1368,7 +1365,7 @@ zfcp_port_enqueue(struct zfcp_adapter *adapter, wwn_t wwpn, u32 status, } else { snprintf(port->sysfs_device.bus_id, BUS_ID_SIZE, "0x%016llx", wwpn); - port->sysfs_device.parent = &adapter->ccw_device->dev; + port->sysfs_device.parent = &adapter->ccw_device->dev; } port->sysfs_device.release = zfcp_sysfs_port_release; dev_set_drvdata(&port->sysfs_device, port); @@ -1388,24 +1385,8 @@ zfcp_port_enqueue(struct zfcp_adapter *adapter, wwn_t wwpn, u32 status, zfcp_port_get(port); - scsi_id = 1; - found = 0; write_lock_irq(&zfcp_data.config_lock); - list_for_each_entry(tmp_port, &adapter->port_list_head, list) { - if (atomic_test_mask(ZFCP_STATUS_PORT_NO_SCSI_ID, - &tmp_port->status)) - continue; - if (tmp_port->scsi_id != scsi_id) { - found = 1; - break; - } - scsi_id++; - } - port->scsi_id = scsi_id; - if (found) - list_add_tail(&port->list, &tmp_port->list); - else - list_add_tail(&port->list, &adapter->port_list_head); + list_add_tail(&port->list, &adapter->port_list_head); atomic_clear_mask(ZFCP_STATUS_COMMON_REMOVE, &port->status); atomic_set_mask(ZFCP_STATUS_COMMON_RUNNING, &port->status); if (d_id == ZFCP_DID_DIRECTORY_SERVICE) @@ -1422,11 +1403,15 @@ zfcp_port_enqueue(struct zfcp_adapter *adapter, wwn_t wwpn, u32 status, void zfcp_port_dequeue(struct zfcp_port *port) { + struct fc_port *rport; + zfcp_port_wait(port); write_lock_irq(&zfcp_data.config_lock); list_del(&port->list); port->adapter->ports--; write_unlock_irq(&zfcp_data.config_lock); + if (port->rport) + fc_remote_port_delete(rport); zfcp_adapter_put(port->adapter); zfcp_sysfs_port_remove_files(&port->sysfs_device, atomic_read(&port->status)); -- cgit v1.2.1 From 20b1730af3ae05450b0e03f5aed40c4313f65db6 Mon Sep 17 00:00:00 2001 From: Heiko Carstens Date: Sun, 28 Aug 2005 13:22:37 -0700 Subject: [PATCH] zfcp: bugfix and compile fixes Bugfix (usage of uninitialized pointer in zfcp_port_dequeue) and compile fixes for the zfcp device driver. Signed-off-by: Heiko Carstens Acked-by: James Bottomley Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/s390/scsi/zfcp_aux.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'drivers/s390/scsi/zfcp_aux.c') diff --git a/drivers/s390/scsi/zfcp_aux.c b/drivers/s390/scsi/zfcp_aux.c index 6fed4a532ca3..bfe3ba73bc0f 100644 --- a/drivers/s390/scsi/zfcp_aux.c +++ b/drivers/s390/scsi/zfcp_aux.c @@ -1403,15 +1403,14 @@ zfcp_port_enqueue(struct zfcp_adapter *adapter, wwn_t wwpn, u32 status, void zfcp_port_dequeue(struct zfcp_port *port) { - struct fc_port *rport; - zfcp_port_wait(port); write_lock_irq(&zfcp_data.config_lock); list_del(&port->list); port->adapter->ports--; write_unlock_irq(&zfcp_data.config_lock); if (port->rport) - fc_remote_port_delete(rport); + fc_remote_port_delete(port->rport); + port->rport = NULL; zfcp_adapter_put(port->adapter); zfcp_sysfs_port_remove_files(&port->sysfs_device, atomic_read(&port->status)); -- cgit v1.2.1