From c31fcf9765a6c3b7e7aef306d2045ecee16df5a9 Mon Sep 17 00:00:00 2001 From: Alex Deryskyba Date: Thu, 22 Jan 2015 14:58:32 +0100 Subject: [PATCH] projects/WeTek_Play/patches/linux: Add a kernel patch to switch IRQ handling for Ethernet, USB and SDIO from CPU0 to CPU1 --- .../linux/130-switch_irq_to_CPU1.patch | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 projects/WeTek_Play/patches/linux/130-switch_irq_to_CPU1.patch diff --git a/projects/WeTek_Play/patches/linux/130-switch_irq_to_CPU1.patch b/projects/WeTek_Play/patches/linux/130-switch_irq_to_CPU1.patch new file mode 100644 index 0000000000..24c139de96 --- /dev/null +++ b/projects/WeTek_Play/patches/linux/130-switch_irq_to_CPU1.patch @@ -0,0 +1,75 @@ +diff -Naur a/drivers/amlogic/ethernet/am_net8218.c b/drivers/amlogic/ethernet/am_net8218.c +--- a/drivers/amlogic/ethernet/am_net8218.c 2015-01-04 18:07:58.000000000 +0100 ++++ b/drivers/amlogic/ethernet/am_net8218.c 2015-01-20 23:44:29.000000000 +0100 +@@ -1251,6 +1251,11 @@ + goto out_err; + } + ++ if (irq_set_affinity(dev->irq, cpumask_of(1))) { ++ printk(KERN_DEBUG "unable to set irq affinity (irq=%d, cpu=%u)\n", ++ dev->irq, 1); ++ } ++ + if (g_debug > 0) + printk(KERN_DEBUG "%s: opened (irq %d).\n", + dev->name, dev->irq); +diff -Naur a/drivers/amlogic/mmc/aml_sdio.c b/drivers/amlogic/mmc/aml_sdio.c +--- a/drivers/amlogic/mmc/aml_sdio.c 2015-01-04 18:07:58.000000000 +0100 ++++ b/drivers/amlogic/mmc/aml_sdio.c 2015-01-21 00:05:08.000000000 +0100 +@@ -1267,6 +1267,11 @@ + return NULL; + } + ++ if (irq_set_affinity(INT_SDIO, cpumask_of(1))) { ++ printk(KERN_DEBUG "unable to set irq affinity (irq=%d, cpu=%u)\n", ++ INT_SDIO, 1); ++ } ++ + host->bn_buf = dma_alloc_coherent(NULL, SDIO_BOUNCE_REQ_SIZE, + &host->bn_dma_buf, GFP_KERNEL); + if(NULL == host->bn_buf){ +diff -Naur a/drivers/amlogic/usb/dwc_otg/310/dwc_otg_driver.c b/drivers/amlogic/usb/dwc_otg/310/dwc_otg_driver.c +--- a/drivers/amlogic/usb/dwc_otg/310/dwc_otg_driver.c 2015-01-04 18:07:58.000000000 +0100 ++++ b/drivers/amlogic/usb/dwc_otg/310/dwc_otg_driver.c 2015-01-20 18:02:40.000000000 +0100 +@@ -1202,7 +1202,10 @@ + } else { + dwc_otg_device->common_irq_installed = 1; + } +- ++ if (irq_set_affinity(_dev->irq, cpumask_of(1))) { ++ pr_warning("unable to set irq affinity (irq=%d, cpu=%u)\n", ++ _dev->irq, 1); ++ } + #ifdef LM_INTERFACE + // set_irq_type(_dev->irq, IRQT_LOW); + #endif +diff -Naur a/drivers/amlogic/usb/dwc_otg/310/dwc_otg_hcd_linux.c b/drivers/amlogic/usb/dwc_otg/310/dwc_otg_hcd_linux.c +--- a/drivers/amlogic/usb/dwc_otg/310/dwc_otg_hcd_linux.c 2015-01-04 18:07:58.000000000 +0100 ++++ b/drivers/amlogic/usb/dwc_otg/310/dwc_otg_hcd_linux.c 2015-01-20 18:06:35.000000000 +0100 +@@ -610,7 +610,11 @@ + if (retval < 0) { + goto error2; + } +- ++ if (irq_set_affinity(_dev->irq, cpumask_of(1))) { ++ pr_warning("unable to set irq affinity (irq=%d, cpu=%u)\n", ++ _dev->irq, 1); ++ } ++ + dwc_otg_hcd_set_priv_data(dwc_otg_hcd, hcd); + return 0; + +diff -Naur a/drivers/amlogic/usb/dwc_otg/310/dwc_otg_pcd_linux.c b/drivers/amlogic/usb/dwc_otg/310/dwc_otg_pcd_linux.c +--- a/drivers/amlogic/usb/dwc_otg/310/dwc_otg_pcd_linux.c 2015-01-04 18:07:58.000000000 +0100 ++++ b/drivers/amlogic/usb/dwc_otg/310/dwc_otg_pcd_linux.c 2015-01-20 18:03:14.000000000 +0100 +@@ -1290,6 +1290,10 @@ + return -EBUSY; + } + ++ if (irq_set_affinity(_dev->irq, cpumask_of(1))) { ++ pr_warning("unable to set irq affinity (irq=%d, cpu=%u)\n", ++ _dev->irq, 1); ++ } + dwc_otg_pcd_start(gadget_wrapper->pcd, &fops); + + return retval;