diff options
author | Alan Perry <Alan.Perry@Sun.COM> | 2009-02-11 09:51:34 -0800 |
---|---|---|
committer | Alan Perry <Alan.Perry@Sun.COM> | 2009-02-11 09:51:34 -0800 |
commit | 8c067cfd3aea0c49a166f9fb38114b56a9160ac6 (patch) | |
tree | 35a2709acf393c154eca809576a4549dd2a4d471 /usr/src | |
parent | 46c97f97ecb940ad28084dff5cb62f2f5f52d982 (diff) | |
download | illumos-gate-8c067cfd3aea0c49a166f9fb38114b56a9160ac6.tar.gz |
6445725 newfs / zpool create on firewire device hangs the OS
6448149 TEST_UNIT_READY / START_STOP_UNIT command doesn't work with 1394 optical device
Contributed by Juergen Keil <jk@tools.de>
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/uts/common/io/1394/targets/scsa1394/hba.c | 8 | ||||
-rw-r--r-- | usr/src/uts/common/io/1394/targets/scsa1394/sbp2_driver.c | 6 | ||||
-rw-r--r-- | usr/src/uts/common/io/sbp2/sbp2.c | 15 | ||||
-rw-r--r-- | usr/src/uts/common/sys/sbp2/common.h | 12 |
4 files changed, 25 insertions, 16 deletions
diff --git a/usr/src/uts/common/io/1394/targets/scsa1394/hba.c b/usr/src/uts/common/io/1394/targets/scsa1394/hba.c index 4569fc1e18..463c749479 100644 --- a/usr/src/uts/common/io/1394/targets/scsa1394/hba.c +++ b/usr/src/uts/common/io/1394/targets/scsa1394/hba.c @@ -19,7 +19,7 @@ * CDDL HEADER END */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ @@ -1094,6 +1094,10 @@ scsa1394_probe_g0_nodata(struct scsi_device *sd, int (*waitfunc)(), if (scsa1394_probe_tran(pkt) < 0) { if (pkt->pkt_reason == CMD_INCOMPLETE) { ret = SCSIPROBE_NORESP; + } else if ((pkt->pkt_reason == CMD_TRAN_ERR) && + ((*(pkt->pkt_scbp) & STATUS_MASK) == STATUS_CHECK) && + (pkt->pkt_state & STATE_ARQ_DONE)) { + ret = SCSIPROBE_EXISTS; } else { ret = SCSIPROBE_FAILURE; } @@ -1994,7 +1998,7 @@ scsa1394_scsi_start(struct scsi_address *ap, struct scsi_pkt *pkt) scsa1394_sbp2_cmd2orb(lp, cmd); /* convert into ORB */ - if ((ret = scsa1394_sbp2_start(lp, cmd)) != DDI_SUCCESS) { + if ((ret = scsa1394_sbp2_start(lp, cmd)) != TRAN_BUSY) { scsa1394_sbp2_nudge(lp); } diff --git a/usr/src/uts/common/io/1394/targets/scsa1394/sbp2_driver.c b/usr/src/uts/common/io/1394/targets/scsa1394/sbp2_driver.c index 9fd35389a7..78cec59166 100644 --- a/usr/src/uts/common/io/1394/targets/scsa1394/sbp2_driver.c +++ b/usr/src/uts/common/io/1394/targets/scsa1394/sbp2_driver.c @@ -19,12 +19,10 @@ * CDDL HEADER END */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * 1394 mass storage SBP-2 driver routines */ @@ -626,7 +624,7 @@ scsa1394_sbp2_start(scsa1394_lun_t *lp, scsa1394_cmd_t *cmd) ret = sbp2_ses_submit_task(lp->l_ses, task); - if (ret == SBP2_SUCCESS) { + if ((ret == SBP2_SUCCESS) || (ret == SBP2_ECONTEXT)) { return (TRAN_ACCEPT); } if (task->ts_error == SBP2_TASK_ERR_BUS) { if (task->ts_bus_error == CMD1394_EDEVICE_BUSY) { diff --git a/usr/src/uts/common/io/sbp2/sbp2.c b/usr/src/uts/common/io/sbp2/sbp2.c index ddacbe2f0f..ff318d11f4 100644 --- a/usr/src/uts/common/io/sbp2/sbp2.c +++ b/usr/src/uts/common/io/sbp2/sbp2.c @@ -19,12 +19,10 @@ * CDDL HEADER END */ /* - * Copyright 2008 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ -#pragma ident "%Z%%M% %I% %E% SMI" - /* * SBP2 module */ @@ -32,6 +30,7 @@ #include <sys/errno.h> #include <sys/cred.h> #include <sys/conf.h> +#include <sys/disp.h> #include <sys/modctl.h> #include <sys/stat.h> #include <sys/stream.h> @@ -904,6 +903,16 @@ sbp2_ses_submit_task(sbp2_ses_t *sp, sbp2_task_t *new_task) return (SBP2_SUCCESS); } + /* + * cannot submit tasks from interrupt context, + * upper layer driver is responsible to call nudge + */ + if (servicing_interrupt()) { + mutex_exit(&ap->a_mutex); + sbp2_agent_release(ap); + return (SBP2_ECONTEXT); + } + /* no active task, grab the first one on the list in INIT state */ ap->a_active_task = sbp2_ses_find_task_state(sp, SBP2_TASK_INIT); if (ap->a_active_task == NULL) { diff --git a/usr/src/uts/common/sys/sbp2/common.h b/usr/src/uts/common/sys/sbp2/common.h index 99b1f8fc3f..c4abc6155b 100644 --- a/usr/src/uts/common/sys/sbp2/common.h +++ b/usr/src/uts/common/sys/sbp2/common.h @@ -2,9 +2,8 @@ * CDDL HEADER START * * The contents of this file are subject to the terms of the - * Common Development and Distribution License, Version 1.0 only - * (the "License"). You may not use this file except in compliance - * with the License. + * Common Development and Distribution License (the "License"). + * You may not use this file except in compliance with the License. * * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE * or http://www.opensolaris.org/os/licensing. @@ -20,15 +19,13 @@ * CDDL HEADER END */ /* - * Copyright 2005 Sun Microsystems, Inc. All rights reserved. + * Copyright 2009 Sun Microsystems, Inc. All rights reserved. * Use is subject to license terms. */ #ifndef _SYS_SBP2_COMMON_H #define _SYS_SBP2_COMMON_H -#pragma ident "%Z%%M% %I% %E% SMI" - /* * Serial Bus Protocol 2 (SBP-2) common definitions */ @@ -127,7 +124,8 @@ enum { SBP2_EALREADY = 9, /* already exists/completed/etc */ SBP2_ESTALE = 10, /* stale login session */ SBP2_EDATA = 11, /* bad/corrupted data */ - SBP2_ENODEV = 12 /* device not there */ + SBP2_ENODEV = 12, /* device not there */ + SBP2_ECONTEXT = 13 /* bad context for I/O operation */ }; #ifdef __cplusplus |