From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
stable@vger.kernel.org, Huacai Chen <chenhc@lemote.com>,
John Crispin <john@phrozen.org>,
"Steven J . Hill" <Steven.Hill@imgtec.com>,
Fuxin Zhang <zhangfx@lemote.com>,
Zhangjin Wu <wuzhangjin@gmail.com>,
linux-mips@linux-mips.org, Ralf Baechle <ralf@linux-mips.org>
Subject: [PATCH 4.4 130/138] MIPS: hpet: Increase HPET_MIN_PROG_DELTA and decrease HPET_MIN_CYCLES
Date: Thu, 18 Aug 2016 15:59:00 +0200 [thread overview]
Message-ID: <20160818135612.869180865@linuxfoundation.org> (raw)
In-Reply-To: <20160818135553.377018690@linuxfoundation.org>
4.4-stable review patch. If anyone has any objections, please let me know.
------------------
From: Huacai Chen <chenhc@lemote.com>
commit 3ef06653987d4c4536b408321edf0e5caa2a317f upstream.
At first, we prefer to use mips clockevent device, so we decrease the
rating of hpet clockevent device.
For hpet, if HPET_MIN_PROG_DELTA (minimum delta of hpet programming) is
too small and HPET_MIN_CYCLES (threshold of -ETIME checking) is too
large, then hpet_next_event() can easily return -ETIME. After commit
c6eb3f70d44828 ("hrtimer: Get rid of hrtimer softirq") this will cause
a RCU stall.
So, HPET_MIN_PROG_DELTA must be sufficient that we don't re-trip the
-ETIME check -- if we do, we will return -ETIME, forward the next event
time, try to set it, return -ETIME again, and basically lock the system
up. Meanwhile, HPET_MIN_CYCLES doesn't need to be too large, 16 cycles
is enough.
This solution is similar to commit f9eccf24615672 ("clocksource/drivers
/vt8500: Increase the minimum delta").
By the way, this patch ensures hpet count/compare to be 32-bit long.
Signed-off-by: Huacai Chen <chenhc@lemote.com>
Cc: John Crispin <john@phrozen.org>
Cc: Steven J . Hill <Steven.Hill@imgtec.com>
Cc: Fuxin Zhang <zhangfx@lemote.com>
Cc: Zhangjin Wu <wuzhangjin@gmail.com>
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/13819/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
arch/mips/loongson64/loongson-3/hpet.c | 14 +++++++-------
1 file changed, 7 insertions(+), 7 deletions(-)
--- a/arch/mips/loongson64/loongson-3/hpet.c
+++ b/arch/mips/loongson64/loongson-3/hpet.c
@@ -13,8 +13,8 @@
#define SMBUS_PCI_REG64 0x64
#define SMBUS_PCI_REGB4 0xb4
-#define HPET_MIN_CYCLES 64
-#define HPET_MIN_PROG_DELTA (HPET_MIN_CYCLES + (HPET_MIN_CYCLES >> 1))
+#define HPET_MIN_CYCLES 16
+#define HPET_MIN_PROG_DELTA (HPET_MIN_CYCLES * 12)
static DEFINE_SPINLOCK(hpet_lock);
DEFINE_PER_CPU(struct clock_event_device, hpet_clockevent_device);
@@ -157,14 +157,14 @@ static int hpet_tick_resume(struct clock
static int hpet_next_event(unsigned long delta,
struct clock_event_device *evt)
{
- unsigned int cnt;
- int res;
+ u32 cnt;
+ s32 res;
cnt = hpet_read(HPET_COUNTER);
- cnt += delta;
+ cnt += (u32) delta;
hpet_write(HPET_T0_CMP, cnt);
- res = (int)(cnt - hpet_read(HPET_COUNTER));
+ res = (s32)(cnt - hpet_read(HPET_COUNTER));
return res < HPET_MIN_CYCLES ? -ETIME : 0;
}
@@ -230,7 +230,7 @@ void __init setup_hpet_timer(void)
cd = &per_cpu(hpet_clockevent_device, cpu);
cd->name = "hpet";
- cd->rating = 320;
+ cd->rating = 100;
cd->features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT;
cd->set_state_shutdown = hpet_set_state_shutdown;
cd->set_state_periodic = hpet_set_state_periodic;
next prev parent reply other threads:[~2016-08-18 14:08 UTC|newest]
Thread overview: 64+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <CGME20160818140229uscas1p28936a684c22cfb777077f1c973fad437@uscas1p2.samsung.com>
[not found] ` <20160818135553.377018690@linuxfoundation.org>
2016-08-18 13:56 ` [PATCH 4.4 001/138] usb: gadget: avoid exposing kernel stack Greg Kroah-Hartman
2016-08-18 13:56 ` [PATCH 4.4 002/138] usb: f_fs: off by one bug in _ffs_func_bind() Greg Kroah-Hartman
2016-08-18 13:56 ` [PATCH 4.4 004/138] usb: quirks: Add no-lpm quirk for Elan Greg Kroah-Hartman
2016-08-18 13:57 ` [PATCH 4.4 010/138] arm64: debug: unmask PSTATE.D earlier Greg Kroah-Hartman
2016-08-18 13:57 ` [PATCH 4.4 012/138] tty: serial: msm: Dont read off end of tx fifo Greg Kroah-Hartman
2016-08-18 13:57 ` [PATCH 4.4 014/138] tty/serial: atmel: fix RS485 half duplex with DMA Greg Kroah-Hartman
2016-08-18 13:57 ` [PATCH 4.4 015/138] gpio: pca953x: Fix NBANK calculation for PCA9536 Greg Kroah-Hartman
2016-08-18 13:57 ` [PATCH 4.4 016/138] gpio: intel-mid: Remove potentially harmful code Greg Kroah-Hartman
2016-08-18 13:57 ` [PATCH 4.4 017/138] Bluetooth: hci_intel: Fix null gpio desc pointer dereference Greg Kroah-Hartman
2016-08-18 13:57 ` [PATCH 4.4 018/138] pinctrl: cherryview: prevent concurrent access to GPIO controllers Greg Kroah-Hartman
2016-08-18 13:57 ` [PATCH 4.4 019/138] arm64: dts: rockchip: fixes the gic400 2nd region size for rk3368 Greg Kroah-Hartman
2016-08-18 13:57 ` [PATCH 4.4 020/138] arm64: mm: avoid fdt_check_header() before the FDT is fully mapped Greg Kroah-Hartman
2016-08-18 13:57 ` [PATCH 4.4 022/138] KVM: PPC: Book3S HV: Save/restore TM state in H_CEDE Greg Kroah-Hartman
2016-08-18 13:57 ` [PATCH 4.4 023/138] KVM: MTRR: fix kvm_mtrr_check_gfn_range_consistency page fault Greg Kroah-Hartman
2016-08-18 13:57 ` [PATCH 4.4 044/138] EDAC: Correct channel count limit Greg Kroah-Hartman
2016-08-18 13:57 ` [PATCH 4.4 046/138] ovl: disallow overlayfs as upperdir Greg Kroah-Hartman
2016-08-18 13:57 ` [PATCH 4.4 047/138] remoteproc: Fix potential race condition in rproc_add Greg Kroah-Hartman
2016-08-18 13:57 ` [PATCH 4.4 048/138] ARC: mm: dont loose PTE_SPECIAL in pte_modify() Greg Kroah-Hartman
2016-08-18 13:57 ` [PATCH 4.4 049/138] jbd2: make journal y2038 safe Greg Kroah-Hartman
2016-08-18 13:57 ` [PATCH 4.4 064/138] nfsd: dont return an unhashed lock stateid after taking mutex Greg Kroah-Hartman
2016-08-18 13:57 ` [PATCH 4.4 066/138] iommu/exynos: Suppress unbinding to prevent system failure Greg Kroah-Hartman
2016-08-18 13:57 ` [PATCH 4.4 067/138] iommu/vt-d: Return error code in domain_context_mapping_one() Greg Kroah-Hartman
2016-08-18 13:57 ` [PATCH 4.4 068/138] iommu/amd: Handle IOMMU_DOMAIN_DMA in ops->domain_free call-back Greg Kroah-Hartman
2016-08-18 13:57 ` [PATCH 4.4 069/138] iommu/amd: Init unity mappings only for dma_ops domains Greg Kroah-Hartman
2016-08-18 13:58 ` [PATCH 4.4 070/138] iommu/amd: Update Alias-DTE in update_device_table() Greg Kroah-Hartman
2016-08-18 13:58 ` [PATCH 4.4 071/138] audit: fix a double fetch in audit_log_single_execve_arg() Greg Kroah-Hartman
2016-08-18 13:58 ` [PATCH 4.4 072/138] ARM: dts: sunxi: Add a startup delay for fixed regulator enabled phys Greg Kroah-Hartman
2016-08-18 13:58 ` [PATCH 4.4 074/138] w1:omap_hdq: fix regression Greg Kroah-Hartman
2016-08-18 13:58 ` [PATCH 4.4 076/138] drm/amdgpu: Poll for both connect/disconnect on analog connectors Greg Kroah-Hartman
2016-08-18 13:58 ` [PATCH 4.4 077/138] drm/amdgpu: support backlight control for UNIPHY3 Greg Kroah-Hartman
2016-08-18 13:58 ` [PATCH 4.4 078/138] drm/amdgpu: Disable RPM helpers while reprobing connectors on resume Greg Kroah-Hartman
2016-08-18 13:58 ` [PATCH 4.4 080/138] drm/amdgpu/gmc7: add missing mullins case Greg Kroah-Hartman
2016-08-18 13:58 ` [PATCH 4.4 082/138] drm/radeon: Poll for both connect/disconnect on analog connectors Greg Kroah-Hartman
2016-08-18 13:58 ` [PATCH 4.4 083/138] drm/radeon: fix firmware info version checks Greg Kroah-Hartman
2016-08-18 13:58 ` [PATCH 4.4 086/138] drm/nouveau/gr/nv3x: fix instobj write offsets in gr setup Greg Kroah-Hartman
2016-08-18 13:58 ` [PATCH 4.4 087/138] drm/nouveau/fbcon: fix font width not divisible by 8 Greg Kroah-Hartman
2016-08-18 13:58 ` [PATCH 4.4 088/138] drm: Restore double clflush on the last partial cacheline Greg Kroah-Hartman
2016-08-18 13:58 ` [PATCH 4.4 092/138] balloon: check the number of available pages in leak balloon Greg Kroah-Hartman
2016-08-18 13:58 ` [PATCH 4.4 093/138] ftrace/recordmcount: Work around for addition of metag magic but not relocations Greg Kroah-Hartman
2016-08-18 13:58 ` [PATCH 4.4 095/138] block: add missing group association in bio-cloning functions Greg Kroah-Hartman
2016-08-18 13:58 ` [PATCH 4.4 096/138] block: fix bdi vs gendisk lifetime mismatch Greg Kroah-Hartman
2016-08-18 13:58 ` [PATCH 4.4 097/138] mtd: nand: fix bug writing 1 byte less than page size Greg Kroah-Hartman
2016-08-18 13:58 ` [PATCH 4.4 098/138] mm/hugetlb: avoid soft lockup in set_max_huge_pages() Greg Kroah-Hartman
2016-08-18 13:58 ` [PATCH 4.4 099/138] ALSA: hda: Fix krealloc() with __GFP_ZERO usage Greg Kroah-Hartman
2016-08-18 13:58 ` [PATCH 4.4 100/138] ALSA: hda/realtek - Cant adjust speakers volume on a Dell AIO Greg Kroah-Hartman
2016-08-18 13:58 ` [PATCH 4.4 101/138] ALSA: hda: add AMD Bonaire AZ PCI ID with proper driver caps Greg Kroah-Hartman
2016-08-18 13:58 ` [PATCH 4.4 102/138] ALSA: hda - Fix headset mic detection problem for two dell machines Greg Kroah-Hartman
2016-08-18 13:58 ` [PATCH 4.4 103/138] IB/mlx5: Fix MODIFY_QP command input structure Greg Kroah-Hartman
2016-08-18 13:58 ` [PATCH 4.4 111/138] IB/IWPM: Fix a potential skb leak Greg Kroah-Hartman
2016-08-18 13:58 ` [PATCH 4.4 112/138] IB/mlx4: Fix the SQ size of an RC QP Greg Kroah-Hartman
2016-08-18 13:58 ` [PATCH 4.4 113/138] IB/mlx4: Fix error flow when sending mads under SRIOV Greg Kroah-Hartman
2016-08-18 13:58 ` [PATCH 4.4 114/138] IB/mlx4: Fix memory leak if QP creation failed Greg Kroah-Hartman
2016-08-18 13:58 ` [PATCH 4.4 116/138] ubi: Make volume resize power cut aware Greg Kroah-Hartman
2016-08-18 13:58 ` [PATCH 4.4 117/138] ubi: Fix early logging Greg Kroah-Hartman
2016-08-18 13:58 ` [PATCH 4.4 124/138] target: Fix ordered task CHECK_CONDITION early exception handling Greg Kroah-Hartman
2016-08-18 13:58 ` [PATCH 4.4 125/138] Input: elan_i2c - properly wake up touchpad on ASUS laptops Greg Kroah-Hartman
2016-08-18 13:58 ` [PATCH 4.4 127/138] SUNRPC: Dont allocate a full sockaddr_storage for tracing Greg Kroah-Hartman
2016-08-18 13:58 ` [PATCH 4.4 129/138] MIPS: Dont register r4k sched clock when CPUFREQ enabled Greg Kroah-Hartman
2016-08-18 13:59 ` Greg Kroah-Hartman [this message]
2016-08-18 13:59 ` [PATCH 4.4 133/138] ACPI / EC: Work around method reentrancy limit in ACPICA for _Qxx Greg Kroah-Hartman
2016-08-18 13:59 ` [PATCH 4.4 134/138] lpfc: fix oops in lpfc_sli4_scmd_to_wqidx_distr() from lpfc_send_taskmgmt() Greg Kroah-Hartman
2016-08-18 13:59 ` [PATCH 4.4 135/138] rtc: s3c: Add s3c_rtc_{enable/disable}_clk in s3c_rtc_setfreq() Greg Kroah-Hartman
2016-08-18 20:07 ` [PATCH 4.4 000/138] 4.4.19-stable review Guenter Roeck
2016-08-18 21:35 ` Shuah Khan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160818135612.869180865@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=Steven.Hill@imgtec.com \
--cc=chenhc@lemote.com \
--cc=john@phrozen.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=ralf@linux-mips.org \
--cc=stable@vger.kernel.org \
--cc=wuzhangjin@gmail.com \
--cc=zhangfx@lemote.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).