public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@suse.de>
To: linux-kernel@vger.kernel.org, stable@kernel.org, jejb@kernel.org
Cc: Justin Forbes <jmforbes@linuxtx.org>,
	Zwane Mwaikambo <zwane@arm.linux.org.uk>,
	"Theodore Ts'o" <tytso@mit.edu>,
	Randy Dunlap <rdunlap@xenotime.net>,
	Dave Jones <davej@redhat.com>,
	Chuck Wolber <chuckw@quantumlinux.com>,
	Chris Wedgwood <reviews@ml.cw.f00f.org>,
	Michael Krufky <mkrufky@linuxtv.org>,
	Chuck Ebbert <cebbert@redhat.com>,
	Domenico Andreoli <cavokz@gmail.com>, Willy Tarreau <w@1wt.eu>,
	Rodrigo Rubira Branco <rbranco@la.checkpoint.com>,
	Jake Edge <jake@lwn.net>, Eugene Teo <eteo@redhat.com>,
	torvalds@linux-foundation.org, akpm@linux-foundation.org,
	alan@lxorguk.ukuu.org.uk, "David S. Miller" <davem@davemloft.net>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>
Subject: [patch 11/60] radeonfb: fix accel engine hangs
Date: Mon, 18 Aug 2008 11:42:13 -0700	[thread overview]
Message-ID: <20080818184213.GL29394@suse.de> (raw)
In-Reply-To: <20080818184035.GA29394@suse.de>

[-- Attachment #1: radeonfb-fix-accel-engine-hangs.patch --]
[-- Type: text/plain, Size: 5645 bytes --]

2.6.26-stable review patch.  If anyone has any objections, please let us know.

------------------
From: David Miller <davem@davemloft.net>

commit 969830b2fedf8336c41d6195f49d250b1e166ff8 upstream

Some chips appear to have the 2D engine hang during screen redraw,
typically in a sequence of copyarea operations. This appear to be
solved by adding a flush of the engine destination pixel cache
and waiting for the engine to be idle before issuing the accel
operation. The performance impact seems to be fairly small.

Here is a trace on an RV370 (PCI device ID 0x5b64), it records the
RBBM_STATUS register, then the source x/y, destination x/y, and
width/height used for the copy:

----------------------------------------
radeonfb_prim_copyarea: STATUS[00000140] src[210:70] dst[210:60] wh[a0:10]
radeonfb_prim_copyarea: STATUS[00000140] src[2b8:70] dst[2b8:60] wh[88:10]
radeonfb_prim_copyarea: STATUS[00000140] src[348:70] dst[348:60] wh[40:10]
radeonfb_prim_copyarea: STATUS[80020140] src[390:70] dst[390:60] wh[88:10]
radeonfb_prim_copyarea: STATUS[8002613f] src[40:80] dst[40:70] wh[28:10]
radeonfb_prim_copyarea: STATUS[80026139] src[a8:80] dst[a8:70] wh[38:10]
radeonfb_prim_copyarea: STATUS[80026133] src[e8:80] dst[e8:70] wh[80:10]
radeonfb_prim_copyarea: STATUS[8002612d] src[170:80] dst[170:70] wh[30:10]
radeonfb_prim_copyarea: STATUS[80026127] src[1a8:80] dst[1a8:70] wh[8:10]
radeonfb_prim_copyarea: STATUS[80026121] src[1b8:80] dst[1b8:70] wh[88:10]
radeonfb_prim_copyarea: STATUS[8002611b] src[248:80] dst[248:70] wh[68:10]
----------------------------------------

When things are going fine the copies complete before the next ROP is
even issued, but all of a sudden the 2D unit becomes active (bit 17 in
RBBM_STATUS) and the FIFO retry (bit 13) and FIFO pipeline busy (bit
14) are set as well.  The FIFO begins to backup until it becomes full.

What happens next is the radeon_fifo_wait() times out, and we access
the chip illegally leading to a bus error which usually wedges the
box.  None of this makes it to the console screen, of course :-)
radeon_fifo_wait() should be modified to reset the accelerator when
this timeout happens instead of programming the chip anyways.

----------------------------------------
radeonfb: FIFO Timeout !
ERROR(0): Cheetah error trap taken afsr[0010080005000000] afar[000007f900800e40] TL1(0)
ERROR(0): TPC[595114] TNPC[595118] O7[459788] TSTATE[11009601]
ERROR(0): TPC<radeonfb_copyarea+0xfc/0x248>
ERROR(0): M_SYND(0),  E_SYND(0), Privileged
ERROR(0): Highest priority error (0000080000000000) "Bus error response from system bus"
ERROR(0): D-cache idx[0] tag[0000000000000000] utag[0000000000000000] stag[0000000000000000]
ERROR(0): D-cache data0[0000000000000000] data1[0000000000000000] data2[0000000000000000] data3[0000000000000000]
ERROR(0): I-cache idx[0] tag[0000000000000000] utag[0000000000000000] stag[0000000000000000] u[0000000000000000] l[00\

ERROR(0): I-cache INSN0[0000000000000000] INSN1[0000000000000000] INSN2[0000000000000000] INSN3[0000000000000000]
ERROR(0): I-cache INSN4[0000000000000000] INSN5[0000000000000000] INSN6[0000000000000000] INSN7[0000000000000000]
ERROR(0): E-cache idx[800e40] tag[000000000e049f4c]
ERROR(0): E-cache data0[fffff8127d300180] data1[00000000004b5384] data2[0000000000000000] data3[0000000000000000]
Ker:xnel panic - not syncing: Irrecoverable deferred error trap.
----------------------------------------

Another quirk is that these copyarea calls will not happen until the
first drivers/char/vt.c:redraw_screen() occurs.  This will only happen
if you 1) VC switch or 2) run "consolechars" or 3) unblank the screen.

This seems to happen because until a redraw_screen() the screen scrolling
method used by fbcon is not finalized yet.  I've seen this with other fb
drivers too.

So if all you do is boot straight into X you will never see this bug on
the relevant chips.

Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

---
 drivers/video/aty/radeon_accel.c |    8 ++++++++
 include/video/radeon.h           |    4 ++++
 2 files changed, 12 insertions(+)

--- a/drivers/video/aty/radeon_accel.c
+++ b/drivers/video/aty/radeon_accel.c
@@ -55,6 +55,10 @@ static void radeonfb_prim_fillrect(struc
 	OUTREG(DP_WRITE_MSK, 0xffffffff);
 	OUTREG(DP_CNTL, (DST_X_LEFT_TO_RIGHT | DST_Y_TOP_TO_BOTTOM));
 
+	radeon_fifo_wait(2);
+	OUTREG(DSTCACHE_CTLSTAT, RB2D_DC_FLUSH_ALL);
+	OUTREG(WAIT_UNTIL, (WAIT_2D_IDLECLEAN | WAIT_DMA_GUI_IDLE));
+
 	radeon_fifo_wait(2);  
 	OUTREG(DST_Y_X, (region->dy << 16) | region->dx);
 	OUTREG(DST_WIDTH_HEIGHT, (region->width << 16) | region->height);
@@ -116,6 +120,10 @@ static void radeonfb_prim_copyarea(struc
 	OUTREG(DP_CNTL, (xdir>=0 ? DST_X_LEFT_TO_RIGHT : 0)
 			| (ydir>=0 ? DST_Y_TOP_TO_BOTTOM : 0));
 
+	radeon_fifo_wait(2);
+	OUTREG(DSTCACHE_CTLSTAT, RB2D_DC_FLUSH_ALL);
+	OUTREG(WAIT_UNTIL, (WAIT_2D_IDLECLEAN | WAIT_DMA_GUI_IDLE));
+
 	radeon_fifo_wait(3);
 	OUTREG(SRC_Y_X, (sy << 16) | sx);
 	OUTREG(DST_Y_X, (dy << 16) | dx);
--- a/include/video/radeon.h
+++ b/include/video/radeon.h
@@ -741,6 +741,10 @@
 #define SOFT_RESET_RB           		   (1 <<  6)
 #define SOFT_RESET_HDP          		   (1 <<  7)
 
+/* WAIT_UNTIL bit constants */
+#define WAIT_DMA_GUI_IDLE			   (1 << 9)
+#define WAIT_2D_IDLECLEAN			   (1 << 16)
+
 /* SURFACE_CNTL bit consants */
 #define SURF_TRANSLATION_DIS			   (1 << 8)
 #define NONSURF_AP0_SWP_16BPP			   (1 << 20)

-- 

  parent reply	other threads:[~2008-08-18 18:49 UTC|newest]

Thread overview: 113+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20080818191012.663450219@mini.kroah.org>
     [not found] ` <20080818183230.966310219@mini.kroah.org>
2008-08-18 18:40   ` [patch 00/60] 2.6.26-stable review Greg KH
2008-08-18 18:41     ` [patch 01/60] mlock() fix return values Greg KH
2008-08-18 18:41     ` [patch 02/60] SCSI: ses: fix VPD inquiry overrun Greg KH
2008-08-18 18:41     ` [patch 03/60] SCSI: scsi_transport_spi: fix oops in revalidate Greg KH
2008-08-18 18:41     ` [patch 04/60] SCSI: block: Fix miscalculation of sg_io timeout in CDROM_SEND_PACKET handler Greg KH
2008-08-18 18:41     ` [patch 05/60] SCSI: hptiop: add more PCI device IDs Greg KH
2008-08-18 18:41     ` [patch 06/60] vt8623fb: fix kernel oops Greg KH
2008-08-18 18:41     ` [patch 07/60] relay: fix "full buffer with exactly full last subbuffer" accounting problem Greg KH
2008-08-18 18:41     ` [patch 08/60] ide-cd: fix endianity for the error message in cdrom_read_capacity Greg KH
2008-08-18 18:41     ` [patch 09/60] posix-timers: do_schedule_next_timer: fix the setting of ->si_overrun Greg KH
2008-08-18 18:41     ` [patch 10/60] posix-timers: fix posix_timer_event() vs dequeue_signal() race Greg KH
2008-08-18 18:42     ` Greg KH [this message]
2008-08-18 18:42     ` [patch 12/60] matrox maven: fix a broken error path Greg KH
2008-08-18 18:42     ` [patch 13/60] USB: pl2023: Remove USB id (4348:5523) handled by ch341 Greg KH
2008-08-18 18:42     ` [patch 14/60] USB: fix interface unregistration logic Greg KH
2008-08-18 18:42     ` [patch 15/60] usb-storage: unusual_devs entries for iRiver T10 and Datafab CF+SM reader Greg KH
2008-08-18 18:43     ` [patch 16/60] USB: usb-storage: quirk around v1.11 firmware on Nikon D4 Greg KH
2008-08-18 18:43     ` [patch 17/60] usb-serial: dont release unregistered minors Greg KH
2008-08-18 18:43     ` [patch 18/60] USB: ftdi_sio: add support for Luminance Stellaris Evaluation/Development Kits Greg KH
2008-08-18 18:43     ` [patch 19/60] USB: ftdi_sio: Add USB Product Id for ELV HS485 Greg KH
2008-08-18 18:43     ` [patch 20/60] ipvs: Fix possible deadlock in estimator code Greg KH
2008-08-19  0:31       ` Simon Horman
2008-08-18 18:43     ` [patch 21/60] acer-wmi: Fix wireless and bluetooth on early AMW0 v2 laptops Greg KH
2008-08-18 18:43     ` [patch 22/60] CIFS: mount of IPC$ breaks with iget patch Greg KH
2008-08-18 18:43     ` [patch 23/60] CIFS: if get root inode fails during mount, cleanup tree connection Greg KH
2008-08-18 18:43     ` [patch 24/60] dccp: change L/R must have at least one byte in the dccpsf_val field Greg KH
2008-08-18 18:43     ` [patch 25/60] syncookies: Make sure ECN is disabled Greg KH
2008-08-18 18:43     ` [patch 26/60] random32: seeding improvement Greg KH
2008-08-18 18:43     ` [patch 27/60] ipv6: Fix ip6_xmit to send fragments if ipfragok is true Greg KH
2008-08-18 18:44     ` [patch 28/60] sparc64: FUTEX_OP_ANDN fix Greg KH
2008-08-18 18:44     ` [patch 29/60] sparc64: Fix global reg snapshotting on self-cpu Greg KH
2008-08-18 18:44     ` [patch 30/60] sparc64: Do not clobber %g7 in setcontext() trap Greg KH
2008-08-18 18:44     ` [patch 31/60] KVM: task switch: segment base is linear address Greg KH
2008-08-18 18:44     ` [patch 32/60] KVM: task switch: use seg regs provided by subarch instead of reading from GDT Greg KH
2008-08-18 18:44     ` [patch 33/60] KVM: Avoid instruction emulation when event delivery is pending Greg KH
2008-08-18 18:44     ` [patch 34/60] KVM: task switch: translate guest segment limit to virt-extension byte granular field Greg KH
2008-08-18 18:44     ` [patch 35/60] KVM: ia64: Fix irq disabling leak in error handling code Greg KH
2008-08-18 18:44     ` [patch 36/60] r8169: avoid thrashing PCI conf space above RTL_GIGA_MAC_VER_06 Greg KH
2008-08-18 18:44     ` [patch 37/60] ALSA: asoc: restrict sample rate and size in Freescale MPC8610 sound drivers Greg KH
2008-08-18 18:44     ` [patch 38/60] i2c: Fix NULL pointer dereference in i2c_new_probed_device Greg KH
2008-08-18 18:44     ` [patch 39/60] i2c: Let users select algorithm drivers manually again Greg KH
2008-08-18 18:44     ` [patch 40/60] ALSA: ASoC: fix SNDCTL_DSP_SYNC support in Freescale 8610 sound drivers Greg KH
2008-08-18 18:44     ` [patch 41/60] x86: amd opteron TOM2 mask val fix Greg KH
2008-08-18 18:45     ` [patch 42/60] ide: it821x in pass-through mode segfaults in 2.6.26-stable Greg KH
2008-08-18 18:45     ` [patch 43/60] CIFS: Fix compiler warning on 64-bit Greg KH
2008-08-18 18:45     ` [patch 44/60] radeon: misc corrections Greg KH
2008-08-18 18:45     ` [patch 45/60] cs5520: add enablebits checking Greg KH
2008-08-18 18:45     ` [patch 46/60] rtl8187: Fix lockups due to concurrent access to config routine Greg KH
2008-08-18 18:45     ` [patch 47/60] sparc64: Fix end-of-stack checking in save_stack_trace() Greg KH
2008-08-18 18:45     ` [patch 48/60] sparc64: Fix recursion in stack overflow detection handling Greg KH
2008-08-18 18:45     ` [patch 49/60] sparc64: Make global reg dumping even more useful Greg KH
2008-08-18 18:45     ` [patch 50/60] sparc64: Implement IRQ stacks Greg KH
2008-08-18 18:45     ` [patch 51/60] sparc64: Handle stack trace attempts before irqstacks are setup Greg KH
2008-08-18 18:45     ` [patch 52/60] x86: fix spin_is_contended() Greg KH
2008-08-18 18:45     ` [patch 53/60] x86: fix setup code crashes on my old 486 box Greg KH
2008-08-18 19:17       ` H. Peter Anvin
2008-08-18 18:45     ` [patch 54/60] qla2xxx: Add dev_loss_tmo_callbk/terminate_rport_io callback support Greg KH
2008-08-18 18:45     ` [patch 55/60] qla2xxx: Set an rports dev_loss_tmo value in a consistent manner Greg KH
2008-08-18 18:45     ` [patch 56/60] usb-storage: revert DMA-alignment change for Wireless USB Greg KH
2008-08-18 18:45     ` [patch 57/60] usb-storage: automatically recognize bad residues Greg KH
2008-08-18 18:45     ` [patch 58/60] CIFS: properly account for new user= field in SPNEGO upcall string allocation Greg KH
2008-08-18 18:45     ` [patch 59/60] PCI: Limit VPD length for Broadcom 5708S Greg KH
2008-08-18 18:45     ` [patch 60/60] crypto: padlock - fix VIA PadLock instruction usage with irq_ts_save/restore() Greg KH
2008-08-18 19:18 ` [patch 00/49] 2.6.25-stable review Greg KH
2008-08-18 19:19   ` [patch 01/49] USB: usb-storage: quirk around v1.11 firmware on Nikon D4 Greg KH
2008-08-18 19:19   ` [patch 02/49] usb-storage: unusual_devs entries for iRiver T10 and Datafab CF+SM reader Greg KH
2008-08-18 19:19   ` [patch 03/49] usb-serial: dont release unregistered minors Greg KH
2008-08-18 19:19   ` [patch 04/49] USB: pl2023: Remove USB id (4348:5523) handled by ch341 Greg KH
2008-08-18 19:19   ` [patch 05/49] USB: ftdi_sio: Add USB Product Id for ELV HS485 Greg KH
2008-08-18 19:19   ` [patch 06/49] USB: ftdi_sio: add support for Luminance Stellaris Evaluation/Development Kits Greg KH
2008-08-18 19:19   ` [patch 07/49] SCSI: ses: fix VPD inquiry overrun Greg KH
2008-08-18 19:19   ` [patch 08/49] SCSI: scsi_transport_spi: fix oops in revalidate Greg KH
2008-08-18 19:19   ` [patch 09/49] SCSI: hptiop: add more PCI device IDs Greg KH
2008-08-18 19:19   ` [patch 10/49] SCSI: block: Fix miscalculation of sg_io timeout in CDROM_SEND_PACKET handler Greg KH
2008-08-18 19:19   ` [patch 11/49] relay: fix "full buffer with exactly full last subbuffer" accounting problem Greg KH
2008-08-18 19:19   ` [patch 12/49] radeonfb: fix accel engine hangs Greg KH
2008-08-18 19:19   ` [patch 13/49] posix-timers: fix posix_timer_event() vs dequeue_signal() race Greg KH
2008-08-18 19:19   ` [patch 14/49] posix-timers: do_schedule_next_timer: fix the setting of ->si_overrun Greg KH
2008-08-18 19:19   ` [patch 15/49] mlock() fix return values Greg KH
2008-08-18 19:19   ` [patch 16/49] matrox maven: fix a broken error path Greg KH
2008-08-18 19:19   ` [patch 17/49] ipvs: Fix possible deadlock in estimator code Greg KH
2008-08-18 19:19   ` [patch 18/49] ide-cd: fix endianity for the error message in cdrom_read_capacity Greg KH
2008-08-18 19:19   ` [patch 19/49] CIFS: mount of IPC$ breaks with iget patch Greg KH
2008-08-18 19:20   ` [patch 20/49] CIFS: if get root inode fails during mount, cleanup tree connection Greg KH
2008-08-18 19:20   ` [patch 21/49] acer-wmi: Fix wireless and bluetooth on early AMW0 v2 laptops Greg KH
2008-08-18 19:20   ` [patch 22/49] dccp: change L/R must have at least one byte in the dccpsf_val field Greg KH
2008-08-18 19:20   ` [patch 23/49] random32: seeding improvement Greg KH
2008-08-18 19:20   ` [patch 24/49] ipv6: Fix ip6_xmit to send fragments if ipfragok is true Greg KH
2008-08-18 19:20   ` [patch 25/49] sparc64: FUTEX_OP_ANDN fix Greg KH
2008-08-18 19:20   ` [patch 26/49] sparc64: Do not clobber %g7 in setcontext() trap Greg KH
2008-08-18 19:20   ` [patch 27/49] uml: fix build when SLOB is enabled Greg KH
2008-08-18 19:20   ` [patch 28/49] uml: fix bad NTP interaction with clock Greg KH
2008-08-18 19:20   ` [patch 29/49] uml: physical memory shouldnt include initial stack Greg KH
2008-08-18 19:20   ` [patch 30/49] uml: track and make up lost ticks Greg KH
2008-08-18 19:20   ` [patch 31/49] uml: missed kmalloc() in pcap_user.c Greg KH
2008-08-18 19:20   ` [patch 32/49] uml: deal with host time going backwards Greg KH
2008-08-18 19:20   ` [patch 33/49] uml: deal with inaccessible address space start Greg KH
2008-08-18 19:20   ` [patch 34/49] uml: missing export of csum_partial() on uml/amd64 Greg KH
2008-08-18 19:20   ` [patch 35/49] uml: memcpy export needs to follow host declaration Greg KH
2008-08-18 19:20   ` [patch 36/49] uml: stub needs to tolerate SIGWINCH Greg KH
2008-08-18 19:20   ` [patch 37/49] uml: work around broken host PTRACE_SYSEMU Greg KH
2008-08-18 19:20   ` [patch 38/49] uml: fix gcc ICEs and unresolved externs Greg KH
2008-08-18 19:20   ` [patch 39/49] uml: Fix boot crash Greg KH
2008-08-18 19:20   ` [patch 40/49] uml: PATH_MAX needs limits.h Greg KH
2008-08-18 19:20   ` [patch 41/49] radeon: misc corrections Greg KH
2008-08-18 19:20   ` [patch 42/49] r8169: avoid thrashing PCI conf space above RTL_GIGA_MAC_VER_06 Greg KH
2008-08-18 19:20   ` [patch 43/49] netfilter: nf_nat_snmp_basic: fix a range check in NAT for SNMP Greg KH
2008-08-18 19:20   ` [patch 44/49] i2c: Fix NULL pointer dereference in i2c_new_probed_device Greg KH
2008-08-18 19:20   ` [patch 45/49] CIFS: Fix compiler warning on 64-bit Greg KH
2008-08-18 19:21   ` [patch 46/49] x86: fix spin_is_contended() Greg KH
2008-08-18 19:21   ` [patch 47/49] x86: fix setup code crashes on my old 486 box Greg KH
2008-08-18 19:21   ` [patch 48/49] qla2xxx: Add dev_loss_tmo_callbk/terminate_rport_io callback support Greg KH
2008-08-18 19:21   ` [patch 49/49] qla2xxx: Set an rports dev_loss_tmo value in a consistent manner Greg KH

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=20080818184213.GL29394@suse.de \
    --to=gregkh@suse.de \
    --cc=akpm@linux-foundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=benh@kernel.crashing.org \
    --cc=cavokz@gmail.com \
    --cc=cebbert@redhat.com \
    --cc=chuckw@quantumlinux.com \
    --cc=davej@redhat.com \
    --cc=davem@davemloft.net \
    --cc=eteo@redhat.com \
    --cc=jake@lwn.net \
    --cc=jejb@kernel.org \
    --cc=jmforbes@linuxtx.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mkrufky@linuxtv.org \
    --cc=rbranco@la.checkpoint.com \
    --cc=rdunlap@xenotime.net \
    --cc=reviews@ml.cw.f00f.org \
    --cc=stable@kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=tytso@mit.edu \
    --cc=w@1wt.eu \
    --cc=zwane@arm.linux.org.uk \
    /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