public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: Linux 2.5.3-pre1-aia1
@ 2002-01-21 22:45 Petr Vandrovec
  2002-01-21 23:27 ` Andre Hedrick
  2002-01-22 14:17 ` Denis Vlasenko
  0 siblings, 2 replies; 62+ messages in thread
From: Petr Vandrovec @ 2002-01-21 22:45 UTC (permalink / raw)
  To: Andre Hedrick
  Cc: vojtech, Davide Libenzi, Anton Altaparmakov, Linus Torvalds,
	linux-kernel

I did not want to participate in this discussion, as it is probably
impossible to explain to you that there is nothing wrong with doing
requests not evenly divisible by block size.

On 21 Jan 02 at 13:44, Andre Hedrick wrote:
> On Mon, 21 Jan 2002, Jens Axboe wrote:
> > On Mon, Jan 21 2002, Andre Hedrick wrote:
> > > > I always thought it is like this (and this is what I still believe after
> > > > having read the sprcification):
> > > > 
> > > > ---
> > > > SET_MUTIPLE 16 sectors
> > > > ---
> > > > READ_MULTIPLE 24 sectors
> > > > IRQ
> > > > PIO transfer 16 sectors
> > > > IRQ
> > > > PIO transfer 8 sectors
> > > > ---
> 
> 255 * 512bytes != 128K  BUG
> 256 * 512bytes == 128K
> 
> You insure we will fail on alignemnt.

SET MULTIPLE MODE description says that host should try block size only
1,2,4,8,16,32,64 or 128 sectors. So where you got 255 from?

> You have stated BLOCK can not deal with correct sector alignments, and
> thus 255 so please fix it first.  I have accepted this brokeness in BLOCK
> and dropped to 128 sectors or a clean 64k.
>
> If we restrict multi-sector PIO to 8 sectors we can do multi interrupt
> ATOMIC disk IO on the paging alignments, but you have enforced single
> sector IO in the multi-sector writing and can not see the difference.

Why we cannot do multi-sector PIO with 16...128 sectors? There is no need
to read all data with one insw() loop, you can store each of these
64kB of data in 65536 different, non-continuous, locations, and ATA device
will not complain, as it will always see 32768 of word reads from its
data port, nothing else... And no, there is no requirement that host
must do back-to-back reads or writes from ATA device data port. Otherwise
we would see upper bound on t0 in PIO-in and PIO-out cycles description.

> If rq->current_nr_sectors is less than 8 we do PIO single sector IO, but
> we are doing that now w/ the copy paste changes from the old ide-disk.c
> stuff that we are attempting deleting.

Please tell me what page 168 (it is number of paper page, page number
in PDF is by 14 greater) of Volume 2, Revision 0, of ATA/ATAPI rev.7
(T13/1532D) in description of READ MULTIPLE talks about?

If the number of requested sectors is not evenly divisible by the block
count, as many full blocks as possible are transferred, followed by a final,
partial block transfer. The partial block transfer shall be for n sectors,
where n = remainder (sector count/block count).

And almost identical text appears on page 296, where it talks about
WRITE MULTIPLE. 

If you are trying to persuade us that there are devices which support
ATA interface, and do not follow these paragraphs word by word, there
is certainly something wrong in the ATA world...
                            Best regards,
                                    Petr Vandrovec
                                    vandrove@vc.cvut.cz
                                    

^ permalink raw reply	[flat|nested] 62+ messages in thread
* Re: Linux 2.5.3-pre1-aia1
@ 2002-01-21  4:40 Andre Hedrick
  2002-01-21  6:19 ` Matti Aarnio
  0 siblings, 1 reply; 62+ messages in thread
From: Andre Hedrick @ 2002-01-21  4:40 UTC (permalink / raw)
  To: linux-kernel

vger eats a second one :-(
---------- Forwarded message ----------
Date: Sun, 20 Jan 2002 17:48:29 -0800 (PST)
From: Andre Hedrick <andre@linuxdiskcert.org>
To: Jens Axboe <axboe@suse.de>
Cc: Davide Libenzi <davidel@xmailserver.org>,
     Anton Altaparmakov <aia21@cam.ac.uk>,
     Linus Torvalds <torvalds@transmeta.com>,
     lkml <linux-kernel@vger.kernel.org>
Subject: Re: Linux 2.5.3-pre1-aia1

On Sun, 20 Jan 2002, Jens Axboe wrote:

> On Sat, Jan 19 2002, Andre Hedrick wrote:
> > > On Sat, Jan 19 2002, Andre Hedrick wrote:
> > > > On Sat, 19 Jan 2002, Jens Axboe wrote:
> > > > 
> > > > > On Fri, Jan 18 2002, Davide Libenzi wrote:
> > > > > > Guys, instead of requiring an -m8 to every user that is observing this
> > > > > > problem, isn't it better that you limit it inside the driver until things
> > > > > > gets fixed ?
> > > > > 
> > > > > There is no -m8 limit, 2.5.3-pre1 + ata253p1-2 patch handles any set
> > > > > multi mode value.
> > > > > 
> > > > > -- 
> > > > > Jens Axboe
> > > > > 
> > > > 
> > > > And that will generate the [lost interrupt], and I have it fixed at all
> > > > levels too now.
> > > 
> > > How so? I don't see the problem.
> > 
> > Unlike ATAPI which will generally send you more data than requested on
> > itw own, ATA devices do not like enjoy or play the game.  Additionally the
> 
> Unrelated ATAPI fodder :-)
> 
> > current code asks for 16 sectors, but we do not do the request copy
> > anymore, and this mean for every 4k of paging we are soliciting for 8k.
> 
> The (now) missing copy is unrelated.
> 
> > We only read out 4k thus the device has the the next 4k we may be wanting
> > ready.  Look at it as a dirty prefetch, but eventally the drive is going
> > to want to go south, thus [lost interrupt]
> 
> Even if the drive is programmed for 16 sectors in multi mode, it still
> must honor lower transfer sizes. The fix I did was not to limit this,
> but rather to only setup transfers for the amount of sectors in the
> first chunk. This is indeed necessary now that we do not have a copy of
> the request to fool around with.
> 
> > Basically as the Block maintainer, you pointed out I am restricted to 4k
> > chunking in PIO.  You decided, in the interest of the block glue layer
> > into the driver, to force early end request per Linus's requirements to
> > return back every 4k completed to block regardless of the size of the
> > total data requested.
> 
> Correct. The solution I did (which was one of the two I suggested) is
> still the cleanest, IMHO.
> 
> > For the above two condition to be properly satisfied, I have to adjust
> > and apply one driver policy make the driver behave and give the desired
> > results.  We should note this will conform with future IDEMA proposals
> > being submitted to the T committees.
> 
> I still don't see a description of why this would cause a lost
> interrupt. What is the flaw in my theory and/or code?

We issue a setmultimode command and the driver defaults to maximum or 16
sectors in most cases.  This means the drive is expecting 16 sectors, and
your design is to issue only 8 sectors or less.  The issuing of 8 sectors
or less in the sector_count, while the device is expecting 16 is a setup
for problems.

The effective operations your changes have created without addressing all
the variables is to terminate the command in process.  Therefore, the
decision made by you was to restrict the transfers to be process to the
count in rq->current_nr_sectors.  There is no bounds checking based on the
command executed.

*****************************
The questions to ask "How would the host terminate a command in progress, 
since BSY=1 (or DRQ=1) at this point?   Is that done via a DEVICE_RESET or
SRST write?"

Let me quote "Hale Landis" (one of the Fathers of ATA).

On an ATA device a H/W Reset or S/W reset is required to terminate a
command in progress. Writing to the Command register while BSY=1 or
BSY=0:DRQ=1 is illegal.

On an ATAPI device a H/W Reset or S/W reset or DEVICE RESET is
required to terminate a command in progress (and that includes PACKET
commands). Writing a value other than 08H (DEVICE RESET) to the
Command register while BSY=1 or BSY=0:DRQ=1 is illegal.
*****************************

Now what you have created is an illegal operation.

If the device is expecting a fixed amount of data and you stop it in
mid-stream and do not reset the device and issue a second command for
transfer, expect the device to go south.

If we are going to operate in this mode of brokeness, then let me finish
the change to of the command structure to make the driver work in that
environment.

Regards,

Andre Hedrick
Linux Disk Certification Project                Linux ATA Development




^ permalink raw reply	[flat|nested] 62+ messages in thread
* Re: Linux 2.5.3-pre1-aia1
@ 2002-01-21  4:40 Andre Hedrick
  0 siblings, 0 replies; 62+ messages in thread
From: Andre Hedrick @ 2002-01-21  4:40 UTC (permalink / raw)
  To: linux-kernel

vger eats another one :-(
---------- Forwarded message ----------
Date: Sun, 20 Jan 2002 16:12:36 -0800 (PST)
From: Andre Hedrick <andre@linuxdiskcert.org>
To: Davide Libenzi <davidel@xmailserver.org>
Cc: Jens Axboe <axboe@suse.de>, Anton Altaparmakov <aia21@cam.ac.uk>,
     Linus Torvalds <torvalds@transmeta.com>,
     lkml <linux-kernel@vger.kernel.org>
Subject: Re: Linux 2.5.3-pre1-aia1

On Sun, 20 Jan 2002, Davide Libenzi wrote:

> On Sun, 20 Jan 2002, Jens Axboe wrote:
> 
> > On Sat, Jan 19 2002, Andre Hedrick wrote:
> > > > On Sat, Jan 19 2002, Andre Hedrick wrote:
> > > > > On Sat, 19 Jan 2002, Jens Axboe wrote:
> > > > >
> > > > > > On Fri, Jan 18 2002, Davide Libenzi wrote:
> > > > > > > Guys, instead of requiring an -m8 to every user that is observing this
> > > > > > > problem, isn't it better that you limit it inside the driver until things
> > > > > > > gets fixed ?
> > > > > >
> > > > > > There is no -m8 limit, 2.5.3-pre1 + ata253p1-2 patch handles any set
> > > > > > multi mode value.
> > > > > >
> > > > > > --
> > > > > > Jens Axboe
> > > > > >
> > > > >
> > > > > And that will generate the [lost interrupt], and I have it fixed at all
> > > > > levels too now.
> > > >
> > > > How so? I don't see the problem.
> > >
> > > Unlike ATAPI which will generally send you more data than requested on
> > > itw own, ATA devices do not like enjoy or play the game.  Additionally the
> >
> > Unrelated ATAPI fodder :-)
> >
> > > current code asks for 16 sectors, but we do not do the request copy
> > > anymore, and this mean for every 4k of paging we are soliciting for 8k.
> >
> > The (now) missing copy is unrelated.
> >
> > > We only read out 4k thus the device has the the next 4k we may be wanting
> > > ready.  Look at it as a dirty prefetch, but eventally the drive is going
> > > to want to go south, thus [lost interrupt]
> >
> > Even if the drive is programmed for 16 sectors in multi mode, it still
> > must honor lower transfer sizes. The fix I did was not to limit this,
> > but rather to only setup transfers for the amount of sectors in the
> > first chunk. This is indeed necessary now that we do not have a copy of
> > the request to fool around with.

Listen and for just a second okay.

Since the set multimode command is similar to the set transfer rate, if
you program the drive to run at U100 but the host can feed only U33 you
have problems.  Much of this simple arguement is the same answer for
multimode.

Same thing here but a variation, of the operations,

> > > Basically as the Block maintainer, you pointed out I am restricted to 4k
> > > chunking in PIO.  You decided, in the interest of the block glue layer
> > > into the driver, to force early end request per Linus's requirements to
> > > return back every 4k completed to block regardless of the size of the
> > > total data requested.
> >
> > Correct. The solution I did (which was one of the two I suggested) is
> > still the cleanest, IMHO.

The "cleanest" != techincal correctness, it may be the cleanest for
current infrastructure of BLOCK, but by no means is it techincally
correct.  It is more of the darwinism of hammer a square object into a
round hole.

> > > For the above two condition to be properly satisfied, I have to adjust
> > > and apply one driver policy make the driver behave and give the desired
> > > results.  We should note this will conform with future IDEMA proposals
> > > being submitted to the T committees.
> >
> > I still don't see a description of why this would cause a lost
> > interrupt. What is the flaw in my theory and/or code?

Because you think of the OS as defining the guidelines and the reality is
the hardware defines the rules and the OS has to work around.  I am happy
to allow you to continue to modify the ISR behavor and the command
behavor, and I am willing to be proven wrong.  When the problem does not
go away, I will request we return to the rules of the hardware.  And this
may require a MEMPOOL just like SCSI.

> Guys, i'm sorry to report you bad news but i still get 'lost interrupt'
> with all applied patches ( Anton and Andre ).

Regards,

Andre Hedrick
Linux Disk Certification Project                Linux ATA Development




^ permalink raw reply	[flat|nested] 62+ messages in thread
* Linux 2.5.3-pre1-aia1
@ 2002-01-18  2:27 Anton Altaparmakov
  2002-01-18 17:32 ` Davide Libenzi
  0 siblings, 1 reply; 62+ messages in thread
From: Anton Altaparmakov @ 2002-01-18  2:27 UTC (permalink / raw)
  To: linux-kernel

Since the new IDE core from Andre is now solid as reported by various 
people on IRC, here is my local patch (stable for me) which you can apply 
to play with the shiny new IDE core (IDE core fix is same as 
ata-253p1-2.bz2 from Jens). (-:

Patch available from:

http://www-stu.christs.cam.ac.uk/~aia21/linux/patch-2.5.3-pre1-aia1
http://www-stu.christs.cam.ac.uk/~aia21/linux/patch-2.5.3-pre1-aia1.bz2
http://www-stu.christs.cam.ac.uk/~aia21/linux/patch-2.5.3-pre1-aia1.gz

Linux 2.5.3-pre1-aia1

o       Fix new IDE core                        (Jens Axboe, Andre Hedrick)
+       Configure help entries for IDE          (Andre Hedrick, Rob Radez, me)
+       Reduce NTFS vmalloc use (NTFS 1.1.22)   (me)
o       Compile fixes for dnotify               (me)
o       Compile fixes for via82cxxx             (me)

Patches marked "+" have been submitted to Linus by me already.

Enjoy,

Anton


-- 
   "I've not lost my mind. It's backed up on tape somewhere." - Unknown
-- 
Anton Altaparmakov <aia21 at cam.ac.uk> (replace at with @)
Linux NTFS Maintainer / WWW: http://linux-ntfs.sf.net/
ICQ: 8561279 / WWW: http://www-stu.christs.cam.ac.uk/~aia21/


^ permalink raw reply	[flat|nested] 62+ messages in thread

end of thread, other threads:[~2002-01-22 18:55 UTC | newest]

Thread overview: 62+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-01-21 22:45 Linux 2.5.3-pre1-aia1 Petr Vandrovec
2002-01-21 23:27 ` Andre Hedrick
2002-01-22  7:58   ` Jens Axboe
2002-01-22  8:52     ` Andre Hedrick
2002-01-22 14:17 ` Denis Vlasenko
  -- strict thread matches above, loose matches on Subject: below --
2002-01-21  4:40 Andre Hedrick
2002-01-21  6:19 ` Matti Aarnio
2002-01-21  4:40 Andre Hedrick
2002-01-18  2:27 Anton Altaparmakov
2002-01-18 17:32 ` Davide Libenzi
2002-01-18 19:05   ` Jens Axboe
2002-01-18 19:23     ` Davide Libenzi
2002-01-18 19:28       ` Andre Hedrick
2002-01-18 19:48         ` Davide Libenzi
2002-01-18 19:40           ` Andre Hedrick
2002-01-18 19:44           ` Andre Hedrick
2002-01-19 11:40           ` Jens Axboe
2002-01-19 11:37             ` Andre Hedrick
2002-01-19 15:45               ` Jens Axboe
2002-01-19 20:36                 ` Andre Hedrick
2002-01-19 21:44                   ` Davide Libenzi
2002-01-20  0:31                     ` Andre Hedrick
2002-01-20  2:02                       ` Davide Libenzi
2002-01-20 10:48                   ` Jens Axboe
2002-01-20 18:55                     ` Davide Libenzi
2002-01-21  0:12                       ` Andre Hedrick
2002-01-21 10:43                         ` Vojtech Pavlik
2002-01-21 10:48                           ` Jens Axboe
2002-01-21 10:56                             ` Jens Axboe
2002-01-21 17:44                               ` Davide Libenzi
2002-01-21 11:14                             ` Vojtech Pavlik
2002-01-21 11:29                               ` Jens Axboe
2002-01-21 11:38                                 ` Vojtech Pavlik
2002-01-21 11:51                                   ` Andre Hedrick
2002-01-21 11:34                               ` Andre Hedrick
2002-01-21 17:44                                 ` Jens Axboe
2002-01-21 20:18                                   ` Andre Hedrick
2002-01-21 22:57                                     ` Vojtech Pavlik
2002-01-21 23:53                                       ` Andre Hedrick
2002-01-22  7:20                                         ` Vojtech Pavlik
2002-01-22  7:52                                           ` Andre Hedrick
2002-01-22  8:16                                             ` Jens Axboe
2002-01-22  9:45                                               ` Andre Hedrick
2002-01-22 10:06                                                 ` Jens Axboe
2002-01-22 10:26                                                 ` Anton Altaparmakov
2002-01-22 16:49                                           ` Linus Torvalds
2002-01-22 18:45                                             ` Andre Hedrick
2002-01-21 21:44                                   ` Andre Hedrick
2002-01-22  7:32                                     ` Jens Axboe
2002-01-21 11:22                           ` Andre Hedrick
2002-01-21 11:32                             ` Vojtech Pavlik
2002-01-21 11:34                               ` Jens Axboe
2002-01-21  1:48                     ` Andre Hedrick
2002-01-21  7:36                       ` Jens Axboe
2002-01-21  7:46                         ` Andre Hedrick
2002-01-21  8:01                           ` Jens Axboe
2002-01-21  8:42                             ` Andre Hedrick
2002-01-21  9:00                               ` Jens Axboe
2002-01-21  8:59                                 ` Andre Hedrick
2002-01-21  9:07                                   ` Jens Axboe
2002-01-21  9:48                                     ` Andre Hedrick
2002-01-18 19:26   ` Andre Hedrick

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox