Received: by 2002:a05:7412:251c:b0:e2:908c:2ebd with SMTP id w28csp793221rda; Sun, 22 Oct 2023 09:58:47 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHU8v4qNIg6VuOSRDP29PJbrTTOVUaN57MVNNGsOjPiYYW7fqdIhT15orjZQkmzrzSy2ySK X-Received: by 2002:a05:6a20:a29a:b0:16b:e46e:1246 with SMTP id a26-20020a056a20a29a00b0016be46e1246mr5967584pzl.30.1697993926837; Sun, 22 Oct 2023 09:58:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697993926; cv=none; d=google.com; s=arc-20160816; b=qC9nVkS1EXjGOmLmfLMwVDCcs7iNQxD7/iBDN9l+CayicRv5eu4c+IXaTpVTkPiZtv lkOJRJ5Am82HyTZ5tJ7BGT3oN/eLli2HWsYi9GcwU6E75bH9tA1y3TMJCAUP+94faLM+ Toz7X1jy20ejwVObOY7c3ZTXQWbUQInI4KGurZEJa8VwacxPNJfjFK42Xi39+4BAyY4e aXWMzVh07Xd2Y1z9aEVZKIGFv0EXKFg7U7A9EyZmEjCKdrIn/LTtLLqEs81Bc7IH6aTi VQiz5UpQkBGQ/EQDMCRrtY7tMo61D12D7NJHzIvgVrjXxLE1eOcUPkf1godY06XndMld /IuQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:sender:dkim-signature; bh=IwkHwhxesLPKqjBuQHsCOV/nzGIgUui9PvuqFp60Gu4=; fh=RQoMKabLDBX0fWtOMNEMFDECs02Ms2nUtf3S7H9wVfs=; b=zynI2J8Sy519PLaQg5xE9Ibn3z5nnXKVPlGYt7RKCDp5AkjPhvQLcI2hB2ysuHHJ1B 7qfhlLRXwIBP57uXgQku9qzFQXiXlgKJB4J10WBTPah7cUNFYibJ0Azx4fZys70N5nFb aWnYk1fG5oaGYf1NCrki/yZxDOAswrSba8rnDsJ/V9OSFxjgXJEcCP8QDg7/vdW/XiF+ RHXENbwukeR+T4btyrQQ1Lcsr3fDbedV6AkmHHcB1dODsPw5SsrqqOyHwbgSXpsxWTY0 RFxDMlNV8p/HUh9ss+siLo7UvM5LOLuN3T01CJwcJephQwEZKY86l/cA8xOkwtcgLH3Y kvLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Psm4wsGp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id z24-20020a656658000000b005740b4723f9si5340358pgv.811.2023.10.22.09.58.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Oct 2023 09:58:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=Psm4wsGp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 71A8C8088A66; Sun, 22 Oct 2023 09:58:44 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231909AbjJVQ6d (ORCPT + 99 others); Sun, 22 Oct 2023 12:58:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229500AbjJVQ6c (ORCPT ); Sun, 22 Oct 2023 12:58:32 -0400 Received: from mail-pf1-x42f.google.com (mail-pf1-x42f.google.com [IPv6:2607:f8b0:4864:20::42f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C3FEEE; Sun, 22 Oct 2023 09:58:28 -0700 (PDT) Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-6b497c8575aso2530892b3a.1; Sun, 22 Oct 2023 09:58:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697993908; x=1698598708; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=IwkHwhxesLPKqjBuQHsCOV/nzGIgUui9PvuqFp60Gu4=; b=Psm4wsGpF2xEcjvz9RxQykfY0kESoRu5NcwVTuAqadyCrudKSOz5aaw8pOGjIzAmlz wPy1O+4Uo2J9upLNDDqmsJJqekbXu59q+mWceos5AG/xb8zUgQJXUmvoJtu6LkVSz+u4 YUHRjntPZ4yo3wa00J+rbgED1xrM4HIWqe+KjELmM3jQGdA3Sbq2i6zVmYT9DiGtNALZ q/8NK7irNlNt5x1kAwiWPCuBYv7oucNUvBSHNraQzXJAjN1ch1CieW3T7YRLcnNrI6KW p2MvaVcZMjIxYz+w8/IPIpP6Ch5QXJPhhIDDq83lrlL821Wbv6pob+QsR4M2fFCF70m2 qnyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697993908; x=1698598708; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=IwkHwhxesLPKqjBuQHsCOV/nzGIgUui9PvuqFp60Gu4=; b=vH8cDK07SFdpcD7oXu7JGQHtciYJnxKlsr1nRCWd2AaG6b+6InHMlhSHowz33Ctex8 ckY0IGe2NQdoVrFf8PXzlWbPq3lNTzS/QlSfF9Fpw20UqJHNWVJna8UT1qlTm1OBlThj jgYz9WXx8dRpnSdJjEwy57b2NakdJwqFosvPCd08xvtkMtUxJzYXP7kiifz/hkVdY08q NGR184XIWHaVM1bKMzMk7QBY3zsDdS/fjZsXeBqxMEFNRnBPpB7BzS8Rsms5aLW3SNPC F0WLwM2/D1wQA8RJXKF9MEAjdmHit8W/oZEJ7hanaqIWdcClV5Uuw4BUap6AN3Gu2Q1j uV6A== X-Gm-Message-State: AOJu0YxpbH+P0XzAza4Rd/x4oYHXLskPHcgW83uhhCXz8NQzjRGMqRvf aSjKh9AkSaQr32lGIC6cbBk= X-Received: by 2002:a05:6a20:1602:b0:153:7515:9919 with SMTP id l2-20020a056a20160200b0015375159919mr9062907pzj.21.1697993907684; Sun, 22 Oct 2023 09:58:27 -0700 (PDT) Received: from ?IPV6:2600:1700:e321:62f0:329c:23ff:fee3:9d7c? ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id z11-20020aa79e4b000000b006b725b2158bsm4790807pfq.41.2023.10.22.09.58.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 22 Oct 2023 09:58:27 -0700 (PDT) Sender: Guenter Roeck Message-ID: <1fae4d2c-4bc7-f169-7b84-501674a82ee4@roeck-us.net> Date: Sun, 22 Oct 2023 09:58:26 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH] sbsa_gwdt: Calculate timeout with 64-bit math Content-Language: en-US To: Darren Hart Cc: linux-kernel@vger.kernel.org, Vanshidhar Konda , Wim Van Sebroeck , linux-watchdog@vger.kernel.org, linux-arm-kernel@lists.infradead.org, stable@vger.kernel.org References: <7d1713c5ffab19b0f3de796d82df19e8b1f340de.1695286124.git.darren@os.amperecomputing.com> From: Guenter Roeck In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.1 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Sun, 22 Oct 2023 09:58:44 -0700 (PDT) On 10/14/23 02:12, Darren Hart wrote: > On Tue, Sep 26, 2023 at 05:45:13AM -0700, Guenter Roeck wrote: >> On Thu, Sep 21, 2023 at 02:02:36AM -0700, Darren Hart wrote: >>> Commit abd3ac7902fb ("watchdog: sbsa: Support architecture version 1") >>> introduced new timer math for watchdog revision 1 with the 48 bit offset >>> register. >>> >>> The gwdt->clk and timeout are u32, but the argument being calculated is >>> u64. Without a cast, the compiler performs u32 operations, truncating >>> intermediate steps, resulting in incorrect values. >>> >>> A watchdog revision 1 implementation with a gwdt->clk of 1GHz and a >>> timeout of 600s writes 3647256576 to the one shot watchdog instead of >>> 300000000000, resulting in the watchdog firing in 3.6s instead of 600s. >>> >>> Force u64 math by casting the first argument (gwdt->clk) as a u64. Make >>> the order of operations explicit with parenthesis. >>> >>> Fixes: abd3ac7902fb ("watchdog: sbsa: Support architecture version 1") >>> Reported-by: Vanshidhar Konda >>> Signed-off-by: Darren Hart >>> Cc: Wim Van Sebroeck >>> Cc: Guenter Roeck >>> Cc: linux-watchdog@vger.kernel.org >>> Cc: linux-kernel@vger.kernel.org >>> Cc: linux-arm-kernel@lists.infradead.org >>> Cc: # 5.14.x >> >> Reviewed-by: Guenter Roeck > > Guenter or Wim, I haven't seen this land in the RCs or in next yet. Have > you already picked it up? Anything more needed from me? > > Thanks, > Sorry, I am suffering from what I can only describe as a severe case of maintainer/reviewer PTSD, and I have yet to find a way of dealing with that. Guenter