今日重点:✍️ 写作——补丁写得对不对,维护者先看问题陈述信不信得过。 今天用一封真实的 i2c/qcom-cci 封面信,拆四步写法: 现象写成可以照着复现的、排除写成有名有姓的、根因写成一条环环相扣的链、证据带上分母。 最后给你一组事实,练一段三句话的根因陈述。
✍️ 原文(真实邮件,逐字引用)
/ sectionOn the Lenovo Yoga Slim 7x (X1E80100) the OV02C10 front camera on CCI1 master 1 fails to start whenever it is opened again within about a second of being closed. The first register write times out ("master 1 queue 0 timeout") and the stream does not start.
Two attempts so far treated this as a sensor power-up problem. One gave the ov02c10 driver a longer settle time, the other a minimum off time for the camera rails through regulator-off-on-delay-us [1]. Neither is needed.
The sensor holds SCL and SDA low while it is powered down. If the CCI controller stays clocked from then until its next transfer, the master no longer starts transfers. The queue stays on its first command, no interrupt arrives, and only the reset in cci_run_queue()'s timeout path brings it back.
出处:linux-media,Birk Skyum 的封面信 [PATCH 0/2] i2c: qcom-cci: Recover after a target powers down under a running controller, 2026-10-20(UTC;北京时间 10-21 凌晨)。下面五张卡片引用的都是这封封面信里的原句, 卡片下方给的是该句所在的邮件,点开即可对照。
✍️ 第一步:现象要能验收
/ section★ ① 平台、触发条件、可观察结果,一句写完
原句 On the Lenovo Yoga Slim 7x (X1E80100) the OV02C10 front camera on CCI1 master 1 fails to start whenever it is opened again within about a second of being closed. The first register write times out ("master 1 queue 0 timeout") and the stream does not start.
拆解 主语是设备与操作——the OV02C10 front camera on CCI1 master 1 fails to start, 不是「我发现一个 bug」。一句话里塞进了四样东西: 平台(Lenovo Yoga Slim 7x / X1E80100)、位置(CCI1 master 1)、 触发条件(opened again within about a second of being closed)、 结果(fails to start)。
within about a second 是可操作的时间窗:维护者能拿这个参数去复现; about 又保留了不确定性,不把边界说成精确值。 第二句把「失败」落到日志原文:"master 1 queue 0 timeout" 放在括号里, 比转述「传输超时」有用得多——对方可以直接搜这行字符串。
within about a second 是可操作的时间窗:维护者能拿这个参数去复现; about 又保留了不确定性,不把边界说成精确值。 第二句把「失败」落到日志原文:"master 1 queue 0 timeout" 放在括号里, 比转述「传输超时」有用得多——对方可以直接搜这行字符串。
写法 现象句的模板:平台 + 触发条件 + 可观察结果 +(可选)报错原文。 别写 「sometimes broken」,写清 where / when / what。 一句话能让陌生人复现,现象段就合格了。
✍️ 第二步:排除要指名道姓
/ section★ ② 先说别人试过什么,再下结论
原句 Two attempts so far treated this as a sensor power-up problem. One gave the ov02c10 driver a longer settle time, the other a minimum off time for the camera rails through regulator-off-on-delay-us [1]. Neither is needed.
拆解 这一段的结构是「先列,再否」。 先承认此前的判断:Two attempts so far treated this as a sensor power-up problem (到目前为止有两次尝试,都把它当成 sensor 上电问题)。 然后给两个尝试各一个具体做法:一个给了更长的 settle time,另一个通过 regulator-off-on-delay-us 给摄像头电源轨设了最小关闭时间,并附上 [1] 的链接。 最后用三个词收束:Neither is needed.(两个都不需要)。
力度在这里:不是 「probably not needed」,是 not needed。 作者已经找到了别的根因,才敢把话说到这个份上。
力度在这里:不是 「probably not needed」,是 not needed。 作者已经找到了别的根因,才敢把话说到这个份上。
为什么这样写 维护者最怕「又一个猜测」。把既有尝试列出来、说明为什么不够, 等于替评审做了一次排除法;[1] 既给对方台阶,也让自己的判断可核对。 注意顺序:先有证据,再下断言。 没有后面的根因段落,这句 Neither is needed. 就只是冒犯。
✍️ 第三步:根因要一环扣一环
/ section★ ③ 三句、三个主语、一条链
原句 The sensor holds SCL and SDA low while it is powered down. If the CCI controller stays clocked from then until its next transfer, the master no longer starts transfers. The queue stays on its first command, no interrupt arrives, and only the reset in cci_run_queue()'s timeout path brings it back.
拆解 三句话,按因果顺序排: ① The sensor holds SCL and SDA low while it is powered down.——条件。 谁在做什么:sensor 断电时把两根信号线保持在低电平。 ② If the CCI controller stays clocked from then until its next transfer, the master no longer starts transfers.——机制。 If … 把前一句接成条件;stays clocked 是状态持续,不是一次动作。 ③ The queue stays on its first command, no interrupt arrives, and only the reset in cci_run_queue()'s timeout path brings it back.——结果链。 三个分句按时间顺序走:queue 停在第一条命令 → 没有中断 → 只有超时路径里的 reset 能救回来。
写法 根因段落别用含糊的 it。每一句的主语都要能让读者指认—— sensor、controller、queue,各归各位。 写完做个检查:把三句拆开单独读,每句还能不能回答「谁对谁做了什么」? 能,链条就立住了;不能,说明中间缺了一环。
顺带 holds SCL and SDA low 是硬件行话:把信号线保持在低电平,中文常说「拉低」。 brings it back 在这里是「让控制器恢复工作」,不是「带回来」。
✍️ 第四步:证据要带分母
/ section★ ④ 19/20 与 0/20——不写「显著改善」
原句 Tested on the Yoga with the driver from i2c/i2c-next, built as a module for a 7.2.8-based kernel whose device tree has no off-on delay for the camera rails. The CCI clock runs at 37.5 MHz there.
数据 表格本身没有形容词,只有分母和对照:修之前 20 次里失败 19 次, 修之后 20 次里失败 0 次。读者不需要相信作者的判断,自己看数就行。
边界条件 7.2.8-based kernel、built as a module、 device tree has no off-on delay、CCI clock runs at 37.5 MHz—— 这些不是废话,是让别人判断「我的环境能不能复现」的参数。 少了它们,0/20 只是一个漂亮数字;有了它们,别人知道该在什么条件下验证。
写法 证据 = 对照组 + 分母 + 测试边界。 能写数字就不写形容词:19/20 → 0/20 胜过 「much more reliable」。
pause 0.05 s 0.1 s 0.2 s 0.5 s 1 s
failed before 19/20 19/20 19/20 19/20 16/20
failed after 0/20 0/20 0/20 0/20 0/20 ✍️ 收尾:把动作写成一句祈使句
/ section★ ⑤ 一句一个补丁,动词开头
原句 Patch 1 resets the controller on every runtime resume. Patch 2 suspends it 50 ms after its last transfer.
拆解 两句,一句一个补丁,动词开头(resets / suspends),不解释、不重复。 读者读完问题陈述,需要知道的下一件事就是「你改了什么」——这里给的就是这个。
对照 Patch 1 的 commit message 把同一件事写得更紧: Reset the controller on every runtime resume, as the timeout path does. 祈使句标题 + as the timeout path does 说明已有先例—— 不是引入新机制,是把超时路径里已有的做法搬到 resume 路径。 最后这半句降低了维护者的心理成本:改动有据可循,不是凭空发明。
✨ 辅助彩蛋:三个可以顺手拿走的短语
/ section★ 短句收束、拉低一根线、救回一个控制器
① Neither is needed. 两个都不需要。neither 指前文刚列出的两者,短句一锤定音。 适合在列完两个候选方案后收束;注意它比 Neither of them may be needed 硬得多, 用之前先确认证据够。
② holds SCL and SDA low 把 SCL 和 SDA 保持在低电平。硬件语境里 hold a line low / drive a line low 都是常见说法,中文对应「拉低」;low 在这里是电平状态,不是「低电量」。
③ brings it back 让控制器恢复工作。bring sth back 在这里不是「带回来」,而是「把卡死的状态救回来」; 同义可写 recovers it。
记忆钩子 neither 收束两个,hold low 拉低一根线,bring back 救回一个控制器。
✍️ 今日练习
/ column✍️ 下面是从这组补丁里摘出的事实。请写成一段三句的根因陈述:第 1 句写触发条件,第 2 句写控制器侧机制,第 3 句写可观察结果。要求每句主语明确,不用含义不清的 it。事实:OV02C10 每次停止推流都会断电;断电的 sensor 把 SCL/SDA 拉低;控制器时钟从那时起一直开着;下一次传输时 queue 停在第一条命令;没有中断;只有 100 ms 超时路径里的 reset 能恢复。
💡 显示答案
参考作答(仿写示范,非原文):The OV02C10 is powered down whenever it stops streaming, and the unpowered sensor holds SCL and SDA low. If the CCI controller stays clocked until the next transfer, the master stops starting transfers: the queue remains on its first command and no interrupt arrives. Only the reset in the 100 ms timeout path of cci_run_queue() recovers the bus. 写法要点:第 1 句用 and 把「断电」与「拉低」接成因果前件;第 2 句用 If … 引出控制器侧机制,冒号后展开两个可观察结果;第 3 句用 Only … 把恢复路径收窄到一个动作,对应原文的 only the reset … brings it back。
📖 原文:The sensor holds SCL and SDA low while it is powered down. If the CCI controller stays clocked from then until its next transfer, the master no longer starts transfers. The queue stays on its first command, no interrupt arrives, and only the reset in cci_run_queue()'s timeout path brings it back.
📎 原文引用 每日一句:Write the failure so it can be reproduced; write the cause so it can be checked.
仿写示范