diff options
author | Andy Walls <awalls@radix.net> | 2008-11-16 21:33:41 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-12-30 06:38:09 -0500 |
commit | 3f75c6161f28e6a17c547daf552c1127c805c5e7 (patch) | |
tree | 1e4db5013c05946832221bfdca743720091f6582 /drivers/media/video/cx18/cx18-io.c | |
parent | 72a4f8081af1c53a1673c173ce0fdd85c4b7d403 (diff) |
V4L/DVB (9724): cx18: Streamline cx18-io[ch] wrappers and enforce MMIO retry strategy
cx18: Streamline cx18-io[ch] wrappers and enforce MMIO retry strategy so that
write retries always occur and read retries never occur (as they never help).
Remove MMIO statistics logging to speed up MMIO accesses. Deprecate & ignore
retry_mmio and mmio_ndelay module parameters, to essentially force
retry_mmio=1 and mmio_ndelay=0.
Signed-off-by: Andy Walls <awalls@radix.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx18/cx18-io.c')
-rw-r--r-- | drivers/media/video/cx18/cx18-io.c | 128 |
1 files changed, 0 insertions, 128 deletions
diff --git a/drivers/media/video/cx18/cx18-io.c b/drivers/media/video/cx18/cx18-io.c index c67694f63d0e..a2b5e807faca 100644 --- a/drivers/media/video/cx18/cx18-io.c +++ b/drivers/media/video/cx18/cx18-io.c | |||
@@ -31,12 +31,6 @@ void cx18_log_statistics(struct cx18 *cx) | |||
31 | if (!(cx18_debug & CX18_DBGFLG_INFO)) | 31 | if (!(cx18_debug & CX18_DBGFLG_INFO)) |
32 | return; | 32 | return; |
33 | 33 | ||
34 | for (i = 0; i <= CX18_MAX_MMIO_WR_RETRIES; i++) | ||
35 | CX18_DEBUG_INFO("retried_write[%d] = %d\n", i, | ||
36 | atomic_read(&cx->mmio_stats.retried_write[i])); | ||
37 | for (i = 0; i <= CX18_MAX_MMIO_RD_RETRIES; i++) | ||
38 | CX18_DEBUG_INFO("retried_read[%d] = %d\n", i, | ||
39 | atomic_read(&cx->mmio_stats.retried_read[i])); | ||
40 | for (i = 0; i <= CX18_MAX_MB_ACK_DELAY; i++) | 34 | for (i = 0; i <= CX18_MAX_MB_ACK_DELAY; i++) |
41 | if (atomic_read(&cx->mbox_stats.mb_ack_delay[i])) | 35 | if (atomic_read(&cx->mbox_stats.mb_ack_delay[i])) |
42 | CX18_DEBUG_INFO("mb_ack_delay[%d] = %d\n", i, | 36 | CX18_DEBUG_INFO("mb_ack_delay[%d] = %d\n", i, |
@@ -44,128 +38,6 @@ void cx18_log_statistics(struct cx18 *cx) | |||
44 | return; | 38 | return; |
45 | } | 39 | } |
46 | 40 | ||
47 | void cx18_raw_writel_retry(struct cx18 *cx, u32 val, void __iomem *addr) | ||
48 | { | ||
49 | int i; | ||
50 | for (i = 0; i < CX18_MAX_MMIO_WR_RETRIES; i++) { | ||
51 | cx18_raw_writel_noretry(cx, val, addr); | ||
52 | if (val == cx18_raw_readl_noretry(cx, addr)) | ||
53 | break; | ||
54 | } | ||
55 | cx18_log_write_retries(cx, i, addr); | ||
56 | } | ||
57 | |||
58 | u32 cx18_raw_readl_retry(struct cx18 *cx, const void __iomem *addr) | ||
59 | { | ||
60 | int i; | ||
61 | u32 val; | ||
62 | for (i = 0; i < CX18_MAX_MMIO_RD_RETRIES; i++) { | ||
63 | val = cx18_raw_readl_noretry(cx, addr); | ||
64 | if (val != 0xffffffff) /* PCI bus read error */ | ||
65 | break; | ||
66 | } | ||
67 | cx18_log_read_retries(cx, i, addr); | ||
68 | return val; | ||
69 | } | ||
70 | |||
71 | u16 cx18_raw_readw_retry(struct cx18 *cx, const void __iomem *addr) | ||
72 | { | ||
73 | int i; | ||
74 | u16 val; | ||
75 | for (i = 0; i < CX18_MAX_MMIO_RD_RETRIES; i++) { | ||
76 | val = cx18_raw_readw_noretry(cx, addr); | ||
77 | if (val != 0xffff) /* PCI bus read error */ | ||
78 | break; | ||
79 | } | ||
80 | cx18_log_read_retries(cx, i, addr); | ||
81 | return val; | ||
82 | } | ||
83 | |||
84 | void cx18_writel_retry(struct cx18 *cx, u32 val, void __iomem *addr) | ||
85 | { | ||
86 | int i; | ||
87 | for (i = 0; i < CX18_MAX_MMIO_WR_RETRIES; i++) { | ||
88 | cx18_writel_noretry(cx, val, addr); | ||
89 | if (val == cx18_readl_noretry(cx, addr)) | ||
90 | break; | ||
91 | } | ||
92 | cx18_log_write_retries(cx, i, addr); | ||
93 | } | ||
94 | |||
95 | void _cx18_writel_expect(struct cx18 *cx, u32 val, void __iomem *addr, | ||
96 | u32 eval, u32 mask) | ||
97 | { | ||
98 | int i; | ||
99 | eval &= mask; | ||
100 | for (i = 0; i < CX18_MAX_MMIO_WR_RETRIES; i++) { | ||
101 | cx18_writel_noretry(cx, val, addr); | ||
102 | if (eval == (cx18_readl_noretry(cx, addr) & mask)) | ||
103 | break; | ||
104 | } | ||
105 | cx18_log_write_retries(cx, i, addr); | ||
106 | } | ||
107 | |||
108 | void cx18_writew_retry(struct cx18 *cx, u16 val, void __iomem *addr) | ||
109 | { | ||
110 | int i; | ||
111 | for (i = 0; i < CX18_MAX_MMIO_WR_RETRIES; i++) { | ||
112 | cx18_writew_noretry(cx, val, addr); | ||
113 | if (val == cx18_readw_noretry(cx, addr)) | ||
114 | break; | ||
115 | } | ||
116 | cx18_log_write_retries(cx, i, addr); | ||
117 | } | ||
118 | |||
119 | void cx18_writeb_retry(struct cx18 *cx, u8 val, void __iomem *addr) | ||
120 | { | ||
121 | int i; | ||
122 | for (i = 0; i < CX18_MAX_MMIO_WR_RETRIES; i++) { | ||
123 | cx18_writeb_noretry(cx, val, addr); | ||
124 | if (val == cx18_readb_noretry(cx, addr)) | ||
125 | break; | ||
126 | } | ||
127 | cx18_log_write_retries(cx, i, addr); | ||
128 | } | ||
129 | |||
130 | u32 cx18_readl_retry(struct cx18 *cx, const void __iomem *addr) | ||
131 | { | ||
132 | int i; | ||
133 | u32 val; | ||
134 | for (i = 0; i < CX18_MAX_MMIO_RD_RETRIES; i++) { | ||
135 | val = cx18_readl_noretry(cx, addr); | ||
136 | if (val != 0xffffffff) /* PCI bus read error */ | ||
137 | break; | ||
138 | } | ||
139 | cx18_log_read_retries(cx, i, addr); | ||
140 | return val; | ||
141 | } | ||
142 | |||
143 | u16 cx18_readw_retry(struct cx18 *cx, const void __iomem *addr) | ||
144 | { | ||
145 | int i; | ||
146 | u16 val; | ||
147 | for (i = 0; i < CX18_MAX_MMIO_RD_RETRIES; i++) { | ||
148 | val = cx18_readw_noretry(cx, addr); | ||
149 | if (val != 0xffff) /* PCI bus read error */ | ||
150 | break; | ||
151 | } | ||
152 | cx18_log_read_retries(cx, i, addr); | ||
153 | return val; | ||
154 | } | ||
155 | |||
156 | u8 cx18_readb_retry(struct cx18 *cx, const void __iomem *addr) | ||
157 | { | ||
158 | int i; | ||
159 | u8 val; | ||
160 | for (i = 0; i < CX18_MAX_MMIO_RD_RETRIES; i++) { | ||
161 | val = cx18_readb_noretry(cx, addr); | ||
162 | if (val != 0xff) /* PCI bus read error */ | ||
163 | break; | ||
164 | } | ||
165 | cx18_log_read_retries(cx, i, addr); | ||
166 | return val; | ||
167 | } | ||
168 | |||
169 | void cx18_memset_io(struct cx18 *cx, void __iomem *addr, int val, size_t count) | 41 | void cx18_memset_io(struct cx18 *cx, void __iomem *addr, int val, size_t count) |
170 | { | 42 | { |
171 | u8 __iomem *dst = addr; | 43 | u8 __iomem *dst = addr; |