diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-26 13:24:51 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-26 13:24:51 -0400 |
| commit | 299650cad6bf00a0d119592f5e1d265bee938044 (patch) | |
| tree | cd76a4d1c0cd63e6a976ca206dc076c30a06d77d | |
| parent | f76ddd98075de950cbb13f47b8356262d9f44c6d (diff) | |
| parent | bf34be058158fd30622601346819d098dc5d623f (diff) | |
Merge tag 'driver-core-3.7-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
Pull driver core fixes from Greg Kroah-Hartman:
"Here are a number of firmware core fixes for 3.7, and some other minor
fixes. And some documentation updates thrown in for good measure.
All have been in the linux-next tree for a while.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>"
* tag 'driver-core-3.7-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
Documentation:Chinese translation of Documentation/arm64/memory.txt
Documentation:Chinese translation of Documentation/arm64/booting.txt
Documentation:Chinese translation of Documentation/IRQ.txt
firmware loader: document kernel direct loading
sysfs: sysfs_pathname/sysfs_add_one: Use strlcat() instead of strcat()
dynamic_debug: Remove unnecessary __used
firmware loader: sync firmware cache by async_synchronize_full_domain
firmware loader: let direct loading back on 'firmware_buf'
firmware loader: fix one reqeust_firmware race
firmware loader: cancel uncache work before caching firmware
| -rw-r--r-- | Documentation/firmware_class/README | 26 | ||||
| -rw-r--r-- | Documentation/zh_CN/IRQ.txt | 39 | ||||
| -rw-r--r-- | Documentation/zh_CN/arm64/booting.txt | 156 | ||||
| -rw-r--r-- | Documentation/zh_CN/arm64/memory.txt | 93 | ||||
| -rw-r--r-- | drivers/base/firmware_class.c | 266 | ||||
| -rw-r--r-- | fs/sysfs/dir.c | 16 | ||||
| -rw-r--r-- | include/linux/dynamic_debug.h | 2 |
7 files changed, 465 insertions, 133 deletions
diff --git a/Documentation/firmware_class/README b/Documentation/firmware_class/README index 7eceaff63f5f..815b711bcd85 100644 --- a/Documentation/firmware_class/README +++ b/Documentation/firmware_class/README | |||
| @@ -18,32 +18,40 @@ | |||
| 18 | High level behavior (mixed): | 18 | High level behavior (mixed): |
| 19 | ============================ | 19 | ============================ |
| 20 | 20 | ||
| 21 | kernel(driver): calls request_firmware(&fw_entry, $FIRMWARE, device) | 21 | 1), kernel(driver): |
| 22 | 22 | - calls request_firmware(&fw_entry, $FIRMWARE, device) | |
| 23 | userspace: | 23 | - kernel searchs the fimware image with name $FIRMWARE directly |
| 24 | in the below search path of root filesystem: | ||
| 25 | "/lib/firmware/updates/" UTS_RELEASE, | ||
| 26 | "/lib/firmware/updates", | ||
| 27 | "/lib/firmware/" UTS_RELEASE, | ||
| 28 | "/lib/firmware" | ||
| 29 | - If found, goto 7), else goto 2) | ||
| 30 | |||
| 31 | 2), userspace: | ||
| 24 | - /sys/class/firmware/xxx/{loading,data} appear. | 32 | - /sys/class/firmware/xxx/{loading,data} appear. |
| 25 | - hotplug gets called with a firmware identifier in $FIRMWARE | 33 | - hotplug gets called with a firmware identifier in $FIRMWARE |
| 26 | and the usual hotplug environment. | 34 | and the usual hotplug environment. |
| 27 | - hotplug: echo 1 > /sys/class/firmware/xxx/loading | 35 | - hotplug: echo 1 > /sys/class/firmware/xxx/loading |
| 28 | 36 | ||
| 29 | kernel: Discard any previous partial load. | 37 | 3), kernel: Discard any previous partial load. |
| 30 | 38 | ||
| 31 | userspace: | 39 | 4), userspace: |
| 32 | - hotplug: cat appropriate_firmware_image > \ | 40 | - hotplug: cat appropriate_firmware_image > \ |
| 33 | /sys/class/firmware/xxx/data | 41 | /sys/class/firmware/xxx/data |
| 34 | 42 | ||
| 35 | kernel: grows a buffer in PAGE_SIZE increments to hold the image as it | 43 | 5), kernel: grows a buffer in PAGE_SIZE increments to hold the image as it |
| 36 | comes in. | 44 | comes in. |
| 37 | 45 | ||
| 38 | userspace: | 46 | 6), userspace: |
| 39 | - hotplug: echo 0 > /sys/class/firmware/xxx/loading | 47 | - hotplug: echo 0 > /sys/class/firmware/xxx/loading |
| 40 | 48 | ||
| 41 | kernel: request_firmware() returns and the driver has the firmware | 49 | 7), kernel: request_firmware() returns and the driver has the firmware |
| 42 | image in fw_entry->{data,size}. If something went wrong | 50 | image in fw_entry->{data,size}. If something went wrong |
| 43 | request_firmware() returns non-zero and fw_entry is set to | 51 | request_firmware() returns non-zero and fw_entry is set to |
| 44 | NULL. | 52 | NULL. |
| 45 | 53 | ||
| 46 | kernel(driver): Driver code calls release_firmware(fw_entry) releasing | 54 | 8), kernel(driver): Driver code calls release_firmware(fw_entry) releasing |
| 47 | the firmware image and any related resource. | 55 | the firmware image and any related resource. |
| 48 | 56 | ||
| 49 | High level behavior (driver code): | 57 | High level behavior (driver code): |
diff --git a/Documentation/zh_CN/IRQ.txt b/Documentation/zh_CN/IRQ.txt new file mode 100644 index 000000000000..956026d5cf82 --- /dev/null +++ b/Documentation/zh_CN/IRQ.txt | |||
| @@ -0,0 +1,39 @@ | |||
| 1 | Chinese translated version of Documentation/IRQ.txt | ||
| 2 | |||
| 3 | If you have any comment or update to the content, please contact the | ||
| 4 | original document maintainer directly. However, if you have a problem | ||
| 5 | communicating in English you can also ask the Chinese maintainer for | ||
| 6 | help. Contact the Chinese maintainer if this translation is outdated | ||
| 7 | or if there is a problem with the translation. | ||
| 8 | |||
| 9 | Maintainer: Eric W. Biederman <ebiederman@xmission.com> | ||
| 10 | Chinese maintainer: Fu Wei <tekkamanninja@gmail.com> | ||
| 11 | --------------------------------------------------------------------- | ||
| 12 | Documentation/IRQ.txt 的中文翻译 | ||
| 13 | |||
| 14 | 如果想评论或更新本文的内容,请直接联系原文档的维护者。如果你使用英文 | ||
| 15 | 交流有困难的话,也可以向中文版维护者求助。如果本翻译更新不及时或者翻 | ||
| 16 | 译存在问题,请联系中文版维护者。 | ||
| 17 | 英文版维护者: Eric W. Biederman <ebiederman@xmission.com> | ||
| 18 | 中文版维护者: 傅炜 Fu Wei <tekkamanninja@gmail.com> | ||
| 19 | 中文版翻译者: 傅炜 Fu Wei <tekkamanninja@gmail.com> | ||
| 20 | 中文版校译者: 傅炜 Fu Wei <tekkamanninja@gmail.com> | ||
| 21 | |||
| 22 | |||
| 23 | 以下为正文 | ||
| 24 | --------------------------------------------------------------------- | ||
| 25 | 何为 IRQ? | ||
| 26 | |||
| 27 | 一个 IRQ 是来自某个设备的一个中断请求。目前,它们可以来自一个硬件引脚, | ||
| 28 | 或来自一个数据包。多个设备可能连接到同个硬件引脚,从而共享一个 IRQ。 | ||
| 29 | |||
| 30 | 一个 IRQ 编号是用于告知硬件中断源的内核标识。通常情况下,这是一个 | ||
| 31 | 全局 irq_desc 数组的索引,但是除了在 linux/interrupt.h 中的实现, | ||
| 32 | 具体的细节是体系结构特定的。 | ||
| 33 | |||
| 34 | 一个 IRQ 编号是设备上某个可能的中断源的枚举。通常情况下,枚举的编号是 | ||
| 35 | 该引脚在系统内中断控制器的所有输入引脚中的编号。对于 ISA 总线中的情况, | ||
| 36 | 枚举的是在两个 i8259 中断控制器中 16 个输入引脚。 | ||
| 37 | |||
| 38 | 架构可以对 IRQ 编号指定额外的含义,在硬件涉及任何手工配置的情况下, | ||
| 39 | 是被提倡的。ISA 的 IRQ 是一个分配这类额外含义的典型例子。 | ||
diff --git a/Documentation/zh_CN/arm64/booting.txt b/Documentation/zh_CN/arm64/booting.txt new file mode 100644 index 000000000000..28fa325b7461 --- /dev/null +++ b/Documentation/zh_CN/arm64/booting.txt | |||
| @@ -0,0 +1,156 @@ | |||
| 1 | Chinese translated version of Documentation/arm64/booting.txt | ||
| 2 | |||
| 3 | If you have any comment or update to the content, please contact the | ||
| 4 | original document maintainer directly. However, if you have a problem | ||
| 5 | communicating in English you can also ask the Chinese maintainer for | ||
| 6 | help. Contact the Chinese maintainer if this translation is outdated | ||
| 7 | or if there is a problem with the translation. | ||
| 8 | |||
| 9 | Maintainer: Will Deacon <will.deacon@arm.com> | ||
| 10 | Chinese maintainer: Fu Wei <tekkamanninja@gmail.com> | ||
| 11 | --------------------------------------------------------------------- | ||
| 12 | Documentation/arm64/booting.txt 的中文翻译 | ||
| 13 | |||
| 14 | 如果想评论或更新本文的内容,请直接联系原文档的维护者。如果你使用英文 | ||
| 15 | 交流有困难的话,也可以向中文版维护者求助。如果本翻译更新不及时或者翻 | ||
| 16 | 译存在问题,请联系中文版维护者。 | ||
| 17 | |||
| 18 | 英文版维护者: Will Deacon <will.deacon@arm.com> | ||
| 19 | 中文版维护者: 傅炜 Fu Wei <tekkamanninja@gmail.com> | ||
| 20 | 中文版翻译者: 傅炜 Fu Wei <tekkamanninja@gmail.com> | ||
| 21 | 中文版校译者: 傅炜 Fu Wei <tekkamanninja@gmail.com> | ||
| 22 | |||
| 23 | 以下为正文 | ||
| 24 | --------------------------------------------------------------------- | ||
| 25 | 启动 AArch64 Linux | ||
| 26 | ================== | ||
| 27 | |||
| 28 | 作者: Will Deacon <will.deacon@arm.com> | ||
| 29 | 日期: 2012 年 09 月 07 日 | ||
| 30 | |||
| 31 | 本文档基于 Russell King 的 ARM 启动文档,且适用于所有公开发布的 | ||
| 32 | AArch64 Linux 内核代码。 | ||
| 33 | |||
| 34 | AArch64 异常模型由多个异常级别(EL0 - EL3)组成,对于 EL0 和 EL1 | ||
| 35 | 异常级有对应的安全和非安全模式。EL2 是系统管理级,且仅存在于 | ||
| 36 | 非安全模式下。EL3 是最高特权级,且仅存在于安全模式下。 | ||
| 37 | |||
| 38 | 基于本文档的目的,我们将简单地使用‘引导装载程序’(‘boot loader’) | ||
| 39 | 这个术语来定义在将控制权交给 Linux 内核前 CPU 上执行的所有软件。 | ||
| 40 | 这可能包含安全监控和系统管理代码,或者它可能只是一些用于准备最小启动 | ||
| 41 | 环境的指令。 | ||
| 42 | |||
| 43 | 基本上,引导装载程序(至少)应实现以下操作: | ||
| 44 | |||
| 45 | 1、设置和初始化 RAM | ||
| 46 | 2、设置设备树数据 | ||
| 47 | 3、解压内核映像 | ||
| 48 | 4、调用内核映像 | ||
| 49 | |||
| 50 | |||
| 51 | 1、设置和初始化 RAM | ||
| 52 | ----------------- | ||
| 53 | |||
| 54 | 必要性: 强制 | ||
| 55 | |||
| 56 | 引导装载程序应该找到并初始化系统中所有内核用于保持系统变量数据的 RAM。 | ||
| 57 | 这个操作的执行是设备依赖的。(它可能使用内部算法来自动定位和计算所有 | ||
| 58 | RAM,或可能使用对这个设备已知的 RAM 信息,还可能使用任何引导装载程序 | ||
| 59 | 设计者想到的匹配方法。) | ||
| 60 | |||
| 61 | |||
| 62 | 2、设置设备树数据 | ||
| 63 | --------------- | ||
| 64 | |||
| 65 | 必要性: 强制 | ||
| 66 | |||
| 67 | 设备树数据块(dtb)大小必须不大于 2 MB,且位于从内核映像起始算起第一个 | ||
| 68 | 512MB 内的 2MB 边界上。这使得内核可以通过初始页表中的单个节描述符来 | ||
| 69 | 映射此数据块。 | ||
