* [PATCH 1/2] iw_cxgb4: call dev_put() on l2t allocation failure
@ 2016-08-26 15:27 Steve Wise
[not found] ` <c1b639ca7d71ee034e334b4400ff0bae3ba58c47.1472241953.git.swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
0 siblings, 1 reply; 6+ messages in thread
From: Steve Wise @ 2016-08-26 15:27 UTC (permalink / raw)
To: dledford-H+wXaHxf7aLQT0dZR+AlfA,
linux-rdma-u79uwXL29TY76Z2rM5mHXA
Signed-off-by: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
---
drivers/infiniband/hw/cxgb4/cm.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c
index b6a953a..434a7fb 100644
--- a/drivers/infiniband/hw/cxgb4/cm.c
+++ b/drivers/infiniband/hw/cxgb4/cm.c
@@ -2117,8 +2117,10 @@ static int import_ep(struct c4iw_ep *ep, int iptype, __u8 *peer_ip,
}
ep->l2t = cxgb4_l2t_get(cdev->rdev.lldi.l2t,
n, pdev, rt_tos2priority(tos));
- if (!ep->l2t)
+ if (!ep->l2t) {
+ dev_put(pdev);
goto out;
+ }
ep->mtu = pdev->mtu;
ep->tx_chan = cxgb4_port_chan(pdev);
ep->smac_idx = cxgb4_tp_smt_idx(adapter_type,
--
2.7.0
--
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
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] iw_cxgb4: block module unload until all ep resources are released
[not found] ` <c1b639ca7d71ee034e334b4400ff0bae3ba58c47.1472241953.git.swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
@ 2016-08-26 15:28 ` Steve Wise
2016-08-29 19:25 ` [PATCH 1/2] iw_cxgb4: call dev_put() on l2t allocation failure Steve Wise
1 sibling, 0 replies; 6+ messages in thread
From: Steve Wise @ 2016-08-26 15:28 UTC (permalink / raw)
To: dledford-H+wXaHxf7aLQT0dZR+AlfA,
linux-rdma-u79uwXL29TY76Z2rM5mHXA
Otherwise an endpoint can be still closing down causing a touch
after free crash.
Fixes: ad61a4c7a9b7 ("iw_cxgb4: don't block in destroy_qp awaiting the last deref")
Signed-off-by: Steve Wise <swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
---
drivers/infiniband/hw/cxgb4/cm.c | 2 ++
drivers/infiniband/hw/cxgb4/device.c | 5 +++++
drivers/infiniband/hw/cxgb4/iw_cxgb4.h | 1 +
3 files changed, 8 insertions(+)
diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c
index 434a7fb..80f9889 100644
--- a/drivers/infiniband/hw/cxgb4/cm.c
+++ b/drivers/infiniband/hw/cxgb4/cm.c
@@ -333,6 +333,8 @@ static void remove_ep_tid(struct c4iw_ep *ep)
spin_lock_irqsave(&ep->com.dev->lock, flags);
_remove_handle(ep->com.dev, &ep->com.dev->hwtid_idr, ep->hwtid, 0);
+ if (idr_is_empty(&ep->com.dev->hwtid_idr))
+ wake_up(&ep->com.dev->wait);
spin_unlock_irqrestore(&ep->com.dev->lock, flags);
}
diff --git a/drivers/infiniband/hw/cxgb4/device.c b/drivers/infiniband/hw/cxgb4/device.c
index 071d733..3c4b212 100644
--- a/drivers/infiniband/hw/cxgb4/device.c
+++ b/drivers/infiniband/hw/cxgb4/device.c
@@ -872,9 +872,13 @@ static void c4iw_rdev_close(struct c4iw_rdev *rdev)
static void c4iw_dealloc(struct uld_ctx *ctx)
{
c4iw_rdev_close(&ctx->dev->rdev);
+ WARN_ON_ONCE(!idr_is_empty(&ctx->dev->cqidr));
idr_destroy(&ctx->dev->cqidr);
+ WARN_ON_ONCE(!idr_is_empty(&ctx->dev->qpidr));
idr_destroy(&ctx->dev->qpidr);
+ WARN_ON_ONCE(!idr_is_empty(&ctx->dev->mmidr));
idr_destroy(&ctx->dev->mmidr);
+ wait_event(ctx->dev->wait, idr_is_empty(&ctx->dev->hwtid_idr));
idr_destroy(&ctx->dev->hwtid_idr);
idr_destroy(&ctx->dev->stid_idr);
idr_destroy(&ctx->dev->atid_idr);
@@ -992,6 +996,7 @@ static struct c4iw_dev *c4iw_alloc(const struct cxgb4_lld_info *infop)
mutex_init(&devp->rdev.stats.lock);
mutex_init(&devp->db_mutex);
INIT_LIST_HEAD(&devp->db_fc_list);
+ init_waitqueue_head(&devp->wait);
devp->avail_ird = devp->rdev.lldi.max_ird_adapter;
if (c4iw_debugfs_root) {
diff --git a/drivers/infiniband/hw/cxgb4/iw_cxgb4.h b/drivers/infiniband/hw/cxgb4/iw_cxgb4.h
index aa47e0a..4b83b84 100644
--- a/drivers/infiniband/hw/cxgb4/iw_cxgb4.h
+++ b/drivers/infiniband/hw/cxgb4/iw_cxgb4.h
@@ -263,6 +263,7 @@ struct c4iw_dev {
struct idr stid_idr;
struct list_head db_fc_list;
u32 avail_ird;
+ wait_queue_head_t wait;
};
static inline struct c4iw_dev *to_c4iw_dev(struct ib_device *ibdev)
--
2.7.0
--
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
^ permalink raw reply related [flat|nested] 6+ messages in thread
* RE: [PATCH 1/2] iw_cxgb4: call dev_put() on l2t allocation failure
[not found] ` <c1b639ca7d71ee034e334b4400ff0bae3ba58c47.1472241953.git.swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
2016-08-26 15:28 ` [PATCH 2/2] iw_cxgb4: block module unload until all ep resources are released Steve Wise
@ 2016-08-29 19:25 ` Steve Wise
2016-09-02 14:09 ` Doug Ledford
1 sibling, 1 reply; 6+ messages in thread
From: Steve Wise @ 2016-08-29 19:25 UTC (permalink / raw)
To: dledford-H+wXaHxf7aLQT0dZR+AlfA,
linux-rdma-u79uwXL29TY76Z2rM5mHXA
Hey Doug, I was hoping these two could make 4.8-rc. Particularly patch 2/2.
Steve.
--
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] iw_cxgb4: call dev_put() on l2t allocation failure
2016-08-29 19:25 ` [PATCH 1/2] iw_cxgb4: call dev_put() on l2t allocation failure Steve Wise
@ 2016-09-02 14:09 ` Doug Ledford
[not found] ` <05141088-7c92-daba-1e0b-da1bc5656a75-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 6+ messages in thread
From: Doug Ledford @ 2016-09-02 14:09 UTC (permalink / raw)
To: Steve Wise, linux-rdma-u79uwXL29TY76Z2rM5mHXA
[-- Attachment #1.1: Type: text/plain, Size: 737 bytes --]
On 8/29/2016 3:25 PM, Steve Wise wrote:
> Hey Doug, I was hoping these two could make 4.8-rc. Particularly patch 2/2.
>
> Steve.
>
>
Hi Steve,
You've submitted these both individually and as part of a larger nvme
patchset. You should know that I generally ignore nvme patch sets (I
have enough stuff to review), I just happened to catch it this time.
Submitting these both ways is likely to cause problems down the road,
including getting me yelled at by Linus when the same patches come from
two different places. Please try to avoid that.
Now, in regards to these two patches, how are you wanting to proceed?
--
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
GPG Key ID: 0E572FDD
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* RE: [PATCH 1/2] iw_cxgb4: call dev_put() on l2t allocation failure
[not found] ` <05141088-7c92-daba-1e0b-da1bc5656a75-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
@ 2016-09-02 14:24 ` Steve Wise
2016-09-02 17:15 ` Doug Ledford
0 siblings, 1 reply; 6+ messages in thread
From: Steve Wise @ 2016-09-02 14:24 UTC (permalink / raw)
To: 'Doug Ledford', linux-rdma-u79uwXL29TY76Z2rM5mHXA
Cc: 'Sagi Grimberg', 'Christoph Hellwig'
>
> On 8/29/2016 3:25 PM, Steve Wise wrote:
> > Hey Doug, I was hoping these two could make 4.8-rc. Particularly patch
> 2/2.
> >
> > Steve.
> >
> >
>
> Hi Steve,
>
> You've submitted these both individually and as part of a larger nvme
> patchset. You should know that I generally ignore nvme patch sets (I
> have enough stuff to review), I just happened to catch it this time.
> Submitting these both ways is likely to cause problems down the road,
> including getting me yelled at by Linus when the same patches come from
> two different places. Please try to avoid that.
>
> Now, in regards to these two patches, how are you wanting to proceed?
>
Sorry about that. My screw up. I should have just CCed linux-rdma and you
on the original nvme series as it progressed, instead of posting the
iw_cxgb4 patches to linux-rdma separately. In v4 of the nvme series, which
CCed you and linux-rdma, I propose that Sagi merge these through the
nvme-fabrics. I haven't heard back from him on that yet. So I want to
wait until we hear from him before proceeding.
Thanks,
Steve
--
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
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH 1/2] iw_cxgb4: call dev_put() on l2t allocation failure
2016-09-02 14:24 ` Steve Wise
@ 2016-09-02 17:15 ` Doug Ledford
0 siblings, 0 replies; 6+ messages in thread
From: Doug Ledford @ 2016-09-02 17:15 UTC (permalink / raw)
To: Steve Wise, linux-rdma-u79uwXL29TY76Z2rM5mHXA
Cc: 'Sagi Grimberg', 'Christoph Hellwig'
[-- Attachment #1.1: Type: text/plain, Size: 1280 bytes --]
On 9/2/2016 10:24 AM, Steve Wise wrote:
>>
>> On 8/29/2016 3:25 PM, Steve Wise wrote:
>>> Hey Doug, I was hoping these two could make 4.8-rc. Particularly patch
>> 2/2.
>>>
>>> Steve.
>>>
>>>
>>
>> Hi Steve,
>>
>> You've submitted these both individually and as part of a larger nvme
>> patchset. You should know that I generally ignore nvme patch sets (I
>> have enough stuff to review), I just happened to catch it this time.
>> Submitting these both ways is likely to cause problems down the road,
>> including getting me yelled at by Linus when the same patches come from
>> two different places. Please try to avoid that.
>>
>> Now, in regards to these two patches, how are you wanting to proceed?
>>
>
> Sorry about that. My screw up. I should have just CCed linux-rdma and you
> on the original nvme series as it progressed, instead of posting the
> iw_cxgb4 patches to linux-rdma separately. In v4 of the nvme series, which
> CCed you and linux-rdma, I propose that Sagi merge these through the
> nvme-fabrics. I haven't heard back from him on that yet. So I want to
> wait until we hear from him before proceeding.
Your call.
--
Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
GPG Key ID: 0E572FDD
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-09-02 17:15 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-26 15:27 [PATCH 1/2] iw_cxgb4: call dev_put() on l2t allocation failure Steve Wise
[not found] ` <c1b639ca7d71ee034e334b4400ff0bae3ba58c47.1472241953.git.swise-7bPotxP6k4+P2YhJcF5u+vpXobYPEAuW@public.gmane.org>
2016-08-26 15:28 ` [PATCH 2/2] iw_cxgb4: block module unload until all ep resources are released Steve Wise
2016-08-29 19:25 ` [PATCH 1/2] iw_cxgb4: call dev_put() on l2t allocation failure Steve Wise
2016-09-02 14:09 ` Doug Ledford
[not found] ` <05141088-7c92-daba-1e0b-da1bc5656a75-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-09-02 14:24 ` Steve Wise
2016-09-02 17:15 ` Doug Ledford
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox