diff options
125 files changed, 1275 insertions, 1525 deletions
diff --git a/Documentation/ja_JP/HOWTO b/Documentation/ja_JP/HOWTO index 488c77fa3aae..0775cf4798b2 100644 --- a/Documentation/ja_JP/HOWTO +++ b/Documentation/ja_JP/HOWTO | |||
@@ -11,14 +11,14 @@ for non English (read: Japanese) speakers and is not intended as a | |||
11 | fork. So if you have any comments or updates for this file, please try | 11 | fork. So if you have any comments or updates for this file, please try |
12 | to update the original English file first. | 12 | to update the original English file first. |
13 | 13 | ||
14 | Last Updated: 2007/11/16 | 14 | Last Updated: 2008/08/21 |
15 | ================================== | 15 | ================================== |
16 | ã“ã‚Œã¯ã€ | 16 | ã“ã‚Œã¯ã€ |
17 | linux-2.6.24/Documentation/HOWTO | 17 | linux-2.6.27/Documentation/HOWTO |
18 | ã®å’Œè¨³ã§ã™ã€‚ | 18 | ã®å’Œè¨³ã§ã™ã€‚ |
19 | 19 | ||
20 | 翻訳団体: JF プãƒã‚¸ã‚§ã‚¯ãƒˆ < http://www.linux.or.jp/JF/ > | 20 | 翻訳団体: JF プãƒã‚¸ã‚§ã‚¯ãƒˆ < http://www.linux.or.jp/JF/ > |
21 | 翻訳日: 2007/11/10 | 21 | 翻訳日: 2008/8/5 |
22 | 翻訳者: Tsugikazu Shibata <tshibata at ab dot jp dot nec dot com> | 22 | 翻訳者: Tsugikazu Shibata <tshibata at ab dot jp dot nec dot com> |
23 | æ ¡æ£è€…: æ¾å€‰ã•ã‚“ <nbh--mats at nifty dot com> | 23 | æ ¡æ£è€…: æ¾å€‰ã•ã‚“ <nbh--mats at nifty dot com> |
24 | å°æž— é›…å…¸ã•ã‚“ (Masanori Kobayasi) <zap03216 at nifty dot ne dot jp> | 24 | å°æž— é›…å…¸ã•ã‚“ (Masanori Kobayasi) <zap03216 at nifty dot ne dot jp> |
@@ -287,13 +287,15 @@ Linux カーãƒãƒ«ã®é–‹ç™ºãƒ—ãƒã‚»ã‚¹ã¯ç¾åœ¨å¹¾ã¤ã‹ã®ç•°ãªã‚‹ãƒ¡ã‚¤ãƒ³ã‚ | |||
287 | ã«å®‰å®šã—ãŸçŠ¶æ…‹ã«ã‚ã‚‹ã¨åˆ¤æ–ã—ãŸã¨ãã«ãƒªãƒªãƒ¼ã‚¹ã•ã‚Œã¾ã™ã€‚目標ã¯æ¯Žé€±æ–° | 287 | ã«å®‰å®šã—ãŸçŠ¶æ…‹ã«ã‚ã‚‹ã¨åˆ¤æ–ã—ãŸã¨ãã«ãƒªãƒªãƒ¼ã‚¹ã•ã‚Œã¾ã™ã€‚目標ã¯æ¯Žé€±æ–° |
288 | ã—ã„ -rc カーãƒãƒ«ã‚’リリースã™ã‚‹ã“ã¨ã§ã™ã€‚ | 288 | ã—ã„ -rc カーãƒãƒ«ã‚’リリースã™ã‚‹ã“ã¨ã§ã™ã€‚ |
289 | 289 | ||
290 | - 以下㮠URL ã§å„ -rc リリースã«å˜åœ¨ã™ã‚‹æ—¢çŸ¥ã®å¾Œæˆ»ã‚Šå•é¡Œã®ãƒªã‚¹ãƒˆ | ||
291 | ãŒè¿½è·¡ã•ã‚Œã¾ã™- | ||
292 | http://kernelnewbies.org/known_regressions | ||
293 | |||
294 | - ã“ã®ãƒ—ãƒã‚»ã‚¹ã¯ã‚«ãƒ¼ãƒãƒ«ãŒ 「準備ãŒã§ããŸã€ã¨è€ƒãˆã‚‰ã‚Œã‚‹ã¾ã§ç¶™ç¶šã—ã¾ | 290 | - ã“ã®ãƒ—ãƒã‚»ã‚¹ã¯ã‚«ãƒ¼ãƒãƒ«ãŒ 「準備ãŒã§ããŸã€ã¨è€ƒãˆã‚‰ã‚Œã‚‹ã¾ã§ç¶™ç¶šã—ã¾ |
295 | ã™ã€‚ã“ã®ãƒ—ãƒã‚»ã‚¹ã¯ã ã„ãŸã„ 6週間継続ã—ã¾ã™ã€‚ | 291 | ã™ã€‚ã“ã®ãƒ—ãƒã‚»ã‚¹ã¯ã ã„ãŸã„ 6週間継続ã—ã¾ã™ã€‚ |
296 | 292 | ||
293 | - å„リリースã§ã®æ—¢çŸ¥ã®å¾Œæˆ»ã‚Šå•é¡Œ(regression: ã“ã®ãƒªãƒªãƒ¼ã‚¹ã®ä¸ã§æ–°è¦ | ||
294 | ã«ä½œã‚Šè¾¼ã¾ã‚ŒãŸå•é¡Œã‚’指ã™) ã¯ãã®éƒ½åº¦ Linux-kernel メーリングリスト | ||
295 | ã«æŠ•ç¨¿ã•ã‚Œã¾ã™ã€‚ゴールã¨ã—ã¦ã¯ã€ã‚«ãƒ¼ãƒãƒ«ãŒ 「準備ãŒã§ããŸã€ã¨å®£è¨€ | ||
296 | ã™ã‚‹å‰ã«ã“ã®ãƒªã‚¹ãƒˆã®é•·ã•ã‚’ゼãƒã«æ¸›ã‚‰ã™ã“ã¨ã§ã™ãŒã€ç¾å®Ÿã«ã¯ã€æ•°å€‹ã® | ||
297 | 後戻りå•é¡ŒãŒãƒªãƒªãƒ¼ã‚¹æ™‚ã«ãŸã³ãŸã³æ®‹ã£ã¦ã—ã¾ã„ã¾ã™ã€‚ | ||
298 | |||
297 | Andrew Morton ㌠Linux-kernel メーリングリストã«ã‚«ãƒ¼ãƒãƒ«ãƒªãƒªãƒ¼ã‚¹ã«ã¤ã„ | 299 | Andrew Morton ㌠Linux-kernel メーリングリストã«ã‚«ãƒ¼ãƒãƒ«ãƒªãƒªãƒ¼ã‚¹ã«ã¤ã„ |
298 | ã¦æ›¸ã„ãŸã“ã¨ã‚’ã“ã“ã§è¨€ã£ã¦ãŠãã“ã¨ã¯ä¾¡å€¤ãŒã‚ã‚Šã¾ã™- | 300 | ã¦æ›¸ã„ãŸã“ã¨ã‚’ã“ã“ã§è¨€ã£ã¦ãŠãã“ã¨ã¯ä¾¡å€¤ãŒã‚ã‚Šã¾ã™- |
299 | 「カーãƒãƒ«ãŒã„ã¤ãƒªãƒªãƒ¼ã‚¹ã•ã‚Œã‚‹ã‹ã¯èª°ã‚‚知りã¾ã›ã‚“。ãªãœãªã‚‰ã€ã“ã‚Œã¯ç¾ | 301 | 「カーãƒãƒ«ãŒã„ã¤ãƒªãƒªãƒ¼ã‚¹ã•ã‚Œã‚‹ã‹ã¯èª°ã‚‚知りã¾ã›ã‚“。ãªãœãªã‚‰ã€ã“ã‚Œã¯ç¾ |
@@ -303,18 +305,20 @@ Andrew Morton ㌠Linux-kernel メーリングリストã«ã‚«ãƒ¼ãƒãƒ«ãƒªãƒªãƒ¼ã | |||
303 | 2.6.x.y -stable カーãƒãƒ«ãƒ„リー | 305 | 2.6.x.y -stable カーãƒãƒ«ãƒ„リー |
304 | --------------------------- | 306 | --------------------------- |
305 | 307 | ||
306 | ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã«4ã¤ç›®ã®æ•°å—ãŒã¤ã„ãŸã‚«ãƒ¼ãƒãƒ«ã¯ -stable カーãƒãƒ«ã§ã™ã€‚ã“れ㫠| 308 | ãƒãƒ¼ã‚¸ãƒ§ãƒ³ç•ªå·ãŒ4ã¤ã®æ•°å—ã«åˆ†ã‹ã‚Œã¦ã„るカーãƒãƒ«ã¯ -stable カーãƒãƒ«ã§ã™ã€‚ |
307 | ã¯ã€2.6.x カーãƒãƒ«ã§è¦‹ã¤ã‹ã£ãŸã‚»ã‚ュリティå•é¡Œã‚„é‡å¤§ãªå¾Œæˆ»ã‚Šã«å¯¾ã™ã‚‹æ¯” | 309 | ã“ã‚Œã«ã¯ã€2.6.x カーãƒãƒ«ã§è¦‹ã¤ã‹ã£ãŸã‚»ã‚ュリティå•é¡Œã‚„é‡å¤§ãªå¾Œæˆ»ã‚Šã«å¯¾ |
308 | 較的å°ã•ã„é‡è¦ãªä¿®æ£ãŒå«ã¾ã‚Œã¾ã™ã€‚ | 310 | ã™ã‚‹æ¯”較的å°ã•ã„é‡è¦ãªä¿®æ£ãŒå«ã¾ã‚Œã¾ã™ã€‚ |
309 | 311 | ||
310 | ã“ã‚Œã¯ã€é–‹ç™º/実験的ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã®ãƒ†ã‚¹ãƒˆã«å”力ã™ã‚‹ã“ã¨ã«èˆˆå‘³ãŒç„¡ã〠| 312 | ã“ã‚Œã¯ã€é–‹ç™º/実験的ãƒãƒ¼ã‚¸ãƒ§ãƒ³ã®ãƒ†ã‚¹ãƒˆã«å”力ã™ã‚‹ã“ã¨ã«èˆˆå‘³ãŒç„¡ã〠|
311 | 最新ã®å®‰å®šã—ãŸã‚«ãƒ¼ãƒãƒ«ã‚’使ã„ãŸã„ユーザã«æŽ¨å¥¨ã™ã‚‹ãƒ–ランãƒã§ã™ã€‚ | 313 | 最新ã®å®‰å®šã—ãŸã‚«ãƒ¼ãƒãƒ«ã‚’使ã„ãŸã„ユーザã«æŽ¨å¥¨ã™ã‚‹ãƒ–ランãƒã§ã™ã€‚ |
312 | 314 | ||
313 | ã‚‚ã—ã€2.6.x.y カーãƒãƒ«ãŒå˜åœ¨ã—ãªã„å ´åˆã«ã¯ã€ç•ªå·ãŒä¸€ç•ªå¤§ãã„ 2.6.x | 315 | ã‚‚ã—ã€2.6.x.y カーãƒãƒ«ãŒå˜åœ¨ã—ãªã„å ´åˆã«ã¯ã€ç•ªå·ãŒä¸€ç•ªå¤§ãã„ 2.6.x ㌠|
314 | ãŒæœ€æ–°ã®å®‰å®šç‰ˆã‚«ãƒ¼ãƒãƒ«ã§ã™ã€‚ | 316 | 最新ã®å®‰å®šç‰ˆã‚«ãƒ¼ãƒãƒ«ã§ã™ã€‚ |
315 | 317 | ||
316 | 2.6.x.y 㯠"stable" ãƒãƒ¼ãƒ <stable@kernel.org> ã§ãƒ¡ãƒ³ãƒ†ã•ã‚Œã¦ãŠã‚Šã€ã | 318 | 2.6.x.y 㯠"stable" ãƒãƒ¼ãƒ <stable@kernel.org> ã§ãƒ¡ãƒ³ãƒ†ã•ã‚Œã¦ãŠã‚Šã€å¿… |
317 | ã„ãŸã„隔週ã§ãƒªãƒªãƒ¼ã‚¹ã•ã‚Œã¦ã„ã¾ã™ã€‚ | 319 | è¦ã«å¿œã˜ã¦ãƒªãƒªãƒ¼ã‚¹ã•ã‚Œã¾ã™ã€‚通常ã®ãƒªãƒªãƒ¼ã‚¹æœŸé–“㯠2週間毎ã§ã™ãŒã€å·®ã—迫㣠|
320 | ãŸå•é¡ŒãŒãªã‘ã‚Œã°ã‚‚ã†å°‘ã—é•·ããªã‚‹ã“ã¨ã‚‚ã‚ã‚Šã¾ã™ã€‚ã‚»ã‚ュリティ関連ã®å•é¡Œ | ||
321 | ã®å ´åˆã¯ã“ã‚Œã«å¯¾ã—ã¦ã ã„ãŸã„ã®å ´åˆã€ã™ãã«ãƒªãƒªãƒ¼ã‚¹ãŒã•ã‚Œã¾ã™ã€‚ | ||
318 | 322 | ||
319 | カーãƒãƒ«ãƒ„リーã«å…¥ã£ã¦ã„ã‚‹ã€Documentation/stable_kernel_rules.txt ファ | 323 | カーãƒãƒ«ãƒ„リーã«å…¥ã£ã¦ã„ã‚‹ã€Documentation/stable_kernel_rules.txt ファ |
320 | イルã«ã¯ã©ã®ã‚ˆã†ãªç¨®é¡žã®å¤‰æ›´ãŒ -stable ツリーã«å—ã‘入れå¯èƒ½ã‹ã€ã¾ãŸãƒª | 324 | イルã«ã¯ã©ã®ã‚ˆã†ãªç¨®é¡žã®å¤‰æ›´ãŒ -stable ツリーã«å—ã‘入れå¯èƒ½ã‹ã€ã¾ãŸãƒª |
@@ -341,7 +345,9 @@ linux-kernel メーリングリストã§åŽé›†ã•ã‚ŒãŸå¤šæ•°ã®ãƒ‘ッãƒã¨åŒæ | |||
341 | メインラインã¸å…¥ã‚Œã‚‹ã‚ˆã†ã« Linus ã«ãƒ—ッシュã—ã¾ã™ã€‚ | 345 | メインラインã¸å…¥ã‚Œã‚‹ã‚ˆã†ã« Linus ã«ãƒ—ッシュã—ã¾ã™ã€‚ |
342 | 346 | ||
343 | メインカーãƒãƒ«ãƒ„リーã«å«ã‚ã‚‹ãŸã‚ã« Linus ã«é€ã‚‹å‰ã«ã€ã™ã¹ã¦ã®æ–°ã—ã„パッ | 347 | メインカーãƒãƒ«ãƒ„リーã«å«ã‚ã‚‹ãŸã‚ã« Linus ã«é€ã‚‹å‰ã«ã€ã™ã¹ã¦ã®æ–°ã—ã„パッ |
344 | ãƒãŒ -mm ツリーã§ãƒ†ã‚¹ãƒˆã•ã‚Œã‚‹ã“ã¨ãŒå¼·ã推奨ã•ã‚Œã¾ã™ã€‚ | 348 | ãƒãŒ -mm ツリーã§ãƒ†ã‚¹ãƒˆã•ã‚Œã‚‹ã“ã¨ãŒå¼·ã推奨ã•ã‚Œã¦ã„ã¾ã™ã€‚マージウィン |
349 | ドウãŒé–‹ãå‰ã« -mm ツリーã«ç¾ã‚Œãªã‹ã£ãŸãƒ‘ッãƒã¯ãƒ¡ã‚¤ãƒ³ãƒ©ã‚¤ãƒ³ã«ãƒžãƒ¼ã‚¸ã• | ||
350 | れるã“ã¨ã¯å›°é›£ã«ãªã‚Šã¾ã™ã€‚ | ||
345 | 351 | ||
346 | ã“れらã®ã‚«ãƒ¼ãƒãƒ«ã¯å®‰å®šã—ã¦å‹•ä½œã™ã¹ãシステムã¨ã—ã¦ä½¿ã†ã®ã«ã¯é©åˆ‡ã§ã¯ã‚ | 352 | ã“れらã®ã‚«ãƒ¼ãƒãƒ«ã¯å®‰å®šã—ã¦å‹•ä½œã™ã¹ãシステムã¨ã—ã¦ä½¿ã†ã®ã«ã¯é©åˆ‡ã§ã¯ã‚ |
347 | ã‚Šã¾ã›ã‚“ã—ã€ã‚«ãƒ¼ãƒãƒ«ãƒ–ランãƒã®ä¸ã§ã‚‚ã‚‚ã£ã¨ã‚‚動作ã«ãƒªã‚¹ã‚¯ãŒé«˜ã„ã‚‚ã®ã§ã™ã€‚ | 353 | ã‚Šã¾ã›ã‚“ã—ã€ã‚«ãƒ¼ãƒãƒ«ãƒ–ランãƒã®ä¸ã§ã‚‚ã‚‚ã£ã¨ã‚‚動作ã«ãƒªã‚¹ã‚¯ãŒé«˜ã„ã‚‚ã®ã§ã™ã€‚ |
@@ -395,13 +401,15 @@ linux-kernel メーリングリストã§åŽé›†ã•ã‚ŒãŸå¤šæ•°ã®ãƒ‘ッãƒã¨åŒæ | |||
395 | - pcmcia, Dominik Brodowski <linux@dominikbrodowski.net> | 401 | - pcmcia, Dominik Brodowski <linux@dominikbrodowski.net> |
396 | git.kernel.org:/pub/scm/linux/kernel/git/brodo/pcmcia-2.6.git | 402 | git.kernel.org:/pub/scm/linux/kernel/git/brodo/pcmcia-2.6.git |
397 | 403 | ||
398 | - SCSI, James Bottomley <James.Bottomley@SteelEye.com> | 404 | - SCSI, James Bottomley <James.Bottomley@hansenpartnership.com> |
399 | git.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6.git | 405 | git.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6.git |
400 | 406 | ||
407 | - x86, Ingo Molnar <mingo@elte.hu> | ||
408 | git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86.git | ||
409 | |||
401 | quilt ツリー- | 410 | quilt ツリー- |
402 | - USB, PCI ドライãƒã‚³ã‚¢ã¨ I2C, Greg Kroah-Hartman <gregkh@suse.de> | 411 | - USB, ドライãƒã‚³ã‚¢ã¨ I2C, Greg Kroah-Hartman <gregkh@suse.de> |
403 | kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/ | 412 | kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/ |
404 | - x86-64 㨠i386 ã®ä»²é–“ Andi Kleen <ak@suse.de> | ||
405 | 413 | ||
406 | ãã®ä»–ã®ã‚«ãƒ¼ãƒãƒ«ãƒ„リー㯠http://git.kernel.org/ 㨠MAINTAINERS ファ | 414 | ãã®ä»–ã®ã‚«ãƒ¼ãƒãƒ«ãƒ„リー㯠http://git.kernel.org/ 㨠MAINTAINERS ファ |
407 | イルã«ä¸€è¦§è¡¨ãŒã‚ã‚Šã¾ã™ã€‚ | 415 | イルã«ä¸€è¦§è¡¨ãŒã‚ã‚Šã¾ã™ã€‚ |
@@ -412,13 +420,32 @@ linux-kernel メーリングリストã§åŽé›†ã•ã‚ŒãŸå¤šæ•°ã®ãƒ‘ッãƒã¨åŒæ | |||
412 | bugzilla.kernel.org 㯠Linux カーãƒãƒ«é–‹ç™ºè€…ãŒã‚«ãƒ¼ãƒãƒ«ã®ãƒã‚°ã‚’追跡ã™ã‚‹ | 420 | bugzilla.kernel.org 㯠Linux カーãƒãƒ«é–‹ç™ºè€…ãŒã‚«ãƒ¼ãƒãƒ«ã®ãƒã‚°ã‚’追跡ã™ã‚‹ |
413 | å ´æ‰€ã§ã™ã€‚ユーザã¯è¦‹ã¤ã‘ãŸãƒã‚°ã®å…¨ã¦ã‚’ã“ã®ãƒ„ールã§å ±å‘Šã™ã¹ãã§ã™ã€‚ | 421 | å ´æ‰€ã§ã™ã€‚ユーザã¯è¦‹ã¤ã‘ãŸãƒã‚°ã®å…¨ã¦ã‚’ã“ã®ãƒ„ールã§å ±å‘Šã™ã¹ãã§ã™ã€‚ |
414 | ã©ã† kernel bugzilla を使ã†ã‹ã®è©³ç´°ã¯ã€ä»¥ä¸‹ã‚’å‚ç…§ã—ã¦ãã ã•ã„- | 422 | ã©ã† kernel bugzilla を使ã†ã‹ã®è©³ç´°ã¯ã€ä»¥ä¸‹ã‚’å‚ç…§ã—ã¦ãã ã•ã„- |
415 | http://test.kernel.org/bugzilla/faq.html | 423 | http://bugzilla.kernel.org/page.cgi?id=faq.html |
416 | |||
417 | メインカーãƒãƒ«ã‚½ãƒ¼ã‚¹ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã«ã‚るファイル REPORTING-BUGS ã¯ã‚«ãƒ¼ãƒ | 424 | メインカーãƒãƒ«ã‚½ãƒ¼ã‚¹ãƒ‡ã‚£ãƒ¬ã‚¯ãƒˆãƒªã«ã‚るファイル REPORTING-BUGS ã¯ã‚«ãƒ¼ãƒ |
418 | ルãƒã‚°ã‚‰ã—ã„ã‚‚ã®ã«ã¤ã„ã¦ã©ã†ãƒ¬ãƒãƒ¼ãƒˆã™ã‚‹ã‹ã®è‰¯ã„テンプレートã§ã‚ã‚Šã€å• | 425 | ルãƒã‚°ã‚‰ã—ã„ã‚‚ã®ã«ã¤ã„ã¦ã©ã†ãƒ¬ãƒãƒ¼ãƒˆã™ã‚‹ã‹ã®è‰¯ã„テンプレートã§ã‚ã‚Šã€å• |
419 | é¡Œã®è¿½è·¡ã‚’助ã‘ã‚‹ãŸã‚ã«ã‚«ãƒ¼ãƒãƒ«é–‹ç™ºè€…ã«ã¨ã£ã¦ã©ã‚“ãªæƒ…å ±ãŒå¿…è¦ãªã®ã‹ã®è©³ | 426 | é¡Œã®è¿½è·¡ã‚’助ã‘ã‚‹ãŸã‚ã«ã‚«ãƒ¼ãƒãƒ«é–‹ç™ºè€…ã«ã¨ã£ã¦ã©ã‚“ãªæƒ…å ±ãŒå¿…è¦ãªã®ã‹ã®è©³ |
420 | ç´°ãŒæ›¸ã‹ã‚Œã¦ã„ã¾ã™ã€‚ | 427 | ç´°ãŒæ›¸ã‹ã‚Œã¦ã„ã¾ã™ã€‚ |
421 | 428 | ||
429 | ãƒã‚°ãƒ¬ãƒãƒ¼ãƒˆã®ç®¡ç† | ||
430 | ------------------- | ||
431 | |||
432 | ã‚ãªãŸã®ãƒãƒƒã‚ングã®ã‚¹ã‚ルを訓練ã™ã‚‹æœ€é«˜ã®æ–¹æ³•ã®ã²ã¨ã¤ã«ã€ä»–人ãŒãƒ¬ãƒãƒ¼ | ||
433 | トã—ãŸãƒã‚°ã‚’ä¿®æ£ã™ã‚‹ã“ã¨ãŒã‚ã‚Šã¾ã™ã€‚ã‚ãªãŸãŒã‚«ãƒ¼ãƒãƒ«ã‚’より安定化ã•ã›ã‚‹ | ||
434 | ã“ã«å¯„与ã™ã‚‹ã¨ã„ã†ã“ã¨ã ã‘ã§ãªãã€ã‚ãªãŸã¯ ç¾å®Ÿã®å•é¡Œã‚’ä¿®æ£ã™ã‚‹ã“ã¨ã‚’ | ||
435 | å¦ã³ã€è‡ªåˆ†ã®ã‚¹ã‚ルも強化ã§ãã€ã¾ãŸä»–ã®é–‹ç™ºè€…ãŒã‚ãªãŸã®å˜åœ¨ã«æ°—ãŒã¤ã | ||
436 | ã¾ã™ã€‚ãƒã‚°ã‚’ä¿®æ£ã™ã‚‹ã“ã¨ã¯ã€å¤šãã®é–‹ç™ºè€…ã®ä¸ã‹ã‚‰è‡ªåˆ†ãŒåŠŸç¸¾ã‚’ã‚ã’る最善 | ||
437 | ã®é“ã§ã™ã€ãªãœãªã‚‰å¤šãã®äººã¯ä»–人ã®ãƒã‚°ã®ä¿®æ£ã«æ™‚間を浪費ã™ã‚‹ã“ã¨ã‚’好㾠| ||
438 | ãªã„ã‹ã‚‰ã§ã™ã€‚ | ||
439 | |||
440 | ã™ã§ã«ãƒ¬ãƒãƒ¼ãƒˆã•ã‚ŒãŸãƒã‚°ã®ãŸã‚ã«ä»•äº‹ã‚’ã™ã‚‹ãŸã‚ã«ã¯ã€ | ||
441 | http://bugzilla.kernel.org ã«è¡Œã£ã¦ãã ã•ã„。もã—今後ã®ãƒã‚°ãƒ¬ãƒãƒ¼ãƒˆã« | ||
442 | ã¤ã„ã¦ã‚¢ãƒ‰ãƒã‚¤ã‚¹ã‚’å—ã‘ãŸã„ã®ã§ã‚ã‚Œã°ã€bugme-new メーリングリスト(æ–°ã— | ||
443 | ã„ãƒã‚°ãƒ¬ãƒãƒ¼ãƒˆã ã‘ãŒã“ã“ã«ãƒ¡ãƒ¼ãƒ«ã•ã‚Œã‚‹) ã¾ãŸã¯ bugme-janitor メーリン | ||
444 | グリスト(bugzilla ã®å¤‰æ›´æ¯Žã«ã“ã“ã«ãƒ¡ãƒ¼ãƒ«ã•ã‚Œã‚‹)ã‚’è³¼èªã§ãã¾ã™ã€‚ | ||
445 | |||
446 | http://lists.linux-foundation.org/mailman/listinfo/bugme-new | ||
447 | http://lists.linux-foundation.org/mailman/listinfo/bugme-janitors | ||
448 | |||
422 | メーリングリスト | 449 | メーリングリスト |
423 | ------------- | 450 | ------------- |
424 | 451 | ||
diff --git a/Documentation/ja_JP/SubmitChecklist b/Documentation/ja_JP/SubmitChecklist new file mode 100644 index 000000000000..6c42e071d723 --- /dev/null +++ b/Documentation/ja_JP/SubmitChecklist | |||
@@ -0,0 +1,111 @@ | |||
1 | NOTE: | ||
2 | This is a version of Documentation/SubmitChecklist into Japanese. | ||
3 | This document is maintained by Takenori Nagano <t-nagano@ah.jp.nec.com> | ||
4 | and the JF Project team <http://www.linux.or.jp/JF/>. | ||
5 | If you find any difference between this document and the original file | ||
6 | or a problem with the translation, | ||
7 | please contact the maintainer of this file or JF project. | ||
8 | |||
9 | Please also note that the purpose of this file is to be easier to read | ||
10 | for non English (read: Japanese) speakers and is not intended as a | ||
11 | fork. So if you have any comments or updates of this file, please try | ||
12 | to update the original English file first. | ||
13 | |||
14 | Last Updated: 2008/07/14 | ||
15 | ================================== | ||
16 | ã“ã‚Œã¯ã€ | ||
17 | linux-2.6.26/Documentation/SubmitChecklist ã®å’Œè¨³ã§ã™ã€‚ | ||
18 | |||
19 | 翻訳団体: JF プãƒã‚¸ã‚§ã‚¯ãƒˆ < http://www.linux.or.jp/JF/ > | ||
20 | 翻訳日: 2008/07/14 | ||
21 | 翻訳者: Takenori Nagano <t-nagano at ah dot jp dot nec dot com> | ||
22 | æ ¡æ£è€…: Masanori Kobayashi ã•ã‚“ <zap03216 at nifty dot ne dot jp> | ||
23 | ================================== | ||
24 | |||
25 | |||
26 | Linux カーãƒãƒ«ãƒ‘ッãƒæŠ•ç¨¿è€…å‘ã‘ãƒã‚§ãƒƒã‚¯ãƒªã‚¹ãƒˆ | ||
27 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
28 | |||
29 | 本書ã§ã¯ã€ãƒ‘ッãƒã‚’ã‚ˆã‚Šç´ æ—©ãå–り込んã§ã‚‚らã„ãŸã„開発者ãŒå®Ÿè·µã™ã¹ã基本的ãªäº‹æŸ„ | ||
30 | ã‚’ã„ãã¤ã‹ç´¹ä»‹ã—ã¾ã™ã€‚ã“ã“ã«ã‚ã‚‹å…¨ã¦ã®äº‹æŸ„ã¯ã€Documentation/SubmittingPatches | ||
31 | ãªã©ã®Linuxカーãƒãƒ«ãƒ‘ッãƒæŠ•ç¨¿ã«éš›ã—ã¦ã®å¿ƒå¾—を補足ã™ã‚‹ã‚‚ã®ã§ã™ã€‚ | ||
32 | |||
33 | 1: 妥当ãªCONFIGオプションや変更ã•ã‚ŒãŸCONFIGオプションã€ã¤ã¾ã‚Š =y, =m, =n | ||
34 | å…¨ã¦ã§æ£ã—ãビルドã§ãã‚‹ã“ã¨ã‚’確èªã—ã¦ãã ã•ã„。ãã®éš›ã€gccåŠã³ãƒªãƒ³ã‚«ãŒ | ||
35 | warningã‚„errorを出ã—ã¦ã„ãªã„ã“ã¨ã‚‚確èªã—ã¦ãã ã•ã„。 | ||
36 | |||
37 | 2: allnoconfig, allmodconfig オプションを用ã„ã¦æ£ã—ãビルドã§ãã‚‹ã“ã¨ã‚’ | ||
38 | 確èªã—ã¦ãã ã•ã„。 | ||
39 | |||
40 | 3: 手許ã®ã‚¯ãƒã‚¹ã‚³ãƒ³ãƒ‘イルツールやOSDLã®PLMã®ã‚ˆã†ãªã‚‚ã®ã‚’用ã„ã¦ã€è¤‡æ•°ã® | ||
41 | アーã‚テクãƒãƒ£ã«ãŠã„ã¦ã‚‚æ£ã—ãビルドã§ãã‚‹ã“ã¨ã‚’確èªã—ã¦ãã ã•ã„。 | ||
42 | |||
43 | 4: 64bité•·ã®'unsigned long'を使用ã—ã¦ã„ã‚‹ppc64ã¯ã€ã‚¯ãƒã‚¹ã‚³ãƒ³ãƒ‘イルã§ã® | ||
44 | ãƒã‚§ãƒƒã‚¯ã«é©å½“ãªã‚¢ãƒ¼ã‚テクãƒãƒ£ã§ã™ã€‚ | ||
45 | |||
46 | 5: カーãƒãƒ«ã‚³ãƒ¼ãƒ‡ã‚£ãƒ³ã‚°ã‚¹ã‚¿ã‚¤ãƒ«ã«æº–æ‹ ã—ã¦ã„ã‚‹ã‹ã©ã†ã‹ç¢ºèªã—ã¦ãã ã•ã„(!) | ||
47 | |||
48 | 6: CONFIGオプションã®è¿½åŠ ・変更をã—ãŸå ´åˆã«ã¯ã€CONFIGメニューãŒå£Šã‚Œã¦ã„ãªã„ | ||
49 | ã“ã¨ã‚’確èªã—ã¦ãã ã•ã„。 | ||
50 | |||
51 | 7: æ–°ã—ãKconfigã®ã‚ªãƒ—ã‚·ãƒ§ãƒ³ã‚’è¿½åŠ ã™ã‚‹éš›ã«ã¯ã€å¿…ãšãã®helpも記述ã—ã¦ãã ã•ã„。 | ||
52 | |||
53 | 8: é©åˆ‡ãªKconfigã®ä¾å˜é–¢ä¿‚を考ãˆãªãŒã‚‰æ…Žé‡ã«ãƒã‚§ãƒƒã‚¯ã—ã¦ãã ã•ã„。 | ||
54 | ãŸã ã—ã€ã“ã®ä½œæ¥ã¯ãƒžã‚·ãƒ³ã‚’使ã£ãŸãƒ†ã‚¹ãƒˆã§ãã¡ã‚“ã¨è¡Œã†ã®ãŒã¨ã¦ã‚‚困難ã§ã™ã€‚ | ||
55 | ã†ã¾ãã‚„ã‚‹ã«ã¯ã€è‡ªåˆ†ã®é ã§è€ƒãˆã‚‹ã“ã¨ã§ã™ã€‚ | ||
56 | |||
57 | 9: sparseを利用ã—ã¦ã¡ã‚ƒã‚“ã¨ã—ãŸã‚³ãƒ¼ãƒ‰ãƒã‚§ãƒƒã‚¯ã‚’ã—ã¦ãã ã•ã„。 | ||
58 | |||
59 | 10: 'make checkstack' 㨠'make namespacecheck' を利用ã—ã€å•é¡ŒãŒç™ºè¦‹ã•ã‚ŒãŸã‚‰ | ||
60 | ä¿®æ£ã—ã¦ãã ã•ã„。'make checkstack' ã¯æ˜Žç¤ºçš„ã«å•é¡Œã‚’示ã—ã¾ã›ã‚“ãŒã€ã©ã‚Œã‹ | ||
61 | 1ã¤ã®é–¢æ•°ãŒ512ãƒã‚¤ãƒˆã‚ˆã‚Šå¤§ãã„スタックを使ã£ã¦ã„ã‚Œã°ã€ä¿®æ£ã™ã¹ã候補㨠| ||
62 | ãªã‚Šã¾ã™ã€‚ | ||
63 | |||
64 | 11: ã‚°ãƒãƒ¼ãƒãƒ«ãªkernel API を説明ã™ã‚‹ kernel-doc をソースã®ä¸ã«å«ã‚ã¦ãã ã•ã„。 | ||
65 | ( staticãªé–¢æ•°ã«ãŠã„ã¦ã¯å¿…é ˆã§ã¯ã‚ã‚Šã¾ã›ã‚“ãŒã€å«ã‚ã¦ã‚‚らã£ã¦ã‚‚çµæ§‹ã§ã™ ) | ||
66 | ãã—ã¦ã€'make htmldocs' ã‚‚ã—ã㯠'make mandocs' を利用ã—ã¦è¿½è¨˜ã—㟠| ||
67 | ドã‚ュメントã®ãƒã‚§ãƒƒã‚¯ã‚’è¡Œã„ã€å•é¡ŒãŒè¦‹ã¤ã‹ã£ãŸå ´åˆã«ã¯ä¿®æ£ã‚’è¡Œã£ã¦ãã ã•ã„。 | ||
68 | |||
69 | 12: CONFIG_PREEMPT, CONFIG_DEBUG_PREEMPT, CONFIG_DEBUG_SLAB, | ||
70 | CONFIG_DEBUG_PAGEALLOC, CONFIG_DEBUG_MUTEXES, CONFIG_DEBUG_SPINLOCK, | ||
71 | CONFIG_DEBUG_SPINLOCK_SLEEP ã“れら全ã¦ã‚’åŒæ™‚ã«æœ‰åŠ¹ã«ã—ã¦å‹•ä½œç¢ºèªã‚’ | ||
72 | è¡Œã£ã¦ãã ã•ã„。 | ||
73 | |||
74 | 13: CONFIG_SMP, CONFIG_PREEMPT を有効ã«ã—ãŸå ´åˆã¨ç„¡åŠ¹ã«ã—ãŸå ´åˆã®ä¸¡æ–¹ã§ | ||
75 | ビルドã—ãŸä¸Šã€å‹•ä½œç¢ºèªã‚’è¡Œã£ã¦ãã ã•ã„。 | ||
76 | |||
77 | 14: ã‚‚ã—パッãƒãŒãƒ‡ã‚£ã‚¹ã‚¯ã®I/O性能ãªã©ã«å½±éŸ¿ã‚’与ãˆã‚‹ã‚ˆã†ã§ã‚ã‚Œã°ã€ | ||
78 | 'CONFIG_LBD'オプションを有効ã«ã—ãŸå ´åˆã¨ç„¡åŠ¹ã«ã—ãŸå ´åˆã®ä¸¡æ–¹ã§ | ||
79 | テストを実施ã—ã¦ã¿ã¦ãã ã•ã„。 | ||
80 | |||
81 | 15: lockdepã®æ©Ÿèƒ½ã‚’å…¨ã¦æœ‰åŠ¹ã«ã—ãŸä¸Šã§ã€å…¨ã¦ã®ã‚³ãƒ¼ãƒ‰ãƒ‘スを評価ã—ã¦ãã ã•ã„。 | ||
82 | |||
83 | 16: /proc ã«æ–°ã—ã„ã‚¨ãƒ³ãƒˆãƒªã‚’è¿½åŠ ã—ãŸå ´åˆã«ã¯ã€Documentation/ é…下㫠| ||
84 | å¿…ãšãƒ‰ã‚ãƒ¥ãƒ¡ãƒ³ãƒˆã‚’è¿½åŠ ã—ã¦ãã ã•ã„。 | ||
85 | |||
86 | 17: æ–°ã—ã„ãƒ–ãƒ¼ãƒˆãƒ‘ãƒ©ãƒ¡ãƒ¼ã‚¿ã‚’è¿½åŠ ã—ãŸå ´åˆã«ã¯ã€ | ||
87 | å¿…ãšDocumentation/kernel-parameters.txt ã«èª¬æ˜Žã‚’è¿½åŠ ã—ã¦ãã ã•ã„。 | ||
88 | |||
89 | 18: æ–°ã—ãmoduleã«ãƒ‘ãƒ©ãƒ¡ãƒ¼ã‚¿ã‚’è¿½åŠ ã—ãŸå ´åˆã«ã¯ã€MODULE_PARM_DESC()ã‚’ | ||
90 | 利用ã—ã¦å¿…ãšãã®èª¬æ˜Žã‚’記述ã—ã¦ãã ã•ã„。 | ||
91 | |||
92 | 19: æ–°ã—ã„userspaceインタフェースを作æˆã—ãŸå ´åˆã«ã¯ã€Documentation/ABI/ ã« | ||
93 | Documentation/ABI/README ã‚’å‚考ã«ã—ã¦å¿…ãšãƒ‰ã‚ãƒ¥ãƒ¡ãƒ³ãƒˆã‚’è¿½åŠ ã—ã¦ãã ã•ã„。 | ||
94 | |||
95 | 20: 'make headers_check'を実行ã—ã¦å…¨ãå•é¡ŒãŒãªã„ã“ã¨ã‚’確èªã—ã¦ãã ã•ã„。 | ||
96 | |||
97 | 21: å°‘ãªãã¨ã‚‚slabã‚¢ãƒã‚±ãƒ¼ã‚·ãƒ§ãƒ³ã¨pageã‚¢ãƒã‚±ãƒ¼ã‚·ãƒ§ãƒ³ã«å¤±æ•—ã—ãŸå ´åˆã® | ||
98 | 挙動ã«ã¤ã„ã¦ã€fault-injectionを利用ã—ã¦ç¢ºèªã—ã¦ãã ã•ã„。 | ||
99 | Documentation/fault-injection/ ã‚’å‚ç…§ã—ã¦ãã ã•ã„。 | ||
100 | |||
101 | è¿½åŠ ã—ãŸã‚³ãƒ¼ãƒ‰ãŒã‹ãªã‚Šã®é‡ã§ã‚ã£ãŸãªã‚‰ã°ã€ã‚µãƒ–システム特有㮠| ||
102 | fault-injectionã‚’è¿½åŠ ã—ãŸã»ã†ãŒè‰¯ã„ã‹ã‚‚ã—ã‚Œã¾ã›ã‚“。 | ||
103 | |||
104 | 22: æ–°ãŸã«è¿½åŠ ã—ãŸã‚³ãƒ¼ãƒ‰ã¯ã€`gcc -W'ã§ã‚³ãƒ³ãƒ‘イルã—ã¦ãã ã•ã„。 | ||
105 | ã“ã®ã‚ªãƒ—ションã¯å¤§é‡ã®ä¸è¦ãªãƒ¡ãƒƒã‚»ãƒ¼ã‚¸ã‚’出力ã—ã¾ã™ãŒã€ | ||
106 | "warning: comparison between signed and unsigned" ã®ã‚ˆã†ãªãƒ¡ãƒƒã‚»ãƒ¼ã‚¸ã¯ã€ | ||
107 | ãƒã‚°ã‚’見ã¤ã‘ã‚‹ã®ã«å½¹ã«ç«‹ã¡ã¾ã™ã€‚ | ||
108 | |||
109 | 23: 投稿ã—ãŸãƒ‘ッãƒãŒ -mm パッãƒã‚»ãƒƒãƒˆã«ãƒžãƒ¼ã‚¸ã•ã‚ŒãŸå¾Œã€å…¨ã¦ã®æ—¢å˜ã®ãƒ‘ッãƒã‚„ | ||
110 | VM, VFS ãŠã‚ˆã³ãã®ä»–ã®ã‚µãƒ–システムã«é–¢ã™ã‚‹æ§˜ã€…ãªå¤‰æ›´ã¨ã€ç¾æ™‚点ã§ã‚‚å…±å˜ | ||
111 | ã§ãã‚‹ã“ã¨ã‚’確èªã™ã‚‹ãƒ†ã‚¹ãƒˆã‚’è¡Œã£ã¦ãã ã•ã„。 | ||
diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index a8976467a983..1150444a21ab 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt | |||
@@ -1074,6 +1074,9 @@ and is between 256 and 4096 characters. It is defined in the file | |||
1074 | 1074 | ||
1075 | * [no]ncq: Turn on or off NCQ. | 1075 | * [no]ncq: Turn on or off NCQ. |
1076 | 1076 | ||
1077 | * nohrst, nosrst, norst: suppress hard, soft | ||
1078 | and both resets. | ||
1079 | |||
1077 | If there are multiple matching configurations changing | 1080 | If there are multiple matching configurations changing |
1078 | the same attribute, the last one is used. | 1081 | the same attribute, the last one is used. |
1079 | 1082 | ||
diff --git a/arch/arm/mach-integrator/impd1.c b/arch/arm/mach-integrator/impd1.c index 0a7b3267c8d8..3c8383dbe9e6 100644 --- a/arch/arm/mach-integrator/impd1.c +++ b/arch/arm/mach-integrator/impd1.c | |||
@@ -405,7 +405,7 @@ static int impd1_probe(struct lm_device *dev) | |||
405 | 405 | ||
406 | ret = amba_device_register(d, &dev->resource); | 406 | ret = amba_device_register(d, &dev->resource); |
407 | if (ret) { | 407 | if (ret) { |
408 | dev_err(&d->dev, "unable to register device: %d\n"); | 408 | dev_err(&d->dev, "unable to register device: %d\n", ret); |
409 | kfree(d); | 409 | kfree(d); |
410 | } | 410 | } |
411 | } | 411 | } |
diff --git a/arch/arm/mach-ixp4xx/fsg-setup.c b/arch/arm/mach-ixp4xx/fsg-setup.c index 0db3a909ae61..501dfdcc39fe 100644 --- a/arch/arm/mach-ixp4xx/fsg-setup.c +++ b/arch/arm/mach-ixp4xx/fsg-setup.c | |||
@@ -64,7 +64,7 @@ static struct platform_device fsg_i2c_gpio = { | |||
64 | 64 | ||
65 | static struct i2c_board_info __initdata fsg_i2c_board_info [] = { | 65 | static struct i2c_board_info __initdata fsg_i2c_board_info [] = { |
66 | { | 66 | { |
67 | I2C_BOARD_INFO("rtc-isl1208", 0x6f), | 67 | I2C_BOARD_INFO("isl1208", 0x6f), |
68 | }, | 68 | }, |
69 | }; | 69 | }; |
70 | 70 | ||
@@ -179,7 +179,6 @@ static void __init fsg_init(void) | |||
179 | { | 179 | { |
180 | DECLARE_MAC_BUF(mac_buf); | 180 | DECLARE_MAC_BUF(mac_buf); |
181 | uint8_t __iomem *f; | 181 | uint8_t __iomem *f; |
182 | int i; | ||
183 | 182 | ||
184 | ixp4xx_sys_init(); | 183 | ixp4xx_sys_init(); |
185 | 184 | ||
@@ -228,6 +227,7 @@ static void __init fsg_init(void) | |||
228 | f = ioremap(IXP4XX_EXP_BUS_BASE(0), 0x400000); | 227 | f = ioremap(IXP4XX_EXP_BUS_BASE(0), 0x400000); |
229 | if (f) { | 228 | if (f) { |
230 | #ifdef __ARMEB__ | 229 | #ifdef __ARMEB__ |
230 | int i; | ||
231 | for (i = 0; i < 6; i++) { | 231 | for (i = 0; i < 6; i++) { |
232 | fsg_plat_eth[0].hwaddr[i] = readb(f + 0x3C0422 + i); | 232 | fsg_plat_eth[0].hwaddr[i] = readb(f + 0x3C0422 + i); |
233 | fsg_plat_eth[1].hwaddr[i] = readb(f + 0x3C043B + i); | 233 | fsg_plat_eth[1].hwaddr[i] = readb(f + 0x3C043B + i); |
diff --git a/arch/arm/mach-pxa/clock.c b/arch/arm/mach-pxa/clock.c index c01eea88f787..ca8e20538157 100644 --- a/arch/arm/mach-pxa/clock.c +++ b/arch/arm/mach-pxa/clock.c | |||
@@ -125,3 +125,28 @@ void clks_register(struct clk *clks, size_t num) | |||
125 | list_add(&clks[i].node, &clocks); | 125 | list_add(&clks[i].node, &clocks); |
126 | mutex_unlock(&clocks_mutex); | 126 | mutex_unlock(&clocks_mutex); |
127 | } | 127 | } |
128 | |||
129 | int clk_add_alias(char *alias, struct device *alias_dev, char *id, | ||
130 | struct device *dev) | ||
131 | { | ||
132 | struct clk *r = clk_lookup(dev, id); | ||
133 | struct clk *new; | ||
134 | |||
135 | if (!r) | ||
136 | return -ENODEV; | ||
137 | |||
138 | new = kzalloc(sizeof(struct clk), GFP_KERNEL); | ||
139 | |||
140 | if (!new) | ||
141 | return -ENOMEM; | ||
142 | |||
143 | new->name = alias; | ||
144 | new->dev = alias_dev; | ||
145 | new->other = r; | ||
146 | |||
147 | mutex_lock(&clocks_mutex); | ||
148 | list_add(&new->node, &clocks); | ||
149 | mutex_unlock(&clocks_mutex); | ||
150 | |||
151 | return 0; | ||
152 | } | ||
diff --git a/arch/arm/mach-pxa/clock.h b/arch/arm/mach-pxa/clock.h index 1ec8f9178aaf..73be795fe3bf 100644 --- a/arch/arm/mach-pxa/clock.h +++ b/arch/arm/mach-pxa/clock.h | |||
@@ -1,3 +1,5 @@ | |||
1 | #include <linux/list.h> | ||
2 | |||
1 | struct clk; | 3 | struct clk; |
2 | 4 | ||
3 | struct clkops { | 5 | struct clkops { |
@@ -86,3 +88,6 @@ extern void clk_pxa3xx_cken_disable(struct clk *); | |||
86 | #endif | 88 | #endif |
87 | 89 | ||
88 | void clks_register(struct clk *clks, size_t num); | 90 | void clks_register(struct clk *clks, size_t num); |
91 | int clk_add_alias(char *alias, struct device *alias_dev, char *id, | ||
92 | struct device *dev); | ||
93 | |||
diff --git a/arch/arm/mach-pxa/eseries.c b/arch/arm/mach-pxa/eseries.c index 03942450885b..001a252bd514 100644 --- a/arch/arm/mach-pxa/eseries.c +++ b/arch/arm/mach-pxa/eseries.c | |||
@@ -10,18 +10,78 @@ | |||
10 | * | 10 | * |
11 | */ | 11 | */ |
12 | 12 | ||
13 | #include <linux/kernel.h> | ||
13 | #include <linux/init.h> | 14 | #include <linux/init.h> |
14 | 15 | ||
15 | #include <asm/setup.h> | 16 | #include <asm/setup.h> |
16 | #include <asm/mach/arch.h> | 17 | #include <asm/mach/arch.h> |
17 | #include <mach/hardware.h> | ||
18 | #include <asm/mach-types.h> | 18 | #include <asm/mach-types.h> |
19 | 19 | ||
20 | #include <mach/mfp-pxa25x.h> | ||
21 | #include <mach/hardware.h> | ||
22 | |||
20 | #include "generic.h" | 23 | #include "generic.h" |
21 | 24 | ||
25 | static unsigned long e740_pin_config[] __initdata = { | ||
26 | /* Chip selects */ | ||
27 | GPIO15_nCS_1, /* CS1 - Flash */ | ||
28 | GPIO79_nCS_3, /* CS3 - IMAGEON */ | ||
29 | GPIO80_nCS_4, /* CS4 - TMIO */ | ||
30 | |||
31 | /* Clocks */ | ||
32 | GPIO12_32KHz, | ||
33 | |||
34 | /* BTUART */ | ||
35 | GPIO42_BTUART_RXD, | ||
36 | GPIO43_BTUART_TXD, | ||
37 | GPIO44_BTUART_CTS, | ||
38 | GPIO45_GPIO, /* Used by TMIO for #SUSPEND */ | ||
39 | |||
40 | /* PC Card */ | ||
41 | GPIO8_GPIO, /* CD0 */ | ||
42 | GPIO44_GPIO, /* CD1 */ | ||
43 | GPIO11_GPIO, /* IRQ0 */ | ||
44 | GPIO6_GPIO, /* IRQ1 */ | ||
45 | GPIO27_GPIO, /* RST0 */ | ||
46 | GPIO24_GPIO, /* RST1 */ | ||
47 | GPIO20_GPIO, /* PWR0 */ | ||
48 | GPIO23_GPIO, /* PWR1 */ | ||
49 | GPIO48_nPOE, | ||
50 | GPIO49_nPWE, | ||
51 | GPIO50_nPIOR, | ||
52 | GPIO51_nPIOW, | ||
53 | GPIO52_nPCE_1, | ||
54 | GPIO53_nPCE_2, | ||
55 | GPIO54_nPSKTSEL, | ||
56 | GPIO55_nPREG, | ||
57 | GPIO56_nPWAIT, | ||
58 | GPIO57_nIOIS16, | ||
59 | |||
60 | /* wakeup */ | ||
61 | GPIO0_GPIO | WAKEUP_ON_EDGE_RISE, | ||
62 | }; | ||
63 | |||
64 | static unsigned long e400_pin_config[] __initdata = { | ||
65 | /* Chip selects */ | ||
66 | GPIO15_nCS_1, /* CS1 - Flash */ | ||
67 | GPIO80_nCS_4, /* CS4 - TMIO */ | ||
68 | |||
69 | /* Clocks */ | ||
70 | GPIO12_32KHz, | ||
71 | |||
72 | /* BTUART */ | ||
73 | GPIO42_BTUART_RXD, | ||
74 | GPIO43_BTUART_TXD, | ||
75 | GPIO44_BTUART_CTS, | ||
76 | GPIO45_GPIO, /* Used by TMIO for #SUSPEND */ | ||
77 | |||
78 | /* wakeup */ | ||
79 | GPIO0_GPIO | WAKEUP_ON_EDGE_RISE, | ||
80 | }; | ||
81 | |||
22 | /* Only e800 has 128MB RAM */ | 82 | /* Only e800 has 128MB RAM */ |
23 | static void __init eseries_fixup(struct machine_desc *desc, | 83 | static void __init eseries_fixup(struct machine_desc *desc, |
24 | struct tag *tags, char **cmdline, struct meminfo *mi) | 84 | struct tag *tags, char **cmdline, struct meminfo *mi) |
25 | { | 85 | { |
26 | mi->nr_banks=1; | 86 | mi->nr_banks=1; |
27 | mi->bank[0].start = 0xa0000000; | 87 | mi->bank[0].start = 0xa0000000; |
@@ -32,83 +92,95 @@ static void __init eseries_fixup(struct machine_desc *desc, | |||
32 | mi->bank[0].size = (64*1024*1024); | 92 | mi->bank[0].size = (64*1024*1024); |
33 | } | 93 | } |
34 | 94 | ||
95 | static void __init e740_init(void) | ||
96 | { | ||
97 | pxa2xx_mfp_config(ARRAY_AND_SIZE(e740_pin_config)); | ||
98 | } | ||
99 | |||
100 | static void __init e400_init(void) | ||
101 | { | ||
102 | pxa2xx_mfp_config(ARRAY_AND_SIZE(e400_pin_config)); | ||
103 | } | ||
104 | |||
35 | /* e-series machine definitions */ | 105 | /* e-series machine definitions */ |
36 | 106 | ||
37 | #ifdef CONFIG_MACH_E330 | 107 | #ifdef CONFIG_MACH_E330 |
38 | MACHINE_START(E330, "Toshiba e330") | 108 | MACHINE_START(E330, "Toshiba e330") |
39 | /* Maintainer: Ian Molton (spyro@f2s.com) */ | 109 | /* Maintainer: Ian Molton (spyro@f2s.com) */ |
40 | .phys_io = 0x40000000, | 110 | .phys_io = 0x40000000, |
41 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, | 111 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, |
42 | .boot_params = 0xa0000100, | 112 | .boot_params = 0xa0000100, |
43 | .map_io = pxa_map_io, | 113 | .map_io = pxa_map_io, |
44 | .init_irq = pxa25x_init_irq, | 114 | .init_irq = pxa25x_init_irq, |
45 | .fixup = eseries_fixup, | 115 | .fixup = eseries_fixup, |
46 | .timer = &pxa_timer, | 116 | .timer = &pxa_timer, |
47 | MACHINE_END | 117 | MACHINE_END |
48 | #endif | 118 | #endif |
49 | 119 | ||
50 | #ifdef CONFIG_MACH_E350 | 120 | #ifdef CONFIG_MACH_E350 |
51 | MACHINE_START(E350, "Toshiba e350") | 121 | MACHINE_START(E350, "Toshiba e350") |
52 | /* Maintainer: Ian Molton (spyro@f2s.com) */ | 122 | /* Maintainer: Ian Molton (spyro@f2s.com) */ |
53 | .phys_io = 0x40000000, | 123 | .phys_io = 0x40000000, |
54 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, | 124 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, |
55 | .boot_params = 0xa0000100, | 125 | .boot_params = 0xa0000100, |
56 | .map_io = pxa_map_io, | 126 | .map_io = pxa_map_io, |
57 | .init_irq = pxa25x_init_irq, | 127 | .init_irq = pxa25x_init_irq, |
58 | .fixup = eseries_fixup, | 128 | .fixup = eseries_fixup, |
59 | .timer = &pxa_timer, | 129 | .timer = &pxa_timer, |
60 | MACHINE_END | 130 | MACHINE_END |
61 | #endif | 131 | #endif |
62 | 132 | ||
63 | #ifdef CONFIG_MACH_E740 | 133 | #ifdef CONFIG_MACH_E740 |
64 | MACHINE_START(E740, "Toshiba e740") | 134 | MACHINE_START(E740, "Toshiba e740") |
65 | /* Maintainer: Ian Molton (spyro@f2s.com) */ | 135 | /* Maintainer: Ian Molton (spyro@f2s.com) */ |
66 | .phys_io = 0x40000000, | 136 | .phys_io = 0x40000000, |
67 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, | 137 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, |
68 | .boot_params = 0xa0000100, | 138 | .boot_params = 0xa0000100, |
69 | .map_io = pxa_map_io, | 139 | .map_io = pxa_map_io, |
70 | .init_irq = pxa25x_init_irq, | 140 | .init_irq = pxa25x_init_irq, |
71 | .fixup = eseries_fixup, | 141 | .fixup = eseries_fixup, |
72 | .timer = &pxa_timer, | 142 | .init_machine = e740_init, |
143 | .timer = &pxa_timer, | ||
73 | MACHINE_END | 144 | MACHINE_END |
74 | #endif | 145 | #endif |
75 | 146 | ||
76 | #ifdef CONFIG_MACH_E750 | 147 | #ifdef CONFIG_MACH_E750 |
77 | MACHINE_START(E750, "Toshiba e750") | 148 | MACHINE_START(E750, "Toshiba e750") |
78 | /* Maintainer: Ian Molton (spyro@f2s.com) */ | 149 | /* Maintainer: Ian Molton (spyro@f2s.com) */ |
79 | .phys_io = 0x40000000, | 150 | .phys_io = 0x40000000, |
80 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, | 151 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, |
81 | .boot_params = 0xa0000100, | 152 | .boot_params = 0xa0000100, |
82 | .map_io = pxa_map_io, | 153 | .map_io = pxa_map_io, |
83 | .init_irq = pxa25x_init_irq, | 154 | .init_irq = pxa25x_init_irq, |
84 | .fixup = eseries_fixup, | 155 | .fixup = eseries_fixup, |
85 | .timer = &pxa_timer, | 156 | .timer = &pxa_timer, |
86 | MACHINE_END | 157 | MACHINE_END |
87 | #endif | 158 | #endif |
88 | 159 | ||
89 | #ifdef CONFIG_MACH_E400 | 160 | #ifdef CONFIG_MACH_E400 |
90 | MACHINE_START(E400, "Toshiba e400") | 161 | MACHINE_START(E400, "Toshiba e400") |
91 | /* Maintainer: Ian Molton (spyro@f2s.com) */ | 162 | /* Maintainer: Ian Molton (spyro@f2s.com) */ |
92 | .phys_io = 0x40000000, | 163 | .phys_io = 0x40000000, |
93 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, | 164 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, |
94 | .boot_params = 0xa0000100, | 165 | .boot_params = 0xa0000100, |
95 | .map_io = pxa_map_io, | 166 | .map_io = pxa_map_io, |
96 | .init_irq = pxa25x_init_irq, | 167 | .init_irq = pxa25x_init_irq, |
97 | .fixup = eseries_fixup, | 168 | .fixup = eseries_fixup, |
98 | .timer = &pxa_timer, | 169 | .init_machine = e400_init, |
170 | .timer = &pxa_timer, | ||
99 | MACHINE_END | 171 | MACHINE_END |
100 | #endif | 172 | #endif |
101 | 173 | ||
102 | #ifdef CONFIG_MACH_E800 | 174 | #ifdef CONFIG_MACH_E800 |
103 | MACHINE_START(E800, "Toshiba e800") | 175 | MACHINE_START(E800, "Toshiba e800") |
104 | /* Maintainer: Ian Molton (spyro@f2s.com) */ | 176 | /* Maintainer: Ian Molton (spyro@f2s.com) */ |
105 | .phys_io = 0x40000000, | 177 | .phys_io = 0x40000000, |
106 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, | 178 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, |
107 | .boot_params = 0xa0000100, | 179 | .boot_params = 0xa0000100, |
108 | .map_io = pxa_map_io, | 180 | .map_io = pxa_map_io, |
109 | .init_irq = pxa25x_init_irq, | 181 | .init_irq = pxa25x_init_irq, |
110 | .fixup = eseries_fixup, | 182 | .fixup = eseries_fixup, |
111 | .timer = &pxa_timer, | 183 | .timer = &pxa_timer, |
112 | MACHINE_END | 184 | MACHINE_END |
113 | #endif | 185 | #endif |
114 | 186 | ||
diff --git a/arch/arm/mach-pxa/include/mach/irqs.h b/arch/arm/mach-pxa/include/mach/irqs.h index 32772bc6925c..108b5db9b2af 100644 --- a/arch/arm/mach-pxa/include/mach/irqs.h +++ b/arch/arm/mach-pxa/include/mach/irqs.h | |||
@@ -183,6 +183,7 @@ | |||
183 | defined(CONFIG_MACH_TOSA) || \ | 183 | defined(CONFIG_MACH_TOSA) || \ |
184 | defined(CONFIG_MACH_MAINSTONE) || \ | 184 | defined(CONFIG_MACH_MAINSTONE) || \ |
185 | defined(CONFIG_MACH_PCM027) || \ | 185 | defined(CONFIG_MACH_PCM027) || \ |
186 | defined(CONFIG_ARCH_PXA_ESERIES) || \ | ||
186 | defined(CONFIG_MACH_MAGICIAN) | 187 | defined(CONFIG_MACH_MAGICIAN) |
187 | #define NR_IRQS (IRQ_BOARD_END) | 188 | #define NR_IRQS (IRQ_BOARD_END) |
188 | #elif defined(CONFIG_MACH_ZYLONITE) | 189 | #elif defined(CONFIG_MACH_ZYLONITE) |
diff --git a/arch/arm/mach-pxa/lubbock.c b/arch/arm/mach-pxa/lubbock.c index bb9e09208b9f..4ffdff2d9ff1 100644 --- a/arch/arm/mach-pxa/lubbock.c +++ b/arch/arm/mach-pxa/lubbock.c | |||
@@ -52,6 +52,7 @@ | |||
52 | #include <mach/mmc.h> | 52 | #include <mach/mmc.h> |
53 | 53 | ||
54 | #include "generic.h" | 54 | #include "generic.h" |
55 | #include "clock.h" | ||
55 | #include "devices.h" | 56 | #include "devices.h" |
56 | 57 | ||
57 | static unsigned long lubbock_pin_config[] __initdata = { | 58 | static unsigned long lubbock_pin_config[] __initdata = { |
@@ -485,6 +486,7 @@ static void __init lubbock_init(void) | |||
485 | 486 | ||
486 | pxa2xx_mfp_config(ARRAY_AND_SIZE(lubbock_pin_config)); | 487 | pxa2xx_mfp_config(ARRAY_AND_SIZE(lubbock_pin_config)); |
487 | 488 | ||
489 | clk_add_alias("SA1111_CLK", NULL, "GPIO11_CLK", NULL); | ||
488 | pxa_set_udc_info(&udc_info); | 490 | pxa_set_udc_info(&udc_info); |
489 | set_pxa_fb_info(&sharp_lm8v31); | 491 | set_pxa_fb_info(&sharp_lm8v31); |
490 | pxa_set_mci_info(&lubbock_mci_platform_data); | 492 | pxa_set_mci_info(&lubbock_mci_platform_data); |
diff --git a/arch/arm/mach-pxa/pxa25x.c b/arch/arm/mach-pxa/pxa25x.c index 9e5d8a8c6424..305452b56e91 100644 --- a/arch/arm/mach-pxa/pxa25x.c +++ b/arch/arm/mach-pxa/pxa25x.c | |||
@@ -166,8 +166,7 @@ static struct clk pxa25x_hwuart_clk = | |||
166 | ; | 166 | ; |
167 | 167 | ||
168 | /* | 168 | /* |
169 | * PXA 2xx clock declarations. Order is important (see aliases below) | 169 | * PXA 2xx clock declarations. |
170 | * Please be careful not to disrupt the ordering. | ||
171 | */ | 170 | */ |
172 | static struct clk pxa25x_clks[] = { | 171 | static struct clk pxa25x_clks[] = { |
173 | INIT_CK("LCDCLK", LCD, &clk_pxa25x_lcd_ops, &pxa_device_fb.dev), | 172 | INIT_CK("LCDCLK", LCD, &clk_pxa25x_lcd_ops, &pxa_device_fb.dev), |
@@ -194,11 +193,6 @@ static struct clk pxa25x_clks[] = { | |||
194 | INIT_CKEN("FICPCLK", FICP, 47923000, 0, NULL), | 193 | INIT_CKEN("FICPCLK", FICP, 47923000, 0, NULL), |
195 | }; | 194 | }; |
196 | 195 | ||
197 | static struct clk pxa2xx_clk_aliases[] = { | ||
198 | INIT_CKOTHER("GPIO7_CLK", &pxa25x_clks[4], NULL), | ||
199 | INIT_CKOTHER("SA1111_CLK", &pxa25x_clks[5], NULL), | ||
200 | }; | ||
201 | |||
202 | #ifdef CONFIG_PM | 196 | #ifdef CONFIG_PM |
203 | 197 | ||
204 | #define SAVE(x) sleep_save[SLEEP_SAVE_##x] = x | 198 | #define SAVE(x) sleep_save[SLEEP_SAVE_##x] = x |
@@ -375,8 +369,6 @@ static int __init pxa25x_init(void) | |||
375 | if (cpu_is_pxa255()) | 369 | if (cpu_is_pxa255()) |
376 | ret = platform_device_register(&pxa_device_hwuart); | 370 | ret = platform_device_register(&pxa_device_hwuart); |
377 | 371 | ||
378 | clks_register(pxa2xx_clk_aliases, ARRAY_SIZE(pxa2xx_clk_aliases)); | ||
379 | |||
380 | return ret; | 372 | return ret; |
381 | } | 373 | } |
382 | 374 | ||
diff --git a/arch/arm/mach-pxa/pxa300.c b/arch/arm/mach-pxa/pxa300.c index 494fc1f032db..9adc7fc4618a 100644 --- a/arch/arm/mach-pxa/pxa300.c +++ b/arch/arm/mach-pxa/pxa300.c | |||
@@ -90,7 +90,9 @@ static struct clk common_clks[] = { | |||
90 | }; | 90 | }; |
91 | 91 | ||
92 | static struct clk pxa310_clks[] = { | 92 | static struct clk pxa310_clks[] = { |
93 | #ifdef CONFIG_CPU_PXA310 | ||
93 | PXA3xx_CKEN("MMCCLK", MMC3, 19500000, 0, &pxa3xx_device_mci3.dev), | 94 | PXA3xx_CKEN("MMCCLK", MMC3, 19500000, 0, &pxa3xx_device_mci3.dev), |
95 | #endif | ||
94 | }; | 96 | }; |
95 | 97 | ||
96 | static int __init pxa300_init(void) | 98 | static int __init pxa300_init(void) |
diff --git a/arch/s390/defconfig b/arch/s390/defconfig index c5cdb975d590..9b0bc2c9fba0 100644 --- a/arch/s390/defconfig +++ b/arch/s390/defconfig | |||
@@ -1,7 +1,7 @@ | |||
1 | # | 1 | # |
2 | # Automatically generated make config: don't edit | 2 | # Automatically generated make config: don't edit |
3 | # Linux kernel version: 2.6.26-rc4 | 3 | # Linux kernel version: 2.6.27-rc4 |
4 | # Fri May 30 09:49:33 2008 | 4 | # Thu Aug 21 19:43:29 2008 |
5 | # | 5 | # |
6 | CONFIG_SCHED_MC=y | 6 | CONFIG_SCHED_MC=y |
7 | CONFIG_MMU=y | 7 | CONFIG_MMU=y |
@@ -68,7 +68,6 @@ CONFIG_INITRAMFS_SOURCE="" | |||
68 | CONFIG_SYSCTL=y | 68 | CONFIG_SYSCTL=y |
69 | # CONFIG_EMBEDDED is not set | 69 | # CONFIG_EMBEDDED is not set |
70 | CONFIG_SYSCTL_SYSCALL=y | 70 | CONFIG_SYSCTL_SYSCALL=y |
71 | CONFIG_SYSCTL_SYSCALL_CHECK=y | ||
72 | CONFIG_KALLSYMS=y | 71 | CONFIG_KALLSYMS=y |
73 | # CONFIG_KALLSYMS_ALL is not set | 72 | # CONFIG_KALLSYMS_ALL is not set |
74 | # CONFIG_KALLSYMS_EXTRA_PASS is not set | 73 | # CONFIG_KALLSYMS_EXTRA_PASS is not set |
@@ -93,11 +92,17 @@ CONFIG_SLAB=y | |||
93 | # CONFIG_MARKERS is not set | 92 | # CONFIG_MARKERS is not set |
94 | CONFIG_HAVE_OPROFILE=y | 93 | CONFIG_HAVE_OPROFILE=y |
95 | CONFIG_KPROBES=y | 94 | CONFIG_KPROBES=y |
95 | # CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS is not set | ||
96 | CONFIG_KRETPROBES=y | 96 | CONFIG_KRETPROBES=y |
97 | # CONFIG_HAVE_IOREMAP_PROT is not set | ||
97 | CONFIG_HAVE_KPROBES=y | 98 | CONFIG_HAVE_KPROBES=y |
98 | CONFIG_HAVE_KRETPROBES=y | 99 | CONFIG_HAVE_KRETPROBES=y |
100 | # CONFIG_HAVE_ARCH_TRACEHOOK is not set | ||
99 | # CONFIG_HAVE_DMA_ATTRS is not set | 101 | # CONFIG_HAVE_DMA_ATTRS is not set |
102 | # CONFIG_USE_GENERIC_SMP_HELPERS is not set | ||
103 | # CONFIG_HAVE_CLK is not set | ||
100 | CONFIG_PROC_PAGE_MONITOR=y | 104 | CONFIG_PROC_PAGE_MONITOR=y |
105 | # CONFIG_HAVE_GENERIC_DMA_COHERENT is not set | ||
101 | CONFIG_SLABINFO=y | 106 | CONFIG_SLABINFO=y |
102 | CONFIG_RT_MUTEXES=y | 107 | CONFIG_RT_MUTEXES=y |
103 | # CONFIG_TINY_SHMEM is not set | 108 | # CONFIG_TINY_SHMEM is not set |
@@ -113,6 +118,7 @@ CONFIG_STOP_MACHINE=y | |||
113 | CONFIG_BLOCK=y | 118 | CONFIG_BLOCK=y |
114 | # CONFIG_BLK_DEV_IO_TRACE is not set | 119 | # CONFIG_BLK_DEV_IO_TRACE is not set |
115 | CONFIG_BLK_DEV_BSG=y | 120 | CONFIG_BLK_DEV_BSG=y |
121 | # CONFIG_BLK_DEV_INTEGRITY is not set | ||
116 | CONFIG_BLOCK_COMPAT=y | 122 | CONFIG_BLOCK_COMPAT=y |
117 | 123 | ||
118 | # | 124 | # |
@@ -175,6 +181,8 @@ CONFIG_PREEMPT=y | |||
175 | CONFIG_ARCH_SPARSEMEM_ENABLE=y | 181 | CONFIG_ARCH_SPARSEMEM_ENABLE=y |
176 | CONFIG_ARCH_SPARSEMEM_DEFAULT=y | 182 | CONFIG_ARCH_SPARSEMEM_DEFAULT=y |
177 | CONFIG_ARCH_SELECT_MEMORY_MODEL=y | 183 | CONFIG_ARCH_SELECT_MEMORY_MODEL=y |
184 | CONFIG_ARCH_ENABLE_MEMORY_HOTPLUG=y | ||
185 | CONFIG_ARCH_ENABLE_MEMORY_HOTREMOVE=y | ||
178 | CONFIG_SELECT_MEMORY_MODEL=y | 186 | CONFIG_SELECT_MEMORY_MODEL=y |
179 | # CONFIG_FLATMEM_MANUAL is not set | 187 | # CONFIG_FLATMEM_MANUAL is not set |
180 | # CONFIG_DISCONTIGMEM_MANUAL is not set | 188 | # CONFIG_DISCONTIGMEM_MANUAL is not set |
@@ -185,8 +193,12 @@ CONFIG_HAVE_MEMORY_PRESENT=y | |||
185 | CONFIG_SPARSEMEM_EXTREME=y | 193 | CONFIG_SPARSEMEM_EXTREME=y |
186 | CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y | 194 | CONFIG_SPARSEMEM_VMEMMAP_ENABLE=y |
187 | CONFIG_SPARSEMEM_VMEMMAP=y | 195 | CONFIG_SPARSEMEM_VMEMMAP=y |
196 | CONFIG_MEMORY_HOTPLUG=y | ||
197 | CONFIG_MEMORY_HOTPLUG_SPARSE=y | ||
198 | CONFIG_MEMORY_HOTREMOVE=y | ||
188 | CONFIG_PAGEFLAGS_EXTENDED=y | 199 | CONFIG_PAGEFLAGS_EXTENDED=y |
189 | CONFIG_SPLIT_PTLOCK_CPUS=4 | 200 | CONFIG_SPLIT_PTLOCK_CPUS=4 |
201 | CONFIG_MIGRATION=y | ||
190 | CONFIG_RESOURCES_64BIT=y | 202 | CONFIG_RESOURCES_64BIT=y |
191 | CONFIG_ZONE_DMA_FLAG=1 | 203 | CONFIG_ZONE_DMA_FLAG=1 |
192 | CONFIG_BOUNCE=y | 204 | CONFIG_BOUNCE=y |
@@ -198,6 +210,7 @@ CONFIG_VIRT_TO_BUS=y | |||
198 | CONFIG_MACHCHK_WARNING=y | 210 | CONFIG_MACHCHK_WARNING=y |
199 | CONFIG_QDIO=y | 211 | CONFIG_QDIO=y |
200 | # CONFIG_QDIO_DEBUG is not set | 212 | # CONFIG_QDIO_DEBUG is not set |
213 | CONFIG_CHSC_SCH=m | ||
201 | 214 | ||
202 | # | 215 | # |
203 | # Misc | 216 | # Misc |
@@ -206,6 +219,7 @@ CONFIG_IPL=y | |||
206 | # CONFIG_IPL_TAPE is not set | 219 | # CONFIG_IPL_TAPE is not set |
207 | CONFIG_IPL_VM=y | 220 | CONFIG_IPL_VM=y |
208 | CONFIG_BINFMT_ELF=y | 221 | CONFIG_BINFMT_ELF=y |
222 | CONFIG_COMPAT_BINFMT_ELF=y | ||
209 | CONFIG_BINFMT_MISC=m | 223 | CONFIG_BINFMT_MISC=m |
210 | CONFIG_FORCE_MAX_ZONEORDER=9 | 224 | CONFIG_FORCE_MAX_ZONEORDER=9 |
211 | # CONFIG_PROCESS_DEBUG is not set | 225 | # CONFIG_PROCESS_DEBUG is not set |
@@ -226,10 +240,6 @@ CONFIG_S390_HYPFS_FS=y | |||
226 | CONFIG_KEXEC=y | 240 | CONFIG_KEXEC=y |
227 | # CONFIG_ZFCPDUMP is not set | 241 | # CONFIG_ZFCPDUMP is not set |
228 | CONFIG_S390_GUEST=y | 242 | CONFIG_S390_GUEST=y |
229 | |||
230 | # | ||
231 | # Networking | ||
232 | # | ||
233 | CONFIG_NET=y | 243 | CONFIG_NET=y |
234 | 244 | ||
235 | # | 245 | # |
@@ -364,7 +374,6 @@ CONFIG_NET_SCH_CBQ=m | |||
364 | # CONFIG_NET_SCH_HTB is not set | 374 | # CONFIG_NET_SCH_HTB is not set |
365 | # CONFIG_NET_SCH_HFSC is not set | 375 | # CONFIG_NET_SCH_HFSC is not set |
366 | CONFIG_NET_SCH_PRIO=m | 376 | CONFIG_NET_SCH_PRIO=m |
367 | CONFIG_NET_SCH_RR=m | ||
368 | CONFIG_NET_SCH_RED=m | 377 | CONFIG_NET_SCH_RED=m |
369 | CONFIG_NET_SCH_SFQ=m | 378 | CONFIG_NET_SCH_SFQ=m |
370 | CONFIG_NET_SCH_TEQL=m | 379 | CONFIG_NET_SCH_TEQL=m |
@@ -430,7 +439,9 @@ CONFIG_CCW=y | |||
430 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" | 439 | CONFIG_UEVENT_HELPER_PATH="/sbin/hotplug" |
431 | CONFIG_STANDALONE=y | 440 | CONFIG_STANDALONE=y |
432 | CONFIG_PREVENT_FIRMWARE_BUILD=y | 441 | CONFIG_PREVENT_FIRMWARE_BUILD=y |
433 | # CONFIG_FW_LOADER is not set | 442 | CONFIG_FW_LOADER=y |
443 | # CONFIG_FIRMWARE_IN_KERNEL is not set | ||
444 | CONFIG_EXTRA_FIRMWARE="" | ||
434 | # CONFIG_DEBUG_DRIVER is not set | 445 | # CONFIG_DEBUG_DRIVER is not set |
435 | # CONFIG_DEBUG_DEVRES is not set | 446 | # CONFIG_DEBUG_DEVRES is not set |
436 | CONFIG_SYS_HYPERVISOR=y | 447 | CONFIG_SYS_HYPERVISOR=y |
@@ -507,6 +518,11 @@ CONFIG_SCSI_LOWLEVEL=y | |||
507 | # CONFIG_ISCSI_TCP is not set | 518 | # CONFIG_ISCSI_TCP is not set |
508 | # CONFIG_SCSI_DEBUG is not set | 519 | # CONFIG_SCSI_DEBUG is not set |
509 | CONFIG_ZFCP=y | 520 | CONFIG_ZFCP=y |
521 | CONFIG_SCSI_DH=m | ||
522 | CONFIG_SCSI_DH_RDAC=m | ||
523 | CONFIG_SCSI_DH_HP_SW=m | ||
524 | CONFIG_SCSI_DH_EMC=m | ||
525 | CONFIG_SCSI_DH_ALUA=m | ||
510 | CONFIG_MD=y | 526 | CONFIG_MD=y |
511 | CONFIG_BLK_DEV_MD=y | 527 | CONFIG_BLK_DEV_MD=y |
512 | CONFIG_MD_LINEAR=m | 528 | CONFIG_MD_LINEAR=m |
@@ -522,14 +538,10 @@ CONFIG_DM_CRYPT=y | |||
522 | CONFIG_DM_SNAPSHOT=y | 538 | CONFIG_DM_SNAPSHOT=y |
523 | CONFIG_DM_MIRROR=y | 539 | CONFIG_DM_MIRROR=y |
524 | CONFIG_DM_ZERO=y | 540 | CONFIG_DM_ZERO=y |
525 | CONFIG_DM_MULTIPATH=y | 541 | CONFIG_DM_MULTIPATH=m |
526 | # CONFIG_DM_MULTIPATH_EMC is not set | ||
527 | # CONFIG_DM_MULTIPATH_RDAC is not set | ||
528 | # CONFIG_DM_MULTIPATH_HP is not set | ||
529 | # CONFIG_DM_DELAY is not set | 542 | # CONFIG_DM_DELAY is not set |
530 | # CONFIG_DM_UEVENT is not set | 543 | # CONFIG_DM_UEVENT is not set |
531 | CONFIG_NETDEVICES=y | 544 | CONFIG_NETDEVICES=y |
532 | # CONFIG_NETDEVICES_MULTIQUEUE is not set | ||
533 | # CONFIG_IFB is not set | 545 | # CONFIG_IFB is not set |
534 | CONFIG_DUMMY=m | 546 | CONFIG_DUMMY=m |
535 | CONFIG_BONDING=m | 547 | CONFIG_BONDING=m |
@@ -544,7 +556,6 @@ CONFIG_NET_ETHERNET=y | |||
544 | # CONFIG_IBM_NEW_EMAC_TAH is not set | 556 | # CONFIG_IBM_NEW_EMAC_TAH is not set |
545 | # CONFIG_IBM_NEW_EMAC_EMAC4 is not set | 557 | # CONFIG_IBM_NEW_EMAC_EMAC4 is not set |
546 | CONFIG_NETDEV_1000=y | 558 | CONFIG_NETDEV_1000=y |
547 | # CONFIG_E1000E_ENABLED is not set | ||
548 | CONFIG_NETDEV_10000=y | 559 | CONFIG_NETDEV_10000=y |
549 | # CONFIG_TR is not set | 560 | # CONFIG_TR is not set |
550 | # CONFIG_WAN is not set | 561 | # CONFIG_WAN is not set |
@@ -576,7 +587,10 @@ CONFIG_DEVKMEM=y | |||
576 | CONFIG_UNIX98_PTYS=y | 587 | CONFIG_UNIX98_PTYS=y |
577 | CONFIG_LEGACY_PTYS=y | 588 | CONFIG_LEGACY_PTYS=y |
578 | CONFIG_LEGACY_PTY_COUNT=256 | 589 | CONFIG_LEGACY_PTY_COUNT=256 |
590 | CONFIG_HVC_DRIVER=y | ||
591 | CONFIG_VIRTIO_CONSOLE=y | ||
579 | CONFIG_HW_RANDOM=m | 592 | CONFIG_HW_RANDOM=m |
593 | CONFIG_HW_RANDOM_VIRTIO=m | ||
580 | # CONFIG_R3964 is not set | 594 | # CONFIG_R3964 is not set |
581 | CONFIG_RAW_DRIVER=m | 595 | CONFIG_RAW_DRIVER=m |
582 | CONFIG_MAX_RAW_DEVS=256 | 596 | CONFIG_MAX_RAW_DEVS=256 |
@@ -616,6 +630,7 @@ CONFIG_MONWRITER=m | |||
616 | CONFIG_S390_VMUR=m | 630 | CONFIG_S390_VMUR=m |
617 | # CONFIG_POWER_SUPPLY is not set | 631 | # CONFIG_POWER_SUPPLY is not set |
618 | # CONFIG_THERMAL is not set | 632 | # CONFIG_THERMAL is not set |
633 | # CONFIG_THERMAL_HWMON is not set | ||
619 | # CONFIG_WATCHDOG is not set | 634 | # CONFIG_WATCHDOG is not set |
620 | 635 | ||
621 | # | 636 | # |
@@ -693,6 +708,7 @@ CONFIG_CONFIGFS_FS=m | |||
693 | # CONFIG_CRAMFS is not set | 708 | # CONFIG_CRAMFS is not set |
694 | # CONFIG_VXFS_FS is not set | 709 | # CONFIG_VXFS_FS is not set |
695 | # CONFIG_MINIX_FS is not set | 710 | # CONFIG_MINIX_FS is not set |
711 | # CONFIG_OMFS_FS is not set | ||
696 | # CONFIG_HPFS_FS is not set | 712 | # CONFIG_HPFS_FS is not set |
697 | # CONFIG_QNX4FS_FS is not set | 713 | # CONFIG_QNX4FS_FS is not set |
698 | # CONFIG_ROMFS_FS is not set | 714 | # CONFIG_ROMFS_FS is not set |
@@ -712,7 +728,6 @@ CONFIG_LOCKD_V4=y | |||
712 | CONFIG_EXPORTFS=y | 728 | CONFIG_EXPORTFS=y |
713 | CONFIG_NFS_COMMON=y | 729 | CONFIG_NFS_COMMON=y |
714 | CONFIG_SUNRPC=y | 730 | CONFIG_SUNRPC=y |
715 | # CONFIG_SUNRPC_BIND34 is not set | ||
716 | # CONFIG_RPCSEC_GSS_KRB5 is not set | 731 | # CONFIG_RPCSEC_GSS_KRB5 is not set |
717 | # CONFIG_RPCSEC_GSS_SPKM3 is not set | 732 | # CONFIG_RPCSEC_GSS_SPKM3 is not set |
718 | # CONFIG_SMB_FS is not set | 733 | # CONFIG_SMB_FS is not set |
@@ -780,6 +795,7 @@ CONFIG_DEBUG_BUGVERBOSE=y | |||
780 | # CONFIG_DEBUG_INFO is not set | 795 | # CONFIG_DEBUG_INFO is not set |
781 | # CONFIG_DEBUG_VM is not set | 796 | # CONFIG_DEBUG_VM is not set |
782 | # CONFIG_DEBUG_WRITECOUNT is not set | 797 | # CONFIG_DEBUG_WRITECOUNT is not set |
798 | CONFIG_DEBUG_MEMORY_INIT=y | ||
783 | # CONFIG_DEBUG_LIST is not set | 799 | # CONFIG_DEBUG_LIST is not set |
784 | # CONFIG_DEBUG_SG is not set | 800 | # CONFIG_DEBUG_SG is not set |
785 | # CONFIG_FRAME_POINTER is not set | 801 | # CONFIG_FRAME_POINTER is not set |
@@ -789,6 +805,7 @@ CONFIG_DEBUG_BUGVERBOSE=y | |||
789 | # CONFIG_LKDTM is not set | 805 | # CONFIG_LKDTM is not set |
790 | # CONFIG_FAULT_INJECTION is not set | 806 | # CONFIG_FAULT_INJECTION is not set |
791 | # CONFIG_LATENCYTOP is not set | 807 | # CONFIG_LATENCYTOP is not set |
808 | CONFIG_SYSCTL_SYSCALL_CHECK=y | ||
792 | CONFIG_SAMPLES=y | 809 | CONFIG_SAMPLES=y |
793 | # CONFIG_SAMPLE_KOBJECT is not set | 810 | # CONFIG_SAMPLE_KOBJECT is not set |
794 | # CONFIG_SAMPLE_KPROBES is not set | 811 | # CONFIG_SAMPLE_KPROBES is not set |
@@ -847,6 +864,10 @@ CONFIG_CRYPTO_HMAC=m | |||
847 | # CONFIG_CRYPTO_MD4 is not set | 864 | # CONFIG_CRYPTO_MD4 is not set |
848 | CONFIG_CRYPTO_MD5=m | 865 | CONFIG_CRYPTO_MD5=m |
849 | # CONFIG_CRYPTO_MICHAEL_MIC is not set | 866 | # CONFIG_CRYPTO_MICHAEL_MIC is not set |
867 | CONFIG_CRYPTO_RMD128=m | ||
868 | CONFIG_CRYPTO_RMD160=m | ||
869 | CONFIG_CRYPTO_RMD256=m | ||
870 | CONFIG_CRYPTO_RMD320=m | ||
850 | CONFIG_CRYPTO_SHA1=m | 871 | CONFIG_CRYPTO_SHA1=m |
851 | # CONFIG_CRYPTO_SHA256 is not set | 872 | # CONFIG_CRYPTO_SHA256 is not set |
852 | # CONFIG_CRYPTO_SHA512 is not set | 873 | # CONFIG_CRYPTO_SHA512 is not set |
@@ -895,6 +916,7 @@ CONFIG_BITREVERSE=m | |||
895 | # CONFIG_GENERIC_FIND_NEXT_BIT is not set | 916 | # CONFIG_GENERIC_FIND_NEXT_BIT is not set |
896 | # CONFIG_CRC_CCITT is not set | 917 | # CONFIG_CRC_CCITT is not set |
897 | # CONFIG_CRC16 is not set | 918 | # CONFIG_CRC16 is not set |
919 | CONFIG_CRC_T10DIF=y | ||
898 | # CONFIG_CRC_ITU_T is not set | 920 | # CONFIG_CRC_ITU_T is not set |
899 | CONFIG_CRC32=m | 921 | CONFIG_CRC32=m |
900 | CONFIG_CRC7=m | 922 | CONFIG_CRC7=m |
diff --git a/arch/s390/include/asm/bitops.h b/arch/s390/include/asm/bitops.h index b4eb24ab5af9..8e9243ae0c19 100644 --- a/arch/s390/include/asm/bitops.h +++ b/arch/s390/include/asm/bitops.h | |||
@@ -709,7 +709,7 @@ static inline int find_next_zero_bit (const unsigned long * addr, | |||
709 | * __ffz_word returns __BITOPS_WORDSIZE | 709 | * __ffz_word returns __BITOPS_WORDSIZE |
710 | * if no zero bit is present in the word. | 710 | * if no zero bit is present in the word. |
711 | */ | 711 | */ |
712 | set = __ffz_word(0, *p >> bit) + bit; | 712 | set = __ffz_word(bit, *p >> bit); |
713 | if (set >= size) | 713 | if (set >= size) |
714 | return size + offset; | 714 | return size + offset; |
715 | if (set < __BITOPS_WORDSIZE) | 715 | if (set < __BITOPS_WORDSIZE) |
@@ -824,7 +824,7 @@ static inline int ext2_find_next_zero_bit(void *vaddr, unsigned long size, | |||
824 | * s390 version of ffz returns __BITOPS_WORDSIZE | 824 | * s390 version of ffz returns __BITOPS_WORDSIZE |
825 | * if no zero bit is present in the word. | 825 | * if no zero bit is present in the word. |
826 | */ | 826 | */ |
827 | set = ffz(__load_ulong_le(p, 0) >> bit) + bit; | 827 | set = __ffz_word(bit, __load_ulong_le(p, 0) >> bit); |
828 | if (set >= size) | 828 | if (set >= size) |
829 | return size + offset; | 829 | return size + offset; |
830 | if (set < __BITOPS_WORDSIZE) | 830 | if (set < __BITOPS_WORDSIZE) |
@@ -865,7 +865,7 @@ static inline int ext2_find_next_bit(void *vaddr, unsigned long size, | |||
865 | * s390 version of ffz returns __BITOPS_WORDSIZE | 865 | * s390 version of ffz returns __BITOPS_WORDSIZE |
866 | * if no zero bit is present in the word. | 866 | * if no zero bit is present in the word. |
867 | */ | 867 | */ |
868 | set = ffs(__load_ulong_le(p, 0) >> bit) + bit; | 868 | set = __ffs_word(0, __load_ulong_le(p, 0) & (~0UL << bit)); |
869 | if (set >= size) | 869 | if (set >= size) |
870 | return size + offset; | 870 | return size + offset; |
871 | if (set < __BITOPS_WORDSIZE) | 871 | if (set < __BITOPS_WORDSIZE) |
diff --git a/arch/s390/kernel/process.c b/arch/s390/kernel/process.c index 9839767d0842..3e2c05cb6a87 100644 --- a/arch/s390/kernel/process.c +++ b/arch/s390/kernel/process.c | |||
@@ -75,7 +75,9 @@ unsigned long thread_saved_pc(struct task_struct *tsk) | |||
75 | return sf->gprs[8]; | 75 | return sf->gprs[8]; |
76 | } | 76 | } |
77 | 77 | ||
78 | DEFINE_PER_CPU(struct s390_idle_data, s390_idle); | 78 | DEFINE_PER_CPU(struct s390_idle_data, s390_idle) = { |
79 | .lock = __SPIN_LOCK_UNLOCKED(s390_idle.lock) | ||
80 | }; | ||
79 | 81 | ||
80 | static int s390_idle_enter(void) | 82 | static int s390_idle_enter(void) |
81 | { | 83 | { |
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c index b795b3e24afd..00b9b4dec5eb 100644 --- a/arch/s390/kernel/smp.c +++ b/arch/s390/kernel/smp.c | |||
@@ -610,7 +610,6 @@ static void __init smp_create_idle(unsigned int cpu) | |||
610 | if (IS_ERR(p)) | 610 | if (IS_ERR(p)) |
611 | panic("failed fork for CPU %u: %li", cpu, PTR_ERR(p)); | 611 | panic("failed fork for CPU %u: %li", cpu, PTR_ERR(p)); |
612 | current_set[cpu] = p; | 612 | current_set[cpu] = p; |
613 | spin_lock_init(&(&per_cpu(s390_idle, cpu))->lock); | ||
614 | } | 613 | } |
615 | 614 | ||
616 | static int __cpuinit smp_alloc_lowcore(int cpu) | 615 | static int __cpuinit smp_alloc_lowcore(int cpu) |
@@ -845,7 +844,6 @@ void __init smp_prepare_boot_cpu(void) | |||
845 | current_set[0] = current; | 844 | current_set[0] = current; |
846 | smp_cpu_state[0] = CPU_STATE_CONFIGURED; | 845 | smp_cpu_state[0] = CPU_STATE_CONFIGURED; |
847 | smp_cpu_polarization[0] = POLARIZATION_UNKNWN; | 846 | smp_cpu_polarization[0] = POLARIZATION_UNKNWN; |
848 | spin_lock_init(&(&__get_cpu_var(s390_idle))->lock); | ||
849 | } | 847 | } |
850 | 848 | ||
851 | void __init smp_cpus_done(unsigned int max_cpus) | 849 | void __init smp_cpus_done(unsigned int max_cpus) |
diff --git a/arch/x86/kernel/amd_iommu.c b/arch/x86/kernel/amd_iommu.c index de39e1f2ede5..69b4d060b21c 100644 --- a/arch/x86/kernel/amd_iommu.c +++ b/arch/x86/kernel/amd_iommu.c | |||
@@ -65,7 +65,7 @@ static int __iommu_queue_command(struct amd_iommu *iommu, struct iommu_cmd *cmd) | |||
65 | u8 *target; | 65 | u8 *target; |
66 | 66 | ||
67 | tail = readl(iommu->mmio_base + MMIO_CMD_TAIL_OFFSET); | 67 | tail = readl(iommu->mmio_base + MMIO_CMD_TAIL_OFFSET); |
68 | target = (iommu->cmd_buf + tail); | 68 | target = iommu->cmd_buf + tail; |
69 | memcpy_toio(target, cmd, sizeof(*cmd)); | 69 | memcpy_toio(target, cmd, sizeof(*cmd)); |
70 | tail = (tail + sizeof(*cmd)) % iommu->cmd_buf_size; | 70 | tail = (tail + sizeof(*cmd)) % iommu->cmd_buf_size; |
71 | head = readl(iommu->mmio_base + MMIO_CMD_HEAD_OFFSET); | 71 | head = readl(iommu->mmio_base + MMIO_CMD_HEAD_OFFSET); |
diff --git a/arch/x86/kernel/cpu/addon_cpuid_features.c b/arch/x86/kernel/cpu/addon_cpuid_features.c index 84a8220a6072..a6ef672adbba 100644 --- a/arch/x86/kernel/cpu/addon_cpuid_features.c +++ b/arch/x86/kernel/cpu/addon_cpuid_features.c | |||
@@ -56,9 +56,22 @@ void __cpuinit validate_pat_support(struct cpuinfo_x86 *c) | |||
56 | 56 | ||
57 | switch (c->x86_vendor) { | 57 | switch (c->x86_vendor) { |
58 | case X86_VENDOR_INTEL: | 58 | case X86_VENDOR_INTEL: |
59 | if (c->x86 == 0xF || (c->x86 == 6 && c->x86_model >= 15)) | 59 | /* |
60 | * There is a known erratum on Pentium III and Core Solo | ||
61 | * and Core Duo CPUs. | ||
62 | * " Page with PAT set to WC while associated MTRR is UC | ||
63 | * may consolidate to UC " | ||
64 | * Because of this erratum, it is better to stick with | ||
65 | * setting WC in MTRR rather than using PAT on these CPUs. | ||
66 | * | ||
67 | * Enable PAT WC only on P4, Core 2 or later CPUs. | ||
68 | */ | ||
69 | if (c->x86 > 0x6 || (c->x86 == 6 && c->x86_model >= 15)) | ||
60 | return; | 70 | return; |
61 | break; | 71 | |
72 | pat_disable("PAT WC disabled due to known CPU erratum."); | ||
73 | return; | ||
74 | |||
62 | case X86_VENDOR_AMD: | 75 | case X86_VENDOR_AMD: |
63 | case X86_VENDOR_CENTAUR: | 76 | case X86_VENDOR_CENTAUR: |
64 | case X86_VENDOR_TRANSMETA: | 77 | case X86_VENDOR_TRANSMETA: |
diff --git a/arch/x86/kernel/cpu/cyrix.c b/arch/x86/kernel/cpu/cyrix.c index 3fd7a67bb06a..e710a21bb6e8 100644 --- a/arch/x86/kernel/cpu/cyrix.c +++ b/arch/x86/kernel/cpu/cyrix.c | |||
@@ -134,23 +134,6 @@ static void __cpuinit set_cx86_memwb(void) | |||
134 | setCx86(CX86_CCR2, getCx86(CX86_CCR2) | 0x14); | 134 | setCx86(CX86_CCR2, getCx86(CX86_CCR2) | 0x14); |
135 | } | 135 | } |
136 | 136 | ||
137 | static void __cpuinit set_cx86_inc(void) | ||
138 | { | ||
139 | unsigned char ccr3; | ||
140 | |||
141 | printk(KERN_INFO "Enable Incrementor on Cyrix/NSC processor.\n"); | ||
142 | |||
143 | ccr3 = getCx86(CX86_CCR3); | ||
144 | setCx86(CX86_CCR3, (ccr3 & 0x0f) | 0x10); /* enable MAPEN */ | ||
145 | /* PCR1 -- Performance Control */ | ||
146 | /* Incrementor on, whatever that is */ | ||
147 | setCx86(CX86_PCR1, getCx86(CX86_PCR1) | 0x02); | ||
148 | /* PCR0 -- Performance Control */ | ||
149 | /* Incrementor Margin 10 */ | ||
150 | setCx86(CX86_PCR0, getCx86(CX86_PCR0) | 0x04); | ||
151 | setCx86(CX86_CCR3, ccr3); /* disable MAPEN */ | ||
152 | } | ||
153 | |||
154 | /* | 137 | /* |
155 | * Configure later MediaGX and/or Geode processor. | 138 | * Configure later MediaGX and/or Geode processor. |
156 | */ | 139 | */ |
@@ -174,7 +157,6 @@ static void __cpuinit geode_configure(void) | |||
174 | 157 | ||
175 | set_cx86_memwb(); | 158 | set_cx86_memwb(); |
176 | set_cx86_reorder(); | 159 | set_cx86_reorder(); |
177 | set_cx86_inc(); | ||
178 | 160 | ||
179 | local_irq_restore(flags); | 161 | local_irq_restore(flags); |
180 | } | 162 | } |
diff --git a/arch/x86/kernel/cpu/mtrr/generic.c b/arch/x86/kernel/cpu/mtrr/generic.c index 509bd3d9eacd..cb7d3b6a80eb 100644 --- a/arch/x86/kernel/cpu/mtrr/generic.c +++ b/arch/x86/kernel/cpu/mtrr/generic.c | |||
@@ -379,6 +379,7 @@ static void generic_get_mtrr(unsigned int reg, unsigned long *base, | |||
379 | unsigned long *size, mtrr_type *type) | 379 | unsigned long *size, mtrr_type *type) |
380 | { | 380 | { |
381 | unsigned int mask_lo, mask_hi, base_lo, base_hi; | 381 | unsigned int mask_lo, mask_hi, base_lo, base_hi; |
382 | unsigned int tmp, hi; | ||
382 | 383 | ||
383 | rdmsr(MTRRphysMask_MSR(reg), mask_lo, mask_hi); | 384 | rdmsr(MTRRphysMask_MSR(reg), mask_lo, mask_hi); |
384 | if ((mask_lo & 0x800) == 0) { | 385 | if ((mask_lo & 0x800) == 0) { |
@@ -392,8 +393,23 @@ static void generic_get_mtrr(unsigned int reg, unsigned long *base, | |||
392 | rdmsr(MTRRphysBase_MSR(reg), base_lo, base_hi); | 393 | rdmsr(MTRRphysBase_MSR(reg), base_lo, base_hi); |
393 | 394 | ||
394 | /* Work out the shifted address mask. */ | 395 | /* Work out the shifted address mask. */ |
395 | mask_lo = size_or_mask | mask_hi << (32 - PAGE_SHIFT) | 396 | tmp = mask_hi << (32 - PAGE_SHIFT) | mask_lo >> PAGE_SHIFT; |
396 | | mask_lo >> PAGE_SHIFT; | 397 | mask_lo = size_or_mask | tmp; |
398 | /* Expand tmp with high bits to all 1s*/ | ||
399 | hi = fls(tmp); | ||
400 | if (hi > 0) { | ||
401 | tmp |= ~((1<<(hi - 1)) - 1); | ||
402 | |||
403 | if (tmp != mask_lo) { | ||
404 | static int once = 1; | ||
405 | |||
406 | if (once) { | ||
407 | printk(KERN_INFO "mtrr: your BIOS has set up an incorrect mask, fixing it up.\n"); | ||
408 | once = 0; | ||
409 | } | ||
410 | mask_lo = tmp; | ||
411 | } | ||
412 | } | ||
397 | 413 | ||
398 | /* This works correctly if size is a power of two, i.e. a | 414 | /* This works correctly if size is a power of two, i.e. a |
399 | contiguous range. */ | 415 | contiguous range. */ |
diff --git a/arch/x86/kernel/cpu/mtrr/main.c b/arch/x86/kernel/cpu/mtrr/main.c index 6f23969c8faf..b117d7f8a564 100644 --- a/arch/x86/kernel/cpu/mtrr/main.c +++ b/arch/x86/kernel/cpu/mtrr/main.c | |||
@@ -1496,11 +1496,8 @@ int __init mtrr_trim_uncached_memory(unsigned long end_pfn) | |||
1496 | 1496 | ||
1497 | /* kvm/qemu doesn't have mtrr set right, don't trim them all */ | 1497 | /* kvm/qemu doesn't have mtrr set right, don't trim them all */ |
1498 | if (!highest_pfn) { | 1498 | if (!highest_pfn) { |
1499 | if (!kvm_para_available()) { | 1499 | WARN(!kvm_para_available(), KERN_WARNING |
1500 | printk(KERN_WARNING | ||
1501 | "WARNING: strange, CPU MTRRs all blank?\n"); | 1500 | "WARNING: strange, CPU MTRRs all blank?\n"); |
1502 | WARN_ON(1); | ||
1503 | } | ||
1504 | return 0; | 1501 | return 0; |
1505 | } | 1502 | } |
1506 | 1503 | ||
diff --git a/arch/x86/kernel/genx2apic_uv_x.c b/arch/x86/kernel/genx2apic_uv_x.c index 2d7e307c7779..bfa837cb16be 100644 --- a/arch/x86/kernel/genx2apic_uv_x.c +++ b/arch/x86/kernel/genx2apic_uv_x.c | |||
@@ -293,7 +293,9 @@ static __init void uv_rtc_init(void) | |||
293 | sn_rtc_cycles_per_second = ticks_per_sec; | 293 | sn_rtc_cycles_per_second = ticks_per_sec; |
294 | } | 294 | } |
295 | 295 | ||
296 | static __init void uv_system_init(void) | 296 | static bool uv_system_inited; |
297 | |||
298 | void __init uv_system_init(void) | ||
297 | { | 299 | { |
298 | union uvh_si_addr_map_config_u m_n_config; | 300 | union uvh_si_addr_map_config_u m_n_config; |
299 | union uvh_node_id_u node_id; | 301 | union uvh_node_id_u node_id; |
@@ -383,6 +385,7 @@ static __init void uv_system_init(void) | |||
383 | map_mmr_high(max_pnode); | 385 | map_mmr_high(max_pnode); |
384 | map_config_high(max_pnode); | 386 | map_config_high(max_pnode); |
385 | map_mmioh_high(max_pnode); | 387 | map_mmioh_high(max_pnode); |
388 | uv_system_inited = true; | ||
386 | } | 389 | } |
387 | 390 | ||
388 | /* | 391 | /* |
@@ -391,8 +394,7 @@ static __init void uv_system_init(void) | |||
391 | */ | 394 | */ |
392 | void __cpuinit uv_cpu_init(void) | 395 | void __cpuinit uv_cpu_init(void) |
393 | { | 396 | { |
394 | if (!uv_node_to_blade) | 397 | BUG_ON(!uv_system_inited); |
395 | uv_system_init(); | ||
396 | 398 | ||
397 | uv_blade_info[uv_numa_blade_id()].nr_online_cpus++; | 399 | uv_blade_info[uv_numa_blade_id()].nr_online_cpus++; |
398 | 400 | ||
diff --git a/arch/x86/kernel/numaq_32.c b/arch/x86/kernel/numaq_32.c index b8c45610b20a..eecc8c18f010 100644 --- a/arch/x86/kernel/numaq_32.c +++ b/arch/x86/kernel/numaq_32.c | |||
@@ -73,7 +73,7 @@ static void __init smp_dump_qct(void) | |||
73 | } | 73 | } |
74 | 74 | ||
75 | 75 | ||
76 | void __init numaq_tsc_disable(void) | 76 | void __cpuinit numaq_tsc_disable(void) |
77 | { | 77 | { |
78 | if (!found_numaq) | 78 | if (!found_numaq) |
79 | return; | 79 | return; |
diff --git a/arch/x86/kernel/paravirt.c b/arch/x86/kernel/paravirt.c index 94da4d52d798..300da17e61cb 100644 --- a/arch/x86/kernel/paravirt.c +++ b/arch/x86/kernel/paravirt.c | |||
@@ -471,7 +471,7 @@ struct pv_lock_ops pv_lock_ops = { | |||
471 | .spin_unlock = __ticket_spin_unlock, | 471 | .spin_unlock = __ticket_spin_unlock, |
472 | #endif | 472 | #endif |
473 | }; | 473 | }; |
474 | EXPORT_SYMBOL_GPL(pv_lock_ops); | 474 | EXPORT_SYMBOL(pv_lock_ops); |
475 | 475 | ||
476 | EXPORT_SYMBOL_GPL(pv_time_ops); | 476 | EXPORT_SYMBOL_GPL(pv_time_ops); |
477 | EXPORT_SYMBOL (pv_cpu_ops); | 477 | EXPORT_SYMBOL (pv_cpu_ops); |
diff --git a/arch/x86/kernel/pci-calgary_64.c b/arch/x86/kernel/pci-calgary_64.c index 218d783ed7a8..dcdac6c826e9 100644 --- a/arch/x86/kernel/pci-calgary_64.c +++ b/arch/x86/kernel/pci-calgary_64.c | |||
@@ -343,9 +343,8 @@ static void iommu_free(struct iommu_table *tbl, dma_addr_t dma_addr, | |||
343 | /* were we called with bad_dma_address? */ | 343 | /* were we called with bad_dma_address? */ |
344 | badend = bad_dma_address + (EMERGENCY_PAGES * PAGE_SIZE); | 344 | badend = bad_dma_address + (EMERGENCY_PAGES * PAGE_SIZE); |
345 | if (unlikely((dma_addr >= bad_dma_address) && (dma_addr < badend))) { | 345 | if (unlikely((dma_addr >= bad_dma_address) && (dma_addr < badend))) { |
346 | printk(KERN_ERR "Calgary: driver tried unmapping bad DMA " | 346 | WARN(1, KERN_ERR "Calgary: driver tried unmapping bad DMA " |
347 | "address 0x%Lx\n", dma_addr); | 347 | "address 0x%Lx\n", dma_addr); |
348 | WARN_ON(1); | ||
349 | return; | 348 | return; |
350 | } | 349 | } |
351 | 350 | ||
@@ -1269,13 +1268,15 @@ static inline int __init determine_tce_table_size(u64 ram) | |||
1269 | static int __init build_detail_arrays(void) | 1268 | static int __init build_detail_arrays(void) |
1270 | { | 1269 | { |
1271 | unsigned long ptr; | 1270 | unsigned long ptr; |
1272 | int i, scal_detail_size, rio_detail_size; | 1271 | unsigned numnodes, i; |
1272 | int scal_detail_size, rio_detail_size; | ||
1273 | 1273 | ||
1274 | if (rio_table_hdr->num_scal_dev > MAX_NUMNODES){ | 1274 | numnodes = rio_table_hdr->num_scal_dev; |
1275 | if (numnodes > MAX_NUMNODES){ | ||
1275 | printk(KERN_WARNING | 1276 | printk(KERN_WARNING |
1276 | "Calgary: MAX_NUMNODES too low! Defined as %d, " | 1277 | "Calgary: MAX_NUMNODES too low! Defined as %d, " |
1277 | "but system has %d nodes.\n", | 1278 | "but system has %d nodes.\n", |
1278 | MAX_NUMNODES, rio_table_hdr->num_scal_dev); | 1279 | MAX_NUMNODES, numnodes); |
1279 | return -ENODEV; | 1280 | return -ENODEV; |
1280 | } | 1281 | } |
1281 | 1282 | ||
@@ -1296,8 +1297,7 @@ static int __init build_detail_arrays(void) | |||
1296 | } | 1297 | } |
1297 | 1298 | ||
1298 | ptr = ((unsigned long)rio_table_hdr) + 3; | 1299 | ptr = ((unsigned long)rio_table_hdr) + 3; |
1299 | for (i = 0; i < rio_table_hdr->num_scal_dev; | 1300 | for (i = 0; i < numnodes; i++, ptr += scal_detail_size) |
1300 | i++, ptr += scal_detail_size) | ||
1301 | scal_devs[i] = (struct scal_detail *)ptr; | 1301 | scal_devs[i] = (struct scal_detail *)ptr; |
1302 | 1302 | ||
1303 | for (i = 0; i < rio_table_hdr->num_rio_dev; | 1303 | for (i = 0; i < rio_table_hdr->num_rio_dev; |
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index a4656adab53b..362d4e7f2d38 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c | |||
@@ -604,14 +604,6 @@ void __init setup_arch(char **cmdline_p) | |||
604 | early_cpu_init(); | 604 | early_cpu_init(); |
605 | early_ioremap_init(); | 605 | early_ioremap_init(); |
606 | 606 | ||
607 | #if defined(CONFIG_VMI) && defined(CONFIG_X86_32) | ||
608 | /* | ||
609 | * Must be before kernel pagetables are setup | ||
610 | * or fixmap area is touched. | ||
611 | */ | ||
612 | vmi_init(); | ||
613 | #endif | ||
614 | |||
615 | ROOT_DEV = old_decode_dev(boot_params.hdr.root_dev); | 607 | ROOT_DEV = old_decode_dev(boot_params.hdr.root_dev); |
616 | screen_info = boot_params.screen_info; | 608 | screen_info = boot_params.screen_info; |
617 | edid_info = boot_params.edid_info; | 609 | edid_info = boot_params.edid_info; |
@@ -678,6 +670,14 @@ void __init setup_arch(char **cmdline_p) | |||
678 | 670 | ||
679 | parse_early_param(); | 671 | parse_early_param(); |
680 | 672 | ||
673 | #if defined(CONFIG_VMI) && defined(CONFIG_X86_32) | ||
674 | /* | ||
675 | * Must be before kernel pagetables are setup | ||
676 | * or fixmap area is touched. | ||
677 | */ | ||
678 | vmi_init(); | ||
679 | #endif | ||
680 | |||
681 | /* after early param, so could get panic from serial */ | 681 | /* after early param, so could get panic from serial */ |
682 | reserve_early_setup_data(); | 682 | reserve_early_setup_data(); |
683 | 683 | ||
diff --git a/arch/x86/kernel/smpboot.c b/arch/x86/kernel/smpboot.c index e139e617f422..7985c5b3f916 100644 --- a/arch/x86/kernel/smpboot.c +++ b/arch/x86/kernel/smpboot.c | |||
@@ -1221,6 +1221,9 @@ void __init native_smp_prepare_cpus(unsigned int max_cpus) | |||
1221 | printk(KERN_INFO "CPU%d: ", 0); | 1221 | printk(KERN_INFO "CPU%d: ", 0); |
1222 | print_cpu_info(&cpu_data(0)); | 1222 | print_cpu_info(&cpu_data(0)); |
1223 | setup_boot_clock(); | 1223 | setup_boot_clock(); |
1224 | |||
1225 | if (is_uv_system()) | ||
1226 | uv_system_init(); | ||
1224 | out: | 1227 | out: |
1225 | preempt_enable(); | 1228 | preempt_enable(); |
1226 | } | 1229 | } |
diff --git a/arch/x86/kernel/tlb_uv.c b/arch/x86/kernel/tlb_uv.c index d0fbb7712ab0..8b8c0d6640fa 100644 --- a/arch/x86/kernel/tlb_uv.c +++ b/arch/x86/kernel/tlb_uv.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <asm/genapic.h> | 17 | #include <asm/genapic.h> |
18 | #include <asm/idle.h> | 18 | #include <asm/idle.h> |
19 | #include <asm/tsc.h> | 19 | #include <asm/tsc.h> |
20 | #include <asm/irq_vectors.h> | ||
20 | 21 | ||
21 | #include <mach_apic.h> | 22 | #include <mach_apic.h> |
22 | 23 | ||
@@ -783,7 +784,7 @@ static int __init uv_bau_init(void) | |||
783 | uv_init_blade(blade, node, cur_cpu); | 784 | uv_init_blade(blade, node, cur_cpu); |
784 | cur_cpu += uv_blade_nr_possible_cpus(blade); | 785 | cur_cpu += uv_blade_nr_possible_cpus(blade); |
785 | } | 786 | } |
786 | set_intr_gate(UV_BAU_MESSAGE, uv_bau_message_intr1); | 787 | alloc_intr_gate(UV_BAU_MESSAGE, uv_bau_message_intr1); |
787 | uv_enable_timeouts(); | 788 | uv_enable_timeouts(); |
788 | 789 | ||
789 | return 0; | 790 | return 0; |
diff --git a/arch/x86/kernel/tsc_sync.c b/arch/x86/kernel/tsc_sync.c index 0577825cf89b..9ffb01c31c40 100644 --- a/arch/x86/kernel/tsc_sync.c +++ b/arch/x86/kernel/tsc_sync.c | |||
@@ -88,11 +88,9 @@ static __cpuinit void check_tsc_warp(void) | |||
88 | __raw_spin_unlock(&sync_lock); | 88 | __raw_spin_unlock(&sync_lock); |
89 | } | 89 | } |
90 | } | 90 | } |
91 | if (!(now-start)) { | 91 | WARN(!(now-start), |
92 | printk("Warning: zero tsc calibration delta: %Ld [max: %Ld]\n", | 92 | "Warning: zero tsc calibration delta: %Ld [max: %Ld]\n", |
93 | now-start, end-start); | 93 | now-start, end-start); |
94 | WARN_ON(1); | ||
95 | } | ||
96 | } | 94 | } |
97 | 95 | ||
98 | /* | 96 | /* |
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c index a87ea0e4b3dc..d3746efb060d 100644 --- a/arch/x86/mm/init_64.c +++ b/arch/x86/mm/init_64.c | |||
@@ -241,7 +241,7 @@ static unsigned long __initdata table_start; | |||
241 | static unsigned long __meminitdata table_end; | 241 | static unsigned long __meminitdata table_end; |
242 | static unsigned long __meminitdata table_top; | 242 | static unsigned long __meminitdata table_top; |
243 | 243 | ||
244 | static __meminit void *alloc_low_page(unsigned long *phys) | 244 | static __ref void *alloc_low_page(unsigned long *phys) |
245 | { | 245 | { |
246 | unsigned long pfn = table_end++; | 246 | unsigned long pfn = table_end++; |
247 | void *adr; | 247 | void *adr; |
@@ -262,7 +262,7 @@ static __meminit void *alloc_low_page(unsigned long *phys) | |||
262 | return adr; | 262 | return adr; |
263 | } | 263 | } |
264 | 264 | ||
265 | static __meminit void unmap_low_page(void *adr) | 265 | static __ref void unmap_low_page(void *adr) |
266 | { | 266 | { |
267 | if (after_bootmem) | 267 | if (after_bootmem) |
268 | return; | 268 | return; |
@@ -336,9 +336,12 @@ phys_pmd_init(pmd_t *pmd_page, unsigned long address, unsigned long end, | |||
336 | } | 336 | } |
337 | 337 | ||
338 | if (pmd_val(*pmd)) { | 338 | if (pmd_val(*pmd)) { |
339 | if (!pmd_large(*pmd)) | 339 | if (!pmd_large(*pmd)) { |
340 | spin_lock(&init_mm.page_table_lock); | ||
340 | last_map_addr = phys_pte_update(pmd, address, | 341 | last_map_addr = phys_pte_update(pmd, address, |
341 | end); | 342 | end); |
343 | spin_unlock(&init_mm.page_table_lock); | ||
344 | } | ||
342 | /* Count entries we're using from level2_ident_pgt */ | 345 | /* Count entries we're using from level2_ident_pgt */ |
343 | if (start == 0) | 346 | if (start == 0) |
344 | pages++; | 347 | pages++; |
@@ -347,8 +350,10 @@ phys_pmd_init(pmd_t *pmd_page, unsigned long address, unsigned long end, | |||
347 | 350 | ||
348 | if (page_size_mask & (1<<PG_LEVEL_2M)) { | 351 | if (page_size_mask & (1<<PG_LEVEL_2M)) { |
349 | pages++; | 352 | pages++; |
353 | spin_lock(&init_mm.page_table_lock); | ||
350 | set_pte((pte_t *)pmd, | 354 | set_pte((pte_t *)pmd, |
351 | pfn_pte(address >> PAGE_SHIFT, PAGE_KERNEL_LARGE)); | 355 | pfn_pte(address >> PAGE_SHIFT, PAGE_KERNEL_LARGE)); |
356 | spin_unlock(&init_mm.page_table_lock); | ||
352 | last_map_addr = (address & PMD_MASK) + PMD_SIZE; | 357 | last_map_addr = (address & PMD_MASK) + PMD_SIZE; |
353 | continue; | 358 | continue; |
354 | } | 359 | } |
@@ -357,7 +362,9 @@ phys_pmd_init(pmd_t *pmd_page, unsigned long address, unsigned long end, | |||
357 | last_map_addr = phys_pte_init(pte, address, end); | 362 | last_map_addr = phys_pte_init(pte, address, end); |
358 | unmap_low_page(pte); | 363 | unmap_low_page(pte); |
359 | 364 | ||
365 | spin_lock(&init_mm.page_table_lock); | ||
360 | pmd_populate_kernel(&init_mm, pmd, __va(pte_phys)); | 366 | pmd_populate_kernel(&init_mm, pmd, __va(pte_phys)); |
367 | spin_unlock(&init_mm.page_table_lock); | ||
361 | } | 368 | } |
362 | update_page_count(PG_LEVEL_2M, pages); | 369 | update_page_count(PG_LEVEL_2M, pages); |
363 | return last_map_addr; | 370 | return last_map_addr; |
@@ -370,9 +377,7 @@ phys_pmd_update(pud_t *pud, unsigned long address, unsigned long end, | |||
370 | pmd_t *pmd = pmd_offset(pud, 0); | 377 | pmd_t *pmd = pmd_offset(pud, 0); |
371 | unsigned long last_map_addr; | 378 | unsigned long last_map_addr; |
372 | 379 | ||
373 | spin_lock(&init_mm.page_table_lock); | ||
374 | last_map_addr = phys_pmd_init(pmd, address, end, page_size_mask); | 380 | last_map_addr = phys_pmd_init(pmd, address, end, page_size_mask); |
375 | spin_unlock(&init_mm.page_table_lock); | ||
376 | __flush_tlb_all(); | 381 | __flush_tlb_all(); |
377 | return last_map_addr; | 382 | return last_map_addr; |
378 | } | 383 | } |
@@ -408,20 +413,21 @@ phys_pud_init(pud_t *pud_page, unsigned long addr, unsigned long end, | |||
408 | 413 | ||
409 | if (page_size_mask & (1<<PG_LEVEL_1G)) { | 414 | if (page_size_mask & (1<<PG_LEVEL_1G)) { |
410 | pages++; | 415 | pages++; |
416 | spin_lock(&init_mm.page_table_lock); | ||
411 | set_pte((pte_t *)pud, | 417 | set_pte((pte_t *)pud, |
412 | pfn_pte(addr >> PAGE_SHIFT, PAGE_KERNEL_LARGE)); | 418 | pfn_pte(addr >> PAGE_SHIFT, PAGE_KERNEL_LARGE)); |
419 | spin_unlock(&init_mm.page_table_lock); | ||
413 | last_map_addr = (addr & PUD_MASK) + PUD_SIZE; | 420 | last_map_addr = (addr & PUD_MASK) + PUD_SIZE; |
414 | continue; | 421 | continue; |
415 | } | 422 | } |
416 | 423 | ||
417 | pmd = alloc_low_page(&pmd_phys); | 424 | pmd = alloc_low_page(&pmd_phys); |
418 | |||
419 | spin_lock(&init_mm.page_table_lock); | ||
420 | last_map_addr = phys_pmd_init(pmd, addr, end, page_size_mask); | 425 | last_map_addr = phys_pmd_init(pmd, addr, end, page_size_mask); |
421 | unmap_low_page(pmd); | 426 | unmap_low_page(pmd); |
427 | |||
428 | spin_lock(&init_mm.page_table_lock); | ||
422 | pud_populate(&init_mm, pud, __va(pmd_phys)); | 429 | pud_populate(&init_mm, pud, __va(pmd_phys)); |
423 | spin_unlock(&init_mm.page_table_lock); | 430 | spin_unlock(&init_mm.page_table_lock); |
424 | |||
425 | } | 431 | } |
426 | __flush_tlb_all(); | 432 | __flush_tlb_all(); |
427 | update_page_count(PG_LEVEL_1G, pages); | 433 | update_page_count(PG_LEVEL_1G, pages); |
@@ -513,16 +519,14 @@ static unsigned long __init kernel_physical_mapping_init(unsigned long start, | |||
513 | continue; | 519 | continue; |
514 | } | 520 | } |
515 | 521 | ||
516 | if (after_bootmem) | 522 | pud = alloc_low_page(&pud_phys); |
517 | pud = pud_offset(pgd, start & PGDIR_MASK); | ||
518 | else | ||
519 | pud = alloc_low_page(&pud_phys); | ||
520 | |||
521 | last_map_addr = phys_pud_init(pud, __pa(start), __pa(next), | 523 | last_map_addr = phys_pud_init(pud, __pa(start), __pa(next), |
522 | page_size_mask); | 524 | page_size_mask); |
523 | unmap_low_page(pud); | 525 | unmap_low_page(pud); |
524 | pgd_populate(&init_mm, pgd_offset_k(start), | 526 | |
525 | __va(pud_phys)); | 527 | spin_lock(&init_mm.page_table_lock); |
528 | pgd_populate(&init_mm, pgd, __va(pud_phys)); | ||
529 | spin_unlock(&init_mm.page_table_lock); | ||
526 | } | 530 | } |
527 | 531 | ||
528 | return last_map_addr; | 532 | return last_map_addr; |
diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c index 6ba6f889c79d..d4b6e6a29ae3 100644 --- a/arch/x86/mm/ioremap.c +++ b/arch/x86/mm/ioremap.c | |||
@@ -553,13 +553,11 @@ static int __init check_early_ioremap_leak(void) | |||
553 | { | 553 | { |
554 | if (!early_ioremap_nested) | 554 | if (!early_ioremap_nested) |
555 | return 0; | 555 | return 0; |
556 | 556 | WARN(1, KERN_WARNING | |
557 | printk(KERN_WARNING | ||
558 | "Debug warning: early ioremap leak of %d areas detected.\n", | 557 | "Debug warning: early ioremap leak of %d areas detected.\n", |
559 | early_ioremap_nested); | 558 | early_ioremap_nested); |
560 | printk(KERN_WARNING | 559 | printk(KERN_WARNING |
561 | "please boot with early_ioremap_debug and report the dmesg.\n"); | 560 | "please boot with early_ioremap_debug and report the dmesg.\n"); |
562 | WARN_ON(1); | ||
563 | 561 | ||
564 | return 1; | 562 | return 1; |
565 | } | 563 | } |
diff --git a/arch/x86/mm/mmio-mod.c b/arch/x86/mm/mmio-mod.c index e7397e108beb..635b50e85581 100644 --- a/arch/x86/mm/mmio-mod.c +++ b/arch/x86/mm/mmio-mod.c | |||
@@ -430,7 +430,9 @@ static void enter_uniprocessor(void) | |||
430 | "may miss events.\n"); | 430 | "may miss events.\n"); |
431 | } | 431 | } |
432 | 432 | ||
433 | static void leave_uniprocessor(void) | 433 | /* __ref because leave_uniprocessor calls cpu_up which is __cpuinit, |
434 | but this whole function is ifdefed CONFIG_HOTPLUG_CPU */ | ||
435 | static void __ref leave_uniprocessor(void) | ||
434 | { | 436 | { |
435 | int cpu; | 437 | int cpu; |
436 | int err; | 438 | int err; |
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c index f5f5154ea11e..43e2f8483e4f 100644 --- a/arch/x86/mm/pageattr.c +++ b/arch/x86/mm/pageattr.c | |||
@@ -849,7 +849,7 @@ int set_memory_uc(unsigned long addr, int numpages) | |||
849 | /* | 849 | /* |
850 | * for now UC MINUS. see comments in ioremap_nocache() | 850 | * for now UC MINUS. see comments in ioremap_nocache() |
851 | */ | 851 | */ |
852 | if (reserve_memtype(addr, addr + numpages * PAGE_SIZE, | 852 | if (reserve_memtype(__pa(addr), __pa(addr) + numpages * PAGE_SIZE, |
853 | _PAGE_CACHE_UC_MINUS, NULL)) | 853 | _PAGE_CACHE_UC_MINUS, NULL)) |
854 | return -EINVAL; | 854 | return -EINVAL; |
855 | 855 | ||
@@ -868,7 +868,7 @@ int set_memory_wc(unsigned long addr, int numpages) | |||
868 | if (!pat_enabled) | 868 | if (!pat_enabled) |
869 | return set_memory_uc(addr, numpages); | 869 | return set_memory_uc(addr, numpages); |
870 | 870 | ||
871 | if (reserve_memtype(addr, addr + numpages * PAGE_SIZE, | 871 | if (reserve_memtype(__pa(addr), __pa(addr) + numpages * PAGE_SIZE, |
872 | _PAGE_CACHE_WC, NULL)) | 872 | _PAGE_CACHE_WC, NULL)) |
873 | return -EINVAL; | 873 | return -EINVAL; |
874 | 874 | ||
@@ -884,7 +884,7 @@ int _set_memory_wb(unsigned long addr, int numpages) | |||
884 | 884 | ||
885 | int set_memory_wb(unsigned long addr, int numpages) | 885 | int set_memory_wb(unsigned long addr, int numpages) |
886 | { | 886 | { |
887 | free_memtype(addr, addr + numpages * PAGE_SIZE); | 887 | free_memtype(__pa(addr), __pa(addr) + numpages * PAGE_SIZE); |
888 | 888 | ||
889 | return _set_memory_wb(addr, numpages); | 889 | return _set_memory_wb(addr, numpages); |
890 | } | 890 | } |
diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c index 2fe30916d4b6..2a50e0fa64a5 100644 --- a/arch/x86/mm/pat.c +++ b/arch/x86/mm/pat.c | |||
@@ -207,6 +207,9 @@ static int chk_conflict(struct memtype *new, struct memtype *entry, | |||
207 | return -EBUSY; | 207 | return -EBUSY; |
208 | } | 208 | } |
209 | 209 | ||
210 | static struct memtype *cached_entry; | ||
211 | static u64 cached_start; | ||
212 | |||
210 | /* | 213 | /* |
211 | * req_type typically has one of the: | 214 | * req_type typically has one of the: |
212 | * - _PAGE_CACHE_WB | 215 | * - _PAGE_CACHE_WB |
@@ -280,11 +283,17 @@ int reserve_memtype(u64 start, u64 end, unsigned long req_type, | |||
280 | 283 | ||
281 | spin_lock(&memtype_lock); | 284 | spin_lock(&memtype_lock); |
282 | 285 | ||
286 | if (cached_entry && start >= cached_start) | ||
287 | entry = cached_entry; | ||
288 | else | ||
289 | entry = list_entry(&memtype_list, struct memtype, nd); | ||
290 | |||
283 | /* Search for existing mapping that overlaps the current range */ | 291 | /* Search for existing mapping that overlaps the current range */ |
284 | where = NULL; | 292 | where = NULL; |
285 | list_for_each_entry(entry, &memtype_list, nd) { | 293 | list_for_each_entry_continue(entry, &memtype_list, nd) { |
286 | if (end <= entry->start) { | 294 | if (end <= entry->start) { |
287 | where = entry->nd.prev; | 295 | where = entry->nd.prev; |
296 | cached_entry = list_entry(where, struct memtype, nd); | ||
288 | break; | 297 | break; |
289 | } else if (start <= entry->start) { /* end > entry->start */ | 298 | } else if (start <= entry->start) { /* end > entry->start */ |
290 | err = chk_conflict(new, entry, new_type); | 299 | err = chk_conflict(new, entry, new_type); |
@@ -292,6 +301,8 @@ int reserve_memtype(u64 start, u64 end, unsigned long req_type, | |||
292 | dprintk("Overlap at 0x%Lx-0x%Lx\n", | 301 | dprintk("Overlap at 0x%Lx-0x%Lx\n", |
293 | entry->start, entry->end); | 302 | entry->start, entry->end); |
294 | where = entry->nd.prev; | 303 | where = entry->nd.prev; |
304 | cached_entry = list_entry(where, | ||
305 | struct memtype, nd); | ||
295 | } | 306 | } |
296 | break; | 307 | break; |
297 | } else if (start < entry->end) { /* start > entry->start */ | 308 | } else if (start < entry->end) { /* start > entry->start */ |
@@ -299,7 +310,20 @@ int reserve_memtype(u64 start, u64 end, unsigned long req_type, | |||
299 | if (!err) { | 310 | if (!err) { |
300 | dprintk("Overlap at 0x%Lx-0x%Lx\n", | 311 | dprintk("Overlap at 0x%Lx-0x%Lx\n", |
301 | entry->start, entry->end); | 312 | entry->start, entry->end); |
302 | where = &entry->nd; | 313 | cached_entry = list_entry(entry->nd.prev, |
314 | struct memtype, nd); | ||
315 | |||
316 | /* | ||
317 | * Move to right position in the linked | ||
318 | * list to add this new entry | ||
319 | */ | ||
320 | list_for_each_entry_continue(entry, | ||
321 | &memtype_list, nd) { | ||
322 | if (start <= entry->start) { | ||
323 | where = entry->nd.prev; | ||
324 | break; | ||
325 | } | ||
326 | } | ||
303 | } | 327 | } |
304 | break; | 328 | break; |
305 | } | 329 | } |
@@ -314,6 +338,8 @@ int reserve_memtype(u64 start, u64 end, unsigned long req_type, | |||
314 | return err; | 338 | return err; |
315 | } | 339 | } |
316 | 340 | ||
341 | cached_start = start; | ||
342 | |||
317 | if (where) | 343 | if (where) |
318 | list_add(&new->nd, where); | 344 | list_add(&new->nd, where); |
319 | else | 345 | else |
@@ -343,6 +369,9 @@ int free_memtype(u64 start, u64 end) | |||
343 | spin_lock(&memtype_lock); | 369 | spin_lock(&memtype_lock); |
344 | list_for_each_entry(entry, &memtype_list, nd) { | 370 | list_for_each_entry(entry, &memtype_list, nd) { |
345 | if (entry->start == start && entry->end == end) { | 371 | if (entry->start == start && entry->end == end) { |
372 | if (cached_entry == entry || cached_start == start) | ||
373 | cached_entry = NULL; | ||
374 | |||
346 | list_del(&entry->nd); | 375 | list_del(&entry->nd); |
347 | kfree(entry); | 376 | kfree(entry); |
348 | err = 0; | 377 | err = 0; |
@@ -361,14 +390,6 @@ int free_memtype(u64 start, u64 end) | |||
361 | } | 390 | } |
362 | 391 | ||
363 | 392 | ||
364 | /* | ||
365 | * /dev/mem mmap interface. The memtype used for mapping varies: | ||
366 | * - Use UC for mappings with O_SYNC flag | ||
367 | * - Without O_SYNC flag, if there is any conflict in reserve_memtype, | ||
368 | * inherit the memtype from existing mapping. | ||
369 | * - Else use UC_MINUS memtype (for backward compatibility with existing | ||
370 | * X drivers. | ||
371 | */ | ||
372 | pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn, | 393 | pgprot_t phys_mem_access_prot(struct file *file, unsigned long pfn, |
373 | unsigned long size, pgprot_t vma_prot) | 394 | unsigned long size, pgprot_t vma_prot) |
374 | { | 395 | { |
@@ -406,14 +427,14 @@ int phys_mem_access_prot_allowed(struct file *file, unsigned long pfn, | |||
406 | unsigned long size, pgprot_t *vma_prot) | 427 | unsigned long size, pgprot_t *vma_prot) |
407 | { | 428 | { |
408 | u64 offset = ((u64) pfn) << PAGE_SHIFT; | 429 | u64 offset = ((u64) pfn) << PAGE_SHIFT; |
409 | unsigned long flags = _PAGE_CACHE_UC_MINUS; | 430 | unsigned long flags = -1; |
410 | int retval; | 431 | int retval; |
411 | 432 | ||
412 | if (!range_is_allowed(pfn, size)) | 433 | if (!range_is_allowed(pfn, size)) |
413 | return 0; | 434 | return 0; |
414 | 435 | ||
415 | if (file->f_flags & O_SYNC) { | 436 | if (file->f_flags & O_SYNC) { |
416 | flags = _PAGE_CACHE_UC; | 437 | flags = _PAGE_CACHE_UC_MINUS; |
417 | } | 438 | } |
418 | 439 | ||
419 | #ifdef CONFIG_X86_32 | 440 | #ifdef CONFIG_X86_32 |
@@ -436,13 +457,14 @@ int phys_mem_access_prot_allowed(struct file *file, unsigned long pfn, | |||
436 | #endif | 457 | #endif |
437 | 458 | ||
438 | /* | 459 | /* |
439 | * With O_SYNC, we can only take UC mapping. Fail if we cannot. | 460 | * With O_SYNC, we can only take UC_MINUS mapping. Fail if we cannot. |
461 | * | ||
440 | * Without O_SYNC, we want to get | 462 | * Without O_SYNC, we want to get |
441 | * - WB for WB-able memory and no other conflicting mappings | 463 | * - WB for WB-able memory and no other conflicting mappings |
442 | * - UC_MINUS for non-WB-able memory with no other conflicting mappings | 464 | * - UC_MINUS for non-WB-able memory with no other conflicting mappings |
443 | * - Inherit from confliting mappings otherwise | 465 | * - Inherit from confliting mappings otherwise |
444 | */ | 466 | */ |
445 | if (flags != _PAGE_CACHE_UC_MINUS) { | 467 | if (flags != -1) { |
446 | retval = reserve_memtype(offset, offset + size, flags, NULL); | 468 | retval = reserve_memtype(offset, offset + size, flags, NULL); |
447 | } else { | 469 | } else { |
448 | retval = reserve_memtype(offset, offset + size, -1, &flags); | 470 | retval = reserve_memtype(offset, offset + size, -1, &flags); |
diff --git a/arch/x86/oprofile/nmi_int.c b/arch/x86/oprofile/nmi_int.c index 3f90289410e6..0227694f7dab 100644 --- a/arch/x86/oprofile/nmi_int.c +++ b/arch/x86/oprofile/nmi_int.c | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/slab.h> | 15 | #include <linux/slab.h> |
16 | #include <linux/moduleparam.h> | 16 | #include <linux/moduleparam.h> |
17 | #include <linux/kdebug.h> | 17 | #include <linux/kdebug.h> |
18 | #include <linux/cpu.h> | ||
18 | #include <asm/nmi.h> | 19 | #include <asm/nmi.h> |
19 | #include <asm/msr.h> | 20 | #include <asm/msr.h> |
20 | #include <asm/apic.h> | 21 | #include <asm/apic.h> |
@@ -28,23 +29,48 @@ static DEFINE_PER_CPU(unsigned long, saved_lvtpc); | |||
28 | 29 | ||
29 | static int nmi_start(void); | 30 | static int nmi_start(void); |
30 | static void nmi_stop(void); | 31 | static void nmi_stop(void); |
32 | static void nmi_cpu_start(void *dummy); | ||
33 | static void nmi_cpu_stop(void *dummy); | ||
31 | 34 | ||
32 | /* 0 == registered but off, 1 == registered and on */ | 35 | /* 0 == registered but off, 1 == registered and on */ |
33 | static int nmi_enabled = 0; | 36 | static int nmi_enabled = 0; |
34 | 37 | ||
38 | #ifdef CONFIG_SMP | ||
39 | static int oprofile_cpu_notifier(struct notifier_block *b, unsigned long action, | ||
40 | void *data) | ||
41 | { | ||
42 | int cpu = (unsigned long)data; | ||
43 | switch (action) { | ||
44 | case CPU_DOWN_FAILED: | ||
45 | case CPU_ONLINE: | ||
46 | smp_call_function_single(cpu, nmi_cpu_start, NULL, 0); | ||
47 | break; | ||
48 | case CPU_DOWN_PREPARE: | ||
49 | smp_call_function_single(cpu, nmi_cpu_stop, NULL, 1); | ||
50 | break; | ||
51 | } | ||
52 | return NOTIFY_DONE; | ||
53 | } | ||
54 | |||
55 | static struct notifier_block oprofile_cpu_nb = { | ||
56 | .notifier_call = oprofile_cpu_notifier | ||
57 | }; | ||
58 | #endif | ||
59 | |||
35 | #ifdef CONFIG_PM | 60 | #ifdef CONFIG_PM |
36 | 61 | ||
37 | static int nmi_suspend(struct sys_device *dev, pm_message_t state) | 62 | static int nmi_suspend(struct sys_device *dev, pm_message_t state) |
38 | { | 63 | { |
64 | /* Only one CPU left, just stop that one */ | ||
39 | if (nmi_enabled == 1) | 65 | if (nmi_enabled == 1) |
40 | nmi_stop(); | 66 | nmi_cpu_stop(NULL); |
41 | return 0; | 67 | return 0; |
42 | } | 68 | } |
43 | 69 | ||
44 | static int nmi_resume(struct sys_device *dev) | 70 | static int nmi_resume(struct sys_device *dev) |
45 | { | 71 | { |
46 | if (nmi_enabled == 1) | 72 | if (nmi_enabled == 1) |
47 | nmi_start(); | 73 | nmi_cpu_start(NULL); |
48 | return 0; | 74 | return 0; |
49 | } | 75 | } |
50 | 76 | ||
@@ -463,6 +489,9 @@ int __init op_nmi_init(struct oprofile_operations *ops) | |||
463 | } | 489 | } |
464 | 490 | ||
465 | init_sysfs(); | 491 | init_sysfs(); |
492 | #ifdef CONFIG_SMP | ||
493 | register_cpu_notifier(&oprofile_cpu_nb); | ||
494 | #endif | ||
466 | using_nmi = 1; | 495 | using_nmi = 1; |
467 | ops->create_files = nmi_create_files; | 496 | ops->create_files = nmi_create_files; |
468 | ops->setup = nmi_setup; | 497 | ops->setup = nmi_setup; |
@@ -476,6 +505,10 @@ int __init op_nmi_init(struct oprofile_operations *ops) | |||
476 | 505 | ||
477 | void op_nmi_exit(void) | 506 | void op_nmi_exit(void) |
478 | { | 507 | { |
479 | if (using_nmi) | 508 | if (using_nmi) { |
480 | exit_sysfs(); | 509 | exit_sysfs(); |
510 | #ifdef CONFIG_SMP | ||
511 | unregister_cpu_notifier(&oprofile_cpu_nb); | ||
512 | #endif | ||
513 | } | ||
481 | } | 514 | } |
diff --git a/block/genhd.c b/block/genhd.c index c13cc77291af..656c2c7abf99 100644 --- a/block/genhd.c +++ b/block/genhd.c | |||
@@ -293,27 +293,30 @@ void __init printk_all_partitions(void) | |||
293 | /* iterator */ | 293 | /* iterator */ |
294 | static int find_start(struct device *dev, void *data) | 294 | static int find_start(struct device *dev, void *data) |
295 | { | 295 | { |
296 | loff_t k = *(loff_t *)data; | 296 | loff_t *k = data; |
297 | 297 | ||
298 | if (dev->type != &disk_type) | 298 | if (dev->type != &disk_type) |
299 | return 0; | 299 | return 0; |
300 | if (!k--) | 300 | if (!*k) |
301 | return 1; | 301 | return 1; |
302 | (*k)--; | ||
302 | return 0; | 303 | return 0; |
303 | } | 304 | } |
304 | 305 | ||
305 | static void *part_start(struct seq_file *part, loff_t *pos) | 306 | static void *part_start(struct seq_file *part, loff_t *pos) |
306 | { | 307 | { |
307 | struct device *dev; | 308 | struct device *dev; |
308 | loff_t n = *pos; | 309 | loff_t k = *pos; |
309 | 310 | ||
310 | if (!n) | 311 | if (!k) |
311 | seq_puts(part, "major minor #blocks name\n\n"); | 312 | seq_puts(part, "major minor #blocks name\n\n"); |
312 | 313 | ||
313 | mutex_lock(&block_class_lock); | 314 | mutex_lock(&block_class_lock); |
314 | dev = class_find_device(&block_class, NULL, (void *)pos, find_start); | 315 | dev = class_find_device(&block_class, NULL, &k, find_start); |
315 | if (dev) | 316 | if (dev) { |
317 | put_device(dev); | ||
316 | return dev_to_disk(dev); | 318 | return dev_to_disk(dev); |
319 | } | ||
317 | return NULL; | 320 | return NULL; |
318 | } | 321 | } |
319 | 322 | ||
@@ -330,8 +333,10 @@ static void *part_next(struct seq_file *part, void *v, loff_t *pos) | |||
330 | struct device *dev; | 333 | struct device *dev; |
331 | ++*pos; | 334 | ++*pos; |
332 | dev = class_find_device(&block_class, &gp->dev, NULL, find_next); | 335 | dev = class_find_device(&block_class, &gp->dev, NULL, find_next); |
333 | if (dev) | 336 | if (dev) { |
337 | put_device(dev); | ||
334 | return dev_to_disk(dev); | 338 | return dev_to_disk(dev); |
339 | } | ||
335 | return NULL; | 340 | return NULL; |
336 | } | 341 | } |
337 | 342 | ||
@@ -568,11 +573,14 @@ static struct device_type disk_type = { | |||
568 | static void *diskstats_start(struct seq_file *part, loff_t *pos) | 573 | static void *diskstats_start(struct seq_file *part, loff_t *pos) |
569 | { | 574 | { |
570 | struct device *dev; | 575 | struct device *dev; |
576 | loff_t k = *pos; | ||
571 | 577 | ||
572 | mutex_lock(&block_class_lock); | 578 | mutex_lock(&block_class_lock); |
573 | dev = class_find_device(&block_class, NULL, (void *)pos, find_start); | 579 | dev = class_find_device(&block_class, NULL, &k, find_start); |
574 | if (dev) | 580 | if (dev) { |
581 | put_device(dev); | ||
575 | return dev_to_disk(dev); | 582 | return dev_to_disk(dev); |
583 | } | ||
576 | return NULL; | 584 | return NULL; |
577 | } | 585 | } |
578 | 586 | ||
@@ -583,8 +591,10 @@ static void *diskstats_next(struct seq_file *part, void *v, loff_t *pos) | |||
583 | 591 | ||
584 | ++*pos; | 592 | ++*pos; |
585 | dev = class_find_device(&block_class, &gp->dev, NULL, find_next); | 593 | dev = class_find_device(&block_class, &gp->dev, NULL, find_next); |
586 | if (dev) | 594 | if (dev) { |
595 | put_device(dev); | ||
587 | return dev_to_disk(dev); | 596 | return dev_to_disk(dev); |
597 | } | ||
588 | return NULL; | 598 | return NULL; |
589 | } | 599 | } |
590 | 600 | ||
@@ -712,10 +722,12 @@ dev_t blk_lookup_devt(const char *name, int part) | |||
712 | mutex_lock(&block_class_lock); | 722 | mutex_lock(&block_class_lock); |
713 | find.name = name; | 723 | find.name = name; |
714 | find.part = part; | 724 | find.part = part; |
715 | dev = class_find_device(&block_class, NULL, (void *)&find, match_id); | 725 | dev = class_find_device(&block_class, NULL, &find, match_id); |
716 | if (dev) | 726 | if (dev) { |
727 | put_device(dev); | ||
717 | devt = MKDEV(MAJOR(dev->devt), | 728 | devt = MKDEV(MAJOR(dev->devt), |
718 | MINOR(dev->devt) + part); | 729 | MINOR(dev->devt) + part); |
730 | } | ||
719 | mutex_unlock(&block_class_lock); | 731 | mutex_unlock(&block_class_lock); |
720 | 732 | ||
721 | return devt; | 733 | return devt; |
diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index ef3e5522e1a4..c729e6988bbb 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c | |||
@@ -486,6 +486,8 @@ static const struct pci_device_id ahci_pci_tbl[] = { | |||
486 | { PCI_VDEVICE(INTEL, 0x502b), board_ahci }, /* Tolapai */ | 486 | { PCI_VDEVICE(INTEL, 0x502b), board_ahci }, /* Tolapai */ |
487 | { PCI_VDEVICE(INTEL, 0x3a05), board_ahci }, /* ICH10 */ | 487 | { PCI_VDEVICE(INTEL, 0x3a05), board_ahci }, /* ICH10 */ |
488 | { PCI_VDEVICE(INTEL, 0x3a25), board_ahci }, /* ICH10 */ | 488 | { PCI_VDEVICE(INTEL, 0x3a25), board_ahci }, /* ICH10 */ |
489 | { PCI_VDEVICE(INTEL, 0x3b24), board_ahci }, /* PCH RAID */ | ||
490 | { PCI_VDEVICE(INTEL, 0x3b2b), board_ahci }, /* PCH RAID */ | ||
489 | 491 | ||
490 | /* JMicron 360/1/3/5/6, match class to avoid IDE function */ | 492 | /* JMicron 360/1/3/5/6, match class to avoid IDE function */ |
491 | { PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, | 493 | { PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, |
@@ -575,9 +577,9 @@ static const struct pci_device_id ahci_pci_tbl[] = { | |||
575 | { PCI_VDEVICE(NVIDIA, 0x0bc7), board_ahci }, /* MCP7B */ | 577 | { PCI_VDEVICE(NVIDIA, 0x0bc7), board_ahci }, /* MCP7B */ |
576 | 578 | ||
577 | /* SiS */ | 579 | /* SiS */ |
578 | { PCI_VDEVICE(SI, 0x1184), board_ahci_nopmp }, /* SiS 966 */ | 580 | { PCI_VDEVICE(SI, 0x1184), board_ahci }, /* SiS 966 */ |
579 | { PCI_VDEVICE(SI, 0x1185), board_ahci_nopmp }, /* SiS 968 */ | 581 | { PCI_VDEVICE(SI, 0x1185), board_ahci }, /* SiS 968 */ |
580 | { PCI_VDEVICE(SI, 0x0186), board_ahci_nopmp }, /* SiS 968 */ | 582 | { PCI_VDEVICE(SI, 0x0186), board_ahci }, /* SiS 968 */ |
581 | 583 | ||
582 | /* Marvell */ | 584 | /* Marvell */ |
583 | { PCI_VDEVICE(MARVELL, 0x6145), board_ahci_mv }, /* 6145 */ | 585 | { PCI_VDEVICE(MARVELL, 0x6145), board_ahci_mv }, /* 6145 */ |
diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c index c294121fd69e..b1d08a8f5003 100644 --- a/drivers/ata/ata_piix.c +++ b/drivers/ata/ata_piix.c | |||
@@ -275,6 +275,14 @@ static const struct pci_device_id piix_pci_tbl[] = { | |||
275 | { 0x8086, 0x3a20, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata }, | 275 | { 0x8086, 0x3a20, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata }, |
276 | /* SATA Controller IDE (ICH10) */ | 276 | /* SATA Controller IDE (ICH10) */ |
277 | { 0x8086, 0x3a26, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata }, | 277 | { 0x8086, 0x3a26, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata }, |
278 | /* SATA Controller IDE (PCH) */ | ||
279 | { 0x8086, 0x3b20, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata }, | ||
280 | /* SATA Controller IDE (PCH) */ | ||
281 | { 0x8086, 0x3b26, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata }, | ||
282 | /* SATA Controller IDE (PCH) */ | ||
283 | { 0x8086, 0x3b2d, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_2port_sata }, | ||
284 | /* SATA Controller IDE (PCH) */ | ||
285 | { 0x8086, 0x3b2e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, ich8_sata }, | ||
278 | 286 | ||
279 | { } /* terminate list */ | 287 | { } /* terminate list */ |
280 | }; | 288 | }; |
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 5ba96c5052c8..79e3a8e7a84a 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
@@ -104,6 +104,7 @@ struct ata_force_param { | |||
104 | unsigned long xfer_mask; | 104 | unsigned long xfer_mask; |
105 | unsigned int horkage_on; | 105 | unsigned int horkage_on; |
106 | unsigned int horkage_off; | 106 | unsigned int horkage_off; |
107 | unsigned int lflags; | ||
107 | }; | 108 | }; |
108 | 109 | ||
109 | struct ata_force_ent { | 110 | struct ata_force_ent { |
@@ -196,22 +197,23 @@ void ata_force_cbl(struct ata_port *ap) | |||
196 | } | 197 | } |
197 | 198 | ||
198 | /** | 199 | /** |
199 | * ata_force_spd_limit - force SATA spd limit according to libata.force | 200 | * ata_force_link_limits - force link limits according to libata.force |
200 | * @link: ATA link of interest | 201 | * @link: ATA link of interest |
201 | * | 202 | * |
202 | * Force SATA spd limit according to libata.force and whine about | 203 | * Force link flags and SATA spd limit according to libata.force |
203 | * it. When only the port part is specified (e.g. 1:), the limit | 204 | * and whine about it. When only the port part is specified |
204 | * applies to all links connected to both the host link and all | 205 | * (e.g. 1:), the limit applies to all links connected to both |
205 | * fan-out ports connected via PMP. If the device part is | 206 | * the host link and all fan-out ports connected via PMP. If the |
206 | * specified as 0 (e.g. 1.00:), it specifies the first fan-out | 207 | * device part is specified as 0 (e.g. 1.00:), it specifies the |
207 | * link not the host link. Device number 15 always points to the | 208 | * first fan-out link not the host link. Device number 15 always |
208 | * host link whether PMP is attached or not. | 209 | * points to the host link whether PMP is attached or not. |
209 | * | 210 | * |
210 | * LOCKING: | 211 | * LOCKING: |
211 | * EH context. | 212 | * EH context. |
212 | */ | 213 | */ |
213 | static void ata_force_spd_limit(struct ata_link *link) | 214 | static void ata_force_link_limits(struct ata_link *link) |
214 | { | 215 | { |
216 | bool did_spd = false; | ||
215 | int linkno, i; | 217 | int linkno, i; |
216 | 218 | ||
217 | if (ata_is_host_link(link)) | 219 | if (ata_is_host_link(link)) |
@@ -228,13 +230,22 @@ static void ata_force_spd_limit(struct ata_link *link) | |||
228 | if (fe->device != -1 && fe->device != linkno) | 230 | if (fe->device != -1 && fe->device != linkno) |
229 | continue; | 231 | continue; |
230 | 232 | ||
231 | if (!fe->param.spd_limit) | 233 | /* only honor the first spd limit */ |
232 | continue; | 234 | if (!did_spd && fe->param.spd_limit) { |
235 | link->hw_sata_spd_limit = (1 << fe->param.spd_limit) - 1; | ||
236 | ata_link_printk(link, KERN_NOTICE, | ||
237 | "FORCE: PHY spd limit set to %s\n", | ||
238 | fe->param.name); | ||
239 | did_spd = true; | ||
240 | } | ||
233 | 241 | ||
234 | link->hw_sata_spd_limit = (1 << fe->param.spd_limit) - 1; | 242 | /* let lflags stack */ |
235 | ata_link_printk(link, KERN_NOTICE, | 243 | if (fe->param.lflags) { |
236 | "FORCE: PHY spd limit set to %s\n", fe->param.name); | 244 | link->flags |= fe->param.lflags; |
237 | return; | 245 | ata_link_printk(link, KERN_NOTICE, |
246 | "FORCE: link flag 0x%x forced -> 0x%x\n", | ||
247 | fe->param.lflags, link->flags); | ||
248 | } | ||
238 | } | 249 | } |
239 | } | 250 | } |
240 | 251 | ||
@@ -3277,7 +3288,7 @@ int ata_do_set_mode(struct ata_link *link, struct ata_device **r_failed_dev) | |||
3277 | dev->dma_mode = ata_xfer_mask2mode(dma_mask); | 3288 | dev->dma_mode = ata_xfer_mask2mode(dma_mask); |
3278 | 3289 | ||
3279 | found = 1; | 3290 | found = 1; |
3280 | if (dev->dma_mode != 0xff) | 3291 | if (ata_dma_enabled(dev)) |
3281 | used_dma = 1; | 3292 | used_dma = 1; |
3282 | } | 3293 | } |
3283 | if (!found) | 3294 | if (!found) |
@@ -3302,7 +3313,7 @@ int ata_do_set_mode(struct ata_link *link, struct ata_device **r_failed_dev) | |||
3302 | 3313 | ||
3303 | /* step 3: set host DMA timings */ | 3314 | /* step 3: set host DMA timings */ |
3304 | ata_link_for_each_dev(dev, link) { | 3315 | ata_link_for_each_dev(dev, link) { |
3305 | if (!ata_dev_enabled(dev) || dev->dma_mode == 0xff) | 3316 | if (!ata_dev_enabled(dev) || !ata_dma_enabled(dev)) |
3306 | continue; | 3317 | continue; |
3307 | 3318 | ||
3308 | dev->xfer_mode = dev->dma_mode; | 3319 | dev->xfer_mode = dev->dma_mode; |
@@ -5188,19 +5199,18 @@ void ata_link_init(struct ata_port *ap, struct ata_link *link, int pmp) | |||
5188 | */ | 5199 | */ |
5189 | int sata_link_init_spd(struct ata_link *link) | 5200 | int sata_link_init_spd(struct ata_link *link) |
5190 | { | 5201 | { |
5191 | u32 scontrol; | ||
5192 | u8 spd; | 5202 | u8 spd; |
5193 | int rc; | 5203 | int rc; |
5194 | 5204 | ||
5195 | rc = sata_scr_read(link, SCR_CONTROL, &scontrol); | 5205 | rc = sata_scr_read(link, SCR_CONTROL, &link->saved_scontrol); |
5196 | if (rc) | 5206 | if (rc) |
5197 | return rc; | 5207 | return rc; |
5198 | 5208 | ||
5199 | spd = (scontrol >> 4) & 0xf; | 5209 | spd = (link->saved_scontrol >> 4) & 0xf; |
5200 | if (spd) | 5210 | if (spd) |
5201 | link->hw_sata_spd_limit &= (1 << spd) - 1; | 5211 | link->hw_sata_spd_limit &= (1 << spd) - 1; |
5202 | 5212 | ||
5203 | ata_force_spd_limit(link); | 5213 | ata_force_link_limits(link); |
5204 | 5214 | ||
5205 | link->sata_spd_limit = link->hw_sata_spd_limit; | 5215 | link->sata_spd_limit = link->hw_sata_spd_limit; |
5206 | 5216 | ||
@@ -5783,9 +5793,10 @@ static void ata_port_detach(struct ata_port *ap) | |||
5783 | ata_port_wait_eh(ap); | 5793 | ata_port_wait_eh(ap); |
5784 | 5794 | ||
5785 | /* EH is now guaranteed to see UNLOADING - EH context belongs | 5795 | /* EH is now guaranteed to see UNLOADING - EH context belongs |
5786 | * to us. Disable all existing devices. | 5796 | * to us. Restore SControl and disable all existing devices. |
5787 | */ | 5797 | */ |
5788 | ata_port_for_each_link(link, ap) { | 5798 | __ata_port_for_each_link(link, ap) { |
5799 | sata_scr_write(link, SCR_CONTROL, link->saved_scontrol); | ||
5789 | ata_link_for_each_dev(dev, link) | 5800 | ata_link_for_each_dev(dev, link) |
5790 | ata_dev_disable(dev); | 5801 | ata_dev_disable(dev); |
5791 | } | 5802 | } |
@@ -5991,6 +6002,9 @@ static int __init ata_parse_force_one(char **cur, | |||
5991 | { "udma133", .xfer_mask = 1 << (ATA_SHIFT_UDMA + 6) }, | 6002 | { "udma133", .xfer_mask = 1 << (ATA_SHIFT_UDMA + 6) }, |
5992 | { "udma/133", .xfer_mask = 1 << (ATA_SHIFT_UDMA + 6) }, | 6003 | { "udma/133", .xfer_mask = 1 << (ATA_SHIFT_UDMA + 6) }, |
5993 | { "udma7", .xfer_mask = 1 << (ATA_SHIFT_UDMA + 7) }, | 6004 | { "udma7", .xfer_mask = 1 << (ATA_SHIFT_UDMA + 7) }, |
6005 | { "nohrst", .lflags = ATA_LFLAG_NO_HRST }, | ||
6006 | { "nosrst", .lflags = ATA_LFLAG_NO_SRST }, | ||
6007 | { "norst", .lflags = ATA_LFLAG_NO_HRST | ATA_LFLAG_NO_SRST }, | ||
5994 | }; | 6008 | }; |
5995 | char *start = *cur, *p = *cur; | 6009 | char *start = *cur, *p = *cur; |
5996 | char *id, *val, *endp; | 6010 | char *id, *val, *endp; |
diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c index 58bdc538d229..c1db2f234d2e 100644 --- a/drivers/ata/libata-eh.c +++ b/drivers/ata/libata-eh.c | |||
@@ -2040,7 +2040,7 @@ static void ata_eh_link_report(struct ata_link *link) | |||
2040 | } | 2040 | } |
2041 | 2041 | ||
2042 | if (ehc->i.serror) | 2042 | if (ehc->i.serror) |
2043 | ata_port_printk(ap, KERN_ERR, | 2043 | ata_link_printk(link, KERN_ERR, |
2044 | "SError: { %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s}\n", | 2044 | "SError: { %s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s%s}\n", |
2045 | ehc->i.serror & SERR_DATA_RECOVERED ? "RecovData " : "", | 2045 | ehc->i.serror & SERR_DATA_RECOVERED ? "RecovData " : "", |
2046 | ehc->i.serror & SERR_COMM_RECOVERED ? "RecovComm " : "", | 2046 | ehc->i.serror & SERR_COMM_RECOVERED ? "RecovComm " : "", |
@@ -2171,18 +2171,12 @@ static int ata_do_reset(struct ata_link *link, ata_reset_fn_t reset, | |||
2171 | } | 2171 | } |
2172 | 2172 | ||
2173 | static int ata_eh_followup_srst_needed(struct ata_link *link, | 2173 | static int ata_eh_followup_srst_needed(struct ata_link *link, |
2174 | int rc, int classify, | 2174 | int rc, const unsigned int *classes) |
2175 | const unsigned int *classes) | ||
2176 | { | 2175 | { |
2177 | if ((link->flags & ATA_LFLAG_NO_SRST) || ata_link_offline(link)) | 2176 | if ((link->flags & ATA_LFLAG_NO_SRST) || ata_link_offline(link)) |
2178 | return 0; | 2177 | return 0; |
2179 | if (rc == -EAGAIN) { | 2178 | if (rc == -EAGAIN) |
2180 | if (classify) | 2179 | return 1; |
2181 | return 1; | ||
2182 | rc = 0; | ||
2183 | } | ||
2184 | if (rc != 0) | ||
2185 | return 0; | ||
2186 | if (sata_pmp_supported(link->ap) && ata_is_host_link(link)) | 2180 | if (sata_pmp_supported(link->ap) && ata_is_host_link(link)) |
2187 | return 1; | 2181 | return 1; |
2188 | return 0; | 2182 | return 0; |
@@ -2210,6 +2204,10 @@ int ata_eh_reset(struct ata_link *link, int classify, | |||
2210 | */ | 2204 | */ |
2211 | while (ata_eh_reset_timeouts[max_tries] != ULONG_MAX) | 2205 | while (ata_eh_reset_timeouts[max_tries] != ULONG_MAX) |
2212 | max_tries++; | 2206 | max_tries++; |
2207 | if (link->flags & ATA_LFLAG_NO_HRST) | ||
2208 | hardreset = NULL; | ||
2209 | if (link->flags & ATA_LFLAG_NO_SRST) | ||
2210 | softreset = NULL; | ||
2213 | 2211 | ||
2214 | now = jiffies; | 2212 | now = jiffies; |
2215 | deadline = ata_deadline(ehc->last_reset, ATA_EH_RESET_COOL_DOWN); | 2213 | deadline = ata_deadline(ehc->last_reset, ATA_EH_RESET_COOL_DOWN); |
@@ -2247,10 +2245,10 @@ int ata_eh_reset(struct ata_link *link, int classify, | |||
2247 | ehc->i.action &= ~ATA_EH_RESET; | 2245 | ehc->i.action &= ~ATA_EH_RESET; |
2248 | if (hardreset) { | 2246 | if (hardreset) { |
2249 | reset = hardreset; | 2247 | reset = hardreset; |
2250 | ehc->i.action = ATA_EH_HARDRESET; | 2248 | ehc->i.action |= ATA_EH_HARDRESET; |
2251 | } else if (softreset) { | 2249 | } else if (softreset) { |
2252 | reset = softreset; | 2250 | reset = softreset; |
2253 | ehc->i.action = ATA_EH_SOFTRESET; | 2251 | ehc->i.action |= ATA_EH_SOFTRESET; |
2254 | } | 2252 | } |
2255 | 2253 | ||
2256 | if (prereset) { | 2254 | if (prereset) { |
@@ -2305,9 +2303,11 @@ int ata_eh_reset(struct ata_link *link, int classify, | |||
2305 | ehc->i.flags |= ATA_EHI_DID_SOFTRESET; | 2303 | ehc->i.flags |= ATA_EHI_DID_SOFTRESET; |
2306 | 2304 | ||
2307 | rc = ata_do_reset(link, reset, classes, deadline); | 2305 | rc = ata_do_reset(link, reset, classes, deadline); |
2306 | if (rc && rc != -EAGAIN) | ||
2307 | goto fail; | ||
2308 | 2308 | ||
2309 | if (reset == hardreset && | 2309 | if (reset == hardreset && |
2310 | ata_eh_followup_srst_needed(link, rc, classify, classes)) { | 2310 | ata_eh_followup_srst_needed(link, rc, classes)) { |
2311 | /* okay, let's do follow-up softreset */ | 2311 | /* okay, let's do follow-up softreset */ |
2312 | reset = softreset; | 2312 | reset = softreset; |
2313 | 2313 | ||
@@ -2322,10 +2322,6 @@ int ata_eh_reset(struct ata_link *link, int classify, | |||
2322 | ata_eh_about_to_do(link, NULL, ATA_EH_RESET); | 2322 | ata_eh_about_to_do(link, NULL, ATA_EH_RESET); |
2323 | rc = ata_do_reset(link, reset, classes, deadline); | 2323 | rc = ata_do_reset(link, reset, classes, deadline); |
2324 | } | 2324 | } |
2325 | |||
2326 | /* -EAGAIN can happen if we skipped followup SRST */ | ||
2327 | if (rc && rc != -EAGAIN) | ||
2328 | goto fail; | ||
2329 | } else { | 2325 | } else { |
2330 | if (verbose) | 2326 | if (verbose) |
2331 | ata_link_printk(link, KERN_INFO, "no reset method " | 2327 | ata_link_printk(link, KERN_INFO, "no reset method " |
diff --git a/drivers/ata/pata_acpi.c b/drivers/ata/pata_acpi.c index fbe605711554..eb919c16a03e 100644 --- a/drivers/ata/pata_acpi.c +++ b/drivers/ata/pata_acpi.c | |||
@@ -181,7 +181,7 @@ static unsigned int pacpi_qc_issue(struct ata_queued_cmd *qc) | |||
181 | 181 | ||
182 | if (adev != acpi->last) { | 182 | if (adev != acpi->last) { |
183 | pacpi_set_piomode(ap, adev); | 183 | pacpi_set_piomode(ap, adev); |
184 | if (adev->dma_mode) | 184 | if (ata_dma_enabled(adev)) |
185 | pacpi_set_dmamode(ap, adev); | 185 | pacpi_set_dmamode(ap, adev); |
186 | acpi->last = adev; | 186 | acpi->last = adev; |
187 | } | 187 | } |
diff --git a/drivers/ata/pata_atiixp.c b/drivers/ata/pata_atiixp.c index d7de7baf58a8..e8a0d99d7356 100644 --- a/drivers/ata/pata_atiixp.c +++ b/drivers/ata/pata_atiixp.c | |||
@@ -183,7 +183,7 @@ static void atiixp_bmdma_start(struct ata_queued_cmd *qc) | |||
183 | u16 tmp16; | 183 | u16 tmp16; |
184 | 184 | ||
185 | pci_read_config_word(pdev, ATIIXP_IDE_UDMA_CONTROL, &tmp16); | 185 | pci_read_config_word(pdev, ATIIXP_IDE_UDMA_CONTROL, &tmp16); |
186 | if (adev->dma_mode >= XFER_UDMA_0) | 186 | if (ata_using_udma(adev)) |
187 | tmp16 |= (1 << dn); | 187 | tmp16 |= (1 << dn); |
188 | else | 188 | else |
189 | tmp16 &= ~(1 << dn); | 189 | tmp16 &= ~(1 << dn); |
diff --git a/drivers/ata/pata_cs5530.c b/drivers/ata/pata_cs5530.c index 744beebaaf49..0c4b271a9d5a 100644 --- a/drivers/ata/pata_cs5530.c +++ b/drivers/ata/pata_cs5530.c | |||
@@ -149,10 +149,10 @@ static unsigned int cs5530_qc_issue(struct ata_queued_cmd *qc) | |||
149 | struct ata_device *prev = ap->private_data; | 149 | struct ata_device *prev = ap->private_data; |
150 | 150 | ||
151 | /* See if the DMA settings could be wrong */ | 151 | /* See if the DMA settings could be wrong */ |
152 | if (adev->dma_mode != 0 && adev != prev && prev != NULL) { | 152 | if (ata_dma_enabled(adev) && adev != prev && prev != NULL) { |
153 | /* Maybe, but do the channels match MWDMA/UDMA ? */ | 153 | /* Maybe, but do the channels match MWDMA/UDMA ? */ |
154 | if ((adev->dma_mode >= XFER_UDMA_0 && prev->dma_mode < XFER_UDMA_0) || | 154 | if ((ata_using_udma(adev) && !ata_using_udma(prev)) || |
155 | (adev->dma_mode < XFER_UDMA_0 && prev->dma_mode >= XFER_UDMA_0)) | 155 | (ata_using_udma(prev) && !ata_using_udma(adev))) |
156 | /* Switch the mode bits */ | 156 | /* Switch the mode bits */ |
157 | cs5530_set_dmamode(ap, adev); | 157 | cs5530_set_dmamode(ap, adev); |
158 | } | 158 | } |
diff --git a/drivers/ata/pata_it821x.c b/drivers/ata/pata_it821x.c index 27843c70eb9d..0221c9a46769 100644 --- a/drivers/ata/pata_it821x.c +++ b/drivers/ata/pata_it821x.c | |||
@@ -606,7 +606,7 @@ static void it821x_display_disk(int n, u8 *buf) | |||
606 | { | 606 | { |
607 | unsigned char id[41]; | 607 | unsigned char id[41]; |
608 | int mode = 0; | 608 | int mode = 0; |
609 | char *mtype; | 609 | char *mtype = ""; |
610 | char mbuf[8]; | 610 | char mbuf[8]; |
611 | char *cbl = "(40 wire cable)"; | 611 | char *cbl = "(40 wire cable)"; |
612 | 612 | ||
diff --git a/drivers/ata/pata_oldpiix.c b/drivers/ata/pata_oldpiix.c index e678af383d13..df64f2443001 100644 --- a/drivers/ata/pata_oldpiix.c +++ b/drivers/ata/pata_oldpiix.c | |||
@@ -198,7 +198,7 @@ static unsigned int oldpiix_qc_issue(struct ata_queued_cmd *qc) | |||
198 | 198 | ||
199 | if (adev != ap->private_data) { | 199 | if (adev != ap->private_data) { |
200 | oldpiix_set_piomode(ap, adev); | 200 | oldpiix_set_piomode(ap, adev); |
201 | if (adev->dma_mode) | 201 | if (ata_dma_enabled(adev)) |
202 | oldpiix_set_dmamode(ap, adev); | 202 | oldpiix_set_dmamode(ap, adev); |
203 | } | 203 | } |
204 | return ata_sff_qc_issue(qc); | 204 | return ata_sff_qc_issue(qc); |
diff --git a/drivers/ata/pata_sc1200.c b/drivers/ata/pata_sc1200.c index cbab397e3db7..0278fd2b8fb1 100644 --- a/drivers/ata/pata_sc1200.c +++ b/drivers/ata/pata_sc1200.c | |||
@@ -167,10 +167,10 @@ static unsigned int sc1200_qc_issue(struct ata_queued_cmd *qc) | |||
167 | struct ata_device *prev = ap->private_data; | 167 | struct ata_device *prev = ap->private_data; |
168 | 168 | ||
169 | /* See if the DMA settings could be wrong */ | 169 | /* See if the DMA settings could be wrong */ |
170 | if (adev->dma_mode != 0 && adev != prev && prev != NULL) { | 170 | if (ata_dma_enabled(adev) && adev != prev && prev != NULL) { |
171 | /* Maybe, but do the channels match MWDMA/UDMA ? */ | 171 | /* Maybe, but do the channels match MWDMA/UDMA ? */ |
172 | if ((adev->dma_mode >= XFER_UDMA_0 && prev->dma_mode < XFER_UDMA_0) || | 172 | if ((ata_using_udma(adev) && !ata_using_udma(prev)) || |
173 | (adev->dma_mode < XFER_UDMA_0 && prev->dma_mode >= XFER_UDMA_0)) | 173 | (ata_using_udma(prev) && !ata_using_udma(adev))) |
174 | /* Switch the mode bits */ | 174 | /* Switch the mode bits */ |
175 | sc1200_set_dmamode(ap, adev); | 175 | sc1200_set_dmamode(ap, adev); |
176 | } | 176 | } |
diff --git a/drivers/ata/pata_via.c b/drivers/ata/pata_via.c index 57d951b11f2d..8fdb2ce73210 100644 --- a/drivers/ata/pata_via.c +++ b/drivers/ata/pata_via.c | |||
@@ -324,62 +324,26 @@ static void via_set_dmamode(struct ata_port *ap, struct ata_device *adev) | |||
324 | } | 324 | } |
325 | 325 | ||
326 | /** | 326 | /** |
327 | * via_ata_sff_tf_load - send taskfile registers to host controller | 327 | * via_tf_load - send taskfile registers to host controller |
328 | * @ap: Port to which output is sent | 328 | * @ap: Port to which output is sent |
329 | * @tf: ATA taskfile register set | 329 | * @tf: ATA taskfile register set |
330 | * | 330 | * |
331 | * Outputs ATA taskfile to standard ATA host controller. | 331 | * Outputs ATA taskfile to standard ATA host controller. |
332 | * | 332 | * |
333 | * Note: This is to fix the internal bug of via chipsets, which | 333 | * Note: This is to fix the internal bug of via chipsets, which |
334 | * will reset the device register after changing the IEN bit on | 334 | * will reset the device register after changing the IEN bit on |
335 | * ctl register | 335 | * ctl register |
336 | */ | 336 | */ |
337 | static void via_ata_tf_load(struct ata_port *ap, const struct ata_taskfile *tf) | 337 | static void via_tf_load(struct ata_port *ap, const struct ata_taskfile *tf) |
338 | { | 338 | { |
339 | struct ata_ioports *ioaddr = &ap->ioaddr; | 339 | struct ata_taskfile tmp_tf; |
340 | unsigned int is_addr = tf->flags & ATA_TFLAG_ISADDR; | ||
341 | |||
342 | if (tf->ctl != ap->last_ctl) { | ||
343 | iowrite8(tf->ctl, ioaddr->ctl_addr); | ||
344 | iowrite8(tf->device, ioaddr->device_addr); | ||
345 | ap->last_ctl = tf->ctl; | ||
346 | ata_wait_idle(ap); | ||
347 | } | ||
348 | |||
349 | if (is_addr && (tf->flags & ATA_TFLAG_LBA48)) { | ||
350 | iowrite8(tf->hob_feature, ioaddr->feature_addr); | ||
351 | iowrite8(tf->hob_nsect, ioaddr->nsect_addr); | ||
352 | iowrite8(tf->hob_lbal, ioaddr->lbal_addr); | ||
353 | iowrite8(tf->hob_lbam, ioaddr->lbam_addr); | ||
354 | iowrite8(tf->hob_lbah, ioaddr->lbah_addr); | ||
355 | VPRINTK("hob: feat 0x%X nsect 0x%X, lba 0x%X 0x%X 0x%X\n", | ||
356 | tf->hob_feature, | ||
357 | tf->hob_nsect, | ||
358 | tf->hob_lbal, | ||
359 | tf->hob_lbam, | ||
360 | tf->hob_lbah); | ||
361 | } | ||
362 | 340 | ||
363 | if (is_addr) { | 341 | if (ap->ctl != ap->last_ctl && !(tf->flags & ATA_TFLAG_DEVICE)) { |
364 | iowrite8(tf->feature, ioaddr->feature_addr); | 342 | tmp_tf = *tf; |
365 | iowrite8(tf->nsect, ioaddr->nsect_addr); | 343 | tmp_tf.flags |= ATA_TFLAG_DEVICE; |
366 | iowrite8(tf->lbal, ioaddr->lbal_addr); | 344 | tf = &tmp_tf; |
367 | iowrite8(tf->lbam, ioaddr->lbam_addr); | ||
368 | iowrite8(tf->lbah, ioaddr->lbah_addr); | ||
369 | VPRINTK("feat 0x%X nsect 0x%X lba 0x%X 0x%X 0x%X\n", | ||
370 | tf->feature, | ||
371 | tf->nsect, | ||
372 | tf->lbal, | ||
373 | tf->lbam, | ||
374 | tf->lbah); | ||
375 | } | 345 | } |
376 | 346 | ata_sff_tf_load(ap, tf); | |
377 | if (tf->flags & ATA_TFLAG_DEVICE) { | ||
378 | iowrite8(tf->device, ioaddr->device_addr); | ||
379 | VPRINTK("device 0x%X\n", tf->device); | ||
380 | } | ||
381 | |||
382 | ata_wait_idle(ap); | ||
383 | } | 347 | } |
384 | 348 | ||
385 | static struct scsi_host_template via_sht = { | 349 | static struct scsi_host_template via_sht = { |
@@ -392,13 +356,12 @@ static struct ata_port_operations via_port_ops = { | |||
392 | .set_piomode = via_set_piomode, | 356 | .set_piomode = via_set_piomode, |
393 | .set_dmamode = via_set_dmamode, | 357 | .set_dmamode = via_set_dmamode, |
394 | .prereset = via_pre_reset, | 358 | .prereset = via_pre_reset, |
395 | .sff_tf_load = via_ata_tf_load, | 359 | .sff_tf_load = via_tf_load, |
396 | }; | 360 | }; |
397 | 361 | ||
398 | static struct ata_port_operations via_port_ops_noirq = { | 362 | static struct ata_port_operations via_port_ops_noirq = { |
399 | .inherits = &via_port_ops, | 363 | .inherits = &via_port_ops, |
400 | .sff_data_xfer = ata_sff_data_xfer_noirq, | 364 | .sff_data_xfer = ata_sff_data_xfer_noirq, |
401 | .sff_tf_load = via_ata_tf_load, | ||
402 | }; | 365 | }; |
403 | 366 | ||
404 | /** | 367 | /** |
diff --git a/drivers/ata/sata_mv.c b/drivers/ata/sata_mv.c index ad169ffbc4cb..13c1d2af18ac 100644 --- a/drivers/ata/sata_mv.c +++ b/drivers/ata/sata_mv.c | |||
@@ -1134,30 +1134,16 @@ static int mv_qc_defer(struct ata_queued_cmd *qc) | |||
1134 | if (ap->nr_active_links == 0) | 1134 | if (ap->nr_active_links == 0) |
1135 | return 0; | 1135 | return 0; |
1136 | 1136 | ||
1137 | if (pp->pp_flags & MV_PP_FLAG_EDMA_EN) { | 1137 | /* |
1138 | /* | 1138 | * The port is operating in host queuing mode (EDMA) with NCQ |
1139 | * The port is operating in host queuing mode (EDMA). | 1139 | * enabled, allow multiple NCQ commands. EDMA also allows |
1140 | * It can accomodate a new qc if the qc protocol | 1140 | * queueing multiple DMA commands but libata core currently |
1141 | * is compatible with the current host queue mode. | 1141 | * doesn't allow it. |
1142 | */ | 1142 | */ |
1143 | if (pp->pp_flags & MV_PP_FLAG_NCQ_EN) { | 1143 | if ((pp->pp_flags & MV_PP_FLAG_EDMA_EN) && |
1144 | /* | 1144 | (pp->pp_flags & MV_PP_FLAG_NCQ_EN) && ata_is_ncq(qc->tf.protocol)) |
1145 | * The host queue (EDMA) is in NCQ mode. | 1145 | return 0; |
1146 | * If the new qc is also an NCQ command, | 1146 | |
1147 | * then allow the new qc. | ||
1148 | */ | ||
1149 | if (qc->tf.protocol == ATA_PROT_NCQ) | ||
1150 | return 0; | ||
1151 | } else { | ||
1152 | /* | ||
1153 | * The host queue (EDMA) is in non-NCQ, DMA mode. | ||
1154 | * If the new qc is also a non-NCQ, DMA command, | ||
1155 | * then allow the new qc. | ||
1156 | */ | ||
1157 | if (qc->tf.protocol == ATA_PROT_DMA) | ||
1158 | return 0; | ||
1159 | } | ||
1160 | } | ||
1161 | return ATA_DEFER_PORT; | 1147 | return ATA_DEFER_PORT; |
1162 | } | 1148 | } |
1163 | 1149 | ||
@@ -3036,7 +3022,8 @@ static int mv_chip_id(struct ata_host *host, unsigned int board_idx) | |||
3036 | break; | 3022 | break; |
3037 | case chip_soc: | 3023 | case chip_soc: |
3038 | hpriv->ops = &mv_soc_ops; | 3024 | hpriv->ops = &mv_soc_ops; |
3039 | hp_flags |= MV_HP_FLAG_SOC | MV_HP_ERRATA_60X1C0; | 3025 | hp_flags |= MV_HP_FLAG_SOC | MV_HP_GEN_IIE | |
3026 | MV_HP_ERRATA_60X1C0; | ||
3040 | break; | 3027 | break; |
3041 | 3028 | ||
3042 | default: | 3029 | default: |
diff --git a/drivers/base/class.c b/drivers/base/class.c index 5667c2f02c51..cc5e28c8885c 100644 --- a/drivers/base/class.c +++ b/drivers/base/class.c | |||
@@ -295,6 +295,12 @@ int class_for_each_device(struct class *class, struct device *start, | |||
295 | 295 | ||
296 | if (!class) | 296 | if (!class) |
297 | return -EINVAL; | 297 | return -EINVAL; |
298 | if (!class->p) { | ||
299 | WARN(1, "%s called for class '%s' before it was initialized", | ||
300 | __func__, class->name); | ||
301 | return -EINVAL; | ||
302 | } | ||
303 | |||
298 | mutex_lock(&class->p->class_mutex); | 304 | mutex_lock(&class->p->class_mutex); |
299 | list_for_each_entry(dev, &class->p->class_devices, node) { | 305 | list_for_each_entry(dev, &class->p->class_devices, node) { |
300 | if (start) { | 306 | if (start) { |
@@ -344,6 +350,11 @@ struct device *class_find_device(struct class *class, struct device *start, | |||
344 | 350 | ||
345 | if (!class) | 351 | if (!class) |
346 | return NULL; | 352 | return NULL; |
353 | if (!class->p) { | ||
354 | WARN(1, "%s called for class '%s' before it was initialized", | ||
355 | __func__, class->name); | ||
356 | return NULL; | ||
357 | } | ||
347 | 358 | ||
348 | mutex_lock(&class->p->class_mutex); | 359 | mutex_lock(&class->p->class_mutex); |
349 | list_for_each_entry(dev, &class->p->class_devices, node) { | 360 | list_for_each_entry(dev, &class->p->class_devices, node) { |
diff --git a/drivers/base/core.c b/drivers/base/core.c index 068aa1c9538c..d021c98605b3 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c | |||
@@ -53,7 +53,7 @@ static inline int device_is_not_partition(struct device *dev) | |||
53 | * it is attached to. If it is not attached to a bus either, an empty | 53 | * it is attached to. If it is not attached to a bus either, an empty |
54 | * string will be returned. | 54 | * string will be returned. |
55 | */ | 55 | */ |
56 | const char *dev_driver_string(struct device *dev) | 56 | const char *dev_driver_string(const struct device *dev) |
57 | { | 57 | { |
58 | return dev->driver ? dev->driver->name : | 58 | return dev->driver ? dev->driver->name : |
59 | (dev->bus ? dev->bus->name : | 59 | (dev->bus ? dev->bus->name : |
@@ -541,6 +541,7 @@ void device_initialize(struct device *dev) | |||
541 | spin_lock_init(&dev->devres_lock); | 541 | spin_lock_init(&dev->devres_lock); |
542 | INIT_LIST_HEAD(&dev->devres_head); | 542 | INIT_LIST_HEAD(&dev->devres_head); |
543 | device_init_wakeup(dev, 0); | 543 | device_init_wakeup(dev, 0); |
544 | device_pm_init(dev); | ||
544 | set_dev_node(dev, -1); | 545 | set_dev_node(dev, -1); |
545 | } | 546 | } |
546 | 547 | ||
@@ -843,13 +844,19 @@ int device_add(struct device *dev) | |||
843 | { | 844 | { |
844 | struct device *parent = NULL; | 845 | struct device *parent = NULL; |
845 | struct class_interface *class_intf; | 846 | struct class_interface *class_intf; |
846 | int error; | 847 | int error = -EINVAL; |
847 | 848 | ||
848 | dev = get_device(dev); | 849 | dev = get_device(dev); |
849 | if (!dev || !strlen(dev->bus_id)) { | 850 | if (!dev) |
850 | error = -EINVAL; | 851 | goto done; |
851 | goto Done; | 852 | |
852 | } | 853 | /* Temporarily support init_name if it is set. |
854 | * It will override bus_id for now */ | ||
855 | if (dev->init_name) | ||
856 | dev_set_name(dev, "%s", dev->init_name); | ||
857 | |||
858 | if (!strlen(dev->bus_id)) | ||
859 | goto done; | ||
853 | 860 | ||
854 | pr_debug("device: '%s': %s\n", dev->bus_id, __func__); | 861 | pr_debug("device: '%s': %s\n", dev->bus_id, __func__); |
855 | 862 | ||
@@ -897,9 +904,10 @@ int device_add(struct device *dev) | |||
897 | error = bus_add_device(dev); | 904 | error = bus_add_device(dev); |
898 | if (error) | 905 | if (error) |
899 | goto BusError; | 906 | goto BusError; |
900 | error = device_pm_add(dev); | 907 | error = dpm_sysfs_add(dev); |
901 | if (error) | 908 | if (error) |
902 | goto PMError; | 909 | goto DPMError; |
910 | device_pm_add(dev); | ||
903 | kobject_uevent(&dev->kobj, KOBJ_ADD); | 911 | kobject_uevent(&dev->kobj, KOBJ_ADD); |
904 | bus_attach_device(dev); | 912 | bus_attach_device(dev); |
905 | if (parent) | 913 | if (parent) |
@@ -917,10 +925,10 @@ int device_add(struct device *dev) | |||
917 | class_intf->add_dev(dev, class_intf); | 925 | class_intf->add_dev(dev, class_intf); |
918 | mutex_unlock(&dev->class->p->class_mutex); | 926 | mutex_unlock(&dev->class->p->class_mutex); |
919 | } | 927 | } |
920 | Done: | 928 | done: |
921 | put_device(dev); | 929 | put_device(dev); |
922 | return error; | 930 | return error; |
923 | PMError: | 931 | DPMError: |
924 | bus_remove_device(dev); | 932 | bus_remove_device(dev); |
925 | BusError: | 933 | BusError: |
926 | if (dev->bus) | 934 | if (dev->bus) |
@@ -944,7 +952,7 @@ int device_add(struct device *dev) | |||
944 | cleanup_device_parent(dev); | 952 | cleanup_device_parent(dev); |
945 | if (parent) | 953 | if (parent) |
946 | put_device(parent); | 954 | put_device(parent); |
947 | goto Done; | 955 | goto done; |
948 | } | 956 | } |
949 | 957 | ||
950 | /** | 958 | /** |
@@ -1007,6 +1015,7 @@ void device_del(struct device *dev) | |||
1007 | struct class_interface *class_intf; | 1015 | struct class_interface *class_intf; |
1008 | 1016 | ||
1009 | device_pm_remove(dev); | 1017 | device_pm_remove(dev); |
1018 | dpm_sysfs_remove(dev); | ||
1010 | if (parent) | 1019 | if (parent) |
1011 | klist_del(&dev->knode_parent); | 1020 | klist_del(&dev->knode_parent); |
1012 | if (MAJOR(dev->devt)) { | 1021 | if (MAJOR(dev->devt)) { |
diff --git a/drivers/base/driver.c b/drivers/base/driver.c index 2ef5acf4368b..1e2bda780e48 100644 --- a/drivers/base/driver.c +++ b/drivers/base/driver.c | |||
@@ -16,9 +16,6 @@ | |||
16 | #include <linux/string.h> | 16 | #include <linux/string.h> |
17 | #include "base.h" | 17 | #include "base.h" |
18 | 18 | ||
19 | #define to_dev(node) container_of(node, struct device, driver_list) | ||
20 | |||
21 | |||
22 | static struct device *next_device(struct klist_iter *i) | 19 | static struct device *next_device(struct klist_iter *i) |
23 | { | 20 | { |
24 | struct klist_node *n = klist_next(i); | 21 | struct klist_node *n = klist_next(i); |
diff --git a/drivers/base/power/main.c b/drivers/base/power/main.c index 3250c5257b74..273a944d4040 100644 --- a/drivers/base/power/main.c +++ b/drivers/base/power/main.c | |||
@@ -67,20 +67,16 @@ void device_pm_unlock(void) | |||
67 | * device_pm_add - add a device to the list of active devices | 67 | * device_pm_add - add a device to the list of active devices |
68 | * @dev: Device to be added to the list | 68 | * @dev: Device to be added to the list |
69 | */ | 69 | */ |
70 | int device_pm_add(struct device *dev) | 70 | void device_pm_add(struct device *dev) |
71 | { | 71 | { |
72 | int error; | ||
73 | |||
74 | pr_debug("PM: Adding info for %s:%s\n", | 72 | pr_debug("PM: Adding info for %s:%s\n", |
75 | dev->bus ? dev->bus->name : "No Bus", | 73 | dev->bus ? dev->bus->name : "No Bus", |
76 | kobject_name(&dev->kobj)); | 74 | kobject_name(&dev->kobj)); |
77 | mutex_lock(&dpm_list_mtx); | 75 | mutex_lock(&dpm_list_mtx); |
78 | if (dev->parent) { | 76 | if (dev->parent) { |
79 | if (dev->parent->power.status >= DPM_SUSPENDING) { | 77 | if (dev->parent->power.status >= DPM_SUSPENDING) |
80 | dev_warn(dev, "parent %s is sleeping, will not add\n", | 78 | dev_warn(dev, "parent %s should not be sleeping\n", |
81 | dev->parent->bus_id); | 79 | dev->parent->bus_id); |
82 | WARN_ON(true); | ||
83 | } | ||
84 | } else if (transition_started) { | 80 | } else if (transition_started) { |
85 | /* | 81 | /* |
86 | * We refuse to register parentless devices while a PM | 82 | * We refuse to register parentless devices while a PM |
@@ -89,13 +85,9 @@ int device_pm_add(struct device *dev) | |||
89 | */ | 85 | */ |
90 | WARN_ON(true); | 86 | WARN_ON(true); |
91 | } | 87 | } |
92 | error = dpm_sysfs_add(dev); | 88 | |
93 | if (!error) { | 89 | list_add_tail(&dev->power.entry, &dpm_list); |
94 | dev->power.status = DPM_ON; | ||
95 | list_add_tail(&dev->power.entry, &dpm_list); | ||
96 | } | ||
97 | mutex_unlock(&dpm_list_mtx); | 90 | mutex_unlock(&dpm_list_mtx); |
98 | return error; | ||
99 | } | 91 | } |
100 | 92 | ||
101 | /** | 93 | /** |
@@ -110,7 +102,6 @@ void device_pm_remove(struct device *dev) | |||
110 | dev->bus ? dev->bus->name : "No Bus", | 102 | dev->bus ? dev->bus->name : "No Bus", |
111 | kobject_name(&dev->kobj)); | 103 | kobject_name(&dev->kobj)); |
112 | mutex_lock(&dpm_list_mtx); | 104 | mutex_lock(&dpm_list_mtx); |
113 | dpm_sysfs_remove(dev); | ||
114 | list_del_init(&dev->power.entry); | 105 | list_del_init(&dev->power.entry); |
115 | mutex_unlock(&dpm_list_mtx); | 106 | mutex_unlock(&dpm_list_mtx); |
116 | } | 107 | } |
diff --git a/drivers/base/power/power.h b/drivers/base/power/power.h index a3252c0e2887..41f51fae042f 100644 --- a/drivers/base/power/power.h +++ b/drivers/base/power/power.h | |||
@@ -1,3 +1,8 @@ | |||
1 | static inline void device_pm_init(struct device *dev) | ||
2 | { | ||
3 | dev->power.status = DPM_ON; | ||
4 | } | ||
5 | |||
1 | #ifdef CONFIG_PM_SLEEP | 6 | #ifdef CONFIG_PM_SLEEP |
2 | 7 | ||
3 | /* | 8 | /* |
@@ -11,12 +16,12 @@ static inline struct device *to_device(struct list_head *entry) | |||
11 | return container_of(entry, struct device, power.entry); | 16 | return container_of(entry, struct device, power.entry); |
12 | } | 17 | } |
13 | 18 | ||
14 | extern int device_pm_add(struct device *); | 19 | extern void device_pm_add(struct device *); |
15 | extern void device_pm_remove(struct device *); | 20 | extern void device_pm_remove(struct device *); |
16 | 21 | ||
17 | #else /* CONFIG_PM_SLEEP */ | 22 | #else /* CONFIG_PM_SLEEP */ |
18 | 23 | ||
19 | static inline int device_pm_add(struct device *dev) { return 0; } | 24 | static inline void device_pm_add(struct device *dev) {} |
20 | static inline void device_pm_remove(struct device *dev) {} | 25 | static inline void device_pm_remove(struct device *dev) {} |
21 | 26 | ||
22 | #endif | 27 | #endif |
diff --git a/drivers/infiniband/hw/ipath/ipath_iba7220.c b/drivers/infiniband/hw/ipath/ipath_iba7220.c index d90f5e9a54fa..9839e20119bc 100644 --- a/drivers/infiniband/hw/ipath/ipath_iba7220.c +++ b/drivers/infiniband/hw/ipath/ipath_iba7220.c | |||
@@ -1720,7 +1720,7 @@ static void ipath_7220_put_tid(struct ipath_devdata *dd, u64 __iomem *tidptr, | |||
1720 | "not 2KB aligned!\n", pa); | 1720 | "not 2KB aligned!\n", pa); |
1721 | return; | 1721 | return; |
1722 | } | 1722 | } |
1723 | if (pa >= (1UL << IBA7220_TID_SZ_SHIFT)) { | 1723 | if (chippa >= (1UL << IBA7220_TID_SZ_SHIFT)) { |
1724 | ipath_dev_err(dd, | 1724 | ipath_dev_err(dd, |
1725 | "BUG: Physical page address 0x%lx " | 1725 | "BUG: Physical page address 0x%lx " |
1726 | "larger than supported\n", pa); | 1726 | "larger than supported\n", pa); |
diff --git a/drivers/infiniband/hw/ipath/ipath_ud.c b/drivers/infiniband/hw/ipath/ipath_ud.c index 36aa242c487c..729446f56aab 100644 --- a/drivers/infiniband/hw/ipath/ipath_ud.c +++ b/drivers/infiniband/hw/ipath/ipath_ud.c | |||
@@ -267,6 +267,7 @@ int ipath_make_ud_req(struct ipath_qp *qp) | |||
267 | u16 lrh0; | 267 | u16 lrh0; |
268 | u16 lid; | 268 | u16 lid; |
269 | int ret = 0; | 269 | int ret = 0; |
270 | int next_cur; | ||
270 | 271 | ||
271 | spin_lock_irqsave(&qp->s_lock, flags); | 272 | spin_lock_irqsave(&qp->s_lock, flags); |
272 | 273 | ||
@@ -290,8 +291,9 @@ int ipath_make_ud_req(struct ipath_qp *qp) | |||
290 | goto bail; | 291 | goto bail; |
291 | 292 | ||
292 | wqe = get_swqe_ptr(qp, qp->s_cur); | 293 | wqe = get_swqe_ptr(qp, qp->s_cur); |
293 | if (++qp->s_cur >= qp->s_size) | 294 | next_cur = qp->s_cur + 1; |
294 | qp->s_cur = 0; | 295 | if (next_cur >= qp->s_size) |
296 | next_cur = 0; | ||
295 | 297 | ||
296 | /* Construct the header. */ | 298 | /* Construct the header. */ |
297 | ah_attr = &to_iah(wqe->wr.wr.ud.ah)->attr; | 299 | ah_attr = &to_iah(wqe->wr.wr.ud.ah)->attr; |
@@ -315,6 +317,7 @@ int ipath_make_ud_req(struct ipath_qp *qp) | |||
315 | qp->s_flags |= IPATH_S_WAIT_DMA; | 317 | qp->s_flags |= IPATH_S_WAIT_DMA; |
316 | goto bail; | 318 | goto bail; |
317 | } | 319 | } |
320 | qp->s_cur = next_cur; | ||
318 | spin_unlock_irqrestore(&qp->s_lock, flags); | 321 | spin_unlock_irqrestore(&qp->s_lock, flags); |
319 | ipath_ud_loopback(qp, wqe); | 322 | ipath_ud_loopback(qp, wqe); |
320 | spin_lock_irqsave(&qp->s_lock, flags); | 323 | spin_lock_irqsave(&qp->s_lock, flags); |
@@ -323,6 +326,7 @@ int ipath_make_ud_req(struct ipath_qp *qp) | |||
323 | } | 326 | } |
324 | } | 327 | } |
325 | 328 | ||
329 | qp->s_cur = next_cur; | ||
326 | extra_bytes = -wqe->length & 3; | 330 | extra_bytes = -wqe->length & 3; |
327 | nwords = (wqe->length + extra_bytes) >> 2; | 331 | nwords = (wqe->length + extra_bytes) >> 2; |
328 | 332 | ||
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c index f51201b17bfd..7e9e218738fa 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c | |||
@@ -156,14 +156,8 @@ static int ipoib_stop(struct net_device *dev) | |||
156 | 156 | ||
157 | netif_stop_queue(dev); | 157 | netif_stop_queue(dev); |
158 | 158 | ||
159 | /* | 159 | ipoib_ib_dev_down(dev, 0); |
160 | * Now flush workqueue to make sure a scheduled task doesn't | 160 | ipoib_ib_dev_stop(dev, 0); |
161 | * bring our internal state back up. | ||
162 | */ | ||
163 | flush_workqueue(ipoib_workqueue); | ||
164 | |||
165 | ipoib_ib_dev_down(dev, 1); | ||
166 | ipoib_ib_dev_stop(dev, 1); | ||
167 | 161 | ||
168 | if (!test_bit(IPOIB_FLAG_SUBINTERFACE, &priv->flags)) { | 162 | if (!test_bit(IPOIB_FLAG_SUBINTERFACE, &priv->flags)) { |
169 | struct ipoib_dev_priv *cpriv; | 163 | struct ipoib_dev_priv *cpriv; |
@@ -1314,7 +1308,7 @@ sysfs_failed: | |||
1314 | 1308 | ||
1315 | register_failed: | 1309 | register_failed: |
1316 | ib_unregister_event_handler(&priv->event_handler); | 1310 | ib_unregister_event_handler(&priv->event_handler); |
1317 | flush_scheduled_work(); | 1311 | flush_workqueue(ipoib_workqueue); |
1318 | 1312 | ||
1319 | event_failed: | 1313 | event_failed: |
1320 | ipoib_dev_cleanup(priv->dev); | 1314 | ipoib_dev_cleanup(priv->dev); |
@@ -1373,7 +1367,12 @@ static void ipoib_remove_one(struct ib_device *device) | |||
1373 | 1367 | ||
1374 | list_for_each_entry_safe(priv, tmp, dev_list, list) { | 1368 | list_for_each_entry_safe(priv, tmp, dev_list, list) { |
1375 | ib_unregister_event_handler(&priv->event_handler); | 1369 | ib_unregister_event_handler(&priv->event_handler); |
1376 | flush_scheduled_work(); | 1370 | |
1371 | rtnl_lock(); | ||
1372 | dev_change_flags(priv->dev, priv->dev->flags & ~IFF_UP); | ||
1373 | rtnl_unlock(); | ||
1374 | |||
1375 | flush_workqueue(ipoib_workqueue); | ||
1377 | 1376 | ||
1378 | unregister_netdev(priv->dev); | 1377 | unregister_netdev(priv->dev); |
1379 | ipoib_dev_cleanup(priv->dev); | 1378 | ipoib_dev_cleanup(priv->dev); |
diff --git a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c index 8950e9546f4e..ac33c8f3ea85 100644 --- a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c +++ b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c | |||
@@ -392,8 +392,16 @@ static int ipoib_mcast_join_complete(int status, | |||
392 | &priv->mcast_task, 0); | 392 | &priv->mcast_task, 0); |
393 | mutex_unlock(&mcast_mutex); | 393 | mutex_unlock(&mcast_mutex); |
394 | 394 | ||
395 | if (mcast == priv->broadcast) | 395 | if (mcast == priv->broadcast) { |
396 | /* | ||
397 | * Take RTNL lock here to avoid racing with | ||
398 | * ipoib_stop() and turning the carrier back | ||
399 | * on while a device is being removed. | ||
400 | */ | ||
401 | rtnl_lock(); | ||
396 | netif_carrier_on(dev); | 402 | netif_carrier_on(dev); |
403 | rtnl_unlock(); | ||
404 | } | ||
397 | 405 | ||
398 | return 0; | 406 | return 0; |
399 | } | 407 | } |
diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c index 1b6c52ef7339..acb78017e7d0 100644 --- a/drivers/s390/block/dasd.c +++ b/drivers/s390/block/dasd.c | |||
@@ -2333,13 +2333,11 @@ int dasd_generic_notify(struct ccw_device *cdev, int event) | |||
2333 | { | 2333 | { |
2334 | struct dasd_device *device; | 2334 | struct dasd_device *device; |
2335 | struct dasd_ccw_req *cqr; | 2335 | struct dasd_ccw_req *cqr; |
2336 | unsigned long flags; | ||
2337 | int ret; | 2336 | int ret; |
2338 | 2337 | ||
2339 | device = dasd_device_from_cdev(cdev); | 2338 | device = dasd_device_from_cdev_locked(cdev); |
2340 | if (IS_ERR(device)) | 2339 | if (IS_ERR(device)) |
2341 | return 0; | 2340 | return 0; |
2342 | spin_lock_irqsave(get_ccwdev_lock(cdev), flags); | ||
2343 | ret = 0; | 2341 | ret = 0; |
2344 | switch (event) { | 2342 | switch (event) { |
2345 | case CIO_GONE: | 2343 | case CIO_GONE: |
@@ -2369,7 +2367,6 @@ int dasd_generic_notify(struct ccw_device *cdev, int event) | |||
2369 | ret = 1; | 2367 | ret = 1; |
2370 | break; | 2368 | break; |
2371 | } | 2369 | } |
2372 | spin_unlock_irqrestore(get_ccwdev_lock(cdev), flags); | ||
2373 | dasd_put_device(device); | 2370 | dasd_put_device(device); |
2374 | return ret; | 2371 | return ret; |
2375 | } | 2372 | } |
diff --git a/drivers/s390/block/dasd_eckd.h b/drivers/s390/block/dasd_eckd.h index 4bf0aa5112c1..2476f87d21d0 100644 --- a/drivers/s390/block/dasd_eckd.h +++ b/drivers/s390/block/dasd_eckd.h | |||
@@ -308,7 +308,7 @@ struct dasd_psf_prssd_data { | |||
308 | unsigned char flags; | 308 | unsigned char flags; |
309 | unsigned char reserved[4]; | 309 | unsigned char reserved[4]; |
310 | unsigned char suborder; | 310 | unsigned char suborder; |
311 | unsigned char varies[9]; | 311 | unsigned char varies[5]; |
312 | } __attribute__ ((packed)); | 312 | } __attribute__ ((packed)); |
313 | 313 | ||
314 | /* | 314 | /* |
diff --git a/drivers/s390/block/dasd_eer.c b/drivers/s390/block/dasd_eer.c index 29da4413ad43..bf512ac75b9e 100644 --- a/drivers/s390/block/dasd_eer.c +++ b/drivers/s390/block/dasd_eer.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/poll.h> | 16 | #include <linux/poll.h> |
17 | #include <linux/mutex.h> | 17 | #include <linux/mutex.h> |
18 | #include <linux/smp_lock.h> | 18 | #include <linux/smp_lock.h> |
19 | #include <linux/err.h> | ||
19 | 20 | ||
20 | #include <asm/uaccess.h> | 21 | #include <asm/uaccess.h> |
21 | #include <asm/atomic.h> | 22 | #include <asm/atomic.h> |
@@ -457,7 +458,7 @@ int dasd_eer_enable(struct dasd_device *device) | |||
457 | 458 | ||
458 | cqr = dasd_kmalloc_request("ECKD", 1 /* SNSS */, | 459 | cqr = dasd_kmalloc_request("ECKD", 1 /* SNSS */, |
459 | SNSS_DATA_SIZE, device); | 460 | SNSS_DATA_SIZE, device); |
460 | if (!cqr) | 461 | if (IS_ERR(cqr)) |
461 | return -ENOMEM; | 462 | return -ENOMEM; |
462 | 463 | ||
463 | cqr->startdev = device; | 464 | cqr->startdev = device; |
diff --git a/drivers/s390/block/dcssblk.c b/drivers/s390/block/dcssblk.c index 01fcdd91b846..db85f1fb131e 100644 --- a/drivers/s390/block/dcssblk.c +++ b/drivers/s390/block/dcssblk.c | |||
@@ -384,6 +384,10 @@ dcssblk_add_store(struct device *dev, struct device_attribute *attr, const char | |||
384 | * get minor, add to list | 384 | * get minor, add to list |
385 | */ | 385 | */ |
386 | down_write(&dcssblk_devices_sem); | 386 | down_write(&dcssblk_devices_sem); |
387 | if (dcssblk_get_segment_by_name(local_buf)) { | ||
388 | rc = -EEXIST; | ||
389 | goto release_gd; | ||
390 | } | ||
387 | rc = dcssblk_assign_free_minor(dev_info); | 391 | rc = dcssblk_assign_free_minor(dev_info); |
388 | if (rc) { | 392 | if (rc) { |
389 | up_write(&dcssblk_devices_sem); | 393 | up_write(&dcssblk_devices_sem); |
diff --git a/drivers/s390/char/tape_char.c b/drivers/s390/char/tape_char.c index 687720b552d1..be0ce2215c8d 100644 --- a/drivers/s390/char/tape_char.c +++ b/drivers/s390/char/tape_char.c | |||
@@ -109,7 +109,7 @@ tapechar_check_idalbuffer(struct tape_device *device, size_t block_size) | |||
109 | 109 | ||
110 | /* The current idal buffer is not correct. Allocate a new one. */ | 110 | /* The current idal buffer is not correct. Allocate a new one. */ |
111 | new = idal_buffer_alloc(block_size, 0); | 111 | new = idal_buffer_alloc(block_size, 0); |
112 | if (new == NULL) | 112 | if (IS_ERR(new)) |
113 | return -ENOMEM; | 113 | return -ENOMEM; |
114 | 114 | ||
115 | if (device->char_data.idal_buf != NULL) | 115 | if (device->char_data.idal_buf != NULL) |
diff --git a/drivers/s390/char/tape_std.c b/drivers/s390/char/tape_std.c index 2a1af4e60be0..cc8fd781ee22 100644 --- a/drivers/s390/char/tape_std.c +++ b/drivers/s390/char/tape_std.c | |||
@@ -248,7 +248,7 @@ tape_std_mtsetblk(struct tape_device *device, int count) | |||
248 | 248 | ||
249 | /* Allocate a new idal buffer. */ | 249 | /* Allocate a new idal buffer. */ |
250 | new = idal_buffer_alloc(count, 0); | 250 | new = idal_buffer_alloc(count, 0); |
251 | if (new == NULL) | 251 | if (IS_ERR(new)) |
252 | return -ENOMEM; | 252 | return -ENOMEM; |
253 | if (device->char_data.idal_buf != NULL) | 253 | if (device->char_data.idal_buf != NULL) |
254 | idal_buffer_free(device->char_data.idal_buf); | 254 | idal_buffer_free(device->char_data.idal_buf); |
diff --git a/drivers/s390/cio/ccwgroup.c b/drivers/s390/cio/ccwgroup.c index 26a930e832bd..e0ce65fca4e7 100644 --- a/drivers/s390/cio/ccwgroup.c +++ b/drivers/s390/cio/ccwgroup.c | |||
@@ -112,8 +112,10 @@ ccwgroup_release (struct device *dev) | |||
112 | gdev = to_ccwgroupdev(dev); | 112 | gdev = to_ccwgroupdev(dev); |
113 | 113 | ||
114 | for (i = 0; i < gdev->count; i++) { | 114 | for (i = 0; i < gdev->count; i++) { |
115 | dev_set_drvdata(&gdev->cdev[i]->dev, NULL); | 115 | if (gdev->cdev[i]) { |
116 | put_device(&gdev->cdev[i]->dev); | 116 | dev_set_drvdata(&gdev->cdev[i]->dev, NULL); |
117 | put_device(&gdev->cdev[i]->dev); | ||
118 | } | ||
117 | } | 119 | } |
118 | kfree(gdev); | 120 | kfree(gdev); |
119 | } | 121 | } |
@@ -221,6 +223,13 @@ int ccwgroup_create_from_string(struct device *root, unsigned int creator_id, | |||
221 | atomic_set(&gdev->onoff, 0); | 223 | atomic_set(&gdev->onoff, 0); |
222 | mutex_init(&gdev->reg_mutex); | 224 | mutex_init(&gdev->reg_mutex); |
223 | mutex_lock(&gdev->reg_mutex); | 225 | mutex_lock(&gdev->reg_mutex); |
226 | gdev->creator_id = creator_id; | ||
227 | gdev->count = num_devices; | ||
228 | gdev->dev.bus = &ccwgroup_bus_type; | ||
229 | gdev->dev.parent = root; | ||
230 | gdev->dev.release = ccwgroup_release; | ||
231 | device_initialize(&gdev->dev); | ||
232 | |||
224 | curr_buf = buf; | 233 | curr_buf = buf; |
225 | for (i = 0; i < num_devices && curr_buf; i++) { | 234 | for (i = 0; i < num_devices && curr_buf; i++) { |
226 | rc = __get_next_bus_id(&curr_buf, tmp_bus_id); | 235 | rc = __get_next_bus_id(&curr_buf, tmp_bus_id); |
@@ -258,16 +267,11 @@ int ccwgroup_create_from_string(struct device *root, unsigned int creator_id, | |||
258 | rc = -EINVAL; | 267 | rc = -EINVAL; |
259 | goto error; | 268 | goto error; |
260 | } | 269 | } |
261 | gdev->creator_id = creator_id; | ||
262 | gdev->count = num_devices; | ||
263 | gdev->dev.bus = &ccwgroup_bus_type; | ||
264 | gdev->dev.parent = root; | ||
265 | gdev->dev.release = ccwgroup_release; | ||
266 | 270 | ||
267 | snprintf (gdev->dev.bus_id, BUS_ID_SIZE, "%s", | 271 | snprintf (gdev->dev.bus_id, BUS_ID_SIZE, "%s", |
268 | gdev->cdev[0]->dev.bus_id); | 272 | gdev->cdev[0]->dev.bus_id); |
269 | 273 | ||
270 | rc = device_register(&gdev->dev); | 274 | rc = device_add(&gdev->dev); |
271 | if (rc) | 275 | if (rc) |
272 | goto error; | 276 | goto error; |
273 | get_device(&gdev->dev); | 277 | get_device(&gdev->dev); |
diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c index 46c021d880dc..51489eff6b0b 100644 --- a/drivers/s390/cio/css.c +++ b/drivers/s390/cio/css.c | |||
@@ -477,7 +477,6 @@ void css_schedule_eval_all(void) | |||
477 | 477 | ||
478 | void css_wait_for_slow_path(void) | 478 | void css_wait_for_slow_path(void) |
479 | { | 479 | { |
480 | flush_workqueue(ccw_device_notify_work); | ||
481 | flush_workqueue(slow_path_wq); | 480 | flush_workqueue(slow_path_wq); |
482 | } | 481 | } |
483 | 482 | ||
diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c index e818d0c54c09..28221030b886 100644 --- a/drivers/s390/cio/device.c +++ b/drivers/s390/cio/device.c | |||
@@ -150,7 +150,6 @@ static struct css_driver io_subchannel_driver = { | |||
150 | }; | 150 | }; |
151 | 151 | ||
152 | struct workqueue_struct *ccw_device_work; | 152 | struct workqueue_struct *ccw_device_work; |
153 | struct workqueue_struct *ccw_device_notify_work; | ||
154 | wait_queue_head_t ccw_device_init_wq; | 153 | wait_queue_head_t ccw_device_init_wq; |
155 | atomic_t ccw_device_init_count; | 154 | atomic_t ccw_device_init_count; |
156 | 155 | ||
@@ -168,11 +167,6 @@ init_ccw_bus_type (void) | |||
168 | ccw_device_work = create_singlethread_workqueue("cio"); | 167 | ccw_device_work = create_singlethread_workqueue("cio"); |
169 | if (!ccw_device_work) | 168 | if (!ccw_device_work) |
170 | return -ENOMEM; /* FIXME: better errno ? */ | 169 | return -ENOMEM; /* FIXME: better errno ? */ |
171 | ccw_device_notify_work = create_singlethread_workqueue("cio_notify"); | ||
172 | if (!ccw_device_notify_work) { | ||
173 | ret = -ENOMEM; /* FIXME: better errno ? */ | ||
174 | goto out_err; | ||
175 | } | ||
176 | slow_path_wq = create_singlethread_workqueue("kslowcrw"); | 170 | slow_path_wq = create_singlethread_workqueue("kslowcrw"); |
177 | if (!slow_path_wq) { | 171 | if (!slow_path_wq) { |
178 | ret = -ENOMEM; /* FIXME: better errno ? */ | 172 | ret = -ENOMEM; /* FIXME: better errno ? */ |
@@ -192,8 +186,6 @@ init_ccw_bus_type (void) | |||
192 | out_err: | 186 | out_err: |
193 | if (ccw_device_work) | 187 | if (ccw_device_work) |
194 | destroy_workqueue(ccw_device_work); | 188 | destroy_workqueue(ccw_device_work); |
195 | if (ccw_device_notify_work) | ||
196 | destroy_workqueue(ccw_device_notify_work); | ||
197 | if (slow_path_wq) | 189 | if (slow_path_wq) |
198 | destroy_workqueue(slow_path_wq); | 190 | destroy_workqueue(slow_path_wq); |
199 | return ret; | 191 | return ret; |
@@ -204,7 +196,6 @@ cleanup_ccw_bus_type (void) | |||
204 | { | 196 | { |
205 | css_driver_unregister(&io_subchannel_driver); | 197 | css_driver_unregister(&io_subchannel_driver); |
206 | bus_unregister(&ccw_bus_type); | 198 | bus_unregister(&ccw_bus_type); |
207 | destroy_workqueue(ccw_device_notify_work); | ||
208 | destroy_workqueue(ccw_device_work); | 199 | destroy_workqueue(ccw_device_work); |
209 | } | 200 | } |
210 | 201 | ||
@@ -1496,11 +1487,22 @@ static void device_set_disconnected(struct ccw_device *cdev) | |||
1496 | ccw_device_schedule_recovery(); | 1487 | ccw_device_schedule_recovery(); |
1497 | } | 1488 | } |
1498 | 1489 | ||
1490 | void ccw_device_set_notoper(struct ccw_device *cdev) | ||
1491 | { | ||
1492 | struct subchannel *sch = to_subchannel(cdev->dev.parent); | ||
1493 | |||
1494 | CIO_TRACE_EVENT(2, "notoper"); | ||
1495 | CIO_TRACE_EVENT(2, sch->dev.bus_id); | ||
1496 | ccw_device_set_timeout(cdev, 0); | ||
1497 | cio_disable_subchannel(sch); | ||
1498 | cdev->private->state = DEV_STATE_NOT_OPER; | ||
1499 | } | ||
1500 | |||
1499 | static int io_subchannel_sch_event(struct subchannel *sch, int slow) | 1501 | static int io_subchannel_sch_event(struct subchannel *sch, int slow) |
1500 | { | 1502 | { |
1501 | int event, ret, disc; | 1503 | int event, ret, disc; |
1502 | unsigned long flags; | 1504 | unsigned long flags; |
1503 | enum { NONE, UNREGISTER, UNREGISTER_PROBE, REPROBE } action; | 1505 | enum { NONE, UNREGISTER, UNREGISTER_PROBE, REPROBE, DISC } action; |
1504 | struct ccw_device *cdev; | 1506 | struct ccw_device *cdev; |
1505 | 1507 | ||
1506 | spin_lock_irqsave(sch->lock, flags); | 1508 | spin_lock_irqsave(sch->lock, flags); |
@@ -1535,16 +1537,11 @@ static int io_subchannel_sch_event(struct subchannel *sch, int slow) | |||
1535 | } | 1537 | } |
1536 | /* fall through */ | 1538 | /* fall through */ |
1537 | case CIO_GONE: | 1539 | case CIO_GONE: |
1538 | /* Prevent unwanted effects when opening lock. */ | ||
1539 | cio_disable_subchannel(sch); | ||
1540 | device_set_disconnected(cdev); | ||
1541 | /* Ask driver what to do with device. */ | 1540 | /* Ask driver what to do with device. */ |
1542 | action = UNREGISTER; | 1541 | if (io_subchannel_notify(sch, event)) |
1543 | spin_unlock_irqrestore(sch->lock, flags); | 1542 | action = DISC; |
1544 | ret = io_subchannel_notify(sch, event); | 1543 | else |
1545 | spin_lock_irqsave(sch->lock, flags); | 1544 | action = UNREGISTER; |
1546 | if (ret) | ||
1547 | action = NONE; | ||
1548 | break; | 1545 | break; |
1549 | case CIO_REVALIDATE: | 1546 | case CIO_REVALIDATE: |
1550 | /* Device will be removed, so no notify necessary. */ | 1547 | /* Device will be removed, so no notify necessary. */ |
@@ -1565,6 +1562,7 @@ static int io_subchannel_sch_event(struct subchannel *sch, int slow) | |||
1565 | switch (action) { | 1562 | switch (action) { |
1566 | case UNREGISTER: | 1563 | case UNREGISTER: |
1567 | case UNREGISTER_PROBE: | 1564 | case UNREGISTER_PROBE: |
1565 | ccw_device_set_notoper(cdev); | ||
1568 | /* Unregister device (will use subchannel lock). */ | 1566 | /* Unregister device (will use subchannel lock). */ |
1569 | spin_unlock_irqrestore(sch->lock, flags); | 1567 | spin_unlock_irqrestore(sch->lock, flags); |
1570 | css_sch_device_unregister(sch); | 1568 | css_sch_device_unregister(sch); |
@@ -1577,6 +1575,9 @@ static int io_subchannel_sch_event(struct subchannel *sch, int slow) | |||
1577 | case REPROBE: | 1575 | case REPROBE: |
1578 | ccw_device_trigger_reprobe(cdev); | 1576 | ccw_device_trigger_reprobe(cdev); |
1579 | break; | 1577 | break; |
1578 | case DISC: | ||
1579 | device_set_disconnected(cdev); | ||
1580 | break; | ||
1580 | default: | 1581 | default: |
1581 | break; | 1582 | break; |
1582 | } | 1583 | } |
@@ -1828,5 +1829,4 @@ EXPORT_SYMBOL(ccw_driver_unregister); | |||
1828 | EXPORT_SYMBOL(get_ccwdev_by_busid); | 1829 | EXPORT_SYMBOL(get_ccwdev_by_busid); |
1829 | EXPORT_SYMBOL(ccw_bus_type); | 1830 | EXPORT_SYMBOL(ccw_bus_type); |
1830 | EXPORT_SYMBOL(ccw_device_work); | 1831 | EXPORT_SYMBOL(ccw_device_work); |
1831 | EXPORT_SYMBOL(ccw_device_notify_work); | ||
1832 | EXPORT_SYMBOL_GPL(ccw_device_get_subchannel_id); | 1832 | EXPORT_SYMBOL_GPL(ccw_device_get_subchannel_id); |
diff --git a/drivers/s390/cio/device.h b/drivers/s390/cio/device.h index 9800a8335a3f..6f5c3f2b3587 100644 --- a/drivers/s390/cio/device.h +++ b/drivers/s390/cio/device.h | |||
@@ -72,7 +72,6 @@ dev_fsm_final_state(struct ccw_device *cdev) | |||
72 | } | 72 | } |
73 | 73 | ||
74 | extern struct workqueue_struct *ccw_device_work; | 74 | extern struct workqueue_struct *ccw_device_work; |
75 | extern struct workqueue_struct *ccw_device_notify_work; | ||
76 | extern wait_queue_head_t ccw_device_init_wq; | 75 | extern wait_queue_head_t ccw_device_init_wq; |
77 | extern atomic_t ccw_device_init_count; | 76 | extern atomic_t ccw_device_init_count; |
78 | 77 | ||
@@ -120,6 +119,7 @@ int ccw_device_stlck(struct ccw_device *); | |||
120 | void ccw_device_trigger_reprobe(struct ccw_device *); | 119 | void ccw_device_trigger_reprobe(struct ccw_device *); |
121 | void ccw_device_kill_io(struct ccw_device *); | 120 | void ccw_device_kill_io(struct ccw_device *); |
122 | int ccw_device_notify(struct ccw_device *, int); | 121 | int ccw_device_notify(struct ccw_device *, int); |
122 | void ccw_device_set_notoper(struct ccw_device *cdev); | ||
123 | 123 | ||
124 | /* qdio needs this. */ | 124 | /* qdio needs this. */ |
125 | void ccw_device_set_timeout(struct ccw_device *, int); | 125 | void ccw_device_set_timeout(struct ccw_device *, int); |
diff --git a/drivers/s390/cio/device_fsm.c b/drivers/s390/cio/device_fsm.c index 8b5fe57fb2f3..550508df952b 100644 --- a/drivers/s390/cio/device_fsm.c +++ b/drivers/s390/cio/device_fsm.c | |||
@@ -337,26 +337,34 @@ int ccw_device_notify(struct ccw_device *cdev, int event) | |||
337 | return 0; | 337 | return 0; |
338 | if (!cdev->online) | 338 | if (!cdev->online) |
339 | return 0; | 339 | return 0; |
340 | CIO_MSG_EVENT(2, "notify called for 0.%x.%04x, event=%d\n", | ||
341 | cdev->private->dev_id.ssid, cdev->private->dev_id.devno, | ||
342 | event); | ||
340 | return cdev->drv->notify ? cdev->drv->notify(cdev, event) : 0; | 343 | return cdev->drv->notify ? cdev->drv->notify(cdev, event) : 0; |
341 | } | 344 | } |
342 | 345 | ||
343 | static void | 346 | static void cmf_reenable_delayed(struct work_struct *work) |
344 | ccw_device_oper_notify(struct work_struct *work) | ||
345 | { | 347 | { |
346 | struct ccw_device_private *priv; | 348 | struct ccw_device_private *priv; |
347 | struct ccw_device *cdev; | 349 | struct ccw_device *cdev; |
348 | int ret; | ||
349 | 350 | ||
350 | priv = container_of(work, struct ccw_device_private, kick_work); | 351 | priv = container_of(work, struct ccw_device_private, kick_work); |
351 | cdev = priv->cdev; | 352 | cdev = priv->cdev; |
352 | ret = ccw_device_notify(cdev, CIO_OPER); | 353 | cmf_reenable(cdev); |
353 | if (ret) { | 354 | } |
355 | |||
356 | static void ccw_device_oper_notify(struct ccw_device *cdev) | ||
357 | { | ||
358 | if (ccw_device_notify(cdev, CIO_OPER)) { | ||
354 | /* Reenable channel measurements, if needed. */ | 359 | /* Reenable channel measurements, if needed. */ |
355 | cmf_reenable(cdev); | 360 | PREPARE_WORK(&cdev->private->kick_work, cmf_reenable_delayed); |
356 | wake_up(&cdev->private->wait_q); | 361 | queue_work(ccw_device_work, &cdev->private->kick_work); |
357 | } else | 362 | return; |
358 | /* Driver doesn't want device back. */ | 363 | } |
359 | ccw_device_do_unreg_rereg(work); | 364 | /* Driver doesn't want device back. */ |
365 | ccw_device_set_notoper(cdev); | ||
366 | PREPARE_WORK(&cdev->private->kick_work, ccw_device_do_unreg_rereg); | ||
367 | queue_work(ccw_device_work, &cdev->private->kick_work); | ||
360 | } | 368 | } |
361 | 369 | ||
362 | /* | 370 | /* |
@@ -386,8 +394,7 @@ ccw_device_done(struct ccw_device *cdev, int state) | |||
386 | 394 | ||
387 | if (cdev->private->flags.donotify) { | 395 | if (cdev->private->flags.donotify) { |
388 | cdev->private->flags.donotify = 0; | 396 | cdev->private->flags.donotify = 0; |
389 | PREPARE_WORK(&cdev->private->kick_work, ccw_device_oper_notify); | 397 | ccw_device_oper_notify(cdev); |
390 | queue_work(ccw_device_notify_work, &cdev->private->kick_work); | ||
391 | } | 398 | } |
392 | wake_up(&cdev->private->wait_q); | 399 | wake_up(&cdev->private->wait_q); |
393 | 400 | ||
diff --git a/drivers/s390/cio/qdio_debug.h b/drivers/s390/cio/qdio_debug.h index 8484b83698e1..5a4d85b829ad 100644 --- a/drivers/s390/cio/qdio_debug.h +++ b/drivers/s390/cio/qdio_debug.h | |||
@@ -61,18 +61,18 @@ | |||
61 | 61 | ||
62 | /* s390dbf views */ | 62 | /* s390dbf views */ |
63 | #define QDIO_DBF_SETUP_LEN 8 | 63 | #define QDIO_DBF_SETUP_LEN 8 |
64 | #define QDIO_DBF_SETUP_PAGES 4 | 64 | #define QDIO_DBF_SETUP_PAGES 8 |
65 | #define QDIO_DBF_SETUP_NR_AREAS 1 | 65 | #define QDIO_DBF_SETUP_NR_AREAS 1 |
66 | 66 | ||
67 | #define QDIO_DBF_TRACE_LEN 8 | 67 | #define QDIO_DBF_TRACE_LEN 8 |
68 | #define QDIO_DBF_TRACE_NR_AREAS 2 | 68 | #define QDIO_DBF_TRACE_NR_AREAS 2 |
69 | 69 | ||
70 | #ifdef CONFIG_QDIO_DEBUG | 70 | #ifdef CONFIG_QDIO_DEBUG |
71 | #define QDIO_DBF_TRACE_PAGES 16 | 71 | #define QDIO_DBF_TRACE_PAGES 32 |
72 | #define QDIO_DBF_SETUP_LEVEL 6 | 72 | #define QDIO_DBF_SETUP_LEVEL 6 |
73 | #define QDIO_DBF_TRACE_LEVEL 4 | 73 | #define QDIO_DBF_TRACE_LEVEL 4 |
74 | #else /* !CONFIG_QDIO_DEBUG */ | 74 | #else /* !CONFIG_QDIO_DEBUG */ |
75 | #define QDIO_DBF_TRACE_PAGES 4 | 75 | #define QDIO_DBF_TRACE_PAGES 8 |
76 | #define QDIO_DBF_SETUP_LEVEL 2 | 76 | #define QDIO_DBF_SETUP_LEVEL 2 |
77 | #define QDIO_DBF_TRACE_LEVEL 2 | 77 | #define QDIO_DBF_TRACE_LEVEL 2 |
78 | #endif /* CONFIG_QDIO_DEBUG */ | 78 | #endif /* CONFIG_QDIO_DEBUG */ |
diff --git a/drivers/s390/cio/qdio_main.c b/drivers/s390/cio/qdio_main.c index d15648514a0f..e6eabc853422 100644 --- a/drivers/s390/cio/qdio_main.c +++ b/drivers/s390/cio/qdio_main.c | |||
@@ -330,6 +330,7 @@ static int qdio_siga_output(struct qdio_q *q) | |||
330 | int cc; | 330 | int cc; |
331 | u32 busy_bit; | 331 | u32 busy_bit; |
332 | u64 start_time = 0; | 332 | u64 start_time = 0; |
333 | char dbf_text[15]; | ||
333 | 334 | ||
334 | QDIO_DBF_TEXT5(0, trace, "sigaout"); | 335 | QDIO_DBF_TEXT5(0, trace, "sigaout"); |
335 | QDIO_DBF_HEX5(0, trace, &q, sizeof(void *)); | 336 | QDIO_DBF_HEX5(0, trace, &q, sizeof(void *)); |
@@ -338,6 +339,9 @@ static int qdio_siga_output(struct qdio_q *q) | |||
338 | again: | 339 | again: |
339 | cc = qdio_do_siga_output(q, &busy_bit); | 340 | cc = qdio_do_siga_output(q, &busy_bit); |
340 | if (queue_type(q) == QDIO_IQDIO_QFMT && cc == 2 && busy_bit) { | 341 | if (queue_type(q) == QDIO_IQDIO_QFMT && cc == 2 && busy_bit) { |
342 | sprintf(dbf_text, "bb%4x%2x", q->irq_ptr->schid.sch_no, q->nr); | ||
343 | QDIO_DBF_TEXT3(0, trace, dbf_text); | ||
344 | |||
341 | if (!start_time) | 345 | if (!start_time) |
342 | start_time = get_usecs(); | 346 | start_time = get_usecs(); |
343 | else if ((get_usecs() - start_time) < QDIO_BUSY_BIT_PATIENCE) | 347 | else if ((get_usecs() - start_time) < QDIO_BUSY_BIT_PATIENCE) |
@@ -748,16 +752,18 @@ static void qdio_kick_outbound_q(struct qdio_q *q) | |||
748 | rc = qdio_siga_output(q); | 752 | rc = qdio_siga_output(q); |
749 | switch (rc) { | 753 | switch (rc) { |
750 | case 0: | 754 | case 0: |
751 | /* went smooth this time, reset timestamp */ | ||
752 | q->u.out.timestamp = 0; | ||
753 | |||
754 | /* TODO: improve error handling for CC=0 case */ | 755 | /* TODO: improve error handling for CC=0 case */ |
755 | #ifdef CONFIG_QDIO_DEBUG | 756 | #ifdef CONFIG_QDIO_DEBUG |
756 | QDIO_DBF_TEXT3(0, trace, "cc2reslv"); | 757 | if (q->u.out.timestamp) { |
757 | sprintf(dbf_text, "%4x%2x%2x", q->irq_ptr->schid.sch_no, q->nr, | 758 | QDIO_DBF_TEXT3(0, trace, "cc2reslv"); |
758 | atomic_read(&q->u.out.busy_siga_counter)); | 759 | sprintf(dbf_text, "%4x%2x%2x", q->irq_ptr->schid.sch_no, |
759 | QDIO_DBF_TEXT3(0, trace, dbf_text); | 760 | q->nr, |
761 | atomic_read(&q->u.out.busy_siga_counter)); | ||
762 | QDIO_DBF_TEXT3(0, trace, dbf_text); | ||
763 | } | ||
760 | #endif /* CONFIG_QDIO_DEBUG */ | 764 | #endif /* CONFIG_QDIO_DEBUG */ |
765 | /* went smooth this time, reset timestamp */ | ||
766 | q->u.out.timestamp = 0; | ||
761 | break; | 767 | break; |
762 | /* cc=2 and busy bit */ | 768 | /* cc=2 and busy bit */ |
763 | case (2 | QDIO_ERROR_SIGA_BUSY): | 769 | case (2 | QDIO_ERROR_SIGA_BUSY): |
@@ -1066,14 +1072,12 @@ void qdio_int_handler(struct ccw_device *cdev, unsigned long intparm, | |||
1066 | if (IS_ERR(irb)) { | 1072 | if (IS_ERR(irb)) { |
1067 | switch (PTR_ERR(irb)) { | 1073 | switch (PTR_ERR(irb)) { |
1068 | case -EIO: | 1074 | case -EIO: |
1069 | sprintf(dbf_text, "ierr%4x", | 1075 | sprintf(dbf_text, "ierr%4x", irq_ptr->schid.sch_no); |
1070 | cdev->private->schid.sch_no); | ||
1071 | QDIO_DBF_TEXT2(1, setup, dbf_text); | 1076 | QDIO_DBF_TEXT2(1, setup, dbf_text); |
1072 | qdio_int_error(cdev); | 1077 | qdio_int_error(cdev); |
1073 | return; | 1078 | return; |
1074 | case -ETIMEDOUT: | 1079 | case -ETIMEDOUT: |
1075 | sprintf(dbf_text, "qtoh%4x", | 1080 | sprintf(dbf_text, "qtoh%4x", irq_ptr->schid.sch_no); |
1076 | cdev->private->schid.sch_no); | ||
1077 | QDIO_DBF_TEXT2(1, setup, dbf_text); | 1081 | QDIO_DBF_TEXT2(1, setup, dbf_text); |
1078 | qdio_int_error(cdev); | 1082 | qdio_int_error(cdev); |
1079 | return; | 1083 | return; |
@@ -1124,8 +1128,10 @@ void qdio_int_handler(struct ccw_device *cdev, unsigned long intparm, | |||
1124 | struct qdio_ssqd_desc *qdio_get_ssqd_desc(struct ccw_device *cdev) | 1128 | struct qdio_ssqd_desc *qdio_get_ssqd_desc(struct ccw_device *cdev) |
1125 | { | 1129 | { |
1126 | struct qdio_irq *irq_ptr; | 1130 | struct qdio_irq *irq_ptr; |
1131 | char dbf_text[15]; | ||
1127 | 1132 | ||
1128 | QDIO_DBF_TEXT0(0, setup, "getssqd"); | 1133 | sprintf(dbf_text, "qssq%4x", cdev->private->schid.sch_no); |
1134 | QDIO_DBF_TEXT0(0, setup, dbf_text); | ||
1129 | 1135 | ||
1130 | irq_ptr = cdev->private->qdio_data; | 1136 | irq_ptr = cdev->private->qdio_data; |
1131 | if (!irq_ptr) | 1137 | if (!irq_ptr) |
@@ -1149,14 +1155,13 @@ int qdio_cleanup(struct ccw_device *cdev, int how) | |||
1149 | char dbf_text[15]; | 1155 | char dbf_text[15]; |
1150 | int rc; | 1156 | int rc; |
1151 | 1157 | ||
1158 | sprintf(dbf_text, "qcln%4x", cdev->private->schid.sch_no); | ||
1159 | QDIO_DBF_TEXT0(0, setup, dbf_text); | ||
1160 | |||
1152 | irq_ptr = cdev->private->qdio_data; | 1161 | irq_ptr = cdev->private->qdio_data; |
1153 | if (!irq_ptr) | 1162 | if (!irq_ptr) |
1154 | return -ENODEV; | 1163 | return -ENODEV; |
1155 | 1164 | ||
1156 | sprintf(dbf_text, "qcln%4x", irq_ptr->schid.sch_no); | ||
1157 | QDIO_DBF_TEXT1(0, trace, dbf_text); | ||
1158 | QDIO_DBF_TEXT0(0, setup, dbf_text); | ||
1159 | |||
1160 | rc = qdio_shutdown(cdev, how); | 1165 | rc = qdio_shutdown(cdev, how); |
1161 | if (rc == 0) | 1166 | if (rc == 0) |
1162 | rc = qdio_free(cdev); | 1167 | rc = qdio_free(cdev); |
@@ -1191,6 +1196,9 @@ int qdio_shutdown(struct ccw_device *cdev, int how) | |||
1191 | unsigned long flags; | 1196 | unsigned long flags; |
1192 | char dbf_text[15]; | 1197 | char dbf_text[15]; |
1193 | 1198 | ||
1199 | sprintf(dbf_text, "qshu%4x", cdev->private->schid.sch_no); | ||
1200 | QDIO_DBF_TEXT0(0, setup, dbf_text); | ||
1201 | |||
1194 | irq_ptr = cdev->private->qdio_data; | 1202 | irq_ptr = cdev->private->qdio_data; |
1195 | if (!irq_ptr) | 1203 | if (!irq_ptr) |
1196 | return -ENODEV; | 1204 | return -ENODEV; |
@@ -1205,10 +1213,6 @@ int qdio_shutdown(struct ccw_device *cdev, int how) | |||
1205 | return 0; | 1213 | return 0; |
1206 | } | 1214 | } |
1207 | 1215 | ||
1208 | sprintf(dbf_text, "qsqs%4x", irq_ptr->schid.sch_no); | ||
1209 | QDIO_DBF_TEXT1(0, trace, dbf_text); | ||
1210 | QDIO_DBF_TEXT0(0, setup, dbf_text); | ||
1211 | |||
1212 | tiqdio_remove_input_queues(irq_ptr); | 1216 | tiqdio_remove_input_queues(irq_ptr); |
1213 | qdio_shutdown_queues(cdev); | 1217 | qdio_shutdown_queues(cdev); |
1214 | qdio_shutdown_debug_entries(irq_ptr, cdev); | 1218 | qdio_shutdown_debug_entries(irq_ptr, cdev); |
@@ -1247,7 +1251,6 @@ no_cleanup: | |||
1247 | 1251 | ||
1248 | qdio_set_state(irq_ptr, QDIO_IRQ_STATE_INACTIVE); | 1252 | qdio_set_state(irq_ptr, QDIO_IRQ_STATE_INACTIVE); |
1249 | mutex_unlock(&irq_ptr->setup_mutex); | 1253 | mutex_unlock(&irq_ptr->setup_mutex); |
1250 | module_put(THIS_MODULE); | ||
1251 | if (rc) | 1254 | if (rc) |
1252 | return rc; | 1255 | return rc; |
1253 | return 0; | 1256 | return 0; |
@@ -1263,16 +1266,14 @@ int qdio_free(struct ccw_device *cdev) | |||
1263 | struct qdio_irq *irq_ptr; | 1266 | struct qdio_irq *irq_ptr; |
1264 | char dbf_text[15]; | 1267 | char dbf_text[15]; |
1265 | 1268 | ||
1269 | sprintf(dbf_text, "qfre%4x", cdev->private->schid.sch_no); | ||
1270 | QDIO_DBF_TEXT0(0, setup, dbf_text); | ||
1271 | |||
1266 | irq_ptr = cdev->private->qdio_data; | 1272 | irq_ptr = cdev->private->qdio_data; |
1267 | if (!irq_ptr) | 1273 | if (!irq_ptr) |
1268 | return -ENODEV; | 1274 | return -ENODEV; |
1269 | 1275 | ||
1270 | mutex_lock(&irq_ptr->setup_mutex); | 1276 | mutex_lock(&irq_ptr->setup_mutex); |
1271 | |||
1272 | sprintf(dbf_text, "qfqs%4x", irq_ptr->schid.sch_no); | ||
1273 | QDIO_DBF_TEXT1(0, trace, dbf_text); | ||
1274 | QDIO_DBF_TEXT0(0, setup, dbf_text); | ||
1275 | |||
1276 | cdev->private->qdio_data = NULL; | 1277 | cdev->private->qdio_data = NULL; |
1277 | mutex_unlock(&irq_ptr->setup_mutex); | 1278 | mutex_unlock(&irq_ptr->setup_mutex); |
1278 | 1279 | ||
@@ -1295,7 +1296,6 @@ int qdio_initialize(struct qdio_initialize *init_data) | |||
1295 | 1296 | ||
1296 | sprintf(dbf_text, "qini%4x", init_data->cdev->private->schid.sch_no); | 1297 | sprintf(dbf_text, "qini%4x", init_data->cdev->private->schid.sch_no); |
1297 | QDIO_DBF_TEXT0(0, setup, dbf_text); | 1298 | QDIO_DBF_TEXT0(0, setup, dbf_text); |
1298 | QDIO_DBF_TEXT0(0, trace, dbf_text); | ||
1299 | 1299 | ||
1300 | rc = qdio_allocate(init_data); | 1300 | rc = qdio_allocate(init_data); |
1301 | if (rc) | 1301 | if (rc) |
@@ -1319,7 +1319,6 @@ int qdio_allocate(struct qdio_initialize *init_data) | |||
1319 | 1319 | ||
1320 | sprintf(dbf_text, "qalc%4x", init_data->cdev->private->schid.sch_no); | 1320 | sprintf(dbf_text, "qalc%4x", init_data->cdev->private->schid.sch_no); |
1321 | QDIO_DBF_TEXT0(0, setup, dbf_text); | 1321 | QDIO_DBF_TEXT0(0, setup, dbf_text); |
1322 | QDIO_DBF_TEXT0(0, trace, dbf_text); | ||
1323 | 1322 | ||
1324 | if ((init_data->no_input_qs && !init_data->input_handler) || | 1323 | if ((init_data->no_input_qs && !init_data->input_handler) || |
1325 | (init_data->no_output_qs && !init_data->output_handler)) | 1324 | (init_data->no_output_qs && !init_data->output_handler)) |
@@ -1389,6 +1388,9 @@ int qdio_establish(struct qdio_initialize *init_data) | |||
1389 | unsigned long saveflags; | 1388 | unsigned long saveflags; |
1390 | int rc; | 1389 | int rc; |
1391 | 1390 | ||
1391 | sprintf(dbf_text, "qest%4x", cdev->private->schid.sch_no); | ||
1392 | QDIO_DBF_TEXT0(0, setup, dbf_text); | ||
1393 | |||
1392 | irq_ptr = cdev->private->qdio_data; | 1394 | irq_ptr = cdev->private->qdio_data; |
1393 | if (!irq_ptr) | 1395 | if (!irq_ptr) |
1394 | return -ENODEV; | 1396 | return -ENODEV; |
@@ -1396,13 +1398,6 @@ int qdio_establish(struct qdio_initialize *init_data) | |||
1396 | if (cdev->private->state != DEV_STATE_ONLINE) | 1398 | if (cdev->private->state != DEV_STATE_ONLINE) |
1397 | return -EINVAL; | 1399 | return -EINVAL; |
1398 | 1400 | ||
1399 | if (!try_module_get(THIS_MODULE)) | ||
1400 | return -EINVAL; | ||
1401 | |||
1402 | sprintf(dbf_text, "qest%4x", cdev->private->schid.sch_no); | ||
1403 | QDIO_DBF_TEXT0(0, setup, dbf_text); | ||
1404 | QDIO_DBF_TEXT0(0, trace, dbf_text); | ||
1405 | |||
1406 | mutex_lock(&irq_ptr->setup_mutex); | 1401 | mutex_lock(&irq_ptr->setup_mutex); |
1407 | qdio_setup_irq(init_data); | 1402 | qdio_setup_irq(init_data); |
1408 | 1403 | ||
@@ -1472,6 +1467,9 @@ int qdio_activate(struct ccw_device *cdev) | |||
1472 | unsigned long saveflags; | 1467 | unsigned long saveflags; |
1473 | char dbf_text[20]; | 1468 | char dbf_text[20]; |
1474 | 1469 | ||
1470 | sprintf(dbf_text, "qact%4x", cdev->private->schid.sch_no); | ||
1471 | QDIO_DBF_TEXT0(0, setup, dbf_text); | ||
1472 | |||
1475 | irq_ptr = cdev->private->qdio_data; | 1473 | irq_ptr = cdev->private->qdio_data; |
1476 | if (!irq_ptr) | 1474 | if (!irq_ptr) |
1477 | return -ENODEV; | 1475 | return -ENODEV; |
@@ -1485,10 +1483,6 @@ int qdio_activate(struct ccw_device *cdev) | |||
1485 | goto out; | 1483 | goto out; |
1486 | } | 1484 | } |
1487 | 1485 | ||
1488 | sprintf(dbf_text, "qact%4x", irq_ptr->schid.sch_no); | ||
1489 | QDIO_DBF_TEXT2(0, setup, dbf_text); | ||
1490 | QDIO_DBF_TEXT2(0, trace, dbf_text); | ||
1491 | |||
1492 | irq_ptr->ccw.cmd_code = irq_ptr->aqueue.cmd; | 1486 | irq_ptr->ccw.cmd_code = irq_ptr->aqueue.cmd; |
1493 | irq_ptr->ccw.flags = CCW_FLAG_SLI; | 1487 | irq_ptr->ccw.flags = CCW_FLAG_SLI; |
1494 | irq_ptr->ccw.count = irq_ptr->aqueue.count; | 1488 | irq_ptr->ccw.count = irq_ptr->aqueue.count; |
@@ -1663,7 +1657,7 @@ int do_QDIO(struct ccw_device *cdev, unsigned int callflags, | |||
1663 | #ifdef CONFIG_QDIO_DEBUG | 1657 | #ifdef CONFIG_QDIO_DEBUG |
1664 | char dbf_text[20]; | 1658 | char dbf_text[20]; |
1665 | 1659 | ||
1666 | sprintf(dbf_text, "doQD%04x", cdev->private->schid.sch_no); | 1660 | sprintf(dbf_text, "doQD%4x", cdev->private->schid.sch_no); |
1667 | QDIO_DBF_TEXT3(0, trace, dbf_text); | 1661 | QDIO_DBF_TEXT3(0, trace, dbf_text); |
1668 | #endif /* CONFIG_QDIO_DEBUG */ | 1662 | #endif /* CONFIG_QDIO_DEBUG */ |
1669 | 1663 | ||
diff --git a/drivers/s390/cio/qdio_setup.c b/drivers/s390/cio/qdio_setup.c index 1bd2a208db28..1679e2f91c94 100644 --- a/drivers/s390/cio/qdio_setup.c +++ b/drivers/s390/cio/qdio_setup.c | |||
@@ -165,7 +165,7 @@ static void setup_queues(struct qdio_irq *irq_ptr, | |||
165 | void **output_sbal_array = qdio_init->output_sbal_addr_array; | 165 | void **output_sbal_array = qdio_init->output_sbal_addr_array; |
166 | int i; | 166 | int i; |
167 | 167 | ||
168 | sprintf(dbf_text, "qfqs%4x", qdio_init->cdev->private->schid.sch_no); | 168 | sprintf(dbf_text, "qset%4x", qdio_init->cdev->private->schid.sch_no); |
169 | QDIO_DBF_TEXT0(0, setup, dbf_text); | 169 | QDIO_DBF_TEXT0(0, setup, dbf_text); |
170 | 170 | ||
171 | for_each_input_queue(irq_ptr, q, i) { | 171 | for_each_input_queue(irq_ptr, q, i) { |
@@ -285,7 +285,7 @@ void qdio_setup_ssqd_info(struct qdio_irq *irq_ptr) | |||
285 | rc = __get_ssqd_info(irq_ptr); | 285 | rc = __get_ssqd_info(irq_ptr); |
286 | if (rc) { | 286 | if (rc) { |
287 | QDIO_DBF_TEXT2(0, setup, "ssqdasig"); | 287 | QDIO_DBF_TEXT2(0, setup, "ssqdasig"); |
288 | sprintf(dbf_text, "schno%x", irq_ptr->schid.sch_no); | 288 | sprintf(dbf_text, "schn%4x", irq_ptr->schid.sch_no); |
289 | QDIO_DBF_TEXT2(0, setup, dbf_text); | 289 | QDIO_DBF_TEXT2(0, setup, dbf_text); |
290 | sprintf(dbf_text, "rc:%d", rc); | 290 | sprintf(dbf_text, "rc:%d", rc); |
291 | QDIO_DBF_TEXT2(0, setup, dbf_text); | 291 | QDIO_DBF_TEXT2(0, setup, dbf_text); |
@@ -447,7 +447,7 @@ void qdio_print_subchannel_info(struct qdio_irq *irq_ptr, | |||
447 | { | 447 | { |
448 | char s[80]; | 448 | char s[80]; |
449 | 449 | ||
450 | sprintf(s, "%s ", cdev->dev.bus_id); | 450 | sprintf(s, "%s sc:%x ", cdev->dev.bus_id, irq_ptr->schid.sch_no); |
451 | 451 | ||
452 | switch (irq_ptr->qib.qfmt) { | 452 | switch (irq_ptr->qib.qfmt) { |
453 | case QDIO_QETH_QFMT: | 453 | case QDIO_QETH_QFMT: |
diff --git a/drivers/s390/cio/qdio_thinint.c b/drivers/s390/cio/qdio_thinint.c index 9291a771d812..ea7f61400267 100644 --- a/drivers/s390/cio/qdio_thinint.c +++ b/drivers/s390/cio/qdio_thinint.c | |||
@@ -113,7 +113,11 @@ void tiqdio_remove_input_queues(struct qdio_irq *irq_ptr) | |||
113 | struct qdio_q *q; | 113 | struct qdio_q *q; |
114 | int i; | 114 | int i; |
115 | 115 | ||
116 | for_each_input_queue(irq_ptr, q, i) { | 116 | for (i = 0; i < irq_ptr->nr_input_qs; i++) { |
117 | q = irq_ptr->input_qs[i]; | ||
118 | /* if establish triggered an error */ | ||
119 | if (!q || !q->entry.prev || !q->entry.next) | ||
120 | continue; | ||
117 | list_del_rcu(&q->entry); | 121 | list_del_rcu(&q->entry); |
118 | synchronize_rcu(); | 122 | synchronize_rcu(); |
119 | } | 123 | } |
diff --git a/drivers/uio/Kconfig b/drivers/uio/Kconfig index 2e9079df26b3..4190be64917f 100644 --- a/drivers/uio/Kconfig +++ b/drivers/uio/Kconfig | |||
@@ -33,6 +33,19 @@ config UIO_PDRV | |||
33 | 33 | ||
34 | If you don't know what to do here, say N. | 34 | If you don't know what to do here, say N. |
35 | 35 | ||
36 | config UIO_PDRV_GENIRQ | ||
37 | tristate "Userspace I/O platform driver with generic IRQ handling" | ||
38 | help | ||
39 | Platform driver for Userspace I/O devices, including generic | ||
40 | interrupt handling code. Shared interrupts are not supported. | ||
41 | |||
42 | This kernel driver requires that the matching userspace driver | ||
43 | handles interrupts in a special way. Userspace is responsible | ||
44 | for acknowledging the hardware device if needed, and re-enabling | ||
45 | interrupts in the interrupt controller using the write() syscall. | ||
46 | |||
47 | If you don't know what to do here, say N. | ||
48 | |||
36 | config UIO_SMX | 49 | config UIO_SMX |
37 | tristate "SMX cryptengine UIO interface" | 50 | tristate "SMX cryptengine UIO interface" |
38 | default n | 51 | default n |
diff --git a/drivers/uio/Makefile b/drivers/uio/Makefile index e00ce0def1a0..8667bbdef904 100644 --- a/drivers/uio/Makefile +++ b/drivers/uio/Makefile | |||
@@ -1,4 +1,5 @@ | |||
1 | obj-$(CONFIG_UIO) += uio.o | 1 | obj-$(CONFIG_UIO) += uio.o |
2 | obj-$(CONFIG_UIO_CIF) += uio_cif.o | 2 | obj-$(CONFIG_UIO_CIF) += uio_cif.o |
3 | obj-$(CONFIG_UIO_PDRV) += uio_pdrv.o | 3 | obj-$(CONFIG_UIO_PDRV) += uio_pdrv.o |
4 | obj-$(CONFIG_UIO_PDRV_GENIRQ) += uio_pdrv_genirq.o | ||
4 | obj-$(CONFIG_UIO_SMX) += uio_smx.o | 5 | obj-$(CONFIG_UIO_SMX) += uio_smx.o |
diff --git a/drivers/uio/uio_pdrv.c b/drivers/uio/uio_pdrv.c index 5d0d2e85d982..0b4ef39cd85d 100644 --- a/drivers/uio/uio_pdrv.c +++ b/drivers/uio/uio_pdrv.c | |||
@@ -88,6 +88,8 @@ static int uio_pdrv_remove(struct platform_device *pdev) | |||
88 | 88 | ||
89 | uio_unregister_device(pdata->uioinfo); | 89 | uio_unregister_device(pdata->uioinfo); |
90 | 90 | ||
91 | kfree(pdata); | ||
92 | |||
91 | return 0; | 93 | return 0; |
92 | } | 94 | } |
93 | 95 | ||
@@ -114,5 +116,5 @@ module_exit(uio_pdrv_exit); | |||
114 | 116 | ||
115 | MODULE_AUTHOR("Uwe Kleine-Koenig"); | 117 | MODULE_AUTHOR("Uwe Kleine-Koenig"); |
116 | MODULE_DESCRIPTION("Userspace I/O platform driver"); | 118 | MODULE_DESCRIPTION("Userspace I/O platform driver"); |
117 | MODULE_LICENSE("GPL"); | 119 | MODULE_LICENSE("GPL v2"); |
118 | MODULE_ALIAS("platform:" DRIVER_NAME); | 120 | MODULE_ALIAS("platform:" DRIVER_NAME); |
diff --git a/drivers/uio/uio_pdrv_genirq.c b/drivers/uio/uio_pdrv_genirq.c new file mode 100644 index 000000000000..1f82c83a92ae --- /dev/null +++ b/drivers/uio/uio_pdrv_genirq.c | |||
@@ -0,0 +1,188 @@ | |||
1 | /* | ||
2 | * drivers/uio/uio_pdrv_genirq.c | ||
3 | * | ||
4 | * Userspace I/O platform driver with generic IRQ handling code. | ||
5 | * | ||
6 | * Copyright (C) 2008 Magnus Damm | ||
7 | * | ||
8 | * Based on uio_pdrv.c by Uwe Kleine-Koenig, | ||
9 | * Copyright (C) 2008 by Digi International Inc. | ||
10 | * All rights reserved. | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or modify it | ||
13 | * under the terms of the GNU General Public License version 2 as published by | ||
14 | * the Free Software Foundation. | ||
15 | */ | ||
16 | |||
17 | #include <linux/platform_device.h> | ||
18 | #include <linux/uio_driver.h> | ||
19 | #include <linux/spinlock.h> | ||
20 | #include <linux/bitops.h> | ||
21 | #include <linux/interrupt.h> | ||
22 | #include <linux/stringify.h> | ||
23 | |||
24 | #define DRIVER_NAME "uio_pdrv_genirq" | ||
25 | |||
26 | struct uio_pdrv_genirq_platdata { | ||
27 | struct uio_info *uioinfo; | ||
28 | spinlock_t lock; | ||
29 | unsigned long flags; | ||
30 | }; | ||
31 | |||
32 | static irqreturn_t uio_pdrv_genirq_handler(int irq, struct uio_info *dev_info) | ||
33 | { | ||
34 | struct uio_pdrv_genirq_platdata *priv = dev_info->priv; | ||
35 | |||
36 | /* Just disable the interrupt in the interrupt controller, and | ||
37 | * remember the state so we can allow user space to enable it later. | ||
38 | */ | ||
39 | |||
40 | if (!test_and_set_bit(0, &priv->flags)) | ||
41 | disable_irq_nosync(irq); | ||
42 | |||
43 | return IRQ_HANDLED; | ||
44 | } | ||
45 | |||
46 | static int uio_pdrv_genirq_irqcontrol(struct uio_info *dev_info, s32 irq_on) | ||
47 | { | ||
48 | struct uio_pdrv_genirq_platdata *priv = dev_info->priv; | ||
49 | unsigned long flags; | ||
50 | |||
51 | /* Allow user space to enable and disable the interrupt | ||
52 | * in the interrupt controller, but keep track of the | ||
53 | * state to prevent per-irq depth damage. | ||
54 | * | ||
55 | * Serialize this operation to support multiple tasks. | ||
56 | */ | ||
57 | |||
58 | spin_lock_irqsave(&priv->lock, flags); | ||
59 | if (irq_on) { | ||
60 | if (test_and_clear_bit(0, &priv->flags)) | ||
61 | enable_irq(dev_info->irq); | ||
62 | } else { | ||
63 | if (!test_and_set_bit(0, &priv->flags)) | ||
64 | disable_irq(dev_info->irq); | ||
65 | } | ||
66 | spin_unlock_irqrestore(&priv->lock, flags); | ||
67 | |||
68 | return 0; | ||
69 | } | ||
70 | |||
71 | static int uio_pdrv_genirq_probe(struct platform_device *pdev) | ||
72 | { | ||
73 | struct uio_info *uioinfo = pdev->dev.platform_data; | ||
74 | struct uio_pdrv_genirq_platdata *priv; | ||
75 | struct uio_mem *uiomem; | ||
76 | int ret = -EINVAL; | ||
77 | int i; | ||
78 | |||
79 | if (!uioinfo || !uioinfo->name || !uioinfo->version) { | ||
80 | dev_err(&pdev->dev, "missing platform_data\n"); | ||
81 | goto bad0; | ||
82 | } | ||
83 | |||
84 | if (uioinfo->handler || uioinfo->irqcontrol || uioinfo->irq_flags) { | ||
85 | dev_err(&pdev->dev, "interrupt configuration error\n"); | ||
86 | goto bad0; | ||
87 | } | ||
88 | |||
89 | priv = kzalloc(sizeof(*priv), GFP_KERNEL); | ||
90 | if (!priv) { | ||
91 | ret = -ENOMEM; | ||
92 | dev_err(&pdev->dev, "unable to kmalloc\n"); | ||
93 | goto bad0; | ||
94 | } | ||
95 | |||
96 | priv->uioinfo = uioinfo; | ||
97 | spin_lock_init(&priv->lock); | ||
98 | priv->flags = 0; /* interrupt is enabled to begin with */ | ||
99 | |||
100 | uiomem = &uioinfo->mem[0]; | ||
101 | |||
102 | for (i = 0; i < pdev->num_resources; ++i) { | ||
103 | struct resource *r = &pdev->resource[i]; | ||
104 | |||
105 | if (r->flags != IORESOURCE_MEM) | ||
106 | continue; | ||
107 | |||
108 | if (uiomem >= &uioinfo->mem[MAX_UIO_MAPS]) { | ||
109 | dev_warn(&pdev->dev, "device has more than " | ||
110 | __stringify(MAX_UIO_MAPS) | ||
111 | " I/O memory resources.\n"); | ||
112 | break; | ||
113 | } | ||
114 | |||
115 | uiomem->memtype = UIO_MEM_PHYS; | ||
116 | uiomem->addr = r->start; | ||
117 | uiomem->size = r->end - r->start + 1; | ||
118 | ++uiomem; | ||
119 | } | ||
120 | |||
121 | while (uiomem < &uioinfo->mem[MAX_UIO_MAPS]) { | ||
122 | uiomem->size = 0; | ||
123 | ++uiomem; | ||
124 | } | ||
125 | |||
126 | /* This driver requires no hardware specific kernel code to handle | ||
127 | * interrupts. Instead, the interrupt handler simply disables the | ||
128 | * interrupt in the interrupt controller. User space is responsible | ||
129 | * for performing hardware specific acknowledge and re-enabling of | ||
130 | * the interrupt in the interrupt controller. | ||
131 | * | ||
132 | * Interrupt sharing is not supported. | ||
133 | */ | ||
134 | |||
135 | uioinfo->irq_flags = IRQF_DISABLED; | ||
136 | uioinfo->handler = uio_pdrv_genirq_handler; | ||
137 | uioinfo->irqcontrol = uio_pdrv_genirq_irqcontrol; | ||
138 | uioinfo->priv = priv; | ||
139 | |||
140 | ret = uio_register_device(&pdev->dev, priv->uioinfo); | ||
141 | if (ret) { | ||
142 | dev_err(&pdev->dev, "unable to register uio device\n"); | ||
143 | goto bad1; | ||
144 | } | ||
145 | |||
146 | platform_set_drvdata(pdev, priv); | ||
147 | return 0; | ||
148 | bad1: | ||
149 | kfree(priv); | ||
150 | bad0: | ||
151 | return ret; | ||
152 | } | ||
153 | |||
154 | static int uio_pdrv_genirq_remove(struct platform_device *pdev) | ||
155 | { | ||
156 | struct uio_pdrv_genirq_platdata *priv = platform_get_drvdata(pdev); | ||
157 | |||
158 | uio_unregister_device(priv->uioinfo); | ||
159 | kfree(priv); | ||
160 | return 0; | ||
161 | } | ||
162 | |||
163 | static struct platform_driver uio_pdrv_genirq = { | ||
164 | .probe = uio_pdrv_genirq_probe, | ||
165 | .remove = uio_pdrv_genirq_remove, | ||
166 | .driver = { | ||
167 | .name = DRIVER_NAME, | ||
168 | .owner = THIS_MODULE, | ||
169 | }, | ||
170 | }; | ||
171 | |||
172 | static int __init uio_pdrv_genirq_init(void) | ||
173 | { | ||
174 | return platform_driver_register(&uio_pdrv_genirq); | ||
175 | } | ||
176 | |||
177 | static void __exit uio_pdrv_genirq_exit(void) | ||
178 | { | ||
179 | platform_driver_unregister(&uio_pdrv_genirq); | ||
180 | } | ||
181 | |||
182 | module_init(uio_pdrv_genirq_init); | ||
183 | module_exit(uio_pdrv_genirq_exit); | ||
184 | |||
185 | MODULE_AUTHOR("Magnus Damm"); | ||
186 | MODULE_DESCRIPTION("Userspace I/O platform driver with generic IRQ handling"); | ||
187 | MODULE_LICENSE("GPL v2"); | ||
188 | MODULE_ALIAS("platform:" DRIVER_NAME); | ||
diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c index efc4373ededb..c257453fa9de 100644 --- a/drivers/usb/class/cdc-acm.c +++ b/drivers/usb/class/cdc-acm.c | |||
@@ -589,8 +589,8 @@ static int acm_tty_open(struct tty_struct *tty, struct file *filp) | |||
589 | tasklet_schedule(&acm->urb_task); | 589 | tasklet_schedule(&acm->urb_task); |
590 | 590 | ||
591 | done: | 591 | done: |
592 | err_out: | ||
593 | mutex_unlock(&acm->mutex); | 592 | mutex_unlock(&acm->mutex); |
593 | err_out: | ||
594 | mutex_unlock(&open_mutex); | 594 | mutex_unlock(&open_mutex); |
595 | return rv; | 595 | return rv; |
596 | 596 | ||
@@ -1362,6 +1362,9 @@ static struct usb_device_id acm_ids[] = { | |||
1362 | { USB_DEVICE(0x0803, 0x3095), /* Zoom Telephonics Model 3095F USB MODEM */ | 1362 | { USB_DEVICE(0x0803, 0x3095), /* Zoom Telephonics Model 3095F USB MODEM */ |
1363 | .driver_info = NO_UNION_NORMAL, /* has no union descriptor */ | 1363 | .driver_info = NO_UNION_NORMAL, /* has no union descriptor */ |
1364 | }, | 1364 | }, |
1365 | { USB_DEVICE(0x0572, 0x1321), /* Conexant USB MODEM CX93010 */ | ||
1366 | .driver_info = NO_UNION_NORMAL, /* has no union descriptor */ | ||
1367 | }, | ||
1365 | 1368 | ||
1366 | /* control interfaces with various AT-command sets */ | 1369 | /* control interfaces with various AT-command sets */ |
1367 | { USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM, | 1370 | { USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ACM, |
diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c index 2be37fe466f2..5a7fa6f09958 100644 --- a/drivers/usb/core/driver.c +++ b/drivers/usb/core/driver.c | |||
@@ -230,6 +230,13 @@ static int usb_probe_interface(struct device *dev) | |||
230 | */ | 230 | */ |
231 | intf->pm_usage_cnt = !(driver->supports_autosuspend); | 231 | intf->pm_usage_cnt = !(driver->supports_autosuspend); |
232 | 232 | ||
233 | /* Carry out a deferred switch to altsetting 0 */ | ||
234 | if (intf->needs_altsetting0) { | ||
235 | usb_set_interface(udev, intf->altsetting[0]. | ||
236 | desc.bInterfaceNumber, 0); | ||
237 | intf->needs_altsetting0 = 0; | ||
238 | } | ||
239 | |||
233 | error = driver->probe(intf, id); | 240 | error = driver->probe(intf, id); |
234 | if (error) { | 241 | if (error) { |
235 | mark_quiesced(intf); | 242 | mark_quiesced(intf); |
@@ -266,8 +273,17 @@ static int usb_unbind_interface(struct device *dev) | |||
266 | 273 | ||
267 | driver->disconnect(intf); | 274 | driver->disconnect(intf); |
268 | 275 | ||
269 | /* reset other interface state */ | 276 | /* Reset other interface state. |
270 | usb_set_interface(udev, intf->altsetting[0].desc.bInterfaceNumber, 0); | 277 | * We cannot do a Set-Interface if the device is suspended or |
278 | * if it is prepared for a system sleep (since installing a new | ||
279 | * altsetting means creating new endpoint device entries). | ||
280 | * When either of these happens, defer the Set-Interface. | ||
281 | */ | ||
282 | if (!error && intf->dev.power.status == DPM_ON) | ||
283 | usb_set_interface(udev, intf->altsetting[0]. | ||
284 | desc.bInterfaceNumber, 0); | ||
285 | else | ||
286 | intf->needs_altsetting0 = 1; | ||
271 | usb_set_intfdata(intf, NULL); | 287 | usb_set_intfdata(intf, NULL); |
272 | 288 | ||
273 | intf->condition = USB_INTERFACE_UNBOUND; | 289 | intf->condition = USB_INTERFACE_UNBOUND; |
@@ -798,7 +814,8 @@ void usb_forced_unbind_intf(struct usb_interface *intf) | |||
798 | * The caller must hold @intf's device's lock, but not its pm_mutex | 814 | * The caller must hold @intf's device's lock, but not its pm_mutex |
799 | * and not @intf->dev.sem. | 815 | * and not @intf->dev.sem. |
800 | * | 816 | * |
801 | * FIXME: The caller must block system sleep transitions. | 817 | * Note: Rebinds will be skipped if a system sleep transition is in |
818 | * progress and the PM "complete" callback hasn't occurred yet. | ||
802 | */ | 819 | */ |
803 | void usb_rebind_intf(struct usb_interface *intf) | 820 | void usb_rebind_intf(struct usb_interface *intf) |
804 | { | 821 | { |
@@ -814,10 +831,12 @@ void usb_rebind_intf(struct usb_interface *intf) | |||
814 | } | 831 | } |
815 | 832 | ||
816 | /* Try to rebind the interface */ | 833 | /* Try to rebind the interface */ |
817 | intf->needs_binding = 0; | 834 | if (intf->dev.power.status == DPM_ON) { |
818 | rc = device_attach(&intf->dev); | 835 | intf->needs_binding = 0; |
819 | if (rc < 0) | 836 | rc = device_attach(&intf->dev); |
820 | dev_warn(&intf->dev, "rebind failed: %d\n", rc); | 837 | if (rc < 0) |
838 | dev_warn(&intf->dev, "rebind failed: %d\n", rc); | ||
839 | } | ||
821 | } | 840 | } |
822 | 841 | ||
823 | #ifdef CONFIG_PM | 842 | #ifdef CONFIG_PM |
@@ -829,7 +848,6 @@ void usb_rebind_intf(struct usb_interface *intf) | |||
829 | * or rebind interfaces that have been unbound, according to @action. | 848 | * or rebind interfaces that have been unbound, according to @action. |
830 | * | 849 | * |
831 | * The caller must hold @udev's device lock. | 850 | * The caller must hold @udev's device lock. |
832 | * FIXME: For rebinds, the caller must block system sleep transitions. | ||
833 | */ | 851 | */ |
834 | static void do_unbind_rebind(struct usb_device *udev, int action) | 852 | static void do_unbind_rebind(struct usb_device *udev, int action) |
835 | { | 853 | { |
@@ -851,22 +869,8 @@ static void do_unbind_rebind(struct usb_device *udev, int action) | |||
851 | } | 869 | } |
852 | break; | 870 | break; |
853 | case DO_REBIND: | 871 | case DO_REBIND: |
854 | if (intf->needs_binding) { | 872 | if (intf->needs_binding) |
855 | |||
856 | /* FIXME: The next line is needed because we are going to probe | ||
857 | * the interface, but as far as the PM core is concerned the | ||
858 | * interface is still suspended. The problem wouldn't exist | ||
859 | * if we could rebind the interface during the interface's own | ||
860 | * resume() call, but at the time the usb_device isn't locked! | ||
861 | * | ||
862 | * The real solution will be to carry this out during the device's | ||
863 | * complete() callback. Until that is implemented, we have to | ||
864 | * use this hack. | ||
865 | */ | ||
866 | // intf->dev.power.sleeping = 0; | ||
867 | |||
868 | usb_rebind_intf(intf); | 873 | usb_rebind_intf(intf); |
869 | } | ||
870 | break; | 874 | break; |
871 | } | 875 | } |
872 | } | 876 | } |
@@ -926,14 +930,14 @@ static int usb_resume_device(struct usb_device *udev) | |||
926 | } | 930 | } |
927 | 931 | ||
928 | /* Caller has locked intf's usb_device's pm mutex */ | 932 | /* Caller has locked intf's usb_device's pm mutex */ |
929 | static int usb_suspend_interface(struct usb_interface *intf, pm_message_t msg) | 933 | static int usb_suspend_interface(struct usb_device *udev, |
934 | struct usb_interface *intf, pm_message_t msg) | ||
930 | { | 935 | { |
931 | struct usb_driver *driver; | 936 | struct usb_driver *driver; |
932 | int status = 0; | 937 | int status = 0; |
933 | 938 | ||
934 | /* with no hardware, USB interfaces only use FREEZE and ON states */ | 939 | /* with no hardware, USB interfaces only use FREEZE and ON states */ |
935 | if (interface_to_usbdev(intf)->state == USB_STATE_NOTATTACHED || | 940 | if (udev->state == USB_STATE_NOTATTACHED || !is_active(intf)) |
936 | !is_active(intf)) | ||
937 | goto done; | 941 | goto done; |
938 | 942 | ||
939 | if (intf->condition == USB_INTERFACE_UNBOUND) /* This can't happen */ | 943 | if (intf->condition == USB_INTERFACE_UNBOUND) /* This can't happen */ |
@@ -944,7 +948,7 @@ static int usb_suspend_interface(struct usb_interface *intf, pm_message_t msg) | |||
944 | status = driver->suspend(intf, msg); | 948 | status = driver->suspend(intf, msg); |
945 | if (status == 0) | 949 | if (status == 0) |
946 | mark_quiesced(intf); | 950 | mark_quiesced(intf); |
947 | else if (!interface_to_usbdev(intf)->auto_pm) | 951 | else if (!udev->auto_pm) |
948 | dev_err(&intf->dev, "%s error %d\n", | 952 | dev_err(&intf->dev, "%s error %d\n", |
949 | "suspend", status); | 953 | "suspend", status); |
950 | } else { | 954 | } else { |
@@ -961,13 +965,13 @@ static int usb_suspend_interface(struct usb_interface *intf, pm_message_t msg) | |||
961 | } | 965 | } |
962 | 966 | ||
963 | /* Caller has locked intf's usb_device's pm_mutex */ | 967 | /* Caller has locked intf's usb_device's pm_mutex */ |
964 | static int usb_resume_interface(struct usb_interface *intf, int reset_resume) | 968 | static int usb_resume_interface(struct usb_device *udev, |
969 | struct usb_interface *intf, int reset_resume) | ||
965 | { | 970 | { |
966 | struct usb_driver *driver; | 971 | struct usb_driver *driver; |
967 | int status = 0; | 972 | int status = 0; |
968 | 973 | ||
969 | if (interface_to_usbdev(intf)->state == USB_STATE_NOTATTACHED || | 974 | if (udev->state == USB_STATE_NOTATTACHED || is_active(intf)) |
970 | is_active(intf)) | ||
971 | goto done; | 975 | goto done; |
972 | 976 | ||
973 | /* Don't let autoresume interfere with unbinding */ | 977 | /* Don't let autoresume interfere with unbinding */ |
@@ -975,8 +979,17 @@ static int usb_resume_interface(struct usb_interface *intf, int reset_resume) | |||
975 | goto done; | 979 | goto done; |
976 | 980 | ||
977 | /* Can't resume it if it doesn't have a driver. */ | 981 | /* Can't resume it if it doesn't have a driver. */ |
978 | if (intf->condition == USB_INTERFACE_UNBOUND) | 982 | if (intf->condition == USB_INTERFACE_UNBOUND) { |
983 | |||
984 | /* Carry out a deferred switch to altsetting 0 */ | ||
985 | if (intf->needs_altsetting0 && | ||
986 | intf->dev.power.status == DPM_ON) { | ||
987 | usb_set_interface(udev, intf->altsetting[0]. | ||
988 | desc.bInterfaceNumber, 0); | ||
989 | intf->needs_altsetting0 = 0; | ||
990 | } | ||
979 | goto done; | 991 | goto done; |
992 | } | ||
980 | 993 | ||
981 | /* Don't resume if the interface is marked for rebinding */ | 994 | /* Don't resume if the interface is marked for rebinding */ |
982 | if (intf->needs_binding) | 995 | if (intf->needs_binding) |
@@ -1151,7 +1164,7 @@ static int usb_suspend_both(struct usb_device *udev, pm_message_t msg) | |||
1151 | if (udev->actconfig) { | 1164 | if (udev->actconfig) { |
1152 | for (; i < udev->actconfig->desc.bNumInterfaces; i++) { | 1165 | for (; i < udev->actconfig->desc.bNumInterfaces; i++) { |
1153 | intf = udev->actconfig->interface[i]; | 1166 | intf = udev->actconfig->interface[i]; |
1154 | status = usb_suspend_interface(intf, msg); | 1167 | status = usb_suspend_interface(udev, intf, msg); |
1155 | if (status != 0) | 1168 | if (status != 0) |
1156 | break; | 1169 | break; |
1157 | } | 1170 | } |
@@ -1163,7 +1176,7 @@ static int usb_suspend_both(struct usb_device *udev, pm_message_t msg) | |||
1163 | if (status != 0) { | 1176 | if (status != 0) { |
1164 | while (--i >= 0) { | 1177 | while (--i >= 0) { |
1165 | intf = udev->actconfig->interface[i]; | 1178 | intf = udev->actconfig->interface[i]; |
1166 | usb_resume_interface(intf, 0); | 1179 | usb_resume_interface(udev, intf, 0); |
1167 | } | 1180 | } |
1168 | 1181 | ||
1169 | /* Try another autosuspend when the interfaces aren't busy */ | 1182 | /* Try another autosuspend when the interfaces aren't busy */ |
@@ -1276,7 +1289,7 @@ static int usb_resume_both(struct usb_device *udev) | |||
1276 | if (status == 0 && udev->actconfig) { | 1289 | if (status == 0 && udev->actconfig) { |
1277 | for (i = 0; i < udev->actconfig->desc.bNumInterfaces; i++) { | 1290 | for (i = 0; i < udev->actconfig->desc.bNumInterfaces; i++) { |
1278 | intf = udev->actconfig->interface[i]; | 1291 | intf = udev->actconfig->interface[i]; |
1279 | usb_resume_interface(intf, udev->reset_resume); | 1292 | usb_resume_interface(udev, intf, udev->reset_resume); |
1280 | } | 1293 | } |
1281 | } | 1294 | } |
1282 | 1295 | ||
@@ -1605,12 +1618,10 @@ int usb_external_resume_device(struct usb_device *udev) | |||
1605 | return status; | 1618 | return status; |
1606 | } | 1619 | } |
1607 | 1620 | ||
1608 | static int usb_suspend(struct device *dev, pm_message_t message) | 1621 | int usb_suspend(struct device *dev, pm_message_t message) |
1609 | { | 1622 | { |
1610 | struct usb_device *udev; | 1623 | struct usb_device *udev; |
1611 | 1624 | ||
1612 | if (!is_usb_device(dev)) /* Ignore PM for interfaces */ | ||
1613 | return 0; | ||
1614 | udev = to_usb_device(dev); | 1625 | udev = to_usb_device(dev); |
1615 | 1626 | ||
1616 | /* If udev is already suspended, we can skip this suspend and | 1627 | /* If udev is already suspended, we can skip this suspend and |
@@ -1629,12 +1640,10 @@ static int usb_suspend(struct device *dev, pm_message_t message) | |||
1629 | return usb_external_suspend_device(udev, message); | 1640 | return usb_external_suspend_device(udev, message); |
1630 | } | 1641 | } |
1631 | 1642 | ||
1632 | static int usb_resume(struct device *dev) | 1643 | int usb_resume(struct device *dev) |
1633 | { | 1644 | { |
1634 | struct usb_device *udev; | 1645 | struct usb_device *udev; |
1635 | 1646 | ||
1636 | if (!is_usb_device(dev)) /* Ignore PM for interfaces */ | ||
1637 | return 0; | ||
1638 | udev = to_usb_device(dev); | 1647 | udev = to_usb_device(dev); |
1639 | 1648 | ||
1640 | /* If udev->skip_sys_resume is set then udev was already suspended | 1649 | /* If udev->skip_sys_resume is set then udev was already suspended |
@@ -1646,17 +1655,10 @@ static int usb_resume(struct device *dev) | |||
1646 | return usb_external_resume_device(udev); | 1655 | return usb_external_resume_device(udev); |
1647 | } | 1656 | } |
1648 | 1657 | ||
1649 | #else | ||
1650 | |||
1651 | #define usb_suspend NULL | ||
1652 | #define usb_resume NULL | ||
1653 | |||
1654 | #endif /* CONFIG_PM */ | 1658 | #endif /* CONFIG_PM */ |
1655 | 1659 | ||
1656 | struct bus_type usb_bus_type = { | 1660 | struct bus_type usb_bus_type = { |
1657 | .name = "usb", | 1661 | .name = "usb", |
1658 | .match = usb_device_match, | 1662 | .match = usb_device_match, |
1659 | .uevent = usb_uevent, | 1663 | .uevent = usb_uevent, |
1660 | .suspend = usb_suspend, | ||
1661 | .resume = usb_resume, | ||
1662 | }; | 1664 | }; |
diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c index f7bfd72ef115..8abd4e59bf4a 100644 --- a/drivers/usb/core/hcd.c +++ b/drivers/usb/core/hcd.c | |||
@@ -924,15 +924,6 @@ static int register_root_hub(struct usb_hcd *hcd) | |||
924 | return retval; | 924 | return retval; |
925 | } | 925 | } |
926 | 926 | ||
927 | void usb_enable_root_hub_irq (struct usb_bus *bus) | ||
928 | { | ||
929 | struct usb_hcd *hcd; | ||
930 | |||
931 | hcd = container_of (bus, struct usb_hcd, self); | ||
932 | if (hcd->driver->hub_irq_enable && hcd->state != HC_STATE_HALT) | ||
933 | hcd->driver->hub_irq_enable (hcd); | ||
934 | } | ||
935 | |||
936 | 927 | ||
937 | /*-------------------------------------------------------------------------*/ | 928 | /*-------------------------------------------------------------------------*/ |
938 | 929 | ||
diff --git a/drivers/usb/core/hcd.h b/drivers/usb/core/hcd.h index 5b0b59b0d89b..e710ce04e228 100644 --- a/drivers/usb/core/hcd.h +++ b/drivers/usb/core/hcd.h | |||
@@ -212,8 +212,6 @@ struct hc_driver { | |||
212 | int (*bus_suspend)(struct usb_hcd *); | 212 | int (*bus_suspend)(struct usb_hcd *); |
213 | int (*bus_resume)(struct usb_hcd *); | 213 | int (*bus_resume)(struct usb_hcd *); |
214 | int (*start_port_reset)(struct usb_hcd *, unsigned port_num); | 214 | int (*start_port_reset)(struct usb_hcd *, unsigned port_num); |
215 | void (*hub_irq_enable)(struct usb_hcd *); | ||
216 | /* Needed only if port-change IRQs are level-triggered */ | ||
217 | 215 | ||
218 | /* force handover of high-speed port to full-speed companion */ | 216 | /* force handover of high-speed port to full-speed companion */ |
219 | void (*relinquish_port)(struct usb_hcd *, int); | 217 | void (*relinquish_port)(struct usb_hcd *, int); |
@@ -379,8 +377,6 @@ extern struct list_head usb_bus_list; | |||
379 | extern struct mutex usb_bus_list_lock; | 377 | extern struct mutex usb_bus_list_lock; |
380 | extern wait_queue_head_t usb_kill_urb_queue; | 378 | extern wait_queue_head_t usb_kill_urb_queue; |
381 | 379 | ||
382 | extern void usb_enable_root_hub_irq(struct usb_bus *bus); | ||
383 | |||
384 | extern int usb_find_interface_driver(struct usb_device *dev, | 380 | extern int usb_find_interface_driver(struct usb_device *dev, |
385 | struct usb_interface *interface); | 381 | struct usb_interface *interface); |
386 | 382 | ||
diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c index 107e1d25ddec..6a5cb018383d 100644 --- a/drivers/usb/core/hub.c +++ b/drivers/usb/core/hub.c | |||
@@ -2102,8 +2102,6 @@ int usb_port_resume(struct usb_device *udev) | |||
2102 | } | 2102 | } |
2103 | 2103 | ||
2104 | clear_bit(port1, hub->busy_bits); | 2104 | clear_bit(port1, hub->busy_bits); |
2105 | if (!hub->hdev->parent && !hub->busy_bits[0]) | ||
2106 | usb_enable_root_hub_irq(hub->hdev->bus); | ||
2107 | 2105 | ||
2108 | status = check_port_resume_type(udev, | 2106 | status = check_port_resume_type(udev, |
2109 | hub, port1, status, portchange, portstatus); | 2107 | hub, port1, status, portchange, portstatus); |
@@ -3081,11 +3079,6 @@ static void hub_events(void) | |||
3081 | } | 3079 | } |
3082 | } | 3080 | } |
3083 | 3081 | ||
3084 | /* If this is a root hub, tell the HCD it's okay to | ||
3085 | * re-enable port-change interrupts now. */ | ||
3086 | if (!hdev->parent && !hub->busy_bits[0]) | ||
3087 | usb_enable_root_hub_irq(hdev->bus); | ||
3088 | |||
3089 | loop_autopm: | 3082 | loop_autopm: |
3090 | /* Allow autosuspend if we're not going to run again */ | 3083 | /* Allow autosuspend if we're not going to run again */ |
3091 | if (list_empty(&hub->event_list)) | 3084 | if (list_empty(&hub->event_list)) |
@@ -3311,8 +3304,6 @@ static int usb_reset_and_verify_device(struct usb_device *udev) | |||
3311 | break; | 3304 | break; |
3312 | } | 3305 | } |
3313 | clear_bit(port1, parent_hub->busy_bits); | 3306 | clear_bit(port1, parent_hub->busy_bits); |
3314 | if (!parent_hdev->parent && !parent_hub->busy_bits[0]) | ||
3315 | usb_enable_root_hub_irq(parent_hdev->bus); | ||
3316 | 3307 | ||
3317 | if (ret < 0) | 3308 | if (ret < 0) |
3318 | goto re_enumerate; | 3309 | goto re_enumerate; |
diff --git a/drivers/usb/core/urb.c b/drivers/usb/core/urb.c index c0b1ae25ae2a..47111e88f791 100644 --- a/drivers/usb/core/urb.c +++ b/drivers/usb/core/urb.c | |||
@@ -601,15 +601,20 @@ EXPORT_SYMBOL_GPL(usb_kill_anchored_urbs); | |||
601 | void usb_unlink_anchored_urbs(struct usb_anchor *anchor) | 601 | void usb_unlink_anchored_urbs(struct usb_anchor *anchor) |
602 | { | 602 | { |
603 | struct urb *victim; | 603 | struct urb *victim; |
604 | unsigned long flags; | ||
604 | 605 | ||
605 | spin_lock_irq(&anchor->lock); | 606 | spin_lock_irqsave(&anchor->lock, flags); |
606 | while (!list_empty(&anchor->urb_list)) { | 607 | while (!list_empty(&anchor->urb_list)) { |
607 | victim = list_entry(anchor->urb_list.prev, struct urb, | 608 | victim = list_entry(anchor->urb_list.prev, struct urb, |
608 | anchor_list); | 609 | anchor_list); |
610 | usb_get_urb(victim); | ||
611 | spin_unlock_irqrestore(&anchor->lock, flags); | ||
609 | /* this will unanchor the URB */ | 612 | /* this will unanchor the URB */ |
610 | usb_unlink_urb(victim); | 613 | usb_unlink_urb(victim); |
614 | usb_put_urb(victim); | ||
615 | spin_lock_irqsave(&anchor->lock, flags); | ||
611 | } | 616 | } |
612 | spin_unlock_irq(&anchor->lock); | 617 | spin_unlock_irqrestore(&anchor->lock, flags); |
613 | } | 618 | } |
614 | EXPORT_SYMBOL_GPL(usb_unlink_anchored_urbs); | 619 | EXPORT_SYMBOL_GPL(usb_unlink_anchored_urbs); |
615 | 620 | ||
diff --git a/drivers/usb/core/usb.c b/drivers/usb/core/usb.c index 84fcaa6a21ec..be1fa0723f2c 100644 --- a/drivers/usb/core/usb.c +++ b/drivers/usb/core/usb.c | |||
@@ -219,12 +219,6 @@ static int usb_dev_uevent(struct device *dev, struct kobj_uevent_env *env) | |||
219 | } | 219 | } |
220 | #endif /* CONFIG_HOTPLUG */ | 220 | #endif /* CONFIG_HOTPLUG */ |
221 | 221 | ||
222 | struct device_type usb_device_type = { | ||
223 | .name = "usb_device", | ||
224 | .release = usb_release_dev, | ||
225 | .uevent = usb_dev_uevent, | ||
226 | }; | ||
227 | |||
228 | #ifdef CONFIG_PM | 222 | #ifdef CONFIG_PM |
229 | 223 | ||
230 | static int ksuspend_usb_init(void) | 224 | static int ksuspend_usb_init(void) |
@@ -244,13 +238,80 @@ static void ksuspend_usb_cleanup(void) | |||
244 | destroy_workqueue(ksuspend_usb_wq); | 238 | destroy_workqueue(ksuspend_usb_wq); |
245 | } | 239 | } |
246 | 240 | ||
241 | /* USB device Power-Management thunks. | ||
242 | * There's no need to distinguish here between quiescing a USB device | ||
243 | * and powering it down; the generic_suspend() routine takes care of | ||
244 | * it by skipping the usb_port_suspend() call for a quiesce. And for | ||
245 | * USB interfaces there's no difference at all. | ||
246 | */ | ||
247 | |||
248 | static int usb_dev_prepare(struct device *dev) | ||
249 | { | ||
250 | return 0; /* Implement eventually? */ | ||
251 | } | ||
252 | |||
253 | static void usb_dev_complete(struct device *dev) | ||
254 | { | ||
255 | /* Currently used only for rebinding interfaces */ | ||
256 | usb_resume(dev); /* Implement eventually? */ | ||
257 | } | ||
258 | |||
259 | static int usb_dev_suspend(struct device *dev) | ||
260 | { | ||
261 | return usb_suspend(dev, PMSG_SUSPEND); | ||
262 | } | ||
263 | |||
264 | static int usb_dev_resume(struct device *dev) | ||
265 | { | ||
266 | return usb_resume(dev); | ||
267 | } | ||
268 | |||
269 | static int usb_dev_freeze(struct device *dev) | ||
270 | { | ||
271 | return usb_suspend(dev, PMSG_FREEZE); | ||
272 | } | ||
273 | |||
274 | static int usb_dev_thaw(struct device *dev) | ||
275 | { | ||
276 | return usb_resume(dev); | ||
277 | } | ||
278 | |||
279 | static int usb_dev_poweroff(struct device *dev) | ||
280 | { | ||
281 | return usb_suspend(dev, PMSG_HIBERNATE); | ||
282 | } | ||
283 | |||
284 | static int usb_dev_restore(struct device *dev) | ||
285 | { | ||
286 | return usb_resume(dev); | ||
287 | } | ||
288 | |||
289 | static struct pm_ops usb_device_pm_ops = { | ||
290 | .prepare = usb_dev_prepare, | ||
291 | .complete = usb_dev_complete, | ||
292 | .suspend = usb_dev_suspend, | ||
293 | .resume = usb_dev_resume, | ||
294 | .freeze = usb_dev_freeze, | ||
295 | .thaw = usb_dev_thaw, | ||
296 | .poweroff = usb_dev_poweroff, | ||
297 | .restore = usb_dev_restore, | ||
298 | }; | ||
299 | |||
247 | #else | 300 | #else |
248 | 301 | ||
249 | #define ksuspend_usb_init() 0 | 302 | #define ksuspend_usb_init() 0 |
250 | #define ksuspend_usb_cleanup() do {} while (0) | 303 | #define ksuspend_usb_cleanup() do {} while (0) |
304 | #define usb_device_pm_ops (*(struct pm_ops *)0) | ||
251 | 305 | ||
252 | #endif /* CONFIG_PM */ | 306 | #endif /* CONFIG_PM */ |
253 | 307 | ||
308 | struct device_type usb_device_type = { | ||
309 | .name = "usb_device", | ||
310 | .release = usb_release_dev, | ||
311 | .uevent = usb_dev_uevent, | ||
312 | .pm = &usb_device_pm_ops, | ||
313 | }; | ||
314 | |||
254 | 315 | ||
255 | /* Returns 1 if @usb_bus is WUSB, 0 otherwise */ | 316 | /* Returns 1 if @usb_bus is WUSB, 0 otherwise */ |
256 | static unsigned usb_bus_is_wusb(struct usb_bus *bus) | 317 | static unsigned usb_bus_is_wusb(struct usb_bus *bus) |
diff --git a/drivers/usb/core/usb.h b/drivers/usb/core/usb.h index d9a6e16dbf84..9a1a45ac3add 100644 --- a/drivers/usb/core/usb.h +++ b/drivers/usb/core/usb.h | |||
@@ -41,6 +41,9 @@ extern void usb_host_cleanup(void); | |||
41 | 41 | ||
42 | #ifdef CONFIG_PM | 42 | #ifdef CONFIG_PM |
43 | 43 | ||
44 | extern int usb_suspend(struct device *dev, pm_message_t msg); | ||
45 | extern int usb_resume(struct device *dev); | ||
46 | |||
44 | extern void usb_autosuspend_work(struct work_struct *work); | 47 | extern void usb_autosuspend_work(struct work_struct *work); |
45 | extern int usb_port_suspend(struct usb_device *dev); | 48 | extern int usb_port_suspend(struct usb_device *dev); |
46 | extern int usb_port_resume(struct usb_device *dev); | 49 | extern int usb_port_resume(struct usb_device *dev); |
diff --git a/drivers/usb/gadget/pxa27x_udc.c b/drivers/usb/gadget/pxa27x_udc.c index a28513ecbe5b..7cbc78a6853d 100644 --- a/drivers/usb/gadget/pxa27x_udc.c +++ b/drivers/usb/gadget/pxa27x_udc.c | |||
@@ -1622,7 +1622,7 @@ int usb_gadget_register_driver(struct usb_gadget_driver *driver) | |||
1622 | struct pxa_udc *udc = the_controller; | 1622 | struct pxa_udc *udc = the_controller; |
1623 | int retval; | 1623 | int retval; |
1624 | 1624 | ||
1625 | if (!driver || driver->speed != USB_SPEED_FULL || !driver->bind | 1625 | if (!driver || driver->speed < USB_SPEED_FULL || !driver->bind |
1626 | || !driver->disconnect || !driver->setup) | 1626 | || !driver->disconnect || !driver->setup) |
1627 | return -EINVAL; | 1627 | return -EINVAL; |
1628 | if (!udc) | 1628 | if (!udc) |
diff --git a/drivers/usb/host/isp1760-hcd.c b/drivers/usb/host/isp1760-hcd.c index d22a84f86a33..8017f1cf78e2 100644 --- a/drivers/usb/host/isp1760-hcd.c +++ b/drivers/usb/host/isp1760-hcd.c | |||
@@ -988,7 +988,7 @@ static void do_atl_int(struct usb_hcd *usb_hcd) | |||
988 | /* | 988 | /* |
989 | * write bank1 address twice to ensure the 90ns delay (time | 989 | * write bank1 address twice to ensure the 90ns delay (time |
990 | * between BANK0 write and the priv_read_copy() call is at | 990 | * between BANK0 write and the priv_read_copy() call is at |
991 | * least 3*t_WHWL + 2*t_w11 = 3*25ns + 2*17ns = 92ns) | 991 | * least 3*t_WHWL + 2*t_w11 = 3*25ns + 2*17ns = 109ns) |
992 | */ | 992 | */ |
993 | isp1760_writel(payload + ISP_BANK(1), usb_hcd->regs + | 993 | isp1760_writel(payload + ISP_BANK(1), usb_hcd->regs + |
994 | HC_MEMORY_REG); | 994 | HC_MEMORY_REG); |
diff --git a/drivers/usb/host/ohci-at91.c b/drivers/usb/host/ohci-at91.c index 6db7a2889e66..4ed228a89943 100644 --- a/drivers/usb/host/ohci-at91.c +++ b/drivers/usb/host/ohci-at91.c | |||
@@ -260,7 +260,6 @@ static const struct hc_driver ohci_at91_hc_driver = { | |||
260 | */ | 260 | */ |
261 | .hub_status_data = ohci_hub_status_data, | 261 | .hub_status_data = ohci_hub_status_data, |
262 | .hub_control = ohci_hub_control, | 262 | .hub_control = ohci_hub_control, |
263 | .hub_irq_enable = ohci_rhsc_enable, | ||
264 | #ifdef CONFIG_PM | 263 | #ifdef CONFIG_PM |
265 | .bus_suspend = ohci_bus_suspend, | 264 | .bus_suspend = ohci_bus_suspend, |
266 | .bus_resume = ohci_bus_resume, | 265 | .bus_resume = ohci_bus_resume, |
diff --git a/drivers/usb/host/ohci-au1xxx.c b/drivers/usb/host/ohci-au1xxx.c index c0948008fe3d..2ac4e022a13f 100644 --- a/drivers/usb/host/ohci-au1xxx.c +++ b/drivers/usb/host/ohci-au1xxx.c | |||
@@ -163,7 +163,6 @@ static const struct hc_driver ohci_au1xxx_hc_driver = { | |||
163 | */ | 163 | */ |
164 | .hub_status_data = ohci_hub_status_data, | 164 | .hub_status_data = ohci_hub_status_data, |
165 | .hub_control = ohci_hub_control, | 165 | .hub_control = ohci_hub_control, |
166 | .hub_irq_enable = ohci_rhsc_enable, | ||
167 | #ifdef CONFIG_PM | 166 | #ifdef CONFIG_PM |
168 | .bus_suspend = ohci_bus_suspend, | 167 | .bus_suspend = ohci_bus_suspend, |
169 | .bus_resume = ohci_bus_resume, | 168 | .bus_resume = ohci_bus_resume, |
diff --git a/drivers/usb/host/ohci-ep93xx.c b/drivers/usb/host/ohci-ep93xx.c index cb0b506f8259..fb3055f084b5 100644 --- a/drivers/usb/host/ohci-ep93xx.c +++ b/drivers/usb/host/ohci-ep93xx.c | |||
@@ -134,7 +134,6 @@ static struct hc_driver ohci_ep93xx_hc_driver = { | |||
134 | .get_frame_number = ohci_get_frame, | 134 | .get_frame_number = ohci_get_frame, |
135 | .hub_status_data = ohci_hub_status_data, | 135 | .hub_status_data = ohci_hub_status_data, |
136 | .hub_control = ohci_hub_control, | 136 | .hub_control = ohci_hub_control, |
137 | .hub_irq_enable = ohci_rhsc_enable, | ||
138 | #ifdef CONFIG_PM | 137 | #ifdef CONFIG_PM |
139 | .bus_suspend = ohci_bus_suspend, | 138 | .bus_suspend = ohci_bus_suspend, |
140 | .bus_resume = ohci_bus_resume, | 139 | .bus_resume = ohci_bus_resume, |
diff --git a/drivers/usb/host/ohci-hub.c b/drivers/usb/host/ohci-hub.c index 439beb784f3e..7ea9a7b31155 100644 --- a/drivers/usb/host/ohci-hub.c +++ b/drivers/usb/host/ohci-hub.c | |||
@@ -36,18 +36,6 @@ | |||
36 | 36 | ||
37 | /*-------------------------------------------------------------------------*/ | 37 | /*-------------------------------------------------------------------------*/ |
38 | 38 | ||
39 | /* hcd->hub_irq_enable() */ | ||
40 | static void ohci_rhsc_enable (struct usb_hcd *hcd) | ||
41 | { | ||
42 | struct ohci_hcd *ohci = hcd_to_ohci (hcd); | ||
43 | |||
44 | spin_lock_irq(&ohci->lock); | ||
45 | if (!ohci->autostop) | ||
46 | del_timer(&hcd->rh_timer); /* Prevent next poll */ | ||
47 | ohci_writel(ohci, OHCI_INTR_RHSC, &ohci->regs->intrenable); | ||
48 | spin_unlock_irq(&ohci->lock); | ||
49 | } | ||
50 | |||
51 | #define OHCI_SCHED_ENABLES \ | 39 | #define OHCI_SCHED_ENABLES \ |
52 | (OHCI_CTRL_CLE|OHCI_CTRL_BLE|OHCI_CTRL_PLE|OHCI_CTRL_IE) | 40 | (OHCI_CTRL_CLE|OHCI_CTRL_BLE|OHCI_CTRL_PLE|OHCI_CTRL_IE) |
53 | 41 | ||
@@ -374,18 +362,28 @@ static int ohci_root_hub_state_changes(struct ohci_hcd *ohci, int changed, | |||
374 | int any_connected) | 362 | int any_connected) |
375 | { | 363 | { |
376 | int poll_rh = 1; | 364 | int poll_rh = 1; |
365 | int rhsc; | ||
377 | 366 | ||
367 | rhsc = ohci_readl(ohci, &ohci->regs->intrenable) & OHCI_INTR_RHSC; | ||
378 | switch (ohci->hc_control & OHCI_CTRL_HCFS) { | 368 | switch (ohci->hc_control & OHCI_CTRL_HCFS) { |
379 | 369 | ||
380 | case OHCI_USB_OPER: | 370 | case OHCI_USB_OPER: |
381 | /* keep on polling until we know a device is connected | 371 | /* If no status changes are pending, enable status-change |
382 | * and RHSC is enabled */ | 372 | * interrupts. |
373 | */ | ||
374 | if (!rhsc && !changed) { | ||
375 | rhsc = OHCI_INTR_RHSC; | ||
376 | ohci_writel(ohci, rhsc, &ohci->regs->intrenable); | ||
377 | } | ||
378 | |||
379 | /* Keep on polling until we know a device is connected | ||
380 | * and RHSC is enabled, or until we autostop. | ||
381 | */ | ||
383 | if (!ohci->autostop) { | 382 | if (!ohci->autostop) { |
384 | if (any_connected || | 383 | if (any_connected || |
385 | !device_may_wakeup(&ohci_to_hcd(ohci) | 384 | !device_may_wakeup(&ohci_to_hcd(ohci) |
386 | ->self.root_hub->dev)) { | 385 | ->self.root_hub->dev)) { |
387 | if (ohci_readl(ohci, &ohci->regs->intrenable) & | 386 | if (rhsc) |
388 | OHCI_INTR_RHSC) | ||
389 | poll_rh = 0; | 387 | poll_rh = 0; |
390 | } else { | 388 | } else { |
391 | ohci->autostop = 1; | 389 | ohci->autostop = 1; |
@@ -398,12 +396,13 @@ static int ohci_root_hub_state_changes(struct ohci_hcd *ohci, int changed, | |||
398 | ohci->autostop = 0; | 396 | ohci->autostop = 0; |
399 | ohci->next_statechange = jiffies + | 397 | ohci->next_statechange = jiffies + |
400 | STATECHANGE_DELAY; | 398 | STATECHANGE_DELAY; |
401 | } else if (time_after_eq(jiffies, | 399 | } else if (rhsc && time_after_eq(jiffies, |
402 | ohci->next_statechange) | 400 | ohci->next_statechange) |
403 | && !ohci->ed_rm_list | 401 | && !ohci->ed_rm_list |
404 | && !(ohci->hc_control & | 402 | && !(ohci->hc_control & |
405 | OHCI_SCHED_ENABLES)) { | 403 | OHCI_SCHED_ENABLES)) { |
406 | ohci_rh_suspend(ohci, 1); | 404 | ohci_rh_suspend(ohci, 1); |
405 | poll_rh = 0; | ||
407 | } | 406 | } |
408 | } | 407 | } |
409 | break; | 408 | break; |
@@ -417,6 +416,12 @@ static int ohci_root_hub_state_changes(struct ohci_hcd *ohci, int changed, | |||
417 | else | 416 | else |
418 | usb_hcd_resume_root_hub(ohci_to_hcd(ohci)); | 417 | usb_hcd_resume_root_hub(ohci_to_hcd(ohci)); |
419 | } else { | 418 | } else { |
419 | if (!rhsc && (ohci->autostop || | ||
420 | ohci_to_hcd(ohci)->self.root_hub-> | ||
421 | do_remote_wakeup)) | ||
422 | ohci_writel(ohci, OHCI_INTR_RHSC, | ||
423 | &ohci->regs->intrenable); | ||
424 | |||
420 | /* everything is idle, no need for polling */ | 425 | /* everything is idle, no need for polling */ |
421 | poll_rh = 0; | 426 | poll_rh = 0; |
422 | } | 427 | } |
@@ -438,12 +443,16 @@ static inline int ohci_rh_resume(struct ohci_hcd *ohci) | |||
438 | static int ohci_root_hub_state_changes(struct ohci_hcd *ohci, int changed, | 443 | static int ohci_root_hub_state_changes(struct ohci_hcd *ohci, int changed, |
439 | int any_connected) | 444 | int any_connected) |
440 | { | 445 | { |
441 | int poll_rh = 1; | 446 | /* If RHSC is enabled, don't poll */ |
442 | |||
443 | /* keep on polling until RHSC is enabled */ | ||
444 | if (ohci_readl(ohci, &ohci->regs->intrenable) & OHCI_INTR_RHSC) | 447 | if (ohci_readl(ohci, &ohci->regs->intrenable) & OHCI_INTR_RHSC) |
445 | poll_rh = 0; | 448 | return 0; |
446 | return poll_rh; | 449 | |
450 | /* If no status changes are pending, enable status-change interrupts */ | ||
451 | if (!changed) { | ||
452 | ohci_writel(ohci, OHCI_INTR_RHSC, &ohci->regs->intrenable); | ||
453 | return 0; | ||
454 | } | ||
455 | return 1; | ||
447 | } | 456 | } |
448 | 457 | ||
449 | #endif /* CONFIG_PM */ | 458 | #endif /* CONFIG_PM */ |
diff --git a/drivers/usb/host/ohci-lh7a404.c b/drivers/usb/host/ohci-lh7a404.c index 9e31d440d115..de42283149c7 100644 --- a/drivers/usb/host/ohci-lh7a404.c +++ b/drivers/usb/host/ohci-lh7a404.c | |||
@@ -193,7 +193,6 @@ static const struct hc_driver ohci_lh7a404_hc_driver = { | |||
193 | */ | 193 | */ |
194 | .hub_status_data = ohci_hub_status_data, | 194 | .hub_status_data = ohci_hub_status_data, |
195 | .hub_control = ohci_hub_control, | 195 | .hub_control = ohci_hub_control, |
196 | .hub_irq_enable = ohci_rhsc_enable, | ||
197 | #ifdef CONFIG_PM | 196 | #ifdef CONFIG_PM |
198 | .bus_suspend = ohci_bus_suspend, | 197 | .bus_suspend = ohci_bus_suspend, |
199 | .bus_resume = ohci_bus_resume, | 198 | .bus_resume = ohci_bus_resume, |
diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c index 3d532b709670..1eb64d08b60a 100644 --- a/drivers/usb/host/ohci-omap.c +++ b/drivers/usb/host/ohci-omap.c | |||
@@ -470,7 +470,6 @@ static const struct hc_driver ohci_omap_hc_driver = { | |||
470 | */ | 470 | */ |
471 | .hub_status_data = ohci_hub_status_data, | 471 | .hub_status_data = ohci_hub_status_data, |
472 | .hub_control = ohci_hub_control, | 472 | .hub_control = ohci_hub_control, |
473 | .hub_irq_enable = ohci_rhsc_enable, | ||
474 | #ifdef CONFIG_PM | 473 | #ifdef CONFIG_PM |
475 | .bus_suspend = ohci_bus_suspend, | 474 | .bus_suspend = ohci_bus_suspend, |
476 | .bus_resume = ohci_bus_resume, | 475 | .bus_resume = ohci_bus_resume, |
diff --git a/drivers/usb/host/ohci-pci.c b/drivers/usb/host/ohci-pci.c index 083e8df0a817..a9c2ae36c7ad 100644 --- a/drivers/usb/host/ohci-pci.c +++ b/drivers/usb/host/ohci-pci.c | |||
@@ -459,7 +459,6 @@ static const struct hc_driver ohci_pci_hc_driver = { | |||
459 | */ | 459 | */ |
460 | .hub_status_data = ohci_hub_status_data, | 460 | .hub_status_data = ohci_hub_status_data, |
461 | .hub_control = ohci_hub_control, | 461 | .hub_control = ohci_hub_control, |
462 | .hub_irq_enable = ohci_rhsc_enable, | ||
463 | #ifdef CONFIG_PM | 462 | #ifdef CONFIG_PM |
464 | .bus_suspend = ohci_bus_suspend, | 463 | .bus_suspend = ohci_bus_suspend, |
465 | .bus_resume = ohci_bus_resume, | 464 | .bus_resume = ohci_bus_resume, |
diff --git a/drivers/usb/host/ohci-pnx4008.c b/drivers/usb/host/ohci-pnx4008.c index b02cd0761977..658a2a978c32 100644 --- a/drivers/usb/host/ohci-pnx4008.c +++ b/drivers/usb/host/ohci-pnx4008.c | |||
@@ -277,7 +277,6 @@ static const struct hc_driver ohci_pnx4008_hc_driver = { | |||
277 | */ | 277 | */ |
278 | .hub_status_data = ohci_hub_status_data, | 278 | .hub_status_data = ohci_hub_status_data, |
279 | .hub_control = ohci_hub_control, | 279 | .hub_control = ohci_hub_control, |
280 | .hub_irq_enable = ohci_rhsc_enable, | ||
281 | #ifdef CONFIG_PM | 280 | #ifdef CONFIG_PM |
282 | .bus_suspend = ohci_bus_suspend, | 281 | .bus_suspend = ohci_bus_suspend, |
283 | .bus_resume = ohci_bus_resume, | 282 | .bus_resume = ohci_bus_resume, |
diff --git a/drivers/usb/host/ohci-pnx8550.c b/drivers/usb/host/ohci-pnx8550.c index 605d59cba28e..28467e288a93 100644 --- a/drivers/usb/host/ohci-pnx8550.c +++ b/drivers/usb/host/ohci-pnx8550.c | |||
@@ -201,7 +201,6 @@ static const struct hc_driver ohci_pnx8550_hc_driver = { | |||
201 | */ | 201 | */ |
202 | .hub_status_data = ohci_hub_status_data, | 202 | .hub_status_data = ohci_hub_status_data, |
203 | .hub_control = ohci_hub_control, | 203 | .hub_control = ohci_hub_control, |
204 | .hub_irq_enable = ohci_rhsc_enable, | ||
205 | #ifdef CONFIG_PM | 204 | #ifdef CONFIG_PM |
206 | .bus_suspend = ohci_bus_suspend, | 205 | .bus_suspend = ohci_bus_suspend, |
207 | .bus_resume = ohci_bus_resume, | 206 | .bus_resume = ohci_bus_resume, |
diff --git a/drivers/usb/host/ohci-ppc-of.c b/drivers/usb/host/ohci-ppc-of.c index 91e6e101a4cc..7ac53264ead3 100644 --- a/drivers/usb/host/ohci-ppc-of.c +++ b/drivers/usb/host/ohci-ppc-of.c | |||
@@ -72,7 +72,6 @@ static const struct hc_driver ohci_ppc_of_hc_driver = { | |||
72 | */ | 72 | */ |
73 | .hub_status_data = ohci_hub_status_data, | 73 | .hub_status_data = ohci_hub_status_data, |
74 | .hub_control = ohci_hub_control, | 74 | .hub_control = ohci_hub_control, |
75 | .hub_irq_enable = ohci_rhsc_enable, | ||
76 | #ifdef CONFIG_PM | 75 | #ifdef CONFIG_PM |
77 | .bus_suspend = ohci_bus_suspend, | 76 | .bus_suspend = ohci_bus_suspend, |
78 | .bus_resume = ohci_bus_resume, | 77 | .bus_resume = ohci_bus_resume, |
diff --git a/drivers/usb/host/ohci-ppc-soc.c b/drivers/usb/host/ohci-ppc-soc.c index 523c30125577..cd3398b675b2 100644 --- a/drivers/usb/host/ohci-ppc-soc.c +++ b/drivers/usb/host/ohci-ppc-soc.c | |||
@@ -172,7 +172,6 @@ static const struct hc_driver ohci_ppc_soc_hc_driver = { | |||
172 | */ | 172 | */ |
173 | .hub_status_data = ohci_hub_status_data, | 173 | .hub_status_data = ohci_hub_status_data, |
174 | .hub_control = ohci_hub_control, | 174 | .hub_control = ohci_hub_control, |
175 | .hub_irq_enable = ohci_rhsc_enable, | ||
176 | #ifdef CONFIG_PM | 175 | #ifdef CONFIG_PM |
177 | .bus_suspend = ohci_bus_suspend, | 176 | .bus_suspend = ohci_bus_suspend, |
178 | .bus_resume = ohci_bus_resume, | 177 | .bus_resume = ohci_bus_resume, |
diff --git a/drivers/usb/host/ohci-ps3.c b/drivers/usb/host/ohci-ps3.c index 55c95647f008..2089d8a46c4b 100644 --- a/drivers/usb/host/ohci-ps3.c +++ b/drivers/usb/host/ohci-ps3.c | |||
@@ -68,7 +68,6 @@ static const struct hc_driver ps3_ohci_hc_driver = { | |||
68 | .get_frame_number = ohci_get_frame, | 68 | .get_frame_number = ohci_get_frame, |
69 | .hub_status_data = ohci_hub_status_data, | 69 | .hub_status_data = ohci_hub_status_data, |
70 | .hub_control = ohci_hub_control, | 70 | .hub_control = ohci_hub_control, |
71 | .hub_irq_enable = ohci_rhsc_enable, | ||
72 | .start_port_reset = ohci_start_port_reset, | 71 | .start_port_reset = ohci_start_port_reset, |
73 | #if defined(CONFIG_PM) | 72 | #if defined(CONFIG_PM) |
74 | .bus_suspend = ohci_bus_suspend, | 73 | .bus_suspend = ohci_bus_suspend, |
diff --git a/drivers/usb/host/ohci-pxa27x.c b/drivers/usb/host/ohci-pxa27x.c index 8c9c4849db6e..7f0f35c78185 100644 --- a/drivers/usb/host/ohci-pxa27x.c +++ b/drivers/usb/host/ohci-pxa27x.c | |||
@@ -298,7 +298,6 @@ static const struct hc_driver ohci_pxa27x_hc_driver = { | |||
298 | */ | 298 | */ |
299 | .hub_status_data = ohci_hub_status_data, | 299 | .hub_status_data = ohci_hub_status_data, |
300 | .hub_control = ohci_hub_control, | 300 | .hub_control = ohci_hub_control, |
301 | .hub_irq_enable = ohci_rhsc_enable, | ||
302 | #ifdef CONFIG_PM | 301 | #ifdef CONFIG_PM |
303 | .bus_suspend = ohci_bus_suspend, | 302 | .bus_suspend = ohci_bus_suspend, |
304 | .bus_resume = ohci_bus_resume, | 303 | .bus_resume = ohci_bus_resume, |
diff --git a/drivers/usb/host/ohci-s3c2410.c b/drivers/usb/host/ohci-s3c2410.c index 9e3dc4069e8b..f46af7a718d4 100644 --- a/drivers/usb/host/ohci-s3c2410.c +++ b/drivers/usb/host/ohci-s3c2410.c | |||
@@ -466,7 +466,6 @@ static const struct hc_driver ohci_s3c2410_hc_driver = { | |||
466 | */ | 466 | */ |
467 | .hub_status_data = ohci_s3c2410_hub_status_data, | 467 | .hub_status_data = ohci_s3c2410_hub_status_data, |
468 | .hub_control = ohci_s3c2410_hub_control, | 468 | .hub_control = ohci_s3c2410_hub_control, |
469 | .hub_irq_enable = ohci_rhsc_enable, | ||
470 | #ifdef CONFIG_PM | 469 | #ifdef CONFIG_PM |
471 | .bus_suspend = ohci_bus_suspend, | 470 | .bus_suspend = ohci_bus_suspend, |
472 | .bus_resume = ohci_bus_resume, | 471 | .bus_resume = ohci_bus_resume, |
diff --git a/drivers/usb/host/ohci-sa1111.c b/drivers/usb/host/ohci-sa1111.c index 4626b002e670..e4bbe8e188e4 100644 --- a/drivers/usb/host/ohci-sa1111.c +++ b/drivers/usb/host/ohci-sa1111.c | |||
@@ -231,7 +231,6 @@ static const struct hc_driver ohci_sa1111_hc_driver = { | |||
231 | */ | 231 | */ |
232 | .hub_status_data = ohci_hub_status_data, | 232 | .hub_status_data = ohci_hub_status_data, |
233 | .hub_control = ohci_hub_control, | 233 | .hub_control = ohci_hub_control, |
234 | .hub_irq_enable = ohci_rhsc_enable, | ||
235 | #ifdef CONFIG_PM | 234 | #ifdef CONFIG_PM |
236 | .bus_suspend = ohci_bus_suspend, | 235 | .bus_suspend = ohci_bus_suspend, |
237 | .bus_resume = ohci_bus_resume, | 236 | .bus_resume = ohci_bus_resume, |
diff --git a/drivers/usb/host/ohci-sh.c b/drivers/usb/host/ohci-sh.c index e7ee607278fe..60f03cc7ec4f 100644 --- a/drivers/usb/host/ohci-sh.c +++ b/drivers/usb/host/ohci-sh.c | |||
@@ -68,7 +68,6 @@ static const struct hc_driver ohci_sh_hc_driver = { | |||
68 | */ | 68 | */ |
69 | .hub_status_data = ohci_hub_status_data, | 69 | .hub_status_data = ohci_hub_status_data, |
70 | .hub_control = ohci_hub_control, | 70 | .hub_control = ohci_hub_control, |
71 | .hub_irq_enable = ohci_rhsc_enable, | ||
72 | #ifdef CONFIG_PM | 71 | #ifdef CONFIG_PM |
73 | .bus_suspend = ohci_bus_suspend, | 72 | .bus_suspend = ohci_bus_suspend, |
74 | .bus_resume = ohci_bus_resume, | 73 | .bus_resume = ohci_bus_resume, |
diff --git a/drivers/usb/host/ohci-sm501.c b/drivers/usb/host/ohci-sm501.c index 21b164e4abeb..cff23637cfcc 100644 --- a/drivers/usb/host/ohci-sm501.c +++ b/drivers/usb/host/ohci-sm501.c | |||
@@ -75,7 +75,6 @@ static const struct hc_driver ohci_sm501_hc_driver = { | |||
75 | */ | 75 | */ |
76 | .hub_status_data = ohci_hub_status_data, | 76 | .hub_status_data = ohci_hub_status_data, |
77 | .hub_control = ohci_hub_control, | 77 | .hub_control = ohci_hub_control, |
78 | .hub_irq_enable = ohci_rhsc_enable, | ||
79 | #ifdef CONFIG_PM | 78 | #ifdef CONFIG_PM |
80 | .bus_suspend = ohci_bus_suspend, | 79 | .bus_suspend = ohci_bus_suspend, |
81 | .bus_resume = ohci_bus_resume, | 80 | .bus_resume = ohci_bus_resume, |
diff --git a/drivers/usb/host/ohci-ssb.c b/drivers/usb/host/ohci-ssb.c index 3660c83d80af..23fd6a886bdd 100644 --- a/drivers/usb/host/ohci-ssb.c +++ b/drivers/usb/host/ohci-ssb.c | |||
@@ -81,7 +81,6 @@ static const struct hc_driver ssb_ohci_hc_driver = { | |||
81 | 81 | ||
82 | .hub_status_data = ohci_hub_status_data, | 82 | .hub_status_data = ohci_hub_status_data, |
83 | .hub_control = ohci_hub_control, | 83 | .hub_control = ohci_hub_control, |
84 | .hub_irq_enable = ohci_rhsc_enable, | ||
85 | #ifdef CONFIG_PM | 84 | #ifdef CONFIG_PM |
86 | .bus_suspend = ohci_bus_suspend, | 85 | .bus_suspend = ohci_bus_suspend, |
87 | .bus_resume = ohci_bus_resume, | 86 | .bus_resume = ohci_bus_resume, |
diff --git a/drivers/usb/host/u132-hcd.c b/drivers/usb/host/u132-hcd.c index 20ad3c48fcb2..228f2b070f2b 100644 --- a/drivers/usb/host/u132-hcd.c +++ b/drivers/usb/host/u132-hcd.c | |||
@@ -2934,16 +2934,6 @@ static int u132_start_port_reset(struct usb_hcd *hcd, unsigned port_num) | |||
2934 | return 0; | 2934 | return 0; |
2935 | } | 2935 | } |
2936 | 2936 | ||
2937 | static void u132_hub_irq_enable(struct usb_hcd *hcd) | ||
2938 | { | ||
2939 | struct u132 *u132 = hcd_to_u132(hcd); | ||
2940 | if (u132->going > 1) { | ||
2941 | dev_err(&u132->platform_dev->dev, "device has been removed %d\n" | ||
2942 | , u132->going); | ||
2943 | } else if (u132->going > 0) | ||
2944 | dev_err(&u132->platform_dev->dev, "device is being removed\n"); | ||
2945 | } | ||
2946 | |||
2947 | 2937 | ||
2948 | #ifdef CONFIG_PM | 2938 | #ifdef CONFIG_PM |
2949 | static int u132_bus_suspend(struct usb_hcd *hcd) | 2939 | static int u132_bus_suspend(struct usb_hcd *hcd) |
@@ -2995,7 +2985,6 @@ static struct hc_driver u132_hc_driver = { | |||
2995 | .bus_suspend = u132_bus_suspend, | 2985 | .bus_suspend = u132_bus_suspend, |
2996 | .bus_resume = u132_bus_resume, | 2986 | .bus_resume = u132_bus_resume, |
2997 | .start_port_reset = u132_start_port_reset, | 2987 | .start_port_reset = u132_start_port_reset, |
2998 | .hub_irq_enable = u132_hub_irq_enable, | ||
2999 | }; | 2988 | }; |
3000 | 2989 | ||
3001 | /* | 2990 | /* |
diff --git a/drivers/usb/misc/sisusbvga/sisusb.c b/drivers/usb/misc/sisusbvga/sisusb.c index fbace41a7cba..69c34a58e205 100644 --- a/drivers/usb/misc/sisusbvga/sisusb.c +++ b/drivers/usb/misc/sisusbvga/sisusb.c | |||
@@ -3270,6 +3270,7 @@ static struct usb_device_id sisusb_table [] = { | |||
3270 | { USB_DEVICE(0x0711, 0x0900) }, | 3270 | { USB_DEVICE(0x0711, 0x0900) }, |
3271 | { USB_DEVICE(0x0711, 0x0901) }, | 3271 | { USB_DEVICE(0x0711, 0x0901) }, |
3272 | { USB_DEVICE(0x0711, 0x0902) }, | 3272 | { USB_DEVICE(0x0711, 0x0902) }, |
3273 | { USB_DEVICE(0x0711, 0x0918) }, | ||
3273 | { USB_DEVICE(0x182d, 0x021c) }, | 3274 | { USB_DEVICE(0x182d, 0x021c) }, |
3274 | { USB_DEVICE(0x182d, 0x0269) }, | 3275 | { USB_DEVICE(0x182d, 0x0269) }, |
3275 | { } | 3276 | { } |
diff --git a/drivers/usb/musb/Kconfig b/drivers/usb/musb/Kconfig index faca4333f27a..a0017486ad4e 100644 --- a/drivers/usb/musb/Kconfig +++ b/drivers/usb/musb/Kconfig | |||
@@ -165,12 +165,11 @@ config USB_TUSB_OMAP_DMA | |||
165 | help | 165 | help |
166 | Enable DMA transfers on TUSB 6010 when OMAP DMA is available. | 166 | Enable DMA transfers on TUSB 6010 when OMAP DMA is available. |
167 | 167 | ||
168 | config USB_MUSB_LOGLEVEL | 168 | config USB_MUSB_DEBUG |
169 | depends on USB_MUSB_HDRC | 169 | depends on USB_MUSB_HDRC |
170 | int 'Logging Level (0 - none / 3 - annoying / ... )' | 170 | bool "Enable debugging messages" |
171 | default 0 | 171 | default n |
172 | help | 172 | help |
173 | Set the logging level. 0 disables the debugging altogether, | 173 | This enables musb debugging. To set the logging level use the debug |
174 | although when USB_DEBUG is set the value is at least 1. | 174 | module parameter. Starting at level 3, per-transfer (urb, usb_request, |
175 | Starting at level 3, per-transfer (urb, usb_request, packet, | 175 | packet, or dma transfer) tracing may kick in. |
176 | or dma transfer) tracing may kick in. | ||
diff --git a/drivers/usb/musb/Makefile b/drivers/usb/musb/Makefile index 88eb67de08ae..b6af0d687a73 100644 --- a/drivers/usb/musb/Makefile +++ b/drivers/usb/musb/Makefile | |||
@@ -64,23 +64,6 @@ endif | |||
64 | 64 | ||
65 | # Debugging | 65 | # Debugging |
66 | 66 | ||
67 | MUSB_DEBUG:=$(CONFIG_USB_MUSB_LOGLEVEL) | 67 | ifeq ($(CONFIG_USB_MUSB_DEBUG),y) |
68 | 68 | EXTRA_CFLAGS += -DDEBUG | |
69 | ifeq ("$(strip $(MUSB_DEBUG))","") | ||
70 | ifdef CONFIG_USB_DEBUG | ||
71 | MUSB_DEBUG:=1 | ||
72 | else | ||
73 | MUSB_DEBUG:=0 | ||
74 | endif | ||
75 | endif | 69 | endif |
76 | |||
77 | ifneq ($(MUSB_DEBUG),0) | ||
78 | EXTRA_CFLAGS += -DDEBUG | ||
79 | |||
80 | ifeq ($(CONFIG_PROC_FS),y) | ||
81 | musb_hdrc-objs += musb_procfs.o | ||
82 | endif | ||
83 | |||
84 | endif | ||
85 | |||
86 | EXTRA_CFLAGS += -DMUSB_DEBUG=$(MUSB_DEBUG) | ||
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c index d68ec6daf335..c5b8f0296fcf 100644 --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c | |||
@@ -114,23 +114,14 @@ | |||
114 | 114 | ||
115 | 115 | ||
116 | 116 | ||
117 | #if MUSB_DEBUG > 0 | 117 | unsigned debug; |
118 | unsigned debug = MUSB_DEBUG; | 118 | module_param(debug, uint, S_IRUGO | S_IWUSR); |
119 | module_param(debug, uint, 0); | 119 | MODULE_PARM_DESC(debug, "Debug message level. Default = 0"); |
120 | MODULE_PARM_DESC(debug, "initial debug message level"); | ||
121 | |||
122 | #define MUSB_VERSION_SUFFIX "/dbg" | ||
123 | #endif | ||
124 | 120 | ||
125 | #define DRIVER_AUTHOR "Mentor Graphics, Texas Instruments, Nokia" | 121 | #define DRIVER_AUTHOR "Mentor Graphics, Texas Instruments, Nokia" |
126 | #define DRIVER_DESC "Inventra Dual-Role USB Controller Driver" | 122 | #define DRIVER_DESC "Inventra Dual-Role USB Controller Driver" |
127 | 123 | ||
128 | #define MUSB_VERSION_BASE "6.0" | 124 | #define MUSB_VERSION "6.0" |
129 | |||
130 | #ifndef MUSB_VERSION_SUFFIX | ||
131 | #define MUSB_VERSION_SUFFIX "" | ||
132 | #endif | ||
133 | #define MUSB_VERSION MUSB_VERSION_BASE MUSB_VERSION_SUFFIX | ||
134 | 125 | ||
135 | #define DRIVER_INFO DRIVER_DESC ", v" MUSB_VERSION | 126 | #define DRIVER_INFO DRIVER_DESC ", v" MUSB_VERSION |
136 | 127 | ||
@@ -2037,6 +2028,8 @@ bad_config: | |||
2037 | musb->xceiv.state = OTG_STATE_A_IDLE; | 2028 | musb->xceiv.state = OTG_STATE_A_IDLE; |
2038 | 2029 | ||
2039 | status = usb_add_hcd(musb_to_hcd(musb), -1, 0); | 2030 | status = usb_add_hcd(musb_to_hcd(musb), -1, 0); |
2031 | if (status) | ||
2032 | goto fail; | ||
2040 | 2033 | ||
2041 | DBG(1, "%s mode, status %d, devctl %02x %c\n", | 2034 | DBG(1, "%s mode, status %d, devctl %02x %c\n", |
2042 | "HOST", status, | 2035 | "HOST", status, |
@@ -2051,6 +2044,8 @@ bad_config: | |||
2051 | musb->xceiv.state = OTG_STATE_B_IDLE; | 2044 | musb->xceiv.state = OTG_STATE_B_IDLE; |
2052 | 2045 | ||
2053 | status = musb_gadget_setup(musb); | 2046 | status = musb_gadget_setup(musb); |
2047 | if (status) | ||
2048 | goto fail; | ||
2054 | 2049 | ||
2055 | DBG(1, "%s mode, status %d, dev%02x\n", | 2050 | DBG(1, "%s mode, status %d, dev%02x\n", |
2056 | is_otg_enabled(musb) ? "OTG" : "PERIPHERAL", | 2051 | is_otg_enabled(musb) ? "OTG" : "PERIPHERAL", |
@@ -2059,16 +2054,14 @@ bad_config: | |||
2059 | 2054 | ||
2060 | } | 2055 | } |
2061 | 2056 | ||
2062 | if (status == 0) | 2057 | return 0; |
2063 | musb_debug_create("driver/musb_hdrc", musb); | 2058 | |
2064 | else { | ||
2065 | fail: | 2059 | fail: |
2066 | if (musb->clock) | 2060 | if (musb->clock) |
2067 | clk_put(musb->clock); | 2061 | clk_put(musb->clock); |
2068 | device_init_wakeup(dev, 0); | 2062 | device_init_wakeup(dev, 0); |
2069 | musb_free(musb); | 2063 | musb_free(musb); |
2070 | return status; | 2064 | return status; |
2071 | } | ||
2072 | 2065 | ||
2073 | #ifdef CONFIG_SYSFS | 2066 | #ifdef CONFIG_SYSFS |
2074 | status = device_create_file(dev, &dev_attr_mode); | 2067 | status = device_create_file(dev, &dev_attr_mode); |
@@ -2131,7 +2124,6 @@ static int __devexit musb_remove(struct platform_device *pdev) | |||
2131 | * - OTG mode: both roles are deactivated (or never-activated) | 2124 | * - OTG mode: both roles are deactivated (or never-activated) |
2132 | */ | 2125 | */ |
2133 | musb_shutdown(pdev); | 2126 | musb_shutdown(pdev); |
2134 | musb_debug_delete("driver/musb_hdrc", musb); | ||
2135 | #ifdef CONFIG_USB_MUSB_HDRC_HCD | 2127 | #ifdef CONFIG_USB_MUSB_HDRC_HCD |
2136 | if (musb->board_mode == MUSB_HOST) | 2128 | if (musb->board_mode == MUSB_HOST) |
2137 | usb_remove_hcd(musb_to_hcd(musb)); | 2129 | usb_remove_hcd(musb_to_hcd(musb)); |
diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h index eade46d81708..82227251931b 100644 --- a/drivers/usb/musb/musb_core.h +++ b/drivers/usb/musb/musb_core.h | |||
@@ -485,23 +485,4 @@ extern int musb_platform_get_vbus_status(struct musb *musb); | |||
485 | extern int __init musb_platform_init(struct musb *musb); | 485 | extern int __init musb_platform_init(struct musb *musb); |
486 | extern int musb_platform_exit(struct musb *musb); | 486 | extern int musb_platform_exit(struct musb *musb); |
487 | 487 | ||
488 | /*-------------------------- ProcFS definitions ---------------------*/ | ||
489 | |||
490 | struct proc_dir_entry; | ||
491 | |||
492 | #if (MUSB_DEBUG > 0) && defined(MUSB_CONFIG_PROC_FS) | ||
493 | extern struct proc_dir_entry *musb_debug_create(char *name, struct musb *data); | ||
494 | extern void musb_debug_delete(char *name, struct musb *data); | ||
495 | |||
496 | #else | ||
497 | static inline struct proc_dir_entry * | ||
498 | musb_debug_create(char *name, struct musb *data) | ||
499 | { | ||
500 | return NULL; | ||
501 | } | ||
502 | static inline void musb_debug_delete(char *name, struct musb *data) | ||
503 | { | ||
504 | } | ||
505 | #endif | ||
506 | |||
507 | #endif /* __MUSB_CORE_H__ */ | 488 | #endif /* __MUSB_CORE_H__ */ |
diff --git a/drivers/usb/musb/musb_debug.h b/drivers/usb/musb/musb_debug.h index 3bdb311e820d..4d2794441b15 100644 --- a/drivers/usb/musb/musb_debug.h +++ b/drivers/usb/musb/musb_debug.h | |||
@@ -48,11 +48,7 @@ | |||
48 | __func__, __LINE__ , ## args); \ | 48 | __func__, __LINE__ , ## args); \ |
49 | } } while (0) | 49 | } } while (0) |
50 | 50 | ||
51 | #if MUSB_DEBUG > 0 | ||
52 | extern unsigned debug; | 51 | extern unsigned debug; |
53 | #else | ||
54 | #define debug 0 | ||
55 | #endif | ||
56 | 52 | ||
57 | static inline int _dbg_level(unsigned l) | 53 | static inline int _dbg_level(unsigned l) |
58 | { | 54 | { |
diff --git a/drivers/usb/musb/musb_gadget_ep0.c b/drivers/usb/musb/musb_gadget_ep0.c index 48d7d3ccb243..a57652fff39c 100644 --- a/drivers/usb/musb/musb_gadget_ep0.c +++ b/drivers/usb/musb/musb_gadget_ep0.c | |||
@@ -476,6 +476,7 @@ static void ep0_rxstate(struct musb *musb) | |||
476 | return; | 476 | return; |
477 | musb->ackpend = 0; | 477 | musb->ackpend = 0; |
478 | } | 478 | } |
479 | musb_ep_select(musb->mregs, 0); | ||
479 | musb_writew(regs, MUSB_CSR0, tmp); | 480 | musb_writew(regs, MUSB_CSR0, tmp); |
480 | } | 481 | } |
481 | 482 | ||
@@ -528,6 +529,7 @@ static void ep0_txstate(struct musb *musb) | |||
528 | } | 529 | } |
529 | 530 | ||
530 | /* send it out, triggering a "txpktrdy cleared" irq */ | 531 | /* send it out, triggering a "txpktrdy cleared" irq */ |
532 | musb_ep_select(musb->mregs, 0); | ||
531 | musb_writew(regs, MUSB_CSR0, csr); | 533 | musb_writew(regs, MUSB_CSR0, csr); |
532 | } | 534 | } |
533 | 535 | ||
diff --git a/drivers/usb/musb/musb_procfs.c b/drivers/usb/musb/musb_procfs.c deleted file mode 100644 index 55e6b78bdccc..000000000000 --- a/drivers/usb/musb/musb_procfs.c +++ /dev/null | |||
@@ -1,830 +0,0 @@ | |||
1 | /* | ||
2 | * MUSB OTG driver debug support | ||
3 | * | ||
4 | * Copyright 2005 Mentor Graphics Corporation | ||
5 | * Copyright (C) 2005-2006 by Texas Instruments | ||
6 | * Copyright (C) 2006-2007 Nokia Corporation | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public License | ||
10 | * version 2 as published by the Free Software Foundation. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, but | ||
13 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
15 | * General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
20 | * 02110-1301 USA | ||
21 | * | ||
22 | * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR IMPLIED | ||
23 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
24 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN | ||
25 | * NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
26 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
27 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | ||
28 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
29 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
30 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
31 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
32 | * | ||
33 | */ | ||
34 | |||
35 | #include <linux/kernel.h> | ||
36 | #include <linux/proc_fs.h> | ||
37 | #include <linux/seq_file.h> | ||
38 | #include <linux/uaccess.h> /* FIXME remove procfs writes */ | ||
39 | #include <asm/arch/hardware.h> | ||
40 | |||
41 | #include "musb_core.h" | ||
42 | |||
43 | #include "davinci.h" | ||
44 | |||
45 | #ifdef CONFIG_USB_MUSB_HDRC_HCD | ||
46 | |||
47 | static int dump_qh(struct musb_qh *qh, char *buf, unsigned max) | ||
48 | { | ||
49 | int count; | ||
50 | int tmp; | ||
51 | struct usb_host_endpoint *hep = qh->hep; | ||
52 | struct urb *urb; | ||
53 | |||
54 | count = snprintf(buf, max, " qh %p dev%d ep%d%s max%d\n", | ||
55 | qh, qh->dev->devnum, qh->epnum, | ||
56 | ({ char *s; switch (qh->type) { | ||
57 | case USB_ENDPOINT_XFER_BULK: | ||
58 | s = "-bulk"; break; | ||
59 | case USB_ENDPOINT_XFER_INT: | ||
60 | s = "-int"; break; | ||
61 | case USB_ENDPOINT_XFER_CONTROL: | ||
62 | s = ""; break; | ||
63 | default: | ||
64 | s = "iso"; break; | ||
65 | }; s; }), | ||
66 | qh->maxpacket); | ||
67 | if (count <= 0) | ||
68 | return 0; | ||
69 | buf += count; | ||
70 | max -= count; | ||
71 | |||
72 | list_for_each_entry(urb, &hep->urb_list, urb_list) { | ||
73 | tmp = snprintf(buf, max, "\t%s urb %p %d/%d\n", | ||
74 | usb_pipein(urb->pipe) ? "in" : "out", | ||
75 | urb, urb->actual_length, | ||
76 | urb->transfer_buffer_length); | ||
77 | if (tmp <= 0) | ||
78 | break; | ||
79 | tmp = min(tmp, (int)max); | ||
80 | count += tmp; | ||
81 | buf += tmp; | ||
82 | max -= tmp; | ||
83 | } | ||
84 | return count; | ||
85 | } | ||
86 | |||
87 | static int | ||
88 | dump_queue(struct list_head *q, char *buf, unsigned max) | ||
89 | { | ||
90 | int count = 0; | ||
91 | struct musb_qh *qh; | ||
92 | |||
93 | list_for_each_entry(qh, q, ring) { | ||
94 | int tmp; | ||
95 | |||
96 | tmp = dump_qh(qh, buf, max); | ||
97 | if (tmp <= 0) | ||
98 | break; | ||
99 | tmp = min(tmp, (int)max); | ||
100 | count += tmp; | ||
101 | buf += tmp; | ||
102 | max -= tmp; | ||
103 | } | ||
104 | return count; | ||
105 | } | ||
106 | |||
107 | #endif /* HCD */ | ||
108 | |||
109 | #ifdef CONFIG_USB_GADGET_MUSB_HDRC | ||
110 | static int dump_ep(struct musb_ep *ep, char *buffer, unsigned max) | ||
111 | { | ||
112 | char *buf = buffer; | ||
113 | int code = 0; | ||
114 | void __iomem *regs = ep->hw_ep->regs; | ||
115 | char *mode = "1buf"; | ||
116 | |||
117 | if (ep->is_in) { | ||
118 | if (ep->hw_ep->tx_double_buffered) | ||
119 | mode = "2buf"; | ||
120 | } else { | ||
121 | if (ep->hw_ep->rx_double_buffered) | ||
122 | mode = "2buf"; | ||
123 | } | ||
124 | |||
125 | do { | ||
126 | struct usb_request *req; | ||
127 | |||
128 | code = snprintf(buf, max, | ||
129 | "\n%s (hw%d): %s%s, csr %04x maxp %04x\n", | ||
130 | ep->name, ep->current_epnum, | ||
131 | mode, ep->dma ? " dma" : "", | ||
132 | musb_readw(regs, | ||
133 | (ep->is_in || !ep->current_epnum) | ||
134 | ? MUSB_TXCSR | ||
135 | : MUSB_RXCSR), | ||
136 | musb_readw(regs, ep->is_in | ||
137 | ? MUSB_TXMAXP | ||
138 | : MUSB_RXMAXP) | ||
139 | ); | ||
140 | if (code <= 0) | ||
141 | break; | ||
142 | code = min(code, (int) max); | ||
143 | buf += code; | ||
144 | max -= code; | ||
145 | |||
146 | if (is_cppi_enabled() && ep->current_epnum) { | ||
147 | unsigned cppi = ep->current_epnum - 1; | ||
148 | void __iomem *base = ep->musb->ctrl_base; | ||
149 | unsigned off1 = cppi << 2; | ||
150 | void __iomem *ram = base; | ||
151 | char tmp[16]; | ||
152 | |||
153 | if (ep->is_in) { | ||
154 | ram += DAVINCI_TXCPPI_STATERAM_OFFSET(cppi); | ||
155 | tmp[0] = 0; | ||
156 | } else { | ||
157 | ram += DAVINCI_RXCPPI_STATERAM_OFFSET(cppi); | ||
158 | snprintf(tmp, sizeof tmp, "%d left, ", | ||
159 | musb_readl(base, | ||
160 | DAVINCI_RXCPPI_BUFCNT0_REG + off1)); | ||
161 | } | ||
162 | |||
163 | code = snprintf(buf, max, "%cX DMA%d: %s" | ||
164 | "%08x %08x, %08x %08x; " | ||
165 | "%08x %08x %08x .. %08x\n", | ||
166 | ep->is_in ? 'T' : 'R', | ||
167 | ep->current_epnum - 1, tmp, | ||
168 | musb_readl(ram, 0 * 4), | ||
169 | musb_readl(ram, 1 * 4), | ||
170 | musb_readl(ram, 2 * 4), | ||
171 | musb_readl(ram, 3 * 4), | ||
172 | musb_readl(ram, 4 * 4), | ||
173 | musb_readl(ram, 5 * 4), | ||
174 | musb_readl(ram, 6 * 4), | ||
175 | musb_readl(ram, 7 * 4)); | ||
176 | if (code <= 0) | ||
177 | break; | ||
178 | code = min(code, (int) max); | ||
179 | buf += code; | ||
180 | max -= code; | ||
181 | } | ||
182 | |||
183 | if (list_empty(&ep->req_list)) { | ||
184 | code = snprintf(buf, max, "\t(queue empty)\n"); | ||
185 | if (code <= 0) | ||
186 | break; | ||
187 | code = min(code, (int) max); | ||
188 | buf += code; | ||
189 | max -= code; | ||
190 | break; | ||
191 | } | ||
192 | list_for_each_entry(req, &ep->req_list, list) { | ||
193 | code = snprintf(buf, max, "\treq %p, %s%s%d/%d\n", | ||
194 | req, | ||
195 | req->zero ? "zero, " : "", | ||
196 | req->short_not_ok ? "!short, " : "", | ||
197 | req->actual, req->length); | ||
198 | if (code <= 0) | ||
199 | break; | ||
200 | code = min(code, (int) max); | ||
201 | buf += code; | ||
202 | max -= code; | ||
203 | } | ||
204 | } while (0); | ||
205 | return buf - buffer; | ||
206 | } | ||
207 | #endif | ||
208 | |||
209 | static int | ||
210 | dump_end_info(struct musb *musb, u8 epnum, char *aBuffer, unsigned max) | ||
211 | { | ||
212 | int code = 0; | ||
213 | char *buf = aBuffer; | ||
214 | struct musb_hw_ep *hw_ep = &musb->endpoints[epnum]; | ||
215 | |||
216 | do { | ||
217 | musb_ep_select(musb->mregs, epnum); | ||
218 | #ifdef CONFIG_USB_MUSB_HDRC_HCD | ||
219 | if (is_host_active(musb)) { | ||
220 | int dump_rx, dump_tx; | ||
221 | void __iomem *regs = hw_ep->regs; | ||
222 | |||
223 | /* TEMPORARY (!) until we have a real periodic | ||
224 | * schedule tree ... | ||
225 | */ | ||
226 | if (!epnum) { | ||
227 | /* control is shared, uses RX queue | ||
228 | * but (mostly) shadowed tx registers | ||
229 | */ | ||
230 | dump_tx = !list_empty(&musb->control); | ||
231 | dump_rx = 0; | ||
232 | } else if (hw_ep == musb->bulk_ep) { | ||
233 | dump_tx = !list_empty(&musb->out_bulk); | ||
234 | dump_rx = !list_empty(&musb->in_bulk); | ||
235 | } else if (musb->periodic[epnum]) { | ||
236 | struct usb_host_endpoint *hep; | ||
237 | |||
238 | hep = musb->periodic[epnum]->hep; | ||
239 | dump_rx = hep->desc.bEndpointAddress | ||
240 | & USB_ENDPOINT_DIR_MASK; | ||
241 | dump_tx = !dump_rx; | ||
242 | } else | ||
243 | break; | ||
244 | /* END TEMPORARY */ | ||
245 | |||
246 | |||
247 | if (dump_rx) { | ||
248 | code = snprintf(buf, max, | ||
249 | "\nRX%d: %s rxcsr %04x interval %02x " | ||
250 | "max %04x type %02x; " | ||
251 | "dev %d hub %d port %d" | ||
252 | "\n", | ||
253 | epnum, | ||
254 | hw_ep->rx_double_buffered | ||
255 | ? "2buf" : "1buf", | ||
256 | musb_readw(regs, MUSB_RXCSR), | ||
257 | musb_readb(regs, MUSB_RXINTERVAL), | ||
258 | musb_readw(regs, MUSB_RXMAXP), | ||
259 | musb_readb(regs, MUSB_RXTYPE), | ||
260 | /* FIXME: assumes multipoint */ | ||
261 | musb_readb(musb->mregs, | ||
262 | MUSB_BUSCTL_OFFSET(epnum, | ||
263 | MUSB_RXFUNCADDR)), | ||
264 | musb_readb(musb->mregs, | ||
265 | MUSB_BUSCTL_OFFSET(epnum, | ||
266 | MUSB_RXHUBADDR)), | ||
267 | musb_readb(musb->mregs, | ||
268 | MUSB_BUSCTL_OFFSET(epnum, | ||
269 | MUSB_RXHUBPORT)) | ||
270 | ); | ||
271 | if (code <= 0) | ||
272 | break; | ||
273 | code = min(code, (int) max); | ||
274 | buf += code; | ||
275 | max -= code; | ||
276 | |||
277 | if (is_cppi_enabled() | ||
278 | && epnum | ||
279 | && hw_ep->rx_channel) { | ||
280 | unsigned cppi = epnum - 1; | ||
281 | unsigned off1 = cppi << 2; | ||
282 | void __iomem *base; | ||
283 | void __iomem *ram; | ||
284 | char tmp[16]; | ||
285 | |||
286 | base = musb->ctrl_base; | ||
287 | ram = DAVINCI_RXCPPI_STATERAM_OFFSET( | ||
288 | cppi) + base; | ||
289 | snprintf(tmp, sizeof tmp, "%d left, ", | ||
290 | musb_readl(base, | ||
291 | DAVINCI_RXCPPI_BUFCNT0_REG | ||
292 | + off1)); | ||
293 | |||
294 | code = snprintf(buf, max, | ||
295 | " rx dma%d: %s" | ||
296 | "%08x %08x, %08x %08x; " | ||
297 | "%08x %08x %08x .. %08x\n", | ||
298 | cppi, tmp, | ||
299 | musb_readl(ram, 0 * 4), | ||
300 | musb_readl(ram, 1 * 4), | ||
301 | musb_readl(ram, 2 * 4), | ||
302 | musb_readl(ram, 3 * 4), | ||
303 | musb_readl(ram, 4 * 4), | ||
304 | musb_readl(ram, 5 * 4), | ||
305 | musb_readl(ram, 6 * 4), | ||
306 | musb_readl(ram, 7 * 4)); | ||
307 | if (code <= 0) | ||
308 | break; | ||
309 | code = min(code, (int) max); | ||
310 | buf += code; | ||
311 | max -= code; | ||
312 | } | ||
313 | |||
314 | if (hw_ep == musb->bulk_ep | ||
315 | && !list_empty( | ||
316 | &musb->in_bulk)) { | ||
317 | code = dump_queue(&musb->in_bulk, | ||
318 | buf, max); | ||
319 | if (code <= 0) | ||
320 | break; | ||
321 | code = min(code, (int) max); | ||
322 | buf += code; | ||
323 | max -= code; | ||
324 | } else if (musb->periodic[epnum]) { | ||
325 | code = dump_qh(musb->periodic[epnum], | ||
326 | buf, max); | ||
327 | if (code <= 0) | ||
328 | break; | ||
329 | code = min(code, (int) max); | ||
330 | buf += code; | ||
331 | max -= code; | ||
332 | } | ||
333 | } | ||
334 | |||
335 | if (dump_tx) { | ||
336 | code = snprintf(buf, max, | ||
337 | "\nTX%d: %s txcsr %04x interval %02x " | ||
338 | "max %04x type %02x; " | ||
339 | "dev %d hub %d port %d" | ||
340 | "\n", | ||
341 | epnum, | ||
342 | hw_ep->tx_double_buffered | ||
343 | ? "2buf" : "1buf", | ||
344 | musb_readw(regs, MUSB_TXCSR), | ||
345 | musb_readb(regs, MUSB_TXINTERVAL), | ||
346 | musb_readw(regs, MUSB_TXMAXP), | ||
347 | musb_readb(regs, MUSB_TXTYPE), | ||
348 | /* FIXME: assumes multipoint */ | ||
349 | musb_readb(musb->mregs, | ||
350 | MUSB_BUSCTL_OFFSET(epnum, | ||
351 | MUSB_TXFUNCADDR)), | ||
352 | musb_readb(musb->mregs, | ||
353 | MUSB_BUSCTL_OFFSET(epnum, | ||
354 | MUSB_TXHUBADDR)), | ||
355 | musb_readb(musb->mregs, | ||
356 | MUSB_BUSCTL_OFFSET(epnum, | ||
357 | MUSB_TXHUBPORT)) | ||
358 | ); | ||
359 | if (code <= 0) | ||
360 | break; | ||
361 | code = min(code, (int) max); | ||
362 | buf += code; | ||
363 | max -= code; | ||
364 | |||
365 | if (is_cppi_enabled() | ||
366 | && epnum | ||
367 | && hw_ep->tx_channel) { | ||
368 | unsigned cppi = epnum - 1; | ||
369 | void __iomem *base; | ||
370 | void __iomem *ram; | ||
371 | |||
372 | base = musb->ctrl_base; | ||
373 | ram = DAVINCI_RXCPPI_STATERAM_OFFSET( | ||
374 | cppi) + base; | ||
375 | code = snprintf(buf, max, | ||
376 | " tx dma%d: " | ||
377 | "%08x %08x, %08x %08x; " | ||
378 | "%08x %08x %08x .. %08x\n", | ||
379 | cppi, | ||
380 | musb_readl(ram, 0 * 4), | ||
381 | musb_readl(ram, 1 * 4), | ||
382 | musb_readl(ram, 2 * 4), | ||
383 | musb_readl(ram, 3 * 4), | ||
384 | musb_readl(ram, 4 * 4), | ||
385 | musb_readl(ram, 5 * 4), | ||
386 | musb_readl(ram, 6 * 4), | ||
387 | musb_readl(ram, 7 * 4)); | ||
388 | if (code <= 0) | ||
389 | break; | ||
390 | code = min(code, (int) max); | ||
391 | buf += code; | ||
392 | max -= code; | ||
393 | } | ||
394 | |||
395 | if (hw_ep == musb->control_ep | ||
396 | && !list_empty( | ||
397 | &musb->control)) { | ||
398 | code = dump_queue(&musb->control, | ||
399 | buf, max); | ||
400 | if (code <= 0) | ||
401 | break; | ||
402 | code = min(code, (int) max); | ||
403 | buf += code; | ||
404 | max -= code; | ||
405 | } else if (hw_ep == musb->bulk_ep | ||
406 | && !list_empty( | ||
407 | &musb->out_bulk)) { | ||
408 | code = dump_queue(&musb->out_bulk, | ||
409 | buf, max); | ||
410 | if (code <= 0) | ||
411 | break; | ||
412 | code = min(code, (int) max); | ||
413 | buf += code; | ||
414 | max -= code; | ||
415 | } else if (musb->periodic[epnum]) { | ||
416 | code = dump_qh(musb->periodic[epnum], | ||
417 | buf, max); | ||
418 | if (code <= 0) | ||
419 | break; | ||
420 | code = min(code, (int) max); | ||
421 | buf += code; | ||
422 | max -= code; | ||
423 | } | ||
424 | } | ||
425 | } | ||
426 | #endif | ||
427 | #ifdef CONFIG_USB_GADGET_MUSB_HDRC | ||
428 | if (is_peripheral_active(musb)) { | ||
429 | code = 0; | ||
430 | |||
431 | if (hw_ep->ep_in.desc || !epnum) { | ||
432 | code = dump_ep(&hw_ep->ep_in, buf, max); | ||
433 | if (code <= 0) | ||
434 | break; | ||
435 | code = min(code, (int) max); | ||
436 | buf += code; | ||
437 | max -= code; | ||
438 | } | ||
439 | if (hw_ep->ep_out.desc) { | ||
440 | code = dump_ep(&hw_ep->ep_out, buf, max); | ||
441 | if (code <= 0) | ||
442 | break; | ||
443 | code = min(code, (int) max); | ||
444 | buf += code; | ||
445 | max -= code; | ||
446 | } | ||
447 | } | ||
448 | #endif | ||
449 | } while (0); | ||
450 | |||
451 | return buf - aBuffer; | ||
452 | } | ||
453 | |||
454 | /* Dump the current status and compile options. | ||
455 | * @param musb the device driver instance | ||
456 | * @param buffer where to dump the status; it must be big enough to hold the | ||
457 | * result otherwise "BAD THINGS HAPPENS(TM)". | ||
458 | */ | ||
459 | static int dump_header_stats(struct musb *musb, char *buffer) | ||
460 | { | ||
461 | int code, count = 0; | ||
462 | const void __iomem *mbase = musb->mregs; | ||
463 | |||
464 | *buffer = 0; | ||
465 | count = sprintf(buffer, "Status: %sHDRC, Mode=%s " | ||
466 | "(Power=%02x, DevCtl=%02x)\n", | ||
467 | (musb->is_multipoint ? "M" : ""), MUSB_MODE(musb), | ||
468 | musb_readb(mbase, MUSB_POWER), | ||
469 | musb_readb(mbase, MUSB_DEVCTL)); | ||
470 | if (count <= 0) | ||
471 | return 0; | ||
472 | buffer += count; | ||
473 | |||
474 | code = sprintf(buffer, "OTG state: %s; %sactive\n", | ||
475 | otg_state_string(musb), | ||
476 | musb->is_active ? "" : "in"); | ||
477 | if (code <= 0) | ||
478 | goto done; | ||
479 | buffer += code; | ||
480 | count += code; | ||
481 | |||
482 | code = sprintf(buffer, | ||
483 | "Options: " | ||
484 | #ifdef CONFIG_MUSB_PIO_ONLY | ||
485 | "pio" | ||
486 | #elif defined(CONFIG_USB_TI_CPPI_DMA) | ||
487 | "cppi-dma" | ||
488 | #elif defined(CONFIG_USB_INVENTRA_DMA) | ||
489 | "musb-dma" | ||
490 | #elif defined(CONFIG_USB_TUSB_OMAP_DMA) | ||
491 | "tusb-omap-dma" | ||
492 | #else | ||
493 | "?dma?" | ||
494 | #endif | ||
495 | ", " | ||
496 | #ifdef CONFIG_USB_MUSB_OTG | ||
497 | "otg (peripheral+host)" | ||
498 | #elif defined(CONFIG_USB_GADGET_MUSB_HDRC) | ||
499 | "peripheral" | ||
500 | #elif defined(CONFIG_USB_MUSB_HDRC_HCD) | ||
501 | "host" | ||
502 | #endif | ||
503 | ", debug=%d [eps=%d]\n", | ||
504 | debug, | ||
505 | musb->nr_endpoints); | ||
506 | if (code <= 0) | ||
507 | goto done; | ||
508 | count += code; | ||
509 | buffer += code; | ||
510 | |||
511 | #ifdef CONFIG_USB_GADGET_MUSB_HDRC | ||
512 | code = sprintf(buffer, "Peripheral address: %02x\n", | ||
513 | musb_readb(musb->ctrl_base, MUSB_FADDR)); | ||
514 | if (code <= 0) | ||
515 | goto done; | ||
516 | buffer += code; | ||
517 | count += code; | ||
518 | #endif | ||
519 | |||
520 | #ifdef CONFIG_USB_MUSB_HDRC_HCD | ||
521 | code = sprintf(buffer, "Root port status: %08x\n", | ||
522 | musb->port1_status); | ||
523 | if (code <= 0) | ||
524 | goto done; | ||
525 | buffer += code; | ||
526 | count += code; | ||
527 | #endif | ||
528 | |||
529 | #ifdef CONFIG_ARCH_DAVINCI | ||
530 | code = sprintf(buffer, | ||
531 | "DaVinci: ctrl=%02x stat=%1x phy=%03x\n" | ||
532 | "\trndis=%05x auto=%04x intsrc=%08x intmsk=%08x" | ||
533 | "\n", | ||
534 | musb_readl(musb->ctrl_base, DAVINCI_USB_CTRL_REG), | ||
535 | musb_readl(musb->ctrl_base, DAVINCI_USB_STAT_REG), | ||
536 | __raw_readl((void __force __iomem *) | ||
537 | IO_ADDRESS(USBPHY_CTL_PADDR)), | ||
538 | musb_readl(musb->ctrl_base, DAVINCI_RNDIS_REG), | ||
539 | musb_readl(musb->ctrl_base, DAVINCI_AUTOREQ_REG), | ||
540 | musb_readl(musb->ctrl_base, | ||
541 | DAVINCI_USB_INT_SOURCE_REG), | ||
542 | musb_readl(musb->ctrl_base, | ||
543 | DAVINCI_USB_INT_MASK_REG)); | ||
544 | if (code <= 0) | ||
545 | goto done; | ||
546 | count += code; | ||
547 | buffer += code; | ||
548 | #endif /* DAVINCI */ | ||
549 | |||
550 | #ifdef CONFIG_USB_TUSB6010 | ||
551 | code = sprintf(buffer, | ||
552 | "TUSB6010: devconf %08x, phy enable %08x drive %08x" | ||
553 | "\n\totg %03x timer %08x" | ||
554 | "\n\tprcm conf %08x mgmt %08x; int src %08x mask %08x" | ||
555 | "\n", | ||
556 | musb_readl(musb->ctrl_base, TUSB_DEV_CONF), | ||
557 | musb_readl(musb->ctrl_base, TUSB_PHY_OTG_CTRL_ENABLE), | ||
558 | musb_readl(musb->ctrl_base, TUSB_PHY_OTG_CTRL), | ||
559 | musb_readl(musb->ctrl_base, TUSB_DEV_OTG_STAT), | ||
560 | musb_readl(musb->ctrl_base, TUSB_DEV_OTG_TIMER), | ||
561 | musb_readl(musb->ctrl_base, TUSB_PRCM_CONF), | ||
562 | musb_readl(musb->ctrl_base, TUSB_PRCM_MNGMT), | ||
563 | musb_readl(musb->ctrl_base, TUSB_INT_SRC), | ||
564 | musb_readl(musb->ctrl_base, TUSB_INT_MASK)); | ||
565 | if (code <= 0) | ||
566 | goto done; | ||
567 | count += code; | ||
568 | buffer += code; | ||
569 | #endif /* DAVINCI */ | ||
570 | |||
571 | if (is_cppi_enabled() && musb->dma_controller) { | ||
572 | code = sprintf(buffer, | ||
573 | "CPPI: txcr=%d txsrc=%01x txena=%01x; " | ||
574 | "rxcr=%d rxsrc=%01x rxena=%01x " | ||
575 | "\n", | ||
576 | musb_readl(musb->ctrl_base, | ||
577 | DAVINCI_TXCPPI_CTRL_REG), | ||
578 | musb_readl(musb->ctrl_base, | ||
579 | DAVINCI_TXCPPI_RAW_REG), | ||
580 | musb_readl(musb->ctrl_base, | ||
581 | DAVINCI_TXCPPI_INTENAB_REG), | ||
582 | musb_readl(musb->ctrl_base, | ||
583 | DAVINCI_RXCPPI_CTRL_REG), | ||
584 | musb_readl(musb->ctrl_base, | ||
585 | DAVINCI_RXCPPI_RAW_REG), | ||
586 | musb_readl(musb->ctrl_base, | ||
587 | DAVINCI_RXCPPI_INTENAB_REG)); | ||
588 | if (code <= 0) | ||
589 | goto done; | ||
590 | count += code; | ||
591 | buffer += code; | ||
592 | } | ||
593 | |||
594 | #ifdef CONFIG_USB_GADGET_MUSB_HDRC | ||
595 | if (is_peripheral_enabled(musb)) { | ||
596 | code = sprintf(buffer, "Gadget driver: %s\n", | ||
597 | musb->gadget_driver | ||
598 | ? musb->gadget_driver->driver.name | ||
599 | : "(none)"); | ||
600 | if (code <= 0) | ||
601 | goto done; | ||
602 | count += code; | ||
603 | buffer += code; | ||
604 | } | ||
605 | #endif | ||
606 | |||
607 | done: | ||
608 | return count; | ||
609 | } | ||
610 | |||
611 | /* Write to ProcFS | ||
612 | * | ||
613 | * C soft-connect | ||
614 | * c soft-disconnect | ||
615 | * I enable HS | ||
616 | * i disable HS | ||
617 | * s stop session | ||
618 | * F force session (OTG-unfriendly) | ||
619 | * E rElinquish bus (OTG) | ||
620 | * H request host mode | ||
621 | * h cancel host request | ||
622 | * T start sending TEST_PACKET | ||
623 | * D<num> set/query the debug level | ||
624 | */ | ||
625 | static int musb_proc_write(struct file *file, const char __user *buffer, | ||
626 | unsigned long count, void *data) | ||
627 | { | ||
628 | char cmd; | ||
629 | u8 reg; | ||
630 | struct musb *musb = (struct musb *)data; | ||
631 | void __iomem *mbase = musb->mregs; | ||
632 | |||
633 | /* MOD_INC_USE_COUNT; */ | ||
634 | |||
635 | if (unlikely(copy_from_user(&cmd, buffer, 1))) | ||
636 | return -EFAULT; | ||
637 | |||
638 | switch (cmd) { | ||
639 | case 'C': | ||
640 | if (mbase) { | ||
641 | reg = musb_readb(mbase, MUSB_POWER) | ||
642 | | MUSB_POWER_SOFTCONN; | ||
643 | musb_writeb(mbase, MUSB_POWER, reg); | ||
644 | } | ||
645 | break; | ||
646 | |||
647 | case 'c': | ||
648 | if (mbase) { | ||
649 | reg = musb_readb(mbase, MUSB_POWER) | ||
650 | & ~MUSB_POWER_SOFTCONN; | ||
651 | musb_writeb(mbase, MUSB_POWER, reg); | ||
652 | } | ||
653 | break; | ||
654 | |||
655 | case 'I': | ||
656 | if (mbase) { | ||
657 | reg = musb_readb(mbase, MUSB_POWER) | ||
658 | | MUSB_POWER_HSENAB; | ||
659 | musb_writeb(mbase, MUSB_POWER, reg); | ||
660 | } | ||
661 | break; | ||
662 | |||
663 | case 'i': | ||
664 | if (mbase) { | ||
665 | reg = musb_readb(mbase, MUSB_POWER) | ||
666 | & ~MUSB_POWER_HSENAB; | ||
667 | musb_writeb(mbase, MUSB_POWER, reg); | ||
668 | } | ||
669 | break; | ||
670 | |||
671 | case 'F': | ||
672 | reg = musb_readb(mbase, MUSB_DEVCTL); | ||
673 | reg |= MUSB_DEVCTL_SESSION; | ||
674 | musb_writeb(mbase, MUSB_DEVCTL, reg); | ||
675 | break; | ||
676 | |||
677 | case 'H': | ||
678 | if (mbase) { | ||
679 | reg = musb_readb(mbase, MUSB_DEVCTL); | ||
680 | reg |= MUSB_DEVCTL_HR; | ||
681 | musb_writeb(mbase, MUSB_DEVCTL, reg); | ||
682 | /* MUSB_HST_MODE( ((struct musb*)data) ); */ | ||
683 | /* WARNING("Host Mode\n"); */ | ||
684 | } | ||
685 | break; | ||
686 | |||
687 | case 'h': | ||
688 | if (mbase) { | ||
689 | reg = musb_readb(mbase, MUSB_DEVCTL); | ||
690 | reg &= ~MUSB_DEVCTL_HR; | ||
691 | musb_writeb(mbase, MUSB_DEVCTL, reg); | ||
692 | } | ||
693 | break; | ||
694 | |||
695 | case 'T': | ||
696 | if (mbase) { | ||
697 | musb_load_testpacket(musb); | ||
698 | musb_writeb(mbase, MUSB_TESTMODE, | ||
699 | MUSB_TEST_PACKET); | ||
700 | } | ||
701 | break; | ||
702 | |||
703 | #if (MUSB_DEBUG > 0) | ||
704 | /* set/read debug level */ | ||
705 | case 'D':{ | ||
706 | if (count > 1) { | ||
707 | char digits[8], *p = digits; | ||
708 | int i = 0, level = 0, sign = 1; | ||
709 | int len = min(count - 1, (unsigned long)8); | ||
710 | |||
711 | if (copy_from_user(&digits, &buffer[1], len)) | ||
712 | return -EFAULT; | ||
713 | |||
714 | /* optional sign */ | ||
715 | if (*p == '-') { | ||
716 | len -= 1; | ||
717 | sign = -sign; | ||
718 | p++; | ||
719 | } | ||
720 | |||
721 | /* read it */ | ||
722 | while (i++ < len && *p > '0' && *p < '9') { | ||
723 | level = level * 10 + (*p - '0'); | ||
724 | p++; | ||
725 | } | ||
726 | |||
727 | level *= sign; | ||
728 | DBG(1, "debug level %d\n", level); | ||
729 | debug = level; | ||
730 | } | ||
731 | } | ||
732 | break; | ||
733 | |||
734 | |||
735 | case '?': | ||
736 | INFO("?: you are seeing it\n"); | ||
737 | INFO("C/c: soft connect enable/disable\n"); | ||
738 | INFO("I/i: hispeed enable/disable\n"); | ||
739 | INFO("F: force session start\n"); | ||
740 | INFO("H: host mode\n"); | ||
741 | INFO("T: start sending TEST_PACKET\n"); | ||
742 | INFO("D: set/read dbug level\n"); | ||
743 | break; | ||
744 | #endif | ||
745 | |||
746 | default: | ||
747 | ERR("Command %c not implemented\n", cmd); | ||
748 | break; | ||
749 | } | ||
750 | |||
751 | musb_platform_try_idle(musb, 0); | ||
752 | |||
753 | return count; | ||
754 | } | ||
755 | |||
756 | static int musb_proc_read(char *page, char **start, | ||
757 | off_t off, int count, int *eof, void *data) | ||
758 | { | ||
759 | char *buffer = page; | ||
760 | int code = 0; | ||
761 | unsigned long flags; | ||
762 | struct musb *musb = data; | ||
763 | unsigned epnum; | ||
764 | |||
765 | count -= off; | ||
766 | count -= 1; /* for NUL at end */ | ||
767 | if (count <= 0) | ||
768 | return -EINVAL; | ||
769 | |||
770 | spin_lock_irqsave(&musb->lock, flags); | ||
771 | |||
772 | code = dump_header_stats(musb, buffer); | ||
773 | if (code > 0) { | ||
774 | buffer += code; | ||
775 | count -= code; | ||
776 | } | ||
777 | |||
778 | /* generate the report for the end points */ | ||
779 | /* REVISIT ... not unless something's connected! */ | ||
780 | for (epnum = 0; count >= 0 && epnum < musb->nr_endpoints; | ||
781 | epnum++) { | ||
782 | code = dump_end_info(musb, epnum, buffer, count); | ||
783 | if (code > 0) { | ||
784 | buffer += code; | ||
785 | count -= code; | ||
786 | } | ||
787 | } | ||
788 | |||
789 | musb_platform_try_idle(musb, 0); | ||
790 | |||
791 | spin_unlock_irqrestore(&musb->lock, flags); | ||
792 | *eof = 1; | ||
793 | |||
794 | return buffer - page; | ||
795 | } | ||
796 | |||
797 | void __devexit musb_debug_delete(char *name, struct musb *musb) | ||
798 | { | ||
799 | if (musb->proc_entry) | ||
800 | remove_proc_entry(name, NULL); | ||
801 | } | ||
802 | |||
803 | struct proc_dir_entry *__init | ||
804 | musb_debug_create(char *name, struct musb *data) | ||
805 | { | ||
806 | struct proc_dir_entry *pde; | ||
807 | |||
808 | /* FIXME convert everything to seq_file; then later, debugfs */ | ||
809 | |||
810 | if (!name) | ||
811 | return NULL; | ||
812 | |||
813 | pde = create_proc_entry(name, S_IFREG | S_IRUGO | S_IWUSR, NULL); | ||
814 | data->proc_entry = pde; | ||
815 | if (pde) { | ||
816 | pde->data = data; | ||
817 | /* pde->owner = THIS_MODULE; */ | ||
818 | |||
819 | pde->read_proc = musb_proc_read; | ||
820 | pde->write_proc = musb_proc_write; | ||
821 | |||
822 | pde->size = 0; | ||
823 | |||
824 | pr_debug("Registered /proc/%s\n", name); | ||
825 | } else { | ||
826 | pr_debug("Cannot create a valid proc file entry"); | ||
827 | } | ||
828 | |||
829 | return pde; | ||
830 | } | ||
diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c index e143198aeb02..9f9cd36455f4 100644 --- a/drivers/usb/serial/option.c +++ b/drivers/usb/serial/option.c | |||
@@ -173,6 +173,7 @@ static int option_send_setup(struct tty_struct *tty, struct usb_serial_port *po | |||
173 | #define KYOCERA_PRODUCT_KPC680 0x180a | 173 | #define KYOCERA_PRODUCT_KPC680 0x180a |
174 | 174 | ||
175 | #define ANYDATA_VENDOR_ID 0x16d5 | 175 | #define ANYDATA_VENDOR_ID 0x16d5 |
176 | #define ANYDATA_PRODUCT_ADU_620UW 0x6202 | ||
176 | #define ANYDATA_PRODUCT_ADU_E100A 0x6501 | 177 | #define ANYDATA_PRODUCT_ADU_E100A 0x6501 |
177 | #define ANYDATA_PRODUCT_ADU_500A 0x6502 | 178 | #define ANYDATA_PRODUCT_ADU_500A 0x6502 |
178 | 179 | ||
@@ -318,6 +319,7 @@ static struct usb_device_id option_ids[] = { | |||
318 | { USB_DEVICE(DELL_VENDOR_ID, 0x8138) }, /* Dell Wireless 5520 Voda I Mobile Broadband (3G HSDPA) Minicard */ | 319 | { USB_DEVICE(DELL_VENDOR_ID, 0x8138) }, /* Dell Wireless 5520 Voda I Mobile Broadband (3G HSDPA) Minicard */ |
319 | { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_E100A) }, | 320 | { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_E100A) }, |
320 | { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_500A) }, | 321 | { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_500A) }, |
322 | { USB_DEVICE(ANYDATA_VENDOR_ID, ANYDATA_PRODUCT_ADU_620UW) }, | ||
321 | { USB_DEVICE(AXESSTEL_VENDOR_ID, AXESSTEL_PRODUCT_MV110H) }, | 323 | { USB_DEVICE(AXESSTEL_VENDOR_ID, AXESSTEL_PRODUCT_MV110H) }, |
322 | { USB_DEVICE(ONDA_VENDOR_ID, ONDA_PRODUCT_MSA501HS) }, | 324 | { USB_DEVICE(ONDA_VENDOR_ID, ONDA_PRODUCT_MSA501HS) }, |
323 | { USB_DEVICE(ONDA_VENDOR_ID, ONDA_PRODUCT_ET502HS) }, | 325 | { USB_DEVICE(ONDA_VENDOR_ID, ONDA_PRODUCT_ET502HS) }, |
diff --git a/include/asm-x86/genapic_32.h b/include/asm-x86/genapic_32.h index b02ea6e17de8..754d635f90ff 100644 --- a/include/asm-x86/genapic_32.h +++ b/include/asm-x86/genapic_32.h | |||
@@ -118,6 +118,7 @@ enum uv_system_type {UV_NONE, UV_LEGACY_APIC, UV_X2APIC, UV_NON_UNIQUE_APIC}; | |||
118 | #define get_uv_system_type() UV_NONE | 118 | #define get_uv_system_type() UV_NONE |
119 | #define is_uv_system() 0 | 119 | #define is_uv_system() 0 |
120 | #define uv_wakeup_secondary(a, b) 1 | 120 | #define uv_wakeup_secondary(a, b) 1 |
121 | #define uv_system_init() do {} while (0) | ||
121 | 122 | ||
122 | 123 | ||
123 | #endif | 124 | #endif |
diff --git a/include/asm-x86/genapic_64.h b/include/asm-x86/genapic_64.h index 0f8504627c41..a47d63129135 100644 --- a/include/asm-x86/genapic_64.h +++ b/include/asm-x86/genapic_64.h | |||
@@ -42,6 +42,7 @@ extern int is_uv_system(void); | |||
42 | extern struct genapic apic_x2apic_uv_x; | 42 | extern struct genapic apic_x2apic_uv_x; |
43 | DECLARE_PER_CPU(int, x2apic_extra_bits); | 43 | DECLARE_PER_CPU(int, x2apic_extra_bits); |
44 | extern void uv_cpu_init(void); | 44 | extern void uv_cpu_init(void); |
45 | extern void uv_system_init(void); | ||
45 | extern int uv_wakeup_secondary(int phys_apicid, unsigned int start_rip); | 46 | extern int uv_wakeup_secondary(int phys_apicid, unsigned int start_rip); |
46 | 47 | ||
47 | extern void setup_apic_routing(void); | 48 | extern void setup_apic_routing(void); |
diff --git a/include/asm-x86/irq_vectors.h b/include/asm-x86/irq_vectors.h index b95d167b7fb2..a48c7f2dbdc0 100644 --- a/include/asm-x86/irq_vectors.h +++ b/include/asm-x86/irq_vectors.h | |||
@@ -76,6 +76,7 @@ | |||
76 | #define CALL_FUNCTION_SINGLE_VECTOR 0xfb | 76 | #define CALL_FUNCTION_SINGLE_VECTOR 0xfb |
77 | #define THERMAL_APIC_VECTOR 0xfa | 77 | #define THERMAL_APIC_VECTOR 0xfa |
78 | #define THRESHOLD_APIC_VECTOR 0xf9 | 78 | #define THRESHOLD_APIC_VECTOR 0xf9 |
79 | #define UV_BAU_MESSAGE 0xf8 | ||
79 | #define INVALIDATE_TLB_VECTOR_END 0xf7 | 80 | #define INVALIDATE_TLB_VECTOR_END 0xf7 |
80 | #define INVALIDATE_TLB_VECTOR_START 0xf0 /* f0-f7 used for TLB flush */ | 81 | #define INVALIDATE_TLB_VECTOR_START 0xf0 /* f0-f7 used for TLB flush */ |
81 | 82 | ||
diff --git a/include/asm-x86/uv/uv_bau.h b/include/asm-x86/uv/uv_bau.h index 91ac0dfb7588..610b6b308e93 100644 --- a/include/asm-x86/uv/uv_bau.h +++ b/include/asm-x86/uv/uv_bau.h | |||
@@ -40,11 +40,6 @@ | |||
40 | #define UV_ACTIVATION_DESCRIPTOR_SIZE 32 | 40 | #define UV_ACTIVATION_DESCRIPTOR_SIZE 32 |
41 | #define UV_DISTRIBUTION_SIZE 256 | 41 | #define UV_DISTRIBUTION_SIZE 256 |
42 | #define UV_SW_ACK_NPENDING 8 | 42 | #define UV_SW_ACK_NPENDING 8 |
43 | #define UV_BAU_MESSAGE 200 | ||
44 | /* | ||
45 | * Messaging irq; see irq_64.h and include/asm-x86/hw_irq_64.h | ||
46 | * To be dynamically allocated in the future | ||
47 | */ | ||
48 | #define UV_NET_ENDPOINT_INTD 0x38 | 43 | #define UV_NET_ENDPOINT_INTD 0x38 |
49 | #define UV_DESC_BASE_PNODE_SHIFT 49 | 44 | #define UV_DESC_BASE_PNODE_SHIFT 49 |
50 | #define UV_PAYLOADQ_PNODE_SHIFT 49 | 45 | #define UV_PAYLOADQ_PNODE_SHIFT 49 |
diff --git a/include/linux/device.h b/include/linux/device.h index d24a47f80f9c..4d8372d135df 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -358,6 +358,7 @@ struct device { | |||
358 | 358 | ||
359 | struct kobject kobj; | 359 | struct kobject kobj; |
360 | char bus_id[BUS_ID_SIZE]; /* position on parent bus */ | 360 | char bus_id[BUS_ID_SIZE]; /* position on parent bus */ |
361 | const char *init_name; /* initial name of the device */ | ||
361 | struct device_type *type; | 362 | struct device_type *type; |
362 | unsigned uevent_suppress:1; | 363 | unsigned uevent_suppress:1; |
363 | 364 | ||
@@ -406,7 +407,7 @@ struct device { | |||
406 | /* Get the wakeup routines, which depend on struct device */ | 407 | /* Get the wakeup routines, which depend on struct device */ |
407 | #include <linux/pm_wakeup.h> | 408 | #include <linux/pm_wakeup.h> |
408 | 409 | ||
409 | static inline const char *dev_name(struct device *dev) | 410 | static inline const char *dev_name(const struct device *dev) |
410 | { | 411 | { |
411 | /* will be changed into kobject_name(&dev->kobj) in the near future */ | 412 | /* will be changed into kobject_name(&dev->kobj) in the near future */ |
412 | return dev->bus_id; | 413 | return dev->bus_id; |
@@ -518,7 +519,7 @@ extern void device_shutdown(void); | |||
518 | extern void sysdev_shutdown(void); | 519 | extern void sysdev_shutdown(void); |
519 | 520 | ||
520 | /* debugging and troubleshooting/diagnostic helpers. */ | 521 | /* debugging and troubleshooting/diagnostic helpers. */ |
521 | extern const char *dev_driver_string(struct device *dev); | 522 | extern const char *dev_driver_string(const struct device *dev); |
522 | #define dev_printk(level, dev, format, arg...) \ | 523 | #define dev_printk(level, dev, format, arg...) \ |
523 | printk(level "%s %s: " format , dev_driver_string(dev) , \ | 524 | printk(level "%s %s: " format , dev_driver_string(dev) , \ |
524 | dev_name(dev) , ## arg) | 525 | dev_name(dev) , ## arg) |
diff --git a/include/linux/libata.h b/include/linux/libata.h index 06b80337303b..225bfc5bd9ec 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -163,6 +163,7 @@ enum { | |||
163 | ATA_DEV_NONE = 9, /* no device */ | 163 | ATA_DEV_NONE = 9, /* no device */ |
164 | 164 | ||
165 | /* struct ata_link flags */ | 165 | /* struct ata_link flags */ |
166 | ATA_LFLAG_NO_HRST = (1 << 1), /* avoid hardreset */ | ||
166 | ATA_LFLAG_NO_SRST = (1 << 2), /* avoid softreset */ | 167 | ATA_LFLAG_NO_SRST = (1 << 2), /* avoid softreset */ |
167 | ATA_LFLAG_ASSUME_ATA = (1 << 3), /* assume ATA class */ | 168 | ATA_LFLAG_ASSUME_ATA = (1 << 3), /* assume ATA class */ |
168 | ATA_LFLAG_ASSUME_SEMB = (1 << 4), /* assume SEMB class */ | 169 | ATA_LFLAG_ASSUME_SEMB = (1 << 4), /* assume SEMB class */ |
@@ -646,6 +647,7 @@ struct ata_link { | |||
646 | 647 | ||
647 | unsigned int flags; /* ATA_LFLAG_xxx */ | 648 | unsigned int flags; /* ATA_LFLAG_xxx */ |
648 | 649 | ||
650 | u32 saved_scontrol; /* SControl on probe */ | ||
649 | unsigned int hw_sata_spd_limit; | 651 | unsigned int hw_sata_spd_limit; |
650 | unsigned int sata_spd_limit; | 652 | unsigned int sata_spd_limit; |
651 | unsigned int sata_spd; /* current SATA PHY speed */ | 653 | unsigned int sata_spd; /* current SATA PHY speed */ |
@@ -1427,6 +1429,28 @@ static inline unsigned long ata_deadline(unsigned long from_jiffies, | |||
1427 | return from_jiffies + msecs_to_jiffies(timeout_msecs); | 1429 | return from_jiffies + msecs_to_jiffies(timeout_msecs); |
1428 | } | 1430 | } |
1429 | 1431 | ||
1432 | /* Don't open code these in drivers as there are traps. Firstly the range may | ||
1433 | change in future hardware and specs, secondly 0xFF means 'no DMA' but is | ||
1434 | > UDMA_0. Dyma ddreigiau */ | ||
1435 | |||
1436 | static inline int ata_using_mwdma(struct ata_device *adev) | ||
1437 | { | ||
1438 | if (adev->dma_mode >= XFER_MW_DMA_0 && adev->dma_mode <= XFER_MW_DMA_4) | ||
1439 | return 1; | ||
1440 | return 0; | ||
1441 | } | ||
1442 | |||
1443 | static inline int ata_using_udma(struct ata_device *adev) | ||
1444 | { | ||
1445 | if (adev->dma_mode >= XFER_UDMA_0 && adev->dma_mode <= XFER_UDMA_7) | ||
1446 | return 1; | ||
1447 | return 0; | ||
1448 | } | ||
1449 | |||
1450 | static inline int ata_dma_enabled(struct ata_device *adev) | ||
1451 | { | ||
1452 | return (adev->dma_mode == 0xFF ? 0 : 1); | ||
1453 | } | ||
1430 | 1454 | ||
1431 | /************************************************************************** | 1455 | /************************************************************************** |
1432 | * PMP - drivers/ata/libata-pmp.c | 1456 | * PMP - drivers/ata/libata-pmp.c |
diff --git a/include/linux/tick.h b/include/linux/tick.h index d3c02695dc5d..8cf8cfe2cc97 100644 --- a/include/linux/tick.h +++ b/include/linux/tick.h | |||
@@ -74,10 +74,13 @@ extern struct tick_device *tick_get_device(int cpu); | |||
74 | extern int tick_init_highres(void); | 74 | extern int tick_init_highres(void); |
75 | extern int tick_program_event(ktime_t expires, int force); | 75 | extern int tick_program_event(ktime_t expires, int force); |
76 | extern void tick_setup_sched_timer(void); | 76 | extern void tick_setup_sched_timer(void); |
77 | # endif | ||
78 | |||
79 | # if defined CONFIG_NO_HZ || defined CONFIG_HIGH_RES_TIMERS | ||
77 | extern void tick_cancel_sched_timer(int cpu); | 80 | extern void tick_cancel_sched_timer(int cpu); |
78 | # else | 81 | # else |
79 | static inline void tick_cancel_sched_timer(int cpu) { } | 82 | static inline void tick_cancel_sched_timer(int cpu) { } |
80 | # endif /* HIGHRES */ | 83 | # endif |
81 | 84 | ||
82 | # ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST | 85 | # ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST |
83 | extern struct tick_device *tick_get_broadcast_device(void); | 86 | extern struct tick_device *tick_get_broadcast_device(void); |
diff --git a/include/linux/usb.h b/include/linux/usb.h index 0924cd9c30f6..94ac74aba6b6 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -110,6 +110,8 @@ enum usb_interface_condition { | |||
110 | * @sysfs_files_created: sysfs attributes exist | 110 | * @sysfs_files_created: sysfs attributes exist |
111 | * @needs_remote_wakeup: flag set when the driver requires remote-wakeup | 111 | * @needs_remote_wakeup: flag set when the driver requires remote-wakeup |
112 | * capability during autosuspend. | 112 | * capability during autosuspend. |
113 | * @needs_altsetting0: flag set when a set-interface request for altsetting 0 | ||
114 | * has been deferred. | ||
113 | * @needs_binding: flag set when the driver should be re-probed or unbound | 115 | * @needs_binding: flag set when the driver should be re-probed or unbound |
114 | * following a reset or suspend operation it doesn't support. | 116 | * following a reset or suspend operation it doesn't support. |
115 | * @dev: driver model's view of this device | 117 | * @dev: driver model's view of this device |
@@ -162,6 +164,7 @@ struct usb_interface { | |||
162 | unsigned is_active:1; /* the interface is not suspended */ | 164 | unsigned is_active:1; /* the interface is not suspended */ |
163 | unsigned sysfs_files_created:1; /* the sysfs attributes exist */ | 165 | unsigned sysfs_files_created:1; /* the sysfs attributes exist */ |
164 | unsigned needs_remote_wakeup:1; /* driver requires remote wakeup */ | 166 | unsigned needs_remote_wakeup:1; /* driver requires remote wakeup */ |
167 | unsigned needs_altsetting0:1; /* switch to altsetting 0 is pending */ | ||
165 | unsigned needs_binding:1; /* needs delayed unbind/rebind */ | 168 | unsigned needs_binding:1; /* needs delayed unbind/rebind */ |
166 | 169 | ||
167 | struct device dev; /* interface specific device info */ | 170 | struct device dev; /* interface specific device info */ |
diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c index f5da526424a9..7a46bde78c66 100644 --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c | |||
@@ -643,17 +643,21 @@ void tick_setup_sched_timer(void) | |||
643 | ts->nohz_mode = NOHZ_MODE_HIGHRES; | 643 | ts->nohz_mode = NOHZ_MODE_HIGHRES; |
644 | #endif | 644 | #endif |
645 | } | 645 | } |
646 | #endif /* HIGH_RES_TIMERS */ | ||
646 | 647 | ||
648 | #if defined CONFIG_NO_HZ || defined CONFIG_HIGH_RES_TIMERS | ||
647 | void tick_cancel_sched_timer(int cpu) | 649 | void tick_cancel_sched_timer(int cpu) |
648 | { | 650 | { |
649 | struct tick_sched *ts = &per_cpu(tick_cpu_sched, cpu); | 651 | struct tick_sched *ts = &per_cpu(tick_cpu_sched, cpu); |
650 | 652 | ||
653 | # ifdef CONFIG_HIGH_RES_TIMERS | ||
651 | if (ts->sched_timer.base) | 654 | if (ts->sched_timer.base) |
652 | hrtimer_cancel(&ts->sched_timer); | 655 | hrtimer_cancel(&ts->sched_timer); |
656 | # endif | ||
653 | 657 | ||
654 | ts->nohz_mode = NOHZ_MODE_INACTIVE; | 658 | ts->nohz_mode = NOHZ_MODE_INACTIVE; |
655 | } | 659 | } |
656 | #endif /* HIGH_RES_TIMERS */ | 660 | #endif |
657 | 661 | ||
658 | /** | 662 | /** |
659 | * Async notification about clocksource changes | 663 | * Async notification about clocksource changes |
diff --git a/lib/kobject.c b/lib/kobject.c index bd732ffebc85..fbf0ae282376 100644 --- a/lib/kobject.c +++ b/lib/kobject.c | |||
@@ -223,8 +223,7 @@ static int kobject_set_name_vargs(struct kobject *kobj, const char *fmt, | |||
223 | return -ENOMEM; | 223 | return -ENOMEM; |
224 | 224 | ||
225 | /* ewww... some of these buggers have '/' in the name ... */ | 225 | /* ewww... some of these buggers have '/' in the name ... */ |
226 | s = strchr(kobj->name, '/'); | 226 | while ((s = strchr(kobj->name, '/'))) |
227 | if (s) | ||
228 | s[0] = '!'; | 227 | s[0] = '!'; |
229 | 228 | ||
230 | kfree(old_name); | 229 | kfree(old_name); |
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c index 4fa1f3ad2513..4c9890ec2528 100644 --- a/scripts/mod/file2alias.c +++ b/scripts/mod/file2alias.c | |||
@@ -344,14 +344,20 @@ static void do_pnp_device_entry(void *symval, unsigned long size, | |||
344 | struct module *mod) | 344 | struct module *mod) |
345 | { | 345 | { |
346 | const unsigned long id_size = sizeof(struct pnp_device_id); | 346 | const unsigned long id_size = sizeof(struct pnp_device_id); |
347 | const struct pnp_device_id *id = symval; | 347 | const unsigned int count = (size / id_size)-1; |
348 | const struct pnp_device_id *devs = symval; | ||
349 | unsigned int i; | ||
348 | 350 | ||
349 | device_id_check(mod->name, "pnp", size, id_size, symval); | 351 | device_id_check(mod->name, "pnp", size, id_size, symval); |
350 | 352 | ||
351 | buf_printf(&mod->dev_table_buf, | 353 | for (i = 0; i < count; i++) { |
352 | "MODULE_ALIAS(\"pnp:d%s*\");\n", id->id); | 354 | const char *id = (char *)devs[i].id; |
353 | buf_printf(&mod->dev_table_buf, | 355 | |
354 | "MODULE_ALIAS(\"acpi*:%s:*\");\n", id->id); | 356 | buf_printf(&mod->dev_table_buf, |
357 | "MODULE_ALIAS(\"pnp:d%s*\");\n", id); | ||
358 | buf_printf(&mod->dev_table_buf, | ||
359 | "MODULE_ALIAS(\"acpi*:%s:*\");\n", id); | ||
360 | } | ||
355 | } | 361 | } |
356 | 362 | ||
357 | /* looks like: "pnp:dD" for every device of the card */ | 363 | /* looks like: "pnp:dD" for every device of the card */ |