[linux-next:master 1624/2270] drivers/gpu/drm/amd/amdgpu/amdgpu_fw_attestation.c:130:6: warning: no previous prototype for 'amdgpu_fw_attestation_debugfs_init'
by kernel test robot
Hi John,
FYI, the error/warning still remains.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: 1c86f90a16d413621918ae1403842b43632f0b3d
commit: 19ae333001b375bbc7d1ff9eaa9cbb0a72fff65e [1624/2270] drm/amdgpu: added support for psp fw attestation
config: parisc-randconfig-r012-20201029 (attached as .config)
compiler: hppa-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commi...
git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
git fetch --no-tags linux-next master
git checkout 19ae333001b375bbc7d1ff9eaa9cbb0a72fff65e
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=parisc
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> drivers/gpu/drm/amd/amdgpu/amdgpu_fw_attestation.c:130:6: warning: no previous prototype for 'amdgpu_fw_attestation_debugfs_init' [-Wmissing-prototypes]
130 | void amdgpu_fw_attestation_debugfs_init(struct amdgpu_device *adev)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from drivers/gpu/drm/amd/amdgpu/amdgpu_fw_attestation.c:28:
drivers/gpu/drm/amd/amdgpu/amdgpu.h:198:19: warning: 'no_system_mem_limit' defined but not used [-Wunused-const-variable=]
198 | static const bool no_system_mem_limit;
| ^~~~~~~~~~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/amdgpu.h:197:19: warning: 'debug_evictions' defined but not used [-Wunused-const-variable=]
197 | static const bool debug_evictions; /* = false */
| ^~~~~~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/amdgpu.h:196:18: warning: 'sched_policy' defined but not used [-Wunused-const-variable=]
196 | static const int sched_policy = KFD_SCHED_POLICY_HWS;
| ^~~~~~~~~~~~
In file included from drivers/gpu/drm/amd/amdgpu/../display/dc/dc_types.h:33,
from drivers/gpu/drm/amd/amdgpu/../display/dc/dm_services_types.h:30,
from drivers/gpu/drm/amd/amdgpu/../include/dm_pp_interface.h:26,
from drivers/gpu/drm/amd/amdgpu/amdgpu.h:67,
from drivers/gpu/drm/amd/amdgpu/amdgpu_fw_attestation.c:28:
drivers/gpu/drm/amd/amdgpu/../display/include/fixed31_32.h:76:32: warning: 'dc_fixpt_ln2_div_2' defined but not used [-Wunused-const-variable=]
76 | static const struct fixed31_32 dc_fixpt_ln2_div_2 = { 1488522236LL };
| ^~~~~~~~~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/../display/include/fixed31_32.h:75:32: warning: 'dc_fixpt_ln2' defined but not used [-Wunused-const-variable=]
75 | static const struct fixed31_32 dc_fixpt_ln2 = { 2977044471LL };
| ^~~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/../display/include/fixed31_32.h:74:32: warning: 'dc_fixpt_e' defined but not used [-Wunused-const-variable=]
74 | static const struct fixed31_32 dc_fixpt_e = { 11674931555LL };
| ^~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/../display/include/fixed31_32.h:73:32: warning: 'dc_fixpt_two_pi' defined but not used [-Wunused-const-variable=]
73 | static const struct fixed31_32 dc_fixpt_two_pi = { 26986075409LL };
| ^~~~~~~~~~~~~~~
drivers/gpu/drm/amd/amdgpu/../display/include/fixed31_32.h:72:32: warning: 'dc_fixpt_pi' defined but not used [-Wunused-const-variable=]
72 | static const struct fixed31_32 dc_fixpt_pi = { 13493037705LL };
| ^~~~~~~~~~~
vim +/amdgpu_fw_attestation_debugfs_init +130 drivers/gpu/drm/amd/amdgpu/amdgpu_fw_attestation.c
129
> 130 void amdgpu_fw_attestation_debugfs_init(struct amdgpu_device *adev)
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 7 months
[ebiggers:ext4-pending 1/1] fs/ext4/dir.c:673:12: error: 'generic_ci_d_hash' undeclared here (not in a function)
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux.git ext4-pending
head: e9d7106ceca0f2310b27c5d635f9a2f43112b98d
commit: e9d7106ceca0f2310b27c5d635f9a2f43112b98d [1/1] ext4: Use generic casefolding support
config: microblaze-randconfig-r024-20201029 (attached as .config)
compiler: microblaze-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux.git/commit...
git remote add ebiggers https://git.kernel.org/pub/scm/linux/kernel/git/ebiggers/linux.git
git fetch --no-tags ebiggers ext4-pending
git checkout e9d7106ceca0f2310b27c5d635f9a2f43112b98d
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=microblaze
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
>> fs/ext4/dir.c:673:12: error: 'generic_ci_d_hash' undeclared here (not in a function)
673 | .d_hash = generic_ci_d_hash,
| ^~~~~~~~~~~~~~~~~
>> fs/ext4/dir.c:674:15: error: 'generic_ci_d_compare' undeclared here (not in a function)
674 | .d_compare = generic_ci_d_compare,
| ^~~~~~~~~~~~~~~~~~~~
--
fs/ext4/hash.c: In function 'ext4fs_dirhash':
>> fs/ext4/hash.c:278:42: error: 'struct super_block' has no member named 's_encoding'
278 | const struct unicode_map *um = dir->i_sb->s_encoding;
| ^~
--
fs/ext4/namei.c: In function 'ext4_ci_compare':
>> fs/ext4/namei.c:1290:35: error: 'const struct super_block' has no member named 's_encoding'
1290 | const struct unicode_map *um = sb->s_encoding;
| ^~
>> fs/ext4/namei.c:1302:7: error: implicit declaration of function 'sb_has_strict_encoding' [-Werror=implicit-function-declaration]
1302 | if (sb_has_strict_encoding(sb))
| ^~~~~~~~~~~~~~~~~~~~~~
fs/ext4/namei.c: In function 'ext4_fname_setup_ci_filename':
>> fs/ext4/namei.c:1319:39: error: 'struct super_block' has no member named 's_encoding'
1319 | if (!IS_CASEFOLDED(dir) || !dir->i_sb->s_encoding) {
| ^~
fs/ext4/namei.c:1328:31: error: 'struct super_block' has no member named 's_encoding'
1328 | len = utf8_casefold(dir->i_sb->s_encoding,
| ^~
fs/ext4/namei.c: In function 'ext4_match':
fs/ext4/namei.c:1365:18: error: 'struct super_block' has no member named 's_encoding'
1365 | if (parent->i_sb->s_encoding && IS_CASEFOLDED(parent)) {
| ^~
fs/ext4/namei.c: In function 'ext4_add_entry':
fs/ext4/namei.c:2201:8: error: 'struct super_block' has no member named 's_encoding'
2201 | sb->s_encoding && utf8_validate(sb->s_encoding, &dentry->d_name))
| ^~
fs/ext4/namei.c:2201:40: error: 'struct super_block' has no member named 's_encoding'
2201 | sb->s_encoding && utf8_validate(sb->s_encoding, &dentry->d_name))
| ^~
cc1: some warnings being treated as errors
--
fs/ext4/super.c: In function 'ext4_put_super':
>> fs/ext4/super.c:1291:16: error: 'struct super_block' has no member named 's_encoding'
1291 | utf8_unload(sb->s_encoding);
| ^~
fs/ext4/super.c: In function 'ext4_fill_super':
fs/ext4/super.c:4306:42: error: 'struct super_block' has no member named 's_encoding'
4306 | if (ext4_has_feature_casefold(sb) && !sb->s_encoding) {
| ^~
fs/ext4/super.c:4337:5: error: 'struct super_block' has no member named 's_encoding'
4337 | sb->s_encoding = encoding;
| ^~
>> fs/ext4/super.c:4338:5: error: 'struct super_block' has no member named 's_encoding_flags'
4338 | sb->s_encoding_flags = encoding_flags;
| ^~
fs/ext4/super.c:4978:8: error: 'struct super_block' has no member named 's_encoding'
4978 | if (sb->s_encoding)
| ^~
fs/ext4/super.c:5187:16: error: 'struct super_block' has no member named 's_encoding'
5187 | utf8_unload(sb->s_encoding);
| ^~
vim +/generic_ci_d_hash +673 fs/ext4/dir.c
670
671 #ifdef CONFIG_UNICODE
672 const struct dentry_operations ext4_dentry_ops = {
> 673 .d_hash = generic_ci_d_hash,
> 674 .d_compare = generic_ci_d_compare,
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 7 months
[hverkuil-media:tegrav6 13/27] tc358840.c:(.text.tc358840_get_detected_timings+0x44c): undefined reference to `__udivdi3'
by kernel test robot
tree: git://linuxtv.org/hverkuil/media_tree.git tegrav6
head: c298f971d8467f7891114f516ab9eaa277ea36b5
commit: 59de076ff63dee07af9f6aa5f0fe95ad5a637bef [13/27] tc358840: various fixes
config: mips-allyesconfig (attached as .config)
compiler: mips-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
git remote add hverkuil-media git://linuxtv.org/hverkuil/media_tree.git
git fetch --no-tags hverkuil-media tegrav6
git checkout 59de076ff63dee07af9f6aa5f0fe95ad5a637bef
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=mips
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
arch/mips/kernel/head.o: in function `dtb_found':
(.ref.text+0xe0): relocation truncated to fit: R_MIPS_26 against `start_kernel'
init/main.o: in function `set_reset_devices':
main.c:(.init.text+0x20): relocation truncated to fit: R_MIPS_26 against `_mcount'
main.c:(.init.text+0x30): relocation truncated to fit: R_MIPS_26 against `__sanitizer_cov_trace_pc'
init/main.o: in function `debug_kernel':
main.c:(.init.text+0x9c): relocation truncated to fit: R_MIPS_26 against `_mcount'
main.c:(.init.text+0xac): relocation truncated to fit: R_MIPS_26 against `__sanitizer_cov_trace_pc'
init/main.o: in function `quiet_kernel':
main.c:(.init.text+0x118): relocation truncated to fit: R_MIPS_26 against `_mcount'
main.c:(.init.text+0x128): relocation truncated to fit: R_MIPS_26 against `__sanitizer_cov_trace_pc'
init/main.o: in function `init_setup':
main.c:(.init.text+0x1a4): relocation truncated to fit: R_MIPS_26 against `_mcount'
main.c:(.init.text+0x1c8): relocation truncated to fit: R_MIPS_26 against `__sanitizer_cov_trace_pc'
main.c:(.init.text+0x1e8): relocation truncated to fit: R_MIPS_26 against `__sanitizer_cov_trace_pc'
main.c:(.init.text+0x1fc): additional relocation overflows omitted from the output
mips-linux-ld: drivers/media/i2c/tc358840.o: in function `tc358840_get_detected_timings':
>> tc358840.c:(.text.tc358840_get_detected_timings+0x44c): undefined reference to `__udivdi3'
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 7 months
fs/nfsd/nfs4xdr.c:4657 nfsd4_encode_read_plus_hole() warn: inconsistent indenting
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 23859ae44402f4d935b9ee548135dd1e65e2cbf4
commit: 2db27992dd565bf400658edc18f67aed0b6bc6cb NFSD: Add READ_PLUS hole segment encoding
date: 2 weeks ago
config: parisc-randconfig-m031-20201028 (attached as .config)
compiler: hppa64-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
New smatch warnings:
fs/nfsd/nfs4xdr.c:4657 nfsd4_encode_read_plus_hole() warn: inconsistent indenting
Old smatch warnings:
fs/nfsd/nfs4xdr.c:679 nfsd4_decode_close() warn: ignoring unreachable code.
vim +4657 fs/nfsd/nfs4xdr.c
4642
4643 static __be32
4644 nfsd4_encode_read_plus_hole(struct nfsd4_compoundres *resp,
4645 struct nfsd4_read *read,
4646 unsigned long maxcount, u32 *eof)
4647 {
4648 struct file *file = read->rd_nf->nf_file;
4649 __be32 *p;
4650
4651 /* Content type, offset, byte count */
4652 p = xdr_reserve_space(&resp->xdr, 4 + 8 + 8);
4653 if (!p)
4654 return nfserr_resource;
4655
4656 *p++ = htonl(NFS4_CONTENT_HOLE);
> 4657 p = xdr_encode_hyper(p, read->rd_offset);
4658 p = xdr_encode_hyper(p, maxcount);
4659
4660 *eof = (read->rd_offset + maxcount) >= i_size_read(file_inode(file));
4661 return nfs_ok;
4662 }
4663
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 7 months
drivers/dma/mediatek/mtk-hsdma.c:451:17: sparse: sparse: incorrect type in assignment (different base types)
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 23859ae44402f4d935b9ee548135dd1e65e2cbf4
commit: a5460b5e5fb82656807840d40d3deaecad094044 READ_ONCE: Simplify implementations of {READ,WRITE}_ONCE()
date: 7 months ago
config: xtensa-randconfig-s031-20201029 (attached as .config)
compiler: xtensa-linux-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.3-56-gc09e8239-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout a5460b5e5fb82656807840d40d3deaecad094044
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=xtensa
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
"sparse warnings: (new ones prefixed by >>)"
>> drivers/dma/mediatek/mtk-hsdma.c:451:17: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 volatile @@ got unsigned int [usertype] src @@
drivers/dma/mediatek/mtk-hsdma.c:451:17: sparse: expected restricted __le32 volatile
>> drivers/dma/mediatek/mtk-hsdma.c:451:17: sparse: got unsigned int [usertype] src
drivers/dma/mediatek/mtk-hsdma.c:452:17: sparse: sparse: restricted __le32 degrades to integer
drivers/dma/mediatek/mtk-hsdma.c:452:17: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 volatile @@ got unsigned int @@
drivers/dma/mediatek/mtk-hsdma.c:452:17: sparse: expected restricted __le32 volatile
drivers/dma/mediatek/mtk-hsdma.c:452:17: sparse: got unsigned int
>> drivers/dma/mediatek/mtk-hsdma.c:456:17: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 volatile @@ got unsigned int [usertype] dest @@
drivers/dma/mediatek/mtk-hsdma.c:456:17: sparse: expected restricted __le32 volatile
>> drivers/dma/mediatek/mtk-hsdma.c:456:17: sparse: got unsigned int [usertype] dest
drivers/dma/mediatek/mtk-hsdma.c:457:17: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 volatile @@ got int @@
drivers/dma/mediatek/mtk-hsdma.c:457:17: sparse: expected restricted __le32 volatile
drivers/dma/mediatek/mtk-hsdma.c:457:17: sparse: got int
drivers/dma/mediatek/mtk-hsdma.c:580:33: sparse: sparse: restricted __le32 degrades to integer
drivers/dma/mediatek/mtk-hsdma.c:604:26: sparse: sparse: Using plain integer as NULL pointer
drivers/dma/mediatek/mtk-hsdma.c:878:18: sparse: sparse: incorrect type in initializer (different base types) @@ expected restricted __le32 [usertype] ddone @@ got unsigned long @@
drivers/dma/mediatek/mtk-hsdma.c:878:18: sparse: expected restricted __le32 [usertype] ddone
drivers/dma/mediatek/mtk-hsdma.c:878:18: sparse: got unsigned long
drivers/dma/mediatek/mtk-hsdma.c:879:16: sparse: sparse: incorrect type in initializer (different base types) @@ expected restricted __le32 [usertype] ls0 @@ got unsigned long @@
drivers/dma/mediatek/mtk-hsdma.c:879:16: sparse: expected restricted __le32 [usertype] ls0
drivers/dma/mediatek/mtk-hsdma.c:879:16: sparse: got unsigned long
drivers/dma/mediatek/mtk-hsdma.c:883:18: sparse: sparse: incorrect type in initializer (different base types) @@ expected restricted __le32 [usertype] ddone @@ got unsigned long @@
drivers/dma/mediatek/mtk-hsdma.c:883:18: sparse: expected restricted __le32 [usertype] ddone
drivers/dma/mediatek/mtk-hsdma.c:883:18: sparse: got unsigned long
drivers/dma/mediatek/mtk-hsdma.c:884:16: sparse: sparse: incorrect type in initializer (different base types) @@ expected restricted __le32 [usertype] ls0 @@ got unsigned long @@
drivers/dma/mediatek/mtk-hsdma.c:884:16: sparse: expected restricted __le32 [usertype] ls0
drivers/dma/mediatek/mtk-hsdma.c:884:16: sparse: got unsigned long
drivers/dma/mediatek/mtk-hsdma.c: note: in included file (through arch/xtensa/include/asm/io.h, include/linux/scatterlist.h, include/linux/dmaengine.h):
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:225:22: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected unsigned int [usertype] value @@ got restricted __le32 [usertype] @@
include/asm-generic/io.h:225:22: sparse: expected unsigned int [usertype] value
include/asm-generic/io.h:225:22: sparse: got restricted __le32 [usertype]
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
include/asm-generic/io.h:179:15: sparse: sparse: cast to restricted __le32
vim +451 drivers/dma/mediatek/mtk-hsdma.c
548c4597e984b7 Sean Wang 2018-03-15 411
548c4597e984b7 Sean Wang 2018-03-15 412 static int mtk_hsdma_issue_pending_vdesc(struct mtk_hsdma_device *hsdma,
548c4597e984b7 Sean Wang 2018-03-15 413 struct mtk_hsdma_pchan *pc,
548c4597e984b7 Sean Wang 2018-03-15 414 struct mtk_hsdma_vdesc *hvd)
548c4597e984b7 Sean Wang 2018-03-15 415 {
548c4597e984b7 Sean Wang 2018-03-15 416 struct mtk_hsdma_ring *ring = &pc->ring;
548c4597e984b7 Sean Wang 2018-03-15 417 struct mtk_hsdma_pdesc *txd, *rxd;
548c4597e984b7 Sean Wang 2018-03-15 418 u16 reserved, prev, tlen, num_sgs;
548c4597e984b7 Sean Wang 2018-03-15 419 unsigned long flags;
548c4597e984b7 Sean Wang 2018-03-15 420
548c4597e984b7 Sean Wang 2018-03-15 421 /* Protect against PC is accessed by multiple VCs simultaneously */
548c4597e984b7 Sean Wang 2018-03-15 422 spin_lock_irqsave(&hsdma->lock, flags);
548c4597e984b7 Sean Wang 2018-03-15 423
548c4597e984b7 Sean Wang 2018-03-15 424 /*
548c4597e984b7 Sean Wang 2018-03-15 425 * Reserve rooms, where pc->nr_free is used to track how many free
548c4597e984b7 Sean Wang 2018-03-15 426 * rooms in the ring being updated in user and IRQ context.
548c4597e984b7 Sean Wang 2018-03-15 427 */
548c4597e984b7 Sean Wang 2018-03-15 428 num_sgs = DIV_ROUND_UP(hvd->len, MTK_HSDMA_MAX_LEN);
548c4597e984b7 Sean Wang 2018-03-15 429 reserved = min_t(u16, num_sgs, atomic_read(&pc->nr_free));
548c4597e984b7 Sean Wang 2018-03-15 430
548c4597e984b7 Sean Wang 2018-03-15 431 if (!reserved) {
548c4597e984b7 Sean Wang 2018-03-15 432 spin_unlock_irqrestore(&hsdma->lock, flags);
548c4597e984b7 Sean Wang 2018-03-15 433 return -ENOSPC;
548c4597e984b7 Sean Wang 2018-03-15 434 }
548c4597e984b7 Sean Wang 2018-03-15 435
548c4597e984b7 Sean Wang 2018-03-15 436 atomic_sub(reserved, &pc->nr_free);
548c4597e984b7 Sean Wang 2018-03-15 437
548c4597e984b7 Sean Wang 2018-03-15 438 while (reserved--) {
548c4597e984b7 Sean Wang 2018-03-15 439 /* Limit size by PD capability for valid data moving */
548c4597e984b7 Sean Wang 2018-03-15 440 tlen = (hvd->len > MTK_HSDMA_MAX_LEN) ?
548c4597e984b7 Sean Wang 2018-03-15 441 MTK_HSDMA_MAX_LEN : hvd->len;
548c4597e984b7 Sean Wang 2018-03-15 442
548c4597e984b7 Sean Wang 2018-03-15 443 /*
548c4597e984b7 Sean Wang 2018-03-15 444 * Setup PDs using the remaining VD info mapped on those
548c4597e984b7 Sean Wang 2018-03-15 445 * reserved rooms. And since RXD is shared memory between the
548c4597e984b7 Sean Wang 2018-03-15 446 * host and the device allocated by dma_alloc_coherent call,
548c4597e984b7 Sean Wang 2018-03-15 447 * the helper macro WRITE_ONCE can ensure the data written to
548c4597e984b7 Sean Wang 2018-03-15 448 * RAM would really happens.
548c4597e984b7 Sean Wang 2018-03-15 449 */
548c4597e984b7 Sean Wang 2018-03-15 450 txd = &ring->txd[ring->cur_tptr];
548c4597e984b7 Sean Wang 2018-03-15 @451 WRITE_ONCE(txd->desc1, hvd->src);
548c4597e984b7 Sean Wang 2018-03-15 452 WRITE_ONCE(txd->desc2,
548c4597e984b7 Sean Wang 2018-03-15 453 hsdma->soc->ls0 | MTK_HSDMA_DESC_PLEN(tlen));
548c4597e984b7 Sean Wang 2018-03-15 454
548c4597e984b7 Sean Wang 2018-03-15 455 rxd = &ring->rxd[ring->cur_tptr];
548c4597e984b7 Sean Wang 2018-03-15 @456 WRITE_ONCE(rxd->desc1, hvd->dest);
548c4597e984b7 Sean Wang 2018-03-15 457 WRITE_ONCE(rxd->desc2, MTK_HSDMA_DESC_PLEN(tlen));
548c4597e984b7 Sean Wang 2018-03-15 458
548c4597e984b7 Sean Wang 2018-03-15 459 /* Associate VD, the PD belonged to */
548c4597e984b7 Sean Wang 2018-03-15 460 ring->cb[ring->cur_tptr].vd = &hvd->vd;
548c4597e984b7 Sean Wang 2018-03-15 461
548c4597e984b7 Sean Wang 2018-03-15 462 /* Move forward the pointer of TX ring */
548c4597e984b7 Sean Wang 2018-03-15 463 ring->cur_tptr = MTK_HSDMA_NEXT_DESP_IDX(ring->cur_tptr,
548c4597e984b7 Sean Wang 2018-03-15 464 MTK_DMA_SIZE);
548c4597e984b7 Sean Wang 2018-03-15 465
548c4597e984b7 Sean Wang 2018-03-15 466 /* Update VD with remaining data */
548c4597e984b7 Sean Wang 2018-03-15 467 hvd->src += tlen;
548c4597e984b7 Sean Wang 2018-03-15 468 hvd->dest += tlen;
548c4597e984b7 Sean Wang 2018-03-15 469 hvd->len -= tlen;
548c4597e984b7 Sean Wang 2018-03-15 470 }
548c4597e984b7 Sean Wang 2018-03-15 471
548c4597e984b7 Sean Wang 2018-03-15 472 /*
548c4597e984b7 Sean Wang 2018-03-15 473 * Tagging flag for the last PD for VD will be responsible for
548c4597e984b7 Sean Wang 2018-03-15 474 * completing VD.
548c4597e984b7 Sean Wang 2018-03-15 475 */
548c4597e984b7 Sean Wang 2018-03-15 476 if (!hvd->len) {
548c4597e984b7 Sean Wang 2018-03-15 477 prev = MTK_HSDMA_LAST_DESP_IDX(ring->cur_tptr, MTK_DMA_SIZE);
548c4597e984b7 Sean Wang 2018-03-15 478 ring->cb[prev].flag = MTK_HSDMA_VDESC_FINISHED;
548c4597e984b7 Sean Wang 2018-03-15 479 }
548c4597e984b7 Sean Wang 2018-03-15 480
548c4597e984b7 Sean Wang 2018-03-15 481 /* Ensure all changes indeed done before we're going on */
548c4597e984b7 Sean Wang 2018-03-15 482 wmb();
548c4597e984b7 Sean Wang 2018-03-15 483
548c4597e984b7 Sean Wang 2018-03-15 484 /*
548c4597e984b7 Sean Wang 2018-03-15 485 * Updating into hardware the pointer of TX ring lets HSDMA to take
548c4597e984b7 Sean Wang 2018-03-15 486 * action for those pending PDs.
548c4597e984b7 Sean Wang 2018-03-15 487 */
548c4597e984b7 Sean Wang 2018-03-15 488 mtk_dma_write(hsdma, MTK_HSDMA_TX_CPU, ring->cur_tptr);
548c4597e984b7 Sean Wang 2018-03-15 489
548c4597e984b7 Sean Wang 2018-03-15 490 spin_unlock_irqrestore(&hsdma->lock, flags);
548c4597e984b7 Sean Wang 2018-03-15 491
548c4597e984b7 Sean Wang 2018-03-15 492 return 0;
548c4597e984b7 Sean Wang 2018-03-15 493 }
548c4597e984b7 Sean Wang 2018-03-15 494
:::::: The code at line 451 was first introduced by commit
:::::: 548c4597e984b79aad8190235d664f1c3a433f94 dmaengine: mediatek: Add MediaTek High-Speed DMA controller for MT7622 and MT7623 SoC
:::::: TO: Sean Wang <sean.wang(a)mediatek.com>
:::::: CC: Vinod Koul <vinod.koul(a)intel.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 7 months