mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 09:36:22 +02:00
ata: libata: Pass ap parameter directly to functions in the issuing path
Context analysis cannot recognize that qc->ap == ap. Therefore, grow a struct ata_port parameter to the following functions: ata_qc_issue(), __ata_scsi_queuecmd(), and ata_scsi_translate() such that we will be able to enable context analysis in a follow-up commit. No functionality has been changed. Signed-off-by: Bart Van Assche <bvanassche@acm.org> Reviewed-by: Hannes Reinecke <hare@kernel.org> Signed-off-by: Niklas Cassel <cassel@kernel.org>
This commit is contained in:
parent
7725c45682
commit
b2412353ad
|
|
@ -1605,7 +1605,7 @@ unsigned int ata_exec_internal(struct ata_device *dev, struct ata_taskfile *tf,
|
|||
qc->private_data = &wait;
|
||||
qc->complete_fn = ata_qc_complete_internal;
|
||||
|
||||
ata_qc_issue(qc);
|
||||
ata_qc_issue(ap, qc);
|
||||
|
||||
spin_unlock_irqrestore(ap->lock, flags);
|
||||
|
||||
|
|
@ -5150,6 +5150,7 @@ EXPORT_SYMBOL_GPL(ata_qc_get_active);
|
|||
|
||||
/**
|
||||
* ata_qc_issue - issue taskfile to device
|
||||
* @ap: ATA port of interest
|
||||
* @qc: command to issue to device
|
||||
*
|
||||
* Prepare an ATA command to submission to device.
|
||||
|
|
@ -5160,9 +5161,8 @@ EXPORT_SYMBOL_GPL(ata_qc_get_active);
|
|||
* LOCKING:
|
||||
* spin_lock_irqsave(host lock)
|
||||
*/
|
||||
void ata_qc_issue(struct ata_queued_cmd *qc)
|
||||
void ata_qc_issue(struct ata_port *ap, struct ata_queued_cmd *qc)
|
||||
{
|
||||
struct ata_port *ap = qc->ap;
|
||||
struct ata_link *link = qc->dev->link;
|
||||
u8 prot = qc->tf.protocol;
|
||||
|
||||
|
|
|
|||
|
|
@ -1379,7 +1379,7 @@ EXPORT_SYMBOL_GPL(ata_sas_sdev_configure);
|
|||
int ata_sas_queuecmd(struct scsi_cmnd *cmd, struct ata_port *ap)
|
||||
{
|
||||
if (likely(ata_dev_enabled(ap->link.device)))
|
||||
return __ata_scsi_queuecmd(cmd, ap->link.device);
|
||||
return __ata_scsi_queuecmd(cmd, ap->link.device, ap);
|
||||
|
||||
cmd->result = (DID_BAD_TARGET << 16);
|
||||
scsi_done(cmd);
|
||||
|
|
|
|||
|
|
@ -1681,7 +1681,7 @@ void ata_scsi_deferred_qc_work(struct work_struct *work)
|
|||
if (qc && !ata_port_eh_scheduled(ap)) {
|
||||
WARN_ON_ONCE(ap->ops->qc_defer(qc));
|
||||
link->deferred_qc = NULL;
|
||||
ata_qc_issue(qc);
|
||||
ata_qc_issue(ap, qc);
|
||||
}
|
||||
|
||||
spin_unlock_irqrestore(ap->lock, flags);
|
||||
|
|
@ -1812,7 +1812,7 @@ static int ata_scsi_qc_issue(struct ata_port *ap, struct ata_queued_cmd *qc)
|
|||
}
|
||||
|
||||
issue_qc:
|
||||
ata_qc_issue(qc);
|
||||
ata_qc_issue(ap, qc);
|
||||
return 0;
|
||||
|
||||
defer_qc:
|
||||
|
|
@ -1840,6 +1840,7 @@ static int ata_scsi_qc_issue(struct ata_port *ap, struct ata_queued_cmd *qc)
|
|||
* @dev: ATA device to which the command is addressed
|
||||
* @cmd: SCSI command to execute
|
||||
* @xlat_func: Actor which translates @cmd to an ATA taskfile
|
||||
* @ap: ATA port of interest
|
||||
*
|
||||
* Our ->queuecommand() function has decided that the SCSI
|
||||
* command issued can be directly translated into an ATA
|
||||
|
|
@ -1862,9 +1863,8 @@ static int ata_scsi_qc_issue(struct ata_port *ap, struct ata_queued_cmd *qc)
|
|||
* command needs to be deferred.
|
||||
*/
|
||||
static int ata_scsi_translate(struct ata_device *dev, struct scsi_cmnd *cmd,
|
||||
ata_xlat_func_t xlat_func)
|
||||
ata_xlat_func_t xlat_func, struct ata_port *ap)
|
||||
{
|
||||
struct ata_port *ap = dev->link->ap;
|
||||
struct ata_queued_cmd *qc;
|
||||
|
||||
lockdep_assert_held(ap->lock);
|
||||
|
|
@ -4521,9 +4521,9 @@ static void ata_scsi_simulate(struct ata_device *dev, struct scsi_cmnd *cmd)
|
|||
}
|
||||
|
||||
enum scsi_qc_status __ata_scsi_queuecmd(struct scsi_cmnd *scmd,
|
||||
struct ata_device *dev)
|
||||
struct ata_device *dev,
|
||||
struct ata_port *ap)
|
||||
{
|
||||
struct ata_port *ap = dev->link->ap;
|
||||
u8 scsi_op = scmd->cmnd[0];
|
||||
ata_xlat_func_t xlat_func;
|
||||
|
||||
|
|
@ -4564,7 +4564,7 @@ enum scsi_qc_status __ata_scsi_queuecmd(struct scsi_cmnd *scmd,
|
|||
}
|
||||
|
||||
if (xlat_func)
|
||||
return ata_scsi_translate(dev, scmd, xlat_func);
|
||||
return ata_scsi_translate(dev, scmd, xlat_func, ap);
|
||||
|
||||
ata_scsi_simulate(dev, scmd);
|
||||
|
||||
|
|
@ -4610,7 +4610,7 @@ enum scsi_qc_status ata_scsi_queuecmd(struct Scsi_Host *shost,
|
|||
|
||||
dev = ata_scsi_find_dev(ap, scsidev);
|
||||
if (likely(dev))
|
||||
rc = __ata_scsi_queuecmd(cmd, dev);
|
||||
rc = __ata_scsi_queuecmd(cmd, dev, ap);
|
||||
else {
|
||||
cmd->result = (DID_BAD_TARGET << 16);
|
||||
scsi_done(cmd);
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ extern int ata_down_xfermask_limit(struct ata_device *dev, unsigned int sel);
|
|||
extern unsigned int ata_dev_set_feature(struct ata_device *dev,
|
||||
u8 subcmd, u8 action);
|
||||
extern void ata_qc_free(struct ata_queued_cmd *qc);
|
||||
extern void ata_qc_issue(struct ata_queued_cmd *qc);
|
||||
extern void ata_qc_issue(struct ata_port *ap, struct ata_queued_cmd *qc);
|
||||
extern void __ata_qc_complete(struct ata_queued_cmd *qc);
|
||||
extern int atapi_check_dma(struct ata_queued_cmd *qc);
|
||||
extern void swap_buf_le16(u16 *buf, unsigned int buf_words);
|
||||
|
|
@ -166,7 +166,8 @@ void ata_scsi_sdev_config(struct scsi_device *sdev);
|
|||
int ata_scsi_dev_config(struct scsi_device *sdev, struct queue_limits *lim,
|
||||
struct ata_device *dev);
|
||||
enum scsi_qc_status __ata_scsi_queuecmd(struct scsi_cmnd *scmd,
|
||||
struct ata_device *dev);
|
||||
struct ata_device *dev,
|
||||
struct ata_port *ap);
|
||||
void ata_scsi_deferred_qc_work(struct work_struct *work);
|
||||
void ata_scsi_requeue_deferred_qc(struct ata_port *ap);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user