fixes for 2.6.13-rc6
Subsystems (5)
cover fixes for 2.6.13-rc6
Here are a series of patches against 2.6.13-rc6 that fix a few minor bugs in the driver core, USB, and PCI subsystems.
thanks,
greg k-h
PATCH 1/7 Driver core: potentially fix use after free in class_device_attr_show
From: Maneesh Soni <[email protected]>
o moves the code to free devt_attr from class_device_del() to class_dev_release() which is called after the last reference to the corresponding kobject() is gone. This allows to keep the devt_attr alive while the corresponding sysfs file is open.
--- drivers/base/class.c | 10 ++++++---- 1 files changed, 6 insertions(+), 4 deletions(-)
drivers/base/class.c +6 -4
@@ -299,6 +299,11 @@ static void class_dev_release(struct kobpr_debug ("device class '%s': release.\n" , cd->class_id); +if (cd->devt_attr) { +kfree (cd->devt_attr); + cd->devt_attr =NULL ; + } +if (cls->release) cls->release (cd);else {
@@ -591,11 +596,8 @@ void class_device_del(struct class_devicif (class_dev->dev)sysfs_remove_link (&class_dev->kobj,"device" ); -if (class_dev->devt_attr) { +if (class_dev->devt_attr)class_device_remove_file (class_dev, class_dev->devt_attr); -kfree (class_dev->devt_attr); - class_dev->devt_attr =NULL ; - }class_device_remove_attrs (class_dev);kobject_hotplug (&class_dev->kobj,KOBJ_REMOVE );
--
PATCH 2/7 PCI: 6700/6702PXH quirk
In reply to Greg Kroah-HartmanFrom: Kristen Accardi <[email protected]>
On the 6700/6702 PXH part, a MSI may get corrupted if an ACPI hotplug driver and SHPC driver in MSI mode are used together. This patch will prevent MSI from being enabled for the SHPC as part of an early pci quirk, as well as on any pci device which sets the no_msi bit.
--- drivers/pci/msi.c | 5 ++++- drivers/pci/pci.h | 2 +- drivers/pci/quirks.c | 21 +++++++++++++++++++++ include/linux/pci.h | 3 ++- include/linux/pci_ids.h | 5 +++++ 5 files changed, 33 insertions(+), 3 deletions(-)
drivers/pci/msi.c +4 -1
@@ -453,7 +453,7 @@ static void enable_msi_mode(struct pci_d } } -static void disable_msi_mode (struct pci_dev *dev,int pos,int type) +void disable_msi_mode (struct pci_dev *dev,int pos,int type) {u16 control;
@@ -699,6 +699,9 @@ int pci_enable_msi(struct pci_dev* dev)if (!pci_msi_enable || !dev)return status; +if (dev->no_msi) +return status; + temp = dev->irq;if ((status =msi_init ()) <0 )
drivers/pci/pci.h +1 -1
@@ -46,7 +46,7 @@ extern int pci_msi_quirk;#else #define pci_msi_quirk 0#endif - +void disable_msi_mode (struct pci_dev *dev,int pos,int type);extern int pcie_mch_quirk;extern struct device_attribute pci_dev_attrs[];extern struct class_device_attribute class_device_attr_cpuaffinity;
drivers/pci/quirks.c +21 -0
@@ -1291,6 +1291,27 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INDECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_INTEL ,PCI_DEVICE_ID_INTEL_E7320_MCH , quirk_pcie_mch );DECLARE_PCI_FIXUP_FINAL (PCI_VENDOR_ID_INTEL ,PCI_DEVICE_ID_INTEL_E7525_MCH , quirk_pcie_mch ); + +/* +* It's possible for the MSI to get corrupted if shpc and acpi +* are used together on certain PXH-based systems. +*/ +static void __devinit quirk_pcie_pxh (struct pci_dev *dev) +{ +disable_msi_mode (dev,pci_find_capability (dev,PCI_CAP_ID_MSI ), +PCI_CAP_ID_MSI ); + dev->no_msi =1 ; + +printk (KERN_WARNING "PCI: PXH quirk detected, " +"disabling MSI for SHPC device\n" ); +} +DECLARE_PCI_FIXUP_EARLY (PCI_VENDOR_ID_INTEL ,PCI_DEVICE_ID_INTEL_PXHD_0 , quirk_pcie_pxh); +DECLARE_PCI_FIXUP_EARLY (PCI_VENDOR_ID_INTEL ,PCI_DEVICE_ID_INTEL_PXHD_1 , quirk_pcie_pxh); +DECLARE_PCI_FIXUP_EARLY (PCI_VENDOR_ID_INTEL ,PCI_DEVICE_ID_INTEL_PXH_0 , quirk_pcie_pxh); +DECLARE_PCI_FIXUP_EARLY (PCI_VENDOR_ID_INTEL ,PCI_DEVICE_ID_INTEL_PXH_1 , quirk_pcie_pxh); +DECLARE_PCI_FIXUP_EARLY (PCI_VENDOR_ID_INTEL ,PCI_DEVICE_ID_INTEL_PXHV , quirk_pcie_pxh); + +static void __devinit quirk_netmos (struct pci_dev *dev) {unsigned int num_parallel = (dev->subsystem_device &0xf0 ) >>4 ;
include/linux/pci.h +2 -1
@@ -556,7 +556,8 @@ struct pci_dev {/* keep track of device state */ unsigned int is_enabled:1; /* pci_enable_device has been called */ unsigned int is_busmaster:1; /* device is busmaster */ - + unsigned int no_msi:1; /* device may not use msi */ +u32 saved_config_space[16 ];/* config space saved at suspend time */ struct bin_attribute *rom_attr;/* attribute descriptor for sysfs ROM entry */ int rom_attr_enabled;/* has display of the rom attribute been enabled? */
include/linux/pci_ids.h +5 -0
@@ -2281,6 +2281,11 @@#define PCI_VENDOR_ID_INTEL 0x8086#define PCI_DEVICE_ID_INTEL_EESSC 0x0008#define PCI_DEVICE_ID_INTEL_21145 0x0039 +#define PCI_DEVICE_ID_INTEL_PXHD_0 0x0320 +#define PCI_DEVICE_ID_INTEL_PXHD_1 0x0321 +#define PCI_DEVICE_ID_INTEL_PXH_0 0x0329 +#define PCI_DEVICE_ID_INTEL_PXH_1 0x032A +#define PCI_DEVICE_ID_INTEL_PXHV 0x032C#define PCI_DEVICE_ID_INTEL_82375 0x0482#define PCI_DEVICE_ID_INTEL_82424 0x0483#define PCI_DEVICE_ID_INTEL_82378 0x0484
--
PATCH 3/7 PCI: fix quirk-6700-fix.patch
In reply to Greg Kroah-HartmanFrom: Andrew Morton <[email protected]>
drivers/built-in.o(.text+0x32c3): In function `quirk_pcie_pxh':/usr/src/25/drivers/pci/quirks.c:1312: undefined reference to `disable_msi_mode'
--- drivers/pci/pci.h | 6 ++++++ 1 files changed, 6 insertions(+)
drivers/pci/pci.h +6 -0
@@ -46,7 +46,13 @@ extern int pci_msi_quirk;#else #define pci_msi_quirk 0#endif + +#ifdef CONFIG_PCI_MSI void disable_msi_mode (struct pci_dev *dev,int pos,int type); +#else +static inline void disable_msi_mode (struct pci_dev *dev,int pos,int type) { } +#endif +extern int pcie_mch_quirk;extern struct device_attribute pci_dev_attrs[];extern struct class_device_attribute class_device_attr_cpuaffinity;
--
Re: [patch 3/7] PCI: fix quirk-6700-fix.patch
Quoted 20 lines · Greg Kroah-Hartman
From: Andrew Morton <[email protected]>
drivers/built-in.o(.text+0x32c3): In function `quirk_pcie_pxh':
/usr/src/25/drivers/pci/quirks.c:1312: undefined reference to `disable_msi_mode'Signed-off-by Andrew Morton <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>--- drivers/pci/pci.h | 6 ++++++ 1 files changed, 6 insertions(+)drivers/pci/pci.h +0
-0@@ -46,7 +46,13 @@ extern int pci_msi_quirk;#else #define pci_msi_quirk 0#endif
drivers/pci/pci.h extern int pci_msi_quirk; · line 58
Quoted 10 lines
drivers/pci/pci.h +6
-0+ +#ifdef CONFIG_PCI_MSI void disable_msi_mode (struct pci_dev *dev,int pos,int type); +#else +static inline void disable_msi_mode (struct pci_dev *dev,int pos,int type) { } +#endif +extern int pcie_mch_quirk;extern struct device_attribute pci_dev_attrs[];extern struct class_device_attribute class_device_attr_cpuaffinity;
hm. I normally fold crappy little patches like this into the main patch before sending it Linuswards. The submitter gets a mention in the s-o-b record and perhaps a one-line description if the fix was less than utterly trivial.
That's one advantage of the patch-scripts/quilt approach: these little post-facto fixups don't pollute the upstream changelog record.
Re: [patch 3/7] PCI: fix quirk-6700-fix.patch
Quoted 5 lines · Andrew Morton
hm. I normally fold crappy little patches like this into the main patch before sending it Linuswards. The submitter gets a mention in the s-o-b record and perhaps a one-line description if the fix was less than utterly trivial.
Ok, I will do that in the future, I just wanted to make sure everyone got the proper credit.
thanks,
greg k-h
PATCH 4/7 PCI Hotplug: new contact info
In reply to Greg Kroah-HartmanFrom: Kristen Accardi <[email protected]>
--- MAINTAINERS | 12 ++++++++++++ drivers/pci/hotplug/pciehp.h | 2 +- drivers/pci/hotplug/pciehp_core.c | 2 +- drivers/pci/hotplug/pciehp_ctrl.c | 2 +- drivers/pci/hotplug/pciehp_hpc.c | 2 +- drivers/pci/hotplug/pciehp_pci.c | 2 +- drivers/pci/hotplug/pciehprm.h | 2 +- drivers/pci/hotplug/pciehprm_acpi.c | 2 +- drivers/pci/hotplug/pciehprm_nonacpi.c | 2 +- drivers/pci/hotplug/pciehprm_nonacpi.h | 2 +- drivers/pci/hotplug/shpchp.h | 2 +- drivers/pci/hotplug/shpchp_core.c | 2 +- drivers/pci/hotplug/shpchp_ctrl.c | 2 +- drivers/pci/hotplug/shpchp_hpc.c | 2 +- drivers/pci/hotplug/shpchp_pci.c | 2 +- drivers/pci/hotplug/shpchprm.h | 2 +- drivers/pci/hotplug/shpchprm_acpi.c | 2 +- drivers/pci/hotplug/shpchprm_legacy.c | 2 +- drivers/pci/hotplug/shpchprm_legacy.h | 2 +- drivers/pci/hotplug/shpchprm_nonacpi.c | 2 +- drivers/pci/hotplug/shpchprm_nonacpi.h | 2 +- 21 files changed, 32 insertions(+), 20 deletions(-)
drivers/pci/hotplug/pciehp_core.c +1 -1
@@ -23,7 +23,7 @@* along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * -* Send feedback to <[email protected]>, <[email protected]> +* Send feedback to <[email protected]>, <[email protected]> * */
drivers/pci/hotplug/pciehp_ctrl.c +1 -1
@@ -23,7 +23,7 @@* along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * -* Send feedback to <[email protected]>, <[email protected]> +* Send feedback to <[email protected]>, <[email protected]> * */
drivers/pci/hotplug/pciehp.h +1 -1
@@ -23,7 +23,7 @@* along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * -* Send feedback to <[email protected]>, <[email protected]> +* Send feedback to <[email protected]>, <[email protected]> * */ #ifndef _PCIEHP_H
drivers/pci/hotplug/pciehp_hpc.c +1 -1
@@ -23,7 +23,7 @@* along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * -* Send feedback to <[email protected]>,<[email protected]> +* Send feedback to <[email protected]>,<[email protected]> * */
drivers/pci/hotplug/pciehp_pci.c +1 -1
@@ -23,7 +23,7 @@* along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * -* Send feedback to <[email protected]>, <[email protected]> +* Send feedback to <[email protected]>, <[email protected]> * */
drivers/pci/hotplug/pciehprm_acpi.c +1 -1
@@ -20,7 +20,7 @@* along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * -* Send feedback to <[email protected]> +* Send feedback to <[email protected]> * */
drivers/pci/hotplug/pciehprm.h +1 -1
@@ -23,7 +23,7 @@* along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * -* Send feedback to <[email protected]>, <[email protected]> +* Send feedback to <[email protected]>, <[email protected]> * */
drivers/pci/hotplug/pciehprm_nonacpi.c +1 -1
@@ -23,7 +23,7 @@* along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * -* Send feedback to <[email protected]>, <[email protected]> +* Send feedback to <[email protected]>, <[email protected]> * */
drivers/pci/hotplug/pciehprm_nonacpi.h +1 -1
@@ -23,7 +23,7 @@* along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * -* Send feedback to <[email protected]>, <[email protected]> +* Send feedback to <[email protected]>, <[email protected]> * */
drivers/pci/hotplug/shpchp_core.c +1 -1
@@ -23,7 +23,7 @@* along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * -* Send feedback to <[email protected]>, <[email protected]> +* Send feedback to <[email protected]>, <[email protected]> * */
drivers/pci/hotplug/shpchp_ctrl.c +1 -1
@@ -23,7 +23,7 @@* along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * -* Send feedback to <[email protected]>, <[email protected]> +* Send feedback to <[email protected]>, <[email protected]> * */
drivers/pci/hotplug/shpchp.h +1 -1
@@ -23,7 +23,7 @@* along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * -* Send feedback to <[email protected]>,<[email protected]> +* Send feedback to <[email protected]>,<[email protected]> * */ #ifndef _SHPCHP_H
drivers/pci/hotplug/shpchp_hpc.c +1 -1
@@ -23,7 +23,7 @@* along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * -* Send feedback to <[email protected]>,<[email protected]> +* Send feedback to <[email protected]>,<[email protected]> * */
drivers/pci/hotplug/shpchp_pci.c +1 -1
@@ -23,7 +23,7 @@* along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * -* Send feedback to <[email protected]>, <[email protected]> +* Send feedback to <[email protected]>, <[email protected]> * */
drivers/pci/hotplug/shpchprm_acpi.c +1 -1
@@ -20,7 +20,7 @@* along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * -* Send feedback to <[email protected]> +* Send feedback to <[email protected]> * */
drivers/pci/hotplug/shpchprm.h +1 -1
@@ -23,7 +23,7 @@* along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * -* Send feedback to <[email protected]>, <[email protected]> +* Send feedback to <[email protected]>, <[email protected]> * */
drivers/pci/hotplug/shpchprm_legacy.c +1 -1
@@ -23,7 +23,7 @@* along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * -* Send feedback to <[email protected]>,<[email protected]> +* Send feedback to <[email protected]>,<[email protected]> * */
drivers/pci/hotplug/shpchprm_legacy.h +1 -1
@@ -23,7 +23,7 @@* along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * -* Send feedback to <[email protected]>, <[email protected]> +* Send feedback to <[email protected]>, <[email protected]> * */
drivers/pci/hotplug/shpchprm_nonacpi.c +1 -1
@@ -23,7 +23,7 @@* along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * -* Send feedback to <[email protected]>, <[email protected]> +* Send feedback to <[email protected]>, <[email protected]> * */
drivers/pci/hotplug/shpchprm_nonacpi.h +1 -1
@@ -23,7 +23,7 @@* along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * -* Send feedback to <[email protected]>, <[email protected]> +* Send feedback to <[email protected]>, <[email protected]> * */
MAINTAINERS +12 -0
@@ -1825,6 +1825,12 @@ P: Greg Kroah-Hartman M: [email protected] S: Maintained +PCIE HOTPLUG DRIVER +P: Kristen Carlson Accardi +M: [email protected] +L: [email protected] +S: Maintained + PCMCIA SUBSYSTEM P: Linux PCMCIA Team L: http://lists.infradead.org/mailman/listinfo/linux-pcmcia
@@ -2201,6 +2207,12 @@ W: http://projects.buici.com/arm L: [email protected] (subscribers-only) S: Maintained +SHPC HOTPLUG DRIVER +P: Kristen Carlson Accardi +M: [email protected] +L: [email protected] +S: Maintained + SPARC (sparc32): P: William L. Irwin M: [email protected]
--
PATCH 5/7 PCI: update documentation
In reply to Greg Kroah-HartmanFrom: Jiri Slaby <[email protected]>
This removes very old functions from pci docs, which aren't no longer in the kernel.
--- Documentation/pci.txt | 14 -------------- 1 files changed, 14 deletions(-)
Documentation/pci.txt +0 -14
@@ -266,20 +266,6 @@ port an old driver to the new PCI interf in the kernel as they aren't compatible with hotplug or PCI domains or having sane locking. -pcibios_present() and Since ages, you don't need to test presence -pci_present() of PCI subsystem when trying to talk to it. - If it's not there, the list of PCI devices - is empty and all functions for searching for - devices just return NULL. -pcibios_(read|write)_* Superseded by their pci_(read|write)_* - counterparts. -pcibios_find_* Superseded by their pci_get_* counterparts. -pci_for_each_dev() Superseded by pci_get_device() -pci_for_each_dev_reverse() Superseded by pci_find_device_reverse() -pci_for_each_bus() Superseded by pci_find_next_bus() pci_find_device() Superseded by pci_get_device() pci_find_subsys() Superseded by pci_get_subsys() pci_find_slot() Superseded by pci_get_slot() -pcibios_find_class() Superseded by pci_get_class() -pci_find_class() Superseded by pci_get_class() -pci_(read|write)_*_nodev() Superseded by pci_bus_(read|write)_*()
--
PATCH 6/7 USB: fix usb wacom tablet driver bug
In reply to Greg Kroah-HartmanFrom: Ping Cheng <[email protected]>
This patch fixes bug 4905 and a Cintiq 21UX bug.
--- drivers/usb/input/wacom.c | 21 ++++++++++----------- 1 files changed, 10 insertions(+), 11 deletions(-)
drivers/usb/input/wacom.c +10 -11
@@ -342,9 +342,6 @@ static void wacom_graphire_irq(struct ur goto exit; } - x =le16_to_cpu (*(__le16 *) &data[2 ]); - y =le16_to_cpu (*(__le16 *) &data[4 ]); -input_regs (dev, regs);if (data[1 ] &0x10 ) {/* in prox */
@@ -373,15 +370,17 @@ static void wacom_graphire_irq(struct ur } } -if (data[1 ] &0x80 ) { +if (data[1 ] &0x90 ) { + x =le16_to_cpu (*(__le16 *) &data[2 ]); + y =le16_to_cpu (*(__le16 *) &data[4 ]);input_report_abs (dev,ABS_X , x);input_report_abs (dev,ABS_Y , y); - } -if (wacom->tool[0 ] !=BTN_TOOL_MOUSE ) { -input_report_abs (dev,ABS_PRESSURE ,le16_to_cpu (*(__le16 *) &data[6 ])); -input_report_key (dev,BTN_TOUCH , data[1 ] &0x01 ); -input_report_key (dev,BTN_STYLUS , data[1 ] &0x02 ); -input_report_key (dev,BTN_STYLUS2 , data[1 ] &0x04 ); +if (wacom->tool[0 ] !=BTN_TOOL_MOUSE ) { +input_report_abs (dev,ABS_PRESSURE ,le16_to_cpu (*(__le16 *) &data[6 ])); +input_report_key (dev,BTN_TOUCH , data[1 ] &0x01 ); +input_report_key (dev,BTN_STYLUS , data[1 ] &0x02 ); +input_report_key (dev,BTN_STYLUS2 , data[1 ] &0x04 ); + } }input_report_key (dev, wacom->tool[0 ], data[1 ] &0x10 );
@@ -568,7 +567,7 @@ static void wacom_intuos_irq(struct urb/* Cintiq doesn't send data when RDY bit isn't set */ if ((wacom->features->type ==CINTIQ ) && !(data[1 ] &0x40 )) -return ; + goto exit;if (wacom->features->type >=INTUOS3 ) {input_report_abs (dev,ABS_X , (data[2 ] <<9 ) | (data[3 ] <<1 ) | ((data[9 ] >>1 ) &1 ));
--
PATCH 7/7 USB: usbmon: Copyrights and a typo
In reply to Greg Kroah-HartmanFrom: Pete Zaitcev <[email protected]>
Add copyright statements and fix a typo.
--- drivers/usb/mon/mon_main.c | 4 +++- drivers/usb/mon/usb_mon.h | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-)
drivers/usb/mon/mon_main.c +3 -1
@@ -2,6 +2,8 @@* The USB Monitor, inspired by Dave Harding's USBMon. * * mon_main.c: Main file, module initiation and exit, registrations, etc. +* +* Copyright (C) 2005 Pete Zaitcev ([email protected]) */ #include <linux/kernel.h>
@@ -311,7 +313,7 @@ mondir =debugfs_create_dir ("usbmon" ,NULL );if (IS_ERR (mondir)) { - printk(KERN_NOTICE TAG ": debugs is not available\n"); + printk(KERN_NOTICE TAG ": debugfs is not available\n");return -ENODEV ; }if (mondir ==NULL ) {
drivers/usb/mon/usb_mon.h +2 -0
@@ -1,5 +1,7 @@/* * The USB Monitor, inspired by Dave Harding's USBMon. +* +* Copyright (C) 2005 Pete Zaitcev ([email protected]) */ #ifndef __USB_MON_H
--