From patchwork Thu Oct 20 12:44:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Farber, Eliav" X-Patchwork-Id: 6185 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp98942wrr; Thu, 20 Oct 2022 06:05:56 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7H1KeC6eqGS7LVv5LBoW7aSNqWdb1ewCvwLnP1KojZP8o3u3JI8aW/a4reG2gAiS6XDYNz X-Received: by 2002:a17:902:7b95:b0:178:ab50:76b5 with SMTP id w21-20020a1709027b9500b00178ab5076b5mr14015521pll.161.1666271145561; Thu, 20 Oct 2022 06:05:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666271145; cv=none; d=google.com; s=arc-20160816; b=qL8yw5s4+ccyKJx0uHY4Aphmt+iparTyuceJ5bUzY+IJFnQudpcjuf0HIZhyx28g7/ U3TcAX+zj1n3CqaBCN1aBqZs0UvguzFmRAoAdlpmIr6qYWwcxyxF5RKyUZI285vebX/t rEss05RKX5N1GzRmF+O1pAPSWlIqwKFOJkYlHKhjk+G22USB9om+iWJOG04pjemMAam9 vzxxVOzd/JSbzawhCHEgGCInOil1h74UtJxPHvxxX+NCwN5qLls2LtEgAFKs8NqMcAyl dti59+pbJMUwCejCCCcMA7ShTpU+XO5ypAPUx0p6vyJO/POqbSXF7CM86oLuIrZMwylR echg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=g+Mj6CRyj2LV1ySn2gOnQJn4NQ7XWVLANWajuKVQIGI=; b=yrQxw4DYO9E1RkULP1nJUyARperiwi/yJUxwe06B8bm8R3P3UMFp0nB8swjKNC0U8P jDy6+NRZokBJrJUfGiwqMVxobRIIO5DBarycpZ1N3vXqJyUUxTRa56COssviraRwu1iV ZzRgZkTnBUGiudE6727KaqjjSOga+XP90LqFFvpX239PnKkVCSKLST2KKnGrIHWXV/no ixiIvef4NeiUB+ZGXAfPqdya7AVtsHgYO89i4pRB+2IM+pq2Aqj1vsbc6J0dfG9hcBoS ASTr/GEw2mlH3magFa1BW/U3DW96q/uuvdbQoAYqK+io2ppBPPlbazr4HvQ9k3gQ+5En lWvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=eQZ0V3ZL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k10-20020a056a00134a00b00562fc008395si21804968pfu.341.2022.10.20.06.05.20; Thu, 20 Oct 2022 06:05:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amazon.com header.s=amazon201209 header.b=eQZ0V3ZL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amazon.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230217AbiJTMpK (ORCPT + 99 others); Thu, 20 Oct 2022 08:45:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230136AbiJTMpH (ORCPT ); Thu, 20 Oct 2022 08:45:07 -0400 Received: from smtp-fw-6002.amazon.com (smtp-fw-6002.amazon.com [52.95.49.90]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E09AFF8FE; Thu, 20 Oct 2022 05:45:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1666269905; x=1697805905; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=g+Mj6CRyj2LV1ySn2gOnQJn4NQ7XWVLANWajuKVQIGI=; b=eQZ0V3ZLWnl1AWwHWO4dXzuw7D7RDcRajyUkDSx0x6P0rih0T3HIOIl6 fNe27++bUIJ314uzrHiM87S5W56RQDZY//nRY4cRsDEiLEBudJbxaHOH6 w6mHufeVyF5q9TdJxhhTgsOyKgLyJ6NMw++USa7i5WEiFg1tIfCHcVOQ2 o=; X-IronPort-AV: E=Sophos;i="5.95,198,1661817600"; d="scan'208";a="257694944" Received: from iad12-co-svc-p1-lb1-vlan3.amazon.com (HELO email-inbound-relay-iad-1a-e823fbde.us-east-1.amazon.com) ([10.43.8.6]) by smtp-border-fw-6002.iad6.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Oct 2022 12:45:02 +0000 Received: from EX13MTAUWB001.ant.amazon.com (iad12-ws-svc-p26-lb9-vlan3.iad.amazon.com [10.40.163.38]) by email-inbound-relay-iad-1a-e823fbde.us-east-1.amazon.com (Postfix) with ESMTPS id 30B70C0A0C; Thu, 20 Oct 2022 12:44:59 +0000 (UTC) Received: from EX19D013UWA004.ant.amazon.com (10.13.138.207) by EX13MTAUWB001.ant.amazon.com (10.43.161.207) with Microsoft SMTP Server (TLS) id 15.0.1497.42; Thu, 20 Oct 2022 12:44:59 +0000 Received: from EX13MTAUEB002.ant.amazon.com (10.43.60.12) by EX19D013UWA004.ant.amazon.com (10.13.138.207) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.1118.15; Thu, 20 Oct 2022 12:44:59 +0000 Received: from dev-dsk-farbere-1a-46ecabed.eu-west-1.amazon.com (172.19.116.181) by mail-relay.amazon.com (10.43.60.234) with Microsoft SMTP Server id 15.0.1497.42 via Frontend Transport; Thu, 20 Oct 2022 12:44:58 +0000 Received: by dev-dsk-farbere-1a-46ecabed.eu-west-1.amazon.com (Postfix, from userid 14301484) id 2E7284BBA; Thu, 20 Oct 2022 12:44:58 +0000 (UTC) From: Eliav Farber To: , , , , , , CC: , , , , , , , , Subject: [PATCH v2] edac: fix period calculation in edac_device_reset_delay_period() Date: Thu, 20 Oct 2022 12:44:58 +0000 Message-ID: <20221020124458.22153-1-farbere@amazon.com> X-Mailer: git-send-email 2.37.1 MIME-Version: 1.0 X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_SPF_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747207506779463568?= X-GMAIL-MSGID: =?utf-8?q?1747211932734551883?= Fix period calculation in case user sets a value of 1000. The input of round_jiffies_relative() should be in jiffies and not in milli-seconds. Signed-off-by: Eliav Farber Signed-off-by: Eliav Farber Signed-off-by: Borislav Petkov (AMD) --- v2 --> v1: - Fix the bug without modifying jiffs which is used to set edac_dev->delay. drivers/edac/edac_device.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/edac/edac_device.c b/drivers/edac/edac_device.c index 19522c568aa5..e944dd9b3593 100644 --- a/drivers/edac/edac_device.c +++ b/drivers/edac/edac_device.c @@ -398,13 +398,13 @@ void edac_device_reset_delay_period(struct edac_device_ctl_info *edac_dev, { unsigned long jiffs = msecs_to_jiffies(value); - if (value == 1000) - jiffs = round_jiffies_relative(value); - edac_dev->poll_msec = value; edac_dev->delay = jiffs; - edac_mod_work(&edac_dev->work, jiffs); + if (value == 1000) + edac_mod_work(&edac_dev->work, round_jiffies_relative(jiffs)); + else + edac_mod_work(&edac_dev->work, jiffs); } int edac_device_alloc_index(void)