Message ID | 20170929143704.30635-3-l.stach@pengutronix.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Hi Lucas,
[auto build test WARNING on drm/drm-next]
[also build test WARNING on v4.14-rc2 next-20170929]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Lucas-Stach/drm-etnaviv-remove-iommu-fault-handler/20170930-080416
base: git://people.freedesktop.org/~airlied/linux.git drm-next
config: arm-allmodconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (Debian 6.1.1-9) 6.1.1 20160705
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
make.cross ARCH=arm
Note: it may well be a FALSE warning. FWIW you are at least aware of it now.
http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings
All warnings (new ones prefixed by >>):
drivers/gpu/drm/etnaviv/etnaviv_iommu.c: In function 'etnaviv_iommuv1_domain_alloc':
>> drivers/gpu/drm/etnaviv/etnaviv_iommu.c:208:5: warning: 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized]
if (ret)
^
vim +/ret +208 drivers/gpu/drm/etnaviv/etnaviv_iommu.c
a8c21a54 The etnaviv authors 2015-12-03 189
dd34bb96 Lucas Stach 2016-08-16 190 struct iommu_domain *etnaviv_iommuv1_domain_alloc(struct etnaviv_gpu *gpu)
a8c21a54 The etnaviv authors 2015-12-03 191 {
a8c21a54 The etnaviv authors 2015-12-03 192 struct etnaviv_iommu_domain *etnaviv_domain;
a8c21a54 The etnaviv authors 2015-12-03 193 int ret;
a8c21a54 The etnaviv authors 2015-12-03 194
a8c21a54 The etnaviv authors 2015-12-03 195 etnaviv_domain = kzalloc(sizeof(*etnaviv_domain), GFP_KERNEL);
a8c21a54 The etnaviv authors 2015-12-03 196 if (!etnaviv_domain)
a8c21a54 The etnaviv authors 2015-12-03 197 return NULL;
a8c21a54 The etnaviv authors 2015-12-03 198
a8c21a54 The etnaviv authors 2015-12-03 199 etnaviv_domain->dev = gpu->dev;
a8c21a54 The etnaviv authors 2015-12-03 200
a8c21a54 The etnaviv authors 2015-12-03 201 etnaviv_domain->domain.type = __IOMMU_DOMAIN_PAGING;
a8c21a54 The etnaviv authors 2015-12-03 202 etnaviv_domain->domain.ops = &etnaviv_iommu_ops.ops;
13c34fe5 Lucas Stach 2016-06-13 203 etnaviv_domain->domain.pgsize_bitmap = SZ_4K;
a8c21a54 The etnaviv authors 2015-12-03 204 etnaviv_domain->domain.geometry.aperture_start = GPU_MEM_START;
a8c21a54 The etnaviv authors 2015-12-03 205 etnaviv_domain->domain.geometry.aperture_end = GPU_MEM_START + PT_ENTRIES * SZ_4K - 1;
a8c21a54 The etnaviv authors 2015-12-03 206
a8c21a54 The etnaviv authors 2015-12-03 207 ret = __etnaviv_iommu_init(etnaviv_domain);
a8c21a54 The etnaviv authors 2015-12-03 @208 if (ret)
:::::: The code at line 208 was first introduced by commit
:::::: a8c21a5451d831e67b7a6fb910f9ca8bc7b43554 drm/etnaviv: add initial etnaviv DRM driver
:::::: TO: The etnaviv authors <dri-devel@lists.freedesktop.org>
:::::: CC: Lucas Stach <l.stach@pengutronix.de>
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
diff --git a/drivers/gpu/drm/etnaviv/etnaviv_iommu.c b/drivers/gpu/drm/etnaviv/etnaviv_iommu.c index f804c0aaa7a2..aaa8c4136f53 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_iommu.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_iommu.c @@ -50,22 +50,6 @@ static struct etnaviv_iommu_domain *to_etnaviv_domain(struct iommu_domain *domai return container_of(domain, struct etnaviv_iommu_domain, domain); } -static int pgtable_alloc(struct etnaviv_iommu_domain_pgtable *pgtable, - size_t size) -{ - pgtable->pgtable = dma_alloc_coherent(NULL, size, &pgtable->paddr, GFP_KERNEL); - if (!pgtable->pgtable) - return -ENOMEM; - - return 0; -} - -static void pgtable_free(struct etnaviv_iommu_domain_pgtable *pgtable, - size_t size) -{ - dma_free_coherent(NULL, size, pgtable->pgtable, pgtable->paddr); -} - static void pgtable_write(struct etnaviv_iommu_domain_pgtable *pgtable, unsigned long iova, phys_addr_t paddr) { @@ -91,8 +75,11 @@ static int __etnaviv_iommu_init(struct etnaviv_iommu_domain *etnaviv_domain) for (i = 0; i < SZ_4K / 4; i++) *p++ = 0xdead55aa; - ret = pgtable_alloc(&etnaviv_domain->pgtable, PT_SIZE); - if (ret < 0) { + etnaviv_domain->pgtable.pgtable = + dma_alloc_coherent(etnaviv_domain->dev, PT_SIZE, + &etnaviv_domain->pgtable.paddr, + GFP_KERNEL); + if (!etnaviv_domain->pgtable.pgtable) { dma_free_coherent(etnaviv_domain->dev, SZ_4K, etnaviv_domain->bad_page_cpu, etnaviv_domain->bad_page_dma); @@ -112,7 +99,9 @@ static void etnaviv_domain_free(struct iommu_domain *domain) { struct etnaviv_iommu_domain *etnaviv_domain = to_etnaviv_domain(domain); - pgtable_free(&etnaviv_domain->pgtable, PT_SIZE); + dma_free_coherent(etnaviv_domain->dev, PT_SIZE, + etnaviv_domain->pgtable.pgtable, + etnaviv_domain->pgtable.paddr); dma_free_coherent(etnaviv_domain->dev, SZ_4K, etnaviv_domain->bad_page_cpu,