linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Adrian McMenamin <lkmladrian@gmail.com>
To: Adrian McMenamin <adrian@newgolddream.dyndns.info>
Cc: Paul Mundt <lethal@linux-sh.org>, Greg KH <greg@kroah.com>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	dwmw2 <dwmw2@infradead.org>, linux-sh <linux-sh@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-input <linux-input@vger.kernel.org>
Subject: Re: [PATCH RFC] sh: maple: Add support for SEGA Dreamcast VMU and clean up maple bus driver (1/3)
Date: Fri, 30 Jan 2009 09:55:38 +0000	[thread overview]
Message-ID: <8b67d60901300155n66f86d4ch875d01cd1620409e@mail.gmail.com> (raw)
In-Reply-To: <793692118a2f4bdd17326e8bed6c9792.squirrel@newgolddream.dyndns.info>

2009/1/29 Adrian McMenamin <adrian@newgolddream.dyndns.info>:
> On Thu, January 29, 2009 4:43 pm, Adrian McMenamin wrote:
>> On Thu, January 29, 2009 3:13 am, Paul Mundt wrote:

>>>>
>>> Please do not abuse P2SEGADDR in this fashion. No new code should be
>>> using P2SEGADDR anyways. maple is particularly abusive in this case
>>> since
>>> it bounces back and forth between P2SEGADDR and PHYSADDR to try and
>>> ignore the fact cache flushing has to be handled.
>>>
>>> You may also wish to consider ioremap/ioremap_nocache().
>>>
>>
>> Can I just use dma_cache_sync before each dma run and then use the P1
>> address space?
>>
>
> After the dma run I mean - the cache is flushed before the run - but not
> after.
>


So I have done this:

Removing P2SEGADDR call and flushing caches
---

diff --git a/drivers/sh/maple/maple.c b/drivers/sh/maple/maple.c
index 4d9b8b3..5dca308 100644
--- a/drivers/sh/maple/maple.c
+++ b/drivers/sh/maple/maple.c
@@ -186,7 +186,7 @@ static struct mapleq *maple_allocq(struct
maple_device *mdev)
 	mq->recvbuf = kmem_cache_zalloc(maple_queue_cache, GFP_KERNEL);
 	if (!mq->recvbuf)
 		goto failed_p2;
-	mq->recvbuf->buf = (void *)P2SEGADDR(&((mq->recvbuf->bufx)[0]));
+	mq->recvbuf->buf = &((mq->recvbuf->bufx)[0]);

 	return mq;

@@ -639,9 +639,11 @@ static void maple_dma_handler(struct work_struct *work)
 	ctrl_outl(0, MAPLE_ENABLE);
 	if (!list_empty(&maple_sentq)) {
 		list_for_each_entry_safe(mq, nmq, &maple_sentq, list) {
+			mdev = mq->dev;
 			recvbuf = mq->recvbuf->buf;
+			dma_cache_sync(&mdev->dev, recvbuf, 0x400,
+				DMA_FROM_DEVICE);
 			code = recvbuf[0];
-			mdev = mq->dev;
 			kfree(mq->sendbuf);
 			list_del_init(&mq->list);
 			switch (code) {


Seems to work...

      reply	other threads:[~2009-01-30  9:55 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-28 23:47 [PATCH RFC] sh: maple: Add support for SEGA Dreamcast VMU and clean up maple bus driver (0/3) Adrian McMenamin
2009-01-28 23:57 ` [PATCH RFC] sh: maple: Add support for SEGA Dreamcast VMU and clean up maple bus driver (1/3) Adrian McMenamin
2009-01-29  0:09   ` [PATCH RFC] sh: maple: Add support for SEGA Dreamcast VMU and clean up maple bus driver (2/3) Adrian McMenamin
2009-01-29  0:18     ` [PATCH RFC] sh: maple: Add support for SEGA Dreamcast VMU and clean up maple bus driver (3/3) Adrian McMenamin
2009-01-29  2:57       ` Paul Mundt
2009-01-29 10:34         ` Adrian McMenamin
2009-01-29  5:46       ` Mike Frysinger
2009-01-29  0:44     ` [PATCH RFC] sh: maple: Add support for SEGA Dreamcast VMU and clean up maple bus driver (2/3) Mike Frysinger
2009-01-29  0:49       ` Adrian McMenamin
2009-01-29  1:12         ` Mike Frysinger
2009-01-29  0:42   ` [PATCH RFC] sh: maple: Add support for SEGA Dreamcast VMU and clean up maple bus driver (1/3) Mike Frysinger
2009-01-29  3:13   ` Paul Mundt
2009-01-29 16:43     ` Adrian McMenamin
     [not found]     ` <3ca9ec7a13c1a13ea7be6c37bbdfdb0c.squirrel@newgolddream.dyndns.info>
2009-01-29 16:51       ` Adrian McMenamin
2009-01-30  9:55         ` Adrian McMenamin [this message]

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=8b67d60901300155n66f86d4ch875d01cd1620409e@mail.gmail.com \
    --to=lkmladrian@gmail.com \
    --cc=adrian@newgolddream.dyndns.info \
    --cc=dmitry.torokhov@gmail.com \
    --cc=dwmw2@infradead.org \
    --cc=greg@kroah.com \
    --cc=lethal@linux-sh.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sh@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;
as well as URLs for NNTP newsgroup(s).