* [PATCH] Chinese: add translation of io_ordering.txt
@ 2014-04-16 15:25 Lin Yongting
0 siblings, 0 replies; 3+ messages in thread
From: Lin Yongting @ 2014-04-16 15:25 UTC (permalink / raw)
To: gregkh, akpm, harryxiyou, rdunlap
Cc: linux-kernel, linux-doc, linux-kernel, linyongting, linyongting
This is a Chinese translated version of Documentation/io_ordering.txt
Signed-off-by: Lin Yongting <linyongting@gmail.com>
---
Documentation/zh_CN/io_ordering.txt | 67 +++++++++++++++++++++++++++++++++++
1 file changed, 67 insertions(+)
create mode 100644 Documentation/zh_CN/io_ordering.txt
diff --git a/Documentation/zh_CN/io_ordering.txt b/Documentation/zh_CN/io_ordering.txt
new file mode 100644
index 0000000..e592daf
--- /dev/null
+++ b/Documentation/zh_CN/io_ordering.txt
@@ -0,0 +1,67 @@
+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芯片清刷未处理的写操作,
+再处理后面的读操作,防止引发数据不一致问题。
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] Chinese: add translation of io_ordering.txt
@ 2014-04-16 15:20 Lin Yongting
0 siblings, 0 replies; 3+ messages in thread
From: Lin Yongting @ 2014-04-16 15:20 UTC (permalink / raw)
To: gregkh, akpm, harryxiyou, rdunlap
Cc: linux-kernel, linux-doc, linux-kernel, linyongting, linyongting
This is a Chinese translated version of Documentation/io_ordering.txt
Signed-off-by: Lin Yongting <linyongting@gmail.com>
---
Documentation/zh_CN/io_ordering.txt | 67 +++++++++++++++++++++++++++++++++++
1 file changed, 67 insertions(+)
create mode 100644 Documentation/zh_CN/io_ordering.txt
diff --git a/Documentation/zh_CN/io_ordering.txt b/Documentation/zh_CN/io_ordering.txt
new file mode 100644
index 0000000..e592daf
--- /dev/null
+++ b/Documentation/zh_CN/io_ordering.txt
@@ -0,0 +1,67 @@
+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芯片清刷未处理的写操作,
+再处理后面的读操作,防止引发数据不一致问题。
--
1.7.9.5
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH] Chinese: add translation of io_ordering.txt
@ 2014-03-08 9:53 Linyongting
0 siblings, 0 replies; 3+ messages in thread
From: Linyongting @ 2014-03-08 9:53 UTC (permalink / raw)
To: harryxiyou, rob, linux-kernel, linux-doc, linux-kernel; +Cc: linyongting
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="gb2312", Size: 3250 bytes --]
This is a Chinese translated version of Documentation/io_ordering.txt
Signed-off-by: Lin Yongting <linyongting@gmail.com>
---
Documentation/zh_CN/io_ordering.txt | 67 +++++++++++++++++++++++++++++++++++
1 file changed, 67 insertions(+)
create mode 100644 Documentation/zh_CN/io_ordering.txt
diff --git a/Documentation/zh_CN/io_ordering.txt b/Documentation/zh_CN/io_ordering.txt
new file mode 100644
index 0000000..e592daf
--- /dev/null
+++ b/Documentation/zh_CN/io_ordering.txt
@@ -0,0 +1,67 @@
+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>
+
+
+ÒÔÏÂΪÕýÎÄ
+---------------------------------------------------------------------
+
+ÔÚijЩƽ̨ÉÏ£¬ËùνµÄÄÚ´æÓ³Éä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оƬÇåˢδ´¦ÀíµÄд²Ù×÷£¬
+ÔÙ´¦ÀíºóÃæµÄ¶Á²Ù×÷£¬·ÀÖ¹Òý·¢Êý¾Ý²»Ò»ÖÂÎÊÌâ¡£
--
1.7.9.5
ÿôèº{.nÇ+·®+%Ëÿ±éݶ\x17¥wÿº{.nÇ+·¥{±þG«éÿ{ayº\x1dÊÚë,j\a¢f£¢·hïêÿêçz_è®\x03(éÝ¢j"ú\x1a¶^[m§ÿÿ¾\a«þG«éÿ¢¸?¨èÚ&£ø§~á¶iOæ¬z·vØ^\x14\x04\x1a¶^[m§ÿÿÃ\fÿ¶ìÿ¢¸?I¥
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-04-16 15:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-16 15:25 [PATCH] Chinese: add translation of io_ordering.txt Lin Yongting
-- strict thread matches above, loose matches on Subject: below --
2014-04-16 15:20 Lin Yongting
2014-03-08 9:53 Linyongting
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).