From patchwork Fri Jun 17 08:52:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huacai Chen X-Patchwork-Id: 9183079 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7EE246075F for ; Fri, 17 Jun 2016 08:53:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 52E82269A3 for ; Fri, 17 Jun 2016 08:53:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 47D032839C; Fri, 17 Jun 2016 08:53:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AACC2269A3 for ; Fri, 17 Jun 2016 08:53:01 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BF4C26EB70; Fri, 17 Jun 2016 08:52:57 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-it0-x244.google.com (mail-it0-x244.google.com [IPv6:2607:f8b0:4001:c0b::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id 50F976EB6D for ; Fri, 17 Jun 2016 08:52:56 +0000 (UTC) Received: by mail-it0-x244.google.com with SMTP id h190so10083711ith.3 for ; Fri, 17 Jun 2016 01:52:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:cc; bh=kevW7ckY8wrgxEUsjZVvAzHWvkba+/v+1UUcaoeX8e8=; b=flzcjpvCt8VyWoCGj40YOB5JL857qwplGwssHcAcEKLwaWPaWkTgVUkw3oRdz/pl/F 5UI9umqHRc/cspRtUjAjtuitUYan5c/dYq0z4SQzMxeHGdZe7CRhWhra0n+8E+6k6BPn teXN8I2JapjO7dEbNYWtOhZmqMKs6z2xlrLa4LVs9aJgYN/XGoEscGIGBTw8Kt8a4dxt mpqwRUDADXg9DHNQZwSudjJNn9WxRb2vJcGYXMQFrckOHoRU5vyxMmVEifQ2al7z/S2J xmMkLZsYJopYaQoZOBbVGM9pR94FyiPk2CQ+gK9bnu6GbOc7IEs3i685AlephSdXZYWn jfkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=kevW7ckY8wrgxEUsjZVvAzHWvkba+/v+1UUcaoeX8e8=; b=eDkMSn9tXMGytGuE+JYJc9ZFEW4fcDyvcc28dpebCgoGRNdCDHNkBwCxhA1es6Ia3F CbWXjFmfmdL2pIh7N15Rm50QDGxKF83SPItsHFEbGcG/th3cRg60hMzuspSBkBFb3MRH oPLNUJDKVtQqalDNJcOga3/Fpytw1ieXHpU51cAFNAP84J5m1W647lTdbye57DrhxcHy Qs6XL8um0wNw5azkMgx5AxOiYDvImdLp7waKS2ggd/JPAv2o/O8NwNqJ/NhPyNPVcpjB DpvFoe9YteUFvhSRX4Wa7N841jxSAUHhu4+w9/QG8wGkoX7M4h0R4Sf4CnVS1oScvxMU VXFg== X-Gm-Message-State: ALyK8tIjzFaOml9DzaMwLwWIL28ZPsK/vXO3OXsMRhwVXFlJ3Twc8x6oa+jMLC2YNFe2TltWEev/GwK7ooClXw== X-Received: by 10.36.223.65 with SMTP id r62mr1462287itg.1.1466153575317; Fri, 17 Jun 2016 01:52:55 -0700 (PDT) MIME-Version: 1.0 Received: by 10.36.94.70 with HTTP; Fri, 17 Jun 2016 01:52:54 -0700 (PDT) From: Huacai Chen Date: Fri, 17 Jun 2016 16:52:54 +0800 Message-ID: Subject: RS780 UVD cause hpet_readl() very slow To: =?UTF-8?Q?Christian_K=C3=B6nig?= , Alex Deucher , Maling list - DRI developers Cc: sunc@lemote.com, =?UTF-8?B?546L6ZSQ?= , xueca@lemote.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Hi, Christian We found that if we use RS780 UVD decoding, hpet_readl() will need as long as 1ms. But, if attach a U-disk on south bridge (SB700) and read some data from it, hpet_readl() has no problem. Could you please give me some suggestions or fix it? How to reproduce: 1, apply the patch on top of kernel (4.2+) and boot with this kernel 2, ensure that no USB device attached on SB700 (except keyboard and mouse) 3, download this file: http://mirror.lemote.com/fedora-users/ipfootball/video_bench/1920x1080_25fps_h264_ac3.mkv 4, ffmpeg -hwaccel vdpau -i 1920x1080_25fps_h264_acc.mkv -f rawvideo -an -y /dev/null 5, dmesg will complain "So big..." Huacai diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c index 307a498..a0c8634 100644 --- a/arch/x86/kernel/apic/apic.c +++ b/arch/x86/kernel/apic/apic.c @@ -452,10 +452,12 @@ EXPORT_SYMBOL_GPL(setup_APIC_eilvt); /* * Program the next event, relative to now */ +void check_hpet(void); static int lapic_next_event(unsigned long delta, struct clock_event_device *evt) { apic_write(APIC_TMICT, delta); + check_hpet(); return 0; } diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c index 3acbff4..19329e8 100644 --- a/arch/x86/kernel/hpet.c +++ b/arch/x86/kernel/hpet.c @@ -367,6 +367,15 @@ static void hpet_set_mode(enum clock_event_mode mode, } } +void check_hpet(void) +{ + u32 cnt1,cnt2; + + cnt1 = hpet_readl(HPET_COUNTER); + cnt2 = hpet_readl(HPET_COUNTER); + if(cnt2-cnt1>1000) printk("So big! (%u)\n",cnt2-cnt1); +} + static int hpet_next_event(unsigned long delta, struct clock_event_device *evt, int timer) {