From patchwork Tue Oct 29 01:29:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Chan X-Patchwork-Id: 13854321 Received: from mail-pg1-f178.google.com (mail-pg1-f178.google.com [209.85.215.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 200A780054; Tue, 29 Oct 2024 01:31:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730165483; cv=none; b=J1YQXK3gLLVHWkMJERqaQfQfFNUsNwOpP45txZmv1q6g8fF1yeVkmtZP+fHJ4BFdJs6fmMB9m3Ix3MMtQ0cd8m/a6gPlqGJ2OSFYThdYBuaZPt1hBntrwks5qOlQpIO0DjdBvE8IfrAPyfUekpUvkdkKNRZWJwv1aIJ6SH+dj80= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730165483; c=relaxed/simple; bh=VqoKn0i085NYBXXwHkUOwL2fkvCdHCGrJiPFJ/U3NUI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LxXqMfh2SzD2MkFdbAIz5vTF/OP7fi6ztxmDXbWb/X/e/lEg0uG5ejJZ4mE2foijm7d/VVezYGWNXHOwld+kT5L3A5snvNMr3SU6vIoci+4V+C1BchoRYXOoPK1icsi05zQyEcK1vGxrg5k2hy6r7c2+A+llj9akM3SgPB++3pI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Wp9NUbcl; arc=none smtp.client-ip=209.85.215.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Wp9NUbcl" Received: by mail-pg1-f178.google.com with SMTP id 41be03b00d2f7-7edb6879196so3142527a12.3; Mon, 28 Oct 2024 18:31:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730165481; x=1730770281; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ZLlIgnNlMn/MjFz2hg97vAWrW6LF9UehdPASjV2ScCU=; b=Wp9NUbclnPzUZmYrx5Y2TPFA0/jyqn8XFJ+oGEVtralTmn3ohhszIHeSfflewYH9NK HxG9/lqidsSYXB9gn7rzDxmRJzTaBPXzWSZ/EFomPI+fJdS0HOVCYfNcRKQRhhL9FDCT j49VZr2D3o4OenRwmbQb9TBhuunk8dU4MZ7Wfa5zReCeplGemsdtAOckgQJSezonFL3C oP5RV6fvmXT0l3ss95RIFFo/ekhQngvILqzo+Ap/Hwbnt06M0qlU3rTcxr81ieza/QMs 3rfYqrYftEUvaxlFgn63iYoBNLguD09uha2Uo70GHhWKWX1QDKxQxRqgBQZyOdZSYGlY 7ABg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730165481; x=1730770281; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZLlIgnNlMn/MjFz2hg97vAWrW6LF9UehdPASjV2ScCU=; b=YdiVce+ggQhmwvBb/pFVD+KC9BotaOQF4V6Eu2y7FcBYIvaox4/N9vKEQYKrPJPY0e zAwjegk7P5EotDnOmnJCV060NvpliL9aN7WR4Bcf47tIu/yeEOfcWtof9/e7bO+er+j1 KPtcZRTp2OUJ8Hid3lHds8JzLgOwI9oMyQV29jXJTGpMj8JWkLChL61qHnZ6MAGUJrPt cT1UQenlPSDX7s35Ke15s9CTqdifHGoOzIyxjpvtGi3z+9e89NQoUCLkIycovBuO/9VR 6EQ244c9uLqtc83qkQVqECdrgL8mzQ+3q6WpxeQJIiLKIYnvTtThJzxXgOYhZHixQ1mQ b5JA== X-Forwarded-Encrypted: i=1; AJvYcCV+lrqk0MHDVKtGcUnNrHfGO/H3GhWeUDaOvopKJl0k+wt8MKMJN0Dg6TETDNQZImjxTgV488/e5unfajtIRCI=@vger.kernel.org, AJvYcCX7j9FeLM/B1HuOCKC6xz1nLf5fKEyN1WPYZki2263BN9ElfXhJVa2/5La7+1cXkfjkLM6ChsMYUhlOIo8=@vger.kernel.org X-Gm-Message-State: AOJu0YzLXvYRdT6Wj0yuJ407f7sO8Y3/ncxadnZWx3wP7gtc6t8MFRXL tpYMvmx/dAme93Ea+bOPO2WrBY6y7dEJfA74uRMbfv+uV31I2CeS X-Google-Smtp-Source: AGHT+IFsJ8/5pQAcma2IcNhwC+EoCEWeaDrvUbuERmpkGhRfDc2AJixjHb6s+XFCiJXWVYDvFRJCIg== X-Received: by 2002:a05:6a20:c6ce:b0:1d8:d302:16a7 with SMTP id adf61e73a8af0-1d9a83ab53emr11772805637.3.1730165481451; Mon, 28 Oct 2024 18:31:21 -0700 (PDT) Received: from localhost.localdomain ([59.188.211.160]) by smtp.googlemail.com with ESMTPSA id d2e1a72fcca58-7205791e564sm6686529b3a.17.2024.10.28.18.31.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Oct 2024 18:31:21 -0700 (PDT) From: Nick Chan To: Hector Martin , Sven Peter , Alyssa Rosenzweig , Wim Van Sebroeck , Guenter Roeck , asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Nick Chan , Arnd Bergmann Subject: [PATCH v2 RESEND 1/2] watchdog: apple: Actually flush writes after requesting watchdog restart Date: Tue, 29 Oct 2024 09:29:17 +0800 Message-ID: <20241029013055.45538-2-towinchenmi@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241029013055.45538-1-towinchenmi@gmail.com> References: <20241029013055.45538-1-towinchenmi@gmail.com> Precedence: bulk X-Mailing-List: linux-watchdog@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Although there is an existing code comment about flushing the writes, writes were not actually being flushed. Actually flush the writes by changing readl_relaxed() to readl(). Fixes: 4ed224aeaf661 ("watchdog: Add Apple SoC watchdog driver") Suggested-by: Arnd Bergmann Reviewed-by: Guenter Roeck Signed-off-by: Nick Chan --- drivers/watchdog/apple_wdt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/watchdog/apple_wdt.c b/drivers/watchdog/apple_wdt.c index d4f739932f0b..62dabf223d90 100644 --- a/drivers/watchdog/apple_wdt.c +++ b/drivers/watchdog/apple_wdt.c @@ -130,7 +130,7 @@ static int apple_wdt_restart(struct watchdog_device *wdd, unsigned long mode, * can take up to ~20-25ms until the SoC is actually reset. Just wait * 50ms here to be safe. */ - (void)readl_relaxed(wdt->regs + APPLE_WDT_WD1_CUR_TIME); + (void)readl(wdt->regs + APPLE_WDT_WD1_CUR_TIME); mdelay(50); return 0; From patchwork Tue Oct 29 01:29:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Chan X-Patchwork-Id: 13854322 Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 941B07DA68; Tue, 29 Oct 2024 01:31:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730165487; cv=none; b=TzriD6QFhH1dU+f5LnJ3O+XbHJX/InbHbwJecU6sNjRV9TDFo7QbfmY7TrM3atZ1ZZcTrxvMZBm/1BTatzpKrvTghRrM4jSwvjy1ihA+kPOtoaJvvS+qliwH8UsAQOSUHHus9jRlA10Z65kMo48/g0CA7DTii32Rww1Blh41asE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730165487; c=relaxed/simple; bh=NSHVBWbogICthgN37WJmF2hsHjd0eXsxGqoFlVCPbp4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Hj+ErK8NgJs9DEloaB6LE0uHagSSW1U3+XEL6ocohqU8wc/zvq//b7w1BwB5+eO0Q+hy4U4FDBWQIHsCk/DOZp6mfzMSazJCy/uR520v0iQwSx0mat/xmMC5/rgYx3l0/ZGZQ+bkk6K3Z65mzV5SU58W8xD24xcBlWQ41MQxMtY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=mxfL5b8o; arc=none smtp.client-ip=209.85.210.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="mxfL5b8o" Received: by mail-pf1-f171.google.com with SMTP id d2e1a72fcca58-71e681bc315so3442250b3a.0; Mon, 28 Oct 2024 18:31:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1730165485; x=1730770285; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=F22qCHP6afNbcrGoAQJ3oBUeXfRzjwgHNZ47hyoRqrs=; b=mxfL5b8oX2fwQ7FOUDIK7pbW1pFuk8tygOqj62At2z+bHN9s6e2AlBvO0d1V3d7Jim OUd/tTYEbQh6g7/ISW+mmH/iIf0g0E9IGQij4JIT/EtaOilb9Dm39XK2zqvlsYOK/z/j D3I68Dvc87837YklReAQdERsZVPTzmeyyQQv+U4H3fiUyw1dPlOHznLPqYqamigTO7GS hhRCYxbiSrDRLqQiDLyHbDd3+/ClMIF7cHydOm1VoTxUFQbv6nETwfPPGECm/8TteOWB d3XXqlaQrqkPL2NISUdkyJbuuExInwO0L2fkoB4vKRP/z7vQpULwDJrPkXj3pbbR9v2b 7Xuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730165485; x=1730770285; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=F22qCHP6afNbcrGoAQJ3oBUeXfRzjwgHNZ47hyoRqrs=; b=umsjUm4ywGVOYluaiIbv7BflI+qMK1fUdXLX1DMpqoA+bZ93KcVwNU8Eq+cSSo8yGG keTfuo1mnFriYUpJ+GyAUh9+08xw6VuQsnl9mo1sCeA6gZNvgrom6YA2RIlxxc9sVY8c UE/uhU+ZI8p8AUS3RtGrmJAKdpJeIdKXP0mieBJt+k9gz05+JMOGbpNV9121gUcuL6Nq CrN3KS5b7xVykCgKanEUc5j3JcJP9QyKCenfy1V1P+YmlWY3vKvGPwsmJe7SfIsJcAHF osR8xHCxDRbKGcL5hc1vUfMUEzjW6kcNivCeARF8QPgPwnOvgutAgWP+XSA1jMQHBcmq XKPw== X-Forwarded-Encrypted: i=1; AJvYcCWXMcIVEeAa2bgFpPIcVXYe0Xa9rSUtNGrhmMoez0wRE4OV8k1SVVJ48jisAyukZPwEDM8lszz26ee3lIl3R0A=@vger.kernel.org, AJvYcCXxTiRF3Tsh+PsGgJahq4x87BMuJyfkTrFYl1L6AVtDPpxNhe2Ik1jA5hLMDZKmhL8jwrSKAPauQZSPTQ4=@vger.kernel.org X-Gm-Message-State: AOJu0YzGRonWIj+PRTv/b/KV6XWAZv21LtbqrE7+IbK5N9cWkb9C1wBF nHkpg/sAnqbSMBzpGNtndWALmLU02680EyBYw9/b2eLuXD+ncBad X-Google-Smtp-Source: AGHT+IGyIb7Q8egCdWVoHzLFh6oz2bKRaVNI9AS0F5sLQSVgIeGhhVlP3LwlcUK0ZiaVTtFh86x4rw== X-Received: by 2002:a05:6a00:741e:b0:71e:66e6:ca17 with SMTP id d2e1a72fcca58-720967cfbe7mr578632b3a.9.1730165484691; Mon, 28 Oct 2024 18:31:24 -0700 (PDT) Received: from localhost.localdomain ([59.188.211.160]) by smtp.googlemail.com with ESMTPSA id d2e1a72fcca58-7205791e564sm6686529b3a.17.2024.10.28.18.31.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Oct 2024 18:31:23 -0700 (PDT) From: Nick Chan To: Hector Martin , Sven Peter , Alyssa Rosenzweig , Wim Van Sebroeck , Guenter Roeck , asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-watchdog@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Nick Chan Subject: [PATCH v2 RESEND 2/2] watchdog: apple: Increase reset delay to 150ms Date: Tue, 29 Oct 2024 09:29:18 +0800 Message-ID: <20241029013055.45538-3-towinchenmi@gmail.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241029013055.45538-1-towinchenmi@gmail.com> References: <20241029013055.45538-1-towinchenmi@gmail.com> Precedence: bulk X-Mailing-List: linux-watchdog@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The Apple A8X SoC seems to be slowest at resetting, taking up to around 125ms to reset. Wait 150ms to be safe here. Reviewed-by: Sven Peter Reviewed-by: Guenter Roeck Signed-off-by: Nick Chan --- drivers/watchdog/apple_wdt.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/watchdog/apple_wdt.c b/drivers/watchdog/apple_wdt.c index 62dabf223d90..95d9e37df41c 100644 --- a/drivers/watchdog/apple_wdt.c +++ b/drivers/watchdog/apple_wdt.c @@ -127,11 +127,11 @@ static int apple_wdt_restart(struct watchdog_device *wdd, unsigned long mode, /* * Flush writes and then wait for the SoC to reset. Even though the * reset is queued almost immediately experiments have shown that it - * can take up to ~20-25ms until the SoC is actually reset. Just wait - * 50ms here to be safe. + * can take up to ~120-125ms until the SoC is actually reset. Just + * wait 150ms here to be safe. */ (void)readl(wdt->regs + APPLE_WDT_WD1_CUR_TIME); - mdelay(50); + mdelay(150); return 0; }