From patchwork Tue Jan 24 01:48:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sarangdhar Joshi X-Patchwork-Id: 9533857 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id ADD246046A for ; Tue, 24 Jan 2017 01:50:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9E9F32768C for ; Tue, 24 Jan 2017 01:50:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 923DF27BFF; Tue, 24 Jan 2017 01:50:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, T_DKIM_INVALID autolearn=no version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 62C732768C for ; Tue, 24 Jan 2017 01:49:59 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cVqF9-0003LA-1h; Tue, 24 Jan 2017 01:49:55 +0000 Received: from smtp.codeaurora.org ([198.145.29.96]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cVqEh-0003JC-EB for linux-arm-kernel@lists.infradead.org; Tue, 24 Jan 2017 01:49:32 +0000 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id C9A8260714; Tue, 24 Jan 2017 01:49:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1485222546; bh=rxfbMQB3MjjlJ8k5jDziBfQXrQlHjX+EdX2lGT721Xo=; h=From:To:Cc:Subject:Date:From; b=YdRCWw5kG2GS8WwrtOmWTJfwHEyCkcKPpUr5MM1tksXT01/hGUgnqPesj1bzn0jwS RCE504GvWg27bvTkU7XAnsKZWv/4cgP5b6Q6GOThmrSgzo7mdTdxtn3VNfl+xmoPl8 d1v9V1Dm0IcLp0XhM3TEk60OK9Qw14eWkS5VZ/1o= Received: from spjoshi-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: spjoshi@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id E70BA601D1; Tue, 24 Jan 2017 01:49:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1485222546; bh=rxfbMQB3MjjlJ8k5jDziBfQXrQlHjX+EdX2lGT721Xo=; h=From:To:Cc:Subject:Date:From; b=YdRCWw5kG2GS8WwrtOmWTJfwHEyCkcKPpUr5MM1tksXT01/hGUgnqPesj1bzn0jwS RCE504GvWg27bvTkU7XAnsKZWv/4cgP5b6Q6GOThmrSgzo7mdTdxtn3VNfl+xmoPl8 d1v9V1Dm0IcLp0XhM3TEk60OK9Qw14eWkS5VZ/1o= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org E70BA601D1 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=spjoshi@codeaurora.org From: Sarangdhar Joshi To: Ohad Ben-Cohen , Bjorn Andersson , Loic Pallardy , Santosh Shilimkar Subject: [PATCH] remoteproc: Move rproc_delete_debug_dir() to rproc_del() Date: Mon, 23 Jan 2017 17:48:48 -0800 Message-Id: <1485222528-20603-1-git-send-email-spjoshi@codeaurora.org> X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170123_174929_253458_5B70556D X-CRM114-Status: GOOD ( 10.86 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Trilok Soni , linux-arm-msm@vger.kernel.org, Stephen Boyd , linux-kernel@vger.kernel.org, linux-remoteproc@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The "remoteproc{0,1...}" sysfs entries are added in rproc_add() and deleted in rproc_type_release() instead of in rproc_del(). That leaves these lingering entries sticking around after we return from rproc_del(). Move the rproc_delete_debug_dir() to rproc_del() to fix this. Signed-off-by: Sarangdhar Joshi --- drivers/remoteproc/remoteproc_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index 953ee29..78200a7 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -1315,8 +1315,6 @@ static void rproc_type_release(struct device *dev) dev_info(&rproc->dev, "releasing %s\n", rproc->name); - rproc_delete_debug_dir(rproc); - idr_destroy(&rproc->notifyids); if (rproc->index >= 0) @@ -1491,6 +1489,8 @@ int rproc_del(struct rproc *rproc) if (rproc->auto_boot) rproc_shutdown(rproc); + rproc_delete_debug_dir(rproc); + /* the rproc is downref'ed as soon as it's removed from the klist */ mutex_lock(&rproc_list_mutex); list_del(&rproc->node);