From mboxrd@z Thu Jan 1 00:00:00 1970 From: Douglas Gilbert Subject: Re: Bugs on Linux 2.6.18-rc2 sg code? Date: Mon, 28 Aug 2006 18:11:56 -0400 Message-ID: <44F36A2C.7010806@torque.net> References: <8202f4270608101843r7df002d2l40e03eca3271b050@mail.gmail.com> <44E6388D.1000206@torque.net> <44E68F76.4010702@torque.net> <8202f4270608281412s2da23a52jfa0d2c4b73099587@mail.gmail.com> Reply-To: dougg@torque.net Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: Received: from pentafluge.infradead.org ([213.146.154.40]:28806 "EHLO pentafluge.infradead.org") by vger.kernel.org with ESMTP id S964770AbWH1WMC (ORCPT ); Mon, 28 Aug 2006 18:12:02 -0400 In-Reply-To: <8202f4270608281412s2da23a52jfa0d2c4b73099587@mail.gmail.com> Sender: linux-scsi-owner@vger.kernel.org List-Id: linux-scsi@vger.kernel.org To: Fajun Chen Cc: linux-scsi@vger.kernel.org Fajun Chen wrote: > Hi Doug, > > Forgot to report this. I've tested your patch and it works. Fajun, That is good to hear as that patch appeared in lk 2.6.18-rc5 today. Doug Gilbert > On 8/18/06, Douglas Gilbert wrote: >> Douglas Gilbert wrote: >> > Fajun Chen wrote: >> >> Hi Folks, >> >> >> >> I use ATA pass through via sg ioctl interface for data read/write. >> >> Linux 2.6.18-rc2 patched with Jeff Garzik's libata git patch was >> >> running on ARM IOP80321 board. The HBA Sil3124 was used. >> >> >> >> Two problems were observed: >> >> 1. sg mmap bug? >> >> My test program could not write data correctly to the mmapped >> >> buffer in the user space. The program did a read immediately >> >> after a write and the data mismatches. Swapped the sg_vma_nopage() >> >> function with the one in 2.6.15.4 release fixed the problem. So this >> >> appears to be a wrong change to the sg mmap code in 2.6.18-rc2 >> >> release. >> > >> > Thanks for the report. I can confirm that mmap-ed IO >> > in the sg driver is broken. Simply reading 16 blocks >> > from some arbitrary offset with sg_dd and sgm_dd >> > and comparing the fetched data shows mismatches starting >> > above the first page (i.e. above byte offset 4096 on >> > i386). >> > >> > Your point about the change to sg_vma_nopage() between >> > lk 2.6.15 and lk 2.6.16 also seems to be correct. >> > The most indented part of that function has been >> > changed from incrementing the change count on the >> > reported page (as indicated by 'offset') in a >> > compound page allocation to ignoring the 'offset' >> > and incrementing the page count on the first page >> > in a compound page allocation. >> >> Fajun, >> Could you please try the patch below and report if it fixes >> your sg mmap problem. The patch is against lk 2.6.18-rc4 >> and I assume it will apply against "rc2" as well. >> The patch re-instates the former logic and fixes the >> problem in my tests. >> >> Doug Gilbert >> >> >> >