generic: mtd: backport SPI_NOR_HAS_LOCK
[openwrt/openwrt.git] / target / linux / layerscape / patches-4.4 / 7153-staging-fsl-mc-Added-MSI-support-to-the-MC-bus-drive.patch
1 From f588a135d9260f2e7fe29b0bb0b5294fc9c99f6c Mon Sep 17 00:00:00 2001
2 From: "J. German Rivera" <German.Rivera@freescale.com>
3 Date: Wed, 6 Jan 2016 16:03:29 -0600
4 Subject: [PATCH 153/226] staging: fsl-mc: Added MSI support to the MC bus
5 driver
6
7 Initialize/Cleanup ITS-MSI support for the MC bus driver at driver
8 init/exit time. Associate an MSI domain with each DPAA2 child device.
9
10 Signed-off-by: J. German Rivera <German.Rivera@freescale.com>
11 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
12 ---
13 drivers/staging/fsl-mc/bus/mc-bus.c | 12 ++++++++++++
14 1 file changed, 12 insertions(+)
15
16 --- a/drivers/staging/fsl-mc/bus/mc-bus.c
17 +++ b/drivers/staging/fsl-mc/bus/mc-bus.c
18 @@ -16,6 +16,8 @@
19 #include <linux/ioport.h>
20 #include <linux/slab.h>
21 #include <linux/limits.h>
22 +#include <linux/bitops.h>
23 +#include <linux/msi.h>
24 #include "../include/dpmng.h"
25 #include "../include/mc-sys.h"
26 #include "dprc-cmd.h"
27 @@ -472,6 +474,8 @@ int fsl_mc_device_add(struct dprc_obj_de
28 mc_dev->icid = parent_mc_dev->icid;
29 mc_dev->dma_mask = FSL_MC_DEFAULT_DMA_MASK;
30 mc_dev->dev.dma_mask = &mc_dev->dma_mask;
31 + dev_set_msi_domain(&mc_dev->dev,
32 + dev_get_msi_domain(&parent_mc_dev->dev));
33 }
34
35 /*
36 @@ -833,8 +837,15 @@ static int __init fsl_mc_bus_driver_init
37 if (error < 0)
38 goto error_cleanup_dprc_driver;
39
40 + error = its_fsl_mc_msi_init();
41 + if (error < 0)
42 + goto error_cleanup_mc_allocator;
43 +
44 return 0;
45
46 +error_cleanup_mc_allocator:
47 + fsl_mc_allocator_driver_exit();
48 +
49 error_cleanup_dprc_driver:
50 dprc_driver_exit();
51
52 @@ -856,6 +867,7 @@ static void __exit fsl_mc_bus_driver_exi
53 if (WARN_ON(!mc_dev_cache))
54 return;
55
56 + its_fsl_mc_msi_cleanup();
57 fsl_mc_allocator_driver_exit();
58 dprc_driver_exit();
59 platform_driver_unregister(&fsl_mc_bus_driver);