From: Sergei Shtylyov <sshtylyov@ru.mvista.com>
To: albertl@mail.com
Cc: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>,
Alan Cox <alan@lxorguk.ukuu.org.uk>,
Linux IDE <linux-ide@vger.kernel.org>,
"Adam W. Hawks" <awhawks@us.ibm.com>
Subject: Re: [PATCH 2/2] ide: clear bmdma status in ide_intr() (revised)
Date: Thu, 25 Jan 2007 18:17:22 +0300 [thread overview]
Message-ID: <45B8CA02.4050701@ru.mvista.com> (raw)
In-Reply-To: <45B878F0.7060707@tw.ibm.com>
Albert Lee wrote:
> patch 2/2 (revised):
> - Do the dma status clearing in ide_intr() and add a new hwif->ide_dma_clear_irq such that LLDD can override it.
> - Fix drive->waiting_for_dma to work with CDB-intr devices.
>
> Signed-off-by: Albert Lee <albertcc@tw.ibm.com>
> ---
> hwif->dma is not reliable: ide_intr() races with dma_start(). Sometimes we got hwif->dma == 0
> in ide_intr() even though it is actually a DMA interrupt. So, drive->waiting_for_dma is used instead.
>
> Also revised per Sergei's comments and let ide_dma_clear_irq return "void".
> The "if (hwif->dma_status)" check in __ide_dma_clear_irq() is kept as is since I think
> it would be safer for the old ISA/VESA IDE devices that has no BMDMA registers.
ISA/VESA drivers shouldn't have this method defined at all since they're
PIO only. But well, it won't hurt...
> For your review, thanks.
> diff -Nrup 01_remove_from_ide_cd/drivers/ide/ide-cd.c 02_add_to_ide_intr/drivers/ide/ide-cd.c
> --- 01_remove_from_ide_cd/drivers/ide/ide-cd.c 2007-01-24 11:00:03.000000000 +0800
> +++ 02_add_to_ide_intr/drivers/ide/ide-cd.c 2007-01-25 16:52:20.000000000 +0800
> @@ -923,6 +923,10 @@ static ide_startstop_t cdrom_start_packe
> HWIF(drive)->OUTB(drive->ctl, IDE_CONTROL_REG);
>
> if (CDROM_CONFIG_FLAGS (drive)->drq_interrupt) {
> + /* waiting for CDB interrupt, not DMA yet. */
> + if (info->dma)
> + drive->waiting_for_dma = 0;
> +
> /* packet command */
> ide_execute_command(drive, WIN_PACKETCMD, handler, ATAPI_WAIT_PC, cdrom_timer_expiry);
> return ide_started;
> @@ -965,6 +969,10 @@ static ide_startstop_t cdrom_transfer_pa
> /* Check for errors. */
> if (cdrom_decode_status(drive, DRQ_STAT, NULL))
> return ide_stopped;
> +
> + /* Ok, next interrupt will be dma interrupt. */
> + if (info->dma)
> + drive->waiting_for_dma = 1;
> } else {
> /* Otherwise, we must wait for DRQ to get set. */
> if (ide_wait_stat(&startstop, drive, DRQ_STAT,
Erm... shouldn't we set drive->waiting_for_dma in hwif->dma_start() then?
Why it's set in hwif->dma_setup() at all I wonder?
MBR, Sergei
next prev parent reply other threads:[~2007-01-25 15:17 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-01-18 11:19 [PATCH] ide: Fix ATAPI DMA lost irq problem with CDB intr devices Albert Lee
[not found] ` <58cb370e0701191133m3dd584ffna5b231b00392c13d@mail.gmail.com>
2007-01-19 19:59 ` Bartlomiej Zolnierkiewicz
2007-01-22 7:28 ` Albert Lee
2007-01-22 8:45 ` Albert Lee
2007-01-22 16:05 ` Bartlomiej Zolnierkiewicz
2007-01-24 3:33 ` [PATCH 0/2] ide: clear bmdma status in ide_intr for all commands Albert Lee
2007-01-24 3:36 ` [PATCH 1/2] ide: remove clearing bmdma status from cdrom_decode_status() Albert Lee
2007-01-24 3:42 ` [PATCH 2/2] ide: clear bmdma status in ide_intr() Albert Lee
2007-01-24 13:04 ` Sergei Shtylyov
2007-01-25 9:31 ` [PATCH 2/2] ide: clear bmdma status in ide_intr() (revised) Albert Lee
2007-01-25 15:17 ` Sergei Shtylyov [this message]
2007-01-25 16:40 ` Sergei Shtylyov
2007-01-30 2:49 ` [PATCH 0/2] ide: clear bmdma status in ide_intr for Intel controllers (revised #3) Albert Lee
2007-01-30 2:52 ` [PATCH 1/2] ide: remove clearing bmdma status from cdrom_decode_status() (rev #3) Albert Lee
2007-01-30 3:02 ` [PATCH 2/2] ide: clear bmdma status in ide_intr() for Intel controllers (revised #3) Albert Lee
2007-01-30 14:13 ` Sergei Shtylyov
2007-01-30 14:27 ` Alan
[not found] ` <58cb370e0701301117n316a9efax1e0b6299a8f8594a@mail.gmail.com>
2007-01-30 20:21 ` Bartlomiej Zolnierkiewicz
2007-01-31 5:49 ` [PATCH 0/2] ide: clear bmdma status in ide_intr for Intel controllers (revised #4) Albert Lee
2007-01-31 5:54 ` [PATCH 1/2] ide: clear bmdma status in ide_intr() for ICHx " Albert Lee
2007-01-31 5:57 ` [PATCH 2/2] ide: remove clearing bmdma status from cdrom_decode_status() (rev #4) Albert Lee
[not found] ` <58cb370e0702021307i3d275e84qbeb3b44f58ad6b51@mail.gmail.com>
2007-02-02 21:14 ` [PATCH 0/2] ide: clear bmdma status in ide_intr for Intel controllers (revised #4) Bartlomiej Zolnierkiewicz
2007-01-22 14:47 ` [PATCH] ide: Fix ATAPI DMA lost irq problem with CDB intr devices Alan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=45B8CA02.4050701@ru.mvista.com \
--to=sshtylyov@ru.mvista.com \
--cc=alan@lxorguk.ukuu.org.uk \
--cc=albertl@mail.com \
--cc=awhawks@us.ibm.com \
--cc=bzolnier@gmail.com \
--cc=linux-ide@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.