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: 9533849 X-Patchwork-Delegate: agross@codeaurora.org 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 4ABC76046A for ; Tue, 24 Jan 2017 01:49:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3221B277D9 for ; Tue, 24 Jan 2017 01:49:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 26BE227C05; Tue, 24 Jan 2017 01:49:10 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D0EF9277D9 for ; Tue, 24 Jan 2017 01:49:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751893AbdAXBtI (ORCPT ); Mon, 23 Jan 2017 20:49:08 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:59226 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751838AbdAXBtH (ORCPT ); Mon, 23 Jan 2017 20:49:07 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 0935A60852; Tue, 24 Jan 2017 01:49:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1485222547; bh=rxfbMQB3MjjlJ8k5jDziBfQXrQlHjX+EdX2lGT721Xo=; h=From:To:Cc:Subject:Date:From; b=XhiYnM0u624lr9wZfR3X0vcMwG5TwExQFTr4Mwe0wEltxwJPHV+pNSxSUeGWR70Oq +2/L5cxEwgMfK8J4oc/kFG4aBlICF5cDOFAnWBr4i2ePmUlLy+dTU3+zuI3xpK9hYL uICY1mJn5ksxvy5jgY4N7uP731TxZ8GriyIFlvt8= 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 Cc: Sarangdhar Joshi , linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, Stephen Boyd , Trilok Soni 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 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.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);