From patchwork Wed Dec 13 22:41:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 10111035 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 8259160352 for ; Wed, 13 Dec 2017 22:43:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7678128EB3 for ; Wed, 13 Dec 2017 22:43:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6B7DA28F85; Wed, 13 Dec 2017 22:43:09 +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=unavailable 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 D83B728EB3 for ; Wed, 13 Dec 2017 22:43:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751523AbdLMWm5 (ORCPT ); Wed, 13 Dec 2017 17:42:57 -0500 Received: from mail-pf0-f196.google.com ([209.85.192.196]:33696 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752509AbdLMWlR (ORCPT ); Wed, 13 Dec 2017 17:41:17 -0500 Received: by mail-pf0-f196.google.com with SMTP id y89so2205325pfk.0 for ; Wed, 13 Dec 2017 14:41:17 -0800 (PST) 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=bq8TdGQjagZoow55sXdxLaQ04rt/+nuXUXQV/0cUf1c=; b=fPRWtqBR5Wr46ahCySP6KQf/LsxPAKAB2OhG5hLtPoMQD+TY1iVQ29dGt30JqYi1Ud lWYsGaUfuRWs6JYnpiMsuCTzpNzNe3TDvb6JP7HG7iY9Ba9/tbV/HIb0ifDbXpjiFDCt F7s92lAQid/RC9UJRbP68qz1XoeIZUpjcDWKE= 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=bq8TdGQjagZoow55sXdxLaQ04rt/+nuXUXQV/0cUf1c=; b=kDN1UTSoiFCtpA2QZ2maTfrCGKhOLF1IJ+2BJ49Gks2htamet32V2fo5yPb5KtJI+q ZoDVFztTDsBxfFy49RRiYmar+ZvAjzKIruSsTTSasRXut6B63ozZWGl1r308U1qxWNow ZzVgLw82m1KZh9it4LxPb9iDKXphEbC+P5i3nCSdOtLUhxp5xg3Kj4814KznCqPYvP5O klBAbz7EMoUmRdXwBGhrRuM/ETwKF/xK7lJYHymS4Xctm8GbbTooXOUm6VQ6DOHXa6hZ r1mK5niy54W0447nNOTAb2inNlVQfL+SnBIvbezjJHkuCehmcl28kETasgXzKXyg6RFC BkAg== X-Gm-Message-State: AKGB3mLEXWQXA+dc3Ye3V9YhHOwFxAcTRsAvc+UJXFy3DapcpX8Rr83W KmZTF+nf0f6WQep/SzSxjUXOKg== X-Google-Smtp-Source: ACJfBov4JOkdhS0FU2QSsXHWKk3M0/TGITtlRkaP1gt5SgGkN41iNr/rDnHRSIOuvT7aIFQQPV7OGg== X-Received: by 10.84.217.131 with SMTP id p3mr163810pli.270.1513204877004; Wed, 13 Dec 2017 14:41:17 -0800 (PST) Received: from localhost.localdomain (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id x15sm4464205pfh.27.2017.12.13.14.41.15 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Dec 2017 14:41:15 -0800 (PST) From: Bjorn Andersson To: Ohad Ben-Cohen , Bjorn Andersson Cc: linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/8] remoteproc: Remove depricated crash completion Date: Wed, 13 Dec 2017 14:41:04 -0800 Message-Id: <20171213224111.17864-2-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.15.0 In-Reply-To: <20171213224111.17864-1-bjorn.andersson@linaro.org> References: <20171213224111.17864-1-bjorn.andersson@linaro.org> Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The crash handling now happens in a single execution context, so there's no longer a need for a completion to synchronize this. Signed-off-by: Bjorn Andersson --- drivers/remoteproc/remoteproc_core.c | 10 ---------- include/linux/remoteproc.h | 2 -- 2 files changed, 12 deletions(-) diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index b2f8afee2b67..15e2c4530a0a 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -1028,10 +1028,6 @@ static int rproc_stop(struct rproc *rproc, bool graceful) return ret; } - /* if in crash state, unlock crash handler */ - if (rproc->state == RPROC_CRASHED) - complete_all(&rproc->crash_comp); - rproc->state = RPROC_OFFLINE; dev_info(dev, "stopped remote processor %s\n", rproc->name); @@ -1057,8 +1053,6 @@ int rproc_trigger_recovery(struct rproc *rproc) dev_err(dev, "recovering %s\n", rproc->name); - init_completion(&rproc->crash_comp); - ret = mutex_lock_interruptible(&rproc->lock); if (ret) return ret; @@ -1067,9 +1061,6 @@ int rproc_trigger_recovery(struct rproc *rproc) if (ret) goto unlock_mutex; - /* wait until there is no more rproc users */ - wait_for_completion(&rproc->crash_comp); - /* load firmware */ ret = request_firmware(&firmware_p, rproc->firmware, dev); if (ret < 0) { @@ -1459,7 +1450,6 @@ struct rproc *rproc_alloc(struct device *dev, const char *name, INIT_LIST_HEAD(&rproc->subdevs); INIT_WORK(&rproc->crash_handler, rproc_crash_handler_work); - init_completion(&rproc->crash_comp); rproc->state = RPROC_OFFLINE; diff --git a/include/linux/remoteproc.h b/include/linux/remoteproc.h index 20a9467744ea..2d1058111e57 100644 --- a/include/linux/remoteproc.h +++ b/include/linux/remoteproc.h @@ -406,7 +406,6 @@ enum rproc_crash_type { * @index: index of this rproc device * @crash_handler: workqueue for handling a crash * @crash_cnt: crash counter - * @crash_comp: completion used to sync crash handler and the rproc reload * @recovery_disabled: flag that state if recovery was disabled * @max_notifyid: largest allocated notify id. * @table_ptr: pointer to the resource table in effect @@ -437,7 +436,6 @@ struct rproc { int index; struct work_struct crash_handler; unsigned int crash_cnt; - struct completion crash_comp; bool recovery_disabled; int max_notifyid; struct resource_table *table_ptr;