From patchwork Mon Oct 28 10:10:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "\(Exiting\) Baolin Wang" X-Patchwork-Id: 177896 Delivered-To: patch@linaro.org Received: by 2002:a92:409a:0:0:0:0:0 with SMTP id d26csp3169327ill; Mon, 28 Oct 2019 03:11:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqyxtA/Zukb0F2k4iIM295iwMk7aUFIgM/8hlVsy0A/S+pJbk/T94S2LVnvWZ9efkDYt2A7e X-Received: by 2002:a17:906:79c9:: with SMTP id m9mr15206208ejo.297.1572257483607; Mon, 28 Oct 2019 03:11:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572257483; cv=none; d=google.com; s=arc-20160816; b=FpuO6W5rQhj/CLhXhF8LhH4+t+k68zA0VfEp0zof9hID+H+C7yrKUQ0ptpoVg0ibHG 1Xw70aTRjYOg5+XGNTeqLuhr6lUPNPcQOguwdArYDtT15Pm/QkKQQ5GVKI26EP3cqThD vxrnt3Hz+NWbqagXTNaossmfgxYo0sLo7bpIecKkxGB0BwVPoSbwVdFrMBarO9h/vB0m +KkTj6SlRDfJvTUZJc+mqReX3VXqZhuKJmStQRma2KrLDMqkbRIJIzvNBBIVsNtSVVsl 2IiGazet5vieo7Q/R2CWVtFIaAFTfEc49oIAL6VN8VpCVCCvMxU6EIMxKw/yW2vZThnB bYPQ== 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; bh=1p7hyilQyLC0LoGK1FT1eESXa0Fk3YdfBZS2estKH68=; b=GaMlSBaFFNqOGWdwEviUIx4f08J4BkQRVfMF/BTvUqQIUlKPW9Gn2qu+iv1MgjAfG1 t8xp8Io/LE324Uz+9mrBNKUHDpml7V0WMU74mHM/s71oG4HI67CwjDw+aZn2JZCackWZ x1b4il7oEJ4jwt4AwjidihHcgrF8eNO2wf5bDzeAGyuPPold8nvezTd+ZwbwkhvAV3WS ZeGy2qQnfM7nl+8x4N9aLxsq3GwMvnQBuuht8iamd4lHpVq9/1qtyaivDyvEAR1XhMuK czuQ94iPHmuU0wMEhzlmV6w5Ygmrrs98Nb+Lm+MfhGWaPc5xwSzodX1ArVdlxmp1Uega 4bzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=cucz40bZ; spf=pass (google.com: best guess record for domain of linux-spi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-spi-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 b15si6061344ejd.66.2019.10.28.03.11.23; Mon, 28 Oct 2019 03:11:23 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-spi-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=cucz40bZ; spf=pass (google.com: best guess record for domain of linux-spi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-spi-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 S1732826AbfJ1KLT (ORCPT + 2 others); Mon, 28 Oct 2019 06:11:19 -0400 Received: from mail-pg1-f193.google.com ([209.85.215.193]:36614 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732215AbfJ1KLT (ORCPT ); Mon, 28 Oct 2019 06:11:19 -0400 Received: by mail-pg1-f193.google.com with SMTP id j22so575100pgh.3 for ; Mon, 28 Oct 2019 03:11:19 -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=1p7hyilQyLC0LoGK1FT1eESXa0Fk3YdfBZS2estKH68=; b=cucz40bZRRrdO+e+HJGqz+I/9B2vU7e56mSOqqOdRHE/RZPibLqsfWu1ch2dr7DHX3 lqPPvTD3byOFkERnOlHE0oRmOu4pFTqY5GSRau/NsxvRJObzn6E7FepKen7ivRt3F2+d Ct+POSt0czcTq39fvtm/uE0My3IEVK9mjVs8Bqqh+3Qvz1S9xL27OrRUcol4rYL1yxep 68CjipFi3LIVl8MGlQ0IvZVKsKrI3qkkpagNYFnm5vNDRvwYkclnvNOHc69BwEokS6N/ MKIIZE9HU94gwOF1hYcY9KoIHqtFyX8Rm44SzDyWvmKc2E54dhz8NYWoOFcl95/a9Zk5 wEjw== 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=1p7hyilQyLC0LoGK1FT1eESXa0Fk3YdfBZS2estKH68=; b=m3RxmUtUfJWRAdfnRD05LG4nS4HbC1C5TDr81gkmrWVTFzc0iXoG2gybphwZEE+wI8 GOGfUNV+e+wWpjsihs56xcmcpHVthOALlwcM+3Mm+V3xGwVUg/pUoP+FXNOwOcYo1E40 lFZJc40S1853J34S+Hbe8HDXfVMqcAtsSjKCAGURHG/NeIbLQ3qtHD5vK7TbO5QCbeIk s22Nix/NQv7w+/JhvrP6htbwjBJbCGML4TVYISqQWukxIuuFmDzJ4cFTpFyOYDO4lcQB 0r7oPrTo5yo1ZsA50jKLJy4zkG48KiQY48R2m7bUsjoBHvn0nwXgenPy5yquPa5n/+gL AGWA== X-Gm-Message-State: APjAAAU2ODtCPuEDDVVNHdvSnAoJoHMuQj0/sf0RXi8eecESACnJcbbs oZ1x0monJt6WyC9tObdE/f+phw== X-Received: by 2002:a63:540c:: with SMTP id i12mr10145632pgb.322.1572257478956; Mon, 28 Oct 2019 03:11:18 -0700 (PDT) Received: from baolinwangubtpc.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id m26sm3071872pgd.87.2019.10.28.03.11.14 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 28 Oct 2019 03:11:17 -0700 (PDT) From: Baolin Wang To: broonie@kernel.org Cc: orsonzhai@gmail.com, zhang.lyra@gmail.com, baolin.wang@linaro.org, baolin.wang7@gmail.com, ling_ling.xu@unisoc.com, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 1/2] spi: sprd: adi: Add missing lock protection when rebooting Date: Mon, 28 Oct 2019 18:10:30 +0800 Message-Id: <7b04711127434555e3a1a86bc6be99860cd86668.1572257085.git.baolin.wang@linaro.org> X-Mailer: git-send-email 1.7.9.5 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org From: Lingling Xu When rebooting the system, we should lock the watchdog after configuration to make sure the watchdog can reboot the system successfully. Signed-off-by: Lingling Xu Signed-off-by: Baolin Wang --- drivers/spi/spi-sprd-adi.c | 3 +++ 1 file changed, 3 insertions(+) -- 1.7.9.5 diff --git a/drivers/spi/spi-sprd-adi.c b/drivers/spi/spi-sprd-adi.c index 9a05128..9613cfe 100644 --- a/drivers/spi/spi-sprd-adi.c +++ b/drivers/spi/spi-sprd-adi.c @@ -393,6 +393,9 @@ static int sprd_adi_restart_handler(struct notifier_block *this, val |= BIT_WDG_RUN | BIT_WDG_RST; sprd_adi_write(sadi, sadi->slave_pbase + REG_WDG_CTRL, val); + /* Lock the watchdog */ + sprd_adi_write(sadi, sadi->slave_pbase + REG_WDG_LOCK, ~WDG_UNLOCK_KEY); + mdelay(1000); dev_emerg(sadi->dev, "Unable to restart system\n");