Chinese translated version of Documentation/driver-api/io_ordering.rst 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/driver-api/io_ordering.rst çä¸æç¿»è¯ å¦ææ³è¯è®ºææ´æ°æ¬æçå 容ï¼è¯·ç´æ¥èç³»åææ¡£çç»´æ¤è ãå¦æä½ ä½¿ç¨è±æ 交æµæå°é¾çè¯ï¼ä¹å¯ä»¥åä¸æçç»´æ¤è æ±å©ãå¦ææ¬ç¿»è¯æ´æ°ä¸åæ¶æè ç¿» è¯åå¨é®é¢ï¼è¯·èç³»ä¸æçç»´æ¤è ã ä¸æçç»´æ¤è ï¼ ææ°¸å¬ 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è¯çæ¸ å·æªå¤ççåæä½ï¼ åå¤çåé¢ç读æä½ï¼é²æ¢å¼åæ°æ®ä¸ä¸è´é®é¢ã