lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <201210241224.06791.arnd@arndb.de>
Date:	Wed, 24 Oct 2012 12:24:06 +0000
From:	Arnd Bergmann <arnd@...db.de>
To:	Gregory CLEMENT <gregory.clement@...e-electrons.com>
Cc:	Lior Amsalem <alior@...vell.com>, Andrew Lunn <andrew@...n.ch>,
	Ike Pan <ike.pan@...onical.com>,
	Nadav Haklai <nadavh@...vell.com>,
	Ian Molton <ian.molton@...ethink.co.uk>,
	David Marlin <dmarlin@...hat.com>,
	Yehuda Yitschak <yehuday@...vell.com>,
	Jani Monoses <jani.monoses@...onical.com>,
	Russell King <linux@....linux.org.uk>,
	Tawfik Bayouk <tawfik@...vell.com>,
	Dan Frazier <dann.frazier@...onical.com>,
	"Eran Ben-Avi" <benavi@...vell.com>,
	Leif Lindholm <leif.lindholm@....com>,
	Sebastian Hesselbarth <sebastian.hesselbarth@...il.com>,
	Jason Cooper <jason@...edaemon.net>,
	Jon Masters <jcm@...hat.com>,
	Rob Herring <rob.herring@...xeda.com>,
	Ben Dooks <ben-linux@...ff.org>,
	linux-arm-kernel@...ts.infradead.org,
	Thomas Petazzoni <thomas.petazzoni@...e-electrons.com>,
	Chris Van Hoof <vanhoof@...onical.com>,
	Nicolas Pitre <nico@...xnic.net>, linux-kernel@...r.kernel.org,
	Maen Suleiman <maen@...vell.com>,
	Shadi Ammouri <shadi@...vell.com>,
	Olof Johansson <olof@...om.net>
Subject: Re: [PATCH 2/2] arm: mvebu: Add hardware I/O Coherency support

On Wednesday 24 October 2012, Gregory CLEMENT wrote:
> On 10/24/2012 01:48 PM, Gregory CLEMENT wrote:
> > On 10/24/2012 01:36 PM, Arnd Bergmann wrote:
> >>
> >> I think it would be cleaner to statically define the operations in a constant
> >> structure and point directly to the functions you need. If necessary, use
> >> multiple structures.
> > 
> > My problem was that these functions are not exposed, only arm_dma_op and
> > arm_coherent_dma_ops are exported.
> > Or do you think about something like this:
>
> struct dma_map_ops *dma_ops = {
>         .alloc                  = arm_coherent_dma_ops.arm_coherent_dma_alloc,
>         .free                   = arm_coherent_dma_ops.arm_coherent_dma_free,
>         .mmap                   = arm_coherent_dma_ops.arm_dma_mmap,
>         .get_sgtable            = arm_coherent_dma_ops.arm_dma_get_sgtable,
>         .map_sg                 = arm_coherent_dma_ops.arm_dma_map_sg,
>         .set_dma_mask           = arm_coherent_dma_ops.arm_dma_set_mask,
>         .map_page               = armada_xp_dma_map_page,
>         .unmap_page             = armada_xp_dma_unmap_page,
>         .unmap_sg               = arm_dma_ops.unmap_sg,
>         .sync_single_for_cpu    = armada_xp_dma_sync,
>         .sync_single_for_device = armada_xp_dma_sync,
>         .sync_sg_for_cpu        = arm_dma_ops.sync_sg_for_cpu,
>         .sync_sg_for_device     = arm_dma_ops.sync_sg_for_device,
> };

No, I was thinking of making the underlying functions globally visible
and have extern declarations in a header file so you can access them
directly.

Generally speaking, when you run into a problem with common code, your
first approach should be to fix the common code before you try to work
around it.

	Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ