Subject: Re: DMA troubles
To: Filka Michal <michal.filka@strom.cz>
From: Quentin Garnier <cube@cubidou.net>
List: tech-kern
Date: 04/26/2006 12:05:44
--ftQmbtOmUf2cr8rB
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Apr 26, 2006 at 11:57:58AM +0200, Filka Michal wrote:
> > > > > Hi all,
> > > > > I have a problem (possibly) with DMA. I can allocate a DMA
> memory in
> > > my
> > > > > driver and work with it without any troubles. However, If I
> unload
> > > > > driver (it is a LKM) and try to load it again, kernel crashes
> during
> > > DMA
> > > > > memory allocation. I did a DMA deinitialization when unloading
> > > driver
> > > >
> > > > How does it crash ?
> > >
> > > ... it breaks into kernel debugger (Page fault trap) during the call
> of
> > > "bus_dmamem_alloc". I made a simple skeleton of my driver which is
> only
> > > loaded and unloaded and it still fails in second attempt for loading
> it.
> > > First attempt loads/unloads without any troubles. All this happens
> even
> > > if I do only "..._alloc" and "..._free" with no other operations on
> > > DMAed memory.
> > >
> > > Any ideas are very welcome.
> >=20
> > I'm afraid you'll have to show some code to get welcomed ideas...
> ... I have already put it in initial message. Of course I can copy it
> here again.

I'd expect the error to be somewhere else.  E.g., I'm not seeing when
you do that allocation, nor when you do the deallocation.

--=20
Quentin Garnier - cube@cubidou.net - cube@NetBSD.org
"When I find the controls, I'll go where I like, I'll know where I want
to be, but maybe for now I'll stay right here on a silent sea."
KT Tunstall, Silent Sea, Eye to the Telescope, 2004.

--ftQmbtOmUf2cr8rB
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.6 (NetBSD)

iQEVAwUBRE9F+NgoQloHrPnoAQK6LQf+LmRccyhTqsWnlCEr5zl6tpd1V+P9tikx
eRDTdHO5Wl97CBxjMUJTetDngH+5h7Tti/1v7CK/Npc0Ppb49pgT3eDNklZwGOg4
mSKVfHhOh+aqC0gB4uz0gXcs/1LPZgGieDachFv9LK8XS2J57UNembrjC8A+mDqi
0O45Umg6wxKKgfhHHMrErlHnUFLK0FtHZzpNg18AgqY3f6xloSPsOT4Hz1mzCE3V
4MZJCWkgH7FUt3WHDDcySU1twLvnfi58fo8zzE2ZcnFUKd1S/HRFXkzcIRl3bW/1
e9DzELZ7x9NUNJRrJlV6H6tQtMshifJ5MFHBkAJBYjzGO7NvyH2h/g==
=Awpv
-----END PGP SIGNATURE-----

--ftQmbtOmUf2cr8rB--