* [PATCH] 2.5.14 IDE CD-ROM PIO mode
@ 2002-05-07 8:51 Osamu Tomita
2002-05-07 9:57 ` Martin Dalecki
0 siblings, 1 reply; 6+ messages in thread
From: Osamu Tomita @ 2002-05-07 8:51 UTC (permalink / raw)
To: Martin Dalecki; +Cc: linux-kernel
I could not use CD-ROM drive [PIO mode] on 2.5.14.
Error messeges are follows.
May 7 11:05:03 sarah kernel: hdc: cdrom_read_intr: data underrun (4294967292 blocks)
May 7 11:05:03 sarah kernel: end_request: I/O error, dev 16:00, sector 92
May 7 11:05:03 sarah kernel: Buffer I/O error on device ide1(22,0), logical block 22
This patch works fine for me. Please check it.
--- linux/drivers/ide/ide-cd.c.orig Mon May 6 12:38:01 2002
+++ linux/drivers/ide/ide-cd.c Tue May 7 16:43:51 2002
@@ -962,7 +962,7 @@
/* First, figure out if we need to bit-bucket
any of the leading sectors. */
- nskip = MIN(rq->current_nr_sectors - bio_sectors(rq->bio), sectors_to_transfer);
+ nskip = MIN((int)(rq->current_nr_sectors - bio_sectors(rq->bio)), sectors_to_transfer);
while (nskip > 0) {
/* We need to throw away a sector. */
--
Osamu Tomita
E-mail: tomita@cinet.co.jp
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] 2.5.14 IDE CD-ROM PIO mode
2002-05-07 8:51 [PATCH] 2.5.14 IDE CD-ROM PIO mode Osamu Tomita
@ 2002-05-07 9:57 ` Martin Dalecki
2002-05-07 11:41 ` Christoph Hellwig
0 siblings, 1 reply; 6+ messages in thread
From: Martin Dalecki @ 2002-05-07 9:57 UTC (permalink / raw)
To: Osamu Tomita; +Cc: linux-kernel
Uz.ytkownik Osamu Tomita napisa?:
> I could not use CD-ROM drive [PIO mode] on 2.5.14.
> Error messeges are follows.
>
> May 7 11:05:03 sarah kernel: hdc: cdrom_read_intr: data underrun (4294967292 blocks)
> May 7 11:05:03 sarah kernel: end_request: I/O error, dev 16:00, sector 92
> May 7 11:05:03 sarah kernel: Buffer I/O error on device ide1(22,0), logical block 22
>
> This patch works fine for me. Please check it.
Indeed this makes very much of sense. I will take it.
How did you see it "hawkeye"?
> --- linux/drivers/ide/ide-cd.c.orig Mon May 6 12:38:01 2002
> +++ linux/drivers/ide/ide-cd.c Tue May 7 16:43:51 2002
> @@ -962,7 +962,7 @@
>
> /* First, figure out if we need to bit-bucket
> any of the leading sectors. */
> - nskip = MIN(rq->current_nr_sectors - bio_sectors(rq->bio), sectors_to_transfer);
> + nskip = MIN((int)(rq->current_nr_sectors - bio_sectors(rq->bio)), sectors_to_transfer);
>
> while (nskip > 0) {
> /* We need to throw away a sector. */
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH] 2.5.14 IDE CD-ROM PIO mode
2002-05-07 9:57 ` Martin Dalecki
@ 2002-05-07 11:41 ` Christoph Hellwig
2002-05-07 10:42 ` Martin Dalecki
0 siblings, 1 reply; 6+ messages in thread
From: Christoph Hellwig @ 2002-05-07 11:41 UTC (permalink / raw)
To: Martin Dalecki; +Cc: Osamu Tomita, linux-kernel
On Tue, May 07, 2002 at 11:57:20AM +0200, Martin Dalecki wrote:
> > @@ -962,7 +962,7 @@
> >
> > /* First, figure out if we need to bit-bucket
> > any of the leading sectors. */
> > - nskip = MIN(rq->current_nr_sectors - bio_sectors(rq->bio), sectors_to_transfer);
> > + nskip = MIN((int)(rq->current_nr_sectors - bio_sectors(rq->bio)), sectors_to_transfer);
What about a s/MIN/min/g in the idea driver to easily catch such bugs?
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] 2.5.14 IDE CD-ROM PIO mode
2002-05-07 11:41 ` Christoph Hellwig
@ 2002-05-07 10:42 ` Martin Dalecki
2002-05-07 14:29 ` Bartlomiej Zolnierkiewicz
0 siblings, 1 reply; 6+ messages in thread
From: Martin Dalecki @ 2002-05-07 10:42 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: Osamu Tomita, linux-kernel
Uz.ytkownik Christoph Hellwig napisa?:
> On Tue, May 07, 2002 at 11:57:20AM +0200, Martin Dalecki wrote:
>
>>>@@ -962,7 +962,7 @@
>>>
>>> /* First, figure out if we need to bit-bucket
>>> any of the leading sectors. */
>>>- nskip = MIN(rq->current_nr_sectors - bio_sectors(rq->bio), sectors_to_transfer);
>>>+ nskip = MIN((int)(rq->current_nr_sectors - bio_sectors(rq->bio)), sectors_to_transfer);
>>
>
> What about a s/MIN/min/g in the idea driver to easily catch such bugs?
Good idea partially already implemented :-).
At least the generic code and the host chip driver code are alread
switched to using those "chatch them" macros.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] 2.5.14 IDE CD-ROM PIO mode
2002-05-07 10:42 ` Martin Dalecki
@ 2002-05-07 14:29 ` Bartlomiej Zolnierkiewicz
2002-05-07 13:51 ` Martin Dalecki
0 siblings, 1 reply; 6+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2002-05-07 14:29 UTC (permalink / raw)
To: Martin Dalecki; +Cc: Christoph Hellwig, Osamu Tomita, linux-kernel
while we are here, I think that drivers shouldn't take
requests < hardsect_size, it should be handled by block layer
requests On Tue, 7 May 2002, Martin Dalecki wrote:
> Uz.ytkownik Christoph Hellwig napisa?:
> > On Tue, May 07, 2002 at 11:57:20AM +0200, Martin Dalecki wrote:
> >
> >>>@@ -962,7 +962,7 @@
> >>>
> >>> /* First, figure out if we need to bit-bucket
> >>> any of the leading sectors. */
> >>>- nskip = MIN(rq->current_nr_sectors - bio_sectors(rq->bio), sectors_to_transfer);
> >>>+ nskip = MIN((int)(rq->current_nr_sectors - bio_sectors(rq->bio)), sectors_to_transfer);
> >>
> >
> > What about a s/MIN/min/g in the idea driver to easily catch such bugs?
>
> Good idea partially already implemented :-).
> At least the generic code and the host chip driver code are alread
> switched to using those "chatch them" macros.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2002-05-07 14:54 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-05-07 8:51 [PATCH] 2.5.14 IDE CD-ROM PIO mode Osamu Tomita
2002-05-07 9:57 ` Martin Dalecki
2002-05-07 11:41 ` Christoph Hellwig
2002-05-07 10:42 ` Martin Dalecki
2002-05-07 14:29 ` Bartlomiej Zolnierkiewicz
2002-05-07 13:51 ` Martin Dalecki
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox