Skip to contentSkip to conversation

firmware: convert tg3 driver to request_firmware()

PATCH In review Jaswinder Singh 5 participants 13 messages Jun 18, 2008

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

PATCH 1/1 firmware: convert tg3 driver to request_firmware()

Firmware blob is big-endian starts with version numbers, followed by start address and length.
length = end_address_of_bss - start_address_of_text. Remainder is the blob to be loaded contiguously from start address.

--

drivers/net/Kconfig              |    8
drivers/net/tg3.c                |  782 ++++-----------------------------------
drivers/net/tg3.h                |    4
firmware/Makefile                |    2
firmware/WHENCE                  |   19
firmware/tigon/tg3.bin.ihex      |  175 ++++++++
firmware/tigon/tg3_tso.bin.ihex  |  446 ++++++++++++++++++++++
firmware/tigon/tg3_tso5.bin.ihex |  252 ++++++++++++
8 files changed, 992 insertions(+), 696 deletions(-)

create mode 100644 firmware/tigon/tg3.bin.ihex create mode 100644 firmware/tigon/tg3_tso.bin.ihex create mode 100644 firmware/tigon/tg3_tso5.bin.ihex

drivers/net/Kconfig +8 -0
index d53dcab..05b5e22 100644
@@ -2254,12 +2254,20 @@ config VIA_VELOCITY
 config TIGON3
 	tristate "Broadcom Tigon3 support"
 	depends on PCI
+	select FW_LOADER
 	help
 	  This driver supports Broadcom Tigon3 based gigabit Ethernet cards.
 
 	  To compile this driver as a module, choose M here: the module
 	  will be called tg3.  This is recommended.
 
+config TIGON3_FIRMWARE
+	bool "Include firmware for Broadcom Tigon3"
+	depends on TIGON3
+	---help---
+	  This includes firmware for Broadcom Tigon3 based gigabit Ethernet.
+	  Say 'N' and let it get loaded from userspace on demand.
+
 config BNX2
 	tristate "Broadcom NetXtremeII support"
 	depends on PCI
drivers/net/tg3.c +86 -696

916 lines not on this page · raw message

drivers/net/tg3.h +4 -0
index 0404f93..435ff9b 100644
@@ -2611,6 +2611,10 @@ struct tg3 {
 #define SST_25VF0X0_PAGE_SIZE		4098
 
 	struct ethtool_coalesce		coal;
+
+	/* firmware info */
+	const struct firmware		*fw;
+	u32				fw_len;
 };
 
 #endif /* !(_T3_H) */
firmware/Makefile +2 -0
index 305ec70..39db18b 100644
@@ -22,6 +22,8 @@ fw-shipped-$(CONFIG_E100_FIRMWARE) += e100/d101m_ucode.bin \
 		e100/d101s_ucode.bin e100/d102e_ucode.bin
 fw-shipped-$(CONFIG_ACENIC_TG1_FIRMWARE) += acenic_tg1.bin
 fw-shipped-$(CONFIG_ACENIC_TG1_FIRMWARE) += acenic_tg2.bin
+fw-shipped-$(CONFIG_TIGON3_FIRMWARE) += tigon/tg3.bin \
+		tigon/tg3_tso.bin tigon/tg3_tso5.bin
 fw-shipped-$(CONFIG_USB_SERIAL_KEYSPAN_MPR) += keyspan/mpr.fw
 fw-shipped-$(CONFIG_USB_SERIAL_KEYSPAN_USA18X) += keyspan/usa18x.fw
 fw-shipped-$(CONFIG_USB_SERIAL_KEYSPAN_USA19) += keyspan/usa19.fw
firmware/WHENCE +19 -0
index 83f05df..1ec779b 100644
@@ -259,3 +259,22 @@ Licence: Unknown
 Found in hex form in kernel source.
 
 --------------------------------------------------------------------------
+
+Driver: tigon3 -- Broadcom Tigon3 based gigabit Ethernet cards
+
+File: tigon/tg3.bin
+File: tigon/tg3_tso.bin
+File: tigon/tg3_tso5.bin
+
+Licence:
+ * Firmware is:
+ *	Derived from proprietary unpublished source code,
+ *	Copyright (C) 2000-2003 Broadcom Corporation.
+ *
+ *	Permission is hereby granted for the distribution of this firmware
+ *	data in hexadecimal or equivalent format, provided this copyright
+ *	notice is accompanying it.
+
+Found in hex form in kernel source.
+
+--------------------------------------------------------------------------
firmware/tigon/tg3.bin.ihex new file +175 -0

175 lines not on this page · raw message

firmware/tigon/tg3_tso.bin.ihex new file +446 -0

446 lines not on this page · raw message

firmware/tigon/tg3_tso5.bin.ihex new file +252 -0

252 lines not on this page · raw message

#1 lore raw
Quoted 16 lines · Jaswinder Singh

Firmware blob is big-endian starts with version numbers, followed by start address and length.
length = end_address_of_bss - start_address_of_text. Remainder is the blob to be loaded contiguously from start address.

--

drivers/net/Kconfig              |    8
drivers/net/tg3.c                |  782 ++++-----------------------------------
drivers/net/tg3.h                |    4
firmware/Makefile                |    2
firmware/WHENCE                  |   19
firmware/tigon/tg3.bin.ihex      |  175 ++++++++
firmware/tigon/tg3_tso.bin.ihex  |  446 ++++++++++++++++++++++
firmware/tigon/tg3_tso5.bin.ihex |  252 ++++++++++++
8 files changed, 992 insertions(+), 696 deletions(-)
Quoted 3 lines

create mode 100644 firmware/tigon/tg3.bin.ihex create mode 100644 firmware/tigon/tg3_tso.bin.ihex create mode 100644 firmware/tigon/tg3_tso5.bin.ihex

Sigh, this has the same problems as the last patch.

* the Kconfig for the firmware should default to 'Y', to make it harder for users to create a non-working driver.

* request_firmware() capability is clearly and obviously a separate logical change, and should not be included in the same patch as firmware separation.

It just makes the patch longer and more difficult to read and review with the two separate changes mushed together. Having separate patches also means it is easier to test and validate the loadable firmware approach.

* the firmware should live in the same dir as the driver, just like it has for its entire lifetime until now. It's silly to create a driver hierarchy in firmware/ that parallels the rest of the tree

* fedora-rawhide, debian-unstable, and similar targets must already be prepped for firmware installs (both from the kernel and via external firmware packages like ipw2200-firmware).

* all net driver patches should get copied to [email protected], which is where networking changes are discussed

This patch should not create ANY operational differences for users. Requiring additional steps such as "make firmware_install" in order for the user to achieve the same working driver as they had in the last kernel is an example of such a [script-breaking] operational difference.

We have to make it tough for users to screw this up. It's too easy to
create a non-working driver, with request_firmware()... as existing
distro support for firmwares has already proven in the field.

Jeff

#2 lore raw
Quoted 3 lines · Jeff Garzik

It just makes the patch longer and more difficult to read and review with the two separate changes mushed together. Having separate patches also means it is easier to test and validate the loadable firmware approach.

In this _particular_ case, because the big hex arrays were directly in tg3.c and not a header file, it might be a little easier to review the code changes for correctness if we post a cut-down patch which doesn't actually _remove_ the hex arrays, but instead just leaves them present but unused. That cut-down patch is below.

It still doesn't make sense to add a completely _new_ code path for loading firmware by request_firmware() though; that would just have to add new functions to parallel with each function touched by patch below, and it would be much harder to read the patch and actually see what's changing.

This is the patch we're seeking constructive review of:

drivers/net/tg3.c +86 -70
index 07b3f77..a70147d 100644
@@ -38,6 +38,7 @@
 #include <linux/workqueue.h>
 #include <linux/prefetch.h>
 #include <linux/dma-mapping.h>
+#include <linux/firmware.h>
 
 #include <net/checksum.h>
 #include <net/ip.h>
@@ -139,6 +140,9 @@ MODULE_AUTHOR("David S. Miller ([email protected]) and Jeff Garzik (jgarzik@pobox
 MODULE_DESCRIPTION("Broadcom Tigon3 ethernet driver");
 MODULE_LICENSE("GPL");
 MODULE_VERSION(DRV_MODULE_VERSION);
+MODULE_FIRMWARE("tigon/tg3.bin");
+MODULE_FIRMWARE("tigon/tg3_tso.bin");
+MODULE_FIRMWARE("tigon/tg3_tso5.bin");
 
 static int tg3_debug = -1;	/* -1 = use TG3_DEF_MSG_ENABLE as value */
 module_param(tg3_debug, int, 0);
@@ -5778,15 +5658,9 @@ static int tg3_halt_cpu(struct tg3 *tp, u32 offset)
 }
 
 struct fw_info {
-	unsigned int text_base;
-	unsigned int text_len;
-	const u32 *text_data;
-	unsigned int rodata_base;
-	unsigned int rodata_len;
-	const u32 *rodata_data;
-	unsigned int data_base;
-	unsigned int data_len;
-	const u32 *data_data;
+	unsigned int fw_base;
+	unsigned int fw_len;
+	const __be32 *fw_data;
 };
 
 /* tp->lock is held. */
@@ -5823,24 +5697,11 @@ static int tg3_load_firmware_cpu(struct tg3 *tp, u32 cpu_base, u32 cpu_scratch_b
 		write_op(tp, cpu_scratch_base + i, 0);
 	tw32(cpu_base + CPU_STATE, 0xffffffff);
 	tw32(cpu_base + CPU_MODE, tr32(cpu_base+CPU_MODE)|CPU_MODE_HALT);
-	for (i = 0; i < (info->text_len / sizeof(u32)); i++)
-		write_op(tp, (cpu_scratch_base +
-			      (info->text_base & 0xffff) +
-			      (i * sizeof(u32))),
-			 (info->text_data ?
-			  info->text_data[i] : 0));
-	for (i = 0; i < (info->rodata_len / sizeof(u32)); i++)
-		write_op(tp, (cpu_scratch_base +
-			      (info->rodata_base & 0xffff) +
-			      (i * sizeof(u32))),
-			 (info->rodata_data ?
-			  info->rodata_data[i] : 0));
-	for (i = 0; i < (info->data_len / sizeof(u32)); i++)
+	for (i = 0; i < (info->fw_len / sizeof(u32)); i++)
 		write_op(tp, (cpu_scratch_base +
-			      (info->data_base & 0xffff) +
+			      (info->fw_base & 0xffff) +
 			      (i * sizeof(u32))),
-			 (info->data_data ?
-			  info->data_data[i] : 0));
+			      be32_to_cpu(info->fw_data[i]));
 
 	err = 0;
 
@@ -5852,17 +5713,20 @@ out:
 static int tg3_load_5701_a0_firmware_fix(struct tg3 *tp)
 {
 	struct fw_info info;
+	const __be32 *fw_data;
 	int err, i;
 
-	info.text_base = TG3_FW_TEXT_ADDR;
-	info.text_len = TG3_FW_TEXT_LEN;
-	info.text_data = &tg3FwText[0];
-	info.rodata_base = TG3_FW_RODATA_ADDR;
-	info.rodata_len = TG3_FW_RODATA_LEN;
-	info.rodata_data = &tg3FwRodata[0];
-	info.data_base = TG3_FW_DATA_ADDR;
-	info.data_len = TG3_FW_DATA_LEN;
-	info.data_data = NULL;
+	fw_data = (void *)tp->fw->data;
+
+	/* Firmware blob starts with version numbers, followed by
+	   start address and length. We are setting complete length.
+	   length = end_address_of_bss - start_address_of_text.
+	   Remainder is the blob to be loaded contiguously
+	   from start address. */
+
+	info.fw_base = be32_to_cpu(fw_data[1]);
+	info.fw_len = tp->fw->size-12;
+	info.fw_data = &fw_data[3];
 
 	err = tg3_load_firmware_cpu(tp, RX_CPU_BASE,
 				    RX_CPU_SCRATCH_BASE, RX_CPU_SCRATCH_SIZE,
@@ -5878,21 +5742,21 @@ static int tg3_load_5701_a0_firmware_fix(struct tg3 *tp)
 
 	/* Now startup only the RX cpu. */
 	tw32(RX_CPU_BASE + CPU_STATE, 0xffffffff);
-	tw32_f(RX_CPU_BASE + CPU_PC,    TG3_FW_TEXT_ADDR);
+	tw32_f(RX_CPU_BASE + CPU_PC,    info.fw_base);
 
 	for (i = 0; i < 5; i++) {
-		if (tr32(RX_CPU_BASE + CPU_PC) = TG3_FW_TEXT_ADDR)
+		if (tr32(RX_CPU_BASE + CPU_PC) = info.fw_base)
 			break;
 		tw32(RX_CPU_BASE + CPU_STATE, 0xffffffff);
 		tw32(RX_CPU_BASE + CPU_MODE,  CPU_MODE_HALT);
-		tw32_f(RX_CPU_BASE + CPU_PC,    TG3_FW_TEXT_ADDR);
+		tw32_f(RX_CPU_BASE + CPU_PC,    info.fw_base);
 		udelay(1000);
 	}
 	if (i >= 5) {
 		printk(KERN_ERR PFX "tg3_load_firmware fails for %s "
 		       "to set RX CPU PC, is %08x should be %08x\n",
 		       tp->dev->name, tr32(RX_CPU_BASE + CPU_PC),
-		       TG3_FW_TEXT_ADDR);
+		       info.fw_base);
 		return -ENODEV;
 	}
 	tw32(RX_CPU_BASE + CPU_STATE, 0xffffffff);
@@ -5901,41 +5765,32 @@ static int tg3_load_5701_a0_firmware_fix(struct tg3 *tp)
 
 /* tp->lock is held. */
 static int tg3_load_tso_firmware(struct tg3 *tp)
 {
 	struct fw_info info;
+	const __be32 *fw_data;
 	unsigned long cpu_base, cpu_scratch_base, cpu_scratch_size;
 	int err, i;
 
 	if (tp->tg3_flags2 & TG3_FLG2_HW_TSO)
 		return 0;
 
+	fw_data = (void *)tp->fw->data;
+
+	/* Firmware blob starts with version numbers, followed by
+	   start address and length. We are setting complete length.
+	   length = end_address_of_bss - start_address_of_text.
+	   Remainder is the blob to be loaded contiguously
+	   from start address. */
+
+	info.fw_base = be32_to_cpu(fw_data[1]);
+	cpu_scratch_size = tp->fw_len;
+	info.fw_len = tp->fw->size-12;
+	info.fw_data = &fw_data[3];
+
 	if (GET_ASIC_REV(tp->pci_chip_rev_id) = ASIC_REV_5705) {
-		info.text_base = TG3_TSO5_FW_TEXT_ADDR;
-		info.text_len = TG3_TSO5_FW_TEXT_LEN;
-		info.text_data = &tg3Tso5FwText[0];
-		info.rodata_base = TG3_TSO5_FW_RODATA_ADDR;
-		info.rodata_len = TG3_TSO5_FW_RODATA_LEN;
-		info.rodata_data = &tg3Tso5FwRodata[0];
-		info.data_base = TG3_TSO5_FW_DATA_ADDR;
-		info.data_len = TG3_TSO5_FW_DATA_LEN;
-		info.data_data = &tg3Tso5FwData[0];
 		cpu_base = RX_CPU_BASE;
 		cpu_scratch_base = NIC_SRAM_MBUF_POOL_BASE5705;
-		cpu_scratch_size = (info.text_len +
-				    info.rodata_len +
-				    info.data_len +
-				    TG3_TSO5_FW_SBSS_LEN +
-				    TG3_TSO5_FW_BSS_LEN);
 	} else {
-		info.text_base = TG3_TSO_FW_TEXT_ADDR;
-		info.text_len = TG3_TSO_FW_TEXT_LEN;
-		info.text_data = &tg3TsoFwText[0];
-		info.rodata_base = TG3_TSO_FW_RODATA_ADDR;
-		info.rodata_len = TG3_TSO_FW_RODATA_LEN;
-		info.rodata_data = &tg3TsoFwRodata[0];
-		info.data_base = TG3_TSO_FW_DATA_ADDR;
-		info.data_len = TG3_TSO_FW_DATA_LEN;
-		info.data_data = &tg3TsoFwData[0];
 		cpu_base = TX_CPU_BASE;
 		cpu_scratch_base = TX_CPU_SCRATCH_BASE;
 		cpu_scratch_size = TX_CPU_SCRATCH_SIZE;
@@ -6455,21 +5808,21 @@ static int tg3_load_tso_firmware(struct tg3 *tp)
 
 	/* Now startup the cpu. */
 	tw32(cpu_base + CPU_STATE, 0xffffffff);
-	tw32_f(cpu_base + CPU_PC,    info.text_base);
+	tw32_f(cpu_base + CPU_PC,    info.fw_base);
 
 	for (i = 0; i < 5; i++) {
-		if (tr32(cpu_base + CPU_PC) = info.text_base)
+		if (tr32(cpu_base + CPU_PC) = info.fw_base)
 			break;
 		tw32(cpu_base + CPU_STATE, 0xffffffff);
 		tw32(cpu_base + CPU_MODE,  CPU_MODE_HALT);
-		tw32_f(cpu_base + CPU_PC,    info.text_base);
+		tw32_f(cpu_base + CPU_PC,    info.fw_base);
 		udelay(1000);
 	}
 	if (i >= 5) {
 		printk(KERN_ERR PFX "tg3_load_tso_firmware fails for %s "
 		       "to set CPU PC, is %08x should be %08x\n",
 		       tp->dev->name, tr32(cpu_base + CPU_PC),
-		       info.text_base);
+		       info.fw_base);
 		return -ENODEV;
 	}
 	tw32(cpu_base + CPU_STATE, 0xffffffff);
@@ -6731,11 +6084,7 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy)
 	else if (tp->tg3_flags2 & TG3_FLG2_TSO_CAPABLE) {
 		int fw_len;
 
-		fw_len = (TG3_TSO5_FW_TEXT_LEN +
-			  TG3_TSO5_FW_RODATA_LEN +
-			  TG3_TSO5_FW_DATA_LEN +
-			  TG3_TSO5_FW_SBSS_LEN +
-			  TG3_TSO5_FW_BSS_LEN);
+		fw_len = tp->fw_len;
 		fw_len = (fw_len + (0x80 - 1)) & ~(0x80 - 1);
 		tw32(BUFMGR_MB_POOL_ADDR,
 		     NIC_SRAM_MBUF_POOL_BASE5705 + fw_len);
@@ -12706,6 +12055,8 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
 	struct net_device *dev;
 	struct tg3 *tp;
 	int err, pm_cap;
+	const __be32 *fw_data;
+	const char *fw_name = NULL;
 	char str[40];
 	u64 dma_mask, persist_dma_mask;
 	DECLARE_MAC_BUF(mac);
@@ -12878,8 +12229,16 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
 
 	tg3_init_bufmgr_config(tp);
 
+	if (tp->pci_chip_rev_id = CHIPREV_ID_5701_A0)
+		fw_name = "tigon/tg3.bin";
+
 	if (tp->tg3_flags2 & TG3_FLG2_HW_TSO) {
 		tp->tg3_flags2 |= TG3_FLG2_TSO_CAPABLE;
+
+		if (GET_ASIC_REV(tp->pci_chip_rev_id) = ASIC_REV_5705)
+			fw_name = "tigon/tg3_tso5.bin";
+		else
+			fw_name = "tigon/tg3_tso.bin";
 	}
 	else if (GET_ASIC_REV(tp->pci_chip_rev_id) = ASIC_REV_5700 ||
 	    GET_ASIC_REV(tp->pci_chip_rev_id) = ASIC_REV_5701 ||
@@ -12891,6 +12250,31 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
 		tp->tg3_flags2 |= TG3_FLG2_TSO_CAPABLE | TG3_FLG2_TSO_BUG;
 	}
 
+	if (fw_name) {
+		err = request_firmware(&tp->fw, fw_name, &tp->pdev->dev);
+		if (err) {
+			printk(KERN_ERR "tg3: Failed to load firmware \"%s\"\n",
+				fw_name);
+			goto err_out_apeunmap;
+		}
+
+		fw_data = (void *)tp->fw->data;
+
+	/* Firmware blob starts with version numbers, followed by
+	   start address and length. We are setting complete length.
+	   length = end_address_of_bss - start_address_of_text.
+	   Remainder is the blob to be loaded contiguously
+	   from start address. */
+
+		tp->fw_len = be32_to_cpu(fw_data[2]);	/* includes bss */
+		if (tp->fw_len < (tp->fw->size-12)) {
+			printk(KERN_ERR "tg3: bogus length %d in \"%s\"\n",
+				tp->fw_len, fw_name);
+			err = -EINVAL;
+			goto err_out_apeunmap;
+		}
+	}
+
 	/* TSO is on by default on chips that support hardware TSO.
 	 * Firmware TSO on older chips gives lower performance, so it
 	 * is off by default, but can be enabled using ethtool.
@@ -13017,6 +12401,9 @@ static int __devinit tg3_init_one(struct pci_dev *pdev,
 	return 0;
 
 err_out_apeunmap:
+	if (tp->fw)
+		release_firmware(tp->fw);
+
 	if (tp->aperegs) {
 		iounmap(tp->aperegs);
 		tp->aperegs = NULL;
@@ -13047,6 +12434,9 @@ static void __devexit tg3_remove_one(struct pci_dev *pdev)
 	if (dev) {
 		struct tg3 *tp = netdev_priv(dev);
 
+		if (tp->fw)
+			release_firmware(tp->fw);
+
 		flush_scheduled_work();
 		unregister_netdev(dev);
 		if (tp->aperegs) {
drivers/net/tg3.h +4 -0
index 0404f93..435ff9b 100644
@@ -2611,6 +2611,10 @@ struct tg3 {
 #define SST_25VF0X0_PAGE_SIZE		4098
 
 	struct ethtool_coalesce		coal;
+
+	/* firmware info */
+	const struct firmware		*fw;
+	u32				fw_len;
 };
 
 #endif /* !(_T3_H) */
Signature · 1 line
dwmw2
#3 lore raw
In reply to Jaswinder Singh

From: Jaswinder Singh <[email protected]>
Date: Wed, 18 Jun 2008 19:58:33 +0530

Quoted 6 lines

Firmware blob is big-endian starts with version numbers, followed by start address and length.
length = end_address_of_bss - start_address_of_text. Remainder is the blob to be loaded contiguously from start address.

Please use my upstream email address not my RH one.

And NACK on this patch.

#4 lore raw
In reply to Jaswinder Singh
Quoted 11 lines · David S. Miller

From: Jaswinder Singh <[email protected]>
Date: Wed, 18 Jun 2008 19:58:33 +0530

Quoted 6 lines

Firmware blob is big-endian starts with version numbers, followed by start address and length.
length = end_address_of_bss - start_address_of_text. Remainder is the blob to be loaded contiguously from start address.

Please use my upstream email address not my RH one.

I think Jaswinder just used the address(es) he found in the source file.

Quoted 1 line

And NACK on this patch.

For what reason?

Signature · 1 line
dwmw2
maintainer
#5 lore raw
In reply to Jaswinder Singh

From: David Woodhouse <[email protected]>
Date: Wed, 18 Jun 2008 23:26:51 +0100

Quoted 4 lines · David S. Miller
Quoted 1 line

And NACK on this patch.

For what reason?

Something that worked previously with no effort on the user's part now will not work automatically as it should.

This is a step backwards, and I will not provide support for any change that rips the firmware out of tg3 or does not enable the in-tree firmware built statically into the driver by default.

#6 lore raw
In reply to Jaswinder Singh
Quoted 8 lines · David Miller

From: David Woodhouse <[email protected]>
Date: Wed, 18 Jun 2008 23:26:51 +0100

Quoted 4 lines · David S. Miller
Quoted 1 line

And NACK on this patch.

For what reason?

Quoted 7 lines

Something that worked previously with no effort on the user's part now will not work automatically as it should.

This is a step backwards, and I will not provide support for any change that rips the firmware out of tg3 or does not enable the in-tree firmware built statically into the driver by default.

The patch does not remove the ability to build the firmware statically into the kernel image. You can still do that just fine.

It merely adds the _option_ to load it from userspace, as is recommended practice for current drivers.

Signature · 1 line
dwmw2
maintainer
#7 lore raw
In reply to Jaswinder Singh

From: David Woodhouse <[email protected]>
Date: Wed, 18 Jun 2008 23:39:41 +0100

Quoted 2 lines

It merely adds the _option_ to load it from userspace, as is recommended practice for current drivers.

And the default is to not use the in-kernel copy.

At least how things were previously, the dists had to at least think about patching out firmware and actually make a decision here.

Now they can just turn off their brains with the changes you've been proposing lately and from a user perspective I am sure the end result is going to suck.

#8 lore raw
In reply to Jaswinder Singh
Quoted 8 lines · David Miller

And the default is to not use the in-kernel copy.

At least how things were previously, the dists had to at least think about patching out firmware and actually make a decision here.

Now they can just turn off their brains with the changes you've been proposing lately and from a user perspective I am sure the end result is going to suck.

Have you been testing the Fedora kernel builds with the new 'kernel-firmware' subpackage and actually found problems with it?

Why did you not report them?

Or even if you aren't talking about _real_ bugs, but just problems you are imagining -- can you point them out explicitly? Other people on the distro side with whom it's been discussed have not raised such issues.

The intention of the infrastructure I've developed, in particular the ability to satisfy request_firmware() without calling out to userspace, was to solve such issues. We believe they _are_ solved, so if you still see problems then please actually point them out rather than just spreading FUD.

Signature · 1 line
dwmw2
maintainer
#9 lore raw
In reply to Jaswinder Singh

From: David Woodhouse <[email protected]>
Date: Wed, 18 Jun 2008 23:49:54 +0100

Quoted 2 lines

We believe they _are_ solved, so if you still see problems then please actually point them out rather than just spreading FUD.

Tell me this, how can I (with the default config option settings) netboot properly without an initial ramdisk after these tg3 patches and still get the proper firmware?

#10 lore raw
In reply to Jaswinder Singh
Quoted 3 lines · David Miller

Tell me this, how can I (with the default config option settings) netboot properly without an initial ramdisk after these tg3 patches and still get the proper firmware?

I suppose the facetious answer is that you can't, just as you can't do it with a default config _before_ these patches -- because neither CONFIG_TIGON3 nor the various options you need for nfsroot are enabled by default.

But if you _have_ a working nfsroot+tg3 config and you apply these patches, then all you need to do is say 'y' when you're asked if you want to include the firmware for it:
CONFIG_TIGON3_FIRMWARE=y

If you are competent enough to get nfsroot working, it isn't really very credible to claim you lack the wit to say 'y' when asked that question, surely?

Solving that problem was step #1 in the process of converting drivers to use request_firmware(). You _have_ to be able to build the firmware into the kernel image, and you _can_.

Signature · 1 line
dwmw2
maintainer
#11 lore raw
In reply to Jaswinder Singh

From: David Woodhouse <[email protected]>
Date: Thu, 19 Jun 2008 00:15:56 +0100

Quoted 3 lines

Solving that problem was step #1 in the process of converting drivers to use request_firmware(). You _have_ to be able to build the firmware into the kernel image, and you _can_.

Fair enough.

I'll step back and let you work out the objections Jeff raised.

#12 lore raw
In reply to Jaswinder Singh
Quoted 4 lines · David Miller

Fair enough.

I'll step back and let you work out the objections Jeff raised.

I have considered his request to do the conversion in two steps, but I think it's misguided.

It _was_ actually my original plan, but the experience with the drivers we've converted so far has shown that it isn't particularly feasible to do it like that.

In just about every driver we've done so far, we've made minor changes in the way we handle firmware when it comes from request_firmware() -- often due to the fact that what we get from request_firmware() now has a constant endianness, instead of being a host-endian array in the source.

So we end up _changing_ the code which loads the firmware. Usually only fairly minor changes, and in a way which can be made Obviously Correctâ„¢, but it _is_ changed.

And those patches are easier to review if you can just see the changes. To first add a new code path for the request_firmware() version, and then remove the old code path in a separate patch, just obfuscates what's happening -- it's a bit like changing files as you rename them. The old function disappears and the new one, subtly changed, appears.

I showed the acenic version of that earlier -- the two separate patches are _much_ harder to read and review individually, in my view, than the single combined patch where you can actually see what's changing.

Not only is it counter-productive from the POV of code review, it's _also_ counter-productive from the testing POV. Because if we only merge the first of the two patches and people report "yes, my acenic still works in linux-next", you don't _know_ that they were using the new request_firmware() code path. People have a tendency to ignore even the most scary printk you can put in before you fall back to the built-in version. They'll just tell you 'it works'.

So it's _better_ for that built-in version to be what you get with CONFIG_TIGON3_FIRMWARE=y in the patches I've sent. And then we _know_ that we're testing the new request_firmware() code path in the driver and that our testing is _meaningful_.

Doing it two separate patches is just pointless and counter-productive churn; really.

Signature · 6 lines
dwmw2

--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html