* linux-next: manual merge of the scsi-mkp tree with the origin tree
@ 2026-09-17 19:39 Mark Brown
2026-09-18 5:12 ` Niklas Cassel
0 siblings, 1 reply; 9+ messages in thread
From: Mark Brown @ 2026-09-17 19:39 UTC (permalink / raw)
To: Martin K. Petersen
Cc: Damien Le Moal, Linux Kernel Mailing List,
Linux Next Mailing List, Martin K. Petersen, Niklas Cassel
[-- Attachment #1: Type: text/plain, Size: 22127 bytes --]
Hi all,
Today's linux-next merge of the scsi-mkp tree got a conflict in:
drivers/ata/libata-scsi.c
between commit:
6d81700ad7c48 ("ata: libata-scsi: do not raise UA for storage element depopulation and restoration")
from the origin tree and commit:
c44f095a9d176 ("scsi: ata: libata: Use combined sense codes")
from the scsi-mkp tree.
I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging. You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.
diff --combined drivers/ata/libata-scsi.c
index db43fd7b64182,66fef7ffbf1b1..0000000000000
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@@ -190,28 -190,25 +190,25 @@@ DEVICE_ATTR(unload_heads, S_IRUGO | S_I
ata_scsi_park_show, ata_scsi_park_store);
EXPORT_SYMBOL_GPL(dev_attr_unload_heads);
- bool ata_scsi_sense_is_valid(u8 sk, u8 asc, u8 ascq)
+ bool ata_scsi_sense_is_valid(u8 sense_key, u16 sense_code)
{
- /*
- * If sk == NO_SENSE, and asc + ascq == NO ADDITIONAL SENSE INFORMATION,
- * then there is no sense data to add.
- */
- if (sk == 0 && asc == 0 && ascq == 0)
+ if (sense_key == NO_SENSE &&
+ sense_code == NO_ADDITIONAL_SENSE_INFORMATION)
return false;
/* If sk > COMPLETED, sense data is bogus. */
- if (sk > COMPLETED)
+ if (sense_key > COMPLETED)
return false;
return true;
}
void ata_scsi_set_sense(struct ata_device *dev, struct scsi_cmnd *cmd,
- u8 sk, u8 asc, u8 ascq)
+ u8 sk, u16 code)
{
bool d_sense = (dev->flags & ATA_DFLAG_D_SENSE);
- scsi_build_sense(cmd, d_sense, sk, asc, ascq);
+ scsi_set_sense(cmd, d_sense, sk, code);
}
static void ata_scsi_set_sense_information(struct ata_queued_cmd *qc)
@@@ -316,8 -313,7 +313,7 @@@ static void ata_scsi_set_passthru_sense
static void ata_scsi_set_invalid_field(struct ata_device *dev,
struct scsi_cmnd *cmd, u16 field, u8 bit)
{
- ata_scsi_set_sense(dev, cmd, ILLEGAL_REQUEST, 0x24, 0x0);
- /* "Invalid field in CDB" */
+ ata_scsi_set_sense(dev, cmd, ILLEGAL_REQUEST, INVALID_FIELD_IN_CDB);
scsi_set_sense_field_pointer(cmd->sense_buffer, SCSI_SENSE_BUFFERSIZE,
field, bit, 1);
}
@@@ -325,8 -321,8 +321,8 @@@
static void ata_scsi_set_invalid_parameter(struct ata_device *dev,
struct scsi_cmnd *cmd, u16 field)
{
- /* "Invalid field in parameter list" */
- ata_scsi_set_sense(dev, cmd, ILLEGAL_REQUEST, 0x26, 0x0);
+ ata_scsi_set_sense(dev, cmd, ILLEGAL_REQUEST,
+ INVALID_FIELD_IN_PARAMETER_LIST);
scsi_set_sense_field_pointer(cmd->sense_buffer, SCSI_SENSE_BUFFERSIZE,
field, 0xff, 0);
}
@@@ -525,7 -521,8 +521,8 @@@ int ata_cmd_ioctl(struct scsi_device *s
* check condition even if no error. Filter that. */
if (scsi_status_is_check_condition(cmd_result)) {
if (sshdr.sense_key == RECOVERED_ERROR &&
- sshdr.asc == 0 && sshdr.ascq == 0x1d)
+ sshdr.sense_code ==
+ ATA_PASS_THROUGH_INFORMATION_AVAILABLE)
cmd_result &= ~SAM_STAT_CHECK_CONDITION;
}
@@@ -613,7 -610,8 +610,8 @@@ int ata_task_ioctl(struct scsi_device *
* check condition even if no error. Filter that. */
if (cmd_result & SAM_STAT_CHECK_CONDITION) {
if (sshdr.sense_key == RECOVERED_ERROR &&
- sshdr.asc == 0 && sshdr.ascq == 0x1d)
+ sshdr.sense_code ==
+ ATA_PASS_THROUGH_INFORMATION_AVAILABLE)
cmd_result &= ~SAM_STAT_CHECK_CONDITION;
}
@@@ -792,79 -790,143 +790,143 @@@ static void ata_qc_set_pc_nbytes(struc
qc->nbytes = scsi_bufflen(scmd) + qc->extrabytes;
}
+ struct ata_err_sense {
+ u8 err_mask;
+ u8 sense_key;
+ u16 sense_code;
+ };
+
/**
* ata_to_sense_error - convert ATA error to SCSI error
* @drv_stat: value contained in ATA status register
* @drv_err: value contained in ATA error register
* @sk: the sense key we'll fill out
- * @asc: the additional sense code we'll fill out
- * @ascq: the additional sense code qualifier we'll fill out
+ * @scode: the additional sense code and its qualifier we'll fill out
*
* Converts an ATA error into a SCSI error. Fill out pointers to
- * SK, ASC, and ASCQ bytes for later use in fixed or descriptor
+ * the sense key and sense code for later use in fixed or descriptor
* format sense blocks.
*
* LOCKING:
* spin_lock_irqsave(host lock)
*/
- static void ata_to_sense_error(u8 drv_stat, u8 drv_err, u8 *sk, u8 *asc,
- u8 *ascq)
+ static void ata_to_sense_error(u8 drv_stat, u8 drv_err, u8 *sk, u16 *scode)
{
int i;
/* Based on the 3ware driver translation table */
- static const unsigned char sense_table[][4] = {
- /* BBD|ECC|ID|MAR */
- {0xd1, ABORTED_COMMAND, 0x00, 0x00},
- // Device busy Aborted command
- /* BBD|ECC|ID */
- {0xd0, ABORTED_COMMAND, 0x00, 0x00},
- // Device busy Aborted command
- /* ECC|MC|MARK */
- {0x61, HARDWARE_ERROR, 0x00, 0x00},
- // Device fault Hardware error
- /* ICRC|ABRT */ /* NB: ICRC & !ABRT is BBD */
- {0x84, ABORTED_COMMAND, 0x47, 0x00},
- // Data CRC error SCSI parity error
- /* MC|ID|ABRT|TRK0|MARK */
- {0x37, NOT_READY, 0x04, 0x00},
- // Unit offline Not ready
- /* MCR|MARK */
- {0x09, NOT_READY, 0x04, 0x00},
- // Unrecovered disk error Not ready
- /* Bad address mark */
- {0x01, MEDIUM_ERROR, 0x13, 0x00},
- // Address mark not found for data field
- /* TRK0 - Track 0 not found */
- {0x02, HARDWARE_ERROR, 0x00, 0x00},
- // Hardware error
- /* Abort: 0x04 is not translated here, see below */
- /* Media change request */
- {0x08, NOT_READY, 0x04, 0x00},
- // FIXME: faking offline
- /* SRV/IDNF - ID not found */
- {0x10, ILLEGAL_REQUEST, 0x21, 0x00},
- // Logical address out of range
- /* MC - Media Changed */
- {0x20, UNIT_ATTENTION, 0x28, 0x00},
- // Not ready to ready change, medium may have changed
- /* ECC - Uncorrectable ECC error */
- {0x40, MEDIUM_ERROR, 0x11, 0x04},
- // Unrecovered read error
- /* BBD - block marked bad */
- {0x80, MEDIUM_ERROR, 0x11, 0x04},
- // Block marked bad Medium error, unrecovered read error
- {0xFF, 0xFF, 0xFF, 0xFF}, // END mark
+ static const struct ata_err_sense sense_table[] = {
+ {
+ /* BBD|ECC|ID|MAR - Device busy */
+ 0xd1,
+ ABORTED_COMMAND,
+ NO_ADDITIONAL_SENSE_INFORMATION
+ },
+ {
+ /* BBD|ECC|ID - Device busy */
+ 0xd0,
+ ABORTED_COMMAND,
+ NO_ADDITIONAL_SENSE_INFORMATION
+ },
+ {
+ /* ECC|MC|MARK - Device fault */
+ 0x61,
+ HARDWARE_ERROR,
+ NO_ADDITIONAL_SENSE_INFORMATION
+ },
+ {
+ /* ICRC|ABRT - Data CRC error */
+ /* NB: ICRC & !ABRT is BBD */
+ 0x84,
+ ABORTED_COMMAND,
+ SCSI_PARITY_ERROR
+ },
+ {
+ /* MC|ID|ABRT|TRK0|MARK - Unit offline */
+ 0x37,
+ NOT_READY,
+ LU_NOT_READY
+ },
+ {
+ /* MCR|MARK - Unrecovered disk error */
+ 0x09,
+ NOT_READY,
+ LU_NOT_READY
+ },
+ {
+ /* Bad address mark */
+ 0x01,
+ MEDIUM_ERROR,
+ ADDRESS_MARK_NOT_FOUND_FOR_DATA_FIELD
+ },
+ {
+ /* TRK0 - Track 0 not found */
+ 0x02,
+ HARDWARE_ERROR,
+ NO_ADDITIONAL_SENSE_INFORMATION
+ },
+ {
+ /* Abort: 0x04 is not translated here, see below */
+ /* Media change request */
+ 0x08,
+ NOT_READY,
+ LU_NOT_READY
+ },
+ {
+ /* SRV/IDNF - ID not found */
+ 0x10,
+ ILLEGAL_REQUEST,
+ LOGICAL_BLOCK_ADDRESS_OUT_OF_RANGE
+ },
+ {
+ /* MC - Media Changed */
+ 0x20,
+ UNIT_ATTENTION,
+ NOT_READY_TO_READY_CHANGE_MEDIUM_MAY_HAVE_CHANGED
+ },
+ {
+ /* ECC - Uncorrectable ECC error */
+ 0x40,
+ MEDIUM_ERROR,
+ UNRECOVERED_READ_ERROR_AUTO_REALLOCATE_FAILED
+ },
+ {
+ /* BBD - block marked bad */
+ 0x80,
+ MEDIUM_ERROR,
+ UNRECOVERED_READ_ERROR_AUTO_REALLOCATE_FAILED
+ },
+ {
+ /* END mark */
+ 0xFF, 0xFF, 0xFFFF
+ },
};
- static const unsigned char stat_table[][4] = {
- /* Busy: must be first because BUSY means no other bits valid */
- { ATA_BUSY, ABORTED_COMMAND, 0x00, 0x00 },
- /* Device fault: INTERNAL TARGET FAILURE */
- { ATA_DF, HARDWARE_ERROR, 0x44, 0x00 },
- /* Corrected data error */
- { ATA_CORR, RECOVERED_ERROR, 0x00, 0x00 },
-
- { 0xFF, 0xFF, 0xFF, 0xFF }, /* END mark */
+ static const struct ata_err_sense stat_table[] = {
+ {
+ /*
+ * Busy: must be first because BUSY means no other bits
+ * valid.
+ */
+ ATA_BUSY,
+ ABORTED_COMMAND,
+ NO_ADDITIONAL_SENSE_INFORMATION
+ },
+ {
+ /* Device fault */
+ ATA_DF,
+ HARDWARE_ERROR,
+ INTERNAL_TARGET_FAILURE
+ },
+ {
+ /* Corrected data error */
+ ATA_CORR,
+ RECOVERED_ERROR,
+ NO_ADDITIONAL_SENSE_INFORMATION
+ },
+ {
+ /* END mark */
+ 0xFF, 0xFF, 0xFFFF
+ },
};
/*
@@@ -876,13 -938,12 +938,12 @@@
if (drv_err) {
/* Look for drv_err */
- for (i = 0; sense_table[i][0] != 0xFF; i++) {
+ for (i = 0; sense_table[i].err_mask != 0xFF; i++) {
/* Look for best matches first */
- if ((sense_table[i][0] & drv_err) ==
- sense_table[i][0]) {
- *sk = sense_table[i][1];
- *asc = sense_table[i][2];
- *ascq = sense_table[i][3];
+ if ((sense_table[i].err_mask & drv_err) ==
+ sense_table[i].err_mask) {
+ *sk = sense_table[i].sense_key;
+ *scode = sense_table[i].sense_code;
return;
}
}
@@@ -893,11 -954,10 +954,10 @@@
* has only the ABRT bit set, we decode drv_stat. ABRT by itself
* is not descriptive enough.
*/
- for (i = 0; stat_table[i][0] != 0xFF; i++) {
- if (stat_table[i][0] & drv_stat) {
- *sk = stat_table[i][1];
- *asc = stat_table[i][2];
- *ascq = stat_table[i][3];
+ for (i = 0; stat_table[i].err_mask != 0xFF; i++) {
+ if (stat_table[i].err_mask & drv_stat) {
+ *sk = stat_table[i].sense_key;
+ *scode = stat_table[i].sense_code;
return;
}
}
@@@ -907,8 -967,7 +967,7 @@@
* that won't cause people to do things like return a disk wrongly.
*/
*sk = ABORTED_COMMAND;
- *asc = 0x00;
- *ascq = 0x00;
+ *scode = NO_ADDITIONAL_SENSE_INFORMATION;
}
/*
@@@ -931,40 -990,41 +990,41 @@@ static void ata_gen_passthru_sense(stru
struct ata_device *dev = qc->dev;
struct scsi_cmnd *cmd = qc->scsicmd;
struct ata_taskfile *tf = &qc->result_tf;
- u8 sense_key, asc, ascq;
+ u16 sense_code;
+ u8 sense_key;
if (!(qc->flags & ATA_QCFLAG_RTF_FILLED)) {
ata_dev_dbg(dev,
"missing result TF: can't generate ATA PT sense data\n");
if (qc->err_mask)
- ata_scsi_set_sense(dev, cmd, ABORTED_COMMAND, 0, 0);
+ ata_scsi_set_sense(dev, cmd, ABORTED_COMMAND,
+ NO_ADDITIONAL_SENSE_INFORMATION);
return;
}
/*
- * Use ata_to_sense_error() to map status register bits
- * onto sense key, asc & ascq.
+ * Use ata_to_sense_error() to map status register bits onto sense key
+ * and sense code.
*/
if (qc->err_mask ||
tf->status & (ATA_BUSY | ATA_DF | ATA_ERR | ATA_DRQ)) {
ata_to_sense_error(tf->status, tf->error,
- &sense_key, &asc, &ascq);
- ata_scsi_set_sense(qc->dev, cmd, sense_key, asc, ascq);
- } else {
- /*
- * ATA PASS-THROUGH INFORMATION AVAILABLE
- *
- * Note: we are supposed to call ata_scsi_set_sense(), which
- * respects the D_SENSE bit, instead of unconditionally
- * generating the sense data in descriptor format. However,
- * because hdparm, hddtemp, and udisks incorrectly assume sense
- * data in descriptor format, without even looking at the
- * RESPONSE CODE field in the returned sense data (to see which
- * format the returned sense data is in), we are stuck with
- * being bug compatible with older kernels.
- */
- scsi_build_sense(cmd, 1, RECOVERED_ERROR, 0, 0x1D);
+ &sense_key, &sense_code);
+ ata_scsi_set_sense(qc->dev, cmd, sense_key, sense_code);
+ return;
}
+
+ /*
+ * Note: we are supposed to call ata_scsi_set_sense(), which respects
+ * the D_SENSE bit, instead of unconditionally generating the sense data
+ * in descriptor format. However, because hdparm, hddtemp, and udisks
+ * incorrectly assume sense data in descriptor format, without even
+ * looking at the RESPONSE CODE field in the returned sense data (to see
+ * which format the returned sense data is in), we are stuck with being
+ * bug compatible with older kernels.
+ */
+ scsi_set_sense(cmd, 1, RECOVERED_ERROR,
+ ATA_PASS_THROUGH_INFORMATION_AVAILABLE);
}
/**
@@@ -981,19 -1041,18 +1041,18 @@@ static void ata_gen_ata_sense(struct at
struct ata_device *dev = qc->dev;
struct scsi_cmnd *cmd = qc->scsicmd;
struct ata_taskfile *tf = &qc->result_tf;
- u8 sense_key, asc, ascq;
if (ata_dev_disabled(dev)) {
/* Device disabled after error recovery */
- /* LOGICAL UNIT NOT READY, HARD RESET REQUIRED */
- ata_scsi_set_sense(dev, cmd, NOT_READY, 0x04, 0x21);
+ ata_scsi_set_sense(dev, cmd, NOT_READY,
+ LU_NOT_READY_HARD_RESET_REQUIRED);
return;
}
if (ata_id_is_locked(dev->id)) {
/* Security locked */
- /* LOGICAL UNIT ACCESS NOT AUTHORIZED */
- ata_scsi_set_sense(dev, cmd, DATA_PROTECT, 0x74, 0x71);
+ ata_scsi_set_sense(dev, cmd, DATA_PROTECT,
+ LU_ACCESS_NOT_AUTHORIZED);
return;
}
@@@ -1008,9 -1067,12 +1067,12 @@@
*/
if (qc->err_mask ||
tf->status & (ATA_BUSY | ATA_DF | ATA_ERR | ATA_DRQ)) {
+ u16 sense_code;
+ u8 sense_key;
+
ata_to_sense_error(tf->status, tf->error,
- &sense_key, &asc, &ascq);
- ata_scsi_set_sense(dev, cmd, sense_key, asc, ascq);
+ &sense_key, &sense_code);
+ ata_scsi_set_sense(dev, cmd, sense_key, sense_code);
return;
}
@@@ -1019,7 -1081,8 +1081,8 @@@
"Could not decode error 0x%x, status 0x%x (err_mask=0x%x)\n",
tf->error, tf->status, qc->err_mask);
aborted:
- ata_scsi_set_sense(dev, cmd, ABORTED_COMMAND, 0, 0);
+ ata_scsi_set_sense(dev, cmd, ABORTED_COMMAND,
+ NO_ADDITIONAL_SENSE_INFORMATION);
}
void ata_scsi_sdev_config(struct scsi_device *sdev)
@@@ -1273,7 -1336,8 +1336,8 @@@ static unsigned int ata_scsi_start_stop
/* Ignore IMMED bit (cdb[1] & 0x1), violates sat-r05 */
if (!ata_dev_power_init_tf(qc->dev, &qc->tf, cdb[4] & 0x1)) {
- ata_scsi_set_sense(qc->dev, scmd, ABORTED_COMMAND, 0, 0);
+ ata_scsi_set_sense(qc->dev, scmd, ABORTED_COMMAND,
+ NO_ADDITIONAL_SENSE_INFORMATION);
return 1;
}
@@@ -1501,8 -1565,8 +1565,8 @@@ invalid_fld
return 1;
out_of_range:
- ata_scsi_set_sense(qc->dev, scmd, ILLEGAL_REQUEST, 0x21, 0x0);
- /* "Logical Block Address out of range" */
+ ata_scsi_set_sense(qc->dev, scmd, ILLEGAL_REQUEST,
+ LOGICAL_BLOCK_ADDRESS_OUT_OF_RANGE);
return 1;
nothing_to_do:
@@@ -1638,8 -1702,8 +1702,8 @@@ invalid_fld
return 1;
out_of_range:
- ata_scsi_set_sense(qc->dev, scmd, ILLEGAL_REQUEST, 0x21, 0x0);
- /* "Logical Block Address out of range" */
+ ata_scsi_set_sense(qc->dev, scmd, ILLEGAL_REQUEST,
+ LOGICAL_BLOCK_ADDRESS_OUT_OF_RANGE);
return 1;
nothing_to_do:
@@@ -2015,7 -2079,8 +2079,8 @@@ static void ata_scsi_rbuf_fill(struct a
len = actor(dev, cmd, ata_scsi_rbuf);
if (len) {
if (WARN_ON(len > ATA_SCSI_RBUF_SIZE)) {
- ata_scsi_set_sense(dev, cmd, ABORTED_COMMAND, 0, 0);
+ ata_scsi_set_sense(dev, cmd, ABORTED_COMMAND,
+ NO_ADDITIONAL_SENSE_INFORMATION);
spin_unlock_irqrestore(&ata_scsi_rbuf_lock, flags);
return;
}
@@@ -2894,8 -2959,8 +2959,8 @@@ invalid_fld
return 0;
saving_not_supp:
- ata_scsi_set_sense(dev, cmd, ILLEGAL_REQUEST, 0x39, 0x0);
- /* "Saving parameters not supported" */
+ ata_scsi_set_sense(dev, cmd, ILLEGAL_REQUEST,
+ SAVING_PARAMETERS_NOT_SUPPORTED);
return 0;
}
@@@ -3732,12 -3797,12 +3797,12 @@@ invalid_fld
ata_scsi_set_invalid_field(dev, scmd, fp, bp);
return 1;
invalid_param_len:
- /* "Parameter list length error" */
- ata_scsi_set_sense(dev, scmd, ILLEGAL_REQUEST, 0x1a, 0x0);
+ ata_scsi_set_sense(dev, scmd, ILLEGAL_REQUEST,
+ PARAMETER_LIST_LENGTH_ERROR);
return 1;
invalid_opcode:
- /* "Invalid command operation code" */
- ata_scsi_set_sense(dev, scmd, ILLEGAL_REQUEST, 0x20, 0x0);
+ ata_scsi_set_sense(dev, scmd, ILLEGAL_REQUEST,
+ INVALID_COMMAND_OP_CODE);
return 1;
}
@@@ -4199,8 -4264,8 +4264,8 @@@ invalid_fld
return 1;
invalid_param_len:
- /* "Parameter list length error" */
- ata_scsi_set_sense(qc->dev, scmd, ILLEGAL_REQUEST, 0x1a, 0x0);
+ ata_scsi_set_sense(qc->dev, scmd, ILLEGAL_REQUEST,
+ PARAMETER_LIST_LENGTH_ERROR);
return 1;
}
@@@ -4277,8 -4342,8 +4342,8 @@@ static unsigned int ata_scsi_zbc_out_xl
ata_scsi_set_invalid_field(qc->dev, scmd, fp, 0xff);
return 1;
invalid_param_len:
- /* "Parameter list length error" */
- ata_scsi_set_sense(qc->dev, scmd, ILLEGAL_REQUEST, 0x1a, 0x0);
+ ata_scsi_set_sense(qc->dev, scmd, ILLEGAL_REQUEST,
+ PARAMETER_LIST_LENGTH_ERROR);
return 1;
}
@@@ -4629,8 -4694,8 +4694,8 @@@ static unsigned int ata_scsi_mode_selec
return 1;
invalid_param_len:
- /* "Parameter list length error" */
- ata_scsi_set_sense(qc->dev, scmd, ILLEGAL_REQUEST, 0x1a, 0x0);
+ ata_scsi_set_sense(qc->dev, scmd, ILLEGAL_REQUEST,
+ PARAMETER_LIST_LENGTH_ERROR);
return 1;
skip:
@@@ -4789,7 -4854,8 +4854,8 @@@ ata_scsi_get_phys_element_status_xlat(s
/* ATA_CMD_GET_PHYS_ELEMENT_STATUS is a DMA command. */
if (!(dev->flags & ATA_DFLAG_DEPOP) || !ata_dma_enabled(dev)) {
- ata_scsi_set_sense(dev, scmd, ILLEGAL_REQUEST, 0x20, 0x0);
+ ata_scsi_set_sense(dev, scmd, ILLEGAL_REQUEST,
+ INVALID_COMMAND_OP_CODE);
return 1;
}
@@@ -4823,6 -4889,28 +4889,6 @@@
return 0;
}
-static void ata_scsi_depop_ua_cap_changed_complete(struct ata_queued_cmd *qc)
-{
- struct scsi_cmnd *scmd = qc->scsicmd;
- u8 *cdb = scmd->cmnd;
- bool is_ata_passthru = cdb[0] == ATA_16 || cdb[0] == ATA_12;
- bool is_success = qc->err_mask == 0;
-
- /*
- * For successful non-passthrough commands, raise a UNIT ATTENTION with
- * the additional sense code set to CAPACITY DATA HAS CHANGED to be
- * raised. Note that this should be done only if the capacity has
- * actually changed, which may not be the case if the element that was
- * specified for depopulation was already depopulated, or we did not
- * restore any removed element. But a capacity change unit attention is
- * harmless, so always raise the unit attention.
- */
- if (is_success && !is_ata_passthru)
- ata_scsi_set_sense(qc->dev, scmd, UNIT_ATTENTION,
- CAPACITY_DATA_HAS_CHANGED);
- ata_scsi_qc_complete(qc);
-}
-
static unsigned int
ata_scsi_remove_element_and_truncate_xlat(struct ata_queued_cmd *qc)
{
@@@ -4834,7 -4922,8 +4900,8 @@@
u32 id;
if (!(dev->flags & ATA_DFLAG_DEPOP)) {
- ata_scsi_set_sense(dev, scmd, ILLEGAL_REQUEST, 0x20, 0x0);
+ ata_scsi_set_sense(dev, scmd, ILLEGAL_REQUEST,
+ INVALID_COMMAND_OP_CODE);
return 1;
}
@@@ -4862,6 -4951,7 +4929,6 @@@
tf->flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE | ATA_TFLAG_LBA48;
qc->flags |= ATA_QCFLAG_RESULT_TF;
- qc->complete_fn = ata_scsi_depop_ua_cap_changed_complete;
return 0;
}
@@@ -4876,7 -4966,8 +4943,8 @@@ ata_scsi_remove_element_and_modify_zone
u32 id;
if (!(dev->flags & ATA_DFLAG_DEPOP_MODIFY)) {
- ata_scsi_set_sense(dev, scmd, ILLEGAL_REQUEST, 0x20, 0x0);
+ ata_scsi_set_sense(dev, scmd, ILLEGAL_REQUEST,
+ INVALID_COMMAND_OP_CODE);
return 1;
}
@@@ -4904,7 -4995,8 +4972,8 @@@ ata_scsi_restore_elements_and_rebuild_x
struct ata_taskfile *tf = &qc->tf;
if (!(dev->flags & ATA_DFLAG_DEPOP_RESTORE)) {
- ata_scsi_set_sense(dev, scmd, ILLEGAL_REQUEST, 0x20, 0x0);
+ ata_scsi_set_sense(dev, scmd, ILLEGAL_REQUEST,
+ INVALID_COMMAND_OP_CODE);
return 1;
}
@@@ -4914,6 -5006,7 +4983,6 @@@
tf->flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE | ATA_TFLAG_LBA48;
qc->flags |= ATA_QCFLAG_RESULT_TF;
- qc->complete_fn = ata_scsi_depop_ua_cap_changed_complete;
return 0;
}
@@@ -5064,7 -5157,8 +5133,8 @@@ static void ata_scsi_simulate(struct at
break;
case REQUEST_SENSE:
- ata_scsi_set_sense(dev, cmd, 0, 0, 0);
+ ata_scsi_set_sense(dev, cmd, NO_SENSE,
+ NO_ADDITIONAL_SENSE_INFORMATION);
break;
/* if we reach this, then writeback caching is disabled,
@@@ -5093,8 -5187,8 +5163,8 @@@
/* all other commands */
default:
- ata_scsi_set_sense(dev, cmd, ILLEGAL_REQUEST, 0x20, 0x0);
- /* "Invalid command operation code" */
+ ata_scsi_set_sense(dev, cmd, ILLEGAL_REQUEST,
+ INVALID_COMMAND_OP_CODE);
break;
}
@@@ -5382,7 -5476,7 +5452,7 @@@ bool ata_scsi_offline_dev(struct ata_de
* ata_scsi_remove_dev - remove attached SCSI device
* @dev: ATA device to remove attached SCSI device for
*
- * This function is called from ata_eh_scsi_hotplug() and
+ * This function is called from ata_scsi_hotplug() and
* responsible for removing the SCSI device attached to @dev.
*
* LOCKING:
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: linux-next: manual merge of the scsi-mkp tree with the origin tree
2026-09-17 19:39 linux-next: manual merge of the scsi-mkp tree with the origin tree Mark Brown
@ 2026-09-18 5:12 ` Niklas Cassel
0 siblings, 0 replies; 9+ messages in thread
From: Niklas Cassel @ 2026-09-18 5:12 UTC (permalink / raw)
To: Mark Brown
Cc: Martin K. Petersen, Damien Le Moal, Linux Kernel Mailing List,
Linux Next Mailing List, Martin K. Petersen
On Thu, Sep 17, 2026 at 08:39:06PM +0100, Mark Brown wrote:
> Hi all,
>
> Today's linux-next merge of the scsi-mkp tree got a conflict in:
>
> drivers/ata/libata-scsi.c
>
> between commit:
>
> 6d81700ad7c48 ("ata: libata-scsi: do not raise UA for storage element depopulation and restoration")
>
> from the origin tree and commit:
>
> c44f095a9d176 ("scsi: ata: libata: Use combined sense codes")
>
> from the scsi-mkp tree.
>
> I fixed it up (see below) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging. You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.
Mark, thank you for the notice.
Martin, as Damien mentioned in the cover letter:
https://lore.kernel.org/linux-scsi/20260908090308.1085097-1-dlemoal@kernel.org/T/#mcf890a9a7d47f717b6362a76c8fb8760a58d7761
Perhaps you could either:
-Rebase scsi-staging on top of -rc2
or
-Merge in -rc2 to scsi-staging
Kind regards,
Niklas
^ permalink raw reply [flat|nested] 9+ messages in thread
* linux-next: manual merge of the scsi-mkp tree with the origin tree
@ 2026-09-17 20:09 Mark Brown
0 siblings, 0 replies; 9+ messages in thread
From: Mark Brown @ 2026-09-17 20:09 UTC (permalink / raw)
To: Martin K. Petersen
Cc: Chandrakanth Patil, Linux Kernel Mailing List,
Linux Next Mailing List, Martin K. Petersen, Milan P. Gandhi,
Ranjan Kumar
[-- Attachment #1: Type: text/plain, Size: 1639 bytes --]
Hi all,
Today's linux-next merge of the scsi-mkp tree got a conflict in:
drivers/scsi/mpi3mr/mpi3mr_transport.c
between commits:
419d129f970aa ("scsi: mpi3mr: Fix target device refcount leak in mpi3mr_sas_port_add()")
dba9e2181ca5e ("scsi: mpi3mr: Fix NULL pointer dereference in mpi3mr_sas_port_add()")
from the origin tree and commit:
29e3f0856e854 ("scsi: mpi3mr: Fix SAS port allocation and registration error handling")
from the scsi-mkp tree.
I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging. You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.
diff --cc drivers/scsi/mpi3mr/mpi3mr_transport.c
index 232af978d7372,a3412cd4ca5bc..0000000000000
--- a/drivers/scsi/mpi3mr/mpi3mr_transport.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_transport.c
@@@ -1504,11 -1560,17 +1560,20 @@@ static struct mpi3mr_sas_port *mpi3mr_s
return mr_sas_port;
out_fail:
+ if (tgtdev) {
+ tgtdev->dev_spec.sas_sata_inf.pend_sas_rphy_add = 0;
+ tgtdev->dev_spec.sas_sata_inf.rphy = NULL;
+ mpi3mr_tgtdev_put(tgtdev);
+ }
+
list_for_each_entry_safe(mr_sas_phy, next, &mr_sas_port->phy_list,
- port_siblings)
+ port_siblings) {
+ mr_sas_phy->phy_belongs_to_port = 0;
list_del(&mr_sas_phy->port_siblings);
+ }
+ if (tgtdev)
+ mpi3mr_tgtdev_put(tgtdev);
kfree(mr_sas_port);
return NULL;
}
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread* linux-next: manual merge of the scsi-mkp tree with the origin tree
@ 2026-07-13 15:13 Mark Brown
2026-07-16 10:13 ` Uwe Kleine-König
0 siblings, 1 reply; 9+ messages in thread
From: Mark Brown @ 2026-07-13 15:13 UTC (permalink / raw)
To: Martin K. Petersen
Cc: Linux Kernel Mailing List, Linux Next Mailing List,
Uwe Kleine-König
[-- Attachment #1: Type: text/plain, Size: 1478 bytes --]
Hi all,
Today's linux-next merge of the scsi-mkp tree got a conflict in:
include/linux/mod_devicetable.h
between commit:
ad428f5811bd7 ("mod_devicetable.h: Split into per subsystem headers")
from the origin tree and commit:
e73ba3d6ed03b ("scsi: zorro: Simplify storing pointers in device id struct")
from the scsi-mkp tree.
I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging. You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.
diff --cc include/linux/mod_devicetable.h
index a397213bedace,2673a1bd82c45..0000000000000
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
diff --git a/include/linux/device-id/zorro.h b/include/linux/device-id/zorro.h
index 5fdac81689839..26827b9b90b67 100644
--- a/include/linux/device-id/zorro.h
+++ b/include/linux/device-id/zorro.h
@@ -13,7 +13,11 @@ typedef unsigned long kernel_ulong_t;
struct zorro_device_id {
__u32 id; /* Device ID or ZORRO_WILDCARD */
- kernel_ulong_t driver_data; /* Data private to the driver */
+ union {
+ /* Data private to the driver */
+ kernel_ulong_t driver_data;
+ const void *driver_data_ptr;
+ };
};
#endif /* ifndef LINUX_DEVICE_ID_ZORRO_H */
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: linux-next: manual merge of the scsi-mkp tree with the origin tree
2026-07-13 15:13 Mark Brown
@ 2026-07-16 10:13 ` Uwe Kleine-König
2026-07-16 13:03 ` Mark Brown
0 siblings, 1 reply; 9+ messages in thread
From: Uwe Kleine-König @ 2026-07-16 10:13 UTC (permalink / raw)
To: Mark Brown
Cc: Martin K. Petersen, Linux Kernel Mailing List, Linux Next Mailing List
[-- Attachment #1: Type: text/plain, Size: 3701 bytes --]
Hello Mark,
On Mon, Jul 13, 2026 at 04:13:24PM +0100, Mark Brown wrote:
> Today's linux-next merge of the scsi-mkp tree got a conflict in:
>
> include/linux/mod_devicetable.h
>
> between commit:
>
> ad428f5811bd7 ("mod_devicetable.h: Split into per subsystem headers")
>
> from the origin tree and commit:
>
> e73ba3d6ed03b ("scsi: zorro: Simplify storing pointers in device id struct")
>
> from the scsi-mkp tree.
>
> I fixed it up (see below) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging. You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.
>
> diff --cc include/linux/mod_devicetable.h
> index a397213bedace,2673a1bd82c45..0000000000000
> --- a/include/linux/mod_devicetable.h
> +++ b/include/linux/mod_devicetable.h
> diff --git a/include/linux/device-id/zorro.h b/include/linux/device-id/zorro.h
> index 5fdac81689839..26827b9b90b67 100644
> --- a/include/linux/device-id/zorro.h
> +++ b/include/linux/device-id/zorro.h
> @@ -13,7 +13,11 @@ typedef unsigned long kernel_ulong_t;
>
> struct zorro_device_id {
> __u32 id; /* Device ID or ZORRO_WILDCARD */
> - kernel_ulong_t driver_data; /* Data private to the driver */
> + union {
> + /* Data private to the driver */
> + kernel_ulong_t driver_data;
> + const void *driver_data_ptr;
> + };
> };
While this looks right, I think it's wrong in git:
$ git show next-20260715~32
commit b36e50419ebc00bef45b574c6ce3e7edbbda5eb9
Merge: 20361c12febf cf1af0ccca54
Author: Mark Brown <broonie@kernel.org>
Date: Wed Jul 15 14:23:48 2026 +0100
Merge branch 'for-next' of https://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git
diff --cc include/linux/device-id/zorro.h
index 5fdac8168983,000000000000..26827b9b90b6
mode 100644,000000..100644
--- a/include/linux/device-id/zorro.h
+++ b/include/linux/device-id/zorro.h
@@@ -1,19 -1,0 +1,23 @@@
+/* SPDX-License-Identifier: GPL-2.0 */
+#ifndef LINUX_DEVICE_ID_ZORRO_H
+#define LINUX_DEVICE_ID_ZORRO_H
+
+#ifdef __KERNEL__
+#include <linux/types.h>
+typedef unsigned long kernel_ulong_t;
+#endif
+
+#define ZORRO_WILDCARD (0xffffffff) /* not official */
+
+#define ZORRO_DEVICE_MODALIAS_FMT "zorro:i%08X"
+
+struct zorro_device_id {
+ __u32 id; /* Device ID or ZORRO_WILDCARD */
- kernel_ulong_t driver_data; /* Data private to the driver */
++ union {
++ /* Data private to the driver */
++ kernel_ulong_t driver_data;
++ const void *driver_data_ptr;
++ };
+};
+
+#endif /* ifndef LINUX_DEVICE_ID_ZORRO_H */
So the fixup is applied to the merge of the scsi tree and not the
scsi-mkp tree. The latter wasn't pulled into next-20260715 at all. Given
that e73ba3d6ed03b isn't in next, the fixup shouldn't be there either.
Looking at merge.log I see merging scsi-mkp is tried, the fixup is
applied, yielding 0fd66dadace89 and then `git reset --hard HEAD^`
follows throwing away that commit to replace it by
next-20260714/scsi-mkp which is already included and thus the
patches/device-id-zorro fixup is applied to the wrong commit.
Having said that e73ba3d6ed03b is still in
https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next
without the patch preparing drivers/ata/pata_buddha.c for that change
and thus resulting in a build failure on m68k.
Best regards
Uwe
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: linux-next: manual merge of the scsi-mkp tree with the origin tree
2026-07-16 10:13 ` Uwe Kleine-König
@ 2026-07-16 13:03 ` Mark Brown
2026-07-16 13:09 ` Martin K. Petersen
0 siblings, 1 reply; 9+ messages in thread
From: Mark Brown @ 2026-07-16 13:03 UTC (permalink / raw)
To: Uwe Kleine-König
Cc: Martin K. Petersen, Linux Kernel Mailing List, Linux Next Mailing List
[-- Attachment #1: Type: text/plain, Size: 1591 bytes --]
On Thu, Jul 16, 2026 at 12:13:59PM +0200, Uwe Kleine-König wrote:
> So the fixup is applied to the merge of the scsi tree and not the
> scsi-mkp tree. The latter wasn't pulled into next-20260715 at all. Given
> that e73ba3d6ed03b isn't in next, the fixup shouldn't be there either.
> Looking at merge.log I see merging scsi-mkp is tried, the fixup is
> applied, yielding 0fd66dadace89 and then `git reset --hard HEAD^`
> follows throwing away that commit to replace it by
> next-20260714/scsi-mkp which is already included and thus the
> patches/device-id-zorro fixup is applied to the wrong commit.
Right, the fixups don't differentiate between versions of the tree and
the fact that scsi-mkp is broken and never had a version that was merged
this cycle means that the tooling gets confused about the fixup. We
need the fixup to try the build on the off chance that there's a fix,
but then it's not needed if the fix failed and since it's not dependent
on any context added by the merge it doesn't get skipped.
> Having said that e73ba3d6ed03b is still in
> https://git.kernel.org/pub/scm/linux/kernel/git/mkp/scsi.git for-next
> without the patch preparing drivers/ata/pata_buddha.c for that change
> and thus resulting in a build failure on m68k.
It's also got an arm64 allyesconfig build failure which is what's
keeping it out of -next, the submitter of the offending patch asked for
their patches to be dropped but I've seen no response from Martin.
Hopefully at some point the various build failures will be addressed and
this will all get sorted.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: linux-next: manual merge of the scsi-mkp tree with the origin tree
2026-07-16 13:03 ` Mark Brown
@ 2026-07-16 13:09 ` Martin K. Petersen
2026-07-16 13:20 ` Mark Brown
0 siblings, 1 reply; 9+ messages in thread
From: Martin K. Petersen @ 2026-07-16 13:09 UTC (permalink / raw)
To: Mark Brown
Cc: Uwe Kleine-König, Martin K. Petersen,
Linux Kernel Mailing List, Linux Next Mailing List
Mark,
> It's also got an arm64 allyesconfig build failure which is what's
> keeping it out of -next, the submitter of the offending patch asked for
> their patches to be dropped but I've seen no response from Martin.
I've been traveling for a couple of days. Will resolve this later today.
--
Martin K. Petersen
^ permalink raw reply [flat|nested] 9+ messages in thread
* Re: linux-next: manual merge of the scsi-mkp tree with the origin tree
2026-07-16 13:09 ` Martin K. Petersen
@ 2026-07-16 13:20 ` Mark Brown
0 siblings, 0 replies; 9+ messages in thread
From: Mark Brown @ 2026-07-16 13:20 UTC (permalink / raw)
To: Martin K. Petersen
Cc: Uwe Kleine-König, Linux Kernel Mailing List,
Linux Next Mailing List
[-- Attachment #1: Type: text/plain, Size: 477 bytes --]
On Thu, Jul 16, 2026 at 09:09:14AM -0400, Martin K. Petersen wrote:
> > It's also got an arm64 allyesconfig build failure which is what's
> > keeping it out of -next, the submitter of the offending patch asked for
> > their patches to be dropped but I've seen no response from Martin.
> I've been traveling for a couple of days. Will resolve this later today.
Ah, excellent - thanks! That will also resolve the issue with the fixup
from Uwe so we should be good.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
* linux-next: manual merge of the scsi-mkp tree with the origin tree
@ 2026-03-30 19:58 Mark Brown
0 siblings, 0 replies; 9+ messages in thread
From: Mark Brown @ 2026-03-30 19:58 UTC (permalink / raw)
To: Martin K. Petersen
Cc: Linux Kernel Mailing List, Linux Next Mailing List, Ranjan Kumar
[-- Attachment #1: Type: text/plain, Size: 2524 bytes --]
Hi all,
Today's linux-next merge of the scsi-mkp tree got a conflict in:
drivers/scsi/mpi3mr/mpi3mr_fw.c
between commit:
fa96392ebebc8 ("scsi: mpi3mr: Add NULL checks when resetting request and reply queues")
from the origin tree and commit:
9d660e482071b ("scsi: mpi3mr: Add queue-full tracking for operational request queues")
from the scsi-mkp tree.
I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging. You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.
diff --cc drivers/scsi/mpi3mr/mpi3mr_fw.c
index c744210cc9018,01042eaf0dff4..0000000000000
--- a/drivers/scsi/mpi3mr/mpi3mr_fw.c
+++ b/drivers/scsi/mpi3mr/mpi3mr_fw.c
@@@ -4817,25 -4828,22 +4838,26 @@@ void mpi3mr_memset_buffers(struct mpi3m
}
for (i = 0; i < mrioc->num_queues; i++) {
- mrioc->op_reply_qinfo[i].qid = 0;
- mrioc->op_reply_qinfo[i].ci = 0;
- mrioc->op_reply_qinfo[i].num_replies = 0;
- mrioc->op_reply_qinfo[i].ephase = 0;
- atomic_set(&mrioc->op_reply_qinfo[i].pend_ios, 0);
- atomic_set(&mrioc->op_reply_qinfo[i].in_use, 0);
- mpi3mr_memset_op_reply_q_buffers(mrioc, i);
+ if (mrioc->op_reply_qinfo) {
+ mrioc->op_reply_qinfo[i].qid = 0;
+ mrioc->op_reply_qinfo[i].ci = 0;
+ mrioc->op_reply_qinfo[i].num_replies = 0;
+ mrioc->op_reply_qinfo[i].ephase = 0;
+ atomic_set(&mrioc->op_reply_qinfo[i].pend_ios, 0);
+ atomic_set(&mrioc->op_reply_qinfo[i].in_use, 0);
+ mpi3mr_memset_op_reply_q_buffers(mrioc, i);
+ }
- mrioc->req_qinfo[i].ci = 0;
- mrioc->req_qinfo[i].pi = 0;
- mrioc->req_qinfo[i].num_requests = 0;
- mrioc->req_qinfo[i].qid = 0;
- mrioc->req_qinfo[i].reply_qid = 0;
- spin_lock_init(&mrioc->req_qinfo[i].q_lock);
- mrioc->req_qinfo[i].last_full_host_tag = 0;
- mpi3mr_memset_op_req_q_buffers(mrioc, i);
+ if (mrioc->req_qinfo) {
+ mrioc->req_qinfo[i].ci = 0;
+ mrioc->req_qinfo[i].pi = 0;
+ mrioc->req_qinfo[i].num_requests = 0;
+ mrioc->req_qinfo[i].qid = 0;
+ mrioc->req_qinfo[i].reply_qid = 0;
+ spin_lock_init(&mrioc->req_qinfo[i].q_lock);
++ mrioc->req_qinfo[i].last_full_host_tag = 0;
+ mpi3mr_memset_op_req_q_buffers(mrioc, i);
+ }
}
atomic_set(&mrioc->pend_large_data_sz, 0);
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply [flat|nested] 9+ messages in thread
end of thread, other threads:[~2026-09-18 5:12 UTC | newest]
Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-17 19:39 linux-next: manual merge of the scsi-mkp tree with the origin tree Mark Brown
2026-09-18 5:12 ` Niklas Cassel
-- strict thread matches above, loose matches on Subject: below --
2026-09-17 20:09 Mark Brown
2026-07-13 15:13 Mark Brown
2026-07-16 10:13 ` Uwe Kleine-König
2026-07-16 13:03 ` Mark Brown
2026-07-16 13:09 ` Martin K. Petersen
2026-07-16 13:20 ` Mark Brown
2026-03-30 19:58 Mark Brown
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®