Subject: Re: [PATCH 2/9] Move dma_ops from archdata into struct device

From: Greg Kroah-Hartman <[email-masked]>
Date: Wed, 11 Jan 2017 07:46:24 +0100

On Tue, Jan 10, 2017 at 04:56:41PM -0800, Bart Van Assche wrote:
> Several RDMA drivers, e.g. drivers/infiniband/hw/qib, use the CPU to
> transfer data between memory and PCIe adapter. Because of performance
> reasons it is important that the CPU cache is not flushed when such
> drivers transfer data. Make this possible by allowing these drivers to
> override the dma_map_ops pointer. Additionally, introduce the function
> set_dma_ops() that will be used by a later patch in this series.
> 
> Signed-off-by: Bart Van Assche <[email-masked]>
> Cc: Greg Kroah-Hartman <[email-masked]>
> Cc: Aurelien Jacquiot <[email-masked]>
> Cc: Catalin Marinas <[email-masked]>
> Cc: Chris Zankel <[email-masked]>
> Cc: David Howells <[email-masked]>
> Cc: David S. Miller <[email-masked]>
> Cc: Fenghua Yu <[email-masked]>
> Cc: Geert Uytterhoeven <[email-masked]>
> Cc: Geoff Levand <[email-masked]>
> Cc: H. Peter Anvin <[email-masked]>
> Cc: Haavard Skinnemoen <[email-masked]>
> Cc: Hans-Christian Egtvedt <[email-masked]>
> Cc: Helge Deller <[email-masked]>
> Cc: Ingo Molnar <[email-masked]>
> Cc: James E.J. Bottomley <[email-masked]>
> Cc: Jesper Nilsson <[email-masked]>
> Cc: Joerg Roedel <[email-masked]>
> Cc: Jon Mason <[email-masked]>
> Cc: Jonas Bonn <[email-masked]>
> Cc: Ley Foon Tan <[email-masked]>
> Cc: Mark Salter <[email-masked]>
> Cc: Max Filippov <[email-masked]>
> Cc: Mikael Starvik <[email-masked]>
> Cc: Muli Ben-Yehuda <[email-masked]>
> Cc: Rich Felker <[email-masked]>
> Cc: Russell King <[email-masked]>
> Cc: Stafford Horne <[email-masked]>
> Cc: Stefan Kristiansson <[email-masked]>
> Cc: Thomas Gleixner <[email-masked]>
> Cc: Tony Luck <[email-masked]>
> Cc: Will Deacon <[email-masked]>
> Cc: [email-masked]
> Cc: Yoshinori Sato <[email-masked]>
> Cc: [email-masked]
> Cc: [email-masked]
> Cc: [email-masked]
> Cc: [email-masked]
> Cc: [email-masked]
> Cc: [email-masked]
> Cc: [email-masked]
> Cc: [email-masked]
> Cc: [email-masked]
> Cc: [email-masked]
> Cc: [email-masked]
> Cc: [email-masked]
> Cc: [email-masked]
> Cc: [email-masked]
> Cc: [email-masked]
> Cc: [email-masked]
> Cc: [email-masked]
> Cc: [email-masked]
> Cc: [email-masked]
> Cc: [email-masked]
> Cc: [email-masked]
> Cc: [email-masked]
> Cc: [email-masked]
> Cc: [email-masked]

That's a crazy cc: list, you should break this up into smaller pieces,
otherwise it's going to bounce...

> diff --git a/include/linux/device.h b/include/linux/device.h
> index 491b4c0ca633..c7cb225d36b0 100644
> --- a/include/linux/device.h
> +++ b/include/linux/device.h
> @@ -885,6 +885,8 @@ struct dev_links_info {
>   * a higher-level representation of the device.
>   */
>  struct device {
> +	const struct dma_map_ops *dma_ops; /* See also get_dma_ops() */
> +
>  	struct device		*parent;
>  
>  	struct device_private	*p;

Why not put this new pointer down with the other dma fields in this
structure?  Any specific reason it needs to be first?

thanks,

greg k-h