Received: by 10.192.165.148 with SMTP id m20csp4030049imm; Mon, 23 Apr 2018 17:36:23 -0700 (PDT) X-Google-Smtp-Source: AIpwx49BRnWy1QYXhNRY5El+ZvboRTu1Qpp8AGchdyYWcJrQoIiFESSGqtXDbpYRzeeGVDRzNLqW X-Received: by 10.98.220.78 with SMTP id t75mr21140891pfg.139.1524530183360; Mon, 23 Apr 2018 17:36:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524530183; cv=none; d=google.com; s=arc-20160816; b=Km3fWz9J5W3uWdEqNQr8eQQGwyrgNSQ2HQsh8nnp7hK21TqdYIysxmlk0Zul7ypcyR LhoTc753eK5psf4oGhZ9HK+uqGHlYpXjYobfpU5RaF5LRiJkbK3+n6K46Yc5oT4Zzi8l 44a4CYGM7NvgiWA8VBhhksOV+FfmsUdtWWyCUA9r1qhCW02Z8jIGNpx/x4bKMOb0CVTl hfdy0srrBPczeQ+53ziVyyGEJ54/maAV6z1vs2C+csSFzkHbPylmjAR498PHMNWkTTXk n4p8UBH3pITg714LhJUkHHnLuL74ExT07Qa0Kc5RodzvK3c1ylm20W4zR89JECc3evFR juiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=Y8hZ1k7cV4we5foTe5Q4dDwUpYWd0cdFqLFTGROAuwc=; b=iDR4MyY93RywQoFAloUBzbOUGTizNnWhMwS3AOqSqIC6I6BnQcZZNu8trO2kiCh9T1 yA6yKvIvXKcsBYXrUnyIcLc7eHuEszxJY8SNqxDVtCWttU06LJdD1M3sCSpU+s78yv8u Pm8+VP6asaueE7OwDcnPU5RQyj8xN8TuLWgLppSqMQ9l8Y/ot6xacmQZAbUlhLXh32gD 5o05xbpPD93OJsOp822/95j3hVNym571oluR7PaQFqtTrmQE0+AkSyhwhfBD/SMZQWuy JltY9soOzlTEBvypfGaAcNlKTqcZidCJzi7oaCLjIgYgMEHvnXq8DforC7mBQIz2q5bF +WeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DMbPFGh8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e5-v6si13278619pls.579.2018.04.23.17.36.09; Mon, 23 Apr 2018 17:36:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=DMbPFGh8; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932682AbeDXAfF (ORCPT + 99 others); Mon, 23 Apr 2018 20:35:05 -0400 Received: from mail-wr0-f193.google.com ([209.85.128.193]:34646 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932647AbeDXAfC (ORCPT ); Mon, 23 Apr 2018 20:35:02 -0400 Received: by mail-wr0-f193.google.com with SMTP id p18-v6so26693776wrm.1 for ; Mon, 23 Apr 2018 17:35:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=Y8hZ1k7cV4we5foTe5Q4dDwUpYWd0cdFqLFTGROAuwc=; b=DMbPFGh8/mOw3Fo4zRJzX54nfxdc2cJPDNpxkTjLlUZNN7UbNIwJmH/2dcIjUxZkhg iUF9jGwd+Sq0GjJSL1n1u0wzWbq71UvfQHiLyKYGp35nKjqwDbEP3oCWz2EkDtfKrzhe eqYf4AQDq6wHRpurRZfRnwt+tkM0N+fj9nPfEAPr8ros9Rl08tc3gy8uNIOBeBnS41it Ry5KAMe6onCVap0yVvwwKbDeAntr5JG+Qy4EeGmOMCgSgznRiTrvXB20thVq4hzxr9G7 HOA5IpIyyzUuxjJRW4hOhS5s7Hvl6pZWkc/YXXzbmC7c6VfR20alTx1KHrKtveXNUzxV j2BA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=Y8hZ1k7cV4we5foTe5Q4dDwUpYWd0cdFqLFTGROAuwc=; b=f2kVdkL7x8AKPTw0XU2xb68phl1cZ8IYWHoqu/7V7GNBt4PACxXvig48xUdtUvbS9u ehZKISBwaBqGVruUpbgTU6gIorvWUITMsKoZyOBXTDIa4r08TeF1qkWL+wT6N4BK1OvK NkrIQ/0MGv1C/gQyKGG/SSFJAaWwLPngyRZ7bTudIsFwLb0EfF55Q1iUqup+PGx0lfHu OZMGIbBgJQCvu+kMT8vuX3OXcV8Yly1O/56iKwv2eehZ4qklw1Ywkb8N99mS689yWp69 yR9qOWMxTu++Tz/s6dFr4ArPCLMDApOlOmsDGSkpHIP2ry9B0C5/01Yto/WnCM3ljr9e tjZA== X-Gm-Message-State: ALQs6tBmJFY2Qia5FjNCzaUFeCB3JTbNhUdaaxsRAJOXJ4xw+jZKE4uF I12EzEryrWylnQkuanPxVQs= X-Received: by 2002:adf:c4c4:: with SMTP id o4-v6mr19251389wrf.173.1524530100924; Mon, 23 Apr 2018 17:35:00 -0700 (PDT) Received: from [192.168.1.3] (x4dbae8f2.dyn.telefonica.de. [77.186.232.242]) by smtp.gmail.com with ESMTPSA id e50-v6sm32245139wre.4.2018.04.23.17.34.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 23 Apr 2018 17:34:59 -0700 (PDT) Subject: Re: [PATCH] staging: bcm2835-audio: Disconnect and free vchi_instance on module_exit() To: Greg Kroah-Hartman Cc: Andy Shevchenko , Eric Anholt , Stefan Wahren , Florian Fainelli , Ray Jui , Scott Branden , devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com, linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org References: <20180417050028.19372-1-k.marinushkin@gmail.com> <20180423135024.GA2337@kroah.com> From: Kirill Marinushkin Message-ID: <7e2dbb73-f93d-7b87-2fa0-d8b40f4a11a5@gmail.com> Date: Tue, 24 Apr 2018 02:35:50 +0200 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20180423135024.GA2337@kroah.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04/23/18 15:50, Greg Kroah-Hartman wrote: > On Tue, Apr 17, 2018 at 07:00:28AM +0200, Kirill Marinushkin wrote: >> In the current implementation, vchi_instance is inited during the first >> call of bcm2835_audio_open_connection(), and is never freed. It causes a >> memory leak when the module `snd_bcm2835` is removed. >> >> Here is how this commit fixes it: >> >> * the VCHI context (including vchi_instance) is created once in the >> platform's devres >> * the VCHI context is allocated and connected once during module_init() >> * all created bcm2835_chips have a pointer to this VCHI context >> * bcm2835_audio_open_connection() can access the VCHI context through the >> associated bcm2835_chip >> * the VCHI context is disconnected and freed once during module_exit() >> >> After this commit is applied, I don't see other issues with the module's >> init/exit, so I also remove the associated TODO task. >> >> Steps to reproduce the memory leak before this commit: > > > Patch dropped due to kbuild complaints. > > Please fix up and resend. > > thanks, > > greg k-h Hello Greg, Due to which complains of kbuild is the patch dropped? I would like to fix the complains, but I don't see any errors or warnings on my side. Are you sure that the kbuild test robot did it's job correctly? The log says: >> it may well be a FALSE warning Please show me what is wrong in my patch. The log from kbuild test robot says: >> [auto build test WARNING on staging/staging-testing] >> [also build test WARNING on v4.17-rc1] >> [cannot apply to anholt/for-next] >> [if your patch is applied to the wrong git tree, please drop us a note to help improve the system] >> >> url: https://github.com/0day-ci/linux/commits/Kirill-Marinushkin/staging-bcm2835-audio-Disconnect-and-free-vchi_instance-on-module_exit/20180417-193147 >> config: arm-allmodconfig >> compiler: arm-linux-gnueabi-gcc (Debian 7.2.0-11) 7.2.0 >> reproduce: >> wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross >> chmod +x ~/bin/make.cross >> make.cross ARCH=arm allmodconfig >> make.cross ARCH=arm >> >> Note: it may well be a FALSE warning. FWIW you are at least aware of it now. >> http://gcc.gnu.org/wiki/Better_Uninitialized_Warnings I cannot clone from the given url, because it does not exist. I cannot use the compiler from the log, because it is built for x86_64, and my host machine is i686. Below are the steps how I tried to reproduce the issue, but errors or warnings didn't happen. I applied the patch on top of the following upstream tag: 60cc43fc8884 (tag: v4.17-rc1) Linux 4.17-rc1 And executed: make CROSS_COMPILE=arm-linux-gnueabihf- --jobs=4 ARCH=arm allmodconfig make CROSS_COMPILE=arm-linux-gnueabihf- --jobs=4 ARCH=arm But the compilation succeed without any errors or warnings. My compiler version is: arm-linux-gnueabihf-gcc (crosstool-NG linaro-1.13.1-4.8-2014.01 - Linaro GCC 2013.11) 4.8.3 20140106 (prerelease) Best Regards, Kirill