mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Carsten Jacobi <carsten@ccac.rwth-aachen.de>
To: Marc Zyngier <mzyngier@freesurf.fr>,
	Linux-Kernel Mailinglist <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] lne390 and Jensen Alphas
Date: Mon, 13 Oct 2003 23:14:23 +0200	[thread overview]
Message-ID: <20031013211423.GA27129@ccac.rwth-aachen.de> (raw)
In-Reply-To: <wrp1xtir95d.fsf@hina.wild-wind.fr.eu.org>

On Sun, Oct 12, 2003 at 01:24:30PM +0200, Marc Zyngier wrote:

> This doesn't look to me like a proper fix. You should unconditionally
> use ioremap and memcpy_{from,to}io (not the isa_* version). No need to
> have a special Jensen case here.

Marc,

I wish I could use the memcpy_{from,to}io-functions because I know by
myself that they are well optimized and tested. But in this case they
don't behave the way the lne390 adapter needs them.
If you take a look into arch/alpha/lib/io.c you see that the function
_memcpy_toio() is checking the count of bytes to copy and the address to
copy to against their alignment. In case they are on a 16bit boundary
(and unfortunately they are always on such a boundary because the MAC
header is 14 bytes and the alignment of skb->data is honoring the start
of IP data for alignment to increase the performance of the stack)
_memcpy_toio() will use __raw_writew() to actually copy the data. And
this is exactly what doesn't work: Filling the shared mem of the lne390
adapter using 16bit write operations. I think this problem does not arise
on x86 architectures.
About five years ago I addressed that issue 
(http://www.uwsg.iu.edu/hypermail/linux/kernel/9807.3/1132.html) and got
an answer from Alan Cox
(http://www.uwsg.iu.edu/hypermail/linux/kernel/9807.3/1212.html)

> Please look at the way ne3210.c was fixed in 2.6.0-test7.

Hmm, I see you are using memcpy_{from,to}io-functions only. Five years
ago I sent another patch that established a new function I called
"memcpy_toio_g32a"()
(http://www.ussg.iu.edu/hypermail/linux/kernel/9808.1/0275.html), but that was
the one that never did it into an official release. Indeed, I am also
unwilling to write a dirty hack and use well defined io-functions
instead. This is clean and it is even easier to develop and debug.
Unfortunately .... I start to repeat. Or, is there another way to copy
something from mem to iomem that is definitely using 32bit write
operations? Any help is welcome ...

Regards,
	Carsten Jacobi


  reply	other threads:[~2003-10-13 21:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-10 22:17 Carsten Jacobi
2003-10-12 11:24 ` Marc Zyngier
2003-10-13 21:14   ` Carsten Jacobi [this message]
2003-10-11 21:10 Carsten Jacobi

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=20031013211423.GA27129@ccac.rwth-aachen.de \
    --to=carsten@ccac.rwth-aachen.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mzyngier@freesurf.fr \
    /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®