mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
To: Martyn Welch <martyn.welch@ge.com>
Cc: Alessio Igor Bogani <alessioigorbogani@gmail.com>,
	devel@driverdev.osuosl.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Igor Alekseev <igor.alekseev@itep.ru>,
	LKML <linux-kernel@vger.kernel.org>,
	Manohar Vanga <manohar.vanga@gmail.com>
Subject: Re: [PATCHv3 08/16] staging: vme_user: provide DMA functionality
Date: Wed, 8 Jul 2015 17:39:00 +0300	[thread overview]
Message-ID: <476EC692-520C-499E-9564-A0D0BC2BF36F@gmail.com> (raw)
In-Reply-To: <559D2879.30602@ge.com>


> On 08 Jul 2015, at 16:41, Martyn Welch <martyn.welch@ge.com> wrote:
> 
> On 07/07/15 13:51, Alessio Igor Bogani wrote:
>>> Current VME stack links windows not to the boards, but to device drivers.
>>> >Driver
>>> >could potentially minimise window usage within it’s scope (any sort of
>>> >window
>>> >reusing, like mapping whole A16 once to be used with all boards), but this
>>> >won’t
>>> >work across multiple drivers. Even if all of your drivers are window-wise
>>> >economic,
>>> >they will still need some amount of windows per each driver. Not that we
>>> >have that
>>> >many kernel drivers...
>> Yes you can share a window/image between all boards of the same type
>> (in effect we are porting our drivers in this way)*but*  it isn't the
>> expected way to work (see Documentation/vme_api.txt struct
>> vme_driver's probe() and match() functions and the GE PIO2 VME
>> driver).
> 
> I think it's perfectly valid to use a single window to dynamically map to the address space belonging to one of a number of devices supported by a single driver. I think this is almost preferable to mapping a large window over a large portion of the VME address space to drive a number of devices as (depending on there spacing in the VME address space) the latter could cause issues with filling available PCI address space. Admittedly this is more of a problem on 32-bit systems, but…

Speaking of which. We do have 32 bit SBC’s (Fastwell CPC600) and there we can only map up to 32mb. If we drop an unnecessary alignment requirement, this can be raised up to 63mb. The next comes a hack that is a bit dirty: changing pdev->bus to something like pdev->bus->parent. Then maximal VME window size is only limited by vmalloc memory which on 32bit system can be raised up to ~700 mb by adding vmalloc=768M to kernel argument line.

For the reference, here is the iomem mapping of the working system without the hack (also some window mappings are already done):

% cat /proc/iomem 
00000000-00000fff : reserved
00001000-00097fff : System RAM
00098000-0009ffff : reserved
000a0000-000bffff : PCI Bus 0000:00
  000a0000-000bffff : Video RAM area
000c0000-000c7fff : Video ROM
000d0000-000d0fff : Adapter ROM
000d1000-000d29ff : Adapter ROM
000d3000-000d3fff : Adapter ROM
000d4000-000d4fff : Adapter ROM
000d8000-000dbfff : PCI Bus 0000:00
000dc000-000fffff : reserved
  000f0000-000fffff : System ROM
00100000-3de8ffff : System RAM
  01000000-01822261 : Kernel code
  01822262-01ca4e3f : Kernel data
  01da1000-01e6dfff : Kernel bss
3de90000-3de96fff : ACPI Tables
3de97000-3defffff : ACPI Non-volatile Storage
3df00000-3fffffff : reserved
40000000-febfffff : PCI Bus 0000:00
  d8000000-d807ffff : 0000:00:02.0
  d8080000-d80fffff : 0000:00:02.1
  d8100000-d810000f : 0000:00:1d.4
  d8100400-d81007ff : 0000:00:1d.7
    d8100400-d81007ff : ehci_hcd
  d8200000-dfffffff : PCI Bus 0000:02
    d8200000-d821ffff : 0000:02:00.0
      d8200000-d821ffff : e1000
    d8220000-d823ffff : 0000:02:00.1
      d8220000-d823ffff : e1000
    d8240000-d825ffff : 0000:02:01.0
      d8240000-d825ffff : e1000
    d8260000-d827ffff : 0000:02:01.1
      d8260000-d827ffff : e1000
    d8280000-d82fffff : vme_tsi148.7
    d8300000-d830ffff : vme_tsi148.0
    d8310000-d930ffff : vme_tsi148.3
    d9310000-d931ffff : vme_tsi148.2
    dc000000-dc000fff : 0000:02:02.0
      dc000000-dc000fff : vme_tsi148
  e8000000-efffffff : 0000:00:02.0
  f0000000-f7ffffff : 0000:00:02.1
fec00000-fec003ff : IOAPIC 0
fec10000-fec103ff : IOAPIC 1
fee00000-feefffff : pnp 00:01
  fee00000-fee00fff : Local APIC
    fee00000-fee00fff : pnp 00:02
feff0000-feffffff : reserved
  feff0000-feffffff : pnp 00:01
ff800000-ffffffff : INT0800:00
  ff800000-ffbfffff : reserved
  fffffc00-ffffffff : reserved


  reply	other threads:[~2015-07-08 14:39 UTC|newest]

Thread overview: 49+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-28 12:06 [PATCHv3 00/16] vme DMA and user space driver improvements Dmitry Kalinkin
2015-05-28 12:06 ` [PATCHv3 01/16] Documentation: mention vme_master_mmap() in VME API Dmitry Kalinkin
2015-05-28 12:06 ` [PATCHv3 02/16] vme: tsi148: fix DMA lists longer that one item Dmitry Kalinkin
2015-05-28 12:07 ` [PATCHv3 03/16] vme: tsi148: fix first DMA item mapping Dmitry Kalinkin
2015-05-28 12:07 ` [PATCHv3 04/16] vme: stop DMA transfer on interruption Dmitry Kalinkin
2015-05-28 12:07 ` [PATCHv3 05/16] staging: vme_user: refactor llseek to switch(){} Dmitry Kalinkin
2015-05-28 12:07 ` [PATCHv3 06/16] vme: check for A64 overflow in vme_check_window() Dmitry Kalinkin
2015-05-28 12:07 ` [PATCHv3 07/16] vme: export vme_check_window() Dmitry Kalinkin
2015-05-28 12:07 ` [PATCHv3 08/16] staging: vme_user: provide DMA functionality Dmitry Kalinkin
2015-06-13  0:28   ` Greg Kroah-Hartman
2015-07-06 13:22     ` Martyn Welch
2015-07-06 13:50       ` Dmitry Kalinkin
2015-07-06 14:48         ` Martyn Welch
2015-07-06 17:24           ` Dmitry Kalinkin
2015-07-07  7:13             ` Alessio Igor Bogani
     [not found]             ` <CAPk1OjEX7YX5J=yMPOGyGg7ZT6P-iKtaGRDDv2oARPFUcdnKnQ@mail.gmail.com>
2015-07-07 10:52               ` Dmitry Kalinkin
2015-07-08 13:57                 ` Martyn Welch
2015-07-08 14:47                   ` Dmitry Kalinkin
     [not found]               ` <78FC1849-FFE4-49E5-8421-25D27324F790@gmail.com>
2015-07-07 12:51                 ` Alessio Igor Bogani
2015-07-07 13:04                   ` Dmitry Kalinkin
2015-07-08 13:41                   ` Martyn Welch
2015-07-08 14:39                     ` Dmitry Kalinkin [this message]
2015-07-08 14:42                     ` [PATCH] vme: lower alignment requirement in pci bridge drivers Dmitry Kalinkin
2015-07-08 13:28               ` [PATCHv3 08/16] staging: vme_user: provide DMA functionality Martyn Welch
2015-07-08 13:22             ` Martyn Welch
2015-07-08 15:02               ` Generic VME UIO driver Dmitry Kalinkin
2015-07-20  8:09                 ` Martyn Welch
2015-05-28 12:07 ` [PATCHv3 09/16] vme: ca91cx42: return error code on DMA error Dmitry Kalinkin
2015-05-28 12:07 ` [PATCHv3 10/16] vme: ca91cx42: fix LM_CTL address mask Dmitry Kalinkin
2015-05-28 12:07 ` [PATCHv3 11/16] staging: vme_user: remove unused counters Dmitry Kalinkin
2015-05-28 12:07 ` [PATCHv3 12/16] staging: vme_user: remove forward declarations Dmitry Kalinkin
2015-05-28 12:07 ` [PATCHv3 13/16] staging: vme_user: remove open/release Dmitry Kalinkin
2015-05-28 12:07 ` [PATCHv3 14/16] staging: vme_user: remove buf_unalloc helper Dmitry Kalinkin
2015-05-28 12:07 ` [PATCHv3 15/16] vme: tsi148: depend on HAS_DMA for Kconfig Dmitry Kalinkin
2015-05-28 12:07 ` [PATCHv3 16/16] vme: provide uapi header Dmitry Kalinkin
2015-06-13  0:30   ` Greg Kroah-Hartman
2015-05-31  3:06 ` [PATCHv3 00/16] vme DMA and user space driver improvements Greg Kroah-Hartman
2015-06-10 13:09   ` Dmitry Kalinkin
2015-06-13  0:31     ` Greg Kroah-Hartman
2015-06-13  2:04       ` Dmitry Kalinkin
2015-06-13  2:24         ` Greg Kroah-Hartman
2015-06-13  2:30           ` Dmitry Kalinkin
2015-06-13  4:40             ` Greg Kroah-Hartman
2015-06-13 13:34               ` [PATCHv4 0/4] " Dmitry Kalinkin
2015-06-13 13:34                 ` [PATCHv4 1/4] staging: vme_user: remove forward declarations Dmitry Kalinkin
2015-06-13 13:34                 ` [PATCHv4 2/4] staging: vme_user: remove open/release Dmitry Kalinkin
2015-06-13 13:34                 ` [PATCHv4 3/4] staging: vme_user: remove buf_unalloc helper Dmitry Kalinkin
2015-06-13 13:34                 ` [PATCHv4 4/4] staging: vme_user: provide DMA functionality Dmitry Kalinkin
2015-06-13 21:47                 ` [PATCHv4 0/4] vme DMA and user space driver improvements Greg Kroah-Hartman

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=476EC692-520C-499E-9564-A0D0BC2BF36F@gmail.com \
    --to=dmitry.kalinkin@gmail.com \
    --cc=alessioigorbogani@gmail.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=igor.alekseev@itep.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manohar.vanga@gmail.com \
    --cc=martyn.welch@ge.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 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®