public inbox for linux-rdma@vger.kernel.org
 help / color / mirror / Atom feed
From: Sven Breuner <sven.breuner-mPn0NPGs4xGatNDF+KUbs4QuADTiUCJX@public.gmane.org>
To: linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Cc: Bernd Schubert
	<public-bernd.schubert-mPn0NPGs4xGatNDF+KUbs4QuADTiUCJX-1dZseelyfdZg9hUCZPvPmw@public.gmane.org>,
	"Hefty,
	Sean"
	<public-sean.hefty-ral2JQCrhuEAvxtiuMwx3w-1dZseelyfdZg9hUCZPvPmw@public.gmane.org>,
	"linux-rdma-u79uwXL29TY76Z2rM5mHXA-XMD5yJDbdMReXY1tMh2IBg@public.gmane.org"
	<public-linux-rdma-u79uwXL29TY76Z2rM5mHXA-1dZseelyfdZg9hUCZPvPmw@public.gmane.org>
Subject: Re: [PATCH] core/verb.c: fix kernel panic: always initialize struct ib_qp *qp->usecnt
Date: Fri, 27 Jan 2012 17:23:30 +0100	[thread overview]
Message-ID: <4F22CF82.2060606@itwm.fraunhofer.de> (raw)
In-Reply-To: <CAL1RGDW=XfCd3aCmB0mE1WcOUeDj=17=s2K0A3zpFmBF6Rg_Rg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

Hi,

Roland Dreier wrote on 01/20/2012 07:43 PM:
> On Fri, Jan 20, 2012 at 10:40 AM, Roland Dreier<roland-BHEL68pLQRGGvPXPguhicg@public.gmane.org>  wrote:
>> On Fri, Jan 20, 2012 at 8:14 AM, Bernd Schubert
>> <bernd.schubert-mPn0NPGs4xGatNDF+KUbs4QuADTiUCJX@public.gmane.org>  wrote:
>>> I *guess* the qp allocated by pd->context->ops.create_qp() does not have
>>> qp->usecnt initialized (not does it know anything about it). So its random
>>> value will fail the destruction later. A simple workaround that would work
>>> for us, is to extend the patch I send to
>>>
>>> diff --git a/drivers/infiniband/core/verbs.c
>>> b/drivers/infiniband/core/verbs.c
>>> index 602b1bd..fba1675 100644
>>> --- a/drivers/infiniband/core/verbs.c
>>> +++ b/drivers/infiniband/core/verbs.c
>>> @@ -874,7 +874,7 @@ int ib_destroy_qp(struct ib_qp *qp)
>>>         struct ib_srq *srq;
>>>         int ret;
>>>
>>> -       if (atomic_read(&qp->usecnt))
>>> +       if (qp->qp_type == IB_QPT_XRC_TGT&&  atomic_read(&qp->usecnt))
>>>                 return -EBUSY;
>>>
>>>         if (qp->real_qp != qp)
>>
>> It looks like this is sufficient and correct without the other patch?
>
> But maybe it's cleaner to initialize qp->usecnt in
> both ib_create_qp() and ib_uverbs_create_qp().
>
>   - R.


is there any progress on this? We have already reached Linux stable 
3.2.2 and IB still appears to be broken (at least for mthca) because of 
this.

Best regards,
Sven

--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2012-01-27 16:23 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-19 19:46 [PATCH] core/verb.c: fix kernel panic: always initialize struct ib_qp *qp->usecnt Bernd Schubert
     [not found] ` <20120119194641.1391553.39048.stgit-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2012-01-19 20:29   ` Hefty, Sean
     [not found]     ` <1828884A29C6694DAF28B7E6B8A823732DC0C33E-P5GAC/sN6hlZtRGVdHMbwrfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2012-01-20 16:14       ` Bernd Schubert
     [not found]         ` <4F1992F6.9070103-mPn0NPGs4xGatNDF+KUbs4QuADTiUCJX@public.gmane.org>
2012-01-20 18:40           ` Roland Dreier
     [not found]             ` <CAL1RGDWSh3HpVY5dui549EoqhzTYaSnsCPGdEU+hPZ9NWx6ttw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-01-20 18:43               ` Roland Dreier
     [not found]                 ` <CAL1RGDW=XfCd3aCmB0mE1WcOUeDj=17=s2K0A3zpFmBF6Rg_Rg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-01-27 16:23                   ` Sven Breuner [this message]
     [not found]                     ` <4F22CF82.2060606-mPn0NPGs4xGatNDF+KUbs4QuADTiUCJX@public.gmane.org>
2012-01-27 17:20                       ` Roland Dreier
     [not found]                         ` <CAL1RGDXXYG48d2P0h4G+z4W8HebjrQ7HTWyx5FqgB0_2OqC4Ng-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-01-27 18:49                           ` Sven Breuner
     [not found]                             ` <4F22F1C9.3090801-mPn0NPGs4xGatNDF+KUbs4QuADTiUCJX@public.gmane.org>
2012-01-27 19:09                               ` Roland Dreier
2012-01-23 15:11               ` Bernd Schubert
2012-01-19 20:38   ` Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2012-01-20 18:43 Hefty, Sean
     [not found] ` <1828884A29C6694DAF28B7E6B8A823732DC115E2-P5GAC/sN6hmkrb+BlOpmy7fspsVTdybXVpNB7YpNyf8@public.gmane.org>
2012-01-23 16:11   ` Bernd Schubert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4F22CF82.2060606@itwm.fraunhofer.de \
    --to=sven.breuner-mpn0npgs4xgatndf+kubs4quadtiucjx@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=public-bernd.schubert-mPn0NPGs4xGatNDF+KUbs4QuADTiUCJX-1dZseelyfdZg9hUCZPvPmw@public.gmane.org \
    --cc=public-linux-rdma-u79uwXL29TY76Z2rM5mHXA-1dZseelyfdZg9hUCZPvPmw@public.gmane.org \
    --cc=public-sean.hefty-ral2JQCrhuEAvxtiuMwx3w-1dZseelyfdZg9hUCZPvPmw@public.gmane.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox