public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [BK PATCH] PCI fixes for 2.6.7-rc1
@ 2004-05-28 21:33 Greg KH
  2004-05-28 21:35 ` [PATCH] " Greg KH
  0 siblings, 1 reply; 7+ messages in thread
From: Greg KH @ 2004-05-28 21:33 UTC (permalink / raw)
  To: torvalds, akpm; +Cc: linux-kernel

Hi,

Here are some small PCI patches for 2.6.7-rc1.  They are a few pci id
updates, janitor fixes, and a suspend bus fix patch.  They have all been
in the last few -mm releases.

Please pull from:
	bk://kernel.bkbits.net/gregkh/linux/pci-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.


 drivers/pci/pci-driver.c |   26 ++++++++++++++++++++++++--
 drivers/pci/pci.c        |    5 +++++
 drivers/pci/pci.ids      |   26 +++++++++++++-------------
 drivers/pci/probe.c      |    2 ++
 include/linux/pci.h      |    5 +++++
 include/linux/pci_ids.h  |   16 ++++++++++++++++
 6 files changed, 65 insertions(+), 15 deletions(-)
-----

<trimmer:infiniconsys.com>:
  o PCI: Add InfiniCon PCI ID to pci_ids.h

Arjan van de Ven:
  o PCI: restore pci config space on resume

Greg Kroah-Hartman:
  o Reversed pci.ids changes, as Linus already fixed them in his tree
  o PCI: fix up build warnings in pci.ids file

Luiz Capitulino:
  o PCI: fix pci/probe.c possible NULL pointer

Roland Dreier:
  o PCI: Add InfiniBand HCA IDs to pci_ids.h


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

* [PATCH] PCI fixes for 2.6.7-rc1
  2004-05-28 21:33 [BK PATCH] PCI fixes for 2.6.7-rc1 Greg KH
@ 2004-05-28 21:35 ` Greg KH
  2004-05-28 21:35   ` Greg KH
  0 siblings, 1 reply; 7+ messages in thread
From: Greg KH @ 2004-05-28 21:35 UTC (permalink / raw)
  To: linux-kernel

ChangeSet 1.1717.6.23, 2004/05/18 23:56:57-07:00, greg@kroah.com

[PATCH] PCI: fix up build warnings in pci.ids file.


 drivers/pci/pci.ids |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)


diff -Nru a/drivers/pci/pci.ids b/drivers/pci/pci.ids
--- a/drivers/pci/pci.ids	Fri May 28 14:29:25 2004
+++ b/drivers/pci/pci.ids	Fri May 28 14:29:25 2004
@@ -2331,7 +2331,7 @@
 	c801  PCI-GPIB
 	c831  PCI-GPIB bridge
 1094  First International Computers [FIC]
-1095  Silicon Image, Inc. (formerly CMD Technology Inc)
+1095  Silicon Image, Inc.
 	0240  Adaptec AAR-1210SA SATA HostRAID Controller
 	0640  PCI0640
 	0643  PCI0643
@@ -5155,7 +5155,7 @@
 	9132  Ethernet 100/10 MBit
 1283  Integrated Technology Express, Inc.
 	673a  IT8330G
-	8212  IT/ITE8212 Dual channel ATA RAID controller (PCI version seems to be IT8212, embedded seems to be ITE8212)
+	8212  IT/ITE8212 Dual channel ATA RAID controller
 	8330  IT8330G
 	8872  IT8874F PCI Dual Serial Port Controller
 	8888  IT8888F PCI to ISA Bridge with SMB
@@ -6098,7 +6098,7 @@
 	0340  PC4800
 	0350  PC4800
 	4500  PC4500
-	4800  Cisco Aironet 340 802.11b Wireless LAN Adapter/Aironet PC4800
+	4800  Cisco Aironet 340 802.11b Wireless LAN Adapter
 	a504  Cisco Aironet Wireless 802.11b
 	a505  Cisco Aironet CB20a 802.11a Wireless LAN Adapter
 14ba  INTERNIX Inc.
@@ -6824,7 +6824,7 @@
 1629  Kongsberg Spacetec AS
 	1003  Format synchronizer v3.0
 	2002  Fast Universal Data Output
-1638  Standard Microsystems Corp [SMC]
+1638  SMC
 	1100  SMC2602W EZConnect / Addtron AWA-100 / Eumitcom PCI WL11000
 163c  Smart Link Ltd.
 	3052  SmartLink SmartPCI562 56K Modem


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

* Re: [PATCH] PCI fixes for 2.6.7-rc1
  2004-05-28 21:35 ` [PATCH] " Greg KH
@ 2004-05-28 21:35   ` Greg KH
  2004-05-28 21:35     ` Greg KH
  0 siblings, 1 reply; 7+ messages in thread
From: Greg KH @ 2004-05-28 21:35 UTC (permalink / raw)
  To: linux-kernel

ChangeSet 1.1717.6.24, 2004/05/18 23:57:17-07:00, roland@topspin.com

[PATCH] PCI: Add InfiniBand HCA IDs to pci_ids.h

Add InfiniBand HCA IDs to pci_ids.h.


 include/linux/pci_ids.h |    7 +++++++
 1 files changed, 7 insertions(+)


diff -Nru a/include/linux/pci_ids.h b/include/linux/pci_ids.h
--- a/include/linux/pci_ids.h	Fri May 28 14:29:20 2004
+++ b/include/linux/pci_ids.h	Fri May 28 14:29:20 2004
@@ -1870,6 +1870,11 @@
 #define PCI_VENDOR_ID_ZOLTRIX		0x15b0
 #define PCI_DEVICE_ID_ZOLTRIX_2BD0	0x2bd0 
 
+#define PCI_VENDOR_ID_MELLANOX		0x15b3
+#define PCI_DEVICE_ID_MELLANOX_TAVOR	0x5a44
+#define PCI_DEVICE_ID_MELLANOX_ARBEL_COMPAT 0x6278
+#define PCI_DEVICE_ID_MELLANOX_ARBEL	0x6282
+
 #define PCI_VENDOR_ID_PDC		0x15e9
 #define PCI_DEVICE_ID_PDC_1841		0x1841
 
@@ -1890,6 +1895,8 @@
 #define PCI_VENDOR_ID_S2IO		0x17d5
 #define	PCI_DEVICE_ID_S2IO_WIN		0x5731
 #define	PCI_DEVICE_ID_S2IO_UNI		0x5831
+
+#define PCI_VENDOR_ID_TOPSPIN		0x1867
 
 #define PCI_VENDOR_ID_ARC               0x192E
 #define PCI_DEVICE_ID_ARC_EHCI          0x0101


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

* Re: [PATCH] PCI fixes for 2.6.7-rc1
  2004-05-28 21:35   ` Greg KH
@ 2004-05-28 21:35     ` Greg KH
  2004-05-28 21:35       ` Greg KH
  0 siblings, 1 reply; 7+ messages in thread
From: Greg KH @ 2004-05-28 21:35 UTC (permalink / raw)
  To: linux-kernel

ChangeSet 1.1717.6.25, 2004/05/19 10:33:24-07:00, greg@kroah.com

Reversed pci.ids changes, as Linus already fixed them in his tree


 drivers/pci/pci.ids |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)


diff -Nru a/drivers/pci/pci.ids b/drivers/pci/pci.ids
--- a/drivers/pci/pci.ids	Fri May 28 14:29:15 2004
+++ b/drivers/pci/pci.ids	Fri May 28 14:29:15 2004
@@ -2331,7 +2331,7 @@
 	c801  PCI-GPIB
 	c831  PCI-GPIB bridge
 1094  First International Computers [FIC]
-1095  Silicon Image, Inc.
+1095  Silicon Image, Inc. (formerly CMD Technology Inc)
 	0240  Adaptec AAR-1210SA SATA HostRAID Controller
 	0640  PCI0640
 	0643  PCI0643
@@ -5155,7 +5155,7 @@
 	9132  Ethernet 100/10 MBit
 1283  Integrated Technology Express, Inc.
 	673a  IT8330G
-	8212  IT/ITE8212 Dual channel ATA RAID controller
+	8212  IT/ITE8212 Dual channel ATA RAID controller (PCI version seems to be IT8212, embedded seems to be ITE8212)
 	8330  IT8330G
 	8872  IT8874F PCI Dual Serial Port Controller
 	8888  IT8888F PCI to ISA Bridge with SMB
@@ -6098,7 +6098,7 @@
 	0340  PC4800
 	0350  PC4800
 	4500  PC4500
-	4800  Cisco Aironet 340 802.11b Wireless LAN Adapter
+	4800  Cisco Aironet 340 802.11b Wireless LAN Adapter/Aironet PC4800
 	a504  Cisco Aironet Wireless 802.11b
 	a505  Cisco Aironet CB20a 802.11a Wireless LAN Adapter
 14ba  INTERNIX Inc.
@@ -6824,7 +6824,7 @@
 1629  Kongsberg Spacetec AS
 	1003  Format synchronizer v3.0
 	2002  Fast Universal Data Output
-1638  SMC
+1638  Standard Microsystems Corp [SMC]
 	1100  SMC2602W EZConnect / Addtron AWA-100 / Eumitcom PCI WL11000
 163c  Smart Link Ltd.
 	3052  SmartLink SmartPCI562 56K Modem


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

* Re: [PATCH] PCI fixes for 2.6.7-rc1
  2004-05-28 21:35     ` Greg KH
@ 2004-05-28 21:35       ` Greg KH
  2004-05-28 21:35         ` Greg KH
  0 siblings, 1 reply; 7+ messages in thread
From: Greg KH @ 2004-05-28 21:35 UTC (permalink / raw)
  To: linux-kernel

ChangeSet 1.1717.6.26, 2004/05/26 15:37:25-07:00, arjanv@redhat.com

[PATCH] PCI: restore pci config space on resume

The patch below enhances the PCI layer with 2 things
1) enable and busmaster state are stored in the pci device struct
2) pci config space is stored to the pci device struct

with that, it is possible to make a generic pci resume method that restores
config space and reenables the device, including busmaster when appropriate.

One can rightfully argue that the driver resume method should do this, and
yes that is right. So the patch only does it for devices that don't have a
resume method. Like the main PCI bridge on my testbox of which the bios so
nicely forgets to restore the bus master bit during resume.. With this patch
my testbox resumes just fine while it, well, wasn't all too happy as you can
imagine without a busmaster pci bridge.


 drivers/pci/pci-driver.c |   26 ++++++++++++++++++++++++--
 drivers/pci/pci.c        |    5 +++++
 include/linux/pci.h      |    5 +++++
 3 files changed, 34 insertions(+), 2 deletions(-)


diff -Nru a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c
--- a/drivers/pci/pci-driver.c	Fri May 28 14:29:10 2004
+++ b/drivers/pci/pci-driver.c	Fri May 28 14:29:10 2004
@@ -299,10 +299,30 @@
 {
 	struct pci_dev * pci_dev = to_pci_dev(dev);
 	struct pci_driver * drv = pci_dev->driver;
+	int i = 0;
 
 	if (drv && drv->suspend)
-		return drv->suspend(pci_dev,state);
-	return 0;
+		i = drv->suspend(pci_dev,state);
+		
+	pci_save_state(pci_dev, pci_dev->saved_config_space);
+	return i;
+}
+
+
+/* 
+ * Default resume method for devices that have no driver provided resume,
+ * or not even a driver at all.
+ */
+static void pci_default_resume(struct pci_dev *pci_dev)
+{
+	/* restore the PCI config space */
+	pci_restore_state(pci_dev, pci_dev->saved_config_space);
+	/* if the device was enabled before suspend, reenable */
+	if (pci_dev->is_enabled)
+		pci_enable_device(pci_dev);
+	/* if the device was busmaster before the suspend, make it busmaster again */
+	if (pci_dev->is_busmaster)
+		pci_set_master(pci_dev);
 }
 
 static int pci_device_resume(struct device * dev)
@@ -312,6 +332,8 @@
 
 	if (drv && drv->resume)
 		drv->resume(pci_dev);
+	else
+		pci_default_resume(pci_dev);
 	return 0;
 }
 
diff -Nru a/drivers/pci/pci.c b/drivers/pci/pci.c
--- a/drivers/pci/pci.c	Fri May 28 14:29:10 2004
+++ b/drivers/pci/pci.c	Fri May 28 14:29:10 2004
@@ -385,6 +385,7 @@
 int
 pci_enable_device(struct pci_dev *dev)
 {
+	dev->is_enabled = 1;
 	return pci_enable_device_bars(dev, (1 << PCI_NUM_RESOURCES) - 1);
 }
 
@@ -399,6 +400,9 @@
 pci_disable_device(struct pci_dev *dev)
 {
 	u16 pci_command;
+	
+	dev->is_enabled = 0;
+	dev->is_busmaster = 0;
 
 	pci_read_config_word(dev, PCI_COMMAND, &pci_command);
 	if (pci_command & PCI_COMMAND_MASTER) {
@@ -601,6 +605,7 @@
 		cmd |= PCI_COMMAND_MASTER;
 		pci_write_config_word(dev, PCI_COMMAND, cmd);
 	}
+	dev->is_busmaster = 1;
 	pcibios_set_master(dev);
 }
 
diff -Nru a/include/linux/pci.h b/include/linux/pci.h
--- a/include/linux/pci.h	Fri May 28 14:29:10 2004
+++ b/include/linux/pci.h	Fri May 28 14:29:10 2004
@@ -488,6 +488,11 @@
 	/* These fields are used by common fixups */
 	unsigned int	transparent:1;	/* Transparent PCI bridge */
 	unsigned int	multifunction:1;/* Part of multi-function device */
+	/* 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 	saved_config_space[16]; /* config space saved at suspend time */
 #ifdef CONFIG_PCI_NAMES
 #define PCI_NAME_SIZE	96
 #define PCI_NAME_HALF	__stringify(43)	/* less than half to handle slop */


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

* Re: [PATCH] PCI fixes for 2.6.7-rc1
  2004-05-28 21:35         ` Greg KH
@ 2004-05-28 21:35           ` Greg KH
  0 siblings, 0 replies; 7+ messages in thread
From: Greg KH @ 2004-05-28 21:35 UTC (permalink / raw)
  To: linux-kernel

ChangeSet 1.1759, 2004/05/28 13:37:08-07:00, lcapitulino@prefeitura.sp.gov.br

[PATCH] PCI: fix pci/probe.c possible NULL pointer.

 In drivers/pci/probe.c::pci_scan_bridge() the call for pci_alloc_child_bus()
can return NULL, but it is not handled by the function (detected by
Coverity's checker).

 The patch bellow fix that returning `max' if we got the NULL, but
I do not know if it is right. I guess it is, because in that case
the function will act in the same way as with `pass != 0'.

Signed-off by: Luiz Capitulino <lcapitulino@prefeitura.sp.gov.br>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>


 drivers/pci/probe.c |    2 ++
 1 files changed, 2 insertions(+)


diff -Nru a/drivers/pci/probe.c b/drivers/pci/probe.c
--- a/drivers/pci/probe.c	Fri May 28 14:28:53 2004
+++ b/drivers/pci/probe.c	Fri May 28 14:28:53 2004
@@ -366,6 +366,8 @@
 			return max;
 		busnr = (buses >> 8) & 0xFF;
 		child = pci_alloc_child_bus(bus, dev, busnr);
+		if (!child)
+			return max;
 		child->primary = buses & 0xFF;
 		child->subordinate = (buses >> 16) & 0xFF;
 		child->bridge_ctl = bctl;


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

* Re: [PATCH] PCI fixes for 2.6.7-rc1
  2004-05-28 21:35       ` Greg KH
@ 2004-05-28 21:35         ` Greg KH
  2004-05-28 21:35           ` Greg KH
  0 siblings, 1 reply; 7+ messages in thread
From: Greg KH @ 2004-05-28 21:35 UTC (permalink / raw)
  To: linux-kernel

ChangeSet 1.1758, 2004/05/28 13:36:07-07:00, trimmer@infiniconsys.com

[PATCH] PCI: Add InfiniCon PCI ID to pci_ids.h

We would like to have the InfiniCon PCI Vendor ID added to pci_ids.h
Below is a context diff, which would would greatly appreciate if you
applied and included in future kernel releases.

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


 include/linux/pci_ids.h |    2 ++
 1 files changed, 2 insertions(+)


diff -Nru a/include/linux/pci_ids.h b/include/linux/pci_ids.h
--- a/include/linux/pci_ids.h	Fri May 28 14:28:59 2004
+++ b/include/linux/pci_ids.h	Fri May 28 14:28:59 2004
@@ -1910,6 +1910,8 @@
 #define	PCI_DEVICE_ID_S2IO_WIN		0x5731
 #define	PCI_DEVICE_ID_S2IO_UNI		0x5831
 
+#define PCI_VENDOR_ID_INFINICON		0x1820
+
 #define PCI_VENDOR_ID_TOPSPIN		0x1867
 
 #define PCI_VENDOR_ID_ARC               0x192E


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

end of thread, other threads:[~2004-05-28 22:04 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-05-28 21:33 [BK PATCH] PCI fixes for 2.6.7-rc1 Greg KH
2004-05-28 21:35 ` [PATCH] " Greg KH
2004-05-28 21:35   ` Greg KH
2004-05-28 21:35     ` Greg KH
2004-05-28 21:35       ` Greg KH
2004-05-28 21:35         ` Greg KH
2004-05-28 21:35           ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox