From owner-freebsd-hackers@FreeBSD.ORG Wed Jan 28 17:21:23 2009 Return-Path: Delivered-To: hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 64B181065680 for ; Wed, 28 Jan 2009 17:21:23 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 21BC48FC17 for ; Wed, 28 Jan 2009 17:21:23 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.2/8.14.1) with ESMTP id n0SHIdHM006539; Wed, 28 Jan 2009 10:18:39 -0700 (MST) (envelope-from imp@bsdimp.com) Date: Wed, 28 Jan 2009 10:19:00 -0700 (MST) Message-Id: <20090128.101900.1355775961.imp@bsdimp.com> To: keramida@ceid.upatras.gr From: "M. Warner Losh" In-Reply-To: <87d4e7e4y0.fsf@kobe.laptop> References: <20090128.092046.84362525.imp@bsdimp.com> <87mydbiecp.fsf@kobe.laptop> <87d4e7e4y0.fsf@kobe.laptop> X-Mailer: Mew version 5.2 on Emacs 21.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: hackers@freebsd.org Subject: Re: Code review request: cdcontrol status label additon X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 28 Jan 2009 17:21:23 -0000 In message: <87d4e7e4y0.fsf@kobe.laptop> Giorgos Keramidas writes: : On Wed, 28 Jan 2009 18:29:10 +0200, Giorgos Keramidas wrote: : > On Wed, 28 Jan 2009 09:20:46 -0700 (MST), "M. Warner Losh" wrote: : >> Not going to look at glabel for this. I lifted the code from glable, : >> but must have done it badly. I'll grab a core 10 cd and see what's up. : > : > It may not be Fedora specific. I just happened to have it handy... : > : > Sorry for creating *more* work for you. I'll see if I can hack at : > cdcontrol too, and provide more useful input :) : : If it helps at all, I added this: : : lseek(fd, ISO9660_OFFSET, SEEK_SET); : rc = read (fd, buffer, CD_SECTOR_LEN); : + if (rc == -1) : + err(1, "read"); : if (rc == CD_SECTOR_LEN && : memcmp(buffer, ISO9660_MAGIC, sizeof(ISO9660_MAGIC) - 1) == 0) { : : and it seems that read() fails with EIO: : : lseek(3,0x8000,SEEK_SET) = 32768 (0x8000) : read(3,0xbfbfe3a3,2048) ERR#5 'Input/output error' OK. That's definitely not page aligned. : My `/var/log/messages' shows at the same time: : : Jan 28 19:01:52 kobe kernel: acd0: FAILURE - non aligned DMA transfer attempted : Jan 28 19:01:52 kobe kernel: acd0: setting up DMA failed ???? I have no clue what this means. I'll have to investigate. Chances are that your hardware has limitations on where DMA can come from and no provisions in the acd driver to bounce them (likely a reasonable performance thing). This likely means that I'll have to malloc the buffer to get it page aligned... Warner