[PATCH] wfx: fix irqf_oneshot.cocci warnings
by kernel test robot
From: kernel test robot <lkp(a)intel.com>
drivers/net/wireless/silabs/wfx/bus_sdio.c:134:8-33: ERROR: Threaded IRQ with no primary handler requested without IRQF_ONESHOT
Since commit 1c6c69525b40 ("genirq: Reject bogus threaded irq requests")
threaded IRQs without a primary handler need to be requested with
IRQF_ONESHOT, otherwise the request will fail.
So pass the IRQF_ONESHOT flag in this case.
Generated by: scripts/coccinelle/misc/irqf_oneshot.cocci
CC: Jérôme Pouiller <jerome.pouiller(a)silabs.com>
Reported-by: kernel test robot <lkp(a)intel.com>
Signed-off-by: kernel test robot <lkp(a)intel.com>
---
url: https://github.com/0day-ci/linux/commits/Jerome-Pouiller/wfx-get-out-from...
base: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git b828324bba8f575fde487a91fec07303789dda8a
bus_sdio.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
--- a/drivers/net/wireless/silabs/wfx/bus_sdio.c
+++ b/drivers/net/wireless/silabs/wfx/bus_sdio.c
@@ -132,7 +132,8 @@ static int wfx_sdio_irq_subscribe(void *
flags = IRQF_TRIGGER_HIGH;
flags |= IRQF_ONESHOT;
return devm_request_threaded_irq(&bus->func->dev, bus->of_irq, NULL,
- wfx_sdio_irq_handler_ext, flags,
+ wfx_sdio_irq_handler_ext,
+ flags | IRQF_ONESHOT,
"wfx", bus);
}
1 year, 6 months
{standard input}:3162: Error: operands mismatch -- statement `eorl %a1,%d2' ignored
by kernel test robot
Hi Brendan,
FYI, the error/warning still remains.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 1a4431a5db2bf800c647ee0ed87f2727b8d6c29c
commit: 981f94c3e92146705baf97fb417a5ed1ab1a79a5 bpf: Add bitwise atomic instructions
date: 9 weeks ago
config: m68k-randconfig-r025-20210316 (attached as .config)
compiler: m68k-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/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 981f94c3e92146705baf97fb417a5ed1ab1a79a5
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.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 >>):
In file included from include/linux/kernel.h:10,
from include/linux/list.h:9,
from include/linux/preempt.h:11,
from arch/m68k/include/asm/irqflags.h:6,
from include/linux/irqflags.h:16,
from arch/m68k/include/asm/atomic.h:6,
from include/linux/atomic.h:7,
from include/linux/filter.h:10,
from kernel/bpf/core.c:21:
include/linux/scatterlist.h: In function 'sg_set_buf':
arch/m68k/include/asm/page_mm.h:174:49: warning: ordered comparison of pointer with null pointer [-Wextra]
174 | #define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET && (void *)(kaddr) < high_memory)
| ^~
include/linux/compiler.h:78:42: note: in definition of macro 'unlikely'
78 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
include/linux/scatterlist.h:137:2: note: in expansion of macro 'BUG_ON'
137 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~
include/linux/scatterlist.h:137:10: note: in expansion of macro 'virt_addr_valid'
137 | BUG_ON(!virt_addr_valid(buf));
| ^~~~~~~~~~~~~~~
kernel/bpf/core.c: At top level:
kernel/bpf/core.c:1350:12: warning: no previous prototype for 'bpf_probe_read_kernel' [-Wmissing-prototypes]
1350 | u64 __weak bpf_probe_read_kernel(void *dst, u32 size, const void *unsafe_ptr)
| ^~~~~~~~~~~~~~~~~~~~~
kernel/bpf/core.c:1751:6: warning: no previous prototype for 'bpf_patch_call_args' [-Wmissing-prototypes]
1751 | void bpf_patch_call_args(struct bpf_insn *insn, u32 stack_depth)
| ^~~~~~~~~~~~~~~~~~~
{standard input}: Assembler messages:
>> {standard input}:3162: Error: operands mismatch -- statement `eorl %a1,%d2' ignored
{standard input}:3162: Error: invalid instruction for this architecture; needs 68020 or higher (68020 [68k, 68ec020], 68030 [68ec030], 68040 [68ec040], 68060 [68ec060]) -- statement `casl %d1,%d2,(%a5)' ignored
{standard input}:3182: Error: invalid instruction for this architecture; needs 68020 or higher (68020 [68k, 68ec020], 68030 [68ec030], 68040 [68ec040], 68060 [68ec060]) -- statement `casl %d1,%d3,(%a0)' ignored
{standard input}:3225: Error: invalid instruction for this architecture; needs 68020 or higher (68020 [68k, 68ec020], 68030 [68ec030], 68040 [68ec040], 68060 [68ec060]) -- statement `casl %d1,%d2,(%a5)' ignored
>> {standard input}:3267: Error: operands mismatch -- statement `andl %a1,%d2' ignored
{standard input}:3267: Error: invalid instruction for this architecture; needs 68020 or higher (68020 [68k, 68ec020], 68030 [68ec030], 68040 [68ec040], 68060 [68ec060]) -- statement `casl %d1,%d2,(%a5)' ignored
>> {standard input}:3311: Error: operands mismatch -- statement `orl %a1,%d2' ignored
{standard input}:3311: Error: invalid instruction for this architecture; needs 68020 or higher (68020 [68k, 68ec020], 68030 [68ec030], 68040 [68ec040], 68060 [68ec060]) -- statement `casl %d1,%d2,(%a5)' ignored
{standard input}:3359: Error: invalid instruction for this architecture; needs 68020 or higher (68020 [68k, 68ec020], 68030 [68ec030], 68040 [68ec040], 68060 [68ec060]) -- statement `casl %d0,%d3,(%a0)' ignored
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
[song-md:md-next 5/6] drivers/md/raid10.c:1526:8-27: atomic_dec_and_test variation before object free at line 1532.
by kernel test robot
tree: git://git.kernel.org/pub/scm/linux/kernel/git/song/md.git md-next
head: 49c4d345c81f149a29b3db6e521e5191e55f02b6
commit: f3cf8c2b2caf6ae77b7c786218d3b060faef63a6 [5/6] md/raid10: improve discard request for far layout
config: x86_64-allyesconfig (attached as .config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
"coccinelle warnings: (new ones prefixed by >>)"
>> drivers/md/raid10.c:1526:8-27: atomic_dec_and_test variation before object free at line 1532.
drivers/md/raid10.c:1526:8-27: atomic_dec_and_test variation before object free at line 1537.
vim +1526 drivers/md/raid10.c
1520
1521 static void raid_end_discard_bio(struct r10bio *r10bio)
1522 {
1523 struct r10conf *conf = r10bio->mddev->private;
1524 struct r10bio *first_r10bio;
1525
> 1526 while (atomic_dec_and_test(&r10bio->remaining)) {
1527
1528 allow_barrier(conf);
1529
1530 if (!test_bit(R10BIO_Discard, &r10bio->state)) {
1531 first_r10bio = (struct r10bio *)r10bio->master_bio;
> 1532 free_r10bio(r10bio);
1533 r10bio = first_r10bio;
1534 } else {
1535 md_write_end(r10bio->mddev);
1536 bio_endio(r10bio->master_bio);
1537 free_r10bio(r10bio);
1538 break;
1539 }
1540 }
1541 }
1542
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
Re: [PATCH v5 3/3] mmc: sdhci-of-dwcmshc: add rockchip platform support
by kernel test robot
Hi Shawn,
I love your patch! Perhaps something to improve:
[auto build test WARNING on robh/for-next]
[also build test WARNING on linus/master v5.12-rc3 next-20210315]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Shawn-Lin/dt-bindings-mmc-sdhci-...
base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
config: powerpc-randconfig-r002-20210316 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 50c7504a93fdb90c26870db8c8ea7add895c7725)
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
# install powerpc cross compiling tool for clang build
# apt-get install binutils-powerpc-linux-gnu
# https://github.com/0day-ci/linux/commit/4e67269c227f3ccf6904cdc31971bf653...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Shawn-Lin/dt-bindings-mmc-sdhci-of-dwcmhsc-Convert-to-yaml-file/20210316-100829
git checkout 4e67269c227f3ccf6904cdc31971bf6534d1bcf3
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=powerpc
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 >>):
In file included from drivers/mmc/host/sdhci-of-dwcmshc.c:11:
In file included from include/linux/dma-mapping.h:10:
In file included from include/linux/scatterlist.h:9:
In file included from arch/powerpc/include/asm/io.h:619:
arch/powerpc/include/asm/io-defs.h:43:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
DEF_PCI_AC_NORET(insb, (unsigned long p, void *b, unsigned long c),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET'
__do_##name al; \
^~~~~~~~~~~~~~
<scratch space>:10:1: note: expanded from here
__do_insb
^
arch/powerpc/include/asm/io.h:556:56: note: expanded from macro '__do_insb'
#define __do_insb(p, b, n) readsb((PCI_IO_ADDR)_IO_BASE+(p), (b), (n))
~~~~~~~~~~~~~~~~~~~~~^
In file included from drivers/mmc/host/sdhci-of-dwcmshc.c:11:
In file included from include/linux/dma-mapping.h:10:
In file included from include/linux/scatterlist.h:9:
In file included from arch/powerpc/include/asm/io.h:619:
arch/powerpc/include/asm/io-defs.h:45:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
DEF_PCI_AC_NORET(insw, (unsigned long p, void *b, unsigned long c),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET'
__do_##name al; \
^~~~~~~~~~~~~~
<scratch space>:12:1: note: expanded from here
__do_insw
^
arch/powerpc/include/asm/io.h:557:56: note: expanded from macro '__do_insw'
#define __do_insw(p, b, n) readsw((PCI_IO_ADDR)_IO_BASE+(p), (b), (n))
~~~~~~~~~~~~~~~~~~~~~^
In file included from drivers/mmc/host/sdhci-of-dwcmshc.c:11:
In file included from include/linux/dma-mapping.h:10:
In file included from include/linux/scatterlist.h:9:
In file included from arch/powerpc/include/asm/io.h:619:
arch/powerpc/include/asm/io-defs.h:47:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
DEF_PCI_AC_NORET(insl, (unsigned long p, void *b, unsigned long c),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET'
__do_##name al; \
^~~~~~~~~~~~~~
<scratch space>:14:1: note: expanded from here
__do_insl
^
arch/powerpc/include/asm/io.h:558:56: note: expanded from macro '__do_insl'
#define __do_insl(p, b, n) readsl((PCI_IO_ADDR)_IO_BASE+(p), (b), (n))
~~~~~~~~~~~~~~~~~~~~~^
In file included from drivers/mmc/host/sdhci-of-dwcmshc.c:11:
In file included from include/linux/dma-mapping.h:10:
In file included from include/linux/scatterlist.h:9:
In file included from arch/powerpc/include/asm/io.h:619:
arch/powerpc/include/asm/io-defs.h:49:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
DEF_PCI_AC_NORET(outsb, (unsigned long p, const void *b, unsigned long c),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET'
__do_##name al; \
^~~~~~~~~~~~~~
<scratch space>:16:1: note: expanded from here
__do_outsb
^
arch/powerpc/include/asm/io.h:559:58: note: expanded from macro '__do_outsb'
#define __do_outsb(p, b, n) writesb((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
~~~~~~~~~~~~~~~~~~~~~^
In file included from drivers/mmc/host/sdhci-of-dwcmshc.c:11:
In file included from include/linux/dma-mapping.h:10:
In file included from include/linux/scatterlist.h:9:
In file included from arch/powerpc/include/asm/io.h:619:
arch/powerpc/include/asm/io-defs.h:51:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
DEF_PCI_AC_NORET(outsw, (unsigned long p, const void *b, unsigned long c),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET'
__do_##name al; \
^~~~~~~~~~~~~~
<scratch space>:18:1: note: expanded from here
__do_outsw
^
arch/powerpc/include/asm/io.h:560:58: note: expanded from macro '__do_outsw'
#define __do_outsw(p, b, n) writesw((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
~~~~~~~~~~~~~~~~~~~~~^
In file included from drivers/mmc/host/sdhci-of-dwcmshc.c:11:
In file included from include/linux/dma-mapping.h:10:
In file included from include/linux/scatterlist.h:9:
In file included from arch/powerpc/include/asm/io.h:619:
arch/powerpc/include/asm/io-defs.h:53:1: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
DEF_PCI_AC_NORET(outsl, (unsigned long p, const void *b, unsigned long c),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
arch/powerpc/include/asm/io.h:616:3: note: expanded from macro 'DEF_PCI_AC_NORET'
__do_##name al; \
^~~~~~~~~~~~~~
<scratch space>:20:1: note: expanded from here
__do_outsl
^
arch/powerpc/include/asm/io.h:561:58: note: expanded from macro '__do_outsl'
#define __do_outsl(p, b, n) writesl((PCI_IO_ADDR)_IO_BASE+(p),(b),(n))
~~~~~~~~~~~~~~~~~~~~~^
>> drivers/mmc/host/sdhci-of-dwcmshc.c:371:6: warning: variable 'rk_priv' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
if (err)
^~~
drivers/mmc/host/sdhci-of-dwcmshc.c:403:6: note: uninitialized use occurs here
if (rk_priv)
^~~~~~~
drivers/mmc/host/sdhci-of-dwcmshc.c:371:2: note: remove the 'if' if its condition is always false
if (err)
^~~~~~~~
drivers/mmc/host/sdhci-of-dwcmshc.c:329:29: note: initialize the variable 'rk_priv' to silence this warning
struct rk3568_priv *rk_priv;
^
= NULL
7 warnings generated.
vim +371 drivers/mmc/host/sdhci-of-dwcmshc.c
4e67269c227f3c Shawn Lin 2021-03-16 323
e438cf49b3053e Jisheng Zhang 2018-07-06 324 static int dwcmshc_probe(struct platform_device *pdev)
e438cf49b3053e Jisheng Zhang 2018-07-06 325 {
e438cf49b3053e Jisheng Zhang 2018-07-06 326 struct sdhci_pltfm_host *pltfm_host;
e438cf49b3053e Jisheng Zhang 2018-07-06 327 struct sdhci_host *host;
e438cf49b3053e Jisheng Zhang 2018-07-06 328 struct dwcmshc_priv *priv;
4e67269c227f3c Shawn Lin 2021-03-16 329 struct rk3568_priv *rk_priv;
4e67269c227f3c Shawn Lin 2021-03-16 330 const struct sdhci_pltfm_data *pltfm_data;
e438cf49b3053e Jisheng Zhang 2018-07-06 331 int err;
b85c997d2cfefe Jisheng Zhang 2018-08-28 332 u32 extra;
e438cf49b3053e Jisheng Zhang 2018-07-06 333
4e67269c227f3c Shawn Lin 2021-03-16 334 pltfm_data = of_device_get_match_data(&pdev->dev);
4e67269c227f3c Shawn Lin 2021-03-16 335 if (!pltfm_data) {
4e67269c227f3c Shawn Lin 2021-03-16 336 dev_err(&pdev->dev, "Error: No device match data found\n");
4e67269c227f3c Shawn Lin 2021-03-16 337 return -ENODEV;
4e67269c227f3c Shawn Lin 2021-03-16 338 }
4e67269c227f3c Shawn Lin 2021-03-16 339
4e67269c227f3c Shawn Lin 2021-03-16 340 host = sdhci_pltfm_init(pdev, pltfm_data,
e438cf49b3053e Jisheng Zhang 2018-07-06 341 sizeof(struct dwcmshc_priv));
e438cf49b3053e Jisheng Zhang 2018-07-06 342 if (IS_ERR(host))
e438cf49b3053e Jisheng Zhang 2018-07-06 343 return PTR_ERR(host);
e438cf49b3053e Jisheng Zhang 2018-07-06 344
b85c997d2cfefe Jisheng Zhang 2018-08-28 345 /*
b85c997d2cfefe Jisheng Zhang 2018-08-28 346 * extra adma table cnt for cross 128M boundary handling.
b85c997d2cfefe Jisheng Zhang 2018-08-28 347 */
b85c997d2cfefe Jisheng Zhang 2018-08-28 348 extra = DIV_ROUND_UP_ULL(dma_get_required_mask(&pdev->dev), SZ_128M);
b85c997d2cfefe Jisheng Zhang 2018-08-28 349 if (extra > SDHCI_MAX_SEGS)
b85c997d2cfefe Jisheng Zhang 2018-08-28 350 extra = SDHCI_MAX_SEGS;
b85c997d2cfefe Jisheng Zhang 2018-08-28 351 host->adma_table_cnt += extra;
b85c997d2cfefe Jisheng Zhang 2018-08-28 352
e438cf49b3053e Jisheng Zhang 2018-07-06 353 pltfm_host = sdhci_priv(host);
e438cf49b3053e Jisheng Zhang 2018-07-06 354 priv = sdhci_pltfm_priv(pltfm_host);
e438cf49b3053e Jisheng Zhang 2018-07-06 355
e438cf49b3053e Jisheng Zhang 2018-07-06 356 pltfm_host->clk = devm_clk_get(&pdev->dev, "core");
e438cf49b3053e Jisheng Zhang 2018-07-06 357 if (IS_ERR(pltfm_host->clk)) {
e438cf49b3053e Jisheng Zhang 2018-07-06 358 err = PTR_ERR(pltfm_host->clk);
e438cf49b3053e Jisheng Zhang 2018-07-06 359 dev_err(&pdev->dev, "failed to get core clk: %d\n", err);
e438cf49b3053e Jisheng Zhang 2018-07-06 360 goto free_pltfm;
e438cf49b3053e Jisheng Zhang 2018-07-06 361 }
e438cf49b3053e Jisheng Zhang 2018-07-06 362 err = clk_prepare_enable(pltfm_host->clk);
e438cf49b3053e Jisheng Zhang 2018-07-06 363 if (err)
e438cf49b3053e Jisheng Zhang 2018-07-06 364 goto free_pltfm;
e438cf49b3053e Jisheng Zhang 2018-07-06 365
e438cf49b3053e Jisheng Zhang 2018-07-06 366 priv->bus_clk = devm_clk_get(&pdev->dev, "bus");
e438cf49b3053e Jisheng Zhang 2018-07-06 367 if (!IS_ERR(priv->bus_clk))
e438cf49b3053e Jisheng Zhang 2018-07-06 368 clk_prepare_enable(priv->bus_clk);
e438cf49b3053e Jisheng Zhang 2018-07-06 369
e438cf49b3053e Jisheng Zhang 2018-07-06 370 err = mmc_of_parse(host->mmc);
e438cf49b3053e Jisheng Zhang 2018-07-06 @371 if (err)
e438cf49b3053e Jisheng Zhang 2018-07-06 372 goto err_clk;
e438cf49b3053e Jisheng Zhang 2018-07-06 373
e438cf49b3053e Jisheng Zhang 2018-07-06 374 sdhci_get_of_property(pdev);
e438cf49b3053e Jisheng Zhang 2018-07-06 375
4e67269c227f3c Shawn Lin 2021-03-16 376 priv->vendor_specific_area1 =
4e67269c227f3c Shawn Lin 2021-03-16 377 sdhci_readl(host, DWCMSHC_P_VENDOR_AREA1) & DWCMSHC_AREA1_MASK;
4e67269c227f3c Shawn Lin 2021-03-16 378
ca1219c0a74322 Jisheng Zhang 2020-12-29 379 host->mmc_host_ops.request = dwcmshc_request;
4e67269c227f3c Shawn Lin 2021-03-16 380 host->mmc_host_ops.hs400_enhanced_strobe = dwcmshc_hs400_enhanced_strobe;
4e67269c227f3c Shawn Lin 2021-03-16 381
4e67269c227f3c Shawn Lin 2021-03-16 382 if (pltfm_data == &sdhci_dwcmshc_rk3568_pdata) {
4e67269c227f3c Shawn Lin 2021-03-16 383 rk_priv = devm_kzalloc(&pdev->dev, sizeof(struct rk3568_priv), GFP_KERNEL);
4e67269c227f3c Shawn Lin 2021-03-16 384 if (!rk_priv)
4e67269c227f3c Shawn Lin 2021-03-16 385 goto err_clk;
4e67269c227f3c Shawn Lin 2021-03-16 386
4e67269c227f3c Shawn Lin 2021-03-16 387 priv->priv = rk_priv;
4e67269c227f3c Shawn Lin 2021-03-16 388
4e67269c227f3c Shawn Lin 2021-03-16 389 err = dwcmshc_rk3568_init(host, rk_priv);
4e67269c227f3c Shawn Lin 2021-03-16 390 if (err)
4e67269c227f3c Shawn Lin 2021-03-16 391 goto err_clk;
4e67269c227f3c Shawn Lin 2021-03-16 392 }
ca1219c0a74322 Jisheng Zhang 2020-12-29 393
e438cf49b3053e Jisheng Zhang 2018-07-06 394 err = sdhci_add_host(host);
e438cf49b3053e Jisheng Zhang 2018-07-06 395 if (err)
e438cf49b3053e Jisheng Zhang 2018-07-06 396 goto err_clk;
e438cf49b3053e Jisheng Zhang 2018-07-06 397
e438cf49b3053e Jisheng Zhang 2018-07-06 398 return 0;
e438cf49b3053e Jisheng Zhang 2018-07-06 399
e438cf49b3053e Jisheng Zhang 2018-07-06 400 err_clk:
e438cf49b3053e Jisheng Zhang 2018-07-06 401 clk_disable_unprepare(pltfm_host->clk);
e438cf49b3053e Jisheng Zhang 2018-07-06 402 clk_disable_unprepare(priv->bus_clk);
4e67269c227f3c Shawn Lin 2021-03-16 403 if (rk_priv)
4e67269c227f3c Shawn Lin 2021-03-16 404 clk_bulk_disable_unprepare(RK3568_MAX_CLKS,
4e67269c227f3c Shawn Lin 2021-03-16 405 rk_priv->rockchip_clks);
e438cf49b3053e Jisheng Zhang 2018-07-06 406 free_pltfm:
e438cf49b3053e Jisheng Zhang 2018-07-06 407 sdhci_pltfm_free(pdev);
e438cf49b3053e Jisheng Zhang 2018-07-06 408 return err;
e438cf49b3053e Jisheng Zhang 2018-07-06 409 }
e438cf49b3053e Jisheng Zhang 2018-07-06 410
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
drivers/md/raid5.c:2539 resize_stripes() warn: inconsistent indenting
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 1a4431a5db2bf800c647ee0ed87f2727b8d6c29c
commit: f16acaf328c5615fdaea74f9bd0b4019544532d6 md/raid5: resize stripe_head when reshape array
date: 6 months ago
config: openrisc-randconfig-m031-20210316 (attached as .config)
compiler: or1k-linux-gcc (GCC) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
New smatch warnings:
drivers/md/raid5.c:2539 resize_stripes() warn: inconsistent indenting
Old smatch warnings:
drivers/md/raid5.c:2840 raid5_end_write_request() error: uninitialized symbol 'rdev'.
drivers/md/raid5.c:2845 raid5_end_write_request() error: uninitialized symbol 'rdev'.
drivers/md/raid5.c:6950 alloc_thread_groups() warn: double check that we're allocating correct size: 108 vs 1
vim +2539 drivers/md/raid5.c
2459
2460 static int resize_stripes(struct r5conf *conf, int newsize)
2461 {
2462 /* Make all the stripes able to hold 'newsize' devices.
2463 * New slots in each stripe get 'page' set to a new page.
2464 *
2465 * This happens in stages:
2466 * 1/ create a new kmem_cache and allocate the required number of
2467 * stripe_heads.
2468 * 2/ gather all the old stripe_heads and transfer the pages across
2469 * to the new stripe_heads. This will have the side effect of
2470 * freezing the array as once all stripe_heads have been collected,
2471 * no IO will be possible. Old stripe heads are freed once their
2472 * pages have been transferred over, and the old kmem_cache is
2473 * freed when all stripes are done.
2474 * 3/ reallocate conf->disks to be suitable bigger. If this fails,
2475 * we simple return a failure status - no need to clean anything up.
2476 * 4/ allocate new pages for the new slots in the new stripe_heads.
2477 * If this fails, we don't bother trying the shrink the
2478 * stripe_heads down again, we just leave them as they are.
2479 * As each stripe_head is processed the new one is released into
2480 * active service.
2481 *
2482 * Once step2 is started, we cannot afford to wait for a write,
2483 * so we use GFP_NOIO allocations.
2484 */
2485 struct stripe_head *osh, *nsh;
2486 LIST_HEAD(newstripes);
2487 struct disk_info *ndisks;
2488 int err = 0;
2489 struct kmem_cache *sc;
2490 int i;
2491 int hash, cnt;
2492
2493 md_allow_write(conf->mddev);
2494
2495 /* Step 1 */
2496 sc = kmem_cache_create(conf->cache_name[1-conf->active_name],
2497 sizeof(struct stripe_head)+(newsize-1)*sizeof(struct r5dev),
2498 0, 0, NULL);
2499 if (!sc)
2500 return -ENOMEM;
2501
2502 /* Need to ensure auto-resizing doesn't interfere */
2503 mutex_lock(&conf->cache_size_mutex);
2504
2505 for (i = conf->max_nr_stripes; i; i--) {
2506 nsh = alloc_stripe(sc, GFP_KERNEL, newsize, conf);
2507 if (!nsh)
2508 break;
2509
2510 list_add(&nsh->lru, &newstripes);
2511 }
2512 if (i) {
2513 /* didn't get enough, give up */
2514 while (!list_empty(&newstripes)) {
2515 nsh = list_entry(newstripes.next, struct stripe_head, lru);
2516 list_del(&nsh->lru);
2517 free_stripe(sc, nsh);
2518 }
2519 kmem_cache_destroy(sc);
2520 mutex_unlock(&conf->cache_size_mutex);
2521 return -ENOMEM;
2522 }
2523 /* Step 2 - Must use GFP_NOIO now.
2524 * OK, we have enough stripes, start collecting inactive
2525 * stripes and copying them over
2526 */
2527 hash = 0;
2528 cnt = 0;
2529 list_for_each_entry(nsh, &newstripes, lru) {
2530 lock_device_hash_lock(conf, hash);
2531 wait_event_cmd(conf->wait_for_stripe,
2532 !list_empty(conf->inactive_list + hash),
2533 unlock_device_hash_lock(conf, hash),
2534 lock_device_hash_lock(conf, hash));
2535 osh = get_free_stripe(conf, hash);
2536 unlock_device_hash_lock(conf, hash);
2537
2538 #if PAGE_SIZE != DEFAULT_STRIPE_SIZE
> 2539 for (i = 0; i < osh->nr_pages; i++) {
2540 nsh->pages[i] = osh->pages[i];
2541 osh->pages[i] = NULL;
2542 }
2543 #endif
2544 for(i=0; i<conf->pool_size; i++) {
2545 nsh->dev[i].page = osh->dev[i].page;
2546 nsh->dev[i].orig_page = osh->dev[i].page;
2547 nsh->dev[i].offset = osh->dev[i].offset;
2548 }
2549 nsh->hash_lock_index = hash;
2550 free_stripe(conf->slab_cache, osh);
2551 cnt++;
2552 if (cnt >= conf->max_nr_stripes / NR_STRIPE_HASH_LOCKS +
2553 !!((conf->max_nr_stripes % NR_STRIPE_HASH_LOCKS) > hash)) {
2554 hash++;
2555 cnt = 0;
2556 }
2557 }
2558 kmem_cache_destroy(conf->slab_cache);
2559
2560 /* Step 3.
2561 * At this point, we are holding all the stripes so the array
2562 * is completely stalled, so now is a good time to resize
2563 * conf->disks and the scribble region
2564 */
2565 ndisks = kcalloc(newsize, sizeof(struct disk_info), GFP_NOIO);
2566 if (ndisks) {
2567 for (i = 0; i < conf->pool_size; i++)
2568 ndisks[i] = conf->disks[i];
2569
2570 for (i = conf->pool_size; i < newsize; i++) {
2571 ndisks[i].extra_page = alloc_page(GFP_NOIO);
2572 if (!ndisks[i].extra_page)
2573 err = -ENOMEM;
2574 }
2575
2576 if (err) {
2577 for (i = conf->pool_size; i < newsize; i++)
2578 if (ndisks[i].extra_page)
2579 put_page(ndisks[i].extra_page);
2580 kfree(ndisks);
2581 } else {
2582 kfree(conf->disks);
2583 conf->disks = ndisks;
2584 }
2585 } else
2586 err = -ENOMEM;
2587
2588 mutex_unlock(&conf->cache_size_mutex);
2589
2590 conf->slab_cache = sc;
2591 conf->active_name = 1-conf->active_name;
2592
2593 /* Step 4, return new stripes to service */
2594 while(!list_empty(&newstripes)) {
2595 nsh = list_entry(newstripes.next, struct stripe_head, lru);
2596 list_del_init(&nsh->lru);
2597
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months
[agd5f:amd-staging-drm-next 2019/2049] drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:4677:6: warning: no previous prototype for function 'amdgpu_device_recheck_guilty_jobs'
by kernel test robot
tree: https://gitlab.freedesktop.org/agd5f/linux.git amd-staging-drm-next
head: b2987e229a0d616d97063b3b695e7c9483933c27
commit: c8a921d49443025e10794342d4433b3f29616409 [2019/2049] drm/amd/amdgpu implement tdr advanced mode
config: x86_64-randconfig-r015-20210315 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project a28facba1ccdc957f386b7753f4958307f1bfde8)
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
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
git remote add agd5f https://gitlab.freedesktop.org/agd5f/linux.git
git fetch --no-tags agd5f amd-staging-drm-next
git checkout c8a921d49443025e10794342d4433b3f29616409
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
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 >>):
In file included from drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:39:
include/linux/efi.h:1099:34: warning: passing 1-byte aligned argument to 4-byte aligned parameter 2 of 'get_var' may result in an unaligned pointer access [-Walign-mismatch]
status = get_var(L"SecureBoot", &EFI_GLOBAL_VARIABLE_GUID, NULL, &size,
^
include/linux/efi.h:1107:24: warning: passing 1-byte aligned argument to 4-byte aligned parameter 2 of 'get_var' may result in an unaligned pointer access [-Walign-mismatch]
get_var(L"SetupMode", &EFI_GLOBAL_VARIABLE_GUID, NULL, &size, &setupmode);
^
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:4731:27: error: no member named 'num_jobs' in 'struct drm_gpu_scheduler'
atomic_dec(&ring->sched.num_jobs);
~~~~~~~~~~~ ^
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:4738:25: error: no member named 'node' in 'struct drm_sched_job'
list_del_init(&s_job->node);
~~~~~ ^
>> drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:4677:6: warning: no previous prototype for function 'amdgpu_device_recheck_guilty_jobs' [-Wmissing-prototypes]
void amdgpu_device_recheck_guilty_jobs(struct amdgpu_device *adev,
^
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c:4677:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
void amdgpu_device_recheck_guilty_jobs(struct amdgpu_device *adev,
^
static
3 warnings and 2 errors generated.
vim +/amdgpu_device_recheck_guilty_jobs +4677 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
4676
> 4677 void amdgpu_device_recheck_guilty_jobs(struct amdgpu_device *adev,
4678 struct amdgpu_hive_info *hive,
4679 struct list_head *device_list_handle,
4680 bool *need_full_reset)
4681 {
4682 int i, r = 0;
4683
4684 for (i = 0; i < AMDGPU_MAX_RINGS; ++i) {
4685 struct amdgpu_ring *ring = adev->rings[i];
4686 int ret = 0;
4687 struct drm_sched_job *s_job;
4688
4689 if (!ring || !ring->sched.thread)
4690 continue;
4691
4692 s_job = list_first_entry_or_null(&ring->sched.pending_list,
4693 struct drm_sched_job, list);
4694 if (s_job == NULL)
4695 continue;
4696
4697 /* clear job's guilty and depend the folowing step to decide the real one */
4698 drm_sched_reset_karma(s_job);
4699 drm_sched_resubmit_jobs_ext(&ring->sched, 1);
4700
4701 ret = dma_fence_wait_timeout(s_job->s_fence->parent, false, ring->sched.timeout);
4702 if (ret == 0) { /* timeout */
4703 DRM_ERROR("Found the real bad job! ring:%s, job_id:%llx\n",
4704 ring->sched.name, s_job->id);
4705
4706 /* set guilty */
4707 drm_sched_increase_karma(s_job);
4708 retry:
4709 /* do hw reset */
4710 if (amdgpu_sriov_vf(adev)) {
4711 amdgpu_virt_fini_data_exchange(adev);
4712 r = amdgpu_device_reset_sriov(adev, false);
4713 if (r)
4714 adev->asic_reset_res = r;
4715 } else {
4716 r = amdgpu_do_asic_reset(hive, device_list_handle,
4717 need_full_reset, false);
4718 if (r && r == -EAGAIN)
4719 goto retry;
4720 }
4721
4722 /*
4723 * add reset counter so that the following
4724 * resubmitted job could flush vmid
4725 */
4726 atomic_inc(&adev->gpu_reset_counter);
4727 continue;
4728 }
4729
4730 /* got the hw fence, signal finished fence */
4731 atomic_dec(&ring->sched.num_jobs);
4732 dma_fence_get(&s_job->s_fence->finished);
4733 dma_fence_signal(&s_job->s_fence->finished);
4734 dma_fence_put(&s_job->s_fence->finished);
4735
4736 /* remove node from list and free the job */
4737 spin_lock(&ring->sched.job_list_lock);
4738 list_del_init(&s_job->node);
4739 spin_unlock(&ring->sched.job_list_lock);
4740 ring->sched.ops->free_job(s_job);
4741 }
4742 }
4743
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 6 months