diff mbox

[rdma-next] RDMA/srpt: Fix RCU debug build error

Message ID 1516746607.3339.47.camel@wdc.com (mailing list archive)
State Superseded
Headers show

Commit Message

Bart Van Assche Jan. 23, 2018, 10:30 p.m. UTC
On Tue, 2018-01-23 at 20:57 +0200, Leon Romanovsky wrote:
> So how are we going to solve that rdma/for-next doesn't compile?


How about the following?

[PATCH] IB/srpt: Fix CONFIG_DEBUG_OBJECTS_RCU_HEAD=y build

Avoid that the kernel build fails as follows if RCU debugging is
enabled:

ERROR: "init_rcu_head" [drivers/infiniband/ulp/srpt/ib_srpt.ko] undefined!

Comments

Leon Romanovsky Jan. 24, 2018, 6:44 a.m. UTC | #1
On Tue, Jan 23, 2018 at 10:30:08PM +0000, Bart Van Assche wrote:
> On Tue, 2018-01-23 at 20:57 +0200, Leon Romanovsky wrote:
> > So how are we going to solve that rdma/for-next doesn't compile?
>
> How about the following?
>
> [PATCH] IB/srpt: Fix CONFIG_DEBUG_OBJECTS_RCU_HEAD=y build
>
> Avoid that the kernel build fails as follows if RCU debugging is
> enabled:
>
> ERROR: "init_rcu_head" [drivers/infiniband/ulp/srpt/ib_srpt.ko] undefined!
>
> diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c
> index 5ccc75c389e2..a78a79791950 100644
> --- a/drivers/infiniband/ulp/srpt/ib_srpt.c
> +++ b/drivers/infiniband/ulp/srpt/ib_srpt.c
> @@ -1977,7 +1977,6 @@ static struct srpt_nexus *srpt_get_nexus(struct srpt_port *sport,
>  			nexus = ERR_PTR(-ENOMEM);
>  			break;
>  		}
> -		init_rcu_head(&tmp_nexus->rcu);
>  		INIT_LIST_HEAD(&tmp_nexus->ch_list);
>  		memcpy(tmp_nexus->i_port_id, i_port_id, 16);
>  		memcpy(tmp_nexus->t_port_id, t_port_id, 16);
> @@ -2147,7 +2146,6 @@ static int srpt_cm_req_recv(struct srpt_device *const sdev,
>  		goto reject;
>  	}
>
> -	init_rcu_head(&ch->rcu);
>  	kref_init(&ch->kref);
>  	ch->pkey = be16_to_cpu(pkey);
>  	ch->nexus = nexus;

Thanks
Doug Ledford Jan. 24, 2018, 10:36 p.m. UTC | #2
On Tue, 2018-01-23 at 22:30 +0000, Bart Van Assche wrote:
> On Tue, 2018-01-23 at 20:57 +0200, Leon Romanovsky wrote:
> > So how are we going to solve that rdma/for-next doesn't compile?
> 
> How about the following?
> 
> [PATCH] IB/srpt: Fix CONFIG_DEBUG_OBJECTS_RCU_HEAD=y build
> 
> Avoid that the kernel build fails as follows if RCU debugging is
> enabled:
> 
> ERROR: "init_rcu_head" [drivers/infiniband/ulp/srpt/ib_srpt.ko] undefined!
> 
> diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c
> index 5ccc75c389e2..a78a79791950 100644
> --- a/drivers/infiniband/ulp/srpt/ib_srpt.c
> +++ b/drivers/infiniband/ulp/srpt/ib_srpt.c
> @@ -1977,7 +1977,6 @@ static struct srpt_nexus *srpt_get_nexus(struct srpt_port *sport,
>  			nexus = ERR_PTR(-ENOMEM);
>  			break;
>  		}
> -		init_rcu_head(&tmp_nexus->rcu);
>  		INIT_LIST_HEAD(&tmp_nexus->ch_list);
>  		memcpy(tmp_nexus->i_port_id, i_port_id, 16);
>  		memcpy(tmp_nexus->t_port_id, t_port_id, 16);
> @@ -2147,7 +2146,6 @@ static int srpt_cm_req_recv(struct srpt_device *const sdev,
>  		goto reject;
>  	}
>  
> -	init_rcu_head(&ch->rcu);
>  	kref_init(&ch->kref);
>  	ch->pkey = be16_to_cpu(pkey);
>  	ch->nexus = nexus;

Hi Bart,

Can you please resend this as an official patch with SOB so we can pull
this in?  Thanks.
Bart Van Assche Jan. 24, 2018, 10:40 p.m. UTC | #3
On Wed, 2018-01-24 at 17:36 -0500, Doug Ledford wrote:
> Can you please resend this as an official patch with SOB so we can pull

> this in?  Thanks.


Hello Doug,

Can you have a look at this patch and see whether this needs any further
adjustments: https://marc.info/?l=linux-rdma&m=151677697120770.

Thanks,

Bart.
Doug Ledford Jan. 25, 2018, 1:19 a.m. UTC | #4
On Wed, 2018-01-24 at 22:40 +0000, Bart Van Assche wrote:
> On Wed, 2018-01-24 at 17:36 -0500, Doug Ledford wrote:
> > Can you please resend this as an official patch with SOB so we can pull
> > this in?  Thanks.
> 
> Hello Doug,
> 
> Can you have a look at this patch and see whether this needs any further
> adjustments: https://marc.info/?l=linux-rdma&m=151677697120770.
> 
> Thanks,
> 
> Bart.

That's good.  I just missed it in my email client because the time/date
sorting of the threads had this thread later in my list and that lone
patch sitting by itself out of sight-out of mind.  Thanks for the
pointer ;-)
diff mbox

Patch

diff --git a/drivers/infiniband/ulp/srpt/ib_srpt.c b/drivers/infiniband/ulp/srpt/ib_srpt.c
index 5ccc75c389e2..a78a79791950 100644
--- a/drivers/infiniband/ulp/srpt/ib_srpt.c
+++ b/drivers/infiniband/ulp/srpt/ib_srpt.c
@@ -1977,7 +1977,6 @@  static struct srpt_nexus *srpt_get_nexus(struct srpt_port *sport,
 			nexus = ERR_PTR(-ENOMEM);
 			break;
 		}
-		init_rcu_head(&tmp_nexus->rcu);
 		INIT_LIST_HEAD(&tmp_nexus->ch_list);
 		memcpy(tmp_nexus->i_port_id, i_port_id, 16);
 		memcpy(tmp_nexus->t_port_id, t_port_id, 16);
@@ -2147,7 +2146,6 @@  static int srpt_cm_req_recv(struct srpt_device *const sdev,
 		goto reject;
 	}
 
-	init_rcu_head(&ch->rcu);
 	kref_init(&ch->kref);
 	ch->pkey = be16_to_cpu(pkey);
 	ch->nexus = nexus;