Re: [PATCH 7/8] drm/msm/dpu: add SM8150 to hw catalog
by kbuild test robot
CC: kbuild-all(a)lists.01.org
In-Reply-To: <20200526032235.21930-8-jonathan(a)marek.ca>
References: <20200526032235.21930-8-jonathan(a)marek.ca>
TO: Jonathan Marek <jonathan(a)marek.ca>
TO: freedreno(a)lists.freedesktop.org
CC: Rob Clark <robdclark(a)gmail.com>
CC: Sean Paul <sean(a)poorly.run>
CC: David Airlie <airlied(a)linux.ie>
CC: Daniel Vetter <daniel(a)ffwll.ch>
CC: Shubhashree Dhar <dhar(a)codeaurora.org>
CC: Raviteja Tamatam <travitej(a)codeaurora.org>
CC: Kalyan Thota <kalyan_t(a)codeaurora.org>
CC: Thomas Gleixner <tglx(a)linutronix.de>
CC: Stephen Boyd <swboyd(a)chromium.org>
Hi Jonathan,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on linus/master]
[also build test WARNING on v5.7-rc7]
[cannot apply to next-20200526]
[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/Jonathan-Marek/Initial-SM8150-an...
base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 9cb1fd0efd195590b828b9b865421ad345a4a145
:::::: branch date: 32 hours ago
:::::: commit date: 32 hours ago
config: arm64-randconfig-s031-20200527 (attached as .config)
compiler: aarch64-linux-gcc (GCC) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.1-240-gf0fe1cd9-dirty
# save the attached .config to linux build tree
make W=1 C=1 ARCH=arm64 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c:98:26: sparse: sparse: undefined identifier 'DPU_SSPP_SMART_DMA_V2_5'
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c:96:10: sparse: sparse: Initializer entry defined twice
>> drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c:104:10: sparse: also defined here
# https://github.com/0day-ci/linux/commit/6a90302321af832ea18679e1b29b0301c...
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout 6a90302321af832ea18679e1b29b0301caade709
vim +104 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c
7bdc0c4b812602f Kalyan Thota 2019-11-25 92
6a90302321af832 Jonathan Marek 2020-05-25 93 static const struct dpu_caps sm8150_dpu_caps = {
6a90302321af832 Jonathan Marek 2020-05-25 94 .max_mixer_width = DEFAULT_DPU_OUTPUT_LINE_WIDTH,
6a90302321af832 Jonathan Marek 2020-05-25 95 .max_mixer_blendstages = 0xb,
6a90302321af832 Jonathan Marek 2020-05-25 96 .max_linewidth = 4096,
6a90302321af832 Jonathan Marek 2020-05-25 97 .qseed_type = DPU_SSPP_SCALER_QSEED3,
6a90302321af832 Jonathan Marek 2020-05-25 98 .smart_dma_rev = DPU_SSPP_SMART_DMA_V2_5,
6a90302321af832 Jonathan Marek 2020-05-25 99 .ubwc_version = DPU_HW_UBWC_VER_30,
6a90302321af832 Jonathan Marek 2020-05-25 100 .has_src_split = true,
6a90302321af832 Jonathan Marek 2020-05-25 101 .has_dim_layer = true,
6a90302321af832 Jonathan Marek 2020-05-25 102 .has_idle_pc = true,
6a90302321af832 Jonathan Marek 2020-05-25 103 .has_3d_merge = true,
6a90302321af832 Jonathan Marek 2020-05-25 @104 .max_linewidth = 4096,
6a90302321af832 Jonathan Marek 2020-05-25 105 .pixel_ram_size = DEFAULT_PIXEL_RAM_SIZE,
6a90302321af832 Jonathan Marek 2020-05-25 106 .max_hdeci_exp = MAX_HORZ_DECIMATION,
6a90302321af832 Jonathan Marek 2020-05-25 107 .max_vdeci_exp = MAX_VERT_DECIMATION,
6a90302321af832 Jonathan Marek 2020-05-25 108 };
6a90302321af832 Jonathan Marek 2020-05-25 109
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years
[linux-next:master 11987/12912] net/netfilter/nf_conntrack_core.c:2068 __nf_conntrack_update() error: uninitialized symbol 'ctinfo'.
by kbuild test robot
CC: kbuild-all(a)lists.01.org
TO: Pablo Neira Ayuso <pablo(a)netfilter.org>
CC: Florian Westphal <fw(a)strlen.de>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: b0523c7b1c9d0edcd6c0fe6d2cb558a9ad5c60a8
commit: ee04805ff54a63ffd90bc6749ebfe73473734ddb [11987/12912] netfilter: conntrack: make conntrack userspace helpers work again
:::::: branch date: 16 hours ago
:::::: commit date: 32 hours ago
config: i386-randconfig-m021-20200527 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-13) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
New smatch warnings:
net/netfilter/nf_conntrack_core.c:2068 __nf_conntrack_update() error: uninitialized symbol 'ctinfo'.
net/netfilter/nf_conntrack_core.c:2117 nf_confirm_cthelper() warn: unsigned 'protoff' is never less than zero.
Old smatch warnings:
net/netfilter/nf_conntrack_core.c:1314 early_drop() error: uninitialized symbol 'bucket'.
# 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 remote update linux-next
git checkout ee04805ff54a63ffd90bc6749ebfe73473734ddb
vim +/ctinfo +2068 net/netfilter/nf_conntrack_core.c
9fb9cbb1082d6b3 Yasuyuki Kozakai 2005-11-09 2018
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2019 static int __nf_conntrack_update(struct net *net, struct sk_buff *skb,
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2020 struct nf_conn *ct)
368982cd7d1bd41 Pablo Neira Ayuso 2018-05-23 2021 {
368982cd7d1bd41 Pablo Neira Ayuso 2018-05-23 2022 struct nf_conntrack_tuple_hash *h;
368982cd7d1bd41 Pablo Neira Ayuso 2018-05-23 2023 struct nf_conntrack_tuple tuple;
368982cd7d1bd41 Pablo Neira Ayuso 2018-05-23 2024 enum ip_conntrack_info ctinfo;
368982cd7d1bd41 Pablo Neira Ayuso 2018-05-23 2025 struct nf_nat_hook *nat_hook;
6816d931cab0090 Florian Westphal 2018-06-29 2026 unsigned int status;
6816d931cab0090 Florian Westphal 2018-06-29 2027 int dataoff;
368982cd7d1bd41 Pablo Neira Ayuso 2018-05-23 2028 u16 l3num;
368982cd7d1bd41 Pablo Neira Ayuso 2018-05-23 2029 u8 l4num;
368982cd7d1bd41 Pablo Neira Ayuso 2018-05-23 2030
368982cd7d1bd41 Pablo Neira Ayuso 2018-05-23 2031 l3num = nf_ct_l3num(ct);
368982cd7d1bd41 Pablo Neira Ayuso 2018-05-23 2032
6816d931cab0090 Florian Westphal 2018-06-29 2033 dataoff = get_l4proto(skb, skb_network_offset(skb), l3num, &l4num);
6816d931cab0090 Florian Westphal 2018-06-29 2034 if (dataoff <= 0)
368982cd7d1bd41 Pablo Neira Ayuso 2018-05-23 2035 return -1;
368982cd7d1bd41 Pablo Neira Ayuso 2018-05-23 2036
368982cd7d1bd41 Pablo Neira Ayuso 2018-05-23 2037 if (!nf_ct_get_tuple(skb, skb_network_offset(skb), dataoff, l3num,
303e0c5589592e4 Florian Westphal 2019-01-15 2038 l4num, net, &tuple))
368982cd7d1bd41 Pablo Neira Ayuso 2018-05-23 2039 return -1;
368982cd7d1bd41 Pablo Neira Ayuso 2018-05-23 2040
368982cd7d1bd41 Pablo Neira Ayuso 2018-05-23 2041 if (ct->status & IPS_SRC_NAT) {
368982cd7d1bd41 Pablo Neira Ayuso 2018-05-23 2042 memcpy(tuple.src.u3.all,
368982cd7d1bd41 Pablo Neira Ayuso 2018-05-23 2043 ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.u3.all,
368982cd7d1bd41 Pablo Neira Ayuso 2018-05-23 2044 sizeof(tuple.src.u3.all));
368982cd7d1bd41 Pablo Neira Ayuso 2018-05-23 2045 tuple.src.u.all =
368982cd7d1bd41 Pablo Neira Ayuso 2018-05-23 2046 ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.u.all;
368982cd7d1bd41 Pablo Neira Ayuso 2018-05-23 2047 }
368982cd7d1bd41 Pablo Neira Ayuso 2018-05-23 2048
368982cd7d1bd41 Pablo Neira Ayuso 2018-05-23 2049 if (ct->status & IPS_DST_NAT) {
368982cd7d1bd41 Pablo Neira Ayuso 2018-05-23 2050 memcpy(tuple.dst.u3.all,
368982cd7d1bd41 Pablo Neira Ayuso 2018-05-23 2051 ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.dst.u3.all,
368982cd7d1bd41 Pablo Neira Ayuso 2018-05-23 2052 sizeof(tuple.dst.u3.all));
368982cd7d1bd41 Pablo Neira Ayuso 2018-05-23 2053 tuple.dst.u.all =
368982cd7d1bd41 Pablo Neira Ayuso 2018-05-23 2054 ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.dst.u.all;
368982cd7d1bd41 Pablo Neira Ayuso 2018-05-23 2055 }
368982cd7d1bd41 Pablo Neira Ayuso 2018-05-23 2056
368982cd7d1bd41 Pablo Neira Ayuso 2018-05-23 2057 h = nf_conntrack_find_get(net, nf_ct_zone(ct), &tuple);
368982cd7d1bd41 Pablo Neira Ayuso 2018-05-23 2058 if (!h)
368982cd7d1bd41 Pablo Neira Ayuso 2018-05-23 2059 return 0;
368982cd7d1bd41 Pablo Neira Ayuso 2018-05-23 2060
368982cd7d1bd41 Pablo Neira Ayuso 2018-05-23 2061 /* Store status bits of the conntrack that is clashing to re-do NAT
368982cd7d1bd41 Pablo Neira Ayuso 2018-05-23 2062 * mangling according to what it has been done already to this packet.
368982cd7d1bd41 Pablo Neira Ayuso 2018-05-23 2063 */
368982cd7d1bd41 Pablo Neira Ayuso 2018-05-23 2064 status = ct->status;
368982cd7d1bd41 Pablo Neira Ayuso 2018-05-23 2065
368982cd7d1bd41 Pablo Neira Ayuso 2018-05-23 2066 nf_ct_put(ct);
368982cd7d1bd41 Pablo Neira Ayuso 2018-05-23 2067 ct = nf_ct_tuplehash_to_ctrack(h);
368982cd7d1bd41 Pablo Neira Ayuso 2018-05-23 @2068 nf_ct_set(skb, ct, ctinfo);
368982cd7d1bd41 Pablo Neira Ayuso 2018-05-23 2069
368982cd7d1bd41 Pablo Neira Ayuso 2018-05-23 2070 nat_hook = rcu_dereference(nf_nat_hook);
368982cd7d1bd41 Pablo Neira Ayuso 2018-05-23 2071 if (!nat_hook)
368982cd7d1bd41 Pablo Neira Ayuso 2018-05-23 2072 return 0;
368982cd7d1bd41 Pablo Neira Ayuso 2018-05-23 2073
368982cd7d1bd41 Pablo Neira Ayuso 2018-05-23 2074 if (status & IPS_SRC_NAT &&
368982cd7d1bd41 Pablo Neira Ayuso 2018-05-23 2075 nat_hook->manip_pkt(skb, ct, NF_NAT_MANIP_SRC,
368982cd7d1bd41 Pablo Neira Ayuso 2018-05-23 2076 IP_CT_DIR_ORIGINAL) == NF_DROP)
368982cd7d1bd41 Pablo Neira Ayuso 2018-05-23 2077 return -1;
368982cd7d1bd41 Pablo Neira Ayuso 2018-05-23 2078
368982cd7d1bd41 Pablo Neira Ayuso 2018-05-23 2079 if (status & IPS_DST_NAT &&
368982cd7d1bd41 Pablo Neira Ayuso 2018-05-23 2080 nat_hook->manip_pkt(skb, ct, NF_NAT_MANIP_DST,
368982cd7d1bd41 Pablo Neira Ayuso 2018-05-23 2081 IP_CT_DIR_ORIGINAL) == NF_DROP)
368982cd7d1bd41 Pablo Neira Ayuso 2018-05-23 2082 return -1;
368982cd7d1bd41 Pablo Neira Ayuso 2018-05-23 2083
368982cd7d1bd41 Pablo Neira Ayuso 2018-05-23 2084 return 0;
368982cd7d1bd41 Pablo Neira Ayuso 2018-05-23 2085 }
368982cd7d1bd41 Pablo Neira Ayuso 2018-05-23 2086
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2087 /* This packet is coming from userspace via nf_queue, complete the packet
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2088 * processing after the helper invocation in nf_confirm().
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2089 */
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2090 static int nf_confirm_cthelper(struct sk_buff *skb, struct nf_conn *ct,
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2091 enum ip_conntrack_info ctinfo)
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2092 {
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2093 const struct nf_conntrack_helper *helper;
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2094 const struct nf_conn_help *help;
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2095 unsigned int protoff;
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2096
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2097 help = nfct_help(ct);
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2098 if (!help)
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2099 return 0;
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2100
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2101 helper = rcu_dereference(help->helper);
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2102 if (!(helper->flags & NF_CT_HELPER_F_USERSPACE))
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2103 return 0;
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2104
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2105 switch (nf_ct_l3num(ct)) {
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2106 case NFPROTO_IPV4:
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2107 protoff = skb_network_offset(skb) + ip_hdrlen(skb);
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2108 break;
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2109 #if IS_ENABLED(CONFIG_IPV6)
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2110 case NFPROTO_IPV6: {
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2111 __be16 frag_off;
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2112 u8 pnum;
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2113
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2114 pnum = ipv6_hdr(skb)->nexthdr;
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2115 protoff = ipv6_skip_exthdr(skb, sizeof(struct ipv6hdr), &pnum,
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2116 &frag_off);
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 @2117 if (protoff < 0 || (frag_off & htons(~0x7)) != 0)
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2118 return 0;
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2119 break;
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2120 }
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2121 #endif
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2122 default:
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2123 return 0;
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2124 }
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2125
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2126 if (test_bit(IPS_SEQ_ADJUST_BIT, &ct->status) &&
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2127 !nf_is_loopback_packet(skb)) {
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2128 if (!nf_ct_seq_adjust(skb, ct, ctinfo, protoff)) {
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2129 NF_CT_STAT_INC_ATOMIC(nf_ct_net(ct), drop);
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2130 return -1;
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2131 }
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2132 }
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2133
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2134 /* We've seen it coming out the other side: confirm it */
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2135 return nf_conntrack_confirm(skb) == NF_DROP ? - 1 : 0;
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2136 }
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2137
:::::: The code at line 2068 was first introduced by commit
:::::: 368982cd7d1bd41cd39049c794990aca3770db44 netfilter: nfnetlink_queue: resolve clash for unconfirmed conntracks
:::::: TO: Pablo Neira Ayuso <pablo(a)netfilter.org>
:::::: CC: Pablo Neira Ayuso <pablo(a)netfilter.org>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years
[linux-next:master 11987/12912] net/netfilter/nf_conntrack_core.c:2117:6-13: WARNING: Unsigned expression compared with zero: protoff < 0
by kbuild test robot
CC: kbuild-all(a)lists.01.org
TO: Pablo Neira Ayuso <pablo(a)netfilter.org>
CC: Florian Westphal <fw(a)strlen.de>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: b0523c7b1c9d0edcd6c0fe6d2cb558a9ad5c60a8
commit: ee04805ff54a63ffd90bc6749ebfe73473734ddb [11987/12912] netfilter: conntrack: make conntrack userspace helpers work again
:::::: branch date: 13 hours ago
:::::: commit date: 29 hours ago
config: microblaze-randconfig-c022-20200526 (attached as .config)
compiler: microblaze-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
Reported-by: Julia Lawall <julia.lawall(a)lip6.fr>
coccinelle warnings: (new ones prefixed by >>)
>> net/netfilter/nf_conntrack_core.c:2117:6-13: WARNING: Unsigned expression compared with zero: protoff < 0
# 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 remote update linux-next
git checkout ee04805ff54a63ffd90bc6749ebfe73473734ddb
vim +2117 net/netfilter/nf_conntrack_core.c
368982cd7d1bd41 Pablo Neira Ayuso 2018-05-23 2086
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2087 /* This packet is coming from userspace via nf_queue, complete the packet
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2088 * processing after the helper invocation in nf_confirm().
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2089 */
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2090 static int nf_confirm_cthelper(struct sk_buff *skb, struct nf_conn *ct,
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2091 enum ip_conntrack_info ctinfo)
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2092 {
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2093 const struct nf_conntrack_helper *helper;
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2094 const struct nf_conn_help *help;
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2095 unsigned int protoff;
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2096
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2097 help = nfct_help(ct);
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2098 if (!help)
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2099 return 0;
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2100
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2101 helper = rcu_dereference(help->helper);
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2102 if (!(helper->flags & NF_CT_HELPER_F_USERSPACE))
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2103 return 0;
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2104
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2105 switch (nf_ct_l3num(ct)) {
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2106 case NFPROTO_IPV4:
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2107 protoff = skb_network_offset(skb) + ip_hdrlen(skb);
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2108 break;
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2109 #if IS_ENABLED(CONFIG_IPV6)
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2110 case NFPROTO_IPV6: {
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2111 __be16 frag_off;
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2112 u8 pnum;
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2113
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2114 pnum = ipv6_hdr(skb)->nexthdr;
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2115 protoff = ipv6_skip_exthdr(skb, sizeof(struct ipv6hdr), &pnum,
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2116 &frag_off);
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 @2117 if (protoff < 0 || (frag_off & htons(~0x7)) != 0)
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2118 return 0;
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2119 break;
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2120 }
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2121 #endif
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2122 default:
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2123 return 0;
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2124 }
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2125
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2126 if (test_bit(IPS_SEQ_ADJUST_BIT, &ct->status) &&
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2127 !nf_is_loopback_packet(skb)) {
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2128 if (!nf_ct_seq_adjust(skb, ct, ctinfo, protoff)) {
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2129 NF_CT_STAT_INC_ATOMIC(nf_ct_net(ct), drop);
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2130 return -1;
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2131 }
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2132 }
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2133
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2134 /* We've seen it coming out the other side: confirm it */
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2135 return nf_conntrack_confirm(skb) == NF_DROP ? - 1 : 0;
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2136 }
ee04805ff54a63f Pablo Neira Ayuso 2020-05-24 2137
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years
[linux-next:master 10689/12912] drivers/infiniband/hw/hfi1/netdev_rx.c:335 hfi1_netdev_free() error: use free_netdev() here instead of kfree(dd->dummy_netdev)
by kbuild test robot
CC: kbuild-all(a)lists.01.org
TO: Grzegorz Andrejczuk <grzegorz.andrejczuk(a)intel.com>
CC: Jason Gunthorpe <jgg(a)mellanox.com>
CC: Mike Marciniszyn <mike.marciniszyn(a)intel.com>
CC: Dennis Dalessandro <dennis.dalessandro(a)intel.com>
CC: Sadanand Warrier <sadanand.warrier(a)intel.com>
CC: Kaike Wan <kaike.wan(a)intel.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: b0523c7b1c9d0edcd6c0fe6d2cb558a9ad5c60a8
commit: 370caa5b5880cd988645735c2d5d1d597c258e39 [10689/12912] IB/hfi1: Add rx functions for dummy netdev
:::::: branch date: 7 hours ago
:::::: commit date: 5 days ago
config: x86_64-randconfig-m001-20200526 (attached as .config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
smatch warnings:
drivers/infiniband/hw/hfi1/netdev_rx.c:335 hfi1_netdev_free() error: use free_netdev() here instead of kfree(dd->dummy_netdev)
# 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 remote update linux-next
git checkout 370caa5b5880cd988645735c2d5d1d597c258e39
vim +335 drivers/infiniband/hw/hfi1/netdev_rx.c
370caa5b5880cd9 Grzegorz Andrejczuk 2020-05-11 327
370caa5b5880cd9 Grzegorz Andrejczuk 2020-05-11 328 void hfi1_netdev_free(struct hfi1_devdata *dd)
370caa5b5880cd9 Grzegorz Andrejczuk 2020-05-11 329 {
370caa5b5880cd9 Grzegorz Andrejczuk 2020-05-11 330 struct hfi1_netdev_priv *priv;
370caa5b5880cd9 Grzegorz Andrejczuk 2020-05-11 331
370caa5b5880cd9 Grzegorz Andrejczuk 2020-05-11 332 if (dd->dummy_netdev) {
370caa5b5880cd9 Grzegorz Andrejczuk 2020-05-11 333 priv = hfi1_netdev_priv(dd->dummy_netdev);
370caa5b5880cd9 Grzegorz Andrejczuk 2020-05-11 334 dd_dev_info(dd, "hfi1 netdev freed\n");
370caa5b5880cd9 Grzegorz Andrejczuk 2020-05-11 @335 kfree(dd->dummy_netdev);
370caa5b5880cd9 Grzegorz Andrejczuk 2020-05-11 336 dd->dummy_netdev = NULL;
370caa5b5880cd9 Grzegorz Andrejczuk 2020-05-11 337 }
370caa5b5880cd9 Grzegorz Andrejczuk 2020-05-11 338 }
370caa5b5880cd9 Grzegorz Andrejczuk 2020-05-11 339
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years
[linux-next:master 12558/12912] net/ipv4/tcp_ipv4.c:576 tcp_v4_err() error: uninitialized symbol 'skb'.
by kbuild test robot
CC: kbuild-all(a)lists.01.org
TO: Eric Dumazet <edumazet(a)google.com>
CC: "Maciej Żenczykowski" <maze(a)google.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head: b0523c7b1c9d0edcd6c0fe6d2cb558a9ad5c60a8
commit: 45af29ca761c275e350cca659856bc56f1035ef9 [12558/12912] tcp: allow traceroute -Mtcp for unpriv users
:::::: branch date: 6 hours ago
:::::: commit date: 16 hours ago
config: i386-randconfig-m021-20200526 (attached as .config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
smatch warnings:
net/ipv4/tcp_ipv4.c:576 tcp_v4_err() error: uninitialized symbol 'skb'.
# 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 remote update linux-next
git checkout 45af29ca761c275e350cca659856bc56f1035ef9
vim +/skb +576 net/ipv4/tcp_ipv4.c
26e3736090e103 Eric Dumazet 2015-03-22 405
^1da177e4c3f41 Linus Torvalds 2005-04-16 406 /*
^1da177e4c3f41 Linus Torvalds 2005-04-16 407 * This routine is called by the ICMP module when it gets some
^1da177e4c3f41 Linus Torvalds 2005-04-16 408 * sort of error condition. If err < 0 then the socket should
^1da177e4c3f41 Linus Torvalds 2005-04-16 409 * be closed and the error returned to the user. If err > 0
^1da177e4c3f41 Linus Torvalds 2005-04-16 410 * it's just the icmp type << 8 | icmp code. After adjustment
^1da177e4c3f41 Linus Torvalds 2005-04-16 411 * header points to the first 8 bytes of the tcp header. We need
^1da177e4c3f41 Linus Torvalds 2005-04-16 412 * to find the appropriate port.
^1da177e4c3f41 Linus Torvalds 2005-04-16 413 *
^1da177e4c3f41 Linus Torvalds 2005-04-16 414 * The locking strategy used here is very "optimistic". When
^1da177e4c3f41 Linus Torvalds 2005-04-16 415 * someone else accesses the socket the ICMP is just dropped
^1da177e4c3f41 Linus Torvalds 2005-04-16 416 * and for some paths there is no check at all.
^1da177e4c3f41 Linus Torvalds 2005-04-16 417 * A more general error queue to queue errors for later handling
^1da177e4c3f41 Linus Torvalds 2005-04-16 418 * is probably better.
^1da177e4c3f41 Linus Torvalds 2005-04-16 419 *
^1da177e4c3f41 Linus Torvalds 2005-04-16 420 */
^1da177e4c3f41 Linus Torvalds 2005-04-16 421
32bbd8793f24b0 Stefano Brivio 2018-11-08 422 int tcp_v4_err(struct sk_buff *icmp_skb, u32 info)
^1da177e4c3f41 Linus Torvalds 2005-04-16 423 {
b71d1d426d263b Eric Dumazet 2011-04-22 424 const struct iphdr *iph = (const struct iphdr *)icmp_skb->data;
4d1a2d9ec1c17d Damian Lukowski 2009-08-26 425 struct tcphdr *th = (struct tcphdr *)(icmp_skb->data + (iph->ihl << 2));
f1ecd5d9e73666 Damian Lukowski 2009-08-26 426 struct inet_connection_sock *icsk;
^1da177e4c3f41 Linus Torvalds 2005-04-16 427 struct tcp_sock *tp;
^1da177e4c3f41 Linus Torvalds 2005-04-16 428 struct inet_sock *inet;
4d1a2d9ec1c17d Damian Lukowski 2009-08-26 429 const int type = icmp_hdr(icmp_skb)->type;
4d1a2d9ec1c17d Damian Lukowski 2009-08-26 430 const int code = icmp_hdr(icmp_skb)->code;
^1da177e4c3f41 Linus Torvalds 2005-04-16 431 struct sock *sk;
f1ecd5d9e73666 Damian Lukowski 2009-08-26 432 struct sk_buff *skb;
0a672f74131dd6 Yuchung Cheng 2014-05-11 433 struct request_sock *fastopen;
9a568de4818dea Eric Dumazet 2017-05-16 434 u32 seq, snd_una;
9a568de4818dea Eric Dumazet 2017-05-16 435 s32 remaining;
9a568de4818dea Eric Dumazet 2017-05-16 436 u32 delta_us;
^1da177e4c3f41 Linus Torvalds 2005-04-16 437 int err;
4d1a2d9ec1c17d Damian Lukowski 2009-08-26 438 struct net *net = dev_net(icmp_skb->dev);
^1da177e4c3f41 Linus Torvalds 2005-04-16 439
26e3736090e103 Eric Dumazet 2015-03-22 440 sk = __inet_lookup_established(net, &tcp_hashinfo, iph->daddr,
26e3736090e103 Eric Dumazet 2015-03-22 441 th->dest, iph->saddr, ntohs(th->source),
3fa6f616a7a4d0 David Ahern 2017-08-07 442 inet_iif(icmp_skb), 0);
^1da177e4c3f41 Linus Torvalds 2005-04-16 443 if (!sk) {
5d3848bc33b7d1 Eric Dumazet 2016-04-27 444 __ICMP_INC_STATS(net, ICMP_MIB_INERRORS);
32bbd8793f24b0 Stefano Brivio 2018-11-08 445 return -ENOENT;
^1da177e4c3f41 Linus Torvalds 2005-04-16 446 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 447 if (sk->sk_state == TCP_TIME_WAIT) {
9469c7b4aa210c YOSHIFUJI Hideaki 2006-10-10 448 inet_twsk_put(inet_twsk(sk));
32bbd8793f24b0 Stefano Brivio 2018-11-08 449 return 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 450 }
26e3736090e103 Eric Dumazet 2015-03-22 451 seq = ntohl(th->seq);
32bbd8793f24b0 Stefano Brivio 2018-11-08 452 if (sk->sk_state == TCP_NEW_SYN_RECV) {
32bbd8793f24b0 Stefano Brivio 2018-11-08 453 tcp_req_err(sk, seq, type == ICMP_PARAMETERPROB ||
9cf7490360bf2c Eric Dumazet 2016-02-02 454 type == ICMP_TIME_EXCEEDED ||
9cf7490360bf2c Eric Dumazet 2016-02-02 455 (type == ICMP_DEST_UNREACH &&
9cf7490360bf2c Eric Dumazet 2016-02-02 456 (code == ICMP_NET_UNREACH ||
9cf7490360bf2c Eric Dumazet 2016-02-02 457 code == ICMP_HOST_UNREACH)));
32bbd8793f24b0 Stefano Brivio 2018-11-08 458 return 0;
32bbd8793f24b0 Stefano Brivio 2018-11-08 459 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 460
^1da177e4c3f41 Linus Torvalds 2005-04-16 461 bh_lock_sock(sk);
^1da177e4c3f41 Linus Torvalds 2005-04-16 462 /* If too many ICMPs get dropped on busy
^1da177e4c3f41 Linus Torvalds 2005-04-16 463 * servers this needs to be solved differently.
563d34d0578626 Eric Dumazet 2012-07-23 464 * We do take care of PMTU discovery (RFC1191) special case :
563d34d0578626 Eric Dumazet 2012-07-23 465 * we can receive locally generated ICMP messages while socket is held.
^1da177e4c3f41 Linus Torvalds 2005-04-16 466 */
b74aa930ef49a3 Eric Dumazet 2013-01-19 467 if (sock_owned_by_user(sk)) {
b74aa930ef49a3 Eric Dumazet 2013-01-19 468 if (!(type == ICMP_DEST_UNREACH && code == ICMP_FRAG_NEEDED))
02a1d6e7a6bb02 Eric Dumazet 2016-04-27 469 __NET_INC_STATS(net, LINUX_MIB_LOCKDROPPEDICMPS);
b74aa930ef49a3 Eric Dumazet 2013-01-19 470 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 471 if (sk->sk_state == TCP_CLOSE)
^1da177e4c3f41 Linus Torvalds 2005-04-16 472 goto out;
^1da177e4c3f41 Linus Torvalds 2005-04-16 473
97e3ecd112ba45 stephen hemminger 2010-03-18 474 if (unlikely(iph->ttl < inet_sk(sk)->min_ttl)) {
02a1d6e7a6bb02 Eric Dumazet 2016-04-27 475 __NET_INC_STATS(net, LINUX_MIB_TCPMINTTLDROP);
97e3ecd112ba45 stephen hemminger 2010-03-18 476 goto out;
97e3ecd112ba45 stephen hemminger 2010-03-18 477 }
97e3ecd112ba45 stephen hemminger 2010-03-18 478
f1ecd5d9e73666 Damian Lukowski 2009-08-26 479 icsk = inet_csk(sk);
^1da177e4c3f41 Linus Torvalds 2005-04-16 480 tp = tcp_sk(sk);
0a672f74131dd6 Yuchung Cheng 2014-05-11 481 /* XXX (TFO) - tp->snd_una should be ISN (tcp_create_openreq_child() */
d983ea6f16b835 Eric Dumazet 2019-10-10 482 fastopen = rcu_dereference(tp->fastopen_rsk);
0a672f74131dd6 Yuchung Cheng 2014-05-11 483 snd_una = fastopen ? tcp_rsk(fastopen)->snt_isn : tp->snd_una;
^1da177e4c3f41 Linus Torvalds 2005-04-16 484 if (sk->sk_state != TCP_LISTEN &&
0a672f74131dd6 Yuchung Cheng 2014-05-11 485 !between(seq, snd_una, tp->snd_nxt)) {
02a1d6e7a6bb02 Eric Dumazet 2016-04-27 486 __NET_INC_STATS(net, LINUX_MIB_OUTOFWINDOWICMPS);
^1da177e4c3f41 Linus Torvalds 2005-04-16 487 goto out;
^1da177e4c3f41 Linus Torvalds 2005-04-16 488 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 489
^1da177e4c3f41 Linus Torvalds 2005-04-16 490 switch (type) {
55be7a9c6074f7 David S. Miller 2012-07-11 491 case ICMP_REDIRECT:
45caeaa5ac0b4b Jon Maxwell 2017-03-10 492 if (!sock_owned_by_user(sk))
55be7a9c6074f7 David S. Miller 2012-07-11 493 do_redirect(icmp_skb, sk);
55be7a9c6074f7 David S. Miller 2012-07-11 494 goto out;
^1da177e4c3f41 Linus Torvalds 2005-04-16 495 case ICMP_SOURCE_QUENCH:
^1da177e4c3f41 Linus Torvalds 2005-04-16 496 /* Just silently ignore these. */
^1da177e4c3f41 Linus Torvalds 2005-04-16 497 goto out;
^1da177e4c3f41 Linus Torvalds 2005-04-16 498 case ICMP_PARAMETERPROB:
^1da177e4c3f41 Linus Torvalds 2005-04-16 499 err = EPROTO;
^1da177e4c3f41 Linus Torvalds 2005-04-16 500 break;
^1da177e4c3f41 Linus Torvalds 2005-04-16 501 case ICMP_DEST_UNREACH:
^1da177e4c3f41 Linus Torvalds 2005-04-16 502 if (code > NR_ICMP_UNREACH)
^1da177e4c3f41 Linus Torvalds 2005-04-16 503 goto out;
^1da177e4c3f41 Linus Torvalds 2005-04-16 504
^1da177e4c3f41 Linus Torvalds 2005-04-16 505 if (code == ICMP_FRAG_NEEDED) { /* PMTU discovery (RFC1191) */
0d4f0608619de5 Eric Dumazet 2013-03-18 506 /* We are not interested in TCP_LISTEN and open_requests
0d4f0608619de5 Eric Dumazet 2013-03-18 507 * (SYN-ACKs send out by Linux are always <576bytes so
0d4f0608619de5 Eric Dumazet 2013-03-18 508 * they should go through unfragmented).
0d4f0608619de5 Eric Dumazet 2013-03-18 509 */
0d4f0608619de5 Eric Dumazet 2013-03-18 510 if (sk->sk_state == TCP_LISTEN)
0d4f0608619de5 Eric Dumazet 2013-03-18 511 goto out;
0d4f0608619de5 Eric Dumazet 2013-03-18 512
563d34d0578626 Eric Dumazet 2012-07-23 513 tp->mtu_info = info;
144d56e9104418 Eric Dumazet 2012-08-20 514 if (!sock_owned_by_user(sk)) {
563d34d0578626 Eric Dumazet 2012-07-23 515 tcp_v4_mtu_reduced(sk);
144d56e9104418 Eric Dumazet 2012-08-20 516 } else {
7aa5470c2c0926 Eric Dumazet 2016-12-03 517 if (!test_and_set_bit(TCP_MTU_REDUCED_DEFERRED, &sk->sk_tsq_flags))
144d56e9104418 Eric Dumazet 2012-08-20 518 sock_hold(sk);
144d56e9104418 Eric Dumazet 2012-08-20 519 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 520 goto out;
^1da177e4c3f41 Linus Torvalds 2005-04-16 521 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 522
^1da177e4c3f41 Linus Torvalds 2005-04-16 523 err = icmp_err_convert[code].errno;
f1ecd5d9e73666 Damian Lukowski 2009-08-26 524 /* check if icmp_skb allows revert of backoff
f1ecd5d9e73666 Damian Lukowski 2009-08-26 525 * (see draft-zimmermann-tcp-lcd) */
f1ecd5d9e73666 Damian Lukowski 2009-08-26 526 if (code != ICMP_NET_UNREACH && code != ICMP_HOST_UNREACH)
f1ecd5d9e73666 Damian Lukowski 2009-08-26 527 break;
f1ecd5d9e73666 Damian Lukowski 2009-08-26 528 if (seq != tp->snd_una || !icsk->icsk_retransmits ||
0a672f74131dd6 Yuchung Cheng 2014-05-11 529 !icsk->icsk_backoff || fastopen)
f1ecd5d9e73666 Damian Lukowski 2009-08-26 530 break;
f1ecd5d9e73666 Damian Lukowski 2009-08-26 531
8f49c2703b3351 David S. Miller 2010-11-12 532 if (sock_owned_by_user(sk))
8f49c2703b3351 David S. Miller 2010-11-12 533 break;
8f49c2703b3351 David S. Miller 2010-11-12 534
2c4cc9712364c0 Eric Dumazet 2019-02-15 535 skb = tcp_rtx_queue_head(sk);
2c4cc9712364c0 Eric Dumazet 2019-02-15 536 if (WARN_ON_ONCE(!skb))
2c4cc9712364c0 Eric Dumazet 2019-02-15 537 break;
2c4cc9712364c0 Eric Dumazet 2019-02-15 538
f1ecd5d9e73666 Damian Lukowski 2009-08-26 539 icsk->icsk_backoff--;
fcdd1cf4dd63ae Eric Dumazet 2014-09-22 540 icsk->icsk_rto = tp->srtt_us ? __tcp_set_rto(tp) :
fcdd1cf4dd63ae Eric Dumazet 2014-09-22 541 TCP_TIMEOUT_INIT;
fcdd1cf4dd63ae Eric Dumazet 2014-09-22 542 icsk->icsk_rto = inet_csk_rto_backoff(icsk, TCP_RTO_MAX);
f1ecd5d9e73666 Damian Lukowski 2009-08-26 543
f1ecd5d9e73666 Damian Lukowski 2009-08-26 544
9a568de4818dea Eric Dumazet 2017-05-16 545 tcp_mstamp_refresh(tp);
2fd66ffba50716 Eric Dumazet 2018-09-21 546 delta_us = (u32)(tp->tcp_mstamp - tcp_skb_timestamp_us(skb));
7faee5c0d51416 Eric Dumazet 2014-09-05 547 remaining = icsk->icsk_rto -
9a568de4818dea Eric Dumazet 2017-05-16 548 usecs_to_jiffies(delta_us);
f1ecd5d9e73666 Damian Lukowski 2009-08-26 549
9a568de4818dea Eric Dumazet 2017-05-16 550 if (remaining > 0) {
f1ecd5d9e73666 Damian Lukowski 2009-08-26 551 inet_csk_reset_xmit_timer(sk, ICSK_TIME_RETRANS,
f1ecd5d9e73666 Damian Lukowski 2009-08-26 552 remaining, TCP_RTO_MAX);
f1ecd5d9e73666 Damian Lukowski 2009-08-26 553 } else {
f1ecd5d9e73666 Damian Lukowski 2009-08-26 554 /* RTO revert clocked out retransmission.
f1ecd5d9e73666 Damian Lukowski 2009-08-26 555 * Will retransmit now */
f1ecd5d9e73666 Damian Lukowski 2009-08-26 556 tcp_retransmit_timer(sk);
f1ecd5d9e73666 Damian Lukowski 2009-08-26 557 }
f1ecd5d9e73666 Damian Lukowski 2009-08-26 558
^1da177e4c3f41 Linus Torvalds 2005-04-16 559 break;
^1da177e4c3f41 Linus Torvalds 2005-04-16 560 case ICMP_TIME_EXCEEDED:
^1da177e4c3f41 Linus Torvalds 2005-04-16 561 err = EHOSTUNREACH;
^1da177e4c3f41 Linus Torvalds 2005-04-16 562 break;
^1da177e4c3f41 Linus Torvalds 2005-04-16 563 default:
^1da177e4c3f41 Linus Torvalds 2005-04-16 564 goto out;
^1da177e4c3f41 Linus Torvalds 2005-04-16 565 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 566
^1da177e4c3f41 Linus Torvalds 2005-04-16 567 switch (sk->sk_state) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 568 case TCP_SYN_SENT:
0a672f74131dd6 Yuchung Cheng 2014-05-11 569 case TCP_SYN_RECV:
0a672f74131dd6 Yuchung Cheng 2014-05-11 570 /* Only in fast or simultaneous open. If a fast open socket is
0a672f74131dd6 Yuchung Cheng 2014-05-11 571 * is already accepted it is treated as a connected one below.
^1da177e4c3f41 Linus Torvalds 2005-04-16 572 */
51456b2914a34d Ian Morris 2015-04-03 573 if (fastopen && !fastopen->sk)
0a672f74131dd6 Yuchung Cheng 2014-05-11 574 break;
0a672f74131dd6 Yuchung Cheng 2014-05-11 575
45af29ca761c27 Eric Dumazet 2020-05-24 @576 ip_icmp_error(sk, skb, err, th->dest, info, (u8 *)th);
45af29ca761c27 Eric Dumazet 2020-05-24 577
^1da177e4c3f41 Linus Torvalds 2005-04-16 578 if (!sock_owned_by_user(sk)) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 579 sk->sk_err = err;
^1da177e4c3f41 Linus Torvalds 2005-04-16 580
^1da177e4c3f41 Linus Torvalds 2005-04-16 581 sk->sk_error_report(sk);
^1da177e4c3f41 Linus Torvalds 2005-04-16 582
^1da177e4c3f41 Linus Torvalds 2005-04-16 583 tcp_done(sk);
^1da177e4c3f41 Linus Torvalds 2005-04-16 584 } else {
^1da177e4c3f41 Linus Torvalds 2005-04-16 585 sk->sk_err_soft = err;
^1da177e4c3f41 Linus Torvalds 2005-04-16 586 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 587 goto out;
^1da177e4c3f41 Linus Torvalds 2005-04-16 588 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 589
^1da177e4c3f41 Linus Torvalds 2005-04-16 590 /* If we've already connected we will keep trying
^1da177e4c3f41 Linus Torvalds 2005-04-16 591 * until we time out, or the user gives up.
^1da177e4c3f41 Linus Torvalds 2005-04-16 592 *
^1da177e4c3f41 Linus Torvalds 2005-04-16 593 * rfc1122 4.2.3.9 allows to consider as hard errors
^1da177e4c3f41 Linus Torvalds 2005-04-16 594 * only PROTO_UNREACH and PORT_UNREACH (well, FRAG_FAILED too,
^1da177e4c3f41 Linus Torvalds 2005-04-16 595 * but it is obsoleted by pmtu discovery).
^1da177e4c3f41 Linus Torvalds 2005-04-16 596 *
^1da177e4c3f41 Linus Torvalds 2005-04-16 597 * Note, that in modern internet, where routing is unreliable
^1da177e4c3f41 Linus Torvalds 2005-04-16 598 * and in each dark corner broken firewalls sit, sending random
^1da177e4c3f41 Linus Torvalds 2005-04-16 599 * errors ordered by their masters even this two messages finally lose
^1da177e4c3f41 Linus Torvalds 2005-04-16 600 * their original sense (even Linux sends invalid PORT_UNREACHs)
^1da177e4c3f41 Linus Torvalds 2005-04-16 601 *
^1da177e4c3f41 Linus Torvalds 2005-04-16 602 * Now we are in compliance with RFCs.
^1da177e4c3f41 Linus Torvalds 2005-04-16 603 * --ANK (980905)
^1da177e4c3f41 Linus Torvalds 2005-04-16 604 */
^1da177e4c3f41 Linus Torvalds 2005-04-16 605
^1da177e4c3f41 Linus Torvalds 2005-04-16 606 inet = inet_sk(sk);
^1da177e4c3f41 Linus Torvalds 2005-04-16 607 if (!sock_owned_by_user(sk) && inet->recverr) {
^1da177e4c3f41 Linus Torvalds 2005-04-16 608 sk->sk_err = err;
^1da177e4c3f41 Linus Torvalds 2005-04-16 609 sk->sk_error_report(sk);
^1da177e4c3f41 Linus Torvalds 2005-04-16 610 } else { /* Only an error on timeout */
^1da177e4c3f41 Linus Torvalds 2005-04-16 611 sk->sk_err_soft = err;
^1da177e4c3f41 Linus Torvalds 2005-04-16 612 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 613
^1da177e4c3f41 Linus Torvalds 2005-04-16 614 out:
^1da177e4c3f41 Linus Torvalds 2005-04-16 615 bh_unlock_sock(sk);
^1da177e4c3f41 Linus Torvalds 2005-04-16 616 sock_put(sk);
32bbd8793f24b0 Stefano Brivio 2018-11-08 617 return 0;
^1da177e4c3f41 Linus Torvalds 2005-04-16 618 }
^1da177e4c3f41 Linus Torvalds 2005-04-16 619
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 1 month
net/dsa/tag_8021q.c:109 dsa_8021q_restore_pvid() error: uninitialized symbol 'pvid'.
by Dan Carpenter
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 9cb1fd0efd195590b828b9b865421ad345a4a145
commit: c80ed84e76886487703bf04b38ce10e92e2d6e26 net: dsa: tag_8021q: Fix dsa_8021q_restore_pvid for an absent pvid
date: 6 months ago
config: x86_64-randconfig-m001-20200526 (attached as .config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
smatch warnings:
net/dsa/tag_8021q.c:109 dsa_8021q_restore_pvid() error: uninitialized symbol 'pvid'.
# 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 remote update linus
git checkout c80ed84e76886487703bf04b38ce10e92e2d6e26
vim +/pvid +109 net/dsa/tag_8021q.c
5f33183b7fdfeb Vladimir Oltean 2019-08-30 96 static int dsa_8021q_restore_pvid(struct dsa_switch *ds, int port)
5f33183b7fdfeb Vladimir Oltean 2019-08-30 97 {
5f33183b7fdfeb Vladimir Oltean 2019-08-30 98 struct bridge_vlan_info vinfo;
5f33183b7fdfeb Vladimir Oltean 2019-08-30 99 struct net_device *slave;
5f33183b7fdfeb Vladimir Oltean 2019-08-30 100 u16 pvid;
5f33183b7fdfeb Vladimir Oltean 2019-08-30 101 int err;
5f33183b7fdfeb Vladimir Oltean 2019-08-30 102
5f33183b7fdfeb Vladimir Oltean 2019-08-30 103 if (!dsa_is_user_port(ds, port))
5f33183b7fdfeb Vladimir Oltean 2019-08-30 104 return 0;
5f33183b7fdfeb Vladimir Oltean 2019-08-30 105
5f33183b7fdfeb Vladimir Oltean 2019-08-30 106 slave = ds->ports[port].slave;
5f33183b7fdfeb Vladimir Oltean 2019-08-30 107
5f33183b7fdfeb Vladimir Oltean 2019-08-30 108 err = br_vlan_get_pvid(slave, &pvid);
c80ed84e768864 Vladimir Oltean 2019-11-16 @109 if (!pvid || err < 0)
^^^^^^^^^^^^^^^^
I don't know why this warning is only showing up now in May 2020...
Anyway, we could solve the problem by checking for errors first:
if (err < 0 || !pvid) {
The UBSan tool can detect uninitialized values used at runtime so it
might generate a splat as well. Other than that, obviously it is
harmless.
5f33183b7fdfeb Vladimir Oltean 2019-08-30 110 /* There is no pvid on the bridge for this port, which is
5f33183b7fdfeb Vladimir Oltean 2019-08-30 111 * perfectly valid. Nothing to restore, bye-bye!
5f33183b7fdfeb Vladimir Oltean 2019-08-30 112 */
5f33183b7fdfeb Vladimir Oltean 2019-08-30 113 return 0;
5f33183b7fdfeb Vladimir Oltean 2019-08-30 114
5f33183b7fdfeb Vladimir Oltean 2019-08-30 115 err = br_vlan_get_info(slave, pvid, &vinfo);
5f33183b7fdfeb Vladimir Oltean 2019-08-30 116 if (err < 0) {
5f33183b7fdfeb Vladimir Oltean 2019-08-30 117 dev_err(ds->dev, "Couldn't determine PVID attributes\n");
5f33183b7fdfeb Vladimir Oltean 2019-08-30 118 return err;
5f33183b7fdfeb Vladimir Oltean 2019-08-30 119 }
5f33183b7fdfeb Vladimir Oltean 2019-08-30 120
5f33183b7fdfeb Vladimir Oltean 2019-08-30 121 return dsa_port_vid_add(&ds->ports[port], pvid, vinfo.flags);
5f33183b7fdfeb Vladimir Oltean 2019-08-30 122 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 1 month
Re: [PATCH 1/2] nl80211: FILS discovery/bcast probe resp support
by Dan Carpenter
Hi Aloka,
url: https://github.com/0day-ci/linux/commits/Aloka-Dixit/FILS-discovery-and-b...
base: https://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git master
config: x86_64-defconfig (attached as .config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
New smatch warnings:
net/wireless/nl80211.c:4771 nl80211_parse_fd_bcastpresp() error: we previously assumed 'tmpl' could be null (see line 4766)
# https://github.com/0day-ci/linux/commit/d7497e63c41decf82e86f11b0691e47e2...
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout d7497e63c41decf82e86f11b0691e47e24b11122
vim +/tmpl +4771 net/wireless/nl80211.c
d7497e63c41dec Aloka Dixit 2020-05-22 4738 static int nl80211_parse_fd_bcastpresp(struct genl_info *info,
d7497e63c41dec Aloka Dixit 2020-05-22 4739 struct cfg80211_ap_settings *params)
d7497e63c41dec Aloka Dixit 2020-05-22 4740 {
d7497e63c41dec Aloka Dixit 2020-05-22 4741 struct nlattr *tmpl;
d7497e63c41dec Aloka Dixit 2020-05-22 4742 struct nlattr *tb[NL80211_FD_BCASTPRESP_ATTR_MAX + 1];
d7497e63c41dec Aloka Dixit 2020-05-22 4743 int ret;
d7497e63c41dec Aloka Dixit 2020-05-22 4744 struct cfg80211_beacon_data *beacon = ¶ms->beacon;
d7497e63c41dec Aloka Dixit 2020-05-22 4745 struct cfg80211_fd_bcastpresp *cfg;
d7497e63c41dec Aloka Dixit 2020-05-22 4746
d7497e63c41dec Aloka Dixit 2020-05-22 4747 if (params->chandef.center_freq1 <= 5940 &&
d7497e63c41dec Aloka Dixit 2020-05-22 4748 params->chandef.center_freq1 >= 7105)
d7497e63c41dec Aloka Dixit 2020-05-22 4749 return -EOPNOTSUPP;
d7497e63c41dec Aloka Dixit 2020-05-22 4750
d7497e63c41dec Aloka Dixit 2020-05-22 4751 ret = nla_parse_nested(tb, NL80211_FD_BCASTPRESP_ATTR_MAX,
d7497e63c41dec Aloka Dixit 2020-05-22 4752 info->attrs[NL80211_ATTR_FD_BCASTPRESP_CFG],
d7497e63c41dec Aloka Dixit 2020-05-22 4753 fd_bcastpresp_policy, NULL);
d7497e63c41dec Aloka Dixit 2020-05-22 4754 if (ret)
d7497e63c41dec Aloka Dixit 2020-05-22 4755 return ret;
d7497e63c41dec Aloka Dixit 2020-05-22 4756
d7497e63c41dec Aloka Dixit 2020-05-22 4757 if (!tb[NL80211_FD_BCASTPRESP_ATTR_TYPE] ||
d7497e63c41dec Aloka Dixit 2020-05-22 4758 !tb[NL80211_FD_BCASTPRESP_ATTR_INT])
d7497e63c41dec Aloka Dixit 2020-05-22 4759 return -EINVAL;
d7497e63c41dec Aloka Dixit 2020-05-22 4760
d7497e63c41dec Aloka Dixit 2020-05-22 4761 cfg = ¶ms->fd_bcastpresp;
d7497e63c41dec Aloka Dixit 2020-05-22 4762 cfg->type = nla_get_u8(tb[NL80211_FD_BCASTPRESP_ATTR_TYPE]);
d7497e63c41dec Aloka Dixit 2020-05-22 4763 cfg->interval = nla_get_u32(tb[NL80211_FD_BCASTPRESP_ATTR_INT]);
d7497e63c41dec Aloka Dixit 2020-05-22 4764
d7497e63c41dec Aloka Dixit 2020-05-22 4765 tmpl = tb[NL80211_FD_BCASTPRESP_ATTR_TMPL];
d7497e63c41dec Aloka Dixit 2020-05-22 @4766 if (!tmpl && !beacon->fils_disc_len && !beacon->bcast_presp_len)
Should the && be ||?
d7497e63c41dec Aloka Dixit 2020-05-22 4767 return -EINVAL;
d7497e63c41dec Aloka Dixit 2020-05-22 4768
d7497e63c41dec Aloka Dixit 2020-05-22 4769 if (cfg->type == CFG80211_TYPE_FILS_DISCOVERY) {
d7497e63c41dec Aloka Dixit 2020-05-22 4770 beacon->fils_disc = nla_data(tmpl);
d7497e63c41dec Aloka Dixit 2020-05-22 @4771 beacon->fils_disc_len = nla_len(tmpl);
^^^^
Unchecked dereference.
d7497e63c41dec Aloka Dixit 2020-05-22 4772 } else if (cfg->type == CFG80211_TYPE_BCAST_PROBE_RESP) {
d7497e63c41dec Aloka Dixit 2020-05-22 4773 beacon->bcast_presp = nla_data(tmpl);
d7497e63c41dec Aloka Dixit 2020-05-22 4774 beacon->bcast_presp_len = nla_len(tmpl);
d7497e63c41dec Aloka Dixit 2020-05-22 4775 }
d7497e63c41dec Aloka Dixit 2020-05-22 4776
d7497e63c41dec Aloka Dixit 2020-05-22 4777 return 0;
d7497e63c41dec Aloka Dixit 2020-05-22 4778 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 1 month
[djwong-xfs:repair-metadata-atomically 77/229] fs/xfs/scrub/rtsummary.c:75 xchk_setup_rtsummary() error: uninitialized symbol 'resblks'.
by Dan Carpenter
tree: https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git repair-metadata-atomically
head: d334005df02786c9f288f2c7060603e9680946b5
commit: 0d44a170037d3e6825d8ca4b52f3cf6019a40850 [77/229] xfs: online repair of realtime summaries
config: i386-allyesconfig (attached as .config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
smatch warnings:
fs/xfs/scrub/rtsummary.c:75 xchk_setup_rtsummary() error: uninitialized symbol 'resblks'.
# https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git/comm...
git remote add djwong-xfs https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git
git remote update djwong-xfs
git checkout 0d44a170037d3e6825d8ca4b52f3cf6019a40850
vim +/resblks +75 fs/xfs/scrub/rtsummary.c
7a9053f61cc608e Darrick J. Wong 2020-03-10 56 int
d11bb52d9fe16ea Darrick J. Wong 2020-03-16 57 xchk_setup_rtsummary(
d11bb52d9fe16ea Darrick J. Wong 2020-03-16 58 struct xfs_scrub *sc,
d11bb52d9fe16ea Darrick J. Wong 2020-03-16 59 struct xfs_inode *ip)
7a9053f61cc608e Darrick J. Wong 2020-03-10 60 {
d11bb52d9fe16ea Darrick J. Wong 2020-03-16 61 struct xfs_mount *mp = sc->mp;
0d44a170037d3e6 Darrick J. Wong 2020-03-12 62 unsigned long long resblks;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
d11bb52d9fe16ea Darrick J. Wong 2020-03-16 63 int error;
d11bb52d9fe16ea Darrick J. Wong 2020-03-16 64
0d44a170037d3e6 Darrick J. Wong 2020-03-12 65 /*
0d44a170037d3e6 Darrick J. Wong 2020-03-12 66 * If we're doing a repair, we reserve 2x the summary blocks: once for
0d44a170037d3e6 Darrick J. Wong 2020-03-12 67 * the new summary contents and again for the bmbt blocks and the
0d44a170037d3e6 Darrick J. Wong 2020-03-12 68 * remapping operation.
0d44a170037d3e6 Darrick J. Wong 2020-03-12 69 */
0d44a170037d3e6 Darrick J. Wong 2020-03-12 70 if (sc->sm->sm_flags & XFS_SCRUB_IFLAG_REPAIR) {
0d44a170037d3e6 Darrick J. Wong 2020-03-12 71 resblks = XFS_B_TO_FSB(sc->mp, sc->mp->m_rsumsize) * 2;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
0d44a170037d3e6 Darrick J. Wong 2020-03-12 72 if (resblks > UINT_MAX)
0d44a170037d3e6 Darrick J. Wong 2020-03-12 73 return -EOPNOTSUPP;
0d44a170037d3e6 Darrick J. Wong 2020-03-12 74 }
0d44a170037d3e6 Darrick J. Wong 2020-03-12 @75 error = xchk_trans_alloc(sc, resblks);
^^^^^^^
Uninitialized on else path.
d11bb52d9fe16ea Darrick J. Wong 2020-03-16 76 if (error)
d11bb52d9fe16ea Darrick J. Wong 2020-03-16 77 return error;
d11bb52d9fe16ea Darrick J. Wong 2020-03-16 78
d11bb52d9fe16ea Darrick J. Wong 2020-03-16 79 /* Allocate a memory buffer for the summary comparison. */
d11bb52d9fe16ea Darrick J. Wong 2020-03-16 80 sc->buf = kmem_alloc_large(sc->mp->m_sb.sb_blocksize, KM_MAYFAIL);
d11bb52d9fe16ea Darrick J. Wong 2020-03-16 81 if (!sc->buf)
d11bb52d9fe16ea Darrick J. Wong 2020-03-16 82 return -ENOMEM;
7a9053f61cc608e Darrick J. Wong 2020-03-10 83
7a9053f61cc608e Darrick J. Wong 2020-03-10 84 /*
d11bb52d9fe16ea Darrick J. Wong 2020-03-16 85 * Locking order requires us to take the rtbitmap first. We must be
d11bb52d9fe16ea Darrick J. Wong 2020-03-16 86 * careful to unlock it ourselves when we are done with the rtbitmap
d11bb52d9fe16ea Darrick J. Wong 2020-03-16 87 * file since the scrub infrastructure won't do that for us.
7a9053f61cc608e Darrick J. Wong 2020-03-10 88 */
d11bb52d9fe16ea Darrick J. Wong 2020-03-16 89 xfs_ilock(mp->m_rbmip, XFS_ILOCK_SHARED | XFS_ILOCK_RTBITMAP);
d11bb52d9fe16ea Darrick J. Wong 2020-03-16 90
d11bb52d9fe16ea Darrick J. Wong 2020-03-16 91 /* ...and then we can lock the rtsummary inode. */
7a9053f61cc608e Darrick J. Wong 2020-03-10 92 sc->ilock_flags = XFS_ILOCK_EXCL | XFS_ILOCK_RTSUM;
d11bb52d9fe16ea Darrick J. Wong 2020-03-16 93 sc->ip = sc->mp->m_rsumip;
7a9053f61cc608e Darrick J. Wong 2020-03-10 94 xfs_ilock(sc->ip, sc->ilock_flags);
7a9053f61cc608e Darrick J. Wong 2020-03-10 95
d11bb52d9fe16ea Darrick J. Wong 2020-03-16 96 return 0;
d11bb52d9fe16ea Darrick J. Wong 2020-03-16 97 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 1 month
[djwong-xfs:repair-metadata-atomically 206/229] fs/xfs/xfs_bmap_item.c:503 xfs_bui_item_recover() error: uninitialized symbol 'type'.
by Dan Carpenter
tree: https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git repair-metadata-atomically
head: d334005df02786c9f288f2c7060603e9680946b5
commit: ff363fee12a5518f3bcd0f904b46d737e811cf0b [206/229] xfs: clean up xfs_bui_item_recover
config: i386-allyesconfig (attached as .config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
smatch warnings:
fs/xfs/xfs_bmap_item.c:503 xfs_bui_item_recover() error: uninitialized symbol 'type'.
# https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git/comm...
git remote add djwong-xfs https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux.git
git remote update djwong-xfs
git checkout ff363fee12a5518f3bcd0f904b46d737e811cf0b
vim +/type +503 fs/xfs/xfs_bmap_item.c
ba266f4f4c84ea Darrick J. Wong 2020-05-15 423 STATIC int
c557f2b9dcf4ed Darrick J. Wong 2020-05-15 424 xfs_bui_item_recover(
c557f2b9dcf4ed Darrick J. Wong 2020-05-15 425 struct xfs_log_item *lip,
aaddb7e46e876a Darrick J. Wong 2020-05-15 426 struct xfs_defer_capture **dfcp)
77d61fe45e7205 Darrick J. Wong 2016-10-03 427 {
c557f2b9dcf4ed Darrick J. Wong 2020-05-15 428 struct xfs_bmbt_irec irec;
c557f2b9dcf4ed Darrick J. Wong 2020-05-15 429 struct xfs_bui_log_item *buip = BUI_ITEM(lip);
c557f2b9dcf4ed Darrick J. Wong 2020-05-15 430 struct xfs_trans *tp;
c557f2b9dcf4ed Darrick J. Wong 2020-05-15 431 struct xfs_inode *ip = NULL;
aaddb7e46e876a Darrick J. Wong 2020-05-15 432 struct xfs_mount *mp = lip->li_mountp;
77d61fe45e7205 Darrick J. Wong 2016-10-03 433 struct xfs_map_extent *bmap;
c557f2b9dcf4ed Darrick J. Wong 2020-05-15 434 struct xfs_bud_log_item *budp;
77d61fe45e7205 Darrick J. Wong 2016-10-03 435 xfs_fsblock_t startblock_fsb;
77d61fe45e7205 Darrick J. Wong 2016-10-03 436 xfs_fsblock_t inode_fsb;
e1a4e37cc7b665 Darrick J. Wong 2017-06-14 437 xfs_filblks_t count;
c557f2b9dcf4ed Darrick J. Wong 2020-05-15 438 xfs_exntst_t state;
9f3afb57d5f1e7 Darrick J. Wong 2016-10-03 439 enum xfs_bmap_intent_type type;
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
c557f2b9dcf4ed Darrick J. Wong 2020-05-15 440 unsigned int bui_type;
9f3afb57d5f1e7 Darrick J. Wong 2016-10-03 441 int whichfork;
c557f2b9dcf4ed Darrick J. Wong 2020-05-15 442 int error = 0;
77d61fe45e7205 Darrick J. Wong 2016-10-03 443
77d61fe45e7205 Darrick J. Wong 2016-10-03 444 /* Only one mapping operation per BUI... */
ff363fee12a551 Darrick J. Wong 2020-05-21 445 if (buip->bui_format.bui_nextents != XFS_BUI_MAX_FAST_EXTENTS)
ff363fee12a551 Darrick J. Wong 2020-05-21 446 goto garbage;
77d61fe45e7205 Darrick J. Wong 2016-10-03 447
77d61fe45e7205 Darrick J. Wong 2016-10-03 448 /*
77d61fe45e7205 Darrick J. Wong 2016-10-03 449 * First check the validity of the extent described by the
77d61fe45e7205 Darrick J. Wong 2016-10-03 450 * BUI. If anything is bad, then toss the BUI.
77d61fe45e7205 Darrick J. Wong 2016-10-03 451 */
77d61fe45e7205 Darrick J. Wong 2016-10-03 452 bmap = &buip->bui_format.bui_extents[0];
77d61fe45e7205 Darrick J. Wong 2016-10-03 453 startblock_fsb = XFS_BB_TO_FSB(mp,
77d61fe45e7205 Darrick J. Wong 2016-10-03 454 XFS_FSB_TO_DADDR(mp, bmap->me_startblock));
77d61fe45e7205 Darrick J. Wong 2016-10-03 455 inode_fsb = XFS_BB_TO_FSB(mp, XFS_FSB_TO_DADDR(mp,
77d61fe45e7205 Darrick J. Wong 2016-10-03 456 XFS_INO_TO_FSB(mp, bmap->me_owner)));
ff363fee12a551 Darrick J. Wong 2020-05-21 457 state = (bmap->me_flags & XFS_BMAP_EXTENT_UNWRITTEN) ?
ff363fee12a551 Darrick J. Wong 2020-05-21 458 XFS_EXT_UNWRITTEN : XFS_EXT_NORM;
ff363fee12a551 Darrick J. Wong 2020-05-21 459 whichfork = (bmap->me_flags & XFS_BMAP_EXTENT_ATTR_FORK) ?
ff363fee12a551 Darrick J. Wong 2020-05-21 460 XFS_ATTR_FORK : XFS_DATA_FORK;
ff363fee12a551 Darrick J. Wong 2020-05-21 461 bui_type = bmap->me_flags & XFS_BMAP_EXTENT_TYPE_MASK;
ff363fee12a551 Darrick J. Wong 2020-05-21 462 switch (bui_type) {
77d61fe45e7205 Darrick J. Wong 2016-10-03 463 case XFS_BMAP_MAP:
77d61fe45e7205 Darrick J. Wong 2016-10-03 464 case XFS_BMAP_UNMAP:
77d61fe45e7205 Darrick J. Wong 2016-10-03 465 break;
77d61fe45e7205 Darrick J. Wong 2016-10-03 466 default:
ff363fee12a551 Darrick J. Wong 2020-05-21 467 goto garbage;
77d61fe45e7205 Darrick J. Wong 2016-10-03 468 }
ff363fee12a551 Darrick J. Wong 2020-05-21 469 if (startblock_fsb == 0 ||
77d61fe45e7205 Darrick J. Wong 2016-10-03 470 bmap->me_len == 0 ||
77d61fe45e7205 Darrick J. Wong 2016-10-03 471 inode_fsb == 0 ||
77d61fe45e7205 Darrick J. Wong 2016-10-03 472 startblock_fsb >= mp->m_sb.sb_dblocks ||
77d61fe45e7205 Darrick J. Wong 2016-10-03 473 bmap->me_len >= mp->m_sb.sb_agblocks ||
77d61fe45e7205 Darrick J. Wong 2016-10-03 474 inode_fsb >= mp->m_sb.sb_dblocks ||
ff363fee12a551 Darrick J. Wong 2020-05-21 475 (bmap->me_flags & ~XFS_BMAP_EXTENT_FLAGS))
ff363fee12a551 Darrick J. Wong 2020-05-21 476 goto garbage;
9f3afb57d5f1e7 Darrick J. Wong 2016-10-03 477
9f3afb57d5f1e7 Darrick J. Wong 2016-10-03 478 /* Grab the inode. */
ff363fee12a551 Darrick J. Wong 2020-05-21 479 error = xfs_iget(mp, NULL, bmap->me_owner, 0, 0, &ip);
9f3afb57d5f1e7 Darrick J. Wong 2016-10-03 480 if (error)
ff363fee12a551 Darrick J. Wong 2020-05-21 481 return error;
17c12bcd3030e4 Darrick J. Wong 2016-10-03 482 if (VFS_I(ip)->i_nlink == 0)
17c12bcd3030e4 Darrick J. Wong 2016-10-03 483 xfs_iflags_set(ip, XFS_IRECOVERY);
9f3afb57d5f1e7 Darrick J. Wong 2016-10-03 484
ff363fee12a551 Darrick J. Wong 2020-05-21 485 /* Allocate transaction and do the work. */
ff363fee12a551 Darrick J. Wong 2020-05-21 486 error = xfs_trans_alloc(mp, &M_RES(mp)->tr_itruncate,
ff363fee12a551 Darrick J. Wong 2020-05-21 487 XFS_EXTENTADD_SPACE_RES(mp, XFS_DATA_FORK), 0, 0, &tp);
ff363fee12a551 Darrick J. Wong 2020-05-21 488 if (error)
ff363fee12a551 Darrick J. Wong 2020-05-21 489 goto err_rele;
ff363fee12a551 Darrick J. Wong 2020-05-21 490
ff363fee12a551 Darrick J. Wong 2020-05-21 491 budp = xfs_trans_get_bud(tp, buip);
ff363fee12a551 Darrick J. Wong 2020-05-21 492 xfs_ilock(ip, XFS_ILOCK_EXCL);
9f3afb57d5f1e7 Darrick J. Wong 2016-10-03 493 xfs_trans_ijoin(tp, ip, 0);
9f3afb57d5f1e7 Darrick J. Wong 2016-10-03 494
e1a4e37cc7b665 Darrick J. Wong 2017-06-14 495 count = bmap->me_len;
ff363fee12a551 Darrick J. Wong 2020-05-21 496 error = xfs_trans_log_finish_bmap_update(tp, budp, bui_type, ip,
ff363fee12a551 Darrick J. Wong 2020-05-21 497 whichfork, bmap->me_startoff, bmap->me_startblock,
ff363fee12a551 Darrick J. Wong 2020-05-21 498 &count, state);
9f3afb57d5f1e7 Darrick J. Wong 2016-10-03 499 if (error)
ff363fee12a551 Darrick J. Wong 2020-05-21 500 goto err_cancel;
9f3afb57d5f1e7 Darrick J. Wong 2016-10-03 501
e1a4e37cc7b665 Darrick J. Wong 2017-06-14 502 if (count > 0) {
e1a4e37cc7b665 Darrick J. Wong 2017-06-14 @503 ASSERT(type == XFS_BMAP_UNMAP);
^^^^^^^^^^^^^^^^^^^^^^
Dead code.
e1a4e37cc7b665 Darrick J. Wong 2017-06-14 504 irec.br_startblock = bmap->me_startblock;
e1a4e37cc7b665 Darrick J. Wong 2017-06-14 505 irec.br_blockcount = count;
e1a4e37cc7b665 Darrick J. Wong 2017-06-14 506 irec.br_startoff = bmap->me_startoff;
e1a4e37cc7b665 Darrick J. Wong 2017-06-14 507 irec.br_state = state;
3e08f42ae7828b Darrick J. Wong 2019-08-26 508 xfs_bmap_unmap_extent(tp, ip, &irec);
e1a4e37cc7b665 Darrick J. Wong 2017-06-14 509 }
e1a4e37cc7b665 Darrick J. Wong 2017-06-14 510
ff363fee12a551 Darrick J. Wong 2020-05-21 511 /* Commit transaction, which frees tp. */
aaddb7e46e876a Darrick J. Wong 2020-05-15 512 error = xlog_recover_trans_commit(tp, dfcp);
ff363fee12a551 Darrick J. Wong 2020-05-21 513 if (error)
ff363fee12a551 Darrick J. Wong 2020-05-21 514 goto err_unlock;
ff363fee12a551 Darrick J. Wong 2020-05-21 515 return 0;
9f3afb57d5f1e7 Darrick J. Wong 2016-10-03 516
ff363fee12a551 Darrick J. Wong 2020-05-21 517 err_cancel:
9f3afb57d5f1e7 Darrick J. Wong 2016-10-03 518 xfs_trans_cancel(tp);
ff363fee12a551 Darrick J. Wong 2020-05-21 519 err_unlock:
9f3afb57d5f1e7 Darrick J. Wong 2016-10-03 520 xfs_iunlock(ip, XFS_ILOCK_EXCL);
ff363fee12a551 Darrick J. Wong 2020-05-21 521 err_rele:
44a8736bd20a08 Darrick J. Wong 2018-07-25 522 xfs_irele(ip);
77d61fe45e7205 Darrick J. Wong 2016-10-03 523 return error;
ff363fee12a551 Darrick J. Wong 2020-05-21 524 garbage:
ff363fee12a551 Darrick J. Wong 2020-05-21 525 xfs_bui_release(buip);
ff363fee12a551 Darrick J. Wong 2020-05-21 526 return -EFSCORRUPTED;
77d61fe45e7205 Darrick J. Wong 2016-10-03 527 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 1 month
Re: [PATCH] uio: disable lazy irq disable to avoid double fire
by Dan Carpenter
Hi Thommy,
url: https://github.com/0day-ci/linux/commits/Thommy-Jakobsson/uio-disable-laz...
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git c9d7e3da1f3c4cf5dddfc5d7ce4d76d013aba1cc
config: i386-allyesconfig (attached as .config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce (this is a W=1 build):
# save the attached .config to linux build tree
make ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kbuild test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
smatch warnings:
drivers/uio/uio_pdrv_genirq.c:185 uio_pdrv_genirq_probe() warn: passing devm_ allocated variable to kfree. 'priv'
# https://github.com/0day-ci/linux/commit/c6460d7bd1fb8e3ff5aa0c252c37bbfcb...
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout c6460d7bd1fb8e3ff5aa0c252c37bbfcb9245367
vim +/priv +185 drivers/uio/uio_pdrv_genirq.c
c767db0ab4bc85 Magnus Damm 2008-07-11 110 static int uio_pdrv_genirq_probe(struct platform_device *pdev)
c767db0ab4bc85 Magnus Damm 2008-07-11 111 {
08cb2e2148f763 Jingoo Han 2013-08-30 112 struct uio_info *uioinfo = dev_get_platdata(&pdev->dev);
b0297622a9726b Daniel Mack 2019-08-15 113 struct device_node *node = pdev->dev.of_node;
c767db0ab4bc85 Magnus Damm 2008-07-11 114 struct uio_pdrv_genirq_platdata *priv;
c767db0ab4bc85 Magnus Damm 2008-07-11 115 struct uio_mem *uiomem;
c767db0ab4bc85 Magnus Damm 2008-07-11 116 int ret = -EINVAL;
c767db0ab4bc85 Magnus Damm 2008-07-11 117 int i;
c767db0ab4bc85 Magnus Damm 2008-07-11 118
b0297622a9726b Daniel Mack 2019-08-15 119 if (node) {
b0297622a9726b Daniel Mack 2019-08-15 120 const char *name;
b0297622a9726b Daniel Mack 2019-08-15 121
27760f86866331 Hans J. Koch 2011-07-07 122 /* alloc uioinfo for one device */
e6789cd3dfb553 Michal Simek 2013-09-12 123 uioinfo = devm_kzalloc(&pdev->dev, sizeof(*uioinfo),
e6789cd3dfb553 Michal Simek 2013-09-12 124 GFP_KERNEL);
27760f86866331 Hans J. Koch 2011-07-07 125 if (!uioinfo) {
27760f86866331 Hans J. Koch 2011-07-07 126 dev_err(&pdev->dev, "unable to kmalloc\n");
e6789cd3dfb553 Michal Simek 2013-09-12 127 return -ENOMEM;
27760f86866331 Hans J. Koch 2011-07-07 128 }
b0297622a9726b Daniel Mack 2019-08-15 129
b0297622a9726b Daniel Mack 2019-08-15 130 if (!of_property_read_string(node, "linux,uio-name", &name))
b0297622a9726b Daniel Mack 2019-08-15 131 uioinfo->name = devm_kstrdup(&pdev->dev, name, GFP_KERNEL);
b0297622a9726b Daniel Mack 2019-08-15 132 else
b0297622a9726b Daniel Mack 2019-08-15 133 uioinfo->name = devm_kasprintf(&pdev->dev, GFP_KERNEL,
b0297622a9726b Daniel Mack 2019-08-15 134 "%pOFn", node);
b0297622a9726b Daniel Mack 2019-08-15 135
27760f86866331 Hans J. Koch 2011-07-07 136 uioinfo->version = "devicetree";
27760f86866331 Hans J. Koch 2011-07-07 137 /* Multiple IRQs are not supported */
27760f86866331 Hans J. Koch 2011-07-07 138 }
27760f86866331 Hans J. Koch 2011-07-07 139
c767db0ab4bc85 Magnus Damm 2008-07-11 140 if (!uioinfo || !uioinfo->name || !uioinfo->version) {
c767db0ab4bc85 Magnus Damm 2008-07-11 141 dev_err(&pdev->dev, "missing platform_data\n");
e6789cd3dfb553 Michal Simek 2013-09-12 142 return ret;
c767db0ab4bc85 Magnus Damm 2008-07-11 143 }
c767db0ab4bc85 Magnus Damm 2008-07-11 144
e543ae896626a5 Mike Frysinger 2008-10-29 145 if (uioinfo->handler || uioinfo->irqcontrol ||
e543ae896626a5 Mike Frysinger 2008-10-29 146 uioinfo->irq_flags & IRQF_SHARED) {
c767db0ab4bc85 Magnus Damm 2008-07-11 147 dev_err(&pdev->dev, "interrupt configuration error\n");
e6789cd3dfb553 Michal Simek 2013-09-12 148 return ret;
c767db0ab4bc85 Magnus Damm 2008-07-11 149 }
c767db0ab4bc85 Magnus Damm 2008-07-11 150
e6789cd3dfb553 Michal Simek 2013-09-12 151 priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
^^^^^^^^^^^^^^^^^^^
c767db0ab4bc85 Magnus Damm 2008-07-11 152 if (!priv) {
c767db0ab4bc85 Magnus Damm 2008-07-11 153 dev_err(&pdev->dev, "unable to kmalloc\n");
e6789cd3dfb553 Michal Simek 2013-09-12 154 return -ENOMEM;
c767db0ab4bc85 Magnus Damm 2008-07-11 155 }
c767db0ab4bc85 Magnus Damm 2008-07-11 156
c767db0ab4bc85 Magnus Damm 2008-07-11 157 priv->uioinfo = uioinfo;
c767db0ab4bc85 Magnus Damm 2008-07-11 158 spin_lock_init(&priv->lock);
c767db0ab4bc85 Magnus Damm 2008-07-11 159 priv->flags = 0; /* interrupt is enabled to begin with */
af76756e6e8c26 Magnus Damm 2009-08-14 160 priv->pdev = pdev;
c767db0ab4bc85 Magnus Damm 2008-07-11 161
94ca629e40eb7e Benedikt Spranger 2012-05-14 162 if (!uioinfo->irq) {
94ca629e40eb7e Benedikt Spranger 2012-05-14 163 ret = platform_get_irq(pdev, 0);
e3a3c3a205554e Pavel Machek 2013-06-18 164 uioinfo->irq = ret;
e3a3c3a205554e Pavel Machek 2013-06-18 165 if (ret == -ENXIO && pdev->dev.of_node)
e3a3c3a205554e Pavel Machek 2013-06-18 166 uioinfo->irq = UIO_IRQ_NONE;
34bc4f468a9fab Oscar Ravadilla 2020-01-08 167 else if (ret == -EPROBE_DEFER)
34bc4f468a9fab Oscar Ravadilla 2020-01-08 168 return ret;
e3a3c3a205554e Pavel Machek 2013-06-18 169 else if (ret < 0) {
94ca629e40eb7e Benedikt Spranger 2012-05-14 170 dev_err(&pdev->dev, "failed to get IRQ\n");
e6789cd3dfb553 Michal Simek 2013-09-12 171 return ret;
94ca629e40eb7e Benedikt Spranger 2012-05-14 172 }
94ca629e40eb7e Benedikt Spranger 2012-05-14 173 }
e3a3c3a205554e Pavel Machek 2013-06-18 174
c6460d7bd1fb8e Thommy Jakobsson 2020-05-21 175 if (uioinfo->irq) {
c6460d7bd1fb8e Thommy Jakobsson 2020-05-21 176 struct irq_data *irq_data = irq_get_irq_data(uioinfo->irq);
c6460d7bd1fb8e Thommy Jakobsson 2020-05-21 177
c6460d7bd1fb8e Thommy Jakobsson 2020-05-21 178 /*
c6460d7bd1fb8e Thommy Jakobsson 2020-05-21 179 * If a level interrupt, dont do lazy disable. Otherwise the
c6460d7bd1fb8e Thommy Jakobsson 2020-05-21 180 * irq will fire again since clearing of the actual cause, on
c6460d7bd1fb8e Thommy Jakobsson 2020-05-21 181 * device level, is done in userspace
c6460d7bd1fb8e Thommy Jakobsson 2020-05-21 182 */
c6460d7bd1fb8e Thommy Jakobsson 2020-05-21 183 if (!irq_data) {
c6460d7bd1fb8e Thommy Jakobsson 2020-05-21 184 dev_err(&pdev->dev, "unable to get irq data\n");
c6460d7bd1fb8e Thommy Jakobsson 2020-05-21 @185 kfree(priv);
This should be deleted. It is a double free.
c6460d7bd1fb8e Thommy Jakobsson 2020-05-21 186 return -ENXIO;
c6460d7bd1fb8e Thommy Jakobsson 2020-05-21 187 }
c6460d7bd1fb8e Thommy Jakobsson 2020-05-21 188 /*
c6460d7bd1fb8e Thommy Jakobsson 2020-05-21 189 * irqd_is_level_type() isn't used since isn't valid unitil
c6460d7bd1fb8e Thommy Jakobsson 2020-05-21 190 * irq is configured.
c6460d7bd1fb8e Thommy Jakobsson 2020-05-21 191 */
c6460d7bd1fb8e Thommy Jakobsson 2020-05-21 192 if (irqd_get_trigger_type(irq_data) & IRQ_TYPE_LEVEL_MASK) {
c6460d7bd1fb8e Thommy Jakobsson 2020-05-21 193 dev_info(&pdev->dev, "disable lazy unmask\n");
c6460d7bd1fb8e Thommy Jakobsson 2020-05-21 194 irq_set_status_flags(uioinfo->irq, IRQ_DISABLE_UNLAZY);
c6460d7bd1fb8e Thommy Jakobsson 2020-05-21 195 }
c6460d7bd1fb8e Thommy Jakobsson 2020-05-21 196 }
c6460d7bd1fb8e Thommy Jakobsson 2020-05-21 197
c767db0ab4bc85 Magnus Damm 2008-07-11 198 uiomem = &uioinfo->mem[0];
c767db0ab4bc85 Magnus Damm 2008-07-11 199
c767db0ab4bc85 Magnus Damm 2008-07-11 200 for (i = 0; i < pdev->num_resources; ++i) {
c767db0ab4bc85 Magnus Damm 2008-07-11 201 struct resource *r = &pdev->resource[i];
c767db0ab4bc85 Magnus Damm 2008-07-11 202
c767db0ab4bc85 Magnus Damm 2008-07-11 203 if (r->flags != IORESOURCE_MEM)
c767db0ab4bc85 Magnus Damm 2008-07-11 204 continue;
c767db0ab4bc85 Magnus Damm 2008-07-11 205
c767db0ab4bc85 Magnus Damm 2008-07-11 206 if (uiomem >= &uioinfo->mem[MAX_UIO_MAPS]) {
c767db0ab4bc85 Magnus Damm 2008-07-11 207 dev_warn(&pdev->dev, "device has more than "
c767db0ab4bc85 Magnus Damm 2008-07-11 208 __stringify(MAX_UIO_MAPS)
c767db0ab4bc85 Magnus Damm 2008-07-11 209 " I/O memory resources.\n");
c767db0ab4bc85 Magnus Damm 2008-07-11 210 break;
c767db0ab4bc85 Magnus Damm 2008-07-11 211 }
c767db0ab4bc85 Magnus Damm 2008-07-11 212
c767db0ab4bc85 Magnus Damm 2008-07-11 213 uiomem->memtype = UIO_MEM_PHYS;
c767db0ab4bc85 Magnus Damm 2008-07-11 214 uiomem->addr = r->start;
28f65c11f2ffb3 Joe Perches 2011-06-09 215 uiomem->size = resource_size(r);
ecd43c0d7e504f Manuel Traut 2012-11-09 216 uiomem->name = r->name;
c767db0ab4bc85 Magnus Damm 2008-07-11 217 ++uiomem;
c767db0ab4bc85 Magnus Damm 2008-07-11 218 }
c767db0ab4bc85 Magnus Damm 2008-07-11 219
c767db0ab4bc85 Magnus Damm 2008-07-11 220 while (uiomem < &uioinfo->mem[MAX_UIO_MAPS]) {
c767db0ab4bc85 Magnus Damm 2008-07-11 221 uiomem->size = 0;
c767db0ab4bc85 Magnus Damm 2008-07-11 222 ++uiomem;
c767db0ab4bc85 Magnus Damm 2008-07-11 223 }
c767db0ab4bc85 Magnus Damm 2008-07-11 224
c767db0ab4bc85 Magnus Damm 2008-07-11 225 /* This driver requires no hardware specific kernel code to handle
c767db0ab4bc85 Magnus Damm 2008-07-11 226 * interrupts. Instead, the interrupt handler simply disables the
c767db0ab4bc85 Magnus Damm 2008-07-11 227 * interrupt in the interrupt controller. User space is responsible
c767db0ab4bc85 Magnus Damm 2008-07-11 228 * for performing hardware specific acknowledge and re-enabling of
c767db0ab4bc85 Magnus Damm 2008-07-11 229 * the interrupt in the interrupt controller.
c767db0ab4bc85 Magnus Damm 2008-07-11 230 *
c767db0ab4bc85 Magnus Damm 2008-07-11 231 * Interrupt sharing is not supported.
c767db0ab4bc85 Magnus Damm 2008-07-11 232 */
c767db0ab4bc85 Magnus Damm 2008-07-11 233
c767db0ab4bc85 Magnus Damm 2008-07-11 234 uioinfo->handler = uio_pdrv_genirq_handler;
c767db0ab4bc85 Magnus Damm 2008-07-11 235 uioinfo->irqcontrol = uio_pdrv_genirq_irqcontrol;
af76756e6e8c26 Magnus Damm 2009-08-14 236 uioinfo->open = uio_pdrv_genirq_open;
af76756e6e8c26 Magnus Damm 2009-08-14 237 uioinfo->release = uio_pdrv_genirq_release;
c767db0ab4bc85 Magnus Damm 2008-07-11 238 uioinfo->priv = priv;
c767db0ab4bc85 Magnus Damm 2008-07-11 239
af76756e6e8c26 Magnus Damm 2009-08-14 240 /* Enable Runtime PM for this device:
af76756e6e8c26 Magnus Damm 2009-08-14 241 * The device starts in suspended state to allow the hardware to be
af76756e6e8c26 Magnus Damm 2009-08-14 242 * turned off by default. The Runtime PM bus code should power on the
af76756e6e8c26 Magnus Damm 2009-08-14 243 * hardware and enable clocks at open().
af76756e6e8c26 Magnus Damm 2009-08-14 244 */
af76756e6e8c26 Magnus Damm 2009-08-14 245 pm_runtime_enable(&pdev->dev);
af76756e6e8c26 Magnus Damm 2009-08-14 246
eff1dd87fae244 Alexandru Ardelean 2020-03-06 247 ret = devm_add_action_or_reset(&pdev->dev, uio_pdrv_genirq_cleanup,
eff1dd87fae244 Alexandru Ardelean 2020-03-06 248 &pdev->dev);
eff1dd87fae244 Alexandru Ardelean 2020-03-06 249 if (ret)
e6789cd3dfb553 Michal Simek 2013-09-12 250 return ret;
c767db0ab4bc85 Magnus Damm 2008-07-11 251
eff1dd87fae244 Alexandru Ardelean 2020-03-06 252 ret = devm_uio_register_device(&pdev->dev, priv->uioinfo);
eff1dd87fae244 Alexandru Ardelean 2020-03-06 253 if (ret)
eff1dd87fae244 Alexandru Ardelean 2020-03-06 254 dev_err(&pdev->dev, "unable to register uio device\n");
47296b1962ead8 Jie Zhou 2011-04-06 255
eff1dd87fae244 Alexandru Ardelean 2020-03-06 256 return ret;
c767db0ab4bc85 Magnus Damm 2008-07-11 257 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
2 years, 1 month