Received: by mail.netbsd.org (Postfix, from userid 605) id 542E219CF3D; Mon, 10 Jan 2011 11:18:17 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id B450719CF17 for ; Mon, 10 Jan 2011 11:18:16 +0000 (UTC) X-Virus-Scanned: amavisd-new at NetBSD.org Received: from mail.netbsd.org ([127.0.0.1]) by localhost (mail.NetBSD.org [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id Dh7wa+Aj1HO6 for ; Mon, 10 Jan 2011 11:18:15 +0000 (UTC) Received: from cvs.netbsd.org (cvs.NetBSD.org [IPv6:2001:4f8:3:7:2e0:81ff:fe30:95bd]) by mail.netbsd.org (Postfix) with ESMTP id AB4B119CF15 for ; Mon, 10 Jan 2011 11:18:15 +0000 (UTC) Received: by cvs.netbsd.org (Postfix, from userid 500) id 7BCCC175DD; Mon, 10 Jan 2011 11:18:15 +0000 (UTC) MIME-Version: 1.0 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Date: Mon, 10 Jan 2011 11:18:15 +0000 From: "Izumi Tsutsui" Subject: CVS commit: src/sys/dev/ic To: source-changes@NetBSD.org X-Mailer: log_accum Message-Id: <20110110111815.7BCCC175DD@cvs.netbsd.org> Sender: source-changes-owner@NetBSD.org List-Id: source-changes.NetBSD.org Precedence: bulk Reply-To: source-changes-d@NetBSD.org Mail-Reply-To: "Izumi Tsutsui" Mail-Followup-To: source-changes-d@NetBSD.org Module Name: src Committed By: tsutsui Date: Mon Jan 10 11:18:15 UTC 2011 Modified Files: src/sys/dev/ic: ahcisata_core.c Log Message: Don't call bus_dmamap_load(9) and bus_dmamap_sync(9) on command xfers if (AT_READ|AT_WRITE) in ata_c->flags is set but ata_c->bcount is zero. Someone actually tries to put such a command and it causes DIAGNOSTIC panic in x86/bus_dma.c:_bus_dmamap_sync(). I think bus_dma(9) API itself may allow calls with mapsize==0 but there are many MD code that asserts offset>=mapsize or len==0. The problem is reported and fix is confirmed by Takuro KUBOTA with XEN DOM0 kernel (which has options DIAGNOSTIC). To generate a diff of this commit: cvs rdiff -u -r1.30 -r1.31 src/sys/dev/ic/ahcisata_core.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.