public inbox for linux-sh@vger.kernel.org
 help / color / mirror / Atom feed
From: "Magnus Damm" <magnus.damm@gmail.com>
To: linux-sh@vger.kernel.org
Subject: Re: [PATCH] sh: use declared coherent memory for dreamcast pci ethernet adapter
Date: Fri, 25 Jan 2008 04:16:21 +0000	[thread overview]
Message-ID: <aec7e5c30801242016vf70588p53aaac8caeb8d683@mail.gmail.com> (raw)
In-Reply-To: <20080124094050.25814.40528.sendpatchset@clockwork.opensource.se>

[-- Attachment #1: Type: text/plain, Size: 2179 bytes --]

On Jan 25, 2008 7:53 AM, Adrian McMenamin
<adrian@newgolddream.dyndns.info> wrote:
> On Thu, 2008-01-24 at 22:33 +0000, Adrian McMenamin wrote:
> > On Thu, 2008-01-24 at 18:40 +0900, Magnus Damm wrote:
> > > sh: use declared coherent memory for dreamcast pci ethernet adapter
> > >
> > > This patch makes the dreamcast use the recently added declared coherent
> > > memory functions to point out the memory window suitable for dma.
> > >
> > > Apart from cleaning up, this gives the dreamcast a proper memory allocator
> > > for pci dma memory.
> > >
> > > Signed-off-by: Magnus Damm <damm@igel.co.jp>
> >
> >
> > I get this now:
> >
> > [    2.894858] IP-Config: Failed to open eth0
> > [    2.898395] IP-Config: No network devices available.
> >
> > So it appears, on first blush, that the patch breaks the driver. I'll
> > test further to confirm.
> >
>
> I can confirm that the patches:
>
> f838a96ef5cdc261cb458b154e79b259688008b8
> b82c3460d4a2d86cdac80e178a76f3833f1aecba
> 1b0a4750bf70d0e6f1b4ef573b1231530b9891be
>
> all need to be reverted as they break the Dreamcast network driver

Hi Adrian,

Thanks for testing and sorry about breaking the dreamcast ethernet
driver. We do need declared coherent memory support for the sm501 chip
and there shouldn't be any problems with using that interface for the
dreamcast. At least in theory. =)

I did unfortunately introduce a generic bug with the declared coherent
memory V2 patch yesterday, but I've posted a fix for that earlier
today. I don't however think that fix will help you. What you're
seeing seems to be that IP-config doesn't work which hints that packet
data isn't transferred as it should. And in your case it's most likely
because some virtual address or dma handle isn't setup properly.

The main thing here is that dma_alloc_coherent() should return the
same virtual address and dma handle regardless if my coherent patches
are applied. Or the values should at least be sane.

Can you please apply the attached patch and test both with and without
the 3 declared coherent patches? I'd like to see the values printed
out by printk() both with and without the declared coherent patches.

Thank you.

/ magnus

[-- Attachment #2: linux-2.6.25-pre-sh-8139too-dma-printk-20080125.patch --]
[-- Type: application/octet-stream, Size: 710 bytes --]

--- 0001/drivers/net/8139too.c
+++ work/drivers/net/8139too.c	2008-01-25 13:08:46.000000000 +0900
@@ -1311,6 +1311,15 @@ static int rtl8139_open (struct net_devi
 					   &tp->tx_bufs_dma, GFP_KERNEL);
 	tp->rx_ring = dma_alloc_coherent(&tp->pci_dev->dev, RX_BUF_TOT_LEN,
 					   &tp->rx_ring_dma, GFP_KERNEL);
+
+	printk("zzzzzzzz:"
+	       "tx_bufs = 0x%08lx/0x%08lx, "
+	       "rx_ring = 0x%08lx/0x%08lx, "
+	       "(0x%08lx)\n",
+	       (unsigned long)tp->tx_bufs, (unsigned long)tp->tx_bufs_dma,
+	       (unsigned long)tp->rx_ring, (unsigned long)tp->rx_ring_dma,
+	       (unsigned long)tp->pci_dev->dev.dma_mem);
+
 	if (tp->tx_bufs == NULL || tp->rx_ring == NULL) {
 		free_irq(dev->irq, dev);
 

  parent reply	other threads:[~2008-01-25  4:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-24  9:40 [PATCH] sh: use declared coherent memory for dreamcast pci ethernet adapter Magnus Damm
2008-01-24 22:33 ` [PATCH] sh: use declared coherent memory for dreamcast pci Adrian McMenamin
2008-01-24 22:53 ` Adrian McMenamin
2008-01-25  4:16 ` Magnus Damm [this message]
2008-01-25 21:00 ` Adrian McMenamin
2008-01-25 21:46 ` Adrian McMenamin
2008-01-27  4:37 ` [PATCH] sh: use declared coherent memory for dreamcast pci ethernet adapter Magnus Damm
2008-02-01  3:00 ` Paul Mundt
2008-02-03 21:32 ` [PATCH] sh: use declared coherent memory for dreamcast pci Adrian McMenamin
2008-02-03 23:26 ` Adrian McMenamin
2008-02-04  9:07 ` [PATCH] sh: use declared coherent memory for dreamcast pci ethernet adapter Magnus Damm

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=aec7e5c30801242016vf70588p53aaac8caeb8d683@mail.gmail.com \
    --to=magnus.damm@gmail.com \
    --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