atomisp: remove contiguous handling
authorAlan Cox <alan@linux.intel.com>
Wed, 12 Apr 2017 18:21:59 +0000 (19:21 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 Apr 2017 08:07:27 +0000 (10:07 +0200)
The base hmm MMU code doesn't support contiguous allocations (they BUG), so
remove support from them from the higher levels of the heirarchy.

We still need to unwind all these layers but it turns out that some of the init
order stuff is rather sensitive and the simple cleanup breaks everything

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/media/atomisp/pci/atomisp2/css2400/ia_css_memory_access.c
drivers/staging/media/atomisp/pci/atomisp2/hrt/hive_isp_css_mm_hrt.c
drivers/staging/media/atomisp/pci/atomisp2/hrt/hive_isp_css_mm_hrt.h
drivers/staging/media/atomisp/pci/atomisp2/hrt/memory_access.c

index 8d559aa73cb0209f1a16a826a867620fe46d5794..1f6ae203cb12953d6e1596e85be7b8a4d97716b5 100644 (file)
@@ -31,31 +31,18 @@ mmgr_malloc(const size_t size)
 hrt_vaddress mmgr_alloc_attr(const size_t size, const uint16_t attrs)
 {
        uint16_t masked_attrs = attrs & MMGR_ATTRIBUTE_MASK;
+       WARN_ON(attrs & MMGR_ATTRIBUTE_CONTIGUOUS);
 
        if (masked_attrs & MMGR_ATTRIBUTE_CLEARED) {
-               if (masked_attrs & MMGR_ATTRIBUTE_CACHED) {
-                       if (masked_attrs & MMGR_ATTRIBUTE_CONTIGUOUS)
-                               return (ia_css_ptr) hrt_isp_css_mm_calloc_contiguous(size);
-                       else
-                               return (ia_css_ptr) hrt_isp_css_mm_calloc_cached(size);
-               } else {
-                       if (masked_attrs & MMGR_ATTRIBUTE_CONTIGUOUS)
-                               return (ia_css_ptr) hrt_isp_css_mm_calloc_contiguous(size);
-                       else
-                               return (ia_css_ptr) hrt_isp_css_mm_calloc(size);
-               }
+               if (masked_attrs & MMGR_ATTRIBUTE_CACHED)
+                       return (ia_css_ptr) hrt_isp_css_mm_calloc_cached(size);
+               else
+                       return (ia_css_ptr) hrt_isp_css_mm_calloc(size);
        } else {
-               if (masked_attrs & MMGR_ATTRIBUTE_CACHED) {
-                       if (masked_attrs & MMGR_ATTRIBUTE_CONTIGUOUS)
-                               return (ia_css_ptr) hrt_isp_css_mm_alloc_contiguous(size);
-                       else
-                               return (ia_css_ptr) hrt_isp_css_mm_alloc_cached(size);
-               } else {
-                       if (masked_attrs & MMGR_ATTRIBUTE_CONTIGUOUS)
-                               return (ia_css_ptr) hrt_isp_css_mm_alloc_contiguous(size);
-                       else
-                               return (ia_css_ptr) hrt_isp_css_mm_alloc(size);
-               }
+               if (masked_attrs & MMGR_ATTRIBUTE_CACHED)
+                       return (ia_css_ptr) hrt_isp_css_mm_alloc_cached(size);
+               else
+                       return (ia_css_ptr) hrt_isp_css_mm_alloc(size);
        }
 }
 
index 9f8267ad06b1b5b3751e35ee0f152a94425da91b..78b470983ec5c43bff2abb65d35d4671222302d1 100644 (file)
@@ -180,14 +180,3 @@ phys_addr_t hrt_isp_css_virt_to_phys(ia_css_ptr virt_addr)
        return hmm_virt_to_phys(virt_addr);
 }
 
-ia_css_ptr hrt_isp_css_mm_alloc_contiguous(size_t bytes)
-{
-       BUG_ON(false);
-       return 0;
-}
-ia_css_ptr hrt_isp_css_mm_calloc_contiguous(size_t bytes)
-{
-       BUG_ON(false);
-       return 0;
-}
-
index 41c6d14ca61104940ead321fe66952d376227e17..47832068501b9b8147bbfd4c18b0a526bffa3388 100644 (file)
@@ -81,8 +81,5 @@ int hrt_isp_css_mm_store_int(ia_css_ptr virt_addr, int data);
    the display driver on  the FPGA system */
 phys_addr_t hrt_isp_css_virt_to_phys(ia_css_ptr virt_addr);
 
-ia_css_ptr hrt_isp_css_mm_alloc_contiguous(size_t bytes);
-ia_css_ptr hrt_isp_css_mm_calloc_contiguous(size_t bytes);
-
 void hrt_isp_css_mm_clear(void);
 #endif /* _hive_isp_css_mm_hrt_h_ */
index dcc4c916982ba3192f5fae6c9ecd93fe3443ff00..7694ee480cfcd2bdc855dc21470baa22489bbd31 100644 (file)
@@ -60,42 +60,23 @@ ia_css_ptr mmgr_alloc_attr(const size_t     size, const uint16_t attribute)
 
        assert(page_table_base_address != (sys_address)-1);
        assert((attribute & MMGR_ATTRIBUTE_UNUSED) == 0);
+       WARN_ON(attribute & MMGR_ATTRIBUTE_CONTIGUOUS);
 
        if (attribute & MMGR_ATTRIBUTE_CLEARED) {
                if (attribute & MMGR_ATTRIBUTE_CACHED) {
-                       if (attribute & MMGR_ATTRIBUTE_CONTIGUOUS) /* { */
-                               ptr = hrt_isp_css_mm_calloc_contiguous(
+                       ptr = hrt_isp_css_mm_calloc_cached(
                                                aligned_size + extra_space);
-                       /* } */ else /* { */
-                               ptr = hrt_isp_css_mm_calloc_cached(
-                                               aligned_size + extra_space);
-                       /* } */
                } else { /* !MMGR_ATTRIBUTE_CACHED */
-                       if (attribute & MMGR_ATTRIBUTE_CONTIGUOUS) /* { */
-                               ptr = hrt_isp_css_mm_calloc_contiguous(
-                                               aligned_size + extra_space);
-                       /* } */ else /* { */
-                               ptr = hrt_isp_css_mm_calloc(
+                       ptr = hrt_isp_css_mm_calloc(
                                                aligned_size + extra_space);
-                       /* } */
                }
        } else { /* MMGR_ATTRIBUTE_CLEARED */
                if (attribute & MMGR_ATTRIBUTE_CACHED) {
-                       if (attribute & MMGR_ATTRIBUTE_CONTIGUOUS) /* { */
-                               ptr = hrt_isp_css_mm_alloc_contiguous(
-                                               aligned_size + extra_space);
-                       /* } */ else /* { */
-                               ptr = hrt_isp_css_mm_alloc_cached(
+                       ptr = hrt_isp_css_mm_alloc_cached(
                                                aligned_size + extra_space);
-                       /* } */
                } else { /* !MMGR_ATTRIBUTE_CACHED */
-                       if (attribute & MMGR_ATTRIBUTE_CONTIGUOUS) /* { */
-                               ptr = hrt_isp_css_mm_alloc_contiguous(
-                                               aligned_size + extra_space);
-                       /* } */ else /* { */
-                               ptr = hrt_isp_css_mm_alloc(
-                                               aligned_size + extra_space);
-                       /* } */
+                       ptr = hrt_isp_css_mm_alloc(
+                                       aligned_size + extra_space);
                }
        }
        return ptr;