GoboLinux Downloads Documentation Community Recipes Screenshots

GoboLinux Recipe & Package Search Tool

71 versions of Linux.

ProgramAgeSizeByWWWSummary
Linux 4.13.2-r1 731  88794 Luca...
The Linux Kernel.
Linux 4.9.16-r3 902  100651 Luca...
The Linux Kernel.
Linux 4.9.4-r5 958  99374 Luca...
The Linux Kernel.
Linux 4.8.2-r2 1024  89394 Luca...
The Linux Kernel.
Linux 4.7.4-r1 1094  82767 Luca...
The Linux Kernel.
Linux 4.7.0-r4 1149  82585 Luca...
The Linux Kernel.
Linux 3.13.3-r1 2029  252629 Luca...
The Linux Kernel.
Linux 3.12.6-r1 2089  238949 Luca...
The Linux Kernel.
Linux 3.9.4-r2 2284  70048 Luca...
The Linux Kernel.
Linux 3.7.1-r2 2457  67579 Luca...
The Linux Kernel.
Linux 3.5.0-r1 2608  124391 Luca...
The Linux Kernel.
Linux 3.4.4-r1 2608  124348 Luca...
The Linux Kernel.
Linux 3.3.6-r1 2608  124410 Luca...
The Linux Kernel.
Linux 3.2.12-r2 2736  124345 Luca...
The Linux Kernel.
Linux 3.2.7-r1 2766  123550 Mich...
The Linux Kernel.
Linux 3.1.1-r1 2871  122907 Mich...
The Linux Kernel.
Linux 3.0.4-r4 2932  122754 Luca...
The Linux Kernel.
Linux 2.6.36.3-r1 3155  116087 Diog...
The Linux Kernel.
Linux 2.6.32.3-r1 3533  117990 Luca...
The Linux Kernel.
Linux 2.6.32-r1 3574  117751 Luca...
The Linux Kernel.
Linux 2.6.31.6-r3 3579  126499 Luca...
The Linux Kernel.
Linux 2.6.30.5-r1 3658  166102 Jona...
The Linux Kernel.
Linux 2.6.29.1-r1 3801  117500 Luca...
The Linux Kernel.
Linux 2.6.28.7-r1 3857  115518 Giam...
The Linux Kernel.
Linux 2.6.28.1-r1 3857  115487 Giam...
The Linux Kernel.
Linux 2.6.28-r1 3857  116681 Mich...
The Linux Kernel.
Linux 2.6.27.8-r1 3857  134160 Giam...
The Linux Kernel.
Linux 2.6.27.4-r3 3857  149529 Luca...
The Linux Kernel.
Linux 2.6.25.17-r1 3857  172834 Giam...
The Linux Kernel.
Linux 2.6.25.16-r1 3857  166500 Giam...
The Linux Kernel.
Linux 2.6.25.10-r2 3857  165320 Giam...
The Linux Kernel.
Linux 2.6.25.7-r1 3857  157294 Giam...
The Linux Kernel.
Linux 2.6.25.4-r1 3857  133017 Hopp...
The Linux Kernel.
Linux 2.6.25-r1 3857  133216 Luca...
The Linux Kernel.
Linux 2.6.24.4-r5 3857  150733
The Linux Kernel.
view entry at GitHub | download recipe.bz2 file
01-gobohide.patch
02-unionfs-2.3.2_for_2.6.24.4.patch
03-squashfs-3.3-cvs_20080310.patch
04-squashfs-3.3-cvs_20080310-fix.patch
04-thinkpad-acpi-0.19-20080107_v2.6.24.patch
05-applesmc-case-led.patch
06-applesmc_int.patch
07-applesmc-macbook2.patch
08-applesmc-retry-when-accessing-keys.patch
09-appletouch-add-macbook3-trackpad.patch
10-appletouch.patch
11-appletouch-new.patch
12-sigmatel_audio_display_all_controls_when_subsystem_id_is_wrong.patch
13-sigmatel_audio_fix_macbook_v2.patch
14-appletouch-2.6.24_rc8.patch
15-macbook3rd-2.6.24_rc8.patch
16-usbhid-macbook3_1-quirks.patch
17-applesmc_led_unregister.patch
18-vm_splice_fix.patch
Recipe
Resources/BuildInformation
Resources/Dependencies
Resources/Description
Resources/NewDependencies
i686/Recipe
i686/dot-config
ppc/Recipe
ppc/dot-config
Retry up to 200 ms when reading or writing keys.

From: Nicolas Boichat <nicolas@boichat.ch>


---

 drivers/hwmon/applesmc.c |   69 +++++++++++++++++++++++++++++++---------------
 1 files changed, 47 insertions(+), 22 deletions(-)

diff --git a/drivers/hwmon/applesmc.c b/drivers/hwmon/applesmc.c
index 4dca4cd..0950839 100644
--- a/drivers/hwmon/applesmc.c
+++ b/drivers/hwmon/applesmc.c
@@ -114,6 +114,9 @@ static const char* fan_speed_keys[] = {
 #define INIT_TIMEOUT_MSECS	5000	/* wait up to 5s for device init ... */
 #define INIT_WAIT_MSECS		50	/* ... in 50ms increments */
 
+#define ACCESS_TIMEOUT_MSECS	500	/* wait up to 500ms when accessing a key */
+#define ACCESS_WAIT_MSECS	5	/* ... in 5ms increments */
+
 #define APPLESMC_POLL_INTERVAL	50	/* msecs */
 #define APPLESMC_INPUT_FUZZ	4	/* input event threshold */
 #define APPLESMC_INPUT_FLAT	4
@@ -188,12 +191,13 @@ static int __wait_status(u8 val)
 
 /*
  * applesmc_read_key - reads len bytes from a given key, and put them in buffer.
+ * Tries up to ACCESS_WAIT_MSECS to read the value.
  * Returns zero on success or a negative error on failure. Callers must
  * hold applesmc_lock.
  */
 static int applesmc_read_key(const char* key, u8* buffer, u8 len)
 {
-	int i;
+	int i, total, ret;
 
 	if (len > APPLESMC_MAX_DATA_LENGTH) {
 		printk(KERN_ERR	"applesmc_read_key: cannot read more than "
@@ -201,33 +205,54 @@ static int applesmc_read_key(const char* key, u8* buffer, u8 \
len)
 		return -EINVAL;
 	}
 
-	outb(APPLESMC_READ_CMD, APPLESMC_CMD_PORT);
-	if (__wait_status(0x0c))
-		return -EIO;
+	for (total = ACCESS_TIMEOUT_MSECS; total > 0;
+						total -= ACCESS_WAIT_MSECS) {
+		ret = 0;
+		outb(APPLESMC_READ_CMD, APPLESMC_CMD_PORT);
+		if (__wait_status(0x0c)) {
+			ret = -EIO;
+			goto wait_fail;
+		}
 
-	for (i = 0; i < 4; i++) {
-		outb(key[i], APPLESMC_DATA_PORT);
-		if (__wait_status(0x04))
-			return -EIO;
-	}
-	if (debug)
-		printk(KERN_DEBUG "<%s", key);
+		for (i = 0; i < 4; i++) {
+			outb(key[i], APPLESMC_DATA_PORT);
+			if (__wait_status(0x04)) {
+				ret = -EIO;
+				goto wait_fail;
+			}
+		}
+		if (debug)
+			printk(KERN_DEBUG "<%s", key);
 
-	outb(len, APPLESMC_DATA_PORT);
-	if (debug)
-		printk(KERN_DEBUG ">%x", len);
+		outb(len, APPLESMC_DATA_PORT);
+		if (debug)
+			printk(KERN_DEBUG ">%x", len);
 
-	for (i = 0; i < len; i++) {
-		if (__wait_status(0x05))
-			return -EIO;
-		buffer[i] = inb(APPLESMC_DATA_PORT);
+		for (i = 0; i < len; i++) {
+			if (__wait_status(0x05)) {
+				ret = -EIO;
+				goto wait_fail;
+			}
+			buffer[i] = inb(APPLESMC_DATA_PORT);
+			if (debug)
+				printk(KERN_DEBUG "<%x", buffer[i]);
+		}
 		if (debug)
-			printk(KERN_DEBUG "<%x", buffer[i]);
+			printk(KERN_DEBUG "\n");
+
+		break;
+
+wait_fail:
+		msleep(ACCESS_WAIT_MSECS);
+		continue;		
 	}
-	if (debug)
-		printk(KERN_DEBUG "\n");
 
-	return 0;
+	if (total != ACCESS_TIMEOUT_MSECS) {
+		printk(KERN_DEBUG "Read: Waited %d ms for the value\n",
+						ACCESS_TIMEOUT_MSECS-total);
+	}
+
+	return ret;
 }
 
 /*
Linux 2.6.24.3-r5 3857  150221 Luca...
The Linux Kernel.
Linux 2.6.24.2-r3 3857  146488 Giam...
The Linux Kernel.
Linux 2.6.24.1-r1 3857  146454 Giam...
The Linux Kernel.
Linux 2.6.24-r1 3857  146428 Luca...
The Linux Kernel.
Linux 2.6.23.8-r4 3857  155842 Luca...
The Linux Kernel.
Linux 2.6.22.7-r4 3857  114727 Luca...
The Linux Kernel.
Linux 2.6.22.1-r1 3857  121391 Luca...
The Linux Kernel.
Linux 2.6.21.1-r3 3857  118854 Luca...
The Linux Kernel.
Linux 2.6.20.7-r1 3857  117945 Luca...
The Linux Kernel.
Linux 2.6.20.4-r3 3857  151150 Luca...
The Linux Kernel.
Linux 2.6.20-r1 3857  106429 Luca...
The Linux Kernel.
Linux 2.6.18.3-r2 3857  111124 Luca...
The Linux Kernel.
Linux 2.6.17.11-r1 3857  164053 Luca...
The Linux Kernel.
Linux 2.6.17.3-r1 3857  165067 Luca...
The Linux Kernel.
Linux 2.6.16.20-r1 3857  133625 Luca...
The Linux Kernel.
Linux 2.6.16.14-r1 3857  168270 Luca...
The Linux Kernel.
Linux 2.6.15.5-r1 3857  224686 Jona...
The Linux Kernel.
Linux 2.6.15.2-r1 3857  177165 Carl...
The Linux Kernel.
Linux 2.6.15.1-r1 3857  149219 Jona...
The Linux Kernel.
Linux 2.6.15-r1 3857  149214 Luca...
The Linux Kernel.
Linux 2.6.14.4-r1 3857  150166 Jona...
The Linux Kernel.
Linux 2.6.14.3-r1 3857  150060 Jona...
The Linux Kernel.
Linux 2.6.14.2-r1 3857  149791 Carl...
The Linux Kernel.
Linux 2.6.13.4-r1 3857  149559 Luca...
The Linux Kernel.
Linux 2.6.13.2-r1 3857  56611 Jona...
The Linux Kernel.
Linux 2.6.13.1-r1 3857  56378 Luca...
The Linux Kernel.
Linux 2.6.12.2-r1 3857  50355 Luca...
The Linux Kernel.
Linux 2.6.11.9-r1 3857  98969 Luca...
The Linux Kernel.
Linux 2.6.11.8-r1 3857  109424 Jona...
The Linux Kernel.
Linux 2.6.11-r1 3857  99032 Luca...
The Linux Kernel.
Linux 2.6.10-r1 3857  65969 Luca...
The Linux Kernel.
Linux 2.6.9-r1 3857  278461 Luca...
The Linux Kernel.
Linux 2.6.8.1-r1 3857  35576 Luca...
The Linux Kernel.
Linux 2.6.7-r1 3857  22610 Luca...
The Linux Kernel.
Linux 2.6.6-r1 3857  21958 Luca...
The Linux Kernel.
Linux 2.4.26-r1 3857  22359 Luca...
The Linux Kernel.