From: Finn Thain <fthain@telegraphics.com.au>
To: Michael Schmitz <schmitzmic@gmail.com>
Cc: Vainikka Tuomas <tuomas.vainikka@aalto.fi>,
Geert Uytterhoeven <geert@linux-m68k.org>,
linux-m68k <linux-m68k@vger.kernel.org>
Subject: zorro_esp, was Re: m68k v3.16 status update
Date: Wed, 20 Dec 2017 09:06:50 +1100 (AEDT) [thread overview]
Message-ID: <alpine.LNX.2.21.1712191835410.3@nippy.intranet> (raw)
In-Reply-To: <d5f920dd-6678-d3a7-d823-e6524f3611cd@gmail.com>
On Tue, 19 Dec 2017, Michael Schmitz wrote:
> >
> > > Contrary to the Mac driver, esp->command_block and
> > > esp->command_block_dma are not identical addresses on Amiga.
> >
> > Why not make them identical, depending on the length of the tranfer?
> > (Then choose PIO or DMA by testing for the same threshold.)
>
> esp->command_block_dma is mapped at driver init time so we don't get to
> chose at command submission time.
You could set esp->command_block_dma to an address like 0xffffffff. Then
when zorro_esp's ops->send_dma_cmd method is to do a DMA to or from that
address, check the transfer length. If the length is small, use
esp->command_block as the address for a PIO transfer. Otherwise, use the
mapped esp->command_block (which you saved somewhere at driver init time)
for a DMA transfer.
This is a hack, of course. Perhaps we can avoid the hack if we pass the
virtual address as an argument to ops->send_dma_cmd.
(Or *sg could be passed, if we cook up a couple of scattergather structs
to replace ent->sense_ptr and esp->command_block. This might allow for the
elimination of ops->map_single and ops->unmap_single altogether...)
> >
> > > (I can use esp->command_block in the reconnect message special case
> > > but not otherwise ...)
> >
> > Maybe something like this...
> >
> > struct esp_cmd_entry *ent = esp->active_cmd;
> > struct esp_cmd_priv *spriv = ESP_CMD_PRIV(ent->cmd);
> > struct scatterlist *sg = spriv->cur_sg;
> > unsigned long addr = sg_page(sg) + sg->offset;
> >
> > but that doesn't work for the esp_autosense() case, which doesn't
> > involve esp->ops->map_sg...
> >
> > HTH
>
> I'll give that a try to see if this works for regular transfers.
>
> Will look at ways to identify autosense as well (do sense data fit into
> the ESP FIFO usually?)
You can identify the autosense case easily enough,
struct esp_cmd_entry *ent = esp->active_cmd;
struct esp_cmd_priv *spriv = ESP_CMD_PRIV(ent->cmd);
unsigned long addr;
if (ent->flags & ESP_CMD_FLAG_AUTOSENSE)
addr = spriv->sense_ptr;
else {
struct scatterlist *sg = spriv->cur_sg;
addr = sg_page(sg) + sg->offset;
}
But that still leaves the command_block case unhandled (I don't think we
can use spriv->cur_sg for that, so we'd need a hack like the one above).
All this complexity doesn't really belong in the ops->send_dma_cmd method,
so I think we are back to passing in the virtual pointer as a parameter.
That change would touch every esp driver. But it could improve mac_esp,
since mac_esp would no longer have to do any fake dma mapping. Maybe I
should do a patch for this?
--
>
> Cheers,
>
> Michael
>
>
next prev parent reply other threads:[~2017-12-19 22:06 UTC|newest]
Thread overview: 36+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-05 19:40 m68k v3.16 status update Geert Uytterhoeven
2014-08-05 19:52 ` Ingo Jürgensmann
2014-08-05 20:29 ` John Paul Adrian Glaubitz
2014-08-06 7:35 ` Geert Uytterhoeven
2014-08-06 9:53 ` John Paul Adrian Glaubitz
2014-08-08 8:58 ` Michael Schmitz
2014-08-08 9:53 ` Tuomas Vainikka
2014-08-08 8:38 ` Michael Schmitz
2014-08-08 9:45 ` Christian T. Steigies
2014-08-08 22:33 ` Michael Schmitz
2014-08-08 14:25 ` Tuomas Vainikka
2014-08-08 22:25 ` Michael Schmitz
2014-08-09 6:45 ` Tuomas Vainikka
2014-08-10 1:44 ` Michael Schmitz
2017-12-14 4:47 ` Michael Schmitz
2017-12-14 12:07 ` Vainikka Tuomas
2017-12-14 13:20 ` John Paul Adrian Glaubitz
2017-12-14 18:40 ` Michael Schmitz
2017-12-14 23:49 ` Finn Thain
2017-12-19 0:40 ` Michael Schmitz
2017-12-19 3:35 ` Finn Thain
2017-12-19 6:11 ` Michael Schmitz
2017-12-19 22:06 ` Finn Thain [this message]
2017-12-19 23:01 ` Finn Thain
2017-12-20 1:42 ` Michael Schmitz
2017-12-20 3:34 ` Finn Thain
2017-12-28 8:02 ` Michael Schmitz
2017-12-29 0:02 ` Finn Thain
2017-12-29 9:09 ` Michael Schmitz
2017-12-19 8:19 ` Geert Uytterhoeven
2017-12-20 7:33 ` zorro_esp, was: " Michael Schmitz
2017-12-20 8:13 ` Geert Uytterhoeven
2017-12-15 8:34 ` Vainikka Tuomas
2017-12-16 0:04 ` TCQ with zorro_esp, was " Finn Thain
2017-12-19 0:44 ` Michael Schmitz
2014-08-09 1:14 ` Michael Schmitz
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=alpine.LNX.2.21.1712191835410.3@nippy.intranet \
--to=fthain@telegraphics.com.au \
--cc=geert@linux-m68k.org \
--cc=linux-m68k@vger.kernel.org \
--cc=schmitzmic@gmail.com \
--cc=tuomas.vainikka@aalto.fi \
/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;
as well as URLs for NNTP newsgroup(s).