From owner-freebsd-current@FreeBSD.ORG Thu May 22 08:51:09 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id E229037B401 for ; Thu, 22 May 2003 08:51:09 -0700 (PDT) Received: from mail.sandvine.com (sandvine.com [199.243.201.138]) by mx1.FreeBSD.org (Postfix) with ESMTP id EE0ED43F3F for ; Thu, 22 May 2003 08:51:08 -0700 (PDT) (envelope-from don@sandvine.com) Received: by mail.sandvine.com with Internet Mail Service (5.5.2653.19) id ; Thu, 22 May 2003 11:51:07 -0400 Message-ID: From: Don Bowman To: 'Gavin Atkinson' , current@freebsd.org Date: Thu, 22 May 2003 11:51:07 -0400 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain; charset="iso-8859-1" Subject: RE: GEOM panic on boot when ahd cannot find disk X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 22 May 2003 15:51:10 -0000 From: Gavin Atkinson [mailto:gavin@ury.york.ac.uk] > On Thu, 22 May 2003, Gavin Atkinson wrote: > > > The system fails to detect the drive (a Fujitsu MAP3367NC) > attached to an > > Adaptec AIC7902 controller, > > As a follow up to this, 4.8-STABLE-20030522-JPSNAP detects > the controller > and SCSI drive correctly. > > Gavin There is a bug in the AIC7xxx driver which will cause this behaviour. I received a patch from justin gibbs, which he indicated he was going to commit. I've attached the patch below, this can be applied against the CURRENT aic7xxx driver, and then that can be pulled into 4.8 directly. ==== //depot/aic7xxx/aic7xxx/aic79xx.c#191 - /usr/src/sys/dev/aic7xxx/aic79xx.c ==== *** /tmp/tmp.537.0 Thu May 15 19:29:44 2003 --- /usr/src/sys/dev/aic7xxx/aic79xx.c Thu May 15 19:22:02 2003 *************** *** 5722,5727 **** --- 5722,5728 ---- next_scb->sg_list = segs; next_scb->sense_data = sense_data; next_scb->sense_busaddr = sense_busaddr; + memset(hscb, 0, sizeof(*hscb)); next_scb->hscb = hscb; hscb->hscb_busaddr = ahd_htole32(hscb_busaddr); *************** *** 8279,8286 **** download_consts[PKT_OVERRUN_BUFOFFSET] = (ahd->overrun_buf - (uint8_t *)ahd->qoutfifo) / 256; download_consts[SCB_TRANSFER_SIZE] = SCB_TRANSFER_SIZE_1BYTE_LUN; - if ((ahd->bugs & AHD_PKT_LUN_BUG) != 0) - download_consts[SCB_TRANSFER_SIZE] = SCB_TRANSFER_SIZE_FULL_LUN; cur_patch = patches; downloaded = 0; skip_addr = 0; --- 8280,8285 ---- ==== //depot/aic7xxx/aic7xxx/aic79xx.seq#92 - /usr/src/sys/dev/aic7xxx/aic79xx.seq ==== *** /tmp/tmp.537.1 Thu May 15 19:29:44 2003 --- /usr/src/sys/dev/aic7xxx/aic79xx.seq Thu May 15 19:16:55 2003 *************** *** 261,266 **** --- 261,275 ---- clr A; add CMDS_PENDING, 1; adc CMDS_PENDING[1], A; + if ((ahd->bugs & AHD_PKT_LUN_BUG) != 0) { + /* + * "Short Luns" are not placed into outgoing LQ + * packets in the correct byte order. Use a full + * sized lun field instead and fill it with the + * one byte of lun information we support. + */ + mov SCB_PKT_LUN[6], SCB_LUN; + } /* * The FIFO use count field is shared with the * tag set by the host so that our SCB dma engine ==== //depot/aic7xxx/aic7xxx/aic79xx_inline.h#48 - /usr/src/sys/dev/aic7xxx/aic79xx_inline.h ==== *** /tmp/tmp.537.2 Thu May 15 19:29:44 2003 --- /usr/src/sys/dev/aic7xxx/aic79xx_inline.h Thu May 15 19:09:49 2003 *************** *** 272,281 **** if ((scb->flags & SCB_PACKETIZED) != 0) { /* XXX what about ACA?? It is type 4, but TAG_TYPE == 0x3. */ scb->hscb->task_attribute= scb->hscb->control & SCB_TAG_TYPE; - /* - * For Rev A short lun workaround. - */ - scb->hscb->pkt_long_lun[6] = scb->hscb->lun; } if (scb->hscb->cdb_len <= MAX_CDB_LEN_WITH_SENSE_ADDR --- 272,277 ----