Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

scsi: pm80xx: Remove global lock from outbound queue processing

Introduce spin lock for outbound queue. With this, driver need not acquire
HBA global lock for outbound queue processing.

Link: https://lore.kernel.org/r/20210415103352.3580-9-Viswas.G@microchip.com
Acked-by: Jack Wang <jinpu.wang@cloud.ionos.com>
Signed-off-by: Viswas G <Viswas.G@microchip.com>
Signed-off-by: Ruksar Devadi <Ruksar.devadi@microchip.com>
Signed-off-by: Ashokkumar N <Ashokkumar.N@microchip.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

authored by

Viswas G and committed by
Martin K. Petersen
1f02beff b431472b

+9 -5
+6 -3
drivers/scsi/pm8001/pm8001_init.c
··· 267 267 { 268 268 int i, count = 0, rc = 0; 269 269 u32 ci_offset, ib_offset, ob_offset, pi_offset; 270 - struct inbound_queue_table *circularQ; 270 + struct inbound_queue_table *ibq; 271 + struct outbound_queue_table *obq; 271 272 272 273 spin_lock_init(&pm8001_ha->lock); 273 274 spin_lock_init(&pm8001_ha->bitmap_lock); ··· 316 315 pm8001_ha->memoryMap.region[IOP].alignment = 32; 317 316 318 317 for (i = 0; i < count; i++) { 319 - circularQ = &pm8001_ha->inbnd_q_tbl[i]; 320 - spin_lock_init(&circularQ->iq_lock); 318 + ibq = &pm8001_ha->inbnd_q_tbl[i]; 319 + spin_lock_init(&ibq->iq_lock); 321 320 /* MPI Memory region 3 for consumer Index of inbound queues */ 322 321 pm8001_ha->memoryMap.region[ci_offset+i].num_elements = 1; 323 322 pm8001_ha->memoryMap.region[ci_offset+i].element_size = 4; ··· 346 345 } 347 346 348 347 for (i = 0; i < count; i++) { 348 + obq = &pm8001_ha->outbnd_q_tbl[i]; 349 + spin_lock_init(&obq->oq_lock); 349 350 /* MPI Memory region 4 for producer Index of outbound queues */ 350 351 pm8001_ha->memoryMap.region[pi_offset+i].num_elements = 1; 351 352 pm8001_ha->memoryMap.region[pi_offset+i].element_size = 4;
+1
drivers/scsi/pm8001/pm8001_sas.h
··· 456 456 u32 dinterrup_to_pci_offset; 457 457 __le32 producer_index; 458 458 u32 consumer_idx; 459 + spinlock_t oq_lock; 459 460 }; 460 461 struct pm8001_hba_memspace { 461 462 void __iomem *memvirtaddr;
+2 -2
drivers/scsi/pm8001/pm80xx_hwi.c
··· 4133 4133 return ret; 4134 4134 } 4135 4135 } 4136 - spin_lock_irqsave(&pm8001_ha->lock, flags); 4137 4136 circularQ = &pm8001_ha->outbnd_q_tbl[vec]; 4137 + spin_lock_irqsave(&circularQ->oq_lock, flags); 4138 4138 do { 4139 4139 /* spurious interrupt during setup if kexec-ing and 4140 4140 * driver doing a doorbell access w/ the pre-kexec oq ··· 4160 4160 break; 4161 4161 } 4162 4162 } while (1); 4163 - spin_unlock_irqrestore(&pm8001_ha->lock, flags); 4163 + spin_unlock_irqrestore(&circularQ->oq_lock, flags); 4164 4164 return ret; 4165 4165 } 4166 4166