Date: Fri, 26 Feb 1999 09:54:48 -0700 (MST) From: "Kenneth D. Merry" <ken@plutotech.com> To: bfischer@Techfak.Uni-Bielefeld.DE (Bjoern Fischer) Cc: freebsd-scsi@freebsd.org Subject: Re: oddities in CAM/cdrecord/DFLTPHYS Message-ID: <199902261654.JAA51953@panzer.plutotech.com> In-Reply-To: <19990226120433.A285@broccoli.no-support.loc> from Bjoern Fischer at "Feb 26, 1999 12: 4:33 pm"
next in thread | previous in thread | raw e-mail | index | archive | help
Bjoern Fischer wrote... > Hello Kenneth, > > you sent a patch to Joern Schilling changing scsi_maxdma() to return > (DFLTPHYS - PAGESIZE) instead of (DFLTPHYS). Although cdrecord only > works for me with (DFLTPHYS - PAGESIZE), there are some oddities in > either cdrecord's libscg/scsi-bsd.c or in cam/cam_periph.c. cdrecord > uses buffers which are already page aligned, so I don't see the > necessitiy of (DFLTPHYS - PAGESIZE). But looking at the buffer pointer > in cam/cam_periph.c:543 one sees that it has lost it's page alignment. > After the correction the buffer is too large. Is it possible that > the buffer pointer looses it's alignment in kernel space (e.g. by > adding a header or s.t.)? What's a 's.t.'? As far as I know, there's no code in the kernel that manipulates the user-passed-in data pointer. At least not up to that point. Of course we temporarily exchange it for a pointer to the same space mapped into the kernel's virtual address space lower down in cam_periph_mapmem(). Here's what I would suggest: - print out the data pointer that is put into the CCB. This will be sp->addr in scsi_send(). - In the pass driver in the kernel, print out the address that it gets. You'll probably want to print it out in passsendccb(), before and after the xpt_merge_ccb() call. (in sys/cam/scsi/scsi_pass.c) From there the CCB is run through cam_periph_mapmem(). My guess is that the buffer is getting thrown out of page alignment somewhere in cdrecord, but I could be wrong of course. If we are manipulating the pointer, then that probably indicates a bug. :) I told Joerg to use DFLTPHYS - PAGESIZE mainly because cdda2wav was sending in non-page-aligned buffers, which eventually would cause problems. I never did enough testing on cdrecord to conclusively say whether or not he was using page aligned buffers. Anyway, let me know what you find. If there's a bug, in the kernel or in cdrecord, we should get it fixed. Ken -- Kenneth Merry ken@plutotech.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-scsi" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199902261654.JAA51953>