From patchwork Fri Oct 26 11:16:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thierry Reding X-Patchwork-Id: 10657249 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A2ED1109C for ; Fri, 26 Oct 2018 11:21:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8F2C22BF69 for ; Fri, 26 Oct 2018 11:21:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 812692BFA4; Fri, 26 Oct 2018 11:21:31 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,DKIM_VALID,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 071302BF69 for ; Fri, 26 Oct 2018 11:21:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=MN9LLMFoEs5iaym9jVE1qQ8uWvr5mlX7no0b70SexVA=; b=L2T9Nk+3tEkt+b lB+uhUi9ATnzo/w4v0zq+gitQiSRvxDBeZf+6bQJRI7I++DVm9ROwlsZVN7TsbwsruYOBC1vLUOzM FKOBcYaw0I/q6+8/yemlpf3HSNlLEHyGrJhAnLWjetIgi19ECGMjQBGiP4alPvMb9aLrWoIvgvwCu LPRtSQpXurqErJu9E1iWlXpl5cGDzdUmKSnmVxOvckY0JGh437cypkbP+HveWqDpq5vXn7YgoerJZ yv5dRpjhsFH1iMglwOa131tsZlK5hkYrIdmsCVcSRI/AfLjEcnvIPU34oVZCsFu1VwOqAJcLu8DmW CMcKO7nHVV2gwVGm7ndg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gG0B2-0006jj-MA; Fri, 26 Oct 2018 11:21:16 +0000 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gG06v-0003fO-VS for linux-arm-kernel@lists.infradead.org; Fri, 26 Oct 2018 11:17:18 +0000 Received: by mail-wr1-x442.google.com with SMTP id u1-v6so971144wrn.0 for ; Fri, 26 Oct 2018 04:16:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2sZwP3mlc7VxxXlW13/auVGX7x7GQ4BVbqowzB5gMCg=; b=pASvG5zWUBOpsGY2JT9/6cknbvnC7WYynrEcIvv/AfzfW1m+vZhzTfHFXIvAgCCwav ylmvlSrGc42yZ47+pb092xmPd4aREgPAQo0QG+4QpkBt0HPjvrg0rxlBD75c12htHPU9 rGAqiaEcOfGY1xTFqx3rMv06Tx5jkLdiP+2pqRuB2rAh+GCY+Ltw5uv8ykZodzgigO9W Xxb6CD7bFU4TbiOWvsq3/xI+hdYELe4HRPXlJRJcZjU2K0YGOA2YeIWb213yz0sAZsVs ORtQWekQ/yCaZGDY3dKf79fBe/e5AyZHvpo8M3hn14kpNGicFfmbVhYM8HmThTntLUaa bO+A== 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:mime-version:content-transfer-encoding; bh=2sZwP3mlc7VxxXlW13/auVGX7x7GQ4BVbqowzB5gMCg=; b=MuMXeK4WgpDhuPgzI9Q19jl3lJYq60BKD8kFDHPvIMmxd+jVGlsbCvmMom4x4oKuRV q9x9qtBbqd6F3LNUGU8S6nvheD9oAjCLqJ1umbIQvs7F9yOvWiCbccDh7+9H0GJWiY98 NBD59aAXfO2cbyK8c6HBYYQIVTNXanD4slcDpE/1p+lSIEOQF3Icrnxjc1mgzzeDXz3j exWbxLuat+tVF4g5GTXYVJiE+Rl4b/Z798UyYuSX7JBRJB9mtGyHNxUE7aUCxXVinPMu izF8tS3T0TirdN8NsKZZF1IalAGrsd1g8SsmAurmZ7Yi/Ud9DJ2EH+EDfY2UTZzWSa9k AAWw== X-Gm-Message-State: AGRZ1gLRifGOMY938ShkcmIruGHimM2jL+/tOV6yD4raKuhybRdZ0HzP 1tkADm8BChbRSxACGy40Jp0= X-Google-Smtp-Source: AJdET5cUmTiwi5a/EEOSbpLZjBgpKvmVAZd7+401Zl3v8ZujdGTBUrIWf/uWZ/J1UQhmhRB/PAh2EQ== X-Received: by 2002:adf:cd0c:: with SMTP id w12-v6mr5496264wrm.67.1540552610102; Fri, 26 Oct 2018 04:16:50 -0700 (PDT) Received: from localhost (pD9E511F8.dip0.t-ipconnect.de. [217.229.17.248]) by smtp.gmail.com with ESMTPSA id a2-v6sm1743870wmf.12.2018.10.26.04.16.49 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 26 Oct 2018 04:16:49 -0700 (PDT) From: Thierry Reding To: Thierry Reding , Jassi Brar , Greg Kroah-Hartman Subject: [PATCH 5/9] mailbox: tegra-hsp: Add suspend/resume support Date: Fri, 26 Oct 2018 13:16:34 +0200 Message-Id: <20181026111638.10759-6-thierry.reding@gmail.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181026111638.10759-1-thierry.reding@gmail.com> References: <20181026111638.10759-1-thierry.reding@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181026_041702_093178_65FBF4E1 X-CRM114-Status: GOOD ( 14.73 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Mika Liljeberg , Mikko Perttunen , Timo Alho , linux-serial@vger.kernel.org, Jiri Slaby , linux-tegra@vger.kernel.org, Pekka Pessi , Jon Hunter , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Thierry Reding Upon resuming from a system sleep state, the interrupts for all active shared mailboxes need to be reenabled, otherwise they will not work. Signed-off-by: Thierry Reding --- drivers/mailbox/tegra-hsp.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/drivers/mailbox/tegra-hsp.c b/drivers/mailbox/tegra-hsp.c index d070c8e38375..043f7173af8f 100644 --- a/drivers/mailbox/tegra-hsp.c +++ b/drivers/mailbox/tegra-hsp.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include @@ -802,6 +803,23 @@ static int tegra_hsp_remove(struct platform_device *pdev) return 0; } +static int tegra_hsp_resume(struct device *dev) +{ + struct tegra_hsp *hsp = dev_get_drvdata(dev); + unsigned int i; + + for (i = 0; i < hsp->num_sm; i++) { + struct tegra_hsp_mailbox *mb = &hsp->mailboxes[i]; + + if (mb->channel.chan->cl) + tegra_hsp_mailbox_startup(mb->channel.chan); + } + + return 0; +} + +static SIMPLE_DEV_PM_OPS(tegra_hsp_pm_ops, NULL, tegra_hsp_resume); + static const struct tegra_hsp_db_map tegra186_hsp_db_map[] = { { "ccplex", TEGRA_HSP_DB_MASTER_CCPLEX, HSP_DB_CCPLEX, }, { "bpmp", TEGRA_HSP_DB_MASTER_BPMP, HSP_DB_BPMP, }, @@ -821,6 +839,7 @@ static struct platform_driver tegra_hsp_driver = { .driver = { .name = "tegra-hsp", .of_match_table = tegra_hsp_match, + .pm = &tegra_hsp_pm_ops, }, .probe = tegra_hsp_probe, .remove = tegra_hsp_remove,