From patchwork Mon Aug 28 05:31:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 111096 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp4370626qge; Sun, 27 Aug 2017 22:31:51 -0700 (PDT) X-Received: by 10.99.0.202 with SMTP id 193mr1132740pga.21.1503898310919; Sun, 27 Aug 2017 22:31:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503898310; cv=none; d=google.com; s=arc-20160816; b=JRYjcjLvvuVBHCI+tp6zJPNrBveJ1MkXmRrqKG0NPpSXkpGig24n9oqfrdMCcYBUnI GEN8FE7PmxL/qT6PVAgkqsQc2nsLkSWSZikIr1cSTisD8OF0U71NJ4JoIb/+G5/Cg0lF MHvQ88k46XUQ5Krmt3yZuLZSosBM2TzQvXIKFCYIOHL+ZSMm6KnPDExTc0xaI0Qckudw iA+G11EZKk4LXQiDU14423HkHHosTN2l4oyU6CJlJWM7pl53N1quFlW2auF4GvgjmIdL YUYiuLH1nLAZLIKYkfv3sM8+JZr9ZMkf/r4N5j6N4AyScX2sFrpoQNtobNimDoXHaI8Y EqPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=JomoSfAilI7bMGWjRP6EJVNZR2kUuSYQ+l0z/N5k8k0=; b=REyYMwkkPNJPE3Tf9KuG7qayEZeyUHITKLJ2y47oouHqph5KXug+/Rh9WFpYYiY0Zl r3PQaAFdzp1helRyU5KR0Fusm7B9AbWJVK+ex9BJdB/IoC1+yIgqQLY3XZ4Fee+173s4 MGDe0wnd2XCUKkhbV2dkOPPdzH6gwgjzEbfGBw3obHAjeu+KxIEq7hPua9/8IN7rGtnK gvFbZza2GpJsAVgB+APQ1RQNk7qhzpiaXoqgNsYmatbvSKhzVe6cgzm5+rPnQPgkN6yu yblVx0Cf8gfv0m7+3zqtVsVJLNpkLnsY1XuZugah9MNnK8ZZvoejK1cHxOjHUfLkjgsM JnZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BRz//eZ6; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d62si8840647pga.9.2017.08.27.22.31.50; Sun, 27 Aug 2017 22:31:50 -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=@linaro.org header.s=google header.b=BRz//eZ6; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751201AbdH1Fbr (ORCPT + 26 others); Mon, 28 Aug 2017 01:31:47 -0400 Received: from mail-pg0-f47.google.com ([74.125.83.47]:38874 "EHLO mail-pg0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750767AbdH1Fbq (ORCPT ); Mon, 28 Aug 2017 01:31:46 -0400 Received: by mail-pg0-f47.google.com with SMTP id b8so20705100pgn.5 for ; Sun, 27 Aug 2017 22:31:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=JomoSfAilI7bMGWjRP6EJVNZR2kUuSYQ+l0z/N5k8k0=; b=BRz//eZ6IvOAgCxZ2ozCxwAOKJIJ/jp+SMnGoSuOXprDyjou9Z7b6Y1tXgi5jJGfQ7 wAMDhb7LOu6ogT+MXh5KJ29eqrXTN29aV099yH0a1HvjQlKOA5nqgaBdJcNzCwcwWgb+ 3v1Ppa1leb8Xj9IBtR/NIrVtmHYWXCFZNo8UA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=JomoSfAilI7bMGWjRP6EJVNZR2kUuSYQ+l0z/N5k8k0=; b=tckpxPMt1K9UcbTJNJERh25Iv1vI4UpCpTxDPtqoIDaeCB1vGgrNGQiFgQ8Ao0EU+S IfB5DnnW3WCMX6wo0Cgv8CiLTGOU40qDeQ/BtxKTclexBAyPamjY70N/46iCbJY6zaSj J62nsSj30iVcKq6ts+EObX+m+0ZQUgP0DbkXvlZde7pPvSSC+81eewNrCeazKL/aDjs0 A7Bewnzs2WxATUaSkH6FJQSCJ//Y4YB81vh1aGNTlRYcxA5eMAZa6uTBcdvqMIXqGZBa 81deZy0eQeTVNYN4DJ9LyT0YMk1W3Cc7VZcXaqixhJ9qbTW0VPQ+l1Ssc3fhsZI3/btO 7fvQ== X-Gm-Message-State: AHYfb5hYuEkzyRxN+chC9YtP+y/idQiPLKNNs/eZ88xcSXUJzjGPNiCJ L/ZY4jgapTv0jq8M X-Received: by 10.84.215.9 with SMTP id k9mr7239240pli.186.1503898305791; Sun, 27 Aug 2017 22:31:45 -0700 (PDT) Received: from localhost.localdomain (ip68-111-217-79.sd.sd.cox.net. [68.111.217.79]) by smtp.gmail.com with ESMTPSA id 133sm1718884pgf.51.2017.08.27.22.31.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 27 Aug 2017 22:31:44 -0700 (PDT) From: Bjorn Andersson To: Ohad Ben-Cohen , Bjorn Andersson Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] remoteproc: Stop subdevices in reverse order Date: Sun, 27 Aug 2017 22:31:42 -0700 Message-Id: <20170828053142.26152-1-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.12.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Subdevices might depend on earlier registered subdevices for communication purposes, as such they should be stopped in reverse order so that said communication channel is removed after the dependent subdevice is stopped. Signed-off-by: Bjorn Andersson --- drivers/remoteproc/remoteproc_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.12.0 diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index e82f60182027..5aaa4c21d14d 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -794,7 +794,7 @@ static void rproc_remove_subdevices(struct rproc *rproc) { struct rproc_subdev *subdev; - list_for_each_entry(subdev, &rproc->subdevs, node) + list_for_each_entry_reverse(subdev, &rproc->subdevs, node) subdev->remove(subdev); }