Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 60fbf2bd authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'driver-core-3.15-rc2' of...

Merge tag 'driver-core-3.15-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core

Pull driver core fixes from Greg KH:
 "Here are some driver core fixes for 3.15-rc2.  Also in here are some
  documentation updates, as well as an API removal that had to wait for
  after -rc1 due to the cleanups coming into you from multiple developer
  trees (this one and the PPC tree.)

  All have been in linux next successfully"

* tag 'driver-core-3.15-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
  drivers/base/dd.c incorrect pr_debug() parameters
  Documentation: Update stable address in Chinese and Japanese translations
  topology: Fix compilation warning when not in SMP
  Chinese: add translation of io_ordering.txt
  stable_kernel_rules: spelling/word usage
  sysfs, driver-core: remove unused {sysfs|device}_schedule_callback_owner()
  kernfs: protect lazy kernfs_iattrs allocation with mutex
  fs: Don't return 0 from get_anon_bdev
parents 8cb652bb 94f8cc0e
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -315,7 +315,7 @@ Andrew Morton が Linux-kernel メーリングリストにカーネルリリー
もし、3.x.y カーネルが存在しない場合には、番号が一番大きい 3.x が
最新の安定版カーネルです。

3.x.y は "stable" チーム <stable@kernel.org> でメンテされており、必
3.x.y は "stable" チーム <stable@vger.kernel.org> でメンテされており、必
要に応じてリリースされます。通常のリリース期間は 2週間毎ですが、差し迫っ
た問題がなければもう少し長くなることもあります。セキュリティ関連の問題
の場合はこれに対してだいたいの場合、すぐにリリースがされます。
+3 −3
Original line number Diff line number Diff line
@@ -50,16 +50,16 @@ linux-2.6.29/Documentation/stable_kernel_rules.txt

-stable ツリーにパッチを送付する手続き-

 - 上記の規則に従っているかを確認した後に、stable@kernel.org にパッチ
 - 上記の規則に従っているかを確認した後に、stable@vger.kernel.org にパッチ
   を送る。
 - 送信者はパッチがキューに受け付けられた際には ACK を、却下された場合
   には NAK を受け取る。この反応は開発者たちのスケジュールによって、数
   日かかる場合がある。
 - もし受け取られたら、パッチは他の開発者たちと関連するサブシステムの
   メンテナーによるレビューのために -stable キューに追加される。
 - パッチに stable@kernel.org のアドレスが付加されているときには、それ
 - パッチに stable@vger.kernel.org のアドレスが付加されているときには、それ
   が Linus のツリーに入る時に自動的に stable チームに email される。
 - セキュリティパッチはこのエイリアス (stable@kernel.org) に送られるべ
 - セキュリティパッチはこのエイリアス (stable@vger.kernel.org) に送られるべ
   きではなく、代わりに security@kernel.org のアドレスに送られる。

レビューサイクル-
+1 −1
Original line number Diff line number Diff line
@@ -39,7 +39,7 @@ Procedure for submitting patches to the -stable tree:
   the stable tree without anything else needing to be done by the author
   or subsystem maintainer.
 - If the patch requires other patches as prerequisites which can be
   cherry-picked than this can be specified in the following format in
   cherry-picked, then this can be specified in the following format in
   the sign-off area:

     Cc: <stable@vger.kernel.org> # 3.3.x: a1f84a3: sched: Check for idle
+1 −1
Original line number Diff line number Diff line
@@ -237,7 +237,7 @@ kernel.org网站的pub/linux/kernel/v2.6/目录下找到它。它的开发遵循
如果没有2.6.x.y版本内核存在,那么最新的2.6.x版本内核就相当于是当前的稳定
版内核。

2.6.x.y版本由“稳定版”小组(邮件地址<stable@kernel.org>)维护,一般隔周发
2.6.x.y版本由“稳定版”小组(邮件地址<stable@vger.kernel.org>)维护,一般隔周发
布新版本。

内核源码中的Documentation/stable_kernel_rules.txt文件具体描述了可被稳定
+67 −0
Original line number Diff line number Diff line
Chinese translated version of Documentation/io_orderings.txt

If you have any comment or update to the content, please contact the
original document maintainer directly.  However, if you have a problem
communicating in English you can also ask the Chinese maintainer for
help.  Contact the Chinese maintainer if this translation is outdated
or if there is a problem with the translation.

Chinese maintainer: Lin Yongting <linyongting@gmail.com>
---------------------------------------------------------------------
Documentation/io_ordering.txt 的中文翻译

如果想评论或更新本文的内容,请直接联系原文档的维护者。如果你使用英文
交流有困难的话,也可以向中文版维护者求助。如果本翻译更新不及时或者翻
译存在问题,请联系中文版维护者。

中文版维护者: 林永听 Lin Yongting <linyongting@gmail.com>
中文版翻译者: 林永听 Lin Yongting <linyongting@gmail.com>
中文版校译者: 林永听 Lin Yongting <linyongting@gmail.com>


以下为正文
---------------------------------------------------------------------

在某些平台上,所谓的内存映射I/O是弱顺序。在这些平台上,驱动开发者有责任
保证I/O内存映射地址的写操作按程序图意的顺序达到设备。通常读取一个“安全”
设备寄存器或桥寄存器,触发IO芯片清刷未处理的写操作到达设备后才处理读操作,
而达到保证目的。驱动程序通常在spinlock保护的临界区退出之前使用这种技术。
这也可以保证后面的写操作只在前面的写操作之后到达设备(这非常类似于内存
屏障操作,mb(),不过仅适用于I/O)。

假设一个设备驱动程的具体例子:

        ...
CPU A:  spin_lock_irqsave(&dev_lock, flags)
CPU A:  val = readl(my_status);
CPU A:  ...
CPU A:  writel(newval, ring_ptr);
CPU A:  spin_unlock_irqrestore(&dev_lock, flags)
        ...
CPU B:  spin_lock_irqsave(&dev_lock, flags)
CPU B:  val = readl(my_status);
CPU B:  ...
CPU B:  writel(newval2, ring_ptr);
CPU B:  spin_unlock_irqrestore(&dev_lock, flags)
        ...

上述例子中,设备可能会先接收到newval2的值,然后接收到newval的值,问题就
发生了。不过很容易通过下面方法来修复:

        ...
CPU A:  spin_lock_irqsave(&dev_lock, flags)
CPU A:  val = readl(my_status);
CPU A:  ...
CPU A:  writel(newval, ring_ptr);
CPU A:  (void)readl(safe_register); /* 配置寄存器?*/
CPU A:  spin_unlock_irqrestore(&dev_lock, flags)
        ...
CPU B:  spin_lock_irqsave(&dev_lock, flags)
CPU B:  val = readl(my_status);
CPU B:  ...
CPU B:  writel(newval2, ring_ptr);
CPU B:  (void)readl(safe_register); /* 配置寄存器?*/
CPU B:  spin_unlock_irqrestore(&dev_lock, flags)

在解决方案中,读取safe_register寄存器,触发IO芯片清刷未处理的写操作,
再处理后面的读操作,防止引发数据不一致问题。
Loading