From: Jason Gunthorpe <jgg@ziepe•ca>
To: duoming@zju•edu.cn
Cc: Dan Carpenter <dan.carpenter@oracle•com>,
linux-kernel@vger•kernel.org, chris@zankel•net,
jcmvbkbc@gmail•com, mustafa.ismail@intel•com,
shiraz.saleem@intel•com, wg@grandegger•com, mkl@pengutronix•de,
davem@davemloft•net, kuba@kernel•org, pabeni@redhat•com,
jes@trained-monkey•org, gregkh@linuxfoundation•org,
jirislaby@kernel•org, alexander.deucher@amd•com,
linux-xtensa@linux-xtensa•org, linux-rdma@vger•kernel.org,
linux-can@vger•kernel.org, netdev@vger•kernel.org,
linux-hippi@sunsite•dk, linux-staging@lists•linux.dev,
linux-serial@vger•kernel.org, linux-usb@vger•kernel.org
Subject: Re: Re: [PATCH 09/11] drivers: infiniband: hw: Fix deadlock in irdma_cleanup_cm_core()
Date: Thu, 7 Apr 2022 11:23:55 -0300 [thread overview]
Message-ID: <20220407142355.GV64706@ziepe.ca> (raw)
In-Reply-To: <1be0c02d.3f701.1800416ef60.Coremail.duoming@zju.edu.cn>
On Thu, Apr 07, 2022 at 08:54:13PM +0800, duoming@zju•edu.cn wrote:
> > > diff --git a/drivers/infiniband/hw/irdma/cm.c b/drivers/infiniband/hw/irdma/cm.c
> > > index dedb3b7edd8..019dd8bfe08 100644
> > > +++ b/drivers/infiniband/hw/irdma/cm.c
> > > @@ -3252,8 +3252,11 @@ void irdma_cleanup_cm_core(struct irdma_cm_core *cm_core)
> > > return;
> > >
> > > spin_lock_irqsave(&cm_core->ht_lock, flags);
> > > - if (timer_pending(&cm_core->tcp_timer))
> > > + if (timer_pending(&cm_core->tcp_timer)) {
> > > + spin_unlock_irqrestore(&cm_core->ht_lock, flags);
> > > del_timer_sync(&cm_core->tcp_timer);
> > > + spin_lock_irqsave(&cm_core->ht_lock, flags);
> > > + }
> > > spin_unlock_irqrestore(&cm_core->ht_lock, flags);
> >
> > This lock doesn't seem to be protecting anything. Also do we need to
> > check timer_pending()? I think the del_timer_sync() function will just
> > return directly if there isn't a pending lock?
>
> Thanks a lot for your advice, I will remove the timer_pending() and the
> redundant lock.
Does del_timer_sync work with a self-rescheduling timer like this has?
Jason
next prev parent reply other threads:[~2022-04-07 14:25 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-07 6:33 [PATCH 00/11] Fix deadlocks caused by del_timer_sync() Duoming Zhou
2022-04-07 6:33 ` [PATCH 01/11] drivers: tty: serial: Fix deadlock in sa1100_set_termios() Duoming Zhou
2022-04-07 7:02 ` Jiri Slaby
2022-04-07 14:03 ` duoming
2022-04-07 6:33 ` [PATCH 02/11] drivers: usb: host: Fix deadlock in oxu_bus_suspend() Duoming Zhou
2022-04-07 8:01 ` Oliver Neukum
2022-04-07 12:02 ` duoming
2022-04-07 6:33 ` [PATCH 03/11] drivers: staging: rtl8192u: Fix deadlock in ieee80211_beacons_stop() Duoming Zhou
2022-04-07 6:33 ` [PATCH 04/11] drivers: staging: rtl8723bs: Fix deadlock in rtw_surveydone_event_callback() Duoming Zhou
2022-04-07 6:36 ` [PATCH 05/11] drivers: staging: rtl8192e: Fix deadlock in rtllib_beacons_stop() Duoming Zhou
2022-04-07 6:36 ` [PATCH 06/11] drivers: staging: rtl8192e: Fix deadlock in rtw_joinbss_event_prehandle() Duoming Zhou
2022-04-07 6:36 ` [PATCH 07/11] drivers: net: hippi: Fix deadlock in rr_close() Duoming Zhou
2022-04-07 6:37 ` [PATCH 08/11] drivers: net: can: Fix deadlock in grcan_close() Duoming Zhou
2022-04-07 6:37 ` [PATCH 09/11] drivers: infiniband: hw: Fix deadlock in irdma_cleanup_cm_core() Duoming Zhou
2022-04-07 11:24 ` Dan Carpenter
2022-04-07 12:54 ` duoming
2022-04-07 14:23 ` Jason Gunthorpe [this message]
2022-04-07 14:38 ` duoming
2022-04-07 17:35 ` Saleem, Shiraz
2022-04-07 15:24 ` Dan Carpenter
2022-04-07 17:36 ` Saleem, Shiraz
2022-04-08 0:35 ` duoming
2022-04-08 2:21 ` Saleem, Shiraz
2022-04-08 2:52 ` duoming
2022-04-07 6:37 ` [PATCH 10/11] arch: xtensa: platforms: Fix deadlock in iss_net_close() Duoming Zhou
2022-04-07 6:37 ` [PATCH 11/11] arch: xtensa: platforms: Fix deadlock in rs_close() Duoming Zhou
2022-04-07 7:21 ` Max Filippov
2022-04-07 11:05 ` duoming
2022-04-07 9:42 ` Sergey Shtylyov
2022-04-07 11:12 ` duoming
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=20220407142355.GV64706@ziepe.ca \
--to=jgg@ziepe$(echo .)ca \
--cc=alexander.deucher@amd$(echo .)com \
--cc=chris@zankel$(echo .)net \
--cc=dan.carpenter@oracle$(echo .)com \
--cc=davem@davemloft$(echo .)net \
--cc=duoming@zju$(echo .)edu.cn \
--cc=gregkh@linuxfoundation$(echo .)org \
--cc=jcmvbkbc@gmail$(echo .)com \
--cc=jes@trained-monkey$(echo .)org \
--cc=jirislaby@kernel$(echo .)org \
--cc=kuba@kernel$(echo .)org \
--cc=linux-can@vger$(echo .)kernel.org \
--cc=linux-hippi@sunsite$(echo .)dk \
--cc=linux-kernel@vger$(echo .)kernel.org \
--cc=linux-rdma@vger$(echo .)kernel.org \
--cc=linux-serial@vger$(echo .)kernel.org \
--cc=linux-staging@lists$(echo .)linux.dev \
--cc=linux-usb@vger$(echo .)kernel.org \
--cc=linux-xtensa@linux-xtensa$(echo .)org \
--cc=mkl@pengutronix$(echo .)de \
--cc=mustafa.ismail@intel$(echo .)com \
--cc=netdev@vger$(echo .)kernel.org \
--cc=pabeni@redhat$(echo .)com \
--cc=shiraz.saleem@intel$(echo .)com \
--cc=wg@grandegger$(echo .)com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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