linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: Joerg Roedel <joro@8bytes.org>
Cc: kbuild-all@01.org, Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
	Christoph Hellwig <hch@lst.de>,
	Marek Szyprowski <m.szyprowski@samsung.com>,
	Robin Murphy <robin.murphy@arm.com>,
	iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org,
	Joerg Roedel <jroedel@suse.de>
Subject: Re: [PATCH] swiotlb: Return error from swiotlb_init_with_tbl()
Date: Sun, 3 Feb 2019 02:09:24 +0800	[thread overview]
Message-ID: <201902030208.AANz29ca%fengguang.wu@intel.com> (raw)
In-Reply-To: <20190131162424.10477-1-joro@8bytes.org>

[-- Attachment #1: Type: text/plain, Size: 3943 bytes --]

Hi Joerg,

I love your patch! Perhaps something to improve:

[auto build test WARNING on swiotlb/linux-next]
[also build test WARNING on v5.0-rc4]
[cannot apply to next-20190201]
[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/Joerg-Roedel/swiotlb-Return-error-from-swiotlb_init_with_tbl/20190203-013129
base:   https://git.kernel.org/pub/scm/linux/kernel/git/konrad/swiotlb.git linux-next
config: riscv-tinyconfig (attached as .config)
compiler: riscv64-linux-gcc (GCC) 8.2.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=8.2.0 make.cross ARCH=riscv 

All warnings (new ones prefixed by >>):

   kernel/dma/swiotlb.c: In function 'swiotlb_init_with_tbl':
>> kernel/dma/swiotlb.c:230:17: warning: passing argument 1 of 'memblock_free' makes integer from pointer without a cast [-Wint-conversion]
      memblock_free(io_tlb_list,
                    ^~~~~~~~~~~
   In file included from kernel/dma/swiotlb.c:42:
   include/linux/memblock.h:123:31: note: expected 'phys_addr_t' {aka 'long long unsigned int'} but argument is of type 'unsigned int *'
    int memblock_free(phys_addr_t base, phys_addr_t size);
                      ~~~~~~~~~~~~^~~~
   kernel/dma/swiotlb.c:234:17: warning: passing argument 1 of 'memblock_free' makes integer from pointer without a cast [-Wint-conversion]
      memblock_free(io_tlb_orig_addr,
                    ^~~~~~~~~~~~~~~~
   In file included from kernel/dma/swiotlb.c:42:
   include/linux/memblock.h:123:31: note: expected 'phys_addr_t' {aka 'long long unsigned int'} but argument is of type 'phys_addr_t *' {aka 'long long unsigned int *'}
    int memblock_free(phys_addr_t base, phys_addr_t size);
                      ~~~~~~~~~~~~^~~~

vim +/memblock_free +230 kernel/dma/swiotlb.c

   190	
   191	int __init swiotlb_init_with_tbl(char *tlb, unsigned long nslabs, int verbose)
   192	{
   193		unsigned long i, bytes;
   194	
   195		bytes = nslabs << IO_TLB_SHIFT;
   196	
   197		io_tlb_nslabs = nslabs;
   198		io_tlb_start = __pa(tlb);
   199		io_tlb_end = io_tlb_start + bytes;
   200	
   201		/*
   202		 * Allocate and initialize the free list array.  This array is used
   203		 * to find contiguous free memory regions of size up to IO_TLB_SEGSIZE
   204		 * between io_tlb_start and io_tlb_end.
   205		 */
   206		io_tlb_list = memblock_alloc_nopanic(
   207					PAGE_ALIGN(io_tlb_nslabs * sizeof(int)),
   208					PAGE_SIZE);
   209		io_tlb_orig_addr = memblock_alloc_nopanic(
   210					PAGE_ALIGN(io_tlb_nslabs * sizeof(phys_addr_t)),
   211					PAGE_SIZE);
   212		if (io_tlb_list == NULL || io_tlb_orig_addr == NULL)
   213			goto out_fail;
   214	
   215		for (i = 0; i < io_tlb_nslabs; i++) {
   216			io_tlb_list[i] = IO_TLB_SEGSIZE - OFFSET(i, IO_TLB_SEGSIZE);
   217			io_tlb_orig_addr[i] = INVALID_PHYS_ADDR;
   218		}
   219		io_tlb_index = 0;
   220	
   221		if (verbose)
   222			swiotlb_print_info();
   223	
   224		swiotlb_set_max_segment(io_tlb_nslabs << IO_TLB_SHIFT);
   225	
   226		return 0;
   227	
   228	out_fail:
   229		if (io_tlb_list)
 > 230			memblock_free(io_tlb_list,
   231				      PAGE_ALIGN(io_tlb_nslabs * sizeof(int)));
   232	
   233		if (io_tlb_orig_addr)
   234			memblock_free(io_tlb_orig_addr,
   235				      PAGE_ALIGN(io_tlb_nslabs * sizeof(phys_addr_t)));
   236	
   237		io_tlb_list      = NULL;
   238		io_tlb_orig_addr = NULL;
   239		io_tlb_end       = 0;
   240		io_tlb_start     = 0;
   241		io_tlb_nslabs    = 0;
   242		max_segment      = 0;
   243	
   244		return -ENOMEM;
   245	}
   246	

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

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 4490 bytes --]

      parent reply	other threads:[~2019-02-02 18:10 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-31 16:24 [PATCH] swiotlb: Return error from swiotlb_init_with_tbl() Joerg Roedel
2019-02-01  8:12 ` Christoph Hellwig
2019-02-01 16:50   ` Joerg Roedel
2019-02-01 16:56     ` Christoph Hellwig
2019-02-01 16:59       ` Joerg Roedel
2019-02-02 17:06         ` Christoph Hellwig
2019-02-02 18:09 ` kbuild test robot [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201902030208.AANz29ca%fengguang.wu@intel.com \
    --to=lkp@intel.com \
    --cc=hch@lst.de \
    --cc=iommu@lists.linux-foundation.org \
    --cc=joro@8bytes.org \
    --cc=jroedel@suse.de \
    --cc=kbuild-all@01.org \
    --cc=konrad.wilk@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=robin.murphy@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).