HACK: sunxi: video: change kernel framebuffer mapping to writecombine

The kernelspace mapping of framebuffer (needed for fbcon) had CPU
caching enabled by some mistake. This caused glitches and artifacts
in the framebuffer console, which can be easily reproduced as reported
on IRC:

  <buZz> supereasy to reproduce;
         1) type a multiword command on (fbdev) console
         2) ctrl-left a word
         3) delete its first character
         4) tada, sticky pixels

The solution is to change the kernel framebuffer memory mapping to
writecombine, just like it is done for the userspace mapping.

This patch is definitely *not* a clean solution. It is cutting some
corners by doing exactly what was NAK'ed by the ARM kernel maintainers:
  http://lists.infradead.org/pipermail/linux-arm-kernel/2011-April/048844.html
  http://lists.infradead.org/pipermail/linux-arm-kernel/2011-June/052233.html

The ioremap restriction (intended to prevent creating aliased mappings
with different memory attributes) has been introduced with 309caa9cc6ff39d2,
later relaxed in 06c10884486a63a1, and finally re-introduced again
in 67cfa23ac9df810d.

Even though this patch is not perfect, it can be used as a stopgap solution.

= changes in v2 revision:
    Fix for the problems with disp module loading/unloading in dual-monitor
    configuration. Added debugging messages and fallback code for the case
    if ioremap_wc() fails.

Signed-off-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>
arm:mach-sun4i:clock: Fix for "[ccmu] try to set apb1 parent to sata_pll failed!" warning print. U-boot also uses OSC24M for apb1.
tty:serial:8250_sunxi: Fix module unload
sunxi-serial: Don't report an irq as handled when it is not handled

The sunxi uarts have a state where they report an interrupt-type unknown
to the generic 8250 code (more about that in a later patch in this series),
on my 1 GB RAM mini-x u-boot seems to always hit the exact right timing to
trigger this interrupt getting asserted, and since the Linux kernel code
does not know how to clear it, we end up with a stuck interrupt.

For some reasons the sunxi kernel tree has a hack simply reporting any serial
interrupt as handled, even though it was not handled. This causes the kernel
to hang in a loop servicing the unhandled interrupt for ever.

This patch reverts this hack, bringing this part of the sunxi kernel tree
in sync with mainline. This causes the kernel to correctly detect the stuck
interrupts and continue working (except for the serial port), when the uart
raises this special interrupt.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
sunxi-serial: Fix bad pointer access in sw_serial_pm

The sunxi-serial code assumes that the struct uart_port *port parameter
passed to the pm callback it the address of the struct it used to register.

But this is completely wrong! The argument passed to serial8250_register_port
is only a template, it is copied not used directly. Instead store the
correct address in port->private_data and use that.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
sunxi-serial: No need to keep the port struct in memory

Since it is only a template we don't need to keep it around.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
sunxi-serial: Get rid of sw_serial global array

There is no need for global state here, instead store the line-number we
got from registering together with our other info in the sw_serial_port
struct.

While at it, also add proper error checking for the serial8250_register_port
call.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
sunxi-serial: Get rid of useless sw_serial_get_config

All info gathered there is never uses, so while we're cleaning up the
sunxi-serial code lets nuke this.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
sunxi-serial: Deal with sunxi 8250-s special busy interrupt

The sunxi uarts report interrupts with the iir register no interrupt bit
set, which causes a stuck interrupt. I can reproduce this 100% on my mini-x
with 1 GB of RAM.

When this happens this bit (bit 0) is combined with bit 1 and bit 2, this
is also done by Synopsys DesignWare 8250, and is called a busy interrupt
condition there. Likely the sunxi and the Synopsys DesignWare 8250-s have some
common ancestry.

This patch fixes the stuck interrupt condition by re-using the code for the
busy-interrupt from 8250_dw.c after this ttyS0 works reliable on my mini-x.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
input:touchscreen:ft5x_ts: Make device visible under /sys/class/input/input*
arch:arm:configs add ext4 fs capabilities

add ext4 fs capabilities to defconfigs.

this allows fedora 17 packages to be updated as rpm uses capabilities
in preference to setuid.

Signed-off-by: Robin Humble <robin.humble+sunxi@anu.edu.au>
cgroup: Take css_set_lock from cgroup_css_sets_empty()

As indicated in the comment above cgroup_css_sets_empty it needs the
css_set_lock. But neither of the 2 call points have it, so rather then fixing
the callers just take the lock inside cgroup_css_sets_empty().

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
cgroup: Fix use after free of cgrp (cgrp->css_sets) (v2)

Running a 3.4 kernel + Fedora-18 (systemd) userland on my Allwinner A10
(arm cortex a8), I'm seeing repeated, reproducable list_del list corruption
errors when build with CONFIG_DEBUG_LIST, and the backtrace always shows
free_css_set_work as the function making the problematic list_del call.

I've tracked this doen to a use after free of the cgrp struct, specifically
of the cgrp->css_sets list_head, which gets cleared by free_css_set_work.

Since free_css_set_work runs form a workqueue, it is possible for it to not be
done with clearing the list when the cgrp gets free-ed. To avoid this the code
adding the links increases cgrp->count, and the freeing code running from the
workqueue decreases cgrp->count *after* doing list_del, and then if the count
goes to 0 calls cgroup_wakeup_rmdir_waiter().

However cgroup_rmdir() is missing a check for cgrp->count != 0, causing it
to still continue with the rmdir (which leads to the free-ing of the cgrp),
before free_css_set_work is done. Sometimes the free-ed memory is re-used
before free_css_set_work gets around to unlinking link->cgrp_link_list,
triggering the list_del list corruption messages.

This patch fixes this by properly checking for cgrp->count != 0 and waiting
for the cgroup_rmdir_waitq in that case.

Changes in v2:
-The cgrp->count check must be done before the cgroup_clear_css_refs()
 call/check, since on success cgroup_clear_css_refs has decremented all
 the css refs, and that *must* be done only once

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
sunxi: disp_ump: Introduce a new ioctl for UMP wrapping the whole framebuffer

There are two ioctls (GET_UMP_SECURE_ID_BUF1 and GET_UMP_SECURE_ID_BUF2)
available for similar purpose already. And they are used by xf86-video-mali
X11 DDX driver.

In order not to clash with them, we just can add a new ioctl. This ioctl is
needed for the new, soon to be announced xf86-video-sunxifb X11 DDX driver.

Signed-off-by: Siarhei Siamashka <siarhei.siamashka@gmail.com>