From: Tuomas Vainikka <tuomas.vainikka@aalto.fi>
To: Michael Schmitz <schmitzmic@gmail.com>
Cc: Linux/m68k <linux-m68k@vger.kernel.org>,
Geert Uytterhoeven <geert@linux-m68k.org>
Subject: Re: [PATCH 0/2] Experimental Amiga Zorro ESP driver
Date: Sat, 31 Aug 2013 13:37:44 +0300 [thread overview]
Message-ID: <5221C778.1080808@aalto.fi> (raw)
In-Reply-To: <CAOmrzkKtB4OpnFNFh9PR4V8bc3ExfFXpwtkhGj0veQ4w-d=cqA@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 3485 bytes --]
On 08/22/2013 11:34 PM, Michael Schmitz wrote:
> Hello Tuomas,
>
>>> No idea which functions you refer to regarding PIO (reading from FIFO).
>>> Anyway, the DMA will read from the same FIFO that the CPU would, if I
>>> understand DMA correctly. There really should be no difference-
>> esp.scsi.c:1058 versus esp.scsi.c:1120
> I suppose this is because reconnect_with_tag() cannot rely on the tag
> information already being in the FIFO when it is called from
> esp_reconnect(). esp_reconnect() is called from the reselection
> interrupt so the fifo data is already present.
>
>> In:
>> http://pdf.datasheetcatalog.com/datasheet/AdvancedMicroDevices/mXxxsy.pdf
>> page 42: Enable Selection/Reselection Command (Command Code 44H/C4H)
>>
>> explains why the bytes might end up in FIFO; The chip DMA got disabled at
>> some point. Also, you need to explicitly issue a specific (don't know which,
>> yet) command to let the DMA access the FIFO.
> The chip DMA should be activated by the ESP_CMD_DMA bit that is set in
> all uses of send_dma_cmd. I can't see where the DMA would have been
> disabled.
>
>>> The DMA transfer function can be changed to fetch less than seven bytes
>>> from the FIFO by PIO instead of setting up DMA transfer (just poll the FIFO
>>> after sending the command to the ESP, instead of first setting up the DMA
>>> then sending the command),
>>>
>> I'd rather find out why and where the DMA is disabled before we resort to
>> PIO. It is also possible that the chip interrupt is cleared prematurely by
>> reading the interrupt register, in which case the interrupt is not seen by
>> The Loop.
> That's the attitude - my suggestion was purely pragmatic, in order to
> overcome that particular roadblock and see whether there's further
> issues. But fixing this properly would be much preferred.
>
> David Miller is still maintainer of the ESP code - I can't think of
> anyone better suited to answer ESP specific questions really.
>
>
This might have nothing to do with the current issue, but during the
course of debugging this two byte dma write, I stumbled across this;
[ 2434.370000] ESP: reconnect tag, IRQ(0:10:97), kernel BUG at
mm/slab.c:3011! [1]
I had modified the code in esp_scsi.c inside the reconnect_with_tag
function to kzalloc the two bytes, single mapping it to "from device"
direction in order to check whether the issue was with the dma writing
directly to the command block. The dma command was directed to write the
two bytes to the area kalloc'd, after which they were copied to the real
command block, and the kalloc'd area was unmapped and freed. This would
work a couple times when the driver attempted to get the two bytes, but
eventually, the above mentioned kernel bug would kick in. I had made
sure to unmap and free the two bytes before the function could exit.
Another oddity [2] was that I assigned the kalloc'd bytes to 0xff and
0xfe, and although the code to copy the two bytes to the real command
block was after the IRQ2 timeout loop (that continuously calls
zorro_esp_irq_pending() ), these values were already sitting in the
command block before the loop would exit and the values be copied. I
could not prevent this from happening even when I disabled optimizations
and/or made the copy through a temporary volatile u8. The last two
values from the printk are command_block[0] and command_block[1].
[1] zesp050.cap:836 (printk message in zorro_esp_irq_pending() was disabled)
[2] zesp049.cap:988
-Tuomas
[-- Attachment #2: zesp049.cap.gz --]
[-- Type: application/x-gzip, Size: 4570 bytes --]
[-- Attachment #3: zesp050.cap.gz --]
[-- Type: application/x-gzip, Size: 10753 bytes --]
next prev parent reply other threads:[~2013-08-31 10:37 UTC|newest]
Thread overview: 53+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-06 20:56 [PATCH 0/2] Experimental Amiga Zorro ESP driver Michael Schmitz
2013-06-06 20:56 ` [PATCH 1/2] m68k/amiga - Zorro ESP SCSI Makefile/Kconfig support Michael Schmitz
2013-06-06 20:56 ` [PATCH 2/2] m68k/amiga - Zorro ESP: convert old driver to ESP core Michael Schmitz
2013-08-15 21:40 ` [PATCH 0/2] Experimental Amiga Zorro ESP driver Tuomas Vainikka
2013-08-16 19:01 ` Tuomas Vainikka
2013-08-17 1:49 ` Michael Schmitz
2013-08-17 11:33 ` Tuomas Vainikka
2013-08-18 2:05 ` Michael Schmitz
2013-08-18 8:23 ` Geert Uytterhoeven
2013-08-18 8:58 ` Michael Schmitz
2013-08-18 9:10 ` Geert Uytterhoeven
2013-08-19 8:48 ` Michael Schmitz
2013-08-19 11:47 ` Tuomas Vainikka
2013-08-19 12:01 ` Geert Uytterhoeven
2013-08-19 20:46 ` Tuomas Vainikka
2013-08-20 9:36 ` Michael Schmitz
2013-08-20 10:00 ` Tuomas Vainikka
2013-08-22 20:34 ` Michael Schmitz
2013-08-31 10:37 ` Tuomas Vainikka [this message]
2013-09-10 21:13 ` Tuomas Vainikka
2013-09-11 10:12 ` Michael Schmitz
2013-09-11 13:08 ` Tuomas Vainikka
2013-09-11 20:14 ` Tuomas Vainikka
2013-09-26 13:44 ` Michael Schmitz
2013-09-26 14:04 ` Tuomas Vainikka
2013-09-27 9:17 ` Michael Schmitz
2013-09-11 14:48 ` Geert Uytterhoeven
2013-09-12 15:36 ` esp_scsi QTAG in FAS216 (was Re: [PATCH 0/2] Experimental Amiga Zorro ESP driver) Tuomas Vainikka
2013-09-26 13:50 ` Michael Schmitz
2014-04-04 20:28 ` esp_scsi QTAG in FAS216 David Miller
2014-04-06 20:33 ` Michael Schmitz
2014-04-07 3:39 ` David Miller
2014-04-10 14:31 ` Kars de Jong
2014-04-11 1:47 ` Michael Schmitz
2014-04-13 14:47 ` Kars de Jong
2014-04-13 22:38 ` Michael Schmitz
2014-04-14 2:14 ` David Miller
2014-04-14 5:05 ` Tuomas Vainikka
2014-04-14 8:51 ` Michael Schmitz
2014-05-25 8:56 ` Geert Uytterhoeven
2014-05-26 1:15 ` Michael Schmitz
2014-04-14 9:01 ` Michael Schmitz
2014-05-04 11:41 ` Tuomas Vainikka
2016-10-28 21:54 ` Finn Thain
2016-10-30 2:33 ` Finn Thain
2016-10-31 8:03 ` Michael Schmitz
2016-10-31 18:54 ` Michael Schmitz
2016-10-31 23:47 ` Finn Thain
2016-11-01 7:09 ` Michael Schmitz
2016-11-01 7:23 ` Finn Thain
2013-08-18 9:14 ` [PATCH 0/2] Experimental Amiga Zorro ESP driver Tuomas Vainikka
2013-08-18 9:42 ` Geert Uytterhoeven
2013-08-18 12:25 ` Tuomas Vainikka
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=5221C778.1080808@aalto.fi \
--to=tuomas.vainikka@aalto.fi \
--cc=geert@linux-m68k.org \
--cc=linux-m68k@vger.kernel.org \
--cc=schmitzmic@gmail.com \
/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