Javed Hasan b2b0f16fa6 scsi: libfc: Avoid invoking response handler twice if ep is already completed
A race condition exists between the response handler getting called because
of exchange_mgr_reset() (which clears out all the active XIDs) and the
response we get via an interrupt.

Sequence of events:

	 rport ba0200: Port timeout, state PLOGI
	 rport ba0200: Port entered PLOGI state from PLOGI state
	 xid 1052: Exchange timer armed : 20000 msecs      xid timer armed here
	 rport ba0200: Received LOGO request while in state PLOGI
	 rport ba0200: Delete port
	 rport ba0200: work event 3
	 rport ba0200: lld callback ev 3
	 bnx2fc: rport_event_hdlr: event = 3, port_id = 0xba0200
	 bnx2fc: ba0200 - rport not created Yet!!
	 /* Here we reset any outstanding exchanges before
	 freeing rport using the exch_mgr_reset() */
	 xid 1052: Exchange timer canceled
	 /* Here we got two responses for one xid */
	 xid 1052: invoking resp(), esb 20000000 state 3
	 xid 1052: invoking resp(), esb 20000000 state 3
	 xid 1052: fc_rport_plogi_resp() : ep->resp_active 2
	 xid 1052: fc_rport_plogi_resp() : ep->resp_active 2

Skip the response if the exchange is already completed.

Link: https://lore.kernel.org/r/20201215194731.2326-1-jhasan@marvell.com
Signed-off-by: Javed Hasan <jhasan@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
2021-01-12 23:07:32 -05:00
..
2020-10-14 15:15:35 -07:00
2020-12-16 13:34:31 -08:00
2020-12-16 13:34:31 -08:00
2020-12-02 12:59:04 -05:00
2020-12-09 12:14:41 -05:00
2020-12-16 13:34:31 -08:00
2020-03-11 23:07:59 -04:00
2020-12-16 13:34:31 -08:00
2020-10-14 15:15:35 -07:00
2020-12-16 13:34:31 -08:00
2017-12-04 20:32:53 -05:00
2020-10-23 16:19:02 -07:00
2018-06-19 22:02:25 -04:00
2019-11-12 22:21:35 -05:00
2020-02-24 14:54:25 -05:00
2020-03-11 23:07:59 -04:00
2020-10-07 21:48:28 -04:00
2019-01-08 21:58:35 -05:00
2020-09-02 22:49:06 -04:00
2020-12-16 13:34:31 -08:00
2020-09-02 22:49:06 -04:00
2020-08-23 17:36:59 -05:00
2020-10-26 18:23:24 -04:00
2018-11-06 21:31:28 -05:00
2020-07-24 22:09:55 -04:00
2020-12-16 13:34:31 -08:00
2020-12-07 20:24:09 -05:00
2020-10-14 15:15:35 -07:00
2020-12-07 20:24:09 -05:00
2020-12-07 20:24:09 -05:00
2020-09-15 17:34:18 -04:00
2020-08-23 17:36:59 -05:00
2020-10-14 15:15:35 -07:00
2020-10-14 15:15:35 -07:00
2021-01-01 12:58:07 -08:00
2020-06-19 23:06:43 -04:00
2018-06-19 22:02:25 -04:00
2020-12-01 14:53:39 -07:00
2020-10-14 15:15:35 -07:00
2019-07-11 15:14:01 -07:00
2020-02-24 15:01:57 -05:00
2020-10-26 18:23:24 -04:00
2020-12-16 11:49:46 -08:00
2020-10-14 15:15:35 -07:00
2019-07-11 15:14:01 -07:00