Unified · Split
| @@ -136,7 +136,7 @@ quiet_cmd_db2ps = PS $@ · 135 unmodified lines | ||
| 136 | 136 | %.ps : %.xml |
| 137 | 137 | $(call cmd,db2ps) |
| 138 | 138 | |
| 139 | −quiet_cmd_db2pdf = PDF $@ | |
| 139 | +quiet_cmd_db2pdf = PDF $@ | |
| 140 | 140 | cmd_db2pdf = $(subst TYPE,pdf, $($(PDF_METHOD)template)) |
| 141 | 141 | %.pdf : %.xml |
| 142 | 142 | $(call cmd,db2pdf) |
| @@ -148,7 +148,7 @@ build_main_index = rm -rf $(main_idx) && \ · 5 unmodified lines | ||
| 148 | 148 | echo '<h2>Kernel Version: $(KERNELVERSION)</h2>' >> $(main_idx) && \ |
| 149 | 149 | cat $(HTML) >> $(main_idx) |
| 150 | 150 | |
| 151 | −quiet_cmd_db2html = HTML $@ | |
| 151 | +quiet_cmd_db2html = HTML $@ | |
| 152 | 152 | cmd_db2html = xmlto xhtml $(XMLTOFLAGS) -o $(patsubst %.html,%,$@) $< && \ |
| 153 | 153 | echo '<a HREF="$(patsubst %.html,%,$(notdir $@))/index.html"> \ |
| 154 | 154 | $(patsubst %.html,%,$(notdir $@))</a><p>' > $@ |
| @@ -24,7 +24,7 @@ · 23 unmodified lines | ||
| 24 | 24 | <surname>Cox</surname> |
| 25 | 25 | <affiliation> |
| 26 | 26 | <address> |
| 27 | − <email>alan@redhat.com</email> | |
| 27 | + <email>alan@lxorguk.ukuu.org.uk</email> | |
| 28 | 28 | </address> |
| 29 | 29 | </affiliation> |
| 30 | 30 | </author> |
| @@ -12,7 +12,7 @@ · 11 unmodified lines | ||
| 12 | 12 | <surname>Cox</surname> |
| 13 | 13 | <affiliation> |
| 14 | 14 | <address> |
| 15 | − <email>alan@redhat.com</email> | |
| 15 | + <email>alan@lxorguk.ukuu.org.uk</email> | |
| 16 | 16 | </address> |
| 17 | 17 | </affiliation> |
| 18 | 18 | </author> |
| @@ -12,7 +12,7 @@ · 11 unmodified lines | ||
| 12 | 12 | <surname>Cox</surname> |
| 13 | 13 | <affiliation> |
| 14 | 14 | <address> |
| 15 | − <email>alan@redhat.com</email> | |
| 15 | + <email>alan@lxorguk.ukuu.org.uk</email> | |
| 16 | 16 | </address> |
| 17 | 17 | </affiliation> |
| 18 | 18 | </author> |
| @@ -12,7 +12,7 @@ · 11 unmodified lines | ||
| 12 | 12 | <surname>Cox</surname> |
| 13 | 13 | <affiliation> |
| 14 | 14 | <address> |
| 15 | − <email>alan@redhat.com</email> | |
| 15 | + <email>alan@lxorguk.ukuu.org.uk</email> | |
| 16 | 16 | </address> |
| 17 | 17 | </affiliation> |
| 18 | 18 | </author> |
| @@ -17,7 +17,7 @@ companies. If you sign purchase orders or you have any clue about the · 16 unmodified lines | ||
| 17 | 17 | budget of your group, you're almost certainly not a kernel manager. |
| 18 | 18 | These suggestions may or may not apply to you. |
| 19 | 19 | |
| 20 | −First off, I'd suggest buying "Seven Habits of Highly Successful | |
| 20 | +First off, I'd suggest buying "Seven Habits of Highly Effective | |
| 21 | 21 | People", and NOT read it. Burn it, it's a great symbolic gesture. |
| 22 | 22 | |
| 23 | 23 | (*) This document does so not so much by answering the question, but by |
| @@ -0,0 +1 @@ | ||
| 1 | +getdelays | |
| @@ -0,0 +1 @@ | ||
| 1 | +cfag12864b-example | |
| @@ -0,0 +1 @@ | ||
| 1 | +ucon | |
| @@ -161,8 +161,12 @@ prototypes: · 160 unmodified lines | ||
| 161 | 161 | int (*set_page_dirty)(struct page *page); |
| 162 | 162 | int (*readpages)(struct file *filp, struct address_space *mapping, |
| 163 | 163 | struct list_head *pages, unsigned nr_pages); |
| 164 | − int (*prepare_write)(struct file *, struct page *, unsigned, unsigned); | |
| 165 | − int (*commit_write)(struct file *, struct page *, unsigned, unsigned); | |
| 164 | + int (*write_begin)(struct file *, struct address_space *mapping, | |
| 165 | + loff_t pos, unsigned len, unsigned flags, | |
| 166 | + struct page **pagep, void **fsdata); | |
| 167 | + int (*write_end)(struct file *, struct address_space *mapping, | |
| 168 | + loff_t pos, unsigned len, unsigned copied, | |
| 169 | + struct page *page, void *fsdata); | |
| 166 | 170 | sector_t (*bmap)(struct address_space *, sector_t); |
| 167 | 171 | int (*invalidatepage) (struct page *, unsigned long); |
| 168 | 172 | int (*releasepage) (struct page *, int); |
| @@ -180,8 +184,6 @@ sync_page: no maybe · 11 unmodified lines | ||
| 180 | 184 | writepages: no |
| 181 | 185 | set_page_dirty no no |
| 182 | 186 | readpages: no |
| 183 | −prepare_write: no yes yes | |
| 184 | −commit_write: no yes yes | |
| 185 | 187 | write_begin: no locks the page yes |
| 186 | 188 | write_end: no yes, unlocks yes |
| 187 | 189 | perform_write: no n/a yes |
| @@ -191,7 +193,7 @@ releasepage: no yes · 3 unmodified lines | ||
| 191 | 193 | direct_IO: no |
| 192 | 194 | launder_page: no yes |
| 193 | 195 | |
| 194 | − ->prepare_write(), ->commit_write(), ->sync_page() and ->readpage() | |
| 196 | + ->write_begin(), ->write_end(), ->sync_page() and ->readpage() | |
| 195 | 197 | may be called from the request handler (/dev/loop). |
| 196 | 198 | |
| 197 | 199 | ->readpage() unlocks the page, either synchronously or via I/O |
| @@ -492,7 +492,7 @@ written-back to storage typically in whole pages, however the · 491 unmodified lines | ||
| 492 | 492 | address_space has finer control of write sizes. |
| 493 | 493 | |
| 494 | 494 | The read process essentially only requires 'readpage'. The write |
| 495 | −process is more complicated and uses prepare_write/commit_write or | |
| 495 | +process is more complicated and uses write_begin/write_end or | |
| 496 | 496 | set_page_dirty to write data into the address_space, and writepage, |
| 497 | 497 | sync_page, and writepages to writeback data to storage. |
| 498 | 498 | |
| @@ -521,8 +521,6 @@ struct address_space_operations { · 22 unmodified lines | ||
| 521 | 521 | int (*set_page_dirty)(struct page *page); |
| 522 | 522 | int (*readpages)(struct file *filp, struct address_space *mapping, |
| 523 | 523 | struct list_head *pages, unsigned nr_pages); |
| 524 | − int (*prepare_write)(struct file *, struct page *, unsigned, unsigned); | |
| 525 | − int (*commit_write)(struct file *, struct page *, unsigned, unsigned); | |
| 526 | 524 | int (*write_begin)(struct file *, struct address_space *mapping, |
| 527 | 525 | loff_t pos, unsigned len, unsigned flags, |
| 528 | 526 | struct page **pagep, void **fsdata); |
| @@ -598,37 +596,7 @@ struct address_space_operations { · 69 unmodified lines | ||
| 598 | 596 | readpages is only used for read-ahead, so read errors are |
| 599 | 597 | ignored. If anything goes wrong, feel free to give up. |
| 600 | 598 | |
| 601 | − prepare_write: called by the generic write path in VM to set up a write | |
| 602 | − request for a page. This indicates to the address space that | |
| 603 | − the given range of bytes is about to be written. The | |
| 604 | − address_space should check that the write will be able to | |
| 605 | − complete, by allocating space if necessary and doing any other | |
| 606 | − internal housekeeping. If the write will update parts of | |
| 607 | − any basic-blocks on storage, then those blocks should be | |
| 608 | − pre-read (if they haven't been read already) so that the | |
| 609 | − updated blocks can be written out properly. | |
| 610 | − The page will be locked. | |
| 611 | − | |
| 612 | − Note: the page _must not_ be marked uptodate in this function | |
| 613 | − (or anywhere else) unless it actually is uptodate right now. As | |
| 614 | − soon as a page is marked uptodate, it is possible for a concurrent | |
| 615 | − read(2) to copy it to userspace. | |
| 616 | − | |
| 617 | − commit_write: If prepare_write succeeds, new data will be copied | |
| 618 | − into the page and then commit_write will be called. It will | |
| 619 | − typically update the size of the file (if appropriate) and | |
| 620 | − mark the inode as dirty, and do any other related housekeeping | |
| 621 | − operations. It should avoid returning an error if possible - | |
| 622 | − errors should have been handled by prepare_write. | |
| 623 | − | |
| 624 | − write_begin: This is intended as a replacement for prepare_write. The | |
| 625 | − key differences being that: | |
| 626 | − - it returns a locked page (in *pagep) rather than being | |
| 627 | − given a pre locked page; | |
| 628 | − - it must be able to cope with short writes (where the | |
| 629 | − length passed to write_begin is greater than the number | |
| 630 | − of bytes copied into the page). | |
| 631 | − | |
| 599 | + write_begin: | |
| 632 | 600 | Called by the generic buffered write code to ask the filesystem to |
| 633 | 601 | prepare to write len bytes at the given offset in the file. The |
| 634 | 602 | address_space should check that the write will be able to complete, |
| @@ -640,6 +608,9 @@ struct address_space_operations { · 5 unmodified lines | ||
| 640 | 608 | The filesystem must return the locked pagecache page for the specified |
| 641 | 609 | offset, in *pagep, for the caller to write into. |
| 642 | 610 | |
| 611 | + It must be able to cope with short writes (where the length passed to | |
| 612 | + write_begin is greater than the number of bytes copied into the page). | |
| 613 | + | |
| 643 | 614 | flags is a field for AOP_FLAG_xxx flags, described in |
| 644 | 615 | include/linux/fs.h. |
| 645 | 616 | |
| @@ -42,7 +42,7 @@ I suspect that this driver could be made to work for the following SiS · 41 unmodified lines | ||
| 42 | 42 | chipsets as well: 635, and 635T. If anyone owns a board with those chips |
| 43 | 43 | AND is willing to risk crashing & burning an otherwise well-behaved kernel |
| 44 | 44 | in the name of progress... please contact me at <mhoffman@lightlink.com> or |
| 45 | −via the project's mailing list: <i2c@lm-sensors.org>. Please send bug | |
| 45 | +via the linux-i2c mailing list: <linux-i2c@vger.kernel.org>. Please send bug | |
| 46 | 46 | reports and/or success stories as well. |
| 47 | 47 | |
| 48 | 48 | |
| @@ -0,0 +1 @@ | ||
| 1 | +aliasing-test | |
| @@ -5,7 +5,7 @@ I want to thank all who contributed to this project and especially to: · 4 unmodified lines | ||
| 5 | 5 | Thomas Bogendörfer (tsbogend@bigbug.franken.de) |
| 6 | 6 | Tester, lots of bugfixes and hints. |
| 7 | 7 | |
| 8 | −Alan Cox (alan@redhat.com) | |
| 8 | +Alan Cox (alan@lxorguk.ukuu.org.uk) | |
| 9 | 9 | For help getting into standard-kernel. |
| 10 | 10 | |
| 11 | 11 | Henner Eisen (eis@baty.hanse.de) |
| @@ -11,14 +11,14 @@ for non English (read: Japanese) speakers and is not intended as a · 10 unmodified lines | ||
| 11 | 11 | fork. So if you have any comments or updates for this file, please try |
| 12 | 12 | to update the original English file first. |
| 13 | 13 | |
| 14 | −Last Updated: 2008/08/21 | |
| 14 | +Last Updated: 2008/10/24 | |
| 15 | 15 | ================================== |
| 16 | 16 | これは、 |
| 17 | −linux-2.6.27/Documentation/HOWTO | |
| 17 | +linux-2.6.28/Documentation/HOWTO | |
| 18 | 18 | の和訳です。 |
| 19 | 19 | |
| 20 | 20 | 翻訳団体: JF プロジェクト < http://www.linux.or.jp/JF/ > |
| 21 | −翻訳日: 2008/8/5 | |
| 21 | +翻訳日: 2008/10/24 | |
| 22 | 22 | 翻訳者: Tsugikazu Shibata <tshibata at ab dot jp dot nec dot com> |
| 23 | 23 | 校正者: 松倉さん <nbh--mats at nifty dot com> |
| 24 | 24 | 小林 雅典さん (Masanori Kobayasi) <zap03216 at nifty dot ne dot jp> |
| @@ -110,8 +110,8 @@ Linux カーネルソースツリーは幅広い範囲のドキュメントを · 85 unmodified lines | ||
| 110 | 110 | 新しいドキュメントファイルも追加することを勧めます。 |
| 111 | 111 | カーネルの変更が、カーネルがユーザ空間に公開しているインターフェイスの |
| 112 | 112 | 変更を引き起こす場合、その変更を説明するマニュアルページのパッチや情報 |
| 113 | −をマニュアルページのメンテナ mtk.manpages@gmail.com に送ることを勧めま | |
| 114 | −す。 | |
| 113 | +をマニュアルページのメンテナ mtk.manpages@gmail.com に送り、CC を | |
| 114 | +linux-api@ver.kernel.org に送ることを勧めます。 | |
| 115 | 115 | |
| 116 | 116 | 以下はカーネルソースツリーに含まれている読んでおくべきファイルの一覧で |
| 117 | 117 | す- |
| @@ -149,7 +149,7 @@ Linux カーネルソースツリーは幅広い範囲のドキュメントを · 31 unmodified lines | ||
| 149 | 149 | この他にパッチを作る方法についてのよくできた記述は- |
| 150 | 150 | |
| 151 | 151 | "The Perfect Patch" |
| 152 | − http://www.zip.com.au/~akpm/linux/patches/stuff/tpp.txt | |
| 152 | + http://userweb.kernel.org/~akpm/stuff/tpp.txt | |
| 153 | 153 | "Linux kernel patch submission format" |
| 154 | 154 | http://linux.yyz.us/patch-format.html |
| 155 | 155 | |
| @@ -664,7 +664,7 @@ Linux カーネルコミュニティは、一度に大量のコードの塊を · 508 unmodified lines | ||
| 664 | 664 | これについて全てがどのようにあるべきかについての詳細は、以下のドキュメ |
| 665 | 665 | ントの ChangeLog セクションを見てください- |
| 666 | 666 | "The Perfect Patch" |
| 667 | − http://www.zip.com.au/~akpm/linux/patches/stuff/tpp.txt | |
| 667 | + http://userweb.kernel.org/~akpm/stuff/tpp.txt | |
| 668 | 668 | |
| 669 | 669 | これらのどれもが、時にはとても困難です。これらの慣例を完璧に実施するに |
| 670 | 670 | は数年かかるかもしれません。これは継続的な改善のプロセスであり、そのた |
| @@ -0,0 +1 @@ | ||
| 1 | +ifenslave | |
| @@ -60,6 +60,6 @@ Tobias Ringstrom <tori@unhappy.mine.nu> : Current Maintainer · 59 unmodified lines | ||
| 60 | 60 | Contributors: |
| 61 | 61 | |
| 62 | 62 | Marcelo Tosatti <marcelo@conectiva.com.br> |
| 63 | −Alan Cox <alan@redhat.com> | |
| 63 | +Alan Cox <alan@lxorguk.ukuu.org.uk> | |
| 64 | 64 | Jeff Garzik <jgarzik@pobox.com> |
| 65 | 65 | Vojtech Pavlik <vojtech@suse.cz> |
| @@ -0,0 +1 @@ | ||
| 1 | +crc32hash | |
| @@ -92,7 +92,7 @@ other HZ detail. Thus the CFS scheduler has no notion of "timeslices" in the · 91 unmodified lines | ||
| 92 | 92 | way the previous scheduler had, and has no heuristics whatsoever. There is |
| 93 | 93 | only one central tunable (you have to switch on CONFIG_SCHED_DEBUG): |
| 94 | 94 | |
| 95 | − /proc/sys/kernel/sched_granularity_ns | |
| 95 | + /proc/sys/kernel/sched_min_granularity_ns | |
| 96 | 96 | |
| 97 | 97 | which can be used to tune the scheduler from "desktop" (i.e., low latencies) to |
| 98 | 98 | "server" (i.e., good batching) workloads. It defaults to a setting suitable |
| @@ -128,7 +128,7 @@ Supported Cards/Chipsets · 127 unmodified lines | ||
| 128 | 128 | |
| 129 | 129 | People |
| 130 | 130 | ------------------------- |
| 131 | −Alan Cox <alan@redhat.com> | |
| 131 | +Alan Cox <alan@lxorguk.ukuu.org.uk> | |
| 132 | 132 | Christoph Hellwig <hch@infradead.org> (updates for new-style PCI probing and SCSI host registration, |
| 133 | 133 | small cleanups/fixes) |
| 134 | 134 | Matt Domsch <matt_domsch@dell.com> (revision ioctl, adapter messages) |
| @@ -0,0 +1,2 @@ | ||
| 1 | +spidev_fdx | |
| 2 | +spidev_test | |
| @@ -12,6 +12,7 @@ Rules on what kind of patches are accepted, and which ones are not, into the · 11 unmodified lines | ||
| 12 | 12 | marked CONFIG_BROKEN), an oops, a hang, data corruption, a real |
| 13 | 13 | security issue, or some "oh, that's not good" issue. In short, something |
| 14 | 14 | critical. |
| 15 | + - New device IDs and quirks are also accepted. | |
| 15 | 16 | - No "theoretical race condition" issues, unless an explanation of how the |
| 16 | 17 | race can be exploited is also provided. |
| 17 | 18 | - It cannot contain any "trivial" fixes in it (spelling changes, |
| @@ -363,11 +363,21 @@ tainted: · 362 unmodified lines | ||
| 363 | 363 | Non-zero if the kernel has been tainted. Numeric values, which |
| 364 | 364 | can be ORed together: |
| 365 | 365 | |
| 366 | − 1 - A module with a non-GPL license has been loaded, this | |
| 367 | − includes modules with no license. | |
| 368 | − Set by modutils >= 2.4.9 and module-init-tools. | |
| 369 | − 2 - A module was force loaded by insmod -f. | |
| 370 | − Set by modutils >= 2.4.9 and module-init-tools. | |
| 371 | − 4 - Unsafe SMP processors: SMP with CPUs not designed for SMP. | |
| 372 | − 64 - A module from drivers/staging was loaded. | |
| 366 | + 1 - A module with a non-GPL license has been loaded, this | |
| 367 | + includes modules with no license. | |
| 368 | + Set by modutils >= 2.4.9 and module-init-tools. | |
| 369 | + 2 - A module was force loaded by insmod -f. | |
| 370 | + Set by modutils >= 2.4.9 and module-init-tools. | |
| 371 | + 4 - Unsafe SMP processors: SMP with CPUs not designed for SMP. | |
| 372 | + 8 - A module was forcibly unloaded from the system by rmmod -f. | |
| 373 | + 16 - A hardware machine check error occurred on the system. | |
| 374 | + 32 - A bad page was discovered on the system. | |
| 375 | + 64 - The user has asked that the system be marked "tainted". This | |
| 376 | + could be because they are running software that directly modifies | |
| 377 | + the hardware, or for other reasons. | |
| 378 | + 128 - The system has died. | |
| 379 | + 256 - The ACPI DSDT has been overridden with one supplied by the user | |
| 380 | + instead of using the one provided by the hardware. | |
| 381 | + 512 - A kernel warning has occurred. | |
| 382 | +1024 - A module from drivers/staging was loaded. | |
| 373 | 383 | |
| @@ -0,0 +1 @@ | ||
| 1 | +v4lgrab | |
| @@ -3,7 +3,7 @@ Contributors to bttv: · 2 unmodified lines | ||
| 3 | 3 | Michael Chu <mmchu@pobox.com> |
| 4 | 4 | AverMedia fix and more flexible card recognition |
| 5 | 5 | |
| 6 | −Alan Cox <alan@redhat.com> | |
| 6 | +Alan Cox <alan@lxorguk.ukuu.org.uk> | |
| 7 | 7 | Video4Linux interface and 2.1.x kernel adaptation |
| 8 | 8 | |
| 9 | 9 | Chris Kleitsch |
| @@ -0,0 +1 @@ | ||
| 1 | +slabinfo | |
| @@ -0,0 +1,2 @@ | ||
| 1 | +watchdog-simple | |
| 2 | +watchdog-test | |
| @@ -347,7 +347,7 @@ S: Maintained · 346 unmodified lines | ||
| 347 | 347 | ALI1563 I2C DRIVER |
| 348 | 348 | P: Rudolf Marek |
| 349 | 349 | M: r.marek@assembler.cz |
| 350 | −L: i2c@lm-sensors.org | |
| 350 | +L: linux-i2c@vger.kernel.org | |
| 351 | 351 | S: Maintained |
| 352 | 352 | |
| 353 | 353 | ALPHA PORT |
| @@ -1749,7 +1749,7 @@ FREESCALE I2C CPM DRIVER · 1395 unmodified lines | ||
| 1749 | 1749 | P: Jochen Friedrich |
| 1750 | 1750 | M: jochen@scram.de |
| 1751 | 1751 | L: linuxppc-dev@ozlabs.org |
| 1752 | −L: i2c@lm-sensors.org | |
| 1752 | +L: linux-i2c@vger.kernel.org | |
| 1753 | 1753 | S: Maintained |
| 1754 | 1754 | |
| 1755 | 1755 | FREESCALE SOC FS_ENET DRIVER |
| @@ -2022,7 +2022,7 @@ S: Maintained · 266 unmodified lines | ||
| 2022 | 2022 | I2C/SMBUS STUB DRIVER |
| 2023 | 2023 | P: Mark M. Hoffman |
| 2024 | 2024 | M: mhoffman@lightlink.com |
| 2025 | −L: i2c@lm-sensors.org | |
| 2025 | +L: linux-i2c@vger.kernel.org | |
| 2026 | 2026 | S: Maintained |
| 2027 | 2027 | |
| 2028 | 2028 | I2C SUBSYSTEM |
| @@ -2030,14 +2030,14 @@ P: Jean Delvare (PC drivers, core) · 1 unmodified line | ||
| 2030 | 2030 | M: khali@linux-fr.org |
| 2031 | 2031 | P: Ben Dooks (embedded platforms) |
| 2032 | 2032 | M: ben-linux@fluff.org |
| 2033 | −L: i2c@lm-sensors.org | |
| 2033 | +L: linux-i2c@vger.kernel.org | |
| 2034 | 2034 | T: quilt http://khali.linux-fr.org/devel/linux-2.6/jdelvare-i2c/ |
| 2035 | 2035 | S: Maintained |
| 2036 | 2036 | |
| 2037 | 2037 | I2C-TINY-USB DRIVER |
| 2038 | 2038 | P: Till Harbaum |
| 2039 | 2039 | M: till@harbaum.org |
| 2040 | −L: i2c@lm-sensors.org | |
| 2040 | +L: linux-i2c@vger.kernel.org | |
| 2041 | 2041 | T: http://www.harbaum.org/till/i2c_tiny_usb |
| 2042 | 2042 | S: Maintained |
| 2043 | 2043 | |
| @@ -2701,6 +2701,16 @@ M: matthew@wil.cx · 657 unmodified lines | ||
| 2701 | 2701 | L: linux-scsi@vger.kernel.org |
| 2702 | 2702 | S: Maintained |
| 2703 | 2703 | |
| 2704 | +LTP (Linux Test Project) | |
| 2705 | +P: Subrata Modak | |
| 2706 | +M: subrata@linux.vnet.ibm.com | |
| 2707 | +P: Mike Frysinger | |
| 2708 | +M: vapier@gentoo.org | |
| 2709 | +L: ltp-list@lists.sourceforge.net (subscribers-only) | |
| 2710 | +W: http://ltp.sourceforge.net/ | |
| 2711 | +T: git kernel.org/pub/scm/linux/kernel/git/galak/ltp.git | |
| 2712 | +S: Maintained | |
| 2713 | + | |
| 2704 | 2714 | M32R ARCHITECTURE |
| 2705 | 2715 | P: Hirokazu Takata |
| 2706 | 2716 | M: takata@linux-m32r.org |
| @@ -3143,7 +3153,7 @@ S: Maintained · 436 unmodified lines | ||
| 3143 | 3153 | OPENCORES I2C BUS DRIVER |
| 3144 | 3154 | P: Peter Korsgaard |
| 3145 | 3155 | M: jacmet@sunsite.dk |
| 3146 | −L: i2c@lm-sensors.org | |
| 3156 | +L: linux-i2c@vger.kernel.org | |
| 3147 | 3157 | S: Maintained |
| 3148 | 3158 | |
| 3149 | 3159 | OPROFILE |
| @@ -3190,7 +3200,7 @@ S: Maintained · 40 unmodified lines | ||
| 3190 | 3200 | PA SEMI SMBUS DRIVER |
| 3191 | 3201 | P: Olof Johansson |
| 3192 | 3202 | M: olof@lixom.net |
| 3193 | −L: i2c@lm-sensors.org | |
| 3203 | +L: linux-i2c@vger.kernel.org | |
| 3194 | 3204 | S: Maintained |
| 3195 | 3205 | |
| 3196 | 3206 | PANASONIC LAPTOP ACPI EXTRAS DRIVER |
| @@ -3335,7 +3345,7 @@ S: Maintained · 138 unmodified lines | ||
| 3335 | 3345 | PNXxxxx I2C DRIVER |
| 3336 | 3346 | P: Vitaly Wool |
| 3337 | 3347 | M: vitalywool@gmail.com |
| 3338 | −L: i2c@lm-sensors.org | |
| 3348 | +L: linux-i2c@vger.kernel.org | |
| 3339 | 3349 | S: Maintained |
| 3340 | 3350 | |
| 3341 | 3351 | PPP PROTOCOL DRIVERS AND COMPRESSORS |
| @@ -3799,7 +3809,7 @@ S: Maintained · 457 unmodified lines | ||
| 3799 | 3809 | SIS 96X I2C/SMBUS DRIVER |
| 3800 | 3810 | P: Mark M. Hoffman |
| 3801 | 3811 | M: mhoffman@lightlink.com |
| 3802 | −L: i2c@lm-sensors.org | |
| 3812 | +L: linux-i2c@vger.kernel.org | |
| 3803 | 3813 | S: Maintained |
| 3804 | 3814 | |
| 3805 | 3815 | SIS FRAMEBUFFER DRIVER |
| @@ -4546,7 +4556,7 @@ S: Maintained · 740 unmodified lines | ||
| 4546 | 4556 | VIAPRO SMBUS DRIVER |
| 4547 | 4557 | P: Jean Delvare |
| 4548 | 4558 | M: khali@linux-fr.org |
| 4549 | −L: i2c@lm-sensors.org | |
| 4559 | +L: linux-i2c@vger.kernel.org | |
| 4550 | 4560 | S: Maintained |
| 4551 | 4561 | |
| 4552 | 4562 | VIA UNICHROME(PRO)/CHROME9 FRAMEBUFFER DRIVER |
| @@ -536,7 +536,7 @@ KBUILD_CFLAGS += -g · 535 unmodified lines | ||
| 536 | 536 | KBUILD_AFLAGS += -gdwarf-2 |
| 537 | 537 | endif |
| 538 | 538 | |
| 539 | −ifdef CONFIG_FTRACE | |
| 539 | +ifdef CONFIG_FUNCTION_TRACER | |
| 540 | 540 | KBUILD_CFLAGS += -pg |
| 541 | 541 | endif |
| 542 | 542 | |
| @@ -16,8 +16,7 @@ config ARM · 15 unmodified lines | ||
| 16 | 16 | select HAVE_ARCH_KGDB |
| 17 | 17 | select HAVE_KPROBES if (!XIP_KERNEL) |
| 18 | 18 | select HAVE_KRETPROBES if (HAVE_KPROBES) |
| 19 | − select HAVE_FTRACE if (!XIP_KERNEL) | |
| 20 | − select HAVE_DYNAMIC_FTRACE if (HAVE_FTRACE) | |
| 19 | + select HAVE_FUNCTION_TRACER if (!XIP_KERNEL) | |
| 21 | 20 | select HAVE_GENERIC_DMA_COHERENT |
| 22 | 21 | help |
| 23 | 22 | The ARM series is a line of low-power-consumption RISC chip designs |
| @@ -70,7 +70,7 @@ SEDFLAGS = s/TEXT_START/$(ZTEXTADDR)/;s/BSS_START/$(ZBSSADDR)/ · 69 unmodified lines | ||
| 70 | 70 | targets := vmlinux vmlinux.lds piggy.gz piggy.o font.o font.c \ |
| 71 | 71 | head.o misc.o $(OBJS) |
| 72 | 72 | |
| 73 | −ifeq ($(CONFIG_FTRACE),y) | |
| 73 | +ifeq ($(CONFIG_FUNCTION_TRACER),y) | |
| 74 | 74 | ORIG_CFLAGS := $(KBUILD_CFLAGS) |
| 75 | 75 | KBUILD_CFLAGS = $(subst -pg, , $(ORIG_CFLAGS)) |
| 76 | 76 | endif |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | #ifndef _ASM_ARM_FTRACE |
| 2 | 2 | #define _ASM_ARM_FTRACE |
| 3 | 3 | |
| 4 | −#ifdef CONFIG_FTRACE | |
| 4 | +#ifdef CONFIG_FUNCTION_TRACER | |
| 5 | 5 | #define MCOUNT_ADDR ((long)(mcount)) |
| 6 | 6 | #define MCOUNT_INSN_SIZE 4 /* sizeof mcount call */ |
| 7 | 7 | |
| @@ -183,6 +183,6 @@ EXPORT_SYMBOL(_find_next_bit_be); · 182 unmodified lines | ||
| 183 | 183 | |
| 184 | 184 | EXPORT_SYMBOL(copy_page); |
| 185 | 185 | |
| 186 | −#ifdef CONFIG_FTRACE | |
| 186 | +#ifdef CONFIG_FUNCTION_TRACER | |
| 187 | 187 | EXPORT_SYMBOL(mcount); |
| 188 | 188 | #endif |
| @@ -101,7 +101,7 @@ ENDPROC(ret_from_fork) · 100 unmodified lines | ||
| 101 | 101 | #undef CALL |
| 102 | 102 | #define CALL(x) .long x |
| 103 | 103 | |
| 104 | −#ifdef CONFIG_FTRACE | |
| 104 | +#ifdef CONFIG_FUNCTION_TRACER | |
| 105 | 105 | #ifdef CONFIG_DYNAMIC_FTRACE |
| 106 | 106 | ENTRY(mcount) |
| 107 | 107 | stmdb sp!, {r0-r3, lr} |
| @@ -149,7 +149,7 @@ trace: · 41 unmodified lines | ||
| 149 | 149 | ftrace_stub: |
| 150 | 150 | mov pc, lr |
| 151 | 151 | |
| 152 | −#endif /* CONFIG_FTRACE */ | |
| 152 | +#endif /* CONFIG_FUNCTION_TRACER */ | |
| 153 | 153 | |
| 154 | 154 | /*============================================================================= |
| 155 | 155 | * SWI handler |
| @@ -95,19 +95,6 @@ int ftrace_update_ftrace_func(ftrace_func_t func) · 94 unmodified lines | ||
| 95 | 95 | return ret; |
| 96 | 96 | } |
| 97 | 97 | |
| 98 | −int ftrace_mcount_set(unsigned long *data) | |
| 99 | −{ | |
| 100 | − unsigned long pc, old; | |
| 101 | − unsigned long *addr = data; | |
| 102 | − unsigned char *new; | |
| 103 | − | |
| 104 | − pc = (unsigned long)&mcount_call; | |
| 105 | − memcpy(&old, &mcount_call, MCOUNT_INSN_SIZE); | |
| 106 | − new = ftrace_call_replace(pc, *addr); | |
| 107 | − *addr = ftrace_modify_code(pc, (unsigned char *)&old, new); | |
| 108 | − return 0; | |
| 109 | −} | |
| 110 | − | |
| 111 | 98 | /* run from kstop_machine */ |
| 112 | 99 | int __init ftrace_dyn_arch_init(void *data) |
| 113 | 100 | { |
| @@ -11,6 +11,5 @@ extern int force_iommu, no_iommu; · 10 unmodified lines | ||
| 11 | 11 | extern int iommu_detected; |
| 12 | 12 | extern void iommu_dma_init(void); |
| 13 | 13 | extern void machvec_init(const char *name); |
| 14 | −extern int forbid_dac; | |
| 15 | 14 | |
| 16 | 15 | #endif |
| @@ -365,7 +365,8 @@ struct kvm_vcpu_arch { · 364 unmodified lines | ||
| 365 | 365 | long itc_offset; |
| 366 | 366 | unsigned long itc_check; |
| 367 | 367 | unsigned long timer_check; |
| 368 | − unsigned long timer_pending; | |
| 368 | + unsigned int timer_pending; | |
| 369 | + unsigned int timer_fired; | |
| 369 | 370 | |
| 370 | 371 | unsigned long vrr[8]; |
| 371 | 372 | unsigned long ibr[8]; |
| @@ -417,6 +418,9 @@ struct kvm_arch { · 45 unmodified lines | ||
| 417 | 418 | struct list_head assigned_dev_head; |
| 418 | 419 | struct dmar_domain *intel_iommu_domain; |
| 419 | 420 | struct hlist_head irq_ack_notifier_list; |
| 421 | + | |
| 422 | + unsigned long irq_sources_bitmap; | |
| 423 | + unsigned long irq_states[KVM_IOAPIC_NUM_PINS]; | |
| 420 | 424 | }; |
| 421 | 425 | |
| 422 | 426 | union cpuid3_t { |
| @@ -89,13 +89,6 @@ int iommu_dma_supported(struct device *dev, u64 mask) · 88 unmodified lines | ||
| 89 | 89 | { |
| 90 | 90 | struct dma_mapping_ops *ops = get_dma_ops(dev); |
| 91 | 91 | |
| 92 | −#ifdef CONFIG_PCI | |
| 93 | − if (mask > 0xffffffff && forbid_dac > 0) { | |
| 94 | − dev_info(dev, "Disallowing DAC for device\n"); | |
| 95 | − return 0; | |
| 96 | − } | |
| 97 | −#endif | |
| 98 | − | |
| 99 | 92 | if (ops->dma_supported_op) |
| 100 | 93 | return ops->dma_supported_op(dev, mask); |
| 101 | 94 | |
| @@ -29,13 +29,18 @@ define cmd_offsets · 28 unmodified lines | ||
| 29 | 29 | echo ""; \ |
| 30 | 30 | echo "#endif" ) > $@ |
| 31 | 31 | endef |
| 32 | + | |
| 32 | 33 | # We use internal rules to avoid the "is up to date" message from make |
| 33 | −arch/ia64/kvm/asm-offsets.s: arch/ia64/kvm/asm-offsets.c | |
| 34 | +arch/ia64/kvm/asm-offsets.s: arch/ia64/kvm/asm-offsets.c \ | |
| 35 | + $(wildcard $(srctree)/arch/ia64/include/asm/*.h)\ | |
| 36 | + $(wildcard $(srctree)/include/linux/*.h) | |
| 34 | 37 | $(call if_changed_dep,cc_s_c) |
| 35 | 38 | |
| 36 | 39 | $(obj)/$(offsets-file): arch/ia64/kvm/asm-offsets.s |
| 37 | 40 | $(call cmd,offsets) |
| 38 | 41 | |
| 42 | +FORCE : $(obj)/$(offsets-file) | |
| 43 | + | |
| 39 | 44 | # |
| 40 | 45 | # Makefile for Kernel-based Virtual Machine module |
| 41 | 46 | # |
| @@ -53,7 +58,6 @@ endif · 11 unmodified lines | ||
| 53 | 58 | kvm-objs := $(common-objs) kvm-ia64.o kvm_fw.o |
| 54 | 59 | obj-$(CONFIG_KVM) += kvm.o |
| 55 | 60 | |
| 56 | −FORCE : $(obj)/$(offsets-file) | |
| 57 | 61 | EXTRA_CFLAGS_vcpu.o += -mfixed-range=f2-f5,f12-f127 |
| 58 | 62 | kvm-intel-objs = vmm.o vmm_ivt.o trampoline.o vcpu.o optvfault.o mmio.o \ |
| 59 | 63 | vtlb.o process.o |
| @@ -385,6 +385,7 @@ static int handle_global_purge(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) · 384 unmodified lines | ||
| 385 | 385 | struct kvm *kvm = vcpu->kvm; |
| 386 | 386 | struct call_data call_data; |
| 387 | 387 | int i; |
| 388 | + | |
| 388 | 389 | call_data.ptc_g_data = p->u.ptc_g_data; |
| 389 | 390 | |
| 390 | 391 | for (i = 0; i < KVM_MAX_VCPUS; i++) { |
| @@ -418,33 +419,41 @@ int kvm_emulate_halt(struct kvm_vcpu *vcpu) · 27 unmodified lines | ||
| 418 | 419 | ktime_t kt; |
| 419 | 420 | long itc_diff; |
| 420 | 421 | unsigned long vcpu_now_itc; |
| 421 | − | |
| 422 | 422 | unsigned long expires; |
| 423 | 423 | struct hrtimer *p_ht = &vcpu->arch.hlt_timer; |
| 424 | 424 | unsigned long cyc_per_usec = local_cpu_data->cyc_per_usec; |
| 425 | 425 | struct vpd *vpd = to_host(vcpu->kvm, vcpu->arch.vpd); |
| 426 | 426 | |
| 427 | − vcpu_now_itc = ia64_getreg(_IA64_REG_AR_ITC) + vcpu->arch.itc_offset; | |
| 427 | + if (irqchip_in_kernel(vcpu->kvm)) { | |
| 428 | 428 | |
| 429 | − if (time_after(vcpu_now_itc, vpd->itm)) { | |
| 430 | − vcpu->arch.timer_check = 1; | |
| 431 | − return 1; | |
| 432 | − } | |
| 433 | − itc_diff = vpd->itm - vcpu_now_itc; | |
| 434 | − if (itc_diff < 0) | |
| 435 | − itc_diff = -itc_diff; | |
| 429 | + vcpu_now_itc = ia64_getreg(_IA64_REG_AR_ITC) + vcpu->arch.itc_offset; | |
| 436 | 430 | |
| 437 | − expires = div64_u64(itc_diff, cyc_per_usec); | |
| 438 | − kt = ktime_set(0, 1000 * expires); | |
| 439 | − vcpu->arch.ht_active = 1; | |
| 440 | − hrtimer_start(p_ht, kt, HRTIMER_MODE_ABS); | |
| 431 | + if (time_after(vcpu_now_itc, vpd->itm)) { | |
| 432 | + vcpu->arch.timer_check = 1; | |
| 433 | + return 1; | |
| 434 | + } | |
| 435 | + itc_diff = vpd->itm - vcpu_now_itc; | |
| 436 | + if (itc_diff < 0) | |
| 437 | + itc_diff = -itc_diff; | |
| 438 | + | |
| 439 | + expires = div64_u64(itc_diff, cyc_per_usec); | |
| 440 | + kt = ktime_set(0, 1000 * expires); | |
| 441 | + | |
| 442 | + down_read(&vcpu->kvm->slots_lock); | |
| 443 | + vcpu->arch.ht_active = 1; | |
| 444 | + hrtimer_start(p_ht, kt, HRTIMER_MODE_ABS); | |
| 441 | 445 | |
| 442 | − if (irqchip_in_kernel(vcpu->kvm)) { | |
| 443 | 446 | vcpu->arch.mp_state = KVM_MP_STATE_HALTED; |
| 444 | 447 | kvm_vcpu_block(vcpu); |
| 445 | 448 | hrtimer_cancel(p_ht); |
| 446 | 449 | vcpu->arch.ht_active = 0; |
| 447 | 450 | |
| 451 | + if (test_and_clear_bit(KVM_REQ_UNHALT, &vcpu->requests)) | |
| 452 | + if (vcpu->arch.mp_state == KVM_MP_STATE_HALTED) | |
| 453 | + vcpu->arch.mp_state = | |
| 454 | + KVM_MP_STATE_RUNNABLE; | |
| 455 | + up_read(&vcpu->kvm->slots_lock); | |
| 456 | + | |
| 448 | 457 | if (vcpu->arch.mp_state != KVM_MP_STATE_RUNNABLE) |
| 449 | 458 | return -EINTR; |
| 450 | 459 | return 1; |
| @@ -484,10 +493,6 @@ static int (*kvm_vti_exit_handlers[])(struct kvm_vcpu *vcpu, · 33 unmodified lines | ||
| 484 | 493 | static const int kvm_vti_max_exit_handlers = |
| 485 | 494 | sizeof(kvm_vti_exit_handlers)/sizeof(*kvm_vti_exit_handlers); |
| 486 | 495 | |
| 487 | −static void kvm_prepare_guest_switch(struct kvm_vcpu *vcpu) | |
| 488 | −{ | |
| 489 | −} | |
| 490 | − | |
| 491 | 496 | static uint32_t kvm_get_exit_reason(struct kvm_vcpu *vcpu) |
| 492 | 497 | { |
| 493 | 498 | struct exit_ctl_data *p_exit_data; |
| @@ -600,8 +605,6 @@ static int __vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) · 106 unmodified lines | ||
| 600 | 605 | |
| 601 | 606 | again: |
| 602 | 607 | preempt_disable(); |
| 603 | − | |
| 604 | − kvm_prepare_guest_switch(vcpu); | |
| 605 | 608 | local_irq_disable(); |
| 606 | 609 | |
| 607 | 610 | if (signal_pending(current)) { |
| @@ -614,7 +617,7 @@ again: · 6 unmodified lines | ||
| 614 | 617 | |
| 615 | 618 | vcpu->guest_mode = 1; |
| 616 | 619 | kvm_guest_enter(); |
| 617 | − | |
| 620 | + down_read(&vcpu->kvm->slots_lock); | |
| 618 | 621 | r = vti_vcpu_run(vcpu, kvm_run); |
| 619 | 622 | if (r < 0) { |
| 620 | 623 | local_irq_enable(); |
| @@ -634,9 +637,8 @@ again: · 13 unmodified lines | ||
| 634 | 637 | * But we need to prevent reordering, hence this barrier(): |
| 635 | 638 | */ |
| 636 | 639 | barrier(); |
| 637 | − | |
| 638 | 640 | kvm_guest_exit(); |
| 639 | − | |
| 641 | + up_read(&vcpu->kvm->slots_lock); | |
| 640 | 642 | preempt_enable(); |
| 641 | 643 | |
| 642 | 644 | r = kvm_handle_exit(kvm_run, vcpu); |
| @@ -673,6 +675,7 @@ int kvm_arch_vcpu_ioctl_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) · 30 unmodified lines | ||
| 673 | 675 | |
| 674 | 676 | if (unlikely(vcpu->arch.mp_state == KVM_MP_STATE_UNINITIALIZED)) { |
| 675 | 677 | kvm_vcpu_block(vcpu); |
| 678 | + clear_bit(KVM_REQ_UNHALT, &vcpu->requests); | |
| 676 | 679 | vcpu_put(vcpu); |
| 677 | 680 | return -EAGAIN; |
| 678 | 681 | } |
| @@ -778,6 +781,9 @@ static void kvm_init_vm(struct kvm *kvm) · 99 unmodified lines | ||
| 778 | 781 | kvm_build_io_pmt(kvm); |
| 779 | 782 | |
| 780 | 783 | INIT_LIST_HEAD(&kvm->arch.assigned_dev_head); |
| 784 | + | |
| 785 | + /* Reserve bit 0 of irq_sources_bitmap for userspace irq source */ | |
| 786 | + set_bit(KVM_USERSPACE_IRQ_SOURCE_ID, &kvm->arch.irq_sources_bitmap); | |
| 781 | 787 | } |
| 782 | 788 | |
| 783 | 789 | struct kvm *kvm_arch_create_vm(void) |
| @@ -941,9 +947,8 @@ long kvm_arch_vm_ioctl(struct file *filp, · 157 unmodified lines | ||
| 941 | 947 | goto out; |
| 942 | 948 | if (irqchip_in_kernel(kvm)) { |
| 943 | 949 | mutex_lock(&kvm->lock); |
| 944 | − kvm_ioapic_set_irq(kvm->arch.vioapic, | |
| 945 | − irq_event.irq, | |
| 946 | − irq_event.level); | |
| 950 | + kvm_set_irq(kvm, KVM_USERSPACE_IRQ_SOURCE_ID, | |
| 951 | + irq_event.irq, irq_event.level); | |
| 947 | 952 | mutex_unlock(&kvm->lock); |
| 948 | 953 | r = 0; |
| 949 | 954 | } |
| @@ -1123,15 +1128,16 @@ static enum hrtimer_restart hlt_timer_fn(struct hrtimer *data) · 173 unmodified lines | ||
| 1123 | 1128 | wait_queue_head_t *q; |
| 1124 | 1129 | |
| 1125 | 1130 | vcpu = container_of(data, struct kvm_vcpu, arch.hlt_timer); |
| 1131 | + q = &vcpu->wq; | |
| 1132 | + | |
| 1126 | 1133 | if (vcpu->arch.mp_state != KVM_MP_STATE_HALTED) |
| 1127 | 1134 | goto out; |
| 1128 | 1135 | |
| 1129 | − q = &vcpu->wq; | |
| 1130 | − if (waitqueue_active(q)) { | |
| 1131 | − vcpu->arch.mp_state = KVM_MP_STATE_RUNNABLE; | |
| 1136 | + if (waitqueue_active(q)) | |
| 1132 | 1137 | wake_up_interruptible(q); |
| 1133 | − } | |
| 1138 | + | |
| 1134 | 1139 | out: |
| 1140 | + vcpu->arch.timer_fired = 1; | |
| 1135 | 1141 | vcpu->arch.timer_check = 1; |
| 1136 | 1142 | return HRTIMER_NORESTART; |
| 1137 | 1143 | } |
| @@ -1700,12 +1706,14 @@ static void vcpu_kick_intr(void *info) · 562 unmodified lines | ||
| 1700 | 1706 | void kvm_vcpu_kick(struct kvm_vcpu *vcpu) |
| 1701 | 1707 | { |
| 1702 | 1708 | int ipi_pcpu = vcpu->cpu; |
| 1709 | + int cpu = get_cpu(); | |
| 1703 | 1710 | |
| 1704 | 1711 | if (waitqueue_active(&vcpu->wq)) |
| 1705 | 1712 | wake_up_interruptible(&vcpu->wq); |
| 1706 | 1713 | |
| 1707 | − if (vcpu->guest_mode) | |
| 1714 | + if (vcpu->guest_mode && cpu != ipi_pcpu) | |
| 1708 | 1715 | smp_call_function_single(ipi_pcpu, vcpu_kick_intr, vcpu, 0); |
| 1716 | + put_cpu(); | |
| 1709 | 1717 | } |
| 1710 | 1718 | |
| 1711 | 1719 | int kvm_apic_set_irq(struct kvm_vcpu *vcpu, u8 vec, u8 trig) |
| @@ -1715,13 +1723,7 @@ int kvm_apic_set_irq(struct kvm_vcpu *vcpu, u8 vec, u8 trig) · 3 unmodified lines | ||
| 1715 | 1723 | |
| 1716 | 1724 | if (!test_and_set_bit(vec, &vpd->irr[0])) { |
| 1717 | 1725 | vcpu->arch.irq_new_pending = 1; |
| 1718 | − if (vcpu->arch.mp_state == KVM_MP_STATE_RUNNABLE) | |
| 1719 | − kvm_vcpu_kick(vcpu); | |
| 1720 | − else if (vcpu->arch.mp_state == KVM_MP_STATE_HALTED) { | |
| 1721 | − vcpu->arch.mp_state = KVM_MP_STATE_RUNNABLE; | |
| 1722 | − if (waitqueue_active(&vcpu->wq)) | |
| 1723 | − wake_up_interruptible(&vcpu->wq); | |
| 1724 | − } | |
| 1726 | + kvm_vcpu_kick(vcpu); | |
| 1725 | 1727 | return 1; |
| 1726 | 1728 | } |
| 1727 | 1729 | return 0; |
| @@ -1791,7 +1793,7 @@ int kvm_cpu_has_interrupt(struct kvm_vcpu *vcpu) · 63 unmodified lines | ||
| 1791 | 1793 | |
| 1792 | 1794 | int kvm_cpu_has_pending_timer(struct kvm_vcpu *vcpu) |
| 1793 | 1795 | { |
| 1794 | − return 0; | |
| 1796 | + return vcpu->arch.timer_fired; | |
| 1795 | 1797 | } |
| 1796 | 1798 | |
| 1797 | 1799 | gfn_t unalias_gfn(struct kvm *kvm, gfn_t gfn) |
| @@ -286,6 +286,12 @@ static u64 kvm_get_pal_call_index(struct kvm_vcpu *vcpu) · 285 unmodified lines | ||
| 286 | 286 | return index; |
| 287 | 287 | } |
| 288 | 288 | |
| 289 | +static void prepare_for_halt(struct kvm_vcpu *vcpu) | |
| 290 | +{ | |
| 291 | + vcpu->arch.timer_pending = 1; | |
| 292 | + vcpu->arch.timer_fired = 0; | |
| 293 | +} | |
| 294 | + | |
| 289 | 295 | int kvm_pal_emul(struct kvm_vcpu *vcpu, struct kvm_run *run) |
| 290 | 296 | { |
| 291 | 297 | |
| @@ -304,11 +310,10 @@ int kvm_pal_emul(struct kvm_vcpu *vcpu, struct kvm_run *run) · 12 unmodified lines | ||
| 304 | 310 | break; |
| 305 | 311 | case PAL_HALT_LIGHT: |
| 306 | 312 | { |
| 307 | − vcpu->arch.timer_pending = 1; | |
| 308 | 313 | INIT_PAL_STATUS_SUCCESS(result); |
| 314 | + prepare_for_halt(vcpu); | |
| 309 | 315 | if (kvm_highest_pending_irq(vcpu) == -1) |
| 310 | 316 | ret = kvm_emulate_halt(vcpu); |
| 311 | − | |
| 312 | 317 | } |
| 313 | 318 | break; |
| 314 | 319 | |
| @@ -713,7 +713,7 @@ void leave_hypervisor_tail(void) · 712 unmodified lines | ||
| 713 | 713 | if (!(VCPU(v, itv) & (1 << 16))) { |
| 714 | 714 | vcpu_pend_interrupt(v, VCPU(v, itv) |
| 715 | 715 | & 0xff); |
| 716 | − VMX(v, itc_check) = 0; | |
| 716 | + VMX(v, itc_check) = 0; | |
| 717 | 717 | } else { |
| 718 | 718 | v->arch.timer_pending = 1; |
| 719 | 719 | } |
| @@ -238,21 +238,8 @@ config MIPS_SIM · 237 unmodified lines | ||
| 238 | 238 | This option enables support for MIPS Technologies MIPSsim software |
| 239 | 239 | emulator. |
| 240 | 240 | |
| 241 | −config MARKEINS | |
| 242 | − bool "NEC EMMA2RH Mark-eins" | |
| 243 | − select CEVT_R4K | |
| 244 | − select CSRC_R4K | |
| 245 | − select DMA_NONCOHERENT | |
| 246 | − select HW_HAS_PCI | |
| 247 | − select IRQ_CPU | |
| 248 | − select SWAP_IO_SPACE | |
| 249 | − select SYS_SUPPORTS_32BIT_KERNEL | |
| 250 | − select SYS_SUPPORTS_BIG_ENDIAN | |
| 251 | − select SYS_SUPPORTS_LITTLE_ENDIAN | |
| 252 | − select SYS_HAS_CPU_R5000 | |
| 253 | − help | |
| 254 | − This enables support for the R5432-based NEC Mark-eins | |
| 255 | − boards with R5500 CPU. | |
| 241 | +config MACH_EMMA | |
| 242 | + bool "NEC EMMA series based machines" | |
| 256 | 243 | |
| 257 | 244 | config MACH_VR41XX |
| 258 | 245 | bool "NEC VR4100 series based machines" |
| @@ -261,6 +248,19 @@ config MACH_VR41XX · 2 unmodified lines | ||
| 261 | 248 | select SYS_HAS_CPU_VR41XX |
| 262 | 249 | select GENERIC_HARDIRQS_NO__DO_IRQ |
| 263 | 250 | |
| 251 | +config NXP_STB220 | |
| 252 | + bool "NXP STB220 board" | |
| 253 | + select SOC_PNX833X | |
| 254 | + help | |
| 255 | + Support for NXP Semiconductors STB220 Development Board. | |
| 256 | + | |
| 257 | +config NXP_STB225 | |
| 258 | + bool "NXP 225 board" | |
| 259 | + select SOC_PNX833X | |
| 260 | + select SOC_PNX8335 | |
| 261 | + help | |
| 262 | + Support for NXP Semiconductors STB225 Development Board. | |
| 263 | + | |
| 264 | 264 | config PNX8550_JBS |
| 265 | 265 | bool "NXP PNX8550 based JBS board" |
| 266 | 266 | select PNX8550 |
| @@ -601,6 +601,7 @@ endchoice · 334 unmodified lines | ||
| 601 | 601 | |
| 602 | 602 | source "arch/mips/alchemy/Kconfig" |
| 603 | 603 | source "arch/mips/basler/excite/Kconfig" |
| 604 | +source "arch/mips/emma/Kconfig" | |
| 604 | 605 | source "arch/mips/jazz/Kconfig" |
| 605 | 606 | source "arch/mips/lasat/Kconfig" |
| 606 | 607 | source "arch/mips/pmc-sierra/Kconfig" |
| @@ -849,6 +850,24 @@ config MIPS_RM9122 · 242 unmodified lines | ||
| 849 | 850 | bool |
| 850 | 851 | select SERIAL_RM9000 |
| 851 | 852 | |
| 853 | +config SOC_PNX833X | |
| 854 | + bool | |
| 855 | + select CEVT_R4K | |
| 856 | + select CSRC_R4K | |
| 857 | + select IRQ_CPU | |
| 858 | + select DMA_NONCOHERENT | |
| 859 | + select SYS_HAS_CPU_MIPS32_R2 | |
| 860 | + select SYS_SUPPORTS_32BIT_KERNEL | |
| 861 | + select SYS_SUPPORTS_LITTLE_ENDIAN | |
| 862 | + select SYS_SUPPORTS_BIG_ENDIAN | |
| 863 | + select GENERIC_HARDIRQS_NO__DO_IRQ | |
| 864 | + select GENERIC_GPIO | |
| 865 | + select CPU_MIPSR2_IRQ_VI | |
| 866 | + | |
| 867 | +config SOC_PNX8335 | |
| 868 | + bool | |
| 869 | + select SOC_PNX833X | |
| 870 | + | |
| 852 | 871 | config PNX8550 |
| 853 | 872 | bool |
| 854 | 873 | select SOC_PNX8550 |
| @@ -1092,6 +1111,16 @@ config CPU_R5432 · 237 unmodified lines | ||
| 1092 | 1111 | select CPU_SUPPORTS_32BIT_KERNEL |
| 1093 | 1112 | select CPU_SUPPORTS_64BIT_KERNEL |
| 1094 | 1113 | |
| 1114 | +config CPU_R5500 | |
| 1115 | + bool "R5500" | |
| 1116 | + depends on SYS_HAS_CPU_R5500 | |
| 1117 | + select CPU_HAS_LLSC | |
| 1118 | + select CPU_SUPPORTS_32BIT_KERNEL | |
| 1119 | + select CPU_SUPPORTS_64BIT_KERNEL | |
| 1120 | + help | |
| 1121 | + NEC VR5500 and VR5500A series processors implement 64-bit MIPS IV | |
| 1122 | + instruction set. | |
| 1123 | + | |
| 1095 | 1124 | config CPU_R6000 |
| 1096 | 1125 | bool "R6000" |
| 1097 | 1126 | depends on EXPERIMENTAL |
| @@ -1202,6 +1231,9 @@ config SYS_HAS_CPU_R5000 · 104 unmodified lines | ||
| 1202 | 1231 | config SYS_HAS_CPU_R5432 |
| 1203 | 1232 | bool |
| 1204 | 1233 | |
| 1234 | +config SYS_HAS_CPU_R5500 | |
| 1235 | + bool | |
| 1236 | + | |
| 1205 | 1237 | config SYS_HAS_CPU_R6000 |
| 1206 | 1238 | bool |
| 1207 | 1239 | |
| @@ -131,6 +131,8 @@ cflags-$(CONFIG_CPU_MIPS64_R2) += $(call cc-option,-march=mips64r2,-mips64r2 -U_ · 130 unmodified lines | ||
| 131 | 131 | cflags-$(CONFIG_CPU_R5000) += -march=r5000 -Wa,--trap |
| 132 | 132 | cflags-$(CONFIG_CPU_R5432) += $(call cc-option,-march=r5400,-march=r5000) \ |
| 133 | 133 | -Wa,--trap |
| 134 | +cflags-$(CONFIG_CPU_R5500) += $(call cc-option,-march=r5500,-march=r5000) \ | |
| 135 | + -Wa,--trap | |
| 134 | 136 | cflags-$(CONFIG_CPU_NEVADA) += $(call cc-option,-march=rm5200,-march=r5000) \ |
| 135 | 137 | -Wa,--trap |
| 136 | 138 | cflags-$(CONFIG_CPU_RM7000) += $(call cc-option,-march=rm7000,-march=r5000) \ |
| @@ -381,6 +383,14 @@ load-$(CONFIG_CASIO_E55) += 0xffffffff80004000 · 244 unmodified lines | ||
| 381 | 383 | # |
| 382 | 384 | load-$(CONFIG_TANBAC_TB022X) += 0xffffffff80000000 |
| 383 | 385 | |
| 386 | +# NXP STB225 | |
| 387 | +core-$(CONFIG_SOC_PNX833X) += arch/mips/nxp/pnx833x/common/ | |
| 388 | +cflags-$(CONFIG_SOC_PNX833X) += -Iarch/mips/include/asm/mach-pnx833x | |
| 389 | +libs-$(CONFIG_NXP_STB220) += arch/mips/nxp/pnx833x/stb22x/ | |
| 390 | +load-$(CONFIG_NXP_STB220) += 0xffffffff80001000 | |
| 391 | +libs-$(CONFIG_NXP_STB225) += arch/mips/nxp/pnx833x/stb22x/ | |
| 392 | +load-$(CONFIG_NXP_STB225) += 0xffffffff80001000 | |
| 393 | + | |
| 384 | 394 | # |
| 385 | 395 | # Common NXP PNX8550 |
| 386 | 396 | # |
| @@ -399,14 +409,17 @@ load-$(CONFIG_PNX8550_JBS) += 0xffffffff80060000 · 12 unmodified lines | ||
| 399 | 409 | libs-$(CONFIG_PNX8550_STB810) += arch/mips/nxp/pnx8550/stb810/ |
| 400 | 410 | load-$(CONFIG_PNX8550_STB810) += 0xffffffff80060000 |
| 401 | 411 | |
| 402 | −# NEC EMMA2RH boards | |
| 403 | 412 | # |
| 404 | −core-$(CONFIG_EMMA2RH) += arch/mips/emma2rh/common/ | |
| 405 | −cflags-$(CONFIG_EMMA2RH) += -I$(srctree)/arch/mips/include/asm/mach-emma2rh | |
| 413 | +# Common NEC EMMAXXX | |
| 414 | +# | |
| 415 | +core-$(CONFIG_SOC_EMMA) += arch/mips/emma/common/ | |
| 416 | +cflags-$(CONFIG_SOC_EMMA2RH) += -I$(srctree)/arch/mips/include/asm/mach-emma2rh | |
| 406 | 417 | |
| 418 | +# | |
| 407 | 419 | # NEC EMMA2RH Mark-eins |
| 408 | −core-$(CONFIG_MARKEINS) += arch/mips/emma2rh/markeins/ | |
| 409 | −load-$(CONFIG_MARKEINS) += 0xffffffff88100000 | |
| 420 | +# | |
| 421 | +core-$(CONFIG_NEC_MARKEINS) += arch/mips/emma/markeins/ | |
| 422 | +load-$(CONFIG_NEC_MARKEINS) += 0xffffffff88100000 | |
| 410 | 423 | |
| 411 | 424 | # |
| 412 | 425 | # SGI IP22 (Indy/Indigo2) |
| @@ -17,6 +17,8 @@ · 16 unmodified lines | ||
| 17 | 17 | #include <linux/init.h> |
| 18 | 18 | |
| 19 | 19 | #include <asm/mach-au1x00/au1xxx.h> |
| 20 | +#include <asm/mach-au1x00/au1xxx_dbdma.h> | |
| 21 | +#include <asm/mach-au1x00/au1100_mmc.h> | |
| 20 | 22 | |
| 21 | 23 | #define PORT(_base, _irq) \ |
| 22 | 24 | { \ |
| @@ -163,24 +165,6 @@ static struct resource au1xxx_usb_gdt_resources[] = { · 140 unmodified lines | ||
| 163 | 165 | }, |
| 164 | 166 | }; |
| 165 | 167 | |
| 166 | −static struct resource au1xxx_mmc_resources[] = { | |
| 167 | − [0] = { | |
| 168 | − .start = SD0_PHYS_ADDR, | |
| 169 | − .end = SD0_PHYS_ADDR + 0x7ffff, | |
| 170 | − .flags = IORESOURCE_MEM, | |
| 171 | − }, | |
| 172 | − [1] = { | |
| 173 | − .start = SD1_PHYS_ADDR, | |
| 174 | − .end = SD1_PHYS_ADDR + 0x7ffff, | |
| 175 | − .flags = IORESOURCE_MEM, | |
| 176 | − }, | |
| 177 | − [2] = { | |
| 178 | − .start = AU1200_SD_INT, | |
| 179 | − .end = AU1200_SD_INT, | |
| 180 | − .flags = IORESOURCE_IRQ, | |
| 181 | − } | |
| 182 | −}; | |
| 183 | − | |
| 184 | 168 | static u64 udc_dmamask = DMA_32BIT_MASK; |
| 185 | 169 | |
| 186 | 170 | static struct platform_device au1xxx_usb_gdt_device = { |
| @@ -249,16 +233,79 @@ static struct platform_device au1200_lcd_device = { · 62 unmodified lines | ||
| 249 | 233 | |
| 250 | 234 | static u64 au1xxx_mmc_dmamask = DMA_32BIT_MASK; |
| 251 | 235 | |
| 252 | −static struct platform_device au1xxx_mmc_device = { | |
| 236 | +extern struct au1xmmc_platform_data au1xmmc_platdata[2]; | |
| 237 | + | |
| 238 | +static struct resource au1200_mmc0_resources[] = { | |
| 239 | + [0] = { | |
| 240 | + .start = SD0_PHYS_ADDR, | |
| 241 | + .end = SD0_PHYS_ADDR + 0x7ffff, | |
| 242 | + .flags = IORESOURCE_MEM, | |
| 243 | + }, | |
| 244 | + [1] = { | |
| 245 | + .start = AU1200_SD_INT, | |
| 246 | + .end = AU1200_SD_INT, | |
| 247 | + .flags = IORESOURCE_IRQ, | |
| 248 | + }, | |
| 249 | + [2] = { | |
| 250 | + .start = DSCR_CMD0_SDMS_TX0, | |
| 251 | + .end = DSCR_CMD0_SDMS_TX0, | |
| 252 | + .flags = IORESOURCE_DMA, | |
| 253 | + }, | |
| 254 | + [3] = { | |
| 255 | + .start = DSCR_CMD0_SDMS_RX0, | |
| 256 | + .end = DSCR_CMD0_SDMS_RX0, | |
| 257 | + .flags = IORESOURCE_DMA, | |
| 258 | + } | |
| 259 | +}; | |
| 260 | + | |
| 261 | +static struct platform_device au1200_mmc0_device = { | |
| 253 | 262 | .name = "au1xxx-mmc", |
| 254 | 263 | .id = 0, |
| 255 | 264 | .dev = { |
| 256 | − .dma_mask = &au1xxx_mmc_dmamask, | |
| 257 | − .coherent_dma_mask = DMA_32BIT_MASK, | |
| 265 | + .dma_mask = &au1xxx_mmc_dmamask, | |
| 266 | + .coherent_dma_mask = DMA_32BIT_MASK, | |
| 267 | + .platform_data = &au1xmmc_platdata[0], | |
| 258 | 268 | }, |
| 259 | − .num_resources = ARRAY_SIZE(au1xxx_mmc_resources), | |
| 260 | − .resource = au1xxx_mmc_resources, | |
| 269 | + .num_resources = ARRAY_SIZE(au1200_mmc0_resources), | |
| 270 | + .resource = au1200_mmc0_resources, | |
| 261 | 271 | }; |
| 272 | + | |
| 273 | +#ifndef CONFIG_MIPS_DB1200 | |
| 274 | +static struct resource au1200_mmc1_resources[] = { | |
| 275 | + [0] = { | |
| 276 | + .start = SD1_PHYS_ADDR, | |
| 277 | + .end = SD1_PHYS_ADDR + 0x7ffff, | |
| 278 | + .flags = IORESOURCE_MEM, | |
| 279 | + }, | |
| 280 | + [1] = { | |
| 281 | + .start = AU1200_SD_INT, | |
| 282 | + .end = AU1200_SD_INT, | |
| 283 | + .flags = IORESOURCE_IRQ, | |
| 284 | + }, | |
| 285 | + [2] = { | |
| 286 | + .start = DSCR_CMD0_SDMS_TX1, | |
| 287 | + .end = DSCR_CMD0_SDMS_TX1, | |
| 288 | + .flags = IORESOURCE_DMA, | |
| 289 | + }, | |
| 290 | + [3] = { | |
| 291 | + .start = DSCR_CMD0_SDMS_RX1, | |
| 292 | + .end = DSCR_CMD0_SDMS_RX1, | |
| 293 | + .flags = IORESOURCE_DMA, | |
| 294 | + } | |
| 295 | +}; | |
| 296 | + | |
| 297 | +static struct platform_device au1200_mmc1_device = { | |
| 298 | + .name = "au1xxx-mmc", | |
| 299 | + .id = 1, | |
| 300 | + .dev = { | |
| 301 | + .dma_mask = &au1xxx_mmc_dmamask, | |
| 302 | + .coherent_dma_mask = DMA_32BIT_MASK, | |
| 303 | + .platform_data = &au1xmmc_platdata[1], | |
| 304 | + }, | |
| 305 | + .num_resources = ARRAY_SIZE(au1200_mmc1_resources), | |
| 306 | + .resource = au1200_mmc1_resources, | |
| 307 | +}; | |
| 308 | +#endif /* #ifndef CONFIG_MIPS_DB1200 */ | |
| 262 | 309 | #endif /* #ifdef CONFIG_SOC_AU1200 */ |
| 263 | 310 | |
| 264 | 311 | static struct platform_device au1x00_pcmcia_device = { |
| @@ -296,7 +343,10 @@ static struct platform_device *au1xxx_platform_devices[] __initdata = { · 31 unmodified lines | ||
| 296 | 343 | &au1xxx_usb_gdt_device, |
| 297 | 344 | &au1xxx_usb_otg_device, |
| 298 | 345 | &au1200_lcd_device, |
| 299 | − &au1xxx_mmc_device, | |
| 346 | + &au1200_mmc0_device, | |
| 347 | +#ifndef CONFIG_MIPS_DB1200 | |
| 348 | + &au1200_mmc1_device, | |
| 349 | +#endif | |
| 300 | 350 | #endif |
| 301 | 351 | #ifdef SMBUS_PSC_BASE |
| 302 | 352 | &pbdb_smbus_device, |
| @@ -20,9 +20,90 @@ · 19 unmodified lines | ||
| 20 | 20 | |
| 21 | 21 | #include <linux/dma-mapping.h> |
| 22 | 22 | #include <linux/init.h> |
| 23 | +#include <linux/leds.h> | |
| 23 | 24 | #include <linux/platform_device.h> |
| 24 | 25 | |
| 25 | 26 | #include <asm/mach-au1x00/au1xxx.h> |
| 27 | +#include <asm/mach-au1x00/au1100_mmc.h> | |
| 28 | + | |
| 29 | +static int mmc_activity; | |
| 30 | + | |
| 31 | +static void pb1200mmc0_set_power(void *mmc_host, int state) | |
| 32 | +{ | |
| 33 | + if (state) | |
| 34 | + bcsr->board |= BCSR_BOARD_SD0PWR; | |
| 35 | + else | |
| 36 | + bcsr->board &= ~BCSR_BOARD_SD0PWR; | |
| 37 | + | |
| 38 | + au_sync_delay(1); | |
| 39 | +} | |
| 40 | + | |
| 41 | +static int pb1200mmc0_card_readonly(void *mmc_host) | |
| 42 | +{ | |
| 43 | + return (bcsr->status & BCSR_STATUS_SD0WP) ? 1 : 0; | |
| 44 | +} | |
| 45 | + | |
| 46 | +static int pb1200mmc0_card_inserted(void *mmc_host) | |
| 47 | +{ | |
| 48 | + return (bcsr->sig_status & BCSR_INT_SD0INSERT) ? 1 : 0; | |
| 49 | +} | |
| 50 | + | |
| 51 | +static void pb1200_mmcled_set(struct led_classdev *led, | |
| 52 | + enum led_brightness brightness) | |
| 53 | +{ | |
| 54 | + if (brightness != LED_OFF) { | |
| 55 | + if (++mmc_activity == 1) | |
| 56 | + bcsr->disk_leds &= ~(1 << 8); | |
| 57 | + } else { | |
| 58 | + if (--mmc_activity == 0) | |
| 59 | + bcsr->disk_leds |= (1 << 8); | |
| 60 | + } | |
| 61 | +} | |
| 62 | + | |
| 63 | +static struct led_classdev pb1200mmc_led = { | |
| 64 | + .brightness_set = pb1200_mmcled_set, | |
| 65 | +}; | |
| 66 | + | |
| 67 | +#ifndef CONFIG_MIPS_DB1200 | |
| 68 | +static void pb1200mmc1_set_power(void *mmc_host, int state) | |
| 69 | +{ | |
| 70 | + if (state) | |
| 71 | + bcsr->board |= BCSR_BOARD_SD1PWR; | |
| 72 | + else | |
| 73 | + bcsr->board &= ~BCSR_BOARD_SD1PWR; | |
| 74 | + | |
| 75 | + au_sync_delay(1); | |
| 76 | +} | |
| 77 | + | |
| 78 | +static int pb1200mmc1_card_readonly(void *mmc_host) | |
| 79 | +{ | |
| 80 | + return (bcsr->status & BCSR_STATUS_SD1WP) ? 1 : 0; | |
| 81 | +} | |
| 82 | + | |
| 83 | +static int pb1200mmc1_card_inserted(void *mmc_host) | |
| 84 | +{ | |
| 85 | + return (bcsr->sig_status & BCSR_INT_SD1INSERT) ? 1 : 0; | |
| 86 | +} | |
| 87 | +#endif | |
| 88 | + | |
| 89 | +const struct au1xmmc_platform_data au1xmmc_platdata[2] = { | |
| 90 | + [0] = { | |
| 91 | + .set_power = pb1200mmc0_set_power, | |
| 92 | + .card_inserted = pb1200mmc0_card_inserted, | |
| 93 | + .card_readonly = pb1200mmc0_card_readonly, | |
| 94 | + .cd_setup = NULL, /* use poll-timer in driver */ | |
| 95 | + .led = &pb1200mmc_led, | |
| 96 | + }, | |
| 97 | +#ifndef CONFIG_MIPS_DB1200 | |
| 98 | + [1] = { | |
| 99 | + .set_power = pb1200mmc1_set_power, | |
| 100 | + .card_inserted = pb1200mmc1_card_inserted, | |
| 101 | + .card_readonly = pb1200mmc1_card_readonly, | |
| 102 | + .cd_setup = NULL, /* use poll-timer in driver */ | |
| 103 | + .led = &pb1200mmc_led, | |
| 104 | + }, | |
| 105 | +#endif | |
| 106 | +}; | |
| 26 | 107 | |
| 27 | 108 | static struct resource ide_resources[] = { |
| 28 | 109 | [0] = { |
| @@ -0,0 +1,1149 @@ | ||
| 1 | +# | |
| 2 | +# Automatically generated make config: don't edit | |
| 3 | +# Linux kernel version: 2.6.26 | |
| 4 | +# Sat Jul 26 09:02:59 2008 | |
| 5 | +# | |
| 6 | +CONFIG_MIPS=y | |
| 7 | + | |
| 8 | +# | |
| 9 | +# Machine selection | |
| 10 | +# | |
| 11 | +# CONFIG_MACH_ALCHEMY is not set | |
| 12 | +# CONFIG_BASLER_EXCITE is not set | |
| 13 | +# CONFIG_BCM47XX is not set | |
| 14 | +# CONFIG_MIPS_COBALT is not set | |
| 15 | +# CONFIG_MACH_DECSTATION is not set | |
| 16 | +# CONFIG_MACH_JAZZ is not set | |
| 17 | +# CONFIG_LASAT is not set | |
| 18 | +# CONFIG_LEMOTE_FULONG is not set | |
| 19 | +# CONFIG_MIPS_MALTA is not set | |
| 20 | +# CONFIG_MIPS_SIM is not set | |
| 21 | +# CONFIG_MARKEINS is not set | |
| 22 | +# CONFIG_MACH_VR41XX is not set | |
| 23 | +# CONFIG_NXP_STB220 is not set | |
| 24 | +CONFIG_NXP_STB225=y | |
| 25 | +# CONFIG_PNX8550_JBS is not set | |
| 26 | +# CONFIG_PNX8550_STB810 is not set | |
| 27 | +# CONFIG_PMC_MSP is not set | |
| 28 | +# CONFIG_PMC_YOSEMITE is not set | |
| 29 | +# CONFIG_SGI_IP22 is not set | |
| 30 | +# CONFIG_SGI_IP27 is not set | |
| 31 | +# CONFIG_SGI_IP28 is not set | |
| 32 | +# CONFIG_SGI_IP32 is not set | |
| 33 | +# CONFIG_SIBYTE_CRHINE is not set | |
| 34 | +# CONFIG_SIBYTE_CARMEL is not set | |
| 35 | +# CONFIG_SIBYTE_CRHONE is not set | |
| 36 | +# CONFIG_SIBYTE_RHONE is not set | |
| 37 | +# CONFIG_SIBYTE_SWARM is not set | |
| 38 | +# CONFIG_SIBYTE_LITTLESUR is not set | |
| 39 | +# CONFIG_SIBYTE_SENTOSA is not set | |
| 40 | +# CONFIG_SIBYTE_BIGSUR is not set | |
| 41 | +# CONFIG_SNI_RM is not set | |
| 42 | +# CONFIG_MACH_TX39XX is not set | |
| 43 | +# CONFIG_MACH_TX49XX is not set | |
| 44 | +# CONFIG_WR_PPMC is not set | |
| 45 | +CONFIG_RWSEM_GENERIC_SPINLOCK=y | |
| 46 | +# CONFIG_ARCH_HAS_ILOG2_U32 is not set | |
| 47 | +# CONFIG_ARCH_HAS_ILOG2_U64 is not set | |
| 48 | +CONFIG_ARCH_SUPPORTS_OPROFILE=y | |
| 49 | +CONFIG_GENERIC_FIND_NEXT_BIT=y | |
| 50 | +CONFIG_GENERIC_HWEIGHT=y | |
| 51 | +CONFIG_GENERIC_CALIBRATE_DELAY=y | |
| 52 | +CONFIG_GENERIC_CLOCKEVENTS=y | |
| 53 | +CONFIG_GENERIC_TIME=y | |
| 54 | +CONFIG_GENERIC_CMOS_UPDATE=y | |
| 55 | +CONFIG_SCHED_NO_NO_OMIT_FRAME_POINTER=y | |
| 56 | +CONFIG_GENERIC_HARDIRQS_NO__DO_IRQ=y | |
| 57 | +CONFIG_CEVT_R4K=y | |
| 58 | +CONFIG_CSRC_R4K=y | |
| 59 | +CONFIG_DMA_NONCOHERENT=y | |
| 60 | +CONFIG_DMA_NEED_PCI_MAP_STATE=y | |
| 61 | +# CONFIG_HOTPLUG_CPU is not set | |
| 62 | +# CONFIG_NO_IOPORT is not set | |
| 63 | +CONFIG_GENERIC_GPIO=y | |
| 64 | +# CONFIG_CPU_BIG_ENDIAN is not set | |
| 65 | +CONFIG_CPU_LITTLE_ENDIAN=y | |
| 66 | +CONFIG_SYS_SUPPORTS_BIG_ENDIAN=y | |
| 67 | +CONFIG_SYS_SUPPORTS_LITTLE_ENDIAN=y | |
| 68 | +CONFIG_IRQ_CPU=y | |
| 69 | +CONFIG_SOC_PNX833X=y | |
| 70 | +CONFIG_SOC_PNX8335=y | |
| 71 | +CONFIG_MIPS_L1_CACHE_SHIFT=5 | |
| 72 | + | |
| 73 | +# | |
| 74 | +# CPU selection | |
| 75 | +# | |
| 76 | +# CONFIG_CPU_LOONGSON2 is not set | |
| 77 | +# CONFIG_CPU_MIPS32_R1 is not set | |
| 78 | +CONFIG_CPU_MIPS32_R2=y | |
| 79 | +# CONFIG_CPU_MIPS64_R1 is not set | |
| 80 | +# CONFIG_CPU_MIPS64_R2 is not set | |
| 81 | +# CONFIG_CPU_R3000 is not set | |
| 82 | +# CONFIG_CPU_TX39XX is not set | |
| 83 | +# CONFIG_CPU_VR41XX is not set | |
| 84 | +# CONFIG_CPU_R4300 is not set | |
| 85 | +# CONFIG_CPU_R4X00 is not set | |
| 86 | +# CONFIG_CPU_TX49XX is not set | |
| 87 | +# CONFIG_CPU_R5000 is not set | |
| 88 | +# CONFIG_CPU_R5432 is not set | |
| 89 | +# CONFIG_CPU_R6000 is not set | |
| 90 | +# CONFIG_CPU_NEVADA is not set | |
| 91 | +# CONFIG_CPU_R8000 is not set | |
| 92 | +# CONFIG_CPU_R10000 is not set | |
| 93 | +# CONFIG_CPU_RM7000 is not set | |
| 94 | +# CONFIG_CPU_RM9000 is not set | |
| 95 | +# CONFIG_CPU_SB1 is not set | |
| 96 | +CONFIG_SYS_HAS_CPU_MIPS32_R2=y | |
| 97 | +CONFIG_CPU_MIPS32=y | |
| 98 | +CONFIG_CPU_MIPSR2=y | |
| 99 | +CONFIG_SYS_SUPPORTS_32BIT_KERNEL=y | |
| 100 | +CONFIG_CPU_SUPPORTS_32BIT_KERNEL=y | |
| 101 | + | |
| 102 | +# | |
| 103 | +# Kernel type | |
| 104 | +# | |
| 105 | +CONFIG_32BIT=y | |
| 106 | +# CONFIG_64BIT is not set | |
| 107 | +CONFIG_PAGE_SIZE_4KB=y | |
| 108 | +# CONFIG_PAGE_SIZE_8KB is not set | |
| 109 | +# CONFIG_PAGE_SIZE_16KB is not set | |
| 110 | +# CONFIG_PAGE_SIZE_64KB is not set | |
| 111 | +CONFIG_CPU_HAS_PREFETCH=y | |
| 112 | +CONFIG_MIPS_MT_DISABLED=y | |
| 113 | +# CONFIG_MIPS_MT_SMP is not set | |
| 114 | +# CONFIG_MIPS_MT_SMTC is not set | |
| 115 | +CONFIG_CPU_HAS_LLSC=y | |
| 116 | +CONFIG_CPU_MIPSR2_IRQ_VI=y | |
| 117 | +CONFIG_CPU_HAS_SYNC=y | |
| 118 | +CONFIG_GENERIC_HARDIRQS=y | |
| 119 | +CONFIG_GENERIC_IRQ_PROBE=y | |
| 120 | +CONFIG_CPU_SUPPORTS_HIGHMEM=y | |
| 121 | +CONFIG_ARCH_FLATMEM_ENABLE=y | |
| 122 | +CONFIG_ARCH_POPULATES_NODE_MAP=y | |
| 123 | +CONFIG_SELECT_MEMORY_MODEL=y | |
| 124 | +CONFIG_FLATMEM_MANUAL=y | |
| 125 | +# CONFIG_DISCONTIGMEM_MANUAL is not set | |
| 126 | +# CONFIG_SPARSEMEM_MANUAL is not set | |
| 127 | +CONFIG_FLATMEM=y | |
| 128 | +CONFIG_FLAT_NODE_MEM_MAP=y | |
| 129 | +# CONFIG_SPARSEMEM_STATIC is not set | |
| 130 | +# CONFIG_SPARSEMEM_VMEMMAP_ENABLE is not set | |
| 131 | +CONFIG_PAGEFLAGS_EXTENDED=y | |
| 132 | +CONFIG_SPLIT_PTLOCK_CPUS=4 | |
| 133 | +# CONFIG_RESOURCES_64BIT is not set | |
| 134 | +CONFIG_ZONE_DMA_FLAG=0 | |
| 135 | +CONFIG_VIRT_TO_BUS=y | |
| 136 | +CONFIG_TICK_ONESHOT=y | |
| 137 | +CONFIG_NO_HZ=y | |
| 138 | +CONFIG_HIGH_RES_TIMERS=y | |
| 139 | +CONFIG_GENERIC_CLOCKEVENTS_BUILD=y | |
| 140 | +# CONFIG_HZ_48 is not set | |
| 141 | +# CONFIG_HZ_100 is not set | |
| 142 | +CONFIG_HZ_128=y | |
| 143 | +# CONFIG_HZ_250 is not set | |
| 144 | +# CONFIG_HZ_256 is not set | |
| 145 | +# CONFIG_HZ_1000 is not set | |
| 146 | +# CONFIG_HZ_1024 is not set | |
| 147 | +CONFIG_SYS_SUPPORTS_ARBIT_HZ=y | |
| 148 | +CONFIG_HZ=128 | |
| 149 | +# CONFIG_PREEMPT_NONE is not set | |
| 150 | +CONFIG_PREEMPT_VOLUNTARY=y | |
| 151 | +# CONFIG_PREEMPT is not set | |
| 152 | +# CONFIG_KEXEC is not set | |
| 153 | +# CONFIG_SECCOMP is not set | |
| 154 | +CONFIG_LOCKDEP_SUPPORT=y | |
| 155 | +CONFIG_STACKTRACE_SUPPORT=y | |
| 156 | +CONFIG_DEFCONFIG_LIST="/lib/modules/$UNAME_RELEASE/.config" | |
| 157 | + | |
| 158 | +# | |
| 159 | +# General setup | |
| 160 | +# | |
| 161 | +CONFIG_EXPERIMENTAL=y | |
| 162 | +CONFIG_BROKEN_ON_SMP=y | |
| 163 | +CONFIG_INIT_ENV_ARG_LIMIT=32 | |
| 164 | +CONFIG_LOCALVERSION="" | |
| 165 | +# CONFIG_LOCALVERSION_AUTO is not set | |
| 166 | +# CONFIG_SWAP is not set | |
| 167 | +CONFIG_SYSVIPC=y | |
| 168 | +CONFIG_SYSVIPC_SYSCTL=y | |
| 169 | +# CONFIG_POSIX_MQUEUE is not set | |
| 170 | +# CONFIG_BSD_PROCESS_ACCT is not set | |
| 171 | +# CONFIG_TASKSTATS is not set | |
| 172 | +# CONFIG_AUDIT is not set | |
| 173 | +# CONFIG_IKCONFIG is not set | |
| 174 | +CONFIG_LOG_BUF_SHIFT=14 | |
| 175 | +# CONFIG_CGROUPS is not set | |
| 176 | +# CONFIG_GROUP_SCHED is not set | |
| 177 | +CONFIG_SYSFS_DEPRECATED=y | |
| 178 | +CONFIG_SYSFS_DEPRECATED_V2=y | |
| 179 | +# CONFIG_RELAY is not set | |
| 180 | +# CONFIG_NAMESPACES is not set | |
| 181 | +# CONFIG_BLK_DEV_INITRD is not set | |
| 182 | +CONFIG_CC_OPTIMIZE_FOR_SIZE=y | |
| 183 | +CONFIG_SYSCTL=y | |
| 184 | +CONFIG_EMBEDDED=y | |
| 185 | +CONFIG_SYSCTL_SYSCALL=y | |
| 186 | +CONFIG_SYSCTL_SYSCALL_CHECK=y | |
| 187 | +CONFIG_KALLSYMS=y | |
| 188 | +# CONFIG_KALLSYMS_EXTRA_PASS is not set | |
| 189 | +CONFIG_HOTPLUG=y | |
| 190 | +CONFIG_PRINTK=y | |
| 191 | +CONFIG_BUG=y | |
| 192 | +CONFIG_ELF_CORE=y | |
| 193 | +CONFIG_PCSPKR_PLATFORM=y | |
| 194 | +CONFIG_COMPAT_BRK=y | |
| 195 | +CONFIG_BASE_FULL=y | |
| 196 | +CONFIG_FUTEX=y | |
| 197 | +CONFIG_ANON_INODES=y | |
| 198 | +CONFIG_EPOLL=y | |
| 199 | +CONFIG_SIGNALFD=y | |
| 200 | +CONFIG_TIMERFD=y | |
| 201 | +CONFIG_EVENTFD=y | |
| 202 | +CONFIG_SHMEM=y | |
| 203 | +CONFIG_VM_EVENT_COUNTERS=y | |
| 204 | +CONFIG_SLAB=y | |
| 205 | +# CONFIG_SLUB is not set | |
| 206 | +# CONFIG_SLOB is not set | |
| 207 | +# CONFIG_PROFILING is not set | |
| 208 | +# CONFIG_MARKERS is not set | |
| 209 | +CONFIG_HAVE_OPROFILE=y | |
| 210 | +# CONFIG_HAVE_KPROBES is not set | |
| 211 | +# CONFIG_HAVE_KRETPROBES is not set | |
| 212 | +# CONFIG_HAVE_DMA_ATTRS is not set | |
| 213 | +# CONFIG_USE_GENERIC_SMP_HELPERS is not set | |
| 214 | +CONFIG_PROC_PAGE_MONITOR=y | |
| 215 | +CONFIG_SLABINFO=y | |
| 216 | +CONFIG_RT_MUTEXES=y | |
| 217 | +# CONFIG_TINY_SHMEM is not set | |
| 218 | +CONFIG_BASE_SMALL=0 | |
| 219 | +CONFIG_MODULES=y | |
| 220 | +# CONFIG_MODULE_FORCE_LOAD is not set | |
| 221 | +CONFIG_MODULE_UNLOAD=y | |
| 222 | +# CONFIG_MODULE_FORCE_UNLOAD is not set | |
| 223 | +# CONFIG_MODVERSIONS is not set | |
| 224 | +# CONFIG_MODULE_SRCVERSION_ALL is not set | |
| 225 | +CONFIG_KMOD=y | |
| 226 | +CONFIG_BLOCK=y | |
| 227 | +# CONFIG_LBD is not set | |
| 228 | +# CONFIG_BLK_DEV_IO_TRACE is not set | |
| 229 | +# CONFIG_LSF is not set | |
| 230 | +# CONFIG_BLK_DEV_BSG is not set | |
| 231 | +# CONFIG_BLK_DEV_INTEGRITY is not set | |
| 232 | + | |
| 233 | +# | |
| 234 | +# IO Schedulers | |
| 235 | +# | |
| 236 | +CONFIG_IOSCHED_NOOP=y | |
| 237 | +# CONFIG_IOSCHED_AS is not set | |
| 238 | +# CONFIG_IOSCHED_DEADLINE is not set | |
| 239 | +# CONFIG_IOSCHED_CFQ is not set | |
| 240 | +# CONFIG_DEFAULT_AS is not set | |
| 241 | +# CONFIG_DEFAULT_DEADLINE is not set | |
| 242 | +# CONFIG_DEFAULT_CFQ is not set | |
| 243 | +CONFIG_DEFAULT_NOOP=y | |
| 244 | +CONFIG_DEFAULT_IOSCHED="noop" | |
| 245 | +CONFIG_CLASSIC_RCU=y | |
| 246 | + | |
| 247 | +# | |
| 248 | +# Bus options (PCI, PCMCIA, EISA, ISA, TC) | |
| 249 | +# | |
| 250 | +# CONFIG_ARCH_SUPPORTS_MSI is not set | |
| 251 | +CONFIG_MMU=y | |
| 252 | +# CONFIG_PCCARD is not set | |
| 253 | + | |
| 254 | +# | |
| 255 | +# Executable file formats | |
| 256 | +# | |
| 257 | +CONFIG_BINFMT_ELF=y | |
| 258 | +# CONFIG_BINFMT_MISC is not set | |
| 259 | +CONFIG_TRAD_SIGNALS=y | |
| 260 | + | |
| 261 | +# | |
| 262 | +# Power management options | |
| 263 | +# | |
| 264 | +CONFIG_ARCH_SUSPEND_POSSIBLE=y | |
| 265 | +CONFIG_PM=y | |
| 266 | +# CONFIG_PM_DEBUG is not set | |
| 267 | +CONFIG_PM_SLEEP=y | |
| 268 | +CONFIG_SUSPEND=y | |
| 269 | +CONFIG_SUSPEND_FREEZER=y | |
| 270 | + | |
| 271 | +# | |
| 272 | +# Networking | |
| 273 | +# | |
| 274 | +CONFIG_NET=y | |
| 275 | + | |
| 276 | +# | |
| 277 | +# Networking options | |
| 278 | +# | |
| 279 | +CONFIG_PACKET=y | |
| 280 | +# CONFIG_PACKET_MMAP is not set | |
| 281 | +CONFIG_UNIX=y | |
| 282 | +CONFIG_XFRM=y | |
| 283 | +# CONFIG_XFRM_USER is not set | |
| 284 | +# CONFIG_XFRM_SUB_POLICY is not set | |
| 285 | +# CONFIG_XFRM_MIGRATE is not set | |
| 286 | +# CONFIG_XFRM_STATISTICS is not set | |
| 287 | +# CONFIG_NET_KEY is not set | |
| 288 | +CONFIG_INET=y | |
| 289 | +CONFIG_IP_MULTICAST=y | |
| 290 | +# CONFIG_IP_ADVANCED_ROUTER is not set | |
| 291 | +CONFIG_IP_FIB_HASH=y | |
| 292 | +CONFIG_IP_PNP=y | |
| 293 | +CONFIG_IP_PNP_DHCP=y | |
| 294 | +# CONFIG_IP_PNP_BOOTP is not set | |
| 295 | +# CONFIG_IP_PNP_RARP is not set | |
| 296 | +# CONFIG_NET_IPIP is not set | |
| 297 | +# CONFIG_NET_IPGRE is not set | |
| 298 | +# CONFIG_IP_MROUTE is not set | |
| 299 | +# CONFIG_ARPD is not set | |
| 300 | +# CONFIG_SYN_COOKIES is not set | |
| 301 | +CONFIG_INET_AH=y | |
| 302 | +# CONFIG_INET_ESP is not set | |
| 303 | +# CONFIG_INET_IPCOMP is not set | |
| 304 | +# CONFIG_INET_XFRM_TUNNEL is not set | |
| 305 | +# CONFIG_INET_TUNNEL is not set | |
| 306 | +CONFIG_INET_XFRM_MODE_TRANSPORT=y | |
| 307 | +CONFIG_INET_XFRM_MODE_TUNNEL=y | |
| 308 | +CONFIG_INET_XFRM_MODE_BEET=y | |
| 309 | +# CONFIG_INET_LRO is not set | |
| 310 | +CONFIG_INET_DIAG=y | |
| 311 | +CONFIG_INET_TCP_DIAG=y | |
| 312 | +# CONFIG_TCP_CONG_ADVANCED is not set | |
| 313 | +CONFIG_TCP_CONG_CUBIC=y | |
| 314 | +CONFIG_DEFAULT_TCP_CONG="cubic" | |
| 315 | +# CONFIG_TCP_MD5SIG is not set | |
| 316 | +# CONFIG_IPV6 is not set | |
| 317 | +# CONFIG_NETWORK_SECMARK is not set | |
| 318 | +# CONFIG_NETFILTER is not set | |
| 319 | +# CONFIG_IP_DCCP is not set | |
| 320 | +# CONFIG_IP_SCTP is not set | |
| 321 | +# CONFIG_TIPC is not set | |
| 322 | +# CONFIG_ATM is not set | |
| 323 | +# CONFIG_BRIDGE is not set | |
| 324 | +# CONFIG_VLAN_8021Q is not set | |
| 325 | +# CONFIG_DECNET is not set | |
| 326 | +# CONFIG_LLC2 is not set | |
| 327 | +# CONFIG_IPX is not set | |
| 328 | +# CONFIG_ATALK is not set | |
| 329 | +# CONFIG_X25 is not set | |
| 330 | +# CONFIG_LAPB is not set | |
| 331 | +# CONFIG_ECONET is not set | |
| 332 | +# CONFIG_WAN_ROUTER is not set | |
| 333 | +# CONFIG_NET_SCHED is not set | |
| 334 | + | |
| 335 | +# | |
| 336 | +# Network testing | |
| 337 | +# | |
| 338 | +# CONFIG_NET_PKTGEN is not set | |
| 339 | +# CONFIG_HAMRADIO is not set | |
| 340 | +# CONFIG_CAN is not set | |
| 341 | +# CONFIG_IRDA is not set | |
| 342 | +# CONFIG_BT is not set | |
| 343 | +# CONFIG_AF_RXRPC is not set | |
| 344 | + | |
| 345 | +# | |
| 346 | +# Wireless | |
| 347 | +# | |
| 348 | +# CONFIG_CFG80211 is not set | |
| 349 | +# CONFIG_WIRELESS_EXT is not set | |
| 350 | +# CONFIG_MAC80211 is not set | |
| 351 | +# CONFIG_IEEE80211 is not set | |
| 352 | +# CONFIG_RFKILL is not set | |
| 353 | +# CONFIG_NET_9P is not set | |
| 354 | + | |
| 355 | +# | |
| 356 | +# Device Drivers | |
| 357 | +# | |
| 358 | + | |
| 359 | +# | |
| 360 | +# Generic Driver Options | |
| 361 | +# | |
| 362 | +CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | |
| 363 | +CONFIG_STANDALONE=y | |
| 364 | +CONFIG_PREVENT_FIRMWARE_BUILD=y | |
| 365 | +CONFIG_FW_LOADER=y | |
| 366 | +CONFIG_FIRMWARE_IN_KERNEL=y | |
| 367 | +CONFIG_EXTRA_FIRMWARE="" | |
| 368 | +# CONFIG_SYS_HYPERVISOR is not set | |
| 369 | +# CONFIG_CONNECTOR is not set | |
| 370 | +CONFIG_MTD=y | |
| 371 | +# CONFIG_MTD_DEBUG is not set | |
| 372 | +# CONFIG_MTD_CONCAT is not set | |
| 373 | +CONFIG_MTD_PARTITIONS=y | |
| 374 | +# CONFIG_MTD_REDBOOT_PARTS is not set | |
| 375 | +CONFIG_MTD_CMDLINE_PARTS=y | |
| 376 | +# CONFIG_MTD_AR7_PARTS is not set | |
| 377 | + | |
| 378 | +# | |
| 379 | +# User Modules And Translation Layers | |
| 380 | +# | |
| 381 | +CONFIG_MTD_CHAR=y | |
| 382 | +CONFIG_MTD_BLKDEVS=y | |
| 383 | +CONFIG_MTD_BLOCK=y | |
| 384 | +# CONFIG_FTL is not set | |
| 385 | +# CONFIG_NFTL is not set | |
| 386 | +# CONFIG_INFTL is not set | |
| 387 | +# CONFIG_RFD_FTL is not set | |
| 388 | +# CONFIG_SSFDC is not set | |
| 389 | +# CONFIG_MTD_OOPS is not set | |
| 390 | + | |
| 391 | +# | |
| 392 | +# RAM/ROM/Flash chip drivers | |
| 393 | +# | |
| 394 | +CONFIG_MTD_CFI=y | |
| 395 | +# CONFIG_MTD_JEDECPROBE is not set | |
| 396 | +CONFIG_MTD_GEN_PROBE=y | |
| 397 | +CONFIG_MTD_CFI_ADV_OPTIONS=y | |
| 398 | +# CONFIG_MTD_CFI_NOSWAP is not set | |
| 399 | +# CONFIG_MTD_CFI_BE_BYTE_SWAP is not set | |
| 400 | +CONFIG_MTD_CFI_LE_BYTE_SWAP=y | |
| 401 | +CONFIG_MTD_CFI_GEOMETRY=y | |
| 402 | +CONFIG_MTD_MAP_BANK_WIDTH_1=y | |
| 403 | +CONFIG_MTD_MAP_BANK_WIDTH_2=y | |
| 404 | +CONFIG_MTD_MAP_BANK_WIDTH_4=y | |
| 405 | +# CONFIG_MTD_MAP_BANK_WIDTH_8 is not set | |
| 406 | +# CONFIG_MTD_MAP_BANK_WIDTH_16 is not set | |
| 407 | +# CONFIG_MTD_MAP_BANK_WIDTH_32 is not set | |
| 408 | +CONFIG_MTD_CFI_I1=y | |
| 409 | +CONFIG_MTD_CFI_I2=y | |
| 410 | +# CONFIG_MTD_CFI_I4 is not set | |
| 411 | +# CONFIG_MTD_CFI_I8 is not set | |
| 412 | +# CONFIG_MTD_OTP is not set | |
| 413 | +# CONFIG_MTD_CFI_INTELEXT is not set | |
| 414 | +CONFIG_MTD_CFI_AMDSTD=y | |
| 415 | +# CONFIG_MTD_CFI_STAA is not set | |
| 416 | +CONFIG_MTD_CFI_UTIL=y | |
| 417 | +# CONFIG_MTD_RAM is not set | |
| 418 | +# CONFIG_MTD_ROM is not set | |
| 419 | +# CONFIG_MTD_ABSENT is not set | |
| 420 | + | |
| 421 | +# | |
| 422 | +# Mapping drivers for chip access | |
| 423 | +# | |
| 424 | +# CONFIG_MTD_COMPLEX_MAPPINGS is not set | |
| 425 | +CONFIG_MTD_PHYSMAP=y | |
| 426 | +CONFIG_MTD_PHYSMAP_START=0x18000000 | |
| 427 | +CONFIG_MTD_PHYSMAP_LEN=0x04000000 | |
| 428 | +CONFIG_MTD_PHYSMAP_BANKWIDTH=2 | |
| 429 | +# CONFIG_MTD_PLATRAM is not set | |
| 430 | + | |
| 431 | +# | |
| 432 | +# Self-contained MTD device drivers | |
| 433 | +# | |
| 434 | +# CONFIG_MTD_SLRAM is not set | |
| 435 | +# CONFIG_MTD_PHRAM is not set | |
| 436 | +# CONFIG_MTD_MTDRAM is not set | |
| 437 | +# CONFIG_MTD_BLOCK2MTD is not set | |
| 438 | + | |
| 439 | +# | |
| 440 | +# Disk-On-Chip Device Drivers | |
| 441 | +# | |
| 442 | +# CONFIG_MTD_DOC2000 is not set | |
| 443 | +# CONFIG_MTD_DOC2001 is not set | |
| 444 | +# CONFIG_MTD_DOC2001PLUS is not set | |
| 445 | +# CONFIG_MTD_NAND is not set | |
| 446 | +# CONFIG_MTD_ONENAND is not set | |
| 447 | + | |
| 448 | +# | |
| 449 | +# UBI - Unsorted block images | |
| 450 | +# | |
| 451 | +# CONFIG_MTD_UBI is not set | |
| 452 | +# CONFIG_PARPORT is not set | |
| 453 | +CONFIG_BLK_DEV=y | |
| 454 | +# CONFIG_BLK_DEV_COW_COMMON is not set | |
| 455 | +CONFIG_BLK_DEV_LOOP=y | |
| 456 | +# CONFIG_BLK_DEV_CRYPTOLOOP is not set | |
| 457 | +# CONFIG_BLK_DEV_NBD is not set | |
| 458 | +# CONFIG_BLK_DEV_RAM is not set | |
| 459 | +# CONFIG_CDROM_PKTCDVD is not set | |
| 460 | +# CONFIG_ATA_OVER_ETH is not set | |
| 461 | +# CONFIG_BLK_DEV_HD is not set | |
| 462 | +# CONFIG_MISC_DEVICES is not set | |
| 463 | +CONFIG_HAVE_IDE=y | |
| 464 | +# CONFIG_IDE is not set | |
| 465 | + | |
| 466 | +# | |
| 467 | +# SCSI device support | |
| 468 | +# | |
| 469 | +# CONFIG_RAID_ATTRS is not set | |
| 470 | +CONFIG_SCSI=y | |
| 471 | +CONFIG_SCSI_DMA=y | |
| 472 | +# CONFIG_SCSI_TGT is not set | |
| 473 | +# CONFIG_SCSI_NETLINK is not set | |
| 474 | +CONFIG_SCSI_PROC_FS=y | |
| 475 | + | |
| 476 | +# | |
| 477 | +# SCSI support type (disk, tape, CD-ROM) | |
| 478 | +# | |
| 479 | +CONFIG_BLK_DEV_SD=y | |
| 480 | +# CONFIG_CHR_DEV_ST is not set | |
| 481 | +# CONFIG_CHR_DEV_OSST is not set | |
| 482 | +# CONFIG_BLK_DEV_SR is not set | |
| 483 | +# CONFIG_CHR_DEV_SG is not set | |
| 484 | +# CONFIG_CHR_DEV_SCH is not set | |
| 485 | + | |
| 486 | +# | |
| 487 | +# Some SCSI devices (e.g. CD jukebox) support multiple LUNs | |
| 488 | +# | |
| 489 | +# CONFIG_SCSI_MULTI_LUN is not set | |
| 490 | +# CONFIG_SCSI_CONSTANTS is not set | |
| 491 | +# CONFIG_SCSI_LOGGING is not set | |
| 492 | +# CONFIG_SCSI_SCAN_ASYNC is not set | |
| 493 | +CONFIG_SCSI_WAIT_SCAN=m | |
| 494 | + | |
| 495 | +# | |
| 496 | +# SCSI Transports | |
| 497 | +# | |
| 498 | +# CONFIG_SCSI_SPI_ATTRS is not set | |
| 499 | +# CONFIG_SCSI_FC_ATTRS is not set | |
| 500 | +# CONFIG_SCSI_ISCSI_ATTRS is not set | |
| 501 | +# CONFIG_SCSI_SAS_LIBSAS is not set | |
| 502 | +# CONFIG_SCSI_SRP_ATTRS is not set | |
| 503 | +# CONFIG_SCSI_LOWLEVEL is not set | |
| 504 | +# CONFIG_SCSI_DH is not set | |
| 505 | +CONFIG_ATA=y | |
| 506 | +# CONFIG_ATA_NONSTANDARD is not set | |
| 507 | +CONFIG_SATA_PMP=y | |
| 508 | +CONFIG_ATA_SFF=y | |
| 509 | +# CONFIG_SATA_MV is not set | |
| 510 | +# CONFIG_PATA_PLATFORM is not set | |
| 511 | +# CONFIG_MD is not set | |
| 512 | +CONFIG_NETDEVICES=y | |
| 513 | +# CONFIG_DUMMY is not set | |
| 514 | +# CONFIG_BONDING is not set | |
| 515 | +# CONFIG_MACVLAN is not set | |
| 516 | +# CONFIG_EQUALIZER is not set | |
| 517 | +# CONFIG_TUN is not set | |
| 518 | +# CONFIG_VETH is not set | |
| 519 | +# CONFIG_PHYLIB is not set | |
| 520 | +CONFIG_NET_ETHERNET=y | |
| 521 | +CONFIG_MII=y | |
| 522 | +# CONFIG_AX88796 is not set | |
| 523 | +# CONFIG_DM9000 is not set | |
| 524 | +# CONFIG_IBM_NEW_EMAC_ZMII is not set | |
| 525 | +# CONFIG_IBM_NEW_EMAC_RGMII is not set | |
| 526 | +# CONFIG_IBM_NEW_EMAC_TAH is not set | |
| 527 | +# CONFIG_IBM_NEW_EMAC_EMAC4 is not set | |
| 528 | +# CONFIG_B44 is not set | |
| 529 | +# CONFIG_NETDEV_1000 is not set | |
| 530 | +# CONFIG_NETDEV_10000 is not set | |
| 531 | + | |
| 532 | +# | |
| 533 | +# Wireless LAN | |
| 534 | +# | |
| 535 | +# CONFIG_WLAN_PRE80211 is not set | |
| 536 | +# CONFIG_WLAN_80211 is not set | |
| 537 | +# CONFIG_IWLWIFI_LEDS is not set | |
| 538 | +# CONFIG_WAN is not set | |
| 539 | +# CONFIG_PPP is not set | |
| 540 | +# CONFIG_SLIP is not set | |
| 541 | +# CONFIG_NETCONSOLE is not set | |
| 542 | +# CONFIG_NETPOLL is not set | |
| 543 | +# CONFIG_NET_POLL_CONTROLLER is not set | |
| 544 | +# CONFIG_ISDN is not set | |
| 545 | +# CONFIG_PHONE is not set | |
| 546 | + | |
| 547 | +# | |
| 548 | +# Input device support | |
| 549 | +# | |
| 550 | +CONFIG_INPUT=y | |
| 551 | +# CONFIG_INPUT_FF_MEMLESS is not set | |
| 552 | +# CONFIG_INPUT_POLLDEV is not set | |
| 553 | + | |
| 554 | +# | |
| 555 | +# Userland interfaces | |
| 556 | +# | |
| 557 | +# CONFIG_INPUT_MOUSEDEV is not set | |
| 558 | +# CONFIG_INPUT_JOYDEV is not set | |
| 559 | +CONFIG_INPUT_EVDEV=m | |
| 560 | +CONFIG_INPUT_EVBUG=m | |
| 561 | + | |
| 562 | +# | |
| 563 | +# Input Device Drivers | |
| 564 | +# | |
| 565 | +# CONFIG_INPUT_KEYBOARD is not set | |
| 566 | +# CONFIG_INPUT_MOUSE is not set | |
| 567 | +# CONFIG_INPUT_JOYSTICK is not set | |
| 568 | +# CONFIG_INPUT_TABLET is not set | |
| 569 | +# CONFIG_INPUT_TOUCHSCREEN is not set | |
| 570 | +# CONFIG_INPUT_MISC is not set | |
| 571 | + | |
| 572 | +# | |
| 573 | +# Hardware I/O ports | |
| 574 | +# | |
| 575 | +CONFIG_SERIO=y | |
| 576 | +# CONFIG_SERIO_I8042 is not set | |
| 577 | +CONFIG_SERIO_SERPORT=y | |
| 578 | +# CONFIG_SERIO_LIBPS2 is not set | |
| 579 | +# CONFIG_SERIO_RAW is not set | |
| 580 | +# CONFIG_GAMEPORT is not set | |
| 581 | + | |
| 582 | +# | |
| 583 | +# Character devices | |
| 584 | +# | |
| 585 | +CONFIG_VT=y | |
| 586 | +CONFIG_CONSOLE_TRANSLATIONS=y | |
| 587 | +# CONFIG_VT_CONSOLE is not set | |
| 588 | +CONFIG_HW_CONSOLE=y | |
| 589 | +# CONFIG_VT_HW_CONSOLE_BINDING is not set | |
| 590 | +CONFIG_DEVKMEM=y | |
| 591 | +# CONFIG_SERIAL_NONSTANDARD is not set | |
| 592 | + | |
| 593 | +# | |
| 594 | +# Serial drivers | |
| 595 | +# | |
| 596 | +# CONFIG_SERIAL_8250 is not set | |
| 597 | + | |
| 598 | +# | |
| 599 | +# Non-8250 serial port support | |
| 600 | +# | |
| 601 | +CONFIG_SERIAL_PNX8XXX=y | |
| 602 | +CONFIG_SERIAL_PNX8XXX_CONSOLE=y | |
| 603 | +CONFIG_SERIAL_CORE=y | |
| 604 | +CONFIG_SERIAL_CORE_CONSOLE=y | |
| 605 | +CONFIG_UNIX98_PTYS=y | |
| 606 | +# CONFIG_LEGACY_PTYS is not set | |
| 607 | +# CONFIG_IPMI_HANDLER is not set | |
| 608 | +CONFIG_HW_RANDOM=y | |
| 609 | +# CONFIG_R3964 is not set | |
| 610 | +# CONFIG_RAW_DRIVER is not set | |
| 611 | +# CONFIG_TCG_TPM is not set | |
| 612 | +CONFIG_I2C=y | |
| 613 | +CONFIG_I2C_BOARDINFO=y | |
| 614 | +CONFIG_I2C_CHARDEV=y | |
| 615 | + | |
| 616 | +# | |
| 617 | +# I2C Hardware Bus support | |
| 618 | +# | |
| 619 | + | |
| 620 | +# | |
| 621 | +# I2C system bus drivers (mostly embedded / system-on-chip) | |
| 622 | +# | |
| 623 | +# CONFIG_I2C_GPIO is not set | |
| 624 | +# CONFIG_I2C_OCORES is not set | |
| 625 | +# CONFIG_I2C_SIMTEC is not set | |
| 626 | + | |
| 627 | +# | |
| 628 | +# External I2C/SMBus adapter drivers | |
| 629 | +# | |
| 630 | +# CONFIG_I2C_PARPORT_LIGHT is not set | |
| 631 | +# CONFIG_I2C_TAOS_EVM is not set | |
| 632 | + | |
| 633 | +# | |
| 634 | +# Other I2C/SMBus bus drivers | |
| 635 | +# | |
| 636 | +# CONFIG_I2C_PCA_PLATFORM is not set | |
| 637 | +# CONFIG_I2C_STUB is not set | |
| 638 | + | |
| 639 | +# | |
| 640 | +# Miscellaneous I2C Chip support | |
| 641 | +# | |
| 642 | +# CONFIG_DS1682 is not set | |
| 643 | +# CONFIG_AT24 is not set | |
| 644 | +# CONFIG_SENSORS_EEPROM is not set | |
| 645 | +# CONFIG_SENSORS_PCF8574 is not set | |
| 646 | +# CONFIG_PCF8575 is not set | |
| 647 | +# CONFIG_SENSORS_PCA9539 is not set | |
| 648 | +# CONFIG_SENSORS_PCF8591 is not set | |
| 649 | +# CONFIG_SENSORS_MAX6875 is not set | |
| 650 | +# CONFIG_SENSORS_TSL2550 is not set | |
| 651 | +# CONFIG_I2C_DEBUG_CORE is not set | |
| 652 | +# CONFIG_I2C_DEBUG_ALGO is not set | |
| 653 | +# CONFIG_I2C_DEBUG_BUS is not set | |
| 654 | +# CONFIG_I2C_DEBUG_CHIP is not set | |
| 655 | +# CONFIG_SPI is not set | |
| 656 | +# CONFIG_W1 is not set | |
| 657 | +# CONFIG_POWER_SUPPLY is not set | |
| 658 | +# CONFIG_HWMON is not set | |
| 659 | +# CONFIG_THERMAL is not set | |
| 660 | +# CONFIG_THERMAL_HWMON is not set | |
| 661 | +# CONFIG_WATCHDOG is not set | |
| 662 | + | |
| 663 | +# | |
| 664 | +# Sonics Silicon Backplane | |
| 665 | +# | |
| 666 | +CONFIG_SSB_POSSIBLE=y | |
| 667 | +# CONFIG_SSB is not set | |
| 668 | + | |
| 669 | +# | |
| 670 | +# Multifunction device drivers | |
| 671 | +# | |
| 672 | +# CONFIG_MFD_CORE is not set | |
| 673 | +# CONFIG_MFD_SM501 is not set | |
| 674 | +# CONFIG_HTC_PASIC3 is not set | |
| 675 | + | |
| 676 | +# | |
| 677 | +# Multimedia devices | |
| 678 | +# | |
| 679 | + | |
| 680 | +# | |
| 681 | +# Multimedia core support | |
| 682 | +# | |
| 683 | +# CONFIG_VIDEO_DEV is not set | |
| 684 | +CONFIG_DVB_CORE=y | |
| 685 | +CONFIG_VIDEO_MEDIA=y | |
| 686 | + | |
| 687 | +# | |
| 688 | +# Multimedia drivers | |
| 689 | +# | |
| 690 | +# CONFIG_MEDIA_ATTACH is not set | |
| 691 | +CONFIG_MEDIA_TUNER=y | |
| 692 | +# CONFIG_MEDIA_TUNER_CUSTOMIZE is not set | |
| 693 | +CONFIG_MEDIA_TUNER_SIMPLE=y | |
| 694 | +CONFIG_MEDIA_TUNER_TDA8290=y | |
| 695 | +CONFIG_MEDIA_TUNER_TDA9887=y | |
| 696 | +CONFIG_MEDIA_TUNER_TEA5761=y | |
| 697 | +CONFIG_MEDIA_TUNER_TEA5767=y | |
| 698 | +CONFIG_MEDIA_TUNER_MT20XX=y | |
| 699 | +CONFIG_MEDIA_TUNER_XC2028=y | |
| 700 | +CONFIG_MEDIA_TUNER_XC5000=y | |
| 701 | +CONFIG_DVB_CAPTURE_DRIVERS=y | |
| 702 | +# CONFIG_TTPCI_EEPROM is not set | |
| 703 | +# CONFIG_DVB_B2C2_FLEXCOP is not set | |
| 704 | + | |
| 705 | +# | |
| 706 | +# Supported DVB Frontends | |
| 707 | +# | |
| 708 | + | |
| 709 | +# | |
| 710 | +# Customise DVB Frontends | |
| 711 | +# | |
| 712 | +# CONFIG_DVB_FE_CUSTOMISE is not set | |
| 713 | + | |
| 714 | +# | |
| 715 | +# DVB-S (satellite) frontends | |
| 716 | +# | |
| 717 | +# CONFIG_DVB_CX24110 is not set | |
| 718 | +# CONFIG_DVB_CX24123 is not set | |
| 719 | +# CONFIG_DVB_MT312 is not set | |
| 720 | +# CONFIG_DVB_S5H1420 is not set | |
| 721 | +# CONFIG_DVB_STV0299 is not set | |
| 722 | +# CONFIG_DVB_TDA8083 is not set | |
| 723 | +# CONFIG_DVB_TDA10086 is not set | |
| 724 | +# CONFIG_DVB_VES1X93 is not set | |
| 725 | +# CONFIG_DVB_TUNER_ITD1000 is not set | |
| 726 | +# CONFIG_DVB_TDA826X is not set | |
| 727 | +# CONFIG_DVB_TUA6100 is not set | |
| 728 | + | |
| 729 | +# | |
| 730 | +# DVB-T (terrestrial) frontends | |
| 731 | +# | |
| 732 | +# CONFIG_DVB_SP8870 is not set | |
| 733 | +# CONFIG_DVB_SP887X is not set | |
| 734 | +# CONFIG_DVB_CX22700 is not set | |
| 735 | +# CONFIG_DVB_CX22702 is not set | |
| 736 | +# CONFIG_DVB_DRX397XD is not set | |
| 737 | +# CONFIG_DVB_L64781 is not set | |
| 738 | +CONFIG_DVB_TDA1004X=y | |
| 739 | +# CONFIG_DVB_NXT6000 is not set | |
| 740 | +# CONFIG_DVB_MT352 is not set | |
| 741 | +# CONFIG_DVB_ZL10353 is not set | |
| 742 | +# CONFIG_DVB_DIB3000MB is not set | |
| 743 | +# CONFIG_DVB_DIB3000MC is not set | |
| 744 | +# CONFIG_DVB_DIB7000M is not set | |
| 745 | +# CONFIG_DVB_DIB7000P is not set | |
| 746 | +# CONFIG_DVB_TDA10048 is not set | |
| 747 | + | |
| 748 | +# | |
| 749 | +# DVB-C (cable) frontends | |
| 750 | +# | |
| 751 | +# CONFIG_DVB_VES1820 is not set | |
| 752 | +# CONFIG_DVB_TDA10021 is not set | |
| 753 | +# CONFIG_DVB_TDA10023 is not set | |
| 754 | +# CONFIG_DVB_STV0297 is not set | |
| 755 | + | |
| 756 | +# | |
| 757 | +# ATSC (North American/Korean Terrestrial/Cable DTV) frontends | |
| 758 | +# | |
| 759 | +# CONFIG_DVB_NXT200X is not set | |
| 760 | +# CONFIG_DVB_OR51211 is not set | |
| 761 | +# CONFIG_DVB_OR51132 is not set | |
| 762 | +# CONFIG_DVB_BCM3510 is not set | |
| 763 | +# CONFIG_DVB_LGDT330X is not set | |
| 764 | +# CONFIG_DVB_S5H1409 is not set | |
| 765 | +# CONFIG_DVB_AU8522 is not set | |
| 766 | +# CONFIG_DVB_S5H1411 is not set | |
| 767 | + | |
| 768 | +# | |
| 769 | +# Digital terrestrial only tuners/PLL | |
| 770 | +# | |
| 771 | +# CONFIG_DVB_PLL is not set | |
| 772 | +# CONFIG_DVB_TUNER_DIB0070 is not set | |
| 773 | + | |
| 774 | +# | |
| 775 | +# SEC control devices for DVB-S | |
| 776 | +# | |
| 777 | +# CONFIG_DVB_LNBP21 is not set | |
| 778 | +# CONFIG_DVB_ISL6405 is not set | |
| 779 | +# CONFIG_DVB_ISL6421 is not set | |
| 780 | +# CONFIG_DAB is not set | |
| 781 | + | |
| 782 | +# | |
| 783 | +# Graphics support | |
| 784 | +# | |
| 785 | +# CONFIG_VGASTATE is not set | |
| 786 | +# CONFIG_VIDEO_OUTPUT_CONTROL is not set | |
| 787 | +CONFIG_FB=y | |
| 788 | +# CONFIG_FIRMWARE_EDID is not set | |
| 789 | +# CONFIG_FB_DDC is not set | |
| 790 | +# CONFIG_FB_CFB_FILLRECT is not set | |
| 791 | +# CONFIG_FB_CFB_COPYAREA is not set | |
| 792 | +# CONFIG_FB_CFB_IMAGEBLIT is not set | |
| 793 | +# CONFIG_FB_CFB_REV_PIXELS_IN_BYTE is not set | |
| 794 | +# CONFIG_FB_SYS_FILLRECT is not set | |
| 795 | +# CONFIG_FB_SYS_COPYAREA is not set | |
| 796 | +# CONFIG_FB_SYS_IMAGEBLIT is not set | |
| 797 | +# CONFIG_FB_FOREIGN_ENDIAN is not set | |
| 798 | +# CONFIG_FB_SYS_FOPS is not set | |
| 799 | +# CONFIG_FB_SVGALIB is not set | |
| 800 | +# CONFIG_FB_MACMODES is not set | |
| 801 | +# CONFIG_FB_BACKLIGHT is not set | |
| 802 | +# CONFIG_FB_MODE_HELPERS is not set | |
| 803 | +# CONFIG_FB_TILEBLITTING is not set | |
| 804 | + | |
| 805 | +# | |
| 806 | +# Frame buffer hardware drivers | |
| 807 | +# | |
| 808 | +# CONFIG_FB_S1D13XXX is not set | |
| 809 | +# CONFIG_FB_VIRTUAL is not set | |
| 810 | +# CONFIG_BACKLIGHT_LCD_SUPPORT is not set | |
| 811 | + | |
| 812 | +# | |
| 813 | +# Display device support | |
| 814 | +# | |
| 815 | +# CONFIG_DISPLAY_SUPPORT is not set | |
| 816 | + | |
| 817 | +# | |
| 818 | +# Console display driver support | |
| 819 | +# | |
| 820 | +# CONFIG_VGA_CONSOLE is not set | |
| 821 | +CONFIG_DUMMY_CONSOLE=y | |
| 822 | +# CONFIG_FRAMEBUFFER_CONSOLE is not set | |
| 823 | +# CONFIG_LOGO is not set | |
| 824 | +CONFIG_SOUND=m | |
| 825 | +CONFIG_SND=m | |
| 826 | +CONFIG_SND_TIMER=m | |
| 827 | +CONFIG_SND_PCM=m | |
| 828 | +CONFIG_SND_SEQUENCER=m | |
| 829 | +# CONFIG_SND_SEQ_DUMMY is not set | |
| 830 | +CONFIG_SND_OSSEMUL=y | |
| 831 | +CONFIG_SND_MIXER_OSS=m | |
| 832 | +CONFIG_SND_PCM_OSS=m | |
| 833 | +CONFIG_SND_PCM_OSS_PLUGINS=y | |
| 834 | +CONFIG_SND_SEQUENCER_OSS=y | |
| 835 | +# CONFIG_SND_DYNAMIC_MINORS is not set | |
| 836 | +CONFIG_SND_SUPPORT_OLD_API=y | |
| 837 | +CONFIG_SND_VERBOSE_PROCFS=y | |
| 838 | +CONFIG_SND_VERBOSE_PRINTK=y | |
| 839 | +CONFIG_SND_DEBUG=y | |
| 840 | +# CONFIG_SND_DEBUG_VERBOSE is not set | |
| 841 | +# CONFIG_SND_PCM_XRUN_DEBUG is not set | |
| 842 | +CONFIG_SND_DRIVERS=y | |
| 843 | +# CONFIG_SND_DUMMY is not set | |
| 844 | +# CONFIG_SND_VIRMIDI is not set | |
| 845 | +# CONFIG_SND_MTPAV is not set | |
| 846 | +# CONFIG_SND_SERIAL_U16550 is not set | |
| 847 | +# CONFIG_SND_MPU401 is not set | |
| 848 | +CONFIG_SND_MIPS=y | |
| 849 | +# CONFIG_SND_SOC is not set | |
| 850 | +# CONFIG_SOUND_PRIME is not set | |
| 851 | +CONFIG_HID_SUPPORT=y | |
| 852 | +CONFIG_HID=y | |
| 853 | +# CONFIG_HID_DEBUG is not set | |
| 854 | +# CONFIG_HIDRAW is not set | |
| 855 | +CONFIG_USB_SUPPORT=y | |
| 856 | +# CONFIG_USB_ARCH_HAS_HCD is not set | |
| 857 | +# CONFIG_USB_ARCH_HAS_OHCI is not set | |
| 858 | +# CONFIG_USB_ARCH_HAS_EHCI is not set | |
| 859 | +# CONFIG_USB_OTG_WHITELIST is not set | |
| 860 | +# CONFIG_USB_OTG_BLACKLIST_HUB is not set | |
| 861 | + | |
| 862 | +# | |
| 863 | +# NOTE: USB_STORAGE enables SCSI, and 'SCSI disk support' | |
| 864 | +# | |
| 865 | +# CONFIG_USB_GADGET is not set | |
| 866 | +# CONFIG_MMC is not set | |
| 867 | +# CONFIG_MEMSTICK is not set | |
| 868 | +# CONFIG_NEW_LEDS is not set | |
| 869 | +# CONFIG_ACCESSIBILITY is not set | |
| 870 | +CONFIG_RTC_LIB=y | |
| 871 | +# CONFIG_RTC_CLASS is not set | |
| 872 | +# CONFIG_DMADEVICES is not set | |
| 873 | +# CONFIG_UIO is not set | |
| 874 | + | |
| 875 | +# | |
| 876 | +# File systems | |
| 877 | +# | |
| 878 | +CONFIG_EXT2_FS=m | |
| 879 | +# CONFIG_EXT2_FS_XATTR is not set | |
| 880 | +# CONFIG_EXT2_FS_XIP is not set | |
| 881 | +# CONFIG_EXT3_FS is not set | |
| 882 | +# CONFIG_EXT4DEV_FS is not set | |
| 883 | +# CONFIG_REISERFS_FS is not set | |
| 884 | +# CONFIG_JFS_FS is not set | |
| 885 | +# CONFIG_FS_POSIX_ACL is not set | |
| 886 | +# CONFIG_XFS_FS is not set | |
| 887 | +# CONFIG_OCFS2_FS is not set | |
| 888 | +# CONFIG_DNOTIFY is not set | |
| 889 | +CONFIG_INOTIFY=y | |
| 890 | +CONFIG_INOTIFY_USER=y | |
| 891 | +# CONFIG_QUOTA is not set | |
| 892 | +# CONFIG_AUTOFS_FS is not set | |
| 893 | +# CONFIG_AUTOFS4_FS is not set | |
| 894 | +# CONFIG_FUSE_FS is not set | |
| 895 | + | |
| 896 | +# | |
| 897 | +# CD-ROM/DVD Filesystems | |
| 898 | +# | |
| 899 | +# CONFIG_ISO9660_FS is not set | |
| 900 | +# CONFIG_UDF_FS is not set | |
| 901 | + | |
| 902 | +# | |
| 903 | +# DOS/FAT/NT Filesystems | |
| 904 | +# | |
| 905 | +CONFIG_FAT_FS=m | |
| 906 | +CONFIG_MSDOS_FS=m | |
| 907 | +CONFIG_VFAT_FS=m | |
| 908 | +CONFIG_FAT_DEFAULT_CODEPAGE=437 | |
| 909 | +CONFIG_FAT_DEFAULT_IOCHARSET="iso8859-1" | |
| 910 | +# CONFIG_NTFS_FS is not set | |
| 911 | + | |
| 912 | +# | |
| 913 | +# Pseudo filesystems | |
| 914 | +# | |
| 915 | +CONFIG_PROC_FS=y | |
| 916 | +# CONFIG_PROC_KCORE is not set | |
| 917 | +CONFIG_PROC_SYSCTL=y | |
| 918 | +CONFIG_SYSFS=y | |
| 919 | +CONFIG_TMPFS=y | |
| 920 | +# CONFIG_TMPFS_POSIX_ACL is not set | |
| 921 | +# CONFIG_HUGETLB_PAGE is not set | |
| 922 | +# CONFIG_CONFIGFS_FS is not set | |
| 923 | + | |
| 924 | +# | |
| 925 | +# Miscellaneous filesystems | |
| 926 | +# | |
| 927 | +# CONFIG_ADFS_FS is not set | |
| 928 | +# CONFIG_AFFS_FS is not set | |
| 929 | +# CONFIG_HFS_FS is not set | |
| 930 | +# CONFIG_HFSPLUS_FS is not set | |
| 931 | +# CONFIG_BEFS_FS is not set | |
| 932 | +# CONFIG_BFS_FS is not set | |
| 933 | +# CONFIG_EFS_FS is not set | |
| 934 | +CONFIG_JFFS2_FS=y | |
| 935 | +CONFIG_JFFS2_FS_DEBUG=0 | |
| 936 | +CONFIG_JFFS2_FS_WRITEBUFFER=y | |
| 937 | +# CONFIG_JFFS2_FS_WBUF_VERIFY is not set | |
| 938 | +# CONFIG_JFFS2_SUMMARY is not set | |
| 939 | +# CONFIG_JFFS2_FS_XATTR is not set | |
| 940 | +# CONFIG_JFFS2_COMPRESSION_OPTIONS is not set | |
| 941 | +CONFIG_JFFS2_ZLIB=y | |
| 942 | +# CONFIG_JFFS2_LZO is not set | |
| 943 | +CONFIG_JFFS2_RTIME=y | |
| 944 | +# CONFIG_JFFS2_RUBIN is not set | |
| 945 | +CONFIG_CRAMFS=y | |
| 946 | +# CONFIG_VXFS_FS is not set | |
| 947 | +# CONFIG_MINIX_FS is not set | |
| 948 | +# CONFIG_HPFS_FS is not set | |
| 949 | +# CONFIG_QNX4FS_FS is not set | |
| 950 | +# CONFIG_ROMFS_FS is not set | |
| 951 | +# CONFIG_SYSV_FS is not set | |
| 952 | +# CONFIG_UFS_FS is not set | |
| 953 | +CONFIG_NETWORK_FILESYSTEMS=y | |
| 954 | +CONFIG_NFS_FS=y | |
| 955 | +CONFIG_NFS_V3=y | |
| 956 | +# CONFIG_NFS_V3_ACL is not set | |
| 957 | +# CONFIG_NFS_V4 is not set | |
| 958 | +CONFIG_ROOT_NFS=y | |
| 959 | +CONFIG_NFSD=m | |
| 960 | +CONFIG_NFSD_V3=y | |
| 961 | +# CONFIG_NFSD_V3_ACL is not set | |
| 962 | +# CONFIG_NFSD_V4 is not set | |
| 963 | +CONFIG_LOCKD=y | |
| 964 | +CONFIG_LOCKD_V4=y | |
| 965 | +CONFIG_EXPORTFS=m | |
| 966 | +CONFIG_NFS_COMMON=y | |
| 967 | +CONFIG_SUNRPC=y | |
| 968 | +# CONFIG_RPCSEC_GSS_KRB5 is not set | |
| 969 | +# CONFIG_RPCSEC_GSS_SPKM3 is not set | |
| 970 | +# CONFIG_SMB_FS is not set | |
| 971 | +# CONFIG_CIFS is not set | |
| 972 | +# CONFIG_NCP_FS is not set | |
| 973 | +# CONFIG_CODA_FS is not set | |
| 974 | +# CONFIG_AFS_FS is not set | |
| 975 | + | |
| 976 | +# | |
| 977 | +# Partition Types | |
| 978 | +# | |
| 979 | +# CONFIG_PARTITION_ADVANCED is not set | |
| 980 | +CONFIG_MSDOS_PARTITION=y | |
| 981 | +CONFIG_NLS=y | |
| 982 | +CONFIG_NLS_DEFAULT="iso8859-1" | |
| 983 | +CONFIG_NLS_CODEPAGE_437=m | |
| 984 | +# CONFIG_NLS_CODEPAGE_737 is not set | |
| 985 | +# CONFIG_NLS_CODEPAGE_775 is not set | |
| 986 | +CONFIG_NLS_CODEPAGE_850=m | |
| 987 | +# CONFIG_NLS_CODEPAGE_852 is not set | |
| 988 | +# CONFIG_NLS_CODEPAGE_855 is not set | |
| 989 | +# CONFIG_NLS_CODEPAGE_857 is not set | |
| 990 | +# CONFIG_NLS_CODEPAGE_860 is not set | |
| 991 | +# CONFIG_NLS_CODEPAGE_861 is not set | |
| 992 | +# CONFIG_NLS_CODEPAGE_862 is not set | |
| 993 | +# CONFIG_NLS_CODEPAGE_863 is not set | |
| 994 | +# CONFIG_NLS_CODEPAGE_864 is not set | |
| 995 | +# CONFIG_NLS_CODEPAGE_865 is not set | |
| 996 | +# CONFIG_NLS_CODEPAGE_866 is not set | |
| 997 | +# CONFIG_NLS_CODEPAGE_869 is not set | |
| 998 | +# CONFIG_NLS_CODEPAGE_936 is not set | |
| 999 | +# CONFIG_NLS_CODEPAGE_950 is not set | |
| 1000 | +CONFIG_NLS_CODEPAGE_932=m | |
| 1001 | +# CONFIG_NLS_CODEPAGE_949 is not set | |
| 1002 | +# CONFIG_NLS_CODEPAGE_874 is not set | |
| 1003 | +# CONFIG_NLS_ISO8859_8 is not set | |
| 1004 | +# CONFIG_NLS_CODEPAGE_1250 is not set | |
| 1005 | +# CONFIG_NLS_CODEPAGE_1251 is not set | |
| 1006 | +CONFIG_NLS_ASCII=m | |
| 1007 | +CONFIG_NLS_ISO8859_1=m | |
| 1008 | +# CONFIG_NLS_ISO8859_2 is not set | |
| 1009 | +# CONFIG_NLS_ISO8859_3 is not set | |
| 1010 | +# CONFIG_NLS_ISO8859_4 is not set | |
| 1011 | +# CONFIG_NLS_ISO8859_5 is not set | |
| 1012 | +# CONFIG_NLS_ISO8859_6 is not set | |
| 1013 | +# CONFIG_NLS_ISO8859_7 is not set | |
| 1014 | +# CONFIG_NLS_ISO8859_9 is not set | |
| 1015 | +# CONFIG_NLS_ISO8859_13 is not set | |
| 1016 | +# CONFIG_NLS_ISO8859_14 is not set | |
| 1017 | +CONFIG_NLS_ISO8859_15=m | |
| 1018 | +# CONFIG_NLS_KOI8_R is not set | |
| 1019 | +# CONFIG_NLS_KOI8_U is not set | |
| 1020 | +CONFIG_NLS_UTF8=m | |
| 1021 | +# CONFIG_DLM is not set | |
| 1022 | + | |
| 1023 | +# | |
| 1024 | +# Kernel hacking | |
| 1025 | +# | |
| 1026 | +CONFIG_TRACE_IRQFLAGS_SUPPORT=y | |
| 1027 | +# CONFIG_PRINTK_TIME is not set | |
| 1028 | +CONFIG_ENABLE_WARN_DEPRECATED=y | |
| 1029 | +CONFIG_ENABLE_MUST_CHECK=y | |
| 1030 | +CONFIG_FRAME_WARN=1024 | |
| 1031 | +# CONFIG_MAGIC_SYSRQ is not set | |
| 1032 | +# CONFIG_UNUSED_SYMBOLS is not set | |
| 1033 | +# CONFIG_DEBUG_FS is not set | |
| 1034 | +# CONFIG_HEADERS_CHECK is not set | |
| 1035 | +# CONFIG_DEBUG_KERNEL is not set | |
| 1036 | +# CONFIG_SAMPLES is not set | |
| 1037 | +# CONFIG_KERNEL_TESTS is not set | |
| 1038 | +CONFIG_CMDLINE="" | |
| 1039 | + | |
| 1040 | +# | |
| 1041 | +# Security options | |
| 1042 | +# | |
| 1043 | +# CONFIG_KEYS is not set | |
| 1044 | +# CONFIG_SECURITY is not set | |
| 1045 | +# CONFIG_SECURITY_FILE_CAPABILITIES is not set | |
| 1046 | +CONFIG_CRYPTO=y | |
| 1047 | + | |
| 1048 | +# | |
| 1049 | +# Crypto core or helper | |
| 1050 | +# | |
| 1051 | +CONFIG_CRYPTO_ALGAPI=y | |
| 1052 | +CONFIG_CRYPTO_HASH=y | |
| 1053 | +CONFIG_CRYPTO_MANAGER=y | |
| 1054 | +# CONFIG_CRYPTO_GF128MUL is not set | |
| 1055 | +# CONFIG_CRYPTO_NULL is not set | |
| 1056 | +# CONFIG_CRYPTO_CRYPTD is not set | |
| 1057 | +# CONFIG_CRYPTO_AUTHENC is not set | |
| 1058 | +# CONFIG_CRYPTO_TEST is not set | |
| 1059 | + | |
| 1060 | +# | |
| 1061 | +# Authenticated Encryption with Associated Data | |
| 1062 | +# | |
| 1063 | +# CONFIG_CRYPTO_CCM is not set | |
| 1064 | +# CONFIG_CRYPTO_GCM is not set | |
| 1065 | +# CONFIG_CRYPTO_SEQIV is not set | |
| 1066 | + | |
| 1067 | +# | |
| 1068 | +# Block modes | |
| 1069 | +# | |
| 1070 | +# CONFIG_CRYPTO_CBC is not set | |
| 1071 | +# CONFIG_CRYPTO_CTR is not set | |
| 1072 | +# CONFIG_CRYPTO_CTS is not set | |
| 1073 | +# CONFIG_CRYPTO_ECB is not set | |
| 1074 | +# CONFIG_CRYPTO_LRW is not set | |
| 1075 | +# CONFIG_CRYPTO_PCBC is not set | |
| 1076 | +# CONFIG_CRYPTO_XTS is not set | |
| 1077 | + | |
| 1078 | +# | |
| 1079 | +# Hash modes | |
| 1080 | +# | |
| 1081 | +CONFIG_CRYPTO_HMAC=y | |
| 1082 | +# CONFIG_CRYPTO_XCBC is not set | |
| 1083 | + | |
| 1084 | +# | |
| 1085 | +# Digest | |
| 1086 | +# | |
| 1087 | +# CONFIG_CRYPTO_CRC32C is not set | |
| 1088 | +# CONFIG_CRYPTO_MD4 is not set | |
| 1089 | +CONFIG_CRYPTO_MD5=y | |
| 1090 | +# CONFIG_CRYPTO_MICHAEL_MIC is not set | |
| 1091 | +# CONFIG_CRYPTO_RMD128 is not set | |
| 1092 | +# CONFIG_CRYPTO_RMD160 is not set | |
| 1093 | +# CONFIG_CRYPTO_RMD256 is not set | |
| 1094 | +# CONFIG_CRYPTO_RMD320 is not set | |
| 1095 | +CONFIG_CRYPTO_SHA1=y | |
| 1096 | +# CONFIG_CRYPTO_SHA256 is not set | |
| 1097 | +# CONFIG_CRYPTO_SHA512 is not set | |
| 1098 | +# CONFIG_CRYPTO_TGR192 is not set | |
| 1099 | +# CONFIG_CRYPTO_WP512 is not set | |
| 1100 | + | |
| 1101 | +# | |
| 1102 | +# Ciphers | |
| 1103 | +# | |
| 1104 | +# CONFIG_CRYPTO_AES is not set | |
| 1105 | +# CONFIG_CRYPTO_ANUBIS is not set | |
| 1106 | +# CONFIG_CRYPTO_ARC4 is not set | |
| 1107 | +# CONFIG_CRYPTO_BLOWFISH is not set | |
| 1108 | +# CONFIG_CRYPTO_CAMELLIA is not set | |
| 1109 | +# CONFIG_CRYPTO_CAST5 is not set | |
| 1110 | +# CONFIG_CRYPTO_CAST6 is not set | |
| 1111 | +# CONFIG_CRYPTO_DES is not set | |
| 1112 | +# CONFIG_CRYPTO_FCRYPT is not set | |
| 1113 | +# CONFIG_CRYPTO_KHAZAD is not set | |
| 1114 | +# CONFIG_CRYPTO_SALSA20 is not set | |
| 1115 | +# CONFIG_CRYPTO_SEED is not set | |
| 1116 | +# CONFIG_CRYPTO_SERPENT is not set | |
| 1117 | +# CONFIG_CRYPTO_TEA is not set | |
| 1118 | +# CONFIG_CRYPTO_TWOFISH is not set | |
| 1119 | + | |
| 1120 | +# | |
| 1121 | +# Compression | |
| 1122 | +# | |
| 1123 | +# CONFIG_CRYPTO_DEFLATE is not set | |
| 1124 | +# CONFIG_CRYPTO_LZO is not set | |
| 1125 | + | |
| 1126 | +# | |
| 1127 | +# Random Number Generation | |
| 1128 | +# | |
| 1129 | +# CONFIG_CRYPTO_PRNG is not set | |
| 1130 | +CONFIG_CRYPTO_HW=y | |
| 1131 | + | |
| 1132 | +# | |
| 1133 | +# Library routines | |
| 1134 | +# | |
| 1135 | +CONFIG_BITREVERSE=y | |
| 1136 | +# CONFIG_GENERIC_FIND_FIRST_BIT is not set | |
| 1137 | +# CONFIG_CRC_CCITT is not set | |
| 1138 | +# CONFIG_CRC16 is not set | |
| 1139 | +# CONFIG_CRC_T10DIF is not set | |
| 1140 | +# CONFIG_CRC_ITU_T is not set | |
| 1141 | +CONFIG_CRC32=y | |
| 1142 | +# CONFIG_CRC7 is not set | |
| 1143 | +# CONFIG_LIBCRC32C is not set | |
| 1144 | +CONFIG_ZLIB_INFLATE=y | |
| 1145 | +CONFIG_ZLIB_DEFLATE=y | |
| 1146 | +CONFIG_PLIST=y | |
| 1147 | +CONFIG_HAS_IOMEM=y | |
| 1148 | +CONFIG_HAS_IOPORT=y | |
| 1149 | +CONFIG_HAS_DMA=y | |
| @@ -0,0 +1,29 @@ | ||
| 1 | +choice | |
| 2 | + prompt "Machine type" | |
| 3 | + depends on MACH_EMMA | |
| 4 | + default NEC_MARKEINS | |
| 5 | + | |
| 6 | +config NEC_MARKEINS | |
| 7 | + bool "NEC EMMA2RH Mark-eins board" | |
| 8 | + select SOC_EMMA2RH | |
| 9 | + select HW_HAS_PCI | |
| 10 | + help | |
| 11 | + This enables support for the NEC Electronics Mark-eins boards. | |
| 12 | + | |
| 13 | +endchoice | |
| 14 | + | |
| 15 | +config SOC_EMMA2RH | |
| 16 | + bool | |
| 17 | + select SOC_EMMA | |
| 18 | + select SYS_HAS_CPU_R5500 | |
| 19 | + select SYS_SUPPORTS_32BIT_KERNEL | |
| 20 | + select SYS_SUPPORTS_64BIT_KERNEL | |
| 21 | + | |
| 22 | +config SOC_EMMA | |
| 23 | + bool | |
| 24 | + select CEVT_R4K | |
| 25 | + select CSRC_R4K | |
| 26 | + select DMA_NONCOHERENT | |
| 27 | + select IRQ_CPU | |
| 28 | + select SWAP_IO_SPACE | |
| 29 | + select SYS_SUPPORTS_BIG_ENDIAN | |
| @@ -10,4 +10,4 @@ · 9 unmodified lines | ||
| 10 | 10 | # (at your option) any later version. |
| 11 | 11 | # |
| 12 | 12 | |
| 13 | −obj-$(CONFIG_MARKEINS) += irq.o irq_emma2rh.o prom.o | |
| 13 | +obj-$(CONFIG_NEC_MARKEINS) += prom.o | |
| @@ -29,11 +29,11 @@ · 28 unmodified lines | ||
| 29 | 29 | |
| 30 | 30 | #include <asm/addrspace.h> |
| 31 | 31 | #include <asm/bootinfo.h> |
| 32 | −#include <asm/emma2rh/emma2rh.h> | |
| 32 | +#include <asm/emma/emma2rh.h> | |
| 33 | 33 | |
| 34 | 34 | const char *get_system_type(void) |
| 35 | 35 | { |
| 36 | −#if defined(CONFIG_MARKEINS) | |
| 36 | +#ifdef CONFIG_NEC_MARKEINS | |
| 37 | 37 | return "NEC EMMA2RH Mark-eins"; |
| 38 | 38 | #else |
| 39 | 39 | #error Unknown NEC board |
| @@ -60,7 +60,7 @@ void __init prom_init(void) · 20 unmodified lines | ||
| 60 | 60 | strcat(arcs_cmdline, " "); |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | −#if defined(CONFIG_MARKEINS) | |
| 63 | +#ifdef CONFIG_NEC_MARKEINS | |
| 64 | 64 | add_memory_region(0, EMMA2RH_RAM_SIZE, BOOT_MEM_RAM); |
| 65 | 65 | #else |
| 66 | 66 | #error Unknown NEC board |
| @@ -10,4 +10,4 @@ · 9 unmodified lines | ||
| 10 | 10 | # (at your option) any later version. |
| 11 | 11 | # |
| 12 | 12 | |
| 13 | −obj-$(CONFIG_MARKEINS) += irq.o irq_markeins.o setup.o led.o platform.o | |
| 13 | +obj-$(CONFIG_NEC_MARKEINS) += irq.o setup.o led.o platform.o | |
| @@ -0,0 +1,331 @@ | ||
| 1 | +/* | |
| 2 | + * arch/mips/emma2rh/markeins/irq.c | |
| 3 | + * This file defines the irq handler for EMMA2RH. | |
| 4 | + * | |
| 5 | + * Copyright (C) NEC Electronics Corporation 2004-2006 | |
| 6 | + * | |
| 7 | + * This file is based on the arch/mips/ddb5xxx/ddb5477/irq.c | |
| 8 | + * | |
| 9 | + * Copyright 2001 MontaVista Software Inc. | |
| 10 | + * | |
| 11 | + * This program is free software; you can redistribute it and/or modify | |
| 12 | + * it under the terms of the GNU General Public License as published by | |
| 13 | + * the Free Software Foundation; either version 2 of the License, or | |
| 14 | + * (at your option) any later version. | |
| 15 | + * | |
| 16 | + * This program is distributed in the hope that it will be useful, | |
| 17 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 18 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 19 | + * GNU General Public License for more details. | |
| 20 | + * | |
| 21 | + * You should have received a copy of the GNU General Public License | |
| 22 | + * along with this program; if not, write to the Free Software | |
| 23 | + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 24 | + */ | |
| 25 | +#include <linux/init.h> | |
| 26 | +#include <linux/interrupt.h> | |
| 27 | +#include <linux/irq.h> | |
| 28 | +#include <linux/types.h> | |
| 29 | +#include <linux/ptrace.h> | |
| 30 | +#include <linux/delay.h> | |
| 31 | + | |
| 32 | +#include <asm/irq_cpu.h> | |
| 33 | +#include <asm/system.h> | |
| 34 | +#include <asm/mipsregs.h> | |
| 35 | +#include <asm/addrspace.h> | |
| 36 | +#include <asm/bootinfo.h> | |
| 37 | + | |
| 38 | +#include <asm/emma/emma2rh.h> | |
| 39 | + | |
| 40 | +static void emma2rh_irq_enable(unsigned int irq) | |
| 41 | +{ | |
| 42 | + u32 reg_value; | |
| 43 | + u32 reg_bitmask; | |
| 44 | + u32 reg_index; | |
| 45 | + | |
| 46 | + irq -= EMMA2RH_IRQ_BASE; | |
| 47 | + | |
| 48 | + reg_index = EMMA2RH_BHIF_INT_EN_0 + | |
| 49 | + (EMMA2RH_BHIF_INT_EN_1 - EMMA2RH_BHIF_INT_EN_0) * (irq / 32); | |
| 50 | + reg_value = emma2rh_in32(reg_index); | |
| 51 | + reg_bitmask = 0x1 << (irq % 32); | |
| 52 | + emma2rh_out32(reg_index, reg_value | reg_bitmask); | |
| 53 | +} | |
| 54 | + | |
| 55 | +static void emma2rh_irq_disable(unsigned int irq) | |
| 56 | +{ | |
| 57 | + u32 reg_value; | |
| 58 | + u32 reg_bitmask; | |
| 59 | + u32 reg_index; | |
| 60 | + | |
| 61 | + irq -= EMMA2RH_IRQ_BASE; | |
| 62 | + | |
| 63 | + reg_index = EMMA2RH_BHIF_INT_EN_0 + | |
| 64 | + (EMMA2RH_BHIF_INT_EN_1 - EMMA2RH_BHIF_INT_EN_0) * (irq / 32); | |
| 65 | + reg_value = emma2rh_in32(reg_index); | |
| 66 | + reg_bitmask = 0x1 << (irq % 32); | |
| 67 | + emma2rh_out32(reg_index, reg_value & ~reg_bitmask); | |
| 68 | +} | |
| 69 | + | |
| 70 | +struct irq_chip emma2rh_irq_controller = { | |
| 71 | + .name = "emma2rh_irq", | |
| 72 | + .ack = emma2rh_irq_disable, | |
| 73 | + .mask = emma2rh_irq_disable, | |
| 74 | + .mask_ack = emma2rh_irq_disable, | |
| 75 | + .unmask = emma2rh_irq_enable, | |
| 76 | +}; | |
| 77 | + | |
| 78 | +void emma2rh_irq_init(void) | |
| 79 | +{ | |
| 80 | + u32 i; | |
| 81 | + | |
| 82 | + for (i = 0; i < NUM_EMMA2RH_IRQ; i++) | |
| 83 | + set_irq_chip_and_handler(EMMA2RH_IRQ_BASE + i, | |
| 84 | + &emma2rh_irq_controller, | |
| 85 | + handle_level_irq); | |
| 86 | +} | |
| 87 | + | |
| 88 | +static void emma2rh_sw_irq_enable(unsigned int irq) | |
| 89 | +{ | |
| 90 | + u32 reg; | |
| 91 | + | |
| 92 | + irq -= EMMA2RH_SW_IRQ_BASE; | |
| 93 | + | |
| 94 | + reg = emma2rh_in32(EMMA2RH_BHIF_SW_INT_EN); | |
| 95 | + reg |= 1 << irq; | |
| 96 | + emma2rh_out32(EMMA2RH_BHIF_SW_INT_EN, reg); | |
| 97 | +} | |
| 98 | + | |
| 99 | +static void emma2rh_sw_irq_disable(unsigned int irq) | |
| 100 | +{ | |
| 101 | + u32 reg; | |
| 102 | + | |
| 103 | + irq -= EMMA2RH_SW_IRQ_BASE; | |
| 104 | + | |
| 105 | + reg = emma2rh_in32(EMMA2RH_BHIF_SW_INT_EN); | |
| 106 | + reg &= ~(1 << irq); | |
| 107 | + emma2rh_out32(EMMA2RH_BHIF_SW_INT_EN, reg); | |
| 108 | +} | |
| 109 | + | |
| 110 | +struct irq_chip emma2rh_sw_irq_controller = { | |
| 111 | + .name = "emma2rh_sw_irq", | |
| 112 | + .ack = emma2rh_sw_irq_disable, | |
| 113 | + .mask = emma2rh_sw_irq_disable, | |
| 114 | + .mask_ack = emma2rh_sw_irq_disable, | |
| 115 | + .unmask = emma2rh_sw_irq_enable, | |
| 116 | +}; | |
| 117 | + | |
| 118 | +void emma2rh_sw_irq_init(void) | |
| 119 | +{ | |
| 120 | + u32 i; | |
| 121 | + | |
| 122 | + for (i = 0; i < NUM_EMMA2RH_IRQ_SW; i++) | |
| 123 | + set_irq_chip_and_handler(EMMA2RH_SW_IRQ_BASE + i, | |
| 124 | + &emma2rh_sw_irq_controller, | |
| 125 | + handle_level_irq); | |
| 126 | +} | |
| 127 | + | |
| 128 | +static void emma2rh_gpio_irq_enable(unsigned int irq) | |
| 129 | +{ | |
| 130 | + u32 reg; | |
| 131 | + | |
| 132 | + irq -= EMMA2RH_GPIO_IRQ_BASE; | |
| 133 | + | |
| 134 | + reg = emma2rh_in32(EMMA2RH_GPIO_INT_MASK); | |
| 135 | + reg |= 1 << irq; | |
| 136 | + emma2rh_out32(EMMA2RH_GPIO_INT_MASK, reg); | |
| 137 | +} | |
| 138 | + | |
| 139 | +static void emma2rh_gpio_irq_disable(unsigned int irq) | |
| 140 | +{ | |
| 141 | + u32 reg; | |
| 142 | + | |
| 143 | + irq -= EMMA2RH_GPIO_IRQ_BASE; | |
| 144 | + | |
| 145 | + reg = emma2rh_in32(EMMA2RH_GPIO_INT_MASK); | |
| 146 | + reg &= ~(1 << irq); | |
| 147 | + emma2rh_out32(EMMA2RH_GPIO_INT_MASK, reg); | |
| 148 | +} | |
| 149 | + | |
| 150 | +static void emma2rh_gpio_irq_ack(unsigned int irq) | |
| 151 | +{ | |
| 152 | + u32 reg; | |
| 153 | + | |
| 154 | + irq -= EMMA2RH_GPIO_IRQ_BASE; | |
| 155 | + emma2rh_out32(EMMA2RH_GPIO_INT_ST, ~(1 << irq)); | |
| 156 | + | |
| 157 | + reg = emma2rh_in32(EMMA2RH_GPIO_INT_MASK); | |
| 158 | + reg &= ~(1 << irq); | |
| 159 | + emma2rh_out32(EMMA2RH_GPIO_INT_MASK, reg); | |
| 160 | +} | |
| 161 | + | |
| 162 | +static void emma2rh_gpio_irq_end(unsigned int irq) | |
| 163 | +{ | |
| 164 | + u32 reg; | |
| 165 | + | |
| 166 | + if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) { | |
| 167 | + | |
| 168 | + irq -= EMMA2RH_GPIO_IRQ_BASE; | |
| 169 | + | |
| 170 | + reg = emma2rh_in32(EMMA2RH_GPIO_INT_MASK); | |
| 171 | + reg |= 1 << irq; | |
| 172 | + emma2rh_out32(EMMA2RH_GPIO_INT_MASK, reg); | |
| 173 | + } | |
| 174 | +} | |
| 175 | + | |
| 176 | +struct irq_chip emma2rh_gpio_irq_controller = { | |
| 177 | + .name = "emma2rh_gpio_irq", | |
| 178 | + .ack = emma2rh_gpio_irq_ack, | |
| 179 | + .mask = emma2rh_gpio_irq_disable, | |
| 180 | + .mask_ack = emma2rh_gpio_irq_ack, | |
| 181 | + .unmask = emma2rh_gpio_irq_enable, | |
| 182 | + .end = emma2rh_gpio_irq_end, | |
| 183 | +}; | |
| 184 | + | |
| 185 | +void emma2rh_gpio_irq_init(void) | |
| 186 | +{ | |
| 187 | + u32 i; | |
| 188 | + | |
| 189 | + for (i = 0; i < NUM_EMMA2RH_IRQ_GPIO; i++) | |
| 190 | + set_irq_chip(EMMA2RH_GPIO_IRQ_BASE + i, | |
| 191 | + &emma2rh_gpio_irq_controller); | |
| 192 | +} | |
| 193 | + | |
| 194 | +static struct irqaction irq_cascade = { | |
| 195 | + .handler = no_action, | |
| 196 | + .flags = 0, | |
| 197 | + .mask = CPU_MASK_NONE, | |
| 198 | + .name = "cascade", | |
| 199 | + .dev_id = NULL, | |
| 200 | + .next = NULL, | |
| 201 | +}; | |
| 202 | + | |
| 203 | +/* | |
| 204 | + * the first level int-handler will jump here if it is a emma2rh irq | |
| 205 | + */ | |
| 206 | +void emma2rh_irq_dispatch(void) | |
| 207 | +{ | |
| 208 | + u32 intStatus; | |
| 209 | + u32 bitmask; | |
| 210 | + u32 i; | |
| 211 | + | |
| 212 | + intStatus = emma2rh_in32(EMMA2RH_BHIF_INT_ST_0) & | |
| 213 | + emma2rh_in32(EMMA2RH_BHIF_INT_EN_0); | |
| 214 | + | |
| 215 | +#ifdef EMMA2RH_SW_CASCADE | |
| 216 | + if (intStatus & | |
| 217 | + (1 << ((EMMA2RH_SW_CASCADE - EMMA2RH_IRQ_INT0) & (32 - 1)))) { | |
| 218 | + u32 swIntStatus; | |
| 219 | + swIntStatus = emma2rh_in32(EMMA2RH_BHIF_SW_INT) | |
| 220 | + & emma2rh_in32(EMMA2RH_BHIF_SW_INT_EN); | |
| 221 | + for (i = 0, bitmask = 1; i < 32; i++, bitmask <<= 1) { | |
| 222 | + if (swIntStatus & bitmask) { | |
| 223 | + do_IRQ(EMMA2RH_SW_IRQ_BASE + i); | |
| 224 | + return; | |
| 225 | + } | |
| 226 | + } | |
| 227 | + } | |
| 228 | +#endif | |
| 229 | + | |
| 230 | + for (i = 0, bitmask = 1; i < 32; i++, bitmask <<= 1) { | |
| 231 | + if (intStatus & bitmask) { | |
| 232 | + do_IRQ(EMMA2RH_IRQ_BASE + i); | |
| 233 | + return; | |
| 234 | + } | |
| 235 | + } | |
| 236 | + | |
| 237 | + intStatus = emma2rh_in32(EMMA2RH_BHIF_INT_ST_1) & | |
| 238 | + emma2rh_in32(EMMA2RH_BHIF_INT_EN_1); | |
| 239 | + | |
| 240 | +#ifdef EMMA2RH_GPIO_CASCADE | |
| 241 | + if (intStatus & | |
| 242 | + (1 << ((EMMA2RH_GPIO_CASCADE - EMMA2RH_IRQ_INT0) & (32 - 1)))) { | |
| 243 | + u32 gpioIntStatus; | |
| 244 | + gpioIntStatus = emma2rh_in32(EMMA2RH_GPIO_INT_ST) | |
| 245 | + & emma2rh_in32(EMMA2RH_GPIO_INT_MASK); | |
| 246 | + for (i = 0, bitmask = 1; i < 32; i++, bitmask <<= 1) { | |
| 247 | + if (gpioIntStatus & bitmask) { | |
| 248 | + do_IRQ(EMMA2RH_GPIO_IRQ_BASE + i); | |
| 249 | + return; | |
| 250 | + } | |
| 251 | + } | |
| 252 | + } | |
| 253 | +#endif | |
| 254 | + | |
| 255 | + for (i = 32, bitmask = 1; i < 64; i++, bitmask <<= 1) { | |
| 256 | + if (intStatus & bitmask) { | |
| 257 | + do_IRQ(EMMA2RH_IRQ_BASE + i); | |
| 258 | + return; | |
| 259 | + } | |
| 260 | + } | |
| 261 | + | |
| 262 | + intStatus = emma2rh_in32(EMMA2RH_BHIF_INT_ST_2) & | |
| 263 | + emma2rh_in32(EMMA2RH_BHIF_INT_EN_2); | |
| 264 | + | |
| 265 | + for (i = 64, bitmask = 1; i < 96; i++, bitmask <<= 1) { | |
| 266 | + if (intStatus & bitmask) { | |
| 267 | + do_IRQ(EMMA2RH_IRQ_BASE + i); | |
| 268 | + return; | |
| 269 | + } | |
| 270 | + } | |
| 271 | +} | |
| 272 | + | |
| 273 | +void __init arch_init_irq(void) | |
| 274 | +{ | |
| 275 | + u32 reg; | |
| 276 | + | |
| 277 | + /* by default, interrupts are disabled. */ | |
| 278 | + emma2rh_out32(EMMA2RH_BHIF_INT_EN_0, 0); | |
| 279 | + emma2rh_out32(EMMA2RH_BHIF_INT_EN_1, 0); | |
| 280 | + emma2rh_out32(EMMA2RH_BHIF_INT_EN_2, 0); | |
| 281 | + emma2rh_out32(EMMA2RH_BHIF_INT1_EN_0, 0); | |
| 282 | + emma2rh_out32(EMMA2RH_BHIF_INT1_EN_1, 0); | |
| 283 | + emma2rh_out32(EMMA2RH_BHIF_INT1_EN_2, 0); | |
| 284 | + emma2rh_out32(EMMA2RH_BHIF_SW_INT_EN, 0); | |
| 285 | + | |
| 286 | + clear_c0_status(0xff00); | |
| 287 | + set_c0_status(0x0400); | |
| 288 | + | |
| 289 | +#define GPIO_PCI (0xf<<15) | |
| 290 | + /* setup GPIO interrupt for PCI interface */ | |
| 291 | + /* direction input */ | |
| 292 | + reg = emma2rh_in32(EMMA2RH_GPIO_DIR); | |
| 293 | + emma2rh_out32(EMMA2RH_GPIO_DIR, reg & ~GPIO_PCI); | |
| 294 | + /* disable interrupt */ | |
| 295 | + reg = emma2rh_in32(EMMA2RH_GPIO_INT_MASK); | |
| 296 | + emma2rh_out32(EMMA2RH_GPIO_INT_MASK, reg & ~GPIO_PCI); | |
| 297 | + /* level triggerd */ | |
| 298 | + reg = emma2rh_in32(EMMA2RH_GPIO_INT_MODE); | |
| 299 | + emma2rh_out32(EMMA2RH_GPIO_INT_MODE, reg | GPIO_PCI); | |
| 300 | + reg = emma2rh_in32(EMMA2RH_GPIO_INT_CND_A); | |
| 301 | + emma2rh_out32(EMMA2RH_GPIO_INT_CND_A, reg & (~GPIO_PCI)); | |
| 302 | + /* interrupt clear */ | |
| 303 | + emma2rh_out32(EMMA2RH_GPIO_INT_ST, ~GPIO_PCI); | |
| 304 | + | |
| 305 | + /* init all controllers */ | |
| 306 | + emma2rh_irq_init(); | |
| 307 | + emma2rh_sw_irq_init(); | |
| 308 | + emma2rh_gpio_irq_init(); | |
| 309 | + mips_cpu_irq_init(); | |
| 310 | + | |
| 311 | + /* setup cascade interrupts */ | |
| 312 | + setup_irq(EMMA2RH_IRQ_BASE + EMMA2RH_SW_CASCADE, &irq_cascade); | |
| 313 | + setup_irq(EMMA2RH_IRQ_BASE + EMMA2RH_GPIO_CASCADE, &irq_cascade); | |
| 314 | + setup_irq(CPU_IRQ_BASE + CPU_EMMA2RH_CASCADE, &irq_cascade); | |
| 315 | +} | |
| 316 | + | |
| 317 | +asmlinkage void plat_irq_dispatch(void) | |
| 318 | +{ | |
| 319 | + unsigned int pending = read_c0_status() & read_c0_cause() & ST0_IM; | |
| 320 | + | |
| 321 | + if (pending & STATUSF_IP7) | |
| 322 | + do_IRQ(CPU_IRQ_BASE + 7); | |
| 323 | + else if (pending & STATUSF_IP2) | |
| 324 | + emma2rh_irq_dispatch(); | |
| 325 | + else if (pending & STATUSF_IP1) | |
| 326 | + do_IRQ(CPU_IRQ_BASE + 1); | |
| 327 | + else if (pending & STATUSF_IP0) | |
| 328 | + do_IRQ(CPU_IRQ_BASE + 0); | |
| 329 | + else | |
| 330 | + spurious_interrupt(); | |
| 331 | +} | |
| @@ -21,7 +21,7 @@ · 20 unmodified lines | ||
| 21 | 21 | #include <linux/kernel.h> |
| 22 | 22 | #include <linux/types.h> |
| 23 | 23 | #include <linux/string.h> |
| 24 | −#include <asm/emma2rh/emma2rh.h> | |
| 24 | +#include <asm/emma/emma2rh.h> | |
| 25 | 25 | |
| 26 | 26 | const unsigned long clear = 0x20202020; |
| 27 | 27 | |
| @@ -36,7 +36,7 @@ · 35 unmodified lines | ||
| 36 | 36 | #include <asm/reboot.h> |
| 37 | 37 | #include <asm/traps.h> |
| 38 | 38 | |
| 39 | −#include <asm/emma2rh/emma2rh.h> | |
| 39 | +#include <asm/emma/emma2rh.h> | |
| 40 | 40 | |
| 41 | 41 | |
| 42 | 42 | #define I2C_EMMA2RH "emma2rh-iic" /* must be in sync with IIC driver */ |
| @@ -29,7 +29,7 @@ · 28 unmodified lines | ||
| 29 | 29 | #include <asm/time.h> |
| 30 | 30 | #include <asm/reboot.h> |
| 31 | 31 | |
| 32 | −#include <asm/emma2rh/emma2rh.h> | |
| 32 | +#include <asm/emma/emma2rh.h> | |
| 33 | 33 | |
| 34 | 34 | #define USE_CPU_COUNTER_TIMER /* whether we use cpu counter */ |
| 35 | 35 | |
| @@ -1,105 +0,0 @@ | ||
| 1 | −/* | |
| 2 | − * arch/mips/emma2rh/common/irq.c | |
| 3 | − * This file is common irq dispatcher. | |
| 4 | − * | |
| 5 | − * Copyright (C) NEC Electronics Corporation 2005-2006 | |
| 6 | − * | |
| 7 | − * This file is based on the arch/mips/ddb5xxx/ddb5477/irq.c | |
| 8 | − * | |
| 9 | − * Copyright 2001 MontaVista Software Inc. | |
| 10 | − * | |
| 11 | − * This program is free software; you can redistribute it and/or modify | |
| 12 | − * it under the terms of the GNU General Public License as published by | |
| 13 | − * the Free Software Foundation; either version 2 of the License, or | |
| 14 | − * (at your option) any later version. | |
| 15 | − * | |
| 16 | − * This program is distributed in the hope that it will be useful, | |
| 17 | − * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 18 | − * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 19 | − * GNU General Public License for more details. | |
| 20 | − * | |
| 21 | − * You should have received a copy of the GNU General Public License | |
| 22 | − * along with this program; if not, write to the Free Software | |
| 23 | − * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 24 | − */ | |
| 25 | −#include <linux/init.h> | |
| 26 | −#include <linux/interrupt.h> | |
| 27 | −#include <linux/irq.h> | |
| 28 | −#include <linux/types.h> | |
| 29 | − | |
| 30 | −#include <asm/system.h> | |
| 31 | −#include <asm/mipsregs.h> | |
| 32 | −#include <asm/addrspace.h> | |
| 33 | −#include <asm/bootinfo.h> | |
| 34 | − | |
| 35 | −#include <asm/emma2rh/emma2rh.h> | |
| 36 | − | |
| 37 | −/* | |
| 38 | − * the first level int-handler will jump here if it is a emma2rh irq | |
| 39 | − */ | |
| 40 | −void emma2rh_irq_dispatch(void) | |
| 41 | −{ | |
| 42 | − u32 intStatus; | |
| 43 | − u32 bitmask; | |
| 44 | − u32 i; | |
| 45 | − | |
| 46 | − intStatus = emma2rh_in32(EMMA2RH_BHIF_INT_ST_0) | |
| 47 | − & emma2rh_in32(EMMA2RH_BHIF_INT_EN_0); | |
| 48 | − | |
| 49 | −#ifdef EMMA2RH_SW_CASCADE | |
| 50 | − if (intStatus & | |
| 51 | − (1 << ((EMMA2RH_SW_CASCADE - EMMA2RH_IRQ_INT0) & (32 - 1)))) { | |
| 52 | − u32 swIntStatus; | |
| 53 | − swIntStatus = emma2rh_in32(EMMA2RH_BHIF_SW_INT) | |
| 54 | − & emma2rh_in32(EMMA2RH_BHIF_SW_INT_EN); | |
| 55 | − for (i = 0, bitmask = 1; i < 32; i++, bitmask <<= 1) { | |
| 56 | − if (swIntStatus & bitmask) { | |
| 57 | − do_IRQ(EMMA2RH_SW_IRQ_BASE + i); | |
| 58 | − return; | |
| 59 | − } | |
| 60 | − } | |
| 61 | − } | |
| 62 | −#endif | |
| 63 | − | |
| 64 | − for (i = 0, bitmask = 1; i < 32; i++, bitmask <<= 1) { | |
| 65 | − if (intStatus & bitmask) { | |
| 66 | − do_IRQ(EMMA2RH_IRQ_BASE + i); | |
| 67 | − return; | |
| 68 | − } | |
| 69 | − } | |
| 70 | − | |
| 71 | − intStatus = emma2rh_in32(EMMA2RH_BHIF_INT_ST_1) | |
| 72 | − & emma2rh_in32(EMMA2RH_BHIF_INT_EN_1); | |
| 73 | − | |
| 74 | −#ifdef EMMA2RH_GPIO_CASCADE | |
| 75 | − if (intStatus & | |
| 76 | − (1 << ((EMMA2RH_GPIO_CASCADE - EMMA2RH_IRQ_INT0) & (32 - 1)))) { | |
| 77 | − u32 gpioIntStatus; | |
| 78 | − gpioIntStatus = emma2rh_in32(EMMA2RH_GPIO_INT_ST) | |
| 79 | − & emma2rh_in32(EMMA2RH_GPIO_INT_MASK); | |
| 80 | − for (i = 0, bitmask = 1; i < 32; i++, bitmask <<= 1) { | |
| 81 | − if (gpioIntStatus & bitmask) { | |
| 82 | − do_IRQ(EMMA2RH_GPIO_IRQ_BASE + i); | |
| 83 | − return; | |
| 84 | − } | |
| 85 | − } | |
| 86 | − } | |
| 87 | −#endif | |
| 88 | − | |
| 89 | − for (i = 32, bitmask = 1; i < 64; i++, bitmask <<= 1) { | |
| 90 | − if (intStatus & bitmask) { | |
| 91 | − do_IRQ(EMMA2RH_IRQ_BASE + i); | |
| 92 | − return; | |
| 93 | − } | |
| 94 | − } | |
| 95 | − | |
| 96 | − intStatus = emma2rh_in32(EMMA2RH_BHIF_INT_ST_2) | |
| 97 | − & emma2rh_in32(EMMA2RH_BHIF_INT_EN_2); | |
| 98 | − | |
| 99 | − for (i = 64, bitmask = 1; i < 96; i++, bitmask <<= 1) { | |
| 100 | − if (intStatus & bitmask) { | |
| 101 | − do_IRQ(EMMA2RH_IRQ_BASE + i); | |
| 102 | − return; | |
| 103 | − } | |
| 104 | − } | |
| 105 | −} | |
| @@ -1,106 +0,0 @@ | ||
| 1 | −/* | |
| 2 | − * arch/mips/emma2rh/common/irq_emma2rh.c | |
| 3 | − * This file defines the irq handler for EMMA2RH. | |
| 4 | − * | |
| 5 | − * Copyright (C) NEC Electronics Corporation 2005-2006 | |
| 6 | − * | |
| 7 | − * This file is based on the arch/mips/ddb5xxx/ddb5477/irq_5477.c | |
| 8 | − * | |
| 9 | − * Copyright 2001 MontaVista Software Inc. | |
| 10 | − * | |
| 11 | − * This program is free software; you can redistribute it and/or modify | |
| 12 | − * it under the terms of the GNU General Public License as published by | |
| 13 | − * the Free Software Foundation; either version 2 of the License, or | |
| 14 | − * (at your option) any later version. | |
| 15 | − * | |
| 16 | − * This program is distributed in the hope that it will be useful, | |
| 17 | − * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 18 | − * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 19 | − * GNU General Public License for more details. | |
| 20 | − * | |
| 21 | − * You should have received a copy of the GNU General Public License | |
| 22 | − * along with this program; if not, write to the Free Software | |
| 23 | − * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 24 | − */ | |
| 25 | − | |
| 26 | −/* | |
| 27 | − * EMMA2RH defines 64 IRQs. | |
| 28 | − * | |
| 29 | − * This file exports one function: | |
| 30 | − * emma2rh_irq_init(u32 irq_base); | |
| 31 | − */ | |
| 32 | − | |
| 33 | −#include <linux/interrupt.h> | |
| 34 | −#include <linux/types.h> | |
| 35 | −#include <linux/ptrace.h> | |
| 36 | − | |
| 37 | −#include <asm/debug.h> | |
| 38 | − | |
| 39 | −#include <asm/emma2rh/emma2rh.h> | |
| 40 | − | |
| 41 | −/* number of total irqs supported by EMMA2RH */ | |
| 42 | −#define NUM_EMMA2RH_IRQ 96 | |
| 43 | − | |
| 44 | −static int emma2rh_irq_base = -1; | |
| 45 | − | |
| 46 | −void ll_emma2rh_irq_enable(int); | |
| 47 | −void ll_emma2rh_irq_disable(int); | |
| 48 | − | |
| 49 | −static void emma2rh_irq_enable(unsigned int irq) | |
| 50 | −{ | |
| 51 | − ll_emma2rh_irq_enable(irq - emma2rh_irq_base); | |
| 52 | −} | |
| 53 | − | |
| 54 | −static void emma2rh_irq_disable(unsigned int irq) | |
| 55 | −{ | |
| 56 | − ll_emma2rh_irq_disable(irq - emma2rh_irq_base); | |
| 57 | −} | |
| 58 | − | |
| 59 | −struct irq_chip emma2rh_irq_controller = { | |
| 60 | − .name = "emma2rh_irq", | |
| 61 | − .ack = emma2rh_irq_disable, | |
| 62 | − .mask = emma2rh_irq_disable, | |
| 63 | − .mask_ack = emma2rh_irq_disable, | |
| 64 | − .unmask = emma2rh_irq_enable, | |
| 65 | −}; | |
| 66 | − | |
| 67 | −void emma2rh_irq_init(u32 irq_base) | |
| 68 | −{ | |
| 69 | − u32 i; | |
| 70 | − | |
| 71 | − for (i = irq_base; i < irq_base + NUM_EMMA2RH_IRQ; i++) | |
| 72 | − set_irq_chip_and_handler(i, &emma2rh_irq_controller, | |
| 73 | − handle_level_irq); | |
| 74 | − | |
| 75 | − emma2rh_irq_base = irq_base; | |
| 76 | −} | |
| 77 | − | |
| 78 | −void ll_emma2rh_irq_enable(int emma2rh_irq) | |
| 79 | −{ | |
| 80 | − u32 reg_value; | |
| 81 | − u32 reg_bitmask; | |
| 82 | − u32 reg_index; | |
| 83 | − | |
| 84 | − reg_index = EMMA2RH_BHIF_INT_EN_0 | |
| 85 | − + (EMMA2RH_BHIF_INT_EN_1 - EMMA2RH_BHIF_INT_EN_0) | |
| 86 | − * (emma2rh_irq / 32); | |
| 87 | − reg_value = emma2rh_in32(reg_index); | |
| 88 | − reg_bitmask = 0x1 << (emma2rh_irq % 32); | |
| 89 | − db_assert((reg_value & reg_bitmask) == 0); | |
| 90 | − emma2rh_out32(reg_index, reg_value | reg_bitmask); | |
| 91 | −} | |
| 92 | − | |
| 93 | −void ll_emma2rh_irq_disable(int emma2rh_irq) | |
| 94 | −{ | |
| 95 | − u32 reg_value; | |
| 96 | − u32 reg_bitmask; | |
| 97 | − u32 reg_index; | |
| 98 | − | |
| 99 | − reg_index = EMMA2RH_BHIF_INT_EN_0 | |
| 100 | − + (EMMA2RH_BHIF_INT_EN_1 - EMMA2RH_BHIF_INT_EN_0) | |
| 101 | − * (emma2rh_irq / 32); | |
| 102 | − reg_value = emma2rh_in32(reg_index); | |
| 103 | − reg_bitmask = 0x1 << (emma2rh_irq % 32); | |
| 104 | − db_assert((reg_value & reg_bitmask) != 0); | |
| 105 | − emma2rh_out32(reg_index, reg_value & ~reg_bitmask); | |
| 106 | −} | |
| @@ -1,132 +0,0 @@ | ||
| 1 | −/* | |
| 2 | − * arch/mips/emma2rh/markeins/irq.c | |
| 3 | − * This file defines the irq handler for EMMA2RH. | |
| 4 | − * | |
| 5 | − * Copyright (C) NEC Electronics Corporation 2004-2006 | |
| 6 | − * | |
| 7 | − * This file is based on the arch/mips/ddb5xxx/ddb5477/irq.c | |
| 8 | − * | |
| 9 | − * Copyright 2001 MontaVista Software Inc. | |
| 10 | − * | |
| 11 | − * This program is free software; you can redistribute it and/or modify | |
| 12 | − * it under the terms of the GNU General Public License as published by | |
| 13 | − * the Free Software Foundation; either version 2 of the License, or | |
| 14 | − * (at your option) any later version. | |
| 15 | − * | |
| 16 | − * This program is distributed in the hope that it will be useful, | |
| 17 | − * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 18 | − * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 19 | − * GNU General Public License for more details. | |
| 20 | − * | |
| 21 | − * You should have received a copy of the GNU General Public License | |
| 22 | − * along with this program; if not, write to the Free Software | |
| 23 | − * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 24 | − */ | |
| 25 | −#include <linux/init.h> | |
| 26 | −#include <linux/interrupt.h> | |
| 27 | −#include <linux/irq.h> | |
| 28 | −#include <linux/types.h> | |
| 29 | −#include <linux/ptrace.h> | |
| 30 | −#include <linux/delay.h> | |
| 31 | − | |
| 32 | −#include <asm/irq_cpu.h> | |
| 33 | −#include <asm/system.h> | |
| 34 | −#include <asm/mipsregs.h> | |
| 35 | −#include <asm/debug.h> | |
| 36 | −#include <asm/addrspace.h> | |
| 37 | −#include <asm/bootinfo.h> | |
| 38 | − | |
| 39 | −#include <asm/emma2rh/emma2rh.h> | |
| 40 | − | |
| 41 | −/* | |
| 42 | − * IRQ mapping | |
| 43 | − * | |
| 44 | − * 0-7: 8 CPU interrupts | |
| 45 | − * 0 - software interrupt 0 | |
| 46 | − * 1 - software interrupt 1 | |
| 47 | − * 2 - most Vrc5477 interrupts are routed to this pin | |
| 48 | − * 3 - (optional) some other interrupts routed to this pin for debugg | |
| 49 | − * 4 - not used | |
| 50 | − * 5 - not used | |
| 51 | − * 6 - not used | |
| 52 | − * 7 - cpu timer (used by default) | |
| 53 | − * | |
| 54 | − */ | |
| 55 | − | |
| 56 | −extern void emma2rh_sw_irq_init(u32 base); | |
| 57 | −extern void emma2rh_gpio_irq_init(u32 base); | |
| 58 | −extern void emma2rh_irq_init(u32 base); | |
| 59 | −extern void emma2rh_irq_dispatch(void); | |
| 60 | − | |
| 61 | −static struct irqaction irq_cascade = { | |
| 62 | − .handler = no_action, | |
| 63 | − .flags = 0, | |
| 64 | − .mask = CPU_MASK_NONE, | |
| 65 | − .name = "cascade", | |
| 66 | − .dev_id = NULL, | |
| 67 | − .next = NULL, | |
| 68 | −}; | |
| 69 | − | |
| 70 | −void __init arch_init_irq(void) | |
| 71 | −{ | |
| 72 | − u32 reg; | |
| 73 | − | |
| 74 | − db_run(printk("markeins_irq_setup invoked.\n")); | |
| 75 | − | |
| 76 | − /* by default, interrupts are disabled. */ | |
| 77 | − emma2rh_out32(EMMA2RH_BHIF_INT_EN_0, 0); | |
| 78 | − emma2rh_out32(EMMA2RH_BHIF_INT_EN_1, 0); | |
| 79 | − emma2rh_out32(EMMA2RH_BHIF_INT_EN_2, 0); | |
| 80 | − emma2rh_out32(EMMA2RH_BHIF_INT1_EN_0, 0); | |
| 81 | − emma2rh_out32(EMMA2RH_BHIF_INT1_EN_1, 0); | |
| 82 | − emma2rh_out32(EMMA2RH_BHIF_INT1_EN_2, 0); | |
| 83 | − emma2rh_out32(EMMA2RH_BHIF_SW_INT_EN, 0); | |
| 84 | − | |
| 85 | − clear_c0_status(0xff00); | |
| 86 | − set_c0_status(0x0400); | |
| 87 | − | |
| 88 | −#define GPIO_PCI (0xf<<15) | |
| 89 | − /* setup GPIO interrupt for PCI interface */ | |
| 90 | − /* direction input */ | |
| 91 | − reg = emma2rh_in32(EMMA2RH_GPIO_DIR); | |
| 92 | − emma2rh_out32(EMMA2RH_GPIO_DIR, reg & ~GPIO_PCI); | |
| 93 | − /* disable interrupt */ | |
| 94 | − reg = emma2rh_in32(EMMA2RH_GPIO_INT_MASK); | |
| 95 | − emma2rh_out32(EMMA2RH_GPIO_INT_MASK, reg & ~GPIO_PCI); | |
| 96 | − /* level triggerd */ | |
| 97 | − reg = emma2rh_in32(EMMA2RH_GPIO_INT_MODE); | |
| 98 | − emma2rh_out32(EMMA2RH_GPIO_INT_MODE, reg | GPIO_PCI); | |
| 99 | − reg = emma2rh_in32(EMMA2RH_GPIO_INT_CND_A); | |
| 100 | − emma2rh_out32(EMMA2RH_GPIO_INT_CND_A, reg & (~GPIO_PCI)); | |
| 101 | − /* interrupt clear */ | |
| 102 | − emma2rh_out32(EMMA2RH_GPIO_INT_ST, ~GPIO_PCI); | |
| 103 | − | |
| 104 | − /* init all controllers */ | |
| 105 | − emma2rh_irq_init(EMMA2RH_IRQ_BASE); | |
| 106 | − emma2rh_sw_irq_init(EMMA2RH_SW_IRQ_BASE); | |
| 107 | − emma2rh_gpio_irq_init(EMMA2RH_GPIO_IRQ_BASE); | |
| 108 | − mips_cpu_irq_init(); | |
| 109 | − | |
| 110 | − /* setup cascade interrupts */ | |
| 111 | − setup_irq(EMMA2RH_IRQ_BASE + EMMA2RH_SW_CASCADE, &irq_cascade); | |
| 112 | − setup_irq(EMMA2RH_IRQ_BASE + EMMA2RH_GPIO_CASCADE, &irq_cascade); | |
| 113 | − setup_irq(CPU_IRQ_BASE + CPU_EMMA2RH_CASCADE, &irq_cascade); | |
| 114 | −} | |
| 115 | − | |
| 116 | −asmlinkage void plat_irq_dispatch(void) | |
| 117 | −{ | |
| 118 | − unsigned int pending = read_c0_status() & read_c0_cause() & ST0_IM; | |
| 119 | − | |
| 120 | − if (pending & STATUSF_IP7) | |
| 121 | − do_IRQ(CPU_IRQ_BASE + 7); | |
| 122 | − else if (pending & STATUSF_IP2) | |
| 123 | − emma2rh_irq_dispatch(); | |
| 124 | − else if (pending & STATUSF_IP1) | |
| 125 | − do_IRQ(CPU_IRQ_BASE + 1); | |
| 126 | − else if (pending & STATUSF_IP0) | |
| 127 | − do_IRQ(CPU_IRQ_BASE + 0); | |
| 128 | − else | |
| 129 | − spurious_interrupt(); | |
| 130 | −} | |
| 131 | − | |
| 132 | − | |
| @@ -1,158 +0,0 @@ | ||
| 1 | −/* | |
| 2 | − * arch/mips/emma2rh/markeins/irq_markeins.c | |
| 3 | − * This file defines the irq handler for Mark-eins. | |
| 4 | − * | |
| 5 | − * Copyright (C) NEC Electronics Corporation 2004-2006 | |
| 6 | − * | |
| 7 | − * This file is based on the arch/mips/ddb5xxx/ddb5477/irq_5477.c | |
| 8 | − * | |
| 9 | − * Copyright 2001 MontaVista Software Inc. | |
| 10 | − * | |
| 11 | − * This program is free software; you can redistribute it and/or modify | |
| 12 | − * it under the terms of the GNU General Public License as published by | |
| 13 | − * the Free Software Foundation; either version 2 of the License, or | |
| 14 | − * (at your option) any later version. | |
| 15 | − * | |
| 16 | − * This program is distributed in the hope that it will be useful, | |
| 17 | − * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 18 | − * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 19 | − * GNU General Public License for more details. | |
| 20 | − * | |
| 21 | − * You should have received a copy of the GNU General Public License | |
| 22 | − * along with this program; if not, write to the Free Software | |
| 23 | − * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
| 24 | − */ | |
| 25 | −#include <linux/interrupt.h> | |
| 26 | −#include <linux/irq.h> | |
| 27 | −#include <linux/types.h> | |
| 28 | −#include <linux/ptrace.h> | |
| 29 | − | |
| 30 | −#include <asm/debug.h> | |
| 31 | −#include <asm/emma2rh/emma2rh.h> | |
| 32 | − | |
| 33 | −static int emma2rh_sw_irq_base = -1; | |
| 34 | −static int emma2rh_gpio_irq_base = -1; | |
| 35 | − | |
| 36 | −void ll_emma2rh_sw_irq_enable(int reg); | |
| 37 | −void ll_emma2rh_sw_irq_disable(int reg); | |
| 38 | −void ll_emma2rh_gpio_irq_enable(int reg); | |
| 39 | −void ll_emma2rh_gpio_irq_disable(int reg); | |
| 40 | − | |
| 41 | −static void emma2rh_sw_irq_enable(unsigned int irq) | |
| 42 | −{ | |
| 43 | − ll_emma2rh_sw_irq_enable(irq - emma2rh_sw_irq_base); | |
| 44 | −} | |
| 45 | − | |
| 46 | −static void emma2rh_sw_irq_disable(unsigned int irq) | |
| 47 | −{ | |
| 48 | − ll_emma2rh_sw_irq_disable(irq - emma2rh_sw_irq_base); | |
| 49 | −} | |
| 50 | − | |
| 51 | −struct irq_chip emma2rh_sw_irq_controller = { | |
| 52 | − .name = "emma2rh_sw_irq", | |
| 53 | − .ack = emma2rh_sw_irq_disable, | |
| 54 | − .mask = emma2rh_sw_irq_disable, | |
| 55 | − .mask_ack = emma2rh_sw_irq_disable, | |
| 56 | − .unmask = emma2rh_sw_irq_enable, | |
| 57 | −}; | |
| 58 | − | |
| 59 | −void emma2rh_sw_irq_init(u32 irq_base) | |
| 60 | −{ | |
| 61 | − u32 i; | |
| 62 | − | |
| 63 | − for (i = irq_base; i < irq_base + NUM_EMMA2RH_IRQ_SW; i++) | |
| 64 | − set_irq_chip_and_handler(i, &emma2rh_sw_irq_controller, | |
| 65 | − handle_level_irq); | |
| 66 | − | |
| 67 | − emma2rh_sw_irq_base = irq_base; | |
| 68 | −} | |
| 69 | − | |
| 70 | −void ll_emma2rh_sw_irq_enable(int irq) | |
| 71 | −{ | |
| 72 | − u32 reg; | |
| 73 | − | |
| 74 | − db_assert(irq >= 0); | |
| 75 | − db_assert(irq < NUM_EMMA2RH_IRQ_SW); | |
| 76 | − | |
| 77 | − reg = emma2rh_in32(EMMA2RH_BHIF_SW_INT_EN); | |
| 78 | − reg |= 1 << irq; | |
| 79 | − emma2rh_out32(EMMA2RH_BHIF_SW_INT_EN, reg); | |
| 80 | −} | |
| 81 | − | |
| 82 | −void ll_emma2rh_sw_irq_disable(int irq) | |
| 83 | −{ | |
| 84 | − u32 reg; | |
| 85 | − | |
| 86 | − db_assert(irq >= 0); | |
| 87 | − db_assert(irq < 32); | |
| 88 | − | |
| 89 | − reg = emma2rh_in32(EMMA2RH_BHIF_SW_INT_EN); | |
| 90 | − reg &= ~(1 << irq); | |
| 91 | − emma2rh_out32(EMMA2RH_BHIF_SW_INT_EN, reg); | |
| 92 | −} | |
| 93 | − | |
| 94 | −static void emma2rh_gpio_irq_enable(unsigned int irq) | |
| 95 | −{ | |
| 96 | − ll_emma2rh_gpio_irq_enable(irq - emma2rh_gpio_irq_base); | |
| 97 | −} | |
| 98 | − | |
| 99 | −static void emma2rh_gpio_irq_disable(unsigned int irq) | |
| 100 | −{ | |
| 101 | − ll_emma2rh_gpio_irq_disable(irq - emma2rh_gpio_irq_base); | |
| 102 | −} | |
| 103 | − | |
| 104 | −static void emma2rh_gpio_irq_ack(unsigned int irq) | |
| 105 | −{ | |
| 106 | − irq -= emma2rh_gpio_irq_base; | |
| 107 | − emma2rh_out32(EMMA2RH_GPIO_INT_ST, ~(1 << irq)); | |
| 108 | − ll_emma2rh_gpio_irq_disable(irq); | |
| 109 | −} | |
| 110 | − | |
| 111 | −static void emma2rh_gpio_irq_end(unsigned int irq) | |
| 112 | −{ | |
| 113 | − if (!(irq_desc[irq].status & (IRQ_DISABLED | IRQ_INPROGRESS))) | |
| 114 | − ll_emma2rh_gpio_irq_enable(irq - emma2rh_gpio_irq_base); | |
| 115 | −} | |
| 116 | − | |
| 117 | −struct irq_chip emma2rh_gpio_irq_controller = { | |
| 118 | − .name = "emma2rh_gpio_irq", | |
| 119 | − .ack = emma2rh_gpio_irq_ack, | |
| 120 | − .mask = emma2rh_gpio_irq_disable, | |
| 121 | − .mask_ack = emma2rh_gpio_irq_ack, | |
| 122 | − .unmask = emma2rh_gpio_irq_enable, | |
| 123 | − .end = emma2rh_gpio_irq_end, | |
| 124 | −}; | |
| 125 | − | |
| 126 | −void emma2rh_gpio_irq_init(u32 irq_base) | |
| 127 | −{ | |
| 128 | − u32 i; | |
| 129 | − | |
| 130 | − for (i = irq_base; i < irq_base + NUM_EMMA2RH_IRQ_GPIO; i++) | |
| 131 | − set_irq_chip(i, &emma2rh_gpio_irq_controller); | |
| 132 | − | |
| 133 | − emma2rh_gpio_irq_base = irq_base; | |
| 134 | −} | |
| 135 | − | |
| 136 | −void ll_emma2rh_gpio_irq_enable(int irq) | |
| 137 | −{ | |
| 138 | − u32 reg; | |
| 139 | − | |
| 140 | − db_assert(irq >= 0); | |
| 141 | − db_assert(irq < NUM_EMMA2RH_IRQ_GPIO); | |
| 142 | − | |
| 143 | − reg = emma2rh_in32(EMMA2RH_GPIO_INT_MASK); | |
| 144 | − reg |= 1 << irq; | |
| 145 | − emma2rh_out32(EMMA2RH_GPIO_INT_MASK, reg); | |
| 146 | −} | |
| 147 | − | |
| 148 | −void ll_emma2rh_gpio_irq_disable(int irq) | |
| 149 | −{ | |
| 150 | − u32 reg; | |
| 151 | − | |
| 152 | − db_assert(irq >= 0); | |
| 153 | − db_assert(irq < NUM_EMMA2RH_IRQ_GPIO); | |
| 154 | − | |
| 155 | − reg = emma2rh_in32(EMMA2RH_GPIO_INT_MASK); | |
| 156 | − reg &= ~(1 << irq); | |
| 157 | − emma2rh_out32(EMMA2RH_GPIO_INT_MASK, reg); | |
| 158 | −} | |
| @@ -1,5 +1,5 @@ | ||
| 1 | 1 | /* |
| 2 | − * include/asm-mips/emma2rh/emma2rh.h | |
| 2 | + * arch/mips/include/asm/emma/emma2rh.h | |
| 3 | 3 | * This file is EMMA2RH common header. |
| 4 | 4 | * |
| 5 | 5 | * Copyright (C) NEC Electronics Corporation 2005-2006 |
| @@ -21,8 +21,8 @@ · 15 unmodified lines | ||
| 21 | 21 | * along with this program; if not, write to the Free Software |
| 22 | 22 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 23 | 23 | */ |
| 24 | −#ifndef __ASM_EMMA2RH_EMMA2RH_H | |
| 25 | −#define __ASM_EMMA2RH_EMMA2RH_H | |
| 24 | +#ifndef __ASM_EMMA_EMMA2RH_H | |
| 25 | +#define __ASM_EMMA_EMMA2RH_H | |
| 26 | 26 | |
| 27 | 27 | #include <irq.h> |
| 28 | 28 | |
| @@ -206,7 +206,6 @@ static inline void emma2rh_out32(u32 offset, u32 val) · 177 unmodified lines | ||
| 206 | 206 | static inline u32 emma2rh_in32(u32 offset) |
| 207 | 207 | { |
| 208 | 208 | u32 val = *(volatile u32 *)(EMMA2RH_BASE | offset); |
| 209 | − emma2rh_sync(); | |
| 210 | 209 | return val; |
| 211 | 210 | } |
| 212 | 211 | |
| @@ -219,7 +218,6 @@ static inline void emma2rh_out16(u32 offset, u16 val) · 6 unmodified lines | ||
| 219 | 218 | static inline u16 emma2rh_in16(u32 offset) |
| 220 | 219 | { |
| 221 | 220 | u16 val = *(volatile u16 *)(EMMA2RH_BASE | offset); |
| 222 | − emma2rh_sync(); | |
| 223 | 221 | return val; |
| 224 | 222 | } |
| 225 | 223 | |
| @@ -232,7 +230,6 @@ static inline void emma2rh_out8(u32 offset, u8 val) · 6 unmodified lines | ||
| 232 | 230 | static inline u8 emma2rh_in8(u32 offset) |
| 233 | 231 | { |
| 234 | 232 | u8 val = *(volatile u8 *)(EMMA2RH_BASE | offset); |
| 235 | − emma2rh_sync(); | |
| 236 | 233 | return val; |
| 237 | 234 | } |
| 238 | 235 | |
| @@ -324,10 +321,10 @@ static inline u8 emma2rh_in8(u32 offset) · 85 unmodified lines | ||
| 324 | 321 | /* |
| 325 | 322 | * include the board dependent part |
| 326 | 323 | */ |
| 327 | −#if defined(CONFIG_MARKEINS) | |
| 328 | −#include <asm/emma2rh/markeins.h> | |
| 324 | +#ifdef CONFIG_NEC_MARKEINS | |
| 325 | +#include <asm/emma/markeins.h> | |
| 329 | 326 | #else |
| 330 | 327 | #error "Unknown EMMA2RH board!" |
| 331 | 328 | #endif |
| 332 | 329 | |
| 333 | −#endif /* __ASM_EMMA2RH_EMMA2RH_H */ | |
| 330 | +#endif /* __ASM_EMMA_EMMA2RH_H */ | |
File renamed without changes.
| @@ -0,0 +1,30 @@ | ||
| 1 | +/* | |
| 2 | + * Copyright (c) 2008 Zhang Le <r0bertz@gentoo.org> | |
| 3 | + * | |
| 4 | + * This program is free software; you can redistribute it | |
| 5 | + * and/or modify it under the terms of the GNU General | |
| 6 | + * Public License as published by the Free Software | |
| 7 | + * Foundation; either version 2 of the License, or (at your | |
| 8 | + * option) any later version. | |
| 9 | + * | |
| 10 | + * This program is distributed in the hope that it will be | |
| 11 | + * useful, but WITHOUT ANY WARRANTY; without even the implied | |
| 12 | + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR | |
| 13 | + * PURPOSE. See the GNU General Public License for more | |
| 14 | + * details. | |
| 15 | + * | |
| 16 | + * You should have received a copy of the GNU General Public | |
| 17 | + * License along with this program; if not, write to the Free | |
| 18 | + * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA | |
| 19 | + * 02139, USA. | |
| 20 | + */ | |
| 21 | + | |
| 22 | +#ifndef _LEMOTE_PCI_H_ | |
| 23 | +#define _LEMOTE_PCI_H_ | |
| 24 | + | |
| 25 | +#define LOONGSON2E_PCI_MEM_START 0x14000000UL | |
| 26 | +#define LOONGSON2E_PCI_MEM_END 0x1fffffffUL | |
| 27 | +#define LOONGSON2E_PCI_IO_START 0x00004000UL | |
| 28 | +#define LOONGSON2E_IO_PORT_BASE 0x1fd00000UL | |
| 29 | + | |
| 30 | +#endif /* !_LEMOTE_PCI_H_ */ | |
| @@ -0,0 +1,172 @@ | ||
| 1 | +/* | |
| 2 | + * gpio.h: GPIO Support for PNX833X. | |
| 3 | + * | |
| 4 | + * Copyright 2008 NXP Semiconductors | |
| 5 | + * Chris Steel <chris.steel@nxp.com> | |
| 6 | + * Daniel Laird <daniel.j.laird@nxp.com> | |
| 7 | + * | |
| 8 | + * This program is free software; you can redistribute it and/or modify | |
| 9 | + * it under the terms of the GNU General Public License as published by | |
| 10 | + * the Free Software Foundation; either version 2 of the License, or | |
| 11 | + * (at your option) any later version. | |
| 12 | + * | |
| 13 | + * This program is distributed in the hope that it will be useful, | |
| 14 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 15 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 16 | + * GNU General Public License for more details. | |
| 17 | + * | |
| 18 | + * You should have received a copy of the GNU General Public License | |
| 19 | + * along with this program; if not, write to the Free Software | |
| 20 | + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |
| 21 | + */ | |
| 22 | +#ifndef __ASM_MIPS_MACH_PNX833X_GPIO_H | |
| 23 | +#define __ASM_MIPS_MACH_PNX833X_GPIO_H | |
| 24 | + | |
| 25 | +/* BIG FAT WARNING: races danger! | |
| 26 | + No protections exist here. Current users are only early init code, | |
| 27 | + when locking is not needed because no cuncurency yet exists there, | |
| 28 | + and GPIO IRQ dispatcher, which does locking. | |
| 29 | + However, if many uses will ever happen, proper locking will be needed | |
| 30 | + - including locking between different uses | |
| 31 | +*/ | |
| 32 | + | |
| 33 | +#include "pnx833x.h" | |
| 34 | + | |
| 35 | +#define SET_REG_BIT(reg, bit) do { (reg |= (1 << (bit))); } while (0) | |
| 36 | +#define CLEAR_REG_BIT(reg, bit) do { (reg &= ~(1 << (bit))); } while (0) | |
| 37 | + | |
| 38 | +/* Initialize GPIO to a known state */ | |
| 39 | +static inline void pnx833x_gpio_init(void) | |
| 40 | +{ | |
| 41 | + PNX833X_PIO_DIR = 0; | |
| 42 | + PNX833X_PIO_DIR2 = 0; | |
| 43 | + PNX833X_PIO_SEL = 0; | |
| 44 | + PNX833X_PIO_SEL2 = 0; | |
| 45 | + PNX833X_PIO_INT_EDGE = 0; | |
| 46 | + PNX833X_PIO_INT_HI = 0; | |
| 47 | + PNX833X_PIO_INT_LO = 0; | |
| 48 | + | |
| 49 | + /* clear any GPIO interrupt requests */ | |
| 50 | + PNX833X_PIO_INT_CLEAR = 0xffff; | |
| 51 | + PNX833X_PIO_INT_CLEAR = 0; | |
| 52 | + PNX833X_PIO_INT_ENABLE = 0; | |
| 53 | +} | |
| 54 | + | |
| 55 | +/* Select GPIO direction for a pin */ | |
| 56 | +static inline void pnx833x_gpio_select_input(unsigned int pin) | |
| 57 | +{ | |
| 58 | + if (pin < 32) | |
| 59 | + CLEAR_REG_BIT(PNX833X_PIO_DIR, pin); | |
| 60 | + else | |
| 61 | + CLEAR_REG_BIT(PNX833X_PIO_DIR2, pin & 31); | |
| 62 | +} | |
| 63 | +static inline void pnx833x_gpio_select_output(unsigned int pin) | |
| 64 | +{ | |
| 65 | + if (pin < 32) | |
| 66 | + SET_REG_BIT(PNX833X_PIO_DIR, pin); | |
| 67 | + else | |
| 68 | + SET_REG_BIT(PNX833X_PIO_DIR2, pin & 31); | |
| 69 | +} | |
| 70 | + | |
| 71 | +/* Select GPIO or alternate function for a pin */ | |
| 72 | +static inline void pnx833x_gpio_select_function_io(unsigned int pin) | |
| 73 | +{ | |
| 74 | + if (pin < 32) | |
| 75 | + CLEAR_REG_BIT(PNX833X_PIO_SEL, pin); | |
| 76 | + else | |
| 77 | + CLEAR_REG_BIT(PNX833X_PIO_SEL2, pin & 31); | |
| 78 | +} | |
| 79 | +static inline void pnx833x_gpio_select_function_alt(unsigned int pin) | |
| 80 | +{ | |
| 81 | + if (pin < 32) | |
| 82 | + SET_REG_BIT(PNX833X_PIO_SEL, pin); | |
| 83 | + else | |
| 84 | + SET_REG_BIT(PNX833X_PIO_SEL2, pin & 31); | |
| 85 | +} | |
| 86 | + | |
| 87 | +/* Read GPIO pin */ | |
| 88 | +static inline int pnx833x_gpio_read(unsigned int pin) | |
| 89 | +{ | |
| 90 | + if (pin < 32) | |
| 91 | + return (PNX833X_PIO_IN >> pin) & 1; | |
| 92 | + else | |
| 93 | + return (PNX833X_PIO_IN2 >> (pin & 31)) & 1; | |
| 94 | +} | |
| 95 | + | |
| 96 | +/* Write GPIO pin */ | |
| 97 | +static inline void pnx833x_gpio_write(unsigned int val, unsigned int pin) | |
| 98 | +{ | |
| 99 | + if (pin < 32) { | |
| 100 | + if (val) | |
| 101 | + SET_REG_BIT(PNX833X_PIO_OUT, pin); | |
| 102 | + else | |
| 103 | + CLEAR_REG_BIT(PNX833X_PIO_OUT, pin); | |
| 104 | + } else { | |
| 105 | + if (val) | |
| 106 | + SET_REG_BIT(PNX833X_PIO_OUT2, pin & 31); | |
| 107 | + else | |
| 108 | + CLEAR_REG_BIT(PNX833X_PIO_OUT2, pin & 31); | |
| 109 | + } | |
| 110 | +} | |
| 111 | + | |
| 112 | +/* Configure GPIO interrupt */ | |
| 113 | +#define GPIO_INT_NONE 0 | |
| 114 | +#define GPIO_INT_LEVEL_LOW 1 | |
| 115 | +#define GPIO_INT_LEVEL_HIGH 2 | |
| 116 | +#define GPIO_INT_EDGE_RISING 3 | |
| 117 | +#define GPIO_INT_EDGE_FALLING 4 | |
| 118 | +#define GPIO_INT_EDGE_BOTH 5 | |
| 119 | +static inline void pnx833x_gpio_setup_irq(int when, unsigned int pin) | |
| 120 | +{ | |
| 121 | + switch (when) { | |
| 122 | + case GPIO_INT_LEVEL_LOW: | |
| 123 | + CLEAR_REG_BIT(PNX833X_PIO_INT_EDGE, pin); | |
| 124 | + CLEAR_REG_BIT(PNX833X_PIO_INT_HI, pin); | |
| 125 | + SET_REG_BIT(PNX833X_PIO_INT_LO, pin); | |
| 126 | + break; | |
| 127 | + case GPIO_INT_LEVEL_HIGH: | |
| 128 | + CLEAR_REG_BIT(PNX833X_PIO_INT_EDGE, pin); | |
| 129 | + SET_REG_BIT(PNX833X_PIO_INT_HI, pin); | |
| 130 | + CLEAR_REG_BIT(PNX833X_PIO_INT_LO, pin); | |
| 131 | + break; | |
| 132 | + case GPIO_INT_EDGE_RISING: | |
| 133 | + SET_REG_BIT(PNX833X_PIO_INT_EDGE, pin); | |
| 134 | + SET_REG_BIT(PNX833X_PIO_INT_HI, pin); | |
| 135 | + CLEAR_REG_BIT(PNX833X_PIO_INT_LO, pin); | |
| 136 | + break; | |
| 137 | + case GPIO_INT_EDGE_FALLING: | |
| 138 | + SET_REG_BIT(PNX833X_PIO_INT_EDGE, pin); | |
| 139 | + CLEAR_REG_BIT(PNX833X_PIO_INT_HI, pin); | |
| 140 | + SET_REG_BIT(PNX833X_PIO_INT_LO, pin); | |
| 141 | + break; | |
| 142 | + case GPIO_INT_EDGE_BOTH: | |
| 143 | + SET_REG_BIT(PNX833X_PIO_INT_EDGE, pin); | |
| 144 | + SET_REG_BIT(PNX833X_PIO_INT_HI, pin); | |
| 145 | + SET_REG_BIT(PNX833X_PIO_INT_LO, pin); | |
| 146 | + break; | |
| 147 | + default: | |
| 148 | + CLEAR_REG_BIT(PNX833X_PIO_INT_EDGE, pin); | |
| 149 | + CLEAR_REG_BIT(PNX833X_PIO_INT_HI, pin); | |
| 150 | + CLEAR_REG_BIT(PNX833X_PIO_INT_LO, pin); | |
| 151 | + break; | |
| 152 | + } | |
| 153 | +} | |
| 154 | + | |
| 155 | +/* Enable/disable GPIO interrupt */ | |
| 156 | +static inline void pnx833x_gpio_enable_irq(unsigned int pin) | |
| 157 | +{ | |
| 158 | + SET_REG_BIT(PNX833X_PIO_INT_ENABLE, pin); | |
| 159 | +} | |
| 160 | +static inline void pnx833x_gpio_disable_irq(unsigned int pin) | |
| 161 | +{ | |
| 162 | + CLEAR_REG_BIT(PNX833X_PIO_INT_ENABLE, pin); | |
| 163 | +} | |
| 164 | + | |
| 165 | +/* Clear GPIO interrupt request */ | |
| 166 | +static inline void pnx833x_gpio_clear_irq(unsigned int pin) | |
| 167 | +{ | |
| 168 | + SET_REG_BIT(PNX833X_PIO_INT_CLEAR, pin); | |
| 169 | + CLEAR_REG_BIT(PNX833X_PIO_INT_CLEAR, pin); | |
| 170 | +} | |
| 171 | + | |
| 172 | +#endif | |
| @@ -0,0 +1,126 @@ | ||
| 1 | + | |
| 2 | +/* | |
| 3 | + * irq.h: IRQ mappings for PNX833X. | |
| 4 | + * | |
| 5 | + * Copyright 2008 NXP Semiconductors | |
| 6 | + * Chris Steel <chris.steel@nxp.com> | |
| 7 | + * Daniel Laird <daniel.j.laird@nxp.com> | |
| 8 | + * | |
| 9 | + * This program is free software; you can redistribute it and/or modify | |
| 10 | + * it under the terms of the GNU General Public License as published by | |
| 11 | + * the Free Software Foundation; either version 2 of the License, or | |
| 12 | + * (at your option) any later version. | |
| 13 | + * | |
| 14 | + * This program is distributed in the hope that it will be useful, | |
| 15 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 16 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 17 | + * GNU General Public License for more details. | |
| 18 | + * | |
| 19 | + * You should have received a copy of the GNU General Public License | |
| 20 | + * along with this program; if not, write to the Free Software | |
| 21 | + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |
| 22 | + */ | |
| 23 | + | |
| 24 | +#ifndef __ASM_MIPS_MACH_PNX833X_IRQ_MAPPING_H | |
| 25 | +#define __ASM_MIPS_MACH_PNX833X_IRQ_MAPPING_H | |
| 26 | +/* | |
| 27 | + * The "IRQ numbers" are completely virtual. | |
| 28 | + * | |
| 29 | + * In PNX8330/1, we have 48 interrupt lines, numbered from 1 to 48. | |
| 30 | + * Let's use numbers 1..48 for PIC interrupts, number 0 for timer interrupt, | |
| 31 | + * numbers 49..64 for (virtual) GPIO interrupts. | |
| 32 | + * | |
| 33 | + * In PNX8335, we have 57 interrupt lines, numbered from 1 to 57, | |
| 34 | + * connected to PIC, which uses core hardware interrupt 2, and also | |
| 35 | + * a timer interrupt through hardware interrupt 5. | |
| 36 | + * Let's use numbers 1..64 for PIC interrupts, number 0 for timer interrupt, | |
| 37 | + * numbers 65..80 for (virtual) GPIO interrupts. | |
| 38 | + * | |
| 39 | + */ | |
| 40 | +#include <irq.h> | |
| 41 | + | |
| 42 | +#define PNX833X_TIMER_IRQ (MIPS_CPU_IRQ_BASE + 7) | |
| 43 | + | |
| 44 | +/* Interrupts supported by PIC */ | |
| 45 | +#define PNX833X_PIC_I2C0_INT (PNX833X_PIC_IRQ_BASE + 1) | |
| 46 | +#define PNX833X_PIC_I2C1_INT (PNX833X_PIC_IRQ_BASE + 2) | |
| 47 | +#define PNX833X_PIC_UART0_INT (PNX833X_PIC_IRQ_BASE + 3) | |
| 48 | +#define PNX833X_PIC_UART1_INT (PNX833X_PIC_IRQ_BASE + 4) | |
| 49 | +#define PNX833X_PIC_TS_IN0_DV_INT (PNX833X_PIC_IRQ_BASE + 5) | |
| 50 | +#define PNX833X_PIC_TS_IN0_DMA_INT (PNX833X_PIC_IRQ_BASE + 6) | |
| 51 | +#define PNX833X_PIC_GPIO_INT (PNX833X_PIC_IRQ_BASE + 7) | |
| 52 | +#define PNX833X_PIC_AUDIO_DEC_INT (PNX833X_PIC_IRQ_BASE + 8) | |
| 53 | +#define PNX833X_PIC_VIDEO_DEC_INT (PNX833X_PIC_IRQ_BASE + 9) | |
| 54 | +#define PNX833X_PIC_CONFIG_INT (PNX833X_PIC_IRQ_BASE + 10) | |
| 55 | +#define PNX833X_PIC_AOI_INT (PNX833X_PIC_IRQ_BASE + 11) | |
| 56 | +#define PNX833X_PIC_SYNC_INT (PNX833X_PIC_IRQ_BASE + 12) | |
| 57 | +#define PNX8330_PIC_SPU_INT (PNX833X_PIC_IRQ_BASE + 13) | |
| 58 | +#define PNX8335_PIC_SATA_INT (PNX833X_PIC_IRQ_BASE + 13) | |
| 59 | +#define PNX833X_PIC_OSD_INT (PNX833X_PIC_IRQ_BASE + 14) | |
| 60 | +#define PNX833X_PIC_DISP1_INT (PNX833X_PIC_IRQ_BASE + 15) | |
| 61 | +#define PNX833X_PIC_DEINTERLACER_INT (PNX833X_PIC_IRQ_BASE + 16) | |
| 62 | +#define PNX833X_PIC_DISPLAY2_INT (PNX833X_PIC_IRQ_BASE + 17) | |
| 63 | +#define PNX833X_PIC_VC_INT (PNX833X_PIC_IRQ_BASE + 18) | |
| 64 | +#define PNX833X_PIC_SC_INT (PNX833X_PIC_IRQ_BASE + 19) | |
| 65 | +#define PNX833X_PIC_IDE_INT (PNX833X_PIC_IRQ_BASE + 20) | |
| 66 | +#define PNX833X_PIC_IDE_DMA_INT (PNX833X_PIC_IRQ_BASE + 21) | |
| 67 | +#define PNX833X_PIC_TS_IN1_DV_INT (PNX833X_PIC_IRQ_BASE + 22) | |
| 68 | +#define PNX833X_PIC_TS_IN1_DMA_INT (PNX833X_PIC_IRQ_BASE + 23) | |
| 69 | +#define PNX833X_PIC_SGDX_DMA_INT (PNX833X_PIC_IRQ_BASE + 24) | |
| 70 | +#define PNX833X_PIC_TS_OUT_INT (PNX833X_PIC_IRQ_BASE + 25) | |
| 71 | +#define PNX833X_PIC_IR_INT (PNX833X_PIC_IRQ_BASE + 26) | |
| 72 | +#define PNX833X_PIC_VMSP1_INT (PNX833X_PIC_IRQ_BASE + 27) | |
| 73 | +#define PNX833X_PIC_VMSP2_INT (PNX833X_PIC_IRQ_BASE + 28) | |
| 74 | +#define PNX833X_PIC_PIBC_INT (PNX833X_PIC_IRQ_BASE + 29) | |
| 75 | +#define PNX833X_PIC_TS_IN0_TRD_INT (PNX833X_PIC_IRQ_BASE + 30) | |
| 76 | +#define PNX833X_PIC_SGDX_TPD_INT (PNX833X_PIC_IRQ_BASE + 31) | |
| 77 | +#define PNX833X_PIC_USB_INT (PNX833X_PIC_IRQ_BASE + 32) | |
| 78 | +#define PNX833X_PIC_TS_IN1_TRD_INT (PNX833X_PIC_IRQ_BASE + 33) | |
| 79 | +#define PNX833X_PIC_CLOCK_INT (PNX833X_PIC_IRQ_BASE + 34) | |
| 80 | +#define PNX833X_PIC_SGDX_PARSER_INT (PNX833X_PIC_IRQ_BASE + 35) | |
| 81 | +#define PNX833X_PIC_VMSP_DMA_INT (PNX833X_PIC_IRQ_BASE + 36) | |
| 82 | + | |
| 83 | +#if defined(CONFIG_SOC_PNX8335) | |
| 84 | +#define PNX8335_PIC_MIU_INT (PNX833X_PIC_IRQ_BASE + 37) | |
| 85 | +#define PNX8335_PIC_AVCHIP_IRQ_INT (PNX833X_PIC_IRQ_BASE + 38) | |
| 86 | +#define PNX8335_PIC_SYNC_HD_INT (PNX833X_PIC_IRQ_BASE + 39) | |
| 87 | +#define PNX8335_PIC_DISP_HD_INT (PNX833X_PIC_IRQ_BASE + 40) | |
| 88 | +#define PNX8335_PIC_DISP_SCALER_INT (PNX833X_PIC_IRQ_BASE + 41) | |
| 89 | +#define PNX8335_PIC_OSD_HD1_INT (PNX833X_PIC_IRQ_BASE + 42) | |
| 90 | +#define PNX8335_PIC_DTL_WRITER_Y_INT (PNX833X_PIC_IRQ_BASE + 43) | |
| 91 | +#define PNX8335_PIC_DTL_WRITER_C_INT (PNX833X_PIC_IRQ_BASE + 44) | |
| 92 | +#define PNX8335_PIC_DTL_EMULATOR_Y_IR_INT (PNX833X_PIC_IRQ_BASE + 45) | |
| 93 | +#define PNX8335_PIC_DTL_EMULATOR_C_IR_INT (PNX833X_PIC_IRQ_BASE + 46) | |
| 94 | +#define PNX8335_PIC_DENC_TTX_INT (PNX833X_PIC_IRQ_BASE + 47) | |
| 95 | +#define PNX8335_PIC_MMI_SIF0_INT (PNX833X_PIC_IRQ_BASE + 48) | |
| 96 | +#define PNX8335_PIC_MMI_SIF1_INT (PNX833X_PIC_IRQ_BASE + 49) | |
| 97 | +#define PNX8335_PIC_MMI_CDMMU_INT (PNX833X_PIC_IRQ_BASE + 50) | |
| 98 | +#define PNX8335_PIC_PIBCS_INT (PNX833X_PIC_IRQ_BASE + 51) | |
| 99 | +#define PNX8335_PIC_ETHERNET_INT (PNX833X_PIC_IRQ_BASE + 52) | |
| 100 | +#define PNX8335_PIC_VMSP1_0_INT (PNX833X_PIC_IRQ_BASE + 53) | |
| 101 | +#define PNX8335_PIC_VMSP1_1_INT (PNX833X_PIC_IRQ_BASE + 54) | |
| 102 | +#define PNX8335_PIC_VMSP1_DMA_INT (PNX833X_PIC_IRQ_BASE + 55) | |
| 103 | +#define PNX8335_PIC_TDGR_DE_INT (PNX833X_PIC_IRQ_BASE + 56) | |
| 104 | +#define PNX8335_PIC_IR1_IRQ_INT (PNX833X_PIC_IRQ_BASE + 57) | |
| 105 | +#endif | |
| 106 | + | |
| 107 | +/* GPIO interrupts */ | |
| 108 | +#define PNX833X_GPIO_0_INT (PNX833X_GPIO_IRQ_BASE + 0) | |
| 109 | +#define PNX833X_GPIO_1_INT (PNX833X_GPIO_IRQ_BASE + 1) | |
| 110 | +#define PNX833X_GPIO_2_INT (PNX833X_GPIO_IRQ_BASE + 2) | |
| 111 | +#define PNX833X_GPIO_3_INT (PNX833X_GPIO_IRQ_BASE + 3) | |
| 112 | +#define PNX833X_GPIO_4_INT (PNX833X_GPIO_IRQ_BASE + 4) | |
| 113 | +#define PNX833X_GPIO_5_INT (PNX833X_GPIO_IRQ_BASE + 5) | |
| 114 | +#define PNX833X_GPIO_6_INT (PNX833X_GPIO_IRQ_BASE + 6) | |
| 115 | +#define PNX833X_GPIO_7_INT (PNX833X_GPIO_IRQ_BASE + 7) | |
| 116 | +#define PNX833X_GPIO_8_INT (PNX833X_GPIO_IRQ_BASE + 8) | |
| 117 | +#define PNX833X_GPIO_9_INT (PNX833X_GPIO_IRQ_BASE + 9) | |
| 118 | +#define PNX833X_GPIO_10_INT (PNX833X_GPIO_IRQ_BASE + 10) | |
| 119 | +#define PNX833X_GPIO_11_INT (PNX833X_GPIO_IRQ_BASE + 11) | |
| 120 | +#define PNX833X_GPIO_12_INT (PNX833X_GPIO_IRQ_BASE + 12) | |
| 121 | +#define PNX833X_GPIO_13_INT (PNX833X_GPIO_IRQ_BASE + 13) | |
| 122 | +#define PNX833X_GPIO_14_INT (PNX833X_GPIO_IRQ_BASE + 14) | |
| 123 | +#define PNX833X_GPIO_15_INT (PNX833X_GPIO_IRQ_BASE + 15) | |
| 124 | + | |
| 125 | +#endif | |
| 126 | + | |
| @@ -0,0 +1,53 @@ | ||
| 1 | +/* | |
| 2 | + * irq.h: IRQ mappings for PNX833X. | |
| 3 | + * | |
| 4 | + * Copyright 2008 NXP Semiconductors | |
| 5 | + * Chris Steel <chris.steel@nxp.com> | |
| 6 | + * Daniel Laird <daniel.j.laird@nxp.com> | |
| 7 | + * | |
| 8 | + * This program is free software; you can redistribute it and/or modify | |
| 9 | + * it under the terms of the GNU General Public License as published by | |
| 10 | + * the Free Software Foundation; either version 2 of the License, or | |
| 11 | + * (at your option) any later version. | |
| 12 | + * | |
| 13 | + * This program is distributed in the hope that it will be useful, | |
| 14 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 15 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 16 | + * GNU General Public License for more details. | |
| 17 | + * | |
| 18 | + * You should have received a copy of the GNU General Public License | |
| 19 | + * along with this program; if not, write to the Free Software | |
| 20 | + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |
| 21 | + */ | |
| 22 | + | |
| 23 | +#ifndef __ASM_MIPS_MACH_PNX833X_IRQ_H | |
| 24 | +#define __ASM_MIPS_MACH_PNX833X_IRQ_H | |
| 25 | +/* | |
| 26 | + * The "IRQ numbers" are completely virtual. | |
| 27 | + * | |
| 28 | + * In PNX8330/1, we have 48 interrupt lines, numbered from 1 to 48. | |
| 29 | + * Let's use numbers 1..48 for PIC interrupts, number 0 for timer interrupt, | |
| 30 | + * numbers 49..64 for (virtual) GPIO interrupts. | |
| 31 | + * | |
| 32 | + * In PNX8335, we have 57 interrupt lines, numbered from 1 to 57, | |
| 33 | + * connected to PIC, which uses core hardware interrupt 2, and also | |
| 34 | + * a timer interrupt through hardware interrupt 5. | |
| 35 | + * Let's use numbers 1..64 for PIC interrupts, number 0 for timer interrupt, | |
| 36 | + * numbers 65..80 for (virtual) GPIO interrupts. | |
| 37 | + * | |
| 38 | + */ | |
| 39 | +#if defined(CONFIG_SOC_PNX8335) | |
| 40 | + #define PNX833X_PIC_NUM_IRQ 58 | |
| 41 | +#else | |
| 42 | + #define PNX833X_PIC_NUM_IRQ 37 | |
| 43 | +#endif | |
| 44 | + | |
| 45 | +#define MIPS_CPU_NUM_IRQ 8 | |
| 46 | +#define PNX833X_GPIO_NUM_IRQ 16 | |
| 47 | + | |
| 48 | +#define MIPS_CPU_IRQ_BASE 0 | |
| 49 | +#define PNX833X_PIC_IRQ_BASE (MIPS_CPU_IRQ_BASE + MIPS_CPU_NUM_IRQ) | |
| 50 | +#define PNX833X_GPIO_IRQ_BASE (PNX833X_PIC_IRQ_BASE + PNX833X_PIC_NUM_IRQ) | |
| 51 | +#define NR_IRQS (MIPS_CPU_NUM_IRQ + PNX833X_PIC_NUM_IRQ + PNX833X_GPIO_NUM_IRQ) | |
| 52 | + | |
| 53 | +#endif | |
| @@ -0,0 +1,202 @@ | ||
| 1 | +/* | |
| 2 | + * pnx833x.h: Register mappings for PNX833X. | |
| 3 | + * | |
| 4 | + * Copyright 2008 NXP Semiconductors | |
| 5 | + * Chris Steel <chris.steel@nxp.com> | |
| 6 | + * Daniel Laird <daniel.j.laird@nxp.com> | |
| 7 | + * | |
| 8 | + * This program is free software; you can redistribute it and/or modify | |
| 9 | + * it under the terms of the GNU General Public License as published by | |
| 10 | + * the Free Software Foundation; either version 2 of the License, or | |
| 11 | + * (at your option) any later version. | |
| 12 | + * | |
| 13 | + * This program is distributed in the hope that it will be useful, | |
| 14 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 15 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 16 | + * GNU General Public License for more details. | |
| 17 | + * | |
| 18 | + * You should have received a copy of the GNU General Public License | |
| 19 | + * along with this program; if not, write to the Free Software | |
| 20 | + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |
| 21 | + */ | |
| 22 | +#ifndef __ASM_MIPS_MACH_PNX833X_PNX833X_H | |
| 23 | +#define __ASM_MIPS_MACH_PNX833X_PNX833X_H | |
| 24 | + | |
| 25 | +/* All regs are accessed in KSEG1 */ | |
| 26 | +#define PNX833X_BASE (0xa0000000ul + 0x17E00000ul) | |
| 27 | + | |
| 28 | +#define PNX833X_REG(offs) (*((volatile unsigned long *)(PNX833X_BASE + offs))) | |
| 29 | + | |
| 30 | +/* Registers are named exactly as in PNX833X docs, just with PNX833X_ prefix */ | |
| 31 | + | |
| 32 | +/* Read access to multibit fields */ | |
| 33 | +#define PNX833X_BIT(val, reg, field) ((val) & PNX833X_##reg##_##field) | |
| 34 | +#define PNX833X_REGBIT(reg, field) PNX833X_BIT(PNX833X_##reg, reg, field) | |
| 35 | + | |
| 36 | +/* Use PNX833X_FIELD to extract a field from val */ | |
| 37 | +#define PNX_FIELD(cpu, val, reg, field) \ | |
| 38 | + (((val) & PNX##cpu##_##reg##_##field##_MASK) >> \ | |
| 39 | + PNX##cpu##_##reg##_##field##_SHIFT) | |
| 40 | +#define PNX833X_FIELD(val, reg, field) PNX_FIELD(833X, val, reg, field) | |
| 41 | +#define PNX8330_FIELD(val, reg, field) PNX_FIELD(8330, val, reg, field) | |
| 42 | +#define PNX8335_FIELD(val, reg, field) PNX_FIELD(8335, val, reg, field) | |
| 43 | + | |
| 44 | +/* Use PNX833X_REGFIELD to extract a field from a register */ | |
| 45 | +#define PNX833X_REGFIELD(reg, field) PNX833X_FIELD(PNX833X_##reg, reg, field) | |
| 46 | +#define PNX8330_REGFIELD(reg, field) PNX8330_FIELD(PNX8330_##reg, reg, field) | |
| 47 | +#define PNX8335_REGFIELD(reg, field) PNX8335_FIELD(PNX8335_##reg, reg, field) | |
| 48 | + | |
| 49 | + | |
| 50 | +#define PNX_WRITEFIELD(cpu, val, reg, field) \ | |
| 51 | + (PNX##cpu##_##reg = (PNX##cpu##_##reg & ~(PNX##cpu##_##reg##_##field##_MASK)) | \ | |
| 52 | + ((val) << PNX##cpu##_##reg##_##field##_SHIFT)) | |
| 53 | +#define PNX833X_WRITEFIELD(val, reg, field) \ | |
| 54 | + PNX_WRITEFIELD(833X, val, reg, field) | |
| 55 | +#define PNX8330_WRITEFIELD(val, reg, field) \ | |
| 56 | + PNX_WRITEFIELD(8330, val, reg, field) | |
| 57 | +#define PNX8335_WRITEFIELD(val, reg, field) \ | |
| 58 | + PNX_WRITEFIELD(8335, val, reg, field) | |
| 59 | + | |
| 60 | + | |
| 61 | +/* Macros to detect CPU type */ | |
| 62 | + | |
| 63 | +#define PNX833X_CONFIG_MODULE_ID PNX833X_REG(0x7FFC) | |
| 64 | +#define PNX833X_CONFIG_MODULE_ID_MAJREV_MASK 0x0000f000 | |
| 65 | +#define PNX833X_CONFIG_MODULE_ID_MAJREV_SHIFT 12 | |
| 66 | +#define PNX8330_CONFIG_MODULE_MAJREV 4 | |
| 67 | +#define PNX8335_CONFIG_MODULE_MAJREV 5 | |
| 68 | +#define CPU_IS_PNX8330 (PNX833X_REGFIELD(CONFIG_MODULE_ID, MAJREV) == \ | |
| 69 | + PNX8330_CONFIG_MODULE_MAJREV) | |
| 70 | +#define CPU_IS_PNX8335 (PNX833X_REGFIELD(CONFIG_MODULE_ID, MAJREV) == \ | |
| 71 | + PNX8335_CONFIG_MODULE_MAJREV) | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | +#define PNX833X_RESET_CONTROL PNX833X_REG(0x8004) | |
| 76 | +#define PNX833X_RESET_CONTROL_2 PNX833X_REG(0x8014) | |
| 77 | + | |
| 78 | +#define PNX833X_PIC_REG(offs) PNX833X_REG(0x01000 + (offs)) | |
| 79 | +#define PNX833X_PIC_INT_PRIORITY PNX833X_PIC_REG(0x0) | |
| 80 | +#define PNX833X_PIC_INT_SRC PNX833X_PIC_REG(0x4) | |
| 81 | +#define PNX833X_PIC_INT_SRC_INT_SRC_MASK 0x00000FF8ul /* bits 11:3 */ | |
| 82 | +#define PNX833X_PIC_INT_SRC_INT_SRC_SHIFT 3 | |
| 83 | +#define PNX833X_PIC_INT_REG(irq) PNX833X_PIC_REG(0x10 + 4*(irq)) | |
| 84 | + | |
| 85 | +#define PNX833X_CLOCK_CPUCP_CTL PNX833X_REG(0x9228) | |
| 86 | +#define PNX833X_CLOCK_CPUCP_CTL_EXIT_RESET 0x00000002ul /* bit 1 */ | |
| 87 | +#define PNX833X_CLOCK_CPUCP_CTL_DIV_CLOCK_MASK 0x00000018ul /* bits 4:3 */ | |
| 88 | +#define PNX833X_CLOCK_CPUCP_CTL_DIV_CLOCK_SHIFT 3 | |
| 89 | + | |
| 90 | +#define PNX8335_CLOCK_PLL_CPU_CTL PNX833X_REG(0x9020) | |
| 91 | +#define PNX8335_CLOCK_PLL_CPU_CTL_FREQ_MASK 0x1f | |
| 92 | +#define PNX8335_CLOCK_PLL_CPU_CTL_FREQ_SHIFT 0 | |
| 93 | + | |
| 94 | +#define PNX833X_CONFIG_MUX PNX833X_REG(0x7004) | |
| 95 | +#define PNX833X_CONFIG_MUX_IDE_MUX 0x00000080 /* bit 7 */ | |
| 96 | + | |
| 97 | +#define PNX8330_CONFIG_POLYFUSE_7 PNX833X_REG(0x7040) | |
| 98 | +#define PNX8330_CONFIG_POLYFUSE_7_BOOT_MODE_MASK 0x00180000 | |
| 99 | +#define PNX8330_CONFIG_POLYFUSE_7_BOOT_MODE_SHIFT 19 | |
| 100 | + | |
| 101 | +#define PNX833X_PIO_IN PNX833X_REG(0xF000) | |
| 102 | +#define PNX833X_PIO_OUT PNX833X_REG(0xF004) | |
| 103 | +#define PNX833X_PIO_DIR PNX833X_REG(0xF008) | |
| 104 | +#define PNX833X_PIO_SEL PNX833X_REG(0xF014) | |
| 105 | +#define PNX833X_PIO_INT_EDGE PNX833X_REG(0xF020) | |
| 106 | +#define PNX833X_PIO_INT_HI PNX833X_REG(0xF024) | |
| 107 | +#define PNX833X_PIO_INT_LO PNX833X_REG(0xF028) | |
| 108 | +#define PNX833X_PIO_INT_STATUS PNX833X_REG(0xFFE0) | |
| 109 | +#define PNX833X_PIO_INT_ENABLE PNX833X_REG(0xFFE4) | |
| 110 | +#define PNX833X_PIO_INT_CLEAR PNX833X_REG(0xFFE8) | |
| 111 | +#define PNX833X_PIO_IN2 PNX833X_REG(0xF05C) | |
| 112 | +#define PNX833X_PIO_OUT2 PNX833X_REG(0xF060) | |
| 113 | +#define PNX833X_PIO_DIR2 PNX833X_REG(0xF064) | |
| 114 | +#define PNX833X_PIO_SEL2 PNX833X_REG(0xF068) | |
| 115 | + | |
| 116 | +#define PNX833X_UART0_PORTS_START (PNX833X_BASE + 0xB000) | |
| 117 | +#define PNX833X_UART0_PORTS_END (PNX833X_BASE + 0xBFFF) | |
| 118 | +#define PNX833X_UART1_PORTS_START (PNX833X_BASE + 0xC000) | |
| 119 | +#define PNX833X_UART1_PORTS_END (PNX833X_BASE + 0xCFFF) | |
| 120 | + | |
| 121 | +#define PNX833X_USB_PORTS_START (PNX833X_BASE + 0x19000) | |
| 122 | +#define PNX833X_USB_PORTS_END (PNX833X_BASE + 0x19FFF) | |
| 123 | + | |
| 124 | +#define PNX833X_CONFIG_USB PNX833X_REG(0x7008) | |
| 125 | + | |
| 126 | +#define PNX833X_I2C0_PORTS_START (PNX833X_BASE + 0xD000) | |
| 127 | +#define PNX833X_I2C0_PORTS_END (PNX833X_BASE + 0xDFFF) | |
| 128 | +#define PNX833X_I2C1_PORTS_START (PNX833X_BASE + 0xE000) | |
| 129 | +#define PNX833X_I2C1_PORTS_END (PNX833X_BASE + 0xEFFF) | |
| 130 | + | |
| 131 | +#define PNX833X_IDE_PORTS_START (PNX833X_BASE + 0x1A000) | |
| 132 | +#define PNX833X_IDE_PORTS_END (PNX833X_BASE + 0x1AFFF) | |
| 133 | +#define PNX833X_IDE_MODULE_ID PNX833X_REG(0x1AFFC) | |
| 134 | + | |
| 135 | +#define PNX833X_IDE_MODULE_ID_MODULE_ID_MASK 0xFFFF0000 | |
| 136 | +#define PNX833X_IDE_MODULE_ID_MODULE_ID_SHIFT 16 | |
| 137 | +#define PNX833X_IDE_MODULE_ID_VALUE 0xA009 | |
| 138 | + | |
| 139 | + | |
| 140 | +#define PNX833X_MIU_SEL0 PNX833X_REG(0x2004) | |
| 141 | +#define PNX833X_MIU_SEL0_TIMING PNX833X_REG(0x2008) | |
| 142 | +#define PNX833X_MIU_SEL1 PNX833X_REG(0x200C) | |
| 143 | +#define PNX833X_MIU_SEL1_TIMING PNX833X_REG(0x2010) | |
| 144 | +#define PNX833X_MIU_SEL2 PNX833X_REG(0x2014) | |
| 145 | +#define PNX833X_MIU_SEL2_TIMING PNX833X_REG(0x2018) | |
| 146 | +#define PNX833X_MIU_SEL3 PNX833X_REG(0x201C) | |
| 147 | +#define PNX833X_MIU_SEL3_TIMING PNX833X_REG(0x2020) | |
| 148 | + | |
| 149 | +#define PNX833X_MIU_SEL0_SPI_MODE_ENABLE_MASK (1 << 14) | |
| 150 | +#define PNX833X_MIU_SEL0_SPI_MODE_ENABLE_SHIFT 14 | |
| 151 | + | |
| 152 | +#define PNX833X_MIU_SEL0_BURST_MODE_ENABLE_MASK (1 << 7) | |
| 153 | +#define PNX833X_MIU_SEL0_BURST_MODE_ENABLE_SHIFT 7 | |
| 154 | + | |
| 155 | +#define PNX833X_MIU_SEL0_BURST_PAGE_LEN_MASK (0xF << 9) | |
| 156 | +#define PNX833X_MIU_SEL0_BURST_PAGE_LEN_SHIFT 9 | |
| 157 | + | |
| 158 | +#define PNX833X_MIU_CONFIG_SPI PNX833X_REG(0x2000) | |
| 159 | + | |
| 160 | +#define PNX833X_MIU_CONFIG_SPI_OPCODE_MASK (0xFF << 3) | |
| 161 | +#define PNX833X_MIU_CONFIG_SPI_OPCODE_SHIFT 3 | |
| 162 | + | |
| 163 | +#define PNX833X_MIU_CONFIG_SPI_DATA_ENABLE_MASK (1 << 2) | |
| 164 | +#define PNX833X_MIU_CONFIG_SPI_DATA_ENABLE_SHIFT 2 | |
| 165 | + | |
| 166 | +#define PNX833X_MIU_CONFIG_SPI_ADDR_ENABLE_MASK (1 << 1) | |
| 167 | +#define PNX833X_MIU_CONFIG_SPI_ADDR_ENABLE_SHIFT 1 | |
| 168 | + | |
| 169 | +#define PNX833X_MIU_CONFIG_SPI_SYNC_MASK (1 << 0) | |
| 170 | +#define PNX833X_MIU_CONFIG_SPI_SYNC_SHIFT 0 | |
| 171 | + | |
| 172 | +#define PNX833X_WRITE_CONFIG_SPI(opcode, data_enable, addr_enable, sync) \ | |
| 173 | + (PNX833X_MIU_CONFIG_SPI = \ | |
| 174 | + ((opcode) << PNX833X_MIU_CONFIG_SPI_OPCODE_SHIFT) | \ | |
| 175 | + ((data_enable) << PNX833X_MIU_CONFIG_SPI_DATA_ENABLE_SHIFT) | \ | |
| 176 | + ((addr_enable) << PNX833X_MIU_CONFIG_SPI_ADDR_ENABLE_SHIFT) | \ | |
| 177 | + ((sync) << PNX833X_MIU_CONFIG_SPI_SYNC_SHIFT)) | |
| 178 | + | |
| 179 | +#define PNX8335_IP3902_PORTS_START (PNX833X_BASE + 0x2F000) | |
| 180 | +#define PNX8335_IP3902_PORTS_END (PNX833X_BASE + 0x2FFFF) | |
| 181 | +#define PNX8335_IP3902_MODULE_ID PNX833X_REG(0x2FFFC) | |
| 182 | + | |
| 183 | +#define PNX8335_IP3902_MODULE_ID_MODULE_ID_MASK 0xFFFF0000 | |
| 184 | +#define PNX8335_IP3902_MODULE_ID_MODULE_ID_SHIFT 16 | |
| 185 | +#define PNX8335_IP3902_MODULE_ID_VALUE 0x3902 | |
| 186 | + | |
| 187 | + /* I/O location(gets remapped)*/ | |
| 188 | +#define PNX8335_NAND_BASE 0x18000000 | |
| 189 | +/* I/O location with CLE high */ | |
| 190 | +#define PNX8335_NAND_CLE_MASK 0x00100000 | |
| 191 | +/* I/O location with ALE high */ | |
| 192 | +#define PNX8335_NAND_ALE_MASK 0x00010000 | |
| 193 | + | |
| 194 | +#define PNX8335_SATA_PORTS_START (PNX833X_BASE + 0x2E000) | |
| 195 | +#define PNX8335_SATA_PORTS_END (PNX833X_BASE + 0x2EFFF) | |
| 196 | +#define PNX8335_SATA_MODULE_ID PNX833X_REG(0x2EFFC) | |
| 197 | + | |
| 198 | +#define PNX8335_SATA_MODULE_ID_MODULE_ID_MASK 0xFFFF0000 | |
| 199 | +#define PNX8335_SATA_MODULE_ID_MODULE_ID_SHIFT 16 | |
| 200 | +#define PNX8335_SATA_MODULE_ID_VALUE 0xA099 | |
| 201 | + | |
| 202 | +#endif | |
| @@ -0,0 +1,25 @@ | ||
| 1 | +/* | |
| 2 | + * This file is subject to the terms and conditions of the GNU General Public | |
| 3 | + * License. See the file "COPYING" in the main directory of this archive | |
| 4 | + * for more details. | |
| 5 | + * | |
| 6 | + * Copyright (C) 2002, 2004, 2007 by Ralf Baechle <ralf@linux-mips.org> | |
| 7 | + */ | |
| 8 | +#ifndef __ASM_MIPS_MACH_PNX833X_WAR_H | |
| 9 | +#define __ASM_MIPS_MACH_PNX833X_WAR_H | |
| 10 | + | |
| 11 | +#define R4600_V1_INDEX_ICACHEOP_WAR 0 | |
| 12 | +#define R4600_V1_HIT_CACHEOP_WAR 0 | |
| 13 | +#define R4600_V2_HIT_CACHEOP_WAR 0 | |
| 14 | +#define R5432_CP0_INTERRUPT_WAR 0 | |
| 15 | +#define BCM1250_M3_WAR 0 | |
| 16 | +#define SIBYTE_1956_WAR 0 | |
| 17 | +#define MIPS4K_ICACHE_REFILL_WAR 0 | |
| 18 | +#define MIPS_CACHE_SYNC_WAR 0 | |
| 19 | +#define TX49XX_ICACHE_INDEX_INV_WAR 0 | |
| 20 | +#define RM9000_CDEX_SMP_WAR 0 | |
| 21 | +#define ICACHE_REFILLS_WORKAROUND_WAR 0 | |
| 22 | +#define R10000_LLSC_WAR 0 | |
| 23 | +#define MIPS34K_MISSED_ITLB_WAR 0 | |
| 24 | + | |
| 25 | +#endif /* __ASM_MIPS_MACH_PNX8550_WAR_H */ | |
| @@ -0,0 +1,26 @@ | ||
| 1 | +#ifndef __ASM_MACH_TX49XX_MANGLE_PORT_H | |
| 2 | +#define __ASM_MACH_TX49XX_MANGLE_PORT_H | |
| 3 | + | |
| 4 | +#define __swizzle_addr_b(port) (port) | |
| 5 | +#define __swizzle_addr_w(port) (port) | |
| 6 | +#define __swizzle_addr_l(port) (port) | |
| 7 | +#define __swizzle_addr_q(port) (port) | |
| 8 | + | |
| 9 | +#define ioswabb(a, x) (x) | |
| 10 | +#define __mem_ioswabb(a, x) (x) | |
| 11 | +#if defined(CONFIG_TOSHIBA_RBTX4939) && \ | |
| 12 | + (defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)) && \ | |
| 13 | + defined(__BIG_ENDIAN) | |
| 14 | +#define NEEDS_TXX9_IOSWABW | |
| 15 | +extern u16 (*ioswabw)(volatile u16 *a, u16 x); | |
| 16 | +extern u16 (*__mem_ioswabw)(volatile u16 *a, u16 x); | |
| 17 | +#else | |
| 18 | +#define ioswabw(a, x) le16_to_cpu(x) | |
| 19 | +#define __mem_ioswabw(a, x) (x) | |
| 20 | +#endif | |
| 21 | +#define ioswabl(a, x) le32_to_cpu(x) | |
| 22 | +#define __mem_ioswabl(a, x) (x) | |
| 23 | +#define ioswabq(a, x) le64_to_cpu(x) | |
| 24 | +#define __mem_ioswabq(a, x) (x) | |
| 25 | + | |
| 26 | +#endif /* __ASM_MACH_TX49XX_MANGLE_PORT_H */ | |
| @@ -192,6 +192,7 @@ · 191 unmodified lines | ||
| 192 | 192 | #define PM_16M 0x01ffe000 |
| 193 | 193 | #define PM_64M 0x07ffe000 |
| 194 | 194 | #define PM_256M 0x1fffe000 |
| 195 | +#define PM_1G 0x7fffe000 | |
| 195 | 196 | |
| 196 | 197 | #endif |
| 197 | 198 | |
| @@ -98,6 +98,8 @@ search_module_dbetables(unsigned long addr) · 97 unmodified lines | ||
| 98 | 98 | #define MODULE_PROC_FAMILY "R5000 " |
| 99 | 99 | #elif defined CONFIG_CPU_R5432 |
| 100 | 100 | #define MODULE_PROC_FAMILY "R5432 " |
| 101 | +#elif defined CONFIG_CPU_R5500 | |
| 102 | +#define MODULE_PROC_FAMILY "R5500 " | |
| 101 | 103 | #elif defined CONFIG_CPU_R6000 |
| 102 | 104 | #define MODULE_PROC_FAMILY "R6000 " |
| 103 | 105 | #elif defined CONFIG_CPU_NEVADA |
| @@ -80,25 +80,25 @@ enum pt_watch_style { · 79 unmodified lines | ||
| 80 | 80 | pt_watch_style_mips64 |
| 81 | 81 | }; |
| 82 | 82 | struct mips32_watch_regs { |
| 83 | − uint32_t watchlo[8]; | |
| 83 | + unsigned int watchlo[8]; | |
| 84 | 84 | /* Lower 16 bits of watchhi. */ |
| 85 | − uint16_t watchhi[8]; | |
| 85 | + unsigned short watchhi[8]; | |
| 86 | 86 | /* Valid mask and I R W bits. |
| 87 | 87 | * bit 0 -- 1 if W bit is usable. |
| 88 | 88 | * bit 1 -- 1 if R bit is usable. |
| 89 | 89 | * bit 2 -- 1 if I bit is usable. |
| 90 | 90 | * bits 3 - 11 -- Valid watchhi mask bits. |
| 91 | 91 | */ |
| 92 | − uint16_t watch_masks[8]; | |
| 92 | + unsigned short watch_masks[8]; | |
| 93 | 93 | /* The number of valid watch register pairs. */ |
| 94 | − uint32_t num_valid; | |
| 94 | + unsigned int num_valid; | |
| 95 | 95 | } __attribute__((aligned(8))); |
| 96 | 96 | |
| 97 | 97 | struct mips64_watch_regs { |
| 98 | − uint64_t watchlo[8]; | |
| 99 | − uint16_t watchhi[8]; | |
| 100 | − uint16_t watch_masks[8]; | |
| 101 | − uint32_t num_valid; | |
| 98 | + unsigned long long watchlo[8]; | |
| 99 | + unsigned short watchhi[8]; | |
| 100 | + unsigned short watch_masks[8]; | |
| 101 | + unsigned int num_valid; | |
| 102 | 102 | } __attribute__((aligned(8))); |
| 103 | 103 | |
| 104 | 104 | struct pt_watch_regs { |
| @@ -116,6 +116,7 @@ struct pt_watch_regs { · 11 unmodified lines | ||
| 116 | 116 | |
| 117 | 117 | #include <linux/compiler.h> |
| 118 | 118 | #include <linux/linkage.h> |
| 119 | +#include <linux/types.h> | |
| 119 | 120 | #include <asm/isadep.h> |
| 120 | 121 | |
| 121 | 122 | struct task_struct; |
| @@ -86,4 +86,9 @@ void txx9_iocled_init(unsigned long baseaddr, · 85 unmodified lines | ||
| 86 | 86 | int basenum, unsigned int num, int lowactive, |
| 87 | 87 | const char *color, char **deftriggers); |
| 88 | 88 | |
| 89 | +/* 7SEG LED */ | |
| 90 | +void txx9_7segled_init(unsigned int num, | |
| 91 | + void (*putc)(unsigned int pos, unsigned char val)); | |
| 92 | +int txx9_7segled_putc(unsigned int pos, char c); | |
| 93 | + | |
| 89 | 94 | #endif /* __ASM_TXX9_GENERIC_H */ |
| @@ -33,6 +33,7 @@ obj-$(CONFIG_CPU_R4X00) += r4k_fpu.o r4k_switch.o · 32 unmodified lines | ||
| 33 | 33 | obj-$(CONFIG_CPU_R5000) += r4k_fpu.o r4k_switch.o |
| 34 | 34 | obj-$(CONFIG_CPU_R6000) += r6000_fpu.o r4k_switch.o |
| 35 | 35 | obj-$(CONFIG_CPU_R5432) += r4k_fpu.o r4k_switch.o |
| 36 | +obj-$(CONFIG_CPU_R5500) += r4k_fpu.o r4k_switch.o | |
| 36 | 37 | obj-$(CONFIG_CPU_R8000) += r4k_fpu.o r4k_switch.o |
| 37 | 38 | obj-$(CONFIG_CPU_RM7000) += r4k_fpu.o r4k_switch.o |
| 38 | 39 | obj-$(CONFIG_CPU_RM9000) += r4k_fpu.o r4k_switch.o |
| @@ -180,7 +180,7 @@ bad_stack: · 179 unmodified lines | ||
| 180 | 180 | * The system call does not exist in this kernel |
| 181 | 181 | */ |
| 182 | 182 | illegal_syscall: |
| 183 | − li v0, -ENOSYS # error | |
| 183 | + li v0, ENOSYS # error | |
| 184 | 184 | sw v0, PT_R2(sp) |
| 185 | 185 | li t0, 1 # set error flag |
| 186 | 186 | sw t0, PT_R7(sp) |
| @@ -293,7 +293,7 @@ bad_alignment: · 106 unmodified lines | ||
| 293 | 293 | jr t2 |
| 294 | 294 | /* Unreached */ |
| 295 | 295 | |
| 296 | −einval: li v0, -EINVAL | |
| 296 | +einval: li v0, -ENOSYS | |
| 297 | 297 | jr ra |
| 298 | 298 | END(sys_syscall) |
| 299 | 299 | |
| @@ -117,7 +117,7 @@ syscall_trace_entry: · 116 unmodified lines | ||
| 117 | 117 | |
| 118 | 118 | illegal_syscall: |
| 119 | 119 | /* This also isn't a 64-bit syscall, throw an error. */ |
| 120 | − li v0, -ENOSYS # error | |
| 120 | + li v0, ENOSYS # error | |
| 121 | 121 | sd v0, PT_R2(sp) |
| 122 | 122 | li t0, 1 # set error flag |
| 123 | 123 | sd t0, PT_R7(sp) |
| @@ -601,8 +601,8 @@ static int __init debugfs_mips(void) · 600 unmodified lines | ||
| 601 | 601 | struct dentry *d; |
| 602 | 602 | |
| 603 | 603 | d = debugfs_create_dir("mips", NULL); |
| 604 | − if (IS_ERR(d)) | |
| 605 | − return PTR_ERR(d); | |
| 604 | + if (!d) | |
| 605 | + return -ENOMEM; | |
| 606 | 606 | mips_debugfs_dir = d; |
| 607 | 607 | return 0; |
| 608 | 608 | } |
| @@ -163,8 +163,10 @@ static void stop_this_cpu(void *dummy) · 162 unmodified lines | ||
| 163 | 163 | * Remove this CPU: |
| 164 | 164 | */ |
| 165 | 165 | cpu_clear(smp_processor_id(), cpu_online_map); |
| 166 | − local_irq_enable(); /* May need to service _machine_restart IPI */ | |
| 167 | − for (;;); /* Wait if available. */ | |
| 166 | + for (;;) { | |
| 167 | + if (cpu_wait) | |
| 168 | + (*cpu_wait)(); /* Wait if available. */ | |
| 169 | + } | |
| 168 | 170 | } |
| 169 | 171 | |
| 170 | 172 | void smp_send_stop(void) |
| @@ -560,12 +560,12 @@ static int __init debugfs_unaligned(void) · 559 unmodified lines | ||
| 560 | 560 | return -ENODEV; |
| 561 | 561 | d = debugfs_create_u32("unaligned_instructions", S_IRUGO, |
| 562 | 562 | mips_debugfs_dir, &unaligned_instructions); |
| 563 | − if (IS_ERR(d)) | |
| 564 | − return PTR_ERR(d); | |
| 563 | + if (!d) | |
| 564 | + return -ENOMEM; | |
| 565 | 565 | d = debugfs_create_u32("unaligned_action", S_IRUGO | S_IWUSR, |
| 566 | 566 | mips_debugfs_dir, &unaligned_action); |
| 567 | − if (IS_ERR(d)) | |
| 568 | − return PTR_ERR(d); | |
| 567 | + if (!d) | |
| 568 | + return -ENOMEM; | |
| 569 | 569 | return 0; |
| 570 | 570 | } |
| 571 | 571 | __initcall(debugfs_unaligned); |
| @@ -30,19 +30,20 @@ · 29 unmodified lines | ||
| 30 | 30 | #include <linux/kernel.h> |
| 31 | 31 | #include <linux/init.h> |
| 32 | 32 | #include <asm/mips-boards/bonito64.h> |
| 33 | +#include <asm/mach-lemote/pci.h> | |
| 33 | 34 | |
| 34 | 35 | extern struct pci_ops bonito64_pci_ops; |
| 35 | 36 | |
| 36 | 37 | static struct resource loongson2e_pci_mem_resource = { |
| 37 | 38 | .name = "LOONGSON2E PCI MEM", |
| 38 | − .start = 0x14000000UL, | |
| 39 | − .end = 0x1fffffffUL, | |
| 39 | + .start = LOONGSON2E_PCI_MEM_START, | |
| 40 | + .end = LOONGSON2E_PCI_MEM_END, | |
| 40 | 41 | .flags = IORESOURCE_MEM, |
| 41 | 42 | }; |
| 42 | 43 | |
| 43 | 44 | static struct resource loongson2e_pci_io_resource = { |
| 44 | 45 | .name = "LOONGSON2E PCI IO MEM", |
| 45 | − .start = 0x00004000UL, | |
| 46 | + .start = LOONGSON2E_PCI_IO_START, | |
| 46 | 47 | .end = IO_SPACE_LIMIT, |
| 47 | 48 | .flags = IORESOURCE_IO, |
| 48 | 49 | }; |
| @@ -82,6 +83,12 @@ static void __init ict_pcimap(void) · 33 unmodified lines | ||
| 82 | 83 | static int __init pcibios_init(void) |
| 83 | 84 | { |
| 84 | 85 | ict_pcimap(); |
| 86 | + | |
| 87 | + loongson2e_pci_controller.io_map_base = | |
| 88 | + (unsigned long) ioremap(LOONGSON2E_IO_PORT_BASE, | |
| 89 | + loongson2e_pci_io_resource.end - | |
| 90 | + loongson2e_pci_io_resource.start + 1); | |
| 91 | + | |
| 85 | 92 | register_pci_controller(&loongson2e_pci_controller); |
| 86 | 93 | |
| 87 | 94 | return 0; |
| @@ -34,6 +34,7 @@ · 33 unmodified lines | ||
| 34 | 34 | #include <asm/mc146818-time.h> |
| 35 | 35 | #include <asm/time.h> |
| 36 | 36 | #include <asm/wbflush.h> |
| 37 | +#include <asm/mach-lemote/pci.h> | |
| 37 | 38 | |
| 38 | 39 | #ifdef CONFIG_VT |
| 39 | 40 | #include <linux/console.h> |
| @@ -42,12 +43,6 @@ · 2 unmodified lines | ||
| 42 | 43 | |
| 43 | 44 | extern void mips_reboot_setup(void); |
| 44 | 45 | |
| 45 | −#ifdef CONFIG_64BIT | |
| 46 | −#define PTR_PAD(p) ((0xffffffff00000000)|((unsigned long long)(p))) | |
| 47 | −#else | |
| 48 | −#define PTR_PAD(p) (p) | |
| 49 | −#endif | |
| 50 | − | |
| 51 | 46 | unsigned long cpu_clock_freq; |
| 52 | 47 | unsigned long bus_clock; |
| 53 | 48 | unsigned int memsize; |
| @@ -80,8 +75,8 @@ static void wbflush_loongson2e(void) · 26 unmodified lines | ||
| 80 | 75 | |
| 81 | 76 | void __init plat_mem_setup(void) |
| 82 | 77 | { |
| 83 | − set_io_port_base(PTR_PAD(0xbfd00000)); | |
| 84 | − | |
| 78 | + set_io_port_base((unsigned long)ioremap(LOONGSON2E_IO_PORT_BASE, | |
| 79 | + IO_SPACE_LIMIT - LOONGSON2E_PCI_IO_START + 1)); | |
| 85 | 80 | mips_reboot_setup(); |
| 86 | 81 | |
| 87 | 82 | __wbflush = wbflush_loongson2e; |
| @@ -18,6 +18,7 @@ obj-$(CONFIG_CPU_R4300) += dump_tlb.o · 17 unmodified lines | ||
| 18 | 18 | obj-$(CONFIG_CPU_R4X00) += dump_tlb.o |
| 19 | 19 | obj-$(CONFIG_CPU_R5000) += dump_tlb.o |
| 20 | 20 | obj-$(CONFIG_CPU_R5432) += dump_tlb.o |
| 21 | +obj-$(CONFIG_CPU_R5500) += dump_tlb.o | |
| 21 | 22 | obj-$(CONFIG_CPU_R6000) += |
| 22 | 23 | obj-$(CONFIG_CPU_R8000) += |
| 23 | 24 | obj-$(CONFIG_CPU_RM7000) += dump_tlb.o |
| @@ -25,6 +25,7 @@ static inline const char *msk2str(unsigned int mask) · 24 unmodified lines | ||
| 25 | 25 | case PM_16M: return "16Mb"; |
| 26 | 26 | case PM_64M: return "64Mb"; |
| 27 | 27 | case PM_256M: return "256Mb"; |
| 28 | + case PM_1G: return "1Gb"; | |
| 28 | 29 | #endif |
| 29 | 30 | } |
| 30 | 31 | return ""; |
| @@ -1299,12 +1299,12 @@ static int __init debugfs_fpuemu(void) · 1298 unmodified lines | ||
| 1299 | 1299 | if (!mips_debugfs_dir) |
| 1300 | 1300 | return -ENODEV; |
| 1301 | 1301 | dir = debugfs_create_dir("fpuemustats", mips_debugfs_dir); |
| 1302 | − if (IS_ERR(dir)) | |
| 1303 | − return PTR_ERR(dir); | |
| 1302 | + if (!dir) | |
| 1303 | + return -ENOMEM; | |
| 1304 | 1304 | for (i = 0; i < ARRAY_SIZE(vars); i++) { |
| 1305 | 1305 | d = debugfs_create_u32(vars[i].name, S_IRUGO, dir, vars[i].v); |
| 1306 | − if (IS_ERR(d)) | |
| 1307 | − return PTR_ERR(d); | |
| 1306 | + if (!d) | |
| 1307 | + return -ENOMEM; | |
| 1308 | 1308 | } |
| 1309 | 1309 | return 0; |
| 1310 | 1310 | } |
| @@ -19,6 +19,7 @@ obj-$(CONFIG_CPU_R4300) += c-r4k.o cex-gen.o tlb-r4k.o · 18 unmodified lines | ||
| 19 | 19 | obj-$(CONFIG_CPU_R4X00) += c-r4k.o cex-gen.o tlb-r4k.o |
| 20 | 20 | obj-$(CONFIG_CPU_R5000) += c-r4k.o cex-gen.o tlb-r4k.o |
| 21 | 21 | obj-$(CONFIG_CPU_R5432) += c-r4k.o cex-gen.o tlb-r4k.o |
| 22 | +obj-$(CONFIG_CPU_R5500) += c-r4k.o cex-gen.o tlb-r4k.o | |
| 22 | 23 | obj-$(CONFIG_CPU_R8000) += c-r4k.o cex-gen.o tlb-r8k.o |
| 23 | 24 | obj-$(CONFIG_CPU_RM7000) += c-r4k.o cex-gen.o tlb-r4k.o |
| 24 | 25 | obj-$(CONFIG_CPU_RM9000) += c-r4k.o cex-gen.o tlb-r4k.o |
| @@ -324,7 +324,6 @@ void dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nelems, · 323 unmodified lines | ||
| 324 | 324 | if (cpu_is_noncoherent_r10000(dev)) |
| 325 | 325 | __dma_sync((unsigned long)page_address(sg_page(sg)), |
| 326 | 326 | sg->length, direction); |
| 327 | − plat_unmap_dma_mem(sg->dma_address); | |
| 328 | 327 | } |
| 329 | 328 | } |
| 330 | 329 | |
| @@ -342,7 +341,6 @@ void dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nele · 11 unmodified lines | ||
| 342 | 341 | if (!plat_device_is_coherent(dev)) |
| 343 | 342 | __dma_sync((unsigned long)page_address(sg_page(sg)), |
| 344 | 343 | sg->length, direction); |
| 345 | − plat_unmap_dma_mem(sg->dma_address); | |
| 346 | 344 | } |
| 347 | 345 | } |
| 348 | 346 | |
| @@ -0,0 +1,3 @@ | ||
| 1 | +obj-y := interrupts.o platform.o prom.o setup.o reset.o | |
| 2 | + | |
| 3 | +EXTRA_CFLAGS += -Werror | |
| @@ -0,0 +1,380 @@ | ||
| 1 | +/* | |
| 2 | + * interrupts.c: Interrupt mappings for PNX833X. | |
| 3 | + * | |
| 4 | + * Copyright 2008 NXP Semiconductors | |
| 5 | + * Chris Steel <chris.steel@nxp.com> | |
| 6 | + * Daniel Laird <daniel.j.laird@nxp.com> | |
| 7 | + * | |
| 8 | + * This program is free software; you can redistribute it and/or modify | |
| 9 | + * it under the terms of the GNU General Public License as published by | |
| 10 | + * the Free Software Foundation; either version 2 of the License, or | |
| 11 | + * (at your option) any later version. | |
| 12 | + * | |
| 13 | + * This program is distributed in the hope that it will be useful, | |
| 14 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 15 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 16 | + * GNU General Public License for more details. | |
| 17 | + * | |
| 18 | + * You should have received a copy of the GNU General Public License | |
| 19 | + * along with this program; if not, write to the Free Software | |
| 20 | + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |
| 21 | + */ | |
| 22 | +#include <linux/kernel.h> | |
| 23 | +#include <linux/irq.h> | |
| 24 | +#include <linux/hardirq.h> | |
| 25 | +#include <linux/interrupt.h> | |
| 26 | +#include <asm/mipsregs.h> | |
| 27 | +#include <asm/irq_cpu.h> | |
| 28 | +#include <irq.h> | |
| 29 | +#include <irq-mapping.h> | |
| 30 | +#include <gpio.h> | |
| 31 | + | |
| 32 | +static int mips_cpu_timer_irq; | |
| 33 | + | |
| 34 | +static const unsigned int irq_prio[PNX833X_PIC_NUM_IRQ] = | |
| 35 | +{ | |
| 36 | + 0, /* unused */ | |
| 37 | + 4, /* PNX833X_PIC_I2C0_INT 1 */ | |
| 38 | + 4, /* PNX833X_PIC_I2C1_INT 2 */ | |
| 39 | + 1, /* PNX833X_PIC_UART0_INT 3 */ | |
| 40 | + 1, /* PNX833X_PIC_UART1_INT 4 */ | |
| 41 | + 6, /* PNX833X_PIC_TS_IN0_DV_INT 5 */ | |
| 42 | + 6, /* PNX833X_PIC_TS_IN0_DMA_INT 6 */ | |
| 43 | + 7, /* PNX833X_PIC_GPIO_INT 7 */ | |
| 44 | + 4, /* PNX833X_PIC_AUDIO_DEC_INT 8 */ | |
| 45 | + 5, /* PNX833X_PIC_VIDEO_DEC_INT 9 */ | |
| 46 | + 4, /* PNX833X_PIC_CONFIG_INT 10 */ | |
| 47 | + 4, /* PNX833X_PIC_AOI_INT 11 */ | |
| 48 | + 9, /* PNX833X_PIC_SYNC_INT 12 */ | |
| 49 | + 9, /* PNX8335_PIC_SATA_INT 13 */ | |
| 50 | + 4, /* PNX833X_PIC_OSD_INT 14 */ | |
| 51 | + 9, /* PNX833X_PIC_DISP1_INT 15 */ | |
| 52 | + 4, /* PNX833X_PIC_DEINTERLACER_INT 16 */ | |
| 53 | + 9, /* PNX833X_PIC_DISPLAY2_INT 17 */ | |
| 54 | + 4, /* PNX833X_PIC_VC_INT 18 */ | |
| 55 | + 4, /* PNX833X_PIC_SC_INT 19 */ | |
| 56 | + 9, /* PNX833X_PIC_IDE_INT 20 */ | |
| 57 | + 9, /* PNX833X_PIC_IDE_DMA_INT 21 */ | |
| 58 | + 6, /* PNX833X_PIC_TS_IN1_DV_INT 22 */ | |
| 59 | + 6, /* PNX833X_PIC_TS_IN1_DMA_INT 23 */ | |
| 60 | + 4, /* PNX833X_PIC_SGDX_DMA_INT 24 */ | |
| 61 | + 4, /* PNX833X_PIC_TS_OUT_INT 25 */ | |
| 62 | + 4, /* PNX833X_PIC_IR_INT 26 */ | |
| 63 | + 3, /* PNX833X_PIC_VMSP1_INT 27 */ | |
| 64 | + 3, /* PNX833X_PIC_VMSP2_INT 28 */ | |
| 65 | + 4, /* PNX833X_PIC_PIBC_INT 29 */ | |
| 66 | + 4, /* PNX833X_PIC_TS_IN0_TRD_INT 30 */ | |
| 67 | + 4, /* PNX833X_PIC_SGDX_TPD_INT 31 */ | |
| 68 | + 5, /* PNX833X_PIC_USB_INT 32 */ | |
| 69 | + 4, /* PNX833X_PIC_TS_IN1_TRD_INT 33 */ | |
| 70 | + 4, /* PNX833X_PIC_CLOCK_INT 34 */ | |
| 71 | + 4, /* PNX833X_PIC_SGDX_PARSER_INT 35 */ | |
| 72 | + 4, /* PNX833X_PIC_VMSP_DMA_INT 36 */ | |
| 73 | +#if defined(CONFIG_SOC_PNX8335) | |
| 74 | + 4, /* PNX8335_PIC_MIU_INT 37 */ | |
| 75 | + 4, /* PNX8335_PIC_AVCHIP_IRQ_INT 38 */ | |
| 76 | + 9, /* PNX8335_PIC_SYNC_HD_INT 39 */ | |
| 77 | + 9, /* PNX8335_PIC_DISP_HD_INT 40 */ | |
| 78 | + 9, /* PNX8335_PIC_DISP_SCALER_INT 41 */ | |
| 79 | + 4, /* PNX8335_PIC_OSD_HD1_INT 42 */ | |
| 80 | + 4, /* PNX8335_PIC_DTL_WRITER_Y_INT 43 */ | |
| 81 | + 4, /* PNX8335_PIC_DTL_WRITER_C_INT 44 */ | |
| 82 | + 4, /* PNX8335_PIC_DTL_EMULATOR_Y_IR_INT 45 */ | |
| 83 | + 4, /* PNX8335_PIC_DTL_EMULATOR_C_IR_INT 46 */ | |
| 84 | + 4, /* PNX8335_PIC_DENC_TTX_INT 47 */ | |
| 85 | + 4, /* PNX8335_PIC_MMI_SIF0_INT 48 */ | |
| 86 | + 4, /* PNX8335_PIC_MMI_SIF1_INT 49 */ | |
| 87 | + 4, /* PNX8335_PIC_MMI_CDMMU_INT 50 */ | |
| 88 | + 4, /* PNX8335_PIC_PIBCS_INT 51 */ | |
| 89 | + 12, /* PNX8335_PIC_ETHERNET_INT 52 */ | |
| 90 | + 3, /* PNX8335_PIC_VMSP1_0_INT 53 */ | |
| 91 | + 3, /* PNX8335_PIC_VMSP1_1_INT 54 */ | |
| 92 | + 4, /* PNX8335_PIC_VMSP1_DMA_INT 55 */ | |
| 93 | + 4, /* PNX8335_PIC_TDGR_DE_INT 56 */ | |
| 94 | + 4, /* PNX8335_PIC_IR1_IRQ_INT 57 */ | |
| 95 | +#endif | |
| 96 | +}; | |
| 97 | + | |
| 98 | +static void pnx833x_timer_dispatch(void) | |
| 99 | +{ | |
| 100 | + do_IRQ(mips_cpu_timer_irq); | |
| 101 | +} | |
| 102 | + | |
| 103 | +static void pic_dispatch(void) | |
| 104 | +{ | |
| 105 | + unsigned int irq = PNX833X_REGFIELD(PIC_INT_SRC, INT_SRC); | |
| 106 | + | |
| 107 | + if ((irq >= 1) && (irq < (PNX833X_PIC_NUM_IRQ))) { | |
| 108 | + unsigned long priority = PNX833X_PIC_INT_PRIORITY; | |
| 109 | + PNX833X_PIC_INT_PRIORITY = irq_prio[irq]; | |
| 110 | + | |
| 111 | + if (irq == PNX833X_PIC_GPIO_INT) { | |
| 112 | + unsigned long mask = PNX833X_PIO_INT_STATUS & PNX833X_PIO_INT_ENABLE; | |
| 113 | + int pin; | |
| 114 | + while ((pin = ffs(mask & 0xffff))) { | |
| 115 | + pin -= 1; | |
| 116 | + do_IRQ(PNX833X_GPIO_IRQ_BASE + pin); | |
| 117 | + mask &= ~(1 << pin); | |
| 118 | + } | |
| 119 | + } else { | |
| 120 | + do_IRQ(irq + PNX833X_PIC_IRQ_BASE); | |
| 121 | + } | |
| 122 | + | |
| 123 | + PNX833X_PIC_INT_PRIORITY = priority; | |
| 124 | + } else { | |
| 125 | + printk(KERN_ERR "plat_irq_dispatch: unexpected irq %u\n", irq); | |
| 126 | + } | |
| 127 | +} | |
| 128 | + | |
| 129 | +asmlinkage void plat_irq_dispatch(void) | |
| 130 | +{ | |
| 131 | + unsigned int pending = read_c0_status() & read_c0_cause(); | |
| 132 | + | |
| 133 | + if (pending & STATUSF_IP4) | |
| 134 | + pic_dispatch(); | |
| 135 | + else if (pending & STATUSF_IP7) | |
| 136 | + do_IRQ(PNX833X_TIMER_IRQ); | |
| 137 | + else | |
| 138 | + spurious_interrupt(); | |
| 139 | +} | |
| 140 | + | |
| 141 | +static inline void pnx833x_hard_enable_pic_irq(unsigned int irq) | |
| 142 | +{ | |
| 143 | + /* Currently we do this by setting IRQ priority to 1. | |
| 144 | + If priority support is being implemented, 1 should be repalced | |
| 145 | + by a better value. */ | |
| 146 | + PNX833X_PIC_INT_REG(irq) = irq_prio[irq]; | |
| 147 | +} | |
| 148 | + | |
| 149 | +static inline void pnx833x_hard_disable_pic_irq(unsigned int irq) | |
| 150 | +{ | |
| 151 | + /* Disable IRQ by writing setting it's priority to 0 */ | |
| 152 | + PNX833X_PIC_INT_REG(irq) = 0; | |
| 153 | +} | |
| 154 | + | |
| 155 | +static int irqflags[PNX833X_PIC_NUM_IRQ]; /* initialized by zeroes */ | |
| 156 | +#define IRQFLAG_STARTED 1 | |
| 157 | +#define IRQFLAG_DISABLED 2 | |
| 158 | + | |
| 159 | +static DEFINE_SPINLOCK(pnx833x_irq_lock); | |
| 160 | + | |
| 161 | +static unsigned int pnx833x_startup_pic_irq(unsigned int irq) | |
| 162 | +{ | |
| 163 | + unsigned long flags; | |
| 164 | + unsigned int pic_irq = irq - PNX833X_PIC_IRQ_BASE; | |
| 165 | + | |
| 166 | + spin_lock_irqsave(&pnx833x_irq_lock, flags); | |
| 167 | + | |
| 168 | + irqflags[pic_irq] = IRQFLAG_STARTED; /* started, not disabled */ | |
| 169 | + pnx833x_hard_enable_pic_irq(pic_irq); | |
| 170 | + | |
| 171 | + spin_unlock_irqrestore(&pnx833x_irq_lock, flags); | |
| 172 | + return 0; | |
| 173 | +} | |
| 174 | + | |
| 175 | +static void pnx833x_shutdown_pic_irq(unsigned int irq) | |
| 176 | +{ | |
| 177 | + unsigned long flags; | |
| 178 | + unsigned int pic_irq = irq - PNX833X_PIC_IRQ_BASE; | |
| 179 | + | |
| 180 | + spin_lock_irqsave(&pnx833x_irq_lock, flags); | |
| 181 | + | |
| 182 | + irqflags[pic_irq] = 0; /* not started */ | |
| 183 | + pnx833x_hard_disable_pic_irq(pic_irq); | |
| 184 | + | |
| 185 | + spin_unlock_irqrestore(&pnx833x_irq_lock, flags); | |
| 186 | +} | |
| 187 | + | |
| 188 | +static void pnx833x_enable_pic_irq(unsigned int irq) | |
| 189 | +{ | |
| 190 | + unsigned long flags; | |
| 191 | + unsigned int pic_irq = irq - PNX833X_PIC_IRQ_BASE; | |
| 192 | + | |
| 193 | + spin_lock_irqsave(&pnx833x_irq_lock, flags); | |
| 194 | + | |
| 195 | + irqflags[pic_irq] &= ~IRQFLAG_DISABLED; | |
| 196 | + if (irqflags[pic_irq] == IRQFLAG_STARTED) | |
| 197 | + pnx833x_hard_enable_pic_irq(pic_irq); | |
| 198 | + | |
| 199 | + spin_unlock_irqrestore(&pnx833x_irq_lock, flags); | |
| 200 | +} | |
| 201 | + | |
| 202 | +static void pnx833x_disable_pic_irq(unsigned int irq) | |
| 203 | +{ | |
| 204 | + unsigned long flags; | |
| 205 | + unsigned int pic_irq = irq - PNX833X_PIC_IRQ_BASE; | |
| 206 | + | |
| 207 | + spin_lock_irqsave(&pnx833x_irq_lock, flags); | |
| 208 | + | |
| 209 | + irqflags[pic_irq] |= IRQFLAG_DISABLED; | |
| 210 | + pnx833x_hard_disable_pic_irq(pic_irq); | |
| 211 | + | |
| 212 | + spin_unlock_irqrestore(&pnx833x_irq_lock, flags); | |
| 213 | +} | |
| 214 | + | |
| 215 | +static void pnx833x_ack_pic_irq(unsigned int irq) | |
| 216 | +{ | |
| 217 | +} | |
| 218 | + | |
| 219 | +static void pnx833x_end_pic_irq(unsigned int irq) | |
| 220 | +{ | |
| 221 | +} | |
| 222 | + | |
| 223 | +static DEFINE_SPINLOCK(pnx833x_gpio_pnx833x_irq_lock); | |
| 224 | + | |
| 225 | +static unsigned int pnx833x_startup_gpio_irq(unsigned int irq) | |
| 226 | +{ | |
| 227 | + int pin = irq - PNX833X_GPIO_IRQ_BASE; | |
| 228 | + unsigned long flags; | |
| 229 | + spin_lock_irqsave(&pnx833x_gpio_pnx833x_irq_lock, flags); | |
| 230 | + pnx833x_gpio_enable_irq(pin); | |
| 231 | + spin_unlock_irqrestore(&pnx833x_gpio_pnx833x_irq_lock, flags); | |
| 232 | + return 0; | |
| 233 | +} | |
| 234 | + | |
| 235 | +static void pnx833x_enable_gpio_irq(unsigned int irq) | |
| 236 | +{ | |
| 237 | + int pin = irq - PNX833X_GPIO_IRQ_BASE; | |
| 238 | + unsigned long flags; | |
| 239 | + spin_lock_irqsave(&pnx833x_gpio_pnx833x_irq_lock, flags); | |
| 240 | + pnx833x_gpio_enable_irq(pin); | |
| 241 | + spin_unlock_irqrestore(&pnx833x_gpio_pnx833x_irq_lock, flags); | |
| 242 | +} | |
| 243 | + | |
| 244 | +static void pnx833x_disable_gpio_irq(unsigned int irq) | |
| 245 | +{ | |
| 246 | + int pin = irq - PNX833X_GPIO_IRQ_BASE; | |
| 247 | + unsigned long flags; | |
| 248 | + spin_lock_irqsave(&pnx833x_gpio_pnx833x_irq_lock, flags); | |
| 249 | + pnx833x_gpio_disable_irq(pin); | |
| 250 | + spin_unlock_irqrestore(&pnx833x_gpio_pnx833x_irq_lock, flags); | |
| 251 | +} | |
| 252 | + | |
| 253 | +static void pnx833x_ack_gpio_irq(unsigned int irq) | |
| 254 | +{ | |
| 255 | +} | |
| 256 | + | |
| 257 | +static void pnx833x_end_gpio_irq(unsigned int irq) | |
| 258 | +{ | |
| 259 | + int pin = irq - PNX833X_GPIO_IRQ_BASE; | |
| 260 | + unsigned long flags; | |
| 261 | + spin_lock_irqsave(&pnx833x_gpio_pnx833x_irq_lock, flags); | |
| 262 | + pnx833x_gpio_clear_irq(pin); | |
| 263 | + spin_unlock_irqrestore(&pnx833x_gpio_pnx833x_irq_lock, flags); | |
| 264 | +} | |
| 265 | + | |
| 266 | +static int pnx833x_set_type_gpio_irq(unsigned int irq, unsigned int flow_type) | |
| 267 | +{ | |
| 268 | + int pin = irq - PNX833X_GPIO_IRQ_BASE; | |
| 269 | + int gpio_mode; | |
| 270 | + | |
| 271 | + switch (flow_type) { | |
| 272 | + case IRQ_TYPE_EDGE_RISING: | |
| 273 | + gpio_mode = GPIO_INT_EDGE_RISING; | |
| 274 | + break; | |
| 275 | + case IRQ_TYPE_EDGE_FALLING: | |
| 276 | + gpio_mode = GPIO_INT_EDGE_FALLING; | |
| 277 | + break; | |
| 278 | + case IRQ_TYPE_EDGE_BOTH: | |
| 279 | + gpio_mode = GPIO_INT_EDGE_BOTH; | |
| 280 | + break; | |
| 281 | + case IRQ_TYPE_LEVEL_HIGH: | |
| 282 | + gpio_mode = GPIO_INT_LEVEL_HIGH; | |
| 283 | + break; | |
| 284 | + case IRQ_TYPE_LEVEL_LOW: | |
| 285 | + gpio_mode = GPIO_INT_LEVEL_LOW; | |
| 286 | + break; | |
| 287 | + default: | |
| 288 | + gpio_mode = GPIO_INT_NONE; | |
| 289 | + break; | |
| 290 | + } | |
| 291 | + | |
| 292 | + pnx833x_gpio_setup_irq(gpio_mode, pin); | |
| 293 | + | |
| 294 | + return 0; | |
| 295 | +} | |
| 296 | + | |
| 297 | +static struct irq_chip pnx833x_pic_irq_type = { | |
| 298 | + .typename = "PNX-PIC", | |
| 299 | + .startup = pnx833x_startup_pic_irq, | |
| 300 | + .shutdown = pnx833x_shutdown_pic_irq, | |
| 301 | + .enable = pnx833x_enable_pic_irq, | |
| 302 | + .disable = pnx833x_disable_pic_irq, | |
| 303 | + .ack = pnx833x_ack_pic_irq, | |
| 304 | + .end = pnx833x_end_pic_irq | |
| 305 | +}; | |
| 306 | + | |
| 307 | +static struct irq_chip pnx833x_gpio_irq_type = { | |
| 308 | + .typename = "PNX-GPIO", | |
| 309 | + .startup = pnx833x_startup_gpio_irq, | |
| 310 | + .shutdown = pnx833x_disable_gpio_irq, | |
| 311 | + .enable = pnx833x_enable_gpio_irq, | |
| 312 | + .disable = pnx833x_disable_gpio_irq, | |
| 313 | + .ack = pnx833x_ack_gpio_irq, | |
| 314 | + .end = pnx833x_end_gpio_irq, | |
| 315 | + .set_type = pnx833x_set_type_gpio_irq | |
| 316 | +}; | |
| 317 | + | |
| 318 | +void __init arch_init_irq(void) | |
| 319 | +{ | |
| 320 | + unsigned int irq; | |
| 321 | + | |
| 322 | + /* setup standard internal cpu irqs */ | |
| 323 | + mips_cpu_irq_init(); | |
| 324 | + | |
| 325 | + /* Set IRQ information in irq_desc */ | |
| 326 | + for (irq = PNX833X_PIC_IRQ_BASE; irq < (PNX833X_PIC_IRQ_BASE + PNX833X_PIC_NUM_IRQ); irq++) { | |
| 327 | + pnx833x_hard_disable_pic_irq(irq); | |
| 328 | + set_irq_chip_and_handler(irq, &pnx833x_pic_irq_type, handle_simple_irq); | |
| 329 | + } | |
| 330 | + | |
| 331 | + for (irq = PNX833X_GPIO_IRQ_BASE; irq < (PNX833X_GPIO_IRQ_BASE + PNX833X_GPIO_NUM_IRQ); irq++) | |
| 332 | + set_irq_chip_and_handler(irq, &pnx833x_gpio_irq_type, handle_simple_irq); | |
| 333 | + | |
| 334 | + /* Set PIC priority limiter register to 0 */ | |
| 335 | + PNX833X_PIC_INT_PRIORITY = 0; | |
| 336 | + | |
| 337 | + /* Setup GPIO IRQ dispatching */ | |
| 338 | + pnx833x_startup_pic_irq(PNX833X_PIC_GPIO_INT); | |
| 339 | + | |
| 340 | + /* Enable PIC IRQs (HWIRQ2) */ | |
| 341 | + if (cpu_has_vint) | |
| 342 | + set_vi_handler(4, pic_dispatch); | |
| 343 | + | |
| 344 | + write_c0_status(read_c0_status() | IE_IRQ2); | |
| 345 | +} | |
| 346 | + | |
| 347 | +unsigned int __cpuinit get_c0_compare_int(void) | |
| 348 | +{ | |
| 349 | + if (cpu_has_vint) | |
| 350 | + set_vi_handler(cp0_compare_irq, pnx833x_timer_dispatch); | |
| 351 | + | |
| 352 | + mips_cpu_timer_irq = MIPS_CPU_IRQ_BASE + cp0_compare_irq; | |
| 353 | + return mips_cpu_timer_irq; | |
| 354 | +} | |
| 355 | + | |
| 356 | +void __init plat_time_init(void) | |
| 357 | +{ | |
| 358 | + /* calculate mips_hpt_frequency based on PNX833X_CLOCK_CPUCP_CTL reg */ | |
| 359 | + | |
| 360 | + extern unsigned long mips_hpt_frequency; | |
| 361 | + unsigned long reg = PNX833X_CLOCK_CPUCP_CTL; | |
| 362 | + | |
| 363 | + if (!(PNX833X_BIT(reg, CLOCK_CPUCP_CTL, EXIT_RESET))) { | |
| 364 | + /* Functional clock is disabled so use crystal frequency */ | |
| 365 | + mips_hpt_frequency = 25; | |
| 366 | + } else { | |
| 367 | +#if defined(CONFIG_SOC_PNX8335) | |
| 368 | + /* Functional clock is enabled, so get clock multiplier */ | |
| 369 | + mips_hpt_frequency = 90 + (10 * PNX8335_REGFIELD(CLOCK_PLL_CPU_CTL, FREQ)); | |
| 370 | +#else | |
| 371 | + static const unsigned long int freq[4] = {240, 160, 120, 80}; | |
| 372 | + mips_hpt_frequency = freq[PNX833X_FIELD(reg, CLOCK_CPUCP_CTL, DIV_CLOCK)]; | |
| 373 | +#endif | |
| 374 | + } | |
| 375 | + | |
| 376 | + printk(KERN_INFO "CPU clock is %ld MHz\n", mips_hpt_frequency); | |
| 377 | + | |
| 378 | + mips_hpt_frequency *= 500000; | |
| 379 | +} | |
| 380 | + | |
| @@ -0,0 +1,319 @@ | ||
| 1 | +/* | |
| 2 | + * platform.c: platform support for PNX833X. | |
| 3 | + * | |
| 4 | + * Copyright 2008 NXP Semiconductors | |
| 5 | + * Chris Steel <chris.steel@nxp.com> | |
| 6 | + * Daniel Laird <daniel.j.laird@nxp.com> | |
| 7 | + * | |
| 8 | + * Based on software written by: | |
| 9 | + * Nikita Youshchenko <yoush@debian.org>, based on PNX8550 code. | |
| 10 | + * | |
| 11 | + * This program is free software; you can redistribute it and/or modify | |
| 12 | + * it under the terms of the GNU General Public License as published by | |
| 13 | + * the Free Software Foundation; either version 2 of the License, or | |
| 14 | + * (at your option) any later version. | |
| 15 | + * | |
| 16 | + * This program is distributed in the hope that it will be useful, | |
| 17 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 18 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 19 | + * GNU General Public License for more details. | |
| 20 | + * | |
| 21 | + * You should have received a copy of the GNU General Public License | |
| 22 | + * along with this program; if not, write to the Free Software | |
| 23 | + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |
| 24 | + */ | |
| 25 | +#include <linux/device.h> | |
| 26 | +#include <linux/dma-mapping.h> | |
| 27 | +#include <linux/platform_device.h> | |
| 28 | +#include <linux/kernel.h> | |
| 29 | +#include <linux/init.h> | |
| 30 | +#include <linux/resource.h> | |
| 31 | +#include <linux/serial.h> | |
| 32 | +#include <linux/serial_pnx8xxx.h> | |
| 33 | +#include <linux/mtd/nand.h> | |
| 34 | +#include <linux/mtd/partitions.h> | |
| 35 | + | |
| 36 | +#ifdef CONFIG_I2C_PNX0105 | |
| 37 | +/* Until i2c driver available in kernel.*/ | |
| 38 | +#include <linux/i2c-pnx0105.h> | |
| 39 | +#endif | |
| 40 | + | |
| 41 | +#include <irq.h> | |
| 42 | +#include <irq-mapping.h> | |
| 43 | +#include <pnx833x.h> | |
| 44 | + | |
| 45 | +static u64 uart_dmamask = DMA_32BIT_MASK; | |
| 46 | + | |
| 47 | +static struct resource pnx833x_uart_resources[] = { | |
| 48 | + [0] = { | |
| 49 | + .start = PNX833X_UART0_PORTS_START, | |
| 50 | + .end = PNX833X_UART0_PORTS_END, | |
| 51 | + .flags = IORESOURCE_MEM, | |
| 52 | + }, | |
| 53 | + [1] = { | |
| 54 | + .start = PNX833X_PIC_UART0_INT, | |
| 55 | + .end = PNX833X_PIC_UART0_INT, | |
| 56 | + .flags = IORESOURCE_IRQ, | |
| 57 | + }, | |
| 58 | + [2] = { | |
| 59 | + .start = PNX833X_UART1_PORTS_START, | |
| 60 | + .end = PNX833X_UART1_PORTS_END, | |
| 61 | + .flags = IORESOURCE_MEM, | |
| 62 | + }, | |
| 63 | + [3] = { | |
| 64 | + .start = PNX833X_PIC_UART1_INT, | |
| 65 | + .end = PNX833X_PIC_UART1_INT, | |
| 66 | + .flags = IORESOURCE_IRQ, | |
| 67 | + }, | |
| 68 | +}; | |
| 69 | + | |
| 70 | +struct pnx8xxx_port pnx8xxx_ports[] = { | |
| 71 | + [0] = { | |
| 72 | + .port = { | |
| 73 | + .type = PORT_PNX8XXX, | |
| 74 | + .iotype = UPIO_MEM, | |
| 75 | + .membase = (void __iomem *)PNX833X_UART0_PORTS_START, | |
| 76 | + .mapbase = PNX833X_UART0_PORTS_START, | |
| 77 | + .irq = PNX833X_PIC_UART0_INT, | |
| 78 | + .uartclk = 3692300, | |
| 79 | + .fifosize = 16, | |
| 80 | + .flags = UPF_BOOT_AUTOCONF, | |
| 81 | + .line = 0, | |
| 82 | + }, | |
| 83 | + }, | |
| 84 | + [1] = { | |
| 85 | + .port = { | |
| 86 | + .type = PORT_PNX8XXX, | |
| 87 | + .iotype = UPIO_MEM, | |
| 88 | + .membase = (void __iomem *)PNX833X_UART1_PORTS_START, | |
| 89 | + .mapbase = PNX833X_UART1_PORTS_START, | |
| 90 | + .irq = PNX833X_PIC_UART1_INT, | |
| 91 | + .uartclk = 3692300, | |
| 92 | + .fifosize = 16, | |
| 93 | + .flags = UPF_BOOT_AUTOCONF, | |
| 94 | + .line = 1, | |
| 95 | + }, | |
| 96 | + }, | |
| 97 | +}; | |
| 98 | + | |
| 99 | +static struct platform_device pnx833x_uart_device = { | |
| 100 | + .name = "pnx8xxx-uart", | |
| 101 | + .id = -1, | |
| 102 | + .dev = { | |
| 103 | + .dma_mask = &uart_dmamask, | |
| 104 | + .coherent_dma_mask = DMA_32BIT_MASK, | |
| 105 | + .platform_data = pnx8xxx_ports, | |
| 106 | + }, | |
| 107 | + .num_resources = ARRAY_SIZE(pnx833x_uart_resources), | |
| 108 | + .resource = pnx833x_uart_resources, | |
| 109 | +}; | |
| 110 | + | |
| 111 | +static u64 ehci_dmamask = DMA_32BIT_MASK; | |
| 112 | + | |
| 113 | +static struct resource pnx833x_usb_ehci_resources[] = { | |
| 114 | + [0] = { | |
| 115 | + .start = PNX833X_USB_PORTS_START, | |
| 116 | + .end = PNX833X_USB_PORTS_END, | |
| 117 | + .flags = IORESOURCE_MEM, | |
| 118 | + }, | |
| 119 | + [1] = { | |
| 120 | + .start = PNX833X_PIC_USB_INT, | |
| 121 | + .end = PNX833X_PIC_USB_INT, | |
| 122 | + .flags = IORESOURCE_IRQ, | |
| 123 | + }, | |
| 124 | +}; | |
| 125 | + | |
| 126 | +static struct platform_device pnx833x_usb_ehci_device = { | |
| 127 | + .name = "pnx833x-ehci", | |
| 128 | + .id = -1, | |
| 129 | + .dev = { | |
| 130 | + .dma_mask = &ehci_dmamask, | |
| 131 | + .coherent_dma_mask = DMA_32BIT_MASK, | |
| 132 | + }, | |
| 133 | + .num_resources = ARRAY_SIZE(pnx833x_usb_ehci_resources), | |
| 134 | + .resource = pnx833x_usb_ehci_resources, | |
| 135 | +}; | |
| 136 | + | |
| 137 | +#ifdef CONFIG_I2C_PNX0105 | |
| 138 | +static struct resource pnx833x_i2c0_resources[] = { | |
| 139 | + { | |
| 140 | + .start = PNX833X_I2C0_PORTS_START, | |
| 141 | + .end = PNX833X_I2C0_PORTS_END, | |
| 142 | + .flags = IORESOURCE_MEM, | |
| 143 | + }, | |
| 144 | + { | |
| 145 | + .start = PNX833X_PIC_I2C0_INT, | |
| 146 | + .end = PNX833X_PIC_I2C0_INT, | |
| 147 | + .flags = IORESOURCE_IRQ, | |
| 148 | + }, | |
| 149 | +}; | |
| 150 | + | |
| 151 | +static struct resource pnx833x_i2c1_resources[] = { | |
| 152 | + { | |
| 153 | + .start = PNX833X_I2C1_PORTS_START, | |
| 154 | + .end = PNX833X_I2C1_PORTS_END, | |
| 155 | + .flags = IORESOURCE_MEM, | |
| 156 | + }, | |
| 157 | + { | |
| 158 | + .start = PNX833X_PIC_I2C1_INT, | |
| 159 | + .end = PNX833X_PIC_I2C1_INT, | |
| 160 | + .flags = IORESOURCE_IRQ, | |
| 161 | + }, | |
| 162 | +}; | |
| 163 | + | |
| 164 | +static struct i2c_pnx0105_dev pnx833x_i2c_dev[] = { | |
| 165 | + { | |
| 166 | + .base = PNX833X_I2C0_PORTS_START, | |
| 167 | + .irq = -1, /* should be PNX833X_PIC_I2C0_INT but polling is faster */ | |
| 168 | + .clock = 6, /* 0 == 400 kHz, 4 == 100 kHz(Maximum HDMI), 6 = 50kHz(Prefered HDCP) */ | |
| 169 | + .bus_addr = 0, /* no slave support */ | |
| 170 | + }, | |
| 171 | + { | |
| 172 | + .base = PNX833X_I2C1_PORTS_START, | |
| 173 | + .irq = -1, /* on high freq, polling is faster */ | |
| 174 | + /*.irq = PNX833X_PIC_I2C1_INT,*/ | |
| 175 | + .clock = 4, /* 0 == 400 kHz, 4 == 100 kHz. 100 kHz seems a safe default for now */ | |
| 176 | + .bus_addr = 0, /* no slave support */ | |
| 177 | + }, | |
| 178 | +}; | |
| 179 | + | |
| 180 | +static struct platform_device pnx833x_i2c0_device = { | |
| 181 | + .name = "i2c-pnx0105", | |
| 182 | + .id = 0, | |
| 183 | + .dev = { | |
| 184 | + .platform_data = &pnx833x_i2c_dev[0], | |
| 185 | + }, | |
| 186 | + .num_resources = ARRAY_SIZE(pnx833x_i2c0_resources), | |
| 187 | + .resource = pnx833x_i2c0_resources, | |
| 188 | +}; | |
| 189 | + | |
| 190 | +static struct platform_device pnx833x_i2c1_device = { | |
| 191 | + .name = "i2c-pnx0105", | |
| 192 | + .id = 1, | |
| 193 | + .dev = { | |
| 194 | + .platform_data = &pnx833x_i2c_dev[1], | |
| 195 | + }, | |
| 196 | + .num_resources = ARRAY_SIZE(pnx833x_i2c1_resources), | |
| 197 | + .resource = pnx833x_i2c1_resources, | |
| 198 | +}; | |
| 199 | +#endif | |
| 200 | + | |
| 201 | +static u64 ethernet_dmamask = DMA_32BIT_MASK; | |
| 202 | + | |
| 203 | +static struct resource pnx833x_ethernet_resources[] = { | |
| 204 | + [0] = { | |
| 205 | + .start = PNX8335_IP3902_PORTS_START, | |
| 206 | + .end = PNX8335_IP3902_PORTS_END, | |
| 207 | + .flags = IORESOURCE_MEM, | |
| 208 | + }, | |
| 209 | + [1] = { | |
| 210 | + .start = PNX8335_PIC_ETHERNET_INT, | |
| 211 | + .end = PNX8335_PIC_ETHERNET_INT, | |
| 212 | + .flags = IORESOURCE_IRQ, | |
| 213 | + }, | |
| 214 | +}; | |
| 215 | + | |
| 216 | +static struct platform_device pnx833x_ethernet_device = { | |
| 217 | + .name = "ip3902-eth", | |
| 218 | + .id = -1, | |
| 219 | + .dev = { | |
| 220 | + .dma_mask = ðernet_dmamask, | |
| 221 | + .coherent_dma_mask = DMA_32BIT_MASK, | |
| 222 | + }, | |
| 223 | + .num_resources = ARRAY_SIZE(pnx833x_ethernet_resources), | |
| 224 | + .resource = pnx833x_ethernet_resources, | |
| 225 | +}; | |
| 226 | + | |
| 227 | +static struct resource pnx833x_sata_resources[] = { | |
| 228 | + [0] = { | |
| 229 | + .start = PNX8335_SATA_PORTS_START, | |
| 230 | + .end = PNX8335_SATA_PORTS_END, | |
| 231 | + .flags = IORESOURCE_MEM, | |
| 232 | + }, | |
| 233 | + [1] = { | |
| 234 | + .start = PNX8335_PIC_SATA_INT, | |
| 235 | + .end = PNX8335_PIC_SATA_INT, | |
| 236 | + .flags = IORESOURCE_IRQ, | |
| 237 | + }, | |
| 238 | +}; | |
| 239 | + | |
| 240 | +static struct platform_device pnx833x_sata_device = { | |
| 241 | + .name = "pnx833x-sata", | |
| 242 | + .id = -1, | |
| 243 | + .num_resources = ARRAY_SIZE(pnx833x_sata_resources), | |
| 244 | + .resource = pnx833x_sata_resources, | |
| 245 | +}; | |
| 246 | + | |
| 247 | +static const char *part_probes[] = { | |
| 248 | + "cmdlinepart", | |
| 249 | + NULL | |
| 250 | +}; | |
| 251 | + | |
| 252 | +static void | |
| 253 | +pnx833x_flash_nand_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl) | |
| 254 | +{ | |
| 255 | + struct nand_chip *this = mtd->priv; | |
| 256 | + unsigned long nandaddr = (unsigned long)this->IO_ADDR_W; | |
| 257 | + | |
| 258 | + if (cmd == NAND_CMD_NONE) | |
| 259 | + return; | |
| 260 | + | |
| 261 | + if (ctrl & NAND_CLE) | |
| 262 | + writeb(cmd, (void __iomem *)(nandaddr + PNX8335_NAND_CLE_MASK)); | |
| 263 | + else | |
| 264 | + writeb(cmd, (void __iomem *)(nandaddr + PNX8335_NAND_ALE_MASK)); | |
| 265 | +} | |
| 266 | + | |
| 267 | +static struct platform_nand_data pnx833x_flash_nand_data = { | |
| 268 | + .chip = { | |
| 269 | + .chip_delay = 25, | |
| 270 | + .part_probe_types = part_probes, | |
| 271 | + }, | |
| 272 | + .ctrl = { | |
| 273 | + .cmd_ctrl = pnx833x_flash_nand_cmd_ctrl | |
| 274 | + } | |
| 275 | +}; | |
| 276 | + | |
| 277 | +/* | |
| 278 | + * Set start to be the correct address (PNX8335_NAND_BASE with no 0xb!!), | |
| 279 | + * 12 bytes more seems to be the standard that allows for NAND access. | |
| 280 | + */ | |
| 281 | +static struct resource pnx833x_flash_nand_resource = { | |
| 282 | + .start = PNX8335_NAND_BASE, | |
| 283 | + .end = PNX8335_NAND_BASE + 12, | |
| 284 | + .flags = IORESOURCE_MEM, | |
| 285 | +}; | |
| 286 | + | |
| 287 | +static struct platform_device pnx833x_flash_nand = { | |
| 288 | + .name = "gen_nand", | |
| 289 | + .id = -1, | |
| 290 | + .num_resources = 1, | |
| 291 | + .resource = &pnx833x_flash_nand_resource, | |
| 292 | + .dev = { | |
| 293 | + .platform_data = &pnx833x_flash_nand_data, | |
| 294 | + }, | |
| 295 | +}; | |
| 296 | + | |
| 297 | +static struct platform_device *pnx833x_platform_devices[] __initdata = { | |
| 298 | + &pnx833x_uart_device, | |
| 299 | + &pnx833x_usb_ehci_device, | |
| 300 | +#ifdef CONFIG_I2C_PNX0105 | |
| 301 | + &pnx833x_i2c0_device, | |
| 302 | + &pnx833x_i2c1_device, | |
| 303 | +#endif | |
| 304 | + &pnx833x_ethernet_device, | |
| 305 | + &pnx833x_sata_device, | |
| 306 | + &pnx833x_flash_nand, | |
| 307 | +}; | |
| 308 | + | |
| 309 | +static int __init pnx833x_platform_init(void) | |
| 310 | +{ | |
| 311 | + int res; | |
| 312 | + | |
| 313 | + res = platform_add_devices(pnx833x_platform_devices, | |
| 314 | + ARRAY_SIZE(pnx833x_platform_devices)); | |
| 315 | + | |
| 316 | + return res; | |
| 317 | +} | |
| 318 | + | |
| 319 | +arch_initcall(pnx833x_platform_init); | |
| @@ -0,0 +1,70 @@ | ||
| 1 | +/* | |
| 2 | + * prom.c: | |
| 3 | + * | |
| 4 | + * Copyright 2008 NXP Semiconductors | |
| 5 | + * Chris Steel <chris.steel@nxp.com> | |
| 6 | + * Daniel Laird <daniel.j.laird@nxp.com> | |
| 7 | + * | |
| 8 | + * Based on software written by: | |
| 9 | + * Nikita Youshchenko <yoush@debian.org>, based on PNX8550 code. | |
| 10 | + * | |
| 11 | + * This program is free software; you can redistribute it and/or modify | |
| 12 | + * it under the terms of the GNU General Public License as published by | |
| 13 | + * the Free Software Foundation; either version 2 of the License, or | |
| 14 | + * (at your option) any later version. | |
| 15 | + * | |
| 16 | + * This program is distributed in the hope that it will be useful, | |
| 17 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 18 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 19 | + * GNU General Public License for more details. | |
| 20 | + * | |
| 21 | + * You should have received a copy of the GNU General Public License | |
| 22 | + * along with this program; if not, write to the Free Software | |
| 23 | + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |
| 24 | + */ | |
| 25 | +#include <linux/init.h> | |
| 26 | +#include <asm/bootinfo.h> | |
| 27 | +#include <linux/string.h> | |
| 28 | + | |
| 29 | +void __init prom_init_cmdline(void) | |
| 30 | +{ | |
| 31 | + int argc = fw_arg0; | |
| 32 | + char **argv = (char **)fw_arg1; | |
| 33 | + char *c = &(arcs_cmdline[0]); | |
| 34 | + int i; | |
| 35 | + | |
| 36 | + for (i = 1; i < argc; i++) { | |
| 37 | + strcpy(c, argv[i]); | |
| 38 | + c += strlen(argv[i]); | |
| 39 | + if (i < argc-1) | |
| 40 | + *c++ = ' '; | |
| 41 | + } | |
| 42 | + *c = 0; | |
| 43 | +} | |
| 44 | + | |
| 45 | +char __init *prom_getenv(char *envname) | |
| 46 | +{ | |
| 47 | + extern char **prom_envp; | |
| 48 | + char **env = prom_envp; | |
| 49 | + int i; | |
| 50 | + | |
| 51 | + i = strlen(envname); | |
| 52 | + | |
| 53 | + while (*env) { | |
| 54 | + if (strncmp(envname, *env, i) == 0 && *(*env+i) == '=') | |
| 55 | + return *env + i + 1; | |
| 56 | + env++; | |
| 57 | + } | |
| 58 | + | |
| 59 | + return 0; | |
| 60 | +} | |
| 61 | + | |
| 62 | +void __init prom_free_prom_memory(void) | |
| 63 | +{ | |
| 64 | +} | |
| 65 | + | |
| 66 | +char * __init prom_getcmdline(void) | |
| 67 | +{ | |
| 68 | + return arcs_cmdline; | |
| 69 | +} | |
| 70 | + | |
| @@ -0,0 +1,45 @@ | ||
| 1 | +/* | |
| 2 | + * reset.c: reset support for PNX833X. | |
| 3 | + * | |
| 4 | + * Copyright 2008 NXP Semiconductors | |
| 5 | + * Chris Steel <chris.steel@nxp.com> | |
| 6 | + * Daniel Laird <daniel.j.laird@nxp.com> | |
| 7 | + * | |
| 8 | + * Based on software written by: | |
| 9 | + * Nikita Youshchenko <yoush@debian.org>, based on PNX8550 code. | |
| 10 | + * | |
| 11 | + * This program is free software; you can redistribute it and/or modify | |
| 12 | + * it under the terms of the GNU General Public License as published by | |
| 13 | + * the Free Software Foundation; either version 2 of the License, or | |
| 14 | + * (at your option) any later version. | |
| 15 | + * | |
| 16 | + * This program is distributed in the hope that it will be useful, | |
| 17 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 18 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 19 | + * GNU General Public License for more details. | |
| 20 | + * | |
| 21 | + * You should have received a copy of the GNU General Public License | |
| 22 | + * along with this program; if not, write to the Free Software | |
| 23 | + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |
| 24 | + */ | |
| 25 | +#include <linux/slab.h> | |
| 26 | +#include <linux/reboot.h> | |
| 27 | +#include <pnx833x.h> | |
| 28 | + | |
| 29 | +void pnx833x_machine_restart(char *command) | |
| 30 | +{ | |
| 31 | + PNX833X_RESET_CONTROL_2 = 0; | |
| 32 | + PNX833X_RESET_CONTROL = 0; | |
| 33 | +} | |
| 34 | + | |
| 35 | +void pnx833x_machine_halt(void) | |
| 36 | +{ | |
| 37 | + while (1) | |
| 38 | + __asm__ __volatile__ ("wait"); | |
| 39 | + | |
| 40 | +} | |
| 41 | + | |
| 42 | +void pnx833x_machine_power_off(void) | |
| 43 | +{ | |
| 44 | + pnx833x_machine_halt(); | |
| 45 | +} | |
| @@ -0,0 +1,64 @@ | ||
| 1 | +/* | |
| 2 | + * setup.c: Setup PNX833X Soc. | |
| 3 | + * | |
| 4 | + * Copyright 2008 NXP Semiconductors | |
| 5 | + * Chris Steel <chris.steel@nxp.com> | |
| 6 | + * Daniel Laird <daniel.j.laird@nxp.com> | |
| 7 | + * | |
| 8 | + * Based on software written by: | |
| 9 | + * Nikita Youshchenko <yoush@debian.org>, based on PNX8550 code. | |
| 10 | + * | |
| 11 | + * This program is free software; you can redistribute it and/or modify | |
| 12 | + * it under the terms of the GNU General Public License as published by | |
| 13 | + * the Free Software Foundation; either version 2 of the License, or | |
| 14 | + * (at your option) any later version. | |
| 15 | + * | |
| 16 | + * This program is distributed in the hope that it will be useful, | |
| 17 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 18 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 19 | + * GNU General Public License for more details. | |
| 20 | + * | |
| 21 | + * You should have received a copy of the GNU General Public License | |
| 22 | + * along with this program; if not, write to the Free Software | |
| 23 | + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |
| 24 | + */ | |
| 25 | +#include <linux/init.h> | |
| 26 | +#include <linux/interrupt.h> | |
| 27 | +#include <linux/ioport.h> | |
| 28 | +#include <linux/io.h> | |
| 29 | +#include <linux/pci.h> | |
| 30 | +#include <asm/reboot.h> | |
| 31 | +#include <pnx833x.h> | |
| 32 | +#include <gpio.h> | |
| 33 | + | |
| 34 | +extern void pnx833x_board_setup(void); | |
| 35 | +extern void pnx833x_machine_restart(char *); | |
| 36 | +extern void pnx833x_machine_halt(void); | |
| 37 | +extern void pnx833x_machine_power_off(void); | |
| 38 | + | |
| 39 | +int __init plat_mem_setup(void) | |
| 40 | +{ | |
| 41 | + /* fake pci bus to avoid bounce buffers */ | |
| 42 | + PCI_DMA_BUS_IS_PHYS = 1; | |
| 43 | + | |
| 44 | + /* set mips clock to 320MHz */ | |
| 45 | +#if defined(CONFIG_SOC_PNX8335) | |
| 46 | + PNX8335_WRITEFIELD(0x17, CLOCK_PLL_CPU_CTL, FREQ); | |
| 47 | +#endif | |
| 48 | + pnx833x_gpio_init(); /* so it will be ready in board_setup() */ | |
| 49 | + | |
| 50 | + pnx833x_board_setup(); | |
| 51 | + | |
| 52 | + _machine_restart = pnx833x_machine_restart; | |
| 53 | + _machine_halt = pnx833x_machine_halt; | |
| 54 | + pm_power_off = pnx833x_machine_power_off; | |
| 55 | + | |
| 56 | + /* IO/MEM resources. */ | |
| 57 | + set_io_port_base(KSEG1); | |
| 58 | + ioport_resource.start = 0; | |
| 59 | + ioport_resource.end = ~0; | |
| 60 | + iomem_resource.start = 0; | |
| 61 | + iomem_resource.end = ~0; | |
| 62 | + | |
| 63 | + return 0; | |
| 64 | +} | |
| @@ -0,0 +1,3 @@ | ||
| 1 | +lib-y := board.o | |
| 2 | + | |
| 3 | +EXTRA_CFLAGS += -Werror | |
| @@ -0,0 +1,133 @@ | ||
| 1 | +/* | |
| 2 | + * board.c: STB225 board support. | |
| 3 | + * | |
| 4 | + * Copyright 2008 NXP Semiconductors | |
| 5 | + * Chris Steel <chris.steel@nxp.com> | |
| 6 | + * Daniel Laird <daniel.j.laird@nxp.com> | |
| 7 | + * | |
| 8 | + * Based on software written by: | |
| 9 | + * Nikita Youshchenko <yoush@debian.org>, based on PNX8550 code. | |
| 10 | + * | |
| 11 | + * This program is free software; you can redistribute it and/or modify | |
| 12 | + * it under the terms of the GNU General Public License as published by | |
| 13 | + * the Free Software Foundation; either version 2 of the License, or | |
| 14 | + * (at your option) any later version. | |
| 15 | + * | |
| 16 | + * This program is distributed in the hope that it will be useful, | |
| 17 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 18 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 19 | + * GNU General Public License for more details. | |
| 20 | + * | |
| 21 | + * You should have received a copy of the GNU General Public License | |
| 22 | + * along with this program; if not, write to the Free Software | |
| 23 | + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |
| 24 | + */ | |
| 25 | +#include <linux/init.h> | |
| 26 | +#include <asm/bootinfo.h> | |
| 27 | +#include <linux/mm.h> | |
| 28 | +#include <pnx833x.h> | |
| 29 | +#include <gpio.h> | |
| 30 | + | |
| 31 | +/* endianess twiddlers */ | |
| 32 | +#define PNX8335_DEBUG0 0x4400 | |
| 33 | +#define PNX8335_DEBUG1 0x4404 | |
| 34 | +#define PNX8335_DEBUG2 0x4408 | |
| 35 | +#define PNX8335_DEBUG3 0x440c | |
| 36 | +#define PNX8335_DEBUG4 0x4410 | |
| 37 | +#define PNX8335_DEBUG5 0x4414 | |
| 38 | +#define PNX8335_DEBUG6 0x4418 | |
| 39 | +#define PNX8335_DEBUG7 0x441c | |
| 40 | + | |
| 41 | +int prom_argc; | |
| 42 | +char **prom_argv = 0, **prom_envp = 0; | |
| 43 | + | |
| 44 | +extern void prom_init_cmdline(void); | |
| 45 | +extern char *prom_getenv(char *envname); | |
| 46 | + | |
| 47 | +const char *get_system_type(void) | |
| 48 | +{ | |
| 49 | + return "NXP STB22x"; | |
| 50 | +} | |
| 51 | + | |
| 52 | +static inline unsigned long env_or_default(char *env, unsigned long dfl) | |
| 53 | +{ | |
| 54 | + char *str = prom_getenv(env); | |
| 55 | + return str ? simple_strtol(str, 0, 0) : dfl; | |
| 56 | +} | |
| 57 | + | |
| 58 | +void __init prom_init(void) | |
| 59 | +{ | |
| 60 | + unsigned long memsize; | |
| 61 | + | |
| 62 | + prom_argc = fw_arg0; | |
| 63 | + prom_argv = (char **)fw_arg1; | |
| 64 | + prom_envp = (char **)fw_arg2; | |
| 65 | + | |
| 66 | + prom_init_cmdline(); | |
| 67 | + | |
| 68 | + memsize = env_or_default("memsize", 0x02000000); | |
| 69 | + add_memory_region(0, memsize, BOOT_MEM_RAM); | |
| 70 | +} | |
| 71 | + | |
| 72 | +void __init pnx833x_board_setup(void) | |
| 73 | +{ | |
| 74 | + pnx833x_gpio_select_function_alt(4); | |
| 75 | + pnx833x_gpio_select_output(4); | |
| 76 | + pnx833x_gpio_select_function_alt(5); | |
| 77 | + pnx833x_gpio_select_input(5); | |
| 78 | + pnx833x_gpio_select_function_alt(6); | |
| 79 | + pnx833x_gpio_select_input(6); | |
| 80 | + pnx833x_gpio_select_function_alt(7); | |
| 81 | + pnx833x_gpio_select_output(7); | |
| 82 | + | |
| 83 | + pnx833x_gpio_select_function_alt(25); | |
| 84 | + pnx833x_gpio_select_function_alt(26); | |
| 85 | + | |
| 86 | + pnx833x_gpio_select_function_alt(27); | |
| 87 | + pnx833x_gpio_select_function_alt(28); | |
| 88 | + pnx833x_gpio_select_function_alt(29); | |
| 89 | + pnx833x_gpio_select_function_alt(30); | |
| 90 | + pnx833x_gpio_select_function_alt(31); | |
| 91 | + pnx833x_gpio_select_function_alt(32); | |
| 92 | + pnx833x_gpio_select_function_alt(33); | |
| 93 | + | |
| 94 | +#if defined(CONFIG_MTD_NAND_PLATFORM) || defined(CONFIG_MTD_NAND_PLATFORM_MODULE) | |
| 95 | + /* Setup MIU for NAND access on CS0... | |
| 96 | + * | |
| 97 | + * (it seems that we must also configure CS1 for reliable operation, | |
| 98 | + * otherwise the first read ID command will fail if it's read as 4 bytes | |
| 99 | + * but pass if it's read as 1 word.) | |
| 100 | + */ | |
| 101 | + | |
| 102 | + /* Setup MIU CS0 & CS1 timing */ | |
| 103 | + PNX833X_MIU_SEL0 = 0; | |
| 104 | + PNX833X_MIU_SEL1 = 0; | |
| 105 | + PNX833X_MIU_SEL0_TIMING = 0x50003081; | |
| 106 | + PNX833X_MIU_SEL1_TIMING = 0x50003081; | |
| 107 | + | |
| 108 | + /* Setup GPIO 00 for use as MIU CS1 (CS0 is not multiplexed, so does not need this) */ | |
| 109 | + pnx833x_gpio_select_function_alt(0); | |
| 110 | + | |
| 111 | + /* Setup GPIO 04 to input NAND read/busy signal */ | |
| 112 | + pnx833x_gpio_select_function_io(4); | |
| 113 | + pnx833x_gpio_select_input(4); | |
| 114 | + | |
| 115 | + /* Setup GPIO 05 to disable NAND write protect */ | |
| 116 | + pnx833x_gpio_select_function_io(5); | |
| 117 | + pnx833x_gpio_select_output(5); | |
| 118 | + pnx833x_gpio_write(1, 5); | |
| 119 | + | |
| 120 | +#elif defined(CONFIG_MTD_CFI) || defined(CONFIG_MTD_CFI_MODULE) | |
| 121 | + | |
| 122 | + /* Set up MIU for 16-bit NOR access on CS0 and CS1... */ | |
| 123 | + | |
| 124 | + /* Setup MIU CS0 & CS1 timing */ | |
| 125 | + PNX833X_MIU_SEL0 = 1; | |
| 126 | + PNX833X_MIU_SEL1 = 1; | |
| 127 | + PNX833X_MIU_SEL0_TIMING = 0x6A08D082; | |
| 128 | + PNX833X_MIU_SEL1_TIMING = 0x6A08D082; | |
| 129 | + | |
| 130 | + /* Setup GPIO 00 for use as MIU CS1 (CS0 is not multiplexed, so does not need this) */ | |
| 131 | + pnx833x_gpio_select_function_alt(0); | |
| 132 | +#endif | |
| 133 | +} | |
| @@ -13,7 +13,7 @@ obj-$(CONFIG_MIPS_MSC) += ops-msc.o · 12 unmodified lines | ||
| 13 | 13 | obj-$(CONFIG_MIPS_NILE4) += ops-nile4.o |
| 14 | 14 | obj-$(CONFIG_SOC_TX3927) += ops-tx3927.o |
| 15 | 15 | obj-$(CONFIG_PCI_VR41XX) += ops-vr41xx.o pci-vr41xx.o |
| 16 | −obj-$(CONFIG_MARKEINS) += ops-emma2rh.o pci-emma2rh.o fixup-emma2rh.o | |
| 16 | +obj-$(CONFIG_NEC_MARKEINS) += ops-emma2rh.o pci-emma2rh.o fixup-emma2rh.o | |
| 17 | 17 | obj-$(CONFIG_PCI_TX4927) += ops-tx4927.o |
| 18 | 18 | obj-$(CONFIG_BCM47XX) += pci-bcm47xx.o |
| 19 | 19 | |
| @@ -30,7 +30,7 @@ · 29 unmodified lines | ||
| 30 | 30 | |
| 31 | 31 | #include <asm/bootinfo.h> |
| 32 | 32 | |
| 33 | −#include <asm/emma2rh/emma2rh.h> | |
| 33 | +#include <asm/emma/emma2rh.h> | |
| 34 | 34 | |
| 35 | 35 | #define EMMA2RH_PCI_HOST_SLOT 0x09 |
| 36 | 36 | #define EMMA2RH_USB_SLOT 0x03 |
| @@ -30,6 +30,7 @@ · 29 unmodified lines | ||
| 30 | 30 | #include <linux/init.h> |
| 31 | 31 | |
| 32 | 32 | #include <asm/mach-rc32434/rc32434.h> |
| 33 | +#include <asm/mach-rc32434/irq.h> | |
| 33 | 34 | |
| 34 | 35 | static int __devinitdata irq_map[2][12] = { |
| 35 | 36 | {0, 0, 2, 3, 2, 3, 0, 0, 0, 0, 0, 1}, |
| @@ -30,7 +30,7 @@ · 29 unmodified lines | ||
| 30 | 30 | #include <asm/addrspace.h> |
| 31 | 31 | #include <asm/debug.h> |
| 32 | 32 | |
| 33 | −#include <asm/emma2rh/emma2rh.h> | |
| 33 | +#include <asm/emma/emma2rh.h> | |
| 34 | 34 | |
| 35 | 35 | #define RTABORT (0x1<<9) |
| 36 | 36 | #define RMABORT (0x1<<10) |
| @@ -30,7 +30,7 @@ · 29 unmodified lines | ||
| 30 | 30 | |
| 31 | 31 | #include <asm/bootinfo.h> |
| 32 | 32 | |
| 33 | −#include <asm/emma2rh/emma2rh.h> | |
| 33 | +#include <asm/emma/emma2rh.h> | |
| 34 | 34 | |
| 35 | 35 | static struct resource pci_io_resource = { |
| 36 | 36 | .name = "pci IO space", |
| @@ -280,7 +280,7 @@ static int __init plat_setup_devices(void) · 279 unmodified lines | ||
| 280 | 280 | { |
| 281 | 281 | /* Look for the CF card reader */ |
| 282 | 282 | if (!readl(IDT434_REG_BASE + DEV1MASK)) |
| 283 | − rb532_devs[1] = NULL; | |
| 283 | + rb532_devs[2] = NULL; /* disable cf_slot0 at index 2 */ | |
| 284 | 284 | else { |
| 285 | 285 | cf_slot0_res[0].start = |
| 286 | 286 | readl(IDT434_REG_BASE + DEV1BASE); |
| @@ -310,6 +310,10 @@ int __init rb532_gpio_init(void) · 309 unmodified lines | ||
| 310 | 310 | return -ENXIO; |
| 311 | 311 | } |
| 312 | 312 | |
| 313 | + /* Set the interrupt status and level for the CF pin */ | |
| 314 | + rb532_gpio_set_int_level(&rb532_gpio_chip->chip, CF_GPIO_NUM, 1); | |
| 315 | + rb532_gpio_set_int_status(&rb532_gpio_chip->chip, CF_GPIO_NUM, 0); | |
| 316 | + | |
| 313 | 317 | return 0; |
| 314 | 318 | } |
| 315 | 319 | arch_initcall(rb532_gpio_init); |
| @@ -12,20 +12,11 @@ · 11 unmodified lines | ||
| 12 | 12 | #include <linux/types.h> |
| 13 | 13 | #include <linux/init.h> |
| 14 | 14 | #include <linux/kernel_stat.h> |
| 15 | −#include <linux/signal.h> | |
| 16 | −#include <linux/sched.h> | |
| 17 | 15 | #include <linux/interrupt.h> |
| 18 | −#include <linux/irq.h> | |
| 19 | 16 | |
| 20 | −#include <asm/mipsregs.h> | |
| 21 | −#include <asm/addrspace.h> | |
| 22 | 17 | #include <asm/irq_cpu.h> |
| 23 | −#include <asm/sgi/ioc.h> | |
| 24 | 18 | #include <asm/sgi/hpc3.h> |
| 25 | 19 | #include <asm/sgi/ip22.h> |
| 26 | −#include <asm/time.h> | |
| 27 | − | |
| 28 | −/* #define DEBUG_SGINT */ | |
| 29 | 20 | |
| 30 | 21 | /* So far nothing hangs here */ |
| 31 | 22 | #undef USE_LIO3_IRQ |
| @@ -68,7 +59,7 @@ static void enable_local1_irq(unsigned int irq) · 36 unmodified lines | ||
| 68 | 59 | sgint->imask1 |= (1 << (irq - SGINT_LOCAL1)); |
| 69 | 60 | } |
| 70 | 61 | |
| 71 | −void disable_local1_irq(unsigned int irq) | |
| 62 | +static void disable_local1_irq(unsigned int irq) | |
| 72 | 63 | { |
| 73 | 64 | sgint->imask1 &= ~(1 << (irq - SGINT_LOCAL1)); |
| 74 | 65 | } |
| @@ -87,7 +78,7 @@ static void enable_local2_irq(unsigned int irq) · 12 unmodified lines | ||
| 87 | 78 | sgint->cmeimask0 |= (1 << (irq - SGINT_LOCAL2)); |
| 88 | 79 | } |
| 89 | 80 | |
| 90 | −void disable_local2_irq(unsigned int irq) | |
| 81 | +static void disable_local2_irq(unsigned int irq) | |
| 91 | 82 | { |
| 92 | 83 | sgint->cmeimask0 &= ~(1 << (irq - SGINT_LOCAL2)); |
| 93 | 84 | if (!sgint->cmeimask0) |
| @@ -108,7 +99,7 @@ static void enable_local3_irq(unsigned int irq) · 14 unmodified lines | ||
| 108 | 99 | sgint->cmeimask1 |= (1 << (irq - SGINT_LOCAL3)); |
| 109 | 100 | } |
| 110 | 101 | |
| 111 | −void disable_local3_irq(unsigned int irq) | |
| 102 | +static void disable_local3_irq(unsigned int irq) | |
| 112 | 103 | { |
| 113 | 104 | sgint->cmeimask1 &= ~(1 << (irq - SGINT_LOCAL3)); |
| 114 | 105 | if (!sgint->cmeimask1) |
| @@ -344,6 +335,6 @@ void __init arch_init_irq(void) · 229 unmodified lines | ||
| 344 | 335 | |
| 345 | 336 | #ifdef CONFIG_EISA |
| 346 | 337 | if (ip22_is_fullhouse()) /* Only Indigo-2 has EISA stuff */ |
| 347 | − ip22_eisa_init(); | |
| 338 | + ip22_eisa_init(); | |
| 348 | 339 | #endif |
| 349 | 340 | } |
| @@ -46,9 +46,10 @@ config TOSHIBA_RBTX4938 · 45 unmodified lines | ||
| 46 | 46 | support this machine type |
| 47 | 47 | |
| 48 | 48 | config TOSHIBA_RBTX4939 |
| 49 | − bool "Toshiba RBTX4939 bobard" | |
| 49 | + bool "Toshiba RBTX4939 board" | |
| 50 | 50 | depends on MACH_TX49XX |
| 51 | 51 | select SOC_TX4939 |
| 52 | + select TXX9_7SEGLED | |
| 52 | 53 | help |
| 53 | 54 | This Toshiba board is based on the TX4939 processor. Say Y here to |
| 54 | 55 | support this machine type |
| @@ -86,6 +87,9 @@ config SOC_TX4939 · 31 unmodified lines | ||
| 86 | 87 | select HW_HAS_PCI |
| 87 | 88 | select PCI_TX4927 |
| 88 | 89 | |
| 90 | +config TXX9_7SEGLED | |
| 91 | + bool | |
| 92 | + | |
| 89 | 93 | config TOSHIBA_FPCIB0 |
| 90 | 94 | bool "FPCIB0 Backplane Support" |
| 91 | 95 | depends on PCI && MACH_TXX9 |
| @@ -0,0 +1,112 @@ | ||
| 1 | +/* | |
| 2 | + * 7 Segment LED routines | |
| 3 | + * Based on RBTX49xx patch from CELF patch archive. | |
| 4 | + * | |
| 5 | + * This file is subject to the terms and conditions of the GNU General Public | |
| 6 | + * License. See the file "COPYING" in the main directory of this archive | |
| 7 | + * for more details. | |
| 8 | + * | |
| 9 | + * (C) Copyright TOSHIBA CORPORATION 2005-2007 | |
| 10 | + * All Rights Reserved. | |
| 11 | + */ | |
| 12 | +#include <linux/sysdev.h> | |
| 13 | +#include <linux/slab.h> | |
| 14 | +#include <linux/map_to_7segment.h> | |
| 15 | +#include <asm/txx9/generic.h> | |
| 16 | + | |
| 17 | +static unsigned int tx_7segled_num; | |
| 18 | +static void (*tx_7segled_putc)(unsigned int pos, unsigned char val); | |
| 19 | + | |
| 20 | +void __init txx9_7segled_init(unsigned int num, | |
| 21 | + void (*putc)(unsigned int pos, unsigned char val)) | |
| 22 | +{ | |
| 23 | + tx_7segled_num = num; | |
| 24 | + tx_7segled_putc = putc; | |
| 25 | +} | |
| 26 | + | |
| 27 | +static SEG7_CONVERSION_MAP(txx9_seg7map, MAP_ASCII7SEG_ALPHANUM_LC); | |
| 28 | + | |
| 29 | +int txx9_7segled_putc(unsigned int pos, char c) | |
| 30 | +{ | |
| 31 | + if (pos >= tx_7segled_num) | |
| 32 | + return -EINVAL; | |
| 33 | + c = map_to_seg7(&txx9_seg7map, c); | |
| 34 | + if (c < 0) | |
| 35 | + return c; | |
| 36 | + tx_7segled_putc(pos, c); | |
| 37 | + return 0; | |
| 38 | +} | |
| 39 | + | |
| 40 | +static ssize_t ascii_store(struct sys_device *dev, | |
| 41 | + struct sysdev_attribute *attr, | |
| 42 | + const char *buf, size_t size) | |
| 43 | +{ | |
| 44 | + unsigned int ch = dev->id; | |
| 45 | + txx9_7segled_putc(ch, buf[0]); | |
| 46 | + return size; | |
| 47 | +} | |
| 48 | + | |
| 49 | +static ssize_t raw_store(struct sys_device *dev, | |
| 50 | + struct sysdev_attribute *attr, | |
| 51 | + const char *buf, size_t size) | |
| 52 | +{ | |
| 53 | + unsigned int ch = dev->id; | |
| 54 | + tx_7segled_putc(ch, buf[0]); | |
| 55 | + return size; | |
| 56 | +} | |
| 57 | + | |
| 58 | +static SYSDEV_ATTR(ascii, 0200, NULL, ascii_store); | |
| 59 | +static SYSDEV_ATTR(raw, 0200, NULL, raw_store); | |
| 60 | + | |
| 61 | +static ssize_t map_seg7_show(struct sysdev_class *class, char *buf) | |
| 62 | +{ | |
| 63 | + memcpy(buf, &txx9_seg7map, sizeof(txx9_seg7map)); | |
| 64 | + return sizeof(txx9_seg7map); | |
| 65 | +} | |
| 66 | + | |
| 67 | +static ssize_t map_seg7_store(struct sysdev_class *class, | |
| 68 | + const char *buf, size_t size) | |
| 69 | +{ | |
| 70 | + if (size != sizeof(txx9_seg7map)) | |
| 71 | + return -EINVAL; | |
| 72 | + memcpy(&txx9_seg7map, buf, size); | |
| 73 | + return size; | |
| 74 | +} | |
| 75 | + | |
| 76 | +static SYSDEV_CLASS_ATTR(map_seg7, 0600, map_seg7_show, map_seg7_store); | |
| 77 | + | |
| 78 | +static struct sysdev_class tx_7segled_sysdev_class = { | |
| 79 | + .name = "7segled", | |
| 80 | +}; | |
| 81 | + | |
| 82 | +static int __init tx_7segled_init_sysfs(void) | |
| 83 | +{ | |
| 84 | + int error, i; | |
| 85 | + if (!tx_7segled_num) | |
| 86 | + return -ENODEV; | |
| 87 | + error = sysdev_class_register(&tx_7segled_sysdev_class); | |
| 88 | + if (error) | |
| 89 | + return error; | |
| 90 | + error = sysdev_class_create_file(&tx_7segled_sysdev_class, | |
| 91 | + &attr_map_seg7); | |
| 92 | + if (error) | |
| 93 | + return error; | |
| 94 | + for (i = 0; i < tx_7segled_num; i++) { | |
| 95 | + struct sys_device *dev; | |
| 96 | + dev = kzalloc(sizeof(*dev), GFP_KERNEL); | |
| 97 | + if (!dev) { | |
| 98 | + error = -ENODEV; | |
| 99 | + break; | |
| 100 | + } | |
| 101 | + dev->id = i; | |
| 102 | + dev->cls = &tx_7segled_sysdev_class; | |
| 103 | + error = sysdev_register(dev); | |
| 104 | + if (!error) { | |
| 105 | + sysdev_create_file(dev, &attr_ascii); | |
| 106 | + sysdev_create_file(dev, &attr_raw); | |
| 107 | + } | |
| 108 | + } | |
| 109 | + return error; | |
| 110 | +} | |
| 111 | + | |
| 112 | +device_initcall(tx_7segled_init_sysfs); | |
| @@ -10,5 +10,6 @@ obj-$(CONFIG_SOC_TX4938) += mem_tx4927.o setup_tx4938.o irq_tx4938.o · 9 unmodified lines | ||
| 10 | 10 | obj-$(CONFIG_SOC_TX4939) += setup_tx4939.o irq_tx4939.o |
| 11 | 11 | obj-$(CONFIG_TOSHIBA_FPCIB0) += smsc_fdc37m81x.o |
| 12 | 12 | obj-$(CONFIG_SPI) += spi_eeprom.o |
| 13 | +obj-$(CONFIG_TXX9_7SEGLED) += 7segled.o | |
| 13 | 14 | |
| 14 | 15 | EXTRA_CFLAGS += -Werror |
| @@ -156,11 +156,23 @@ static struct txx9_board_vec *__init find_board_byname(const char *name) · 155 unmodified lines | ||
| 156 | 156 | |
| 157 | 157 | static void __init prom_init_cmdline(void) |
| 158 | 158 | { |
| 159 | − int argc = (int)fw_arg0; | |
| 160 | − int *argv32 = (int *)fw_arg1; | |
| 159 | + int argc; | |
| 160 | + int *argv32; | |
| 161 | 161 | int i; /* Always ignore the "-c" at argv[0] */ |
| 162 | 162 | char builtin[CL_SIZE]; |
| 163 | 163 | |
| 164 | + if (fw_arg0 >= CKSEG0 || fw_arg1 < CKSEG0) { | |
| 165 | + /* | |
| 166 | + * argc is not a valid number, or argv32 is not a valid | |
| 167 | + * pointer | |
| 168 | + */ | |
| 169 | + argc = 0; | |
| 170 | + argv32 = NULL; | |
| 171 | + } else { | |
| 172 | + argc = (int)fw_arg0; | |
| 173 | + argv32 = (int *)fw_arg1; | |
| 174 | + } | |
| 175 | + | |
| 164 | 176 | /* ignore all built-in args if any f/w args given */ |
| 165 | 177 | /* |
| 166 | 178 | * But if built-in strings was started with '+', append them |
| @@ -414,10 +426,12 @@ char * __init prom_getcmdline(void) · 247 unmodified lines | ||
| 414 | 426 | |
| 415 | 427 | const char *__init prom_getenv(const char *name) |
| 416 | 428 | { |
| 417 | − const s32 *str = (const s32 *)fw_arg2; | |
| 429 | + const s32 *str; | |
| 418 | 430 | |
| 419 | − if (!str) | |
| 431 | + if (fw_arg2 < CKSEG0) | |
| 420 | 432 | return NULL; |
| 433 | + | |
| 434 | + str = (const s32 *)fw_arg2; | |
| 421 | 435 | /* YAMON style ("name", "value" pairs) */ |
| 422 | 436 | while (str[0] && str[1]) { |
| 423 | 437 | if (!strcmp((const char *)(unsigned long)str[0], name)) |
| @@ -622,6 +636,21 @@ unsigned long (*__swizzle_addr_b)(unsigned long port) = __swizzle_addr_none; · 198 unmodified lines | ||
| 622 | 636 | EXPORT_SYMBOL(__swizzle_addr_b); |
| 623 | 637 | #endif |
| 624 | 638 | |
| 639 | +#ifdef NEEDS_TXX9_IOSWABW | |
| 640 | +static u16 ioswabw_default(volatile u16 *a, u16 x) | |
| 641 | +{ | |
| 642 | + return le16_to_cpu(x); | |
| 643 | +} | |
| 644 | +static u16 __mem_ioswabw_default(volatile u16 *a, u16 x) | |
| 645 | +{ | |
| 646 | + return x; | |
| 647 | +} | |
| 648 | +u16 (*ioswabw)(volatile u16 *a, u16 x) = ioswabw_default; | |
| 649 | +EXPORT_SYMBOL(ioswabw); | |
| 650 | +u16 (*__mem_ioswabw)(volatile u16 *a, u16 x) = __mem_ioswabw_default; | |
| 651 | +EXPORT_SYMBOL(__mem_ioswabw); | |
| 652 | +#endif | |
| 653 | + | |
| 625 | 654 | void __init txx9_physmap_flash_init(int no, unsigned long addr, |
| 626 | 655 | unsigned long size, |
| 627 | 656 | const struct physmap_flash_data *pdata) |
| @@ -14,6 +14,8 @@ · 13 unmodified lines | ||
| 14 | 14 | #include <linux/types.h> |
| 15 | 15 | #include <linux/platform_device.h> |
| 16 | 16 | #include <linux/leds.h> |
| 17 | +#include <linux/interrupt.h> | |
| 18 | +#include <linux/smc91x.h> | |
| 17 | 19 | #include <asm/reboot.h> |
| 18 | 20 | #include <asm/txx9/generic.h> |
| 19 | 21 | #include <asm/txx9/pci.h> |
| @@ -33,6 +35,21 @@ static void __init rbtx4939_time_init(void) · 13 unmodified lines | ||
| 33 | 35 | tx4939_time_init(0); |
| 34 | 36 | } |
| 35 | 37 | |
| 38 | +#if defined(__BIG_ENDIAN) && \ | |
| 39 | + (defined(CONFIG_SMC91X) || defined(CONFIG_SMC91X_MODULE)) | |
| 40 | +#define HAVE_RBTX4939_IOSWAB | |
| 41 | +#define IS_CE1_ADDR(addr) \ | |
| 42 | + ((((unsigned long)(addr) - IO_BASE) & 0xfff00000) == TXX9_CE(1)) | |
| 43 | +static u16 rbtx4939_ioswabw(volatile u16 *a, u16 x) | |
| 44 | +{ | |
| 45 | + return IS_CE1_ADDR(a) ? x : le16_to_cpu(x); | |
| 46 | +} | |
| 47 | +static u16 rbtx4939_mem_ioswabw(volatile u16 *a, u16 x) | |
| 48 | +{ | |
| 49 | + return !IS_CE1_ADDR(a) ? x : le16_to_cpu(x); | |
| 50 | +} | |
| 51 | +#endif /* __BIG_ENDIAN && CONFIG_SMC91X */ | |
| 52 | + | |
| 36 | 53 | static void __init rbtx4939_pci_setup(void) |
| 37 | 54 | { |
| 38 | 55 | #ifdef CONFIG_PCI |
| @@ -239,6 +256,32 @@ static inline void rbtx4939_led_setup(void) · 200 unmodified lines | ||
| 239 | 256 | } |
| 240 | 257 | #endif |
| 241 | 258 | |
| 259 | +static void __rbtx4939_7segled_putc(unsigned int pos, unsigned char val) | |
| 260 | +{ | |
| 261 | +#if defined(CONFIG_LEDS_CLASS) || defined(CONFIG_LEDS_CLASS_MODULE) | |
| 262 | + unsigned long flags; | |
| 263 | + local_irq_save(flags); | |
| 264 | + /* bit7: reserved for LED class */ | |
| 265 | + led_val[pos] = (led_val[pos] & 0x80) | (val & 0x7f); | |
| 266 | + val = led_val[pos]; | |
| 267 | + local_irq_restore(flags); | |
| 268 | +#endif | |
| 269 | + writeb(val, rbtx4939_7seg_addr(pos / 4, pos % 4)); | |
| 270 | +} | |
| 271 | + | |
| 272 | +static void rbtx4939_7segled_putc(unsigned int pos, unsigned char val) | |
| 273 | +{ | |
| 274 | + /* convert from map_to_seg7() notation */ | |
| 275 | + val = (val & 0x88) | | |
| 276 | + ((val & 0x40) >> 6) | | |
| 277 | + ((val & 0x20) >> 4) | | |
| 278 | + ((val & 0x10) >> 2) | | |
| 279 | + ((val & 0x04) << 2) | | |
| 280 | + ((val & 0x02) << 4) | | |
| 281 | + ((val & 0x01) << 6); | |
| 282 | + __rbtx4939_7segled_putc(pos, val); | |
| 283 | +} | |
| 284 | + | |
| 242 | 285 | static void __init rbtx4939_arch_init(void) |
| 243 | 286 | { |
| 244 | 287 | rbtx4939_pci_setup(); |
| @@ -246,6 +289,22 @@ static void __init rbtx4939_arch_init(void) · 1 unmodified line | ||
| 246 | 289 | |
| 247 | 290 | static void __init rbtx4939_device_init(void) |
| 248 | 291 | { |
| 292 | + unsigned long smc_addr = RBTX4939_ETHER_ADDR - IO_BASE; | |
| 293 | + struct resource smc_res[] = { | |
| 294 | + { | |
| 295 | + .start = smc_addr, | |
| 296 | + .end = smc_addr + 0x10 - 1, | |
| 297 | + .flags = IORESOURCE_MEM, | |
| 298 | + }, { | |
| 299 | + .start = RBTX4939_IRQ_ETHER, | |
| 300 | + /* override default irq flag defined in smc91x.h */ | |
| 301 | + .flags = IORESOURCE_IRQ | IRQF_TRIGGER_LOW, | |
| 302 | + }, | |
| 303 | + }; | |
| 304 | + struct smc91x_platdata smc_pdata = { | |
| 305 | + .flags = SMC91X_USE_16BIT, | |
| 306 | + }; | |
| 307 | + struct platform_device *pdev; | |
| 249 | 308 | #if defined(CONFIG_TC35815) || defined(CONFIG_TC35815_MODULE) |
| 250 | 309 | int i, j; |
| 251 | 310 | unsigned char ethaddr[2][6]; |
| @@ -262,6 +321,12 @@ static void __init rbtx4939_device_init(void) · 10 unmodified lines | ||
| 262 | 321 | } |
| 263 | 322 | tx4939_ethaddr_init(ethaddr[0], ethaddr[1]); |
| 264 | 323 | #endif |
| 324 | + pdev = platform_device_alloc("smc91x", -1); | |
| 325 | + if (!pdev || | |
| 326 | + platform_device_add_resources(pdev, smc_res, ARRAY_SIZE(smc_res)) || | |
| 327 | + platform_device_add_data(pdev, &smc_pdata, sizeof(smc_pdata)) || | |
| 328 | + platform_device_add(pdev)) | |
| 329 | + platform_device_put(pdev); | |
| 265 | 330 | rbtx4939_led_setup(); |
| 266 | 331 | tx4939_wdt_init(); |
| 267 | 332 | tx4939_ata_init(); |
| @@ -269,6 +334,8 @@ static void __init rbtx4939_device_init(void) · 1 unmodified line | ||
| 269 | 334 | |
| 270 | 335 | static void __init rbtx4939_setup(void) |
| 271 | 336 | { |
| 337 | + int i; | |
| 338 | + | |
| 272 | 339 | rbtx4939_ebusc_setup(); |
| 273 | 340 | /* always enable ATA0 */ |
| 274 | 341 | txx9_set64(&tx4939_ccfgptr->pcfg, TX4939_PCFG_ATA0MODE); |
| @@ -276,9 +343,16 @@ static void __init rbtx4939_setup(void) · 1 unmodified line | ||
| 276 | 343 | if (txx9_master_clock == 0) |
| 277 | 344 | txx9_master_clock = 20000000; |
| 278 | 345 | tx4939_setup(); |
| 346 | +#ifdef HAVE_RBTX4939_IOSWAB | |
| 347 | + ioswabw = rbtx4939_ioswabw; | |
| 348 | + __mem_ioswabw = rbtx4939_mem_ioswabw; | |
| 349 | +#endif | |
| 279 | 350 | |
| 280 | 351 | _machine_restart = rbtx4939_machine_restart; |
| 281 | 352 | |
| 353 | + txx9_7segled_init(RBTX4939_MAX_7SEGLEDS, rbtx4939_7segled_putc); | |
| 354 | + for (i = 0; i < RBTX4939_MAX_7SEGLEDS; i++) | |
| 355 | + txx9_7segled_putc(i, '-'); | |
| 282 | 356 | pr_info("RBTX4939 (Rev %02x) --- FPGA(Rev %02x) DIPSW:%02x,%02x\n", |
| 283 | 357 | readb(rbtx4939_board_rev_addr), readb(rbtx4939_ioc_rev_addr), |
| 284 | 358 | readb(rbtx4939_udipsw_addr), readb(rbtx4939_bdipsw_addr)); |
| @@ -108,8 +108,7 @@ config ARCH_NO_VIRT_TO_BUS · 107 unmodified lines | ||
| 108 | 108 | config PPC |
| 109 | 109 | bool |
| 110 | 110 | default y |
| 111 | − select HAVE_DYNAMIC_FTRACE | |
| 112 | − select HAVE_FTRACE | |
| 111 | + select HAVE_FUNCTION_TRACER | |
| 113 | 112 | select ARCH_WANT_OPTIONAL_GPIOLIB |
| 114 | 113 | select HAVE_IDE |
| 115 | 114 | select HAVE_IOREMAP_PROT |
| @@ -122,7 +122,7 @@ KBUILD_CFLAGS += -mcpu=powerpc · 121 unmodified lines | ||
| 122 | 122 | endif |
| 123 | 123 | |
| 124 | 124 | # Work around a gcc code-gen bug with -fno-omit-frame-pointer. |
| 125 | −ifeq ($(CONFIG_FTRACE),y) | |
| 125 | +ifeq ($(CONFIG_FUNCTION_TRACER),y) | |
| 126 | 126 | KBUILD_CFLAGS += -mno-sched-epilog |
| 127 | 127 | endif |
| 128 | 128 | |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | #ifndef _ASM_POWERPC_FTRACE |
| 2 | 2 | #define _ASM_POWERPC_FTRACE |
| 3 | 3 | |
| 4 | −#ifdef CONFIG_FTRACE | |
| 4 | +#ifdef CONFIG_FUNCTION_TRACER | |
| 5 | 5 | #define MCOUNT_ADDR ((long)(_mcount)) |
| 6 | 6 | #define MCOUNT_INSN_SIZE 4 /* sizeof mcount call */ |
| 7 | 7 | |
| @@ -12,7 +12,7 @@ CFLAGS_prom_init.o += -fPIC · 11 unmodified lines | ||
| 12 | 12 | CFLAGS_btext.o += -fPIC |
| 13 | 13 | endif |
| 14 | 14 | |
| 15 | −ifdef CONFIG_FTRACE | |
| 15 | +ifdef CONFIG_FUNCTION_TRACER | |
| 16 | 16 | # Do not trace early boot code |
| 17 | 17 | CFLAGS_REMOVE_cputable.o = -pg -mno-sched-epilog |
| 18 | 18 | CFLAGS_REMOVE_prom_init.o = -pg -mno-sched-epilog |
| @@ -1158,7 +1158,7 @@ machine_check_in_rtas: · 1157 unmodified lines | ||
| 1158 | 1158 | |
| 1159 | 1159 | #endif /* CONFIG_PPC_RTAS */ |
| 1160 | 1160 | |
| 1161 | −#ifdef CONFIG_FTRACE | |
| 1161 | +#ifdef CONFIG_FUNCTION_TRACER | |
| 1162 | 1162 | #ifdef CONFIG_DYNAMIC_FTRACE |
| 1163 | 1163 | _GLOBAL(mcount) |
| 1164 | 1164 | _GLOBAL(_mcount) |
| @@ -884,7 +884,7 @@ _GLOBAL(enter_prom) · 883 unmodified lines | ||
| 884 | 884 | mtlr r0 |
| 885 | 885 | blr |
| 886 | 886 | |
| 887 | −#ifdef CONFIG_FTRACE | |
| 887 | +#ifdef CONFIG_FUNCTION_TRACER | |
| 888 | 888 | #ifdef CONFIG_DYNAMIC_FTRACE |
| 889 | 889 | _GLOBAL(mcount) |
| 890 | 890 | _GLOBAL(_mcount) |
| @@ -28,17 +28,17 @@ static unsigned int ftrace_nop = 0x60000000; · 27 unmodified lines | ||
| 28 | 28 | #endif |
| 29 | 29 | |
| 30 | 30 | |
| 31 | −static unsigned int notrace ftrace_calc_offset(long ip, long addr) | |
| 31 | +static unsigned int ftrace_calc_offset(long ip, long addr) | |
| 32 | 32 | { |
| 33 | 33 | return (int)(addr - ip); |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | −notrace unsigned char *ftrace_nop_replace(void) | |
| 36 | +unsigned char *ftrace_nop_replace(void) | |
| 37 | 37 | { |
| 38 | 38 | return (char *)&ftrace_nop; |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | −notrace unsigned char *ftrace_call_replace(unsigned long ip, unsigned long addr) | |
| 41 | +unsigned char *ftrace_call_replace(unsigned long ip, unsigned long addr) | |
| 42 | 42 | { |
| 43 | 43 | static unsigned int op; |
| 44 | 44 | |
| @@ -68,7 +68,7 @@ notrace unsigned char *ftrace_call_replace(unsigned long ip, unsigned long addr) · 23 unmodified lines | ||
| 68 | 68 | # define _ASM_PTR " .long " |
| 69 | 69 | #endif |
| 70 | 70 | |
| 71 | −notrace int | |
| 71 | +int | |
| 72 | 72 | ftrace_modify_code(unsigned long ip, unsigned char *old_code, |
| 73 | 73 | unsigned char *new_code) |
| 74 | 74 | { |
| @@ -113,7 +113,7 @@ ftrace_modify_code(unsigned long ip, unsigned char *old_code, · 38 unmodified lines | ||
| 113 | 113 | return faulted; |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | −notrace int ftrace_update_ftrace_func(ftrace_func_t func) | |
| 116 | +int ftrace_update_ftrace_func(ftrace_func_t func) | |
| 117 | 117 | { |
| 118 | 118 | unsigned long ip = (unsigned long)(&ftrace_call); |
| 119 | 119 | unsigned char old[MCOUNT_INSN_SIZE], *new; |
| @@ -126,23 +126,6 @@ notrace int ftrace_update_ftrace_func(ftrace_func_t func) · 6 unmodified lines | ||
| 126 | 126 | return ret; |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | −notrace int ftrace_mcount_set(unsigned long *data) | |
| 130 | −{ | |
| 131 | − unsigned long ip = (long)(&mcount_call); | |
| 132 | − unsigned long *addr = data; | |
| 133 | − unsigned char old[MCOUNT_INSN_SIZE], *new; | |
| 134 | − | |
| 135 | − /* | |
| 136 | − * Replace the mcount stub with a pointer to the | |
| 137 | − * ip recorder function. | |
| 138 | − */ | |
| 139 | − memcpy(old, &mcount_call, MCOUNT_INSN_SIZE); | |
| 140 | − new = ftrace_call_replace(ip, *addr); | |
| 141 | − *addr = ftrace_modify_code(ip, old, new); | |
| 142 | − | |
| 143 | − return 0; | |
| 144 | −} | |
| 145 | − | |
| 146 | 129 | int __init ftrace_dyn_arch_init(void *data) |
| 147 | 130 | { |
| 148 | 131 | /* This is running in kstop_machine */ |
| @@ -68,7 +68,7 @@ EXPORT_SYMBOL(single_step_exception); · 67 unmodified lines | ||
| 68 | 68 | EXPORT_SYMBOL(sys_sigreturn); |
| 69 | 69 | #endif |
| 70 | 70 | |
| 71 | −#ifdef CONFIG_FTRACE | |
| 71 | +#ifdef CONFIG_FUNCTION_TRACER | |
| 72 | 72 | EXPORT_SYMBOL(_mcount); |
| 73 | 73 | #endif |
| 74 | 74 | |
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | CFLAGS_bootx_init.o += -fPIC |
| 2 | 2 | |
| 3 | −ifdef CONFIG_FTRACE | |
| 3 | +ifdef CONFIG_FUNCTION_TRACER | |
| 4 | 4 | # Do not trace early boot code |
| 5 | 5 | CFLAGS_REMOVE_bootx_init.o = -pg -mno-sched-epilog |
| 6 | 6 | endif |
| @@ -241,19 +241,17 @@ config PACK_STACK · 240 unmodified lines | ||
| 241 | 241 | Say Y if you are unsure. |
| 242 | 242 | |
| 243 | 243 | config SMALL_STACK |
| 244 | − bool "Use 4kb/8kb for kernel stack instead of 8kb/16kb" | |
| 245 | − depends on PACK_STACK && !LOCKDEP | |
| 244 | + bool "Use 8kb for kernel stack instead of 16kb" | |
| 245 | + depends on PACK_STACK && 64BIT && !LOCKDEP | |
| 246 | 246 | help |
| 247 | 247 | If you say Y here and the compiler supports the -mkernel-backchain |
| 248 | − option the kernel will use a smaller kernel stack size. For 31 bit | |
| 249 | − the reduced size is 4kb instead of 8kb and for 64 bit it is 8kb | |
| 250 | − instead of 16kb. This allows to run more thread on a system and | |
| 251 | − reduces the pressure on the memory management for higher order | |
| 252 | − page allocations. | |
| 248 | + option the kernel will use a smaller kernel stack size. The reduced | |
| 249 | + size is 8kb instead of 16kb. This allows to run more threads on a | |
| 250 | + system and reduces the pressure on the memory management for higher | |
| 251 | + order page allocations. | |
| 253 | 252 | |
| 254 | 253 | Say N if you are unsure. |
| 255 | 254 | |
| 256 | − | |
| 257 | 255 | config CHECK_STACK |
| 258 | 256 | bool "Detect kernel stack overflow" |
| 259 | 257 | help |
| @@ -384,7 +382,7 @@ config IPL · 124 unmodified lines | ||
| 384 | 382 | choice |
| 385 | 383 | prompt "IPL method generated into head.S" |
| 386 | 384 | depends on IPL |
| 387 | − default IPL_TAPE | |
| 385 | + default IPL_VM | |
| 388 | 386 | help |
| 389 | 387 | Select "tape" if you want to IPL the image from a Tape. |
| 390 | 388 | |
| @@ -424,7 +424,7 @@ out: · 423 unmodified lines | ||
| 424 | 424 | */ |
| 425 | 425 | int appldata_register_ops(struct appldata_ops *ops) |
| 426 | 426 | { |
| 427 | − if ((ops->size > APPLDATA_MAX_REC_SIZE) || (ops->size < 0)) | |
| 427 | + if (ops->size > APPLDATA_MAX_REC_SIZE) | |
| 428 | 428 | return -EINVAL; |
| 429 | 429 | |
| 430 | 430 | ops->ctl_table = kzalloc(4 * sizeof(struct ctl_table), GFP_KERNEL); |
| @@ -52,7 +52,7 @@ struct kvm_vqconfig { · 51 unmodified lines | ||
| 52 | 52 | |
| 53 | 53 | #ifdef __KERNEL__ |
| 54 | 54 | /* early virtio console setup */ |
| 55 | −#ifdef CONFIG_VIRTIO_CONSOLE | |
| 55 | +#ifdef CONFIG_S390_GUEST | |
| 56 | 56 | extern void s390_virtio_console_init(void); |
| 57 | 57 | #else |
| 58 | 58 | static inline void s390_virtio_console_init(void) |
| @@ -7,7 +7,8 @@ typedef struct { · 6 unmodified lines | ||
| 7 | 7 | unsigned long asce_bits; |
| 8 | 8 | unsigned long asce_limit; |
| 9 | 9 | int noexec; |
| 10 | − int pgstes; | |
| 10 | + int has_pgste; /* The mmu context has extended page tables */ | |
| 11 | + int alloc_pgste; /* cloned contexts will have extended page tables */ | |
| 11 | 12 | } mm_context_t; |
| 12 | 13 | |
| 13 | 14 | #endif |
| @@ -20,12 +20,25 @@ static inline int init_new_context(struct task_struct *tsk, · 19 unmodified lines | ||
| 20 | 20 | #ifdef CONFIG_64BIT |
| 21 | 21 | mm->context.asce_bits |= _ASCE_TYPE_REGION3; |
| 22 | 22 | #endif |
| 23 | − if (current->mm->context.pgstes) { | |
| 23 | + if (current->mm->context.alloc_pgste) { | |
| 24 | + /* | |
| 25 | + * alloc_pgste indicates, that any NEW context will be created | |
| 26 | + * with extended page tables. The old context is unchanged. The | |
| 27 | + * page table allocation and the page table operations will | |
| 28 | + * look at has_pgste to distinguish normal and extended page | |
| 29 | + * tables. The only way to create extended page tables is to | |
| 30 | + * set alloc_pgste and then create a new context (e.g. dup_mm). | |
| 31 | + * The page table allocation is called after init_new_context | |
| 32 | + * and if has_pgste is set, it will create extended page | |
| 33 | + * tables. | |
| 34 | + */ | |
| 24 | 35 | mm->context.noexec = 0; |
| 25 | − mm->context.pgstes = 1; | |
| 36 | + mm->context.has_pgste = 1; | |
| 37 | + mm->context.alloc_pgste = 1; | |
| 26 | 38 | } else { |
| 27 | 39 | mm->context.noexec = s390_noexec; |
| 28 | − mm->context.pgstes = 0; | |
| 40 | + mm->context.has_pgste = 0; | |
| 41 | + mm->context.alloc_pgste = 0; | |
| 29 | 42 | } |
| 30 | 43 | mm->context.asce_limit = STACK_TOP_MAX; |
| 31 | 44 | crst_table_init((unsigned long *) mm->pgd, pgd_entry_type(mm)); |
| @@ -679,7 +679,7 @@ static inline void pmd_clear(pmd_t *pmd) · 678 unmodified lines | ||
| 679 | 679 | |
| 680 | 680 | static inline void pte_clear(struct mm_struct *mm, unsigned long addr, pte_t *ptep) |
| 681 | 681 | { |
| 682 | − if (mm->context.pgstes) | |
| 682 | + if (mm->context.has_pgste) | |
| 683 | 683 | ptep_rcp_copy(ptep); |
| 684 | 684 | pte_val(*ptep) = _PAGE_TYPE_EMPTY; |
| 685 | 685 | if (mm->context.noexec) |
| @@ -763,7 +763,7 @@ static inline int kvm_s390_test_and_clear_page_dirty(struct mm_struct *mm, · 77 unmodified lines | ||
| 763 | 763 | struct page *page; |
| 764 | 764 | unsigned int skey; |
| 765 | 765 | |
| 766 | − if (!mm->context.pgstes) | |
| 766 | + if (!mm->context.has_pgste) | |
| 767 | 767 | return -EINVAL; |
| 768 | 768 | rcp_lock(ptep); |
| 769 | 769 | pgste = (unsigned long *) (ptep + PTRS_PER_PTE); |
| @@ -794,7 +794,7 @@ static inline int ptep_test_and_clear_young(struct vm_area_struct *vma, · 24 unmodified lines | ||
| 794 | 794 | int young; |
| 795 | 795 | unsigned long *pgste; |
| 796 | 796 | |
| 797 | − if (!vma->vm_mm->context.pgstes) | |
| 797 | + if (!vma->vm_mm->context.has_pgste) | |
| 798 | 798 | return 0; |
| 799 | 799 | physpage = pte_val(*ptep) & PAGE_MASK; |
| 800 | 800 | pgste = (unsigned long *) (ptep + PTRS_PER_PTE); |
| @@ -844,7 +844,7 @@ static inline void __ptep_ipte(unsigned long address, pte_t *ptep) · 43 unmodified lines | ||
| 844 | 844 | static inline void ptep_invalidate(struct mm_struct *mm, |
| 845 | 845 | unsigned long address, pte_t *ptep) |
| 846 | 846 | { |
| 847 | − if (mm->context.pgstes) { | |
| 847 | + if (mm->context.has_pgste) { | |
| 848 | 848 | rcp_lock(ptep); |
| 849 | 849 | __ptep_ipte(address, ptep); |
| 850 | 850 | ptep_rcp_copy(ptep); |
| @@ -15,13 +15,8 @@ · 14 unmodified lines | ||
| 15 | 15 | * Size of kernel stack for each process |
| 16 | 16 | */ |
| 17 | 17 | #ifndef __s390x__ |
| 18 | −#ifndef __SMALL_STACK | |
| 19 | 18 | #define THREAD_ORDER 1 |
| 20 | 19 | #define ASYNC_ORDER 1 |
| 21 | −#else | |
| 22 | −#define THREAD_ORDER 0 | |
| 23 | −#define ASYNC_ORDER 0 | |
| 24 | −#endif | |
| 25 | 20 | #else /* __s390x__ */ |
| 26 | 21 | #ifndef __SMALL_STACK |
| 27 | 22 | #define THREAD_ORDER 2 |
| @@ -1119,9 +1119,7 @@ out: · 1118 unmodified lines | ||
| 1119 | 1119 | return rc; |
| 1120 | 1120 | } |
| 1121 | 1121 | |
| 1122 | −static ssize_t __ref rescan_store(struct sys_device *dev, | |
| 1123 | − struct sysdev_attribute *attr, | |
| 1124 | − const char *buf, | |
| 1122 | +static ssize_t __ref rescan_store(struct sysdev_class *class, const char *buf, | |
| 1125 | 1123 | size_t count) |
| 1126 | 1124 | { |
| 1127 | 1125 | int rc; |
| @@ -1129,12 +1127,10 @@ static ssize_t __ref rescan_store(struct sys_device *dev, · 1 unmodified line | ||
| 1129 | 1127 | rc = smp_rescan_cpus(); |
| 1130 | 1128 | return rc ? rc : count; |
| 1131 | 1129 | } |
| 1132 | −static SYSDEV_ATTR(rescan, 0200, NULL, rescan_store); | |
| 1130 | +static SYSDEV_CLASS_ATTR(rescan, 0200, NULL, rescan_store); | |
| 1133 | 1131 | #endif /* CONFIG_HOTPLUG_CPU */ |
| 1134 | 1132 | |
| 1135 | −static ssize_t dispatching_show(struct sys_device *dev, | |
| 1136 | − struct sysdev_attribute *attr, | |
| 1137 | − char *buf) | |
| 1133 | +static ssize_t dispatching_show(struct sysdev_class *class, char *buf) | |
| 1138 | 1134 | { |
| 1139 | 1135 | ssize_t count; |
| 1140 | 1136 | |
| @@ -1144,9 +1140,8 @@ static ssize_t dispatching_show(struct sys_device *dev, · 3 unmodified lines | ||
| 1144 | 1140 | return count; |
| 1145 | 1141 | } |
| 1146 | 1142 | |
| 1147 | −static ssize_t dispatching_store(struct sys_device *dev, | |
| 1148 | − struct sysdev_attribute *attr, | |
| 1149 | − const char *buf, size_t count) | |
| 1143 | +static ssize_t dispatching_store(struct sysdev_class *dev, const char *buf, | |
| 1144 | + size_t count) | |
| 1150 | 1145 | { |
| 1151 | 1146 | int val, rc; |
| 1152 | 1147 | char delim; |
| @@ -1168,7 +1163,8 @@ out: · 15 unmodified lines | ||
| 1168 | 1163 | put_online_cpus(); |
| 1169 | 1164 | return rc ? rc : count; |
| 1170 | 1165 | } |
| 1171 | −static SYSDEV_ATTR(dispatching, 0644, dispatching_show, dispatching_store); | |
| 1166 | +static SYSDEV_CLASS_ATTR(dispatching, 0644, dispatching_show, | |
| 1167 | + dispatching_store); | |
| 1172 | 1168 | |
| 1173 | 1169 | static int __init topology_init(void) |
| 1174 | 1170 | { |
| @@ -1178,13 +1174,11 @@ static int __init topology_init(void) · 3 unmodified lines | ||
| 1178 | 1174 | register_cpu_notifier(&smp_cpu_nb); |
| 1179 | 1175 | |
| 1180 | 1176 | #ifdef CONFIG_HOTPLUG_CPU |
| 1181 | − rc = sysfs_create_file(&cpu_sysdev_class.kset.kobj, | |
| 1182 | − &attr_rescan.attr); | |
| 1177 | + rc = sysdev_class_create_file(&cpu_sysdev_class, &attr_rescan); | |
| 1183 | 1178 | if (rc) |
| 1184 | 1179 | return rc; |
| 1185 | 1180 | #endif |
| 1186 | − rc = sysfs_create_file(&cpu_sysdev_class.kset.kobj, | |
| 1187 | − &attr_dispatching.attr); | |
| 1181 | + rc = sysdev_class_create_file(&cpu_sysdev_class, &attr_dispatching); | |
| 1188 | 1182 | if (rc) |
| 1189 | 1183 | return rc; |
| 1190 | 1184 | for_each_present_cpu(cpu) { |
| @@ -169,7 +169,7 @@ unsigned long *page_table_alloc(struct mm_struct *mm) · 168 unmodified lines | ||
| 169 | 169 | unsigned long *table; |
| 170 | 170 | unsigned long bits; |
| 171 | 171 | |
| 172 | − bits = (mm->context.noexec || mm->context.pgstes) ? 3UL : 1UL; | |
| 172 | + bits = (mm->context.noexec || mm->context.has_pgste) ? 3UL : 1UL; | |
| 173 | 173 | spin_lock(&mm->page_table_lock); |
| 174 | 174 | page = NULL; |
| 175 | 175 | if (!list_empty(&mm->context.pgtable_list)) { |
| @@ -186,7 +186,7 @@ unsigned long *page_table_alloc(struct mm_struct *mm) · 10 unmodified lines | ||
| 186 | 186 | pgtable_page_ctor(page); |
| 187 | 187 | page->flags &= ~FRAG_MASK; |
| 188 | 188 | table = (unsigned long *) page_to_phys(page); |
| 189 | − if (mm->context.pgstes) | |
| 189 | + if (mm->context.has_pgste) | |
| 190 | 190 | clear_table_pgstes(table); |
| 191 | 191 | else |
| 192 | 192 | clear_table(table, _PAGE_TYPE_EMPTY, PAGE_SIZE); |
| @@ -210,7 +210,7 @@ void page_table_free(struct mm_struct *mm, unsigned long *table) · 17 unmodified lines | ||
| 210 | 210 | struct page *page; |
| 211 | 211 | unsigned long bits; |
| 212 | 212 | |
| 213 | − bits = (mm->context.noexec || mm->context.pgstes) ? 3UL : 1UL; | |
| 213 | + bits = (mm->context.noexec || mm->context.has_pgste) ? 3UL : 1UL; | |
| 214 | 214 | bits <<= (__pa(table) & (PAGE_SIZE - 1)) / 256 / sizeof(unsigned long); |
| 215 | 215 | page = pfn_to_page(__pa(table) >> PAGE_SHIFT); |
| 216 | 216 | spin_lock(&mm->page_table_lock); |
| @@ -257,7 +257,7 @@ int s390_enable_sie(void) · 40 unmodified lines | ||
| 257 | 257 | struct mm_struct *mm, *old_mm; |
| 258 | 258 | |
| 259 | 259 | /* Do we have pgstes? if yes, we are done */ |
| 260 | − if (tsk->mm->context.pgstes) | |
| 260 | + if (tsk->mm->context.has_pgste) | |
| 261 | 261 | return 0; |
| 262 | 262 | |
| 263 | 263 | /* lets check if we are allowed to replace the mm */ |
| @@ -269,14 +269,14 @@ int s390_enable_sie(void) · 5 unmodified lines | ||
| 269 | 269 | } |
| 270 | 270 | task_unlock(tsk); |
| 271 | 271 | |
| 272 | − /* we copy the mm with pgstes enabled */ | |
| 273 | − tsk->mm->context.pgstes = 1; | |
| 272 | + /* we copy the mm and let dup_mm create the page tables with_pgstes */ | |
| 273 | + tsk->mm->context.alloc_pgste = 1; | |
| 274 | 274 | mm = dup_mm(tsk); |
| 275 | − tsk->mm->context.pgstes = 0; | |
| 275 | + tsk->mm->context.alloc_pgste = 0; | |
| 276 | 276 | if (!mm) |
| 277 | 277 | return -ENOMEM; |
| 278 | 278 | |
| 279 | − /* Now lets check again if somebody attached ptrace etc */ | |
| 279 | + /* Now lets check again if something happened */ | |
| 280 | 280 | task_lock(tsk); |
| 281 | 281 | if (!tsk->mm || atomic_read(&tsk->mm->mm_users) > 1 || |
| 282 | 282 | tsk->mm != tsk->active_mm || tsk->mm->ioctx_list) { |
| @@ -11,8 +11,7 @@ config SPARC · 10 unmodified lines | ||
| 11 | 11 | config SPARC64 |
| 12 | 12 | bool |
| 13 | 13 | default y |
| 14 | − select HAVE_DYNAMIC_FTRACE | |
| 15 | − select HAVE_FTRACE | |
| 14 | + select HAVE_FUNCTION_TRACER | |
| 16 | 15 | select HAVE_IDE |
| 17 | 16 | select HAVE_LMB |
| 18 | 17 | select HAVE_ARCH_KGDB |
| @@ -33,7 +33,7 @@ config DEBUG_PAGEALLOC · 32 unmodified lines | ||
| 33 | 33 | |
| 34 | 34 | config MCOUNT |
| 35 | 35 | bool |
| 36 | − depends on STACK_DEBUG || FTRACE | |
| 36 | + depends on STACK_DEBUG || FUNCTION_TRACER | |
| 37 | 37 | default y |
| 38 | 38 | |
| 39 | 39 | config FRAME_POINTER |
| @@ -5,6 +5,8 @@ · 4 unmodified lines | ||
| 5 | 5 | EXTRA_AFLAGS := -ansi |
| 6 | 6 | EXTRA_CFLAGS := -Werror |
| 7 | 7 | |
| 8 | +CFLAGS_REMOVE_ftrace.o = -pg | |
| 9 | + | |
| 8 | 10 | extra-y := head.o init_task.o vmlinux.lds |
| 9 | 11 | |
| 10 | 12 | obj-y := process.o setup.o cpu.o idprom.o reboot.o \ |
| @@ -9,12 +9,12 @@ · 8 unmodified lines | ||
| 9 | 9 | |
| 10 | 10 | static const u32 ftrace_nop = 0x01000000; |
| 11 | 11 | |
| 12 | −notrace unsigned char *ftrace_nop_replace(void) | |
| 12 | +unsigned char *ftrace_nop_replace(void) | |
| 13 | 13 | { |
| 14 | 14 | return (char *)&ftrace_nop; |
| 15 | 15 | } |
| 16 | 16 | |
| 17 | −notrace unsigned char *ftrace_call_replace(unsigned long ip, unsigned long addr) | |
| 17 | +unsigned char *ftrace_call_replace(unsigned long ip, unsigned long addr) | |
| 18 | 18 | { |
| 19 | 19 | static u32 call; |
| 20 | 20 | s32 off; |
| @@ -25,7 +25,7 @@ notrace unsigned char *ftrace_call_replace(unsigned long ip, unsigned long addr) · 4 unmodified lines | ||
| 25 | 25 | return (unsigned char *) &call; |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | −notrace int | |
| 28 | +int | |
| 29 | 29 | ftrace_modify_code(unsigned long ip, unsigned char *old_code, |
| 30 | 30 | unsigned char *new_code) |
| 31 | 31 | { |
| @@ -59,7 +59,7 @@ ftrace_modify_code(unsigned long ip, unsigned char *old_code, · 27 unmodified lines | ||
| 59 | 59 | return faulted; |
| 60 | 60 | } |
| 61 | 61 | |
| 62 | −notrace int ftrace_update_ftrace_func(ftrace_func_t func) | |
| 62 | +int ftrace_update_ftrace_func(ftrace_func_t func) | |
| 63 | 63 | { |
| 64 | 64 | unsigned long ip = (unsigned long)(&ftrace_call); |
| 65 | 65 | unsigned char old[MCOUNT_INSN_SIZE], *new; |
| @@ -69,24 +69,6 @@ notrace int ftrace_update_ftrace_func(ftrace_func_t func) · 3 unmodified lines | ||
| 69 | 69 | return ftrace_modify_code(ip, old, new); |
| 70 | 70 | } |
| 71 | 71 | |
| 72 | −notrace int ftrace_mcount_set(unsigned long *data) | |
| 73 | −{ | |
| 74 | − unsigned long ip = (long)(&mcount_call); | |
| 75 | − unsigned long *addr = data; | |
| 76 | − unsigned char old[MCOUNT_INSN_SIZE], *new; | |
| 77 | − | |
| 78 | − /* | |
| 79 | − * Replace the mcount stub with a pointer to the | |
| 80 | − * ip recorder function. | |
| 81 | − */ | |
| 82 | − memcpy(old, &mcount_call, MCOUNT_INSN_SIZE); | |
| 83 | − new = ftrace_call_replace(ip, *addr); | |
| 84 | − *addr = ftrace_modify_code(ip, old, new); | |
| 85 | − | |
| 86 | − return 0; | |
| 87 | −} | |
| 88 | − | |
| 89 | − | |
| 90 | 72 | int __init ftrace_dyn_arch_init(void *data) |
| 91 | 73 | { |
| 92 | 74 | ftrace_mcount_set(data); |
| @@ -93,7 +93,7 @@ mcount: · 92 unmodified lines | ||
| 93 | 93 | nop |
| 94 | 94 | 1: |
| 95 | 95 | #endif |
| 96 | −#ifdef CONFIG_FTRACE | |
| 96 | +#ifdef CONFIG_FUNCTION_TRACER | |
| 97 | 97 | #ifdef CONFIG_DYNAMIC_FTRACE |
| 98 | 98 | mov %o7, %o0 |
| 99 | 99 | .globl mcount_call |
| @@ -119,7 +119,7 @@ mcount_call: · 19 unmodified lines | ||
| 119 | 119 | .size _mcount,.-_mcount |
| 120 | 120 | .size mcount,.-mcount |
| 121 | 121 | |
| 122 | −#ifdef CONFIG_FTRACE | |
| 122 | +#ifdef CONFIG_FUNCTION_TRACER | |
| 123 | 123 | .globl ftrace_stub |
| 124 | 124 | .type ftrace_stub,#function |
| 125 | 125 | ftrace_stub: |
| @@ -28,7 +28,7 @@ config X86 · 27 unmodified lines | ||
| 28 | 28 | select HAVE_KRETPROBES |
| 29 | 29 | select HAVE_FTRACE_MCOUNT_RECORD |
| 30 | 30 | select HAVE_DYNAMIC_FTRACE |
| 31 | − select HAVE_FTRACE | |
| 31 | + select HAVE_FUNCTION_TRACER | |
| 32 | 32 | select HAVE_KVM if ((X86_32 && !X86_VOYAGER && !X86_VISWS && !X86_NUMAQ) || X86_64) |
| 33 | 33 | select HAVE_ARCH_KGDB if !X86_VOYAGER |
| 34 | 34 | select HAVE_ARCH_TRACEHOOK |
| @@ -1 +1,3 @@ | ||
| 1 | 1 | relocs |
| 2 | +vmlinux.bin.all | |
| 3 | +vmlinux.relocs | |
| @@ -255,9 +255,11 @@ static inline unsigned long dma_alloc_coherent_mask(struct device *dev, · 254 unmodified lines | ||
| 255 | 255 | |
| 256 | 256 | static inline gfp_t dma_alloc_coherent_gfp_flags(struct device *dev, gfp_t gfp) |
| 257 | 257 | { |
| 258 | −#ifdef CONFIG_X86_64 | |
| 259 | 258 | unsigned long dma_mask = dma_alloc_coherent_mask(dev, gfp); |
| 260 | 259 | |
| 260 | + if (dma_mask <= DMA_24BIT_MASK) | |
| 261 | + gfp |= GFP_DMA; | |
| 262 | +#ifdef CONFIG_X86_64 | |
| 261 | 263 | if (dma_mask <= DMA_32BIT_MASK && !(gfp & GFP_DMA)) |
| 262 | 264 | gfp |= GFP_DMA32; |
| 263 | 265 | #endif |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | #ifndef _ASM_X86_FTRACE_H |
| 2 | 2 | #define _ASM_X86_FTRACE_H |
| 3 | 3 | |
| 4 | −#ifdef CONFIG_FTRACE | |
| 4 | +#ifdef CONFIG_FUNCTION_TRACER | |
| 5 | 5 | #define MCOUNT_ADDR ((long)(mcount)) |
| 6 | 6 | #define MCOUNT_INSN_SIZE 5 /* sizeof mcount call */ |
| 7 | 7 | |
| @@ -19,6 +19,6 @@ static inline unsigned long ftrace_call_adjust(unsigned long addr) · 11 unmodified lines | ||
| 19 | 19 | } |
| 20 | 20 | #endif |
| 21 | 21 | |
| 22 | −#endif /* CONFIG_FTRACE */ | |
| 22 | +#endif /* CONFIG_FUNCTION_TRACER */ | |
| 23 | 23 | |
| 24 | 24 | #endif /* _ASM_X86_FTRACE_H */ |
| @@ -7,7 +7,6 @@ extern struct dma_mapping_ops nommu_dma_ops; · 6 unmodified lines | ||
| 7 | 7 | extern int force_iommu, no_iommu; |
| 8 | 8 | extern int iommu_detected; |
| 9 | 9 | extern int dmar_disabled; |
| 10 | −extern int forbid_dac; | |
| 11 | 10 | |
| 12 | 11 | extern unsigned long iommu_nr_pages(unsigned long addr, unsigned long len); |
| 13 | 12 | |
| @@ -364,6 +364,9 @@ struct kvm_arch{ · 363 unmodified lines | ||
| 364 | 364 | |
| 365 | 365 | struct page *ept_identity_pagetable; |
| 366 | 366 | bool ept_identity_pagetable_done; |
| 367 | + | |
| 368 | + unsigned long irq_sources_bitmap; | |
| 369 | + unsigned long irq_states[KVM_IOAPIC_NUM_PINS]; | |
| 367 | 370 | }; |
| 368 | 371 | |
| 369 | 372 | struct kvm_vm_stat { |
| @@ -6,11 +6,12 @@ extra-y := head_$(BITS).o head$(BITS).o head.o init_task.o vmlinu · 5 unmodified lines | ||
| 6 | 6 | |
| 7 | 7 | CPPFLAGS_vmlinux.lds += -U$(UTS_MACHINE) |
| 8 | 8 | |
| 9 | −ifdef CONFIG_FTRACE | |
| 9 | +ifdef CONFIG_FUNCTION_TRACER | |
| 10 | 10 | # Do not profile debug and lowlevel utilities |
| 11 | 11 | CFLAGS_REMOVE_tsc.o = -pg |
| 12 | 12 | CFLAGS_REMOVE_rtc.o = -pg |
| 13 | 13 | CFLAGS_REMOVE_paravirt-spinlocks.o = -pg |
| 14 | +CFLAGS_REMOVE_ftrace.o = -pg | |
| 14 | 15 | endif |
| 15 | 16 | |
| 16 | 17 | # |
| @@ -1149,7 +1149,7 @@ ENDPROC(xen_failsafe_callback) · 1148 unmodified lines | ||
| 1149 | 1149 | |
| 1150 | 1150 | #endif /* CONFIG_XEN */ |
| 1151 | 1151 | |
| 1152 | −#ifdef CONFIG_FTRACE | |
| 1152 | +#ifdef CONFIG_FUNCTION_TRACER | |
| 1153 | 1153 | #ifdef CONFIG_DYNAMIC_FTRACE |
| 1154 | 1154 | |
| 1155 | 1155 | ENTRY(mcount) |
| @@ -1204,7 +1204,7 @@ trace: · 48 unmodified lines | ||
| 1204 | 1204 | jmp ftrace_stub |
| 1205 | 1205 | END(mcount) |
| 1206 | 1206 | #endif /* CONFIG_DYNAMIC_FTRACE */ |
| 1207 | −#endif /* CONFIG_FTRACE */ | |
| 1207 | +#endif /* CONFIG_FUNCTION_TRACER */ | |
| 1208 | 1208 | |
| 1209 | 1209 | .section .rodata,"a" |
| 1210 | 1210 | #include "syscall_table_32.S" |
| @@ -61,7 +61,7 @@ · 60 unmodified lines | ||
| 61 | 61 | |
| 62 | 62 | .code64 |
| 63 | 63 | |
| 64 | −#ifdef CONFIG_FTRACE | |
| 64 | +#ifdef CONFIG_FUNCTION_TRACER | |
| 65 | 65 | #ifdef CONFIG_DYNAMIC_FTRACE |
| 66 | 66 | ENTRY(mcount) |
| 67 | 67 | retq |
| @@ -138,7 +138,7 @@ trace: · 70 unmodified lines | ||
| 138 | 138 | jmp ftrace_stub |
| 139 | 139 | END(mcount) |
| 140 | 140 | #endif /* CONFIG_DYNAMIC_FTRACE */ |
| 141 | −#endif /* CONFIG_FTRACE */ | |
| 141 | +#endif /* CONFIG_FUNCTION_TRACER */ | |
| 142 | 142 | |
| 143 | 143 | #ifndef CONFIG_PREEMPT |
| 144 | 144 | #define retint_kernel retint_restore_args |
| @@ -21,8 +21,7 @@ · 20 unmodified lines | ||
| 21 | 21 | #include <asm/nops.h> |
| 22 | 22 | |
| 23 | 23 | |
| 24 | −/* Long is fine, even if it is only 4 bytes ;-) */ | |
| 25 | −static unsigned long *ftrace_nop; | |
| 24 | +static unsigned char ftrace_nop[MCOUNT_INSN_SIZE]; | |
| 26 | 25 | |
| 27 | 26 | union ftrace_code_union { |
| 28 | 27 | char code[MCOUNT_INSN_SIZE]; |
| @@ -33,17 +32,17 @@ union ftrace_code_union { · 4 unmodified lines | ||
| 33 | 32 | }; |
| 34 | 33 | |
| 35 | 34 | |
| 36 | −static int notrace ftrace_calc_offset(long ip, long addr) | |
| 35 | +static int ftrace_calc_offset(long ip, long addr) | |
| 37 | 36 | { |
| 38 | 37 | return (int)(addr - ip); |
| 39 | 38 | } |
| 40 | 39 | |
| 41 | −notrace unsigned char *ftrace_nop_replace(void) | |
| 40 | +unsigned char *ftrace_nop_replace(void) | |
| 42 | 41 | { |
| 43 | − return (char *)ftrace_nop; | |
| 42 | + return ftrace_nop; | |
| 44 | 43 | } |
| 45 | 44 | |
| 46 | −notrace unsigned char *ftrace_call_replace(unsigned long ip, unsigned long addr) | |
| 45 | +unsigned char *ftrace_call_replace(unsigned long ip, unsigned long addr) | |
| 47 | 46 | { |
| 48 | 47 | static union ftrace_code_union calc; |
| 49 | 48 | |
| @@ -57,7 +56,7 @@ notrace unsigned char *ftrace_call_replace(unsigned long ip, unsigned long addr) · 7 unmodified lines | ||
| 57 | 56 | return calc.code; |
| 58 | 57 | } |
| 59 | 58 | |
| 60 | −notrace int | |
| 59 | +int | |
| 61 | 60 | ftrace_modify_code(unsigned long ip, unsigned char *old_code, |
| 62 | 61 | unsigned char *new_code) |
| 63 | 62 | { |
| @@ -66,26 +65,31 @@ ftrace_modify_code(unsigned long ip, unsigned char *old_code, · 2 unmodified lines | ||
| 66 | 65 | /* |
| 67 | 66 | * Note: Due to modules and __init, code can |
| 68 | 67 | * disappear and change, we need to protect against faulting |
| 69 | − * as well as code changing. | |
| 68 | + * as well as code changing. We do this by using the | |
| 69 | + * probe_kernel_* functions. | |
| 70 | 70 | * |
| 71 | 71 | * No real locking needed, this code is run through |
| 72 | 72 | * kstop_machine, or before SMP starts. |
| 73 | 73 | */ |
| 74 | − if (__copy_from_user_inatomic(replaced, (char __user *)ip, MCOUNT_INSN_SIZE)) | |
| 75 | − return 1; | |
| 76 | 74 | |
| 75 | + /* read the text we want to modify */ | |
| 76 | + if (probe_kernel_read(replaced, (void *)ip, MCOUNT_INSN_SIZE)) | |
| 77 | + return -EFAULT; | |
| 78 | + | |
| 79 | + /* Make sure it is what we expect it to be */ | |
| 77 | 80 | if (memcmp(replaced, old_code, MCOUNT_INSN_SIZE) != 0) |
| 78 | − return 2; | |
| 81 | + return -EINVAL; | |
| 79 | 82 | |
| 80 | − WARN_ON_ONCE(__copy_to_user_inatomic((char __user *)ip, new_code, | |
| 81 | − MCOUNT_INSN_SIZE)); | |
| 83 | + /* replace the text with the new text */ | |
| 84 | + if (probe_kernel_write((void *)ip, new_code, MCOUNT_INSN_SIZE)) | |
| 85 | + return -EPERM; | |
| 82 | 86 | |
| 83 | 87 | sync_core(); |
| 84 | 88 | |
| 85 | 89 | return 0; |
| 86 | 90 | } |
| 87 | 91 | |
| 88 | −notrace int ftrace_update_ftrace_func(ftrace_func_t func) | |
| 92 | +int ftrace_update_ftrace_func(ftrace_func_t func) | |
| 89 | 93 | { |
| 90 | 94 | unsigned long ip = (unsigned long)(&ftrace_call); |
| 91 | 95 | unsigned char old[MCOUNT_INSN_SIZE], *new; |
| @@ -98,13 +102,6 @@ notrace int ftrace_update_ftrace_func(ftrace_func_t func) · 6 unmodified lines | ||
| 98 | 102 | return ret; |
| 99 | 103 | } |
| 100 | 104 | |
| 101 | −notrace int ftrace_mcount_set(unsigned long *data) | |
| 102 | −{ | |
| 103 | − /* mcount is initialized as a nop */ | |
| 104 | − *data = 0; | |
| 105 | − return 0; | |
| 106 | −} | |
| 107 | − | |
| 108 | 105 | int __init ftrace_dyn_arch_init(void *data) |
| 109 | 106 | { |
| 110 | 107 | extern const unsigned char ftrace_test_p6nop[]; |
| @@ -127,9 +124,6 @@ int __init ftrace_dyn_arch_init(void *data) · 16 unmodified lines | ||
| 127 | 124 | * TODO: check the cpuid to determine the best nop. |
| 128 | 125 | */ |
| 129 | 126 | asm volatile ( |
| 130 | − "jmp ftrace_test_jmp\n" | |
| 131 | − /* This code needs to stay around */ | |
| 132 | − ".section .text, \"ax\"\n" | |
| 133 | 127 | "ftrace_test_jmp:" |
| 134 | 128 | "jmp ftrace_test_p6nop\n" |
| 135 | 129 | "nop\n" |
| @@ -140,8 +134,6 @@ int __init ftrace_dyn_arch_init(void *data) · 4 unmodified lines | ||
| 140 | 134 | "jmp 1f\n" |
| 141 | 135 | "ftrace_test_nop5:" |
| 142 | 136 | ".byte 0x66,0x66,0x66,0x66,0x90\n" |
| 143 | − "jmp 1f\n" | |
| 144 | − ".previous\n" | |
| 145 | 137 | "1:" |
| 146 | 138 | ".section .fixup, \"ax\"\n" |
| 147 | 139 | "2: movl $1, %0\n" |
| @@ -156,15 +148,15 @@ int __init ftrace_dyn_arch_init(void *data) · 8 unmodified lines | ||
| 156 | 148 | switch (faulted) { |
| 157 | 149 | case 0: |
| 158 | 150 | pr_info("ftrace: converting mcount calls to 0f 1f 44 00 00\n"); |
| 159 | − ftrace_nop = (unsigned long *)ftrace_test_p6nop; | |
| 151 | + memcpy(ftrace_nop, ftrace_test_p6nop, MCOUNT_INSN_SIZE); | |
| 160 | 152 | break; |
| 161 | 153 | case 1: |
| 162 | 154 | pr_info("ftrace: converting mcount calls to 66 66 66 66 90\n"); |
| 163 | − ftrace_nop = (unsigned long *)ftrace_test_nop5; | |
| 155 | + memcpy(ftrace_nop, ftrace_test_nop5, MCOUNT_INSN_SIZE); | |
| 164 | 156 | break; |
| 165 | 157 | case 2: |
| 166 | 158 | pr_info("ftrace: converting mcount calls to jmp . + 5\n"); |
| 167 | − ftrace_nop = (unsigned long *)ftrace_test_jmp; | |
| 159 | + memcpy(ftrace_nop, ftrace_test_jmp, MCOUNT_INSN_SIZE); | |
| 168 | 160 | break; |
| 169 | 161 | } |
| 170 | 162 | |
| @@ -15,7 +15,6 @@ · 14 unmodified lines | ||
| 15 | 15 | #include <linux/ctype.h> |
| 16 | 16 | #include <linux/init.h> |
| 17 | 17 | #include <linux/sched.h> |
| 18 | −#include <linux/bootmem.h> | |
| 19 | 18 | #include <linux/module.h> |
| 20 | 19 | #include <linux/hardirq.h> |
| 21 | 20 | #include <asm/smp.h> |
| @@ -398,16 +397,16 @@ void __init uv_system_init(void) · 376 unmodified lines | ||
| 398 | 397 | printk(KERN_DEBUG "UV: Found %d blades\n", uv_num_possible_blades()); |
| 399 | 398 | |
| 400 | 399 | bytes = sizeof(struct uv_blade_info) * uv_num_possible_blades(); |
| 401 | − uv_blade_info = alloc_bootmem_pages(bytes); | |
| 400 | + uv_blade_info = kmalloc(bytes, GFP_KERNEL); | |
| 402 | 401 | |
| 403 | 402 | get_lowmem_redirect(&lowmem_redir_base, &lowmem_redir_size); |
| 404 | 403 | |
| 405 | 404 | bytes = sizeof(uv_node_to_blade[0]) * num_possible_nodes(); |
| 406 | − uv_node_to_blade = alloc_bootmem_pages(bytes); | |
| 405 | + uv_node_to_blade = kmalloc(bytes, GFP_KERNEL); | |
| 407 | 406 | memset(uv_node_to_blade, 255, bytes); |
| 408 | 407 | |
| 409 | 408 | bytes = sizeof(uv_cpu_to_blade[0]) * num_possible_cpus(); |
| 410 | − uv_cpu_to_blade = alloc_bootmem_pages(bytes); | |
| 409 | + uv_cpu_to_blade = kmalloc(bytes, GFP_KERNEL); | |
| 411 | 410 | memset(uv_cpu_to_blade, 255, bytes); |
| 412 | 411 | |
| 413 | 412 | blade = 0; |
| @@ -5,7 +5,7 @@ · 4 unmodified lines | ||
| 5 | 5 | #include <asm/desc.h> |
| 6 | 6 | #include <asm/ftrace.h> |
| 7 | 7 | |
| 8 | −#ifdef CONFIG_FTRACE | |
| 8 | +#ifdef CONFIG_FUNCTION_TRACER | |
| 9 | 9 | /* mcount is defined in assembly */ |
| 10 | 10 | EXPORT_SYMBOL(mcount); |
| 11 | 11 | #endif |
| @@ -9,6 +9,8 @@ · 8 unmodified lines | ||
| 9 | 9 | #include <asm/calgary.h> |
| 10 | 10 | #include <asm/amd_iommu.h> |
| 11 | 11 | |
| 12 | +static int forbid_dac __read_mostly; | |
| 13 | + | |
| 12 | 14 | struct dma_mapping_ops *dma_ops; |
| 13 | 15 | EXPORT_SYMBOL(dma_ops); |
| 14 | 16 | |
| @@ -291,3 +293,17 @@ void pci_iommu_shutdown(void) · 276 unmodified lines | ||
| 291 | 293 | } |
| 292 | 294 | /* Must execute after PCI subsystem */ |
| 293 | 295 | fs_initcall(pci_iommu_init); |
| 296 | + | |
| 297 | +#ifdef CONFIG_PCI | |
| 298 | +/* Many VIA bridges seem to corrupt data for DAC. Disable it here */ | |
| 299 | + | |
| 300 | +static __devinit void via_no_dac(struct pci_dev *dev) | |
| 301 | +{ | |
| 302 | + if ((dev->class >> 8) == PCI_CLASS_BRIDGE_PCI && forbid_dac == 0) { | |
| 303 | + printk(KERN_INFO "PCI: VIA PCI bridge detected." | |
| 304 | + "Disabling DAC.\n"); | |
| 305 | + forbid_dac = 1; | |
| 306 | + } | |
| 307 | +} | |
| 308 | +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_ANY_ID, via_no_dac); | |
| 309 | +#endif | |
| @@ -18,9 +18,21 @@ swiotlb_map_single_phys(struct device *hwdev, phys_addr_t paddr, size_t size, · 17 unmodified lines | ||
| 18 | 18 | return swiotlb_map_single(hwdev, phys_to_virt(paddr), size, direction); |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | +static void *x86_swiotlb_alloc_coherent(struct device *hwdev, size_t size, | |
| 22 | + dma_addr_t *dma_handle, gfp_t flags) | |
| 23 | +{ | |
| 24 | + void *vaddr; | |
| 25 | + | |
| 26 | + vaddr = dma_generic_alloc_coherent(hwdev, size, dma_handle, flags); | |
| 27 | + if (vaddr) | |
| 28 | + return vaddr; | |
| 29 | + | |
| 30 | + return swiotlb_alloc_coherent(hwdev, size, dma_handle, flags); | |
| 31 | +} | |
| 32 | + | |
| 21 | 33 | struct dma_mapping_ops swiotlb_dma_ops = { |
| 22 | 34 | .mapping_error = swiotlb_dma_mapping_error, |
| 23 | − .alloc_coherent = swiotlb_alloc_coherent, | |
| 35 | + .alloc_coherent = x86_swiotlb_alloc_coherent, | |
| 24 | 36 | .free_coherent = swiotlb_free_coherent, |
| 25 | 37 | .map_single = swiotlb_map_single_phys, |
| 26 | 38 | .unmap_single = swiotlb_unmap_single, |
| @@ -12,7 +12,7 @@ · 11 unmodified lines | ||
| 12 | 12 | #include <asm/desc.h> |
| 13 | 13 | #include <asm/ftrace.h> |
| 14 | 14 | |
| 15 | −#ifdef CONFIG_FTRACE | |
| 15 | +#ifdef CONFIG_FUNCTION_TRACER | |
| 16 | 16 | /* mcount is defined in assembly */ |
| 17 | 17 | EXPORT_SYMBOL(mcount); |
| 18 | 18 | #endif |
| @@ -545,6 +545,12 @@ struct kvm_pit *kvm_create_pit(struct kvm *kvm) · 544 unmodified lines | ||
| 545 | 545 | if (!pit) |
| 546 | 546 | return NULL; |
| 547 | 547 | |
| 548 | + mutex_lock(&kvm->lock); | |
| 549 | + pit->irq_source_id = kvm_request_irq_source_id(kvm); | |
| 550 | + mutex_unlock(&kvm->lock); | |
| 551 | + if (pit->irq_source_id < 0) | |
| 552 | + return NULL; | |
| 553 | + | |
| 548 | 554 | mutex_init(&pit->pit_state.lock); |
| 549 | 555 | mutex_lock(&pit->pit_state.lock); |
| 550 | 556 | spin_lock_init(&pit->pit_state.inject_lock); |
| @@ -587,6 +593,7 @@ void kvm_free_pit(struct kvm *kvm) · 36 unmodified lines | ||
| 587 | 593 | mutex_lock(&kvm->arch.vpit->pit_state.lock); |
| 588 | 594 | timer = &kvm->arch.vpit->pit_state.pit_timer.timer; |
| 589 | 595 | hrtimer_cancel(timer); |
| 596 | + kvm_free_irq_source_id(kvm, kvm->arch.vpit->irq_source_id); | |
| 590 | 597 | mutex_unlock(&kvm->arch.vpit->pit_state.lock); |
| 591 | 598 | kfree(kvm->arch.vpit); |
| 592 | 599 | } |
| @@ -595,8 +602,8 @@ void kvm_free_pit(struct kvm *kvm) · 2 unmodified lines | ||
| 595 | 602 | static void __inject_pit_timer_intr(struct kvm *kvm) |
| 596 | 603 | { |
| 597 | 604 | mutex_lock(&kvm->lock); |
| 598 | − kvm_set_irq(kvm, 0, 1); | |
| 599 | − kvm_set_irq(kvm, 0, 0); | |
| 605 | + kvm_set_irq(kvm, kvm->arch.vpit->irq_source_id, 0, 1); | |
| 606 | + kvm_set_irq(kvm, kvm->arch.vpit->irq_source_id, 0, 0); | |
| 600 | 607 | mutex_unlock(&kvm->lock); |
| 601 | 608 | } |
| 602 | 609 | |
| @@ -44,6 +44,7 @@ struct kvm_pit { · 43 unmodified lines | ||
| 44 | 44 | struct kvm_io_device speaker_dev; |
| 45 | 45 | struct kvm *kvm; |
| 46 | 46 | struct kvm_kpit_state pit_state; |
| 47 | + int irq_source_id; | |
| 47 | 48 | }; |
| 48 | 49 | |
| 49 | 50 | #define KVM_PIT_BASE_ADDRESS 0x40 |
| @@ -2634,6 +2634,7 @@ static int kvm_pv_mmu_write(struct kvm_vcpu *vcpu, · 2633 unmodified lines | ||
| 2634 | 2634 | static int kvm_pv_mmu_flush_tlb(struct kvm_vcpu *vcpu) |
| 2635 | 2635 | { |
| 2636 | 2636 | kvm_x86_ops->tlb_flush(vcpu); |
| 2637 | + set_bit(KVM_REQ_MMU_SYNC, &vcpu->requests); | |
| 2637 | 2638 | return 1; |
| 2638 | 2639 | } |
| 2639 | 2640 | |
| @@ -1742,7 +1742,8 @@ long kvm_arch_vm_ioctl(struct file *filp, · 1741 unmodified lines | ||
| 1742 | 1742 | goto out; |
| 1743 | 1743 | if (irqchip_in_kernel(kvm)) { |
| 1744 | 1744 | mutex_lock(&kvm->lock); |
| 1745 | − kvm_set_irq(kvm, irq_event.irq, irq_event.level); | |
| 1745 | + kvm_set_irq(kvm, KVM_USERSPACE_IRQ_SOURCE_ID, | |
| 1746 | + irq_event.irq, irq_event.level); | |
| 1746 | 1747 | mutex_unlock(&kvm->lock); |
| 1747 | 1748 | r = 0; |
| 1748 | 1749 | } |
| @@ -4013,6 +4014,9 @@ struct kvm *kvm_arch_create_vm(void) · 2264 unmodified lines | ||
| 4013 | 4014 | INIT_LIST_HEAD(&kvm->arch.active_mmu_pages); |
| 4014 | 4015 | INIT_LIST_HEAD(&kvm->arch.assigned_dev_head); |
| 4015 | 4016 | |
| 4017 | + /* Reserve bit 0 of irq_sources_bitmap for userspace irq source */ | |
| 4018 | + set_bit(KVM_USERSPACE_IRQ_SOURCE_ID, &kvm->arch.irq_sources_bitmap); | |
| 4019 | + | |
| 4016 | 4020 | return kvm; |
| 4017 | 4021 | } |
| 4018 | 4022 | |
| @@ -350,8 +350,10 @@ phys_pte_init(pte_t *pte_page, unsigned long addr, unsigned long end, · 349 unmodified lines | ||
| 350 | 350 | * pagetable pages as RO. So assume someone who pre-setup |
| 351 | 351 | * these mappings are more intelligent. |
| 352 | 352 | */ |
| 353 | − if (pte_val(*pte)) | |
| 353 | + if (pte_val(*pte)) { | |
| 354 | + pages++; | |
| 354 | 355 | continue; |
| 356 | + } | |
| 355 | 357 | |
| 356 | 358 | if (0) |
| 357 | 359 | printk(" pte=%p addr=%lx pte=%016lx\n", |
| @@ -418,8 +420,10 @@ phys_pmd_init(pmd_t *pmd_page, unsigned long address, unsigned long end, · 60 unmodified lines | ||
| 418 | 420 | * not differ with respect to page frame and |
| 419 | 421 | * attributes. |
| 420 | 422 | */ |
| 421 | − if (page_size_mask & (1 << PG_LEVEL_2M)) | |
| 423 | + if (page_size_mask & (1 << PG_LEVEL_2M)) { | |
| 424 | + pages++; | |
| 422 | 425 | continue; |
| 426 | + } | |
| 423 | 427 | new_prot = pte_pgprot(pte_clrhuge(*(pte_t *)pmd)); |
| 424 | 428 | } |
| 425 | 429 | |
| @@ -499,8 +503,10 @@ phys_pud_init(pud_t *pud_page, unsigned long addr, unsigned long end, · 73 unmodified lines | ||
| 499 | 503 | * not differ with respect to page frame and |
| 500 | 504 | * attributes. |
| 501 | 505 | */ |
| 502 | − if (page_size_mask & (1 << PG_LEVEL_1G)) | |
| 506 | + if (page_size_mask & (1 << PG_LEVEL_1G)) { | |
| 507 | + pages++; | |
| 503 | 508 | continue; |
| 509 | + } | |
| 504 | 510 | prot = pte_pgprot(pte_clrhuge(*(pte_t *)pud)); |
| 505 | 511 | } |
| 506 | 512 | |
| @@ -831,7 +837,7 @@ int arch_add_memory(int nid, u64 start, u64 size) · 324 unmodified lines | ||
| 831 | 837 | unsigned long nr_pages = size >> PAGE_SHIFT; |
| 832 | 838 | int ret; |
| 833 | 839 | |
| 834 | − last_mapped_pfn = init_memory_mapping(start, start + size-1); | |
| 840 | + last_mapped_pfn = init_memory_mapping(start, start + size); | |
| 835 | 841 | if (last_mapped_pfn > max_pfn_mapped) |
| 836 | 842 | max_pfn_mapped = last_mapped_pfn; |
| 837 | 843 | |
| @@ -1,4 +1,4 @@ | ||
| 1 | −ifdef CONFIG_FTRACE | |
| 1 | +ifdef CONFIG_FUNCTION_TRACER | |
| 2 | 2 | # Do not profile debug and lowlevel utilities |
| 3 | 3 | CFLAGS_REMOVE_spinlock.o = -pg |
| 4 | 4 | CFLAGS_REMOVE_time.o = -pg |
| @@ -246,11 +246,21 @@ xmaddr_t arbitrary_virt_to_machine(void *vaddr) · 245 unmodified lines | ||
| 246 | 246 | { |
| 247 | 247 | unsigned long address = (unsigned long)vaddr; |
| 248 | 248 | unsigned int level; |
| 249 | − pte_t *pte = lookup_address(address, &level); | |
| 250 | − unsigned offset = address & ~PAGE_MASK; | |
| 249 | + pte_t *pte; | |
| 250 | + unsigned offset; | |
| 251 | 251 | |
| 252 | − BUG_ON(pte == NULL); | |
| 252 | + /* | |
| 253 | + * if the PFN is in the linear mapped vaddr range, we can just use | |
| 254 | + * the (quick) virt_to_machine() p2m lookup | |
| 255 | + */ | |
| 256 | + if (virt_addr_valid(vaddr)) | |
| 257 | + return virt_to_machine(vaddr); | |
| 253 | 258 | |
| 259 | + /* otherwise we have to do a (slower) full page-table walk */ | |
| 260 | + | |
| 261 | + pte = lookup_address(address, &level); | |
| 262 | + BUG_ON(pte == NULL); | |
| 263 | + offset = address & ~PAGE_MASK; | |
| 254 | 264 | return XMADDR(((phys_addr_t)pte_mfn(*pte) << PAGE_SHIFT) + offset); |
| 255 | 265 | } |
| 256 | 266 | |
| @@ -410,7 +420,7 @@ void xen_ptep_modify_prot_commit(struct mm_struct *mm, unsigned long addr, · 153 unmodified lines | ||
| 410 | 420 | |
| 411 | 421 | xen_mc_batch(); |
| 412 | 422 | |
| 413 | − u.ptr = virt_to_machine(ptep).maddr | MMU_PT_UPDATE_PRESERVE_AD; | |
| 423 | + u.ptr = arbitrary_virt_to_machine(ptep).maddr | MMU_PT_UPDATE_PRESERVE_AD; | |
| 414 | 424 | u.val = pte_val_ma(pte); |
| 415 | 425 | xen_extend_mmu_update(&u); |
| 416 | 426 | |
| @@ -68,6 +68,8 @@ source "drivers/ssb/Kconfig" · 67 unmodified lines | ||
| 68 | 68 | |
| 69 | 69 | source "drivers/mfd/Kconfig" |
| 70 | 70 | |
| 71 | +source "drivers/regulator/Kconfig" | |
| 72 | + | |
| 71 | 73 | source "drivers/media/Kconfig" |
| 72 | 74 | |
| 73 | 75 | source "drivers/video/Kconfig" |
| @@ -49,6 +49,17 @@ · 48 unmodified lines | ||
| 49 | 49 | #define DRV_NAME "ahci" |
| 50 | 50 | #define DRV_VERSION "3.0" |
| 51 | 51 | |
| 52 | +/* Enclosure Management Control */ | |
| 53 | +#define EM_CTRL_MSG_TYPE 0x000f0000 | |
| 54 | + | |
| 55 | +/* Enclosure Management LED Message Type */ | |
| 56 | +#define EM_MSG_LED_HBA_PORT 0x0000000f | |
| 57 | +#define EM_MSG_LED_PMP_SLOT 0x0000ff00 | |
| 58 | +#define EM_MSG_LED_VALUE 0xffff0000 | |
| 59 | +#define EM_MSG_LED_VALUE_ACTIVITY 0x00070000 | |
| 60 | +#define EM_MSG_LED_VALUE_OFF 0xfff80000 | |
| 61 | +#define EM_MSG_LED_VALUE_ON 0x00010000 | |
| 62 | + | |
| 52 | 63 | static int ahci_skip_host_reset; |
| 53 | 64 | module_param_named(skip_host_reset, ahci_skip_host_reset, int, 0444); |
| 54 | 65 | MODULE_PARM_DESC(skip_host_reset, "skip global host reset (0=don't skip, 1=skip)"); |
| @@ -588,6 +599,9 @@ static const struct pci_device_id ahci_pci_tbl[] = { · 533 unmodified lines | ||
| 588 | 599 | { PCI_VDEVICE(MARVELL, 0x6145), board_ahci_mv }, /* 6145 */ |
| 589 | 600 | { PCI_VDEVICE(MARVELL, 0x6121), board_ahci_mv }, /* 6121 */ |
| 590 | 601 | |
| 602 | + /* Promise */ | |
| 603 | + { PCI_VDEVICE(PROMISE, 0x3f20), board_ahci }, /* PDC42819 */ | |
| 604 | + | |
| 591 | 605 | /* Generic, PCI class code for AHCI */ |
| 592 | 606 | { PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, |
| 593 | 607 | PCI_CLASS_STORAGE_SATA_AHCI, 0xffffff, board_ahci }, |
| @@ -1220,18 +1234,20 @@ static void ahci_sw_activity_blink(unsigned long arg) · 626 unmodified lines | ||
| 1220 | 1234 | struct ahci_em_priv *emp = &pp->em_priv[link->pmp]; |
| 1221 | 1235 | unsigned long led_message = emp->led_state; |
| 1222 | 1236 | u32 activity_led_state; |
| 1237 | + unsigned long flags; | |
| 1223 | 1238 | |
| 1224 | − led_message &= 0xffff0000; | |
| 1239 | + led_message &= EM_MSG_LED_VALUE; | |
| 1225 | 1240 | led_message |= ap->port_no | (link->pmp << 8); |
| 1226 | 1241 | |
| 1227 | 1242 | /* check to see if we've had activity. If so, |
| 1228 | 1243 | * toggle state of LED and reset timer. If not, |
| 1229 | 1244 | * turn LED to desired idle state. |
| 1230 | 1245 | */ |
| 1246 | + spin_lock_irqsave(ap->lock, flags); | |
| 1231 | 1247 | if (emp->saved_activity != emp->activity) { |
| 1232 | 1248 | emp->saved_activity = emp->activity; |
| 1233 | 1249 | /* get the current LED state */ |
| 1234 | − activity_led_state = led_message & 0x00010000; | |
| 1250 | + activity_led_state = led_message & EM_MSG_LED_VALUE_ON; | |
| 1235 | 1251 | |
| 1236 | 1252 | if (activity_led_state) |
| 1237 | 1253 | activity_led_state = 0; |
| @@ -1239,17 +1255,18 @@ static void ahci_sw_activity_blink(unsigned long arg) · 1 unmodified line | ||
| 1239 | 1255 | activity_led_state = 1; |
| 1240 | 1256 | |
| 1241 | 1257 | /* clear old state */ |
| 1242 | − led_message &= 0xfff8ffff; | |
| 1258 | + led_message &= ~EM_MSG_LED_VALUE_ACTIVITY; | |
| 1243 | 1259 | |
| 1244 | 1260 | /* toggle state */ |
| 1245 | 1261 | led_message |= (activity_led_state << 16); |
| 1246 | 1262 | mod_timer(&emp->timer, jiffies + msecs_to_jiffies(100)); |
| 1247 | 1263 | } else { |
| 1248 | 1264 | /* switch to idle */ |
| 1249 | − led_message &= 0xfff8ffff; | |
| 1265 | + led_message &= ~EM_MSG_LED_VALUE_ACTIVITY; | |
| 1250 | 1266 | if (emp->blink_policy == BLINK_OFF) |
| 1251 | 1267 | led_message |= (1 << 16); |
| 1252 | 1268 | } |
| 1269 | + spin_unlock_irqrestore(ap->lock, flags); | |
| 1253 | 1270 | ahci_transmit_led_message(ap, led_message, 4); |
| 1254 | 1271 | } |
| 1255 | 1272 | |
| @@ -1294,7 +1311,7 @@ static ssize_t ahci_transmit_led_message(struct ata_port *ap, u32 state, · 38 unmodified lines | ||
| 1294 | 1311 | struct ahci_em_priv *emp; |
| 1295 | 1312 | |
| 1296 | 1313 | /* get the slot number from the message */ |
| 1297 | − pmp = (state & 0x0000ff00) >> 8; | |
| 1314 | + pmp = (state & EM_MSG_LED_PMP_SLOT) >> 8; | |
| 1298 | 1315 | if (pmp < MAX_SLOTS) |
| 1299 | 1316 | emp = &pp->em_priv[pmp]; |
| 1300 | 1317 | else |
| @@ -1319,7 +1336,7 @@ static ssize_t ahci_transmit_led_message(struct ata_port *ap, u32 state, · 18 unmodified lines | ||
| 1319 | 1336 | message[0] |= (4 << 8); |
| 1320 | 1337 | |
| 1321 | 1338 | /* ignore 0:4 of byte zero, fill in port info yourself */ |
| 1322 | − message[1] = ((state & 0xfffffff0) | ap->port_no); | |
| 1339 | + message[1] = ((state & ~EM_MSG_LED_HBA_PORT) | ap->port_no); | |
| 1323 | 1340 | |
| 1324 | 1341 | /* write message to EM_LOC */ |
| 1325 | 1342 | writel(message[0], mmio + hpriv->em_loc); |
| @@ -1362,7 +1379,7 @@ static ssize_t ahci_led_store(struct ata_port *ap, const char *buf, · 36 unmodified lines | ||
| 1362 | 1379 | state = simple_strtoul(buf, NULL, 0); |
| 1363 | 1380 | |
| 1364 | 1381 | /* get the slot number from the message */ |
| 1365 | − pmp = (state & 0x0000ff00) >> 8; | |
| 1382 | + pmp = (state & EM_MSG_LED_PMP_SLOT) >> 8; | |
| 1366 | 1383 | if (pmp < MAX_SLOTS) |
| 1367 | 1384 | emp = &pp->em_priv[pmp]; |
| 1368 | 1385 | else |
| @@ -1373,7 +1390,7 @@ static ssize_t ahci_led_store(struct ata_port *ap, const char *buf, · 4 unmodified lines | ||
| 1373 | 1390 | * activity led through em_message |
| 1374 | 1391 | */ |
| 1375 | 1392 | if (emp->blink_policy) |
| 1376 | − state &= 0xfff8ffff; | |
| 1393 | + state &= ~EM_MSG_LED_VALUE_ACTIVITY; | |
| 1377 | 1394 | |
| 1378 | 1395 | return ahci_transmit_led_message(ap, state, size); |
| 1379 | 1396 | } |
| @@ -1392,16 +1409,16 @@ static ssize_t ahci_activity_store(struct ata_device *dev, enum sw_activity val) · 12 unmodified lines | ||
| 1392 | 1409 | link->flags &= ~(ATA_LFLAG_SW_ACTIVITY); |
| 1393 | 1410 | |
| 1394 | 1411 | /* set the LED to OFF */ |
| 1395 | − port_led_state &= 0xfff80000; | |
| 1412 | + port_led_state &= EM_MSG_LED_VALUE_OFF; | |
| 1396 | 1413 | port_led_state |= (ap->port_no | (link->pmp << 8)); |
| 1397 | 1414 | ahci_transmit_led_message(ap, port_led_state, 4); |
| 1398 | 1415 | } else { |
| 1399 | 1416 | link->flags |= ATA_LFLAG_SW_ACTIVITY; |
| 1400 | 1417 | if (val == BLINK_OFF) { |
| 1401 | 1418 | /* set LED to ON for idle */ |
| 1402 | − port_led_state &= 0xfff80000; | |
| 1419 | + port_led_state &= EM_MSG_LED_VALUE_OFF; | |
| 1403 | 1420 | port_led_state |= (ap->port_no | (link->pmp << 8)); |
| 1404 | − port_led_state |= 0x00010000; /* check this */ | |
| 1421 | + port_led_state |= EM_MSG_LED_VALUE_ON; /* check this */ | |
| 1405 | 1422 | ahci_transmit_led_message(ap, port_led_state, 4); |
| 1406 | 1423 | } |
| 1407 | 1424 | } |
| @@ -2612,7 +2629,7 @@ static int ahci_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) · 1204 unmodified lines | ||
| 2612 | 2629 | u32 em_loc = readl(mmio + HOST_EM_LOC); |
| 2613 | 2630 | u32 em_ctl = readl(mmio + HOST_EM_CTL); |
| 2614 | 2631 | |
| 2615 | − messages = (em_ctl & 0x000f0000) >> 16; | |
| 2632 | + messages = (em_ctl & EM_CTRL_MSG_TYPE) >> 16; | |
| 2616 | 2633 | |
| 2617 | 2634 | /* we only support LED message type right now */ |
| 2618 | 2635 | if ((messages & 0x01) && (ahci_em_messages == 1)) { |
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | /* |
| 2 | 2 | * ata_generic.c - Generic PATA/SATA controller driver. |
| 3 | − * Copyright 2005 Red Hat Inc <alan@redhat.com>, all rights reserved. | |
| 3 | + * Copyright 2005 Red Hat Inc, all rights reserved. | |
| 4 | 4 | * |
| 5 | 5 | * Elements from ide/pci/generic.c |
| 6 | 6 | * Copyright (C) 2001-2002 Andre Hedrick <andre@linux-ide.org> |
| @@ -14,7 +14,7 @@ · 13 unmodified lines | ||
| 14 | 14 | * |
| 15 | 15 | * Copyright (C) 1998-1999 Andrzej Krzysztofowicz, Author and Maintainer |
| 16 | 16 | * Copyright (C) 1998-2000 Andre Hedrick <andre@linux-ide.org> |
| 17 | − * Copyright (C) 2003 Red Hat Inc <alan@redhat.com> | |
| 17 | + * Copyright (C) 2003 Red Hat Inc | |
| 18 | 18 | * |
| 19 | 19 | * |
| 20 | 20 | * This program is free software; you can redistribute it and/or modify |
| @@ -4156,29 +4156,33 @@ static int cable_is_40wire(struct ata_port *ap) · 4155 unmodified lines | ||
| 4156 | 4156 | struct ata_link *link; |
| 4157 | 4157 | struct ata_device *dev; |
| 4158 | 4158 | |
| 4159 | − /* If the controller thinks we are 40 wire, we are */ | |
| 4159 | + /* If the controller thinks we are 40 wire, we are. */ | |
| 4160 | 4160 | if (ap->cbl == ATA_CBL_PATA40) |
| 4161 | 4161 | return 1; |
| 4162 | − /* If the controller thinks we are 80 wire, we are */ | |
| 4162 | + | |
| 4163 | + /* If the controller thinks we are 80 wire, we are. */ | |
| 4163 | 4164 | if (ap->cbl == ATA_CBL_PATA80 || ap->cbl == ATA_CBL_SATA) |
| 4164 | 4165 | return 0; |
| 4165 | − /* If the system is known to be 40 wire short cable (eg laptop), | |
| 4166 | − then we allow 80 wire modes even if the drive isn't sure */ | |
| 4166 | + | |
| 4167 | + /* If the system is known to be 40 wire short cable (eg | |
| 4168 | + * laptop), then we allow 80 wire modes even if the drive | |
| 4169 | + * isn't sure. | |
| 4170 | + */ | |
| 4167 | 4171 | if (ap->cbl == ATA_CBL_PATA40_SHORT) |
| 4168 | 4172 | return 0; |
| 4169 | − /* If the controller doesn't know we scan | |
| 4170 | − | |
| 4171 | − - Note: We look for all 40 wire detects at this point. | |
| 4172 | − Any 80 wire detect is taken to be 80 wire cable | |
| 4173 | − because | |
| 4174 | − - In many setups only the one drive (slave if present) | |
| 4175 | − will give a valid detect | |
| 4176 | − - If you have a non detect capable drive you don't | |
| 4177 | − want it to colour the choice | |
| 4178 | − */ | |
| 4173 | + | |
| 4174 | + /* If the controller doesn't know, we scan. | |
| 4175 | + * | |
| 4176 | + * Note: We look for all 40 wire detects at this point. Any | |
| 4177 | + * 80 wire detect is taken to be 80 wire cable because | |
| 4178 | + * - in many setups only the one drive (slave if present) will | |
| 4179 | + * give a valid detect | |
| 4180 | + * - if you have a non detect capable drive you don't want it | |
| 4181 | + * to colour the choice | |
| 4182 | + */ | |
| 4179 | 4183 | ata_port_for_each_link(link, ap) { |
| 4180 | 4184 | ata_link_for_each_dev(dev, link) { |
| 4181 | − if (!ata_is_40wire(dev)) | |
| 4185 | + if (ata_dev_enabled(dev) && !ata_is_40wire(dev)) | |
| 4182 | 4186 | return 0; |
| 4183 | 4187 | } |
| 4184 | 4188 | } |
| @@ -4553,6 +4557,7 @@ void swap_buf_le16(u16 *buf, unsigned int buf_words) · 368 unmodified lines | ||
| 4553 | 4557 | /** |
| 4554 | 4558 | * ata_qc_new_init - Request an available ATA command, and initialize it |
| 4555 | 4559 | * @dev: Device from whom we request an available command structure |
| 4560 | + * @tag: command tag | |
| 4556 | 4561 | * |
| 4557 | 4562 | * LOCKING: |
| 4558 | 4563 | * None. |
| @@ -603,6 +603,9 @@ void ata_scsi_error(struct Scsi_Host *host) · 602 unmodified lines | ||
| 603 | 603 | ata_link_for_each_dev(dev, link) { |
| 604 | 604 | int devno = dev->devno; |
| 605 | 605 | |
| 606 | + if (!ata_dev_enabled(dev)) | |
| 607 | + continue; | |
| 608 | + | |
| 606 | 609 | ehc->saved_xfer_mode[devno] = dev->xfer_mode; |
| 607 | 610 | if (ata_ncq_enabled(dev)) |
| 608 | 611 | ehc->saved_ncq_enabled |= 1 << devno; |
| @@ -1161,6 +1164,7 @@ void ata_eh_detach_dev(struct ata_device *dev) · 552 unmodified lines | ||
| 1161 | 1164 | { |
| 1162 | 1165 | struct ata_link *link = dev->link; |
| 1163 | 1166 | struct ata_port *ap = link->ap; |
| 1167 | + struct ata_eh_context *ehc = &link->eh_context; | |
| 1164 | 1168 | unsigned long flags; |
| 1165 | 1169 | |
| 1166 | 1170 | ata_dev_disable(dev); |
| @@ -1174,9 +1178,11 @@ void ata_eh_detach_dev(struct ata_device *dev) · 7 unmodified lines | ||
| 1174 | 1178 | ap->pflags |= ATA_PFLAG_SCSI_HOTPLUG; |
| 1175 | 1179 | } |
| 1176 | 1180 | |
| 1177 | − /* clear per-dev EH actions */ | |
| 1181 | + /* clear per-dev EH info */ | |
| 1178 | 1182 | ata_eh_clear_action(link, dev, &link->eh_info, ATA_EH_PERDEV_MASK); |
| 1179 | 1183 | ata_eh_clear_action(link, dev, &link->eh_context.i, ATA_EH_PERDEV_MASK); |
| 1184 | + ehc->saved_xfer_mode[dev->devno] = 0; | |
| 1185 | + ehc->saved_ncq_enabled &= ~(1 << dev->devno); | |
| 1180 | 1186 | |
| 1181 | 1187 | spin_unlock_irqrestore(ap->lock, flags); |
| 1182 | 1188 | } |
| @@ -2787,6 +2793,9 @@ int ata_set_mode(struct ata_link *link, struct ata_device **r_failed_dev) · 1604 unmodified lines | ||
| 2787 | 2793 | |
| 2788 | 2794 | /* if data transfer is verified, clear DUBIOUS_XFER on ering top */ |
| 2789 | 2795 | ata_link_for_each_dev(dev, link) { |
| 2796 | + if (!ata_dev_enabled(dev)) | |
| 2797 | + continue; | |
| 2798 | + | |
| 2790 | 2799 | if (!(dev->flags & ATA_DFLAG_DUBIOUS_XFER)) { |
| 2791 | 2800 | struct ata_ering_entry *ent; |
| 2792 | 2801 | |
| @@ -2808,6 +2817,9 @@ int ata_set_mode(struct ata_link *link, struct ata_device **r_failed_dev) · 15 unmodified lines | ||
| 2808 | 2817 | u8 saved_xfer_mode = ehc->saved_xfer_mode[dev->devno]; |
| 2809 | 2818 | u8 saved_ncq = !!(ehc->saved_ncq_enabled & (1 << dev->devno)); |
| 2810 | 2819 | |
| 2820 | + if (!ata_dev_enabled(dev)) | |
| 2821 | + continue; | |
| 2822 | + | |
| 2811 | 2823 | if (dev->xfer_mode != saved_xfer_mode || |
| 2812 | 2824 | ata_ncq_enabled(dev) != saved_ncq) |
| 2813 | 2825 | dev->flags |= ATA_DFLAG_DUBIOUS_XFER; |
| @@ -1107,6 +1107,15 @@ static int ata_scsi_dev_config(struct scsi_device *sdev, · 1106 unmodified lines | ||
| 1107 | 1107 | |
| 1108 | 1108 | depth = min(sdev->host->can_queue, ata_id_queue_depth(dev->id)); |
| 1109 | 1109 | depth = min(ATA_MAX_QUEUE - 1, depth); |
| 1110 | + | |
| 1111 | + /* | |
| 1112 | + * If this device is behind a port multiplier, we have | |
| 1113 | + * to share the tag map between all devices on that PMP. | |
| 1114 | + * Set up the shared tag map here and we get automatic. | |
| 1115 | + */ | |
| 1116 | + if (dev->link->ap->pmp_link) | |
| 1117 | + scsi_init_shared_tag_map(sdev->host, ATA_MAX_QUEUE - 1); | |
| 1118 | + | |
| 1110 | 1119 | scsi_set_tag_type(sdev, MSG_SIMPLE_TAG); |
| 1111 | 1120 | scsi_activate_tcq(sdev, depth); |
| 1112 | 1121 | } |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | /* |
| 2 | 2 | * ACPI PATA driver |
| 3 | 3 | * |
| 4 | − * (c) 2007 Red Hat <alan@redhat.com> | |
| 4 | + * (c) 2007 Red Hat | |
| 5 | 5 | */ |
| 6 | 6 | |
| 7 | 7 | #include <linux/kernel.h> |
| @@ -1,7 +1,6 @@ | ||
| 1 | 1 | /* |
| 2 | 2 | * pata_ali.c - ALI 15x3 PATA for new ATA layer |
| 3 | 3 | * (C) 2005 Red Hat Inc |
| 4 | − * Alan Cox <alan@redhat.com> | |
| 5 | 4 | * |
| 6 | 5 | * based in part upon |
| 7 | 6 | * linux/drivers/ide/pci/alim15x3.c Version 0.17 2003/01/02 |
| @@ -1,7 +1,6 @@ | ||
| 1 | 1 | /* |
| 2 | 2 | * pata_amd.c - AMD PATA for new ATA layer |
| 3 | 3 | * (C) 2005-2006 Red Hat Inc |
| 4 | − * Alan Cox <alan@redhat.com> | |
| 5 | 4 | * |
| 6 | 5 | * Based on pata-sil680. Errata information is taken from data sheets |
| 7 | 6 | * and the amd74xx.c driver by Vojtech Pavlik. Nvidia SATA devices are |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | /* |
| 2 | 2 | * pata_artop.c - ARTOP ATA controller driver |
| 3 | 3 | * |
| 4 | − * (C) 2006 Red Hat <alan@redhat.com> | |
| 4 | + * (C) 2006 Red Hat | |
| 5 | 5 | * (C) 2007 Bartlomiej Zolnierkiewicz |
| 6 | 6 | * |
| 7 | 7 | * Based in part on drivers/ide/pci/aec62xx.c |
| @@ -1,7 +1,6 @@ | ||
| 1 | 1 | /* |
| 2 | 2 | * pata_atiixp.c - ATI PATA for new ATA layer |
| 3 | 3 | * (C) 2005 Red Hat Inc |
| 4 | − * Alan Cox <alan@redhat.com> | |
| 5 | 4 | * |
| 6 | 5 | * Based on |
| 7 | 6 | * |
| @@ -1,7 +1,6 @@ | ||
| 1 | 1 | /* |
| 2 | 2 | * pata_cmd640.c - CMD640 PCI PATA for new ATA layer |
| 3 | 3 | * (C) 2007 Red Hat Inc |
| 4 | − * Alan Cox <alan@redhat.com> | |
| 5 | 4 | * |
| 6 | 5 | * Based upon |
| 7 | 6 | * linux/drivers/ide/pci/cmd640.c Version 1.02 Sep 01, 1996 |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | /* |
| 2 | 2 | * pata_cmd64x.c - CMD64x PATA for new ATA layer |
| 3 | 3 | * (C) 2005 Red Hat Inc |
| 4 | − * Alan Cox <alan@redhat.com> | |
| 4 | + * Alan Cox <alan@lxorguk.ukuu.org.uk> | |
| 5 | 5 | * |
| 6 | 6 | * Based upon |
| 7 | 7 | * linux/drivers/ide/pci/cmd64x.c Version 1.30 Sept 10, 2002 |
| @@ -1,7 +1,6 @@ | ||
| 1 | 1 | /* |
| 2 | 2 | * pata-cs5530.c - CS5530 PATA for new ATA layer |
| 3 | 3 | * (C) 2005 Red Hat Inc |
| 4 | − * Alan Cox <alan@redhat.com> | |
| 5 | 4 | * |
| 6 | 5 | * based upon cs5530.c by Mark Lord. |
| 7 | 6 | * |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | /* |
| 2 | 2 | * pata-cs5535.c - CS5535 PATA for new ATA layer |
| 3 | 3 | * (C) 2005-2006 Red Hat Inc |
| 4 | − * Alan Cox <alan@redhat.com> | |
| 4 | + * Alan Cox <alan@lxorguk.ukuu.org.uk> | |
| 5 | 5 | * |
| 6 | 6 | * based upon cs5535.c from AMD <Jens.Altmann@amd.com> as cleaned up and |
| 7 | 7 | * made readable and Linux style by Wolfgang Zuleger <wolfgang.zuleger@gmx.de |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | /* |
| 2 | 2 | * pata_cypress.c - Cypress PATA for new ATA layer |
| 3 | 3 | * (C) 2006 Red Hat Inc |
| 4 | − * Alan Cox <alan@redhat.com> | |
| 4 | + * Alan Cox | |
| 5 | 5 | * |
| 6 | 6 | * Based heavily on |
| 7 | 7 | * linux/drivers/ide/pci/cy82c693.c Version 0.40 Sep. 10, 2002 |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | /* |
| 2 | 2 | * pata_efar.c - EFAR PIIX clone controller driver |
| 3 | 3 | * |
| 4 | − * (C) 2005 Red Hat <alan@redhat.com> | |
| 4 | + * (C) 2005 Red Hat | |
| 5 | 5 | * |
| 6 | 6 | * Some parts based on ata_piix.c by Jeff Garzik and others. |
| 7 | 7 | * |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | |
| 2 | 2 | /* |
| 3 | 3 | * pata-isapnp.c - ISA PnP PATA controller driver. |
| 4 | − * Copyright 2005/2006 Red Hat Inc <alan@redhat.com>, all rights reserved. | |
| 4 | + * Copyright 2005/2006 Red Hat Inc, all rights reserved. | |
| 5 | 5 | * |
| 6 | 6 | * Based in part on ide-pnp.c by Andrey Panin <pazke@donpac.ru> |
| 7 | 7 | */ |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | /* |
| 2 | 2 | * pata_it821x.c - IT821x PATA for new ATA layer |
| 3 | 3 | * (C) 2005 Red Hat Inc |
| 4 | − * Alan Cox <alan@redhat.com> | |
| 4 | + * Alan Cox <alan@lxorguk.ukuu.org.uk> | |
| 5 | 5 | * (C) 2007 Bartlomiej Zolnierkiewicz |
| 6 | 6 | * |
| 7 | 7 | * based upon |
| @@ -10,7 +10,7 @@ · 2 unmodified lines | ||
| 10 | 10 | * |
| 11 | 11 | * linux/drivers/ide/pci/it821x.c Version 0.09 December 2004 |
| 12 | 12 | * |
| 13 | − * Copyright (C) 2004 Red Hat <alan@redhat.com> | |
| 13 | + * Copyright (C) 2004 Red Hat | |
| 14 | 14 | * |
| 15 | 15 | * May be copied or modified under the terms of the GNU General Public License |
| 16 | 16 | * Based in part on the ITE vendor provided SCSI driver. |
| @@ -557,9 +557,8 @@ static unsigned int it821x_read_id(struct ata_device *adev, · 540 unmodified lines | ||
| 557 | 557 | if (strstr(model_num, "Integrated Technology Express")) { |
| 558 | 558 | /* Set feature bits the firmware neglects */ |
| 559 | 559 | id[49] |= 0x0300; /* LBA, DMA */ |
| 560 | − id[82] |= 0x0400; /* LBA48 */ | |
| 561 | 560 | id[83] &= 0x7FFF; |
| 562 | − id[83] |= 0x4000; /* Word 83 is valid */ | |
| 561 | + id[83] |= 0x4400; /* Word 83 is valid and LBA48 */ | |
| 563 | 562 | id[86] |= 0x0400; /* LBA48 on */ |
| 564 | 563 | id[ATA_ID_MAJOR_VER] |= 0x1F; |
| 565 | 564 | } |
| @@ -4,7 +4,7 @@ · 3 unmodified lines | ||
| 4 | 4 | * driven by AHCI in the usual configuration although |
| 5 | 5 | * this driver can handle other setups if we need it. |
| 6 | 6 | * |
| 7 | − * (c) 2006 Red Hat <alan@redhat.com> | |
| 7 | + * (c) 2006 Red Hat | |
| 8 | 8 | */ |
| 9 | 9 | |
| 10 | 10 | #include <linux/kernel.h> |
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | /* |
| 2 | 2 | * pata-legacy.c - Legacy port PATA/SATA controller driver. |
| 3 | − * Copyright 2005/2006 Red Hat <alan@redhat.com>, all rights reserved. | |
| 3 | + * Copyright 2005/2006 Red Hat, all rights reserved. | |
| 4 | 4 | * |
| 5 | 5 | * This program is free software; you can redistribute it and/or modify |
| 6 | 6 | * it under the terms of the GNU General Public License as published by |
| @@ -5,7 +5,7 @@ · 4 unmodified lines | ||
| 5 | 5 | * isn't making full use of the device functionality but it is |
| 6 | 6 | * easy to get working. |
| 7 | 7 | * |
| 8 | − * (c) 2006 Red Hat <alan@redhat.com> | |
| 8 | + * (c) 2006 Red Hat | |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | 11 | #include <linux/kernel.h> |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | /* |
| 2 | 2 | * pata_mpiix.c - Intel MPIIX PATA for new ATA layer |
| 3 | 3 | * (C) 2005-2006 Red Hat Inc |
| 4 | − * Alan Cox <alan@redhat.com> | |
| 4 | + * Alan Cox <alan@lxorguk.ukuu.org.uk> | |
| 5 | 5 | * |
| 6 | 6 | * The MPIIX is different enough to the PIIX4 and friends that we give it |
| 7 | 7 | * a separate driver. The old ide/pci code handles this by just not tuning |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | /* |
| 2 | 2 | * pata_netcell.c - Netcell PATA driver |
| 3 | 3 | * |
| 4 | − * (c) 2006 Red Hat <alan@redhat.com> | |
| 4 | + * (c) 2006 Red Hat | |
| 5 | 5 | */ |
| 6 | 6 | |
| 7 | 7 | #include <linux/kernel.h> |
| @@ -1,7 +1,6 @@ | ||
| 1 | 1 | /* |
| 2 | 2 | * pata_ninja32.c - Ninja32 PATA for new ATA layer |
| 3 | 3 | * (C) 2007 Red Hat Inc |
| 4 | − * Alan Cox <alan@redhat.com> | |
| 5 | 4 | * |
| 6 | 5 | * Note: The controller like many controllers has shared timings for |
| 7 | 6 | * PIO and DMA. We thus flip to the DMA timings in dma_start and flip back |
| @@ -45,7 +44,7 @@ · 37 unmodified lines | ||
| 45 | 44 | #include <linux/libata.h> |
| 46 | 45 | |
| 47 | 46 | #define DRV_NAME "pata_ninja32" |
| 48 | −#define DRV_VERSION "0.0.1" | |
| 47 | +#define DRV_VERSION "0.1.1" | |
| 49 | 48 | |
| 50 | 49 | |
| 51 | 50 | /** |
| @@ -89,6 +88,17 @@ static struct ata_port_operations ninja32_port_ops = { · 37 unmodified lines | ||
| 89 | 88 | .set_piomode = ninja32_set_piomode, |
| 90 | 89 | }; |
| 91 | 90 | |
| 91 | +static void ninja32_program(void __iomem *base) | |
| 92 | +{ | |
| 93 | + iowrite8(0x05, base + 0x01); /* Enable interrupt lines */ | |
| 94 | + iowrite8(0xBE, base + 0x02); /* Burst, ?? setup */ | |
| 95 | + iowrite8(0x01, base + 0x03); /* Unknown */ | |
| 96 | + iowrite8(0x20, base + 0x04); /* WAIT0 */ | |
| 97 | + iowrite8(0x8f, base + 0x05); /* Unknown */ | |
| 98 | + iowrite8(0xa4, base + 0x1c); /* Unknown */ | |
| 99 | + iowrite8(0x83, base + 0x1d); /* BMDMA control: WAIT0 */ | |
| 100 | +} | |
| 101 | + | |
| 92 | 102 | static int ninja32_init_one(struct pci_dev *dev, const struct pci_device_id *id) |
| 93 | 103 | { |
| 94 | 104 | struct ata_host *host; |
| @@ -134,18 +144,28 @@ static int ninja32_init_one(struct pci_dev *dev, const struct pci_device_id *id) · 39 unmodified lines | ||
| 134 | 144 | ap->ioaddr.bmdma_addr = base; |
| 135 | 145 | ata_sff_std_ports(&ap->ioaddr); |
| 136 | 146 | |
| 137 | − iowrite8(0x05, base + 0x01); /* Enable interrupt lines */ | |
| 138 | − iowrite8(0xBE, base + 0x02); /* Burst, ?? setup */ | |
| 139 | − iowrite8(0x01, base + 0x03); /* Unknown */ | |
| 140 | − iowrite8(0x20, base + 0x04); /* WAIT0 */ | |
| 141 | − iowrite8(0x8f, base + 0x05); /* Unknown */ | |
| 142 | − iowrite8(0xa4, base + 0x1c); /* Unknown */ | |
| 143 | − iowrite8(0x83, base + 0x1d); /* BMDMA control: WAIT0 */ | |
| 147 | + ninja32_program(base); | |
| 144 | 148 | /* FIXME: Should we disable them at remove ? */ |
| 145 | 149 | return ata_host_activate(host, dev->irq, ata_sff_interrupt, |
| 146 | 150 | IRQF_SHARED, &ninja32_sht); |
| 147 | 151 | } |
| 148 | 152 | |
| 153 | +#ifdef CONFIG_PM | |
| 154 | + | |
| 155 | +static int ninja32_reinit_one(struct pci_dev *pdev) | |
| 156 | +{ | |
| 157 | + struct ata_host *host = dev_get_drvdata(&pdev->dev); | |
| 158 | + int rc; | |
| 159 | + | |
| 160 | + rc = ata_pci_device_do_resume(pdev); | |
| 161 | + if (rc) | |
| 162 | + return rc; | |
| 163 | + ninja32_program(host->iomap[0]); | |
| 164 | + ata_host_resume(host); | |
| 165 | + return 0; | |
| 166 | +} | |
| 167 | +#endif | |
| 168 | + | |
| 149 | 169 | static const struct pci_device_id ninja32[] = { |
| 150 | 170 | { 0x1145, 0xf021, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, |
| 151 | 171 | { 0x1145, 0xf024, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 }, |
| @@ -156,7 +176,11 @@ static struct pci_driver ninja32_pci_driver = { · 4 unmodified lines | ||
| 156 | 176 | .name = DRV_NAME, |
| 157 | 177 | .id_table = ninja32, |
| 158 | 178 | .probe = ninja32_init_one, |
| 159 | − .remove = ata_pci_remove_one | |
| 179 | + .remove = ata_pci_remove_one, | |
| 180 | +#ifdef CONFIG_PM | |
| 181 | + .suspend = ata_pci_device_suspend, | |
| 182 | + .resume = ninja32_reinit_one, | |
| 183 | +#endif | |
| 160 | 184 | }; |
| 161 | 185 | |
| 162 | 186 | static int __init ninja32_init(void) |
| @@ -1,7 +1,6 @@ | ||
| 1 | 1 | /* |
| 2 | 2 | * pata_ns87410.c - National Semiconductor 87410 PATA for new ATA layer |
| 3 | 3 | * (C) 2006 Red Hat Inc |
| 4 | − * Alan Cox <alan@redhat.com> | |
| 5 | 4 | * |
| 6 | 5 | * This program is free software; you can redistribute it and/or modify |
| 7 | 6 | * it under the terms of the GNU General Public License as published by |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | /* |
| 2 | 2 | * pata_ns87415.c - NS87415 (non PARISC) PATA |
| 3 | 3 | * |
| 4 | − * (C) 2005 Red Hat <alan@redhat.com> | |
| 4 | + * (C) 2005 Red Hat <alan@lxorguk.ukuu.org.uk> | |
| 5 | 5 | * |
| 6 | 6 | * This is a fairly generic MWDMA controller. It has some limitations |
| 7 | 7 | * as it requires timing reloads on PIO/DMA transitions but it is otherwise |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | /* |
| 2 | 2 | * pata_oldpiix.c - Intel PATA/SATA controllers |
| 3 | 3 | * |
| 4 | − * (C) 2005 Red Hat <alan@redhat.com> | |
| 4 | + * (C) 2005 Red Hat | |
| 5 | 5 | * |
| 6 | 6 | * Some parts based on ata_piix.c by Jeff Garzik and others. |
| 7 | 7 | * |
| @@ -1,7 +1,6 @@ | ||
| 1 | 1 | /* |
| 2 | 2 | * pata_opti.c - ATI PATA for new ATA layer |
| 3 | 3 | * (C) 2005 Red Hat Inc |
| 4 | − * Alan Cox <alan@redhat.com> | |
| 5 | 4 | * |
| 6 | 5 | * Based on |
| 7 | 6 | * linux/drivers/ide/pci/opti621.c Version 0.7 Sept 10, 2002 |
| @@ -1,7 +1,6 @@ | ||
| 1 | 1 | /* |
| 2 | 2 | * pata_optidma.c - Opti DMA PATA for new ATA layer |
| 3 | 3 | * (C) 2006 Red Hat Inc |
| 4 | − * Alan Cox <alan@redhat.com> | |
| 5 | 4 | * |
| 6 | 5 | * The Opti DMA controllers are related to the older PIO PCI controllers |
| 7 | 6 | * and indeed the VLB ones. The main differences are that the timing |
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | /* |
| 2 | 2 | * pata_pcmcia.c - PCMCIA PATA controller driver. |
| 3 | − * Copyright 2005-2006 Red Hat Inc <alan@redhat.com>, all rights reserved. | |
| 3 | + * Copyright 2005-2006 Red Hat Inc, all rights reserved. | |
| 4 | 4 | * PCMCIA ident update Copyright 2006 Marcin Juszkiewicz |
| 5 | 5 | * <openembedded@hrw.one.pl> |
| 6 | 6 | * |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | /* |
| 2 | 2 | * pata_pdc202xx_old.c - Promise PDC202xx PATA for new ATA layer |
| 3 | 3 | * (C) 2005 Red Hat Inc |
| 4 | − * Alan Cox <alan@redhat.com> | |
| 4 | + * Alan Cox <alan@lxorguk.ukuu.org.uk> | |
| 5 | 5 | * (C) 2007 Bartlomiej Zolnierkiewicz |
| 6 | 6 | * |
| 7 | 7 | * Based in part on linux/drivers/ide/pci/pdc202xx_old.c |
| @@ -5,7 +5,7 @@ · 4 unmodified lines | ||
| 5 | 5 | * |
| 6 | 6 | * Based on pata_pcmcia: |
| 7 | 7 | * |
| 8 | − * Copyright 2005-2006 Red Hat Inc <alan@redhat.com>, all rights reserved. | |
| 8 | + * Copyright 2005-2006 Red Hat Inc, all rights reserved. | |
| 9 | 9 | * |
| 10 | 10 | * This file is subject to the terms and conditions of the GNU General Public |
| 11 | 11 | * License. See the file "COPYING" in the main directory of this archive |
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | /* |
| 2 | 2 | * pata_qdi.c - QDI VLB ATA controllers |
| 3 | − * (C) 2006 Red Hat <alan@redhat.com> | |
| 3 | + * (C) 2006 Red Hat | |
| 4 | 4 | * |
| 5 | 5 | * This driver mostly exists as a proof of concept for non PCI devices under |
| 6 | 6 | * libata. While the QDI6580 was 'neat' in 1993 it is no longer terribly |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | /* |
| 2 | 2 | * pata_radisys.c - Intel PATA/SATA controllers |
| 3 | 3 | * |
| 4 | − * (C) 2006 Red Hat <alan@redhat.com> | |
| 4 | + * (C) 2006 Red Hat <alan@lxorguk.ukuu.org.uk> | |
| 5 | 5 | * |
| 6 | 6 | * Some parts based on ata_piix.c by Jeff Garzik and others. |
| 7 | 7 | * |
| @@ -1,5 +1,5 @@ | ||
| 1 | 1 | /* |
| 2 | − * New ATA layer SC1200 driver Alan Cox <alan@redhat.com> | |
| 2 | + * New ATA layer SC1200 driver Alan Cox <alan@lxorguk.ukuu.org.uk> | |
| 3 | 3 | * |
| 4 | 4 | * TODO: Mode selection filtering |
| 5 | 5 | * TODO: Can't enable second channel until ATA core has serialize |
| @@ -8,7 +8,7 @@ · 7 unmodified lines | ||
| 8 | 8 | * Copyright 2003-2005 Jeff Garzik |
| 9 | 9 | * Copyright (C) 1998-1999 Andrzej Krzysztofowicz, Author and Maintainer |
| 10 | 10 | * Copyright (C) 1998-2000 Andre Hedrick <andre@linux-ide.org> |
| 11 | − * Copyright (C) 2003 Red Hat Inc <alan@redhat.com> | |
| 11 | + * Copyright (C) 2003 Red Hat Inc | |
| 12 | 12 | * |
| 13 | 13 | * and drivers/ata/ahci.c: |
| 14 | 14 | * Copyright 2004-2005 Red Hat, Inc. |
| @@ -1,7 +1,6 @@ | ||
| 1 | 1 | /* |
| 2 | 2 | * pata_serverworks.c - Serverworks PATA for new ATA layer |
| 3 | 3 | * (C) 2005 Red Hat Inc |
| 4 | − * Alan Cox <alan@redhat.com> | |
| 5 | 4 | * |
| 6 | 5 | * based upon |
| 7 | 6 | * |
| @@ -1,7 +1,6 @@ | ||
| 1 | 1 | /* |
| 2 | 2 | * pata_sil680.c - SIL680 PATA for new ATA layer |
| 3 | 3 | * (C) 2005 Red Hat Inc |
| 4 | − * Alan Cox <alan@redhat.com> | |
| 5 | 4 | * |
| 6 | 5 | * based upon |
| 7 | 6 | * |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | /* |
| 2 | 2 | * pata_sis.c - SiS ATA driver |
| 3 | 3 | * |
| 4 | − * (C) 2005 Red Hat <alan@redhat.com> | |
| 4 | + * (C) 2005 Red Hat | |
| 5 | 5 | * (C) 2007 Bartlomiej Zolnierkiewicz |
| 6 | 6 | * |
| 7 | 7 | * Based upon linux/drivers/ide/pci/sis5513.c |
| @@ -1,7 +1,6 @@ | ||
| 1 | 1 | /* |
| 2 | 2 | * pata_sl82c105.c - SL82C105 PATA for new ATA layer |
| 3 | 3 | * (C) 2005 Red Hat Inc |
| 4 | − * Alan Cox <alan@redhat.com> | |
| 5 | 4 | * |
| 6 | 5 | * Based in part on linux/drivers/ide/pci/sl82c105.c |
| 7 | 6 | * SL82C105/Winbond 553 IDE driver |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | /* |
| 2 | 2 | * pata_triflex.c - Compaq PATA for new ATA layer |
| 3 | 3 | * (C) 2005 Red Hat Inc |
| 4 | − * Alan Cox <alan@redhat.com> | |
| 4 | + * Alan Cox <alan@lxorguk.ukuu.org.uk> | |
| 5 | 5 | * |
| 6 | 6 | * based upon |
| 7 | 7 | * |
| @@ -1,7 +1,6 @@ | ||
| 1 | 1 | /* |
| 2 | 2 | * pata_via.c - VIA PATA for new ATA layer |
| 3 | 3 | * (C) 2005-2006 Red Hat Inc |
| 4 | − * Alan Cox <alan@redhat.com> | |
| 5 | 4 | * |
| 6 | 5 | * Documentation |
| 7 | 6 | * Most chipset documentation available under NDA only |
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | /* |
| 2 | 2 | * pata_winbond.c - Winbond VLB ATA controllers |
| 3 | − * (C) 2006 Red Hat <alan@redhat.com> | |
| 3 | + * (C) 2006 Red Hat | |
| 4 | 4 | * |
| 5 | 5 | * Support for the Winbond 83759A when operating in advanced mode. |
| 6 | 6 | * Multichip mode is not currently supported. |
| @@ -1329,6 +1329,11 @@ static int sil24_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) · 1328 unmodified lines | ||
| 1329 | 1329 | } |
| 1330 | 1330 | } |
| 1331 | 1331 | |
| 1332 | + /* Set max read request size to 4096. This slightly increases | |
| 1333 | + * write throughput for pci-e variants. | |
| 1334 | + */ | |
| 1335 | + pcie_set_readrq(pdev, 4096); | |
| 1336 | + | |
| 1332 | 1337 | sil24_init_controller(host); |
| 1333 | 1338 | |
| 1334 | 1339 | pci_set_master(pdev); |
| @@ -355,7 +355,7 @@ static void __sysdev_resume(struct sys_device *dev) · 354 unmodified lines | ||
| 355 | 355 | * sysdev_suspend - Suspend all system devices. |
| 356 | 356 | * @state: Power state to enter. |
| 357 | 357 | * |
| 358 | − * We perform an almost identical operation as sys_device_shutdown() | |
| 358 | + * We perform an almost identical operation as sysdev_shutdown() | |
| 359 | 359 | * above, though calling ->suspend() instead. Interrupts are disabled |
| 360 | 360 | * when this called. Devices are responsible for both saving state and |
| 361 | 361 | * quiescing or powering down the device. |
| @@ -437,7 +437,7 @@ aux_driver: · 75 unmodified lines | ||
| 437 | 437 | /** |
| 438 | 438 | * sysdev_resume - Bring system devices back to life. |
| 439 | 439 | * |
| 440 | − * Similar to sys_device_suspend(), but we iterate the list forwards | |
| 440 | + * Similar to sysdev_suspend(), but we iterate the list forwards | |
| 441 | 441 | * to guarantee that parent devices are resumed before their children. |
| 442 | 442 | * |
| 443 | 443 | * Note: Interrupts are disabled when called. |
| @@ -488,7 +488,8 @@ ssize_t sysdev_store_ulong(struct sys_device *sysdev, · 44 unmodified lines | ||
| 488 | 488 | if (end == buf) |
| 489 | 489 | return -EINVAL; |
| 490 | 490 | *(unsigned long *)(ea->var) = new; |
| 491 | − return end - buf; | |
| 491 | + /* Always return full write size even if we didn't consume all */ | |
| 492 | + return size; | |
| 492 | 493 | } |
| 493 | 494 | EXPORT_SYMBOL_GPL(sysdev_store_ulong); |
| 494 | 495 | |
| @@ -511,7 +512,8 @@ ssize_t sysdev_store_int(struct sys_device *sysdev, · 16 unmodified lines | ||
| 511 | 512 | if (end == buf || new > INT_MAX || new < INT_MIN) |
| 512 | 513 | return -EINVAL; |
| 513 | 514 | *(int *)(ea->var) = new; |
| 514 | − return end - buf; | |
| 515 | + /* Always return full write size even if we didn't consume all */ | |
| 516 | + return size; | |
| 515 | 517 | } |
| 516 | 518 | EXPORT_SYMBOL_GPL(sysdev_store_int); |
| 517 | 519 | |
| @@ -40,8 +40,7 @@ · 39 unmodified lines | ||
| 40 | 40 | * Heinz Mauelshagen <mge@sistina.com>, Feb 2002 |
| 41 | 41 | * |
| 42 | 42 | * Support for falling back on the write file operation when the address space |
| 43 | − * operations prepare_write and/or commit_write are not available on the | |
| 44 | − * backing filesystem. | |
| 43 | + * operations write_begin is not available on the backing filesystem. | |
| 45 | 44 | * Anton Altaparmakov, 16 Feb 2005 |
| 46 | 45 | * |
| 47 | 46 | * Still To Fix: |
| @@ -765,7 +764,7 @@ static int loop_set_fd(struct loop_device *lo, fmode_t mode, · 717 unmodified lines | ||
| 765 | 764 | */ |
| 766 | 765 | if (!file->f_op->splice_read) |
| 767 | 766 | goto out_putf; |
| 768 | − if (aops->prepare_write || aops->write_begin) | |
| 767 | + if (aops->write_begin) | |
| 769 | 768 | lo_flags |= LO_FLAGS_USE_AOPS; |
| 770 | 769 | if (!(lo_flags & LO_FLAGS_USE_AOPS) && !file->f_op->write) |
| 771 | 770 | lo_flags |= LO_FLAGS_READ_ONLY; |
| @@ -152,7 +152,7 @@ static int btsdio_rx_packet(struct btsdio_data *data) · 151 unmodified lines | ||
| 152 | 152 | |
| 153 | 153 | err = sdio_readsb(data->func, skb->data, REG_RDAT, len - 4); |
| 154 | 154 | if (err < 0) { |
| 155 | − kfree(skb); | |
| 155 | + kfree_skb(skb); | |
| 156 | 156 | return err; |
| 157 | 157 | } |
| 158 | 158 | |
| @@ -11,7 +11,7 @@ · 10 unmodified lines | ||
| 11 | 11 | * derived from |
| 12 | 12 | * |
| 13 | 13 | * Hardware driver for the AMD 768 Random Number Generator (RNG) |
| 14 | − * (c) Copyright 2001 Red Hat Inc <alan@redhat.com> | |
| 14 | + * (c) Copyright 2001 Red Hat Inc | |
| 15 | 15 | * |
| 16 | 16 | * derived from |
| 17 | 17 | * |
| @@ -11,7 +11,7 @@ · 10 unmodified lines | ||
| 11 | 11 | * derived from |
| 12 | 12 | * |
| 13 | 13 | * Hardware driver for the AMD 768 Random Number Generator (RNG) |
| 14 | − * (c) Copyright 2001 Red Hat Inc <alan@redhat.com> | |
| 14 | + * (c) Copyright 2001 Red Hat Inc | |
| 15 | 15 | * |
| 16 | 16 | * derived from |
| 17 | 17 | * |
| @@ -11,7 +11,7 @@ · 10 unmodified lines | ||
| 11 | 11 | * derived from |
| 12 | 12 | * |
| 13 | 13 | * Hardware driver for the AMD 768 Random Number Generator (RNG) |
| 14 | − * (c) Copyright 2001 Red Hat Inc <alan@redhat.com> | |
| 14 | + * (c) Copyright 2001 Red Hat Inc | |
| 15 | 15 | * |
| 16 | 16 | * derived from |
| 17 | 17 | * |
| @@ -11,7 +11,7 @@ · 10 unmodified lines | ||
| 11 | 11 | * derived from |
| 12 | 12 | * |
| 13 | 13 | * Hardware driver for the AMD 768 Random Number Generator (RNG) |
| 14 | − * (c) Copyright 2001 Red Hat Inc <alan@redhat.com> | |
| 14 | + * (c) Copyright 2001 Red Hat Inc | |
| 15 | 15 | * |
| 16 | 16 | * derived from |
| 17 | 17 | * |
| @@ -957,3 +957,4 @@ module_exit(cleanup_ipmi); · 956 unmodified lines | ||
| 957 | 957 | MODULE_LICENSE("GPL"); |
| 958 | 958 | MODULE_AUTHOR("Corey Minyard <minyard@mvista.com>"); |
| 959 | 959 | MODULE_DESCRIPTION("Linux device interface for the IPMI message handler."); |
| 960 | +MODULE_ALIAS("platform:ipmi_si"); | |
| @@ -102,6 +102,13 @@ config EDAC_I3000 · 101 unmodified lines | ||
| 102 | 102 | Support for error detection and correction on the Intel |
| 103 | 103 | 3000 and 3010 server chipsets. |
| 104 | 104 | |
| 105 | +config EDAC_X38 | |
| 106 | + tristate "Intel X38" | |
| 107 | + depends on EDAC_MM_EDAC && PCI && X86 | |
| 108 | + help | |
| 109 | + Support for error detection and correction on the Intel | |
| 110 | + X38 server chipsets. | |
| 111 | + | |
| 105 | 112 | config EDAC_I82860 |
| 106 | 113 | tristate "Intel 82860" |
| 107 | 114 | depends on EDAC_MM_EDAC && PCI && X86_32 |
| @@ -26,6 +26,7 @@ obj-$(CONFIG_EDAC_I82443BXGX) += i82443bxgx_edac.o · 25 unmodified lines | ||
| 26 | 26 | obj-$(CONFIG_EDAC_I82875P) += i82875p_edac.o |
| 27 | 27 | obj-$(CONFIG_EDAC_I82975X) += i82975x_edac.o |
| 28 | 28 | obj-$(CONFIG_EDAC_I3000) += i3000_edac.o |
| 29 | +obj-$(CONFIG_EDAC_X38) += x38_edac.o | |
| 29 | 30 | obj-$(CONFIG_EDAC_I82860) += i82860_edac.o |
| 30 | 31 | obj-$(CONFIG_EDAC_R82600) += r82600_edac.o |
| 31 | 32 | obj-$(CONFIG_EDAC_PASEMI) += pasemi_edac.o |
| @@ -9,6 +9,7 @@ · 8 unmodified lines | ||
| 9 | 9 | */ |
| 10 | 10 | #undef DEBUG |
| 11 | 11 | |
| 12 | +#include <linux/edac.h> | |
| 12 | 13 | #include <linux/module.h> |
| 13 | 14 | #include <linux/init.h> |
| 14 | 15 | #include <linux/platform_device.h> |
| @@ -164,6 +165,8 @@ static int __devinit cell_edac_probe(struct platform_device *pdev) · 149 unmodified lines | ||
| 164 | 165 | if (regs == NULL) |
| 165 | 166 | return -ENODEV; |
| 166 | 167 | |
| 168 | + edac_op_state = EDAC_OPSTATE_POLL; | |
| 169 | + | |
| 167 | 170 | /* Get channel population */ |
| 168 | 171 | reg = in_be64(®s->mic_mnt_cfg); |
| 169 | 172 | dev_dbg(&pdev->dev, "MIC_MNT_CFG = 0x%016lx\n", reg); |
| @@ -0,0 +1,524 @@ | ||
| 1 | +/* | |
| 2 | + * Intel X38 Memory Controller kernel module | |
| 3 | + * Copyright (C) 2008 Cluster Computing, Inc. | |
| 4 | + * | |
| 5 | + * This file may be distributed under the terms of the | |
| 6 | + * GNU General Public License. | |
| 7 | + * | |
| 8 | + * This file is based on i3200_edac.c | |
| 9 | + * | |
| 10 | + */ | |
| 11 | + | |
| 12 | +#include <linux/module.h> | |
| 13 | +#include <linux/init.h> | |
| 14 | +#include <linux/pci.h> | |
| 15 | +#include <linux/pci_ids.h> | |
| 16 | +#include <linux/slab.h> | |
| 17 | +#include <linux/edac.h> | |
| 18 | +#include "edac_core.h" | |
| 19 | + | |
| 20 | +#define X38_REVISION "1.1" | |
| 21 | + | |
| 22 | +#define EDAC_MOD_STR "x38_edac" | |
| 23 | + | |
| 24 | +#define PCI_DEVICE_ID_INTEL_X38_HB 0x29e0 | |
| 25 | + | |
| 26 | +#define X38_RANKS 8 | |
| 27 | +#define X38_RANKS_PER_CHANNEL 4 | |
| 28 | +#define X38_CHANNELS 2 | |
| 29 | + | |
| 30 | +/* Intel X38 register addresses - device 0 function 0 - DRAM Controller */ | |
| 31 | + | |
| 32 | +#define X38_MCHBAR_LOW 0x48 /* MCH Memory Mapped Register BAR */ | |
| 33 | +#define X38_MCHBAR_HIGH 0x4b | |
| 34 | +#define X38_MCHBAR_MASK 0xfffffc000ULL /* bits 35:14 */ | |
| 35 | +#define X38_MMR_WINDOW_SIZE 16384 | |
| 36 | + | |
| 37 | +#define X38_TOM 0xa0 /* Top of Memory (16b) | |
| 38 | + * | |
| 39 | + * 15:10 reserved | |
| 40 | + * 9:0 total populated physical memory | |
| 41 | + */ | |
| 42 | +#define X38_TOM_MASK 0x3ff /* bits 9:0 */ | |
| 43 | +#define X38_TOM_SHIFT 26 /* 64MiB grain */ | |
| 44 | + | |
| 45 | +#define X38_ERRSTS 0xc8 /* Error Status Register (16b) | |
| 46 | + * | |
| 47 | + * 15 reserved | |
| 48 | + * 14 Isochronous TBWRR Run Behind FIFO Full | |
| 49 | + * (ITCV) | |
| 50 | + * 13 Isochronous TBWRR Run Behind FIFO Put | |
| 51 | + * (ITSTV) | |
| 52 | + * 12 reserved | |
| 53 | + * 11 MCH Thermal Sensor Event | |
| 54 | + * for SMI/SCI/SERR (GTSE) | |
| 55 | + * 10 reserved | |
| 56 | + * 9 LOCK to non-DRAM Memory Flag (LCKF) | |
| 57 | + * 8 reserved | |
| 58 | + * 7 DRAM Throttle Flag (DTF) | |
| 59 | + * 6:2 reserved | |
| 60 | + * 1 Multi-bit DRAM ECC Error Flag (DMERR) | |
| 61 | + * 0 Single-bit DRAM ECC Error Flag (DSERR) | |
| 62 | + */ | |
| 63 | +#define X38_ERRSTS_UE 0x0002 | |
| 64 | +#define X38_ERRSTS_CE 0x0001 | |
| 65 | +#define X38_ERRSTS_BITS (X38_ERRSTS_UE | X38_ERRSTS_CE) | |
| 66 | + | |
| 67 | + | |
| 68 | +/* Intel MMIO register space - device 0 function 0 - MMR space */ | |
| 69 | + | |
| 70 | +#define X38_C0DRB 0x200 /* Channel 0 DRAM Rank Boundary (16b x 4) | |
| 71 | + * | |
| 72 | + * 15:10 reserved | |
| 73 | + * 9:0 Channel 0 DRAM Rank Boundary Address | |
| 74 | + */ | |
| 75 | +#define X38_C1DRB 0x600 /* Channel 1 DRAM Rank Boundary (16b x 4) */ | |
| 76 | +#define X38_DRB_MASK 0x3ff /* bits 9:0 */ | |
| 77 | +#define X38_DRB_SHIFT 26 /* 64MiB grain */ | |
| 78 | + | |
| 79 | +#define X38_C0ECCERRLOG 0x280 /* Channel 0 ECC Error Log (64b) | |
| 80 | + * | |
| 81 | + * 63:48 Error Column Address (ERRCOL) | |
| 82 | + * 47:32 Error Row Address (ERRROW) | |
| 83 | + * 31:29 Error Bank Address (ERRBANK) | |
| 84 | + * 28:27 Error Rank Address (ERRRANK) | |
| 85 | + * 26:24 reserved | |
| 86 | + * 23:16 Error Syndrome (ERRSYND) | |
| 87 | + * 15: 2 reserved | |
| 88 | + * 1 Multiple Bit Error Status (MERRSTS) | |
| 89 | + * 0 Correctable Error Status (CERRSTS) | |
| 90 | + */ | |
| 91 | +#define X38_C1ECCERRLOG 0x680 /* Channel 1 ECC Error Log (64b) */ | |
| 92 | +#define X38_ECCERRLOG_CE 0x1 | |
| 93 | +#define X38_ECCERRLOG_UE 0x2 | |
| 94 | +#define X38_ECCERRLOG_RANK_BITS 0x18000000 | |
| 95 | +#define X38_ECCERRLOG_SYNDROME_BITS 0xff0000 | |
| 96 | + | |
| 97 | +#define X38_CAPID0 0xe0 /* see P.94 of spec for details */ | |
| 98 | + | |
| 99 | +static int x38_channel_num; | |
| 100 | + | |
| 101 | +static int how_many_channel(struct pci_dev *pdev) | |
| 102 | +{ | |
| 103 | + unsigned char capid0_8b; /* 8th byte of CAPID0 */ | |
| 104 | + | |
| 105 | + pci_read_config_byte(pdev, X38_CAPID0 + 8, &capid0_8b); | |
| 106 | + if (capid0_8b & 0x20) { /* check DCD: Dual Channel Disable */ | |
| 107 | + debugf0("In single channel mode.\n"); | |
| 108 | + x38_channel_num = 1; | |
| 109 | + } else { | |
| 110 | + debugf0("In dual channel mode.\n"); | |
| 111 | + x38_channel_num = 2; | |
| 112 | + } | |
| 113 | + | |
| 114 | + return x38_channel_num; | |
| 115 | +} | |
| 116 | + | |
| 117 | +static unsigned long eccerrlog_syndrome(u64 log) | |
| 118 | +{ | |
| 119 | + return (log & X38_ECCERRLOG_SYNDROME_BITS) >> 16; | |
| 120 | +} | |
| 121 | + | |
| 122 | +static int eccerrlog_row(int channel, u64 log) | |
| 123 | +{ | |
| 124 | + return ((log & X38_ECCERRLOG_RANK_BITS) >> 27) | | |
| 125 | + (channel * X38_RANKS_PER_CHANNEL); | |
| 126 | +} | |
| 127 | + | |
| 128 | +enum x38_chips { | |
| 129 | + X38 = 0, | |
| 130 | +}; | |
| 131 | + | |
| 132 | +struct x38_dev_info { | |
| 133 | + const char *ctl_name; | |
| 134 | +}; | |
| 135 | + | |
| 136 | +struct x38_error_info { | |
| 137 | + u16 errsts; | |
| 138 | + u16 errsts2; | |
| 139 | + u64 eccerrlog[X38_CHANNELS]; | |
| 140 | +}; | |
| 141 | + | |
| 142 | +static const struct x38_dev_info x38_devs[] = { | |
| 143 | + [X38] = { | |
| 144 | + .ctl_name = "x38"}, | |
| 145 | +}; | |
| 146 | + | |
| 147 | +static struct pci_dev *mci_pdev; | |
| 148 | +static int x38_registered = 1; | |
| 149 | + | |
| 150 | + | |
| 151 | +static void x38_clear_error_info(struct mem_ctl_info *mci) | |
| 152 | +{ | |
| 153 | + struct pci_dev *pdev; | |
| 154 | + | |
| 155 | + pdev = to_pci_dev(mci->dev); | |
| 156 | + | |
| 157 | + /* | |
| 158 | + * Clear any error bits. | |
| 159 | + * (Yes, we really clear bits by writing 1 to them.) | |
| 160 | + */ | |
| 161 | + pci_write_bits16(pdev, X38_ERRSTS, X38_ERRSTS_BITS, | |
| 162 | + X38_ERRSTS_BITS); | |
| 163 | +} | |
| 164 | + | |
| 165 | +static u64 x38_readq(const void __iomem *addr) | |
| 166 | +{ | |
| 167 | + return readl(addr) | (((u64)readl(addr + 4)) << 32); | |
| 168 | +} | |
| 169 | + | |
| 170 | +static void x38_get_and_clear_error_info(struct mem_ctl_info *mci, | |
| 171 | + struct x38_error_info *info) | |
| 172 | +{ | |
| 173 | + struct pci_dev *pdev; | |
| 174 | + void __iomem *window = mci->pvt_info; | |
| 175 | + | |
| 176 | + pdev = to_pci_dev(mci->dev); | |
| 177 | + | |
| 178 | + /* | |
| 179 | + * This is a mess because there is no atomic way to read all the | |
| 180 | + * registers at once and the registers can transition from CE being | |
| 181 | + * overwritten by UE. | |
| 182 | + */ | |
| 183 | + pci_read_config_word(pdev, X38_ERRSTS, &info->errsts); | |
| 184 | + if (!(info->errsts & X38_ERRSTS_BITS)) | |
| 185 | + return; | |
| 186 | + | |
| 187 | + info->eccerrlog[0] = x38_readq(window + X38_C0ECCERRLOG); | |
| 188 | + if (x38_channel_num == 2) | |
| 189 | + info->eccerrlog[1] = x38_readq(window + X38_C1ECCERRLOG); | |
| 190 | + | |
| 191 | + pci_read_config_word(pdev, X38_ERRSTS, &info->errsts2); | |
| 192 | + | |
| 193 | + /* | |
| 194 | + * If the error is the same for both reads then the first set | |
| 195 | + * of reads is valid. If there is a change then there is a CE | |
| 196 | + * with no info and the second set of reads is valid and | |
| 197 | + * should be UE info. | |
| 198 | + */ | |
| 199 | + if ((info->errsts ^ info->errsts2) & X38_ERRSTS_BITS) { | |
| 200 | + info->eccerrlog[0] = x38_readq(window + X38_C0ECCERRLOG); | |
| 201 | + if (x38_channel_num == 2) | |
| 202 | + info->eccerrlog[1] = | |
| 203 | + x38_readq(window + X38_C1ECCERRLOG); | |
| 204 | + } | |
| 205 | + | |
| 206 | + x38_clear_error_info(mci); | |
| 207 | +} | |
| 208 | + | |
| 209 | +static void x38_process_error_info(struct mem_ctl_info *mci, | |
| 210 | + struct x38_error_info *info) | |
| 211 | +{ | |
| 212 | + int channel; | |
| 213 | + u64 log; | |
| 214 | + | |
| 215 | + if (!(info->errsts & X38_ERRSTS_BITS)) | |
| 216 | + return; | |
| 217 | + | |
| 218 | + if ((info->errsts ^ info->errsts2) & X38_ERRSTS_BITS) { | |
| 219 | + edac_mc_handle_ce_no_info(mci, "UE overwrote CE"); | |
| 220 | + info->errsts = info->errsts2; | |
| 221 | + } | |
| 222 | + | |
| 223 | + for (channel = 0; channel < x38_channel_num; channel++) { | |
| 224 | + log = info->eccerrlog[channel]; | |
| 225 | + if (log & X38_ECCERRLOG_UE) { | |
| 226 | + edac_mc_handle_ue(mci, 0, 0, | |
| 227 | + eccerrlog_row(channel, log), "x38 UE"); | |
| 228 | + } else if (log & X38_ECCERRLOG_CE) { | |
| 229 | + edac_mc_handle_ce(mci, 0, 0, | |
| 230 | + eccerrlog_syndrome(log), | |
| 231 | + eccerrlog_row(channel, log), 0, "x38 CE"); | |
| 232 | + } | |
| 233 | + } | |
| 234 | +} | |
| 235 | + | |
| 236 | +static void x38_check(struct mem_ctl_info *mci) | |
| 237 | +{ | |
| 238 | + struct x38_error_info info; | |
| 239 | + | |
| 240 | + debugf1("MC%d: %s()\n", mci->mc_idx, __func__); | |
| 241 | + x38_get_and_clear_error_info(mci, &info); | |
| 242 | + x38_process_error_info(mci, &info); | |
| 243 | +} | |
| 244 | + | |
| 245 | + | |
| 246 | +void __iomem *x38_map_mchbar(struct pci_dev *pdev) | |
| 247 | +{ | |
| 248 | + union { | |
| 249 | + u64 mchbar; | |
| 250 | + struct { | |
| 251 | + u32 mchbar_low; | |
| 252 | + u32 mchbar_high; | |
| 253 | + }; | |
| 254 | + } u; | |
| 255 | + void __iomem *window; | |
| 256 | + | |
| 257 | + pci_read_config_dword(pdev, X38_MCHBAR_LOW, &u.mchbar_low); | |
| 258 | + pci_write_config_dword(pdev, X38_MCHBAR_LOW, u.mchbar_low | 0x1); | |
| 259 | + pci_read_config_dword(pdev, X38_MCHBAR_HIGH, &u.mchbar_high); | |
| 260 | + u.mchbar &= X38_MCHBAR_MASK; | |
| 261 | + | |
| 262 | + if (u.mchbar != (resource_size_t)u.mchbar) { | |
| 263 | + printk(KERN_ERR | |
| 264 | + "x38: mmio space beyond accessible range (0x%llx)\n", | |
| 265 | + (unsigned long long)u.mchbar); | |
| 266 | + return NULL; | |
| 267 | + } | |
| 268 | + | |
| 269 | + window = ioremap_nocache(u.mchbar, X38_MMR_WINDOW_SIZE); | |
| 270 | + if (!window) | |
| 271 | + printk(KERN_ERR "x38: cannot map mmio space at 0x%llx\n", | |
| 272 | + (unsigned long long)u.mchbar); | |
| 273 | + | |
| 274 | + return window; | |
| 275 | +} | |
| 276 | + | |
| 277 | + | |
| 278 | +static void x38_get_drbs(void __iomem *window, | |
| 279 | + u16 drbs[X38_CHANNELS][X38_RANKS_PER_CHANNEL]) | |
| 280 | +{ | |
| 281 | + int i; | |
| 282 | + | |
| 283 | + for (i = 0; i < X38_RANKS_PER_CHANNEL; i++) { | |
| 284 | + drbs[0][i] = readw(window + X38_C0DRB + 2*i) & X38_DRB_MASK; | |
| 285 | + drbs[1][i] = readw(window + X38_C1DRB + 2*i) & X38_DRB_MASK; | |
| 286 | + } | |
| 287 | +} | |
| 288 | + | |
| 289 | +static bool x38_is_stacked(struct pci_dev *pdev, | |
| 290 | + u16 drbs[X38_CHANNELS][X38_RANKS_PER_CHANNEL]) | |
| 291 | +{ | |
| 292 | + u16 tom; | |
| 293 | + | |
| 294 | + pci_read_config_word(pdev, X38_TOM, &tom); | |
| 295 | + tom &= X38_TOM_MASK; | |
| 296 | + | |
| 297 | + return drbs[X38_CHANNELS - 1][X38_RANKS_PER_CHANNEL - 1] == tom; | |
| 298 | +} | |
| 299 | + | |
| 300 | +static unsigned long drb_to_nr_pages( | |
| 301 | + u16 drbs[X38_CHANNELS][X38_RANKS_PER_CHANNEL], | |
| 302 | + bool stacked, int channel, int rank) | |
| 303 | +{ | |
| 304 | + int n; | |
| 305 | + | |
| 306 | + n = drbs[channel][rank]; | |
| 307 | + if (rank > 0) | |
| 308 | + n -= drbs[channel][rank - 1]; | |
| 309 | + if (stacked && (channel == 1) && drbs[channel][rank] == | |
| 310 | + drbs[channel][X38_RANKS_PER_CHANNEL - 1]) { | |
| 311 | + n -= drbs[0][X38_RANKS_PER_CHANNEL - 1]; | |
| 312 | + } | |
| 313 | + | |
| 314 | + n <<= (X38_DRB_SHIFT - PAGE_SHIFT); | |
| 315 | + return n; | |
| 316 | +} | |
| 317 | + | |
| 318 | +static int x38_probe1(struct pci_dev *pdev, int dev_idx) | |
| 319 | +{ | |
| 320 | + int rc; | |
| 321 | + int i; | |
| 322 | + struct mem_ctl_info *mci = NULL; | |
| 323 | + unsigned long last_page; | |
| 324 | + u16 drbs[X38_CHANNELS][X38_RANKS_PER_CHANNEL]; | |
| 325 | + bool stacked; | |
| 326 | + void __iomem *window; | |
| 327 | + | |
| 328 | + debugf0("MC: %s()\n", __func__); | |
| 329 | + | |
| 330 | + window = x38_map_mchbar(pdev); | |
| 331 | + if (!window) | |
| 332 | + return -ENODEV; | |
| 333 | + | |
| 334 | + x38_get_drbs(window, drbs); | |
| 335 | + | |
| 336 | + how_many_channel(pdev); | |
| 337 | + | |
| 338 | + /* FIXME: unconventional pvt_info usage */ | |
| 339 | + mci = edac_mc_alloc(0, X38_RANKS, x38_channel_num, 0); | |
| 340 | + if (!mci) | |
| 341 | + return -ENOMEM; | |
| 342 | + | |
| 343 | + debugf3("MC: %s(): init mci\n", __func__); | |
| 344 | + | |
| 345 | + mci->dev = &pdev->dev; | |
| 346 | + mci->mtype_cap = MEM_FLAG_DDR2; | |
| 347 | + | |
| 348 | + mci->edac_ctl_cap = EDAC_FLAG_SECDED; | |
| 349 | + mci->edac_cap = EDAC_FLAG_SECDED; | |
| 350 | + | |
| 351 | + mci->mod_name = EDAC_MOD_STR; | |
| 352 | + mci->mod_ver = X38_REVISION; | |
| 353 | + mci->ctl_name = x38_devs[dev_idx].ctl_name; | |
| 354 | + mci->dev_name = pci_name(pdev); | |
| 355 | + mci->edac_check = x38_check; | |
| 356 | + mci->ctl_page_to_phys = NULL; | |
| 357 | + mci->pvt_info = window; | |
| 358 | + | |
| 359 | + stacked = x38_is_stacked(pdev, drbs); | |
| 360 | + | |
| 361 | + /* | |
| 362 | + * The dram rank boundary (DRB) reg values are boundary addresses | |
| 363 | + * for each DRAM rank with a granularity of 64MB. DRB regs are | |
| 364 | + * cumulative; the last one will contain the total memory | |
| 365 | + * contained in all ranks. | |
| 366 | + */ | |
| 367 | + last_page = -1UL; | |
| 368 | + for (i = 0; i < mci->nr_csrows; i++) { | |
| 369 | + unsigned long nr_pages; | |
| 370 | + struct csrow_info *csrow = &mci->csrows[i]; | |
| 371 | + | |
| 372 | + nr_pages = drb_to_nr_pages(drbs, stacked, | |
| 373 | + i / X38_RANKS_PER_CHANNEL, | |
| 374 | + i % X38_RANKS_PER_CHANNEL); | |
| 375 | + | |
| 376 | + if (nr_pages == 0) { | |
| 377 | + csrow->mtype = MEM_EMPTY; | |
| 378 | + continue; | |
| 379 | + } | |
| 380 | + | |
| 381 | + csrow->first_page = last_page + 1; | |
| 382 | + last_page += nr_pages; | |
| 383 | + csrow->last_page = last_page; | |
| 384 | + csrow->nr_pages = nr_pages; | |
| 385 | + | |
| 386 | + csrow->grain = nr_pages << PAGE_SHIFT; | |
| 387 | + csrow->mtype = MEM_DDR2; | |
| 388 | + csrow->dtype = DEV_UNKNOWN; | |
| 389 | + csrow->edac_mode = EDAC_UNKNOWN; | |
| 390 | + } | |
| 391 | + | |
| 392 | + x38_clear_error_info(mci); | |
| 393 | + | |
| 394 | + rc = -ENODEV; | |
| 395 | + if (edac_mc_add_mc(mci)) { | |
| 396 | + debugf3("MC: %s(): failed edac_mc_add_mc()\n", __func__); | |
| 397 | + goto fail; | |
| 398 | + } | |
| 399 | + | |
| 400 | + /* get this far and it's successful */ | |
| 401 | + debugf3("MC: %s(): success\n", __func__); | |
| 402 | + return 0; | |
| 403 | + | |
| 404 | +fail: | |
| 405 | + iounmap(window); | |
| 406 | + if (mci) | |
| 407 | + edac_mc_free(mci); | |
| 408 | + | |
| 409 | + return rc; | |
| 410 | +} | |
| 411 | + | |
| 412 | +static int __devinit x38_init_one(struct pci_dev *pdev, | |
| 413 | + const struct pci_device_id *ent) | |
| 414 | +{ | |
| 415 | + int rc; | |
| 416 | + | |
| 417 | + debugf0("MC: %s()\n", __func__); | |
| 418 | + | |
| 419 | + if (pci_enable_device(pdev) < 0) | |
| 420 | + return -EIO; | |
| 421 | + | |
| 422 | + rc = x38_probe1(pdev, ent->driver_data); | |
| 423 | + if (!mci_pdev) | |
| 424 | + mci_pdev = pci_dev_get(pdev); | |
| 425 | + | |
| 426 | + return rc; | |
| 427 | +} | |
| 428 | + | |
| 429 | +static void __devexit x38_remove_one(struct pci_dev *pdev) | |
| 430 | +{ | |
| 431 | + struct mem_ctl_info *mci; | |
| 432 | + | |
| 433 | + debugf0("%s()\n", __func__); | |
| 434 | + | |
| 435 | + mci = edac_mc_del_mc(&pdev->dev); | |
| 436 | + if (!mci) | |
| 437 | + return; | |
| 438 | + | |
| 439 | + iounmap(mci->pvt_info); | |
| 440 | + | |
| 441 | + edac_mc_free(mci); | |
| 442 | +} | |
| 443 | + | |
| 444 | +static const struct pci_device_id x38_pci_tbl[] __devinitdata = { | |
| 445 | + { | |
| 446 | + PCI_VEND_DEV(INTEL, X38_HB), PCI_ANY_ID, PCI_ANY_ID, 0, 0, | |
| 447 | + X38}, | |
| 448 | + { | |
| 449 | + 0, | |
| 450 | + } /* 0 terminated list. */ | |
| 451 | +}; | |
| 452 | + | |
| 453 | +MODULE_DEVICE_TABLE(pci, x38_pci_tbl); | |
| 454 | + | |
| 455 | +static struct pci_driver x38_driver = { | |
| 456 | + .name = EDAC_MOD_STR, | |
| 457 | + .probe = x38_init_one, | |
| 458 | + .remove = __devexit_p(x38_remove_one), | |
| 459 | + .id_table = x38_pci_tbl, | |
| 460 | +}; | |
| 461 | + | |
| 462 | +static int __init x38_init(void) | |
| 463 | +{ | |
| 464 | + int pci_rc; | |
| 465 | + | |
| 466 | + debugf3("MC: %s()\n", __func__); | |
| 467 | + | |
| 468 | + /* Ensure that the OPSTATE is set correctly for POLL or NMI */ | |
| 469 | + opstate_init(); | |
| 470 | + | |
| 471 | + pci_rc = pci_register_driver(&x38_driver); | |
| 472 | + if (pci_rc < 0) | |
| 473 | + goto fail0; | |
| 474 | + | |
| 475 | + if (!mci_pdev) { | |
| 476 | + x38_registered = 0; | |
| 477 | + mci_pdev = pci_get_device(PCI_VENDOR_ID_INTEL, | |
| 478 | + PCI_DEVICE_ID_INTEL_X38_HB, NULL); | |
| 479 | + if (!mci_pdev) { | |
| 480 | + debugf0("x38 pci_get_device fail\n"); | |
| 481 | + pci_rc = -ENODEV; | |
| 482 | + goto fail1; | |
| 483 | + } | |
| 484 | + | |
| 485 | + pci_rc = x38_init_one(mci_pdev, x38_pci_tbl); | |
| 486 | + if (pci_rc < 0) { | |
| 487 | + debugf0("x38 init fail\n"); | |
| 488 | + pci_rc = -ENODEV; | |
| 489 | + goto fail1; | |
| 490 | + } | |
| 491 | + } | |
| 492 | + | |
| 493 | + return 0; | |
| 494 | + | |
| 495 | +fail1: | |
| 496 | + pci_unregister_driver(&x38_driver); | |
| 497 | + | |
| 498 | +fail0: | |
| 499 | + if (mci_pdev) | |
| 500 | + pci_dev_put(mci_pdev); | |
| 501 | + | |
| 502 | + return pci_rc; | |
| 503 | +} | |
| 504 | + | |
| 505 | +static void __exit x38_exit(void) | |
| 506 | +{ | |
| 507 | + debugf3("MC: %s()\n", __func__); | |
| 508 | + | |
| 509 | + pci_unregister_driver(&x38_driver); | |
| 510 | + if (!x38_registered) { | |
| 511 | + x38_remove_one(mci_pdev); | |
| 512 | + pci_dev_put(mci_pdev); | |
| 513 | + } | |
| 514 | +} | |
| 515 | + | |
| 516 | +module_init(x38_init); | |
| 517 | +module_exit(x38_exit); | |
| 518 | + | |
| 519 | +MODULE_LICENSE("GPL"); | |
| 520 | +MODULE_AUTHOR("Cluster Computing, Inc. Hitoshi Mitake"); | |
| 521 | +MODULE_DESCRIPTION("MC support for Intel X38 memory hub controllers"); | |
| 522 | + | |
| 523 | +module_param(edac_op_state, int, 0444); | |
| 524 | +MODULE_PARM_DESC(edac_op_state, "EDAC Error Reporting state: 0=Poll,1=NMI"); | |
| @@ -476,6 +476,7 @@ static int ar_context_add_page(struct ar_context *ctx) · 475 unmodified lines | ||
| 476 | 476 | if (ab == NULL) |
| 477 | 477 | return -ENOMEM; |
| 478 | 478 | |
| 479 | + ab->next = NULL; | |
| 479 | 480 | memset(&ab->descriptor, 0, sizeof(ab->descriptor)); |
| 480 | 481 | ab->descriptor.control = cpu_to_le16(DESCRIPTOR_INPUT_MORE | |
| 481 | 482 | DESCRIPTOR_STATUS | |
| @@ -496,6 +497,21 @@ static int ar_context_add_page(struct ar_context *ctx) · 14 unmodified lines | ||
| 496 | 497 | return 0; |
| 497 | 498 | } |
| 498 | 499 | |
| 500 | +static void ar_context_release(struct ar_context *ctx) | |
| 501 | +{ | |
| 502 | + struct ar_buffer *ab, *ab_next; | |
| 503 | + size_t offset; | |
| 504 | + dma_addr_t ab_bus; | |
| 505 | + | |
| 506 | + for (ab = ctx->current_buffer; ab; ab = ab_next) { | |
| 507 | + ab_next = ab->next; | |
| 508 | + offset = offsetof(struct ar_buffer, data); | |
| 509 | + ab_bus = le32_to_cpu(ab->descriptor.data_address) - offset; | |
| 510 | + dma_free_coherent(ctx->ohci->card.device, PAGE_SIZE, | |
| 511 | + ab, ab_bus); | |
| 512 | + } | |
| 513 | +} | |
| 514 | + | |
| 499 | 515 | #if defined(CONFIG_PPC_PMAC) && defined(CONFIG_PPC32) |
| 500 | 516 | #define cond_le32_to_cpu(v) \ |
| 501 | 517 | (ohci->old_uninorth ? (__force __u32)(v) : le32_to_cpu(v)) |
| @@ -2349,8 +2365,8 @@ pci_probe(struct pci_dev *dev, const struct pci_device_id *ent) · 1847 unmodified lines | ||
| 2349 | 2365 | |
| 2350 | 2366 | ohci = kzalloc(sizeof(*ohci), GFP_KERNEL); |
| 2351 | 2367 | if (ohci == NULL) { |
| 2352 | − fw_error("Could not malloc fw_ohci data.\n"); | |
| 2353 | − return -ENOMEM; | |
| 2368 | + err = -ENOMEM; | |
| 2369 | + goto fail; | |
| 2354 | 2370 | } |
| 2355 | 2371 | |
| 2356 | 2372 | fw_card_initialize(&ohci->card, &ohci_driver, &dev->dev); |
| @@ -2359,7 +2375,7 @@ pci_probe(struct pci_dev *dev, const struct pci_device_id *ent) · 2 unmodified lines | ||
| 2359 | 2375 | |
| 2360 | 2376 | err = pci_enable_device(dev); |
| 2361 | 2377 | if (err) { |
| 2362 | − fw_error("Failed to enable OHCI hardware.\n"); | |
| 2378 | + fw_error("Failed to enable OHCI hardware\n"); | |
| 2363 | 2379 | goto fail_free; |
| 2364 | 2380 | } |
| 2365 | 2381 | |
| @@ -2427,9 +2443,8 @@ pci_probe(struct pci_dev *dev, const struct pci_device_id *ent) · 61 unmodified lines | ||
| 2427 | 2443 | ohci->ir_context_list = kzalloc(size, GFP_KERNEL); |
| 2428 | 2444 | |
| 2429 | 2445 | if (ohci->it_context_list == NULL || ohci->ir_context_list == NULL) { |
| 2430 | − fw_error("Out of memory for it/ir contexts.\n"); | |
| 2431 | 2446 | err = -ENOMEM; |
| 2432 | − goto fail_registers; | |
| 2447 | + goto fail_contexts; | |
| 2433 | 2448 | } |
| 2434 | 2449 | |
| 2435 | 2450 | /* self-id dma buffer allocation */ |
| @@ -2438,9 +2453,8 @@ pci_probe(struct pci_dev *dev, const struct pci_device_id *ent) · 2 unmodified lines | ||
| 2438 | 2453 | &ohci->self_id_bus, |
| 2439 | 2454 | GFP_KERNEL); |
| 2440 | 2455 | if (ohci->self_id_cpu == NULL) { |
| 2441 | − fw_error("Out of memory for self ID buffer.\n"); | |
| 2442 | 2456 | err = -ENOMEM; |
| 2443 | − goto fail_registers; | |
| 2457 | + goto fail_contexts; | |
| 2444 | 2458 | } |
| 2445 | 2459 | |
| 2446 | 2460 | bus_options = reg_read(ohci, OHCI1394_BusOptions); |
| @@ -2460,9 +2474,13 @@ pci_probe(struct pci_dev *dev, const struct pci_device_id *ent) · 13 unmodified lines | ||
| 2460 | 2474 | fail_self_id: |
| 2461 | 2475 | dma_free_coherent(ohci->card.device, SELF_ID_BUF_SIZE, |
| 2462 | 2476 | ohci->self_id_cpu, ohci->self_id_bus); |
| 2463 | − fail_registers: | |
| 2464 | − kfree(ohci->it_context_list); | |
| 2477 | + fail_contexts: | |
| 2465 | 2478 | kfree(ohci->ir_context_list); |
| 2479 | + kfree(ohci->it_context_list); | |
| 2480 | + context_release(&ohci->at_response_ctx); | |
| 2481 | + context_release(&ohci->at_request_ctx); | |
| 2482 | + ar_context_release(&ohci->ar_response_ctx); | |
| 2483 | + ar_context_release(&ohci->ar_request_ctx); | |
| 2466 | 2484 | pci_iounmap(dev, ohci->registers); |
| 2467 | 2485 | fail_iomem: |
| 2468 | 2486 | pci_release_region(dev, 0); |
| @@ -2471,6 +2489,9 @@ pci_probe(struct pci_dev *dev, const struct pci_device_id *ent) · 2 unmodified lines | ||
| 2471 | 2489 | fail_free: |
| 2472 | 2490 | kfree(&ohci->card); |
| 2473 | 2491 | ohci_pmac_off(dev); |
| 2492 | + fail: | |
| 2493 | + if (err == -ENOMEM) | |
| 2494 | + fw_error("Out of memory\n"); | |
| 2474 | 2495 | |
| 2475 | 2496 | return err; |
| 2476 | 2497 | } |
| @@ -2491,8 +2512,19 @@ static void pci_remove(struct pci_dev *dev) · 14 unmodified lines | ||
| 2491 | 2512 | |
| 2492 | 2513 | software_reset(ohci); |
| 2493 | 2514 | free_irq(dev->irq, ohci); |
| 2515 | + | |
| 2516 | + if (ohci->next_config_rom && ohci->next_config_rom != ohci->config_rom) | |
| 2517 | + dma_free_coherent(ohci->card.device, CONFIG_ROM_SIZE, | |
| 2518 | + ohci->next_config_rom, ohci->next_config_rom_bus); | |
| 2519 | + if (ohci->config_rom) | |
| 2520 | + dma_free_coherent(ohci->card.device, CONFIG_ROM_SIZE, | |
| 2521 | + ohci->config_rom, ohci->config_rom_bus); | |
| 2494 | 2522 | dma_free_coherent(ohci->card.device, SELF_ID_BUF_SIZE, |
| 2495 | 2523 | ohci->self_id_cpu, ohci->self_id_bus); |
| 2524 | + ar_context_release(&ohci->ar_request_ctx); | |
| 2525 | + ar_context_release(&ohci->ar_response_ctx); | |
| 2526 | + context_release(&ohci->at_request_ctx); | |
| 2527 | + context_release(&ohci->at_response_ctx); | |
| 2496 | 2528 | kfree(ohci->it_context_list); |
| 2497 | 2529 | kfree(ohci->ir_context_list); |
| 2498 | 2530 | pci_iounmap(dev, ohci->registers); |
| @@ -173,6 +173,9 @@ struct sbp2_target { · 172 unmodified lines | ||
| 173 | 173 | int blocked; /* ditto */ |
| 174 | 174 | }; |
| 175 | 175 | |
| 176 | +/* Impossible login_id, to detect logout attempt before successful login */ | |
| 177 | +#define INVALID_LOGIN_ID 0x10000 | |
| 178 | + | |
| 176 | 179 | /* |
| 177 | 180 | * Per section 7.4.8 of the SBP-2 spec, a mgt_ORB_timeout value can be |
| 178 | 181 | * provided in the config rom. Most devices do provide a value, which |
| @@ -788,9 +791,20 @@ static void sbp2_release_target(struct kref *kref) · 609 unmodified lines | ||
| 788 | 791 | scsi_remove_device(sdev); |
| 789 | 792 | scsi_device_put(sdev); |
| 790 | 793 | } |
| 791 | − sbp2_send_management_orb(lu, tgt->node_id, lu->generation, | |
| 792 | − SBP2_LOGOUT_REQUEST, lu->login_id, NULL); | |
| 793 | − | |
| 794 | + if (lu->login_id != INVALID_LOGIN_ID) { | |
| 795 | + int generation, node_id; | |
| 796 | + /* | |
| 797 | + * tgt->node_id may be obsolete here if we failed | |
| 798 | + * during initial login or after a bus reset where | |
| 799 | + * the topology changed. | |
| 800 | + */ | |
| 801 | + generation = device->generation; | |
| 802 | + smp_rmb(); /* node_id vs. generation */ | |
| 803 | + node_id = device->node_id; | |
| 804 | + sbp2_send_management_orb(lu, node_id, generation, | |
| 805 | + SBP2_LOGOUT_REQUEST, | |
| 806 | + lu->login_id, NULL); | |
| 807 | + } | |
| 794 | 808 | fw_core_remove_address_handler(&lu->address_handler); |
| 795 | 809 | list_del(&lu->link); |
| 796 | 810 | kfree(lu); |
| @@ -805,19 +819,20 @@ static void sbp2_release_target(struct kref *kref) · 8 unmodified lines | ||
| 805 | 819 | |
| 806 | 820 | static struct workqueue_struct *sbp2_wq; |
| 807 | 821 | |
| 822 | +static void sbp2_target_put(struct sbp2_target *tgt) | |
| 823 | +{ | |
| 824 | + kref_put(&tgt->kref, sbp2_release_target); | |
| 825 | +} | |
| 826 | + | |
| 808 | 827 | /* |
| 809 | 828 | * Always get the target's kref when scheduling work on one its units. |
| 810 | 829 | * Each workqueue job is responsible to call sbp2_target_put() upon return. |
| 811 | 830 | */ |
| 812 | 831 | static void sbp2_queue_work(struct sbp2_logical_unit *lu, unsigned long delay) |
| 813 | 832 | { |
| 814 | − if (queue_delayed_work(sbp2_wq, &lu->work, delay)) | |
| 815 | − kref_get(&lu->tgt->kref); | |
| 816 | −} | |
| 817 | − | |
| 818 | −static void sbp2_target_put(struct sbp2_target *tgt) | |
| 819 | −{ | |
| 820 | − kref_put(&tgt->kref, sbp2_release_target); | |
| 833 | + kref_get(&lu->tgt->kref); | |
| 834 | + if (!queue_delayed_work(sbp2_wq, &lu->work, delay)) | |
| 835 | + sbp2_target_put(lu->tgt); | |
| 821 | 836 | } |
| 822 | 837 | |
| 823 | 838 | /* |
| @@ -978,6 +993,7 @@ static int sbp2_add_logical_unit(struct sbp2_target *tgt, int lun_entry) · 154 unmodified lines | ||
| 978 | 993 | |
| 979 | 994 | lu->tgt = tgt; |
| 980 | 995 | lu->lun = lun_entry & 0xffff; |
| 996 | + lu->login_id = INVALID_LOGIN_ID; | |
| 981 | 997 | lu->retries = 0; |
| 982 | 998 | lu->has_sdev = false; |
| 983 | 999 | lu->blocked = false; |
| @@ -1147,7 +1163,7 @@ static int sbp2_probe(struct device *dev) · 163 unmodified lines | ||
| 1147 | 1163 | |
| 1148 | 1164 | /* Do the login in a workqueue so we can easily reschedule retries. */ |
| 1149 | 1165 | list_for_each_entry(lu, &tgt->lu_list, link) |
| 1150 | − sbp2_queue_work(lu, 0); | |
| 1166 | + sbp2_queue_work(lu, DIV_ROUND_UP(HZ, 5)); | |
| 1151 | 1167 | return 0; |
| 1152 | 1168 | |
| 1153 | 1169 | fail_tgt_put: |
| @@ -413,7 +413,7 @@ static void · 412 unmodified lines | ||
| 413 | 413 | update_tree(struct fw_card *card, struct fw_node *root) |
| 414 | 414 | { |
| 415 | 415 | struct list_head list0, list1; |
| 416 | − struct fw_node *node0, *node1; | |
| 416 | + struct fw_node *node0, *node1, *next1; | |
| 417 | 417 | int i, event; |
| 418 | 418 | |
| 419 | 419 | INIT_LIST_HEAD(&list0); |
| @@ -485,7 +485,9 @@ update_tree(struct fw_card *card, struct fw_node *root) · 65 unmodified lines | ||
| 485 | 485 | } |
| 486 | 486 | |
| 487 | 487 | node0 = fw_node(node0->link.next); |
| 488 | − node1 = fw_node(node1->link.next); | |
| 488 | + next1 = fw_node(node1->link.next); | |
| 489 | + fw_node_put(node1); | |
| 490 | + node1 = next1; | |
| 489 | 491 | } |
| 490 | 492 | } |
| 491 | 493 | |
| @@ -248,7 +248,7 @@ struct fw_card { · 247 unmodified lines | ||
| 248 | 248 | struct fw_node *local_node; |
| 249 | 249 | struct fw_node *root_node; |
| 250 | 250 | struct fw_node *irm_node; |
| 251 | − int color; | |
| 251 | + u8 color; /* must be u8 to match the definition in struct fw_node */ | |
| 252 | 252 | int gap_count; |
| 253 | 253 | bool beta_repeaters_present; |
| 254 | 254 | |
| @@ -1263,6 +1263,7 @@ static const struct hid_device_id hid_blacklist[] = { · 1262 unmodified lines | ||
| 1263 | 1263 | { HID_USB_DEVICE(USB_VENDOR_ID_DELL, USB_DEVICE_ID_DELL_W7658) }, |
| 1264 | 1264 | { HID_USB_DEVICE(USB_VENDOR_ID_DELL, USB_DEVICE_ID_DELL_SK8115) }, |
| 1265 | 1265 | { HID_USB_DEVICE(USB_VENDOR_ID_EZKEY, USB_DEVICE_ID_BTC_8193) }, |
| 1266 | + { HID_USB_DEVICE(USB_VENDOR_ID_GENERIC_13BA, USB_DEVICE_ID_GENERIC_13BA_KBD_MOUSE) }, | |
| 1266 | 1267 | { HID_USB_DEVICE(USB_VENDOR_ID_GYRATION, USB_DEVICE_ID_GYRATION_REMOTE) }, |
| 1267 | 1268 | { HID_USB_DEVICE(USB_VENDOR_ID_GYRATION, USB_DEVICE_ID_GYRATION_REMOTE_2) }, |
| 1268 | 1269 | { HID_USB_DEVICE(USB_VENDOR_ID_LABTEC, USB_DEVICE_ID_LABTEC_WIRELESS_KEYBOARD) }, |
| @@ -48,6 +48,7 @@ err_free: · 47 unmodified lines | ||
| 48 | 48 | static const struct hid_device_id dell_devices[] = { |
| 49 | 49 | { HID_USB_DEVICE(USB_VENDOR_ID_DELL, USB_DEVICE_ID_DELL_W7658) }, |
| 50 | 50 | { HID_USB_DEVICE(USB_VENDOR_ID_DELL, USB_DEVICE_ID_DELL_SK8115) }, |
| 51 | + { HID_USB_DEVICE(USB_VENDOR_ID_GENERIC_13BA, USB_DEVICE_ID_GENERIC_13BA_KBD_MOUSE) }, | |
| 51 | 52 | { } |
| 52 | 53 | }; |
| 53 | 54 | MODULE_DEVICE_TABLE(hid, dell_devices); |
| @@ -163,6 +163,9 @@ · 162 unmodified lines | ||
| 163 | 163 | |
| 164 | 164 | #define USB_VENDOR_ID_GENERAL_TOUCH 0x0dfc |
| 165 | 165 | |
| 166 | +#define USB_VENDOR_ID_GENERIC_13BA 0x13ba | |
| 167 | +#define USB_DEVICE_ID_GENERIC_13BA_KBD_MOUSE 0x0017 | |
| 168 | + | |
| 166 | 169 | #define USB_VENDOR_ID_GLAB 0x06c2 |
| 167 | 170 | #define USB_DEVICE_ID_4_PHIDGETSERVO_30 0x0038 |
| 168 | 171 | #define USB_DEVICE_ID_1_PHIDGETSERVO_30 0x0039 |
| @@ -20,6 +20,7 @@ · 19 unmodified lines | ||
| 20 | 20 | #include <linux/kernel.h> |
| 21 | 21 | #include <linux/list.h> |
| 22 | 22 | #include <linux/mm.h> |
| 23 | +#include <linux/mutex.h> | |
| 23 | 24 | #include <linux/smp_lock.h> |
| 24 | 25 | #include <linux/spinlock.h> |
| 25 | 26 | #include <asm/unaligned.h> |
| @@ -776,21 +777,10 @@ static int usbhid_start(struct hid_device *hid) · 750 unmodified lines | ||
| 776 | 777 | struct usb_interface *intf = to_usb_interface(hid->dev.parent); |
| 777 | 778 | struct usb_host_interface *interface = intf->cur_altsetting; |
| 778 | 779 | struct usb_device *dev = interface_to_usbdev(intf); |
| 779 | − struct usbhid_device *usbhid; | |
| 780 | + struct usbhid_device *usbhid = hid->driver_data; | |
| 780 | 781 | unsigned int n, insize = 0; |
| 781 | 782 | int ret; |
| 782 | 783 | |
| 783 | − WARN_ON(hid->driver_data); | |
| 784 | − | |
| 785 | − usbhid = kzalloc(sizeof(struct usbhid_device), GFP_KERNEL); | |
| 786 | − if (usbhid == NULL) { | |
| 787 | − ret = -ENOMEM; | |
| 788 | − goto err; | |
| 789 | − } | |
| 790 | − | |
| 791 | − hid->driver_data = usbhid; | |
| 792 | − usbhid->hid = hid; | |
| 793 | − | |
| 794 | 784 | usbhid->bufsize = HID_MIN_BUFFER_SIZE; |
| 795 | 785 | hid_find_max_report(hid, HID_INPUT_REPORT, &usbhid->bufsize); |
| 796 | 786 | hid_find_max_report(hid, HID_OUTPUT_REPORT, &usbhid->bufsize); |
| @@ -804,6 +794,7 @@ static int usbhid_start(struct hid_device *hid) · 7 unmodified lines | ||
| 804 | 794 | if (insize > HID_MAX_BUFFER_SIZE) |
| 805 | 795 | insize = HID_MAX_BUFFER_SIZE; |
| 806 | 796 | |
| 797 | + mutex_lock(&usbhid->setup); | |
| 807 | 798 | if (hid_alloc_buffers(dev, hid)) { |
| 808 | 799 | ret = -ENOMEM; |
| 809 | 800 | goto fail; |
| @@ -888,6 +879,9 @@ static int usbhid_start(struct hid_device *hid) · 78 unmodified lines | ||
| 888 | 879 | usbhid_init_reports(hid); |
| 889 | 880 | hid_dump_device(hid); |
| 890 | 881 | |
| 882 | + set_bit(HID_STARTED, &usbhid->iofl); | |
| 883 | + mutex_unlock(&usbhid->setup); | |
| 884 | + | |
| 891 | 885 | return 0; |
| 892 | 886 | |
| 893 | 887 | fail: |
| @@ -895,8 +889,7 @@ fail: · 1 unmodified line | ||
| 895 | 889 | usb_free_urb(usbhid->urbout); |
| 896 | 890 | usb_free_urb(usbhid->urbctrl); |
| 897 | 891 | hid_free_buffers(dev, hid); |
| 898 | − kfree(usbhid); | |
| 899 | −err: | |
| 892 | + mutex_unlock(&usbhid->setup); | |
| 900 | 893 | return ret; |
| 901 | 894 | } |
| 902 | 895 | |
| @@ -907,6 +900,8 @@ static void usbhid_stop(struct hid_device *hid) · 4 unmodified lines | ||
| 907 | 900 | if (WARN_ON(!usbhid)) |
| 908 | 901 | return; |
| 909 | 902 | |
| 903 | + mutex_lock(&usbhid->setup); | |
| 904 | + clear_bit(HID_STARTED, &usbhid->iofl); | |
| 910 | 905 | spin_lock_irq(&usbhid->inlock); /* Sync with error handler */ |
| 911 | 906 | set_bit(HID_DISCONNECTED, &usbhid->iofl); |
| 912 | 907 | spin_unlock_irq(&usbhid->inlock); |
| @@ -931,8 +926,7 @@ static void usbhid_stop(struct hid_device *hid) · 18 unmodified lines | ||
| 931 | 926 | usb_free_urb(usbhid->urbout); |
| 932 | 927 | |
| 933 | 928 | hid_free_buffers(hid_to_usb_dev(hid), hid); |
| 934 | − kfree(usbhid); | |
| 935 | − hid->driver_data = NULL; | |
| 929 | + mutex_unlock(&usbhid->setup); | |
| 936 | 930 | } |
| 937 | 931 | |
| 938 | 932 | static struct hid_ll_driver usb_hid_driver = { |
| @@ -947,6 +941,7 @@ static struct hid_ll_driver usb_hid_driver = { · 8 unmodified lines | ||
| 947 | 941 | static int hid_probe(struct usb_interface *intf, const struct usb_device_id *id) |
| 948 | 942 | { |
| 949 | 943 | struct usb_device *dev = interface_to_usbdev(intf); |
| 944 | + struct usbhid_device *usbhid; | |
| 950 | 945 | struct hid_device *hid; |
| 951 | 946 | size_t len; |
| 952 | 947 | int ret; |
| @@ -1000,14 +995,26 @@ static int hid_probe(struct usb_interface *intf, const struct usb_device_id *id) · 47 unmodified lines | ||
| 1000 | 995 | if (usb_string(dev, dev->descriptor.iSerialNumber, hid->uniq, 64) <= 0) |
| 1001 | 996 | hid->uniq[0] = 0; |
| 1002 | 997 | |
| 998 | + usbhid = kzalloc(sizeof(*usbhid), GFP_KERNEL); | |
| 999 | + if (usbhid == NULL) { | |
| 1000 | + ret = -ENOMEM; | |
| 1001 | + goto err; | |
| 1002 | + } | |
| 1003 | + | |
| 1004 | + hid->driver_data = usbhid; | |
| 1005 | + usbhid->hid = hid; | |
| 1006 | + mutex_init(&usbhid->setup); /* needed on suspend/resume */ | |
| 1007 | + | |
| 1003 | 1008 | ret = hid_add_device(hid); |
| 1004 | 1009 | if (ret) { |
| 1005 | 1010 | if (ret != -ENODEV) |
| 1006 | 1011 | dev_err(&intf->dev, "can't add hid device: %d\n", ret); |
| 1007 | − goto err; | |
| 1012 | + goto err_free; | |
| 1008 | 1013 | } |
| 1009 | 1014 | |
| 1010 | 1015 | return 0; |
| 1016 | +err_free: | |
| 1017 | + kfree(usbhid); | |
| 1011 | 1018 | err: |
| 1012 | 1019 | hid_destroy_device(hid); |
| 1013 | 1020 | return ret; |
| @@ -1016,11 +1023,14 @@ err: · 2 unmodified lines | ||
| 1016 | 1023 | static void hid_disconnect(struct usb_interface *intf) |
| 1017 | 1024 | { |
| 1018 | 1025 | struct hid_device *hid = usb_get_intfdata(intf); |
| 1026 | + struct usbhid_device *usbhid; | |
| 1019 | 1027 | |
| 1020 | 1028 | if (WARN_ON(!hid)) |
| 1021 | 1029 | return; |
| 1022 | 1030 | |
| 1031 | + usbhid = hid->driver_data; | |
| 1023 | 1032 | hid_destroy_device(hid); |
| 1033 | + kfree(usbhid); | |
| 1024 | 1034 | } |
| 1025 | 1035 | |
| 1026 | 1036 | static int hid_suspend(struct usb_interface *intf, pm_message_t message) |
| @@ -1028,11 +1038,18 @@ static int hid_suspend(struct usb_interface *intf, pm_message_t message) · 1 unmodified line | ||
| 1028 | 1038 | struct hid_device *hid = usb_get_intfdata (intf); |
| 1029 | 1039 | struct usbhid_device *usbhid = hid->driver_data; |
| 1030 | 1040 | |
| 1041 | + mutex_lock(&usbhid->setup); | |
| 1042 | + if (!test_bit(HID_STARTED, &usbhid->iofl)) { | |
| 1043 | + mutex_unlock(&usbhid->setup); | |
| 1044 | + return 0; | |
| 1045 | + } | |
| 1046 | + | |
| 1031 | 1047 | spin_lock_irq(&usbhid->inlock); /* Sync with error handler */ |
| 1032 | 1048 | set_bit(HID_SUSPENDED, &usbhid->iofl); |
| 1033 | 1049 | spin_unlock_irq(&usbhid->inlock); |
| 1034 | − del_timer(&usbhid->io_retry); | |
| 1050 | + del_timer_sync(&usbhid->io_retry); | |
| 1035 | 1051 | usb_kill_urb(usbhid->urbin); |
| 1052 | + mutex_unlock(&usbhid->setup); | |
| 1036 | 1053 | dev_dbg(&intf->dev, "suspend\n"); |
| 1037 | 1054 | return 0; |
| 1038 | 1055 | } |
| @@ -1043,9 +1060,16 @@ static int hid_resume(struct usb_interface *intf) · 4 unmodified lines | ||
| 1043 | 1060 | struct usbhid_device *usbhid = hid->driver_data; |
| 1044 | 1061 | int status; |
| 1045 | 1062 | |
| 1063 | + mutex_lock(&usbhid->setup); | |
| 1064 | + if (!test_bit(HID_STARTED, &usbhid->iofl)) { | |
| 1065 | + mutex_unlock(&usbhid->setup); | |
| 1066 | + return 0; | |
| 1067 | + } | |
| 1068 | + | |
| 1046 | 1069 | clear_bit(HID_SUSPENDED, &usbhid->iofl); |
| 1047 | 1070 | usbhid->retry_delay = 0; |
| 1048 | 1071 | status = hid_start_in(hid); |
| 1072 | + mutex_unlock(&usbhid->setup); | |
| 1049 | 1073 | dev_dbg(&intf->dev, "resume status %d\n", status); |
| 1050 | 1074 | return status; |
| 1051 | 1075 | } |
| @@ -27,6 +27,7 @@ · 26 unmodified lines | ||
| 27 | 27 | #include <linux/types.h> |
| 28 | 28 | #include <linux/slab.h> |
| 29 | 29 | #include <linux/list.h> |
| 30 | +#include <linux/mutex.h> | |
| 30 | 31 | #include <linux/timer.h> |
| 31 | 32 | #include <linux/wait.h> |
| 32 | 33 | #include <linux/workqueue.h> |
| @@ -73,6 +74,7 @@ struct usbhid_device { · 40 unmodified lines | ||
| 73 | 74 | dma_addr_t outbuf_dma; /* Output buffer dma */ |
| 74 | 75 | spinlock_t outlock; /* Output fifo spinlock */ |
| 75 | 76 | |
| 77 | + struct mutex setup; | |
| 76 | 78 | unsigned long iofl; /* I/O flags (CTRL_RUNNING, OUT_RUNNING) */ |
| 77 | 79 | struct timer_list io_retry; /* Retry timer */ |
| 78 | 80 | unsigned long stop_retry; /* Time to give up, in jiffies */ |
| @@ -507,7 +507,7 @@ static int s3c24xx_i2c_doxfer(struct s3c24xx_i2c *i2c, struct i2c_msg *msgs, int · 506 unmodified lines | ||
| 507 | 507 | unsigned long timeout; |
| 508 | 508 | int ret; |
| 509 | 509 | |
| 510 | − if (!readl(i2c->regs + S3C2410_IICCON) & S3C2410_IICCON_IRQEN) | |
| 510 | + if (!(readl(i2c->regs + S3C2410_IICCON) & S3C2410_IICCON_IRQEN)) | |
| 511 | 511 | return -EIO; |
| 512 | 512 | |
| 513 | 513 | ret = s3c24xx_i2c_set_master(i2c); |
| @@ -81,6 +81,7 @@ static struct i2c_algo_bit_data scx200_i2c_data = { · 80 unmodified lines | ||
| 81 | 81 | |
| 82 | 82 | static struct i2c_adapter scx200_i2c_ops = { |
| 83 | 83 | .owner = THIS_MODULE, |
| 84 | + .class = I2C_CLASS_HWMON | I2C_CLASS_SPD, | |
| 84 | 85 | .id = I2C_HW_B_SCX200, |
| 85 | 86 | .algo_data = &scx200_i2c_data, |
| 86 | 87 | .name = "NatSemi SCx200 I2C", |
| @@ -174,5 +174,6 @@ static void __exit sgi_buttons_exit(void) · 173 unmodified lines | ||
| 174 | 174 | platform_driver_unregister(&sgi_buttons_driver); |
| 175 | 175 | } |
| 176 | 176 | |
| 177 | +MODULE_LICENSE("GPL"); | |
| 177 | 178 | module_init(sgi_buttons_init); |
| 178 | 179 | module_exit(sgi_buttons_exit); |
| @@ -17,6 +17,7 @@ · 16 unmodified lines | ||
| 17 | 17 | #include <linux/init.h> |
| 18 | 18 | #include <linux/platform_device.h> |
| 19 | 19 | #include <linux/leds.h> |
| 20 | +#include <linux/workqueue.h> | |
| 20 | 21 | #include <linux/mfd/da903x.h> |
| 21 | 22 | |
| 22 | 23 | #define DA9030_LED1_CONTROL 0x20 |
| @@ -656,9 +656,10 @@ static void do_failures(struct mirror_set *ms, struct bio_list *failures) · 655 unmodified lines | ||
| 656 | 656 | return; |
| 657 | 657 | |
| 658 | 658 | if (!ms->log_failure) { |
| 659 | − while ((bio = bio_list_pop(failures))) | |
| 659 | + while ((bio = bio_list_pop(failures))) { | |
| 660 | 660 | ms->in_sync = 0; |
| 661 | 661 | dm_rh_mark_nosync(ms->rh, bio, bio->bi_size, 0); |
| 662 | + } | |
| 662 | 663 | return; |
| 663 | 664 | } |
| 664 | 665 | |
| @@ -229,19 +229,21 @@ static void __insert_origin(struct origin *o) · 228 unmodified lines | ||
| 229 | 229 | */ |
| 230 | 230 | static int register_snapshot(struct dm_snapshot *snap) |
| 231 | 231 | { |
| 232 | − struct origin *o; | |
| 232 | + struct origin *o, *new_o; | |
| 233 | 233 | struct block_device *bdev = snap->origin->bdev; |
| 234 | 234 | |
| 235 | + new_o = kmalloc(sizeof(*new_o), GFP_KERNEL); | |
| 236 | + if (!new_o) | |
| 237 | + return -ENOMEM; | |
| 238 | + | |
| 235 | 239 | down_write(&_origins_lock); |
| 236 | 240 | o = __lookup_origin(bdev); |
| 237 | 241 | |
| 238 | − if (!o) { | |
| 242 | + if (o) | |
| 243 | + kfree(new_o); | |
| 244 | + else { | |
| 239 | 245 | /* New origin */ |
| 240 | − o = kmalloc(sizeof(*o), GFP_KERNEL); | |
| 241 | − if (!o) { | |
| 242 | − up_write(&_origins_lock); | |
| 243 | − return -ENOMEM; | |
| 244 | − } | |
| 246 | + o = new_o; | |
| 245 | 247 | |
| 246 | 248 | /* Initialise the struct */ |
| 247 | 249 | INIT_LIST_HEAD(&o->snapshots); |
| @@ -368,6 +370,7 @@ static struct dm_snap_pending_exception *alloc_pending_exception(struct dm_snaps · 120 unmodified lines | ||
| 368 | 370 | struct dm_snap_pending_exception *pe = mempool_alloc(s->pending_pool, |
| 369 | 371 | GFP_NOIO); |
| 370 | 372 | |
| 373 | + atomic_inc(&s->pending_exceptions_count); | |
| 371 | 374 | pe->snap = s; |
| 372 | 375 | |
| 373 | 376 | return pe; |
| @@ -375,7 +378,11 @@ static struct dm_snap_pending_exception *alloc_pending_exception(struct dm_snaps · 1 unmodified line | ||
| 375 | 378 | |
| 376 | 379 | static void free_pending_exception(struct dm_snap_pending_exception *pe) |
| 377 | 380 | { |
| 378 | − mempool_free(pe, pe->snap->pending_pool); | |
| 381 | + struct dm_snapshot *s = pe->snap; | |
| 382 | + | |
| 383 | + mempool_free(pe, s->pending_pool); | |
| 384 | + smp_mb__before_atomic_dec(); | |
| 385 | + atomic_dec(&s->pending_exceptions_count); | |
| 379 | 386 | } |
| 380 | 387 | |
| 381 | 388 | static void insert_completed_exception(struct dm_snapshot *s, |
| @@ -600,6 +607,7 @@ static int snapshot_ctr(struct dm_target *ti, unsigned int argc, char **argv) · 218 unmodified lines | ||
| 600 | 607 | |
| 601 | 608 | s->valid = 1; |
| 602 | 609 | s->active = 0; |
| 610 | + atomic_set(&s->pending_exceptions_count, 0); | |
| 603 | 611 | init_rwsem(&s->lock); |
| 604 | 612 | spin_lock_init(&s->pe_lock); |
| 605 | 613 | s->ti = ti; |
| @@ -726,6 +734,14 @@ static void snapshot_dtr(struct dm_target *ti) · 120 unmodified lines | ||
| 726 | 734 | /* After this returns there can be no new kcopyd jobs. */ |
| 727 | 735 | unregister_snapshot(s); |
| 728 | 736 | |
| 737 | + while (atomic_read(&s->pending_exceptions_count)) | |
| 738 | + yield(); | |
| 739 | + /* | |
| 740 | + * Ensure instructions in mempool_destroy aren't reordered | |
| 741 | + * before atomic_read. | |
| 742 | + */ | |
| 743 | + smp_mb(); | |
| 744 | + | |
| 729 | 745 | #ifdef CONFIG_DM_DEBUG |
| 730 | 746 | for (i = 0; i < DM_TRACKED_CHUNK_HASH_SIZE; i++) |
| 731 | 747 | BUG_ON(!hlist_empty(&s->tracked_chunk_hash[i])); |
| @@ -160,6 +160,8 @@ struct dm_snapshot { · 159 unmodified lines | ||
| 160 | 160 | |
| 161 | 161 | mempool_t *pending_pool; |
| 162 | 162 | |
| 163 | + atomic_t pending_exceptions_count; | |
| 164 | + | |
| 163 | 165 | struct exception_table pending; |
| 164 | 166 | struct exception_table complete; |
| 165 | 167 | |
| @@ -567,8 +567,8 @@ static void i2o_block_biosparam(unsigned long capacity, unsigned short *cyls, · 566 unmodified lines | ||
| 567 | 567 | |
| 568 | 568 | /** |
| 569 | 569 | * i2o_block_open - Open the block device |
| 570 | − * @inode: inode for block device being opened | |
| 571 | − * @file: file to open | |
| 570 | + * @bdev: block device being opened | |
| 571 | + * @mode: file open mode | |
| 572 | 572 | * |
| 573 | 573 | * Power up the device, mount and lock the media. This function is called, |
| 574 | 574 | * if the block device is opened for access. |
| @@ -596,8 +596,8 @@ static int i2o_block_open(struct block_device *bdev, fmode_t mode) · 21 unmodified lines | ||
| 596 | 596 | |
| 597 | 597 | /** |
| 598 | 598 | * i2o_block_release - Release the I2O block device |
| 599 | − * @inode: inode for block device being released | |
| 600 | − * @file: file to close | |
| 599 | + * @disk: gendisk device being released | |
| 600 | + * @mode: file open mode | |
| 601 | 601 | * |
| 602 | 602 | * Unlock and unmount the media, and power down the device. Gets called if |
| 603 | 603 | * the block device is closed. |
| @@ -643,8 +643,8 @@ static int i2o_block_getgeo(struct block_device *bdev, struct hd_geometry *geo) · 39 unmodified lines | ||
| 643 | 643 | |
| 644 | 644 | /** |
| 645 | 645 | * i2o_block_ioctl - Issue device specific ioctl calls. |
| 646 | − * @inode: inode for block device ioctl | |
| 647 | − * @file: file for ioctl | |
| 646 | + * @bdev: block device being opened | |
| 647 | + * @mode: file open mode | |
| 648 | 648 | * @cmd: ioctl command |
| 649 | 649 | * @arg: arg |
| 650 | 650 | * |
| @@ -113,7 +113,6 @@ static int hdpu_nexus_probe(struct platform_device *pdev) · 112 unmodified lines | ||
| 113 | 113 | if (!hdpu_chassis_id) |
| 114 | 114 | printk(KERN_WARNING "sky_nexus: " |
| 115 | 115 | "Unable to create proc dir entry: sky_chassis_id\n"); |
| 116 | − } | |
| 117 | 116 | |
| 118 | 117 | return 0; |
| 119 | 118 | } |
| @@ -5,14 +5,14 @@ · 4 unmodified lines | ||
| 5 | 5 | obj-$(CONFIG_SGI_XP) += xp.o |
| 6 | 6 | xp-y := xp_main.o |
| 7 | 7 | xp-$(CONFIG_IA64_SGI_SN2) += xp_sn2.o xp_nofault.o |
| 8 | −xp-$(CONFIG_IA64_GENERIC) += xp_sn2.o xp_nofault.o xp_uv.o | |
| 8 | +xp-$(CONFIG_IA64_GENERIC) += xp_sn2.o xp_nofault.o | |
| 9 | 9 | xp-$(CONFIG_IA64_SGI_UV) += xp_uv.o |
| 10 | 10 | xp-$(CONFIG_X86_64) += xp_uv.o |
| 11 | 11 | |
| 12 | 12 | obj-$(CONFIG_SGI_XP) += xpc.o |
| 13 | 13 | xpc-y := xpc_main.o xpc_channel.o xpc_partition.o |
| 14 | 14 | xpc-$(CONFIG_IA64_SGI_SN2) += xpc_sn2.o |
| 15 | −xpc-$(CONFIG_IA64_GENERIC) += xpc_sn2.o xpc_uv.o | |
| 15 | +xpc-$(CONFIG_IA64_GENERIC) += xpc_sn2.o | |
| 16 | 16 | xpc-$(CONFIG_IA64_SGI_UV) += xpc_uv.o |
| 17 | 17 | xpc-$(CONFIG_X86_64) += xpc_uv.o |
| 18 | 18 | |
| @@ -19,7 +19,11 @@ · 18 unmodified lines | ||
| 19 | 19 | #include <asm/system.h> |
| 20 | 20 | #include <asm/sn/arch.h> /* defines is_shub1() and is_shub2() */ |
| 21 | 21 | #define is_shub() ia64_platform_is("sn2") |
| 22 | +#ifdef CONFIG_IA64_SGI_UV | |
| 22 | 23 | #define is_uv() ia64_platform_is("uv") |
| 24 | +#else | |
| 25 | +#define is_uv() 0 | |
| 26 | +#endif | |
| 23 | 27 | #endif |
| 24 | 28 | #ifdef CONFIG_X86_64 |
| 25 | 29 | #include <asm/genapic.h> |
| @@ -1104,7 +1104,7 @@ xpc_do_exit(enum xp_retval reason) · 1103 unmodified lines | ||
| 1104 | 1104 | |
| 1105 | 1105 | if (is_shub()) |
| 1106 | 1106 | xpc_exit_sn2(); |
| 1107 | − else | |
| 1107 | + else if (is_uv()) | |
| 1108 | 1108 | xpc_exit_uv(); |
| 1109 | 1109 | } |
| 1110 | 1110 | |
| @@ -1363,7 +1363,7 @@ out_2: · 252 unmodified lines | ||
| 1363 | 1363 | out_1: |
| 1364 | 1364 | if (is_shub()) |
| 1365 | 1365 | xpc_exit_sn2(); |
| 1366 | − else | |
| 1366 | + else if (is_uv()) | |
| 1367 | 1367 | xpc_exit_uv(); |
| 1368 | 1368 | return ret; |
| 1369 | 1369 | } |
| @@ -2315,8 +2315,10 @@ end: · 2314 unmodified lines | ||
| 2315 | 2315 | */ |
| 2316 | 2316 | static int sony_pic_disable(struct acpi_device *device) |
| 2317 | 2317 | { |
| 2318 | − if (ACPI_FAILURE(acpi_evaluate_object(device->handle, | |
| 2319 | − "_DIS", NULL, NULL))) | |
| 2318 | + acpi_status ret = acpi_evaluate_object(device->handle, "_DIS", NULL, | |
| 2319 | + NULL); | |
| 2320 | + | |
| 2321 | + if (ACPI_FAILURE(ret) && ret != AE_NOT_FOUND) | |
| 2320 | 2322 | return -ENXIO; |
| 2321 | 2323 | |
| 2322 | 2324 | dprintk("Device disabled\n"); |
| @@ -833,12 +833,14 @@ static int amd8111e_rx_poll(struct napi_struct *napi, int budget) · 832 unmodified lines | ||
| 833 | 833 | |
| 834 | 834 | } while(intr0 & RINT0); |
| 835 | 835 | |
| 836 | − /* Receive descriptor is empty now */ | |
| 837 | − spin_lock_irqsave(&lp->lock, flags); | |
| 838 | − __netif_rx_complete(dev, napi); | |
| 839 | − writel(VAL0|RINTEN0, mmio + INTEN0); | |
| 840 | − writel(VAL2 | RDMD0, mmio + CMD0); | |
| 841 | − spin_unlock_irqrestore(&lp->lock, flags); | |
| 836 | + if (rx_pkt_limit > 0) { | |
| 837 | + /* Receive descriptor is empty now */ | |
| 838 | + spin_lock_irqsave(&lp->lock, flags); | |
| 839 | + __netif_rx_complete(dev, napi); | |
| 840 | + writel(VAL0|RINTEN0, mmio + INTEN0); | |
| 841 | + writel(VAL2 | RDMD0, mmio + CMD0); | |
| 842 | + spin_unlock_irqrestore(&lp->lock, flags); | |
| 843 | + } | |
| 842 | 844 | |
| 843 | 845 | rx_not_empty: |
| 844 | 846 | return num_rx_pkt; |
| @@ -40,7 +40,7 @@ · 39 unmodified lines | ||
| 40 | 40 | #include <asm/io.h> |
| 41 | 41 | |
| 42 | 42 | #define DRV_NAME "ehea" |
| 43 | −#define DRV_VERSION "EHEA_0094" | |
| 43 | +#define DRV_VERSION "EHEA_0095" | |
| 44 | 44 | |
| 45 | 45 | /* eHEA capability flags */ |
| 46 | 46 | #define DLPAR_PORT_ADD_REM 1 |
| @@ -632,10 +632,13 @@ static void ehea_rebuild_busmap(void) · 631 unmodified lines | ||
| 632 | 632 | } |
| 633 | 633 | } |
| 634 | 634 | |
| 635 | −static int ehea_update_busmap(unsigned long pfn, unsigned long pgnum, int add) | |
| 635 | +static int ehea_update_busmap(unsigned long pfn, unsigned long nr_pages, int add) | |
| 636 | 636 | { |
| 637 | 637 | unsigned long i, start_section, end_section; |
| 638 | 638 | |
| 639 | + if (!nr_pages) | |
| 640 | + return 0; | |
| 641 | + | |
| 639 | 642 | if (!ehea_bmap) { |
| 640 | 643 | ehea_bmap = kzalloc(sizeof(struct ehea_bmap), GFP_KERNEL); |
| 641 | 644 | if (!ehea_bmap) |
| @@ -643,7 +646,7 @@ static int ehea_update_busmap(unsigned long pfn, unsigned long pgnum, int add) · 1 unmodified line | ||
| 643 | 646 | } |
| 644 | 647 | |
| 645 | 648 | start_section = (pfn * PAGE_SIZE) / EHEA_SECTSIZE; |
| 646 | − end_section = start_section + ((pgnum * PAGE_SIZE) / EHEA_SECTSIZE); | |
| 649 | + end_section = start_section + ((nr_pages * PAGE_SIZE) / EHEA_SECTSIZE); | |
| 647 | 650 | /* Mark entries as valid or invalid only; address is assigned later */ |
| 648 | 651 | for (i = start_section; i < end_section; i++) { |
| 649 | 652 | u64 flag; |
| @@ -692,10 +695,54 @@ int ehea_rem_sect_bmap(unsigned long pfn, unsigned long nr_pages) · 42 unmodified lines | ||
| 692 | 695 | return ret; |
| 693 | 696 | } |
| 694 | 697 | |
| 695 | −static int ehea_create_busmap_callback(unsigned long pfn, | |
| 696 | − unsigned long nr_pages, void *arg) | |
| 698 | +static int ehea_is_hugepage(unsigned long pfn) | |
| 699 | +{ | |
| 700 | + int page_order; | |
| 701 | + | |
| 702 | + if (pfn & EHEA_HUGEPAGE_PFN_MASK) | |
| 703 | + return 0; | |
| 704 | + | |
| 705 | + page_order = compound_order(pfn_to_page(pfn)); | |
| 706 | + if (page_order + PAGE_SHIFT != EHEA_HUGEPAGESHIFT) | |
| 707 | + return 0; | |
| 708 | + | |
| 709 | + return 1; | |
| 710 | +} | |
| 711 | + | |
| 712 | +static int ehea_create_busmap_callback(unsigned long initial_pfn, | |
| 713 | + unsigned long total_nr_pages, void *arg) | |
| 697 | 714 | { |
| 698 | − return ehea_update_busmap(pfn, nr_pages, EHEA_BUSMAP_ADD_SECT); | |
| 715 | + int ret; | |
| 716 | + unsigned long pfn, start_pfn, end_pfn, nr_pages; | |
| 717 | + | |
| 718 | + if ((total_nr_pages * PAGE_SIZE) < EHEA_HUGEPAGE_SIZE) | |
| 719 | + return ehea_update_busmap(initial_pfn, total_nr_pages, | |
| 720 | + EHEA_BUSMAP_ADD_SECT); | |
| 721 | + | |
| 722 | + /* Given chunk is >= 16GB -> check for hugepages */ | |
| 723 | + start_pfn = initial_pfn; | |
| 724 | + end_pfn = initial_pfn + total_nr_pages; | |
| 725 | + pfn = start_pfn; | |
| 726 | + | |
| 727 | + while (pfn < end_pfn) { | |
| 728 | + if (ehea_is_hugepage(pfn)) { | |
| 729 | + /* Add mem found in front of the hugepage */ | |
| 730 | + nr_pages = pfn - start_pfn; | |
| 731 | + ret = ehea_update_busmap(start_pfn, nr_pages, | |
| 732 | + EHEA_BUSMAP_ADD_SECT); | |
| 733 | + if (ret) | |
| 734 | + return ret; | |
| 735 | + | |
| 736 | + /* Skip the hugepage */ | |
| 737 | + pfn += (EHEA_HUGEPAGE_SIZE / PAGE_SIZE); | |
| 738 | + start_pfn = pfn; | |
| 739 | + } else | |
| 740 | + pfn += (EHEA_SECTSIZE / PAGE_SIZE); | |
| 741 | + } | |
| 742 | + | |
| 743 | + /* Add mem found behind the hugepage(s) */ | |
| 744 | + nr_pages = pfn - start_pfn; | |
| 745 | + return ehea_update_busmap(start_pfn, nr_pages, EHEA_BUSMAP_ADD_SECT); | |
| 699 | 746 | } |
| 700 | 747 | |
| 701 | 748 | int ehea_create_busmap(void) |
| @@ -40,6 +40,9 @@ · 39 unmodified lines | ||
| 40 | 40 | #define EHEA_PAGESIZE (1UL << EHEA_PAGESHIFT) |
| 41 | 41 | #define EHEA_SECTSIZE (1UL << 24) |
| 42 | 42 | #define EHEA_PAGES_PER_SECTION (EHEA_SECTSIZE >> EHEA_PAGESHIFT) |
| 43 | +#define EHEA_HUGEPAGESHIFT 34 | |
| 44 | +#define EHEA_HUGEPAGE_SIZE (1UL << EHEA_HUGEPAGESHIFT) | |
| 45 | +#define EHEA_HUGEPAGE_PFN_MASK ((EHEA_HUGEPAGE_SIZE - 1) >> PAGE_SHIFT) | |
| 43 | 46 | |
| 44 | 47 | #if ((1UL << SECTION_SIZE_BITS) < EHEA_SECTSIZE) |
| 45 | 48 | #error eHEA module cannot work if kernel sectionsize < ehea sectionsize |
| @@ -2605,7 +2605,7 @@ static int __devinit emac_init_config(struct emac_instance *dev) · 2604 unmodified lines | ||
| 2605 | 2605 | of_device_is_compatible(np, "ibm,emac-440gr")) |
| 2606 | 2606 | dev->features |= EMAC_FTR_440EP_PHY_CLK_FIX; |
| 2607 | 2607 | if (of_device_is_compatible(np, "ibm,emac-405ez")) { |
| 2608 | −#ifdef CONFIG_IBM_NEW_EMAC_NO_FLOW_CONTROL | |
| 2608 | +#ifdef CONFIG_IBM_NEW_EMAC_NO_FLOW_CTRL | |
| 2609 | 2609 | dev->features |= EMAC_FTR_NO_FLOW_CONTROL_40x; |
| 2610 | 2610 | #else |
| 2611 | 2611 | printk(KERN_ERR "%s: Flow control not disabled!\n", |
| @@ -35,7 +35,6 @@ · 34 unmodified lines | ||
| 35 | 35 | #include <linux/module.h> |
| 36 | 36 | #include <linux/delay.h> |
| 37 | 37 | #include <linux/netdevice.h> |
| 38 | −#include <linux/cpumask.h> | |
| 39 | 38 | |
| 40 | 39 | #include <linux/mlx4/driver.h> |
| 41 | 40 | #include <linux/mlx4/device.h> |
| @@ -360,9 +360,9 @@ int mlx4_QUERY_DEV_CAP(struct mlx4_dev *dev, struct mlx4_dev_cap *dev_cap) · 359 unmodified lines | ||
| 360 | 360 | #define QUERY_PORT_ETH_MTU_OFFSET 0x02 |
| 361 | 361 | #define QUERY_PORT_WIDTH_OFFSET 0x06 |
| 362 | 362 | #define QUERY_PORT_MAX_GID_PKEY_OFFSET 0x07 |
| 363 | −#define QUERY_PORT_MAC_OFFSET 0x08 | |
| 364 | 363 | #define QUERY_PORT_MAX_MACVLAN_OFFSET 0x0a |
| 365 | 364 | #define QUERY_PORT_MAX_VL_OFFSET 0x0b |
| 365 | +#define QUERY_PORT_MAC_OFFSET 0x10 | |
| 366 | 366 | |
| 367 | 367 | for (i = 1; i <= dev_cap->num_ports; ++i) { |
| 368 | 368 | err = mlx4_cmd_box(dev, 0, mailbox->dma, i, 0, MLX4_CMD_QUERY_PORT, |
| @@ -420,9 +420,13 @@ static int __devinit dmfe_init_one (struct pci_dev *pdev, · 419 unmodified lines | ||
| 420 | 420 | /* Allocate Tx/Rx descriptor memory */ |
| 421 | 421 | db->desc_pool_ptr = pci_alloc_consistent(pdev, sizeof(struct tx_desc) * |
| 422 | 422 | DESC_ALL_CNT + 0x20, &db->desc_pool_dma_ptr); |
| 423 | + if (!db->desc_pool_ptr) | |
| 424 | + goto err_out_res; | |
| 423 | 425 | |
| 424 | 426 | db->buf_pool_ptr = pci_alloc_consistent(pdev, TX_BUF_ALLOC * |
| 425 | 427 | TX_DESC_CNT + 4, &db->buf_pool_dma_ptr); |
| 428 | + if (!db->buf_pool_ptr) | |
| 429 | + goto err_out_free_desc; | |
| 426 | 430 | |
| 427 | 431 | db->first_tx_desc = (struct tx_desc *) db->desc_pool_ptr; |
| 428 | 432 | db->first_tx_desc_dma = db->desc_pool_dma_ptr; |
| @@ -469,7 +473,7 @@ static int __devinit dmfe_init_one (struct pci_dev *pdev, · 40 unmodified lines | ||
| 469 | 473 | |
| 470 | 474 | err = register_netdev (dev); |
| 471 | 475 | if (err) |
| 472 | − goto err_out_res; | |
| 476 | + goto err_out_free_buf; | |
| 473 | 477 | |
| 474 | 478 | printk(KERN_INFO "%s: Davicom DM%04lx at pci%s, " |
| 475 | 479 | "%s, irq %d.\n", |
| @@ -483,6 +487,12 @@ static int __devinit dmfe_init_one (struct pci_dev *pdev, · 7 unmodified lines | ||
| 483 | 487 | |
| 484 | 488 | return 0; |
| 485 | 489 | |
| 490 | +err_out_free_buf: | |
| 491 | + pci_free_consistent(pdev, TX_BUF_ALLOC * TX_DESC_CNT + 4, | |
| 492 | + db->buf_pool_ptr, db->buf_pool_dma_ptr); | |
| 493 | +err_out_free_desc: | |
| 494 | + pci_free_consistent(pdev, sizeof(struct tx_desc) * DESC_ALL_CNT + 0x20, | |
| 495 | + db->desc_pool_ptr, db->desc_pool_dma_ptr); | |
| 486 | 496 | err_out_res: |
| 487 | 497 | pci_release_regions(pdev); |
| 488 | 498 | err_out_disable: |
| @@ -396,6 +396,20 @@ static void dm9601_set_multicast(struct net_device *net) · 395 unmodified lines | ||
| 396 | 396 | dm_write_reg_async(dev, DM_RX_CTRL, rx_ctl); |
| 397 | 397 | } |
| 398 | 398 | |
| 399 | +static int dm9601_set_mac_address(struct net_device *net, void *p) | |
| 400 | +{ | |
| 401 | + struct sockaddr *addr = p; | |
| 402 | + struct usbnet *dev = netdev_priv(net); | |
| 403 | + | |
| 404 | + if (!is_valid_ether_addr(addr->sa_data)) | |
| 405 | + return -EINVAL; | |
| 406 | + | |
| 407 | + memcpy(net->dev_addr, addr->sa_data, net->addr_len); | |
| 408 | + dm_write_async(dev, DM_PHY_ADDR, net->addr_len, net->dev_addr); | |
| 409 | + | |
| 410 | + return 0; | |
| 411 | +} | |
| 412 | + | |
| 399 | 413 | static int dm9601_bind(struct usbnet *dev, struct usb_interface *intf) |
| 400 | 414 | { |
| 401 | 415 | int ret; |
| @@ -406,6 +420,7 @@ static int dm9601_bind(struct usbnet *dev, struct usb_interface *intf) · 4 unmodified lines | ||
| 406 | 420 | |
| 407 | 421 | dev->net->do_ioctl = dm9601_ioctl; |
| 408 | 422 | dev->net->set_multicast_list = dm9601_set_multicast; |
| 423 | + dev->net->set_mac_address = dm9601_set_mac_address; | |
| 409 | 424 | dev->net->ethtool_ops = &dm9601_ethtool_ops; |
| 410 | 425 | dev->net->hard_header_len += DM_TX_OVERHEAD; |
| 411 | 426 | dev->hard_mtu = dev->net->mtu + dev->net->hard_header_len; |
| @@ -521,7 +521,7 @@ static void __devexit velocity_remove1(struct pci_dev *pdev) · 520 unmodified lines | ||
| 521 | 521 | * we don't duplicate code for each option. |
| 522 | 522 | */ |
| 523 | 523 | |
| 524 | −static void __devinit velocity_set_int_opt(int *opt, int val, int min, int max, int def, char *name, char *devname) | |
| 524 | +static void __devinit velocity_set_int_opt(int *opt, int val, int min, int max, int def, char *name, const char *devname) | |
| 525 | 525 | { |
| 526 | 526 | if (val == -1) |
| 527 | 527 | *opt = def; |
| @@ -550,7 +550,7 @@ static void __devinit velocity_set_int_opt(int *opt, int val, int min, int max, · 22 unmodified lines | ||
| 550 | 550 | * we don't duplicate code for each option. |
| 551 | 551 | */ |
| 552 | 552 | |
| 553 | −static void __devinit velocity_set_bool_opt(u32 * opt, int val, int def, u32 flag, char *name, char *devname) | |
| 553 | +static void __devinit velocity_set_bool_opt(u32 * opt, int val, int def, u32 flag, char *name, const char *devname) | |
| 554 | 554 | { |
| 555 | 555 | (*opt) &= (~flag); |
| 556 | 556 | if (val == -1) |
| @@ -576,7 +576,7 @@ static void __devinit velocity_set_bool_opt(u32 * opt, int val, int def, u32 fla · 19 unmodified lines | ||
| 576 | 576 | * for the current device |
| 577 | 577 | */ |
| 578 | 578 | |
| 579 | −static void __devinit velocity_get_options(struct velocity_opt *opts, int index, char *devname) | |
| 579 | +static void __devinit velocity_get_options(struct velocity_opt *opts, int index, const char *devname) | |
| 580 | 580 | { |
| 581 | 581 | |
| 582 | 582 | velocity_set_int_opt(&opts->rx_thresh, rx_thresh[index], RX_THRESH_MIN, RX_THRESH_MAX, RX_THRESH_DEF, "rx_thresh", devname); |
| @@ -863,6 +863,7 @@ static int __devinit velocity_found1(struct pci_dev *pdev, const struct pci_devi · 280 unmodified lines | ||
| 863 | 863 | static int first = 1; |
| 864 | 864 | struct net_device *dev; |
| 865 | 865 | int i; |
| 866 | + const char *drv_string; | |
| 866 | 867 | const struct velocity_info_tbl *info = &chip_info_table[ent->driver_data]; |
| 867 | 868 | struct velocity_info *vptr; |
| 868 | 869 | struct mac_regs __iomem * regs; |
| @@ -935,7 +936,9 @@ static int __devinit velocity_found1(struct pci_dev *pdev, const struct pci_devi · 66 unmodified lines | ||
| 935 | 936 | dev->dev_addr[i] = readb(®s->PAR[i]); |
| 936 | 937 | |
| 937 | 938 | |
| 938 | − velocity_get_options(&vptr->options, velocity_nics, dev->name); | |
| 939 | + drv_string = dev_driver_string(&pdev->dev); | |
| 940 | + | |
| 941 | + velocity_get_options(&vptr->options, velocity_nics, drv_string); | |
| 939 | 942 | |
| 940 | 943 | /* |
| 941 | 944 | * Mask out the options cannot be set to the chip |
| @@ -756,10 +756,11 @@ static void sppp_cisco_input (struct sppp *sp, struct sk_buff *skb) · 755 unmodified lines | ||
| 756 | 756 | case CISCO_ADDR_REQ: |
| 757 | 757 | /* Stolen from net/ipv4/devinet.c -- SIOCGIFADDR ioctl */ |
| 758 | 758 | { |
| 759 | − struct in_device *in_dev; | |
| 760 | − struct in_ifaddr *ifa; | |
| 761 | 759 | __be32 addr = 0, mask = htonl(~0U); /* FIXME: is the mask correct? */ |
| 762 | 760 | #ifdef CONFIG_INET |
| 761 | + struct in_device *in_dev; | |
| 762 | + struct in_ifaddr *ifa; | |
| 763 | + | |
| 763 | 764 | rcu_read_lock(); |
| 764 | 765 | if ((in_dev = __in_dev_get_rcu(dev)) != NULL) |
| 765 | 766 | { |
| @@ -661,8 +661,7 @@ ath5k_pci_resume(struct pci_dev *pdev) · 660 unmodified lines | ||
| 661 | 661 | { |
| 662 | 662 | struct ieee80211_hw *hw = pci_get_drvdata(pdev); |
| 663 | 663 | struct ath5k_softc *sc = hw->priv; |
| 664 | − struct ath5k_hw *ah = sc->ah; | |
| 665 | − int i, err; | |
| 664 | + int err; | |
| 666 | 665 | |
| 667 | 666 | pci_restore_state(pdev); |
| 668 | 667 | |
| @@ -688,16 +687,6 @@ ath5k_pci_resume(struct pci_dev *pdev) · 19 unmodified lines | ||
| 688 | 687 | goto err_irq; |
| 689 | 688 | ath5k_led_enable(sc); |
| 690 | 689 | |
| 691 | − /* | |
| 692 | − * Reset the key cache since some parts do not | |
| 693 | − * reset the contents on initial power up or resume. | |
| 694 | − * | |
| 695 | − * FIXME: This may need to be revisited when mac80211 becomes | |
| 696 | − * aware of suspend/resume. | |
| 697 | − */ | |
| 698 | − for (i = 0; i < AR5K_KEYTABLE_SIZE; i++) | |
| 699 | − ath5k_hw_reset_key(ah, i); | |
| 700 | − | |
| 701 | 690 | return 0; |
| 702 | 691 | err_irq: |
| 703 | 692 | free_irq(pdev->irq, sc); |
| @@ -718,7 +707,6 @@ ath5k_attach(struct pci_dev *pdev, struct ieee80211_hw *hw) · 14 unmodified lines | ||
| 718 | 707 | struct ath5k_softc *sc = hw->priv; |
| 719 | 708 | struct ath5k_hw *ah = sc->ah; |
| 720 | 709 | u8 mac[ETH_ALEN]; |
| 721 | − unsigned int i; | |
| 722 | 710 | int ret; |
| 723 | 711 | |
| 724 | 712 | ATH5K_DBG(sc, ATH5K_DEBUG_ANY, "devid 0x%x\n", pdev->device); |
| @@ -736,13 +724,6 @@ ath5k_attach(struct pci_dev *pdev, struct ieee80211_hw *hw) · 11 unmodified lines | ||
| 736 | 724 | if (ret > 0) |
| 737 | 725 | __set_bit(ATH_STAT_MRRETRY, sc->status); |
| 738 | 726 | |
| 739 | − /* | |
| 740 | − * Reset the key cache since some parts do not | |
| 741 | − * reset the contents on initial power up. | |
| 742 | − */ | |
| 743 | − for (i = 0; i < AR5K_KEYTABLE_SIZE; i++) | |
| 744 | − ath5k_hw_reset_key(ah, i); | |
| 745 | − | |
| 746 | 727 | /* |
| 747 | 728 | * Collect the channel list. The 802.11 layer |
| 748 | 729 | * is resposible for filtering this list based |
| @@ -2202,7 +2183,8 @@ ath5k_beacon_config(struct ath5k_softc *sc) · 1453 unmodified lines | ||
| 2202 | 2183 | static int |
| 2203 | 2184 | ath5k_init(struct ath5k_softc *sc, bool is_resume) |
| 2204 | 2185 | { |
| 2205 | − int ret; | |
| 2186 | + struct ath5k_hw *ah = sc->ah; | |
| 2187 | + int ret, i; | |
| 2206 | 2188 | |
| 2207 | 2189 | mutex_lock(&sc->lock); |
| 2208 | 2190 | |
| @@ -2235,10 +2217,17 @@ ath5k_init(struct ath5k_softc *sc, bool is_resume) · 26 unmodified lines | ||
| 2235 | 2217 | if (ret) |
| 2236 | 2218 | goto done; |
| 2237 | 2219 | |
| 2220 | + /* | |
| 2221 | + * Reset the key cache since some parts do not reset the | |
| 2222 | + * contents on initial power up or resume from suspend. | |
| 2223 | + */ | |
| 2224 | + for (i = 0; i < AR5K_KEYTABLE_SIZE; i++) | |
| 2225 | + ath5k_hw_reset_key(ah, i); | |
| 2226 | + | |
| 2238 | 2227 | __set_bit(ATH_STAT_STARTED, sc->status); |
| 2239 | 2228 | |
| 2240 | 2229 | /* Set ack to be sent at low bit-rates */ |
| 2241 | − ath5k_hw_set_ack_bitrate_high(sc->ah, false); | |
| 2230 | + ath5k_hw_set_ack_bitrate_high(ah, false); | |
| 2242 | 2231 | |
| 2243 | 2232 | mod_timer(&sc->calib_tim, round_jiffies(jiffies + |
| 2244 | 2233 | msecs_to_jiffies(ath5k_calinterval * 1000))); |
| @@ -328,7 +328,7 @@ static int process_rxed_802_11_packet(struct lbs_private *priv, · 327 unmodified lines | ||
| 328 | 328 | lbs_deb_rx("rx err: frame received with bad length\n"); |
| 329 | 329 | priv->stats.rx_length_errors++; |
| 330 | 330 | ret = -EINVAL; |
| 331 | − kfree(skb); | |
| 331 | + kfree_skb(skb); | |
| 332 | 332 | goto done; |
| 333 | 333 | } |
| 334 | 334 | |
| @@ -319,7 +319,7 @@ static int p54_parse_eeprom(struct ieee80211_hw *dev, void *eeprom, int len) · 318 unmodified lines | ||
| 319 | 319 | void *tmp; |
| 320 | 320 | int err; |
| 321 | 321 | u8 *end = (u8 *)eeprom + len; |
| 322 | − u16 synth; | |
| 322 | + u16 synth = 0; | |
| 323 | 323 | DECLARE_MAC_BUF(mac); |
| 324 | 324 | |
| 325 | 325 | wrap = (struct eeprom_pda_wrap *) eeprom; |
| @@ -422,7 +422,8 @@ static int p54_parse_eeprom(struct ieee80211_hw *dev, void *eeprom, int len) · 96 unmodified lines | ||
| 422 | 422 | entry = (void *)entry + (entry_len + 1)*2; |
| 423 | 423 | } |
| 424 | 424 | |
| 425 | − if (!priv->iq_autocal || !priv->output_limit || !priv->curve_data) { | |
| 425 | + if (!synth || !priv->iq_autocal || !priv->output_limit || | |
| 426 | + !priv->curve_data) { | |
| 426 | 427 | printk(KERN_ERR "p54: not all required entries found in eeprom!\n"); |
| 427 | 428 | err = -EINVAL; |
| 428 | 429 | goto err; |
| @@ -346,68 +346,6 @@ static void p54p_tx(struct ieee80211_hw *dev, struct p54_control_hdr *data, · 345 unmodified lines | ||
| 346 | 346 | printk(KERN_INFO "%s: tx overflow.\n", wiphy_name(dev->wiphy)); |
| 347 | 347 | } |
| 348 | 348 | |
| 349 | −static int p54p_open(struct ieee80211_hw *dev) | |
| 350 | −{ | |
| 351 | − struct p54p_priv *priv = dev->priv; | |
| 352 | − int err; | |
| 353 | − | |
| 354 | − init_completion(&priv->boot_comp); | |
| 355 | − err = request_irq(priv->pdev->irq, &p54p_interrupt, | |
| 356 | − IRQF_SHARED, "p54pci", dev); | |
| 357 | − if (err) { | |
| 358 | − printk(KERN_ERR "%s: failed to register IRQ handler\n", | |
| 359 | − wiphy_name(dev->wiphy)); | |
| 360 | − return err; | |
| 361 | − } | |
| 362 | − | |
| 363 | − memset(priv->ring_control, 0, sizeof(*priv->ring_control)); | |
| 364 | − err = p54p_upload_firmware(dev); | |
| 365 | − if (err) { | |
| 366 | − free_irq(priv->pdev->irq, dev); | |
| 367 | − return err; | |
| 368 | − } | |
| 369 | − priv->rx_idx_data = priv->tx_idx_data = 0; | |
| 370 | − priv->rx_idx_mgmt = priv->tx_idx_mgmt = 0; | |
| 371 | − | |
| 372 | − p54p_refill_rx_ring(dev, 0, priv->ring_control->rx_data, | |
| 373 | − ARRAY_SIZE(priv->ring_control->rx_data), priv->rx_buf_data); | |
| 374 | − | |
| 375 | − p54p_refill_rx_ring(dev, 2, priv->ring_control->rx_mgmt, | |
| 376 | − ARRAY_SIZE(priv->ring_control->rx_mgmt), priv->rx_buf_mgmt); | |
| 377 | − | |
| 378 | − P54P_WRITE(ring_control_base, cpu_to_le32(priv->ring_control_dma)); | |
| 379 | − P54P_READ(ring_control_base); | |
| 380 | − wmb(); | |
| 381 | − udelay(10); | |
| 382 | − | |
| 383 | − P54P_WRITE(int_enable, cpu_to_le32(ISL38XX_INT_IDENT_INIT)); | |
| 384 | − P54P_READ(int_enable); | |
| 385 | − wmb(); | |
| 386 | − udelay(10); | |
| 387 | − | |
| 388 | − P54P_WRITE(dev_int, cpu_to_le32(ISL38XX_DEV_INT_RESET)); | |
| 389 | − P54P_READ(dev_int); | |
| 390 | − | |
| 391 | − if (!wait_for_completion_interruptible_timeout(&priv->boot_comp, HZ)) { | |
| 392 | − printk(KERN_ERR "%s: Cannot boot firmware!\n", | |
| 393 | − wiphy_name(dev->wiphy)); | |
| 394 | − free_irq(priv->pdev->irq, dev); | |
| 395 | − return -ETIMEDOUT; | |
| 396 | − } | |
| 397 | − | |
| 398 | − P54P_WRITE(int_enable, cpu_to_le32(ISL38XX_INT_IDENT_UPDATE)); | |
| 399 | − P54P_READ(int_enable); | |
| 400 | − wmb(); | |
| 401 | − udelay(10); | |
| 402 | − | |
| 403 | − P54P_WRITE(dev_int, cpu_to_le32(ISL38XX_DEV_INT_UPDATE)); | |
| 404 | − P54P_READ(dev_int); | |
| 405 | − wmb(); | |
| 406 | − udelay(10); | |
| 407 | − | |
| 408 | − return 0; | |
| 409 | −} | |
| 410 | − | |
| 411 | 349 | static void p54p_stop(struct ieee80211_hw *dev) |
| 412 | 350 | { |
| 413 | 351 | struct p54p_priv *priv = dev->priv; |
| @@ -474,6 +412,68 @@ static void p54p_stop(struct ieee80211_hw *dev) · 60 unmodified lines | ||
| 474 | 412 | memset(ring_control, 0, sizeof(*ring_control)); |
| 475 | 413 | } |
| 476 | 414 | |
| 415 | +static int p54p_open(struct ieee80211_hw *dev) | |
| 416 | +{ | |
| 417 | + struct p54p_priv *priv = dev->priv; | |
| 418 | + int err; | |
| 419 | + | |
| 420 | + init_completion(&priv->boot_comp); | |
| 421 | + err = request_irq(priv->pdev->irq, &p54p_interrupt, | |
| 422 | + IRQF_SHARED, "p54pci", dev); | |
| 423 | + if (err) { | |
| 424 | + printk(KERN_ERR "%s: failed to register IRQ handler\n", | |
| 425 | + wiphy_name(dev->wiphy)); | |
| 426 | + return err; | |
| 427 | + } | |
| 428 | + | |
| 429 | + memset(priv->ring_control, 0, sizeof(*priv->ring_control)); | |
| 430 | + err = p54p_upload_firmware(dev); | |
| 431 | + if (err) { | |
| 432 | + free_irq(priv->pdev->irq, dev); | |
| 433 | + return err; | |
| 434 | + } | |
| 435 | + priv->rx_idx_data = priv->tx_idx_data = 0; | |
| 436 | + priv->rx_idx_mgmt = priv->tx_idx_mgmt = 0; | |
| 437 | + | |
| 438 | + p54p_refill_rx_ring(dev, 0, priv->ring_control->rx_data, | |
| 439 | + ARRAY_SIZE(priv->ring_control->rx_data), priv->rx_buf_data); | |
| 440 | + | |
| 441 | + p54p_refill_rx_ring(dev, 2, priv->ring_control->rx_mgmt, | |
| 442 | + ARRAY_SIZE(priv->ring_control->rx_mgmt), priv->rx_buf_mgmt); | |
| 443 | + | |
| 444 | + P54P_WRITE(ring_control_base, cpu_to_le32(priv->ring_control_dma)); | |
| 445 | + P54P_READ(ring_control_base); | |
| 446 | + wmb(); | |
| 447 | + udelay(10); | |
| 448 | + | |
| 449 | + P54P_WRITE(int_enable, cpu_to_le32(ISL38XX_INT_IDENT_INIT)); | |
| 450 | + P54P_READ(int_enable); | |
| 451 | + wmb(); | |
| 452 | + udelay(10); | |
| 453 | + | |
| 454 | + P54P_WRITE(dev_int, cpu_to_le32(ISL38XX_DEV_INT_RESET)); | |
| 455 | + P54P_READ(dev_int); | |
| 456 | + | |
| 457 | + if (!wait_for_completion_interruptible_timeout(&priv->boot_comp, HZ)) { | |
| 458 | + printk(KERN_ERR "%s: Cannot boot firmware!\n", | |
| 459 | + wiphy_name(dev->wiphy)); | |
| 460 | + p54p_stop(dev); | |
| 461 | + return -ETIMEDOUT; | |
| 462 | + } | |
| 463 | + | |
| 464 | + P54P_WRITE(int_enable, cpu_to_le32(ISL38XX_INT_IDENT_UPDATE)); | |
| 465 | + P54P_READ(int_enable); | |
| 466 | + wmb(); | |
| 467 | + udelay(10); | |
| 468 | + | |
| 469 | + P54P_WRITE(dev_int, cpu_to_le32(ISL38XX_DEV_INT_UPDATE)); | |
| 470 | + P54P_READ(dev_int); | |
| 471 | + wmb(); | |
| 472 | + udelay(10); | |
| 473 | + | |
| 474 | + return 0; | |
| 475 | +} | |
| 476 | + | |
| 477 | 477 | static int __devinit p54p_probe(struct pci_dev *pdev, |
| 478 | 478 | const struct pci_device_id *id) |
| 479 | 479 | { |
| @@ -556,11 +556,13 @@ static int __devinit p54p_probe(struct pci_dev *pdev, · 76 unmodified lines | ||
| 556 | 556 | spin_lock_init(&priv->lock); |
| 557 | 557 | tasklet_init(&priv->rx_tasklet, p54p_rx_tasklet, (unsigned long)dev); |
| 558 | 558 | |
| 559 | − p54p_open(dev); | |
| 559 | + err = p54p_open(dev); | |
| 560 | + if (err) | |
| 561 | + goto err_free_common; | |
| 560 | 562 | err = p54_read_eeprom(dev); |
| 561 | 563 | p54p_stop(dev); |
| 562 | 564 | if (err) |
| 563 | − goto err_free_desc; | |
| 565 | + goto err_free_common; | |
| 564 | 566 | |
| 565 | 567 | err = ieee80211_register_hw(dev); |
| 566 | 568 | if (err) { |
| @@ -573,8 +575,6 @@ static int __devinit p54p_probe(struct pci_dev *pdev, · 6 unmodified lines | ||
| 573 | 575 | |
| 574 | 576 | err_free_common: |
| 575 | 577 | p54_free_common(dev); |
| 576 | − | |
| 577 | − err_free_desc: | |
| 578 | 578 | pci_free_consistent(pdev, sizeof(*priv->ring_control), |
| 579 | 579 | priv->ring_control, priv->ring_control_dma); |
| 580 | 580 | |
| @@ -43,20 +43,6 @@ static void __devinit quirk_mellanox_tavor(struct pci_dev *dev) · 42 unmodified lines | ||
| 43 | 43 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_MELLANOX,PCI_DEVICE_ID_MELLANOX_TAVOR,quirk_mellanox_tavor); |
| 44 | 44 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_MELLANOX,PCI_DEVICE_ID_MELLANOX_TAVOR_BRIDGE,quirk_mellanox_tavor); |
| 45 | 45 | |
| 46 | −/* Many VIA bridges seem to corrupt data for DAC. Disable it here */ | |
| 47 | −int forbid_dac __read_mostly; | |
| 48 | −EXPORT_SYMBOL(forbid_dac); | |
| 49 | − | |
| 50 | −static __devinit void via_no_dac(struct pci_dev *dev) | |
| 51 | −{ | |
| 52 | − if ((dev->class >> 8) == PCI_CLASS_BRIDGE_PCI && forbid_dac == 0) { | |
| 53 | − dev_info(&dev->dev, | |
| 54 | − "VIA PCI bridge detected. Disabling DAC.\n"); | |
| 55 | − forbid_dac = 1; | |
| 56 | − } | |
| 57 | −} | |
| 58 | −DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_ANY_ID, via_no_dac); | |
| 59 | − | |
| 60 | 46 | /* Deal with broken BIOS'es that neglect to enable passive release, |
| 61 | 47 | which can cause problems in combination with the 82441FX/PPro MTRRs */ |
| 62 | 48 | static void quirk_passive_release(struct pci_dev *dev) |
| @@ -79,6 +79,11 @@ struct da903x_regulator_info { · 78 unmodified lines | ||
| 79 | 79 | int enable_bit; |
| 80 | 80 | }; |
| 81 | 81 | |
| 82 | +static inline struct device *to_da903x_dev(struct regulator_dev *rdev) | |
| 83 | +{ | |
| 84 | + return rdev_get_dev(rdev)->parent->parent; | |
| 85 | +} | |
| 86 | + | |
| 82 | 87 | static inline int check_range(struct da903x_regulator_info *info, |
| 83 | 88 | int min_uV, int max_uV) |
| 84 | 89 | { |
| @@ -93,7 +98,7 @@ static int da903x_set_ldo_voltage(struct regulator_dev *rdev, · 8 unmodified lines | ||
| 93 | 98 | int min_uV, int max_uV) |
| 94 | 99 | { |
| 95 | 100 | struct da903x_regulator_info *info = rdev_get_drvdata(rdev); |
| 96 | − struct device *da9034_dev = rdev_get_dev(rdev)->parent; | |
| 101 | + struct device *da9034_dev = to_da903x_dev(rdev); | |
| 97 | 102 | uint8_t val, mask; |
| 98 | 103 | |
| 99 | 104 | if (check_range(info, min_uV, max_uV)) { |
| @@ -111,7 +116,7 @@ static int da903x_set_ldo_voltage(struct regulator_dev *rdev, · 11 unmodified lines | ||
| 111 | 116 | static int da903x_get_voltage(struct regulator_dev *rdev) |
| 112 | 117 | { |
| 113 | 118 | struct da903x_regulator_info *info = rdev_get_drvdata(rdev); |
| 114 | − struct device *da9034_dev = rdev_get_dev(rdev)->parent; | |
| 119 | + struct device *da9034_dev = to_da903x_dev(rdev); | |
| 115 | 120 | uint8_t val, mask; |
| 116 | 121 | int ret; |
| 117 | 122 | |
| @@ -128,7 +133,7 @@ static int da903x_get_voltage(struct regulator_dev *rdev) · 10 unmodified lines | ||
| 128 | 133 | static int da903x_enable(struct regulator_dev *rdev) |
| 129 | 134 | { |
| 130 | 135 | struct da903x_regulator_info *info = rdev_get_drvdata(rdev); |
| 131 | − struct device *da9034_dev = rdev_get_dev(rdev)->parent; | |
| 136 | + struct device *da9034_dev = to_da903x_dev(rdev); | |
| 132 | 137 | |
| 133 | 138 | return da903x_set_bits(da9034_dev, info->enable_reg, |
| 134 | 139 | 1 << info->enable_bit); |
| @@ -137,7 +142,7 @@ static int da903x_enable(struct regulator_dev *rdev) · 2 unmodified lines | ||
| 137 | 142 | static int da903x_disable(struct regulator_dev *rdev) |
| 138 | 143 | { |
| 139 | 144 | struct da903x_regulator_info *info = rdev_get_drvdata(rdev); |
| 140 | − struct device *da9034_dev = rdev_get_dev(rdev)->parent; | |
| 145 | + struct device *da9034_dev = to_da903x_dev(rdev); | |
| 141 | 146 | |
| 142 | 147 | return da903x_clr_bits(da9034_dev, info->enable_reg, |
| 143 | 148 | 1 << info->enable_bit); |
| @@ -146,7 +151,7 @@ static int da903x_disable(struct regulator_dev *rdev) · 2 unmodified lines | ||
| 146 | 151 | static int da903x_is_enabled(struct regulator_dev *rdev) |
| 147 | 152 | { |
| 148 | 153 | struct da903x_regulator_info *info = rdev_get_drvdata(rdev); |
| 149 | − struct device *da9034_dev = rdev_get_dev(rdev)->parent; | |
| 154 | + struct device *da9034_dev = to_da903x_dev(rdev); | |
| 150 | 155 | uint8_t reg_val; |
| 151 | 156 | int ret; |
| 152 | 157 | |
| @@ -162,7 +167,7 @@ static int da9030_set_ldo1_15_voltage(struct regulator_dev *rdev, · 9 unmodified lines | ||
| 162 | 167 | int min_uV, int max_uV) |
| 163 | 168 | { |
| 164 | 169 | struct da903x_regulator_info *info = rdev_get_drvdata(rdev); |
| 165 | − struct device *da903x_dev = rdev_get_dev(rdev)->parent; | |
| 170 | + struct device *da903x_dev = to_da903x_dev(rdev); | |
| 166 | 171 | uint8_t val, mask; |
| 167 | 172 | int ret; |
| 168 | 173 | |
| @@ -189,7 +194,7 @@ static int da9030_set_ldo14_voltage(struct regulator_dev *rdev, · 20 unmodified lines | ||
| 189 | 194 | int min_uV, int max_uV) |
| 190 | 195 | { |
| 191 | 196 | struct da903x_regulator_info *info = rdev_get_drvdata(rdev); |
| 192 | − struct device *da903x_dev = rdev_get_dev(rdev)->parent; | |
| 197 | + struct device *da903x_dev = to_da903x_dev(rdev); | |
| 193 | 198 | uint8_t val, mask; |
| 194 | 199 | int thresh; |
| 195 | 200 | |
| @@ -215,7 +220,7 @@ static int da9030_set_ldo14_voltage(struct regulator_dev *rdev, · 19 unmodified lines | ||
| 215 | 220 | static int da9030_get_ldo14_voltage(struct regulator_dev *rdev) |
| 216 | 221 | { |
| 217 | 222 | struct da903x_regulator_info *info = rdev_get_drvdata(rdev); |
| 218 | − struct device *da903x_dev = rdev_get_dev(rdev)->parent; | |
| 223 | + struct device *da903x_dev = to_da903x_dev(rdev); | |
| 219 | 224 | uint8_t val, mask; |
| 220 | 225 | int ret; |
| 221 | 226 | |
| @@ -238,7 +243,7 @@ static int da9034_set_dvc_voltage(struct regulator_dev *rdev, · 16 unmodified lines | ||
| 238 | 243 | int min_uV, int max_uV) |
| 239 | 244 | { |
| 240 | 245 | struct da903x_regulator_info *info = rdev_get_drvdata(rdev); |
| 241 | − struct device *da9034_dev = rdev_get_dev(rdev)->parent; | |
| 246 | + struct device *da9034_dev = to_da903x_dev(rdev); | |
| 242 | 247 | uint8_t val, mask; |
| 243 | 248 | int ret; |
| 244 | 249 | |
| @@ -264,7 +269,7 @@ static int da9034_set_ldo12_voltage(struct regulator_dev *rdev, · 19 unmodified lines | ||
| 264 | 269 | int min_uV, int max_uV) |
| 265 | 270 | { |
| 266 | 271 | struct da903x_regulator_info *info = rdev_get_drvdata(rdev); |
| 267 | − struct device *da9034_dev = rdev_get_dev(rdev)->parent; | |
| 272 | + struct device *da9034_dev = to_da903x_dev(rdev); | |
| 268 | 273 | uint8_t val, mask; |
| 269 | 274 | |
| 270 | 275 | if (check_range(info, min_uV, max_uV)) { |
| @@ -283,7 +288,7 @@ static int da9034_set_ldo12_voltage(struct regulator_dev *rdev, · 12 unmodified lines | ||
| 283 | 288 | static int da9034_get_ldo12_voltage(struct regulator_dev *rdev) |
| 284 | 289 | { |
| 285 | 290 | struct da903x_regulator_info *info = rdev_get_drvdata(rdev); |
| 286 | − struct device *da9034_dev = rdev_get_dev(rdev)->parent; | |
| 291 | + struct device *da9034_dev = to_da903x_dev(rdev); | |
| 287 | 292 | uint8_t val, mask; |
| 288 | 293 | int ret; |
| 289 | 294 | |
| @@ -466,7 +471,7 @@ static int __devinit da903x_regulator_probe(struct platform_device *pdev) · 176 unmodified lines | ||
| 466 | 471 | if (ri->desc.id == DA9030_ID_LDO1 || ri->desc.id == DA9030_ID_LDO15) |
| 467 | 472 | ri->desc.ops = &da9030_regulator_ldo1_15_ops; |
| 468 | 473 | |
| 469 | − rdev = regulator_register(&ri->desc, pdev->dev.parent, ri); | |
| 474 | + rdev = regulator_register(&ri->desc, &pdev->dev, ri); | |
| 470 | 475 | if (IS_ERR(rdev)) { |
| 471 | 476 | dev_err(&pdev->dev, "failed to register regulator %s\n", |
| 472 | 477 | ri->desc.name); |
| @@ -189,7 +189,7 @@ static const struct rtc_class_ops ds3234_rtc_ops = { · 188 unmodified lines | ||
| 189 | 189 | .set_time = ds3234_set_time, |
| 190 | 190 | }; |
| 191 | 191 | |
| 192 | −static int ds3234_probe(struct spi_device *spi) | |
| 192 | +static int __devinit ds3234_probe(struct spi_device *spi) | |
| 193 | 193 | { |
| 194 | 194 | struct rtc_device *rtc; |
| 195 | 195 | unsigned char tmp; |
| @@ -249,7 +249,7 @@ static int ds3234_probe(struct spi_device *spi) · 53 unmodified lines | ||
| 249 | 249 | return 0; |
| 250 | 250 | } |
| 251 | 251 | |
| 252 | −static int __exit ds3234_remove(struct spi_device *spi) | |
| 252 | +static int __devexit ds3234_remove(struct spi_device *spi) | |
| 253 | 253 | { |
| 254 | 254 | struct ds3234 *chip = platform_get_drvdata(spi); |
| 255 | 255 | struct rtc_device *rtc = chip->rtc; |
| @@ -455,6 +455,8 @@ static int __devinit s3c_rtc_probe(struct platform_device *pdev) · 454 unmodified lines | ||
| 455 | 455 | |
| 456 | 456 | s3c_rtc_setfreq(&pdev->dev, 1); |
| 457 | 457 | |
| 458 | + device_init_wakeup(&pdev->dev, 1); | |
| 459 | + | |
| 458 | 460 | /* register RTC and exit */ |
| 459 | 461 | |
| 460 | 462 | rtc = rtc_device_register("s3c", &pdev->dev, &s3c_rtcops, |
| @@ -507,7 +509,7 @@ static int s3c_rtc_resume(struct platform_device *pdev) · 46 unmodified lines | ||
| 507 | 509 | #define s3c_rtc_resume NULL |
| 508 | 510 | #endif |
| 509 | 511 | |
| 510 | −static struct platform_driver s3c2410_rtcdrv = { | |
| 512 | +static struct platform_driver s3c2410_rtc_driver = { | |
| 511 | 513 | .probe = s3c_rtc_probe, |
| 512 | 514 | .remove = __devexit_p(s3c_rtc_remove), |
| 513 | 515 | .suspend = s3c_rtc_suspend, |
| @@ -523,12 +525,12 @@ static char __initdata banner[] = "S3C24XX RTC, (c) 2004,2006 Simtec Electronics · 9 unmodified lines | ||
| 523 | 525 | static int __init s3c_rtc_init(void) |
| 524 | 526 | { |
| 525 | 527 | printk(banner); |
| 526 | − return platform_driver_register(&s3c2410_rtcdrv); | |
| 528 | + return platform_driver_register(&s3c2410_rtc_driver); | |
| 527 | 529 | } |
| 528 | 530 | |
| 529 | 531 | static void __exit s3c_rtc_exit(void) |
| 530 | 532 | { |
| 531 | − platform_driver_unregister(&s3c2410_rtcdrv); | |
| 533 | + platform_driver_unregister(&s3c2410_rtc_driver); | |
| 532 | 534 | } |
| 533 | 535 | |
| 534 | 536 | module_init(s3c_rtc_init); |
| @@ -76,7 +76,7 @@ tapeblock_trigger_requeue(struct tape_device *device) · 75 unmodified lines | ||
| 76 | 76 | static void |
| 77 | 77 | tapeblock_end_request(struct request *req, int error) |
| 78 | 78 | { |
| 79 | − if (__blk_end_request(req, error, blk_rq_bytes(req))) | |
| 79 | + if (blk_end_request(req, error, blk_rq_bytes(req))) | |
| 80 | 80 | BUG(); |
| 81 | 81 | } |
| 82 | 82 | |
| @@ -166,7 +166,7 @@ tapeblock_requeue(struct work_struct *work) { · 83 unmodified lines | ||
| 166 | 166 | nr_queued++; |
| 167 | 167 | spin_unlock(get_ccwdev_lock(device->cdev)); |
| 168 | 168 | |
| 169 | − spin_lock(&device->blk_data.request_queue_lock); | |
| 169 | + spin_lock_irq(&device->blk_data.request_queue_lock); | |
| 170 | 170 | while ( |
| 171 | 171 | !blk_queue_plugged(queue) && |
| 172 | 172 | elv_next_request(queue) && |
| @@ -176,7 +176,9 @@ tapeblock_requeue(struct work_struct *work) { · 3 unmodified lines | ||
| 176 | 176 | if (rq_data_dir(req) == WRITE) { |
| 177 | 177 | DBF_EVENT(1, "TBLOCK: Rejecting write request\n"); |
| 178 | 178 | blkdev_dequeue_request(req); |
| 179 | + spin_unlock_irq(&device->blk_data.request_queue_lock); | |
| 179 | 180 | tapeblock_end_request(req, -EIO); |
| 181 | + spin_lock_irq(&device->blk_data.request_queue_lock); | |
| 180 | 182 | continue; |
| 181 | 183 | } |
| 182 | 184 | blkdev_dequeue_request(req); |
| @@ -1200,7 +1200,7 @@ tape_open(struct tape_device *device) · 1199 unmodified lines | ||
| 1200 | 1200 | { |
| 1201 | 1201 | int rc; |
| 1202 | 1202 | |
| 1203 | − spin_lock(get_ccwdev_lock(device->cdev)); | |
| 1203 | + spin_lock_irq(get_ccwdev_lock(device->cdev)); | |
| 1204 | 1204 | if (device->tape_state == TS_NOT_OPER) { |
| 1205 | 1205 | DBF_EVENT(6, "TAPE:nodev\n"); |
| 1206 | 1206 | rc = -ENODEV; |
| @@ -1218,7 +1218,7 @@ tape_open(struct tape_device *device) · 11 unmodified lines | ||
| 1218 | 1218 | tape_state_set(device, TS_IN_USE); |
| 1219 | 1219 | rc = 0; |
| 1220 | 1220 | } |
| 1221 | − spin_unlock(get_ccwdev_lock(device->cdev)); | |
| 1221 | + spin_unlock_irq(get_ccwdev_lock(device->cdev)); | |
| 1222 | 1222 | return rc; |
| 1223 | 1223 | } |
| 1224 | 1224 | |
| @@ -1228,11 +1228,11 @@ tape_open(struct tape_device *device) · 3 unmodified lines | ||
| 1228 | 1228 | int |
| 1229 | 1229 | tape_release(struct tape_device *device) |
| 1230 | 1230 | { |
| 1231 | − spin_lock(get_ccwdev_lock(device->cdev)); | |
| 1231 | + spin_lock_irq(get_ccwdev_lock(device->cdev)); | |
| 1232 | 1232 | if (device->tape_state == TS_IN_USE) |
| 1233 | 1233 | tape_state_set(device, TS_UNUSED); |
| 1234 | 1234 | module_put(device->discipline->owner); |
| 1235 | − spin_unlock(get_ccwdev_lock(device->cdev)); | |
| 1235 | + spin_unlock_irq(get_ccwdev_lock(device->cdev)); | |
| 1236 | 1236 | return 0; |
| 1237 | 1237 | } |
| 1238 | 1238 | |
| @@ -20,6 +20,7 @@ static struct dentry *debugfs_root; · 19 unmodified lines | ||
| 20 | 20 | #define MAX_DEBUGFS_QUEUES 32 |
| 21 | 21 | static struct dentry *debugfs_queues[MAX_DEBUGFS_QUEUES] = { NULL }; |
| 22 | 22 | static DEFINE_MUTEX(debugfs_mutex); |
| 23 | +#define QDIO_DEBUGFS_NAME_LEN 40 | |
| 23 | 24 | |
| 24 | 25 | void qdio_allocate_do_dbf(struct qdio_initialize *init_data) |
| 25 | 26 | { |
| @@ -152,17 +153,6 @@ static int qstat_seq_open(struct inode *inode, struct file *filp) · 126 unmodified lines | ||
| 152 | 153 | filp->f_path.dentry->d_inode->i_private); |
| 153 | 154 | } |
| 154 | 155 | |
| 155 | −static void get_queue_name(struct qdio_q *q, struct ccw_device *cdev, char *name) | |
| 156 | −{ | |
| 157 | − memset(name, 0, sizeof(name)); | |
| 158 | − sprintf(name, "%s", dev_name(&cdev->dev)); | |
| 159 | − if (q->is_input_q) | |
| 160 | − sprintf(name + strlen(name), "_input"); | |
| 161 | − else | |
| 162 | − sprintf(name + strlen(name), "_output"); | |
| 163 | − sprintf(name + strlen(name), "_%d", q->nr); | |
| 164 | −} | |
| 165 | − | |
| 166 | 156 | static void remove_debugfs_entry(struct qdio_q *q) |
| 167 | 157 | { |
| 168 | 158 | int i; |
| @@ -189,14 +179,17 @@ static struct file_operations debugfs_fops = { · 20 unmodified lines | ||
| 189 | 179 | static void setup_debugfs_entry(struct qdio_q *q, struct ccw_device *cdev) |
| 190 | 180 | { |
| 191 | 181 | int i = 0; |
| 192 | − char name[40]; | |
| 182 | + char name[QDIO_DEBUGFS_NAME_LEN]; | |
| 193 | 183 | |
| 194 | 184 | while (debugfs_queues[i] != NULL) { |
| 195 | 185 | i++; |
| 196 | 186 | if (i >= MAX_DEBUGFS_QUEUES) |
| 197 | 187 | return; |
| 198 | 188 | } |
| 199 | − get_queue_name(q, cdev, name); | |
| 189 | + snprintf(name, QDIO_DEBUGFS_NAME_LEN, "%s_%s_%d", | |
| 190 | + dev_name(&cdev->dev), | |
| 191 | + q->is_input_q ? "input" : "output", | |
| 192 | + q->nr); | |
| 200 | 193 | debugfs_queues[i] = debugfs_create_file(name, S_IFREG | S_IRUGO | S_IWUSR, |
| 201 | 194 | debugfs_root, q, &debugfs_fops); |
| 202 | 195 | } |
| @@ -1083,7 +1083,6 @@ void qdio_int_handler(struct ccw_device *cdev, unsigned long intparm, · 1082 unmodified lines | ||
| 1083 | 1083 | case -EIO: |
| 1084 | 1084 | sprintf(dbf_text, "ierr%4x", irq_ptr->schid.sch_no); |
| 1085 | 1085 | QDIO_DBF_TEXT2(1, setup, dbf_text); |
| 1086 | − qdio_int_error(cdev); | |
| 1087 | 1086 | return; |
| 1088 | 1087 | case -ETIMEDOUT: |
| 1089 | 1088 | sprintf(dbf_text, "qtoh%4x", irq_ptr->schid.sch_no); |
| @@ -3025,7 +3025,7 @@ static inline void __qeth_fill_buffer(struct sk_buff *skb, · 3024 unmodified lines | ||
| 3025 | 3025 | struct qdio_buffer *buffer, int is_tso, int *next_element_to_fill, |
| 3026 | 3026 | int offset) |
| 3027 | 3027 | { |
| 3028 | − int length = skb->len - offset; | |
| 3028 | + int length = skb->len; | |
| 3029 | 3029 | int length_here; |
| 3030 | 3030 | int element; |
| 3031 | 3031 | char *data; |
| @@ -3037,6 +3037,7 @@ static inline void __qeth_fill_buffer(struct sk_buff *skb, · 5 unmodified lines | ||
| 3037 | 3037 | |
| 3038 | 3038 | if (offset >= 0) { |
| 3039 | 3039 | data = skb->data + offset; |
| 3040 | + length -= offset; | |
| 3040 | 3041 | first_lap = 0; |
| 3041 | 3042 | } |
| 3042 | 3043 | |
| @@ -373,8 +373,6 @@ static int qeth_l2_stop_card(struct qeth_card *card, int recovery_mode) · 372 unmodified lines | ||
| 373 | 373 | QETH_DBF_HEX(SETUP, 2, &card, sizeof(void *)); |
| 374 | 374 | |
| 375 | 375 | qeth_set_allowed_threads(card, 0, 1); |
| 376 | − if (qeth_wait_for_threads(card, ~QETH_RECOVER_THREAD)) | |
| 377 | − return -ERESTARTSYS; | |
| 378 | 376 | if (card->read.state == CH_STATE_UP && |
| 379 | 377 | card->write.state == CH_STATE_UP && |
| 380 | 378 | (card->state == CARD_STATE_UP)) { |
| @@ -451,12 +449,15 @@ static void qeth_l2_process_inbound_buffer(struct qeth_card *card, · 70 unmodified lines | ||
| 451 | 449 | netif_rx(skb); |
| 452 | 450 | break; |
| 453 | 451 | case QETH_HEADER_TYPE_OSN: |
| 454 | − skb_push(skb, sizeof(struct qeth_hdr)); | |
| 455 | − skb_copy_to_linear_data(skb, hdr, | |
| 452 | + if (card->info.type == QETH_CARD_TYPE_OSN) { | |
| 453 | + skb_push(skb, sizeof(struct qeth_hdr)); | |
| 454 | + skb_copy_to_linear_data(skb, hdr, | |
| 456 | 455 | sizeof(struct qeth_hdr)); |
| 457 | − len = skb->len; | |
| 458 | − card->osn_info.data_cb(skb); | |
| 459 | − break; | |
| 456 | + len = skb->len; | |
| 457 | + card->osn_info.data_cb(skb); | |
| 458 | + break; | |
| 459 | + } | |
| 460 | + /* else unknown */ | |
| 460 | 461 | default: |
| 461 | 462 | dev_kfree_skb_any(skb); |
| 462 | 463 | QETH_DBF_TEXT(TRACE, 3, "inbunkno"); |
| @@ -975,12 +976,6 @@ static int __qeth_l2_set_online(struct ccwgroup_device *gdev, int recovery_mode) · 512 unmodified lines | ||
| 975 | 976 | QETH_DBF_HEX(SETUP, 2, &card, sizeof(void *)); |
| 976 | 977 | |
| 977 | 978 | qeth_set_allowed_threads(card, QETH_RECOVER_THREAD, 1); |
| 978 | − if (qeth_wait_for_threads(card, ~QETH_RECOVER_THREAD)) { | |
| 979 | − PRINT_WARN("set_online of card %s interrupted by user!\n", | |
| 980 | − CARD_BUS_ID(card)); | |
| 981 | − return -ERESTARTSYS; | |
| 982 | − } | |
| 983 | − | |
| 984 | 979 | recover_flag = card->state; |
| 985 | 980 | rc = ccw_device_set_online(CARD_RDEV(card)); |
| 986 | 981 | if (rc) { |
| @@ -1091,11 +1086,7 @@ static int __qeth_l2_set_offline(struct ccwgroup_device *cgdev, · 104 unmodified lines | ||
| 1091 | 1086 | if (card->dev && netif_carrier_ok(card->dev)) |
| 1092 | 1087 | netif_carrier_off(card->dev); |
| 1093 | 1088 | recover_flag = card->state; |
| 1094 | − if (qeth_l2_stop_card(card, recovery_mode) == -ERESTARTSYS) { | |
| 1095 | − PRINT_WARN("Stopping card %s interrupted by user!\n", | |
| 1096 | − CARD_BUS_ID(card)); | |
| 1097 | − return -ERESTARTSYS; | |
| 1098 | − } | |
| 1089 | + qeth_l2_stop_card(card, recovery_mode); | |
| 1099 | 1090 | rc = ccw_device_set_offline(CARD_DDEV(card)); |
| 1100 | 1091 | rc2 = ccw_device_set_offline(CARD_WDEV(card)); |
| 1101 | 1092 | rc3 = ccw_device_set_offline(CARD_RDEV(card)); |
| @@ -2064,8 +2064,6 @@ static int qeth_l3_stop_card(struct qeth_card *card, int recovery_mode) · 2063 unmodified lines | ||
| 2064 | 2064 | QETH_DBF_HEX(SETUP, 2, &card, sizeof(void *)); |
| 2065 | 2065 | |
| 2066 | 2066 | qeth_set_allowed_threads(card, 0, 1); |
| 2067 | − if (qeth_wait_for_threads(card, ~QETH_RECOVER_THREAD)) | |
| 2068 | − return -ERESTARTSYS; | |
| 2069 | 2067 | if (card->read.state == CH_STATE_UP && |
| 2070 | 2068 | card->write.state == CH_STATE_UP && |
| 2071 | 2069 | (card->state == CARD_STATE_UP)) { |
| @@ -3049,11 +3047,6 @@ static int __qeth_l3_set_online(struct ccwgroup_device *gdev, int recovery_mode) · 977 unmodified lines | ||
| 3049 | 3047 | QETH_DBF_HEX(SETUP, 2, &card, sizeof(void *)); |
| 3050 | 3048 | |
| 3051 | 3049 | qeth_set_allowed_threads(card, QETH_RECOVER_THREAD, 1); |
| 3052 | − if (qeth_wait_for_threads(card, ~QETH_RECOVER_THREAD)) { | |
| 3053 | − PRINT_WARN("set_online of card %s interrupted by user!\n", | |
| 3054 | − CARD_BUS_ID(card)); | |
| 3055 | − return -ERESTARTSYS; | |
| 3056 | − } | |
| 3057 | 3050 | |
| 3058 | 3051 | recover_flag = card->state; |
| 3059 | 3052 | rc = ccw_device_set_online(CARD_RDEV(card)); |
| @@ -3170,11 +3163,7 @@ static int __qeth_l3_set_offline(struct ccwgroup_device *cgdev, · 110 unmodified lines | ||
| 3170 | 3163 | if (card->dev && netif_carrier_ok(card->dev)) |
| 3171 | 3164 | netif_carrier_off(card->dev); |
| 3172 | 3165 | recover_flag = card->state; |
| 3173 | − if (qeth_l3_stop_card(card, recovery_mode) == -ERESTARTSYS) { | |
| 3174 | − PRINT_WARN("Stopping card %s interrupted by user!\n", | |
| 3175 | − CARD_BUS_ID(card)); | |
| 3176 | − return -ERESTARTSYS; | |
| 3177 | − } | |
| 3166 | + qeth_l3_stop_card(card, recovery_mode); | |
| 3178 | 3167 | rc = ccw_device_set_offline(CARD_DDEV(card)); |
| 3179 | 3168 | rc2 = ccw_device_set_offline(CARD_WDEV(card)); |
| 3180 | 3169 | rc3 = ccw_device_set_offline(CARD_RDEV(card)); |
| @@ -121,9 +121,6 @@ static ssize_t qeth_l3_dev_route6_show(struct device *dev, · 120 unmodified lines | ||
| 121 | 121 | if (!card) |
| 122 | 122 | return -EINVAL; |
| 123 | 123 | |
| 124 | − if (!qeth_is_supported(card, IPA_IPV6)) | |
| 125 | − return sprintf(buf, "%s\n", "n/a"); | |
| 126 | − | |
| 127 | 124 | return qeth_l3_dev_route_show(card, &card->options.route6, buf); |
| 128 | 125 | } |
| 129 | 126 | |
| @@ -135,10 +132,6 @@ static ssize_t qeth_l3_dev_route6_store(struct device *dev, · 5 unmodified lines | ||
| 135 | 132 | if (!card) |
| 136 | 133 | return -EINVAL; |
| 137 | 134 | |
| 138 | − if (!qeth_is_supported(card, IPA_IPV6)) { | |
| 139 | − return -EOPNOTSUPP; | |
| 140 | − } | |
| 141 | − | |
| 142 | 135 | return qeth_l3_dev_route_store(card, &card->options.route6, |
| 143 | 136 | QETH_PROT_IPV6, buf, count); |
| 144 | 137 | } |
| @@ -133,7 +133,7 @@ static int usbtmc_release(struct inode *inode, struct file *file) · 132 unmodified lines | ||
| 133 | 133 | |
| 134 | 134 | static int usbtmc_ioctl_abort_bulk_in(struct usbtmc_device_data *data) |
| 135 | 135 | { |
| 136 | − char *buffer; | |
| 136 | + u8 *buffer; | |
| 137 | 137 | struct device *dev; |
| 138 | 138 | int rv; |
| 139 | 139 | int n; |
| @@ -106,6 +106,9 @@ static DEFINE_SPINLOCK(hcd_root_hub_lock); · 105 unmodified lines | ||
| 106 | 106 | /* used when updating an endpoint's URB list */ |
| 107 | 107 | static DEFINE_SPINLOCK(hcd_urb_list_lock); |
| 108 | 108 | |
| 109 | +/* used to protect against unlinking URBs after the device is gone */ | |
| 110 | +static DEFINE_SPINLOCK(hcd_urb_unlink_lock); | |
| 111 | + | |
| 109 | 112 | /* wait queue for synchronous unlinks */ |
| 110 | 113 | DECLARE_WAIT_QUEUE_HEAD(usb_kill_urb_queue); |
| 111 | 114 | |
| @@ -1376,10 +1379,25 @@ static int unlink1(struct usb_hcd *hcd, struct urb *urb, int status) · 1264 unmodified lines | ||
| 1376 | 1379 | int usb_hcd_unlink_urb (struct urb *urb, int status) |
| 1377 | 1380 | { |
| 1378 | 1381 | struct usb_hcd *hcd; |
| 1379 | − int retval; | |
| 1382 | + int retval = -EIDRM; | |
| 1383 | + unsigned long flags; | |
| 1380 | 1384 | |
| 1381 | − hcd = bus_to_hcd(urb->dev->bus); | |
| 1382 | − retval = unlink1(hcd, urb, status); | |
| 1385 | + /* Prevent the device and bus from going away while | |
| 1386 | + * the unlink is carried out. If they are already gone | |
| 1387 | + * then urb->use_count must be 0, since disconnected | |
| 1388 | + * devices can't have any active URBs. | |
| 1389 | + */ | |
| 1390 | + spin_lock_irqsave(&hcd_urb_unlink_lock, flags); | |
| 1391 | + if (atomic_read(&urb->use_count) > 0) { | |
| 1392 | + retval = 0; | |
| 1393 | + usb_get_dev(urb->dev); | |
| 1394 | + } | |
| 1395 | + spin_unlock_irqrestore(&hcd_urb_unlink_lock, flags); | |
| 1396 | + if (retval == 0) { | |
| 1397 | + hcd = bus_to_hcd(urb->dev->bus); | |
| 1398 | + retval = unlink1(hcd, urb, status); | |
| 1399 | + usb_put_dev(urb->dev); | |
| 1400 | + } | |
| 1383 | 1401 | |
| 1384 | 1402 | if (retval == 0) |
| 1385 | 1403 | retval = -EINPROGRESS; |
| @@ -1528,6 +1546,17 @@ void usb_hcd_disable_endpoint(struct usb_device *udev, · 142 unmodified lines | ||
| 1528 | 1546 | hcd->driver->endpoint_disable(hcd, ep); |
| 1529 | 1547 | } |
| 1530 | 1548 | |
| 1549 | +/* Protect against drivers that try to unlink URBs after the device | |
| 1550 | + * is gone, by waiting until all unlinks for @udev are finished. | |
| 1551 | + * Since we don't currently track URBs by device, simply wait until | |
| 1552 | + * nothing is running in the locked region of usb_hcd_unlink_urb(). | |
| 1553 | + */ | |
| 1554 | +void usb_hcd_synchronize_unlinks(struct usb_device *udev) | |
| 1555 | +{ | |
| 1556 | + spin_lock_irq(&hcd_urb_unlink_lock); | |
| 1557 | + spin_unlock_irq(&hcd_urb_unlink_lock); | |
| 1558 | +} | |
| 1559 | + | |
| 1531 | 1560 | /*-------------------------------------------------------------------------*/ |
| 1532 | 1561 | |
| 1533 | 1562 | /* called in any context */ |
| @@ -232,6 +232,7 @@ extern void usb_hcd_flush_endpoint(struct usb_device *udev, · 231 unmodified lines | ||
| 232 | 232 | struct usb_host_endpoint *ep); |
| 233 | 233 | extern void usb_hcd_disable_endpoint(struct usb_device *udev, |
| 234 | 234 | struct usb_host_endpoint *ep); |
| 235 | +extern void usb_hcd_synchronize_unlinks(struct usb_device *udev); | |
| 235 | 236 | extern int usb_hcd_get_frame_number(struct usb_device *udev); |
| 236 | 237 | |
| 237 | 238 | extern struct usb_hcd *usb_create_hcd(const struct hc_driver *driver, |
| @@ -659,6 +659,9 @@ static void hub_activate(struct usb_hub *hub, enum hub_activation_type type) · 658 unmodified lines | ||
| 659 | 659 | PREPARE_DELAYED_WORK(&hub->init_work, hub_init_func2); |
| 660 | 660 | schedule_delayed_work(&hub->init_work, |
| 661 | 661 | msecs_to_jiffies(delay)); |
| 662 | + | |
| 663 | + /* Suppress autosuspend until init is done */ | |
| 664 | + to_usb_interface(hub->intfdev)->pm_usage_cnt = 1; | |
| 662 | 665 | return; /* Continues at init2: below */ |
| 663 | 666 | } else { |
| 664 | 667 | hub_power_on(hub, true); |
| @@ -1429,6 +1432,7 @@ void usb_disconnect(struct usb_device **pdev) · 764 unmodified lines | ||
| 1429 | 1432 | */ |
| 1430 | 1433 | dev_dbg (&udev->dev, "unregistering device\n"); |
| 1431 | 1434 | usb_disable_device(udev, 0); |
| 1435 | + usb_hcd_synchronize_unlinks(udev); | |
| 1432 | 1436 | |
| 1433 | 1437 | usb_unlock_device(udev); |
| 1434 | 1438 | |
| @@ -474,6 +474,12 @@ EXPORT_SYMBOL_GPL(usb_submit_urb); · 473 unmodified lines | ||
| 474 | 474 | * indicating that the request has been canceled (rather than any other |
| 475 | 475 | * code). |
| 476 | 476 | * |
| 477 | + * Drivers should not call this routine or related routines, such as | |
| 478 | + * usb_kill_urb() or usb_unlink_anchored_urbs(), after their disconnect | |
| 479 | + * method has returned. The disconnect function should synchronize with | |
| 480 | + * a driver's I/O routines to insure that all URB-related activity has | |
| 481 | + * completed before it returns. | |
| 482 | + * | |
| 477 | 483 | * This request is always asynchronous. Success is indicated by |
| 478 | 484 | * returning -EINPROGRESS, at which time the URB will probably not yet |
| 479 | 485 | * have been given back to the device driver. When it is eventually |
| @@ -550,6 +556,9 @@ EXPORT_SYMBOL_GPL(usb_unlink_urb); · 70 unmodified lines | ||
| 550 | 556 | * This routine may not be used in an interrupt context (such as a bottom |
| 551 | 557 | * half or a completion handler), or when holding a spinlock, or in other |
| 552 | 558 | * situations where the caller can't schedule(). |
| 559 | + * | |
| 560 | + * This routine should not be called by a driver after its disconnect | |
| 561 | + * method has returned. | |
| 553 | 562 | */ |
| 554 | 563 | void usb_kill_urb(struct urb *urb) |
| 555 | 564 | { |
| @@ -588,6 +597,9 @@ EXPORT_SYMBOL_GPL(usb_kill_urb); · 32 unmodified lines | ||
| 588 | 597 | * This routine may not be used in an interrupt context (such as a bottom |
| 589 | 598 | * half or a completion handler), or when holding a spinlock, or in other |
| 590 | 599 | * situations where the caller can't schedule(). |
| 600 | + * | |
| 601 | + * This routine should not be called by a driver after its disconnect | |
| 602 | + * method has returned. | |
| 591 | 603 | */ |
| 592 | 604 | void usb_poison_urb(struct urb *urb) |
| 593 | 605 | { |
| @@ -622,6 +634,9 @@ EXPORT_SYMBOL_GPL(usb_unpoison_urb); · 28 unmodified lines | ||
| 622 | 634 | * |
| 623 | 635 | * this allows all outstanding URBs to be killed starting |
| 624 | 636 | * from the back of the queue |
| 637 | + * | |
| 638 | + * This routine should not be called by a driver after its disconnect | |
| 639 | + * method has returned. | |
| 625 | 640 | */ |
| 626 | 641 | void usb_kill_anchored_urbs(struct usb_anchor *anchor) |
| 627 | 642 | { |
| @@ -651,6 +666,9 @@ EXPORT_SYMBOL_GPL(usb_kill_anchored_urbs); · 23 unmodified lines | ||
| 651 | 666 | * this allows all outstanding URBs to be poisoned starting |
| 652 | 667 | * from the back of the queue. Newly added URBs will also be |
| 653 | 668 | * poisoned |
| 669 | + * | |
| 670 | + * This routine should not be called by a driver after its disconnect | |
| 671 | + * method has returned. | |
| 654 | 672 | */ |
| 655 | 673 | void usb_poison_anchored_urbs(struct usb_anchor *anchor) |
| 656 | 674 | { |
| @@ -672,6 +690,7 @@ void usb_poison_anchored_urbs(struct usb_anchor *anchor) · 15 unmodified lines | ||
| 672 | 690 | spin_unlock_irq(&anchor->lock); |
| 673 | 691 | } |
| 674 | 692 | EXPORT_SYMBOL_GPL(usb_poison_anchored_urbs); |
| 693 | + | |
| 675 | 694 | /** |
| 676 | 695 | * usb_unlink_anchored_urbs - asynchronously cancel transfer requests en masse |
| 677 | 696 | * @anchor: anchor the requests are bound to |
| @@ -680,6 +699,9 @@ EXPORT_SYMBOL_GPL(usb_poison_anchored_urbs); · 2 unmodified lines | ||
| 680 | 699 | * from the back of the queue. This function is asynchronous. |
| 681 | 700 | * The unlinking is just tiggered. It may happen after this |
| 682 | 701 | * function has returned. |
| 702 | + * | |
| 703 | + * This routine should not be called by a driver after its disconnect | |
| 704 | + * method has returned. | |
| 683 | 705 | */ |
| 684 | 706 | void usb_unlink_anchored_urbs(struct usb_anchor *anchor) |
| 685 | 707 | { |
| @@ -281,6 +281,7 @@ static void serial_close(struct tty_struct *tty, struct file *filp) · 280 unmodified lines | ||
| 281 | 281 | if (tty->driver_data) |
| 282 | 282 | tty->driver_data = NULL; |
| 283 | 283 | tty_port_tty_set(&port->port, NULL); |
| 284 | + tty_kref_put(tty); | |
| 284 | 285 | } |
| 285 | 286 | } |
| 286 | 287 | |
| @@ -333,6 +333,13 @@ UNUSUAL_DEV( 0x0482, 0x0103, 0x0100, 0x0100, · 332 unmodified lines | ||
| 333 | 333 | "Finecam S5", |
| 334 | 334 | US_SC_DEVICE, US_PR_DEVICE, NULL, US_FL_FIX_INQUIRY), |
| 335 | 335 | |
| 336 | +/* Patch submitted by Jens Taprogge <jens.taprogge@taprogge.org> */ | |
| 337 | +UNUSUAL_DEV( 0x0482, 0x0107, 0x0100, 0x0100, | |
| 338 | + "Kyocera", | |
| 339 | + "CONTAX SL300R T*", | |
| 340 | + US_SC_DEVICE, US_PR_DEVICE, NULL, | |
| 341 | + US_FL_FIX_CAPACITY | US_FL_NOT_LOCKABLE), | |
| 342 | + | |
| 336 | 343 | /* Reported by Paul Stewart <stewart@wetlogic.net> |
| 337 | 344 | * This entry is needed because the device reports Sub=ff */ |
| 338 | 345 | UNUSUAL_DEV( 0x04a4, 0x0004, 0x0001, 0x0001, |
| @@ -2118,7 +2118,7 @@ static void fbcon_bmove_rec(struct vc_data *vc, struct display *p, int sy, int s · 2117 unmodified lines | ||
| 2118 | 2118 | height, width); |
| 2119 | 2119 | } |
| 2120 | 2120 | |
| 2121 | −static __inline__ void updatescrollmode(struct display *p, | |
| 2121 | +static void updatescrollmode(struct display *p, | |
| 2122 | 2122 | struct fb_info *info, |
| 2123 | 2123 | struct vc_data *vc) |
| 2124 | 2124 | { |
| @@ -1262,8 +1262,8 @@ fb_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg) · 1261 unmodified lines | ||
| 1262 | 1262 | case FBIOPUT_CON2FBMAP: |
| 1263 | 1263 | arg = (unsigned long) compat_ptr(arg); |
| 1264 | 1264 | case FBIOBLANK: |
| 1265 | − ret = fb_ioctl(file, cmd, arg); | |
| 1266 | − break; | |
| 1265 | + mutex_unlock(&info->lock); | |
| 1266 | + return fb_ioctl(file, cmd, arg); | |
| 1267 | 1267 | |
| 1268 | 1268 | case FBIOGET_FSCREENINFO: |
| 1269 | 1269 | ret = fb_get_fscreeninfo(inode, file, cmd, arg); |
| @@ -38,7 +38,6 @@ · 37 unmodified lines | ||
| 38 | 38 | #include "iface.h" |
| 39 | 39 | #include "viafbdev.h" |
| 40 | 40 | #include "chip.h" |
| 41 | −#include "debug.h" | |
| 42 | 41 | #include "accel.h" |
| 43 | 42 | #include "share.h" |
| 44 | 43 | #include "dvi.h" |
| @@ -48,12 +47,10 @@ · 3 unmodified lines | ||
| 48 | 47 | |
| 49 | 48 | #include "lcd.h" |
| 50 | 49 | #include "ioctl.h" |
| 51 | −#include "viamode.h" | |
| 52 | 50 | #include "via_utility.h" |
| 53 | 51 | #include "vt1636.h" |
| 54 | 52 | #include "tblDPASetting.h" |
| 55 | 53 | #include "tbl1636.h" |
| 56 | −#include "viafbdev.h" | |
| 57 | 54 | |
| 58 | 55 | /* External struct*/ |
| 59 | 56 | |
| @@ -774,7 +774,7 @@ void xen_poll_irq(int irq) · 773 unmodified lines | ||
| 774 | 774 | |
| 775 | 775 | poll.nr_ports = 1; |
| 776 | 776 | poll.timeout = 0; |
| 777 | − poll.ports = &evtchn; | |
| 777 | + set_xen_guest_handle(poll.ports, &evtchn); | |
| 778 | 778 | |
| 779 | 779 | if (HYPERVISOR_sched_op(SCHEDOP_poll, &poll) != 0) |
| 780 | 780 | BUG(); |
| @@ -39,8 +39,6 @@ static int xen_suspend(void *data) · 38 unmodified lines | ||
| 39 | 39 | |
| 40 | 40 | BUG_ON(!irqs_disabled()); |
| 41 | 41 | |
| 42 | − load_cr3(swapper_pg_dir); | |
| 43 | − | |
| 44 | 42 | err = device_power_down(PMSG_SUSPEND); |
| 45 | 43 | if (err) { |
| 46 | 44 | printk(KERN_ERR "xen_suspend: device_power_down failed: %d\n", |
| @@ -23,13 +23,7 @@ · 22 unmodified lines | ||
| 23 | 23 | #include <asm/page.h> |
| 24 | 24 | #include <xen/xencomm.h> |
| 25 | 25 | #include <xen/interface/xen.h> |
| 26 | −#ifdef __ia64__ | |
| 27 | −#include <asm/xen/xencomm.h> /* for is_kern_addr() */ | |
| 28 | −#endif | |
| 29 | − | |
| 30 | −#ifdef HAVE_XEN_PLATFORM_COMPAT_H | |
| 31 | −#include <xen/platform-compat.h> | |
| 32 | −#endif | |
| 26 | +#include <asm/xen/xencomm.h> /* for xencomm_is_phys_contiguous() */ | |
| 33 | 27 | |
| 34 | 28 | static int xencomm_init(struct xencomm_desc *desc, |
| 35 | 29 | void *buffer, unsigned long bytes) |
| @@ -157,20 +151,11 @@ static int xencomm_create(void *buffer, unsigned long bytes, · 121 unmodified lines | ||
| 157 | 151 | return 0; |
| 158 | 152 | } |
| 159 | 153 | |
| 160 | −/* check if memory address is within VMALLOC region */ | |
| 161 | −static int is_phys_contiguous(unsigned long addr) | |
| 162 | −{ | |
| 163 | − if (!is_kernel_addr(addr)) | |
| 164 | − return 0; | |
| 165 | − | |
| 166 | − return (addr < VMALLOC_START) || (addr >= VMALLOC_END); | |
| 167 | −} | |
| 168 | − | |
| 169 | 154 | static struct xencomm_handle *xencomm_create_inline(void *ptr) |
| 170 | 155 | { |
| 171 | 156 | unsigned long paddr; |
| 172 | 157 | |
| 173 | − BUG_ON(!is_phys_contiguous((unsigned long)ptr)); | |
| 158 | + BUG_ON(!xencomm_is_phys_contiguous((unsigned long)ptr)); | |
| 174 | 159 | |
| 175 | 160 | paddr = (unsigned long)xencomm_pa(ptr); |
| 176 | 161 | BUG_ON(paddr & XENCOMM_INLINE_FLAG); |
| @@ -202,7 +187,7 @@ struct xencomm_handle *xencomm_map(void *ptr, unsigned long bytes) · 25 unmodified lines | ||
| 202 | 187 | int rc; |
| 203 | 188 | struct xencomm_desc *desc; |
| 204 | 189 | |
| 205 | − if (is_phys_contiguous((unsigned long)ptr)) | |
| 190 | + if (xencomm_is_phys_contiguous((unsigned long)ptr)) | |
| 206 | 191 | return xencomm_create_inline(ptr); |
| 207 | 192 | |
| 208 | 193 | rc = xencomm_create(ptr, bytes, &desc, GFP_KERNEL); |
| @@ -219,7 +204,7 @@ struct xencomm_handle *__xencomm_map_no_alloc(void *ptr, unsigned long bytes, · 10 unmodified lines | ||
| 219 | 204 | int rc; |
| 220 | 205 | struct xencomm_desc *desc = NULL; |
| 221 | 206 | |
| 222 | − if (is_phys_contiguous((unsigned long)ptr)) | |
| 207 | + if (xencomm_is_phys_contiguous((unsigned long)ptr)) | |
| 223 | 208 | return xencomm_create_inline(ptr); |
| 224 | 209 | |
| 225 | 210 | rc = xencomm_create_mini(ptr, bytes, xc_desc, |
| @@ -2,7 +2,7 @@ · 1 unmodified line | ||
| 2 | 2 | * An implementation of a loadable kernel mode driver providing |
| 3 | 3 | * multiple kernel/user space bidirectional communications links. |
| 4 | 4 | * |
| 5 | − * Author: Alan Cox <alan@redhat.com> | |
| 5 | + * Author: Alan Cox <alan@lxorguk.ukuu.org.uk> | |
| 6 | 6 | * |
| 7 | 7 | * This program is free software; you can redistribute it and/or |
| 8 | 8 | * modify it under the terms of the GNU General Public License |
| @@ -1251,6 +1251,7 @@ struct kmem_cache *ecryptfs_header_cache_2; · 1250 unmodified lines | ||
| 1251 | 1251 | /** |
| 1252 | 1252 | * ecryptfs_write_headers_virt |
| 1253 | 1253 | * @page_virt: The virtual address to write the headers to |
| 1254 | + * @max: The size of memory allocated at page_virt | |
| 1254 | 1255 | * @size: Set to the number of bytes written by this function |
| 1255 | 1256 | * @crypt_stat: The cryptographic context |
| 1256 | 1257 | * @ecryptfs_dentry: The eCryptfs dentry |
| @@ -1278,7 +1279,8 @@ struct kmem_cache *ecryptfs_header_cache_2; · 21 unmodified lines | ||
| 1278 | 1279 | * |
| 1279 | 1280 | * Returns zero on success |
| 1280 | 1281 | */ |
| 1281 | −static int ecryptfs_write_headers_virt(char *page_virt, size_t *size, | |
| 1282 | +static int ecryptfs_write_headers_virt(char *page_virt, size_t max, | |
| 1283 | + size_t *size, | |
| 1282 | 1284 | struct ecryptfs_crypt_stat *crypt_stat, |
| 1283 | 1285 | struct dentry *ecryptfs_dentry) |
| 1284 | 1286 | { |
| @@ -1296,7 +1298,7 @@ static int ecryptfs_write_headers_virt(char *page_virt, size_t *size, · 11 unmodified lines | ||
| 1296 | 1298 | offset += written; |
| 1297 | 1299 | rc = ecryptfs_generate_key_packet_set((page_virt + offset), crypt_stat, |
| 1298 | 1300 | ecryptfs_dentry, &written, |
| 1299 | − PAGE_CACHE_SIZE - offset); | |
| 1301 | + max - offset); | |
| 1300 | 1302 | if (rc) |
| 1301 | 1303 | ecryptfs_printk(KERN_WARNING, "Error generating key packet " |
| 1302 | 1304 | "set; rc = [%d]\n", rc); |
| @@ -1368,14 +1370,14 @@ int ecryptfs_write_metadata(struct dentry *ecryptfs_dentry) · 65 unmodified lines | ||
| 1368 | 1370 | goto out; |
| 1369 | 1371 | } |
| 1370 | 1372 | /* Released in this function */ |
| 1371 | − virt = kzalloc(crypt_stat->num_header_bytes_at_front, GFP_KERNEL); | |
| 1373 | + virt = (char *)get_zeroed_page(GFP_KERNEL); | |
| 1372 | 1374 | if (!virt) { |
| 1373 | 1375 | printk(KERN_ERR "%s: Out of memory\n", __func__); |
| 1374 | 1376 | rc = -ENOMEM; |
| 1375 | 1377 | goto out; |
| 1376 | 1378 | } |
| 1377 | − rc = ecryptfs_write_headers_virt(virt, &size, crypt_stat, | |
| 1378 | − ecryptfs_dentry); | |
| 1379 | + rc = ecryptfs_write_headers_virt(virt, PAGE_CACHE_SIZE, &size, | |
| 1380 | + crypt_stat, ecryptfs_dentry); | |
| 1379 | 1381 | if (unlikely(rc)) { |
| 1380 | 1382 | printk(KERN_ERR "%s: Error whilst writing headers; rc = [%d]\n", |
| 1381 | 1383 | __func__, rc); |
| @@ -1393,8 +1395,7 @@ int ecryptfs_write_metadata(struct dentry *ecryptfs_dentry) · 11 unmodified lines | ||
| 1393 | 1395 | goto out_free; |
| 1394 | 1396 | } |
| 1395 | 1397 | out_free: |
| 1396 | − memset(virt, 0, crypt_stat->num_header_bytes_at_front); | |
| 1397 | − kfree(virt); | |
| 1398 | + free_page((unsigned long)virt); | |
| 1398 | 1399 | out: |
| 1399 | 1400 | return rc; |
| 1400 | 1401 | } |
| @@ -175,7 +175,7 @@ static ssize_t fat_direct_IO(int rw, struct kiocb *iocb, · 174 unmodified lines | ||
| 175 | 175 | |
| 176 | 176 | if (rw == WRITE) { |
| 177 | 177 | /* |
| 178 | − * FIXME: blockdev_direct_IO() doesn't use ->prepare_write(), | |
| 178 | + * FIXME: blockdev_direct_IO() doesn't use ->write_begin(), | |
| 179 | 179 | * so we need to update the ->mmu_private to block boundary. |
| 180 | 180 | * |
| 181 | 181 | * But we must fill the remaining area or hole by nul for |
| @@ -860,7 +860,6 @@ out: · 859 unmodified lines | ||
| 860 | 860 | * int journal_get_undo_access() - Notify intent to modify metadata with non-rewindable consequences |
| 861 | 861 | * @handle: transaction |
| 862 | 862 | * @bh: buffer to undo |
| 863 | − * @credits: store the number of taken credits here (if not NULL) | |
| 864 | 863 | * |
| 865 | 864 | * Sometimes there is a need to distinguish between metadata which has |
| 866 | 865 | * been committed to disk and that which has not. The ext3fs code uses |
| @@ -814,7 +814,7 @@ EXPORT_SYMBOL(simple_getattr); · 813 unmodified lines | ||
| 814 | 814 | EXPORT_SYMBOL(simple_link); |
| 815 | 815 | EXPORT_SYMBOL(simple_lookup); |
| 816 | 816 | EXPORT_SYMBOL(simple_pin_fs); |
| 817 | −EXPORT_SYMBOL(simple_prepare_write); | |
| 817 | +EXPORT_UNUSED_SYMBOL(simple_prepare_write); | |
| 818 | 818 | EXPORT_SYMBOL(simple_readpage); |
| 819 | 819 | EXPORT_SYMBOL(simple_release_fs); |
| 820 | 820 | EXPORT_SYMBOL(simple_rename); |
| @@ -5,7 +5,7 @@ · 4 unmodified lines | ||
| 5 | 5 | * |
| 6 | 6 | * nfs inode and superblock handling functions |
| 7 | 7 | * |
| 8 | − * Modularised by Alan Cox <Alan.Cox@linux.org>, while hacking some | |
| 8 | + * Modularised by Alan Cox <alan@lxorguk.ukuu.org.uk>, while hacking some | |
| 9 | 9 | * experimental NFS changes. Modularisation taken straight from SYS5 fs. |
| 10 | 10 | * |
| 11 | 11 | * Change to nfs_read_super() to permit NFS mounts to multi-homed hosts. |
| @@ -5,7 +5,7 @@ · 4 unmodified lines | ||
| 5 | 5 | * |
| 6 | 6 | * nfs superblock handling functions |
| 7 | 7 | * |
| 8 | − * Modularised by Alan Cox <Alan.Cox@linux.org>, while hacking some | |
| 8 | + * Modularised by Alan Cox <alan@lxorguk.ukuu.org.uk>, while hacking some | |
| 9 | 9 | * experimental NFS changes. Modularisation taken straight from SYS5 fs. |
| 10 | 10 | * |
| 11 | 11 | * Change to nfs_read_super() to permit NFS mounts to multi-homed hosts. |
| @@ -679,8 +679,7 @@ leave: · 678 unmodified lines | ||
| 679 | 679 | |
| 680 | 680 | /* Some parts of this taken from generic_cont_expand, which turned out |
| 681 | 681 | * to be too fragile to do exactly what we need without us having to |
| 682 | − * worry about recursive locking in ->prepare_write() and | |
| 683 | − * ->commit_write(). */ | |
| 682 | + * worry about recursive locking in ->write_begin() and ->write_end(). */ | |
| 684 | 683 | static int ocfs2_write_zero_page(struct inode *inode, |
| 685 | 684 | u64 size) |
| 686 | 685 | { |
| @@ -40,7 +40,7 @@ · 39 unmodified lines | ||
| 40 | 40 | * |
| 41 | 41 | * |
| 42 | 42 | * Alan Cox : security fixes. |
| 43 | − * <Alan.Cox@linux.org> | |
| 43 | + * <alan@lxorguk.ukuu.org.uk> | |
| 44 | 44 | * |
| 45 | 45 | * Al Viro : safe handling of mm_struct |
| 46 | 46 | * |
| @@ -731,8 +731,8 @@ ssize_t splice_from_pipe(struct pipe_inode_info *pipe, struct file *out, · 730 unmodified lines | ||
| 731 | 731 | }; |
| 732 | 732 | |
| 733 | 733 | /* |
| 734 | − * The actor worker might be calling ->prepare_write and | |
| 735 | − * ->commit_write. Most of the time, these expect i_mutex to | |
| 734 | + * The actor worker might be calling ->write_begin and | |
| 735 | + * ->write_end. Most of the time, these expect i_mutex to | |
| 736 | 736 | * be held. Since this may result in an ABBA deadlock with |
| 737 | 737 | * pipe->inode, we have to order lock acquiry here. |
| 738 | 738 | */ |
| @@ -3,6 +3,7 @@ · 2 unmodified lines | ||
| 3 | 3 | |
| 4 | 4 | enum die_val { |
| 5 | 5 | DIE_UNUSED, |
| 6 | + DIE_OOPS=1 | |
| 6 | 7 | }; |
| 7 | 8 | |
| 8 | 9 | #endif /* _ASM_GENERIC_KDEBUG_H */ |
| @@ -25,7 +25,6 @@ struct cgroup; · 24 unmodified lines | ||
| 25 | 25 | |
| 26 | 26 | extern int cgroup_init_early(void); |
| 27 | 27 | extern int cgroup_init(void); |
| 28 | −extern void cgroup_init_smp(void); | |
| 29 | 28 | extern void cgroup_lock(void); |
| 30 | 29 | extern bool cgroup_lock_live_group(struct cgroup *cgrp); |
| 31 | 30 | extern void cgroup_unlock(void); |
| @@ -348,8 +347,6 @@ struct cgroup_subsys { · 316 unmodified lines | ||
| 348 | 347 | struct cgroupfs_root *root; |
| 349 | 348 | |
| 350 | 349 | struct list_head sibling; |
| 351 | − | |
| 352 | − void *private; | |
| 353 | 350 | }; |
| 354 | 351 | |
| 355 | 352 | #define SUBSYS(_x) extern struct cgroup_subsys _x ## _subsys; |
| @@ -410,7 +407,6 @@ void cgroup_mm_owner_callbacks(struct task_struct *old, · 54 unmodified lines | ||
| 410 | 407 | |
| 411 | 408 | static inline int cgroup_init_early(void) { return 0; } |
| 412 | 409 | static inline int cgroup_init(void) { return 0; } |
| 413 | −static inline void cgroup_init_smp(void) {} | |
| 414 | 410 | static inline void cgroup_fork(struct task_struct *p) {} |
| 415 | 411 | static inline void cgroup_fork_callbacks(struct task_struct *p) {} |
| 416 | 412 | static inline void cgroup_post_fork(struct task_struct *p) {} |
| @@ -44,11 +44,6 @@ static inline bool should_send_signal(struct task_struct *p) · 43 unmodified lines | ||
| 44 | 44 | return !(p->flags & PF_FREEZER_NOSIG); |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | −/* | |
| 48 | − * Wake up a frozen process | |
| 49 | − */ | |
| 50 | −extern int __thaw_process(struct task_struct *p); | |
| 51 | − | |
| 52 | 47 | /* Takes and releases task alloc lock using task_lock() */ |
| 53 | 48 | extern int thaw_process(struct task_struct *p); |
| 54 | 49 | |
| @@ -489,13 +489,6 @@ struct address_space_operations { · 488 unmodified lines | ||
| 489 | 489 | int (*readpages)(struct file *filp, struct address_space *mapping, |
| 490 | 490 | struct list_head *pages, unsigned nr_pages); |
| 491 | 491 | |
| 492 | − /* | |
| 493 | − * ext3 requires that a successful prepare_write() call be followed | |
| 494 | − * by a commit_write() call - they must be balanced | |
| 495 | − */ | |
| 496 | − int (*prepare_write)(struct file *, struct page *, unsigned, unsigned); | |
| 497 | − int (*commit_write)(struct file *, struct page *, unsigned, unsigned); | |
| 498 | − | |
| 499 | 492 | int (*write_begin)(struct file *, struct address_space *mapping, |
| 500 | 493 | loff_t pos, unsigned len, unsigned flags, |
| 501 | 494 | struct page **pagep, void **fsdata); |
| @@ -8,7 +8,7 @@ · 7 unmodified lines | ||
| 8 | 8 | #include <linux/types.h> |
| 9 | 9 | #include <linux/kallsyms.h> |
| 10 | 10 | |
| 11 | −#ifdef CONFIG_FTRACE | |
| 11 | +#ifdef CONFIG_FUNCTION_TRACER | |
| 12 | 12 | |
| 13 | 13 | extern int ftrace_enabled; |
| 14 | 14 | extern int |
| @@ -36,16 +36,14 @@ void clear_ftrace_function(void); · 21 unmodified lines | ||
| 36 | 36 | |
| 37 | 37 | extern void ftrace_stub(unsigned long a0, unsigned long a1); |
| 38 | 38 | |
| 39 | −#else /* !CONFIG_FTRACE */ | |
| 39 | +#else /* !CONFIG_FUNCTION_TRACER */ | |
| 40 | 40 | # define register_ftrace_function(ops) do { } while (0) |
| 41 | 41 | # define unregister_ftrace_function(ops) do { } while (0) |
| 42 | 42 | # define clear_ftrace_function(ops) do { } while (0) |
| 43 | −static inline void ftrace_kill_atomic(void) { } | |
| 44 | −#endif /* CONFIG_FTRACE */ | |
| 43 | +static inline void ftrace_kill(void) { } | |
| 44 | +#endif /* CONFIG_FUNCTION_TRACER */ | |
| 45 | 45 | |
| 46 | 46 | #ifdef CONFIG_DYNAMIC_FTRACE |
| 47 | −# define FTRACE_HASHBITS 10 | |
| 48 | −# define FTRACE_HASHSIZE (1<<FTRACE_HASHBITS) | |
| 49 | 47 | |
| 50 | 48 | enum { |
| 51 | 49 | FTRACE_FL_FREE = (1 << 0), |
| @@ -58,9 +56,9 @@ enum { · 6 unmodified lines | ||
| 58 | 56 | }; |
| 59 | 57 | |
| 60 | 58 | struct dyn_ftrace { |
| 61 | − struct hlist_node node; | |
| 62 | − unsigned long ip; /* address of mcount call-site */ | |
| 63 | − unsigned long flags; | |
| 59 | + struct list_head list; | |
| 60 | + unsigned long ip; /* address of mcount call-site */ | |
| 61 | + unsigned long flags; | |
| 64 | 62 | }; |
| 65 | 63 | |
| 66 | 64 | int ftrace_force_update(void); |
| @@ -71,14 +69,33 @@ extern int ftrace_ip_converted(unsigned long ip); · 4 unmodified lines | ||
| 71 | 69 | extern unsigned char *ftrace_nop_replace(void); |
| 72 | 70 | extern unsigned char *ftrace_call_replace(unsigned long ip, unsigned long addr); |
| 73 | 71 | extern int ftrace_dyn_arch_init(void *data); |
| 74 | −extern int ftrace_mcount_set(unsigned long *data); | |
| 75 | −extern int ftrace_modify_code(unsigned long ip, unsigned char *old_code, | |
| 76 | − unsigned char *new_code); | |
| 77 | 72 | extern int ftrace_update_ftrace_func(ftrace_func_t func); |
| 78 | 73 | extern void ftrace_caller(void); |
| 79 | 74 | extern void ftrace_call(void); |
| 80 | 75 | extern void mcount_call(void); |
| 81 | 76 | |
| 77 | +/** | |
| 78 | + * ftrace_modify_code - modify code segment | |
| 79 | + * @ip: the address of the code segment | |
| 80 | + * @old_code: the contents of what is expected to be there | |
| 81 | + * @new_code: the code to patch in | |
| 82 | + * | |
| 83 | + * This is a very sensitive operation and great care needs | |
| 84 | + * to be taken by the arch. The operation should carefully | |
| 85 | + * read the location, check to see if what is read is indeed | |
| 86 | + * what we expect it to be, and then on success of the compare, | |
| 87 | + * it should write to the location. | |
| 88 | + * | |
| 89 | + * Return must be: | |
| 90 | + * 0 on success | |
| 91 | + * -EFAULT on error reading the location | |
| 92 | + * -EINVAL on a failed compare of the contents | |
| 93 | + * -EPERM on error writing to the location | |
| 94 | + * Any other value will be considered a failure. | |
| 95 | + */ | |
| 96 | +extern int ftrace_modify_code(unsigned long ip, unsigned char *old_code, | |
| 97 | + unsigned char *new_code); | |
| 98 | + | |
| 82 | 99 | extern int skip_trace(unsigned long ip); |
| 83 | 100 | |
| 84 | 101 | extern void ftrace_release(void *start, unsigned long size); |
| @@ -97,11 +114,10 @@ static inline void ftrace_release(void *start, unsigned long size) { } · 12 unmodified lines | ||
| 97 | 114 | |
| 98 | 115 | /* totally disable ftrace - can not re-enable after this */ |
| 99 | 116 | void ftrace_kill(void); |
| 100 | −void ftrace_kill_atomic(void); | |
| 101 | 117 | |
| 102 | 118 | static inline void tracer_disable(void) |
| 103 | 119 | { |
| 104 | −#ifdef CONFIG_FTRACE | |
| 120 | +#ifdef CONFIG_FUNCTION_TRACER | |
| 105 | 121 | ftrace_enabled = 0; |
| 106 | 122 | #endif |
| 107 | 123 | } |
| @@ -113,7 +129,7 @@ static inline void tracer_disable(void) · 5 unmodified lines | ||
| 113 | 129 | */ |
| 114 | 130 | static inline int __ftrace_enabled_save(void) |
| 115 | 131 | { |
| 116 | −#ifdef CONFIG_FTRACE | |
| 132 | +#ifdef CONFIG_FUNCTION_TRACER | |
| 117 | 133 | int saved_ftrace_enabled = ftrace_enabled; |
| 118 | 134 | ftrace_enabled = 0; |
| 119 | 135 | return saved_ftrace_enabled; |
| @@ -124,7 +140,7 @@ static inline int __ftrace_enabled_save(void) · 4 unmodified lines | ||
| 124 | 140 | |
| 125 | 141 | static inline void __ftrace_enabled_restore(int enabled) |
| 126 | 142 | { |
| 127 | −#ifdef CONFIG_FTRACE | |
| 143 | +#ifdef CONFIG_FUNCTION_TRACER | |
| 128 | 144 | ftrace_enabled = enabled; |
| 129 | 145 | #endif |
| 130 | 146 | } |
| @@ -410,6 +410,7 @@ struct hid_output_fifo { · 409 unmodified lines | ||
| 410 | 410 | #define HID_SUSPENDED 5 |
| 411 | 411 | #define HID_CLEAR_HALT 6 |
| 412 | 412 | #define HID_DISCONNECTED 7 |
| 413 | +#define HID_STARTED 8 | |
| 413 | 414 | |
| 414 | 415 | struct hid_input { |
| 415 | 416 | struct list_head list; |
| @@ -116,6 +116,8 @@ extern int _cond_resched(void); · 115 unmodified lines | ||
| 116 | 116 | # define might_resched() do { } while (0) |
| 117 | 117 | #endif |
| 118 | 118 | |
| 119 | +#ifdef CONFIG_DEBUG_SPINLOCK_SLEEP | |
| 120 | + void __might_sleep(char *file, int line); | |
| 119 | 121 | /** |
| 120 | 122 | * might_sleep - annotation for functions that can sleep |
| 121 | 123 | * |
| @@ -126,8 +128,6 @@ extern int _cond_resched(void); · 4 unmodified lines | ||
| 126 | 128 | * be bitten later when the calling function happens to sleep when it is not |
| 127 | 129 | * supposed to. |
| 128 | 130 | */ |
| 129 | −#ifdef CONFIG_DEBUG_SPINLOCK_SLEEP | |
| 130 | − void __might_sleep(char *file, int line); | |
| 131 | 131 | # define might_sleep() \ |
| 132 | 132 | do { __might_sleep(__FILE__, __LINE__); might_resched(); } while (0) |
| 133 | 133 | #else |
| @@ -489,6 +489,9 @@ struct kvm_assigned_pci_dev { · 488 unmodified lines | ||
| 489 | 489 | __u32 busnr; |
| 490 | 490 | __u32 devfn; |
| 491 | 491 | __u32 flags; |
| 492 | + union { | |
| 493 | + __u32 reserved[12]; | |
| 494 | + }; | |
| 492 | 495 | }; |
| 493 | 496 | |
| 494 | 497 | struct kvm_assigned_irq { |
| @@ -496,6 +499,9 @@ struct kvm_assigned_irq { · 1 unmodified line | ||
| 496 | 499 | __u32 host_irq; |
| 497 | 500 | __u32 guest_irq; |
| 498 | 501 | __u32 flags; |
| 502 | + union { | |
| 503 | + __u32 reserved[12]; | |
| 504 | + }; | |
| 499 | 505 | }; |
| 500 | 506 | |
| 501 | 507 | #define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0) |
| @@ -37,6 +37,8 @@ · 36 unmodified lines | ||
| 37 | 37 | #define KVM_REQ_UNHALT 6 |
| 38 | 38 | #define KVM_REQ_MMU_SYNC 7 |
| 39 | 39 | |
| 40 | +#define KVM_USERSPACE_IRQ_SOURCE_ID 0 | |
| 41 | + | |
| 40 | 42 | struct kvm_vcpu; |
| 41 | 43 | extern struct kmem_cache *kvm_vcpu_cache; |
| 42 | 44 | |
| @@ -306,15 +308,18 @@ struct kvm_assigned_dev_kernel { · 263 unmodified lines | ||
| 306 | 308 | int host_irq; |
| 307 | 309 | int guest_irq; |
| 308 | 310 | int irq_requested; |
| 311 | + int irq_source_id; | |
| 309 | 312 | struct pci_dev *dev; |
| 310 | 313 | struct kvm *kvm; |
| 311 | 314 | }; |
| 312 | −void kvm_set_irq(struct kvm *kvm, int irq, int level); | |
| 315 | +void kvm_set_irq(struct kvm *kvm, int irq_source_id, int irq, int level); | |
| 313 | 316 | void kvm_notify_acked_irq(struct kvm *kvm, unsigned gsi); |
| 314 | 317 | void kvm_register_irq_ack_notifier(struct kvm *kvm, |
| 315 | 318 | struct kvm_irq_ack_notifier *kian); |
| 316 | 319 | void kvm_unregister_irq_ack_notifier(struct kvm *kvm, |
| 317 | 320 | struct kvm_irq_ack_notifier *kian); |
| 321 | +int kvm_request_irq_source_id(struct kvm *kvm); | |
| 322 | +void kvm_free_irq_source_id(struct kvm *kvm, int irq_source_id); | |
| 318 | 323 | |
| 319 | 324 | #ifdef CONFIG_DMAR |
| 320 | 325 | int kvm_iommu_map_pages(struct kvm *kvm, gfn_t base_gfn, |
| @@ -135,6 +135,7 @@ struct usb_device_id { · 134 unmodified lines | ||
| 135 | 135 | |
| 136 | 136 | struct hid_device_id { |
| 137 | 137 | __u16 bus; |
| 138 | + __u16 pad1; | |
| 138 | 139 | __u32 vendor; |
| 139 | 140 | __u32 product; |
| 140 | 141 | kernel_ulong_t driver_data |
| @@ -72,6 +72,7 @@ struct phonetmsg { · 71 unmodified lines | ||
| 72 | 72 | } pn_msg_u; |
| 73 | 73 | }; |
| 74 | 74 | #define PN_COMMON_MESSAGE 0xF0 |
| 75 | +#define PN_COMMGR 0x10 | |
| 75 | 76 | #define PN_PREFIX 0xE0 /* resource for extended messages */ |
| 76 | 77 | #define pn_submsg_id pn_msg_u.base.pn_submsg_id |
| 77 | 78 | #define pn_e_submsg_id pn_msg_u.ext.pn_e_submsg_id |
| @@ -59,10 +59,10 @@ struct rlimit { · 58 unmodified lines | ||
| 59 | 59 | #define _STK_LIM (8*1024*1024) |
| 60 | 60 | |
| 61 | 61 | /* |
| 62 | − * GPG wants 32kB of mlocked memory, to make sure pass phrases | |
| 62 | + * GPG2 wants 64kB of mlocked memory, to make sure pass phrases | |
| 63 | 63 | * and other sensitive information are never written to disk. |
| 64 | 64 | */ |
| 65 | −#define MLOCK_LIMIT (8 * PAGE_SIZE) | |
| 65 | +#define MLOCK_LIMIT ((PAGE_SIZE > 64*1024) ? PAGE_SIZE : 64*1024) | |
| 66 | 66 | |
| 67 | 67 | /* |
| 68 | 68 | * Due to binary compatibility, the actual resource numbers |
| @@ -936,7 +936,6 @@ struct sched_class { · 935 unmodified lines | ||
| 936 | 936 | void (*enqueue_task) (struct rq *rq, struct task_struct *p, int wakeup); |
| 937 | 937 | void (*dequeue_task) (struct rq *rq, struct task_struct *p, int sleep); |
| 938 | 938 | void (*yield_task) (struct rq *rq); |
| 939 | − int (*select_task_rq)(struct task_struct *p, int sync); | |
| 940 | 939 | |
| 941 | 940 | void (*check_preempt_curr) (struct rq *rq, struct task_struct *p, int sync); |
| 942 | 941 | |
| @@ -944,6 +943,8 @@ struct sched_class { · 1 unmodified line | ||
| 944 | 943 | void (*put_prev_task) (struct rq *rq, struct task_struct *p); |
| 945 | 944 | |
| 946 | 945 | #ifdef CONFIG_SMP |
| 946 | + int (*select_task_rq)(struct task_struct *p, int sync); | |
| 947 | + | |
| 947 | 948 | unsigned long (*load_balance) (struct rq *this_rq, int this_cpu, |
| 948 | 949 | struct rq *busiest, unsigned long max_load_move, |
| 949 | 950 | struct sched_domain *sd, enum cpu_idle_type idle, |
| @@ -955,16 +956,17 @@ struct sched_class { · 5 unmodified lines | ||
| 955 | 956 | void (*pre_schedule) (struct rq *this_rq, struct task_struct *task); |
| 956 | 957 | void (*post_schedule) (struct rq *this_rq); |
| 957 | 958 | void (*task_wake_up) (struct rq *this_rq, struct task_struct *task); |
| 958 | −#endif | |
| 959 | 959 | |
| 960 | − void (*set_curr_task) (struct rq *rq); | |
| 961 | − void (*task_tick) (struct rq *rq, struct task_struct *p, int queued); | |
| 962 | − void (*task_new) (struct rq *rq, struct task_struct *p); | |
| 963 | 960 | void (*set_cpus_allowed)(struct task_struct *p, |
| 964 | 961 | const cpumask_t *newmask); |
| 965 | 962 | |
| 966 | 963 | void (*rq_online)(struct rq *rq); |
| 967 | 964 | void (*rq_offline)(struct rq *rq); |
| 965 | +#endif | |
| 966 | + | |
| 967 | + void (*set_curr_task) (struct rq *rq); | |
| 968 | + void (*task_tick) (struct rq *rq, struct task_struct *p, int queued); | |
| 969 | + void (*task_new) (struct rq *rq, struct task_struct *p); | |
| 968 | 970 | |
| 969 | 971 | void (*switched_from) (struct rq *this_rq, struct task_struct *task, |
| 970 | 972 | int running); |
| @@ -1585,6 +1585,7 @@ int security_syslog(int type); · 1584 unmodified lines | ||
| 1585 | 1585 | int security_settime(struct timespec *ts, struct timezone *tz); |
| 1586 | 1586 | int security_vm_enough_memory(long pages); |
| 1587 | 1587 | int security_vm_enough_memory_mm(struct mm_struct *mm, long pages); |
| 1588 | +int security_vm_enough_memory_kern(long pages); | |
| 1588 | 1589 | int security_bprm_alloc(struct linux_binprm *bprm); |
| 1589 | 1590 | void security_bprm_free(struct linux_binprm *bprm); |
| 1590 | 1591 | void security_bprm_apply_creds(struct linux_binprm *bprm, int unsafe); |
| @@ -1820,6 +1821,11 @@ static inline int security_vm_enough_memory(long pages) · 229 unmodified lines | ||
| 1820 | 1821 | return cap_vm_enough_memory(current->mm, pages); |
| 1821 | 1822 | } |
| 1822 | 1823 | |
| 1824 | +static inline int security_vm_enough_memory_kern(long pages) | |
| 1825 | +{ | |
| 1826 | + return cap_vm_enough_memory(current->mm, pages); | |
| 1827 | +} | |
| 1828 | + | |
| 1823 | 1829 | static inline int security_vm_enough_memory_mm(struct mm_struct *mm, long pages) |
| 1824 | 1830 | { |
| 1825 | 1831 | return cap_vm_enough_memory(mm, pages); |
| @@ -18,6 +18,9 @@ · 17 unmodified lines | ||
| 18 | 18 | * duplex (MicroWire) controllers. Provide chipslect() and txrx_bufs(), |
| 19 | 19 | * and custom setup()/cleanup() methods. |
| 20 | 20 | */ |
| 21 | + | |
| 22 | +#include <linux/workqueue.h> | |
| 23 | + | |
| 21 | 24 | struct spi_bitbang { |
| 22 | 25 | struct workqueue_struct *workqueue; |
| 23 | 26 | struct work_struct work; |
| @@ -1474,7 +1474,6 @@ void ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw, · 1473 unmodified lines | ||
| 1474 | 1474 | * ieee80211_beacon_get - beacon generation function |
| 1475 | 1475 | * @hw: pointer obtained from ieee80211_alloc_hw(). |
| 1476 | 1476 | * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. |
| 1477 | − * @control: will be filled with information needed to send this beacon. | |
| 1478 | 1477 | * |
| 1479 | 1478 | * If the beacon frames are generated by the host system (i.e., not in |
| 1480 | 1479 | * hardware/firmware), the low-level driver uses this function to receive |
| @@ -1575,7 +1574,6 @@ __le16 ieee80211_generic_frame_duration(struct ieee80211_hw *hw, · 94 unmodified lines | ||
| 1575 | 1574 | * ieee80211_get_buffered_bc - accessing buffered broadcast and multicast frames |
| 1576 | 1575 | * @hw: pointer as obtained from ieee80211_alloc_hw(). |
| 1577 | 1576 | * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. |
| 1578 | − * @control: will be filled with information needed to send returned frame. | |
| 1579 | 1577 | * |
| 1580 | 1578 | * Function for accessing buffered broadcast and multicast frames. If |
| 1581 | 1579 | * hardware/firmware does not implement buffering of broadcast/multicast |
| @@ -1623,9 +1621,8 @@ unsigned int ieee80211_hdrlen(__le16 fc); · 41 unmodified lines | ||
| 1623 | 1621 | * |
| 1624 | 1622 | * @keyconf: the parameter passed with the set key |
| 1625 | 1623 | * @skb: the skb for which the key is needed |
| 1626 | − * @rc4key: a buffer to which the key will be written | |
| 1627 | 1624 | * @type: TBD |
| 1628 | − * @key: TBD | |
| 1625 | + * @key: a buffer to which the key will be written | |
| 1629 | 1626 | */ |
| 1630 | 1627 | void ieee80211_get_tkip_key(struct ieee80211_key_conf *keyconf, |
| 1631 | 1628 | struct sk_buff *skb, |
| @@ -1726,7 +1723,8 @@ void ieee80211_iterate_active_interfaces_atomic(struct ieee80211_hw *hw, · 94 unmodified lines | ||
| 1726 | 1723 | * @hw: pointer as obtained from ieee80211_alloc_hw(). |
| 1727 | 1724 | * @ra: receiver address of the BA session recipient |
| 1728 | 1725 | * @tid: the TID to BA on. |
| 1729 | − * @return: success if addBA request was sent, failure otherwise | |
| 1726 | + * | |
| 1727 | + * Return: success if addBA request was sent, failure otherwise | |
| 1730 | 1728 | * |
| 1731 | 1729 | * Although mac80211/low level driver/user space application can estimate |
| 1732 | 1730 | * the need to start aggregation on a certain RA/TID, the session level |
| @@ -1764,7 +1762,8 @@ void ieee80211_start_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, const u8 *ra, · 31 unmodified lines | ||
| 1764 | 1762 | * @ra: receiver address of the BA session recipient |
| 1765 | 1763 | * @tid: the TID to stop BA. |
| 1766 | 1764 | * @initiator: if indicates initiator DELBA frame will be sent. |
| 1767 | − * @return: error if no sta with matching da found, success otherwise | |
| 1765 | + * | |
| 1766 | + * Return: error if no sta with matching da found, success otherwise | |
| 1768 | 1767 | * |
| 1769 | 1768 | * Although mac80211/low level driver/user space application can estimate |
| 1770 | 1769 | * the need to stop aggregation on a certain RA/TID, the session level |
| @@ -27,7 +27,7 @@ · 26 unmodified lines | ||
| 27 | 27 | * The lower layers may not require more space, ever. Make sure it's |
| 28 | 28 | * enough. |
| 29 | 29 | */ |
| 30 | −#define MAX_PHONET_HEADER 8 | |
| 30 | +#define MAX_PHONET_HEADER (8 + MAX_HEADER) | |
| 31 | 31 | |
| 32 | 32 | /* |
| 33 | 33 | * Every Phonet* socket has this structure first in its |
| @@ -140,8 +140,18 @@ static inline struct scsi_cmnd *scsi_find_tag(struct scsi_device *sdev, int tag) · 139 unmodified lines | ||
| 140 | 140 | */ |
| 141 | 141 | static inline int scsi_init_shared_tag_map(struct Scsi_Host *shost, int depth) |
| 142 | 142 | { |
| 143 | − shost->bqt = blk_init_tags(depth); | |
| 144 | − return shost->bqt ? 0 : -ENOMEM; | |
| 143 | + /* | |
| 144 | + * If the shared tag map isn't already initialized, do it now. | |
| 145 | + * This saves callers from having to check ->bqt when setting up | |
| 146 | + * devices on the shared host (for libata) | |
| 147 | + */ | |
| 148 | + if (!shost->bqt) { | |
| 149 | + shost->bqt = blk_init_tags(depth); | |
| 150 | + if (!shost->bqt) | |
| 151 | + return -ENOMEM; | |
| 152 | + } | |
| 153 | + | |
| 154 | + return 0; | |
| 145 | 155 | } |
| 146 | 156 | |
| 147 | 157 | /** |
| @@ -28,7 +28,8 @@ · 27 unmodified lines | ||
| 28 | 28 | */ |
| 29 | 29 | #define SOC_SINGLE_VALUE(xreg, xshift, xmax, xinvert) \ |
| 30 | 30 | ((unsigned long)&(struct soc_mixer_control) \ |
| 31 | − {.reg = xreg, .shift = xshift, .max = xmax, .invert = xinvert}) | |
| 31 | + {.reg = xreg, .shift = xshift, .rshift = xshift, .max = xmax, \ | |
| 32 | + .invert = xinvert}) | |
| 32 | 33 | #define SOC_SINGLE_VALUE_EXT(xreg, xmax, xinvert) \ |
| 33 | 34 | ((unsigned long)&(struct soc_mixer_control) \ |
| 34 | 35 | {.reg = xreg, .max = xmax, .invert = xinvert}) |
| @@ -401,16 +401,20 @@ config CGROUP_MEM_RES_CTLR · 400 unmodified lines | ||
| 401 | 401 | depends on CGROUPS && RESOURCE_COUNTERS |
| 402 | 402 | select MM_OWNER |
| 403 | 403 | help |
| 404 | − Provides a memory resource controller that manages both page cache and | |
| 405 | − RSS memory. | |
| 404 | + Provides a memory resource controller that manages both anonymous | |
| 405 | + memory and page cache. (See Documentation/controllers/memory.txt) | |
| 406 | 406 | |
| 407 | 407 | Note that setting this option increases fixed memory overhead |
| 408 | − associated with each page of memory in the system by 4/8 bytes | |
| 409 | − and also increases cache misses because struct page on many 64bit | |
| 410 | − systems will not fit into a single cache line anymore. | |
| 408 | + associated with each page of memory in the system. By this, | |
| 409 | + 20(40)bytes/PAGE_SIZE on 32(64)bit system will be occupied by memory | |
| 410 | + usage tracking struct at boot. Total amount of this is printed out | |
| 411 | + at boot. | |
| 411 | 412 | |
| 412 | 413 | Only enable when you're ok with these trade offs and really |
| 413 | − sure you need the memory resource controller. | |
| 414 | + sure you need the memory resource controller. Even when you enable | |
| 415 | + this, you can set "cgroup_disable=memory" at your boot option to | |
| 416 | + disable memory resource controller and you can avoid overheads. | |
| 417 | + (and lose benefits of memory resource contoller) | |
| 414 | 418 | |
| 415 | 419 | This config option also selects MM_OWNER config option, which |
| 416 | 420 | could in turn add some fork/exit overhead. |
| @@ -1,4 +1,4 @@ | ||
| 1 | − | |
| 1 | +#include <linux/delay.h> | |
| 2 | 2 | #include <linux/raid/md.h> |
| 3 | 3 | #include <linux/delay.h> |
| 4 | 4 | |
| @@ -13,7 +13,7 @@ obj-y = sched.o fork.o exec_domain.o panic.o printk.o \ · 12 unmodified lines | ||
| 13 | 13 | |
| 14 | 14 | CFLAGS_REMOVE_sched.o = -mno-spe |
| 15 | 15 | |
| 16 | −ifdef CONFIG_FTRACE | |
| 16 | +ifdef CONFIG_FUNCTION_TRACER | |
| 17 | 17 | # Do not trace debug files and internal ftrace files |
| 18 | 18 | CFLAGS_REMOVE_lockdep.o = -pg |
| 19 | 19 | CFLAGS_REMOVE_lockdep_proc.o = -pg |
| @@ -88,7 +88,7 @@ obj-$(CONFIG_MARKERS) += marker.o · 68 unmodified lines | ||
| 88 | 88 | obj-$(CONFIG_TRACEPOINTS) += tracepoint.o |
| 89 | 89 | obj-$(CONFIG_LATENCYTOP) += latencytop.o |
| 90 | 90 | obj-$(CONFIG_HAVE_GENERIC_DMA_COHERENT) += dma-coherent.o |
| 91 | −obj-$(CONFIG_FTRACE) += trace/ | |
| 91 | +obj-$(CONFIG_FUNCTION_TRACER) += trace/ | |
| 92 | 92 | obj-$(CONFIG_TRACING) += trace/ |
| 93 | 93 | obj-$(CONFIG_SMP) += sched_cpupri.o |
| 94 | 94 | |
| @@ -162,9 +162,13 @@ static int freezer_can_attach(struct cgroup_subsys *ss, · 161 unmodified lines | ||
| 162 | 162 | struct task_struct *task) |
| 163 | 163 | { |
| 164 | 164 | struct freezer *freezer; |
| 165 | − int retval; | |
| 166 | 165 | |
| 167 | − /* Anything frozen can't move or be moved to/from */ | |
| 166 | + /* | |
| 167 | + * Anything frozen can't move or be moved to/from. | |
| 168 | + * | |
| 169 | + * Since orig_freezer->state == FROZEN means that @task has been | |
| 170 | + * frozen, so it's sufficient to check the latter condition. | |
| 171 | + */ | |
| 168 | 172 | |
| 169 | 173 | if (is_task_frozen_enough(task)) |
| 170 | 174 | return -EBUSY; |
| @@ -173,13 +177,7 @@ static int freezer_can_attach(struct cgroup_subsys *ss, · 2 unmodified lines | ||
| 173 | 177 | if (freezer->state == CGROUP_FROZEN) |
| 174 | 178 | return -EBUSY; |
| 175 | 179 | |
| 176 | − retval = 0; | |
| 177 | − task_lock(task); | |
| 178 | − freezer = task_freezer(task); | |
| 179 | − if (freezer->state == CGROUP_FROZEN) | |
| 180 | − retval = -EBUSY; | |
| 181 | − task_unlock(task); | |
| 182 | − return retval; | |
| 180 | + return 0; | |
| 183 | 181 | } |
| 184 | 182 | |
| 185 | 183 | static void freezer_fork(struct cgroup_subsys *ss, struct task_struct *task) |
| @@ -190,8 +188,9 @@ static void freezer_fork(struct cgroup_subsys *ss, struct task_struct *task) · 4 unmodified lines | ||
| 190 | 188 | freezer = task_freezer(task); |
| 191 | 189 | task_unlock(task); |
| 192 | 190 | |
| 193 | − BUG_ON(freezer->state == CGROUP_FROZEN); | |
| 194 | 191 | spin_lock_irq(&freezer->lock); |
| 192 | + BUG_ON(freezer->state == CGROUP_FROZEN); | |
| 193 | + | |
| 195 | 194 | /* Locking avoids race with FREEZING -> THAWED transitions. */ |
| 196 | 195 | if (freezer->state == CGROUP_FREEZING) |
| 197 | 196 | freeze_task(task, true); |
| @@ -276,25 +275,18 @@ static int try_to_freeze_cgroup(struct cgroup *cgroup, struct freezer *freezer) · 78 unmodified lines | ||
| 276 | 275 | return num_cant_freeze_now ? -EBUSY : 0; |
| 277 | 276 | } |
| 278 | 277 | |
| 279 | −static int unfreeze_cgroup(struct cgroup *cgroup, struct freezer *freezer) | |
| 278 | +static void unfreeze_cgroup(struct cgroup *cgroup, struct freezer *freezer) | |
| 280 | 279 | { |
| 281 | 280 | struct cgroup_iter it; |
| 282 | 281 | struct task_struct *task; |
| 283 | 282 | |
| 284 | 283 | cgroup_iter_start(cgroup, &it); |
| 285 | 284 | while ((task = cgroup_iter_next(cgroup, &it))) { |
| 286 | − int do_wake; | |
| 287 | − | |
| 288 | − task_lock(task); | |
| 289 | − do_wake = __thaw_process(task); | |
| 290 | − task_unlock(task); | |
| 291 | − if (do_wake) | |
| 292 | − wake_up_process(task); | |
| 285 | + thaw_process(task); | |
| 293 | 286 | } |
| 294 | 287 | cgroup_iter_end(cgroup, &it); |
| 295 | − freezer->state = CGROUP_THAWED; | |
| 296 | 288 | |
| 297 | − return 0; | |
| 289 | + freezer->state = CGROUP_THAWED; | |
| 298 | 290 | } |
| 299 | 291 | |
| 300 | 292 | static int freezer_change_state(struct cgroup *cgroup, |
| @@ -304,27 +296,22 @@ static int freezer_change_state(struct cgroup *cgroup, · 3 unmodified lines | ||
| 304 | 296 | int retval = 0; |
| 305 | 297 | |
| 306 | 298 | freezer = cgroup_freezer(cgroup); |
| 299 | + | |
| 307 | 300 | spin_lock_irq(&freezer->lock); |
| 301 | + | |
| 308 | 302 | update_freezer_state(cgroup, freezer); |
| 309 | 303 | if (goal_state == freezer->state) |
| 310 | 304 | goto out; |
| 311 | − switch (freezer->state) { | |
| 305 | + | |
| 306 | + switch (goal_state) { | |
| 312 | 307 | case CGROUP_THAWED: |
| 313 | − retval = try_to_freeze_cgroup(cgroup, freezer); | |
| 308 | + unfreeze_cgroup(cgroup, freezer); | |
| 314 | 309 | break; |
| 315 | − case CGROUP_FREEZING: | |
| 316 | − if (goal_state == CGROUP_FROZEN) { | |
| 317 | − /* Userspace is retrying after | |
| 318 | − * "/bin/echo FROZEN > freezer.state" returned -EBUSY */ | |
| 319 | − retval = try_to_freeze_cgroup(cgroup, freezer); | |
| 320 | − break; | |
| 321 | − } | |
| 322 | − /* state == FREEZING and goal_state == THAWED, so unfreeze */ | |
| 323 | 310 | case CGROUP_FROZEN: |
| 324 | − retval = unfreeze_cgroup(cgroup, freezer); | |
| 311 | + retval = try_to_freeze_cgroup(cgroup, freezer); | |
| 325 | 312 | break; |
| 326 | 313 | default: |
| 327 | − break; | |
| 314 | + BUG(); | |
| 328 | 315 | } |
| 329 | 316 | out: |
| 330 | 317 | spin_unlock_irq(&freezer->lock); |
| @@ -121,16 +121,7 @@ void cancel_freezing(struct task_struct *p) · 120 unmodified lines | ||
| 121 | 121 | } |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | −/* | |
| 125 | − * Wake up a frozen process | |
| 126 | − * | |
| 127 | − * task_lock() is needed to prevent the race with refrigerator() which may | |
| 128 | − * occur if the freezing of tasks fails. Namely, without the lock, if the | |
| 129 | − * freezing of tasks failed, thaw_tasks() might have run before a task in | |
| 130 | − * refrigerator() could call frozen_process(), in which case the task would be | |
| 131 | − * frozen and no one would thaw it. | |
| 132 | − */ | |
| 133 | −int __thaw_process(struct task_struct *p) | |
| 124 | +static int __thaw_process(struct task_struct *p) | |
| 134 | 125 | { |
| 135 | 126 | if (frozen(p)) { |
| 136 | 127 | p->flags &= ~PF_FROZEN; |
| @@ -140,6 +131,15 @@ int __thaw_process(struct task_struct *p) · 3 unmodified lines | ||
| 140 | 131 | return 0; |
| 141 | 132 | } |
| 142 | 133 | |
| 134 | +/* | |
| 135 | + * Wake up a frozen process | |
| 136 | + * | |
| 137 | + * task_lock() is needed to prevent the race with refrigerator() which may | |
| 138 | + * occur if the freezing of tasks fails. Namely, without the lock, if the | |
| 139 | + * freezing of tasks failed, thaw_tasks() might have run before a task in | |
| 140 | + * refrigerator() could call frozen_process(), in which case the task would be | |
| 141 | + * frozen and no one would thaw it. | |
| 142 | + */ | |
| 143 | 143 | int thaw_process(struct task_struct *p) |
| 144 | 144 | { |
| 145 | 145 | task_lock(p); |
| @@ -220,7 +220,7 @@ void unregister_handler_proc(unsigned int irq, struct irqaction *action) · 219 unmodified lines | ||
| 220 | 220 | } |
| 221 | 221 | } |
| 222 | 222 | |
| 223 | −void register_default_affinity_proc(void) | |
| 223 | +static void register_default_affinity_proc(void) | |
| 224 | 224 | { |
| 225 | 225 | #ifdef CONFIG_SMP |
| 226 | 226 | proc_create("irq/default_smp_affinity", 0600, NULL, |
| @@ -2169,12 +2169,11 @@ void early_boot_irqs_on(void) · 2168 unmodified lines | ||
| 2169 | 2169 | /* |
| 2170 | 2170 | * Hardirqs will be enabled: |
| 2171 | 2171 | */ |
| 2172 | −void trace_hardirqs_on_caller(unsigned long a0) | |
| 2172 | +void trace_hardirqs_on_caller(unsigned long ip) | |
| 2173 | 2173 | { |
| 2174 | 2174 | struct task_struct *curr = current; |
| 2175 | − unsigned long ip; | |
| 2176 | 2175 | |
| 2177 | − time_hardirqs_on(CALLER_ADDR0, a0); | |
| 2176 | + time_hardirqs_on(CALLER_ADDR0, ip); | |
| 2178 | 2177 | |
| 2179 | 2178 | if (unlikely(!debug_locks || current->lockdep_recursion)) |
| 2180 | 2179 | return; |
| @@ -2188,7 +2187,6 @@ void trace_hardirqs_on_caller(unsigned long a0) · 7 unmodified lines | ||
| 2188 | 2187 | } |
| 2189 | 2188 | /* we'll do an OFF -> ON transition: */ |
| 2190 | 2189 | curr->hardirqs_enabled = 1; |
| 2191 | − ip = (unsigned long) __builtin_return_address(0); | |
| 2192 | 2190 | |
| 2193 | 2191 | if (DEBUG_LOCKS_WARN_ON(!irqs_disabled())) |
| 2194 | 2192 | return; |
| @@ -2224,11 +2222,11 @@ EXPORT_SYMBOL(trace_hardirqs_on); · 29 unmodified lines | ||
| 2224 | 2222 | /* |
| 2225 | 2223 | * Hardirqs were disabled: |
| 2226 | 2224 | */ |
| 2227 | −void trace_hardirqs_off_caller(unsigned long a0) | |
| 2225 | +void trace_hardirqs_off_caller(unsigned long ip) | |
| 2228 | 2226 | { |
| 2229 | 2227 | struct task_struct *curr = current; |
| 2230 | 2228 | |
| 2231 | − time_hardirqs_off(CALLER_ADDR0, a0); | |
| 2229 | + time_hardirqs_off(CALLER_ADDR0, ip); | |
| 2232 | 2230 | |
| 2233 | 2231 | if (unlikely(!debug_locks || current->lockdep_recursion)) |
| 2234 | 2232 | return; |
| @@ -2241,7 +2239,7 @@ void trace_hardirqs_off_caller(unsigned long a0) · 6 unmodified lines | ||
| 2241 | 2239 | * We have done an ON -> OFF transition: |
| 2242 | 2240 | */ |
| 2243 | 2241 | curr->hardirqs_enabled = 0; |
| 2244 | − curr->hardirq_disable_ip = _RET_IP_; | |
| 2242 | + curr->hardirq_disable_ip = ip; | |
| 2245 | 2243 | curr->hardirq_disable_event = ++curr->irq_events; |
| 2246 | 2244 | debug_atomic_inc(&hardirqs_off_events); |
| 2247 | 2245 | } else |
| @@ -3417,9 +3415,10 @@ retry: · 1169 unmodified lines | ||
| 3417 | 3415 | } |
| 3418 | 3416 | printk(" ignoring it.\n"); |
| 3419 | 3417 | unlock = 0; |
| 3418 | + } else { | |
| 3419 | + if (count != 10) | |
| 3420 | + printk(KERN_CONT " locked it.\n"); | |
| 3420 | 3421 | } |
| 3421 | − if (count != 10) | |
| 3422 | − printk(" locked it.\n"); | |
| 3423 | 3422 | |
| 3424 | 3423 | do_each_thread(g, p) { |
| 3425 | 3424 | /* |
| @@ -232,45 +232,6 @@ static inline void boot_delay_msec(void) · 231 unmodified lines | ||
| 232 | 232 | } |
| 233 | 233 | #endif |
| 234 | 234 | |
| 235 | −/* | |
| 236 | − * Return the number of unread characters in the log buffer. | |
| 237 | − */ | |
| 238 | −static int log_buf_get_len(void) | |
| 239 | −{ | |
| 240 | − return logged_chars; | |
| 241 | −} | |
| 242 | − | |
| 243 | −/* | |
| 244 | − * Copy a range of characters from the log buffer. | |
| 245 | − */ | |
| 246 | −int log_buf_copy(char *dest, int idx, int len) | |
| 247 | −{ | |
| 248 | − int ret, max; | |
| 249 | − bool took_lock = false; | |
| 250 | − | |
| 251 | − if (!oops_in_progress) { | |
| 252 | − spin_lock_irq(&logbuf_lock); | |
| 253 | − took_lock = true; | |
| 254 | − } | |
| 255 | − | |
| 256 | − max = log_buf_get_len(); | |
| 257 | − if (idx < 0 || idx >= max) { | |
| 258 | − ret = -1; | |
| 259 | − } else { | |
| 260 | − if (len > max) | |
| 261 | − len = max; | |
| 262 | − ret = len; | |
| 263 | − idx += (log_end - max); | |
| 264 | − while (len-- > 0) | |
| 265 | − dest[len] = LOG_BUF(idx + len); | |
| 266 | − } | |
| 267 | − | |
| 268 | − if (took_lock) | |
| 269 | − spin_unlock_irq(&logbuf_lock); | |
| 270 | − | |
| 271 | − return ret; | |
| 272 | −} | |
| 273 | − | |
| 274 | 235 | /* |
| 275 | 236 | * Commands to do_syslog: |
| 276 | 237 | * |
| @@ -102,7 +102,7 @@ int profile_setup(char *str) · 101 unmodified lines | ||
| 102 | 102 | __setup("profile=", profile_setup); |
| 103 | 103 | |
| 104 | 104 | |
| 105 | −int profile_init(void) | |
| 105 | +int __ref profile_init(void) | |
| 106 | 106 | { |
| 107 | 107 | int buffer_bytes; |
| 108 | 108 | if (!prof_on) |
| @@ -571,7 +571,7 @@ static void __init __reserve_region_with_split(struct resource *root, · 570 unmodified lines | ||
| 571 | 571 | |
| 572 | 572 | } |
| 573 | 573 | |
| 574 | −void reserve_region_with_split(struct resource *root, | |
| 574 | +void __init reserve_region_with_split(struct resource *root, | |
| 575 | 575 | resource_size_t start, resource_size_t end, |
| 576 | 576 | const char *name) |
| 577 | 577 | { |
| @@ -386,7 +386,6 @@ struct cfs_rq { · 385 unmodified lines | ||
| 386 | 386 | |
| 387 | 387 | u64 exec_clock; |
| 388 | 388 | u64 min_vruntime; |
| 389 | − u64 pair_start; | |
| 390 | 389 | |
| 391 | 390 | struct rb_root tasks_timeline; |
| 392 | 391 | struct rb_node *rb_leftmost; |
| @@ -3344,7 +3343,7 @@ small_imbalance: · 2951 unmodified lines | ||
| 3344 | 3343 | } else |
| 3345 | 3344 | this_load_per_task = cpu_avg_load_per_task(this_cpu); |
| 3346 | 3345 | |
| 3347 | − if (max_load - this_load + 2*busiest_load_per_task >= | |
| 3346 | + if (max_load - this_load + busiest_load_per_task >= | |
| 3348 | 3347 | busiest_load_per_task * imbn) { |
| 3349 | 3348 | *imbalance = busiest_load_per_task; |
| 3350 | 3349 | return busiest; |
| @@ -143,6 +143,49 @@ static inline struct sched_entity *parent_entity(struct sched_entity *se) · 142 unmodified lines | ||
| 143 | 143 | return se->parent; |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | +/* return depth at which a sched entity is present in the hierarchy */ | |
| 147 | +static inline int depth_se(struct sched_entity *se) | |
| 148 | +{ | |
| 149 | + int depth = 0; | |
| 150 | + | |
| 151 | + for_each_sched_entity(se) | |
| 152 | + depth++; | |
| 153 | + | |
| 154 | + return depth; | |
| 155 | +} | |
| 156 | + | |
| 157 | +static void | |
| 158 | +find_matching_se(struct sched_entity **se, struct sched_entity **pse) | |
| 159 | +{ | |
| 160 | + int se_depth, pse_depth; | |
| 161 | + | |
| 162 | + /* | |
| 163 | + * preemption test can be made between sibling entities who are in the | |
| 164 | + * same cfs_rq i.e who have a common parent. Walk up the hierarchy of | |
| 165 | + * both tasks until we find their ancestors who are siblings of common | |
| 166 | + * parent. | |
| 167 | + */ | |
| 168 | + | |
| 169 | + /* First walk up until both entities are at same depth */ | |
| 170 | + se_depth = depth_se(*se); | |
| 171 | + pse_depth = depth_se(*pse); | |
| 172 | + | |
| 173 | + while (se_depth > pse_depth) { | |
| 174 | + se_depth--; | |
| 175 | + *se = parent_entity(*se); | |
| 176 | + } | |
| 177 | + | |
| 178 | + while (pse_depth > se_depth) { | |
| 179 | + pse_depth--; | |
| 180 | + *pse = parent_entity(*pse); | |
| 181 | + } | |
| 182 | + | |
| 183 | + while (!is_same_group(*se, *pse)) { | |
| 184 | + *se = parent_entity(*se); | |
| 185 | + *pse = parent_entity(*pse); | |
| 186 | + } | |
| 187 | +} | |
| 188 | + | |
| 146 | 189 | #else /* CONFIG_FAIR_GROUP_SCHED */ |
| 147 | 190 | |
| 148 | 191 | static inline struct rq *rq_of(struct cfs_rq *cfs_rq) |
| @@ -193,6 +236,11 @@ static inline struct sched_entity *parent_entity(struct sched_entity *se) · 44 unmodified lines | ||
| 193 | 236 | return NULL; |
| 194 | 237 | } |
| 195 | 238 | |
| 239 | +static inline void | |
| 240 | +find_matching_se(struct sched_entity **se, struct sched_entity **pse) | |
| 241 | +{ | |
| 242 | +} | |
| 243 | + | |
| 196 | 244 | #endif /* CONFIG_FAIR_GROUP_SCHED */ |
| 197 | 245 | |
| 198 | 246 | |
| @@ -223,6 +271,27 @@ static inline s64 entity_key(struct cfs_rq *cfs_rq, struct sched_entity *se) · 24 unmodified lines | ||
| 223 | 271 | return se->vruntime - cfs_rq->min_vruntime; |
| 224 | 272 | } |
| 225 | 273 | |
| 274 | +static void update_min_vruntime(struct cfs_rq *cfs_rq) | |
| 275 | +{ | |
| 276 | + u64 vruntime = cfs_rq->min_vruntime; | |
| 277 | + | |
| 278 | + if (cfs_rq->curr) | |
| 279 | + vruntime = cfs_rq->curr->vruntime; | |
| 280 | + | |
| 281 | + if (cfs_rq->rb_leftmost) { | |
| 282 | + struct sched_entity *se = rb_entry(cfs_rq->rb_leftmost, | |
| 283 | + struct sched_entity, | |
| 284 | + run_node); | |
| 285 | + | |
| 286 | + if (vruntime == cfs_rq->min_vruntime) | |
| 287 | + vruntime = se->vruntime; | |
| 288 | + else | |
| 289 | + vruntime = min_vruntime(vruntime, se->vruntime); | |
| 290 | + } | |
| 291 | + | |
| 292 | + cfs_rq->min_vruntime = max_vruntime(cfs_rq->min_vruntime, vruntime); | |
| 293 | +} | |
| 294 | + | |
| 226 | 295 | /* |
| 227 | 296 | * Enqueue an entity into the rb-tree: |
| 228 | 297 | */ |
| @@ -256,15 +325,8 @@ static void __enqueue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se) · 27 unmodified lines | ||
| 256 | 325 | * Maintain a cache of leftmost tree entries (it is frequently |
| 257 | 326 | * used): |
| 258 | 327 | */ |
| 259 | − if (leftmost) { | |
| 328 | + if (leftmost) | |
| 260 | 329 | cfs_rq->rb_leftmost = &se->run_node; |
| 261 | − /* | |
| 262 | − * maintain cfs_rq->min_vruntime to be a monotonic increasing | |
| 263 | − * value tracking the leftmost vruntime in the tree. | |
| 264 | − */ | |
| 265 | − cfs_rq->min_vruntime = | |
| 266 | − max_vruntime(cfs_rq->min_vruntime, se->vruntime); | |
| 267 | − } | |
| 268 | 330 | |
| 269 | 331 | rb_link_node(&se->run_node, parent, link); |
| 270 | 332 | rb_insert_color(&se->run_node, &cfs_rq->tasks_timeline); |
| @@ -274,18 +336,9 @@ static void __dequeue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se) · 3 unmodified lines | ||
| 274 | 336 | { |
| 275 | 337 | if (cfs_rq->rb_leftmost == &se->run_node) { |
| 276 | 338 | struct rb_node *next_node; |
| 277 | − struct sched_entity *next; | |
| 278 | 339 | |
| 279 | 340 | next_node = rb_next(&se->run_node); |
| 280 | 341 | cfs_rq->rb_leftmost = next_node; |
| 281 | − | |
| 282 | − if (next_node) { | |
| 283 | − next = rb_entry(next_node, | |
| 284 | − struct sched_entity, run_node); | |
| 285 | − cfs_rq->min_vruntime = | |
| 286 | − max_vruntime(cfs_rq->min_vruntime, | |
| 287 | − next->vruntime); | |
| 288 | − } | |
| 289 | 342 | } |
| 290 | 343 | |
| 291 | 344 | if (cfs_rq->next == se) |
| @@ -424,6 +477,7 @@ __update_curr(struct cfs_rq *cfs_rq, struct sched_entity *curr, · 132 unmodified lines | ||
| 424 | 477 | schedstat_add(cfs_rq, exec_clock, delta_exec); |
| 425 | 478 | delta_exec_weighted = calc_delta_fair(delta_exec, curr); |
| 426 | 479 | curr->vruntime += delta_exec_weighted; |
| 480 | + update_min_vruntime(cfs_rq); | |
| 427 | 481 | } |
| 428 | 482 | |
| 429 | 483 | static void update_curr(struct cfs_rq *cfs_rq) |
| @@ -613,13 +667,7 @@ static void check_spread(struct cfs_rq *cfs_rq, struct sched_entity *se) · 183 unmodified lines | ||
| 613 | 667 | static void |
| 614 | 668 | place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int initial) |
| 615 | 669 | { |
| 616 | − u64 vruntime; | |
| 617 | − | |
| 618 | − if (first_fair(cfs_rq)) { | |
| 619 | − vruntime = min_vruntime(cfs_rq->min_vruntime, | |
| 620 | − __pick_next_entity(cfs_rq)->vruntime); | |
| 621 | − } else | |
| 622 | − vruntime = cfs_rq->min_vruntime; | |
| 670 | + u64 vruntime = cfs_rq->min_vruntime; | |
| 623 | 671 | |
| 624 | 672 | /* |
| 625 | 673 | * The 'current' period is already promised to the current tasks, |
| @@ -696,6 +744,7 @@ dequeue_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int sleep) · 70 unmodified lines | ||
| 696 | 744 | if (se != cfs_rq->curr) |
| 697 | 745 | __dequeue_entity(cfs_rq, se); |
| 698 | 746 | account_entity_dequeue(cfs_rq, se); |
| 747 | + update_min_vruntime(cfs_rq); | |
| 699 | 748 | } |
| 700 | 749 | |
| 701 | 750 | /* |
| @@ -742,16 +791,14 @@ set_next_entity(struct cfs_rq *cfs_rq, struct sched_entity *se) · 40 unmodified lines | ||
| 742 | 791 | se->prev_sum_exec_runtime = se->sum_exec_runtime; |
| 743 | 792 | } |
| 744 | 793 | |
| 794 | +static int | |
| 795 | +wakeup_preempt_entity(struct sched_entity *curr, struct sched_entity *se); | |
| 796 | + | |
| 745 | 797 | static struct sched_entity * |
| 746 | 798 | pick_next(struct cfs_rq *cfs_rq, struct sched_entity *se) |
| 747 | 799 | { |
| 748 | − struct rq *rq = rq_of(cfs_rq); | |
| 749 | − u64 pair_slice = rq->clock - cfs_rq->pair_start; | |
| 750 | − | |
| 751 | − if (!cfs_rq->next || pair_slice > sysctl_sched_min_granularity) { | |
| 752 | − cfs_rq->pair_start = rq->clock; | |
| 800 | + if (!cfs_rq->next || wakeup_preempt_entity(cfs_rq->next, se) == 1) | |
| 753 | 801 | return se; |
| 754 | − } | |
| 755 | 802 | |
| 756 | 803 | return cfs_rq->next; |
| 757 | 804 | } |
| @@ -1122,10 +1169,9 @@ wake_affine(struct sched_domain *this_sd, struct rq *this_rq, · 364 unmodified lines | ||
| 1122 | 1169 | if (!(this_sd->flags & SD_WAKE_AFFINE) || !sched_feat(AFFINE_WAKEUPS)) |
| 1123 | 1170 | return 0; |
| 1124 | 1171 | |
| 1125 | − if (!sync && sched_feat(SYNC_WAKEUPS) && | |
| 1126 | − curr->se.avg_overlap < sysctl_sched_migration_cost && | |
| 1127 | − p->se.avg_overlap < sysctl_sched_migration_cost) | |
| 1128 | − sync = 1; | |
| 1172 | + if (sync && (curr->se.avg_overlap > sysctl_sched_migration_cost || | |
| 1173 | + p->se.avg_overlap > sysctl_sched_migration_cost)) | |
| 1174 | + sync = 0; | |
| 1129 | 1175 | |
| 1130 | 1176 | /* |
| 1131 | 1177 | * If sync wakeup then subtract the (maximum possible) |
| @@ -1244,12 +1290,41 @@ static unsigned long wakeup_gran(struct sched_entity *se) · 112 unmodified lines | ||
| 1244 | 1290 | * More easily preempt - nice tasks, while not making it harder for |
| 1245 | 1291 | * + nice tasks. |
| 1246 | 1292 | */ |
| 1247 | − if (sched_feat(ASYM_GRAN)) | |
| 1248 | − gran = calc_delta_mine(gran, NICE_0_LOAD, &se->load); | |
| 1293 | + if (!sched_feat(ASYM_GRAN) || se->load.weight > NICE_0_LOAD) | |
| 1294 | + gran = calc_delta_fair(sysctl_sched_wakeup_granularity, se); | |
| 1249 | 1295 | |
| 1250 | 1296 | return gran; |
| 1251 | 1297 | } |
| 1252 | 1298 | |
| 1299 | +/* | |
| 1300 | + * Should 'se' preempt 'curr'. | |
| 1301 | + * | |
| 1302 | + * |s1 | |
| 1303 | + * |s2 | |
| 1304 | + * |s3 | |
| 1305 | + * g | |
| 1306 | + * |<--->|c | |
| 1307 | + * | |
| 1308 | + * w(c, s1) = -1 | |
| 1309 | + * w(c, s2) = 0 | |
| 1310 | + * w(c, s3) = 1 | |
| 1311 | + * | |
| 1312 | + */ | |
| 1313 | +static int | |
| 1314 | +wakeup_preempt_entity(struct sched_entity *curr, struct sched_entity *se) | |
| 1315 | +{ | |
| 1316 | + s64 gran, vdiff = curr->vruntime - se->vruntime; | |
| 1317 | + | |
| 1318 | + if (vdiff <= 0) | |
| 1319 | + return -1; | |
| 1320 | + | |
| 1321 | + gran = wakeup_gran(curr); | |
| 1322 | + if (vdiff > gran) | |
| 1323 | + return 1; | |
| 1324 | + | |
| 1325 | + return 0; | |
| 1326 | +} | |
| 1327 | + | |
| 1253 | 1328 | /* |
| 1254 | 1329 | * Preempt the current task with a newly woken task if needed: |
| 1255 | 1330 | */ |
| @@ -1258,7 +1333,6 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p, int sync) · 2 unmodified lines | ||
| 1258 | 1333 | struct task_struct *curr = rq->curr; |
| 1259 | 1334 | struct cfs_rq *cfs_rq = task_cfs_rq(curr); |
| 1260 | 1335 | struct sched_entity *se = &curr->se, *pse = &p->se; |
| 1261 | − s64 delta_exec; | |
| 1262 | 1336 | |
| 1263 | 1337 | if (unlikely(rt_prio(p->prio))) { |
| 1264 | 1338 | update_rq_clock(rq); |
| @@ -1296,9 +1370,19 @@ static void check_preempt_wakeup(struct rq *rq, struct task_struct *p, int sync) · 31 unmodified lines | ||
| 1296 | 1370 | return; |
| 1297 | 1371 | } |
| 1298 | 1372 | |
| 1299 | − delta_exec = se->sum_exec_runtime - se->prev_sum_exec_runtime; | |
| 1300 | − if (delta_exec > wakeup_gran(pse)) | |
| 1301 | − resched_task(curr); | |
| 1373 | + find_matching_se(&se, &pse); | |
| 1374 | + | |
| 1375 | + while (se) { | |
| 1376 | + BUG_ON(!pse); | |
| 1377 | + | |
| 1378 | + if (wakeup_preempt_entity(se, pse) == 1) { | |
| 1379 | + resched_task(curr); | |
| 1380 | + break; | |
| 1381 | + } | |
| 1382 | + | |
| 1383 | + se = parent_entity(se); | |
| 1384 | + pse = parent_entity(pse); | |
| 1385 | + } | |
| 1302 | 1386 | } |
| 1303 | 1387 | |
| 1304 | 1388 | static struct task_struct *pick_next_task_fair(struct rq *rq) |
| @@ -1594,9 +1678,6 @@ static const struct sched_class fair_sched_class = { · 289 unmodified lines | ||
| 1594 | 1678 | .enqueue_task = enqueue_task_fair, |
| 1595 | 1679 | .dequeue_task = dequeue_task_fair, |
| 1596 | 1680 | .yield_task = yield_task_fair, |
| 1597 | −#ifdef CONFIG_SMP | |
| 1598 | − .select_task_rq = select_task_rq_fair, | |
| 1599 | −#endif /* CONFIG_SMP */ | |
| 1600 | 1681 | |
| 1601 | 1682 | .check_preempt_curr = check_preempt_wakeup, |
| 1602 | 1683 | |
| @@ -1604,6 +1685,8 @@ static const struct sched_class fair_sched_class = { · 1 unmodified line | ||
| 1604 | 1685 | .put_prev_task = put_prev_task_fair, |
| 1605 | 1686 | |
| 1606 | 1687 | #ifdef CONFIG_SMP |
| 1688 | + .select_task_rq = select_task_rq_fair, | |
| 1689 | + | |
| 1607 | 1690 | .load_balance = load_balance_fair, |
| 1608 | 1691 | .move_one_task = move_one_task_fair, |
| 1609 | 1692 | #endif |
| @@ -105,9 +105,6 @@ static const struct sched_class idle_sched_class = { · 104 unmodified lines | ||
| 105 | 105 | |
| 106 | 106 | /* dequeue is not valid, we print a debug message there: */ |
| 107 | 107 | .dequeue_task = dequeue_task_idle, |
| 108 | −#ifdef CONFIG_SMP | |
| 109 | − .select_task_rq = select_task_rq_idle, | |
| 110 | −#endif /* CONFIG_SMP */ | |
| 111 | 108 | |
| 112 | 109 | .check_preempt_curr = check_preempt_curr_idle, |
| 113 | 110 | |
| @@ -115,6 +112,8 @@ static const struct sched_class idle_sched_class = { · 1 unmodified line | ||
| 115 | 112 | .put_prev_task = put_prev_task_idle, |
| 116 | 113 | |
| 117 | 114 | #ifdef CONFIG_SMP |
| 115 | + .select_task_rq = select_task_rq_idle, | |
| 116 | + | |
| 118 | 117 | .load_balance = load_balance_idle, |
| 119 | 118 | .move_one_task = move_one_task_idle, |
| 120 | 119 | #endif |
| @@ -1504,9 +1504,6 @@ static const struct sched_class rt_sched_class = { · 1503 unmodified lines | ||
| 1504 | 1504 | .enqueue_task = enqueue_task_rt, |
| 1505 | 1505 | .dequeue_task = dequeue_task_rt, |
| 1506 | 1506 | .yield_task = yield_task_rt, |
| 1507 | −#ifdef CONFIG_SMP | |
| 1508 | − .select_task_rq = select_task_rq_rt, | |
| 1509 | −#endif /* CONFIG_SMP */ | |
| 1510 | 1507 | |
| 1511 | 1508 | .check_preempt_curr = check_preempt_curr_rt, |
| 1512 | 1509 | |
| @@ -1514,6 +1511,8 @@ static const struct sched_class rt_sched_class = { · 1 unmodified line | ||
| 1514 | 1511 | .put_prev_task = put_prev_task_rt, |
| 1515 | 1512 | |
| 1516 | 1513 | #ifdef CONFIG_SMP |
| 1514 | + .select_task_rq = select_task_rq_rt, | |
| 1515 | + | |
| 1517 | 1516 | .load_balance = load_balance_rt, |
| 1518 | 1517 | .move_one_task = move_one_task_rt, |
| 1519 | 1518 | .set_cpus_allowed = set_cpus_allowed_rt, |
| @@ -1144,7 +1144,8 @@ static int kill_something_info(int sig, struct siginfo *info, pid_t pid) · 1143 unmodified lines | ||
| 1144 | 1144 | struct task_struct * p; |
| 1145 | 1145 | |
| 1146 | 1146 | for_each_process(p) { |
| 1147 | − if (p->pid > 1 && !same_thread_group(p, current)) { | |
| 1147 | + if (task_pid_vnr(p) > 1 && | |
| 1148 | + !same_thread_group(p, current)) { | |
| 1148 | 1149 | int err = group_send_sig_info(sig, info, p); |
| 1149 | 1150 | ++count; |
| 1150 | 1151 | if (err != -EPERM) |
| @@ -474,7 +474,7 @@ static struct ctl_table kern_table[] = { · 473 unmodified lines | ||
| 474 | 474 | .mode = 0644, |
| 475 | 475 | .proc_handler = &proc_dointvec, |
| 476 | 476 | }, |
| 477 | −#ifdef CONFIG_FTRACE | |
| 477 | +#ifdef CONFIG_FUNCTION_TRACER | |
| 478 | 478 | { |
| 479 | 479 | .ctl_name = CTL_UNNUMBERED, |
| 480 | 480 | .procname = "ftrace_enabled", |
| @@ -1,13 +1,13 @@ | ||
| 1 | 1 | # |
| 2 | −# Architectures that offer an FTRACE implementation should select HAVE_FTRACE: | |
| 2 | +# Architectures that offer an FUNCTION_TRACER implementation should | |
| 3 | +# select HAVE_FUNCTION_TRACER: | |
| 3 | 4 | # |
| 4 | 5 | |
| 5 | 6 | config NOP_TRACER |
| 6 | 7 | bool |
| 7 | 8 | |
| 8 | −config HAVE_FTRACE | |
| 9 | +config HAVE_FUNCTION_TRACER | |
| 9 | 10 | bool |
| 10 | − select NOP_TRACER | |
| 11 | 11 | |
| 12 | 12 | config HAVE_DYNAMIC_FTRACE |
| 13 | 13 | bool |
| @@ -27,10 +27,13 @@ config TRACING · 13 unmodified lines | ||
| 27 | 27 | select RING_BUFFER |
| 28 | 28 | select STACKTRACE |
| 29 | 29 | select TRACEPOINTS |
| 30 | + select NOP_TRACER | |
| 31 | + | |
| 32 | +menu "Tracers" | |
| 30 | 33 | |
| 31 | −config FTRACE | |
| 34 | +config FUNCTION_TRACER | |
| 32 | 35 | bool "Kernel Function Tracer" |
| 33 | − depends on HAVE_FTRACE | |
| 36 | + depends on HAVE_FUNCTION_TRACER | |
| 34 | 37 | depends on DEBUG_KERNEL |
| 35 | 38 | select FRAME_POINTER |
| 36 | 39 | select TRACING |
| @@ -49,7 +52,6 @@ config IRQSOFF_TRACER · 12 unmodified lines | ||
| 49 | 52 | default n |
| 50 | 53 | depends on TRACE_IRQFLAGS_SUPPORT |
| 51 | 54 | depends on GENERIC_TIME |
| 52 | − depends on HAVE_FTRACE | |
| 53 | 55 | depends on DEBUG_KERNEL |
| 54 | 56 | select TRACE_IRQFLAGS |
| 55 | 57 | select TRACING |
| @@ -73,7 +75,6 @@ config PREEMPT_TRACER · 17 unmodified lines | ||
| 73 | 75 | default n |
| 74 | 76 | depends on GENERIC_TIME |
| 75 | 77 | depends on PREEMPT |
| 76 | − depends on HAVE_FTRACE | |
| 77 | 78 | depends on DEBUG_KERNEL |
| 78 | 79 | select TRACING |
| 79 | 80 | select TRACER_MAX_TRACE |
| @@ -101,7 +102,6 @@ config SYSPROF_TRACER · 21 unmodified lines | ||
| 101 | 102 | |
| 102 | 103 | config SCHED_TRACER |
| 103 | 104 | bool "Scheduling Latency Tracer" |
| 104 | − depends on HAVE_FTRACE | |
| 105 | 105 | depends on DEBUG_KERNEL |
| 106 | 106 | select TRACING |
| 107 | 107 | select CONTEXT_SWITCH_TRACER |
| @@ -112,7 +112,6 @@ config SCHED_TRACER · 4 unmodified lines | ||
| 112 | 112 | |
| 113 | 113 | config CONTEXT_SWITCH_TRACER |
| 114 | 114 | bool "Trace process context switches" |
| 115 | − depends on HAVE_FTRACE | |
| 116 | 115 | depends on DEBUG_KERNEL |
| 117 | 116 | select TRACING |
| 118 | 117 | select MARKERS |
| @@ -122,9 +121,9 @@ config CONTEXT_SWITCH_TRACER · 3 unmodified lines | ||
| 122 | 121 | |
| 123 | 122 | config BOOT_TRACER |
| 124 | 123 | bool "Trace boot initcalls" |
| 125 | − depends on HAVE_FTRACE | |
| 126 | 124 | depends on DEBUG_KERNEL |
| 127 | 125 | select TRACING |
| 126 | + select CONTEXT_SWITCH_TRACER | |
| 128 | 127 | help |
| 129 | 128 | This tracer helps developers to optimize boot times: it records |
| 130 | 129 | the timings of the initcalls and traces key events and the identity |
| @@ -141,9 +140,9 @@ config BOOT_TRACER · 10 unmodified lines | ||
| 141 | 140 | |
| 142 | 141 | config STACK_TRACER |
| 143 | 142 | bool "Trace max stack" |
| 144 | − depends on HAVE_FTRACE | |
| 143 | + depends on HAVE_FUNCTION_TRACER | |
| 145 | 144 | depends on DEBUG_KERNEL |
| 146 | − select FTRACE | |
| 145 | + select FUNCTION_TRACER | |
| 147 | 146 | select STACKTRACE |
| 148 | 147 | help |
| 149 | 148 | This special tracer records the maximum stack footprint of the |
| @@ -160,7 +159,7 @@ config STACK_TRACER · 10 unmodified lines | ||
| 160 | 159 | |
| 161 | 160 | config DYNAMIC_FTRACE |
| 162 | 161 | bool "enable/disable ftrace tracepoints dynamically" |
| 163 | − depends on FTRACE | |
| 162 | + depends on FUNCTION_TRACER | |
| 164 | 163 | depends on HAVE_DYNAMIC_FTRACE |
| 165 | 164 | depends on DEBUG_KERNEL |
| 166 | 165 | default y |
| @@ -170,7 +169,7 @@ config DYNAMIC_FTRACE · 3 unmodified lines | ||
| 170 | 169 | with a No-Op instruction) as they are called. A table is |
| 171 | 170 | created to dynamically enable them again. |
| 172 | 171 | |
| 173 | − This way a CONFIG_FTRACE kernel is slightly larger, but otherwise | |
| 172 | + This way a CONFIG_FUNCTION_TRACER kernel is slightly larger, but otherwise | |
| 174 | 173 | has native performance as long as no tracing is active. |
| 175 | 174 | |
| 176 | 175 | The changes to the code are done by a kernel thread that |
| @@ -195,3 +194,5 @@ config FTRACE_STARTUP_TEST · 18 unmodified lines | ||
| 195 | 194 | a series of tests are made to verify that the tracer is |
| 196 | 195 | functioning properly. It will do tests on all the configured |
| 197 | 196 | tracers of ftrace. |
| 197 | + | |
| 198 | +endmenu | |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | |
| 2 | 2 | # Do not instrument the tracer itself: |
| 3 | 3 | |
| 4 | −ifdef CONFIG_FTRACE | |
| 4 | +ifdef CONFIG_FUNCTION_TRACER | |
| 5 | 5 | ORIG_CFLAGS := $(KBUILD_CFLAGS) |
| 6 | 6 | KBUILD_CFLAGS = $(subst -pg,,$(ORIG_CFLAGS)) |
| 7 | 7 | |
| @@ -10,13 +10,13 @@ CFLAGS_trace_selftest_dynamic.o = -pg · 2 unmodified lines | ||
| 10 | 10 | obj-y += trace_selftest_dynamic.o |
| 11 | 11 | endif |
| 12 | 12 | |
| 13 | −obj-$(CONFIG_FTRACE) += libftrace.o | |
| 13 | +obj-$(CONFIG_FUNCTION_TRACER) += libftrace.o | |
| 14 | 14 | obj-$(CONFIG_RING_BUFFER) += ring_buffer.o |
| 15 | 15 | |
| 16 | 16 | obj-$(CONFIG_TRACING) += trace.o |
| 17 | 17 | obj-$(CONFIG_CONTEXT_SWITCH_TRACER) += trace_sched_switch.o |
| 18 | 18 | obj-$(CONFIG_SYSPROF_TRACER) += trace_sysprof.o |
| 19 | −obj-$(CONFIG_FTRACE) += trace_functions.o | |
| 19 | +obj-$(CONFIG_FUNCTION_TRACER) += trace_functions.o | |
| 20 | 20 | obj-$(CONFIG_IRQSOFF_TRACER) += trace_irqsoff.o |
| 21 | 21 | obj-$(CONFIG_PREEMPT_TRACER) += trace_irqsoff.o |
| 22 | 22 | obj-$(CONFIG_SCHED_TRACER) += trace_sched_wakeup.o |
| @@ -25,13 +25,24 @@ · 24 unmodified lines | ||
| 25 | 25 | #include <linux/ftrace.h> |
| 26 | 26 | #include <linux/sysctl.h> |
| 27 | 27 | #include <linux/ctype.h> |
| 28 | −#include <linux/hash.h> | |
| 29 | 28 | #include <linux/list.h> |
| 30 | 29 | |
| 31 | 30 | #include <asm/ftrace.h> |
| 32 | 31 | |
| 33 | 32 | #include "trace.h" |
| 34 | 33 | |
| 34 | +#define FTRACE_WARN_ON(cond) \ | |
| 35 | + do { \ | |
| 36 | + if (WARN_ON(cond)) \ | |
| 37 | + ftrace_kill(); \ | |
| 38 | + } while (0) | |
| 39 | + | |
| 40 | +#define FTRACE_WARN_ON_ONCE(cond) \ | |
| 41 | + do { \ | |
| 42 | + if (WARN_ON_ONCE(cond)) \ | |
| 43 | + ftrace_kill(); \ | |
| 44 | + } while (0) | |
| 45 | + | |
| 35 | 46 | /* ftrace_enabled is a method to turn ftrace on or off */ |
| 36 | 47 | int ftrace_enabled __read_mostly; |
| 37 | 48 | static int last_ftrace_enabled; |
| @@ -153,21 +164,8 @@ static int __unregister_ftrace_function(struct ftrace_ops *ops) · 115 unmodified lines | ||
| 153 | 164 | } |
| 154 | 165 | |
| 155 | 166 | #ifdef CONFIG_DYNAMIC_FTRACE |
| 156 | − | |
| 157 | 167 | #ifndef CONFIG_FTRACE_MCOUNT_RECORD |
| 158 | −/* | |
| 159 | − * The hash lock is only needed when the recording of the mcount | |
| 160 | − * callers are dynamic. That is, by the caller themselves and | |
| 161 | − * not recorded via the compilation. | |
| 162 | − */ | |
| 163 | −static DEFINE_SPINLOCK(ftrace_hash_lock); | |
| 164 | −#define ftrace_hash_lock(flags) spin_lock_irqsave(&ftrace_hash_lock, flags) | |
| 165 | −#define ftrace_hash_unlock(flags) \ | |
| 166 | − spin_unlock_irqrestore(&ftrace_hash_lock, flags) | |
| 167 | −#else | |
| 168 | −/* This is protected via the ftrace_lock with MCOUNT_RECORD. */ | |
| 169 | −#define ftrace_hash_lock(flags) do { (void)(flags); } while (0) | |
| 170 | −#define ftrace_hash_unlock(flags) do { } while(0) | |
| 168 | +# error Dynamic ftrace depends on MCOUNT_RECORD | |
| 171 | 169 | #endif |
| 172 | 170 | |
| 173 | 171 | /* |
| @@ -178,8 +176,6 @@ static DEFINE_SPINLOCK(ftrace_hash_lock); · 4 unmodified lines | ||
| 178 | 176 | */ |
| 179 | 177 | static unsigned long mcount_addr = MCOUNT_ADDR; |
| 180 | 178 | |
| 181 | −static struct task_struct *ftraced_task; | |
| 182 | − | |
| 183 | 179 | enum { |
| 184 | 180 | FTRACE_ENABLE_CALLS = (1 << 0), |
| 185 | 181 | FTRACE_DISABLE_CALLS = (1 << 1), |
| @@ -190,13 +186,9 @@ enum { · 4 unmodified lines | ||
| 190 | 186 | |
| 191 | 187 | static int ftrace_filtered; |
| 192 | 188 | static int tracing_on; |
| 193 | −static int frozen_record_count; | |
| 194 | − | |
| 195 | −static struct hlist_head ftrace_hash[FTRACE_HASHSIZE]; | |
| 196 | 189 | |
| 197 | −static DEFINE_PER_CPU(int, ftrace_shutdown_disable_cpu); | |
| 190 | +static LIST_HEAD(ftrace_new_addrs); | |
| 198 | 191 | |
| 199 | −static DEFINE_MUTEX(ftraced_lock); | |
| 200 | 192 | static DEFINE_MUTEX(ftrace_regex_lock); |
| 201 | 193 | |
| 202 | 194 | struct ftrace_page { |
| @@ -214,16 +206,13 @@ struct ftrace_page { · 11 unmodified lines | ||
| 214 | 206 | static struct ftrace_page *ftrace_pages_start; |
| 215 | 207 | static struct ftrace_page *ftrace_pages; |
| 216 | 208 | |
| 217 | −static int ftraced_trigger; | |
| 218 | −static int ftraced_suspend; | |
| 219 | −static int ftraced_stop; | |
| 220 | − | |
| 221 | −static int ftrace_record_suspend; | |
| 222 | − | |
| 223 | 209 | static struct dyn_ftrace *ftrace_free_records; |
| 224 | 210 | |
| 225 | 211 | |
| 226 | 212 | #ifdef CONFIG_KPROBES |
| 213 | + | |
| 214 | +static int frozen_record_count; | |
| 215 | + | |
| 227 | 216 | static inline void freeze_record(struct dyn_ftrace *rec) |
| 228 | 217 | { |
| 229 | 218 | if (!(rec->flags & FTRACE_FL_FROZEN)) { |
| @@ -250,72 +239,6 @@ static inline int record_frozen(struct dyn_ftrace *rec) · 20 unmodified lines | ||
| 250 | 239 | # define record_frozen(rec) ({ 0; }) |
| 251 | 240 | #endif /* CONFIG_KPROBES */ |
| 252 | 241 | |
| 253 | −int skip_trace(unsigned long ip) | |
| 254 | −{ | |
| 255 | − unsigned long fl; | |
| 256 | − struct dyn_ftrace *rec; | |
| 257 | − struct hlist_node *t; | |
| 258 | − struct hlist_head *head; | |
| 259 | − | |
| 260 | − if (frozen_record_count == 0) | |
| 261 | − return 0; | |
| 262 | − | |
| 263 | − head = &ftrace_hash[hash_long(ip, FTRACE_HASHBITS)]; | |
| 264 | − hlist_for_each_entry_rcu(rec, t, head, node) { | |
| 265 | − if (rec->ip == ip) { | |
| 266 | − if (record_frozen(rec)) { | |
| 267 | − if (rec->flags & FTRACE_FL_FAILED) | |
| 268 | − return 1; | |
| 269 | − | |
| 270 | − if (!(rec->flags & FTRACE_FL_CONVERTED)) | |
| 271 | − return 1; | |
| 272 | − | |
| 273 | − if (!tracing_on || !ftrace_enabled) | |
| 274 | − return 1; | |
| 275 | − | |
| 276 | − if (ftrace_filtered) { | |
| 277 | − fl = rec->flags & (FTRACE_FL_FILTER | | |
| 278 | − FTRACE_FL_NOTRACE); | |
| 279 | − if (!fl || (fl & FTRACE_FL_NOTRACE)) | |
| 280 | − return 1; | |
| 281 | − } | |
| 282 | − } | |
| 283 | − break; | |
| 284 | − } | |
| 285 | − } | |
| 286 | − | |
| 287 | − return 0; | |
| 288 | −} | |
| 289 | − | |
| 290 | −static inline int | |
| 291 | −ftrace_ip_in_hash(unsigned long ip, unsigned long key) | |
| 292 | −{ | |
| 293 | − struct dyn_ftrace *p; | |
| 294 | − struct hlist_node *t; | |
| 295 | − int found = 0; | |
| 296 | − | |
| 297 | − hlist_for_each_entry_rcu(p, t, &ftrace_hash[key], node) { | |
| 298 | − if (p->ip == ip) { | |
| 299 | − found = 1; | |
| 300 | − break; | |
| 301 | − } | |
| 302 | − } | |
| 303 | − | |
| 304 | − return found; | |
| 305 | −} | |
| 306 | − | |
| 307 | −static inline void | |
| 308 | −ftrace_add_hash(struct dyn_ftrace *node, unsigned long key) | |
| 309 | −{ | |
| 310 | − hlist_add_head_rcu(&node->node, &ftrace_hash[key]); | |
| 311 | −} | |
| 312 | − | |
| 313 | −/* called from kstop_machine */ | |
| 314 | −static inline void ftrace_del_hash(struct dyn_ftrace *node) | |
| 315 | −{ | |
| 316 | − hlist_del(&node->node); | |
| 317 | −} | |
| 318 | − | |
| 319 | 242 | static void ftrace_free_rec(struct dyn_ftrace *rec) |
| 320 | 243 | { |
| 321 | 244 | rec->ip = (unsigned long)ftrace_free_records; |
| @@ -346,7 +269,6 @@ void ftrace_release(void *start, unsigned long size) · 24 unmodified lines | ||
| 346 | 269 | } |
| 347 | 270 | } |
| 348 | 271 | spin_unlock(&ftrace_lock); |
| 349 | − | |
| 350 | 272 | } |
| 351 | 273 | |
| 352 | 274 | static struct dyn_ftrace *ftrace_alloc_dyn_node(unsigned long ip) |
| @@ -358,10 +280,8 @@ static struct dyn_ftrace *ftrace_alloc_dyn_node(unsigned long ip) · 5 unmodified lines | ||
| 358 | 280 | rec = ftrace_free_records; |
| 359 | 281 | |
| 360 | 282 | if (unlikely(!(rec->flags & FTRACE_FL_FREE))) { |
| 361 | − WARN_ON_ONCE(1); | |
| 283 | + FTRACE_WARN_ON_ONCE(1); | |
| 362 | 284 | ftrace_free_records = NULL; |
| 363 | − ftrace_disabled = 1; | |
| 364 | − ftrace_enabled = 0; | |
| 365 | 285 | return NULL; |
| 366 | 286 | } |
| 367 | 287 | |
| @@ -371,76 +291,36 @@ static struct dyn_ftrace *ftrace_alloc_dyn_node(unsigned long ip) · 3 unmodified lines | ||
| 371 | 291 | } |
| 372 | 292 | |
| 373 | 293 | if (ftrace_pages->index == ENTRIES_PER_PAGE) { |
| 374 | − if (!ftrace_pages->next) | |
| 375 | − return NULL; | |
| 294 | + if (!ftrace_pages->next) { | |
| 295 | + /* allocate another page */ | |
| 296 | + ftrace_pages->next = | |
| 297 | + (void *)get_zeroed_page(GFP_KERNEL); | |
| 298 | + if (!ftrace_pages->next) | |
| 299 | + return NULL; | |
| 300 | + } | |
| 376 | 301 | ftrace_pages = ftrace_pages->next; |
| 377 | 302 | } |
| 378 | 303 | |
| 379 | 304 | return &ftrace_pages->records[ftrace_pages->index++]; |
| 380 | 305 | } |
| 381 | 306 | |
| 382 | −static void | |
| 307 | +static struct dyn_ftrace * | |
| 383 | 308 | ftrace_record_ip(unsigned long ip) |
| 384 | 309 | { |
| 385 | − struct dyn_ftrace *node; | |
| 386 | − unsigned long flags; | |
| 387 | − unsigned long key; | |
| 388 | − int resched; | |
| 389 | − int cpu; | |
| 310 | + struct dyn_ftrace *rec; | |
| 390 | 311 | |
| 391 | 312 | if (!ftrace_enabled || ftrace_disabled) |
| 392 | − return; | |
| 393 | − | |
| 394 | − resched = need_resched(); | |
| 395 | − preempt_disable_notrace(); | |
| 313 | + return NULL; | |
| 396 | 314 | |
| 397 | − /* | |
| 398 | − * We simply need to protect against recursion. | |
| 399 | − * Use the the raw version of smp_processor_id and not | |
| 400 | − * __get_cpu_var which can call debug hooks that can | |
| 401 | − * cause a recursive crash here. | |
| 402 | − */ | |
| 403 | − cpu = raw_smp_processor_id(); | |
| 404 | − per_cpu(ftrace_shutdown_disable_cpu, cpu)++; | |
| 405 | − if (per_cpu(ftrace_shutdown_disable_cpu, cpu) != 1) | |
| 406 | − goto out; | |
| 407 | − | |
| 408 | − if (unlikely(ftrace_record_suspend)) | |
| 409 | − goto out; | |
| 410 | − | |
| 411 | − key = hash_long(ip, FTRACE_HASHBITS); | |
| 412 | − | |
| 413 | − WARN_ON_ONCE(key >= FTRACE_HASHSIZE); | |
| 414 | − | |
| 415 | − if (ftrace_ip_in_hash(ip, key)) | |
| 416 | − goto out; | |
| 417 | − | |
| 418 | − ftrace_hash_lock(flags); | |
| 419 | − | |
| 420 | − /* This ip may have hit the hash before the lock */ | |
| 421 | − if (ftrace_ip_in_hash(ip, key)) | |
| 422 | − goto out_unlock; | |
| 423 | − | |
| 424 | − node = ftrace_alloc_dyn_node(ip); | |
| 425 | − if (!node) | |
| 426 | − goto out_unlock; | |
| 427 | − | |
| 428 | − node->ip = ip; | |
| 429 | − | |
| 430 | − ftrace_add_hash(node, key); | |
| 315 | + rec = ftrace_alloc_dyn_node(ip); | |
| 316 | + if (!rec) | |
| 317 | + return NULL; | |
| 431 | 318 | |
| 432 | − ftraced_trigger = 1; | |
| 319 | + rec->ip = ip; | |
| 433 | 320 | |
| 434 | − out_unlock: | |
| 435 | − ftrace_hash_unlock(flags); | |
| 436 | − out: | |
| 437 | − per_cpu(ftrace_shutdown_disable_cpu, cpu)--; | |
| 321 | + list_add(&rec->list, &ftrace_new_addrs); | |
| 438 | 322 | |
| 439 | − /* prevent recursion with scheduler */ | |
| 440 | − if (resched) | |
| 441 | − preempt_enable_no_resched_notrace(); | |
| 442 | − else | |
| 443 | − preempt_enable_notrace(); | |
| 323 | + return rec; | |
| 444 | 324 | } |
| 445 | 325 | |
| 446 | 326 | #define FTRACE_ADDR ((long)(ftrace_caller)) |
| @@ -559,7 +439,6 @@ static void ftrace_replace_code(int enable) · 112 unmodified lines | ||
| 559 | 439 | rec->flags |= FTRACE_FL_FAILED; |
| 560 | 440 | if ((system_state == SYSTEM_BOOTING) || |
| 561 | 441 | !core_kernel_text(rec->ip)) { |
| 562 | − ftrace_del_hash(rec); | |
| 563 | 442 | ftrace_free_rec(rec); |
| 564 | 443 | } |
| 565 | 444 | } |
| @@ -567,15 +446,6 @@ static void ftrace_replace_code(int enable) · 1 unmodified line | ||
| 567 | 446 | } |
| 568 | 447 | } |
| 569 | 448 | |
| 570 | −static void ftrace_shutdown_replenish(void) | |
| 571 | −{ | |
| 572 | − if (ftrace_pages->next) | |
| 573 | − return; | |
| 574 | − | |
| 575 | − /* allocate another page */ | |
| 576 | − ftrace_pages->next = (void *)get_zeroed_page(GFP_KERNEL); | |
| 577 | −} | |
| 578 | − | |
| 579 | 449 | static void print_ip_ins(const char *fmt, unsigned char *p) |
| 580 | 450 | { |
| 581 | 451 | int i; |
| @@ -591,23 +461,23 @@ ftrace_code_disable(struct dyn_ftrace *rec) · 9 unmodified lines | ||
| 591 | 461 | { |
| 592 | 462 | unsigned long ip; |
| 593 | 463 | unsigned char *nop, *call; |
| 594 | − int failed; | |
| 464 | + int ret; | |
| 595 | 465 | |
| 596 | 466 | ip = rec->ip; |
| 597 | 467 | |
| 598 | 468 | nop = ftrace_nop_replace(); |
| 599 | 469 | call = ftrace_call_replace(ip, mcount_addr); |
| 600 | 470 | |
| 601 | − failed = ftrace_modify_code(ip, call, nop); | |
| 602 | − if (failed) { | |
| 603 | − switch (failed) { | |
| 604 | − case 1: | |
| 605 | − WARN_ON_ONCE(1); | |
| 471 | + ret = ftrace_modify_code(ip, call, nop); | |
| 472 | + if (ret) { | |
| 473 | + switch (ret) { | |
| 474 | + case -EFAULT: | |
| 475 | + FTRACE_WARN_ON_ONCE(1); | |
| 606 | 476 | pr_info("ftrace faulted on modifying "); |
| 607 | 477 | print_ip_sym(ip); |
| 608 | 478 | break; |
| 609 | − case 2: | |
| 610 | − WARN_ON_ONCE(1); | |
| 479 | + case -EINVAL: | |
| 480 | + FTRACE_WARN_ON_ONCE(1); | |
| 611 | 481 | pr_info("ftrace failed to modify "); |
| 612 | 482 | print_ip_sym(ip); |
| 613 | 483 | print_ip_ins(" expected: ", call); |
| @@ -615,6 +485,15 @@ ftrace_code_disable(struct dyn_ftrace *rec) · 1 unmodified line | ||
| 615 | 485 | print_ip_ins(" replace: ", nop); |
| 616 | 486 | printk(KERN_CONT "\n"); |
| 617 | 487 | break; |
| 488 | + case -EPERM: | |
| 489 | + FTRACE_WARN_ON_ONCE(1); | |
| 490 | + pr_info("ftrace faulted on writing "); | |
| 491 | + print_ip_sym(ip); | |
| 492 | + break; | |
| 493 | + default: | |
| 494 | + FTRACE_WARN_ON_ONCE(1); | |
| 495 | + pr_info("ftrace faulted on unknown error "); | |
| 496 | + print_ip_sym(ip); | |
| 618 | 497 | } |
| 619 | 498 | |
| 620 | 499 | rec->flags |= FTRACE_FL_FAILED; |
| @@ -623,19 +502,11 @@ ftrace_code_disable(struct dyn_ftrace *rec) · 2 unmodified lines | ||
| 623 | 502 | return 1; |
| 624 | 503 | } |
| 625 | 504 | |
| 626 | −static int __ftrace_update_code(void *ignore); | |
| 627 | − | |
| 628 | 505 | static int __ftrace_modify_code(void *data) |
| 629 | 506 | { |
| 630 | − unsigned long addr; | |
| 631 | 507 | int *command = data; |
| 632 | 508 | |
| 633 | 509 | if (*command & FTRACE_ENABLE_CALLS) { |
| 634 | − /* | |
| 635 | − * Update any recorded ips now that we have the | |
| 636 | − * machine stopped | |
| 637 | − */ | |
| 638 | − __ftrace_update_code(NULL); | |
| 639 | 510 | ftrace_replace_code(1); |
| 640 | 511 | tracing_on = 1; |
| 641 | 512 | } else if (*command & FTRACE_DISABLE_CALLS) { |
| @@ -646,14 +517,6 @@ static int __ftrace_modify_code(void *data) · 4 unmodified lines | ||
| 646 | 517 | if (*command & FTRACE_UPDATE_TRACE_FUNC) |
| 647 | 518 | ftrace_update_ftrace_func(ftrace_trace_function); |
| 648 | 519 | |
| 649 | − if (*command & FTRACE_ENABLE_MCOUNT) { | |
| 650 | − addr = (unsigned long)ftrace_record_ip; | |
| 651 | − ftrace_mcount_set(&addr); | |
| 652 | − } else if (*command & FTRACE_DISABLE_MCOUNT) { | |
| 653 | − addr = (unsigned long)ftrace_stub; | |
| 654 | − ftrace_mcount_set(&addr); | |
| 655 | − } | |
| 656 | − | |
| 657 | 520 | return 0; |
| 658 | 521 | } |
| 659 | 522 | |
| @@ -662,26 +525,9 @@ static void ftrace_run_update_code(int command) · 2 unmodified lines | ||
| 662 | 525 | stop_machine(__ftrace_modify_code, &command, NULL); |
| 663 | 526 | } |
| 664 | 527 | |
| 665 | −void ftrace_disable_daemon(void) | |
| 666 | −{ | |
| 667 | − /* Stop the daemon from calling kstop_machine */ | |
| 668 | − mutex_lock(&ftraced_lock); | |
| 669 | − ftraced_stop = 1; | |
| 670 | − mutex_unlock(&ftraced_lock); | |
| 671 | − | |
| 672 | − ftrace_force_update(); | |
| 673 | −} | |
| 674 | − | |
| 675 | −void ftrace_enable_daemon(void) | |
| 676 | −{ | |
| 677 | − mutex_lock(&ftraced_lock); | |
| 678 | − ftraced_stop = 0; | |
| 679 | − mutex_unlock(&ftraced_lock); | |
| 680 | − | |
| 681 | − ftrace_force_update(); | |
| 682 | −} | |
| 683 | − | |
| 684 | 528 | static ftrace_func_t saved_ftrace_func; |
| 529 | +static int ftrace_start; | |
| 530 | +static DEFINE_MUTEX(ftrace_start_lock); | |
| 685 | 531 | |
| 686 | 532 | static void ftrace_startup(void) |
| 687 | 533 | { |
| @@ -690,9 +536,9 @@ static void ftrace_startup(void) · 2 unmodified lines | ||
| 690 | 536 | if (unlikely(ftrace_disabled)) |
| 691 | 537 | return; |
| 692 | 538 | |
| 693 | − mutex_lock(&ftraced_lock); | |
| 694 | − ftraced_suspend++; | |
| 695 | − if (ftraced_suspend == 1) | |
| 539 | + mutex_lock(&ftrace_start_lock); | |
| 540 | + ftrace_start++; | |
| 541 | + if (ftrace_start == 1) | |
| 696 | 542 | command |= FTRACE_ENABLE_CALLS; |
| 697 | 543 | |
| 698 | 544 | if (saved_ftrace_func != ftrace_trace_function) { |
| @@ -705,7 +551,7 @@ static void ftrace_startup(void) · 6 unmodified lines | ||
| 705 | 551 | |
| 706 | 552 | ftrace_run_update_code(command); |
| 707 | 553 | out: |
| 708 | − mutex_unlock(&ftraced_lock); | |
| 554 | + mutex_unlock(&ftrace_start_lock); | |
| 709 | 555 | } |
| 710 | 556 | |
| 711 | 557 | static void ftrace_shutdown(void) |
| @@ -715,9 +561,9 @@ static void ftrace_shutdown(void) · 3 unmodified lines | ||
| 715 | 561 | if (unlikely(ftrace_disabled)) |
| 716 | 562 | return; |
| 717 | 563 | |
| 718 | − mutex_lock(&ftraced_lock); | |
| 719 | − ftraced_suspend--; | |
| 720 | − if (!ftraced_suspend) | |
| 564 | + mutex_lock(&ftrace_start_lock); | |
| 565 | + ftrace_start--; | |
| 566 | + if (!ftrace_start) | |
| 721 | 567 | command |= FTRACE_DISABLE_CALLS; |
| 722 | 568 | |
| 723 | 569 | if (saved_ftrace_func != ftrace_trace_function) { |
| @@ -730,7 +576,7 @@ static void ftrace_shutdown(void) · 6 unmodified lines | ||
| 730 | 576 | |
| 731 | 577 | ftrace_run_update_code(command); |
| 732 | 578 | out: |
| 733 | − mutex_unlock(&ftraced_lock); | |
| 579 | + mutex_unlock(&ftrace_start_lock); | |
| 734 | 580 | } |
| 735 | 581 | |
| 736 | 582 | static void ftrace_startup_sysctl(void) |
| @@ -740,15 +586,15 @@ static void ftrace_startup_sysctl(void) · 3 unmodified lines | ||
| 740 | 586 | if (unlikely(ftrace_disabled)) |
| 741 | 587 | return; |
| 742 | 588 | |
| 743 | − mutex_lock(&ftraced_lock); | |
| 589 | + mutex_lock(&ftrace_start_lock); | |
| 744 | 590 | /* Force update next time */ |
| 745 | 591 | saved_ftrace_func = NULL; |
| 746 | − /* ftraced_suspend is true if we want ftrace running */ | |
| 747 | − if (ftraced_suspend) | |
| 592 | + /* ftrace_start is true if we want ftrace running */ | |
| 593 | + if (ftrace_start) | |
| 748 | 594 | command |= FTRACE_ENABLE_CALLS; |
| 749 | 595 | |
| 750 | 596 | ftrace_run_update_code(command); |
| 751 | − mutex_unlock(&ftraced_lock); | |
| 597 | + mutex_unlock(&ftrace_start_lock); | |
| 752 | 598 | } |
| 753 | 599 | |
| 754 | 600 | static void ftrace_shutdown_sysctl(void) |
| @@ -758,112 +604,50 @@ static void ftrace_shutdown_sysctl(void) · 3 unmodified lines | ||
| 758 | 604 | if (unlikely(ftrace_disabled)) |
| 759 | 605 | return; |
| 760 | 606 | |
| 761 | − mutex_lock(&ftraced_lock); | |
| 762 | − /* ftraced_suspend is true if ftrace is running */ | |
| 763 | − if (ftraced_suspend) | |
| 607 | + mutex_lock(&ftrace_start_lock); | |
| 608 | + /* ftrace_start is true if ftrace is running */ | |
| 609 | + if (ftrace_start) | |
| 764 | 610 | command |= FTRACE_DISABLE_CALLS; |
| 765 | 611 | |
| 766 | 612 | ftrace_run_update_code(command); |
| 767 | − mutex_unlock(&ftraced_lock); | |
| 613 | + mutex_unlock(&ftrace_start_lock); | |
| 768 | 614 | } |
| 769 | 615 | |
| 770 | 616 | static cycle_t ftrace_update_time; |
| 771 | 617 | static unsigned long ftrace_update_cnt; |
| 772 | 618 | unsigned long ftrace_update_tot_cnt; |
| 773 | 619 | |
| 774 | −static int __ftrace_update_code(void *ignore) | |
| 620 | +static int ftrace_update_code(void) | |
| 775 | 621 | { |
| 776 | − int i, save_ftrace_enabled; | |
| 622 | + struct dyn_ftrace *p, *t; | |
| 777 | 623 | cycle_t start, stop; |
| 778 | − struct dyn_ftrace *p; | |
| 779 | − struct hlist_node *t, *n; | |
| 780 | − struct hlist_head *head, temp_list; | |
| 781 | − | |
| 782 | − /* Don't be recording funcs now */ | |
| 783 | − ftrace_record_suspend++; | |
| 784 | − save_ftrace_enabled = ftrace_enabled; | |
| 785 | − ftrace_enabled = 0; | |
| 786 | 624 | |
| 787 | 625 | start = ftrace_now(raw_smp_processor_id()); |
| 788 | 626 | ftrace_update_cnt = 0; |
| 789 | 627 | |
| 790 | − /* No locks needed, the machine is stopped! */ | |
| 791 | − for (i = 0; i < FTRACE_HASHSIZE; i++) { | |
| 792 | − INIT_HLIST_HEAD(&temp_list); | |
| 793 | − head = &ftrace_hash[i]; | |
| 628 | + list_for_each_entry_safe(p, t, &ftrace_new_addrs, list) { | |
| 794 | 629 | |
| 795 | − /* all CPUS are stopped, we are safe to modify code */ | |
| 796 | − hlist_for_each_entry_safe(p, t, n, head, node) { | |
| 797 | − /* Skip over failed records which have not been | |
| 798 | − * freed. */ | |
| 799 | − if (p->flags & FTRACE_FL_FAILED) | |
| 800 | − continue; | |
| 630 | + /* If something went wrong, bail without enabling anything */ | |
| 631 | + if (unlikely(ftrace_disabled)) | |
| 632 | + return -1; | |
| 801 | 633 | |
| 802 | − /* Unconverted records are always at the head of the | |
| 803 | − * hash bucket. Once we encounter a converted record, | |
| 804 | − * simply skip over to the next bucket. Saves ftraced | |
| 805 | − * some processor cycles (ftrace does its bid for | |
| 806 | − * global warming :-p ). */ | |
| 807 | − if (p->flags & (FTRACE_FL_CONVERTED)) | |
| 808 | − break; | |
| 634 | + list_del_init(&p->list); | |
| 809 | 635 | |
| 810 | − /* Ignore updates to this record's mcount site. | |
| 811 | − * Reintroduce this record at the head of this | |
| 812 | − * bucket to attempt to "convert" it again if | |
| 813 | − * the kprobe on it is unregistered before the | |
| 814 | − * next run. */ | |
| 815 | − if (get_kprobe((void *)p->ip)) { | |
| 816 | − ftrace_del_hash(p); | |
| 817 | − INIT_HLIST_NODE(&p->node); | |
| 818 | − hlist_add_head(&p->node, &temp_list); | |
| 819 | − freeze_record(p); | |
| 820 | − continue; | |
| 821 | − } else { | |
| 822 | − unfreeze_record(p); | |
| 823 | − } | |
| 824 | − | |
| 825 | − /* convert record (i.e, patch mcount-call with NOP) */ | |
| 826 | − if (ftrace_code_disable(p)) { | |
| 827 | − p->flags |= FTRACE_FL_CONVERTED; | |
| 828 | − ftrace_update_cnt++; | |
| 829 | − } else { | |
| 830 | − if ((system_state == SYSTEM_BOOTING) || | |
| 831 | − !core_kernel_text(p->ip)) { | |
| 832 | − ftrace_del_hash(p); | |
| 833 | − ftrace_free_rec(p); | |
| 834 | − } | |
| 835 | − } | |
| 836 | − } | |
| 837 | − | |
| 838 | − hlist_for_each_entry_safe(p, t, n, &temp_list, node) { | |
| 839 | − hlist_del(&p->node); | |
| 840 | − INIT_HLIST_NODE(&p->node); | |
| 841 | − hlist_add_head(&p->node, head); | |
| 842 | − } | |
| 636 | + /* convert record (i.e, patch mcount-call with NOP) */ | |
| 637 | + if (ftrace_code_disable(p)) { | |
| 638 | + p->flags |= FTRACE_FL_CONVERTED; | |
| 639 | + ftrace_update_cnt++; | |
| 640 | + } else | |
| 641 | + ftrace_free_rec(p); | |
| 843 | 642 | } |
| 844 | 643 | |
| 845 | 644 | stop = ftrace_now(raw_smp_processor_id()); |
| 846 | 645 | ftrace_update_time = stop - start; |
| 847 | 646 | ftrace_update_tot_cnt += ftrace_update_cnt; |
| 848 | − ftraced_trigger = 0; | |
| 849 | − | |
| 850 | − ftrace_enabled = save_ftrace_enabled; | |
| 851 | − ftrace_record_suspend--; | |
| 852 | 647 | |
| 853 | 648 | return 0; |
| 854 | 649 | } |
| 855 | 650 | |
| 856 | −static int ftrace_update_code(void) | |
| 857 | −{ | |
| 858 | − if (unlikely(ftrace_disabled) || | |
| 859 | − !ftrace_enabled || !ftraced_trigger) | |
| 860 | − return 0; | |
| 861 | − | |
| 862 | − stop_machine(__ftrace_update_code, NULL, NULL); | |
| 863 | − | |
| 864 | − return 1; | |
| 865 | −} | |
| 866 | − | |
| 867 | 651 | static int __init ftrace_dyn_table_alloc(unsigned long num_to_init) |
| 868 | 652 | { |
| 869 | 653 | struct ftrace_page *pg; |
| @@ -892,7 +676,7 @@ static int __init ftrace_dyn_table_alloc(unsigned long num_to_init) · 22 unmodified lines | ||
| 892 | 676 | pg = ftrace_pages = ftrace_pages_start; |
| 893 | 677 | |
| 894 | 678 | cnt = num_to_init / ENTRIES_PER_PAGE; |
| 895 | − pr_info("ftrace: allocating %ld hash entries in %d pages\n", | |
| 679 | + pr_info("ftrace: allocating %ld entries in %d pages\n", | |
| 896 | 680 | num_to_init, cnt); |
| 897 | 681 | |
| 898 | 682 | for (i = 0; i < cnt; i++) { |
| @@ -1401,10 +1185,10 @@ ftrace_regex_release(struct inode *inode, struct file *file, int enable) · 502 unmodified lines | ||
| 1401 | 1185 | } |
| 1402 | 1186 | |
| 1403 | 1187 | mutex_lock(&ftrace_sysctl_lock); |
| 1404 | − mutex_lock(&ftraced_lock); | |
| 1405 | − if (iter->filtered && ftraced_suspend && ftrace_enabled) | |
| 1188 | + mutex_lock(&ftrace_start_lock); | |
| 1189 | + if (iter->filtered && ftrace_start && ftrace_enabled) | |
| 1406 | 1190 | ftrace_run_update_code(FTRACE_ENABLE_CALLS); |
| 1407 | − mutex_unlock(&ftraced_lock); | |
| 1191 | + mutex_unlock(&ftrace_start_lock); | |
| 1408 | 1192 | mutex_unlock(&ftrace_sysctl_lock); |
| 1409 | 1193 | |
| 1410 | 1194 | kfree(iter); |
| @@ -1424,55 +1208,6 @@ ftrace_notrace_release(struct inode *inode, struct file *file) · 13 unmodified lines | ||
| 1424 | 1208 | return ftrace_regex_release(inode, file, 0); |
| 1425 | 1209 | } |
| 1426 | 1210 | |
| 1427 | −static ssize_t | |
| 1428 | −ftraced_read(struct file *filp, char __user *ubuf, | |
| 1429 | − size_t cnt, loff_t *ppos) | |
| 1430 | −{ | |
| 1431 | − /* don't worry about races */ | |
| 1432 | − char *buf = ftraced_stop ? "disabled\n" : "enabled\n"; | |
| 1433 | − int r = strlen(buf); | |
| 1434 | − | |
| 1435 | − return simple_read_from_buffer(ubuf, cnt, ppos, buf, r); | |
| 1436 | −} | |
| 1437 | − | |
| 1438 | −static ssize_t | |
| 1439 | −ftraced_write(struct file *filp, const char __user *ubuf, | |
| 1440 | − size_t cnt, loff_t *ppos) | |
| 1441 | −{ | |
| 1442 | − char buf[64]; | |
| 1443 | − long val; | |
| 1444 | − int ret; | |
| 1445 | − | |
| 1446 | − if (cnt >= sizeof(buf)) | |
| 1447 | − return -EINVAL; | |
| 1448 | − | |
| 1449 | − if (copy_from_user(&buf, ubuf, cnt)) | |
| 1450 | − return -EFAULT; | |
| 1451 | − | |
| 1452 | − if (strncmp(buf, "enable", 6) == 0) | |
| 1453 | − val = 1; | |
| 1454 | − else if (strncmp(buf, "disable", 7) == 0) | |
| 1455 | − val = 0; | |
| 1456 | − else { | |
| 1457 | − buf[cnt] = 0; | |
| 1458 | − | |
| 1459 | − ret = strict_strtoul(buf, 10, &val); | |
| 1460 | − if (ret < 0) | |
| 1461 | − return ret; | |
| 1462 | − | |
| 1463 | − val = !!val; | |
| 1464 | − } | |
| 1465 | − | |
| 1466 | − if (val) | |
| 1467 | − ftrace_enable_daemon(); | |
| 1468 | − else | |
| 1469 | − ftrace_disable_daemon(); | |
| 1470 | − | |
| 1471 | − filp->f_pos += cnt; | |
| 1472 | − | |
| 1473 | − return cnt; | |
| 1474 | −} | |
| 1475 | − | |
| 1476 | 1211 | static struct file_operations ftrace_avail_fops = { |
| 1477 | 1212 | .open = ftrace_avail_open, |
| 1478 | 1213 | .read = seq_read, |
| @@ -1503,54 +1238,6 @@ static struct file_operations ftrace_notrace_fops = { · 24 unmodified lines | ||
| 1503 | 1238 | .release = ftrace_notrace_release, |
| 1504 | 1239 | }; |
| 1505 | 1240 | |
| 1506 | −static struct file_operations ftraced_fops = { | |
| 1507 | − .open = tracing_open_generic, | |
| 1508 | − .read = ftraced_read, | |
| 1509 | − .write = ftraced_write, | |
| 1510 | −}; | |
| 1511 | − | |
| 1512 | −/** | |
| 1513 | − * ftrace_force_update - force an update to all recording ftrace functions | |
| 1514 | − */ | |
| 1515 | −int ftrace_force_update(void) | |
| 1516 | −{ | |
| 1517 | − int ret = 0; | |
| 1518 | − | |
| 1519 | − if (unlikely(ftrace_disabled)) | |
| 1520 | − return -ENODEV; | |
| 1521 | − | |
| 1522 | − mutex_lock(&ftrace_sysctl_lock); | |
| 1523 | − mutex_lock(&ftraced_lock); | |
| 1524 | − | |
| 1525 | − /* | |
| 1526 | − * If ftraced_trigger is not set, then there is nothing | |
| 1527 | − * to update. | |
| 1528 | − */ | |
| 1529 | − if (ftraced_trigger && !ftrace_update_code()) | |
| 1530 | − ret = -EBUSY; | |
| 1531 | − | |
| 1532 | − mutex_unlock(&ftraced_lock); | |
| 1533 | − mutex_unlock(&ftrace_sysctl_lock); | |
| 1534 | − | |
| 1535 | − return ret; | |
| 1536 | −} | |
| 1537 | − | |
| 1538 | −static void ftrace_force_shutdown(void) | |
| 1539 | −{ | |
| 1540 | − struct task_struct *task; | |
| 1541 | − int command = FTRACE_DISABLE_CALLS | FTRACE_UPDATE_TRACE_FUNC; | |
| 1542 | − | |
| 1543 | − mutex_lock(&ftraced_lock); | |
| 1544 | − task = ftraced_task; | |
| 1545 | − ftraced_task = NULL; | |
| 1546 | − ftraced_suspend = -1; | |
| 1547 | − ftrace_run_update_code(command); | |
| 1548 | − mutex_unlock(&ftraced_lock); | |
| 1549 | − | |
| 1550 | − if (task) | |
| 1551 | − kthread_stop(task); | |
| 1552 | −} | |
| 1553 | − | |
| 1554 | 1241 | static __init int ftrace_init_debugfs(void) |
| 1555 | 1242 | { |
| 1556 | 1243 | struct dentry *d_tracer; |
| @@ -1581,17 +1268,11 @@ static __init int ftrace_init_debugfs(void) · 24 unmodified lines | ||
| 1581 | 1268 | pr_warning("Could not create debugfs " |
| 1582 | 1269 | "'set_ftrace_notrace' entry\n"); |
| 1583 | 1270 | |
| 1584 | − entry = debugfs_create_file("ftraced_enabled", 0644, d_tracer, | |
| 1585 | − NULL, &ftraced_fops); | |
| 1586 | − if (!entry) | |
| 1587 | − pr_warning("Could not create debugfs " | |
| 1588 | − "'ftraced_enabled' entry\n"); | |
| 1589 | 1271 | return 0; |
| 1590 | 1272 | } |
| 1591 | 1273 | |
| 1592 | 1274 | fs_initcall(ftrace_init_debugfs); |
| 1593 | 1275 | |
| 1594 | −#ifdef CONFIG_FTRACE_MCOUNT_RECORD | |
| 1595 | 1276 | static int ftrace_convert_nops(unsigned long *start, |
| 1596 | 1277 | unsigned long *end) |
| 1597 | 1278 | { |
| @@ -1599,20 +1280,18 @@ static int ftrace_convert_nops(unsigned long *start, · 1 unmodified line | ||
| 1599 | 1280 | unsigned long addr; |
| 1600 | 1281 | unsigned long flags; |
| 1601 | 1282 | |
| 1283 | + mutex_lock(&ftrace_start_lock); | |
| 1602 | 1284 | p = start; |
| 1603 | 1285 | while (p < end) { |
| 1604 | 1286 | addr = ftrace_call_adjust(*p++); |
| 1605 | − /* should not be called from interrupt context */ | |
| 1606 | − spin_lock(&ftrace_lock); | |
| 1607 | 1287 | ftrace_record_ip(addr); |
| 1608 | − spin_unlock(&ftrace_lock); | |
| 1609 | − ftrace_shutdown_replenish(); | |
| 1610 | 1288 | } |
| 1611 | 1289 | |
| 1612 | − /* p is ignored */ | |
| 1290 | + /* disable interrupts to prevent kstop machine */ | |
| 1613 | 1291 | local_irq_save(flags); |
| 1614 | − __ftrace_update_code(p); | |
| 1292 | + ftrace_update_code(); | |
| 1615 | 1293 | local_irq_restore(flags); |
| 1294 | + mutex_unlock(&ftrace_start_lock); | |
| 1616 | 1295 | |
| 1617 | 1296 | return 0; |
| 1618 | 1297 | } |
| @@ -1658,130 +1337,34 @@ void __init ftrace_init(void) · 39 unmodified lines | ||
| 1658 | 1337 | failed: |
| 1659 | 1338 | ftrace_disabled = 1; |
| 1660 | 1339 | } |
| 1661 | −#else /* CONFIG_FTRACE_MCOUNT_RECORD */ | |
| 1662 | −static int ftraced(void *ignore) | |
| 1663 | −{ | |
| 1664 | − unsigned long usecs; | |
| 1665 | − | |
| 1666 | − while (!kthread_should_stop()) { | |
| 1667 | − | |
| 1668 | − set_current_state(TASK_INTERRUPTIBLE); | |
| 1669 | − | |
| 1670 | − /* check once a second */ | |
| 1671 | − schedule_timeout(HZ); | |
| 1672 | 1340 | |
| 1673 | − if (unlikely(ftrace_disabled)) | |
| 1674 | − continue; | |
| 1675 | − | |
| 1676 | − mutex_lock(&ftrace_sysctl_lock); | |
| 1677 | − mutex_lock(&ftraced_lock); | |
| 1678 | − if (!ftraced_suspend && !ftraced_stop && | |
| 1679 | − ftrace_update_code()) { | |
| 1680 | − usecs = nsecs_to_usecs(ftrace_update_time); | |
| 1681 | − if (ftrace_update_tot_cnt > 100000) { | |
| 1682 | − ftrace_update_tot_cnt = 0; | |
| 1683 | − pr_info("hm, dftrace overflow: %lu change%s" | |
| 1684 | − " (%lu total) in %lu usec%s\n", | |
| 1685 | − ftrace_update_cnt, | |
| 1686 | − ftrace_update_cnt != 1 ? "s" : "", | |
| 1687 | − ftrace_update_tot_cnt, | |
| 1688 | − usecs, usecs != 1 ? "s" : ""); | |
| 1689 | − ftrace_disabled = 1; | |
| 1690 | − WARN_ON_ONCE(1); | |
| 1691 | − } | |
| 1692 | − } | |
| 1693 | − mutex_unlock(&ftraced_lock); | |
| 1694 | − mutex_unlock(&ftrace_sysctl_lock); | |
| 1695 | − | |
| 1696 | − ftrace_shutdown_replenish(); | |
| 1697 | − } | |
| 1698 | − __set_current_state(TASK_RUNNING); | |
| 1699 | − return 0; | |
| 1700 | −} | |
| 1341 | +#else | |
| 1701 | 1342 | |
| 1702 | −static int __init ftrace_dynamic_init(void) | |
| 1343 | +static int __init ftrace_nodyn_init(void) | |
| 1703 | 1344 | { |
| 1704 | − struct task_struct *p; | |
| 1705 | − unsigned long addr; | |
| 1706 | − int ret; | |
| 1707 | − | |
| 1708 | − addr = (unsigned long)ftrace_record_ip; | |
| 1709 | − | |
| 1710 | − stop_machine(ftrace_dyn_arch_init, &addr, NULL); | |
| 1711 | − | |
| 1712 | − /* ftrace_dyn_arch_init places the return code in addr */ | |
| 1713 | − if (addr) { | |
| 1714 | − ret = (int)addr; | |
| 1715 | − goto failed; | |
| 1716 | − } | |
| 1717 | − | |
| 1718 | − ret = ftrace_dyn_table_alloc(NR_TO_INIT); | |
| 1719 | − if (ret) | |
| 1720 | − goto failed; | |
| 1721 | − | |
| 1722 | − p = kthread_run(ftraced, NULL, "ftraced"); | |
| 1723 | − if (IS_ERR(p)) { | |
| 1724 | − ret = -1; | |
| 1725 | − goto failed; | |
| 1726 | − } | |
| 1727 | − | |
| 1728 | − last_ftrace_enabled = ftrace_enabled = 1; | |
| 1729 | − ftraced_task = p; | |
| 1730 | − | |
| 1345 | + ftrace_enabled = 1; | |
| 1731 | 1346 | return 0; |
| 1732 | − | |
| 1733 | − failed: | |
| 1734 | − ftrace_disabled = 1; | |
| 1735 | − return ret; | |
| 1736 | 1347 | } |
| 1348 | +device_initcall(ftrace_nodyn_init); | |
| 1737 | 1349 | |
| 1738 | −core_initcall(ftrace_dynamic_init); | |
| 1739 | −#endif /* CONFIG_FTRACE_MCOUNT_RECORD */ | |
| 1740 | − | |
| 1741 | −#else | |
| 1742 | 1350 | # define ftrace_startup() do { } while (0) |
| 1743 | 1351 | # define ftrace_shutdown() do { } while (0) |
| 1744 | 1352 | # define ftrace_startup_sysctl() do { } while (0) |
| 1745 | 1353 | # define ftrace_shutdown_sysctl() do { } while (0) |
| 1746 | −# define ftrace_force_shutdown() do { } while (0) | |
| 1747 | 1354 | #endif /* CONFIG_DYNAMIC_FTRACE */ |
| 1748 | 1355 | |
| 1749 | 1356 | /** |
| 1750 | − * ftrace_kill_atomic - kill ftrace from critical sections | |
| 1357 | + * ftrace_kill - kill ftrace | |
| 1751 | 1358 | * |
| 1752 | 1359 | * This function should be used by panic code. It stops ftrace |
| 1753 | 1360 | * but in a not so nice way. If you need to simply kill ftrace |
| 1754 | 1361 | * from a non-atomic section, use ftrace_kill. |
| 1755 | 1362 | */ |
| 1756 | −void ftrace_kill_atomic(void) | |
| 1757 | −{ | |
| 1758 | − ftrace_disabled = 1; | |
| 1759 | − ftrace_enabled = 0; | |
| 1760 | −#ifdef CONFIG_DYNAMIC_FTRACE | |
| 1761 | − ftraced_suspend = -1; | |
| 1762 | −#endif | |
| 1763 | − clear_ftrace_function(); | |
| 1764 | −} | |
| 1765 | − | |
| 1766 | −/** | |
| 1767 | − * ftrace_kill - totally shutdown ftrace | |
| 1768 | − * | |
| 1769 | − * This is a safety measure. If something was detected that seems | |
| 1770 | − * wrong, calling this function will keep ftrace from doing | |
| 1771 | − * any more modifications, and updates. | |
| 1772 | − * used when something went wrong. | |
| 1773 | − */ | |
| 1774 | 1363 | void ftrace_kill(void) |
| 1775 | 1364 | { |
| 1776 | − mutex_lock(&ftrace_sysctl_lock); | |
| 1777 | 1365 | ftrace_disabled = 1; |
| 1778 | 1366 | ftrace_enabled = 0; |
| 1779 | − | |
| 1780 | 1367 | clear_ftrace_function(); |
| 1781 | − mutex_unlock(&ftrace_sysctl_lock); | |
| 1782 | − | |
| 1783 | − /* Try to totally disable ftrace */ | |
| 1784 | − ftrace_force_shutdown(); | |
| 1785 | 1368 | } |
| 1786 | 1369 | |
| 1787 | 1370 | /** |
| @@ -1870,3 +1453,4 @@ ftrace_enable_sysctl(struct ctl_table *table, int write, · 82 unmodified lines | ||
| 1870 | 1453 | mutex_unlock(&ftrace_sysctl_lock); |
| 1871 | 1454 | return ret; |
| 1872 | 1455 | } |
| 1456 | + | |
| @@ -130,7 +130,7 @@ struct buffer_page { · 129 unmodified lines | ||
| 130 | 130 | static inline void free_buffer_page(struct buffer_page *bpage) |
| 131 | 131 | { |
| 132 | 132 | if (bpage->page) |
| 133 | − __free_page(bpage->page); | |
| 133 | + free_page((unsigned long)bpage->page); | |
| 134 | 134 | kfree(bpage); |
| 135 | 135 | } |
| 136 | 136 | |
| @@ -966,7 +966,9 @@ rb_add_time_stamp(struct ring_buffer_per_cpu *cpu_buffer, · 829 unmodified lines | ||
| 966 | 966 | if (unlikely(*delta > (1ULL << 59) && !once++)) { |
| 967 | 967 | printk(KERN_WARNING "Delta way too big! %llu" |
| 968 | 968 | " ts=%llu write stamp = %llu\n", |
| 969 | − *delta, *ts, cpu_buffer->write_stamp); | |
| 969 | + (unsigned long long)*delta, | |
| 970 | + (unsigned long long)*ts, | |
| 971 | + (unsigned long long)cpu_buffer->write_stamp); | |
| 970 | 972 | WARN_ON(1); |
| 971 | 973 | } |
| 972 | 974 | |
| @@ -34,6 +34,7 @@ · 33 unmodified lines | ||
| 34 | 34 | |
| 35 | 35 | #include <linux/stacktrace.h> |
| 36 | 36 | #include <linux/ring_buffer.h> |
| 37 | +#include <linux/irqflags.h> | |
| 37 | 38 | |
| 38 | 39 | #include "trace.h" |
| 39 | 40 | |
| @@ -873,7 +874,7 @@ ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3) · 833 unmodified lines | ||
| 873 | 874 | preempt_enable_notrace(); |
| 874 | 875 | } |
| 875 | 876 | |
| 876 | −#ifdef CONFIG_FTRACE | |
| 877 | +#ifdef CONFIG_FUNCTION_TRACER | |
| 877 | 878 | static void |
| 878 | 879 | function_trace_call(unsigned long ip, unsigned long parent_ip) |
| 879 | 880 | { |
| @@ -887,9 +888,6 @@ function_trace_call(unsigned long ip, unsigned long parent_ip) · 7 unmodified lines | ||
| 887 | 888 | if (unlikely(!ftrace_function_enabled)) |
| 888 | 889 | return; |
| 889 | 890 | |
| 890 | − if (skip_trace(ip)) | |
| 891 | − return; | |
| 892 | − | |
| 893 | 891 | pc = preempt_count(); |
| 894 | 892 | resched = need_resched(); |
| 895 | 893 | preempt_disable_notrace(); |
| @@ -2401,9 +2399,10 @@ tracing_set_trace_write(struct file *filp, const char __user *ubuf, · 1505 unmodified lines | ||
| 2401 | 2399 | int i; |
| 2402 | 2400 | size_t ret; |
| 2403 | 2401 | |
| 2402 | + ret = cnt; | |
| 2403 | + | |
| 2404 | 2404 | if (cnt > max_tracer_type_len) |
| 2405 | 2405 | cnt = max_tracer_type_len; |
| 2406 | − ret = cnt; | |
| 2407 | 2406 | |
| 2408 | 2407 | if (copy_from_user(&buf, ubuf, cnt)) |
| 2409 | 2408 | return -EFAULT; |
| @@ -2436,8 +2435,8 @@ tracing_set_trace_write(struct file *filp, const char __user *ubuf, · 26 unmodified lines | ||
| 2436 | 2435 | out: |
| 2437 | 2436 | mutex_unlock(&trace_types_lock); |
| 2438 | 2437 | |
| 2439 | − if (ret == cnt) | |
| 2440 | − filp->f_pos += cnt; | |
| 2438 | + if (ret > 0) | |
| 2439 | + filp->f_pos += ret; | |
| 2441 | 2440 | |
| 2442 | 2441 | return ret; |
| 2443 | 2442 | } |
| @@ -3120,7 +3119,7 @@ void ftrace_dump(void) · 676 unmodified lines | ||
| 3120 | 3119 | dump_ran = 1; |
| 3121 | 3120 | |
| 3122 | 3121 | /* No turning back! */ |
| 3123 | − ftrace_kill_atomic(); | |
| 3122 | + ftrace_kill(); | |
| 3124 | 3123 | |
| 3125 | 3124 | for_each_tracing_cpu(cpu) { |
| 3126 | 3125 | atomic_inc(&global_trace.data[cpu]->disabled); |
| @@ -335,7 +335,7 @@ void update_max_tr_single(struct trace_array *tr, · 334 unmodified lines | ||
| 335 | 335 | |
| 336 | 336 | extern cycle_t ftrace_now(int cpu); |
| 337 | 337 | |
| 338 | −#ifdef CONFIG_FTRACE | |
| 338 | +#ifdef CONFIG_FUNCTION_TRACER | |
| 339 | 339 | void tracing_start_function_trace(void); |
| 340 | 340 | void tracing_stop_function_trace(void); |
| 341 | 341 | #else |
| @@ -64,7 +64,7 @@ static void function_trace_ctrl_update(struct trace_array *tr) · 63 unmodified lines | ||
| 64 | 64 | |
| 65 | 65 | static struct tracer function_trace __read_mostly = |
| 66 | 66 | { |
| 67 | − .name = "ftrace", | |
| 67 | + .name = "function", | |
| 68 | 68 | .init = function_trace_init, |
| 69 | 69 | .reset = function_trace_reset, |
| 70 | 70 | .ctrl_update = function_trace_ctrl_update, |
| @@ -63,7 +63,7 @@ irq_trace(void) · 62 unmodified lines | ||
| 63 | 63 | */ |
| 64 | 64 | static __cacheline_aligned_in_smp unsigned long max_sequence; |
| 65 | 65 | |
| 66 | −#ifdef CONFIG_FTRACE | |
| 66 | +#ifdef CONFIG_FUNCTION_TRACER | |
| 67 | 67 | /* |
| 68 | 68 | * irqsoff uses its own tracer function to keep the overhead down: |
| 69 | 69 | */ |
| @@ -104,7 +104,7 @@ static struct ftrace_ops trace_ops __read_mostly = · 34 unmodified lines | ||
| 104 | 104 | { |
| 105 | 105 | .func = irqsoff_tracer_call, |
| 106 | 106 | }; |
| 107 | −#endif /* CONFIG_FTRACE */ | |
| 107 | +#endif /* CONFIG_FUNCTION_TRACER */ | |
| 108 | 108 | |
| 109 | 109 | /* |
| 110 | 110 | * Should this new latency be reported/recorded? |
| @@ -31,7 +31,7 @@ static raw_spinlock_t wakeup_lock = · 30 unmodified lines | ||
| 31 | 31 | |
| 32 | 32 | static void __wakeup_reset(struct trace_array *tr); |
| 33 | 33 | |
| 34 | −#ifdef CONFIG_FTRACE | |
| 34 | +#ifdef CONFIG_FUNCTION_TRACER | |
| 35 | 35 | /* |
| 36 | 36 | * irqsoff uses its own tracer function to keep the overhead down: |
| 37 | 37 | */ |
| @@ -96,7 +96,7 @@ static struct ftrace_ops trace_ops __read_mostly = · 58 unmodified lines | ||
| 96 | 96 | { |
| 97 | 97 | .func = wakeup_tracer_call, |
| 98 | 98 | }; |
| 99 | −#endif /* CONFIG_FTRACE */ | |
| 99 | +#endif /* CONFIG_FUNCTION_TRACER */ | |
| 100 | 100 | |
| 101 | 101 | /* |
| 102 | 102 | * Should this new latency be reported/recorded? |
| @@ -70,7 +70,7 @@ static int trace_test_buffer(struct trace_array *tr, unsigned long *count) · 69 unmodified lines | ||
| 70 | 70 | return ret; |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | −#ifdef CONFIG_FTRACE | |
| 73 | +#ifdef CONFIG_FUNCTION_TRACER | |
| 74 | 74 | |
| 75 | 75 | #ifdef CONFIG_DYNAMIC_FTRACE |
| 76 | 76 | |
| @@ -99,13 +99,6 @@ int trace_selftest_startup_dynamic_tracing(struct tracer *trace, · 22 unmodified lines | ||
| 99 | 99 | /* passed in by parameter to fool gcc from optimizing */ |
| 100 | 100 | func(); |
| 101 | 101 | |
| 102 | − /* update the records */ | |
| 103 | − ret = ftrace_force_update(); | |
| 104 | − if (ret) { | |
| 105 | − printk(KERN_CONT ".. ftraced failed .. "); | |
| 106 | − return ret; | |
| 107 | − } | |
| 108 | − | |
| 109 | 102 | /* |
| 110 | 103 | * Some archs *cough*PowerPC*cough* add charachters to the |
| 111 | 104 | * start of the function names. We simply put a '*' to |
| @@ -183,13 +176,6 @@ trace_selftest_startup_function(struct tracer *trace, struct trace_array *tr) · 71 unmodified lines | ||
| 183 | 176 | /* make sure msleep has been recorded */ |
| 184 | 177 | msleep(1); |
| 185 | 178 | |
| 186 | − /* force the recorded functions to be traced */ | |
| 187 | − ret = ftrace_force_update(); | |
| 188 | − if (ret) { | |
| 189 | − printk(KERN_CONT ".. ftraced failed .. "); | |
| 190 | − return ret; | |
| 191 | − } | |
| 192 | − | |
| 193 | 179 | /* start the tracing */ |
| 194 | 180 | ftrace_enabled = 1; |
| 195 | 181 | tracer_enabled = 1; |
| @@ -226,7 +212,7 @@ trace_selftest_startup_function(struct tracer *trace, struct trace_array *tr) · 30 unmodified lines | ||
| 226 | 212 | |
| 227 | 213 | return ret; |
| 228 | 214 | } |
| 229 | −#endif /* CONFIG_FTRACE */ | |
| 215 | +#endif /* CONFIG_FUNCTION_TRACER */ | |
| 230 | 216 | |
| 231 | 217 | #ifdef CONFIG_IRQSOFF_TRACER |
| 232 | 218 | int |
| @@ -44,6 +44,10 @@ static inline void check_stack(void) · 43 unmodified lines | ||
| 44 | 44 | if (this_size <= max_stack_size) |
| 45 | 45 | return; |
| 46 | 46 | |
| 47 | + /* we do not handle interrupt stacks yet */ | |
| 48 | + if (!object_is_on_stack(&this_size)) | |
| 49 | + return; | |
| 50 | + | |
| 47 | 51 | raw_local_irq_save(flags); |
| 48 | 52 | __raw_spin_lock(&max_stack_lock); |
| 49 | 53 | |
| @@ -131,6 +131,9 @@ tracepoint_entry_remove_probe(struct tracepoint_entry *entry, void *probe) · 130 unmodified lines | ||
| 131 | 131 | |
| 132 | 132 | old = entry->funcs; |
| 133 | 133 | |
| 134 | + if (!old) | |
| 135 | + return NULL; | |
| 136 | + | |
| 134 | 137 | debug_print_probes(entry); |
| 135 | 138 | /* (N -> M), (N > 1, M >= 0) probes */ |
| 136 | 139 | for (nr_probes = 0; old[nr_probes]; nr_probes++) { |
| @@ -388,6 +391,11 @@ int tracepoint_probe_unregister(const char *name, void *probe) · 251 unmodified lines | ||
| 388 | 391 | if (entry->rcu_pending) |
| 389 | 392 | rcu_barrier_sched(); |
| 390 | 393 | old = tracepoint_entry_remove_probe(entry, probe); |
| 394 | + if (!old) { | |
| 395 | + printk(KERN_WARNING "Warning: Trying to unregister a probe" | |
| 396 | + "that doesn't exist\n"); | |
| 397 | + goto end; | |
| 398 | + } | |
| 391 | 399 | mutex_unlock(&tracepoints_mutex); |
| 392 | 400 | tracepoint_update_probes(); /* may update entry */ |
| 393 | 401 | mutex_lock(&tracepoints_mutex); |
| @@ -2,7 +2,7 @@ · 1 unmodified line | ||
| 2 | 2 | # Makefile for some libs needed in the kernel. |
| 3 | 3 | # |
| 4 | 4 | |
| 5 | −ifdef CONFIG_FTRACE | |
| 5 | +ifdef CONFIG_FUNCTION_TRACER | |
| 6 | 6 | ORIG_CFLAGS := $(KBUILD_CFLAGS) |
| 7 | 7 | KBUILD_CFLAGS = $(subst -pg,,$(ORIG_CFLAGS)) |
| 8 | 8 | endif |
| @@ -402,6 +402,8 @@ static int __init dynamic_printk_init(void) · 401 unmodified lines | ||
| 402 | 402 | iter->logical_modname, |
| 403 | 403 | iter->flag_names, iter->hash, iter->hash2); |
| 404 | 404 | } |
| 405 | + if (dynamic_enabled == DYNAMIC_ENABLED_ALL) | |
| 406 | + set_all(true); | |
| 405 | 407 | return 0; |
| 406 | 408 | } |
| 407 | 409 | module_init(dynamic_printk_init); |
| @@ -411,7 +413,7 @@ static int __init dynamic_printk_setup(char *str) · 3 unmodified lines | ||
| 411 | 413 | { |
| 412 | 414 | if (str) |
| 413 | 415 | return -ENOENT; |
| 414 | − set_all(true); | |
| 416 | + dynamic_enabled = DYNAMIC_ENABLED_ALL; | |
| 415 | 417 | return 0; |
| 416 | 418 | } |
| 417 | 419 | /* Use early_param(), so we can get debug output as early as possible */ |
| @@ -497,8 +497,10 @@ swiotlb_alloc_coherent(struct device *hwdev, size_t size, · 496 unmodified lines | ||
| 497 | 497 | printk("hwdev DMA mask = 0x%016Lx, dev_addr = 0x%016Lx\n", |
| 498 | 498 | (unsigned long long)*hwdev->dma_mask, |
| 499 | 499 | (unsigned long long)dev_addr); |
| 500 | − panic("swiotlb_alloc_coherent: allocated memory is out of " | |
| 501 | − "range for device"); | |
| 500 | + | |
| 501 | + /* DMA_TO_DEVICE to avoid memcpy in unmap_single */ | |
| 502 | + unmap_single(hwdev, ret, size, DMA_TO_DEVICE); | |
| 503 | + return NULL; | |
| 502 | 504 | } |
| 503 | 505 | *dma_handle = dev_addr; |
| 504 | 506 | return ret; |
| @@ -2029,48 +2029,8 @@ int pagecache_write_begin(struct file *file, struct address_space *mapping, · 2028 unmodified lines | ||
| 2029 | 2029 | { |
| 2030 | 2030 | const struct address_space_operations *aops = mapping->a_ops; |
| 2031 | 2031 | |
| 2032 | − if (aops->write_begin) { | |
| 2033 | − return aops->write_begin(file, mapping, pos, len, flags, | |
| 2032 | + return aops->write_begin(file, mapping, pos, len, flags, | |
| 2034 | 2033 | pagep, fsdata); |
| 2035 | − } else { | |
| 2036 | − int ret; | |
| 2037 | − pgoff_t index = pos >> PAGE_CACHE_SHIFT; | |
| 2038 | − unsigned offset = pos & (PAGE_CACHE_SIZE - 1); | |
| 2039 | − struct inode *inode = mapping->host; | |
| 2040 | − struct page *page; | |
| 2041 | −again: | |
| 2042 | − page = __grab_cache_page(mapping, index); | |
| 2043 | − *pagep = page; | |
| 2044 | − if (!page) | |
| 2045 | − return -ENOMEM; | |
| 2046 | − | |
| 2047 | − if (flags & AOP_FLAG_UNINTERRUPTIBLE && !PageUptodate(page)) { | |
| 2048 | − /* | |
| 2049 | − * There is no way to resolve a short write situation | |
| 2050 | − * for a !Uptodate page (except by double copying in | |
| 2051 | − * the caller done by generic_perform_write_2copy). | |
| 2052 | − * | |
| 2053 | − * Instead, we have to bring it uptodate here. | |
| 2054 | − */ | |
| 2055 | − ret = aops->readpage(file, page); | |
| 2056 | − page_cache_release(page); | |
| 2057 | − if (ret) { | |
| 2058 | − if (ret == AOP_TRUNCATED_PAGE) | |
| 2059 | − goto again; | |
| 2060 | − return ret; | |
| 2061 | − } | |
| 2062 | − goto again; | |
| 2063 | − } | |
| 2064 | − | |
| 2065 | − ret = aops->prepare_write(file, page, offset, offset+len); | |
| 2066 | − if (ret) { | |
| 2067 | − unlock_page(page); | |
| 2068 | − page_cache_release(page); | |
| 2069 | − if (pos + len > inode->i_size) | |
| 2070 | − vmtruncate(inode, inode->i_size); | |
| 2071 | − } | |
| 2072 | − return ret; | |
| 2073 | − } | |
| 2074 | 2034 | } |
| 2075 | 2035 | EXPORT_SYMBOL(pagecache_write_begin); |
| 2076 | 2036 | |
| @@ -2079,32 +2039,9 @@ int pagecache_write_end(struct file *file, struct address_space *mapping, · 2 unmodified lines | ||
| 2079 | 2039 | struct page *page, void *fsdata) |
| 2080 | 2040 | { |
| 2081 | 2041 | const struct address_space_operations *aops = mapping->a_ops; |
| 2082 | − int ret; | |
| 2083 | − | |
| 2084 | − if (aops->write_end) { | |
| 2085 | − mark_page_accessed(page); | |
| 2086 | − ret = aops->write_end(file, mapping, pos, len, copied, | |
| 2087 | − page, fsdata); | |
| 2088 | − } else { | |
| 2089 | − unsigned offset = pos & (PAGE_CACHE_SIZE - 1); | |
| 2090 | − struct inode *inode = mapping->host; | |
| 2091 | − | |
| 2092 | − flush_dcache_page(page); | |
| 2093 | − ret = aops->commit_write(file, page, offset, offset+len); | |
| 2094 | − unlock_page(page); | |
| 2095 | − mark_page_accessed(page); | |
| 2096 | − page_cache_release(page); | |
| 2097 | − | |
| 2098 | − if (ret < 0) { | |
| 2099 | − if (pos + len > inode->i_size) | |
| 2100 | − vmtruncate(inode, inode->i_size); | |
| 2101 | − } else if (ret > 0) | |
| 2102 | − ret = min_t(size_t, copied, ret); | |
| 2103 | − else | |
| 2104 | − ret = copied; | |
| 2105 | − } | |
| 2106 | 2042 | |
| 2107 | − return ret; | |
| 2043 | + mark_page_accessed(page); | |
| 2044 | + return aops->write_end(file, mapping, pos, len, copied, page, fsdata); | |
| 2108 | 2045 | } |
| 2109 | 2046 | EXPORT_SYMBOL(pagecache_write_end); |
| 2110 | 2047 | |
| @@ -2226,174 +2163,6 @@ repeat: · 115 unmodified lines | ||
| 2226 | 2163 | } |
| 2227 | 2164 | EXPORT_SYMBOL(__grab_cache_page); |
| 2228 | 2165 | |
| 2229 | −static ssize_t generic_perform_write_2copy(struct file *file, | |
| 2230 | − struct iov_iter *i, loff_t pos) | |
| 2231 | −{ | |
| 2232 | − struct address_space *mapping = file->f_mapping; | |
| 2233 | − const struct address_space_operations *a_ops = mapping->a_ops; | |
| 2234 | − struct inode *inode = mapping->host; | |
| 2235 | − long status = 0; | |
| 2236 | − ssize_t written = 0; | |
| 2237 | − | |
| 2238 | − do { | |
| 2239 | − struct page *src_page; | |
| 2240 | − struct page *page; | |
| 2241 | − pgoff_t index; /* Pagecache index for current page */ | |
| 2242 | − unsigned long offset; /* Offset into pagecache page */ | |
| 2243 | − unsigned long bytes; /* Bytes to write to page */ | |
| 2244 | − size_t copied; /* Bytes copied from user */ | |
| 2245 | − | |
| 2246 | − offset = (pos & (PAGE_CACHE_SIZE - 1)); | |
| 2247 | − index = pos >> PAGE_CACHE_SHIFT; | |
| 2248 | − bytes = min_t(unsigned long, PAGE_CACHE_SIZE - offset, | |
| 2249 | − iov_iter_count(i)); | |
| 2250 | − | |
| 2251 | − /* | |
| 2252 | − * a non-NULL src_page indicates that we're doing the | |
| 2253 | − * copy via get_user_pages and kmap. | |
| 2254 | − */ | |
| 2255 | − src_page = NULL; | |
| 2256 | − | |
| 2257 | − /* | |
| 2258 | − * Bring in the user page that we will copy from _first_. | |
| 2259 | − * Otherwise there's a nasty deadlock on copying from the | |
| 2260 | − * same page as we're writing to, without it being marked | |
| 2261 | − * up-to-date. | |
| 2262 | − * | |
| 2263 | − * Not only is this an optimisation, but it is also required | |
| 2264 | − * to check that the address is actually valid, when atomic | |
| 2265 | − * usercopies are used, below. | |
| 2266 | − */ | |
| 2267 | − if (unlikely(iov_iter_fault_in_readable(i, bytes))) { | |
| 2268 | − status = -EFAULT; | |
| 2269 | − break; | |
| 2270 | − } | |
| 2271 | − | |
| 2272 | − page = __grab_cache_page(mapping, index); | |
| 2273 | − if (!page) { | |
| 2274 | − status = -ENOMEM; | |
| 2275 | − break; | |
| 2276 | − } | |
| 2277 | − | |
| 2278 | − /* | |
| 2279 | − * non-uptodate pages cannot cope with short copies, and we | |
| 2280 | − * cannot take a pagefault with the destination page locked. | |
| 2281 | − * So pin the source page to copy it. | |
| 2282 | − */ | |
| 2283 | − if (!PageUptodate(page) && !segment_eq(get_fs(), KERNEL_DS)) { | |
| 2284 | − unlock_page(page); | |
| 2285 | − | |
| 2286 | − src_page = alloc_page(GFP_KERNEL); | |
| 2287 | − if (!src_page) { | |
| 2288 | − page_cache_release(page); | |
| 2289 | − status = -ENOMEM; | |
| 2290 | − break; | |
| 2291 | − } | |
| 2292 | − | |
| 2293 | − /* | |
| 2294 | − * Cannot get_user_pages with a page locked for the | |
| 2295 | − * same reason as we can't take a page fault with a | |
| 2296 | − * page locked (as explained below). | |
| 2297 | − */ | |
| 2298 | − copied = iov_iter_copy_from_user(src_page, i, | |
| 2299 | − offset, bytes); | |
| 2300 | − if (unlikely(copied == 0)) { | |
| 2301 | − status = -EFAULT; | |
| 2302 | − page_cache_release(page); | |
| 2303 | − page_cache_release(src_page); | |
| 2304 | − break; | |
| 2305 | − } | |
| 2306 | − bytes = copied; | |
| 2307 | − | |
| 2308 | − lock_page(page); | |
| 2309 | − /* | |
| 2310 | − * Can't handle the page going uptodate here, because | |
| 2311 | − * that means we would use non-atomic usercopies, which | |
| 2312 | − * zero out the tail of the page, which can cause | |
| 2313 | − * zeroes to become transiently visible. We could just | |
| 2314 | − * use a non-zeroing copy, but the APIs aren't too | |
| 2315 | − * consistent. | |
| 2316 | − */ | |
| 2317 | − if (unlikely(!page->mapping || PageUptodate(page))) { | |
| 2318 | − unlock_page(page); | |
| 2319 | − page_cache_release(page); | |
| 2320 | − page_cache_release(src_page); | |
| 2321 | − continue; | |
| 2322 | − } | |
| 2323 | − } | |
| 2324 | − | |
| 2325 | − status = a_ops->prepare_write(file, page, offset, offset+bytes); | |
| 2326 | − if (unlikely(status)) | |
| 2327 | − goto fs_write_aop_error; | |
| 2328 | − | |
| 2329 | − if (!src_page) { | |
| 2330 | − /* | |
| 2331 | − * Must not enter the pagefault handler here, because | |
| 2332 | − * we hold the page lock, so we might recursively | |
| 2333 | − * deadlock on the same lock, or get an ABBA deadlock | |
| 2334 | − * against a different lock, or against the mmap_sem | |
| 2335 | − * (which nests outside the page lock). So increment | |
| 2336 | − * preempt count, and use _atomic usercopies. | |
| 2337 | − * | |
| 2338 | − * The page is uptodate so we are OK to encounter a | |
| 2339 | − * short copy: if unmodified parts of the page are | |
| 2340 | − * marked dirty and written out to disk, it doesn't | |
| 2341 | − * really matter. | |
| 2342 | − */ | |
| 2343 | − pagefault_disable(); | |
| 2344 | − copied = iov_iter_copy_from_user_atomic(page, i, | |
| 2345 | − offset, bytes); | |
| 2346 | − pagefault_enable(); | |
| 2347 | − } else { | |
| 2348 | − void *src, *dst; | |
| 2349 | − src = kmap_atomic(src_page, KM_USER0); | |
| 2350 | − dst = kmap_atomic(page, KM_USER1); | |
| 2351 | − memcpy(dst + offset, src + offset, bytes); | |
| 2352 | − kunmap_atomic(dst, KM_USER1); | |
| 2353 | − kunmap_atomic(src, KM_USER0); | |
| 2354 | − copied = bytes; | |
| 2355 | − } | |
| 2356 | − flush_dcache_page(page); | |
| 2357 | − | |
| 2358 | − status = a_ops->commit_write(file, page, offset, offset+bytes); | |
| 2359 | − if (unlikely(status < 0)) | |
| 2360 | − goto fs_write_aop_error; | |
| 2361 | − if (unlikely(status > 0)) /* filesystem did partial write */ | |
| 2362 | − copied = min_t(size_t, copied, status); | |
| 2363 | − | |
| 2364 | − unlock_page(page); | |
| 2365 | − mark_page_accessed(page); | |
| 2366 | − page_cache_release(page); | |
| 2367 | − if (src_page) | |
| 2368 | − page_cache_release(src_page); | |
| 2369 | − | |
| 2370 | − iov_iter_advance(i, copied); | |
| 2371 | − pos += copied; | |
| 2372 | − written += copied; | |
| 2373 | − | |
| 2374 | − balance_dirty_pages_ratelimited(mapping); | |
| 2375 | − cond_resched(); | |
| 2376 | − continue; | |
| 2377 | − | |
| 2378 | −fs_write_aop_error: | |
| 2379 | − unlock_page(page); | |
| 2380 | − page_cache_release(page); | |
| 2381 | − if (src_page) | |
| 2382 | − page_cache_release(src_page); | |
| 2383 | − | |
| 2384 | − /* | |
| 2385 | − * prepare_write() may have instantiated a few blocks | |
| 2386 | − * outside i_size. Trim these off again. Don't need | |
| 2387 | − * i_size_read because we hold i_mutex. | |
| 2388 | − */ | |
| 2389 | − if (pos + bytes > inode->i_size) | |
| 2390 | − vmtruncate(inode, inode->i_size); | |
| 2391 | − break; | |
| 2392 | − } while (iov_iter_count(i)); | |
| 2393 | − | |
| 2394 | − return written ? written : status; | |
| 2395 | −} | |
| 2396 | − | |
| 2397 | 2166 | static ssize_t generic_perform_write(struct file *file, |
| 2398 | 2167 | struct iov_iter *i, loff_t pos) |
| 2399 | 2168 | { |
| @@ -2494,10 +2263,7 @@ generic_file_buffered_write(struct kiocb *iocb, const struct iovec *iov, · 94 unmodified lines | ||
| 2494 | 2263 | struct iov_iter i; |
| 2495 | 2264 | |
| 2496 | 2265 | iov_iter_init(&i, iov, nr_segs, count, written); |
| 2497 | − if (a_ops->write_begin) | |
| 2498 | − status = generic_perform_write(file, &i, pos); | |
| 2499 | − else | |
| 2500 | − status = generic_perform_write_2copy(file, &i, pos); | |
| 2266 | + status = generic_perform_write(file, &i, pos); | |
| 2501 | 2267 | |
| 2502 | 2268 | if (likely(status >= 0)) { |
| 2503 | 2269 | written += status; |
| @@ -175,7 +175,8 @@ int __vm_enough_memory(struct mm_struct *mm, long pages, int cap_sys_admin) · 174 unmodified lines | ||
| 175 | 175 | |
| 176 | 176 | /* Don't let a single process grow too big: |
| 177 | 177 | leave 3% of the size of this process for other processes */ |
| 178 | − allowed -= mm->total_vm / 32; | |
| 178 | + if (mm) | |
| 179 | + allowed -= mm->total_vm / 32; | |
| 179 | 180 | |
| 180 | 181 | /* |
| 181 | 182 | * cast `allowed' as a signed long because vm_committed_space |
| @@ -1454,7 +1454,8 @@ int __vm_enough_memory(struct mm_struct *mm, long pages, int cap_sys_admin) · 1453 unmodified lines | ||
| 1454 | 1454 | |
| 1455 | 1455 | /* Don't let a single process grow too big: |
| 1456 | 1456 | leave 3% of the size of this process for other processes */ |
| 1457 | − allowed -= current->mm->total_vm / 32; | |
| 1457 | + if (mm) | |
| 1458 | + allowed -= mm->total_vm / 32; | |
| 1458 | 1459 | |
| 1459 | 1460 | /* |
| 1460 | 1461 | * cast `allowed' as a signed long because vm_committed_space |
| @@ -161,8 +161,8 @@ static inline struct shmem_sb_info *SHMEM_SB(struct super_block *sb) · 160 unmodified lines | ||
| 161 | 161 | */ |
| 162 | 162 | static inline int shmem_acct_size(unsigned long flags, loff_t size) |
| 163 | 163 | { |
| 164 | − return (flags & VM_ACCOUNT)? | |
| 165 | − security_vm_enough_memory(VM_ACCT(size)): 0; | |
| 164 | + return (flags & VM_ACCOUNT) ? | |
| 165 | + security_vm_enough_memory_kern(VM_ACCT(size)) : 0; | |
| 166 | 166 | } |
| 167 | 167 | |
| 168 | 168 | static inline void shmem_unacct_size(unsigned long flags, loff_t size) |
| @@ -179,8 +179,8 @@ static inline void shmem_unacct_size(unsigned long flags, loff_t size) · 10 unmodified lines | ||
| 179 | 179 | */ |
| 180 | 180 | static inline int shmem_acct_block(unsigned long flags) |
| 181 | 181 | { |
| 182 | − return (flags & VM_ACCOUNT)? | |
| 183 | − 0: security_vm_enough_memory(VM_ACCT(PAGE_CACHE_SIZE)); | |
| 182 | + return (flags & VM_ACCOUNT) ? | |
| 183 | + 0 : security_vm_enough_memory_kern(VM_ACCT(PAGE_CACHE_SIZE)); | |
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | static inline void shmem_unacct_blocks(unsigned long flags, long pages) |
| @@ -897,7 +897,8 @@ EXPORT_SYMBOL(vm_unmap_ram); · 896 unmodified lines | ||
| 897 | 897 | * @count: number of pages |
| 898 | 898 | * @node: prefer to allocate data structures on this node |
| 899 | 899 | * @prot: memory protection to use. PAGE_KERNEL for regular RAM |
| 900 | − * @returns: a pointer to the address that has been mapped, or NULL on failure | |
| 900 | + * | |
| 901 | + * Returns: a pointer to the address that has been mapped, or %NULL on failure | |
| 901 | 902 | */ |
| 902 | 903 | void *vm_map_ram(struct page **pages, unsigned int count, int node, pgprot_t prot) |
| 903 | 904 | { |
| @@ -1973,28 +1973,27 @@ static void pktgen_setup_inject(struct pktgen_dev *pkt_dev) · 1972 unmodified lines | ||
| 1973 | 1973 | |
| 1974 | 1974 | /* make sure that we don't pick a non-existing transmit queue */ |
| 1975 | 1975 | ntxq = pkt_dev->odev->real_num_tx_queues; |
| 1976 | − if (ntxq <= num_online_cpus() && (pkt_dev->flags & F_QUEUE_MAP_CPU)) { | |
| 1976 | + if (ntxq > num_online_cpus() && (pkt_dev->flags & F_QUEUE_MAP_CPU)) { | |
| 1977 | 1977 | printk(KERN_WARNING "pktgen: WARNING: QUEUE_MAP_CPU " |
| 1978 | − "disabled because CPU count (%d) exceeds number ", | |
| 1979 | − num_online_cpus()); | |
| 1980 | − printk(KERN_WARNING "pktgen: WARNING: of tx queues " | |
| 1981 | − "(%d) on %s \n", ntxq, pkt_dev->odev->name); | |
| 1978 | + "disabled because CPU count (%d) exceeds number " | |
| 1979 | + "of tx queues (%d) on %s\n", num_online_cpus(), ntxq, | |
| 1980 | + pkt_dev->odev->name); | |
| 1982 | 1981 | pkt_dev->flags &= ~F_QUEUE_MAP_CPU; |
| 1983 | 1982 | } |
| 1984 | 1983 | if (ntxq <= pkt_dev->queue_map_min) { |
| 1985 | 1984 | printk(KERN_WARNING "pktgen: WARNING: Requested " |
| 1986 | − "queue_map_min (%d) exceeds number of tx\n", | |
| 1987 | − pkt_dev->queue_map_min); | |
| 1988 | − printk(KERN_WARNING "pktgen: WARNING: queues (%d) on " | |
| 1989 | − "%s, resetting\n", ntxq, pkt_dev->odev->name); | |
| 1985 | + "queue_map_min (zero-based) (%d) exceeds valid range " | |
| 1986 | + "[0 - %d] for (%d) queues on %s, resetting\n", | |
| 1987 | + pkt_dev->queue_map_min, (ntxq ?: 1)- 1, ntxq, | |
| 1988 | + pkt_dev->odev->name); | |
| 1990 | 1989 | pkt_dev->queue_map_min = ntxq - 1; |
| 1991 | 1990 | } |
| 1992 | − if (ntxq <= pkt_dev->queue_map_max) { | |
| 1991 | + if (pkt_dev->queue_map_max >= ntxq) { | |
| 1993 | 1992 | printk(KERN_WARNING "pktgen: WARNING: Requested " |
| 1994 | − "queue_map_max (%d) exceeds number of tx\n", | |
| 1995 | − pkt_dev->queue_map_max); | |
| 1996 | − printk(KERN_WARNING "pktgen: WARNING: queues (%d) on " | |
| 1997 | − "%s, resetting\n", ntxq, pkt_dev->odev->name); | |
| 1993 | + "queue_map_max (zero-based) (%d) exceeds valid range " | |
| 1994 | + "[0 - %d] for (%d) queues on %s, resetting\n", | |
| 1995 | + pkt_dev->queue_map_max, (ntxq ?: 1)- 1, ntxq, | |
| 1996 | + pkt_dev->odev->name); | |
| 1998 | 1997 | pkt_dev->queue_map_max = ntxq - 1; |
| 1999 | 1998 | } |
| 2000 | 1999 | |
| @@ -2279,6 +2279,11 @@ struct sk_buff *tcp_make_synack(struct sock *sk, struct dst_entry *dst, · 2278 unmodified lines | ||
| 2279 | 2279 | } |
| 2280 | 2280 | |
| 2281 | 2281 | memset(&opts, 0, sizeof(opts)); |
| 2282 | +#ifdef CONFIG_SYN_COOKIES | |
| 2283 | + if (unlikely(req->cookie_ts)) | |
| 2284 | + TCP_SKB_CB(skb)->when = cookie_init_timestamp(req); | |
| 2285 | + else | |
| 2286 | +#endif | |
| 2282 | 2287 | TCP_SKB_CB(skb)->when = tcp_time_stamp; |
| 2283 | 2288 | tcp_header_size = tcp_synack_options(sk, req, mss, |
| 2284 | 2289 | skb, &opts, &md5) + |
| @@ -2304,11 +2309,6 @@ struct sk_buff *tcp_make_synack(struct sock *sk, struct dst_entry *dst, · 19 unmodified lines | ||
| 2304 | 2309 | |
| 2305 | 2310 | /* RFC1323: The window in SYN & SYN/ACK segments is never scaled. */ |
| 2306 | 2311 | th->window = htons(min(req->rcv_wnd, 65535U)); |
| 2307 | −#ifdef CONFIG_SYN_COOKIES | |
| 2308 | − if (unlikely(req->cookie_ts)) | |
| 2309 | − TCP_SKB_CB(skb)->when = cookie_init_timestamp(req); | |
| 2310 | − else | |
| 2311 | −#endif | |
| 2312 | 2312 | tcp_options_write((__be32 *)(th + 1), tp, &opts, &md5_hash_location); |
| 2313 | 2313 | th->doff = (tcp_header_size >> 2); |
| 2314 | 2314 | TCP_INC_STATS(sock_net(sk), TCP_MIB_OUTSEGS); |
| @@ -94,8 +94,8 @@ minstrel_stats_open(struct inode *inode, struct file *file) · 93 unmodified lines | ||
| 94 | 94 | prob / 10, prob % 10, |
| 95 | 95 | mr->last_success, |
| 96 | 96 | mr->last_attempts, |
| 97 | − mr->succ_hist, | |
| 98 | − mr->att_hist); | |
| 97 | + (unsigned long long)mr->succ_hist, | |
| 98 | + (unsigned long long)mr->att_hist); | |
| 99 | 99 | } |
| 100 | 100 | p += sprintf(p, "\nTotal packet count:: ideal %d " |
| 101 | 101 | "lookaround %d\n\n", |
| @@ -106,7 +106,7 @@ minstrel_stats_open(struct inode *inode, struct file *file) · 4 unmodified lines | ||
| 106 | 106 | return 0; |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | −static int | |
| 109 | +static ssize_t | |
| 110 | 110 | minstrel_stats_read(struct file *file, char __user *buf, size_t len, loff_t *o) |
| 111 | 111 | { |
| 112 | 112 | struct minstrel_stats_info *ms; |
| @@ -261,6 +261,8 @@ static inline int can_respond(struct sk_buff *skb) · 260 unmodified lines | ||
| 261 | 261 | return 0; /* we are not the destination */ |
| 262 | 262 | if (ph->pn_res == PN_PREFIX && !pskb_may_pull(skb, 5)) |
| 263 | 263 | return 0; |
| 264 | + if (ph->pn_res == PN_COMMGR) /* indications */ | |
| 265 | + return 0; | |
| 264 | 266 | |
| 265 | 267 | ph = pn_hdr(skb); /* re-acquires the pointer */ |
| 266 | 268 | pm = pn_msg(skb); |
| @@ -309,7 +311,8 @@ static int send_reset_indications(struct sk_buff *rskb) · 42 unmodified lines | ||
| 309 | 311 | |
| 310 | 312 | return pn_raw_send(data, sizeof(data), rskb->dev, |
| 311 | 313 | pn_object(oph->pn_sdev, 0x00), |
| 312 | − pn_object(oph->pn_rdev, oph->pn_robj), 0x10); | |
| 314 | + pn_object(oph->pn_rdev, oph->pn_robj), | |
| 315 | + PN_COMMGR); | |
| 313 | 316 | } |
| 314 | 317 | |
| 315 | 318 | |
| @@ -256,6 +256,11 @@ static struct input_handler rfkill_handler = { · 255 unmodified lines | ||
| 256 | 256 | |
| 257 | 257 | static int __init rfkill_handler_init(void) |
| 258 | 258 | { |
| 259 | + unsigned long last_run = jiffies - msecs_to_jiffies(500); | |
| 260 | + rfkill_wlan.last = last_run; | |
| 261 | + rfkill_bt.last = last_run; | |
| 262 | + rfkill_uwb.last = last_run; | |
| 263 | + rfkill_wimax.last = last_run; | |
| 259 | 264 | return input_register_handler(&rfkill_handler); |
| 260 | 265 | } |
| 261 | 266 | |
| @@ -198,10 +198,16 @@ cmd_modversions = \ · 197 unmodified lines | ||
| 198 | 198 | fi; |
| 199 | 199 | endif |
| 200 | 200 | |
| 201 | +ifdef CONFIG_64BIT | |
| 202 | +arch_bits = 64 | |
| 203 | +else | |
| 204 | +arch_bits = 32 | |
| 205 | +endif | |
| 206 | + | |
| 201 | 207 | ifdef CONFIG_FTRACE_MCOUNT_RECORD |
| 202 | 208 | cmd_record_mcount = perl $(srctree)/scripts/recordmcount.pl \ |
| 203 | − "$(ARCH)" "$(OBJDUMP)" "$(OBJCOPY)" "$(CC)" "$(LD)" "$(NM)" "$(RM)" \ | |
| 204 | − "$(MV)" "$(@)"; | |
| 209 | + "$(ARCH)" "$(arch_bits)" "$(OBJDUMP)" "$(OBJCOPY)" "$(CC)" "$(LD)" \ | |
| 210 | + "$(NM)" "$(RM)" "$(MV)" "$(@)"; | |
| 205 | 211 | endif |
| 206 | 212 | |
| 207 | 213 | define rule_cc_o_c |
| @@ -37,7 +37,10 @@ · 36 unmodified lines | ||
| 37 | 37 | # dmesg | perl scripts/bootgraph.pl > output.svg |
| 38 | 38 | # |
| 39 | 39 | |
| 40 | −my %start, %end; | |
| 40 | +use strict; | |
| 41 | + | |
| 42 | +my %start; | |
| 43 | +my %end; | |
| 41 | 44 | my $done = 0; |
| 42 | 45 | my $maxtime = 0; |
| 43 | 46 | my $firsttime = 100; |
| @@ -105,18 +108,20 @@ my $threshold = ($maxtime - $firsttime) / 60.0; · 61 unmodified lines | ||
| 105 | 108 | my $stylecounter = 0; |
| 106 | 109 | my %rows; |
| 107 | 110 | my $rowscount = 1; |
| 108 | −while (($key,$value) = each %start) { | |
| 111 | +my @initcalls = sort { $start{$a} <=> $start{$b} } keys(%start); | |
| 112 | +my $key; | |
| 113 | +foreach $key (@initcalls) { | |
| 109 | 114 | my $duration = $end{$key} - $start{$key}; |
| 110 | 115 | |
| 111 | 116 | if ($duration >= $threshold) { |
| 112 | − my $s, $s2, $e, $y; | |
| 113 | − $pid = $pids{$key}; | |
| 117 | + my ($s, $s2, $e, $w, $y, $y2, $style); | |
| 118 | + my $pid = $pids{$key}; | |
| 114 | 119 | |
| 115 | 120 | if (!defined($rows{$pid})) { |
| 116 | 121 | $rows{$pid} = $rowscount; |
| 117 | 122 | $rowscount = $rowscount + 1; |
| 118 | 123 | } |
| 119 | − $s = ($value - $firsttime) * $mult; | |
| 124 | + $s = ($start{$key} - $firsttime) * $mult; | |
| 120 | 125 | $s2 = $s + 6; |
| 121 | 126 | $e = ($end{$key} - $firsttime) * $mult; |
| 122 | 127 | $w = $e - $s; |
| @@ -140,9 +145,9 @@ while (($key,$value) = each %start) { · 17 unmodified lines | ||
| 140 | 145 | my $time = $firsttime; |
| 141 | 146 | my $step = ($maxtime - $firsttime) / 15; |
| 142 | 147 | while ($time < $maxtime) { |
| 143 | − my $s2 = ($time - $firsttime) * $mult; | |
| 148 | + my $s3 = ($time - $firsttime) * $mult; | |
| 144 | 149 | my $tm = int($time * 100) / 100.0; |
| 145 | − print "<text transform=\"translate($s2,89) rotate(90)\">$tm</text>\n"; | |
| 150 | + print "<text transform=\"translate($s3,89) rotate(90)\">$tm</text>\n"; | |
| 146 | 151 | $time = $time + $step; |
| 147 | 152 | } |
| 148 | 153 | |
| @@ -106,7 +106,13 @@ if ($#ARGV < 6) { · 105 unmodified lines | ||
| 106 | 106 | exit(1); |
| 107 | 107 | } |
| 108 | 108 | |
| 109 | −my ($arch, $objdump, $objcopy, $cc, $ld, $nm, $rm, $mv, $inputfile) = @ARGV; | |
| 109 | +my ($arch, $bits, $objdump, $objcopy, $cc, | |
| 110 | + $ld, $nm, $rm, $mv, $inputfile) = @ARGV; | |
| 111 | + | |
| 112 | +# Acceptable sections to record. | |
| 113 | +my %text_sections = ( | |
| 114 | + ".text" => 1, | |
| 115 | +); | |
| 110 | 116 | |
| 111 | 117 | $objdump = "objdump" if ((length $objdump) == 0); |
| 112 | 118 | $objcopy = "objcopy" if ((length $objcopy) == 0); |
| @@ -129,8 +135,16 @@ my $function_regex; # Find the name of a function · 16 unmodified lines | ||
| 129 | 135 | # (return offset and func name) |
| 130 | 136 | my $mcount_regex; # Find the call site to mcount (return offset) |
| 131 | 137 | |
| 138 | +if ($arch eq "x86") { | |
| 139 | + if ($bits == 64) { | |
| 140 | + $arch = "x86_64"; | |
| 141 | + } else { | |
| 142 | + $arch = "i386"; | |
| 143 | + } | |
| 144 | +} | |
| 145 | + | |
| 132 | 146 | if ($arch eq "x86_64") { |
| 133 | − $section_regex = "Disassembly of section"; | |
| 147 | + $section_regex = "Disassembly of section\\s+(\\S+):"; | |
| 134 | 148 | $function_regex = "^([0-9a-fA-F]+)\\s+<(.*?)>:"; |
| 135 | 149 | $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\smcount([+-]0x[0-9a-zA-Z]+)?\$"; |
| 136 | 150 | $type = ".quad"; |
| @@ -142,7 +156,7 @@ if ($arch eq "x86_64") { · 5 unmodified lines | ||
| 142 | 156 | $cc .= " -m64"; |
| 143 | 157 | |
| 144 | 158 | } elsif ($arch eq "i386") { |
| 145 | − $section_regex = "Disassembly of section"; | |
| 159 | + $section_regex = "Disassembly of section\\s+(\\S+):"; | |
| 146 | 160 | $function_regex = "^([0-9a-fA-F]+)\\s+<(.*?)>:"; |
| 147 | 161 | $mcount_regex = "^\\s*([0-9a-fA-F]+):.*\\smcount\$"; |
| 148 | 162 | $type = ".long"; |
| @@ -289,7 +303,13 @@ my $text; · 140 unmodified lines | ||
| 289 | 303 | while (<IN>) { |
| 290 | 304 | # is it a section? |
| 291 | 305 | if (/$section_regex/) { |
| 292 | − $read_function = 1; | |
| 306 | + | |
| 307 | + # Only record text sections that we know are safe | |
| 308 | + if (defined($text_sections{$1})) { | |
| 309 | + $read_function = 1; | |
| 310 | + } else { | |
| 311 | + $read_function = 0; | |
| 312 | + } | |
| 293 | 313 | # print out any recorded offsets |
| 294 | 314 | update_funcs() if ($text_found); |
| 295 | 315 | |
| @@ -198,14 +198,23 @@ int security_settime(struct timespec *ts, struct timezone *tz) · 197 unmodified lines | ||
| 198 | 198 | |
| 199 | 199 | int security_vm_enough_memory(long pages) |
| 200 | 200 | { |
| 201 | + WARN_ON(current->mm == NULL); | |
| 201 | 202 | return security_ops->vm_enough_memory(current->mm, pages); |
| 202 | 203 | } |
| 203 | 204 | |
| 204 | 205 | int security_vm_enough_memory_mm(struct mm_struct *mm, long pages) |
| 205 | 206 | { |
| 207 | + WARN_ON(mm == NULL); | |
| 206 | 208 | return security_ops->vm_enough_memory(mm, pages); |
| 207 | 209 | } |
| 208 | 210 | |
| 211 | +int security_vm_enough_memory_kern(long pages) | |
| 212 | +{ | |
| 213 | + /* If current->mm is a kernel thread then we will pass NULL, | |
| 214 | + for this specific case that is fine */ | |
| 215 | + return security_ops->vm_enough_memory(current->mm, pages); | |
| 216 | +} | |
| 217 | + | |
| 209 | 218 | int security_bprm_alloc(struct linux_binprm *bprm) |
| 210 | 219 | { |
| 211 | 220 | return security_ops->bprm_alloc_security(bprm); |
| @@ -225,8 +225,13 @@ struct snd_kcontrol *snd_ctl_new1(const struct snd_kcontrol_new *ncontrol, · 224 unmodified lines | ||
| 225 | 225 | kctl.id.iface = ncontrol->iface; |
| 226 | 226 | kctl.id.device = ncontrol->device; |
| 227 | 227 | kctl.id.subdevice = ncontrol->subdevice; |
| 228 | − if (ncontrol->name) | |
| 228 | + if (ncontrol->name) { | |
| 229 | 229 | strlcpy(kctl.id.name, ncontrol->name, sizeof(kctl.id.name)); |
| 230 | + if (strcmp(ncontrol->name, kctl.id.name) != 0) | |
| 231 | + snd_printk(KERN_WARNING | |
| 232 | + "Control name '%s' truncated to '%s'\n", | |
| 233 | + ncontrol->name, kctl.id.name); | |
| 234 | + } | |
| 230 | 235 | kctl.id.index = ncontrol->index; |
| 231 | 236 | kctl.count = ncontrol->count ? ncontrol->count : 1; |
| 232 | 237 | access = ncontrol->access == 0 ? SNDRV_CTL_ELEM_ACCESS_READWRITE : |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | /* |
| 2 | 2 | * Initialisation code for Cyrix/NatSemi VSA1 softaudio |
| 3 | 3 | * |
| 4 | − * (C) Copyright 2003 Red Hat Inc <alan@redhat.com> | |
| 4 | + * (C) Copyright 2003 Red Hat Inc <alan@lxorguk.ukuu.org.uk> | |
| 5 | 5 | * |
| 6 | 6 | * XpressAudio(tm) is used on the Cyrix MediaGX (now NatSemi Geode) systems. |
| 7 | 7 | * The older version (VSA1) provides fairly good soundblaster emulation |
| @@ -1927,9 +1927,9 @@ static int snd_ac97_dev_register(struct snd_device *device) · 1926 unmodified lines | ||
| 1927 | 1927 | ac97->dev.bus = &ac97_bus_type; |
| 1928 | 1928 | ac97->dev.parent = ac97->bus->card->dev; |
| 1929 | 1929 | ac97->dev.release = ac97_device_release; |
| 1930 | − snprintf(ac97->dev.bus_id, BUS_ID_SIZE, "%d-%d:%s", | |
| 1931 | − ac97->bus->card->number, ac97->num, | |
| 1932 | − snd_ac97_get_short_name(ac97)); | |
| 1930 | + dev_set_name(&ac97->dev, "%d-%d:%s", | |
| 1931 | + ac97->bus->card->number, ac97->num, | |
| 1932 | + snd_ac97_get_short_name(ac97)); | |
| 1933 | 1933 | if ((err = device_register(&ac97->dev)) < 0) { |
| 1934 | 1934 | snd_printk(KERN_ERR "Can't register ac97 bus\n"); |
| 1935 | 1935 | ac97->dev.bus = NULL; |
| @@ -932,7 +932,7 @@ snd_ad1889_create(struct snd_card *card, · 931 unmodified lines | ||
| 932 | 932 | goto free_and_ret; |
| 933 | 933 | |
| 934 | 934 | chip->bar = pci_resource_start(pci, 0); |
| 935 | − chip->iobase = ioremap_nocache(chip->bar, pci_resource_len(pci, 0)); | |
| 935 | + chip->iobase = pci_ioremap_bar(pci, 0); | |
| 936 | 936 | if (chip->iobase == NULL) { |
| 937 | 937 | printk(KERN_ERR PFX "unable to reserve region.\n"); |
| 938 | 938 | err = -EBUSY; |
| @@ -1609,7 +1609,7 @@ static int __devinit snd_atiixp_create(struct snd_card *card, · 1608 unmodified lines | ||
| 1609 | 1609 | return err; |
| 1610 | 1610 | } |
| 1611 | 1611 | chip->addr = pci_resource_start(pci, 0); |
| 1612 | − chip->remap_addr = ioremap_nocache(chip->addr, pci_resource_len(pci, 0)); | |
| 1612 | + chip->remap_addr = pci_ioremap_bar(pci, 0); | |
| 1613 | 1613 | if (chip->remap_addr == NULL) { |
| 1614 | 1614 | snd_printk(KERN_ERR "AC'97 space ioremap problem\n"); |
| 1615 | 1615 | snd_atiixp_free(chip); |
| @@ -1252,7 +1252,7 @@ static int __devinit snd_atiixp_create(struct snd_card *card, · 1251 unmodified lines | ||
| 1252 | 1252 | return err; |
| 1253 | 1253 | } |
| 1254 | 1254 | chip->addr = pci_resource_start(pci, 0); |
| 1255 | − chip->remap_addr = ioremap_nocache(chip->addr, pci_resource_len(pci, 0)); | |
| 1255 | + chip->remap_addr = pci_ioremap_bar(pci, 0); | |
| 1256 | 1256 | if (chip->remap_addr == NULL) { |
| 1257 | 1257 | snd_printk(KERN_ERR "AC'97 space ioremap problem\n"); |
| 1258 | 1258 | snd_atiixp_free(chip); |
| @@ -180,8 +180,7 @@ snd_vortex_create(struct snd_card *card, struct pci_dev *pci, vortex_t ** rchip) · 179 unmodified lines | ||
| 180 | 180 | if ((err = pci_request_regions(pci, CARD_NAME_SHORT)) != 0) |
| 181 | 181 | goto regions_out; |
| 182 | 182 | |
| 183 | − chip->mmio = ioremap_nocache(pci_resource_start(pci, 0), | |
| 184 | − pci_resource_len(pci, 0)); | |
| 183 | + chip->mmio = pci_ioremap_bar(pci, 0); | |
| 185 | 184 | if (!chip->mmio) { |
| 186 | 185 | printk(KERN_ERR "MMIO area remap failed.\n"); |
| 187 | 186 | err = -ENOMEM; |
| @@ -749,8 +749,7 @@ static int __devinit snd_bt87x_create(struct snd_card *card, · 748 unmodified lines | ||
| 749 | 749 | pci_disable_device(pci); |
| 750 | 750 | return err; |
| 751 | 751 | } |
| 752 | − chip->mmio = ioremap_nocache(pci_resource_start(pci, 0), | |
| 753 | − pci_resource_len(pci, 0)); | |
| 752 | + chip->mmio = pci_ioremap_bar(pci, 0); | |
| 754 | 753 | if (!chip->mmio) { |
| 755 | 754 | snd_printk(KERN_ERR "cannot remap io memory\n"); |
| 756 | 755 | err = -ENOMEM; |
| @@ -1382,8 +1382,8 @@ static int __devinit snd_cs4281_create(struct snd_card *card, · 1381 unmodified lines | ||
| 1382 | 1382 | chip->ba0_addr = pci_resource_start(pci, 0); |
| 1383 | 1383 | chip->ba1_addr = pci_resource_start(pci, 1); |
| 1384 | 1384 | |
| 1385 | − chip->ba0 = ioremap_nocache(chip->ba0_addr, pci_resource_len(pci, 0)); | |
| 1386 | − chip->ba1 = ioremap_nocache(chip->ba1_addr, pci_resource_len(pci, 1)); | |
| 1385 | + chip->ba0 = pci_ioremap_bar(pci, 0); | |
| 1386 | + chip->ba1 = pci_ioremap_bar(pci, 1); | |
| 1387 | 1387 | if (!chip->ba0 || !chip->ba1) { |
| 1388 | 1388 | snd_cs4281_free(chip); |
| 1389 | 1389 | return -ENOMEM; |
| @@ -2,7 +2,7 @@ · 1 unmodified line | ||
| 2 | 2 | * cs5530.c - Initialisation code for Cyrix/NatSemi VSA1 softaudio |
| 3 | 3 | * |
| 4 | 4 | * (C) Copyright 2007 Ash Willis <ashwillis@programmer.net> |
| 5 | − * (C) Copyright 2003 Red Hat Inc <alan@redhat.com> | |
| 5 | + * (C) Copyright 2003 Red Hat Inc <alan@lxorguk.ukuu.org.uk> | |
| 6 | 6 | * |
| 7 | 7 | * This driver was ported (shamelessly ripped ;) from oss/kahlua.c but I did |
| 8 | 8 | * mess with it a bit. The chip seems to have to have trouble with full duplex |
| @@ -132,7 +132,7 @@ static int __devinit snd_cs5530_create(struct snd_card *card, · 123 unmodified lines | ||
| 132 | 132 | } |
| 133 | 133 | chip->pci_base = pci_resource_start(pci, 0); |
| 134 | 134 | |
| 135 | − mem = ioremap_nocache(chip->pci_base, pci_resource_len(pci, 0)); | |
| 135 | + mem = pci_ioremap_bar(pci, 0); | |
| 136 | 136 | if (mem == NULL) { |
| 137 | 137 | kfree(chip); |
| 138 | 138 | pci_disable_device(pci); |
| @@ -64,6 +64,7 @@ static struct hda_vendor_id hda_vendor_ids[] = { · 63 unmodified lines | ||
| 64 | 64 | { 0x14f1, "Conexant" }, |
| 65 | 65 | { 0x17e8, "Chrontel" }, |
| 66 | 66 | { 0x1854, "LG" }, |
| 67 | + { 0x1aec, "Wolfson Microelectronics" }, | |
| 67 | 68 | { 0x434d, "C-Media" }, |
| 68 | 69 | { 0x8384, "SigmaTel" }, |
| 69 | 70 | {} /* terminator */ |
| @@ -45,6 +45,7 @@ · 44 unmodified lines | ||
| 45 | 45 | #include <linux/slab.h> |
| 46 | 46 | #include <linux/pci.h> |
| 47 | 47 | #include <linux/mutex.h> |
| 48 | +#include <linux/reboot.h> | |
| 48 | 49 | #include <sound/core.h> |
| 49 | 50 | #include <sound/initval.h> |
| 50 | 51 | #include "hda_codec.h" |
| @@ -397,6 +398,9 @@ struct azx { · 346 unmodified lines | ||
| 397 | 398 | |
| 398 | 399 | /* for pending irqs */ |
| 399 | 400 | struct work_struct irq_pending_work; |
| 401 | + | |
| 402 | + /* reboot notifier (for mysterious hangup problem at power-down) */ | |
| 403 | + struct notifier_block reboot_notifier; | |
| 400 | 404 | }; |
| 401 | 405 | |
| 402 | 406 | /* driver types */ |
| @@ -1978,6 +1982,28 @@ static int azx_resume(struct pci_dev *pci) · 1575 unmodified lines | ||
| 1978 | 1982 | #endif /* CONFIG_PM */ |
| 1979 | 1983 | |
| 1980 | 1984 | |
| 1985 | +/* | |
| 1986 | + * reboot notifier for hang-up problem at power-down | |
| 1987 | + */ | |
| 1988 | +static int azx_halt(struct notifier_block *nb, unsigned long event, void *buf) | |
| 1989 | +{ | |
| 1990 | + struct azx *chip = container_of(nb, struct azx, reboot_notifier); | |
| 1991 | + azx_stop_chip(chip); | |
| 1992 | + return NOTIFY_OK; | |
| 1993 | +} | |
| 1994 | + | |
| 1995 | +static void azx_notifier_register(struct azx *chip) | |
| 1996 | +{ | |
| 1997 | + chip->reboot_notifier.notifier_call = azx_halt; | |
| 1998 | + register_reboot_notifier(&chip->reboot_notifier); | |
| 1999 | +} | |
| 2000 | + | |
| 2001 | +static void azx_notifier_unregister(struct azx *chip) | |
| 2002 | +{ | |
| 2003 | + if (chip->reboot_notifier.notifier_call) | |
| 2004 | + unregister_reboot_notifier(&chip->reboot_notifier); | |
| 2005 | +} | |
| 2006 | + | |
| 1981 | 2007 | /* |
| 1982 | 2008 | * destructor |
| 1983 | 2009 | */ |
| @@ -1985,6 +2011,8 @@ static int azx_free(struct azx *chip) · 1 unmodified line | ||
| 1985 | 2011 | { |
| 1986 | 2012 | int i; |
| 1987 | 2013 | |
| 2014 | + azx_notifier_unregister(chip); | |
| 2015 | + | |
| 1988 | 2016 | if (chip->initialized) { |
| 1989 | 2017 | azx_clear_irq_pending(chip); |
| 1990 | 2018 | for (i = 0; i < chip->num_streams; i++) |
| @@ -2158,7 +2186,7 @@ static int __devinit azx_create(struct snd_card *card, struct pci_dev *pci, · 167 unmodified lines | ||
| 2158 | 2186 | } |
| 2159 | 2187 | |
| 2160 | 2188 | chip->addr = pci_resource_start(pci, 0); |
| 2161 | − chip->remap_addr = ioremap_nocache(chip->addr, pci_resource_len(pci,0)); | |
| 2189 | + chip->remap_addr = pci_ioremap_bar(pci, 0); | |
| 2162 | 2190 | if (chip->remap_addr == NULL) { |
| 2163 | 2191 | snd_printk(KERN_ERR SFX "ioremap error\n"); |
| 2164 | 2192 | err = -ENXIO; |
| @@ -2348,6 +2376,7 @@ static int __devinit azx_probe(struct pci_dev *pci, · 183 unmodified lines | ||
| 2348 | 2376 | pci_set_drvdata(pci, card); |
| 2349 | 2377 | chip->running = 1; |
| 2350 | 2378 | power_down_all_codecs(chip); |
| 2379 | + azx_notifier_register(chip); | |
| 2351 | 2380 | |
| 2352 | 2381 | dev++; |
| 2353 | 2382 | return err; |
| @@ -3860,6 +3860,7 @@ static const char *ad1884a_models[AD1884A_MODELS] = { · 3859 unmodified lines | ||
| 3860 | 3860 | |
| 3861 | 3861 | static struct snd_pci_quirk ad1884a_cfg_tbl[] = { |
| 3862 | 3862 | SND_PCI_QUIRK(0x103c, 0x3030, "HP", AD1884A_MOBILE), |
| 3863 | + SND_PCI_QUIRK(0x103c, 0x3056, "HP", AD1884A_MOBILE), | |
| 3863 | 3864 | SND_PCI_QUIRK(0x17aa, 0x20ac, "Thinkpad X300", AD1884A_THINKPAD), |
| 3864 | 3865 | {} |
| 3865 | 3866 | }; |
| @@ -307,6 +307,13 @@ struct alc_spec { · 306 unmodified lines | ||
| 307 | 307 | /* for PLL fix */ |
| 308 | 308 | hda_nid_t pll_nid; |
| 309 | 309 | unsigned int pll_coef_idx, pll_coef_bit; |
| 310 | + | |
| 311 | +#ifdef SND_HDA_NEEDS_RESUME | |
| 312 | +#define ALC_MAX_PINS 16 | |
| 313 | + unsigned int num_pins; | |
| 314 | + hda_nid_t pin_nids[ALC_MAX_PINS]; | |
| 315 | + unsigned int pin_cfgs[ALC_MAX_PINS]; | |
| 316 | +#endif | |
| 310 | 317 | }; |
| 311 | 318 | |
| 312 | 319 | /* |
| @@ -2778,6 +2785,64 @@ static void alc_free(struct hda_codec *codec) · 2465 unmodified lines | ||
| 2778 | 2785 | codec->spec = NULL; /* to be sure */ |
| 2779 | 2786 | } |
| 2780 | 2787 | |
| 2788 | +#ifdef SND_HDA_NEEDS_RESUME | |
| 2789 | +static void store_pin_configs(struct hda_codec *codec) | |
| 2790 | +{ | |
| 2791 | + struct alc_spec *spec = codec->spec; | |
| 2792 | + hda_nid_t nid, end_nid; | |
| 2793 | + | |
| 2794 | + end_nid = codec->start_nid + codec->num_nodes; | |
| 2795 | + for (nid = codec->start_nid; nid < end_nid; nid++) { | |
| 2796 | + unsigned int wid_caps = get_wcaps(codec, nid); | |
| 2797 | + unsigned int wid_type = | |
| 2798 | + (wid_caps & AC_WCAP_TYPE) >> AC_WCAP_TYPE_SHIFT; | |
| 2799 | + if (wid_type != AC_WID_PIN) | |
| 2800 | + continue; | |
| 2801 | + if (spec->num_pins >= ARRAY_SIZE(spec->pin_nids)) | |
| 2802 | + break; | |
| 2803 | + spec->pin_nids[spec->num_pins] = nid; | |
| 2804 | + spec->pin_cfgs[spec->num_pins] = | |
| 2805 | + snd_hda_codec_read(codec, nid, 0, | |
| 2806 | + AC_VERB_GET_CONFIG_DEFAULT, 0); | |
| 2807 | + spec->num_pins++; | |
| 2808 | + } | |
| 2809 | +} | |
| 2810 | + | |
| 2811 | +static void resume_pin_configs(struct hda_codec *codec) | |
| 2812 | +{ | |
| 2813 | + struct alc_spec *spec = codec->spec; | |
| 2814 | + int i; | |
| 2815 | + | |
| 2816 | + for (i = 0; i < spec->num_pins; i++) { | |
| 2817 | + hda_nid_t pin_nid = spec->pin_nids[i]; | |
| 2818 | + unsigned int pin_config = spec->pin_cfgs[i]; | |
| 2819 | + snd_hda_codec_write(codec, pin_nid, 0, | |
| 2820 | + AC_VERB_SET_CONFIG_DEFAULT_BYTES_0, | |
| 2821 | + pin_config & 0x000000ff); | |
| 2822 | + snd_hda_codec_write(codec, pin_nid, 0, | |
| 2823 | + AC_VERB_SET_CONFIG_DEFAULT_BYTES_1, | |
| 2824 | + (pin_config & 0x0000ff00) >> 8); | |
| 2825 | + snd_hda_codec_write(codec, pin_nid, 0, | |
| 2826 | + AC_VERB_SET_CONFIG_DEFAULT_BYTES_2, | |
| 2827 | + (pin_config & 0x00ff0000) >> 16); | |
| 2828 | + snd_hda_codec_write(codec, pin_nid, 0, | |
| 2829 | + AC_VERB_SET_CONFIG_DEFAULT_BYTES_3, | |
| 2830 | + pin_config >> 24); | |
| 2831 | + } | |
| 2832 | +} | |
| 2833 | + | |
| 2834 | +static int alc_resume(struct hda_codec *codec) | |
| 2835 | +{ | |
| 2836 | + resume_pin_configs(codec); | |
| 2837 | + codec->patch_ops.init(codec); | |
| 2838 | + snd_hda_codec_resume_amp(codec); | |
| 2839 | + snd_hda_codec_resume_cache(codec); | |
| 2840 | + return 0; | |
| 2841 | +} | |
| 2842 | +#else | |
| 2843 | +#define store_pin_configs(codec) | |
| 2844 | +#endif | |
| 2845 | + | |
| 2781 | 2846 | /* |
| 2782 | 2847 | */ |
| 2783 | 2848 | static struct hda_codec_ops alc_patch_ops = { |
| @@ -2786,6 +2851,9 @@ static struct hda_codec_ops alc_patch_ops = { · 2 unmodified lines | ||
| 2786 | 2851 | .init = alc_init, |
| 2787 | 2852 | .free = alc_free, |
| 2788 | 2853 | .unsol_event = alc_unsol_event, |
| 2854 | +#ifdef SND_HDA_NEEDS_RESUME | |
| 2855 | + .resume = alc_resume, | |
| 2856 | +#endif | |
| 2789 | 2857 | #ifdef CONFIG_SND_HDA_POWER_SAVE |
| 2790 | 2858 | .check_power_status = alc_check_power_status, |
| 2791 | 2859 | #endif |
| @@ -3832,6 +3900,7 @@ static int alc880_parse_auto_config(struct hda_codec *codec) · 1040 unmodified lines | ||
| 3832 | 3900 | spec->num_mux_defs = 1; |
| 3833 | 3901 | spec->input_mux = &spec->private_imux; |
| 3834 | 3902 | |
| 3903 | + store_pin_configs(codec); | |
| 3835 | 3904 | return 1; |
| 3836 | 3905 | } |
| 3837 | 3906 | |
| @@ -5250,6 +5319,7 @@ static int alc260_parse_auto_config(struct hda_codec *codec) · 1412 unmodified lines | ||
| 5250 | 5319 | } |
| 5251 | 5320 | spec->num_mixers++; |
| 5252 | 5321 | |
| 5322 | + store_pin_configs(codec); | |
| 5253 | 5323 | return 1; |
| 5254 | 5324 | } |
| 5255 | 5325 | |
| @@ -10313,6 +10383,7 @@ static int alc262_parse_auto_config(struct hda_codec *codec) · 5057 unmodified lines | ||
| 10313 | 10383 | if (err < 0) |
| 10314 | 10384 | return err; |
| 10315 | 10385 | |
| 10386 | + store_pin_configs(codec); | |
| 10316 | 10387 | return 1; |
| 10317 | 10388 | } |
| 10318 | 10389 | |
| @@ -11447,6 +11518,7 @@ static int alc268_parse_auto_config(struct hda_codec *codec) · 1128 unmodified lines | ||
| 11447 | 11518 | if (err < 0) |
| 11448 | 11519 | return err; |
| 11449 | 11520 | |
| 11521 | + store_pin_configs(codec); | |
| 11450 | 11522 | return 1; |
| 11451 | 11523 | } |
| 11452 | 11524 | |
| @@ -12230,6 +12302,7 @@ static int alc269_parse_auto_config(struct hda_codec *codec) · 777 unmodified lines | ||
| 12230 | 12302 | spec->mixers[spec->num_mixers] = alc269_capture_mixer; |
| 12231 | 12303 | spec->num_mixers++; |
| 12232 | 12304 | |
| 12305 | + store_pin_configs(codec); | |
| 12233 | 12306 | return 1; |
| 12234 | 12307 | } |
| 12235 | 12308 | |
| @@ -13316,6 +13389,7 @@ static int alc861_parse_auto_config(struct hda_codec *codec) · 1080 unmodified lines | ||
| 13316 | 13389 | spec->mixers[spec->num_mixers] = alc861_capture_mixer; |
| 13317 | 13390 | spec->num_mixers++; |
| 13318 | 13391 | |
| 13392 | + store_pin_configs(codec); | |
| 13319 | 13393 | return 1; |
| 13320 | 13394 | } |
| 13321 | 13395 | |
| @@ -14427,6 +14501,7 @@ static int alc861vd_parse_auto_config(struct hda_codec *codec) · 1105 unmodified lines | ||
| 14427 | 14501 | if (err < 0) |
| 14428 | 14502 | return err; |
| 14429 | 14503 | |
| 14504 | + store_pin_configs(codec); | |
| 14430 | 14505 | return 1; |
| 14431 | 14506 | } |
| 14432 | 14507 | |
| @@ -16258,6 +16333,8 @@ static int alc662_parse_auto_config(struct hda_codec *codec) · 1825 unmodified lines | ||
| 16258 | 16333 | |
| 16259 | 16334 | spec->mixers[spec->num_mixers] = alc662_capture_mixer; |
| 16260 | 16335 | spec->num_mixers++; |
| 16336 | + | |
| 16337 | + store_pin_configs(codec); | |
| 16261 | 16338 | return 1; |
| 16262 | 16339 | } |
| 16263 | 16340 | |
| @@ -566,10 +566,8 @@ static int stac92xx_smux_enum_put(struct snd_kcontrol *kcontrol, · 565 unmodified lines | ||
| 566 | 566 | nid = codec->slave_dig_outs[smux_idx - 1]; |
| 567 | 567 | if (spec->cur_smux[smux_idx] == smux->num_items - 1) |
| 568 | 568 | val = AMP_OUT_MUTE; |
| 569 | − if (smux_idx == 0) | |
| 570 | − nid = spec->multiout.dig_out_nid; | |
| 571 | 569 | else |
| 572 | − nid = codec->slave_dig_outs[smux_idx - 1]; | |
| 570 | + val = AMP_OUT_UNMUTE; | |
| 573 | 571 | /* un/mute SPDIF out */ |
| 574 | 572 | snd_hda_codec_write_cache(codec, nid, 0, |
| 575 | 573 | AC_VERB_SET_AMP_GAIN_MUTE, val); |
| @@ -2688,12 +2688,13 @@ static int __devinit snd_ice1712_probe(struct pci_dev *pci, · 2687 unmodified lines | ||
| 2688 | 2688 | return err; |
| 2689 | 2689 | } |
| 2690 | 2690 | |
| 2691 | − if (ice_has_con_ac97(ice)) | |
| 2691 | + if (ice_has_con_ac97(ice)) { | |
| 2692 | 2692 | err = snd_ice1712_pcm(ice, pcm_dev++, NULL); |
| 2693 | 2693 | if (err < 0) { |
| 2694 | 2694 | snd_card_free(card); |
| 2695 | 2695 | return err; |
| 2696 | 2696 | } |
| 2697 | + } | |
| 2697 | 2698 | |
| 2698 | 2699 | err = snd_ice1712_ac97_mixer(ice); |
| 2699 | 2700 | if (err < 0) { |
| @@ -2715,12 +2716,13 @@ static int __devinit snd_ice1712_probe(struct pci_dev *pci, · 15 unmodified lines | ||
| 2715 | 2716 | } |
| 2716 | 2717 | } |
| 2717 | 2718 | |
| 2718 | − if (ice_has_con_ac97(ice)) | |
| 2719 | + if (ice_has_con_ac97(ice)) { | |
| 2719 | 2720 | err = snd_ice1712_pcm_ds(ice, pcm_dev++, NULL); |
| 2720 | 2721 | if (err < 0) { |
| 2721 | 2722 | snd_card_free(card); |
| 2722 | 2723 | return err; |
| 2723 | 2724 | } |
| 2725 | + } | |
| 2724 | 2726 | |
| 2725 | 2727 | if (!c->no_mpu401) { |
| 2726 | 2728 | err = snd_mpu401_uart_new(card, 0, MPU401_HW_ICE1712, |
| @@ -2702,6 +2702,7 @@ static struct snd_pci_quirk intel8x0_clock_list[] __devinitdata = { · 2701 unmodified lines | ||
| 2702 | 2702 | SND_PCI_QUIRK(0x0e11, 0x008a, "AD1885", 41000), |
| 2703 | 2703 | SND_PCI_QUIRK(0x1028, 0x00be, "AD1885", 44100), |
| 2704 | 2704 | SND_PCI_QUIRK(0x1028, 0x0177, "AD1980", 48000), |
| 2705 | + SND_PCI_QUIRK(0x1028, 0x01ad, "AD1981B", 48000), | |
| 2705 | 2706 | SND_PCI_QUIRK(0x1043, 0x80f3, "AD1985", 48000), |
| 2706 | 2707 | { } /* terminator */ |
| 2707 | 2708 | }; |
| @@ -1314,8 +1314,7 @@ static int __devinit snd_mixart_probe(struct pci_dev *pci, · 1313 unmodified lines | ||
| 1314 | 1314 | } |
| 1315 | 1315 | for (i = 0; i < 2; i++) { |
| 1316 | 1316 | mgr->mem[i].phys = pci_resource_start(pci, i); |
| 1317 | − mgr->mem[i].virt = ioremap_nocache(mgr->mem[i].phys, | |
| 1318 | − pci_resource_len(pci, i)); | |
| 1317 | + mgr->mem[i].virt = pci_ioremap_bar(pci, i); | |
| 1319 | 1318 | if (!mgr->mem[i].virt) { |
| 1320 | 1319 | printk(KERN_ERR "unable to remap resource 0x%lx\n", |
| 1321 | 1320 | mgr->mem[i].phys); |
| @@ -70,12 +70,24 @@ static struct sport_param sport_params[2] = { · 69 unmodified lines | ||
| 70 | 70 | } |
| 71 | 71 | }; |
| 72 | 72 | |
| 73 | −static u16 sport_req[][7] = { | |
| 74 | − { P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS, | |
| 75 | − P_SPORT0_DRPRI, P_SPORT0_RSCLK, 0}, | |
| 76 | − { P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_RFS, | |
| 77 | − P_SPORT1_DRPRI, P_SPORT1_RSCLK, 0}, | |
| 78 | −}; | |
| 73 | +/* | |
| 74 | + * Setting the TFS pin selector for SPORT 0 based on whether the selected | |
| 75 | + * port id F or G. If the port is F then no conflict should exist for the | |
| 76 | + * TFS. When Port G is selected and EMAC then there is a conflict between | |
| 77 | + * the PHY interrupt line and TFS. Current settings prevent the conflict | |
| 78 | + * by ignoring the TFS pin when Port G is selected. This allows both | |
| 79 | + * ssm2602 using Port G and EMAC concurrently. | |
| 80 | + */ | |
| 81 | +#ifdef CONFIG_BF527_SPORT0_PORTF | |
| 82 | +#define LOCAL_SPORT0_TFS (P_SPORT0_TFS) | |
| 83 | +#else | |
| 84 | +#define LOCAL_SPORT0_TFS (0) | |
| 85 | +#endif | |
| 86 | + | |
| 87 | +static u16 sport_req[][7] = { {P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS, | |
| 88 | + P_SPORT0_DRPRI, P_SPORT0_RSCLK, LOCAL_SPORT0_TFS, 0}, | |
| 89 | + {P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_RFS, P_SPORT1_DRPRI, | |
| 90 | + P_SPORT1_RSCLK, P_SPORT1_TFS, 0} }; | |
| 79 | 91 | |
| 80 | 92 | static int bf5xx_i2s_set_dai_fmt(struct snd_soc_dai *cpu_dai, |
| 81 | 93 | unsigned int fmt) |
| @@ -98,23 +110,21 @@ static int bf5xx_i2s_set_dai_fmt(struct snd_soc_dai *cpu_dai, · 16 unmodified lines | ||
| 98 | 110 | ret = -EINVAL; |
| 99 | 111 | break; |
| 100 | 112 | default: |
| 113 | + printk(KERN_ERR "%s: Unknown DAI format type\n", __func__); | |
| 101 | 114 | ret = -EINVAL; |
| 102 | 115 | break; |
| 103 | 116 | } |
| 104 | 117 | |
| 105 | 118 | switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) { |
| 106 | − case SND_SOC_DAIFMT_CBS_CFS: | |
| 107 | − ret = -EINVAL; | |
| 108 | − break; | |
| 109 | − case SND_SOC_DAIFMT_CBM_CFS: | |
| 110 | − ret = -EINVAL; | |
| 111 | − break; | |
| 112 | 119 | case SND_SOC_DAIFMT_CBM_CFM: |
| 113 | 120 | break; |
| 121 | + case SND_SOC_DAIFMT_CBS_CFS: | |
| 122 | + case SND_SOC_DAIFMT_CBM_CFS: | |
| 114 | 123 | case SND_SOC_DAIFMT_CBS_CFM: |
| 115 | 124 | ret = -EINVAL; |
| 116 | 125 | break; |
| 117 | 126 | default: |
| 127 | + printk(KERN_ERR "%s: Unknown DAI master type\n", __func__); | |
| 118 | 128 | ret = -EINVAL; |
| 119 | 129 | break; |
| 120 | 130 | } |
| @@ -140,7 +140,7 @@ SOC_SINGLE("Capture ADC Boost (+20dB) Switch", AC97_VIDEO, 6, 1, 0), · 139 unmodified lines | ||
| 140 | 140 | |
| 141 | 141 | SOC_SINGLE("ALC Target Volume", AC97_CODEC_CLASS_REV, 12, 15, 0), |
| 142 | 142 | SOC_SINGLE("ALC Hold Time", AC97_CODEC_CLASS_REV, 8, 15, 0), |
| 143 | −SOC_SINGLE("ALC Decay Time ", AC97_CODEC_CLASS_REV, 4, 15, 0), | |
| 143 | +SOC_SINGLE("ALC Decay Time", AC97_CODEC_CLASS_REV, 4, 15, 0), | |
| 144 | 144 | SOC_SINGLE("ALC Attack Time", AC97_CODEC_CLASS_REV, 0, 15, 0), |
| 145 | 145 | SOC_ENUM("ALC Function", wm9713_enum[6]), |
| 146 | 146 | SOC_SINGLE("ALC Max Volume", AC97_PCI_SVID, 11, 7, 0), |
| @@ -277,7 +277,7 @@ static int psc_i2s_trigger(struct snd_pcm_substream *substream, int cmd) · 276 unmodified lines | ||
| 277 | 277 | struct mpc52xx_psc __iomem *regs = psc_i2s->psc_regs; |
| 278 | 278 | u16 imr; |
| 279 | 279 | u8 psc_cmd; |
| 280 | − long flags; | |
| 280 | + unsigned long flags; | |
| 281 | 281 | |
| 282 | 282 | if (substream->pstr->stream == SNDRV_PCM_STREAM_CAPTURE) |
| 283 | 283 | s = &psc_i2s->capture; |
| @@ -699,9 +699,11 @@ static ssize_t psc_i2s_stat_store(struct device *dev, · 415 unmodified lines | ||
| 699 | 699 | return count; |
| 700 | 700 | } |
| 701 | 701 | |
| 702 | −DEVICE_ATTR(status, 0644, psc_i2s_status_show, NULL); | |
| 703 | −DEVICE_ATTR(playback_underrun, 0644, psc_i2s_stat_show, psc_i2s_stat_store); | |
| 704 | −DEVICE_ATTR(capture_overrun, 0644, psc_i2s_stat_show, psc_i2s_stat_store); | |
| 702 | +static DEVICE_ATTR(status, 0644, psc_i2s_status_show, NULL); | |
| 703 | +static DEVICE_ATTR(playback_underrun, 0644, psc_i2s_stat_show, | |
| 704 | + psc_i2s_stat_store); | |
| 705 | +static DEVICE_ATTR(capture_overrun, 0644, psc_i2s_stat_show, | |
| 706 | + psc_i2s_stat_store); | |
| 705 | 707 | |
| 706 | 708 | /* --------------------------------------------------------------------- |
| 707 | 709 | * OF platform bus binding code: |
| @@ -819,8 +821,8 @@ static int __devinit psc_i2s_of_probe(struct of_device *op, · 111 unmodified lines | ||
| 819 | 821 | |
| 820 | 822 | /* Register the SYSFS files */ |
| 821 | 823 | rc = device_create_file(psc_i2s->dev, &dev_attr_status); |
| 822 | − rc = device_create_file(psc_i2s->dev, &dev_attr_capture_overrun); | |
| 823 | − rc = device_create_file(psc_i2s->dev, &dev_attr_playback_underrun); | |
| 824 | + rc |= device_create_file(psc_i2s->dev, &dev_attr_capture_overrun); | |
| 825 | + rc |= device_create_file(psc_i2s->dev, &dev_attr_playback_underrun); | |
| 824 | 826 | if (rc) |
| 825 | 827 | dev_info(psc_i2s->dev, "error creating sysfs files\n"); |
| 826 | 828 | |
| @@ -1462,7 +1462,7 @@ int snd_soc_info_volsw(struct snd_kcontrol *kcontrol, · 1461 unmodified lines | ||
| 1462 | 1462 | struct soc_mixer_control *mc = |
| 1463 | 1463 | (struct soc_mixer_control *)kcontrol->private_value; |
| 1464 | 1464 | int max = mc->max; |
| 1465 | − unsigned int shift = mc->min; | |
| 1465 | + unsigned int shift = mc->shift; | |
| 1466 | 1466 | unsigned int rshift = mc->rshift; |
| 1467 | 1467 | |
| 1468 | 1468 | if (max == 1) |
| @@ -57,7 +57,7 @@ module_exit(cleanup_soundcore); · 56 unmodified lines | ||
| 57 | 57 | /* |
| 58 | 58 | * OSS sound core handling. Breaks out sound functions to submodules |
| 59 | 59 | * |
| 60 | − * Author: Alan Cox <alan.cox@linux.org> | |
| 60 | + * Author: Alan Cox <alan@lxorguk.ukuu.org.uk> | |
| 61 | 61 | * |
| 62 | 62 | * Fixes: |
| 63 | 63 | * |
| @@ -1480,6 +1480,36 @@ YAMAHA_DEVICE(0x7010, "UB99"), · 1479 unmodified lines | ||
| 1480 | 1480 | } |
| 1481 | 1481 | } |
| 1482 | 1482 | }, |
| 1483 | +{ | |
| 1484 | + /* Advanced modes of the Edirol UA-25EX. | |
| 1485 | + * For the standard mode, UA-25EX has ID 0582:00e7, which | |
| 1486 | + * offers only 16-bit PCM at 44.1 kHz and no MIDI. | |
| 1487 | + */ | |
| 1488 | + USB_DEVICE_VENDOR_SPEC(0x0582, 0x00e6), | |
| 1489 | + .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) { | |
| 1490 | + .vendor_name = "EDIROL", | |
| 1491 | + .product_name = "UA-25EX", | |
| 1492 | + .ifnum = QUIRK_ANY_INTERFACE, | |
| 1493 | + .type = QUIRK_COMPOSITE, | |
| 1494 | + .data = (const struct snd_usb_audio_quirk[]) { | |
| 1495 | + { | |
| 1496 | + .ifnum = 0, | |
| 1497 | + .type = QUIRK_AUDIO_EDIROL_UAXX | |
| 1498 | + }, | |
| 1499 | + { | |
| 1500 | + .ifnum = 1, | |
| 1501 | + .type = QUIRK_AUDIO_EDIROL_UAXX | |
| 1502 | + }, | |
| 1503 | + { | |
| 1504 | + .ifnum = 2, | |
| 1505 | + .type = QUIRK_AUDIO_EDIROL_UAXX | |
| 1506 | + }, | |
| 1507 | + { | |
| 1508 | + .ifnum = -1 | |
| 1509 | + } | |
| 1510 | + } | |
| 1511 | + } | |
| 1512 | +}, | |
| 1483 | 1513 | |
| 1484 | 1514 | /* Guillemot devices */ |
| 1485 | 1515 | { |
| @@ -25,15 +25,23 @@ · 24 unmodified lines | ||
| 25 | 25 | #include "ioapic.h" |
| 26 | 26 | |
| 27 | 27 | /* This should be called with the kvm->lock mutex held */ |
| 28 | −void kvm_set_irq(struct kvm *kvm, int irq, int level) | |
| 28 | +void kvm_set_irq(struct kvm *kvm, int irq_source_id, int irq, int level) | |
| 29 | 29 | { |
| 30 | + unsigned long *irq_state = (unsigned long *)&kvm->arch.irq_states[irq]; | |
| 31 | + | |
| 32 | + /* Logical OR for level trig interrupt */ | |
| 33 | + if (level) | |
| 34 | + set_bit(irq_source_id, irq_state); | |
| 35 | + else | |
| 36 | + clear_bit(irq_source_id, irq_state); | |
| 37 | + | |
| 30 | 38 | /* Not possible to detect if the guest uses the PIC or the |
| 31 | 39 | * IOAPIC. So set the bit in both. The guest will ignore |
| 32 | 40 | * writes to the unused one. |
| 33 | 41 | */ |
| 34 | − kvm_ioapic_set_irq(kvm->arch.vioapic, irq, level); | |
| 42 | + kvm_ioapic_set_irq(kvm->arch.vioapic, irq, !!(*irq_state)); | |
| 35 | 43 | #ifdef CONFIG_X86 |
| 36 | − kvm_pic_set_irq(pic_irqchip(kvm), irq, level); | |
| 44 | + kvm_pic_set_irq(pic_irqchip(kvm), irq, !!(*irq_state)); | |
| 37 | 45 | #endif |
| 38 | 46 | } |
| 39 | 47 | |
| @@ -58,3 +66,31 @@ void kvm_unregister_irq_ack_notifier(struct kvm *kvm, · 18 unmodified lines | ||
| 58 | 66 | { |
| 59 | 67 | hlist_del(&kian->link); |
| 60 | 68 | } |
| 69 | + | |
| 70 | +/* The caller must hold kvm->lock mutex */ | |
| 71 | +int kvm_request_irq_source_id(struct kvm *kvm) | |
| 72 | +{ | |
| 73 | + unsigned long *bitmap = &kvm->arch.irq_sources_bitmap; | |
| 74 | + int irq_source_id = find_first_zero_bit(bitmap, | |
| 75 | + sizeof(kvm->arch.irq_sources_bitmap)); | |
| 76 | + if (irq_source_id >= sizeof(kvm->arch.irq_sources_bitmap)) { | |
| 77 | + printk(KERN_WARNING "kvm: exhaust allocatable IRQ sources!\n"); | |
| 78 | + irq_source_id = -EFAULT; | |
| 79 | + } else | |
| 80 | + set_bit(irq_source_id, bitmap); | |
| 81 | + return irq_source_id; | |
| 82 | +} | |
| 83 | + | |
| 84 | +void kvm_free_irq_source_id(struct kvm *kvm, int irq_source_id) | |
| 85 | +{ | |
| 86 | + int i; | |
| 87 | + | |
| 88 | + if (irq_source_id <= 0 || | |
| 89 | + irq_source_id >= sizeof(kvm->arch.irq_sources_bitmap)) { | |
| 90 | + printk(KERN_ERR "kvm: IRQ source ID out of range!\n"); | |
| 91 | + return; | |
| 92 | + } | |
| 93 | + for (i = 0; i < KVM_IOAPIC_NUM_PINS; i++) | |
| 94 | + clear_bit(irq_source_id, &kvm->arch.irq_states[i]); | |
| 95 | + clear_bit(irq_source_id, &kvm->arch.irq_sources_bitmap); | |
| 96 | +} | |
| @@ -105,14 +105,12 @@ static void kvm_assigned_dev_interrupt_work_handler(struct work_struct *work) · 104 unmodified lines | ||
| 105 | 105 | */ |
| 106 | 106 | mutex_lock(&assigned_dev->kvm->lock); |
| 107 | 107 | kvm_set_irq(assigned_dev->kvm, |
| 108 | + assigned_dev->irq_source_id, | |
| 108 | 109 | assigned_dev->guest_irq, 1); |
| 109 | 110 | mutex_unlock(&assigned_dev->kvm->lock); |
| 110 | 111 | kvm_put_kvm(assigned_dev->kvm); |
| 111 | 112 | } |
| 112 | 113 | |
| 113 | −/* FIXME: Implement the OR logic needed to make shared interrupts on | |
| 114 | − * this line behave properly | |
| 115 | − */ | |
| 116 | 114 | static irqreturn_t kvm_assigned_dev_intr(int irq, void *dev_id) |
| 117 | 115 | { |
| 118 | 116 | struct kvm_assigned_dev_kernel *assigned_dev = |
| @@ -134,7 +132,7 @@ static void kvm_assigned_dev_ack_irq(struct kvm_irq_ack_notifier *kian) · 15 unmodified lines | ||
| 134 | 132 | |
| 135 | 133 | dev = container_of(kian, struct kvm_assigned_dev_kernel, |
| 136 | 134 | ack_notifier); |
| 137 | − kvm_set_irq(dev->kvm, dev->guest_irq, 0); | |
| 135 | + kvm_set_irq(dev->kvm, dev->irq_source_id, dev->guest_irq, 0); | |
| 138 | 136 | enable_irq(dev->host_irq); |
| 139 | 137 | } |
| 140 | 138 | |
| @@ -146,6 +144,7 @@ static void kvm_free_assigned_device(struct kvm *kvm, · 5 unmodified lines | ||
| 146 | 144 | free_irq(assigned_dev->host_irq, (void *)assigned_dev); |
| 147 | 145 | |
| 148 | 146 | kvm_unregister_irq_ack_notifier(kvm, &assigned_dev->ack_notifier); |
| 147 | + kvm_free_irq_source_id(kvm, assigned_dev->irq_source_id); | |
| 149 | 148 | |
| 150 | 149 | if (cancel_work_sync(&assigned_dev->interrupt_work)) |
| 151 | 150 | /* We had pending work. That means we will have to take |
| @@ -215,6 +214,11 @@ static int kvm_vm_ioctl_assign_irq(struct kvm *kvm, · 63 unmodified lines | ||
| 215 | 214 | match->ack_notifier.gsi = assigned_irq->guest_irq; |
| 216 | 215 | match->ack_notifier.irq_acked = kvm_assigned_dev_ack_irq; |
| 217 | 216 | kvm_register_irq_ack_notifier(kvm, &match->ack_notifier); |
| 217 | + r = kvm_request_irq_source_id(kvm); | |
| 218 | + if (r < 0) | |
| 219 | + goto out_release; | |
| 220 | + else | |
| 221 | + match->irq_source_id = r; | |
| 218 | 222 | |
| 219 | 223 | /* Even though this is PCI, we don't want to use shared |
| 220 | 224 | * interrupts. Sharing host devices with guest-assigned devices |