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: 107359 Delivered-To: patch@linaro.org Received: by 10.140.101.44 with SMTP id t41csp4803004qge; Tue, 11 Jul 2017 05:26:17 -0700 (PDT) X-Received: by 10.98.224.11 with SMTP id f11mr50510906pfh.118.1499775977270; Tue, 11 Jul 2017 05:26:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1499775977; cv=none; d=google.com; s=arc-20160816; b=Ehq9/xnKoc/oGRyPd0VRxpcFJBUInvJfOCgdztBuVclhBZtZeIfzNXssGMpFvEpFpb p3oWlEE5AyX1TCFsY96bI6SNZnufCqnE7ROlSG3PtXdJNn9wL1vOWwf5I5q3iUGSQQKl PCw9jyFVTNh/0guqbiZiYtdlFapKLJquZ8T/QrL2Rs4tNVDc9IxCvQz2YLDxKEsA+kP3 ZHwY9W521s+TGX6ZKCbBOwQVMmqdpY4WsdYjBNobbocfAUL2a9yk5yQtm8ROd8jKZJoa A4sY/snF/JCKvr2lhf+3/aN1jJnb42ov6cxVZpfKezBWP+tsv5117NvRbabhmfrqWDCB qcpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=clTc9FSUU+lwrmhKeKVKidkrrSRPVEb0hllpjjfQYG4=; b=oFwdISvvElKpTqLrIATxUXs75S6bchMSt87pg1rCy7X0X27TzDnsmS/GuoALCv7dgo qpVXBcgSCFflF4DTSuTZt8XuB+90n8Yw55BwojFb4QGdaUEVy3gCWJtFV5T0bOdJlQYt +I4pSLKZ9VzC9GSkLV8WXRODaxyYYiAaxx75fuXegMfxf4eOOk8yQY6dPQBHWm7daPQ7 A63aDXqZbj5OtDV5Srno38CRYuownxGEW4ofiKnDoFNLvZLGyQ+5MXWd9q3MSxi0b8UJ PqTMhwHCzsacmtXeSRTJeihyQvAEOtibLQ6CmtEXdxn9TnMomNyqzRyIGL9P64vzhQEO XmIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=Yj3Onl5W; spf=pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-serial-owner@vger.kernel.org; dmarc=fail (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 q84si7687402pfi.408.2017.07.11.05.26.17; Tue, 11 Jul 2017 05:26:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=Yj3Onl5W; spf=pass (google.com: best guess record for domain of linux-serial-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-serial-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753283AbdGKM0P (ORCPT + 3 others); Tue, 11 Jul 2017 08:26:15 -0400 Received: from mail-lf0-f50.google.com ([209.85.215.50]:32949 "EHLO mail-lf0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752577AbdGKM0O (ORCPT ); Tue, 11 Jul 2017 08:26:14 -0400 Received: by mail-lf0-f50.google.com with SMTP id z78so83717796lff.0 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=VL/pR4g2pqTEClg9ZSbDKMLqvqS5lwtEjFj/qFE05hOKoM0O/fgUOiMylBbgsab2bs QPpqom7jwZE6cj7H2joq/gL494imrMr4+uGgGFLU9zphX7e57fhsfCmzi800RdiuohT3 0xiNxZ3Zq4RCpGclwTVR4WMy4wxPtUV7t/Ng5aJt2xTh2FeuW6hzqcSSWiwaiwv6NewO pt9+XA6utv9UINnRNy8PAPuoU3LSG8ucdWZMJeVmf5ejXzOMFRpQnHZ8fMFEUV0oocHC Ia3HLsTiHoxZ0yATKLJoMOPJkmGqD/+BefZAKelHqN0wVnGTL6/9gYkxg+2Uhi9bFmO/ Ar0Q== X-Gm-Message-State: AIVw110VnxHRHzxH+/g9qFJxw1YUtqfPHQKjzr/LlY+RQ16oNRDXWo67 iqkRRE8F8jfWkpcM 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-serial-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-serial@vger.kernel.org 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(+) -- 2.9.4 -- To unsubscribe from this list: send the line "unsubscribe linux-serial" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Acked-by: Philipp Zabel Signed-off-by: Philipp Zabel Reviewed-by: Linus Walleij 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, };