Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1040145ybg; Wed, 10 Jun 2020 22:24:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzRtYZ2deUA/7y2WAaVSA33KFKjgyn+Bc8YFwOn2AE08FAEmptydOxr5jaRtzUSZSchPfhy X-Received: by 2002:a17:906:c455:: with SMTP id ck21mr6565096ejb.342.1591853095477; Wed, 10 Jun 2020 22:24:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591853095; cv=none; d=google.com; s=arc-20160816; b=AZnuiRlBnGz37oCefROJaZfUanRc5JxGhu5Yp1+bo57otTZLMEUe+YbOX9nscMEI9n +/hdOMgXmk+/o/5RKBc1fKCbS4DFKu8tnb4ONJYQeAS5NfX2FKhp5Iwf1rAL5RpWCrqg jPvXme9vThfe3/ycHVzhMHUUgv/UOnHAvb76zD6d/FghfLULXMLkoa1D/boPXjJlT7qx RA8uOmsRwxIUFtd3HOVkt4Mtn/hCOg818rwVOnpPYznfiP+Vllfc9qET/OmaXvEjB+rM 8caQ9t/FRfLv/66D4WdVDqMcJ7UGHPypcEzmuNpqEPlyTyXG+xrmXOMCl0qzIyTa8du/ L/Sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=1ILMwubnJQNPNAjEKJe3Og6tiFfzI6Q6shWaNu3nPh8=; b=o7SNlgi4xasH6pdoczW7LlLNKXdp6Fk4uOSqEUQzcmsQMQvt7gYw33tSyz+CEbviTN FbvPHmat7OzqylR53cLVJDy4+00E2d3d6DmN+YYjncCO6XwtV/nvbphH4sH1mTqsyyCJ 9f1uYPxfNbaopcz15KHOn+G81ULKuXhnP0GnA3SbAPp6uY+yH3LzRUEnxPpUZP8CEDux qal2G2k9FvxlnOkzEgdfBKa3rB2jeDoFcu/FSOnQVm3H3HfTs1KctTIelCg5S7BvOCXa HIMV8ifChaHBPJMeO+W7vVa7ksIxlcb6hT+RUiZxH53EUbJIEGB5hqu8FZydSsKTKVDw nuiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=OigtWWGO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n17si1379392ejg.418.2020.06.10.22.24.17; Wed, 10 Jun 2020 22:24:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=OigtWWGO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726316AbgFKFVT (ORCPT + 99 others); Thu, 11 Jun 2020 01:21:19 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:59778 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725300AbgFKFVT (ORCPT ); Thu, 11 Jun 2020 01:21:19 -0400 X-UUID: 68ba96c5a4ca469db000851d4e9734a8-20200611 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=1ILMwubnJQNPNAjEKJe3Og6tiFfzI6Q6shWaNu3nPh8=; b=OigtWWGO4cCp1tK5BSPHrT/5XYGMOAJlqXwLjX4JX68TjxpOAtkRWyITFcjuSPaGgniR/cM62wNPz3VMa8sIUvc37/W1J6f2e+jLCAKrpuXy5ejfsxIUNarNEYuBzaRS6brb4g0kQGgjVNFvuMTW7K0pcmpMfk5MzFZbO2OBszI=; X-UUID: 68ba96c5a4ca469db000851d4e9734a8-20200611 Received: from mtkexhb02.mediatek.inc [(172.21.101.103)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 1465615967; Thu, 11 Jun 2020 13:21:12 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs02n2.mediatek.inc (172.21.101.101) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 11 Jun 2020 13:21:11 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 11 Jun 2020 13:21:09 +0800 From: Stanley Chu To: , , , , , CC: , , , , , , , , , , , , , Stanley Chu Subject: [PATCH v4] scsi: ufs: Fix imprecise load calculation in devfreq window Date: Thu, 11 Jun 2020 13:21:09 +0800 Message-ID: <20200611052109.22700-1-stanley.chu@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: 15808926AE20E5473D36ADD8ADA4232D6CE1F132A283B18C20BE289C9826830A2000:8 X-MTK: N Content-Transfer-Encoding: base64 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org VGhlIFVGUyBsb2FkIGNhbGN1bGF0aW9uIGlzIGJhc2VkIG9uICJ0b3RhbF90aW1lIiBhbmQgImJ1 c3lfdGltZSIgaW4gYQ0KZGV2ZnJlcSB3aW5kb3cuIEhvd2V2ZXIsIHRoZSBzb3VyY2Ugb2YgdGlt ZSBpcyBkaWZmZXJlbnQgZm9yIGJvdGgNCnBhcmFtZXRlcnM6ICJidXN5X3RpbWUiIGlzI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