From patchwork Tue May 15 20:53:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Elder X-Patchwork-Id: 135929 Delivered-To: patch@linaro.org Received: by 2002:a2e:9706:0:0:0:0:0 with SMTP id r6-v6csp27576lji; Tue, 15 May 2018 13:54:04 -0700 (PDT) X-Google-Smtp-Source: AB8JxZprhS43Pioi9SfugiLjg72nqD3H1tCgJgtjbLVkQyrCF12mwHVhb2kBJ64V8SGWF2xIIbVn X-Received: by 2002:a62:c103:: with SMTP id i3-v6mr16691083pfg.148.1526417644266; Tue, 15 May 2018 13:54:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1526417644; cv=none; d=google.com; s=arc-20160816; b=ZqrSj3dSiH5IqZS/S1tY+WJ9amDmirN8FmctdeC42wmrFrPoxD7Oo0V7eRnnflRLxN 98235Nb/Z1TgzZ1zSFNlz6Q+AW0zCnsrSRPyBEUA6m1MVCiK+UhtwaWrbNy9R8CJv07B 2cEHxInWkXZm/O2dd4tX6mit4x5KkiBQEDDHGkpgV2a7mUVaMiVQcQvHU8uwVG+bPcX/ RwYNwBR+mosIzoOyDY2UDBwcarfLLdRS0zzw/EcKoDbFez2j4n1SJ33MiMt2Y2zqJSn1 ckMxx+QnTRnedBktUtdVQWFYnfO2MFuwukBzMeIuW21c0QEZpt256E21Kn2dk5QwxmaL yAhg== 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=6HyQzw6NAdfB2F6Sekrf3bHu2OVNG3LO++5UtltSAQ4=; b=dHWbgp0HtKiXbHT/rQC1L/AbXe9qMUlXOSY+Yx5lyNkn396wqbDBsEAoA/7kF1zNt4 emNodvaiY19+BIA1r1ijI2Pou5FUNXMtusaJyyI1Sgarjs8WUAvqh8UpuvGGDLNiC1So d5hiF+cFsHR9qhI3XHMOceZh1aweZfEzVlH+bkT/WyH5AsWo710gTCWAEi3LEKvZxNRm Fa3XgO711ExEDcAJseVbU3QR+FwssbShV260/JL8H7JFbafkpxAlIKvYGnpuzFTsWci5 WGaNbzBVeadQ5dR13HaqRbd2YXdJWZWSk9rUbsMooTKLTAL+dgX/7Sdp5c5hOhMnd6hf Tt3Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=iMDy1IT8; 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 p91-v6si841704plb.457.2018.05.15.13.54.04; Tue, 15 May 2018 13:54:04 -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=iMDy1IT8; 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 S1752700AbeEOUyB (ORCPT + 29 others); Tue, 15 May 2018 16:54:01 -0400 Received: from mail-it0-f66.google.com ([209.85.214.66]:38933 "EHLO mail-it0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752236AbeEOUx4 (ORCPT ); Tue, 15 May 2018 16:53:56 -0400 Received: by mail-it0-f66.google.com with SMTP id c3-v6so5345721itj.4 for ; Tue, 15 May 2018 13:53:56 -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=6HyQzw6NAdfB2F6Sekrf3bHu2OVNG3LO++5UtltSAQ4=; b=iMDy1IT8rWZu9845v0sj7CZxHPdkGjBVKfakpGfmqI5USIRex/878ndlAiusn0F/yU VZ7Y28uH/zKs0tfElCIaMieDPcKRVppPdjF6IHv9wmHkHT4/dRdAuVYcqwh9eO1H9Gce 8fFRI0HKZn4zIIz9QgFJDgd/6E81r8sm6j8yg= 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=6HyQzw6NAdfB2F6Sekrf3bHu2OVNG3LO++5UtltSAQ4=; b=IJ+/cQ+CeX9ffXuUO+7GW22y5qrGSxkL04TeRfFnFTrOc7tsJQw74y6JLIi/3hjVMd KHUFXmQHYpfhXS+WeS+ZUzjGS1Yxy2L45tlV6UEEyo0FWQzTXZO9yh2DDrar1FlwYym9 iu1GaEDueYWAQSxwfacc2tEU+Rmqf0Bi6lYwmnEc790Ds8xTHItgjrAHajOGK5QnFLZ4 NbBQoaZexPII8RodE8hjAKutMFtWajyWpsnrfGLUPHw5z2Q2Vu7lt+lRey8coe+HKUo2 rYMudQgfKbvoSb0juSpLtULnUOaAH+f/dMDB+m+fbTVrETeVGSTarIYaPRg+WbBfzVrG yH1w== X-Gm-Message-State: ALKqPwdFAUZ3pqdHsEb0eoMvtMTU50QIfKDhsu5K05fV+aUjcLGZlakE 97tR34JcQ4nKcaF17UiAW+vKehpkaas= X-Received: by 2002:a24:61ce:: with SMTP id s197-v6mr17279448itc.10.1526417636127; Tue, 15 May 2018 13:53:56 -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 t9-v6sm440407ioa.82.2018.05.15.13.53.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 May 2018 13:53:55 -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 2/5] remoteproc: Make start and stop in subdev optional Date: Tue, 15 May 2018 15:53:42 -0500 Message-Id: <20180515205345.8090-3-elder@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180515205345.8090-1-elder@linaro.org> References: <20180515205345.8090-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. Signed-off-by: Bjorn Andersson Acked-by: Alex Elder --- drivers/remoteproc/remoteproc_core.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) -- 2.17.0 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); + } } /**