From owner-freebsd-current@FreeBSD.ORG Wed Dec 5 17:21:19 2012 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 116EC4A2 for ; Wed, 5 Dec 2012 17:21:19 +0000 (UTC) (envelope-from jim.harris@gmail.com) Received: from mail-wi0-f174.google.com (mail-wi0-f174.google.com [209.85.212.174]) by mx1.freebsd.org (Postfix) with ESMTP id 8D9BC8FC14 for ; Wed, 5 Dec 2012 17:21:18 +0000 (UTC) Received: by mail-wi0-f174.google.com with SMTP id hm9so1897406wib.13 for ; Wed, 05 Dec 2012 09:21:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=AlnBixa2fcdGHcBnJTuj8bBe24GNdeo2GqrrQSzrVlc=; b=b86zRarhcVjoI6v9DAMgrEjJsXjGR4ygGqKUCr9XpL/yeBSZ+6s3tTd5R4uN6qgLMO XVSKDWEM9n3OiIcPLd0RYWAuLPL7+k+T7MezIuUg1j/VHRgmhqcwwri2BhWfC7kfV5Ak BnV/YZZH4M4EPIjM2ch3gRx9UwZK+SuwVnaqwHYDb5YVkGgBrffJMGVUPWZeM4GiVukF cjemDvkiYcOmTchhCYWR89jsb7tJUcMbS8Z9vgDN+YxO3xRpuZ3K4Mw6WPbzhYYS+yY0 6ohb8/s+jpOAgejO6k5ZyfSOwqgfOCRxsAmcNCqVVtCTFUezx8QYgg9Kz/UtFinTOUC4 Fyuw== MIME-Version: 1.0 Received: by 10.180.109.132 with SMTP id hs4mr4498323wib.1.1354728077185; Wed, 05 Dec 2012 09:21:17 -0800 (PST) Received: by 10.217.57.4 with HTTP; Wed, 5 Dec 2012 09:21:17 -0800 (PST) In-Reply-To: References: Date: Wed, 5 Dec 2012 10:21:17 -0700 Message-ID: Subject: Re: Call for testers, users with scsi cards From: Jim Harris To: Jeff Roberson Content-Type: text/plain; charset=ISO-8859-1 X-Content-Filtered-By: Mailman/MimeDel 2.1.14 Cc: current@freebsd.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 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: Wed, 05 Dec 2012 17:21:19 -0000 On Tue, Dec 4, 2012 at 2:36 PM, Jeff Roberson wrote: > http://people.freebsd.org/~**jeff/loadccb.diff > > This patch consolidates all of the functions that map cam control blocks > for DMA into one central function. This change is a precursor to adding > new features to the I/O stack. It is mostly mechanical. If you are > running current on a raid or scsi card, especially if it is a lesser used > one, I would really like you to apply this patch and report back any > problems. If it works you should notice nothing. If it doesn't work you > will probably panic immediately on I/O or otherwise no I/O will happen. > > Hi Jeff, This patch breaks both ahci and isci on my system. I still need to root cause the isci panic, but I have some details on ahci. Fatal trap 12: page fault while in kernel mode cpuid = 0; apic id = 00 fault virtual address = 0x6c fault code = supervisor read data, page not present instruction pointer = 0x20:0xffffffff80314f98 stack pointer = 0x28:0xffffff884433a130 frame pointer = 0x28:0xffffff884433a1d0 code segment = base 0x0, limit 0xfffff, type 0x1b = DPL 0, pres 1, long 1, def32 0, gran 1 processor eflags = interrupt enabled, resume, IOPL = 0 current process = 4 (xpt_thrd) [ thread pid 4 tid 100174 ] Stopped at ahci_dmasetprd+0xb8: movl 0x6c(%rcx),%eax db> bt Tracing pid 4 tid 100174 td 0xfffffe002c080480 ahci_dmasetprd() at ahci_dmasetprd+0xb8/frame 0xffffff884433a1d0 bus_dmamap_load() at bus_dmamap_load+0x91/frame 0xffffff884433a230 bus_dmamap_load_ccb() at bus_dmamap_load_ccb+0xf0/frame 0xffffff884433a280 ahci_dmasetprd() at ahci_dmasetprd+0x82e/frame 0xffffff884433a320 bus_dmamap_load_ccb() at bus_dmamap_load_ccb+0x3b/frame 0xffffff884433a370 ahciaction() at ahciaction+0x7d4/frame 0xffffff884433a3b0 xpt_run_dev_sendq() at xpt_run_dev_sendq+0x2a1/frame 0xffffff884433a3f0 xpt_action_default() at xpt_action_default+0x10bd/frame 0xffffff884433a480 probestart() at probestart+0x1e5/frame 0xffffff884433a5d0 xpt_run_dev_allocq() at xpt_run_dev_allocq+0x192/frame 0xffffff884433a610 proberegister() at proberegister+0xf9/frame 0xffffff884433a630 cam_periph_alloc() at cam_periph_alloc+0x571/frame 0xffffff884433a710 ata_scan_lun() at ata_scan_lun+0x147/frame 0xffffff884433a920 ata_scan_bus() at ata_scan_bus+0x2c0/frame 0xffffff884433aa40 xpt_scanner_thread() at xpt_scanner_thread+0x161/frame 0xffffff884433aa70 fork_exit() at fork_exit+0x9a/frame 0xffffff884433aab0 fork_trampoline() at fork_trampoline+0xe/frame 0xffffff884433aab0 The following patch to ahci.c works, but hopefully someone more familiar with ahci can chime in. Index: sys/dev/ahci/ahci.c =================================================================== --- sys/dev/ahci/ahci.c (revision 243900) +++ sys/dev/ahci/ahci.c (working copy) @@ -1669,19 +1669,9 @@ slot->dma.nsegs = 0; /* If request moves data, setup and load SG list */ if ((ccb->ccb_h.flags & CAM_DIR_MASK) != CAM_DIR_NONE) { - void *buf; - bus_size_t size; - slot->state = AHCI_SLOT_LOADING; - if (ccb->ccb_h.func_code == XPT_ATA_IO) { - buf = ccb->ataio.data_ptr; - size = ccb->ataio.dxfer_len; - } else { - buf = ccb->csio.data_ptr; - size = ccb->csio.dxfer_len; - } - bus_dmamap_load(ch->dma.data_tag, slot->dma.data_map, - buf, size, ahci_dmasetprd, slot, 0); + bus_dmamap_load_ccb(ch->dma.data_tag, slot->dma.data_map, ccb, + ahci_dmasetprd, slot, 0); } else ahci_execute_transaction(slot); } -Jim