.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
---|
1 | 2 | /* |
---|
2 | 3 | * SCSI RDMA (SRP) transport class |
---|
3 | 4 | * |
---|
4 | 5 | * Copyright (C) 2007 FUJITA Tomonori <tomof@acm.org> |
---|
5 | | - * |
---|
6 | | - * This program is free software; you can redistribute it and/or |
---|
7 | | - * modify it under the terms of the GNU General Public License as |
---|
8 | | - * published by the Free Software Foundation, version 2 of the |
---|
9 | | - * License. |
---|
10 | | - * |
---|
11 | | - * This program is distributed in the hope that it will be useful, but |
---|
12 | | - * WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
13 | | - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
---|
14 | | - * General Public License for more details. |
---|
15 | | - * |
---|
16 | | - * You should have received a copy of the GNU General Public License |
---|
17 | | - * along with this program; if not, write to the Free Software |
---|
18 | | - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA |
---|
19 | | - * 02110-1301 USA |
---|
20 | 6 | */ |
---|
21 | 7 | #include <linux/init.h> |
---|
22 | 8 | #include <linux/module.h> |
---|
.. | .. |
---|
409 | 395 | } |
---|
410 | 396 | } |
---|
411 | 397 | |
---|
| 398 | +/* |
---|
| 399 | + * scsi_target_block() must have been called before this function is |
---|
| 400 | + * called to guarantee that no .queuecommand() calls are in progress. |
---|
| 401 | + */ |
---|
412 | 402 | static void __rport_fail_io_fast(struct srp_rport *rport) |
---|
413 | 403 | { |
---|
414 | 404 | struct Scsi_Host *shost = rport_to_shost(rport); |
---|
.. | .. |
---|
418 | 408 | |
---|
419 | 409 | if (srp_rport_set_state(rport, SRP_RPORT_FAIL_FAST)) |
---|
420 | 410 | return; |
---|
421 | | - /* |
---|
422 | | - * Call scsi_target_block() to wait for ongoing shost->queuecommand() |
---|
423 | | - * calls before invoking i->f->terminate_rport_io(). |
---|
424 | | - */ |
---|
425 | | - scsi_target_block(rport->dev.parent); |
---|
| 411 | + |
---|
426 | 412 | scsi_target_unblock(rport->dev.parent, SDEV_TRANSPORT_OFFLINE); |
---|
427 | 413 | |
---|
428 | 414 | /* Involve the LLD if possible to terminate all I/O on the rport. */ |
---|
.. | .. |
---|
591 | 577 | * failure timers if these had not yet been started. |
---|
592 | 578 | */ |
---|
593 | 579 | __rport_fail_io_fast(rport); |
---|
594 | | - scsi_target_unblock(&shost->shost_gendev, |
---|
595 | | - SDEV_TRANSPORT_OFFLINE); |
---|
596 | 580 | __srp_start_tl_fail_timers(rport); |
---|
597 | 581 | } else if (rport->state != SRP_RPORT_BLOCKED) { |
---|
598 | 582 | scsi_target_unblock(&shost->shost_gendev, |
---|