[amd] common: remove mutexes and locks

This commit is contained in:
Adam Madsen 2020-11-13 17:20:06 -06:00
parent 331f44820e
commit d537ed67d9
2 changed files with 0 additions and 24 deletions

View File

@ -48,10 +48,6 @@ int amd_common_pre_reset(struct vendor_reset_dev *dev)
dev->vendor_private = priv;
priv->vdev = dev;
spin_lock_init(&priv->pcie_lock);
spin_lock_init(&priv->reg_lock);
mutex_init(&priv->smu_lock);
priv->mmio_base = pci_resource_start(pdev, 5);
priv->mmio_size = pci_resource_len(pdev, 5);
priv->mmio = ioremap(priv->mmio_base, priv->mmio_size);
@ -99,7 +95,6 @@ int amd_common_post_reset(struct vendor_reset_dev *dev)
kfree(priv);
dev->vendor_private = NULL;
mutex_destroy(&priv->smu_lock);
return 0;
}
@ -124,8 +119,6 @@ int smum_send_msg_to_smc_with_parameter(struct amd_fake_dev *adev, uint16_t msg,
{
int ret = 0;
mutex_lock(&adev_to_amd_private(adev)->smu_lock);
ret = smu_wait(adev);
if (ret != 0x1)
{
@ -151,7 +144,6 @@ int smum_send_msg_to_smc_with_parameter(struct amd_fake_dev *adev, uint16_t msg,
ret = ret != 0x01;
out:
mutex_unlock(&adev_to_amd_private(adev)->smu_lock);
return ret;
}

View File

@ -36,11 +36,8 @@ Place, Suite 330, Boston, MA 02111-1307 USA
__out = readl(adev_to_amd_private(adev)->mmio + (reg)); \
else \
{ \
unsigned long __flags; \
spin_lock_irqsave(&adev_to_amd_private(adev)->reg_lock, __flags); \
writel((reg), adev_to_amd_private(adev)->mmio + mmMM_INDEX); \
__out = readl(adev_to_amd_private(adev)->mmio + mmMM_DATA); \
spin_unlock_irqrestore(&adev_to_amd_private(adev)->reg_lock, __flags); \
} \
__out; \
})
@ -52,35 +49,26 @@ Place, Suite 330, Boston, MA 02111-1307 USA
writel(v, adev_to_amd_private(adev)->mmio + (reg)); \
else \
{ \
unsigned long __flags; \
spin_lock_irqsave(&adev_to_amd_private(adev)->reg_lock, __flags); \
writel((reg), adev_to_amd_private(adev)->mmio + mmMM_INDEX); \
writel(v, adev_to_amd_private(adev)->mmio + mmMM_DATA); \
spin_unlock_irqrestore(&adev_to_amd_private(adev)->reg_lock, __flags); \
} \
} while (0)
#define WREG32_PCIE(reg, v) \
do \
{ \
unsigned long __flags; \
spin_lock_irqsave(&adev_to_amd_private(adev)->pcie_lock, __flags); \
WREG32(mmPCIE_INDEX2, reg); \
(void)RREG32(mmPCIE_INDEX2); \
WREG32(mmPCIE_DATA2, v); \
(void)RREG32(mmPCIE_DATA2); \
spin_unlock_irqrestore(&adev_to_amd_private(adev)->pcie_lock, __flags); \
} while (0)
#define RREG32_PCIE(reg) \
({ \
unsigned long __flags; \
u32 __tmp_read; \
spin_lock_irqsave(&adev_to_amd_private(adev)->pcie_lock, __flags); \
WREG32(mmPCIE_INDEX2, reg); \
(void)RREG32(mmPCIE_INDEX2); \
__tmp_read = RREG32(mmPCIE_DATA2); \
spin_unlock_irqrestore(&adev_to_amd_private(adev)->pcie_lock, __flags); \
__tmp_read; \
})
@ -120,10 +108,6 @@ struct amd_vendor_private
resource_size_t mmio_base;
resource_size_t mmio_size;
uint32_t __iomem *mmio;
spinlock_t pcie_lock;
spinlock_t reg_lock;
struct mutex smu_lock;
};
static inline struct amd_vendor_private *adev_to_amd_private(struct amd_fake_dev *adev)