From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751399AbdILHFy (ORCPT ); Tue, 12 Sep 2017 03:05:54 -0400 Received: from smtpbgbr2.qq.com ([54.207.22.56]:51050 "EHLO smtpbgbr2.qq.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751015AbdILHFx (ORCPT ); Tue, 12 Sep 2017 03:05:53 -0400 X-QQ-mid: bizesmtp15t1505199926thl4sj0u X-QQ-SSF: 01100000008000F0FMF0B00A0000000 X-QQ-FEAT: HrKUqYRgvQs/vaWNGNcQ4y/evu4kc0qldD7amuiaCFHL/+l3AuhCJA0Ipsepx cUsyzS3ZY8kicbQIqkPkEuTt9E3ecDPhsFPfs2PwxeQyGbzZmosYrcPwNUFAco8/Pla6mFk N4ktBK/E3Fl+/kVn3o87kHZl+uT4Nl0DDz/epcsC0YrJ6h0RFgAgcE360a2nGKmHYTILLwB U9akVpVVhBNGvL0gG0Znq35GxVq8zxByMTevuZi5RuvktfJRnS2L/WvXfuoq4jhCGJNZ1kz edcS/vQ70NFQpnQXtdQ6LgEtv5lId/jekVQI563fDKRsPi X-QQ-GoodBg: 0 From: Huacai Chen To: Christoph Hellwig Cc: Marek Szyprowski , Robin Murphy , Fuxin Zhang , linux-kernel@vger.kernel.org, Huacai Chen , stable@vger.kernel.org Subject: [PATCH V2 1/3] dma-mapping: Provide a default plat_device_is_coherent() Date: Tue, 12 Sep 2017 15:07:04 +0800 Message-Id: <1505200024-22238-1-git-send-email-chenhc@lemote.com> X-Mailer: git-send-email 2.7.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:lemote.com:qybgforeign:qybgforeign4 X-QQ-Bgrelay: 1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We will use plat_device_is_coherent() in generic cases, but it is MIPS-specific now. So we provide a default implementation. Cc: stable@vger.kernel.org Signed-off-by: Huacai Chen --- arch/mips/include/asm/dma-mapping.h | 1 + include/linux/dma-mapping.h | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/arch/mips/include/asm/dma-mapping.h b/arch/mips/include/asm/dma-mapping.h index aba7138..662eca9 100644 --- a/arch/mips/include/asm/dma-mapping.h +++ b/arch/mips/include/asm/dma-mapping.h @@ -8,6 +8,7 @@ #ifndef CONFIG_SGI_IP27 /* Kludge to fix 2.6.39 build for IP27 */ #include #endif +#define ARCH_HAS_PLAT_DEVICE_IS_COHERENT extern const struct dma_map_ops *mips_dma_map_ops; diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index 2189c79..613a80e 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h @@ -710,6 +710,14 @@ static inline void *dma_zalloc_coherent(struct device *dev, size_t size, } #ifdef CONFIG_HAS_DMA + +#ifndef ARCH_HAS_PLAT_DEVICE_IS_COHERENT +static inline int plat_device_is_coherent(struct device *dev) +{ + return 1; +} +#endif + static inline int dma_get_cache_alignment(void) { #ifdef ARCH_DMA_MINALIGN -- 2.7.0