mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-07-21 22:47:51 -04:00
Merge branch 7.2/scsi-queue into 7.2/scsi-fixes
Pull in outstanding commits from 7.2/scsi-queue. Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
This commit is contained in:
@@ -2627,7 +2627,7 @@ bfa_fcs_fdmi_get_hbaattr(struct bfa_fcs_lport_fdmi_s *fdmi,
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
static noinline_for_stack void
|
||||
bfa_fcs_fdmi_get_portattr(struct bfa_fcs_lport_fdmi_s *fdmi,
|
||||
struct bfa_fcs_fdmi_port_attr_s *port_attr)
|
||||
{
|
||||
|
||||
@@ -2224,14 +2224,6 @@ struct scsi_device *scsi_device_from_queue(struct request_queue *q)
|
||||
|
||||
return sdev;
|
||||
}
|
||||
/*
|
||||
* pktcdvd should have been integrated into the SCSI layers, but for historical
|
||||
* reasons like the old IDE driver it isn't. This export allows it to safely
|
||||
* probe if a given device is a SCSI one and only attach to that.
|
||||
*/
|
||||
#ifdef CONFIG_CDROM_PKTCDVD_MODULE
|
||||
EXPORT_SYMBOL_GPL(scsi_device_from_queue);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* scsi_block_requests - Utility function used by low-level drivers to prevent
|
||||
|
||||
@@ -102,6 +102,7 @@ void scsi_eh_done(struct scsi_cmnd *scmd);
|
||||
|
||||
/* scsi_lib.c */
|
||||
extern void scsi_device_unbusy(struct scsi_device *sdev, struct scsi_cmnd *cmd);
|
||||
extern struct scsi_device *scsi_device_from_queue(struct request_queue *q);
|
||||
extern void scsi_queue_insert(struct scsi_cmnd *cmd,
|
||||
enum scsi_qc_status reason);
|
||||
extern void scsi_io_completion(struct scsi_cmnd *, unsigned int);
|
||||
|
||||
@@ -611,6 +611,25 @@ static void scsiback_disconnect(struct vscsibk_info *info)
|
||||
xenbus_unmap_ring_vfree(info->dev, info->ring.sring);
|
||||
}
|
||||
|
||||
/*
|
||||
* Send the error response for a request that did not reach the target core
|
||||
* and return its tag. Free the tag before the response drops the v2p
|
||||
* reference that keeps the session alive, and snapshot what the response
|
||||
* needs since returning the tag can let the slot be reused.
|
||||
*/
|
||||
static void scsiback_resp_and_free(struct vscsibk_pend *pending_req,
|
||||
int32_t result)
|
||||
{
|
||||
struct vscsibk_info *info = pending_req->info;
|
||||
struct v2p_entry *v2p = pending_req->v2p;
|
||||
struct se_session *se_sess = v2p->tpg->tpg_nexus->tvn_se_sess;
|
||||
u16 rqid = pending_req->rqid;
|
||||
|
||||
target_free_tag(se_sess, &pending_req->se_cmd);
|
||||
scsiback_send_response(info, NULL, result, 0, rqid);
|
||||
kref_put(&v2p->kref, scsiback_free_translation_entry);
|
||||
}
|
||||
|
||||
static void scsiback_device_action(struct vscsibk_pend *pending_req,
|
||||
enum tcm_tmreq_table act, int tag)
|
||||
{
|
||||
@@ -639,7 +658,7 @@ static void scsiback_device_action(struct vscsibk_pend *pending_req,
|
||||
return;
|
||||
|
||||
err:
|
||||
scsiback_do_resp_with_sense(NULL, err, 0, pending_req);
|
||||
scsiback_resp_and_free(pending_req, err);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -792,9 +811,8 @@ static int scsiback_do_cmd_fn(struct vscsibk_info *info,
|
||||
case VSCSIIF_ACT_SCSI_CDB:
|
||||
if (scsiback_gnttab_data_map(&ring_req, pending_req)) {
|
||||
scsiback_fast_flush_area(pending_req);
|
||||
scsiback_do_resp_with_sense(NULL,
|
||||
DID_ERROR << 16, 0, pending_req);
|
||||
transport_generic_free_cmd(&pending_req->se_cmd, 0);
|
||||
scsiback_resp_and_free(pending_req,
|
||||
DID_ERROR << 16);
|
||||
} else {
|
||||
scsiback_cmd_exec(pending_req);
|
||||
}
|
||||
@@ -808,9 +826,7 @@ static int scsiback_do_cmd_fn(struct vscsibk_info *info,
|
||||
break;
|
||||
default:
|
||||
pr_err_ratelimited("invalid request\n");
|
||||
scsiback_do_resp_with_sense(NULL, DID_ERROR << 16, 0,
|
||||
pending_req);
|
||||
transport_generic_free_cmd(&pending_req->se_cmd, 0);
|
||||
scsiback_resp_and_free(pending_req, DID_ERROR << 16);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
@@ -408,7 +408,6 @@ void scsi_attach_vpd(struct scsi_device *sdev);
|
||||
void scsi_cdl_check(struct scsi_device *sdev);
|
||||
int scsi_cdl_enable(struct scsi_device *sdev, bool enable);
|
||||
|
||||
extern struct scsi_device *scsi_device_from_queue(struct request_queue *q);
|
||||
extern int __must_check scsi_device_get(struct scsi_device *);
|
||||
extern void scsi_device_put(struct scsi_device *);
|
||||
extern struct scsi_device *scsi_device_lookup(struct Scsi_Host *,
|
||||
|
||||
Reference in New Issue
Block a user