Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756914AbZKMPL7 (ORCPT ); Fri, 13 Nov 2009 10:11:59 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1756868AbZKMPLt (ORCPT ); Fri, 13 Nov 2009 10:11:49 -0500 Received: from mtagate3.de.ibm.com ([195.212.17.163]:44489 "EHLO mtagate3.de.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756131AbZKMPJH (ORCPT ); Fri, 13 Nov 2009 10:09:07 -0500 Message-Id: <20091113150915.209911383@de.ibm.com> User-Agent: quilt/0.48-1 Date: Fri, 13 Nov 2009 16:08:57 +0100 From: Martin Schwidefsky To: linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org Cc: Heiko Carstens , Peter Oberparleiter , Martin Schwidefsky Subject: [patch 33/52] [PATCH] cio: handle error during path verification consistently References: <20091113150824.351347652@de.ibm.com> Content-Disposition: inline; filename=132-cio-verification-errors.diff Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2782 Lines: 80 From: Peter Oberparleiter Handle verification errors consistently through the existing callback ccw_device_done to reduce cleanup code duplication. Signed-off-by: Peter Oberparleiter Signed-off-by: Martin Schwidefsky --- drivers/s390/cio/device_fsm.c | 19 +++++++++---------- drivers/s390/cio/device_pgid.c | 2 +- 2 files changed, 10 insertions(+), 11 deletions(-) Index: quilt-2.6/drivers/s390/cio/device_fsm.c =================================================================== --- quilt-2.6.orig/drivers/s390/cio/device_fsm.c 2009-11-13 16:08:18.000000000 +0100 +++ quilt-2.6/drivers/s390/cio/device_fsm.c 2009-11-13 16:08:19.000000000 +0100 @@ -549,9 +549,8 @@ sch = to_subchannel(cdev->dev.parent); /* Update schib - pom may have changed. */ if (cio_update_schib(sch)) { - cdev->private->flags.donotify = 0; - ccw_device_done(cdev, DEV_STATE_NOT_OPER); - return; + err = -ENODEV; + goto callback; } /* Update lpm with verified path mask. */ sch->lpm = sch->vpm; @@ -561,9 +560,8 @@ ccw_device_verify_start(cdev); return; } +callback: switch (err) { - case -EOPNOTSUPP: /* path grouping not supported, just set online. */ - cdev->private->options.pgroup = 0; case 0: ccw_device_done(cdev, DEV_STATE_ONLINE); /* Deliver fake irb to device driver, if needed. */ @@ -586,14 +584,15 @@ cdev->private->flags.donotify = 0; ccw_device_done(cdev, DEV_STATE_BOXED); break; + case -EACCES: + /* Reset oper notify indication after verify error. */ + cdev->private->flags.donotify = 0; + ccw_device_done(cdev, DEV_STATE_DISCONNECTED); + break; default: /* Reset oper notify indication after verify error. */ cdev->private->flags.donotify = 0; - if (cdev->online) { - ccw_device_set_timeout(cdev, 0); - dev_fsm_event(cdev, DEV_EVENT_NOTOPER); - } else - ccw_device_done(cdev, DEV_STATE_NOT_OPER); + ccw_device_done(cdev, DEV_STATE_NOT_OPER); break; } } Index: quilt-2.6/drivers/s390/cio/device_pgid.c =================================================================== --- quilt-2.6.orig/drivers/s390/cio/device_pgid.c 2009-11-13 15:48:33.000000000 +0100 +++ quilt-2.6/drivers/s390/cio/device_pgid.c 2009-11-13 16:08:19.000000000 +0100 @@ -423,7 +423,7 @@ /* Permanent path failure, try next. */ } /* Done with all paths. */ - ccw_device_verify_done(cdev, (sch->vpm != 0) ? 0 : -ENODEV); + ccw_device_verify_done(cdev, (sch->vpm != 0) ? 0 : -EACCES); } /* -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/