Initial commit
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
Build all core packages / Build all core packages for selected target (push) Has been cancelled
Build and Push prebuilt tools container / Build and Push all prebuilt containers (push) Has been cancelled
Build Toolchains / Build Toolchains for each target (push) Has been cancelled
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
Coverity scan build / Coverity x86/64 build (push) Has been cancelled
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
Build all core packages / Build all core packages for selected target (push) Has been cancelled
Build and Push prebuilt tools container / Build and Push all prebuilt containers (push) Has been cancelled
Build Toolchains / Build Toolchains for each target (push) Has been cancelled
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
Coverity scan build / Coverity x86/64 build (push) Has been cancelled
This commit is contained in:
92
package/kernel/lantiq/vrx518_ep/patches/100-compat.patch
Normal file
92
package/kernel/lantiq/vrx518_ep/patches/100-compat.patch
Normal file
@@ -0,0 +1,92 @@
|
||||
--- a/ep.c
|
||||
+++ b/ep.c
|
||||
@@ -373,23 +373,23 @@ int dc_ep_dev_info_req(int dev_idx, enum
|
||||
|
||||
switch (module) {
|
||||
case DC_EP_INT_PPE:
|
||||
- dev->irq = priv->irq_base;
|
||||
+ dev->irq = pci_irq_vector(priv->pdev, 0);
|
||||
if (priv->msi_mode == DC_EP_8_MSI_MODE) {
|
||||
- dev->aca_tx_irq = priv->irq_base + 7;
|
||||
- dev->aca_rx_irq = priv->irq_base + 6;
|
||||
+ dev->aca_tx_irq = pci_irq_vector(priv->pdev, 7);
|
||||
+ dev->aca_rx_irq = pci_irq_vector(priv->pdev, 6);
|
||||
} else if (priv->msi_mode == DC_EP_4_MSI_MODE) {
|
||||
- dev->aca_tx_irq = priv->irq_base + 2;
|
||||
- dev->aca_rx_irq = priv->irq_base + 3;
|
||||
+ dev->aca_tx_irq = pci_irq_vector(priv->pdev, 2);
|
||||
+ dev->aca_rx_irq = pci_irq_vector(priv->pdev, 3);
|
||||
} else {
|
||||
dev_err(dev->dev, "%s ACA should never occur\n",
|
||||
__func__);
|
||||
}
|
||||
break;
|
||||
case DC_EP_INT_MEI:
|
||||
- dev->irq = priv->irq_base + 1;
|
||||
+ dev->irq = pci_irq_vector(priv->pdev, 1);
|
||||
break;
|
||||
default:
|
||||
- dev->irq = priv->irq_base;
|
||||
+ dev->irq = pci_irq_vector(priv->pdev, 0);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -466,8 +466,8 @@ static int dc_ep_msi_enable(struct pci_d
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
- err = pci_enable_msi_exact(pdev, nvec);
|
||||
- if (err) {
|
||||
+ err = pci_alloc_irq_vectors(pdev, nvec, nvec, PCI_IRQ_MSI | PCI_IRQ_LEGACY);
|
||||
+ if (err < 0) {
|
||||
dev_err(&pdev->dev,
|
||||
"%s: Failed to enable MSI interrupts error code: %d\n",
|
||||
__func__, err);
|
||||
@@ -589,15 +589,15 @@ static int dc_ep_probe(struct pci_dev *p
|
||||
/* Target structures have a limit of 32 bit DMA pointers.
|
||||
* DMA pointers can be wider than 32 bits by default on some systems.
|
||||
*/
|
||||
- ret = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
|
||||
+ ret = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));
|
||||
if (ret) {
|
||||
dev_err(&pdev->dev, "32-bit DMA not available: %d\n", ret);
|
||||
goto err_region;
|
||||
}
|
||||
|
||||
- ret = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(32));
|
||||
+ ret = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(32));
|
||||
if (ret) {
|
||||
- dev_err(&pdev->dev, "cannot enable 32-bit consistent DMA\n");
|
||||
+ dev_err(&pdev->dev, "cannot enable 32-bit coherent DMA\n");
|
||||
goto err_region;
|
||||
}
|
||||
|
||||
@@ -654,7 +654,7 @@ static int dc_ep_probe(struct pci_dev *p
|
||||
goto err_iomap;
|
||||
|
||||
spin_lock(&dc_ep_lock);
|
||||
- priv->irq_base = pdev->irq;
|
||||
+ priv->irq_base = pci_irq_vector(pdev, 0);
|
||||
spin_unlock(&dc_ep_lock);
|
||||
|
||||
#ifndef CONFIG_OF
|
||||
@@ -715,7 +715,7 @@ static void dc_ep_remove(struct pci_dev
|
||||
dc_ep_icu_disable(priv);
|
||||
pci_iounmap(pdev, priv->mem);
|
||||
pci_release_region(pdev, DC_EP_BAR_NUM);
|
||||
- pci_disable_msi(pdev);
|
||||
+ pci_free_irq_vectors(pdev);
|
||||
wmb();
|
||||
pci_clear_master(pdev);
|
||||
pci_disable_device(pdev);
|
||||
--- a/aca.c
|
||||
+++ b/aca.c
|
||||
@@ -756,7 +756,7 @@ static void aca_hif_param_init_done(stru
|
||||
addr = fw_param->init_addr;
|
||||
dev_dbg(priv->dev, "init_addr: %x\n", addr);
|
||||
memcpy_toio(priv->mem + addr, hif_params, sizeof(*hif_params));
|
||||
- kzfree(hif_params);
|
||||
+ kfree(hif_params);
|
||||
dev_dbg(priv->dev, "%s\n", __func__);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
Fix double negation of bitmask in dc_ep_icu_disable andwr32_mask.
|
||||
Also add locking to ensure the masking is applied atomically.
|
||||
|
||||
--- a/misc.c
|
||||
+++ b/misc.c
|
||||
@@ -68,12 +68,22 @@ void dc_ep_icu_disable(struct dc_ep_priv
|
||||
|
||||
void dc_ep_icu_dis_intr(struct dc_ep_priv *priv, u32 bits)
|
||||
{
|
||||
- wr32_mask(~bits, 0, ICU_IMER);
|
||||
+ struct dc_aca *aca = to_aca(priv);
|
||||
+ unsigned long flags;
|
||||
+
|
||||
+ spin_lock_irqsave(&aca->icu_lock, flags);
|
||||
+ wr32_mask(bits, 0, ICU_IMER);
|
||||
+ spin_unlock_irqrestore(&aca->icu_lock, flags);
|
||||
}
|
||||
|
||||
void dc_ep_icu_en_intr(struct dc_ep_priv *priv, u32 bits)
|
||||
{
|
||||
+ struct dc_aca *aca = to_aca(priv);
|
||||
+ unsigned long flags;
|
||||
+
|
||||
+ spin_lock_irqsave(&aca->icu_lock, flags);
|
||||
wr32_mask(0, bits, ICU_IMER);
|
||||
+ spin_unlock_irqrestore(&aca->icu_lock, flags);
|
||||
}
|
||||
|
||||
void dc_ep_assert_device(struct dc_ep_priv *priv, u32 bits)
|
||||
--- a/aca.c
|
||||
+++ b/aca.c
|
||||
@@ -1158,6 +1158,7 @@ void dc_aca_info_init(struct dc_ep_priv
|
||||
struct dc_aca *aca = to_aca(priv);
|
||||
|
||||
aca->initialized = false;
|
||||
+ spin_lock_init(&aca->icu_lock);
|
||||
spin_lock_init(&aca->clk_lock);
|
||||
spin_lock_init(&aca->rcu_lock);
|
||||
mutex_init(&aca->pin_lock);
|
||||
--- a/aca.h
|
||||
+++ b/aca.h
|
||||
@@ -470,6 +470,7 @@ struct aca_hif_params {
|
||||
|
||||
struct dc_aca {
|
||||
bool initialized;
|
||||
+ spinlock_t icu_lock;
|
||||
spinlock_t clk_lock;
|
||||
spinlock_t rcu_lock;
|
||||
struct mutex pin_lock;
|
||||
Reference in New Issue
Block a user