Re: [PATCH 3/3] iommu: Enable compile testing for some of drivers

2020-01-03 Thread Krzysztof Kozlowski
On Thu, Jan 02, 2020 at 04:40:16PM -0600, Suman Anna wrote:
> Hi Krzysztof,
> 
> On 12/31/19 2:07 AM, Krzysztof Kozlowski wrote:
> > On Tue, Dec 31, 2019 at 03:43:39PM +0800, kbuild test robot wrote:
> >> Hi Krzysztof,
> >>
> >> I love your patch! Perhaps something to improve:
> >>
> >> [auto build test WARNING on iommu/next]
> >> [also build test WARNING on v5.5-rc4]
> >> [if your patch is applied to the wrong git tree, please drop us a note to 
> >> help
> >> improve the system. BTW, we also suggest to use '--base' option to specify 
> >> the
> >> base tree in git format-patch, please see 
> >> https://stackoverflow.com/a/37406982]
> >>
> >> url:
> >> https://github.com/0day-ci/linux/commits/Krzysztof-Kozlowski/iommu-omap-Fix-pointer-cast-Wpointer-to-int-cast-warnings-on-64-bit/20191231-022212
> >> base:   https://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git next
> >> config: ia64-allmodconfig (attached as .config)
> >> compiler: ia64-linux-gcc (GCC) 7.5.0
> >> reproduce:
> >> wget 
> >> https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross 
> >> -O ~/bin/make.cross
> >> chmod +x ~/bin/make.cross
> >> # save the attached .config to linux build tree
> >> GCC_VERSION=7.5.0 make.cross ARCH=ia64 
> >>
> >> If you fix the issue, kindly add following tag
> >> Reported-by: kbuild test robot 
> > 
> > I saw it already while compile testing my patch. I must admit that I
> > could not find easy/fast fix for it.  Probably the
> > omap_iommu_translate() helper should be made 64-bit friendly but this
> > obfuscates the code. 
> 
> >The driver and hardware supports only 32-bit addresses.
> 
> Yeah, is there a reason why you are trying to enable the build for the
> OMAP IOMMU driver on 64-bit platforms or other architectures - the IP
> and driver is only ever used on ARMv7 platforms, and it should already
> be available for COMPILE_TEST on those.

It's the same reason we enable compile testing on all other drivers
which will never be used outside original platforms. There are many
of such examples because we want to increase the build coverage to as
many different configurations as possible. There could be also another
benefit - easier code reusability - although it is purely theoretical in
this case, I think.

Best regards,
Krzysztof
___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu


Re: [PATCH 3/3] iommu: Enable compile testing for some of drivers

2020-01-02 Thread Suman Anna via iommu
Hi Krzysztof,

On 12/31/19 2:07 AM, Krzysztof Kozlowski wrote:
> On Tue, Dec 31, 2019 at 03:43:39PM +0800, kbuild test robot wrote:
>> Hi Krzysztof,
>>
>> I love your patch! Perhaps something to improve:
>>
>> [auto build test WARNING on iommu/next]
>> [also build test WARNING on v5.5-rc4]
>> [if your patch is applied to the wrong git tree, please drop us a note to 
>> help
>> improve the system. BTW, we also suggest to use '--base' option to specify 
>> the
>> base tree in git format-patch, please see 
>> https://stackoverflow.com/a/37406982]
>>
>> url:
>> https://github.com/0day-ci/linux/commits/Krzysztof-Kozlowski/iommu-omap-Fix-pointer-cast-Wpointer-to-int-cast-warnings-on-64-bit/20191231-022212
>> base:   https://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git next
>> config: ia64-allmodconfig (attached as .config)
>> compiler: ia64-linux-gcc (GCC) 7.5.0
>> reproduce:
>> wget 
>> https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
>> ~/bin/make.cross
>> chmod +x ~/bin/make.cross
>> # save the attached .config to linux build tree
>> GCC_VERSION=7.5.0 make.cross ARCH=ia64 
>>
>> If you fix the issue, kindly add following tag
>> Reported-by: kbuild test robot 
> 
> I saw it already while compile testing my patch. I must admit that I
> could not find easy/fast fix for it.  Probably the
> omap_iommu_translate() helper should be made 64-bit friendly but this
> obfuscates the code. 

>The driver and hardware supports only 32-bit addresses.

Yeah, is there a reason why you are trying to enable the build for the
OMAP IOMMU driver on 64-bit platforms or other architectures - the IP
and driver is only ever used on ARMv7 platforms, and it should already
be available for COMPILE_TEST on those.

regards
Suman

> 
> Best regards,
> Krzysztof
> 
> 
>>
>> All warnings (new ones prefixed by >>):
>>
>>In file included from drivers/iommu/omap-iommu.c:33:0:
>>drivers/iommu/omap-iommu.c: In function 'omap_iommu_iova_to_phys':
 drivers/iommu/omap-iopgtable.h:44:21: warning: large integer implicitly 
 truncated to unsigned type [-Woverflow]
>> #define IOPTE_MASK  (~(IOPTE_SIZE - 1))
>> ^
 drivers/iommu/omap-iommu.c:1641:41: note: in expansion of macro 
 'IOPTE_MASK'
>>ret = omap_iommu_translate(*pte, da, IOPTE_MASK);
>> ^~
>>drivers/iommu/omap-iopgtable.h:51:23: warning: large integer implicitly 
>> truncated to unsigned type [-Woverflow]
>> #define IOLARGE_MASK  (~(IOLARGE_SIZE - 1))
>>   ^
 drivers/iommu/omap-iommu.c:1643:41: note: in expansion of macro 
 'IOLARGE_MASK'
>>ret = omap_iommu_translate(*pte, da, IOLARGE_MASK);
>> ^~~~
>>drivers/iommu/omap-iopgtable.h:27:25: warning: large integer implicitly 
>> truncated to unsigned type [-Woverflow]
>> #define IOSECTION_MASK  (~(IOSECTION_SIZE - 1))
>> ^
 drivers/iommu/omap-iommu.c:1649:41: note: in expansion of macro 
 'IOSECTION_MASK'
>>ret = omap_iommu_translate(*pgd, da, IOSECTION_MASK);
>> ^~
>>drivers/iommu/omap-iopgtable.h:34:23: warning: large integer implicitly 
>> truncated to unsigned type [-Woverflow]
>> #define IOSUPER_MASK  (~(IOSUPER_SIZE - 1))
>>   ^
 drivers/iommu/omap-iommu.c:1651:41: note: in expansion of macro 
 'IOSUPER_MASK'
>>ret = omap_iommu_translate(*pgd, da, IOSUPER_MASK);
>> ^~~~
>>
>> vim +44 drivers/iommu/omap-iopgtable.h
>>
>> 97ec7d585b33bb arch/arm/plat-omap/iopgtable.h Hiroshi DOYU 2010-02-15  38  
>> 97ec7d585b33bb arch/arm/plat-omap/iopgtable.h Hiroshi DOYU 2010-02-15  39  /*
>> 97ec7d585b33bb arch/arm/plat-omap/iopgtable.h Hiroshi DOYU 2010-02-15  40   
>> * "small page" address mask and size definitions.
>> 97ec7d585b33bb arch/arm/plat-omap/iopgtable.h Hiroshi DOYU 2010-02-15  41   
>> */
>> a9dcad5e375800 arch/arm/plat-omap/iopgtable.h Hiroshi DOYU 2009-01-26  42  
>> #define IOPTE_SHIFT   12
>> 5ff98fa68c88d7 drivers/iommu/omap-iopgtable.h Suman Anna   2015-07-20  43  
>> #define IOPTE_SIZEBIT(IOPTE_SHIFT)
>> a9dcad5e375800 arch/arm/plat-omap/iopgtable.h Hiroshi DOYU 2009-01-26 @44  
>> #define IOPTE_MASK(~(IOPTE_SIZE - 1))
>> a9dcad5e375800 arch/arm/plat-omap/iopgtable.h Hiroshi DOYU 2009-01-26  45  
>>
>> :: The code at line 44 was first introduced by commit
>> :: a9dcad5e375800fcb07f7617dba23b3aade8f09d omap iommu: tlb and 
>> pagetable primitives
>>
>> :: TO: Hiroshi DOYU 
>> :: CC: Hiroshi DOYU 
>>
>> ---
>> 0-DAY kernel test infrastructure Open Source Technology 
>> Center
>> https://lists.01.org/hyperkitty/list/kbuild-...@lists.01.org Intel 
>> Corporation
> 
> 


Re: [PATCH 3/3] iommu: Enable compile testing for some of drivers

2019-12-31 Thread Krzysztof Kozlowski
On Tue, Dec 31, 2019 at 09:08:38AM +0800, kbuild test robot wrote:
> Hi Krzysztof,
> 
> I love your patch! Yet something to improve:
> 
> [auto build test ERROR on iommu/next]
> [also build test ERROR on v5.5-rc4 next-20191219]
> [if your patch is applied to the wrong git tree, please drop us a note to help
> improve the system. BTW, we also suggest to use '--base' option to specify the
> base tree in git format-patch, please see 
> https://stackoverflow.com/a/37406982]
> 
> url:
> https://github.com/0day-ci/linux/commits/Krzysztof-Kozlowski/iommu-omap-Fix-pointer-cast-Wpointer-to-int-cast-warnings-on-64-bit/20191231-022212
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git next
> config: sparc64-allmodconfig (attached as .config)
> compiler: sparc64-linux-gcc (GCC) 7.5.0
> reproduce:
> wget 
> https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
> ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # save the attached .config to linux build tree
> GCC_VERSION=7.5.0 make.cross ARCH=sparc64 
> 
> If you fix the issue, kindly add following tag
> Reported-by: kbuild test robot 

Thanks, kbuild!

I sent a fix:
https://lore.kernel.org/linux-arm-kernel/159956-7612-1-git-send-email-k...@kernel.org/

Best regards,
Krzysztof

___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu


Re: [PATCH 3/3] iommu: Enable compile testing for some of drivers

2019-12-31 Thread Krzysztof Kozlowski
On Tue, Dec 31, 2019 at 03:43:39PM +0800, kbuild test robot wrote:
> Hi Krzysztof,
> 
> I love your patch! Perhaps something to improve:
> 
> [auto build test WARNING on iommu/next]
> [also build test WARNING on v5.5-rc4]
> [if your patch is applied to the wrong git tree, please drop us a note to help
> improve the system. BTW, we also suggest to use '--base' option to specify the
> base tree in git format-patch, please see 
> https://stackoverflow.com/a/37406982]
> 
> url:
> https://github.com/0day-ci/linux/commits/Krzysztof-Kozlowski/iommu-omap-Fix-pointer-cast-Wpointer-to-int-cast-warnings-on-64-bit/20191231-022212
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git next
> config: ia64-allmodconfig (attached as .config)
> compiler: ia64-linux-gcc (GCC) 7.5.0
> reproduce:
> wget 
> https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
> ~/bin/make.cross
> chmod +x ~/bin/make.cross
> # save the attached .config to linux build tree
> GCC_VERSION=7.5.0 make.cross ARCH=ia64 
> 
> If you fix the issue, kindly add following tag
> Reported-by: kbuild test robot 

I saw it already while compile testing my patch. I must admit that I
could not find easy/fast fix for it.  Probably the
omap_iommu_translate() helper should be made 64-bit friendly but this
obfuscates the code. The driver and hardware supports only 32-bit addresses.

Best regards,
Krzysztof


> 
> All warnings (new ones prefixed by >>):
> 
>In file included from drivers/iommu/omap-iommu.c:33:0:
>drivers/iommu/omap-iommu.c: In function 'omap_iommu_iova_to_phys':
> >> drivers/iommu/omap-iopgtable.h:44:21: warning: large integer implicitly 
> >> truncated to unsigned type [-Woverflow]
> #define IOPTE_MASK  (~(IOPTE_SIZE - 1))
> ^
> >> drivers/iommu/omap-iommu.c:1641:41: note: in expansion of macro 
> >> 'IOPTE_MASK'
>ret = omap_iommu_translate(*pte, da, IOPTE_MASK);
> ^~
>drivers/iommu/omap-iopgtable.h:51:23: warning: large integer implicitly 
> truncated to unsigned type [-Woverflow]
> #define IOLARGE_MASK  (~(IOLARGE_SIZE - 1))
>   ^
> >> drivers/iommu/omap-iommu.c:1643:41: note: in expansion of macro 
> >> 'IOLARGE_MASK'
>ret = omap_iommu_translate(*pte, da, IOLARGE_MASK);
> ^~~~
>drivers/iommu/omap-iopgtable.h:27:25: warning: large integer implicitly 
> truncated to unsigned type [-Woverflow]
> #define IOSECTION_MASK  (~(IOSECTION_SIZE - 1))
> ^
> >> drivers/iommu/omap-iommu.c:1649:41: note: in expansion of macro 
> >> 'IOSECTION_MASK'
>ret = omap_iommu_translate(*pgd, da, IOSECTION_MASK);
> ^~
>drivers/iommu/omap-iopgtable.h:34:23: warning: large integer implicitly 
> truncated to unsigned type [-Woverflow]
> #define IOSUPER_MASK  (~(IOSUPER_SIZE - 1))
>   ^
> >> drivers/iommu/omap-iommu.c:1651:41: note: in expansion of macro 
> >> 'IOSUPER_MASK'
>ret = omap_iommu_translate(*pgd, da, IOSUPER_MASK);
> ^~~~
> 
> vim +44 drivers/iommu/omap-iopgtable.h
> 
> 97ec7d585b33bb arch/arm/plat-omap/iopgtable.h Hiroshi DOYU 2010-02-15  38  
> 97ec7d585b33bb arch/arm/plat-omap/iopgtable.h Hiroshi DOYU 2010-02-15  39  /*
> 97ec7d585b33bb arch/arm/plat-omap/iopgtable.h Hiroshi DOYU 2010-02-15  40   * 
> "small page" address mask and size definitions.
> 97ec7d585b33bb arch/arm/plat-omap/iopgtable.h Hiroshi DOYU 2010-02-15  41   */
> a9dcad5e375800 arch/arm/plat-omap/iopgtable.h Hiroshi DOYU 2009-01-26  42  
> #define IOPTE_SHIFT12
> 5ff98fa68c88d7 drivers/iommu/omap-iopgtable.h Suman Anna   2015-07-20  43  
> #define IOPTE_SIZE BIT(IOPTE_SHIFT)
> a9dcad5e375800 arch/arm/plat-omap/iopgtable.h Hiroshi DOYU 2009-01-26 @44  
> #define IOPTE_MASK (~(IOPTE_SIZE - 1))
> a9dcad5e375800 arch/arm/plat-omap/iopgtable.h Hiroshi DOYU 2009-01-26  45  
> 
> :: The code at line 44 was first introduced by commit
> :: a9dcad5e375800fcb07f7617dba23b3aade8f09d omap iommu: tlb and pagetable 
> primitives
> 
> :: TO: Hiroshi DOYU 
> :: CC: Hiroshi DOYU 
> 
> ---
> 0-DAY kernel test infrastructure Open Source Technology Center
> https://lists.01.org/hyperkitty/list/kbuild-...@lists.01.org Intel Corporation


___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu


Re: [PATCH 3/3] iommu: Enable compile testing for some of drivers

2019-12-30 Thread kbuild test robot
Hi Krzysztof,

I love your patch! Perhaps something to improve:

[auto build test WARNING on iommu/next]
[also build test WARNING on v5.5-rc4]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:
https://github.com/0day-ci/linux/commits/Krzysztof-Kozlowski/iommu-omap-Fix-pointer-cast-Wpointer-to-int-cast-warnings-on-64-bit/20191231-022212
base:   https://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git next
config: ia64-allmodconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 7.5.0
reproduce:
wget 
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=7.5.0 make.cross ARCH=ia64 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot 

All warnings (new ones prefixed by >>):

   In file included from drivers/iommu/omap-iommu.c:33:0:
   drivers/iommu/omap-iommu.c: In function 'omap_iommu_iova_to_phys':
>> drivers/iommu/omap-iopgtable.h:44:21: warning: large integer implicitly 
>> truncated to unsigned type [-Woverflow]
#define IOPTE_MASK  (~(IOPTE_SIZE - 1))
^
>> drivers/iommu/omap-iommu.c:1641:41: note: in expansion of macro 'IOPTE_MASK'
   ret = omap_iommu_translate(*pte, da, IOPTE_MASK);
^~
   drivers/iommu/omap-iopgtable.h:51:23: warning: large integer implicitly 
truncated to unsigned type [-Woverflow]
#define IOLARGE_MASK  (~(IOLARGE_SIZE - 1))
  ^
>> drivers/iommu/omap-iommu.c:1643:41: note: in expansion of macro 
>> 'IOLARGE_MASK'
   ret = omap_iommu_translate(*pte, da, IOLARGE_MASK);
^~~~
   drivers/iommu/omap-iopgtable.h:27:25: warning: large integer implicitly 
truncated to unsigned type [-Woverflow]
#define IOSECTION_MASK  (~(IOSECTION_SIZE - 1))
^
>> drivers/iommu/omap-iommu.c:1649:41: note: in expansion of macro 
>> 'IOSECTION_MASK'
   ret = omap_iommu_translate(*pgd, da, IOSECTION_MASK);
^~
   drivers/iommu/omap-iopgtable.h:34:23: warning: large integer implicitly 
truncated to unsigned type [-Woverflow]
#define IOSUPER_MASK  (~(IOSUPER_SIZE - 1))
  ^
>> drivers/iommu/omap-iommu.c:1651:41: note: in expansion of macro 
>> 'IOSUPER_MASK'
   ret = omap_iommu_translate(*pgd, da, IOSUPER_MASK);
^~~~

vim +44 drivers/iommu/omap-iopgtable.h

97ec7d585b33bb arch/arm/plat-omap/iopgtable.h Hiroshi DOYU 2010-02-15  38  
97ec7d585b33bb arch/arm/plat-omap/iopgtable.h Hiroshi DOYU 2010-02-15  39  /*
97ec7d585b33bb arch/arm/plat-omap/iopgtable.h Hiroshi DOYU 2010-02-15  40   * 
"small page" address mask and size definitions.
97ec7d585b33bb arch/arm/plat-omap/iopgtable.h Hiroshi DOYU 2010-02-15  41   */
a9dcad5e375800 arch/arm/plat-omap/iopgtable.h Hiroshi DOYU 2009-01-26  42  
#define IOPTE_SHIFT  12
5ff98fa68c88d7 drivers/iommu/omap-iopgtable.h Suman Anna   2015-07-20  43  
#define IOPTE_SIZE   BIT(IOPTE_SHIFT)
a9dcad5e375800 arch/arm/plat-omap/iopgtable.h Hiroshi DOYU 2009-01-26 @44  
#define IOPTE_MASK   (~(IOPTE_SIZE - 1))
a9dcad5e375800 arch/arm/plat-omap/iopgtable.h Hiroshi DOYU 2009-01-26  45  

:: The code at line 44 was first introduced by commit
:: a9dcad5e375800fcb07f7617dba23b3aade8f09d omap iommu: tlb and pagetable 
primitives

:: TO: Hiroshi DOYU 
:: CC: Hiroshi DOYU 

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-...@lists.01.org Intel Corporation


.config.gz
Description: application/gzip
___
iommu mailing list
iommu@lists.linux-foundation.org
https://lists.linuxfoundation.org/mailman/listinfo/iommu

Re: [PATCH 3/3] iommu: Enable compile testing for some of drivers

2019-12-30 Thread kbuild test robot
Hi Krzysztof,

I love your patch! Yet something to improve:

[auto build test ERROR on iommu/next]
[also build test ERROR on v5.5-rc4 next-20191219]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:
https://github.com/0day-ci/linux/commits/Krzysztof-Kozlowski/iommu-omap-Fix-pointer-cast-Wpointer-to-int-cast-warnings-on-64-bit/20191231-022212
base:   https://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu.git next
config: sparc64-allmodconfig (attached as .config)
compiler: sparc64-linux-gcc (GCC) 7.5.0
reproduce:
wget 
https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O 
~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
GCC_VERSION=7.5.0 make.cross ARCH=sparc64 

If you fix the issue, kindly add following tag
Reported-by: kbuild test robot 

All errors (new ones prefixed by >>):

   drivers/gpu/drm/rockchip/rockchip_drm_gem.c: In function 
'rockchip_gem_alloc_iommu':
>> drivers/gpu/drm/rockchip/rockchip_drm_gem.c:134:20: error: implicit 
>> declaration of function 'vmap'; did you mean 'bmap'? 
>> [-Werror=implicit-function-declaration]
  rk_obj->kvaddr = vmap(rk_obj->pages, rk_obj->num_pages, VM_MAP,
   ^~~~
   bmap
>> drivers/gpu/drm/rockchip/rockchip_drm_gem.c:134:59: error: 'VM_MAP' 
>> undeclared (first use in this function); did you mean 'VM_MPX'?
  rk_obj->kvaddr = vmap(rk_obj->pages, rk_obj->num_pages, VM_MAP,
  ^~
  VM_MPX
   drivers/gpu/drm/rockchip/rockchip_drm_gem.c:134:59: note: each undeclared 
identifier is reported only once for each function it appears in
   drivers/gpu/drm/rockchip/rockchip_drm_gem.c: In function 
'rockchip_gem_free_iommu':
>> drivers/gpu/drm/rockchip/rockchip_drm_gem.c:190:2: error: implicit 
>> declaration of function 'vunmap'; did you mean 'iounmap'? 
>> [-Werror=implicit-function-declaration]
 vunmap(rk_obj->kvaddr);
 ^~
 iounmap
   drivers/gpu/drm/rockchip/rockchip_drm_gem.c: In function 
'rockchip_gem_prime_vmap':
   drivers/gpu/drm/rockchip/rockchip_drm_gem.c:547:49: error: 'VM_MAP' 
undeclared (first use in this function); did you mean 'VM_MPX'?
  return vmap(rk_obj->pages, rk_obj->num_pages, VM_MAP,
^~
VM_MPX
   cc1: some warnings being treated as errors

vim +134 drivers/gpu/drm/rockchip/rockchip_drm_gem.c

38f993b7c59e26 Tomasz Figa 2016-06-24  119  
38f993b7c59e26 Tomasz Figa 2016-06-24  120  static int 
rockchip_gem_alloc_iommu(struct rockchip_gem_object *rk_obj,
38f993b7c59e26 Tomasz Figa 2016-06-24  121  
bool alloc_kmap)
38f993b7c59e26 Tomasz Figa 2016-06-24  122  {
38f993b7c59e26 Tomasz Figa 2016-06-24  123  int ret;
38f993b7c59e26 Tomasz Figa 2016-06-24  124  
38f993b7c59e26 Tomasz Figa 2016-06-24  125  ret = 
rockchip_gem_get_pages(rk_obj);
38f993b7c59e26 Tomasz Figa 2016-06-24  126  if (ret < 0)
38f993b7c59e26 Tomasz Figa 2016-06-24  127  return ret;
38f993b7c59e26 Tomasz Figa 2016-06-24  128  
38f993b7c59e26 Tomasz Figa 2016-06-24  129  ret = 
rockchip_gem_iommu_map(rk_obj);
38f993b7c59e26 Tomasz Figa 2016-06-24  130  if (ret < 0)
38f993b7c59e26 Tomasz Figa 2016-06-24  131  goto err_free;
38f993b7c59e26 Tomasz Figa 2016-06-24  132  
38f993b7c59e26 Tomasz Figa 2016-06-24  133  if (alloc_kmap) {
38f993b7c59e26 Tomasz Figa 2016-06-24 @134  rk_obj->kvaddr 
= vmap(rk_obj->pages, rk_obj->num_pages, VM_MAP,
38f993b7c59e26 Tomasz Figa 2016-06-24  135  
  pgprot_writecombine(PAGE_KERNEL));
38f993b7c59e26 Tomasz Figa 2016-06-24  136  if 
(!rk_obj->kvaddr) {
38f993b7c59e26 Tomasz Figa 2016-06-24  137  
DRM_ERROR("failed to vmap() buffer\n");
38f993b7c59e26 Tomasz Figa 2016-06-24  138  ret = 
-ENOMEM;
38f993b7c59e26 Tomasz Figa 2016-06-24  139  goto 
err_unmap;
38f993b7c59e26 Tomasz Figa 2016-06-24  140  }
38f993b7c59e26 Tomasz Figa 2016-06-24  141  }
38f993b7c59e26 Tomasz Figa 2016-06-24  142  
38f993b7c59e26 Tomasz Figa 2016-06-24  143  return 0;
38f993b7c59e26 Tomasz Figa 2016-06-24  144  
38f993b7c59e26 Tomasz Figa 2016-06-24  145  err_unmap:
38f993b7c59e26 Tomasz Figa 2016-06-24  146  
rockchip_gem_iommu_unmap(rk_obj);
38f993b7c59e26