All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Masayuki Ohtake" <masa-korg@dsn.okisemi.com>
To: "FUJITA Tomonori" <fujita.tomonori@lab.ntt.co.jp>
Cc: <shemminger@vyatta.com>, <sam@ravnborg.org>, <joe@perches.com>,
	"ML linux-kernel" <linux-kernel@vger.kernel.org>,
	"ML netdev" <netdev@vger.kernel.org>, <gregory.v.rose@intel.com>,
	<mbizon@freebox.fr>, <kristoffer@gaisler.com>,
	<ralf@linux-mips.org>, <john.linn@xilinx.com>,
	<randy.dunlap@oracle.com>, <davem@davemloft.net>,
	<meego-dev@meego.com>, "Wang, Qi" <qi.wang@intel.com>,
	"Wang, Yong Y" <yong.y.wang@intel.com>,
	<andrew.chih.howe.khor@intel.com>,
	"Intel OTC" <joel.clark@intel.com>,
	"Foster, Margie" <margie.foster@intel.com>,
	"okada" <okada533@dsn.okisemi.com>,
	"Morinaga" <morinaga526@dsn.okisemi.com>,
	"shimizu" <shimizu394@dsn.okisemi.com>
Subject: Re: [PATCH] Gigabit Ethernet driver of Topcliff PCH
Date: Tue, 7 Sep 2010 10:13:22 +0900	[thread overview]
Message-ID: <001a01cb4e2a$5f870bf0$66f8800a@maildom.okisemi.com> (raw)
In-Reply-To: 20100903112248Q.fujita.tomonori@lab.ntt.co.jp

Hi Fujita

Thank you for your comments.

> > + if (buffer_info->dma) {
> > + pci_unmap_single(adapter->pdev, buffer_info->dma,
> > + buffer_info->length, PCI_DMA_FROMDEVICE);
> > + buffer_info->dma = 0;
>
> Probably, this trick doesn't work because zero could be a valid DMA
> address on some architctures.
>

The flag which shows mapped will be added.
And it is used instead of "if (buffer_info->dma) ".


> > + /*-- Set Buffer infomation --*/
> > + buffer_info->length = skb->len;
> > + buffer_info->dma =
> > +     pci_map_single(adapter->pdev, skb->data, buffer_info->length,
> > +    PCI_DMA_TODEVICE);
>
> Needs to handle mapping failure (dma_mapping_errro)?

Error process will be added.


> Can you use dma_map_* API instead of pci_map_*? Please read:
>

This DMA of device is not standard.  Personal use of Gigabit Ethernet device.
So, I guess that I do not need to use DMA-API.

Thanks, Ohtake
----- Original Message ----- 
From: "FUJITA Tomonori" <fujita.tomonori@lab.ntt.co.jp>
To: <masa-korg@dsn.okisemi.com>
Cc: <shemminger@vyatta.com>; <sam@ravnborg.org>; <joe@perches.com>; <linux-kernel@vger.kernel.org>;
<netdev@vger.kernel.org>; <gregory.v.rose@intel.com>; <mbizon@freebox.fr>; <kristoffer@gaisler.com>;
<ralf@linux-mips.org>; <john.linn@xilinx.com>; <randy.dunlap@oracle.com>; <davem@davemloft.net>; <meego-dev@meego.com>;
<qi.wang@intel.com>; <yong.y.wang@intel.com>; <andrew.chih.howe.khor@intel.com>; <joel.clark@intel.com>;
<margie.foster@intel.com>; <okada533@dsn.okisemi.com>; <morinaga526@dsn.okisemi.com>; <shimizu394@dsn.okisemi.com>
Sent: Friday, September 03, 2010 11:23 AM
Subject: Re: [PATCH] Gigabit Ethernet driver of Topcliff PCH


> On Tue, 31 Aug 2010 23:15:22 +0900
> Masayuki Ohtake <masa-korg@dsn.okisemi.com> wrote:
>
> > Gigabit Ethernet driver of Topcliff PCH
> > Patch created against 2.6.35
> >
> > Topcliff PCH is the platform controller hub that is going to be used in
> > Intel's upcoming general embedded platform. All IO peripherals in
> > Topcliff PCH are actually devices sitting on AMBA bus.
> > Topcliff PCH has Gigabit Ethernet I/F. Using this I/F, it is able to
> > access system devices connected to Gigabit Ethernet.
> >
> > Signed-off-by: Masayuki Ohtake <masa-korg@dsn.okisemi.com>
> > ---
> >  drivers/net/Kconfig                   |   10 +
> >  drivers/net/Makefile                  |    1 +
> >  drivers/net/pch_gbe/Makefile          |    4 +
> >  drivers/net/pch_gbe/pch_gbe.h         |  683 +++++++++
> >  drivers/net/pch_gbe/pch_gbe_api.c     |  246 ++++
> >  drivers/net/pch_gbe/pch_gbe_api.h     |   34 +
> >  drivers/net/pch_gbe/pch_gbe_ethtool.c |  618 ++++++++
> >  drivers/net/pch_gbe/pch_gbe_main.c    | 2591 +++++++++++++++++++++++++++++++++
> >  drivers/net/pch_gbe/pch_gbe_param.c   |  519 +++++++
> >  drivers/net/pch_gbe/pch_gbe_phy.c     |  276 ++++
> >  drivers/net/pch_gbe/pch_gbe_phy.h     |   35 +
> >  11 files changed, 5017 insertions(+), 0 deletions(-)
> >  create mode 100644 drivers/net/pch_gbe/Makefile
> >  create mode 100644 drivers/net/pch_gbe/pch_gbe.h
> >  create mode 100644 drivers/net/pch_gbe/pch_gbe_api.c
> >  create mode 100644 drivers/net/pch_gbe/pch_gbe_api.h
> >  create mode 100644 drivers/net/pch_gbe/pch_gbe_ethtool.c
> >  create mode 100644 drivers/net/pch_gbe/pch_gbe_main.c
> >  create mode 100644 drivers/net/pch_gbe/pch_gbe_param.c
> >  create mode 100644 drivers/net/pch_gbe/pch_gbe_phy.c
> >  create mode 100644 drivers/net/pch_gbe/pch_gbe_phy.h
>
> (snip)
>
> > +/**
> > + * pch_gbe_unmap_and_free_rx_resource - Unmap and free rx socket buffer
> > + * @adapter:      Board private structure
> > + * @buffer_info:  Buffer information structure
> > + */
> > +static void pch_gbe_unmap_and_free_rx_resource(
> > + struct pch_gbe_adapter *adapter,
> > + struct pch_gbe_buffer *buffer_info)
> > +{
> > + if (buffer_info->dma) {
> > + pci_unmap_single(adapter->pdev, buffer_info->dma,
> > + buffer_info->length, PCI_DMA_FROMDEVICE);
> > + buffer_info->dma = 0;
>
> Probably, this trick doesn't work because zero could be a valid DMA
> address on some architctures.
>
>
> > + /*-- Set Buffer infomation --*/
> > + buffer_info->length = skb->len;
> > + buffer_info->dma =
> > +     pci_map_single(adapter->pdev, skb->data, buffer_info->length,
> > +    PCI_DMA_TODEVICE);
>
> Needs to handle mapping failure (dma_mapping_errro)?
>
> I found the same problems in other places.
>
>
> Can you use dma_map_* API instead of pci_map_*? Please read:
>
> Documentation/DMA-API.txt
> Documentation/DMA-API-HOWTO.txt
>
>
> Thanks,
>





  reply	other threads:[~2010-09-07  1:17 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-26  9:56 [PATCH] Gigabit Ethernet driver of Topcliff PCH Masayuki Ohtake
2010-08-26  9:56 ` Masayuki Ohtake
2010-08-26 10:28 ` Sam Ravnborg
2010-08-26 12:47   ` Masayuki Ohtake
2010-08-26 14:44 ` Joe Perches
2010-08-26 15:34 ` Stephen Hemminger
2010-08-26 15:40 ` Stephen Hemminger
2010-08-26 15:41 ` Stephen Hemminger
2010-08-26 15:42 ` Stephen Hemminger
2010-08-26 15:43 ` Stephen Hemminger
2010-08-26 15:45 ` Stephen Hemminger
2010-08-26 15:47 ` Stephen Hemminger
2010-08-26 15:57 ` Stephen Hemminger
2010-08-26 16:05 ` Stephen Hemminger
2010-08-26 16:16   ` Joe Perches
2010-08-26 16:29     ` Stephen Hemminger
2010-08-26 17:02       ` Joe Perches
2010-08-31 14:15 ` Masayuki Ohtake
2010-08-31 14:15   ` Masayuki Ohtake
2010-08-31 14:51   ` Eric Dumazet
2010-09-02 12:39     ` Masayuki Ohtake
2010-09-02 13:40       ` Eric Dumazet
2010-09-02 15:10         ` Stephen Hemminger
2010-09-03 13:32           ` Masayuki Ohtake
2010-09-03 13:43             ` Eric Dumazet
2010-09-03 14:11               ` Masayuki Ohtake
2010-08-31 15:08   ` Randy Dunlap
2010-08-31 16:10   ` Joe Perches
2010-08-31 17:25     ` [PATCH] drivers/net/pch_gbe: Use bool not unsigned char Joe Perches
2010-08-31 18:38       ` [PATCH] drivers/net/pch_gbe: Cleanup stats use Joe Perches
2010-09-01  1:33         ` Stephen Hemminger
2010-09-01  1:38           ` Joe Perches
2010-09-03  2:23   ` [PATCH] Gigabit Ethernet driver of Topcliff PCH FUJITA Tomonori
2010-09-07  1:13     ` Masayuki Ohtake [this message]
2010-09-07  3:21       ` FUJITA Tomonori
2010-09-07  4:06         ` Masayuki Ohtake
  -- strict thread matches above, loose matches on Subject: below --
2010-09-03 14:09 Masayuki Ohtake
2010-09-03 14:09 ` Masayuki Ohtake
2010-09-03 16:35 ` Jiri Slaby
2010-09-07  1:13   ` Masayuki Ohtake
2010-09-08 13:52   ` Masayuki Ohtake
2010-09-08 14:16     ` Jiri Slaby
2010-09-08 14:54       ` Stephen Hemminger
2010-09-08 14:55       ` Stephen Hemminger
2010-09-09 13:37         ` Masayuki Ohtake
2010-09-09 13:38       ` Masayuki Ohtake
2010-09-03 20:00 ` Joe Perches
2010-09-07  2:42 ` Masayuki Ohtake
2010-09-07  2:42   ` Masayuki Ohtake
2010-09-08 20:36   ` David Miller
2010-09-15 12:19     ` Masayuki Ohtake

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='001a01cb4e2a$5f870bf0$66f8800a@maildom.okisemi.com' \
    --to=masa-korg@dsn.okisemi.com \
    --cc=andrew.chih.howe.khor@intel.com \
    --cc=davem@davemloft.net \
    --cc=fujita.tomonori@lab.ntt.co.jp \
    --cc=gregory.v.rose@intel.com \
    --cc=joe@perches.com \
    --cc=joel.clark@intel.com \
    --cc=john.linn@xilinx.com \
    --cc=kristoffer@gaisler.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=margie.foster@intel.com \
    --cc=mbizon@freebox.fr \
    --cc=meego-dev@meego.com \
    --cc=morinaga526@dsn.okisemi.com \
    --cc=netdev@vger.kernel.org \
    --cc=okada533@dsn.okisemi.com \
    --cc=qi.wang@intel.com \
    --cc=ralf@linux-mips.org \
    --cc=randy.dunlap@oracle.com \
    --cc=sam@ravnborg.org \
    --cc=shemminger@vyatta.com \
    --cc=shimizu394@dsn.okisemi.com \
    --cc=yong.y.wang@intel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.