ata: libata-scsi: Remove superfluous local_irq_save()
Niklas Cassel
maintainerPATCH 1/1 ata: libata-scsi: Remove superfluous local_irq_save()
Commit 28a3fc2295a7 ("libata: implement ZBC IN translation") added ata_scsi_report_zones_complete(). Since the beginning, this function has disabled IRQs on the local CPU using local_irq_save().
qc->complete_fn is always called with ap->lock held, and the ap->lock is always taking using spin_lock_irq*().
Thus, this local_irq_save() is superfluous and can be removed.
--- drivers/ata/libata-scsi.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/ata/libata-scsi.c +2 -3
@@ -3572,13 +3572,13 @@ static void ata_scsi_report_zones_complete(struct ata_queued_cmd *qc) {struct scsi_cmnd *scmd = qc->scsicmd;struct sg_mapping_iter miter; -unsigned long flags;unsigned int bytes =0 ; +lockdep_assert_held (qc->ap->lock); +sg_miter_start (&miter,scsi_sglist (scmd),scsi_sg_count (scmd),SG_MITER_TO_SG |SG_MITER_ATOMIC ); -local_irq_save (flags);while (sg_miter_next (&miter)) {unsigned int offset =0 ;
@@ -3626,7 +3626,6 @@ static void ata_scsi_report_zones_complete(struct ata_queued_cmd *qc) } }sg_miter_stop (&miter); -local_irq_restore (flags);ata_scsi_qc_complete (qc); }
Signature · 1 line
2.52.0
Niklas Cassel
maintainerQuoted 6 lines · Niklas Cassel
Commit
28a3fc2295a7("libata: implement ZBC IN translation") addedata_scsi_report_zones_complete(). Since the beginning, this function has disabled IRQs on the local CPU usinglocal_irq_save().
qc->complete_fnis always called withap->lockheld, and theap->lockis always taking using spin_lock_irq*().
s/taking/taken/
Quoted 35 lines · Niklas Cassel
Commit
28a3fc2295a7("libata: implement ZBC IN translation") addedata_scsi_report_zones_complete(). Since the beginning, this function has disabled IRQs on the local CPU usinglocal_irq_save().
qc->complete_fnis always called withap->lockheld, and theap->lockis always taking using spin_lock_irq*().Thus, this
local_irq_save()is superfluous and can be removed.Signed-off-by Niklas Cassel <[email protected]>--- drivers/ata/libata-scsi.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)drivers/ata/libata-scsi.c +2
-2@@ -3572,13 +3572,13 @@ static void ata_scsi_report_zones_complete(struct ata_queued_cmd *qc) {struct scsi_cmnd *scmd = qc->scsicmd;struct sg_mapping_iter miter; -unsigned long flags;unsigned int bytes =0 ; +lockdep_assert_held (qc->ap->lock); +sg_miter_start (&miter,scsi_sglist (scmd),scsi_sg_count (scmd),SG_MITER_TO_SG |SG_MITER_ATOMIC ); -local_irq_save (flags);while (sg_miter_next (&miter)) {unsigned int offset =0 ;
drivers/ata/libata-scsi.c static void ata_scsi_report_zones_complete(struct ata_queued_cmd *qc) · line 3631
Quoted 7 lines
drivers/ata/libata-scsi.c +0
-1@@ -3626,7 +3626,6 @@ static void ata_scsi_report_zones_complete(struct ata_queued_cmd *qc) } }sg_miter_stop (&miter); -local_irq_restore (flags);ata_scsi_qc_complete (qc); }
Cheers,
Hannes
Signature · 4 lines
Dr. Hannes Reinecke Kernel Storage Architect [email protected] +49 911 74053 688 SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich
Damien Le Moal
maintainerQuoted 10 lines · Niklas Cassel
Commit
28a3fc2295a7("libata: implement ZBC IN translation") addedata_scsi_report_zones_complete(). Since the beginning, this function has disabled IRQs on the local CPU usinglocal_irq_save().
qc->complete_fnis always called withap->lockheld, and theap->lockis always taking using spin_lock_irq*().Thus, this
local_irq_save()is superfluous and can be removed.Signed-off-by Niklas Cassel <[email protected]>
I staged this in for-6.20, which I will rebase once rc1 is out.
Signature · 2 lines
Damien Le Moal Western Digital Research