mirror of
https://github.com/torvalds/linux.git
synced 2026-06-05 04:56:13 +02:00
SCSI fixes on 20250905
Obvious driver patch plus update to sr to add back rotational media flag since CDROMS are rotational. Signed-off-by: James E.J. Bottomley <James.Bottomley@HansenPartnership.com> -----BEGIN PGP SIGNATURE----- iJwEABMIAEQWIQTnYEDbdso9F2cI+arnQslM7pishQUCaLsNQCYcamFtZXMuYm90 dG9tbGV5QGhhbnNlbnBhcnRuZXJzaGlwLmNvbQAKCRDnQslM7pishU2SAQCTyMtS 9Nryoq5XAzzWc+exbXrhmCQmx7vovM+G0VXRWwD/eyj76Y4OTioBbCpSOpkiTmu8 O2MxuKmUIyjbNm/gSBE= =rEsa -----END PGP SIGNATURE----- Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi Pull SCSI fixes from James Bottomley: "Obvious driver patch plus update to sr to add back rotational media flag since CDROMS are rotational" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: sr: Reinstate rotational media flag scsi: lpfc: Fix buffer free/clear order in deferred receive path
This commit is contained in:
commit
d3e45016f7
|
|
@ -1243,7 +1243,7 @@ lpfc_nvmet_defer_rcv(struct nvmet_fc_target_port *tgtport,
|
|||
struct lpfc_nvmet_tgtport *tgtp;
|
||||
struct lpfc_async_xchg_ctx *ctxp =
|
||||
container_of(rsp, struct lpfc_async_xchg_ctx, hdlrctx.fcp_req);
|
||||
struct rqb_dmabuf *nvmebuf = ctxp->rqb_buffer;
|
||||
struct rqb_dmabuf *nvmebuf;
|
||||
struct lpfc_hba *phba = ctxp->phba;
|
||||
unsigned long iflag;
|
||||
|
||||
|
|
@ -1251,13 +1251,18 @@ lpfc_nvmet_defer_rcv(struct nvmet_fc_target_port *tgtport,
|
|||
lpfc_nvmeio_data(phba, "NVMET DEFERRCV: xri x%x sz %d CPU %02x\n",
|
||||
ctxp->oxid, ctxp->size, raw_smp_processor_id());
|
||||
|
||||
spin_lock_irqsave(&ctxp->ctxlock, iflag);
|
||||
nvmebuf = ctxp->rqb_buffer;
|
||||
if (!nvmebuf) {
|
||||
spin_unlock_irqrestore(&ctxp->ctxlock, iflag);
|
||||
lpfc_printf_log(phba, KERN_INFO, LOG_NVME_IOERR,
|
||||
"6425 Defer rcv: no buffer oxid x%x: "
|
||||
"flg %x ste %x\n",
|
||||
ctxp->oxid, ctxp->flag, ctxp->state);
|
||||
return;
|
||||
}
|
||||
ctxp->rqb_buffer = NULL;
|
||||
spin_unlock_irqrestore(&ctxp->ctxlock, iflag);
|
||||
|
||||
tgtp = phba->targetport->private;
|
||||
if (tgtp)
|
||||
|
|
@ -1265,9 +1270,6 @@ lpfc_nvmet_defer_rcv(struct nvmet_fc_target_port *tgtport,
|
|||
|
||||
/* Free the nvmebuf since a new buffer already replaced it */
|
||||
nvmebuf->hrq->rqbp->rqb_free_buffer(phba, nvmebuf);
|
||||
spin_lock_irqsave(&ctxp->ctxlock, iflag);
|
||||
ctxp->rqb_buffer = NULL;
|
||||
spin_unlock_irqrestore(&ctxp->ctxlock, iflag);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -475,13 +475,21 @@ static blk_status_t sr_init_command(struct scsi_cmnd *SCpnt)
|
|||
|
||||
static int sr_revalidate_disk(struct scsi_cd *cd)
|
||||
{
|
||||
struct request_queue *q = cd->device->request_queue;
|
||||
struct scsi_sense_hdr sshdr;
|
||||
struct queue_limits lim;
|
||||
int sector_size;
|
||||
|
||||
/* if the unit is not ready, nothing more to do */
|
||||
if (scsi_test_unit_ready(cd->device, SR_TIMEOUT, MAX_RETRIES, &sshdr))
|
||||
return 0;
|
||||
sr_cd_check(&cd->cdi);
|
||||
return get_sectorsize(cd);
|
||||
sector_size = get_sectorsize(cd);
|
||||
|
||||
lim = queue_limits_start_update(q);
|
||||
lim.logical_block_size = sector_size;
|
||||
lim.features |= BLK_FEAT_ROTATIONAL;
|
||||
return queue_limits_commit_update_frozen(q, &lim);
|
||||
}
|
||||
|
||||
static int sr_block_open(struct gendisk *disk, blk_mode_t mode)
|
||||
|
|
@ -721,10 +729,8 @@ static int sr_probe(struct device *dev)
|
|||
|
||||
static int get_sectorsize(struct scsi_cd *cd)
|
||||
{
|
||||
struct request_queue *q = cd->device->request_queue;
|
||||
static const u8 cmd[10] = { READ_CAPACITY };
|
||||
unsigned char buffer[8] = { };
|
||||
struct queue_limits lim;
|
||||
int err;
|
||||
int sector_size;
|
||||
struct scsi_failure failure_defs[] = {
|
||||
|
|
@ -795,9 +801,7 @@ static int get_sectorsize(struct scsi_cd *cd)
|
|||
set_capacity(cd->disk, cd->capacity);
|
||||
}
|
||||
|
||||
lim = queue_limits_start_update(q);
|
||||
lim.logical_block_size = sector_size;
|
||||
return queue_limits_commit_update_frozen(q, &lim);
|
||||
return sector_size;
|
||||
}
|
||||
|
||||
static int get_capabilities(struct scsi_cd *cd)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user