aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/generic/patches-3.6/511-yaffs-3.5-use-clear_inode.patch
blob: f4479675a275fb88b03b45a9725ef8a650470377 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
--- a/fs/yaffs2/yaffs_vfs_glue.c
+++ b/fs/yaffs2/yaffs_vfs_glue.c
@@ -924,7 +924,11 @@ static void yaffs_evict_inode( struct in
 	if (!inode->i_nlink && !is_bad_inode(inode))
 		deleteme = 1;
 	truncate_inode_pages(&inode->i_data,0);
-	end_writeback(inode);
+#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 5, 0)
+	clear_inode(inode);
+#else
+ 	end_writeback(inode);
+#endif
 
 	if(deleteme && obj){
 		dev = obj->my_dev;
round-color: #ddffdd } /* Generic.Inserted */ .highlight .go { color: #888888 } /* Generic.Output */ .highlight .gp { color: #555555 } /* Generic.Prompt */ .highlight .gs { font-weight: bold } /* Generic.Strong */ .highlight .gu { color: #666666 } /* Generic.Subheading */ .highlight .gt { color: #aa0000 } /* Generic.Traceback */ .highlight .kc { color: #008800; font-weight: bold } /* Keyword.Constant */ .highlight .kd { color: #008800; font-weight: bold } /* Keyword.Declaration */ .highlight .kn { color: #008800; font-weight: bold } /* Keyword.Namespace */ .highlight .kp { color: #008800 } /* Keyword.Pseudo */ .highlight .kr { color: #008800; font-weight: bold } /* Keyword.Reserved */ .highlight .kt { color: #888888; font-weight: bold } /* Keyword.Type */ .highlight .m { color: #0000DD; font-weight: bold } /* Literal.Number */ .highlight .s { color: #dd2200; background-color: #fff0f0 } /* Literal.String */ .highlight .na { color: #336699 } /* Name.Attribute */ .highlight .nb { color: #003388 } /* Name.Builtin */ .highlight .nc { color: #bb0066; font-weight: bold } /* Name.Class */ .highlight .no { color: #003366; font-weight: bold } /* Name.Constant */ .highlight .nd { color: #555555 } /* Name.Decorator */ .highlight .ne { color: #bb0066; font-weight: bold } /* Name.Exception */ .highlight .nf { color: #0066bb; font-weight: bold } /* Name.Function */ .highlight .nl { color: #336699; font-style: italic } /* Name.Label */ .highlight .nn { color: #bb0066; font-weight: bold } /* Name.Namespace */ .highlight .py { color: #336699; font-weight: bold } /* Name.Property */ .highlight .nt { color: #bb0066; font-weight: bold } /* Name.Tag */ .highlight .nv { color: #336699 } /* Name.Variable */ .highlight .ow { color: #008800 } /* Operator.Word */ .highlight .w { color: #bbbbbb } /* Text.Whitespace */ .highlight .mb { color: #0000DD; font-weight: bold } /* Literal.Number.Bin */ .highlight .mf { color: #0000DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
--- a/ath/if_ath.c
+++ b/ath/if_ath.c
@@ -396,7 +396,6 @@ static int tpc = 1;
 static int maxvaps = -1;
 static int xchanmode = -1;
 #include "ath_wprobe.c"
-static int beacon_cal = 1;
 
 static const struct ath_hw_detect generic_hw_info = {
 	.vendor_name = "Unknown",
@@ -431,7 +430,6 @@ static struct notifier_block ath_event_b
 };
 
 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2,5,52))
-MODULE_PARM(beacon_cal, "i");
 MODULE_PARM(maxvaps, "i");
 MODULE_PARM(xchanmode, "i");
 MODULE_PARM(rfkill, "i");
@@ -443,7 +441,6 @@ MODULE_PARM(autocreate, "s");
 MODULE_PARM(ratectl, "s");
 #else
 #include <linux/moduleparam.h>
-module_param(beacon_cal, int, 0600);
 module_param(maxvaps, int, 0600);
 module_param(xchanmode, int, 0600);
 module_param(rfkill, int, 0600);
@@ -837,6 +834,7 @@ ath_attach(u_int16_t devid, struct net_d
 		error = EIO;
 		goto bad2;
 	}
+	sc->sc_cal_interval = ath_calinterval;
 	init_timer(&sc->sc_cal_ch);
 	sc->sc_cal_ch.function = ath_calibrate;
 	sc->sc_cal_ch.data = (unsigned long) dev;
@@ -2765,8 +2763,7 @@ ath_stop_locked(struct net_device *dev)
 		}
 		if (!sc->sc_invalid) {
 			del_timer_sync(&sc->sc_dfs_cac_timer);
-			if (!sc->sc_beacon_cal)
-				del_timer_sync(&sc->sc_cal_ch);
+			del_timer_sync(&sc->sc_cal_ch);
 		}
 		ath_draintxq(sc);
 		if (!sc->sc_invalid) {
@@ -2791,10 +2788,9 @@ static void ath_set_beacon_cal(struct at
 	if (val) {
 		del_timer_sync(&sc->sc_cal_ch);
 	} else {
-		sc->sc_cal_ch.expires = jiffies + (ath_calinterval * HZ);
-		add_timer(&sc->sc_cal_ch);
+		mod_timer(&sc->sc_cal_ch, jiffies + (sc->sc_cal_interval * HZ));
 	}
-	sc->sc_beacon_cal = !!val && beacon_cal;
+	sc->sc_beacon_cal = !!val;
 }
 
 /*
@@ -3036,7 +3032,7 @@ ath_reset(struct net_device *dev)
 	 * XXX: starting the calibration too early seems to lead to
 	 * problems with the beacons.
 	 */
-	sc->sc_lastcal = jiffies;
+	sc->sc_nextcal = jiffies + msecs_to_jiffies(sc->sc_cal_interval * 1000);
 
 	/*
 	 * Convert to a HAL channel description with the flags
@@ -5477,10 +5473,9 @@ next:
 			"Invoking ath_hal_txstart with sc_bhalq: %d\n",
 			sc->sc_bhalq);
 		ath_hal_txstart(ah, sc->sc_bhalq);
-		if (sc->sc_beacon_cal && (jiffies > sc->sc_lastcal + (ath_calinterval * HZ))) {
-			sc->sc_cal_ch.expires = jiffies + msecs_to_jiffies(10);
-			add_timer(&sc->sc_cal_ch);
-		}
+		if (sc->sc_beacon_cal && ((sc->sc_bmisscount == 3) ||
+		    (jiffies > sc->sc_nextcal)))
+			mod_timer(&sc->sc_cal_ch, jiffies + 1);
 
 		sc->sc_stats.ast_be_xmit++;		/* XXX per-VAP? */
 	}
@@ -9161,6 +9156,7 @@ ath_startrecv(struct ath_softc *sc)
 		dev->mtu, sc->sc_cachelsz, sc->sc_rxbufsize);
 
 	sc->sc_rxlink = NULL;
+	ath_set_beacon_cal(sc, IEEE80211_IS_MODE_BEACON(sc->sc_ic.ic_opmode));
 	STAILQ_FOREACH(bf, &sc->sc_rxbuf, bf_list) {
 		int error = ath_rxbuf_init(sc, bf);
 		ATH_RXBUF_RESET(bf);
@@ -9377,7 +9373,7 @@ ath_chan_set(struct ath_softc *sc, struc
 				jiffies + (sc->sc_dfs_cac_period * HZ));
 
 			/* This is a good time to start a calibration */
-			ath_set_beacon_cal(sc, 1);
+			mod_timer(&sc->sc_cal_ch, jiffies + 1);
 		}
 		/*
 		 * re configure beacons when it is a turbo mode switch.
@@ -9471,25 +9467,23 @@ ath_calibrate(unsigned long arg)
 	if (isIQdone == AH_TRUE) {
 		/* Unless user has overridden calibration interval,
 		 * upgrade to less frequent calibration */
-		if (ath_calinterval == ATH_SHORT_CALINTERVAL)
-			ath_calinterval = ATH_LONG_CALINTERVAL;
+		if (sc->sc_cal_interval == ATH_SHORT_CALINTERVAL)
+			sc->sc_cal_interval = ATH_LONG_CALINTERVAL;
 	}
 	else {
 		/* Unless user has overridden calibration interval,
 		 * downgrade to more frequent calibration */
-		if (ath_calinterval == ATH_LONG_CALINTERVAL)
-			ath_calinterval = ATH_SHORT_CALINTERVAL;
+		if (sc->sc_cal_interval == ATH_LONG_CALINTERVAL)
+			sc->sc_cal_interval = ATH_SHORT_CALINTERVAL;
 	}
 
 	DPRINTF(sc, ATH_DEBUG_CALIBRATE, "Channel %u/%x -- IQ %s.\n",
 		sc->sc_curchan.channel, sc->sc_curchan.channelFlags,
 		isIQdone ? "done" : "not done");
 
-	sc->sc_lastcal = jiffies;
-	if (!sc->sc_beacon_cal) {
-		sc->sc_cal_ch.expires = jiffies + (ath_calinterval * HZ);
-		add_timer(&sc->sc_cal_ch);
-	}
+	sc->sc_nextcal = jiffies + msecs_to_jiffies(sc->sc_cal_interval * 1000);
+	if (!sc->sc_beacon_cal)
+		mod_timer(&sc->sc_cal_ch, sc->sc_nextcal);
 }
 
 static void
@@ -9597,9 +9591,6 @@ ath_newstate(struct ieee80211vap *vap, e
 		ieee80211_state_name[vap->iv_state],
 		ieee80211_state_name[nstate]);
 
-	if (!sc->sc_beacon_cal)
-		del_timer(&sc->sc_cal_ch);		/* periodic calibration timer */
-
 	ath_hal_setledstate(ah, leds[nstate]);	/* set LED */
 	netif_stop_queue(dev);			/* before we do anything else */
 
@@ -9821,10 +9812,7 @@ ath_newstate(struct ieee80211vap *vap, e
 				IEEE80211_IS_MODE_DFS_MASTER(vap->iv_opmode)) {
 			DPRINTF(sc, ATH_DEBUG_STATE | ATH_DEBUG_DOTH, 
 				"VAP -> DFSWAIT_PENDING \n");
-			/* start calibration timer with a really small value 
-			 * 1/10 sec */
-			if (!sc->sc_beacon_cal)
-				mod_timer(&sc->sc_cal_ch, jiffies + (HZ/10));
+			mod_timer(&sc->sc_cal_ch, jiffies + 1);
 			/* wake the receiver */
 			netif_wake_queue(dev);
 			/* don't do the other usual stuff... */
@@ -9866,12 +9854,6 @@ done:
 	/* Invoke the parent method to complete the work. */
 	error = avp->av_newstate(vap, nstate, arg);
 
-	/* Finally, start any timers. */
-	if (nstate == IEEE80211_S_RUN && !sc->sc_beacon_cal) {
-		/* start periodic recalibration timer */
-		mod_timer(&sc->sc_cal_ch, jiffies + (ath_calinterval * HZ));
-	}
-
 #ifdef ATH_SUPERG_XR
 	if (vap->iv_flags & IEEE80211_F_XR &&
 		nstate == IEEE80211_S_RUN)
--- a/ath/if_athvar.h
+++ b/ath/if_athvar.h
@@ -834,7 +834,8 @@ struct ath_softc {
 
 	struct ieee80211_channel *sc_last_chan;
 	int sc_beacon_cal;			/* use beacon timer for calibration */
-	u_int64_t sc_lastcal;			/* last time the calibration was performed */
+	u_int64_t sc_nextcal;			/* last time the calibration was performed */
+	int sc_cal_interval;			/* current calibration interval */
 	struct timer_list sc_cal_ch;		/* calibration timer */
 	HAL_NODE_STATS sc_halstats;		/* station-mode rssi stats */