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 16EFBC47258 for ; Tue, 23 Jan 2024 09:25:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 91EC56B0080; Tue, 23 Jan 2024 04:25:33 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 8CDEF6B0082; Tue, 23 Jan 2024 04:25:33 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7956A6B0083; Tue, 23 Jan 2024 04:25:33 -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 64C3B6B0080 for ; Tue, 23 Jan 2024 04:25:33 -0500 (EST) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 3F4DFA06BB for ; Tue, 23 Jan 2024 09:25:33 +0000 (UTC) X-FDA: 81710042946.17.5CB57EF Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) by imf03.hostedemail.com (Postfix) with ESMTP id 5521420010 for ; Tue, 23 Jan 2024 09:25:30 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf03.hostedemail.com: domain of l.stach@pengutronix.de designates 185.203.201.7 as permitted sender) smtp.mailfrom=l.stach@pengutronix.de ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1706001931; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vptQZH+rMhM2fygIIkSqXOm/4o0rm3Iuan6KB2GQdvk=; b=PlZg+Kt9ALNdu5nA1TIflEfcIa2UpmGVxwkD6tzmVZtn89lmvokR3qWUocgdA1ZmxxcymP 6wcHCNwT2L4gIjYKnmH9wi9lzNjwFMMwi0/vM8LR5l3LToK/t2faipY3Jy4s1oz0vx5dXf Im5TsOnbQb9OBRdSRmdge5uEAlJpPPk= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf03.hostedemail.com: domain of l.stach@pengutronix.de designates 185.203.201.7 as permitted sender) smtp.mailfrom=l.stach@pengutronix.de ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1706001931; a=rsa-sha256; cv=none; b=DTXIY+IQp0UT0T45Dd+Xg4Z4W8/C4wsrh6gNbGvZKKRMgOgC24LH1XC97ifJLNb/LL3CAo GA9UjHa4K13/rg+uPB7SWoWddcLlSKpy83Yl9k4o3wcIghddP6CHC36dzVD6DNZrT1ixAu yegcBi01FY3h1mqNyB3FcYV4+qwiciU= Received: from ptz.office.stw.pengutronix.de ([2a0a:edc0:0:900:1d::77] helo=[IPv6:::1]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rSD26-0001ky-SV; Tue, 23 Jan 2024 10:25:26 +0100 Message-ID: <387720feac4593ac66fac594950975a6a317da46.camel@pengutronix.de> Subject: Re: [linux-next:master 139/1036] drivers/gpu/drm/etnaviv/etnaviv_drv.c:614:3-14: ERROR: probable double put. (fwd) From: Lucas Stach To: Sui JIngfeng , Julia Lawall Cc: Linux Memory Management List , oe-kbuild-all@lists.linux.dev Date: Tue, 23 Jan 2024 10:25:25 +0100 In-Reply-To: <8f844ac1-eecf-4ace-854e-6d7d7aad9ad6@linux.dev> References: <94afe420-f3b-5620-2380-82c9c62838f0@inria.fr> <8f844ac1-eecf-4ace-854e-6d7d7aad9ad6@linux.dev> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.48.4 (3.48.4-1.fc38) MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a0a:edc0:0:900:1d::77 X-SA-Exim-Mail-From: l.stach@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-mm@kvack.org X-Rspam-User: X-Rspamd-Server: rspam12 X-Rspamd-Queue-Id: 5521420010 X-Stat-Signature: m5y7prk7517wrodgyzdzdapxepq758fq X-HE-Tag: 1706001930-923273 X-HE-Meta: U2FsdGVkX1+FuWAnWAXHWrYUG+vLvbmTObQo4ldoi3wUeCl7x6Mb4j8lQEzE3ju8snJKyo96lpJSwPgpbhTk2gLtVpfGPXFg6gTLUnqaK7e862jBBzmB8BjfjJ/eMDbPvCmabqRbBsb3aIEaR1CC7esteIuoaQa8+PGhIbg06cEcF3t2psu0gw4PH9h8pEjnd6J+1jhXvKaBaM2pf7wk2O8LZecVPK7wdGCk+GUrmoXadHgOCiEFEMQUXKqvNAcx9ofOGXh3feaUTGbA+QJ3VmAvStdtBSxDGCkPgqgMYmKWR9wONfPsfDqnq286Z9y943pddEtoyaoaZqhw8bdzJZx3o3p4cKc7fisvM6y4Ezxl3N/uKyYK3nEau1lpP3V+BaG0DOwE7+inJVK5fbXP2VBpJIqEVg+KMXlJ3WmCS+0lyZ54Mvhyjy1Qz6I1rcY/vMRWgHKWg4iNLWOw+UrgTVKjGL3GO9lNHRYHTUSWZ9Xqv0fQUptd75RLm35HAd14RLOEQ0aO3xzAOfyclaXEh4N2XrRpMzeEWT+uv2KLdJJjRF2HH8o0HVIy/wrfwYTFndmgPqMRITHLYHXdlwmLKRbTiqHTk/MH8GUF+jFdY2IJBj+ZvBbCD5jSML5CUOZRRrCgPcDvuy5cJNwGaSjiTjm3KInHFvazTQd2HgIe7dhO1am6FEGkfbI1ZlHKmfwO2EK4sMNj5nsOyEVTmiieHdSj3N2owZ0IvRRE4nklAuMBJO01HvA+Zq1EUXbTlEnR6NN64Vov/UjmBGf7wzJ011ldJwwd8Dr8kKSfyw1xPwNKoKOZxemUTLSQ5HQJL7jhU4CbrF436496qZri1tQiWdjkFwEo1i25+ea5bxSa2RFhhTGQ+HnJkBCX+g2vKNPpxwhKAUno+aVcIKXl5gYC7zDvCrvAoS0q3ZxNYv4Aw27Aq0nwy18Fakm5j9lMWoeuSghkFcptnpI51Pny8ZV d5P/zGut 55S+5pxiRn+FLSZMDg0TaxXJYM+TjGw3kACyQ+xCJnFkpm49FZt2r5HdTvuq04IvKTB6FK+boL7EDjWT9p6VqzLhAreJEqqXn1gbvtv6GMvSPYoWmTaJClow/7klVEhLaslBSmPwJsyMkldh3nHlJp9fDw9Up4t4jvylSBLwhq2LMSoeYoKkHiGd+cSW846sDMo7WrP8lSi7Ox7qbCIKA1ZVZZhXqPCP4khzrk8XDKrYanBa4xqs3EuGokfPCyTbLlUqMX81Jp27tU8prjauxVgA6G3+BOZvr3JV+9aJqz5NpevUXMcKJQBcsJHTUz8Qq/wV/ilJZ5Bnan5c= 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: Hi Jingfeng, hi Julia, Am Montag, dem 22.01.2024 um 21:49 +0800 schrieb Sui JIngfeng: > Hi, >=20 >=20 > On 2024/1/22 20:33, Julia Lawall wrote: > > The of_node_put on line 614 does not look useful. >=20 > Simply delete that line would solve this problem, what do you think? >=20 Yes, that looks right. As the patch was only in etnaviv/next, which is not a stable branch I amended the patch, dropping this line. Regards, Lucas >=20 > >=20 > > ---------- 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 do= uble put. > >=20 > > BCC: lkp@intel.com > > CC: oe-kbuild-all@lists.linux.dev > > CC: Linux Memory Management List > > TO: Sui Jingfeng > > CC: Lucas Stach > >=20 > > 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) > >=20 > > If you fix the issue in a separate patch/commit (i.e. not just a new ve= rsion 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= / > >=20 > > cocci warnings: (new ones prefixed by >>) > > > > drivers/gpu/drm/etnaviv/etnaviv_drv.c:614:3-14: ERROR: probable dou= ble put. > > vim +614 drivers/gpu/drm/etnaviv/etnaviv_drv.c > >=20 > > 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= =3D &pdev->dev; > > 0ea057a9cb2be4 Michael Walle 2021-09-07 601 struct device_node= *first_node =3D NULL; > > a8c21a5451d831 The etnaviv authors 2015-12-03 602 struct component_m= atch *match =3D 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_nod= e *core_node; > > a8c21a5451d831 The etnaviv authors 2015-12-03 606 > > 246774d17fc05a Lucas Stach 2018-01-24 607 for_each_compatib= le_node(core_node, NULL, "vivante,gc") { > > 246774d17fc05a Lucas Stach 2018-01-24 608 if (!of_device_i= s_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 =3D = 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 =3D 0; nam= es[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 ca= n 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 add= ress of a STLB. Moreover, to initialize the > > f5be833dc86f49 Michael Walle 2021-09-07 628 * MMU we need a c= ommand 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 sur= e we are allocating the command buffers and > > f5be833dc86f49 Michael Walle 2021-09-07 634 * TLBs in the low= er 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_cohere= nt_mask(&pdev->dev, DMA_BIT_MASK(32))) { > > f5be833dc86f49 Michael Walle 2021-09-07 638 dev_dbg(&pdev->de= v, "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 G= PU we found. This assumes that all Vivante > > 0ea057a9cb2be4 Michael Walle 2021-09-07 645 * GPUs in the sys= tem share the same DMA constraints. > > 0ea057a9cb2be4 Michael Walle 2021-09-07 646 */ > > 56df40c804fa40 Sui Jingfeng 2023-10-02 647 first_node =3D etn= aviv_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_m= aster_add_with_match(dev, &etnaviv_master_ops, match); > > a8c21a5451d831 The etnaviv authors 2015-12-03 654 } > > a8c21a5451d831 The etnaviv authors 2015-12-03 655 > >=20