Skip to content

Commit

Permalink
remove jrcu, fix more typos and make v4l2 build if selected
Browse files Browse the repository at this point in the history
  • Loading branch information
joilaroi committed May 7, 2012
1 parent d74224d commit 91f05b6
Show file tree
Hide file tree
Showing 18 changed files with 49 additions and 179 deletions.
3 changes: 2 additions & 1 deletion arch/arm/mach-msm/include/mach/board.h
Expand Up @@ -79,12 +79,13 @@ struct msm_camera_legacy_device_platform_data {

#define MSM_CAMERA_FLASH_NONE 0
#define MSM_CAMERA_FLASH_LED 1

#ifdef CONFIG_HUAWEI_CAMERA
struct msm_camera_sensor_vreg {
const char *vreg_name;
unsigned int mv;
uint8_t always_on;
};
#endif //CONFIG_HUAWEI_CAMERA

#define MSM_CAMERA_FLASH_SRC_PMIC (0x00000001<<0)
#define MSM_CAMERA_FLASH_SRC_PWM (0x00000001<<1)
Expand Down
4 changes: 3 additions & 1 deletion arch/arm/mach-msm/include/mach/camera.h
Expand Up @@ -24,7 +24,7 @@
#include <linux/cdev.h>
#include <linux/platform_device.h>
#include <linux/wakelock.h>
#include "linux/types.h"
#include <linux/types.h>

#include <mach/board.h>
#include <media/msm_camera.h>
Expand Down Expand Up @@ -209,6 +209,7 @@ static inline int msm_camera_flash_set_led_state(unsigned led_state)
}
#endif

#ifdef CONFIG_MSM_CAMERA_V4L2
/* Below functions are added for V4L2 kernel APIs */
struct msm_v4l2_driver {
struct msm_sync *sync;
Expand All @@ -225,6 +226,7 @@ struct msm_v4l2_driver {

int msm_v4l2_register(struct msm_v4l2_driver *);
int msm_v4l2_unregister(struct msm_v4l2_driver *);
#endif

void msm_camvfe_init(void);
int msm_camvfe_check(void *);
Expand Down
2 changes: 1 addition & 1 deletion drivers/i2c/chips/akm8975.c
Expand Up @@ -33,7 +33,7 @@
#include <linux/akm8975.h>
#include <linux/earlysuspend.h>

#include "linux/hardware_self_adapt.h"
#include <linux/hardware_self_adapt.h>

#ifdef CONFIG_HUAWEI_HW_DEV_DCT
#include <linux/hw_dev_dec.h>
Expand Down
14 changes: 12 additions & 2 deletions drivers/media/video/Kconfig
Expand Up @@ -1048,6 +1048,8 @@ config USB_S2255

endif # V4L_USB_DRIVERS

endif # VIDEO_CAPTURE_DRIVERS

#
# MSM camera configuration
#
Expand All @@ -1062,14 +1064,22 @@ menuconfig MSM_CAMERA
Say Y here to enable selecting the video adapters for
Qualcomm msm camera and video encoding

config MSM_CAMERA_V4L2
bool "Video For Linux interface to MSM camera"
depends on MSM_CAMERA && VIDEO_V4L2 && EXPERIMENTAL
default y
help
Say Y here to enable the V4L2 interface for the MSM camera.
Not everything works through this interface and it has not
been thoroughly tested.

config MSM_CAMERA_DEBUG
bool "Qualcomm MSM camera debugging with printk"
depends on MSM_CAMERA
default n
help
Enable printk() debug for msm camera


# MSM camera does not require V4L2
source "drivers/media/video/msm/Kconfig"

endif # VIDEO_CAPTURE_DRIVERS
3 changes: 2 additions & 1 deletion drivers/media/video/msm/Makefile
Expand Up @@ -3,7 +3,8 @@ ifeq ($(GCC_VERSION),0404)
CFLAGS_REMOVE_msm_vfe8x.o = -Wframe-larger-than=1024
endif

obj-$(CONFIG_MSM_CAMERA) += msm_camera.o msm_v4l2.o msm_axi_qos.o
obj-$(CONFIG_MSM_CAMERA) += msm_camera.o msm_axi_qos.o
obj-$(CONFIG_MSM_CAMERA_V4L2) +=msm_v4l2.o
obj-$(CONFIG_MSM_CAMERA_FLASH) += flash.o
obj-$(CONFIG_ARCH_MSM_ARM11) += msm_vfe7x.o msm_io7x.o
obj-$(CONFIG_ARCH_MSM7X30) += msm_vfe31.o msm_io_vfe31.o
Expand Down
6 changes: 6 additions & 0 deletions drivers/media/video/msm/msm_camera.c
Expand Up @@ -874,6 +874,7 @@ static int msm_get_stats(struct msm_sync *sync, void __user *arg)
se.ctrl_cmd.resp_fd = ctrl->resp_fd;
break;

#ifdef CONFIG_MSM_CAMERA_V4L2
case MSM_CAM_Q_V4L2_REQ:
/* control command from v4l2 client */
ctrl = (struct msm_ctrl_cmd *)(qcmd->command);
Expand All @@ -897,6 +898,7 @@ static int msm_get_stats(struct msm_sync *sync, void __user *arg)
se.ctrl_cmd.type = ctrl->type;
se.ctrl_cmd.length = ctrl->length;
break;
#endif

default:
rc = -EFAULT;
Expand Down Expand Up @@ -2175,6 +2177,7 @@ static int msm_open_control(struct inode *inode, struct file *filep)
return rc;
}

#ifdef CONFIG_MSM_CAMERA_V4L2
static int __msm_v4l2_control(struct msm_sync *sync,
struct msm_ctrl_cmd *out)
{
Expand Down Expand Up @@ -2219,6 +2222,7 @@ static int __msm_v4l2_control(struct msm_sync *sync,
CDBG("__msm_v4l2_control: end rc = %d\n", rc);
return rc;
}
#endif

static const struct file_operations msm_fops_config = {
.owner = THIS_MODULE,
Expand Down Expand Up @@ -2281,6 +2285,7 @@ static int msm_tear_down_cdev(struct msm_device *msm, dev_t devno)
return 0;
}

#ifdef CONFIG_MSM_CAMERA_V4L2
int msm_v4l2_register(struct msm_v4l2_driver *drv)
{
/* FIXME: support multiple sensors */
Expand All @@ -2307,6 +2312,7 @@ int msm_v4l2_unregister(struct msm_v4l2_driver *drv)
return 0;
}
EXPORT_SYMBOL(msm_v4l2_unregister);
#endif

static int msm_sync_init(struct msm_sync *sync,
struct platform_device *pdev,
Expand Down
8 changes: 4 additions & 4 deletions fs/yaffs2/yaffs_mtdif.c
Expand Up @@ -15,10 +15,10 @@

#include "yaffs_mtdif.h"

#include "linux/mtd/mtd.h"
#include "linux/types.h"
#include "linux/time.h"
#include "linux/mtd/nand.h"
#include <linux/mtd/mtd.h>
#include <linux/types.h>
#include <linux/time.h>
#include <linux/mtd/nand.h>

#include "yaffs_linux.h"

Expand Down
8 changes: 4 additions & 4 deletions fs/yaffs2/yaffs_mtdif1.c
Expand Up @@ -31,10 +31,10 @@
#include "yaffs_tagscompat.h" /* for yaffs_calc_tags_ecc */
#include "yaffs_linux.h"

#include "linux/kernel.h"
#include "linux/version.h"
#include "linux/types.h"
#include "linux/mtd/mtd.h"
#include <linux/kernel.h>
#include <linux/version.h>
#include <linux/types.h>
#include <linux/mtd/mtd.h>

/* Don't compile this module if we don't have MTD's mtd_oob_ops interface */
#if (MTD_VERSION_CODE > MTD_VERSION(2, 6, 17))
Expand Down
6 changes: 3 additions & 3 deletions fs/yaffs2/yaffs_mtdif2.c
Expand Up @@ -18,9 +18,9 @@

#include "yaffs_mtdif2.h"

#include "linux/mtd/mtd.h"
#include "linux/types.h"
#include "linux/time.h"
#include <linux/mtd/mtd.h>
#include <linux/types.h>
#include <linux/time.h>

#include "yaffs_packedtags2.h"

Expand Down
8 changes: 1 addition & 7 deletions include/linux/hardirq.h
Expand Up @@ -138,13 +138,7 @@ static inline void account_system_vtime(struct task_struct *tsk)
}
#endif

#if defined(CONFIG_JRCU)
extern int rcu_nmi_seen;
# define rcu_irq_enter() do { } while (0)
# define rcu_irq_exit() do { } while (0)
# define rcu_nmi_enter() do { rcu_nmi_seen = 1; } while (0)
# define rcu_nmi_exit() do { } while (0)
#elif defined(CONFIG_NO_HZ)
#if defined(CONFIG_NO_HZ)
#if defined(CONFIG_TINY_RCU)
extern void rcu_enter_nohz(void);
extern void rcu_exit_nohz(void);
Expand Down
11 changes: 2 additions & 9 deletions include/linux/kernel.h
Expand Up @@ -117,18 +117,11 @@ struct completion;
struct pt_regs;
struct user;

/* cannot bring in linux/rcupdate.h at this point */
#ifdef CONFIG_JRCU
extern void rcu_note_might_resched(void);
#else
#define rcu_note_might_resched()
#endif /*JRCU */

#ifdef CONFIG_PREEMPT_VOLUNTARY
extern int _cond_resched(void);
# define might_resched() do { _cond_resched(); rcu_note_might_resched(); } while (0)
# define might_resched() _cond_resched()
#else
# define might_resched() do { rcu_note_might_resched(); } while (0)
# define might_resched() do { } while (0)
#endif

#ifdef CONFIG_DEBUG_SPINLOCK_SLEEP
Expand Down
31 changes: 2 additions & 29 deletions include/linux/preempt.h
Expand Up @@ -10,45 +10,18 @@
#include <linux/linkage.h>
#include <linux/list.h>

/* cannot include rcupdate.h here, so open-code this */

#if defined(CONFIG_JRCU)
# define __add_preempt_count(val) do { \
int newval = (preempt_count() += (val)); \
if (newval == (val)) \
smp_wmb(); \
} while (0)
#else
# define __add_preempt_count(val) do { preempt_count() += (val); } while (0)
#endif

#if defined(CONFIG_JRCU_LAZY) || !defined(CONFIG_JRCU)
# define __sub_preempt_count(val) do { preempt_count() -= (val); } while (0)
#else
# define __sub_preempt_count(val) do { \
int newval = (preempt_count() -= (val)); \
if (newval == 0) { \
/* race with preemption OK, preempt will do the mb for us */ \
smp_wmb(); \
} \
} while (0)
#endif

#if defined(CONFIG_DEBUG_PREEMPT) || defined(CONFIG_PREEMPT_TRACER)
extern void add_preempt_count(int val);
extern void sub_preempt_count(int val);
#else
# define add_preempt_count(val) __add_preempt_count(val)
# define sub_preempt_count(val) __sub_preempt_count(val)
# define add_preempt_count(val) do { preempt_count() += (val); } while (0)
# define sub_preempt_count(val) do { preempt_count() -= (val); } while (0)
#endif

#define inc_preempt_count() add_preempt_count(1)
#define dec_preempt_count() sub_preempt_count(1)

#define preempt_count() (current_thread_info()->preempt_count)
#ifdef CONFIG_PREEMPT_COUNT_CPU
extern int preempt_count_cpu(int cpu);
#endif

#ifdef CONFIG_PREEMPT

Expand Down
4 changes: 1 addition & 3 deletions include/linux/rcupdate.h
Expand Up @@ -77,9 +77,7 @@ extern int rcu_scheduler_active;

#if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU)
#include <linux/rcutree.h>
#elif defined(CONFIG_JRCU)
#include <linux/jrcu.h>
#elif defined(CONFIG_TINY_RCU)
#elif CONFIG_TINY_RCU
#include <linux/rcutiny.h>
#else
#error "Unknown RCU implementation specified to kernel configuration"
Expand Down
2 changes: 0 additions & 2 deletions include/linux/sched.h
Expand Up @@ -1896,8 +1896,6 @@ extern void wake_up_idle_cpu(int cpu);
static inline void wake_up_idle_cpu(int cpu) { }
#endif

extern void force_cpu_resched(int cpu);

extern unsigned int sysctl_sched_latency;
extern unsigned int sysctl_sched_min_granularity;
extern unsigned int sysctl_sched_wakeup_granularity;
Expand Down
63 changes: 0 additions & 63 deletions init/Kconfig
Expand Up @@ -372,71 +372,8 @@ config TINY_RCU
is not required. This option greatly reduces the
memory footprint of RCU.

config JRCU
bool "A tiny single-CPU RCU for small SMP systems"
depends on PREEMPT
depends on !SMP
select PREEMPT_COUNT_CPU
help
This option selects a minimal-footprint RCU suitable for small SMP
systems -- that is, those with fewer than 16 or perhaps 32, and
certainly less than 64 processors.

This RCU variant may be a good choice for systems with low latency
requirements. It does RCU garbage collection from a single CPU
rather than have each CPU do its own. This frees up all but one
CPU from interference by this periodic requirement.

Most users should say N here.

endchoice

config JRCU_DAEMON
bool
depends on JRCU
default y
help
Required. The context switch when leaving the daemon is needed
to get the CPU to reliably participate in end-of-batch processing.

config JRCU_DAEMON_PRIO
int "JRCU Daemon priority"
depends on JRCU_DAEMON
default 0
help
The JRCU daemon priority. If 0 then the daemon runs SCHED_OTHER.
If >0 then the daemon runs SCHED_RR and its priority will be
the value selected. If <0 then SCHED_RR is again selected, but
now its priority will be the biased downwards from the maximum
possible Posix priority.

config JRCU_LAZY
bool "Should JRCU be lazy recognizing end-of-batch"
depends on JRCU
default n
help
If you say Y here, JRCU will on occasion fail to recognize
end-of-batch for an rcu period or two.

If you say N here, JRCU will be more aggressive; in fact it
will always recognize end-of-batch at the earliest possible time.

Being lazy should be fractionally more efficient in that JRCU
inserts fewer memory barriers along some high performance kernel
code paths.

If unsure, say N.

config PREEMPT_COUNT_CPU
bool "preempt count cpu"
depends on JRCU
default n
help
If Y then the preempt_count_cpu() function will be compiled into
the kernel. Its existance impacts kernel performance slightly,
so this option should be selected only if other kernel features
that use preempt_count_cpu() are also selected.

config RCU_TRACE
bool "Enable tracing for RCU"
depends on TREE_RCU || TREE_PREEMPT_RCU
Expand Down
1 change: 0 additions & 1 deletion kernel/Makefile
Expand Up @@ -80,7 +80,6 @@ obj-$(CONFIG_GENERIC_HARDIRQS) += irq/
obj-$(CONFIG_SECCOMP) += seccomp.o
obj-$(CONFIG_RCU_TORTURE_TEST) += rcutorture.o
obj-$(CONFIG_TREE_RCU) += rcutree.o
obj-$(CONFIG_JRCU) += jrcu.o
obj-$(CONFIG_TREE_PREEMPT_RCU) += rcutree.o
obj-$(CONFIG_TREE_RCU_TRACE) += rcutree_trace.o
obj-$(CONFIG_TINY_RCU) += rcutiny.o
Expand Down

0 comments on commit 91f05b6

Please sign in to comment.