]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/3.1.5/arm-omap-hwmod-fix-the-addr-space-irq-dma-count-apis.patch
Linux 5.1.6
[thirdparty/kernel/stable-queue.git] / releases / 3.1.5 / arm-omap-hwmod-fix-the-addr-space-irq-dma-count-apis.patch
1 From cc1b0765da6078b906772b79ff211b88cc0ae958 Mon Sep 17 00:00:00 2001
2 From: sricharan <r.sricharan@ti.com>
3 Date: Wed, 23 Nov 2011 14:35:07 -0800
4 Subject: ARM: OMAP: hwmod: Fix the addr space, irq, dma count APIs
5
6 From: sricharan <r.sricharan@ti.com>
7
8 commit cc1b0765da6078b906772b79ff211b88cc0ae958 upstream.
9
10 The address spaces, irqs and dma reqs count APIs return the
11 number of corresponding entries in a hwmod including a additional
12 null value or a -1 terminator in the structure introduced recently.
13 More information here:
14
15 - 212738a4: omap_hwmod: use a terminator record with omap_hwmod_mpu_irqs
16 arrays
17
18 - 78183f3f: omap_hwmod: use a null structure record to terminate
19 omap_hwmod_addr_space arrays
20
21 - bc614958: omap_hwmod: use a terminator record with omap_hwmod_dma_info
22 arrays
23
24 The issue with irqs and dma info was originally reported by Benoit Cousson.
25
26 The devices which have multiple hwmods and use device_build_ss are
27 broken with this, as their resources are populated with a extra null
28 value, subsequently the probe fails. So fix the API not to include
29 the array terminator in the count.
30
31 Reported-by: Benoit Cousson <b-cousson@ti.com>
32 Signed-off-by: Santosh Shilimkar <santosh.shilimar@ti.com>
33 Signed-off-by: sricharan <r.sricharan@ti.com>
34 Signed-off-by: Benoit Cousson <b-cousson@ti.com>
35 Cc: Paul Walmsley <paul@pwsan.com>
36 Signed-off-by: Tony Lindgren <tony@atomide.com>
37 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
38
39 ---
40 arch/arm/mach-omap2/omap_hwmod.c | 6 +++---
41 1 file changed, 3 insertions(+), 3 deletions(-)
42
43 --- a/arch/arm/mach-omap2/omap_hwmod.c
44 +++ b/arch/arm/mach-omap2/omap_hwmod.c
45 @@ -749,7 +749,7 @@ static int _count_mpu_irqs(struct omap_h
46 ohii = &oh->mpu_irqs[i++];
47 } while (ohii->irq != -1);
48
49 - return i;
50 + return i-1;
51 }
52
53 /**
54 @@ -772,7 +772,7 @@ static int _count_sdma_reqs(struct omap_
55 ohdi = &oh->sdma_reqs[i++];
56 } while (ohdi->dma_req != -1);
57
58 - return i;
59 + return i-1;
60 }
61
62 /**
63 @@ -795,7 +795,7 @@ static int _count_ocp_if_addr_spaces(str
64 mem = &os->addr[i++];
65 } while (mem->pa_start != mem->pa_end);
66
67 - return i;
68 + return i-1;
69 }
70
71 /**