From patchwork Tue Jul 11 12:26:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 9834593 X-Patchwork-Delegate: sboyd@codeaurora.org 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 A3E6160318 for ; Tue, 11 Jul 2017 12:26:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 903D022B26 for ; Tue, 11 Jul 2017 12:26:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8060B28429; Tue, 11 Jul 2017 12:26:17 +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.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham 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 C024D22B26 for ; Tue, 11 Jul 2017 12:26:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754061AbdGKM0P (ORCPT ); Tue, 11 Jul 2017 08:26:15 -0400 Received: from mail-lf0-f49.google.com ([209.85.215.49]:34197 "EHLO mail-lf0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752619AbdGKM0O (ORCPT ); Tue, 11 Jul 2017 08:26:14 -0400 Received: by mail-lf0-f49.google.com with SMTP id t72so83618288lff.1 for ; Tue, 11 Jul 2017 05:26:14 -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=Zo8x+2ZzH7ij+9K0Rwbaxx21takp/UR4YVbuvGK6lh4=; b=Yj3Onl5Wtv1zmuCW23LkZ0YIitWGLzAgyVC0Q6o9VHmFL87dEGvGrKCGZePFuepUtQ e4z29ea5TuKPDQUtLLLc8BT1cahTsfV/H/EEedwm9PSKnuJdCmS6G+q1ugm/zzEsHXun 2x/kdtUeyDjyX+4jgIRwBEeEpjKINTN/6YtDo= 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=Zo8x+2ZzH7ij+9K0Rwbaxx21takp/UR4YVbuvGK6lh4=; b=MUTVhJZZV0tGej6Q3zBpJZHtY5e+yCb7ti7jpe0FiKL35qTQWoE4kT6eCopkgn70W3 AENNrvQzBb2NTmFRQfTHwuOTCGCr3xVywJtKksYpwbeLKu+VhrqHv84JbwkCXnE0w3VH geuehFtXMbbMAb7nudwfSPL93OAVcDbpGPR9jFdpOQ73e33qaQTZ7ZHSbbdk4JXeqGhF 8UroRJVCA75Wmgc1aqvygmVLHPtmciATNFdn10aARz39ilKTqM2E95YgS9bOwbSvv+on zKmuK+voiMcDSpSzCAh8F5+61BARcUrgPbcinZyhBnJaBku9gb4BwsVcjUoYnW/M7KWp LR5Q== X-Gm-Message-State: AIVw11264+DT9lGiKordSLfoGkJEtgcxGeJ3MYhuE1N2Y5sWGVILvb2S CNF+JBwt9IIL1/bB X-Received: by 10.25.89.82 with SMTP id n79mr3104656lfb.179.1499775973243; Tue, 11 Jul 2017 05:26:13 -0700 (PDT) Received: from fabina.bredbandsbolaget.se (c-8d7271d5.014-348-6c756e10.cust.bredbandsbolaget.se. [213.113.114.141]) by smtp.gmail.com with ESMTPSA id 19sm2959845ljv.62.2017.07.11.05.26.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Jul 2017 05:26:11 -0700 (PDT) From: Linus Walleij To: Michael Turquette , Stephen Boyd , Philipp Zabel , linux-clk@vger.kernel.org Cc: Janos Laube , Paulius Zaleckas , linux-arm-kernel@lists.infradead.org, Hans Ulli Kroll , Florian Fainelli , Linus Walleij , Joel Stanley , Greg Kroah-Hartman , linux-serial@vger.kernel.org Subject: [PATCH] clk: gemini: Fix reset regression Date: Tue, 11 Jul 2017 14:26:01 +0200 Message-Id: <20170711122601.17745-1-linus.walleij@linaro.org> X-Mailer: git-send-email 2.9.4 Sender: linux-clk-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP commit e2860e1f62f2 ("serial: 8250_of: Add reset support") introduced reset support for the 8250_of driver. However it unconditionally uses the assert/deassert pair to deassert reset on the device at probe and assert it at remove. This does not work with systems that have a self-deasserting reset controller, such as Gemini, that recently added a reset controller. As a result, the console will not probe on the Gemini with this message: Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled of_serial: probe of 42000000.serial failed with error -524 This (-ENOTSUPP) is the error code returned by the deassert() operation on self-deasserting reset controllers. To work around this, implement dummy .assert() and .deassert() operations in the Gemini combined clock and reset controller. This fixes the issue on this system. Cc: Joel Stanley Cc: Philipp Zabel Cc: Greg Kroah-Hartman Cc: linux-serial@vger.kernel.org Fixes: e2860e1f62f2 ("serial: 8250_of: Add reset support") Signed-off-by: Linus Walleij --- This is the solution suggested by Philipp, I think. --- drivers/clk/clk-gemini.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/clk/clk-gemini.c b/drivers/clk/clk-gemini.c index c391a49aaaff..b4cf2f699a21 100644 --- a/drivers/clk/clk-gemini.c +++ b/drivers/clk/clk-gemini.c @@ -237,6 +237,18 @@ static int gemini_reset(struct reset_controller_dev *rcdev, BIT(GEMINI_RESET_CPU1) | BIT(id)); } +static int gemini_reset_assert(struct reset_controller_dev *rcdev, + unsigned long id) +{ + return 0; +} + +static int gemini_reset_deassert(struct reset_controller_dev *rcdev, + unsigned long id) +{ + return 0; +} + static int gemini_reset_status(struct reset_controller_dev *rcdev, unsigned long id) { @@ -253,6 +265,8 @@ static int gemini_reset_status(struct reset_controller_dev *rcdev, static const struct reset_control_ops gemini_reset_ops = { .reset = gemini_reset, + .assert = gemini_reset_assert, + .deassert = gemini_reset_deassert, .status = gemini_reset_status, };