Make the SCSI core set cmd->budget_token because there is code in the ATA core that uses this member variable directly. Prepare for skipping the SCSI budget map allocation if this map is not needed. Cc: Damien Le Moal Cc: Niklas Cassel Cc: John Garry Cc: Christoph Hellwig Signed-off-by: Bart Van Assche --- drivers/ata/libata-scsi.c | 1 + include/scsi/scsi_host.h | 3 +++ 2 files changed, 4 insertions(+) diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c index 026122bb6f2f..66f69116de60 100644 --- a/drivers/ata/libata-scsi.c +++ b/drivers/ata/libata-scsi.c @@ -4499,6 +4499,7 @@ int ata_scsi_add_hosts(struct ata_host *host, const struct scsi_host_template *s shost->max_lun = 1; shost->max_channel = 1; shost->max_cmd_len = 32; + shost->needs_budget_token = true; /* Schedule policy is determined by ->qc_defer() * callback and it needs to see every deferred qc. diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index e87cf7eadd26..2b3fc8dcbf0b 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h @@ -695,6 +695,9 @@ struct Scsi_Host { /* The transport requires the LUN bits NOT to be stored in CDB[1] */ unsigned no_scsi2_lun_in_cdb:1; + /* Whether the LLD uses cmd->budget_token */ + unsigned needs_budget_token:1; + /* * Optional work queue to be utilized by the transport */