Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 186871
b: refs/heads/master
c: 311e54c
h: refs/heads/master
i:
  186869: 31f3158
  186867: 974dded
  186863: e98049d
v: v3
  • Loading branch information
H Hartley Sweeten authored and Samuel Ortiz committed Mar 7, 2010
1 parent 43e9f4e commit 3562caa
Show file tree
Hide file tree
Showing 534 changed files with 25,256 additions and 31,795 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8fe900b8c7aa6a307e552ff776e0c04c28dcf9c8
refs/heads/master: 311e54c07e784fe63d421f724dcc597d1f82ccad
93 changes: 0 additions & 93 deletions trunk/Documentation/power/runtime_pm.txt
Original file line number Diff line number Diff line change
Expand Up @@ -224,12 +224,6 @@ defined in include/linux/pm.h:
RPM_SUSPENDED, which means that each device is initially regarded by the
PM core as 'suspended', regardless of its real hardware status

unsigned int runtime_auto;
- if set, indicates that the user space has allowed the device driver to
power manage the device at run time via the /sys/devices/.../power/control
interface; it may only be modified with the help of the pm_runtime_allow()
and pm_runtime_forbid() helper functions

All of the above fields are members of the 'power' member of 'struct device'.

4. Run-time PM Device Helper Functions
Expand Down Expand Up @@ -335,20 +329,6 @@ drivers/base/power/runtime.c and include/linux/pm_runtime.h:
'power.runtime_error' is set or 'power.disable_depth' is greater than
zero)

bool pm_runtime_suspended(struct device *dev);
- return true if the device's runtime PM status is 'suspended', or false
otherwise

void pm_runtime_allow(struct device *dev);
- set the power.runtime_auto flag for the device and decrease its usage
counter (used by the /sys/devices/.../power/control interface to
effectively allow the device to be power managed at run time)

void pm_runtime_forbid(struct device *dev);
- unset the power.runtime_auto flag for the device and increase its usage
counter (used by the /sys/devices/.../power/control interface to
effectively prevent the device from being power managed at run time)

It is safe to execute the following helper functions from interrupt context:

pm_request_idle()
Expand Down Expand Up @@ -402,18 +382,6 @@ may be desirable to suspend the device as soon as ->probe() or ->remove() has
finished, so the PM core uses pm_runtime_idle_sync() to invoke the
subsystem-level idle callback for the device at that time.

The user space can effectively disallow the driver of the device to power manage
it at run time by changing the value of its /sys/devices/.../power/control
attribute to "on", which causes pm_runtime_forbid() to be called. In principle,
this mechanism may also be used by the driver to effectively turn off the
run-time power management of the device until the user space turns it on.
Namely, during the initialization the driver can make sure that the run-time PM
status of the device is 'active' and call pm_runtime_forbid(). It should be
noted, however, that if the user space has already intentionally changed the
value of /sys/devices/.../power/control to "auto" to allow the driver to power
manage the device at run time, the driver may confuse it by using
pm_runtime_forbid() this way.

6. Run-time PM and System Sleep

Run-time PM and system sleep (i.e., system suspend and hibernation, also known
Expand Down Expand Up @@ -463,64 +431,3 @@ The PM core always increments the run-time usage counter before calling the
->prepare() callback and decrements it after calling the ->complete() callback.
Hence disabling run-time PM temporarily like this will not cause any run-time
suspend callbacks to be lost.

7. Generic subsystem callbacks

Subsystems may wish to conserve code space by using the set of generic power
management callbacks provided by the PM core, defined in
driver/base/power/generic_ops.c:

int pm_generic_runtime_idle(struct device *dev);
- invoke the ->runtime_idle() callback provided by the driver of this
device, if defined, and call pm_runtime_suspend() for this device if the
return value is 0 or the callback is not defined

int pm_generic_runtime_suspend(struct device *dev);
- invoke the ->runtime_suspend() callback provided by the driver of this
device and return its result, or return -EINVAL if not defined

int pm_generic_runtime_resume(struct device *dev);
- invoke the ->runtime_resume() callback provided by the driver of this
device and return its result, or return -EINVAL if not defined

int pm_generic_suspend(struct device *dev);
- if the device has not been suspended at run time, invoke the ->suspend()
callback provided by its driver and return its result, or return 0 if not
defined

int pm_generic_resume(struct device *dev);
- invoke the ->resume() callback provided by the driver of this device and,
if successful, change the device's runtime PM status to 'active'

int pm_generic_freeze(struct device *dev);
- if the device has not been suspended at run time, invoke the ->freeze()
callback provided by its driver and return its result, or return 0 if not
defined

int pm_generic_thaw(struct device *dev);
- if the device has not been suspended at run time, invoke the ->thaw()
callback provided by its driver and return its result, or return 0 if not
defined

int pm_generic_poweroff(struct device *dev);
- if the device has not been suspended at run time, invoke the ->poweroff()
callback provided by its driver and return its result, or return 0 if not
defined

int pm_generic_restore(struct device *dev);
- invoke the ->restore() callback provided by the driver of this device and,
if successful, change the device's runtime PM status to 'active'

These functions can be assigned to the ->runtime_idle(), ->runtime_suspend(),
->runtime_resume(), ->suspend(), ->resume(), ->freeze(), ->thaw(), ->poweroff(),
or ->restore() callback pointers in the subsystem-level dev_pm_ops structures.

If a subsystem wishes to use all of them at the same time, it can simply assign
the GENERIC_SUBSYS_PM_OPS macro, defined in include/linux/pm.h, to its
dev_pm_ops structure pointer.

Device drivers that wish to use the same function as a system suspend, freeze,
poweroff and run-time suspend callback, and similarly for system resume, thaw,
restore, and run-time resume, can achieve this with the help of the
UNIVERSAL_DEV_PM_OPS macro defined in include/linux/pm.h (possibly setting its
last argument to NULL).
14 changes: 0 additions & 14 deletions trunk/arch/parisc/Kconfig.debug
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,4 @@ config DEBUG_RODATA
portion of the kernel code won't be covered by a TLB anymore.
If in doubt, say "N".

config DEBUG_STRICT_USER_COPY_CHECKS
bool "Strict copy size checks"
depends on DEBUG_KERNEL && !TRACE_BRANCH_PROFILING
---help---
Enabling this option turns a certain set of sanity checks for user
copy operations into compile time failures.

The copy_from_user() etc checks are there to help test if there
are sufficient security checks on the length argument of
the copy operation, by having gcc prove that the argument is
within bounds.

If unsure, or if you run an older (pre 4.4) gcc, say N.

endmenu
23 changes: 22 additions & 1 deletion trunk/arch/parisc/include/asm/param.h
Original file line number Diff line number Diff line change
@@ -1 +1,22 @@
#include <asm-generic/param.h>
#ifndef _ASMPARISC_PARAM_H
#define _ASMPARISC_PARAM_H

#ifdef __KERNEL__
#define HZ CONFIG_HZ
#define USER_HZ 100 /* some user API use "ticks" */
#define CLOCKS_PER_SEC (USER_HZ) /* like times() */
#endif

#ifndef HZ
#define HZ 100
#endif

#define EXEC_PAGESIZE 4096

#ifndef NOGROUP
#define NOGROUP (-1)
#endif

#define MAXHOSTNAMELEN 64 /* max length of hostname */

#endif
2 changes: 1 addition & 1 deletion trunk/arch/parisc/include/asm/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ static inline void set_eiem(unsigned long val)
ldcd). */

#define __PA_LDCW_ALIGNMENT 4
#define __ldcw_align(a) (&(a)->slock)
#define __ldcw_align(a) ((volatile unsigned int *)a)
#define __LDCW "ldcw,co"

#endif /*!CONFIG_PA20*/
Expand Down
27 changes: 2 additions & 25 deletions trunk/arch/parisc/include/asm/uaccess.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include <asm/page.h>
#include <asm/system.h>
#include <asm/cache.h>
#include <asm/errno.h>
#include <asm-generic/uaccess-unaligned.h>

#define VERIFY_READ 0
Expand Down Expand Up @@ -235,35 +234,13 @@ extern long lstrnlen_user(const char __user *,long);

unsigned long copy_to_user(void __user *dst, const void *src, unsigned long len);
#define __copy_to_user copy_to_user
unsigned long __copy_from_user(void *dst, const void __user *src, unsigned long len);
unsigned long copy_from_user(void *dst, const void __user *src, unsigned long len);
#define __copy_from_user copy_from_user
unsigned long copy_in_user(void __user *dst, const void __user *src, unsigned long len);
#define __copy_in_user copy_in_user
#define __copy_to_user_inatomic __copy_to_user
#define __copy_from_user_inatomic __copy_from_user

extern void copy_from_user_overflow(void)
#ifdef CONFIG_DEBUG_STRICT_USER_COPY_CHECKS
__compiletime_error("copy_from_user() buffer size is not provably correct")
#else
__compiletime_warning("copy_from_user() buffer size is not provably correct")
#endif
;

static inline unsigned long __must_check copy_from_user(void *to,
const void __user *from,
unsigned long n)
{
int sz = __compiletime_object_size(to);
int ret = -EFAULT;

if (likely(sz == -1 || !__builtin_constant_p(n) || sz >= n))
ret = __copy_from_user(to, from, n);
else
copy_from_user_overflow();

return ret;
}

struct pt_regs;
int fixup_exception(struct pt_regs *regs);

Expand Down
4 changes: 1 addition & 3 deletions trunk/arch/parisc/include/asm/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -811,10 +811,8 @@
#define __NR_pwritev (__NR_Linux + 316)
#define __NR_rt_tgsigqueueinfo (__NR_Linux + 317)
#define __NR_perf_event_open (__NR_Linux + 318)
#define __NR_recvmmsg (__NR_Linux + 319)
#define __NR_accept4 (__NR_Linux + 320)

#define __NR_Linux_syscalls (__NR_accept4 + 1)
#define __NR_Linux_syscalls (__NR_perf_event_open + 1)


#define __IGNORE_select /* newselect */
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/parisc/kernel/cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,14 +171,14 @@ parisc_cache_init(void)
cache_info.ic_conf.cc_cst,
cache_info.ic_conf.cc_hv);

printk("D-TLB conf: sh %d page %d cst %d aid %d pad1 %d\n",
printk("D-TLB conf: sh %d page %d cst %d aid %d pad1 %d \n",
cache_info.dt_conf.tc_sh,
cache_info.dt_conf.tc_page,
cache_info.dt_conf.tc_cst,
cache_info.dt_conf.tc_aid,
cache_info.dt_conf.tc_pad1);

printk("I-TLB conf: sh %d page %d cst %d aid %d pad1 %d\n",
printk("I-TLB conf: sh %d page %d cst %d aid %d pad1 %d \n",
cache_info.it_conf.tc_sh,
cache_info.it_conf.tc_page,
cache_info.it_conf.tc_cst,
Expand Down
2 changes: 0 additions & 2 deletions trunk/arch/parisc/kernel/syscall_table.S
Original file line number Diff line number Diff line change
Expand Up @@ -417,8 +417,6 @@
ENTRY_COMP(pwritev)
ENTRY_COMP(rt_tgsigqueueinfo)
ENTRY_SAME(perf_event_open)
ENTRY_COMP(recvmmsg)
ENTRY_SAME(accept4) /* 320 */

/* Nothing yet */

Expand Down
29 changes: 16 additions & 13 deletions trunk/arch/parisc/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,21 +250,9 @@ static int __init rtc_init(void)
}
module_init(rtc_init);

void read_persistent_clock(struct timespec *ts)
{
static struct pdc_tod tod_data;
if (pdc_tod_read(&tod_data) == 0) {
ts->tv_sec = tod_data.tod_sec;
ts->tv_nsec = tod_data.tod_usec * 1000;
} else {
printk(KERN_ERR "Error reading tod clock\n");
ts->tv_sec = 0;
ts->tv_nsec = 0;
}
}

void __init time_init(void)
{
static struct pdc_tod tod_data;
unsigned long current_cr16_khz;

clocktick = (100 * PAGE0->mem_10msec) / HZ;
Expand All @@ -276,4 +264,19 @@ void __init time_init(void)
clocksource_cr16.mult = clocksource_khz2mult(current_cr16_khz,
clocksource_cr16.shift);
clocksource_register(&clocksource_cr16);

if (pdc_tod_read(&tod_data) == 0) {
unsigned long flags;

write_seqlock_irqsave(&xtime_lock, flags);
xtime.tv_sec = tod_data.tod_sec;
xtime.tv_nsec = tod_data.tod_usec * 1000;
set_normalized_timespec(&wall_to_monotonic,
-xtime.tv_sec, -xtime.tv_nsec);
write_sequnlock_irqrestore(&xtime_lock, flags);
} else {
printk(KERN_ERR "Error reading tod clock\n");
xtime.tv_sec = 0;
xtime.tv_nsec = 0;
}
}
14 changes: 10 additions & 4 deletions trunk/arch/parisc/kernel/unaligned.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
#include <linux/module.h>
#include <linux/sched.h>
#include <linux/signal.h>
#include <linux/ratelimit.h>
#include <asm/uaccess.h>

/* #define DEBUG_UNALIGNED 1 */
Expand Down Expand Up @@ -447,7 +446,8 @@ static int emulate_std(struct pt_regs *regs, int frreg, int flop)

void handle_unaligned(struct pt_regs *regs)
{
static DEFINE_RATELIMIT_STATE(ratelimit, 5 * HZ, 5);
static unsigned long unaligned_count = 0;
static unsigned long last_time = 0;
unsigned long newbase = R1(regs->iir)?regs->gr[R1(regs->iir)]:0;
int modify = 0;
int ret = ERR_NOTHANDLED;
Expand All @@ -460,8 +460,14 @@ void handle_unaligned(struct pt_regs *regs)
goto force_sigbus;
}

if (!(current->thread.flags & PARISC_UAC_NOPRINT) &&
__ratelimit(&ratelimit)) {
if (unaligned_count > 5 &&
time_after(jiffies, last_time + 5 * HZ)) {
unaligned_count = 0;
last_time = jiffies;
}

if (!(current->thread.flags & PARISC_UAC_NOPRINT)
&& ++unaligned_count < 5) {
char buf[256];
sprintf(buf, "%s(%d): unaligned access to 0x" RFMT " at ip=0x" RFMT "\n",
current->comm, task_pid_nr(current), regs->ior, regs->iaoq[0]);
Expand Down
3 changes: 1 addition & 2 deletions trunk/arch/parisc/lib/memcpy.c
Original file line number Diff line number Diff line change
Expand Up @@ -475,8 +475,7 @@ unsigned long copy_to_user(void __user *dst, const void *src, unsigned long len)
return pa_memcpy((void __force *)dst, src, len);
}

EXPORT_SYMBOL(__copy_from_user);
unsigned long __copy_from_user(void *dst, const void __user *src, unsigned long len)
unsigned long copy_from_user(void *dst, const void __user *src, unsigned long len)
{
mtsp(get_user_space(), 1);
mtsp(get_kernel_space(), 2);
Expand Down
16 changes: 0 additions & 16 deletions trunk/arch/sh/boards/mach-migor/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -419,9 +419,6 @@ static struct i2c_board_info migor_i2c_devices[] = {
I2C_BOARD_INFO("migor_ts", 0x51),
.irq = 38, /* IRQ6 */
},
{
I2C_BOARD_INFO("wm8978", 0x1a),
},
};

static struct i2c_board_info migor_i2c_camera[] = {
Expand Down Expand Up @@ -622,19 +619,6 @@ static int __init migor_devices_setup(void)

platform_resource_setup_memory(&migor_ceu_device, "ceu", 4 << 20);

/* SIU: Port B */
gpio_request(GPIO_FN_SIUBOLR, NULL);
gpio_request(GPIO_FN_SIUBOBT, NULL);
gpio_request(GPIO_FN_SIUBISLD, NULL);
gpio_request(GPIO_FN_SIUBOSLD, NULL);
gpio_request(GPIO_FN_SIUMCKB, NULL);

/*
* The original driver sets SIUB OLR/OBT, ILR/IBT, and SIUA OLR/OBT to
* output. Need only SIUB, set to output for master mode (table 34.2)
*/
__raw_writew(__raw_readw(PORT_MSELCRA) | 1, PORT_MSELCRA);

i2c_register_board_info(0, migor_i2c_devices,
ARRAY_SIZE(migor_i2c_devices));

Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/sh/boot/compressed/cache.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ int cache_control(unsigned int command)

for (i = 0; i < (32 * 1024); i += 32) {
(void)*p;
p += (32 / sizeof(int));
p += (32 / sizeof (int));
}

return 0;
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/sh/include/asm/cacheflush.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ extern void copy_from_user_page(struct vm_area_struct *vma,
struct page *page, unsigned long vaddr, void *dst, const void *src,
unsigned long len);

#define flush_cache_vmap(start, end) local_flush_cache_all(NULL)
#define flush_cache_vunmap(start, end) local_flush_cache_all(NULL)
#define flush_cache_vmap(start, end) flush_cache_all()
#define flush_cache_vunmap(start, end) flush_cache_all()

#define flush_dcache_mmap_lock(mapping) do { } while (0)
#define flush_dcache_mmap_unlock(mapping) do { } while (0)
Expand Down
Loading

0 comments on commit 3562caa

Please sign in to comment.