diff options
54 files changed, 613 insertions, 466 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 0ed3234125e3..54f21a5c262b 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
| @@ -114,7 +114,7 @@ In addition, the following text indicates that the option: | |||
| 114 | Parameters denoted with BOOT are actually interpreted by the boot | 114 | Parameters denoted with BOOT are actually interpreted by the boot |
| 115 | loader, and have no meaning to the kernel directly. | 115 | loader, and have no meaning to the kernel directly. |
| 116 | Do not modify the syntax of boot loader parameters without extreme | 116 | Do not modify the syntax of boot loader parameters without extreme |
| 117 | need or coordination with <Documentation/x86/i386/boot.txt>. | 117 | need or coordination with <Documentation/x86/boot.txt>. |
| 118 | 118 | ||
| 119 | There are also arch-specific kernel-parameters not documented here. | 119 | There are also arch-specific kernel-parameters not documented here. |
| 120 | See for example <Documentation/x86/x86_64/boot-options.txt>. | 120 | See for example <Documentation/x86/x86_64/boot-options.txt>. |
| @@ -2451,7 +2451,7 @@ and is between 256 and 4096 characters. It is defined in the file | |||
| 2451 | See Documentation/fb/modedb.txt. | 2451 | See Documentation/fb/modedb.txt. |
| 2452 | 2452 | ||
| 2453 | vga= [BOOT,X86-32] Select a particular video mode | 2453 | vga= [BOOT,X86-32] Select a particular video mode |
| 2454 | See Documentation/x86/i386/boot.txt and | 2454 | See Documentation/x86/boot.txt and |
| 2455 | Documentation/svga.txt. | 2455 | Documentation/svga.txt. |
| 2456 | Use vga=ask for menu. | 2456 | Use vga=ask for menu. |
| 2457 | This is actually a boot loader parameter; the value is | 2457 | This is actually a boot loader parameter; the value is |
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 9c39095b33fc..bc2fbadff9f9 100644 --- a/arch/x86/Kconfig +++ b/arch/x86/Kconfig | |||
| @@ -1803,7 +1803,7 @@ config DMAR | |||
| 1803 | remapping devices. | 1803 | remapping devices. |
| 1804 | 1804 | ||
| 1805 | config DMAR_DEFAULT_ON | 1805 | config DMAR_DEFAULT_ON |
| 1806 | def_bool n | 1806 | def_bool y |
| 1807 | prompt "Enable DMA Remapping Devices by default" | 1807 | prompt "Enable DMA Remapping Devices by default" |
| 1808 | depends on DMAR | 1808 | depends on DMAR |
| 1809 | help | 1809 | 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/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/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/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/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 | } |
