Skip to content

Commit

Permalink
Varias modificaciones.
Browse files Browse the repository at this point in the history
jbd2: fix fsync() tid wraparound bug
If an application program does not make any changes to the indirect
blocks or extent tree, i_datasync_tid will not get updated.  If there
are enough commits (i.e., 2**31) such that tid_geq()'s calculations
wrap, and there isn't a currently active transaction at the time of
the fdatasync() call, this can end up triggering a BUG_ON in
fs/jbd2/commit.c:

	J_ASSERT(journal->j_running_transaction != NULL);

It's pretty rare that this can happen, since it requires the use of
fdatasync() plus *very* frequent and excessive use of fsync().  But
with the right workload, it can.

We fix this by replacing the use of tid_geq() with an equality test,
since there's only one valid transaction id that we is valid for us to
wait until it is commited: namely, the currently running transaction
(if it exists).

Signed-off-by: "Theodore Ts'o" <[email protected]>

Arreglos para la memoria.

Cambio de cálculo para la batería y nuevo driver.

Eliminado código de pausa en el arranque.

Modificaciones varias.

Créditos: c.val
  • Loading branch information
Dosis2 committed Dec 3, 2011
1 parent 874c215 commit 75dbdf4
Show file tree
Hide file tree
Showing 14 changed files with 240 additions and 457 deletions.
10 changes: 5 additions & 5 deletions arch/arm/configs/pw28_defconfig
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# Automatically generated make config: don't edit
# Linux kernel version: 2.6.32.9
# Sun Nov 13 01:17:00 2011
# Thu Dec 1 10:31:42 2011
#
CONFIG_ARM=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
Expand Down Expand Up @@ -97,9 +97,9 @@ CONFIG_AIO=y
#
CONFIG_VM_EVENT_COUNTERS=y
CONFIG_COMPAT_BRK=y
CONFIG_SLAB=y
# CONFIG_SLAB is not set
# CONFIG_SLUB is not set
# CONFIG_SLQB is not set
CONFIG_SLQB=y
# CONFIG_SLOB is not set
# CONFIG_PROFILING is not set
CONFIG_HAVE_OPROFILE=y
Expand Down Expand Up @@ -1165,7 +1165,6 @@ CONFIG_POWER_SUPPLY=y
# CONFIG_BATTERY_BQ27x00 is not set
# CONFIG_BATTERY_MAX17040 is not set
CONFIG_BATTERY_MSM=y
CONFIG_SIMCUST_BATTERY_PERCENT_FOR_PE28=y
# CONFIG_BATTERY_MSM_FAKE is not set
# CONFIG_HWMON is not set
# CONFIG_THERMAL is not set
Expand Down Expand Up @@ -1968,7 +1967,8 @@ CONFIG_DEBUG_KERNEL=y
# CONFIG_SCHEDSTATS is not set
CONFIG_TIMER_STATS=y
# CONFIG_DEBUG_OBJECTS is not set
# CONFIG_DEBUG_SLAB is not set
# CONFIG_SLQB_DEBUG is not set
# CONFIG_SLQB_SYSFS is not set
# CONFIG_DEBUG_KMEMLEAK is not set
# CONFIG_DEBUG_PREEMPT is not set
# CONFIG_DEBUG_RT_MUTEXES is not set
Expand Down
97 changes: 49 additions & 48 deletions arch/arm/mach-msm/board-pw28.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,63 +125,56 @@ static struct platform_device mass_storage_device = {
.name = "usb_mass_storage",
.id = -1,
.dev = {
.platform_data = &usb_mass_storage_pdata,
.platform_data = &usb_mass_storage_pdata,
},
};
#endif

#ifdef CONFIG_USB_ANDROID
static char *usb_functions_default[] = {
#ifdef CONFIG_USB_ANDROID_RMNET
"rmnet",
#endif
"usb_mass_storage",
#ifdef CONFIG_USB_F_SERIAL
"modem",
"nmea",
#endif
"diag",
"modem",
"nmea",
"rmnet",
"usb_mass_storage",
};

static char *usb_functions_default_adb[] = {
"usb_mass_storage",
"adb",
#ifdef CONFIG_USB_ANDROID_RMNET
"rmnet",
#endif
#ifdef CONFIG_USB_F_SERIAL
"modem",
"nmea",
#endif
"diag",
"adb",
"modem",
"nmea",
"rmnet",
"usb_mass_storage",
};

static char *usb_functions_rndis[] = {
#ifdef CONFIG_USB_ANDROID_RNDIS
"rndis",
#endif
"rndis",
};

static char *usb_functions_rndis_adb[] = {
#ifdef CONFIG_USB_ANDROID_RNDIS
"rndis",
#endif
"adb",
"rndis",
"adb",
};

static char *usb_functions_all[] = {
#ifdef CONFIG_USB_ANDROID_RNDIS
"rndis",
"rndis",
#endif
#ifdef CONFIG_USB_ANDROID_DIAG
"diag",
#endif
"usb_mass_storage",
"adb",
#ifdef CONFIG_USB_F_SERIAL
"modem",
"nmea",
"modem",
"nmea",
#endif
#ifdef CONFIG_USB_ANDROID_RMNET
"rmnet",
"rmnet",
#endif
"usb_mass_storage",
#ifdef CONFIG_USB_ANDROID_ACM
"acm",
"acm",
#endif
};

Expand Down Expand Up @@ -219,7 +212,7 @@ static struct platform_device usb_mass_storage_device = {
.name = "usb_mass_storage",
.id = -1,
.dev = {
.platform_data = &mass_storage_pdata,
.platform_data = &mass_storage_pdata,
},
};

Expand All @@ -233,7 +226,7 @@ static struct platform_device rndis_device = {
.name = "rndis",
.id = -1,
.dev = {
.platform_data = &rndis_pdata,
.platform_data = &rndis_pdata,
},
};

Expand All @@ -253,8 +246,8 @@ static struct android_usb_platform_data android_usb_pdata = {
static struct platform_device android_usb_device = {
.name = "android_usb",
.id = -1,
.dev = {
.platform_data = &android_usb_pdata,
.dev = {
.platform_data = &android_usb_pdata,
},
};

Expand Down Expand Up @@ -287,19 +280,13 @@ static struct platform_device smc91x_device = {

#ifdef CONFIG_USB_FUNCTION
static struct usb_function_map usb_functions_map[] = {
#ifdef CONFIG_USB_ANDROID_DIAG
{"diag", 0},
#endif
{"adb", 1},
#ifdef CONFIG_USB_F_SERIAL
{"modem", 2},
{"nmea", 3},
#endif
{"mass_storage", 4},
{"ethernet", 5},
#ifdef CONFIG_USB_ANDROID_RMNET
{"rmnet", 6},
#endif
};

/* dynamic composition */
Expand Down Expand Up @@ -494,7 +481,7 @@ static struct platform_device msm_device_snd = {
.name = "msm_snd",
.id = -1,
.dev = {
.platform_data = &msm_device_snd_endpoints
.platform_data = &msm_device_snd_endpoints
},
};

Expand Down Expand Up @@ -600,7 +587,7 @@ static struct platform_device msm_device_adspdec = {
.name = "msm_adspdec",
.id = -1,
.dev = {
.platform_data = &msm_device_adspdec_database
.platform_data = &msm_device_adspdec_database
},
};

Expand Down Expand Up @@ -666,7 +653,7 @@ static struct platform_device hs_device = {
.name = "msm-handset",
.id = -1,
.dev = {
.platform_data = &hs_platform_data,
.platform_data = &hs_platform_data,
},
};

Expand Down Expand Up @@ -1165,7 +1152,7 @@ static struct platform_device msm_device_kgsl = {
.num_resources = ARRAY_SIZE(kgsl_resources),
.resource = kgsl_resources,
.dev = {
.platform_data = &kgsl_pdata,
.platform_data = &kgsl_pdata,
},
};
#endif
Expand Down Expand Up @@ -1521,20 +1508,31 @@ static struct msm_camera_sensor_info msm_camera_sensor_mt9d112_data = {
static struct platform_device msm_camera_sensor_mt9d112 = {
.name = "msm_camera_mt9d112",
.dev = {
.platform_data = &msm_camera_sensor_mt9d112_data,
.platform_data = &msm_camera_sensor_mt9d112_data,
},
};
#endif
#endif

static u32 msm_calculate_batt_capacity(u32 current_voltage);

static struct msm_psy_batt_pdata msm_psy_batt_data = {
.voltage_min_design = 3200,
.voltage_min_design = 3291,
.voltage_max_design = 4300,
.avail_chg_sources = AC_CHG | USB_CHG ,
.batt_technology = POWER_SUPPLY_TECHNOLOGY_LION,
.calculate_capacity = NULL,
.calculate_capacity = &msm_calculate_batt_capacity,
};

static u32 msm_calculate_batt_capacity(u32 current_voltage)
{
u32 low_voltage = msm_psy_batt_data.voltage_min_design;
u32 high_voltage = msm_psy_batt_data.voltage_max_design;

return (current_voltage - low_voltage) * 100
/ (high_voltage - low_voltage);
}

static struct platform_device msm_batt_device = {
.name = "msm-battery",
.id = -1,
Expand Down Expand Up @@ -1590,6 +1588,9 @@ static struct platform_device *devices[] __initdata = {
#ifdef CONFIG_USB_ANDROID
&usb_mass_storage_device,
&rndis_device,
#ifdef CONFIG_USB_ANDROID_DIAG
&usb_diag_device,
#endif
&android_usb_device,
#endif
&msm_device_i2c,
Expand Down
4 changes: 2 additions & 2 deletions arch/arm/mach-msm/rpc_server_handset.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@

#define KEY(hs_key, input_key) ((hs_key << 24) | input_key)

extern volatile int key_for_charger;
//extern volatile int key_for_charger;
enum hs_event {
HS_EVNT_EXT_PWR = 0, /* External Power status */
HS_EVNT_HSD, /* Headset Detection */
Expand Down Expand Up @@ -293,7 +293,7 @@ static void report_hs_key(uint32_t key_code, uint32_t key_parm)
case KEY_POWER:
case KEY_END:
printk(KERN_ERR "%s: remote handset event %d\n",__func__, key);
key_for_charger = KEY_END;//For power off charging
//key_for_charger = KEY_END;//For power off charging
case KEY_VOLUMEUP:
case KEY_VOLUMEDOWN:
input_report_key(hs->ipdev, key, (key_code != HS_REL_K));
Expand Down
23 changes: 19 additions & 4 deletions drivers/net/wireless/bcm4329/dhd_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -1670,13 +1670,27 @@ dhd_open(struct net_device *net)
uint32 toe_ol;
#endif
int ifidx;

wl_control_wl_start(net); /* start if needed */
int32 ret = 0;
dhd_os_wake_lock(&dhd->pub);
/* Update FW path if it was changed */
if ((firmware_path != NULL) && (firmware_path[0] != '\0')) {
if (firmware_path[strlen(firmware_path)-1] == '\n')
firmware_path[strlen(firmware_path)-1] = '\0';
strcpy(fw_path, firmware_path);
firmware_path[0] = '\0';
}

/* Force start if ifconfig_up gets called before START command */
wl_control_wl_start(net);

ifidx = dhd_net2idx(dhd, net);
DHD_TRACE(("%s: ifidx %d\n", __FUNCTION__, ifidx));

/* ASSERT(ifidx == 0); */
if ((dhd->iflist[ifidx]) && (dhd->iflist[ifidx]->state == WLC_E_IF_DEL)) {
DHD_ERROR(("%s: Error: called when IF already deleted\n", __FUNCTION__));
ret = -1;
goto exit;
}

if (ifidx == 0) { /* do it only for primary eth0 */

Expand All @@ -1697,7 +1711,8 @@ dhd_open(struct net_device *net)
dhd->pub.up = 1;

OLD_MOD_INC_USE_COUNT;
return 0;
exit:
return ret;
}

osl_t *
Expand Down
7 changes: 0 additions & 7 deletions drivers/power/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,6 @@ config BATTERY_MSM
help
Say Y to enable support for the battery in Qualcomm MSM.

config SIMCUST_BATTERY_PERCENT_FOR_PE28
bool "MSM battery percent cust for pe28"
depends on ARCH_MSM
default n
help
Say Y to enable support for the battery percentage curve for pe28 .

config BATTERY_MSM_FAKE
tristate "Fake MSM battery"
depends on ARCH_MSM && BATTERY_MSM
Expand Down
Loading

0 comments on commit 75dbdf4

Please sign in to comment.