2009-12-16 14:36:12

by Yong Zhang

[permalink] [raw]
Subject: [PATCH 0/5] use DECLARE_COMPLETION_ONSTACK for non-constant completion

The _ONSTACK variant should be used for on-stack completion,
otherwise it will break lockdep.

Yong Zhang (5):
aha152x: use DECLARE_COMPLETION_ONSTACK for non-constant completion
mISDN: use DECLARE_COMPLETION_ONSTACK for non-constant completion
USB: use DECLARE_COMPLETION_ONSTACK for non-constant completion
hwmon: use DECLARE_COMPLETION_ONSTACK for non-constant completion
powerpc/iseries: use DECLARE_COMPLETION_ONSTACK for non-constant completion

arch/powerpc/platforms/iseries/viopath.c | 2 +-
drivers/hwmon/ams/ams-pmu.c | 4 ++--
drivers/isdn/mISDN/l1oip_core.c | 2 +-
drivers/scsi/aha152x.c | 2 +-
drivers/usb/gadget/fsl_qe_udc.c | 2 +-
drivers/usb/gadget/fsl_udc_core.c | 2 +-
drivers/usb/gadget/langwell_udc.c | 2 +-
7 files changed, 8 insertions(+), 8 deletions(-)


2009-12-16 14:36:23

by Yong Zhang

[permalink] [raw]
Subject: [PATCH 1/5] powerpc/iseries: use DECLARE_COMPLETION_ONSTACK for non-constant completion

The _ONSTACK variant should be used for on-stack completion,
otherwise it will break lockdep.

Signed-off-by: Yong Zhang <[email protected]>
Cc: Benjamin Herrenschmidt <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: [email protected]
---
arch/powerpc/platforms/iseries/viopath.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/arch/powerpc/platforms/iseries/viopath.c b/arch/powerpc/platforms/iseries/viopath.c
index 49ff4dc..5aea94f 100644
--- a/arch/powerpc/platforms/iseries/viopath.c
+++ b/arch/powerpc/platforms/iseries/viopath.c
@@ -116,7 +116,7 @@ static int proc_viopath_show(struct seq_file *m, void *v)
u16 vlanMap;
dma_addr_t handle;
HvLpEvent_Rc hvrc;
- DECLARE_COMPLETION(done);
+ DECLARE_COMPLETION_ONSTACK(done);
struct device_node *node;
const char *sysid;

--
1.6.3.3

2009-12-16 14:36:34

by Yong Zhang

[permalink] [raw]
Subject: [PATCH 2/5] hwmon: use DECLARE_COMPLETION_ONSTACK for non-constant completion

The _ONSTACK variant should be used for on-stack completion,
otherwise it will break lockdep.

Signed-off-by: Yong Zhang <[email protected]>
Cc: Stelian Pop <[email protected]>
Cc: Michael Hanselmann <[email protected]>
---
drivers/hwmon/ams/ams-pmu.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/hwmon/ams/ams-pmu.c b/drivers/hwmon/ams/ams-pmu.c
index fb18b3d..2016629 100644
--- a/drivers/hwmon/ams/ams-pmu.c
+++ b/drivers/hwmon/ams/ams-pmu.c
@@ -52,7 +52,7 @@ static void ams_pmu_req_complete(struct adb_request *req)
static void ams_pmu_set_register(u8 reg, u8 value)
{
static struct adb_request req;
- DECLARE_COMPLETION(req_complete);
+ DECLARE_COMPLETION_ONSTACK(req_complete);

req.arg = &req_complete;
if (pmu_request(&req, ams_pmu_req_complete, 4, ams_pmu_cmd, 0x00, reg, value))
@@ -65,7 +65,7 @@ static void ams_pmu_set_register(u8 reg, u8 value)
static u8 ams_pmu_get_register(u8 reg)
{
static struct adb_request req;
- DECLARE_COMPLETION(req_complete);
+ DECLARE_COMPLETION_ONSTACK(req_complete);

req.arg = &req_complete;
if (pmu_request(&req, ams_pmu_req_complete, 3, ams_pmu_cmd, 0x01, reg))
--
1.6.3.3

2009-12-16 14:36:52

by Yong Zhang

[permalink] [raw]
Subject: [PATCH 3/5] USB: use DECLARE_COMPLETION_ONSTACK for non-constant completion

The _ONSTACK variant should be used for on-stack completion,
otherwise it will break lockdep.

Signed-off-by: Yong Zhang <[email protected]>
Cc: Greg Kroah-Hartman <[email protected]>
Cc: Anton Vorontsov <[email protected]>
Cc: Kay Sievers <[email protected]>
Cc: Li Yang <[email protected]>
Cc: David Brownell <[email protected]>
Cc: [email protected]
---
drivers/usb/gadget/fsl_qe_udc.c | 2 +-
drivers/usb/gadget/fsl_udc_core.c | 2 +-
drivers/usb/gadget/langwell_udc.c | 2 +-
3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/gadget/fsl_qe_udc.c b/drivers/usb/gadget/fsl_qe_udc.c
index 7881f12..5e9e921 100644
--- a/drivers/usb/gadget/fsl_qe_udc.c
+++ b/drivers/usb/gadget/fsl_qe_udc.c
@@ -2694,7 +2694,7 @@ static int __devexit qe_udc_remove(struct of_device *ofdev)
struct qe_ep *ep;
unsigned int size;

- DECLARE_COMPLETION(done);
+ DECLARE_COMPLETION_ONSTACK(done);

if (!udc_controller)
return -ENODEV;
diff --git a/drivers/usb/gadget/fsl_udc_core.c b/drivers/usb/gadget/fsl_udc_core.c
index fa3d142..e9e4de3 100644
--- a/drivers/usb/gadget/fsl_udc_core.c
+++ b/drivers/usb/gadget/fsl_udc_core.c
@@ -2399,7 +2399,7 @@ static int __exit fsl_udc_remove(struct platform_device *pdev)
{
struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);

- DECLARE_COMPLETION(done);
+ DECLARE_COMPLETION_ONSTACK(done);

if (!udc_controller)
return -ENODEV;
diff --git a/drivers/usb/gadget/langwell_udc.c b/drivers/usb/gadget/langwell_udc.c
index a391351..ddfe015 100644
--- a/drivers/usb/gadget/langwell_udc.c
+++ b/drivers/usb/gadget/langwell_udc.c
@@ -2903,7 +2903,7 @@ static void langwell_udc_remove(struct pci_dev *pdev)
{
struct langwell_udc *dev = the_controller;

- DECLARE_COMPLETION(done);
+ DECLARE_COMPLETION_ONSTACK(done);

BUG_ON(dev->driver);
DBG(dev, "---> %s()\n", __func__);
--
1.6.3.3

2009-12-16 14:37:37

by Yong Zhang

[permalink] [raw]
Subject: [PATCH 4/5] mISDN: use DECLARE_COMPLETION_ONSTACK for non-constant completion

The _ONSTACK variant should be used for on-stack completion,
otherwise it will break lockdep.

Signed-off-by: Yong Zhang <[email protected]>
Cc: Karsten Keil <[email protected]>
Cc: David S. Miller <[email protected]>
Cc: Andreas Eversberg <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
---
drivers/isdn/mISDN/l1oip_core.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/isdn/mISDN/l1oip_core.c b/drivers/isdn/mISDN/l1oip_core.c
index 7e5f30d..f1e8af5 100644
--- a/drivers/isdn/mISDN/l1oip_core.c
+++ b/drivers/isdn/mISDN/l1oip_core.c
@@ -661,7 +661,7 @@ l1oip_socket_thread(void *data)
size_t recvbuf_size = 1500;
int recvlen;
struct socket *socket = NULL;
- DECLARE_COMPLETION(wait);
+ DECLARE_COMPLETION_ONSTACK(wait);

/* allocate buffer memory */
recvbuf = kmalloc(recvbuf_size, GFP_KERNEL);
--
1.6.3.3

2009-12-16 14:37:24

by Yong Zhang

[permalink] [raw]
Subject: [PATCH 5/5] aha152x: use DECLARE_COMPLETION_ONSTACK for non-constant completion

The _ONSTACK variant should be used for on-stack completion,
otherwise it will break lockdep.

Signed-off-by: Yong Zhang <[email protected]>
Cc: Juergen E. Fischer <[email protected]>
Cc: James E.J. Bottomley <[email protected]>
Cc: [email protected]
---
drivers/scsi/aha152x.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/aha152x.c b/drivers/scsi/aha152x.c
index 1e5478a..44e43b5 100644
--- a/drivers/scsi/aha152x.c
+++ b/drivers/scsi/aha152x.c
@@ -1143,7 +1143,7 @@ static int aha152x_abort(Scsi_Cmnd *SCpnt)
static int aha152x_device_reset(Scsi_Cmnd * SCpnt)
{
struct Scsi_Host *shpnt = SCpnt->device->host;
- DECLARE_COMPLETION(done);
+ DECLARE_COMPLETION_ONSTACK(done);
int ret, issued, disconnected;
unsigned char old_cmd_len = SCpnt->cmd_len;
unsigned long flags;
--
1.6.3.3

2009-12-16 15:14:24

by Cong Wang

[permalink] [raw]
Subject: Re: [PATCH 0/5] use DECLARE_COMPLETION_ONSTACK for non-constant completion

On Wed, Dec 16, 2009 at 10:35:56PM +0800, Yong Zhang wrote:
>The _ONSTACK variant should be used for on-stack completion,
>otherwise it will break lockdep.
>
>Yong Zhang (5):
> aha152x: use DECLARE_COMPLETION_ONSTACK for non-constant completion
> mISDN: use DECLARE_COMPLETION_ONSTACK for non-constant completion
> USB: use DECLARE_COMPLETION_ONSTACK for non-constant completion
> hwmon: use DECLARE_COMPLETION_ONSTACK for non-constant completion
> powerpc/iseries: use DECLARE_COMPLETION_ONSTACK for non-constant completion

These all look fine for me.

Reviewed-by: WANG Cong <[email protected]>

For lockdep stuff, you should Cc Peter, adding him into Cc...

Thanks.


>
> arch/powerpc/platforms/iseries/viopath.c | 2 +-
> drivers/hwmon/ams/ams-pmu.c | 4 ++--
> drivers/isdn/mISDN/l1oip_core.c | 2 +-
> drivers/scsi/aha152x.c | 2 +-
> drivers/usb/gadget/fsl_qe_udc.c | 2 +-
> drivers/usb/gadget/fsl_udc_core.c | 2 +-
> drivers/usb/gadget/langwell_udc.c | 2 +-
> 7 files changed, 8 insertions(+), 8 deletions(-)
>--
>To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
>the body of a message to [email protected]
>More majordomo info at http://vger.kernel.org/majordomo-info.html
>Please read the FAQ at http://www.tux.org/lkml/

--
Live like a child, think like the god.

2009-12-16 19:00:38

by Karsten Keil

[permalink] [raw]
Subject: Re: [PATCH 4/5] mISDN: use DECLARE_COMPLETION_ONSTACK for non-constant completion

The _ONSTACK variant should be used for on-stack completion,
otherwise it will break lockdep.

Signed-off-by: Yong Zhang <[email protected]>
Acked-by: Karsten Keil <[email protected]>
Cc: David S. Miller <[email protected]>
Cc: Andreas Eversberg <[email protected]>
Cc: Arnaldo Carvalho de Melo <[email protected]>
---
drivers/isdn/mISDN/l1oip_core.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/isdn/mISDN/l1oip_core.c b/drivers/isdn/mISDN/l1oip_core.c
index 7e5f30d..f1e8af5 100644
--- a/drivers/isdn/mISDN/l1oip_core.c
+++ b/drivers/isdn/mISDN/l1oip_core.c
@@ -661,7 +661,7 @@ l1oip_socket_thread(void *data)
size_t recvbuf_size = 1500;
int recvlen;
struct socket *socket = NULL;
- DECLARE_COMPLETION(wait);
+ DECLARE_COMPLETION_ONSTACK(wait);

/* allocate buffer memory */
recvbuf = kmalloc(recvbuf_size, GFP_KERNEL);

2009-12-19 04:30:23

by David Miller

[permalink] [raw]
Subject: Re: [PATCH 4/5] mISDN: use DECLARE_COMPLETION_ONSTACK for non-constant completion

From: Karsten Keil <[email protected]>
Date: Wed, 16 Dec 2009 20:00:20 +0100

> The _ONSTACK variant should be used for on-stack completion,
> otherwise it will break lockdep.
>
> Signed-off-by: Yong Zhang <[email protected]>
> Acked-by: Karsten Keil <[email protected]>

Applied, thanks.