From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C31B9C47DAF for ; Mon, 22 Jan 2024 12:33:37 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 24BA66B0071; Mon, 22 Jan 2024 07:33:37 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 1FBB76B0072; Mon, 22 Jan 2024 07:33:37 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0EAF86B0085; Mon, 22 Jan 2024 07:33:37 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id F33586B0071 for ; Mon, 22 Jan 2024 07:33:36 -0500 (EST) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 1300B120956 for ; Mon, 22 Jan 2024 12:33:36 +0000 (UTC) X-FDA: 81706888032.18.FBFCDCF Received: from mail2-relais-roc.national.inria.fr (mail2-relais-roc.national.inria.fr [192.134.164.83]) by imf19.hostedemail.com (Postfix) with ESMTP id EADEF1A0026 for ; Mon, 22 Jan 2024 12:33:32 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=inria.fr header.s=dc header.b=VFDnAejF; spf=pass (imf19.hostedemail.com: domain of julia.lawall@inria.fr designates 192.134.164.83 as permitted sender) smtp.mailfrom=julia.lawall@inria.fr; dmarc=pass (policy=none) header.from=inria.fr ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1705926813; a=rsa-sha256; cv=none; b=1HojSOr2IpLmIhzmqdc/G3nLHY4J67T0YK1PYCXjxjHdHOsH9LcIfihjB8lzWyYN8XIfBc 9CX2KoBJkgRy8pLUMtnpKW9E04R+RISqoAqi7ExThGP1xlUl0emYJV6SVumqePoUHwKrd1 liDYVg387i536Hc+g3S1tVlCm182/dE= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=inria.fr header.s=dc header.b=VFDnAejF; spf=pass (imf19.hostedemail.com: domain of julia.lawall@inria.fr designates 192.134.164.83 as permitted sender) smtp.mailfrom=julia.lawall@inria.fr; dmarc=pass (policy=none) header.from=inria.fr ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1705926813; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=JcrMINdtUdvFAXHXMV9C4AnH5Y082kAC468shjm95W0=; b=gi/8YnwITBJdJSbEbxGXxcixaSiWYYES0+ChILc/PycAk7wNF0Y7Hr1AgGLUVL7KFC1zm+ tyqcHAODu32GdACEoWHkoEpHD0MHO+cFIjhbA39iykiwqyyWeVZgTfzM03HjUUytCNfJZl Aht7Wji+nwWQ7yfrvjrFacgShOEUI0o= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inria.fr; s=dc; h=date:from:to:cc:subject:message-id:mime-version; bh=JcrMINdtUdvFAXHXMV9C4AnH5Y082kAC468shjm95W0=; b=VFDnAejFyk2NGDKrBshHVZNUsLbNfsdiRC+2bg4gLtm8WNzZP73p3d4Y eqerkuAC2+hFi0WrrhU1/DlWdsOhfZ8srK31Uy4ganrXZa8nrrPK2M2u0 J6Jk89xjhwMR86AjCnZgS6VZBdjFOOHZCwB4QXaKWgHkxxwzVr6YyJbUA w=; X-IronPort-AV: E=Sophos;i="6.05,211,1701126000"; d="scan'208";a="147947370" Received: from dt-lawall.paris.inria.fr ([128.93.67.65]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jan 2024 13:33:31 +0100 Date: Mon, 22 Jan 2024 13:33:30 +0100 (CET) From: Julia Lawall To: Sui Jingfeng , Lucas Stach cc: Linux Memory Management List , oe-kbuild-all@lists.linux.dev Subject: [linux-next:master 139/1036] drivers/gpu/drm/etnaviv/etnaviv_drv.c:614:3-14: ERROR: probable double put. (fwd) Message-ID: <94afe420-f3b-5620-2380-82c9c62838f0@inria.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: EADEF1A0026 X-Stat-Signature: iob3q4hfqckngxdjh3is7s1pjqu5up4t X-Rspam-User: X-HE-Tag: 1705926812-455006 X-HE-Meta: U2FsdGVkX1+sDwPSl4rw8eyGLhgXaQDWEg2tnJ8QteYwLVJ/gf84cTMKw8qs+RQZ30/uYzIV4Qg4jB2YfjGl3lPn3IUlNLogTuyDTCUsNwde1WDcFbNMaP9YAPHad0qXbwzuiT1Ryk/PrH6mimJPIlwIuKuf7+Tk2hyxsPbrQoI4BeoUHXpbXcpLD2woXV6Nm9DXnWOOIAbQZx7eaJAxqd9Y+Sl5eELpiW9zGXOt4ITmzI/F77YnesxNKf5g37YNBoSVs+gKk8E0nG/SYmol6z4pPPlYolH8rAcHRsqMZtl8M8yJRTUuruT+df6bcuqPv3p/tppbAufe5FYj5S2r8mN4wEMJCPWlJDa0yBZuvLyvnobuPXNBzgMhbJlNw5z46A41TTvnKnnApnwQPJVoQX+PTXMFZ44ntwFiN+hVrEPxBgTtiPmSSsirinXl4jxhrdVl+MVDDwBoRszJi83jgPWrzLnJCR61I43roZgjC9bY5NV+XpUO5U1NyOq4Cp5MCJtp0KZVpq4/z+orHvEjGQtDphUkURNUkBk38/1bTG965KFQq5CuMylSwXGNKLKp/KaI8VzMBDPKbsP6eRnYPm0PVM483CboR/I8SQU3v+M+aRnTPmEm5dNZ2cpPSeXb7zpq7z6q8Nu2IC5LOr0BbB5W0TJ1HSfgsGIS5h4E4SKnfWfjrI0/vdD5yi7O3bZ21qP0h6ysOWYbcCBI7OGwRDj+JTWK/eUbf6F73JIQAaue9QPrRDlIRUhhXl9uC6BLfHsrfNpk3Ym4vFhMDEdKe3xhNSrOjZrIAxgdhIAaQ+yVwAWnvTpltK4/AILl6DY89W/1sXmiS/URxi/1EKO0vdhgxWqSQOlMawM69D15k5ESGPCk6QXGG52P29GBCnZdgz0Tm6xL8ZHzDqvS3/xtp0L/HpOnJHv/g7ubj36bp5LPuGkk6GFg/Wp7mh1Nff+F97+ivlrTo8abBYsAFQW mjO5QT8U XtTtKChBPLB4aCmpXEGb5zGsY/nLJo1MIE88+hM1pUD62sPSqaEBI9UnvsQOf2V3M7IDh5JgqRM8XnZ63B6i5S7Syg7MHnAKOWiirDXF05+W7aO5d9K0QFpbxr3V9oT7LNPnGuYjFs8CCiFBDiqT0LxujgUFijN9vdR3asvkJ5lSlQpZxcBEpzo8NFvULwB7x4KJhdoZ0xjevJ5x2shmBaOdMIVeu+lRQ6cJZRNnAD6EjvzJoEUHTnfUYG/Hy4n9etodKHu/wqLUqCvAVQrBR8QrisARwjxr+KfVX0WYikDcDtE6icMA0I36PFPcc7Z5jLPuKlzaSWv3As03gfftbLcv6eQdehAmIXJGjz/J4IfGufDrLbvNkp+px0qjhpJiyFLMbrcQFWLC+P4zjjwqD65cgRg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: The of_node_put on line 614 does not look useful. julia ---------- Forwarded message ---------- Date: Mon, 22 Jan 2024 19:18:22 +0800 From: kernel test robot To: oe-kbuild@lists.linux.dev Cc: lkp@intel.com, Julia Lawall Subject: [linux-next:master 139/1036] drivers/gpu/drm/etnaviv/etnaviv_drv.c:614:3-14: ERROR: probable double put. BCC: lkp@intel.com CC: oe-kbuild-all@lists.linux.dev CC: Linux Memory Management List TO: Sui Jingfeng CC: Lucas Stach tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master head: 319fbd8fc6d339e0a1c7b067eed870c518a13a02 commit: 56df40c804fa40712239478355abe265aeda2197 [139/1036] drm/etnaviv: Add a helper to get the first available GPU device node :::::: branch date: 10 hours ago :::::: commit date: 3 months ago config: x86_64-randconfig-102-20240122 (https://download.01.org/0day-ci/archive/20240122/202401221903.GjEKVu8R-lkp@intel.com/config) compiler: ClangBuiltLinux clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot | Reported-by: Julia Lawall | Closes: https://lore.kernel.org/r/202401221903.GjEKVu8R-lkp@intel.com/ cocci warnings: (new ones prefixed by >>) >> drivers/gpu/drm/etnaviv/etnaviv_drv.c:614:3-14: ERROR: probable double put. vim +614 drivers/gpu/drm/etnaviv/etnaviv_drv.c a8c21a5451d831 The etnaviv authors 2015-12-03 597 a8c21a5451d831 The etnaviv authors 2015-12-03 598 static int etnaviv_pdev_probe(struct platform_device *pdev) a8c21a5451d831 The etnaviv authors 2015-12-03 599 { a8c21a5451d831 The etnaviv authors 2015-12-03 600 struct device *dev = &pdev->dev; 0ea057a9cb2be4 Michael Walle 2021-09-07 601 struct device_node *first_node = NULL; a8c21a5451d831 The etnaviv authors 2015-12-03 602 struct component_match *match = NULL; a8c21a5451d831 The etnaviv authors 2015-12-03 603 246774d17fc05a Lucas Stach 2018-01-24 604 if (!dev->platform_data) { a8c21a5451d831 The etnaviv authors 2015-12-03 605 struct device_node *core_node; a8c21a5451d831 The etnaviv authors 2015-12-03 606 246774d17fc05a Lucas Stach 2018-01-24 607 for_each_compatible_node(core_node, NULL, "vivante,gc") { 246774d17fc05a Lucas Stach 2018-01-24 608 if (!of_device_is_available(core_node)) 246774d17fc05a Lucas Stach 2018-01-24 609 continue; a8c21a5451d831 The etnaviv authors 2015-12-03 610 97ac0e47aed5f6 Russell King 2016-10-19 611 drm_of_component_match_add(&pdev->dev, &match, 0a522394202f1f Yong Wu 2022-02-14 612 component_compare_of, core_node); 56df40c804fa40 Sui Jingfeng 2023-10-02 613 56df40c804fa40 Sui Jingfeng 2023-10-02 @614 of_node_put(core_node); a8c21a5451d831 The etnaviv authors 2015-12-03 615 } 246774d17fc05a Lucas Stach 2018-01-24 616 } else { a8c21a5451d831 The etnaviv authors 2015-12-03 617 char **names = dev->platform_data; a8c21a5451d831 The etnaviv authors 2015-12-03 618 unsigned i; a8c21a5451d831 The etnaviv authors 2015-12-03 619 a8c21a5451d831 The etnaviv authors 2015-12-03 620 for (i = 0; names[i]; i++) 0a522394202f1f Yong Wu 2022-02-14 621 component_match_add(dev, &match, component_compare_dev_name, names[i]); a8c21a5451d831 The etnaviv authors 2015-12-03 622 } a8c21a5451d831 The etnaviv authors 2015-12-03 623 f5be833dc86f49 Michael Walle 2021-09-07 624 /* f5be833dc86f49 Michael Walle 2021-09-07 625 * PTA and MTLB can have 40 bit base addresses, but f5be833dc86f49 Michael Walle 2021-09-07 626 * unfortunately, an entry in the MTLB can only point to a f5be833dc86f49 Michael Walle 2021-09-07 627 * 32 bit base address of a STLB. Moreover, to initialize the f5be833dc86f49 Michael Walle 2021-09-07 628 * MMU we need a command buffer with a 32 bit address because f5be833dc86f49 Michael Walle 2021-09-07 629 * without an MMU there is only an indentity mapping between f5be833dc86f49 Michael Walle 2021-09-07 630 * the internal 32 bit addresses and the bus addresses. f5be833dc86f49 Michael Walle 2021-09-07 631 * f5be833dc86f49 Michael Walle 2021-09-07 632 * To make things easy, we set the dma_coherent_mask to 32 f5be833dc86f49 Michael Walle 2021-09-07 633 * bit to make sure we are allocating the command buffers and f5be833dc86f49 Michael Walle 2021-09-07 634 * TLBs in the lower 4 GiB address space. f5be833dc86f49 Michael Walle 2021-09-07 635 */ f5be833dc86f49 Michael Walle 2021-09-07 636 if (dma_set_mask(&pdev->dev, DMA_BIT_MASK(40)) || f5be833dc86f49 Michael Walle 2021-09-07 637 dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32))) { f5be833dc86f49 Michael Walle 2021-09-07 638 dev_dbg(&pdev->dev, "No suitable DMA available\n"); f5be833dc86f49 Michael Walle 2021-09-07 639 return -ENODEV; f5be833dc86f49 Michael Walle 2021-09-07 640 } f5be833dc86f49 Michael Walle 2021-09-07 641 0ea057a9cb2be4 Michael Walle 2021-09-07 642 /* 0ea057a9cb2be4 Michael Walle 2021-09-07 643 * Apply the same DMA configuration to the virtual etnaviv 0ea057a9cb2be4 Michael Walle 2021-09-07 644 * device as the GPU we found. This assumes that all Vivante 0ea057a9cb2be4 Michael Walle 2021-09-07 645 * GPUs in the system share the same DMA constraints. 0ea057a9cb2be4 Michael Walle 2021-09-07 646 */ 56df40c804fa40 Sui Jingfeng 2023-10-02 647 first_node = etnaviv_of_first_available_node(); 56df40c804fa40 Sui Jingfeng 2023-10-02 648 if (first_node) { 0ea057a9cb2be4 Michael Walle 2021-09-07 649 of_dma_configure(&pdev->dev, first_node, true); 56df40c804fa40 Sui Jingfeng 2023-10-02 650 of_node_put(first_node); 56df40c804fa40 Sui Jingfeng 2023-10-02 651 } 0ea057a9cb2be4 Michael Walle 2021-09-07 652 a8c21a5451d831 The etnaviv authors 2015-12-03 653 return component_master_add_with_match(dev, &etnaviv_master_ops, match); a8c21a5451d831 The etnaviv authors 2015-12-03 654 } a8c21a5451d831 The etnaviv authors 2015-12-03 655 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki