mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl>
To: Jeremy Higdon <jeremy@sgi.com>
Cc: gwh@sgi.com, jbarnes@sgi.com, aniket_m@hotmail.com,
	linux-kernel@vger.kernel.org
Subject: Re: Patch to add support for SGI's IOC4 chipset
Date: Wed, 22 Oct 2003 20:31:02 +0200	[thread overview]
Message-ID: <200310222031.02243.bzolnier@elka.pw.edu.pl> (raw)
In-Reply-To: <20031022043058.GC80096@sgi.com>

On Wednesday 22 of October 2003 06:30, Jeremy Higdon wrote:
> On Tue, Oct 21, 2003 at 04:39:28PM +0200, Bartlomiej Zolnierkiewicz wrote:
> > On Tuesday 21 of October 2003 08:35, Jeremy Higdon wrote:
> > > > - defining IDE_ARCH_ACK_INTR and ide_ack_intr() in sgiioc4.c is a
> > > > no-op, it should be done <asm/ide.h> to make it work
> > > >   (I think the same problem is present in 2.4.x)
> > >
> > > The definition in <include/linux/ide.h> is only used if
> > > IDE_ARCH_ACK_INTR is not defined.  sgiioc4.c defines IDE_ARCH_ACK_INTR
> > > before including that file, so I believe we get the definition we want
> > > without touching ide.h, don't we?
> >
> > ide_ack_intr() is used by ide-io.c.  If IDE_ARCH_ACK_INTR is not defined
> > in ide.h (and it won't be cause you are doing this only in sgiioc4.c
> > /sgiioc4.h in 2.4.x case/ about which ide-io.c has abolutely no idea)
> > ide_ack_intr() will turn into no-op and hwif->ack_intr() won't be called.
>
> I see what you mean.  Thanks for spotting and fixing this.

I think there is another bug:

...
	hwif->hw.ack_intr = &sgiioc4_checkirq;	/* MultiFunction Chip */
...

sgiioc4_clearirq() should be used instead of sgiioc4_checkirq() here,
because otherwise IRQ won't be cleared.

In order to do this you must modify sgiioc4_clearirq() slightly,
just change "return intr_reg;" to "return intr_reg & 0x03;".

If you wonder why, please look at ide_ack_intr() use in ide-io.c:ide_intr().

> I've run into a problem in testing.  For some reason, I've started to get
> ide timeouts, and the error recovery is not working correctly, due to a
> problem in the driver.
>
> In sgiioc4_ide_dma_stop(), sgiioc4_ide_dma_end(), and sgiioc4_clearirq(),
> there are calls to xide_delay(), which uses schedule_timeout() to sleep.
> Since all of these sgiioc4_ functions can be called from interrupt context,
> that's an obvious problem.
>
> In sgiioc4_clearirq(), the delay function is while we're waiting for the
> interrupt to clear.
>
> In sgiioc4_ide_dma_stop(), we're waiting for the DMA bit to clear.
>
> In sgiioc4_ide_dma_end(), we're waiting for another DMA to finish.
>
> I believe that the right answer is to use udelay() and give up after
> a short period of time.  My question is what does the ide layer

Yes, just use udelay().

> expect?  That is, if you call the dma_end function and the hardware
> driver can't succeed, what would you like us to do?  Is there a way
> to return error, or should we just fail and the ide infrastructure
> will pick it up later and reset things?

The latter, sgiioc4_ide_dma_end() already returns error value to higher layer.
dma_intr() checks it and handle errors (at least in theory).

> I am new to Linux IDE, so forgive these questions if the answers should
> be obvious.

No problem.

thanks,
--bartlomiej


  reply	other threads:[~2003-10-22 18:26 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-02 23:28 Aniket Malatpure
2003-10-03  0:43 ` Andrew Morton
2003-10-03 14:45 ` Bartlomiej Zolnierkiewicz
2003-10-03 14:55   ` Jeff Garzik
2003-10-03 15:13     ` Bartlomiej Zolnierkiewicz
2003-10-04  1:52       ` Aniket Malatpure
2003-10-04  0:32   ` Aniket Malatpure
2003-10-04 17:30     ` Bartlomiej Zolnierkiewicz
2003-10-07  8:27       ` Jeremy Higdon
2003-10-07 13:27         ` Bartlomiej Zolnierkiewicz
2003-10-08  3:38           ` Jeremy Higdon
2003-10-16 18:20             ` Bartlomiej Zolnierkiewicz
2003-10-21  6:35               ` Jeremy Higdon
2003-10-21 14:39                 ` Bartlomiej Zolnierkiewicz
2003-10-22  4:30                   ` Jeremy Higdon
2003-10-22 18:31                     ` Bartlomiej Zolnierkiewicz [this message]
2003-10-23  4:34                       ` Jeremy Higdon
2003-10-25  2:09                       ` Jeremy Higdon

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=200310222031.02243.bzolnier@elka.pw.edu.pl \
    --to=b.zolnierkiewicz@elka.pw.edu.pl \
    --cc=aniket_m@hotmail.com \
    --cc=gwh@sgi.com \
    --cc=jbarnes@sgi.com \
    --cc=jeremy@sgi.com \
    --cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®