diff options
105 files changed, 1875 insertions, 863 deletions
diff --git a/Documentation/ABI/testing/sysfs-bus-pci b/Documentation/ABI/testing/sysfs-bus-pci index ceddcff4082a..e638e15a8895 100644 --- a/Documentation/ABI/testing/sysfs-bus-pci +++ b/Documentation/ABI/testing/sysfs-bus-pci | |||
@@ -1,3 +1,46 @@ | |||
1 | What: /sys/bus/pci/drivers/.../bind | ||
2 | Date: December 2003 | ||
3 | Contact: linux-pci@vger.kernel.org | ||
4 | Description: | ||
5 | Writing a device location to this file will cause | ||
6 | the driver to attempt to bind to the device found at | ||
7 | this location. This is useful for overriding default | ||
8 | bindings. The format for the location is: DDDD:BB:DD.F. | ||
9 | That is Domain:Bus:Device.Function and is the same as | ||
10 | found in /sys/bus/pci/devices/. For example: | ||
11 | # echo 0000:00:19.0 > /sys/bus/pci/drivers/foo/bind | ||
12 | (Note: kernels before 2.6.28 may require echo -n). | ||
13 | |||
14 | What: /sys/bus/pci/drivers/.../unbind | ||
15 | Date: December 2003 | ||
16 | Contact: linux-pci@vger.kernel.org | ||
17 | Description: | ||
18 | Writing a device location to this file will cause the | ||
19 | driver to attempt to unbind from the device found at | ||
20 | this location. This may be useful when overriding default | ||
21 | bindings. The format for the location is: DDDD:BB:DD.F. | ||
22 | That is Domain:Bus:Device.Function and is the same as | ||
23 | found in /sys/bus/pci/devices/. For example: | ||
24 | # echo 0000:00:19.0 > /sys/bus/pci/drivers/foo/unbind | ||
25 | (Note: kernels before 2.6.28 may require echo -n). | ||
26 | |||
27 | What: /sys/bus/pci/drivers/.../new_id | ||
28 | Date: December 2003 | ||
29 | Contact: linux-pci@vger.kernel.org | ||
30 | Description: | ||
31 | Writing a device ID to this file will attempt to | ||
32 | dynamically add a new device ID to a PCI device driver. | ||
33 | This may allow the driver to support more hardware than | ||
34 | was included in the driver's static device ID support | ||
35 | table at compile time. The format for the device ID is: | ||
36 | VVVV DDDD SVVV SDDD CCCC MMMM PPPP. That is Vendor ID, | ||
37 | Device ID, Subsystem Vendor ID, Subsystem Device ID, | ||
38 | Class, Class Mask, and Private Driver Data. The Vendor ID | ||
39 | and Device ID fields are required, the rest are optional. | ||
40 | Upon successfully adding an ID, the driver will probe | ||
41 | for the device and attempt to bind to it. For example: | ||
42 | # echo "8086 10f5" > /sys/bus/pci/drivers/foo/new_id | ||
43 | |||
1 | What: /sys/bus/pci/devices/.../vpd | 44 | What: /sys/bus/pci/devices/.../vpd |
2 | Date: February 2008 | 45 | Date: February 2008 |
3 | Contact: Ben Hutchings <bhutchings@solarflare.com> | 46 | Contact: Ben Hutchings <bhutchings@solarflare.com> |
diff --git a/Documentation/dvb/README.flexcop b/Documentation/dvb/README.flexcop deleted file mode 100644 index 5515469de7cf..000000000000 --- a/Documentation/dvb/README.flexcop +++ /dev/null | |||
@@ -1,205 +0,0 @@ | |||
1 | This README escorted the skystar2-driver rewriting procedure. It describes the | ||
2 | state of the new flexcop-driver set and some internals are written down here | ||
3 | too. | ||
4 | |||
5 | This document hopefully describes things about the flexcop and its | ||
6 | device-offsprings. Goal was to write an easy-to-write and easy-to-read set of | ||
7 | drivers based on the skystar2.c and other information. | ||
8 | |||
9 | Remark: flexcop-pci.c was a copy of skystar2.c, but every line has been | ||
10 | touched and rewritten. | ||
11 | |||
12 | History & News | ||
13 | ============== | ||
14 | 2005-04-01 - correct USB ISOC transfers (thanks to Vadim Catana) | ||
15 | |||
16 | |||
17 | |||
18 | |||
19 | General coding processing | ||
20 | ========================= | ||
21 | |||
22 | We should proceed as follows (as long as no one complains): | ||
23 | |||
24 | 0) Think before start writing code! | ||
25 | |||
26 | 1) rewriting the skystar2.c with the help of the flexcop register descriptions | ||
27 | and splitting up the files to a pci-bus-part and a flexcop-part. | ||
28 | The new driver will be called b2c2-flexcop-pci.ko/b2c2-flexcop-usb.ko for the | ||
29 | device-specific part and b2c2-flexcop.ko for the common flexcop-functions. | ||
30 | |||
31 | 2) Search for errors in the leftover of flexcop-pci.c (compare with pluto2.c | ||
32 | and other pci drivers) | ||
33 | |||
34 | 3) make some beautification (see 'Improvements when rewriting (refactoring) is | ||
35 | done') | ||
36 | |||
37 | 4) Testing the new driver and maybe substitute the skystar2.c with it, to reach | ||
38 | a wider tester audience. | ||
39 | |||
40 | 5) creating an usb-bus-part using the already written flexcop code for the pci | ||
41 | card. | ||
42 | |||
43 | Idea: create a kernel-object for the flexcop and export all important | ||
44 | functions. This option saves kernel-memory, but maybe a lot of functions have | ||
45 | to be exported to kernel namespace. | ||
46 | |||
47 | |||
48 | Current situation | ||
49 | ================= | ||
50 | |||
51 | 0) Done :) | ||
52 | 1) Done (some minor issues left) | ||
53 | 2) Done | ||
54 | 3) Not ready yet, more information is necessary | ||
55 | 4) next to be done (see the table below) | ||
56 | 5) USB driver is working (yes, there are some minor issues) | ||
57 | |||
58 | What seems to be ready? | ||
59 | ----------------------- | ||
60 | |||
61 | 1) Rewriting | ||
62 | 1a) i2c is cut off from the flexcop-pci.c and seems to work | ||
63 | 1b) moved tuner and demod stuff from flexcop-pci.c to flexcop-tuner-fe.c | ||
64 | 1c) moved lnb and diseqc stuff from flexcop-pci.c to flexcop-tuner-fe.c | ||
65 | 1e) eeprom (reading MAC address) | ||
66 | 1d) sram (no dynamic sll size detection (commented out) (using default as JJ told me)) | ||
67 | 1f) misc. register accesses for reading parameters (e.g. resetting, revision) | ||
68 | 1g) pid/mac filter (flexcop-hw-filter.c) | ||
69 | 1i) dvb-stuff initialization in flexcop.c (done) | ||
70 | 1h) dma stuff (now just using the size-irq, instead of all-together, to be done) | ||
71 | 1j) remove flexcop initialization from flexcop-pci.c completely (done) | ||
72 | 1l) use a well working dma IRQ method (done, see 'Known bugs and problems and TODO') | ||
73 | 1k) cleanup flexcop-files (remove unused EXPORT_SYMBOLs, make static from | ||
74 | non-static where possible, moved code to proper places) | ||
75 | |||
76 | 2) Search for errors in the leftover of flexcop-pci.c (partially done) | ||
77 | 5a) add MAC address reading | ||
78 | 5c) feeding of ISOC data to the software demux (format of the isochronous data | ||
79 | and speed optimization, no real error) (thanks to Vadim Catana) | ||
80 | |||
81 | What to do in the near future? | ||
82 | -------------------------------------- | ||
83 | (no special order here) | ||
84 | |||
85 | 5) USB driver | ||
86 | 5b) optimize isoc-transfer (submitting/killing isoc URBs when transfer is starting) | ||
87 | |||
88 | Testing changes | ||
89 | --------------- | ||
90 | |||
91 | O = item is working | ||
92 | P = item is partially working | ||
93 | X = item is not working | ||
94 | N = item does not apply here | ||
95 | <empty field> = item need to be examined | ||
96 | |||
97 | | PCI | USB | ||
98 | item | mt352 | nxt2002 | stv0299 | mt312 | mt352 | nxt2002 | stv0299 | mt312 | ||
99 | -------+-------+---------+---------+-------+-------+---------+---------+------- | ||
100 | 1a) | O | | | | N | N | N | N | ||
101 | 1b) | O | | | | | | O | | ||
102 | 1c) | N | N | | | N | N | O | | ||
103 | 1d) | O | O | ||
104 | 1e) | O | O | ||
105 | 1f) | P | ||
106 | 1g) | O | ||
107 | 1h) | P | | ||
108 | 1i) | O | N | ||
109 | 1j) | O | N | ||
110 | 1l) | O | N | ||
111 | 2) | O | N | ||
112 | 5a) | N | O | ||
113 | 5b)* | N | | ||
114 | 5c) | N | O | ||
115 | |||
116 | * - not done yet | ||
117 | |||
118 | Known bugs and problems and TODO | ||
119 | -------------------------------- | ||
120 | |||
121 | 1g/h/l) when pid filtering is enabled on the pci card | ||
122 | |||
123 | DMA usage currently: | ||
124 | The DMA is splitted in 2 equal-sized subbuffers. The Flexcop writes to first | ||
125 | address and triggers an IRQ when it's full and starts writing to the second | ||
126 | address. When the second address is full, the IRQ is triggered again, and | ||
127 | the flexcop writes to first address again, and so on. | ||
128 | The buffersize of each address is currently 640*188 bytes. | ||
129 | |||
130 | Problem is, when using hw-pid-filtering and doing some low-bandwidth | ||
131 | operation (like scanning) the buffers won't be filled enough to trigger | ||
132 | the IRQ. That's why: | ||
133 | |||
134 | When PID filtering is activated, the timer IRQ is used. Every 1.97 ms the IRQ | ||
135 | is triggered. Is the current write address of DMA1 different to the one | ||
136 | during the last IRQ, then the data is passed to the demuxer. | ||
137 | |||
138 | There is an additional DMA-IRQ-method: packet count IRQ. This isn't | ||
139 | implemented correctly yet. | ||
140 | |||
141 | The solution is to disable HW PID filtering, but I don't know how the DVB | ||
142 | API software demux behaves on slow systems with 45MBit/s TS. | ||
143 | |||
144 | Solved bugs :) | ||
145 | -------------- | ||
146 | 1g) pid-filtering (somehow pid index 4 and 5 (EMM_PID and ECM_PID) aren't | ||
147 | working) | ||
148 | SOLUTION: also index 0 was affected, because net_translation is done for | ||
149 | these indexes by default | ||
150 | |||
151 | 5b) isochronous transfer does only work in the first attempt (for the Sky2PC | ||
152 | USB, Air2PC is working) SOLUTION: the flexcop was going asleep and never really | ||
153 | woke up again (don't know if this need fixes, see | ||
154 | flexcop-fe-tuner.c:flexcop_sleep) | ||
155 | |||
156 | NEWS: when the driver is loaded and unloaded and loaded again (w/o doing | ||
157 | anything in the while the driver is loaded the first time), no transfers take | ||
158 | place anymore. | ||
159 | |||
160 | Improvements when rewriting (refactoring) is done | ||
161 | ================================================= | ||
162 | |||
163 | - split sleeping of the flexcop (misc_204.ACPI3_sig = 1;) from lnb_control | ||
164 | (enable sleeping for other demods than dvb-s) | ||
165 | - add support for CableStar (stv0297 Microtune 203x/ALPS) (almost done, incompatibilities with the Nexus-CA) | ||
166 | |||
167 | Debugging | ||
168 | --------- | ||
169 | - add verbose debugging to skystar2.c (dump the reg_dw_data) and compare it | ||
170 | with this flexcop, this is important, because i2c is now using the | ||
171 | flexcop_ibi_value union from flexcop-reg.h (do you have a better idea for | ||
172 | that, please tell us so). | ||
173 | |||
174 | Everything which is identical in the following table, can be put into a common | ||
175 | flexcop-module. | ||
176 | |||
177 | PCI USB | ||
178 | ------------------------------------------------------------------------------- | ||
179 | Different: | ||
180 | Register access: accessing IO memory USB control message | ||
181 | I2C bus: I2C bus of the FC USB control message | ||
182 | Data transfer: DMA isochronous transfer | ||
183 | EEPROM transfer: through i2c bus not clear yet | ||
184 | |||
185 | Identical: | ||
186 | Streaming: accessing registers | ||
187 | PID Filtering: accessing registers | ||
188 | Sram destinations: accessing registers | ||
189 | Tuner/Demod: I2C bus | ||
190 | DVB-stuff: can be written for common use | ||
191 | |||
192 | Acknowledgements (just for the rewriting part) | ||
193 | ================ | ||
194 | |||
195 | Bjarne Steinsbo thought a lot in the first place of the pci part for this code | ||
196 | sharing idea. | ||
197 | |||
198 | Andreas Oberritter for providing a recent PCI initialization template | ||
199 | (pluto2.c). | ||
200 | |||
201 | Boleslaw Ciesielski for pointing out a problem with firmware loader. | ||
202 | |||
203 | Vadim Catana for correcting the USB transfer. | ||
204 | |||
205 | comments, critics and ideas to linux-dvb@linuxtv.org. | ||
diff --git a/Documentation/dvb/technisat.txt b/Documentation/dvb/technisat.txt index cdf6ee4b2da1..3f435ffb289c 100644 --- a/Documentation/dvb/technisat.txt +++ b/Documentation/dvb/technisat.txt | |||
@@ -1,5 +1,5 @@ | |||
1 | How to set up the Technisat devices | 1 | How to set up the Technisat/B2C2 Flexcop devices |
2 | =================================== | 2 | ================================================ |
3 | 3 | ||
4 | 1) Find out what device you have | 4 | 1) Find out what device you have |
5 | ================================ | 5 | ================================ |
@@ -16,54 +16,60 @@ DVB: registering frontend 0 (Conexant CX24123/CX24109)... | |||
16 | 16 | ||
17 | If the Technisat is the only TV device in your box get rid of unnecessary modules and check this one: | 17 | If the Technisat is the only TV device in your box get rid of unnecessary modules and check this one: |
18 | "Multimedia devices" => "Customise analog and hybrid tuner modules to build" | 18 | "Multimedia devices" => "Customise analog and hybrid tuner modules to build" |
19 | In this directory uncheck every driver which is activated there. | 19 | In this directory uncheck every driver which is activated there (except "Simple tuner support" for case 9 only). |
20 | 20 | ||
21 | Then please activate: | 21 | Then please activate: |
22 | 2a) Main module part: | 22 | 2a) Main module part: |
23 | 23 | ||
24 | a.)"Multimedia devices" => "DVB/ATSC adapters" => "Technisat/B2C2 FlexcopII(b) and FlexCopIII adapters" | 24 | a.)"Multimedia devices" => "DVB/ATSC adapters" => "Technisat/B2C2 FlexcopII(b) and FlexCopIII adapters" |
25 | b.)"Multimedia devices" => "DVB/ATSC adapters" => "Technisat/B2C2 FlexcopII(b) and FlexCopIII adapters" => "Technisat/B2C2 Air/Sky/Cable2PC PCI" in case of a PCI card OR | 25 | b.)"Multimedia devices" => "DVB/ATSC adapters" => "Technisat/B2C2 FlexcopII(b) and FlexCopIII adapters" => "Technisat/B2C2 Air/Sky/Cable2PC PCI" in case of a PCI card |
26 | OR | ||
26 | c.)"Multimedia devices" => "DVB/ATSC adapters" => "Technisat/B2C2 FlexcopII(b) and FlexCopIII adapters" => "Technisat/B2C2 Air/Sky/Cable2PC USB" in case of an USB 1.1 adapter | 27 | c.)"Multimedia devices" => "DVB/ATSC adapters" => "Technisat/B2C2 FlexcopII(b) and FlexCopIII adapters" => "Technisat/B2C2 Air/Sky/Cable2PC USB" in case of an USB 1.1 adapter |
27 | d.)"Multimedia devices" => "DVB/ATSC adapters" => "Technisat/B2C2 FlexcopII(b) and FlexCopIII adapters" => "Enable debug for the B2C2 FlexCop drivers" | 28 | d.)"Multimedia devices" => "DVB/ATSC adapters" => "Technisat/B2C2 FlexcopII(b) and FlexCopIII adapters" => "Enable debug for the B2C2 FlexCop drivers" |
28 | Notice: d.) is helpful for troubleshooting | 29 | Notice: d.) is helpful for troubleshooting |
29 | 30 | ||
30 | 2b) Frontend module part: | 31 | 2b) Frontend module part: |
31 | 32 | ||
32 | 1.) Revision 2.3: | 33 | 1.) SkyStar DVB-S Revision 2.3: |
33 | a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build" | 34 | a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build" |
34 | b.)"Multimedia devices" => "Customise DVB frontends" => "Zarlink VP310/MT312/ZL10313 based" | 35 | b.)"Multimedia devices" => "Customise DVB frontends" => "Zarlink VP310/MT312/ZL10313 based" |
35 | 36 | ||
36 | 2.) Revision 2.6: | 37 | 2.) SkyStar DVB-S Revision 2.6: |
37 | a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build" | 38 | a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build" |
38 | b.)"Multimedia devices" => "Customise DVB frontends" => "ST STV0299 based" | 39 | b.)"Multimedia devices" => "Customise DVB frontends" => "ST STV0299 based" |
39 | 40 | ||
40 | 3.) Revision 2.7: | 41 | 3.) SkyStar DVB-S Revision 2.7: |
41 | a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build" | 42 | a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build" |
42 | b.)"Multimedia devices" => "Customise DVB frontends" => "Samsung S5H1420 based" | 43 | b.)"Multimedia devices" => "Customise DVB frontends" => "Samsung S5H1420 based" |
43 | c.)"Multimedia devices" => "Customise DVB frontends" => "Integrant ITD1000 Zero IF tuner for DVB-S/DSS" | 44 | c.)"Multimedia devices" => "Customise DVB frontends" => "Integrant ITD1000 Zero IF tuner for DVB-S/DSS" |
44 | d.)"Multimedia devices" => "Customise DVB frontends" => "ISL6421 SEC controller" | 45 | d.)"Multimedia devices" => "Customise DVB frontends" => "ISL6421 SEC controller" |
45 | 46 | ||
46 | 4.) Revision 2.8: | 47 | 4.) SkyStar DVB-S Revision 2.8: |
47 | a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build" | 48 | a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build" |
48 | b.)"Multimedia devices" => "Customise DVB frontends" => "Conexant CX24113/CX24128 tuner for DVB-S/DSS" | 49 | b.)"Multimedia devices" => "Customise DVB frontends" => "Conexant CX24113/CX24128 tuner for DVB-S/DSS" |
49 | c.)"Multimedia devices" => "Customise DVB frontends" => "Conexant CX24123 based" | 50 | c.)"Multimedia devices" => "Customise DVB frontends" => "Conexant CX24123 based" |
50 | d.)"Multimedia devices" => "Customise DVB frontends" => "ISL6421 SEC controller" | 51 | d.)"Multimedia devices" => "Customise DVB frontends" => "ISL6421 SEC controller" |
51 | 52 | ||
52 | 5.) DVB-T card: | 53 | 5.) AirStar DVB-T card: |
53 | a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build" | 54 | a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build" |
54 | b.)"Multimedia devices" => "Customise DVB frontends" => "Zarlink MT352 based" | 55 | b.)"Multimedia devices" => "Customise DVB frontends" => "Zarlink MT352 based" |
55 | 56 | ||
56 | 6.) DVB-C card: | 57 | 6.) CableStar DVB-C card: |
57 | a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build" | 58 | a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build" |
58 | b.)"Multimedia devices" => "Customise DVB frontends" => "ST STV0297 based" | 59 | b.)"Multimedia devices" => "Customise DVB frontends" => "ST STV0297 based" |
59 | 60 | ||
60 | 7.) ATSC card 1st generation: | 61 | 7.) AirStar ATSC card 1st generation: |
61 | a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build" | 62 | a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build" |
62 | b.)"Multimedia devices" => "Customise DVB frontends" => "Broadcom BCM3510" | 63 | b.)"Multimedia devices" => "Customise DVB frontends" => "Broadcom BCM3510" |
63 | 64 | ||
64 | 8.) ATSC card 2nd generation: | 65 | 8.) AirStar ATSC card 2nd generation: |
65 | a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build" | 66 | a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build" |
66 | b.)"Multimedia devices" => "Customise DVB frontends" => "NxtWave Communications NXT2002/NXT2004 based" | 67 | b.)"Multimedia devices" => "Customise DVB frontends" => "NxtWave Communications NXT2002/NXT2004 based" |
67 | c.)"Multimedia devices" => "Customise DVB frontends" => "LG Electronics LGDT3302/LGDT3303 based" | 68 | c.)"Multimedia devices" => "Customise DVB frontends" => "Generic I2C PLL based tuners" |
68 | 69 | ||
69 | Author: Uwe Bugla <uwe.bugla@gmx.de> December 2008 | 70 | 9.) AirStar ATSC card 3rd generation: |
71 | a.)"Multimedia devices" => "Customise DVB frontends" => "Customise the frontend modules to build" | ||
72 | b.)"Multimedia devices" => "Customise DVB frontends" => "LG Electronics LGDT3302/LGDT3303 based" | ||
73 | c.)"Multimedia devices" => "Customise analog and hybrid tuner modules to build" => "Simple tuner support" | ||
74 | |||
75 | Author: Uwe Bugla <uwe.bugla@gmx.de> February 2009 | ||
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 4d7e001ec39d..d1cb2069e2f4 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
@@ -115,7 +115,7 @@ In addition, the following text indicates that the option: | |||
115 | Parameters denoted with BOOT are actually interpreted by the boot | 115 | Parameters denoted with BOOT are actually interpreted by the boot |
116 | loader, and have no meaning to the kernel directly. | 116 | loader, and have no meaning to the kernel directly. |
117 | Do not modify the syntax of boot loader parameters without extreme | 117 | Do not modify the syntax of boot loader parameters without extreme |
118 | need or coordination with <Documentation/x86/i386/boot.txt>. | 118 | need or coordination with <Documentation/x86/boot.txt>. |
119 | 119 | ||
120 | There are also arch-specific kernel-parameters not documented here. | 120 | There are also arch-specific kernel-parameters not documented here. |
121 | See for example <Documentation/x86/x86_64/boot-options.txt>. | 121 | See for example <Documentation/x86/x86_64/boot-options.txt>. |
@@ -2461,7 +2461,7 @@ and is between 256 and 4096 characters. It is defined in the file | |||
2461 | See Documentation/fb/modedb.txt. | 2461 | See Documentation/fb/modedb.txt. |
2462 | 2462 | ||
2463 | vga= [BOOT,X86-32] Select a particular video mode | 2463 | vga= [BOOT,X86-32] Select a particular video mode |
2464 | See Documentation/x86/i386/boot.txt and | 2464 | See Documentation/x86/boot.txt and |
2465 | Documentation/svga.txt. | 2465 | Documentation/svga.txt. |
2466 | Use vga=ask for menu. | 2466 | Use vga=ask for menu. |
2467 | This is actually a boot loader parameter; the value is | 2467 | This is actually a boot loader parameter; the value is |
diff --git a/arch/arm/mach-davinci/board-evm.c b/arch/arm/mach-davinci/board-evm.c index a957d239a683..38b6a9ce2a93 100644 --- a/arch/arm/mach-davinci/board-evm.c +++ b/arch/arm/mach-davinci/board-evm.c | |||
@@ -311,6 +311,9 @@ evm_u35_setup(struct i2c_client *client, int gpio, unsigned ngpio, void *c) | |||
311 | gpio_request(gpio + 7, "nCF_SEL"); | 311 | gpio_request(gpio + 7, "nCF_SEL"); |
312 | gpio_direction_output(gpio + 7, 1); | 312 | gpio_direction_output(gpio + 7, 1); |
313 | 313 | ||
314 | /* irlml6401 sustains over 3A, switches 5V in under 8 msec */ | ||
315 | setup_usb(500, 8); | ||
316 | |||
314 | return 0; | 317 | return 0; |
315 | } | 318 | } |
316 | 319 | ||
@@ -417,9 +420,6 @@ static __init void davinci_evm_init(void) | |||
417 | platform_add_devices(davinci_evm_devices, | 420 | platform_add_devices(davinci_evm_devices, |
418 | ARRAY_SIZE(davinci_evm_devices)); | 421 | ARRAY_SIZE(davinci_evm_devices)); |
419 | evm_init_i2c(); | 422 | evm_init_i2c(); |
420 | |||
421 | /* irlml6401 sustains over 3A, switches 5V in under 8 msec */ | ||
422 | setup_usb(500, 8); | ||
423 | } | 423 | } |
424 | 424 | ||
425 | static __init void davinci_evm_irq_init(void) | 425 | static __init void davinci_evm_irq_init(void) |
diff --git a/arch/arm/mach-davinci/clock.c b/arch/arm/mach-davinci/clock.c index 28f6dbc95bd7..abb92b7eca0c 100644 --- a/arch/arm/mach-davinci/clock.c +++ b/arch/arm/mach-davinci/clock.c | |||
@@ -231,6 +231,11 @@ static struct clk davinci_clks[] = { | |||
231 | .lpsc = DAVINCI_LPSC_GPIO, | 231 | .lpsc = DAVINCI_LPSC_GPIO, |
232 | }, | 232 | }, |
233 | { | 233 | { |
234 | .name = "usb", | ||
235 | .rate = &commonrate, | ||
236 | .lpsc = DAVINCI_LPSC_USB, | ||
237 | }, | ||
238 | { | ||
234 | .name = "AEMIFCLK", | 239 | .name = "AEMIFCLK", |
235 | .rate = &commonrate, | 240 | .rate = &commonrate, |
236 | .lpsc = DAVINCI_LPSC_AEMIF, | 241 | .lpsc = DAVINCI_LPSC_AEMIF, |
diff --git a/arch/arm/mach-davinci/usb.c b/arch/arm/mach-davinci/usb.c index 867ead2559ad..69680784448a 100644 --- a/arch/arm/mach-davinci/usb.c +++ b/arch/arm/mach-davinci/usb.c | |||
@@ -47,6 +47,7 @@ static struct musb_hdrc_platform_data usb_data = { | |||
47 | #elif defined(CONFIG_USB_MUSB_HOST) | 47 | #elif defined(CONFIG_USB_MUSB_HOST) |
48 | .mode = MUSB_HOST, | 48 | .mode = MUSB_HOST, |
49 | #endif | 49 | #endif |
50 | .clock = "usb", | ||
50 | .config = &musb_config, | 51 | .config = &musb_config, |
51 | }; | 52 | }; |
52 | 53 | ||
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index 600eef3f3ac7..e61465a18c7e 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig | |||
@@ -603,7 +603,7 @@ config CAVIUM_OCTEON_SIMULATOR | |||
603 | select SYS_SUPPORTS_64BIT_KERNEL | 603 | select SYS_SUPPORTS_64BIT_KERNEL |
604 | select SYS_SUPPORTS_BIG_ENDIAN | 604 | select SYS_SUPPORTS_BIG_ENDIAN |
605 | select SYS_SUPPORTS_HIGHMEM | 605 | select SYS_SUPPORTS_HIGHMEM |
606 | select CPU_CAVIUM_OCTEON | 606 | select SYS_HAS_CPU_CAVIUM_OCTEON |
607 | help | 607 | help |
608 | The Octeon simulator is software performance model of the Cavium | 608 | The Octeon simulator is software performance model of the Cavium |
609 | Octeon Processor. It supports simulating Octeon processors on x86 | 609 | Octeon Processor. It supports simulating Octeon processors on x86 |
@@ -618,7 +618,7 @@ config CAVIUM_OCTEON_REFERENCE_BOARD | |||
618 | select SYS_SUPPORTS_BIG_ENDIAN | 618 | select SYS_SUPPORTS_BIG_ENDIAN |
619 | select SYS_SUPPORTS_HIGHMEM | 619 | select SYS_SUPPORTS_HIGHMEM |
620 | select SYS_HAS_EARLY_PRINTK | 620 | select SYS_HAS_EARLY_PRINTK |
621 | select CPU_CAVIUM_OCTEON | 621 | select SYS_HAS_CPU_CAVIUM_OCTEON |
622 | select SWAP_IO_SPACE | 622 | select SWAP_IO_SPACE |
623 | help | 623 | help |
624 | This option supports all of the Octeon reference boards from Cavium | 624 | This option supports all of the Octeon reference boards from Cavium |
@@ -1234,6 +1234,7 @@ config CPU_SB1 | |||
1234 | 1234 | ||
1235 | config CPU_CAVIUM_OCTEON | 1235 | config CPU_CAVIUM_OCTEON |
1236 | bool "Cavium Octeon processor" | 1236 | bool "Cavium Octeon processor" |
1237 | depends on SYS_HAS_CPU_CAVIUM_OCTEON | ||
1237 | select IRQ_CPU | 1238 | select IRQ_CPU |
1238 | select IRQ_CPU_OCTEON | 1239 | select IRQ_CPU_OCTEON |
1239 | select CPU_HAS_PREFETCH | 1240 | select CPU_HAS_PREFETCH |
@@ -1314,6 +1315,9 @@ config SYS_HAS_CPU_RM9000 | |||
1314 | config SYS_HAS_CPU_SB1 | 1315 | config SYS_HAS_CPU_SB1 |
1315 | bool | 1316 | bool |
1316 | 1317 | ||
1318 | config SYS_HAS_CPU_CAVIUM_OCTEON | ||
1319 | bool | ||
1320 | |||
1317 | # | 1321 | # |
1318 | # CPU may reorder R->R, R->W, W->R, W->W | 1322 | # CPU may reorder R->R, R->W, W->R, W->W |
1319 | # Reordering beyond LL and SC is handled in WEAK_REORDERING_BEYOND_LLSC | 1323 | # Reordering beyond LL and SC is handled in WEAK_REORDERING_BEYOND_LLSC |
@@ -1387,6 +1391,7 @@ config 32BIT | |||
1387 | config 64BIT | 1391 | config 64BIT |
1388 | bool "64-bit kernel" | 1392 | bool "64-bit kernel" |
1389 | depends on CPU_SUPPORTS_64BIT_KERNEL && SYS_SUPPORTS_64BIT_KERNEL | 1393 | depends on CPU_SUPPORTS_64BIT_KERNEL && SYS_SUPPORTS_64BIT_KERNEL |
1394 | select HAVE_SYSCALL_WRAPPERS | ||
1390 | help | 1395 | help |
1391 | Select this option if you want to build a 64-bit kernel. | 1396 | Select this option if you want to build a 64-bit kernel. |
1392 | 1397 | ||
diff --git a/arch/mips/alchemy/common/time.c b/arch/mips/alchemy/common/time.c index 6fd441d16af5..f58d4ffb8945 100644 --- a/arch/mips/alchemy/common/time.c +++ b/arch/mips/alchemy/common/time.c | |||
@@ -118,7 +118,7 @@ void __init plat_time_init(void) | |||
118 | * setup counter 1 (RTC) to tick at full speed | 118 | * setup counter 1 (RTC) to tick at full speed |
119 | */ | 119 | */ |
120 | t = 0xffffff; | 120 | t = 0xffffff; |
121 | while ((au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_T1S) && t--) | 121 | while ((au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_T1S) && --t) |
122 | asm volatile ("nop"); | 122 | asm volatile ("nop"); |
123 | if (!t) | 123 | if (!t) |
124 | goto cntr_err; | 124 | goto cntr_err; |
@@ -127,7 +127,7 @@ void __init plat_time_init(void) | |||
127 | au_sync(); | 127 | au_sync(); |
128 | 128 | ||
129 | t = 0xffffff; | 129 | t = 0xffffff; |
130 | while ((au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C1S) && t--) | 130 | while ((au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C1S) && --t) |
131 | asm volatile ("nop"); | 131 | asm volatile ("nop"); |
132 | if (!t) | 132 | if (!t) |
133 | goto cntr_err; | 133 | goto cntr_err; |
@@ -135,7 +135,7 @@ void __init plat_time_init(void) | |||
135 | au_sync(); | 135 | au_sync(); |
136 | 136 | ||
137 | t = 0xffffff; | 137 | t = 0xffffff; |
138 | while ((au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C1S) && t--) | 138 | while ((au_readl(SYS_COUNTER_CNTRL) & SYS_CNTRL_C1S) && --t) |
139 | asm volatile ("nop"); | 139 | asm volatile ("nop"); |
140 | if (!t) | 140 | if (!t) |
141 | goto cntr_err; | 141 | goto cntr_err; |
diff --git a/arch/mips/kernel/irq.c b/arch/mips/kernel/irq.c index a0ff2b66e22b..4b4007b3083a 100644 --- a/arch/mips/kernel/irq.c +++ b/arch/mips/kernel/irq.c | |||
@@ -111,7 +111,6 @@ int show_interrupts(struct seq_file *p, void *v) | |||
111 | seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]); | 111 | seq_printf(p, "%10u ", kstat_cpu(j).irqs[i]); |
112 | #endif | 112 | #endif |
113 | seq_printf(p, " %14s", irq_desc[i].chip->name); | 113 | seq_printf(p, " %14s", irq_desc[i].chip->name); |
114 | seq_printf(p, "-%-8s", irq_desc[i].name); | ||
115 | seq_printf(p, " %s", action->name); | 114 | seq_printf(p, " %s", action->name); |
116 | 115 | ||
117 | for (action=action->next; action; action = action->next) | 116 | for (action=action->next; action; action = action->next) |
diff --git a/arch/mips/kernel/linux32.c b/arch/mips/kernel/linux32.c index aa2c55e3b55f..2f8452b404c7 100644 --- a/arch/mips/kernel/linux32.c +++ b/arch/mips/kernel/linux32.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include <linux/module.h> | 32 | #include <linux/module.h> |
33 | #include <linux/binfmts.h> | 33 | #include <linux/binfmts.h> |
34 | #include <linux/security.h> | 34 | #include <linux/security.h> |
35 | #include <linux/syscalls.h> | ||
35 | #include <linux/compat.h> | 36 | #include <linux/compat.h> |
36 | #include <linux/vfs.h> | 37 | #include <linux/vfs.h> |
37 | #include <linux/ipc.h> | 38 | #include <linux/ipc.h> |
@@ -63,9 +64,9 @@ | |||
63 | #define merge_64(r1, r2) ((((r2) & 0xffffffffUL) << 32) + ((r1) & 0xffffffffUL)) | 64 | #define merge_64(r1, r2) ((((r2) & 0xffffffffUL) << 32) + ((r1) & 0xffffffffUL)) |
64 | #endif | 65 | #endif |
65 | 66 | ||
66 | asmlinkage unsigned long | 67 | SYSCALL_DEFINE6(32_mmap2, unsigned long, addr, unsigned long, len, |
67 | sys32_mmap2(unsigned long addr, unsigned long len, unsigned long prot, | 68 | unsigned long, prot, unsigned long, flags, unsigned long, fd, |
68 | unsigned long flags, unsigned long fd, unsigned long pgoff) | 69 | unsigned long, pgoff) |
69 | { | 70 | { |
70 | struct file * file = NULL; | 71 | struct file * file = NULL; |
71 | unsigned long error; | 72 | unsigned long error; |
@@ -121,21 +122,21 @@ struct rlimit32 { | |||
121 | int rlim_max; | 122 | int rlim_max; |
122 | }; | 123 | }; |
123 | 124 | ||
124 | asmlinkage long sys32_truncate64(const char __user * path, | 125 | SYSCALL_DEFINE4(32_truncate64, const char __user *, path, |
125 | unsigned long __dummy, int a2, int a3) | 126 | unsigned long, __dummy, unsigned long, a2, unsigned long, a3) |
126 | { | 127 | { |
127 | return sys_truncate(path, merge_64(a2, a3)); | 128 | return sys_truncate(path, merge_64(a2, a3)); |
128 | } | 129 | } |
129 | 130 | ||
130 | asmlinkage long sys32_ftruncate64(unsigned int fd, unsigned long __dummy, | 131 | SYSCALL_DEFINE4(32_ftruncate64, unsigned long, fd, unsigned long, __dummy, |
131 | int a2, int a3) | 132 | unsigned long, a2, unsigned long, a3) |
132 | { | 133 | { |
133 | return sys_ftruncate(fd, merge_64(a2, a3)); | 134 | return sys_ftruncate(fd, merge_64(a2, a3)); |
134 | } | 135 | } |
135 | 136 | ||
136 | asmlinkage int sys32_llseek(unsigned int fd, unsigned int offset_high, | 137 | SYSCALL_DEFINE5(32_llseek, unsigned long, fd, unsigned long, offset_high, |
137 | unsigned int offset_low, loff_t __user * result, | 138 | unsigned long, offset_low, loff_t __user *, result, |
138 | unsigned int origin) | 139 | unsigned long, origin) |
139 | { | 140 | { |
140 | return sys_llseek(fd, offset_high, offset_low, result, origin); | 141 | return sys_llseek(fd, offset_high, offset_low, result, origin); |
141 | } | 142 | } |
@@ -144,20 +145,20 @@ asmlinkage int sys32_llseek(unsigned int fd, unsigned int offset_high, | |||
144 | lseek back to original location. They fail just like lseek does on | 145 | lseek back to original location. They fail just like lseek does on |
145 | non-seekable files. */ | 146 | non-seekable files. */ |
146 | 147 | ||
147 | asmlinkage ssize_t sys32_pread(unsigned int fd, char __user * buf, | 148 | SYSCALL_DEFINE6(32_pread, unsigned long, fd, char __user *, buf, size_t, count, |
148 | size_t count, u32 unused, u64 a4, u64 a5) | 149 | unsigned long, unused, unsigned long, a4, unsigned long, a5) |
149 | { | 150 | { |
150 | return sys_pread64(fd, buf, count, merge_64(a4, a5)); | 151 | return sys_pread64(fd, buf, count, merge_64(a4, a5)); |
151 | } | 152 | } |
152 | 153 | ||
153 | asmlinkage ssize_t sys32_pwrite(unsigned int fd, const char __user * buf, | 154 | SYSCALL_DEFINE6(32_pwrite, unsigned int, fd, const char __user *, buf, |
154 | size_t count, u32 unused, u64 a4, u64 a5) | 155 | size_t, count, u32, unused, u64, a4, u64, a5) |
155 | { | 156 | { |
156 | return sys_pwrite64(fd, buf, count, merge_64(a4, a5)); | 157 | return sys_pwrite64(fd, buf, count, merge_64(a4, a5)); |
157 | } | 158 | } |
158 | 159 | ||
159 | asmlinkage int sys32_sched_rr_get_interval(compat_pid_t pid, | 160 | SYSCALL_DEFINE2(32_sched_rr_get_interval, compat_pid_t, pid, |
160 | struct compat_timespec __user *interval) | 161 | struct compat_timespec __user *, interval) |
161 | { | 162 | { |
162 | struct timespec t; | 163 | struct timespec t; |
163 | int ret; | 164 | int ret; |
@@ -174,8 +175,8 @@ asmlinkage int sys32_sched_rr_get_interval(compat_pid_t pid, | |||
174 | 175 | ||
175 | #ifdef CONFIG_SYSVIPC | 176 | #ifdef CONFIG_SYSVIPC |
176 | 177 | ||
177 | asmlinkage long | 178 | SYSCALL_DEFINE6(32_ipc, u32, call, long, first, long, second, long, third, |
178 | sys32_ipc(u32 call, int first, int second, int third, u32 ptr, u32 fifth) | 179 | unsigned long, ptr, unsigned long, fifth) |
179 | { | 180 | { |
180 | int version, err; | 181 | int version, err; |
181 | 182 | ||
@@ -233,8 +234,8 @@ sys32_ipc(u32 call, int first, int second, int third, u32 ptr, u32 fifth) | |||
233 | 234 | ||
234 | #else | 235 | #else |
235 | 236 | ||
236 | asmlinkage long | 237 | SYSCALL_DEFINE6(32_ipc, u32, call, int, first, int, second, int, third, |
237 | sys32_ipc(u32 call, int first, int second, int third, u32 ptr, u32 fifth) | 238 | u32, ptr, u32 fifth) |
238 | { | 239 | { |
239 | return -ENOSYS; | 240 | return -ENOSYS; |
240 | } | 241 | } |
@@ -242,7 +243,7 @@ sys32_ipc(u32 call, int first, int second, int third, u32 ptr, u32 fifth) | |||
242 | #endif /* CONFIG_SYSVIPC */ | 243 | #endif /* CONFIG_SYSVIPC */ |
243 | 244 | ||
244 | #ifdef CONFIG_MIPS32_N32 | 245 | #ifdef CONFIG_MIPS32_N32 |
245 | asmlinkage long sysn32_semctl(int semid, int semnum, int cmd, u32 arg) | 246 | SYSCALL_DEFINE4(n32_semctl, int, semid, int, semnum, int, cmd, u32, arg) |
246 | { | 247 | { |
247 | /* compat_sys_semctl expects a pointer to union semun */ | 248 | /* compat_sys_semctl expects a pointer to union semun */ |
248 | u32 __user *uptr = compat_alloc_user_space(sizeof(u32)); | 249 | u32 __user *uptr = compat_alloc_user_space(sizeof(u32)); |
@@ -251,13 +252,14 @@ asmlinkage long sysn32_semctl(int semid, int semnum, int cmd, u32 arg) | |||
251 | return compat_sys_semctl(semid, semnum, cmd, uptr); | 252 | return compat_sys_semctl(semid, semnum, cmd, uptr); |
252 | } | 253 | } |
253 | 254 | ||
254 | asmlinkage long sysn32_msgsnd(int msqid, u32 msgp, unsigned msgsz, int msgflg) | 255 | SYSCALL_DEFINE4(n32_msgsnd, int, msqid, u32, msgp, unsigned int, msgsz, |
256 | int, msgflg) | ||
255 | { | 257 | { |
256 | return compat_sys_msgsnd(msqid, msgsz, msgflg, compat_ptr(msgp)); | 258 | return compat_sys_msgsnd(msqid, msgsz, msgflg, compat_ptr(msgp)); |
257 | } | 259 | } |
258 | 260 | ||
259 | asmlinkage long sysn32_msgrcv(int msqid, u32 msgp, size_t msgsz, int msgtyp, | 261 | SYSCALL_DEFINE5(n32_msgrcv, int, msqid, u32, msgp, size_t, msgsz, |
260 | int msgflg) | 262 | int, msgtyp, int, msgflg) |
261 | { | 263 | { |
262 | return compat_sys_msgrcv(msqid, msgsz, msgtyp, msgflg, IPC_64, | 264 | return compat_sys_msgrcv(msqid, msgsz, msgtyp, msgflg, IPC_64, |
263 | compat_ptr(msgp)); | 265 | compat_ptr(msgp)); |
@@ -277,7 +279,7 @@ struct sysctl_args32 | |||
277 | 279 | ||
278 | #ifdef CONFIG_SYSCTL_SYSCALL | 280 | #ifdef CONFIG_SYSCTL_SYSCALL |
279 | 281 | ||
280 | asmlinkage long sys32_sysctl(struct sysctl_args32 __user *args) | 282 | SYSCALL_DEFINE1(32_sysctl, struct sysctl_args32 __user *, args) |
281 | { | 283 | { |
282 | struct sysctl_args32 tmp; | 284 | struct sysctl_args32 tmp; |
283 | int error; | 285 | int error; |
@@ -316,9 +318,16 @@ asmlinkage long sys32_sysctl(struct sysctl_args32 __user *args) | |||
316 | return error; | 318 | return error; |
317 | } | 319 | } |
318 | 320 | ||
321 | #else | ||
322 | |||
323 | SYSCALL_DEFINE1(32_sysctl, struct sysctl_args32 __user *, args) | ||
324 | { | ||
325 | return -ENOSYS; | ||
326 | } | ||
327 | |||
319 | #endif /* CONFIG_SYSCTL_SYSCALL */ | 328 | #endif /* CONFIG_SYSCTL_SYSCALL */ |
320 | 329 | ||
321 | asmlinkage long sys32_newuname(struct new_utsname __user * name) | 330 | SYSCALL_DEFINE1(32_newuname, struct new_utsname __user *, name) |
322 | { | 331 | { |
323 | int ret = 0; | 332 | int ret = 0; |
324 | 333 | ||
@@ -334,7 +343,7 @@ asmlinkage long sys32_newuname(struct new_utsname __user * name) | |||
334 | return ret; | 343 | return ret; |
335 | } | 344 | } |
336 | 345 | ||
337 | asmlinkage int sys32_personality(unsigned long personality) | 346 | SYSCALL_DEFINE1(32_personality, unsigned long, personality) |
338 | { | 347 | { |
339 | int ret; | 348 | int ret; |
340 | personality &= 0xffffffff; | 349 | personality &= 0xffffffff; |
@@ -357,7 +366,7 @@ struct ustat32 { | |||
357 | 366 | ||
358 | extern asmlinkage long sys_ustat(dev_t dev, struct ustat __user * ubuf); | 367 | extern asmlinkage long sys_ustat(dev_t dev, struct ustat __user * ubuf); |
359 | 368 | ||
360 | asmlinkage int sys32_ustat(dev_t dev, struct ustat32 __user * ubuf32) | 369 | SYSCALL_DEFINE2(32_ustat, dev_t, dev, struct ustat32 __user *, ubuf32) |
361 | { | 370 | { |
362 | int err; | 371 | int err; |
363 | struct ustat tmp; | 372 | struct ustat tmp; |
@@ -381,8 +390,8 @@ out: | |||
381 | return err; | 390 | return err; |
382 | } | 391 | } |
383 | 392 | ||
384 | asmlinkage int sys32_sendfile(int out_fd, int in_fd, compat_off_t __user *offset, | 393 | SYSCALL_DEFINE4(32_sendfile, long, out_fd, long, in_fd, |
385 | s32 count) | 394 | compat_off_t __user *, offset, s32, count) |
386 | { | 395 | { |
387 | mm_segment_t old_fs = get_fs(); | 396 | mm_segment_t old_fs = get_fs(); |
388 | int ret; | 397 | int ret; |
diff --git a/arch/mips/kernel/scall32-o32.S b/arch/mips/kernel/scall32-o32.S index 51d1ba415b90..9ab70c3b5be6 100644 --- a/arch/mips/kernel/scall32-o32.S +++ b/arch/mips/kernel/scall32-o32.S | |||
@@ -399,7 +399,7 @@ einval: li v0, -ENOSYS | |||
399 | sys sys_swapon 2 | 399 | sys sys_swapon 2 |
400 | sys sys_reboot 3 | 400 | sys sys_reboot 3 |
401 | sys sys_old_readdir 3 | 401 | sys sys_old_readdir 3 |
402 | sys old_mmap 6 /* 4090 */ | 402 | sys sys_mips_mmap 6 /* 4090 */ |
403 | sys sys_munmap 2 | 403 | sys sys_munmap 2 |
404 | sys sys_truncate 2 | 404 | sys sys_truncate 2 |
405 | sys sys_ftruncate 2 | 405 | sys sys_ftruncate 2 |
@@ -519,7 +519,7 @@ einval: li v0, -ENOSYS | |||
519 | sys sys_sendfile 4 | 519 | sys sys_sendfile 4 |
520 | sys sys_ni_syscall 0 | 520 | sys sys_ni_syscall 0 |
521 | sys sys_ni_syscall 0 | 521 | sys sys_ni_syscall 0 |
522 | sys sys_mmap2 6 /* 4210 */ | 522 | sys sys_mips_mmap2 6 /* 4210 */ |
523 | sys sys_truncate64 4 | 523 | sys sys_truncate64 4 |
524 | sys sys_ftruncate64 4 | 524 | sys sys_ftruncate64 4 |
525 | sys sys_stat64 2 | 525 | sys sys_stat64 2 |
diff --git a/arch/mips/kernel/scall64-64.S b/arch/mips/kernel/scall64-64.S index a9e171618994..9b4698667154 100644 --- a/arch/mips/kernel/scall64-64.S +++ b/arch/mips/kernel/scall64-64.S | |||
@@ -207,7 +207,7 @@ sys_call_table: | |||
207 | PTR sys_newlstat | 207 | PTR sys_newlstat |
208 | PTR sys_poll | 208 | PTR sys_poll |
209 | PTR sys_lseek | 209 | PTR sys_lseek |
210 | PTR old_mmap | 210 | PTR sys_mips_mmap |
211 | PTR sys_mprotect /* 5010 */ | 211 | PTR sys_mprotect /* 5010 */ |
212 | PTR sys_munmap | 212 | PTR sys_munmap |
213 | PTR sys_brk | 213 | PTR sys_brk |
diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S index 30f3b6317a83..7438e92f8a01 100644 --- a/arch/mips/kernel/scall64-n32.S +++ b/arch/mips/kernel/scall64-n32.S | |||
@@ -129,12 +129,12 @@ EXPORT(sysn32_call_table) | |||
129 | PTR sys_newlstat | 129 | PTR sys_newlstat |
130 | PTR sys_poll | 130 | PTR sys_poll |
131 | PTR sys_lseek | 131 | PTR sys_lseek |
132 | PTR old_mmap | 132 | PTR sys_mips_mmap |
133 | PTR sys_mprotect /* 6010 */ | 133 | PTR sys_mprotect /* 6010 */ |
134 | PTR sys_munmap | 134 | PTR sys_munmap |
135 | PTR sys_brk | 135 | PTR sys_brk |
136 | PTR sys32_rt_sigaction | 136 | PTR sys_32_rt_sigaction |
137 | PTR sys32_rt_sigprocmask | 137 | PTR sys_32_rt_sigprocmask |
138 | PTR compat_sys_ioctl /* 6015 */ | 138 | PTR compat_sys_ioctl /* 6015 */ |
139 | PTR sys_pread64 | 139 | PTR sys_pread64 |
140 | PTR sys_pwrite64 | 140 | PTR sys_pwrite64 |
@@ -159,7 +159,7 @@ EXPORT(sysn32_call_table) | |||
159 | PTR compat_sys_setitimer | 159 | PTR compat_sys_setitimer |
160 | PTR sys_alarm | 160 | PTR sys_alarm |
161 | PTR sys_getpid | 161 | PTR sys_getpid |
162 | PTR sys32_sendfile | 162 | PTR sys_32_sendfile |
163 | PTR sys_socket /* 6040 */ | 163 | PTR sys_socket /* 6040 */ |
164 | PTR sys_connect | 164 | PTR sys_connect |
165 | PTR sys_accept | 165 | PTR sys_accept |
@@ -181,14 +181,14 @@ EXPORT(sysn32_call_table) | |||
181 | PTR sys_exit | 181 | PTR sys_exit |
182 | PTR compat_sys_wait4 | 182 | PTR compat_sys_wait4 |
183 | PTR sys_kill /* 6060 */ | 183 | PTR sys_kill /* 6060 */ |
184 | PTR sys32_newuname | 184 | PTR sys_32_newuname |
185 | PTR sys_semget | 185 | PTR sys_semget |
186 | PTR sys_semop | 186 | PTR sys_semop |
187 | PTR sysn32_semctl | 187 | PTR sys_n32_semctl |
188 | PTR sys_shmdt /* 6065 */ | 188 | PTR sys_shmdt /* 6065 */ |
189 | PTR sys_msgget | 189 | PTR sys_msgget |
190 | PTR sysn32_msgsnd | 190 | PTR sys_n32_msgsnd |
191 | PTR sysn32_msgrcv | 191 | PTR sys_n32_msgrcv |
192 | PTR compat_sys_msgctl | 192 | PTR compat_sys_msgctl |
193 | PTR compat_sys_fcntl /* 6070 */ | 193 | PTR compat_sys_fcntl /* 6070 */ |
194 | PTR sys_flock | 194 | PTR sys_flock |
@@ -245,15 +245,15 @@ EXPORT(sysn32_call_table) | |||
245 | PTR sys_getsid | 245 | PTR sys_getsid |
246 | PTR sys_capget | 246 | PTR sys_capget |
247 | PTR sys_capset | 247 | PTR sys_capset |
248 | PTR sys32_rt_sigpending /* 6125 */ | 248 | PTR sys_32_rt_sigpending /* 6125 */ |
249 | PTR compat_sys_rt_sigtimedwait | 249 | PTR compat_sys_rt_sigtimedwait |
250 | PTR sys32_rt_sigqueueinfo | 250 | PTR sys_32_rt_sigqueueinfo |
251 | PTR sysn32_rt_sigsuspend | 251 | PTR sysn32_rt_sigsuspend |
252 | PTR sys32_sigaltstack | 252 | PTR sys32_sigaltstack |
253 | PTR compat_sys_utime /* 6130 */ | 253 | PTR compat_sys_utime /* 6130 */ |
254 | PTR sys_mknod | 254 | PTR sys_mknod |
255 | PTR sys32_personality | 255 | PTR sys_32_personality |
256 | PTR sys32_ustat | 256 | PTR sys_32_ustat |
257 | PTR compat_sys_statfs | 257 | PTR compat_sys_statfs |
258 | PTR compat_sys_fstatfs /* 6135 */ | 258 | PTR compat_sys_fstatfs /* 6135 */ |
259 | PTR sys_sysfs | 259 | PTR sys_sysfs |
@@ -265,14 +265,14 @@ EXPORT(sysn32_call_table) | |||
265 | PTR sys_sched_getscheduler | 265 | PTR sys_sched_getscheduler |
266 | PTR sys_sched_get_priority_max | 266 | PTR sys_sched_get_priority_max |
267 | PTR sys_sched_get_priority_min | 267 | PTR sys_sched_get_priority_min |
268 | PTR sys32_sched_rr_get_interval /* 6145 */ | 268 | PTR sys_32_sched_rr_get_interval /* 6145 */ |
269 | PTR sys_mlock | 269 | PTR sys_mlock |
270 | PTR sys_munlock | 270 | PTR sys_munlock |
271 | PTR sys_mlockall | 271 | PTR sys_mlockall |
272 | PTR sys_munlockall | 272 | PTR sys_munlockall |
273 | PTR sys_vhangup /* 6150 */ | 273 | PTR sys_vhangup /* 6150 */ |
274 | PTR sys_pivot_root | 274 | PTR sys_pivot_root |
275 | PTR sys32_sysctl | 275 | PTR sys_32_sysctl |
276 | PTR sys_prctl | 276 | PTR sys_prctl |
277 | PTR compat_sys_adjtimex | 277 | PTR compat_sys_adjtimex |
278 | PTR compat_sys_setrlimit /* 6155 */ | 278 | PTR compat_sys_setrlimit /* 6155 */ |
diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S index fefef4af8595..b0fef4ff9827 100644 --- a/arch/mips/kernel/scall64-o32.S +++ b/arch/mips/kernel/scall64-o32.S | |||
@@ -265,12 +265,12 @@ sys_call_table: | |||
265 | PTR sys_olduname | 265 | PTR sys_olduname |
266 | PTR sys_umask /* 4060 */ | 266 | PTR sys_umask /* 4060 */ |
267 | PTR sys_chroot | 267 | PTR sys_chroot |
268 | PTR sys32_ustat | 268 | PTR sys_32_ustat |
269 | PTR sys_dup2 | 269 | PTR sys_dup2 |
270 | PTR sys_getppid | 270 | PTR sys_getppid |
271 | PTR sys_getpgrp /* 4065 */ | 271 | PTR sys_getpgrp /* 4065 */ |
272 | PTR sys_setsid | 272 | PTR sys_setsid |
273 | PTR sys32_sigaction | 273 | PTR sys_32_sigaction |
274 | PTR sys_sgetmask | 274 | PTR sys_sgetmask |
275 | PTR sys_ssetmask | 275 | PTR sys_ssetmask |
276 | PTR sys_setreuid /* 4070 */ | 276 | PTR sys_setreuid /* 4070 */ |
@@ -293,7 +293,7 @@ sys_call_table: | |||
293 | PTR sys_swapon | 293 | PTR sys_swapon |
294 | PTR sys_reboot | 294 | PTR sys_reboot |
295 | PTR compat_sys_old_readdir | 295 | PTR compat_sys_old_readdir |
296 | PTR old_mmap /* 4090 */ | 296 | PTR sys_mips_mmap /* 4090 */ |
297 | PTR sys_munmap | 297 | PTR sys_munmap |
298 | PTR sys_truncate | 298 | PTR sys_truncate |
299 | PTR sys_ftruncate | 299 | PTR sys_ftruncate |
@@ -320,12 +320,12 @@ sys_call_table: | |||
320 | PTR compat_sys_wait4 | 320 | PTR compat_sys_wait4 |
321 | PTR sys_swapoff /* 4115 */ | 321 | PTR sys_swapoff /* 4115 */ |
322 | PTR compat_sys_sysinfo | 322 | PTR compat_sys_sysinfo |
323 | PTR sys32_ipc | 323 | PTR sys_32_ipc |
324 | PTR sys_fsync | 324 | PTR sys_fsync |
325 | PTR sys32_sigreturn | 325 | PTR sys32_sigreturn |
326 | PTR sys32_clone /* 4120 */ | 326 | PTR sys32_clone /* 4120 */ |
327 | PTR sys_setdomainname | 327 | PTR sys_setdomainname |
328 | PTR sys32_newuname | 328 | PTR sys_32_newuname |
329 | PTR sys_ni_syscall /* sys_modify_ldt */ | 329 | PTR sys_ni_syscall /* sys_modify_ldt */ |
330 | PTR compat_sys_adjtimex | 330 | PTR compat_sys_adjtimex |
331 | PTR sys_mprotect /* 4125 */ | 331 | PTR sys_mprotect /* 4125 */ |
@@ -339,11 +339,11 @@ sys_call_table: | |||
339 | PTR sys_fchdir | 339 | PTR sys_fchdir |
340 | PTR sys_bdflush | 340 | PTR sys_bdflush |
341 | PTR sys_sysfs /* 4135 */ | 341 | PTR sys_sysfs /* 4135 */ |
342 | PTR sys32_personality | 342 | PTR sys_32_personality |
343 | PTR sys_ni_syscall /* for afs_syscall */ | 343 | PTR sys_ni_syscall /* for afs_syscall */ |
344 | PTR sys_setfsuid | 344 | PTR sys_setfsuid |
345 | PTR sys_setfsgid | 345 | PTR sys_setfsgid |
346 | PTR sys32_llseek /* 4140 */ | 346 | PTR sys_32_llseek /* 4140 */ |
347 | PTR compat_sys_getdents | 347 | PTR compat_sys_getdents |
348 | PTR compat_sys_select | 348 | PTR compat_sys_select |
349 | PTR sys_flock | 349 | PTR sys_flock |
@@ -356,7 +356,7 @@ sys_call_table: | |||
356 | PTR sys_ni_syscall /* 4150 */ | 356 | PTR sys_ni_syscall /* 4150 */ |
357 | PTR sys_getsid | 357 | PTR sys_getsid |
358 | PTR sys_fdatasync | 358 | PTR sys_fdatasync |
359 | PTR sys32_sysctl | 359 | PTR sys_32_sysctl |
360 | PTR sys_mlock | 360 | PTR sys_mlock |
361 | PTR sys_munlock /* 4155 */ | 361 | PTR sys_munlock /* 4155 */ |
362 | PTR sys_mlockall | 362 | PTR sys_mlockall |
@@ -368,7 +368,7 @@ sys_call_table: | |||
368 | PTR sys_sched_yield | 368 | PTR sys_sched_yield |
369 | PTR sys_sched_get_priority_max | 369 | PTR sys_sched_get_priority_max |
370 | PTR sys_sched_get_priority_min | 370 | PTR sys_sched_get_priority_min |
371 | PTR sys32_sched_rr_get_interval /* 4165 */ | 371 | PTR sys_32_sched_rr_get_interval /* 4165 */ |
372 | PTR compat_sys_nanosleep | 372 | PTR compat_sys_nanosleep |
373 | PTR sys_mremap | 373 | PTR sys_mremap |
374 | PTR sys_accept | 374 | PTR sys_accept |
@@ -397,25 +397,25 @@ sys_call_table: | |||
397 | PTR sys_getresgid | 397 | PTR sys_getresgid |
398 | PTR sys_prctl | 398 | PTR sys_prctl |
399 | PTR sys32_rt_sigreturn | 399 | PTR sys32_rt_sigreturn |
400 | PTR sys32_rt_sigaction | 400 | PTR sys_32_rt_sigaction |
401 | PTR sys32_rt_sigprocmask /* 4195 */ | 401 | PTR sys_32_rt_sigprocmask /* 4195 */ |
402 | PTR sys32_rt_sigpending | 402 | PTR sys_32_rt_sigpending |
403 | PTR compat_sys_rt_sigtimedwait | 403 | PTR compat_sys_rt_sigtimedwait |
404 | PTR sys32_rt_sigqueueinfo | 404 | PTR sys_32_rt_sigqueueinfo |
405 | PTR sys32_rt_sigsuspend | 405 | PTR sys32_rt_sigsuspend |
406 | PTR sys32_pread /* 4200 */ | 406 | PTR sys_32_pread /* 4200 */ |
407 | PTR sys32_pwrite | 407 | PTR sys_32_pwrite |
408 | PTR sys_chown | 408 | PTR sys_chown |
409 | PTR sys_getcwd | 409 | PTR sys_getcwd |
410 | PTR sys_capget | 410 | PTR sys_capget |
411 | PTR sys_capset /* 4205 */ | 411 | PTR sys_capset /* 4205 */ |
412 | PTR sys32_sigaltstack | 412 | PTR sys32_sigaltstack |
413 | PTR sys32_sendfile | 413 | PTR sys_32_sendfile |
414 | PTR sys_ni_syscall | 414 | PTR sys_ni_syscall |
415 | PTR sys_ni_syscall | 415 | PTR sys_ni_syscall |
416 | PTR sys32_mmap2 /* 4210 */ | 416 | PTR sys_mips_mmap2 /* 4210 */ |
417 | PTR sys32_truncate64 | 417 | PTR sys_32_truncate64 |
418 | PTR sys32_ftruncate64 | 418 | PTR sys_32_ftruncate64 |
419 | PTR sys_newstat | 419 | PTR sys_newstat |
420 | PTR sys_newlstat | 420 | PTR sys_newlstat |
421 | PTR sys_newfstat /* 4215 */ | 421 | PTR sys_newfstat /* 4215 */ |
@@ -481,7 +481,7 @@ sys_call_table: | |||
481 | PTR compat_sys_mq_notify /* 4275 */ | 481 | PTR compat_sys_mq_notify /* 4275 */ |
482 | PTR compat_sys_mq_getsetattr | 482 | PTR compat_sys_mq_getsetattr |
483 | PTR sys_ni_syscall /* sys_vserver */ | 483 | PTR sys_ni_syscall /* sys_vserver */ |
484 | PTR sys32_waitid | 484 | PTR sys_32_waitid |
485 | PTR sys_ni_syscall /* available, was setaltroot */ | 485 | PTR sys_ni_syscall /* available, was setaltroot */ |
486 | PTR sys_add_key /* 4280 */ | 486 | PTR sys_add_key /* 4280 */ |
487 | PTR sys_request_key | 487 | PTR sys_request_key |
diff --git a/arch/mips/kernel/signal.c b/arch/mips/kernel/signal.c index a4e106c56ab5..830c5ef9932b 100644 --- a/arch/mips/kernel/signal.c +++ b/arch/mips/kernel/signal.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/ptrace.h> | 19 | #include <linux/ptrace.h> |
20 | #include <linux/unistd.h> | 20 | #include <linux/unistd.h> |
21 | #include <linux/compiler.h> | 21 | #include <linux/compiler.h> |
22 | #include <linux/syscalls.h> | ||
22 | #include <linux/uaccess.h> | 23 | #include <linux/uaccess.h> |
23 | 24 | ||
24 | #include <asm/abi.h> | 25 | #include <asm/abi.h> |
@@ -338,8 +339,8 @@ asmlinkage int sys_rt_sigsuspend(nabi_no_regargs struct pt_regs regs) | |||
338 | } | 339 | } |
339 | 340 | ||
340 | #ifdef CONFIG_TRAD_SIGNALS | 341 | #ifdef CONFIG_TRAD_SIGNALS |
341 | asmlinkage int sys_sigaction(int sig, const struct sigaction __user *act, | 342 | SYSCALL_DEFINE3(sigaction, int, sig, const struct sigaction __user *, act, |
342 | struct sigaction __user *oact) | 343 | struct sigaction __user *, oact) |
343 | { | 344 | { |
344 | struct k_sigaction new_ka, old_ka; | 345 | struct k_sigaction new_ka, old_ka; |
345 | int ret; | 346 | int ret; |
diff --git a/arch/mips/kernel/signal32.c b/arch/mips/kernel/signal32.c index 652709b353ad..2e74075ac0ca 100644 --- a/arch/mips/kernel/signal32.c +++ b/arch/mips/kernel/signal32.c | |||
@@ -349,8 +349,8 @@ asmlinkage int sys32_rt_sigsuspend(nabi_no_regargs struct pt_regs regs) | |||
349 | return -ERESTARTNOHAND; | 349 | return -ERESTARTNOHAND; |
350 | } | 350 | } |
351 | 351 | ||
352 | asmlinkage int sys32_sigaction(int sig, const struct sigaction32 __user *act, | 352 | SYSCALL_DEFINE3(32_sigaction, long, sig, const struct sigaction32 __user *, act, |
353 | struct sigaction32 __user *oact) | 353 | struct sigaction32 __user *, oact) |
354 | { | 354 | { |
355 | struct k_sigaction new_ka, old_ka; | 355 | struct k_sigaction new_ka, old_ka; |
356 | int ret; | 356 | int ret; |
@@ -704,9 +704,9 @@ struct mips_abi mips_abi_32 = { | |||
704 | .restart = __NR_O32_restart_syscall | 704 | .restart = __NR_O32_restart_syscall |
705 | }; | 705 | }; |
706 | 706 | ||
707 | asmlinkage int sys32_rt_sigaction(int sig, const struct sigaction32 __user *act, | 707 | SYSCALL_DEFINE4(32_rt_sigaction, int, sig, |
708 | struct sigaction32 __user *oact, | 708 | const struct sigaction32 __user *, act, |
709 | unsigned int sigsetsize) | 709 | struct sigaction32 __user *, oact, unsigned int, sigsetsize) |
710 | { | 710 | { |
711 | struct k_sigaction new_sa, old_sa; | 711 | struct k_sigaction new_sa, old_sa; |
712 | int ret = -EINVAL; | 712 | int ret = -EINVAL; |
@@ -748,8 +748,8 @@ out: | |||
748 | return ret; | 748 | return ret; |
749 | } | 749 | } |
750 | 750 | ||
751 | asmlinkage int sys32_rt_sigprocmask(int how, compat_sigset_t __user *set, | 751 | SYSCALL_DEFINE4(32_rt_sigprocmask, int, how, compat_sigset_t __user *, set, |
752 | compat_sigset_t __user *oset, unsigned int sigsetsize) | 752 | compat_sigset_t __user *, oset, unsigned int, sigsetsize) |
753 | { | 753 | { |
754 | sigset_t old_set, new_set; | 754 | sigset_t old_set, new_set; |
755 | int ret; | 755 | int ret; |
@@ -770,8 +770,8 @@ asmlinkage int sys32_rt_sigprocmask(int how, compat_sigset_t __user *set, | |||
770 | return ret; | 770 | return ret; |
771 | } | 771 | } |
772 | 772 | ||
773 | asmlinkage int sys32_rt_sigpending(compat_sigset_t __user *uset, | 773 | SYSCALL_DEFINE2(32_rt_sigpending, compat_sigset_t __user *, uset, |
774 | unsigned int sigsetsize) | 774 | unsigned int, sigsetsize) |
775 | { | 775 | { |
776 | int ret; | 776 | int ret; |
777 | sigset_t set; | 777 | sigset_t set; |
@@ -787,7 +787,8 @@ asmlinkage int sys32_rt_sigpending(compat_sigset_t __user *uset, | |||
787 | return ret; | 787 | return ret; |
788 | } | 788 | } |
789 | 789 | ||
790 | asmlinkage int sys32_rt_sigqueueinfo(int pid, int sig, compat_siginfo_t __user *uinfo) | 790 | SYSCALL_DEFINE3(32_rt_sigqueueinfo, int, pid, int, sig, |
791 | compat_siginfo_t __user *, uinfo) | ||
791 | { | 792 | { |
792 | siginfo_t info; | 793 | siginfo_t info; |
793 | int ret; | 794 | int ret; |
@@ -802,10 +803,9 @@ asmlinkage int sys32_rt_sigqueueinfo(int pid, int sig, compat_siginfo_t __user * | |||
802 | return ret; | 803 | return ret; |
803 | } | 804 | } |
804 | 805 | ||
805 | asmlinkage long | 806 | SYSCALL_DEFINE5(32_waitid, int, which, compat_pid_t, pid, |
806 | sys32_waitid(int which, compat_pid_t pid, | 807 | compat_siginfo_t __user *, uinfo, int, options, |
807 | compat_siginfo_t __user *uinfo, int options, | 808 | struct compat_rusage __user *, uru) |
808 | struct compat_rusage __user *uru) | ||
809 | { | 809 | { |
810 | siginfo_t info; | 810 | siginfo_t info; |
811 | struct rusage ru; | 811 | struct rusage ru; |
diff --git a/arch/mips/kernel/syscall.c b/arch/mips/kernel/syscall.c index 37970d9b2186..8cf384644040 100644 --- a/arch/mips/kernel/syscall.c +++ b/arch/mips/kernel/syscall.c | |||
@@ -152,9 +152,9 @@ out: | |||
152 | return error; | 152 | return error; |
153 | } | 153 | } |
154 | 154 | ||
155 | asmlinkage unsigned long | 155 | SYSCALL_DEFINE6(mips_mmap, unsigned long, addr, unsigned long, len, |
156 | old_mmap(unsigned long addr, unsigned long len, int prot, | 156 | unsigned long, prot, unsigned long, flags, unsigned long, |
157 | int flags, int fd, off_t offset) | 157 | fd, off_t, offset) |
158 | { | 158 | { |
159 | unsigned long result; | 159 | unsigned long result; |
160 | 160 | ||
@@ -168,9 +168,9 @@ out: | |||
168 | return result; | 168 | return result; |
169 | } | 169 | } |
170 | 170 | ||
171 | asmlinkage unsigned long | 171 | SYSCALL_DEFINE6(mips_mmap2, unsigned long, addr, unsigned long, len, |
172 | sys_mmap2(unsigned long addr, unsigned long len, unsigned long prot, | 172 | unsigned long, prot, unsigned long, flags, unsigned long, fd, |
173 | unsigned long flags, unsigned long fd, unsigned long pgoff) | 173 | unsigned long, pgoff) |
174 | { | 174 | { |
175 | if (pgoff & (~PAGE_MASK >> 12)) | 175 | if (pgoff & (~PAGE_MASK >> 12)) |
176 | return -EINVAL; | 176 | return -EINVAL; |
@@ -240,7 +240,7 @@ out: | |||
240 | /* | 240 | /* |
241 | * Compacrapability ... | 241 | * Compacrapability ... |
242 | */ | 242 | */ |
243 | asmlinkage int sys_uname(struct old_utsname __user * name) | 243 | SYSCALL_DEFINE1(uname, struct old_utsname __user *, name) |
244 | { | 244 | { |
245 | if (name && !copy_to_user(name, utsname(), sizeof (*name))) | 245 | if (name && !copy_to_user(name, utsname(), sizeof (*name))) |
246 | return 0; | 246 | return 0; |
@@ -250,7 +250,7 @@ asmlinkage int sys_uname(struct old_utsname __user * name) | |||
250 | /* | 250 | /* |
251 | * Compacrapability ... | 251 | * Compacrapability ... |
252 | */ | 252 | */ |
253 | asmlinkage int sys_olduname(struct oldold_utsname __user * name) | 253 | SYSCALL_DEFINE1(olduname, struct oldold_utsname __user *, name) |
254 | { | 254 | { |
255 | int error; | 255 | int error; |
256 | 256 | ||
@@ -279,7 +279,7 @@ asmlinkage int sys_olduname(struct oldold_utsname __user * name) | |||
279 | return error; | 279 | return error; |
280 | } | 280 | } |
281 | 281 | ||
282 | asmlinkage int sys_set_thread_area(unsigned long addr) | 282 | SYSCALL_DEFINE1(set_thread_area, unsigned long, addr) |
283 | { | 283 | { |
284 | struct thread_info *ti = task_thread_info(current); | 284 | struct thread_info *ti = task_thread_info(current); |
285 | 285 | ||
@@ -290,7 +290,7 @@ asmlinkage int sys_set_thread_area(unsigned long addr) | |||
290 | return 0; | 290 | return 0; |
291 | } | 291 | } |
292 | 292 | ||
293 | asmlinkage int _sys_sysmips(int cmd, long arg1, int arg2, int arg3) | 293 | asmlinkage int _sys_sysmips(long cmd, long arg1, long arg2, long arg3) |
294 | { | 294 | { |
295 | switch (cmd) { | 295 | switch (cmd) { |
296 | case MIPS_ATOMIC_SET: | 296 | case MIPS_ATOMIC_SET: |
@@ -325,8 +325,8 @@ asmlinkage int _sys_sysmips(int cmd, long arg1, int arg2, int arg3) | |||
325 | * | 325 | * |
326 | * This is really horribly ugly. | 326 | * This is really horribly ugly. |
327 | */ | 327 | */ |
328 | asmlinkage int sys_ipc(unsigned int call, int first, int second, | 328 | SYSCALL_DEFINE6(ipc, unsigned int, call, int, first, int, second, |
329 | unsigned long third, void __user *ptr, long fifth) | 329 | unsigned long, third, void __user *, ptr, long, fifth) |
330 | { | 330 | { |
331 | int version, ret; | 331 | int version, ret; |
332 | 332 | ||
@@ -411,7 +411,7 @@ asmlinkage int sys_ipc(unsigned int call, int first, int second, | |||
411 | /* | 411 | /* |
412 | * No implemented yet ... | 412 | * No implemented yet ... |
413 | */ | 413 | */ |
414 | asmlinkage int sys_cachectl(char *addr, int nbytes, int op) | 414 | SYSCALL_DEFINE3(cachectl, char *, addr, int, nbytes, int, op) |
415 | { | 415 | { |
416 | return -ENOSYS; | 416 | return -ENOSYS; |
417 | } | 417 | } |
diff --git a/arch/mips/mm/cache.c b/arch/mips/mm/cache.c index 98ad0a82c29e..694d51f523d1 100644 --- a/arch/mips/mm/cache.c +++ b/arch/mips/mm/cache.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/linkage.h> | 13 | #include <linux/linkage.h> |
14 | #include <linux/module.h> | 14 | #include <linux/module.h> |
15 | #include <linux/sched.h> | 15 | #include <linux/sched.h> |
16 | #include <linux/syscalls.h> | ||
16 | #include <linux/mm.h> | 17 | #include <linux/mm.h> |
17 | 18 | ||
18 | #include <asm/cacheflush.h> | 19 | #include <asm/cacheflush.h> |
@@ -58,8 +59,8 @@ EXPORT_SYMBOL(_dma_cache_wback_inv); | |||
58 | * We could optimize the case where the cache argument is not BCACHE but | 59 | * We could optimize the case where the cache argument is not BCACHE but |
59 | * that seems very atypical use ... | 60 | * that seems very atypical use ... |
60 | */ | 61 | */ |
61 | asmlinkage int sys_cacheflush(unsigned long addr, | 62 | SYSCALL_DEFINE3(cacheflush, unsigned long, addr, unsigned long, bytes, |
62 | unsigned long bytes, unsigned int cache) | 63 | unsigned int, cache) |
63 | { | 64 | { |
64 | if (bytes == 0) | 65 | if (bytes == 0) |
65 | return 0; | 66 | return 0; |
diff --git a/arch/powerpc/sysdev/ppc4xx_pci.c b/arch/powerpc/sysdev/ppc4xx_pci.c index 77fae5f64f2e..5558d932b4d5 100644 --- a/arch/powerpc/sysdev/ppc4xx_pci.c +++ b/arch/powerpc/sysdev/ppc4xx_pci.c | |||
@@ -204,6 +204,23 @@ static int __init ppc4xx_setup_one_pci_PMM(struct pci_controller *hose, | |||
204 | { | 204 | { |
205 | u32 ma, pcila, pciha; | 205 | u32 ma, pcila, pciha; |
206 | 206 | ||
207 | /* Hack warning ! The "old" PCI 2.x cell only let us configure the low | ||
208 | * 32-bit of incoming PLB addresses. The top 4 bits of the 36-bit | ||
209 | * address are actually hard wired to a value that appears to depend | ||
210 | * on the specific SoC. For example, it's 0 on 440EP and 1 on 440EPx. | ||
211 | * | ||
212 | * The trick here is we just crop those top bits and ignore them when | ||
213 | * programming the chip. That means the device-tree has to be right | ||
214 | * for the specific part used (we don't print a warning if it's wrong | ||
215 | * but on the other hand, you'll crash quickly enough), but at least | ||
216 | * this code should work whatever the hard coded value is | ||
217 | */ | ||
218 | plb_addr &= 0xffffffffull; | ||
219 | |||
220 | /* Note: Due to the above hack, the test below doesn't actually test | ||
221 | * if you address is above 4G, but it tests that address and | ||
222 | * (address + size) are both contained in the same 4G | ||
223 | */ | ||
207 | if ((plb_addr + size) > 0xffffffffull || !is_power_of_2(size) || | 224 | if ((plb_addr + size) > 0xffffffffull || !is_power_of_2(size) || |
208 | size < 0x1000 || (plb_addr & (size - 1)) != 0) { | 225 | size < 0x1000 || (plb_addr & (size - 1)) != 0) { |
209 | printk(KERN_WARNING "%s: Resource out of range\n", | 226 | printk(KERN_WARNING "%s: Resource out of range\n", |
diff --git a/arch/sh/boards/board-ap325rxa.c b/arch/sh/boards/board-ap325rxa.c index 7c35787d29b4..72da416f6162 100644 --- a/arch/sh/boards/board-ap325rxa.c +++ b/arch/sh/boards/board-ap325rxa.c | |||
@@ -22,7 +22,6 @@ | |||
22 | #include <linux/gpio.h> | 22 | #include <linux/gpio.h> |
23 | #include <linux/spi/spi.h> | 23 | #include <linux/spi/spi.h> |
24 | #include <linux/spi/spi_gpio.h> | 24 | #include <linux/spi/spi_gpio.h> |
25 | #include <media/ov772x.h> | ||
26 | #include <media/soc_camera_platform.h> | 25 | #include <media/soc_camera_platform.h> |
27 | #include <media/sh_mobile_ceu.h> | 26 | #include <media/sh_mobile_ceu.h> |
28 | #include <video/sh_mobile_lcdc.h> | 27 | #include <video/sh_mobile_lcdc.h> |
@@ -224,7 +223,6 @@ static void camera_power(int val) | |||
224 | } | 223 | } |
225 | 224 | ||
226 | #ifdef CONFIG_I2C | 225 | #ifdef CONFIG_I2C |
227 | /* support for the old ncm03j camera */ | ||
228 | static unsigned char camera_ncm03j_magic[] = | 226 | static unsigned char camera_ncm03j_magic[] = |
229 | { | 227 | { |
230 | 0x87, 0x00, 0x88, 0x08, 0x89, 0x01, 0x8A, 0xE8, | 228 | 0x87, 0x00, 0x88, 0x08, 0x89, 0x01, 0x8A, 0xE8, |
@@ -245,23 +243,6 @@ static unsigned char camera_ncm03j_magic[] = | |||
245 | 0x63, 0xD4, 0x64, 0xEA, 0xD6, 0x0F, | 243 | 0x63, 0xD4, 0x64, 0xEA, 0xD6, 0x0F, |
246 | }; | 244 | }; |
247 | 245 | ||
248 | static int camera_probe(void) | ||
249 | { | ||
250 | struct i2c_adapter *a = i2c_get_adapter(0); | ||
251 | struct i2c_msg msg; | ||
252 | int ret; | ||
253 | |||
254 | camera_power(1); | ||
255 | msg.addr = 0x6e; | ||
256 | msg.buf = camera_ncm03j_magic; | ||
257 | msg.len = 2; | ||
258 | msg.flags = 0; | ||
259 | ret = i2c_transfer(a, &msg, 1); | ||
260 | camera_power(0); | ||
261 | |||
262 | return ret; | ||
263 | } | ||
264 | |||
265 | static int camera_set_capture(struct soc_camera_platform_info *info, | 246 | static int camera_set_capture(struct soc_camera_platform_info *info, |
266 | int enable) | 247 | int enable) |
267 | { | 248 | { |
@@ -313,35 +294,8 @@ static struct platform_device camera_device = { | |||
313 | .platform_data = &camera_info, | 294 | .platform_data = &camera_info, |
314 | }, | 295 | }, |
315 | }; | 296 | }; |
316 | |||
317 | static int __init camera_setup(void) | ||
318 | { | ||
319 | if (camera_probe() > 0) | ||
320 | platform_device_register(&camera_device); | ||
321 | |||
322 | return 0; | ||
323 | } | ||
324 | late_initcall(camera_setup); | ||
325 | |||
326 | #endif /* CONFIG_I2C */ | 297 | #endif /* CONFIG_I2C */ |
327 | 298 | ||
328 | static int ov7725_power(struct device *dev, int mode) | ||
329 | { | ||
330 | camera_power(0); | ||
331 | if (mode) | ||
332 | camera_power(1); | ||
333 | |||
334 | return 0; | ||
335 | } | ||
336 | |||
337 | static struct ov772x_camera_info ov7725_info = { | ||
338 | .buswidth = SOCAM_DATAWIDTH_8, | ||
339 | .flags = OV772X_FLAG_VFLIP | OV772X_FLAG_HFLIP, | ||
340 | .link = { | ||
341 | .power = ov7725_power, | ||
342 | }, | ||
343 | }; | ||
344 | |||
345 | static struct sh_mobile_ceu_info sh_mobile_ceu_info = { | 299 | static struct sh_mobile_ceu_info sh_mobile_ceu_info = { |
346 | .flags = SOCAM_PCLK_SAMPLE_RISING | SOCAM_HSYNC_ACTIVE_HIGH | | 300 | .flags = SOCAM_PCLK_SAMPLE_RISING | SOCAM_HSYNC_ACTIVE_HIGH | |
347 | SOCAM_VSYNC_ACTIVE_HIGH | SOCAM_MASTER | SOCAM_DATAWIDTH_8, | 301 | SOCAM_VSYNC_ACTIVE_HIGH | SOCAM_MASTER | SOCAM_DATAWIDTH_8, |
@@ -392,6 +346,9 @@ static struct platform_device *ap325rxa_devices[] __initdata = { | |||
392 | &ap325rxa_nor_flash_device, | 346 | &ap325rxa_nor_flash_device, |
393 | &lcdc_device, | 347 | &lcdc_device, |
394 | &ceu_device, | 348 | &ceu_device, |
349 | #ifdef CONFIG_I2C | ||
350 | &camera_device, | ||
351 | #endif | ||
395 | &nand_flash_device, | 352 | &nand_flash_device, |
396 | &sdcard_cn3_device, | 353 | &sdcard_cn3_device, |
397 | }; | 354 | }; |
@@ -400,10 +357,6 @@ static struct i2c_board_info __initdata ap325rxa_i2c_devices[] = { | |||
400 | { | 357 | { |
401 | I2C_BOARD_INFO("pcf8563", 0x51), | 358 | I2C_BOARD_INFO("pcf8563", 0x51), |
402 | }, | 359 | }, |
403 | { | ||
404 | I2C_BOARD_INFO("ov772x", 0x21), | ||
405 | .platform_data = &ov7725_info, | ||
406 | }, | ||
407 | }; | 360 | }; |
408 | 361 | ||
409 | static struct spi_board_info ap325rxa_spi_devices[] = { | 362 | static struct spi_board_info ap325rxa_spi_devices[] = { |
diff --git a/arch/sh/kernel/cpu/sh2a/clock-sh7201.c b/arch/sh/kernel/cpu/sh2a/clock-sh7201.c index 020a96fe961a..4a5e59732334 100644 --- a/arch/sh/kernel/cpu/sh2a/clock-sh7201.c +++ b/arch/sh/kernel/cpu/sh2a/clock-sh7201.c | |||
@@ -18,8 +18,8 @@ | |||
18 | #include <asm/freq.h> | 18 | #include <asm/freq.h> |
19 | #include <asm/io.h> | 19 | #include <asm/io.h> |
20 | 20 | ||
21 | const static int pll1rate[]={1,2,3,4,6,8}; | 21 | static const int pll1rate[]={1,2,3,4,6,8}; |
22 | const static int pfc_divisors[]={1,2,3,4,6,8,12}; | 22 | static const int pfc_divisors[]={1,2,3,4,6,8,12}; |
23 | #define ifc_divisors pfc_divisors | 23 | #define ifc_divisors pfc_divisors |
24 | 24 | ||
25 | #if (CONFIG_SH_CLK_MD == 0) | 25 | #if (CONFIG_SH_CLK_MD == 0) |
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig index 8fc9a847cf48..bcc1d2a9d050 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig | |||
@@ -1804,7 +1804,7 @@ config DMAR | |||
1804 | remapping devices. | 1804 | remapping devices. |
1805 | 1805 | ||
1806 | config DMAR_DEFAULT_ON | 1806 | config DMAR_DEFAULT_ON |
1807 | def_bool n | 1807 | def_bool y |
1808 | prompt "Enable DMA Remapping Devices by default" | 1808 | prompt "Enable DMA Remapping Devices by default" |
1809 | depends on DMAR | 1809 | depends on DMAR |
1810 | help | 1810 | help |
diff --git a/arch/x86/include/asm/iomap.h b/arch/x86/include/asm/iomap.h index c1f06289b14b..86af26091d6c 100644 --- a/arch/x86/include/asm/iomap.h +++ b/arch/x86/include/asm/iomap.h | |||
@@ -23,6 +23,9 @@ | |||
23 | #include <asm/pgtable.h> | 23 | #include <asm/pgtable.h> |
24 | #include <asm/tlbflush.h> | 24 | #include <asm/tlbflush.h> |
25 | 25 | ||
26 | int | ||
27 | is_io_mapping_possible(resource_size_t base, unsigned long size); | ||
28 | |||
26 | void * | 29 | void * |
27 | iomap_atomic_prot_pfn(unsigned long pfn, enum km_type type, pgprot_t prot); | 30 | iomap_atomic_prot_pfn(unsigned long pfn, enum km_type type, pgprot_t prot); |
28 | 31 | ||
diff --git a/arch/x86/mach-voyager/voyager_smp.c b/arch/x86/mach-voyager/voyager_smp.c index 7ffcdeec4631..b9cc84a2a4fc 100644 --- a/arch/x86/mach-voyager/voyager_smp.c +++ b/arch/x86/mach-voyager/voyager_smp.c | |||
@@ -65,7 +65,7 @@ static volatile unsigned long smp_invalidate_needed; | |||
65 | 65 | ||
66 | /* Bitmask of CPUs present in the system - exported by i386_syms.c, used | 66 | /* Bitmask of CPUs present in the system - exported by i386_syms.c, used |
67 | * by scheduler but indexed physically */ | 67 | * by scheduler but indexed physically */ |
68 | cpumask_t phys_cpu_present_map = CPU_MASK_NONE; | 68 | static cpumask_t voyager_phys_cpu_present_map = CPU_MASK_NONE; |
69 | 69 | ||
70 | /* The internal functions */ | 70 | /* The internal functions */ |
71 | static void send_CPI(__u32 cpuset, __u8 cpi); | 71 | static void send_CPI(__u32 cpuset, __u8 cpi); |
@@ -366,19 +366,19 @@ void __init find_smp_config(void) | |||
366 | /* set up everything for just this CPU, we can alter | 366 | /* set up everything for just this CPU, we can alter |
367 | * this as we start the other CPUs later */ | 367 | * this as we start the other CPUs later */ |
368 | /* now get the CPU disposition from the extended CMOS */ | 368 | /* now get the CPU disposition from the extended CMOS */ |
369 | cpus_addr(phys_cpu_present_map)[0] = | 369 | cpus_addr(voyager_phys_cpu_present_map)[0] = |
370 | voyager_extended_cmos_read(VOYAGER_PROCESSOR_PRESENT_MASK); | 370 | voyager_extended_cmos_read(VOYAGER_PROCESSOR_PRESENT_MASK); |
371 | cpus_addr(phys_cpu_present_map)[0] |= | 371 | cpus_addr(voyager_phys_cpu_present_map)[0] |= |
372 | voyager_extended_cmos_read(VOYAGER_PROCESSOR_PRESENT_MASK + 1) << 8; | 372 | voyager_extended_cmos_read(VOYAGER_PROCESSOR_PRESENT_MASK + 1) << 8; |
373 | cpus_addr(phys_cpu_present_map)[0] |= | 373 | cpus_addr(voyager_phys_cpu_present_map)[0] |= |
374 | voyager_extended_cmos_read(VOYAGER_PROCESSOR_PRESENT_MASK + | 374 | voyager_extended_cmos_read(VOYAGER_PROCESSOR_PRESENT_MASK + |
375 | 2) << 16; | 375 | 2) << 16; |
376 | cpus_addr(phys_cpu_present_map)[0] |= | 376 | cpus_addr(voyager_phys_cpu_present_map)[0] |= |
377 | voyager_extended_cmos_read(VOYAGER_PROCESSOR_PRESENT_MASK + | 377 | voyager_extended_cmos_read(VOYAGER_PROCESSOR_PRESENT_MASK + |
378 | 3) << 24; | 378 | 3) << 24; |
379 | init_cpu_possible(&phys_cpu_present_map); | 379 | init_cpu_possible(&voyager_phys_cpu_present_map); |
380 | printk("VOYAGER SMP: phys_cpu_present_map = 0x%lx\n", | 380 | printk("VOYAGER SMP: voyager_phys_cpu_present_map = 0x%lx\n", |
381 | cpus_addr(phys_cpu_present_map)[0]); | 381 | cpus_addr(voyager_phys_cpu_present_map)[0]); |
382 | /* Here we set up the VIC to enable SMP */ | 382 | /* Here we set up the VIC to enable SMP */ |
383 | /* enable the CPIs by writing the base vector to their register */ | 383 | /* enable the CPIs by writing the base vector to their register */ |
384 | outb(VIC_DEFAULT_CPI_BASE, VIC_CPI_BASE_REGISTER); | 384 | outb(VIC_DEFAULT_CPI_BASE, VIC_CPI_BASE_REGISTER); |
@@ -628,15 +628,15 @@ void __init smp_boot_cpus(void) | |||
628 | /* now that the cat has probed the Voyager System Bus, sanity | 628 | /* now that the cat has probed the Voyager System Bus, sanity |
629 | * check the cpu map */ | 629 | * check the cpu map */ |
630 | if (((voyager_quad_processors | voyager_extended_vic_processors) | 630 | if (((voyager_quad_processors | voyager_extended_vic_processors) |
631 | & cpus_addr(phys_cpu_present_map)[0]) != | 631 | & cpus_addr(voyager_phys_cpu_present_map)[0]) != |
632 | cpus_addr(phys_cpu_present_map)[0]) { | 632 | cpus_addr(voyager_phys_cpu_present_map)[0]) { |
633 | /* should panic */ | 633 | /* should panic */ |
634 | printk("\n\n***WARNING*** " | 634 | printk("\n\n***WARNING*** " |
635 | "Sanity check of CPU present map FAILED\n"); | 635 | "Sanity check of CPU present map FAILED\n"); |
636 | } | 636 | } |
637 | } else if (voyager_level == 4) | 637 | } else if (voyager_level == 4) |
638 | voyager_extended_vic_processors = | 638 | voyager_extended_vic_processors = |
639 | cpus_addr(phys_cpu_present_map)[0]; | 639 | cpus_addr(voyager_phys_cpu_present_map)[0]; |
640 | 640 | ||
641 | /* this sets up the idle task to run on the current cpu */ | 641 | /* this sets up the idle task to run on the current cpu */ |
642 | voyager_extended_cpus = 1; | 642 | voyager_extended_cpus = 1; |
@@ -670,7 +670,7 @@ void __init smp_boot_cpus(void) | |||
670 | /* loop over all the extended VIC CPUs and boot them. The | 670 | /* loop over all the extended VIC CPUs and boot them. The |
671 | * Quad CPUs must be bootstrapped by their extended VIC cpu */ | 671 | * Quad CPUs must be bootstrapped by their extended VIC cpu */ |
672 | for (i = 0; i < nr_cpu_ids; i++) { | 672 | for (i = 0; i < nr_cpu_ids; i++) { |
673 | if (i == boot_cpu_id || !cpu_isset(i, phys_cpu_present_map)) | 673 | if (i == boot_cpu_id || !cpu_isset(i, voyager_phys_cpu_present_map)) |
674 | continue; | 674 | continue; |
675 | do_boot_cpu(i); | 675 | do_boot_cpu(i); |
676 | /* This udelay seems to be needed for the Quad boots | 676 | /* This udelay seems to be needed for the Quad boots |
diff --git a/arch/x86/mm/iomap_32.c b/arch/x86/mm/iomap_32.c index ca53224fc56c..6c2b1af16926 100644 --- a/arch/x86/mm/iomap_32.c +++ b/arch/x86/mm/iomap_32.c | |||
@@ -20,6 +20,24 @@ | |||
20 | #include <asm/pat.h> | 20 | #include <asm/pat.h> |
21 | #include <linux/module.h> | 21 | #include <linux/module.h> |
22 | 22 | ||
23 | #ifdef CONFIG_X86_PAE | ||
24 | int | ||
25 | is_io_mapping_possible(resource_size_t base, unsigned long size) | ||
26 | { | ||
27 | return 1; | ||
28 | } | ||
29 | #else | ||
30 | int | ||
31 | is_io_mapping_possible(resource_size_t base, unsigned long size) | ||
32 | { | ||
33 | /* There is no way to map greater than 1 << 32 address without PAE */ | ||
34 | if (base + size > 0x100000000ULL) | ||
35 | return 0; | ||
36 | |||
37 | return 1; | ||
38 | } | ||
39 | #endif | ||
40 | |||
23 | /* Map 'pfn' using fixed map 'type' and protections 'prot' | 41 | /* Map 'pfn' using fixed map 'type' and protections 'prot' |
24 | */ | 42 | */ |
25 | void * | 43 | void * |
diff --git a/arch/x86/mm/kmmio.c b/arch/x86/mm/kmmio.c index 93d82038af4b..9f205030d9aa 100644 --- a/arch/x86/mm/kmmio.c +++ b/arch/x86/mm/kmmio.c | |||
@@ -32,11 +32,14 @@ struct kmmio_fault_page { | |||
32 | struct list_head list; | 32 | struct list_head list; |
33 | struct kmmio_fault_page *release_next; | 33 | struct kmmio_fault_page *release_next; |
34 | unsigned long page; /* location of the fault page */ | 34 | unsigned long page; /* location of the fault page */ |
35 | bool old_presence; /* page presence prior to arming */ | ||
36 | bool armed; | ||
35 | 37 | ||
36 | /* | 38 | /* |
37 | * Number of times this page has been registered as a part | 39 | * Number of times this page has been registered as a part |
38 | * of a probe. If zero, page is disarmed and this may be freed. | 40 | * of a probe. If zero, page is disarmed and this may be freed. |
39 | * Used only by writers (RCU). | 41 | * Used only by writers (RCU) and post_kmmio_handler(). |
42 | * Protected by kmmio_lock, when linked into kmmio_page_table. | ||
40 | */ | 43 | */ |
41 | int count; | 44 | int count; |
42 | }; | 45 | }; |
@@ -105,57 +108,85 @@ static struct kmmio_fault_page *get_kmmio_fault_page(unsigned long page) | |||
105 | return NULL; | 108 | return NULL; |
106 | } | 109 | } |
107 | 110 | ||
108 | static void set_page_present(unsigned long addr, bool present, | 111 | static void set_pmd_presence(pmd_t *pmd, bool present, bool *old) |
109 | unsigned int *pglevel) | 112 | { |
113 | pmdval_t v = pmd_val(*pmd); | ||
114 | *old = !!(v & _PAGE_PRESENT); | ||
115 | v &= ~_PAGE_PRESENT; | ||
116 | if (present) | ||
117 | v |= _PAGE_PRESENT; | ||
118 | set_pmd(pmd, __pmd(v)); | ||
119 | } | ||
120 | |||
121 | static void set_pte_presence(pte_t *pte, bool present, bool *old) | ||
122 | { | ||
123 | pteval_t v = pte_val(*pte); | ||
124 | *old = !!(v & _PAGE_PRESENT); | ||
125 | v &= ~_PAGE_PRESENT; | ||
126 | if (present) | ||
127 | v |= _PAGE_PRESENT; | ||
128 | set_pte_atomic(pte, __pte(v)); | ||
129 | } | ||
130 | |||
131 | static int set_page_presence(unsigned long addr, bool present, bool *old) | ||
110 | { | 132 | { |
111 | pteval_t pteval; | ||
112 | pmdval_t pmdval; | ||
113 | unsigned int level; | 133 | unsigned int level; |
114 | pmd_t *pmd; | ||
115 | pte_t *pte = lookup_address(addr, &level); | 134 | pte_t *pte = lookup_address(addr, &level); |
116 | 135 | ||
117 | if (!pte) { | 136 | if (!pte) { |
118 | pr_err("kmmio: no pte for page 0x%08lx\n", addr); | 137 | pr_err("kmmio: no pte for page 0x%08lx\n", addr); |
119 | return; | 138 | return -1; |
120 | } | 139 | } |
121 | 140 | ||
122 | if (pglevel) | ||
123 | *pglevel = level; | ||
124 | |||
125 | switch (level) { | 141 | switch (level) { |
126 | case PG_LEVEL_2M: | 142 | case PG_LEVEL_2M: |
127 | pmd = (pmd_t *)pte; | 143 | set_pmd_presence((pmd_t *)pte, present, old); |
128 | pmdval = pmd_val(*pmd) & ~_PAGE_PRESENT; | ||
129 | if (present) | ||
130 | pmdval |= _PAGE_PRESENT; | ||
131 | set_pmd(pmd, __pmd(pmdval)); | ||
132 | break; | 144 | break; |
133 | |||
134 | case PG_LEVEL_4K: | 145 | case PG_LEVEL_4K: |
135 | pteval = pte_val(*pte) & ~_PAGE_PRESENT; | 146 | set_pte_presence(pte, present, old); |
136 | if (present) | ||
137 | pteval |= _PAGE_PRESENT; | ||
138 | set_pte_atomic(pte, __pte(pteval)); | ||
139 | break; | 147 | break; |
140 | |||
141 | default: | 148 | default: |
142 | pr_err("kmmio: unexpected page level 0x%x.\n", level); | 149 | pr_err("kmmio: unexpected page level 0x%x.\n", level); |
143 | return; | 150 | return -1; |
144 | } | 151 | } |
145 | 152 | ||
146 | __flush_tlb_one(addr); | 153 | __flush_tlb_one(addr); |
154 | return 0; | ||
147 | } | 155 | } |
148 | 156 | ||
149 | /** Mark the given page as not present. Access to it will trigger a fault. */ | 157 | /* |
150 | static void arm_kmmio_fault_page(unsigned long page, unsigned int *pglevel) | 158 | * Mark the given page as not present. Access to it will trigger a fault. |
159 | * | ||
160 | * Struct kmmio_fault_page is protected by RCU and kmmio_lock, but the | ||
161 | * protection is ignored here. RCU read lock is assumed held, so the struct | ||
162 | * will not disappear unexpectedly. Furthermore, the caller must guarantee, | ||
163 | * that double arming the same virtual address (page) cannot occur. | ||
164 | * | ||
165 | * Double disarming on the other hand is allowed, and may occur when a fault | ||
166 | * and mmiotrace shutdown happen simultaneously. | ||
167 | */ | ||
168 | static int arm_kmmio_fault_page(struct kmmio_fault_page *f) | ||
151 | { | 169 | { |
152 | set_page_present(page & PAGE_MASK, false, pglevel); | 170 | int ret; |
171 | WARN_ONCE(f->armed, KERN_ERR "kmmio page already armed.\n"); | ||
172 | if (f->armed) { | ||
173 | pr_warning("kmmio double-arm: page 0x%08lx, ref %d, old %d\n", | ||
174 | f->page, f->count, f->old_presence); | ||
175 | } | ||
176 | ret = set_page_presence(f->page, false, &f->old_presence); | ||
177 | WARN_ONCE(ret < 0, KERN_ERR "kmmio arming 0x%08lx failed.\n", f->page); | ||
178 | f->armed = true; | ||
179 | return ret; | ||
153 | } | 180 | } |
154 | 181 | ||
155 | /** Mark the given page as present. */ | 182 | /** Restore the given page to saved presence state. */ |
156 | static void disarm_kmmio_fault_page(unsigned long page, unsigned int *pglevel) | 183 | static void disarm_kmmio_fault_page(struct kmmio_fault_page *f) |
157 | { | 184 | { |
158 | set_page_present(page & PAGE_MASK, true, pglevel); | 185 | bool tmp; |
186 | int ret = set_page_presence(f->page, f->old_presence, &tmp); | ||
187 | WARN_ONCE(ret < 0, | ||
188 | KERN_ERR "kmmio disarming 0x%08lx failed.\n", f->page); | ||
189 | f->armed = false; | ||
159 | } | 190 | } |
160 | 191 | ||
161 | /* | 192 | /* |
@@ -202,28 +233,32 @@ int kmmio_handler(struct pt_regs *regs, unsigned long addr) | |||
202 | 233 | ||
203 | ctx = &get_cpu_var(kmmio_ctx); | 234 | ctx = &get_cpu_var(kmmio_ctx); |
204 | if (ctx->active) { | 235 | if (ctx->active) { |
205 | disarm_kmmio_fault_page(faultpage->page, NULL); | ||
206 | if (addr == ctx->addr) { | 236 | if (addr == ctx->addr) { |
207 | /* | 237 | /* |
208 | * On SMP we sometimes get recursive probe hits on the | 238 | * A second fault on the same page means some other |
209 | * same address. Context is already saved, fall out. | 239 | * condition needs handling by do_page_fault(), the |
240 | * page really not being present is the most common. | ||
210 | */ | 241 | */ |
211 | pr_debug("kmmio: duplicate probe hit on CPU %d, for " | 242 | pr_debug("kmmio: secondary hit for 0x%08lx CPU %d.\n", |
212 | "address 0x%08lx.\n", | 243 | addr, smp_processor_id()); |
213 | smp_processor_id(), addr); | 244 | |
214 | ret = 1; | 245 | if (!faultpage->old_presence) |
215 | goto no_kmmio_ctx; | 246 | pr_info("kmmio: unexpected secondary hit for " |
216 | } | 247 | "address 0x%08lx on CPU %d.\n", addr, |
217 | /* | 248 | smp_processor_id()); |
218 | * Prevent overwriting already in-flight context. | 249 | } else { |
219 | * This should not happen, let's hope disarming at least | 250 | /* |
220 | * prevents a panic. | 251 | * Prevent overwriting already in-flight context. |
221 | */ | 252 | * This should not happen, let's hope disarming at |
222 | pr_emerg("kmmio: recursive probe hit on CPU %d, " | 253 | * least prevents a panic. |
254 | */ | ||
255 | pr_emerg("kmmio: recursive probe hit on CPU %d, " | ||
223 | "for address 0x%08lx. Ignoring.\n", | 256 | "for address 0x%08lx. Ignoring.\n", |
224 | smp_processor_id(), addr); | 257 | smp_processor_id(), addr); |
225 | pr_emerg("kmmio: previous hit was at 0x%08lx.\n", | 258 | pr_emerg("kmmio: previous hit was at 0x%08lx.\n", |
226 | ctx->addr); | 259 | ctx->addr); |
260 | disarm_kmmio_fault_page(faultpage); | ||
261 | } | ||
227 | goto no_kmmio_ctx; | 262 | goto no_kmmio_ctx; |
228 | } | 263 | } |
229 | ctx->active++; | 264 | ctx->active++; |
@@ -244,7 +279,7 @@ int kmmio_handler(struct pt_regs *regs, unsigned long addr) | |||
244 | regs->flags &= ~X86_EFLAGS_IF; | 279 | regs->flags &= ~X86_EFLAGS_IF; |
245 | 280 | ||
246 | /* Now we set present bit in PTE and single step. */ | 281 | /* Now we set present bit in PTE and single step. */ |
247 | disarm_kmmio_fault_page(ctx->fpage->page, NULL); | 282 | disarm_kmmio_fault_page(ctx->fpage); |
248 | 283 | ||
249 | /* | 284 | /* |
250 | * If another cpu accesses the same page while we are stepping, | 285 | * If another cpu accesses the same page while we are stepping, |
@@ -275,7 +310,7 @@ static int post_kmmio_handler(unsigned long condition, struct pt_regs *regs) | |||
275 | struct kmmio_context *ctx = &get_cpu_var(kmmio_ctx); | 310 | struct kmmio_context *ctx = &get_cpu_var(kmmio_ctx); |
276 | 311 | ||
277 | if (!ctx->active) { | 312 | if (!ctx->active) { |
278 | pr_debug("kmmio: spurious debug trap on CPU %d.\n", | 313 | pr_warning("kmmio: spurious debug trap on CPU %d.\n", |
279 | smp_processor_id()); | 314 | smp_processor_id()); |
280 | goto out; | 315 | goto out; |
281 | } | 316 | } |
@@ -283,7 +318,11 @@ static int post_kmmio_handler(unsigned long condition, struct pt_regs *regs) | |||
283 | if (ctx->probe && ctx->probe->post_handler) | 318 | if (ctx->probe && ctx->probe->post_handler) |
284 | ctx->probe->post_handler(ctx->probe, condition, regs); | 319 | ctx->probe->post_handler(ctx->probe, condition, regs); |
285 | 320 | ||
286 | arm_kmmio_fault_page(ctx->fpage->page, NULL); | 321 | /* Prevent racing against release_kmmio_fault_page(). */ |
322 | spin_lock(&kmmio_lock); | ||
323 | if (ctx->fpage->count) | ||
324 | arm_kmmio_fault_page(ctx->fpage); | ||
325 | spin_unlock(&kmmio_lock); | ||
287 | 326 | ||
288 | regs->flags &= ~X86_EFLAGS_TF; | 327 | regs->flags &= ~X86_EFLAGS_TF; |
289 | regs->flags |= ctx->saved_flags; | 328 | regs->flags |= ctx->saved_flags; |
@@ -315,20 +354,24 @@ static int add_kmmio_fault_page(unsigned long page) | |||
315 | f = get_kmmio_fault_page(page); | 354 | f = get_kmmio_fault_page(page); |
316 | if (f) { | 355 | if (f) { |
317 | if (!f->count) | 356 | if (!f->count) |
318 | arm_kmmio_fault_page(f->page, NULL); | 357 | arm_kmmio_fault_page(f); |
319 | f->count++; | 358 | f->count++; |
320 | return 0; | 359 | return 0; |
321 | } | 360 | } |
322 | 361 | ||
323 | f = kmalloc(sizeof(*f), GFP_ATOMIC); | 362 | f = kzalloc(sizeof(*f), GFP_ATOMIC); |
324 | if (!f) | 363 | if (!f) |
325 | return -1; | 364 | return -1; |
326 | 365 | ||
327 | f->count = 1; | 366 | f->count = 1; |
328 | f->page = page; | 367 | f->page = page; |
329 | list_add_rcu(&f->list, kmmio_page_list(f->page)); | ||
330 | 368 | ||
331 | arm_kmmio_fault_page(f->page, NULL); | 369 | if (arm_kmmio_fault_page(f)) { |
370 | kfree(f); | ||
371 | return -1; | ||
372 | } | ||
373 | |||
374 | list_add_rcu(&f->list, kmmio_page_list(f->page)); | ||
332 | 375 | ||
333 | return 0; | 376 | return 0; |
334 | } | 377 | } |
@@ -347,7 +390,7 @@ static void release_kmmio_fault_page(unsigned long page, | |||
347 | f->count--; | 390 | f->count--; |
348 | BUG_ON(f->count < 0); | 391 | BUG_ON(f->count < 0); |
349 | if (!f->count) { | 392 | if (!f->count) { |
350 | disarm_kmmio_fault_page(f->page, NULL); | 393 | disarm_kmmio_fault_page(f); |
351 | f->release_next = *release_list; | 394 | f->release_next = *release_list; |
352 | *release_list = f; | 395 | *release_list = f; |
353 | } | 396 | } |
diff --git a/arch/x86/mm/testmmiotrace.c b/arch/x86/mm/testmmiotrace.c index ab50a8d7402c..427fd1b56df5 100644 --- a/arch/x86/mm/testmmiotrace.c +++ b/arch/x86/mm/testmmiotrace.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Written by Pekka Paalanen, 2008 <pq@iki.fi> | 2 | * Written by Pekka Paalanen, 2008-2009 <pq@iki.fi> |
3 | */ | 3 | */ |
4 | #include <linux/module.h> | 4 | #include <linux/module.h> |
5 | #include <linux/io.h> | 5 | #include <linux/io.h> |
@@ -9,35 +9,74 @@ | |||
9 | 9 | ||
10 | static unsigned long mmio_address; | 10 | static unsigned long mmio_address; |
11 | module_param(mmio_address, ulong, 0); | 11 | module_param(mmio_address, ulong, 0); |
12 | MODULE_PARM_DESC(mmio_address, "Start address of the mapping of 16 kB."); | 12 | MODULE_PARM_DESC(mmio_address, " Start address of the mapping of 16 kB " |
13 | "(or 8 MB if read_far is non-zero)."); | ||
14 | |||
15 | static unsigned long read_far = 0x400100; | ||
16 | module_param(read_far, ulong, 0); | ||
17 | MODULE_PARM_DESC(read_far, " Offset of a 32-bit read within 8 MB " | ||
18 | "(default: 0x400100)."); | ||
19 | |||
20 | static unsigned v16(unsigned i) | ||
21 | { | ||
22 | return i * 12 + 7; | ||
23 | } | ||
24 | |||
25 | static unsigned v32(unsigned i) | ||
26 | { | ||
27 | return i * 212371 + 13; | ||
28 | } | ||
13 | 29 | ||
14 | static void do_write_test(void __iomem *p) | 30 | static void do_write_test(void __iomem *p) |
15 | { | 31 | { |
16 | unsigned int i; | 32 | unsigned int i; |
33 | pr_info(MODULE_NAME ": write test.\n"); | ||
17 | mmiotrace_printk("Write test.\n"); | 34 | mmiotrace_printk("Write test.\n"); |
35 | |||
18 | for (i = 0; i < 256; i++) | 36 | for (i = 0; i < 256; i++) |
19 | iowrite8(i, p + i); | 37 | iowrite8(i, p + i); |
38 | |||
20 | for (i = 1024; i < (5 * 1024); i += 2) | 39 | for (i = 1024; i < (5 * 1024); i += 2) |
21 | iowrite16(i * 12 + 7, p + i); | 40 | iowrite16(v16(i), p + i); |
41 | |||
22 | for (i = (5 * 1024); i < (16 * 1024); i += 4) | 42 | for (i = (5 * 1024); i < (16 * 1024); i += 4) |
23 | iowrite32(i * 212371 + 13, p + i); | 43 | iowrite32(v32(i), p + i); |
24 | } | 44 | } |
25 | 45 | ||
26 | static void do_read_test(void __iomem *p) | 46 | static void do_read_test(void __iomem *p) |
27 | { | 47 | { |
28 | unsigned int i; | 48 | unsigned int i; |
49 | unsigned errs[3] = { 0 }; | ||
50 | pr_info(MODULE_NAME ": read test.\n"); | ||
29 | mmiotrace_printk("Read test.\n"); | 51 | mmiotrace_printk("Read test.\n"); |
52 | |||
30 | for (i = 0; i < 256; i++) | 53 | for (i = 0; i < 256; i++) |
31 | ioread8(p + i); | 54 | if (ioread8(p + i) != i) |
55 | ++errs[0]; | ||
56 | |||
32 | for (i = 1024; i < (5 * 1024); i += 2) | 57 | for (i = 1024; i < (5 * 1024); i += 2) |
33 | ioread16(p + i); | 58 | if (ioread16(p + i) != v16(i)) |
59 | ++errs[1]; | ||
60 | |||
34 | for (i = (5 * 1024); i < (16 * 1024); i += 4) | 61 | for (i = (5 * 1024); i < (16 * 1024); i += 4) |
35 | ioread32(p + i); | 62 | if (ioread32(p + i) != v32(i)) |
63 | ++errs[2]; | ||
64 | |||
65 | mmiotrace_printk("Read errors: 8-bit %d, 16-bit %d, 32-bit %d.\n", | ||
66 | errs[0], errs[1], errs[2]); | ||
36 | } | 67 | } |
37 | 68 | ||
38 | static void do_test(void) | 69 | static void do_read_far_test(void __iomem *p) |
39 | { | 70 | { |
40 | void __iomem *p = ioremap_nocache(mmio_address, 0x4000); | 71 | pr_info(MODULE_NAME ": read far test.\n"); |
72 | mmiotrace_printk("Read far test.\n"); | ||
73 | |||
74 | ioread32(p + read_far); | ||
75 | } | ||
76 | |||
77 | static void do_test(unsigned long size) | ||
78 | { | ||
79 | void __iomem *p = ioremap_nocache(mmio_address, size); | ||
41 | if (!p) { | 80 | if (!p) { |
42 | pr_err(MODULE_NAME ": could not ioremap, aborting.\n"); | 81 | pr_err(MODULE_NAME ": could not ioremap, aborting.\n"); |
43 | return; | 82 | return; |
@@ -45,11 +84,15 @@ static void do_test(void) | |||
45 | mmiotrace_printk("ioremap returned %p.\n", p); | 84 | mmiotrace_printk("ioremap returned %p.\n", p); |
46 | do_write_test(p); | 85 | do_write_test(p); |
47 | do_read_test(p); | 86 | do_read_test(p); |
87 | if (read_far && read_far < size - 4) | ||
88 | do_read_far_test(p); | ||
48 | iounmap(p); | 89 | iounmap(p); |
49 | } | 90 | } |
50 | 91 | ||
51 | static int __init init(void) | 92 | static int __init init(void) |
52 | { | 93 | { |
94 | unsigned long size = (read_far) ? (8 << 20) : (16 << 10); | ||
95 | |||
53 | if (mmio_address == 0) { | 96 | if (mmio_address == 0) { |
54 | pr_err(MODULE_NAME ": you have to use the module argument " | 97 | pr_err(MODULE_NAME ": you have to use the module argument " |
55 | "mmio_address.\n"); | 98 | "mmio_address.\n"); |
@@ -58,10 +101,11 @@ static int __init init(void) | |||
58 | return -ENXIO; | 101 | return -ENXIO; |
59 | } | 102 | } |
60 | 103 | ||
61 | pr_warning(MODULE_NAME ": WARNING: mapping 16 kB @ 0x%08lx " | 104 | pr_warning(MODULE_NAME ": WARNING: mapping %lu kB @ 0x%08lx in PCI " |
62 | "in PCI address space, and writing " | 105 | "address space, and writing 16 kB of rubbish in there.\n", |
63 | "rubbish in there.\n", mmio_address); | 106 | size >> 10, mmio_address); |
64 | do_test(); | 107 | do_test(size); |
108 | pr_info(MODULE_NAME ": All done.\n"); | ||
65 | return 0; | 109 | return 0; |
66 | } | 110 | } |
67 | 111 | ||
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c index bea215230b20..b58e96338149 100644 --- a/arch/x86/xen/enlighten.c +++ b/arch/x86/xen/enlighten.c | |||
@@ -1672,6 +1672,9 @@ asmlinkage void __init xen_start_kernel(void) | |||
1672 | possible map and a non-dummy shared_info. */ | 1672 | possible map and a non-dummy shared_info. */ |
1673 | per_cpu(xen_vcpu, 0) = &HYPERVISOR_shared_info->vcpu_info[0]; | 1673 | per_cpu(xen_vcpu, 0) = &HYPERVISOR_shared_info->vcpu_info[0]; |
1674 | 1674 | ||
1675 | local_irq_disable(); | ||
1676 | early_boot_irqs_off(); | ||
1677 | |||
1675 | xen_raw_console_write("mapping kernel into physical memory\n"); | 1678 | xen_raw_console_write("mapping kernel into physical memory\n"); |
1676 | pgd = xen_setup_kernel_pagetable(pgd, xen_start_info->nr_pages); | 1679 | pgd = xen_setup_kernel_pagetable(pgd, xen_start_info->nr_pages); |
1677 | 1680 | ||
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c index cc4649577a61..6dab63bdc4c1 100644 --- a/drivers/gpu/drm/i915/i915_dma.c +++ b/drivers/gpu/drm/i915/i915_dma.c | |||
@@ -1090,6 +1090,11 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) | |||
1090 | dev_priv->mm.gtt_mapping = | 1090 | dev_priv->mm.gtt_mapping = |
1091 | io_mapping_create_wc(dev->agp->base, | 1091 | io_mapping_create_wc(dev->agp->base, |
1092 | dev->agp->agp_info.aper_size * 1024*1024); | 1092 | dev->agp->agp_info.aper_size * 1024*1024); |
1093 | if (dev_priv->mm.gtt_mapping == NULL) { | ||
1094 | ret = -EIO; | ||
1095 | goto out_rmmap; | ||
1096 | } | ||
1097 | |||
1093 | /* Set up a WC MTRR for non-PAT systems. This is more common than | 1098 | /* Set up a WC MTRR for non-PAT systems. This is more common than |
1094 | * one would think, because the kernel disables PAT on first | 1099 | * one would think, because the kernel disables PAT on first |
1095 | * generation Core chips because WC PAT gets overridden by a UC | 1100 | * generation Core chips because WC PAT gets overridden by a UC |
@@ -1122,7 +1127,7 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) | |||
1122 | if (!I915_NEED_GFX_HWS(dev)) { | 1127 | if (!I915_NEED_GFX_HWS(dev)) { |
1123 | ret = i915_init_phys_hws(dev); | 1128 | ret = i915_init_phys_hws(dev); |
1124 | if (ret != 0) | 1129 | if (ret != 0) |
1125 | goto out_rmmap; | 1130 | goto out_iomapfree; |
1126 | } | 1131 | } |
1127 | 1132 | ||
1128 | /* On the 945G/GM, the chipset reports the MSI capability on the | 1133 | /* On the 945G/GM, the chipset reports the MSI capability on the |
@@ -1161,6 +1166,8 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags) | |||
1161 | 1166 | ||
1162 | return 0; | 1167 | return 0; |
1163 | 1168 | ||
1169 | out_iomapfree: | ||
1170 | io_mapping_free(dev_priv->mm.gtt_mapping); | ||
1164 | out_rmmap: | 1171 | out_rmmap: |
1165 | iounmap(dev_priv->regs); | 1172 | iounmap(dev_priv->regs); |
1166 | free_priv: | 1173 | free_priv: |
diff --git a/drivers/media/dvb/b2c2/flexcop-hw-filter.c b/drivers/media/dvb/b2c2/flexcop-hw-filter.c index b386cc66c6b3..451974ba32f3 100644 --- a/drivers/media/dvb/b2c2/flexcop-hw-filter.c +++ b/drivers/media/dvb/b2c2/flexcop-hw-filter.c | |||
@@ -192,6 +192,7 @@ int flexcop_pid_feed_control(struct flexcop_device *fc, struct dvb_demux_feed *d | |||
192 | 192 | ||
193 | return 0; | 193 | return 0; |
194 | } | 194 | } |
195 | EXPORT_SYMBOL(flexcop_pid_feed_control); | ||
195 | 196 | ||
196 | void flexcop_hw_filter_init(struct flexcop_device *fc) | 197 | void flexcop_hw_filter_init(struct flexcop_device *fc) |
197 | { | 198 | { |
diff --git a/drivers/media/dvb/b2c2/flexcop-pci.c b/drivers/media/dvb/b2c2/flexcop-pci.c index 5b30dfc7846b..76e37fd96bb6 100644 --- a/drivers/media/dvb/b2c2/flexcop-pci.c +++ b/drivers/media/dvb/b2c2/flexcop-pci.c | |||
@@ -13,9 +13,9 @@ static int enable_pid_filtering = 1; | |||
13 | module_param(enable_pid_filtering, int, 0444); | 13 | module_param(enable_pid_filtering, int, 0444); |
14 | MODULE_PARM_DESC(enable_pid_filtering, "enable hardware pid filtering: supported values: 0 (fullts), 1"); | 14 | MODULE_PARM_DESC(enable_pid_filtering, "enable hardware pid filtering: supported values: 0 (fullts), 1"); |
15 | 15 | ||
16 | static int irq_chk_intv; | 16 | static int irq_chk_intv = 100; |
17 | module_param(irq_chk_intv, int, 0644); | 17 | module_param(irq_chk_intv, int, 0644); |
18 | MODULE_PARM_DESC(irq_chk_intv, "set the interval for IRQ watchdog (currently just debugging)."); | 18 | MODULE_PARM_DESC(irq_chk_intv, "set the interval for IRQ streaming watchdog."); |
19 | 19 | ||
20 | #ifdef CONFIG_DVB_B2C2_FLEXCOP_DEBUG | 20 | #ifdef CONFIG_DVB_B2C2_FLEXCOP_DEBUG |
21 | #define dprintk(level,args...) \ | 21 | #define dprintk(level,args...) \ |
@@ -34,7 +34,9 @@ MODULE_PARM_DESC(irq_chk_intv, "set the interval for IRQ watchdog (currently jus | |||
34 | 34 | ||
35 | static int debug; | 35 | static int debug; |
36 | module_param(debug, int, 0644); | 36 | module_param(debug, int, 0644); |
37 | MODULE_PARM_DESC(debug, "set debug level (1=info,2=regs,4=TS,8=irqdma (|-able))." DEBSTATUS); | 37 | MODULE_PARM_DESC(debug, |
38 | "set debug level (1=info,2=regs,4=TS,8=irqdma,16=check (|-able))." | ||
39 | DEBSTATUS); | ||
38 | 40 | ||
39 | #define DRIVER_VERSION "0.1" | 41 | #define DRIVER_VERSION "0.1" |
40 | #define DRIVER_NAME "Technisat/B2C2 FlexCop II/IIb/III Digital TV PCI Driver" | 42 | #define DRIVER_NAME "Technisat/B2C2 FlexCop II/IIb/III Digital TV PCI Driver" |
@@ -58,6 +60,8 @@ struct flexcop_pci { | |||
58 | int active_dma1_addr; /* 0 = addr0 of dma1; 1 = addr1 of dma1 */ | 60 | int active_dma1_addr; /* 0 = addr0 of dma1; 1 = addr1 of dma1 */ |
59 | u32 last_dma1_cur_pos; /* position of the pointer last time the timer/packet irq occured */ | 61 | u32 last_dma1_cur_pos; /* position of the pointer last time the timer/packet irq occured */ |
60 | int count; | 62 | int count; |
63 | int count_prev; | ||
64 | int stream_problem; | ||
61 | 65 | ||
62 | spinlock_t irq_lock; | 66 | spinlock_t irq_lock; |
63 | 67 | ||
@@ -103,18 +107,32 @@ static void flexcop_pci_irq_check_work(struct work_struct *work) | |||
103 | container_of(work, struct flexcop_pci, irq_check_work.work); | 107 | container_of(work, struct flexcop_pci, irq_check_work.work); |
104 | struct flexcop_device *fc = fc_pci->fc_dev; | 108 | struct flexcop_device *fc = fc_pci->fc_dev; |
105 | 109 | ||
106 | flexcop_ibi_value v = fc->read_ibi_reg(fc,sram_dest_reg_714); | 110 | if (fc->feedcount) { |
107 | 111 | ||
108 | flexcop_dump_reg(fc_pci->fc_dev,dma1_000,4); | 112 | if (fc_pci->count == fc_pci->count_prev) { |
109 | 113 | deb_chk("no IRQ since the last check\n"); | |
110 | if (v.sram_dest_reg_714.net_ovflow_error) | 114 | if (fc_pci->stream_problem++ == 3) { |
111 | deb_chk("sram net_ovflow_error\n"); | 115 | struct dvb_demux_feed *feed; |
112 | if (v.sram_dest_reg_714.media_ovflow_error) | 116 | |
113 | deb_chk("sram media_ovflow_error\n"); | 117 | spin_lock_irq(&fc->demux.lock); |
114 | if (v.sram_dest_reg_714.cai_ovflow_error) | 118 | list_for_each_entry(feed, &fc->demux.feed_list, |
115 | deb_chk("sram cai_ovflow_error\n"); | 119 | list_head) { |
116 | if (v.sram_dest_reg_714.cai_ovflow_error) | 120 | flexcop_pid_feed_control(fc, feed, 0); |
117 | deb_chk("sram cai_ovflow_error\n"); | 121 | } |
122 | |||
123 | list_for_each_entry(feed, &fc->demux.feed_list, | ||
124 | list_head) { | ||
125 | flexcop_pid_feed_control(fc, feed, 1); | ||
126 | } | ||
127 | spin_unlock_irq(&fc->demux.lock); | ||
128 | |||
129 | fc_pci->stream_problem = 0; | ||
130 | } | ||
131 | } else { | ||
132 | fc_pci->stream_problem = 0; | ||
133 | fc_pci->count_prev = fc_pci->count; | ||
134 | } | ||
135 | } | ||
118 | 136 | ||
119 | schedule_delayed_work(&fc_pci->irq_check_work, | 137 | schedule_delayed_work(&fc_pci->irq_check_work, |
120 | msecs_to_jiffies(irq_chk_intv < 100 ? 100 : irq_chk_intv)); | 138 | msecs_to_jiffies(irq_chk_intv < 100 ? 100 : irq_chk_intv)); |
@@ -216,16 +234,12 @@ static int flexcop_pci_stream_control(struct flexcop_device *fc, int onoff) | |||
216 | flexcop_dma_control_timer_irq(fc,FC_DMA_1,1); | 234 | flexcop_dma_control_timer_irq(fc,FC_DMA_1,1); |
217 | deb_irq("IRQ enabled\n"); | 235 | deb_irq("IRQ enabled\n"); |
218 | 236 | ||
237 | fc_pci->count_prev = fc_pci->count; | ||
238 | |||
219 | // fc_pci->active_dma1_addr = 0; | 239 | // fc_pci->active_dma1_addr = 0; |
220 | // flexcop_dma_control_size_irq(fc,FC_DMA_1,1); | 240 | // flexcop_dma_control_size_irq(fc,FC_DMA_1,1); |
221 | 241 | ||
222 | if (irq_chk_intv > 0) | ||
223 | schedule_delayed_work(&fc_pci->irq_check_work, | ||
224 | msecs_to_jiffies(irq_chk_intv < 100 ? 100 : irq_chk_intv)); | ||
225 | } else { | 242 | } else { |
226 | if (irq_chk_intv > 0) | ||
227 | cancel_delayed_work(&fc_pci->irq_check_work); | ||
228 | |||
229 | flexcop_dma_control_timer_irq(fc,FC_DMA_1,0); | 243 | flexcop_dma_control_timer_irq(fc,FC_DMA_1,0); |
230 | deb_irq("IRQ disabled\n"); | 244 | deb_irq("IRQ disabled\n"); |
231 | 245 | ||
@@ -299,8 +313,6 @@ static int flexcop_pci_init(struct flexcop_pci *fc_pci) | |||
299 | IRQF_SHARED, DRIVER_NAME, fc_pci)) != 0) | 313 | IRQF_SHARED, DRIVER_NAME, fc_pci)) != 0) |
300 | goto err_pci_iounmap; | 314 | goto err_pci_iounmap; |
301 | 315 | ||
302 | |||
303 | |||
304 | fc_pci->init_state |= FC_PCI_INIT; | 316 | fc_pci->init_state |= FC_PCI_INIT; |
305 | return ret; | 317 | return ret; |
306 | 318 | ||
@@ -375,6 +387,10 @@ static int flexcop_pci_probe(struct pci_dev *pdev, const struct pci_device_id *e | |||
375 | 387 | ||
376 | INIT_DELAYED_WORK(&fc_pci->irq_check_work, flexcop_pci_irq_check_work); | 388 | INIT_DELAYED_WORK(&fc_pci->irq_check_work, flexcop_pci_irq_check_work); |
377 | 389 | ||
390 | if (irq_chk_intv > 0) | ||
391 | schedule_delayed_work(&fc_pci->irq_check_work, | ||
392 | msecs_to_jiffies(irq_chk_intv < 100 ? 100 : irq_chk_intv)); | ||
393 | |||
378 | return ret; | 394 | return ret; |
379 | 395 | ||
380 | err_fc_exit: | 396 | err_fc_exit: |
@@ -393,6 +409,9 @@ static void flexcop_pci_remove(struct pci_dev *pdev) | |||
393 | { | 409 | { |
394 | struct flexcop_pci *fc_pci = pci_get_drvdata(pdev); | 410 | struct flexcop_pci *fc_pci = pci_get_drvdata(pdev); |
395 | 411 | ||
412 | if (irq_chk_intv > 0) | ||
413 | cancel_delayed_work(&fc_pci->irq_check_work); | ||
414 | |||
396 | flexcop_pci_dma_exit(fc_pci); | 415 | flexcop_pci_dma_exit(fc_pci); |
397 | flexcop_device_exit(fc_pci->fc_dev); | 416 | flexcop_device_exit(fc_pci->fc_dev); |
398 | flexcop_pci_exit(fc_pci); | 417 | flexcop_pci_exit(fc_pci); |
diff --git a/drivers/media/dvb/b2c2/flexcop.c b/drivers/media/dvb/b2c2/flexcop.c index 676413a915b4..91068952b502 100644 --- a/drivers/media/dvb/b2c2/flexcop.c +++ b/drivers/media/dvb/b2c2/flexcop.c | |||
@@ -212,8 +212,7 @@ void flexcop_reset_block_300(struct flexcop_device *fc) | |||
212 | v210.sw_reset_210.Block_reset_enable = 0xb2; | 212 | v210.sw_reset_210.Block_reset_enable = 0xb2; |
213 | 213 | ||
214 | fc->write_ibi_reg(fc,sw_reset_210,v210); | 214 | fc->write_ibi_reg(fc,sw_reset_210,v210); |
215 | msleep(1); | 215 | udelay(1000); |
216 | |||
217 | fc->write_ibi_reg(fc,ctrl_208,v208_save); | 216 | fc->write_ibi_reg(fc,ctrl_208,v208_save); |
218 | } | 217 | } |
219 | 218 | ||
diff --git a/drivers/media/video/em28xx/em28xx-audio.c b/drivers/media/video/em28xx/em28xx-audio.c index 5d882a44e3ee..2ac738fa6a07 100644 --- a/drivers/media/video/em28xx/em28xx-audio.c +++ b/drivers/media/video/em28xx/em28xx-audio.c | |||
@@ -463,6 +463,8 @@ static int em28xx_audio_init(struct em28xx *dev) | |||
463 | pcm->info_flags = 0; | 463 | pcm->info_flags = 0; |
464 | pcm->private_data = dev; | 464 | pcm->private_data = dev; |
465 | strcpy(pcm->name, "Empia 28xx Capture"); | 465 | strcpy(pcm->name, "Empia 28xx Capture"); |
466 | |||
467 | snd_card_set_dev(card, &dev->udev->dev); | ||
466 | strcpy(card->driver, "Empia Em28xx Audio"); | 468 | strcpy(card->driver, "Empia Em28xx Audio"); |
467 | strcpy(card->shortname, "Em28xx Audio"); | 469 | strcpy(card->shortname, "Em28xx Audio"); |
468 | strcpy(card->longname, "Empia Em28xx Audio"); | 470 | strcpy(card->longname, "Empia Em28xx Audio"); |
diff --git a/drivers/media/video/pxa_camera.c b/drivers/media/video/pxa_camera.c index a1d6008efcbb..07c334f25aae 100644 --- a/drivers/media/video/pxa_camera.c +++ b/drivers/media/video/pxa_camera.c | |||
@@ -1155,23 +1155,23 @@ static int pxa_camera_set_fmt(struct soc_camera_device *icd, | |||
1155 | { | 1155 | { |
1156 | struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); | 1156 | struct soc_camera_host *ici = to_soc_camera_host(icd->dev.parent); |
1157 | struct pxa_camera_dev *pcdev = ici->priv; | 1157 | struct pxa_camera_dev *pcdev = ici->priv; |
1158 | const struct soc_camera_data_format *host_fmt, *cam_fmt = NULL; | 1158 | const struct soc_camera_data_format *cam_fmt = NULL; |
1159 | const struct soc_camera_format_xlate *xlate; | 1159 | const struct soc_camera_format_xlate *xlate = NULL; |
1160 | struct soc_camera_sense sense = { | 1160 | struct soc_camera_sense sense = { |
1161 | .master_clock = pcdev->mclk, | 1161 | .master_clock = pcdev->mclk, |
1162 | .pixel_clock_max = pcdev->ciclk / 4, | 1162 | .pixel_clock_max = pcdev->ciclk / 4, |
1163 | }; | 1163 | }; |
1164 | int ret, buswidth; | 1164 | int ret; |
1165 | 1165 | ||
1166 | xlate = soc_camera_xlate_by_fourcc(icd, pixfmt); | 1166 | if (pixfmt) { |
1167 | if (!xlate) { | 1167 | xlate = soc_camera_xlate_by_fourcc(icd, pixfmt); |
1168 | dev_warn(&ici->dev, "Format %x not found\n", pixfmt); | 1168 | if (!xlate) { |
1169 | return -EINVAL; | 1169 | dev_warn(&ici->dev, "Format %x not found\n", pixfmt); |
1170 | } | 1170 | return -EINVAL; |
1171 | } | ||
1171 | 1172 | ||
1172 | buswidth = xlate->buswidth; | 1173 | cam_fmt = xlate->cam_fmt; |
1173 | host_fmt = xlate->host_fmt; | 1174 | } |
1174 | cam_fmt = xlate->cam_fmt; | ||
1175 | 1175 | ||
1176 | /* If PCLK is used to latch data from the sensor, check sense */ | 1176 | /* If PCLK is used to latch data from the sensor, check sense */ |
1177 | if (pcdev->platform_flags & PXA_CAMERA_PCLK_EN) | 1177 | if (pcdev->platform_flags & PXA_CAMERA_PCLK_EN) |
@@ -1201,8 +1201,8 @@ static int pxa_camera_set_fmt(struct soc_camera_device *icd, | |||
1201 | } | 1201 | } |
1202 | 1202 | ||
1203 | if (pixfmt && !ret) { | 1203 | if (pixfmt && !ret) { |
1204 | icd->buswidth = buswidth; | 1204 | icd->buswidth = xlate->buswidth; |
1205 | icd->current_fmt = host_fmt; | 1205 | icd->current_fmt = xlate->host_fmt; |
1206 | } | 1206 | } |
1207 | 1207 | ||
1208 | return ret; | 1208 | return ret; |
diff --git a/drivers/media/video/sh_mobile_ceu_camera.c b/drivers/media/video/sh_mobile_ceu_camera.c index 9a2586b07a05..ddcb81d0b81a 100644 --- a/drivers/media/video/sh_mobile_ceu_camera.c +++ b/drivers/media/video/sh_mobile_ceu_camera.c | |||
@@ -603,21 +603,18 @@ static int sh_mobile_ceu_set_fmt(struct soc_camera_device *icd, | |||
603 | const struct soc_camera_format_xlate *xlate; | 603 | const struct soc_camera_format_xlate *xlate; |
604 | int ret; | 604 | int ret; |
605 | 605 | ||
606 | if (!pixfmt) | ||
607 | return icd->ops->set_fmt(icd, pixfmt, rect); | ||
608 | |||
606 | xlate = soc_camera_xlate_by_fourcc(icd, pixfmt); | 609 | xlate = soc_camera_xlate_by_fourcc(icd, pixfmt); |
607 | if (!xlate) { | 610 | if (!xlate) { |
608 | dev_warn(&ici->dev, "Format %x not found\n", pixfmt); | 611 | dev_warn(&ici->dev, "Format %x not found\n", pixfmt); |
609 | return -EINVAL; | 612 | return -EINVAL; |
610 | } | 613 | } |
611 | 614 | ||
612 | switch (pixfmt) { | 615 | ret = icd->ops->set_fmt(icd, xlate->cam_fmt->fourcc, rect); |
613 | case 0: /* Only geometry change */ | ||
614 | ret = icd->ops->set_fmt(icd, pixfmt, rect); | ||
615 | break; | ||
616 | default: | ||
617 | ret = icd->ops->set_fmt(icd, xlate->cam_fmt->fourcc, rect); | ||
618 | } | ||
619 | 616 | ||
620 | if (pixfmt && !ret) { | 617 | if (!ret) { |
621 | icd->buswidth = xlate->buswidth; | 618 | icd->buswidth = xlate->buswidth; |
622 | icd->current_fmt = xlate->host_fmt; | 619 | icd->current_fmt = xlate->host_fmt; |
623 | pcdev->camera_fmt = xlate->cam_fmt; | 620 | pcdev->camera_fmt = xlate->cam_fmt; |
diff --git a/drivers/misc/hpilo.c b/drivers/misc/hpilo.c index f26667a7abf7..cf991850f01b 100644 --- a/drivers/misc/hpilo.c +++ b/drivers/misc/hpilo.c | |||
@@ -710,6 +710,7 @@ out: | |||
710 | 710 | ||
711 | static struct pci_device_id ilo_devices[] = { | 711 | static struct pci_device_id ilo_devices[] = { |
712 | { PCI_DEVICE(PCI_VENDOR_ID_COMPAQ, 0xB204) }, | 712 | { PCI_DEVICE(PCI_VENDOR_ID_COMPAQ, 0xB204) }, |
713 | { PCI_DEVICE(PCI_VENDOR_ID_HP, 0x3307) }, | ||
713 | { } | 714 | { } |
714 | }; | 715 | }; |
715 | MODULE_DEVICE_TABLE(pci, ilo_devices); | 716 | MODULE_DEVICE_TABLE(pci, ilo_devices); |
@@ -758,7 +759,7 @@ static void __exit ilo_exit(void) | |||
758 | class_destroy(ilo_class); | 759 | class_destroy(ilo_class); |
759 | } | 760 | } |
760 | 761 | ||
761 | MODULE_VERSION("0.06"); | 762 | MODULE_VERSION("1.0"); |
762 | MODULE_ALIAS(ILO_NAME); | 763 | MODULE_ALIAS(ILO_NAME); |
763 | MODULE_DESCRIPTION(ILO_NAME); | 764 | MODULE_DESCRIPTION(ILO_NAME); |
764 | MODULE_AUTHOR("David Altobelli <david.altobelli@hp.com>"); | 765 | MODULE_AUTHOR("David Altobelli <david.altobelli@hp.com>"); |
diff --git a/drivers/mtd/chips/map_rom.c b/drivers/mtd/chips/map_rom.c index 821d0ed6bae3..c76d6e5f47ee 100644 --- a/drivers/mtd/chips/map_rom.c +++ b/drivers/mtd/chips/map_rom.c | |||
@@ -19,6 +19,7 @@ static int maprom_read (struct mtd_info *, loff_t, size_t, size_t *, u_char *); | |||
19 | static int maprom_write (struct mtd_info *, loff_t, size_t, size_t *, const u_char *); | 19 | static int maprom_write (struct mtd_info *, loff_t, size_t, size_t *, const u_char *); |
20 | static void maprom_nop (struct mtd_info *); | 20 | static void maprom_nop (struct mtd_info *); |
21 | static struct mtd_info *map_rom_probe(struct map_info *map); | 21 | static struct mtd_info *map_rom_probe(struct map_info *map); |
22 | static int maprom_erase (struct mtd_info *mtd, struct erase_info *info); | ||
22 | 23 | ||
23 | static struct mtd_chip_driver maprom_chipdrv = { | 24 | static struct mtd_chip_driver maprom_chipdrv = { |
24 | .probe = map_rom_probe, | 25 | .probe = map_rom_probe, |
@@ -42,6 +43,7 @@ static struct mtd_info *map_rom_probe(struct map_info *map) | |||
42 | mtd->read = maprom_read; | 43 | mtd->read = maprom_read; |
43 | mtd->write = maprom_write; | 44 | mtd->write = maprom_write; |
44 | mtd->sync = maprom_nop; | 45 | mtd->sync = maprom_nop; |
46 | mtd->erase = maprom_erase; | ||
45 | mtd->flags = MTD_CAP_ROM; | 47 | mtd->flags = MTD_CAP_ROM; |
46 | mtd->erasesize = map->size; | 48 | mtd->erasesize = map->size; |
47 | mtd->writesize = 1; | 49 | mtd->writesize = 1; |
@@ -71,6 +73,12 @@ static int maprom_write (struct mtd_info *mtd, loff_t to, size_t len, size_t *re | |||
71 | return -EIO; | 73 | return -EIO; |
72 | } | 74 | } |
73 | 75 | ||
76 | static int maprom_erase (struct mtd_info *mtd, struct erase_info *info) | ||
77 | { | ||
78 | /* We do our best 8) */ | ||
79 | return -EROFS; | ||
80 | } | ||
81 | |||
74 | static int __init map_rom_init(void) | 82 | static int __init map_rom_init(void) |
75 | { | 83 | { |
76 | register_mtd_chip_driver(&maprom_chipdrv); | 84 | register_mtd_chip_driver(&maprom_chipdrv); |
diff --git a/drivers/mtd/devices/slram.c b/drivers/mtd/devices/slram.c index a425d09f35a0..00248e81ecd5 100644 --- a/drivers/mtd/devices/slram.c +++ b/drivers/mtd/devices/slram.c | |||
@@ -267,22 +267,28 @@ static int parse_cmdline(char *devname, char *szstart, char *szlength) | |||
267 | if (*(szlength) != '+') { | 267 | if (*(szlength) != '+') { |
268 | devlength = simple_strtoul(szlength, &buffer, 0); | 268 | devlength = simple_strtoul(szlength, &buffer, 0); |
269 | devlength = handle_unit(devlength, buffer) - devstart; | 269 | devlength = handle_unit(devlength, buffer) - devstart; |
270 | if (devlength < devstart) | ||
271 | goto err_out; | ||
272 | |||
273 | devlength -= devstart; | ||
270 | } else { | 274 | } else { |
271 | devlength = simple_strtoul(szlength + 1, &buffer, 0); | 275 | devlength = simple_strtoul(szlength + 1, &buffer, 0); |
272 | devlength = handle_unit(devlength, buffer); | 276 | devlength = handle_unit(devlength, buffer); |
273 | } | 277 | } |
274 | T("slram: devname=%s, devstart=0x%lx, devlength=0x%lx\n", | 278 | T("slram: devname=%s, devstart=0x%lx, devlength=0x%lx\n", |
275 | devname, devstart, devlength); | 279 | devname, devstart, devlength); |
276 | if ((devstart < 0) || (devlength < 0) || (devlength % SLRAM_BLK_SZ != 0)) { | 280 | if (devlength % SLRAM_BLK_SZ != 0) |
277 | E("slram: Illegal start / length parameter.\n"); | 281 | goto err_out; |
278 | return(-EINVAL); | ||
279 | } | ||
280 | 282 | ||
281 | if ((devstart = register_device(devname, devstart, devlength))){ | 283 | if ((devstart = register_device(devname, devstart, devlength))){ |
282 | unregister_devices(); | 284 | unregister_devices(); |
283 | return((int)devstart); | 285 | return((int)devstart); |
284 | } | 286 | } |
285 | return(0); | 287 | return(0); |
288 | |||
289 | err_out: | ||
290 | E("slram: Illegal length parameter.\n"); | ||
291 | return(-EINVAL); | ||
286 | } | 292 | } |
287 | 293 | ||
288 | #ifndef MODULE | 294 | #ifndef MODULE |
diff --git a/drivers/mtd/lpddr/Kconfig b/drivers/mtd/lpddr/Kconfig index acd4ea9b2278..5a401d8047ab 100644 --- a/drivers/mtd/lpddr/Kconfig +++ b/drivers/mtd/lpddr/Kconfig | |||
@@ -12,6 +12,7 @@ config MTD_LPDDR | |||
12 | DDR memories, intended for battery-operated systems. | 12 | DDR memories, intended for battery-operated systems. |
13 | 13 | ||
14 | config MTD_QINFO_PROBE | 14 | config MTD_QINFO_PROBE |
15 | depends on MTD_LPDDR | ||
15 | tristate "Detect flash chips by QINFO probe" | 16 | tristate "Detect flash chips by QINFO probe" |
16 | help | 17 | help |
17 | Device Information for LPDDR chips is offered through the Overlay | 18 | Device Information for LPDDR chips is offered through the Overlay |
diff --git a/drivers/mtd/maps/Kconfig b/drivers/mtd/maps/Kconfig index 0225cbbf22de..043d50fb6ef6 100644 --- a/drivers/mtd/maps/Kconfig +++ b/drivers/mtd/maps/Kconfig | |||
@@ -491,7 +491,7 @@ config MTD_PCMCIA_ANONYMOUS | |||
491 | 491 | ||
492 | config MTD_BFIN_ASYNC | 492 | config MTD_BFIN_ASYNC |
493 | tristate "Blackfin BF533-STAMP Flash Chip Support" | 493 | tristate "Blackfin BF533-STAMP Flash Chip Support" |
494 | depends on BFIN533_STAMP && MTD_CFI | 494 | depends on BFIN533_STAMP && MTD_CFI && MTD_COMPLEX_MAPPINGS |
495 | select MTD_PARTITIONS | 495 | select MTD_PARTITIONS |
496 | default y | 496 | default y |
497 | help | 497 | help |
diff --git a/drivers/mtd/maps/bfin-async-flash.c b/drivers/mtd/maps/bfin-async-flash.c index 6fec86aaed7e..576611f605db 100644 --- a/drivers/mtd/maps/bfin-async-flash.c +++ b/drivers/mtd/maps/bfin-async-flash.c | |||
@@ -152,14 +152,18 @@ static int __devinit bfin_flash_probe(struct platform_device *pdev) | |||
152 | 152 | ||
153 | if (gpio_request(state->enet_flash_pin, DRIVER_NAME)) { | 153 | if (gpio_request(state->enet_flash_pin, DRIVER_NAME)) { |
154 | pr_devinit(KERN_ERR DRIVER_NAME ": Failed to request gpio %d\n", state->enet_flash_pin); | 154 | pr_devinit(KERN_ERR DRIVER_NAME ": Failed to request gpio %d\n", state->enet_flash_pin); |
155 | kfree(state); | ||
155 | return -EBUSY; | 156 | return -EBUSY; |
156 | } | 157 | } |
157 | gpio_direction_output(state->enet_flash_pin, 1); | 158 | gpio_direction_output(state->enet_flash_pin, 1); |
158 | 159 | ||
159 | pr_devinit(KERN_NOTICE DRIVER_NAME ": probing %d-bit flash bus\n", state->map.bankwidth * 8); | 160 | pr_devinit(KERN_NOTICE DRIVER_NAME ": probing %d-bit flash bus\n", state->map.bankwidth * 8); |
160 | state->mtd = do_map_probe(memory->name, &state->map); | 161 | state->mtd = do_map_probe(memory->name, &state->map); |
161 | if (!state->mtd) | 162 | if (!state->mtd) { |
163 | gpio_free(state->enet_flash_pin); | ||
164 | kfree(state); | ||
162 | return -ENXIO; | 165 | return -ENXIO; |
166 | } | ||
163 | 167 | ||
164 | #ifdef CONFIG_MTD_PARTITIONS | 168 | #ifdef CONFIG_MTD_PARTITIONS |
165 | ret = parse_mtd_partitions(state->mtd, part_probe_types, &pdata->parts, 0); | 169 | ret = parse_mtd_partitions(state->mtd, part_probe_types, &pdata->parts, 0); |
diff --git a/drivers/mtd/maps/ck804xrom.c b/drivers/mtd/maps/ck804xrom.c index 5f7a245ed132..424f17d6ffd1 100644 --- a/drivers/mtd/maps/ck804xrom.c +++ b/drivers/mtd/maps/ck804xrom.c | |||
@@ -342,9 +342,9 @@ static struct pci_device_id ck804xrom_pci_tbl[] = { | |||
342 | { 0, } | 342 | { 0, } |
343 | }; | 343 | }; |
344 | 344 | ||
345 | #if 0 | ||
345 | MODULE_DEVICE_TABLE(pci, ck804xrom_pci_tbl); | 346 | MODULE_DEVICE_TABLE(pci, ck804xrom_pci_tbl); |
346 | 347 | ||
347 | #if 0 | ||
348 | static struct pci_driver ck804xrom_driver = { | 348 | static struct pci_driver ck804xrom_driver = { |
349 | .name = MOD_NAME, | 349 | .name = MOD_NAME, |
350 | .id_table = ck804xrom_pci_tbl, | 350 | .id_table = ck804xrom_pci_tbl, |
diff --git a/drivers/mtd/maps/physmap.c b/drivers/mtd/maps/physmap.c index 87743661d48e..4b122e7ab4b3 100644 --- a/drivers/mtd/maps/physmap.c +++ b/drivers/mtd/maps/physmap.c | |||
@@ -29,6 +29,7 @@ struct physmap_flash_info { | |||
29 | struct map_info map[MAX_RESOURCES]; | 29 | struct map_info map[MAX_RESOURCES]; |
30 | #ifdef CONFIG_MTD_PARTITIONS | 30 | #ifdef CONFIG_MTD_PARTITIONS |
31 | int nr_parts; | 31 | int nr_parts; |
32 | struct mtd_partition *parts; | ||
32 | #endif | 33 | #endif |
33 | }; | 34 | }; |
34 | 35 | ||
@@ -45,25 +46,26 @@ static int physmap_flash_remove(struct platform_device *dev) | |||
45 | 46 | ||
46 | physmap_data = dev->dev.platform_data; | 47 | physmap_data = dev->dev.platform_data; |
47 | 48 | ||
48 | #ifdef CONFIG_MTD_CONCAT | 49 | #ifdef CONFIG_MTD_PARTITIONS |
49 | if (info->cmtd != info->mtd[0]) { | 50 | if (info->nr_parts) { |
51 | del_mtd_partitions(info->cmtd); | ||
52 | kfree(info->parts); | ||
53 | } else if (physmap_data->nr_parts) | ||
54 | del_mtd_partitions(info->cmtd); | ||
55 | else | ||
50 | del_mtd_device(info->cmtd); | 56 | del_mtd_device(info->cmtd); |
57 | #else | ||
58 | del_mtd_device(info->cmtd); | ||
59 | #endif | ||
60 | |||
61 | #ifdef CONFIG_MTD_CONCAT | ||
62 | if (info->cmtd != info->mtd[0]) | ||
51 | mtd_concat_destroy(info->cmtd); | 63 | mtd_concat_destroy(info->cmtd); |
52 | } | ||
53 | #endif | 64 | #endif |
54 | 65 | ||
55 | for (i = 0; i < MAX_RESOURCES; i++) { | 66 | for (i = 0; i < MAX_RESOURCES; i++) { |
56 | if (info->mtd[i] != NULL) { | 67 | if (info->mtd[i] != NULL) |
57 | #ifdef CONFIG_MTD_PARTITIONS | ||
58 | if (info->nr_parts || physmap_data->nr_parts) | ||
59 | del_mtd_partitions(info->mtd[i]); | ||
60 | else | ||
61 | del_mtd_device(info->mtd[i]); | ||
62 | #else | ||
63 | del_mtd_device(info->mtd[i]); | ||
64 | #endif | ||
65 | map_destroy(info->mtd[i]); | 68 | map_destroy(info->mtd[i]); |
66 | } | ||
67 | } | 69 | } |
68 | return 0; | 70 | return 0; |
69 | } | 71 | } |
@@ -86,9 +88,6 @@ static int physmap_flash_probe(struct platform_device *dev) | |||
86 | int err = 0; | 88 | int err = 0; |
87 | int i; | 89 | int i; |
88 | int devices_found = 0; | 90 | int devices_found = 0; |
89 | #ifdef CONFIG_MTD_PARTITIONS | ||
90 | struct mtd_partition *parts; | ||
91 | #endif | ||
92 | 91 | ||
93 | physmap_data = dev->dev.platform_data; | 92 | physmap_data = dev->dev.platform_data; |
94 | if (physmap_data == NULL) | 93 | if (physmap_data == NULL) |
@@ -167,10 +166,11 @@ static int physmap_flash_probe(struct platform_device *dev) | |||
167 | goto err_out; | 166 | goto err_out; |
168 | 167 | ||
169 | #ifdef CONFIG_MTD_PARTITIONS | 168 | #ifdef CONFIG_MTD_PARTITIONS |
170 | err = parse_mtd_partitions(info->cmtd, part_probe_types, &parts, 0); | 169 | err = parse_mtd_partitions(info->cmtd, part_probe_types, |
170 | &info->parts, 0); | ||
171 | if (err > 0) { | 171 | if (err > 0) { |
172 | add_mtd_partitions(info->cmtd, parts, err); | 172 | add_mtd_partitions(info->cmtd, info->parts, err); |
173 | kfree(parts); | 173 | info->nr_parts = err; |
174 | return 0; | 174 | return 0; |
175 | } | 175 | } |
176 | 176 | ||
diff --git a/drivers/pci/hotplug/pciehp.h b/drivers/pci/hotplug/pciehp.h index db85284ffb62..39ae37589fda 100644 --- a/drivers/pci/hotplug/pciehp.h +++ b/drivers/pci/hotplug/pciehp.h | |||
@@ -111,6 +111,7 @@ struct controller { | |||
111 | int cmd_busy; | 111 | int cmd_busy; |
112 | unsigned int no_cmd_complete:1; | 112 | unsigned int no_cmd_complete:1; |
113 | unsigned int link_active_reporting:1; | 113 | unsigned int link_active_reporting:1; |
114 | unsigned int notification_enabled:1; | ||
114 | }; | 115 | }; |
115 | 116 | ||
116 | #define INT_BUTTON_IGNORE 0 | 117 | #define INT_BUTTON_IGNORE 0 |
@@ -170,6 +171,7 @@ extern int pciehp_configure_device(struct slot *p_slot); | |||
170 | extern int pciehp_unconfigure_device(struct slot *p_slot); | 171 | extern int pciehp_unconfigure_device(struct slot *p_slot); |
171 | extern void pciehp_queue_pushbutton_work(struct work_struct *work); | 172 | extern void pciehp_queue_pushbutton_work(struct work_struct *work); |
172 | struct controller *pcie_init(struct pcie_device *dev); | 173 | struct controller *pcie_init(struct pcie_device *dev); |
174 | int pcie_init_notification(struct controller *ctrl); | ||
173 | int pciehp_enable_slot(struct slot *p_slot); | 175 | int pciehp_enable_slot(struct slot *p_slot); |
174 | int pciehp_disable_slot(struct slot *p_slot); | 176 | int pciehp_disable_slot(struct slot *p_slot); |
175 | int pcie_enable_notification(struct controller *ctrl); | 177 | int pcie_enable_notification(struct controller *ctrl); |
diff --git a/drivers/pci/hotplug/pciehp_core.c b/drivers/pci/hotplug/pciehp_core.c index c2485542f543..681e3912b821 100644 --- a/drivers/pci/hotplug/pciehp_core.c +++ b/drivers/pci/hotplug/pciehp_core.c | |||
@@ -434,6 +434,13 @@ static int pciehp_probe(struct pcie_device *dev, const struct pcie_port_service_ | |||
434 | goto err_out_release_ctlr; | 434 | goto err_out_release_ctlr; |
435 | } | 435 | } |
436 | 436 | ||
437 | /* Enable events after we have setup the data structures */ | ||
438 | rc = pcie_init_notification(ctrl); | ||
439 | if (rc) { | ||
440 | ctrl_err(ctrl, "Notification initialization failed\n"); | ||
441 | goto err_out_release_ctlr; | ||
442 | } | ||
443 | |||
437 | /* Check if slot is occupied */ | 444 | /* Check if slot is occupied */ |
438 | t_slot = pciehp_find_slot(ctrl, ctrl->slot_device_offset); | 445 | t_slot = pciehp_find_slot(ctrl, ctrl->slot_device_offset); |
439 | t_slot->hpc_ops->get_adapter_status(t_slot, &value); | 446 | t_slot->hpc_ops->get_adapter_status(t_slot, &value); |
diff --git a/drivers/pci/hotplug/pciehp_hpc.c b/drivers/pci/hotplug/pciehp_hpc.c index 71a8012886b0..7a16c6897bb9 100644 --- a/drivers/pci/hotplug/pciehp_hpc.c +++ b/drivers/pci/hotplug/pciehp_hpc.c | |||
@@ -934,7 +934,7 @@ static void pcie_disable_notification(struct controller *ctrl) | |||
934 | ctrl_warn(ctrl, "Cannot disable software notification\n"); | 934 | ctrl_warn(ctrl, "Cannot disable software notification\n"); |
935 | } | 935 | } |
936 | 936 | ||
937 | static int pcie_init_notification(struct controller *ctrl) | 937 | int pcie_init_notification(struct controller *ctrl) |
938 | { | 938 | { |
939 | if (pciehp_request_irq(ctrl)) | 939 | if (pciehp_request_irq(ctrl)) |
940 | return -1; | 940 | return -1; |
@@ -942,13 +942,17 @@ static int pcie_init_notification(struct controller *ctrl) | |||
942 | pciehp_free_irq(ctrl); | 942 | pciehp_free_irq(ctrl); |
943 | return -1; | 943 | return -1; |
944 | } | 944 | } |
945 | ctrl->notification_enabled = 1; | ||
945 | return 0; | 946 | return 0; |
946 | } | 947 | } |
947 | 948 | ||
948 | static void pcie_shutdown_notification(struct controller *ctrl) | 949 | static void pcie_shutdown_notification(struct controller *ctrl) |
949 | { | 950 | { |
950 | pcie_disable_notification(ctrl); | 951 | if (ctrl->notification_enabled) { |
951 | pciehp_free_irq(ctrl); | 952 | pcie_disable_notification(ctrl); |
953 | pciehp_free_irq(ctrl); | ||
954 | ctrl->notification_enabled = 0; | ||
955 | } | ||
952 | } | 956 | } |
953 | 957 | ||
954 | static int pcie_init_slot(struct controller *ctrl) | 958 | static int pcie_init_slot(struct controller *ctrl) |
@@ -1110,13 +1114,8 @@ struct controller *pcie_init(struct pcie_device *dev) | |||
1110 | if (pcie_init_slot(ctrl)) | 1114 | if (pcie_init_slot(ctrl)) |
1111 | goto abort_ctrl; | 1115 | goto abort_ctrl; |
1112 | 1116 | ||
1113 | if (pcie_init_notification(ctrl)) | ||
1114 | goto abort_slot; | ||
1115 | |||
1116 | return ctrl; | 1117 | return ctrl; |
1117 | 1118 | ||
1118 | abort_slot: | ||
1119 | pcie_cleanup_slot(ctrl); | ||
1120 | abort_ctrl: | 1119 | abort_ctrl: |
1121 | kfree(ctrl); | 1120 | kfree(ctrl); |
1122 | abort: | 1121 | abort: |
diff --git a/drivers/pci/pcie/aer/aerdrv_core.c b/drivers/pci/pcie/aer/aerdrv_core.c index aac7006949f1..d0c973685868 100644 --- a/drivers/pci/pcie/aer/aerdrv_core.c +++ b/drivers/pci/pcie/aer/aerdrv_core.c | |||
@@ -108,6 +108,34 @@ int pci_cleanup_aer_correct_error_status(struct pci_dev *dev) | |||
108 | } | 108 | } |
109 | #endif /* 0 */ | 109 | #endif /* 0 */ |
110 | 110 | ||
111 | |||
112 | static void set_device_error_reporting(struct pci_dev *dev, void *data) | ||
113 | { | ||
114 | bool enable = *((bool *)data); | ||
115 | |||
116 | if (dev->pcie_type != PCIE_RC_PORT && | ||
117 | dev->pcie_type != PCIE_SW_UPSTREAM_PORT && | ||
118 | dev->pcie_type != PCIE_SW_DOWNSTREAM_PORT) | ||
119 | return; | ||
120 | |||
121 | if (enable) | ||
122 | pci_enable_pcie_error_reporting(dev); | ||
123 | else | ||
124 | pci_disable_pcie_error_reporting(dev); | ||
125 | } | ||
126 | |||
127 | /** | ||
128 | * set_downstream_devices_error_reporting - enable/disable the error reporting bits on the root port and its downstream ports. | ||
129 | * @dev: pointer to root port's pci_dev data structure | ||
130 | * @enable: true = enable error reporting, false = disable error reporting. | ||
131 | */ | ||
132 | static void set_downstream_devices_error_reporting(struct pci_dev *dev, | ||
133 | bool enable) | ||
134 | { | ||
135 | set_device_error_reporting(dev, &enable); | ||
136 | pci_walk_bus(dev->subordinate, set_device_error_reporting, &enable); | ||
137 | } | ||
138 | |||
111 | static int find_device_iter(struct device *device, void *data) | 139 | static int find_device_iter(struct device *device, void *data) |
112 | { | 140 | { |
113 | struct pci_dev *dev; | 141 | struct pci_dev *dev; |
@@ -525,15 +553,11 @@ void aer_enable_rootport(struct aer_rpc *rpc) | |||
525 | pci_read_config_dword(pdev, aer_pos + PCI_ERR_UNCOR_STATUS, ®32); | 553 | pci_read_config_dword(pdev, aer_pos + PCI_ERR_UNCOR_STATUS, ®32); |
526 | pci_write_config_dword(pdev, aer_pos + PCI_ERR_UNCOR_STATUS, reg32); | 554 | pci_write_config_dword(pdev, aer_pos + PCI_ERR_UNCOR_STATUS, reg32); |
527 | 555 | ||
528 | /* Enable Root Port device reporting error itself */ | 556 | /* |
529 | pci_read_config_word(pdev, pos+PCI_EXP_DEVCTL, ®16); | 557 | * Enable error reporting for the root port device and downstream port |
530 | reg16 = reg16 | | 558 | * devices. |
531 | PCI_EXP_DEVCTL_CERE | | 559 | */ |
532 | PCI_EXP_DEVCTL_NFERE | | 560 | set_downstream_devices_error_reporting(pdev, true); |
533 | PCI_EXP_DEVCTL_FERE | | ||
534 | PCI_EXP_DEVCTL_URRE; | ||
535 | pci_write_config_word(pdev, pos+PCI_EXP_DEVCTL, | ||
536 | reg16); | ||
537 | 561 | ||
538 | /* Enable Root Port's interrupt in response to error messages */ | 562 | /* Enable Root Port's interrupt in response to error messages */ |
539 | pci_write_config_dword(pdev, | 563 | pci_write_config_dword(pdev, |
@@ -553,6 +577,12 @@ static void disable_root_aer(struct aer_rpc *rpc) | |||
553 | u32 reg32; | 577 | u32 reg32; |
554 | int pos; | 578 | int pos; |
555 | 579 | ||
580 | /* | ||
581 | * Disable error reporting for the root port device and downstream port | ||
582 | * devices. | ||
583 | */ | ||
584 | set_downstream_devices_error_reporting(pdev, false); | ||
585 | |||
556 | pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_ERR); | 586 | pos = pci_find_ext_capability(pdev, PCI_EXT_CAP_ID_ERR); |
557 | /* Disable Root's interrupt in response to error messages */ | 587 | /* Disable Root's interrupt in response to error messages */ |
558 | pci_write_config_dword(pdev, pos + PCI_ERR_ROOT_COMMAND, 0); | 588 | pci_write_config_dword(pdev, pos + PCI_ERR_ROOT_COMMAND, 0); |
diff --git a/drivers/pci/pcie/portdrv_pci.c b/drivers/pci/pcie/portdrv_pci.c index f9b874eaeb9f..248b4db91552 100644 --- a/drivers/pci/pcie/portdrv_pci.c +++ b/drivers/pci/pcie/portdrv_pci.c | |||
@@ -97,8 +97,6 @@ static int __devinit pcie_portdrv_probe (struct pci_dev *dev, | |||
97 | 97 | ||
98 | pcie_portdrv_save_config(dev); | 98 | pcie_portdrv_save_config(dev); |
99 | 99 | ||
100 | pci_enable_pcie_error_reporting(dev); | ||
101 | |||
102 | return 0; | 100 | return 0; |
103 | } | 101 | } |
104 | 102 | ||
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index baad093aafe3..f20d55368edb 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c | |||
@@ -1584,6 +1584,7 @@ DECLARE_PCI_FIXUP_RESUME(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_ | |||
1584 | */ | 1584 | */ |
1585 | #define AMD_813X_MISC 0x40 | 1585 | #define AMD_813X_MISC 0x40 |
1586 | #define AMD_813X_NOIOAMODE (1<<0) | 1586 | #define AMD_813X_NOIOAMODE (1<<0) |
1587 | #define AMD_813X_REV_B2 0x13 | ||
1587 | 1588 | ||
1588 | static void quirk_disable_amd_813x_boot_interrupt(struct pci_dev *dev) | 1589 | static void quirk_disable_amd_813x_boot_interrupt(struct pci_dev *dev) |
1589 | { | 1590 | { |
@@ -1591,6 +1592,8 @@ static void quirk_disable_amd_813x_boot_interrupt(struct pci_dev *dev) | |||
1591 | 1592 | ||
1592 | if (noioapicquirk) | 1593 | if (noioapicquirk) |
1593 | return; | 1594 | return; |
1595 | if (dev->revision == AMD_813X_REV_B2) | ||
1596 | return; | ||
1594 | 1597 | ||
1595 | pci_read_config_dword(dev, AMD_813X_MISC, &pci_config_dword); | 1598 | pci_read_config_dword(dev, AMD_813X_MISC, &pci_config_dword); |
1596 | pci_config_dword &= ~AMD_813X_NOIOAMODE; | 1599 | pci_config_dword &= ~AMD_813X_NOIOAMODE; |
@@ -1981,7 +1984,6 @@ static void __devinit quirk_msi_ht_cap(struct pci_dev *dev) | |||
1981 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_HT2000_PCIE, | 1984 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_HT2000_PCIE, |
1982 | quirk_msi_ht_cap); | 1985 | quirk_msi_ht_cap); |
1983 | 1986 | ||
1984 | |||
1985 | /* The nVidia CK804 chipset may have 2 HT MSI mappings. | 1987 | /* The nVidia CK804 chipset may have 2 HT MSI mappings. |
1986 | * MSI are supported if the MSI capability set in any of these mappings. | 1988 | * MSI are supported if the MSI capability set in any of these mappings. |
1987 | */ | 1989 | */ |
@@ -2032,6 +2034,9 @@ DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_SERVERWORKS, | |||
2032 | PCI_DEVICE_ID_SERVERWORKS_HT1000_PXB, | 2034 | PCI_DEVICE_ID_SERVERWORKS_HT1000_PXB, |
2033 | ht_enable_msi_mapping); | 2035 | ht_enable_msi_mapping); |
2034 | 2036 | ||
2037 | DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_8132_BRIDGE, | ||
2038 | ht_enable_msi_mapping); | ||
2039 | |||
2035 | /* The P5N32-SLI Premium motherboard from Asus has a problem with msi | 2040 | /* The P5N32-SLI Premium motherboard from Asus has a problem with msi |
2036 | * for the MCP55 NIC. It is not yet determined whether the msi problem | 2041 | * for the MCP55 NIC. It is not yet determined whether the msi problem |
2037 | * also affects other devices. As for now, turn off msi for this device. | 2042 | * also affects other devices. As for now, turn off msi for this device. |
@@ -2048,10 +2053,100 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_NVIDIA, | |||
2048 | PCI_DEVICE_ID_NVIDIA_NVENET_15, | 2053 | PCI_DEVICE_ID_NVIDIA_NVENET_15, |
2049 | nvenet_msi_disable); | 2054 | nvenet_msi_disable); |
2050 | 2055 | ||
2051 | static void __devinit nv_msi_ht_cap_quirk(struct pci_dev *dev) | 2056 | static void __devinit nv_ht_enable_msi_mapping(struct pci_dev *dev) |
2052 | { | 2057 | { |
2053 | struct pci_dev *host_bridge; | 2058 | struct pci_dev *host_bridge; |
2059 | int pos; | ||
2060 | int i, dev_no; | ||
2061 | int found = 0; | ||
2062 | |||
2063 | dev_no = dev->devfn >> 3; | ||
2064 | for (i = dev_no; i >= 0; i--) { | ||
2065 | host_bridge = pci_get_slot(dev->bus, PCI_DEVFN(i, 0)); | ||
2066 | if (!host_bridge) | ||
2067 | continue; | ||
2068 | |||
2069 | pos = pci_find_ht_capability(host_bridge, HT_CAPTYPE_SLAVE); | ||
2070 | if (pos != 0) { | ||
2071 | found = 1; | ||
2072 | break; | ||
2073 | } | ||
2074 | pci_dev_put(host_bridge); | ||
2075 | } | ||
2076 | |||
2077 | if (!found) | ||
2078 | return; | ||
2079 | |||
2080 | /* root did that ! */ | ||
2081 | if (msi_ht_cap_enabled(host_bridge)) | ||
2082 | goto out; | ||
2083 | |||
2084 | ht_enable_msi_mapping(dev); | ||
2085 | |||
2086 | out: | ||
2087 | pci_dev_put(host_bridge); | ||
2088 | } | ||
2089 | |||
2090 | static void __devinit ht_disable_msi_mapping(struct pci_dev *dev) | ||
2091 | { | ||
2092 | int pos, ttl = 48; | ||
2093 | |||
2094 | pos = pci_find_ht_capability(dev, HT_CAPTYPE_MSI_MAPPING); | ||
2095 | while (pos && ttl--) { | ||
2096 | u8 flags; | ||
2097 | |||
2098 | if (pci_read_config_byte(dev, pos + HT_MSI_FLAGS, | ||
2099 | &flags) == 0) { | ||
2100 | dev_info(&dev->dev, "Enabling HT MSI Mapping\n"); | ||
2101 | |||
2102 | pci_write_config_byte(dev, pos + HT_MSI_FLAGS, | ||
2103 | flags & ~HT_MSI_FLAGS_ENABLE); | ||
2104 | } | ||
2105 | pos = pci_find_next_ht_capability(dev, pos, | ||
2106 | HT_CAPTYPE_MSI_MAPPING); | ||
2107 | } | ||
2108 | } | ||
2109 | |||
2110 | static int __devinit ht_check_msi_mapping(struct pci_dev *dev) | ||
2111 | { | ||
2054 | int pos, ttl = 48; | 2112 | int pos, ttl = 48; |
2113 | int found = 0; | ||
2114 | |||
2115 | /* check if there is HT MSI cap or enabled on this device */ | ||
2116 | pos = pci_find_ht_capability(dev, HT_CAPTYPE_MSI_MAPPING); | ||
2117 | while (pos && ttl--) { | ||
2118 | u8 flags; | ||
2119 | |||
2120 | if (found < 1) | ||
2121 | found = 1; | ||
2122 | if (pci_read_config_byte(dev, pos + HT_MSI_FLAGS, | ||
2123 | &flags) == 0) { | ||
2124 | if (flags & HT_MSI_FLAGS_ENABLE) { | ||
2125 | if (found < 2) { | ||
2126 | found = 2; | ||
2127 | break; | ||
2128 | } | ||
2129 | } | ||
2130 | } | ||
2131 | pos = pci_find_next_ht_capability(dev, pos, | ||
2132 | HT_CAPTYPE_MSI_MAPPING); | ||
2133 | } | ||
2134 | |||
2135 | return found; | ||
2136 | } | ||
2137 | |||
2138 | static void __devinit nv_msi_ht_cap_quirk(struct pci_dev *dev) | ||
2139 | { | ||
2140 | struct pci_dev *host_bridge; | ||
2141 | int pos; | ||
2142 | int found; | ||
2143 | |||
2144 | /* check if there is HT MSI cap or enabled on this device */ | ||
2145 | found = ht_check_msi_mapping(dev); | ||
2146 | |||
2147 | /* no HT MSI CAP */ | ||
2148 | if (found == 0) | ||
2149 | return; | ||
2055 | 2150 | ||
2056 | /* | 2151 | /* |
2057 | * HT MSI mapping should be disabled on devices that are below | 2152 | * HT MSI mapping should be disabled on devices that are below |
@@ -2067,24 +2162,19 @@ static void __devinit nv_msi_ht_cap_quirk(struct pci_dev *dev) | |||
2067 | pos = pci_find_ht_capability(host_bridge, HT_CAPTYPE_SLAVE); | 2162 | pos = pci_find_ht_capability(host_bridge, HT_CAPTYPE_SLAVE); |
2068 | if (pos != 0) { | 2163 | if (pos != 0) { |
2069 | /* Host bridge is to HT */ | 2164 | /* Host bridge is to HT */ |
2070 | ht_enable_msi_mapping(dev); | 2165 | if (found == 1) { |
2166 | /* it is not enabled, try to enable it */ | ||
2167 | nv_ht_enable_msi_mapping(dev); | ||
2168 | } | ||
2071 | return; | 2169 | return; |
2072 | } | 2170 | } |
2073 | 2171 | ||
2074 | /* Host bridge is not to HT, disable HT MSI mapping on this device */ | 2172 | /* HT MSI is not enabled */ |
2075 | pos = pci_find_ht_capability(dev, HT_CAPTYPE_MSI_MAPPING); | 2173 | if (found == 1) |
2076 | while (pos && ttl--) { | 2174 | return; |
2077 | u8 flags; | ||
2078 | 2175 | ||
2079 | if (pci_read_config_byte(dev, pos + HT_MSI_FLAGS, | 2176 | /* Host bridge is not to HT, disable HT MSI mapping on this device */ |
2080 | &flags) == 0) { | 2177 | ht_disable_msi_mapping(dev); |
2081 | dev_info(&dev->dev, "Disabling HT MSI mapping"); | ||
2082 | pci_write_config_byte(dev, pos + HT_MSI_FLAGS, | ||
2083 | flags & ~HT_MSI_FLAGS_ENABLE); | ||
2084 | } | ||
2085 | pos = pci_find_next_ht_capability(dev, pos, | ||
2086 | HT_CAPTYPE_MSI_MAPPING); | ||
2087 | } | ||
2088 | } | 2178 | } |
2089 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID, nv_msi_ht_cap_quirk); | 2179 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_NVIDIA, PCI_ANY_ID, nv_msi_ht_cap_quirk); |
2090 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AL, PCI_ANY_ID, nv_msi_ht_cap_quirk); | 2180 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_AL, PCI_ANY_ID, nv_msi_ht_cap_quirk); |
diff --git a/drivers/serial/sh-sci.h b/drivers/serial/sh-sci.h index 3599828b9766..022e89ffec1d 100644 --- a/drivers/serial/sh-sci.h +++ b/drivers/serial/sh-sci.h | |||
@@ -133,7 +133,7 @@ | |||
133 | # define SCSPTR3 0xffed0024 /* 16 bit SCIF */ | 133 | # define SCSPTR3 0xffed0024 /* 16 bit SCIF */ |
134 | # define SCSPTR4 0xffee0024 /* 16 bit SCIF */ | 134 | # define SCSPTR4 0xffee0024 /* 16 bit SCIF */ |
135 | # define SCSPTR5 0xffef0024 /* 16 bit SCIF */ | 135 | # define SCSPTR5 0xffef0024 /* 16 bit SCIF */ |
136 | # define SCIF_OPER 0x0001 /* Overrun error bit */ | 136 | # define SCIF_ORER 0x0001 /* Overrun error bit */ |
137 | # define SCSCR_INIT(port) 0x3a /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ | 137 | # define SCSCR_INIT(port) 0x3a /* TIE=0,RIE=0,TE=1,RE=1,REIE=1 */ |
138 | #elif defined(CONFIG_CPU_SUBTYPE_SH7201) || \ | 138 | #elif defined(CONFIG_CPU_SUBTYPE_SH7201) || \ |
139 | defined(CONFIG_CPU_SUBTYPE_SH7203) || \ | 139 | defined(CONFIG_CPU_SUBTYPE_SH7203) || \ |
diff --git a/drivers/staging/panel/panel.c b/drivers/staging/panel/panel.c index ab69c1bf36a8..c2747bc88c6f 100644 --- a/drivers/staging/panel/panel.c +++ b/drivers/staging/panel/panel.c | |||
@@ -2164,19 +2164,20 @@ static void __exit panel_cleanup_module(void) | |||
2164 | if (scan_timer.function != NULL) | 2164 | if (scan_timer.function != NULL) |
2165 | del_timer(&scan_timer); | 2165 | del_timer(&scan_timer); |
2166 | 2166 | ||
2167 | if (keypad_enabled) | 2167 | if (pprt != NULL) { |
2168 | misc_deregister(&keypad_dev); | 2168 | if (keypad_enabled) |
2169 | misc_deregister(&keypad_dev); | ||
2170 | |||
2171 | if (lcd_enabled) { | ||
2172 | panel_lcd_print("\x0cLCD driver " PANEL_VERSION | ||
2173 | "\nunloaded.\x1b[Lc\x1b[Lb\x1b[L-"); | ||
2174 | misc_deregister(&lcd_dev); | ||
2175 | } | ||
2169 | 2176 | ||
2170 | if (lcd_enabled) { | 2177 | /* TODO: free all input signals */ |
2171 | panel_lcd_print("\x0cLCD driver " PANEL_VERSION | 2178 | parport_release(pprt); |
2172 | "\nunloaded.\x1b[Lc\x1b[Lb\x1b[L-"); | 2179 | parport_unregister_device(pprt); |
2173 | misc_deregister(&lcd_dev); | ||
2174 | } | 2180 | } |
2175 | |||
2176 | /* TODO: free all input signals */ | ||
2177 | |||
2178 | parport_release(pprt); | ||
2179 | parport_unregister_device(pprt); | ||
2180 | parport_unregister_driver(&panel_driver); | 2181 | parport_unregister_driver(&panel_driver); |
2181 | } | 2182 | } |
2182 | 2183 | ||
diff --git a/drivers/staging/rtl8187se/Kconfig b/drivers/staging/rtl8187se/Kconfig index 79c225acd1ad..f636296b54bc 100644 --- a/drivers/staging/rtl8187se/Kconfig +++ b/drivers/staging/rtl8187se/Kconfig | |||
@@ -1,5 +1,6 @@ | |||
1 | config RTL8187SE | 1 | config RTL8187SE |
2 | tristate "RealTek RTL8187SE Wireless LAN NIC driver" | 2 | tristate "RealTek RTL8187SE Wireless LAN NIC driver" |
3 | depends on PCI | 3 | depends on PCI |
4 | depends on WIRELESS_EXT && COMPAT_NET_DEV_OPS | ||
4 | default N | 5 | default N |
5 | ---help--- | 6 | ---help--- |
diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt.c b/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt.c index af64cfbe16db..7370296225e1 100644 --- a/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt.c +++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_crypt.c | |||
@@ -234,20 +234,21 @@ out: | |||
234 | void ieee80211_crypto_deinit(void) | 234 | void ieee80211_crypto_deinit(void) |
235 | { | 235 | { |
236 | struct list_head *ptr, *n; | 236 | struct list_head *ptr, *n; |
237 | struct ieee80211_crypto_alg *alg = NULL; | ||
237 | 238 | ||
238 | if (hcrypt == NULL) | 239 | if (hcrypt == NULL) |
239 | return; | 240 | return; |
240 | 241 | ||
241 | for (ptr = hcrypt->algs.next, n = ptr->next; ptr != &hcrypt->algs; | 242 | list_for_each_safe(ptr, n, &hcrypt->algs) { |
242 | ptr = n, n = ptr->next) { | 243 | alg = list_entry(ptr, struct ieee80211_crypto_alg, list); |
243 | struct ieee80211_crypto_alg *alg = | 244 | if (alg) { |
244 | (struct ieee80211_crypto_alg *) ptr; | 245 | list_del(ptr); |
245 | list_del(ptr); | 246 | printk(KERN_DEBUG |
246 | printk(KERN_DEBUG "ieee80211_crypt: unregistered algorithm " | 247 | "ieee80211_crypt: unregistered algorithm '%s' (deinit)\n", |
247 | "'%s' (deinit)\n", alg->ops->name); | 248 | alg->ops->name); |
248 | kfree(alg); | 249 | kfree(alg); |
250 | } | ||
249 | } | 251 | } |
250 | |||
251 | kfree(hcrypt); | 252 | kfree(hcrypt); |
252 | } | 253 | } |
253 | 254 | ||
diff --git a/drivers/staging/rtl8187se/r8180_core.c b/drivers/staging/rtl8187se/r8180_core.c index 94534955e38b..66de5cc8ddf1 100644 --- a/drivers/staging/rtl8187se/r8180_core.c +++ b/drivers/staging/rtl8187se/r8180_core.c | |||
@@ -6161,10 +6161,10 @@ static void __exit rtl8180_pci_module_exit(void) | |||
6161 | { | 6161 | { |
6162 | pci_unregister_driver (&rtl8180_pci_driver); | 6162 | pci_unregister_driver (&rtl8180_pci_driver); |
6163 | rtl8180_proc_module_remove(); | 6163 | rtl8180_proc_module_remove(); |
6164 | ieee80211_crypto_deinit(); | ||
6165 | ieee80211_crypto_tkip_exit(); | 6164 | ieee80211_crypto_tkip_exit(); |
6166 | ieee80211_crypto_ccmp_exit(); | 6165 | ieee80211_crypto_ccmp_exit(); |
6167 | ieee80211_crypto_wep_exit(); | 6166 | ieee80211_crypto_wep_exit(); |
6167 | ieee80211_crypto_deinit(); | ||
6168 | DMESG("Exiting"); | 6168 | DMESG("Exiting"); |
6169 | } | 6169 | } |
6170 | 6170 | ||
diff --git a/drivers/staging/winbond/wbusb.c b/drivers/staging/winbond/wbusb.c index b003f9a7e151..f716b2e92b65 100644 --- a/drivers/staging/winbond/wbusb.c +++ b/drivers/staging/winbond/wbusb.c | |||
@@ -319,16 +319,18 @@ static int wb35_probe(struct usb_interface *intf, const struct usb_device_id *id | |||
319 | struct usb_device *udev = interface_to_usbdev(intf); | 319 | struct usb_device *udev = interface_to_usbdev(intf); |
320 | struct wbsoft_priv *priv; | 320 | struct wbsoft_priv *priv; |
321 | struct ieee80211_hw *dev; | 321 | struct ieee80211_hw *dev; |
322 | int err; | 322 | int nr, err; |
323 | 323 | ||
324 | usb_get_dev(udev); | 324 | usb_get_dev(udev); |
325 | 325 | ||
326 | // 20060630.2 Check the device if it already be opened | 326 | // 20060630.2 Check the device if it already be opened |
327 | err = usb_control_msg(udev, usb_rcvctrlpipe( udev, 0 ), | 327 | nr = usb_control_msg(udev, usb_rcvctrlpipe( udev, 0 ), |
328 | 0x01, USB_TYPE_VENDOR|USB_RECIP_DEVICE|USB_DIR_IN, | 328 | 0x01, USB_TYPE_VENDOR|USB_RECIP_DEVICE|USB_DIR_IN, |
329 | 0x0, 0x400, <mp, 4, HZ*100 ); | 329 | 0x0, 0x400, <mp, 4, HZ*100 ); |
330 | if (err) | 330 | if (nr < 0) { |
331 | err = nr; | ||
331 | goto error; | 332 | goto error; |
333 | } | ||
332 | 334 | ||
333 | ltmp = cpu_to_le32(ltmp); | 335 | ltmp = cpu_to_le32(ltmp); |
334 | if (ltmp) { // Is already initialized? | 336 | if (ltmp) { // Is already initialized? |
@@ -337,8 +339,10 @@ static int wb35_probe(struct usb_interface *intf, const struct usb_device_id *id | |||
337 | } | 339 | } |
338 | 340 | ||
339 | dev = ieee80211_alloc_hw(sizeof(*priv), &wbsoft_ops); | 341 | dev = ieee80211_alloc_hw(sizeof(*priv), &wbsoft_ops); |
340 | if (!dev) | 342 | if (!dev) { |
343 | err = -ENOMEM; | ||
341 | goto error; | 344 | goto error; |
345 | } | ||
342 | 346 | ||
343 | priv = dev->priv; | 347 | priv = dev->priv; |
344 | 348 | ||
@@ -369,9 +373,11 @@ static int wb35_probe(struct usb_interface *intf, const struct usb_device_id *id | |||
369 | } | 373 | } |
370 | 374 | ||
371 | dev->extra_tx_headroom = 12; /* FIXME */ | 375 | dev->extra_tx_headroom = 12; /* FIXME */ |
372 | dev->flags = 0; | 376 | dev->flags = IEEE80211_HW_SIGNAL_UNSPEC; |
377 | dev->wiphy->interface_modes = BIT(NL80211_IFTYPE_STATION); | ||
373 | 378 | ||
374 | dev->channel_change_time = 1000; | 379 | dev->channel_change_time = 1000; |
380 | dev->max_signal = 100; | ||
375 | dev->queues = 1; | 381 | dev->queues = 1; |
376 | 382 | ||
377 | dev->wiphy->bands[IEEE80211_BAND_2GHZ] = &wbsoft_band_2GHz; | 383 | dev->wiphy->bands[IEEE80211_BAND_2GHZ] = &wbsoft_band_2GHz; |
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index 326dd7f65ee9..b3d5a23ab56f 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c | |||
@@ -1376,6 +1376,15 @@ static struct usb_device_id acm_ids[] = { | |||
1376 | { USB_DEVICE(0x0572, 0x1324), /* Conexant USB MODEM RD02-D400 */ | 1376 | { USB_DEVICE(0x0572, 0x1324), /* Conexant USB MODEM RD02-D400 */ |
1377 | .driver_info = NO_UNION_NORMAL, /* has no union descriptor */ | 1377 | .driver_info = NO_UNION_NORMAL, /* has no union descriptor */ |
1378 | }, | 1378 | }, |
1379 | { USB_DEVICE(0x22b8, 0x6425), /* Motorola MOTOMAGX phones */ | ||
1380 | }, | ||
1381 | { USB_DEVICE(0x0572, 0x1329), /* Hummingbird huc56s (Conexant) */ | ||
1382 | .driver_info = NO_UNION_NORMAL, /* union descriptor misplaced on | ||
1383 | data interface instead of | ||
1384 | communications interface. | ||
1385 | Maybe we should define a new | ||
1386 | quirk for this. */ | ||
1387 | }, | ||
1379 | 1388 | ||
1380 | /* control interfaces with various AT-command sets */ | 1389 | /* control interfaces with various AT-command sets */ |
1381 | { USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM, | 1390 | { USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM, |
diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c index 31fb204f44c6..49e7f56e0d7f 100644 --- a/drivers/usb/core/message.c +++ b/drivers/usb/core/message.c | |||
@@ -653,7 +653,7 @@ int usb_get_descriptor(struct usb_device *dev, unsigned char type, | |||
653 | if (result <= 0 && result != -ETIMEDOUT) | 653 | if (result <= 0 && result != -ETIMEDOUT) |
654 | continue; | 654 | continue; |
655 | if (result > 1 && ((u8 *)buf)[1] != type) { | 655 | if (result > 1 && ((u8 *)buf)[1] != type) { |
656 | result = -EPROTO; | 656 | result = -ENODATA; |
657 | continue; | 657 | continue; |
658 | } | 658 | } |
659 | break; | 659 | break; |
@@ -696,8 +696,13 @@ static int usb_get_string(struct usb_device *dev, unsigned short langid, | |||
696 | USB_REQ_GET_DESCRIPTOR, USB_DIR_IN, | 696 | USB_REQ_GET_DESCRIPTOR, USB_DIR_IN, |
697 | (USB_DT_STRING << 8) + index, langid, buf, size, | 697 | (USB_DT_STRING << 8) + index, langid, buf, size, |
698 | USB_CTRL_GET_TIMEOUT); | 698 | USB_CTRL_GET_TIMEOUT); |
699 | if (!(result == 0 || result == -EPIPE)) | 699 | if (result == 0 || result == -EPIPE) |
700 | break; | 700 | continue; |
701 | if (result > 1 && ((u8 *) buf)[1] != USB_DT_STRING) { | ||
702 | result = -ENODATA; | ||
703 | continue; | ||
704 | } | ||
705 | break; | ||
701 | } | 706 | } |
702 | return result; | 707 | return result; |
703 | } | 708 | } |
diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig index 3219d137340a..e55fef52a5dc 100644 --- a/drivers/usb/gadget/Kconfig +++ b/drivers/usb/gadget/Kconfig | |||
@@ -191,6 +191,7 @@ config USB_GADGET_OMAP | |||
191 | boolean "OMAP USB Device Controller" | 191 | boolean "OMAP USB Device Controller" |
192 | depends on ARCH_OMAP | 192 | depends on ARCH_OMAP |
193 | select ISP1301_OMAP if MACH_OMAP_H2 || MACH_OMAP_H3 || MACH_OMAP_H4_OTG | 193 | select ISP1301_OMAP if MACH_OMAP_H2 || MACH_OMAP_H3 || MACH_OMAP_H4_OTG |
194 | select USB_OTG_UTILS if ARCH_OMAP | ||
194 | help | 195 | help |
195 | Many Texas Instruments OMAP processors have flexible full | 196 | Many Texas Instruments OMAP processors have flexible full |
196 | speed USB device controllers, with support for up to 30 | 197 | speed USB device controllers, with support for up to 30 |
diff --git a/drivers/usb/gadget/f_obex.c b/drivers/usb/gadget/f_obex.c index 80c2e7e9622f..38aa896cc5db 100644 --- a/drivers/usb/gadget/f_obex.c +++ b/drivers/usb/gadget/f_obex.c | |||
@@ -366,9 +366,9 @@ obex_bind(struct usb_configuration *c, struct usb_function *f) | |||
366 | f->hs_descriptors = usb_copy_descriptors(hs_function); | 366 | f->hs_descriptors = usb_copy_descriptors(hs_function); |
367 | 367 | ||
368 | obex->hs.obex_in = usb_find_endpoint(hs_function, | 368 | obex->hs.obex_in = usb_find_endpoint(hs_function, |
369 | f->descriptors, &obex_hs_ep_in_desc); | 369 | f->hs_descriptors, &obex_hs_ep_in_desc); |
370 | obex->hs.obex_out = usb_find_endpoint(hs_function, | 370 | obex->hs.obex_out = usb_find_endpoint(hs_function, |
371 | f->descriptors, &obex_hs_ep_out_desc); | 371 | f->hs_descriptors, &obex_hs_ep_out_desc); |
372 | } | 372 | } |
373 | 373 | ||
374 | /* Avoid letting this gadget enumerate until the userspace | 374 | /* Avoid letting this gadget enumerate until the userspace |
diff --git a/drivers/usb/gadget/file_storage.c b/drivers/usb/gadget/file_storage.c index b10fa31cc915..1ab9dac7e12d 100644 --- a/drivers/usb/gadget/file_storage.c +++ b/drivers/usb/gadget/file_storage.c | |||
@@ -3879,7 +3879,11 @@ static int __init check_parameters(struct fsg_dev *fsg) | |||
3879 | mod_data.protocol_type = USB_SC_SCSI; | 3879 | mod_data.protocol_type = USB_SC_SCSI; |
3880 | mod_data.protocol_name = "Transparent SCSI"; | 3880 | mod_data.protocol_name = "Transparent SCSI"; |
3881 | 3881 | ||
3882 | if (gadget_is_sh(fsg->gadget)) | 3882 | /* Some peripheral controllers are known not to be able to |
3883 | * halt bulk endpoints correctly. If one of them is present, | ||
3884 | * disable stalls. | ||
3885 | */ | ||
3886 | if (gadget_is_sh(fsg->gadget) || gadget_is_at91(fsg->gadget)) | ||
3883 | mod_data.can_stall = 0; | 3887 | mod_data.can_stall = 0; |
3884 | 3888 | ||
3885 | if (mod_data.release == 0xffff) { // Parameter wasn't set | 3889 | if (mod_data.release == 0xffff) { // Parameter wasn't set |
diff --git a/drivers/usb/gadget/fsl_usb2_udc.c b/drivers/usb/gadget/fsl_usb2_udc.c index f3c6703cffda..d8d9a52a44b3 100644 --- a/drivers/usb/gadget/fsl_usb2_udc.c +++ b/drivers/usb/gadget/fsl_usb2_udc.c | |||
@@ -404,7 +404,10 @@ static void struct_ep_qh_setup(struct fsl_udc *udc, unsigned char ep_num, | |||
404 | } | 404 | } |
405 | if (zlt) | 405 | if (zlt) |
406 | tmp |= EP_QUEUE_HEAD_ZLT_SEL; | 406 | tmp |= EP_QUEUE_HEAD_ZLT_SEL; |
407 | |||
407 | p_QH->max_pkt_length = cpu_to_le32(tmp); | 408 | p_QH->max_pkt_length = cpu_to_le32(tmp); |
409 | p_QH->next_dtd_ptr = 1; | ||
410 | p_QH->size_ioc_int_sts = 0; | ||
408 | 411 | ||
409 | return; | 412 | return; |
410 | } | 413 | } |
diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c index 4725d15d096f..e551bb38852b 100644 --- a/drivers/usb/host/ehci-hcd.c +++ b/drivers/usb/host/ehci-hcd.c | |||
@@ -485,6 +485,7 @@ static int ehci_init(struct usb_hcd *hcd) | |||
485 | * periodic_size can shrink by USBCMD update if hcc_params allows. | 485 | * periodic_size can shrink by USBCMD update if hcc_params allows. |
486 | */ | 486 | */ |
487 | ehci->periodic_size = DEFAULT_I_TDPS; | 487 | ehci->periodic_size = DEFAULT_I_TDPS; |
488 | INIT_LIST_HEAD(&ehci->cached_itd_list); | ||
488 | if ((retval = ehci_mem_init(ehci, GFP_KERNEL)) < 0) | 489 | if ((retval = ehci_mem_init(ehci, GFP_KERNEL)) < 0) |
489 | return retval; | 490 | return retval; |
490 | 491 | ||
@@ -497,6 +498,7 @@ static int ehci_init(struct usb_hcd *hcd) | |||
497 | 498 | ||
498 | ehci->reclaim = NULL; | 499 | ehci->reclaim = NULL; |
499 | ehci->next_uframe = -1; | 500 | ehci->next_uframe = -1; |
501 | ehci->clock_frame = -1; | ||
500 | 502 | ||
501 | /* | 503 | /* |
502 | * dedicate a qh for the async ring head, since we couldn't unlink | 504 | * dedicate a qh for the async ring head, since we couldn't unlink |
diff --git a/drivers/usb/host/ehci-mem.c b/drivers/usb/host/ehci-mem.c index 0431397836f6..10d52919abbb 100644 --- a/drivers/usb/host/ehci-mem.c +++ b/drivers/usb/host/ehci-mem.c | |||
@@ -128,6 +128,7 @@ static inline void qh_put (struct ehci_qh *qh) | |||
128 | 128 | ||
129 | static void ehci_mem_cleanup (struct ehci_hcd *ehci) | 129 | static void ehci_mem_cleanup (struct ehci_hcd *ehci) |
130 | { | 130 | { |
131 | free_cached_itd_list(ehci); | ||
131 | if (ehci->async) | 132 | if (ehci->async) |
132 | qh_put (ehci->async); | 133 | qh_put (ehci->async); |
133 | ehci->async = NULL; | 134 | ehci->async = NULL; |
diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c index a081ee65bde6..07bcb931021b 100644 --- a/drivers/usb/host/ehci-sched.c +++ b/drivers/usb/host/ehci-sched.c | |||
@@ -1004,7 +1004,8 @@ iso_stream_put(struct ehci_hcd *ehci, struct ehci_iso_stream *stream) | |||
1004 | 1004 | ||
1005 | is_in = (stream->bEndpointAddress & USB_DIR_IN) ? 0x10 : 0; | 1005 | is_in = (stream->bEndpointAddress & USB_DIR_IN) ? 0x10 : 0; |
1006 | stream->bEndpointAddress &= 0x0f; | 1006 | stream->bEndpointAddress &= 0x0f; |
1007 | stream->ep->hcpriv = NULL; | 1007 | if (stream->ep) |
1008 | stream->ep->hcpriv = NULL; | ||
1008 | 1009 | ||
1009 | if (stream->rescheduled) { | 1010 | if (stream->rescheduled) { |
1010 | ehci_info (ehci, "ep%d%s-iso rescheduled " | 1011 | ehci_info (ehci, "ep%d%s-iso rescheduled " |
@@ -1653,14 +1654,28 @@ itd_complete ( | |||
1653 | (stream->bEndpointAddress & USB_DIR_IN) ? "in" : "out"); | 1654 | (stream->bEndpointAddress & USB_DIR_IN) ? "in" : "out"); |
1654 | } | 1655 | } |
1655 | iso_stream_put (ehci, stream); | 1656 | iso_stream_put (ehci, stream); |
1656 | /* OK to recycle this ITD now that its completion callback ran. */ | 1657 | |
1657 | done: | 1658 | done: |
1658 | usb_put_urb(urb); | 1659 | usb_put_urb(urb); |
1659 | itd->urb = NULL; | 1660 | itd->urb = NULL; |
1660 | itd->stream = NULL; | 1661 | if (ehci->clock_frame != itd->frame || itd->index[7] != -1) { |
1661 | list_move(&itd->itd_list, &stream->free_list); | 1662 | /* OK to recycle this ITD now. */ |
1662 | iso_stream_put(ehci, stream); | 1663 | itd->stream = NULL; |
1663 | 1664 | list_move(&itd->itd_list, &stream->free_list); | |
1665 | iso_stream_put(ehci, stream); | ||
1666 | } else { | ||
1667 | /* HW might remember this ITD, so we can't recycle it yet. | ||
1668 | * Move it to a safe place until a new frame starts. | ||
1669 | */ | ||
1670 | list_move(&itd->itd_list, &ehci->cached_itd_list); | ||
1671 | if (stream->refcount == 2) { | ||
1672 | /* If iso_stream_put() were called here, stream | ||
1673 | * would be freed. Instead, just prevent reuse. | ||
1674 | */ | ||
1675 | stream->ep->hcpriv = NULL; | ||
1676 | stream->ep = NULL; | ||
1677 | } | ||
1678 | } | ||
1664 | return retval; | 1679 | return retval; |
1665 | } | 1680 | } |
1666 | 1681 | ||
@@ -2101,6 +2116,20 @@ done: | |||
2101 | 2116 | ||
2102 | /*-------------------------------------------------------------------------*/ | 2117 | /*-------------------------------------------------------------------------*/ |
2103 | 2118 | ||
2119 | static void free_cached_itd_list(struct ehci_hcd *ehci) | ||
2120 | { | ||
2121 | struct ehci_itd *itd, *n; | ||
2122 | |||
2123 | list_for_each_entry_safe(itd, n, &ehci->cached_itd_list, itd_list) { | ||
2124 | struct ehci_iso_stream *stream = itd->stream; | ||
2125 | itd->stream = NULL; | ||
2126 | list_move(&itd->itd_list, &stream->free_list); | ||
2127 | iso_stream_put(ehci, stream); | ||
2128 | } | ||
2129 | } | ||
2130 | |||
2131 | /*-------------------------------------------------------------------------*/ | ||
2132 | |||
2104 | static void | 2133 | static void |
2105 | scan_periodic (struct ehci_hcd *ehci) | 2134 | scan_periodic (struct ehci_hcd *ehci) |
2106 | { | 2135 | { |
@@ -2115,10 +2144,17 @@ scan_periodic (struct ehci_hcd *ehci) | |||
2115 | * Touches as few pages as possible: cache-friendly. | 2144 | * Touches as few pages as possible: cache-friendly. |
2116 | */ | 2145 | */ |
2117 | now_uframe = ehci->next_uframe; | 2146 | now_uframe = ehci->next_uframe; |
2118 | if (HC_IS_RUNNING (ehci_to_hcd(ehci)->state)) | 2147 | if (HC_IS_RUNNING(ehci_to_hcd(ehci)->state)) { |
2119 | clock = ehci_readl(ehci, &ehci->regs->frame_index); | 2148 | clock = ehci_readl(ehci, &ehci->regs->frame_index); |
2120 | else | 2149 | clock_frame = (clock >> 3) % ehci->periodic_size; |
2150 | } else { | ||
2121 | clock = now_uframe + mod - 1; | 2151 | clock = now_uframe + mod - 1; |
2152 | clock_frame = -1; | ||
2153 | } | ||
2154 | if (ehci->clock_frame != clock_frame) { | ||
2155 | free_cached_itd_list(ehci); | ||
2156 | ehci->clock_frame = clock_frame; | ||
2157 | } | ||
2122 | clock %= mod; | 2158 | clock %= mod; |
2123 | clock_frame = clock >> 3; | 2159 | clock_frame = clock >> 3; |
2124 | 2160 | ||
@@ -2277,6 +2313,10 @@ restart: | |||
2277 | /* rescan the rest of this frame, then ... */ | 2313 | /* rescan the rest of this frame, then ... */ |
2278 | clock = now; | 2314 | clock = now; |
2279 | clock_frame = clock >> 3; | 2315 | clock_frame = clock >> 3; |
2316 | if (ehci->clock_frame != clock_frame) { | ||
2317 | free_cached_itd_list(ehci); | ||
2318 | ehci->clock_frame = clock_frame; | ||
2319 | } | ||
2280 | } else { | 2320 | } else { |
2281 | now_uframe++; | 2321 | now_uframe++; |
2282 | now_uframe %= mod; | 2322 | now_uframe %= mod; |
diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h index fb7054ccf4fc..262b00c9b334 100644 --- a/drivers/usb/host/ehci.h +++ b/drivers/usb/host/ehci.h | |||
@@ -87,6 +87,10 @@ struct ehci_hcd { /* one per controller */ | |||
87 | int next_uframe; /* scan periodic, start here */ | 87 | int next_uframe; /* scan periodic, start here */ |
88 | unsigned periodic_sched; /* periodic activity count */ | 88 | unsigned periodic_sched; /* periodic activity count */ |
89 | 89 | ||
90 | /* list of itds completed while clock_frame was still active */ | ||
91 | struct list_head cached_itd_list; | ||
92 | unsigned clock_frame; | ||
93 | |||
90 | /* per root hub port */ | 94 | /* per root hub port */ |
91 | unsigned long reset_done [EHCI_MAX_ROOT_PORTS]; | 95 | unsigned long reset_done [EHCI_MAX_ROOT_PORTS]; |
92 | 96 | ||
@@ -220,6 +224,8 @@ timer_action (struct ehci_hcd *ehci, enum ehci_timer_action action) | |||
220 | } | 224 | } |
221 | } | 225 | } |
222 | 226 | ||
227 | static void free_cached_itd_list(struct ehci_hcd *ehci); | ||
228 | |||
223 | /*-------------------------------------------------------------------------*/ | 229 | /*-------------------------------------------------------------------------*/ |
224 | 230 | ||
225 | #include <linux/usb/ehci_def.h> | 231 | #include <linux/usb/ehci_def.h> |
diff --git a/drivers/usb/musb/davinci.c b/drivers/usb/musb/davinci.c index 5a8fd5d57a11..2dc7606f319c 100644 --- a/drivers/usb/musb/davinci.c +++ b/drivers/usb/musb/davinci.c | |||
@@ -377,18 +377,8 @@ int __init musb_platform_init(struct musb *musb) | |||
377 | u32 revision; | 377 | u32 revision; |
378 | 378 | ||
379 | musb->mregs += DAVINCI_BASE_OFFSET; | 379 | musb->mregs += DAVINCI_BASE_OFFSET; |
380 | #if 0 | ||
381 | /* REVISIT there's something odd about clocking, this | ||
382 | * didn't appear do the job ... | ||
383 | */ | ||
384 | musb->clock = clk_get(pDevice, "usb"); | ||
385 | if (IS_ERR(musb->clock)) | ||
386 | return PTR_ERR(musb->clock); | ||
387 | 380 | ||
388 | status = clk_enable(musb->clock); | 381 | clk_enable(musb->clock); |
389 | if (status < 0) | ||
390 | return -ENODEV; | ||
391 | #endif | ||
392 | 382 | ||
393 | /* returns zero if e.g. not clocked */ | 383 | /* returns zero if e.g. not clocked */ |
394 | revision = musb_readl(tibase, DAVINCI_USB_VERSION_REG); | 384 | revision = musb_readl(tibase, DAVINCI_USB_VERSION_REG); |
@@ -453,5 +443,8 @@ int musb_platform_exit(struct musb *musb) | |||
453 | } | 443 | } |
454 | 444 | ||
455 | phy_off(); | 445 | phy_off(); |
446 | |||
447 | clk_disable(musb->clock); | ||
448 | |||
456 | return 0; | 449 | return 0; |
457 | } | 450 | } |
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index 2cc34fa05b73..af77e4659006 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c | |||
@@ -115,7 +115,7 @@ | |||
115 | 115 | ||
116 | 116 | ||
117 | unsigned musb_debug; | 117 | unsigned musb_debug; |
118 | module_param(musb_debug, uint, S_IRUGO | S_IWUSR); | 118 | module_param_named(debug, musb_debug, uint, S_IRUGO | S_IWUSR); |
119 | MODULE_PARM_DESC(debug, "Debug message level. Default = 0"); | 119 | MODULE_PARM_DESC(debug, "Debug message level. Default = 0"); |
120 | 120 | ||
121 | #define DRIVER_AUTHOR "Mentor Graphics, Texas Instruments, Nokia" | 121 | #define DRIVER_AUTHOR "Mentor Graphics, Texas Instruments, Nokia" |
@@ -767,6 +767,7 @@ static irqreturn_t musb_stage2_irq(struct musb *musb, u8 int_usb, | |||
767 | #ifdef CONFIG_USB_MUSB_HDRC_HCD | 767 | #ifdef CONFIG_USB_MUSB_HDRC_HCD |
768 | case OTG_STATE_A_HOST: | 768 | case OTG_STATE_A_HOST: |
769 | case OTG_STATE_A_SUSPEND: | 769 | case OTG_STATE_A_SUSPEND: |
770 | usb_hcd_resume_root_hub(musb_to_hcd(musb)); | ||
770 | musb_root_disconnect(musb); | 771 | musb_root_disconnect(musb); |
771 | if (musb->a_wait_bcon != 0) | 772 | if (musb->a_wait_bcon != 0) |
772 | musb_platform_try_idle(musb, jiffies | 773 | musb_platform_try_idle(musb, jiffies |
@@ -1815,7 +1816,7 @@ static void musb_free(struct musb *musb) | |||
1815 | #ifdef CONFIG_SYSFS | 1816 | #ifdef CONFIG_SYSFS |
1816 | device_remove_file(musb->controller, &dev_attr_mode); | 1817 | device_remove_file(musb->controller, &dev_attr_mode); |
1817 | device_remove_file(musb->controller, &dev_attr_vbus); | 1818 | device_remove_file(musb->controller, &dev_attr_vbus); |
1818 | #ifdef CONFIG_USB_MUSB_OTG | 1819 | #ifdef CONFIG_USB_GADGET_MUSB_HDRC |
1819 | device_remove_file(musb->controller, &dev_attr_srp); | 1820 | device_remove_file(musb->controller, &dev_attr_srp); |
1820 | #endif | 1821 | #endif |
1821 | #endif | 1822 | #endif |
@@ -2063,7 +2064,7 @@ fail2: | |||
2063 | #ifdef CONFIG_SYSFS | 2064 | #ifdef CONFIG_SYSFS |
2064 | device_remove_file(musb->controller, &dev_attr_mode); | 2065 | device_remove_file(musb->controller, &dev_attr_mode); |
2065 | device_remove_file(musb->controller, &dev_attr_vbus); | 2066 | device_remove_file(musb->controller, &dev_attr_vbus); |
2066 | #ifdef CONFIG_USB_MUSB_OTG | 2067 | #ifdef CONFIG_USB_GADGET_MUSB_HDRC |
2067 | device_remove_file(musb->controller, &dev_attr_srp); | 2068 | device_remove_file(musb->controller, &dev_attr_srp); |
2068 | #endif | 2069 | #endif |
2069 | #endif | 2070 | #endif |
@@ -2243,10 +2244,10 @@ static int __init musb_init(void) | |||
2243 | return platform_driver_probe(&musb_driver, musb_probe); | 2244 | return platform_driver_probe(&musb_driver, musb_probe); |
2244 | } | 2245 | } |
2245 | 2246 | ||
2246 | /* make us init after usbcore and before usb | 2247 | /* make us init after usbcore and i2c (transceivers, regulators, etc) |
2247 | * gadget and host-side drivers start to register | 2248 | * and before usb gadget and host-side drivers start to register |
2248 | */ | 2249 | */ |
2249 | subsys_initcall(musb_init); | 2250 | fs_initcall(musb_init); |
2250 | 2251 | ||
2251 | static void __exit musb_cleanup(void) | 2252 | static void __exit musb_cleanup(void) |
2252 | { | 2253 | { |
diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c index 4ea305387981..c7ebd0867fcc 100644 --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c | |||
@@ -575,7 +575,7 @@ static void rxstate(struct musb *musb, struct musb_request *req) | |||
575 | struct usb_request *request = &req->request; | 575 | struct usb_request *request = &req->request; |
576 | struct musb_ep *musb_ep = &musb->endpoints[epnum].ep_out; | 576 | struct musb_ep *musb_ep = &musb->endpoints[epnum].ep_out; |
577 | void __iomem *epio = musb->endpoints[epnum].regs; | 577 | void __iomem *epio = musb->endpoints[epnum].regs; |
578 | u16 fifo_count = 0; | 578 | unsigned fifo_count = 0; |
579 | u16 len = musb_ep->packet_sz; | 579 | u16 len = musb_ep->packet_sz; |
580 | 580 | ||
581 | csr = musb_readw(epio, MUSB_RXCSR); | 581 | csr = musb_readw(epio, MUSB_RXCSR); |
@@ -687,7 +687,7 @@ static void rxstate(struct musb *musb, struct musb_request *req) | |||
687 | len, fifo_count, | 687 | len, fifo_count, |
688 | musb_ep->packet_sz); | 688 | musb_ep->packet_sz); |
689 | 689 | ||
690 | fifo_count = min(len, fifo_count); | 690 | fifo_count = min_t(unsigned, len, fifo_count); |
691 | 691 | ||
692 | #ifdef CONFIG_USB_TUSB_OMAP_DMA | 692 | #ifdef CONFIG_USB_TUSB_OMAP_DMA |
693 | if (tusb_dma_omap() && musb_ep->dma) { | 693 | if (tusb_dma_omap() && musb_ep->dma) { |
diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c index a035ceccf950..6dbbd0786a6a 100644 --- a/drivers/usb/musb/musb_host.c +++ b/drivers/usb/musb/musb_host.c | |||
@@ -335,16 +335,11 @@ musb_save_toggle(struct musb_hw_ep *ep, int is_in, struct urb *urb) | |||
335 | static struct musb_qh * | 335 | static struct musb_qh * |
336 | musb_giveback(struct musb_qh *qh, struct urb *urb, int status) | 336 | musb_giveback(struct musb_qh *qh, struct urb *urb, int status) |
337 | { | 337 | { |
338 | int is_in; | ||
339 | struct musb_hw_ep *ep = qh->hw_ep; | 338 | struct musb_hw_ep *ep = qh->hw_ep; |
340 | struct musb *musb = ep->musb; | 339 | struct musb *musb = ep->musb; |
340 | int is_in = usb_pipein(urb->pipe); | ||
341 | int ready = qh->is_ready; | 341 | int ready = qh->is_ready; |
342 | 342 | ||
343 | if (ep->is_shared_fifo) | ||
344 | is_in = 1; | ||
345 | else | ||
346 | is_in = usb_pipein(urb->pipe); | ||
347 | |||
348 | /* save toggle eagerly, for paranoia */ | 343 | /* save toggle eagerly, for paranoia */ |
349 | switch (qh->type) { | 344 | switch (qh->type) { |
350 | case USB_ENDPOINT_XFER_BULK: | 345 | case USB_ENDPOINT_XFER_BULK: |
@@ -432,7 +427,7 @@ musb_advance_schedule(struct musb *musb, struct urb *urb, | |||
432 | else | 427 | else |
433 | qh = musb_giveback(qh, urb, urb->status); | 428 | qh = musb_giveback(qh, urb, urb->status); |
434 | 429 | ||
435 | if (qh && qh->is_ready && !list_empty(&qh->hep->urb_list)) { | 430 | if (qh != NULL && qh->is_ready) { |
436 | DBG(4, "... next ep%d %cX urb %p\n", | 431 | DBG(4, "... next ep%d %cX urb %p\n", |
437 | hw_ep->epnum, is_in ? 'R' : 'T', | 432 | hw_ep->epnum, is_in ? 'R' : 'T', |
438 | next_urb(qh)); | 433 | next_urb(qh)); |
@@ -942,8 +937,8 @@ static bool musb_h_ep0_continue(struct musb *musb, u16 len, struct urb *urb) | |||
942 | switch (musb->ep0_stage) { | 937 | switch (musb->ep0_stage) { |
943 | case MUSB_EP0_IN: | 938 | case MUSB_EP0_IN: |
944 | fifo_dest = urb->transfer_buffer + urb->actual_length; | 939 | fifo_dest = urb->transfer_buffer + urb->actual_length; |
945 | fifo_count = min(len, ((u16) (urb->transfer_buffer_length | 940 | fifo_count = min_t(size_t, len, urb->transfer_buffer_length - |
946 | - urb->actual_length))); | 941 | urb->actual_length); |
947 | if (fifo_count < len) | 942 | if (fifo_count < len) |
948 | urb->status = -EOVERFLOW; | 943 | urb->status = -EOVERFLOW; |
949 | 944 | ||
@@ -976,10 +971,9 @@ static bool musb_h_ep0_continue(struct musb *musb, u16 len, struct urb *urb) | |||
976 | } | 971 | } |
977 | /* FALLTHROUGH */ | 972 | /* FALLTHROUGH */ |
978 | case MUSB_EP0_OUT: | 973 | case MUSB_EP0_OUT: |
979 | fifo_count = min(qh->maxpacket, ((u16) | 974 | fifo_count = min_t(size_t, qh->maxpacket, |
980 | (urb->transfer_buffer_length | 975 | urb->transfer_buffer_length - |
981 | - urb->actual_length))); | 976 | urb->actual_length); |
982 | |||
983 | if (fifo_count) { | 977 | if (fifo_count) { |
984 | fifo_dest = (u8 *) (urb->transfer_buffer | 978 | fifo_dest = (u8 *) (urb->transfer_buffer |
985 | + urb->actual_length); | 979 | + urb->actual_length); |
@@ -1161,7 +1155,8 @@ void musb_host_tx(struct musb *musb, u8 epnum) | |||
1161 | struct urb *urb; | 1155 | struct urb *urb; |
1162 | struct musb_hw_ep *hw_ep = musb->endpoints + epnum; | 1156 | struct musb_hw_ep *hw_ep = musb->endpoints + epnum; |
1163 | void __iomem *epio = hw_ep->regs; | 1157 | void __iomem *epio = hw_ep->regs; |
1164 | struct musb_qh *qh = hw_ep->out_qh; | 1158 | struct musb_qh *qh = hw_ep->is_shared_fifo ? hw_ep->in_qh |
1159 | : hw_ep->out_qh; | ||
1165 | u32 status = 0; | 1160 | u32 status = 0; |
1166 | void __iomem *mbase = musb->mregs; | 1161 | void __iomem *mbase = musb->mregs; |
1167 | struct dma_channel *dma; | 1162 | struct dma_channel *dma; |
@@ -1308,7 +1303,8 @@ void musb_host_tx(struct musb *musb, u8 epnum) | |||
1308 | * packets before updating TXCSR ... other docs disagree ... | 1303 | * packets before updating TXCSR ... other docs disagree ... |
1309 | */ | 1304 | */ |
1310 | /* PIO: start next packet in this URB */ | 1305 | /* PIO: start next packet in this URB */ |
1311 | wLength = min(qh->maxpacket, (u16) wLength); | 1306 | if (wLength > qh->maxpacket) |
1307 | wLength = qh->maxpacket; | ||
1312 | musb_write_fifo(hw_ep, wLength, buf); | 1308 | musb_write_fifo(hw_ep, wLength, buf); |
1313 | qh->segsize = wLength; | 1309 | qh->segsize = wLength; |
1314 | 1310 | ||
@@ -1867,19 +1863,21 @@ static int musb_urb_enqueue( | |||
1867 | } | 1863 | } |
1868 | qh->type_reg = type_reg; | 1864 | qh->type_reg = type_reg; |
1869 | 1865 | ||
1870 | /* precompute rxinterval/txinterval register */ | 1866 | /* Precompute RXINTERVAL/TXINTERVAL register */ |
1871 | interval = min((u8)16, epd->bInterval); /* log encoding */ | ||
1872 | switch (qh->type) { | 1867 | switch (qh->type) { |
1873 | case USB_ENDPOINT_XFER_INT: | 1868 | case USB_ENDPOINT_XFER_INT: |
1874 | /* fullspeed uses linear encoding */ | 1869 | /* |
1875 | if (USB_SPEED_FULL == urb->dev->speed) { | 1870 | * Full/low speeds use the linear encoding, |
1876 | interval = epd->bInterval; | 1871 | * high speed uses the logarithmic encoding. |
1877 | if (!interval) | 1872 | */ |
1878 | interval = 1; | 1873 | if (urb->dev->speed <= USB_SPEED_FULL) { |
1874 | interval = max_t(u8, epd->bInterval, 1); | ||
1875 | break; | ||
1879 | } | 1876 | } |
1880 | /* FALLTHROUGH */ | 1877 | /* FALLTHROUGH */ |
1881 | case USB_ENDPOINT_XFER_ISOC: | 1878 | case USB_ENDPOINT_XFER_ISOC: |
1882 | /* iso always uses log encoding */ | 1879 | /* ISO always uses logarithmic encoding */ |
1880 | interval = min_t(u8, epd->bInterval, 16); | ||
1883 | break; | 1881 | break; |
1884 | default: | 1882 | default: |
1885 | /* REVISIT we actually want to use NAK limits, hinting to the | 1883 | /* REVISIT we actually want to use NAK limits, hinting to the |
@@ -2037,9 +2035,9 @@ static int musb_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status) | |||
2037 | goto done; | 2035 | goto done; |
2038 | 2036 | ||
2039 | /* Any URB not actively programmed into endpoint hardware can be | 2037 | /* Any URB not actively programmed into endpoint hardware can be |
2040 | * immediately given back. Such an URB must be at the head of its | 2038 | * immediately given back; that's any URB not at the head of an |
2041 | * endpoint queue, unless someday we get real DMA queues. And even | 2039 | * endpoint queue, unless someday we get real DMA queues. And even |
2042 | * then, it might not be known to the hardware... | 2040 | * if it's at the head, it might not be known to the hardware... |
2043 | * | 2041 | * |
2044 | * Otherwise abort current transfer, pending dma, etc.; urb->status | 2042 | * Otherwise abort current transfer, pending dma, etc.; urb->status |
2045 | * has already been updated. This is a synchronous abort; it'd be | 2043 | * has already been updated. This is a synchronous abort; it'd be |
@@ -2078,6 +2076,15 @@ static int musb_urb_dequeue(struct usb_hcd *hcd, struct urb *urb, int status) | |||
2078 | qh->is_ready = 0; | 2076 | qh->is_ready = 0; |
2079 | __musb_giveback(musb, urb, 0); | 2077 | __musb_giveback(musb, urb, 0); |
2080 | qh->is_ready = ready; | 2078 | qh->is_ready = ready; |
2079 | |||
2080 | /* If nothing else (usually musb_giveback) is using it | ||
2081 | * and its URB list has emptied, recycle this qh. | ||
2082 | */ | ||
2083 | if (ready && list_empty(&qh->hep->urb_list)) { | ||
2084 | qh->hep->hcpriv = NULL; | ||
2085 | list_del(&qh->ring); | ||
2086 | kfree(qh); | ||
2087 | } | ||
2081 | } else | 2088 | } else |
2082 | ret = musb_cleanup_urb(urb, qh, urb->pipe & USB_DIR_IN); | 2089 | ret = musb_cleanup_urb(urb, qh, urb->pipe & USB_DIR_IN); |
2083 | done: | 2090 | done: |
@@ -2093,15 +2100,16 @@ musb_h_disable(struct usb_hcd *hcd, struct usb_host_endpoint *hep) | |||
2093 | unsigned long flags; | 2100 | unsigned long flags; |
2094 | struct musb *musb = hcd_to_musb(hcd); | 2101 | struct musb *musb = hcd_to_musb(hcd); |
2095 | u8 is_in = epnum & USB_DIR_IN; | 2102 | u8 is_in = epnum & USB_DIR_IN; |
2096 | struct musb_qh *qh = hep->hcpriv; | 2103 | struct musb_qh *qh; |
2097 | struct urb *urb, *tmp; | 2104 | struct urb *urb; |
2098 | struct list_head *sched; | 2105 | struct list_head *sched; |
2099 | 2106 | ||
2100 | if (!qh) | ||
2101 | return; | ||
2102 | |||
2103 | spin_lock_irqsave(&musb->lock, flags); | 2107 | spin_lock_irqsave(&musb->lock, flags); |
2104 | 2108 | ||
2109 | qh = hep->hcpriv; | ||
2110 | if (qh == NULL) | ||
2111 | goto exit; | ||
2112 | |||
2105 | switch (qh->type) { | 2113 | switch (qh->type) { |
2106 | case USB_ENDPOINT_XFER_CONTROL: | 2114 | case USB_ENDPOINT_XFER_CONTROL: |
2107 | sched = &musb->control; | 2115 | sched = &musb->control; |
@@ -2135,13 +2143,28 @@ musb_h_disable(struct usb_hcd *hcd, struct usb_host_endpoint *hep) | |||
2135 | 2143 | ||
2136 | /* cleanup */ | 2144 | /* cleanup */ |
2137 | musb_cleanup_urb(urb, qh, urb->pipe & USB_DIR_IN); | 2145 | musb_cleanup_urb(urb, qh, urb->pipe & USB_DIR_IN); |
2138 | } else | ||
2139 | urb = NULL; | ||
2140 | 2146 | ||
2141 | /* then just nuke all the others */ | 2147 | /* Then nuke all the others ... and advance the |
2142 | list_for_each_entry_safe_from(urb, tmp, &hep->urb_list, urb_list) | 2148 | * queue on hw_ep (e.g. bulk ring) when we're done. |
2143 | musb_giveback(qh, urb, -ESHUTDOWN); | 2149 | */ |
2150 | while (!list_empty(&hep->urb_list)) { | ||
2151 | urb = next_urb(qh); | ||
2152 | urb->status = -ESHUTDOWN; | ||
2153 | musb_advance_schedule(musb, urb, qh->hw_ep, is_in); | ||
2154 | } | ||
2155 | } else { | ||
2156 | /* Just empty the queue; the hardware is busy with | ||
2157 | * other transfers, and since !qh->is_ready nothing | ||
2158 | * will activate any of these as it advances. | ||
2159 | */ | ||
2160 | while (!list_empty(&hep->urb_list)) | ||
2161 | __musb_giveback(musb, next_urb(qh), -ESHUTDOWN); | ||
2144 | 2162 | ||
2163 | hep->hcpriv = NULL; | ||
2164 | list_del(&qh->ring); | ||
2165 | kfree(qh); | ||
2166 | } | ||
2167 | exit: | ||
2145 | spin_unlock_irqrestore(&musb->lock, flags); | 2168 | spin_unlock_irqrestore(&musb->lock, flags); |
2146 | } | 2169 | } |
2147 | 2170 | ||
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index bfd0b68ceccd..b7c132bded7f 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c | |||
@@ -294,7 +294,11 @@ static int option_send_setup(struct tty_struct *tty, struct usb_serial_port *po | |||
294 | 294 | ||
295 | /* Ericsson products */ | 295 | /* Ericsson products */ |
296 | #define ERICSSON_VENDOR_ID 0x0bdb | 296 | #define ERICSSON_VENDOR_ID 0x0bdb |
297 | #define ERICSSON_PRODUCT_F3507G 0x1900 | 297 | #define ERICSSON_PRODUCT_F3507G_1 0x1900 |
298 | #define ERICSSON_PRODUCT_F3507G_2 0x1902 | ||
299 | |||
300 | #define BENQ_VENDOR_ID 0x04a5 | ||
301 | #define BENQ_PRODUCT_H10 0x4068 | ||
298 | 302 | ||
299 | static struct usb_device_id option_ids[] = { | 303 | static struct usb_device_id option_ids[] = { |
300 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) }, | 304 | { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COLT) }, |
@@ -509,7 +513,10 @@ static struct usb_device_id option_ids[] = { | |||
509 | { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_MF626) }, | 513 | { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_MF626) }, |
510 | { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_MF628) }, | 514 | { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_MF628) }, |
511 | { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_CDMA_TECH) }, | 515 | { USB_DEVICE(ZTE_VENDOR_ID, ZTE_PRODUCT_CDMA_TECH) }, |
512 | { USB_DEVICE(ERICSSON_VENDOR_ID, ERICSSON_PRODUCT_F3507G) }, | 516 | { USB_DEVICE(ERICSSON_VENDOR_ID, ERICSSON_PRODUCT_F3507G_1) }, |
517 | { USB_DEVICE(ERICSSON_VENDOR_ID, ERICSSON_PRODUCT_F3507G_2) }, | ||
518 | { USB_DEVICE(BENQ_VENDOR_ID, BENQ_PRODUCT_H10) }, | ||
519 | { USB_DEVICE(0x1da5, 0x4515) }, /* BenQ H20 */ | ||
513 | { } /* Terminating entry */ | 520 | { } /* Terminating entry */ |
514 | }; | 521 | }; |
515 | MODULE_DEVICE_TABLE(usb, option_ids); | 522 | MODULE_DEVICE_TABLE(usb, option_ids); |
diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h index 50dc33a6065b..6f59c8e510ea 100644 --- a/drivers/usb/storage/unusual_devs.h +++ b/drivers/usb/storage/unusual_devs.h | |||
@@ -907,13 +907,13 @@ UNUSUAL_DEV( 0x05e3, 0x0701, 0x0000, 0xffff, | |||
907 | "Genesys Logic", | 907 | "Genesys Logic", |
908 | "USB to IDE Optical", | 908 | "USB to IDE Optical", |
909 | US_SC_DEVICE, US_PR_DEVICE, NULL, | 909 | US_SC_DEVICE, US_PR_DEVICE, NULL, |
910 | US_FL_GO_SLOW | US_FL_MAX_SECTORS_64 ), | 910 | US_FL_GO_SLOW | US_FL_MAX_SECTORS_64 | US_FL_IGNORE_RESIDUE ), |
911 | 911 | ||
912 | UNUSUAL_DEV( 0x05e3, 0x0702, 0x0000, 0xffff, | 912 | UNUSUAL_DEV( 0x05e3, 0x0702, 0x0000, 0xffff, |
913 | "Genesys Logic", | 913 | "Genesys Logic", |
914 | "USB to IDE Disk", | 914 | "USB to IDE Disk", |
915 | US_SC_DEVICE, US_PR_DEVICE, NULL, | 915 | US_SC_DEVICE, US_PR_DEVICE, NULL, |
916 | US_FL_GO_SLOW | US_FL_MAX_SECTORS_64 ), | 916 | US_FL_GO_SLOW | US_FL_MAX_SECTORS_64 | US_FL_IGNORE_RESIDUE ), |
917 | 917 | ||
918 | /* Reported by Ben Efros <ben@pc-doctor.com> */ | 918 | /* Reported by Ben Efros <ben@pc-doctor.com> */ |
919 | UNUSUAL_DEV( 0x05e3, 0x0723, 0x9451, 0x9451, | 919 | UNUSUAL_DEV( 0x05e3, 0x0723, 0x9451, 0x9451, |
diff --git a/drivers/w1/slaves/Kconfig b/drivers/w1/slaves/Kconfig index 8d0b1fb1e52e..1f51366417b9 100644 --- a/drivers/w1/slaves/Kconfig +++ b/drivers/w1/slaves/Kconfig | |||
@@ -16,6 +16,12 @@ config W1_SLAVE_SMEM | |||
16 | Say Y here if you want to connect 1-wire | 16 | Say Y here if you want to connect 1-wire |
17 | simple 64bit memory rom(ds2401/ds2411/ds1990*) to your wire. | 17 | simple 64bit memory rom(ds2401/ds2411/ds1990*) to your wire. |
18 | 18 | ||
19 | config W1_SLAVE_DS2431 | ||
20 | tristate "1kb EEPROM family support (DS2431)" | ||
21 | help | ||
22 | Say Y here if you want to use a 1-wire | ||
23 | 1kb EEPROM family device (DS2431) | ||
24 | |||
19 | config W1_SLAVE_DS2433 | 25 | config W1_SLAVE_DS2433 |
20 | tristate "4kb EEPROM family support (DS2433)" | 26 | tristate "4kb EEPROM family support (DS2433)" |
21 | help | 27 | help |
diff --git a/drivers/w1/slaves/Makefile b/drivers/w1/slaves/Makefile index 990f400b6d22..f1f51f19b129 100644 --- a/drivers/w1/slaves/Makefile +++ b/drivers/w1/slaves/Makefile | |||
@@ -4,6 +4,7 @@ | |||
4 | 4 | ||
5 | obj-$(CONFIG_W1_SLAVE_THERM) += w1_therm.o | 5 | obj-$(CONFIG_W1_SLAVE_THERM) += w1_therm.o |
6 | obj-$(CONFIG_W1_SLAVE_SMEM) += w1_smem.o | 6 | obj-$(CONFIG_W1_SLAVE_SMEM) += w1_smem.o |
7 | obj-$(CONFIG_W1_SLAVE_DS2431) += w1_ds2431.o | ||
7 | obj-$(CONFIG_W1_SLAVE_DS2433) += w1_ds2433.o | 8 | obj-$(CONFIG_W1_SLAVE_DS2433) += w1_ds2433.o |
8 | obj-$(CONFIG_W1_SLAVE_DS2760) += w1_ds2760.o | 9 | obj-$(CONFIG_W1_SLAVE_DS2760) += w1_ds2760.o |
9 | obj-$(CONFIG_W1_SLAVE_BQ27000) += w1_bq27000.o | 10 | obj-$(CONFIG_W1_SLAVE_BQ27000) += w1_bq27000.o |
diff --git a/drivers/w1/slaves/w1_ds2433.c b/drivers/w1/slaves/w1_ds2433.c index 858c16a544c2..139447148822 100644 --- a/drivers/w1/slaves/w1_ds2433.c +++ b/drivers/w1/slaves/w1_ds2433.c | |||
@@ -156,6 +156,9 @@ out_up: | |||
156 | */ | 156 | */ |
157 | static int w1_f23_write(struct w1_slave *sl, int addr, int len, const u8 *data) | 157 | static int w1_f23_write(struct w1_slave *sl, int addr, int len, const u8 *data) |
158 | { | 158 | { |
159 | #ifdef CONFIG_W1_SLAVE_DS2433_CRC | ||
160 | struct w1_f23_data *f23 = sl->family_data; | ||
161 | #endif | ||
159 | u8 wrbuf[4]; | 162 | u8 wrbuf[4]; |
160 | u8 rdbuf[W1_PAGE_SIZE + 3]; | 163 | u8 rdbuf[W1_PAGE_SIZE + 3]; |
161 | u8 es = (addr + len - 1) & 0x1f; | 164 | u8 es = (addr + len - 1) & 0x1f; |
@@ -196,7 +199,9 @@ static int w1_f23_write(struct w1_slave *sl, int addr, int len, const u8 *data) | |||
196 | 199 | ||
197 | /* Reset the bus to wake up the EEPROM (this may not be needed) */ | 200 | /* Reset the bus to wake up the EEPROM (this may not be needed) */ |
198 | w1_reset_bus(sl->master); | 201 | w1_reset_bus(sl->master); |
199 | 202 | #ifdef CONFIG_W1_SLAVE_DS2433_CRC | |
203 | f23->validcrc &= ~(1 << (addr >> W1_PAGE_BITS)); | ||
204 | #endif | ||
200 | return 0; | 205 | return 0; |
201 | } | 206 | } |
202 | 207 | ||
diff --git a/fs/compat_ioctl.c b/fs/compat_ioctl.c index 39bd4d38e889..45e59d3c7f1f 100644 --- a/fs/compat_ioctl.c +++ b/fs/compat_ioctl.c | |||
@@ -1913,6 +1913,9 @@ COMPATIBLE_IOCTL(FIONREAD) /* This is also TIOCINQ */ | |||
1913 | /* 0x00 */ | 1913 | /* 0x00 */ |
1914 | COMPATIBLE_IOCTL(FIBMAP) | 1914 | COMPATIBLE_IOCTL(FIBMAP) |
1915 | COMPATIBLE_IOCTL(FIGETBSZ) | 1915 | COMPATIBLE_IOCTL(FIGETBSZ) |
1916 | /* 'X' - originally XFS but some now in the VFS */ | ||
1917 | COMPATIBLE_IOCTL(FIFREEZE) | ||
1918 | COMPATIBLE_IOCTL(FITHAW) | ||
1916 | /* RAID */ | 1919 | /* RAID */ |
1917 | COMPATIBLE_IOCTL(RAID_VERSION) | 1920 | COMPATIBLE_IOCTL(RAID_VERSION) |
1918 | COMPATIBLE_IOCTL(GET_ARRAY_INFO) | 1921 | COMPATIBLE_IOCTL(GET_ARRAY_INFO) |
diff --git a/fs/dcache.c b/fs/dcache.c index 937df0fb0da5..07e2d4a44bda 100644 --- a/fs/dcache.c +++ b/fs/dcache.c | |||
@@ -1180,7 +1180,7 @@ struct dentry *d_obtain_alias(struct inode *inode) | |||
1180 | iput(inode); | 1180 | iput(inode); |
1181 | return res; | 1181 | return res; |
1182 | } | 1182 | } |
1183 | EXPORT_SYMBOL_GPL(d_obtain_alias); | 1183 | EXPORT_SYMBOL(d_obtain_alias); |
1184 | 1184 | ||
1185 | /** | 1185 | /** |
1186 | * d_splice_alias - splice a disconnected dentry into the tree if one exists | 1186 | * d_splice_alias - splice a disconnected dentry into the tree if one exists |
diff --git a/fs/jffs2/background.c b/fs/jffs2/background.c index 3cceef4ad2b7..e9580104b6ba 100644 --- a/fs/jffs2/background.c +++ b/fs/jffs2/background.c | |||
@@ -95,13 +95,17 @@ static int jffs2_garbage_collect_thread(void *_c) | |||
95 | spin_unlock(&c->erase_completion_lock); | 95 | spin_unlock(&c->erase_completion_lock); |
96 | 96 | ||
97 | 97 | ||
98 | /* This thread is purely an optimisation. But if it runs when | 98 | /* Problem - immediately after bootup, the GCD spends a lot |
99 | other things could be running, it actually makes things a | 99 | * of time in places like jffs2_kill_fragtree(); so much so |
100 | lot worse. Use yield() and put it at the back of the runqueue | 100 | * that userspace processes (like gdm and X) are starved |
101 | every time. Especially during boot, pulling an inode in | 101 | * despite plenty of cond_resched()s and renicing. Yield() |
102 | with read_inode() is much preferable to having the GC thread | 102 | * doesn't help, either (presumably because userspace and GCD |
103 | get there first. */ | 103 | * are generally competing for a higher latency resource - |
104 | yield(); | 104 | * disk). |
105 | * This forces the GCD to slow the hell down. Pulling an | ||
106 | * inode in with read_inode() is much preferable to having | ||
107 | * the GC thread get there first. */ | ||
108 | schedule_timeout_interruptible(msecs_to_jiffies(50)); | ||
105 | 109 | ||
106 | /* Put_super will send a SIGKILL and then wait on the sem. | 110 | /* Put_super will send a SIGKILL and then wait on the sem. |
107 | */ | 111 | */ |
diff --git a/fs/jffs2/readinode.c b/fs/jffs2/readinode.c index 6ca08ad887c0..1fc1e92356ee 100644 --- a/fs/jffs2/readinode.c +++ b/fs/jffs2/readinode.c | |||
@@ -220,7 +220,7 @@ static int jffs2_add_tn_to_tree(struct jffs2_sb_info *c, | |||
220 | struct jffs2_tmp_dnode_info *tn) | 220 | struct jffs2_tmp_dnode_info *tn) |
221 | { | 221 | { |
222 | uint32_t fn_end = tn->fn->ofs + tn->fn->size; | 222 | uint32_t fn_end = tn->fn->ofs + tn->fn->size; |
223 | struct jffs2_tmp_dnode_info *this; | 223 | struct jffs2_tmp_dnode_info *this, *ptn; |
224 | 224 | ||
225 | dbg_readinode("insert fragment %#04x-%#04x, ver %u at %08x\n", tn->fn->ofs, fn_end, tn->version, ref_offset(tn->fn->raw)); | 225 | dbg_readinode("insert fragment %#04x-%#04x, ver %u at %08x\n", tn->fn->ofs, fn_end, tn->version, ref_offset(tn->fn->raw)); |
226 | 226 | ||
@@ -251,11 +251,18 @@ static int jffs2_add_tn_to_tree(struct jffs2_sb_info *c, | |||
251 | if (this) { | 251 | if (this) { |
252 | /* If the node is coincident with another at a lower address, | 252 | /* If the node is coincident with another at a lower address, |
253 | back up until the other node is found. It may be relevant */ | 253 | back up until the other node is found. It may be relevant */ |
254 | while (this->overlapped) | 254 | while (this->overlapped) { |
255 | this = tn_prev(this); | 255 | ptn = tn_prev(this); |
256 | 256 | if (!ptn) { | |
257 | /* First node should never be marked overlapped */ | 257 | /* |
258 | BUG_ON(!this); | 258 | * We killed a node which set the overlapped |
259 | * flags during the scan. Fix it up. | ||
260 | */ | ||
261 | this->overlapped = 0; | ||
262 | break; | ||
263 | } | ||
264 | this = ptn; | ||
265 | } | ||
259 | dbg_readinode("'this' found %#04x-%#04x (%s)\n", this->fn->ofs, this->fn->ofs + this->fn->size, this->fn ? "data" : "hole"); | 266 | dbg_readinode("'this' found %#04x-%#04x (%s)\n", this->fn->ofs, this->fn->ofs + this->fn->size, this->fn ? "data" : "hole"); |
260 | } | 267 | } |
261 | 268 | ||
@@ -360,7 +367,17 @@ static int jffs2_add_tn_to_tree(struct jffs2_sb_info *c, | |||
360 | } | 367 | } |
361 | if (!this->overlapped) | 368 | if (!this->overlapped) |
362 | break; | 369 | break; |
363 | this = tn_prev(this); | 370 | |
371 | ptn = tn_prev(this); | ||
372 | if (!ptn) { | ||
373 | /* | ||
374 | * We killed a node which set the overlapped | ||
375 | * flags during the scan. Fix it up. | ||
376 | */ | ||
377 | this->overlapped = 0; | ||
378 | break; | ||
379 | } | ||
380 | this = ptn; | ||
364 | } | 381 | } |
365 | } | 382 | } |
366 | 383 | ||
@@ -456,8 +473,15 @@ static int jffs2_build_inode_fragtree(struct jffs2_sb_info *c, | |||
456 | eat_last(&rii->tn_root, &last->rb); | 473 | eat_last(&rii->tn_root, &last->rb); |
457 | ver_insert(&ver_root, last); | 474 | ver_insert(&ver_root, last); |
458 | 475 | ||
459 | if (unlikely(last->overlapped)) | 476 | if (unlikely(last->overlapped)) { |
460 | continue; | 477 | if (pen) |
478 | continue; | ||
479 | /* | ||
480 | * We killed a node which set the overlapped | ||
481 | * flags during the scan. Fix it up. | ||
482 | */ | ||
483 | last->overlapped = 0; | ||
484 | } | ||
461 | 485 | ||
462 | /* Now we have a bunch of nodes in reverse version | 486 | /* Now we have a bunch of nodes in reverse version |
463 | order, in the tree at ver_root. Most of the time, | 487 | order, in the tree at ver_root. Most of the time, |
diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c index 60fe74035db5..3a9e5deed74d 100644 --- a/fs/ocfs2/alloc.c +++ b/fs/ocfs2/alloc.c | |||
@@ -4796,6 +4796,29 @@ out: | |||
4796 | return ret; | 4796 | return ret; |
4797 | } | 4797 | } |
4798 | 4798 | ||
4799 | static int ocfs2_replace_extent_rec(struct inode *inode, | ||
4800 | handle_t *handle, | ||
4801 | struct ocfs2_path *path, | ||
4802 | struct ocfs2_extent_list *el, | ||
4803 | int split_index, | ||
4804 | struct ocfs2_extent_rec *split_rec) | ||
4805 | { | ||
4806 | int ret; | ||
4807 | |||
4808 | ret = ocfs2_path_bh_journal_access(handle, inode, path, | ||
4809 | path_num_items(path) - 1); | ||
4810 | if (ret) { | ||
4811 | mlog_errno(ret); | ||
4812 | goto out; | ||
4813 | } | ||
4814 | |||
4815 | el->l_recs[split_index] = *split_rec; | ||
4816 | |||
4817 | ocfs2_journal_dirty(handle, path_leaf_bh(path)); | ||
4818 | out: | ||
4819 | return ret; | ||
4820 | } | ||
4821 | |||
4799 | /* | 4822 | /* |
4800 | * Mark part or all of the extent record at split_index in the leaf | 4823 | * Mark part or all of the extent record at split_index in the leaf |
4801 | * pointed to by path as written. This removes the unwritten | 4824 | * pointed to by path as written. This removes the unwritten |
@@ -4885,7 +4908,9 @@ static int __ocfs2_mark_extent_written(struct inode *inode, | |||
4885 | 4908 | ||
4886 | if (ctxt.c_contig_type == CONTIG_NONE) { | 4909 | if (ctxt.c_contig_type == CONTIG_NONE) { |
4887 | if (ctxt.c_split_covers_rec) | 4910 | if (ctxt.c_split_covers_rec) |
4888 | el->l_recs[split_index] = *split_rec; | 4911 | ret = ocfs2_replace_extent_rec(inode, handle, |
4912 | path, el, | ||
4913 | split_index, split_rec); | ||
4889 | else | 4914 | else |
4890 | ret = ocfs2_split_and_insert(inode, handle, path, et, | 4915 | ret = ocfs2_split_and_insert(inode, handle, path, et, |
4891 | &last_eb_bh, split_index, | 4916 | &last_eb_bh, split_index, |
diff --git a/fs/ocfs2/dlm/dlmmaster.c b/fs/ocfs2/dlm/dlmmaster.c index 54e182a27caf..0a2813947853 100644 --- a/fs/ocfs2/dlm/dlmmaster.c +++ b/fs/ocfs2/dlm/dlmmaster.c | |||
@@ -1849,12 +1849,12 @@ int dlm_assert_master_handler(struct o2net_msg *msg, u32 len, void *data, | |||
1849 | if (!mle) { | 1849 | if (!mle) { |
1850 | if (res->owner != DLM_LOCK_RES_OWNER_UNKNOWN && | 1850 | if (res->owner != DLM_LOCK_RES_OWNER_UNKNOWN && |
1851 | res->owner != assert->node_idx) { | 1851 | res->owner != assert->node_idx) { |
1852 | mlog(ML_ERROR, "assert_master from " | 1852 | mlog(ML_ERROR, "DIE! Mastery assert from %u, " |
1853 | "%u, but current owner is " | 1853 | "but current owner is %u! (%.*s)\n", |
1854 | "%u! (%.*s)\n", | 1854 | assert->node_idx, res->owner, namelen, |
1855 | assert->node_idx, res->owner, | 1855 | name); |
1856 | namelen, name); | 1856 | __dlm_print_one_lock_resource(res); |
1857 | goto kill; | 1857 | BUG(); |
1858 | } | 1858 | } |
1859 | } else if (mle->type != DLM_MLE_MIGRATION) { | 1859 | } else if (mle->type != DLM_MLE_MIGRATION) { |
1860 | if (res->owner != DLM_LOCK_RES_OWNER_UNKNOWN) { | 1860 | if (res->owner != DLM_LOCK_RES_OWNER_UNKNOWN) { |
diff --git a/fs/ocfs2/dlm/dlmthread.c b/fs/ocfs2/dlm/dlmthread.c index d1295203029f..4060bb328bc8 100644 --- a/fs/ocfs2/dlm/dlmthread.c +++ b/fs/ocfs2/dlm/dlmthread.c | |||
@@ -181,8 +181,7 @@ static int dlm_purge_lockres(struct dlm_ctxt *dlm, | |||
181 | 181 | ||
182 | spin_lock(&res->spinlock); | 182 | spin_lock(&res->spinlock); |
183 | /* This ensures that clear refmap is sent after the set */ | 183 | /* This ensures that clear refmap is sent after the set */ |
184 | __dlm_wait_on_lockres_flags(res, (DLM_LOCK_RES_SETREF_INPROG | | 184 | __dlm_wait_on_lockres_flags(res, DLM_LOCK_RES_SETREF_INPROG); |
185 | DLM_LOCK_RES_MIGRATING)); | ||
186 | spin_unlock(&res->spinlock); | 185 | spin_unlock(&res->spinlock); |
187 | 186 | ||
188 | /* clear our bit from the master's refmap, ignore errors */ | 187 | /* clear our bit from the master's refmap, ignore errors */ |
diff --git a/fs/ocfs2/dlm/dlmunlock.c b/fs/ocfs2/dlm/dlmunlock.c index 86ca085ef324..fcf879ed6930 100644 --- a/fs/ocfs2/dlm/dlmunlock.c +++ b/fs/ocfs2/dlm/dlmunlock.c | |||
@@ -117,11 +117,11 @@ static enum dlm_status dlmunlock_common(struct dlm_ctxt *dlm, | |||
117 | else | 117 | else |
118 | BUG_ON(res->owner == dlm->node_num); | 118 | BUG_ON(res->owner == dlm->node_num); |
119 | 119 | ||
120 | spin_lock(&dlm->spinlock); | 120 | spin_lock(&dlm->ast_lock); |
121 | /* We want to be sure that we're not freeing a lock | 121 | /* We want to be sure that we're not freeing a lock |
122 | * that still has AST's pending... */ | 122 | * that still has AST's pending... */ |
123 | in_use = !list_empty(&lock->ast_list); | 123 | in_use = !list_empty(&lock->ast_list); |
124 | spin_unlock(&dlm->spinlock); | 124 | spin_unlock(&dlm->ast_lock); |
125 | if (in_use) { | 125 | if (in_use) { |
126 | mlog(ML_ERROR, "lockres %.*s: Someone is calling dlmunlock " | 126 | mlog(ML_ERROR, "lockres %.*s: Someone is calling dlmunlock " |
127 | "while waiting for an ast!", res->lockname.len, | 127 | "while waiting for an ast!", res->lockname.len, |
diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c index 206a2370876a..7219a86d34cc 100644 --- a/fs/ocfs2/dlmglue.c +++ b/fs/ocfs2/dlmglue.c | |||
@@ -320,9 +320,14 @@ static void ocfs2_schedule_blocked_lock(struct ocfs2_super *osb, | |||
320 | struct ocfs2_lock_res *lockres); | 320 | struct ocfs2_lock_res *lockres); |
321 | static inline void ocfs2_recover_from_dlm_error(struct ocfs2_lock_res *lockres, | 321 | static inline void ocfs2_recover_from_dlm_error(struct ocfs2_lock_res *lockres, |
322 | int convert); | 322 | int convert); |
323 | #define ocfs2_log_dlm_error(_func, _err, _lockres) do { \ | 323 | #define ocfs2_log_dlm_error(_func, _err, _lockres) do { \ |
324 | mlog(ML_ERROR, "DLM error %d while calling %s on resource %s\n", \ | 324 | if ((_lockres)->l_type != OCFS2_LOCK_TYPE_DENTRY) \ |
325 | _err, _func, _lockres->l_name); \ | 325 | mlog(ML_ERROR, "DLM error %d while calling %s on resource %s\n", \ |
326 | _err, _func, _lockres->l_name); \ | ||
327 | else \ | ||
328 | mlog(ML_ERROR, "DLM error %d while calling %s on resource %.*s%08x\n", \ | ||
329 | _err, _func, OCFS2_DENTRY_LOCK_INO_START - 1, (_lockres)->l_name, \ | ||
330 | (unsigned int)ocfs2_get_dentry_lock_ino(_lockres)); \ | ||
326 | } while (0) | 331 | } while (0) |
327 | static int ocfs2_downconvert_thread(void *arg); | 332 | static int ocfs2_downconvert_thread(void *arg); |
328 | static void ocfs2_downconvert_on_unlock(struct ocfs2_super *osb, | 333 | static void ocfs2_downconvert_on_unlock(struct ocfs2_super *osb, |
diff --git a/fs/ocfs2/ocfs2.h b/fs/ocfs2/ocfs2.h index 077384135f4e..946d3c34b90b 100644 --- a/fs/ocfs2/ocfs2.h +++ b/fs/ocfs2/ocfs2.h | |||
@@ -341,6 +341,9 @@ struct ocfs2_super | |||
341 | struct ocfs2_node_map osb_recovering_orphan_dirs; | 341 | struct ocfs2_node_map osb_recovering_orphan_dirs; |
342 | unsigned int *osb_orphan_wipes; | 342 | unsigned int *osb_orphan_wipes; |
343 | wait_queue_head_t osb_wipe_event; | 343 | wait_queue_head_t osb_wipe_event; |
344 | |||
345 | /* used to protect metaecc calculation check of xattr. */ | ||
346 | spinlock_t osb_xattr_lock; | ||
344 | }; | 347 | }; |
345 | 348 | ||
346 | #define OCFS2_SB(sb) ((struct ocfs2_super *)(sb)->s_fs_info) | 349 | #define OCFS2_SB(sb) ((struct ocfs2_super *)(sb)->s_fs_info) |
diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index b1cb38fbe807..7ac83a81ee55 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c | |||
@@ -1537,6 +1537,13 @@ static int ocfs2_get_sector(struct super_block *sb, | |||
1537 | unlock_buffer(*bh); | 1537 | unlock_buffer(*bh); |
1538 | ll_rw_block(READ, 1, bh); | 1538 | ll_rw_block(READ, 1, bh); |
1539 | wait_on_buffer(*bh); | 1539 | wait_on_buffer(*bh); |
1540 | if (!buffer_uptodate(*bh)) { | ||
1541 | mlog_errno(-EIO); | ||
1542 | brelse(*bh); | ||
1543 | *bh = NULL; | ||
1544 | return -EIO; | ||
1545 | } | ||
1546 | |||
1540 | return 0; | 1547 | return 0; |
1541 | } | 1548 | } |
1542 | 1549 | ||
@@ -1747,6 +1754,7 @@ static int ocfs2_initialize_super(struct super_block *sb, | |||
1747 | INIT_LIST_HEAD(&osb->blocked_lock_list); | 1754 | INIT_LIST_HEAD(&osb->blocked_lock_list); |
1748 | osb->blocked_lock_count = 0; | 1755 | osb->blocked_lock_count = 0; |
1749 | spin_lock_init(&osb->osb_lock); | 1756 | spin_lock_init(&osb->osb_lock); |
1757 | spin_lock_init(&osb->osb_xattr_lock); | ||
1750 | ocfs2_init_inode_steal_slot(osb); | 1758 | ocfs2_init_inode_steal_slot(osb); |
1751 | 1759 | ||
1752 | atomic_set(&osb->alloc_stats.moves, 0); | 1760 | atomic_set(&osb->alloc_stats.moves, 0); |
diff --git a/fs/ocfs2/xattr.c b/fs/ocfs2/xattr.c index 915039fffe6e..4ddd788add67 100644 --- a/fs/ocfs2/xattr.c +++ b/fs/ocfs2/xattr.c | |||
@@ -82,13 +82,14 @@ struct ocfs2_xattr_set_ctxt { | |||
82 | 82 | ||
83 | #define OCFS2_XATTR_ROOT_SIZE (sizeof(struct ocfs2_xattr_def_value_root)) | 83 | #define OCFS2_XATTR_ROOT_SIZE (sizeof(struct ocfs2_xattr_def_value_root)) |
84 | #define OCFS2_XATTR_INLINE_SIZE 80 | 84 | #define OCFS2_XATTR_INLINE_SIZE 80 |
85 | #define OCFS2_XATTR_HEADER_GAP 4 | ||
85 | #define OCFS2_XATTR_FREE_IN_IBODY (OCFS2_MIN_XATTR_INLINE_SIZE \ | 86 | #define OCFS2_XATTR_FREE_IN_IBODY (OCFS2_MIN_XATTR_INLINE_SIZE \ |
86 | - sizeof(struct ocfs2_xattr_header) \ | 87 | - sizeof(struct ocfs2_xattr_header) \ |
87 | - sizeof(__u32)) | 88 | - OCFS2_XATTR_HEADER_GAP) |
88 | #define OCFS2_XATTR_FREE_IN_BLOCK(ptr) ((ptr)->i_sb->s_blocksize \ | 89 | #define OCFS2_XATTR_FREE_IN_BLOCK(ptr) ((ptr)->i_sb->s_blocksize \ |
89 | - sizeof(struct ocfs2_xattr_block) \ | 90 | - sizeof(struct ocfs2_xattr_block) \ |
90 | - sizeof(struct ocfs2_xattr_header) \ | 91 | - sizeof(struct ocfs2_xattr_header) \ |
91 | - sizeof(__u32)) | 92 | - OCFS2_XATTR_HEADER_GAP) |
92 | 93 | ||
93 | static struct ocfs2_xattr_def_value_root def_xv = { | 94 | static struct ocfs2_xattr_def_value_root def_xv = { |
94 | .xv.xr_list.l_count = cpu_to_le16(1), | 95 | .xv.xr_list.l_count = cpu_to_le16(1), |
@@ -274,10 +275,12 @@ static int ocfs2_read_xattr_bucket(struct ocfs2_xattr_bucket *bucket, | |||
274 | bucket->bu_blocks, bucket->bu_bhs, 0, | 275 | bucket->bu_blocks, bucket->bu_bhs, 0, |
275 | NULL); | 276 | NULL); |
276 | if (!rc) { | 277 | if (!rc) { |
278 | spin_lock(&OCFS2_SB(bucket->bu_inode->i_sb)->osb_xattr_lock); | ||
277 | rc = ocfs2_validate_meta_ecc_bhs(bucket->bu_inode->i_sb, | 279 | rc = ocfs2_validate_meta_ecc_bhs(bucket->bu_inode->i_sb, |
278 | bucket->bu_bhs, | 280 | bucket->bu_bhs, |
279 | bucket->bu_blocks, | 281 | bucket->bu_blocks, |
280 | &bucket_xh(bucket)->xh_check); | 282 | &bucket_xh(bucket)->xh_check); |
283 | spin_unlock(&OCFS2_SB(bucket->bu_inode->i_sb)->osb_xattr_lock); | ||
281 | if (rc) | 284 | if (rc) |
282 | mlog_errno(rc); | 285 | mlog_errno(rc); |
283 | } | 286 | } |
@@ -310,9 +313,11 @@ static void ocfs2_xattr_bucket_journal_dirty(handle_t *handle, | |||
310 | { | 313 | { |
311 | int i; | 314 | int i; |
312 | 315 | ||
316 | spin_lock(&OCFS2_SB(bucket->bu_inode->i_sb)->osb_xattr_lock); | ||
313 | ocfs2_compute_meta_ecc_bhs(bucket->bu_inode->i_sb, | 317 | ocfs2_compute_meta_ecc_bhs(bucket->bu_inode->i_sb, |
314 | bucket->bu_bhs, bucket->bu_blocks, | 318 | bucket->bu_bhs, bucket->bu_blocks, |
315 | &bucket_xh(bucket)->xh_check); | 319 | &bucket_xh(bucket)->xh_check); |
320 | spin_unlock(&OCFS2_SB(bucket->bu_inode->i_sb)->osb_xattr_lock); | ||
316 | 321 | ||
317 | for (i = 0; i < bucket->bu_blocks; i++) | 322 | for (i = 0; i < bucket->bu_blocks; i++) |
318 | ocfs2_journal_dirty(handle, bucket->bu_bhs[i]); | 323 | ocfs2_journal_dirty(handle, bucket->bu_bhs[i]); |
@@ -1507,7 +1512,7 @@ static int ocfs2_xattr_set_entry(struct inode *inode, | |||
1507 | last += 1; | 1512 | last += 1; |
1508 | } | 1513 | } |
1509 | 1514 | ||
1510 | free = min_offs - ((void *)last - xs->base) - sizeof(__u32); | 1515 | free = min_offs - ((void *)last - xs->base) - OCFS2_XATTR_HEADER_GAP; |
1511 | if (free < 0) | 1516 | if (free < 0) |
1512 | return -EIO; | 1517 | return -EIO; |
1513 | 1518 | ||
@@ -2190,7 +2195,7 @@ static int ocfs2_xattr_can_be_in_inode(struct inode *inode, | |||
2190 | last += 1; | 2195 | last += 1; |
2191 | } | 2196 | } |
2192 | 2197 | ||
2193 | free = min_offs - ((void *)last - xs->base) - sizeof(__u32); | 2198 | free = min_offs - ((void *)last - xs->base) - OCFS2_XATTR_HEADER_GAP; |
2194 | if (free < 0) | 2199 | if (free < 0) |
2195 | return 0; | 2200 | return 0; |
2196 | 2201 | ||
@@ -2592,8 +2597,9 @@ static int __ocfs2_xattr_set_handle(struct inode *inode, | |||
2592 | 2597 | ||
2593 | if (!ret) { | 2598 | if (!ret) { |
2594 | /* Update inode ctime. */ | 2599 | /* Update inode ctime. */ |
2595 | ret = ocfs2_journal_access(ctxt->handle, inode, xis->inode_bh, | 2600 | ret = ocfs2_journal_access_di(ctxt->handle, inode, |
2596 | OCFS2_JOURNAL_ACCESS_WRITE); | 2601 | xis->inode_bh, |
2602 | OCFS2_JOURNAL_ACCESS_WRITE); | ||
2597 | if (ret) { | 2603 | if (ret) { |
2598 | mlog_errno(ret); | 2604 | mlog_errno(ret); |
2599 | goto out; | 2605 | goto out; |
@@ -5060,8 +5066,8 @@ try_again: | |||
5060 | xh_free_start = le16_to_cpu(xh->xh_free_start); | 5066 | xh_free_start = le16_to_cpu(xh->xh_free_start); |
5061 | header_size = sizeof(struct ocfs2_xattr_header) + | 5067 | header_size = sizeof(struct ocfs2_xattr_header) + |
5062 | count * sizeof(struct ocfs2_xattr_entry); | 5068 | count * sizeof(struct ocfs2_xattr_entry); |
5063 | max_free = OCFS2_XATTR_BUCKET_SIZE - | 5069 | max_free = OCFS2_XATTR_BUCKET_SIZE - header_size - |
5064 | le16_to_cpu(xh->xh_name_value_len) - header_size; | 5070 | le16_to_cpu(xh->xh_name_value_len) - OCFS2_XATTR_HEADER_GAP; |
5065 | 5071 | ||
5066 | mlog_bug_on_msg(header_size > blocksize, "bucket %llu has header size " | 5072 | mlog_bug_on_msg(header_size > blocksize, "bucket %llu has header size " |
5067 | "of %u which exceed block size\n", | 5073 | "of %u which exceed block size\n", |
@@ -5094,7 +5100,7 @@ try_again: | |||
5094 | need = 0; | 5100 | need = 0; |
5095 | } | 5101 | } |
5096 | 5102 | ||
5097 | free = xh_free_start - header_size; | 5103 | free = xh_free_start - header_size - OCFS2_XATTR_HEADER_GAP; |
5098 | /* | 5104 | /* |
5099 | * We need to make sure the new name/value pair | 5105 | * We need to make sure the new name/value pair |
5100 | * can exist in the same block. | 5106 | * can exist in the same block. |
@@ -5127,7 +5133,8 @@ try_again: | |||
5127 | } | 5133 | } |
5128 | 5134 | ||
5129 | xh_free_start = le16_to_cpu(xh->xh_free_start); | 5135 | xh_free_start = le16_to_cpu(xh->xh_free_start); |
5130 | free = xh_free_start - header_size; | 5136 | free = xh_free_start - header_size |
5137 | - OCFS2_XATTR_HEADER_GAP; | ||
5131 | if (xh_free_start % blocksize < need) | 5138 | if (xh_free_start % blocksize < need) |
5132 | free -= xh_free_start % blocksize; | 5139 | free -= xh_free_start % blocksize; |
5133 | 5140 | ||
diff --git a/include/linux/io-mapping.h b/include/linux/io-mapping.h index 82df31726a54..cbc2f0cd631b 100644 --- a/include/linux/io-mapping.h +++ b/include/linux/io-mapping.h | |||
@@ -30,11 +30,14 @@ | |||
30 | * See Documentation/io_mapping.txt | 30 | * See Documentation/io_mapping.txt |
31 | */ | 31 | */ |
32 | 32 | ||
33 | /* this struct isn't actually defined anywhere */ | ||
34 | struct io_mapping; | ||
35 | |||
36 | #ifdef CONFIG_HAVE_ATOMIC_IOMAP | 33 | #ifdef CONFIG_HAVE_ATOMIC_IOMAP |
37 | 34 | ||
35 | struct io_mapping { | ||
36 | resource_size_t base; | ||
37 | unsigned long size; | ||
38 | pgprot_t prot; | ||
39 | }; | ||
40 | |||
38 | /* | 41 | /* |
39 | * For small address space machines, mapping large objects | 42 | * For small address space machines, mapping large objects |
40 | * into the kernel virtual space isn't practical. Where | 43 | * into the kernel virtual space isn't practical. Where |
@@ -43,23 +46,40 @@ struct io_mapping; | |||
43 | */ | 46 | */ |
44 | 47 | ||
45 | static inline struct io_mapping * | 48 | static inline struct io_mapping * |
46 | io_mapping_create_wc(unsigned long base, unsigned long size) | 49 | io_mapping_create_wc(resource_size_t base, unsigned long size) |
47 | { | 50 | { |
48 | return (struct io_mapping *) base; | 51 | struct io_mapping *iomap; |
52 | |||
53 | if (!is_io_mapping_possible(base, size)) | ||
54 | return NULL; | ||
55 | |||
56 | iomap = kmalloc(sizeof(*iomap), GFP_KERNEL); | ||
57 | if (!iomap) | ||
58 | return NULL; | ||
59 | |||
60 | iomap->base = base; | ||
61 | iomap->size = size; | ||
62 | iomap->prot = pgprot_writecombine(__pgprot(__PAGE_KERNEL)); | ||
63 | return iomap; | ||
49 | } | 64 | } |
50 | 65 | ||
51 | static inline void | 66 | static inline void |
52 | io_mapping_free(struct io_mapping *mapping) | 67 | io_mapping_free(struct io_mapping *mapping) |
53 | { | 68 | { |
69 | kfree(mapping); | ||
54 | } | 70 | } |
55 | 71 | ||
56 | /* Atomic map/unmap */ | 72 | /* Atomic map/unmap */ |
57 | static inline void * | 73 | static inline void * |
58 | io_mapping_map_atomic_wc(struct io_mapping *mapping, unsigned long offset) | 74 | io_mapping_map_atomic_wc(struct io_mapping *mapping, unsigned long offset) |
59 | { | 75 | { |
60 | offset += (unsigned long) mapping; | 76 | resource_size_t phys_addr; |
61 | return iomap_atomic_prot_pfn(offset >> PAGE_SHIFT, KM_USER0, | 77 | unsigned long pfn; |
62 | __pgprot(__PAGE_KERNEL_WC)); | 78 | |
79 | BUG_ON(offset >= mapping->size); | ||
80 | phys_addr = mapping->base + offset; | ||
81 | pfn = (unsigned long) (phys_addr >> PAGE_SHIFT); | ||
82 | return iomap_atomic_prot_pfn(pfn, KM_USER0, mapping->prot); | ||
63 | } | 83 | } |
64 | 84 | ||
65 | static inline void | 85 | static inline void |
@@ -71,8 +91,9 @@ io_mapping_unmap_atomic(void *vaddr) | |||
71 | static inline void * | 91 | static inline void * |
72 | io_mapping_map_wc(struct io_mapping *mapping, unsigned long offset) | 92 | io_mapping_map_wc(struct io_mapping *mapping, unsigned long offset) |
73 | { | 93 | { |
74 | offset += (unsigned long) mapping; | 94 | BUG_ON(offset >= mapping->size); |
75 | return ioremap_wc(offset, PAGE_SIZE); | 95 | resource_size_t phys_addr = mapping->base + offset; |
96 | return ioremap_wc(phys_addr, PAGE_SIZE); | ||
76 | } | 97 | } |
77 | 98 | ||
78 | static inline void | 99 | static inline void |
@@ -83,9 +104,12 @@ io_mapping_unmap(void *vaddr) | |||
83 | 104 | ||
84 | #else | 105 | #else |
85 | 106 | ||
107 | /* this struct isn't actually defined anywhere */ | ||
108 | struct io_mapping; | ||
109 | |||
86 | /* Create the io_mapping object*/ | 110 | /* Create the io_mapping object*/ |
87 | static inline struct io_mapping * | 111 | static inline struct io_mapping * |
88 | io_mapping_create_wc(unsigned long base, unsigned long size) | 112 | io_mapping_create_wc(resource_size_t base, unsigned long size) |
89 | { | 113 | { |
90 | return (struct io_mapping *) ioremap_wc(base, size); | 114 | return (struct io_mapping *) ioremap_wc(base, size); |
91 | } | 115 | } |
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h index 62d13391a240..152b2f03fb86 100644 --- a/include/linux/tracepoint.h +++ b/include/linux/tracepoint.h | |||
@@ -157,4 +157,7 @@ static inline void tracepoint_synchronize_unregister(void) | |||
157 | #define TRACE_FORMAT(name, proto, args, fmt) \ | 157 | #define TRACE_FORMAT(name, proto, args, fmt) \ |
158 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) | 158 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) |
159 | 159 | ||
160 | #define TRACE_EVENT_FORMAT(name, proto, args, fmt, struct, tpfmt) \ | ||
161 | TRACE_FORMAT(name, PARAMS(proto), PARAMS(args), PARAMS(fmt)) | ||
162 | |||
160 | #endif | 163 | #endif |
diff --git a/include/linux/user_namespace.h b/include/linux/user_namespace.h index 315bcd375224..cc4f45361dbb 100644 --- a/include/linux/user_namespace.h +++ b/include/linux/user_namespace.h | |||
@@ -13,6 +13,7 @@ struct user_namespace { | |||
13 | struct kref kref; | 13 | struct kref kref; |
14 | struct hlist_head uidhash_table[UIDHASH_SZ]; | 14 | struct hlist_head uidhash_table[UIDHASH_SZ]; |
15 | struct user_struct *creator; | 15 | struct user_struct *creator; |
16 | struct work_struct destroyer; | ||
16 | }; | 17 | }; |
17 | 18 | ||
18 | extern struct user_namespace init_user_ns; | 19 | extern struct user_namespace init_user_ns; |
diff --git a/include/trace/irq_event_types.h b/include/trace/irq_event_types.h index 5d0919fdd2d4..65850bc5ea06 100644 --- a/include/trace/irq_event_types.h +++ b/include/trace/irq_event_types.h | |||
@@ -5,13 +5,29 @@ | |||
5 | # error Unless you know what you are doing. | 5 | # error Unless you know what you are doing. |
6 | #endif | 6 | #endif |
7 | 7 | ||
8 | TRACE_FORMAT(irq_handler_entry, | 8 | #undef TRACE_SYSTEM |
9 | #define TRACE_SYSTEM irq | ||
10 | |||
11 | TRACE_EVENT_FORMAT(irq_handler_entry, | ||
9 | TPPROTO(int irq, struct irqaction *action), | 12 | TPPROTO(int irq, struct irqaction *action), |
10 | TPARGS(irq, action), | 13 | TPARGS(irq, action), |
11 | TPFMT("irq=%d handler=%s", irq, action->name)); | 14 | TPFMT("irq=%d handler=%s", irq, action->name), |
15 | TRACE_STRUCT( | ||
16 | TRACE_FIELD(int, irq, irq) | ||
17 | ), | ||
18 | TPRAWFMT("irq %d") | ||
19 | ); | ||
12 | 20 | ||
13 | TRACE_FORMAT(irq_handler_exit, | 21 | TRACE_EVENT_FORMAT(irq_handler_exit, |
14 | TPPROTO(int irq, struct irqaction *action, int ret), | 22 | TPPROTO(int irq, struct irqaction *action, int ret), |
15 | TPARGS(irq, action, ret), | 23 | TPARGS(irq, action, ret), |
16 | TPFMT("irq=%d handler=%s return=%s", | 24 | TPFMT("irq=%d handler=%s return=%s", |
17 | irq, action->name, ret ? "handled" : "unhandled")); | 25 | irq, action->name, ret ? "handled" : "unhandled"), |
26 | TRACE_STRUCT( | ||
27 | TRACE_FIELD(int, irq, irq) | ||
28 | TRACE_FIELD(int, ret, ret) | ||
29 | ), | ||
30 | TPRAWFMT("irq %d ret %d") | ||
31 | ); | ||
32 | |||
33 | #undef TRACE_SYSTEM | ||
diff --git a/include/trace/sched_event_types.h b/include/trace/sched_event_types.h index a3d3d66a51c8..ba059c10b58a 100644 --- a/include/trace/sched_event_types.h +++ b/include/trace/sched_event_types.h | |||
@@ -1,72 +1,146 @@ | |||
1 | 1 | ||
2 | /* use <trace/sched.h> instead */ | 2 | /* use <trace/sched.h> instead */ |
3 | #ifndef TRACE_FORMAT | 3 | #ifndef TRACE_EVENT_FORMAT |
4 | # error Do not include this file directly. | 4 | # error Do not include this file directly. |
5 | # error Unless you know what you are doing. | 5 | # error Unless you know what you are doing. |
6 | #endif | 6 | #endif |
7 | 7 | ||
8 | TRACE_FORMAT(sched_kthread_stop, | 8 | #undef TRACE_SYSTEM |
9 | #define TRACE_SYSTEM sched | ||
10 | |||
11 | TRACE_EVENT_FORMAT(sched_kthread_stop, | ||
9 | TPPROTO(struct task_struct *t), | 12 | TPPROTO(struct task_struct *t), |
10 | TPARGS(t), | 13 | TPARGS(t), |
11 | TPFMT("task %s:%d", t->comm, t->pid)); | 14 | TPFMT("task %s:%d", t->comm, t->pid), |
15 | TRACE_STRUCT( | ||
16 | TRACE_FIELD(pid_t, pid, t->pid) | ||
17 | ), | ||
18 | TPRAWFMT("task %d") | ||
19 | ); | ||
12 | 20 | ||
13 | TRACE_FORMAT(sched_kthread_stop_ret, | 21 | TRACE_EVENT_FORMAT(sched_kthread_stop_ret, |
14 | TPPROTO(int ret), | 22 | TPPROTO(int ret), |
15 | TPARGS(ret), | 23 | TPARGS(ret), |
16 | TPFMT("ret=%d", ret)); | 24 | TPFMT("ret=%d", ret), |
25 | TRACE_STRUCT( | ||
26 | TRACE_FIELD(int, ret, ret) | ||
27 | ), | ||
28 | TPRAWFMT("ret=%d") | ||
29 | ); | ||
17 | 30 | ||
18 | TRACE_FORMAT(sched_wait_task, | 31 | TRACE_EVENT_FORMAT(sched_wait_task, |
19 | TPPROTO(struct rq *rq, struct task_struct *p), | 32 | TPPROTO(struct rq *rq, struct task_struct *p), |
20 | TPARGS(rq, p), | 33 | TPARGS(rq, p), |
21 | TPFMT("task %s:%d", p->comm, p->pid)); | 34 | TPFMT("task %s:%d", p->comm, p->pid), |
35 | TRACE_STRUCT( | ||
36 | TRACE_FIELD(pid_t, pid, p->pid) | ||
37 | ), | ||
38 | TPRAWFMT("task %d") | ||
39 | ); | ||
22 | 40 | ||
23 | TRACE_FORMAT(sched_wakeup, | 41 | TRACE_EVENT_FORMAT(sched_wakeup, |
24 | TPPROTO(struct rq *rq, struct task_struct *p, int success), | 42 | TPPROTO(struct rq *rq, struct task_struct *p, int success), |
25 | TPARGS(rq, p, success), | 43 | TPARGS(rq, p, success), |
26 | TPFMT("task %s:%d %s", | 44 | TPFMT("task %s:%d %s", |
27 | p->comm, p->pid, success?"succeeded":"failed")); | 45 | p->comm, p->pid, success ? "succeeded" : "failed"), |
46 | TRACE_STRUCT( | ||
47 | TRACE_FIELD(pid_t, pid, p->pid) | ||
48 | TRACE_FIELD(int, success, success) | ||
49 | ), | ||
50 | TPRAWFMT("task %d success=%d") | ||
51 | ); | ||
28 | 52 | ||
29 | TRACE_FORMAT(sched_wakeup_new, | 53 | TRACE_EVENT_FORMAT(sched_wakeup_new, |
30 | TPPROTO(struct rq *rq, struct task_struct *p, int success), | 54 | TPPROTO(struct rq *rq, struct task_struct *p, int success), |
31 | TPARGS(rq, p, success), | 55 | TPARGS(rq, p, success), |
32 | TPFMT("task %s:%d", | 56 | TPFMT("task %s:%d", |
33 | p->comm, p->pid, success?"succeeded":"failed")); | 57 | p->comm, p->pid, success ? "succeeded" : "failed"), |
58 | TRACE_STRUCT( | ||
59 | TRACE_FIELD(pid_t, pid, p->pid) | ||
60 | TRACE_FIELD(int, success, success) | ||
61 | ), | ||
62 | TPRAWFMT("task %d success=%d") | ||
63 | ); | ||
34 | 64 | ||
35 | TRACE_FORMAT(sched_switch, | 65 | TRACE_EVENT_FORMAT(sched_switch, |
36 | TPPROTO(struct rq *rq, struct task_struct *prev, | 66 | TPPROTO(struct rq *rq, struct task_struct *prev, |
37 | struct task_struct *next), | 67 | struct task_struct *next), |
38 | TPARGS(rq, prev, next), | 68 | TPARGS(rq, prev, next), |
39 | TPFMT("task %s:%d ==> %s:%d", | 69 | TPFMT("task %s:%d ==> %s:%d", |
40 | prev->comm, prev->pid, next->comm, next->pid)); | 70 | prev->comm, prev->pid, next->comm, next->pid), |
71 | TRACE_STRUCT( | ||
72 | TRACE_FIELD(pid_t, prev_pid, prev->pid) | ||
73 | TRACE_FIELD(int, prev_prio, prev->prio) | ||
74 | TRACE_FIELD(pid_t, next_pid, next->pid) | ||
75 | TRACE_FIELD(int, next_prio, next->prio) | ||
76 | ), | ||
77 | TPRAWFMT("prev %d:%d ==> next %d:%d") | ||
78 | ); | ||
41 | 79 | ||
42 | TRACE_FORMAT(sched_migrate_task, | 80 | TRACE_EVENT_FORMAT(sched_migrate_task, |
43 | TPPROTO(struct task_struct *p, int orig_cpu, int dest_cpu), | 81 | TPPROTO(struct task_struct *p, int orig_cpu, int dest_cpu), |
44 | TPARGS(p, orig_cpu, dest_cpu), | 82 | TPARGS(p, orig_cpu, dest_cpu), |
45 | TPFMT("task %s:%d from: %d to: %d", | 83 | TPFMT("task %s:%d from: %d to: %d", |
46 | p->comm, p->pid, orig_cpu, dest_cpu)); | 84 | p->comm, p->pid, orig_cpu, dest_cpu), |
85 | TRACE_STRUCT( | ||
86 | TRACE_FIELD(pid_t, pid, p->pid) | ||
87 | TRACE_FIELD(int, orig_cpu, orig_cpu) | ||
88 | TRACE_FIELD(int, dest_cpu, dest_cpu) | ||
89 | ), | ||
90 | TPRAWFMT("task %d from: %d to: %d") | ||
91 | ); | ||
47 | 92 | ||
48 | TRACE_FORMAT(sched_process_free, | 93 | TRACE_EVENT_FORMAT(sched_process_free, |
49 | TPPROTO(struct task_struct *p), | 94 | TPPROTO(struct task_struct *p), |
50 | TPARGS(p), | 95 | TPARGS(p), |
51 | TPFMT("task %s:%d", p->comm, p->pid)); | 96 | TPFMT("task %s:%d", p->comm, p->pid), |
97 | TRACE_STRUCT( | ||
98 | TRACE_FIELD(pid_t, pid, p->pid) | ||
99 | ), | ||
100 | TPRAWFMT("task %d") | ||
101 | ); | ||
52 | 102 | ||
53 | TRACE_FORMAT(sched_process_exit, | 103 | TRACE_EVENT_FORMAT(sched_process_exit, |
54 | TPPROTO(struct task_struct *p), | 104 | TPPROTO(struct task_struct *p), |
55 | TPARGS(p), | 105 | TPARGS(p), |
56 | TPFMT("task %s:%d", p->comm, p->pid)); | 106 | TPFMT("task %s:%d", p->comm, p->pid), |
107 | TRACE_STRUCT( | ||
108 | TRACE_FIELD(pid_t, pid, p->pid) | ||
109 | ), | ||
110 | TPRAWFMT("task %d") | ||
111 | ); | ||
57 | 112 | ||
58 | TRACE_FORMAT(sched_process_wait, | 113 | TRACE_EVENT_FORMAT(sched_process_wait, |
59 | TPPROTO(struct pid *pid), | 114 | TPPROTO(struct pid *pid), |
60 | TPARGS(pid), | 115 | TPARGS(pid), |
61 | TPFMT("pid %d", pid)); | 116 | TPFMT("pid %d", pid_nr(pid)), |
117 | TRACE_STRUCT( | ||
118 | TRACE_FIELD(pid_t, pid, pid_nr(pid)) | ||
119 | ), | ||
120 | TPRAWFMT("task %d") | ||
121 | ); | ||
62 | 122 | ||
63 | TRACE_FORMAT(sched_process_fork, | 123 | TRACE_EVENT_FORMAT(sched_process_fork, |
64 | TPPROTO(struct task_struct *parent, struct task_struct *child), | 124 | TPPROTO(struct task_struct *parent, struct task_struct *child), |
65 | TPARGS(parent, child), | 125 | TPARGS(parent, child), |
66 | TPFMT("parent %s:%d child %s:%d", | 126 | TPFMT("parent %s:%d child %s:%d", |
67 | parent->comm, parent->pid, child->comm, child->pid)); | 127 | parent->comm, parent->pid, child->comm, child->pid), |
128 | TRACE_STRUCT( | ||
129 | TRACE_FIELD(pid_t, parent, parent->pid) | ||
130 | TRACE_FIELD(pid_t, child, child->pid) | ||
131 | ), | ||
132 | TPRAWFMT("parent %d child %d") | ||
133 | ); | ||
68 | 134 | ||
69 | TRACE_FORMAT(sched_signal_send, | 135 | TRACE_EVENT_FORMAT(sched_signal_send, |
70 | TPPROTO(int sig, struct task_struct *p), | 136 | TPPROTO(int sig, struct task_struct *p), |
71 | TPARGS(sig, p), | 137 | TPARGS(sig, p), |
72 | TPFMT("sig: %d task %s:%d", sig, p->comm, p->pid)); | 138 | TPFMT("sig: %d task %s:%d", sig, p->comm, p->pid), |
139 | TRACE_STRUCT( | ||
140 | TRACE_FIELD(int, sig, sig) | ||
141 | TRACE_FIELD(pid_t, pid, p->pid) | ||
142 | ), | ||
143 | TPRAWFMT("sig: %d task %d") | ||
144 | ); | ||
145 | |||
146 | #undef TRACE_SYSTEM | ||
diff --git a/include/trace/trace_event_types.h b/include/trace/trace_event_types.h new file mode 100644 index 000000000000..33c8ed5ccb6c --- /dev/null +++ b/include/trace/trace_event_types.h | |||
@@ -0,0 +1,4 @@ | |||
1 | /* trace/<type>_event_types.h here */ | ||
2 | |||
3 | #include <trace/sched_event_types.h> | ||
4 | #include <trace/irq_event_types.h> | ||
diff --git a/include/trace/trace_events.h b/include/trace/trace_events.h new file mode 100644 index 000000000000..ea2ef2051762 --- /dev/null +++ b/include/trace/trace_events.h | |||
@@ -0,0 +1,4 @@ | |||
1 | /* trace/<type>.h here */ | ||
2 | |||
3 | #include <trace/sched.h> | ||
4 | #include <trace/irq.h> | ||
diff --git a/kernel/trace/events.c b/kernel/trace/events.c index 3c75623893cc..f2509cbaacea 100644 --- a/kernel/trace/events.c +++ b/kernel/trace/events.c | |||
@@ -1,15 +1,17 @@ | |||
1 | /* | 1 | /* |
2 | * This is the place to register all trace points as events. | 2 | * This is the place to register all trace points as events. |
3 | * Include the trace/<type>.h at the top. | ||
4 | * Include the trace/<type>_event_types.h at the bottom. | ||
5 | */ | 3 | */ |
6 | 4 | ||
7 | /* trace/<type>.h here */ | 5 | /* someday this needs to go in a generic header */ |
8 | #include <trace/sched.h> | 6 | #define __STR(x) #x |
9 | #include <trace/irq.h> | 7 | #define STR(x) __STR(x) |
10 | 8 | ||
11 | #include "trace_events.h" | 9 | #include <trace/trace_events.h> |
12 | 10 | ||
13 | /* trace/<type>_event_types.h here */ | 11 | #include "trace_output.h" |
14 | #include <trace/sched_event_types.h> | 12 | |
15 | #include <trace/irq_event_types.h> | 13 | #include "trace_events_stage_1.h" |
14 | #include "trace_events_stage_2.h" | ||
15 | #include "trace_events_stage_3.h" | ||
16 | |||
17 | #include <trace/trace_event_types.h> | ||
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 5db7485158df..c5e39cd7310d 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -846,6 +846,20 @@ void trace_buffer_unlock_commit(struct trace_array *tr, | |||
846 | trace_wake_up(); | 846 | trace_wake_up(); |
847 | } | 847 | } |
848 | 848 | ||
849 | struct ring_buffer_event * | ||
850 | trace_current_buffer_lock_reserve(unsigned char type, unsigned long len, | ||
851 | unsigned long flags, int pc) | ||
852 | { | ||
853 | return trace_buffer_lock_reserve(&global_trace, | ||
854 | type, len, flags, pc); | ||
855 | } | ||
856 | |||
857 | void trace_current_buffer_unlock_commit(struct ring_buffer_event *event, | ||
858 | unsigned long flags, int pc) | ||
859 | { | ||
860 | return trace_buffer_unlock_commit(&global_trace, event, flags, pc); | ||
861 | } | ||
862 | |||
849 | void | 863 | void |
850 | trace_function(struct trace_array *tr, | 864 | trace_function(struct trace_array *tr, |
851 | unsigned long ip, unsigned long parent_ip, unsigned long flags, | 865 | unsigned long ip, unsigned long parent_ip, unsigned long flags, |
@@ -3328,7 +3342,7 @@ create_trace_option_files(struct tracer *tracer) | |||
3328 | for (cnt = 0; opts[cnt].name; cnt++) | 3342 | for (cnt = 0; opts[cnt].name; cnt++) |
3329 | ; | 3343 | ; |
3330 | 3344 | ||
3331 | topts = kzalloc(sizeof(*topts) * (cnt + 1), GFP_KERNEL); | 3345 | topts = kcalloc(cnt + 1, sizeof(*topts), GFP_KERNEL); |
3332 | if (!topts) | 3346 | if (!topts) |
3333 | return NULL; | 3347 | return NULL; |
3334 | 3348 | ||
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h index 632191770aac..f6fa0b9f83a8 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h | |||
@@ -442,6 +442,12 @@ void trace_buffer_unlock_commit(struct trace_array *tr, | |||
442 | struct ring_buffer_event *event, | 442 | struct ring_buffer_event *event, |
443 | unsigned long flags, int pc); | 443 | unsigned long flags, int pc); |
444 | 444 | ||
445 | struct ring_buffer_event * | ||
446 | trace_current_buffer_lock_reserve(unsigned char type, unsigned long len, | ||
447 | unsigned long flags, int pc); | ||
448 | void trace_current_buffer_unlock_commit(struct ring_buffer_event *event, | ||
449 | unsigned long flags, int pc); | ||
450 | |||
445 | struct trace_entry *tracing_get_trace_entry(struct trace_array *tr, | 451 | struct trace_entry *tracing_get_trace_entry(struct trace_array *tr, |
446 | struct trace_array_cpu *data); | 452 | struct trace_array_cpu *data); |
447 | 453 | ||
@@ -720,4 +726,30 @@ static inline void trace_branch_disable(void) | |||
720 | } | 726 | } |
721 | #endif /* CONFIG_BRANCH_TRACER */ | 727 | #endif /* CONFIG_BRANCH_TRACER */ |
722 | 728 | ||
729 | /* trace event type bit fields, not numeric */ | ||
730 | enum { | ||
731 | TRACE_EVENT_TYPE_PRINTF = 1, | ||
732 | TRACE_EVENT_TYPE_RAW = 2, | ||
733 | }; | ||
734 | |||
735 | struct ftrace_event_call { | ||
736 | char *name; | ||
737 | char *system; | ||
738 | struct dentry *dir; | ||
739 | int enabled; | ||
740 | int (*regfunc)(void); | ||
741 | void (*unregfunc)(void); | ||
742 | int id; | ||
743 | struct dentry *raw_dir; | ||
744 | int raw_enabled; | ||
745 | int type; | ||
746 | int (*raw_init)(void); | ||
747 | int (*raw_reg)(void); | ||
748 | void (*raw_unreg)(void); | ||
749 | }; | ||
750 | |||
751 | void event_trace_printk(unsigned long ip, const char *fmt, ...); | ||
752 | extern struct ftrace_event_call __start_ftrace_events[]; | ||
753 | extern struct ftrace_event_call __stop_ftrace_events[]; | ||
754 | |||
723 | #endif /* _LINUX_KERNEL_TRACE_H */ | 755 | #endif /* _LINUX_KERNEL_TRACE_H */ |
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index 3bcb9df93342..1d07f800a9ce 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c | |||
@@ -10,7 +10,9 @@ | |||
10 | #include <linux/module.h> | 10 | #include <linux/module.h> |
11 | #include <linux/ctype.h> | 11 | #include <linux/ctype.h> |
12 | 12 | ||
13 | #include "trace_events.h" | 13 | #include "trace.h" |
14 | |||
15 | #define TRACE_SYSTEM "TRACE_SYSTEM" | ||
14 | 16 | ||
15 | #define events_for_each(event) \ | 17 | #define events_for_each(event) \ |
16 | for (event = __start_ftrace_events; \ | 18 | for (event = __start_ftrace_events; \ |
@@ -42,35 +44,87 @@ static void ftrace_clear_events(void) | |||
42 | } | 44 | } |
43 | } | 45 | } |
44 | 46 | ||
47 | static void ftrace_event_enable_disable(struct ftrace_event_call *call, | ||
48 | int enable) | ||
49 | { | ||
50 | |||
51 | switch (enable) { | ||
52 | case 0: | ||
53 | if (call->enabled) { | ||
54 | call->enabled = 0; | ||
55 | call->unregfunc(); | ||
56 | } | ||
57 | if (call->raw_enabled) { | ||
58 | call->raw_enabled = 0; | ||
59 | call->raw_unreg(); | ||
60 | } | ||
61 | break; | ||
62 | case 1: | ||
63 | if (!call->enabled && | ||
64 | (call->type & TRACE_EVENT_TYPE_PRINTF)) { | ||
65 | call->enabled = 1; | ||
66 | call->regfunc(); | ||
67 | } | ||
68 | if (!call->raw_enabled && | ||
69 | (call->type & TRACE_EVENT_TYPE_RAW)) { | ||
70 | call->raw_enabled = 1; | ||
71 | call->raw_reg(); | ||
72 | } | ||
73 | break; | ||
74 | } | ||
75 | } | ||
76 | |||
45 | static int ftrace_set_clr_event(char *buf, int set) | 77 | static int ftrace_set_clr_event(char *buf, int set) |
46 | { | 78 | { |
47 | struct ftrace_event_call *call = __start_ftrace_events; | 79 | struct ftrace_event_call *call = __start_ftrace_events; |
48 | 80 | char *event = NULL, *sub = NULL, *match; | |
81 | int ret = -EINVAL; | ||
82 | |||
83 | /* | ||
84 | * The buf format can be <subsystem>:<event-name> | ||
85 | * *:<event-name> means any event by that name. | ||
86 | * :<event-name> is the same. | ||
87 | * | ||
88 | * <subsystem>:* means all events in that subsystem | ||
89 | * <subsystem>: means the same. | ||
90 | * | ||
91 | * <name> (no ':') means all events in a subsystem with | ||
92 | * the name <name> or any event that matches <name> | ||
93 | */ | ||
94 | |||
95 | match = strsep(&buf, ":"); | ||
96 | if (buf) { | ||
97 | sub = match; | ||
98 | event = buf; | ||
99 | match = NULL; | ||
100 | |||
101 | if (!strlen(sub) || strcmp(sub, "*") == 0) | ||
102 | sub = NULL; | ||
103 | if (!strlen(event) || strcmp(event, "*") == 0) | ||
104 | event = NULL; | ||
105 | } | ||
49 | 106 | ||
50 | events_for_each(call) { | 107 | events_for_each(call) { |
51 | 108 | ||
52 | if (!call->name) | 109 | if (!call->name) |
53 | continue; | 110 | continue; |
54 | 111 | ||
55 | if (strcmp(buf, call->name) != 0) | 112 | if (match && |
113 | strcmp(match, call->name) != 0 && | ||
114 | strcmp(match, call->system) != 0) | ||
56 | continue; | 115 | continue; |
57 | 116 | ||
58 | if (set) { | 117 | if (sub && strcmp(sub, call->system) != 0) |
59 | /* Already set? */ | 118 | continue; |
60 | if (call->enabled) | 119 | |
61 | return 0; | 120 | if (event && strcmp(event, call->name) != 0) |
62 | call->enabled = 1; | 121 | continue; |
63 | call->regfunc(); | 122 | |
64 | } else { | 123 | ftrace_event_enable_disable(call, set); |
65 | /* Already cleared? */ | 124 | |
66 | if (!call->enabled) | 125 | ret = 0; |
67 | return 0; | ||
68 | call->enabled = 0; | ||
69 | call->unregfunc(); | ||
70 | } | ||
71 | return 0; | ||
72 | } | 126 | } |
73 | return -EINVAL; | 127 | return ret; |
74 | } | 128 | } |
75 | 129 | ||
76 | /* 128 should be much more than enough */ | 130 | /* 128 should be much more than enough */ |
@@ -200,6 +254,8 @@ static int t_show(struct seq_file *m, void *v) | |||
200 | { | 254 | { |
201 | struct ftrace_event_call *call = v; | 255 | struct ftrace_event_call *call = v; |
202 | 256 | ||
257 | if (strcmp(call->system, TRACE_SYSTEM) != 0) | ||
258 | seq_printf(m, "%s:", call->system); | ||
203 | seq_printf(m, "%s\n", call->name); | 259 | seq_printf(m, "%s\n", call->name); |
204 | 260 | ||
205 | return 0; | 261 | return 0; |
@@ -236,7 +292,7 @@ event_enable_read(struct file *filp, char __user *ubuf, size_t cnt, | |||
236 | struct ftrace_event_call *call = filp->private_data; | 292 | struct ftrace_event_call *call = filp->private_data; |
237 | char *buf; | 293 | char *buf; |
238 | 294 | ||
239 | if (call->enabled) | 295 | if (call->enabled || call->raw_enabled) |
240 | buf = "1\n"; | 296 | buf = "1\n"; |
241 | else | 297 | else |
242 | buf = "0\n"; | 298 | buf = "0\n"; |
@@ -267,18 +323,8 @@ event_enable_write(struct file *filp, const char __user *ubuf, size_t cnt, | |||
267 | 323 | ||
268 | switch (val) { | 324 | switch (val) { |
269 | case 0: | 325 | case 0: |
270 | if (!call->enabled) | ||
271 | break; | ||
272 | |||
273 | call->enabled = 0; | ||
274 | call->unregfunc(); | ||
275 | break; | ||
276 | case 1: | 326 | case 1: |
277 | if (call->enabled) | 327 | ftrace_event_enable_disable(call, val); |
278 | break; | ||
279 | |||
280 | call->enabled = 1; | ||
281 | call->regfunc(); | ||
282 | break; | 328 | break; |
283 | 329 | ||
284 | default: | 330 | default: |
@@ -290,6 +336,107 @@ event_enable_write(struct file *filp, const char __user *ubuf, size_t cnt, | |||
290 | return cnt; | 336 | return cnt; |
291 | } | 337 | } |
292 | 338 | ||
339 | static ssize_t | ||
340 | event_type_read(struct file *filp, char __user *ubuf, size_t cnt, | ||
341 | loff_t *ppos) | ||
342 | { | ||
343 | struct ftrace_event_call *call = filp->private_data; | ||
344 | char buf[16]; | ||
345 | int r = 0; | ||
346 | |||
347 | if (call->type & TRACE_EVENT_TYPE_PRINTF) | ||
348 | r += sprintf(buf, "printf\n"); | ||
349 | |||
350 | if (call->type & TRACE_EVENT_TYPE_RAW) | ||
351 | r += sprintf(buf+r, "raw\n"); | ||
352 | |||
353 | return simple_read_from_buffer(ubuf, cnt, ppos, buf, r); | ||
354 | } | ||
355 | |||
356 | static ssize_t | ||
357 | event_type_write(struct file *filp, const char __user *ubuf, size_t cnt, | ||
358 | loff_t *ppos) | ||
359 | { | ||
360 | struct ftrace_event_call *call = filp->private_data; | ||
361 | char buf[64]; | ||
362 | |||
363 | /* | ||
364 | * If there's only one type, we can't change it. | ||
365 | * And currently we always have printf type, and we | ||
366 | * may or may not have raw type. | ||
367 | * | ||
368 | * This is a redundant check, the file should be read | ||
369 | * only if this is the case anyway. | ||
370 | */ | ||
371 | |||
372 | if (!call->raw_init) | ||
373 | return -EPERM; | ||
374 | |||
375 | if (cnt >= sizeof(buf)) | ||
376 | return -EINVAL; | ||
377 | |||
378 | if (copy_from_user(&buf, ubuf, cnt)) | ||
379 | return -EFAULT; | ||
380 | |||
381 | buf[cnt] = 0; | ||
382 | |||
383 | if (!strncmp(buf, "printf", 6) && | ||
384 | (!buf[6] || isspace(buf[6]))) { | ||
385 | |||
386 | call->type = TRACE_EVENT_TYPE_PRINTF; | ||
387 | |||
388 | /* | ||
389 | * If raw enabled, the disable it and enable | ||
390 | * printf type. | ||
391 | */ | ||
392 | if (call->raw_enabled) { | ||
393 | call->raw_enabled = 0; | ||
394 | call->raw_unreg(); | ||
395 | |||
396 | call->enabled = 1; | ||
397 | call->regfunc(); | ||
398 | } | ||
399 | |||
400 | } else if (!strncmp(buf, "raw", 3) && | ||
401 | (!buf[3] || isspace(buf[3]))) { | ||
402 | |||
403 | call->type = TRACE_EVENT_TYPE_RAW; | ||
404 | |||
405 | /* | ||
406 | * If printf enabled, the disable it and enable | ||
407 | * raw type. | ||
408 | */ | ||
409 | if (call->enabled) { | ||
410 | call->enabled = 0; | ||
411 | call->unregfunc(); | ||
412 | |||
413 | call->raw_enabled = 1; | ||
414 | call->raw_reg(); | ||
415 | } | ||
416 | } else | ||
417 | return -EINVAL; | ||
418 | |||
419 | *ppos += cnt; | ||
420 | |||
421 | return cnt; | ||
422 | } | ||
423 | |||
424 | static ssize_t | ||
425 | event_available_types_read(struct file *filp, char __user *ubuf, size_t cnt, | ||
426 | loff_t *ppos) | ||
427 | { | ||
428 | struct ftrace_event_call *call = filp->private_data; | ||
429 | char buf[16]; | ||
430 | int r = 0; | ||
431 | |||
432 | r += sprintf(buf, "printf\n"); | ||
433 | |||
434 | if (call->raw_init) | ||
435 | r += sprintf(buf+r, "raw\n"); | ||
436 | |||
437 | return simple_read_from_buffer(ubuf, cnt, ppos, buf, r); | ||
438 | } | ||
439 | |||
293 | static const struct seq_operations show_event_seq_ops = { | 440 | static const struct seq_operations show_event_seq_ops = { |
294 | .start = t_start, | 441 | .start = t_start, |
295 | .next = t_next, | 442 | .next = t_next, |
@@ -325,6 +472,17 @@ static const struct file_operations ftrace_enable_fops = { | |||
325 | .write = event_enable_write, | 472 | .write = event_enable_write, |
326 | }; | 473 | }; |
327 | 474 | ||
475 | static const struct file_operations ftrace_type_fops = { | ||
476 | .open = tracing_open_generic, | ||
477 | .read = event_type_read, | ||
478 | .write = event_type_write, | ||
479 | }; | ||
480 | |||
481 | static const struct file_operations ftrace_available_types_fops = { | ||
482 | .open = tracing_open_generic, | ||
483 | .read = event_available_types_read, | ||
484 | }; | ||
485 | |||
328 | static struct dentry *event_trace_events_dir(void) | 486 | static struct dentry *event_trace_events_dir(void) |
329 | { | 487 | { |
330 | static struct dentry *d_tracer; | 488 | static struct dentry *d_tracer; |
@@ -345,10 +503,71 @@ static struct dentry *event_trace_events_dir(void) | |||
345 | return d_events; | 503 | return d_events; |
346 | } | 504 | } |
347 | 505 | ||
506 | struct event_subsystem { | ||
507 | struct list_head list; | ||
508 | const char *name; | ||
509 | struct dentry *entry; | ||
510 | }; | ||
511 | |||
512 | static LIST_HEAD(event_subsystems); | ||
513 | |||
514 | static struct dentry * | ||
515 | event_subsystem_dir(const char *name, struct dentry *d_events) | ||
516 | { | ||
517 | struct event_subsystem *system; | ||
518 | |||
519 | /* First see if we did not already create this dir */ | ||
520 | list_for_each_entry(system, &event_subsystems, list) { | ||
521 | if (strcmp(system->name, name) == 0) | ||
522 | return system->entry; | ||
523 | } | ||
524 | |||
525 | /* need to create new entry */ | ||
526 | system = kmalloc(sizeof(*system), GFP_KERNEL); | ||
527 | if (!system) { | ||
528 | pr_warning("No memory to create event subsystem %s\n", | ||
529 | name); | ||
530 | return d_events; | ||
531 | } | ||
532 | |||
533 | system->entry = debugfs_create_dir(name, d_events); | ||
534 | if (!system->entry) { | ||
535 | pr_warning("Could not create event subsystem %s\n", | ||
536 | name); | ||
537 | kfree(system); | ||
538 | return d_events; | ||
539 | } | ||
540 | |||
541 | system->name = name; | ||
542 | list_add(&system->list, &event_subsystems); | ||
543 | |||
544 | return system->entry; | ||
545 | } | ||
546 | |||
348 | static int | 547 | static int |
349 | event_create_dir(struct ftrace_event_call *call, struct dentry *d_events) | 548 | event_create_dir(struct ftrace_event_call *call, struct dentry *d_events) |
350 | { | 549 | { |
351 | struct dentry *entry; | 550 | struct dentry *entry; |
551 | int ret; | ||
552 | |||
553 | /* | ||
554 | * If the trace point header did not define TRACE_SYSTEM | ||
555 | * then the system would be called "TRACE_SYSTEM". | ||
556 | */ | ||
557 | if (strcmp(call->system, "TRACE_SYSTEM") != 0) | ||
558 | d_events = event_subsystem_dir(call->system, d_events); | ||
559 | |||
560 | if (call->raw_init) { | ||
561 | ret = call->raw_init(); | ||
562 | if (ret < 0) { | ||
563 | pr_warning("Could not initialize trace point" | ||
564 | " events/%s\n", call->name); | ||
565 | return ret; | ||
566 | } | ||
567 | } | ||
568 | |||
569 | /* default the output to printf */ | ||
570 | call->type = TRACE_EVENT_TYPE_PRINTF; | ||
352 | 571 | ||
353 | call->dir = debugfs_create_dir(call->name, d_events); | 572 | call->dir = debugfs_create_dir(call->name, d_events); |
354 | if (!call->dir) { | 573 | if (!call->dir) { |
@@ -363,6 +582,21 @@ event_create_dir(struct ftrace_event_call *call, struct dentry *d_events) | |||
363 | pr_warning("Could not create debugfs " | 582 | pr_warning("Could not create debugfs " |
364 | "'%s/enable' entry\n", call->name); | 583 | "'%s/enable' entry\n", call->name); |
365 | 584 | ||
585 | /* Only let type be writable, if we can change it */ | ||
586 | entry = debugfs_create_file("type", | ||
587 | call->raw_init ? 0644 : 0444, | ||
588 | call->dir, call, | ||
589 | &ftrace_type_fops); | ||
590 | if (!entry) | ||
591 | pr_warning("Could not create debugfs " | ||
592 | "'%s/type' entry\n", call->name); | ||
593 | |||
594 | entry = debugfs_create_file("available_types", 0444, call->dir, call, | ||
595 | &ftrace_available_types_fops); | ||
596 | if (!entry) | ||
597 | pr_warning("Could not create debugfs " | ||
598 | "'%s/type' available_types\n", call->name); | ||
599 | |||
366 | return 0; | 600 | return 0; |
367 | } | 601 | } |
368 | 602 | ||
diff --git a/kernel/trace/trace_events.h b/kernel/trace/trace_events.h deleted file mode 100644 index deb95e5006c8..000000000000 --- a/kernel/trace/trace_events.h +++ /dev/null | |||
@@ -1,55 +0,0 @@ | |||
1 | #ifndef _LINUX_KERNEL_TRACE_EVENTS_H | ||
2 | #define _LINUX_KERNEL_TRACE_EVENTS_H | ||
3 | |||
4 | #include <linux/debugfs.h> | ||
5 | #include <linux/ftrace.h> | ||
6 | #include "trace.h" | ||
7 | |||
8 | struct ftrace_event_call { | ||
9 | char *name; | ||
10 | struct dentry *dir; | ||
11 | int enabled; | ||
12 | int (*regfunc)(void); | ||
13 | void (*unregfunc)(void); | ||
14 | }; | ||
15 | |||
16 | |||
17 | #undef TPFMT | ||
18 | #define TPFMT(fmt, args...) fmt "\n", ##args | ||
19 | |||
20 | #undef TRACE_FORMAT | ||
21 | #define TRACE_FORMAT(call, proto, args, fmt) \ | ||
22 | static void ftrace_event_##call(proto) \ | ||
23 | { \ | ||
24 | event_trace_printk(_RET_IP_, "(" #call ") " fmt); \ | ||
25 | } \ | ||
26 | \ | ||
27 | static int ftrace_reg_event_##call(void) \ | ||
28 | { \ | ||
29 | int ret; \ | ||
30 | \ | ||
31 | ret = register_trace_##call(ftrace_event_##call); \ | ||
32 | if (!ret) \ | ||
33 | pr_info("event trace: Could not activate trace point " \ | ||
34 | "probe to " #call); \ | ||
35 | return ret; \ | ||
36 | } \ | ||
37 | \ | ||
38 | static void ftrace_unreg_event_##call(void) \ | ||
39 | { \ | ||
40 | unregister_trace_##call(ftrace_event_##call); \ | ||
41 | } \ | ||
42 | \ | ||
43 | static struct ftrace_event_call __used \ | ||
44 | __attribute__((__aligned__(4))) \ | ||
45 | __attribute__((section("_ftrace_events"))) event_##call = { \ | ||
46 | .name = #call, \ | ||
47 | .regfunc = ftrace_reg_event_##call, \ | ||
48 | .unregfunc = ftrace_unreg_event_##call, \ | ||
49 | } | ||
50 | |||
51 | void event_trace_printk(unsigned long ip, const char *fmt, ...); | ||
52 | extern struct ftrace_event_call __start_ftrace_events[]; | ||
53 | extern struct ftrace_event_call __stop_ftrace_events[]; | ||
54 | |||
55 | #endif /* _LINUX_KERNEL_TRACE_EVENTS_H */ | ||
diff --git a/kernel/trace/trace_events_stage_1.h b/kernel/trace/trace_events_stage_1.h new file mode 100644 index 000000000000..fd3bf9382d37 --- /dev/null +++ b/kernel/trace/trace_events_stage_1.h | |||
@@ -0,0 +1,34 @@ | |||
1 | /* | ||
2 | * Stage 1 of the trace events. | ||
3 | * | ||
4 | * Override the macros in <trace/trace_event_types.h> to include the following: | ||
5 | * | ||
6 | * struct ftrace_raw_<call> { | ||
7 | * struct trace_entry ent; | ||
8 | * <type> <item>; | ||
9 | * [...] | ||
10 | * }; | ||
11 | * | ||
12 | * The <type> <item> is created by the TRACE_FIELD(type, item, assign) | ||
13 | * macro. We simply do "type item;", and that will create the fields | ||
14 | * in the structure. | ||
15 | */ | ||
16 | |||
17 | #undef TRACE_FORMAT | ||
18 | #define TRACE_FORMAT(call, proto, args, fmt) | ||
19 | |||
20 | #undef TRACE_EVENT_FORMAT | ||
21 | #define TRACE_EVENT_FORMAT(name, proto, args, fmt, tstruct, tpfmt) \ | ||
22 | struct ftrace_raw_##name { \ | ||
23 | struct trace_entry ent; \ | ||
24 | tstruct \ | ||
25 | }; \ | ||
26 | static struct ftrace_event_call event_##name | ||
27 | |||
28 | #undef TRACE_STRUCT | ||
29 | #define TRACE_STRUCT(args...) args | ||
30 | |||
31 | #define TRACE_FIELD(type, item, assign) \ | ||
32 | type item; | ||
33 | |||
34 | #include <trace/trace_event_types.h> | ||
diff --git a/kernel/trace/trace_events_stage_2.h b/kernel/trace/trace_events_stage_2.h new file mode 100644 index 000000000000..3eaaef5f19e1 --- /dev/null +++ b/kernel/trace/trace_events_stage_2.h | |||
@@ -0,0 +1,72 @@ | |||
1 | /* | ||
2 | * Stage 2 of the trace events. | ||
3 | * | ||
4 | * Override the macros in <trace/trace_event_types.h> to include the following: | ||
5 | * | ||
6 | * enum print_line_t | ||
7 | * ftrace_raw_output_<call>(struct trace_iterator *iter, int flags) | ||
8 | * { | ||
9 | * struct trace_seq *s = &iter->seq; | ||
10 | * struct ftrace_raw_<call> *field; <-- defined in stage 1 | ||
11 | * struct trace_entry *entry; | ||
12 | * int ret; | ||
13 | * | ||
14 | * entry = iter->ent; | ||
15 | * | ||
16 | * if (entry->type != event_<call>.id) { | ||
17 | * WARN_ON_ONCE(1); | ||
18 | * return TRACE_TYPE_UNHANDLED; | ||
19 | * } | ||
20 | * | ||
21 | * field = (typeof(field))entry; | ||
22 | * | ||
23 | * ret = trace_seq_printf(s, <TPRAWFMT> "%s", <ARGS> "\n"); | ||
24 | * if (!ret) | ||
25 | * return TRACE_TYPE_PARTIAL_LINE; | ||
26 | * | ||
27 | * return TRACE_TYPE_HANDLED; | ||
28 | * } | ||
29 | * | ||
30 | * This is the method used to print the raw event to the trace | ||
31 | * output format. Note, this is not needed if the data is read | ||
32 | * in binary. | ||
33 | */ | ||
34 | |||
35 | #undef TRACE_STRUCT | ||
36 | #define TRACE_STRUCT(args...) args | ||
37 | |||
38 | #undef TRACE_FIELD | ||
39 | #define TRACE_FIELD(type, item, assign) \ | ||
40 | field->item, | ||
41 | |||
42 | |||
43 | #undef TPRAWFMT | ||
44 | #define TPRAWFMT(args...) args | ||
45 | |||
46 | #undef TRACE_EVENT_FORMAT | ||
47 | #define TRACE_EVENT_FORMAT(call, proto, args, fmt, tstruct, tpfmt) \ | ||
48 | enum print_line_t \ | ||
49 | ftrace_raw_output_##call(struct trace_iterator *iter, int flags) \ | ||
50 | { \ | ||
51 | struct trace_seq *s = &iter->seq; \ | ||
52 | struct ftrace_raw_##call *field; \ | ||
53 | struct trace_entry *entry; \ | ||
54 | int ret; \ | ||
55 | \ | ||
56 | entry = iter->ent; \ | ||
57 | \ | ||
58 | if (entry->type != event_##call.id) { \ | ||
59 | WARN_ON_ONCE(1); \ | ||
60 | return TRACE_TYPE_UNHANDLED; \ | ||
61 | } \ | ||
62 | \ | ||
63 | field = (typeof(field))entry; \ | ||
64 | \ | ||
65 | ret = trace_seq_printf(s, tpfmt "%s", tstruct "\n"); \ | ||
66 | if (!ret) \ | ||
67 | return TRACE_TYPE_PARTIAL_LINE; \ | ||
68 | \ | ||
69 | return TRACE_TYPE_HANDLED; \ | ||
70 | } | ||
71 | |||
72 | #include <trace/trace_event_types.h> | ||
diff --git a/kernel/trace/trace_events_stage_3.h b/kernel/trace/trace_events_stage_3.h new file mode 100644 index 000000000000..7a161c49deb4 --- /dev/null +++ b/kernel/trace/trace_events_stage_3.h | |||
@@ -0,0 +1,219 @@ | |||
1 | /* | ||
2 | * Stage 3 of the trace events. | ||
3 | * | ||
4 | * Override the macros in <trace/trace_event_types.h> to include the following: | ||
5 | * | ||
6 | * static void ftrace_event_<call>(proto) | ||
7 | * { | ||
8 | * event_trace_printk(_RET_IP_, "(<call>) " <fmt>); | ||
9 | * } | ||
10 | * | ||
11 | * static int ftrace_reg_event_<call>(void) | ||
12 | * { | ||
13 | * int ret; | ||
14 | * | ||
15 | * ret = register_trace_<call>(ftrace_event_<call>); | ||
16 | * if (!ret) | ||
17 | * pr_info("event trace: Could not activate trace point " | ||
18 | * "probe to <call>"); | ||
19 | * return ret; | ||
20 | * } | ||
21 | * | ||
22 | * static void ftrace_unreg_event_<call>(void) | ||
23 | * { | ||
24 | * unregister_trace_<call>(ftrace_event_<call>); | ||
25 | * } | ||
26 | * | ||
27 | * For those macros defined with TRACE_FORMAT: | ||
28 | * | ||
29 | * static struct ftrace_event_call __used | ||
30 | * __attribute__((__aligned__(4))) | ||
31 | * __attribute__((section("_ftrace_events"))) event_<call> = { | ||
32 | * .name = "<call>", | ||
33 | * .regfunc = ftrace_reg_event_<call>, | ||
34 | * .unregfunc = ftrace_unreg_event_<call>, | ||
35 | * } | ||
36 | * | ||
37 | * | ||
38 | * For those macros defined with TRACE_EVENT_FORMAT: | ||
39 | * | ||
40 | * static struct ftrace_event_call event_<call>; | ||
41 | * | ||
42 | * static void ftrace_raw_event_<call>(proto) | ||
43 | * { | ||
44 | * struct ring_buffer_event *event; | ||
45 | * struct ftrace_raw_<call> *entry; <-- defined in stage 1 | ||
46 | * unsigned long irq_flags; | ||
47 | * int pc; | ||
48 | * | ||
49 | * local_save_flags(irq_flags); | ||
50 | * pc = preempt_count(); | ||
51 | * | ||
52 | * event = trace_current_buffer_lock_reserve(event_<call>.id, | ||
53 | * sizeof(struct ftrace_raw_<call>), | ||
54 | * irq_flags, pc); | ||
55 | * if (!event) | ||
56 | * return; | ||
57 | * entry = ring_buffer_event_data(event); | ||
58 | * | ||
59 | * <tstruct>; <-- Here we assign the entries by the TRACE_FIELD. | ||
60 | * | ||
61 | * trace_current_buffer_unlock_commit(event, irq_flags, pc); | ||
62 | * } | ||
63 | * | ||
64 | * static int ftrace_raw_reg_event_<call>(void) | ||
65 | * { | ||
66 | * int ret; | ||
67 | * | ||
68 | * ret = register_trace_<call>(ftrace_raw_event_<call>); | ||
69 | * if (!ret) | ||
70 | * pr_info("event trace: Could not activate trace point " | ||
71 | * "probe to <call>"); | ||
72 | * return ret; | ||
73 | * } | ||
74 | * | ||
75 | * static void ftrace_unreg_event_<call>(void) | ||
76 | * { | ||
77 | * unregister_trace_<call>(ftrace_raw_event_<call>); | ||
78 | * } | ||
79 | * | ||
80 | * static struct trace_event ftrace_event_type_<call> = { | ||
81 | * .trace = ftrace_raw_output_<call>, <-- stage 2 | ||
82 | * }; | ||
83 | * | ||
84 | * static int ftrace_raw_init_event_<call>(void) | ||
85 | * { | ||
86 | * int id; | ||
87 | * | ||
88 | * id = register_ftrace_event(&ftrace_event_type_<call>); | ||
89 | * if (!id) | ||
90 | * return -ENODEV; | ||
91 | * event_<call>.id = id; | ||
92 | * return 0; | ||
93 | * } | ||
94 | * | ||
95 | * static struct ftrace_event_call __used | ||
96 | * __attribute__((__aligned__(4))) | ||
97 | * __attribute__((section("_ftrace_events"))) event_<call> = { | ||
98 | * .name = "<call>", | ||
99 | * .regfunc = ftrace_reg_event_<call>, | ||
100 | * .unregfunc = ftrace_unreg_event_<call>, | ||
101 | * .raw_init = ftrace_raw_init_event_<call>, | ||
102 | * .raw_reg = ftrace_raw_reg_event_<call>, | ||
103 | * .raw_unreg = ftrace_raw_unreg_event_<call>, | ||
104 | * } | ||
105 | * | ||
106 | */ | ||
107 | |||
108 | #undef TPFMT | ||
109 | #define TPFMT(fmt, args...) fmt "\n", ##args | ||
110 | |||
111 | #define _TRACE_FORMAT(call, proto, args, fmt) \ | ||
112 | static void ftrace_event_##call(proto) \ | ||
113 | { \ | ||
114 | event_trace_printk(_RET_IP_, "(" #call ") " fmt); \ | ||
115 | } \ | ||
116 | \ | ||
117 | static int ftrace_reg_event_##call(void) \ | ||
118 | { \ | ||
119 | int ret; \ | ||
120 | \ | ||
121 | ret = register_trace_##call(ftrace_event_##call); \ | ||
122 | if (!ret) \ | ||
123 | pr_info("event trace: Could not activate trace point " \ | ||
124 | "probe to " #call); \ | ||
125 | return ret; \ | ||
126 | } \ | ||
127 | \ | ||
128 | static void ftrace_unreg_event_##call(void) \ | ||
129 | { \ | ||
130 | unregister_trace_##call(ftrace_event_##call); \ | ||
131 | } \ | ||
132 | |||
133 | |||
134 | #undef TRACE_FORMAT | ||
135 | #define TRACE_FORMAT(call, proto, args, fmt) \ | ||
136 | _TRACE_FORMAT(call, PARAMS(proto), PARAMS(args), PARAMS(fmt)) \ | ||
137 | static struct ftrace_event_call __used \ | ||
138 | __attribute__((__aligned__(4))) \ | ||
139 | __attribute__((section("_ftrace_events"))) event_##call = { \ | ||
140 | .name = #call, \ | ||
141 | .system = STR(TRACE_SYSTEM), \ | ||
142 | .regfunc = ftrace_reg_event_##call, \ | ||
143 | .unregfunc = ftrace_unreg_event_##call, \ | ||
144 | } | ||
145 | |||
146 | #undef TRACE_FIELD | ||
147 | #define TRACE_FIELD(type, item, assign)\ | ||
148 | entry->item = assign; | ||
149 | |||
150 | #undef TRACE_EVENT_FORMAT | ||
151 | #define TRACE_EVENT_FORMAT(call, proto, args, fmt, tstruct, tpfmt) \ | ||
152 | _TRACE_FORMAT(call, PARAMS(proto), PARAMS(args), PARAMS(fmt)) \ | ||
153 | \ | ||
154 | static struct ftrace_event_call event_##call; \ | ||
155 | \ | ||
156 | static void ftrace_raw_event_##call(proto) \ | ||
157 | { \ | ||
158 | struct ring_buffer_event *event; \ | ||
159 | struct ftrace_raw_##call *entry; \ | ||
160 | unsigned long irq_flags; \ | ||
161 | int pc; \ | ||
162 | \ | ||
163 | local_save_flags(irq_flags); \ | ||
164 | pc = preempt_count(); \ | ||
165 | \ | ||
166 | event = trace_current_buffer_lock_reserve(event_##call.id, \ | ||
167 | sizeof(struct ftrace_raw_##call), \ | ||
168 | irq_flags, pc); \ | ||
169 | if (!event) \ | ||
170 | return; \ | ||
171 | entry = ring_buffer_event_data(event); \ | ||
172 | \ | ||
173 | tstruct; \ | ||
174 | \ | ||
175 | trace_current_buffer_unlock_commit(event, irq_flags, pc); \ | ||
176 | } \ | ||
177 | \ | ||
178 | static int ftrace_raw_reg_event_##call(void) \ | ||
179 | { \ | ||
180 | int ret; \ | ||
181 | \ | ||
182 | ret = register_trace_##call(ftrace_raw_event_##call); \ | ||
183 | if (!ret) \ | ||
184 | pr_info("event trace: Could not activate trace point " \ | ||
185 | "probe to " #call); \ | ||
186 | return ret; \ | ||
187 | } \ | ||
188 | \ | ||
189 | static void ftrace_raw_unreg_event_##call(void) \ | ||
190 | { \ | ||
191 | unregister_trace_##call(ftrace_raw_event_##call); \ | ||
192 | } \ | ||
193 | \ | ||
194 | static struct trace_event ftrace_event_type_##call = { \ | ||
195 | .trace = ftrace_raw_output_##call, \ | ||
196 | }; \ | ||
197 | \ | ||
198 | static int ftrace_raw_init_event_##call(void) \ | ||
199 | { \ | ||
200 | int id; \ | ||
201 | \ | ||
202 | id = register_ftrace_event(&ftrace_event_type_##call); \ | ||
203 | if (!id) \ | ||
204 | return -ENODEV; \ | ||
205 | event_##call.id = id; \ | ||
206 | return 0; \ | ||
207 | } \ | ||
208 | \ | ||
209 | static struct ftrace_event_call __used \ | ||
210 | __attribute__((__aligned__(4))) \ | ||
211 | __attribute__((section("_ftrace_events"))) event_##call = { \ | ||
212 | .name = #call, \ | ||
213 | .system = STR(TRACE_SYSTEM), \ | ||
214 | .regfunc = ftrace_reg_event_##call, \ | ||
215 | .unregfunc = ftrace_unreg_event_##call, \ | ||
216 | .raw_init = ftrace_raw_init_event_##call, \ | ||
217 | .raw_reg = ftrace_raw_reg_event_##call, \ | ||
218 | .raw_unreg = ftrace_raw_unreg_event_##call, \ | ||
219 | } | ||
diff --git a/kernel/user_namespace.c b/kernel/user_namespace.c index 79084311ee57..076c7c8215b0 100644 --- a/kernel/user_namespace.c +++ b/kernel/user_namespace.c | |||
@@ -60,12 +60,25 @@ int create_user_ns(struct cred *new) | |||
60 | return 0; | 60 | return 0; |
61 | } | 61 | } |
62 | 62 | ||
63 | void free_user_ns(struct kref *kref) | 63 | /* |
64 | * Deferred destructor for a user namespace. This is required because | ||
65 | * free_user_ns() may be called with uidhash_lock held, but we need to call | ||
66 | * back to free_uid() which will want to take the lock again. | ||
67 | */ | ||
68 | static void free_user_ns_work(struct work_struct *work) | ||
64 | { | 69 | { |
65 | struct user_namespace *ns; | 70 | struct user_namespace *ns = |
66 | 71 | container_of(work, struct user_namespace, destroyer); | |
67 | ns = container_of(kref, struct user_namespace, kref); | ||
68 | free_uid(ns->creator); | 72 | free_uid(ns->creator); |
69 | kfree(ns); | 73 | kfree(ns); |
70 | } | 74 | } |
75 | |||
76 | void free_user_ns(struct kref *kref) | ||
77 | { | ||
78 | struct user_namespace *ns = | ||
79 | container_of(kref, struct user_namespace, kref); | ||
80 | |||
81 | INIT_WORK(&ns->destroyer, free_user_ns_work); | ||
82 | schedule_work(&ns->destroyer); | ||
83 | } | ||
71 | EXPORT_SYMBOL(free_user_ns); | 84 | EXPORT_SYMBOL(free_user_ns); |
diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 903cad46e796..520a75980269 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c | |||
@@ -323,6 +323,7 @@ static struct vmap_area *alloc_vmap_area(unsigned long size, | |||
323 | unsigned long addr; | 323 | unsigned long addr; |
324 | int purged = 0; | 324 | int purged = 0; |
325 | 325 | ||
326 | BUG_ON(!size); | ||
326 | BUG_ON(size & ~PAGE_MASK); | 327 | BUG_ON(size & ~PAGE_MASK); |
327 | 328 | ||
328 | va = kmalloc_node(sizeof(struct vmap_area), | 329 | va = kmalloc_node(sizeof(struct vmap_area), |
@@ -334,6 +335,9 @@ retry: | |||
334 | addr = ALIGN(vstart, align); | 335 | addr = ALIGN(vstart, align); |
335 | 336 | ||
336 | spin_lock(&vmap_area_lock); | 337 | spin_lock(&vmap_area_lock); |
338 | if (addr + size - 1 < addr) | ||
339 | goto overflow; | ||
340 | |||
337 | /* XXX: could have a last_hole cache */ | 341 | /* XXX: could have a last_hole cache */ |
338 | n = vmap_area_root.rb_node; | 342 | n = vmap_area_root.rb_node; |
339 | if (n) { | 343 | if (n) { |
@@ -365,6 +369,8 @@ retry: | |||
365 | 369 | ||
366 | while (addr + size > first->va_start && addr + size <= vend) { | 370 | while (addr + size > first->va_start && addr + size <= vend) { |
367 | addr = ALIGN(first->va_end + PAGE_SIZE, align); | 371 | addr = ALIGN(first->va_end + PAGE_SIZE, align); |
372 | if (addr + size - 1 < addr) | ||
373 | goto overflow; | ||
368 | 374 | ||
369 | n = rb_next(&first->rb_node); | 375 | n = rb_next(&first->rb_node); |
370 | if (n) | 376 | if (n) |
@@ -375,6 +381,7 @@ retry: | |||
375 | } | 381 | } |
376 | found: | 382 | found: |
377 | if (addr + size > vend) { | 383 | if (addr + size > vend) { |
384 | overflow: | ||
378 | spin_unlock(&vmap_area_lock); | 385 | spin_unlock(&vmap_area_lock); |
379 | if (!purged) { | 386 | if (!purged) { |
380 | purge_vmap_area_lazy(); | 387 | purge_vmap_area_lazy(); |
@@ -498,6 +505,7 @@ static void __purge_vmap_area_lazy(unsigned long *start, unsigned long *end, | |||
498 | static DEFINE_SPINLOCK(purge_lock); | 505 | static DEFINE_SPINLOCK(purge_lock); |
499 | LIST_HEAD(valist); | 506 | LIST_HEAD(valist); |
500 | struct vmap_area *va; | 507 | struct vmap_area *va; |
508 | struct vmap_area *n_va; | ||
501 | int nr = 0; | 509 | int nr = 0; |
502 | 510 | ||
503 | /* | 511 | /* |
@@ -537,7 +545,7 @@ static void __purge_vmap_area_lazy(unsigned long *start, unsigned long *end, | |||
537 | 545 | ||
538 | if (nr) { | 546 | if (nr) { |
539 | spin_lock(&vmap_area_lock); | 547 | spin_lock(&vmap_area_lock); |
540 | list_for_each_entry(va, &valist, purge_list) | 548 | list_for_each_entry_safe(va, n_va, &valist, purge_list) |
541 | __free_vmap_area(va); | 549 | __free_vmap_area(va); |
542 | spin_unlock(&vmap_area_lock); | 550 | spin_unlock(&vmap_area_lock); |
543 | } | 551 | } |
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 45eb0ae98eba..2d5ece798c4c 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl | |||
@@ -10,7 +10,7 @@ use strict; | |||
10 | my $P = $0; | 10 | my $P = $0; |
11 | $P =~ s@.*/@@g; | 11 | $P =~ s@.*/@@g; |
12 | 12 | ||
13 | my $V = '0.27'; | 13 | my $V = '0.28'; |
14 | 14 | ||
15 | use Getopt::Long qw(:config no_auto_abbrev); | 15 | use Getopt::Long qw(:config no_auto_abbrev); |
16 | 16 | ||
@@ -110,7 +110,8 @@ our $Sparse = qr{ | |||
110 | __iomem| | 110 | __iomem| |
111 | __must_check| | 111 | __must_check| |
112 | __init_refok| | 112 | __init_refok| |
113 | __kprobes | 113 | __kprobes| |
114 | __ref | ||
114 | }x; | 115 | }x; |
115 | our $Attribute = qr{ | 116 | our $Attribute = qr{ |
116 | const| | 117 | const| |
@@ -1240,7 +1241,8 @@ sub process { | |||
1240 | $realfile =~ s@^([^/]*)/@@; | 1241 | $realfile =~ s@^([^/]*)/@@; |
1241 | 1242 | ||
1242 | $p1_prefix = $1; | 1243 | $p1_prefix = $1; |
1243 | if ($tree && $p1_prefix ne '' && -e "$root/$p1_prefix") { | 1244 | if (!$file && $tree && $p1_prefix ne '' && |
1245 | -e "$root/$p1_prefix") { | ||
1244 | WARN("patch prefix '$p1_prefix' exists, appears to be a -p0 patch\n"); | 1246 | WARN("patch prefix '$p1_prefix' exists, appears to be a -p0 patch\n"); |
1245 | } | 1247 | } |
1246 | 1248 | ||
@@ -1583,9 +1585,9 @@ sub process { | |||
1583 | } | 1585 | } |
1584 | # TEST: allow direct testing of the attribute matcher. | 1586 | # TEST: allow direct testing of the attribute matcher. |
1585 | if ($dbg_attr) { | 1587 | if ($dbg_attr) { |
1586 | if ($line =~ /^.\s*$Attribute\s*$/) { | 1588 | if ($line =~ /^.\s*$Modifier\s*$/) { |
1587 | ERROR("TEST: is attr\n" . $herecurr); | 1589 | ERROR("TEST: is attr\n" . $herecurr); |
1588 | } elsif ($dbg_attr > 1 && $line =~ /^.+($Attribute)/) { | 1590 | } elsif ($dbg_attr > 1 && $line =~ /^.+($Modifier)/) { |
1589 | ERROR("TEST: is not attr ($1 is)\n". $herecurr); | 1591 | ERROR("TEST: is not attr ($1 is)\n". $herecurr); |
1590 | } | 1592 | } |
1591 | next; | 1593 | next; |
@@ -1657,7 +1659,7 @@ sub process { | |||
1657 | 1659 | ||
1658 | # * goes on variable not on type | 1660 | # * goes on variable not on type |
1659 | # (char*[ const]) | 1661 | # (char*[ const]) |
1660 | if ($line =~ m{\($NonptrType(\s*\*[\s\*]*(?:$Modifier\s*)*)\)}) { | 1662 | if ($line =~ m{\($NonptrType(\s*(?:$Modifier\b\s*|\*\s*)+)\)}) { |
1661 | my ($from, $to) = ($1, $1); | 1663 | my ($from, $to) = ($1, $1); |
1662 | 1664 | ||
1663 | # Should start with a space. | 1665 | # Should start with a space. |
@@ -1672,7 +1674,7 @@ sub process { | |||
1672 | if ($from ne $to) { | 1674 | if ($from ne $to) { |
1673 | ERROR("\"(foo$from)\" should be \"(foo$to)\"\n" . $herecurr); | 1675 | ERROR("\"(foo$from)\" should be \"(foo$to)\"\n" . $herecurr); |
1674 | } | 1676 | } |
1675 | } elsif ($line =~ m{\b$NonptrType(\s*\*[\s\*]*(?:$Modifier\s*)?)($Ident)}) { | 1677 | } elsif ($line =~ m{\b$NonptrType(\s*(?:$Modifier\b\s*|\*\s*)+)($Ident)}) { |
1676 | my ($from, $to, $ident) = ($1, $1, $2); | 1678 | my ($from, $to, $ident) = ($1, $1, $2); |
1677 | 1679 | ||
1678 | # Should start with a space. | 1680 | # Should start with a space. |
@@ -1685,8 +1687,8 @@ sub process { | |||
1685 | # Modifiers should have spaces. | 1687 | # Modifiers should have spaces. |
1686 | $to =~ s/(\b$Modifier$)/$1 /; | 1688 | $to =~ s/(\b$Modifier$)/$1 /; |
1687 | 1689 | ||
1688 | #print "from<$from> to<$to>\n"; | 1690 | #print "from<$from> to<$to> ident<$ident>\n"; |
1689 | if ($from ne $to) { | 1691 | if ($from ne $to && $ident !~ /^$Modifier$/) { |
1690 | ERROR("\"foo${from}bar\" should be \"foo${to}bar\"\n" . $herecurr); | 1692 | ERROR("\"foo${from}bar\" should be \"foo${to}bar\"\n" . $herecurr); |
1691 | } | 1693 | } |
1692 | } | 1694 | } |
@@ -1885,11 +1887,11 @@ sub process { | |||
1885 | if ($ctx !~ /[WEBC]x./ && $ca !~ /(?:\)|!|~|\*|-|\&|\||\+\+|\-\-|\{)$/) { | 1887 | if ($ctx !~ /[WEBC]x./ && $ca !~ /(?:\)|!|~|\*|-|\&|\||\+\+|\-\-|\{)$/) { |
1886 | ERROR("space required before that '$op' $at\n" . $hereptr); | 1888 | ERROR("space required before that '$op' $at\n" . $hereptr); |
1887 | } | 1889 | } |
1888 | if ($op eq '*' && $cc =~/\s*const\b/) { | 1890 | if ($op eq '*' && $cc =~/\s*$Modifier\b/) { |
1889 | # A unary '*' may be const | 1891 | # A unary '*' may be const |
1890 | 1892 | ||
1891 | } elsif ($ctx =~ /.xW/) { | 1893 | } elsif ($ctx =~ /.xW/) { |
1892 | ERROR("space prohibited after that '$op' $at\n" . $hereptr); | 1894 | ERROR("Aspace prohibited after that '$op' $at\n" . $hereptr); |
1893 | } | 1895 | } |
1894 | 1896 | ||
1895 | # unary ++ and unary -- are allowed no space on one side. | 1897 | # unary ++ and unary -- are allowed no space on one side. |
@@ -2560,7 +2562,7 @@ sub process { | |||
2560 | if ($line =~ /\bin_atomic\s*\(/) { | 2562 | if ($line =~ /\bin_atomic\s*\(/) { |
2561 | if ($realfile =~ m@^drivers/@) { | 2563 | if ($realfile =~ m@^drivers/@) { |
2562 | ERROR("do not use in_atomic in drivers\n" . $herecurr); | 2564 | ERROR("do not use in_atomic in drivers\n" . $herecurr); |
2563 | } else { | 2565 | } elsif ($realfile !~ m@^kernel/@) { |
2564 | WARN("use of in_atomic() is incorrect outside core kernel code\n" . $herecurr); | 2566 | WARN("use of in_atomic() is incorrect outside core kernel code\n" . $herecurr); |
2565 | } | 2567 | } |
2566 | } | 2568 | } |