Skip to content

Commit

Permalink
megaraid_sas : Use writeq for 64bit pci write to avoid spinlock overhead
Browse files Browse the repository at this point in the history
Resending the patch. Addressed the review comments from Tomas Henzl.
Reduce the assingment for u64 req_data variable.

Use writeq() for 64bit PCI write instead of writel() to avoid additional lock overhead.

Signed-off-by: Sumit Saxena <sumit.saxena@avagotech.com>
Signed-off-by: Kashyap Desai <kashyap.desai@avagotech.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
  • Loading branch information
Sumit.Saxena@avagotech.com authored and Christoph Hellwig committed Sep 16, 2014
1 parent 07e38d9 commit 0756040
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions drivers/scsi/megaraid/megaraid_sas_fusion.c
Original file line number Diff line number Diff line change
Expand Up @@ -1065,13 +1065,19 @@ megasas_fire_cmd_fusion(struct megasas_instance *instance,
u32 req_desc_hi,
struct megasas_register_set __iomem *regs)
{
#if defined(writeq) && defined(CONFIG_64BIT)
u64 req_data = (((u64)req_desc_hi << 32) | (u32)req_desc_lo);

writeq(le64_to_cpu(req_data), &(regs)->inbound_low_queue_port);
#else
unsigned long flags;

spin_lock_irqsave(&instance->hba_lock, flags);

writel(le32_to_cpu(req_desc_lo), &(regs)->inbound_low_queue_port);
writel(le32_to_cpu(req_desc_hi), &(regs)->inbound_high_queue_port);
spin_unlock_irqrestore(&instance->hba_lock, flags);
#endif
}

/**
Expand Down

0 comments on commit 0756040

Please sign in to comment.