Commit 60b4dffb authored by Jean-Paul Saman's avatar Jean-Paul Saman

DaVinci Resizer: flag failing down_interruptible

parent d5c8226e
...@@ -64,8 +64,6 @@ ...@@ -64,8 +64,6 @@
#include "davinci_resizer_hw.h" #include "davinci_resizer_hw.h"
#include "davinci_resizer.h" #include "davinci_resizer.h"
#define DRIVERNAME "DaVinciResizer"
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
MODULE_DESCRIPTION("Texas Instruments Davinci video resizer driver"); MODULE_DESCRIPTION("Texas Instruments Davinci video resizer driver");
...@@ -501,6 +499,11 @@ static int rsz_start(rsz_resize_t * resize, channel_config_t * rsz_conf_chan) ...@@ -501,6 +499,11 @@ static int rsz_start(rsz_resize_t * resize, channel_config_t * rsz_conf_chan)
/* Function call to add the entry of application in array */ /* Function call to add the entry of application in array */
ret = add_to_array(rsz_conf_chan); ret = add_to_array(rsz_conf_chan);
if (ret < 0) {
dev_dbg(rsz_device, "%s: Failed adding array to configuration list aborting\n",
__FUNCTION__);
return -EIO;
}
/*Function call to set up the hardware */ /*Function call to set up the hardware */
rsz_hardware_setup(rsz_conf_chan); rsz_hardware_setup(rsz_conf_chan);
...@@ -541,9 +544,11 @@ static int add_to_array(channel_config_t * rsz_conf_chan) ...@@ -541,9 +544,11 @@ static int add_to_array(channel_config_t * rsz_conf_chan)
dev_dbg(rsz_device, "entering %s\n", __FUNCTION__); dev_dbg(rsz_device, "entering %s\n", __FUNCTION__);
/* locking the configuartion aaray */ /* locking the configuartion array */
down_interruptible(&device_config.array_sem); if (down_interruptible(&device_config.array_sem)) {
dev_dbg(rsz_device, "%s: failed locking configuration array\n", __FUNCTION__);
return -1;
}
/* Add configuration to the queue according to its priority */ /* Add configuration to the queue according to its priority */
if (device_config.array_count == EMPTY) { if (device_config.array_count == EMPTY) {
/* If array empty insert at top position */ /* If array empty insert at top position */
...@@ -587,7 +592,9 @@ static int add_to_array(channel_config_t * rsz_conf_chan) ...@@ -587,7 +592,9 @@ static int add_to_array(channel_config_t * rsz_conf_chan)
wait_for_completion_interruptible wait_for_completion_interruptible
(&(rsz_conf_chan->channel_sem)); (&(rsz_conf_chan->channel_sem));
#else #else
down_interruptible(&(rsz_conf_chan->channel_sem)); if (down_interruptible(&(rsz_conf_chan->channel_sem)))
dev_err(rsz_device, "%s: failed locking pending request\n",
__FUNCTION__);
#endif #endif
} else { } else {
...@@ -609,7 +616,11 @@ static int delete_from_array(channel_config_t * rsz_conf_chan) ...@@ -609,7 +616,11 @@ static int delete_from_array(channel_config_t * rsz_conf_chan)
dev_dbg(rsz_device, "entering %s\n", __FUNCTION__); dev_dbg(rsz_device, "entering %s\n", __FUNCTION__);
down_interruptible(&(device_config.array_sem)); if (down_interruptible(&(device_config.array_sem))) {
dev_dbg(rsz_device, "%s: failed locking configuration array\n",
__FUNCTION__);
return -1;
}
/*shift the entried in array */ /*shift the entried in array */
if (device_config.array_count != SECONDENTRY) { if (device_config.array_count != SECONDENTRY) {
...@@ -1190,7 +1201,9 @@ static int rsz_open(struct inode *inode, struct file *filp) ...@@ -1190,7 +1201,9 @@ static int rsz_open(struct inode *inode, struct file *filp)
/* increment usage counter */ /* increment usage counter */
/* Lock the global variable and increment the counter */ /* Lock the global variable and increment the counter */
down_interruptible(&device_config.device_mutex); if (down_interruptible(&device_config.device_mutex))
dev_err(rsz_device,"%s: failed locking configuration to increment counter\n",
__FUNCTION__);
device_config.module_usage_count++; device_config.module_usage_count++;
up(&device_config.device_mutex); up(&device_config.device_mutex);
...@@ -1262,7 +1275,9 @@ static int rsz_release(struct inode *inode, struct file *filp) ...@@ -1262,7 +1275,9 @@ static int rsz_release(struct inode *inode, struct file *filp)
/* Decrements the module usage count; */ /* Decrements the module usage count; */
/* Lock the global variable and decrement variable */ /* Lock the global variable and decrement variable */
down_interruptible(&device_config.device_mutex); if (down_interruptible(&device_config.device_mutex))
dev_err(rsz_device,"%s: failed locking configuration to decrement counter\n",
__FUNCTION__);
device_config.module_usage_count--; device_config.module_usage_count--;
up(&device_config.device_mutex); up(&device_config.device_mutex);
...@@ -1564,7 +1579,7 @@ static int __init rsz_init(void) ...@@ -1564,7 +1579,7 @@ static int __init rsz_init(void)
/* Register the driver in the kernel */ /* Register the driver in the kernel */
result = alloc_chrdev_region(&dev, ZERO, 1, DRIVER_NAME); result = alloc_chrdev_region(&dev, ZERO, 1, "Resizer");
if (result < ZERO) { if (result < ZERO) {
printk("\nDaVinciresizer: Module intialization failed.\ printk("\nDaVinciresizer: Module intialization failed.\
could not register character device"); could not register character device");
...@@ -1586,7 +1601,7 @@ static int __init rsz_init(void) ...@@ -1586,7 +1601,7 @@ static int __init rsz_init(void)
} }
/* registeration of character device */ /* registeration of character device */
register_chrdev(MAJOR(dev), DRIVER_NAME, &rsz_fops); register_chrdev(MAJOR(dev), "Resizer", &rsz_fops);
/* register driver as a platform driver */ /* register driver as a platform driver */
if (misc_register(&resizer_device)) if (misc_register(&resizer_device))
...@@ -1651,7 +1666,7 @@ void __exit rsz_cleanup(void) ...@@ -1651,7 +1666,7 @@ void __exit rsz_cleanup(void)
cdev_del(&c_dev); cdev_del(&c_dev);
/* unregistering the driver from the kernel */ /* unregistering the driver from the kernel */
unregister_chrdev(MAJOR(dev), DRIVER_NAME); unregister_chrdev(MAJOR(dev), "Resizer");
} /* End of function resizer_cleanup */ } /* End of function resizer_cleanup */
......
...@@ -57,7 +57,6 @@ ...@@ -57,7 +57,6 @@
#define MAX_IMAGE_HEIGHT 960 #define MAX_IMAGE_HEIGHT 960
#define MAX_INPUT_BUFFERS 8 #define MAX_INPUT_BUFFERS 8
#define MAX_OUTPUT_BUFFERS 8 #define MAX_OUTPUT_BUFFERS 8
#define DRIVER_NAME "Resizer"
#define FREE_BUFFER 0 #define FREE_BUFFER 0
#define ALIGNMENT 16 #define ALIGNMENT 16
#define CHANNEL_BUSY 1 #define CHANNEL_BUSY 1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment