All of lore.kernel.org
 help / color / mirror / Atom feed
* [BK PATCH] More Driver Core patches for 2.6.10-rc1
@ 2004-11-05  0:47 Greg KH
  0 siblings, 0 replies; 14+ messages in thread
From: Greg KH @ 2004-11-05  0:47 UTC (permalink / raw)
  To: torvalds, akpm; +Cc: linux-kernel

Hi,

Here are some more driver core and sysfs fixes for 2.6.10-rc1.  They fix
a number of little bugs that people have been reporting over the past
week with the recent sysfs changes, and also the kevent changes.  The
kevent stuff also now has a proper MAINTAINERS entry, and we now export
a few more environment variables through the hotplug interface to make
userspace programs have an easier time trying to figure out how to deal
with devices properly.

Please pull from:
	bk://kernel.bkbits.net/gregkh/linux/driver-2.6

thanks,

greg k-h

p.s. I'll send these as patches in response to this email to lkml for
those who want to see them.

 MAINTAINERS           |    6 ++
 drivers/base/bus.c    |  101 +++++++++++++++++++++++++++++---------------------
 drivers/base/class.c  |   26 ++++++++++++
 drivers/base/core.c   |    6 +-
 drivers/block/genhd.c |   40 +++++++++++++++++++
 fs/sysfs/dir.c        |    6 +-
 fs/sysfs/file.c       |    4 +
 fs/sysfs/inode.c      |    5 --
 fs/sysfs/mount.c      |    2 
 fs/sysfs/symlink.c    |   17 ++++----
 fs/sysfs/sysfs.h      |    2 
 lib/kobject.c         |    1 
 lib/kobject_uevent.c  |    8 +--
 13 files changed, 154 insertions(+), 70 deletions(-)
-----

Adrian Bunk:
  o small sysfs cleanups

Greg Kroah-Hartman:
  o kevent: fix build error if CONFIG_KOBJECT_UEVENT is not selected

Kay Sievers:
  o add the physical device and the bus to the hotplug environment

Maneesh Soni:
  o fix kernel BUG at fs/sysfs/dir.c:20!
  o sysfs: fix sysfs backing store error path confusion

Robert Love:
  o kobject_uevent: add MAINTAINER entry
  o kobject_uevent: fix init ordering

Tejun Heo:
  o driver-model: device_add() error path reference counting fix
  o driver-model: kobject_add() error path reference counting fix
  o driver-model: sysfs_release() dangling pointer reference fix
  o driver-model: bus_recan_devices() locking fix
  o driver-model: comment fix in bus.c


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

* [BK PATCH] More Driver Core patches for 2.6.10-rc1
@ 2004-11-12 22:58 Greg KH
  2004-11-12 23:00 ` [PATCH] " Greg KH
  2004-11-13 20:51 ` [BK PATCH] " Linus Torvalds
  0 siblings, 2 replies; 14+ messages in thread
From: Greg KH @ 2004-11-12 22:58 UTC (permalink / raw)
  To: torvalds, akpm; +Cc: linux-kernel

Hi,

Here are a few driver core and sysfs patches and fixes for 2.6.10-rc1.
They fix some minor bugs in sysfs, add some more environment variables
to /sbin/hotplug to make userspace easier, and shrink the size of struct
device.

Please pull from:
	bk://kernel.bkbits.net/gregkh/linux/driver-2.6

thanks,

greg k-h

p.s. I'll send these as patches in response to this email to lkml for
those who want to see them.

 arch/arm/common/locomo.c        |    3 ---
 arch/arm/common/sa1111.c        |   23 +++++++++++++++--------
 arch/arm/mach-sa1100/neponset.c |   23 +++++++++++++++--------
 drivers/base/bus.c              |    2 +-
 drivers/base/class.c            |    6 ++++++
 drivers/base/core.c             |   21 +++++++++++++++++++++
 drivers/block/genhd.c           |    6 ++++++
 drivers/video/aty/aty128fb.c    |   10 +++++-----
 drivers/video/aty/atyfb_base.c  |   10 +++++-----
 drivers/video/aty/radeon_pm.c   |    6 +++---
 fs/sysfs/dir.c                  |    8 ++++----
 include/linux/device.h          |    5 -----
 include/linux/kobject_uevent.h  |    1 +
 lib/kobject_uevent.c            |    8 +++++---
 14 files changed, 87 insertions(+), 45 deletions(-)
-----

Anil Keshavamurthy:
  o Add KOBJ_ONLINE

David Brownell:
  o driver core: shrink struct device a bit

Greg Kroah-Hartman:
  o sysfs: fix odd patch error
  o driver core: fix up some missed power_state changes from David's patch

Kay Sievers:
  o print hotplug SEQNUM as unsigned
  o add the bus name to the hotplug environment
  o add the driver name to the hotplug environment

Maneesh Soni:
  o sysfs: fix duplicate driver registration error

Milton D. Miller II:
  o fix sysfs backing store error path confusion


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

* Re: [PATCH] More Driver Core patches for 2.6.10-rc1
  2004-11-12 23:00 ` [PATCH] " Greg KH
@ 2004-11-12 23:00   ` Greg KH
  2004-11-12 23:00     ` Greg KH
       [not found]     ` <20041113000052.GC346@electric-eye.fr.zoreil.com>
  0 siblings, 2 replies; 14+ messages in thread
From: Greg KH @ 2004-11-12 23:00 UTC (permalink / raw)
  To: linux-kernel

ChangeSet 1.2094, 2004/11/12 11:42:03-08:00, miltonm@bga.com

[PATCH] fix sysfs backing store error path confusion

On Nov 3, 2004, at 3:42 PM, Greg KH wrote:

|On Tue, Nov 02, 2004 at 10:03:34AM -0600, Maneesh Soni wrote:
||On Tue, Nov 02, 2004 at 02:46:58AM -0600, Milton Miller wrote:
|||sysfs_new_dirent returns ERR_PTR(-ENOMEM) if kmalloc fails but the callers
|||were expecting NULL.
||
||Thanks for spotting this. But as you said, I will prefer to change the callee.
||How about this patch?
..
||-		return -ENOMEM;
||+		return NULL;
|
|Actually, this needs to be a 0, not NULL, otherwise the compiler
|complains with a warning.  I've fixed it up and applied it.
|
|thanks,
|
|greg k-h

I wondered why greg thought the type was wrong.   After it was merged I
realized that the wrong function was changed.  Here's an attempt to fix
both errors.


Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>


 fs/sysfs/dir.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)


diff -Nru a/fs/sysfs/dir.c b/fs/sysfs/dir.c
--- a/fs/sysfs/dir.c	2004-11-12 14:53:33 -08:00
+++ b/fs/sysfs/dir.c	2004-11-12 14:53:33 -08:00
@@ -38,7 +38,7 @@
 
 	sd = kmalloc(sizeof(*sd), GFP_KERNEL);
 	if (!sd)
-		return ERR_PTR(-ENOMEM);
+		return NULL;
 
 	memset(sd, 0, sizeof(*sd));
 	atomic_set(&sd->s_count, 1);
@@ -56,7 +56,7 @@
 
 	sd = sysfs_new_dirent(parent_sd, element);
 	if (!sd)
-		return 0;
+		return -ENOMEMurn -ENOMEM;
 
 	sd->s_mode = mode;
 	sd->s_type = type;


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

* Re: [PATCH] More Driver Core patches for 2.6.10-rc1
  2004-11-12 23:00   ` Greg KH
@ 2004-11-12 23:00     ` Greg KH
  2004-11-12 23:00       ` Greg KH
       [not found]     ` <20041113000052.GC346@electric-eye.fr.zoreil.com>
  1 sibling, 1 reply; 14+ messages in thread
From: Greg KH @ 2004-11-12 23:00 UTC (permalink / raw)
  To: linux-kernel

ChangeSet 1.2095, 2004/11/12 11:42:28-08:00, anil.s.keshavamurthy@intel.com

[PATCH] Add KOBJ_ONLINE

I am trying to fix the current ACPI container.ko and processor.ko to use
kobject_hotplug() for notification. For this I would be requiring the
KOBJ_ONLINE definitions to be added to kobject_action.

Signed-off-by: Anil Keshavamurty <anil.s.keshavamurthy@intel.com>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>


 include/linux/kobject_uevent.h |    1 +
 lib/kobject_uevent.c           |    2 ++
 2 files changed, 3 insertions(+)


diff -Nru a/include/linux/kobject_uevent.h b/include/linux/kobject_uevent.h
--- a/include/linux/kobject_uevent.h	2004-11-12 14:53:26 -08:00
+++ b/include/linux/kobject_uevent.h	2004-11-12 14:53:26 -08:00
@@ -28,6 +28,7 @@
 	KOBJ_MOUNT	= (__force kobject_action_t) 0x04,	/* mount event for block devices */
 	KOBJ_UMOUNT	= (__force kobject_action_t) 0x05,	/* umount event for block devices */
 	KOBJ_OFFLINE	= (__force kobject_action_t) 0x06,	/* offline event for hotplug devices */
+	KOBJ_ONLINE	= (__force kobject_action_t) 0x07,	/* online event for hotplug devices */
 };
 
 
diff -Nru a/lib/kobject_uevent.c b/lib/kobject_uevent.c
--- a/lib/kobject_uevent.c	2004-11-12 14:53:26 -08:00
+++ b/lib/kobject_uevent.c	2004-11-12 14:53:26 -08:00
@@ -42,6 +42,8 @@
 		return "umount";
 	case KOBJ_OFFLINE:
 		return "offline";
+	case KOBJ_ONLINE:
+		return "online";
 	default:
 		return NULL;
 	}


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

* [PATCH] More Driver Core patches for 2.6.10-rc1
  2004-11-12 22:58 [BK PATCH] More Driver Core patches for 2.6.10-rc1 Greg KH
@ 2004-11-12 23:00 ` Greg KH
  2004-11-12 23:00   ` Greg KH
  2004-11-13 20:51 ` [BK PATCH] " Linus Torvalds
  1 sibling, 1 reply; 14+ messages in thread
From: Greg KH @ 2004-11-12 23:00 UTC (permalink / raw)
  To: linux-kernel

ChangeSet 1.2093, 2004/11/12 11:41:25-08:00, david-b@pacbell.net

[PATCH] driver core: shrink struct device a bit

This patch removes two fields from "struct device" that are duplicated
in "struct dev_pm_info":  power_state (which should probably vanish)
and "saved_state".  There were only two "real" uses of saved_state;
both are now switched over to use dev_pm_info.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>


 arch/arm/common/locomo.c        |    3 ---
 arch/arm/common/sa1111.c        |   23 +++++++++++++++--------
 arch/arm/mach-sa1100/neponset.c |   23 +++++++++++++++--------
 include/linux/device.h          |    5 -----
 4 files changed, 30 insertions(+), 24 deletions(-)


diff -Nru a/arch/arm/common/locomo.c b/arch/arm/common/locomo.c
--- a/arch/arm/common/locomo.c	2004-11-12 14:53:41 -08:00
+++ b/arch/arm/common/locomo.c	2004-11-12 14:53:41 -08:00
@@ -627,9 +627,6 @@
 	if (lchip) {
 		__locomo_remove(lchip);
 		dev_set_drvdata(dev, NULL);
-
-		kfree(dev->saved_state);
-		dev->saved_state = NULL;
 	}
 
 	return 0;
diff -Nru a/arch/arm/common/sa1111.c b/arch/arm/common/sa1111.c
--- a/arch/arm/common/sa1111.c	2004-11-12 14:53:41 -08:00
+++ b/arch/arm/common/sa1111.c	2004-11-12 14:53:41 -08:00
@@ -797,6 +797,8 @@
 	unsigned int	wakeen1;
 };
 
+#ifdef	CONFIG_PM
+
 static int sa1111_suspend(struct device *dev, u32 state, u32 level)
 {
 	struct sa1111 *sachip = dev_get_drvdata(dev);
@@ -808,11 +810,10 @@
 	if (level != SUSPEND_DISABLE)
 		return 0;
 
-	dev->saved_state = kmalloc(sizeof(struct sa1111_save_data), GFP_KERNEL);
-	if (!dev->saved_state)
+	save = kmalloc(sizeof(struct sa1111_save_data), GFP_KERNEL);
+	if (!save)
 		return -ENOMEM;
-
-	save = (struct sa1111_save_data *)dev->saved_state;
+	dev->power.saved_state = save;
 
 	spin_lock_irqsave(&sachip->lock, flags);
 
@@ -870,7 +871,7 @@
 	if (level != RESUME_ENABLE)
 		return 0;
 
-	save = (struct sa1111_save_data *)dev->saved_state;
+	save = (struct sa1111_save_data *)dev->power.saved_state;
 	if (!save)
 		return 0;
 
@@ -915,12 +916,18 @@
 
 	spin_unlock_irqrestore(&sachip->lock, flags);
 
-	dev->saved_state = NULL;
+	dev->power.saved_state = NULL;
 	kfree(save);
 
 	return 0;
 }
 
+#else	/* !CONFIG_PM */
+#define sa1111_resume	NULL
+#define sa1111_suspend	NULL
+#endif	/* !CONFIG_PM */
+
+
 static int sa1111_probe(struct device *dev)
 {
 	struct platform_device *pdev = to_platform_device(dev);
@@ -943,8 +950,8 @@
 		__sa1111_remove(sachip);
 		dev_set_drvdata(dev, NULL);
 
-		kfree(dev->saved_state);
-		dev->saved_state = NULL;
+		kfree(dev->power.saved_state);
+		dev->power.saved_state = NULL;
 	}
 
 	return 0;
diff -Nru a/arch/arm/mach-sa1100/neponset.c b/arch/arm/mach-sa1100/neponset.c
--- a/arch/arm/mach-sa1100/neponset.c	2004-11-12 14:53:41 -08:00
+++ b/arch/arm/mach-sa1100/neponset.c	2004-11-12 14:53:41 -08:00
@@ -173,6 +173,8 @@
 	return 0;
 }
 
+#ifdef CONFIG_PM
+
 /*
  * LDM power management.
  */
@@ -184,12 +186,12 @@
 	if (level == SUSPEND_SAVE_STATE ||
 	    level == SUSPEND_DISABLE ||
 	    level == SUSPEND_POWER_DOWN) {
-		if (!dev->saved_state)
-			dev->saved_state = kmalloc(sizeof(unsigned int), GFP_KERNEL);
-		if (!dev->saved_state)
+		if (!dev->power.saved_state)
+			dev->power.saved_state = kmalloc(sizeof(unsigned int), GFP_KERNEL);
+		if (!dev->power.saved_state)
 			return -ENOMEM;
 
-		*(unsigned int *)dev->saved_state = NCR_0;
+		*(unsigned int *)dev->power.saved_state = NCR_0;
 	}
 
 	return 0;
@@ -198,15 +200,20 @@
 static int neponset_resume(struct device *dev, u32 level)
 {
 	if (level == RESUME_RESTORE_STATE || level == RESUME_ENABLE) {
-		if (dev->saved_state) {
-			NCR_0 = *(unsigned int *)dev->saved_state;
-			kfree(dev->saved_state);
-			dev->saved_state = NULL;
+		if (dev->power.saved_state) {
+			NCR_0 = *(unsigned int *)dev->power.saved_state;
+			kfree(dev->power.saved_state);
+			dev->power.saved_state = NULL;
 		}
 	}
 
 	return 0;
 }
+
+#else
+#define	neponset_suspend	NULL
+#define	neponset_resume	NULL
+#endif
 
 static struct device_driver neponset_device_driver = {
 	.name		= "neponset",
diff -Nru a/include/linux/device.h b/include/linux/device.h
--- a/include/linux/device.h	2004-11-12 14:53:41 -08:00
+++ b/include/linux/device.h	2004-11-12 14:53:41 -08:00
@@ -268,12 +268,7 @@
 	void		*platform_data;	/* Platform specific data (e.g. ACPI,
 					   BIOS data relevant to device) */
 	struct dev_pm_info	power;
-	u32		power_state;	/* Current operating state. In
-					   ACPI-speak, this is D0-D3, D0
-					   being fully functional, and D3
-					   being off. */
 
-	unsigned char *saved_state;	/* saved device state */
 	u32		detach_state;	/* State to enter when device is
 					   detached from its driver. */
 


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

* Re: [PATCH] More Driver Core patches for 2.6.10-rc1
  2004-11-12 23:00             ` Greg KH
@ 2004-11-12 23:00               ` Greg KH
  2004-11-12 23:00                 ` Greg KH
  0 siblings, 1 reply; 14+ messages in thread
From: Greg KH @ 2004-11-12 23:00 UTC (permalink / raw)
  To: linux-kernel

ChangeSet 1.2100, 2004/11/12 11:44:09-08:00, greg@kroah.com

[PATCH] driver core: fix up some missed power_state changes from David's patch

Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>


 drivers/video/aty/aty128fb.c   |   10 +++++-----
 drivers/video/aty/atyfb_base.c |   10 +++++-----
 drivers/video/aty/radeon_pm.c  |    6 +++---
 3 files changed, 13 insertions(+), 13 deletions(-)


diff -Nru a/drivers/video/aty/aty128fb.c b/drivers/video/aty/aty128fb.c
--- a/drivers/video/aty/aty128fb.c	2004-11-12 14:52:49 -08:00
+++ b/drivers/video/aty/aty128fb.c	2004-11-12 14:52:49 -08:00
@@ -2363,7 +2363,7 @@
 		state = 2;
 #endif /* CONFIG_PPC_PMAC */
 	 
-	if (state != 2 || state == pdev->dev.power_state)
+	if (state != 2 || state == pdev->dev.power.power_state)
 		return 0;
 
 	printk(KERN_DEBUG "aty128fb: suspending...\n");
@@ -2394,7 +2394,7 @@
 
 	release_console_sem();
 
-	pdev->dev.power_state = state;
+	pdev->dev.power.power_state = state;
 
 	return 0;
 }
@@ -2404,13 +2404,13 @@
 	struct fb_info *info = pci_get_drvdata(pdev);
 	struct aty128fb_par *par = info->par;
 
-	if (pdev->dev.power_state == 0)
+	if (pdev->dev.power.power_state == 0)
 		return 0;
 
 	acquire_console_sem();
 
 	/* Wakeup chip */
-	if (pdev->dev.power_state == 2)
+	if (pdev->dev.power.power_state == 2)
 		aty128_set_suspend(par, 0);
 	par->asleep = 0;
 
@@ -2430,7 +2430,7 @@
 
 	release_console_sem();
 
-	pdev->dev.power_state = 0;
+	pdev->dev.power.power_state = 0;
 
 	printk(KERN_DEBUG "aty128fb: resumed !\n");
 
diff -Nru a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c
--- a/drivers/video/aty/atyfb_base.c	2004-11-12 14:52:49 -08:00
+++ b/drivers/video/aty/atyfb_base.c	2004-11-12 14:52:49 -08:00
@@ -2033,7 +2033,7 @@
 		state = 2;
 #endif /* CONFIG_PPC_PMAC */
 
-	if (state != 2 || state == pdev->dev.power_state)
+	if (state != 2 || state == pdev->dev.power.power_state)
 		return 0;
 
 	acquire_console_sem();
@@ -2062,7 +2062,7 @@
 
 	release_console_sem();
 
-	pdev->dev.power_state = state;
+	pdev->dev.power.power_state = state;
 
 	return 0;
 }
@@ -2072,12 +2072,12 @@
 	struct fb_info *info = pci_get_drvdata(pdev);
 	struct atyfb_par *par = (struct atyfb_par *) info->par;
 
-	if (pdev->dev.power_state == 0)
+	if (pdev->dev.power.power_state == 0)
 		return 0;
 
 	acquire_console_sem();
 
-	if (pdev->dev.power_state == 2)
+	if (pdev->dev.power.power_state == 2)
 		aty_power_mgmt(0, par);
 	par->asleep = 0;
 
@@ -2093,7 +2093,7 @@
 
 	release_console_sem();
 
-	pdev->dev.power_state = 0;
+	pdev->dev.power.power_state = 0;
 
 	return 0;
 }
diff -Nru a/drivers/video/aty/radeon_pm.c b/drivers/video/aty/radeon_pm.c
--- a/drivers/video/aty/radeon_pm.c	2004-11-12 14:52:49 -08:00
+++ b/drivers/video/aty/radeon_pm.c	2004-11-12 14:52:49 -08:00
@@ -898,7 +898,7 @@
 
 	release_console_sem();
 
-	pdev->dev.power_state = state;
+	pdev->dev.power.power_state = state;
 
 	return 0;
 }
@@ -908,7 +908,7 @@
         struct fb_info *info = pci_get_drvdata(pdev);
         struct radeonfb_info *rinfo = info->par;
 
-	if (pdev->dev.power_state == 0)
+	if (pdev->dev.power.power_state == 0)
 		return 0;
 
 	acquire_console_sem();
@@ -935,7 +935,7 @@
 
 	release_console_sem();
 
-	pdev->dev.power_state = 0;
+	pdev->dev.power.power_state = 0;
 
 	printk(KERN_DEBUG "radeonfb: resumed !\n");
 


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

* Re: [PATCH] More Driver Core patches for 2.6.10-rc1
  2004-11-12 23:00           ` Greg KH
@ 2004-11-12 23:00             ` Greg KH
  2004-11-12 23:00               ` Greg KH
  0 siblings, 1 reply; 14+ messages in thread
From: Greg KH @ 2004-11-12 23:00 UTC (permalink / raw)
  To: linux-kernel

ChangeSet 1.2099, 2004/11/12 11:43:49-08:00, kay.sievers@vrfy.org

[PATCH] print hotplug SEQNUM as unsigned

Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>


 lib/kobject_uevent.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)


diff -Nru a/lib/kobject_uevent.c b/lib/kobject_uevent.c
--- a/lib/kobject_uevent.c	2004-11-12 14:52:56 -08:00
+++ b/lib/kobject_uevent.c	2004-11-12 14:52:56 -08:00
@@ -289,10 +289,10 @@
 	spin_lock(&sequence_lock);
 	seq = ++hotplug_seqnum;
 	spin_unlock(&sequence_lock);
-	sprintf(seq_buff, "SEQNUM=%lld", (long long)seq);
+	sprintf(seq_buff, "SEQNUM=%llu", (unsigned long long)seq);
 
-	pr_debug ("%s: %s %s seq=%lld %s %s %s %s %s\n",
-		  __FUNCTION__, argv[0], argv[1], (long long)seq,
+	pr_debug ("%s: %s %s seq=%llu %s %s %s %s %s\n",
+		  __FUNCTION__, argv[0], argv[1], (unsigned long long)seq,
 		  envp[0], envp[1], envp[2], envp[3], envp[4]);
 
 	send_uevent(action_string, kobj_path, envp, GFP_KERNEL);


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

* Re: [PATCH] More Driver Core patches for 2.6.10-rc1
  2004-11-12 23:00         ` Greg KH
@ 2004-11-12 23:00           ` Greg KH
  2004-11-12 23:00             ` Greg KH
  0 siblings, 1 reply; 14+ messages in thread
From: Greg KH @ 2004-11-12 23:00 UTC (permalink / raw)
  To: linux-kernel

ChangeSet 1.2098, 2004/11/12 11:43:27-08:00, kay.sievers@vrfy.org

[PATCH] add the bus name to the hotplug environment

Add the name of the bus and the driver to the hotplug event for
/sys/devices/*. With this addition, userspace knows what it can
expect from sysfs to show up, instead of waiting for a timeout
for devices without a bus.

  ACTION=add
  DEVPATH=/devices/pci0000:00/0000:00:1d.1/usb3/3-1
  SUBSYSTEM=usb
  SEQNUM=978
  PHYSDEVBUS=usb
  PHYSDEVDRIVER=usb

Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>


 drivers/base/bus.c  |    2 +-
 drivers/base/core.c |   21 +++++++++++++++++++++
 2 files changed, 22 insertions(+), 1 deletion(-)


diff -Nru a/drivers/base/bus.c b/drivers/base/bus.c
--- a/drivers/base/bus.c	2004-11-12 14:53:04 -08:00
+++ b/drivers/base/bus.c	2004-11-12 14:53:04 -08:00
@@ -247,7 +247,7 @@
  *	device_bind_driver - bind a driver to one device.
  *	@dev:	device.
  *
- *	Allow manual attachment of a driver to a deivce.
+ *	Allow manual attachment of a driver to a device.
  *	Caller must have already set @dev->driver.
  *
  *	Note that this does not modify the bus reference count
diff -Nru a/drivers/base/core.c b/drivers/base/core.c
--- a/drivers/base/core.c	2004-11-12 14:53:04 -08:00
+++ b/drivers/base/core.c	2004-11-12 14:53:04 -08:00
@@ -116,7 +116,28 @@
 			int num_envp, char *buffer, int buffer_size)
 {
 	struct device *dev = to_dev(kobj);
+	int i = 0;
+	int length = 0;
 	int retval = 0;
+
+	/* add bus name of physical device */
+	if (dev->bus)
+		add_hotplug_env_var(envp, num_envp, &i,
+				    buffer, buffer_size, &length,
+				    "PHYSDEVBUS=%s", dev->bus->name);
+
+	/* add driver name of physical device */
+	if (dev->driver)
+		add_hotplug_env_var(envp, num_envp, &i,
+				    buffer, buffer_size, &length,
+				    "PHYSDEVDRIVER=%s", dev->driver->name);
+
+	/* terminate, set to next free slot, shrink available space */
+	envp[i] = NULL;
+	envp = &envp[i];
+	num_envp -= i;
+	buffer = &buffer[length];
+	buffer_size -= length;
 
 	if (dev->bus->hotplug) {
 		/* have the bus specific function add its stuff */


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

* Re: [PATCH] More Driver Core patches for 2.6.10-rc1
  2004-11-12 23:00     ` Greg KH
@ 2004-11-12 23:00       ` Greg KH
  2004-11-12 23:00         ` Greg KH
  0 siblings, 1 reply; 14+ messages in thread
From: Greg KH @ 2004-11-12 23:00 UTC (permalink / raw)
  To: linux-kernel

ChangeSet 1.2096, 2004/11/12 11:42:46-08:00, maneesh@in.ibm.com

[PATCH] sysfs: fix duplicate driver registration error

o Do not release existing directory if the new directory happens to be a
  duplicate directory. Thanks to Kay Sievers for the testcase.

Signed-off-by: Maneesh Soni <maneesh@in.ibm.com>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>


 fs/sysfs/dir.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


diff -Nru a/fs/sysfs/dir.c b/fs/sysfs/dir.c
--- a/fs/sysfs/dir.c	2004-11-12 14:53:18 -08:00
+++ b/fs/sysfs/dir.c	2004-11-12 14:53:18 -08:00
@@ -111,7 +111,7 @@
 				d_rehash(*d);
 			}
 		}
-		if (error)
+		if (error && (error != -EEXIST))
 			d_drop(*d);
 		dput(*d);
 	} else


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

* Re: [PATCH] More Driver Core patches for 2.6.10-rc1
  2004-11-12 23:00               ` Greg KH
@ 2004-11-12 23:00                 ` Greg KH
  0 siblings, 0 replies; 14+ messages in thread
From: Greg KH @ 2004-11-12 23:00 UTC (permalink / raw)
  To: linux-kernel

ChangeSet 1.2101, 2004/11/12 12:46:17-08:00, greg@kroah.com

sysfs: fix odd patch error

Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>


 fs/sysfs/dir.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


diff -Nru a/fs/sysfs/dir.c b/fs/sysfs/dir.c
--- a/fs/sysfs/dir.c	2004-11-12 14:52:41 -08:00
+++ b/fs/sysfs/dir.c	2004-11-12 14:52:41 -08:00
@@ -56,7 +56,7 @@
 
 	sd = sysfs_new_dirent(parent_sd, element);
 	if (!sd)
-		return -ENOMEMurn -ENOMEM;
+		return -ENOMEM;
 
 	sd->s_mode = mode;
 	sd->s_type = type;


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

* Re: [PATCH] More Driver Core patches for 2.6.10-rc1
  2004-11-12 23:00       ` Greg KH
@ 2004-11-12 23:00         ` Greg KH
  2004-11-12 23:00           ` Greg KH
  0 siblings, 1 reply; 14+ messages in thread
From: Greg KH @ 2004-11-12 23:00 UTC (permalink / raw)
  To: linux-kernel

ChangeSet 1.2097, 2004/11/12 11:43:08-08:00, kay.sievers@vrfy.org

[PATCH] add the driver name to the hotplug environment

Add the name of the device's driver to the hotplug environment of class
and block devices.

  ACTION=add
  DEVPATH=/block/sda
  SUBSYSTEM=block
  SEQNUM=986
  PHYSDEVPATH=/devices/pci0000:00/0000:00:1d.1/usb3/3-1/3-1:1.0/host0/target0:0:0/0:0:0:0
  PHYSDEVBUS=scsi
  PHYSDEVDRIVER=sd

Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>


 drivers/base/class.c  |    6 ++++++
 drivers/block/genhd.c |    6 ++++++
 2 files changed, 12 insertions(+)


diff -Nru a/drivers/base/class.c b/drivers/base/class.c
--- a/drivers/base/class.c	2004-11-12 14:53:11 -08:00
+++ b/drivers/base/class.c	2004-11-12 14:53:11 -08:00
@@ -303,6 +303,12 @@
 					    buffer, buffer_size, &length,
 					    "PHYSDEVBUS=%s", dev->bus->name);
 
+		/* add driver name of physical device */
+		if (dev->driver)
+			add_hotplug_env_var(envp, num_envp, &i,
+					    buffer, buffer_size, &length,
+					    "PHYSDEVDRIVER=%s", dev->driver->name);
+
 		/* terminate, set to next free slot, shrink available space */
 		envp[i] = NULL;
 		envp = &envp[i];
diff -Nru a/drivers/block/genhd.c b/drivers/block/genhd.c
--- a/drivers/block/genhd.c	2004-11-12 14:53:11 -08:00
+++ b/drivers/block/genhd.c	2004-11-12 14:53:11 -08:00
@@ -469,6 +469,12 @@
 					    buffer, buffer_size, &length,
 					    "PHYSDEVBUS=%s", dev->bus->name);
 
+		/* add driver name of physical device */
+		if (dev->driver)
+			add_hotplug_env_var(envp, num_envp, &i,
+					    buffer, buffer_size, &length,
+					    "PHYSDEVDRIVER=%s", dev->driver->name);
+
 		envp[i] = NULL;
 	}
 


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

* Re: [PATCH] More Driver Core patches for 2.6.10-rc1
       [not found]       ` <200411130020.17494.lists@kenneth.aafloy.net>
@ 2004-11-13  0:44         ` Greg KH
  0 siblings, 0 replies; 14+ messages in thread
From: Greg KH @ 2004-11-13  0:44 UTC (permalink / raw)
  To: Kenneth Aafl?y, Francois Romieu; +Cc: linux-kernel

Replied to both of you, and the list, to prevent others from pointing
out the same thing multiple times :)

Oh, it's nice to see that people actually read these patches, I like it.


On Sat, Nov 13, 2004 at 12:20:17AM +0100, Kenneth Aafl?y wrote:
> On Saturday 13 November 2004 00:00, Greg KH wrote:
> > ChangeSet 1.2094, 2004/11/12 11:42:03-08:00, miltonm@bga.com
> >
> > [PATCH] fix sysfs backing store error path confusion
> [snip]
> >   sd = sysfs_new_dirent(parent_sd, element);
> >   if (!sd)
> > -  return 0;
> > +  return -ENOMEMurn -ENOMEM;
> 
> Confusingly strange :)
> 
> Kenneth

On Sat, Nov 13, 2004 at 01:00:52AM +0100, Francois Romieu wrote:
> Greg KH <greg@kroah.com> :
> [...]
> > diff -Nru a/fs/sysfs/dir.c b/fs/sysfs/dir.c
> > --- a/fs/sysfs/dir.c	2004-11-12 14:53:33 -08:00
> > +++ b/fs/sysfs/dir.c	2004-11-12 14:53:33 -08:00
> [...]
> > @@ -56,7 +56,7 @@
> >  
> >  	sd = sysfs_new_dirent(parent_sd, element);
> >  	if (!sd)
> > -		return 0;
> > +		return -ENOMEMurn -ENOMEM;
> 
> Oops.

Yeah, I don't know what happened with my tools here.  But if you look at
the next patch in the series, I fixed it.

thanks,

greg k-h

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

* Re: [BK PATCH] More Driver Core patches for 2.6.10-rc1
  2004-11-12 22:58 [BK PATCH] More Driver Core patches for 2.6.10-rc1 Greg KH
  2004-11-12 23:00 ` [PATCH] " Greg KH
@ 2004-11-13 20:51 ` Linus Torvalds
  2004-11-13 21:10   ` Greg KH
  1 sibling, 1 reply; 14+ messages in thread
From: Linus Torvalds @ 2004-11-13 20:51 UTC (permalink / raw)
  To: Greg KH; +Cc: akpm, linux-kernel



On Fri, 12 Nov 2004, Greg KH wrote:
> 
> David Brownell:
>   o driver core: shrink struct device a bit
> 
> Greg Kroah-Hartman:
>   o driver core: fix up some missed power_state changes from David's patch

Hmm. Apparently drivers/ide/ppc/pmac.c wasn't among those fixed up:

	drivers/ide/ppc/pmac.c: In function `pmac_ide_macio_suspend':
	drivers/ide/ppc/pmac.c:1363: error: structure has no member named `power_state'
	drivers/ide/ppc/pmac.c:1366: error: structure has no member named `power_state'
	...

Is it always valid to just replace

	dev->dev.power_state

with

	dev->dev.power.power_state

or is there anything subtler going on?

		Linus

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

* Re: [BK PATCH] More Driver Core patches for 2.6.10-rc1
  2004-11-13 20:51 ` [BK PATCH] " Linus Torvalds
@ 2004-11-13 21:10   ` Greg KH
  0 siblings, 0 replies; 14+ messages in thread
From: Greg KH @ 2004-11-13 21:10 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: akpm, linux-kernel

On Sat, Nov 13, 2004 at 12:51:41PM -0800, Linus Torvalds wrote:
> 
> 
> On Fri, 12 Nov 2004, Greg KH wrote:
> > 
> > David Brownell:
> >   o driver core: shrink struct device a bit
> > 
> > Greg Kroah-Hartman:
> >   o driver core: fix up some missed power_state changes from David's patch
> 
> Hmm. Apparently drivers/ide/ppc/pmac.c wasn't among those fixed up:
> 
> 	drivers/ide/ppc/pmac.c: In function `pmac_ide_macio_suspend':
> 	drivers/ide/ppc/pmac.c:1363: error: structure has no member named `power_state'
> 	drivers/ide/ppc/pmac.c:1366: error: structure has no member named `power_state'
> 	...

Oops, sorry about that.

> Is it always valid to just replace
> 
> 	dev->dev.power_state
> 
> with
> 
> 	dev->dev.power.power_state

Yes it is.

> or is there anything subtler going on?

Nope, nothing subtle here :)

thanks,

greg k-h

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

end of thread, other threads:[~2004-11-13 21:15 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-12 22:58 [BK PATCH] More Driver Core patches for 2.6.10-rc1 Greg KH
2004-11-12 23:00 ` [PATCH] " Greg KH
2004-11-12 23:00   ` Greg KH
2004-11-12 23:00     ` Greg KH
2004-11-12 23:00       ` Greg KH
2004-11-12 23:00         ` Greg KH
2004-11-12 23:00           ` Greg KH
2004-11-12 23:00             ` Greg KH
2004-11-12 23:00               ` Greg KH
2004-11-12 23:00                 ` Greg KH
     [not found]     ` <20041113000052.GC346@electric-eye.fr.zoreil.com>
     [not found]       ` <200411130020.17494.lists@kenneth.aafloy.net>
2004-11-13  0:44         ` Greg KH
2004-11-13 20:51 ` [BK PATCH] " Linus Torvalds
2004-11-13 21:10   ` Greg KH
  -- strict thread matches above, loose matches on Subject: below --
2004-11-05  0:47 Greg KH

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.