Skip to contentSkip to conversation

Pull request for 'sis190' branch

PATCH In review Francois Romieu 2 participants 7 messages Dec 10, 2007 – Dec 26, 2007

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

cover Pull request for 'sis190' branch

Please pull from branch 'sis190' in repository

git://git.kernel.org/pub/scm/linux/kernel/git/romieu/netdev-2.6.git sis190

to get the changes below.

Distance from 'upstream-linus' (7962024e9d16e9349d76b553326f3fa7be64305e)
-------------------------------------------------------------------------

c27e14e508664471b8e44ef1f81ec080213ea314
348de67fe200e25d8cb80cff35642192436cfeda
004a22d03d62cd08e5287273a5143447db009cd0
14deb44ffe7220be2de697d616f28cce17e72297

Diffstat
--------

 drivers/net/sis190.c |   21 ++++++++++-----------
 1 files changed, 10 insertions(+), 11 deletions(-)

Shortlog
--------

Francois Romieu (4):
sis190: add cmos ram access code for the SiS19x/968 chipset pair
sis190: remove duplicate INIT_WORK
sis190: mdio operation failure is not correctly detected
sis190: scheduling while atomic error

Patch
-----

drivers/net/sis190.c +10 -11
index 7200883..c0db182 100644
@@ -372,7 +372,7 @@ static void __mdio_cmd(void __iomem *ioaddr, u32 ctl)
 		msleep(1);
 	}
 
-	if (i > 999)
+	if (i > 99)
 		printk(KERN_ERR PFX "PHY command failed !\n");
 }
 
@@ -847,10 +847,8 @@ static void sis190_soft_reset(void __iomem *ioaddr)
 {
 	SIS_W32(IntrControl, 0x8000);
 	SIS_PCI_COMMIT();
-	msleep(1);
 	SIS_W32(IntrControl, 0x0);
 	sis190_asic_down(ioaddr);
-	msleep(1);
 }
 
 static void sis190_hw_start(struct net_device *dev)
@@ -1041,8 +1039,6 @@ static int sis190_open(struct net_device *dev)
 	if (rc < 0)
 		goto err_free_rx_1;
 
-	INIT_WORK(&tp->phy_task, sis190_phy_task);
-
 	sis190_request_timer(dev);
 
 	rc = request_irq(dev->irq, sis190_interrupt, IRQF_SHARED, dev->name, dev);
@@ -1549,28 +1545,31 @@ static int __devinit sis190_get_mac_addr_from_eeprom(struct pci_dev *pdev,
 }
 
 /**
- *	sis190_get_mac_addr_from_apc - Get MAC address for SiS965 model
+ *	sis190_get_mac_addr_from_apc - Get MAC address for SiS96x model
  *	@pdev: PCI device
  *	@dev:  network device to get address for
  *
- *	SiS965 model, use APC CMOS RAM to store MAC address.
+ *	SiS96x model, use APC CMOS RAM to store MAC address.
  *	APC CMOS RAM is accessed through ISA bridge.
  *	MAC address is read into @net_dev->dev_addr.
  */
 static int __devinit sis190_get_mac_addr_from_apc(struct pci_dev *pdev,
 						  struct net_device *dev)
 {
+	static const u16 __devinitdata ids[] = { 0x0965, 0x0966, 0x0968 };
 	struct sis190_private *tp = netdev_priv(dev);
 	struct pci_dev *isa_bridge;
 	u8 reg, tmp8;
-	int i;
+	unsigned int i;
 
 	net_probe(tp, KERN_INFO "%s: Read MAC address from APC.\n",
 		  pci_name(pdev));
 
-	isa_bridge = pci_get_device(PCI_VENDOR_ID_SI, 0x0965, NULL);
-	if (!isa_bridge)
-		isa_bridge = pci_get_device(PCI_VENDOR_ID_SI, 0x0966, NULL);
+	for (i = 0; i < ARRAY_SIZE(ids); i++) {
+		isa_bridge = pci_get_device(PCI_VENDOR_ID_SI, ids[i], NULL);
+		if (isa_bridge)
+			break;
+	}
 
 	if (!isa_bridge) {
 		net_probe(tp, KERN_INFO "%s: Can not find ISA bridge.\n",
Signature · 1 line
Ueimor
#1 lore raw

PATCH 1/4 sis190: add cmos ram access code for the SiS19x/968 chipset pair

More work is needed to handle correctly the PHY of the new devices when connected to a 10Mb link but this change already helps some users as is.

Fix for:
http://bugzilla.kernel.org/show_bug.cgi?id=9467

Cc K.M. Liu <[email protected]>
Cc J. Gleacher <[email protected]>
Cc Alexandre Penasso Teixeira <[email protected]>
Cc Arliton Rocha <[email protected]>
Cc Juan Jose Pablos <[email protected]>
Cc Wipat Srutiprom <[email protected]>
---
 drivers/net/sis190.c |   15 +++++++++------
 1 files changed, 9 insertions(+), 6 deletions(-)
drivers/net/sis190.c +9 -6
index 7200883..51bbb60 100644
@@ -1549,28 +1549,31 @@ static int __devinit sis190_get_mac_addr_from_eeprom(struct pci_dev *pdev,
 }
 
 /**
- *	sis190_get_mac_addr_from_apc - Get MAC address for SiS965 model
+ *	sis190_get_mac_addr_from_apc - Get MAC address for SiS96x model
  *	@pdev: PCI device
  *	@dev:  network device to get address for
  *
- *	SiS965 model, use APC CMOS RAM to store MAC address.
+ *	SiS96x model, use APC CMOS RAM to store MAC address.
  *	APC CMOS RAM is accessed through ISA bridge.
  *	MAC address is read into @net_dev->dev_addr.
  */
 static int __devinit sis190_get_mac_addr_from_apc(struct pci_dev *pdev,
 						  struct net_device *dev)
 {
+	static const u16 __devinitdata ids[] = { 0x0965, 0x0966, 0x0968 };
 	struct sis190_private *tp = netdev_priv(dev);
 	struct pci_dev *isa_bridge;
 	u8 reg, tmp8;
-	int i;
+	unsigned int i;
 
 	net_probe(tp, KERN_INFO "%s: Read MAC address from APC.\n",
 		  pci_name(pdev));
 
-	isa_bridge = pci_get_device(PCI_VENDOR_ID_SI, 0x0965, NULL);
-	if (!isa_bridge)
-		isa_bridge = pci_get_device(PCI_VENDOR_ID_SI, 0x0966, NULL);
+	for (i = 0; i < ARRAY_SIZE(ids); i++) {
+		isa_bridge = pci_get_device(PCI_VENDOR_ID_SI, ids[i], NULL);
+		if (isa_bridge)
+			break;
+	}
 
 	if (!isa_bridge) {
 		net_probe(tp, KERN_INFO "%s: Can not find ISA bridge.\n",
Signature · 1 line
1.5.3.3
#2 lore raw

PATCH 2/4 sis190: remove duplicate INIT_WORK

In reply to Francois Romieu

It is already done in sis190_init_one.

---
 drivers/net/sis190.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
drivers/net/sis190.c +0 -2
index 51bbb60..f6a921c 100644
@@ -1041,8 +1041,6 @@ static int sis190_open(struct net_device *dev)
 	if (rc < 0)
 		goto err_free_rx_1;
 
-	INIT_WORK(&tp->phy_task, sis190_phy_task);
-
 	sis190_request_timer(dev);
 
 	rc = request_irq(dev->irq, sis190_interrupt, IRQF_SHARED, dev->name, dev);
Signature · 1 line
1.5.3.3
#3 lore raw

PATCH 3/4 sis190: mdio operation failure is not correctly detected

In reply to Francois Romieu

i ranges from 0 to 100 in the 'for' loop a few lines above.

Reported by davem.

---
 drivers/net/sis190.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/net/sis190.c +1 -1
index f6a921c..973b369 100644
@@ -372,7 +372,7 @@ static void __mdio_cmd(void __iomem *ioaddr, u32 ctl)
 		msleep(1);
 	}
 
-	if (i > 999)
+	if (i > 99)
 		printk(KERN_ERR PFX "PHY command failed !\n");
 }
 
Signature · 1 line
1.5.3.3
#4 lore raw

PATCH 4/4 sis190: scheduling while atomic error

In reply to Francois Romieu

sis190_tx_timeout
-> sis190_hw_start
-> sis190_soft_reset

      -> msleep *splat*

PCI transactions are correctly flushed here.
The msleep() is probably useless.

---
 drivers/net/sis190.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
drivers/net/sis190.c +0 -2
index 973b369..c0db182 100644
@@ -847,10 +847,8 @@ static void sis190_soft_reset(void __iomem *ioaddr)
 {
 	SIS_W32(IntrControl, 0x8000);
 	SIS_PCI_COMMIT();
-	msleep(1);
 	SIS_W32(IntrControl, 0x0);
 	sis190_asic_down(ioaddr);
-	msleep(1);
 }
 
 static void sis190_hw_start(struct net_device *dev)
Signature · 1 line
1.5.3.3
#5 lore raw
In reply to Francois Romieu
Quoted 20 lines · Francois Romieu

Please pull from branch 'sis190' in repository

git://git.kernel.org/pub/scm/linux/kernel/git/romieu/netdev-2.6.git sis190

to get the changes below.

Distance from 'upstream-linus' (7962024e9d16e9349d76b553326f3fa7be64305e)
-------------------------------------------------------------------------

c27e14e508664471b8e44ef1f81ec080213ea314
348de67fe200e25d8cb80cff35642192436cfeda
004a22d03d62cd08e5287273a5143447db009cd0
14deb44ffe7220be2de697d616f28cce17e72297

Diffstat
--------

 drivers/net/sis190.c |   21 ++++++++++-----------
 1 files changed, 10 insertions(+), 11 deletions(-)
Quoted 8 lines

Shortlog
--------

Francois Romieu (4):
sis190: add cmos ram access code for the SiS19x/968 chipset pair
sis190: remove duplicate INIT_WORK
sis190: mdio operation failure is not correctly detected
sis190: scheduling while atomic error

pulled into #upstream

#6 lore raw

Jeff Garzik <[email protected]> :
[...]

Quoted 10 lines
Quoted 8 lines

Shortlog
--------

Francois Romieu (4):
sis190: add cmos ram access code for the SiS19x/968 chipset pair
sis190: remove duplicate INIT_WORK
sis190: mdio operation failure is not correctly detected
sis190: scheduling while atomic error

pulled into #upstream

Imho no owner of a 968 south bridge will be able to use his integrated network device as long as "sis190: add cmos ram access code ..." is not included upstream. Waiting for 2.6.25 means no hardware support before march 2008.

Signature · 1 line
Ueimor