diff options
157 files changed, 1477 insertions, 694 deletions
diff --git a/Documentation/PCI/PCI-DMA-mapping.txt b/Documentation/DMA-API-HOWTO.txt index 52618ab069ad..52618ab069ad 100644 --- a/Documentation/PCI/PCI-DMA-mapping.txt +++ b/Documentation/DMA-API-HOWTO.txt | |||
diff --git a/Documentation/cgroups/memory.txt b/Documentation/cgroups/memory.txt index f8bc802d70b9..3a6aecd078ba 100644 --- a/Documentation/cgroups/memory.txt +++ b/Documentation/cgroups/memory.txt | |||
@@ -340,7 +340,7 @@ Note: | |||
340 | 5.3 swappiness | 340 | 5.3 swappiness |
341 | Similar to /proc/sys/vm/swappiness, but affecting a hierarchy of groups only. | 341 | Similar to /proc/sys/vm/swappiness, but affecting a hierarchy of groups only. |
342 | 342 | ||
343 | Following cgroups' swapiness can't be changed. | 343 | Following cgroups' swappiness can't be changed. |
344 | - root cgroup (uses /proc/sys/vm/swappiness). | 344 | - root cgroup (uses /proc/sys/vm/swappiness). |
345 | - a cgroup which uses hierarchy and it has child cgroup. | 345 | - a cgroup which uses hierarchy and it has child cgroup. |
346 | - a cgroup which uses hierarchy and not the root of hierarchy. | 346 | - a cgroup which uses hierarchy and not the root of hierarchy. |
diff --git a/Documentation/circular-buffers.txt b/Documentation/circular-buffers.txt new file mode 100644 index 000000000000..8117e5bf6065 --- /dev/null +++ b/Documentation/circular-buffers.txt | |||
@@ -0,0 +1,234 @@ | |||
1 | ================ | ||
2 | CIRCULAR BUFFERS | ||
3 | ================ | ||
4 | |||
5 | By: David Howells <dhowells@redhat.com> | ||
6 | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | ||
7 | |||
8 | |||
9 | Linux provides a number of features that can be used to implement circular | ||
10 | buffering. There are two sets of such features: | ||
11 | |||
12 | (1) Convenience functions for determining information about power-of-2 sized | ||
13 | buffers. | ||
14 | |||
15 | (2) Memory barriers for when the producer and the consumer of objects in the | ||
16 | buffer don't want to share a lock. | ||
17 | |||
18 | To use these facilities, as discussed below, there needs to be just one | ||
19 | producer and just one consumer. It is possible to handle multiple producers by | ||
20 | serialising them, and to handle multiple consumers by serialising them. | ||
21 | |||
22 | |||
23 | Contents: | ||
24 | |||
25 | (*) What is a circular buffer? | ||
26 | |||
27 | (*) Measuring power-of-2 buffers. | ||
28 | |||
29 | (*) Using memory barriers with circular buffers. | ||
30 | - The producer. | ||
31 | - The consumer. | ||
32 | |||
33 | |||
34 | ========================== | ||
35 | WHAT IS A CIRCULAR BUFFER? | ||
36 | ========================== | ||
37 | |||
38 | First of all, what is a circular buffer? A circular buffer is a buffer of | ||
39 | fixed, finite size into which there are two indices: | ||
40 | |||
41 | (1) A 'head' index - the point at which the producer inserts items into the | ||
42 | buffer. | ||
43 | |||
44 | (2) A 'tail' index - the point at which the consumer finds the next item in | ||
45 | the buffer. | ||
46 | |||
47 | Typically when the tail pointer is equal to the head pointer, the buffer is | ||
48 | empty; and the buffer is full when the head pointer is one less than the tail | ||
49 | pointer. | ||
50 | |||
51 | The head index is incremented when items are added, and the tail index when | ||
52 | items are removed. The tail index should never jump the head index, and both | ||
53 | indices should be wrapped to 0 when they reach the end of the buffer, thus | ||
54 | allowing an infinite amount of data to flow through the buffer. | ||
55 | |||
56 | Typically, items will all be of the same unit size, but this isn't strictly | ||
57 | required to use the techniques below. The indices can be increased by more | ||
58 | than 1 if multiple items or variable-sized items are to be included in the | ||
59 | buffer, provided that neither index overtakes the other. The implementer must | ||
60 | be careful, however, as a region more than one unit in size may wrap the end of | ||
61 | the buffer and be broken into two segments. | ||
62 | |||
63 | |||
64 | ============================ | ||
65 | MEASURING POWER-OF-2 BUFFERS | ||
66 | ============================ | ||
67 | |||
68 | Calculation of the occupancy or the remaining capacity of an arbitrarily sized | ||
69 | circular buffer would normally be a slow operation, requiring the use of a | ||
70 | modulus (divide) instruction. However, if the buffer is of a power-of-2 size, | ||
71 | then a much quicker bitwise-AND instruction can be used instead. | ||
72 | |||
73 | Linux provides a set of macros for handling power-of-2 circular buffers. These | ||
74 | can be made use of by: | ||
75 | |||
76 | #include <linux/circ_buf.h> | ||
77 | |||
78 | The macros are: | ||
79 | |||
80 | (*) Measure the remaining capacity of a buffer: | ||
81 | |||
82 | CIRC_SPACE(head_index, tail_index, buffer_size); | ||
83 | |||
84 | This returns the amount of space left in the buffer[1] into which items | ||
85 | can be inserted. | ||
86 | |||
87 | |||
88 | (*) Measure the maximum consecutive immediate space in a buffer: | ||
89 | |||
90 | CIRC_SPACE_TO_END(head_index, tail_index, buffer_size); | ||
91 | |||
92 | This returns the amount of consecutive space left in the buffer[1] into | ||
93 | which items can be immediately inserted without having to wrap back to the | ||
94 | beginning of the buffer. | ||
95 | |||
96 | |||
97 | (*) Measure the occupancy of a buffer: | ||
98 | |||
99 | CIRC_CNT(head_index, tail_index, buffer_size); | ||
100 | |||
101 | This returns the number of items currently occupying a buffer[2]. | ||
102 | |||
103 | |||
104 | (*) Measure the non-wrapping occupancy of a buffer: | ||
105 | |||
106 | CIRC_CNT_TO_END(head_index, tail_index, buffer_size); | ||
107 | |||
108 | This returns the number of consecutive items[2] that can be extracted from | ||
109 | the buffer without having to wrap back to the beginning of the buffer. | ||
110 | |||
111 | |||
112 | Each of these macros will nominally return a value between 0 and buffer_size-1, | ||
113 | however: | ||
114 | |||
115 | [1] CIRC_SPACE*() are intended to be used in the producer. To the producer | ||
116 | they will return a lower bound as the producer controls the head index, | ||
117 | but the consumer may still be depleting the buffer on another CPU and | ||
118 | moving the tail index. | ||
119 | |||
120 | To the consumer it will show an upper bound as the producer may be busy | ||
121 | depleting the space. | ||
122 | |||
123 | [2] CIRC_CNT*() are intended to be used in the consumer. To the consumer they | ||
124 | will return a lower bound as the consumer controls the tail index, but the | ||
125 | producer may still be filling the buffer on another CPU and moving the | ||
126 | head index. | ||
127 | |||
128 | To the producer it will show an upper bound as the consumer may be busy | ||
129 | emptying the buffer. | ||
130 | |||
131 | [3] To a third party, the order in which the writes to the indices by the | ||
132 | producer and consumer become visible cannot be guaranteed as they are | ||
133 | independent and may be made on different CPUs - so the result in such a | ||
134 | situation will merely be a guess, and may even be negative. | ||
135 | |||
136 | |||
137 | =========================================== | ||
138 | USING MEMORY BARRIERS WITH CIRCULAR BUFFERS | ||
139 | =========================================== | ||
140 | |||
141 | By using memory barriers in conjunction with circular buffers, you can avoid | ||
142 | the need to: | ||
143 | |||
144 | (1) use a single lock to govern access to both ends of the buffer, thus | ||
145 | allowing the buffer to be filled and emptied at the same time; and | ||
146 | |||
147 | (2) use atomic counter operations. | ||
148 | |||
149 | There are two sides to this: the producer that fills the buffer, and the | ||
150 | consumer that empties it. Only one thing should be filling a buffer at any one | ||
151 | time, and only one thing should be emptying a buffer at any one time, but the | ||
152 | two sides can operate simultaneously. | ||
153 | |||
154 | |||
155 | THE PRODUCER | ||
156 | ------------ | ||
157 | |||
158 | The producer will look something like this: | ||
159 | |||
160 | spin_lock(&producer_lock); | ||
161 | |||
162 | unsigned long head = buffer->head; | ||
163 | unsigned long tail = ACCESS_ONCE(buffer->tail); | ||
164 | |||
165 | if (CIRC_SPACE(head, tail, buffer->size) >= 1) { | ||
166 | /* insert one item into the buffer */ | ||
167 | struct item *item = buffer[head]; | ||
168 | |||
169 | produce_item(item); | ||
170 | |||
171 | smp_wmb(); /* commit the item before incrementing the head */ | ||
172 | |||
173 | buffer->head = (head + 1) & (buffer->size - 1); | ||
174 | |||
175 | /* wake_up() will make sure that the head is committed before | ||
176 | * waking anyone up */ | ||
177 | wake_up(consumer); | ||
178 | } | ||
179 | |||
180 | spin_unlock(&producer_lock); | ||
181 | |||
182 | This will instruct the CPU that the contents of the new item must be written | ||
183 | before the head index makes it available to the consumer and then instructs the | ||
184 | CPU that the revised head index must be written before the consumer is woken. | ||
185 | |||
186 | Note that wake_up() doesn't have to be the exact mechanism used, but whatever | ||
187 | is used must guarantee a (write) memory barrier between the update of the head | ||
188 | index and the change of state of the consumer, if a change of state occurs. | ||
189 | |||
190 | |||
191 | THE CONSUMER | ||
192 | ------------ | ||
193 | |||
194 | The consumer will look something like this: | ||
195 | |||
196 | spin_lock(&consumer_lock); | ||
197 | |||
198 | unsigned long head = ACCESS_ONCE(buffer->head); | ||
199 | unsigned long tail = buffer->tail; | ||
200 | |||
201 | if (CIRC_CNT(head, tail, buffer->size) >= 1) { | ||
202 | /* read index before reading contents at that index */ | ||
203 | smp_read_barrier_depends(); | ||
204 | |||
205 | /* extract one item from the buffer */ | ||
206 | struct item *item = buffer[tail]; | ||
207 | |||
208 | consume_item(item); | ||
209 | |||
210 | smp_mb(); /* finish reading descriptor before incrementing tail */ | ||
211 | |||
212 | buffer->tail = (tail + 1) & (buffer->size - 1); | ||
213 | } | ||
214 | |||
215 | spin_unlock(&consumer_lock); | ||
216 | |||
217 | This will instruct the CPU to make sure the index is up to date before reading | ||
218 | the new item, and then it shall make sure the CPU has finished reading the item | ||
219 | before it writes the new tail pointer, which will erase the item. | ||
220 | |||
221 | |||
222 | Note the use of ACCESS_ONCE() in both algorithms to read the opposition index. | ||
223 | This prevents the compiler from discarding and reloading its cached value - | ||
224 | which some compilers will do across smp_read_barrier_depends(). This isn't | ||
225 | strictly needed if you can be sure that the opposition index will _only_ be | ||
226 | used the once. | ||
227 | |||
228 | |||
229 | =============== | ||
230 | FURTHER READING | ||
231 | =============== | ||
232 | |||
233 | See also Documentation/memory-barriers.txt for a description of Linux's memory | ||
234 | barrier facilities. | ||
diff --git a/Documentation/filesystems/tmpfs.txt b/Documentation/filesystems/tmpfs.txt index 3015da0c6b2a..fe09a2cb1858 100644 --- a/Documentation/filesystems/tmpfs.txt +++ b/Documentation/filesystems/tmpfs.txt | |||
@@ -82,11 +82,13 @@ tmpfs has a mount option to set the NUMA memory allocation policy for | |||
82 | all files in that instance (if CONFIG_NUMA is enabled) - which can be | 82 | all files in that instance (if CONFIG_NUMA is enabled) - which can be |
83 | adjusted on the fly via 'mount -o remount ...' | 83 | adjusted on the fly via 'mount -o remount ...' |
84 | 84 | ||
85 | mpol=default prefers to allocate memory from the local node | 85 | mpol=default use the process allocation policy |
86 | (see set_mempolicy(2)) | ||
86 | mpol=prefer:Node prefers to allocate memory from the given Node | 87 | mpol=prefer:Node prefers to allocate memory from the given Node |
87 | mpol=bind:NodeList allocates memory only from nodes in NodeList | 88 | mpol=bind:NodeList allocates memory only from nodes in NodeList |
88 | mpol=interleave prefers to allocate from each node in turn | 89 | mpol=interleave prefers to allocate from each node in turn |
89 | mpol=interleave:NodeList allocates from each node of NodeList in turn | 90 | mpol=interleave:NodeList allocates from each node of NodeList in turn |
91 | mpol=local prefers to allocate memory from the local node | ||
90 | 92 | ||
91 | NodeList format is a comma-separated list of decimal numbers and ranges, | 93 | NodeList format is a comma-separated list of decimal numbers and ranges, |
92 | a range being two hyphen-separated decimal numbers, the smallest and | 94 | a range being two hyphen-separated decimal numbers, the smallest and |
@@ -134,3 +136,5 @@ Author: | |||
134 | Christoph Rohland <cr@sap.com>, 1.12.01 | 136 | Christoph Rohland <cr@sap.com>, 1.12.01 |
135 | Updated: | 137 | Updated: |
136 | Hugh Dickins, 4 June 2007 | 138 | Hugh Dickins, 4 June 2007 |
139 | Updated: | ||
140 | KOSAKI Motohiro, 16 Mar 2010 | ||
diff --git a/Documentation/memory-barriers.txt b/Documentation/memory-barriers.txt index 7f5809eddee6..631ad2f1b229 100644 --- a/Documentation/memory-barriers.txt +++ b/Documentation/memory-barriers.txt | |||
@@ -3,6 +3,7 @@ | |||
3 | ============================ | 3 | ============================ |
4 | 4 | ||
5 | By: David Howells <dhowells@redhat.com> | 5 | By: David Howells <dhowells@redhat.com> |
6 | Paul E. McKenney <paulmck@linux.vnet.ibm.com> | ||
6 | 7 | ||
7 | Contents: | 8 | Contents: |
8 | 9 | ||
@@ -60,6 +61,10 @@ Contents: | |||
60 | 61 | ||
61 | - And then there's the Alpha. | 62 | - And then there's the Alpha. |
62 | 63 | ||
64 | (*) Example uses. | ||
65 | |||
66 | - Circular buffers. | ||
67 | |||
63 | (*) References. | 68 | (*) References. |
64 | 69 | ||
65 | 70 | ||
@@ -2226,6 +2231,21 @@ The Alpha defines the Linux kernel's memory barrier model. | |||
2226 | See the subsection on "Cache Coherency" above. | 2231 | See the subsection on "Cache Coherency" above. |
2227 | 2232 | ||
2228 | 2233 | ||
2234 | ============ | ||
2235 | EXAMPLE USES | ||
2236 | ============ | ||
2237 | |||
2238 | CIRCULAR BUFFERS | ||
2239 | ---------------- | ||
2240 | |||
2241 | Memory barriers can be used to implement circular buffering without the need | ||
2242 | of a lock to serialise the producer with the consumer. See: | ||
2243 | |||
2244 | Documentation/circular-buffers.txt | ||
2245 | |||
2246 | for details. | ||
2247 | |||
2248 | |||
2229 | ========== | 2249 | ========== |
2230 | REFERENCES | 2250 | REFERENCES |
2231 | ========== | 2251 | ========== |
diff --git a/Documentation/volatile-considered-harmful.txt b/Documentation/volatile-considered-harmful.txt index 991c26a6ef64..db0cb228d64a 100644 --- a/Documentation/volatile-considered-harmful.txt +++ b/Documentation/volatile-considered-harmful.txt | |||
@@ -63,9 +63,9 @@ way to perform a busy wait is: | |||
63 | cpu_relax(); | 63 | cpu_relax(); |
64 | 64 | ||
65 | The cpu_relax() call can lower CPU power consumption or yield to a | 65 | The cpu_relax() call can lower CPU power consumption or yield to a |
66 | hyperthreaded twin processor; it also happens to serve as a memory barrier, | 66 | hyperthreaded twin processor; it also happens to serve as a compiler |
67 | so, once again, volatile is unnecessary. Of course, busy-waiting is | 67 | barrier, so, once again, volatile is unnecessary. Of course, busy- |
68 | generally an anti-social act to begin with. | 68 | waiting is generally an anti-social act to begin with. |
69 | 69 | ||
70 | There are still a few rare situations where volatile makes sense in the | 70 | There are still a few rare situations where volatile makes sense in the |
71 | kernel: | 71 | kernel: |
diff --git a/MAINTAINERS b/MAINTAINERS index 449d44402083..fbc3d653d52b 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -797,12 +797,12 @@ M: Michael Petchkovsky <mkpetch@internode.on.net> | |||
797 | S: Maintained | 797 | S: Maintained |
798 | 798 | ||
799 | ARM/NOMADIK ARCHITECTURE | 799 | ARM/NOMADIK ARCHITECTURE |
800 | M: Alessandro Rubini <rubini@unipv.it> | 800 | M: Alessandro Rubini <rubini@unipv.it> |
801 | M: STEricsson <STEricsson_nomadik_linux@list.st.com> | 801 | M: STEricsson <STEricsson_nomadik_linux@list.st.com> |
802 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) | 802 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) |
803 | S: Maintained | 803 | S: Maintained |
804 | F: arch/arm/mach-nomadik/ | 804 | F: arch/arm/mach-nomadik/ |
805 | F: arch/arm/plat-nomadik/ | 805 | F: arch/arm/plat-nomadik/ |
806 | 806 | ||
807 | ARM/OPENMOKO NEO FREERUNNER (GTA02) MACHINE SUPPORT | 807 | ARM/OPENMOKO NEO FREERUNNER (GTA02) MACHINE SUPPORT |
808 | M: Nelson Castillo <arhuaco@freaks-unidos.net> | 808 | M: Nelson Castillo <arhuaco@freaks-unidos.net> |
@@ -1926,17 +1926,17 @@ F: drivers/scsi/dpt* | |||
1926 | F: drivers/scsi/dpt/ | 1926 | F: drivers/scsi/dpt/ |
1927 | 1927 | ||
1928 | DRBD DRIVER | 1928 | DRBD DRIVER |
1929 | P: Philipp Reisner | 1929 | P: Philipp Reisner |
1930 | P: Lars Ellenberg | 1930 | P: Lars Ellenberg |
1931 | M: drbd-dev@lists.linbit.com | 1931 | M: drbd-dev@lists.linbit.com |
1932 | L: drbd-user@lists.linbit.com | 1932 | L: drbd-user@lists.linbit.com |
1933 | W: http://www.drbd.org | 1933 | W: http://www.drbd.org |
1934 | T: git git://git.drbd.org/linux-2.6-drbd.git drbd | 1934 | T: git git://git.drbd.org/linux-2.6-drbd.git drbd |
1935 | T: git git://git.drbd.org/drbd-8.3.git | 1935 | T: git git://git.drbd.org/drbd-8.3.git |
1936 | S: Supported | 1936 | S: Supported |
1937 | F: drivers/block/drbd/ | 1937 | F: drivers/block/drbd/ |
1938 | F: lib/lru_cache.c | 1938 | F: lib/lru_cache.c |
1939 | F: Documentation/blockdev/drbd/ | 1939 | F: Documentation/blockdev/drbd/ |
1940 | 1940 | ||
1941 | DRIVER CORE, KOBJECTS, AND SYSFS | 1941 | DRIVER CORE, KOBJECTS, AND SYSFS |
1942 | M: Greg Kroah-Hartman <gregkh@suse.de> | 1942 | M: Greg Kroah-Hartman <gregkh@suse.de> |
@@ -3518,8 +3518,8 @@ F: drivers/scsi/sym53c8xx_2/ | |||
3518 | LTP (Linux Test Project) | 3518 | LTP (Linux Test Project) |
3519 | M: Rishikesh K Rajak <risrajak@linux.vnet.ibm.com> | 3519 | M: Rishikesh K Rajak <risrajak@linux.vnet.ibm.com> |
3520 | M: Garrett Cooper <yanegomi@gmail.com> | 3520 | M: Garrett Cooper <yanegomi@gmail.com> |
3521 | M: Mike Frysinger <vapier@gentoo.org> | 3521 | M: Mike Frysinger <vapier@gentoo.org> |
3522 | M: Subrata Modak <subrata@linux.vnet.ibm.com> | 3522 | M: Subrata Modak <subrata@linux.vnet.ibm.com> |
3523 | L: ltp-list@lists.sourceforge.net (subscribers-only) | 3523 | L: ltp-list@lists.sourceforge.net (subscribers-only) |
3524 | W: http://ltp.sourceforge.net/ | 3524 | W: http://ltp.sourceforge.net/ |
3525 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/galak/ltp.git | 3525 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/galak/ltp.git |
@@ -6201,7 +6201,7 @@ F: arch/x86/ | |||
6201 | X86 PLATFORM DRIVERS | 6201 | X86 PLATFORM DRIVERS |
6202 | M: Matthew Garrett <mjg@redhat.com> | 6202 | M: Matthew Garrett <mjg@redhat.com> |
6203 | L: platform-driver-x86@vger.kernel.org | 6203 | L: platform-driver-x86@vger.kernel.org |
6204 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/mjg59/platform-drivers-x86.git | 6204 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/mjg59/platform-drivers-x86.git |
6205 | S: Maintained | 6205 | S: Maintained |
6206 | F: drivers/platform/x86 | 6206 | F: drivers/platform/x86 |
6207 | 6207 | ||
diff --git a/arch/s390/boot/compressed/misc.c b/arch/s390/boot/compressed/misc.c index a97d69525829..14e0479d3888 100644 --- a/arch/s390/boot/compressed/misc.c +++ b/arch/s390/boot/compressed/misc.c | |||
@@ -24,8 +24,8 @@ | |||
24 | /* Symbols defined by linker scripts */ | 24 | /* Symbols defined by linker scripts */ |
25 | extern char input_data[]; | 25 | extern char input_data[]; |
26 | extern int input_len; | 26 | extern int input_len; |
27 | extern int _text; | 27 | extern char _text, _end; |
28 | extern int _end; | 28 | extern char _bss, _ebss; |
29 | 29 | ||
30 | static void error(char *m); | 30 | static void error(char *m); |
31 | 31 | ||
@@ -129,12 +129,12 @@ unsigned long decompress_kernel(void) | |||
129 | unsigned long output_addr; | 129 | unsigned long output_addr; |
130 | unsigned char *output; | 130 | unsigned char *output; |
131 | 131 | ||
132 | check_ipl_parmblock((void *) 0, (unsigned long) output + SZ__bss_start); | ||
133 | memset(&_bss, 0, &_ebss - &_bss); | ||
132 | free_mem_ptr = (unsigned long)&_end; | 134 | free_mem_ptr = (unsigned long)&_end; |
133 | free_mem_end_ptr = free_mem_ptr + HEAP_SIZE; | 135 | free_mem_end_ptr = free_mem_ptr + HEAP_SIZE; |
134 | output = (unsigned char *) ((free_mem_end_ptr + 4095UL) & -4096UL); | 136 | output = (unsigned char *) ((free_mem_end_ptr + 4095UL) & -4096UL); |
135 | 137 | ||
136 | check_ipl_parmblock((void *) 0, (unsigned long) output + SZ__bss_start); | ||
137 | |||
138 | #ifdef CONFIG_BLK_DEV_INITRD | 138 | #ifdef CONFIG_BLK_DEV_INITRD |
139 | /* | 139 | /* |
140 | * Move the initrd right behind the end of the decompressed | 140 | * Move the initrd right behind the end of the decompressed |
diff --git a/arch/s390/include/asm/system.h b/arch/s390/include/asm/system.h index 67ee6c3c6bb3..1741c1556a4e 100644 --- a/arch/s390/include/asm/system.h +++ b/arch/s390/include/asm/system.h | |||
@@ -110,6 +110,7 @@ extern void pfault_fini(void); | |||
110 | #endif /* CONFIG_PFAULT */ | 110 | #endif /* CONFIG_PFAULT */ |
111 | 111 | ||
112 | extern void cmma_init(void); | 112 | extern void cmma_init(void); |
113 | extern int memcpy_real(void *, void *, size_t); | ||
113 | 114 | ||
114 | #define finish_arch_switch(prev) do { \ | 115 | #define finish_arch_switch(prev) do { \ |
115 | set_fs(current->thread.mm_segment); \ | 116 | set_fs(current->thread.mm_segment); \ |
@@ -218,8 +219,8 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size) | |||
218 | " l %0,%2\n" | 219 | " l %0,%2\n" |
219 | "0: nr %0,%5\n" | 220 | "0: nr %0,%5\n" |
220 | " lr %1,%0\n" | 221 | " lr %1,%0\n" |
221 | " or %0,%2\n" | 222 | " or %0,%3\n" |
222 | " or %1,%3\n" | 223 | " or %1,%4\n" |
223 | " cs %0,%1,%2\n" | 224 | " cs %0,%1,%2\n" |
224 | " jnl 1f\n" | 225 | " jnl 1f\n" |
225 | " xr %1,%0\n" | 226 | " xr %1,%0\n" |
@@ -239,8 +240,8 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size) | |||
239 | " l %0,%2\n" | 240 | " l %0,%2\n" |
240 | "0: nr %0,%5\n" | 241 | "0: nr %0,%5\n" |
241 | " lr %1,%0\n" | 242 | " lr %1,%0\n" |
242 | " or %0,%2\n" | 243 | " or %0,%3\n" |
243 | " or %1,%3\n" | 244 | " or %1,%4\n" |
244 | " cs %0,%1,%2\n" | 245 | " cs %0,%1,%2\n" |
245 | " jnl 1f\n" | 246 | " jnl 1f\n" |
246 | " xr %1,%0\n" | 247 | " xr %1,%0\n" |
diff --git a/arch/s390/kernel/head.S b/arch/s390/kernel/head.S index ca4a62bd862f..9d1f76702d47 100644 --- a/arch/s390/kernel/head.S +++ b/arch/s390/kernel/head.S | |||
@@ -517,7 +517,10 @@ startup: | |||
517 | lhi %r1,2 # mode 2 = esame (dump) | 517 | lhi %r1,2 # mode 2 = esame (dump) |
518 | sigp %r1,%r0,0x12 # switch to esame mode | 518 | sigp %r1,%r0,0x12 # switch to esame mode |
519 | sam64 # switch to 64 bit mode | 519 | sam64 # switch to 64 bit mode |
520 | larl %r13,4f | ||
521 | lmh %r0,%r15,0(%r13) # clear high-order half | ||
520 | jg startup_continue | 522 | jg startup_continue |
523 | 4: .fill 16,4,0x0 | ||
521 | #else | 524 | #else |
522 | mvi __LC_AR_MODE_ID,0 # set ESA flag (mode 0) | 525 | mvi __LC_AR_MODE_ID,0 # set ESA flag (mode 0) |
523 | l %r13,4f-.LPG0(%r13) | 526 | l %r13,4f-.LPG0(%r13) |
diff --git a/arch/s390/kernel/head64.S b/arch/s390/kernel/head64.S index 39580e768658..1f70970de0aa 100644 --- a/arch/s390/kernel/head64.S +++ b/arch/s390/kernel/head64.S | |||
@@ -21,7 +21,6 @@ startup_continue: | |||
21 | larl %r1,sched_clock_base_cc | 21 | larl %r1,sched_clock_base_cc |
22 | mvc 0(8,%r1),__LC_LAST_UPDATE_CLOCK | 22 | mvc 0(8,%r1),__LC_LAST_UPDATE_CLOCK |
23 | larl %r13,.LPG1 # get base | 23 | larl %r13,.LPG1 # get base |
24 | lmh %r0,%r15,.Lzero64-.LPG1(%r13) # clear high-order half | ||
25 | lctlg %c0,%c15,.Lctl-.LPG1(%r13) # load control registers | 24 | lctlg %c0,%c15,.Lctl-.LPG1(%r13) # load control registers |
26 | lg %r12,.Lparmaddr-.LPG1(%r13) # pointer to parameter area | 25 | lg %r12,.Lparmaddr-.LPG1(%r13) # pointer to parameter area |
27 | # move IPL device to lowcore | 26 | # move IPL device to lowcore |
@@ -67,7 +66,6 @@ startup_continue: | |||
67 | .L4malign:.quad 0xffffffffffc00000 | 66 | .L4malign:.quad 0xffffffffffc00000 |
68 | .Lscan2g:.quad 0x80000000 + 0x20000 - 8 # 2GB + 128K - 8 | 67 | .Lscan2g:.quad 0x80000000 + 0x20000 - 8 # 2GB + 128K - 8 |
69 | .Lnop: .long 0x07000700 | 68 | .Lnop: .long 0x07000700 |
70 | .Lzero64:.fill 16,4,0x0 | ||
71 | .Lparmaddr: | 69 | .Lparmaddr: |
72 | .quad PARMAREA | 70 | .quad PARMAREA |
73 | .align 64 | 71 | .align 64 |
diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c index 77a63ae419f0..ba363d99de43 100644 --- a/arch/s390/kernel/setup.c +++ b/arch/s390/kernel/setup.c | |||
@@ -401,7 +401,7 @@ setup_lowcore(void) | |||
401 | * Setup lowcore for boot cpu | 401 | * Setup lowcore for boot cpu |
402 | */ | 402 | */ |
403 | BUILD_BUG_ON(sizeof(struct _lowcore) != LC_PAGES * 4096); | 403 | BUILD_BUG_ON(sizeof(struct _lowcore) != LC_PAGES * 4096); |
404 | lc = __alloc_bootmem(LC_PAGES * PAGE_SIZE, LC_PAGES * PAGE_SIZE, 0); | 404 | lc = __alloc_bootmem_low(LC_PAGES * PAGE_SIZE, LC_PAGES * PAGE_SIZE, 0); |
405 | lc->restart_psw.mask = PSW_BASE_BITS | PSW_DEFAULT_KEY; | 405 | lc->restart_psw.mask = PSW_BASE_BITS | PSW_DEFAULT_KEY; |
406 | lc->restart_psw.addr = | 406 | lc->restart_psw.addr = |
407 | PSW_ADDR_AMODE | (unsigned long) restart_int_handler; | 407 | PSW_ADDR_AMODE | (unsigned long) restart_int_handler; |
@@ -433,7 +433,7 @@ setup_lowcore(void) | |||
433 | #ifndef CONFIG_64BIT | 433 | #ifndef CONFIG_64BIT |
434 | if (MACHINE_HAS_IEEE) { | 434 | if (MACHINE_HAS_IEEE) { |
435 | lc->extended_save_area_addr = (__u32) | 435 | lc->extended_save_area_addr = (__u32) |
436 | __alloc_bootmem(PAGE_SIZE, PAGE_SIZE, 0); | 436 | __alloc_bootmem_low(PAGE_SIZE, PAGE_SIZE, 0); |
437 | /* enable extended save area */ | 437 | /* enable extended save area */ |
438 | __ctl_set_bit(14, 29); | 438 | __ctl_set_bit(14, 29); |
439 | } | 439 | } |
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c index 29f65bce55e1..d7d24fc3d6b7 100644 --- a/arch/s390/kernel/smp.c +++ b/arch/s390/kernel/smp.c | |||
@@ -292,9 +292,9 @@ static void __init smp_get_save_area(unsigned int cpu, unsigned int phy_cpu) | |||
292 | zfcpdump_save_areas[cpu] = kmalloc(sizeof(struct save_area), GFP_KERNEL); | 292 | zfcpdump_save_areas[cpu] = kmalloc(sizeof(struct save_area), GFP_KERNEL); |
293 | while (raw_sigp(phy_cpu, sigp_stop_and_store_status) == sigp_busy) | 293 | while (raw_sigp(phy_cpu, sigp_stop_and_store_status) == sigp_busy) |
294 | cpu_relax(); | 294 | cpu_relax(); |
295 | memcpy(zfcpdump_save_areas[cpu], | 295 | memcpy_real(zfcpdump_save_areas[cpu], |
296 | (void *)(unsigned long) store_prefix() + SAVE_AREA_BASE, | 296 | (void *)(unsigned long) store_prefix() + SAVE_AREA_BASE, |
297 | sizeof(struct save_area)); | 297 | sizeof(struct save_area)); |
298 | } | 298 | } |
299 | 299 | ||
300 | struct save_area *zfcpdump_save_areas[NR_CPUS + 1]; | 300 | struct save_area *zfcpdump_save_areas[NR_CPUS + 1]; |
diff --git a/arch/s390/mm/maccess.c b/arch/s390/mm/maccess.c index 81756271dc44..a8c2af8c650f 100644 --- a/arch/s390/mm/maccess.c +++ b/arch/s390/mm/maccess.c | |||
@@ -59,3 +59,29 @@ long probe_kernel_write(void *dst, void *src, size_t size) | |||
59 | } | 59 | } |
60 | return copied < 0 ? -EFAULT : 0; | 60 | return copied < 0 ? -EFAULT : 0; |
61 | } | 61 | } |
62 | |||
63 | int memcpy_real(void *dest, void *src, size_t count) | ||
64 | { | ||
65 | register unsigned long _dest asm("2") = (unsigned long) dest; | ||
66 | register unsigned long _len1 asm("3") = (unsigned long) count; | ||
67 | register unsigned long _src asm("4") = (unsigned long) src; | ||
68 | register unsigned long _len2 asm("5") = (unsigned long) count; | ||
69 | unsigned long flags; | ||
70 | int rc = -EFAULT; | ||
71 | |||
72 | if (!count) | ||
73 | return 0; | ||
74 | flags = __raw_local_irq_stnsm(0xf8UL); | ||
75 | asm volatile ( | ||
76 | "0: mvcle %1,%2,0x0\n" | ||
77 | "1: jo 0b\n" | ||
78 | " lhi %0,0x0\n" | ||
79 | "2:\n" | ||
80 | EX_TABLE(1b,2b) | ||
81 | : "+d" (rc), "+d" (_dest), "+d" (_src), "+d" (_len1), | ||
82 | "+d" (_len2), "=m" (*((long *) dest)) | ||
83 | : "m" (*((long *) src)) | ||
84 | : "cc", "memory"); | ||
85 | __raw_local_irq_ssm(flags); | ||
86 | return rc; | ||
87 | } | ||
diff --git a/arch/sh/boards/mach-ecovec24/setup.c b/arch/sh/boards/mach-ecovec24/setup.c index 39ed8722d11a..6c13b92742e8 100644 --- a/arch/sh/boards/mach-ecovec24/setup.c +++ b/arch/sh/boards/mach-ecovec24/setup.c | |||
@@ -836,6 +836,8 @@ static void __init sh_eth_init(struct sh_eth_plat_data *pd) | |||
836 | pd->mac_addr[i] = mac_read(a, 0x10 + i); | 836 | pd->mac_addr[i] = mac_read(a, 0x10 + i); |
837 | msleep(10); | 837 | msleep(10); |
838 | } | 838 | } |
839 | |||
840 | i2c_put_adapter(a); | ||
839 | } | 841 | } |
840 | #else | 842 | #else |
841 | static void __init sh_eth_init(struct sh_eth_plat_data *pd) | 843 | static void __init sh_eth_init(struct sh_eth_plat_data *pd) |
diff --git a/arch/sh/boards/mach-se/7724/setup.c b/arch/sh/boards/mach-se/7724/setup.c index 66cdbc3c7af9..ccaa290e9aba 100644 --- a/arch/sh/boards/mach-se/7724/setup.c +++ b/arch/sh/boards/mach-se/7724/setup.c | |||
@@ -52,6 +52,13 @@ | |||
52 | * and change SW41 to use 720p | 52 | * and change SW41 to use 720p |
53 | */ | 53 | */ |
54 | 54 | ||
55 | /* | ||
56 | * about sound | ||
57 | * | ||
58 | * This setup.c supports FSI slave mode. | ||
59 | * Please change J20, J21, J22 pin to 1-2 connection. | ||
60 | */ | ||
61 | |||
55 | /* Heartbeat */ | 62 | /* Heartbeat */ |
56 | static struct resource heartbeat_resource = { | 63 | static struct resource heartbeat_resource = { |
57 | .start = PA_LED, | 64 | .start = PA_LED, |
@@ -276,6 +283,7 @@ static struct clk fsimcka_clk = { | |||
276 | .rate = 0, /* unknown */ | 283 | .rate = 0, /* unknown */ |
277 | }; | 284 | }; |
278 | 285 | ||
286 | /* change J20, J21, J22 pin to 1-2 connection to use slave mode */ | ||
279 | struct sh_fsi_platform_info fsi_info = { | 287 | struct sh_fsi_platform_info fsi_info = { |
280 | .porta_flags = SH_FSI_BRS_INV | | 288 | .porta_flags = SH_FSI_BRS_INV | |
281 | SH_FSI_OUT_SLAVE_MODE | | 289 | SH_FSI_OUT_SLAVE_MODE | |
diff --git a/arch/sh/include/cpu-sh4/cpu/mmu_context.h b/arch/sh/include/cpu-sh4/cpu/mmu_context.h index 03ea75c5315d..310ec92f2759 100644 --- a/arch/sh/include/cpu-sh4/cpu/mmu_context.h +++ b/arch/sh/include/cpu-sh4/cpu/mmu_context.h | |||
@@ -19,6 +19,8 @@ | |||
19 | 19 | ||
20 | #define MMUCR 0xFF000010 /* MMU Control Register */ | 20 | #define MMUCR 0xFF000010 /* MMU Control Register */ |
21 | 21 | ||
22 | #define MMU_ITLB_ADDRESS_ARRAY 0xF2000000 | ||
23 | #define MMU_ITLB_ADDRESS_ARRAY2 0xF2800000 | ||
22 | #define MMU_UTLB_ADDRESS_ARRAY 0xF6000000 | 24 | #define MMU_UTLB_ADDRESS_ARRAY 0xF6000000 |
23 | #define MMU_UTLB_ADDRESS_ARRAY2 0xF6800000 | 25 | #define MMU_UTLB_ADDRESS_ARRAY2 0xF6800000 |
24 | #define MMU_PAGE_ASSOC_BIT 0x80 | 26 | #define MMU_PAGE_ASSOC_BIT 0x80 |
diff --git a/arch/sh/include/cpu-sh4/cpu/watchdog.h b/arch/sh/include/cpu-sh4/cpu/watchdog.h index 7672301d0c70..7f62b9380938 100644 --- a/arch/sh/include/cpu-sh4/cpu/watchdog.h +++ b/arch/sh/include/cpu-sh4/cpu/watchdog.h | |||
@@ -21,6 +21,12 @@ | |||
21 | #define WTCNT 0xffcc0000 /*WDTST*/ | 21 | #define WTCNT 0xffcc0000 /*WDTST*/ |
22 | #define WTST WTCNT | 22 | #define WTST WTCNT |
23 | #define WTBST 0xffcc0008 /*WDTBST*/ | 23 | #define WTBST 0xffcc0008 /*WDTBST*/ |
24 | /* Register definitions */ | ||
25 | #elif defined(CONFIG_CPU_SUBTYPE_SH7722) || \ | ||
26 | defined(CONFIG_CPU_SUBTYPE_SH7723) || \ | ||
27 | defined(CONFIG_CPU_SUBTYPE_SH7724) | ||
28 | #define WTCNT 0xa4520000 | ||
29 | #define WTCSR 0xa4520004 | ||
24 | #else | 30 | #else |
25 | /* Register definitions */ | 31 | /* Register definitions */ |
26 | #define WTCNT 0xffc00008 | 32 | #define WTCNT 0xffc00008 |
diff --git a/arch/sh/kernel/dwarf.c b/arch/sh/kernel/dwarf.c index bd1c497280a6..94739ee7aa74 100644 --- a/arch/sh/kernel/dwarf.c +++ b/arch/sh/kernel/dwarf.c | |||
@@ -727,7 +727,7 @@ static int dwarf_parse_cie(void *entry, void *p, unsigned long len, | |||
727 | unsigned char *end, struct module *mod) | 727 | unsigned char *end, struct module *mod) |
728 | { | 728 | { |
729 | struct rb_node **rb_node = &cie_root.rb_node; | 729 | struct rb_node **rb_node = &cie_root.rb_node; |
730 | struct rb_node *parent; | 730 | struct rb_node *parent = *rb_node; |
731 | struct dwarf_cie *cie; | 731 | struct dwarf_cie *cie; |
732 | unsigned long flags; | 732 | unsigned long flags; |
733 | int count; | 733 | int count; |
@@ -856,7 +856,7 @@ static int dwarf_parse_fde(void *entry, u32 entry_type, | |||
856 | unsigned char *end, struct module *mod) | 856 | unsigned char *end, struct module *mod) |
857 | { | 857 | { |
858 | struct rb_node **rb_node = &fde_root.rb_node; | 858 | struct rb_node **rb_node = &fde_root.rb_node; |
859 | struct rb_node *parent; | 859 | struct rb_node *parent = *rb_node; |
860 | struct dwarf_fde *fde; | 860 | struct dwarf_fde *fde; |
861 | struct dwarf_cie *cie; | 861 | struct dwarf_cie *cie; |
862 | unsigned long flags; | 862 | unsigned long flags; |
diff --git a/arch/sh/kernel/idle.c b/arch/sh/kernel/idle.c index 0fd7b41f0a22..273f890b17ae 100644 --- a/arch/sh/kernel/idle.c +++ b/arch/sh/kernel/idle.c | |||
@@ -112,7 +112,7 @@ void cpu_idle(void) | |||
112 | } | 112 | } |
113 | } | 113 | } |
114 | 114 | ||
115 | void __cpuinit select_idle_routine(void) | 115 | void __init select_idle_routine(void) |
116 | { | 116 | { |
117 | /* | 117 | /* |
118 | * If a platform has set its own idle routine, leave it alone. | 118 | * If a platform has set its own idle routine, leave it alone. |
diff --git a/arch/sh/kernel/perf_event.c b/arch/sh/kernel/perf_event.c index 9f253e9cce01..81b6de41ae5d 100644 --- a/arch/sh/kernel/perf_event.c +++ b/arch/sh/kernel/perf_event.c | |||
@@ -315,7 +315,7 @@ void hw_perf_disable(void) | |||
315 | sh_pmu->disable_all(); | 315 | sh_pmu->disable_all(); |
316 | } | 316 | } |
317 | 317 | ||
318 | int register_sh_pmu(struct sh_pmu *pmu) | 318 | int __cpuinit register_sh_pmu(struct sh_pmu *pmu) |
319 | { | 319 | { |
320 | if (sh_pmu) | 320 | if (sh_pmu) |
321 | return -EBUSY; | 321 | return -EBUSY; |
diff --git a/arch/sh/kernel/process_64.c b/arch/sh/kernel/process_64.c index c90957a459ac..c0d40f671ecd 100644 --- a/arch/sh/kernel/process_64.c +++ b/arch/sh/kernel/process_64.c | |||
@@ -504,13 +504,6 @@ out: | |||
504 | return error; | 504 | return error; |
505 | } | 505 | } |
506 | 506 | ||
507 | /* | ||
508 | * These bracket the sleeping functions.. | ||
509 | */ | ||
510 | extern void interruptible_sleep_on(wait_queue_head_t *q); | ||
511 | |||
512 | #define mid_sched ((unsigned long) interruptible_sleep_on) | ||
513 | |||
514 | #ifdef CONFIG_FRAME_POINTER | 507 | #ifdef CONFIG_FRAME_POINTER |
515 | static int in_sh64_switch_to(unsigned long pc) | 508 | static int in_sh64_switch_to(unsigned long pc) |
516 | { | 509 | { |
diff --git a/arch/sh/mm/pmb.c b/arch/sh/mm/pmb.c index a4662e2782c3..3cc21933063b 100644 --- a/arch/sh/mm/pmb.c +++ b/arch/sh/mm/pmb.c | |||
@@ -323,6 +323,7 @@ static void __clear_pmb_entry(struct pmb_entry *pmbe) | |||
323 | writel_uncached(data_val & ~PMB_V, data); | 323 | writel_uncached(data_val & ~PMB_V, data); |
324 | } | 324 | } |
325 | 325 | ||
326 | #ifdef CONFIG_PM | ||
326 | static void set_pmb_entry(struct pmb_entry *pmbe) | 327 | static void set_pmb_entry(struct pmb_entry *pmbe) |
327 | { | 328 | { |
328 | unsigned long flags; | 329 | unsigned long flags; |
@@ -331,6 +332,7 @@ static void set_pmb_entry(struct pmb_entry *pmbe) | |||
331 | __set_pmb_entry(pmbe); | 332 | __set_pmb_entry(pmbe); |
332 | spin_unlock_irqrestore(&pmbe->lock, flags); | 333 | spin_unlock_irqrestore(&pmbe->lock, flags); |
333 | } | 334 | } |
335 | #endif /* CONFIG_PM */ | ||
334 | 336 | ||
335 | int pmb_bolt_mapping(unsigned long vaddr, phys_addr_t phys, | 337 | int pmb_bolt_mapping(unsigned long vaddr, phys_addr_t phys, |
336 | unsigned long size, pgprot_t prot) | 338 | unsigned long size, pgprot_t prot) |
@@ -802,7 +804,7 @@ void __init pmb_init(void) | |||
802 | writel_uncached(0, PMB_IRMCR); | 804 | writel_uncached(0, PMB_IRMCR); |
803 | 805 | ||
804 | /* Flush out the TLB */ | 806 | /* Flush out the TLB */ |
805 | __raw_writel(__raw_readl(MMUCR) | MMUCR_TI, MMUCR); | 807 | local_flush_tlb_all(); |
806 | ctrl_barrier(); | 808 | ctrl_barrier(); |
807 | } | 809 | } |
808 | 810 | ||
diff --git a/arch/sh/mm/tlb-pteaex.c b/arch/sh/mm/tlb-pteaex.c index 32dc674c550c..bdd0982b56ee 100644 --- a/arch/sh/mm/tlb-pteaex.c +++ b/arch/sh/mm/tlb-pteaex.c | |||
@@ -73,5 +73,7 @@ void local_flush_tlb_one(unsigned long asid, unsigned long page) | |||
73 | jump_to_uncached(); | 73 | jump_to_uncached(); |
74 | __raw_writel(page, MMU_UTLB_ADDRESS_ARRAY | MMU_PAGE_ASSOC_BIT); | 74 | __raw_writel(page, MMU_UTLB_ADDRESS_ARRAY | MMU_PAGE_ASSOC_BIT); |
75 | __raw_writel(asid, MMU_UTLB_ADDRESS_ARRAY2 | MMU_PAGE_ASSOC_BIT); | 75 | __raw_writel(asid, MMU_UTLB_ADDRESS_ARRAY2 | MMU_PAGE_ASSOC_BIT); |
76 | __raw_writel(page, MMU_ITLB_ADDRESS_ARRAY | MMU_PAGE_ASSOC_BIT); | ||
77 | __raw_writel(asid, MMU_ITLB_ADDRESS_ARRAY2 | MMU_PAGE_ASSOC_BIT); | ||
76 | back_to_cached(); | 78 | back_to_cached(); |
77 | } | 79 | } |
diff --git a/arch/sh/mm/tlbflush_32.c b/arch/sh/mm/tlbflush_32.c index 004bb3f25b5f..77dc5efa7127 100644 --- a/arch/sh/mm/tlbflush_32.c +++ b/arch/sh/mm/tlbflush_32.c | |||
@@ -123,18 +123,27 @@ void local_flush_tlb_mm(struct mm_struct *mm) | |||
123 | void local_flush_tlb_all(void) | 123 | void local_flush_tlb_all(void) |
124 | { | 124 | { |
125 | unsigned long flags, status; | 125 | unsigned long flags, status; |
126 | int i; | ||
126 | 127 | ||
127 | /* | 128 | /* |
128 | * Flush all the TLB. | 129 | * Flush all the TLB. |
129 | * | ||
130 | * Write to the MMU control register's bit: | ||
131 | * TF-bit for SH-3, TI-bit for SH-4. | ||
132 | * It's same position, bit #2. | ||
133 | */ | 130 | */ |
134 | local_irq_save(flags); | 131 | local_irq_save(flags); |
132 | jump_to_uncached(); | ||
133 | |||
135 | status = __raw_readl(MMUCR); | 134 | status = __raw_readl(MMUCR); |
136 | status |= 0x04; | 135 | status = ((status & MMUCR_URB) >> MMUCR_URB_SHIFT); |
137 | __raw_writel(status, MMUCR); | 136 | |
137 | if (status == 0) | ||
138 | status = MMUCR_URB_NENTRIES; | ||
139 | |||
140 | for (i = 0; i < status; i++) | ||
141 | __raw_writel(0x0, MMU_UTLB_ADDRESS_ARRAY | (i << 8)); | ||
142 | |||
143 | for (i = 0; i < 4; i++) | ||
144 | __raw_writel(0x0, MMU_ITLB_ADDRESS_ARRAY | (i << 8)); | ||
145 | |||
146 | back_to_cached(); | ||
138 | ctrl_barrier(); | 147 | ctrl_barrier(); |
139 | local_irq_restore(flags); | 148 | local_irq_restore(flags); |
140 | } | 149 | } |
diff --git a/arch/x86/kernel/cpu/perf_event_amd.c b/arch/x86/kernel/cpu/perf_event_amd.c index 573458f1caf2..b87e0b6970cb 100644 --- a/arch/x86/kernel/cpu/perf_event_amd.c +++ b/arch/x86/kernel/cpu/perf_event_amd.c | |||
@@ -348,10 +348,12 @@ static void amd_pmu_cpu_offline(int cpu) | |||
348 | 348 | ||
349 | raw_spin_lock(&amd_nb_lock); | 349 | raw_spin_lock(&amd_nb_lock); |
350 | 350 | ||
351 | if (--cpuhw->amd_nb->refcnt == 0) | 351 | if (cpuhw->amd_nb) { |
352 | kfree(cpuhw->amd_nb); | 352 | if (--cpuhw->amd_nb->refcnt == 0) |
353 | kfree(cpuhw->amd_nb); | ||
353 | 354 | ||
354 | cpuhw->amd_nb = NULL; | 355 | cpuhw->amd_nb = NULL; |
356 | } | ||
355 | 357 | ||
356 | raw_spin_unlock(&amd_nb_lock); | 358 | raw_spin_unlock(&amd_nb_lock); |
357 | } | 359 | } |
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index fb7fc24fe727..189cbc2585fa 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c | |||
@@ -8,6 +8,7 @@ | |||
8 | #include <linux/acpi.h> | 8 | #include <linux/acpi.h> |
9 | #include <linux/signal.h> | 9 | #include <linux/signal.h> |
10 | #include <linux/kthread.h> | 10 | #include <linux/kthread.h> |
11 | #include <linux/dmi.h> | ||
11 | 12 | ||
12 | #include <acpi/acpi_drivers.h> | 13 | #include <acpi/acpi_drivers.h> |
13 | 14 | ||
@@ -1032,6 +1033,41 @@ static void acpi_add_id(struct acpi_device *device, const char *dev_id) | |||
1032 | list_add_tail(&id->list, &device->pnp.ids); | 1033 | list_add_tail(&id->list, &device->pnp.ids); |
1033 | } | 1034 | } |
1034 | 1035 | ||
1036 | /* | ||
1037 | * Old IBM workstations have a DSDT bug wherein the SMBus object | ||
1038 | * lacks the SMBUS01 HID and the methods do not have the necessary "_" | ||
1039 | * prefix. Work around this. | ||
1040 | */ | ||
1041 | static int acpi_ibm_smbus_match(struct acpi_device *device) | ||
1042 | { | ||
1043 | acpi_handle h_dummy; | ||
1044 | struct acpi_buffer path = {ACPI_ALLOCATE_BUFFER, NULL}; | ||
1045 | int result; | ||
1046 | |||
1047 | if (!dmi_name_in_vendors("IBM")) | ||
1048 | return -ENODEV; | ||
1049 | |||
1050 | /* Look for SMBS object */ | ||
1051 | result = acpi_get_name(device->handle, ACPI_SINGLE_NAME, &path); | ||
1052 | if (result) | ||
1053 | return result; | ||
1054 | |||
1055 | if (strcmp("SMBS", path.pointer)) { | ||
1056 | result = -ENODEV; | ||
1057 | goto out; | ||
1058 | } | ||
1059 | |||
1060 | /* Does it have the necessary (but misnamed) methods? */ | ||
1061 | result = -ENODEV; | ||
1062 | if (ACPI_SUCCESS(acpi_get_handle(device->handle, "SBI", &h_dummy)) && | ||
1063 | ACPI_SUCCESS(acpi_get_handle(device->handle, "SBR", &h_dummy)) && | ||
1064 | ACPI_SUCCESS(acpi_get_handle(device->handle, "SBW", &h_dummy))) | ||
1065 | result = 0; | ||
1066 | out: | ||
1067 | kfree(path.pointer); | ||
1068 | return result; | ||
1069 | } | ||
1070 | |||
1035 | static void acpi_device_set_id(struct acpi_device *device) | 1071 | static void acpi_device_set_id(struct acpi_device *device) |
1036 | { | 1072 | { |
1037 | acpi_status status; | 1073 | acpi_status status; |
@@ -1082,6 +1118,8 @@ static void acpi_device_set_id(struct acpi_device *device) | |||
1082 | acpi_add_id(device, ACPI_BAY_HID); | 1118 | acpi_add_id(device, ACPI_BAY_HID); |
1083 | else if (ACPI_SUCCESS(acpi_dock_match(device))) | 1119 | else if (ACPI_SUCCESS(acpi_dock_match(device))) |
1084 | acpi_add_id(device, ACPI_DOCK_HID); | 1120 | acpi_add_id(device, ACPI_DOCK_HID); |
1121 | else if (!acpi_ibm_smbus_match(device)) | ||
1122 | acpi_add_id(device, ACPI_SMBUS_IBM_HID); | ||
1085 | 1123 | ||
1086 | break; | 1124 | break; |
1087 | case ACPI_BUS_TYPE_POWER: | 1125 | case ACPI_BUS_TYPE_POWER: |
diff --git a/drivers/ata/libata-sff.c b/drivers/ata/libata-sff.c index 561dec2481cb..277477251a86 100644 --- a/drivers/ata/libata-sff.c +++ b/drivers/ata/libata-sff.c | |||
@@ -1667,6 +1667,7 @@ unsigned int ata_sff_host_intr(struct ata_port *ap, | |||
1667 | { | 1667 | { |
1668 | struct ata_eh_info *ehi = &ap->link.eh_info; | 1668 | struct ata_eh_info *ehi = &ap->link.eh_info; |
1669 | u8 status, host_stat = 0; | 1669 | u8 status, host_stat = 0; |
1670 | bool bmdma_stopped = false; | ||
1670 | 1671 | ||
1671 | VPRINTK("ata%u: protocol %d task_state %d\n", | 1672 | VPRINTK("ata%u: protocol %d task_state %d\n", |
1672 | ap->print_id, qc->tf.protocol, ap->hsm_task_state); | 1673 | ap->print_id, qc->tf.protocol, ap->hsm_task_state); |
@@ -1699,6 +1700,7 @@ unsigned int ata_sff_host_intr(struct ata_port *ap, | |||
1699 | 1700 | ||
1700 | /* before we do anything else, clear DMA-Start bit */ | 1701 | /* before we do anything else, clear DMA-Start bit */ |
1701 | ap->ops->bmdma_stop(qc); | 1702 | ap->ops->bmdma_stop(qc); |
1703 | bmdma_stopped = true; | ||
1702 | 1704 | ||
1703 | if (unlikely(host_stat & ATA_DMA_ERR)) { | 1705 | if (unlikely(host_stat & ATA_DMA_ERR)) { |
1704 | /* error when transfering data to/from memory */ | 1706 | /* error when transfering data to/from memory */ |
@@ -1716,8 +1718,14 @@ unsigned int ata_sff_host_intr(struct ata_port *ap, | |||
1716 | 1718 | ||
1717 | /* check main status, clearing INTRQ if needed */ | 1719 | /* check main status, clearing INTRQ if needed */ |
1718 | status = ata_sff_irq_status(ap); | 1720 | status = ata_sff_irq_status(ap); |
1719 | if (status & ATA_BUSY) | 1721 | if (status & ATA_BUSY) { |
1720 | goto idle_irq; | 1722 | if (bmdma_stopped) { |
1723 | /* BMDMA engine is already stopped, we're screwed */ | ||
1724 | qc->err_mask |= AC_ERR_HSM; | ||
1725 | ap->hsm_task_state = HSM_ST_ERR; | ||
1726 | } else | ||
1727 | goto idle_irq; | ||
1728 | } | ||
1721 | 1729 | ||
1722 | /* ack bmdma irq events */ | 1730 | /* ack bmdma irq events */ |
1723 | ap->ops->sff_irq_clear(ap); | 1731 | ap->ops->sff_irq_clear(ap); |
@@ -1762,13 +1770,16 @@ EXPORT_SYMBOL_GPL(ata_sff_host_intr); | |||
1762 | irqreturn_t ata_sff_interrupt(int irq, void *dev_instance) | 1770 | irqreturn_t ata_sff_interrupt(int irq, void *dev_instance) |
1763 | { | 1771 | { |
1764 | struct ata_host *host = dev_instance; | 1772 | struct ata_host *host = dev_instance; |
1773 | bool retried = false; | ||
1765 | unsigned int i; | 1774 | unsigned int i; |
1766 | unsigned int handled = 0, polling = 0; | 1775 | unsigned int handled, idle, polling; |
1767 | unsigned long flags; | 1776 | unsigned long flags; |
1768 | 1777 | ||
1769 | /* TODO: make _irqsave conditional on x86 PCI IDE legacy mode */ | 1778 | /* TODO: make _irqsave conditional on x86 PCI IDE legacy mode */ |
1770 | spin_lock_irqsave(&host->lock, flags); | 1779 | spin_lock_irqsave(&host->lock, flags); |
1771 | 1780 | ||
1781 | retry: | ||
1782 | handled = idle = polling = 0; | ||
1772 | for (i = 0; i < host->n_ports; i++) { | 1783 | for (i = 0; i < host->n_ports; i++) { |
1773 | struct ata_port *ap = host->ports[i]; | 1784 | struct ata_port *ap = host->ports[i]; |
1774 | struct ata_queued_cmd *qc; | 1785 | struct ata_queued_cmd *qc; |
@@ -1782,7 +1793,8 @@ irqreturn_t ata_sff_interrupt(int irq, void *dev_instance) | |||
1782 | handled |= ata_sff_host_intr(ap, qc); | 1793 | handled |= ata_sff_host_intr(ap, qc); |
1783 | else | 1794 | else |
1784 | polling |= 1 << i; | 1795 | polling |= 1 << i; |
1785 | } | 1796 | } else |
1797 | idle |= 1 << i; | ||
1786 | } | 1798 | } |
1787 | 1799 | ||
1788 | /* | 1800 | /* |
@@ -1790,7 +1802,9 @@ irqreturn_t ata_sff_interrupt(int irq, void *dev_instance) | |||
1790 | * asserting IRQ line, nobody cared will ensue. Check IRQ | 1802 | * asserting IRQ line, nobody cared will ensue. Check IRQ |
1791 | * pending status if available and clear spurious IRQ. | 1803 | * pending status if available and clear spurious IRQ. |
1792 | */ | 1804 | */ |
1793 | if (!handled) { | 1805 | if (!handled && !retried) { |
1806 | bool retry = false; | ||
1807 | |||
1794 | for (i = 0; i < host->n_ports; i++) { | 1808 | for (i = 0; i < host->n_ports; i++) { |
1795 | struct ata_port *ap = host->ports[i]; | 1809 | struct ata_port *ap = host->ports[i]; |
1796 | 1810 | ||
@@ -1805,8 +1819,23 @@ irqreturn_t ata_sff_interrupt(int irq, void *dev_instance) | |||
1805 | ata_port_printk(ap, KERN_INFO, | 1819 | ata_port_printk(ap, KERN_INFO, |
1806 | "clearing spurious IRQ\n"); | 1820 | "clearing spurious IRQ\n"); |
1807 | 1821 | ||
1808 | ap->ops->sff_check_status(ap); | 1822 | if (idle & (1 << i)) { |
1809 | ap->ops->sff_irq_clear(ap); | 1823 | ap->ops->sff_check_status(ap); |
1824 | ap->ops->sff_irq_clear(ap); | ||
1825 | } else { | ||
1826 | /* clear INTRQ and check if BUSY cleared */ | ||
1827 | if (!(ap->ops->sff_check_status(ap) & ATA_BUSY)) | ||
1828 | retry |= true; | ||
1829 | /* | ||
1830 | * With command in flight, we can't do | ||
1831 | * sff_irq_clear() w/o racing with completion. | ||
1832 | */ | ||
1833 | } | ||
1834 | } | ||
1835 | |||
1836 | if (retry) { | ||
1837 | retried = true; | ||
1838 | goto retry; | ||
1810 | } | 1839 | } |
1811 | } | 1840 | } |
1812 | 1841 | ||
diff --git a/drivers/ata/pata_via.c b/drivers/ata/pata_via.c index 3059ec017de3..95d39c36acea 100644 --- a/drivers/ata/pata_via.c +++ b/drivers/ata/pata_via.c | |||
@@ -677,6 +677,7 @@ static const struct pci_device_id via[] = { | |||
677 | { PCI_VDEVICE(VIA, 0x3164), }, | 677 | { PCI_VDEVICE(VIA, 0x3164), }, |
678 | { PCI_VDEVICE(VIA, 0x5324), }, | 678 | { PCI_VDEVICE(VIA, 0x5324), }, |
679 | { PCI_VDEVICE(VIA, 0xC409), VIA_IDFLAG_SINGLE }, | 679 | { PCI_VDEVICE(VIA, 0xC409), VIA_IDFLAG_SINGLE }, |
680 | { PCI_VDEVICE(VIA, 0x9001), VIA_IDFLAG_SINGLE }, | ||
680 | 681 | ||
681 | { }, | 682 | { }, |
682 | }; | 683 | }; |
diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c index a3e10dc7cc25..b78d5c381efe 100644 --- a/drivers/char/agp/intel-agp.c +++ b/drivers/char/agp/intel-agp.c | |||
@@ -97,6 +97,9 @@ EXPORT_SYMBOL(intel_agp_enabled); | |||
97 | #define IS_PINEVIEW (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_PINEVIEW_M_HB || \ | 97 | #define IS_PINEVIEW (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_PINEVIEW_M_HB || \ |
98 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_PINEVIEW_HB) | 98 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_PINEVIEW_HB) |
99 | 99 | ||
100 | #define IS_SNB (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_SANDYBRIDGE_HB || \ | ||
101 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_SANDYBRIDGE_M_HB) | ||
102 | |||
100 | #define IS_G4X (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_EAGLELAKE_HB || \ | 103 | #define IS_G4X (agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_EAGLELAKE_HB || \ |
101 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_Q45_HB || \ | 104 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_Q45_HB || \ |
102 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_G45_HB || \ | 105 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_G45_HB || \ |
@@ -107,8 +110,7 @@ EXPORT_SYMBOL(intel_agp_enabled); | |||
107 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_IRONLAKE_M_HB || \ | 110 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_IRONLAKE_M_HB || \ |
108 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_IRONLAKE_MA_HB || \ | 111 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_IRONLAKE_MA_HB || \ |
109 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_IRONLAKE_MC2_HB || \ | 112 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_IRONLAKE_MC2_HB || \ |
110 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_SANDYBRIDGE_HB || \ | 113 | IS_SNB) |
111 | agp_bridge->dev->device == PCI_DEVICE_ID_INTEL_SANDYBRIDGE_M_HB) | ||
112 | 114 | ||
113 | extern int agp_memory_reserved; | 115 | extern int agp_memory_reserved; |
114 | 116 | ||
@@ -175,6 +177,10 @@ extern int agp_memory_reserved; | |||
175 | #define SNB_GMCH_GMS_STOLEN_448M (0xe << 3) | 177 | #define SNB_GMCH_GMS_STOLEN_448M (0xe << 3) |
176 | #define SNB_GMCH_GMS_STOLEN_480M (0xf << 3) | 178 | #define SNB_GMCH_GMS_STOLEN_480M (0xf << 3) |
177 | #define SNB_GMCH_GMS_STOLEN_512M (0x10 << 3) | 179 | #define SNB_GMCH_GMS_STOLEN_512M (0x10 << 3) |
180 | #define SNB_GTT_SIZE_0M (0 << 8) | ||
181 | #define SNB_GTT_SIZE_1M (1 << 8) | ||
182 | #define SNB_GTT_SIZE_2M (2 << 8) | ||
183 | #define SNB_GTT_SIZE_MASK (3 << 8) | ||
178 | 184 | ||
179 | static const struct aper_size_info_fixed intel_i810_sizes[] = | 185 | static const struct aper_size_info_fixed intel_i810_sizes[] = |
180 | { | 186 | { |
@@ -1200,6 +1206,9 @@ static void intel_i9xx_setup_flush(void) | |||
1200 | if (intel_private.ifp_resource.start) | 1206 | if (intel_private.ifp_resource.start) |
1201 | return; | 1207 | return; |
1202 | 1208 | ||
1209 | if (IS_SNB) | ||
1210 | return; | ||
1211 | |||
1203 | /* setup a resource for this object */ | 1212 | /* setup a resource for this object */ |
1204 | intel_private.ifp_resource.name = "Intel Flush Page"; | 1213 | intel_private.ifp_resource.name = "Intel Flush Page"; |
1205 | intel_private.ifp_resource.flags = IORESOURCE_MEM; | 1214 | intel_private.ifp_resource.flags = IORESOURCE_MEM; |
@@ -1438,6 +1447,8 @@ static unsigned long intel_i965_mask_memory(struct agp_bridge_data *bridge, | |||
1438 | 1447 | ||
1439 | static void intel_i965_get_gtt_range(int *gtt_offset, int *gtt_size) | 1448 | static void intel_i965_get_gtt_range(int *gtt_offset, int *gtt_size) |
1440 | { | 1449 | { |
1450 | u16 snb_gmch_ctl; | ||
1451 | |||
1441 | switch (agp_bridge->dev->device) { | 1452 | switch (agp_bridge->dev->device) { |
1442 | case PCI_DEVICE_ID_INTEL_GM45_HB: | 1453 | case PCI_DEVICE_ID_INTEL_GM45_HB: |
1443 | case PCI_DEVICE_ID_INTEL_EAGLELAKE_HB: | 1454 | case PCI_DEVICE_ID_INTEL_EAGLELAKE_HB: |
@@ -1449,9 +1460,26 @@ static void intel_i965_get_gtt_range(int *gtt_offset, int *gtt_size) | |||
1449 | case PCI_DEVICE_ID_INTEL_IRONLAKE_M_HB: | 1460 | case PCI_DEVICE_ID_INTEL_IRONLAKE_M_HB: |
1450 | case PCI_DEVICE_ID_INTEL_IRONLAKE_MA_HB: | 1461 | case PCI_DEVICE_ID_INTEL_IRONLAKE_MA_HB: |
1451 | case PCI_DEVICE_ID_INTEL_IRONLAKE_MC2_HB: | 1462 | case PCI_DEVICE_ID_INTEL_IRONLAKE_MC2_HB: |
1463 | *gtt_offset = *gtt_size = MB(2); | ||
1464 | break; | ||
1452 | case PCI_DEVICE_ID_INTEL_SANDYBRIDGE_HB: | 1465 | case PCI_DEVICE_ID_INTEL_SANDYBRIDGE_HB: |
1453 | case PCI_DEVICE_ID_INTEL_SANDYBRIDGE_M_HB: | 1466 | case PCI_DEVICE_ID_INTEL_SANDYBRIDGE_M_HB: |
1454 | *gtt_offset = *gtt_size = MB(2); | 1467 | *gtt_offset = MB(2); |
1468 | |||
1469 | pci_read_config_word(intel_private.pcidev, SNB_GMCH_CTRL, &snb_gmch_ctl); | ||
1470 | switch (snb_gmch_ctl & SNB_GTT_SIZE_MASK) { | ||
1471 | default: | ||
1472 | case SNB_GTT_SIZE_0M: | ||
1473 | printk(KERN_ERR "Bad GTT size mask: 0x%04x.\n", snb_gmch_ctl); | ||
1474 | *gtt_size = MB(0); | ||
1475 | break; | ||
1476 | case SNB_GTT_SIZE_1M: | ||
1477 | *gtt_size = MB(1); | ||
1478 | break; | ||
1479 | case SNB_GTT_SIZE_2M: | ||
1480 | *gtt_size = MB(2); | ||
1481 | break; | ||
1482 | } | ||
1455 | break; | 1483 | break; |
1456 | default: | 1484 | default: |
1457 | *gtt_offset = *gtt_size = KB(512); | 1485 | *gtt_offset = *gtt_size = KB(512); |
diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index f404ccfc9c20..44288ce0cb45 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c | |||
@@ -681,6 +681,10 @@ static void resize_console(struct port *port) | |||
681 | struct virtio_device *vdev; | 681 | struct virtio_device *vdev; |
682 | struct winsize ws; | 682 | struct winsize ws; |
683 | 683 | ||
684 | /* The port could have been hot-unplugged */ | ||
685 | if (!port) | ||
686 | return; | ||
687 | |||
684 | vdev = port->portdev->vdev; | 688 | vdev = port->portdev->vdev; |
685 | if (virtio_has_feature(vdev, VIRTIO_CONSOLE_F_SIZE)) { | 689 | if (virtio_has_feature(vdev, VIRTIO_CONSOLE_F_SIZE)) { |
686 | vdev->config->get(vdev, | 690 | vdev->config->get(vdev, |
@@ -947,11 +951,18 @@ static void handle_control_message(struct ports_device *portdev, | |||
947 | */ | 951 | */ |
948 | err = sysfs_create_group(&port->dev->kobj, | 952 | err = sysfs_create_group(&port->dev->kobj, |
949 | &port_attribute_group); | 953 | &port_attribute_group); |
950 | if (err) | 954 | if (err) { |
951 | dev_err(port->dev, | 955 | dev_err(port->dev, |
952 | "Error %d creating sysfs device attributes\n", | 956 | "Error %d creating sysfs device attributes\n", |
953 | err); | 957 | err); |
954 | 958 | } else { | |
959 | /* | ||
960 | * Generate a udev event so that appropriate | ||
961 | * symlinks can be created based on udev | ||
962 | * rules. | ||
963 | */ | ||
964 | kobject_uevent(&port->dev->kobj, KOBJ_CHANGE); | ||
965 | } | ||
955 | break; | 966 | break; |
956 | case VIRTIO_CONSOLE_PORT_REMOVE: | 967 | case VIRTIO_CONSOLE_PORT_REMOVE: |
957 | /* | 968 | /* |
diff --git a/drivers/edac/edac_mce_amd.c b/drivers/edac/edac_mce_amd.c index 8fc91a019620..f5b6d9fe4def 100644 --- a/drivers/edac/edac_mce_amd.c +++ b/drivers/edac/edac_mce_amd.c | |||
@@ -316,7 +316,12 @@ void amd_decode_nb_mce(int node_id, struct err_regs *regs, int handle_errors) | |||
316 | if (regs->nbsh & K8_NBSH_ERR_CPU_VAL) | 316 | if (regs->nbsh & K8_NBSH_ERR_CPU_VAL) |
317 | pr_cont(", core: %u\n", (u8)(regs->nbsh & 0xf)); | 317 | pr_cont(", core: %u\n", (u8)(regs->nbsh & 0xf)); |
318 | } else { | 318 | } else { |
319 | pr_cont(", core: %d\n", fls((regs->nbsh & 0xf) - 1)); | 319 | u8 assoc_cpus = regs->nbsh & 0xf; |
320 | |||
321 | if (assoc_cpus > 0) | ||
322 | pr_cont(", core: %d", fls(assoc_cpus) - 1); | ||
323 | |||
324 | pr_cont("\n"); | ||
320 | } | 325 | } |
321 | 326 | ||
322 | pr_emerg("%s.\n", EXT_ERR_MSG(xec)); | 327 | pr_emerg("%s.\n", EXT_ERR_MSG(xec)); |
diff --git a/drivers/gpio/max730x.c b/drivers/gpio/max730x.c index c9bced55f82b..4a7d662ff9b7 100644 --- a/drivers/gpio/max730x.c +++ b/drivers/gpio/max730x.c | |||
@@ -242,3 +242,7 @@ int __devexit __max730x_remove(struct device *dev) | |||
242 | return ret; | 242 | return ret; |
243 | } | 243 | } |
244 | EXPORT_SYMBOL_GPL(__max730x_remove); | 244 | EXPORT_SYMBOL_GPL(__max730x_remove); |
245 | |||
246 | MODULE_AUTHOR("Juergen Beisert, Wolfram Sang"); | ||
247 | MODULE_LICENSE("GPL v2"); | ||
248 | MODULE_DESCRIPTION("MAX730x GPIO-Expanders, generic parts"); | ||
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c index 8bfc0bbf13e6..a9f8589490cf 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c | |||
@@ -1881,29 +1881,29 @@ struct drm_ioctl_desc i915_ioctls[] = { | |||
1881 | DRM_IOCTL_DEF(DRM_I915_GET_VBLANK_PIPE, i915_vblank_pipe_get, DRM_AUTH ), | 1881 | DRM_IOCTL_DEF(DRM_I915_GET_VBLANK_PIPE, i915_vblank_pipe_get, DRM_AUTH ), |
1882 | DRM_IOCTL_DEF(DRM_I915_VBLANK_SWAP, i915_vblank_swap, DRM_AUTH), | 1882 | DRM_IOCTL_DEF(DRM_I915_VBLANK_SWAP, i915_vblank_swap, DRM_AUTH), |
1883 | DRM_IOCTL_DEF(DRM_I915_HWS_ADDR, i915_set_status_page, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY), | 1883 | DRM_IOCTL_DEF(DRM_I915_HWS_ADDR, i915_set_status_page, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY), |
1884 | DRM_IOCTL_DEF(DRM_I915_GEM_INIT, i915_gem_init_ioctl, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY), | 1884 | DRM_IOCTL_DEF(DRM_I915_GEM_INIT, i915_gem_init_ioctl, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY|DRM_UNLOCKED), |
1885 | DRM_IOCTL_DEF(DRM_I915_GEM_EXECBUFFER, i915_gem_execbuffer, DRM_AUTH), | 1885 | DRM_IOCTL_DEF(DRM_I915_GEM_EXECBUFFER, i915_gem_execbuffer, DRM_AUTH|DRM_UNLOCKED), |
1886 | DRM_IOCTL_DEF(DRM_I915_GEM_EXECBUFFER2, i915_gem_execbuffer2, DRM_AUTH), | 1886 | DRM_IOCTL_DEF(DRM_I915_GEM_EXECBUFFER2, i915_gem_execbuffer2, DRM_AUTH|DRM_UNLOCKED), |
1887 | DRM_IOCTL_DEF(DRM_I915_GEM_PIN, i915_gem_pin_ioctl, DRM_AUTH|DRM_ROOT_ONLY), | 1887 | DRM_IOCTL_DEF(DRM_I915_GEM_PIN, i915_gem_pin_ioctl, DRM_AUTH|DRM_ROOT_ONLY|DRM_UNLOCKED), |
1888 | DRM_IOCTL_DEF(DRM_I915_GEM_UNPIN, i915_gem_unpin_ioctl, DRM_AUTH|DRM_ROOT_ONLY), | 1888 | DRM_IOCTL_DEF(DRM_I915_GEM_UNPIN, i915_gem_unpin_ioctl, DRM_AUTH|DRM_ROOT_ONLY|DRM_UNLOCKED), |
1889 | DRM_IOCTL_DEF(DRM_I915_GEM_BUSY, i915_gem_busy_ioctl, DRM_AUTH), | 1889 | DRM_IOCTL_DEF(DRM_I915_GEM_BUSY, i915_gem_busy_ioctl, DRM_AUTH|DRM_UNLOCKED), |
1890 | DRM_IOCTL_DEF(DRM_I915_GEM_THROTTLE, i915_gem_throttle_ioctl, DRM_AUTH), | 1890 | DRM_IOCTL_DEF(DRM_I915_GEM_THROTTLE, i915_gem_throttle_ioctl, DRM_AUTH|DRM_UNLOCKED), |
1891 | DRM_IOCTL_DEF(DRM_I915_GEM_ENTERVT, i915_gem_entervt_ioctl, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY), | 1891 | DRM_IOCTL_DEF(DRM_I915_GEM_ENTERVT, i915_gem_entervt_ioctl, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY|DRM_UNLOCKED), |
1892 | DRM_IOCTL_DEF(DRM_I915_GEM_LEAVEVT, i915_gem_leavevt_ioctl, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY), | 1892 | DRM_IOCTL_DEF(DRM_I915_GEM_LEAVEVT, i915_gem_leavevt_ioctl, DRM_AUTH|DRM_MASTER|DRM_ROOT_ONLY|DRM_UNLOCKED), |
1893 | DRM_IOCTL_DEF(DRM_I915_GEM_CREATE, i915_gem_create_ioctl, 0), | 1893 | DRM_IOCTL_DEF(DRM_I915_GEM_CREATE, i915_gem_create_ioctl, DRM_UNLOCKED), |
1894 | DRM_IOCTL_DEF(DRM_I915_GEM_PREAD, i915_gem_pread_ioctl, 0), | 1894 | DRM_IOCTL_DEF(DRM_I915_GEM_PREAD, i915_gem_pread_ioctl, DRM_UNLOCKED), |
1895 | DRM_IOCTL_DEF(DRM_I915_GEM_PWRITE, i915_gem_pwrite_ioctl, 0), | 1895 | DRM_IOCTL_DEF(DRM_I915_GEM_PWRITE, i915_gem_pwrite_ioctl, DRM_UNLOCKED), |
1896 | DRM_IOCTL_DEF(DRM_I915_GEM_MMAP, i915_gem_mmap_ioctl, 0), | 1896 | DRM_IOCTL_DEF(DRM_I915_GEM_MMAP, i915_gem_mmap_ioctl, DRM_UNLOCKED), |
1897 | DRM_IOCTL_DEF(DRM_I915_GEM_MMAP_GTT, i915_gem_mmap_gtt_ioctl, 0), | 1897 | DRM_IOCTL_DEF(DRM_I915_GEM_MMAP_GTT, i915_gem_mmap_gtt_ioctl, DRM_UNLOCKED), |
1898 | DRM_IOCTL_DEF(DRM_I915_GEM_SET_DOMAIN, i915_gem_set_domain_ioctl, 0), | 1898 | DRM_IOCTL_DEF(DRM_I915_GEM_SET_DOMAIN, i915_gem_set_domain_ioctl, DRM_UNLOCKED), |
1899 | DRM_IOCTL_DEF(DRM_I915_GEM_SW_FINISH, i915_gem_sw_finish_ioctl, 0), | 1899 | DRM_IOCTL_DEF(DRM_I915_GEM_SW_FINISH, i915_gem_sw_finish_ioctl, DRM_UNLOCKED), |
1900 | DRM_IOCTL_DEF(DRM_I915_GEM_SET_TILING, i915_gem_set_tiling, 0), | 1900 | DRM_IOCTL_DEF(DRM_I915_GEM_SET_TILING, i915_gem_set_tiling, DRM_UNLOCKED), |
1901 | DRM_IOCTL_DEF(DRM_I915_GEM_GET_TILING, i915_gem_get_tiling, 0), | 1901 | DRM_IOCTL_DEF(DRM_I915_GEM_GET_TILING, i915_gem_get_tiling, DRM_UNLOCKED), |
1902 | DRM_IOCTL_DEF(DRM_I915_GEM_GET_APERTURE, i915_gem_get_aperture_ioctl, 0), | 1902 | DRM_IOCTL_DEF(DRM_I915_GEM_GET_APERTURE, i915_gem_get_aperture_ioctl, DRM_UNLOCKED), |
1903 | DRM_IOCTL_DEF(DRM_I915_GET_PIPE_FROM_CRTC_ID, intel_get_pipe_from_crtc_id, 0), | 1903 | DRM_IOCTL_DEF(DRM_I915_GET_PIPE_FROM_CRTC_ID, intel_get_pipe_from_crtc_id, DRM_UNLOCKED), |
1904 | DRM_IOCTL_DEF(DRM_I915_GEM_MADVISE, i915_gem_madvise_ioctl, 0), | 1904 | DRM_IOCTL_DEF(DRM_I915_GEM_MADVISE, i915_gem_madvise_ioctl, DRM_UNLOCKED), |
1905 | DRM_IOCTL_DEF(DRM_I915_OVERLAY_PUT_IMAGE, intel_overlay_put_image, DRM_MASTER|DRM_CONTROL_ALLOW), | 1905 | DRM_IOCTL_DEF(DRM_I915_OVERLAY_PUT_IMAGE, intel_overlay_put_image, DRM_MASTER|DRM_CONTROL_ALLOW|DRM_UNLOCKED), |
1906 | DRM_IOCTL_DEF(DRM_I915_OVERLAY_ATTRS, intel_overlay_attrs, DRM_MASTER|DRM_CONTROL_ALLOW), | 1906 | DRM_IOCTL_DEF(DRM_I915_OVERLAY_ATTRS, intel_overlay_attrs, DRM_MASTER|DRM_CONTROL_ALLOW|DRM_UNLOCKED), |
1907 | }; | 1907 | }; |
1908 | 1908 | ||
1909 | int i915_max_ioctl = DRM_ARRAY_SIZE(i915_ioctls); | 1909 | int i915_max_ioctl = DRM_ARRAY_SIZE(i915_ioctls); |
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index 1b2e95455c05..4b26919abdb2 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c | |||
@@ -139,12 +139,12 @@ const static struct intel_device_info intel_ironlake_m_info = { | |||
139 | 139 | ||
140 | const static struct intel_device_info intel_sandybridge_d_info = { | 140 | const static struct intel_device_info intel_sandybridge_d_info = { |
141 | .is_i965g = 1, .is_i9xx = 1, .need_gfx_hws = 1, | 141 | .is_i965g = 1, .is_i9xx = 1, .need_gfx_hws = 1, |
142 | .has_hotplug = 1, | 142 | .has_hotplug = 1, .is_gen6 = 1, |
143 | }; | 143 | }; |
144 | 144 | ||
145 | const static struct intel_device_info intel_sandybridge_m_info = { | 145 | const static struct intel_device_info intel_sandybridge_m_info = { |
146 | .is_i965g = 1, .is_mobile = 1, .is_i9xx = 1, .need_gfx_hws = 1, | 146 | .is_i965g = 1, .is_mobile = 1, .is_i9xx = 1, .need_gfx_hws = 1, |
147 | .has_hotplug = 1, | 147 | .has_hotplug = 1, .is_gen6 = 1, |
148 | }; | 148 | }; |
149 | 149 | ||
150 | const static struct pci_device_id pciidlist[] = { | 150 | const static struct pci_device_id pciidlist[] = { |
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 979439cfb827..aba8260fbc5e 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h | |||
@@ -205,6 +205,7 @@ struct intel_device_info { | |||
205 | u8 is_g4x : 1; | 205 | u8 is_g4x : 1; |
206 | u8 is_pineview : 1; | 206 | u8 is_pineview : 1; |
207 | u8 is_ironlake : 1; | 207 | u8 is_ironlake : 1; |
208 | u8 is_gen6 : 1; | ||
208 | u8 has_fbc : 1; | 209 | u8 has_fbc : 1; |
209 | u8 has_rc6 : 1; | 210 | u8 has_rc6 : 1; |
210 | u8 has_pipe_cxsr : 1; | 211 | u8 has_pipe_cxsr : 1; |
@@ -1084,6 +1085,7 @@ extern int i915_wait_ring(struct drm_device * dev, int n, const char *caller); | |||
1084 | #define IS_IRONLAKE_M(dev) ((dev)->pci_device == 0x0046) | 1085 | #define IS_IRONLAKE_M(dev) ((dev)->pci_device == 0x0046) |
1085 | #define IS_IRONLAKE(dev) (INTEL_INFO(dev)->is_ironlake) | 1086 | #define IS_IRONLAKE(dev) (INTEL_INFO(dev)->is_ironlake) |
1086 | #define IS_I9XX(dev) (INTEL_INFO(dev)->is_i9xx) | 1087 | #define IS_I9XX(dev) (INTEL_INFO(dev)->is_i9xx) |
1088 | #define IS_GEN6(dev) (INTEL_INFO(dev)->is_gen6) | ||
1087 | #define IS_MOBILE(dev) (INTEL_INFO(dev)->is_mobile) | 1089 | #define IS_MOBILE(dev) (INTEL_INFO(dev)->is_mobile) |
1088 | 1090 | ||
1089 | #define IS_GEN3(dev) (IS_I915G(dev) || \ | 1091 | #define IS_GEN3(dev) (IS_I915G(dev) || \ |
@@ -1107,8 +1109,6 @@ extern int i915_wait_ring(struct drm_device * dev, int n, const char *caller); | |||
1107 | 1109 | ||
1108 | #define I915_NEED_GFX_HWS(dev) (INTEL_INFO(dev)->need_gfx_hws) | 1110 | #define I915_NEED_GFX_HWS(dev) (INTEL_INFO(dev)->need_gfx_hws) |
1109 | 1111 | ||
1110 | #define IS_GEN6(dev) ((dev)->pci_device == 0x0102) | ||
1111 | |||
1112 | /* With the 945 and later, Y tiling got adjusted so that it was 32 128-byte | 1112 | /* With the 945 and later, Y tiling got adjusted so that it was 32 128-byte |
1113 | * rows, which changed the alignment requirements and fence programming. | 1113 | * rows, which changed the alignment requirements and fence programming. |
1114 | */ | 1114 | */ |
diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c index fba37e9f775d..933e865a8929 100644 --- a/drivers/gpu/drm/i915/i915_gem.c +++ b/drivers/gpu/drm/i915/i915_gem.c | |||
@@ -1466,9 +1466,6 @@ i915_gem_object_put_pages(struct drm_gem_object *obj) | |||
1466 | obj_priv->dirty = 0; | 1466 | obj_priv->dirty = 0; |
1467 | 1467 | ||
1468 | for (i = 0; i < page_count; i++) { | 1468 | for (i = 0; i < page_count; i++) { |
1469 | if (obj_priv->pages[i] == NULL) | ||
1470 | break; | ||
1471 | |||
1472 | if (obj_priv->dirty) | 1469 | if (obj_priv->dirty) |
1473 | set_page_dirty(obj_priv->pages[i]); | 1470 | set_page_dirty(obj_priv->pages[i]); |
1474 | 1471 | ||
@@ -2227,11 +2224,6 @@ i915_gem_evict_something(struct drm_device *dev, int min_size) | |||
2227 | seqno = i915_add_request(dev, NULL, obj->write_domain); | 2224 | seqno = i915_add_request(dev, NULL, obj->write_domain); |
2228 | if (seqno == 0) | 2225 | if (seqno == 0) |
2229 | return -ENOMEM; | 2226 | return -ENOMEM; |
2230 | |||
2231 | ret = i915_wait_request(dev, seqno); | ||
2232 | if (ret) | ||
2233 | return ret; | ||
2234 | |||
2235 | continue; | 2227 | continue; |
2236 | } | 2228 | } |
2237 | } | 2229 | } |
@@ -2256,7 +2248,6 @@ i915_gem_object_get_pages(struct drm_gem_object *obj, | |||
2256 | struct address_space *mapping; | 2248 | struct address_space *mapping; |
2257 | struct inode *inode; | 2249 | struct inode *inode; |
2258 | struct page *page; | 2250 | struct page *page; |
2259 | int ret; | ||
2260 | 2251 | ||
2261 | if (obj_priv->pages_refcount++ != 0) | 2252 | if (obj_priv->pages_refcount++ != 0) |
2262 | return 0; | 2253 | return 0; |
@@ -2279,11 +2270,9 @@ i915_gem_object_get_pages(struct drm_gem_object *obj, | |||
2279 | mapping_gfp_mask (mapping) | | 2270 | mapping_gfp_mask (mapping) | |
2280 | __GFP_COLD | | 2271 | __GFP_COLD | |
2281 | gfpmask); | 2272 | gfpmask); |
2282 | if (IS_ERR(page)) { | 2273 | if (IS_ERR(page)) |
2283 | ret = PTR_ERR(page); | 2274 | goto err_pages; |
2284 | i915_gem_object_put_pages(obj); | 2275 | |
2285 | return ret; | ||
2286 | } | ||
2287 | obj_priv->pages[i] = page; | 2276 | obj_priv->pages[i] = page; |
2288 | } | 2277 | } |
2289 | 2278 | ||
@@ -2291,6 +2280,15 @@ i915_gem_object_get_pages(struct drm_gem_object *obj, | |||
2291 | i915_gem_object_do_bit_17_swizzle(obj); | 2280 | i915_gem_object_do_bit_17_swizzle(obj); |
2292 | 2281 | ||
2293 | return 0; | 2282 | return 0; |
2283 | |||
2284 | err_pages: | ||
2285 | while (i--) | ||
2286 | page_cache_release(obj_priv->pages[i]); | ||
2287 | |||
2288 | drm_free_large(obj_priv->pages); | ||
2289 | obj_priv->pages = NULL; | ||
2290 | obj_priv->pages_refcount--; | ||
2291 | return PTR_ERR(page); | ||
2294 | } | 2292 | } |
2295 | 2293 | ||
2296 | static void sandybridge_write_fence_reg(struct drm_i915_fence_reg *reg) | 2294 | static void sandybridge_write_fence_reg(struct drm_i915_fence_reg *reg) |
@@ -4730,6 +4728,11 @@ i915_gem_init_ringbuffer(struct drm_device *dev) | |||
4730 | ring->space += ring->Size; | 4728 | ring->space += ring->Size; |
4731 | } | 4729 | } |
4732 | 4730 | ||
4731 | if (IS_I9XX(dev) && !IS_GEN3(dev)) { | ||
4732 | I915_WRITE(MI_MODE, | ||
4733 | (VS_TIMER_DISPATCH) << 16 | VS_TIMER_DISPATCH); | ||
4734 | } | ||
4735 | |||
4733 | return 0; | 4736 | return 0; |
4734 | } | 4737 | } |
4735 | 4738 | ||
diff --git a/drivers/gpu/drm/i915/i915_gem_tiling.c b/drivers/gpu/drm/i915/i915_gem_tiling.c index b5c55d88ff76..c01c878e51ba 100644 --- a/drivers/gpu/drm/i915/i915_gem_tiling.c +++ b/drivers/gpu/drm/i915/i915_gem_tiling.c | |||
@@ -325,9 +325,12 @@ i915_gem_set_tiling(struct drm_device *dev, void *data, | |||
325 | * need to ensure that any fence register is cleared. | 325 | * need to ensure that any fence register is cleared. |
326 | */ | 326 | */ |
327 | if (!i915_gem_object_fence_offset_ok(obj, args->tiling_mode)) | 327 | if (!i915_gem_object_fence_offset_ok(obj, args->tiling_mode)) |
328 | ret = i915_gem_object_unbind(obj); | 328 | ret = i915_gem_object_unbind(obj); |
329 | else if (obj_priv->fence_reg != I915_FENCE_REG_NONE) | ||
330 | ret = i915_gem_object_put_fence_reg(obj); | ||
329 | else | 331 | else |
330 | ret = i915_gem_object_put_fence_reg(obj); | 332 | i915_gem_release_mmap(obj); |
333 | |||
331 | if (ret != 0) { | 334 | if (ret != 0) { |
332 | WARN(ret != -ERESTARTSYS, | 335 | WARN(ret != -ERESTARTSYS, |
333 | "failed to reset object for tiling switch"); | 336 | "failed to reset object for tiling switch"); |
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h index 3d59862c7ccd..cbbf59f56dfa 100644 --- a/drivers/gpu/drm/i915/i915_reg.h +++ b/drivers/gpu/drm/i915/i915_reg.h | |||
@@ -298,6 +298,10 @@ | |||
298 | #define INSTDONE 0x02090 | 298 | #define INSTDONE 0x02090 |
299 | #define NOPID 0x02094 | 299 | #define NOPID 0x02094 |
300 | #define HWSTAM 0x02098 | 300 | #define HWSTAM 0x02098 |
301 | |||
302 | #define MI_MODE 0x0209c | ||
303 | # define VS_TIMER_DISPATCH (1 << 6) | ||
304 | |||
301 | #define SCPD0 0x0209c /* 915+ only */ | 305 | #define SCPD0 0x0209c /* 915+ only */ |
302 | #define IER 0x020a0 | 306 | #define IER 0x020a0 |
303 | #define IIR 0x020a4 | 307 | #define IIR 0x020a4 |
@@ -366,7 +370,7 @@ | |||
366 | #define FBC_CTL_PERIODIC (1<<30) | 370 | #define FBC_CTL_PERIODIC (1<<30) |
367 | #define FBC_CTL_INTERVAL_SHIFT (16) | 371 | #define FBC_CTL_INTERVAL_SHIFT (16) |
368 | #define FBC_CTL_UNCOMPRESSIBLE (1<<14) | 372 | #define FBC_CTL_UNCOMPRESSIBLE (1<<14) |
369 | #define FBC_C3_IDLE (1<<13) | 373 | #define FBC_CTL_C3_IDLE (1<<13) |
370 | #define FBC_CTL_STRIDE_SHIFT (5) | 374 | #define FBC_CTL_STRIDE_SHIFT (5) |
371 | #define FBC_CTL_FENCENO (1<<0) | 375 | #define FBC_CTL_FENCENO (1<<0) |
372 | #define FBC_COMMAND 0x0320c | 376 | #define FBC_COMMAND 0x0320c |
@@ -2172,6 +2176,14 @@ | |||
2172 | #define DISPLAY_PORT_PLL_BIOS_1 0x46010 | 2176 | #define DISPLAY_PORT_PLL_BIOS_1 0x46010 |
2173 | #define DISPLAY_PORT_PLL_BIOS_2 0x46014 | 2177 | #define DISPLAY_PORT_PLL_BIOS_2 0x46014 |
2174 | 2178 | ||
2179 | #define PCH_DSPCLK_GATE_D 0x42020 | ||
2180 | # define DPFDUNIT_CLOCK_GATE_DISABLE (1 << 7) | ||
2181 | # define DPARBUNIT_CLOCK_GATE_DISABLE (1 << 5) | ||
2182 | |||
2183 | #define PCH_3DCGDIS0 0x46020 | ||
2184 | # define MARIUNIT_CLOCK_GATE_DISABLE (1 << 18) | ||
2185 | # define SVSMUNIT_CLOCK_GATE_DISABLE (1 << 1) | ||
2186 | |||
2175 | #define FDI_PLL_FREQ_CTL 0x46030 | 2187 | #define FDI_PLL_FREQ_CTL 0x46030 |
2176 | #define FDI_PLL_FREQ_CHANGE_REQUEST (1<<24) | 2188 | #define FDI_PLL_FREQ_CHANGE_REQUEST (1<<24) |
2177 | #define FDI_PLL_FREQ_LOCK_LIMIT_MASK 0xfff00 | 2189 | #define FDI_PLL_FREQ_LOCK_LIMIT_MASK 0xfff00 |
diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c index 70c9d4ba7042..f9ba452f0cbf 100644 --- a/drivers/gpu/drm/i915/intel_bios.c +++ b/drivers/gpu/drm/i915/intel_bios.c | |||
@@ -417,8 +417,9 @@ parse_edp(struct drm_i915_private *dev_priv, struct bdb_header *bdb) | |||
417 | edp = find_section(bdb, BDB_EDP); | 417 | edp = find_section(bdb, BDB_EDP); |
418 | if (!edp) { | 418 | if (!edp) { |
419 | if (SUPPORTS_EDP(dev_priv->dev) && dev_priv->edp_support) { | 419 | if (SUPPORTS_EDP(dev_priv->dev) && dev_priv->edp_support) { |
420 | DRM_DEBUG_KMS("No eDP BDB found but eDP panel supported,\ | 420 | DRM_DEBUG_KMS("No eDP BDB found but eDP panel " |
421 | assume 18bpp panel color depth.\n"); | 421 | "supported, assume 18bpp panel color " |
422 | "depth.\n"); | ||
422 | dev_priv->edp_bpp = 18; | 423 | dev_priv->edp_bpp = 18; |
423 | } | 424 | } |
424 | return; | 425 | return; |
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 9cd6de5f9906..58fc7fa0eb1d 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c | |||
@@ -1032,7 +1032,7 @@ static void i8xx_enable_fbc(struct drm_crtc *crtc, unsigned long interval) | |||
1032 | /* enable it... */ | 1032 | /* enable it... */ |
1033 | fbc_ctl = FBC_CTL_EN | FBC_CTL_PERIODIC; | 1033 | fbc_ctl = FBC_CTL_EN | FBC_CTL_PERIODIC; |
1034 | if (IS_I945GM(dev)) | 1034 | if (IS_I945GM(dev)) |
1035 | fbc_ctl |= FBC_C3_IDLE; /* 945 needs special SR handling */ | 1035 | fbc_ctl |= FBC_CTL_C3_IDLE; /* 945 needs special SR handling */ |
1036 | fbc_ctl |= (dev_priv->cfb_pitch & 0xff) << FBC_CTL_STRIDE_SHIFT; | 1036 | fbc_ctl |= (dev_priv->cfb_pitch & 0xff) << FBC_CTL_STRIDE_SHIFT; |
1037 | fbc_ctl |= (interval & 0x2fff) << FBC_CTL_INTERVAL_SHIFT; | 1037 | fbc_ctl |= (interval & 0x2fff) << FBC_CTL_INTERVAL_SHIFT; |
1038 | if (obj_priv->tiling_mode != I915_TILING_NONE) | 1038 | if (obj_priv->tiling_mode != I915_TILING_NONE) |
@@ -4717,6 +4717,20 @@ void intel_init_clock_gating(struct drm_device *dev) | |||
4717 | * specs, but enable as much else as we can. | 4717 | * specs, but enable as much else as we can. |
4718 | */ | 4718 | */ |
4719 | if (HAS_PCH_SPLIT(dev)) { | 4719 | if (HAS_PCH_SPLIT(dev)) { |
4720 | uint32_t dspclk_gate = VRHUNIT_CLOCK_GATE_DISABLE; | ||
4721 | |||
4722 | if (IS_IRONLAKE(dev)) { | ||
4723 | /* Required for FBC */ | ||
4724 | dspclk_gate |= DPFDUNIT_CLOCK_GATE_DISABLE; | ||
4725 | /* Required for CxSR */ | ||
4726 | dspclk_gate |= DPARBUNIT_CLOCK_GATE_DISABLE; | ||
4727 | |||
4728 | I915_WRITE(PCH_3DCGDIS0, | ||
4729 | MARIUNIT_CLOCK_GATE_DISABLE | | ||
4730 | SVSMUNIT_CLOCK_GATE_DISABLE); | ||
4731 | } | ||
4732 | |||
4733 | I915_WRITE(PCH_DSPCLK_GATE_D, dspclk_gate); | ||
4720 | return; | 4734 | return; |
4721 | } else if (IS_G4X(dev)) { | 4735 | } else if (IS_G4X(dev)) { |
4722 | uint32_t dspclk_gate; | 4736 | uint32_t dspclk_gate; |
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c index 14e516fdc2dd..2b3fa7a3c028 100644 --- a/drivers/gpu/drm/i915/intel_lvds.c +++ b/drivers/gpu/drm/i915/intel_lvds.c | |||
@@ -607,53 +607,6 @@ static void intel_lvds_mode_set(struct drm_encoder *encoder, | |||
607 | I915_WRITE(PFIT_CONTROL, lvds_priv->pfit_control); | 607 | I915_WRITE(PFIT_CONTROL, lvds_priv->pfit_control); |
608 | } | 608 | } |
609 | 609 | ||
610 | /* Some lid devices report incorrect lid status, assume they're connected */ | ||
611 | static const struct dmi_system_id bad_lid_status[] = { | ||
612 | { | ||
613 | .ident = "Compaq nx9020", | ||
614 | .matches = { | ||
615 | DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), | ||
616 | DMI_MATCH(DMI_BOARD_NAME, "3084"), | ||
617 | }, | ||
618 | }, | ||
619 | { | ||
620 | .ident = "Samsung SX20S", | ||
621 | .matches = { | ||
622 | DMI_MATCH(DMI_SYS_VENDOR, "Samsung Electronics"), | ||
623 | DMI_MATCH(DMI_BOARD_NAME, "SX20S"), | ||
624 | }, | ||
625 | }, | ||
626 | { | ||
627 | .ident = "Aspire One", | ||
628 | .matches = { | ||
629 | DMI_MATCH(DMI_SYS_VENDOR, "Acer"), | ||
630 | DMI_MATCH(DMI_PRODUCT_NAME, "Aspire one"), | ||
631 | }, | ||
632 | }, | ||
633 | { | ||
634 | .ident = "Aspire 1810T", | ||
635 | .matches = { | ||
636 | DMI_MATCH(DMI_SYS_VENDOR, "Acer"), | ||
637 | DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 1810T"), | ||
638 | }, | ||
639 | }, | ||
640 | { | ||
641 | .ident = "PC-81005", | ||
642 | .matches = { | ||
643 | DMI_MATCH(DMI_SYS_VENDOR, "MALATA"), | ||
644 | DMI_MATCH(DMI_PRODUCT_NAME, "PC-81005"), | ||
645 | }, | ||
646 | }, | ||
647 | { | ||
648 | .ident = "Clevo M5x0N", | ||
649 | .matches = { | ||
650 | DMI_MATCH(DMI_SYS_VENDOR, "CLEVO Co."), | ||
651 | DMI_MATCH(DMI_BOARD_NAME, "M5x0N"), | ||
652 | }, | ||
653 | }, | ||
654 | { } | ||
655 | }; | ||
656 | |||
657 | /** | 610 | /** |
658 | * Detect the LVDS connection. | 611 | * Detect the LVDS connection. |
659 | * | 612 | * |
@@ -669,12 +622,9 @@ static enum drm_connector_status intel_lvds_detect(struct drm_connector *connect | |||
669 | /* ACPI lid methods were generally unreliable in this generation, so | 622 | /* ACPI lid methods were generally unreliable in this generation, so |
670 | * don't even bother. | 623 | * don't even bother. |
671 | */ | 624 | */ |
672 | if (IS_GEN2(dev)) | 625 | if (IS_GEN2(dev) || IS_GEN3(dev)) |
673 | return connector_status_connected; | 626 | return connector_status_connected; |
674 | 627 | ||
675 | if (!dmi_check_system(bad_lid_status) && !acpi_lid_open()) | ||
676 | status = connector_status_disconnected; | ||
677 | |||
678 | return status; | 628 | return status; |
679 | } | 629 | } |
680 | 630 | ||
diff --git a/drivers/gpu/drm/i915/intel_overlay.c b/drivers/gpu/drm/i915/intel_overlay.c index d355d1d527e7..60595fc26fdd 100644 --- a/drivers/gpu/drm/i915/intel_overlay.c +++ b/drivers/gpu/drm/i915/intel_overlay.c | |||
@@ -1068,14 +1068,18 @@ int intel_overlay_put_image(struct drm_device *dev, void *data, | |||
1068 | 1068 | ||
1069 | drmmode_obj = drm_mode_object_find(dev, put_image_rec->crtc_id, | 1069 | drmmode_obj = drm_mode_object_find(dev, put_image_rec->crtc_id, |
1070 | DRM_MODE_OBJECT_CRTC); | 1070 | DRM_MODE_OBJECT_CRTC); |
1071 | if (!drmmode_obj) | 1071 | if (!drmmode_obj) { |
1072 | return -ENOENT; | 1072 | ret = -ENOENT; |
1073 | goto out_free; | ||
1074 | } | ||
1073 | crtc = to_intel_crtc(obj_to_crtc(drmmode_obj)); | 1075 | crtc = to_intel_crtc(obj_to_crtc(drmmode_obj)); |
1074 | 1076 | ||
1075 | new_bo = drm_gem_object_lookup(dev, file_priv, | 1077 | new_bo = drm_gem_object_lookup(dev, file_priv, |
1076 | put_image_rec->bo_handle); | 1078 | put_image_rec->bo_handle); |
1077 | if (!new_bo) | 1079 | if (!new_bo) { |
1078 | return -ENOENT; | 1080 | ret = -ENOENT; |
1081 | goto out_free; | ||
1082 | } | ||
1079 | 1083 | ||
1080 | mutex_lock(&dev->mode_config.mutex); | 1084 | mutex_lock(&dev->mode_config.mutex); |
1081 | mutex_lock(&dev->struct_mutex); | 1085 | mutex_lock(&dev->struct_mutex); |
@@ -1165,6 +1169,7 @@ out_unlock: | |||
1165 | mutex_unlock(&dev->struct_mutex); | 1169 | mutex_unlock(&dev->struct_mutex); |
1166 | mutex_unlock(&dev->mode_config.mutex); | 1170 | mutex_unlock(&dev->mode_config.mutex); |
1167 | drm_gem_object_unreference_unlocked(new_bo); | 1171 | drm_gem_object_unreference_unlocked(new_bo); |
1172 | out_free: | ||
1168 | kfree(params); | 1173 | kfree(params); |
1169 | 1174 | ||
1170 | return ret; | 1175 | return ret; |
diff --git a/drivers/i2c/busses/i2c-scmi.c b/drivers/i2c/busses/i2c-scmi.c index 365e0becaf12..388cbdc96db7 100644 --- a/drivers/i2c/busses/i2c-scmi.c +++ b/drivers/i2c/busses/i2c-scmi.c | |||
@@ -33,6 +33,7 @@ struct acpi_smbus_cmi { | |||
33 | u8 cap_info:1; | 33 | u8 cap_info:1; |
34 | u8 cap_read:1; | 34 | u8 cap_read:1; |
35 | u8 cap_write:1; | 35 | u8 cap_write:1; |
36 | struct smbus_methods_t *methods; | ||
36 | }; | 37 | }; |
37 | 38 | ||
38 | static const struct smbus_methods_t smbus_methods = { | 39 | static const struct smbus_methods_t smbus_methods = { |
@@ -41,10 +42,19 @@ static const struct smbus_methods_t smbus_methods = { | |||
41 | .mt_sbw = "_SBW", | 42 | .mt_sbw = "_SBW", |
42 | }; | 43 | }; |
43 | 44 | ||
45 | /* Some IBM BIOSes omit the leading underscore */ | ||
46 | static const struct smbus_methods_t ibm_smbus_methods = { | ||
47 | .mt_info = "SBI_", | ||
48 | .mt_sbr = "SBR_", | ||
49 | .mt_sbw = "SBW_", | ||
50 | }; | ||
51 | |||
44 | static const struct acpi_device_id acpi_smbus_cmi_ids[] = { | 52 | static const struct acpi_device_id acpi_smbus_cmi_ids[] = { |
45 | {"SMBUS01", 0}, | 53 | {"SMBUS01", (kernel_ulong_t)&smbus_methods}, |
54 | {ACPI_SMBUS_IBM_HID, (kernel_ulong_t)&ibm_smbus_methods}, | ||
46 | {"", 0} | 55 | {"", 0} |
47 | }; | 56 | }; |
57 | MODULE_DEVICE_TABLE(acpi, acpi_smbus_cmi_ids); | ||
48 | 58 | ||
49 | #define ACPI_SMBUS_STATUS_OK 0x00 | 59 | #define ACPI_SMBUS_STATUS_OK 0x00 |
50 | #define ACPI_SMBUS_STATUS_FAIL 0x07 | 60 | #define ACPI_SMBUS_STATUS_FAIL 0x07 |
@@ -150,11 +160,11 @@ acpi_smbus_cmi_access(struct i2c_adapter *adap, u16 addr, unsigned short flags, | |||
150 | 160 | ||
151 | if (read_write == I2C_SMBUS_READ) { | 161 | if (read_write == I2C_SMBUS_READ) { |
152 | protocol |= ACPI_SMBUS_PRTCL_READ; | 162 | protocol |= ACPI_SMBUS_PRTCL_READ; |
153 | method = smbus_methods.mt_sbr; | 163 | method = smbus_cmi->methods->mt_sbr; |
154 | input.count = 3; | 164 | input.count = 3; |
155 | } else { | 165 | } else { |
156 | protocol |= ACPI_SMBUS_PRTCL_WRITE; | 166 | protocol |= ACPI_SMBUS_PRTCL_WRITE; |
157 | method = smbus_methods.mt_sbw; | 167 | method = smbus_cmi->methods->mt_sbw; |
158 | input.count = 5; | 168 | input.count = 5; |
159 | } | 169 | } |
160 | 170 | ||
@@ -290,13 +300,13 @@ static int acpi_smbus_cmi_add_cap(struct acpi_smbus_cmi *smbus_cmi, | |||
290 | union acpi_object *obj; | 300 | union acpi_object *obj; |
291 | acpi_status status; | 301 | acpi_status status; |
292 | 302 | ||
293 | if (!strcmp(name, smbus_methods.mt_info)) { | 303 | if (!strcmp(name, smbus_cmi->methods->mt_info)) { |
294 | status = acpi_evaluate_object(smbus_cmi->handle, | 304 | status = acpi_evaluate_object(smbus_cmi->handle, |
295 | smbus_methods.mt_info, | 305 | smbus_cmi->methods->mt_info, |
296 | NULL, &buffer); | 306 | NULL, &buffer); |
297 | if (ACPI_FAILURE(status)) { | 307 | if (ACPI_FAILURE(status)) { |
298 | ACPI_ERROR((AE_INFO, "Evaluating %s: %i", | 308 | ACPI_ERROR((AE_INFO, "Evaluating %s: %i", |
299 | smbus_methods.mt_info, status)); | 309 | smbus_cmi->methods->mt_info, status)); |
300 | return -EIO; | 310 | return -EIO; |
301 | } | 311 | } |
302 | 312 | ||
@@ -319,9 +329,9 @@ static int acpi_smbus_cmi_add_cap(struct acpi_smbus_cmi *smbus_cmi, | |||
319 | 329 | ||
320 | kfree(buffer.pointer); | 330 | kfree(buffer.pointer); |
321 | smbus_cmi->cap_info = 1; | 331 | smbus_cmi->cap_info = 1; |
322 | } else if (!strcmp(name, smbus_methods.mt_sbr)) | 332 | } else if (!strcmp(name, smbus_cmi->methods->mt_sbr)) |
323 | smbus_cmi->cap_read = 1; | 333 | smbus_cmi->cap_read = 1; |
324 | else if (!strcmp(name, smbus_methods.mt_sbw)) | 334 | else if (!strcmp(name, smbus_cmi->methods->mt_sbw)) |
325 | smbus_cmi->cap_write = 1; | 335 | smbus_cmi->cap_write = 1; |
326 | else | 336 | else |
327 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Unsupported CMI method: %s\n", | 337 | ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Unsupported CMI method: %s\n", |
@@ -349,6 +359,7 @@ static acpi_status acpi_smbus_cmi_query_methods(acpi_handle handle, u32 level, | |||
349 | static int acpi_smbus_cmi_add(struct acpi_device *device) | 359 | static int acpi_smbus_cmi_add(struct acpi_device *device) |
350 | { | 360 | { |
351 | struct acpi_smbus_cmi *smbus_cmi; | 361 | struct acpi_smbus_cmi *smbus_cmi; |
362 | const struct acpi_device_id *id; | ||
352 | 363 | ||
353 | smbus_cmi = kzalloc(sizeof(struct acpi_smbus_cmi), GFP_KERNEL); | 364 | smbus_cmi = kzalloc(sizeof(struct acpi_smbus_cmi), GFP_KERNEL); |
354 | if (!smbus_cmi) | 365 | if (!smbus_cmi) |
@@ -362,6 +373,11 @@ static int acpi_smbus_cmi_add(struct acpi_device *device) | |||
362 | smbus_cmi->cap_read = 0; | 373 | smbus_cmi->cap_read = 0; |
363 | smbus_cmi->cap_write = 0; | 374 | smbus_cmi->cap_write = 0; |
364 | 375 | ||
376 | for (id = acpi_smbus_cmi_ids; id->id[0]; id++) | ||
377 | if (!strcmp(id->id, acpi_device_hid(device))) | ||
378 | smbus_cmi->methods = | ||
379 | (struct smbus_methods_t *) id->driver_data; | ||
380 | |||
365 | acpi_walk_namespace(ACPI_TYPE_METHOD, smbus_cmi->handle, 1, | 381 | acpi_walk_namespace(ACPI_TYPE_METHOD, smbus_cmi->handle, 1, |
366 | acpi_smbus_cmi_query_methods, NULL, smbus_cmi, NULL); | 382 | acpi_smbus_cmi_query_methods, NULL, smbus_cmi, NULL); |
367 | 383 | ||
diff --git a/drivers/misc/c2port/core.c b/drivers/misc/c2port/core.c index b5346b4db91a..b7a85f46a6c2 100644 --- a/drivers/misc/c2port/core.c +++ b/drivers/misc/c2port/core.c | |||
@@ -912,8 +912,8 @@ struct c2port_device *c2port_device_register(char *name, | |||
912 | 912 | ||
913 | c2dev->dev = device_create(c2port_class, NULL, 0, c2dev, | 913 | c2dev->dev = device_create(c2port_class, NULL, 0, c2dev, |
914 | "c2port%d", id); | 914 | "c2port%d", id); |
915 | if (unlikely(!c2dev->dev)) { | 915 | if (unlikely(IS_ERR(c2dev->dev))) { |
916 | ret = -ENOMEM; | 916 | ret = PTR_ERR(c2dev->dev); |
917 | goto error_device_create; | 917 | goto error_device_create; |
918 | } | 918 | } |
919 | dev_set_drvdata(c2dev->dev, c2dev); | 919 | dev_set_drvdata(c2dev->dev, c2dev); |
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index 0eac6c814904..e041c003db22 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c | |||
@@ -225,7 +225,7 @@ static int mmc_read_ext_csd(struct mmc_card *card) | |||
225 | mmc_card_set_blockaddr(card); | 225 | mmc_card_set_blockaddr(card); |
226 | } | 226 | } |
227 | 227 | ||
228 | switch (ext_csd[EXT_CSD_CARD_TYPE]) { | 228 | switch (ext_csd[EXT_CSD_CARD_TYPE] & EXT_CSD_CARD_TYPE_MASK) { |
229 | case EXT_CSD_CARD_TYPE_52 | EXT_CSD_CARD_TYPE_26: | 229 | case EXT_CSD_CARD_TYPE_52 | EXT_CSD_CARD_TYPE_26: |
230 | card->ext_csd.hs_max_dtr = 52000000; | 230 | card->ext_csd.hs_max_dtr = 52000000; |
231 | break; | 231 | break; |
@@ -237,7 +237,6 @@ static int mmc_read_ext_csd(struct mmc_card *card) | |||
237 | printk(KERN_WARNING "%s: card is mmc v4 but doesn't " | 237 | printk(KERN_WARNING "%s: card is mmc v4 but doesn't " |
238 | "support any high-speed modes.\n", | 238 | "support any high-speed modes.\n", |
239 | mmc_hostname(card->host)); | 239 | mmc_hostname(card->host)); |
240 | goto out; | ||
241 | } | 240 | } |
242 | 241 | ||
243 | if (card->ext_csd.rev >= 3) { | 242 | if (card->ext_csd.rev >= 3) { |
diff --git a/drivers/net/arm/ks8695net.c b/drivers/net/arm/ks8695net.c index a1d4188c430b..e7810b74f396 100644 --- a/drivers/net/arm/ks8695net.c +++ b/drivers/net/arm/ks8695net.c | |||
@@ -449,11 +449,10 @@ ks8695_rx_irq(int irq, void *dev_id) | |||
449 | } | 449 | } |
450 | 450 | ||
451 | /** | 451 | /** |
452 | * ks8695_rx - Receive packets called by NAPI poll method | 452 | * ks8695_rx - Receive packets called by NAPI poll method |
453 | * @ksp: Private data for the KS8695 Ethernet | 453 | * @ksp: Private data for the KS8695 Ethernet |
454 | * @budget: The max packets would be receive | 454 | * @budget: Number of packets allowed to process |
455 | */ | 455 | */ |
456 | |||
457 | static int ks8695_rx(struct ks8695_priv *ksp, int budget) | 456 | static int ks8695_rx(struct ks8695_priv *ksp, int budget) |
458 | { | 457 | { |
459 | struct net_device *ndev = ksp->ndev; | 458 | struct net_device *ndev = ksp->ndev; |
@@ -461,7 +460,6 @@ static int ks8695_rx(struct ks8695_priv *ksp, int budget) | |||
461 | int buff_n; | 460 | int buff_n; |
462 | u32 flags; | 461 | u32 flags; |
463 | int pktlen; | 462 | int pktlen; |
464 | int last_rx_processed = -1; | ||
465 | int received = 0; | 463 | int received = 0; |
466 | 464 | ||
467 | buff_n = ksp->next_rx_desc_read; | 465 | buff_n = ksp->next_rx_desc_read; |
@@ -471,6 +469,7 @@ static int ks8695_rx(struct ks8695_priv *ksp, int budget) | |||
471 | cpu_to_le32(RDES_OWN)))) { | 469 | cpu_to_le32(RDES_OWN)))) { |
472 | rmb(); | 470 | rmb(); |
473 | flags = le32_to_cpu(ksp->rx_ring[buff_n].status); | 471 | flags = le32_to_cpu(ksp->rx_ring[buff_n].status); |
472 | |||
474 | /* Found an SKB which we own, this means we | 473 | /* Found an SKB which we own, this means we |
475 | * received a packet | 474 | * received a packet |
476 | */ | 475 | */ |
@@ -533,23 +532,18 @@ rx_failure: | |||
533 | ksp->rx_ring[buff_n].status = cpu_to_le32(RDES_OWN); | 532 | ksp->rx_ring[buff_n].status = cpu_to_le32(RDES_OWN); |
534 | rx_finished: | 533 | rx_finished: |
535 | received++; | 534 | received++; |
536 | /* And note this as processed so we can start | ||
537 | * from here next time | ||
538 | */ | ||
539 | last_rx_processed = buff_n; | ||
540 | buff_n = (buff_n + 1) & MAX_RX_DESC_MASK; | 535 | buff_n = (buff_n + 1) & MAX_RX_DESC_MASK; |
541 | /*And note which RX descriptor we last did */ | ||
542 | if (likely(last_rx_processed != -1)) | ||
543 | ksp->next_rx_desc_read = | ||
544 | (last_rx_processed + 1) & | ||
545 | MAX_RX_DESC_MASK; | ||
546 | } | 536 | } |
537 | |||
538 | /* And note which RX descriptor we last did */ | ||
539 | ksp->next_rx_desc_read = buff_n; | ||
540 | |||
547 | /* And refill the buffers */ | 541 | /* And refill the buffers */ |
548 | ks8695_refill_rxbuffers(ksp); | 542 | ks8695_refill_rxbuffers(ksp); |
549 | 543 | ||
550 | /* Kick the RX DMA engine, in case it became | 544 | /* Kick the RX DMA engine, in case it became suspended */ |
551 | * suspended */ | ||
552 | ks8695_writereg(ksp, KS8695_DRSC, 0); | 545 | ks8695_writereg(ksp, KS8695_DRSC, 0); |
546 | |||
553 | return received; | 547 | return received; |
554 | } | 548 | } |
555 | 549 | ||
diff --git a/drivers/net/igb/e1000_82575.c b/drivers/net/igb/e1000_82575.c index 9d7fa2fb85ea..0bc990ec4a8e 100644 --- a/drivers/net/igb/e1000_82575.c +++ b/drivers/net/igb/e1000_82575.c | |||
@@ -94,6 +94,7 @@ static s32 igb_get_invariants_82575(struct e1000_hw *hw) | |||
94 | case E1000_DEV_ID_82576_FIBER: | 94 | case E1000_DEV_ID_82576_FIBER: |
95 | case E1000_DEV_ID_82576_SERDES: | 95 | case E1000_DEV_ID_82576_SERDES: |
96 | case E1000_DEV_ID_82576_QUAD_COPPER: | 96 | case E1000_DEV_ID_82576_QUAD_COPPER: |
97 | case E1000_DEV_ID_82576_QUAD_COPPER_ET2: | ||
97 | case E1000_DEV_ID_82576_SERDES_QUAD: | 98 | case E1000_DEV_ID_82576_SERDES_QUAD: |
98 | mac->type = e1000_82576; | 99 | mac->type = e1000_82576; |
99 | break; | 100 | break; |
diff --git a/drivers/net/igb/e1000_hw.h b/drivers/net/igb/e1000_hw.h index 448005276b26..82a533f5192a 100644 --- a/drivers/net/igb/e1000_hw.h +++ b/drivers/net/igb/e1000_hw.h | |||
@@ -41,6 +41,7 @@ struct e1000_hw; | |||
41 | #define E1000_DEV_ID_82576_FIBER 0x10E6 | 41 | #define E1000_DEV_ID_82576_FIBER 0x10E6 |
42 | #define E1000_DEV_ID_82576_SERDES 0x10E7 | 42 | #define E1000_DEV_ID_82576_SERDES 0x10E7 |
43 | #define E1000_DEV_ID_82576_QUAD_COPPER 0x10E8 | 43 | #define E1000_DEV_ID_82576_QUAD_COPPER 0x10E8 |
44 | #define E1000_DEV_ID_82576_QUAD_COPPER_ET2 0x1526 | ||
44 | #define E1000_DEV_ID_82576_NS 0x150A | 45 | #define E1000_DEV_ID_82576_NS 0x150A |
45 | #define E1000_DEV_ID_82576_NS_SERDES 0x1518 | 46 | #define E1000_DEV_ID_82576_NS_SERDES 0x1518 |
46 | #define E1000_DEV_ID_82576_SERDES_QUAD 0x150D | 47 | #define E1000_DEV_ID_82576_SERDES_QUAD 0x150D |
diff --git a/drivers/net/igb/igb_main.c b/drivers/net/igb/igb_main.c index 0ed25f059a00..45a0e4fd5871 100644 --- a/drivers/net/igb/igb_main.c +++ b/drivers/net/igb/igb_main.c | |||
@@ -72,6 +72,7 @@ static DEFINE_PCI_DEVICE_TABLE(igb_pci_tbl) = { | |||
72 | { PCI_VDEVICE(INTEL, E1000_DEV_ID_82576_FIBER), board_82575 }, | 72 | { PCI_VDEVICE(INTEL, E1000_DEV_ID_82576_FIBER), board_82575 }, |
73 | { PCI_VDEVICE(INTEL, E1000_DEV_ID_82576_SERDES), board_82575 }, | 73 | { PCI_VDEVICE(INTEL, E1000_DEV_ID_82576_SERDES), board_82575 }, |
74 | { PCI_VDEVICE(INTEL, E1000_DEV_ID_82576_SERDES_QUAD), board_82575 }, | 74 | { PCI_VDEVICE(INTEL, E1000_DEV_ID_82576_SERDES_QUAD), board_82575 }, |
75 | { PCI_VDEVICE(INTEL, E1000_DEV_ID_82576_QUAD_COPPER_ET2), board_82575 }, | ||
75 | { PCI_VDEVICE(INTEL, E1000_DEV_ID_82576_QUAD_COPPER), board_82575 }, | 76 | { PCI_VDEVICE(INTEL, E1000_DEV_ID_82576_QUAD_COPPER), board_82575 }, |
76 | { PCI_VDEVICE(INTEL, E1000_DEV_ID_82575EB_COPPER), board_82575 }, | 77 | { PCI_VDEVICE(INTEL, E1000_DEV_ID_82575EB_COPPER), board_82575 }, |
77 | { PCI_VDEVICE(INTEL, E1000_DEV_ID_82575EB_FIBER_SERDES), board_82575 }, | 78 | { PCI_VDEVICE(INTEL, E1000_DEV_ID_82575EB_FIBER_SERDES), board_82575 }, |
diff --git a/drivers/net/ixgbe/ixgbe_82599.c b/drivers/net/ixgbe/ixgbe_82599.c index 1f30e163bd9c..b405a00817c6 100644 --- a/drivers/net/ixgbe/ixgbe_82599.c +++ b/drivers/net/ixgbe/ixgbe_82599.c | |||
@@ -39,6 +39,7 @@ | |||
39 | #define IXGBE_82599_MC_TBL_SIZE 128 | 39 | #define IXGBE_82599_MC_TBL_SIZE 128 |
40 | #define IXGBE_82599_VFT_TBL_SIZE 128 | 40 | #define IXGBE_82599_VFT_TBL_SIZE 128 |
41 | 41 | ||
42 | void ixgbe_flap_tx_laser_multispeed_fiber(struct ixgbe_hw *hw); | ||
42 | s32 ixgbe_setup_mac_link_multispeed_fiber(struct ixgbe_hw *hw, | 43 | s32 ixgbe_setup_mac_link_multispeed_fiber(struct ixgbe_hw *hw, |
43 | ixgbe_link_speed speed, | 44 | ixgbe_link_speed speed, |
44 | bool autoneg, | 45 | bool autoneg, |
@@ -68,7 +69,9 @@ static void ixgbe_init_mac_link_ops_82599(struct ixgbe_hw *hw) | |||
68 | if (hw->phy.multispeed_fiber) { | 69 | if (hw->phy.multispeed_fiber) { |
69 | /* Set up dual speed SFP+ support */ | 70 | /* Set up dual speed SFP+ support */ |
70 | mac->ops.setup_link = &ixgbe_setup_mac_link_multispeed_fiber; | 71 | mac->ops.setup_link = &ixgbe_setup_mac_link_multispeed_fiber; |
72 | mac->ops.flap_tx_laser = &ixgbe_flap_tx_laser_multispeed_fiber; | ||
71 | } else { | 73 | } else { |
74 | mac->ops.flap_tx_laser = NULL; | ||
72 | if ((mac->ops.get_media_type(hw) == | 75 | if ((mac->ops.get_media_type(hw) == |
73 | ixgbe_media_type_backplane) && | 76 | ixgbe_media_type_backplane) && |
74 | (hw->phy.smart_speed == ixgbe_smart_speed_auto || | 77 | (hw->phy.smart_speed == ixgbe_smart_speed_auto || |
@@ -413,6 +416,41 @@ s32 ixgbe_start_mac_link_82599(struct ixgbe_hw *hw, | |||
413 | } | 416 | } |
414 | 417 | ||
415 | /** | 418 | /** |
419 | * ixgbe_flap_tx_laser_multispeed_fiber - Flap Tx laser | ||
420 | * @hw: pointer to hardware structure | ||
421 | * | ||
422 | * When the driver changes the link speeds that it can support, | ||
423 | * it sets autotry_restart to true to indicate that we need to | ||
424 | * initiate a new autotry session with the link partner. To do | ||
425 | * so, we set the speed then disable and re-enable the tx laser, to | ||
426 | * alert the link partner that it also needs to restart autotry on its | ||
427 | * end. This is consistent with true clause 37 autoneg, which also | ||
428 | * involves a loss of signal. | ||
429 | **/ | ||
430 | void ixgbe_flap_tx_laser_multispeed_fiber(struct ixgbe_hw *hw) | ||
431 | { | ||
432 | u32 esdp_reg = IXGBE_READ_REG(hw, IXGBE_ESDP); | ||
433 | |||
434 | hw_dbg(hw, "ixgbe_flap_tx_laser_multispeed_fiber\n"); | ||
435 | |||
436 | if (hw->mac.autotry_restart) { | ||
437 | /* Disable tx laser; allow 100us to go dark per spec */ | ||
438 | esdp_reg |= IXGBE_ESDP_SDP3; | ||
439 | IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp_reg); | ||
440 | IXGBE_WRITE_FLUSH(hw); | ||
441 | udelay(100); | ||
442 | |||
443 | /* Enable tx laser; allow 100ms to light up */ | ||
444 | esdp_reg &= ~IXGBE_ESDP_SDP3; | ||
445 | IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp_reg); | ||
446 | IXGBE_WRITE_FLUSH(hw); | ||
447 | msleep(100); | ||
448 | |||
449 | hw->mac.autotry_restart = false; | ||
450 | } | ||
451 | } | ||
452 | |||
453 | /** | ||
416 | * ixgbe_setup_mac_link_multispeed_fiber - Set MAC link speed | 454 | * ixgbe_setup_mac_link_multispeed_fiber - Set MAC link speed |
417 | * @hw: pointer to hardware structure | 455 | * @hw: pointer to hardware structure |
418 | * @speed: new link speed | 456 | * @speed: new link speed |
@@ -440,16 +478,6 @@ s32 ixgbe_setup_mac_link_multispeed_fiber(struct ixgbe_hw *hw, | |||
440 | speed &= phy_link_speed; | 478 | speed &= phy_link_speed; |
441 | 479 | ||
442 | /* | 480 | /* |
443 | * When the driver changes the link speeds that it can support, | ||
444 | * it sets autotry_restart to true to indicate that we need to | ||
445 | * initiate a new autotry session with the link partner. To do | ||
446 | * so, we set the speed then disable and re-enable the tx laser, to | ||
447 | * alert the link partner that it also needs to restart autotry on its | ||
448 | * end. This is consistent with true clause 37 autoneg, which also | ||
449 | * involves a loss of signal. | ||
450 | */ | ||
451 | |||
452 | /* | ||
453 | * Try each speed one by one, highest priority first. We do this in | 481 | * Try each speed one by one, highest priority first. We do this in |
454 | * software because 10gb fiber doesn't support speed autonegotiation. | 482 | * software because 10gb fiber doesn't support speed autonegotiation. |
455 | */ | 483 | */ |
@@ -466,6 +494,7 @@ s32 ixgbe_setup_mac_link_multispeed_fiber(struct ixgbe_hw *hw, | |||
466 | /* Set the module link speed */ | 494 | /* Set the module link speed */ |
467 | esdp_reg |= (IXGBE_ESDP_SDP5_DIR | IXGBE_ESDP_SDP5); | 495 | esdp_reg |= (IXGBE_ESDP_SDP5_DIR | IXGBE_ESDP_SDP5); |
468 | IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp_reg); | 496 | IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp_reg); |
497 | IXGBE_WRITE_FLUSH(hw); | ||
469 | 498 | ||
470 | /* Allow module to change analog characteristics (1G->10G) */ | 499 | /* Allow module to change analog characteristics (1G->10G) */ |
471 | msleep(40); | 500 | msleep(40); |
@@ -478,19 +507,7 @@ s32 ixgbe_setup_mac_link_multispeed_fiber(struct ixgbe_hw *hw, | |||
478 | return status; | 507 | return status; |
479 | 508 | ||
480 | /* Flap the tx laser if it has not already been done */ | 509 | /* Flap the tx laser if it has not already been done */ |
481 | if (hw->mac.autotry_restart) { | 510 | hw->mac.ops.flap_tx_laser(hw); |
482 | /* Disable tx laser; allow 100us to go dark per spec */ | ||
483 | esdp_reg |= IXGBE_ESDP_SDP3; | ||
484 | IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp_reg); | ||
485 | udelay(100); | ||
486 | |||
487 | /* Enable tx laser; allow 2ms to light up per spec */ | ||
488 | esdp_reg &= ~IXGBE_ESDP_SDP3; | ||
489 | IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp_reg); | ||
490 | msleep(2); | ||
491 | |||
492 | hw->mac.autotry_restart = false; | ||
493 | } | ||
494 | 511 | ||
495 | /* | 512 | /* |
496 | * Wait for the controller to acquire link. Per IEEE 802.3ap, | 513 | * Wait for the controller to acquire link. Per IEEE 802.3ap, |
@@ -525,6 +542,7 @@ s32 ixgbe_setup_mac_link_multispeed_fiber(struct ixgbe_hw *hw, | |||
525 | esdp_reg &= ~IXGBE_ESDP_SDP5; | 542 | esdp_reg &= ~IXGBE_ESDP_SDP5; |
526 | esdp_reg |= IXGBE_ESDP_SDP5_DIR; | 543 | esdp_reg |= IXGBE_ESDP_SDP5_DIR; |
527 | IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp_reg); | 544 | IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp_reg); |
545 | IXGBE_WRITE_FLUSH(hw); | ||
528 | 546 | ||
529 | /* Allow module to change analog characteristics (10G->1G) */ | 547 | /* Allow module to change analog characteristics (10G->1G) */ |
530 | msleep(40); | 548 | msleep(40); |
@@ -537,19 +555,7 @@ s32 ixgbe_setup_mac_link_multispeed_fiber(struct ixgbe_hw *hw, | |||
537 | return status; | 555 | return status; |
538 | 556 | ||
539 | /* Flap the tx laser if it has not already been done */ | 557 | /* Flap the tx laser if it has not already been done */ |
540 | if (hw->mac.autotry_restart) { | 558 | hw->mac.ops.flap_tx_laser(hw); |
541 | /* Disable tx laser; allow 100us to go dark per spec */ | ||
542 | esdp_reg |= IXGBE_ESDP_SDP3; | ||
543 | IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp_reg); | ||
544 | udelay(100); | ||
545 | |||
546 | /* Enable tx laser; allow 2ms to light up per spec */ | ||
547 | esdp_reg &= ~IXGBE_ESDP_SDP3; | ||
548 | IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp_reg); | ||
549 | msleep(2); | ||
550 | |||
551 | hw->mac.autotry_restart = false; | ||
552 | } | ||
553 | 559 | ||
554 | /* Wait for the link partner to also set speed */ | 560 | /* Wait for the link partner to also set speed */ |
555 | msleep(100); | 561 | msleep(100); |
diff --git a/drivers/net/ixgbe/ixgbe_fcoe.c b/drivers/net/ixgbe/ixgbe_fcoe.c index 4123dec0dfb7..700cfc0aa1b9 100644 --- a/drivers/net/ixgbe/ixgbe_fcoe.c +++ b/drivers/net/ixgbe/ixgbe_fcoe.c | |||
@@ -614,9 +614,9 @@ int ixgbe_fcoe_enable(struct net_device *netdev) | |||
614 | netdev->vlan_features |= NETIF_F_FSO; | 614 | netdev->vlan_features |= NETIF_F_FSO; |
615 | netdev->vlan_features |= NETIF_F_FCOE_MTU; | 615 | netdev->vlan_features |= NETIF_F_FCOE_MTU; |
616 | netdev->fcoe_ddp_xid = IXGBE_FCOE_DDP_MAX - 1; | 616 | netdev->fcoe_ddp_xid = IXGBE_FCOE_DDP_MAX - 1; |
617 | netdev_features_change(netdev); | ||
618 | 617 | ||
619 | ixgbe_init_interrupt_scheme(adapter); | 618 | ixgbe_init_interrupt_scheme(adapter); |
619 | netdev_features_change(netdev); | ||
620 | 620 | ||
621 | if (netif_running(netdev)) | 621 | if (netif_running(netdev)) |
622 | netdev->netdev_ops->ndo_open(netdev); | 622 | netdev->netdev_ops->ndo_open(netdev); |
@@ -660,11 +660,11 @@ int ixgbe_fcoe_disable(struct net_device *netdev) | |||
660 | netdev->vlan_features &= ~NETIF_F_FSO; | 660 | netdev->vlan_features &= ~NETIF_F_FSO; |
661 | netdev->vlan_features &= ~NETIF_F_FCOE_MTU; | 661 | netdev->vlan_features &= ~NETIF_F_FCOE_MTU; |
662 | netdev->fcoe_ddp_xid = 0; | 662 | netdev->fcoe_ddp_xid = 0; |
663 | netdev_features_change(netdev); | ||
664 | 663 | ||
665 | ixgbe_cleanup_fcoe(adapter); | 664 | ixgbe_cleanup_fcoe(adapter); |
666 | |||
667 | ixgbe_init_interrupt_scheme(adapter); | 665 | ixgbe_init_interrupt_scheme(adapter); |
666 | netdev_features_change(netdev); | ||
667 | |||
668 | if (netif_running(netdev)) | 668 | if (netif_running(netdev)) |
669 | netdev->netdev_ops->ndo_open(netdev); | 669 | netdev->netdev_ops->ndo_open(netdev); |
670 | rc = 0; | 670 | rc = 0; |
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index 684af371462d..d75c46ff31f6 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -935,10 +935,12 @@ static bool ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector, | |||
935 | if (skb->prev) | 935 | if (skb->prev) |
936 | skb = ixgbe_transform_rsc_queue(skb, &(rx_ring->rsc_count)); | 936 | skb = ixgbe_transform_rsc_queue(skb, &(rx_ring->rsc_count)); |
937 | if (adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED) { | 937 | if (adapter->flags2 & IXGBE_FLAG2_RSC_ENABLED) { |
938 | if (IXGBE_RSC_CB(skb)->dma) | 938 | if (IXGBE_RSC_CB(skb)->dma) { |
939 | pci_unmap_single(pdev, IXGBE_RSC_CB(skb)->dma, | 939 | pci_unmap_single(pdev, IXGBE_RSC_CB(skb)->dma, |
940 | rx_ring->rx_buf_len, | 940 | rx_ring->rx_buf_len, |
941 | PCI_DMA_FROMDEVICE); | 941 | PCI_DMA_FROMDEVICE); |
942 | IXGBE_RSC_CB(skb)->dma = 0; | ||
943 | } | ||
942 | if (rx_ring->flags & IXGBE_RING_RX_PS_ENABLED) | 944 | if (rx_ring->flags & IXGBE_RING_RX_PS_ENABLED) |
943 | rx_ring->rsc_count += skb_shinfo(skb)->nr_frags; | 945 | rx_ring->rsc_count += skb_shinfo(skb)->nr_frags; |
944 | else | 946 | else |
@@ -3126,10 +3128,12 @@ static void ixgbe_clean_rx_ring(struct ixgbe_adapter *adapter, | |||
3126 | rx_buffer_info->skb = NULL; | 3128 | rx_buffer_info->skb = NULL; |
3127 | do { | 3129 | do { |
3128 | struct sk_buff *this = skb; | 3130 | struct sk_buff *this = skb; |
3129 | if (IXGBE_RSC_CB(this)->dma) | 3131 | if (IXGBE_RSC_CB(this)->dma) { |
3130 | pci_unmap_single(pdev, IXGBE_RSC_CB(this)->dma, | 3132 | pci_unmap_single(pdev, IXGBE_RSC_CB(this)->dma, |
3131 | rx_ring->rx_buf_len, | 3133 | rx_ring->rx_buf_len, |
3132 | PCI_DMA_FROMDEVICE); | 3134 | PCI_DMA_FROMDEVICE); |
3135 | IXGBE_RSC_CB(this)->dma = 0; | ||
3136 | } | ||
3133 | skb = skb->prev; | 3137 | skb = skb->prev; |
3134 | dev_kfree_skb(this); | 3138 | dev_kfree_skb(this); |
3135 | } while (skb); | 3139 | } while (skb); |
@@ -5018,6 +5022,7 @@ static void ixgbe_multispeed_fiber_task(struct work_struct *work) | |||
5018 | autoneg = hw->phy.autoneg_advertised; | 5022 | autoneg = hw->phy.autoneg_advertised; |
5019 | if ((!autoneg) && (hw->mac.ops.get_link_capabilities)) | 5023 | if ((!autoneg) && (hw->mac.ops.get_link_capabilities)) |
5020 | hw->mac.ops.get_link_capabilities(hw, &autoneg, &negotiation); | 5024 | hw->mac.ops.get_link_capabilities(hw, &autoneg, &negotiation); |
5025 | hw->mac.autotry_restart = false; | ||
5021 | if (hw->mac.ops.setup_link) | 5026 | if (hw->mac.ops.setup_link) |
5022 | hw->mac.ops.setup_link(hw, autoneg, negotiation, true); | 5027 | hw->mac.ops.setup_link(hw, autoneg, negotiation, true); |
5023 | adapter->flags |= IXGBE_FLAG_NEED_LINK_UPDATE; | 5028 | adapter->flags |= IXGBE_FLAG_NEED_LINK_UPDATE; |
@@ -6245,9 +6250,6 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev, | |||
6245 | case IXGBE_DEV_ID_82599_KX4: | 6250 | case IXGBE_DEV_ID_82599_KX4: |
6246 | adapter->wol = (IXGBE_WUFC_MAG | IXGBE_WUFC_EX | | 6251 | adapter->wol = (IXGBE_WUFC_MAG | IXGBE_WUFC_EX | |
6247 | IXGBE_WUFC_MC | IXGBE_WUFC_BC); | 6252 | IXGBE_WUFC_MC | IXGBE_WUFC_BC); |
6248 | /* Enable ACPI wakeup in GRC */ | ||
6249 | IXGBE_WRITE_REG(hw, IXGBE_GRC, | ||
6250 | (IXGBE_READ_REG(hw, IXGBE_GRC) & ~IXGBE_GRC_APME)); | ||
6251 | break; | 6253 | break; |
6252 | default: | 6254 | default: |
6253 | adapter->wol = 0; | 6255 | adapter->wol = 0; |
@@ -6380,6 +6382,16 @@ static void __devexit ixgbe_remove(struct pci_dev *pdev) | |||
6380 | del_timer_sync(&adapter->sfp_timer); | 6382 | del_timer_sync(&adapter->sfp_timer); |
6381 | cancel_work_sync(&adapter->watchdog_task); | 6383 | cancel_work_sync(&adapter->watchdog_task); |
6382 | cancel_work_sync(&adapter->sfp_task); | 6384 | cancel_work_sync(&adapter->sfp_task); |
6385 | if (adapter->hw.phy.multispeed_fiber) { | ||
6386 | struct ixgbe_hw *hw = &adapter->hw; | ||
6387 | /* | ||
6388 | * Restart clause 37 autoneg, disable and re-enable | ||
6389 | * the tx laser, to clear & alert the link partner | ||
6390 | * that it needs to restart autotry | ||
6391 | */ | ||
6392 | hw->mac.autotry_restart = true; | ||
6393 | hw->mac.ops.flap_tx_laser(hw); | ||
6394 | } | ||
6383 | cancel_work_sync(&adapter->multispeed_fiber_task); | 6395 | cancel_work_sync(&adapter->multispeed_fiber_task); |
6384 | cancel_work_sync(&adapter->sfp_config_module_task); | 6396 | cancel_work_sync(&adapter->sfp_config_module_task); |
6385 | if (adapter->flags & IXGBE_FLAG_FDIR_HASH_CAPABLE || | 6397 | if (adapter->flags & IXGBE_FLAG_FDIR_HASH_CAPABLE || |
diff --git a/drivers/net/ixgbe/ixgbe_type.h b/drivers/net/ixgbe/ixgbe_type.h index 2be907466593..0ed5ab37cc53 100644 --- a/drivers/net/ixgbe/ixgbe_type.h +++ b/drivers/net/ixgbe/ixgbe_type.h | |||
@@ -2397,6 +2397,7 @@ struct ixgbe_mac_operations { | |||
2397 | s32 (*enable_rx_dma)(struct ixgbe_hw *, u32); | 2397 | s32 (*enable_rx_dma)(struct ixgbe_hw *, u32); |
2398 | 2398 | ||
2399 | /* Link */ | 2399 | /* Link */ |
2400 | void (*flap_tx_laser)(struct ixgbe_hw *); | ||
2400 | s32 (*setup_link)(struct ixgbe_hw *, ixgbe_link_speed, bool, bool); | 2401 | s32 (*setup_link)(struct ixgbe_hw *, ixgbe_link_speed, bool, bool); |
2401 | s32 (*check_link)(struct ixgbe_hw *, ixgbe_link_speed *, bool *, bool); | 2402 | s32 (*check_link)(struct ixgbe_hw *, ixgbe_link_speed *, bool *, bool); |
2402 | s32 (*get_link_capabilities)(struct ixgbe_hw *, ixgbe_link_speed *, | 2403 | s32 (*get_link_capabilities)(struct ixgbe_hw *, ixgbe_link_speed *, |
diff --git a/drivers/net/ixgbevf/ethtool.c b/drivers/net/ixgbevf/ethtool.c index 399be0c34c36..6fdd651abcd1 100644 --- a/drivers/net/ixgbevf/ethtool.c +++ b/drivers/net/ixgbevf/ethtool.c | |||
@@ -46,22 +46,32 @@ struct ixgbe_stats { | |||
46 | int sizeof_stat; | 46 | int sizeof_stat; |
47 | int stat_offset; | 47 | int stat_offset; |
48 | int base_stat_offset; | 48 | int base_stat_offset; |
49 | int saved_reset_offset; | ||
49 | }; | 50 | }; |
50 | 51 | ||
51 | #define IXGBEVF_STAT(m, b) sizeof(((struct ixgbevf_adapter *)0)->m), \ | 52 | #define IXGBEVF_STAT(m, b, r) sizeof(((struct ixgbevf_adapter *)0)->m), \ |
52 | offsetof(struct ixgbevf_adapter, m), \ | 53 | offsetof(struct ixgbevf_adapter, m), \ |
53 | offsetof(struct ixgbevf_adapter, b) | 54 | offsetof(struct ixgbevf_adapter, b), \ |
55 | offsetof(struct ixgbevf_adapter, r) | ||
54 | static struct ixgbe_stats ixgbe_gstrings_stats[] = { | 56 | static struct ixgbe_stats ixgbe_gstrings_stats[] = { |
55 | {"rx_packets", IXGBEVF_STAT(stats.vfgprc, stats.base_vfgprc)}, | 57 | {"rx_packets", IXGBEVF_STAT(stats.vfgprc, stats.base_vfgprc, |
56 | {"tx_packets", IXGBEVF_STAT(stats.vfgptc, stats.base_vfgptc)}, | 58 | stats.saved_reset_vfgprc)}, |
57 | {"rx_bytes", IXGBEVF_STAT(stats.vfgorc, stats.base_vfgorc)}, | 59 | {"tx_packets", IXGBEVF_STAT(stats.vfgptc, stats.base_vfgptc, |
58 | {"tx_bytes", IXGBEVF_STAT(stats.vfgotc, stats.base_vfgotc)}, | 60 | stats.saved_reset_vfgptc)}, |
59 | {"tx_busy", IXGBEVF_STAT(tx_busy, zero_base)}, | 61 | {"rx_bytes", IXGBEVF_STAT(stats.vfgorc, stats.base_vfgorc, |
60 | {"multicast", IXGBEVF_STAT(stats.vfmprc, stats.base_vfmprc)}, | 62 | stats.saved_reset_vfgorc)}, |
61 | {"rx_csum_offload_good", IXGBEVF_STAT(hw_csum_rx_good, zero_base)}, | 63 | {"tx_bytes", IXGBEVF_STAT(stats.vfgotc, stats.base_vfgotc, |
62 | {"rx_csum_offload_errors", IXGBEVF_STAT(hw_csum_rx_error, zero_base)}, | 64 | stats.saved_reset_vfgotc)}, |
63 | {"tx_csum_offload_ctxt", IXGBEVF_STAT(hw_csum_tx_good, zero_base)}, | 65 | {"tx_busy", IXGBEVF_STAT(tx_busy, zero_base, zero_base)}, |
64 | {"rx_header_split", IXGBEVF_STAT(rx_hdr_split, zero_base)}, | 66 | {"multicast", IXGBEVF_STAT(stats.vfmprc, stats.base_vfmprc, |
67 | stats.saved_reset_vfmprc)}, | ||
68 | {"rx_csum_offload_good", IXGBEVF_STAT(hw_csum_rx_good, zero_base, | ||
69 | zero_base)}, | ||
70 | {"rx_csum_offload_errors", IXGBEVF_STAT(hw_csum_rx_error, zero_base, | ||
71 | zero_base)}, | ||
72 | {"tx_csum_offload_ctxt", IXGBEVF_STAT(hw_csum_tx_good, zero_base, | ||
73 | zero_base)}, | ||
74 | {"rx_header_split", IXGBEVF_STAT(rx_hdr_split, zero_base, zero_base)}, | ||
65 | }; | 75 | }; |
66 | 76 | ||
67 | #define IXGBE_QUEUE_STATS_LEN 0 | 77 | #define IXGBE_QUEUE_STATS_LEN 0 |
@@ -455,10 +465,14 @@ static void ixgbevf_get_ethtool_stats(struct net_device *netdev, | |||
455 | ixgbe_gstrings_stats[i].stat_offset; | 465 | ixgbe_gstrings_stats[i].stat_offset; |
456 | char *b = (char *)adapter + | 466 | char *b = (char *)adapter + |
457 | ixgbe_gstrings_stats[i].base_stat_offset; | 467 | ixgbe_gstrings_stats[i].base_stat_offset; |
468 | char *r = (char *)adapter + | ||
469 | ixgbe_gstrings_stats[i].saved_reset_offset; | ||
458 | data[i] = ((ixgbe_gstrings_stats[i].sizeof_stat == | 470 | data[i] = ((ixgbe_gstrings_stats[i].sizeof_stat == |
459 | sizeof(u64)) ? *(u64 *)p : *(u32 *)p) - | 471 | sizeof(u64)) ? *(u64 *)p : *(u32 *)p) - |
460 | ((ixgbe_gstrings_stats[i].sizeof_stat == | 472 | ((ixgbe_gstrings_stats[i].sizeof_stat == |
461 | sizeof(u64)) ? *(u64 *)b : *(u32 *)b); | 473 | sizeof(u64)) ? *(u64 *)b : *(u32 *)b) + |
474 | ((ixgbe_gstrings_stats[i].sizeof_stat == | ||
475 | sizeof(u64)) ? *(u64 *)r : *(u32 *)r); | ||
462 | } | 476 | } |
463 | } | 477 | } |
464 | 478 | ||
diff --git a/drivers/net/ixgbevf/ixgbevf_main.c b/drivers/net/ixgbevf/ixgbevf_main.c index ca653c49b765..d6cbd943a6f0 100644 --- a/drivers/net/ixgbevf/ixgbevf_main.c +++ b/drivers/net/ixgbevf/ixgbevf_main.c | |||
@@ -965,7 +965,7 @@ static irqreturn_t ixgbevf_msix_mbx(int irq, void *data) | |||
965 | 965 | ||
966 | if ((msg & IXGBE_MBVFICR_VFREQ_MASK) == IXGBE_PF_CONTROL_MSG) | 966 | if ((msg & IXGBE_MBVFICR_VFREQ_MASK) == IXGBE_PF_CONTROL_MSG) |
967 | mod_timer(&adapter->watchdog_timer, | 967 | mod_timer(&adapter->watchdog_timer, |
968 | round_jiffies(jiffies + 10)); | 968 | round_jiffies(jiffies + 1)); |
969 | 969 | ||
970 | return IRQ_HANDLED; | 970 | return IRQ_HANDLED; |
971 | } | 971 | } |
@@ -1610,6 +1610,44 @@ static inline void ixgbevf_rx_desc_queue_enable(struct ixgbevf_adapter *adapter, | |||
1610 | (adapter->rx_ring[rxr].count - 1)); | 1610 | (adapter->rx_ring[rxr].count - 1)); |
1611 | } | 1611 | } |
1612 | 1612 | ||
1613 | static void ixgbevf_save_reset_stats(struct ixgbevf_adapter *adapter) | ||
1614 | { | ||
1615 | /* Only save pre-reset stats if there are some */ | ||
1616 | if (adapter->stats.vfgprc || adapter->stats.vfgptc) { | ||
1617 | adapter->stats.saved_reset_vfgprc += adapter->stats.vfgprc - | ||
1618 | adapter->stats.base_vfgprc; | ||
1619 | adapter->stats.saved_reset_vfgptc += adapter->stats.vfgptc - | ||
1620 | adapter->stats.base_vfgptc; | ||
1621 | adapter->stats.saved_reset_vfgorc += adapter->stats.vfgorc - | ||
1622 | adapter->stats.base_vfgorc; | ||
1623 | adapter->stats.saved_reset_vfgotc += adapter->stats.vfgotc - | ||
1624 | adapter->stats.base_vfgotc; | ||
1625 | adapter->stats.saved_reset_vfmprc += adapter->stats.vfmprc - | ||
1626 | adapter->stats.base_vfmprc; | ||
1627 | } | ||
1628 | } | ||
1629 | |||
1630 | static void ixgbevf_init_last_counter_stats(struct ixgbevf_adapter *adapter) | ||
1631 | { | ||
1632 | struct ixgbe_hw *hw = &adapter->hw; | ||
1633 | |||
1634 | adapter->stats.last_vfgprc = IXGBE_READ_REG(hw, IXGBE_VFGPRC); | ||
1635 | adapter->stats.last_vfgorc = IXGBE_READ_REG(hw, IXGBE_VFGORC_LSB); | ||
1636 | adapter->stats.last_vfgorc |= | ||
1637 | (((u64)(IXGBE_READ_REG(hw, IXGBE_VFGORC_MSB))) << 32); | ||
1638 | adapter->stats.last_vfgptc = IXGBE_READ_REG(hw, IXGBE_VFGPTC); | ||
1639 | adapter->stats.last_vfgotc = IXGBE_READ_REG(hw, IXGBE_VFGOTC_LSB); | ||
1640 | adapter->stats.last_vfgotc |= | ||
1641 | (((u64)(IXGBE_READ_REG(hw, IXGBE_VFGOTC_MSB))) << 32); | ||
1642 | adapter->stats.last_vfmprc = IXGBE_READ_REG(hw, IXGBE_VFMPRC); | ||
1643 | |||
1644 | adapter->stats.base_vfgprc = adapter->stats.last_vfgprc; | ||
1645 | adapter->stats.base_vfgorc = adapter->stats.last_vfgorc; | ||
1646 | adapter->stats.base_vfgptc = adapter->stats.last_vfgptc; | ||
1647 | adapter->stats.base_vfgotc = adapter->stats.last_vfgotc; | ||
1648 | adapter->stats.base_vfmprc = adapter->stats.last_vfmprc; | ||
1649 | } | ||
1650 | |||
1613 | static int ixgbevf_up_complete(struct ixgbevf_adapter *adapter) | 1651 | static int ixgbevf_up_complete(struct ixgbevf_adapter *adapter) |
1614 | { | 1652 | { |
1615 | struct net_device *netdev = adapter->netdev; | 1653 | struct net_device *netdev = adapter->netdev; |
@@ -1656,6 +1694,9 @@ static int ixgbevf_up_complete(struct ixgbevf_adapter *adapter) | |||
1656 | /* enable transmits */ | 1694 | /* enable transmits */ |
1657 | netif_tx_start_all_queues(netdev); | 1695 | netif_tx_start_all_queues(netdev); |
1658 | 1696 | ||
1697 | ixgbevf_save_reset_stats(adapter); | ||
1698 | ixgbevf_init_last_counter_stats(adapter); | ||
1699 | |||
1659 | /* bring the link up in the watchdog, this could race with our first | 1700 | /* bring the link up in the watchdog, this could race with our first |
1660 | * link up interrupt but shouldn't be a problem */ | 1701 | * link up interrupt but shouldn't be a problem */ |
1661 | adapter->flags |= IXGBE_FLAG_NEED_LINK_UPDATE; | 1702 | adapter->flags |= IXGBE_FLAG_NEED_LINK_UPDATE; |
@@ -2228,27 +2269,6 @@ out: | |||
2228 | return err; | 2269 | return err; |
2229 | } | 2270 | } |
2230 | 2271 | ||
2231 | static void ixgbevf_init_last_counter_stats(struct ixgbevf_adapter *adapter) | ||
2232 | { | ||
2233 | struct ixgbe_hw *hw = &adapter->hw; | ||
2234 | |||
2235 | adapter->stats.last_vfgprc = IXGBE_READ_REG(hw, IXGBE_VFGPRC); | ||
2236 | adapter->stats.last_vfgorc = IXGBE_READ_REG(hw, IXGBE_VFGORC_LSB); | ||
2237 | adapter->stats.last_vfgorc |= | ||
2238 | (((u64)(IXGBE_READ_REG(hw, IXGBE_VFGORC_MSB))) << 32); | ||
2239 | adapter->stats.last_vfgptc = IXGBE_READ_REG(hw, IXGBE_VFGPTC); | ||
2240 | adapter->stats.last_vfgotc = IXGBE_READ_REG(hw, IXGBE_VFGOTC_LSB); | ||
2241 | adapter->stats.last_vfgotc |= | ||
2242 | (((u64)(IXGBE_READ_REG(hw, IXGBE_VFGOTC_MSB))) << 32); | ||
2243 | adapter->stats.last_vfmprc = IXGBE_READ_REG(hw, IXGBE_VFMPRC); | ||
2244 | |||
2245 | adapter->stats.base_vfgprc = adapter->stats.last_vfgprc; | ||
2246 | adapter->stats.base_vfgorc = adapter->stats.last_vfgorc; | ||
2247 | adapter->stats.base_vfgptc = adapter->stats.last_vfgptc; | ||
2248 | adapter->stats.base_vfgotc = adapter->stats.last_vfgotc; | ||
2249 | adapter->stats.base_vfmprc = adapter->stats.last_vfmprc; | ||
2250 | } | ||
2251 | |||
2252 | #define UPDATE_VF_COUNTER_32bit(reg, last_counter, counter) \ | 2272 | #define UPDATE_VF_COUNTER_32bit(reg, last_counter, counter) \ |
2253 | { \ | 2273 | { \ |
2254 | u32 current_counter = IXGBE_READ_REG(hw, reg); \ | 2274 | u32 current_counter = IXGBE_READ_REG(hw, reg); \ |
@@ -2399,7 +2419,7 @@ static void ixgbevf_watchdog_task(struct work_struct *work) | |||
2399 | if (!netif_carrier_ok(netdev)) { | 2419 | if (!netif_carrier_ok(netdev)) { |
2400 | hw_dbg(&adapter->hw, "NIC Link is Up %s, ", | 2420 | hw_dbg(&adapter->hw, "NIC Link is Up %s, ", |
2401 | ((link_speed == IXGBE_LINK_SPEED_10GB_FULL) ? | 2421 | ((link_speed == IXGBE_LINK_SPEED_10GB_FULL) ? |
2402 | "10 Gbps" : "1 Gbps")); | 2422 | "10 Gbps\n" : "1 Gbps\n")); |
2403 | netif_carrier_on(netdev); | 2423 | netif_carrier_on(netdev); |
2404 | netif_tx_wake_all_queues(netdev); | 2424 | netif_tx_wake_all_queues(netdev); |
2405 | } else { | 2425 | } else { |
@@ -2416,9 +2436,9 @@ static void ixgbevf_watchdog_task(struct work_struct *work) | |||
2416 | } | 2436 | } |
2417 | } | 2437 | } |
2418 | 2438 | ||
2419 | pf_has_reset: | ||
2420 | ixgbevf_update_stats(adapter); | 2439 | ixgbevf_update_stats(adapter); |
2421 | 2440 | ||
2441 | pf_has_reset: | ||
2422 | /* Force detection of hung controller every watchdog period */ | 2442 | /* Force detection of hung controller every watchdog period */ |
2423 | adapter->detect_tx_hung = true; | 2443 | adapter->detect_tx_hung = true; |
2424 | 2444 | ||
@@ -2675,7 +2695,7 @@ static int ixgbevf_open(struct net_device *netdev) | |||
2675 | if (hw->adapter_stopped) { | 2695 | if (hw->adapter_stopped) { |
2676 | err = IXGBE_ERR_MBX; | 2696 | err = IXGBE_ERR_MBX; |
2677 | printk(KERN_ERR "Unable to start - perhaps the PF" | 2697 | printk(KERN_ERR "Unable to start - perhaps the PF" |
2678 | "Driver isn't up yet\n"); | 2698 | " Driver isn't up yet\n"); |
2679 | goto err_setup_reset; | 2699 | goto err_setup_reset; |
2680 | } | 2700 | } |
2681 | } | 2701 | } |
@@ -3390,8 +3410,6 @@ static int __devinit ixgbevf_probe(struct pci_dev *pdev, | |||
3390 | /* setup the private structure */ | 3410 | /* setup the private structure */ |
3391 | err = ixgbevf_sw_init(adapter); | 3411 | err = ixgbevf_sw_init(adapter); |
3392 | 3412 | ||
3393 | ixgbevf_init_last_counter_stats(adapter); | ||
3394 | |||
3395 | #ifdef MAX_SKB_FRAGS | 3413 | #ifdef MAX_SKB_FRAGS |
3396 | netdev->features = NETIF_F_SG | | 3414 | netdev->features = NETIF_F_SG | |
3397 | NETIF_F_IP_CSUM | | 3415 | NETIF_F_IP_CSUM | |
@@ -3449,6 +3467,8 @@ static int __devinit ixgbevf_probe(struct pci_dev *pdev, | |||
3449 | 3467 | ||
3450 | adapter->netdev_registered = true; | 3468 | adapter->netdev_registered = true; |
3451 | 3469 | ||
3470 | ixgbevf_init_last_counter_stats(adapter); | ||
3471 | |||
3452 | /* print the MAC address */ | 3472 | /* print the MAC address */ |
3453 | hw_dbg(hw, "%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x\n", | 3473 | hw_dbg(hw, "%2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x\n", |
3454 | netdev->dev_addr[0], | 3474 | netdev->dev_addr[0], |
diff --git a/drivers/net/ixgbevf/vf.h b/drivers/net/ixgbevf/vf.h index 799600e92700..1f31b052d4b4 100644 --- a/drivers/net/ixgbevf/vf.h +++ b/drivers/net/ixgbevf/vf.h | |||
@@ -157,6 +157,12 @@ struct ixgbevf_hw_stats { | |||
157 | u64 vfgorc; | 157 | u64 vfgorc; |
158 | u64 vfgotc; | 158 | u64 vfgotc; |
159 | u64 vfmprc; | 159 | u64 vfmprc; |
160 | |||
161 | u64 saved_reset_vfgprc; | ||
162 | u64 saved_reset_vfgptc; | ||
163 | u64 saved_reset_vfgorc; | ||
164 | u64 saved_reset_vfgotc; | ||
165 | u64 saved_reset_vfmprc; | ||
160 | }; | 166 | }; |
161 | 167 | ||
162 | struct ixgbevf_info { | 168 | struct ixgbevf_info { |
diff --git a/drivers/net/jme.c b/drivers/net/jme.c index 0f31497833df..c0b59a555384 100644 --- a/drivers/net/jme.c +++ b/drivers/net/jme.c | |||
@@ -946,6 +946,8 @@ jme_alloc_and_feed_skb(struct jme_adapter *jme, int idx) | |||
946 | jme->jme_vlan_rx(skb, jme->vlgrp, | 946 | jme->jme_vlan_rx(skb, jme->vlgrp, |
947 | le16_to_cpu(rxdesc->descwb.vlan)); | 947 | le16_to_cpu(rxdesc->descwb.vlan)); |
948 | NET_STAT(jme).rx_bytes += 4; | 948 | NET_STAT(jme).rx_bytes += 4; |
949 | } else { | ||
950 | dev_kfree_skb(skb); | ||
949 | } | 951 | } |
950 | } else { | 952 | } else { |
951 | jme->jme_rx(skb); | 953 | jme->jme_rx(skb); |
@@ -2081,12 +2083,45 @@ jme_tx_timeout(struct net_device *netdev) | |||
2081 | jme_reset_link(jme); | 2083 | jme_reset_link(jme); |
2082 | } | 2084 | } |
2083 | 2085 | ||
2086 | static inline void jme_pause_rx(struct jme_adapter *jme) | ||
2087 | { | ||
2088 | atomic_dec(&jme->link_changing); | ||
2089 | |||
2090 | jme_set_rx_pcc(jme, PCC_OFF); | ||
2091 | if (test_bit(JME_FLAG_POLL, &jme->flags)) { | ||
2092 | JME_NAPI_DISABLE(jme); | ||
2093 | } else { | ||
2094 | tasklet_disable(&jme->rxclean_task); | ||
2095 | tasklet_disable(&jme->rxempty_task); | ||
2096 | } | ||
2097 | } | ||
2098 | |||
2099 | static inline void jme_resume_rx(struct jme_adapter *jme) | ||
2100 | { | ||
2101 | struct dynpcc_info *dpi = &(jme->dpi); | ||
2102 | |||
2103 | if (test_bit(JME_FLAG_POLL, &jme->flags)) { | ||
2104 | JME_NAPI_ENABLE(jme); | ||
2105 | } else { | ||
2106 | tasklet_hi_enable(&jme->rxclean_task); | ||
2107 | tasklet_hi_enable(&jme->rxempty_task); | ||
2108 | } | ||
2109 | dpi->cur = PCC_P1; | ||
2110 | dpi->attempt = PCC_P1; | ||
2111 | dpi->cnt = 0; | ||
2112 | jme_set_rx_pcc(jme, PCC_P1); | ||
2113 | |||
2114 | atomic_inc(&jme->link_changing); | ||
2115 | } | ||
2116 | |||
2084 | static void | 2117 | static void |
2085 | jme_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp) | 2118 | jme_vlan_rx_register(struct net_device *netdev, struct vlan_group *grp) |
2086 | { | 2119 | { |
2087 | struct jme_adapter *jme = netdev_priv(netdev); | 2120 | struct jme_adapter *jme = netdev_priv(netdev); |
2088 | 2121 | ||
2122 | jme_pause_rx(jme); | ||
2089 | jme->vlgrp = grp; | 2123 | jme->vlgrp = grp; |
2124 | jme_resume_rx(jme); | ||
2090 | } | 2125 | } |
2091 | 2126 | ||
2092 | static void | 2127 | static void |
diff --git a/drivers/net/jme.h b/drivers/net/jme.h index c19db9146a2f..07ad3a457185 100644 --- a/drivers/net/jme.h +++ b/drivers/net/jme.h | |||
@@ -25,7 +25,7 @@ | |||
25 | #define __JME_H_INCLUDED__ | 25 | #define __JME_H_INCLUDED__ |
26 | 26 | ||
27 | #define DRV_NAME "jme" | 27 | #define DRV_NAME "jme" |
28 | #define DRV_VERSION "1.0.5" | 28 | #define DRV_VERSION "1.0.6" |
29 | #define PFX DRV_NAME ": " | 29 | #define PFX DRV_NAME ": " |
30 | 30 | ||
31 | #define PCI_DEVICE_ID_JMICRON_JMC250 0x0250 | 31 | #define PCI_DEVICE_ID_JMICRON_JMC250 0x0250 |
diff --git a/drivers/net/ks8851.c b/drivers/net/ks8851.c index 0573e0bb4444..13cc1ca261d9 100644 --- a/drivers/net/ks8851.c +++ b/drivers/net/ks8851.c | |||
@@ -976,7 +976,6 @@ static void ks8851_set_rx_mode(struct net_device *dev) | |||
976 | crc >>= (32 - 6); /* get top six bits */ | 976 | crc >>= (32 - 6); /* get top six bits */ |
977 | 977 | ||
978 | rxctrl.mchash[crc >> 4] |= (1 << (crc & 0xf)); | 978 | rxctrl.mchash[crc >> 4] |= (1 << (crc & 0xf)); |
979 | mcptr = mcptr->next; | ||
980 | } | 979 | } |
981 | 980 | ||
982 | rxctrl.rxcr1 = RXCR1_RXME | RXCR1_RXPAFMA; | 981 | rxctrl.rxcr1 = RXCR1_RXME | RXCR1_RXPAFMA; |
diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c index d222d7e25273..73f9a31cf94d 100644 --- a/drivers/net/usb/smsc95xx.c +++ b/drivers/net/usb/smsc95xx.c | |||
@@ -1189,9 +1189,21 @@ static struct sk_buff *smsc95xx_tx_fixup(struct usbnet *dev, | |||
1189 | } | 1189 | } |
1190 | 1190 | ||
1191 | if (csum) { | 1191 | if (csum) { |
1192 | u32 csum_preamble = smsc95xx_calc_csum_preamble(skb); | 1192 | if (skb->len <= 45) { |
1193 | skb_push(skb, 4); | 1193 | /* workaround - hardware tx checksum does not work |
1194 | memcpy(skb->data, &csum_preamble, 4); | 1194 | * properly with extremely small packets */ |
1195 | long csstart = skb->csum_start - skb_headroom(skb); | ||
1196 | __wsum calc = csum_partial(skb->data + csstart, | ||
1197 | skb->len - csstart, 0); | ||
1198 | *((__sum16 *)(skb->data + csstart | ||
1199 | + skb->csum_offset)) = csum_fold(calc); | ||
1200 | |||
1201 | csum = false; | ||
1202 | } else { | ||
1203 | u32 csum_preamble = smsc95xx_calc_csum_preamble(skb); | ||
1204 | skb_push(skb, 4); | ||
1205 | memcpy(skb->data, &csum_preamble, 4); | ||
1206 | } | ||
1195 | } | 1207 | } |
1196 | 1208 | ||
1197 | skb_push(skb, 4); | 1209 | skb_push(skb, 4); |
diff --git a/drivers/net/wireless/ath/ath9k/xmit.c b/drivers/net/wireless/ath/ath9k/xmit.c index b2c8207f7bc1..294b486bc3ed 100644 --- a/drivers/net/wireless/ath/ath9k/xmit.c +++ b/drivers/net/wireless/ath/ath9k/xmit.c | |||
@@ -1353,25 +1353,6 @@ static enum ath9k_pkt_type get_hw_packet_type(struct sk_buff *skb) | |||
1353 | return htype; | 1353 | return htype; |
1354 | } | 1354 | } |
1355 | 1355 | ||
1356 | static bool is_pae(struct sk_buff *skb) | ||
1357 | { | ||
1358 | struct ieee80211_hdr *hdr; | ||
1359 | __le16 fc; | ||
1360 | |||
1361 | hdr = (struct ieee80211_hdr *)skb->data; | ||
1362 | fc = hdr->frame_control; | ||
1363 | |||
1364 | if (ieee80211_is_data(fc)) { | ||
1365 | if (ieee80211_is_nullfunc(fc) || | ||
1366 | /* Port Access Entity (IEEE 802.1X) */ | ||
1367 | (skb->protocol == cpu_to_be16(ETH_P_PAE))) { | ||
1368 | return true; | ||
1369 | } | ||
1370 | } | ||
1371 | |||
1372 | return false; | ||
1373 | } | ||
1374 | |||
1375 | static int get_hw_crypto_keytype(struct sk_buff *skb) | 1356 | static int get_hw_crypto_keytype(struct sk_buff *skb) |
1376 | { | 1357 | { |
1377 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); | 1358 | struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb); |
@@ -1696,7 +1677,7 @@ static void ath_tx_start_dma(struct ath_softc *sc, struct ath_buf *bf, | |||
1696 | goto tx_done; | 1677 | goto tx_done; |
1697 | } | 1678 | } |
1698 | 1679 | ||
1699 | if ((tx_info->flags & IEEE80211_TX_CTL_AMPDU) && !is_pae(skb)) { | 1680 | if (tx_info->flags & IEEE80211_TX_CTL_AMPDU) { |
1700 | /* | 1681 | /* |
1701 | * Try aggregation if it's a unicast data frame | 1682 | * Try aggregation if it's a unicast data frame |
1702 | * and the destination is HT capable. | 1683 | * and the destination is HT capable. |
diff --git a/drivers/net/wireless/iwlwifi/iwl-tx.c b/drivers/net/wireless/iwlwifi/iwl-tx.c index 1ed5206721ec..8c12311dbb0a 100644 --- a/drivers/net/wireless/iwlwifi/iwl-tx.c +++ b/drivers/net/wireless/iwlwifi/iwl-tx.c | |||
@@ -124,7 +124,7 @@ void iwl_free_tfds_in_queue(struct iwl_priv *priv, | |||
124 | if (priv->stations[sta_id].tid[tid].tfds_in_queue >= freed) | 124 | if (priv->stations[sta_id].tid[tid].tfds_in_queue >= freed) |
125 | priv->stations[sta_id].tid[tid].tfds_in_queue -= freed; | 125 | priv->stations[sta_id].tid[tid].tfds_in_queue -= freed; |
126 | else { | 126 | else { |
127 | IWL_ERR(priv, "free more than tfds_in_queue (%u:%d)\n", | 127 | IWL_DEBUG_TX(priv, "free more than tfds_in_queue (%u:%d)\n", |
128 | priv->stations[sta_id].tid[tid].tfds_in_queue, | 128 | priv->stations[sta_id].tid[tid].tfds_in_queue, |
129 | freed); | 129 | freed); |
130 | priv->stations[sta_id].tid[tid].tfds_in_queue = 0; | 130 | priv->stations[sta_id].tid[tid].tfds_in_queue = 0; |
diff --git a/drivers/net/wireless/wl12xx/wl1251_debugfs.c b/drivers/net/wireless/wl12xx/wl1251_debugfs.c index 0ccba57fb9fb..05e4d68eb4cc 100644 --- a/drivers/net/wireless/wl12xx/wl1251_debugfs.c +++ b/drivers/net/wireless/wl12xx/wl1251_debugfs.c | |||
@@ -466,7 +466,8 @@ out: | |||
466 | 466 | ||
467 | void wl1251_debugfs_reset(struct wl1251 *wl) | 467 | void wl1251_debugfs_reset(struct wl1251 *wl) |
468 | { | 468 | { |
469 | memset(wl->stats.fw_stats, 0, sizeof(*wl->stats.fw_stats)); | 469 | if (wl->stats.fw_stats != NULL) |
470 | memset(wl->stats.fw_stats, 0, sizeof(*wl->stats.fw_stats)); | ||
470 | wl->stats.retry_count = 0; | 471 | wl->stats.retry_count = 0; |
471 | wl->stats.excessive_retries = 0; | 472 | wl->stats.excessive_retries = 0; |
472 | } | 473 | } |
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index c7bbe30010f7..5af16c2bb540 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c | |||
@@ -1038,6 +1038,7 @@ static struct regulator *create_regulator(struct regulator_dev *rdev, | |||
1038 | goto overflow_err; | 1038 | goto overflow_err; |
1039 | 1039 | ||
1040 | regulator->dev = dev; | 1040 | regulator->dev = dev; |
1041 | sysfs_attr_init(®ulator->dev_attr.attr); | ||
1041 | regulator->dev_attr.attr.name = kstrdup(buf, GFP_KERNEL); | 1042 | regulator->dev_attr.attr.name = kstrdup(buf, GFP_KERNEL); |
1042 | if (regulator->dev_attr.attr.name == NULL) | 1043 | if (regulator->dev_attr.attr.name == NULL) |
1043 | goto attr_name_err; | 1044 | goto attr_name_err; |
diff --git a/drivers/regulator/lp3971.c b/drivers/regulator/lp3971.c index f5532ed79272..b20b3e1d821a 100644 --- a/drivers/regulator/lp3971.c +++ b/drivers/regulator/lp3971.c | |||
@@ -45,7 +45,7 @@ static int lp3971_set_bits(struct lp3971 *lp3971, u8 reg, u16 mask, u16 val); | |||
45 | LP3971_BUCK2 -> 4 | 45 | LP3971_BUCK2 -> 4 |
46 | LP3971_BUCK3 -> 6 | 46 | LP3971_BUCK3 -> 6 |
47 | */ | 47 | */ |
48 | #define BUCK_VOL_CHANGE_SHIFT(x) (((1 << x) & ~0x01) << 1) | 48 | #define BUCK_VOL_CHANGE_SHIFT(x) (((!!x) << 2) | (x & ~0x01)) |
49 | #define BUCK_VOL_CHANGE_FLAG_GO 0x01 | 49 | #define BUCK_VOL_CHANGE_FLAG_GO 0x01 |
50 | #define BUCK_VOL_CHANGE_FLAG_TARGET 0x02 | 50 | #define BUCK_VOL_CHANGE_FLAG_TARGET 0x02 |
51 | #define BUCK_VOL_CHANGE_FLAG_MASK 0x03 | 51 | #define BUCK_VOL_CHANGE_FLAG_MASK 0x03 |
@@ -187,7 +187,8 @@ static int lp3971_ldo_set_voltage(struct regulator_dev *dev, | |||
187 | return -EINVAL; | 187 | return -EINVAL; |
188 | 188 | ||
189 | return lp3971_set_bits(lp3971, LP3971_LDO_VOL_CONTR_REG(ldo), | 189 | return lp3971_set_bits(lp3971, LP3971_LDO_VOL_CONTR_REG(ldo), |
190 | LDO_VOL_CONTR_MASK << LDO_VOL_CONTR_SHIFT(ldo), val); | 190 | LDO_VOL_CONTR_MASK << LDO_VOL_CONTR_SHIFT(ldo), |
191 | val << LDO_VOL_CONTR_SHIFT(ldo)); | ||
191 | } | 192 | } |
192 | 193 | ||
193 | static struct regulator_ops lp3971_ldo_ops = { | 194 | static struct regulator_ops lp3971_ldo_ops = { |
@@ -439,6 +440,10 @@ static int __devinit setup_regulators(struct lp3971 *lp3971, | |||
439 | lp3971->num_regulators = pdata->num_regulators; | 440 | lp3971->num_regulators = pdata->num_regulators; |
440 | lp3971->rdev = kcalloc(pdata->num_regulators, | 441 | lp3971->rdev = kcalloc(pdata->num_regulators, |
441 | sizeof(struct regulator_dev *), GFP_KERNEL); | 442 | sizeof(struct regulator_dev *), GFP_KERNEL); |
443 | if (!lp3971->rdev) { | ||
444 | err = -ENOMEM; | ||
445 | goto err_nomem; | ||
446 | } | ||
442 | 447 | ||
443 | /* Instantiate the regulators */ | 448 | /* Instantiate the regulators */ |
444 | for (i = 0; i < pdata->num_regulators; i++) { | 449 | for (i = 0; i < pdata->num_regulators; i++) { |
@@ -461,6 +466,7 @@ error: | |||
461 | regulator_unregister(lp3971->rdev[i]); | 466 | regulator_unregister(lp3971->rdev[i]); |
462 | kfree(lp3971->rdev); | 467 | kfree(lp3971->rdev); |
463 | lp3971->rdev = NULL; | 468 | lp3971->rdev = NULL; |
469 | err_nomem: | ||
464 | return err; | 470 | return err; |
465 | } | 471 | } |
466 | 472 | ||
diff --git a/drivers/regulator/max1586.c b/drivers/regulator/max1586.c index a49fc952c9a9..c0b09e15edb6 100644 --- a/drivers/regulator/max1586.c +++ b/drivers/regulator/max1586.c | |||
@@ -243,8 +243,8 @@ static int __devexit max1586_pmic_remove(struct i2c_client *client) | |||
243 | for (i = 0; i <= MAX1586_V6; i++) | 243 | for (i = 0; i <= MAX1586_V6; i++) |
244 | if (rdev[i]) | 244 | if (rdev[i]) |
245 | regulator_unregister(rdev[i]); | 245 | regulator_unregister(rdev[i]); |
246 | kfree(rdev); | ||
247 | i2c_set_clientdata(client, NULL); | 246 | i2c_set_clientdata(client, NULL); |
247 | kfree(rdev); | ||
248 | 248 | ||
249 | return 0; | 249 | return 0; |
250 | } | 250 | } |
diff --git a/drivers/regulator/max8649.c b/drivers/regulator/max8649.c index 3ebdf698c648..833aaedc7e64 100644 --- a/drivers/regulator/max8649.c +++ b/drivers/regulator/max8649.c | |||
@@ -356,6 +356,7 @@ static int __devinit max8649_regulator_probe(struct i2c_client *client, | |||
356 | dev_info(info->dev, "Max8649 regulator device is detected.\n"); | 356 | dev_info(info->dev, "Max8649 regulator device is detected.\n"); |
357 | return 0; | 357 | return 0; |
358 | out: | 358 | out: |
359 | i2c_set_clientdata(client, NULL); | ||
359 | kfree(info); | 360 | kfree(info); |
360 | return ret; | 361 | return ret; |
361 | } | 362 | } |
@@ -367,9 +368,9 @@ static int __devexit max8649_regulator_remove(struct i2c_client *client) | |||
367 | if (info) { | 368 | if (info) { |
368 | if (info->regulator) | 369 | if (info->regulator) |
369 | regulator_unregister(info->regulator); | 370 | regulator_unregister(info->regulator); |
371 | i2c_set_clientdata(client, NULL); | ||
370 | kfree(info); | 372 | kfree(info); |
371 | } | 373 | } |
372 | i2c_set_clientdata(client, NULL); | ||
373 | 374 | ||
374 | return 0; | 375 | return 0; |
375 | } | 376 | } |
diff --git a/drivers/regulator/max8660.c b/drivers/regulator/max8660.c index f12f1bb62138..47f90b2fc290 100644 --- a/drivers/regulator/max8660.c +++ b/drivers/regulator/max8660.c | |||
@@ -470,8 +470,8 @@ static int __devexit max8660_remove(struct i2c_client *client) | |||
470 | for (i = 0; i < MAX8660_V_END; i++) | 470 | for (i = 0; i < MAX8660_V_END; i++) |
471 | if (rdev[i]) | 471 | if (rdev[i]) |
472 | regulator_unregister(rdev[i]); | 472 | regulator_unregister(rdev[i]); |
473 | kfree(rdev); | ||
474 | i2c_set_clientdata(client, NULL); | 473 | i2c_set_clientdata(client, NULL); |
474 | kfree(rdev); | ||
475 | 475 | ||
476 | return 0; | 476 | return 0; |
477 | } | 477 | } |
diff --git a/drivers/regulator/max8925-regulator.c b/drivers/regulator/max8925-regulator.c index 67873f08ed40..b6218f11c957 100644 --- a/drivers/regulator/max8925-regulator.c +++ b/drivers/regulator/max8925-regulator.c | |||
@@ -230,7 +230,7 @@ static struct max8925_regulator_info max8925_regulator_info[] = { | |||
230 | MAX8925_LDO(20, 750, 3900, 50), | 230 | MAX8925_LDO(20, 750, 3900, 50), |
231 | }; | 231 | }; |
232 | 232 | ||
233 | static inline struct max8925_regulator_info *find_regulator_info(int id) | 233 | static struct max8925_regulator_info * __devinit find_regulator_info(int id) |
234 | { | 234 | { |
235 | struct max8925_regulator_info *ri; | 235 | struct max8925_regulator_info *ri; |
236 | int i; | 236 | int i; |
@@ -247,7 +247,7 @@ static int __devinit max8925_regulator_probe(struct platform_device *pdev) | |||
247 | { | 247 | { |
248 | struct max8925_chip *chip = dev_get_drvdata(pdev->dev.parent); | 248 | struct max8925_chip *chip = dev_get_drvdata(pdev->dev.parent); |
249 | struct max8925_platform_data *pdata = chip->dev->platform_data; | 249 | struct max8925_platform_data *pdata = chip->dev->platform_data; |
250 | struct max8925_regulator_info *ri = NULL; | 250 | struct max8925_regulator_info *ri; |
251 | struct regulator_dev *rdev; | 251 | struct regulator_dev *rdev; |
252 | 252 | ||
253 | ri = find_regulator_info(pdev->id); | 253 | ri = find_regulator_info(pdev->id); |
@@ -274,7 +274,9 @@ static int __devexit max8925_regulator_remove(struct platform_device *pdev) | |||
274 | { | 274 | { |
275 | struct regulator_dev *rdev = platform_get_drvdata(pdev); | 275 | struct regulator_dev *rdev = platform_get_drvdata(pdev); |
276 | 276 | ||
277 | platform_set_drvdata(pdev, NULL); | ||
277 | regulator_unregister(rdev); | 278 | regulator_unregister(rdev); |
279 | |||
278 | return 0; | 280 | return 0; |
279 | } | 281 | } |
280 | 282 | ||
diff --git a/drivers/rtc/rtc-mc13783.c b/drivers/rtc/rtc-mc13783.c index d60c81b7b693..1379c7faa448 100644 --- a/drivers/rtc/rtc-mc13783.c +++ b/drivers/rtc/rtc-mc13783.c | |||
@@ -319,35 +319,38 @@ static int __devinit mc13783_rtc_probe(struct platform_device *pdev) | |||
319 | { | 319 | { |
320 | int ret; | 320 | int ret; |
321 | struct mc13783_rtc *priv; | 321 | struct mc13783_rtc *priv; |
322 | struct mc13783 *mc13783; | ||
322 | int rtcrst_pending; | 323 | int rtcrst_pending; |
323 | 324 | ||
324 | priv = kzalloc(sizeof(*priv), GFP_KERNEL); | 325 | priv = kzalloc(sizeof(*priv), GFP_KERNEL); |
325 | if (!priv) | 326 | if (!priv) |
326 | return -ENOMEM; | 327 | return -ENOMEM; |
327 | 328 | ||
328 | priv->mc13783 = dev_get_drvdata(pdev->dev.parent); | 329 | mc13783 = dev_get_drvdata(pdev->dev.parent); |
330 | priv->mc13783 = mc13783; | ||
331 | |||
329 | platform_set_drvdata(pdev, priv); | 332 | platform_set_drvdata(pdev, priv); |
330 | 333 | ||
331 | mc13783_lock(priv->mc13783); | 334 | mc13783_lock(mc13783); |
332 | 335 | ||
333 | ret = mc13783_irq_request(priv->mc13783, MC13783_IRQ_RTCRST, | 336 | ret = mc13783_irq_request(mc13783, MC13783_IRQ_RTCRST, |
334 | mc13783_rtc_reset_handler, DRIVER_NAME, priv); | 337 | mc13783_rtc_reset_handler, DRIVER_NAME, priv); |
335 | if (ret) | 338 | if (ret) |
336 | goto err_reset_irq_request; | 339 | goto err_reset_irq_request; |
337 | 340 | ||
338 | ret = mc13783_irq_status(priv->mc13783, MC13783_IRQ_RTCRST, | 341 | ret = mc13783_irq_status(mc13783, MC13783_IRQ_RTCRST, |
339 | NULL, &rtcrst_pending); | 342 | NULL, &rtcrst_pending); |
340 | if (ret) | 343 | if (ret) |
341 | goto err_reset_irq_status; | 344 | goto err_reset_irq_status; |
342 | 345 | ||
343 | priv->valid = !rtcrst_pending; | 346 | priv->valid = !rtcrst_pending; |
344 | 347 | ||
345 | ret = mc13783_irq_request_nounmask(priv->mc13783, MC13783_IRQ_1HZ, | 348 | ret = mc13783_irq_request_nounmask(mc13783, MC13783_IRQ_1HZ, |
346 | mc13783_rtc_update_handler, DRIVER_NAME, priv); | 349 | mc13783_rtc_update_handler, DRIVER_NAME, priv); |
347 | if (ret) | 350 | if (ret) |
348 | goto err_update_irq_request; | 351 | goto err_update_irq_request; |
349 | 352 | ||
350 | ret = mc13783_irq_request_nounmask(priv->mc13783, MC13783_IRQ_TODA, | 353 | ret = mc13783_irq_request_nounmask(mc13783, MC13783_IRQ_TODA, |
351 | mc13783_rtc_alarm_handler, DRIVER_NAME, priv); | 354 | mc13783_rtc_alarm_handler, DRIVER_NAME, priv); |
352 | if (ret) | 355 | if (ret) |
353 | goto err_alarm_irq_request; | 356 | goto err_alarm_irq_request; |
@@ -357,22 +360,22 @@ static int __devinit mc13783_rtc_probe(struct platform_device *pdev) | |||
357 | if (IS_ERR(priv->rtc)) { | 360 | if (IS_ERR(priv->rtc)) { |
358 | ret = PTR_ERR(priv->rtc); | 361 | ret = PTR_ERR(priv->rtc); |
359 | 362 | ||
360 | mc13783_irq_free(priv->mc13783, MC13783_IRQ_TODA, priv); | 363 | mc13783_irq_free(mc13783, MC13783_IRQ_TODA, priv); |
361 | err_alarm_irq_request: | 364 | err_alarm_irq_request: |
362 | 365 | ||
363 | mc13783_irq_free(priv->mc13783, MC13783_IRQ_1HZ, priv); | 366 | mc13783_irq_free(mc13783, MC13783_IRQ_1HZ, priv); |
364 | err_update_irq_request: | 367 | err_update_irq_request: |
365 | 368 | ||
366 | err_reset_irq_status: | 369 | err_reset_irq_status: |
367 | 370 | ||
368 | mc13783_irq_free(priv->mc13783, MC13783_IRQ_RTCRST, priv); | 371 | mc13783_irq_free(mc13783, MC13783_IRQ_RTCRST, priv); |
369 | err_reset_irq_request: | 372 | err_reset_irq_request: |
370 | 373 | ||
371 | platform_set_drvdata(pdev, NULL); | 374 | platform_set_drvdata(pdev, NULL); |
372 | kfree(priv); | 375 | kfree(priv); |
373 | } | 376 | } |
374 | 377 | ||
375 | mc13783_unlock(priv->mc13783); | 378 | mc13783_unlock(mc13783); |
376 | 379 | ||
377 | return ret; | 380 | return ret; |
378 | } | 381 | } |
diff --git a/drivers/s390/block/dasd_3990_erp.c b/drivers/s390/block/dasd_3990_erp.c index 51224f76b980..b3736b8aad39 100644 --- a/drivers/s390/block/dasd_3990_erp.c +++ b/drivers/s390/block/dasd_3990_erp.c | |||
@@ -2287,7 +2287,8 @@ static struct dasd_ccw_req *dasd_3990_erp_add_erp(struct dasd_ccw_req *cqr) | |||
2287 | 2287 | ||
2288 | if (cqr->cpmode == 1) { | 2288 | if (cqr->cpmode == 1) { |
2289 | cplength = 0; | 2289 | cplength = 0; |
2290 | datasize = sizeof(struct tcw) + sizeof(struct tsb); | 2290 | /* TCW needs to be 64 byte aligned, so leave enough room */ |
2291 | datasize = 64 + sizeof(struct tcw) + sizeof(struct tsb); | ||
2291 | } else { | 2292 | } else { |
2292 | cplength = 2; | 2293 | cplength = 2; |
2293 | datasize = 0; | 2294 | datasize = 0; |
@@ -2316,8 +2317,8 @@ static struct dasd_ccw_req *dasd_3990_erp_add_erp(struct dasd_ccw_req *cqr) | |||
2316 | if (cqr->cpmode == 1) { | 2317 | if (cqr->cpmode == 1) { |
2317 | /* make a shallow copy of the original tcw but set new tsb */ | 2318 | /* make a shallow copy of the original tcw but set new tsb */ |
2318 | erp->cpmode = 1; | 2319 | erp->cpmode = 1; |
2319 | erp->cpaddr = erp->data; | 2320 | erp->cpaddr = PTR_ALIGN(erp->data, 64); |
2320 | tcw = erp->data; | 2321 | tcw = erp->cpaddr; |
2321 | tsb = (struct tsb *) &tcw[1]; | 2322 | tsb = (struct tsb *) &tcw[1]; |
2322 | *tcw = *((struct tcw *)cqr->cpaddr); | 2323 | *tcw = *((struct tcw *)cqr->cpaddr); |
2323 | tcw->tsb = (long)tsb; | 2324 | tcw->tsb = (long)tsb; |
diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c index 01f4e7a34aa8..0cb233116855 100644 --- a/drivers/s390/block/dasd_eckd.c +++ b/drivers/s390/block/dasd_eckd.c | |||
@@ -3155,11 +3155,11 @@ static void dasd_eckd_dump_sense_tcw(struct dasd_device *device, | |||
3155 | 3155 | ||
3156 | tsb = NULL; | 3156 | tsb = NULL; |
3157 | sense = NULL; | 3157 | sense = NULL; |
3158 | if (irb->scsw.tm.tcw) | 3158 | if (irb->scsw.tm.tcw && (irb->scsw.tm.fcxs == 0x01)) |
3159 | tsb = tcw_get_tsb( | 3159 | tsb = tcw_get_tsb( |
3160 | (struct tcw *)(unsigned long)irb->scsw.tm.tcw); | 3160 | (struct tcw *)(unsigned long)irb->scsw.tm.tcw); |
3161 | 3161 | ||
3162 | if (tsb && (irb->scsw.tm.fcxs == 0x01)) { | 3162 | if (tsb) { |
3163 | len += sprintf(page + len, KERN_ERR PRINTK_HEADER | 3163 | len += sprintf(page + len, KERN_ERR PRINTK_HEADER |
3164 | " tsb->length %d\n", tsb->length); | 3164 | " tsb->length %d\n", tsb->length); |
3165 | len += sprintf(page + len, KERN_ERR PRINTK_HEADER | 3165 | len += sprintf(page + len, KERN_ERR PRINTK_HEADER |
diff --git a/drivers/s390/char/sclp_async.c b/drivers/s390/char/sclp_async.c index 740fe405c395..f449c696e503 100644 --- a/drivers/s390/char/sclp_async.c +++ b/drivers/s390/char/sclp_async.c | |||
@@ -84,6 +84,7 @@ static int proc_handler_callhome(struct ctl_table *ctl, int write, | |||
84 | rc = copy_from_user(buf, buffer, sizeof(buf)); | 84 | rc = copy_from_user(buf, buffer, sizeof(buf)); |
85 | if (rc != 0) | 85 | if (rc != 0) |
86 | return -EFAULT; | 86 | return -EFAULT; |
87 | buf[len - 1] = '\0'; | ||
87 | if (strict_strtoul(buf, 0, &val) != 0) | 88 | if (strict_strtoul(buf, 0, &val) != 0) |
88 | return -EINVAL; | 89 | return -EINVAL; |
89 | if (val != 0 && val != 1) | 90 | if (val != 0 && val != 1) |
diff --git a/drivers/s390/char/sclp_cmd.c b/drivers/s390/char/sclp_cmd.c index fc7ae05ce48a..4b60ede07f0e 100644 --- a/drivers/s390/char/sclp_cmd.c +++ b/drivers/s390/char/sclp_cmd.c | |||
@@ -308,6 +308,13 @@ struct assign_storage_sccb { | |||
308 | u16 rn; | 308 | u16 rn; |
309 | } __packed; | 309 | } __packed; |
310 | 310 | ||
311 | int arch_get_memory_phys_device(unsigned long start_pfn) | ||
312 | { | ||
313 | if (!rzm) | ||
314 | return 0; | ||
315 | return PFN_PHYS(start_pfn) >> ilog2(rzm); | ||
316 | } | ||
317 | |||
311 | static unsigned long long rn2addr(u16 rn) | 318 | static unsigned long long rn2addr(u16 rn) |
312 | { | 319 | { |
313 | return (unsigned long long) (rn - 1) * rzm; | 320 | return (unsigned long long) (rn - 1) * rzm; |
@@ -704,13 +711,6 @@ int sclp_chp_deconfigure(struct chp_id chpid) | |||
704 | return do_chp_configure(SCLP_CMDW_DECONFIGURE_CHPATH | chpid.id << 8); | 711 | return do_chp_configure(SCLP_CMDW_DECONFIGURE_CHPATH | chpid.id << 8); |
705 | } | 712 | } |
706 | 713 | ||
707 | int arch_get_memory_phys_device(unsigned long start_pfn) | ||
708 | { | ||
709 | if (!rzm) | ||
710 | return 0; | ||
711 | return PFN_PHYS(start_pfn) / rzm; | ||
712 | } | ||
713 | |||
714 | struct chp_info_sccb { | 714 | struct chp_info_sccb { |
715 | struct sccb_header header; | 715 | struct sccb_header header; |
716 | u8 recognized[SCLP_CHP_INFO_MASK_SIZE]; | 716 | u8 recognized[SCLP_CHP_INFO_MASK_SIZE]; |
diff --git a/drivers/s390/char/zcore.c b/drivers/s390/char/zcore.c index 3438658b66b7..3166d85914f2 100644 --- a/drivers/s390/char/zcore.c +++ b/drivers/s390/char/zcore.c | |||
@@ -141,33 +141,6 @@ static int memcpy_hsa_kernel(void *dest, unsigned long src, size_t count) | |||
141 | return memcpy_hsa(dest, src, count, TO_KERNEL); | 141 | return memcpy_hsa(dest, src, count, TO_KERNEL); |
142 | } | 142 | } |
143 | 143 | ||
144 | static int memcpy_real(void *dest, unsigned long src, size_t count) | ||
145 | { | ||
146 | unsigned long flags; | ||
147 | int rc = -EFAULT; | ||
148 | register unsigned long _dest asm("2") = (unsigned long) dest; | ||
149 | register unsigned long _len1 asm("3") = (unsigned long) count; | ||
150 | register unsigned long _src asm("4") = src; | ||
151 | register unsigned long _len2 asm("5") = (unsigned long) count; | ||
152 | |||
153 | if (count == 0) | ||
154 | return 0; | ||
155 | flags = __raw_local_irq_stnsm(0xf8UL); /* switch to real mode */ | ||
156 | asm volatile ( | ||
157 | "0: mvcle %1,%2,0x0\n" | ||
158 | "1: jo 0b\n" | ||
159 | " lhi %0,0x0\n" | ||
160 | "2:\n" | ||
161 | EX_TABLE(1b,2b) | ||
162 | : "+d" (rc), "+d" (_dest), "+d" (_src), "+d" (_len1), | ||
163 | "+d" (_len2), "=m" (*((long*)dest)) | ||
164 | : "m" (*((long*)src)) | ||
165 | : "cc", "memory"); | ||
166 | __raw_local_irq_ssm(flags); | ||
167 | |||
168 | return rc; | ||
169 | } | ||
170 | |||
171 | static int memcpy_real_user(void __user *dest, unsigned long src, size_t count) | 144 | static int memcpy_real_user(void __user *dest, unsigned long src, size_t count) |
172 | { | 145 | { |
173 | static char buf[4096]; | 146 | static char buf[4096]; |
@@ -175,7 +148,7 @@ static int memcpy_real_user(void __user *dest, unsigned long src, size_t count) | |||
175 | 148 | ||
176 | while (offs < count) { | 149 | while (offs < count) { |
177 | size = min(sizeof(buf), count - offs); | 150 | size = min(sizeof(buf), count - offs); |
178 | if (memcpy_real(buf, src + offs, size)) | 151 | if (memcpy_real(buf, (void *) src + offs, size)) |
179 | return -EFAULT; | 152 | return -EFAULT; |
180 | if (copy_to_user(dest + offs, buf, size)) | 153 | if (copy_to_user(dest + offs, buf, size)) |
181 | return -EFAULT; | 154 | return -EFAULT; |
@@ -663,7 +636,7 @@ static int __init zcore_reipl_init(void) | |||
663 | if (ipib_info.ipib < ZFCPDUMP_HSA_SIZE) | 636 | if (ipib_info.ipib < ZFCPDUMP_HSA_SIZE) |
664 | rc = memcpy_hsa_kernel(ipl_block, ipib_info.ipib, PAGE_SIZE); | 637 | rc = memcpy_hsa_kernel(ipl_block, ipib_info.ipib, PAGE_SIZE); |
665 | else | 638 | else |
666 | rc = memcpy_real(ipl_block, ipib_info.ipib, PAGE_SIZE); | 639 | rc = memcpy_real(ipl_block, (void *) ipib_info.ipib, PAGE_SIZE); |
667 | if (rc) { | 640 | if (rc) { |
668 | free_page((unsigned long) ipl_block); | 641 | free_page((unsigned long) ipl_block); |
669 | return rc; | 642 | return rc; |
diff --git a/drivers/serial/sh-sci.c b/drivers/serial/sh-sci.c index f7b9aff88f4a..309de6be8204 100644 --- a/drivers/serial/sh-sci.c +++ b/drivers/serial/sh-sci.c | |||
@@ -779,10 +779,6 @@ static irqreturn_t sci_mpxed_interrupt(int irq, void *ptr) | |||
779 | if ((ssr_status & SCxSR_BRK(port)) && err_enabled) | 779 | if ((ssr_status & SCxSR_BRK(port)) && err_enabled) |
780 | ret = sci_br_interrupt(irq, ptr); | 780 | ret = sci_br_interrupt(irq, ptr); |
781 | 781 | ||
782 | WARN_ONCE(ret == IRQ_NONE, | ||
783 | "%s: %d IRQ %d, status %x, control %x\n", __func__, | ||
784 | irq, port->line, ssr_status, scr_status); | ||
785 | |||
786 | return ret; | 782 | return ret; |
787 | } | 783 | } |
788 | 784 | ||
diff --git a/drivers/serial/sh-sci.h b/drivers/serial/sh-sci.h index fad67d33b0bd..f70c49f915fa 100644 --- a/drivers/serial/sh-sci.h +++ b/drivers/serial/sh-sci.h | |||
@@ -31,7 +31,9 @@ | |||
31 | # define SCSCR_INIT(port) (port->mapbase == SCIF2) ? 0xF3 : 0xF0 | 31 | # define SCSCR_INIT(port) (port->mapbase == SCIF2) ? 0xF3 : 0xF0 |
32 | #elif defined(CONFIG_CPU_SUBTYPE_SH7720) || \ | 32 | #elif defined(CONFIG_CPU_SUBTYPE_SH7720) || \ |
33 | defined(CONFIG_CPU_SUBTYPE_SH7721) || \ | 33 | defined(CONFIG_CPU_SUBTYPE_SH7721) || \ |
34 | defined(CONFIG_ARCH_SHMOBILE) | 34 | defined(CONFIG_ARCH_SH7367) || \ |
35 | defined(CONFIG_ARCH_SH7377) || \ | ||
36 | defined(CONFIG_ARCH_SH7372) | ||
35 | # define SCSCR_INIT(port) 0x0030 /* TIE=0,RIE=0,TE=1,RE=1 */ | 37 | # define SCSCR_INIT(port) 0x0030 /* TIE=0,RIE=0,TE=1,RE=1 */ |
36 | # define PORT_PTCR 0xA405011EUL | 38 | # define PORT_PTCR 0xA405011EUL |
37 | # define PORT_PVCR 0xA4050122UL | 39 | # define PORT_PVCR 0xA4050122UL |
@@ -94,7 +96,9 @@ | |||
94 | # define SCSCR_INIT(port) 0x0038 /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ | 96 | # define SCSCR_INIT(port) 0x0038 /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ |
95 | #elif defined(CONFIG_CPU_SUBTYPE_SH7724) | 97 | #elif defined(CONFIG_CPU_SUBTYPE_SH7724) |
96 | # define SCIF_ORER 0x0001 /* overrun error bit */ | 98 | # define SCIF_ORER 0x0001 /* overrun error bit */ |
97 | # define SCSCR_INIT(port) 0x0038 /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ | 99 | # define SCSCR_INIT(port) ((port)->type == PORT_SCIFA ? \ |
100 | 0x30 /* TIE=0,RIE=0,TE=1,RE=1 */ : \ | ||
101 | 0x38 /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ ) | ||
98 | #elif defined(CONFIG_CPU_SUBTYPE_SH4_202) | 102 | #elif defined(CONFIG_CPU_SUBTYPE_SH4_202) |
99 | # define SCSPTR2 0xffe80020 /* 16 bit SCIF */ | 103 | # define SCSPTR2 0xffe80020 /* 16 bit SCIF */ |
100 | # define SCIF_ORER 0x0001 /* overrun error bit */ | 104 | # define SCIF_ORER 0x0001 /* overrun error bit */ |
@@ -197,6 +201,8 @@ | |||
197 | defined(CONFIG_CPU_SUBTYPE_SH7786) || \ | 201 | defined(CONFIG_CPU_SUBTYPE_SH7786) || \ |
198 | defined(CONFIG_CPU_SUBTYPE_SHX3) | 202 | defined(CONFIG_CPU_SUBTYPE_SHX3) |
199 | #define SCI_CTRL_FLAGS_REIE 0x08 /* 7750 SCIF */ | 203 | #define SCI_CTRL_FLAGS_REIE 0x08 /* 7750 SCIF */ |
204 | #elif defined(CONFIG_CPU_SUBTYPE_SH7724) | ||
205 | #define SCI_CTRL_FLAGS_REIE ((port)->type == PORT_SCIFA ? 0 : 8) | ||
200 | #else | 206 | #else |
201 | #define SCI_CTRL_FLAGS_REIE 0 | 207 | #define SCI_CTRL_FLAGS_REIE 0 |
202 | #endif | 208 | #endif |
@@ -230,7 +236,9 @@ | |||
230 | #if defined(CONFIG_CPU_SUBTYPE_SH7705) || \ | 236 | #if defined(CONFIG_CPU_SUBTYPE_SH7705) || \ |
231 | defined(CONFIG_CPU_SUBTYPE_SH7720) || \ | 237 | defined(CONFIG_CPU_SUBTYPE_SH7720) || \ |
232 | defined(CONFIG_CPU_SUBTYPE_SH7721) || \ | 238 | defined(CONFIG_CPU_SUBTYPE_SH7721) || \ |
233 | defined(CONFIG_ARCH_SHMOBILE) | 239 | defined(CONFIG_ARCH_SH7367) || \ |
240 | defined(CONFIG_ARCH_SH7377) || \ | ||
241 | defined(CONFIG_ARCH_SH7372) | ||
234 | # define SCIF_ORER 0x0200 | 242 | # define SCIF_ORER 0x0200 |
235 | # define SCIF_ERRORS ( SCIF_PER | SCIF_FER | SCIF_ER | SCIF_BRK | SCIF_ORER) | 243 | # define SCIF_ERRORS ( SCIF_PER | SCIF_FER | SCIF_ER | SCIF_BRK | SCIF_ORER) |
236 | # define SCIF_RFDC_MASK 0x007f | 244 | # define SCIF_RFDC_MASK 0x007f |
@@ -264,7 +272,9 @@ | |||
264 | #if defined(CONFIG_CPU_SUBTYPE_SH7705) || \ | 272 | #if defined(CONFIG_CPU_SUBTYPE_SH7705) || \ |
265 | defined(CONFIG_CPU_SUBTYPE_SH7720) || \ | 273 | defined(CONFIG_CPU_SUBTYPE_SH7720) || \ |
266 | defined(CONFIG_CPU_SUBTYPE_SH7721) || \ | 274 | defined(CONFIG_CPU_SUBTYPE_SH7721) || \ |
267 | defined(CONFIG_ARCH_SHMOBILE) | 275 | defined(CONFIG_ARCH_SH7367) || \ |
276 | defined(CONFIG_ARCH_SH7377) || \ | ||
277 | defined(CONFIG_ARCH_SH7372) | ||
268 | # define SCxSR_RDxF_CLEAR(port) (sci_in(port, SCxSR) & 0xfffc) | 278 | # define SCxSR_RDxF_CLEAR(port) (sci_in(port, SCxSR) & 0xfffc) |
269 | # define SCxSR_ERROR_CLEAR(port) (sci_in(port, SCxSR) & 0xfd73) | 279 | # define SCxSR_ERROR_CLEAR(port) (sci_in(port, SCxSR) & 0xfd73) |
270 | # define SCxSR_TDxE_CLEAR(port) (sci_in(port, SCxSR) & 0xffdf) | 280 | # define SCxSR_TDxE_CLEAR(port) (sci_in(port, SCxSR) & 0xffdf) |
@@ -359,7 +369,10 @@ | |||
359 | SCI_OUT(sci_size, sci_offset, value); \ | 369 | SCI_OUT(sci_size, sci_offset, value); \ |
360 | } | 370 | } |
361 | 371 | ||
362 | #if defined(CONFIG_CPU_SH3) || defined(CONFIG_ARCH_SHMOBILE) | 372 | #if defined(CONFIG_CPU_SH3) || \ |
373 | defined(CONFIG_ARCH_SH7367) || \ | ||
374 | defined(CONFIG_ARCH_SH7377) || \ | ||
375 | defined(CONFIG_ARCH_SH7372) | ||
363 | #if defined(CONFIG_CPU_SUBTYPE_SH7710) || defined(CONFIG_CPU_SUBTYPE_SH7712) | 376 | #if defined(CONFIG_CPU_SUBTYPE_SH7710) || defined(CONFIG_CPU_SUBTYPE_SH7712) |
364 | #define SCIx_FNS(name, sh3_sci_offset, sh3_sci_size, sh4_sci_offset, sh4_sci_size, \ | 377 | #define SCIx_FNS(name, sh3_sci_offset, sh3_sci_size, sh4_sci_offset, sh4_sci_size, \ |
365 | sh3_scif_offset, sh3_scif_size, sh4_scif_offset, sh4_scif_size, \ | 378 | sh3_scif_offset, sh3_scif_size, sh4_scif_offset, sh4_scif_size, \ |
@@ -370,7 +383,9 @@ | |||
370 | #elif defined(CONFIG_CPU_SUBTYPE_SH7705) || \ | 383 | #elif defined(CONFIG_CPU_SUBTYPE_SH7705) || \ |
371 | defined(CONFIG_CPU_SUBTYPE_SH7720) || \ | 384 | defined(CONFIG_CPU_SUBTYPE_SH7720) || \ |
372 | defined(CONFIG_CPU_SUBTYPE_SH7721) || \ | 385 | defined(CONFIG_CPU_SUBTYPE_SH7721) || \ |
373 | defined(CONFIG_ARCH_SHMOBILE) | 386 | defined(CONFIG_ARCH_SH7367) || \ |
387 | defined(CONFIG_ARCH_SH7377) || \ | ||
388 | defined(CONFIG_ARCH_SH7372) | ||
374 | #define SCIF_FNS(name, scif_offset, scif_size) \ | 389 | #define SCIF_FNS(name, scif_offset, scif_size) \ |
375 | CPU_SCIF_FNS(name, scif_offset, scif_size) | 390 | CPU_SCIF_FNS(name, scif_offset, scif_size) |
376 | #else | 391 | #else |
@@ -406,7 +421,9 @@ | |||
406 | #if defined(CONFIG_CPU_SUBTYPE_SH7705) || \ | 421 | #if defined(CONFIG_CPU_SUBTYPE_SH7705) || \ |
407 | defined(CONFIG_CPU_SUBTYPE_SH7720) || \ | 422 | defined(CONFIG_CPU_SUBTYPE_SH7720) || \ |
408 | defined(CONFIG_CPU_SUBTYPE_SH7721) || \ | 423 | defined(CONFIG_CPU_SUBTYPE_SH7721) || \ |
409 | defined(CONFIG_ARCH_SHMOBILE) | 424 | defined(CONFIG_ARCH_SH7367) || \ |
425 | defined(CONFIG_ARCH_SH7377) || \ | ||
426 | defined(CONFIG_ARCH_SH7372) | ||
410 | 427 | ||
411 | SCIF_FNS(SCSMR, 0x00, 16) | 428 | SCIF_FNS(SCSMR, 0x00, 16) |
412 | SCIF_FNS(SCBRR, 0x04, 8) | 429 | SCIF_FNS(SCBRR, 0x04, 8) |
@@ -589,7 +606,9 @@ static inline int sci_rxd_in(struct uart_port *port) | |||
589 | #elif defined(CONFIG_CPU_SUBTYPE_SH7705) || \ | 606 | #elif defined(CONFIG_CPU_SUBTYPE_SH7705) || \ |
590 | defined(CONFIG_CPU_SUBTYPE_SH7720) || \ | 607 | defined(CONFIG_CPU_SUBTYPE_SH7720) || \ |
591 | defined(CONFIG_CPU_SUBTYPE_SH7721) || \ | 608 | defined(CONFIG_CPU_SUBTYPE_SH7721) || \ |
592 | defined(CONFIG_ARCH_SHMOBILE) | 609 | defined(CONFIG_ARCH_SH7367) || \ |
610 | defined(CONFIG_ARCH_SH7377) || \ | ||
611 | defined(CONFIG_ARCH_SH7372) | ||
593 | #define SCBRR_VALUE(bps, clk) (((clk*2)+16*bps)/(32*bps)-1) | 612 | #define SCBRR_VALUE(bps, clk) (((clk*2)+16*bps)/(32*bps)-1) |
594 | #elif defined(CONFIG_CPU_SUBTYPE_SH7723) ||\ | 613 | #elif defined(CONFIG_CPU_SUBTYPE_SH7723) ||\ |
595 | defined(CONFIG_CPU_SUBTYPE_SH7724) | 614 | defined(CONFIG_CPU_SUBTYPE_SH7724) |
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index ad37da2b6cb5..a6a88dfd5029 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c | |||
@@ -125,7 +125,7 @@ static void handle_tx(struct vhost_net *net) | |||
125 | mutex_lock(&vq->mutex); | 125 | mutex_lock(&vq->mutex); |
126 | vhost_disable_notify(vq); | 126 | vhost_disable_notify(vq); |
127 | 127 | ||
128 | if (wmem < sock->sk->sk_sndbuf * 2) | 128 | if (wmem < sock->sk->sk_sndbuf / 2) |
129 | tx_poll_stop(net); | 129 | tx_poll_stop(net); |
130 | hdr_size = vq->hdr_size; | 130 | hdr_size = vq->hdr_size; |
131 | 131 | ||
@@ -508,12 +508,12 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd) | |||
508 | /* Verify that ring has been setup correctly. */ | 508 | /* Verify that ring has been setup correctly. */ |
509 | if (!vhost_vq_access_ok(vq)) { | 509 | if (!vhost_vq_access_ok(vq)) { |
510 | r = -EFAULT; | 510 | r = -EFAULT; |
511 | goto err; | 511 | goto err_vq; |
512 | } | 512 | } |
513 | sock = get_socket(fd); | 513 | sock = get_socket(fd); |
514 | if (IS_ERR(sock)) { | 514 | if (IS_ERR(sock)) { |
515 | r = PTR_ERR(sock); | 515 | r = PTR_ERR(sock); |
516 | goto err; | 516 | goto err_vq; |
517 | } | 517 | } |
518 | 518 | ||
519 | /* start polling new socket */ | 519 | /* start polling new socket */ |
@@ -524,12 +524,14 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd) | |||
524 | vhost_net_disable_vq(n, vq); | 524 | vhost_net_disable_vq(n, vq); |
525 | rcu_assign_pointer(vq->private_data, sock); | 525 | rcu_assign_pointer(vq->private_data, sock); |
526 | vhost_net_enable_vq(n, vq); | 526 | vhost_net_enable_vq(n, vq); |
527 | mutex_unlock(&vq->mutex); | ||
528 | done: | 527 | done: |
529 | if (oldsock) { | 528 | if (oldsock) { |
530 | vhost_net_flush_vq(n, index); | 529 | vhost_net_flush_vq(n, index); |
531 | fput(oldsock->file); | 530 | fput(oldsock->file); |
532 | } | 531 | } |
532 | |||
533 | err_vq: | ||
534 | mutex_unlock(&vq->mutex); | ||
533 | err: | 535 | err: |
534 | mutex_unlock(&n->dev.mutex); | 536 | mutex_unlock(&n->dev.mutex); |
535 | return r; | 537 | return r; |
diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index 7cd55e078794..7bd7a1e4409d 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c | |||
@@ -476,8 +476,10 @@ static long vhost_set_vring(struct vhost_dev *d, int ioctl, void __user *argp) | |||
476 | if (r < 0) | 476 | if (r < 0) |
477 | break; | 477 | break; |
478 | eventfp = f.fd == -1 ? NULL : eventfd_fget(f.fd); | 478 | eventfp = f.fd == -1 ? NULL : eventfd_fget(f.fd); |
479 | if (IS_ERR(eventfp)) | 479 | if (IS_ERR(eventfp)) { |
480 | return PTR_ERR(eventfp); | 480 | r = PTR_ERR(eventfp); |
481 | break; | ||
482 | } | ||
481 | if (eventfp != vq->kick) { | 483 | if (eventfp != vq->kick) { |
482 | pollstop = filep = vq->kick; | 484 | pollstop = filep = vq->kick; |
483 | pollstart = vq->kick = eventfp; | 485 | pollstart = vq->kick = eventfp; |
@@ -489,8 +491,10 @@ static long vhost_set_vring(struct vhost_dev *d, int ioctl, void __user *argp) | |||
489 | if (r < 0) | 491 | if (r < 0) |
490 | break; | 492 | break; |
491 | eventfp = f.fd == -1 ? NULL : eventfd_fget(f.fd); | 493 | eventfp = f.fd == -1 ? NULL : eventfd_fget(f.fd); |
492 | if (IS_ERR(eventfp)) | 494 | if (IS_ERR(eventfp)) { |
493 | return PTR_ERR(eventfp); | 495 | r = PTR_ERR(eventfp); |
496 | break; | ||
497 | } | ||
494 | if (eventfp != vq->call) { | 498 | if (eventfp != vq->call) { |
495 | filep = vq->call; | 499 | filep = vq->call; |
496 | ctx = vq->call_ctx; | 500 | ctx = vq->call_ctx; |
@@ -505,8 +509,10 @@ static long vhost_set_vring(struct vhost_dev *d, int ioctl, void __user *argp) | |||
505 | if (r < 0) | 509 | if (r < 0) |
506 | break; | 510 | break; |
507 | eventfp = f.fd == -1 ? NULL : eventfd_fget(f.fd); | 511 | eventfp = f.fd == -1 ? NULL : eventfd_fget(f.fd); |
508 | if (IS_ERR(eventfp)) | 512 | if (IS_ERR(eventfp)) { |
509 | return PTR_ERR(eventfp); | 513 | r = PTR_ERR(eventfp); |
514 | break; | ||
515 | } | ||
510 | if (eventfp != vq->error) { | 516 | if (eventfp != vq->error) { |
511 | filep = vq->error; | 517 | filep = vq->error; |
512 | vq->error = eventfp; | 518 | vq->error = eventfp; |
diff --git a/drivers/video/geode/lxfb.h b/drivers/video/geode/lxfb.h index cc781c00f75d..e4c4d89b7860 100644 --- a/drivers/video/geode/lxfb.h +++ b/drivers/video/geode/lxfb.h | |||
@@ -365,6 +365,8 @@ enum fp_registers { | |||
365 | FP_CRC, /* 0x458 */ | 365 | FP_CRC, /* 0x458 */ |
366 | }; | 366 | }; |
367 | 367 | ||
368 | #define FP_PT2_HSP (1 << 22) | ||
369 | #define FP_PT2_VSP (1 << 23) | ||
368 | #define FP_PT2_SCRC (1 << 27) /* shfclk free */ | 370 | #define FP_PT2_SCRC (1 << 27) /* shfclk free */ |
369 | 371 | ||
370 | #define FP_PM_P (1 << 24) /* panel power ctl */ | 372 | #define FP_PM_P (1 << 24) /* panel power ctl */ |
diff --git a/drivers/video/geode/lxfb_ops.c b/drivers/video/geode/lxfb_ops.c index 0e5d8c7c3eba..bc35a95e59d4 100644 --- a/drivers/video/geode/lxfb_ops.c +++ b/drivers/video/geode/lxfb_ops.c | |||
@@ -274,7 +274,15 @@ static void lx_graphics_enable(struct fb_info *info) | |||
274 | u32 msrlo, msrhi; | 274 | u32 msrlo, msrhi; |
275 | 275 | ||
276 | write_fp(par, FP_PT1, 0); | 276 | write_fp(par, FP_PT1, 0); |
277 | write_fp(par, FP_PT2, FP_PT2_SCRC); | 277 | temp = FP_PT2_SCRC; |
278 | |||
279 | if (info->var.sync & FB_SYNC_HOR_HIGH_ACT) | ||
280 | temp |= FP_PT2_HSP; | ||
281 | |||
282 | if (info->var.sync & FB_SYNC_VERT_HIGH_ACT) | ||
283 | temp |= FP_PT2_VSP; | ||
284 | |||
285 | write_fp(par, FP_PT2, temp); | ||
278 | write_fp(par, FP_DFC, FP_DFC_BC); | 286 | write_fp(par, FP_DFC, FP_DFC_BC); |
279 | 287 | ||
280 | msrlo = MSR_LX_MSR_PADSEL_TFT_SEL_LOW; | 288 | msrlo = MSR_LX_MSR_PADSEL_TFT_SEL_LOW; |
diff --git a/fs/afs/security.c b/fs/afs/security.c index 3ef504370034..bb4ed144d0e4 100644 --- a/fs/afs/security.c +++ b/fs/afs/security.c | |||
@@ -189,8 +189,9 @@ void afs_cache_permit(struct afs_vnode *vnode, struct key *key, long acl_order) | |||
189 | if (!permits) | 189 | if (!permits) |
190 | goto out_unlock; | 190 | goto out_unlock; |
191 | 191 | ||
192 | memcpy(permits->permits, xpermits->permits, | 192 | if (xpermits) |
193 | count * sizeof(struct afs_permit)); | 193 | memcpy(permits->permits, xpermits->permits, |
194 | count * sizeof(struct afs_permit)); | ||
194 | 195 | ||
195 | _debug("key %x access %x", | 196 | _debug("key %x access %x", |
196 | key_serial(key), vnode->status.caller_access); | 197 | key_serial(key), vnode->status.caller_access); |
diff --git a/fs/binfmt_aout.c b/fs/binfmt_aout.c index 15d80bb35d6f..9b6aef0f75e5 100644 --- a/fs/binfmt_aout.c +++ b/fs/binfmt_aout.c | |||
@@ -75,14 +75,16 @@ static int aout_core_dump(struct coredump_params *cprm) | |||
75 | struct file *file = cprm->file; | 75 | struct file *file = cprm->file; |
76 | mm_segment_t fs; | 76 | mm_segment_t fs; |
77 | int has_dumped = 0; | 77 | int has_dumped = 0; |
78 | unsigned long dump_start, dump_size; | 78 | void __user *dump_start; |
79 | int dump_size; | ||
79 | struct user dump; | 80 | struct user dump; |
80 | #ifdef __alpha__ | 81 | #ifdef __alpha__ |
81 | # define START_DATA(u) (u.start_data) | 82 | # define START_DATA(u) ((void __user *)u.start_data) |
82 | #else | 83 | #else |
83 | # define START_DATA(u) ((u.u_tsize << PAGE_SHIFT) + u.start_code) | 84 | # define START_DATA(u) ((void __user *)((u.u_tsize << PAGE_SHIFT) + \ |
85 | u.start_code)) | ||
84 | #endif | 86 | #endif |
85 | # define START_STACK(u) (u.start_stack) | 87 | # define START_STACK(u) ((void __user *)u.start_stack) |
86 | 88 | ||
87 | fs = get_fs(); | 89 | fs = get_fs(); |
88 | set_fs(KERNEL_DS); | 90 | set_fs(KERNEL_DS); |
@@ -104,9 +106,9 @@ static int aout_core_dump(struct coredump_params *cprm) | |||
104 | 106 | ||
105 | /* make sure we actually have a data and stack area to dump */ | 107 | /* make sure we actually have a data and stack area to dump */ |
106 | set_fs(USER_DS); | 108 | set_fs(USER_DS); |
107 | if (!access_ok(VERIFY_READ, (void __user *)START_DATA(dump), dump.u_dsize << PAGE_SHIFT)) | 109 | if (!access_ok(VERIFY_READ, START_DATA(dump), dump.u_dsize << PAGE_SHIFT)) |
108 | dump.u_dsize = 0; | 110 | dump.u_dsize = 0; |
109 | if (!access_ok(VERIFY_READ, (void __user *)START_STACK(dump), dump.u_ssize << PAGE_SHIFT)) | 111 | if (!access_ok(VERIFY_READ, START_STACK(dump), dump.u_ssize << PAGE_SHIFT)) |
110 | dump.u_ssize = 0; | 112 | dump.u_ssize = 0; |
111 | 113 | ||
112 | set_fs(KERNEL_DS); | 114 | set_fs(KERNEL_DS); |
diff --git a/fs/binfmt_elf_fdpic.c b/fs/binfmt_elf_fdpic.c index 2c32d00a6690..7ab23e006e4c 100644 --- a/fs/binfmt_elf_fdpic.c +++ b/fs/binfmt_elf_fdpic.c | |||
@@ -1590,7 +1590,7 @@ static size_t elf_core_vma_data_size(unsigned long mm_flags) | |||
1590 | struct vm_area_struct *vma; | 1590 | struct vm_area_struct *vma; |
1591 | size_t size = 0; | 1591 | size_t size = 0; |
1592 | 1592 | ||
1593 | for (vma = current->mm->mmap; vma; vma->vm_next) | 1593 | for (vma = current->mm->mmap; vma; vma = vma->vm_next) |
1594 | if (maydump(vma, mm_flags)) | 1594 | if (maydump(vma, mm_flags)) |
1595 | size += vma->vm_end - vma->vm_start; | 1595 | size += vma->vm_end - vma->vm_start; |
1596 | return size; | 1596 | return size; |
diff --git a/fs/fscache/page.c b/fs/fscache/page.c index c598ea4c4e7d..69809024d71d 100644 --- a/fs/fscache/page.c +++ b/fs/fscache/page.c | |||
@@ -881,6 +881,7 @@ submit_failed: | |||
881 | goto nobufs; | 881 | goto nobufs; |
882 | 882 | ||
883 | nobufs_unlock_obj: | 883 | nobufs_unlock_obj: |
884 | spin_unlock(&cookie->stores_lock); | ||
884 | spin_unlock(&object->lock); | 885 | spin_unlock(&object->lock); |
885 | nobufs: | 886 | nobufs: |
886 | spin_unlock(&cookie->lock); | 887 | spin_unlock(&cookie->lock); |
diff --git a/fs/nfs/file.c b/fs/nfs/file.c index ae8d02294e46..ae0d92736531 100644 --- a/fs/nfs/file.c +++ b/fs/nfs/file.c | |||
@@ -491,7 +491,8 @@ static int nfs_release_page(struct page *page, gfp_t gfp) | |||
491 | { | 491 | { |
492 | dfprintk(PAGECACHE, "NFS: release_page(%p)\n", page); | 492 | dfprintk(PAGECACHE, "NFS: release_page(%p)\n", page); |
493 | 493 | ||
494 | if (gfp & __GFP_WAIT) | 494 | /* Only do I/O if gfp is a superset of GFP_KERNEL */ |
495 | if ((gfp & GFP_KERNEL) == GFP_KERNEL) | ||
495 | nfs_wb_page(page->mapping->host, page); | 496 | nfs_wb_page(page->mapping->host, page); |
496 | /* If PagePrivate() is set, then the page is not freeable */ | 497 | /* If PagePrivate() is set, then the page is not freeable */ |
497 | if (PagePrivate(page)) | 498 | if (PagePrivate(page)) |
diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c index 4d338be492cb..dd17713413a5 100644 --- a/fs/nfs/nfs4xdr.c +++ b/fs/nfs/nfs4xdr.c | |||
@@ -5552,6 +5552,8 @@ static int nfs4_xdr_dec_delegreturn(struct rpc_rqst *rqstp, __be32 *p, struct nf | |||
5552 | if (status != 0) | 5552 | if (status != 0) |
5553 | goto out; | 5553 | goto out; |
5554 | status = decode_delegreturn(&xdr); | 5554 | status = decode_delegreturn(&xdr); |
5555 | if (status != 0) | ||
5556 | goto out; | ||
5555 | decode_getfattr(&xdr, res->fattr, res->server, | 5557 | decode_getfattr(&xdr, res->fattr, res->server, |
5556 | !RPC_IS_ASYNC(rqstp->rq_task)); | 5558 | !RPC_IS_ASYNC(rqstp->rq_task)); |
5557 | out: | 5559 | out: |
diff --git a/fs/partitions/msdos.c b/fs/partitions/msdos.c index 0028d2ef0662..90be97f1f5a8 100644 --- a/fs/partitions/msdos.c +++ b/fs/partitions/msdos.c | |||
@@ -31,14 +31,17 @@ | |||
31 | */ | 31 | */ |
32 | #include <asm/unaligned.h> | 32 | #include <asm/unaligned.h> |
33 | 33 | ||
34 | #define SYS_IND(p) (get_unaligned(&p->sys_ind)) | 34 | #define SYS_IND(p) get_unaligned(&p->sys_ind) |
35 | #define NR_SECTS(p) ({ __le32 __a = get_unaligned(&p->nr_sects); \ | ||
36 | le32_to_cpu(__a); \ | ||
37 | }) | ||
38 | 35 | ||
39 | #define START_SECT(p) ({ __le32 __a = get_unaligned(&p->start_sect); \ | 36 | static inline sector_t nr_sects(struct partition *p) |
40 | le32_to_cpu(__a); \ | 37 | { |
41 | }) | 38 | return (sector_t)get_unaligned_le32(&p->nr_sects); |
39 | } | ||
40 | |||
41 | static inline sector_t start_sect(struct partition *p) | ||
42 | { | ||
43 | return (sector_t)get_unaligned_le32(&p->start_sect); | ||
44 | } | ||
42 | 45 | ||
43 | static inline int is_extended_partition(struct partition *p) | 46 | static inline int is_extended_partition(struct partition *p) |
44 | { | 47 | { |
@@ -104,13 +107,13 @@ static int aix_magic_present(unsigned char *p, struct block_device *bdev) | |||
104 | 107 | ||
105 | static void | 108 | static void |
106 | parse_extended(struct parsed_partitions *state, struct block_device *bdev, | 109 | parse_extended(struct parsed_partitions *state, struct block_device *bdev, |
107 | u32 first_sector, u32 first_size) | 110 | sector_t first_sector, sector_t first_size) |
108 | { | 111 | { |
109 | struct partition *p; | 112 | struct partition *p; |
110 | Sector sect; | 113 | Sector sect; |
111 | unsigned char *data; | 114 | unsigned char *data; |
112 | u32 this_sector, this_size; | 115 | sector_t this_sector, this_size; |
113 | int sector_size = bdev_logical_block_size(bdev) / 512; | 116 | sector_t sector_size = bdev_logical_block_size(bdev) / 512; |
114 | int loopct = 0; /* number of links followed | 117 | int loopct = 0; /* number of links followed |
115 | without finding a data partition */ | 118 | without finding a data partition */ |
116 | int i; | 119 | int i; |
@@ -145,14 +148,14 @@ parse_extended(struct parsed_partitions *state, struct block_device *bdev, | |||
145 | * First process the data partition(s) | 148 | * First process the data partition(s) |
146 | */ | 149 | */ |
147 | for (i=0; i<4; i++, p++) { | 150 | for (i=0; i<4; i++, p++) { |
148 | u32 offs, size, next; | 151 | sector_t offs, size, next; |
149 | if (!NR_SECTS(p) || is_extended_partition(p)) | 152 | if (!nr_sects(p) || is_extended_partition(p)) |
150 | continue; | 153 | continue; |
151 | 154 | ||
152 | /* Check the 3rd and 4th entries - | 155 | /* Check the 3rd and 4th entries - |
153 | these sometimes contain random garbage */ | 156 | these sometimes contain random garbage */ |
154 | offs = START_SECT(p)*sector_size; | 157 | offs = start_sect(p)*sector_size; |
155 | size = NR_SECTS(p)*sector_size; | 158 | size = nr_sects(p)*sector_size; |
156 | next = this_sector + offs; | 159 | next = this_sector + offs; |
157 | if (i >= 2) { | 160 | if (i >= 2) { |
158 | if (offs + size > this_size) | 161 | if (offs + size > this_size) |
@@ -179,13 +182,13 @@ parse_extended(struct parsed_partitions *state, struct block_device *bdev, | |||
179 | */ | 182 | */ |
180 | p -= 4; | 183 | p -= 4; |
181 | for (i=0; i<4; i++, p++) | 184 | for (i=0; i<4; i++, p++) |
182 | if (NR_SECTS(p) && is_extended_partition(p)) | 185 | if (nr_sects(p) && is_extended_partition(p)) |
183 | break; | 186 | break; |
184 | if (i == 4) | 187 | if (i == 4) |
185 | goto done; /* nothing left to do */ | 188 | goto done; /* nothing left to do */ |
186 | 189 | ||
187 | this_sector = first_sector + START_SECT(p) * sector_size; | 190 | this_sector = first_sector + start_sect(p) * sector_size; |
188 | this_size = NR_SECTS(p) * sector_size; | 191 | this_size = nr_sects(p) * sector_size; |
189 | put_dev_sector(sect); | 192 | put_dev_sector(sect); |
190 | } | 193 | } |
191 | done: | 194 | done: |
@@ -197,7 +200,7 @@ done: | |||
197 | 200 | ||
198 | static void | 201 | static void |
199 | parse_solaris_x86(struct parsed_partitions *state, struct block_device *bdev, | 202 | parse_solaris_x86(struct parsed_partitions *state, struct block_device *bdev, |
200 | u32 offset, u32 size, int origin) | 203 | sector_t offset, sector_t size, int origin) |
201 | { | 204 | { |
202 | #ifdef CONFIG_SOLARIS_X86_PARTITION | 205 | #ifdef CONFIG_SOLARIS_X86_PARTITION |
203 | Sector sect; | 206 | Sector sect; |
@@ -244,7 +247,7 @@ parse_solaris_x86(struct parsed_partitions *state, struct block_device *bdev, | |||
244 | */ | 247 | */ |
245 | static void | 248 | static void |
246 | parse_bsd(struct parsed_partitions *state, struct block_device *bdev, | 249 | parse_bsd(struct parsed_partitions *state, struct block_device *bdev, |
247 | u32 offset, u32 size, int origin, char *flavour, | 250 | sector_t offset, sector_t size, int origin, char *flavour, |
248 | int max_partitions) | 251 | int max_partitions) |
249 | { | 252 | { |
250 | Sector sect; | 253 | Sector sect; |
@@ -263,7 +266,7 @@ parse_bsd(struct parsed_partitions *state, struct block_device *bdev, | |||
263 | if (le16_to_cpu(l->d_npartitions) < max_partitions) | 266 | if (le16_to_cpu(l->d_npartitions) < max_partitions) |
264 | max_partitions = le16_to_cpu(l->d_npartitions); | 267 | max_partitions = le16_to_cpu(l->d_npartitions); |
265 | for (p = l->d_partitions; p - l->d_partitions < max_partitions; p++) { | 268 | for (p = l->d_partitions; p - l->d_partitions < max_partitions; p++) { |
266 | u32 bsd_start, bsd_size; | 269 | sector_t bsd_start, bsd_size; |
267 | 270 | ||
268 | if (state->next == state->limit) | 271 | if (state->next == state->limit) |
269 | break; | 272 | break; |
@@ -290,7 +293,7 @@ parse_bsd(struct parsed_partitions *state, struct block_device *bdev, | |||
290 | 293 | ||
291 | static void | 294 | static void |
292 | parse_freebsd(struct parsed_partitions *state, struct block_device *bdev, | 295 | parse_freebsd(struct parsed_partitions *state, struct block_device *bdev, |
293 | u32 offset, u32 size, int origin) | 296 | sector_t offset, sector_t size, int origin) |
294 | { | 297 | { |
295 | #ifdef CONFIG_BSD_DISKLABEL | 298 | #ifdef CONFIG_BSD_DISKLABEL |
296 | parse_bsd(state, bdev, offset, size, origin, | 299 | parse_bsd(state, bdev, offset, size, origin, |
@@ -300,7 +303,7 @@ parse_freebsd(struct parsed_partitions *state, struct block_device *bdev, | |||
300 | 303 | ||
301 | static void | 304 | static void |
302 | parse_netbsd(struct parsed_partitions *state, struct block_device *bdev, | 305 | parse_netbsd(struct parsed_partitions *state, struct block_device *bdev, |
303 | u32 offset, u32 size, int origin) | 306 | sector_t offset, sector_t size, int origin) |
304 | { | 307 | { |
305 | #ifdef CONFIG_BSD_DISKLABEL | 308 | #ifdef CONFIG_BSD_DISKLABEL |
306 | parse_bsd(state, bdev, offset, size, origin, | 309 | parse_bsd(state, bdev, offset, size, origin, |
@@ -310,7 +313,7 @@ parse_netbsd(struct parsed_partitions *state, struct block_device *bdev, | |||
310 | 313 | ||
311 | static void | 314 | static void |
312 | parse_openbsd(struct parsed_partitions *state, struct block_device *bdev, | 315 | parse_openbsd(struct parsed_partitions *state, struct block_device *bdev, |
313 | u32 offset, u32 size, int origin) | 316 | sector_t offset, sector_t size, int origin) |
314 | { | 317 | { |
315 | #ifdef CONFIG_BSD_DISKLABEL | 318 | #ifdef CONFIG_BSD_DISKLABEL |
316 | parse_bsd(state, bdev, offset, size, origin, | 319 | parse_bsd(state, bdev, offset, size, origin, |
@@ -324,7 +327,7 @@ parse_openbsd(struct parsed_partitions *state, struct block_device *bdev, | |||
324 | */ | 327 | */ |
325 | static void | 328 | static void |
326 | parse_unixware(struct parsed_partitions *state, struct block_device *bdev, | 329 | parse_unixware(struct parsed_partitions *state, struct block_device *bdev, |
327 | u32 offset, u32 size, int origin) | 330 | sector_t offset, sector_t size, int origin) |
328 | { | 331 | { |
329 | #ifdef CONFIG_UNIXWARE_DISKLABEL | 332 | #ifdef CONFIG_UNIXWARE_DISKLABEL |
330 | Sector sect; | 333 | Sector sect; |
@@ -348,7 +351,8 @@ parse_unixware(struct parsed_partitions *state, struct block_device *bdev, | |||
348 | 351 | ||
349 | if (p->s_label != UNIXWARE_FS_UNUSED) | 352 | if (p->s_label != UNIXWARE_FS_UNUSED) |
350 | put_partition(state, state->next++, | 353 | put_partition(state, state->next++, |
351 | START_SECT(p), NR_SECTS(p)); | 354 | le32_to_cpu(p->start_sect), |
355 | le32_to_cpu(p->nr_sects)); | ||
352 | p++; | 356 | p++; |
353 | } | 357 | } |
354 | put_dev_sector(sect); | 358 | put_dev_sector(sect); |
@@ -363,7 +367,7 @@ parse_unixware(struct parsed_partitions *state, struct block_device *bdev, | |||
363 | */ | 367 | */ |
364 | static void | 368 | static void |
365 | parse_minix(struct parsed_partitions *state, struct block_device *bdev, | 369 | parse_minix(struct parsed_partitions *state, struct block_device *bdev, |
366 | u32 offset, u32 size, int origin) | 370 | sector_t offset, sector_t size, int origin) |
367 | { | 371 | { |
368 | #ifdef CONFIG_MINIX_SUBPARTITION | 372 | #ifdef CONFIG_MINIX_SUBPARTITION |
369 | Sector sect; | 373 | Sector sect; |
@@ -390,7 +394,7 @@ parse_minix(struct parsed_partitions *state, struct block_device *bdev, | |||
390 | /* add each partition in use */ | 394 | /* add each partition in use */ |
391 | if (SYS_IND(p) == MINIX_PARTITION) | 395 | if (SYS_IND(p) == MINIX_PARTITION) |
392 | put_partition(state, state->next++, | 396 | put_partition(state, state->next++, |
393 | START_SECT(p), NR_SECTS(p)); | 397 | start_sect(p), nr_sects(p)); |
394 | } | 398 | } |
395 | printk(" >\n"); | 399 | printk(" >\n"); |
396 | } | 400 | } |
@@ -401,7 +405,7 @@ parse_minix(struct parsed_partitions *state, struct block_device *bdev, | |||
401 | static struct { | 405 | static struct { |
402 | unsigned char id; | 406 | unsigned char id; |
403 | void (*parse)(struct parsed_partitions *, struct block_device *, | 407 | void (*parse)(struct parsed_partitions *, struct block_device *, |
404 | u32, u32, int); | 408 | sector_t, sector_t, int); |
405 | } subtypes[] = { | 409 | } subtypes[] = { |
406 | {FREEBSD_PARTITION, parse_freebsd}, | 410 | {FREEBSD_PARTITION, parse_freebsd}, |
407 | {NETBSD_PARTITION, parse_netbsd}, | 411 | {NETBSD_PARTITION, parse_netbsd}, |
@@ -415,7 +419,7 @@ static struct { | |||
415 | 419 | ||
416 | int msdos_partition(struct parsed_partitions *state, struct block_device *bdev) | 420 | int msdos_partition(struct parsed_partitions *state, struct block_device *bdev) |
417 | { | 421 | { |
418 | int sector_size = bdev_logical_block_size(bdev) / 512; | 422 | sector_t sector_size = bdev_logical_block_size(bdev) / 512; |
419 | Sector sect; | 423 | Sector sect; |
420 | unsigned char *data; | 424 | unsigned char *data; |
421 | struct partition *p; | 425 | struct partition *p; |
@@ -483,14 +487,21 @@ int msdos_partition(struct parsed_partitions *state, struct block_device *bdev) | |||
483 | 487 | ||
484 | state->next = 5; | 488 | state->next = 5; |
485 | for (slot = 1 ; slot <= 4 ; slot++, p++) { | 489 | for (slot = 1 ; slot <= 4 ; slot++, p++) { |
486 | u32 start = START_SECT(p)*sector_size; | 490 | sector_t start = start_sect(p)*sector_size; |
487 | u32 size = NR_SECTS(p)*sector_size; | 491 | sector_t size = nr_sects(p)*sector_size; |
488 | if (!size) | 492 | if (!size) |
489 | continue; | 493 | continue; |
490 | if (is_extended_partition(p)) { | 494 | if (is_extended_partition(p)) { |
491 | /* prevent someone doing mkfs or mkswap on an | 495 | /* |
492 | extended partition, but leave room for LILO */ | 496 | * prevent someone doing mkfs or mkswap on an |
493 | put_partition(state, slot, start, size == 1 ? 1 : 2); | 497 | * extended partition, but leave room for LILO |
498 | * FIXME: this uses one logical sector for > 512b | ||
499 | * sector, although it may not be enough/proper. | ||
500 | */ | ||
501 | sector_t n = 2; | ||
502 | n = min(size, max(sector_size, n)); | ||
503 | put_partition(state, slot, start, n); | ||
504 | |||
494 | printk(" <"); | 505 | printk(" <"); |
495 | parse_extended(state, bdev, start, size); | 506 | parse_extended(state, bdev, start, size); |
496 | printk(" >"); | 507 | printk(" >"); |
@@ -513,7 +524,7 @@ int msdos_partition(struct parsed_partitions *state, struct block_device *bdev) | |||
513 | unsigned char id = SYS_IND(p); | 524 | unsigned char id = SYS_IND(p); |
514 | int n; | 525 | int n; |
515 | 526 | ||
516 | if (!NR_SECTS(p)) | 527 | if (!nr_sects(p)) |
517 | continue; | 528 | continue; |
518 | 529 | ||
519 | for (n = 0; subtypes[n].parse && id != subtypes[n].id; n++) | 530 | for (n = 0; subtypes[n].parse && id != subtypes[n].id; n++) |
@@ -521,8 +532,8 @@ int msdos_partition(struct parsed_partitions *state, struct block_device *bdev) | |||
521 | 532 | ||
522 | if (!subtypes[n].parse) | 533 | if (!subtypes[n].parse) |
523 | continue; | 534 | continue; |
524 | subtypes[n].parse(state, bdev, START_SECT(p)*sector_size, | 535 | subtypes[n].parse(state, bdev, start_sect(p)*sector_size, |
525 | NR_SECTS(p)*sector_size, slot); | 536 | nr_sects(p)*sector_size, slot); |
526 | } | 537 | } |
527 | put_dev_sector(sect); | 538 | put_dev_sector(sect); |
528 | return 1; | 539 | return 1; |
diff --git a/fs/proc/kcore.c b/fs/proc/kcore.c index a44a7897fd4d..b442dac8f5f9 100644 --- a/fs/proc/kcore.c +++ b/fs/proc/kcore.c | |||
@@ -490,7 +490,7 @@ read_kcore(struct file *file, char __user *buffer, size_t buflen, loff_t *fpos) | |||
490 | } | 490 | } |
491 | read_unlock(&kclist_lock); | 491 | read_unlock(&kclist_lock); |
492 | 492 | ||
493 | if (m == NULL) { | 493 | if (&m->list == &kclist_head) { |
494 | if (clear_user(buffer, tsz)) | 494 | if (clear_user(buffer, tsz)) |
495 | return -EFAULT; | 495 | return -EFAULT; |
496 | } else if (is_vmalloc_or_module_addr((void *)start)) { | 496 | } else if (is_vmalloc_or_module_addr((void *)start)) { |
diff --git a/fs/read_write.c b/fs/read_write.c index b7f4a1f94d48..113386d6fd2d 100644 --- a/fs/read_write.c +++ b/fs/read_write.c | |||
@@ -258,6 +258,7 @@ ssize_t do_sync_read(struct file *filp, char __user *buf, size_t len, loff_t *pp | |||
258 | init_sync_kiocb(&kiocb, filp); | 258 | init_sync_kiocb(&kiocb, filp); |
259 | kiocb.ki_pos = *ppos; | 259 | kiocb.ki_pos = *ppos; |
260 | kiocb.ki_left = len; | 260 | kiocb.ki_left = len; |
261 | kiocb.ki_nbytes = len; | ||
261 | 262 | ||
262 | for (;;) { | 263 | for (;;) { |
263 | ret = filp->f_op->aio_read(&kiocb, &iov, 1, kiocb.ki_pos); | 264 | ret = filp->f_op->aio_read(&kiocb, &iov, 1, kiocb.ki_pos); |
@@ -313,6 +314,7 @@ ssize_t do_sync_write(struct file *filp, const char __user *buf, size_t len, lof | |||
313 | init_sync_kiocb(&kiocb, filp); | 314 | init_sync_kiocb(&kiocb, filp); |
314 | kiocb.ki_pos = *ppos; | 315 | kiocb.ki_pos = *ppos; |
315 | kiocb.ki_left = len; | 316 | kiocb.ki_left = len; |
317 | kiocb.ki_nbytes = len; | ||
316 | 318 | ||
317 | for (;;) { | 319 | for (;;) { |
318 | ret = filp->f_op->aio_write(&kiocb, &iov, 1, kiocb.ki_pos); | 320 | ret = filp->f_op->aio_write(&kiocb, &iov, 1, kiocb.ki_pos); |
diff --git a/fs/reiserfs/journal.c b/fs/reiserfs/journal.c index ba98546fabbd..f3de5e8a2ae8 100644 --- a/fs/reiserfs/journal.c +++ b/fs/reiserfs/journal.c | |||
@@ -2217,6 +2217,15 @@ static int journal_read_transaction(struct super_block *sb, | |||
2217 | brelse(d_bh); | 2217 | brelse(d_bh); |
2218 | return 1; | 2218 | return 1; |
2219 | } | 2219 | } |
2220 | |||
2221 | if (bdev_read_only(sb->s_bdev)) { | ||
2222 | reiserfs_warning(sb, "clm-2076", | ||
2223 | "device is readonly, unable to replay log"); | ||
2224 | brelse(c_bh); | ||
2225 | brelse(d_bh); | ||
2226 | return -EROFS; | ||
2227 | } | ||
2228 | |||
2220 | trans_id = get_desc_trans_id(desc); | 2229 | trans_id = get_desc_trans_id(desc); |
2221 | /* now we know we've got a good transaction, and it was inside the valid time ranges */ | 2230 | /* now we know we've got a good transaction, and it was inside the valid time ranges */ |
2222 | log_blocks = kmalloc(get_desc_trans_len(desc) * | 2231 | log_blocks = kmalloc(get_desc_trans_len(desc) * |
@@ -2459,12 +2468,6 @@ static int journal_read(struct super_block *sb) | |||
2459 | goto start_log_replay; | 2468 | goto start_log_replay; |
2460 | } | 2469 | } |
2461 | 2470 | ||
2462 | if (continue_replay && bdev_read_only(sb->s_bdev)) { | ||
2463 | reiserfs_warning(sb, "clm-2076", | ||
2464 | "device is readonly, unable to replay log"); | ||
2465 | return -1; | ||
2466 | } | ||
2467 | |||
2468 | /* ok, there are transactions that need to be replayed. start with the first log block, find | 2471 | /* ok, there are transactions that need to be replayed. start with the first log block, find |
2469 | ** all the valid transactions, and pick out the oldest. | 2472 | ** all the valid transactions, and pick out the oldest. |
2470 | */ | 2473 | */ |
diff --git a/fs/reiserfs/xattr_security.c b/fs/reiserfs/xattr_security.c index d8b5bfcbdd30..de1fcffd906b 100644 --- a/fs/reiserfs/xattr_security.c +++ b/fs/reiserfs/xattr_security.c | |||
@@ -76,7 +76,7 @@ int reiserfs_security_init(struct inode *dir, struct inode *inode, | |||
76 | return error; | 76 | return error; |
77 | } | 77 | } |
78 | 78 | ||
79 | if (sec->length) { | 79 | if (sec->length && reiserfs_xattrs_initialized(inode->i_sb)) { |
80 | blocks = reiserfs_xattr_jcreate_nblocks(inode) + | 80 | blocks = reiserfs_xattr_jcreate_nblocks(inode) + |
81 | reiserfs_xattr_nblocks(inode, sec->length); | 81 | reiserfs_xattr_nblocks(inode, sec->length); |
82 | /* We don't want to count the directories twice if we have | 82 | /* We don't want to count the directories twice if we have |
diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h index 3a4767c01c5f..4f7b44866b76 100644 --- a/include/acpi/acpi_drivers.h +++ b/include/acpi/acpi_drivers.h | |||
@@ -65,6 +65,8 @@ | |||
65 | #define ACPI_VIDEO_HID "LNXVIDEO" | 65 | #define ACPI_VIDEO_HID "LNXVIDEO" |
66 | #define ACPI_BAY_HID "LNXIOBAY" | 66 | #define ACPI_BAY_HID "LNXIOBAY" |
67 | #define ACPI_DOCK_HID "LNXDOCK" | 67 | #define ACPI_DOCK_HID "LNXDOCK" |
68 | /* Quirk for broken IBM BIOSes */ | ||
69 | #define ACPI_SMBUS_IBM_HID "SMBUSIBM" | ||
68 | 70 | ||
69 | /* | 71 | /* |
70 | * For fixed hardware buttons, we fabricate acpi_devices with HID | 72 | * For fixed hardware buttons, we fabricate acpi_devices with HID |
diff --git a/include/linux/circ_buf.h b/include/linux/circ_buf.h index a2ed0591fb19..90f2471dc6f2 100644 --- a/include/linux/circ_buf.h +++ b/include/linux/circ_buf.h | |||
@@ -1,3 +1,7 @@ | |||
1 | /* | ||
2 | * See Documentation/circular-buffers.txt for more information. | ||
3 | */ | ||
4 | |||
1 | #ifndef _LINUX_CIRC_BUF_H | 5 | #ifndef _LINUX_CIRC_BUF_H |
2 | #define _LINUX_CIRC_BUF_H 1 | 6 | #define _LINUX_CIRC_BUF_H 1 |
3 | 7 | ||
diff --git a/include/linux/if_tunnel.h b/include/linux/if_tunnel.h index 1822d635be6b..16b92d008bed 100644 --- a/include/linux/if_tunnel.h +++ b/include/linux/if_tunnel.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define _IF_TUNNEL_H_ | 2 | #define _IF_TUNNEL_H_ |
3 | 3 | ||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | #include <asm/byteorder.h> | ||
5 | 6 | ||
6 | #ifdef __KERNEL__ | 7 | #ifdef __KERNEL__ |
7 | #include <linux/ip.h> | 8 | #include <linux/ip.h> |
diff --git a/include/linux/kfifo.h b/include/linux/kfifo.h index bc0fc795bd35..ece0b1c33816 100644 --- a/include/linux/kfifo.h +++ b/include/linux/kfifo.h | |||
@@ -102,8 +102,6 @@ union { \ | |||
102 | unsigned char name##kfifo_buffer[size]; \ | 102 | unsigned char name##kfifo_buffer[size]; \ |
103 | struct kfifo name = __kfifo_initializer(size, name##kfifo_buffer) | 103 | struct kfifo name = __kfifo_initializer(size, name##kfifo_buffer) |
104 | 104 | ||
105 | #undef __kfifo_initializer | ||
106 | |||
107 | extern void kfifo_init(struct kfifo *fifo, void *buffer, | 105 | extern void kfifo_init(struct kfifo *fifo, void *buffer, |
108 | unsigned int size); | 106 | unsigned int size); |
109 | extern __must_check int kfifo_alloc(struct kfifo *fifo, unsigned int size, | 107 | extern __must_check int kfifo_alloc(struct kfifo *fifo, unsigned int size, |
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h index c02c8db73701..8a49cbf0376d 100644 --- a/include/linux/mmc/mmc.h +++ b/include/linux/mmc/mmc.h | |||
@@ -268,6 +268,7 @@ struct _mmc_csd { | |||
268 | 268 | ||
269 | #define EXT_CSD_CARD_TYPE_26 (1<<0) /* Card can run at 26MHz */ | 269 | #define EXT_CSD_CARD_TYPE_26 (1<<0) /* Card can run at 26MHz */ |
270 | #define EXT_CSD_CARD_TYPE_52 (1<<1) /* Card can run at 52MHz */ | 270 | #define EXT_CSD_CARD_TYPE_52 (1<<1) /* Card can run at 52MHz */ |
271 | #define EXT_CSD_CARD_TYPE_MASK 0x3 /* Mask out reserved and DDR bits */ | ||
271 | 272 | ||
272 | #define EXT_CSD_BUS_WIDTH_1 0 /* Card is in 1 bit mode */ | 273 | #define EXT_CSD_BUS_WIDTH_1 0 /* Card is in 1 bit mode */ |
273 | #define EXT_CSD_BUS_WIDTH_4 1 /* Card is in 4 bit mode */ | 274 | #define EXT_CSD_BUS_WIDTH_4 1 /* Card is in 4 bit mode */ |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index c79a88be7c33..fa8b47637997 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -2059,12 +2059,12 @@ static inline void skb_bond_set_mac_by_master(struct sk_buff *skb, | |||
2059 | * duplicates except for 802.3ad ETH_P_SLOW, alb non-mcast/bcast, and | 2059 | * duplicates except for 802.3ad ETH_P_SLOW, alb non-mcast/bcast, and |
2060 | * ARP on active-backup slaves with arp_validate enabled. | 2060 | * ARP on active-backup slaves with arp_validate enabled. |
2061 | */ | 2061 | */ |
2062 | static inline int skb_bond_should_drop(struct sk_buff *skb) | 2062 | static inline int skb_bond_should_drop(struct sk_buff *skb, |
2063 | struct net_device *master) | ||
2063 | { | 2064 | { |
2064 | struct net_device *dev = skb->dev; | ||
2065 | struct net_device *master = dev->master; | ||
2066 | |||
2067 | if (master) { | 2065 | if (master) { |
2066 | struct net_device *dev = skb->dev; | ||
2067 | |||
2068 | if (master->priv_flags & IFF_MASTER_ARPMON) | 2068 | if (master->priv_flags & IFF_MASTER_ARPMON) |
2069 | dev->last_rx = jiffies; | 2069 | dev->last_rx = jiffies; |
2070 | 2070 | ||
diff --git a/include/linux/netfilter/nfnetlink.h b/include/linux/netfilter/nfnetlink.h index 53923868c9bd..361d6b5630ee 100644 --- a/include/linux/netfilter/nfnetlink.h +++ b/include/linux/netfilter/nfnetlink.h | |||
@@ -76,7 +76,7 @@ extern int nfnetlink_subsys_unregister(const struct nfnetlink_subsystem *n); | |||
76 | extern int nfnetlink_has_listeners(struct net *net, unsigned int group); | 76 | extern int nfnetlink_has_listeners(struct net *net, unsigned int group); |
77 | extern int nfnetlink_send(struct sk_buff *skb, struct net *net, u32 pid, unsigned group, | 77 | extern int nfnetlink_send(struct sk_buff *skb, struct net *net, u32 pid, unsigned group, |
78 | int echo, gfp_t flags); | 78 | int echo, gfp_t flags); |
79 | extern void nfnetlink_set_err(struct net *net, u32 pid, u32 group, int error); | 79 | extern int nfnetlink_set_err(struct net *net, u32 pid, u32 group, int error); |
80 | extern int nfnetlink_unicast(struct sk_buff *skb, struct net *net, u_int32_t pid, int flags); | 80 | extern int nfnetlink_unicast(struct sk_buff *skb, struct net *net, u_int32_t pid, int flags); |
81 | 81 | ||
82 | extern void nfnl_lock(void); | 82 | extern void nfnl_lock(void); |
diff --git a/include/linux/netlink.h b/include/linux/netlink.h index fde27c017326..6eaca5e1e8ca 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h | |||
@@ -188,7 +188,7 @@ extern int netlink_has_listeners(struct sock *sk, unsigned int group); | |||
188 | extern int netlink_unicast(struct sock *ssk, struct sk_buff *skb, __u32 pid, int nonblock); | 188 | extern int netlink_unicast(struct sock *ssk, struct sk_buff *skb, __u32 pid, int nonblock); |
189 | extern int netlink_broadcast(struct sock *ssk, struct sk_buff *skb, __u32 pid, | 189 | extern int netlink_broadcast(struct sock *ssk, struct sk_buff *skb, __u32 pid, |
190 | __u32 group, gfp_t allocation); | 190 | __u32 group, gfp_t allocation); |
191 | extern void netlink_set_err(struct sock *ssk, __u32 pid, __u32 group, int code); | 191 | extern int netlink_set_err(struct sock *ssk, __u32 pid, __u32 group, int code); |
192 | extern int netlink_register_notifier(struct notifier_block *nb); | 192 | extern int netlink_register_notifier(struct notifier_block *nb); |
193 | extern int netlink_unregister_notifier(struct notifier_block *nb); | 193 | extern int netlink_unregister_notifier(struct notifier_block *nb); |
194 | 194 | ||
diff --git a/include/linux/reiserfs_xattr.h b/include/linux/reiserfs_xattr.h index 99928dce37ea..7fa02b4af838 100644 --- a/include/linux/reiserfs_xattr.h +++ b/include/linux/reiserfs_xattr.h | |||
@@ -70,6 +70,11 @@ int reiserfs_security_write(struct reiserfs_transaction_handle *th, | |||
70 | void reiserfs_security_free(struct reiserfs_security_handle *sec); | 70 | void reiserfs_security_free(struct reiserfs_security_handle *sec); |
71 | #endif | 71 | #endif |
72 | 72 | ||
73 | static inline int reiserfs_xattrs_initialized(struct super_block *sb) | ||
74 | { | ||
75 | return REISERFS_SB(sb)->priv_root != NULL; | ||
76 | } | ||
77 | |||
73 | #define xattr_size(size) ((size) + sizeof(struct reiserfs_xattr_header)) | 78 | #define xattr_size(size) ((size) + sizeof(struct reiserfs_xattr_header)) |
74 | static inline loff_t reiserfs_xattr_nblocks(struct inode *inode, loff_t size) | 79 | static inline loff_t reiserfs_xattr_nblocks(struct inode *inode, loff_t size) |
75 | { | 80 | { |
diff --git a/include/linux/sunrpc/bc_xprt.h b/include/linux/sunrpc/bc_xprt.h index d7152b451e21..7c91260c44a9 100644 --- a/include/linux/sunrpc/bc_xprt.h +++ b/include/linux/sunrpc/bc_xprt.h | |||
@@ -36,7 +36,6 @@ struct rpc_rqst *xprt_alloc_bc_request(struct rpc_xprt *xprt); | |||
36 | void xprt_free_bc_request(struct rpc_rqst *req); | 36 | void xprt_free_bc_request(struct rpc_rqst *req); |
37 | int xprt_setup_backchannel(struct rpc_xprt *, unsigned int min_reqs); | 37 | int xprt_setup_backchannel(struct rpc_xprt *, unsigned int min_reqs); |
38 | void xprt_destroy_backchannel(struct rpc_xprt *, int max_reqs); | 38 | void xprt_destroy_backchannel(struct rpc_xprt *, int max_reqs); |
39 | void bc_release_request(struct rpc_task *); | ||
40 | int bc_send(struct rpc_rqst *req); | 39 | int bc_send(struct rpc_rqst *req); |
41 | 40 | ||
42 | /* | 41 | /* |
@@ -59,6 +58,10 @@ static inline int svc_is_backchannel(const struct svc_rqst *rqstp) | |||
59 | { | 58 | { |
60 | return 0; | 59 | return 0; |
61 | } | 60 | } |
61 | |||
62 | static inline void xprt_free_bc_request(struct rpc_rqst *req) | ||
63 | { | ||
64 | } | ||
62 | #endif /* CONFIG_NFS_V4_1 */ | 65 | #endif /* CONFIG_NFS_V4_1 */ |
63 | #endif /* _LINUX_SUNRPC_BC_XPRT_H */ | 66 | #endif /* _LINUX_SUNRPC_BC_XPRT_H */ |
64 | 67 | ||
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index f994ae58a002..057929b0a651 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
@@ -688,7 +688,7 @@ asmlinkage long sys_shmat(int shmid, char __user *shmaddr, int shmflg); | |||
688 | asmlinkage long sys_shmget(key_t key, size_t size, int flag); | 688 | asmlinkage long sys_shmget(key_t key, size_t size, int flag); |
689 | asmlinkage long sys_shmdt(char __user *shmaddr); | 689 | asmlinkage long sys_shmdt(char __user *shmaddr); |
690 | asmlinkage long sys_shmctl(int shmid, int cmd, struct shmid_ds __user *buf); | 690 | asmlinkage long sys_shmctl(int shmid, int cmd, struct shmid_ds __user *buf); |
691 | asmlinkage long sys_ipc(unsigned int call, int first, int second, | 691 | asmlinkage long sys_ipc(unsigned int call, int first, unsigned long second, |
692 | unsigned long third, void __user *ptr, long fifth); | 692 | unsigned long third, void __user *ptr, long fifth); |
693 | 693 | ||
694 | asmlinkage long sys_mq_open(const char __user *name, int oflag, mode_t mode, struct mq_attr __user *attr); | 694 | asmlinkage long sys_mq_open(const char __user *name, int oflag, mode_t mode, struct mq_attr __user *attr); |
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h index 04a6908e38d2..ff77e8f882f1 100644 --- a/include/net/bluetooth/bluetooth.h +++ b/include/net/bluetooth/bluetooth.h | |||
@@ -176,6 +176,6 @@ extern void hci_sock_cleanup(void); | |||
176 | extern int bt_sysfs_init(void); | 176 | extern int bt_sysfs_init(void); |
177 | extern void bt_sysfs_cleanup(void); | 177 | extern void bt_sysfs_cleanup(void); |
178 | 178 | ||
179 | extern struct class *bt_class; | 179 | extern struct dentry *bt_debugfs; |
180 | 180 | ||
181 | #endif /* __BLUETOOTH_H */ | 181 | #endif /* __BLUETOOTH_H */ |
diff --git a/include/net/netlink.h b/include/net/netlink.h index f82e463c875a..4fc05b58503e 100644 --- a/include/net/netlink.h +++ b/include/net/netlink.h | |||
@@ -945,7 +945,11 @@ static inline u64 nla_get_u64(const struct nlattr *nla) | |||
945 | */ | 945 | */ |
946 | static inline __be64 nla_get_be64(const struct nlattr *nla) | 946 | static inline __be64 nla_get_be64(const struct nlattr *nla) |
947 | { | 947 | { |
948 | return *(__be64 *) nla_data(nla); | 948 | __be64 tmp; |
949 | |||
950 | nla_memcpy(&tmp, nla, sizeof(tmp)); | ||
951 | |||
952 | return tmp; | ||
949 | } | 953 | } |
950 | 954 | ||
951 | /** | 955 | /** |
diff --git a/init/main.c b/init/main.c index a1ab78ceb4b6..cbead27caefc 100644 --- a/init/main.c +++ b/init/main.c | |||
@@ -858,7 +858,7 @@ static int __init kernel_init(void * unused) | |||
858 | /* | 858 | /* |
859 | * init can allocate pages on any node | 859 | * init can allocate pages on any node |
860 | */ | 860 | */ |
861 | set_mems_allowed(node_possible_map); | 861 | set_mems_allowed(node_states[N_HIGH_MEMORY]); |
862 | /* | 862 | /* |
863 | * init can run on any cpu. | 863 | * init can run on any cpu. |
864 | */ | 864 | */ |
diff --git a/ipc/syscall.c b/ipc/syscall.c index 355a3da9ec73..1d6f53f6b562 100644 --- a/ipc/syscall.c +++ b/ipc/syscall.c | |||
@@ -13,7 +13,7 @@ | |||
13 | #include <linux/syscalls.h> | 13 | #include <linux/syscalls.h> |
14 | #include <linux/uaccess.h> | 14 | #include <linux/uaccess.h> |
15 | 15 | ||
16 | SYSCALL_DEFINE6(ipc, unsigned int, call, int, first, int, second, | 16 | SYSCALL_DEFINE6(ipc, unsigned int, call, int, first, unsigned long, second, |
17 | unsigned long, third, void __user *, ptr, long, fifth) | 17 | unsigned long, third, void __user *, ptr, long, fifth) |
18 | { | 18 | { |
19 | int version, ret; | 19 | int version, ret; |
diff --git a/kernel/cgroup.c b/kernel/cgroup.c index ef909a329750..e2769e13980c 100644 --- a/kernel/cgroup.c +++ b/kernel/cgroup.c | |||
@@ -27,7 +27,6 @@ | |||
27 | */ | 27 | */ |
28 | 28 | ||
29 | #include <linux/cgroup.h> | 29 | #include <linux/cgroup.h> |
30 | #include <linux/module.h> | ||
31 | #include <linux/ctype.h> | 30 | #include <linux/ctype.h> |
32 | #include <linux/errno.h> | 31 | #include <linux/errno.h> |
33 | #include <linux/fs.h> | 32 | #include <linux/fs.h> |
diff --git a/kernel/cpuset.c b/kernel/cpuset.c index ba401fab459f..d10946748ec2 100644 --- a/kernel/cpuset.c +++ b/kernel/cpuset.c | |||
@@ -920,9 +920,6 @@ static int update_cpumask(struct cpuset *cs, struct cpuset *trialcs, | |||
920 | * call to guarantee_online_mems(), as we know no one is changing | 920 | * call to guarantee_online_mems(), as we know no one is changing |
921 | * our task's cpuset. | 921 | * our task's cpuset. |
922 | * | 922 | * |
923 | * Hold callback_mutex around the two modifications of our tasks | ||
924 | * mems_allowed to synchronize with cpuset_mems_allowed(). | ||
925 | * | ||
926 | * While the mm_struct we are migrating is typically from some | 923 | * While the mm_struct we are migrating is typically from some |
927 | * other task, the task_struct mems_allowed that we are hacking | 924 | * other task, the task_struct mems_allowed that we are hacking |
928 | * is for our current task, which must allocate new pages for that | 925 | * is for our current task, which must allocate new pages for that |
@@ -973,15 +970,20 @@ static void cpuset_change_nodemask(struct task_struct *p, | |||
973 | struct cpuset *cs; | 970 | struct cpuset *cs; |
974 | int migrate; | 971 | int migrate; |
975 | const nodemask_t *oldmem = scan->data; | 972 | const nodemask_t *oldmem = scan->data; |
976 | nodemask_t newmems; | 973 | NODEMASK_ALLOC(nodemask_t, newmems, GFP_KERNEL); |
974 | |||
975 | if (!newmems) | ||
976 | return; | ||
977 | 977 | ||
978 | cs = cgroup_cs(scan->cg); | 978 | cs = cgroup_cs(scan->cg); |
979 | guarantee_online_mems(cs, &newmems); | 979 | guarantee_online_mems(cs, newmems); |
980 | 980 | ||
981 | task_lock(p); | 981 | task_lock(p); |
982 | cpuset_change_task_nodemask(p, &newmems); | 982 | cpuset_change_task_nodemask(p, newmems); |
983 | task_unlock(p); | 983 | task_unlock(p); |
984 | 984 | ||
985 | NODEMASK_FREE(newmems); | ||
986 | |||
985 | mm = get_task_mm(p); | 987 | mm = get_task_mm(p); |
986 | if (!mm) | 988 | if (!mm) |
987 | return; | 989 | return; |
@@ -1051,16 +1053,21 @@ static void update_tasks_nodemask(struct cpuset *cs, const nodemask_t *oldmem, | |||
1051 | static int update_nodemask(struct cpuset *cs, struct cpuset *trialcs, | 1053 | static int update_nodemask(struct cpuset *cs, struct cpuset *trialcs, |
1052 | const char *buf) | 1054 | const char *buf) |
1053 | { | 1055 | { |
1054 | nodemask_t oldmem; | 1056 | NODEMASK_ALLOC(nodemask_t, oldmem, GFP_KERNEL); |
1055 | int retval; | 1057 | int retval; |
1056 | struct ptr_heap heap; | 1058 | struct ptr_heap heap; |
1057 | 1059 | ||
1060 | if (!oldmem) | ||
1061 | return -ENOMEM; | ||
1062 | |||
1058 | /* | 1063 | /* |
1059 | * top_cpuset.mems_allowed tracks node_stats[N_HIGH_MEMORY]; | 1064 | * top_cpuset.mems_allowed tracks node_stats[N_HIGH_MEMORY]; |
1060 | * it's read-only | 1065 | * it's read-only |
1061 | */ | 1066 | */ |
1062 | if (cs == &top_cpuset) | 1067 | if (cs == &top_cpuset) { |
1063 | return -EACCES; | 1068 | retval = -EACCES; |
1069 | goto done; | ||
1070 | } | ||
1064 | 1071 | ||
1065 | /* | 1072 | /* |
1066 | * An empty mems_allowed is ok iff there are no tasks in the cpuset. | 1073 | * An empty mems_allowed is ok iff there are no tasks in the cpuset. |
@@ -1076,11 +1083,13 @@ static int update_nodemask(struct cpuset *cs, struct cpuset *trialcs, | |||
1076 | goto done; | 1083 | goto done; |
1077 | 1084 | ||
1078 | if (!nodes_subset(trialcs->mems_allowed, | 1085 | if (!nodes_subset(trialcs->mems_allowed, |
1079 | node_states[N_HIGH_MEMORY])) | 1086 | node_states[N_HIGH_MEMORY])) { |
1080 | return -EINVAL; | 1087 | retval = -EINVAL; |
1088 | goto done; | ||
1089 | } | ||
1081 | } | 1090 | } |
1082 | oldmem = cs->mems_allowed; | 1091 | *oldmem = cs->mems_allowed; |
1083 | if (nodes_equal(oldmem, trialcs->mems_allowed)) { | 1092 | if (nodes_equal(*oldmem, trialcs->mems_allowed)) { |
1084 | retval = 0; /* Too easy - nothing to do */ | 1093 | retval = 0; /* Too easy - nothing to do */ |
1085 | goto done; | 1094 | goto done; |
1086 | } | 1095 | } |
@@ -1096,10 +1105,11 @@ static int update_nodemask(struct cpuset *cs, struct cpuset *trialcs, | |||
1096 | cs->mems_allowed = trialcs->mems_allowed; | 1105 | cs->mems_allowed = trialcs->mems_allowed; |
1097 | mutex_unlock(&callback_mutex); | 1106 | mutex_unlock(&callback_mutex); |
1098 | 1107 | ||
1099 | update_tasks_nodemask(cs, &oldmem, &heap); | 1108 | update_tasks_nodemask(cs, oldmem, &heap); |
1100 | 1109 | ||
1101 | heap_free(&heap); | 1110 | heap_free(&heap); |
1102 | done: | 1111 | done: |
1112 | NODEMASK_FREE(oldmem); | ||
1103 | return retval; | 1113 | return retval; |
1104 | } | 1114 | } |
1105 | 1115 | ||
@@ -1384,40 +1394,47 @@ static void cpuset_attach(struct cgroup_subsys *ss, struct cgroup *cont, | |||
1384 | struct cgroup *oldcont, struct task_struct *tsk, | 1394 | struct cgroup *oldcont, struct task_struct *tsk, |
1385 | bool threadgroup) | 1395 | bool threadgroup) |
1386 | { | 1396 | { |
1387 | nodemask_t from, to; | ||
1388 | struct mm_struct *mm; | 1397 | struct mm_struct *mm; |
1389 | struct cpuset *cs = cgroup_cs(cont); | 1398 | struct cpuset *cs = cgroup_cs(cont); |
1390 | struct cpuset *oldcs = cgroup_cs(oldcont); | 1399 | struct cpuset *oldcs = cgroup_cs(oldcont); |
1400 | NODEMASK_ALLOC(nodemask_t, from, GFP_KERNEL); | ||
1401 | NODEMASK_ALLOC(nodemask_t, to, GFP_KERNEL); | ||
1402 | |||
1403 | if (from == NULL || to == NULL) | ||
1404 | goto alloc_fail; | ||
1391 | 1405 | ||
1392 | if (cs == &top_cpuset) { | 1406 | if (cs == &top_cpuset) { |
1393 | cpumask_copy(cpus_attach, cpu_possible_mask); | 1407 | cpumask_copy(cpus_attach, cpu_possible_mask); |
1394 | to = node_possible_map; | ||
1395 | } else { | 1408 | } else { |
1396 | guarantee_online_cpus(cs, cpus_attach); | 1409 | guarantee_online_cpus(cs, cpus_attach); |
1397 | guarantee_online_mems(cs, &to); | ||
1398 | } | 1410 | } |
1411 | guarantee_online_mems(cs, to); | ||
1399 | 1412 | ||
1400 | /* do per-task migration stuff possibly for each in the threadgroup */ | 1413 | /* do per-task migration stuff possibly for each in the threadgroup */ |
1401 | cpuset_attach_task(tsk, &to, cs); | 1414 | cpuset_attach_task(tsk, to, cs); |
1402 | if (threadgroup) { | 1415 | if (threadgroup) { |
1403 | struct task_struct *c; | 1416 | struct task_struct *c; |
1404 | rcu_read_lock(); | 1417 | rcu_read_lock(); |
1405 | list_for_each_entry_rcu(c, &tsk->thread_group, thread_group) { | 1418 | list_for_each_entry_rcu(c, &tsk->thread_group, thread_group) { |
1406 | cpuset_attach_task(c, &to, cs); | 1419 | cpuset_attach_task(c, to, cs); |
1407 | } | 1420 | } |
1408 | rcu_read_unlock(); | 1421 | rcu_read_unlock(); |
1409 | } | 1422 | } |
1410 | 1423 | ||
1411 | /* change mm; only needs to be done once even if threadgroup */ | 1424 | /* change mm; only needs to be done once even if threadgroup */ |
1412 | from = oldcs->mems_allowed; | 1425 | *from = oldcs->mems_allowed; |
1413 | to = cs->mems_allowed; | 1426 | *to = cs->mems_allowed; |
1414 | mm = get_task_mm(tsk); | 1427 | mm = get_task_mm(tsk); |
1415 | if (mm) { | 1428 | if (mm) { |
1416 | mpol_rebind_mm(mm, &to); | 1429 | mpol_rebind_mm(mm, to); |
1417 | if (is_memory_migrate(cs)) | 1430 | if (is_memory_migrate(cs)) |
1418 | cpuset_migrate_mm(mm, &from, &to); | 1431 | cpuset_migrate_mm(mm, from, to); |
1419 | mmput(mm); | 1432 | mmput(mm); |
1420 | } | 1433 | } |
1434 | |||
1435 | alloc_fail: | ||
1436 | NODEMASK_FREE(from); | ||
1437 | NODEMASK_FREE(to); | ||
1421 | } | 1438 | } |
1422 | 1439 | ||
1423 | /* The various types of files and directories in a cpuset file system */ | 1440 | /* The various types of files and directories in a cpuset file system */ |
@@ -1562,13 +1579,21 @@ static int cpuset_sprintf_cpulist(char *page, struct cpuset *cs) | |||
1562 | 1579 | ||
1563 | static int cpuset_sprintf_memlist(char *page, struct cpuset *cs) | 1580 | static int cpuset_sprintf_memlist(char *page, struct cpuset *cs) |
1564 | { | 1581 | { |
1565 | nodemask_t mask; | 1582 | NODEMASK_ALLOC(nodemask_t, mask, GFP_KERNEL); |
1583 | int retval; | ||
1584 | |||
1585 | if (mask == NULL) | ||
1586 | return -ENOMEM; | ||
1566 | 1587 | ||
1567 | mutex_lock(&callback_mutex); | 1588 | mutex_lock(&callback_mutex); |
1568 | mask = cs->mems_allowed; | 1589 | *mask = cs->mems_allowed; |
1569 | mutex_unlock(&callback_mutex); | 1590 | mutex_unlock(&callback_mutex); |
1570 | 1591 | ||
1571 | return nodelist_scnprintf(page, PAGE_SIZE, mask); | 1592 | retval = nodelist_scnprintf(page, PAGE_SIZE, *mask); |
1593 | |||
1594 | NODEMASK_FREE(mask); | ||
1595 | |||
1596 | return retval; | ||
1572 | } | 1597 | } |
1573 | 1598 | ||
1574 | static ssize_t cpuset_common_file_read(struct cgroup *cont, | 1599 | static ssize_t cpuset_common_file_read(struct cgroup *cont, |
@@ -1997,7 +2022,10 @@ static void scan_for_empty_cpusets(struct cpuset *root) | |||
1997 | struct cpuset *cp; /* scans cpusets being updated */ | 2022 | struct cpuset *cp; /* scans cpusets being updated */ |
1998 | struct cpuset *child; /* scans child cpusets of cp */ | 2023 | struct cpuset *child; /* scans child cpusets of cp */ |
1999 | struct cgroup *cont; | 2024 | struct cgroup *cont; |
2000 | nodemask_t oldmems; | 2025 | NODEMASK_ALLOC(nodemask_t, oldmems, GFP_KERNEL); |
2026 | |||
2027 | if (oldmems == NULL) | ||
2028 | return; | ||
2001 | 2029 | ||
2002 | list_add_tail((struct list_head *)&root->stack_list, &queue); | 2030 | list_add_tail((struct list_head *)&root->stack_list, &queue); |
2003 | 2031 | ||
@@ -2014,7 +2042,7 @@ static void scan_for_empty_cpusets(struct cpuset *root) | |||
2014 | nodes_subset(cp->mems_allowed, node_states[N_HIGH_MEMORY])) | 2042 | nodes_subset(cp->mems_allowed, node_states[N_HIGH_MEMORY])) |
2015 | continue; | 2043 | continue; |
2016 | 2044 | ||
2017 | oldmems = cp->mems_allowed; | 2045 | *oldmems = cp->mems_allowed; |
2018 | 2046 | ||
2019 | /* Remove offline cpus and mems from this cpuset. */ | 2047 | /* Remove offline cpus and mems from this cpuset. */ |
2020 | mutex_lock(&callback_mutex); | 2048 | mutex_lock(&callback_mutex); |
@@ -2030,9 +2058,10 @@ static void scan_for_empty_cpusets(struct cpuset *root) | |||
2030 | remove_tasks_in_empty_cpuset(cp); | 2058 | remove_tasks_in_empty_cpuset(cp); |
2031 | else { | 2059 | else { |
2032 | update_tasks_cpumask(cp, NULL); | 2060 | update_tasks_cpumask(cp, NULL); |
2033 | update_tasks_nodemask(cp, &oldmems, NULL); | 2061 | update_tasks_nodemask(cp, oldmems, NULL); |
2034 | } | 2062 | } |
2035 | } | 2063 | } |
2064 | NODEMASK_FREE(oldmems); | ||
2036 | } | 2065 | } |
2037 | 2066 | ||
2038 | /* | 2067 | /* |
@@ -2090,20 +2119,33 @@ static int cpuset_track_online_cpus(struct notifier_block *unused_nb, | |||
2090 | static int cpuset_track_online_nodes(struct notifier_block *self, | 2119 | static int cpuset_track_online_nodes(struct notifier_block *self, |
2091 | unsigned long action, void *arg) | 2120 | unsigned long action, void *arg) |
2092 | { | 2121 | { |
2122 | NODEMASK_ALLOC(nodemask_t, oldmems, GFP_KERNEL); | ||
2123 | |||
2124 | if (oldmems == NULL) | ||
2125 | return NOTIFY_DONE; | ||
2126 | |||
2093 | cgroup_lock(); | 2127 | cgroup_lock(); |
2094 | switch (action) { | 2128 | switch (action) { |
2095 | case MEM_ONLINE: | 2129 | case MEM_ONLINE: |
2096 | case MEM_OFFLINE: | 2130 | *oldmems = top_cpuset.mems_allowed; |
2097 | mutex_lock(&callback_mutex); | 2131 | mutex_lock(&callback_mutex); |
2098 | top_cpuset.mems_allowed = node_states[N_HIGH_MEMORY]; | 2132 | top_cpuset.mems_allowed = node_states[N_HIGH_MEMORY]; |
2099 | mutex_unlock(&callback_mutex); | 2133 | mutex_unlock(&callback_mutex); |
2100 | if (action == MEM_OFFLINE) | 2134 | update_tasks_nodemask(&top_cpuset, oldmems, NULL); |
2101 | scan_for_empty_cpusets(&top_cpuset); | 2135 | break; |
2136 | case MEM_OFFLINE: | ||
2137 | /* | ||
2138 | * needn't update top_cpuset.mems_allowed explicitly because | ||
2139 | * scan_for_empty_cpusets() will update it. | ||
2140 | */ | ||
2141 | scan_for_empty_cpusets(&top_cpuset); | ||
2102 | break; | 2142 | break; |
2103 | default: | 2143 | default: |
2104 | break; | 2144 | break; |
2105 | } | 2145 | } |
2106 | cgroup_unlock(); | 2146 | cgroup_unlock(); |
2147 | |||
2148 | NODEMASK_FREE(oldmems); | ||
2107 | return NOTIFY_OK; | 2149 | return NOTIFY_OK; |
2108 | } | 2150 | } |
2109 | #endif | 2151 | #endif |
diff --git a/kernel/kthread.c b/kernel/kthread.c index 82ed0ea15194..83911c780175 100644 --- a/kernel/kthread.c +++ b/kernel/kthread.c | |||
@@ -219,7 +219,7 @@ int kthreadd(void *unused) | |||
219 | set_task_comm(tsk, "kthreadd"); | 219 | set_task_comm(tsk, "kthreadd"); |
220 | ignore_signals(tsk); | 220 | ignore_signals(tsk); |
221 | set_cpus_allowed_ptr(tsk, cpu_all_mask); | 221 | set_cpus_allowed_ptr(tsk, cpu_all_mask); |
222 | set_mems_allowed(node_possible_map); | 222 | set_mems_allowed(node_states[N_HIGH_MEMORY]); |
223 | 223 | ||
224 | current->flags |= PF_NOFREEZE | PF_FREEZER_NOSIG; | 224 | current->flags |= PF_NOFREEZE | PF_FREEZER_NOSIG; |
225 | 225 | ||
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 8e5ec5e1ab91..1fafb4b99c9b 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug | |||
@@ -103,7 +103,8 @@ config HEADERS_CHECK | |||
103 | 103 | ||
104 | config DEBUG_SECTION_MISMATCH | 104 | config DEBUG_SECTION_MISMATCH |
105 | bool "Enable full Section mismatch analysis" | 105 | bool "Enable full Section mismatch analysis" |
106 | depends on UNDEFINED | 106 | depends on UNDEFINED || (BLACKFIN) |
107 | default y | ||
107 | # This option is on purpose disabled for now. | 108 | # This option is on purpose disabled for now. |
108 | # It will be enabled when we are down to a reasonable number | 109 | # It will be enabled when we are down to a reasonable number |
109 | # of section mismatch warnings (< 10 for an allyesconfig build) | 110 | # of section mismatch warnings (< 10 for an allyesconfig build) |
@@ -751,7 +751,7 @@ static int write_protect_page(struct vm_area_struct *vma, struct page *page, | |||
751 | * page | 751 | * page |
752 | */ | 752 | */ |
753 | if (page_mapcount(page) + 1 + swapped != page_count(page)) { | 753 | if (page_mapcount(page) + 1 + swapped != page_count(page)) { |
754 | set_pte_at_notify(mm, addr, ptep, entry); | 754 | set_pte_at(mm, addr, ptep, entry); |
755 | goto out_unlock; | 755 | goto out_unlock; |
756 | } | 756 | } |
757 | entry = pte_wrprotect(entry); | 757 | entry = pte_wrprotect(entry); |
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 7973b5221fb8..9ed760dc7448 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c | |||
@@ -3691,8 +3691,10 @@ static struct mem_cgroup *mem_cgroup_alloc(void) | |||
3691 | else | 3691 | else |
3692 | mem = vmalloc(size); | 3692 | mem = vmalloc(size); |
3693 | 3693 | ||
3694 | if (mem) | 3694 | if (!mem) |
3695 | memset(mem, 0, size); | 3695 | return NULL; |
3696 | |||
3697 | memset(mem, 0, size); | ||
3696 | mem->stat = alloc_percpu(struct mem_cgroup_stat_cpu); | 3698 | mem->stat = alloc_percpu(struct mem_cgroup_stat_cpu); |
3697 | if (!mem->stat) { | 3699 | if (!mem->stat) { |
3698 | if (size < PAGE_SIZE) | 3700 | if (size < PAGE_SIZE) |
@@ -3946,28 +3948,6 @@ one_by_one: | |||
3946 | } | 3948 | } |
3947 | return ret; | 3949 | return ret; |
3948 | } | 3950 | } |
3949 | #else /* !CONFIG_MMU */ | ||
3950 | static int mem_cgroup_can_attach(struct cgroup_subsys *ss, | ||
3951 | struct cgroup *cgroup, | ||
3952 | struct task_struct *p, | ||
3953 | bool threadgroup) | ||
3954 | { | ||
3955 | return 0; | ||
3956 | } | ||
3957 | static void mem_cgroup_cancel_attach(struct cgroup_subsys *ss, | ||
3958 | struct cgroup *cgroup, | ||
3959 | struct task_struct *p, | ||
3960 | bool threadgroup) | ||
3961 | { | ||
3962 | } | ||
3963 | static void mem_cgroup_move_task(struct cgroup_subsys *ss, | ||
3964 | struct cgroup *cont, | ||
3965 | struct cgroup *old_cont, | ||
3966 | struct task_struct *p, | ||
3967 | bool threadgroup) | ||
3968 | { | ||
3969 | } | ||
3970 | #endif | ||
3971 | 3951 | ||
3972 | /** | 3952 | /** |
3973 | * is_target_pte_for_mc - check a pte whether it is valid for move charge | 3953 | * is_target_pte_for_mc - check a pte whether it is valid for move charge |
@@ -4330,6 +4310,28 @@ static void mem_cgroup_move_task(struct cgroup_subsys *ss, | |||
4330 | } | 4310 | } |
4331 | mem_cgroup_clear_mc(); | 4311 | mem_cgroup_clear_mc(); |
4332 | } | 4312 | } |
4313 | #else /* !CONFIG_MMU */ | ||
4314 | static int mem_cgroup_can_attach(struct cgroup_subsys *ss, | ||
4315 | struct cgroup *cgroup, | ||
4316 | struct task_struct *p, | ||
4317 | bool threadgroup) | ||
4318 | { | ||
4319 | return 0; | ||
4320 | } | ||
4321 | static void mem_cgroup_cancel_attach(struct cgroup_subsys *ss, | ||
4322 | struct cgroup *cgroup, | ||
4323 | struct task_struct *p, | ||
4324 | bool threadgroup) | ||
4325 | { | ||
4326 | } | ||
4327 | static void mem_cgroup_move_task(struct cgroup_subsys *ss, | ||
4328 | struct cgroup *cont, | ||
4329 | struct cgroup *old_cont, | ||
4330 | struct task_struct *p, | ||
4331 | bool threadgroup) | ||
4332 | { | ||
4333 | } | ||
4334 | #endif | ||
4333 | 4335 | ||
4334 | struct cgroup_subsys mem_cgroup_subsys = { | 4336 | struct cgroup_subsys mem_cgroup_subsys = { |
4335 | .name = "memory", | 4337 | .name = "memory", |
diff --git a/mm/memory.c b/mm/memory.c index 5b7f2002e54b..bc9ba5a1f5b9 100644 --- a/mm/memory.c +++ b/mm/memory.c | |||
@@ -130,6 +130,7 @@ void __sync_task_rss_stat(struct task_struct *task, struct mm_struct *mm) | |||
130 | 130 | ||
131 | for (i = 0; i < NR_MM_COUNTERS; i++) { | 131 | for (i = 0; i < NR_MM_COUNTERS; i++) { |
132 | if (task->rss_stat.count[i]) { | 132 | if (task->rss_stat.count[i]) { |
133 | BUG_ON(!mm); | ||
133 | add_mm_counter(mm, i, task->rss_stat.count[i]); | 134 | add_mm_counter(mm, i, task->rss_stat.count[i]); |
134 | task->rss_stat.count[i] = 0; | 135 | task->rss_stat.count[i] = 0; |
135 | } | 136 | } |
diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 643f66e10187..8034abd3a135 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c | |||
@@ -806,9 +806,13 @@ static long do_get_mempolicy(int *policy, nodemask_t *nmask, | |||
806 | 806 | ||
807 | err = 0; | 807 | err = 0; |
808 | if (nmask) { | 808 | if (nmask) { |
809 | task_lock(current); | 809 | if (mpol_store_user_nodemask(pol)) { |
810 | get_policy_nodemask(pol, nmask); | 810 | *nmask = pol->w.user_nodemask; |
811 | task_unlock(current); | 811 | } else { |
812 | task_lock(current); | ||
813 | get_policy_nodemask(pol, nmask); | ||
814 | task_unlock(current); | ||
815 | } | ||
812 | } | 816 | } |
813 | 817 | ||
814 | out: | 818 | out: |
@@ -2195,8 +2199,8 @@ int mpol_parse_str(char *str, struct mempolicy **mpol, int no_context) | |||
2195 | char *rest = nodelist; | 2199 | char *rest = nodelist; |
2196 | while (isdigit(*rest)) | 2200 | while (isdigit(*rest)) |
2197 | rest++; | 2201 | rest++; |
2198 | if (!*rest) | 2202 | if (*rest) |
2199 | err = 0; | 2203 | goto out; |
2200 | } | 2204 | } |
2201 | break; | 2205 | break; |
2202 | case MPOL_INTERLEAVE: | 2206 | case MPOL_INTERLEAVE: |
@@ -2205,7 +2209,6 @@ int mpol_parse_str(char *str, struct mempolicy **mpol, int no_context) | |||
2205 | */ | 2209 | */ |
2206 | if (!nodelist) | 2210 | if (!nodelist) |
2207 | nodes = node_states[N_HIGH_MEMORY]; | 2211 | nodes = node_states[N_HIGH_MEMORY]; |
2208 | err = 0; | ||
2209 | break; | 2212 | break; |
2210 | case MPOL_LOCAL: | 2213 | case MPOL_LOCAL: |
2211 | /* | 2214 | /* |
@@ -2215,11 +2218,19 @@ int mpol_parse_str(char *str, struct mempolicy **mpol, int no_context) | |||
2215 | goto out; | 2218 | goto out; |
2216 | mode = MPOL_PREFERRED; | 2219 | mode = MPOL_PREFERRED; |
2217 | break; | 2220 | break; |
2218 | 2221 | case MPOL_DEFAULT: | |
2219 | /* | 2222 | /* |
2220 | * case MPOL_BIND: mpol_new() enforces non-empty nodemask. | 2223 | * Insist on a empty nodelist |
2221 | * case MPOL_DEFAULT: mpol_new() enforces empty nodemask, ignores flags. | 2224 | */ |
2222 | */ | 2225 | if (!nodelist) |
2226 | err = 0; | ||
2227 | goto out; | ||
2228 | case MPOL_BIND: | ||
2229 | /* | ||
2230 | * Insist on a nodelist | ||
2231 | */ | ||
2232 | if (!nodelist) | ||
2233 | goto out; | ||
2223 | } | 2234 | } |
2224 | 2235 | ||
2225 | mode_flags = 0; | 2236 | mode_flags = 0; |
@@ -2233,13 +2244,14 @@ int mpol_parse_str(char *str, struct mempolicy **mpol, int no_context) | |||
2233 | else if (!strcmp(flags, "relative")) | 2244 | else if (!strcmp(flags, "relative")) |
2234 | mode_flags |= MPOL_F_RELATIVE_NODES; | 2245 | mode_flags |= MPOL_F_RELATIVE_NODES; |
2235 | else | 2246 | else |
2236 | err = 1; | 2247 | goto out; |
2237 | } | 2248 | } |
2238 | 2249 | ||
2239 | new = mpol_new(mode, mode_flags, &nodes); | 2250 | new = mpol_new(mode, mode_flags, &nodes); |
2240 | if (IS_ERR(new)) | 2251 | if (IS_ERR(new)) |
2241 | err = 1; | 2252 | goto out; |
2242 | else { | 2253 | |
2254 | { | ||
2243 | int ret; | 2255 | int ret; |
2244 | NODEMASK_SCRATCH(scratch); | 2256 | NODEMASK_SCRATCH(scratch); |
2245 | if (scratch) { | 2257 | if (scratch) { |
@@ -2250,13 +2262,15 @@ int mpol_parse_str(char *str, struct mempolicy **mpol, int no_context) | |||
2250 | ret = -ENOMEM; | 2262 | ret = -ENOMEM; |
2251 | NODEMASK_SCRATCH_FREE(scratch); | 2263 | NODEMASK_SCRATCH_FREE(scratch); |
2252 | if (ret) { | 2264 | if (ret) { |
2253 | err = 1; | ||
2254 | mpol_put(new); | 2265 | mpol_put(new); |
2255 | } else if (no_context) { | 2266 | goto out; |
2256 | /* save for contextualization */ | ||
2257 | new->w.user_nodemask = nodes; | ||
2258 | } | 2267 | } |
2259 | } | 2268 | } |
2269 | err = 0; | ||
2270 | if (no_context) { | ||
2271 | /* save for contextualization */ | ||
2272 | new->w.user_nodemask = nodes; | ||
2273 | } | ||
2260 | 2274 | ||
2261 | out: | 2275 | out: |
2262 | /* Restore string for error message */ | 2276 | /* Restore string for error message */ |
diff --git a/mm/mmu_context.c b/mm/mmu_context.c index 0777654147c9..9e82e937000e 100644 --- a/mm/mmu_context.c +++ b/mm/mmu_context.c | |||
@@ -53,6 +53,7 @@ void unuse_mm(struct mm_struct *mm) | |||
53 | struct task_struct *tsk = current; | 53 | struct task_struct *tsk = current; |
54 | 54 | ||
55 | task_lock(tsk); | 55 | task_lock(tsk); |
56 | sync_mm_rss(tsk, mm); | ||
56 | tsk->mm = NULL; | 57 | tsk->mm = NULL; |
57 | /* active_mm is still 'mm' */ | 58 | /* active_mm is still 'mm' */ |
58 | enter_lazy_tlb(mm, tsk); | 59 | enter_lazy_tlb(mm, tsk); |
diff --git a/mm/nommu.c b/mm/nommu.c index 605ace8982a8..e4b8f4d28a3f 100644 --- a/mm/nommu.c +++ b/mm/nommu.c | |||
@@ -1040,10 +1040,9 @@ static int do_mmap_shared_file(struct vm_area_struct *vma) | |||
1040 | if (ret != -ENOSYS) | 1040 | if (ret != -ENOSYS) |
1041 | return ret; | 1041 | return ret; |
1042 | 1042 | ||
1043 | /* getting an ENOSYS error indicates that direct mmap isn't | 1043 | /* getting -ENOSYS indicates that direct mmap isn't possible (as |
1044 | * possible (as opposed to tried but failed) so we'll fall | 1044 | * opposed to tried but failed) so we can only give a suitable error as |
1045 | * through to making a private copy of the data and mapping | 1045 | * it's not possible to make a private copy if MAP_SHARED was given */ |
1046 | * that if we can */ | ||
1047 | return -ENODEV; | 1046 | return -ENODEV; |
1048 | } | 1047 | } |
1049 | 1048 | ||
diff --git a/net/8021q/vlan_core.c b/net/8021q/vlan_core.c index c0316e0ca6e8..c584a0af77d3 100644 --- a/net/8021q/vlan_core.c +++ b/net/8021q/vlan_core.c | |||
@@ -11,7 +11,7 @@ int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp, | |||
11 | if (netpoll_rx(skb)) | 11 | if (netpoll_rx(skb)) |
12 | return NET_RX_DROP; | 12 | return NET_RX_DROP; |
13 | 13 | ||
14 | if (skb_bond_should_drop(skb)) | 14 | if (skb_bond_should_drop(skb, ACCESS_ONCE(skb->dev->master))) |
15 | goto drop; | 15 | goto drop; |
16 | 16 | ||
17 | skb->skb_iif = skb->dev->ifindex; | 17 | skb->skb_iif = skb->dev->ifindex; |
@@ -83,7 +83,7 @@ vlan_gro_common(struct napi_struct *napi, struct vlan_group *grp, | |||
83 | { | 83 | { |
84 | struct sk_buff *p; | 84 | struct sk_buff *p; |
85 | 85 | ||
86 | if (skb_bond_should_drop(skb)) | 86 | if (skb_bond_should_drop(skb, ACCESS_ONCE(skb->dev->master))) |
87 | goto drop; | 87 | goto drop; |
88 | 88 | ||
89 | skb->skb_iif = skb->dev->ifindex; | 89 | skb->skb_iif = skb->dev->ifindex; |
diff --git a/net/bluetooth/hci_sysfs.c b/net/bluetooth/hci_sysfs.c index cafb55b0cea5..05fd125f74fe 100644 --- a/net/bluetooth/hci_sysfs.c +++ b/net/bluetooth/hci_sysfs.c | |||
@@ -8,8 +8,7 @@ | |||
8 | #include <net/bluetooth/bluetooth.h> | 8 | #include <net/bluetooth/bluetooth.h> |
9 | #include <net/bluetooth/hci_core.h> | 9 | #include <net/bluetooth/hci_core.h> |
10 | 10 | ||
11 | struct class *bt_class = NULL; | 11 | static struct class *bt_class; |
12 | EXPORT_SYMBOL_GPL(bt_class); | ||
13 | 12 | ||
14 | struct dentry *bt_debugfs = NULL; | 13 | struct dentry *bt_debugfs = NULL; |
15 | EXPORT_SYMBOL_GPL(bt_debugfs); | 14 | EXPORT_SYMBOL_GPL(bt_debugfs); |
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c index 4db7ae2fe07d..7794a2e2adce 100644 --- a/net/bluetooth/l2cap.c +++ b/net/bluetooth/l2cap.c | |||
@@ -40,6 +40,8 @@ | |||
40 | #include <linux/skbuff.h> | 40 | #include <linux/skbuff.h> |
41 | #include <linux/list.h> | 41 | #include <linux/list.h> |
42 | #include <linux/device.h> | 42 | #include <linux/device.h> |
43 | #include <linux/debugfs.h> | ||
44 | #include <linux/seq_file.h> | ||
43 | #include <linux/uaccess.h> | 45 | #include <linux/uaccess.h> |
44 | #include <linux/crc16.h> | 46 | #include <linux/crc16.h> |
45 | #include <net/sock.h> | 47 | #include <net/sock.h> |
@@ -2830,6 +2832,11 @@ static inline int l2cap_config_rsp(struct l2cap_conn *conn, struct l2cap_cmd_hdr | |||
2830 | int len = cmd->len - sizeof(*rsp); | 2832 | int len = cmd->len - sizeof(*rsp); |
2831 | char req[64]; | 2833 | char req[64]; |
2832 | 2834 | ||
2835 | if (len > sizeof(req) - sizeof(struct l2cap_conf_req)) { | ||
2836 | l2cap_send_disconn_req(conn, sk); | ||
2837 | goto done; | ||
2838 | } | ||
2839 | |||
2833 | /* throw out any old stored conf requests */ | 2840 | /* throw out any old stored conf requests */ |
2834 | result = L2CAP_CONF_SUCCESS; | 2841 | result = L2CAP_CONF_SUCCESS; |
2835 | len = l2cap_parse_conf_rsp(sk, rsp->data, | 2842 | len = l2cap_parse_conf_rsp(sk, rsp->data, |
@@ -3937,31 +3944,42 @@ drop: | |||
3937 | return 0; | 3944 | return 0; |
3938 | } | 3945 | } |
3939 | 3946 | ||
3940 | static ssize_t l2cap_sysfs_show(struct class *dev, | 3947 | static int l2cap_debugfs_show(struct seq_file *f, void *p) |
3941 | struct class_attribute *attr, | ||
3942 | char *buf) | ||
3943 | { | 3948 | { |
3944 | struct sock *sk; | 3949 | struct sock *sk; |
3945 | struct hlist_node *node; | 3950 | struct hlist_node *node; |
3946 | char *str = buf; | ||
3947 | 3951 | ||
3948 | read_lock_bh(&l2cap_sk_list.lock); | 3952 | read_lock_bh(&l2cap_sk_list.lock); |
3949 | 3953 | ||
3950 | sk_for_each(sk, node, &l2cap_sk_list.head) { | 3954 | sk_for_each(sk, node, &l2cap_sk_list.head) { |
3951 | struct l2cap_pinfo *pi = l2cap_pi(sk); | 3955 | struct l2cap_pinfo *pi = l2cap_pi(sk); |
3952 | 3956 | ||
3953 | str += sprintf(str, "%s %s %d %d 0x%4.4x 0x%4.4x %d %d %d\n", | 3957 | seq_printf(f, "%s %s %d %d 0x%4.4x 0x%4.4x %d %d %d\n", |
3954 | batostr(&bt_sk(sk)->src), batostr(&bt_sk(sk)->dst), | 3958 | batostr(&bt_sk(sk)->src), |
3955 | sk->sk_state, __le16_to_cpu(pi->psm), pi->scid, | 3959 | batostr(&bt_sk(sk)->dst), |
3956 | pi->dcid, pi->imtu, pi->omtu, pi->sec_level); | 3960 | sk->sk_state, __le16_to_cpu(pi->psm), |
3961 | pi->scid, pi->dcid, | ||
3962 | pi->imtu, pi->omtu, pi->sec_level); | ||
3957 | } | 3963 | } |
3958 | 3964 | ||
3959 | read_unlock_bh(&l2cap_sk_list.lock); | 3965 | read_unlock_bh(&l2cap_sk_list.lock); |
3960 | 3966 | ||
3961 | return str - buf; | 3967 | return 0; |
3962 | } | 3968 | } |
3963 | 3969 | ||
3964 | static CLASS_ATTR(l2cap, S_IRUGO, l2cap_sysfs_show, NULL); | 3970 | static int l2cap_debugfs_open(struct inode *inode, struct file *file) |
3971 | { | ||
3972 | return single_open(file, l2cap_debugfs_show, inode->i_private); | ||
3973 | } | ||
3974 | |||
3975 | static const struct file_operations l2cap_debugfs_fops = { | ||
3976 | .open = l2cap_debugfs_open, | ||
3977 | .read = seq_read, | ||
3978 | .llseek = seq_lseek, | ||
3979 | .release = single_release, | ||
3980 | }; | ||
3981 | |||
3982 | static struct dentry *l2cap_debugfs; | ||
3965 | 3983 | ||
3966 | static const struct proto_ops l2cap_sock_ops = { | 3984 | static const struct proto_ops l2cap_sock_ops = { |
3967 | .family = PF_BLUETOOTH, | 3985 | .family = PF_BLUETOOTH, |
@@ -4021,8 +4039,12 @@ static int __init l2cap_init(void) | |||
4021 | goto error; | 4039 | goto error; |
4022 | } | 4040 | } |
4023 | 4041 | ||
4024 | if (class_create_file(bt_class, &class_attr_l2cap) < 0) | 4042 | if (bt_debugfs) { |
4025 | BT_ERR("Failed to create L2CAP info file"); | 4043 | l2cap_debugfs = debugfs_create_file("l2cap", 0444, |
4044 | bt_debugfs, NULL, &l2cap_debugfs_fops); | ||
4045 | if (!l2cap_debugfs) | ||
4046 | BT_ERR("Failed to create L2CAP debug file"); | ||
4047 | } | ||
4026 | 4048 | ||
4027 | BT_INFO("L2CAP ver %s", VERSION); | 4049 | BT_INFO("L2CAP ver %s", VERSION); |
4028 | BT_INFO("L2CAP socket layer initialized"); | 4050 | BT_INFO("L2CAP socket layer initialized"); |
@@ -4036,7 +4058,7 @@ error: | |||
4036 | 4058 | ||
4037 | static void __exit l2cap_exit(void) | 4059 | static void __exit l2cap_exit(void) |
4038 | { | 4060 | { |
4039 | class_remove_file(bt_class, &class_attr_l2cap); | 4061 | debugfs_remove(l2cap_debugfs); |
4040 | 4062 | ||
4041 | if (bt_sock_unregister(BTPROTO_L2CAP) < 0) | 4063 | if (bt_sock_unregister(BTPROTO_L2CAP) < 0) |
4042 | BT_ERR("L2CAP socket unregistration failed"); | 4064 | BT_ERR("L2CAP socket unregistration failed"); |
diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c index db8a68e1a5ba..13f114e8b0f9 100644 --- a/net/bluetooth/rfcomm/core.c +++ b/net/bluetooth/rfcomm/core.c | |||
@@ -33,6 +33,8 @@ | |||
33 | #include <linux/init.h> | 33 | #include <linux/init.h> |
34 | #include <linux/wait.h> | 34 | #include <linux/wait.h> |
35 | #include <linux/device.h> | 35 | #include <linux/device.h> |
36 | #include <linux/debugfs.h> | ||
37 | #include <linux/seq_file.h> | ||
36 | #include <linux/net.h> | 38 | #include <linux/net.h> |
37 | #include <linux/mutex.h> | 39 | #include <linux/mutex.h> |
38 | #include <linux/kthread.h> | 40 | #include <linux/kthread.h> |
@@ -2098,13 +2100,10 @@ static struct hci_cb rfcomm_cb = { | |||
2098 | .security_cfm = rfcomm_security_cfm | 2100 | .security_cfm = rfcomm_security_cfm |
2099 | }; | 2101 | }; |
2100 | 2102 | ||
2101 | static ssize_t rfcomm_dlc_sysfs_show(struct class *dev, | 2103 | static int rfcomm_dlc_debugfs_show(struct seq_file *f, void *x) |
2102 | struct class_attribute *attr, | ||
2103 | char *buf) | ||
2104 | { | 2104 | { |
2105 | struct rfcomm_session *s; | 2105 | struct rfcomm_session *s; |
2106 | struct list_head *pp, *p; | 2106 | struct list_head *pp, *p; |
2107 | char *str = buf; | ||
2108 | 2107 | ||
2109 | rfcomm_lock(); | 2108 | rfcomm_lock(); |
2110 | 2109 | ||
@@ -2114,18 +2113,32 @@ static ssize_t rfcomm_dlc_sysfs_show(struct class *dev, | |||
2114 | struct sock *sk = s->sock->sk; | 2113 | struct sock *sk = s->sock->sk; |
2115 | struct rfcomm_dlc *d = list_entry(pp, struct rfcomm_dlc, list); | 2114 | struct rfcomm_dlc *d = list_entry(pp, struct rfcomm_dlc, list); |
2116 | 2115 | ||
2117 | str += sprintf(str, "%s %s %ld %d %d %d %d\n", | 2116 | seq_printf(f, "%s %s %ld %d %d %d %d\n", |
2118 | batostr(&bt_sk(sk)->src), batostr(&bt_sk(sk)->dst), | 2117 | batostr(&bt_sk(sk)->src), |
2119 | d->state, d->dlci, d->mtu, d->rx_credits, d->tx_credits); | 2118 | batostr(&bt_sk(sk)->dst), |
2119 | d->state, d->dlci, d->mtu, | ||
2120 | d->rx_credits, d->tx_credits); | ||
2120 | } | 2121 | } |
2121 | } | 2122 | } |
2122 | 2123 | ||
2123 | rfcomm_unlock(); | 2124 | rfcomm_unlock(); |
2124 | 2125 | ||
2125 | return (str - buf); | 2126 | return 0; |
2126 | } | 2127 | } |
2127 | 2128 | ||
2128 | static CLASS_ATTR(rfcomm_dlc, S_IRUGO, rfcomm_dlc_sysfs_show, NULL); | 2129 | static int rfcomm_dlc_debugfs_open(struct inode *inode, struct file *file) |
2130 | { | ||
2131 | return single_open(file, rfcomm_dlc_debugfs_show, inode->i_private); | ||
2132 | } | ||
2133 | |||
2134 | static const struct file_operations rfcomm_dlc_debugfs_fops = { | ||
2135 | .open = rfcomm_dlc_debugfs_open, | ||
2136 | .read = seq_read, | ||
2137 | .llseek = seq_lseek, | ||
2138 | .release = single_release, | ||
2139 | }; | ||
2140 | |||
2141 | static struct dentry *rfcomm_dlc_debugfs; | ||
2129 | 2142 | ||
2130 | /* ---- Initialization ---- */ | 2143 | /* ---- Initialization ---- */ |
2131 | static int __init rfcomm_init(void) | 2144 | static int __init rfcomm_init(void) |
@@ -2142,8 +2155,12 @@ static int __init rfcomm_init(void) | |||
2142 | goto unregister; | 2155 | goto unregister; |
2143 | } | 2156 | } |
2144 | 2157 | ||
2145 | if (class_create_file(bt_class, &class_attr_rfcomm_dlc) < 0) | 2158 | if (bt_debugfs) { |
2146 | BT_ERR("Failed to create RFCOMM info file"); | 2159 | rfcomm_dlc_debugfs = debugfs_create_file("rfcomm_dlc", 0444, |
2160 | bt_debugfs, NULL, &rfcomm_dlc_debugfs_fops); | ||
2161 | if (!rfcomm_dlc_debugfs) | ||
2162 | BT_ERR("Failed to create RFCOMM debug file"); | ||
2163 | } | ||
2147 | 2164 | ||
2148 | err = rfcomm_init_ttys(); | 2165 | err = rfcomm_init_ttys(); |
2149 | if (err < 0) | 2166 | if (err < 0) |
@@ -2171,7 +2188,7 @@ unregister: | |||
2171 | 2188 | ||
2172 | static void __exit rfcomm_exit(void) | 2189 | static void __exit rfcomm_exit(void) |
2173 | { | 2190 | { |
2174 | class_remove_file(bt_class, &class_attr_rfcomm_dlc); | 2191 | debugfs_remove(rfcomm_dlc_debugfs); |
2175 | 2192 | ||
2176 | hci_unregister_cb(&rfcomm_cb); | 2193 | hci_unregister_cb(&rfcomm_cb); |
2177 | 2194 | ||
diff --git a/net/bluetooth/rfcomm/sock.c b/net/bluetooth/rfcomm/sock.c index ca87d6ac6a20..7f439765403d 100644 --- a/net/bluetooth/rfcomm/sock.c +++ b/net/bluetooth/rfcomm/sock.c | |||
@@ -40,6 +40,8 @@ | |||
40 | #include <linux/skbuff.h> | 40 | #include <linux/skbuff.h> |
41 | #include <linux/list.h> | 41 | #include <linux/list.h> |
42 | #include <linux/device.h> | 42 | #include <linux/device.h> |
43 | #include <linux/debugfs.h> | ||
44 | #include <linux/seq_file.h> | ||
43 | #include <net/sock.h> | 45 | #include <net/sock.h> |
44 | 46 | ||
45 | #include <asm/system.h> | 47 | #include <asm/system.h> |
@@ -1061,28 +1063,38 @@ done: | |||
1061 | return result; | 1063 | return result; |
1062 | } | 1064 | } |
1063 | 1065 | ||
1064 | static ssize_t rfcomm_sock_sysfs_show(struct class *dev, | 1066 | static int rfcomm_sock_debugfs_show(struct seq_file *f, void *p) |
1065 | struct class_attribute *attr, | ||
1066 | char *buf) | ||
1067 | { | 1067 | { |
1068 | struct sock *sk; | 1068 | struct sock *sk; |
1069 | struct hlist_node *node; | 1069 | struct hlist_node *node; |
1070 | char *str = buf; | ||
1071 | 1070 | ||
1072 | read_lock_bh(&rfcomm_sk_list.lock); | 1071 | read_lock_bh(&rfcomm_sk_list.lock); |
1073 | 1072 | ||
1074 | sk_for_each(sk, node, &rfcomm_sk_list.head) { | 1073 | sk_for_each(sk, node, &rfcomm_sk_list.head) { |
1075 | str += sprintf(str, "%s %s %d %d\n", | 1074 | seq_printf(f, "%s %s %d %d\n", |
1076 | batostr(&bt_sk(sk)->src), batostr(&bt_sk(sk)->dst), | 1075 | batostr(&bt_sk(sk)->src), |
1076 | batostr(&bt_sk(sk)->dst), | ||
1077 | sk->sk_state, rfcomm_pi(sk)->channel); | 1077 | sk->sk_state, rfcomm_pi(sk)->channel); |
1078 | } | 1078 | } |
1079 | 1079 | ||
1080 | read_unlock_bh(&rfcomm_sk_list.lock); | 1080 | read_unlock_bh(&rfcomm_sk_list.lock); |
1081 | 1081 | ||
1082 | return (str - buf); | 1082 | return 0; |
1083 | } | 1083 | } |
1084 | 1084 | ||
1085 | static CLASS_ATTR(rfcomm, S_IRUGO, rfcomm_sock_sysfs_show, NULL); | 1085 | static int rfcomm_sock_debugfs_open(struct inode *inode, struct file *file) |
1086 | { | ||
1087 | return single_open(file, rfcomm_sock_debugfs_show, inode->i_private); | ||
1088 | } | ||
1089 | |||
1090 | static const struct file_operations rfcomm_sock_debugfs_fops = { | ||
1091 | .open = rfcomm_sock_debugfs_open, | ||
1092 | .read = seq_read, | ||
1093 | .llseek = seq_lseek, | ||
1094 | .release = single_release, | ||
1095 | }; | ||
1096 | |||
1097 | static struct dentry *rfcomm_sock_debugfs; | ||
1086 | 1098 | ||
1087 | static const struct proto_ops rfcomm_sock_ops = { | 1099 | static const struct proto_ops rfcomm_sock_ops = { |
1088 | .family = PF_BLUETOOTH, | 1100 | .family = PF_BLUETOOTH, |
@@ -1122,8 +1134,12 @@ int __init rfcomm_init_sockets(void) | |||
1122 | if (err < 0) | 1134 | if (err < 0) |
1123 | goto error; | 1135 | goto error; |
1124 | 1136 | ||
1125 | if (class_create_file(bt_class, &class_attr_rfcomm) < 0) | 1137 | if (bt_debugfs) { |
1126 | BT_ERR("Failed to create RFCOMM info file"); | 1138 | rfcomm_sock_debugfs = debugfs_create_file("rfcomm", 0444, |
1139 | bt_debugfs, NULL, &rfcomm_sock_debugfs_fops); | ||
1140 | if (!rfcomm_sock_debugfs) | ||
1141 | BT_ERR("Failed to create RFCOMM debug file"); | ||
1142 | } | ||
1127 | 1143 | ||
1128 | BT_INFO("RFCOMM socket layer initialized"); | 1144 | BT_INFO("RFCOMM socket layer initialized"); |
1129 | 1145 | ||
@@ -1137,7 +1153,7 @@ error: | |||
1137 | 1153 | ||
1138 | void rfcomm_cleanup_sockets(void) | 1154 | void rfcomm_cleanup_sockets(void) |
1139 | { | 1155 | { |
1140 | class_remove_file(bt_class, &class_attr_rfcomm); | 1156 | debugfs_remove(rfcomm_sock_debugfs); |
1141 | 1157 | ||
1142 | if (bt_sock_unregister(BTPROTO_RFCOMM) < 0) | 1158 | if (bt_sock_unregister(BTPROTO_RFCOMM) < 0) |
1143 | BT_ERR("RFCOMM socket layer unregistration failed"); | 1159 | BT_ERR("RFCOMM socket layer unregistration failed"); |
diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c index f93b939539bc..e5b16b76b22e 100644 --- a/net/bluetooth/sco.c +++ b/net/bluetooth/sco.c | |||
@@ -38,6 +38,8 @@ | |||
38 | #include <linux/socket.h> | 38 | #include <linux/socket.h> |
39 | #include <linux/skbuff.h> | 39 | #include <linux/skbuff.h> |
40 | #include <linux/device.h> | 40 | #include <linux/device.h> |
41 | #include <linux/debugfs.h> | ||
42 | #include <linux/seq_file.h> | ||
41 | #include <linux/list.h> | 43 | #include <linux/list.h> |
42 | #include <net/sock.h> | 44 | #include <net/sock.h> |
43 | 45 | ||
@@ -953,28 +955,36 @@ drop: | |||
953 | return 0; | 955 | return 0; |
954 | } | 956 | } |
955 | 957 | ||
956 | static ssize_t sco_sysfs_show(struct class *dev, | 958 | static int sco_debugfs_show(struct seq_file *f, void *p) |
957 | struct class_attribute *attr, | ||
958 | char *buf) | ||
959 | { | 959 | { |
960 | struct sock *sk; | 960 | struct sock *sk; |
961 | struct hlist_node *node; | 961 | struct hlist_node *node; |
962 | char *str = buf; | ||
963 | 962 | ||
964 | read_lock_bh(&sco_sk_list.lock); | 963 | read_lock_bh(&sco_sk_list.lock); |
965 | 964 | ||
966 | sk_for_each(sk, node, &sco_sk_list.head) { | 965 | sk_for_each(sk, node, &sco_sk_list.head) { |
967 | str += sprintf(str, "%s %s %d\n", | 966 | seq_printf(f, "%s %s %d\n", batostr(&bt_sk(sk)->src), |
968 | batostr(&bt_sk(sk)->src), batostr(&bt_sk(sk)->dst), | 967 | batostr(&bt_sk(sk)->dst), sk->sk_state); |
969 | sk->sk_state); | ||
970 | } | 968 | } |
971 | 969 | ||
972 | read_unlock_bh(&sco_sk_list.lock); | 970 | read_unlock_bh(&sco_sk_list.lock); |
973 | 971 | ||
974 | return (str - buf); | 972 | return 0; |
975 | } | 973 | } |
976 | 974 | ||
977 | static CLASS_ATTR(sco, S_IRUGO, sco_sysfs_show, NULL); | 975 | static int sco_debugfs_open(struct inode *inode, struct file *file) |
976 | { | ||
977 | return single_open(file, sco_debugfs_show, inode->i_private); | ||
978 | } | ||
979 | |||
980 | static const struct file_operations sco_debugfs_fops = { | ||
981 | .open = sco_debugfs_open, | ||
982 | .read = seq_read, | ||
983 | .llseek = seq_lseek, | ||
984 | .release = single_release, | ||
985 | }; | ||
986 | |||
987 | static struct dentry *sco_debugfs; | ||
978 | 988 | ||
979 | static const struct proto_ops sco_sock_ops = { | 989 | static const struct proto_ops sco_sock_ops = { |
980 | .family = PF_BLUETOOTH, | 990 | .family = PF_BLUETOOTH, |
@@ -1032,8 +1042,12 @@ static int __init sco_init(void) | |||
1032 | goto error; | 1042 | goto error; |
1033 | } | 1043 | } |
1034 | 1044 | ||
1035 | if (class_create_file(bt_class, &class_attr_sco) < 0) | 1045 | if (bt_debugfs) { |
1036 | BT_ERR("Failed to create SCO info file"); | 1046 | sco_debugfs = debugfs_create_file("sco", 0444, |
1047 | bt_debugfs, NULL, &sco_debugfs_fops); | ||
1048 | if (!sco_debugfs) | ||
1049 | BT_ERR("Failed to create SCO debug file"); | ||
1050 | } | ||
1037 | 1051 | ||
1038 | BT_INFO("SCO (Voice Link) ver %s", VERSION); | 1052 | BT_INFO("SCO (Voice Link) ver %s", VERSION); |
1039 | BT_INFO("SCO socket layer initialized"); | 1053 | BT_INFO("SCO socket layer initialized"); |
@@ -1047,7 +1061,7 @@ error: | |||
1047 | 1061 | ||
1048 | static void __exit sco_exit(void) | 1062 | static void __exit sco_exit(void) |
1049 | { | 1063 | { |
1050 | class_remove_file(bt_class, &class_attr_sco); | 1064 | debugfs_remove(sco_debugfs); |
1051 | 1065 | ||
1052 | if (bt_sock_unregister(BTPROTO_SCO) < 0) | 1066 | if (bt_sock_unregister(BTPROTO_SCO) < 0) |
1053 | BT_ERR("SCO socket unregistration failed"); | 1067 | BT_ERR("SCO socket unregistration failed"); |
diff --git a/net/core/dev.c b/net/core/dev.c index bcc490cc9452..59d4394d2ce8 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -2483,6 +2483,7 @@ int netif_receive_skb(struct sk_buff *skb) | |||
2483 | { | 2483 | { |
2484 | struct packet_type *ptype, *pt_prev; | 2484 | struct packet_type *ptype, *pt_prev; |
2485 | struct net_device *orig_dev; | 2485 | struct net_device *orig_dev; |
2486 | struct net_device *master; | ||
2486 | struct net_device *null_or_orig; | 2487 | struct net_device *null_or_orig; |
2487 | struct net_device *null_or_bond; | 2488 | struct net_device *null_or_bond; |
2488 | int ret = NET_RX_DROP; | 2489 | int ret = NET_RX_DROP; |
@@ -2503,11 +2504,12 @@ int netif_receive_skb(struct sk_buff *skb) | |||
2503 | 2504 | ||
2504 | null_or_orig = NULL; | 2505 | null_or_orig = NULL; |
2505 | orig_dev = skb->dev; | 2506 | orig_dev = skb->dev; |
2506 | if (orig_dev->master) { | 2507 | master = ACCESS_ONCE(orig_dev->master); |
2507 | if (skb_bond_should_drop(skb)) | 2508 | if (master) { |
2509 | if (skb_bond_should_drop(skb, master)) | ||
2508 | null_or_orig = orig_dev; /* deliver only exact match */ | 2510 | null_or_orig = orig_dev; /* deliver only exact match */ |
2509 | else | 2511 | else |
2510 | skb->dev = orig_dev->master; | 2512 | skb->dev = master; |
2511 | } | 2513 | } |
2512 | 2514 | ||
2513 | __get_cpu_var(netdev_rx_stat).total++; | 2515 | __get_cpu_var(netdev_rx_stat).total++; |
diff --git a/net/ipv4/fib_trie.c b/net/ipv4/fib_trie.c index af5d89792860..01ef8ba9025c 100644 --- a/net/ipv4/fib_trie.c +++ b/net/ipv4/fib_trie.c | |||
@@ -961,7 +961,9 @@ fib_find_node(struct trie *t, u32 key) | |||
961 | struct node *n; | 961 | struct node *n; |
962 | 962 | ||
963 | pos = 0; | 963 | pos = 0; |
964 | n = rcu_dereference(t->trie); | 964 | n = rcu_dereference_check(t->trie, |
965 | rcu_read_lock_held() || | ||
966 | lockdep_rtnl_is_held()); | ||
965 | 967 | ||
966 | while (n != NULL && NODE_TYPE(n) == T_TNODE) { | 968 | while (n != NULL && NODE_TYPE(n) == T_TNODE) { |
967 | tn = (struct tnode *) n; | 969 | tn = (struct tnode *) n; |
diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c index f47c9f76754b..f78402d097b3 100644 --- a/net/ipv4/ip_gre.c +++ b/net/ipv4/ip_gre.c | |||
@@ -810,11 +810,13 @@ static netdev_tx_t ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev | |||
810 | tunnel->err_count = 0; | 810 | tunnel->err_count = 0; |
811 | } | 811 | } |
812 | 812 | ||
813 | max_headroom = LL_RESERVED_SPACE(tdev) + gre_hlen; | 813 | max_headroom = LL_RESERVED_SPACE(tdev) + gre_hlen + rt->u.dst.header_len; |
814 | 814 | ||
815 | if (skb_headroom(skb) < max_headroom || skb_shared(skb)|| | 815 | if (skb_headroom(skb) < max_headroom || skb_shared(skb)|| |
816 | (skb_cloned(skb) && !skb_clone_writable(skb, 0))) { | 816 | (skb_cloned(skb) && !skb_clone_writable(skb, 0))) { |
817 | struct sk_buff *new_skb = skb_realloc_headroom(skb, max_headroom); | 817 | struct sk_buff *new_skb = skb_realloc_headroom(skb, max_headroom); |
818 | if (max_headroom > dev->needed_headroom) | ||
819 | dev->needed_headroom = max_headroom; | ||
818 | if (!new_skb) { | 820 | if (!new_skb) { |
819 | ip_rt_put(rt); | 821 | ip_rt_put(rt); |
820 | txq->tx_dropped++; | 822 | txq->tx_dropped++; |
diff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c index 8582e12e4a62..0b9d03c54dc3 100644 --- a/net/ipv4/ipmr.c +++ b/net/ipv4/ipmr.c | |||
@@ -802,6 +802,9 @@ static int ipmr_mfc_add(struct net *net, struct mfcctl *mfc, int mrtsock) | |||
802 | int line; | 802 | int line; |
803 | struct mfc_cache *uc, *c, **cp; | 803 | struct mfc_cache *uc, *c, **cp; |
804 | 804 | ||
805 | if (mfc->mfcc_parent >= MAXVIFS) | ||
806 | return -ENFILE; | ||
807 | |||
805 | line = MFC_HASH(mfc->mfcc_mcastgrp.s_addr, mfc->mfcc_origin.s_addr); | 808 | line = MFC_HASH(mfc->mfcc_mcastgrp.s_addr, mfc->mfcc_origin.s_addr); |
806 | 809 | ||
807 | for (cp = &net->ipv4.mfc_cache_array[line]; | 810 | for (cp = &net->ipv4.mfc_cache_array[line]; |
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index a770df2493d2..54fd68c14c87 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c | |||
@@ -1441,7 +1441,7 @@ void ip_rt_redirect(__be32 old_gw, __be32 daddr, __be32 new_gw, | |||
1441 | dev_hold(rt->u.dst.dev); | 1441 | dev_hold(rt->u.dst.dev); |
1442 | if (rt->idev) | 1442 | if (rt->idev) |
1443 | in_dev_hold(rt->idev); | 1443 | in_dev_hold(rt->idev); |
1444 | rt->u.dst.obsolete = 0; | 1444 | rt->u.dst.obsolete = -1; |
1445 | rt->u.dst.lastuse = jiffies; | 1445 | rt->u.dst.lastuse = jiffies; |
1446 | rt->u.dst.path = &rt->u.dst; | 1446 | rt->u.dst.path = &rt->u.dst; |
1447 | rt->u.dst.neighbour = NULL; | 1447 | rt->u.dst.neighbour = NULL; |
@@ -1506,11 +1506,12 @@ static struct dst_entry *ipv4_negative_advice(struct dst_entry *dst) | |||
1506 | struct dst_entry *ret = dst; | 1506 | struct dst_entry *ret = dst; |
1507 | 1507 | ||
1508 | if (rt) { | 1508 | if (rt) { |
1509 | if (dst->obsolete) { | 1509 | if (dst->obsolete > 0) { |
1510 | ip_rt_put(rt); | 1510 | ip_rt_put(rt); |
1511 | ret = NULL; | 1511 | ret = NULL; |
1512 | } else if ((rt->rt_flags & RTCF_REDIRECTED) || | 1512 | } else if ((rt->rt_flags & RTCF_REDIRECTED) || |
1513 | rt->u.dst.expires) { | 1513 | (rt->u.dst.expires && |
1514 | time_after_eq(jiffies, rt->u.dst.expires))) { | ||
1514 | unsigned hash = rt_hash(rt->fl.fl4_dst, rt->fl.fl4_src, | 1515 | unsigned hash = rt_hash(rt->fl.fl4_dst, rt->fl.fl4_src, |
1515 | rt->fl.oif, | 1516 | rt->fl.oif, |
1516 | rt_genid(dev_net(dst->dev))); | 1517 | rt_genid(dev_net(dst->dev))); |
@@ -1726,7 +1727,9 @@ static void ip_rt_update_pmtu(struct dst_entry *dst, u32 mtu) | |||
1726 | 1727 | ||
1727 | static struct dst_entry *ipv4_dst_check(struct dst_entry *dst, u32 cookie) | 1728 | static struct dst_entry *ipv4_dst_check(struct dst_entry *dst, u32 cookie) |
1728 | { | 1729 | { |
1729 | return NULL; | 1730 | if (rt_is_expired((struct rtable *)dst)) |
1731 | return NULL; | ||
1732 | return dst; | ||
1730 | } | 1733 | } |
1731 | 1734 | ||
1732 | static void ipv4_dst_destroy(struct dst_entry *dst) | 1735 | static void ipv4_dst_destroy(struct dst_entry *dst) |
@@ -1888,7 +1891,8 @@ static int ip_route_input_mc(struct sk_buff *skb, __be32 daddr, __be32 saddr, | |||
1888 | if (!rth) | 1891 | if (!rth) |
1889 | goto e_nobufs; | 1892 | goto e_nobufs; |
1890 | 1893 | ||
1891 | rth->u.dst.output= ip_rt_bug; | 1894 | rth->u.dst.output = ip_rt_bug; |
1895 | rth->u.dst.obsolete = -1; | ||
1892 | 1896 | ||
1893 | atomic_set(&rth->u.dst.__refcnt, 1); | 1897 | atomic_set(&rth->u.dst.__refcnt, 1); |
1894 | rth->u.dst.flags= DST_HOST; | 1898 | rth->u.dst.flags= DST_HOST; |
@@ -2054,6 +2058,7 @@ static int __mkroute_input(struct sk_buff *skb, | |||
2054 | rth->fl.oif = 0; | 2058 | rth->fl.oif = 0; |
2055 | rth->rt_spec_dst= spec_dst; | 2059 | rth->rt_spec_dst= spec_dst; |
2056 | 2060 | ||
2061 | rth->u.dst.obsolete = -1; | ||
2057 | rth->u.dst.input = ip_forward; | 2062 | rth->u.dst.input = ip_forward; |
2058 | rth->u.dst.output = ip_output; | 2063 | rth->u.dst.output = ip_output; |
2059 | rth->rt_genid = rt_genid(dev_net(rth->u.dst.dev)); | 2064 | rth->rt_genid = rt_genid(dev_net(rth->u.dst.dev)); |
@@ -2218,6 +2223,7 @@ local_input: | |||
2218 | goto e_nobufs; | 2223 | goto e_nobufs; |
2219 | 2224 | ||
2220 | rth->u.dst.output= ip_rt_bug; | 2225 | rth->u.dst.output= ip_rt_bug; |
2226 | rth->u.dst.obsolete = -1; | ||
2221 | rth->rt_genid = rt_genid(net); | 2227 | rth->rt_genid = rt_genid(net); |
2222 | 2228 | ||
2223 | atomic_set(&rth->u.dst.__refcnt, 1); | 2229 | atomic_set(&rth->u.dst.__refcnt, 1); |
@@ -2444,6 +2450,7 @@ static int __mkroute_output(struct rtable **result, | |||
2444 | rth->rt_spec_dst= fl->fl4_src; | 2450 | rth->rt_spec_dst= fl->fl4_src; |
2445 | 2451 | ||
2446 | rth->u.dst.output=ip_output; | 2452 | rth->u.dst.output=ip_output; |
2453 | rth->u.dst.obsolete = -1; | ||
2447 | rth->rt_genid = rt_genid(dev_net(dev_out)); | 2454 | rth->rt_genid = rt_genid(dev_net(dev_out)); |
2448 | 2455 | ||
2449 | RT_CACHE_STAT_INC(out_slow_tot); | 2456 | RT_CACHE_STAT_INC(out_slow_tot); |
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 5901010fad55..6afb6d8662b2 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c | |||
@@ -429,7 +429,7 @@ unsigned int tcp_poll(struct file *file, struct socket *sock, poll_table *wait) | |||
429 | if (tp->urg_seq == tp->copied_seq && | 429 | if (tp->urg_seq == tp->copied_seq && |
430 | !sock_flag(sk, SOCK_URGINLINE) && | 430 | !sock_flag(sk, SOCK_URGINLINE) && |
431 | tp->urg_data) | 431 | tp->urg_data) |
432 | target--; | 432 | target++; |
433 | 433 | ||
434 | /* Potential race condition. If read of tp below will | 434 | /* Potential race condition. If read of tp below will |
435 | * escape above sk->sk_state, we can be illegally awaken | 435 | * escape above sk->sk_state, we can be illegally awaken |
@@ -1254,6 +1254,39 @@ static void tcp_prequeue_process(struct sock *sk) | |||
1254 | tp->ucopy.memory = 0; | 1254 | tp->ucopy.memory = 0; |
1255 | } | 1255 | } |
1256 | 1256 | ||
1257 | #ifdef CONFIG_NET_DMA | ||
1258 | static void tcp_service_net_dma(struct sock *sk, bool wait) | ||
1259 | { | ||
1260 | dma_cookie_t done, used; | ||
1261 | dma_cookie_t last_issued; | ||
1262 | struct tcp_sock *tp = tcp_sk(sk); | ||
1263 | |||
1264 | if (!tp->ucopy.dma_chan) | ||
1265 | return; | ||
1266 | |||
1267 | last_issued = tp->ucopy.dma_cookie; | ||
1268 | dma_async_memcpy_issue_pending(tp->ucopy.dma_chan); | ||
1269 | |||
1270 | do { | ||
1271 | if (dma_async_memcpy_complete(tp->ucopy.dma_chan, | ||
1272 | last_issued, &done, | ||
1273 | &used) == DMA_SUCCESS) { | ||
1274 | /* Safe to free early-copied skbs now */ | ||
1275 | __skb_queue_purge(&sk->sk_async_wait_queue); | ||
1276 | break; | ||
1277 | } else { | ||
1278 | struct sk_buff *skb; | ||
1279 | while ((skb = skb_peek(&sk->sk_async_wait_queue)) && | ||
1280 | (dma_async_is_complete(skb->dma_cookie, done, | ||
1281 | used) == DMA_SUCCESS)) { | ||
1282 | __skb_dequeue(&sk->sk_async_wait_queue); | ||
1283 | kfree_skb(skb); | ||
1284 | } | ||
1285 | } | ||
1286 | } while (wait); | ||
1287 | } | ||
1288 | #endif | ||
1289 | |||
1257 | static inline struct sk_buff *tcp_recv_skb(struct sock *sk, u32 seq, u32 *off) | 1290 | static inline struct sk_buff *tcp_recv_skb(struct sock *sk, u32 seq, u32 *off) |
1258 | { | 1291 | { |
1259 | struct sk_buff *skb; | 1292 | struct sk_buff *skb; |
@@ -1546,6 +1579,10 @@ int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |||
1546 | /* __ Set realtime policy in scheduler __ */ | 1579 | /* __ Set realtime policy in scheduler __ */ |
1547 | } | 1580 | } |
1548 | 1581 | ||
1582 | #ifdef CONFIG_NET_DMA | ||
1583 | if (tp->ucopy.dma_chan) | ||
1584 | dma_async_memcpy_issue_pending(tp->ucopy.dma_chan); | ||
1585 | #endif | ||
1549 | if (copied >= target) { | 1586 | if (copied >= target) { |
1550 | /* Do not sleep, just process backlog. */ | 1587 | /* Do not sleep, just process backlog. */ |
1551 | release_sock(sk); | 1588 | release_sock(sk); |
@@ -1554,6 +1591,7 @@ int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, | |||
1554 | sk_wait_data(sk, &timeo); | 1591 | sk_wait_data(sk, &timeo); |
1555 | 1592 | ||
1556 | #ifdef CONFIG_NET_DMA | 1593 | #ifdef CONFIG_NET_DMA |
1594 | tcp_service_net_dma(sk, false); /* Don't block */ | ||
1557 | tp->ucopy.wakeup = 0; | 1595 | tp->ucopy.wakeup = 0; |
1558 | #endif | 1596 | #endif |
1559 | 1597 | ||
@@ -1633,6 +1671,9 @@ do_prequeue: | |||
1633 | copied = -EFAULT; | 1671 | copied = -EFAULT; |
1634 | break; | 1672 | break; |
1635 | } | 1673 | } |
1674 | |||
1675 | dma_async_memcpy_issue_pending(tp->ucopy.dma_chan); | ||
1676 | |||
1636 | if ((offset + used) == skb->len) | 1677 | if ((offset + used) == skb->len) |
1637 | copied_early = 1; | 1678 | copied_early = 1; |
1638 | 1679 | ||
@@ -1702,27 +1743,9 @@ skip_copy: | |||
1702 | } | 1743 | } |
1703 | 1744 | ||
1704 | #ifdef CONFIG_NET_DMA | 1745 | #ifdef CONFIG_NET_DMA |
1705 | if (tp->ucopy.dma_chan) { | 1746 | tcp_service_net_dma(sk, true); /* Wait for queue to drain */ |
1706 | dma_cookie_t done, used; | 1747 | tp->ucopy.dma_chan = NULL; |
1707 | |||
1708 | dma_async_memcpy_issue_pending(tp->ucopy.dma_chan); | ||
1709 | |||
1710 | while (dma_async_memcpy_complete(tp->ucopy.dma_chan, | ||
1711 | tp->ucopy.dma_cookie, &done, | ||
1712 | &used) == DMA_IN_PROGRESS) { | ||
1713 | /* do partial cleanup of sk_async_wait_queue */ | ||
1714 | while ((skb = skb_peek(&sk->sk_async_wait_queue)) && | ||
1715 | (dma_async_is_complete(skb->dma_cookie, done, | ||
1716 | used) == DMA_SUCCESS)) { | ||
1717 | __skb_dequeue(&sk->sk_async_wait_queue); | ||
1718 | kfree_skb(skb); | ||
1719 | } | ||
1720 | } | ||
1721 | 1748 | ||
1722 | /* Safe to free early-copied skbs now */ | ||
1723 | __skb_queue_purge(&sk->sk_async_wait_queue); | ||
1724 | tp->ucopy.dma_chan = NULL; | ||
1725 | } | ||
1726 | if (tp->ucopy.pinned_list) { | 1749 | if (tp->ucopy.pinned_list) { |
1727 | dma_unpin_iovec_pages(tp->ucopy.pinned_list); | 1750 | dma_unpin_iovec_pages(tp->ucopy.pinned_list); |
1728 | tp->ucopy.pinned_list = NULL; | 1751 | tp->ucopy.pinned_list = NULL; |
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 788851ca8c5d..c096a4218b8f 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -2511,6 +2511,9 @@ static void tcp_mark_head_lost(struct sock *sk, int packets) | |||
2511 | int err; | 2511 | int err; |
2512 | unsigned int mss; | 2512 | unsigned int mss; |
2513 | 2513 | ||
2514 | if (packets == 0) | ||
2515 | return; | ||
2516 | |||
2514 | WARN_ON(packets > tp->packets_out); | 2517 | WARN_ON(packets > tp->packets_out); |
2515 | if (tp->lost_skb_hint) { | 2518 | if (tp->lost_skb_hint) { |
2516 | skb = tp->lost_skb_hint; | 2519 | skb = tp->lost_skb_hint; |
diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 70df40980a87..f4df5f931f36 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c | |||
@@ -370,6 +370,11 @@ void tcp_v4_err(struct sk_buff *icmp_skb, u32 info) | |||
370 | if (sk->sk_state == TCP_CLOSE) | 370 | if (sk->sk_state == TCP_CLOSE) |
371 | goto out; | 371 | goto out; |
372 | 372 | ||
373 | if (unlikely(iph->ttl < inet_sk(sk)->min_ttl)) { | ||
374 | NET_INC_STATS_BH(net, LINUX_MIB_TCPMINTTLDROP); | ||
375 | goto out; | ||
376 | } | ||
377 | |||
373 | icsk = inet_csk(sk); | 378 | icsk = inet_csk(sk); |
374 | tp = tcp_sk(sk); | 379 | tp = tcp_sk(sk); |
375 | seq = ntohl(th->seq); | 380 | seq = ntohl(th->seq); |
diff --git a/net/ipv6/ip6mr.c b/net/ipv6/ip6mr.c index 52e0f74fdfe0..23e4ac0cc30e 100644 --- a/net/ipv6/ip6mr.c +++ b/net/ipv6/ip6mr.c | |||
@@ -1113,6 +1113,9 @@ static int ip6mr_mfc_add(struct net *net, struct mf6cctl *mfc, int mrtsock) | |||
1113 | unsigned char ttls[MAXMIFS]; | 1113 | unsigned char ttls[MAXMIFS]; |
1114 | int i; | 1114 | int i; |
1115 | 1115 | ||
1116 | if (mfc->mf6cc_parent >= MAXMIFS) | ||
1117 | return -ENFILE; | ||
1118 | |||
1116 | memset(ttls, 255, MAXMIFS); | 1119 | memset(ttls, 255, MAXMIFS); |
1117 | for (i = 0; i < MAXMIFS; i++) { | 1120 | for (i = 0; i < MAXMIFS; i++) { |
1118 | if (IF_ISSET(i, &mfc->mf6cc_ifset)) | 1121 | if (IF_ISSET(i, &mfc->mf6cc_ifset)) |
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 52cd3eff31dc..7fcb0e5d1213 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c | |||
@@ -879,7 +879,7 @@ static struct dst_entry *ip6_dst_check(struct dst_entry *dst, u32 cookie) | |||
879 | 879 | ||
880 | rt = (struct rt6_info *) dst; | 880 | rt = (struct rt6_info *) dst; |
881 | 881 | ||
882 | if (rt && rt->rt6i_node && (rt->rt6i_node->fn_sernum == cookie)) | 882 | if (rt->rt6i_node && (rt->rt6i_node->fn_sernum == cookie)) |
883 | return dst; | 883 | return dst; |
884 | 884 | ||
885 | return NULL; | 885 | return NULL; |
diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c index 2b2af631d2b8..569410a85953 100644 --- a/net/netfilter/nf_conntrack_netlink.c +++ b/net/netfilter/nf_conntrack_netlink.c | |||
@@ -582,7 +582,9 @@ nla_put_failure: | |||
582 | nlmsg_failure: | 582 | nlmsg_failure: |
583 | kfree_skb(skb); | 583 | kfree_skb(skb); |
584 | errout: | 584 | errout: |
585 | nfnetlink_set_err(net, 0, group, -ENOBUFS); | 585 | if (nfnetlink_set_err(net, 0, group, -ENOBUFS) > 0) |
586 | return -ENOBUFS; | ||
587 | |||
586 | return 0; | 588 | return 0; |
587 | } | 589 | } |
588 | #endif /* CONFIG_NF_CONNTRACK_EVENTS */ | 590 | #endif /* CONFIG_NF_CONNTRACK_EVENTS */ |
diff --git a/net/netfilter/nfnetlink.c b/net/netfilter/nfnetlink.c index 8eb0cc23ada3..6afa3d52ea5f 100644 --- a/net/netfilter/nfnetlink.c +++ b/net/netfilter/nfnetlink.c | |||
@@ -113,9 +113,9 @@ int nfnetlink_send(struct sk_buff *skb, struct net *net, u32 pid, | |||
113 | } | 113 | } |
114 | EXPORT_SYMBOL_GPL(nfnetlink_send); | 114 | EXPORT_SYMBOL_GPL(nfnetlink_send); |
115 | 115 | ||
116 | void nfnetlink_set_err(struct net *net, u32 pid, u32 group, int error) | 116 | int nfnetlink_set_err(struct net *net, u32 pid, u32 group, int error) |
117 | { | 117 | { |
118 | netlink_set_err(net->nfnl, pid, group, error); | 118 | return netlink_set_err(net->nfnl, pid, group, error); |
119 | } | 119 | } |
120 | EXPORT_SYMBOL_GPL(nfnetlink_set_err); | 120 | EXPORT_SYMBOL_GPL(nfnetlink_set_err); |
121 | 121 | ||
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index 320d0423a240..acbbae1e89b5 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c | |||
@@ -1093,6 +1093,7 @@ static inline int do_one_set_err(struct sock *sk, | |||
1093 | struct netlink_set_err_data *p) | 1093 | struct netlink_set_err_data *p) |
1094 | { | 1094 | { |
1095 | struct netlink_sock *nlk = nlk_sk(sk); | 1095 | struct netlink_sock *nlk = nlk_sk(sk); |
1096 | int ret = 0; | ||
1096 | 1097 | ||
1097 | if (sk == p->exclude_sk) | 1098 | if (sk == p->exclude_sk) |
1098 | goto out; | 1099 | goto out; |
@@ -1104,10 +1105,15 @@ static inline int do_one_set_err(struct sock *sk, | |||
1104 | !test_bit(p->group - 1, nlk->groups)) | 1105 | !test_bit(p->group - 1, nlk->groups)) |
1105 | goto out; | 1106 | goto out; |
1106 | 1107 | ||
1108 | if (p->code == ENOBUFS && nlk->flags & NETLINK_RECV_NO_ENOBUFS) { | ||
1109 | ret = 1; | ||
1110 | goto out; | ||
1111 | } | ||
1112 | |||
1107 | sk->sk_err = p->code; | 1113 | sk->sk_err = p->code; |
1108 | sk->sk_error_report(sk); | 1114 | sk->sk_error_report(sk); |
1109 | out: | 1115 | out: |
1110 | return 0; | 1116 | return ret; |
1111 | } | 1117 | } |
1112 | 1118 | ||
1113 | /** | 1119 | /** |
@@ -1116,12 +1122,16 @@ out: | |||
1116 | * @pid: the PID of a process that we want to skip (if any) | 1122 | * @pid: the PID of a process that we want to skip (if any) |
1117 | * @groups: the broadcast group that will notice the error | 1123 | * @groups: the broadcast group that will notice the error |
1118 | * @code: error code, must be negative (as usual in kernelspace) | 1124 | * @code: error code, must be negative (as usual in kernelspace) |
1125 | * | ||
1126 | * This function returns the number of broadcast listeners that have set the | ||
1127 | * NETLINK_RECV_NO_ENOBUFS socket option. | ||
1119 | */ | 1128 | */ |
1120 | void netlink_set_err(struct sock *ssk, u32 pid, u32 group, int code) | 1129 | int netlink_set_err(struct sock *ssk, u32 pid, u32 group, int code) |
1121 | { | 1130 | { |
1122 | struct netlink_set_err_data info; | 1131 | struct netlink_set_err_data info; |
1123 | struct hlist_node *node; | 1132 | struct hlist_node *node; |
1124 | struct sock *sk; | 1133 | struct sock *sk; |
1134 | int ret = 0; | ||
1125 | 1135 | ||
1126 | info.exclude_sk = ssk; | 1136 | info.exclude_sk = ssk; |
1127 | info.pid = pid; | 1137 | info.pid = pid; |
@@ -1132,9 +1142,10 @@ void netlink_set_err(struct sock *ssk, u32 pid, u32 group, int code) | |||
1132 | read_lock(&nl_table_lock); | 1142 | read_lock(&nl_table_lock); |
1133 | 1143 | ||
1134 | sk_for_each_bound(sk, node, &nl_table[ssk->sk_protocol].mc_list) | 1144 | sk_for_each_bound(sk, node, &nl_table[ssk->sk_protocol].mc_list) |
1135 | do_one_set_err(sk, &info); | 1145 | ret += do_one_set_err(sk, &info); |
1136 | 1146 | ||
1137 | read_unlock(&nl_table_lock); | 1147 | read_unlock(&nl_table_lock); |
1148 | return ret; | ||
1138 | } | 1149 | } |
1139 | EXPORT_SYMBOL(netlink_set_err); | 1150 | EXPORT_SYMBOL(netlink_set_err); |
1140 | 1151 | ||
diff --git a/net/rxrpc/ar-accept.c b/net/rxrpc/ar-accept.c index 77228f28fa36..2d744f22a9a1 100644 --- a/net/rxrpc/ar-accept.c +++ b/net/rxrpc/ar-accept.c | |||
@@ -88,6 +88,11 @@ static int rxrpc_accept_incoming_call(struct rxrpc_local *local, | |||
88 | 88 | ||
89 | /* get a notification message to send to the server app */ | 89 | /* get a notification message to send to the server app */ |
90 | notification = alloc_skb(0, GFP_NOFS); | 90 | notification = alloc_skb(0, GFP_NOFS); |
91 | if (!notification) { | ||
92 | _debug("no memory"); | ||
93 | ret = -ENOMEM; | ||
94 | goto error_nofree; | ||
95 | } | ||
91 | rxrpc_new_skb(notification); | 96 | rxrpc_new_skb(notification); |
92 | notification->mark = RXRPC_SKB_MARK_NEW_CALL; | 97 | notification->mark = RXRPC_SKB_MARK_NEW_CALL; |
93 | 98 | ||
@@ -189,6 +194,7 @@ invalid_service: | |||
189 | ret = -ECONNREFUSED; | 194 | ret = -ECONNREFUSED; |
190 | error: | 195 | error: |
191 | rxrpc_free_skb(notification); | 196 | rxrpc_free_skb(notification); |
197 | error_nofree: | ||
192 | _leave(" = %d", ret); | 198 | _leave(" = %d", ret); |
193 | return ret; | 199 | return ret; |
194 | } | 200 | } |
diff --git a/net/sunrpc/auth_gss/auth_gss.c b/net/sunrpc/auth_gss/auth_gss.c index 0cfccc2a0297..c389ccf6437d 100644 --- a/net/sunrpc/auth_gss/auth_gss.c +++ b/net/sunrpc/auth_gss/auth_gss.c | |||
@@ -1280,9 +1280,8 @@ alloc_enc_pages(struct rpc_rqst *rqstp) | |||
1280 | rqstp->rq_release_snd_buf = priv_release_snd_buf; | 1280 | rqstp->rq_release_snd_buf = priv_release_snd_buf; |
1281 | return 0; | 1281 | return 0; |
1282 | out_free: | 1282 | out_free: |
1283 | for (i--; i >= 0; i--) { | 1283 | rqstp->rq_enc_pages_num = i; |
1284 | __free_page(rqstp->rq_enc_pages[i]); | 1284 | priv_release_snd_buf(rqstp); |
1285 | } | ||
1286 | out: | 1285 | out: |
1287 | return -EAGAIN; | 1286 | return -EAGAIN; |
1288 | } | 1287 | } |
diff --git a/net/sunrpc/bc_svc.c b/net/sunrpc/bc_svc.c index 13f214f53120..f0c05d3311c1 100644 --- a/net/sunrpc/bc_svc.c +++ b/net/sunrpc/bc_svc.c | |||
@@ -37,21 +37,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |||
37 | 37 | ||
38 | #define RPCDBG_FACILITY RPCDBG_SVCDSP | 38 | #define RPCDBG_FACILITY RPCDBG_SVCDSP |
39 | 39 | ||
40 | void bc_release_request(struct rpc_task *task) | ||
41 | { | ||
42 | struct rpc_rqst *req = task->tk_rqstp; | ||
43 | |||
44 | dprintk("RPC: bc_release_request: task= %p\n", task); | ||
45 | |||
46 | /* | ||
47 | * Release this request only if it's a backchannel | ||
48 | * preallocated request | ||
49 | */ | ||
50 | if (!bc_prealloc(req)) | ||
51 | return; | ||
52 | xprt_free_bc_request(req); | ||
53 | } | ||
54 | |||
55 | /* Empty callback ops */ | 40 | /* Empty callback ops */ |
56 | static const struct rpc_call_ops nfs41_callback_ops = { | 41 | static const struct rpc_call_ops nfs41_callback_ops = { |
57 | }; | 42 | }; |
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index 154034b675bd..19c9983d5360 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c | |||
@@ -659,6 +659,7 @@ struct rpc_task *rpc_run_bc_task(struct rpc_rqst *req, | |||
659 | task = rpc_new_task(&task_setup_data); | 659 | task = rpc_new_task(&task_setup_data); |
660 | if (!task) { | 660 | if (!task) { |
661 | xprt_free_bc_request(req); | 661 | xprt_free_bc_request(req); |
662 | task = ERR_PTR(-ENOMEM); | ||
662 | goto out; | 663 | goto out; |
663 | } | 664 | } |
664 | task->tk_rqstp = req; | 665 | task->tk_rqstp = req; |
diff --git a/net/sunrpc/rpc_pipe.c b/net/sunrpc/rpc_pipe.c index 8d63f8fd29b7..20e30c6f8355 100644 --- a/net/sunrpc/rpc_pipe.c +++ b/net/sunrpc/rpc_pipe.c | |||
@@ -587,6 +587,8 @@ static struct dentry *__rpc_lookup_create_exclusive(struct dentry *parent, | |||
587 | struct dentry *dentry; | 587 | struct dentry *dentry; |
588 | 588 | ||
589 | dentry = __rpc_lookup_create(parent, name); | 589 | dentry = __rpc_lookup_create(parent, name); |
590 | if (IS_ERR(dentry)) | ||
591 | return dentry; | ||
590 | if (dentry->d_inode == NULL) | 592 | if (dentry->d_inode == NULL) |
591 | return dentry; | 593 | return dentry; |
592 | dput(dentry); | 594 | dput(dentry); |
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c index 469de292c23c..42f09ade0044 100644 --- a/net/sunrpc/xprt.c +++ b/net/sunrpc/xprt.c | |||
@@ -46,6 +46,7 @@ | |||
46 | 46 | ||
47 | #include <linux/sunrpc/clnt.h> | 47 | #include <linux/sunrpc/clnt.h> |
48 | #include <linux/sunrpc/metrics.h> | 48 | #include <linux/sunrpc/metrics.h> |
49 | #include <linux/sunrpc/bc_xprt.h> | ||
49 | 50 | ||
50 | #include "sunrpc.h" | 51 | #include "sunrpc.h" |
51 | 52 | ||
@@ -1032,21 +1033,16 @@ void xprt_release(struct rpc_task *task) | |||
1032 | if (req->rq_release_snd_buf) | 1033 | if (req->rq_release_snd_buf) |
1033 | req->rq_release_snd_buf(req); | 1034 | req->rq_release_snd_buf(req); |
1034 | 1035 | ||
1035 | /* | ||
1036 | * Early exit if this is a backchannel preallocated request. | ||
1037 | * There is no need to have it added to the RPC slot list. | ||
1038 | */ | ||
1039 | if (is_bc_request) | ||
1040 | return; | ||
1041 | |||
1042 | memset(req, 0, sizeof(*req)); /* mark unused */ | ||
1043 | |||
1044 | dprintk("RPC: %5u release request %p\n", task->tk_pid, req); | 1036 | dprintk("RPC: %5u release request %p\n", task->tk_pid, req); |
1037 | if (likely(!is_bc_request)) { | ||
1038 | memset(req, 0, sizeof(*req)); /* mark unused */ | ||
1045 | 1039 | ||
1046 | spin_lock(&xprt->reserve_lock); | 1040 | spin_lock(&xprt->reserve_lock); |
1047 | list_add(&req->rq_list, &xprt->free); | 1041 | list_add(&req->rq_list, &xprt->free); |
1048 | rpc_wake_up_next(&xprt->backlog); | 1042 | rpc_wake_up_next(&xprt->backlog); |
1049 | spin_unlock(&xprt->reserve_lock); | 1043 | spin_unlock(&xprt->reserve_lock); |
1044 | } else | ||
1045 | xprt_free_bc_request(req); | ||
1050 | } | 1046 | } |
1051 | 1047 | ||
1052 | /** | 1048 | /** |
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index e4839c07c913..9847c30b5001 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c | |||
@@ -2251,9 +2251,6 @@ static struct rpc_xprt_ops xs_tcp_ops = { | |||
2251 | .buf_free = rpc_free, | 2251 | .buf_free = rpc_free, |
2252 | .send_request = xs_tcp_send_request, | 2252 | .send_request = xs_tcp_send_request, |
2253 | .set_retrans_timeout = xprt_set_retrans_timeout_def, | 2253 | .set_retrans_timeout = xprt_set_retrans_timeout_def, |
2254 | #if defined(CONFIG_NFS_V4_1) | ||
2255 | .release_request = bc_release_request, | ||
2256 | #endif /* CONFIG_NFS_V4_1 */ | ||
2257 | .close = xs_tcp_close, | 2254 | .close = xs_tcp_close, |
2258 | .destroy = xs_destroy, | 2255 | .destroy = xs_destroy, |
2259 | .print_stats = xs_tcp_print_stats, | 2256 | .print_stats = xs_tcp_print_stats, |
diff --git a/scripts/get_maintainer.pl b/scripts/get_maintainer.pl index f76f3d13276d..6f97a13bcee4 100755 --- a/scripts/get_maintainer.pl +++ b/scripts/get_maintainer.pl | |||
@@ -284,7 +284,7 @@ foreach my $file (@ARGV) { | |||
284 | my $file_cnt = @files; | 284 | my $file_cnt = @files; |
285 | my $lastfile; | 285 | my $lastfile; |
286 | 286 | ||
287 | open(my $patch, '<', $file) | 287 | open(my $patch, "< $file") |
288 | or die "$P: Can't open $file: $!\n"; | 288 | or die "$P: Can't open $file: $!\n"; |
289 | while (<$patch>) { | 289 | while (<$patch>) { |
290 | my $patch_line = $_; | 290 | my $patch_line = $_; |
diff --git a/scripts/kernel-doc b/scripts/kernel-doc index c7865c362d28..fcdfb245a575 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc | |||
@@ -1424,6 +1424,8 @@ sub dump_struct($$) { | |||
1424 | $nested =~ s/\/\*.*?\*\///gos; | 1424 | $nested =~ s/\/\*.*?\*\///gos; |
1425 | # strip kmemcheck_bitfield_{begin,end}.*; | 1425 | # strip kmemcheck_bitfield_{begin,end}.*; |
1426 | $members =~ s/kmemcheck_bitfield_.*?;//gos; | 1426 | $members =~ s/kmemcheck_bitfield_.*?;//gos; |
1427 | # strip attributes | ||
1428 | $members =~ s/__aligned\s*\(\d+\)//gos; | ||
1427 | 1429 | ||
1428 | create_parameterlist($members, ';', $file); | 1430 | create_parameterlist($members, ';', $file); |
1429 | check_sections($file, $declaration_name, "struct", $sectcheck, $struct_actual, $nested); | 1431 | check_sections($file, $declaration_name, "struct", $sectcheck, $struct_actual, $nested); |
@@ -1728,6 +1730,7 @@ sub dump_function($$) { | |||
1728 | $prototype =~ s/^noinline +//; | 1730 | $prototype =~ s/^noinline +//; |
1729 | $prototype =~ s/__devinit +//; | 1731 | $prototype =~ s/__devinit +//; |
1730 | $prototype =~ s/__init +//; | 1732 | $prototype =~ s/__init +//; |
1733 | $prototype =~ s/__init_or_module +//; | ||
1731 | $prototype =~ s/^#\s*define\s+//; #ak added | 1734 | $prototype =~ s/^#\s*define\s+//; #ak added |
1732 | $prototype =~ s/__attribute__\s*\(\([a-z,]*\)\)//; | 1735 | $prototype =~ s/__attribute__\s*\(\([a-z,]*\)\)//; |
1733 | 1736 | ||
diff --git a/sound/arm/pxa2xx-pcm-lib.c b/sound/arm/pxa2xx-pcm-lib.c index 743ac6a29065..fd51fa8b06a1 100644 --- a/sound/arm/pxa2xx-pcm-lib.c +++ b/sound/arm/pxa2xx-pcm-lib.c | |||
@@ -205,6 +205,7 @@ int __pxa2xx_pcm_open(struct snd_pcm_substream *substream) | |||
205 | if (!rtd->dma_desc_array) | 205 | if (!rtd->dma_desc_array) |
206 | goto err1; | 206 | goto err1; |
207 | 207 | ||
208 | rtd->dma_ch = -1; | ||
208 | runtime->private_data = rtd; | 209 | runtime->private_data = rtd; |
209 | return 0; | 210 | return 0; |
210 | 211 | ||
diff --git a/sound/oss/vidc.c b/sound/oss/vidc.c index 725fef0f59a3..a4127bab9231 100644 --- a/sound/oss/vidc.c +++ b/sound/oss/vidc.c | |||
@@ -363,13 +363,13 @@ static void vidc_audio_trigger(int dev, int enable_bits) | |||
363 | struct audio_operations *adev = audio_devs[dev]; | 363 | struct audio_operations *adev = audio_devs[dev]; |
364 | 364 | ||
365 | if (enable_bits & PCM_ENABLE_OUTPUT) { | 365 | if (enable_bits & PCM_ENABLE_OUTPUT) { |
366 | if (!(adev->flags & DMA_ACTIVE)) { | 366 | if (!(adev->dmap_out->flags & DMA_ACTIVE)) { |
367 | unsigned long flags; | 367 | unsigned long flags; |
368 | 368 | ||
369 | local_irq_save(flags); | 369 | local_irq_save(flags); |
370 | 370 | ||
371 | /* prevent recusion */ | 371 | /* prevent recusion */ |
372 | adev->flags |= DMA_ACTIVE; | 372 | adev->dmap_out->flags |= DMA_ACTIVE; |
373 | 373 | ||
374 | dma_interrupt = vidc_audio_dma_interrupt; | 374 | dma_interrupt = vidc_audio_dma_interrupt; |
375 | vidc_sound_dma_irq(0, NULL); | 375 | vidc_sound_dma_irq(0, NULL); |
diff --git a/sound/pci/cmipci.c b/sound/pci/cmipci.c index 1ded64e05643..329968edca9b 100644 --- a/sound/pci/cmipci.c +++ b/sound/pci/cmipci.c | |||
@@ -941,13 +941,21 @@ static snd_pcm_uframes_t snd_cmipci_pcm_pointer(struct cmipci *cm, struct cmipci | |||
941 | struct snd_pcm_substream *substream) | 941 | struct snd_pcm_substream *substream) |
942 | { | 942 | { |
943 | size_t ptr; | 943 | size_t ptr; |
944 | unsigned int reg; | 944 | unsigned int reg, rem, tries; |
945 | |||
945 | if (!rec->running) | 946 | if (!rec->running) |
946 | return 0; | 947 | return 0; |
947 | #if 1 // this seems better.. | 948 | #if 1 // this seems better.. |
948 | reg = rec->ch ? CM_REG_CH1_FRAME2 : CM_REG_CH0_FRAME2; | 949 | reg = rec->ch ? CM_REG_CH1_FRAME2 : CM_REG_CH0_FRAME2; |
949 | ptr = rec->dma_size - (snd_cmipci_read_w(cm, reg) + 1); | 950 | for (tries = 0; tries < 3; tries++) { |
950 | ptr >>= rec->shift; | 951 | rem = snd_cmipci_read_w(cm, reg); |
952 | if (rem < rec->dma_size) | ||
953 | goto ok; | ||
954 | } | ||
955 | printk(KERN_ERR "cmipci: invalid PCM pointer: %#x\n", rem); | ||
956 | return SNDRV_PCM_POS_XRUN; | ||
957 | ok: | ||
958 | ptr = (rec->dma_size - (rem + 1)) >> rec->shift; | ||
951 | #else | 959 | #else |
952 | reg = rec->ch ? CM_REG_CH1_FRAME1 : CM_REG_CH0_FRAME1; | 960 | reg = rec->ch ? CM_REG_CH1_FRAME1 : CM_REG_CH0_FRAME1; |
953 | ptr = snd_cmipci_read(cm, reg) - rec->offset; | 961 | ptr = snd_cmipci_read(cm, reg) - rec->offset; |
diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c index 194a28c54992..61682e1d09da 100644 --- a/sound/pci/hda/patch_conexant.c +++ b/sound/pci/hda/patch_conexant.c | |||
@@ -1591,6 +1591,21 @@ static int patch_cxt5047(struct hda_codec *codec) | |||
1591 | #endif | 1591 | #endif |
1592 | } | 1592 | } |
1593 | spec->vmaster_nid = 0x13; | 1593 | spec->vmaster_nid = 0x13; |
1594 | |||
1595 | switch (codec->subsystem_id >> 16) { | ||
1596 | case 0x103c: | ||
1597 | /* HP laptops have really bad sound over 0 dB on NID 0x10. | ||
1598 | * Fix max PCM level to 0 dB (originally it has 0x1e steps | ||
1599 | * with 0 dB offset 0x17) | ||
1600 | */ | ||
1601 | snd_hda_override_amp_caps(codec, 0x10, HDA_INPUT, | ||
1602 | (0x17 << AC_AMPCAP_OFFSET_SHIFT) | | ||
1603 | (0x17 << AC_AMPCAP_NUM_STEPS_SHIFT) | | ||
1604 | (0x05 << AC_AMPCAP_STEP_SIZE_SHIFT) | | ||
1605 | (1 << AC_AMPCAP_MUTE_SHIFT)); | ||
1606 | break; | ||
1607 | } | ||
1608 | |||
1594 | return 0; | 1609 | return 0; |
1595 | } | 1610 | } |
1596 | 1611 | ||
diff --git a/sound/pci/hda/patch_nvhdmi.c b/sound/pci/hda/patch_nvhdmi.c index 70669a246902..3c10c0b149f4 100644 --- a/sound/pci/hda/patch_nvhdmi.c +++ b/sound/pci/hda/patch_nvhdmi.c | |||
@@ -538,8 +538,6 @@ static int patch_nvhdmi_2ch(struct hda_codec *codec) | |||
538 | * patch entries | 538 | * patch entries |
539 | */ | 539 | */ |
540 | static struct hda_codec_preset snd_hda_preset_nvhdmi[] = { | 540 | static struct hda_codec_preset snd_hda_preset_nvhdmi[] = { |
541 | { .id = 0x10de0067, .name = "MCP67 HDMI", .patch = patch_nvhdmi_2ch }, | ||
542 | { .id = 0x10de8001, .name = "MCP73 HDMI", .patch = patch_nvhdmi_2ch }, | ||
543 | { .id = 0x10de0002, .name = "MCP77/78 HDMI", | 541 | { .id = 0x10de0002, .name = "MCP77/78 HDMI", |
544 | .patch = patch_nvhdmi_8ch_7x }, | 542 | .patch = patch_nvhdmi_8ch_7x }, |
545 | { .id = 0x10de0003, .name = "MCP77/78 HDMI", | 543 | { .id = 0x10de0003, .name = "MCP77/78 HDMI", |
@@ -550,12 +548,16 @@ static struct hda_codec_preset snd_hda_preset_nvhdmi[] = { | |||
550 | .patch = patch_nvhdmi_8ch_7x }, | 548 | .patch = patch_nvhdmi_8ch_7x }, |
551 | { .id = 0x10de0007, .name = "MCP79/7A HDMI", | 549 | { .id = 0x10de0007, .name = "MCP79/7A HDMI", |
552 | .patch = patch_nvhdmi_8ch_7x }, | 550 | .patch = patch_nvhdmi_8ch_7x }, |
553 | { .id = 0x10de000c, .name = "MCP89 HDMI", | 551 | { .id = 0x10de000a, .name = "GT220 HDMI", |
554 | .patch = patch_nvhdmi_8ch_89 }, | 552 | .patch = patch_nvhdmi_8ch_89 }, |
555 | { .id = 0x10de000b, .name = "GT21x HDMI", | 553 | { .id = 0x10de000b, .name = "GT21x HDMI", |
556 | .patch = patch_nvhdmi_8ch_89 }, | 554 | .patch = patch_nvhdmi_8ch_89 }, |
555 | { .id = 0x10de000c, .name = "MCP89 HDMI", | ||
556 | .patch = patch_nvhdmi_8ch_89 }, | ||
557 | { .id = 0x10de000d, .name = "GT240 HDMI", | 557 | { .id = 0x10de000d, .name = "GT240 HDMI", |
558 | .patch = patch_nvhdmi_8ch_89 }, | 558 | .patch = patch_nvhdmi_8ch_89 }, |
559 | { .id = 0x10de0067, .name = "MCP67 HDMI", .patch = patch_nvhdmi_2ch }, | ||
560 | { .id = 0x10de8001, .name = "MCP73 HDMI", .patch = patch_nvhdmi_2ch }, | ||
559 | {} /* terminator */ | 561 | {} /* terminator */ |
560 | }; | 562 | }; |
561 | 563 | ||
@@ -564,11 +566,12 @@ MODULE_ALIAS("snd-hda-codec-id:10de0003"); | |||
564 | MODULE_ALIAS("snd-hda-codec-id:10de0005"); | 566 | MODULE_ALIAS("snd-hda-codec-id:10de0005"); |
565 | MODULE_ALIAS("snd-hda-codec-id:10de0006"); | 567 | MODULE_ALIAS("snd-hda-codec-id:10de0006"); |
566 | MODULE_ALIAS("snd-hda-codec-id:10de0007"); | 568 | MODULE_ALIAS("snd-hda-codec-id:10de0007"); |
567 | MODULE_ALIAS("snd-hda-codec-id:10de0067"); | 569 | MODULE_ALIAS("snd-hda-codec-id:10de000a"); |
568 | MODULE_ALIAS("snd-hda-codec-id:10de8001"); | ||
569 | MODULE_ALIAS("snd-hda-codec-id:10de000c"); | ||
570 | MODULE_ALIAS("snd-hda-codec-id:10de000b"); | 570 | MODULE_ALIAS("snd-hda-codec-id:10de000b"); |
571 | MODULE_ALIAS("snd-hda-codec-id:10de000c"); | ||
571 | MODULE_ALIAS("snd-hda-codec-id:10de000d"); | 572 | MODULE_ALIAS("snd-hda-codec-id:10de000d"); |
573 | MODULE_ALIAS("snd-hda-codec-id:10de0067"); | ||
574 | MODULE_ALIAS("snd-hda-codec-id:10de8001"); | ||
572 | 575 | ||
573 | MODULE_LICENSE("GPL"); | 576 | MODULE_LICENSE("GPL"); |
574 | MODULE_DESCRIPTION("NVIDIA HDMI HD-audio codec"); | 577 | MODULE_DESCRIPTION("NVIDIA HDMI HD-audio codec"); |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 4ec57633af88..053d53d8c8b2 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -2532,8 +2532,6 @@ static int alc_build_controls(struct hda_codec *codec) | |||
2532 | return err; | 2532 | return err; |
2533 | } | 2533 | } |
2534 | 2534 | ||
2535 | alc_free_kctls(codec); /* no longer needed */ | ||
2536 | |||
2537 | /* assign Capture Source enums to NID */ | 2535 | /* assign Capture Source enums to NID */ |
2538 | kctl = snd_hda_find_mixer_ctl(codec, "Capture Source"); | 2536 | kctl = snd_hda_find_mixer_ctl(codec, "Capture Source"); |
2539 | if (!kctl) | 2537 | if (!kctl) |
@@ -2602,6 +2600,9 @@ static int alc_build_controls(struct hda_codec *codec) | |||
2602 | } | 2600 | } |
2603 | } | 2601 | } |
2604 | } | 2602 | } |
2603 | |||
2604 | alc_free_kctls(codec); /* no longer needed */ | ||
2605 | |||
2605 | return 0; | 2606 | return 0; |
2606 | } | 2607 | } |
2607 | 2608 | ||
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index 8c416bb18a57..c4be3fab94e5 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c | |||
@@ -1730,6 +1730,8 @@ static struct snd_pci_quirk stac92hd71bxx_cfg_tbl[] = { | |||
1730 | "HP HDX", STAC_HP_HDX), /* HDX16 */ | 1730 | "HP HDX", STAC_HP_HDX), /* HDX16 */ |
1731 | SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x3620, | 1731 | SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x3620, |
1732 | "HP dv6", STAC_HP_DV5), | 1732 | "HP dv6", STAC_HP_DV5), |
1733 | SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x3061, | ||
1734 | "HP dv6", STAC_HP_DV5), /* HP dv6-1110ax */ | ||
1733 | SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x7010, | 1735 | SND_PCI_QUIRK_MASK(PCI_VENDOR_ID_HP, 0xfff0, 0x7010, |
1734 | "HP", STAC_HP_DV5), | 1736 | "HP", STAC_HP_DV5), |
1735 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0233, | 1737 | SND_PCI_QUIRK(PCI_VENDOR_ID_DELL, 0x0233, |
diff --git a/sound/soc/codecs/tlv320dac33.c b/sound/soc/codecs/tlv320dac33.c index f9f367d29a90..d50f1699ccb2 100644 --- a/sound/soc/codecs/tlv320dac33.c +++ b/sound/soc/codecs/tlv320dac33.c | |||
@@ -778,7 +778,7 @@ static int dac33_prepare_chip(struct snd_pcm_substream *substream) | |||
778 | if (dac33->fifo_mode) { | 778 | if (dac33->fifo_mode) { |
779 | /* Generic for all FIFO modes */ | 779 | /* Generic for all FIFO modes */ |
780 | /* 50-51 : ASRC Control registers */ | 780 | /* 50-51 : ASRC Control registers */ |
781 | dac33_write(codec, DAC33_ASRC_CTRL_A, (1 << 4)); /* div=2 */ | 781 | dac33_write(codec, DAC33_ASRC_CTRL_A, DAC33_SRCLKDIV(1)); |
782 | dac33_write(codec, DAC33_ASRC_CTRL_B, 1); /* ??? */ | 782 | dac33_write(codec, DAC33_ASRC_CTRL_B, 1); /* ??? */ |
783 | 783 | ||
784 | /* Write registers 0x34 and 0x35 (MSB, LSB) */ | 784 | /* Write registers 0x34 and 0x35 (MSB, LSB) */ |
@@ -1038,11 +1038,7 @@ static int dac33_set_dai_fmt(struct snd_soc_dai *codec_dai, | |||
1038 | case SND_SOC_DAIFMT_DSP_A: | 1038 | case SND_SOC_DAIFMT_DSP_A: |
1039 | aictrl_a |= DAC33_AFMT_DSP; | 1039 | aictrl_a |= DAC33_AFMT_DSP; |
1040 | aictrl_b &= ~DAC33_DATA_DELAY_MASK; | 1040 | aictrl_b &= ~DAC33_DATA_DELAY_MASK; |
1041 | aictrl_b |= DAC33_DATA_DELAY(1); /* 1 bit delay */ | 1041 | aictrl_b |= DAC33_DATA_DELAY(0); |
1042 | break; | ||
1043 | case SND_SOC_DAIFMT_DSP_B: | ||
1044 | aictrl_a |= DAC33_AFMT_DSP; | ||
1045 | aictrl_b &= ~DAC33_DATA_DELAY_MASK; /* No delay */ | ||
1046 | break; | 1042 | break; |
1047 | case SND_SOC_DAIFMT_RIGHT_J: | 1043 | case SND_SOC_DAIFMT_RIGHT_J: |
1048 | aictrl_a |= DAC33_AFMT_RIGHT_J; | 1044 | aictrl_a |= DAC33_AFMT_RIGHT_J; |
@@ -1066,7 +1062,7 @@ static void dac33_init_chip(struct snd_soc_codec *codec) | |||
1066 | { | 1062 | { |
1067 | /* 44-46: DAC Control Registers */ | 1063 | /* 44-46: DAC Control Registers */ |
1068 | /* A : DAC sample rate Fsref/1.5 */ | 1064 | /* A : DAC sample rate Fsref/1.5 */ |
1069 | dac33_write(codec, DAC33_DAC_CTRL_A, DAC33_DACRATE(1)); | 1065 | dac33_write(codec, DAC33_DAC_CTRL_A, DAC33_DACRATE(0)); |
1070 | /* B : DAC src=normal, not muted */ | 1066 | /* B : DAC src=normal, not muted */ |
1071 | dac33_write(codec, DAC33_DAC_CTRL_B, DAC33_DACSRCR_RIGHT | | 1067 | dac33_write(codec, DAC33_DAC_CTRL_B, DAC33_DACSRCR_RIGHT | |
1072 | DAC33_DACSRCL_LEFT); | 1068 | DAC33_DACSRCL_LEFT); |
diff --git a/sound/soc/codecs/wm_hubs.c b/sound/soc/codecs/wm_hubs.c index 0ad9f5d536c6..486bdd21a98a 100644 --- a/sound/soc/codecs/wm_hubs.c +++ b/sound/soc/codecs/wm_hubs.c | |||
@@ -74,7 +74,7 @@ static void wait_for_dc_servo(struct snd_soc_codec *codec) | |||
74 | msleep(1); | 74 | msleep(1); |
75 | reg = snd_soc_read(codec, WM8993_DC_SERVO_READBACK_0); | 75 | reg = snd_soc_read(codec, WM8993_DC_SERVO_READBACK_0); |
76 | dev_dbg(codec->dev, "DC servo: %x\n", reg); | 76 | dev_dbg(codec->dev, "DC servo: %x\n", reg); |
77 | } while (reg & WM8993_DCS_DATAPATH_BUSY); | 77 | } while (reg & WM8993_DCS_DATAPATH_BUSY && count < 400); |
78 | 78 | ||
79 | if (reg & WM8993_DCS_DATAPATH_BUSY) | 79 | if (reg & WM8993_DCS_DATAPATH_BUSY) |
80 | dev_err(codec->dev, "Timed out waiting for DC Servo\n"); | 80 | dev_err(codec->dev, "Timed out waiting for DC Servo\n"); |
diff --git a/sound/soc/imx/Kconfig b/sound/soc/imx/Kconfig index c7d0fd9b7de8..7174b4c710de 100644 --- a/sound/soc/imx/Kconfig +++ b/sound/soc/imx/Kconfig | |||
@@ -1,6 +1,6 @@ | |||
1 | config SND_IMX_SOC | 1 | config SND_IMX_SOC |
2 | tristate "SoC Audio for Freescale i.MX CPUs" | 2 | tristate "SoC Audio for Freescale i.MX CPUs" |
3 | depends on ARCH_MXC && BROKEN | 3 | depends on ARCH_MXC |
4 | select SND_PCM | 4 | select SND_PCM |
5 | select FIQ | 5 | select FIQ |
6 | select SND_SOC_AC97_BUS | 6 | select SND_SOC_AC97_BUS |
diff --git a/sound/soc/sh/Kconfig b/sound/soc/sh/Kconfig index 106674979b53..f07f6d8b93e1 100644 --- a/sound/soc/sh/Kconfig +++ b/sound/soc/sh/Kconfig | |||
@@ -32,6 +32,7 @@ config SND_SOC_SH4_SIU | |||
32 | select DMA_ENGINE | 32 | select DMA_ENGINE |
33 | select DMADEVICES | 33 | select DMADEVICES |
34 | select SH_DMAE | 34 | select SH_DMAE |
35 | select FW_LOADER | ||
35 | 36 | ||
36 | ## | 37 | ## |
37 | ## Boards | 38 | ## Boards |