Re: [PATCH net-next 2/2] net: snmp: add snmp tracepoint support for udp
by kernel test robot
Hi,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on net-next/master]
url: https://github.com/0day-ci/linux/commits/menglong8-dong-gmail-com/net-snm...
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git 84882cf72cd774cf16fd338bdbf00f69ac9f9194
config: m68k-allmodconfig (attached as .config)
compiler: m68k-linux-gcc (GCC) 11.2.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://github.com/0day-ci/linux/commit/15def40653e2754aa06d5af35d8fccd51...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review menglong8-dong-gmail-com/net-snmp-tracepoint-support-for-snmp/20211111-213642
git checkout 15def40653e2754aa06d5af35d8fccd51ea903d2
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=m68k SHELL=/bin/bash net/ipv6/
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 >>):
net/ipv6/udp.c: In function 'udpv6_queue_rcv_one_skb':
>> net/ipv6/udp.c:705:59: error: macro "__UDP_INC_STATS" requires 4 arguments, but only 3 given
705 | is_udplite);
| ^
In file included from net/ipv6/udp_impl.h:4,
from net/ipv6/udp.c:55:
include/net/udp.h:421: note: macro "__UDP_INC_STATS" defined here
421 | #define __UDP_INC_STATS(net, skb, field, is_udplite) do { \
|
>> net/ipv6/udp.c:703:33: error: '__UDP_INC_STATS' undeclared (first use in this function); did you mean 'UDP_INC_STATS'?
703 | __UDP_INC_STATS(sock_net(sk),
| ^~~~~~~~~~~~~~~
| UDP_INC_STATS
net/ipv6/udp.c:703:33: note: each undeclared identifier is reported only once for each function it appears in
vim +/__UDP_INC_STATS +705 net/ipv6/udp.c
ba4e58eca8aa94 Gerrit Renker 2006-11-27 669
cf329aa42b6659 Paolo Abeni 2018-11-07 670 static int udpv6_queue_rcv_one_skb(struct sock *sk, struct sk_buff *skb)
ba4e58eca8aa94 Gerrit Renker 2006-11-27 671 {
ba4e58eca8aa94 Gerrit Renker 2006-11-27 672 struct udp_sock *up = udp_sk(sk);
b2bf1e2659b1cb Wang Chen 2007-12-03 673 int is_udplite = IS_UDPLITE(sk);
a18135eb9389c2 David S. Miller 2006-08-15 674
ba4e58eca8aa94 Gerrit Renker 2006-11-27 675 if (!xfrm6_policy_check(sk, XFRM_POLICY_IN, skb))
ba4e58eca8aa94 Gerrit Renker 2006-11-27 676 goto drop;
^1da177e4c3f41 Linus Torvalds 2005-04-16 677
88ab31081b8c8d Davidlohr Bueso 2018-05-08 678 if (static_branch_unlikely(&udpv6_encap_needed_key) && up->encap_type) {
d7f3f62167bc22 Benjamin LaHaise 2012-04-27 679 int (*encap_rcv)(struct sock *sk, struct sk_buff *skb);
d7f3f62167bc22 Benjamin LaHaise 2012-04-27 680
d7f3f62167bc22 Benjamin LaHaise 2012-04-27 681 /*
d7f3f62167bc22 Benjamin LaHaise 2012-04-27 682 * This is an encapsulation socket so pass the skb to
d7f3f62167bc22 Benjamin LaHaise 2012-04-27 683 * the socket's udp_encap_rcv() hook. Otherwise, just
d7f3f62167bc22 Benjamin LaHaise 2012-04-27 684 * fall through and pass this up the UDP socket.
d7f3f62167bc22 Benjamin LaHaise 2012-04-27 685 * up->encap_rcv() returns the following value:
d7f3f62167bc22 Benjamin LaHaise 2012-04-27 686 * =0 if skb was successfully passed to the encap
d7f3f62167bc22 Benjamin LaHaise 2012-04-27 687 * handler or was discarded by it.
d7f3f62167bc22 Benjamin LaHaise 2012-04-27 688 * >0 if skb should be passed on to UDP.
d7f3f62167bc22 Benjamin LaHaise 2012-04-27 689 * <0 if skb should be resubmitted as proto -N
d7f3f62167bc22 Benjamin LaHaise 2012-04-27 690 */
d7f3f62167bc22 Benjamin LaHaise 2012-04-27 691
d7f3f62167bc22 Benjamin LaHaise 2012-04-27 692 /* if we're overly short, let UDP handle it */
6aa7de059173a9 Mark Rutland 2017-10-23 693 encap_rcv = READ_ONCE(up->encap_rcv);
e5aed006be918a Hannes Frederic Sowa 2016-05-19 694 if (encap_rcv) {
d7f3f62167bc22 Benjamin LaHaise 2012-04-27 695 int ret;
d7f3f62167bc22 Benjamin LaHaise 2012-04-27 696
0a80966b1043c3 Tom Herbert 2014-05-07 697 /* Verify checksum before giving to encap */
0a80966b1043c3 Tom Herbert 2014-05-07 698 if (udp_lib_checksum_complete(skb))
0a80966b1043c3 Tom Herbert 2014-05-07 699 goto csum_error;
0a80966b1043c3 Tom Herbert 2014-05-07 700
d7f3f62167bc22 Benjamin LaHaise 2012-04-27 701 ret = encap_rcv(sk, skb);
d7f3f62167bc22 Benjamin LaHaise 2012-04-27 702 if (ret <= 0) {
02c223470c3cc3 Eric Dumazet 2016-04-27 @703 __UDP_INC_STATS(sock_net(sk),
d7f3f62167bc22 Benjamin LaHaise 2012-04-27 704 UDP_MIB_INDATAGRAMS,
d7f3f62167bc22 Benjamin LaHaise 2012-04-27 @705 is_udplite);
d7f3f62167bc22 Benjamin LaHaise 2012-04-27 706 return -ret;
d7f3f62167bc22 Benjamin LaHaise 2012-04-27 707 }
d7f3f62167bc22 Benjamin LaHaise 2012-04-27 708 }
d7f3f62167bc22 Benjamin LaHaise 2012-04-27 709
d7f3f62167bc22 Benjamin LaHaise 2012-04-27 710 /* FALLTHROUGH -- it's a UDP Packet */
d7f3f62167bc22 Benjamin LaHaise 2012-04-27 711 }
d7f3f62167bc22 Benjamin LaHaise 2012-04-27 712
ba4e58eca8aa94 Gerrit Renker 2006-11-27 713 /*
ba4e58eca8aa94 Gerrit Renker 2006-11-27 714 * UDP-Lite specific tests, ignored on UDP sockets (see net/ipv4/udp.c).
ba4e58eca8aa94 Gerrit Renker 2006-11-27 715 */
b0a422772fec29 Miaohe Lin 2020-07-21 716 if ((up->pcflag & UDPLITE_RECV_CC) && UDP_SKB_CB(skb)->partial_cov) {
ba4e58eca8aa94 Gerrit Renker 2006-11-27 717
ba4e58eca8aa94 Gerrit Renker 2006-11-27 718 if (up->pcrlen == 0) { /* full coverage was set */
ba7a46f16dd29f Joe Perches 2014-11-11 719 net_dbg_ratelimited("UDPLITE6: partial coverage %d while full coverage %d requested\n",
ba4e58eca8aa94 Gerrit Renker 2006-11-27 720 UDP_SKB_CB(skb)->cscov, skb->len);
ba4e58eca8aa94 Gerrit Renker 2006-11-27 721 goto drop;
^1da177e4c3f41 Linus Torvalds 2005-04-16 722 }
ba4e58eca8aa94 Gerrit Renker 2006-11-27 723 if (UDP_SKB_CB(skb)->cscov < up->pcrlen) {
ba7a46f16dd29f Joe Perches 2014-11-11 724 net_dbg_ratelimited("UDPLITE6: coverage %d too small, need min %d\n",
ba4e58eca8aa94 Gerrit Renker 2006-11-27 725 UDP_SKB_CB(skb)->cscov, up->pcrlen);
ba4e58eca8aa94 Gerrit Renker 2006-11-27 726 goto drop;
ba4e58eca8aa94 Gerrit Renker 2006-11-27 727 }
ba4e58eca8aa94 Gerrit Renker 2006-11-27 728 }
ba4e58eca8aa94 Gerrit Renker 2006-11-27 729
4b943faedfc29e Paolo Abeni 2017-06-22 730 prefetch(&sk->sk_rmem_alloc);
ce25d66ad5f8d9 Eric Dumazet 2016-06-02 731 if (rcu_access_pointer(sk->sk_filter) &&
ce25d66ad5f8d9 Eric Dumazet 2016-06-02 732 udp_lib_checksum_complete(skb))
6a5dc9e598fe90 Eric Dumazet 2013-04-29 733 goto csum_error;
ce25d66ad5f8d9 Eric Dumazet 2016-06-02 734
ba66bbe5480a01 Daniel Borkmann 2016-07-25 735 if (sk_filter_trim_cap(sk, skb, sizeof(struct udphdr)))
a612769774a30e Michal Kubeček 2016-07-08 736 goto drop;
^1da177e4c3f41 Linus Torvalds 2005-04-16 737
e6afc8ace6dd5c samanthakumar 2016-04-05 738 udp_csum_pull_header(skb);
cb80ef463d1881 Benjamin LaHaise 2012-04-27 739
d826eb14ecef35 Eric Dumazet 2011-11-09 740 skb_dst_drop(skb);
cb75994ec311b2 Wang Chen 2007-12-03 741
850cbaddb52dfd Paolo Abeni 2016-10-21 742 return __udpv6_queue_rcv_skb(sk, skb);
3e215c8d1b6b77 James M Leddy 2014-06-25 743
6a5dc9e598fe90 Eric Dumazet 2013-04-29 744 csum_error:
02c223470c3cc3 Eric Dumazet 2016-04-27 745 __UDP6_INC_STATS(sock_net(sk), UDP_MIB_CSUMERRORS, is_udplite);
ba4e58eca8aa94 Gerrit Renker 2006-11-27 746 drop:
02c223470c3cc3 Eric Dumazet 2016-04-27 747 __UDP6_INC_STATS(sock_net(sk), UDP_MIB_INERRORS, is_udplite);
cb80ef463d1881 Benjamin LaHaise 2012-04-27 748 atomic_inc(&sk->sk_drops);
ba4e58eca8aa94 Gerrit Renker 2006-11-27 749 kfree_skb(skb);
ba4e58eca8aa94 Gerrit Renker 2006-11-27 750 return -1;
^1da177e4c3f41 Linus Torvalds 2005-04-16 751 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 752
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
10 months, 1 week
arch/mips/sibyte/sb1250/setup.c:79:5: warning: no previous prototype for 'sb1250_m3_workaround_needed'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 66f4beaa6c1d28161f534471484b2daa2de1dce0
commit: ab5743079b8e3d3d4309664903f6b1f579168a56 MIPS: Get rid of BCM1250_M3_WAR
date: 1 year, 2 months ago
config: mips-randconfig-r004-20211008 (attached as .config)
compiler: mipsel-linux-gcc (GCC) 11.2.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/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 ab5743079b8e3d3d4309664903f6b1f579168a56
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.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 warnings (new ones prefixed by >>):
>> arch/mips/sibyte/sb1250/setup.c:79:5: warning: no previous prototype for 'sb1250_m3_workaround_needed' [-Wmissing-prototypes]
79 | int sb1250_m3_workaround_needed(void)
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/mips/sibyte/sb1250/setup.c:168:13: warning: no previous prototype for 'sb1250_setup' [-Wmissing-prototypes]
168 | void __init sb1250_setup(void)
| ^~~~~~~~~~~~
vim +/sb1250_m3_workaround_needed +79 arch/mips/sibyte/sb1250/setup.c
^1da177e4c3f41 Linus Torvalds 2005-04-16 78
8d9df29db273ab Ralf Baechle 2010-03-23 @79 int sb1250_m3_workaround_needed(void)
8d9df29db273ab Ralf Baechle 2010-03-23 80 {
8d9df29db273ab Ralf Baechle 2010-03-23 81 switch (soc_type) {
8d9df29db273ab Ralf Baechle 2010-03-23 82 case K_SYS_SOC_TYPE_BCM1250:
8d9df29db273ab Ralf Baechle 2010-03-23 83 case K_SYS_SOC_TYPE_BCM1250_ALT:
8d9df29db273ab Ralf Baechle 2010-03-23 84 case K_SYS_SOC_TYPE_BCM1250_ALT2:
8d9df29db273ab Ralf Baechle 2010-03-23 85 case K_SYS_SOC_TYPE_BCM1125:
8d9df29db273ab Ralf Baechle 2010-03-23 86 case K_SYS_SOC_TYPE_BCM1125H:
8d9df29db273ab Ralf Baechle 2010-03-23 87 return soc_pass < K_SYS_REVISION_BCM1250_C0;
8d9df29db273ab Ralf Baechle 2010-03-23 88
8d9df29db273ab Ralf Baechle 2010-03-23 89 default:
8d9df29db273ab Ralf Baechle 2010-03-23 90 return 0;
8d9df29db273ab Ralf Baechle 2010-03-23 91 }
8d9df29db273ab Ralf Baechle 2010-03-23 92 }
8d9df29db273ab Ralf Baechle 2010-03-23 93
:::::: The code at line 79 was first introduced by commit
:::::: 8d9df29db273ab9a330828f4f4f6669d293a730a MIPS: Sibyte: Apply M3 workaround only on affected chip types and versions.
:::::: TO: Ralf Baechle <ralf(a)linux-mips.org>
:::::: CC: Ralf Baechle <ralf(a)linux-mips.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
10 months, 1 week
drivers/gpu/drm/nouveau/dispnv50/wndwc67e.c:38:9: sparse: sparse: cast removes address space '__iomem' of expression
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 66f4beaa6c1d28161f534471484b2daa2de1dce0
commit: 8ef23b6f6a79e6fa2a169081d2d76011fffa0482 drm/nouveau/disp/ga10[24]: initial support
date: 10 months ago
config: sparc-randconfig-s032-20211109 (attached as .config)
compiler: sparc64-linux-gcc (GCC) 11.2.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.4-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 8ef23b6f6a79e6fa2a169081d2d76011fffa0482
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=sparc SHELL=/bin/bash arch/sparc/vdso/ drivers/gpu/drm/ drivers/net/wireguard/ fs/
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/gpu/drm/nouveau/dispnv50/wndwc67e.c:38:9: sparse: sparse: cast removes address space '__iomem' of expression
>> drivers/gpu/drm/nouveau/dispnv50/wndwc67e.c:38:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/gpu/drm/nouveau/dispnv50/wndwc67e.c:43:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/gpu/drm/nouveau/dispnv50/wndwc67e.c:43:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/gpu/drm/nouveau/dispnv50/wndwc67e.c:43:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/gpu/drm/nouveau/dispnv50/wndwc67e.c:43:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/gpu/drm/nouveau/dispnv50/wndwc67e.c:43:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/gpu/drm/nouveau/dispnv50/wndwc67e.c:60:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/gpu/drm/nouveau/dispnv50/wndwc67e.c:60:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/gpu/drm/nouveau/dispnv50/wndwc67e.c:60:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/gpu/drm/nouveau/dispnv50/wndwc67e.c:61:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/gpu/drm/nouveau/dispnv50/wndwc67e.c:61:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/gpu/drm/nouveau/dispnv50/wndwc67e.c:63:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/gpu/drm/nouveau/dispnv50/wndwc67e.c:63:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/gpu/drm/nouveau/dispnv50/wndwc67e.c:67:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/gpu/drm/nouveau/dispnv50/wndwc67e.c:67:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/gpu/drm/nouveau/dispnv50/wndwc67e.c:71:9: sparse: sparse: cast removes address space '__iomem' of expression
drivers/gpu/drm/nouveau/dispnv50/wndwc67e.c:71:9: sparse: sparse: cast removes address space '__iomem' of expression
vim +/__iomem +38 drivers/gpu/drm/nouveau/dispnv50/wndwc67e.c
28
29 static int
30 wndwc67e_image_set(struct nv50_wndw *wndw, struct nv50_wndw_atom *asyw)
31 {
32 struct nvif_push *push = wndw->wndw.push;
33 int ret;
34
35 if ((ret = PUSH_WAIT(push, 17)))
36 return ret;
37
> 38 PUSH_MTHD(push, NVC57E, SET_PRESENT_CONTROL,
39 NVVAL(NVC57E, SET_PRESENT_CONTROL, MIN_PRESENT_INTERVAL, asyw->image.interval) |
40 NVVAL(NVC57E, SET_PRESENT_CONTROL, BEGIN_MODE, asyw->image.mode) |
41 NVDEF(NVC57E, SET_PRESENT_CONTROL, TIMESTAMP_MODE, DISABLE));
42
43 PUSH_MTHD(push, NVC57E, SET_SIZE,
44 NVVAL(NVC57E, SET_SIZE, WIDTH, asyw->image.w) |
45 NVVAL(NVC57E, SET_SIZE, HEIGHT, asyw->image.h),
46
47 SET_STORAGE,
48 NVVAL(NVC57E, SET_STORAGE, BLOCK_HEIGHT, asyw->image.blockh),
49
50 SET_PARAMS,
51 NVVAL(NVC57E, SET_PARAMS, FORMAT, asyw->image.format) |
52 NVDEF(NVC57E, SET_PARAMS, CLAMP_BEFORE_BLEND, DISABLE) |
53 NVDEF(NVC57E, SET_PARAMS, SWAP_UV, DISABLE) |
54 NVDEF(NVC57E, SET_PARAMS, FMT_ROUNDING_MODE, ROUND_TO_NEAREST),
55
56 SET_PLANAR_STORAGE(0),
57 NVVAL(NVC57E, SET_PLANAR_STORAGE, PITCH, asyw->image.blocks[0]) |
58 NVVAL(NVC57E, SET_PLANAR_STORAGE, PITCH, asyw->image.pitch[0] >> 6));
59
60 PUSH_MTHD(push, NVC57E, SET_CONTEXT_DMA_ISO(0), asyw->image.handle, 1);
61 PUSH_MTHD(push, NVC57E, SET_OFFSET(0), asyw->image.offset[0] >> 8);
62
63 PUSH_MTHD(push, NVC57E, SET_POINT_IN(0),
64 NVVAL(NVC57E, SET_POINT_IN, X, asyw->state.src_x >> 16) |
65 NVVAL(NVC57E, SET_POINT_IN, Y, asyw->state.src_y >> 16));
66
67 PUSH_MTHD(push, NVC57E, SET_SIZE_IN,
68 NVVAL(NVC57E, SET_SIZE_IN, WIDTH, asyw->state.src_w >> 16) |
69 NVVAL(NVC57E, SET_SIZE_IN, HEIGHT, asyw->state.src_h >> 16));
70
71 PUSH_MTHD(push, NVC57E, SET_SIZE_OUT,
72 NVVAL(NVC57E, SET_SIZE_OUT, WIDTH, asyw->state.crtc_w) |
73 NVVAL(NVC57E, SET_SIZE_OUT, HEIGHT, asyw->state.crtc_h));
74 return 0;
75 }
76
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
10 months, 1 week
[jgunthorpe:iommufd 19/20] drivers/iommu/iommufd/device.c:58: warning: expecting prototype for iommufd_bind_device(). Prototype was for iommufd_bind_pci_device() instead
by kernel test robot
tree: https://github.com/jgunthorpe/linux iommufd
head: 17bcea24295e34cf0f061dd3bdbb747b63a1933e
commit: a262a567f972f2a4910e3b85bb5620f981dd8229 [19/20] iommufd: Add kAPI toward external drivers
config: x86_64-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
# https://github.com/jgunthorpe/linux/commit/a262a567f972f2a4910e3b85bb5620...
git remote add jgunthorpe https://github.com/jgunthorpe/linux
git fetch --no-tags jgunthorpe iommufd
git checkout a262a567f972f2a4910e3b85bb5620f981dd8229
# save the attached .config to linux build tree
mkdir build_dir
make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/iommu/iommufd/
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/iommu/iommufd/device.c:58: warning: Function parameter or member 'pdev' not described in 'iommufd_bind_pci_device'
>> drivers/iommu/iommufd/device.c:58: warning: expecting prototype for iommufd_bind_device(). Prototype was for iommufd_bind_pci_device() instead
vim +58 drivers/iommu/iommufd/device.c
38
39 /**
40 * iommufd_bind_device - Bind a physical device marked by a device
41 * cookie to an iommu fd.
42 * @fd: iommufd file descriptor.
43 * @dev: Pointer to a physical device struct.
44 * @id: ID number to return to userspace for this device
45 * @dev_cookie: A cookie that is returned to userspace in events
46 *
47 * A successful bind establishes a security context for the device and returns
48 * struct iommufd_device pointer. Otherwise returns error pointer. An external
49 * driver must call this function before touching the pci_dev in any way. Until
50 * it returns the pci_dev could be subject to external manipulation via PCI P2P.
51 *
52 * Binding a PCI device places the entire base RID under iommufd control.
53 *
54 * The caller must undo this with iommufd_unbind_device()
55 */
56 struct iommufd_device *iommufd_bind_pci_device(int fd, struct pci_dev *pdev,
57 u32 *id, u64 dev_cookie)
> 58 {
59 struct iommufd_device *idev;
60 struct iommufd_ctx *ictx;
61 int rc;
62
63 ictx = iommufd_fget(fd);
64 if (!ictx)
65 return ERR_PTR(-EINVAL);
66
67 rc = iommu_device_set_dma_owner(&pdev->dev, DMA_OWNER_USER, ictx->filp);
68 if (rc)
69 goto out_file_put;
70
71 idev = iommufd_object_alloc(ictx, idev, IOMMUFD_OBJ_DEVICE);
72 if (IS_ERR(idev)) {
73 rc = PTR_ERR(idev);
74 goto out_release_owner;
75 }
76 idev->dev = &pdev->dev;
77 idev->dev_cookie = dev_cookie;
78 /* The calling driver is a user until iommufd_unbind_device() */
79 refcount_inc(&idev->obj.users);
80
81 /*
82 * If the caller fails after this success it must call
83 * iommufd_unbind_device() which is safe since we hold this refcount.
84 * This also means the device is a leaf in the graph and no other object
85 * can take a reference on it.
86 */
87 iommufd_object_finalize(ictx, &idev->obj);
88 *id = idev->obj.id;
89 return idev;
90
91 out_release_owner:
92 iommu_device_release_dma_owner(&pdev->dev, DMA_OWNER_USER);
93 out_file_put:
94 fput(ictx->filp);
95 return ERR_PTR(rc);
96 }
97 EXPORT_SYMBOL_GPL(iommufd_bind_pci_device);
98
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
10 months, 1 week
drivers/edac/thunderx_edac.c:1220:17: warning: 'strncat' specified bound 1024 equals destination size
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 66f4beaa6c1d28161f534471484b2daa2de1dce0
commit: c37495d6254c237578db3121dcf79857e033f8ff slab: add __alloc_size attributes for better bounds checking
date: 6 days ago
config: arm64-buildonly-randconfig-r001-20211111 (attached as .config)
compiler: aarch64-linux-gcc (GCC) 11.2.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/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 c37495d6254c237578db3121dcf79857e033f8ff
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=arm64
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/edac/thunderx_edac.c: In function 'thunderx_ocx_lnk_threaded_isr':
>> drivers/edac/thunderx_edac.c:1220:17: warning: 'strncat' specified bound 1024 equals destination size [-Wstringop-truncation]
1220 | strncat(msg, other, OCX_MESSAGE_SIZE);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/edac/thunderx_edac.c: In function 'thunderx_ocx_com_threaded_isr':
drivers/edac/thunderx_edac.c:1136:17: warning: 'strncat' specified bound 1024 equals destination size [-Wstringop-truncation]
1136 | strncat(msg, other, OCX_MESSAGE_SIZE);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/edac/thunderx_edac.c:1145:33: warning: 'strncat' specified bound 1024 equals destination size [-Wstringop-truncation]
1145 | strncat(msg, other, OCX_MESSAGE_SIZE);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/edac/thunderx_edac.c:1150:33: warning: 'strncat' specified bound 1024 equals destination size [-Wstringop-truncation]
1150 | strncat(msg, other, OCX_MESSAGE_SIZE);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
drivers/edac/thunderx_edac.c: In function 'thunderx_l2c_threaded_isr':
drivers/edac/thunderx_edac.c:1899:17: warning: 'strncat' specified bound 1024 equals destination size [-Wstringop-truncation]
1899 | strncat(msg, other, L2C_MESSAGE_SIZE);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
vim +/strncat +1220 drivers/edac/thunderx_edac.c
41003396f932d7 Sergey Temerkhanov 2017-03-24 1186
41003396f932d7 Sergey Temerkhanov 2017-03-24 1187 static irqreturn_t thunderx_ocx_lnk_threaded_isr(int irq, void *irq_id)
41003396f932d7 Sergey Temerkhanov 2017-03-24 1188 {
41003396f932d7 Sergey Temerkhanov 2017-03-24 1189 struct msix_entry *msix = irq_id;
41003396f932d7 Sergey Temerkhanov 2017-03-24 1190 struct thunderx_ocx *ocx = container_of(msix, struct thunderx_ocx,
41003396f932d7 Sergey Temerkhanov 2017-03-24 1191 msix_ent[msix->entry]);
41003396f932d7 Sergey Temerkhanov 2017-03-24 1192 irqreturn_t ret = IRQ_NONE;
41003396f932d7 Sergey Temerkhanov 2017-03-24 1193 unsigned long tail;
41003396f932d7 Sergey Temerkhanov 2017-03-24 1194 struct ocx_link_err_ctx *ctx;
41003396f932d7 Sergey Temerkhanov 2017-03-24 1195
41003396f932d7 Sergey Temerkhanov 2017-03-24 1196 char *msg;
41003396f932d7 Sergey Temerkhanov 2017-03-24 1197 char *other;
41003396f932d7 Sergey Temerkhanov 2017-03-24 1198
41003396f932d7 Sergey Temerkhanov 2017-03-24 1199 msg = kmalloc(OCX_MESSAGE_SIZE, GFP_KERNEL);
41003396f932d7 Sergey Temerkhanov 2017-03-24 1200 other = kmalloc(OCX_OTHER_SIZE, GFP_KERNEL);
41003396f932d7 Sergey Temerkhanov 2017-03-24 1201
41003396f932d7 Sergey Temerkhanov 2017-03-24 1202 if (!msg || !other)
41003396f932d7 Sergey Temerkhanov 2017-03-24 1203 goto err_free;
41003396f932d7 Sergey Temerkhanov 2017-03-24 1204
41003396f932d7 Sergey Temerkhanov 2017-03-24 1205 while (CIRC_CNT(ocx->link_ring_head, ocx->link_ring_tail,
41003396f932d7 Sergey Temerkhanov 2017-03-24 1206 ARRAY_SIZE(ocx->link_err_ctx))) {
41003396f932d7 Sergey Temerkhanov 2017-03-24 1207 tail = ring_pos(ocx->link_ring_head,
41003396f932d7 Sergey Temerkhanov 2017-03-24 1208 ARRAY_SIZE(ocx->link_err_ctx));
41003396f932d7 Sergey Temerkhanov 2017-03-24 1209
41003396f932d7 Sergey Temerkhanov 2017-03-24 1210 ctx = &ocx->link_err_ctx[tail];
41003396f932d7 Sergey Temerkhanov 2017-03-24 1211
41003396f932d7 Sergey Temerkhanov 2017-03-24 1212 snprintf(msg, OCX_MESSAGE_SIZE,
41003396f932d7 Sergey Temerkhanov 2017-03-24 1213 "%s: OCX_COM_LINK_INT[%d]: %016llx",
41003396f932d7 Sergey Temerkhanov 2017-03-24 1214 ocx->edac_dev->ctl_name,
41003396f932d7 Sergey Temerkhanov 2017-03-24 1215 ctx->link, ctx->reg_com_link_int);
41003396f932d7 Sergey Temerkhanov 2017-03-24 1216
41003396f932d7 Sergey Temerkhanov 2017-03-24 1217 decode_register(other, OCX_OTHER_SIZE,
41003396f932d7 Sergey Temerkhanov 2017-03-24 1218 ocx_com_link_errors, ctx->reg_com_link_int);
41003396f932d7 Sergey Temerkhanov 2017-03-24 1219
41003396f932d7 Sergey Temerkhanov 2017-03-24 @1220 strncat(msg, other, OCX_MESSAGE_SIZE);
41003396f932d7 Sergey Temerkhanov 2017-03-24 1221
41003396f932d7 Sergey Temerkhanov 2017-03-24 1222 if (ctx->reg_com_link_int & OCX_COM_LINK_INT_UE)
41003396f932d7 Sergey Temerkhanov 2017-03-24 1223 edac_device_handle_ue(ocx->edac_dev, 0, 0, msg);
41003396f932d7 Sergey Temerkhanov 2017-03-24 1224 else if (ctx->reg_com_link_int & OCX_COM_LINK_INT_CE)
41003396f932d7 Sergey Temerkhanov 2017-03-24 1225 edac_device_handle_ce(ocx->edac_dev, 0, 0, msg);
41003396f932d7 Sergey Temerkhanov 2017-03-24 1226
41003396f932d7 Sergey Temerkhanov 2017-03-24 1227 ocx->link_ring_tail++;
41003396f932d7 Sergey Temerkhanov 2017-03-24 1228 }
41003396f932d7 Sergey Temerkhanov 2017-03-24 1229
41003396f932d7 Sergey Temerkhanov 2017-03-24 1230 ret = IRQ_HANDLED;
41003396f932d7 Sergey Temerkhanov 2017-03-24 1231 err_free:
41003396f932d7 Sergey Temerkhanov 2017-03-24 1232 kfree(other);
41003396f932d7 Sergey Temerkhanov 2017-03-24 1233 kfree(msg);
41003396f932d7 Sergey Temerkhanov 2017-03-24 1234
41003396f932d7 Sergey Temerkhanov 2017-03-24 1235 return ret;
41003396f932d7 Sergey Temerkhanov 2017-03-24 1236 }
41003396f932d7 Sergey Temerkhanov 2017-03-24 1237
:::::: The code at line 1220 was first introduced by commit
:::::: 41003396f932d7f027725c7acebb6a7caa41dc3e EDAC, thunderx: Add Cavium ThunderX EDAC driver
:::::: TO: Sergey Temerkhanov <s.temerkhanov(a)gmail.com>
:::::: CC: Borislav Petkov <bp(a)suse.de>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
10 months, 1 week
arch/ia64/kernel/ptrace.c:2053:6: warning: no previous prototype for 'syscall_get_arguments'
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 66f4beaa6c1d28161f534471484b2daa2de1dce0
commit: 7962c2eddbfe7cce879acb06f9b4f205789e57b7 arch: remove unused function syscall_set_arguments()
date: 9 weeks ago
config: ia64-defconfig (attached as .config)
compiler: ia64-linux-gcc (GCC) 11.2.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/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 7962c2eddbfe7cce879acb06f9b4f205789e57b7
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=ia64
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 >>):
arch/ia64/kernel/ptrace.c:1215:1: warning: no previous prototype for 'syscall_trace_enter' [-Wmissing-prototypes]
1215 | syscall_trace_enter (long arg0, long arg1, long arg2, long arg3,
| ^~~~~~~~~~~~~~~~~~~
arch/ia64/kernel/ptrace.c:1236:1: warning: no previous prototype for 'syscall_trace_leave' [-Wmissing-prototypes]
1236 | syscall_trace_leave (long arg0, long arg1, long arg2, long arg3,
| ^~~~~~~~~~~~~~~~~~~
>> arch/ia64/kernel/ptrace.c:2053:6: warning: no previous prototype for 'syscall_get_arguments' [-Wmissing-prototypes]
2053 | void syscall_get_arguments(struct task_struct *task,
| ^~~~~~~~~~~~~~~~~~~~~
vim +/syscall_get_arguments +2053 arch/ia64/kernel/ptrace.c
2052
> 2053 void syscall_get_arguments(struct task_struct *task,
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
10 months, 1 week
[drm-misc:drm-misc-next 5/5] drivers/gpu/drm/tidss/tidss_drv.c:91:32: error: 'tidss_pm_ops' defined but not used
by kernel test robot
tree: git://anongit.freedesktop.org/drm/drm-misc drm-misc-next
head: 6e120594631fdcfd83e5e0a1351730dae46d9d24
commit: 6e120594631fdcfd83e5e0a1351730dae46d9d24 [5/5] drm/tidss: Make use of the helper macro SET_RUNTIME_PM_OPS()
config: m68k-allmodconfig (attached as .config)
compiler: m68k-linux-gcc (GCC) 11.2.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 drm-misc git://anongit.freedesktop.org/drm/drm-misc
git fetch --no-tags drm-misc drm-misc-next
git checkout 6e120594631fdcfd83e5e0a1351730dae46d9d24
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=m68k
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 >>):
>> drivers/gpu/drm/tidss/tidss_drv.c:91:32: error: 'tidss_pm_ops' defined but not used [-Werror=unused-const-variable=]
91 | static const struct dev_pm_ops tidss_pm_ops = {
| ^~~~~~~~~~~~
cc1: all warnings being treated as errors
vim +/tidss_pm_ops +91 drivers/gpu/drm/tidss/tidss_drv.c
32a1795f57eecc Jyri Sarha 2019-11-08 90
32a1795f57eecc Jyri Sarha 2019-11-08 @91 static const struct dev_pm_ops tidss_pm_ops = {
32a1795f57eecc Jyri Sarha 2019-11-08 92 SET_SYSTEM_SLEEP_PM_OPS(tidss_suspend, tidss_resume)
6e120594631fdc Cai Huoqing 2021-09-07 93 SET_RUNTIME_PM_OPS(tidss_pm_runtime_suspend, tidss_pm_runtime_resume, NULL)
32a1795f57eecc Jyri Sarha 2019-11-08 94 };
32a1795f57eecc Jyri Sarha 2019-11-08 95
:::::: The code at line 91 was first introduced by commit
:::::: 32a1795f57eecc3974901760400618571c9d357f drm/tidss: New driver for TI Keystone platform Display SubSystem
:::::: TO: Jyri Sarha <jsarha(a)ti.com>
:::::: CC: Jyri Sarha <jsarha(a)ti.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
10 months, 1 week
[freescale-fslc:pr/462 11464/14694] drivers/dma/pxp/pxp_device.c:357:50: warning: implicit conversion from 'enum dma_data_direction' to 'enum dma_transfer_direction'
by kernel test robot
Hi Guoniu.zhou,
FYI, the error/warning still remains.
tree: https://github.com/Freescale/linux-fslc pr/462
head: d82f28fa72f28c7f24d32e0707fce12f234402bd
commit: c339e95a929cb7112a10f8b7ccccc62bcae2e48a [11464/14694] MLK-25591-03: pxp: Kconfg: remove dependency of 32 bits ARM platform
config: nds32-randconfig-r011-20211001 (attached as .config)
compiler: nds32le-linux-gcc (GCC) 11.2.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://github.com/Freescale/linux-fslc/commit/c339e95a929cb7112a10f8b7cc...
git remote add freescale-fslc https://github.com/Freescale/linux-fslc
git fetch --no-tags freescale-fslc pr/462
git checkout c339e95a929cb7112a10f8b7ccccc62bcae2e48a
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=nds32
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/dma/pxp/pxp_device.c: In function 'pxp_ioc_config_chan':
>> drivers/dma/pxp/pxp_device.c:357:50: warning: implicit conversion from 'enum dma_data_direction' to 'enum dma_transfer_direction' [-Wenum-conversion]
357 | DMA_TO_DEVICE,
| ^~~~~~~~~~~~~
vim +357 drivers/dma/pxp/pxp_device.c
ad85d4573b9201 Robby Cai 2019-08-15 305
ad85d4573b9201 Robby Cai 2019-08-15 306 static int pxp_ioc_config_chan(struct pxp_file *priv, unsigned long arg)
ad85d4573b9201 Robby Cai 2019-08-15 307 {
ad85d4573b9201 Robby Cai 2019-08-15 308 struct scatterlist *sg;
ad85d4573b9201 Robby Cai 2019-08-15 309 struct pxp_tx_desc *desc;
ad85d4573b9201 Robby Cai 2019-08-15 310 struct dma_async_tx_descriptor *txd;
ad85d4573b9201 Robby Cai 2019-08-15 311 struct pxp_config_data *pxp_conf;
ad85d4573b9201 Robby Cai 2019-08-15 312 dma_cookie_t cookie;
ad85d4573b9201 Robby Cai 2019-08-15 313 int handle, chan_id;
ad85d4573b9201 Robby Cai 2019-08-15 314 struct dma_chan *chan;
ad85d4573b9201 Robby Cai 2019-08-15 315 struct pxp_chan_obj *obj;
ad85d4573b9201 Robby Cai 2019-08-15 316 int i = 0, j = 0, k = 0, m = 0, length, ret, sg_len;
ad85d4573b9201 Robby Cai 2019-08-15 317
ad85d4573b9201 Robby Cai 2019-08-15 318 pxp_conf = kzalloc(sizeof(*pxp_conf), GFP_KERNEL);
ad85d4573b9201 Robby Cai 2019-08-15 319 if (!pxp_conf)
ad85d4573b9201 Robby Cai 2019-08-15 320 return -ENOMEM;
ad85d4573b9201 Robby Cai 2019-08-15 321
ad85d4573b9201 Robby Cai 2019-08-15 322 ret = copy_from_user(pxp_conf,
ad85d4573b9201 Robby Cai 2019-08-15 323 (struct pxp_config_data *)arg,
ad85d4573b9201 Robby Cai 2019-08-15 324 sizeof(struct pxp_config_data));
ad85d4573b9201 Robby Cai 2019-08-15 325 if (ret) {
ad85d4573b9201 Robby Cai 2019-08-15 326 kfree(pxp_conf);
ad85d4573b9201 Robby Cai 2019-08-15 327 return -EFAULT;
ad85d4573b9201 Robby Cai 2019-08-15 328 }
ad85d4573b9201 Robby Cai 2019-08-15 329
ad85d4573b9201 Robby Cai 2019-08-15 330 handle = pxp_conf->handle;
ad85d4573b9201 Robby Cai 2019-08-15 331 obj = pxp_channel_object_lookup(priv, handle);
ad85d4573b9201 Robby Cai 2019-08-15 332 if (!obj) {
ad85d4573b9201 Robby Cai 2019-08-15 333 kfree(pxp_conf);
ad85d4573b9201 Robby Cai 2019-08-15 334 return -EINVAL;
ad85d4573b9201 Robby Cai 2019-08-15 335 }
ad85d4573b9201 Robby Cai 2019-08-15 336 chan = obj->chan;
ad85d4573b9201 Robby Cai 2019-08-15 337 chan_id = chan->chan_id;
ad85d4573b9201 Robby Cai 2019-08-15 338
ad85d4573b9201 Robby Cai 2019-08-15 339 sg_len = 3;
ad85d4573b9201 Robby Cai 2019-08-15 340 if (pxp_conf->proc_data.engine_enable & PXP_ENABLE_WFE_A)
ad85d4573b9201 Robby Cai 2019-08-15 341 sg_len += 4;
ad85d4573b9201 Robby Cai 2019-08-15 342 if (pxp_conf->proc_data.engine_enable & PXP_ENABLE_WFE_B)
ad85d4573b9201 Robby Cai 2019-08-15 343 sg_len += 4;
ad85d4573b9201 Robby Cai 2019-08-15 344 if (pxp_conf->proc_data.engine_enable & PXP_ENABLE_DITHER)
ad85d4573b9201 Robby Cai 2019-08-15 345 sg_len += 4;
ad85d4573b9201 Robby Cai 2019-08-15 346
ad85d4573b9201 Robby Cai 2019-08-15 347 sg = kmalloc(sizeof(*sg) * sg_len, GFP_KERNEL);
ad85d4573b9201 Robby Cai 2019-08-15 348 if (!sg) {
ad85d4573b9201 Robby Cai 2019-08-15 349 kfree(pxp_conf);
ad85d4573b9201 Robby Cai 2019-08-15 350 return -ENOMEM;
ad85d4573b9201 Robby Cai 2019-08-15 351 }
ad85d4573b9201 Robby Cai 2019-08-15 352
ad85d4573b9201 Robby Cai 2019-08-15 353 sg_init_table(sg, sg_len);
ad85d4573b9201 Robby Cai 2019-08-15 354
ad85d4573b9201 Robby Cai 2019-08-15 355 txd = chan->device->device_prep_slave_sg(chan,
ad85d4573b9201 Robby Cai 2019-08-15 356 sg, sg_len,
ad85d4573b9201 Robby Cai 2019-08-15 @357 DMA_TO_DEVICE,
ad85d4573b9201 Robby Cai 2019-08-15 358 DMA_PREP_INTERRUPT,
ad85d4573b9201 Robby Cai 2019-08-15 359 NULL);
ad85d4573b9201 Robby Cai 2019-08-15 360 if (!txd) {
ad85d4573b9201 Robby Cai 2019-08-15 361 pr_err("Error preparing a DMA transaction descriptor.\n");
ad85d4573b9201 Robby Cai 2019-08-15 362 kfree(pxp_conf);
ad85d4573b9201 Robby Cai 2019-08-15 363 kfree(sg);
ad85d4573b9201 Robby Cai 2019-08-15 364 return -EIO;
ad85d4573b9201 Robby Cai 2019-08-15 365 }
ad85d4573b9201 Robby Cai 2019-08-15 366
ad85d4573b9201 Robby Cai 2019-08-15 367 txd->callback_param = txd;
ad85d4573b9201 Robby Cai 2019-08-15 368 txd->callback = pxp_dma_done;
ad85d4573b9201 Robby Cai 2019-08-15 369
ad85d4573b9201 Robby Cai 2019-08-15 370 desc = to_tx_desc(txd);
ad85d4573b9201 Robby Cai 2019-08-15 371
ad85d4573b9201 Robby Cai 2019-08-15 372 length = desc->len;
ad85d4573b9201 Robby Cai 2019-08-15 373 for (i = 0; i < length; i++) {
ad85d4573b9201 Robby Cai 2019-08-15 374 if (i == 0) { /* S0 */
ad85d4573b9201 Robby Cai 2019-08-15 375 memcpy(&desc->proc_data,
ad85d4573b9201 Robby Cai 2019-08-15 376 &pxp_conf->proc_data,
ad85d4573b9201 Robby Cai 2019-08-15 377 sizeof(struct pxp_proc_data));
ad85d4573b9201 Robby Cai 2019-08-15 378 memcpy(&desc->layer_param.s0_param,
ad85d4573b9201 Robby Cai 2019-08-15 379 &pxp_conf->s0_param,
ad85d4573b9201 Robby Cai 2019-08-15 380 sizeof(struct pxp_layer_param));
ad85d4573b9201 Robby Cai 2019-08-15 381 desc = desc->next;
ad85d4573b9201 Robby Cai 2019-08-15 382 } else if (i == 1) { /* Output */
ad85d4573b9201 Robby Cai 2019-08-15 383 memcpy(&desc->layer_param.out_param,
ad85d4573b9201 Robby Cai 2019-08-15 384 &pxp_conf->out_param,
ad85d4573b9201 Robby Cai 2019-08-15 385 sizeof(struct pxp_layer_param));
ad85d4573b9201 Robby Cai 2019-08-15 386 desc = desc->next;
ad85d4573b9201 Robby Cai 2019-08-15 387 } else if (i == 2) {
ad85d4573b9201 Robby Cai 2019-08-15 388 /* OverLay */
ad85d4573b9201 Robby Cai 2019-08-15 389 memcpy(&desc->layer_param.ol_param,
ad85d4573b9201 Robby Cai 2019-08-15 390 &pxp_conf->ol_param,
ad85d4573b9201 Robby Cai 2019-08-15 391 sizeof(struct pxp_layer_param));
ad85d4573b9201 Robby Cai 2019-08-15 392 desc = desc->next;
ad85d4573b9201 Robby Cai 2019-08-15 393 } else if ((pxp_conf->proc_data.engine_enable & PXP_ENABLE_WFE_A) && (j < 4)) {
ad85d4573b9201 Robby Cai 2019-08-15 394 for (j = 0; j < 4; j++) {
ad85d4573b9201 Robby Cai 2019-08-15 395 if (j == 0) {
ad85d4573b9201 Robby Cai 2019-08-15 396 memcpy(&desc->layer_param.processing_param,
ad85d4573b9201 Robby Cai 2019-08-15 397 &pxp_conf->wfe_a_fetch_param[0],
ad85d4573b9201 Robby Cai 2019-08-15 398 sizeof(struct pxp_layer_param));
ad85d4573b9201 Robby Cai 2019-08-15 399 desc->layer_param.processing_param.flag = PXP_BUF_FLAG_WFE_A_FETCH0;
ad85d4573b9201 Robby Cai 2019-08-15 400 } else if (j == 1) {
ad85d4573b9201 Robby Cai 2019-08-15 401 memcpy(&desc->layer_param.processing_param,
ad85d4573b9201 Robby Cai 2019-08-15 402 &pxp_conf->wfe_a_fetch_param[1],
ad85d4573b9201 Robby Cai 2019-08-15 403 sizeof(struct pxp_layer_param));
ad85d4573b9201 Robby Cai 2019-08-15 404 desc->layer_param.processing_param.flag = PXP_BUF_FLAG_WFE_A_FETCH1;
ad85d4573b9201 Robby Cai 2019-08-15 405 } else if (j == 2) {
ad85d4573b9201 Robby Cai 2019-08-15 406 memcpy(&desc->layer_param.processing_param,
ad85d4573b9201 Robby Cai 2019-08-15 407 &pxp_conf->wfe_a_store_param[0],
ad85d4573b9201 Robby Cai 2019-08-15 408 sizeof(struct pxp_layer_param));
ad85d4573b9201 Robby Cai 2019-08-15 409 desc->layer_param.processing_param.flag = PXP_BUF_FLAG_WFE_A_STORE0;
ad85d4573b9201 Robby Cai 2019-08-15 410 } else if (j == 3) {
ad85d4573b9201 Robby Cai 2019-08-15 411 memcpy(&desc->layer_param.processing_param,
ad85d4573b9201 Robby Cai 2019-08-15 412 &pxp_conf->wfe_a_store_param[1],
ad85d4573b9201 Robby Cai 2019-08-15 413 sizeof(struct pxp_layer_param));
ad85d4573b9201 Robby Cai 2019-08-15 414 desc->layer_param.processing_param.flag = PXP_BUF_FLAG_WFE_A_STORE1;
ad85d4573b9201 Robby Cai 2019-08-15 415 }
ad85d4573b9201 Robby Cai 2019-08-15 416
ad85d4573b9201 Robby Cai 2019-08-15 417 desc = desc->next;
ad85d4573b9201 Robby Cai 2019-08-15 418 }
ad85d4573b9201 Robby Cai 2019-08-15 419
ad85d4573b9201 Robby Cai 2019-08-15 420 i += 4;
ad85d4573b9201 Robby Cai 2019-08-15 421
ad85d4573b9201 Robby Cai 2019-08-15 422 } else if ((pxp_conf->proc_data.engine_enable & PXP_ENABLE_WFE_B) && (m < 4)) {
ad85d4573b9201 Robby Cai 2019-08-15 423 for (m = 0; m < 4; m++) {
ad85d4573b9201 Robby Cai 2019-08-15 424 if (m == 0) {
ad85d4573b9201 Robby Cai 2019-08-15 425 memcpy(&desc->layer_param.processing_param,
ad85d4573b9201 Robby Cai 2019-08-15 426 &pxp_conf->wfe_b_fetch_param[0],
ad85d4573b9201 Robby Cai 2019-08-15 427 sizeof(struct pxp_layer_param));
ad85d4573b9201 Robby Cai 2019-08-15 428 desc->layer_param.processing_param.flag = PXP_BUF_FLAG_WFE_B_FETCH0;
ad85d4573b9201 Robby Cai 2019-08-15 429 } else if (m == 1) {
ad85d4573b9201 Robby Cai 2019-08-15 430 memcpy(&desc->layer_param.processing_param,
ad85d4573b9201 Robby Cai 2019-08-15 431 &pxp_conf->wfe_b_fetch_param[1],
ad85d4573b9201 Robby Cai 2019-08-15 432 sizeof(struct pxp_layer_param));
ad85d4573b9201 Robby Cai 2019-08-15 433 desc->layer_param.processing_param.flag = PXP_BUF_FLAG_WFE_B_FETCH1;
ad85d4573b9201 Robby Cai 2019-08-15 434 } else if (m == 2) {
ad85d4573b9201 Robby Cai 2019-08-15 435 memcpy(&desc->layer_param.processing_param,
ad85d4573b9201 Robby Cai 2019-08-15 436 &pxp_conf->wfe_b_store_param[0],
ad85d4573b9201 Robby Cai 2019-08-15 437 sizeof(struct pxp_layer_param));
ad85d4573b9201 Robby Cai 2019-08-15 438 desc->layer_param.processing_param.flag = PXP_BUF_FLAG_WFE_B_STORE0;
ad85d4573b9201 Robby Cai 2019-08-15 439 } else if (m == 3) {
ad85d4573b9201 Robby Cai 2019-08-15 440 memcpy(&desc->layer_param.processing_param,
ad85d4573b9201 Robby Cai 2019-08-15 441 &pxp_conf->wfe_b_store_param[1],
ad85d4573b9201 Robby Cai 2019-08-15 442 sizeof(struct pxp_layer_param));
ad85d4573b9201 Robby Cai 2019-08-15 443 desc->layer_param.processing_param.flag = PXP_BUF_FLAG_WFE_B_STORE1;
ad85d4573b9201 Robby Cai 2019-08-15 444 }
ad85d4573b9201 Robby Cai 2019-08-15 445
ad85d4573b9201 Robby Cai 2019-08-15 446 desc = desc->next;
ad85d4573b9201 Robby Cai 2019-08-15 447 }
ad85d4573b9201 Robby Cai 2019-08-15 448
ad85d4573b9201 Robby Cai 2019-08-15 449 i += 4;
ad85d4573b9201 Robby Cai 2019-08-15 450
ad85d4573b9201 Robby Cai 2019-08-15 451 } else if ((pxp_conf->proc_data.engine_enable & PXP_ENABLE_DITHER) && (k < 4)) {
ad85d4573b9201 Robby Cai 2019-08-15 452 for (k = 0; k < 4; k++) {
ad85d4573b9201 Robby Cai 2019-08-15 453 if (k == 0) {
ad85d4573b9201 Robby Cai 2019-08-15 454 memcpy(&desc->layer_param.processing_param,
ad85d4573b9201 Robby Cai 2019-08-15 455 &pxp_conf->dither_fetch_param[0],
ad85d4573b9201 Robby Cai 2019-08-15 456 sizeof(struct pxp_layer_param));
ad85d4573b9201 Robby Cai 2019-08-15 457 desc->layer_param.processing_param.flag = PXP_BUF_FLAG_DITHER_FETCH0;
ad85d4573b9201 Robby Cai 2019-08-15 458 } else if (k == 1) {
ad85d4573b9201 Robby Cai 2019-08-15 459 memcpy(&desc->layer_param.processing_param,
ad85d4573b9201 Robby Cai 2019-08-15 460 &pxp_conf->dither_fetch_param[1],
ad85d4573b9201 Robby Cai 2019-08-15 461 sizeof(struct pxp_layer_param));
ad85d4573b9201 Robby Cai 2019-08-15 462 desc->layer_param.processing_param.flag = PXP_BUF_FLAG_DITHER_FETCH1;
ad85d4573b9201 Robby Cai 2019-08-15 463 } else if (k == 2) {
ad85d4573b9201 Robby Cai 2019-08-15 464 memcpy(&desc->layer_param.processing_param,
ad85d4573b9201 Robby Cai 2019-08-15 465 &pxp_conf->dither_store_param[0],
ad85d4573b9201 Robby Cai 2019-08-15 466 sizeof(struct pxp_layer_param));
ad85d4573b9201 Robby Cai 2019-08-15 467 desc->layer_param.processing_param.flag = PXP_BUF_FLAG_DITHER_STORE0;
ad85d4573b9201 Robby Cai 2019-08-15 468 } else if (k == 3) {
ad85d4573b9201 Robby Cai 2019-08-15 469 memcpy(&desc->layer_param.processing_param,
ad85d4573b9201 Robby Cai 2019-08-15 470 &pxp_conf->dither_store_param[1],
ad85d4573b9201 Robby Cai 2019-08-15 471 sizeof(struct pxp_layer_param));
ad85d4573b9201 Robby Cai 2019-08-15 472 desc->layer_param.processing_param.flag = PXP_BUF_FLAG_DITHER_STORE1;
ad85d4573b9201 Robby Cai 2019-08-15 473 }
ad85d4573b9201 Robby Cai 2019-08-15 474
ad85d4573b9201 Robby Cai 2019-08-15 475 desc = desc->next;
ad85d4573b9201 Robby Cai 2019-08-15 476 }
ad85d4573b9201 Robby Cai 2019-08-15 477
ad85d4573b9201 Robby Cai 2019-08-15 478 i += 4;
ad85d4573b9201 Robby Cai 2019-08-15 479 }
ad85d4573b9201 Robby Cai 2019-08-15 480 }
ad85d4573b9201 Robby Cai 2019-08-15 481
ad85d4573b9201 Robby Cai 2019-08-15 482 cookie = txd->tx_submit(txd);
ad85d4573b9201 Robby Cai 2019-08-15 483 if (cookie < 0) {
ad85d4573b9201 Robby Cai 2019-08-15 484 pr_err("Error tx_submit\n");
ad85d4573b9201 Robby Cai 2019-08-15 485 kfree(pxp_conf);
ad85d4573b9201 Robby Cai 2019-08-15 486 kfree(sg);
ad85d4573b9201 Robby Cai 2019-08-15 487 return -EIO;
ad85d4573b9201 Robby Cai 2019-08-15 488 }
ad85d4573b9201 Robby Cai 2019-08-15 489
ad85d4573b9201 Robby Cai 2019-08-15 490 atomic_inc(&irq_info[chan_id].irq_pending);
ad85d4573b9201 Robby Cai 2019-08-15 491
ad85d4573b9201 Robby Cai 2019-08-15 492 kfree(pxp_conf);
ad85d4573b9201 Robby Cai 2019-08-15 493 kfree(sg);
ad85d4573b9201 Robby Cai 2019-08-15 494
ad85d4573b9201 Robby Cai 2019-08-15 495 return 0;
ad85d4573b9201 Robby Cai 2019-08-15 496 }
ad85d4573b9201 Robby Cai 2019-08-15 497
:::::: The code at line 357 was first introduced by commit
:::::: ad85d4573b9201d18cc7d35ce05e4df8e5138b52 dma: pxp: porting pxp dma driver from imx_4.19.y
:::::: TO: Robby Cai <robby.cai(a)nxp.com>
:::::: CC: Dong Aisheng <aisheng.dong(a)nxp.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
10 months, 1 week