All of lore.kernel.org
 help / color / mirror / Atom feed
* [GIT PATCH] driver core patches for 2.6.33-git
@ 2010-03-02 23:09 Greg KH
  2010-03-02 23:28 ` [PATCH 01/62] kobject-example: Spelling fixes Greg Kroah-Hartman
                   ` (60 more replies)
  0 siblings, 61 replies; 90+ messages in thread
From: Greg KH @ 2010-03-02 23:09 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton; +Cc: linux-kernel

Here is the big driver core patchset for the 2.6.34 merge window.

The msi-laptop driver also got updates through this patch series, at the
blessing of the maintainer of that driver.

Please pull from:
	master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-core-2.6.git/

All of these patches have been in the linux-next and mm trees for a
while.

The patches will be sent as a follow-on to this message to lkml for
people to see.

thanks,

greg k-h

------------

 Documentation/HOWTO                       |  113 +++------
 Documentation/kobject.txt                 |    2 +-
 arch/arm/mach-pxa/corgi_ssp.c             |    2 +-
 arch/arm/mach-pxa/sharpsl_pm.c            |    2 +-
 arch/arm/mach-s3c2410/h1940-bluetooth.c   |    2 +-
 arch/arm/mach-sa1100/jornada720_ssp.c     |    2 +-
 arch/ia64/kernel/topology.c               |    2 +-
 arch/mips/txx9/generic/7segled.c          |    5 +-
 arch/powerpc/kernel/cacheinfo.c           |    2 +-
 arch/s390/kernel/smp.c                    |   12 +-
 arch/s390/kernel/time.c                   |   49 +++-
 arch/sh/kernel/cpu/sh4/sq.c               |    2 +-
 arch/x86/kernel/cpu/intel_cacheinfo.c     |    2 +-
 arch/x86/kernel/cpu/mcheck/mce.c          |    1 +
 arch/x86/kernel/cpu/mcheck/mce_amd.c      |    2 +-
 block/blk-integrity.c                     |    2 +-
 block/blk-sysfs.c                         |    2 +-
 block/elevator.c                          |    2 +-
 drivers/acpi/system.c                     |    2 +
 drivers/auxdisplay/cfag12864bfb.c         |    2 +-
 drivers/base/Kconfig                      |   55 +++--
 drivers/base/bus.c                        |   26 +-
 drivers/base/class.c                      |   16 +-
 drivers/base/core.c                       |   33 +--
 drivers/base/cpu.c                        |  105 ++++-----
 drivers/base/dd.c                         |   38 ++--
 drivers/base/devtmpfs.c                   |   13 +
 drivers/base/firmware_class.c             |   11 +-
 drivers/base/memory.c                     |   20 +-
 drivers/base/node.c                       |   81 +++----
 drivers/base/platform.c                   |   76 ++++++-
 drivers/base/power/main.c                 |   20 +-
 drivers/base/sys.c                        |   17 +-
 drivers/block/osdblk.c                    |   12 +-
 drivers/block/pktcdvd.c                   |   14 +-
 drivers/cpufreq/cpufreq.c                 |    2 +-
 drivers/cpuidle/sysfs.c                   |    8 +-
 drivers/dma/ioat/dma.c                    |    2 +-
 drivers/dma/ioat/dma.h                    |    2 +-
 drivers/edac/edac_device_sysfs.c          |    6 +-
 drivers/edac/edac_mc_sysfs.c              |    4 +-
 drivers/edac/edac_pci_sysfs.c             |    4 +-
 drivers/firewire/core-device.c            |    5 +-
 drivers/firmware/edd.c                    |    2 +-
 drivers/firmware/efivars.c                |    2 +-
 drivers/firmware/iscsi_ibft.c             |    2 +-
 drivers/firmware/memmap.c                 |    2 +-
 drivers/gpio/gpiolib.c                    |    8 +-
 drivers/gpu/drm/drm_sysfs.c               |   18 +-
 drivers/gpu/drm/ttm/ttm_bo.c              |    2 +-
 drivers/gpu/drm/ttm/ttm_memory.c          |    2 +-
 drivers/i2c/busses/i2c-omap.c             |    2 +-
 drivers/ieee1394/nodemgr.c                |    5 +-
 drivers/infiniband/core/cm.c              |    2 +-
 drivers/infiniband/core/sysfs.c           |    2 +-
 drivers/infiniband/core/ucm.c             |   13 +-
 drivers/infiniband/core/user_mad.c        |    9 +-
 drivers/infiniband/core/uverbs_main.c     |    9 +-
 drivers/macintosh/windfarm_core.c         |    1 +
 drivers/macintosh/windfarm_smu_controls.c |    1 +
 drivers/md/dm-sysfs.c                     |    2 +-
 drivers/md/md.c                           |    4 +-
 drivers/media/video/omap24xxcam.c         |    2 +-
 drivers/misc/phantom.c                    |   13 +-
 drivers/mtd/ubi/build.c                   |    3 +-
 drivers/net/arm/am79c961a.c               |    2 +-
 drivers/net/bonding/bond_sysfs.c          |    5 +-
 drivers/net/ibmveth.c                     |    2 +-
 drivers/net/iseries_veth.c                |    4 +-
 drivers/parisc/pdc_stable.c               |    2 +-
 drivers/pci/bus.c                         |    4 +-
 drivers/pci/hotplug/fakephp.c             |    2 +-
 drivers/pci/pci-sysfs.c                   |    5 +
 drivers/pci/pci.c                         |    4 +-
 drivers/pci/slot.c                        |    2 +-
 drivers/pcmcia/ds.c                       |    8 +-
 drivers/platform/x86/Kconfig              |    1 +
 drivers/platform/x86/hp-wmi.c             |    4 +-
 drivers/platform/x86/msi-laptop.c         |  360 ++++++++++++++++++++++++++++-
 drivers/scsi/sgiwd93.c                    |    2 +-
 drivers/scsi/sni_53c710.c                 |    2 +-
 drivers/staging/asus_oled/asus_oled.c     |   13 +-
 drivers/uio/Kconfig                       |   24 +-
 drivers/uio/Makefile                      |    2 +-
 drivers/uio/uio.c                         |    4 +-
 drivers/uio/uio_netx.c                    |  172 ++++++++++++++
 drivers/uio/uio_smx.c                     |  140 -----------
 drivers/usb/core/driver.c                 |    4 +-
 drivers/uwb/driver.c                      |    5 +-
 drivers/uwb/umc-bus.c                     |    4 +-
 drivers/uwb/uwb-internal.h                |    4 +-
 drivers/uwb/wlp/sysfs.c                   |    3 +-
 drivers/video/acornfb.c                   |    2 +-
 drivers/video/arcfb.c                     |    2 +-
 drivers/video/cobalt_lcdfb.c              |    2 +-
 drivers/video/efifb.c                     |    2 +-
 drivers/video/epson1355fb.c               |    2 +-
 drivers/video/gbefb.c                     |    2 +-
 drivers/video/hgafb.c                     |    2 +-
 drivers/video/hitfb.c                     |    2 +-
 drivers/video/omap2/dss/manager.c         |    2 +-
 drivers/video/omap2/dss/overlay.c         |    2 +-
 drivers/video/q40fb.c                     |    2 +-
 drivers/video/s3c2410fb.c                 |    4 +-
 drivers/video/sa1100fb.c                  |    2 +-
 drivers/video/sgivwfb.c                   |    2 +-
 drivers/video/sh_mobile_lcdcfb.c          |    2 +-
 drivers/video/vesafb.c                    |    2 +-
 drivers/video/vfb.c                       |    2 +-
 drivers/video/vga16fb.c                   |    2 +-
 drivers/video/w100fb.c                    |    2 +-
 drivers/w1/masters/omap_hdq.c             |    4 +-
 drivers/xen/sys-hypervisor.c              |    2 +-
 fs/btrfs/sysfs.c                          |    4 +-
 fs/dlm/lockspace.c                        |    2 +-
 fs/ext4/super.c                           |    2 +-
 fs/gfs2/sys.c                             |    4 +-
 fs/ocfs2/cluster/masklog.c                |    2 +-
 fs/sysfs/bin.c                            |   50 ++--
 fs/sysfs/dir.c                            |  132 ++++++-----
 fs/sysfs/file.c                           |   47 +++-
 fs/sysfs/inode.c                          |   13 +-
 fs/sysfs/mount.c                          |    4 +-
 fs/sysfs/symlink.c                        |   38 +++
 fs/sysfs/sysfs.h                          |   17 +-
 include/linux/device.h                    |   40 +++-
 include/linux/kobject.h                   |   14 +-
 include/linux/platform_device.h           |    9 +-
 include/linux/sysdev.h                    |   21 ++-
 include/linux/sysfs.h                     |   61 +++++
 include/linux/usb.h                       |    6 +-
 kernel/module.c                           |    3 +
 kernel/params.c                           |    5 +-
 kernel/perf_event.c                       |   13 +-
 kernel/sched.c                            |    4 +
 lib/kobject.c                             |    6 +-
 lib/kobject_uevent.c                      |    2 +-
 mm/slub.c                                 |    4 +-
 net/bluetooth/l2cap.c                     |    4 +-
 net/bluetooth/rfcomm/core.c               |    4 +-
 net/bluetooth/rfcomm/sock.c               |    4 +-
 net/bluetooth/sco.c                       |    4 +-
 net/bridge/br_private.h                   |    2 +-
 net/bridge/br_sysfs_if.c                  |    2 +-
 samples/kobject/kobject-example.c         |    4 +-
 samples/kobject/kset-example.c            |    6 +-
 146 files changed, 1457 insertions(+), 792 deletions(-)
 create mode 100644 drivers/uio/uio_netx.c
 delete mode 100644 drivers/uio/uio_smx.c

---------------

Andi Kleen (12):
      sysdev: Pass attribute in sysdev_class attributes show/store
      sysdev: Convert node driver class attributes to be data driven
      sysdev: Convert cpu driver sysdev class attributes
      sysfs: Add sysfs_add/remove_files utility functions
      sysfs: Add attribute array to sysdev classes
      sysdev: Convert node driver
      sysdev: Use sysdev_class attribute arrays in node driver
      sysdev: Add sysdev_create/remove_files
      sysdev: Fix type of sysdev class attribute in memory driver
      driver-core: Add attribute argument to class_attribute show/store
      driver core: Add class_attr_string for simple read-only string
      driver core: Convert some drivers to CLASS_ATTR_STRING

Ben Hutchings (1):
      Driver core: Fix first line of kernel-doc for a few functions

Dmitry Torokhov (1):
      Driver core: add platform_create_bundle() helper

Emese Revfy (2):
      kobject: Constify struct kset_uevent_ops
      Driver core: Constify struct sysfs_ops in struct kobj_type

Eric Miao (1):
      driver core: make platform_device_id table const

Eric W. Biederman (13):
      sysfs: Cache the last sysfs_dirent to improve readdir scalability v2
      sysfs: Remove sysfs_get/put_active_two
      sysfs: Only take active references on attributes.
      sysfs: Use one lockdep class per sysfs attribute.
      sysfs: Use sysfs_attr_init and sysfs_bin_attr_init on dynamic attributes
      sysfs: Document sysfs_attr_init and sysfs_bin_attr_init
      sysfs: Use sysfs_attr_init and sysfs_bin_attr_init on module dynamic attributes
      sysfs: Serialize updates to the vfs inode
      sysfs: Pack sysfs_dirent more tightly.
      sysfs: Implement sysfs_rename_link
      driver core: Use sysfs_rename_link in device_rename
      sysfs: Pass super_block to sysfs_get_inode
      sysfs: Kill unused sysfs_sb variable.

Greg Kroah-Hartman (2):
      sysdev: fix up the probe/release attributes
      Driver core: create lock/unlock functions for struct device

Hans J. Koch (2):
      UIO: Add a driver for Hilscher netX-based fieldbus cards
      UIO: Remove SMX Cryptengine driver

Heiko Carstens (1):
      sysdev: fix missing s390 conversion

Johannes Berg (1):
      sysfs: windfarm: init sysfs attributes

John Ogness (1):
      UIO: minor Kconfig fixes

Kay Sievers (4):
      Driver-Core: devtmpfs - reset inode permissions before unlinking
      Driver-Core: devtmpfs - remove EXPERIMENTAL and enable it by default
      Driver-Core: disable /sbin/hotplug by default
      Driver-Core: require valid action string in uevent trigger

Lee, Chun-Yi (5):
      msi-laptop: Support standard ec 66/62 command on MSI notebook and nebook
      msi-laptop: Add threeg sysfs file for support query 3G state by standard 66/62 ec command
      msi-laptop: Support some MSI 3G netbook that is need load SCM
      msi-laptop: Add resume method for set the SCM load again
      msi-laptop: Detect 3G device exists by standard ec command

Luis R. Rodriguez (1):
      driver-core: firmware_class: remove base.h header inclusion

Radu Voicilas (2):
      kobject-example: Spelling fixes.
      kset-example: Spelling fixes.

Randy Dunlap (1):
      msi-laptop: depends on RFKILL

Stefan Richter (1):
      HOWTO: Updates on subsystem trees, patchwork, -next (vs. -mm)

Stephen Rothwell (1):
      sysfs: fix for thinko with sysfs_bin_attr_init()

Uwe Kleine-König (10):
      Driver core: make struct platform_driver.id_table const
      platform-drivers: move probe to .devinit.text in arch/arm
      platform-drivers: move probe to .devinit.text in drivers/scsi
      platform-drivers: move probe to .devinit.text in drivers/video
      x86: move hp-wmi's probe function to .devinit.text
      i2c: move i2c_omap's probe function to .devinit.text
      w1: move omap_hdq's probe function to .devinit.text
      media: move omap24xxcam's probe function to .devinit.text
      auxdisplay: move cfag12864bfb's probe function to .devinit.text
      net: move am79c961's probe function to .devinit.text


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

* [PATCH 01/62] kobject-example: Spelling fixes.
  2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
@ 2010-03-02 23:28 ` Greg Kroah-Hartman
  2010-03-02 23:28 ` [PATCH 02/62] kset-example: " Greg Kroah-Hartman
                   ` (59 subsequent siblings)
  60 siblings, 0 replies; 90+ messages in thread
From: Greg Kroah-Hartman @ 2010-03-02 23:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: Radu Voicilas, Greg Kroah-Hartman

From: Radu Voicilas <rvoicilas@gmail.com>

No change in functionality.

Signed-off-by: Radu Voicilas <rvoicilas@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 samples/kobject/kobject-example.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/samples/kobject/kobject-example.c b/samples/kobject/kobject-example.c
index 8d9b55a..86ea0c3 100644
--- a/samples/kobject/kobject-example.c
+++ b/samples/kobject/kobject-example.c
@@ -44,7 +44,7 @@ static struct kobj_attribute foo_attribute =
 	__ATTR(foo, 0666, foo_show, foo_store);
 
 /*
- * More complex function where we determine which varible is being accessed by
+ * More complex function where we determine which variable is being accessed by
  * looking at the attribute for the "baz" and "bar" files.
  */
 static ssize_t b_show(struct kobject *kobj, struct kobj_attribute *attr,
@@ -79,7 +79,7 @@ static struct kobj_attribute bar_attribute =
 
 
 /*
- * Create a group of attributes so that we can create and destory them all
+ * Create a group of attributes so that we can create and destroy them all
  * at once.
  */
 static struct attribute *attrs[] = {
-- 
1.7.0.1


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

* [PATCH 02/62] kset-example: Spelling fixes.
  2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
  2010-03-02 23:28 ` [PATCH 01/62] kobject-example: Spelling fixes Greg Kroah-Hartman
@ 2010-03-02 23:28 ` Greg Kroah-Hartman
  2010-03-02 23:28 ` [PATCH 03/62] Driver core: add platform_create_bundle() helper Greg Kroah-Hartman
                   ` (58 subsequent siblings)
  60 siblings, 0 replies; 90+ messages in thread
From: Greg Kroah-Hartman @ 2010-03-02 23:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: Radu Voicilas, Greg Kroah-Hartman

From: Radu Voicilas <rvoicilas@gmail.com>

No change in functionality.

Signed-off-by: Radu Voicilas <rvoicilas@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 samples/kobject/kset-example.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/samples/kobject/kset-example.c b/samples/kobject/kset-example.c
index 45b7d56..7c60881 100644
--- a/samples/kobject/kset-example.c
+++ b/samples/kobject/kset-example.c
@@ -127,7 +127,7 @@ static struct foo_attribute foo_attribute =
 	__ATTR(foo, 0666, foo_show, foo_store);
 
 /*
- * More complex function where we determine which varible is being accessed by
+ * More complex function where we determine which variable is being accessed by
  * looking at the attribute for the "baz" and "bar" files.
  */
 static ssize_t b_show(struct foo_obj *foo_obj, struct foo_attribute *attr,
@@ -161,7 +161,7 @@ static struct foo_attribute bar_attribute =
 	__ATTR(bar, 0666, b_show, b_store);
 
 /*
- * Create a group of attributes so that we can create and destory them all
+ * Create a group of attributes so that we can create and destroy them all
  * at once.
  */
 static struct attribute *foo_default_attrs[] = {
-- 
1.7.0.1


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

* [PATCH 03/62] Driver core: add platform_create_bundle() helper
  2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
  2010-03-02 23:28 ` [PATCH 01/62] kobject-example: Spelling fixes Greg Kroah-Hartman
  2010-03-02 23:28 ` [PATCH 02/62] kset-example: " Greg Kroah-Hartman
@ 2010-03-02 23:28 ` Greg Kroah-Hartman
  2010-03-02 23:28 ` [PATCH 04/62] driver core: make platform_device_id table const Greg Kroah-Hartman
                   ` (57 subsequent siblings)
  60 siblings, 0 replies; 90+ messages in thread
From: Greg Kroah-Hartman @ 2010-03-02 23:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: Dmitry Torokhov, Dmitry Torokhov, Greg Kroah-Hartman

From: Dmitry Torokhov <dmitry.torokhov@gmail.com>

Many legacy-style module create singleton platform devices themselves,
along with corresponding platform driver. Instead of replicating error
handling code in all such drivers, provide a helper that allocates and
registers a single platform device and a driver and binds them together.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/base/platform.c         |   58 +++++++++++++++++++++++++++++++++++++++
 include/linux/platform_device.h |    5 +++
 2 files changed, 63 insertions(+), 0 deletions(-)

diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index 58efaf2..937d580 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -548,6 +548,64 @@ int __init_or_module platform_driver_probe(struct platform_driver *drv,
 }
 EXPORT_SYMBOL_GPL(platform_driver_probe);
 
+/**
+ * platform_create_bundle - register driver and create corresponding device
+ * @driver: platform driver structure
+ * @probe: the driver probe routine, probably from an __init section
+ * @res: set of resources that needs to be allocated for the device
+ * @n_res: number of resources
+ * @data: platform specific data for this platform device
+ * @size: size of platform specific data
+ *
+ * Use this in legacy-style modules that probe hardware directly and
+ * register a single platform device and corresponding platform driver.
+ */
+struct platform_device * __init_or_module platform_create_bundle(
+			struct platform_driver *driver,
+			int (*probe)(struct platform_device *),
+			struct resource *res, unsigned int n_res,
+			const void *data, size_t size)
+{
+	struct platform_device *pdev;
+	int error;
+
+	pdev = platform_device_alloc(driver->driver.name, -1);
+	if (!pdev) {
+		error = -ENOMEM;
+		goto err_out;
+	}
+
+	if (res) {
+		error = platform_device_add_resources(pdev, res, n_res);
+		if (error)
+			goto err_pdev_put;
+	}
+
+	if (data) {
+		error = platform_device_add_data(pdev, data, size);
+		if (error)
+			goto err_pdev_put;
+	}
+
+	error = platform_device_add(pdev);
+	if (error)
+		goto err_pdev_put;
+
+	error = platform_driver_probe(driver, probe);
+	if (error)
+		goto err_pdev_del;
+
+	return pdev;
+
+err_pdev_del:
+	platform_device_del(pdev);
+err_pdev_put:
+	platform_device_put(pdev);
+err_out:
+	return ERR_PTR(error);
+}
+EXPORT_SYMBOL_GPL(platform_create_bundle);
+
 /* modalias support enables more hands-off userspace setup:
  * (a) environment variable lets new-style hotplug events work once system is
  *     fully running:  "modprobe $MODALIAS"
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
index 71ff887..25e64b4 100644
--- a/include/linux/platform_device.h
+++ b/include/linux/platform_device.h
@@ -77,6 +77,11 @@ extern int platform_driver_probe(struct platform_driver *driver,
 #define platform_get_drvdata(_dev)	dev_get_drvdata(&(_dev)->dev)
 #define platform_set_drvdata(_dev,data)	dev_set_drvdata(&(_dev)->dev, (data))
 
+extern struct platform_device *platform_create_bundle(struct platform_driver *driver,
+					int (*probe)(struct platform_device *),
+					struct resource *res, unsigned int n_res,
+					const void *data, size_t size);
+
 /* early platform driver interface */
 struct early_platform_driver {
 	const char *class_str;
-- 
1.7.0.1


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

* [PATCH 04/62] driver core: make platform_device_id table const
  2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
                   ` (2 preceding siblings ...)
  2010-03-02 23:28 ` [PATCH 03/62] Driver core: add platform_create_bundle() helper Greg Kroah-Hartman
@ 2010-03-02 23:28 ` Greg Kroah-Hartman
  2010-03-02 23:28 ` [PATCH 05/62] sysdev: Pass attribute in sysdev_class attributes show/store Greg Kroah-Hartman
                   ` (56 subsequent siblings)
  60 siblings, 0 replies; 90+ messages in thread
From: Greg Kroah-Hartman @ 2010-03-02 23:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: Eric Miao, Greg Kroah-Hartman

From: Eric Miao <eric.y.miao@gmail.com>

The platform ID table is normally const, force that by adding the attribute.

Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 include/linux/platform_device.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
index 25e64b4..2c2d035 100644
--- a/include/linux/platform_device.h
+++ b/include/linux/platform_device.h
@@ -21,7 +21,7 @@ struct platform_device {
 	u32		num_resources;
 	struct resource	* resource;
 
-	struct platform_device_id	*id_entry;
+	const struct platform_device_id	*id_entry;
 
 	/* arch specific additions */
 	struct pdev_archdata	archdata;
-- 
1.7.0.1


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

* [PATCH 05/62] sysdev: Pass attribute in sysdev_class attributes show/store
  2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
                   ` (3 preceding siblings ...)
  2010-03-02 23:28 ` [PATCH 04/62] driver core: make platform_device_id table const Greg Kroah-Hartman
@ 2010-03-02 23:28 ` Greg Kroah-Hartman
  2010-03-02 23:28 ` [PATCH 06/62] sysdev: Convert node driver class attributes to be data driven Greg Kroah-Hartman
                   ` (55 subsequent siblings)
  60 siblings, 0 replies; 90+ messages in thread
From: Greg Kroah-Hartman @ 2010-03-02 23:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andi Kleen, Andi Kleen, Greg Kroah-Hartman

From: Andi Kleen <andi@firstfloor.org>

Passing the attribute to the low level IO functions allows all kinds
of cleanups, by sharing low level IO code without requiring
an own function for every piece of data.

Also drivers can extend the attributes with own data fields
and use that in the low level function.

Similar to sysdev_attributes and normal attributes.

This is a tree-wide sweep, converting everything in one go.

No functional changes in this patch other than passing the new
argument everywhere.

Tested on x86, the non x86 parts are uncompiled.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 arch/mips/txx9/generic/7segled.c |    5 +++-
 arch/s390/kernel/smp.c           |    8 ++++-
 arch/s390/kernel/time.c          |   49 ++++++++++++++++++++++++++++---------
 drivers/base/cpu.c               |    9 ++++--
 drivers/base/node.c              |   17 +++++++++----
 drivers/base/sys.c               |    4 +-
 drivers/cpuidle/sysfs.c          |    4 +++
 include/linux/sysdev.h           |    6 +++-
 kernel/perf_event.c              |   13 +++++++--
 kernel/sched.c                   |    4 +++
 10 files changed, 89 insertions(+), 30 deletions(-)

diff --git a/arch/mips/txx9/generic/7segled.c b/arch/mips/txx9/generic/7segled.c
index 727ab21..7f8416f 100644
--- a/arch/mips/txx9/generic/7segled.c
+++ b/arch/mips/txx9/generic/7segled.c
@@ -58,13 +58,16 @@ static ssize_t raw_store(struct sys_device *dev,
 static SYSDEV_ATTR(ascii, 0200, NULL, ascii_store);
 static SYSDEV_ATTR(raw, 0200, NULL, raw_store);
 
-static ssize_t map_seg7_show(struct sysdev_class *class, char *buf)
+static ssize_t map_seg7_show(struct sysdev_class *class,
+			     struct sysdev_class_attribute *attr,
+			     char *buf)
 {
 	memcpy(buf, &txx9_seg7map, sizeof(txx9_seg7map));
 	return sizeof(txx9_seg7map);
 }
 
 static ssize_t map_seg7_store(struct sysdev_class *class,
+			      struct sysdev_class_attribute *attr,
 			      const char *buf, size_t size)
 {
 	if (size != sizeof(txx9_seg7map))
diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index 8b10127..e212109 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -1020,7 +1020,9 @@ out:
 	return rc;
 }
 
-static ssize_t __ref rescan_store(struct sysdev_class *class, const char *buf,
+static ssize_t __ref rescan_store(struct sysdev_class *class,
+				  struct sysdev_class_attribute *attr,
+				  const char *buf,
 				  size_t count)
 {
 	int rc;
@@ -1041,7 +1043,9 @@ static ssize_t dispatching_show(struct sysdev_class *class, char *buf)
 	return count;
 }
 
-static ssize_t dispatching_store(struct sysdev_class *dev, const char *buf,
+static ssize_t dispatching_store(struct sysdev_class *dev,
+				 struct sysdev_class_attribute *attr,
+				 const char *buf,
 				 size_t count)
 {
 	int val, rc;
diff --git a/arch/s390/kernel/time.c b/arch/s390/kernel/time.c
index a8f93f1..75894c2 100644
--- a/arch/s390/kernel/time.c
+++ b/arch/s390/kernel/time.c
@@ -1116,14 +1116,18 @@ static struct sys_device etr_port1_dev = {
 /*
  * ETR class attributes
  */
-static ssize_t etr_stepping_port_show(struct sysdev_class *class, char *buf)
+static ssize_t etr_stepping_port_show(struct sysdev_class *class,
+					struct sysdev_class_attribute *attr,
+					char *buf)
 {
 	return sprintf(buf, "%i\n", etr_port0.esw.p);
 }
 
 static SYSDEV_CLASS_ATTR(stepping_port, 0400, etr_stepping_port_show, NULL);
 
-static ssize_t etr_stepping_mode_show(struct sysdev_class *class, char *buf)
+static ssize_t etr_stepping_mode_show(struct sysdev_class *class,
+				      	struct sysdev_class_attribute *attr,
+					char *buf)
 {
 	char *mode_str;
 
@@ -1584,7 +1588,9 @@ static struct sysdev_class stp_sysclass = {
 	.name	= "stp",
 };
 
-static ssize_t stp_ctn_id_show(struct sysdev_class *class, char *buf)
+static ssize_t stp_ctn_id_show(struct sysdev_class *class,
+				struct sysdev_class_attribute *attr,
+				char *buf)
 {
 	if (!stp_online)
 		return -ENODATA;
@@ -1594,7 +1600,9 @@ static ssize_t stp_ctn_id_show(struct sysdev_class *class, char *buf)
 
 static SYSDEV_CLASS_ATTR(ctn_id, 0400, stp_ctn_id_show, NULL);
 
-static ssize_t stp_ctn_type_show(struct sysdev_class *class, char *buf)
+static ssize_t stp_ctn_type_show(struct sysdev_class *class,
+				struct sysdev_class_attribute *attr,
+				char *buf)
 {
 	if (!stp_online)
 		return -ENODATA;
@@ -1603,7 +1611,9 @@ static ssize_t stp_ctn_type_show(struct sysdev_class *class, char *buf)
 
 static SYSDEV_CLASS_ATTR(ctn_type, 0400, stp_ctn_type_show, NULL);
 
-static ssize_t stp_dst_offset_show(struct sysdev_class *class, char *buf)
+static ssize_t stp_dst_offset_show(struct sysdev_class *class,
+				   struct sysdev_class_attribute *attr,
+				   char *buf)
 {
 	if (!stp_online || !(stp_info.vbits & 0x2000))
 		return -ENODATA;
@@ -1612,7 +1622,9 @@ static ssize_t stp_dst_offset_show(struct sysdev_class *class, char *buf)
 
 static SYSDEV_CLASS_ATTR(dst_offset, 0400, stp_dst_offset_show, NULL);
 
-static ssize_t stp_leap_seconds_show(struct sysdev_class *class, char *buf)
+static ssize_t stp_leap_seconds_show(struct sysdev_class *class,
+					struct sysdev_class_attribute *attr,
+					char *buf)
 {
 	if (!stp_online || !(stp_info.vbits & 0x8000))
 		return -ENODATA;
@@ -1621,7 +1633,9 @@ static ssize_t stp_leap_seconds_show(struct sysdev_class *class, char *buf)
 
 static SYSDEV_CLASS_ATTR(leap_seconds, 0400, stp_leap_seconds_show, NULL);
 
-static ssize_t stp_stratum_show(struct sysdev_class *class, char *buf)
+static ssize_t stp_stratum_show(struct sysdev_class *class,
+				struct sysdev_class_attribute *attr,
+				char *buf)
 {
 	if (!stp_online)
 		return -ENODATA;
@@ -1630,7 +1644,9 @@ static ssize_t stp_stratum_show(struct sysdev_class *class, char *buf)
 
 static SYSDEV_CLASS_ATTR(stratum, 0400, stp_stratum_show, NULL);
 
-static ssize_t stp_time_offset_show(struct sysdev_class *class, char *buf)
+static ssize_t stp_time_offset_show(struct sysdev_class *class,
+				struct sysdev_class_attribute *attr,
+				char *buf)
 {
 	if (!stp_online || !(stp_info.vbits & 0x0800))
 		return -ENODATA;
@@ -1639,7 +1655,9 @@ static ssize_t stp_time_offset_show(struct sysdev_class *class, char *buf)
 
 static SYSDEV_CLASS_ATTR(time_offset, 0400, stp_time_offset_show, NULL);
 
-static ssize_t stp_time_zone_offset_show(struct sysdev_class *class, char *buf)
+static ssize_t stp_time_zone_offset_show(struct sysdev_class *class,
+				struct sysdev_class_attribute *attr,
+				char *buf)
 {
 	if (!stp_online || !(stp_info.vbits & 0x4000))
 		return -ENODATA;
@@ -1649,7 +1667,9 @@ static ssize_t stp_time_zone_offset_show(struct sysdev_class *class, char *buf)
 static SYSDEV_CLASS_ATTR(time_zone_offset, 0400,
 			 stp_time_zone_offset_show, NULL);
 
-static ssize_t stp_timing_mode_show(struct sysdev_class *class, char *buf)
+static ssize_t stp_timing_mode_show(struct sysdev_class *class,
+				struct sysdev_class_attribute *attr,
+				char *buf)
 {
 	if (!stp_online)
 		return -ENODATA;
@@ -1658,7 +1678,9 @@ static ssize_t stp_timing_mode_show(struct sysdev_class *class, char *buf)
 
 static SYSDEV_CLASS_ATTR(timing_mode, 0400, stp_timing_mode_show, NULL);
 
-static ssize_t stp_timing_state_show(struct sysdev_class *class, char *buf)
+static ssize_t stp_timing_state_show(struct sysdev_class *class,
+				struct sysdev_class_attribute *attr,
+				char *buf)
 {
 	if (!stp_online)
 		return -ENODATA;
@@ -1667,12 +1689,15 @@ static ssize_t stp_timing_state_show(struct sysdev_class *class, char *buf)
 
 static SYSDEV_CLASS_ATTR(timing_state, 0400, stp_timing_state_show, NULL);
 
-static ssize_t stp_online_show(struct sysdev_class *class, char *buf)
+static ssize_t stp_online_show(struct sysdev_class *class,
+				struct sysdev_class_attribute *attr,
+				char *buf)
 {
 	return sprintf(buf, "%i\n", stp_online);
 }
 
 static ssize_t stp_online_store(struct sysdev_class *class,
+				struct sysdev_class_attribute *attr,
 				const char *buf, size_t count)
 {
 	unsigned int value;
diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c
index 958bd15..fd1b2f9 100644
--- a/drivers/base/cpu.c
+++ b/drivers/base/cpu.c
@@ -151,7 +151,8 @@ static ssize_t print_cpus_map(char *buf, const struct cpumask *map)
 }
 
 #define	print_cpus_func(type) \
-static ssize_t print_cpus_##type(struct sysdev_class *class, char *buf)	\
+static ssize_t print_cpus_##type(struct sysdev_class *class, 		\
+	 		struct sysdev_class_attribute *attr, char *buf)	\
 {									\
 	return print_cpus_map(buf, cpu_##type##_mask);			\
 }									\
@@ -165,7 +166,8 @@ print_cpus_func(present);
 /*
  * Print values for NR_CPUS and offlined cpus
  */
-static ssize_t print_cpus_kernel_max(struct sysdev_class *class, char *buf)
+static ssize_t print_cpus_kernel_max(struct sysdev_class *class,
+				     struct sysdev_class_attribute *attr, char *buf)
 {
 	int n = snprintf(buf, PAGE_SIZE-2, "%d\n", NR_CPUS - 1);
 	return n;
@@ -175,7 +177,8 @@ static SYSDEV_CLASS_ATTR(kernel_max, 0444, print_cpus_kernel_max, NULL);
 /* arch-optional setting to enable display of offline cpus >= nr_cpu_ids */
 unsigned int total_cpus;
 
-static ssize_t print_cpus_offline(struct sysdev_class *class, char *buf)
+static ssize_t print_cpus_offline(struct sysdev_class *class,
+				  struct sysdev_class_attribute *attr, char *buf)
 {
 	int n = 0, len = PAGE_SIZE-2;
 	cpumask_var_t offline;
diff --git a/drivers/base/node.c b/drivers/base/node.c
index 7012279..85c9d30 100644
--- a/drivers/base/node.c
+++ b/drivers/base/node.c
@@ -544,23 +544,29 @@ static ssize_t print_nodes_state(enum node_states state, char *buf)
 	return n;
 }
 
-static ssize_t print_nodes_possible(struct sysdev_class *class, char *buf)
+static ssize_t print_nodes_possible(struct sysdev_class *class,
+				    struct sysdev_class_attribute *attr, char *buf)
 {
 	return print_nodes_state(N_POSSIBLE, buf);
 }
 
-static ssize_t print_nodes_online(struct sysdev_class *class, char *buf)
+static ssize_t print_nodes_online(struct sysdev_class *class,
+				  struct sysdev_class_attribute *attr,
+				  char *buf)
 {
 	return print_nodes_state(N_ONLINE, buf);
 }
 
 static ssize_t print_nodes_has_normal_memory(struct sysdev_class *class,
-						char *buf)
+					     struct sysdev_class_attribute *attr,
+					     char *buf)
 {
 	return print_nodes_state(N_NORMAL_MEMORY, buf);
 }
 
-static ssize_t print_nodes_has_cpu(struct sysdev_class *class, char *buf)
+static ssize_t print_nodes_has_cpu(struct sysdev_class *class,
+				   struct sysdev_class_attribute *attr,
+				   char *buf)
 {
 	return print_nodes_state(N_CPU, buf);
 }
@@ -573,7 +579,8 @@ static SYSDEV_CLASS_ATTR(has_cpu, 0444, print_nodes_has_cpu, NULL);
 
 #ifdef CONFIG_HIGHMEM
 static ssize_t print_nodes_has_high_memory(struct sysdev_class *class,
-						 char *buf)
+					   struct sysdev_class_attribute *attr,
+					   char *buf)
 {
 	return print_nodes_state(N_HIGH_MEMORY, buf);
 }
diff --git a/drivers/base/sys.c b/drivers/base/sys.c
index 0d90390..a38445c 100644
--- a/drivers/base/sys.c
+++ b/drivers/base/sys.c
@@ -89,7 +89,7 @@ static ssize_t sysdev_class_show(struct kobject *kobj, struct attribute *attr,
 	struct sysdev_class_attribute *class_attr = to_sysdev_class_attr(attr);
 
 	if (class_attr->show)
-		return class_attr->show(class, buffer);
+		return class_attr->show(class, class_attr, buffer);
 	return -EIO;
 }
 
@@ -100,7 +100,7 @@ static ssize_t sysdev_class_store(struct kobject *kobj, struct attribute *attr,
 	struct sysdev_class_attribute *class_attr = to_sysdev_class_attr(attr);
 
 	if (class_attr->store)
-		return class_attr->store(class, buffer, count);
+		return class_attr->store(class, class_attr, buffer, count);
 	return -EIO;
 }
 
diff --git a/drivers/cpuidle/sysfs.c b/drivers/cpuidle/sysfs.c
index 97b0038..c9cefac 100644
--- a/drivers/cpuidle/sysfs.c
+++ b/drivers/cpuidle/sysfs.c
@@ -22,6 +22,7 @@ static int __init cpuidle_sysfs_setup(char *unused)
 __setup("cpuidle_sysfs_switch", cpuidle_sysfs_setup);
 
 static ssize_t show_available_governors(struct sysdev_class *class,
+					struct sysdev_class_attribute *attr,
 					char *buf)
 {
 	ssize_t i = 0;
@@ -41,6 +42,7 @@ out:
 }
 
 static ssize_t show_current_driver(struct sysdev_class *class,
+				   struct sysdev_class_attribute *attr,
 				   char *buf)
 {
 	ssize_t ret;
@@ -56,6 +58,7 @@ static ssize_t show_current_driver(struct sysdev_class *class,
 }
 
 static ssize_t show_current_governor(struct sysdev_class *class,
+				     struct sysdev_class_attribute *attr,
 				     char *buf)
 {
 	ssize_t ret;
@@ -71,6 +74,7 @@ static ssize_t show_current_governor(struct sysdev_class *class,
 }
 
 static ssize_t store_current_governor(struct sysdev_class *class,
+				      struct sysdev_class_attribute *attr,
 				      const char *buf, size_t count)
 {
 	char gov_name[CPUIDLE_NAME_LEN];
diff --git a/include/linux/sysdev.h b/include/linux/sysdev.h
index f395bb3..c2458fa 100644
--- a/include/linux/sysdev.h
+++ b/include/linux/sysdev.h
@@ -41,8 +41,10 @@ struct sysdev_class {
 
 struct sysdev_class_attribute {
 	struct attribute attr;
-	ssize_t (*show)(struct sysdev_class *, char *);
-	ssize_t (*store)(struct sysdev_class *, const char *, size_t);
+	ssize_t (*show)(struct sysdev_class *, struct sysdev_class_attribute *,
+			char *);
+	ssize_t (*store)(struct sysdev_class *, struct sysdev_class_attribute *,
+			 const char *, size_t);
 };
 
 #define _SYSDEV_CLASS_ATTR(_name,_mode,_show,_store) 		\
diff --git a/kernel/perf_event.c b/kernel/perf_event.c
index a661e79..4bafeac 100644
--- a/kernel/perf_event.c
+++ b/kernel/perf_event.c
@@ -5481,13 +5481,16 @@ void __init perf_event_init(void)
 	register_cpu_notifier(&perf_cpu_nb);
 }
 
-static ssize_t perf_show_reserve_percpu(struct sysdev_class *class, char *buf)
+static ssize_t perf_show_reserve_percpu(struct sysdev_class *class,
+					struct sysdev_class_attribute *attr,
+					char *buf)
 {
 	return sprintf(buf, "%d\n", perf_reserved_percpu);
 }
 
 static ssize_t
 perf_set_reserve_percpu(struct sysdev_class *class,
+			struct sysdev_class_attribute *attr,
 			const char *buf,
 			size_t count)
 {
@@ -5516,13 +5519,17 @@ perf_set_reserve_percpu(struct sysdev_class *class,
 	return count;
 }
 
-static ssize_t perf_show_overcommit(struct sysdev_class *class, char *buf)
+static ssize_t perf_show_overcommit(struct sysdev_class *class,
+				    struct sysdev_class_attribute *attr,
+				    char *buf)
 {
 	return sprintf(buf, "%d\n", perf_overcommit);
 }
 
 static ssize_t
-perf_set_overcommit(struct sysdev_class *class, const char *buf, size_t count)
+perf_set_overcommit(struct sysdev_class *class,
+		    struct sysdev_class_attribute *attr,
+		    const char *buf, size_t count)
 {
 	unsigned long val;
 	int err;
diff --git a/kernel/sched.c b/kernel/sched.c
index 6a212c9..a678e08 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -7406,11 +7406,13 @@ static ssize_t sched_power_savings_store(const char *buf, size_t count, int smt)
 
 #ifdef CONFIG_SCHED_MC
 static ssize_t sched_mc_power_savings_show(struct sysdev_class *class,
+					   struct sysdev_class_attribute *attr,
 					   char *page)
 {
 	return sprintf(page, "%u\n", sched_mc_power_savings);
 }
 static ssize_t sched_mc_power_savings_store(struct sysdev_class *class,
+					    struct sysdev_class_attribute *attr,
 					    const char *buf, size_t count)
 {
 	return sched_power_savings_store(buf, count, 0);
@@ -7422,11 +7424,13 @@ static SYSDEV_CLASS_ATTR(sched_mc_power_savings, 0644,
 
 #ifdef CONFIG_SCHED_SMT
 static ssize_t sched_smt_power_savings_show(struct sysdev_class *dev,
+					    struct sysdev_class_attribute *attr,
 					    char *page)
 {
 	return sprintf(page, "%u\n", sched_smt_power_savings);
 }
 static ssize_t sched_smt_power_savings_store(struct sysdev_class *dev,
+					     struct sysdev_class_attribute *attr,
 					     const char *buf, size_t count)
 {
 	return sched_power_savings_store(buf, count, 1);
-- 
1.7.0.1


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

* [PATCH 06/62] sysdev: Convert node driver class attributes to be data driven
  2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
                   ` (4 preceding siblings ...)
  2010-03-02 23:28 ` [PATCH 05/62] sysdev: Pass attribute in sysdev_class attributes show/store Greg Kroah-Hartman
@ 2010-03-02 23:28 ` Greg Kroah-Hartman
  2010-03-02 23:28 ` [PATCH 07/62] sysdev: Convert cpu driver sysdev class attributes Greg Kroah-Hartman
                   ` (54 subsequent siblings)
  60 siblings, 0 replies; 90+ messages in thread
From: Greg Kroah-Hartman @ 2010-03-02 23:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andi Kleen, Andi Kleen, Greg Kroah-Hartman

From: Andi Kleen <andi@firstfloor.org>

Using the new attribute argument convert the node driver class
attributes to carry the node state. Then use a shared function to do
what a lot of individual functions did before.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/base/node.c |   65 ++++++++++++++------------------------------------
 1 files changed, 18 insertions(+), 47 deletions(-)

diff --git a/drivers/base/node.c b/drivers/base/node.c
index 85c9d30..aa8bc4b 100644
--- a/drivers/base/node.c
+++ b/drivers/base/node.c
@@ -544,59 +544,29 @@ static ssize_t print_nodes_state(enum node_states state, char *buf)
 	return n;
 }
 
-static ssize_t print_nodes_possible(struct sysdev_class *class,
-				    struct sysdev_class_attribute *attr, char *buf)
-{
-	return print_nodes_state(N_POSSIBLE, buf);
-}
-
-static ssize_t print_nodes_online(struct sysdev_class *class,
-				  struct sysdev_class_attribute *attr,
-				  char *buf)
-{
-	return print_nodes_state(N_ONLINE, buf);
-}
-
-static ssize_t print_nodes_has_normal_memory(struct sysdev_class *class,
-					     struct sysdev_class_attribute *attr,
-					     char *buf)
-{
-	return print_nodes_state(N_NORMAL_MEMORY, buf);
-}
-
-static ssize_t print_nodes_has_cpu(struct sysdev_class *class,
-				   struct sysdev_class_attribute *attr,
-				   char *buf)
-{
-	return print_nodes_state(N_CPU, buf);
-}
-
-static SYSDEV_CLASS_ATTR(possible, 0444, print_nodes_possible, NULL);
-static SYSDEV_CLASS_ATTR(online, 0444, print_nodes_online, NULL);
-static SYSDEV_CLASS_ATTR(has_normal_memory, 0444, print_nodes_has_normal_memory,
-									NULL);
-static SYSDEV_CLASS_ATTR(has_cpu, 0444, print_nodes_has_cpu, NULL);
+struct node_attr {
+	struct sysdev_class_attribute attr;
+	enum node_states state;
+};
 
-#ifdef CONFIG_HIGHMEM
-static ssize_t print_nodes_has_high_memory(struct sysdev_class *class,
-					   struct sysdev_class_attribute *attr,
-					   char *buf)
+static ssize_t show_node_state(struct sysdev_class *class,
+			       struct sysdev_class_attribute *attr, char *buf)
 {
-	return print_nodes_state(N_HIGH_MEMORY, buf);
+	struct node_attr *na = container_of(attr, struct node_attr, attr);
+	return print_nodes_state(na->state, buf);
 }
 
-static SYSDEV_CLASS_ATTR(has_high_memory, 0444, print_nodes_has_high_memory,
-									 NULL);
-#endif
+#define _NODE_ATTR(name, state) \
+	{ _SYSDEV_CLASS_ATTR(name, 0444, show_node_state, NULL), state }
 
-struct sysdev_class_attribute *node_state_attr[] = {
-	&attr_possible,
-	&attr_online,
-	&attr_has_normal_memory,
+static struct node_attr node_state_attr[] = {
+	_NODE_ATTR(possible, N_POSSIBLE),
+	_NODE_ATTR(online, N_ONLINE),
+	_NODE_ATTR(has_normal_memory, N_NORMAL_MEMORY),
+	_NODE_ATTR(has_cpu, N_CPU),
 #ifdef CONFIG_HIGHMEM
-	&attr_has_high_memory,
+	_NODE_ATTR(has_high_memory, N_HIGH_MEMORY),
 #endif
-	&attr_has_cpu,
 };
 
 static int node_states_init(void)
@@ -604,9 +574,10 @@ static int node_states_init(void)
 	int i;
 	int err = 0;
 
+	BUILD_BUG_ON(ARRAY_SIZE(node_state_attr) != NR_NODE_STATES);
 	for (i = 0;  i < NR_NODE_STATES; i++) {
 		int ret;
-		ret = sysdev_class_create_file(&node_class, node_state_attr[i]);
+		ret = sysdev_class_create_file(&node_class, &node_state_attr[i].attr);
 		if (!err)
 			err = ret;
 	}
-- 
1.7.0.1


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

* [PATCH 07/62] sysdev: Convert cpu driver sysdev class attributes
  2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
                   ` (5 preceding siblings ...)
  2010-03-02 23:28 ` [PATCH 06/62] sysdev: Convert node driver class attributes to be data driven Greg Kroah-Hartman
@ 2010-03-02 23:28 ` Greg Kroah-Hartman
  2010-03-02 23:28 ` [PATCH 08/62] sysfs: Add sysfs_add/remove_files utility functions Greg Kroah-Hartman
                   ` (53 subsequent siblings)
  60 siblings, 0 replies; 90+ messages in thread
From: Greg Kroah-Hartman @ 2010-03-02 23:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andi Kleen, Andi Kleen, Greg Kroah-Hartman

From: Andi Kleen <andi@firstfloor.org>

Using the new attribute argument convert the cpu driver class attributes
to carry the node state. Then use a shared function to do what a lot of
individual functions did before.

This eliminates an ugly macro.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/base/cpu.c |   37 +++++++++++++++++++++----------------
 1 files changed, 21 insertions(+), 16 deletions(-)

diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c
index fd1b2f9..b04ecfc 100644
--- a/drivers/base/cpu.c
+++ b/drivers/base/cpu.c
@@ -141,27 +141,32 @@ static SYSDEV_ATTR(crash_notes, 0400, show_crash_notes, NULL);
 /*
  * Print cpu online, possible, present, and system maps
  */
-static ssize_t print_cpus_map(char *buf, const struct cpumask *map)
+
+struct cpu_attr {
+	struct sysdev_class_attribute attr;
+	const struct cpumask *const * const map;
+};
+
+static ssize_t show_cpus_attr(struct sysdev_class *class,
+			      struct sysdev_class_attribute *attr,
+			      char *buf)
 {
-	int n = cpulist_scnprintf(buf, PAGE_SIZE-2, map);
+	struct cpu_attr *ca = container_of(attr, struct cpu_attr, attr);
+	int n = cpulist_scnprintf(buf, PAGE_SIZE-2, *(ca->map));
 
 	buf[n++] = '\n';
 	buf[n] = '\0';
 	return n;
 }
 
-#define	print_cpus_func(type) \
-static ssize_t print_cpus_##type(struct sysdev_class *class, 		\
-	 		struct sysdev_class_attribute *attr, char *buf)	\
-{									\
-	return print_cpus_map(buf, cpu_##type##_mask);			\
-}									\
-static struct sysdev_class_attribute attr_##type##_map = 		\
-	_SYSDEV_CLASS_ATTR(type, 0444, print_cpus_##type, NULL)
+#define _CPU_ATTR(name, map)						\
+	{ _SYSDEV_CLASS_ATTR(name, 0444, show_cpus_attr, NULL), map }
 
-print_cpus_func(online);
-print_cpus_func(possible);
-print_cpus_func(present);
+static struct cpu_attr cpu_attrs[] = {
+	_CPU_ATTR(online, &cpu_online_mask),
+	_CPU_ATTR(possible, &cpu_possible_mask),
+	_CPU_ATTR(present, &cpu_present_mask),
+};
 
 /*
  * Print values for NR_CPUS and offlined cpus
@@ -208,9 +213,9 @@ static ssize_t print_cpus_offline(struct sysdev_class *class,
 static SYSDEV_CLASS_ATTR(offline, 0444, print_cpus_offline, NULL);
 
 static struct sysdev_class_attribute *cpu_state_attr[] = {
-	&attr_online_map,
-	&attr_possible_map,
-	&attr_present_map,
+	&cpu_attrs[0].attr,
+	&cpu_attrs[1].attr,
+	&cpu_attrs[2].attr,
 	&attr_kernel_max,
 	&attr_offline,
 };
-- 
1.7.0.1


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

* [PATCH 08/62] sysfs: Add sysfs_add/remove_files utility functions
  2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
                   ` (6 preceding siblings ...)
  2010-03-02 23:28 ` [PATCH 07/62] sysdev: Convert cpu driver sysdev class attributes Greg Kroah-Hartman
@ 2010-03-02 23:28 ` Greg Kroah-Hartman
  2010-03-02 23:28 ` [PATCH 09/62] sysfs: Add attribute array to sysdev classes Greg Kroah-Hartman
                   ` (52 subsequent siblings)
  60 siblings, 0 replies; 90+ messages in thread
From: Greg Kroah-Hartman @ 2010-03-02 23:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andi Kleen, Andi Kleen, Greg Kroah-Hartman

From: Andi Kleen <andi@firstfloor.org>

Adding/Removing a whole array of attributes is very common. Add a standard
utility function to do this with a simple function call, instead of
requiring drivers to open code this.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 fs/sysfs/file.c       |   20 ++++++++++++++++++++
 include/linux/sysfs.h |   14 ++++++++++++++
 2 files changed, 34 insertions(+), 0 deletions(-)

diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
index dc30d9e..50b725b 100644
--- a/fs/sysfs/file.c
+++ b/fs/sysfs/file.c
@@ -542,6 +542,18 @@ int sysfs_create_file(struct kobject * kobj, const struct attribute * attr)
 
 }
 
+int sysfs_create_files(struct kobject *kobj, const struct attribute **ptr)
+{
+	int err = 0;
+	int i;
+
+	for (i = 0; ptr[i] && !err; i++)
+		err = sysfs_create_file(kobj, ptr[i]);
+	if (err)
+		while (--i >= 0)
+			sysfs_remove_file(kobj, ptr[i]);
+	return err;
+}
 
 /**
  * sysfs_add_file_to_group - add an attribute file to a pre-existing group.
@@ -614,6 +626,12 @@ void sysfs_remove_file(struct kobject * kobj, const struct attribute * attr)
 	sysfs_hash_and_remove(kobj->sd, attr->name);
 }
 
+void sysfs_remove_files(struct kobject * kobj, const struct attribute **ptr)
+{
+	int i;
+	for (i = 0; ptr[i]; i++)
+		sysfs_remove_file(kobj, ptr[i]);
+}
 
 /**
  * sysfs_remove_file_from_group - remove an attribute file from a group.
@@ -732,3 +750,5 @@ EXPORT_SYMBOL_GPL(sysfs_schedule_callback);
 
 EXPORT_SYMBOL_GPL(sysfs_create_file);
 EXPORT_SYMBOL_GPL(sysfs_remove_file);
+EXPORT_SYMBOL_GPL(sysfs_remove_files);
+EXPORT_SYMBOL_GPL(sysfs_create_files);
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
index cfa8308..3e85265 100644
--- a/include/linux/sysfs.h
+++ b/include/linux/sysfs.h
@@ -94,9 +94,12 @@ int __must_check sysfs_move_dir(struct kobject *kobj,
 
 int __must_check sysfs_create_file(struct kobject *kobj,
 				   const struct attribute *attr);
+int __must_check sysfs_create_files(struct kobject *kobj,
+				   const struct attribute **attr);
 int __must_check sysfs_chmod_file(struct kobject *kobj, struct attribute *attr,
 				  mode_t mode);
 void sysfs_remove_file(struct kobject *kobj, const struct attribute *attr);
+void sysfs_remove_files(struct kobject *kobj, const struct attribute **attr);
 
 int __must_check sysfs_create_bin_file(struct kobject *kobj,
 				       const struct bin_attribute *attr);
@@ -164,6 +167,12 @@ static inline int sysfs_create_file(struct kobject *kobj,
 	return 0;
 }
 
+static inline int sysfs_create_files(struct kobject *kobj,
+				    const struct attribute **attr)
+{
+	return 0;
+}
+
 static inline int sysfs_chmod_file(struct kobject *kobj,
 				   struct attribute *attr, mode_t mode)
 {
@@ -175,6 +184,11 @@ static inline void sysfs_remove_file(struct kobject *kobj,
 {
 }
 
+static inline void sysfs_remove_files(struct kobject *kobj,
+				     const struct attribute **attr)
+{
+}
+
 static inline int sysfs_create_bin_file(struct kobject *kobj,
 					const struct bin_attribute *attr)
 {
-- 
1.7.0.1


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

* [PATCH 09/62] sysfs: Add attribute array to sysdev classes
  2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
                   ` (7 preceding siblings ...)
  2010-03-02 23:28 ` [PATCH 08/62] sysfs: Add sysfs_add/remove_files utility functions Greg Kroah-Hartman
@ 2010-03-02 23:28 ` Greg Kroah-Hartman
  2010-03-02 23:28 ` [PATCH 10/62] sysdev: Convert node driver Greg Kroah-Hartman
                   ` (51 subsequent siblings)
  60 siblings, 0 replies; 90+ messages in thread
From: Greg Kroah-Hartman @ 2010-03-02 23:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andi Kleen, Andi Kleen, Greg Kroah-Hartman

From: Andi Kleen <andi@firstfloor.org>

Add a attribute array that is automatically registered and unregistered
to struct sysdev_class. This is similar to what struct class has.

A lot of drivers add list of attributes, so it's better to do
this easily in the common sysdev layer.

This adds a new field to struct sysdev_class. I audited the
whole tree and there are no dynamically allocated sysdev classes,
so this is fully compatible.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/base/sys.c     |    9 ++++++++-
 include/linux/sysdev.h |    2 ++
 2 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/drivers/base/sys.c b/drivers/base/sys.c
index a38445c..747c99e 100644
--- a/drivers/base/sys.c
+++ b/drivers/base/sys.c
@@ -145,13 +145,20 @@ int sysdev_class_register(struct sysdev_class *cls)
 	if (retval)
 		return retval;
 
-	return kset_register(&cls->kset);
+	retval = kset_register(&cls->kset);
+	if (!retval && cls->attrs)
+		retval = sysfs_create_files(&cls->kset.kobj,
+					    (const struct attribute **)cls->attrs);
+	return retval;
 }
 
 void sysdev_class_unregister(struct sysdev_class *cls)
 {
 	pr_debug("Unregistering sysdev class '%s'\n",
 		 kobject_name(&cls->kset.kobj));
+	if (cls->attrs)
+		sysfs_remove_files(&cls->kset.kobj,
+				   (const struct attribute **)cls->attrs);
 	kset_unregister(&cls->kset);
 }
 
diff --git a/include/linux/sysdev.h b/include/linux/sysdev.h
index c2458fa..b6244f9 100644
--- a/include/linux/sysdev.h
+++ b/include/linux/sysdev.h
@@ -27,10 +27,12 @@
 
 
 struct sys_device;
+struct sysdev_class_attribute;
 
 struct sysdev_class {
 	const char *name;
 	struct list_head	drivers;
+	struct sysdev_class_attribute **attrs;
 
 	/* Default operations for these types of devices */
 	int	(*shutdown)(struct sys_device *);
-- 
1.7.0.1


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

* [PATCH 10/62] sysdev: Convert node driver
  2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
                   ` (8 preceding siblings ...)
  2010-03-02 23:28 ` [PATCH 09/62] sysfs: Add attribute array to sysdev classes Greg Kroah-Hartman
@ 2010-03-02 23:28 ` Greg Kroah-Hartman
  2010-03-02 23:28 ` [PATCH 11/62] sysdev: Use sysdev_class attribute arrays in " Greg Kroah-Hartman
                   ` (50 subsequent siblings)
  60 siblings, 0 replies; 90+ messages in thread
From: Greg Kroah-Hartman @ 2010-03-02 23:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andi Kleen, Andi Kleen, Greg Kroah-Hartman

From: Andi Kleen <andi@firstfloor.org>

Use sysdev_class attribute arrays in node driver

Convert the node driver to sysdev_class attribute arrays. This
greatly cleans up the code and remove a lot of code.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/base/cpu.c |   57 +++++++++++++++------------------------------------
 1 files changed, 17 insertions(+), 40 deletions(-)

diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c
index b04ecfc..fb456b7 100644
--- a/drivers/base/cpu.c
+++ b/drivers/base/cpu.c
@@ -13,8 +13,11 @@
 
 #include "base.h"
 
+static struct sysdev_class_attribute *cpu_sysdev_class_attrs[];
+
 struct sysdev_class cpu_sysdev_class = {
 	.name = "cpu",
+	.attrs = cpu_sysdev_class_attrs,
 };
 EXPORT_SYMBOL(cpu_sysdev_class);
 
@@ -90,20 +93,6 @@ static ssize_t cpu_release_store(struct class *class, const char *buf,
 
 static CLASS_ATTR(probe, S_IWUSR, NULL, cpu_probe_store);
 static CLASS_ATTR(release, S_IWUSR, NULL, cpu_release_store);
-
-int __init cpu_probe_release_init(void)
-{
-	int rc;
-
-	rc = sysfs_create_file(&cpu_sysdev_class.kset.kobj,
-			       &class_attr_probe.attr);
-	if (!rc)
-		rc = sysfs_create_file(&cpu_sysdev_class.kset.kobj,
-				       &class_attr_release.attr);
-
-	return rc;
-}
-device_initcall(cpu_probe_release_init);
 #endif /* CONFIG_ARCH_CPU_PROBE_RELEASE */
 
 #else /* ... !CONFIG_HOTPLUG_CPU */
@@ -162,6 +151,7 @@ static ssize_t show_cpus_attr(struct sysdev_class *class,
 #define _CPU_ATTR(name, map)						\
 	{ _SYSDEV_CLASS_ATTR(name, 0444, show_cpus_attr, NULL), map }
 
+/* Keep in sync with cpu_sysdev_class_attrs */
 static struct cpu_attr cpu_attrs[] = {
 	_CPU_ATTR(online, &cpu_online_mask),
 	_CPU_ATTR(possible, &cpu_possible_mask),
@@ -212,29 +202,6 @@ static ssize_t print_cpus_offline(struct sysdev_class *class,
 }
 static SYSDEV_CLASS_ATTR(offline, 0444, print_cpus_offline, NULL);
 
-static struct sysdev_class_attribute *cpu_state_attr[] = {
-	&cpu_attrs[0].attr,
-	&cpu_attrs[1].attr,
-	&cpu_attrs[2].attr,
-	&attr_kernel_max,
-	&attr_offline,
-};
-
-static int cpu_states_init(void)
-{
-	int i;
-	int err = 0;
-
-	for (i = 0;  i < ARRAY_SIZE(cpu_state_attr); i++) {
-		int ret;
-		ret = sysdev_class_create_file(&cpu_sysdev_class,
-						cpu_state_attr[i]);
-		if (!err)
-			err = ret;
-	}
-	return err;
-}
-
 /*
  * register_cpu - Setup a sysfs device for a CPU.
  * @cpu - cpu->hotpluggable field set to 1 will generate a control file in
@@ -280,9 +247,6 @@ int __init cpu_dev_init(void)
 	int err;
 
 	err = sysdev_class_register(&cpu_sysdev_class);
-	if (!err)
-		err = cpu_states_init();
-
 #if defined(CONFIG_SCHED_MC) || defined(CONFIG_SCHED_SMT)
 	if (!err)
 		err = sched_create_sysfs_power_savings_entries(&cpu_sysdev_class);
@@ -290,3 +254,16 @@ int __init cpu_dev_init(void)
 
 	return err;
 }
+
+static struct sysdev_class_attribute *cpu_sysdev_class_attrs[] = {
+#ifdef CONFIG_ARCH_CPU_PROBE_RELEASE
+	&class_attr_probe.attr,
+	&class_attr_release.attr,
+#endif
+	&cpu_attrs[0].attr,
+	&cpu_attrs[1].attr,
+	&cpu_attrs[2].attr,
+	&attr_kernel_max,
+	&attr_offline,
+	NULL
+};
-- 
1.7.0.1


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

* [PATCH 11/62] sysdev: Use sysdev_class attribute arrays in node driver
  2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
                   ` (9 preceding siblings ...)
  2010-03-02 23:28 ` [PATCH 10/62] sysdev: Convert node driver Greg Kroah-Hartman
@ 2010-03-02 23:28 ` Greg Kroah-Hartman
  2010-03-02 23:28 ` [PATCH 12/62] sysdev: Add sysdev_create/remove_files Greg Kroah-Hartman
                   ` (49 subsequent siblings)
  60 siblings, 0 replies; 90+ messages in thread
From: Greg Kroah-Hartman @ 2010-03-02 23:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andi Kleen, Andi Kleen, Greg Kroah-Hartman

From: Andi Kleen <andi@firstfloor.org>

Convert the node driver to sysdev_class attribute arrays. This
greatly cleans up the code and remove a lot of code.

Saves ~150 bytes of code on x86-64.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/base/node.c |   31 ++++++++++++++++---------------
 1 files changed, 16 insertions(+), 15 deletions(-)

diff --git a/drivers/base/node.c b/drivers/base/node.c
index aa8bc4b..ad43185 100644
--- a/drivers/base/node.c
+++ b/drivers/base/node.c
@@ -16,8 +16,11 @@
 #include <linux/device.h>
 #include <linux/swap.h>
 
+static struct sysdev_class_attribute *node_state_attrs[];
+
 static struct sysdev_class node_class = {
 	.name = "node",
+	.attrs = node_state_attrs,
 };
 
 
@@ -569,29 +572,27 @@ static struct node_attr node_state_attr[] = {
 #endif
 };
 
-static int node_states_init(void)
-{
-	int i;
-	int err = 0;
-
-	BUILD_BUG_ON(ARRAY_SIZE(node_state_attr) != NR_NODE_STATES);
-	for (i = 0;  i < NR_NODE_STATES; i++) {
-		int ret;
-		ret = sysdev_class_create_file(&node_class, &node_state_attr[i].attr);
-		if (!err)
-			err = ret;
-	}
-	return err;
-}
+static struct sysdev_class_attribute *node_state_attrs[] = {
+	&node_state_attr[0].attr,
+	&node_state_attr[1].attr,
+	&node_state_attr[2].attr,
+	&node_state_attr[3].attr,
+#ifdef CONFIG_HIGHMEM
+	&node_state_attr[4].attr,
+#endif
+	NULL
+};
 
 #define NODE_CALLBACK_PRI	2	/* lower than SLAB */
 static int __init register_node_type(void)
 {
 	int ret;
 
+ 	BUILD_BUG_ON(ARRAY_SIZE(node_state_attr) != NR_NODE_STATES);
+ 	BUILD_BUG_ON(ARRAY_SIZE(node_state_attrs)-1 != NR_NODE_STATES);
+
 	ret = sysdev_class_register(&node_class);
 	if (!ret) {
-		ret = node_states_init();
 		hotplug_memory_notifier(node_memory_callback,
 					NODE_CALLBACK_PRI);
 	}
-- 
1.7.0.1


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

* [PATCH 12/62] sysdev: Add sysdev_create/remove_files
  2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
                   ` (10 preceding siblings ...)
  2010-03-02 23:28 ` [PATCH 11/62] sysdev: Use sysdev_class attribute arrays in " Greg Kroah-Hartman
@ 2010-03-02 23:28 ` Greg Kroah-Hartman
  2010-03-02 23:28 ` [PATCH 13/62] sysdev: Fix type of sysdev class attribute in memory driver Greg Kroah-Hartman
                   ` (48 subsequent siblings)
  60 siblings, 0 replies; 90+ messages in thread
From: Greg Kroah-Hartman @ 2010-03-02 23:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andi Kleen, Andi Kleen, Greg Kroah-Hartman

From: Andi Kleen <andi@firstfloor.org>

Allow to create/remove arrays of sysdev attributes

Just wrappers around sysfs_create/move_files

Will be used later to clean up some drivers.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 include/linux/sysdev.h |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/include/linux/sysdev.h b/include/linux/sysdev.h
index b6244f9..1154c29 100644
--- a/include/linux/sysdev.h
+++ b/include/linux/sysdev.h
@@ -123,6 +123,19 @@ struct sysdev_attribute {
 extern int sysdev_create_file(struct sys_device *, struct sysdev_attribute *);
 extern void sysdev_remove_file(struct sys_device *, struct sysdev_attribute *);
 
+/* Create/remove NULL terminated attribute list */
+static inline int
+sysdev_create_files(struct sys_device *d, struct sysdev_attribute **a)
+{
+	return sysfs_create_files(&d->kobj, (const struct attribute **)a);
+}
+
+static inline void
+sysdev_remove_files(struct sys_device *d, struct sysdev_attribute **a)
+{
+	return sysfs_remove_files(&d->kobj, (const struct attribute **)a);
+}
+
 struct sysdev_ext_attribute {
 	struct sysdev_attribute attr;
 	void *var;
-- 
1.7.0.1


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

* [PATCH 13/62] sysdev: Fix type of sysdev class attribute in memory driver
  2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
                   ` (11 preceding siblings ...)
  2010-03-02 23:28 ` [PATCH 12/62] sysdev: Add sysdev_create/remove_files Greg Kroah-Hartman
@ 2010-03-02 23:28 ` Greg Kroah-Hartman
  2010-03-02 23:28 ` [PATCH 14/62] sysdev: fix missing s390 conversion Greg Kroah-Hartman
                   ` (47 subsequent siblings)
  60 siblings, 0 replies; 90+ messages in thread
From: Greg Kroah-Hartman @ 2010-03-02 23:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andi Kleen, Andi Kleen, Greg Kroah-Hartman

From: Andi Kleen <andi@firstfloor.org>

This attribute is really a sysdev_class attribute, not a plain class attribute.

They are identical in layout currently, but this might not always be
the case.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/base/memory.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/base/memory.c b/drivers/base/memory.c
index bd02505..563656a 100644
--- a/drivers/base/memory.c
+++ b/drivers/base/memory.c
@@ -309,17 +309,18 @@ static SYSDEV_ATTR(removable, 0444, show_mem_removable, NULL);
  * Block size attribute stuff
  */
 static ssize_t
-print_block_size(struct class *class, char *buf)
+print_block_size(struct sysdev_class *class, struct sysdev_class_attribute *attr,
+		 char *buf)
 {
 	return sprintf(buf, "%#lx\n", (unsigned long)PAGES_PER_SECTION * PAGE_SIZE);
 }
 
-static CLASS_ATTR(block_size_bytes, 0444, print_block_size, NULL);
+static SYSDEV_CLASS_ATTR(block_size_bytes, 0444, print_block_size, NULL);
 
 static int block_size_init(void)
 {
 	return sysfs_create_file(&memory_sysdev_class.kset.kobj,
-				&class_attr_block_size_bytes.attr);
+				&attr_block_size_bytes.attr);
 }
 
 /*
-- 
1.7.0.1


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

* [PATCH 14/62] sysdev: fix missing s390 conversion
  2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
                   ` (12 preceding siblings ...)
  2010-03-02 23:28 ` [PATCH 13/62] sysdev: Fix type of sysdev class attribute in memory driver Greg Kroah-Hartman
@ 2010-03-02 23:28 ` Greg Kroah-Hartman
  2010-03-02 23:28 ` [PATCH 15/62] driver-core: Add attribute argument to class_attribute show/store Greg Kroah-Hartman
                   ` (46 subsequent siblings)
  60 siblings, 0 replies; 90+ messages in thread
From: Greg Kroah-Hartman @ 2010-03-02 23:28 UTC (permalink / raw)
  To: linux-kernel
  Cc: Heiko Carstens, Andi Kleen, Martin Schwidefsky, Greg Kroah-Hartman

From: Heiko Carstens <heiko.carstens@de.ibm.com>

In linux-next "sysdev: Pass attribute in sysdev_class attributes show/store"
forgot to convert one place in s390 code. Here is the missing part.

Cc: Andi Kleen <ak@linux.intel.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 arch/s390/kernel/smp.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
index e212109..29f65bc 100644
--- a/arch/s390/kernel/smp.c
+++ b/arch/s390/kernel/smp.c
@@ -1033,7 +1033,9 @@ static ssize_t __ref rescan_store(struct sysdev_class *class,
 static SYSDEV_CLASS_ATTR(rescan, 0200, NULL, rescan_store);
 #endif /* CONFIG_HOTPLUG_CPU */
 
-static ssize_t dispatching_show(struct sysdev_class *class, char *buf)
+static ssize_t dispatching_show(struct sysdev_class *class,
+				struct sysdev_class_attribute *attr,
+				char *buf)
 {
 	ssize_t count;
 
-- 
1.7.0.1


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

* [PATCH 15/62] driver-core: Add attribute argument to class_attribute show/store
  2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
                   ` (13 preceding siblings ...)
  2010-03-02 23:28 ` [PATCH 14/62] sysdev: fix missing s390 conversion Greg Kroah-Hartman
@ 2010-03-02 23:28 ` Greg Kroah-Hartman
  2010-03-02 23:28 ` [PATCH 16/62] driver core: Add class_attr_string for simple read-only string Greg Kroah-Hartman
                   ` (45 subsequent siblings)
  60 siblings, 0 replies; 90+ messages in thread
From: Greg Kroah-Hartman @ 2010-03-02 23:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andi Kleen, Andi Kleen, Greg Kroah-Hartman

From: Andi Kleen <andi@firstfloor.org>

Passing the attribute to the low level IO functions allows all kinds
of cleanups, by sharing low level IO code without requiring
an own function for every piece of data.

Also drivers can extend the attributes with own data fields
and use that in the low level function.

This makes the class attributes the same as sysdev_class attributes
and plain attributes.

This will allow further cleanups in drivers.

Full tree sweep converting all users.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/base/class.c                  |    4 ++--
 drivers/base/cpu.c                    |    8 ++++++--
 drivers/base/firmware_class.c         |    8 ++++++--
 drivers/base/memory.c                 |   11 ++++++++---
 drivers/block/osdblk.c                |   12 +++++++++---
 drivers/block/pktcdvd.c               |   12 +++++++++---
 drivers/gpio/gpiolib.c                |    8 ++++++--
 drivers/gpu/drm/drm_sysfs.c           |    3 ++-
 drivers/infiniband/core/ucm.c         |    4 +++-
 drivers/infiniband/core/user_mad.c    |    4 +++-
 drivers/infiniband/core/uverbs_main.c |    4 +++-
 drivers/misc/phantom.c                |    2 +-
 drivers/mtd/ubi/build.c               |    3 ++-
 drivers/net/bonding/bond_sysfs.c      |    5 ++++-
 drivers/staging/asus_oled/asus_oled.c |    4 +++-
 drivers/uwb/driver.c                  |    5 ++++-
 include/linux/device.h                |    6 ++++--
 net/bluetooth/l2cap.c                 |    4 +++-
 net/bluetooth/rfcomm/core.c           |    4 +++-
 net/bluetooth/rfcomm/sock.c           |    4 +++-
 net/bluetooth/sco.c                   |    4 +++-
 21 files changed, 87 insertions(+), 32 deletions(-)

diff --git a/drivers/base/class.c b/drivers/base/class.c
index 6e2c3b0..34a2de9 100644
--- a/drivers/base/class.c
+++ b/drivers/base/class.c
@@ -31,7 +31,7 @@ static ssize_t class_attr_show(struct kobject *kobj, struct attribute *attr,
 	ssize_t ret = -EIO;
 
 	if (class_attr->show)
-		ret = class_attr->show(cp->class, buf);
+		ret = class_attr->show(cp->class, class_attr, buf);
 	return ret;
 }
 
@@ -43,7 +43,7 @@ static ssize_t class_attr_store(struct kobject *kobj, struct attribute *attr,
 	ssize_t ret = -EIO;
 
 	if (class_attr->store)
-		ret = class_attr->store(cp->class, buf, count);
+		ret = class_attr->store(cp->class, class_attr, buf, count);
 	return ret;
 }
 
diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c
index fb456b7..9121c77 100644
--- a/drivers/base/cpu.c
+++ b/drivers/base/cpu.c
@@ -79,13 +79,17 @@ void unregister_cpu(struct cpu *cpu)
 }
 
 #ifdef CONFIG_ARCH_CPU_PROBE_RELEASE
-static ssize_t cpu_probe_store(struct class *class, const char *buf,
+static ssize_t cpu_probe_store(struct class *class,
+				struct class_attribute *attr,
+				const char *buf,
 			       size_t count)
 {
 	return arch_cpu_probe(buf, count);
 }
 
-static ssize_t cpu_release_store(struct class *class, const char *buf,
+static ssize_t cpu_release_store(struct class *class,
+				struct class_attribute *attr,
+				const char *buf,
 				 size_t count)
 {
 	return arch_cpu_release(buf, count);
diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
index a950241..6604fb3 100644
--- a/drivers/base/firmware_class.c
+++ b/drivers/base/firmware_class.c
@@ -69,7 +69,9 @@ fw_load_abort(struct firmware_priv *fw_priv)
 }
 
 static ssize_t
-firmware_timeout_show(struct class *class, char *buf)
+firmware_timeout_show(struct class *class,
+		      struct class_attribute *attr,
+		      char *buf)
 {
 	return sprintf(buf, "%d\n", loading_timeout);
 }
@@ -87,7 +89,9 @@ firmware_timeout_show(struct class *class, char *buf)
  *	Note: zero means 'wait forever'.
  **/
 static ssize_t
-firmware_timeout_store(struct class *class, const char *buf, size_t count)
+firmware_timeout_store(struct class *class,
+			struct class_attribute *attr,
+			const char *buf, size_t count)
 {
 	loading_timeout = simple_strtol(buf, NULL, 10);
 	if (loading_timeout < 0)
diff --git a/drivers/base/memory.c b/drivers/base/memory.c
index 563656a..495f15e 100644
--- a/drivers/base/memory.c
+++ b/drivers/base/memory.c
@@ -331,7 +331,8 @@ static int block_size_init(void)
  */
 #ifdef CONFIG_ARCH_MEMORY_PROBE
 static ssize_t
-memory_probe_store(struct class *class, const char *buf, size_t count)
+memory_probe_store(struct class *class, struct class_attribute *attr,
+		   const char *buf, size_t count)
 {
 	u64 phys_addr;
 	int nid;
@@ -368,7 +369,9 @@ static inline int memory_probe_init(void)
 
 /* Soft offline a page */
 static ssize_t
-store_soft_offline_page(struct class *class, const char *buf, size_t count)
+store_soft_offline_page(struct class *class,
+			struct class_attribute *attr,
+			const char *buf, size_t count)
 {
 	int ret;
 	u64 pfn;
@@ -385,7 +388,9 @@ store_soft_offline_page(struct class *class, const char *buf, size_t count)
 
 /* Forcibly offline a page, including killing processes. */
 static ssize_t
-store_hard_offline_page(struct class *class, const char *buf, size_t count)
+store_hard_offline_page(struct class *class,
+			struct class_attribute *attr,
+			const char *buf, size_t count)
 {
 	int ret;
 	u64 pfn;
diff --git a/drivers/block/osdblk.c b/drivers/block/osdblk.c
index a808b15..eb2091a 100644
--- a/drivers/block/osdblk.c
+++ b/drivers/block/osdblk.c
@@ -476,7 +476,9 @@ static void class_osdblk_release(struct class *cls)
 	kfree(cls);
 }
 
-static ssize_t class_osdblk_list(struct class *c, char *data)
+static ssize_t class_osdblk_list(struct class *c,
+				struct class_attribute *attr,
+				char *data)
 {
 	int n = 0;
 	struct list_head *tmp;
@@ -500,7 +502,9 @@ static ssize_t class_osdblk_list(struct class *c, char *data)
 	return n;
 }
 
-static ssize_t class_osdblk_add(struct class *c, const char *buf, size_t count)
+static ssize_t class_osdblk_add(struct class *c,
+				struct class_attribute *attr,
+				const char *buf, size_t count)
 {
 	struct osdblk_device *osdev;
 	ssize_t rc;
@@ -592,7 +596,9 @@ err_out_mod:
 	return rc;
 }
 
-static ssize_t class_osdblk_remove(struct class *c, const char *buf,
+static ssize_t class_osdblk_remove(struct class *c,
+					struct class_attribute *attr,
+					const char *buf,
 					size_t count)
 {
 	struct osdblk_device *osdev = NULL;
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index b72935b..73d815d 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -337,7 +337,9 @@ static void class_pktcdvd_release(struct class *cls)
 {
 	kfree(cls);
 }
-static ssize_t class_pktcdvd_show_map(struct class *c, char *data)
+static ssize_t class_pktcdvd_show_map(struct class *c,
+					struct class_attribute *attr,
+					char *data)
 {
 	int n = 0;
 	int idx;
@@ -356,7 +358,9 @@ static ssize_t class_pktcdvd_show_map(struct class *c, char *data)
 	return n;
 }
 
-static ssize_t class_pktcdvd_store_add(struct class *c, const char *buf,
+static ssize_t class_pktcdvd_store_add(struct class *c,
+					struct class_attribute *attr,
+					const char *buf,
 					size_t count)
 {
 	unsigned int major, minor;
@@ -376,7 +380,9 @@ static ssize_t class_pktcdvd_store_add(struct class *c, const char *buf,
 	return -EINVAL;
 }
 
-static ssize_t class_pktcdvd_store_remove(struct class *c, const char *buf,
+static ssize_t class_pktcdvd_store_remove(struct class *c,
+					  struct class_attribute *attr,
+					  const char *buf,
 					size_t count)
 {
 	unsigned int major, minor;
diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c
index 350842a..3a77eaa 100644
--- a/drivers/gpio/gpiolib.c
+++ b/drivers/gpio/gpiolib.c
@@ -623,7 +623,9 @@ static const struct attribute_group gpiochip_attr_group = {
  * /sys/class/gpio/unexport ... write-only
  *	integer N ... number of GPIO to unexport
  */
-static ssize_t export_store(struct class *class, const char *buf, size_t len)
+static ssize_t export_store(struct class *class,
+				struct class_attribute *attr,
+				const char *buf, size_t len)
 {
 	long	gpio;
 	int	status;
@@ -653,7 +655,9 @@ done:
 	return status ? : len;
 }
 
-static ssize_t unexport_store(struct class *class, const char *buf, size_t len)
+static ssize_t unexport_store(struct class *class,
+				struct class_attribute *attr,
+				const char *buf, size_t len)
 {
 	long	gpio;
 	int	status;
diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c
index 7e42b7e..b95aaf2 100644
--- a/drivers/gpu/drm/drm_sysfs.c
+++ b/drivers/gpu/drm/drm_sysfs.c
@@ -71,7 +71,8 @@ static int drm_class_resume(struct device *dev)
 }
 
 /* Display the version of drm_core. This doesn't work right in current design */
-static ssize_t version_show(struct class *dev, char *buf)
+static ssize_t version_show(struct class *dev, struct class_attribute *attr,
+				char *buf)
 {
 	return sprintf(buf, "%s %d.%d.%d %s\n", CORE_NAME, CORE_MAJOR,
 		       CORE_MINOR, CORE_PATCHLEVEL, CORE_DATE);
diff --git a/drivers/infiniband/core/ucm.c b/drivers/infiniband/core/ucm.c
index f504c9b..98c1643 100644
--- a/drivers/infiniband/core/ucm.c
+++ b/drivers/infiniband/core/ucm.c
@@ -1297,7 +1297,9 @@ static void ib_ucm_remove_one(struct ib_device *device)
 	device_unregister(&ucm_dev->dev);
 }
 
-static ssize_t show_abi_version(struct class *class, char *buf)
+static ssize_t show_abi_version(struct class *class,
+				struct class_attribute *attr,
+				char *buf)
 {
 	return sprintf(buf, "%d\n", IB_USER_CM_ABI_VERSION);
 }
diff --git a/drivers/infiniband/core/user_mad.c b/drivers/infiniband/core/user_mad.c
index 7de0296..113dd0d 100644
--- a/drivers/infiniband/core/user_mad.c
+++ b/drivers/infiniband/core/user_mad.c
@@ -984,7 +984,9 @@ static ssize_t show_port(struct device *dev, struct device_attribute *attr,
 }
 static DEVICE_ATTR(port, S_IRUGO, show_port, NULL);
 
-static ssize_t show_abi_version(struct class *class, char *buf)
+static ssize_t show_abi_version(struct class *class,
+				struct class_attribute *attr,
+				char *buf)
 {
 	return sprintf(buf, "%d\n", IB_USER_MAD_ABI_VERSION);
 }
diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c
index 5f284ff..ef541b9 100644
--- a/drivers/infiniband/core/uverbs_main.c
+++ b/drivers/infiniband/core/uverbs_main.c
@@ -729,7 +729,9 @@ static ssize_t show_dev_abi_version(struct device *device,
 }
 static DEVICE_ATTR(abi_version, S_IRUGO, show_dev_abi_version, NULL);
 
-static ssize_t show_abi_version(struct class *class, char *buf)
+static ssize_t show_abi_version(struct class *class,
+				struct class_attribute *attr,
+				char *buf)
 {
 	return sprintf(buf, "%d\n", IB_USER_VERBS_ABI_VERSION);
 }
diff --git a/drivers/misc/phantom.c b/drivers/misc/phantom.c
index 04c2726..d30ae95 100644
--- a/drivers/misc/phantom.c
+++ b/drivers/misc/phantom.c
@@ -497,7 +497,7 @@ static struct pci_driver phantom_pci_driver = {
 	.resume = phantom_resume
 };
 
-static ssize_t phantom_show_version(struct class *cls, char *buf)
+static ssize_t phantom_show_version(struct class *cls, struct class_attribute *attr, char *buf)
 {
 	return sprintf(buf, PHANTOM_VERSION "\n");
 }
diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c
index 14cec04..bd1d28d 100644
--- a/drivers/mtd/ubi/build.c
+++ b/drivers/mtd/ubi/build.c
@@ -87,7 +87,8 @@ DEFINE_MUTEX(ubi_devices_mutex);
 static DEFINE_SPINLOCK(ubi_devices_lock);
 
 /* "Show" method for files in '/<sysfs>/class/ubi/' */
-static ssize_t ubi_version_show(struct class *class, char *buf)
+static ssize_t ubi_version_show(struct class *class, struct class_attribute *attr,
+				char *buf)
 {
 	return sprintf(buf, "%d\n", UBI_VERSION);
 }
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c
index 5acd557..b8bec08 100644
--- a/drivers/net/bonding/bond_sysfs.c
+++ b/drivers/net/bonding/bond_sysfs.c
@@ -51,7 +51,9 @@
  * "show" function for the bond_masters attribute.
  * The class parameter is ignored.
  */
-static ssize_t bonding_show_bonds(struct class *cls, char *buf)
+static ssize_t bonding_show_bonds(struct class *cls,
+				  struct class_attribute *attr,
+				  char *buf)
 {
 	struct net *net = current->nsproxy->net_ns;
 	struct bond_net *bn = net_generic(net, bond_net_id);
@@ -98,6 +100,7 @@ static struct net_device *bond_get_by_name(struct net *net, const char *ifname)
  */
 
 static ssize_t bonding_store_bonds(struct class *cls,
+				   struct class_attribute *attr,
 				   const char *buffer, size_t count)
 {
 	struct net *net = current->nsproxy->net_ns;
diff --git a/drivers/staging/asus_oled/asus_oled.c b/drivers/staging/asus_oled/asus_oled.c
index 43c57b7..d11e897 100644
--- a/drivers/staging/asus_oled/asus_oled.c
+++ b/drivers/staging/asus_oled/asus_oled.c
@@ -759,7 +759,9 @@ static struct usb_driver oled_driver = {
 	.id_table =	id_table,
 };
 
-static ssize_t version_show(struct class *dev, char *buf)
+static ssize_t version_show(struct class *dev,
+			    struct class_attribute *attr,
+			    char *buf)
 {
 	return sprintf(buf, ASUS_OLED_UNDERSCORE_NAME " %s\n",
 		       ASUS_OLED_VERSION);
diff --git a/drivers/uwb/driver.c b/drivers/uwb/driver.c
index da77e41..08bd6db 100644
--- a/drivers/uwb/driver.c
+++ b/drivers/uwb/driver.c
@@ -74,13 +74,16 @@
 unsigned long beacon_timeout_ms = 500;
 
 static
-ssize_t beacon_timeout_ms_show(struct class *class, char *buf)
+ssize_t beacon_timeout_ms_show(struct class *class,
+				struct class_attribute *attr,
+				char *buf)
 {
 	return scnprintf(buf, PAGE_SIZE, "%lu\n", beacon_timeout_ms);
 }
 
 static
 ssize_t beacon_timeout_ms_store(struct class *class,
+				struct class_attribute *attr,
 				const char *buf, size_t size)
 {
 	unsigned long bt;
diff --git a/include/linux/device.h b/include/linux/device.h
index b30527d..190f8d3 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -251,8 +251,10 @@ extern struct device *class_find_device(struct class *class,
 
 struct class_attribute {
 	struct attribute attr;
-	ssize_t (*show)(struct class *class, char *buf);
-	ssize_t (*store)(struct class *class, const char *buf, size_t count);
+	ssize_t (*show)(struct class *class, struct class_attribute *attr,
+			char *buf);
+	ssize_t (*store)(struct class *class, struct class_attribute *attr,
+			const char *buf, size_t count);
 };
 
 #define CLASS_ATTR(_name, _mode, _show, _store)			\
diff --git a/net/bluetooth/l2cap.c b/net/bluetooth/l2cap.c
index 400efa2..4db7ae2 100644
--- a/net/bluetooth/l2cap.c
+++ b/net/bluetooth/l2cap.c
@@ -3937,7 +3937,9 @@ drop:
 	return 0;
 }
 
-static ssize_t l2cap_sysfs_show(struct class *dev, char *buf)
+static ssize_t l2cap_sysfs_show(struct class *dev,
+				struct class_attribute *attr,
+				char *buf)
 {
 	struct sock *sk;
 	struct hlist_node *node;
diff --git a/net/bluetooth/rfcomm/core.c b/net/bluetooth/rfcomm/core.c
index 89f4a59..db8a68e 100644
--- a/net/bluetooth/rfcomm/core.c
+++ b/net/bluetooth/rfcomm/core.c
@@ -2098,7 +2098,9 @@ static struct hci_cb rfcomm_cb = {
 	.security_cfm	= rfcomm_security_cfm
 };
 
-static ssize_t rfcomm_dlc_sysfs_show(struct class *dev, char *buf)
+static ssize_t rfcomm_dlc_sysfs_show(struct class *dev,
+				     struct class_attribute *attr,
+				     char *buf)
 {
 	struct rfcomm_session *s;
 	struct list_head *pp, *p;
diff --git a/net/bluetooth/rfcomm/sock.c b/net/bluetooth/rfcomm/sock.c
index 4b5968d..ca87d6a 100644
--- a/net/bluetooth/rfcomm/sock.c
+++ b/net/bluetooth/rfcomm/sock.c
@@ -1061,7 +1061,9 @@ done:
 	return result;
 }
 
-static ssize_t rfcomm_sock_sysfs_show(struct class *dev, char *buf)
+static ssize_t rfcomm_sock_sysfs_show(struct class *dev,
+				      struct class_attribute *attr,
+				      char *buf)
 {
 	struct sock *sk;
 	struct hlist_node *node;
diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c
index dd8f6ec..f93b939 100644
--- a/net/bluetooth/sco.c
+++ b/net/bluetooth/sco.c
@@ -953,7 +953,9 @@ drop:
 	return 0;
 }
 
-static ssize_t sco_sysfs_show(struct class *dev, char *buf)
+static ssize_t sco_sysfs_show(struct class *dev,
+				struct class_attribute *attr,
+				char *buf)
 {
 	struct sock *sk;
 	struct hlist_node *node;
-- 
1.7.0.1


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

* [PATCH 16/62] driver core: Add class_attr_string for simple read-only string
  2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
                   ` (14 preceding siblings ...)
  2010-03-02 23:28 ` [PATCH 15/62] driver-core: Add attribute argument to class_attribute show/store Greg Kroah-Hartman
@ 2010-03-02 23:28 ` Greg Kroah-Hartman
  2010-03-02 23:28 ` [PATCH 17/62] driver core: Convert some drivers to CLASS_ATTR_STRING Greg Kroah-Hartman
                   ` (44 subsequent siblings)
  60 siblings, 0 replies; 90+ messages in thread
From: Greg Kroah-Hartman @ 2010-03-02 23:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andi Kleen, Andi Kleen, Greg Kroah-Hartman

From: Andi Kleen <andi@firstfloor.org>

Several drivers just export a static string as class attributes.

Use the new extensible attribute support to define a simple
CLASS_ATTR_STRING() macro for this.

This will allow to remove code from drivers in followon patches.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/base/class.c   |   10 ++++++++++
 include/linux/device.h |   17 +++++++++++++++++
 2 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/drivers/base/class.c b/drivers/base/class.c
index 34a2de9..2e297cc 100644
--- a/drivers/base/class.c
+++ b/drivers/base/class.c
@@ -490,6 +490,16 @@ void class_interface_unregister(struct class_interface *class_intf)
 	class_put(parent);
 }
 
+ssize_t show_class_attr_string(struct class *class, struct class_attribute *attr,
+                        	char *buf)
+{
+	struct class_attribute_string *cs;
+	cs = container_of(attr, struct class_attribute_string, attr);
+	return snprintf(buf, PAGE_SIZE, "%s\n", cs->str);
+}
+
+EXPORT_SYMBOL_GPL(show_class_attr_string);
+
 struct class_compat {
 	struct kobject *kobj;
 };
diff --git a/include/linux/device.h b/include/linux/device.h
index 190f8d3..f95d5bf 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -265,6 +265,23 @@ extern int __must_check class_create_file(struct class *class,
 extern void class_remove_file(struct class *class,
 			      const struct class_attribute *attr);
 
+/* Simple class attribute that is just a static string */
+
+struct class_attribute_string {
+	struct class_attribute attr;
+	char *str;
+};
+
+/* Currently read-only only */
+#define _CLASS_ATTR_STRING(_name, _mode, _str) \
+	{ __ATTR(_name, _mode, show_class_attr_string, NULL), _str }
+#define CLASS_ATTR_STRING(_name, _mode, _str) \
+	struct class_attribute_string class_attr_##_name = \
+		_CLASS_ATTR_STRING(_name, _mode, _str)
+
+extern ssize_t show_class_attr_string(struct class *class, struct class_attribute *attr,
+                        char *buf);
+
 struct class_interface {
 	struct list_head	node;
 	struct class		*class;
-- 
1.7.0.1


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

* [PATCH 17/62] driver core: Convert some drivers to CLASS_ATTR_STRING
  2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
                   ` (15 preceding siblings ...)
  2010-03-02 23:28 ` [PATCH 16/62] driver core: Add class_attr_string for simple read-only string Greg Kroah-Hartman
@ 2010-03-02 23:28 ` Greg Kroah-Hartman
  2010-03-02 23:28 ` [PATCH 18/62] Driver-Core: devtmpfs - reset inode permissions before unlinking Greg Kroah-Hartman
                   ` (43 subsequent siblings)
  60 siblings, 0 replies; 90+ messages in thread
From: Greg Kroah-Hartman @ 2010-03-02 23:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andi Kleen, Andi Kleen, Greg Kroah-Hartman

From: Andi Kleen <andi@firstfloor.org>

Convert some drivers who export a single string as class attribute
to the new class_attr_string functions. This removes redundant
code all over.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/gpu/drm/drm_sysfs.c           |   19 ++++++++-----------
 drivers/infiniband/core/ucm.c         |   15 +++++----------
 drivers/infiniband/core/user_mad.c    |   11 +++--------
 drivers/infiniband/core/uverbs_main.c |   11 +++--------
 drivers/misc/phantom.c                |   13 ++++---------
 drivers/staging/asus_oled/asus_oled.c |   15 ++++-----------
 6 files changed, 27 insertions(+), 57 deletions(-)

diff --git a/drivers/gpu/drm/drm_sysfs.c b/drivers/gpu/drm/drm_sysfs.c
index b95aaf2..014ce24 100644
--- a/drivers/gpu/drm/drm_sysfs.c
+++ b/drivers/gpu/drm/drm_sysfs.c
@@ -70,20 +70,17 @@ static int drm_class_resume(struct device *dev)
 	return 0;
 }
 
-/* Display the version of drm_core. This doesn't work right in current design */
-static ssize_t version_show(struct class *dev, struct class_attribute *attr,
-				char *buf)
-{
-	return sprintf(buf, "%s %d.%d.%d %s\n", CORE_NAME, CORE_MAJOR,
-		       CORE_MINOR, CORE_PATCHLEVEL, CORE_DATE);
-}
-
 static char *drm_devnode(struct device *dev, mode_t *mode)
 {
 	return kasprintf(GFP_KERNEL, "dri/%s", dev_name(dev));
 }
 
-static CLASS_ATTR(version, S_IRUGO, version_show, NULL);
+static CLASS_ATTR_STRING(version, S_IRUGO,
+		CORE_NAME " "
+		__stringify(CORE_MAJOR) "."
+		__stringify(CORE_MINOR) "."
+		__stringify(CORE_PATCHLEVEL) " "
+		CORE_DATE);
 
 /**
  * drm_sysfs_create - create a struct drm_sysfs_class structure
@@ -110,7 +107,7 @@ struct class *drm_sysfs_create(struct module *owner, char *name)
 	class->suspend = drm_class_suspend;
 	class->resume = drm_class_resume;
 
-	err = class_create_file(class, &class_attr_version);
+	err = class_create_file(class, &class_attr_version.attr);
 	if (err)
 		goto err_out_class;
 
@@ -133,7 +130,7 @@ void drm_sysfs_destroy(void)
 {
 	if ((drm_class == NULL) || (IS_ERR(drm_class)))
 		return;
-	class_remove_file(drm_class, &class_attr_version);
+	class_remove_file(drm_class, &class_attr_version.attr);
 	class_destroy(drm_class);
 }
 
diff --git a/drivers/infiniband/core/ucm.c b/drivers/infiniband/core/ucm.c
index 98c1643..622afb6 100644
--- a/drivers/infiniband/core/ucm.c
+++ b/drivers/infiniband/core/ucm.c
@@ -1297,13 +1297,8 @@ static void ib_ucm_remove_one(struct ib_device *device)
 	device_unregister(&ucm_dev->dev);
 }
 
-static ssize_t show_abi_version(struct class *class,
-				struct class_attribute *attr,
-				char *buf)
-{
-	return sprintf(buf, "%d\n", IB_USER_CM_ABI_VERSION);
-}
-static CLASS_ATTR(abi_version, S_IRUGO, show_abi_version, NULL);
+static CLASS_ATTR_STRING(abi_version, S_IRUGO,
+			 __stringify(IB_USER_CM_ABI_VERSION));
 
 static int __init ib_ucm_init(void)
 {
@@ -1316,7 +1311,7 @@ static int __init ib_ucm_init(void)
 		goto error1;
 	}
 
-	ret = class_create_file(&cm_class, &class_attr_abi_version);
+	ret = class_create_file(&cm_class, &class_attr_abi_version.attr);
 	if (ret) {
 		printk(KERN_ERR "ucm: couldn't create abi_version attribute\n");
 		goto error2;
@@ -1330,7 +1325,7 @@ static int __init ib_ucm_init(void)
 	return 0;
 
 error3:
-	class_remove_file(&cm_class, &class_attr_abi_version);
+	class_remove_file(&cm_class, &class_attr_abi_version.attr);
 error2:
 	unregister_chrdev_region(IB_UCM_BASE_DEV, IB_UCM_MAX_DEVICES);
 error1:
@@ -1340,7 +1335,7 @@ error1:
 static void __exit ib_ucm_cleanup(void)
 {
 	ib_unregister_client(&ucm_client);
-	class_remove_file(&cm_class, &class_attr_abi_version);
+	class_remove_file(&cm_class, &class_attr_abi_version.attr);
 	unregister_chrdev_region(IB_UCM_BASE_DEV, IB_UCM_MAX_DEVICES);
 	idr_destroy(&ctx_id_table);
 }
diff --git a/drivers/infiniband/core/user_mad.c b/drivers/infiniband/core/user_mad.c
index 113dd0d..bff5a91 100644
--- a/drivers/infiniband/core/user_mad.c
+++ b/drivers/infiniband/core/user_mad.c
@@ -984,13 +984,8 @@ static ssize_t show_port(struct device *dev, struct device_attribute *attr,
 }
 static DEVICE_ATTR(port, S_IRUGO, show_port, NULL);
 
-static ssize_t show_abi_version(struct class *class,
-				struct class_attribute *attr,
-				char *buf)
-{
-	return sprintf(buf, "%d\n", IB_USER_MAD_ABI_VERSION);
-}
-static CLASS_ATTR(abi_version, S_IRUGO, show_abi_version, NULL);
+static CLASS_ATTR_STRING(abi_version, S_IRUGO,
+			 __stringify(IB_USER_MAD_ABI_VERSION));
 
 static int ib_umad_init_port(struct ib_device *device, int port_num,
 			     struct ib_umad_port *port)
@@ -1187,7 +1182,7 @@ static int __init ib_umad_init(void)
 		goto out_chrdev;
 	}
 
-	ret = class_create_file(umad_class, &class_attr_abi_version);
+	ret = class_create_file(umad_class, &class_attr_abi_version.attr);
 	if (ret) {
 		printk(KERN_ERR "user_mad: couldn't create abi_version attribute\n");
 		goto out_class;
diff --git a/drivers/infiniband/core/uverbs_main.c b/drivers/infiniband/core/uverbs_main.c
index ef541b9..1f16b88 100644
--- a/drivers/infiniband/core/uverbs_main.c
+++ b/drivers/infiniband/core/uverbs_main.c
@@ -729,13 +729,8 @@ static ssize_t show_dev_abi_version(struct device *device,
 }
 static DEVICE_ATTR(abi_version, S_IRUGO, show_dev_abi_version, NULL);
 
-static ssize_t show_abi_version(struct class *class,
-				struct class_attribute *attr,
-				char *buf)
-{
-	return sprintf(buf, "%d\n", IB_USER_VERBS_ABI_VERSION);
-}
-static CLASS_ATTR(abi_version, S_IRUGO, show_abi_version, NULL);
+static CLASS_ATTR_STRING(abi_version, S_IRUGO,
+			 __stringify(IB_USER_VERBS_ABI_VERSION));
 
 static void ib_uverbs_add_one(struct ib_device *device)
 {
@@ -860,7 +855,7 @@ static int __init ib_uverbs_init(void)
 		goto out_chrdev;
 	}
 
-	ret = class_create_file(uverbs_class, &class_attr_abi_version);
+	ret = class_create_file(uverbs_class, &class_attr_abi_version.attr);
 	if (ret) {
 		printk(KERN_ERR "user_verbs: couldn't create abi_version attribute\n");
 		goto out_class;
diff --git a/drivers/misc/phantom.c b/drivers/misc/phantom.c
index d30ae95..779aa8e 100644
--- a/drivers/misc/phantom.c
+++ b/drivers/misc/phantom.c
@@ -497,12 +497,7 @@ static struct pci_driver phantom_pci_driver = {
 	.resume = phantom_resume
 };
 
-static ssize_t phantom_show_version(struct class *cls, struct class_attribute *attr, char *buf)
-{
-	return sprintf(buf, PHANTOM_VERSION "\n");
-}
-
-static CLASS_ATTR(version, 0444, phantom_show_version, NULL);
+static CLASS_ATTR_STRING(version, 0444, PHANTOM_VERSION);
 
 static int __init phantom_init(void)
 {
@@ -515,7 +510,7 @@ static int __init phantom_init(void)
 		printk(KERN_ERR "phantom: can't register phantom class\n");
 		goto err;
 	}
-	retval = class_create_file(phantom_class, &class_attr_version);
+	retval = class_create_file(phantom_class, &class_attr_version.attr);
 	if (retval) {
 		printk(KERN_ERR "phantom: can't create sysfs version file\n");
 		goto err_class;
@@ -541,7 +536,7 @@ static int __init phantom_init(void)
 err_unchr:
 	unregister_chrdev_region(dev, PHANTOM_MAX_MINORS);
 err_attr:
-	class_remove_file(phantom_class, &class_attr_version);
+	class_remove_file(phantom_class, &class_attr_version.attr);
 err_class:
 	class_destroy(phantom_class);
 err:
@@ -554,7 +549,7 @@ static void __exit phantom_exit(void)
 
 	unregister_chrdev_region(MKDEV(phantom_major, 0), PHANTOM_MAX_MINORS);
 
-	class_remove_file(phantom_class, &class_attr_version);
+	class_remove_file(phantom_class, &class_attr_version.attr);
 	class_destroy(phantom_class);
 
 	pr_debug("phantom: module successfully removed\n");
diff --git a/drivers/staging/asus_oled/asus_oled.c b/drivers/staging/asus_oled/asus_oled.c
index d11e897..34a1f5f 100644
--- a/drivers/staging/asus_oled/asus_oled.c
+++ b/drivers/staging/asus_oled/asus_oled.c
@@ -759,15 +759,8 @@ static struct usb_driver oled_driver = {
 	.id_table =	id_table,
 };
 
-static ssize_t version_show(struct class *dev,
-			    struct class_attribute *attr,
-			    char *buf)
-{
-	return sprintf(buf, ASUS_OLED_UNDERSCORE_NAME " %s\n",
-		       ASUS_OLED_VERSION);
-}
-
-static CLASS_ATTR(version, S_IRUGO, version_show, NULL);
+static CLASS_ATTR_STRING(version, S_IRUGO,
+		 	ASUS_OLED_UNDERSCORE_NAME " " ASUS_OLED_VERSION);
 
 static int __init asus_oled_init(void)
 {
@@ -779,7 +772,7 @@ static int __init asus_oled_init(void)
 		return PTR_ERR(oled_class);
 	}
 
-	retval = class_create_file(oled_class, &class_attr_version);
+	retval = class_create_file(oled_class, &class_attr_version.attr);
 	if (retval) {
 		err("Error creating class version file");
 		goto error;
@@ -801,7 +794,7 @@ error:
 
 static void __exit asus_oled_exit(void)
 {
-	class_remove_file(oled_class, &class_attr_version);
+	class_remove_file(oled_class, &class_attr_version.attr);
 	class_destroy(oled_class);
 
 	usb_deregister(&oled_driver);
-- 
1.7.0.1


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

* [PATCH 18/62] Driver-Core: devtmpfs - reset inode permissions before unlinking
  2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
                   ` (16 preceding siblings ...)
  2010-03-02 23:28 ` [PATCH 17/62] driver core: Convert some drivers to CLASS_ATTR_STRING Greg Kroah-Hartman
@ 2010-03-02 23:28 ` Greg Kroah-Hartman
  2010-03-02 23:28 ` [PATCH 19/62] Driver-Core: devtmpfs - remove EXPERIMENTAL and enable it by default Greg Kroah-Hartman
                   ` (42 subsequent siblings)
  60 siblings, 0 replies; 90+ messages in thread
From: Greg Kroah-Hartman @ 2010-03-02 23:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: Kay Sievers, stable, Greg Kroah-Hartman

From: Kay Sievers <kay.sievers@vrfy.org>

Before unlinking the inode, reset the current permissions of possible
references like hardlinks, so granted permissions can not be retained
across the device lifetime by creating hardlinks, in the unusual case
that there is a user-writable directory on the same filesystem.

Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/base/devtmpfs.c |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/drivers/base/devtmpfs.c b/drivers/base/devtmpfs.c
index 42ae452..dac478c 100644
--- a/drivers/base/devtmpfs.c
+++ b/drivers/base/devtmpfs.c
@@ -301,6 +301,19 @@ int devtmpfs_delete_node(struct device *dev)
 		if (dentry->d_inode) {
 			err = vfs_getattr(nd.path.mnt, dentry, &stat);
 			if (!err && dev_mynode(dev, dentry->d_inode, &stat)) {
+				struct iattr newattrs;
+				/*
+				 * before unlinking this node, reset permissions
+				 * of possible references like hardlinks
+				 */
+				newattrs.ia_uid = 0;
+				newattrs.ia_gid = 0;
+				newattrs.ia_mode = stat.mode & ~0777;
+				newattrs.ia_valid =
+					ATTR_UID|ATTR_GID|ATTR_MODE;
+				mutex_lock(&dentry->d_inode->i_mutex);
+				notify_change(dentry, &newattrs);
+				mutex_unlock(&dentry->d_inode->i_mutex);
 				err = vfs_unlink(nd.path.dentry->d_inode,
 						 dentry);
 				if (!err || err == -ENOENT)
-- 
1.7.0.1


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

* [PATCH 19/62] Driver-Core: devtmpfs - remove EXPERIMENTAL and enable it by default
  2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
                   ` (17 preceding siblings ...)
  2010-03-02 23:28 ` [PATCH 18/62] Driver-Core: devtmpfs - reset inode permissions before unlinking Greg Kroah-Hartman
@ 2010-03-02 23:28 ` Greg Kroah-Hartman
  2010-03-03  4:38   ` Eric W. Biederman
  2010-03-02 23:28 ` [PATCH 20/62] Driver-Core: disable /sbin/hotplug " Greg Kroah-Hartman
                   ` (41 subsequent siblings)
  60 siblings, 1 reply; 90+ messages in thread
From: Greg Kroah-Hartman @ 2010-03-02 23:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: Kay Sievers, Greg Kroah-Hartman

From: Kay Sievers <kay.sievers@vrfy.org>

All major distros enable devtmpfs on recent systems, so remove
the EXPERIMENTAL flag, and enable it by default to reflect how it
is used today.

Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/base/Kconfig |   45 ++++++++++++++++++++++++++++-----------------
 1 files changed, 28 insertions(+), 17 deletions(-)

diff --git a/drivers/base/Kconfig b/drivers/base/Kconfig
index ee37727..8497ce9 100644
--- a/drivers/base/Kconfig
+++ b/drivers/base/Kconfig
@@ -9,29 +9,40 @@ config UEVENT_HELPER_PATH
 	  every uevent.
 
 config DEVTMPFS
-	bool "Create a kernel maintained /dev tmpfs (EXPERIMENTAL)"
+	bool "Maintain a devtmpfs filesystem to mount at /dev"
 	depends on HOTPLUG && SHMEM && TMPFS
+	default y
 	help
-	  This creates a tmpfs filesystem, and mounts it at bootup
-	  and mounts it at /dev. The kernel driver core creates device
-	  nodes for all registered devices in that filesystem. All device
-	  nodes are owned by root and have the default mode of 0600.
-	  Userspace can add and delete the nodes as needed. This is
-	  intended to simplify bootup, and make it possible to delay
-	  the initial coldplug at bootup done by udev in userspace.
-	  It should also provide a simpler way for rescue systems
-	  to bring up a kernel with dynamic major/minor numbers.
-	  Meaningful symlinks, permissions and device ownership must
-	  still be handled by userspace.
-	  If unsure, say N here.
+	  This creates a tmpfs filesystem instance early at bootup.
+	  In this filesystem, the kernel driver core maintains device
+	  nodes with their default names and permissions for all
+	  registered devices with an assigned major/minor number.
+	  Userspace can modify the filesystem content as needed, add
+	  symlinks, and apply needed permissions.
+	  It provides a fully functional /dev directory, where usually
+	  udev runs on top, managing permissions and adding meaningful
+	  symlinks.
+	  In very limited environments, it may provide a sufficient
+	  functional /dev without any further help. It also allows simple
+	  rescue systems, and reliably handles dynamic major/minor numbers.
+	  If unsure, say Y here.
 
 config DEVTMPFS_MOUNT
-	bool "Automount devtmpfs at /dev"
+	bool "Automount devtmpfs at /dev, after the kernel mounted the rootfs"
 	depends on DEVTMPFS
+	default y
 	help
-	  This will mount devtmpfs at /dev if the kernel mounts the root
-	  filesystem. It will not affect initramfs based mounting.
-	  If unsure, say N here.
+	  This will instruct the kernel to automatically mount the
+	  devtmpfs filesystem at /dev, directly after the kernel has
+	  mounted the root filesystem. The behavior can be overridden
+	  with the commandline parameter: devtmpfs.mount=0|1.
+	  This option does not affect initramfs based booting, here
+	  the devtmpfs filesystem always needs to be mounted manually
+	  after the roots is mounted.
+	  With this option enabled, it allows to bring up a system in
+	  rescue mode with init=/bin/sh, even when the /dev directory
+	  on the rootfs is completely empty.
+	  If unsure, say Y here.
 
 config STANDALONE
 	bool "Select only drivers that don't need compile-time external firmware" if EXPERIMENTAL
-- 
1.7.0.1


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

* [PATCH 20/62] Driver-Core: disable /sbin/hotplug by default
  2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
                   ` (18 preceding siblings ...)
  2010-03-02 23:28 ` [PATCH 19/62] Driver-Core: devtmpfs - remove EXPERIMENTAL and enable it by default Greg Kroah-Hartman
@ 2010-03-02 23:28 ` Greg Kroah-Hartman
  2010-03-02 23:28 ` [PATCH 21/62] Driver-Core: require valid action string in uevent trigger Greg Kroah-Hartman
                   ` (40 subsequent siblings)
  60 siblings, 0 replies; 90+ messages in thread
From: Greg Kroah-Hartman @ 2010-03-02 23:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: Kay Sievers, Greg Kroah-Hartman

From: Kay Sievers <kay.sievers@vrfy.org>

No recent mainstream system uses the /sbin/hotplug fork-bomb any more.
Disable it by default to reflect how it is used these days.

Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/base/Kconfig |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/drivers/base/Kconfig b/drivers/base/Kconfig
index 8497ce9..338f0bf 100644
--- a/drivers/base/Kconfig
+++ b/drivers/base/Kconfig
@@ -3,10 +3,18 @@ menu "Generic Driver Options"
 config UEVENT_HELPER_PATH
 	string "path to uevent helper"
 	depends on HOTPLUG
-	default "/sbin/hotplug"
+	default ""
 	help
 	  Path to uevent helper program forked by the kernel for
 	  every uevent.
+	  Before the switch to the netlink-based uevent source, this was
+	  used to hook hotplug scripts into kernel device events. It
+	  usually pointed to a shell script at /sbin/hotplug.
+	  This should not be used today, because usual systems create
+	  many events at bootup or device discovery in a very short time
+	  frame. One forked process per event can create so many processes
+	  that it creates a high system load, or on smaller systems
+	  it is known to create out-of-memory situations during bootup.
 
 config DEVTMPFS
 	bool "Maintain a devtmpfs filesystem to mount at /dev"
-- 
1.7.0.1


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

* [PATCH 21/62] Driver-Core: require valid action string in uevent trigger
  2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
                   ` (19 preceding siblings ...)
  2010-03-02 23:28 ` [PATCH 20/62] Driver-Core: disable /sbin/hotplug " Greg Kroah-Hartman
@ 2010-03-02 23:28 ` Greg Kroah-Hartman
  2010-03-02 23:28 ` [PATCH 22/62] sysfs: Cache the last sysfs_dirent to improve readdir scalability v2 Greg Kroah-Hartman
                   ` (39 subsequent siblings)
  60 siblings, 0 replies; 90+ messages in thread
From: Greg Kroah-Hartman @ 2010-03-02 23:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: Kay Sievers, Greg Kroah-Hartman

From: Kay Sievers <kay.sievers@vrfy.org>

No longer fall back to "add" and warn, but always require a valid
action-string written to the "uevent" file.

Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/base/core.c |   11 +++--------
 1 files changed, 3 insertions(+), 8 deletions(-)

diff --git a/drivers/base/core.c b/drivers/base/core.c
index 2820257..e1d6cb4 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -306,15 +306,10 @@ static ssize_t store_uevent(struct device *dev, struct device_attribute *attr,
 {
 	enum kobject_action action;
 
-	if (kobject_action_type(buf, count, &action) == 0) {
+	if (kobject_action_type(buf, count, &action) == 0)
 		kobject_uevent(&dev->kobj, action);
-		goto out;
-	}
-
-	dev_err(dev, "uevent: unsupported action-string; this will "
-		     "be ignored in a future kernel version\n");
-	kobject_uevent(&dev->kobj, KOBJ_ADD);
-out:
+	else
+		dev_err(dev, "uevent: unknown action-string\n");
 	return count;
 }
 
-- 
1.7.0.1


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

* [PATCH 22/62] sysfs: Cache the last sysfs_dirent to improve readdir scalability v2
  2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
                   ` (20 preceding siblings ...)
  2010-03-02 23:28 ` [PATCH 21/62] Driver-Core: require valid action string in uevent trigger Greg Kroah-Hartman
@ 2010-03-02 23:28 ` Greg Kroah-Hartman
  2010-03-02 23:28 ` [PATCH 23/62] driver-core: firmware_class: remove base.h header inclusion Greg Kroah-Hartman
                   ` (38 subsequent siblings)
  60 siblings, 0 replies; 90+ messages in thread
From: Greg Kroah-Hartman @ 2010-03-02 23:28 UTC (permalink / raw)
  To: linux-kernel
  Cc: Eric W. Biederman, Eric W. Biederman, Linus Torvalds, stable,
	Greg Kroah-Hartman

From: Eric W. Biederman <ebiederm@xmission.com>

When sysfs_readdir stops short we now cache the next
sysfs_dirent to return to user space in filp->private_data.
There is no impact on the rest of sysfs by doing this and
in the common case it allows us to pick up exactly where
we left off with no seeking.

Additionally I drop and regrab the sysfs_mutex around
filldir to avoid a page fault abritrarily increasing the
hold time on the sysfs_mutex.

v2: Returned to using INT_MAX as the EOF condition.
    seekdir is ambiguous unless all directory entries have
    a unique f_pos value.

Fixes http://bugzilla.kernel.org/show_bug.cgi?id=14949

Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: stable <stable@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 fs/sysfs/dir.c |   82 +++++++++++++++++++++++++++++++++++++++++---------------
 1 files changed, 60 insertions(+), 22 deletions(-)

diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c
index 699f371..5c4703d 100644
--- a/fs/sysfs/dir.c
+++ b/fs/sysfs/dir.c
@@ -837,11 +837,46 @@ static inline unsigned char dt_type(struct sysfs_dirent *sd)
 	return (sd->s_mode >> 12) & 15;
 }
 
+static int sysfs_dir_release(struct inode *inode, struct file *filp)
+{
+	sysfs_put(filp->private_data);
+	return 0;
+}
+
+static struct sysfs_dirent *sysfs_dir_pos(struct sysfs_dirent *parent_sd,
+	ino_t ino, struct sysfs_dirent *pos)
+{
+	if (pos) {
+		int valid = !(pos->s_flags & SYSFS_FLAG_REMOVED) &&
+			pos->s_parent == parent_sd &&
+			ino == pos->s_ino;
+		sysfs_put(pos);
+		if (valid)
+			return pos;
+	}
+	pos = NULL;
+	if ((ino > 1) && (ino < INT_MAX)) {
+		pos = parent_sd->s_dir.children;
+		while (pos && (ino > pos->s_ino))
+			pos = pos->s_sibling;
+	}
+	return pos;
+}
+
+static struct sysfs_dirent *sysfs_dir_next_pos(struct sysfs_dirent *parent_sd,
+	ino_t ino, struct sysfs_dirent *pos)
+{
+	pos = sysfs_dir_pos(parent_sd, ino, pos);
+	if (pos)
+		pos = pos->s_sibling;
+	return pos;
+}
+
 static int sysfs_readdir(struct file * filp, void * dirent, filldir_t filldir)
 {
 	struct dentry *dentry = filp->f_path.dentry;
 	struct sysfs_dirent * parent_sd = dentry->d_fsdata;
-	struct sysfs_dirent *pos;
+	struct sysfs_dirent *pos = filp->private_data;
 	ino_t ino;
 
 	if (filp->f_pos == 0) {
@@ -857,29 +892,31 @@ static int sysfs_readdir(struct file * filp, void * dirent, filldir_t filldir)
 		if (filldir(dirent, "..", 2, filp->f_pos, ino, DT_DIR) == 0)
 			filp->f_pos++;
 	}
-	if ((filp->f_pos > 1) && (filp->f_pos < INT_MAX)) {
-		mutex_lock(&sysfs_mutex);
-
-		/* Skip the dentries we have already reported */
-		pos = parent_sd->s_dir.children;
-		while (pos && (filp->f_pos > pos->s_ino))
-			pos = pos->s_sibling;
-
-		for ( ; pos; pos = pos->s_sibling) {
-			const char * name;
-			int len;
-
-			name = pos->s_name;
-			len = strlen(name);
-			filp->f_pos = ino = pos->s_ino;
+	mutex_lock(&sysfs_mutex);
+	for (pos = sysfs_dir_pos(parent_sd, filp->f_pos, pos);
+	     pos;
+	     pos = sysfs_dir_next_pos(parent_sd, filp->f_pos, pos)) {
+		const char * name;
+		unsigned int type;
+		int len, ret;
+
+		name = pos->s_name;
+		len = strlen(name);
+		ino = pos->s_ino;
+		type = dt_type(pos);
+		filp->f_pos = ino;
+		filp->private_data = sysfs_get(pos);
 
-			if (filldir(dirent, name, len, filp->f_pos, ino,
-					 dt_type(pos)) < 0)
-				break;
-		}
-		if (!pos)
-			filp->f_pos = INT_MAX;
 		mutex_unlock(&sysfs_mutex);
+		ret = filldir(dirent, name, len, filp->f_pos, ino, type);
+		mutex_lock(&sysfs_mutex);
+		if (ret < 0)
+			break;
+	}
+	mutex_unlock(&sysfs_mutex);
+	if ((filp->f_pos > 1) && !pos) { /* EOF */
+		filp->f_pos = INT_MAX;
+		filp->private_data = NULL;
 	}
 	return 0;
 }
@@ -888,5 +925,6 @@ static int sysfs_readdir(struct file * filp, void * dirent, filldir_t filldir)
 const struct file_operations sysfs_dir_operations = {
 	.read		= generic_read_dir,
 	.readdir	= sysfs_readdir,
+	.release	= sysfs_dir_release,
 	.llseek		= generic_file_llseek,
 };
-- 
1.7.0.1


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

* [PATCH 23/62] driver-core: firmware_class: remove base.h header inclusion
  2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
                   ` (21 preceding siblings ...)
  2010-03-02 23:28 ` [PATCH 22/62] sysfs: Cache the last sysfs_dirent to improve readdir scalability v2 Greg Kroah-Hartman
@ 2010-03-02 23:28 ` Greg Kroah-Hartman
  2010-03-02 23:28 ` [PATCH 24/62] kobject: Constify struct kset_uevent_ops Greg Kroah-Hartman
                   ` (37 subsequent siblings)
  60 siblings, 0 replies; 90+ messages in thread
From: Greg Kroah-Hartman @ 2010-03-02 23:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: Luis R. Rodriguez, Johannes Berg, Greg Kroah-Hartman

From: Luis R. Rodriguez <lrodriguez@atheros.com>

base.h is used by base drivers for sharing internal structures.
Turns out firmware_class does not depend on it at all so remove it.

Cc: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Luis R. Rodriguez <lrodriguez@atheros.com>
Acked-by: Marcel Holtmann <marcel@holtmann.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/base/firmware_class.c |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
index 6604fb3..0797748 100644
--- a/drivers/base/firmware_class.c
+++ b/drivers/base/firmware_class.c
@@ -19,7 +19,6 @@
 #include <linux/kthread.h>
 #include <linux/highmem.h>
 #include <linux/firmware.h>
-#include "base.h"
 
 #define to_dev(obj) container_of(obj, struct device, kobj)
 
-- 
1.7.0.1


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

* [PATCH 24/62] kobject: Constify struct kset_uevent_ops
  2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
                   ` (22 preceding siblings ...)
  2010-03-02 23:28 ` [PATCH 23/62] driver-core: firmware_class: remove base.h header inclusion Greg Kroah-Hartman
@ 2010-03-02 23:28 ` Greg Kroah-Hartman
  2010-03-02 23:28 ` [PATCH 25/62] HOWTO: Updates on subsystem trees, patchwork, -next (vs. -mm) Greg Kroah-Hartman
                   ` (36 subsequent siblings)
  60 siblings, 0 replies; 90+ messages in thread
From: Greg Kroah-Hartman @ 2010-03-02 23:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: Emese Revfy, Greg Kroah-Hartman

From: Emese Revfy <re.emese@gmail.com>

Constify struct kset_uevent_ops.

This is part of the ops structure constification
effort started by Arjan van de Ven et al.

Benefits of this constification:

 * prevents modification of data that is shared
   (referenced) by many other structure instances
   at runtime

 * detects/prevents accidental (but not intentional)
   modification attempts on archs that enforce
   read-only kernel data at runtime

 * potentially better optimized code as the compiler
   can assume that the const data cannot be changed

 * the compiler/linker move const data into .rodata
   and therefore exclude them from false sharing

Signed-off-by: Emese Revfy <re.emese@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/base/bus.c      |    2 +-
 drivers/base/core.c     |    2 +-
 drivers/base/memory.c   |    2 +-
 fs/gfs2/sys.c           |    2 +-
 include/linux/kobject.h |   10 +++++-----
 kernel/params.c         |    2 +-
 lib/kobject.c           |    4 ++--
 lib/kobject_uevent.c    |    2 +-
 mm/slub.c               |    2 +-
 9 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/base/bus.c b/drivers/base/bus.c
index c0c5a43..2afe599 100644
--- a/drivers/base/bus.c
+++ b/drivers/base/bus.c
@@ -154,7 +154,7 @@ static int bus_uevent_filter(struct kset *kset, struct kobject *kobj)
 	return 0;
 }
 
-static struct kset_uevent_ops bus_uevent_ops = {
+static const struct kset_uevent_ops bus_uevent_ops = {
 	.filter = bus_uevent_filter,
 };
 
diff --git a/drivers/base/core.c b/drivers/base/core.c
index e1d6cb4..313db11 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -252,7 +252,7 @@ static int dev_uevent(struct kset *kset, struct kobject *kobj,
 	return retval;
 }
 
-static struct kset_uevent_ops device_uevent_ops = {
+static const struct kset_uevent_ops device_uevent_ops = {
 	.filter =	dev_uevent_filter,
 	.name =		dev_uevent_name,
 	.uevent =	dev_uevent,
diff --git a/drivers/base/memory.c b/drivers/base/memory.c
index 495f15e..2f86915 100644
--- a/drivers/base/memory.c
+++ b/drivers/base/memory.c
@@ -44,7 +44,7 @@ static int memory_uevent(struct kset *kset, struct kobject *obj, struct kobj_uev
 	return retval;
 }
 
-static struct kset_uevent_ops memory_uevent_ops = {
+static const struct kset_uevent_ops memory_uevent_ops = {
 	.name		= memory_uevent_name,
 	.uevent		= memory_uevent,
 };
diff --git a/fs/gfs2/sys.c b/fs/gfs2/sys.c
index 0dc3462..9be733e 100644
--- a/fs/gfs2/sys.c
+++ b/fs/gfs2/sys.c
@@ -576,7 +576,7 @@ static int gfs2_uevent(struct kset *kset, struct kobject *kobj,
 	return 0;
 }
 
-static struct kset_uevent_ops gfs2_uevent_ops = {
+static const struct kset_uevent_ops gfs2_uevent_ops = {
 	.uevent = gfs2_uevent,
 };
 
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index 58ae8e0..57a1eaa 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -118,9 +118,9 @@ struct kobj_uevent_env {
 };
 
 struct kset_uevent_ops {
-	int (*filter)(struct kset *kset, struct kobject *kobj);
-	const char *(*name)(struct kset *kset, struct kobject *kobj);
-	int (*uevent)(struct kset *kset, struct kobject *kobj,
+	int (* const filter)(struct kset *kset, struct kobject *kobj);
+	const char *(* const name)(struct kset *kset, struct kobject *kobj);
+	int (* const uevent)(struct kset *kset, struct kobject *kobj,
 		      struct kobj_uevent_env *env);
 };
 
@@ -155,14 +155,14 @@ struct kset {
 	struct list_head list;
 	spinlock_t list_lock;
 	struct kobject kobj;
-	struct kset_uevent_ops *uevent_ops;
+	const struct kset_uevent_ops *uevent_ops;
 };
 
 extern void kset_init(struct kset *kset);
 extern int __must_check kset_register(struct kset *kset);
 extern void kset_unregister(struct kset *kset);
 extern struct kset * __must_check kset_create_and_add(const char *name,
-						struct kset_uevent_ops *u,
+						const struct kset_uevent_ops *u,
 						struct kobject *parent_kobj);
 
 static inline struct kset *to_kset(struct kobject *kobj)
diff --git a/kernel/params.c b/kernel/params.c
index cf1b691..ac5de7d 100644
--- a/kernel/params.c
+++ b/kernel/params.c
@@ -737,7 +737,7 @@ static int uevent_filter(struct kset *kset, struct kobject *kobj)
 	return 0;
 }
 
-static struct kset_uevent_ops module_uevent_ops = {
+static const struct kset_uevent_ops module_uevent_ops = {
 	.filter = uevent_filter,
 };
 
diff --git a/lib/kobject.c b/lib/kobject.c
index b512b74..cecf5a0 100644
--- a/lib/kobject.c
+++ b/lib/kobject.c
@@ -789,7 +789,7 @@ static struct kobj_type kset_ktype = {
  * If the kset was not able to be created, NULL will be returned.
  */
 static struct kset *kset_create(const char *name,
-				struct kset_uevent_ops *uevent_ops,
+				const struct kset_uevent_ops *uevent_ops,
 				struct kobject *parent_kobj)
 {
 	struct kset *kset;
@@ -832,7 +832,7 @@ static struct kset *kset_create(const char *name,
  * If the kset was not able to be created, NULL will be returned.
  */
 struct kset *kset_create_and_add(const char *name,
-				 struct kset_uevent_ops *uevent_ops,
+				 const struct kset_uevent_ops *uevent_ops,
 				 struct kobject *parent_kobj)
 {
 	struct kset *kset;
diff --git a/lib/kobject_uevent.c b/lib/kobject_uevent.c
index 920a3ca..c9d3a3e 100644
--- a/lib/kobject_uevent.c
+++ b/lib/kobject_uevent.c
@@ -95,7 +95,7 @@ int kobject_uevent_env(struct kobject *kobj, enum kobject_action action,
 	const char *subsystem;
 	struct kobject *top_kobj;
 	struct kset *kset;
-	struct kset_uevent_ops *uevent_ops;
+	const struct kset_uevent_ops *uevent_ops;
 	u64 seq;
 	int i = 0;
 	int retval = 0;
diff --git a/mm/slub.c b/mm/slub.c
index 8d71aaf..02b5a83 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -4538,7 +4538,7 @@ static int uevent_filter(struct kset *kset, struct kobject *kobj)
 	return 0;
 }
 
-static struct kset_uevent_ops slab_uevent_ops = {
+static const struct kset_uevent_ops slab_uevent_ops = {
 	.filter = uevent_filter,
 };
 
-- 
1.7.0.1


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

* [PATCH 25/62] HOWTO: Updates on subsystem trees, patchwork, -next (vs. -mm)
  2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
                   ` (23 preceding siblings ...)
  2010-03-02 23:28 ` [PATCH 24/62] kobject: Constify struct kset_uevent_ops Greg Kroah-Hartman
@ 2010-03-02 23:28 ` Greg Kroah-Hartman
  2010-03-02 23:28 ` [PATCH 26/62] sysdev: fix up the probe/release attributes Greg Kroah-Hartman
                   ` (35 subsequent siblings)
  60 siblings, 0 replies; 90+ messages in thread
From: Greg Kroah-Hartman @ 2010-03-02 23:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: Stefan Richter, Greg Kroah-Hartman

From: Stefan Richter <stefanr@s5r6.in-berlin.de>

One of the roles which -mm fulfilled some time ago (to offer an
integration testing ground) has been taken over by -next.  This is still
news to Documentation/HOWTO, so mention it there.

Also add a word on how patchwork is used to track patches as they make
their way into subsystem trees.  Remove some arbitrary links to
subsystem repositories; they can all be found in the MAINTAINERS
database.

Acked-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 Documentation/HOWTO |  113 ++++++++++++++++----------------------------------
 1 files changed, 36 insertions(+), 77 deletions(-)

diff --git a/Documentation/HOWTO b/Documentation/HOWTO
index 8495fc9..f5395af 100644
--- a/Documentation/HOWTO
+++ b/Documentation/HOWTO
@@ -221,8 +221,8 @@ branches.  These different branches are:
   - main 2.6.x kernel tree
   - 2.6.x.y -stable kernel tree
   - 2.6.x -git kernel patches
-  - 2.6.x -mm kernel patches
   - subsystem specific kernel trees and patches
+  - the 2.6.x -next kernel tree for integration tests
 
 2.6.x kernel tree
 -----------------
@@ -232,7 +232,7 @@ process is as follows:
   - As soon as a new kernel is released a two weeks window is open,
     during this period of time maintainers can submit big diffs to
     Linus, usually the patches that have already been included in the
-    -mm kernel for a few weeks.  The preferred way to submit big changes
+    -next kernel for a few weeks.  The preferred way to submit big changes
     is using git (the kernel's source management tool, more information
     can be found at http://git.or.cz/) but plain patches are also just
     fine.
@@ -293,84 +293,43 @@ daily and represent the current state of Linus' tree.  They are more
 experimental than -rc kernels since they are generated automatically
 without even a cursory glance to see if they are sane.
 
-2.6.x -mm kernel patches
-------------------------
-These are experimental kernel patches released by Andrew Morton.  Andrew
-takes all of the different subsystem kernel trees and patches and mushes
-them together, along with a lot of patches that have been plucked from
-the linux-kernel mailing list.  This tree serves as a proving ground for
-new features and patches.  Once a patch has proved its worth in -mm for
-a while Andrew or the subsystem maintainer pushes it on to Linus for
-inclusion in mainline.
-
-It is heavily encouraged that all new patches get tested in the -mm tree
-before they are sent to Linus for inclusion in the main kernel tree.  Code
-which does not make an appearance in -mm before the opening of the merge
-window will prove hard to merge into the mainline.
-
-These kernels are not appropriate for use on systems that are supposed
-to be stable and they are more risky to run than any of the other
-branches.
-
-If you wish to help out with the kernel development process, please test
-and use these kernel releases and provide feedback to the linux-kernel
-mailing list if you have any problems, and if everything works properly.
-
-In addition to all the other experimental patches, these kernels usually
-also contain any changes in the mainline -git kernels available at the
-time of release.
-
-The -mm kernels are not released on a fixed schedule, but usually a few
--mm kernels are released in between each -rc kernel (1 to 3 is common).
-
 Subsystem Specific kernel trees and patches
 -------------------------------------------
-A number of the different kernel subsystem developers expose their
-development trees so that others can see what is happening in the
-different areas of the kernel.  These trees are pulled into the -mm
-kernel releases as described above.
-
-Here is a list of some of the different kernel trees available:
-  git trees:
-    - Kbuild development tree, Sam Ravnborg <sam@ravnborg.org>
-	git.kernel.org:/pub/scm/linux/kernel/git/sam/kbuild.git
-
-    - ACPI development tree, Len Brown <len.brown@intel.com>
-	git.kernel.org:/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6.git
-
-    - Block development tree, Jens Axboe <jens.axboe@oracle.com>
-	git.kernel.org:/pub/scm/linux/kernel/git/axboe/linux-2.6-block.git
-
-    - DRM development tree, Dave Airlie <airlied@linux.ie>
-	git.kernel.org:/pub/scm/linux/kernel/git/airlied/drm-2.6.git
-
-    - ia64 development tree, Tony Luck <tony.luck@intel.com>
-	git.kernel.org:/pub/scm/linux/kernel/git/aegl/linux-2.6.git
-
-    - infiniband, Roland Dreier <rolandd@cisco.com>
-	git.kernel.org:/pub/scm/linux/kernel/git/roland/infiniband.git
-
-    - libata, Jeff Garzik <jgarzik@pobox.com>
-	git.kernel.org:/pub/scm/linux/kernel/git/jgarzik/libata-dev.git
-
-    - network drivers, Jeff Garzik <jgarzik@pobox.com>
-	git.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6.git
-
-    - pcmcia, Dominik Brodowski <linux@dominikbrodowski.net>
-	git.kernel.org:/pub/scm/linux/kernel/git/brodo/pcmcia-2.6.git
-
-    - SCSI, James Bottomley <James.Bottomley@hansenpartnership.com>
-	git.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6.git
-
-    - x86, Ingo Molnar <mingo@elte.hu>
-	git://git.kernel.org/pub/scm/linux/kernel/git/x86/linux-2.6-x86.git
-
-  quilt trees:
-    - USB, Driver Core, and I2C, Greg Kroah-Hartman <gregkh@suse.de>
-	kernel.org/pub/linux/kernel/people/gregkh/gregkh-2.6/
+The maintainers of the various kernel subsystems --- and also many
+kernel subsystem developers --- expose their current state of
+development in source repositories.  That way, others can see what is
+happening in the different areas of the kernel.  In areas where
+development is rapid, a developer may be asked to base his submissions
+onto such a subsystem kernel tree so that conflicts between the
+submission and other already ongoing work are avoided.
+
+Most of these repositories are git trees, but there are also other SCMs
+in use, or patch queues being published as quilt series.  Addresses of
+these subsystem repositories are listed in the MAINTAINERS file.  Many
+of them can be browsed at http://git.kernel.org/.
+
+Before a proposed patch is committed to such a subsystem tree, it is
+subject to review which primarily happens on mailing lists (see the
+respective section below).  For several kernel subsystems, this review
+process is tracked with the tool patchwork.  Patchwork offers a web
+interface which shows patch postings, any comments on a patch or
+revisions to it, and maintainers can mark patches as under review,
+accepted, or rejected.  Most of these patchwork sites are listed at
+http://patchwork.kernel.org/ or http://patchwork.ozlabs.org/.
+
+2.6.x -next kernel tree for integration tests
+---------------------------------------------
+Before updates from subsystem trees are merged into the mainline 2.6.x
+tree, they need to be integration-tested.  For this purpose, a special
+testing repository exists into which virtually all subsystem trees are
+pulled on an almost daily basis:
+	http://git.kernel.org/?p=linux/kernel/git/sfr/linux-next.git
+	http://linux.f-seidel.de/linux-next/pmwiki/
+
+This way, the -next kernel gives a summary outlook onto what will be
+expected to go into the mainline kernel at the next merge period.
+Adventurous testers are very welcome to runtime-test the -next kernel.
 
-  Other kernel trees can be found listed at http://git.kernel.org/ and in
-  the MAINTAINERS file.
 
 Bug Reporting
 -------------
-- 
1.7.0.1


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

* [PATCH 26/62] sysdev: fix up the probe/release attributes
  2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
                   ` (24 preceding siblings ...)
  2010-03-02 23:28 ` [PATCH 25/62] HOWTO: Updates on subsystem trees, patchwork, -next (vs. -mm) Greg Kroah-Hartman
@ 2010-03-02 23:28 ` Greg Kroah-Hartman
  2010-03-02 23:28 ` [PATCH 27/62] Driver core: Constify struct sysfs_ops in struct kobj_type Greg Kroah-Hartman
                   ` (34 subsequent siblings)
  60 siblings, 0 replies; 90+ messages in thread
From: Greg Kroah-Hartman @ 2010-03-02 23:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman, Andi Kleen

These should be sysdev attributes, not class attributes.  This patch
should resolve the problem.

Thanks to Stephen Rothwell for pointing out the problem.

Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Andi Kleen <andi@firstfloor.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/base/cpu.c |   16 ++++++++--------
 1 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c
index 9121c77..7036e8e 100644
--- a/drivers/base/cpu.c
+++ b/drivers/base/cpu.c
@@ -79,24 +79,24 @@ void unregister_cpu(struct cpu *cpu)
 }
 
 #ifdef CONFIG_ARCH_CPU_PROBE_RELEASE
-static ssize_t cpu_probe_store(struct class *class,
-				struct class_attribute *attr,
+static ssize_t cpu_probe_store(struct sys_device *dev,
+				struct sysdev_attribute *attr,
 				const char *buf,
 			       size_t count)
 {
 	return arch_cpu_probe(buf, count);
 }
 
-static ssize_t cpu_release_store(struct class *class,
-				struct class_attribute *attr,
+static ssize_t cpu_release_store(struct sys_device *dev,
+				struct sysdev_attribute *attr,
 				const char *buf,
 				 size_t count)
 {
 	return arch_cpu_release(buf, count);
 }
 
-static CLASS_ATTR(probe, S_IWUSR, NULL, cpu_probe_store);
-static CLASS_ATTR(release, S_IWUSR, NULL, cpu_release_store);
+static SYSDEV_ATTR(probe, S_IWUSR, NULL, cpu_probe_store);
+static SYSDEV_ATTR(release, S_IWUSR, NULL, cpu_release_store);
 #endif /* CONFIG_ARCH_CPU_PROBE_RELEASE */
 
 #else /* ... !CONFIG_HOTPLUG_CPU */
@@ -261,8 +261,8 @@ int __init cpu_dev_init(void)
 
 static struct sysdev_class_attribute *cpu_sysdev_class_attrs[] = {
 #ifdef CONFIG_ARCH_CPU_PROBE_RELEASE
-	&class_attr_probe.attr,
-	&class_attr_release.attr,
+	&attr_probe,
+	&attr_release,
 #endif
 	&cpu_attrs[0].attr,
 	&cpu_attrs[1].attr,
-- 
1.7.0.1


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

* [PATCH 27/62] Driver core: Constify struct sysfs_ops in struct kobj_type
  2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
                   ` (25 preceding siblings ...)
  2010-03-02 23:28 ` [PATCH 26/62] sysdev: fix up the probe/release attributes Greg Kroah-Hartman
@ 2010-03-02 23:28 ` Greg Kroah-Hartman
  2010-03-02 23:28 ` [PATCH 28/62] Driver core: make struct platform_driver.id_table const Greg Kroah-Hartman
                   ` (33 subsequent siblings)
  60 siblings, 0 replies; 90+ messages in thread
From: Greg Kroah-Hartman @ 2010-03-02 23:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: Emese Revfy, Greg Kroah-Hartman

From: Emese Revfy <re.emese@gmail.com>

Constify struct sysfs_ops.

This is part of the ops structure constification
effort started by Arjan van de Ven et al.

Benefits of this constification:

 * prevents modification of data that is shared
   (referenced) by many other structure instances
   at runtime

 * detects/prevents accidental (but not intentional)
   modification attempts on archs that enforce
   read-only kernel data at runtime

 * potentially better optimized code as the compiler
   can assume that the const data cannot be changed

 * the compiler/linker move const data into .rodata
   and therefore exclude them from false sharing

Signed-off-by: Emese Revfy <re.emese@gmail.com>
Acked-by: David Teigland <teigland@redhat.com>
Acked-by: Matt Domsch <Matt_Domsch@dell.com>
Acked-by: Maciej Sosnowski <maciej.sosnowski@intel.com>
Acked-by: Hans J. Koch <hjk@linutronix.de>
Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>
Acked-by: Jens Axboe <jens.axboe@oracle.com>
Acked-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 Documentation/kobject.txt             |    2 +-
 arch/ia64/kernel/topology.c           |    2 +-
 arch/powerpc/kernel/cacheinfo.c       |    2 +-
 arch/sh/kernel/cpu/sh4/sq.c           |    2 +-
 arch/x86/kernel/cpu/intel_cacheinfo.c |    2 +-
 arch/x86/kernel/cpu/mcheck/mce_amd.c  |    2 +-
 block/blk-integrity.c                 |    2 +-
 block/blk-sysfs.c                     |    2 +-
 block/elevator.c                      |    2 +-
 drivers/base/bus.c                    |    4 ++--
 drivers/base/class.c                  |    2 +-
 drivers/base/core.c                   |    2 +-
 drivers/base/sys.c                    |    4 ++--
 drivers/block/pktcdvd.c               |    2 +-
 drivers/cpufreq/cpufreq.c             |    2 +-
 drivers/cpuidle/sysfs.c               |    4 ++--
 drivers/dma/ioat/dma.c                |    2 +-
 drivers/dma/ioat/dma.h                |    2 +-
 drivers/edac/edac_device_sysfs.c      |    6 +++---
 drivers/edac/edac_mc_sysfs.c          |    4 ++--
 drivers/edac/edac_pci_sysfs.c         |    4 ++--
 drivers/firmware/edd.c                |    2 +-
 drivers/firmware/efivars.c            |    2 +-
 drivers/firmware/iscsi_ibft.c         |    2 +-
 drivers/firmware/memmap.c             |    2 +-
 drivers/gpu/drm/ttm/ttm_bo.c          |    2 +-
 drivers/gpu/drm/ttm/ttm_memory.c      |    2 +-
 drivers/infiniband/core/cm.c          |    2 +-
 drivers/infiniband/core/sysfs.c       |    2 +-
 drivers/md/dm-sysfs.c                 |    2 +-
 drivers/md/md.c                       |    4 ++--
 drivers/net/ibmveth.c                 |    2 +-
 drivers/net/iseries_veth.c            |    4 ++--
 drivers/parisc/pdc_stable.c           |    2 +-
 drivers/pci/hotplug/fakephp.c         |    2 +-
 drivers/pci/slot.c                    |    2 +-
 drivers/uio/uio.c                     |    4 ++--
 drivers/uwb/wlp/sysfs.c               |    3 +--
 drivers/video/omap2/dss/manager.c     |    2 +-
 drivers/video/omap2/dss/overlay.c     |    2 +-
 drivers/xen/sys-hypervisor.c          |    2 +-
 fs/btrfs/sysfs.c                      |    4 ++--
 fs/dlm/lockspace.c                    |    2 +-
 fs/ext4/super.c                       |    2 +-
 fs/gfs2/sys.c                         |    2 +-
 fs/ocfs2/cluster/masklog.c            |    2 +-
 fs/sysfs/file.c                       |    8 ++++----
 include/linux/kobject.h               |    4 ++--
 kernel/params.c                       |    2 +-
 lib/kobject.c                         |    2 +-
 mm/slub.c                             |    2 +-
 net/bridge/br_private.h               |    2 +-
 net/bridge/br_sysfs_if.c              |    2 +-
 samples/kobject/kset-example.c        |    2 +-
 54 files changed, 69 insertions(+), 70 deletions(-)

diff --git a/Documentation/kobject.txt b/Documentation/kobject.txt
index c79ab99..bdb1381 100644
--- a/Documentation/kobject.txt
+++ b/Documentation/kobject.txt
@@ -266,7 +266,7 @@ kobj_type:
 
     struct kobj_type {
 	    void (*release)(struct kobject *);
-	    struct sysfs_ops	*sysfs_ops;
+	    const struct sysfs_ops *sysfs_ops;
 	    struct attribute	**default_attrs;
     };
 
diff --git a/arch/ia64/kernel/topology.c b/arch/ia64/kernel/topology.c
index 8f06035..b3a5818 100644
--- a/arch/ia64/kernel/topology.c
+++ b/arch/ia64/kernel/topology.c
@@ -282,7 +282,7 @@ static ssize_t cache_show(struct kobject * kobj, struct attribute * attr, char *
 	return ret;
 }
 
-static struct sysfs_ops cache_sysfs_ops = {
+static const struct sysfs_ops cache_sysfs_ops = {
 	.show   = cache_show
 };
 
diff --git a/arch/powerpc/kernel/cacheinfo.c b/arch/powerpc/kernel/cacheinfo.c
index bb37b1d..01fe9ce 100644
--- a/arch/powerpc/kernel/cacheinfo.c
+++ b/arch/powerpc/kernel/cacheinfo.c
@@ -642,7 +642,7 @@ static struct kobj_attribute *cache_index_opt_attrs[] = {
 	&cache_assoc_attr,
 };
 
-static struct sysfs_ops cache_index_ops = {
+static const struct sysfs_ops cache_index_ops = {
 	.show = cache_index_show,
 };
 
diff --git a/arch/sh/kernel/cpu/sh4/sq.c b/arch/sh/kernel/cpu/sh4/sq.c
index fc065f9..14726ee 100644
--- a/arch/sh/kernel/cpu/sh4/sq.c
+++ b/arch/sh/kernel/cpu/sh4/sq.c
@@ -326,7 +326,7 @@ static struct attribute *sq_sysfs_attrs[] = {
 	NULL,
 };
 
-static struct sysfs_ops sq_sysfs_ops = {
+static const struct sysfs_ops sq_sysfs_ops = {
 	.show	= sq_sysfs_show,
 	.store	= sq_sysfs_store,
 };
diff --git a/arch/x86/kernel/cpu/intel_cacheinfo.c b/arch/x86/kernel/cpu/intel_cacheinfo.c
index eddb1bd..b3eeb66 100644
--- a/arch/x86/kernel/cpu/intel_cacheinfo.c
+++ b/arch/x86/kernel/cpu/intel_cacheinfo.c
@@ -903,7 +903,7 @@ static ssize_t store(struct kobject *kobj, struct attribute *attr,
 	return ret;
 }
 
-static struct sysfs_ops sysfs_ops = {
+static const struct sysfs_ops sysfs_ops = {
 	.show   = show,
 	.store  = store,
 };
diff --git a/arch/x86/kernel/cpu/mcheck/mce_amd.c b/arch/x86/kernel/cpu/mcheck/mce_amd.c
index 83a3d1f..cda932c 100644
--- a/arch/x86/kernel/cpu/mcheck/mce_amd.c
+++ b/arch/x86/kernel/cpu/mcheck/mce_amd.c
@@ -388,7 +388,7 @@ static ssize_t store(struct kobject *kobj, struct attribute *attr,
 	return ret;
 }
 
-static struct sysfs_ops threshold_ops = {
+static const struct sysfs_ops threshold_ops = {
 	.show			= show,
 	.store			= store,
 };
diff --git a/block/blk-integrity.c b/block/blk-integrity.c
index 15c6308..96e83c2 100644
--- a/block/blk-integrity.c
+++ b/block/blk-integrity.c
@@ -278,7 +278,7 @@ static struct attribute *integrity_attrs[] = {
 	NULL,
 };
 
-static struct sysfs_ops integrity_ops = {
+static const struct sysfs_ops integrity_ops = {
 	.show	= &integrity_attr_show,
 	.store	= &integrity_attr_store,
 };
diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
index e854424..2ae2cb3 100644
--- a/block/blk-sysfs.c
+++ b/block/blk-sysfs.c
@@ -450,7 +450,7 @@ static void blk_release_queue(struct kobject *kobj)
 	kmem_cache_free(blk_requestq_cachep, q);
 }
 
-static struct sysfs_ops queue_sysfs_ops = {
+static const struct sysfs_ops queue_sysfs_ops = {
 	.show	= queue_attr_show,
 	.store	= queue_attr_store,
 };
diff --git a/block/elevator.c b/block/elevator.c
index ee3a883..df75676 100644
--- a/block/elevator.c
+++ b/block/elevator.c
@@ -892,7 +892,7 @@ elv_attr_store(struct kobject *kobj, struct attribute *attr,
 	return error;
 }
 
-static struct sysfs_ops elv_sysfs_ops = {
+static const struct sysfs_ops elv_sysfs_ops = {
 	.show	= elv_attr_show,
 	.store	= elv_attr_store,
 };
diff --git a/drivers/base/bus.c b/drivers/base/bus.c
index 2afe599..cca1aa1 100644
--- a/drivers/base/bus.c
+++ b/drivers/base/bus.c
@@ -70,7 +70,7 @@ static ssize_t drv_attr_store(struct kobject *kobj, struct attribute *attr,
 	return ret;
 }
 
-static struct sysfs_ops driver_sysfs_ops = {
+static const struct sysfs_ops driver_sysfs_ops = {
 	.show	= drv_attr_show,
 	.store	= drv_attr_store,
 };
@@ -115,7 +115,7 @@ static ssize_t bus_attr_store(struct kobject *kobj, struct attribute *attr,
 	return ret;
 }
 
-static struct sysfs_ops bus_sysfs_ops = {
+static const struct sysfs_ops bus_sysfs_ops = {
 	.show	= bus_attr_show,
 	.store	= bus_attr_store,
 };
diff --git a/drivers/base/class.c b/drivers/base/class.c
index 2e297cc..0147f47 100644
--- a/drivers/base/class.c
+++ b/drivers/base/class.c
@@ -63,7 +63,7 @@ static void class_release(struct kobject *kobj)
 	kfree(cp);
 }
 
-static struct sysfs_ops class_sysfs_ops = {
+static const struct sysfs_ops class_sysfs_ops = {
 	.show	= class_attr_show,
 	.store	= class_attr_store,
 };
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 313db11..bbfcea0 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -100,7 +100,7 @@ static ssize_t dev_attr_store(struct kobject *kobj, struct attribute *attr,
 	return ret;
 }
 
-static struct sysfs_ops dev_sysfs_ops = {
+static const struct sysfs_ops dev_sysfs_ops = {
 	.show	= dev_attr_show,
 	.store	= dev_attr_store,
 };
diff --git a/drivers/base/sys.c b/drivers/base/sys.c
index 747c99e..8980fee 100644
--- a/drivers/base/sys.c
+++ b/drivers/base/sys.c
@@ -54,7 +54,7 @@ sysdev_store(struct kobject *kobj, struct attribute *attr,
 	return -EIO;
 }
 
-static struct sysfs_ops sysfs_ops = {
+static const struct sysfs_ops sysfs_ops = {
 	.show	= sysdev_show,
 	.store	= sysdev_store,
 };
@@ -104,7 +104,7 @@ static ssize_t sysdev_class_store(struct kobject *kobj, struct attribute *attr,
 	return -EIO;
 }
 
-static struct sysfs_ops sysfs_class_ops = {
+static const struct sysfs_ops sysfs_class_ops = {
 	.show	= sysdev_class_show,
 	.store	= sysdev_class_store,
 };
diff --git a/drivers/block/pktcdvd.c b/drivers/block/pktcdvd.c
index 73d815d..39c8514 100644
--- a/drivers/block/pktcdvd.c
+++ b/drivers/block/pktcdvd.c
@@ -284,7 +284,7 @@ static ssize_t kobj_pkt_store(struct kobject *kobj,
 	return len;
 }
 
-static struct sysfs_ops kobj_pkt_ops = {
+static const struct sysfs_ops kobj_pkt_ops = {
 	.show = kobj_pkt_show,
 	.store = kobj_pkt_store
 };
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 67bc2ec..2d5d575 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -766,7 +766,7 @@ static void cpufreq_sysfs_release(struct kobject *kobj)
 	complete(&policy->kobj_unregister);
 }
 
-static struct sysfs_ops sysfs_ops = {
+static const struct sysfs_ops sysfs_ops = {
 	.show	= show,
 	.store	= store,
 };
diff --git a/drivers/cpuidle/sysfs.c b/drivers/cpuidle/sysfs.c
index c9cefac..8719b36 100644
--- a/drivers/cpuidle/sysfs.c
+++ b/drivers/cpuidle/sysfs.c
@@ -195,7 +195,7 @@ static ssize_t cpuidle_store(struct kobject * kobj, struct attribute * attr,
 	return ret;
 }
 
-static struct sysfs_ops cpuidle_sysfs_ops = {
+static const struct sysfs_ops cpuidle_sysfs_ops = {
 	.show = cpuidle_show,
 	.store = cpuidle_store,
 };
@@ -281,7 +281,7 @@ static ssize_t cpuidle_state_show(struct kobject * kobj,
 	return ret;
 }
 
-static struct sysfs_ops cpuidle_state_sysfs_ops = {
+static const struct sysfs_ops cpuidle_state_sysfs_ops = {
 	.show = cpuidle_state_show,
 };
 
diff --git a/drivers/dma/ioat/dma.c b/drivers/dma/ioat/dma.c
index dcc4ab7..cc834bb 100644
--- a/drivers/dma/ioat/dma.c
+++ b/drivers/dma/ioat/dma.c
@@ -1146,7 +1146,7 @@ ioat_attr_show(struct kobject *kobj, struct attribute *attr, char *page)
 	return entry->show(&chan->common, page);
 }
 
-struct sysfs_ops ioat_sysfs_ops = {
+const struct sysfs_ops ioat_sysfs_ops = {
 	.show	= ioat_attr_show,
 };
 
diff --git a/drivers/dma/ioat/dma.h b/drivers/dma/ioat/dma.h
index bbc3e78..f2db62c 100644
--- a/drivers/dma/ioat/dma.h
+++ b/drivers/dma/ioat/dma.h
@@ -347,7 +347,7 @@ bool ioat_cleanup_preamble(struct ioat_chan_common *chan,
 			   unsigned long *phys_complete);
 void ioat_kobject_add(struct ioatdma_device *device, struct kobj_type *type);
 void ioat_kobject_del(struct ioatdma_device *device);
-extern struct sysfs_ops ioat_sysfs_ops;
+extern const struct sysfs_ops ioat_sysfs_ops;
 extern struct ioat_sysfs_entry ioat_version_attr;
 extern struct ioat_sysfs_entry ioat_cap_attr;
 #endif /* IOATDMA_H */
diff --git a/drivers/edac/edac_device_sysfs.c b/drivers/edac/edac_device_sysfs.c
index 5376457..5fdedbc 100644
--- a/drivers/edac/edac_device_sysfs.c
+++ b/drivers/edac/edac_device_sysfs.c
@@ -137,7 +137,7 @@ static ssize_t edac_dev_ctl_info_store(struct kobject *kobj,
 }
 
 /* edac_dev file operations for an 'ctl_info' */
-static struct sysfs_ops device_ctl_info_ops = {
+static const struct sysfs_ops device_ctl_info_ops = {
 	.show = edac_dev_ctl_info_show,
 	.store = edac_dev_ctl_info_store
 };
@@ -373,7 +373,7 @@ static ssize_t edac_dev_instance_store(struct kobject *kobj,
 }
 
 /* edac_dev file operations for an 'instance' */
-static struct sysfs_ops device_instance_ops = {
+static const struct sysfs_ops device_instance_ops = {
 	.show = edac_dev_instance_show,
 	.store = edac_dev_instance_store
 };
@@ -476,7 +476,7 @@ static ssize_t edac_dev_block_store(struct kobject *kobj,
 }
 
 /* edac_dev file operations for a 'block' */
-static struct sysfs_ops device_block_ops = {
+static const struct sysfs_ops device_block_ops = {
 	.show = edac_dev_block_show,
 	.store = edac_dev_block_store
 };
diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c
index e1d4ce0..88840e9 100644
--- a/drivers/edac/edac_mc_sysfs.c
+++ b/drivers/edac/edac_mc_sysfs.c
@@ -245,7 +245,7 @@ static ssize_t csrowdev_store(struct kobject *kobj, struct attribute *attr,
 	return -EIO;
 }
 
-static struct sysfs_ops csrowfs_ops = {
+static const struct sysfs_ops csrowfs_ops = {
 	.show = csrowdev_show,
 	.store = csrowdev_store
 };
@@ -575,7 +575,7 @@ static ssize_t mcidev_store(struct kobject *kobj, struct attribute *attr,
 }
 
 /* Intermediate show/store table */
-static struct sysfs_ops mci_ops = {
+static const struct sysfs_ops mci_ops = {
 	.show = mcidev_show,
 	.store = mcidev_store
 };
diff --git a/drivers/edac/edac_pci_sysfs.c b/drivers/edac/edac_pci_sysfs.c
index fb60a87..bef94e3 100644
--- a/drivers/edac/edac_pci_sysfs.c
+++ b/drivers/edac/edac_pci_sysfs.c
@@ -121,7 +121,7 @@ static ssize_t edac_pci_instance_store(struct kobject *kobj,
 }
 
 /* fs_ops table */
-static struct sysfs_ops pci_instance_ops = {
+static const struct sysfs_ops pci_instance_ops = {
 	.show = edac_pci_instance_show,
 	.store = edac_pci_instance_store
 };
@@ -261,7 +261,7 @@ static ssize_t edac_pci_dev_store(struct kobject *kobj,
 	return -EIO;
 }
 
-static struct sysfs_ops edac_pci_sysfs_ops = {
+static const struct sysfs_ops edac_pci_sysfs_ops = {
 	.show = edac_pci_dev_show,
 	.store = edac_pci_dev_store
 };
diff --git a/drivers/firmware/edd.c b/drivers/firmware/edd.c
index 9e4f59d..110e24e 100644
--- a/drivers/firmware/edd.c
+++ b/drivers/firmware/edd.c
@@ -122,7 +122,7 @@ edd_attr_show(struct kobject * kobj, struct attribute *attr, char *buf)
 	return ret;
 }
 
-static struct sysfs_ops edd_attr_ops = {
+static const struct sysfs_ops edd_attr_ops = {
 	.show = edd_attr_show,
 };
 
diff --git a/drivers/firmware/efivars.c b/drivers/firmware/efivars.c
index f4f709d..082f06e 100644
--- a/drivers/firmware/efivars.c
+++ b/drivers/firmware/efivars.c
@@ -362,7 +362,7 @@ static ssize_t efivar_attr_store(struct kobject *kobj, struct attribute *attr,
 	return ret;
 }
 
-static struct sysfs_ops efivar_attr_ops = {
+static const struct sysfs_ops efivar_attr_ops = {
 	.show = efivar_attr_show,
 	.store = efivar_attr_store,
 };
diff --git a/drivers/firmware/iscsi_ibft.c b/drivers/firmware/iscsi_ibft.c
index f82bcda..e9baeab 100644
--- a/drivers/firmware/iscsi_ibft.c
+++ b/drivers/firmware/iscsi_ibft.c
@@ -523,7 +523,7 @@ static ssize_t ibft_show_attribute(struct kobject *kobj,
 	return ret;
 }
 
-static struct sysfs_ops ibft_attr_ops = {
+static const struct sysfs_ops ibft_attr_ops = {
 	.show = ibft_show_attribute,
 };
 
diff --git a/drivers/firmware/memmap.c b/drivers/firmware/memmap.c
index 56f9234..8c58c7b 100644
--- a/drivers/firmware/memmap.c
+++ b/drivers/firmware/memmap.c
@@ -74,7 +74,7 @@ static struct attribute *def_attrs[] = {
 	NULL
 };
 
-static struct sysfs_ops memmap_attr_ops = {
+static const struct sysfs_ops memmap_attr_ops = {
 	.show = memmap_attr_show,
 };
 
diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c
index c7320ce..89c38c4 100644
--- a/drivers/gpu/drm/ttm/ttm_bo.c
+++ b/drivers/gpu/drm/ttm/ttm_bo.c
@@ -128,7 +128,7 @@ static struct attribute *ttm_bo_global_attrs[] = {
 	NULL
 };
 
-static struct sysfs_ops ttm_bo_global_ops = {
+static const struct sysfs_ops ttm_bo_global_ops = {
 	.show = &ttm_bo_global_show
 };
 
diff --git a/drivers/gpu/drm/ttm/ttm_memory.c b/drivers/gpu/drm/ttm/ttm_memory.c
index f5245c0..eb143e0 100644
--- a/drivers/gpu/drm/ttm/ttm_memory.c
+++ b/drivers/gpu/drm/ttm/ttm_memory.c
@@ -152,7 +152,7 @@ static struct attribute *ttm_mem_zone_attrs[] = {
 	NULL
 };
 
-static struct sysfs_ops ttm_mem_zone_ops = {
+static const struct sysfs_ops ttm_mem_zone_ops = {
 	.show = &ttm_mem_zone_show,
 	.store = &ttm_mem_zone_store
 };
diff --git a/drivers/infiniband/core/cm.c b/drivers/infiniband/core/cm.c
index 5130fc5..764787e 100644
--- a/drivers/infiniband/core/cm.c
+++ b/drivers/infiniband/core/cm.c
@@ -3597,7 +3597,7 @@ static ssize_t cm_show_counter(struct kobject *obj, struct attribute *attr,
 		       atomic_long_read(&group->counter[cm_attr->index]));
 }
 
-static struct sysfs_ops cm_counter_ops = {
+static const struct sysfs_ops cm_counter_ops = {
 	.show = cm_show_counter
 };
 
diff --git a/drivers/infiniband/core/sysfs.c b/drivers/infiniband/core/sysfs.c
index 158a214..1558bb7 100644
--- a/drivers/infiniband/core/sysfs.c
+++ b/drivers/infiniband/core/sysfs.c
@@ -79,7 +79,7 @@ static ssize_t port_attr_show(struct kobject *kobj,
 	return port_attr->show(p, port_attr, buf);
 }
 
-static struct sysfs_ops port_sysfs_ops = {
+static const struct sysfs_ops port_sysfs_ops = {
 	.show = port_attr_show
 };
 
diff --git a/drivers/md/dm-sysfs.c b/drivers/md/dm-sysfs.c
index f91b409..84d2b91 100644
--- a/drivers/md/dm-sysfs.c
+++ b/drivers/md/dm-sysfs.c
@@ -75,7 +75,7 @@ static struct attribute *dm_attrs[] = {
 	NULL,
 };
 
-static struct sysfs_ops dm_sysfs_ops = {
+static const struct sysfs_ops dm_sysfs_ops = {
 	.show	= dm_attr_show,
 };
 
diff --git a/drivers/md/md.c b/drivers/md/md.c
index a20a71e..fdc1890 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -2642,7 +2642,7 @@ static void rdev_free(struct kobject *ko)
 	mdk_rdev_t *rdev = container_of(ko, mdk_rdev_t, kobj);
 	kfree(rdev);
 }
-static struct sysfs_ops rdev_sysfs_ops = {
+static const struct sysfs_ops rdev_sysfs_ops = {
 	.show		= rdev_attr_show,
 	.store		= rdev_attr_store,
 };
@@ -4059,7 +4059,7 @@ static void md_free(struct kobject *ko)
 	kfree(mddev);
 }
 
-static struct sysfs_ops md_sysfs_ops = {
+static const struct sysfs_ops md_sysfs_ops = {
 	.show	= md_attr_show,
 	.store	= md_attr_store,
 };
diff --git a/drivers/net/ibmveth.c b/drivers/net/ibmveth.c
index a866939..50715b4 100644
--- a/drivers/net/ibmveth.c
+++ b/drivers/net/ibmveth.c
@@ -1577,7 +1577,7 @@ static struct attribute * veth_pool_attrs[] = {
 	NULL,
 };
 
-static struct sysfs_ops veth_pool_ops = {
+static const struct sysfs_ops veth_pool_ops = {
 	.show   = veth_pool_show,
 	.store  = veth_pool_store,
 };
diff --git a/drivers/net/iseries_veth.c b/drivers/net/iseries_veth.c
index 16c9191..3fa4677 100644
--- a/drivers/net/iseries_veth.c
+++ b/drivers/net/iseries_veth.c
@@ -384,7 +384,7 @@ static struct attribute *veth_cnx_default_attrs[] = {
 	NULL
 };
 
-static struct sysfs_ops veth_cnx_sysfs_ops = {
+static const struct sysfs_ops veth_cnx_sysfs_ops = {
 		.show = veth_cnx_attribute_show
 };
 
@@ -441,7 +441,7 @@ static struct attribute *veth_port_default_attrs[] = {
 	NULL
 };
 
-static struct sysfs_ops veth_port_sysfs_ops = {
+static const struct sysfs_ops veth_port_sysfs_ops = {
 	.show = veth_port_attribute_show
 };
 
diff --git a/drivers/parisc/pdc_stable.c b/drivers/parisc/pdc_stable.c
index 0bc5d47..1062b8f 100644
--- a/drivers/parisc/pdc_stable.c
+++ b/drivers/parisc/pdc_stable.c
@@ -481,7 +481,7 @@ pdcspath_attr_store(struct kobject *kobj, struct attribute *attr,
 	return ret;
 }
 
-static struct sysfs_ops pdcspath_attr_ops = {
+static const struct sysfs_ops pdcspath_attr_ops = {
 	.show = pdcspath_attr_show,
 	.store = pdcspath_attr_store,
 };
diff --git a/drivers/pci/hotplug/fakephp.c b/drivers/pci/hotplug/fakephp.c
index 6151389..0a894ef 100644
--- a/drivers/pci/hotplug/fakephp.c
+++ b/drivers/pci/hotplug/fakephp.c
@@ -73,7 +73,7 @@ static void legacy_release(struct kobject *kobj)
 }
 
 static struct kobj_type legacy_ktype = {
-	.sysfs_ops = &(struct sysfs_ops){
+	.sysfs_ops = &(const struct sysfs_ops){
 		.store = legacy_store, .show = legacy_show
 	},
 	.release = &legacy_release,
diff --git a/drivers/pci/slot.c b/drivers/pci/slot.c
index 49c9e6c..f75a44d 100644
--- a/drivers/pci/slot.c
+++ b/drivers/pci/slot.c
@@ -29,7 +29,7 @@ static ssize_t pci_slot_attr_store(struct kobject *kobj,
 	return attribute->store ? attribute->store(slot, buf, len) : -EIO;
 }
 
-static struct sysfs_ops pci_slot_sysfs_ops = {
+static const struct sysfs_ops pci_slot_sysfs_ops = {
 	.show = pci_slot_attr_show,
 	.store = pci_slot_attr_store,
 };
diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c
index e941367..4de382a 100644
--- a/drivers/uio/uio.c
+++ b/drivers/uio/uio.c
@@ -129,7 +129,7 @@ static ssize_t map_type_show(struct kobject *kobj, struct attribute *attr,
 	return entry->show(mem, buf);
 }
 
-static struct sysfs_ops map_sysfs_ops = {
+static const struct sysfs_ops map_sysfs_ops = {
 	.show = map_type_show,
 };
 
@@ -217,7 +217,7 @@ static ssize_t portio_type_show(struct kobject *kobj, struct attribute *attr,
 	return entry->show(port, buf);
 }
 
-static struct sysfs_ops portio_sysfs_ops = {
+static const struct sysfs_ops portio_sysfs_ops = {
 	.show = portio_type_show,
 };
 
diff --git a/drivers/uwb/wlp/sysfs.c b/drivers/uwb/wlp/sysfs.c
index 0370399..6627c94 100644
--- a/drivers/uwb/wlp/sysfs.c
+++ b/drivers/uwb/wlp/sysfs.c
@@ -615,8 +615,7 @@ ssize_t wlp_wss_attr_store(struct kobject *kobj, struct attribute *attr,
 	return ret;
 }
 
-static
-struct sysfs_ops wss_sysfs_ops = {
+static const struct sysfs_ops wss_sysfs_ops = {
 	.show	= wlp_wss_attr_show,
 	.store	= wlp_wss_attr_store,
 };
diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c
index 27d9c46..378f493 100644
--- a/drivers/video/omap2/dss/manager.c
+++ b/drivers/video/omap2/dss/manager.c
@@ -341,7 +341,7 @@ static ssize_t manager_attr_store(struct kobject *kobj, struct attribute *attr,
 	return manager_attr->store(manager, buf, size);
 }
 
-static struct sysfs_ops manager_sysfs_ops = {
+static const struct sysfs_ops manager_sysfs_ops = {
 	.show = manager_attr_show,
 	.store = manager_attr_store,
 };
diff --git a/drivers/video/omap2/dss/overlay.c b/drivers/video/omap2/dss/overlay.c
index b7f9a73..465b141 100644
--- a/drivers/video/omap2/dss/overlay.c
+++ b/drivers/video/omap2/dss/overlay.c
@@ -320,7 +320,7 @@ static ssize_t overlay_attr_store(struct kobject *kobj, struct attribute *attr,
 	return overlay_attr->store(overlay, buf, size);
 }
 
-static struct sysfs_ops overlay_sysfs_ops = {
+static const struct sysfs_ops overlay_sysfs_ops = {
 	.show = overlay_attr_show,
 	.store = overlay_attr_store,
 };
diff --git a/drivers/xen/sys-hypervisor.c b/drivers/xen/sys-hypervisor.c
index ae5cb05..bb71ab2 100644
--- a/drivers/xen/sys-hypervisor.c
+++ b/drivers/xen/sys-hypervisor.c
@@ -426,7 +426,7 @@ static ssize_t hyp_sysfs_store(struct kobject *kobj,
 	return 0;
 }
 
-static struct sysfs_ops hyp_sysfs_ops = {
+static const struct sysfs_ops hyp_sysfs_ops = {
 	.show = hyp_sysfs_show,
 	.store = hyp_sysfs_store,
 };
diff --git a/fs/btrfs/sysfs.c b/fs/btrfs/sysfs.c
index a240b6f..4ce16ef 100644
--- a/fs/btrfs/sysfs.c
+++ b/fs/btrfs/sysfs.c
@@ -164,12 +164,12 @@ static void btrfs_root_release(struct kobject *kobj)
 	complete(&root->kobj_unregister);
 }
 
-static struct sysfs_ops btrfs_super_attr_ops = {
+static const struct sysfs_ops btrfs_super_attr_ops = {
 	.show	= btrfs_super_attr_show,
 	.store	= btrfs_super_attr_store,
 };
 
-static struct sysfs_ops btrfs_root_attr_ops = {
+static const struct sysfs_ops btrfs_root_attr_ops = {
 	.show	= btrfs_root_attr_show,
 	.store	= btrfs_root_attr_store,
 };
diff --git a/fs/dlm/lockspace.c b/fs/dlm/lockspace.c
index 26a8bd4..f994a7d 100644
--- a/fs/dlm/lockspace.c
+++ b/fs/dlm/lockspace.c
@@ -148,7 +148,7 @@ static void lockspace_kobj_release(struct kobject *k)
 	kfree(ls);
 }
 
-static struct sysfs_ops dlm_attr_ops = {
+static const struct sysfs_ops dlm_attr_ops = {
 	.show  = dlm_attr_show,
 	.store = dlm_attr_store,
 };
diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 735c20d..af2eb20 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -2292,7 +2292,7 @@ static void ext4_sb_release(struct kobject *kobj)
 }
 
 
-static struct sysfs_ops ext4_attr_ops = {
+static const struct sysfs_ops ext4_attr_ops = {
 	.show	= ext4_attr_show,
 	.store	= ext4_attr_store,
 };
diff --git a/fs/gfs2/sys.c b/fs/gfs2/sys.c
index 9be733e..49410d8 100644
--- a/fs/gfs2/sys.c
+++ b/fs/gfs2/sys.c
@@ -49,7 +49,7 @@ static ssize_t gfs2_attr_store(struct kobject *kobj, struct attribute *attr,
 	return a->store ? a->store(sdp, buf, len) : len;
 }
 
-static struct sysfs_ops gfs2_attr_ops = {
+static const struct sysfs_ops gfs2_attr_ops = {
 	.show  = gfs2_attr_show,
 	.store = gfs2_attr_store,
 };
diff --git a/fs/ocfs2/cluster/masklog.c b/fs/ocfs2/cluster/masklog.c
index 1cd2934..880b5d2 100644
--- a/fs/ocfs2/cluster/masklog.c
+++ b/fs/ocfs2/cluster/masklog.c
@@ -135,7 +135,7 @@ static ssize_t mlog_store(struct kobject *obj, struct attribute *attr,
 	return mlog_mask_store(mlog_attr->mask, buf, count);
 }
 
-static struct sysfs_ops mlog_attr_ops = {
+static const struct sysfs_ops mlog_attr_ops = {
 	.show  = mlog_show,
 	.store = mlog_store,
 };
diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
index 50b725b..ced2299 100644
--- a/fs/sysfs/file.c
+++ b/fs/sysfs/file.c
@@ -53,7 +53,7 @@ struct sysfs_buffer {
 	size_t			count;
 	loff_t			pos;
 	char			* page;
-	struct sysfs_ops	* ops;
+	const struct sysfs_ops	* ops;
 	struct mutex		mutex;
 	int			needs_read_fill;
 	int			event;
@@ -75,7 +75,7 @@ static int fill_read_buffer(struct dentry * dentry, struct sysfs_buffer * buffer
 {
 	struct sysfs_dirent *attr_sd = dentry->d_fsdata;
 	struct kobject *kobj = attr_sd->s_parent->s_dir.kobj;
-	struct sysfs_ops * ops = buffer->ops;
+	const struct sysfs_ops * ops = buffer->ops;
 	int ret = 0;
 	ssize_t count;
 
@@ -199,7 +199,7 @@ flush_write_buffer(struct dentry * dentry, struct sysfs_buffer * buffer, size_t
 {
 	struct sysfs_dirent *attr_sd = dentry->d_fsdata;
 	struct kobject *kobj = attr_sd->s_parent->s_dir.kobj;
-	struct sysfs_ops * ops = buffer->ops;
+	const struct sysfs_ops * ops = buffer->ops;
 	int rc;
 
 	/* need attr_sd for attr and ops, its parent for kobj */
@@ -335,7 +335,7 @@ static int sysfs_open_file(struct inode *inode, struct file *file)
 	struct sysfs_dirent *attr_sd = file->f_path.dentry->d_fsdata;
 	struct kobject *kobj = attr_sd->s_parent->s_dir.kobj;
 	struct sysfs_buffer *buffer;
-	struct sysfs_ops *ops;
+	const struct sysfs_ops *ops;
 	int error = -EACCES;
 	char *p;
 
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index 57a1eaa..3950d3c 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -106,7 +106,7 @@ extern char *kobject_get_path(struct kobject *kobj, gfp_t flag);
 
 struct kobj_type {
 	void (*release)(struct kobject *kobj);
-	struct sysfs_ops *sysfs_ops;
+	const struct sysfs_ops *sysfs_ops;
 	struct attribute **default_attrs;
 };
 
@@ -132,7 +132,7 @@ struct kobj_attribute {
 			 const char *buf, size_t count);
 };
 
-extern struct sysfs_ops kobj_sysfs_ops;
+extern const struct sysfs_ops kobj_sysfs_ops;
 
 /**
  * struct kset - a set of kobjects of a specific type, belonging to a specific subsystem.
diff --git a/kernel/params.c b/kernel/params.c
index ac5de7d..4e27762 100644
--- a/kernel/params.c
+++ b/kernel/params.c
@@ -723,7 +723,7 @@ static ssize_t module_attr_store(struct kobject *kobj,
 	return ret;
 }
 
-static struct sysfs_ops module_sysfs_ops = {
+static const struct sysfs_ops module_sysfs_ops = {
 	.show = module_attr_show,
 	.store = module_attr_store,
 };
diff --git a/lib/kobject.c b/lib/kobject.c
index cecf5a0..8115eb1 100644
--- a/lib/kobject.c
+++ b/lib/kobject.c
@@ -700,7 +700,7 @@ static ssize_t kobj_attr_store(struct kobject *kobj, struct attribute *attr,
 	return ret;
 }
 
-struct sysfs_ops kobj_sysfs_ops = {
+const struct sysfs_ops kobj_sysfs_ops = {
 	.show	= kobj_attr_show,
 	.store	= kobj_attr_store,
 };
diff --git a/mm/slub.c b/mm/slub.c
index 02b5a83..b98a4f7 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -4519,7 +4519,7 @@ static void kmem_cache_release(struct kobject *kobj)
 	kfree(s);
 }
 
-static struct sysfs_ops slab_sysfs_ops = {
+static const struct sysfs_ops slab_sysfs_ops = {
 	.show = slab_attr_show,
 	.store = slab_attr_store,
 };
diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
index 2114e45..c53bdd9 100644
--- a/net/bridge/br_private.h
+++ b/net/bridge/br_private.h
@@ -254,7 +254,7 @@ extern void br_ifinfo_notify(int event, struct net_bridge_port *port);
 
 #ifdef CONFIG_SYSFS
 /* br_sysfs_if.c */
-extern struct sysfs_ops brport_sysfs_ops;
+extern const struct sysfs_ops brport_sysfs_ops;
 extern int br_sysfs_addif(struct net_bridge_port *p);
 
 /* br_sysfs_br.c */
diff --git a/net/bridge/br_sysfs_if.c b/net/bridge/br_sysfs_if.c
index 820643a..ce77fb3 100644
--- a/net/bridge/br_sysfs_if.c
+++ b/net/bridge/br_sysfs_if.c
@@ -220,7 +220,7 @@ static ssize_t brport_store(struct kobject * kobj,
 	return ret;
 }
 
-struct sysfs_ops brport_sysfs_ops = {
+const struct sysfs_ops brport_sysfs_ops = {
 	.show = brport_show,
 	.store = brport_store,
 };
diff --git a/samples/kobject/kset-example.c b/samples/kobject/kset-example.c
index 7c60881..3b126d1 100644
--- a/samples/kobject/kset-example.c
+++ b/samples/kobject/kset-example.c
@@ -87,7 +87,7 @@ static ssize_t foo_attr_store(struct kobject *kobj,
 }
 
 /* Our custom sysfs_ops that we will associate with our ktype later on */
-static struct sysfs_ops foo_sysfs_ops = {
+static const struct sysfs_ops foo_sysfs_ops = {
 	.show = foo_attr_show,
 	.store = foo_attr_store,
 };
-- 
1.7.0.1


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

* [PATCH 28/62] Driver core: make struct platform_driver.id_table const
  2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
                   ` (26 preceding siblings ...)
  2010-03-02 23:28 ` [PATCH 27/62] Driver core: Constify struct sysfs_ops in struct kobj_type Greg Kroah-Hartman
@ 2010-03-02 23:28 ` Greg Kroah-Hartman
  2010-03-02 23:28 ` [PATCH 29/62] platform-drivers: move probe to .devinit.text in arch/arm Greg Kroah-Hartman
                   ` (32 subsequent siblings)
  60 siblings, 0 replies; 90+ messages in thread
From: Greg Kroah-Hartman @ 2010-03-02 23:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: Uwe Kleine-König, Greg Kroah-Hartman

From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

This fixes a warning on several pxa based machines:

	arch/arm/mach-pxa/ssp.c:475: warning: initialization discards qualifiers from pointer target type

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Vikram Dhillon <dhillonv10@gmail.com>
Acked-by: Eric Miao <eric.y.miao@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/base/platform.c         |    2 +-
 include/linux/platform_device.h |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index 937d580..575e08b 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -636,7 +636,7 @@ static int platform_uevent(struct device *dev, struct kobj_uevent_env *env)
 }
 
 static const struct platform_device_id *platform_match_id(
-			struct platform_device_id *id,
+			const struct platform_device_id *id,
 			struct platform_device *pdev)
 {
 	while (id->name[0]) {
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
index 2c2d035..212da17 100644
--- a/include/linux/platform_device.h
+++ b/include/linux/platform_device.h
@@ -62,7 +62,7 @@ struct platform_driver {
 	int (*suspend)(struct platform_device *, pm_message_t state);
 	int (*resume)(struct platform_device *);
 	struct device_driver driver;
-	struct platform_device_id *id_table;
+	const struct platform_device_id *id_table;
 };
 
 extern int platform_driver_register(struct platform_driver *);
-- 
1.7.0.1


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

* [PATCH 29/62] platform-drivers: move probe to .devinit.text in arch/arm
  2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
                   ` (27 preceding siblings ...)
  2010-03-02 23:28 ` [PATCH 28/62] Driver core: make struct platform_driver.id_table const Greg Kroah-Hartman
@ 2010-03-02 23:28 ` Greg Kroah-Hartman
  2010-03-02 23:28 ` [PATCH 30/62] platform-drivers: move probe to .devinit.text in drivers/scsi Greg Kroah-Hartman
                   ` (31 subsequent siblings)
  60 siblings, 0 replies; 90+ messages in thread
From: Greg Kroah-Hartman @ 2010-03-02 23:28 UTC (permalink / raw)
  To: linux-kernel
  Cc: Uwe Kleine-König, Andrew Morton, Ben Dooks,
	Dmitry Baryshkov, Eric Miao, Liam Girdwood, Paul Sokolovsky,
	Richard Purdie, Russell King, Greg Kroah-Hartman

From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

A pointer to a probe callback is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Ben Dooks <ben-linux@fluff.org>
Cc: Dmitry Baryshkov <dbaryshkov@gmail.com>
Cc: Eric Miao <eric.miao@marvell.com>
Cc: Liam Girdwood <liam.girdwood@wolfsonmicro.com>
Cc: Paul Sokolovsky <pmiscml@gmail.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Acked-by: Arnaud Patard <arnaud.patard@rtp-net.org>
Acked-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Acked-by: Kristoffer Ericson <kristoffer.ericson@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 arch/arm/mach-pxa/corgi_ssp.c           |    2 +-
 arch/arm/mach-pxa/sharpsl_pm.c          |    2 +-
 arch/arm/mach-s3c2410/h1940-bluetooth.c |    2 +-
 arch/arm/mach-sa1100/jornada720_ssp.c   |    2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-pxa/corgi_ssp.c b/arch/arm/mach-pxa/corgi_ssp.c
index a5ee707..1d9bc11 100644
--- a/arch/arm/mach-pxa/corgi_ssp.c
+++ b/arch/arm/mach-pxa/corgi_ssp.c
@@ -204,7 +204,7 @@ void __init corgi_ssp_set_machinfo(struct corgissp_machinfo *machinfo)
 	ssp_machinfo = machinfo;
 }
 
-static int __init corgi_ssp_probe(struct platform_device *dev)
+static int __devinit corgi_ssp_probe(struct platform_device *dev)
 {
 	int ret;
 
diff --git a/arch/arm/mach-pxa/sharpsl_pm.c b/arch/arm/mach-pxa/sharpsl_pm.c
index 67229a1..463d874 100644
--- a/arch/arm/mach-pxa/sharpsl_pm.c
+++ b/arch/arm/mach-pxa/sharpsl_pm.c
@@ -900,7 +900,7 @@ static struct platform_suspend_ops sharpsl_pm_ops = {
 };
 #endif
 
-static int __init sharpsl_pm_probe(struct platform_device *pdev)
+static int __devinit sharpsl_pm_probe(struct platform_device *pdev)
 {
 	int ret;
 
diff --git a/arch/arm/mach-s3c2410/h1940-bluetooth.c b/arch/arm/mach-s3c2410/h1940-bluetooth.c
index b7d1f8d..a3f3c7b 100644
--- a/arch/arm/mach-s3c2410/h1940-bluetooth.c
+++ b/arch/arm/mach-s3c2410/h1940-bluetooth.c
@@ -56,7 +56,7 @@ static const struct rfkill_ops h1940bt_rfkill_ops = {
 	.set_block = h1940bt_set_block,
 };
 
-static int __init h1940bt_probe(struct platform_device *pdev)
+static int __devinit h1940bt_probe(struct platform_device *pdev)
 {
 	struct rfkill *rfk;
 	int ret = 0;
diff --git a/arch/arm/mach-sa1100/jornada720_ssp.c b/arch/arm/mach-sa1100/jornada720_ssp.c
index 506a5e5..9b6dee5 100644
--- a/arch/arm/mach-sa1100/jornada720_ssp.c
+++ b/arch/arm/mach-sa1100/jornada720_ssp.c
@@ -130,7 +130,7 @@ void jornada_ssp_end(void)
 };
 EXPORT_SYMBOL(jornada_ssp_end);
 
-static int __init jornada_ssp_probe(struct platform_device *dev)
+static int __devinit jornada_ssp_probe(struct platform_device *dev)
 {
 	int ret;
 
-- 
1.7.0.1


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

* [PATCH 30/62] platform-drivers: move probe to .devinit.text in drivers/scsi
  2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
                   ` (28 preceding siblings ...)
  2010-03-02 23:28 ` [PATCH 29/62] platform-drivers: move probe to .devinit.text in arch/arm Greg Kroah-Hartman
@ 2010-03-02 23:28 ` Greg Kroah-Hartman
  2010-03-02 23:28 ` [PATCH 32/62] x86: move hp-wmi's probe function to .devinit.text Greg Kroah-Hartman
                   ` (30 subsequent siblings)
  60 siblings, 0 replies; 90+ messages in thread
From: Greg Kroah-Hartman @ 2010-03-02 23:28 UTC (permalink / raw)
  To: linux-kernel
  Cc: Uwe Kleine-König, Andrew Morton, David Brownell,
	Dmitri Vorobiev, Henrik Kretzschmar, James Bottomley,
	Kay Sievers, peter fuerst, Thomas Bogendoerfer,
	Greg Kroah-Hartman

From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

A pointer to a probe callback is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: David Brownell <dbrownell@users.sourceforge.net>
Cc: Dmitri Vorobiev <dmitri.vorobiev@movial.fi>
Cc: Henrik Kretzschmar <henne@nachtwindheim.de>
Cc: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: peter fuerst <post@pfrst.de>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Acked-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/scsi/sgiwd93.c    |    2 +-
 drivers/scsi/sni_53c710.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/sgiwd93.c b/drivers/scsi/sgiwd93.c
index 0807b26..fef0e3c 100644
--- a/drivers/scsi/sgiwd93.c
+++ b/drivers/scsi/sgiwd93.c
@@ -226,7 +226,7 @@ static struct scsi_host_template sgiwd93_template = {
 	.use_clustering		= DISABLE_CLUSTERING,
 };
 
-static int __init sgiwd93_probe(struct platform_device *pdev)
+static int __devinit sgiwd93_probe(struct platform_device *pdev)
 {
 	struct sgiwd93_platform_data *pd = pdev->dev.platform_data;
 	unsigned char *wdregs = pd->wdregs;
diff --git a/drivers/scsi/sni_53c710.c b/drivers/scsi/sni_53c710.c
index 37b3359..56cf0bb 100644
--- a/drivers/scsi/sni_53c710.c
+++ b/drivers/scsi/sni_53c710.c
@@ -64,7 +64,7 @@ static struct scsi_host_template snirm710_template = {
 	.module		= THIS_MODULE,
 };
 
-static int __init snirm710_probe(struct platform_device *dev)
+static int __devinit snirm710_probe(struct platform_device *dev)
 {
 	unsigned long base;
 	struct NCR_700_Host_Parameters *hostdata;
-- 
1.7.0.1


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

* [PATCH 32/62] x86: move hp-wmi's probe function to .devinit.text
  2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
                   ` (29 preceding siblings ...)
  2010-03-02 23:28 ` [PATCH 30/62] platform-drivers: move probe to .devinit.text in drivers/scsi Greg Kroah-Hartman
@ 2010-03-02 23:28 ` Greg Kroah-Hartman
  2010-03-02 23:28 ` [PATCH 33/62] i2c: move i2c_omap's " Greg Kroah-Hartman
                   ` (29 subsequent siblings)
  60 siblings, 0 replies; 90+ messages in thread
From: Greg Kroah-Hartman @ 2010-03-02 23:28 UTC (permalink / raw)
  To: linux-kernel
  Cc: Uwe Kleine-König, Frans Pop, Larry Finger, Len Brown,
	Helge Deller, Andrew Morton, Greg Kroah-Hartman

From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

A pointer to hp_wmi_bios_setup is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Frans Pop <elendil@planet.nl>
Cc: Larry Finger <Larry.Finger@lwfinger.net>
Cc: Len Brown <lenb@kernel.org>
Cc: Helge Deller <deller@gmx.de>
Cc: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/platform/x86/hp-wmi.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/platform/x86/hp-wmi.c b/drivers/platform/x86/hp-wmi.c
index 3aa57da..7ccf33c 100644
--- a/drivers/platform/x86/hp-wmi.c
+++ b/drivers/platform/x86/hp-wmi.c
@@ -57,7 +57,7 @@ enum hp_wmi_radio {
 	HPWMI_WWAN = 2,
 };
 
-static int __init hp_wmi_bios_setup(struct platform_device *device);
+static int __devinit hp_wmi_bios_setup(struct platform_device *device);
 static int __exit hp_wmi_bios_remove(struct platform_device *device);
 static int hp_wmi_resume_handler(struct device *device);
 
@@ -447,7 +447,7 @@ static void cleanup_sysfs(struct platform_device *device)
 	device_remove_file(&device->dev, &dev_attr_tablet);
 }
 
-static int __init hp_wmi_bios_setup(struct platform_device *device)
+static int __devinit hp_wmi_bios_setup(struct platform_device *device)
 {
 	int err;
 	int wireless = hp_wmi_perform_query(HPWMI_WIRELESS_QUERY, 0, 0);
-- 
1.7.0.1


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

* [PATCH 33/62] i2c: move i2c_omap's probe function to .devinit.text
  2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
                   ` (30 preceding siblings ...)
  2010-03-02 23:28 ` [PATCH 32/62] x86: move hp-wmi's probe function to .devinit.text Greg Kroah-Hartman
@ 2010-03-02 23:28 ` Greg Kroah-Hartman
  2010-03-02 23:28 ` [PATCH 34/62] w1: move omap_hdq's " Greg Kroah-Hartman
                   ` (28 subsequent siblings)
  60 siblings, 0 replies; 90+ messages in thread
From: Greg Kroah-Hartman @ 2010-03-02 23:28 UTC (permalink / raw)
  To: linux-kernel
  Cc: Uwe Kleine-König, Kalle Jokiniemi, Tony Lindgren,
	Paul Walmsley, Richard Woodruff, chandra shekhar, Jason P Marini,
	Syed Mohammed Khasim, Jarkko Nikula, Juha Yrjola, Andrew Morton,
	Greg Kroah-Hartman

From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

A pointer to omap_i2c_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Kalle Jokiniemi <ext-kalle.jokiniemi@nokia.com>
Cc: Tony Lindgren <tony@atomide.com>
Cc: Paul Walmsley <paul@pwsan.com>
Cc: Richard Woodruff <r-woodruff2@ti.com>
Cc: chandra shekhar <x0044955@ti.com>
Cc: Jason P Marini <jason.marini@gmail.com>
Cc: Syed Mohammed Khasim  <x0khasim@ti.com>
Cc: Jarkko Nikula <jarkko.nikula@nokia.com>
Cc: Juha Yrjola <juha.yrjola@solidboot.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/i2c/busses/i2c-omap.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index 0037e31..bd86a85 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -849,7 +849,7 @@ static const struct i2c_algorithm omap_i2c_algo = {
 	.functionality	= omap_i2c_func,
 };
 
-static int __init
+static int __devinit
 omap_i2c_probe(struct platform_device *pdev)
 {
 	struct omap_i2c_dev	*dev;
-- 
1.7.0.1


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

* [PATCH 34/62] w1: move omap_hdq's probe function to .devinit.text
  2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
                   ` (31 preceding siblings ...)
  2010-03-02 23:28 ` [PATCH 33/62] i2c: move i2c_omap's " Greg Kroah-Hartman
@ 2010-03-02 23:28 ` Greg Kroah-Hartman
  2010-03-02 23:28 ` [PATCH 35/62] media: move omap24xxcam's " Greg Kroah-Hartman
                   ` (27 subsequent siblings)
  60 siblings, 0 replies; 90+ messages in thread
From: Greg Kroah-Hartman @ 2010-03-02 23:28 UTC (permalink / raw)
  To: linux-kernel
  Cc: Uwe Kleine-König, Stanley.Miao, Andrew Morton,
	Madhusudhan Chikkature, Felipe Balbi, Greg Kroah-Hartman

From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

A pointer to omap_hdq_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Stanley.Miao <stanley.miao@windriver.com>
Acked-by: Evgeniy Polyakov <zbr@ioremap.net>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Madhusudhan Chikkature <madhu.cr@ti.com>
Cc: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/w1/masters/omap_hdq.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/w1/masters/omap_hdq.c b/drivers/w1/masters/omap_hdq.c
index 0d92969..22977d3 100644
--- a/drivers/w1/masters/omap_hdq.c
+++ b/drivers/w1/masters/omap_hdq.c
@@ -72,7 +72,7 @@ struct hdq_data {
 	int			init_trans;
 };
 
-static int __init omap_hdq_probe(struct platform_device *pdev);
+static int __devinit omap_hdq_probe(struct platform_device *pdev);
 static int omap_hdq_remove(struct platform_device *pdev);
 
 static struct platform_driver omap_hdq_driver = {
@@ -558,7 +558,7 @@ static void omap_w1_write_byte(void *_hdq, u8 byte)
 	return;
 }
 
-static int __init omap_hdq_probe(struct platform_device *pdev)
+static int __devinit omap_hdq_probe(struct platform_device *pdev)
 {
 	struct hdq_data *hdq_data;
 	struct resource *res;
-- 
1.7.0.1


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

* [PATCH 35/62] media: move omap24xxcam's probe function to .devinit.text
  2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
                   ` (32 preceding siblings ...)
  2010-03-02 23:28 ` [PATCH 34/62] w1: move omap_hdq's " Greg Kroah-Hartman
@ 2010-03-02 23:28 ` Greg Kroah-Hartman
  2010-03-02 23:28 ` [PATCH 36/62] auxdisplay: move cfag12864bfb's " Greg Kroah-Hartman
                   ` (26 subsequent siblings)
  60 siblings, 0 replies; 90+ messages in thread
From: Greg Kroah-Hartman @ 2010-03-02 23:28 UTC (permalink / raw)
  To: linux-kernel
  Cc: Uwe Kleine-König, Hans Verkuil, Mauro Carvalho Chehab,
	Andrew Morton, Greg Kroah-Hartman

From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

A pointer to omap24xxcam_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
Acked-by: Trilok Soni <soni.trilok@gmail.com>
Cc: Hans Verkuil <hverkuil@xs4all.nl>
Cc: Mauro Carvalho Chehab <mchehab@redhat.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/media/video/omap24xxcam.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/media/video/omap24xxcam.c b/drivers/media/video/omap24xxcam.c
index 7400eac..142c327 100644
--- a/drivers/media/video/omap24xxcam.c
+++ b/drivers/media/video/omap24xxcam.c
@@ -1735,7 +1735,7 @@ static struct v4l2_int_device omap24xxcam = {
  *
  */
 
-static int __init omap24xxcam_probe(struct platform_device *pdev)
+static int __devinit omap24xxcam_probe(struct platform_device *pdev)
 {
 	struct omap24xxcam_device *cam;
 	struct resource *mem;
-- 
1.7.0.1


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

* [PATCH 36/62] auxdisplay: move cfag12864bfb's probe function to .devinit.text
  2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
                   ` (33 preceding siblings ...)
  2010-03-02 23:28 ` [PATCH 35/62] media: move omap24xxcam's " Greg Kroah-Hartman
@ 2010-03-02 23:28 ` Greg Kroah-Hartman
  2010-03-02 23:28 ` [PATCH 37/62] net: move am79c961's " Greg Kroah-Hartman
                   ` (25 subsequent siblings)
  60 siblings, 0 replies; 90+ messages in thread
From: Greg Kroah-Hartman @ 2010-03-02 23:28 UTC (permalink / raw)
  To: linux-kernel
  Cc: Uwe Kleine-König, Andrew Morton, Avuton Olrich,
	Antonino Daplas, Greg Kroah-Hartman

From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

A pointer to cfag12864bfb_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Avuton Olrich <avuton@gmail.com>
Cc: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/auxdisplay/cfag12864bfb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/auxdisplay/cfag12864bfb.c b/drivers/auxdisplay/cfag12864bfb.c
index fe3a865..b0ca5a4 100644
--- a/drivers/auxdisplay/cfag12864bfb.c
+++ b/drivers/auxdisplay/cfag12864bfb.c
@@ -81,7 +81,7 @@ static struct fb_ops cfag12864bfb_ops = {
 	.fb_mmap = cfag12864bfb_mmap,
 };
 
-static int __init cfag12864bfb_probe(struct platform_device *device)
+static int __devinit cfag12864bfb_probe(struct platform_device *device)
 {
 	int ret = -EINVAL;
  	struct fb_info *info = framebuffer_alloc(0, &device->dev);
-- 
1.7.0.1


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

* [PATCH 37/62] net: move am79c961's probe function to .devinit.text
  2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
                   ` (34 preceding siblings ...)
  2010-03-02 23:28 ` [PATCH 36/62] auxdisplay: move cfag12864bfb's " Greg Kroah-Hartman
@ 2010-03-02 23:28 ` Greg Kroah-Hartman
  2010-03-02 23:28 ` [PATCH 38/62] UIO: Add a driver for Hilscher netX-based fieldbus cards Greg Kroah-Hartman
                   ` (24 subsequent siblings)
  60 siblings, 0 replies; 90+ messages in thread
From: Greg Kroah-Hartman @ 2010-03-02 23:28 UTC (permalink / raw)
  To: linux-kernel
  Cc: Uwe Kleine-König, Roel Kluin, Russell King, netdev,
	Andrew Morton, Greg Kroah-Hartman

From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

A pointer to am79c961_probe is passed to the core via
platform_driver_register and so the function must not disappear when the
.init sections are discarded.  Otherwise (if also having HOTPLUG=y)
unbinding and binding a device to the driver via sysfs will result in an
oops as does a device being registered late.

An alternative to this patch is using platform_driver_probe instead of
platform_driver_register plus removing the pointer to the probe function
from the struct platform_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Cc: Roel Kluin <12o3l@tiscali.nl>
Cc: Russell King <rmk+kernel@arm.linux.org.uk>
Cc: <netdev@vger.kernel.org>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/net/arm/am79c961a.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/arm/am79c961a.c b/drivers/net/arm/am79c961a.c
index 164b37e..1c3c1f9 100644
--- a/drivers/net/arm/am79c961a.c
+++ b/drivers/net/arm/am79c961a.c
@@ -680,7 +680,7 @@ static const struct net_device_ops am79c961_netdev_ops = {
 #endif
 };
 
-static int __init am79c961_probe(struct platform_device *pdev)
+static int __devinit am79c961_probe(struct platform_device *pdev)
 {
 	struct resource *res;
 	struct net_device *dev;
-- 
1.7.0.1


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

* [PATCH 38/62] UIO: Add a driver for Hilscher netX-based fieldbus cards
  2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
                   ` (35 preceding siblings ...)
  2010-03-02 23:28 ` [PATCH 37/62] net: move am79c961's " Greg Kroah-Hartman
@ 2010-03-02 23:28 ` Greg Kroah-Hartman
  2010-03-02 23:28 ` [PATCH 39/62] UIO: minor Kconfig fixes Greg Kroah-Hartman
                   ` (23 subsequent siblings)
  60 siblings, 0 replies; 90+ messages in thread
From: Greg Kroah-Hartman @ 2010-03-02 23:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: Hans J. Koch, Greg Kroah-Hartman

From: Hans J. Koch <hjk@linutronix.de>

This patch adds a Userspace IO driver for netX-based fieldbus cards by
Hilscher (see http://www.hilscher.com). ATM, cifX and comX cards are
supported. The userspace part for this driver is provided by Hilscher
and should come with the card.
The driver is in use for several months now and has been tested by
people at Hilscher and Linutronix.

Signed-off-by: Hans J. Koch <hjk@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/uio/Kconfig    |   11 +++
 drivers/uio/Makefile   |    1 +
 drivers/uio/uio_netx.c |  172 ++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 184 insertions(+), 0 deletions(-)
 create mode 100644 drivers/uio/uio_netx.c

diff --git a/drivers/uio/Kconfig b/drivers/uio/Kconfig
index 8aa1955..069b144 100644
--- a/drivers/uio/Kconfig
+++ b/drivers/uio/Kconfig
@@ -94,4 +94,15 @@ config UIO_PCI_GENERIC
 	  primarily, for virtualization scenarios.
 	  If you compile this as a module, it will be called uio_pci_generic.
 
+config UIO_NETX
+	tristate "Hilscher NetX Card driver"
+	depends on PCI
+	help
+	  Driver for Hilscher NetX based fieldbus cards (cifX, comX).
+	  This driver requires a userspace component that comes with the card
+	  or is available from Hilscher (http://www.hilscher.com).
+
+	  To compile this driver as a module, choose M here; the module
+	  will be called uio_netx.
+
 endif
diff --git a/drivers/uio/Makefile b/drivers/uio/Makefile
index 73b2e75..aa7d033 100644
--- a/drivers/uio/Makefile
+++ b/drivers/uio/Makefile
@@ -6,3 +6,4 @@ obj-$(CONFIG_UIO_SMX)	+= uio_smx.o
 obj-$(CONFIG_UIO_AEC)	+= uio_aec.o
 obj-$(CONFIG_UIO_SERCOS3)	+= uio_sercos3.o
 obj-$(CONFIG_UIO_PCI_GENERIC)	+= uio_pci_generic.o
+obj-$(CONFIG_UIO_NETX)	+= uio_netx.o
diff --git a/drivers/uio/uio_netx.c b/drivers/uio/uio_netx.c
new file mode 100644
index 0000000..afbf0bd
--- /dev/null
+++ b/drivers/uio/uio_netx.c
@@ -0,0 +1,172 @@
+/*
+ * UIO driver for Hilscher NetX based fieldbus cards (cifX, comX).
+ * See http://www.hilscher.com for details.
+ *
+ * (C) 2007 Hans J. Koch <hjk@linutronix.de>
+ * (C) 2008 Manuel Traut <manut@linutronix.de>
+ *
+ * Licensed under GPL version 2 only.
+ *
+ */
+
+#include <linux/device.h>
+#include <linux/io.h>
+#include <linux/module.h>
+#include <linux/pci.h>
+#include <linux/uio_driver.h>
+
+#define PCI_VENDOR_ID_HILSCHER		0x15CF
+#define PCI_DEVICE_ID_HILSCHER_NETX	0x0000
+#define PCI_SUBDEVICE_ID_NXSB_PCA	0x3235
+#define PCI_SUBDEVICE_ID_NXPCA		0x3335
+
+#define DPM_HOST_INT_EN0	0xfff0
+#define DPM_HOST_INT_STAT0	0xffe0
+
+#define DPM_HOST_INT_MASK	0xe600ffff
+#define DPM_HOST_INT_GLOBAL_EN	0x80000000
+
+static irqreturn_t netx_handler(int irq, struct uio_info *dev_info)
+{
+	void __iomem *int_enable_reg = dev_info->mem[0].internal_addr
+					+ DPM_HOST_INT_EN0;
+	void __iomem *int_status_reg = dev_info->mem[0].internal_addr
+					+ DPM_HOST_INT_STAT0;
+
+	/* Is one of our interrupts enabled and active ? */
+	if (!(ioread32(int_enable_reg) & ioread32(int_status_reg)
+		& DPM_HOST_INT_MASK))
+		return IRQ_NONE;
+
+	/* Disable interrupt */
+	iowrite32(ioread32(int_enable_reg) & ~DPM_HOST_INT_GLOBAL_EN,
+		int_enable_reg);
+	return IRQ_HANDLED;
+}
+
+static int __devinit netx_pci_probe(struct pci_dev *dev,
+					const struct pci_device_id *id)
+{
+	struct uio_info *info;
+	int bar;
+
+	info = kzalloc(sizeof(struct uio_info), GFP_KERNEL);
+	if (!info)
+		return -ENOMEM;
+
+	if (pci_enable_device(dev))
+		goto out_free;
+
+	if (pci_request_regions(dev, "netx"))
+		goto out_disable;
+
+	switch (id->device) {
+	case PCI_DEVICE_ID_HILSCHER_NETX:
+		bar = 0;
+		info->name = "netx";
+		break;
+	default:
+		bar = 2;
+		info->name = "netx_plx";
+	}
+
+	/* BAR0 or 2 points to the card's dual port memory */
+	info->mem[0].addr = pci_resource_start(dev, bar);
+	if (!info->mem[0].addr)
+		goto out_release;
+	info->mem[0].internal_addr = ioremap(pci_resource_start(dev, bar),
+						pci_resource_len(dev, bar));
+
+	if (!info->mem[0].internal_addr)
+			goto out_release;
+
+	info->mem[0].size = pci_resource_len(dev, bar);
+	info->mem[0].memtype = UIO_MEM_PHYS;
+	info->irq = dev->irq;
+	info->irq_flags = IRQF_SHARED;
+	info->handler = netx_handler;
+	info->version = "0.0.1";
+
+	/* Make sure all interrupts are disabled */
+	iowrite32(0, info->mem[0].internal_addr + DPM_HOST_INT_EN0);
+
+	if (uio_register_device(&dev->dev, info))
+		goto out_unmap;
+
+	pci_set_drvdata(dev, info);
+	dev_info(&dev->dev, "Found %s card, registered UIO device.\n",
+				info->name);
+
+	return 0;
+
+out_unmap:
+	iounmap(info->mem[0].internal_addr);
+out_release:
+	pci_release_regions(dev);
+out_disable:
+	pci_disable_device(dev);
+out_free:
+	kfree(info);
+	return -ENODEV;
+}
+
+static void netx_pci_remove(struct pci_dev *dev)
+{
+	struct uio_info *info = pci_get_drvdata(dev);
+
+	/* Disable all interrupts */
+	iowrite32(0, info->mem[0].internal_addr + DPM_HOST_INT_EN0);
+	uio_unregister_device(info);
+	pci_release_regions(dev);
+	pci_disable_device(dev);
+	pci_set_drvdata(dev, NULL);
+	iounmap(info->mem[0].internal_addr);
+
+	kfree(info);
+}
+
+static struct pci_device_id netx_pci_ids[] = {
+	{
+		.vendor =	PCI_VENDOR_ID_HILSCHER,
+		.device =	PCI_DEVICE_ID_HILSCHER_NETX,
+		.subvendor =	0,
+		.subdevice =	0,
+	},
+	{
+		.vendor =	PCI_VENDOR_ID_PLX,
+		.device =	PCI_DEVICE_ID_PLX_9030,
+		.subvendor =	PCI_VENDOR_ID_PLX,
+		.subdevice =	PCI_SUBDEVICE_ID_NXSB_PCA,
+	},
+	{
+		.vendor =	PCI_VENDOR_ID_PLX,
+		.device =	PCI_DEVICE_ID_PLX_9030,
+		.subvendor =	PCI_VENDOR_ID_PLX,
+		.subdevice =	PCI_SUBDEVICE_ID_NXPCA,
+	},
+	{ 0, }
+};
+
+static struct pci_driver netx_pci_driver = {
+	.name = "netx",
+	.id_table = netx_pci_ids,
+	.probe = netx_pci_probe,
+	.remove = netx_pci_remove,
+};
+
+static int __init netx_init_module(void)
+{
+	return pci_register_driver(&netx_pci_driver);
+}
+
+static void __exit netx_exit_module(void)
+{
+	pci_unregister_driver(&netx_pci_driver);
+}
+
+module_init(netx_init_module);
+module_exit(netx_exit_module);
+
+MODULE_DEVICE_TABLE(pci, netx_pci_ids);
+MODULE_LICENSE("GPL v2");
+MODULE_AUTHOR("Hans J. Koch, Manuel Traut");
-- 
1.7.0.1


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

* [PATCH 39/62] UIO: minor Kconfig fixes
  2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
                   ` (36 preceding siblings ...)
  2010-03-02 23:28 ` [PATCH 38/62] UIO: Add a driver for Hilscher netX-based fieldbus cards Greg Kroah-Hartman
@ 2010-03-02 23:28 ` Greg Kroah-Hartman
  2010-03-02 23:28 ` [PATCH 40/62] UIO: Remove SMX Cryptengine driver Greg Kroah-Hartman
                   ` (22 subsequent siblings)
  60 siblings, 0 replies; 90+ messages in thread
From: Greg Kroah-Hartman @ 2010-03-02 23:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: John Ogness, Hans J. Koch, Greg Kroah-Hartman

From: John Ogness <john.ogness@linutronix.de>

Two trivial fixes for the Userspace IO Kconfig file:
1) uio_sercos3 is a PCI driver, so let it depend on PCI.
2) "default n" under UIO_PCI_GENERIC is luxury since it is already the default.

Acked-by: John Ogness <john.ogness@linutronix.de>
Signed-off-by: Hans J. Koch <hjk@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/uio/Kconfig |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/uio/Kconfig b/drivers/uio/Kconfig
index 069b144..6dd2a29 100644
--- a/drivers/uio/Kconfig
+++ b/drivers/uio/Kconfig
@@ -74,6 +74,7 @@ config UIO_AEC
 
 config UIO_SERCOS3
 	tristate "Automata Sercos III PCI card driver"
+	depends on PCI
 	help
 	  Userspace I/O interface for the Sercos III PCI card from
 	  Automata GmbH. The userspace part of this driver will be
@@ -87,7 +88,6 @@ config UIO_SERCOS3
 config UIO_PCI_GENERIC
 	tristate "Generic driver for PCI 2.3 and PCI Express cards"
 	depends on PCI
-	default n
 	help
 	  Generic driver that you can bind, dynamically, to any
 	  PCI 2.3 compliant and PCI Express card. It is useful,
-- 
1.7.0.1


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

* [PATCH 40/62] UIO: Remove SMX Cryptengine driver
  2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
                   ` (37 preceding siblings ...)
  2010-03-02 23:28 ` [PATCH 39/62] UIO: minor Kconfig fixes Greg Kroah-Hartman
@ 2010-03-02 23:28 ` Greg Kroah-Hartman
  2010-03-02 23:28 ` [PATCH 41/62] Driver core: Fix first line of kernel-doc for a few functions Greg Kroah-Hartman
                   ` (21 subsequent siblings)
  60 siblings, 0 replies; 90+ messages in thread
From: Greg Kroah-Hartman @ 2010-03-02 23:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: Hans J. Koch, Greg Kroah-Hartman

From: Hans J. Koch <hjk@linutronix.de>

Ben Nizette, the author of this driver, told me in a private mail that this
project has been cancelled. He suggested to remove the driver for now, and
will come back with a new version should the hardware really exist.
This patch completely removes the driver.

Signed-off-by: Hans J. Koch <hjk@linutronix.de>
Acked-by: Ben Nizette <bn@niasdigital.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/uio/Kconfig   |   11 ----
 drivers/uio/Makefile  |    1 -
 drivers/uio/uio_smx.c |  140 -------------------------------------------------
 3 files changed, 0 insertions(+), 152 deletions(-)
 delete mode 100644 drivers/uio/uio_smx.c

diff --git a/drivers/uio/Kconfig b/drivers/uio/Kconfig
index 6dd2a29..1da73ec 100644
--- a/drivers/uio/Kconfig
+++ b/drivers/uio/Kconfig
@@ -44,17 +44,6 @@ config UIO_PDRV_GENIRQ
 
 	  If you don't know what to do here, say N.
 
-config UIO_SMX
-	tristate "SMX cryptengine UIO interface"
-	help
-	  Userspace IO interface to the Cryptography engine found on the
-	  Nias Digital SMX boards.  These will be available from Q4 2008
-	  from http://www.niasdigital.com.  The userspace part of this
-	  driver will be released under the GPL at the same time as the
-	  hardware and will be able to be downloaded from the same site.
-
-	  If you compile this as a module, it will be called uio_smx.
-
 config UIO_AEC
 	tristate "AEC video timestamp device"
 	depends on PCI
diff --git a/drivers/uio/Makefile b/drivers/uio/Makefile
index aa7d033..18fd818 100644
--- a/drivers/uio/Makefile
+++ b/drivers/uio/Makefile
@@ -2,7 +2,6 @@ obj-$(CONFIG_UIO)	+= uio.o
 obj-$(CONFIG_UIO_CIF)	+= uio_cif.o
 obj-$(CONFIG_UIO_PDRV)	+= uio_pdrv.o
 obj-$(CONFIG_UIO_PDRV_GENIRQ)	+= uio_pdrv_genirq.o
-obj-$(CONFIG_UIO_SMX)	+= uio_smx.o
 obj-$(CONFIG_UIO_AEC)	+= uio_aec.o
 obj-$(CONFIG_UIO_SERCOS3)	+= uio_sercos3.o
 obj-$(CONFIG_UIO_PCI_GENERIC)	+= uio_pci_generic.o
diff --git a/drivers/uio/uio_smx.c b/drivers/uio/uio_smx.c
deleted file mode 100644
index 44054a6..0000000
--- a/drivers/uio/uio_smx.c
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * UIO SMX Cryptengine driver.
- *
- * (C) 2008 Nias Digital P/L <bn@niasdigital.com>
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 2 as
- * published by the Free Software Foundation.
- *
- */
-
-#include <linux/device.h>
-#include <linux/module.h>
-#include <linux/platform_device.h>
-#include <linux/uio_driver.h>
-#include <linux/io.h>
-
-#define DRV_NAME "smx-ce"
-#define DRV_VERSION "0.03"
-
-#define SMX_CSR  0x00000000
-#define SMX_EnD  0x00000001
-#define SMX_RUN  0x00000002
-#define SMX_DRDY 0x00000004
-#define SMX_ERR  0x00000008
-
-static irqreturn_t smx_handler(int irq, struct uio_info *dev_info)
-{
-	void __iomem *csr = dev_info->mem[0].internal_addr + SMX_CSR;
-
-	u32 status = ioread32(csr);
-
-	if (!(status & SMX_DRDY))
-		return IRQ_NONE;
-
-	/* Disable interrupt */
-	iowrite32(status & ~SMX_DRDY, csr);
-	return IRQ_HANDLED;
-}
-
-static int __devinit smx_ce_probe(struct platform_device *dev)
-{
-
-	int ret = -ENODEV;
-	struct uio_info *info;
-	struct resource *regs;
-
-	info = kzalloc(sizeof(struct uio_info), GFP_KERNEL);
-	if (!info)
-		return -ENOMEM;
-
-	regs = platform_get_resource(dev, IORESOURCE_MEM, 0);
-	if (!regs) {
-		dev_err(&dev->dev, "No memory resource specified\n");
-		goto out_free;
-	}
-
-	info->mem[0].addr = regs->start;
-	if (!info->mem[0].addr) {
-		dev_err(&dev->dev, "Invalid memory resource\n");
-		goto out_free;
-	}
-
-	info->mem[0].size = regs->end - regs->start + 1;
-	info->mem[0].internal_addr = ioremap(regs->start, info->mem[0].size);
-
-	if (!info->mem[0].internal_addr) {
-		dev_err(&dev->dev, "Can't remap memory address range\n");
-		goto out_free;
-	}
-
-	info->mem[0].memtype = UIO_MEM_PHYS;
-
-	info->name = "smx-ce";
-	info->version = "0.03";
-
-	info->irq = platform_get_irq(dev, 0);
-	if (info->irq < 0) {
-		ret = info->irq;
-		dev_err(&dev->dev, "No (or invalid) IRQ resource specified\n");
-		goto out_unmap;
-	}
-
-	info->irq_flags = IRQF_SHARED;
-	info->handler = smx_handler;
-
-	platform_set_drvdata(dev, info);
-
-	ret = uio_register_device(&dev->dev, info);
-
-	if (ret)
-		goto out_unmap;
-
-	return 0;
-
-out_unmap:
-	iounmap(info->mem[0].internal_addr);
-out_free:
-	kfree(info);
-
-	return ret;
-}
-
-static int __devexit smx_ce_remove(struct platform_device *dev)
-{
-	struct uio_info *info = platform_get_drvdata(dev);
-
-	uio_unregister_device(info);
-	platform_set_drvdata(dev, NULL);
-	iounmap(info->mem[0].internal_addr);
-
-	kfree(info);
-
-	return 0;
-}
-
-static struct platform_driver smx_ce_driver = {
-	.probe		= smx_ce_probe,
-	.remove		= __devexit_p(smx_ce_remove),
-	.driver		= {
-		.name	= DRV_NAME,
-		.owner	= THIS_MODULE,
-	},
-};
-
-static int __init smx_ce_init_module(void)
-{
-	return platform_driver_register(&smx_ce_driver);
-}
-module_init(smx_ce_init_module);
-
-static void __exit smx_ce_exit_module(void)
-{
-	platform_driver_unregister(&smx_ce_driver);
-}
-module_exit(smx_ce_exit_module);
-
-MODULE_LICENSE("GPL v2");
-MODULE_VERSION(DRV_VERSION);
-MODULE_AUTHOR("Ben Nizette <bn@niasdigital.com>");
-- 
1.7.0.1


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

* [PATCH 41/62] Driver core: Fix first line of kernel-doc for a few functions
  2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
                   ` (38 preceding siblings ...)
  2010-03-02 23:28 ` [PATCH 40/62] UIO: Remove SMX Cryptengine driver Greg Kroah-Hartman
@ 2010-03-02 23:28 ` Greg Kroah-Hartman
  2010-03-02 23:28 ` [PATCH 42/62] sysfs: Remove sysfs_get/put_active_two Greg Kroah-Hartman
                   ` (20 subsequent siblings)
  60 siblings, 0 replies; 90+ messages in thread
From: Greg Kroah-Hartman @ 2010-03-02 23:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ben Hutchings, Greg Kroah-Hartman

From: Ben Hutchings <ben@decadent.org.uk>

The function name must be followed by a space, hypen, space, and a
short description.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/base/firmware_class.c |    2 +-
 drivers/base/platform.c       |   16 ++++++++--------
 2 files changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c
index 0797748..d0dc26a 100644
--- a/drivers/base/firmware_class.c
+++ b/drivers/base/firmware_class.c
@@ -613,7 +613,7 @@ request_firmware_work_func(void *arg)
 }
 
 /**
- * request_firmware_nowait: asynchronous version of request_firmware
+ * request_firmware_nowait - asynchronous version of request_firmware
  * @module: module requesting the firmware
  * @uevent: sends uevent to copy the firmware image if this flag
  *	is non-zero else the firmware copy must be done manually.
diff --git a/drivers/base/platform.c b/drivers/base/platform.c
index 575e08b..1ba9d61 100644
--- a/drivers/base/platform.c
+++ b/drivers/base/platform.c
@@ -128,7 +128,7 @@ struct platform_object {
 };
 
 /**
- * platform_device_put
+ * platform_device_put - destroy a platform device
  * @pdev: platform device to free
  *
  * Free all memory associated with a platform device.  This function must
@@ -152,7 +152,7 @@ static void platform_device_release(struct device *dev)
 }
 
 /**
- * platform_device_alloc
+ * platform_device_alloc - create a platform device
  * @name: base name of the device we're adding
  * @id: instance id
  *
@@ -177,7 +177,7 @@ struct platform_device *platform_device_alloc(const char *name, int id)
 EXPORT_SYMBOL_GPL(platform_device_alloc);
 
 /**
- * platform_device_add_resources
+ * platform_device_add_resources - add resources to a platform device
  * @pdev: platform device allocated by platform_device_alloc to add resources to
  * @res: set of resources that needs to be allocated for the device
  * @num: number of resources
@@ -202,7 +202,7 @@ int platform_device_add_resources(struct platform_device *pdev,
 EXPORT_SYMBOL_GPL(platform_device_add_resources);
 
 /**
- * platform_device_add_data
+ * platform_device_add_data - add platform-specific data to a platform device
  * @pdev: platform device allocated by platform_device_alloc to add resources to
  * @data: platform specific data for this platform device
  * @size: size of platform specific data
@@ -344,7 +344,7 @@ void platform_device_unregister(struct platform_device *pdev)
 EXPORT_SYMBOL_GPL(platform_device_unregister);
 
 /**
- * platform_device_register_simple
+ * platform_device_register_simple - add a platform-level device and its resources
  * @name: base name of the device we're adding
  * @id: instance id
  * @res: set of resources that needs to be allocated for the device
@@ -396,7 +396,7 @@ error:
 EXPORT_SYMBOL_GPL(platform_device_register_simple);
 
 /**
- * platform_device_register_data
+ * platform_device_register_data - add a platform-level device with platform-specific data
  * @parent: parent device for the device we're adding
  * @name: base name of the device we're adding
  * @id: instance id
@@ -473,7 +473,7 @@ static void platform_drv_shutdown(struct device *_dev)
 }
 
 /**
- * platform_driver_register
+ * platform_driver_register - register a driver for platform-level devices
  * @drv: platform driver structure
  */
 int platform_driver_register(struct platform_driver *drv)
@@ -491,7 +491,7 @@ int platform_driver_register(struct platform_driver *drv)
 EXPORT_SYMBOL_GPL(platform_driver_register);
 
 /**
- * platform_driver_unregister
+ * platform_driver_unregister - unregister a driver for platform-level devices
  * @drv: platform driver structure
  */
 void platform_driver_unregister(struct platform_driver *drv)
-- 
1.7.0.1


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

* [PATCH 42/62] sysfs: Remove sysfs_get/put_active_two
  2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
                   ` (39 preceding siblings ...)
  2010-03-02 23:28 ` [PATCH 41/62] Driver core: Fix first line of kernel-doc for a few functions Greg Kroah-Hartman
@ 2010-03-02 23:28 ` Greg Kroah-Hartman
  2010-03-03  1:34   ` Tejun Heo
  2010-03-02 23:28 ` [PATCH 43/62] sysfs: Only take active references on attributes Greg Kroah-Hartman
                   ` (19 subsequent siblings)
  60 siblings, 1 reply; 90+ messages in thread
From: Greg Kroah-Hartman @ 2010-03-02 23:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: Eric W. Biederman, Tejun Heo, Greg Kroah-Hartman

From: Eric W. Biederman <ebiederm@xmission.com>

It turns out that holding an active reference on a directory is
pointless.  The purpose of the active references are to allows us to
block when removing sysfs entries that have custom methods so we don't
remove modules while running modular code and to keep those custom
methods from accessing data structures after the files have been
removed.  Further sysfs_remove_dir remove all elements in the
directory before removing the directory itself, so there is no chance
we will remove a directory with active children.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 fs/sysfs/bin.c   |   50 +++++++++++++++++++++++++-------------------------
 fs/sysfs/dir.c   |   43 ++-----------------------------------------
 fs/sysfs/file.c  |   18 +++++++++---------
 fs/sysfs/sysfs.h |    4 ++--
 4 files changed, 38 insertions(+), 77 deletions(-)

diff --git a/fs/sysfs/bin.c b/fs/sysfs/bin.c
index a0a500a..e9d2935 100644
--- a/fs/sysfs/bin.c
+++ b/fs/sysfs/bin.c
@@ -54,14 +54,14 @@ fill_read(struct dentry *dentry, char *buffer, loff_t off, size_t count)
 	int rc;
 
 	/* need attr_sd for attr, its parent for kobj */
-	if (!sysfs_get_active_two(attr_sd))
+	if (!sysfs_get_active(attr_sd))
 		return -ENODEV;
 
 	rc = -EIO;
 	if (attr->read)
 		rc = attr->read(kobj, attr, buffer, off, count);
 
-	sysfs_put_active_two(attr_sd);
+	sysfs_put_active(attr_sd);
 
 	return rc;
 }
@@ -125,14 +125,14 @@ flush_write(struct dentry *dentry, char *buffer, loff_t offset, size_t count)
 	int rc;
 
 	/* need attr_sd for attr, its parent for kobj */
-	if (!sysfs_get_active_two(attr_sd))
+	if (!sysfs_get_active(attr_sd))
 		return -ENODEV;
 
 	rc = -EIO;
 	if (attr->write)
 		rc = attr->write(kobj, attr, buffer, offset, count);
 
-	sysfs_put_active_two(attr_sd);
+	sysfs_put_active(attr_sd);
 
 	return rc;
 }
@@ -184,12 +184,12 @@ static void bin_vma_open(struct vm_area_struct *vma)
 	if (!bb->vm_ops || !bb->vm_ops->open)
 		return;
 
-	if (!sysfs_get_active_two(attr_sd))
+	if (!sysfs_get_active(attr_sd))
 		return;
 
 	bb->vm_ops->open(vma);
 
-	sysfs_put_active_two(attr_sd);
+	sysfs_put_active(attr_sd);
 }
 
 static void bin_vma_close(struct vm_area_struct *vma)
@@ -201,12 +201,12 @@ static void bin_vma_close(struct vm_area_struct *vma)
 	if (!bb->vm_ops || !bb->vm_ops->close)
 		return;
 
-	if (!sysfs_get_active_two(attr_sd))
+	if (!sysfs_get_active(attr_sd))
 		return;
 
 	bb->vm_ops->close(vma);
 
-	sysfs_put_active_two(attr_sd);
+	sysfs_put_active(attr_sd);
 }
 
 static int bin_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
@@ -219,12 +219,12 @@ static int bin_fault(struct vm_area_struct *vma, struct vm_fault *vmf)
 	if (!bb->vm_ops || !bb->vm_ops->fault)
 		return VM_FAULT_SIGBUS;
 
-	if (!sysfs_get_active_two(attr_sd))
+	if (!sysfs_get_active(attr_sd))
 		return VM_FAULT_SIGBUS;
 
 	ret = bb->vm_ops->fault(vma, vmf);
 
-	sysfs_put_active_two(attr_sd);
+	sysfs_put_active(attr_sd);
 	return ret;
 }
 
@@ -241,12 +241,12 @@ static int bin_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
 	if (!bb->vm_ops->page_mkwrite)
 		return 0;
 
-	if (!sysfs_get_active_two(attr_sd))
+	if (!sysfs_get_active(attr_sd))
 		return VM_FAULT_SIGBUS;
 
 	ret = bb->vm_ops->page_mkwrite(vma, vmf);
 
-	sysfs_put_active_two(attr_sd);
+	sysfs_put_active(attr_sd);
 	return ret;
 }
 
@@ -261,12 +261,12 @@ static int bin_access(struct vm_area_struct *vma, unsigned long addr,
 	if (!bb->vm_ops || !bb->vm_ops->access)
 		return -EINVAL;
 
-	if (!sysfs_get_active_two(attr_sd))
+	if (!sysfs_get_active(attr_sd))
 		return -EINVAL;
 
 	ret = bb->vm_ops->access(vma, addr, buf, len, write);
 
-	sysfs_put_active_two(attr_sd);
+	sysfs_put_active(attr_sd);
 	return ret;
 }
 
@@ -281,12 +281,12 @@ static int bin_set_policy(struct vm_area_struct *vma, struct mempolicy *new)
 	if (!bb->vm_ops || !bb->vm_ops->set_policy)
 		return 0;
 
-	if (!sysfs_get_active_two(attr_sd))
+	if (!sysfs_get_active(attr_sd))
 		return -EINVAL;
 
 	ret = bb->vm_ops->set_policy(vma, new);
 
-	sysfs_put_active_two(attr_sd);
+	sysfs_put_active(attr_sd);
 	return ret;
 }
 
@@ -301,12 +301,12 @@ static struct mempolicy *bin_get_policy(struct vm_area_struct *vma,
 	if (!bb->vm_ops || !bb->vm_ops->get_policy)
 		return vma->vm_policy;
 
-	if (!sysfs_get_active_two(attr_sd))
+	if (!sysfs_get_active(attr_sd))
 		return vma->vm_policy;
 
 	pol = bb->vm_ops->get_policy(vma, addr);
 
-	sysfs_put_active_two(attr_sd);
+	sysfs_put_active(attr_sd);
 	return pol;
 }
 
@@ -321,12 +321,12 @@ static int bin_migrate(struct vm_area_struct *vma, const nodemask_t *from,
 	if (!bb->vm_ops || !bb->vm_ops->migrate)
 		return 0;
 
-	if (!sysfs_get_active_two(attr_sd))
+	if (!sysfs_get_active(attr_sd))
 		return 0;
 
 	ret = bb->vm_ops->migrate(vma, from, to, flags);
 
-	sysfs_put_active_two(attr_sd);
+	sysfs_put_active(attr_sd);
 	return ret;
 }
 #endif
@@ -356,7 +356,7 @@ static int mmap(struct file *file, struct vm_area_struct *vma)
 
 	/* need attr_sd for attr, its parent for kobj */
 	rc = -ENODEV;
-	if (!sysfs_get_active_two(attr_sd))
+	if (!sysfs_get_active(attr_sd))
 		goto out_unlock;
 
 	rc = -EINVAL;
@@ -384,7 +384,7 @@ static int mmap(struct file *file, struct vm_area_struct *vma)
 	bb->vm_ops = vma->vm_ops;
 	vma->vm_ops = &bin_vm_ops;
 out_put:
-	sysfs_put_active_two(attr_sd);
+	sysfs_put_active(attr_sd);
 out_unlock:
 	mutex_unlock(&bb->mutex);
 
@@ -399,7 +399,7 @@ static int open(struct inode * inode, struct file * file)
 	int error;
 
 	/* binary file operations requires both @sd and its parent */
-	if (!sysfs_get_active_two(attr_sd))
+	if (!sysfs_get_active(attr_sd))
 		return -ENODEV;
 
 	error = -EACCES;
@@ -426,11 +426,11 @@ static int open(struct inode * inode, struct file * file)
 	mutex_unlock(&sysfs_bin_lock);
 
 	/* open succeeded, put active references */
-	sysfs_put_active_two(attr_sd);
+	sysfs_put_active(attr_sd);
 	return 0;
 
  err_out:
-	sysfs_put_active_two(attr_sd);
+	sysfs_put_active(attr_sd);
 	kfree(bb);
 	return error;
 }
diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c
index 5c4703d..1bdc42f 100644
--- a/fs/sysfs/dir.c
+++ b/fs/sysfs/dir.c
@@ -93,7 +93,7 @@ static void sysfs_unlink_sibling(struct sysfs_dirent *sd)
  *	RETURNS:
  *	Pointer to @sd on success, NULL on failure.
  */
-static struct sysfs_dirent *sysfs_get_active(struct sysfs_dirent *sd)
+struct sysfs_dirent *sysfs_get_active(struct sysfs_dirent *sd)
 {
 	if (unlikely(!sd))
 		return NULL;
@@ -124,7 +124,7 @@ static struct sysfs_dirent *sysfs_get_active(struct sysfs_dirent *sd)
  *	Put an active reference to @sd.  This function is noop if @sd
  *	is NULL.
  */
-static void sysfs_put_active(struct sysfs_dirent *sd)
+void sysfs_put_active(struct sysfs_dirent *sd)
 {
 	struct completion *cmpl;
 	int v;
@@ -145,45 +145,6 @@ static void sysfs_put_active(struct sysfs_dirent *sd)
 }
 
 /**
- *	sysfs_get_active_two - get active references to sysfs_dirent and parent
- *	@sd: sysfs_dirent of interest
- *
- *	Get active reference to @sd and its parent.  Parent's active
- *	reference is grabbed first.  This function is noop if @sd is
- *	NULL.
- *
- *	RETURNS:
- *	Pointer to @sd on success, NULL on failure.
- */
-struct sysfs_dirent *sysfs_get_active_two(struct sysfs_dirent *sd)
-{
-	if (sd) {
-		if (sd->s_parent && unlikely(!sysfs_get_active(sd->s_parent)))
-			return NULL;
-		if (unlikely(!sysfs_get_active(sd))) {
-			sysfs_put_active(sd->s_parent);
-			return NULL;
-		}
-	}
-	return sd;
-}
-
-/**
- *	sysfs_put_active_two - put active references to sysfs_dirent and parent
- *	@sd: sysfs_dirent of interest
- *
- *	Put active references to @sd and its parent.  This function is
- *	noop if @sd is NULL.
- */
-void sysfs_put_active_two(struct sysfs_dirent *sd)
-{
-	if (sd) {
-		sysfs_put_active(sd);
-		sysfs_put_active(sd->s_parent);
-	}
-}
-
-/**
  *	sysfs_deactivate - deactivate sysfs_dirent
  *	@sd: sysfs_dirent to deactivate
  *
diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
index ced2299..4096136 100644
--- a/fs/sysfs/file.c
+++ b/fs/sysfs/file.c
@@ -85,13 +85,13 @@ static int fill_read_buffer(struct dentry * dentry, struct sysfs_buffer * buffer
 		return -ENOMEM;
 
 	/* need attr_sd for attr and ops, its parent for kobj */
-	if (!sysfs_get_active_two(attr_sd))
+	if (!sysfs_get_active(attr_sd))
 		return -ENODEV;
 
 	buffer->event = atomic_read(&attr_sd->s_attr.open->event);
 	count = ops->show(kobj, attr_sd->s_attr.attr, buffer->page);
 
-	sysfs_put_active_two(attr_sd);
+	sysfs_put_active(attr_sd);
 
 	/*
 	 * The code works fine with PAGE_SIZE return but it's likely to
@@ -203,12 +203,12 @@ flush_write_buffer(struct dentry * dentry, struct sysfs_buffer * buffer, size_t
 	int rc;
 
 	/* need attr_sd for attr and ops, its parent for kobj */
-	if (!sysfs_get_active_two(attr_sd))
+	if (!sysfs_get_active(attr_sd))
 		return -ENODEV;
 
 	rc = ops->store(kobj, attr_sd->s_attr.attr, buffer->page, count);
 
-	sysfs_put_active_two(attr_sd);
+	sysfs_put_active(attr_sd);
 
 	return rc;
 }
@@ -344,7 +344,7 @@ static int sysfs_open_file(struct inode *inode, struct file *file)
 		memmove(last_sysfs_file, p, strlen(p) + 1);
 
 	/* need attr_sd for attr and ops, its parent for kobj */
-	if (!sysfs_get_active_two(attr_sd))
+	if (!sysfs_get_active(attr_sd))
 		return -ENODEV;
 
 	/* every kobject with an attribute needs a ktype assigned */
@@ -393,13 +393,13 @@ static int sysfs_open_file(struct inode *inode, struct file *file)
 		goto err_free;
 
 	/* open succeeded, put active references */
-	sysfs_put_active_two(attr_sd);
+	sysfs_put_active(attr_sd);
 	return 0;
 
  err_free:
 	kfree(buffer);
  err_out:
-	sysfs_put_active_two(attr_sd);
+	sysfs_put_active(attr_sd);
 	return error;
 }
 
@@ -437,12 +437,12 @@ static unsigned int sysfs_poll(struct file *filp, poll_table *wait)
 	struct sysfs_open_dirent *od = attr_sd->s_attr.open;
 
 	/* need parent for the kobj, grab both */
-	if (!sysfs_get_active_two(attr_sd))
+	if (!sysfs_get_active(attr_sd))
 		goto trigger;
 
 	poll_wait(filp, &od->poll, wait);
 
-	sysfs_put_active_two(attr_sd);
+	sysfs_put_active(attr_sd);
 
 	if (buffer->event != atomic_read(&od->event))
 		goto trigger;
diff --git a/fs/sysfs/sysfs.h b/fs/sysfs/sysfs.h
index cdd9377..bb7723c 100644
--- a/fs/sysfs/sysfs.h
+++ b/fs/sysfs/sysfs.h
@@ -124,8 +124,8 @@ extern const struct file_operations sysfs_dir_operations;
 extern const struct inode_operations sysfs_dir_inode_operations;
 
 struct dentry *sysfs_get_dentry(struct sysfs_dirent *sd);
-struct sysfs_dirent *sysfs_get_active_two(struct sysfs_dirent *sd);
-void sysfs_put_active_two(struct sysfs_dirent *sd);
+struct sysfs_dirent *sysfs_get_active(struct sysfs_dirent *sd);
+void sysfs_put_active(struct sysfs_dirent *sd);
 void sysfs_addrm_start(struct sysfs_addrm_cxt *acxt,
 		       struct sysfs_dirent *parent_sd);
 int __sysfs_add_one(struct sysfs_addrm_cxt *acxt, struct sysfs_dirent *sd);
-- 
1.7.0.1


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

* [PATCH 43/62] sysfs: Only take active references on attributes.
  2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
                   ` (40 preceding siblings ...)
  2010-03-02 23:28 ` [PATCH 42/62] sysfs: Remove sysfs_get/put_active_two Greg Kroah-Hartman
@ 2010-03-02 23:28 ` Greg Kroah-Hartman
  2010-03-03  1:36   ` Tejun Heo
  2010-03-02 23:28 ` [PATCH 44/62] sysfs: Use one lockdep class per sysfs attribute Greg Kroah-Hartman
                   ` (18 subsequent siblings)
  60 siblings, 1 reply; 90+ messages in thread
From: Greg Kroah-Hartman @ 2010-03-02 23:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: Eric W. Biederman, Tejun Heo, Greg Kroah-Hartman

From: Eric W. Biederman <ebiederm@xmission.com>

If we exclude directories and symlinks from the set of sysfs
dirents where we need active references we are left with
sysfs attributes (binary or not).

- Tweak sysfs_deactivate to only do something on attributes
- Move lockdep initialization into sysfs_file_add_mode to
  limit it to just attributes.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Acked-by: WANG Cong <xiyou.wangcong@gmail.com>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 fs/sysfs/dir.c   |    5 ++++-
 fs/sysfs/file.c  |    1 +
 fs/sysfs/sysfs.h |    1 +
 3 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c
index 1bdc42f..481fdec 100644
--- a/fs/sysfs/dir.c
+++ b/fs/sysfs/dir.c
@@ -156,6 +156,10 @@ static void sysfs_deactivate(struct sysfs_dirent *sd)
 	int v;
 
 	BUG_ON(sd->s_sibling || !(sd->s_flags & SYSFS_FLAG_REMOVED));
+
+	if (!(sysfs_type(sd) & SYSFS_ACTIVE_REF))
+		return;
+
 	sd->s_sibling = (void *)&wait;
 
 	rwsem_acquire(&sd->dep_map, 0, 0, _RET_IP_);
@@ -315,7 +319,6 @@ struct sysfs_dirent *sysfs_new_dirent(const char *name, umode_t mode, int type)
 
 	atomic_set(&sd->s_count, 1);
 	atomic_set(&sd->s_active, 0);
-	sysfs_dirent_init_lockdep(sd);
 
 	sd->s_name = name;
 	sd->s_mode = mode;
diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
index 4096136..e222b25 100644
--- a/fs/sysfs/file.c
+++ b/fs/sysfs/file.c
@@ -509,6 +509,7 @@ int sysfs_add_file_mode(struct sysfs_dirent *dir_sd,
 	if (!sd)
 		return -ENOMEM;
 	sd->s_attr.attr = (void *)attr;
+	sysfs_dirent_init_lockdep(sd);
 
 	sysfs_addrm_start(&acxt, dir_sd);
 	rc = sysfs_add_one(&acxt, sd);
diff --git a/fs/sysfs/sysfs.h b/fs/sysfs/sysfs.h
index bb7723c..7db6884 100644
--- a/fs/sysfs/sysfs.h
+++ b/fs/sysfs/sysfs.h
@@ -79,6 +79,7 @@ struct sysfs_dirent {
 #define SYSFS_KOBJ_BIN_ATTR		0x0004
 #define SYSFS_KOBJ_LINK			0x0008
 #define SYSFS_COPY_NAME			(SYSFS_DIR | SYSFS_KOBJ_LINK)
+#define SYSFS_ACTIVE_REF		(SYSFS_KOBJ_ATTR | SYSFS_KOBJ_BIN_ATTR)
 
 #define SYSFS_FLAG_MASK			~SYSFS_TYPE_MASK
 #define SYSFS_FLAG_REMOVED		0x0200
-- 
1.7.0.1


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

* [PATCH 44/62] sysfs: Use one lockdep class per sysfs attribute.
  2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
                   ` (41 preceding siblings ...)
  2010-03-02 23:28 ` [PATCH 43/62] sysfs: Only take active references on attributes Greg Kroah-Hartman
@ 2010-03-02 23:28 ` Greg Kroah-Hartman
  2010-03-03  1:41   ` Tejun Heo
  2010-03-02 23:28 ` [PATCH 45/62] sysfs: Use sysfs_attr_init and sysfs_bin_attr_init on dynamic attributes Greg Kroah-Hartman
                   ` (17 subsequent siblings)
  60 siblings, 1 reply; 90+ messages in thread
From: Greg Kroah-Hartman @ 2010-03-02 23:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: Eric W. Biederman, Tejun Heo, Greg Kroah-Hartman

From: Eric W. Biederman <ebiederm@xmission.com>

Acknowledge that the logical sysfs rwsem has one instance per
sysfs attribute with different locking depencencies for different
attributes.

There is a sysfs idiom where writing to one sysfs file causes the
addition or removal of other sysfs files.   Lumping all of the
sysfs attributes together in one lock class causes lockdep to
generate lots of false positives.

This introduces the requirement that non-static sysfs attributes
need to be initialized with sysfs_attr_init or sysfs_bin_attr_init.
Strictly speaking this requirement only exists when lockdep is
enabled, and when lockdep is enabled we get a bit fat warning
if this requirement is not met.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Acked-by: WANG Cong <xiyou.wangcong@gmail.com>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 fs/sysfs/sysfs.h      |    7 +++++--
 include/linux/sysfs.h |   18 ++++++++++++++++++
 2 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/fs/sysfs/sysfs.h b/fs/sysfs/sysfs.h
index 7db6884..37e0e08 100644
--- a/fs/sysfs/sysfs.h
+++ b/fs/sysfs/sysfs.h
@@ -92,9 +92,12 @@ static inline unsigned int sysfs_type(struct sysfs_dirent *sd)
 #ifdef CONFIG_DEBUG_LOCK_ALLOC
 #define sysfs_dirent_init_lockdep(sd)				\
 do {								\
-	static struct lock_class_key __key;			\
+	struct attribute *attr = sd->s_attr.attr;		\
+	struct lock_class_key *key = attr->key;			\
+	if (!key)						\
+		key = &attr->skey;				\
 								\
-	lockdep_init_map(&sd->dep_map, "s_active", &__key, 0);	\
+	lockdep_init_map(&sd->dep_map, "s_active", key, 0);	\
 } while(0)
 #else
 #define sysfs_dirent_init_lockdep(sd) do {} while(0)
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
index 3e85265..006c359 100644
--- a/include/linux/sysfs.h
+++ b/include/linux/sysfs.h
@@ -15,6 +15,7 @@
 #include <linux/compiler.h>
 #include <linux/errno.h>
 #include <linux/list.h>
+#include <linux/lockdep.h>
 #include <asm/atomic.h>
 
 struct kobject;
@@ -29,8 +30,23 @@ struct attribute {
 	const char		*name;
 	struct module		*owner;
 	mode_t			mode;
+#ifdef CONFIG_DEBUG_LOCK_ALLOC
+	struct lock_class_key	*key;
+	struct lock_class_key	skey;
+#endif
 };
 
+#ifdef CONFIG_DEBUG_LOCK_ALLOC
+#define sysfs_attr_init(attr)				\
+do {							\
+	static struct lock_class_key __key;		\
+							\
+	(attr)->key = &__key;				\
+} while(0)
+#else
+#define sysfs_attr_init(attr) do {} while(0)
+#endif
+
 struct attribute_group {
 	const char		*name;
 	mode_t			(*is_visible)(struct kobject *,
@@ -74,6 +90,8 @@ struct bin_attribute {
 		    struct vm_area_struct *vma);
 };
 
+#define sysfs_bin_attr_init(bin_attr) sysfs_attr_init(&bin_attr->attr)
+
 struct sysfs_ops {
 	ssize_t	(*show)(struct kobject *, struct attribute *,char *);
 	ssize_t	(*store)(struct kobject *,struct attribute *,const char *, size_t);
-- 
1.7.0.1


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

* [PATCH 45/62] sysfs: Use sysfs_attr_init and sysfs_bin_attr_init on dynamic attributes
  2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
                   ` (42 preceding siblings ...)
  2010-03-02 23:28 ` [PATCH 44/62] sysfs: Use one lockdep class per sysfs attribute Greg Kroah-Hartman
@ 2010-03-02 23:28 ` Greg Kroah-Hartman
  2010-03-03  1:41   ` Tejun Heo
  2010-03-02 23:28 ` [PATCH 46/62] sysfs: Document sysfs_attr_init and sysfs_bin_attr_init Greg Kroah-Hartman
                   ` (16 subsequent siblings)
  60 siblings, 1 reply; 90+ messages in thread
From: Greg Kroah-Hartman @ 2010-03-02 23:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: Eric W. Biederman, Tejun Heo, Greg Kroah-Hartman

From: Eric W. Biederman <ebiederm@xmission.com>

These are the non-static sysfs attributes that exist on
my test machine.  Fix them to use sysfs_attr_init or
sysfs_bin_attr_init as appropriate.   It simply requires
making a sysfs attribute present to see this.  So this
is a little bit tedious but otherwise not too bad.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Acked-by: WANG Cong <xiyou.wangcong@gmail.com>
Cc: Tejun Heo <tj@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 arch/x86/kernel/cpu/mcheck/mce.c |    1 +
 drivers/acpi/system.c            |    2 ++
 drivers/pci/pci-sysfs.c          |    5 +++++
 kernel/params.c                  |    1 +
 4 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c
index a8aacd4..28cba46 100644
--- a/arch/x86/kernel/cpu/mcheck/mce.c
+++ b/arch/x86/kernel/cpu/mcheck/mce.c
@@ -2044,6 +2044,7 @@ static __init void mce_init_banks(void)
 		struct mce_bank *b = &mce_banks[i];
 		struct sysdev_attribute *a = &b->attr;
 
+		sysfs_attr_init(&a->attr);
 		a->attr.name	= b->attrname;
 		snprintf(b->attrname, ATTR_LEN, "bank%d", i);
 
diff --git a/drivers/acpi/system.c b/drivers/acpi/system.c
index a206a12..743f244 100644
--- a/drivers/acpi/system.c
+++ b/drivers/acpi/system.c
@@ -101,6 +101,7 @@ static void acpi_table_attr_init(struct acpi_table_attr *table_attr,
 	struct acpi_table_header *header = NULL;
 	struct acpi_table_attr *attr = NULL;
 
+	sysfs_attr_init(&table_attr->attr.attr);
 	if (table_header->signature[0] != '\0')
 		memcpy(table_attr->name, table_header->signature,
 			ACPI_NAME_SIZE);
@@ -475,6 +476,7 @@ void acpi_irq_stats_init(void)
 			goto fail;
 		strncpy(name, buffer, strlen(buffer) + 1);
 
+		sysfs_attr_init(&counter_attrs[i].attr);
 		counter_attrs[i].attr.name = name;
 		counter_attrs[i].attr.mode = 0644;
 		counter_attrs[i].show = counter_show;
diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
index 807224e..9fa183c 100644
--- a/drivers/pci/pci-sysfs.c
+++ b/drivers/pci/pci-sysfs.c
@@ -642,6 +642,7 @@ void pci_create_legacy_files(struct pci_bus *b)
 	if (!b->legacy_io)
 		goto kzalloc_err;
 
+	sysfs_bin_attr_init(&b->legacy_io);
 	b->legacy_io->attr.name = "legacy_io";
 	b->legacy_io->size = 0xffff;
 	b->legacy_io->attr.mode = S_IRUSR | S_IWUSR;
@@ -654,6 +655,7 @@ void pci_create_legacy_files(struct pci_bus *b)
 		goto legacy_io_err;
 
 	/* Allocated above after the legacy_io struct */
+	sysfs_bin_attr_init(&b->legacy_mem);
 	b->legacy_mem = b->legacy_io + 1;
 	b->legacy_mem->attr.name = "legacy_mem";
 	b->legacy_mem->size = 1024*1024;
@@ -800,6 +802,7 @@ static int pci_create_attr(struct pci_dev *pdev, int num, int write_combine)
 	if (res_attr) {
 		char *res_attr_name = (char *)(res_attr + 1);
 
+		sysfs_bin_attr_init(res_attr);
 		if (write_combine) {
 			pdev->res_attr_wc[num] = res_attr;
 			sprintf(res_attr_name, "resource%d_wc", num);
@@ -972,6 +975,7 @@ static int pci_create_capabilities_sysfs(struct pci_dev *dev)
 		if (!attr)
 			return -ENOMEM;
 
+		sysfs_bin_attr_init(attr);
 		attr->size = dev->vpd->len;
 		attr->attr.name = "vpd";
 		attr->attr.mode = S_IRUSR | S_IWUSR;
@@ -1038,6 +1042,7 @@ int __must_check pci_create_sysfs_dev_files (struct pci_dev *pdev)
 			retval = -ENOMEM;
 			goto err_resource_files;
 		}
+		sysfs_bin_attr_init(attr);
 		attr->size = rom_size;
 		attr->attr.name = "rom";
 		attr->attr.mode = S_IRUSR;
diff --git a/kernel/params.c b/kernel/params.c
index 4e27762..a60ebed 100644
--- a/kernel/params.c
+++ b/kernel/params.c
@@ -517,6 +517,7 @@ static __modinit int add_sysfs_param(struct module_kobject *mk,
 	new->grp.attrs = attrs;
 
 	/* Tack new one on the end. */
+	sysfs_attr_init(&new->attrs[num].mattr.attr);
 	new->attrs[num].param = kp;
 	new->attrs[num].mattr.show = param_attr_show;
 	new->attrs[num].mattr.store = param_attr_store;
-- 
1.7.0.1


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

* [PATCH 46/62] sysfs: Document sysfs_attr_init and sysfs_bin_attr_init
  2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
                   ` (43 preceding siblings ...)
  2010-03-02 23:28 ` [PATCH 45/62] sysfs: Use sysfs_attr_init and sysfs_bin_attr_init on dynamic attributes Greg Kroah-Hartman
@ 2010-03-02 23:28 ` Greg Kroah-Hartman
  2010-03-02 23:28 ` [PATCH 47/62] sysfs: Use sysfs_attr_init and sysfs_bin_attr_init on module dynamic attributes Greg Kroah-Hartman
                   ` (15 subsequent siblings)
  60 siblings, 0 replies; 90+ messages in thread
From: Greg Kroah-Hartman @ 2010-03-02 23:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: Eric W. Biederman, Greg Kroah-Hartman

From: Eric W. Biederman <ebiederm@xmission.com>

I have added a new requirement to the external sysfs interface
that dynamically allocated sysfs attributes must call sysfs_attr_init
if lockdep is enabled.  For the time being callying sysfs_attr_init
is only mandatory if lockdep is enabled, so we can live with a few
unconverted instances until we find them all.  As this is part of
the public interface of sysfs it is a good idea to document these
pseudo functions so someone inspeciting the code can find out
what has happened.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 include/linux/sysfs.h |   20 ++++++++++++++++++++
 1 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
index 006c359..5b8f80f 100644
--- a/include/linux/sysfs.h
+++ b/include/linux/sysfs.h
@@ -36,6 +36,16 @@ struct attribute {
 #endif
 };
 
+/**
+ *	sysfs_attr_init - initialize a dynamically allocated sysfs attribute
+ *	@attr: struct attribute to initialize
+ *
+ *	Initialize a dynamically allocated struct attribute so we can
+ *	make lockdep happy.  This is a new requirement for attributes
+ *	and initially this is only needed when lockdep is enabled.
+ *	Lockdep gives a nice error when your attribute is added to
+ *	sysfs if you don't have this.
+ */
 #ifdef CONFIG_DEBUG_LOCK_ALLOC
 #define sysfs_attr_init(attr)				\
 do {							\
@@ -90,6 +100,16 @@ struct bin_attribute {
 		    struct vm_area_struct *vma);
 };
 
+/**
+ *	sysfs_bin_attr_init - initialize a dynamically allocated bin_attribute
+ *	@attr: struct bin_attribute to initialize
+ *
+ *	Initialize a dynamically allocated struct bin_attribute so we
+ *	can make lockdep happy.  This is a new requirement for
+ *	attributes and initially this is only needed when lockdep is
+ *	enabled.  Lockdep gives a nice error when your attribute is
+ *	added to sysfs if you don't have this.
+ */
 #define sysfs_bin_attr_init(bin_attr) sysfs_attr_init(&bin_attr->attr)
 
 struct sysfs_ops {
-- 
1.7.0.1


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

* [PATCH 47/62] sysfs: Use sysfs_attr_init and sysfs_bin_attr_init on module dynamic attributes
  2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
                   ` (44 preceding siblings ...)
  2010-03-02 23:28 ` [PATCH 46/62] sysfs: Document sysfs_attr_init and sysfs_bin_attr_init Greg Kroah-Hartman
@ 2010-03-02 23:28 ` Greg Kroah-Hartman
  2010-03-02 23:28 ` [PATCH 48/62] sysfs: windfarm: init sysfs attributes Greg Kroah-Hartman
                   ` (14 subsequent siblings)
  60 siblings, 0 replies; 90+ messages in thread
From: Greg Kroah-Hartman @ 2010-03-02 23:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: Eric W. Biederman, Greg Kroah-Hartman

From: Eric W. Biederman <ebiederm@xmission.com>

A little more whack-a-mole annotating the dynamic sysfs attributes.  I
had everything built into my earlier test kernel, and so I missed
these.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 kernel/module.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/kernel/module.c b/kernel/module.c
index f82386b..5ec6b47 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -1083,6 +1083,7 @@ static void add_sect_attrs(struct module *mod, unsigned int nsect,
 		if (sattr->name == NULL)
 			goto out;
 		sect_attrs->nsections++;
+		sysfs_attr_init(&sattr->mattr.attr);
 		sattr->mattr.show = module_sect_show;
 		sattr->mattr.store = NULL;
 		sattr->mattr.attr.name = sattr->name;
@@ -1178,6 +1179,7 @@ static void add_notes_attrs(struct module *mod, unsigned int nsect,
 		if (sect_empty(&sechdrs[i]))
 			continue;
 		if (sechdrs[i].sh_type == SHT_NOTE) {
+			sysfs_bin_attr_init(nattr);
 			nattr->attr.name = mod->sect_attrs->attrs[loaded].name;
 			nattr->attr.mode = S_IRUGO;
 			nattr->size = sechdrs[i].sh_size;
@@ -1250,6 +1252,7 @@ int module_add_modinfo_attrs(struct module *mod)
 		if (!attr->test ||
 		    (attr->test && attr->test(mod))) {
 			memcpy(temp_attr, attr, sizeof(*temp_attr));
+			sysfs_attr_init(&temp_attr->attr);
 			error = sysfs_create_file(&mod->mkobj.kobj,&temp_attr->attr);
 			++temp_attr;
 		}
-- 
1.7.0.1


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

* [PATCH 48/62] sysfs: windfarm: init sysfs attributes
  2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
                   ` (45 preceding siblings ...)
  2010-03-02 23:28 ` [PATCH 47/62] sysfs: Use sysfs_attr_init and sysfs_bin_attr_init on module dynamic attributes Greg Kroah-Hartman
@ 2010-03-02 23:28 ` Greg Kroah-Hartman
  2010-03-02 23:28 ` [PATCH 49/62] sysfs: Serialize updates to the vfs inode Greg Kroah-Hartman
                   ` (13 subsequent siblings)
  60 siblings, 0 replies; 90+ messages in thread
From: Greg Kroah-Hartman @ 2010-03-02 23:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: Johannes Berg, Greg Kroah-Hartman

From: Johannes Berg <johannes@sipsolutions.net>

This is required for lockdep.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/macintosh/windfarm_core.c         |    1 +
 drivers/macintosh/windfarm_smu_controls.c |    1 +
 2 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/macintosh/windfarm_core.c b/drivers/macintosh/windfarm_core.c
index 437f55c..419795f 100644
--- a/drivers/macintosh/windfarm_core.c
+++ b/drivers/macintosh/windfarm_core.c
@@ -321,6 +321,7 @@ int wf_register_sensor(struct wf_sensor *new_sr)
 	kref_init(&new_sr->ref);
 	list_add(&new_sr->link, &wf_sensors);
 
+	sysfs_attr_init(&new_sr->attr.attr);
 	new_sr->attr.attr.name = new_sr->name;
 	new_sr->attr.attr.mode = 0444;
 	new_sr->attr.show = wf_show_sensor;
diff --git a/drivers/macintosh/windfarm_smu_controls.c b/drivers/macintosh/windfarm_smu_controls.c
index 6c68b9e..43137b4 100644
--- a/drivers/macintosh/windfarm_smu_controls.c
+++ b/drivers/macintosh/windfarm_smu_controls.c
@@ -173,6 +173,7 @@ static struct smu_fan_control *smu_fan_create(struct device_node *node,
 
 	fct->fan_type = pwm_fan;
 	fct->ctrl.type = pwm_fan ? WF_CONTROL_PWM_FAN : WF_CONTROL_RPM_FAN;
+	sysfs_attr_init(&fct->ctrl.attr.attr);
 
 	/* We use the name & location here the same way we do for SMU sensors,
 	 * see the comment in windfarm_smu_sensors.c. The locations are a bit
-- 
1.7.0.1


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

* [PATCH 49/62] sysfs: Serialize updates to the vfs inode
  2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
                   ` (46 preceding siblings ...)
  2010-03-02 23:28 ` [PATCH 48/62] sysfs: windfarm: init sysfs attributes Greg Kroah-Hartman
@ 2010-03-02 23:28 ` Greg Kroah-Hartman
  2010-03-02 23:28 ` [PATCH 50/62] sysfs: Pack sysfs_dirent more tightly Greg Kroah-Hartman
                   ` (12 subsequent siblings)
  60 siblings, 0 replies; 90+ messages in thread
From: Greg Kroah-Hartman @ 2010-03-02 23:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: Eric W. Biederman, Greg Kroah-Hartman

From: Eric W. Biederman <ebiederm@aristanetworks.com>

The vfs depends upon filesystem methods to update the
vfs inode.   Sysfs adds to the normal number of places
where the vfs inode is updated by also updatng the
vfs inode in sysfs_refresh_inode.

Typically the inode mutex is used to serialize updates
to the vfs inode, but grabbing the inode mutex in
sysfs_permission and sysfs_getattr causes deadlocks,
because sometimes the vfs calls those operations with
the inode mutex held.  Therefore sysfs  can not use the
inode mutex to serial updates to the vfs inode.

The sysfs_mutex is acquired in all of the routines
where sysfs updates the vfs inode, and with a small
change we can consistently protext sysfs vfs inode
updates with the sysfs_mutex. To protect the sysfs
vfs inode updates with the sysfs_mutex simply requires
extending the scope of sysfs_mutex in sysfs_setattr
over inode_setattr, and over inode_change_ok (so we
have an unchanging inode when we perform the check).

Acked-by: Serge Hallyn <serue@us.ibm.com>
Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 fs/sysfs/inode.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/fs/sysfs/inode.c b/fs/sysfs/inode.c
index 6a06a1d..0d09f6c 100644
--- a/fs/sysfs/inode.c
+++ b/fs/sysfs/inode.c
@@ -111,20 +111,20 @@ int sysfs_setattr(struct dentry *dentry, struct iattr *iattr)
 	if (!sd)
 		return -EINVAL;
 
+	mutex_lock(&sysfs_mutex);
 	error = inode_change_ok(inode, iattr);
 	if (error)
-		return error;
+		goto out;
 
 	iattr->ia_valid &= ~ATTR_SIZE; /* ignore size changes */
 
 	error = inode_setattr(inode, iattr);
 	if (error)
-		return error;
+		goto out;
 
-	mutex_lock(&sysfs_mutex);
 	error = sysfs_sd_setattr(sd, iattr);
+out:
 	mutex_unlock(&sysfs_mutex);
-
 	return error;
 }
 
-- 
1.7.0.1


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

* [PATCH 50/62] sysfs: Pack sysfs_dirent more tightly.
  2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
                   ` (47 preceding siblings ...)
  2010-03-02 23:28 ` [PATCH 49/62] sysfs: Serialize updates to the vfs inode Greg Kroah-Hartman
@ 2010-03-02 23:28 ` Greg Kroah-Hartman
  2010-03-02 23:28 ` [PATCH 51/62] sysfs: Implement sysfs_rename_link Greg Kroah-Hartman
                   ` (11 subsequent siblings)
  60 siblings, 0 replies; 90+ messages in thread
From: Greg Kroah-Hartman @ 2010-03-02 23:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: Eric W. Biederman, Greg Kroah-Hartman

From: Eric W. Biederman <ebiederm@aristanetworks.com>

Placing the 16bit s_mode between a pointer and a long doesn't pack well
especailly on 64bit where we wast 48 bits.  So move s_mode and
declare it as a unsigned short.  This is the sysfs backing store
after all we don't need fields extra large just in case someday
we want userspace to be able to use a larger value.

Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 fs/sysfs/sysfs.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/sysfs/sysfs.h b/fs/sysfs/sysfs.h
index 37e0e08..5a3192a 100644
--- a/fs/sysfs/sysfs.h
+++ b/fs/sysfs/sysfs.h
@@ -66,8 +66,8 @@ struct sysfs_dirent {
 	};
 
 	unsigned int		s_flags;
+	unsigned short		s_mode;
 	ino_t			s_ino;
-	umode_t			s_mode;
 	struct sysfs_inode_attrs *s_iattr;
 };
 
-- 
1.7.0.1


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

* [PATCH 51/62] sysfs: Implement sysfs_rename_link
  2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
                   ` (48 preceding siblings ...)
  2010-03-02 23:28 ` [PATCH 50/62] sysfs: Pack sysfs_dirent more tightly Greg Kroah-Hartman
@ 2010-03-02 23:28 ` Greg Kroah-Hartman
  2010-03-02 23:28 ` [PATCH 52/62] driver core: Use sysfs_rename_link in device_rename Greg Kroah-Hartman
                   ` (10 subsequent siblings)
  60 siblings, 0 replies; 90+ messages in thread
From: Greg Kroah-Hartman @ 2010-03-02 23:28 UTC (permalink / raw)
  To: linux-kernel
  Cc: Eric W. Biederman, Benjamin Thery, Daniel Lezcano,
	Eric W. Biederman, Greg Kroah-Hartman

From: Eric W. Biederman <ebiederm@xmission.com>

Because of rename ordering problems we occassionally give false
warnings about invalid sysfs operations.  So using sysfs_rename
create a sysfs_rename_link function that doesn't need strange
workarounds.

Cc: Benjamin Thery <benjamin.thery@bull.net>
Cc: Daniel Lezcano <dlezcano@fr.ibm.com>
Acked-by: Serge Hallyn <serue@us.ibm.com>
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 fs/sysfs/symlink.c    |   38 ++++++++++++++++++++++++++++++++++++++
 include/linux/sysfs.h |    9 +++++++++
 2 files changed, 47 insertions(+), 0 deletions(-)

diff --git a/fs/sysfs/symlink.c b/fs/sysfs/symlink.c
index c5eff49..1b9a3a1 100644
--- a/fs/sysfs/symlink.c
+++ b/fs/sysfs/symlink.c
@@ -123,6 +123,44 @@ void sysfs_remove_link(struct kobject * kobj, const char * name)
 	sysfs_hash_and_remove(parent_sd, name);
 }
 
+/**
+ *	sysfs_rename_link - rename symlink in object's directory.
+ *	@kobj:	object we're acting for.
+ *	@targ:	object we're pointing to.
+ *	@old:	previous name of the symlink.
+ *	@new:	new name of the symlink.
+ *
+ *	A helper function for the common rename symlink idiom.
+ */
+int sysfs_rename_link(struct kobject *kobj, struct kobject *targ,
+			const char *old, const char *new)
+{
+	struct sysfs_dirent *parent_sd, *sd = NULL;
+	int result;
+
+	if (!kobj)
+		parent_sd = &sysfs_root;
+	else
+		parent_sd = kobj->sd;
+
+	result = -ENOENT;
+	sd = sysfs_get_dirent(parent_sd, old);
+	if (!sd)
+		goto out;
+
+	result = -EINVAL;
+	if (sysfs_type(sd) != SYSFS_KOBJ_LINK)
+		goto out;
+	if (sd->s_symlink.target_sd->s_dir.kobj != targ)
+		goto out;
+
+	result = sysfs_rename(sd, parent_sd, new);
+
+out:
+	sysfs_put(sd);
+	return result;
+}
+
 static int sysfs_get_target_path(struct sysfs_dirent *parent_sd,
 				 struct sysfs_dirent *target_sd, char *path)
 {
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
index 5b8f80f..d77cde6 100644
--- a/include/linux/sysfs.h
+++ b/include/linux/sysfs.h
@@ -151,6 +151,9 @@ int __must_check sysfs_create_link_nowarn(struct kobject *kobj,
 					  const char *name);
 void sysfs_remove_link(struct kobject *kobj, const char *name);
 
+int sysfs_rename_link(struct kobject *kobj, struct kobject *target,
+			const char *old_name, const char *new_name);
+
 int __must_check sysfs_create_group(struct kobject *kobj,
 				    const struct attribute_group *grp);
 int sysfs_update_group(struct kobject *kobj,
@@ -255,6 +258,12 @@ static inline void sysfs_remove_link(struct kobject *kobj, const char *name)
 {
 }
 
+static inline int sysfs_rename_link(struct kobject *k, struct kobject *t,
+				    const char *old_name, const char *new_name)
+{
+	return 0;
+}
+
 static inline int sysfs_create_group(struct kobject *kobj,
 				     const struct attribute_group *grp)
 {
-- 
1.7.0.1


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

* [PATCH 52/62] driver core: Use sysfs_rename_link in device_rename
  2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
                   ` (49 preceding siblings ...)
  2010-03-02 23:28 ` [PATCH 51/62] sysfs: Implement sysfs_rename_link Greg Kroah-Hartman
@ 2010-03-02 23:28 ` Greg Kroah-Hartman
  2010-03-02 23:28 ` [PATCH 53/62] sysfs: Pass super_block to sysfs_get_inode Greg Kroah-Hartman
                   ` (9 subsequent siblings)
  60 siblings, 0 replies; 90+ messages in thread
From: Greg Kroah-Hartman @ 2010-03-02 23:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: Eric W. Biederman, Eric W. Biederman, Greg Kroah-Hartman

From: Eric W. Biederman <ebiederm@xmission.com>

Don't open code the renaming of symlinks in sysfs
instead use the new helper function sysfs_rename_link

Acked-by: Tejun Heo <tj@kernel.org>
Acked-by: Serge Hallyn <serue@us.ibm.com>
Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/base/core.c |   18 ++++++------------
 1 files changed, 6 insertions(+), 12 deletions(-)

diff --git a/drivers/base/core.c b/drivers/base/core.c
index bbfcea0..77acb8a 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -1569,22 +1569,16 @@ int device_rename(struct device *dev, char *new_name)
 	if (old_class_name) {
 		new_class_name = make_class_name(dev->class->name, &dev->kobj);
 		if (new_class_name) {
-			error = sysfs_create_link_nowarn(&dev->parent->kobj,
-							 &dev->kobj,
-							 new_class_name);
-			if (error)
-				goto out;
-			sysfs_remove_link(&dev->parent->kobj, old_class_name);
+			error = sysfs_rename_link(&dev->parent->kobj,
+						  &dev->kobj,
+						  old_class_name,
+						  new_class_name);
 		}
 	}
 #else
 	if (dev->class) {
-		error = sysfs_create_link_nowarn(&dev->class->p->class_subsys.kobj,
-						 &dev->kobj, dev_name(dev));
-		if (error)
-			goto out;
-		sysfs_remove_link(&dev->class->p->class_subsys.kobj,
-				  old_device_name);
+		error = sysfs_rename_link(&dev->class->p->class_subsys.kobj,
+					  &dev->kobj, old_device_name, new_name);
 	}
 #endif
 
-- 
1.7.0.1


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

* [PATCH 53/62] sysfs: Pass super_block to sysfs_get_inode
  2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
                   ` (50 preceding siblings ...)
  2010-03-02 23:28 ` [PATCH 52/62] driver core: Use sysfs_rename_link in device_rename Greg Kroah-Hartman
@ 2010-03-02 23:28 ` Greg Kroah-Hartman
  2010-03-02 23:28 ` [PATCH 54/62] sysfs: Kill unused sysfs_sb variable Greg Kroah-Hartman
                   ` (8 subsequent siblings)
  60 siblings, 0 replies; 90+ messages in thread
From: Greg Kroah-Hartman @ 2010-03-02 23:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: Eric W. Biederman, Eric W. Biederman, Greg Kroah-Hartman

From: Eric W. Biederman <ebiederm@xmission.com>

Currently sysfs_get_inode magically returns an inode on
sysfs_sb.  Make the super_block parameter explicit and
the code becomes clearer.

Acked-by: Tejun Heo <tj@kernel.org>
Acked-by: Serge Hallyn <serue@us.ibm.com>
Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 fs/sysfs/dir.c   |    2 +-
 fs/sysfs/inode.c |    5 +++--
 fs/sysfs/mount.c |    2 +-
 fs/sysfs/sysfs.h |    2 +-
 4 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c
index 481fdec..5907178 100644
--- a/fs/sysfs/dir.c
+++ b/fs/sysfs/dir.c
@@ -645,7 +645,7 @@ static struct dentry * sysfs_lookup(struct inode *dir, struct dentry *dentry,
 	}
 
 	/* attach dentry and inode */
-	inode = sysfs_get_inode(sd);
+	inode = sysfs_get_inode(dir->i_sb, sd);
 	if (!inode) {
 		ret = ERR_PTR(-ENOMEM);
 		goto out_unlock;
diff --git a/fs/sysfs/inode.c b/fs/sysfs/inode.c
index 0d09f6c..082daae 100644
--- a/fs/sysfs/inode.c
+++ b/fs/sysfs/inode.c
@@ -283,6 +283,7 @@ static void sysfs_init_inode(struct sysfs_dirent *sd, struct inode *inode)
 
 /**
  *	sysfs_get_inode - get inode for sysfs_dirent
+ *	@sb: super block
  *	@sd: sysfs_dirent to allocate inode for
  *
  *	Get inode for @sd.  If such inode doesn't exist, a new inode
@@ -295,11 +296,11 @@ static void sysfs_init_inode(struct sysfs_dirent *sd, struct inode *inode)
  *	RETURNS:
  *	Pointer to allocated inode on success, NULL on failure.
  */
-struct inode * sysfs_get_inode(struct sysfs_dirent *sd)
+struct inode * sysfs_get_inode(struct super_block *sb, struct sysfs_dirent *sd)
 {
 	struct inode *inode;
 
-	inode = iget_locked(sysfs_sb, sd->s_ino);
+	inode = iget_locked(sb, sd->s_ino);
 	if (inode && (inode->i_state & I_NEW))
 		sysfs_init_inode(sd, inode);
 
diff --git a/fs/sysfs/mount.c b/fs/sysfs/mount.c
index 4974995..89db07e 100644
--- a/fs/sysfs/mount.c
+++ b/fs/sysfs/mount.c
@@ -54,7 +54,7 @@ static int sysfs_fill_super(struct super_block *sb, void *data, int silent)
 
 	/* get root inode, initialize and unlock it */
 	mutex_lock(&sysfs_mutex);
-	inode = sysfs_get_inode(&sysfs_root);
+	inode = sysfs_get_inode(sb, &sysfs_root);
 	mutex_unlock(&sysfs_mutex);
 	if (!inode) {
 		pr_debug("sysfs: could not get root inode\n");
diff --git a/fs/sysfs/sysfs.h b/fs/sysfs/sysfs.h
index 5a3192a..7593d71 100644
--- a/fs/sysfs/sysfs.h
+++ b/fs/sysfs/sysfs.h
@@ -172,7 +172,7 @@ static inline void __sysfs_put(struct sysfs_dirent *sd)
 /*
  * inode.c
  */
-struct inode *sysfs_get_inode(struct sysfs_dirent *sd);
+struct inode *sysfs_get_inode(struct super_block *sb, struct sysfs_dirent *sd);
 void sysfs_delete_inode(struct inode *inode);
 int sysfs_sd_setattr(struct sysfs_dirent *sd, struct iattr *iattr);
 int sysfs_permission(struct inode *inode, int mask);
-- 
1.7.0.1


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

* [PATCH 54/62] sysfs: Kill unused sysfs_sb variable.
  2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
                   ` (51 preceding siblings ...)
  2010-03-02 23:28 ` [PATCH 53/62] sysfs: Pass super_block to sysfs_get_inode Greg Kroah-Hartman
@ 2010-03-02 23:28 ` Greg Kroah-Hartman
  2010-03-02 23:28 ` [PATCH 56/62] msi-laptop: Support standard ec 66/62 command on MSI notebook and nebook Greg Kroah-Hartman
                   ` (7 subsequent siblings)
  60 siblings, 0 replies; 90+ messages in thread
From: Greg Kroah-Hartman @ 2010-03-02 23:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: Eric W. Biederman, Eric W. Biederman, Greg Kroah-Hartman

From: Eric W. Biederman <ebiederm@xmission.com>

Now that there are no more users we can remove
the sysfs_sb variable.

Acked-by: Tejun Heo <tj@kernel.org>
Acked-by: Serge Hallyn <serue@us.ibm.com>
Signed-off-by: Eric W. Biederman <ebiederm@aristanetworks.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 fs/sysfs/mount.c |    2 --
 fs/sysfs/sysfs.h |    1 -
 2 files changed, 0 insertions(+), 3 deletions(-)

diff --git a/fs/sysfs/mount.c b/fs/sysfs/mount.c
index 89db07e..0cb1088 100644
--- a/fs/sysfs/mount.c
+++ b/fs/sysfs/mount.c
@@ -23,7 +23,6 @@
 
 
 static struct vfsmount *sysfs_mount;
-struct super_block * sysfs_sb = NULL;
 struct kmem_cache *sysfs_dir_cachep;
 
 static const struct super_operations sysfs_ops = {
@@ -50,7 +49,6 @@ static int sysfs_fill_super(struct super_block *sb, void *data, int silent)
 	sb->s_magic = SYSFS_MAGIC;
 	sb->s_op = &sysfs_ops;
 	sb->s_time_gran = 1;
-	sysfs_sb = sb;
 
 	/* get root inode, initialize and unlock it */
 	mutex_lock(&sysfs_mutex);
diff --git a/fs/sysfs/sysfs.h b/fs/sysfs/sysfs.h
index 7593d71..30f5a44 100644
--- a/fs/sysfs/sysfs.h
+++ b/fs/sysfs/sysfs.h
@@ -115,7 +115,6 @@ struct sysfs_addrm_cxt {
  * mount.c
  */
 extern struct sysfs_dirent sysfs_root;
-extern struct super_block *sysfs_sb;
 extern struct kmem_cache *sysfs_dir_cachep;
 
 /*
-- 
1.7.0.1


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

* [PATCH 56/62] msi-laptop: Support standard ec 66/62 command on MSI notebook and nebook
  2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
                   ` (52 preceding siblings ...)
  2010-03-02 23:28 ` [PATCH 54/62] sysfs: Kill unused sysfs_sb variable Greg Kroah-Hartman
@ 2010-03-02 23:28 ` Greg Kroah-Hartman
  2010-03-02 23:42   ` Matthew Garrett
  2010-03-02 23:28 ` [PATCH 57/62] msi-laptop: Add threeg sysfs file for support query 3G state by standard 66/62 ec command Greg Kroah-Hartman
                   ` (6 subsequent siblings)
  60 siblings, 1 reply; 90+ messages in thread
From: Greg Kroah-Hartman @ 2010-03-02 23:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: Lee, Chun-Yi, Lennart Poettering, Greg Kroah-Hartman

From: Lee, Chun-Yi <jlee@novell.com>

Suppport standard ec 66/62 command on MSI notebook and nebook. MSI
netbook and notebook already support 66/62 command, so, add new
get_state function, and put the old model to non-standard model, but
driver still support those old model.

Signed-off-by: Lee, Chun-Yi <jlee@novell.com>
Cc: Lennart Poettering <mzxreary@0pointer.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/platform/x86/msi-laptop.c |   43 +++++++++++++++++++++++++++++++++---
 1 files changed, 39 insertions(+), 4 deletions(-)

diff --git a/drivers/platform/x86/msi-laptop.c b/drivers/platform/x86/msi-laptop.c
index 759763d..323e994 100644
--- a/drivers/platform/x86/msi-laptop.c
+++ b/drivers/platform/x86/msi-laptop.c
@@ -66,6 +66,11 @@
 #define MSI_EC_COMMAND_WIRELESS 0x10
 #define MSI_EC_COMMAND_LCD_LEVEL 0x11
 
+#define MSI_STANDARD_EC_COMMAND_ADDRESS	0x2e
+#define MSI_STANDARD_EC_BLUETOOTH_MASK	(1 << 0)
+#define MSI_STANDARD_EC_WEBCAM_MASK	(1 << 1)
+#define MSI_STANDARD_EC_WLAN_MASK	(1 << 3)
+
 static int force;
 module_param(force, bool, 0);
 MODULE_PARM_DESC(force, "Force driver load, ignore DMI data");
@@ -74,6 +79,9 @@ static int auto_brightness;
 module_param(auto_brightness, int, 0);
 MODULE_PARM_DESC(auto_brightness, "Enable automatic brightness control (0: disabled; 1: enabled; 2: don't touch)");
 
+static bool old_ec_model;
+static int wlan_s, bluetooth_s;
+
 /* Hardware access */
 
 static int set_lcd_level(int level)
@@ -148,6 +156,22 @@ static int get_wireless_state(int *wlan, int *bluetooth)
 	return 0;
 }
 
+static int get_wireless_state_ec_standard(void)
+{
+	u8 rdata;
+	int result;
+
+	result = ec_read(MSI_STANDARD_EC_COMMAND_ADDRESS, &rdata);
+	if (result < 0)
+		return -1;
+
+	wlan_s = !!(rdata & MSI_STANDARD_EC_WLAN_MASK);
+
+	bluetooth_s = !!(rdata & MSI_STANDARD_EC_BLUETOOTH_MASK);
+
+	return 0;
+}
+
 /* Backlight device stuff */
 
 static int bl_get_brightness(struct backlight_device *b)
@@ -176,7 +200,12 @@ static ssize_t show_wlan(struct device *dev,
 
 	int ret, enabled;
 
-	ret = get_wireless_state(&enabled, NULL);
+	if (old_ec_model) {
+		ret = get_wireless_state(&enabled, NULL);
+	} else {
+		ret = get_wireless_state_ec_standard();
+		enabled = wlan_s;
+	}
 	if (ret < 0)
 		return ret;
 
@@ -189,7 +218,12 @@ static ssize_t show_bluetooth(struct device *dev,
 
 	int ret, enabled;
 
-	ret = get_wireless_state(NULL, &enabled);
+	if (old_ec_model) {
+		ret = get_wireless_state(NULL, &enabled);
+	} else {
+		ret = get_wireless_state_ec_standard();
+		enabled = bluetooth_s;
+	}
 	if (ret < 0)
 		return ret;
 
@@ -339,8 +373,8 @@ static int __init msi_init(void)
 	if (acpi_disabled)
 		return -ENODEV;
 
-	if (!force && !dmi_check_system(msi_dmi_table))
-		return -ENODEV;
+	if (force || dmi_check_system(msi_dmi_table))
+		old_ec_model = 1;
 
 	if (auto_brightness < 0 || auto_brightness > 2)
 		return -EINVAL;
@@ -435,3 +469,4 @@ MODULE_ALIAS("dmi:*:svnMICRO-STARINT'LCO.,LTD:pnMS-1013:pvr0131*:cvnMICRO-STARIN
 MODULE_ALIAS("dmi:*:svnMicro-StarInternational:pnMS-1058:pvr0581:rvnMSI:rnMS-1058:*:ct10:*");
 MODULE_ALIAS("dmi:*:svnMicro-StarInternational:pnMS-1412:*:rvnMSI:rnMS-1412:*:cvnMICRO-STARINT'LCO.,LTD:ct10:*");
 MODULE_ALIAS("dmi:*:svnNOTEBOOK:pnSAM2000:pvr0131*:cvnMICRO-STARINT'LCO.,LTD:ct10:*");
+MODULE_ALIAS("dmi:*:svnMICRO-STARINTERNATIONAL*:pnMS-N034:*");
-- 
1.7.0.1


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

* [PATCH 57/62] msi-laptop: Add threeg sysfs file for support query 3G state by standard 66/62 ec command
  2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
                   ` (53 preceding siblings ...)
  2010-03-02 23:28 ` [PATCH 56/62] msi-laptop: Support standard ec 66/62 command on MSI notebook and nebook Greg Kroah-Hartman
@ 2010-03-02 23:28 ` Greg Kroah-Hartman
  2010-03-02 23:36   ` Matthew Garrett
  2010-03-02 23:28 ` [PATCH 58/62] msi-laptop: Support some MSI 3G netbook that is need load SCM Greg Kroah-Hartman
                   ` (5 subsequent siblings)
  60 siblings, 1 reply; 90+ messages in thread
From: Greg Kroah-Hartman @ 2010-03-02 23:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: Lee, Chun-Yi, Lennart Poettering, Greg Kroah-Hartman

From: Lee, Chun-Yi <jlee@novell.com>

Add threeg sysfs file for support query 3G state by standard 66/62 ec
command, the MSI standard ec interface supported this feature.

Signed-off-by: Lee, Chun-Yi <jlee@novell.com>
Cc: Lennart Poettering <mzxreary@0pointer.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/platform/x86/msi-laptop.c |   31 ++++++++++++++++++++++++++++++-
 1 files changed, 30 insertions(+), 1 deletions(-)

diff --git a/drivers/platform/x86/msi-laptop.c b/drivers/platform/x86/msi-laptop.c
index 323e994..1784d55 100644
--- a/drivers/platform/x86/msi-laptop.c
+++ b/drivers/platform/x86/msi-laptop.c
@@ -70,6 +70,7 @@
 #define MSI_STANDARD_EC_BLUETOOTH_MASK	(1 << 0)
 #define MSI_STANDARD_EC_WEBCAM_MASK	(1 << 1)
 #define MSI_STANDARD_EC_WLAN_MASK	(1 << 3)
+#define MSI_STANDARD_EC_3G_MASK		(1 << 4)
 
 static int force;
 module_param(force, bool, 0);
@@ -80,7 +81,7 @@ module_param(auto_brightness, int, 0);
 MODULE_PARM_DESC(auto_brightness, "Enable automatic brightness control (0: disabled; 1: enabled; 2: don't touch)");
 
 static bool old_ec_model;
-static int wlan_s, bluetooth_s;
+static int wlan_s, bluetooth_s, threeg_s;
 
 /* Hardware access */
 
@@ -169,6 +170,8 @@ static int get_wireless_state_ec_standard(void)
 
 	bluetooth_s = !!(rdata & MSI_STANDARD_EC_BLUETOOTH_MASK);
 
+	threeg_s = !!(rdata & MSI_STANDARD_EC_3G_MASK);
+
 	return 0;
 }
 
@@ -230,6 +233,23 @@ static ssize_t show_bluetooth(struct device *dev,
 	return sprintf(buf, "%i\n", enabled);
 }
 
+static ssize_t show_threeg(struct device *dev,
+	struct device_attribute *attr, char *buf)
+{
+
+	int ret;
+
+	/* old msi ec not support 3G */
+	if (old_ec_model)
+		return -1;
+
+	ret = get_wireless_state_ec_standard();
+	if (ret < 0)
+		return ret;
+
+	return sprintf(buf, "%i\n", threeg_s);
+}
+
 static ssize_t show_lcd_level(struct device *dev,
 	struct device_attribute *attr, char *buf)
 {
@@ -292,6 +312,7 @@ static DEVICE_ATTR(lcd_level, 0644, show_lcd_level, store_lcd_level);
 static DEVICE_ATTR(auto_brightness, 0644, show_auto_brightness, store_auto_brightness);
 static DEVICE_ATTR(bluetooth, 0444, show_bluetooth, NULL);
 static DEVICE_ATTR(wlan, 0444, show_wlan, NULL);
+static DEVICE_ATTR(threeg, 0444, show_threeg, NULL);
 
 static struct attribute *msipf_attributes[] = {
 	&dev_attr_lcd_level.attr,
@@ -412,6 +433,12 @@ static int __init msi_init(void)
 	if (ret)
 		goto fail_platform_device2;
 
+	if (!old_ec_model) {
+		ret = device_create_file(&msipf_device->dev, &dev_attr_threeg);
+		if (ret)
+			goto fail_platform_device2;
+	}
+
 	/* Disable automatic brightness control by default because
 	 * this module was probably loaded to do brightness control in
 	 * software. */
@@ -446,6 +473,8 @@ static void __exit msi_cleanup(void)
 {
 
 	sysfs_remove_group(&msipf_device->dev.kobj, &msipf_attribute_group);
+	if (!old_ec_model)
+		device_remove_file(&msipf_device->dev, &dev_attr_threeg);
 	platform_device_unregister(msipf_device);
 	platform_driver_unregister(&msipf_driver);
 	backlight_device_unregister(msibl_device);
-- 
1.7.0.1


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

* [PATCH 58/62] msi-laptop: Support some MSI 3G netbook that is need load SCM
  2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
                   ` (54 preceding siblings ...)
  2010-03-02 23:28 ` [PATCH 57/62] msi-laptop: Add threeg sysfs file for support query 3G state by standard 66/62 ec command Greg Kroah-Hartman
@ 2010-03-02 23:28 ` Greg Kroah-Hartman
  2010-03-02 23:39   ` Matthew Garrett
  2010-03-02 23:28 ` [PATCH 59/62] msi-laptop: Add resume method for set the SCM load again Greg Kroah-Hartman
                   ` (4 subsequent siblings)
  60 siblings, 1 reply; 90+ messages in thread
From: Greg Kroah-Hartman @ 2010-03-02 23:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: Lee, Chun-Yi, Lennart Poettering, Greg Kroah-Hartman

From: Lee, Chun-Yi <jlee@novell.com>

Some MSI 3G netbook only have one fn key to control Wlan/Bluetooth/3G,
those netbook will load the SCM (windows app) to disable the original
Wlan/Bluetooth control by BIOS when user press fn key, then control
Wlan/Bluetooth/3G by SCM (software control by OS). Without SCM, user
cann't on/off 3G module on those 3G netbook.
On Linux, msi-laptop driver will do the same thing to disable the
original BIOS control, then might need use HAL or other userland
application to do the software control that simulate with SCM.
e.g. MSI N034 netbook

Signed-off-by: Lee, Chun-Yi <jlee@novell.com>
Cc: Lennart Poettering <mzxreary@0pointer.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/platform/x86/msi-laptop.c |  238 +++++++++++++++++++++++++++++++++++++
 1 files changed, 238 insertions(+), 0 deletions(-)

diff --git a/drivers/platform/x86/msi-laptop.c b/drivers/platform/x86/msi-laptop.c
index 1784d55..ff21d1a 100644
--- a/drivers/platform/x86/msi-laptop.c
+++ b/drivers/platform/x86/msi-laptop.c
@@ -58,6 +58,7 @@
 #include <linux/dmi.h>
 #include <linux/backlight.h>
 #include <linux/platform_device.h>
+#include <linux/rfkill.h>
 
 #define MSI_DRIVER_VERSION "0.5"
 
@@ -72,6 +73,10 @@
 #define MSI_STANDARD_EC_WLAN_MASK	(1 << 3)
 #define MSI_STANDARD_EC_3G_MASK		(1 << 4)
 
+/* For set SCM load flag to disable BIOS fn key */
+#define MSI_STANDARD_EC_SCM_LOAD_ADDRESS	0x2d
+#define MSI_STANDARD_EC_SCM_LOAD_MASK		(1 << 0)
+
 static int force;
 module_param(force, bool, 0);
 MODULE_PARM_DESC(force, "Force driver load, ignore DMI data");
@@ -83,6 +88,19 @@ MODULE_PARM_DESC(auto_brightness, "Enable automatic brightness control (0: disab
 static bool old_ec_model;
 static int wlan_s, bluetooth_s, threeg_s;
 
+/* Some MSI 3G netbook only have one fn key to control Wlan/Bluetooth/3G,
+ * those netbook will load the SCM (windows app) to disable the original
+ * Wlan/Bluetooth control by BIOS when user press fn key, then control
+ * Wlan/Bluetooth/3G by SCM (software control by OS). Without SCM, user
+ * cann't on/off 3G module on those 3G netbook.
+ * On Linux, msi-laptop driver will do the same thing to disable the
+ * original BIOS control, then might need use HAL or other userland
+ * application to do the software control that simulate with SCM.
+ * e.g. MSI N034 netbook
+ */
+static bool load_scm_model;
+static struct rfkill *rfk_wlan, *rfk_bluetooth, *rfk_threeg;
+
 /* Hardware access */
 
 static int set_lcd_level(int level)
@@ -139,6 +157,35 @@ static int set_auto_brightness(int enable)
 	return ec_transaction(MSI_EC_COMMAND_LCD_LEVEL, wdata, 2, NULL, 0, 1);
 }
 
+static ssize_t set_device_state(const char *buf, size_t count, u8 mask)
+{
+	int status;
+	u8 wdata = 0, rdata;
+	int result;
+
+	if (sscanf(buf, "%i", &status) != 1 || (status < 0 || status > 1))
+		return -EINVAL;
+
+	/* read current device state */
+	result = ec_read(MSI_STANDARD_EC_COMMAND_ADDRESS, &rdata);
+	if (result < 0)
+		return -EINVAL;
+
+	if (!!(rdata & mask) != status) {
+		/* reverse device bit */
+		if (rdata & mask)
+			wdata = rdata & ~mask;
+		else
+			wdata = rdata | mask;
+
+		result = ec_write(MSI_STANDARD_EC_COMMAND_ADDRESS, wdata);
+		if (result < 0)
+			return -EINVAL;
+	}
+
+	return count;
+}
+
 static int get_wireless_state(int *wlan, int *bluetooth)
 {
 	u8 wdata = 0, rdata;
@@ -215,6 +262,12 @@ static ssize_t show_wlan(struct device *dev,
 	return sprintf(buf, "%i\n", enabled);
 }
 
+static ssize_t store_wlan(struct device *dev,
+	struct device_attribute *attr, const char *buf, size_t count)
+{
+	return set_device_state(buf, count, MSI_STANDARD_EC_WLAN_MASK);
+}
+
 static ssize_t show_bluetooth(struct device *dev,
 	struct device_attribute *attr, char *buf)
 {
@@ -233,6 +286,12 @@ static ssize_t show_bluetooth(struct device *dev,
 	return sprintf(buf, "%i\n", enabled);
 }
 
+static ssize_t store_bluetooth(struct device *dev,
+	struct device_attribute *attr, const char *buf, size_t count)
+{
+	return set_device_state(buf, count, MSI_STANDARD_EC_BLUETOOTH_MASK);
+}
+
 static ssize_t show_threeg(struct device *dev,
 	struct device_attribute *attr, char *buf)
 {
@@ -250,6 +309,12 @@ static ssize_t show_threeg(struct device *dev,
 	return sprintf(buf, "%i\n", threeg_s);
 }
 
+static ssize_t store_threeg(struct device *dev,
+	struct device_attribute *attr, const char *buf, size_t count)
+{
+	return set_device_state(buf, count, MSI_STANDARD_EC_3G_MASK);
+}
+
 static ssize_t show_lcd_level(struct device *dev,
 	struct device_attribute *attr, char *buf)
 {
@@ -387,6 +452,169 @@ static struct dmi_system_id __initdata msi_dmi_table[] = {
 	{ }
 };
 
+static struct dmi_system_id __initdata msi_load_scm_models_dmi_table[] = {
+	{
+		.ident = "MSI N034",
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR,
+				"MICRO-STAR INTERNATIONAL CO., LTD"),
+			DMI_MATCH(DMI_PRODUCT_NAME, "MS-N034"),
+			DMI_MATCH(DMI_CHASSIS_VENDOR,
+			"MICRO-STAR INTERNATIONAL CO., LTD")
+		},
+		.callback = dmi_check_cb
+	},
+	{ }
+};
+
+static int rfkill_bluetooth_set(void *data, bool blocked)
+{
+	/* Do something with blocked...*/
+	/*
+	 * blocked == false is on
+	 * blocked == true is off
+	 */
+	if (blocked)
+		set_device_state("0", 0, MSI_STANDARD_EC_BLUETOOTH_MASK);
+	else
+		set_device_state("1", 0, MSI_STANDARD_EC_BLUETOOTH_MASK);
+
+	return 0;
+}
+
+static int rfkill_wlan_set(void *data, bool blocked)
+{
+	if (blocked)
+		set_device_state("0", 0, MSI_STANDARD_EC_WLAN_MASK);
+	else
+		set_device_state("1", 0, MSI_STANDARD_EC_WLAN_MASK);
+
+	return 0;
+}
+
+static int rfkill_threeg_set(void *data, bool blocked)
+{
+	if (blocked)
+		set_device_state("0", 0, MSI_STANDARD_EC_3G_MASK);
+	else
+		set_device_state("1", 0, MSI_STANDARD_EC_3G_MASK);
+
+	return 0;
+}
+
+static struct rfkill_ops rfkill_bluetooth_ops = {
+	.set_block = rfkill_bluetooth_set
+};
+
+static struct rfkill_ops rfkill_wlan_ops = {
+	.set_block = rfkill_wlan_set
+};
+
+static struct rfkill_ops rfkill_threeg_ops = {
+	.set_block = rfkill_threeg_set
+};
+
+static void rfkill_cleanup(void)
+{
+	if (rfk_bluetooth) {
+		rfkill_unregister(rfk_bluetooth);
+		rfkill_destroy(rfk_bluetooth);
+	}
+
+	if (rfk_threeg) {
+		rfkill_unregister(rfk_threeg);
+		rfkill_destroy(rfk_threeg);
+	}
+
+	if (rfk_wlan) {
+		rfkill_unregister(rfk_wlan);
+		rfkill_destroy(rfk_wlan);
+	}
+}
+
+static int rfkill_init(struct platform_device *sdev)
+{
+	/* add rfkill */
+	int retval;
+
+	rfk_bluetooth = rfkill_alloc("msi-bluetooth", &sdev->dev,
+				RFKILL_TYPE_BLUETOOTH,
+				&rfkill_bluetooth_ops, NULL);
+	if (!rfk_bluetooth) {
+		retval = -ENOMEM;
+		goto err_bluetooth;
+	}
+	retval = rfkill_register(rfk_bluetooth);
+	if (retval)
+		goto err_bluetooth;
+
+	rfk_wlan = rfkill_alloc("msi-wlan", &sdev->dev, RFKILL_TYPE_WLAN,
+				&rfkill_wlan_ops, NULL);
+	if (!rfk_wlan) {
+		retval = -ENOMEM;
+		goto err_wlan;
+	}
+	retval = rfkill_register(rfk_wlan);
+	if (retval)
+		goto err_wlan;
+
+	rfk_threeg = rfkill_alloc("msi-threeg", &sdev->dev, RFKILL_TYPE_WWAN,
+				&rfkill_threeg_ops, NULL);
+	if (!rfk_threeg) {
+		retval = -ENOMEM;
+		goto err_threeg;
+	}
+	retval = rfkill_register(rfk_threeg);
+	if (retval)
+		goto err_threeg;
+
+	return 0;
+
+err_threeg:
+	rfkill_destroy(rfk_threeg);
+	if (rfk_wlan)
+		rfkill_unregister(rfk_wlan);
+err_wlan:
+	rfkill_destroy(rfk_wlan);
+	if (rfk_bluetooth)
+		rfkill_unregister(rfk_bluetooth);
+err_bluetooth:
+	rfkill_destroy(rfk_bluetooth);
+
+	return retval;
+}
+
+static int load_scm_model_init(struct platform_device *sdev)
+{
+	u8 data;
+	int result;
+
+	/* allow userland write sysfs file  */
+	dev_attr_bluetooth.store = store_bluetooth;
+	dev_attr_wlan.store = store_wlan;
+	dev_attr_threeg.store = store_threeg;
+	dev_attr_bluetooth.attr.mode |= S_IWUSR;
+	dev_attr_wlan.attr.mode |= S_IWUSR;
+	dev_attr_threeg.attr.mode |= S_IWUSR;
+
+	/* disable hardware control by fn key */
+	result = ec_read(MSI_STANDARD_EC_SCM_LOAD_ADDRESS, &data);
+	if (result < 0)
+		return result;
+
+	result = ec_write(MSI_STANDARD_EC_SCM_LOAD_ADDRESS,
+		data | MSI_STANDARD_EC_SCM_LOAD_MASK);
+	if (result < 0)
+		return result;
+
+	/* initial rfkill */
+	result = rfkill_init(sdev);
+	if (result < 0)
+		return result;
+
+	return 0;
+}
+
 static int __init msi_init(void)
 {
 	int ret;
@@ -397,6 +625,9 @@ static int __init msi_init(void)
 	if (force || dmi_check_system(msi_dmi_table))
 		old_ec_model = 1;
 
+	if (!old_ec_model && dmi_check_system(msi_load_scm_models_dmi_table))
+		load_scm_model = 1;
+
 	if (auto_brightness < 0 || auto_brightness > 2)
 		return -EINVAL;
 
@@ -429,6 +660,11 @@ static int __init msi_init(void)
 	if (ret)
 		goto fail_platform_device1;
 
+	if (load_scm_model && (load_scm_model_init(msipf_device) < 0)) {
+		ret = -EINVAL;
+		goto fail_platform_device1;
+	}
+
 	ret = sysfs_create_group(&msipf_device->dev.kobj, &msipf_attribute_group);
 	if (ret)
 		goto fail_platform_device2;
@@ -479,6 +715,8 @@ static void __exit msi_cleanup(void)
 	platform_driver_unregister(&msipf_driver);
 	backlight_device_unregister(msibl_device);
 
+	rfkill_cleanup();
+
 	/* Enable automatic brightness control again */
 	if (auto_brightness != 2)
 		set_auto_brightness(1);
-- 
1.7.0.1


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

* [PATCH 59/62] msi-laptop: Add resume method for set the SCM load again
  2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
                   ` (55 preceding siblings ...)
  2010-03-02 23:28 ` [PATCH 58/62] msi-laptop: Support some MSI 3G netbook that is need load SCM Greg Kroah-Hartman
@ 2010-03-02 23:28 ` Greg Kroah-Hartman
  2010-03-02 23:28 ` [PATCH 60/62] msi-laptop: Detect 3G device exists by standard ec command Greg Kroah-Hartman
                   ` (3 subsequent siblings)
  60 siblings, 0 replies; 90+ messages in thread
From: Greg Kroah-Hartman @ 2010-03-02 23:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: Lee, Chun-Yi, Lennart Poettering, Greg Kroah-Hartman

From: Lee, Chun-Yi <jlee@novell.com>

Implement the resume method for set the load SCM flag after system reusme.
Without this patch, the wifi function key on SCM model will back to BIOS
control mode then confuse with the userland software control.
e.g. MSI N034

Signed-off-by: Lee, Chun-Yi <jlee@novell.com>
Cc: Lennart Poettering <mzxreary@0pointer.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/platform/x86/msi-laptop.c |   26 +++++++++++++++++++++++++-
 1 files changed, 25 insertions(+), 1 deletions(-)

diff --git a/drivers/platform/x86/msi-laptop.c b/drivers/platform/x86/msi-laptop.c
index ff21d1a..af1b62f 100644
--- a/drivers/platform/x86/msi-laptop.c
+++ b/drivers/platform/x86/msi-laptop.c
@@ -77,6 +77,8 @@
 #define MSI_STANDARD_EC_SCM_LOAD_ADDRESS	0x2d
 #define MSI_STANDARD_EC_SCM_LOAD_MASK		(1 << 0)
 
+static int msi_laptop_resume(struct platform_device *device);
+
 static int force;
 module_param(force, bool, 0);
 MODULE_PARM_DESC(force, "Force driver load, ignore DMI data");
@@ -395,7 +397,8 @@ static struct platform_driver msipf_driver = {
 	.driver = {
 		.name = "msi-laptop-pf",
 		.owner = THIS_MODULE,
-	}
+	},
+	.resume = msi_laptop_resume,
 };
 
 static struct platform_device *msipf_device;
@@ -584,6 +587,27 @@ err_bluetooth:
 	return retval;
 }
 
+static int msi_laptop_resume(struct platform_device *device)
+{
+	u8 data;
+	int result;
+
+	if (!load_scm_model)
+		return 0;
+
+	/* set load SCM to disable hardware control by fn key */
+	result = ec_read(MSI_STANDARD_EC_SCM_LOAD_ADDRESS, &data);
+	if (result < 0)
+		return result;
+
+	result = ec_write(MSI_STANDARD_EC_SCM_LOAD_ADDRESS,
+		data | MSI_STANDARD_EC_SCM_LOAD_MASK);
+	if (result < 0)
+		return result;
+
+	return 0;
+}
+
 static int load_scm_model_init(struct platform_device *sdev)
 {
 	u8 data;
-- 
1.7.0.1


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

* [PATCH 60/62] msi-laptop: Detect 3G device exists by standard ec command
  2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
                   ` (56 preceding siblings ...)
  2010-03-02 23:28 ` [PATCH 59/62] msi-laptop: Add resume method for set the SCM load again Greg Kroah-Hartman
@ 2010-03-02 23:28 ` Greg Kroah-Hartman
  2010-03-02 23:29 ` [PATCH 61/62] msi-laptop: depends on RFKILL Greg Kroah-Hartman
                   ` (2 subsequent siblings)
  60 siblings, 0 replies; 90+ messages in thread
From: Greg Kroah-Hartman @ 2010-03-02 23:28 UTC (permalink / raw)
  To: linux-kernel; +Cc: Lee, Chun-Yi, Lennart Poettering, Greg Kroah-Hartman

From: Lee, Chun-Yi <jlee@novell.com>

Detect 3G device exists by standard ec command. Driver will not create the threeg sysfs
file and threeg rfkill interface if there have no internal 3G device in MSI notebook/netbook.

Signed-off-by: Lee, Chun-Yi <jlee@novell.com>
Cc: Lennart Poettering <mzxreary@0pointer.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/platform/x86/msi-laptop.c |   44 ++++++++++++++++++++++++++++--------
 1 files changed, 34 insertions(+), 10 deletions(-)

diff --git a/drivers/platform/x86/msi-laptop.c b/drivers/platform/x86/msi-laptop.c
index af1b62f..c2b05da 100644
--- a/drivers/platform/x86/msi-laptop.c
+++ b/drivers/platform/x86/msi-laptop.c
@@ -79,6 +79,8 @@
 
 static int msi_laptop_resume(struct platform_device *device);
 
+#define MSI_STANDARD_EC_DEVICES_EXISTS_ADDRESS	0x2f
+
 static int force;
 module_param(force, bool, 0);
 MODULE_PARM_DESC(force, "Force driver load, ignore DMI data");
@@ -89,6 +91,7 @@ MODULE_PARM_DESC(auto_brightness, "Enable automatic brightness control (0: disab
 
 static bool old_ec_model;
 static int wlan_s, bluetooth_s, threeg_s;
+static int threeg_exists;
 
 /* Some MSI 3G netbook only have one fn key to control Wlan/Bluetooth/3G,
  * those netbook will load the SCM (windows app) to disable the original
@@ -224,6 +227,20 @@ static int get_wireless_state_ec_standard(void)
 	return 0;
 }
 
+static int get_threeg_exists(void)
+{
+	u8 rdata;
+	int result;
+
+	result = ec_read(MSI_STANDARD_EC_DEVICES_EXISTS_ADDRESS, &rdata);
+	if (result < 0)
+		return -1;
+
+	threeg_exists = !!(rdata & MSI_STANDARD_EC_3G_MASK);
+
+	return 0;
+}
+
 /* Backlight device stuff */
 
 static int bl_get_brightness(struct backlight_device *b)
@@ -561,15 +578,17 @@ static int rfkill_init(struct platform_device *sdev)
 	if (retval)
 		goto err_wlan;
 
-	rfk_threeg = rfkill_alloc("msi-threeg", &sdev->dev, RFKILL_TYPE_WWAN,
-				&rfkill_threeg_ops, NULL);
-	if (!rfk_threeg) {
-		retval = -ENOMEM;
-		goto err_threeg;
+	if (threeg_exists) {
+		rfk_threeg = rfkill_alloc("msi-threeg", &sdev->dev,
+				RFKILL_TYPE_WWAN, &rfkill_threeg_ops, NULL);
+		if (!rfk_threeg) {
+			retval = -ENOMEM;
+			goto err_threeg;
+		}
+		retval = rfkill_register(rfk_threeg);
+		if (retval)
+			goto err_threeg;
 	}
-	retval = rfkill_register(rfk_threeg);
-	if (retval)
-		goto err_threeg;
 
 	return 0;
 
@@ -649,6 +668,9 @@ static int __init msi_init(void)
 	if (force || dmi_check_system(msi_dmi_table))
 		old_ec_model = 1;
 
+	if (!old_ec_model)
+		get_threeg_exists();
+
 	if (!old_ec_model && dmi_check_system(msi_load_scm_models_dmi_table))
 		load_scm_model = 1;
 
@@ -694,7 +716,9 @@ static int __init msi_init(void)
 		goto fail_platform_device2;
 
 	if (!old_ec_model) {
-		ret = device_create_file(&msipf_device->dev, &dev_attr_threeg);
+		if (threeg_exists)
+			ret = device_create_file(&msipf_device->dev,
+						&dev_attr_threeg);
 		if (ret)
 			goto fail_platform_device2;
 	}
@@ -733,7 +757,7 @@ static void __exit msi_cleanup(void)
 {
 
 	sysfs_remove_group(&msipf_device->dev.kobj, &msipf_attribute_group);
-	if (!old_ec_model)
+	if (!old_ec_model && threeg_exists)
 		device_remove_file(&msipf_device->dev, &dev_attr_threeg);
 	platform_device_unregister(msipf_device);
 	platform_driver_unregister(&msipf_driver);
-- 
1.7.0.1


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

* [PATCH 61/62] msi-laptop: depends on RFKILL
  2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
                   ` (57 preceding siblings ...)
  2010-03-02 23:28 ` [PATCH 60/62] msi-laptop: Detect 3G device exists by standard ec command Greg Kroah-Hartman
@ 2010-03-02 23:29 ` Greg Kroah-Hartman
  2010-03-03  6:09   ` Dmitry Torokhov
  2010-03-02 23:29 ` [PATCH 62/62] sysfs: fix for thinko with sysfs_bin_attr_init() Greg Kroah-Hartman
  2010-03-08 14:12 ` [GIT PATCH] driver core patches for 2.6.33-git Greg KH
  60 siblings, 1 reply; 90+ messages in thread
From: Greg Kroah-Hartman @ 2010-03-02 23:29 UTC (permalink / raw)
  To: linux-kernel
  Cc: Randy Dunlap, Lennart Poettering, Lee, Chun-Yi, Andrew Morton,
	Greg Kroah-Hartman

From: Randy Dunlap <randy.dunlap@oracle.com>

msi-laptop uses rfkill*() interfaces so it should depend on RFKILL.

msi-laptop.c:(.text+0x1fcd1b): undefined reference to `rfkill_alloc'
msi-laptop.c:(.text+0x1fcd76): undefined reference to `rfkill_register'
msi-laptop.c:(.text+0x1fcdc8): undefined reference to `rfkill_destroy'
msi-laptop.c:(.text+0x1fcdd9): undefined reference to `rfkill_unregister'

This repairs "msi-laptop: Detect 3G device exists by standard ec command",
which is in some gregkh tree.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Lennart Poettering <mzxreary@0pointer.de>
Cc: Lee, Chun-Yi <jlee@novell.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/platform/x86/Kconfig |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
index 6848f21..d911de3 100644
--- a/drivers/platform/x86/Kconfig
+++ b/drivers/platform/x86/Kconfig
@@ -148,6 +148,7 @@ config MSI_LAPTOP
 	tristate "MSI Laptop Extras"
 	depends on ACPI
 	depends on BACKLIGHT_CLASS_DEVICE
+	depends on RFKILL
 	---help---
 	  This is a driver for laptops built by MSI (MICRO-STAR
 	  INTERNATIONAL):
-- 
1.7.0.1


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

* [PATCH 62/62] sysfs: fix for thinko with sysfs_bin_attr_init()
  2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
                   ` (58 preceding siblings ...)
  2010-03-02 23:29 ` [PATCH 61/62] msi-laptop: depends on RFKILL Greg Kroah-Hartman
@ 2010-03-02 23:29 ` Greg Kroah-Hartman
  2010-03-08 14:12 ` [GIT PATCH] driver core patches for 2.6.33-git Greg KH
  60 siblings, 0 replies; 90+ messages in thread
From: Greg Kroah-Hartman @ 2010-03-02 23:29 UTC (permalink / raw)
  To: linux-kernel; +Cc: Stephen Rothwell, Eric W. Biederman, Greg Kroah-Hartman

From: Stephen Rothwell <sfr@canb.auug.org.au>

After merging the final tree, today's linux-next build (powerpc
allyesconfig) failed like this:

drivers/pci/pci-sysfs.c: In function 'pci_create_legacy_files':
drivers/pci/pci-sysfs.c:645: error: lvalue required as unary '&' operand
drivers/pci/pci-sysfs.c:658: error: lvalue required as unary '&' operand

Caused by commit "sysfs: Use sysfs_attr_init and sysfs_bin_attr_init on
dynamic attributes" interacting with commit "sysfs: Use one lockdep
class per sysfs attribute") both from the driver-core tree.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
---
 drivers/pci/pci-sysfs.c |    4 ++--
 include/linux/sysfs.h   |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
index 9fa183c..de29645 100644
--- a/drivers/pci/pci-sysfs.c
+++ b/drivers/pci/pci-sysfs.c
@@ -642,7 +642,7 @@ void pci_create_legacy_files(struct pci_bus *b)
 	if (!b->legacy_io)
 		goto kzalloc_err;
 
-	sysfs_bin_attr_init(&b->legacy_io);
+	sysfs_bin_attr_init(b->legacy_io);
 	b->legacy_io->attr.name = "legacy_io";
 	b->legacy_io->size = 0xffff;
 	b->legacy_io->attr.mode = S_IRUSR | S_IWUSR;
@@ -655,7 +655,7 @@ void pci_create_legacy_files(struct pci_bus *b)
 		goto legacy_io_err;
 
 	/* Allocated above after the legacy_io struct */
-	sysfs_bin_attr_init(&b->legacy_mem);
+	sysfs_bin_attr_init(b->legacy_mem);
 	b->legacy_mem = b->legacy_io + 1;
 	b->legacy_mem->attr.name = "legacy_mem";
 	b->legacy_mem->size = 1024*1024;
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
index d77cde6..f0496b3 100644
--- a/include/linux/sysfs.h
+++ b/include/linux/sysfs.h
@@ -110,7 +110,7 @@ struct bin_attribute {
  *	enabled.  Lockdep gives a nice error when your attribute is
  *	added to sysfs if you don't have this.
  */
-#define sysfs_bin_attr_init(bin_attr) sysfs_attr_init(&bin_attr->attr)
+#define sysfs_bin_attr_init(bin_attr) sysfs_attr_init(&(bin_attr)->attr)
 
 struct sysfs_ops {
 	ssize_t	(*show)(struct kobject *, struct attribute *,char *);
-- 
1.7.0.1


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

* Re: [PATCH 57/62] msi-laptop: Add threeg sysfs file for support query 3G state by standard 66/62 ec command
  2010-03-02 23:28 ` [PATCH 57/62] msi-laptop: Add threeg sysfs file for support query 3G state by standard 66/62 ec command Greg Kroah-Hartman
@ 2010-03-02 23:36   ` Matthew Garrett
  2010-03-02 23:47     ` Greg KH
  0 siblings, 1 reply; 90+ messages in thread
From: Matthew Garrett @ 2010-03-02 23:36 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-kernel, Lee, Chun-Yi, Lennart Poettering

On Tue, Mar 02, 2010 at 03:28:56PM -0800, Greg Kroah-Hartman wrote:

> Add threeg sysfs file for support query 3G state by standard 66/62 ec
> command, the MSI standard ec interface supported this feature.

No. Just use the rfkill interface.

-- 
Matthew Garrett | mjg59@srcf.ucam.org

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

* Re: [PATCH 58/62] msi-laptop: Support some MSI 3G netbook that is need load SCM
  2010-03-02 23:28 ` [PATCH 58/62] msi-laptop: Support some MSI 3G netbook that is need load SCM Greg Kroah-Hartman
@ 2010-03-02 23:39   ` Matthew Garrett
  2010-03-02 23:46     ` Greg KH
  0 siblings, 1 reply; 90+ messages in thread
From: Matthew Garrett @ 2010-03-02 23:39 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-kernel, Lee, Chun-Yi, Lennart Poettering

On Tue, Mar 02, 2010 at 03:28:57PM -0800, Greg Kroah-Hartman wrote:
> From: Lee, Chun-Yi <jlee@novell.com>
> 
> Some MSI 3G netbook only have one fn key to control Wlan/Bluetooth/3G,
> those netbook will load the SCM (windows app) to disable the original
> Wlan/Bluetooth control by BIOS when user press fn key, then control
> Wlan/Bluetooth/3G by SCM (software control by OS). Without SCM, user
> cann't on/off 3G module on those 3G netbook.
> On Linux, msi-laptop driver will do the same thing to disable the
> original BIOS control, then might need use HAL or other userland
> application to do the software control that simulate with SCM.
> e.g. MSI N034 netbook

How does the function key event get reported to userland? This should 
generate KEY_RFKILL and then just go through rfkill-input.

-- 
Matthew Garrett | mjg59@srcf.ucam.org

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

* Re: [PATCH 56/62] msi-laptop: Support standard ec 66/62 command on MSI notebook and nebook
  2010-03-02 23:28 ` [PATCH 56/62] msi-laptop: Support standard ec 66/62 command on MSI notebook and nebook Greg Kroah-Hartman
@ 2010-03-02 23:42   ` Matthew Garrett
  2010-03-02 23:58     ` Greg KH
  0 siblings, 1 reply; 90+ messages in thread
From: Matthew Garrett @ 2010-03-02 23:42 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-kernel, Lee, Chun-Yi, Lennart Poettering

On Tue, Mar 02, 2010 at 03:28:55PM -0800, Greg Kroah-Hartman wrote:
> From: Lee, Chun-Yi <jlee@novell.com>
> 
> Suppport standard ec 66/62 command on MSI notebook and nebook. MSI
> netbook and notebook already support 66/62 command, so, add new
> get_state function, and put the old model to non-standard model, but
> driver still support those old model.
> 
> Signed-off-by: Lee, Chun-Yi <jlee@novell.com>
> Cc: Lennart Poettering <mzxreary@0pointer.de>
> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
ACKed-by: Matthew Garrett <mjg@redhat.com>

Greg, could you send x86 platform drivers patches via me from now on? 
There's some stuff in this patchset that isn't sane.
-- 
Matthew Garrett | mjg59@srcf.ucam.org

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

* Re: [PATCH 58/62] msi-laptop: Support some MSI 3G netbook that is need load SCM
  2010-03-02 23:39   ` Matthew Garrett
@ 2010-03-02 23:46     ` Greg KH
  0 siblings, 0 replies; 90+ messages in thread
From: Greg KH @ 2010-03-02 23:46 UTC (permalink / raw)
  To: Matthew Garrett; +Cc: linux-kernel, Lee, Chun-Yi, Lennart Poettering

On Tue, Mar 02, 2010 at 11:39:29PM +0000, Matthew Garrett wrote:
> On Tue, Mar 02, 2010 at 03:28:57PM -0800, Greg Kroah-Hartman wrote:
> > From: Lee, Chun-Yi <jlee@novell.com>
> > 
> > Some MSI 3G netbook only have one fn key to control Wlan/Bluetooth/3G,
> > those netbook will load the SCM (windows app) to disable the original
> > Wlan/Bluetooth control by BIOS when user press fn key, then control
> > Wlan/Bluetooth/3G by SCM (software control by OS). Without SCM, user
> > cann't on/off 3G module on those 3G netbook.
> > On Linux, msi-laptop driver will do the same thing to disable the
> > original BIOS control, then might need use HAL or other userland
> > application to do the software control that simulate with SCM.
> > e.g. MSI N034 netbook
> 
> How does the function key event get reported to userland? This should 
> generate KEY_RFKILL and then just go through rfkill-input.

I'm pretty sure that Joey is using rfkill here, but I didn't realize
that it also supported an input device.

This code is just detecting the keypress, and acting on it, I think,
right Joey?  Isn't that the way this is supposed to work?  Or is it
supposed to use rfkill-input, which then userspace turns around and
calls the other rfkill interface to then disable the wireless?  If so, I
think a number of laptop drivers need to be changed to do this.

thanks,

greg k-h

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

* Re: [PATCH 57/62] msi-laptop: Add threeg sysfs file for support query 3G state by standard 66/62 ec command
  2010-03-02 23:36   ` Matthew Garrett
@ 2010-03-02 23:47     ` Greg KH
  2010-03-03 13:46       ` Matthew Garrett
  0 siblings, 1 reply; 90+ messages in thread
From: Greg KH @ 2010-03-02 23:47 UTC (permalink / raw)
  To: Matthew Garrett; +Cc: linux-kernel, Lee, Chun-Yi, Lennart Poettering

On Tue, Mar 02, 2010 at 11:36:16PM +0000, Matthew Garrett wrote:
> On Tue, Mar 02, 2010 at 03:28:56PM -0800, Greg Kroah-Hartman wrote:
> 
> > Add threeg sysfs file for support query 3G state by standard 66/62 ec
> > command, the MSI standard ec interface supported this feature.
> 
> No. Just use the rfkill interface.

Does rfkill support 3G?  I thought it was only for wireless (80211)
stuff.

thanks,

greg k-h

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

* Re: [PATCH 56/62] msi-laptop: Support standard ec 66/62 command on MSI notebook and nebook
  2010-03-02 23:42   ` Matthew Garrett
@ 2010-03-02 23:58     ` Greg KH
  2010-03-03 13:47       ` Matthew Garrett
  0 siblings, 1 reply; 90+ messages in thread
From: Greg KH @ 2010-03-02 23:58 UTC (permalink / raw)
  To: Matthew Garrett; +Cc: linux-kernel, Lee, Chun-Yi, Lennart Poettering

On Tue, Mar 02, 2010 at 11:42:19PM +0000, Matthew Garrett wrote:
> On Tue, Mar 02, 2010 at 03:28:55PM -0800, Greg Kroah-Hartman wrote:
> > From: Lee, Chun-Yi <jlee@novell.com>
> > 
> > Suppport standard ec 66/62 command on MSI notebook and nebook. MSI
> > netbook and notebook already support 66/62 command, so, add new
> > get_state function, and put the old model to non-standard model, but
> > driver still support those old model.
> > 
> > Signed-off-by: Lee, Chun-Yi <jlee@novell.com>
> > Cc: Lennart Poettering <mzxreary@0pointer.de>
> > Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
> ACKed-by: Matthew Garrett <mjg@redhat.com>
> 
> Greg, could you send x86 platform drivers patches via me from now on? 
> There's some stuff in this patchset that isn't sane.

Ok, will do, you might want to update the MAINTAINERS file, as I just
went with the information in there, and what the get_maintainers.pl
script found by looking at the git history.

thanks,

greg k-h

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

* Re: [PATCH 42/62] sysfs: Remove sysfs_get/put_active_two
  2010-03-02 23:28 ` [PATCH 42/62] sysfs: Remove sysfs_get/put_active_two Greg Kroah-Hartman
@ 2010-03-03  1:34   ` Tejun Heo
  0 siblings, 0 replies; 90+ messages in thread
From: Tejun Heo @ 2010-03-03  1:34 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-kernel, Eric W. Biederman

Hello, Eric.

On 03/03/2010 08:28 AM, Greg Kroah-Hartman wrote:
> From: Eric W. Biederman <ebiederm@xmission.com>
> 
> It turns out that holding an active reference on a directory is
> pointless.  The purpose of the active references are to allows us to
> block when removing sysfs entries that have custom methods so we don't
> remove modules while running modular code and to keep those custom
> methods from accessing data structures after the files have been
> removed.

It's not only the method code but dynamic data structures or even the
actual hardware.

> Further sysfs_remove_dir remove all elements in the
> directory before removing the directory itself, so there is no chance
> we will remove a directory with active children.
> 
> Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
> Cc: Tejun Heo <tj@kernel.org>
> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

Sans the patch description, Acked-by: Tejun Heo <tj@kernel.org>

-- 
tejun

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

* Re: [PATCH 43/62] sysfs: Only take active references on attributes.
  2010-03-02 23:28 ` [PATCH 43/62] sysfs: Only take active references on attributes Greg Kroah-Hartman
@ 2010-03-03  1:36   ` Tejun Heo
  0 siblings, 0 replies; 90+ messages in thread
From: Tejun Heo @ 2010-03-03  1:36 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-kernel, Eric W. Biederman

On 03/03/2010 08:28 AM, Greg Kroah-Hartman wrote:
> From: Eric W. Biederman <ebiederm@xmission.com>
> 
> If we exclude directories and symlinks from the set of sysfs
> dirents where we need active references we are left with
> sysfs attributes (binary or not).
> 
> - Tweak sysfs_deactivate to only do something on attributes
> - Move lockdep initialization into sysfs_file_add_mode to
>   limit it to just attributes.
> 
> Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
> Acked-by: WANG Cong <xiyou.wangcong@gmail.com>
> Cc: Tejun Heo <tj@kernel.org>
> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

Acked-by: Tejun Heo <tj@kernel.org>

-- 
tejun

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

* Re: [PATCH 44/62] sysfs: Use one lockdep class per sysfs attribute.
  2010-03-02 23:28 ` [PATCH 44/62] sysfs: Use one lockdep class per sysfs attribute Greg Kroah-Hartman
@ 2010-03-03  1:41   ` Tejun Heo
  0 siblings, 0 replies; 90+ messages in thread
From: Tejun Heo @ 2010-03-03  1:41 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-kernel, Eric W. Biederman

On 03/03/2010 08:28 AM, Greg Kroah-Hartman wrote:
> From: Eric W. Biederman <ebiederm@xmission.com>
> 
> Acknowledge that the logical sysfs rwsem has one instance per
> sysfs attribute with different locking depencencies for different
> attributes.
> 
> There is a sysfs idiom where writing to one sysfs file causes the
> addition or removal of other sysfs files.   Lumping all of the
> sysfs attributes together in one lock class causes lockdep to
> generate lots of false positives.
> 
> This introduces the requirement that non-static sysfs attributes
> need to be initialized with sysfs_attr_init or sysfs_bin_attr_init.
> Strictly speaking this requirement only exists when lockdep is
> enabled, and when lockdep is enabled we get a bit fat warning
> if this requirement is not met.
> 
> Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
> Acked-by: WANG Cong <xiyou.wangcong@gmail.com>
> Cc: Tejun Heo <tj@kernel.org>
> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

Acked-by: Tejun Heo <tj@kernel.org> but it would be nice if when and
how attr->key is set for each case and how it's supposed to trigger
big fat warning in the code.  It's a bit difficult to follow
currently.

-- 
tejun

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

* Re: [PATCH 45/62] sysfs: Use sysfs_attr_init and sysfs_bin_attr_init on dynamic attributes
  2010-03-02 23:28 ` [PATCH 45/62] sysfs: Use sysfs_attr_init and sysfs_bin_attr_init on dynamic attributes Greg Kroah-Hartman
@ 2010-03-03  1:41   ` Tejun Heo
  0 siblings, 0 replies; 90+ messages in thread
From: Tejun Heo @ 2010-03-03  1:41 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-kernel, Eric W. Biederman

On 03/03/2010 08:28 AM, Greg Kroah-Hartman wrote:
> From: Eric W. Biederman <ebiederm@xmission.com>
> 
> These are the non-static sysfs attributes that exist on
> my test machine.  Fix them to use sysfs_attr_init or
> sysfs_bin_attr_init as appropriate.   It simply requires
> making a sysfs attribute present to see this.  So this
> is a little bit tedious but otherwise not too bad.
> 
> Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
> Acked-by: WANG Cong <xiyou.wangcong@gmail.com>
> Cc: Tejun Heo <tj@kernel.org>
> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

Acked-by: Tejun Heo <tj@kernel.org>

Thanks.

-- 
tejun

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

* Re: [PATCH 19/62] Driver-Core: devtmpfs - remove EXPERIMENTAL and enable it by default
  2010-03-02 23:28 ` [PATCH 19/62] Driver-Core: devtmpfs - remove EXPERIMENTAL and enable it by default Greg Kroah-Hartman
@ 2010-03-03  4:38   ` Eric W. Biederman
  2010-03-03 16:46     ` Linus Torvalds
  0 siblings, 1 reply; 90+ messages in thread
From: Eric W. Biederman @ 2010-03-03  4:38 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Linus Torvalds; +Cc: linux-kernel, Kay Sievers

Greg Kroah-Hartman <gregkh@suse.de> writes:

> From: Kay Sievers <kay.sievers@vrfy.org>
>
> All major distros enable devtmpfs on recent systems, so remove
> the EXPERIMENTAL flag, and enable it by default to reflect how it
> is used today.

Default y?

Default y is the wrong thing for DEVTMPFS_MOUNT.  It changes the
userspace semantics so I can't see how this is safe in the general
case.

I also looked and the most recent bleeding edge distro I have fedora
core 12 doesn't even compile in devtmpfs so this extraordinary claim
that all major distros are using devtmpfs is far from true today.  It
is certainly rare enough that changing there is not yet justification
for changing the default.

Eric

>
> Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
> ---
>  drivers/base/Kconfig |   45 ++++++++++++++++++++++++++++-----------------
>  1 files changed, 28 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/base/Kconfig b/drivers/base/Kconfig
> index ee37727..8497ce9 100644
> --- a/drivers/base/Kconfig
> +++ b/drivers/base/Kconfig
> @@ -9,29 +9,40 @@ config UEVENT_HELPER_PATH
>  	  every uevent.
>  
>  config DEVTMPFS
> -	bool "Create a kernel maintained /dev tmpfs (EXPERIMENTAL)"
> +	bool "Maintain a devtmpfs filesystem to mount at /dev"
>  	depends on HOTPLUG && SHMEM && TMPFS
> +	default y
>  	help
> -	  This creates a tmpfs filesystem, and mounts it at bootup
> -	  and mounts it at /dev. The kernel driver core creates device
> -	  nodes for all registered devices in that filesystem. All device
> -	  nodes are owned by root and have the default mode of 0600.
> -	  Userspace can add and delete the nodes as needed. This is
> -	  intended to simplify bootup, and make it possible to delay
> -	  the initial coldplug at bootup done by udev in userspace.
> -	  It should also provide a simpler way for rescue systems
> -	  to bring up a kernel with dynamic major/minor numbers.
> -	  Meaningful symlinks, permissions and device ownership must
> -	  still be handled by userspace.
> -	  If unsure, say N here.
> +	  This creates a tmpfs filesystem instance early at bootup.
> +	  In this filesystem, the kernel driver core maintains device
> +	  nodes with their default names and permissions for all
> +	  registered devices with an assigned major/minor number.
> +	  Userspace can modify the filesystem content as needed, add
> +	  symlinks, and apply needed permissions.
> +	  It provides a fully functional /dev directory, where usually
> +	  udev runs on top, managing permissions and adding meaningful
> +	  symlinks.
> +	  In very limited environments, it may provide a sufficient
> +	  functional /dev without any further help. It also allows simple
> +	  rescue systems, and reliably handles dynamic major/minor numbers.
> +	  If unsure, say Y here.
>  
>  config DEVTMPFS_MOUNT
> -	bool "Automount devtmpfs at /dev"
> +	bool "Automount devtmpfs at /dev, after the kernel mounted the rootfs"
>  	depends on DEVTMPFS
> +	default y
>  	help
> -	  This will mount devtmpfs at /dev if the kernel mounts the root
> -	  filesystem. It will not affect initramfs based mounting.
> -	  If unsure, say N here.
> +	  This will instruct the kernel to automatically mount the
> +	  devtmpfs filesystem at /dev, directly after the kernel has
> +	  mounted the root filesystem. The behavior can be overridden
> +	  with the commandline parameter: devtmpfs.mount=0|1.
> +	  This option does not affect initramfs based booting, here
> +	  the devtmpfs filesystem always needs to be mounted manually
> +	  after the roots is mounted.
> +	  With this option enabled, it allows to bring up a system in
> +	  rescue mode with init=/bin/sh, even when the /dev directory
> +	  on the rootfs is completely empty.
> +	  If unsure, say Y here.
>  
>  config STANDALONE
>  	bool "Select only drivers that don't need compile-time external firmware" if EXPERIMENTAL
> -- 
> 1.7.0.1
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/

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

* Re: [PATCH 61/62] msi-laptop: depends on RFKILL
  2010-03-02 23:29 ` [PATCH 61/62] msi-laptop: depends on RFKILL Greg Kroah-Hartman
@ 2010-03-03  6:09   ` Dmitry Torokhov
  2010-03-03 21:23     ` Greg KH
  0 siblings, 1 reply; 90+ messages in thread
From: Dmitry Torokhov @ 2010-03-03  6:09 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: linux-kernel, Randy Dunlap, Lennart Poettering, Lee, Chun-Yi,
	Andrew Morton

On Tue, Mar 02, 2010 at 03:29:00PM -0800, Greg Kroah-Hartman wrote:
> From: Randy Dunlap <randy.dunlap@oracle.com>
> 
> msi-laptop uses rfkill*() interfaces so it should depend on RFKILL.
> 
> msi-laptop.c:(.text+0x1fcd1b): undefined reference to `rfkill_alloc'
> msi-laptop.c:(.text+0x1fcd76): undefined reference to `rfkill_register'
> msi-laptop.c:(.text+0x1fcdc8): undefined reference to `rfkill_destroy'
> msi-laptop.c:(.text+0x1fcdd9): undefined reference to `rfkill_unregister'
> 
> This repairs "msi-laptop: Detect 3G device exists by standard ec command",
> which is in some gregkh tree.
> 
> Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
> Cc: Lennart Poettering <mzxreary@0pointer.de>
> Cc: Lee, Chun-Yi <jlee@novell.com>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
> ---
>  drivers/platform/x86/Kconfig |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
> 
> diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
> index 6848f21..d911de3 100644
> --- a/drivers/platform/x86/Kconfig
> +++ b/drivers/platform/x86/Kconfig
> @@ -148,6 +148,7 @@ config MSI_LAPTOP
>  	tristate "MSI Laptop Extras"
>  	depends on ACPI
>  	depends on BACKLIGHT_CLASS_DEVICE
> +	depends on RFKILL

I must say I really dislike when "depends" is used with drivers like
this for high-level subsystems. How would a user (advanced, I agree)
know about existence of such a driver when doing make oldconfig unless
he examines entirety of the pull (new rc patch, tarball, whatever)? And
even if he is aware of the new driver he needs to know exact config name
to see the dependencies (even if he knows how)...

We all know dangers of "select" but I think it is useful when used
judiciously, for entire subsystems only (like selecting serio,
backlight, leds, etc) that do not have additional dependencies.

Thanks.

-- 
Dmitry

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

* Re: [PATCH 57/62] msi-laptop: Add threeg sysfs file for support query 3G state by standard 66/62 ec command
  2010-03-02 23:47     ` Greg KH
@ 2010-03-03 13:46       ` Matthew Garrett
  0 siblings, 0 replies; 90+ messages in thread
From: Matthew Garrett @ 2010-03-03 13:46 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel, Lee, Chun-Yi, Lennart Poettering

On Tue, Mar 02, 2010 at 03:47:00PM -0800, Greg KH wrote:
> On Tue, Mar 02, 2010 at 11:36:16PM +0000, Matthew Garrett wrote:
> > On Tue, Mar 02, 2010 at 03:28:56PM -0800, Greg Kroah-Hartman wrote:
> > 
> > > Add threeg sysfs file for support query 3G state by standard 66/62 ec
> > > command, the MSI standard ec interface supported this feature.
> > 
> > No. Just use the rfkill interface.
> 
> Does rfkill support 3G?  I thought it was only for wireless (80211)
> stuff.

rfkill has types for the majority of radios. A later patch adds the 3g 
rfkill device, so this one should just be dropped - there's no reason to 
add a non-standard radio control file now.

-- 
Matthew Garrett | mjg59@srcf.ucam.org

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

* Re: [PATCH 56/62] msi-laptop: Support standard ec 66/62 command on MSI notebook and nebook
  2010-03-02 23:58     ` Greg KH
@ 2010-03-03 13:47       ` Matthew Garrett
  0 siblings, 0 replies; 90+ messages in thread
From: Matthew Garrett @ 2010-03-03 13:47 UTC (permalink / raw)
  To: Greg KH; +Cc: linux-kernel, Lee, Chun-Yi, Lennart Poettering

On Tue, Mar 02, 2010 at 03:58:04PM -0800, Greg KH wrote:

> Ok, will do, you might want to update the MAINTAINERS file, as I just
> went with the information in there, and what the get_maintainers.pl
> script found by looking at the git history.

You probably grabbed it just before MAINTAINERS was updated :)

-- 
Matthew Garrett | mjg59@srcf.ucam.org

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

* Re: [PATCH 19/62] Driver-Core: devtmpfs - remove EXPERIMENTAL and enable it by default
  2010-03-03  4:38   ` Eric W. Biederman
@ 2010-03-03 16:46     ` Linus Torvalds
  2010-03-03 20:03       ` Kay Sievers
  2010-03-03 21:22       ` Greg KH
  0 siblings, 2 replies; 90+ messages in thread
From: Linus Torvalds @ 2010-03-03 16:46 UTC (permalink / raw)
  To: Eric W. Biederman; +Cc: Greg Kroah-Hartman, linux-kernel, Kay Sievers



On Tue, 2 Mar 2010, Eric W. Biederman wrote:

> Greg Kroah-Hartman <gregkh@suse.de> writes:
>> 
> > From: Kay Sievers <kay.sievers@vrfy.org>
> >
> > All major distros enable devtmpfs on recent systems, so remove
> > the EXPERIMENTAL flag, and enable it by default to reflect how it
> > is used today.
> 
> Default y?
> 
> Default y is the wrong thing for DEVTMPFS_MOUNT.  It changes the
> userspace semantics so I can't see how this is safe in the general
> case.
> 
> I also looked and the most recent bleeding edge distro I have fedora
> core 12 doesn't even compile in devtmpfs so this extraordinary claim
> that all major distros are using devtmpfs is far from true today.  It
> is certainly rare enough that changing there is not yet justification
> for changing the default.

Yeah, this justification is pure and utter sh*t.

We don't just randomly move it from EXPERIMENTAL to make it 'default y'.

In fact, as mentioned yesterday in an unrelated thread, we NEVER make 
something 'default y' unless it is required to maintain _old_ semantics 
(ie some config option that is required for previous behavior to be true), 
or unless it cures cancer.

Guys, I'll say it one more time: developers always feel that _their_ 
particular code is so important that it needs to be 'default y', because 
obviously their code must be used by everybody.

But that is pure and utter CRAP.

Something like the core input layer might be 'default y' because quite 
frankly, for 99% of users, if you don't enable it, the machine is useless. 
And the original keyboard driver used to be compiled in without question. 
And people who really don't want the input layer really _are_ special.

But some random new feature that nobody actually uses, has no legacy 
reasons? Nope. It's simply not 'default y' material.

So I'm not going to pull this crap. People need to learn that 'default y' 
is just WRONG.

Greg, please shut down people like Kay that want to enable something by 
default. We want a _minimal_  working config, not a maximal. If somebody 
has a distro that needs this, they can enable it _then_. Not "let's try to 
make people enable it whether they need it or not, because they _might_".

Because "might need it" is simply not good enough. A "must have" is the 
only reason to do 'default y'.

		Linus

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

* Re: [PATCH 19/62] Driver-Core: devtmpfs - remove EXPERIMENTAL and  enable it by default
  2010-03-03 16:46     ` Linus Torvalds
@ 2010-03-03 20:03       ` Kay Sievers
  2010-03-03 20:21         ` Eric W. Biederman
  2010-03-03 21:22       ` Greg KH
  1 sibling, 1 reply; 90+ messages in thread
From: Kay Sievers @ 2010-03-03 20:03 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Eric W. Biederman, Greg Kroah-Hartman, linux-kernel

On Wed, Mar 3, 2010 at 06:46, Linus Torvalds
<torvalds@linux-foundation.org> wrote:
> Greg, please shut down people like Kay that want to enable something by
> default. We want a _minimal_  working config, not a maximal. If somebody
> has a distro that needs this, they can enable it _then_. Not "let's try to
> make people enable it whether they need it or not, because they _might_".
>
> Because "might need it" is simply not good enough. A "must have" is the
> only reason to do 'default y'.

No problem, if that's he rule, then let's drop the "y".  I always
understood the defaults as the "usually needed to bring up a box"
setting. We had this discussion already with Arjan who stated the same
as you, but we kid of missed to take action on that, sorry.

For the "must have", we will not be able to bootup the upcoming Ubuntu
and openSUSE development distros without it, not sure about Fedora,
the support is there, but it might still work without it. Some smaller
distros also already depend on it.

Thanks,
Kay

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

* Re: [PATCH 19/62] Driver-Core: devtmpfs - remove EXPERIMENTAL and  enable it by default
  2010-03-03 20:03       ` Kay Sievers
@ 2010-03-03 20:21         ` Eric W. Biederman
  2010-03-03 22:01           ` Kay Sievers
  0 siblings, 1 reply; 90+ messages in thread
From: Eric W. Biederman @ 2010-03-03 20:21 UTC (permalink / raw)
  To: Kay Sievers; +Cc: Linus Torvalds, Greg Kroah-Hartman, linux-kernel

Kay Sievers <kay.sievers@vrfy.org> writes:

> On Wed, Mar 3, 2010 at 06:46, Linus Torvalds
> <torvalds@linux-foundation.org> wrote:
>> Greg, please shut down people like Kay that want to enable something by
>> default. We want a _minimal_  working config, not a maximal. If somebody
>> has a distro that needs this, they can enable it _then_. Not "let's try to
>> make people enable it whether they need it or not, because they _might_".
>>
>> Because "might need it" is simply not good enough. A "must have" is the
>> only reason to do 'default y'.
>
> No problem, if that's he rule, then let's drop the "y".  I always
> understood the defaults as the "usually needed to bring up a box"
> setting. We had this discussion already with Arjan who stated the same
> as you, but we kid of missed to take action on that, sorry.
>
> For the "must have", we will not be able to bootup the upcoming Ubuntu
> and openSUSE development distros without it, not sure about Fedora,
> the support is there, but it might still work without it. Some smaller
> distros also already depend on it.

Is this a case of the initial ramdisks won't work, or have you removed
support from udev to create device nodes?

Eric

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

* Re: [PATCH 19/62] Driver-Core: devtmpfs - remove EXPERIMENTAL and enable it by default
  2010-03-03 16:46     ` Linus Torvalds
  2010-03-03 20:03       ` Kay Sievers
@ 2010-03-03 21:22       ` Greg KH
  2010-03-03 21:48         ` Linus Torvalds
  1 sibling, 1 reply; 90+ messages in thread
From: Greg KH @ 2010-03-03 21:22 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Eric W. Biederman, linux-kernel, Kay Sievers

On Wed, Mar 03, 2010 at 08:46:54AM -0800, Linus Torvalds wrote:
> Greg, please shut down people like Kay that want to enable something by 
> default. We want a _minimal_  working config, not a maximal. If somebody 
> has a distro that needs this, they can enable it _then_. Not "let's try to 
> make people enable it whether they need it or not, because they _might_".

Ok, I'll change this.  Do you want me to redo the whole series, or just
add another patch to revert the 'default y' option here?

thanks,

greg k-h

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

* Re: [PATCH 61/62] msi-laptop: depends on RFKILL
  2010-03-03  6:09   ` Dmitry Torokhov
@ 2010-03-03 21:23     ` Greg KH
  0 siblings, 0 replies; 90+ messages in thread
From: Greg KH @ 2010-03-03 21:23 UTC (permalink / raw)
  To: Dmitry Torokhov
  Cc: linux-kernel, Randy Dunlap, Lennart Poettering, Lee, Chun-Yi,
	Andrew Morton

On Tue, Mar 02, 2010 at 10:09:56PM -0800, Dmitry Torokhov wrote:
> On Tue, Mar 02, 2010 at 03:29:00PM -0800, Greg Kroah-Hartman wrote:
> > From: Randy Dunlap <randy.dunlap@oracle.com>
> > 
> > msi-laptop uses rfkill*() interfaces so it should depend on RFKILL.
> > 
> > msi-laptop.c:(.text+0x1fcd1b): undefined reference to `rfkill_alloc'
> > msi-laptop.c:(.text+0x1fcd76): undefined reference to `rfkill_register'
> > msi-laptop.c:(.text+0x1fcdc8): undefined reference to `rfkill_destroy'
> > msi-laptop.c:(.text+0x1fcdd9): undefined reference to `rfkill_unregister'
> > 
> > This repairs "msi-laptop: Detect 3G device exists by standard ec command",
> > which is in some gregkh tree.
> > 
> > Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
> > Cc: Lennart Poettering <mzxreary@0pointer.de>
> > Cc: Lee, Chun-Yi <jlee@novell.com>
> > Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> > Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
> > ---
> >  drivers/platform/x86/Kconfig |    1 +
> >  1 files changed, 1 insertions(+), 0 deletions(-)
> > 
> > diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
> > index 6848f21..d911de3 100644
> > --- a/drivers/platform/x86/Kconfig
> > +++ b/drivers/platform/x86/Kconfig
> > @@ -148,6 +148,7 @@ config MSI_LAPTOP
> >  	tristate "MSI Laptop Extras"
> >  	depends on ACPI
> >  	depends on BACKLIGHT_CLASS_DEVICE
> > +	depends on RFKILL
> 
> I must say I really dislike when "depends" is used with drivers like
> this for high-level subsystems. How would a user (advanced, I agree)
> know about existence of such a driver when doing make oldconfig unless
> he examines entirety of the pull (new rc patch, tarball, whatever)? And
> even if he is aware of the new driver he needs to know exact config name
> to see the dependencies (even if he knows how)...
> 
> We all know dangers of "select" but I think it is useful when used
> judiciously, for entire subsystems only (like selecting serio,
> backlight, leds, etc) that do not have additional dependencies.

Yeah, it is an issue, but without using 'select', one that we have to
live with for now.

thanks,

greg k-h

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

* Re: [PATCH 19/62] Driver-Core: devtmpfs - remove EXPERIMENTAL and enable it by default
  2010-03-03 21:22       ` Greg KH
@ 2010-03-03 21:48         ` Linus Torvalds
  2010-03-03 22:04           ` Greg KH
  0 siblings, 1 reply; 90+ messages in thread
From: Linus Torvalds @ 2010-03-03 21:48 UTC (permalink / raw)
  To: Greg KH; +Cc: Eric W. Biederman, linux-kernel, Kay Sievers



On Wed, 3 Mar 2010, Greg KH wrote:
> 
> Ok, I'll change this.  Do you want me to redo the whole series, or just
> add another patch to revert the 'default y' option here?

I'm ok with just changing the default. I wanted to make a stink over it 
just to make people aware that we already have kernels too big by default, 
and we shouldn't change the default semantics of making a config without 
some major reasons.

Btw, I do think that when you do pull requests during the merge window, 
you should seriously think about basing them on top of some known-stable 
kernel (ie the previous release) rather than some random 
kernel-of-the-day like you seem to.

It's much easier to bisect problems if you'er not fighting multiple 
overlapping bugs, for example - and since you move from quilt to git 
apparently just based on whatever was the most recent git tree when you do 
that move, it really means that in case the kernel you picked was 
unstable, it's going to be a _bitch_ to bisect any problems introduced in 
your series.

Why? Say that the base you picked happened to simply not boot at all (or 
had something like the PCI problem that I encountered that made X not run 
on my machine) for somebody. Now _all_ those commits you did in that 
series are going to be essentially untestable on such a machine - and 
think about what happens if the problem happens mainly on the same 
machines that had the other bug too?

Anyway, I don't know whether you picked a good spot to do your series or 
not, but it _looked_ like a pretty random spot. It might be perfectly 
good. But just in general, since you always generate your trees from a 
quilt series anyway, I suspect we migth be better off (at least for the 
initial merge window series) to base them on the closest thing we have to 
a "known good" base, namely the previous release. Rather than some "maybe 
fine" point in the middle of the merge window.

			Linus

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

* Re: [PATCH 19/62] Driver-Core: devtmpfs - remove EXPERIMENTAL and  enable it by default
  2010-03-03 20:21         ` Eric W. Biederman
@ 2010-03-03 22:01           ` Kay Sievers
  0 siblings, 0 replies; 90+ messages in thread
From: Kay Sievers @ 2010-03-03 22:01 UTC (permalink / raw)
  To: Eric W. Biederman; +Cc: Linus Torvalds, Greg Kroah-Hartman, linux-kernel

On Wed, Mar 3, 2010 at 10:21, Eric W. Biederman <ebiederm@xmission.com> wrote:
> Kay Sievers <kay.sievers@vrfy.org> writes:
>> For the "must have", we will not be able to bootup the upcoming Ubuntu
>> and openSUSE development distros without it, not sure about Fedora,
>> the support is there, but it might still work without it. Some smaller
>> distros also already depend on it.
>
> Is this a case of the initial ramdisks won't work, or have you removed
> support from udev to create device nodes?

Udev has not changed, it still works without any kernel-created nodes,
as it always did.

It's the distro-specific system coldplug/bootstrap logic that got
simplified with the kernel device-node support. There is more pending,
which will take the advantage of not needing to synchronize some
steps, like it was needed the former asynchronous device-node-creation
behavior. It affects initramfs and kernel-mounted rootfs setups, both
now expect devtmpfs to be available.

Kay

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

* Re: [PATCH 19/62] Driver-Core: devtmpfs - remove EXPERIMENTAL and enable it by default
  2010-03-03 21:48         ` Linus Torvalds
@ 2010-03-03 22:04           ` Greg KH
  2010-03-04  0:04             ` Linus Torvalds
  0 siblings, 1 reply; 90+ messages in thread
From: Greg KH @ 2010-03-03 22:04 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Eric W. Biederman, linux-kernel, Kay Sievers

On Wed, Mar 03, 2010 at 01:48:08PM -0800, Linus Torvalds wrote:
> 
> Anyway, I don't know whether you picked a good spot to do your series or 
> not, but it _looked_ like a pretty random spot. It might be perfectly 
> good. But just in general, since you always generate your trees from a 
> quilt series anyway, I suspect we migth be better off (at least for the 
> initial merge window series) to base them on the closest thing we have to 
> a "known good" base, namely the previous release. Rather than some "maybe 
> fine" point in the middle of the merge window.

I originally did the create from the 2.6.33 release, and then did a
merge to test that it would be easy for you, but there were a number of
conflicts due to other trees touching some driver core stuff (that I
knew was going to happen.)  So I did take a merge point after that had
happened, and did test it out here on my machines.

But hey, if you want to have to handle merge conflicts, I'll gladly base
them on known-common points in the future :)

In the future I'll try to pick better merge points.

thanks,

greg k-h

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

* Re: [PATCH 19/62] Driver-Core: devtmpfs - remove EXPERIMENTAL and enable it by default
  2010-03-03 22:04           ` Greg KH
@ 2010-03-04  0:04             ` Linus Torvalds
  0 siblings, 0 replies; 90+ messages in thread
From: Linus Torvalds @ 2010-03-04  0:04 UTC (permalink / raw)
  To: Greg KH; +Cc: Eric W. Biederman, linux-kernel, Kay Sievers



On Wed, 3 Mar 2010, Greg KH wrote:
> 
> I originally did the create from the 2.6.33 release, and then did a
> merge to test that it would be easy for you, but there were a number of
> conflicts due to other trees touching some driver core stuff (that I
> knew was going to happen.)  So I did take a merge point after that had
> happened, and did test it out here on my machines.

Ahh, ok. So at least the base point made sense. I wasn't sure why it was 
that odd point, so I kind of assumed it was just a totally random point. 

> But hey, if you want to have to handle merge conflicts, I'll gladly base
> them on known-common points in the future :)

I'll generally happily do merge conflict resolution, but if there were 
lots of conflicts, then I suspect your choice was fine and probably for 
the best.

Who knows how good a point you picked (we'll see - hopefully the bisect 
worry will never even come up), but even just the "it was very much a 
conscious decision" makes me much happier about it, regardless of 
anything else.

			Linus

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

* Re: [GIT PATCH] driver core patches for 2.6.33-git
  2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
                   ` (59 preceding siblings ...)
  2010-03-02 23:29 ` [PATCH 62/62] sysfs: fix for thinko with sysfs_bin_attr_init() Greg Kroah-Hartman
@ 2010-03-08 14:12 ` Greg KH
  2010-03-08 17:28   ` Linus Torvalds
  60 siblings, 1 reply; 90+ messages in thread
From: Greg KH @ 2010-03-08 14:12 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton, linux-kernel

On Tue, Mar 02, 2010 at 03:09:33PM -0800, Greg KH wrote:
> Here is the big driver core patchset for the 2.6.34 merge window.
> 
> The msi-laptop driver also got updates through this patch series, at the
> blessing of the maintainer of that driver.
> 
> Please pull from:
> 	master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-core-2.6.git/
> 
> All of these patches have been in the linux-next and mm trees for a
> while.
> 
> The patches will be sent as a follow-on to this message to lkml for
> people to see.

I've now updated this series, fixing the 'default y' option for the
DEVTMPFS config options, and respun it on top of your tree as of a few
days ago.

Please pull from:
	master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-core-2.6.git/

The updated diffstat and shortlog is below.

thanks,

greg k-h

---------

 Documentation/HOWTO                       |  113 +++------
 Documentation/kobject.txt                 |    2 +-
 arch/arm/mach-pxa/corgi_ssp.c             |    2 +-
 arch/arm/mach-pxa/sharpsl_pm.c            |    2 +-
 arch/arm/mach-s3c2410/h1940-bluetooth.c   |    2 +-
 arch/arm/mach-sa1100/jornada720_ssp.c     |    2 +-
 arch/ia64/kernel/topology.c               |    2 +-
 arch/mips/txx9/generic/7segled.c          |    5 +-
 arch/powerpc/kernel/cacheinfo.c           |    2 +-
 arch/s390/kernel/smp.c                    |   12 +-
 arch/s390/kernel/time.c                   |   49 +++-
 arch/sh/kernel/cpu/sh4/sq.c               |    2 +-
 arch/x86/kernel/cpu/intel_cacheinfo.c     |    2 +-
 arch/x86/kernel/cpu/mcheck/mce.c          |    1 +
 arch/x86/kernel/cpu/mcheck/mce_amd.c      |    2 +-
 block/blk-integrity.c                     |    2 +-
 block/blk-sysfs.c                         |    2 +-
 block/elevator.c                          |    2 +-
 drivers/acpi/system.c                     |    2 +
 drivers/auxdisplay/cfag12864bfb.c         |    2 +-
 drivers/base/Kconfig                      |   51 +++--
 drivers/base/bus.c                        |   26 +-
 drivers/base/class.c                      |   16 +-
 drivers/base/core.c                       |   46 ++--
 drivers/base/cpu.c                        |  105 ++++-----
 drivers/base/dd.c                         |   38 ++--
 drivers/base/devtmpfs.c                   |   13 +
 drivers/base/firmware_class.c             |   11 +-
 drivers/base/memory.c                     |   20 +-
 drivers/base/node.c                       |   81 +++----
 drivers/base/platform.c                   |   76 ++++++-
 drivers/base/power/main.c                 |   20 +-
 drivers/base/sys.c                        |   17 +-
 drivers/block/osdblk.c                    |   12 +-
 drivers/block/pktcdvd.c                   |   14 +-
 drivers/cpufreq/cpufreq.c                 |    2 +-
 drivers/cpuidle/sysfs.c                   |    8 +-
 drivers/dma/ioat/dma.c                    |    2 +-
 drivers/dma/ioat/dma.h                    |    2 +-
 drivers/edac/edac_device_sysfs.c          |    6 +-
 drivers/edac/edac_mc_sysfs.c              |    4 +-
 drivers/edac/edac_pci_sysfs.c             |    4 +-
 drivers/firewire/core-device.c            |    5 +-
 drivers/firmware/edd.c                    |    2 +-
 drivers/firmware/efivars.c                |    2 +-
 drivers/firmware/iscsi_ibft.c             |    2 +-
 drivers/firmware/memmap.c                 |    2 +-
 drivers/gpio/gpiolib.c                    |    8 +-
 drivers/gpu/drm/drm_sysfs.c               |   18 +-
 drivers/gpu/drm/ttm/ttm_bo.c              |    2 +-
 drivers/gpu/drm/ttm/ttm_memory.c          |    2 +-
 drivers/i2c/busses/i2c-omap.c             |    2 +-
 drivers/ieee1394/nodemgr.c                |    5 +-
 drivers/infiniband/core/cm.c              |    2 +-
 drivers/infiniband/core/sysfs.c           |    2 +-
 drivers/infiniband/core/ucm.c             |   13 +-
 drivers/infiniband/core/user_mad.c        |    9 +-
 drivers/infiniband/core/uverbs_main.c     |    9 +-
 drivers/macintosh/windfarm_core.c         |    1 +
 drivers/macintosh/windfarm_smu_controls.c |    1 +
 drivers/md/dm-sysfs.c                     |    2 +-
 drivers/md/md.c                           |    4 +-
 drivers/media/video/omap24xxcam.c         |    2 +-
 drivers/misc/phantom.c                    |   13 +-
 drivers/mtd/ubi/build.c                   |    3 +-
 drivers/net/bonding/bond_sysfs.c          |    5 +-
 drivers/net/ibmveth.c                     |    2 +-
 drivers/net/iseries_veth.c                |    4 +-
 drivers/parisc/pdc_stable.c               |    2 +-
 drivers/pci/bus.c                         |    4 +-
 drivers/pci/hotplug/fakephp.c             |    2 +-
 drivers/pci/pci-sysfs.c                   |    5 +
 drivers/pci/pci.c                         |    4 +-
 drivers/pci/slot.c                        |    2 +-
 drivers/pcmcia/ds.c                       |    8 +-
 drivers/platform/x86/Kconfig              |    1 +
 drivers/platform/x86/hp-wmi.c             |    4 +-
 drivers/platform/x86/msi-laptop.c         |  360 ++++++++++++++++++++++++++++-
 drivers/scsi/sgiwd93.c                    |    2 +-
 drivers/scsi/sni_53c710.c                 |    2 +-
 drivers/staging/asus_oled/asus_oled.c     |   13 +-
 drivers/uio/Kconfig                       |   24 +-
 drivers/uio/Makefile                      |    2 +-
 drivers/uio/uio.c                         |    4 +-
 drivers/uio/uio_netx.c                    |  172 ++++++++++++++
 drivers/uio/uio_smx.c                     |  140 -----------
 drivers/usb/core/driver.c                 |    4 +-
 drivers/uwb/driver.c                      |    5 +-
 drivers/uwb/umc-bus.c                     |    4 +-
 drivers/uwb/uwb-internal.h                |    4 +-
 drivers/uwb/wlp/sysfs.c                   |    3 +-
 drivers/video/acornfb.c                   |    2 +-
 drivers/video/arcfb.c                     |    2 +-
 drivers/video/cobalt_lcdfb.c              |    2 +-
 drivers/video/efifb.c                     |    2 +-
 drivers/video/epson1355fb.c               |    2 +-
 drivers/video/gbefb.c                     |    2 +-
 drivers/video/hgafb.c                     |    2 +-
 drivers/video/hitfb.c                     |    2 +-
 drivers/video/omap2/dss/manager.c         |    2 +-
 drivers/video/omap2/dss/overlay.c         |    2 +-
 drivers/video/q40fb.c                     |    2 +-
 drivers/video/s3c2410fb.c                 |    4 +-
 drivers/video/sa1100fb.c                  |    2 +-
 drivers/video/sgivwfb.c                   |    2 +-
 drivers/video/sh_mobile_lcdcfb.c          |    2 +-
 drivers/video/vesafb.c                    |    2 +-
 drivers/video/vfb.c                       |    2 +-
 drivers/video/vga16fb.c                   |    2 +-
 drivers/video/w100fb.c                    |    2 +-
 drivers/w1/masters/omap_hdq.c             |    4 +-
 drivers/xen/sys-hypervisor.c              |    2 +-
 fs/btrfs/sysfs.c                          |    4 +-
 fs/dlm/lockspace.c                        |    2 +-
 fs/ext4/super.c                           |    2 +-
 fs/gfs2/sys.c                             |    4 +-
 fs/ocfs2/cluster/masklog.c                |    2 +-
 fs/sysfs/bin.c                            |   50 ++--
 fs/sysfs/dir.c                            |  132 ++++++-----
 fs/sysfs/file.c                           |   47 +++-
 fs/sysfs/inode.c                          |   13 +-
 fs/sysfs/mount.c                          |    4 +-
 fs/sysfs/symlink.c                        |   38 +++
 fs/sysfs/sysfs.h                          |   17 +-
 include/linux/device.h                    |   40 +++-
 include/linux/kobject.h                   |   14 +-
 include/linux/platform_device.h           |    9 +-
 include/linux/sysdev.h                    |   21 ++-
 include/linux/sysfs.h                     |   61 +++++
 include/linux/usb.h                       |    6 +-
 kernel/module.c                           |    3 +
 kernel/params.c                           |    5 +-
 kernel/perf_event.c                       |   13 +-
 kernel/sched.c                            |    4 +
 lib/kobject.c                             |    6 +-
 lib/kobject_uevent.c                      |    2 +-
 mm/slub.c                                 |    4 +-
 net/bluetooth/l2cap.c                     |    4 +-
 net/bluetooth/rfcomm/core.c               |    4 +-
 net/bluetooth/rfcomm/sock.c               |    4 +-
 net/bluetooth/sco.c                       |    4 +-
 net/bridge/br_private.h                   |    2 +-
 net/bridge/br_sysfs_if.c                  |    2 +-
 samples/kobject/kobject-example.c         |    4 +-
 samples/kobject/kset-example.c            |    6 +-
 145 files changed, 1463 insertions(+), 793 deletions(-)
 create mode 100644 drivers/uio/uio_netx.c
 delete mode 100644 drivers/uio/uio_smx.c

---------------

Andi Kleen (12):
      sysdev: Pass attribute in sysdev_class attributes show/store
      sysdev: Convert node driver class attributes to be data driven
      sysdev: Convert cpu driver sysdev class attributes
      sysfs: Add sysfs_add/remove_files utility functions
      sysfs: Add attribute array to sysdev classes
      sysdev: Convert node driver
      sysdev: Use sysdev_class attribute arrays in node driver
      sysdev: Add sysdev_create/remove_files
      sysdev: Fix type of sysdev class attribute in memory driver
      driver-core: Add attribute argument to class_attribute show/store
      driver core: Add class_attr_string for simple read-only string
      driver core: Convert some drivers to CLASS_ATTR_STRING

Ben Hutchings (1):
      Driver core: Fix first line of kernel-doc for a few functions

Dmitry Torokhov (1):
      Driver core: add platform_create_bundle() helper

Emese Revfy (2):
      kobject: Constify struct kset_uevent_ops
      Driver core: Constify struct sysfs_ops in struct kobj_type

Eric Miao (1):
      driver core: make platform_device_id table const

Eric W. Biederman (13):
      sysfs: Cache the last sysfs_dirent to improve readdir scalability v2
      sysfs: Remove sysfs_get/put_active_two
      sysfs: Only take active references on attributes.
      sysfs: Use one lockdep class per sysfs attribute.
      sysfs: Use sysfs_attr_init and sysfs_bin_attr_init on dynamic attributes
      sysfs: Document sysfs_attr_init and sysfs_bin_attr_init
      sysfs: Use sysfs_attr_init and sysfs_bin_attr_init on module dynamic attributes
      sysfs: Serialize updates to the vfs inode
      sysfs: Pack sysfs_dirent more tightly.
      sysfs: Implement sysfs_rename_link
      driver core: Use sysfs_rename_link in device_rename
      sysfs: Pass super_block to sysfs_get_inode
      sysfs: Kill unused sysfs_sb variable.

Greg Kroah-Hartman (2):
      sysdev: fix up the probe/release attributes
      Driver core: create lock/unlock functions for struct device

Hans J. Koch (2):
      UIO: Add a driver for Hilscher netX-based fieldbus cards
      UIO: Remove SMX Cryptengine driver

Heiko Carstens (1):
      sysdev: fix missing s390 conversion

Johannes Berg (1):
      sysfs: windfarm: init sysfs attributes

John Ogness (1):
      UIO: minor Kconfig fixes

Kay Sievers (4):
      Driver-Core: devtmpfs - reset inode permissions before unlinking
      Driver-Core: devtmpfs - remove EXPERIMENTAL and flush out the description
      Driver-Core: disable /sbin/hotplug by default
      Driver-Core: require valid action string in uevent trigger

Lee, Chun-Yi (5):
      msi-laptop: Support standard ec 66/62 command on MSI notebook and nebook
      msi-laptop: Add threeg sysfs file for support query 3G state by standard 66/62 ec command
      msi-laptop: Support some MSI 3G netbook that is need load SCM
      msi-laptop: Add resume method for set the SCM load again
      msi-laptop: Detect 3G device exists by standard ec command

Luis R. Rodriguez (1):
      driver-core: firmware_class: remove base.h header inclusion

Radu Voicilas (2):
      kobject-example: Spelling fixes.
      kset-example: Spelling fixes.

Randy Dunlap (1):
      msi-laptop: depends on RFKILL

Stefan Richter (1):
      HOWTO: Updates on subsystem trees, patchwork, -next (vs. -mm)

Stephen Rothwell (1):
      sysfs: fix for thinko with sysfs_bin_attr_init()

Tejun Heo (1):
      driver-core: fix race condition in get_device_parent()

Uwe Kleine-König (9):
      Driver core: make struct platform_driver.id_table const
      platform-drivers: move probe to .devinit.text in arch/arm
      platform-drivers: move probe to .devinit.text in drivers/scsi
      platform-drivers: move probe to .devinit.text in drivers/video
      x86: move hp-wmi's probe function to .devinit.text
      i2c: move i2c_omap's probe function to .devinit.text
      w1: move omap_hdq's probe function to .devinit.text
      media: move omap24xxcam's probe function to .devinit.text
      auxdisplay: move cfag12864bfb's probe function to .devinit.text


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

* Re: [GIT PATCH] driver core patches for 2.6.33-git
  2010-03-08 14:12 ` [GIT PATCH] driver core patches for 2.6.33-git Greg KH
@ 2010-03-08 17:28   ` Linus Torvalds
  2010-03-08 17:33     ` Greg KH
  0 siblings, 1 reply; 90+ messages in thread
From: Linus Torvalds @ 2010-03-08 17:28 UTC (permalink / raw)
  To: Greg KH; +Cc: Andrew Morton, linux-kernel



On Mon, 8 Mar 2010, Greg KH wrote:
> 
> Please pull from:
> 	master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-core-2.6.git/

Forgot to push out?

		Linus

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

* Re: [GIT PATCH] driver core patches for 2.6.33-git
  2010-03-08 17:28   ` Linus Torvalds
@ 2010-03-08 17:33     ` Greg KH
  0 siblings, 0 replies; 90+ messages in thread
From: Greg KH @ 2010-03-08 17:33 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: Andrew Morton, linux-kernel

On Mon, Mar 08, 2010 at 09:28:09AM -0800, Linus Torvalds wrote:
> 
> 
> On Mon, 8 Mar 2010, Greg KH wrote:
> > 
> > Please pull from:
> > 	master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-core-2.6.git/
> 
> Forgot to push out?

Crap, yes, I did.  It's there now.

thanks,

greg k-h

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

* Re: [PATCH 57/62] msi-laptop: Add threeg sysfs file for support query 3G state by standard 66/62 ec command
  2010-03-03 15:25 Joey Lee
@ 2010-03-03 15:28 ` Matthew Garrett
  0 siblings, 0 replies; 90+ messages in thread
From: Matthew Garrett @ 2010-03-03 15:28 UTC (permalink / raw)
  To: Joey Lee; +Cc: mzxreary, gregkh, linux-kernel

On Wed, Mar 03, 2010 at 08:25:38AM -0700, Joey Lee wrote:

> So, "wwan" does not mean "3g"? or 3g is included in "wwan"?
> And, does the "non-standard radio control file" mean like "threeg",
> "wlan" or "bluetooth" in /sys/devices/platform/xxxxx ?

wwan includes 3g, so it's the appropriate type to use here. The 
non-standard ones are the threeg, wlan and bluetooth files.

> In current x86/platform, there have a bit driver still used the
> "non-standard control file". Does that mean we need replace all of 
> those control files by rfkill interface?

Those are holdovers from before the rfkill interface was usable - we 
should probably be deprecating them. I /think/ all the drivers that 
provide them also provide an rfkill interface now, but if not we should 
probably port them.

-- 
Matthew Garrett | mjg59@srcf.ucam.org

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

* Re: [PATCH 57/62] msi-laptop: Add threeg sysfs file for support query 3G state by standard 66/62 ec command
@ 2010-03-03 15:25 Joey Lee
  2010-03-03 15:28 ` Matthew Garrett
  0 siblings, 1 reply; 90+ messages in thread
From: Joey Lee @ 2010-03-03 15:25 UTC (permalink / raw)
  To: mjg59; +Cc: mzxreary, gregkh, linux-kernel

Hi Matthew,

於 三,2010-03-03 於 13:46 +0000,Matthew Garrett 提到:
> On Tue, Mar 02, 2010 at 03:47:00PM -0800, Greg KH wrote:
> > On Tue, Mar 02, 2010 at 11:36:16PM +0000, Matthew Garrett wrote:
> > > On Tue, Mar 02, 2010 at 03:28:56PM -0800, Greg Kroah-Hartman wrote:
> > > 
> > > > Add threeg sysfs file for support query 3G state by standard 66/62 ec
> > > > command, the MSI standard ec interface supported this feature.
> > > 
> > > No. Just use the rfkill interface.
> > 
> > Does rfkill support 3G?  I thought it was only for wireless (80211)
> > stuff.
> 
> rfkill has types for the majority of radios. A later patch adds the 3g 
> rfkill device, so this one should just be dropped - there's no reason to 
> add a non-standard radio control file now.
> 

So, "wwan" does not mean "3g"? or 3g is included in "wwan"?
And, does the "non-standard radio control file" mean like "threeg",
"wlan" or "bluetooth" in /sys/devices/platform/xxxxx ?

In current x86/platform, there have a bit driver still used the
"non-standard control file". Does that mean we need replace all of 
those control files by rfkill interface?


Thank's
Joey Lee


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

* Re: [PATCH 57/62] msi-laptop: Add threeg sysfs file for support query 3G state by standard 66/62 ec command
@ 2010-03-03  8:55 Joey Lee
  0 siblings, 0 replies; 90+ messages in thread
From: Joey Lee @ 2010-03-03  8:55 UTC (permalink / raw)
  To: mjg59; +Cc: mzxreary, gregkh, linux-kernel

Hi Greg, 

於 二,2010-03-02 於 15:47 -0800,Greg KH 提到:
> On Tue, Mar 02, 2010 at 11:36:16PM +0000, Matthew Garrett wrote:
> > On Tue, Mar 02, 2010 at 03:28:56PM -0800, Greg Kroah-Hartman wrote:
> > 
> > > Add threeg sysfs file for support query 3G state by standard 66/62 ec
> > > command, the MSI standard ec interface supported this feature.
> > 
> > No. Just use the rfkill interface.
> 
> Does rfkill support 3G?  I thought it was only for wireless (80211)
> stuff.
> 

M......No, rfkill have wwan type and I have also generate it in patch.
So, this patch to msi-laptop driver will gnerate the following interface
on MSI N034 netbook when netbook have 3G hardware module:
	- /sys/devices/platform/msi-laptop-pf/threeg
	- /sys/class/rfkill/rfkill2
	  	/sys/class/rfkill/rfkill2/type=wwan

I have reference acer-wmi.c then generate the threeg sysfs, and want to
follow the same style with "wlan" and "bluetooth" sysfs file
in /sys/devices/platform/msi-laptop-pf/rfkill

And, yes, userland just need control wwan by rfkill interface.
Do I need remove threeg sysfs file, now?


Thank's
Joey Lee


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

end of thread, other threads:[~2010-03-08 17:33 UTC | newest]

Thread overview: 90+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-02 23:09 [GIT PATCH] driver core patches for 2.6.33-git Greg KH
2010-03-02 23:28 ` [PATCH 01/62] kobject-example: Spelling fixes Greg Kroah-Hartman
2010-03-02 23:28 ` [PATCH 02/62] kset-example: " Greg Kroah-Hartman
2010-03-02 23:28 ` [PATCH 03/62] Driver core: add platform_create_bundle() helper Greg Kroah-Hartman
2010-03-02 23:28 ` [PATCH 04/62] driver core: make platform_device_id table const Greg Kroah-Hartman
2010-03-02 23:28 ` [PATCH 05/62] sysdev: Pass attribute in sysdev_class attributes show/store Greg Kroah-Hartman
2010-03-02 23:28 ` [PATCH 06/62] sysdev: Convert node driver class attributes to be data driven Greg Kroah-Hartman
2010-03-02 23:28 ` [PATCH 07/62] sysdev: Convert cpu driver sysdev class attributes Greg Kroah-Hartman
2010-03-02 23:28 ` [PATCH 08/62] sysfs: Add sysfs_add/remove_files utility functions Greg Kroah-Hartman
2010-03-02 23:28 ` [PATCH 09/62] sysfs: Add attribute array to sysdev classes Greg Kroah-Hartman
2010-03-02 23:28 ` [PATCH 10/62] sysdev: Convert node driver Greg Kroah-Hartman
2010-03-02 23:28 ` [PATCH 11/62] sysdev: Use sysdev_class attribute arrays in " Greg Kroah-Hartman
2010-03-02 23:28 ` [PATCH 12/62] sysdev: Add sysdev_create/remove_files Greg Kroah-Hartman
2010-03-02 23:28 ` [PATCH 13/62] sysdev: Fix type of sysdev class attribute in memory driver Greg Kroah-Hartman
2010-03-02 23:28 ` [PATCH 14/62] sysdev: fix missing s390 conversion Greg Kroah-Hartman
2010-03-02 23:28 ` [PATCH 15/62] driver-core: Add attribute argument to class_attribute show/store Greg Kroah-Hartman
2010-03-02 23:28 ` [PATCH 16/62] driver core: Add class_attr_string for simple read-only string Greg Kroah-Hartman
2010-03-02 23:28 ` [PATCH 17/62] driver core: Convert some drivers to CLASS_ATTR_STRING Greg Kroah-Hartman
2010-03-02 23:28 ` [PATCH 18/62] Driver-Core: devtmpfs - reset inode permissions before unlinking Greg Kroah-Hartman
2010-03-02 23:28 ` [PATCH 19/62] Driver-Core: devtmpfs - remove EXPERIMENTAL and enable it by default Greg Kroah-Hartman
2010-03-03  4:38   ` Eric W. Biederman
2010-03-03 16:46     ` Linus Torvalds
2010-03-03 20:03       ` Kay Sievers
2010-03-03 20:21         ` Eric W. Biederman
2010-03-03 22:01           ` Kay Sievers
2010-03-03 21:22       ` Greg KH
2010-03-03 21:48         ` Linus Torvalds
2010-03-03 22:04           ` Greg KH
2010-03-04  0:04             ` Linus Torvalds
2010-03-02 23:28 ` [PATCH 20/62] Driver-Core: disable /sbin/hotplug " Greg Kroah-Hartman
2010-03-02 23:28 ` [PATCH 21/62] Driver-Core: require valid action string in uevent trigger Greg Kroah-Hartman
2010-03-02 23:28 ` [PATCH 22/62] sysfs: Cache the last sysfs_dirent to improve readdir scalability v2 Greg Kroah-Hartman
2010-03-02 23:28 ` [PATCH 23/62] driver-core: firmware_class: remove base.h header inclusion Greg Kroah-Hartman
2010-03-02 23:28 ` [PATCH 24/62] kobject: Constify struct kset_uevent_ops Greg Kroah-Hartman
2010-03-02 23:28 ` [PATCH 25/62] HOWTO: Updates on subsystem trees, patchwork, -next (vs. -mm) Greg Kroah-Hartman
2010-03-02 23:28 ` [PATCH 26/62] sysdev: fix up the probe/release attributes Greg Kroah-Hartman
2010-03-02 23:28 ` [PATCH 27/62] Driver core: Constify struct sysfs_ops in struct kobj_type Greg Kroah-Hartman
2010-03-02 23:28 ` [PATCH 28/62] Driver core: make struct platform_driver.id_table const Greg Kroah-Hartman
2010-03-02 23:28 ` [PATCH 29/62] platform-drivers: move probe to .devinit.text in arch/arm Greg Kroah-Hartman
2010-03-02 23:28 ` [PATCH 30/62] platform-drivers: move probe to .devinit.text in drivers/scsi Greg Kroah-Hartman
2010-03-02 23:28 ` [PATCH 32/62] x86: move hp-wmi's probe function to .devinit.text Greg Kroah-Hartman
2010-03-02 23:28 ` [PATCH 33/62] i2c: move i2c_omap's " Greg Kroah-Hartman
2010-03-02 23:28 ` [PATCH 34/62] w1: move omap_hdq's " Greg Kroah-Hartman
2010-03-02 23:28 ` [PATCH 35/62] media: move omap24xxcam's " Greg Kroah-Hartman
2010-03-02 23:28 ` [PATCH 36/62] auxdisplay: move cfag12864bfb's " Greg Kroah-Hartman
2010-03-02 23:28 ` [PATCH 37/62] net: move am79c961's " Greg Kroah-Hartman
2010-03-02 23:28 ` [PATCH 38/62] UIO: Add a driver for Hilscher netX-based fieldbus cards Greg Kroah-Hartman
2010-03-02 23:28 ` [PATCH 39/62] UIO: minor Kconfig fixes Greg Kroah-Hartman
2010-03-02 23:28 ` [PATCH 40/62] UIO: Remove SMX Cryptengine driver Greg Kroah-Hartman
2010-03-02 23:28 ` [PATCH 41/62] Driver core: Fix first line of kernel-doc for a few functions Greg Kroah-Hartman
2010-03-02 23:28 ` [PATCH 42/62] sysfs: Remove sysfs_get/put_active_two Greg Kroah-Hartman
2010-03-03  1:34   ` Tejun Heo
2010-03-02 23:28 ` [PATCH 43/62] sysfs: Only take active references on attributes Greg Kroah-Hartman
2010-03-03  1:36   ` Tejun Heo
2010-03-02 23:28 ` [PATCH 44/62] sysfs: Use one lockdep class per sysfs attribute Greg Kroah-Hartman
2010-03-03  1:41   ` Tejun Heo
2010-03-02 23:28 ` [PATCH 45/62] sysfs: Use sysfs_attr_init and sysfs_bin_attr_init on dynamic attributes Greg Kroah-Hartman
2010-03-03  1:41   ` Tejun Heo
2010-03-02 23:28 ` [PATCH 46/62] sysfs: Document sysfs_attr_init and sysfs_bin_attr_init Greg Kroah-Hartman
2010-03-02 23:28 ` [PATCH 47/62] sysfs: Use sysfs_attr_init and sysfs_bin_attr_init on module dynamic attributes Greg Kroah-Hartman
2010-03-02 23:28 ` [PATCH 48/62] sysfs: windfarm: init sysfs attributes Greg Kroah-Hartman
2010-03-02 23:28 ` [PATCH 49/62] sysfs: Serialize updates to the vfs inode Greg Kroah-Hartman
2010-03-02 23:28 ` [PATCH 50/62] sysfs: Pack sysfs_dirent more tightly Greg Kroah-Hartman
2010-03-02 23:28 ` [PATCH 51/62] sysfs: Implement sysfs_rename_link Greg Kroah-Hartman
2010-03-02 23:28 ` [PATCH 52/62] driver core: Use sysfs_rename_link in device_rename Greg Kroah-Hartman
2010-03-02 23:28 ` [PATCH 53/62] sysfs: Pass super_block to sysfs_get_inode Greg Kroah-Hartman
2010-03-02 23:28 ` [PATCH 54/62] sysfs: Kill unused sysfs_sb variable Greg Kroah-Hartman
2010-03-02 23:28 ` [PATCH 56/62] msi-laptop: Support standard ec 66/62 command on MSI notebook and nebook Greg Kroah-Hartman
2010-03-02 23:42   ` Matthew Garrett
2010-03-02 23:58     ` Greg KH
2010-03-03 13:47       ` Matthew Garrett
2010-03-02 23:28 ` [PATCH 57/62] msi-laptop: Add threeg sysfs file for support query 3G state by standard 66/62 ec command Greg Kroah-Hartman
2010-03-02 23:36   ` Matthew Garrett
2010-03-02 23:47     ` Greg KH
2010-03-03 13:46       ` Matthew Garrett
2010-03-02 23:28 ` [PATCH 58/62] msi-laptop: Support some MSI 3G netbook that is need load SCM Greg Kroah-Hartman
2010-03-02 23:39   ` Matthew Garrett
2010-03-02 23:46     ` Greg KH
2010-03-02 23:28 ` [PATCH 59/62] msi-laptop: Add resume method for set the SCM load again Greg Kroah-Hartman
2010-03-02 23:28 ` [PATCH 60/62] msi-laptop: Detect 3G device exists by standard ec command Greg Kroah-Hartman
2010-03-02 23:29 ` [PATCH 61/62] msi-laptop: depends on RFKILL Greg Kroah-Hartman
2010-03-03  6:09   ` Dmitry Torokhov
2010-03-03 21:23     ` Greg KH
2010-03-02 23:29 ` [PATCH 62/62] sysfs: fix for thinko with sysfs_bin_attr_init() Greg Kroah-Hartman
2010-03-08 14:12 ` [GIT PATCH] driver core patches for 2.6.33-git Greg KH
2010-03-08 17:28   ` Linus Torvalds
2010-03-08 17:33     ` Greg KH
2010-03-03  8:55 [PATCH 57/62] msi-laptop: Add threeg sysfs file for support query 3G state by standard 66/62 ec command Joey Lee
2010-03-03 15:25 Joey Lee
2010-03-03 15:28 ` Matthew Garrett

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.