[PATCH] staging: panel: fix sparse warnings

2014-04-18 Thread Bastien Armand
This patch fixes sparse warnings in panel.c.


Signed-off-by: Bastien Armand armand.bast...@laposte.net
---
 drivers/staging/panel/panel.c |  209 ++---
 1 file changed, 111 insertions(+), 98 deletions(-)

diff --git a/drivers/staging/panel/panel.c b/drivers/staging/panel/panel.c
index 08f9a48..dc34254 100644
--- a/drivers/staging/panel/panel.c
+++ b/drivers/staging/panel/panel.c
@@ -1217,111 +1217,113 @@ static inline int handle_lcd_special_code(void)
return processed;
 }

+static void lcd_write_char(char c)
+{
+   /* first, we'll test if we're in escape mode */
+   if ((c != '\n')  lcd_escape_len = 0) {
+   /* yes, let's add this char to the buffer */
+   lcd_escape[lcd_escape_len++] = c;
+   lcd_escape[lcd_escape_len] = 0;
+   } else {
+   /* aborts any previous escape sequence */
+   lcd_escape_len = -1;
+
+   switch (c) {
+   case LCD_ESCAPE_CHAR:
+   /* start of an escape sequence */
+   lcd_escape_len = 0;
+   lcd_escape[lcd_escape_len] = 0;
+   break;
+   case '\b':
+   /* go back one char and clear it */
+   if (lcd_addr_x  0) {
+   /* check if we're not at the
+  end of the line */
+   if (lcd_addr_x  lcd_bwidth)
+   /* back one char */
+   lcd_write_cmd(0x10);
+   lcd_addr_x--;
+   }
+   /* replace with a space */
+   lcd_write_data(' ');
+   /* back one char again */
+   lcd_write_cmd(0x10);
+   break;
+   case '\014':
+   /* quickly clear the display */
+   lcd_clear_fast();
+   break;
+   case '\n':
+   /* flush the remainder of the current line and
+  go to the beginning of the next line */
+   for (; lcd_addr_x  lcd_bwidth; lcd_addr_x++)
+   lcd_write_data(' ');
+   lcd_addr_x = 0;
+   lcd_addr_y = (lcd_addr_y + 1) % lcd_height;
+   lcd_gotoxy();
+   break;
+   case '\r':
+   /* go to the beginning of the same line */
+   lcd_addr_x = 0;
+   lcd_gotoxy();
+   break;
+   case '\t':
+   /* print a space instead of the tab */
+   lcd_print(' ');
+   break;
+   default:
+   /* simply print this char */
+   lcd_print(c);
+   break;
+   }
+   }
+
+   /* now we'll see if we're in an escape mode and if the current
+  escape sequence can be understood. */
+   if (lcd_escape_len = 2) {
+   int processed = 0;
+
+   if (!strcmp(lcd_escape, [2J)) {
+   /* clear the display */
+   lcd_clear_fast();
+   processed = 1;
+   } else if (!strcmp(lcd_escape, [H)) {
+   /* cursor to home */
+   lcd_addr_x = lcd_addr_y = 0;
+   lcd_gotoxy();
+   processed = 1;
+   }
+   /* codes starting with ^[[L */
+   else if ((lcd_escape_len = 3) 
+(lcd_escape[0] == '[') 
+(lcd_escape[1] == 'L')) {
+   processed = handle_lcd_special_code();
+   }
+
+   /* LCD special escape codes */
+   /* flush the escape sequence if it's been processed
+  or if it is getting too long. */
+   if (processed || (lcd_escape_len = LCD_ESCAPE_LEN))
+   lcd_escape_len = -1;
+   } /* escape codes */
+}
+
 static ssize_t lcd_write(struct file *file,
-const char *buf, size_t count, loff_t *ppos)
+   const char __user *buf, size_t count, loff_t *ppos)
 {
-   const char *tmp = buf;
+   const char __user *tmp = buf;
char c;

-   for (; count--  0; (ppos ? (*ppos)++ : 0), ++tmp) {
+   for (; count--  0; (*ppos)++, tmp++) {
if (!in_interrupt()  (((count + 1)  0x1f) == 0))
/* let's be a little nice with other processes
   that need some CPU */
schedule();

-   if (ppos == NULL  file == NULL)
-   /* let's not use get_user() from the kernel ! */

Re: [PATCH] staging: panel: fix sparse warnings

2014-04-18 Thread Greg Kroah-Hartman
On Fri, Apr 18, 2014 at 08:01:22AM +0200, Bastien Armand wrote:
 This patch fixes sparse warnings in panel.c.

What sparse warnings were fixed here?

It looks like you did a lot of different things, can you please break
this out into one patch per logical change so it can be reviewed
easier?

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] imx-drm: fix hdmi hotplug detection initial state

2014-04-18 Thread Russell King
The initial state at boot is assumed to be disconnected, and we hope
to receive an interrupt to update the status.  Let's be more explicit
about the current state - reading the PHY status register tells us
the current level of the hotplug signal, which we can report back in
the _detect() method.

Signed-off-by: Russell King rmk+ker...@arm.linux.org.uk
---
Having discussed the issue of how to detect HDMI with David Airlie last
night, it is perfectly fine to use the HPD signal.  The reason adapters
like Intel i915 use EDID is because of cross-talk on their HPD signals,
which cause them to falsely indicate transitions when nothing has really
changed state.  So, to say that EDID polling is somehow more in keeping
with DRM than using the HPD signal is rather bogus.

The patch below fixes imx-hdmi for good systems where the HPD signal is
wired up at the board level.

 drivers/staging/imx-drm/imx-hdmi.c | 9 +++--
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/imx-drm/imx-hdmi.c 
b/drivers/staging/imx-drm/imx-hdmi.c
index d47dedd2cdb4..6f5efcc89880 100644
--- a/drivers/staging/imx-drm/imx-hdmi.c
+++ b/drivers/staging/imx-drm/imx-hdmi.c
@@ -120,8 +120,6 @@ struct imx_hdmi {
struct clk *isfr_clk;
struct clk *iahb_clk;
 
-   enum drm_connector_status connector_status;
-
struct hdmi_data_info hdmi_data;
int vic;
 
@@ -1382,7 +1380,9 @@ static enum drm_connector_status 
imx_hdmi_connector_detect(struct drm_connector
 {
struct imx_hdmi *hdmi = container_of(connector, struct imx_hdmi,
 connector);
-   return hdmi-connector_status;
+
+   return hdmi_readb(hdmi, HDMI_PHY_STAT0)  HDMI_PHY_HPD ?
+   connector_status_connected : connector_status_disconnected;
 }
 
 static int imx_hdmi_connector_get_modes(struct drm_connector *connector)
@@ -1524,7 +1524,6 @@ static irqreturn_t imx_hdmi_irq(int irq, void *dev_id)
 
hdmi_modb(hdmi, 0, HDMI_PHY_HPD, HDMI_PHY_POL0);
 
-   hdmi-connector_status = connector_status_connected;
imx_hdmi_poweron(hdmi);
} else {
dev_dbg(hdmi-dev, EVENT=plugout\n);
@@ -1532,7 +1531,6 @@ static irqreturn_t imx_hdmi_irq(int irq, void *dev_id)
hdmi_modb(hdmi, HDMI_PHY_HPD, HDMI_PHY_HPD,
HDMI_PHY_POL0);
 
-   hdmi-connector_status = connector_status_disconnected;
imx_hdmi_poweroff(hdmi);
}
drm_helper_hpd_irq_event(hdmi-connector.dev);
@@ -1606,7 +1604,6 @@ static int imx_hdmi_bind(struct device *dev, struct 
device *master, void *data)
return -ENOMEM;
 
hdmi-dev = dev;
-   hdmi-connector_status = connector_status_disconnected;
hdmi-sample_rate = 48000;
hdmi-ratio = 100;
 
-- 
1.8.3.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2 0/8] Reorder i.MX IPU display enable/disable sequence

2014-04-18 Thread Russell King - ARM Linux
On Mon, Apr 14, 2014 at 11:53:15PM +0200, Philipp Zabel wrote:
 Repeatedly enabling and disabling the display currently can lead to a state
 in which the IPU doesn't produce a valid signal anymore because we disable
 IPU submodules before they can finish their interaction.
 
 This series reorders the enable/disable sequence so that we first wait for the
 DC/DP to finish processing the current frame, then stop the DI and IDMAC, and
 only then disable clocks to the submodules. Also from now on we really disable
 the DC when it is not in use.

Okay, I'm going to queue these up in a couple of days, but there's
something which I'd prefer to be fixed... there's one in particular
that is excessively long.

 Philipp Zabel (8):
   imx-drm: ipu-common: add ipu_map_irq to request non-IDMAC interrupts
   imx-drm: ipu-common: Add helpers to check for a busy IDMAC channel and
 to busywait for an interrupt
   imx-drm: ipu-dmfc: Wait for FIFOs to run empty before disabling
   imx-drm: ipu-dc: Wait for DC_FC_1 / DP_SF_END interrupt
   imx-drm: ipu-dp: Split disabling the DP foreground channel from
 disabling the DP module
   imx-drm: imx-dp: When disabling the DP foreground channel, wait until
 the DP background channel is finished before disabling the IDMAC
 channel

imx-drm: imx-dp: disable DP fg channel after DP bg channel has finished

maybe?

   imx-drm: ipuv3-crtc: Change display enable/disable order
   imx-drm: ipu-dc: Disable DC module when not in use


-- 
FTTC broadband for 0.8mile line: now at 9.7Mbps down 460kbps up... slowly
improving, and getting towards what was expected from it.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] mmc: rtsx: fix possible circular locking dependency

2014-04-18 Thread Peter Wu
Hi!

On Wednesday 16 April 2014 09:38:44 micky_ch...@realsil.com.cn wrote:
 From: Micky Ching micky_ch...@realsil.com.cn
 
 To avoid dead lock, we need make sure host-lock is always acquire
 before pcr-lock. But in irq handler, we acquired pcr-lock in rtsx mfd
 driver, and sd_isr_done_transfer() is called during pcr-lock already
 acquired. Since in sd_isr_done_transfer() the only work we do is schdule
 tasklet, the cmd_tasklet and data_tasklet never conflict, so it is safe
 to remove spin_lock() here.
 
 Signed-off-by: Micky Ching micky_ch...@realsil.com.cn
 ---
  drivers/mmc/host/rtsx_pci_sdmmc.c |4 +---
  1 file changed, 1 insertion(+), 3 deletions(-)

This patch came from https://lkml.kernel.org/r/534de1d7.3000...@realsil.com.cn
(Re: rtsx_pci_sdmmc lockdep splat).

With v3.15-rc1-49-g10ec34f, I have a hung machine when inserting a SD card.
lockdep was not enabled for the kernel, I have not bisected yet.
This patch on top of that kernel version does not help (tested by
rmmod rtsx_pci_sdmmc and insmod the patched one).

Console (as typed over from a picture, sorry for any typos):
WARNING: CPU: 1 PID: 0 at kernel/locking/mutex.c:698
DEBUG_LOCKS_WARN_ON(in_interrupt())
Modules linked in: ...
CPU: 1 PID: 0 Comm: swapper/1 Not tainted 3.15-rc1-custom-49-g10ec34f #5
Hardware name: Shuttle Inc. XS36V/XS36V, BIOS 1.11 12/18/2012
Call trace:
IRQ dump_stack
warn_slowpath_common
warn_slowpath_fmt
__mutex_unlock_slowpath
mutex_unlock
sd_finish_request [rtsx_pci_sdmmc]
tasklet_action
__do_softirq
irq_exit
smp_apic_timer_interrupt
apic_timer_interrupt
EOI ? cpuidle_enter_state
cpuidle_enter
cpu_startup_entry
start_secondary
---[end trace ...]---
(60 seconds later:)
INFO: rcu_preempt detected stalls on CPUs/tasks: {} (detected by 1, t=18004 
jiffies, g=3264, c=3263, q=2)
INFO: Stall ended before state dump start

I also managed to get this trace about 106 seconds later when switching TTY:
INFO: task kworker/... blocked for more than 120 seconds
Workqueue: kmmcd mm_rescan [mmc_core]
Call trace:
? update_rq_clock.part80
? internal_add_timer
schedule
schedule_preempt
__mutex_lock_slowpath
mutex_lock
sdmmc_request [rtsx_pci_sdmmc]
mmc_start_request [mmc_core]
__mmc_start_req [mmc_core]
mmc_wait_for_cmd [mmc_core]
? mmc_release_host [mmc_core]
mmc_io_rw_direct_host [mmc_core]

I'll try to get a lockdep kernel and text logs later, but perhaps you already
know the issue?

Peter

 diff --git a/drivers/mmc/host/rtsx_pci_sdmmc.c
 b/drivers/mmc/host/rtsx_pci_sdmmc.c index 453e1d4..40695e0 100644
 --- a/drivers/mmc/host/rtsx_pci_sdmmc.c
 +++ b/drivers/mmc/host/rtsx_pci_sdmmc.c
 @@ -108,12 +108,10 @@ static void sd_isr_done_transfer(struct
 platform_device *pdev) {
   struct realtek_pci_sdmmc *host = platform_get_drvdata(pdev);
 
 - spin_lock(host-lock);
   if (host-cmd)
   tasklet_schedule(host-cmd_tasklet);
 - if (host-data)
 + else if (host-data)
   tasklet_schedule(host-data_tasklet);
 - spin_unlock(host-lock);
  }
 
  static void sd_request_timeout(unsigned long host_addr)

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: panel: fix sparse warnings

2014-04-18 Thread Bastien Armand
On Thu, Apr 17, 2014 at 11:15:10PM -0700, Greg Kroah-Hartman wrote:
 On Fri, Apr 18, 2014 at 08:01:22AM +0200, Bastien Armand wrote:
  This patch fixes sparse warnings in panel.c.
 
 What sparse warnings were fixed here?
 
 It looks like you did a lot of different things, can you please break
 this out into one patch per logical change so it can be reviewed
 easier?
 
 thanks,
 
 greg k-h

Hi,

Thank you for this return. I will split this patch, document it a little
more and submit it again.

take care.
bastien
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 0/2] staging: panel: fix sparse warnings.

2014-04-18 Thread Bastien Armand
This serie of two patch fix the following sparse warnings in panel.c :
panel.c:1235:26: warning: incorrect type in argument 1 (different address 
spaces)
panel.c:1235:26:expected void const volatile [noderef] asn:1*noident
panel.c:1235:26:got char const *tmp
panel.c:1353:20: warning: incorrect type in initializer (incompatible argument 
2 (different address spaces))
panel.c:1353:20:expected int ( *write )( ... )
panel.c:1353:20:got int ( static [toplevel] *noident )( ... )
panel.c:1591:17: warning: incorrect type in argument 1 (different address 
spaces)
panel.c:1591:17:expected void const volatile [noderef] asn:1*noident
panel.c:1591:17:got char *tmp
panel.c:1620:20: warning: incorrect type in initializer (incompatible argument 
2 (different address spaces))
panel.c:1620:20:expected int ( *read )( ... )
panel.c:1620:20:got int ( static [toplevel] *noident )( ... )

Changes since v1 :
- splitted patch in two

Bastien Armand (2):
  staging: panel: fix sparse warnings in keypad_read
  staging: panel: fix sparse warnings in lcd_write

 drivers/staging/panel/panel.c |  209 ++---
 1 file changed, 111 insertions(+), 98 deletions(-)

--
1.7.10.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 1/2] staging: panel: fix sparse warnings in keypad_read

2014-04-18 Thread Bastien Armand
This patch fixes two sparse warnings related to keypad_read :
warning: incorrect type in argument 1 (different address spaces)
warning: incorrect type in initializer (incompatible argument 2 (different 
address spaces))

Signed-off-by: Bastien Armand armand.bast...@laposte.net
---
 drivers/staging/panel/panel.c |4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/panel/panel.c b/drivers/staging/panel/panel.c
index 08f9a48..1569e26 100644
--- a/drivers/staging/panel/panel.c
+++ b/drivers/staging/panel/panel.c
@@ -1571,11 +1571,11 @@ static void lcd_init(void)
  */

 static ssize_t keypad_read(struct file *file,
-  char *buf, size_t count, loff_t *ppos)
+  char __user *buf, size_t count, loff_t *ppos)
 {

unsigned i = *ppos;
-   char *tmp = buf;
+   char __user *tmp = buf;

if (keypad_buflen == 0) {
if (file-f_flags  O_NONBLOCK)
--
1.7.10.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 2/2] staging: panel: fix sparse warnings in lcd_write

2014-04-18 Thread Bastien Armand
This patch fixes two sparse warnings related to lcd_write :
warning: incorrect type in argument 1 (different address spaces)
warning: incorrect type in initializer (incompatible argument 2 
(different address spaces))

lcd_write can be used from kernel space (in panel_lcd_print) or from user
space. So we introduce the lcd_write_char function that will write a char to
the device. We modify lcd_write and panel_lcd_print to use it. Finally we add
__user annotation missing in lcd_write.


Signed-off-by: Bastien Armand armand.bast...@laposte.net
---
 drivers/staging/panel/panel.c |  205 ++---
 1 file changed, 109 insertions(+), 96 deletions(-)

diff --git a/drivers/staging/panel/panel.c b/drivers/staging/panel/panel.c
index 1569e26..dc34254 100644
--- a/drivers/staging/panel/panel.c
+++ b/drivers/staging/panel/panel.c
@@ -1217,111 +1217,113 @@ static inline int handle_lcd_special_code(void)
return processed;
 }

+static void lcd_write_char(char c)
+{
+   /* first, we'll test if we're in escape mode */
+   if ((c != '\n')  lcd_escape_len = 0) {
+   /* yes, let's add this char to the buffer */
+   lcd_escape[lcd_escape_len++] = c;
+   lcd_escape[lcd_escape_len] = 0;
+   } else {
+   /* aborts any previous escape sequence */
+   lcd_escape_len = -1;
+
+   switch (c) {
+   case LCD_ESCAPE_CHAR:
+   /* start of an escape sequence */
+   lcd_escape_len = 0;
+   lcd_escape[lcd_escape_len] = 0;
+   break;
+   case '\b':
+   /* go back one char and clear it */
+   if (lcd_addr_x  0) {
+   /* check if we're not at the
+  end of the line */
+   if (lcd_addr_x  lcd_bwidth)
+   /* back one char */
+   lcd_write_cmd(0x10);
+   lcd_addr_x--;
+   }
+   /* replace with a space */
+   lcd_write_data(' ');
+   /* back one char again */
+   lcd_write_cmd(0x10);
+   break;
+   case '\014':
+   /* quickly clear the display */
+   lcd_clear_fast();
+   break;
+   case '\n':
+   /* flush the remainder of the current line and
+  go to the beginning of the next line */
+   for (; lcd_addr_x  lcd_bwidth; lcd_addr_x++)
+   lcd_write_data(' ');
+   lcd_addr_x = 0;
+   lcd_addr_y = (lcd_addr_y + 1) % lcd_height;
+   lcd_gotoxy();
+   break;
+   case '\r':
+   /* go to the beginning of the same line */
+   lcd_addr_x = 0;
+   lcd_gotoxy();
+   break;
+   case '\t':
+   /* print a space instead of the tab */
+   lcd_print(' ');
+   break;
+   default:
+   /* simply print this char */
+   lcd_print(c);
+   break;
+   }
+   }
+
+   /* now we'll see if we're in an escape mode and if the current
+  escape sequence can be understood. */
+   if (lcd_escape_len = 2) {
+   int processed = 0;
+
+   if (!strcmp(lcd_escape, [2J)) {
+   /* clear the display */
+   lcd_clear_fast();
+   processed = 1;
+   } else if (!strcmp(lcd_escape, [H)) {
+   /* cursor to home */
+   lcd_addr_x = lcd_addr_y = 0;
+   lcd_gotoxy();
+   processed = 1;
+   }
+   /* codes starting with ^[[L */
+   else if ((lcd_escape_len = 3) 
+(lcd_escape[0] == '[') 
+(lcd_escape[1] == 'L')) {
+   processed = handle_lcd_special_code();
+   }
+
+   /* LCD special escape codes */
+   /* flush the escape sequence if it's been processed
+  or if it is getting too long. */
+   if (processed || (lcd_escape_len = LCD_ESCAPE_LEN))
+   lcd_escape_len = -1;
+   } /* escape codes */
+}
+
 static ssize_t lcd_write(struct file *file,
-const char *buf, size_t count, loff_t *ppos)
+   const char __user *buf, size_t count, loff_t *ppos)
 {
-   const char *tmp = buf;
+   const char __user *tmp = buf;
char c;

-   

r8192e_pci driver broken 3.14+

2014-04-18 Thread Sean MacLennan
Commit 198e0d17c on November 2 by Rashika Kheria breaks the r8192e_pci
driver on my laptop. The bulk of the commit is fine. It is just the
following change that causes grief:

diff --git a/drivers/staging/rtl8192e/rtllib_tx.c 
b/drivers/staging/rtl8192e/rtllib_tx.c
index 3183627..7796488 100644
--- a/drivers/staging/rtl8192e/rtllib_tx.c
+++ b/drivers/staging/rtl8192e/rtllib_tx.c
@@ -171,7 +171,7 @@ inline int rtllib_put_snap(u8 *data, u16 h_proto)
snap-oui[1] = oui[1];
snap-oui[2] = oui[2];

-   *(u16 *)(data + SNAP_SIZE) = htons(h_proto);
+   *(u16 *)(data + SNAP_SIZE) = h_proto;

return SNAP_SIZE + sizeof(u16);
 }

I am not sure what platform this was tested on, but I believe for any
little endian machine the htons() is required. Reverting this part of
the commit gets me a working driver. I sent this email using it ;)

Sorry it took so long to report, I don't really use the wireless in
the winter.

Cheers,
   Sean
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging: crystalhd: Mark local functions as static

2014-04-18 Thread Bojan Prtvar
This fixes the following sparse warnings:
drivers/staging/crystalhd/crystalhd_lnx.c:631:5: warning: symbol 
'chd_dec_pci_suspend' was not declared. Should it be static?
drivers/staging/crystalhd/crystalhd_lnx.c:665:5: warning: symbol 
'chd_dec_pci_resume' was not declared. Should it be static?
drivers/staging/crystalhd/crystalhd_lnx.c:78:29: warning: symbol 
'chd_dec_alloc_iodata' was not declared. Should it be static?
drivers/staging/crystalhd/crystalhd_lnx.c:99:6: warning: symbol 
'chd_dec_free_iodata' was not declared. Should it be static?

Signed-off-by: Bojan Prtvar prtva...@gmail.com
---
 drivers/staging/crystalhd/crystalhd_lnx.c |   10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/crystalhd/crystalhd_lnx.c 
b/drivers/staging/crystalhd/crystalhd_lnx.c
index c1f6163..590e0b8 100644
--- a/drivers/staging/crystalhd/crystalhd_lnx.c
+++ b/drivers/staging/crystalhd/crystalhd_lnx.c
@@ -75,8 +75,8 @@ static int chd_dec_disable_int(struct crystalhd_adp *adp)
return 0;
 }
 
-struct crystalhd_ioctl_data *chd_dec_alloc_iodata(struct crystalhd_adp *adp,
-bool isr)
+static struct crystalhd_ioctl_data *
+chd_dec_alloc_iodata(struct crystalhd_adp *adp, bool isr)
 {
unsigned long flags = 0;
struct crystalhd_ioctl_data *temp;
@@ -96,7 +96,7 @@ struct crystalhd_ioctl_data *chd_dec_alloc_iodata(struct 
crystalhd_adp *adp,
return temp;
 }
 
-void chd_dec_free_iodata(struct crystalhd_adp *adp,
+static void chd_dec_free_iodata(struct crystalhd_adp *adp,
 struct crystalhd_ioctl_data *iodata, bool isr)
 {
unsigned long flags = 0;
@@ -628,7 +628,7 @@ err:
 }
 
 #ifdef CONFIG_PM
-int chd_dec_pci_suspend(struct pci_dev *pdev, pm_message_t state)
+static int chd_dec_pci_suspend(struct pci_dev *pdev, pm_message_t state)
 {
struct crystalhd_adp *adp;
struct crystalhd_ioctl_data *temp;
@@ -662,7 +662,7 @@ int chd_dec_pci_suspend(struct pci_dev *pdev, pm_message_t 
state)
return 0;
 }
 
-int chd_dec_pci_resume(struct pci_dev *pdev)
+static int chd_dec_pci_resume(struct pci_dev *pdev)
 {
struct crystalhd_adp *adp;
enum BC_STATUS sts = BC_STS_SUCCESS;
-- 
1.7.9.5

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: r8192e_pci driver broken 3.14+

2014-04-18 Thread Greg KH
On Fri, Apr 18, 2014 at 01:36:19PM -0400, Sean MacLennan wrote:
 Commit 198e0d17c on November 2 by Rashika Kheria breaks the r8192e_pci
 driver on my laptop. The bulk of the commit is fine. It is just the
 following change that causes grief:
 
 diff --git a/drivers/staging/rtl8192e/rtllib_tx.c 
 b/drivers/staging/rtl8192e/rtllib_tx.c
 index 3183627..7796488 100644
 --- a/drivers/staging/rtl8192e/rtllib_tx.c
 +++ b/drivers/staging/rtl8192e/rtllib_tx.c
 @@ -171,7 +171,7 @@ inline int rtllib_put_snap(u8 *data, u16 h_proto)
   snap-oui[1] = oui[1];
   snap-oui[2] = oui[2];
 
 - *(u16 *)(data + SNAP_SIZE) = htons(h_proto);
 + *(u16 *)(data + SNAP_SIZE) = h_proto;
 
   return SNAP_SIZE + sizeof(u16);
  }
 
 I am not sure what platform this was tested on, but I believe for any
 little endian machine the htons() is required. Reverting this part of
 the commit gets me a working driver. I sent this email using it ;)
 
 Sorry it took so long to report, I don't really use the wireless in
 the winter.

Can you send a patch that fixes this up properly?

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: r8192e_pci driver broken 3.14+

2014-04-18 Thread Dan Carpenter
On Fri, Apr 18, 2014 at 01:36:19PM -0400, Sean MacLennan wrote:
 Commit 198e0d17c on November 2 by Rashika Kheria breaks the r8192e_pci
 driver on my laptop.

This patch went through the intern code review process and not the
normal code review process.  The changelog didn't justify why changing
endianness was correct.

Normally I would have expected something like:

These data types are used by the hardware so little endian is expected.
For most users this change is a no-op and the code works as is.

I really think the intern review process should subliment the normal
code review instead of replacing it.  We have seen many bugs introduced
when we skip the normal review.

regards,
dan carpenter


___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v3] Staging:bcm: Fixes coding style issues in drivers/staging/bcm/Qos.c

2014-04-18 Thread Dan Carpenter
On Thu, Apr 17, 2014 at 08:12:17AM -0400, Marcos A. Di Pietro wrote:
 Fixes code style errors in drivers/staging/bcm/Qos.c

Looks good, it applies fine, thanks.  :)  More comments at the bottom.

 
 Signed-off-by: Marcos A. Di Pietro marcos...@gmail.com
 ---
  drivers/staging/bcm/Qos.c | 17 -
  1 file changed, 12 insertions(+), 5 deletions(-)
 
 diff --git a/drivers/staging/bcm/Qos.c b/drivers/staging/bcm/Qos.c
 index 4f31583..1f5edef 100644
 --- a/drivers/staging/bcm/Qos.c
 +++ b/drivers/staging/bcm/Qos.c
 @@ -4,11 +4,18 @@ This file contains the routines related to Quality of 
 Service.
  */
  #include headers.h
  
 -static void EThCSGetPktInfo(struct bcm_mini_adapter *Adapter, PVOID 
 pvEthPayload, struct bcm_eth_packet_info *pstEthCsPktInfo);
 -static bool EThCSClassifyPkt(struct bcm_mini_adapter *Adapter, struct 
 sk_buff* skb, struct bcm_eth_packet_info *pstEthCsPktInfo, struct 
 bcm_classifier_rule *pstClassifierRule, B_UINT8 EthCSCupport);
 -
 -static USHORTIpVersion4(struct bcm_mini_adapter *Adapter, struct 
 iphdr *iphd,
 -struct bcm_classifier_rule *pstClassifierRule);
 +static void EThCSGetPktInfo(struct bcm_mini_adapter *Adapter,
 + PVOID pvEthPayload,
 + struct bcm_eth_packet_info *pstEthCsPktInfo);
 +
 +static bool EThCSClassifyPkt(struct bcm_mini_adapter *Adapter,
 +  struct sk_buff *skb,
 +  struct bcm_eth_packet_info *pstEthCsPktInfo,
 +  struct bcm_classifier_rule *pstClassifierRule,
 +  B_UINT8 EthCSCupport);
 +
 +static USHORT IpVersion4(struct bcm_mini_adapter *Adapter, struct iphdr 
 *iphd,
 +  struct bcm_classifier_rule *pstClassifierRule);
  
  static VOID PruneQueue(struct bcm_mini_adapter *Adapter, INT iIndex);
  
 -- 
 Fixes whitespace damage and aligns function parameters properly.

This is not the cut-off mark I meant.  I meant the --- cut off under
the signed off by line.  Between the --- and the diff is extra
information which won't be safed in the permanent git log.

But it doesn't matter.

regards,
dan carpenter
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/1] Fix some lines over 80 characters in imx-drm staging driver

2014-04-18 Thread Antoine Schweitzer-Chaput
From 73eb48f2b376c56f0a354ea0e6c2c71972aaffae Mon Sep 17 00:00:00 2001
From: Antoine Schweitzer-Chaput anto...@schweitzer-chaput.fr
Date: Wed, 16 Apr 2014 09:59:26 +0200
Subject: [PATCH 1/1] Fix some lines over 80 characters in imx-drm
staging driver

Signed-off-by: Antoine Schweitzer-Chaput anto...@schweitzer-chaput.fr
---
 drivers/staging/imx-drm/ipu-v3/ipu-common.c | 6 --
 drivers/staging/imx-drm/ipu-v3/ipu-dc.c | 3 ++-
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/imx-drm/ipu-v3/ipu-common.c
b/drivers/staging/imx-drm/ipu-v3/ipu-common.c
index ca85d3d..0ea00de 100644
--- a/drivers/staging/imx-drm/ipu-v3/ipu-common.c
+++ b/drivers/staging/imx-drm/ipu-v3/ipu-common.c
@@ -900,7 +900,8 @@ static void ipu_irq_handle(struct ipu_soc *ipu,
const int *regs, int num_regs)
status = ipu_cm_read(ipu, IPU_INT_CTRL(regs[i]));
 
for_each_set_bit(bit, status, 32) {
-   irq = irq_linear_revmap(ipu-domain, regs[i] * 32 + 
bit);
+   irq = irq_linear_revmap(ipu-domain,
+   regs[i] * 32 + bit);
if (irq)
generic_handle_irq(irq);
}
@@ -1053,7 +1054,8 @@ static int ipu_irq_init(struct ipu_soc *ipu)
}
 
ret = irq_alloc_domain_generic_chips(ipu-domain, 32, 1, IPU,
-handle_level_irq, 0, IRQF_VALID, 
0);
+handle_level_irq, 0,
+IRQF_VALID, 0);
if (ret  0) {
dev_err(ipu-dev, failed to alloc generic irq chips\n);
irq_domain_remove(ipu-domain);
diff --git a/drivers/staging/imx-drm/ipu-v3/ipu-dc.c
b/drivers/staging/imx-drm/ipu-v3/ipu-dc.c
index d5de8bb..5f587d8 100644
--- a/drivers/staging/imx-drm/ipu-v3/ipu-dc.c
+++ b/drivers/staging/imx-drm/ipu-v3/ipu-dc.c
@@ -367,7 +367,8 @@ int ipu_dc_init(struct ipu_soc *ipu, struct device
*dev,
writel(DC_WR_CH_CONF_WORD_SIZE_24 | DC_WR_CH_CONF_DISP_ID_PARALLEL(0),
priv-channels[5].base + DC_WR_CH_CONF);
 
-   writel(DC_GEN_SYNC_1_6_SYNC | DC_GEN_SYNC_PRIORITY_1, priv-dc_reg +
DC_GEN);
+   writel(DC_GEN_SYNC_1_6_SYNC | DC_GEN_SYNC_PRIORITY_1,
+   priv-dc_reg + DC_GEN);
 
ipu-dc_priv = priv;
 
-- 
1.9.0



___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 0/2] staging: rtl8188eu: fix checkpatch errors.

2014-04-18 Thread Konrad Zapalowicz
From: Konrad M Zapalowicz bergo.tor...@gmail.com

This patch removes the following checkpatch errors:

rtl8188eu/core/rtw_p2p.c:
- 1508: ERROR: code indent should use tabs where possible
- 1509: ERROR: code indent should use tabs where possible
- 1510: ERROR: code indent should use tabs where possible
rtl8188eu/core/rtw_recv.c
- 1874: ERROR: code indent should use tabs where possible

Konrad M Zapalowicz (2):
  staging: rtl8188eu: fix spaces instead of tabs for rtw_p2p.c
  staging: rtl8188eu: fix spaces instead of tabs for rtw_recv.c

 drivers/staging/rtl8188eu/core/rtw_p2p.c  | 6 +++---
 drivers/staging/rtl8188eu/core/rtw_recv.c | 2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

-- 
1.8.1.2

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/2] staging: rtl8188eu: fix spaces instead of tabs for rtw_p2p.c

2014-04-18 Thread Konrad Zapalowicz
From: Konrad M Zapalowicz bergo.tor...@gmail.com

This commit fixes the following checkpatch errors:

rtl8188eu/core/rtw_p2p.c
- 1508: ERROR: code indent should use tabs where possible
- 1509: ERROR: code indent should use tabs where possible
- 1510: ERROR: code indent should use tabs where possible

Signed-off-by: Konrad Zapalowicz bergo.torino at gmail.com
---
 drivers/staging/rtl8188eu/core/rtw_p2p.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_p2p.c 
b/drivers/staging/rtl8188eu/core/rtw_p2p.c
index 9425c49..0a15f8c 100644
--- a/drivers/staging/rtl8188eu/core/rtw_p2p.c
+++ b/drivers/staging/rtl8188eu/core/rtw_p2p.c
@@ -1505,9 +1505,9 @@ static void find_phase_handler(struct adapter *padapter)
 
rtw_p2p_set_state(pwdinfo, P2P_STATE_FIND_PHASE_SEARCH);
 
-spin_lock_bh(pmlmepriv-lock);
-rtw_sitesurvey_cmd(padapter, ssid, 1, NULL, 0);
-spin_unlock_bh(pmlmepriv-lock);
+   spin_lock_bh(pmlmepriv-lock);
+   rtw_sitesurvey_cmd(padapter, ssid, 1, NULL, 0);
+   spin_unlock_bh(pmlmepriv-lock);
 }
 
 void p2p_concurrent_handler(struct adapter *padapter);
-- 
1.8.1.2

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/2] staging: rtl8188eu: fix spaces instead of tabs for rtw_recv.c

2014-04-18 Thread Konrad Zapalowicz
From: Konrad M Zapalowicz bergo.tor...@gmail.com

This commit fixes the following checkpatch errors:

rtl8188eu/core/rtw_recv.c
- 1874: ERROR: code indent should use tabs where possible

Signed-off-by: Konrad Zapalowicz bergo.torino at gmail.com
---
 drivers/staging/rtl8188eu/core/rtw_recv.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_recv.c 
b/drivers/staging/rtl8188eu/core/rtw_recv.c
index e305d43..5c1d2d2 100644
--- a/drivers/staging/rtl8188eu/core/rtw_recv.c
+++ b/drivers/staging/rtl8188eu/core/rtw_recv.c
@@ -1871,7 +1871,7 @@ static int recv_indicatepkts_in_order(struct adapter 
*padapter, struct recv_reor
return true;
 
prhdr = container_of(plist, struct recv_frame, list);
-   pattrib = prhdr-attrib;
+   pattrib = prhdr-attrib;
preorder_ctrl-indicate_seq = pattrib-seq_num;
}
 
-- 
1.8.1.2

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[GIT PULL] Staging driver fixes for 3.15-rc2

2014-04-18 Thread Greg KH
The following changes since commit c9eaa447e77efe77b7fa4c953bd62de8297fd6c5:

  Linux 3.15-rc1 (2014-04-13 14:18:35 -0700)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git/ 
tags/staging-3.15-rc2

for you to fetch changes up to 33c84bc14c25074ac14644cf7db75a57e9abaf1a:

  staging: r8188eu: Fix case where ethtype was never obtained and always be 
checked against 0 (2014-04-16 13:07:19 -0700)


staging driver fixes for 3.15-rc2

Here are a few staging driver fixes for issues that have been reported
for 3.15-rc2.

Also dominating the diffstat for the pull request is the removal of the
rtl8187se driver.  It's no longer needed in staging as a real driver
for this hardware is now merged in the tree in the correct location in
drivers/net/

All of these patches have been tested in linux-next.

Signed-off-by: Greg Kroah-Hartman gre...@linuxfoundation.org


Arnd Bergmann (1):
  staging: gs_fpgaboot: remove __TIMESTAMP__ macro

Daeseok Youn (2):
  staging: vme: fix memory leak in vme_user_probe()
  staging: speakup: fix misuse of kstrtol() in handle_goto()

Dan Carpenter (2):
  staging: unisys: use after free in error messages
  Staging: unisys: use after free in list_for_each()

Geert Uytterhoeven (1):
  staging: r8723au: Add missing initialization of change_inx in sort 
algorithm

Greg Kroah-Hartman (1):
  staging: delete rtl8187se wireless driver

Ian Abbott (1):
  staging: comedi: fix circular locking dependency in comedi_mmap()

Jes Sorensen (1):
  staging: rtl8723au: Fix buffer overflow in rtw_get_wfd_ie()

Larry Finger (3):
  staging: r8188eu: Calling rtw_get_stainfo() with a NULL sta_addr will 
return NULL
  staging: r8712u: Fix case where ethtype was never obtained and always be 
checked against 0
  staging: r8188eu: Fix case where ethtype was never obtained and always be 
checked against 0

Paul Bolle (1):
  staging: fpgaboot: clean up Makefile

Richard Weinberger (1):
  staging/rtl8821ae: Fix OOM handling in _rtl_init_deferred_work()

Shuah Khan (2):
  staging/usbip: userspace - fix usbipd SIGSEGV from 
refresh_exported_devices()
  staging/usbip: fix store_attach() sscanf return value check

Tuomas Tynkkynen (1):
  staging: goldfish: Call free_irq in error path

Wilfried Klaebe (1):
  staging: rtl8188eu: remove spaces, correct counts to unbreak P2P ioctls

 drivers/staging/Kconfig|2 -
 drivers/staging/Makefile   |1 -
 drivers/staging/comedi/comedi_buf.c|   37 +-
 drivers/staging/comedi/comedi_fops.c   |   18 +-
 drivers/staging/comedi/comedi_internal.h   |2 +
 drivers/staging/goldfish/goldfish_audio.c  |1 +
 drivers/staging/gs_fpgaboot/Makefile   |2 -
 drivers/staging/gs_fpgaboot/gs_fpgaboot.c  |1 -
 drivers/staging/rtl8187se/Kconfig  |   10 -
 drivers/staging/rtl8187se/Makefile |   38 -
 drivers/staging/rtl8187se/Module.symvers   |0
 drivers/staging/rtl8187se/TODO |   13 -
 drivers/staging/rtl8187se/ieee80211/dot11d.c   |  189 -
 drivers/staging/rtl8187se/ieee80211/dot11d.h   |   71 -
 drivers/staging/rtl8187se/ieee80211/ieee80211.h| 1496 
 .../staging/rtl8187se/ieee80211/ieee80211_crypt.c  |  240 --
 .../staging/rtl8187se/ieee80211/ieee80211_crypt.h  |   86 -
 .../rtl8187se/ieee80211/ieee80211_crypt_ccmp.c |  455 ---
 .../rtl8187se/ieee80211/ieee80211_crypt_tkip.c |  740 
 .../rtl8187se/ieee80211/ieee80211_crypt_wep.c  |  277 --
 .../staging/rtl8187se/ieee80211/ieee80211_module.c |  203 --
 drivers/staging/rtl8187se/ieee80211/ieee80211_rx.c | 1486 
 .../rtl8187se/ieee80211/ieee80211_softmac.c| 2711 --
 .../rtl8187se/ieee80211/ieee80211_softmac_wx.c |  567 ---
 drivers/staging/rtl8187se/ieee80211/ieee80211_tx.c |  591 ---
 drivers/staging/rtl8187se/ieee80211/ieee80211_wx.c |  713 
 drivers/staging/rtl8187se/r8180.h  |  640 
 drivers/staging/rtl8187se/r8180_93cx6.h|   54 -
 drivers/staging/rtl8187se/r8180_core.c | 3775 
 drivers/staging/rtl8187se/r8180_dm.c   | 1139 --
 drivers/staging/rtl8187se/r8180_dm.h   |   23 -
 drivers/staging/rtl8187se/r8180_hw.h   |  588 ---
 drivers/staging/rtl8187se/r8180_rtl8225.h  |   34 -
 drivers/staging/rtl8187se/r8180_rtl8225z2.c|  811 -
 drivers/staging/rtl8187se/r8180_wx.c   | 1409 
 drivers/staging/rtl8187se/r8180_wx.h   |   21 -
 drivers/staging/rtl8187se/r8185b_init.c| 1464 
 drivers/staging/rtl8188eu/core/rtw_recv.c  |   19 +-
 

Re: [PATCH 1/1] Fix some lines over 80 characters in imx-drm staging driver

2014-04-18 Thread Dan Carpenter
The subject doesn't have a prefix.  It should be:

[PATCH] Staging: imx-drm: fix some lines over 80 characters

On Fri, Apr 18, 2014 at 11:18:44PM +0200, Antoine Schweitzer-Chaput wrote:
 From 73eb48f2b376c56f0a354ea0e6c2c71972aaffae Mon Sep 17 00:00:00 2001
 From: Antoine Schweitzer-Chaput anto...@schweitzer-chaput.fr
 Date: Wed, 16 Apr 2014 09:59:26 +0200
 Subject: [PATCH 1/1] Fix some lines over 80 characters in imx-drm
 staging driver


Don't include these headers in the email.

The patch is corrupted. Read Documentation/email-clients.txt or use
`git send-email`.  Send it to yourself first.  Save the raw email
including headers and everything.  `cat raw_email.txt | git am`.  When
that works then resend it to the list.

regards,
dan carpenter


___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 1/2] staging: rtl8188eu: fix spaces instead of tabs for rtw_p2p.c

2014-04-18 Thread Dan Carpenter
On Fri, Apr 18, 2014 at 11:31:35PM +0200, Konrad Zapalowicz wrote:
 From: Konrad M Zapalowicz bergo.tor...@gmail.com

Don't include this line when your sending on your own behalf.

 
 This commit fixes the following checkpatch errors:
 
 rtl8188eu/core/rtw_p2p.c
 - 1508: ERROR: code indent should use tabs where possible
 - 1509: ERROR: code indent should use tabs where possible
 - 1510: ERROR: code indent should use tabs where possible
 
 Signed-off-by: Konrad Zapalowicz bergo.torino at gmail.com

Wrong format.

regards,
dan carpenter

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 0/3] staging: gdm72xx: Minor cleanup

2014-04-18 Thread Greg KH
On Fri, Mar 21, 2014 at 04:34:56PM +0800, Michalis Pappas wrote:
 The following patches perform various cleanups on the gdm72xx driver.
 
 PATCH 1/3 fixes some small coding style issues
 PATCH 2/3 removes an already completed item from the TODO list
 PATCH 3/3 replaces some jiffies comparisons with wrap-safe functions
 
 After all patches have been applied, the only remaining issue on the
 TODO list is to conform to the coding standards. The remaining issues
 reported by checkpatch.pl are probably pedantic, so if agreed, that task
 can be removed from the list too.

These patches were all oddly corrupted, can you try resending them after
ensuring that you can still apply them on your end?

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 01/02] linux-next: staging: gdm72xx: coding style fixes

2014-04-18 Thread Greg Kroah-Hartman
On Thu, Apr 17, 2014 at 04:29:47PM +0300, Alexandr Terekhov wrote:
 Fix:
 - unnecessary whitespace before a quoted newline
 - using `time_before` instread of comparisons of jiffies
 - enclosing macro in parenthesis

You failed to actually build this driver with this patch applied :(


___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 02/02] linux-next: staging: gdm72xx: Fix naked sscanf

2014-04-18 Thread Greg Kroah-Hartman
On Thu, Apr 17, 2014 at 04:31:44PM +0300, Alexandr Terekhov wrote:
 Fix naked sscanf
 
 Signed-off-by: Alexandr Terekhov  alexandr_terek...@epam.com
 
 diff --git a/drivers/staging/gdm72xx/gdm_wimax.c 
 b/drivers/staging/gdm72xx/gdm_wimax.c
 index 05ce2a2..7f60da3 100644
 --- a/drivers/staging/gdm72xx/gdm_wimax.c
 +++ b/drivers/staging/gdm72xx/gdm_wimax.c
 @@ -285,6 +285,7 @@ static void __gdm_wimax_event_send(struct work_struct 
 *work)
   int idx;
   unsigned long flags;
   struct evt_entry *e;
 + int rc;
  
   spin_lock_irqsave(wm_event.evt_lock, flags);
  
 @@ -292,7 +293,10 @@ static void __gdm_wimax_event_send(struct work_struct 
 *work)
   e = list_entry(wm_event.evtq.next, struct evt_entry, list);
   spin_unlock_irqrestore(wm_event.evt_lock, flags);
  
 - sscanf(e-dev-name, wm%d, idx);
 + rc = sscanf(e-dev-name, wm%d, idx);
 + if (0 == rc)

Kernel style is the other way around, or just if (rc)

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: rtl8192u: r8192U_wx: Fix sparse warnings

2014-04-18 Thread Greg KH
On Fri, Mar 21, 2014 at 04:07:49PM +0200, Matei Oprea wrote:
 Fix sparse should be static warnings. Those structures are
 only referenced in file scope so they can be marked as static.
 
 Signed-off-by: Matei Oprea e...@opreamatei.ro
 Cc: ROSEdu Kernel Community fire...@lists.rosedu.org
 ---
  drivers/staging/rtl8192u/r8192U_wx.c |6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)

This patch breaks the build, how did you test it?

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2 3/4] staging: vt6655: remove dead code

2014-04-18 Thread Greg KH
On Wed, Apr 02, 2014 at 02:53:03PM -0300, Guido Martínez wrote:
 Remove dead code in many places on this driver.
 
 Signed-off-by: Guido Martínez gu...@vanguardiasur.com.ar

This patch does not apply, can you refresh it, and the 4/4 patch,
against my latest tree and resend?

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: vt6656: fix sparse warning

2014-04-18 Thread Greg KH
On Mon, Apr 14, 2014 at 10:41:07AM +1000, Angus Gibson wrote:
 This patch fixes the following warning:
 drivers/staging/vt6656/aes_ccmp.c:221:6: warning: symbol 'AESbGenCCMP' was 
 not declared. Should it be static?
 
 Signed-off-by: Angus Gibson darthshr...@gmail.com
 ---
  drivers/staging/vt6656/aes_ccmp.c | 1 +
  1 file changed, 1 insertion(+)
 
 diff --git a/drivers/staging/vt6656/aes_ccmp.c 
 b/drivers/staging/vt6656/aes_ccmp.c
 index e2bfa8d..a9d5168 100644
 --- a/drivers/staging/vt6656/aes_ccmp.c
 +++ b/drivers/staging/vt6656/aes_ccmp.c
 @@ -32,6 +32,7 @@
  
  #include device.h
  #include 80211hdr.h
 +#include aes_ccmp.h

Someone else sent this same patch before you, so I can't take this
patch, sorry :(

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Locking issues in mmc: rtsx: add support for pre_req and post_req (was: Re: [PATCH] mmc: rtsx: fix possible circular locking dependency)

2014-04-18 Thread Peter Wu
So, I reverted c42deffd5b53c9e583d83c7964854ede2f12410d (mmc: rtsx: add 
support for pre_req and post_req) on top of v3.15-rc1-49-g10ec34f and the 
hang issue went away.

There is something that is possibly problematic. All three tasklets (cmd, 
data, finish) try to spinlock on host-lock. According to the tasklets 
documentation[1], they always run at interrupts (i.e., at any time, possibly 
right after tasklet_schedule if I got this right?).

These tasklets however do get scheduled *under* the host-lock which will 
cause a deadlock. This proposed patch (mmc: rtsx: fix possible circular 
locking dependency) fixes the issue for sd_isr_done_transfer, but there are 
others:

1. sd_request_timeout:
 125 spin_lock_irqsave(host-lock, flags);
 ...
 139 out:
 140 tasklet_schedule(host-finish_tasklet); // --
 141 spin_unlock_irqrestore(host-lock, flags);

2. sd_get_rsp (cmd_tasklet!):
 429 spin_lock_irqsave(host-lock, flags);
 ...
 506 tasklet_schedule(host-finish_tasklet); // --
 507 spin_unlock_irqrestore(host-lock, flags);

3. sd_finish_multi_rw (data_tasklet!):
 657 spin_lock_irqsave(host-lock, flags);
 ...
 684 tasklet_schedule(host-finish_tasklet); // --
 685 spin_unlock_irqrestore(host-lock, flags);

4. sdmmc_request:
 921 mutex_lock(pcr-pcr_mutex);
 922 spin_lock_irqsave(host-lock, flags);
 ...
 967 tasklet_schedule(host-finish_tasklet); // --
 968 spin_unlock_irqrestore(host-lock, flags);

5. rtsx_pci_sdmmc_drv_remove:
  1526 spin_lock_irqsave(host-lock, flags);
  1527 if (host-mrq) {
  ...
  1541 tasklet_schedule(host-finish_tasklet); // --
  1542 }
  1543 spin_unlock_irqrestore(host-lock, flags);
  1544 
  1545 del_timer_sync(host-timer);
  1546 tasklet_kill(host-cmd_tasklet);
  1547 tasklet_kill(host-data_tasklet);
  1548 tasklet_kill(host-finish_tasklet); // --

pcr_mutex (un)locking:
 - gets locked in sdmmc_request
 - gets unlocked in sd_finish_request (finish_tasklet).
 - gets locked/unlocked in sdmmc_set_ios
 - gets locked/unlocked in sdmmc_get_ro
 - gets locked/unlocked in sdmmc_get_cd
 - gets locked/unlocked in sdmmc_switch_voltage
 - gets locked/unlocked in sdmmc_execute_tuning

finish_tasklet (sd_finish_request()) gets scheduled in:
 - sd_request_timeout (under host-lock; called on timer expiration)
 - error path of sd_send_cmd
 - get_rsp (cmd_tasklet; under host-lock)
 - error path of sd_start_multi_rw (after mod timer)
 - sd_finish_multi_rw (under host-lock)
 - sdmmc_request (under host-lock in error path; without host-lock
   elsewhere)
 - rtsx_pci_sdmmc_drv_remove (under host-lock)

sd_request_timeout (timer) related:
 - deleted in sd_finish_request under host-lock (also assumes pcr_mutex)
 - sd_send_cmd (timer set with 100ms timeout, not called in error path)
 - sd_start_multi_rw (timeout set to 10 HZ, called before error path is
   checked in which finish_tasklet gets scheduled)
Note: sd_request_timeout claims+releases host-lock.

If I understand it correctly, host-lock is responsible for protecting the 
realtek_pci_sdmmc structure. Why is tasklet_schedule() on the same lock?

Shouldn't the above five tasklet_schedule calls be moved outside the lock? 
Will it be problematic if the same tasklet gets executed multiple times (if 
that is possible?).

Does it really need that much locking? dw_mmc.c also implements pre_req, but 
uses tasklets without needing to lock anything.

Kind regards,
Peter

 [1]: http://www.makelinux.net/ldd3/chp-7-sect-5

On Friday 18 April 2014 16:00:53 Peter Wu wrote:
 On Wednesday 16 April 2014 09:38:44 micky_ch...@realsil.com.cn wrote:
  From: Micky Ching micky_ch...@realsil.com.cn
  
  To avoid dead lock, we need make sure host-lock is always acquire
  before pcr-lock. But in irq handler, we acquired pcr-lock in rtsx mfd
  driver, and sd_isr_done_transfer() is called during pcr-lock already
  acquired. Since in sd_isr_done_transfer() the only work we do is schdule
  tasklet, the cmd_tasklet and data_tasklet never conflict, so it is safe
  to remove spin_lock() here.
  
  Signed-off-by: Micky Ching micky_ch...@realsil.com.cn
  ---
  
   drivers/mmc/host/rtsx_pci_sdmmc.c |4 +---
   1 file changed, 1 insertion(+), 3 deletions(-)
 
 This patch came from
 https://lkml.kernel.org/r/534de1d7.3000...@realsil.com.cn (Re:
 rtsx_pci_sdmmc lockdep splat).
 
 With v3.15-rc1-49-g10ec34f, I have a hung machine when inserting a SD card.
 lockdep was not enabled for the kernel, I have not bisected yet.
 This patch on top of that kernel version does not help (tested by
 rmmod rtsx_pci_sdmmc and insmod the patched one).
 
 Console (as typed over from a picture, sorry for any typos):
 WARNING: CPU: 1 PID: 0 at kernel/locking/mutex.c:698
 DEBUG_LOCKS_WARN_ON(in_interrupt())
 Modules linked in: ...
 CPU: 1 PID: 0 Comm: swapper/1 Not tainted 3.15-rc1-custom-49-g10ec34f #5
 Hardware name: Shuttle 

Re: [PATCH 2/2] staging: rtl8188eu: fix spaces instead of tabs for rtw_recv.c

2014-04-18 Thread Greg KH
On Fri, Apr 18, 2014 at 11:31:36PM +0200, Konrad Zapalowicz wrote:
 From: Konrad M Zapalowicz bergo.tor...@gmail.com
 
 This commit fixes the following checkpatch errors:
 
 rtl8188eu/core/rtw_recv.c
 - 1874: ERROR: code indent should use tabs where possible
 
 Signed-off-by: Konrad Zapalowicz bergo.torino at gmail.com

As Dan pointed out, we need a real address here, use @ please.

can you resend these?

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] Staging: crystalhd: Mark local functions as static

2014-04-18 Thread Greg KH
On Fri, Apr 18, 2014 at 07:57:51PM +0200, Bojan Prtvar wrote:
 This fixes the following sparse warnings:
 drivers/staging/crystalhd/crystalhd_lnx.c:631:5: warning: symbol 
 'chd_dec_pci_suspend' was not declared. Should it be static?
 drivers/staging/crystalhd/crystalhd_lnx.c:665:5: warning: symbol 
 'chd_dec_pci_resume' was not declared. Should it be static?
 drivers/staging/crystalhd/crystalhd_lnx.c:78:29: warning: symbol 
 'chd_dec_alloc_iodata' was not declared. Should it be static?
 drivers/staging/crystalhd/crystalhd_lnx.c:99:6: warning: symbol 
 'chd_dec_free_iodata' was not declared. Should it be static?
 
 Signed-off-by: Bojan Prtvar prtva...@gmail.com
 ---
  drivers/staging/crystalhd/crystalhd_lnx.c |   10 +-
  1 file changed, 5 insertions(+), 5 deletions(-)

This patch doesn't apply to my tree, can you redo it and resend?

thanks,

greg k-h
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel