From owner-p4-projects@FreeBSD.ORG Tue Jun 2 20:56:55 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 439BD1065672; Tue, 2 Jun 2009 20:56:55 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0395F106564A for ; Tue, 2 Jun 2009 20:56:55 +0000 (UTC) (envelope-from mav@freebsd.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id E5DE88FC1C for ; Tue, 2 Jun 2009 20:56:54 +0000 (UTC) (envelope-from mav@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n52KusPf011651 for ; Tue, 2 Jun 2009 20:56:54 GMT (envelope-from mav@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n52Kus3j011649 for perforce@freebsd.org; Tue, 2 Jun 2009 20:56:54 GMT (envelope-from mav@freebsd.org) Date: Tue, 2 Jun 2009 20:56:54 GMT Message-Id: <200906022056.n52Kus3j011649@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to mav@freebsd.org using -f From: Alexander Motin To: Perforce Change Reviews Cc: Subject: PERFORCE change 163376 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Jun 2009 20:56:56 -0000 http://perforce.freebsd.org/chv.cgi?CH=163376 Change 163376 by mav@mav_mavbook on 2009/06/02 20:56:08 Report absent drive via CAM_SEL_TIMEOUT error on any command, same as SCSI. ATA unable to determine that error type so fast, so use scan info for this. Affected files ... .. //depot/projects/scottl-camlock/src/sys/dev/ahci/ahci.c#11 edit Differences ... ==== //depot/projects/scottl-camlock/src/sys/dev/ahci/ahci.c#11 (text+ko) ==== @@ -1668,6 +1668,12 @@ /* Common cases first */ case XPT_ATA_IO: /* Execute the requested I/O operation */ case XPT_SCSI_IO: + if ((((ATA_ATA_MASTER | ATA_ATAPI_MASTER) << + ccb->ccb_h.target_id) & ch->devices) == 0) { + ccb->ccb_h.status = CAM_SEL_TIMEOUT; + xpt_done(ccb); + break; + } ahci_begin_transaction(ch->dev, ccb); break; case XPT_EN_LUN: /* Enable LUN as a target */ @@ -1744,10 +1750,6 @@ { struct ccb_pathinq *cpi = &ccb->cpi; - if (ccb->ccb_h.target_id == CAM_TARGET_WILDCARD || - (((ATA_ATA_MASTER | ATA_ATAPI_MASTER) << - ccb->ccb_h.target_id) & ch->devices)) { - cpi->version_num = 1; /* XXX??? */ cpi->hba_inquiry = PI_SDTR_ABLE | PI_TAG_ABLE; cpi->target_sprt = 0; @@ -1764,15 +1766,12 @@ cpi->unit_number = cam_sim_unit(sim); cpi->transport = XPORT_ATA; cpi->transport_version = 2; - if ((ATA_ATA_MASTER << ccb->ccb_h.target_id) & ch->devices) + if ((ATA_ATAPI_MASTER << ccb->ccb_h.target_id) & ch->devices) + cpi->protocol = PROTO_SCSI; + else cpi->protocol = PROTO_ATA; - else - cpi->protocol = PROTO_SCSI; cpi->protocol_version = SCSI_REV_2; cpi->ccb_h.status = CAM_REQ_CMP; - } else { - ccb->ccb_h.status = CAM_REQ_INVALID; - } xpt_done(ccb); break; }