Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- commit f279731288d2d85484ddd20078e6bae332404875
- Author: Andy (andy572) <17andy@gmx.de>
- Date: Wed Mar 23 16:51:08 2011 +0100
- Replace spinlock with mutex lock
- diff --git a/arch/arm/mach-msm/smd_rpcrouter.c b/arch/arm/mach-msm/smd_rpcrouter.c
- index 8934b4f..5a2dc2b 100755
- --- a/arch/arm/mach-msm/smd_rpcrouter.c
- +++ b/arch/arm/mach-msm/smd_rpcrouter.c
- @@ -212,21 +212,25 @@ struct rpcrouter_xprt_info {
- };
- static LIST_HEAD(xprt_info_list);
- -static DEFINE_SPINLOCK(xprt_info_list_lock);
- +//static DEFINE_SPINLOCK(xprt_info_list_lock);
- +static DEFINE_MUTEX(xprt_info_list_lock);
- static struct rpcrouter_xprt_info *rpcrouter_get_xprt_info(uint32_t remote_pid)
- {
- struct rpcrouter_xprt_info *xprt_info;
- - unsigned long flags;
- +// unsigned long flags;
- - spin_lock_irqsave(&xprt_info_list_lock, flags);
- +// spin_lock_irqsave(&xprt_info_list_lock, flags);
- + mutex_lock(&xprt_info_list_lock);
- list_for_each_entry(xprt_info, &xprt_info_list, list) {
- if (xprt_info->remote_pid == remote_pid) {
- - spin_unlock_irqrestore(&xprt_info_list_lock, flags);
- + //spin_unlock_irqrestore(&xprt_info_list_lock, flags);
- + mutex_unlock(&xprt_info_list_lock);
- return xprt_info;
- }
- }
- - spin_unlock_irqrestore(&xprt_info_list_lock, flags);
- + //spin_unlock_irqrestore(&xprt_info_list_lock, flags);
- + mutex_unlock(&xprt_info_list_lock);
- return NULL;
- }
- @@ -548,15 +552,18 @@ int msm_rpcrouter_destroy_local_endpoint(struct msm_rpc_endpoint *ept)
- msg.cli.cid = ept->cid;
- RR("x REMOVE_CLIENT id=%d:%08x\n", ept->pid, ept->cid);
- - spin_lock_irqsave(&xprt_info_list_lock, flags);
- + //spin_lock_irqsave(&xprt_info_list_lock, flags);
- + mutex_lock(&xprt_info_list_lock);
- list_for_each_entry(xprt_info, &xprt_info_list, list) {
- rc = rpcrouter_send_control_msg(xprt_info, &msg);
- if (rc < 0) {
- - spin_unlock_irqrestore(&xprt_info_list_lock, flags);
- + //spin_unlock_irqrestore(&xprt_info_list_lock, flags);
- + mutex_unlock(&xprt_info_list_lock);
- return rc;
- }
- }
- - spin_unlock_irqrestore(&xprt_info_list_lock, flags);
- + //spin_unlock_irqrestore(&xprt_info_list_lock, flags);
- + mutex_unlock(&xprt_info_list_lock);
- /* Free replies */
- spin_lock_irqsave(&ept->reply_q_lock, flags);
- @@ -1917,7 +1924,7 @@ int msm_rpc_register_server(struct msm_rpc_endpoint *ept,
- union rr_control_msg msg;
- struct rr_server *server;
- struct rpcrouter_xprt_info *xprt_info;
- - unsigned long flags;
- +// unsigned long flags;
- server = rpcrouter_create_server(ept->pid, ept->cid,
- prog, vers);
- @@ -1933,15 +1940,18 @@ int msm_rpc_register_server(struct msm_rpc_endpoint *ept,
- RR("x NEW_SERVER id=%d:%08x prog=%08x:%08x\n",
- ept->pid, ept->cid, prog, vers);
- - spin_lock_irqsave(&xprt_info_list_lock, flags);
- + //spin_lock_irqsave(&xprt_info_list_lock, flags);
- + mutex_lock(&xprt_info_list_lock);
- list_for_each_entry(xprt_info, &xprt_info_list, list) {
- rc = rpcrouter_send_control_msg(xprt_info, &msg);
- if (rc < 0) {
- - spin_unlock_irqrestore(&xprt_info_list_lock, flags);
- + //spin_unlock_irqrestore(&xprt_info_list_lock, flags);
- + mutex_unlock(&xprt_info_list_lock);
- return rc;
- }
- }
- - spin_unlock_irqrestore(&xprt_info_list_lock, flags);
- + //spin_unlock_irqrestore(&xprt_info_list_lock, flags);
- + mutex_unlock(&xprt_info_list_lock);
- return 0;
- }
- @@ -2015,16 +2025,18 @@ static int msm_rpcrouter_modem_notify(struct notifier_block *this,
- int msm_rpcrouter_close(void)
- {
- struct rpcrouter_xprt_info *xprt_info, *tmp_xprt_info;
- - unsigned long flags;
- +// unsigned long flags;
- - spin_lock_irqsave(&xprt_info_list_lock, flags);
- +// spin_lock_irqsave(&xprt_info_list_lock, flags);
- + mutex_lock(&xprt_info_list_lock);
- list_for_each_entry_safe(xprt_info, tmp_xprt_info,
- &xprt_info_list, list) {
- xprt_info->xprt->close();
- list_del(&xprt_info->list);
- kfree(xprt_info);
- }
- - spin_unlock_irqrestore(&xprt_info_list_lock, flags);
- +// spin_unlock_irqrestore(&xprt_info_list_lock, flags);
- + mutex_unlock(&xprt_info_list_lock);
- return 0;
- }
- @@ -2189,7 +2201,7 @@ static int msm_rpcrouter_add_xprt(struct rpcrouter_xprt *xprt)
- {
- struct rpcrouter_xprt_info *xprt_info;
- static uint32_t workthread_created;
- - unsigned long flags;
- +// unsigned long flags;
- xprt_info = kmalloc(sizeof(struct rpcrouter_xprt_info), GFP_KERNEL);
- if (!xprt_info)
- @@ -2229,9 +2241,11 @@ static int msm_rpcrouter_add_xprt(struct rpcrouter_xprt *xprt)
- xprt_info->initialized = 1;
- }
- - spin_lock_irqsave(&xprt_info_list_lock, flags);
- +// spin_lock_irqsave(&xprt_info_list_lock, flags);
- + mutex_lock(&xprt_info_list_lock);
- list_add_tail(&xprt_info->list, &xprt_info_list);
- - spin_unlock_irqrestore(&xprt_info_list_lock, flags);
- +// spin_unlock_irqrestore(&xprt_info_list_lock, flags);
- + mutex_unlock(&xprt_info_list_lock);
- queue_work(xprt_info->workqueue, &xprt_info->read_data);
- commit 380eb0eb9a807a2021db650d63424e37563d88d2
- Author: Andy572 <17andy@gmx.de>
- Date: Sat Mar 26 00:07:46 2011 +0100
- Add filter for input events
- diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c
- index d862742..5bf58e9 100644
- --- a/drivers/cpufreq/cpufreq_ondemand.c
- +++ b/drivers/cpufreq/cpufreq_ondemand.c
- @@ -654,12 +654,31 @@ static void dbs_input_event(struct input_handle *handle, unsigned int type,
- }
- +static int input_dev_filter(const char* input_dev_name)
- +{
- + int ret = 0;
- + if (strstr(input_dev_name, "touchscreen") ||
- + strstr(input_dev_name, "-keypad") ||
- + strstr(input_dev_name, "-nav") ||
- + strstr(input_dev_name, "-oj")) {
- + }
- + else {
- + ret = 1;
- + }
- +
- + return ret;
- +}
- +
- static int dbs_input_connect(struct input_handler *handler,
- struct input_dev *dev, const struct input_device_id *id)
- {
- struct input_handle *handle;
- int error;
- + /* filter out those input_dev that we don't care */
- + if (input_dev_filter(dev->name))
- + return 0;
- +
- handle = kzalloc(sizeof(struct input_handle), GFP_KERNEL);
- if (!handle)
- return -ENOMEM;
- commit a7d5ba9c76aa413bec1ddd229cbf623cb3fbfe95
- Author: Andy572 <17andy@gmx.de>
- Date: Sat Mar 26 22:31:36 2011 +0100
- USB: gadget: f_adb: Claim endpoints so they are not reused by another function.
- diff --git a/drivers/usb/gadget/f_adb.c b/drivers/usb/gadget/f_adb.c
- index 3f53f5e..ef06278 100644
- --- a/drivers/usb/gadget/f_adb.c
- +++ b/drivers/usb/gadget/f_adb.c
- @@ -250,6 +250,7 @@ static int create_bulk_endpoints(struct adb_dev *dev,
- return -ENODEV;
- }
- DBG(cdev, "usb_ep_autoconfig for ep_in got %s\n", ep->name);
- + ep->driver_data = dev; /* claim the endpoint */
- dev->ep_in = ep;
- ep = usb_ep_autoconfig(cdev->gadget, out_desc);
- @@ -258,6 +259,7 @@ static int create_bulk_endpoints(struct adb_dev *dev,
- return -ENODEV;
- }
- DBG(cdev, "usb_ep_autoconfig for adb ep_out got %s\n", ep->name);
- + ep->driver_data = dev; /* claim the endpoint */
- dev->ep_out = ep;
- /* now allocate requests for our endpoints */
- commit 515cc430b0b116771904a79979218c49a418aace
- Author: Andy572 <17andy@gmx.de>
- Date: Thu Mar 31 07:20:38 2011 +0200
- import vfpmodule from 2.6.35 to fix powermanagement
- diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c
- old mode 100644
- new mode 100755
- index 3ccf7e9..4933d6a
- --- a/arch/arm/vfp/vfpmodule.c
- +++ b/arch/arm/vfp/vfpmodule.c
- @@ -201,12 +201,8 @@ static void vfp_raise_exceptions(u32 exceptions, u32 inst, u32 fpscr, struct pt_
- * Comparison instructions always return at least one of
- * these flags set.
- */
- - /* Qualcomm's patch
- - * fix floating point problem
- - * 2010-08-06, cleaneye.kim@lge.com
- - */
- - if (exceptions & (FPSCR_N | FPSCR_Z | FPSCR_C | FPSCR_V))
- - fpscr &= ~(FPSCR_N | FPSCR_Z | FPSCR_C | FPSCR_V);
- + if (exceptions & (FPSCR_N|FPSCR_Z|FPSCR_C|FPSCR_V))
- + fpscr &= ~(FPSCR_N|FPSCR_Z|FPSCR_C|FPSCR_V);
- fpscr |= exceptions;
- @@ -429,31 +425,14 @@ void vfp_reinit(void)
- static int vfp_pm_suspend(struct sys_device *dev, pm_message_t state)
- {
- - struct thread_info *ti = current_thread_info();
- - u32 fpexc = fmrx(FPEXC);
- -
- - /* if vfp is on, then save state for resumption */
- - if (fpexc & FPEXC_EN) {
- - printk(KERN_DEBUG "%s: saving vfp state\n", __func__);
- - vfp_save_state(&ti->vfpstate, fpexc);
- -
- - /* disable, just in case */
- - fmxr(FPEXC, fmrx(FPEXC) & ~FPEXC_EN);
- - }
- -
- - /* clear any information we had about last context state */
- - memset(last_VFP_context, 0, sizeof(last_VFP_context));
- + vfp_flush_context();
- return 0;
- }
- static int vfp_pm_resume(struct sys_device *dev)
- {
- - /* ensure we have access to the vfp */
- - vfp_enable(NULL);
- -
- - /* and disable it to ensure the next usage restores the state */
- - fmxr(FPEXC, fmrx(FPEXC) & ~FPEXC_EN);
- + vfp_reinit();
- return 0;
- }
- @@ -479,54 +458,65 @@ static void vfp_pm_init(void)
- static inline void vfp_pm_init(void) { }
- #endif /* CONFIG_PM */
- -/*
- - * Synchronise the hardware VFP state of a thread other than current with the
- - * saved one. This function is used by the ptrace mechanism.
- - */
- -#ifdef CONFIG_SMP
- -void vfp_sync_state(struct thread_info *thread)
- +void vfp_sync_hwstate(struct thread_info *thread)
- {
- + unsigned int cpu = get_cpu();
- +
- /*
- - * On SMP systems, the VFP state is automatically saved at every
- - * context switch. We mark the thread VFP state as belonging to a
- - * non-existent CPU so that the saved one will be reloaded when
- - * needed.
- + * If the thread we're interested in is the current owner of the
- + * hardware VFP state, then we need to save its state.
- */
- - thread->vfpstate.hard.cpu = NR_CPUS;
- + if (last_VFP_context[cpu] == &thread->vfpstate) {
- + u32 fpexc = fmrx(FPEXC);
- +
- + /*
- + * Save the last VFP state on this CPU.
- + */
- + fmxr(FPEXC, fpexc | FPEXC_EN);
- + vfp_save_state(&thread->vfpstate, fpexc | FPEXC_EN);
- + fmxr(FPEXC, fpexc);
- + }
- +
- + put_cpu();
- }
- -#else
- -void vfp_sync_state(struct thread_info *thread)
- +
- +void vfp_flush_hwstate(struct thread_info *thread)
- {
- unsigned int cpu = get_cpu();
- - u32 fpexc = fmrx(FPEXC);
- /*
- - * If VFP is enabled, the previous state was already saved and
- - * last_VFP_context updated.
- + * If the thread we're interested in is the current owner of the
- + * hardware VFP state, then we need to save its state.
- */
- - if (fpexc & FPEXC_EN)
- - goto out;
- + if (last_VFP_context[cpu] == &thread->vfpstate) {
- + u32 fpexc = fmrx(FPEXC);
- - if (!last_VFP_context[cpu])
- - goto out;
- + fmxr(FPEXC, fpexc & ~FPEXC_EN);
- - /*
- - * Save the last VFP state on this CPU.
- - */
- - fmxr(FPEXC, fpexc | FPEXC_EN);
- - vfp_save_state(last_VFP_context[cpu], fpexc);
- - fmxr(FPEXC, fpexc);
- + /*
- + * Set the context to NULL to force a reload the next time
- + * the thread uses the VFP.
- + */
- + last_VFP_context[cpu] = NULL;
- + }
- +#ifdef CONFIG_SMP
- /*
- - * Set the context to NULL to force a reload the next time the thread
- - * uses the VFP.
- + * For SMP we still have to take care of the case where the thread
- + * migrates to another CPU and then back to the original CPU on which
- + * the last VFP user is still the same thread. Mark the thread VFP
- + * state as belonging to a non-existent CPU so that the saved one will
- + * be reloaded in the above case.
- */
- - last_VFP_context[cpu] = NULL;
- -
- -out:
- + thread->vfpstate.hard.cpu = NR_CPUS;
- +#endif
- put_cpu();
- }
- -#endif
- +
- +// backward compatible:
- +void vfp_sync_state(struct thread_info *thread) {
- + vfp_flush_hwstate(thread);
- +}
- #include <linux/smp.h>
- @@ -579,7 +569,7 @@ static int __init vfp_init(void)
- */
- elf_hwcap |= HWCAP_VFP;
- #ifdef CONFIG_VFPv3
- - if (VFP_arch >= 3) {
- + if (VFP_arch >= 2) {
- elf_hwcap |= HWCAP_VFPv3;
- /*
- commit c706951cb66062ca08469e2a61ad52c19079a647
- Author: Andy572 <17andy@gmx.de>
- Date: Sat Apr 2 22:55:48 2011 +0200
- USB: disable endpoints after unbinding interfaces, not before
- diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c
- index 980a8d2..738aa1e 100644
- --- a/drivers/usb/core/message.c
- +++ b/drivers/usb/core/message.c
- @@ -1185,13 +1185,14 @@ void usb_disable_device(struct usb_device *dev, int skip_ep0)
- {
- int i;
- +/*
- dev_dbg(&dev->dev, "%s nuking %s URBs\n", __func__,
- skip_ep0 ? "non-ep0" : "all");
- for (i = skip_ep0; i < 16; ++i) {
- usb_disable_endpoint(dev, i, true);
- usb_disable_endpoint(dev, i + USB_DIR_IN, true);
- }
- -
- +*/
- /* getting rid of interfaces will disconnect
- * any drivers bound to them (a key side effect)
- */
- @@ -1221,6 +1222,13 @@ void usb_disable_device(struct usb_device *dev, int skip_ep0)
- if (dev->state == USB_STATE_CONFIGURED)
- usb_set_device_state(dev, USB_STATE_ADDRESS);
- }
- +
- + dev_dbg(&dev->dev, "%s nuking %s URBs\n", __func__,
- + skip_ep0 ? "non-ep0" : "all");
- + for (i = skip_ep0; i < 16; ++i) {
- + usb_disable_endpoint(dev, i, true);
- + usb_disable_endpoint(dev, i + USB_DIR_IN, true);
- + }
- }
- /**
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement