From patchwork Tue Jun 26 12:11:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 139977 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp5162002lji; Tue, 26 Jun 2018 05:12:19 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLwA8qAdyUip/B/Ayz+zdU9Jt/vOKp+ZJUgxwIXkuB2A2MJ/uTHO6h8DfyRJopk7hR3v44C X-Received: by 2002:a17:902:3343:: with SMTP id a61-v6mr1319842plc.241.1530015139432; Tue, 26 Jun 2018 05:12:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530015139; cv=none; d=google.com; s=arc-20160816; b=0KvzbV5g2JzqQDiTE96RjkLOJ2KDj1BCkq2PJtysQiblZpkPKDn9N2tdH2Pk/p4wNw 9ExPFmqn/B2A+slfPLDDKOUyDYs4RizQQaV1LoKa8kfOXf96TAqYBz5npWXNOo57NZKj cNduyP2iX4NhVYqBE5ZnWHwovuOPtZ+lRPDX27ln4OAvyj6zZuFkfcE+mMrF0AAfWa83 ORi5udyljBA1B35Tkt+qjCq6th/Iew/KnhPg6aDpRMexEVzTqtoY/t2KlsDRVvBjb0Ur racafjR3EOmeNTexQTo+3CatDvAI6P4BW3W1Fz0u7sw+kbpinAuyKMOF/ujwgNw4x6yg pchw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=I57NxyETdS7bcU1Jd7YbgD9UZcuzgAQvo28u6b2l6Ek=; b=lXB9IrtQIeRHM/XENkHX74TrYJzbQO9dCUXWN9clnDmHwuBpnuZShfhiLqOLny2x0Q TJXuEOCot/VtVuLAiOjYj9d7DYKFZSPe9KGAEJQZNn9jgzzz1qDaS33q5voO6w4QNGpt j5BCLiWoaWin8U5SG1wFFWHbzG7epCBT8H5PZ43edPdVDdn7IzOe56ZdYtZEpXWupiv+ 7TTFXz+m8Sek4kn1ghQ4mfZZnnXvFL0Bu0w8Hoc/MPDdkI2Sf67hO8mdpDLPD6mMWUkC zSnxRYNh/jKQTcI6tLPpH2cGslfeaKWGZUnjOihZ1tFTUm/VP5WJfrogtiSJDfamS3VU TXYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BVwbcAdx; 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 cf13-v6si1760748plb.175.2018.06.26.05.12.19; Tue, 26 Jun 2018 05:12:19 -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=BVwbcAdx; 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 S935361AbeFZMMR (ORCPT + 31 others); Tue, 26 Jun 2018 08:12:17 -0400 Received: from mail-io0-f195.google.com ([209.85.223.195]:45869 "EHLO mail-io0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935259AbeFZMMM (ORCPT ); Tue, 26 Jun 2018 08:12:12 -0400 Received: by mail-io0-f195.google.com with SMTP id l25-v6so15718743ioh.12 for ; Tue, 26 Jun 2018 05:12:12 -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:in-reply-to:references; bh=I57NxyETdS7bcU1Jd7YbgD9UZcuzgAQvo28u6b2l6Ek=; b=BVwbcAdxesZTOq5UrKvkrChLRF5weLtcqKkXCG0YUfp1GFLov9QwNdaLbXqjaI0fGu gbFFj20V6O485p8bHFJCLk4l4p3MpTvRHc2guDHAOarlbdUHyZtlIUQq8dq9wBxhGCS6 8c7S392FJLxTohv/drjaHFXaxSo54ZbfFERgo= 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:in-reply-to :references; bh=I57NxyETdS7bcU1Jd7YbgD9UZcuzgAQvo28u6b2l6Ek=; b=W9CuHFiG7bEOTTcJCSgGTUAKE0x8nyHycB08PR1WcP66K1hAxy9z3Qa7DwxQ3N3zFS Ypx5KlBysTUU06IC4MVpyzaiTkvNglGiXumuAOnbNTeYU+Z6wIsjp4G/Ql6sN9271zeb /r5qyjUK5HMQgHdUP82Fo97K5mWdBgNrOfEOlS7vEFOb6w/lDdO6ctTOl7T/NTakGDiL 5/qGJywbskyW+j7R4Gv04Nlh015zDFxuon34S8ULviTg/84DXN6ik9Jtb5oU2IxqxiYt f6FBpu5EfL9bbHoI1q0WhC9xwWNZMIBcTn4jaaDRK7RMp1WnomfJhxW3LmRcCbPFE1r3 zSeQ== X-Gm-Message-State: APt69E3vd21Wghs+ZEk1uposB+Qf/5AUdWy8P1MZ/uJyhTXFAZBD2Crw OoCZBfPjjvER68D83BM/RlCMwQ== X-Received: by 2002:a6b:144b:: with SMTP id 72-v6mr954408iou.218.1530015131335; Tue, 26 Jun 2018 05:12:11 -0700 (PDT) Received: from localhost.localdomain (c-71-195-29-92.hsd1.mn.comcast.net. [71.195.29.92]) by smtp.gmail.com with ESMTPSA id y62-v6sm902309ioy.88.2018.06.26.05.12.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 Jun 2018 05:12:10 -0700 (PDT) From: Alex Elder To: ohad@wizery.com, bjorn.andersson@linaro.org Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH v2 2/5] remoteproc: Make start and stop in subdev optional Date: Tue, 26 Jun 2018 07:11:56 -0500 Message-Id: <20180626121159.7267-3-elder@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180626121159.7267-1-elder@linaro.org> References: <20180626121159.7267-1-elder@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bjorn Andersson Some subdevices, such as glink ssr only care about the stop operation, so make the operations optional to reduce client code. Tested-by: Fabien Dessenne Signed-off-by: Bjorn Andersson Signed-off-by Alex Elder --- drivers/remoteproc/remoteproc_core.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) -- 2.17.1 diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index 5dd58e6bea88..981ae6dff145 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -780,16 +780,20 @@ static int rproc_start_subdevices(struct rproc *rproc) int ret; list_for_each_entry(subdev, &rproc->subdevs, node) { - ret = subdev->start(subdev); - if (ret) - goto unroll_registration; + if (subdev->start) { + ret = subdev->start(subdev); + if (ret) + goto unroll_registration; + } } return 0; unroll_registration: - list_for_each_entry_continue_reverse(subdev, &rproc->subdevs, node) - subdev->stop(subdev, true); + list_for_each_entry_continue_reverse(subdev, &rproc->subdevs, node) { + if (subdev->stop) + subdev->stop(subdev, true); + } return ret; } @@ -798,8 +802,10 @@ static void rproc_stop_subdevices(struct rproc *rproc, bool crashed) { struct rproc_subdev *subdev; - list_for_each_entry_reverse(subdev, &rproc->subdevs, node) - subdev->stop(subdev, crashed); + list_for_each_entry_reverse(subdev, &rproc->subdevs, node) { + if (subdev->stop) + subdev->stop(subdev, crashed); + } } /**