linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2,RESEND] doc: zh_CN: fix style problems for io_ordering.txt
@ 2020-03-15  6:08 Wang Wenhu
  2020-03-20 23:24 ` Jonathan Corbet
  0 siblings, 1 reply; 3+ messages in thread
From: Wang Wenhu @ 2020-03-15  6:08 UTC (permalink / raw)
  To: Harry Wei, Alex Shi, Jonathan Corbet, linux-doc, linux-kernel
  Cc: kernel, Wang Wenhu

Problems exist in the Chinese translation of io_ordering.txt.
Partly for the difference between Chinese and English character
encoding format, and the others are of the failure to comply
with the ReST markups.

Signed-off-by: Wang Wenhu <wenhu.wang@vivo.com>
---
v2: resend for the failure of delivering.

 .../translations/zh_CN/io_ordering.txt        | 72 ++++++++++++-------
 1 file changed, 46 insertions(+), 26 deletions(-)

diff --git a/Documentation/translations/zh_CN/io_ordering.txt b/Documentation/translations/zh_CN/io_ordering.txt
index 1f8127bdd415..080ed2911db0 100644
--- a/Documentation/translations/zh_CN/io_ordering.txt
+++ b/Documentation/translations/zh_CN/io_ordering.txt
@@ -29,39 +29,59 @@ Documentation/io_ordering.txt 的中文翻译
 这也可以保证后面的写操作只在前面的写操作之后到达设备(这非常类似于内存
 屏障操作,mb(),不过仅适用于I/O)。
 
+A more concrete example from a hypothetical device driver::
+
+		...
+	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)
+		...
+
+
 假设一个设备驱动程的具体例子:
+::
 
+		...
+	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)
         ...
-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)
+		...
+	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芯片清刷未处理的写操作,
 再处理后面的读操作,防止引发数据不一致问题。
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v2,RESEND] doc: zh_CN: fix style problems for io_ordering.txt
  2020-03-15  6:08 [PATCH v2,RESEND] doc: zh_CN: fix style problems for io_ordering.txt Wang Wenhu
@ 2020-03-20 23:24 ` Jonathan Corbet
  2020-03-21  7:40   ` 王文虎
  0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Corbet @ 2020-03-20 23:24 UTC (permalink / raw)
  To: Wang Wenhu; +Cc: Harry Wei, Alex Shi, linux-doc, linux-kernel, kernel

On Sat, 14 Mar 2020 23:08:55 -0700
Wang Wenhu <wenhu.wang@vivo.com> wrote:

> Problems exist in the Chinese translation of io_ordering.txt.
> Partly for the difference between Chinese and English character
> encoding format, and the others are of the failure to comply
> with the ReST markups.

So I feel like I'm missing something here...

> Signed-off-by: Wang Wenhu <wenhu.wang@vivo.com>
> ---
> v2: resend for the failure of delivering.
> 
>  .../translations/zh_CN/io_ordering.txt        | 72 ++++++++++++-------
>  1 file changed, 46 insertions(+), 26 deletions(-)
> 
> diff --git a/Documentation/translations/zh_CN/io_ordering.txt b/Documentation/translations/zh_CN/io_ordering.txt
> index 1f8127bdd415..080ed2911db0 100644
> --- a/Documentation/translations/zh_CN/io_ordering.txt
> +++ b/Documentation/translations/zh_CN/io_ordering.txt
> @@ -29,39 +29,59 @@ Documentation/io_ordering.txt 的中文翻译
>  这也可以保证后面的写操作只在前面的写操作之后到达设备(这非常类似于内存
>  屏障操作,mb(),不过仅适用于I/O)。
>  
> +A more concrete example from a hypothetical device driver::
> +
> +		...
> +	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)
> +		...
> +
> +
>  假设一个设备驱动程的具体例子:
> +::
>  
> +		...
> +	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)

It sure looks like you're adding the same text twice here...?

Thanks,

jon


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re:Re: [PATCH v2,RESEND] doc: zh_CN: fix style problems for io_ordering.txt
  2020-03-20 23:24 ` Jonathan Corbet
@ 2020-03-21  7:40   ` 王文虎
  0 siblings, 0 replies; 3+ messages in thread
From: 王文虎 @ 2020-03-21  7:40 UTC (permalink / raw)
  To: Jonathan Corbet; +Cc: Harry Wei, Alex Shi, linux-doc, linux-kernel, kernel

From: Jonathan Corbet <corbet@lwn.net>
Date: 2020-03-21 07:24:26
To:  Wang Wenhu <wenhu.wang@vivo.com>
Cc:  Harry Wei <harryxiyou@gmail.com>,Alex Shi <alex.shi@linux.alibaba.com>,linux-doc@vger.kernel.org,linux-kernel@vger.kernel.org,kernel@vivo.com
Subject: Re: [PATCH v2,RESEND] doc: zh_CN: fix style problems for io_ordering.txt>On Sat, 14 Mar 2020 23:08:55 -0700
>Wang Wenhu <wenhu.wang@vivo.com> wrote:
>
>> Problems exist in the Chinese translation of io_ordering.txt.
>> Partly for the difference between Chinese and English character
>> encoding format, and the others are of the failure to comply
>> with the ReST markups.
>
>So I feel like I'm missing something here...
Some style modification, such as "::" field added within a newline indicating
start of a block. Because of the difference between encoding of Chinese and
English, it did not work well for Chinese to just put it after some Chinese
characters within the same line.

The file is currently a txt file(none rst), so it's OK just ignore the modifactions.
>
>> Signed-off-by: Wang Wenhu <wenhu.wang@vivo.com>
>> ---
>> v2: resend for the failure of delivering.
>> 
>>  .../translations/zh_CN/io_ordering.txt        | 72 ++++++++++++-------
>>  1 file changed, 46 insertions(+), 26 deletions(-)
>> 
>> diff --git a/Documentation/translations/zh_CN/io_ordering.txt b/Documentation/translations/zh_CN/io_ordering.txt
>> index 1f8127bdd415..080ed2911db0 100644
>> --- a/Documentation/translations/zh_CN/io_ordering.txt
>> +++ b/Documentation/translations/zh_CN/io_ordering.txt
>> @@ -29,39 +29,59 @@ Documentation/io_ordering.txt 的中文翻译
>>  这也可以保证后面的写操作只在前面的写操作之后到达设备(这非常类似于内存
>>  屏障操作,mb(),不过仅适用于I/O)。
>>  
>> +A more concrete example from a hypothetical device driver::
>> +
>> +		...
>> +	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)
>> +		...
>> +
>> +
>>  假设一个设备驱动程的具体例子:
>> +::
>>  
>> +		...
>> +	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)
>
>It sure looks like you're adding the same text twice here...?
As I mentioned below the sign-off area, delivery failure happened so
this is just a resent version.
>
>Thanks,
>
>jon
>



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-03-21  7:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-15  6:08 [PATCH v2,RESEND] doc: zh_CN: fix style problems for io_ordering.txt Wang Wenhu
2020-03-20 23:24 ` Jonathan Corbet
2020-03-21  7:40   ` 王文虎

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).