Skip to content

Commit

Permalink
Merge tag 'driver-core-3.12-rc1' of git://git.kernel.org/pub/scm/linu…
Browse files Browse the repository at this point in the history
…x/kernel/git/gregkh/driver-core

Pull driver core patches from Greg KH:
 "Here's the big driver core pull request for 3.12-rc1.

  Lots of tiny changes here fixing up the way sysfs attributes are
  created, to try to make drivers simpler, and fix a whole class race
  conditions with creations of device attributes after the device was
  announced to userspace.

  All the various pieces are acked by the different subsystem
  maintainers"

* tag 'driver-core-3.12-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (119 commits)
  firmware loader: fix pending_fw_head list corruption
  drivers/base/memory.c: introduce help macro to_memory_block
  dynamic debug: line queries failing due to uninitialized local variable
  sysfs: sysfs_create_groups returns a value.
  debugfs: provide debugfs_create_x64() when disabled
  rbd: convert bus code to use bus_groups
  firmware: dcdbas: use binary attribute groups
  sysfs: add sysfs_create/remove_groups for when SYSFS is not enabled
  driver core: add #include <linux/sysfs.h> to core files.
  HID: convert bus code to use dev_groups
  Input: serio: convert bus code to use drv_groups
  Input: gameport: convert bus code to use drv_groups
  driver core: firmware: use __ATTR_RW()
  driver core: core: use DEVICE_ATTR_RO
  driver core: bus: use DRIVER_ATTR_WO()
  driver core: create write-only attribute macros for devices and drivers
  sysfs: create __ATTR_WO()
  driver-core: platform: convert bus code to use dev_groups
  workqueue: convert bus code to use dev_groups
  MEI: convert bus code to use dev_groups
  ...
  • Loading branch information
torvalds committed Sep 3, 2013
2 parents 1d1fdd9 + 1eeeef1 commit 542a086
Show file tree
Hide file tree
Showing 99 changed files with 1,958 additions and 1,915 deletions.
25 changes: 13 additions & 12 deletions Documentation/ko_KR/HOWTO
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,8 @@ Documentation/DocBook/ 디렉토리 내에서 만들어지며 PDF, Postscript, H
프로젝트를 봐야 한다.
http://kernelnewbies.org
그곳은 거의 모든 종류의 기본적인 커널 개발 질문들(질문하기 전에 먼저
아카이브를 찾아봐라. 과거에 이미 답변되었을 수도 있다)을 할수있는 도움이
될만한 메일링 리스트가 있다. 또한 실시간으로 질문 할수 있는 IRC 채널도
아카이브를 찾아봐라. 과거에 이미 답변되었을 수도 있다)을 할 수 있는 도움이
될만한 메일링 리스트가 있다. 또한 실시간으로 질문 할 수 있는 IRC 채널도
가지고 있으며 리눅스 커널 개발을 배우는 데 유용한 문서들을 보유하고 있다.

웹사이트는 코드구성, 서브시스템들, 그리고 현재 프로젝트들
Expand Down Expand Up @@ -245,7 +245,7 @@ Documentation/DocBook/ 디렉토리 내에서 만들어지며 PDF, Postscript, H
것을 기억해라. 왜냐하면 변경이 자체내에서만 발생하고 추가된 코드가
드라이버 외부의 다른 부분에는 영향을 주지 않으므로 그런 변경은
회귀(역자주: 이전에는 존재하지 않았지만 새로운 기능추가나 변경으로 인해
생겨난 버그)를 일으킬 만한 위험을 가지고 있지 않기 때문이다. -rc1이
생겨난 버그)를 일으킬 만한 위험을 가지고 있지 않기 때문이다. -rc1이
배포된 이후에 git를 사용하여 패치들을 Linus에게 보낼수 있지만 패치들은
공식적인 메일링 리스트로 보내서 검토를 받을 필요가 있다.
- 새로운 -rc는 Linus가 현재 git tree가 테스트 하기에 충분히 안정된 상태에
Expand Down Expand Up @@ -455,7 +455,7 @@ bugme-janitor 메일링 리스트(bugzilla에 모든 변화들이 여기서 메
- 의견
- 변경을 위한 요구
- 당위성을 위한 요구
- 고요
- 침묵

기억하라. 이것들은 여러분의 패치가 커널로 들어가기 위한 과정이다. 여러분의
패치들은 비판과 다른 의견을 받을 수 있고 그것들을 기술적인 레벨로 평가하고
Expand All @@ -472,7 +472,7 @@ bugme-janitor 메일링 리스트(bugzilla에 모든 변화들이 여기서 메
가능한한 가장 좋은 기술적인 해답을 찾고 있는 커뮤니티에서는 항상
어떤 패치가 얼마나 좋은지에 관하여 다른 의견들이 있을 수 있다. 여러분은
협조적이어야 하고 기꺼이 여러분의 생각을 커널 내에 맞추어야 한다. 아니면
적어도 여러분의 것이 가치있다는 것을 중명하여야 한다. 잘못된 것도 여러분이
적어도 여러분의 것이 가치있다는 것을 증명하여야 한다. 잘못된 것도 여러분이
올바른 방향의 해결책으로 이끌어갈 의지가 있다면 받아들여질 것이라는 점을
기억하라.

Expand All @@ -488,21 +488,21 @@ bugme-janitor 메일링 리스트(bugzilla에 모든 변화들이 여기서 메
커널 커뮤니티는 가장 전통적인 회사의 개발 환경과는 다르다. 여기에 여러분들의
문제를 피하기 위한 목록이 있다.
여러분들이 제안한 변경들에 관하여 말할 때 좋은 것들 :
- "이것은 여러 문제들을 해겹합니다."
- "이것은 2000 라인의 코드를 제거합니다."
- "이것은 여러 문제들을 해결합니다."
- "이것은 2000 라인의 코드를 줄입니다."
- "이것은 내가 말하려는 것에 관해 설명하는 패치입니다."
- "나는 5개의 다른 아키텍쳐에서 그것을 테스트했슴으로..."
- "여기에 일련의 작은 패치들이 있슴음로..."
- "이것은 일반적인 머신에서 성능을 향상시킴으로..."
- "나는 5개의 다른 아키텍쳐에서 그것을 테스트 했으므로..."
- "여기에 일련의 작은 패치들이 있으므로..."
- "이것은 일반적인 머신에서 성능을 향상함으로..."

여러분들이 말할 때 피해야 할 좋지 않은 것들 :
- "우리를 그것을 AIT/ptx/Solaris에서 이러한 방법으로 했다. 그러므로 그것은 좋은 것임에 틀립없다..."
- "우리는 그것을 AIX/ptx/Solaris에서 이러한 방법으로 했다. 그러므로 그것은 좋은 것임에 틀림없다..."
- "나는 20년동안 이것을 해왔다. 그러므로..."
- "이것은 돈을 벌기위해 나의 회사가 필요로 하는 것이다."
- "이것은 우리의 엔터프라이즈 상품 라인을 위한 것이다."
- "여기에 나의 생각을 말하고 있는 1000 페이지 설계 문서가 있다."
- "나는 6달동안 이것을 했으니..."
- "여기에 5000라인 짜리 패치가 있으니..."
- "여기에 5000 라인 짜리 패치가 있으니..."
- "나는 현재 뒤죽박죽인 것을 재작성했다. 그리고 여기에..."
- "나는 마감시한을 가지고 있으므로 이 패치는 지금 적용될 필요가 있다."

Expand Down Expand Up @@ -574,6 +574,7 @@ Pat이라는 이름을 가진 여자가 있을 수도 있는 것이다. 리눅
또한 완성되지 않았고 "나중에 수정될 것이다." 와 같은 것들을 포함하는
패치들은 받아들여지지 않을 것이라는 점을 유념하라.


변경을 정당화해라
-----------------

Expand Down
6 changes: 3 additions & 3 deletions Documentation/ko_KR/stable_api_nonsense.txt
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,12 @@ Greg Kroah-Hartman <[email protected]>
---------------------------------

리눅스 커널 드라이버를 계속해서 메인 커널 트리에 반영하지 않고
유지보수하려고 하는 사름들과 이 문제를 논의하게 되면 훨씬 더
유지보수하려고 하는 사람들과 이 문제를 논의하게 되면 훨씬 더
"논란의 여지가 많은" 주제가 될 것이다.

리눅스 커널 개발은 끊임없이 빠른 속도로 이루어지고 있으며 결코
느슨해진 적이 없다. 커널 개발자들이 현재 인터페이스들에서 버그를
발견하거나 무엇인가 할수 있는 더 좋은 방법을 찾게 되었다고 하자.
발견하거나 무엇인가 할 수 있는 더 좋은 방법을 찾게 되었다고 하자.
그들이 발견한 것을 실행한다면 아마도 더 잘 동작하도록 현재 인터페이스들을
수정하게 될 것이다. 그들이 그런 일을 하게되면 함수 이름들은 변하게 되고,
구조체들은 늘어나거나 줄어들게 되고, 함수 파라미터들은 재작업될 것이다.
Expand Down Expand Up @@ -174,7 +174,7 @@ GPL을 따르는 배포 드라이버에 관해 얘기하고 있다는 것을 상
동작하는 것을 보장한다.

메인 커널 트리에 여러분의 드라이버를 반영하면 얻게 되는 장점들은 다음과 같다.
- 관리의 드는 비용(원래 개발자의)은 줄어줄면서 드라이버의 질은 향상될 것이다.
- 관리에 드는 비용(원래 개발자의)은 줄어줄면서 드라이버의 질은 향상될 것이다.
- 다른 개발자들이 여러분의 드라이버에 기능들을 추가 할 것이다.
- 다른 사람들은 여러분의 드라이버에 버그를 발견하고 수정할 것이다.
- 다른 사람들은 여러분의 드라이버의 개선점을 찾을 줄 것이다.
Expand Down
3 changes: 1 addition & 2 deletions arch/arm/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2064,8 +2064,7 @@ config KEXEC

It is an ongoing process to be certain the hardware in a machine
is properly shutdown, so do not be surprised if this code does not
initially work for you. It may help to enable device hotplugging
support.
initially work for you.

config ATAGS_PROC
bool "Export atags in procfs"
Expand Down
6 changes: 3 additions & 3 deletions arch/ia64/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -565,9 +565,9 @@ config KEXEC

It is an ongoing process to be certain the hardware in a machine
is properly shutdown, so do not be surprised if this code does not
initially work for you. It may help to enable device hotplugging
support. As of this writing the exact hardware interface is
strongly in flux, so no good recommendation can be made.
initially work for you. As of this writing the exact hardware
interface is strongly in flux, so no good recommendation can be
made.

config CRASH_DUMP
bool "kernel crash dumps"
Expand Down
6 changes: 3 additions & 3 deletions arch/mips/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2305,9 +2305,9 @@ config KEXEC

It is an ongoing process to be certain the hardware in a machine
is properly shutdown, so do not be surprised if this code does not
initially work for you. It may help to enable device hotplugging
support. As of this writing the exact hardware interface is
strongly in flux, so no good recommendation can be made.
initially work for you. As of this writing the exact hardware
interface is strongly in flux, so no good recommendation can be
made.

config CRASH_DUMP
bool "Kernel crash dumps"
Expand Down
17 changes: 10 additions & 7 deletions arch/mips/kernel/vpe.c
Original file line number Diff line number Diff line change
Expand Up @@ -1335,16 +1335,17 @@ static ssize_t store_kill(struct device *dev, struct device_attribute *attr,

return len;
}
static DEVICE_ATTR(kill, S_IWUSR, NULL, store_kill);

static ssize_t show_ntcs(struct device *cd, struct device_attribute *attr,
static ssize_t ntcs_show(struct device *cd, struct device_attribute *attr,
char *buf)
{
struct vpe *vpe = get_vpe(tclimit);

return sprintf(buf, "%d\n", vpe->ntcs);
}

static ssize_t store_ntcs(struct device *dev, struct device_attribute *attr,
static ssize_t ntcs_store(struct device *dev, struct device_attribute *attr,
const char *buf, size_t len)
{
struct vpe *vpe = get_vpe(tclimit);
Expand All @@ -1365,12 +1366,14 @@ static ssize_t store_ntcs(struct device *dev, struct device_attribute *attr,
out_einval:
return -EINVAL;
}
static DEVICE_ATTR_RW(ntcs);

static struct device_attribute vpe_class_attributes[] = {
__ATTR(kill, S_IWUSR, NULL, store_kill),
__ATTR(ntcs, S_IRUGO | S_IWUSR, show_ntcs, store_ntcs),
{}
static struct attribute vpe_attrs[] = {
&dev_attr_kill.attr,
&dev_attr_ntcs.attr,
NULL,
};
ATTRIBUTE_GROUPS(vpe);

static void vpe_device_release(struct device *cd)
{
Expand All @@ -1381,7 +1384,7 @@ struct class vpe_class = {
.name = "vpe",
.owner = THIS_MODULE,
.dev_release = vpe_device_release,
.dev_attrs = vpe_class_attributes,
.dev_groups = vpe_groups,
};

struct device vpe_device;
Expand Down
6 changes: 3 additions & 3 deletions arch/powerpc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -369,9 +369,9 @@ config KEXEC

It is an ongoing process to be certain the hardware in a machine
is properly shutdown, so do not be surprised if this code does not
initially work for you. It may help to enable device hotplugging
support. As of this writing the exact hardware interface is
strongly in flux, so no good recommendation can be made.
initially work for you. As of this writing the exact hardware
interface is strongly in flux, so no good recommendation can be
made.

config CRASH_DUMP
bool "Build a kdump crash kernel"
Expand Down
6 changes: 3 additions & 3 deletions arch/sh/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -643,9 +643,9 @@ config KEXEC

It is an ongoing process to be certain the hardware in a machine
is properly shutdown, so do not be surprised if this code does not
initially work for you. It may help to enable device hotplugging
support. As of this writing the exact hardware interface is
strongly in flux, so no good recommendation can be made.
initially work for you. As of this writing the exact hardware
interface is strongly in flux, so no good recommendation can be
made.

config CRASH_DUMP
bool "kernel crash dumps (EXPERIMENTAL)"
Expand Down
3 changes: 0 additions & 3 deletions arch/tile/include/asm/topology.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,6 @@ static inline const struct cpumask *cpumask_of_node(int node)
#define topology_core_id(cpu) (cpu)
#define topology_core_cpumask(cpu) ((void)(cpu), cpu_online_mask)
#define topology_thread_cpumask(cpu) cpumask_of(cpu)

/* indicates that pointers to the topology struct cpumask maps are valid */
#define arch_provides_topology_pointers yes
#endif

#endif /* _ASM_TILE_TOPOLOGY_H */
6 changes: 3 additions & 3 deletions arch/x86/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1628,9 +1628,9 @@ config KEXEC

It is an ongoing process to be certain the hardware in a machine
is properly shutdown, so do not be surprised if this code does not
initially work for you. It may help to enable device hotplugging
support. As of this writing the exact hardware interface is
strongly in flux, so no good recommendation can be made.
initially work for you. As of this writing the exact hardware
interface is strongly in flux, so no good recommendation can be
made.

config CRASH_DUMP
bool "kernel crash dumps"
Expand Down
3 changes: 0 additions & 3 deletions arch/x86/include/asm/topology.h
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,6 @@ extern const struct cpumask *cpu_coregroup_mask(int cpu);
#define topology_core_id(cpu) (cpu_data(cpu).cpu_core_id)
#define topology_core_cpumask(cpu) (per_cpu(cpu_core_map, cpu))
#define topology_thread_cpumask(cpu) (per_cpu(cpu_sibling_map, cpu))

/* indicates that pointers to the topology cpumask_t maps are valid */
#define arch_provides_topology_pointers yes
#endif

static inline void arch_fix_phys_package_id(int num, u32 slot)
Expand Down
27 changes: 10 additions & 17 deletions drivers/acpi/bgrt.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,14 @@ static ssize_t show_yoffset(struct device *dev,
}
static DEVICE_ATTR(yoffset, S_IRUGO, show_yoffset, NULL);

static ssize_t show_image(struct file *file, struct kobject *kobj,
static ssize_t image_read(struct file *file, struct kobject *kobj,
struct bin_attribute *attr, char *buf, loff_t off, size_t count)
{
memcpy(buf, attr->private + off, count);
return count;
}

static struct bin_attribute image_attr = {
.attr = {
.name = "image",
.mode = S_IRUGO,
},
.read = show_image,
};
static BIN_ATTR_RO(image, 0); /* size gets filled in later */

static struct attribute *bgrt_attributes[] = {
&dev_attr_version.attr,
Expand All @@ -75,8 +69,14 @@ static struct attribute *bgrt_attributes[] = {
NULL,
};

static struct bin_attribute *bgrt_bin_attributes[] = {
&bin_attr_image,
NULL,
};

static struct attribute_group bgrt_attribute_group = {
.attrs = bgrt_attributes,
.bin_attrs = bgrt_bin_attributes,
};

static int __init bgrt_init(void)
Expand All @@ -86,9 +86,8 @@ static int __init bgrt_init(void)
if (!bgrt_image)
return -ENODEV;

sysfs_bin_attr_init(&image_attr);
image_attr.private = bgrt_image;
image_attr.size = bgrt_image_size;
bin_attr_image.private = bgrt_image;
bin_attr_image.size = bgrt_image_size;

bgrt_kobj = kobject_create_and_add("bgrt", acpi_kobj);
if (!bgrt_kobj)
Expand All @@ -98,14 +97,8 @@ static int __init bgrt_init(void)
if (ret)
goto out_kobject;

ret = sysfs_create_bin_file(bgrt_kobj, &image_attr);
if (ret)
goto out_group;

return 0;

out_group:
sysfs_remove_group(bgrt_kobj, &bgrt_attribute_group);
out_kobject:
kobject_put(bgrt_kobj);
return ret;
Expand Down
10 changes: 10 additions & 0 deletions drivers/base/base.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,16 @@ static inline int driver_match_device(struct device_driver *drv,
return drv->bus->match ? drv->bus->match(dev, drv) : 1;
}

extern int driver_add_groups(struct device_driver *drv,
const struct attribute_group **groups);
extern void driver_remove_groups(struct device_driver *drv,
const struct attribute_group **groups);

extern int device_add_groups(struct device *dev,
const struct attribute_group **groups);
extern void device_remove_groups(struct device *dev,
const struct attribute_group **groups);

extern char *make_class_name(const char *name, struct kobject *kobj);

extern int devres_release_all(struct device *dev);
Expand Down
Loading

0 comments on commit 542a086

Please sign in to comment.