From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756822AbXKELqz (ORCPT ); Mon, 5 Nov 2007 06:46:55 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754934AbXKELqi (ORCPT ); Mon, 5 Nov 2007 06:46:38 -0500 Received: from mtagate4.uk.ibm.com ([195.212.29.137]:65171 "EHLO mtagate4.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756727AbXKELqf (ORCPT ); Mon, 5 Nov 2007 06:46:35 -0500 Message-Id: <20071105114623.907717000@vnet.ibm.com> References: <20071105113742.233391000@vnet.ibm.com> User-Agent: quilt/0.46-1 Date: Mon, 05 Nov 2007 12:37:46 +0100 From: swen@vnet.ibm.com To: James.Bottomley@steeleye.com Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, Christof Schmitt Subject: [patch 4/6] zfcp: Remove SCSI devices when removing complete adapter Content-Disposition: inline; filename=804-zfcp-rmdevs.diff Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org From: Christof Schmitt The common I/O layer can call remove a handler to inform zfcp that a device disappeared. The handler zfcp_ccw_remove then removes all unit, port and the adapter data structures. Removing the units requires that the SCSI devices are removed first. Signed-off-by: Christof Schmitt Signed-off-by: Swen Schillig --- drivers/s390/scsi/zfcp_ccw.c | 3 +++ 1 file changed, 3 insertions(+) diff -urpN linux-2.6/drivers/s390/scsi/zfcp_ccw.c linux-2.6-patched/drivers/s390/scsi/zfcp_ccw.c --- linux-2.6/drivers/s390/scsi/zfcp_ccw.c 2007-11-02 08:37:56.000000000 +0100 +++ linux-2.6-patched/drivers/s390/scsi/zfcp_ccw.c 2007-11-02 08:38:26.000000000 +0100 @@ -120,6 +120,9 @@ zfcp_ccw_remove(struct ccw_device *ccw_d list_for_each_entry_safe(port, p, &adapter->port_remove_lh, list) { list_for_each_entry_safe(unit, u, &port->unit_remove_lh, list) { + if (atomic_test_mask(ZFCP_STATUS_UNIT_REGISTERED, + &unit->status)) + scsi_remove_device(unit->device); zfcp_unit_dequeue(unit); } zfcp_port_dequeue(port); --