All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] brcmsmac: Use current logging styles
From: Joe Perches @ 2011-11-13 19:41 UTC (permalink / raw)
  To: Arend van Spriel; +Cc: John W. Linville, linux-wireless, netdev, LKML

Add and use pr_fmt and pr_<level>
Remove useless double parentheses from macros.
Remove function names from format strings, add to pr_debug use.
Coalesce formats.
Remove uncompileable undeclared variable in a DMA_NONE use.

Signed-off-by: Joe Perches <joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
---
 drivers/net/wireless/brcm80211/brcmsmac/aiutils.c |   14 +-
 drivers/net/wireless/brcm80211/brcmsmac/dma.c     |  145 ++++++++++-----------
 2 files changed, 80 insertions(+), 79 deletions(-)

diff --git a/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c b/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c
index 025fa0e..39e3054 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/aiutils.c
@@ -16,6 +16,8 @@
  * File contents: support functions for PCI/PCIe
  */
 
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/delay.h>
 #include <linux/pci.h>
 
@@ -349,9 +351,9 @@
 #define PCI_FORCEHT(si)	(PCIE(si) && (si->pub.chip == BCM4716_CHIP_ID))
 
 #ifdef BCMDBG
-#define	SI_MSG(args)	printk args
+#define	SI_MSG(fmt, ...)	pr_debug(fmt, ##__VA_ARGS__)
 #else
-#define	SI_MSG(args)
+#define	SI_MSG(fmt, ...)	no_printk(fmt, ##__VA_ARGS__)
 #endif				/* BCMDBG */
 
 #define	GOODCOREADDR(x, b) \
@@ -1073,7 +1075,7 @@ static struct si_info *ai_doattach(struct si_info *sii,
 
 	/* scan for cores */
 	if (socitype == SOCI_AI) {
-		SI_MSG(("Found chip type AI (0x%08x)\n", w));
+		SI_MSG("Found chip type AI (0x%08x)\n", w);
 		/* pass chipc address instead of original core base */
 		ai_scan(&sii->pub, cc);
 	} else {
@@ -1129,7 +1131,7 @@ static struct si_info *ai_doattach(struct si_info *sii,
 		 * set chipControl register bit 15
 		 */
 		if (sih->chiprev == 0) {
-			SI_MSG(("Applying 43224A0 WARs\n"));
+			SI_MSG("Applying 43224A0 WARs\n");
 			ai_corereg(sih, SI_CC_IDX,
 				   offsetof(struct chipcregs, chipcontrol),
 				   CCTRL43224_GPIO_TOGGLE,
@@ -1138,7 +1140,7 @@ static struct si_info *ai_doattach(struct si_info *sii,
 					   CCTRL_43224A0_12MA_LED_DRIVE);
 		}
 		if (sih->chiprev >= 1) {
-			SI_MSG(("Applying 43224B0+ WARs\n"));
+			SI_MSG("Applying 43224B0+ WARs\n");
 			si_pmu_chipcontrol(sih, 0, CCTRL_43224B0_12MA_LED_DRIVE,
 					   CCTRL_43224B0_12MA_LED_DRIVE);
 		}
@@ -1149,7 +1151,7 @@ static struct si_info *ai_doattach(struct si_info *sii,
 		 * enable 12 mA drive strenth for 4313 and
 		 * set chipControl register bit 1
 		 */
-		SI_MSG(("Applying 4313 WARs\n"));
+		SI_MSG("Applying 4313 WARs\n");
 		si_pmu_chipcontrol(sih, 0, CCTRL_4313_12MA_LED_DRIVE,
 				   CCTRL_4313_12MA_LED_DRIVE);
 	}
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/dma.c b/drivers/net/wireless/brcm80211/brcmsmac/dma.c
index e286fb4..0bb8c37 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/dma.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/dma.c
@@ -13,6 +13,9 @@
  * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
  * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
+
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
 #include <linux/slab.h>
 #include <linux/delay.h>
 #include <linux/pci.h>
@@ -168,26 +171,25 @@
 
 /* debug/trace */
 #ifdef BCMDBG
-#define	DMA_ERROR(args) \
-	do { \
-		if (!(*di->msg_level & 1)) \
-			; \
-		else \
-			printk args; \
-	} while (0)
-#define	DMA_TRACE(args) \
-	do { \
-		if (!(*di->msg_level & 2)) \
-			; \
-		else \
-			printk args; \
-	} while (0)
+#define	DMA_ERROR(fmt, ...)					\
+do {								\
+	if (*di->msg_level & 1)					\
+		pr_debug("%s: " fmt, __func__, ##__VA_ARGS__);	\
+} while (0)
+#define	DMA_TRACE(fmt, ...)					\
+do {								\
+	if (*di->msg_level & 2)					\
+		pr_debug("%s: " fmt, __func__, ##__VA_ARGS__);	\
+} while (0)
 #else
-#define	DMA_ERROR(args)
-#define	DMA_TRACE(args)
+#define	DMA_ERROR(fmt, ...)			\
+	no_printk(fmt, ##__VA_ARGS__)
+#define	DMA_TRACE(fmt, ...)			\
+	no_printk(fmt, ##__VA_ARGS__)
 #endif				/* BCMDBG */
 
-#define	DMA_NONE(args)
+#define	DMA_NONE(fmt, ...)			\
+	no_printk(fmt, ##__VA_ARGS__)
 
 #define	MAXNAMEL	8	/* 8 char names */
 
@@ -361,7 +363,7 @@ static uint _dma_ctrlflags(struct dma_info *di, uint mask, uint flags)
 	uint dmactrlflags;
 
 	if (di == NULL) {
-		DMA_ERROR(("_dma_ctrlflags: NULL dma handle\n"));
+		DMA_ERROR("NULL dma handle\n");
 		return 0;
 	}
 
@@ -412,13 +414,13 @@ static bool _dma_isaddrext(struct dma_info *di)
 	/* not all tx or rx channel are available */
 	if (di->d64txregs != NULL) {
 		if (!_dma64_addrext(di->d64txregs))
-			DMA_ERROR(("%s: _dma_isaddrext: DMA64 tx doesn't have "
-				   "AE set\n", di->name));
+			DMA_ERROR("%s: DMA64 tx doesn't have AE set\n",
+				  di->name);
 		return true;
 	} else if (di->d64rxregs != NULL) {
 		if (!_dma64_addrext(di->d64rxregs))
-			DMA_ERROR(("%s: _dma_isaddrext: DMA64 rx doesn't have "
-				   "AE set\n", di->name));
+			DMA_ERROR("%s: DMA64 rx doesn't have AE set\n",
+				  di->name);
 		return true;
 	}
 
@@ -519,8 +521,8 @@ static bool dma64_alloc(struct dma_info *di, uint direction)
 		va = dma_ringalloc(di, D64RINGALIGN, size, &align_bits,
 			&alloced, &di->txdpaorig);
 		if (va == NULL) {
-			DMA_ERROR(("%s: dma64_alloc: DMA_ALLOC_CONSISTENT(ntxd)"
-				   " failed\n", di->name));
+			DMA_ERROR("%s: DMA_ALLOC_CONSISTENT(ntxd) failed\n",
+				  di->name);
 			return false;
 		}
 		align = (1 << align_bits);
@@ -533,8 +535,8 @@ static bool dma64_alloc(struct dma_info *di, uint direction)
 		va = dma_ringalloc(di, D64RINGALIGN, size, &align_bits,
 			&alloced, &di->rxdpaorig);
 		if (va == NULL) {
-			DMA_ERROR(("%s: dma64_alloc: DMA_ALLOC_CONSISTENT(nrxd)"
-				   " failed\n", di->name));
+			DMA_ERROR("%s: DMA_ALLOC_CONSISTENT(nrxd) failed\n",
+				  di->name);
 			return false;
 		}
 		align = (1 << align_bits);
@@ -583,11 +585,10 @@ struct dma_pub *dma_attach(char *name, struct si_pub *sih,
 	 */
 	_dma_ctrlflags(di, DMA_CTRL_ROC | DMA_CTRL_PEN, 0);
 
-	DMA_TRACE(("%s: dma_attach: %s flags 0x%x ntxd %d nrxd %d "
-		   "rxbufsize %d rxextheadroom %d nrxpost %d rxoffset %d "
-		   "dmaregstx %p dmaregsrx %p\n", name, "DMA64",
-		   di->dma.dmactrlflags, ntxd, nrxd, rxbufsize,
-		   rxextheadroom, nrxpost, rxoffset, dmaregstx, dmaregsrx));
+	DMA_TRACE("%s: %s flags 0x%x ntxd %d nrxd %d rxbufsize %d rxextheadroom %d nrxpost %d rxoffset %d dmaregstx %p dmaregsrx %p\n",
+		  name, "DMA64",
+		  di->dma.dmactrlflags, ntxd, nrxd, rxbufsize,
+		  rxextheadroom, nrxpost, rxoffset, dmaregstx, dmaregsrx);
 
 	/* make a private copy of our callers name */
 	strncpy(di->name, name, MAXNAMEL);
@@ -645,8 +646,8 @@ struct dma_pub *dma_attach(char *name, struct si_pub *sih,
 		di->dmadesc_align = 4;	/* 16 byte alignment */
 	}
 
-	DMA_NONE(("DMA descriptor align_needed %d, align %d\n",
-		  di->aligndesc_4k, di->dmadesc_align));
+	DMA_NONE("DMA descriptor align_needed %d, align %d\n",
+		 di->aligndesc_4k, di->dmadesc_align);
 
 	/* allocate tx packet pointer vector */
 	if (ntxd) {
@@ -684,21 +685,21 @@ struct dma_pub *dma_attach(char *name, struct si_pub *sih,
 
 	if ((di->ddoffsetlow != 0) && !di->addrext) {
 		if (di->txdpa > SI_PCI_DMA_SZ) {
-			DMA_ERROR(("%s: dma_attach: txdpa 0x%x: addrext not "
-				   "supported\n", di->name, (u32)di->txdpa));
+			DMA_ERROR("%s: txdpa 0x%x: addrext not supported\n",
+				  di->name, (u32)di->txdpa);
 			goto fail;
 		}
 		if (di->rxdpa > SI_PCI_DMA_SZ) {
-			DMA_ERROR(("%s: dma_attach: rxdpa 0x%x: addrext not "
-				   "supported\n", di->name, (u32)di->rxdpa));
+			DMA_ERROR("%s: rxdpa 0x%x: addrext not supported\n",
+				  di->name, (u32)di->rxdpa);
 			goto fail;
 		}
 	}
 
-	DMA_TRACE(("ddoffsetlow 0x%x ddoffsethigh 0x%x dataoffsetlow 0x%x "
-		   "dataoffsethigh " "0x%x addrext %d\n", di->ddoffsetlow,
-		   di->ddoffsethigh, di->dataoffsetlow, di->dataoffsethigh,
-		   di->addrext));
+	DMA_TRACE("ddoffsetlow 0x%x ddoffsethigh 0x%x dataoffsetlow 0x%x dataoffsethigh 0x%x addrext %d\n",
+		  di->ddoffsetlow, di->ddoffsethigh,
+		  di->dataoffsetlow, di->dataoffsethigh,
+		  di->addrext);
 
 	return (struct dma_pub *) di;
 
@@ -744,7 +745,7 @@ void dma_detach(struct dma_pub *pub)
 {
 	struct dma_info *di = (struct dma_info *)pub;
 
-	DMA_TRACE(("%s: dma_detach\n", di->name));
+	DMA_TRACE("%s:\n", di->name);
 
 	/* free dma descriptor rings */
 	if (di->txd64)
@@ -812,7 +813,7 @@ static void _dma_rxenable(struct dma_info *di)
 	uint dmactrlflags = di->dma.dmactrlflags;
 	u32 control;
 
-	DMA_TRACE(("%s: dma_rxenable\n", di->name));
+	DMA_TRACE("%s:\n", di->name);
 
 	control =
 	    (R_REG(&di->d64rxregs->control) & D64_RC_AE) |
@@ -832,7 +833,7 @@ void dma_rxinit(struct dma_pub *pub)
 {
 	struct dma_info *di = (struct dma_info *)pub;
 
-	DMA_TRACE(("%s: dma_rxinit\n", di->name));
+	DMA_TRACE("%s:\n", di->name);
 
 	if (di->nrxd == 0)
 		return;
@@ -926,7 +927,7 @@ int dma_rx(struct dma_pub *pub, struct sk_buff_head *skb_list)
 		return 0;
 
 	len = le16_to_cpu(*(__le16 *) (p->data));
-	DMA_TRACE(("%s: dma_rx len %d\n", di->name, len));
+	DMA_TRACE("%s: dma_rx len %d\n", di->name, len);
 	dma_spin_for_len(len, p);
 
 	/* set actual length */
@@ -953,14 +954,14 @@ int dma_rx(struct dma_pub *pub, struct sk_buff_head *skb_list)
 				  D64_RS0_CD_MASK) -
 				 di->rcvptrbase) & D64_RS0_CD_MASK,
 				struct dma64desc);
-			DMA_ERROR(("dma_rx, rxin %d rxout %d, hw_curr %d\n",
-				   di->rxin, di->rxout, cur));
+			DMA_ERROR("rxin %d rxout %d, hw_curr %d\n",
+				  di->rxin, di->rxout, cur);
 		}
 #endif				/* BCMDBG */
 
 		if ((di->dma.dmactrlflags & DMA_CTRL_RXMULTI) == 0) {
-			DMA_ERROR(("%s: dma_rx: bad frame length (%d)\n",
-				   di->name, len));
+			DMA_ERROR("%s: bad frame length (%d)\n",
+				  di->name, len);
 			skb_queue_walk_safe(&dma_frames, p, next) {
 				skb_unlink(p, &dma_frames);
 				brcmu_pkt_buf_free_skb(p);
@@ -977,7 +978,7 @@ int dma_rx(struct dma_pub *pub, struct sk_buff_head *skb_list)
 
 static bool dma64_rxidle(struct dma_info *di)
 {
-	DMA_TRACE(("%s: dma_rxidle\n", di->name));
+	DMA_TRACE("%s:\n", di->name);
 
 	if (di->nrxd == 0)
 		return true;
@@ -1017,7 +1018,7 @@ bool dma_rxfill(struct dma_pub *pub)
 
 	n = di->nrxpost - nrxdactive(di, rxin, rxout);
 
-	DMA_TRACE(("%s: dma_rxfill: post %d\n", di->name, n));
+	DMA_TRACE("%s: post %d\n", di->name, n);
 
 	if (di->rxbufsize > BCMEXTRAHDROOM)
 		extra_offset = di->rxextrahdrroom;
@@ -1030,11 +1031,9 @@ bool dma_rxfill(struct dma_pub *pub)
 		p = brcmu_pkt_buf_get_skb(di->rxbufsize + extra_offset);
 
 		if (p == NULL) {
-			DMA_ERROR(("%s: dma_rxfill: out of rxbufs\n",
-				   di->name));
+			DMA_ERROR("%s: out of rxbufs\n", di->name);
 			if (i == 0 && dma64_rxidle(di)) {
-				DMA_ERROR(("%s: rxfill64: ring is empty !\n",
-					   di->name));
+				DMA_ERROR("%s: ring is empty !\n", di->name);
 				ring_empty = true;
 			}
 			di->dma.rxnobuf++;
@@ -1079,7 +1078,7 @@ void dma_rxreclaim(struct dma_pub *pub)
 	struct dma_info *di = (struct dma_info *)pub;
 	struct sk_buff *p;
 
-	DMA_TRACE(("%s: dma_rxreclaim\n", di->name));
+	DMA_TRACE("%s:\n", di->name);
 
 	while ((p = _dma_getnextrxp(di, true)))
 		brcmu_pkt_buf_free_skb(p);
@@ -1110,7 +1109,7 @@ void dma_txinit(struct dma_pub *pub)
 	struct dma_info *di = (struct dma_info *)pub;
 	u32 control = D64_XC_XE;
 
-	DMA_TRACE(("%s: dma_txinit\n", di->name));
+	DMA_TRACE("%s:\n", di->name);
 
 	if (di->ntxd == 0)
 		return;
@@ -1142,7 +1141,7 @@ void dma_txsuspend(struct dma_pub *pub)
 {
 	struct dma_info *di = (struct dma_info *)pub;
 
-	DMA_TRACE(("%s: dma_txsuspend\n", di->name));
+	DMA_TRACE("%s:\n", di->name);
 
 	if (di->ntxd == 0)
 		return;
@@ -1154,7 +1153,7 @@ void dma_txresume(struct dma_pub *pub)
 {
 	struct dma_info *di = (struct dma_info *)pub;
 
-	DMA_TRACE(("%s: dma_txresume\n", di->name));
+	DMA_TRACE("%s:\n", di->name);
 
 	if (di->ntxd == 0)
 		return;
@@ -1176,11 +1175,11 @@ void dma_txreclaim(struct dma_pub *pub, enum txd_range range)
 	struct dma_info *di = (struct dma_info *)pub;
 	struct sk_buff *p;
 
-	DMA_TRACE(("%s: dma_txreclaim %s\n", di->name,
-		   (range == DMA_RANGE_ALL) ? "all" :
-		   ((range ==
-		     DMA_RANGE_TRANSMITTED) ? "transmitted" :
-		    "transferred")));
+	DMA_TRACE("%s: %s\n",
+		  di->name,
+		  range == DMA_RANGE_ALL ? "all" :
+		  range == DMA_RANGE_TRANSMITTED ? "transmitted" :
+		  "transferred");
 
 	if (di->txin == di->txout)
 		return;
@@ -1250,7 +1249,7 @@ int dma_txfast(struct dma_pub *pub, struct sk_buff *p0, bool commit)
 	u32 flags = 0;
 	dma_addr_t pa;
 
-	DMA_TRACE(("%s: dma_txfast\n", di->name));
+	DMA_TRACE("%s:\n", di->name);
 
 	txout = di->txout;
 
@@ -1314,7 +1313,7 @@ int dma_txfast(struct dma_pub *pub, struct sk_buff *p0, bool commit)
 	return 0;
 
  outoftxd:
-	DMA_ERROR(("%s: dma_txfast: out of txds !!!\n", di->name));
+	DMA_ERROR("%s: out of txds !!!\n", di->name);
 	brcmu_pkt_buf_free_skb(p0);
 	di->dma.txavail = 0;
 	di->dma.txnobuf++;
@@ -1338,11 +1337,11 @@ struct sk_buff *dma_getnexttxp(struct dma_pub *pub, enum txd_range range)
 	u16 active_desc;
 	struct sk_buff *txp;
 
-	DMA_TRACE(("%s: dma_getnexttxp %s\n", di->name,
-		   (range == DMA_RANGE_ALL) ? "all" :
-		   ((range ==
-		     DMA_RANGE_TRANSMITTED) ? "transmitted" :
-		    "transferred")));
+	DMA_TRACE("%s: %s\n",
+		  di->name,
+		  range == DMA_RANGE_ALL ? "all" :
+		  range == DMA_RANGE_TRANSMITTED ? "transmitted" :
+		  "transferred");
 
 	if (di->ntxd == 0)
 		return NULL;
@@ -1402,8 +1401,8 @@ struct sk_buff *dma_getnexttxp(struct dma_pub *pub, enum txd_range range)
 	return txp;
 
  bogus:
-	DMA_NONE(("dma_getnexttxp: bogus curr: start %d end %d txout %d "
-		  "force %d\n", start, end, di->txout, forceall));
+	DMA_NONE("bogus curr: start %d end %d txout %d\n",
+		 start, end, di->txout);
 	return NULL;
 }
 


--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply related

* [Bug 42883] Firefox crashes in state_tracker/st_cb_blit.c:87
From: bugzilla-daemon @ 2011-11-13 19:33 UTC (permalink / raw)
  To: dri-devel
In-Reply-To: <bug-42883-502@http.bugs.freedesktop.org/>

https://bugs.freedesktop.org/show_bug.cgi?id=42883

Stefan <kdevel@vogtner.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Platform|Other                       |x86-64 (AMD64)
         OS/Version|All                         |Linux (All)

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

^ permalink raw reply

* Re: [PATCH 3/3] pids: Make it possible to clone tasks with given pids
From: Oleg Nesterov @ 2011-11-13 19:28 UTC (permalink / raw)
  To: Pavel Emelyanov
  Cc: Tejun Heo, Andrew Morton, Cyrill Gorcunov, Glauber Costa,
	Nathan Lynch, Linux Kernel Mailing List, Serge Hallyn,
	Daniel Lezcano
In-Reply-To: <4EBD57D4.1060503@parallels.com>

On 11/11, Pavel Emelyanov wrote:
>
> Hm, so intrusiveness is your main concern here, I see.

To me, this is important.

> OK, let's assume we go with sysctl setting the last_pid.
>
> One of the major concerns with previous attempts have been - someone creates
> a process with a pid that was in use by some app recently and screws things
> up with pid reuse.

Good point.

> My approach solves this,

Yes. Although, can't resist, in a subtle way (imho). CLONE_CHILD_USEPIDS
stops working after a clone() without this flag.

> how can sysctl handle it? Allowing
> the last_pid change by the CAP_SYA_ADMIN

Yes, when I suggested set_last_pid I assumed that it needs CAP_SYS_ADMIN.

> only is not an option, since people
> are looking forward to non-root restore.

But CLONE_NEWPID needs CAP_SYS_ADMIN too ?

Anyway, I do not pretend I understand the problem space. And probably
it would be more convenient to change the creds before forking some
children with the predefined pids, I do not know.

So yes, I agree, CLONE_CHILD_USEPIDS wins here. Perhaps set_last_pid
needs another sysctl(set_last_pid_allowed)/whatever, or another idea.
Or we should use CLONE_CHILD_USEPIDS ;)

Let me repeat. It is not that I strongly against CLONE_CHILD_USEPIDS
(although yes, I can't say personally I like it very much ;). Just
I am trying to ensure we can't make something more clear/clean/simple,
at least from the kernel pov. Especially because you are trying to
establish the new user-visible API.

Oleg.


^ permalink raw reply

* [Bug 42883] Firefox crashes in state_tracker/st_cb_blit.c:87
From: bugzilla-daemon @ 2011-11-13 19:33 UTC (permalink / raw)
  To: dri-devel
In-Reply-To: <bug-42883-502@http.bugs.freedesktop.org/>

https://bugs.freedesktop.org/show_bug.cgi?id=42883

Stefan <kdevel@vogtner.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Firefox crashes             |Firefox crashes in
                   |state_tracker/st_cb_blit.c: |state_tracker/st_cb_blit.c:
                   |87                          |87

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

^ permalink raw reply

* Re: [BUG?] Maybe NFS bug since 2.6.37 on SPARC64
From: Chuck Lever @ 2011-11-13 19:32 UTC (permalink / raw)
  To: Lukas Razik; +Cc: Jim Rees, Trond Myklebust, Linux NFS Mailing List
In-Reply-To: <1321146230.5436.YahooMailNeo@web24710.mail.ird.yahoo.com>


On Nov 12, 2011, at 8:03 PM, Lukas Razik wrote:

> Chuck Lever <chuck.lever@oracle.com> wrote:
> 
>> On Nov 12, 2011, at 1:49 PM, Jim Rees wrote:
>> 
>>> The question for us is how long should an nfsroot client wait for the 
>> server
>>> to reply.  It sounds like the client used to wait longer than it does now.
>> 
>> Before, the client performed the GETPORT(NFS) step synchronously, first.  This 
>> took 30 seconds or so to timeout.  When it did, the client decided to proceed 
>> with port 2049.  Then it went on to do the other mount tasks, and at the point 
>> had waited long enough that these tasks did not time out while waiting for the 
>> switch port.
>> 
>>> It seems to me the client should wait at least 90 seconds so that the
>>> situation you're in (servers on non-portfast ports) will work.  I would
>>> think they should wait indefinitely, since there's not much else they 
>> can
>>> do.
>> 
>> It should be simple to wrap the (MNT(mnt), NFS(getroot)) steps in a while(true) 
>> loop.  Would mount_root_nfs() be the right place for this?
>> 
> 
> I thought it would be harder and I had no time to look inside the kernel but now I wrote a patch:
> The kernel tries to create the MNT RPC client not once as before but three times - then it gives up.

This changes the behavior of normal user space NFS mounts as well.  User space mounts are already retried by the mount.nfs program.  We risk making the mount(2) system call hang by retrying here.

I think we prefer a solution that changes the behavior of only NFSROOT mounts.  Have you tried wrapping mount_root_nfs() as I suggested?

> Third time lucky... ;-)
> In my case the 2. MNT request is successful:
> ---
> [   71.594744] ADDRCONF(NETDEV_UP): eth0: link is not ready
> [   72.617007] IP-Config: Complete:
> [   72.617077]      device=eth0, addr=137.226.167.242, mask=255.255.255.224, gw=137.226.167.225,
> [   72.617278]      host=137.226.167.242, domain=, nis-domain=(none),
> [   72.617393]      bootserver=255.255.255.255, rootserver=137.226.167.241, rootpath=
> [   72.617741] Root-NFS: nfsroot=/srv/nfs/cluster2
> [   72.618010] NFS: nfs mount opts='udp,nolock,addr=137.226.167.241'
> [   72.618147] NFS:   parsing nfs mount option 'udp'
> [   72.618187] NFS:   parsing nfs mount option 'nolock'
> [   72.618233] NFS:   parsing nfs mount option 'addr=137.226.167.241'
> [   72.618301] NFS: MNTPATH: '/srv/nfs/cluster2'
> [   72.618335] NFS: sending MNT request for 137.226.167.241:/srv/nfs/cluster2
> [   72.618383] NFS: 1. MNT request
> [   73.691872] e1000e: eth0 NIC Link is Up 1000 Mbps Full Duplex, Flow Control: Rx
> [   73.711988] ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
> [  107.697332] NFS: 2. MNT request
> [  107.704591] NFS: received 1 auth flavors
> [  107.704653] NFS:   auth flavor[0]: 1
> [  107.704834] NFS: MNT request succeeded
> [  107.704897] NFS: using auth flavor 1
> [  107.711857] VFS: Mounted root (nfs filesystem) on device 0:13.
> INIT: version 2.88 booting
> ---
> 
> So many thanks again for your help and your very helpful hints!
> 
> Regards,
> Lukas
> 
> 
> PS: That's what I've done:
> --- linux-2.6.39.4/fs/nfs/mount_clnt.c  2011-08-03 21:43:28.000000000 +0200
> +++ linux-2.6.39.4-fix/fs/nfs/mount_clnt.c      2011-11-13 01:58:13.000000000 +0100
> @@ -164,6 +164,7 @@
>         };
>         struct rpc_clnt         *mnt_clnt;
>         int                     status;
> +       int                     attempt = 0;
>  
>         dprintk("NFS: sending MNT request for %s:%s\n",
>                 (info->hostname ? info->hostname : "server"),
> @@ -172,7 +173,13 @@
>         if (info->noresvport)
>                 args.flags |= RPC_CLNT_CREATE_NONPRIVPORT;
>  
> -       mnt_clnt = rpc_create(&args);
> +       do {
> +               attempt++;
> +               dprintk("NFS: %d. MNT request\n", attempt);
> +               mnt_clnt = rpc_create(&args);
> +       } while (IS_ERR(mnt_clnt) && attempt < 3);
> +
> +
>         if (IS_ERR(mnt_clnt))
>                 goto out_clnt_err;
> --

-- 
Chuck Lever
chuck[dot]lever[at]oracle[dot]com





^ permalink raw reply

* [Bug 42883] New: Firefox crashes state_tracker/st_cb_blit.c:87
From: bugzilla-daemon @ 2011-11-13 19:32 UTC (permalink / raw)
  To: dri-devel

https://bugs.freedesktop.org/show_bug.cgi?id=42883

             Bug #: 42883
           Summary: Firefox crashes state_tracker/st_cb_blit.c:87
    Classification: Unclassified
           Product: Mesa
           Version: git
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: Drivers/Gallium/r600
        AssignedTo: dri-devel@lists.freedesktop.org
        ReportedBy: kdevel@vogtner.de


The Firefox Nightly Build 
http://ftp.mozilla.org/pub/mozilla.org/firefox/nightly/2011/11/2011-11-12-03-15-41-mozilla-central/firefox-11.0a1.en-US.linux-x86_64.tar.bz2
crashes when Using WebGL:

https://bugzilla.mozilla.org/show_bug.cgi?id=701731#c4

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

^ permalink raw reply

* Re: Using sja1000_isa on a 64b system
From: Wolfgang Grandegger @ 2011-11-13 19:31 UTC (permalink / raw)
  To: Willy Lambert
  Cc: socketcan-users-0fE9KPoRgkgATYTw5x5z8w@public.gmane.org,
	linux-can-u79uwXL29TY76Z2rM5mHXA
In-Reply-To: <CAKvQZ_3anOf1SbE5TK6gvJf4v3gw1MBae0hw5JGr__szt7KoQQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On 11/13/2011 10:15 AM, Willy Lambert wrote:
> 2011/11/13 Willy Lambert <lambert.willy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:
>> 2011/11/12 Wolfgang Grandegger <wg-5Yr1BZd7O62+XT7JhA+gdA@public.gmane.org>:
>>> On 11/12/2011 10:08 PM, Wolfgang Grandegger wrote:
>>>> On 11/12/2011 10:55 AM, Willy Lambert wrote:
>>> ...
>>>>>> I failed to apply the patch, is it for 2.6.38.8 kernels ?
>>>>
>>>> No, it's for up-to-date *mainline* linux version 3.1.x. Any chance to
>>>> switch to David Miller's "net-nex-2.6" tree?. Otherwise I'm going to
>>>> adapt the patch to 2.6.38.8.
>>>
>>> Well, the patch also applies to 2.6.38.8. Maybe you have some problems
>>> extracting the patch. Therefore I have attached it as attachment this
>>> time. Good luck.
>>
>> It's ok now :
>> ard@ard-host:~/src/linux-2.6.38.8$ patch -p1 < wg_platform.patch
>> patching file drivers/net/can/sja1000/Kconfig
>> patching file drivers/net/can/sja1000/sja1000_isa.c
>>
>> I must have done something wrong. I am going to test it now
>>
> 
> arg, it doesn't compile I had a look a sources but I don't see the error :
> 
>   CC [M]  drivers/xenomai/can/rtcan_raw_dev.o
> drivers/net/can/sja1000/sja1000_isa.c: In function ‘sja1000_isa_init’:
> drivers/net/can/sja1000/sja1000_isa.c:297: error: invalid storage
> class for function ‘sja1000_isa_exit’
> drivers/net/can/sja1000/sja1000_isa.c:296: warning: ISO C90 forbids
> mixed declarations and code
> drivers/net/can/sja1000/sja1000_isa.c:307: error: invalid storage
> class for function ‘__inittest’
> drivers/net/can/sja1000/sja1000_isa.c:307: warning: ‘alias’ attribute ignored
> drivers/net/can/sja1000/sja1000_isa.c:308: error: invalid storage
> class for function ‘__exittest’
> drivers/net/can/sja1000/sja1000_isa.c:308: warning: ISO C90 forbids
> mixed declarations and code
> drivers/net/can/sja1000/sja1000_isa.c:308: warning: ‘alias’ attribute ignored
> drivers/net/can/sja1000/sja1000_isa.c:308: error: expected declaration
> or statement at end of input
> make[5]: *** [drivers/net/can/sja1000/sja1000_isa.o] Error 1

Argh, a "}" is missing, sorry. I will test the patch more carefully
before re-sending.

Wolfgang.

^ permalink raw reply

* Mantis CAM not SMP safe / Activating CAM on Technisat Skystar HD2 (DVB-S2)
From: Ninja @ 2011-11-13 19:30 UTC (permalink / raw)
  To: linux-media

Hi,

I'm using a Technisat Skystar HD2 (DVB-S2) with a CI Module under Ubuntu 
11.04.
As some people already noticed, the mantis_ca_init() is never called to 
initialize the CAM.
Since s2-liplianin used almost the same code, I basically just put the 
mantis_ca_init back in,
which is working quite good. But I hope somebody can help me to remove a 
bug rendering the driver not SMP safe,
since I believe my work around for this makes the driver less reliable.

First of all the description of the bug:
I'm using a dual core cpu and noticed that I don't get all the interrupt 
i should get when writing to/ reading from the card using a function 
which uses "mantis_hif_sbuf_opdone_wait" in "mantis_hif.c".
This leads to the 500 ms timeout. Interesting enough, when reading the 
data despite the timeout, the data is valid and available. Using 
max_cpus=1 parameter when starting ubuntu 11.04 solves the problem; all 
interrupts are received and no timeout occurs.
In addition to this, i think the return value of "msecs_to_jiffies" 
changed with some kernel update an thus "mantis_hif_sbuf_opdone_wait" 
never returns an error.
How hope someone can help figuraing out, why the card send less 
interrupt on SMP enabled machines. I know the core which handles the IRQ 
can change, but even all the IRQs from all core are less than when 
disabling SMP.

Now the description how I added the CI support again:

File mantis_hif.c (workaround for the SMP bug):
- Change the call from msecs_to_jiffies(500) to msecs_to_jiffies(2) in 
function "mantis_hif_sbuf_opdone_wait" (we just get the data after 2 ms, 
regardless if we got the data ready IRQ or not).

File mantis_pci.c:
- Move the function set_direction from mantis_core.c to mantis_pci.c (I 
tried to just add the forward declaration to mantis_core.h, but I 
couldn't get it to work...)
- Add its function declaration to mantis_pci.h (extern void 
mantis_set_direction(struct mantis_pci *mantis, int direction);).
- Add "mantis_set_direction(mantis, 0);" after "mantis->revision = 
pdev->revision;" in function "mantis_pci_init".
- Add "mmwrite(0x00, MANTIS_INT_MASK);" before "err = 
request_irq(pdev->irq,"... in function "mantis_pci_init".

File mantis_ca.c:
- Add the include #include "mantis_pci.h"
- Comment in "mantis_set_direction(mantis, 1);" in function 
"mantis_ts_control" in file mantis_ca.c

File manits_dvb.c:
- Add the function call "mantis_ca_init(mantis);" right before the 
return 0 in function "mantis_dvb_init".
- Add th function call "mantis_ca_exit(mantis);" right before 
"tasklet_kill(&mantis->tasklet);" in function "mantis_dvb_exit".

Regards,
Manuel


^ permalink raw reply

* [Buildroot] compile under buildroot
From: Jaroslav Jirásek @ 2011-11-13 19:29 UTC (permalink / raw)
  To: buildroot

Hi, I build buildroot with all development tools, under CentOS 6.
Buildroot I unpack and chroot to this.

Now I want compile something (for example busybox)
All attemps ends with this error:

In file included from /usr/include/sys/types.h:27,
                 from scripts/basic/fixdep.c:105:
/usr/lib/gcc/x86_64-unknown-linux-uclibc/4.3.6/include-fixed/features.h:361:23: error: gnu/stubs.h: No such file or directory


How can I solve this?

Thank you Jarda

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/buildroot/attachments/20111113/41c307b0/attachment.html>

^ permalink raw reply

* [Bug 27314] displayport link training fails on certain panels (channel equalization fails)
From: bugzilla-daemon @ 2011-11-13 19:29 UTC (permalink / raw)
  To: dri-devel
In-Reply-To: <bug-27314-502@http.bugs.freedesktop.org/>

https://bugs.freedesktop.org/show_bug.cgi?id=27314

--- Comment #61 from Rafael Ávila de Espíndola <rafael.espindola@gmail.com> 2011-11-13 11:29:13 PST ---
Created attachment 53481
  --> https://bugs.freedesktop.org/attachment.cgi?id=53481
dmesg from kernel-3.1.0-7.fc16

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply

* [Bug 27314] displayport link training fails on certain panels (channel equalization fails)
From: bugzilla-daemon @ 2011-11-13 19:26 UTC (permalink / raw)
  To: dri-devel
In-Reply-To: <bug-27314-502@http.bugs.freedesktop.org/>

https://bugs.freedesktop.org/show_bug.cgi?id=27314

--- Comment #60 from Rafael Ávila de Espíndola <rafael.espindola@gmail.com> 2011-11-13 11:26:58 PST ---
> Why are you using UMS?  All of the relevant fixes have been in KMS.

KMS also failed with the fedora kernel. I will upload the dmesg in a sec.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply

* WARNING: at fs/sysfs/sysfs.h:195 (during boot)
From: Markus Trippelsdorf @ 2011-11-13 19:24 UTC (permalink / raw)
  To: linux-kernel; +Cc: Greg Kroah-Hartman

I'm seeing this for the fist time:

...
XFS (sda): Mounting Filesystem
XFS (sda): Ending clean mount
ATL1E 0000:02:00.0: irq 40 for MSI/MSI-X
ATL1E 0000:02:00.0: eth0: NIC Link is Up <100 Mbps Full Duplex>
ATL1E 0000:02:00.0: eth0: NIC Link is Up <100 Mbps Full Duplex>
udevd[888]: starting version 171
------------[ cut here ]------------
WARNING: at fs/sysfs/sysfs.h:195 sysfs_get_inode+0x136/0x140()
Hardware name: System Product Name
Pid: 945, comm: udevadm Not tainted 3.2.0-rc1-00252-g8f042aa #49
Call Trace:
 [<ffffffff81072795>] warn_slowpath_common+0x75/0xb0
 [<ffffffff81072895>] warn_slowpath_null+0x15/0x20
 [<ffffffff81167b26>] sysfs_get_inode+0x136/0x140
 [<ffffffff811695df>] sysfs_lookup+0x6f/0x110
 [<ffffffff8111b739>] d_alloc_and_lookup+0x39/0x80
 [<ffffffff8111ca93>] do_lookup+0x283/0x390
 [<ffffffff8111d954>] path_lookupat+0x114/0x6d0
 [<ffffffff8111b946>] ? getname_flags+0x36/0x230
 [<ffffffff8111df3b>] do_path_lookup+0x2b/0x70
 [<ffffffff8111e3a8>] user_path_at_empty+0x58/0xb0
 [<ffffffff81169d4c>] ? sysfs_put_link+0x1c/0x20
 [<ffffffff81120ac4>] ? generic_readlink+0x84/0xa0
 [<ffffffff8111e40c>] user_path_at+0xc/0x10
 [<ffffffff811161e0>] vfs_fstatat+0x30/0x70
 [<ffffffff8112d94b>] ? mntput_no_expire+0x2b/0xe0
 [<ffffffff81116236>] vfs_stat+0x16/0x20
 [<ffffffff81116305>] sys_newstat+0x15/0x30
 [<ffffffff8111642e>] ? sys_readlinkat+0x7e/0xb0
 [<ffffffff814d2c7b>] system_call_fastpath+0x16/0x1b
---[ end trace 2226f614d7765573 ]---
Adding 2097148k swap on /var/tmp/swap/swapfile.  Priority:-1 extents:2 across:2634672k

fs/sysfs/sysfs.h:195: 
    WARN_ON(!atomic_read(&sd->s_count));

-- 
Markus

^ permalink raw reply

* [Bug 30507] [RADEON:KMS:R600C] caster (commercial game) crash
From: bugzilla-daemon @ 2011-11-13 19:21 UTC (permalink / raw)
  To: dri-devel
In-Reply-To: <bug-30507-502@http.bugs.freedesktop.org/>

https://bugs.freedesktop.org/show_bug.cgi?id=30507

regnak90@gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #6 from regnak90@gmail.com 2011-11-13 11:21:45 PST ---
Fixed in r600g

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

^ permalink raw reply

* [PATCH 4/4] docs/html/hcall: Arrange for automatic build
From: Ian Jackson @ 2011-11-13 19:21 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson
In-Reply-To: <1321212066-10648-1-git-send-email-ian.jackson@eu.citrix.com>

- Use index.html rather than a stamp file.
- Automatically generate dependencies.
- Wire into the docs build system

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 docs/Makefile    |    9 ++++++---
 docs/xen-headers |   14 ++++++++++++++
 2 files changed, 20 insertions(+), 3 deletions(-)

diff --git a/docs/Makefile b/docs/Makefile
index 01e59cb..3815170 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -15,7 +15,8 @@ DOC_MARKDOWN	:= $(wildcard misc/*.markdown)
 DOC_PS		:= $(patsubst src/%.tex,ps/%.ps,$(DOC_TEX))
 DOC_PDF		:= $(patsubst src/%.tex,pdf/%.pdf,$(DOC_TEX))
 DOC_HTML	:= $(patsubst src/%.tex,html/%/index.html,$(DOC_TEX)) \
-		   $(patsubst %.markdown,html/%.html,$(DOC_MARKDOWN))
+		   $(patsubst %.markdown,html/%.html,$(DOC_MARKDOWN)) \
+		   html/hcall/index.html
 DOC_TXT         := $(patsubst %.txt,txt/%.txt,$(wildcard misc/*.txt)) \
 		   $(patsubst %.markdown,txt/%.txt,$(DOC_MARKDOWN))
 
@@ -129,13 +130,15 @@ html/%.html: %.markdown
 	$(MARKDOWN) $< > $@.tmp ; \
 	$(call move-if-changed,$@.tmp,$@) ; fi
 
-html/hcall/stamp:
+html/hcall/index.html: ./xen-headers
+	rm -rf $(@D)
 	@$(INSTALL_DIR) $(@D)
 	./xen-headers -O $(@D) \
 		-T 'arch-x86_64 - Xen public headers' \
 		-X arch-ia64 -X arch-x86_32 -X xen-x86_32 \
 		../xen include/public include/xen/errno.h
-	touch $@
+
+-include html/hcall/.deps
 
 txt/%.txt: %.txt
 	$(INSTALL_DIR) $(@D)
diff --git a/docs/xen-headers b/docs/xen-headers
index 3cc9e40..606b824 100755
--- a/docs/xen-headers
+++ b/docs/xen-headers
@@ -310,6 +310,12 @@ END
 }
 
 foreach $pass (qw(1 2)) {
+    my $depspath = "$outdir/.deps";
+    my $depsout;
+    if ($pass==2) {
+	$depsout = new IO::File "$depspath.new", 'w' or die $!;
+    }
+
     find({ wanted => 
 	       sub {
 		   return unless m/\.h$/;
@@ -326,11 +332,19 @@ foreach $pass (qw(1 2)) {
 		   $leaf_opath = $leaf;
 		   $leaf_opath =~ s#/#,#g;
 		   $leaf_opath .= ".html";
+		   print $depsout "$outdir/index.html: $File::Find::name\n"
+		       or die $!
+		       if $pass==2;
 		   process_file($File::Find::name, $outdir.'/'.$leaf_opath);
 	   },
 	   no_chdir => 1,
 	 },
 	 map { "$basedir/$_" } @indirs);
+
+    if ($pass==2) {
+	close $depsout or die $!;
+	rename "$depspath.new", "$depspath" or die $!;
+    }
 }
 
 output_index();
-- 
1.7.2.5

^ permalink raw reply related

* [PATCH 3/4] docs/html/hcall: Generate an "index.html"
From: Ian Jackson @ 2011-11-13 19:21 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson
In-Reply-To: <1321212066-10648-1-git-send-email-ian.jackson@eu.citrix.com>

Generate an "index.html" containing various useful links.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 docs/xen-headers         |   55 ++++++++++++++++++++++++++++++++++++++++++++++
 xen/include/public/xen.h |    4 ++-
 2 files changed, 58 insertions(+), 1 deletions(-)

diff --git a/docs/xen-headers b/docs/xen-headers
index 6918380..3cc9e40 100755
--- a/docs/xen-headers
+++ b/docs/xen-headers
@@ -50,6 +50,8 @@ my ($basedir,@indirs) = @ARGV;
 # general globals
 our $pass;
 our %sdef; 
+our @incontents;
+our @outfiles;
 # $sdef{$type}{$name} => {
 #     DefLocs => { "$leaf_path:$lineno" => $leaf_opath ,... }
 #     Xrefs => { "$leaf_path,$lineno" => "$xref", ... }
@@ -177,6 +179,19 @@ sub out_xrefs ($) {
     @pending_xrefs = ();
 }
 
+sub incontents ($$$) {
+    my ($text, $seq, $anchor) = @_;
+    $anchor = "incontents_$anchor";
+    if ($pass==2) {
+	push @incontents, { 
+	    Seq => $seq,
+	    Href => "$leaf_opath#$anchor",
+	    Title => $text,
+	};
+    }
+    return "<a name=\"$anchor\"><strong>$text</strong></a>";
+}
+
 sub write_file ($$) {
     my ($opath, $odata) = @_;
     my $out = new IO::File "$opath.new", '>' or die "$opath $!";
@@ -231,6 +246,8 @@ sub process_file ($$) {
 	    }
 	} elsif (s/^( \s* \#define \s+ ) (\w+) ( \s+\S )
                   / $1.defmacro($2).norm($3) /xe) {
+	} elsif (s/( \`incontents \s+ (\d+) \s+ (\w+) \s+ )(\S .* \S)
+                 / norm($1).incontents($4, $2, $3) /xe) {
 	} else {
 	    if (m/^\s*\}/) {
 		$in_enum = undef;
@@ -250,11 +267,47 @@ sub process_file ($$) {
     warning("pending xrefs at end of file") if @pending_xrefs;
 
     if ($pass == 2) {
+	push @outfiles, [ $leaf, $leaf_opath ];
 	$o .= "</pre></body></html>";
 	write_file($outfile, $o);
     }
 }
 
+sub output_index () {
+    my $title = "contents - $xtitle";
+    $o = '';
+    $o .= <<END;
+<html><head><title>$title</title></head>
+<body>
+<h1>$title</h1>
+<h2>Starting points</h2>
+<ul>
+END
+    foreach my $ic (sort { $a->{Seq} <=> $b->{Seq} } @incontents) {
+	$o .= "<li><a href=\"$ic->{Href}\">$ic->{Title}</a></li>\n";
+    }
+    $o .= "</ul>\n";
+    my $forkind = sub {
+	my ($type,$desc,$pfx,$sfx) = @_;
+	$o .= "<h2>$desc</h2><ul>\n";
+	foreach my $name (sort keys %{ $sdef{$type} }) {
+	    my $href = refhref($type,$name);
+	    next unless $href =~ m/\S/;
+	    $o .= "<li><a $href>$pfx$name$sfx</a></li>\n";
+	}
+	$o .= "</ul>\n";
+    };
+    $forkind->('Func','Functions','','()');
+    $forkind->('Struct','Structs','struct ','');
+    $forkind->('Enum','Enums and sets of #defines','','');
+    $forkind->('EnumVal','Enum values and individual #defines','','');
+    $o .= "</ul>\n<h2>Files</h2><ul>\n";
+    foreach my $of (sort { $a->[0] cmp $b->[0] } @outfiles) {
+	$o .= "<li><a href=\"$of->[1]\">$of->[0]</a></li>\n";
+    }
+    $o .= "</ul></body></html>\n";
+    write_file("$outdir/index.html", $o);
+}
 
 foreach $pass (qw(1 2)) {
     find({ wanted => 
@@ -279,3 +332,5 @@ foreach $pass (qw(1 2)) {
 	 },
 	 map { "$basedir/$_" } @indirs);
 }
+
+output_index();
diff --git a/xen/include/public/xen.h b/xen/include/public/xen.h
index f2c9e6f..a5b6ad8 100644
--- a/xen/include/public/xen.h
+++ b/xen/include/public/xen.h
@@ -55,7 +55,9 @@ DEFINE_XEN_GUEST_HANDLE(xen_pfn_t);
  * HYPERCALLS
  */
 
-/* ` enum hypercall_num { // __HYPERVISOR_* => HYPERVISOR_*() */
+/* `incontents 100 hcalls List of hypercalls
+ * ` enum hypercall_num { // __HYPERVISOR_* => HYPERVISOR_*()
+ */
 
 #define __HYPERVISOR_set_trap_table        0
 #define __HYPERVISOR_mmu_update            1
-- 
1.7.2.5

^ permalink raw reply related

* [PATCH 2/4] docs/html/hcall: Annotations for two hypercalls
From: Ian Jackson @ 2011-11-13 19:21 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson
In-Reply-To: <1321212066-10648-1-git-send-email-ian.jackson@eu.citrix.com>

Add annotations for a couple of the hypercalls:
 HYPERVISOR_set_trap_table
 HYPERVISOR_mmu_update

We do this by
 * annotating the list of #defines for hypercall numbers
 * annotating the list of error values
 * providing a function prototype for the systematically-named functions
The header generator does the rest.

This exercise revealed a couple of infelicities:
 * In the actual source code, do_mmu_update is defined to return an int
   and do_set_trap_table a long.  However both functions return either
   -Efoo (on error) or 0 for success.
 * The error numbers are defined only in the private header file
   xen/include/xen/errno.h and then only with names which will
   typically clash with other projects.  It would be nice to include a
   public version of this header which defines XEN_E*.  But for now
   we run xen-headers on errno.h too.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 docs/Makefile                     |    2 +-
 xen/include/public/arch-x86/xen.h |    6 ++++++
 xen/include/public/xen.h          |   11 +++++++++--
 xen/include/xen/errno.h           |    5 +++++
 4 files changed, 21 insertions(+), 3 deletions(-)

diff --git a/docs/Makefile b/docs/Makefile
index fc42859..01e59cb 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -134,7 +134,7 @@ html/hcall/stamp:
 	./xen-headers -O $(@D) \
 		-T 'arch-x86_64 - Xen public headers' \
 		-X arch-ia64 -X arch-x86_32 -X xen-x86_32 \
-		../xen include/public
+		../xen include/public include/xen/errno.h
 	touch $@
 
 txt/%.txt: %.txt
diff --git a/xen/include/public/arch-x86/xen.h b/xen/include/public/arch-x86/xen.h
index 79ec633..d663cef 100644
--- a/xen/include/public/arch-x86/xen.h
+++ b/xen/include/public/arch-x86/xen.h
@@ -82,7 +82,13 @@ typedef unsigned long xen_pfn_t;
 typedef unsigned long xen_ulong_t;
 
 /*
+ * ` enum neg_errnoval
+ * ` HYPERVISOR_set_trap_table(const struct trap_info traps[]);
+ * `
+ */
+/*
  * Send an array of these to HYPERVISOR_set_trap_table().
+ * Terminate the array with a sentinel entry, with traps[].address==0.
  * The privilege level specifies which modes may enter a trap via a software
  * interrupt. On x86/64, since rings 1 and 2 are unavailable, we allocate
  * privilege levels as follows:
diff --git a/xen/include/public/xen.h b/xen/include/public/xen.h
index fde9fa5..f2c9e6f 100644
--- a/xen/include/public/xen.h
+++ b/xen/include/public/xen.h
@@ -55,6 +55,8 @@ DEFINE_XEN_GUEST_HANDLE(xen_pfn_t);
  * HYPERCALLS
  */
 
+/* ` enum hypercall_num { // __HYPERVISOR_* => HYPERVISOR_*() */
+
 #define __HYPERVISOR_set_trap_table        0
 #define __HYPERVISOR_mmu_update            1
 #define __HYPERVISOR_set_gdt               2
@@ -105,6 +107,8 @@ DEFINE_XEN_GUEST_HANDLE(xen_pfn_t);
 #define __HYPERVISOR_arch_6               54
 #define __HYPERVISOR_arch_7               55
 
+/* ` } */
+
 /*
  * HYPERCALL COMPATIBILITY.
  */
@@ -163,8 +167,11 @@ DEFINE_XEN_GUEST_HANDLE(xen_pfn_t);
 #define NR_VIRQS       24
 
 /*
- * HYPERVISOR_mmu_update(reqs, count, pdone, foreigndom)
- * 
+ * ` enum neg_errnoval
+ * ` HYPERVISOR_mmu_update(const struct mmu_update reqs[],
+ * `                       unsigned count, unsigned *done_out,
+ * `                       unsigned foreigndom)
+ * `
  * @reqs is an array of mmu_update_t structures ((ptr, val) pairs).
  * @count is the length of the above array.
  * @pdone is an output parameter indicating number of completed operations
diff --git a/xen/include/xen/errno.h b/xen/include/xen/errno.h
index 7cf599f..c2eb5d3 100644
--- a/xen/include/xen/errno.h
+++ b/xen/include/xen/errno.h
@@ -1,6 +1,9 @@
 #ifndef _I386_ERRNO_H
 #define _I386_ERRNO_H
 
+/* ` enum neg_errnoval { /* -Efoo for each Efoo in the list below } */
+/* ` enum errnoval { */
+
 #define	EPERM		 1	/* Operation not permitted */
 #define	ENOENT		 2	/* No such file or directory */
 #define	ESRCH		 3	/* No such process */
@@ -129,4 +132,6 @@
 #define	ENOMEDIUM	123	/* No medium found */
 #define	EMEDIUMTYPE	124	/* Wrong medium type */
 
+/* } */
+
 #endif
-- 
1.7.2.5

^ permalink raw reply related

* [PATCH 1/4] docs/html/hcall: Initial cut of header documentation massager
From: Ian Jackson @ 2011-11-13 19:21 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Jackson
In-Reply-To: <1321212066-10648-1-git-send-email-ian.jackson@eu.citrix.com>

"xen-headers" generates HTML from header files.  So far this generates
just some type cross-references, if you say
   make -C docs html/hcall/stamp

An index page, proper wiring into the build system, and a few more
annotations in the headers, and will be forthcoming.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 docs/Makefile    |    8 ++
 docs/xen-headers |  281 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 289 insertions(+), 0 deletions(-)
 create mode 100755 docs/xen-headers

diff --git a/docs/Makefile b/docs/Makefile
index 2054541..fc42859 100644
--- a/docs/Makefile
+++ b/docs/Makefile
@@ -129,6 +129,14 @@ html/%.html: %.markdown
 	$(MARKDOWN) $< > $@.tmp ; \
 	$(call move-if-changed,$@.tmp,$@) ; fi
 
+html/hcall/stamp:
+	@$(INSTALL_DIR) $(@D)
+	./xen-headers -O $(@D) \
+		-T 'arch-x86_64 - Xen public headers' \
+		-X arch-ia64 -X arch-x86_32 -X xen-x86_32 \
+		../xen include/public
+	touch $@
+
 txt/%.txt: %.txt
 	$(INSTALL_DIR) $(@D)
 	cp $< $@.tmp
diff --git a/docs/xen-headers b/docs/xen-headers
new file mode 100755
index 0000000..6918380
--- /dev/null
+++ b/docs/xen-headers
@@ -0,0 +1,281 @@
+#!/usr/bin/perl -w
+# usage: xen-headers [ -X GLOB -I GLOB ... [-D...] ] \
+#                    -O HTML-DIR PUBLIC-INCLUDE-DIR
+
+# enum values --> selected function or struct
+# type & function names --> definition
+# function or struct selected by enum ++> ref to enum value
+
+# definitions must start in LH column
+# extra syntax:
+#    /* ` <definition>                          } parse as if <definition>
+#     * ` <definition>                          }  was not commented
+#   enum <name> { // <pattern>* => <func>()     } cross-reference
+#   enum <name> { // <pattern>* => struct <s>   }  enum values
+
+# 1st pass: find where things are defined and what references are wanted
+# 2rd pass: write out output
+
+use strict;
+use warnings;
+
+use Getopt::Long;
+use File::Find;
+use IO::File;
+
+Getopt::Long::Configure('bundling');
+
+our $outdir;
+our $debug=0;
+our $xtitle='';
+our @fglobs;
+
+sub includeexclude {
+    my ($yn, $optobj, $value) = @_;
+    push @fglobs, [ $value, $yn ];
+}
+
+GetOptions("O|output-dir=s" => \$outdir,
+           "D+" => \$debug,
+           "T=s" => \$xtitle,
+	   "I=s" => sub { includeexclude(1, @_); },
+	   "X=s" => sub { includeexclude(0, @_); })
+    or die;
+
+die unless defined $outdir;
+@ARGV>=2 or die;
+
+my ($basedir,@indirs) = @ARGV;
+
+# general globals
+our $pass;
+our %sdef; 
+# $sdef{$type}{$name} => {
+#     DefLocs => { "$leaf_path:$lineno" => $leaf_opath ,... }
+#     Xrefs => { "$leaf_path,$lineno" => "$xref", ... }
+#     Used => 1
+# }
+# $type might be  Func Struct Union Enum EnumVal
+
+# provided by the find() function
+our $leaf;
+our $leaf_opath;
+
+# reset at the start of each file
+our $o;
+our $in_enum;
+our @pending_xrefs;
+
+sub compile_fglobs () {
+    local ($_);
+    my $f = "sub file_wanted (\$) {\n    local (\$_) = \"/\$leaf\";\n";
+    foreach my $fglob (@fglobs) {
+	$_ = $fglob->[0];
+	$_ = "**$_**" unless m/[?*]/;
+	s/\W/\\$&/g;
+	s,\\\*\\\*,.*,g;
+	s,\\\*,[^/]*,g;
+	s,\\\?,[^/],g;
+	$f .= "    return $fglob->[1] if m,$_,o;\n";
+    }
+    $f .= "    return 1;\n}\n1;\n";
+    debug(3, $f);
+    eval $f or die "$@ ";
+}
+
+compile_fglobs();
+
+
+sub warning {
+    print STDERR "$leaf:$.: @_\n";
+}
+
+sub debug {
+    my $msglevel = scalar shift @_;
+    return unless $debug >= $msglevel;
+    print STDERR "DEBUG $pass $msglevel @_\n" or die $!;
+}
+
+sub in_enum ($$$) { $in_enum = [ @_ ]; } # [ $enumvalpfx, RefType, $refnamepfx ]
+
+sub aelem ($$$) {
+    my ($ntext,$ytext,$hparams) = @_;
+    return $ntext unless $hparams =~ m/\S/;
+    return "<a $hparams>$ytext</a>";
+}
+
+sub defn ($$$;$) {
+    my ($text,$type,$name,$hparams) = @_;
+    $hparams='' if !defined $hparams;
+    debug(2,"DEFN $. $type $name $hparams");
+    $sdef{$type}{$name}{DefLocs}{"$leaf:$."} = $leaf_opath;
+    my $xrefs = $sdef{$type}{$name}{Xrefs};
+    push @pending_xrefs, values %$xrefs if $xrefs;
+    $hparams .= " name=\"${type}_$name\"" if $sdef{$type}{$name}{Used};
+    return aelem($text, "<strong>$text</strong>", $hparams);
+}
+
+sub norm ($) {
+    local ($_) = @_;
+    my $no = '';
+    while (length) {
+	if (s/^(?:\s|^\W)+//) {
+	    $no .= $&;
+	} elsif (s/^(struct|union|enum)\s+(\w+)\b//) {
+	    $no .= ahref($&, (ucfirst $1), $2);
+	} elsif (s/^\w+\b//) {
+	    $no .= ahref($&, 'Func', $&);
+	} else {
+	    die "$_ ?";
+	}
+    }
+    return $no;
+}
+
+sub refhref ($$) {
+    my ($type,$name) = @_;
+    $sdef{$type}{$name}{Used} = 1;
+    my $locs = $sdef{$type}{$name}{DefLocs};
+    return '' unless $locs;
+    if ((scalar keys %$locs) != 1 && !$sdef{$type}{$name}{MultiWarned}) {
+	warning("multiple definitions of $type $name: $_")
+	    foreach keys %$locs;
+	$sdef{$type}{$name}{MultiWarned}=1;
+    }
+    my ($loc) = values %$locs;
+    return "href=\"$loc#${type}_$name\"";
+}
+
+sub ahref ($$$) {
+    my ($text,$type,$name) = @_;
+    return aelem($text,$text, refhref($type,$name));
+}
+
+sub defmacro ($) {
+    my ($valname) = @_;
+    if (!$in_enum) {
+	return $valname;
+    } elsif (substr($valname, 0, (length $in_enum->[0])) ne $in_enum->[0]) {
+	warning("in enum expecting $in_enum->[0]* got $valname");
+	return $valname;
+    } else {
+	my $reftype = $in_enum->[1];
+	my $refname = $in_enum->[2].substr($valname, (length $in_enum->[0]));
+	$sdef{$reftype}{$refname}{Xrefs}{$leaf,$.} =
+	    "[see <a href=\"$leaf_opath#EnumVal_$valname\">$valname</a>]";
+	$sdef{EnumVal}{$valname}{Used} = 1;
+	return defn($valname,'EnumVal',$valname, refhref($reftype,$refname));
+    }
+}
+
+sub out_xrefs ($) {
+    my ($linemapfunc) = @_;
+    foreach my $xref (@pending_xrefs) {
+	$o .= $linemapfunc->($xref);
+	$o .= "\n";
+    }
+    @pending_xrefs = ();
+}
+
+sub write_file ($$) {
+    my ($opath, $odata) = @_;
+    my $out = new IO::File "$opath.new", '>' or die "$opath $!";
+    print $out $odata or die $!;
+    rename "$opath.new", "$opath" or die "$opath $!";
+}
+
+sub process_file ($$) {
+    my ($infile, $outfile) = @_;
+    debug(1,"$pass $infile => $outfile");
+    my $in = new IO::File "$infile", '<' or die "$infile $!";
+
+    $o = '';
+    $in_enum = undef;
+    @pending_xrefs = ();
+
+    $o .= "<html><head><title>$leaf - $xtitle</title></head><body><pre>\n";
+    
+    while (<$in>) {
+	s/\&/\&amp;/g;
+	s/\</\&lt;/g;
+	s/\>/\&gt;/g;
+
+	if (m/^(.*\`)[ \t]*$/) {
+	    my $lhs = $1;
+	    out_xrefs(sub { "$1 $_[0]"; });
+	} elsif (m/^\s*$/) {
+	    out_xrefs(sub { sprintf "/* %70s */", $_[0]; });
+	}
+
+	# In case of comments, strip " /* ` " and " * ` ";
+	my $lstripped = s,^ \s* /? \* \s* \` \  ,,x ? $&: '';
+
+	# Strip trailing whitespace and perhaps trailing "*/" or "*"
+	s,(?: \s* \* /? )? \s* $,,x or die;
+	my $rstripped = $&;
+
+	# Now the actual functionality:
+
+	debug(3,"$. $_");
+
+	if (s/^( (?: \w+\  )? ) (\w+[a-z]\w+) ( \( .*)$
+             / $1.defn($2,'Func',$2).norm($3) /xe) {
+	} elsif (s/^((struct|union|enum) \  (\w+)) ( \s+ \{ .* )$
+                  / defn($1,(ucfirst $2),$3).norm($4) /xe) {
+	    if ($2 eq 'enum') {
+		if (m,/[/*] (\w+)\* \=\&gt\; (\w+)\*\(\),) { 
+		    in_enum($1,'Func',$2)
+		} elsif (m,/[/*] (\w+)\* \=\&gt\; (struct) (\w+)\*,) { 
+		    in_enum($1,(ucfirst $2),$3);
+	        }
+	    }
+	} elsif (s/^( \s* \#define \s+ ) (\w+) ( \s+\S )
+                  / $1.defmacro($2).norm($3) /xe) {
+	} else {
+	    if (m/^\s*\}/) {
+		$in_enum = undef;
+	    }
+	    $_ = norm($_);
+	}
+
+	# Write the line out
+
+	if ($pass == 2) {
+	    $o .= $lstripped;
+	    $o .= $_;
+	    $o .= $rstripped;
+	}
+    }
+
+    warning("pending xrefs at end of file") if @pending_xrefs;
+
+    if ($pass == 2) {
+	$o .= "</pre></body></html>";
+	write_file($outfile, $o);
+    }
+}
+
+
+foreach $pass (qw(1 2)) {
+    find({ wanted => 
+	       sub {
+		   return unless m/\.h$/;
+		   lstat $File::Find::name or die "$File::Find::name $!";
+		   -f _ or die "$File::Find::name";
+		   substr($File::Find::name, 0, 1+length $basedir) 
+		       eq "$basedir/"
+		       or die "$File::Find::name $basedir";
+		   $leaf = substr($File::Find::name, 1+length $basedir);
+		   if (!file_wanted()) {
+		       debug(1,"$pass $File::Find::name excluded");
+		       return;
+		   }
+		   $leaf_opath = $leaf;
+		   $leaf_opath =~ s#/#,#g;
+		   $leaf_opath .= ".html";
+		   process_file($File::Find::name, $outdir.'/'.$leaf_opath);
+	   },
+	   no_chdir => 1,
+	 },
+	 map { "$basedir/$_" } @indirs);
+}
-- 
1.7.2.5

^ permalink raw reply related

* [PATCH 0/4] docs/html/hcall: Hypercall docs headers
From: Ian Jackson @ 2011-11-13 19:21 UTC (permalink / raw)
  To: xen-devel

This is my proposed approach to providing hypercall documentation: we
provide an htmlified copy of the xen public headers, with a contents
page and cross-reference hyperlinks added.

This is done by a 350-line Perl script to which we can add features as
we think of them.

An example of the output can be found here:
 http://www.chiark.greenend.org.uk/~ijackson/volatile/2011/xen/hcall/

^ permalink raw reply

* Re: [GIT PULL FOR 3.2] misc small changes, mostly get/set IF related
From: Antti Palosaari @ 2011-11-13 19:20 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, linux-media; +Cc: Michael Krufky
In-Reply-To: <4EC016B9.1080306@iki.fi>

Mauro,
and these too for 3.3. Sorry about mistakes.

regards
Antti

On 11/13/2011 09:12 PM, Antti Palosaari wrote:
> Moro
>
> These patches are rather small enchantments and should not have any
> visible effect.
>
> mxl5007t change is that register read fix I have mentioned earlier. Reg
> read is used only for checking chip ID and even if ID is not detected
> correctly it will still work. So no functional changes.
>
> Antti
>
> The following changes since commit
> df5f76dfef9bfaec1ff27d0a60a57a773bf87f0f:
>
> af9015: limit I2C access to keep FW happy (2011-11-13 03:33:30 +0200)
>
> are available in the git repository at:
> git://linuxtv.org/anttip/media_tree.git af9015
>
> Antti Palosaari (12):
> tda18218: implement .get_if_frequency()
> tda18218: fix 6 MHz default IF frequency
> af9013: use .get_if_frequency() when possible
> mt2060: implement .get_if_frequency()
> qt1010: implement .get_if_frequency()
> tda18212: implement .get_if_frequency()
> tda18212: round IF frequency to close hardware value
> cxd2820r: switch to .get_if_frequency()
> cxd2820r: check bandwidth earlier for DVB-T/T2
> mxl5007t: fix reg read
> ce6230: remove experimental from Kconfig
> ce168: remove experimental from Kconfig
>
> drivers/media/common/tuners/mt2060.c | 9 +++-
> drivers/media/common/tuners/mxl5007t.c | 3 +-
> drivers/media/common/tuners/qt1010.c | 9 +++-
> drivers/media/common/tuners/tda18212.c | 17 +++++++-
> drivers/media/common/tuners/tda18218.c | 18 ++++++-
> drivers/media/common/tuners/tda18218_priv.h | 2 +
> drivers/media/dvb/dvb-usb/Kconfig | 4 +-
> drivers/media/dvb/dvb-usb/anysee.c | 7 ---
> drivers/media/dvb/frontends/af9013.c | 43 ++++--------------
> drivers/media/dvb/frontends/cxd2820r.h | 13 ------
> drivers/media/dvb/frontends/cxd2820r_c.c | 13 +++++-
> drivers/media/dvb/frontends/cxd2820r_t.c | 55 +++++++++++++----------
> drivers/media/dvb/frontends/cxd2820r_t2.c | 62 +++++++++++++++------------
> drivers/media/video/em28xx/em28xx-dvb.c | 7 ---
> 14 files changed, 140 insertions(+), 122 deletions(-)
>
>


-- 
http://palosaari.fi/

^ permalink raw reply

* Re: [PATCH FOR 3.2 FIX] af9015: limit I2C access to keep FW happy
From: Antti Palosaari @ 2011-11-13 19:19 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: linux-media, Malcolm Priestley
In-Reply-To: <4EC014E5.5090303@iki.fi>

Mauro,
Don't still but that to the 3.2 as fix. It is not much tested and not 
critical so better put it master for some more testing.

regards
Antti

On 11/13/2011 09:05 PM, Antti Palosaari wrote:
> AF9015 firmware does not like if it gets interrupted by I2C adapter
> request on some critical phases. During normal operation I2C adapter
> is used only 2nd demodulator and tuner on dual tuner devices.
>
> Override demodulator callbacks and use mutex for limit access to
> those "critical" paths to keep AF9015 happy.
>
> Signed-off-by: Antti Palosaari<crope@iki.fi>
> ---
>   drivers/media/dvb/dvb-usb/af9015.c |   97 ++++++++++++++++++++++++++++++++++++
>   drivers/media/dvb/dvb-usb/af9015.h |    7 +++
>   2 files changed, 104 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/media/dvb/dvb-usb/af9015.c b/drivers/media/dvb/dvb-usb/af9015.c
> index c6c275b..033aa8a 100644
> --- a/drivers/media/dvb/dvb-usb/af9015.c
> +++ b/drivers/media/dvb/dvb-usb/af9015.c
> @@ -1093,9 +1093,80 @@ error:
>   	return ret;
>   }
>
> +/* override demod callbacks for resource locking */
> +static int af9015_af9013_set_frontend(struct dvb_frontend *fe,
> +	struct dvb_frontend_parameters *params)
> +{
> +	int ret;
> +	struct dvb_usb_adapter *adap = fe->dvb->priv;
> +	struct af9015_state *priv = adap->dev->priv;
> +
> +	if (mutex_lock_interruptible(&adap->dev->usb_mutex))
> +		return -EAGAIN;
> +
> +	ret = priv->set_frontend[adap->id](fe, params);
> +
> +	mutex_unlock(&adap->dev->usb_mutex);
> +
> +	return ret;
> +}
> +
> +/* override demod callbacks for resource locking */
> +static int af9015_af9013_read_status(struct dvb_frontend *fe,
> +	fe_status_t *status)
> +{
> +	int ret;
> +	struct dvb_usb_adapter *adap = fe->dvb->priv;
> +	struct af9015_state *priv = adap->dev->priv;
> +
> +	if (mutex_lock_interruptible(&adap->dev->usb_mutex))
> +		return -EAGAIN;
> +
> +	ret = priv->read_status[adap->id](fe, status);
> +
> +	mutex_unlock(&adap->dev->usb_mutex);
> +
> +	return ret;
> +}
> +
> +/* override demod callbacks for resource locking */
> +static int af9015_af9013_init(struct dvb_frontend *fe)
> +{
> +	int ret;
> +	struct dvb_usb_adapter *adap = fe->dvb->priv;
> +	struct af9015_state *priv = adap->dev->priv;
> +
> +	if (mutex_lock_interruptible(&adap->dev->usb_mutex))
> +		return -EAGAIN;
> +
> +	ret = priv->init[adap->id](fe);
> +
> +	mutex_unlock(&adap->dev->usb_mutex);
> +
> +	return ret;
> +}
> +
> +/* override demod callbacks for resource locking */
> +static int af9015_af9013_sleep(struct dvb_frontend *fe)
> +{
> +	int ret;
> +	struct dvb_usb_adapter *adap = fe->dvb->priv;
> +	struct af9015_state *priv = adap->dev->priv;
> +
> +	if (mutex_lock_interruptible(&adap->dev->usb_mutex))
> +		return -EAGAIN;
> +
> +	ret = priv->init[adap->id](fe);
> +
> +	mutex_unlock(&adap->dev->usb_mutex);
> +
> +	return ret;
> +}
> +
>   static int af9015_af9013_frontend_attach(struct dvb_usb_adapter *adap)
>   {
>   	int ret;
> +	struct af9015_state *state = adap->dev->priv;
>
>   	if (adap->id == 1) {
>   		/* copy firmware to 2nd demodulator */
> @@ -1116,6 +1187,32 @@ static int af9015_af9013_frontend_attach(struct dvb_usb_adapter *adap)
>   	adap->fe_adap[0].fe = dvb_attach(af9013_attach,&af9015_af9013_config[adap->id],
>   		&adap->dev->i2c_adap);
>
> +	/*
> +	 * AF9015 firmware does not like if it gets interrupted by I2C adapter
> +	 * request on some critical phases. During normal operation I2C adapter
> +	 * is used only 2nd demodulator and tuner on dual tuner devices.
> +	 * Override demodulator callbacks and use mutex for limit access to
> +	 * those "critical" paths to keep AF9015 happy.
> +	 * Note: we abuse unused usb_mutex here.
> +	 */
> +	if (adap->fe_adap[0].fe) {
> +		state->set_frontend[adap->id] =
> +			adap->fe_adap[0].fe->ops.set_frontend;
> +		adap->fe_adap[0].fe->ops.set_frontend =
> +			af9015_af9013_set_frontend;
> +
> +		state->read_status[adap->id] =
> +			adap->fe_adap[0].fe->ops.read_status;
> +		adap->fe_adap[0].fe->ops.read_status =
> +			af9015_af9013_read_status;
> +
> +		state->init[adap->id] = adap->fe_adap[0].fe->ops.init;
> +		adap->fe_adap[0].fe->ops.init = af9015_af9013_init;
> +
> +		state->sleep[adap->id] = adap->fe_adap[0].fe->ops.sleep;
> +		adap->fe_adap[0].fe->ops.sleep = af9015_af9013_sleep;
> +	}
> +
>   	return adap->fe_adap[0].fe == NULL ? -ENODEV : 0;
>   }
>
> diff --git a/drivers/media/dvb/dvb-usb/af9015.h b/drivers/media/dvb/dvb-usb/af9015.h
> index 6252ea6..4a12617 100644
> --- a/drivers/media/dvb/dvb-usb/af9015.h
> +++ b/drivers/media/dvb/dvb-usb/af9015.h
> @@ -102,6 +102,13 @@ struct af9015_state {
>   	u8 rc_repeat;
>   	u32 rc_keycode;
>   	u8 rc_last[4];
> +
> +	/* for demod callback override */
> +	int (*set_frontend[2]) (struct dvb_frontend *fe,
> +		struct dvb_frontend_parameters *params);
> +	int (*read_status[2]) (struct dvb_frontend *fe, fe_status_t *status);
> +	int (*init[2]) (struct dvb_frontend *fe);
> +	int (*sleep[2]) (struct dvb_frontend *fe);
>   };
>
>   struct af9015_config {


-- 
http://palosaari.fi/

^ permalink raw reply

* Re: megaraid_sas: Memory corruption with STP commands
From: adam radford @ 2011-11-13 19:18 UTC (permalink / raw)
  To: Michael Chapman; +Cc: linux-scsi
In-Reply-To: <alpine.LFD.2.02.1111132100070.6318@beren.home>

On Sun, Nov 13, 2011 at 2:03 AM, Michael Chapman <mike@very.puzzling.org> wrote:

> +       cmd->frame->hdr.flags &= ~(MFI_FRAME_SGL64 | MFI_FRAME_SENSE64 |
> MFI_FRAME_IEEE);

Michael,

Thanks for your patch.

Some MegaRAID firmware runs in IEEE SGL mode.  We are going to verify
this patch works with older MegaCLI on a controller that supports IEEE
SGL and one that doesn't before we ack it.

-Adam
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* [PATCH] ASoC: davinci: drop SFFSDR_FPGA and CONFIG_SFFSDR_FPGA
From: Paul Bolle @ 2011-11-13 19:15 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai; +Cc: alsa-devel, linux-kernel

Commit 08bd168696 ("ASoC: Add driver for the Lyrtech SFFSDR board")
added a reference to a Kconfig symbol SFFSDR_FPGA. Commit ac37373b64
("ASoC: DaVinci: Fix SFFSDR compilation error.") added a macro
CONFIG_SFFSDR_FPGA. But there's no Kconfig symbol SFFSDR_FPGA and no
define of CONFIG_SFFSDR_FPGA. So the select of SFFSDR_FPGA is a nop. It
can be dropped. The checks for CONFIG_SFFSDR_FPGA can also be dropped.

Signed-off-by: Paul Bolle <pebolle@tiscali.nl>
---
0) Untested, as this needs (build, etc.) testing if we want to be
thorough. But I do not have the hardware and neither do I have the
needed toolchain at hand.

1) Note that there's no file named *plat-sffsdr/sffsdr-fpga.h in the
tree. Neither is there a function or a macro named
sffsdr_fpga_set_codec_fs. So defining CONFIG_SFFSDR_FPGA will never
work.

 sound/soc/davinci/Kconfig          |    1 -
 sound/soc/davinci/davinci-sffsdr.c |    9 ---------
 2 files changed, 0 insertions(+), 10 deletions(-)

diff --git a/sound/soc/davinci/Kconfig b/sound/soc/davinci/Kconfig
index 9e11a14..6a91206 100644
--- a/sound/soc/davinci/Kconfig
+++ b/sound/soc/davinci/Kconfig
@@ -59,7 +59,6 @@ config SND_DAVINCI_SOC_SFFSDR
 	depends on SND_DAVINCI_SOC && MACH_SFFSDR
 	select SND_DAVINCI_SOC_I2S
 	select SND_SOC_PCM3008
-	select SFFSDR_FPGA
 	help
 	  Say Y if you want to add support for SoC audio on
 	  Lyrtech SFFSDR board.
diff --git a/sound/soc/davinci/davinci-sffsdr.c b/sound/soc/davinci/davinci-sffsdr.c
index 0fe558c..d650c2d 100644
--- a/sound/soc/davinci/davinci-sffsdr.c
+++ b/sound/soc/davinci/davinci-sffsdr.c
@@ -24,9 +24,6 @@
 
 #include <asm/dma.h>
 #include <asm/mach-types.h>
-#ifdef CONFIG_SFFSDR_FPGA
-#include <asm/plat-sffsdr/sffsdr-fpga.h>
-#endif
 
 #include <mach/edma.h>
 
@@ -53,13 +50,11 @@ static int sffsdr_hw_params(struct snd_pcm_substream *substream,
 	/* Fsref can be 32000, 44100 or 48000. */
 	fs = params_rate(params);
 
-#ifndef CONFIG_SFFSDR_FPGA
 	/* Without the FPGA module, the Fs is fixed at 44100 Hz */
 	if (fs != 44100) {
 		pr_debug("warning: only 44.1 kHz is supported without SFFSDR FPGA module\n");
 		return -EINVAL;
 	}
-#endif
 
 	/* set cpu DAI configuration */
 	ret = snd_soc_dai_set_fmt(cpu_dai, AUDIO_FORMAT);
@@ -68,11 +63,7 @@ static int sffsdr_hw_params(struct snd_pcm_substream *substream,
 
 	pr_debug("sffsdr_hw_params: rate = %d Hz\n", fs);
 
-#ifndef CONFIG_SFFSDR_FPGA
 	return 0;
-#else
-	return sffsdr_fpga_set_codec_fs(fs);
-#endif
 }
 
 static struct snd_soc_ops sffsdr_ops = {
-- 
1.7.4.4

^ permalink raw reply related

* [GIT PULL FOR 3.2] misc small changes, mostly get/set IF related
From: Antti Palosaari @ 2011-11-13 19:12 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, linux-media; +Cc: Michael Krufky

Moro

These patches are rather small enchantments and should not have any 
visible effect.

mxl5007t change is that register read fix I have mentioned earlier. Reg 
read is used only for checking chip ID and even if ID is not detected 
correctly it will still work. So no functional changes.

Antti

The following changes since commit df5f76dfef9bfaec1ff27d0a60a57a773bf87f0f:

   af9015: limit I2C access to keep FW happy (2011-11-13 03:33:30 +0200)

are available in the git repository at:
   git://linuxtv.org/anttip/media_tree.git af9015

Antti Palosaari (12):
       tda18218: implement .get_if_frequency()
       tda18218: fix 6 MHz default IF frequency
       af9013: use .get_if_frequency() when possible
       mt2060: implement .get_if_frequency()
       qt1010: implement .get_if_frequency()
       tda18212: implement .get_if_frequency()
       tda18212: round IF frequency to close hardware value
       cxd2820r: switch to .get_if_frequency()
       cxd2820r: check bandwidth earlier for DVB-T/T2
       mxl5007t: fix reg read
       ce6230: remove experimental from Kconfig
       ce168: remove experimental from Kconfig

  drivers/media/common/tuners/mt2060.c        |    9 +++-
  drivers/media/common/tuners/mxl5007t.c      |    3 +-
  drivers/media/common/tuners/qt1010.c        |    9 +++-
  drivers/media/common/tuners/tda18212.c      |   17 +++++++-
  drivers/media/common/tuners/tda18218.c      |   18 ++++++-
  drivers/media/common/tuners/tda18218_priv.h |    2 +
  drivers/media/dvb/dvb-usb/Kconfig           |    4 +-
  drivers/media/dvb/dvb-usb/anysee.c          |    7 ---
  drivers/media/dvb/frontends/af9013.c        |   43 ++++--------------
  drivers/media/dvb/frontends/cxd2820r.h      |   13 ------
  drivers/media/dvb/frontends/cxd2820r_c.c    |   13 +++++-
  drivers/media/dvb/frontends/cxd2820r_t.c    |   55 +++++++++++++----------
  drivers/media/dvb/frontends/cxd2820r_t2.c   |   62 
+++++++++++++++------------
  drivers/media/video/em28xx/em28xx-dvb.c     |    7 ---
  14 files changed, 140 insertions(+), 122 deletions(-)


-- 
http://palosaari.fi/

^ permalink raw reply

* Re: Getting FB to work in Console
From: David J Ring Jr @ 2011-11-13 19:11 UTC (permalink / raw)
  To: linux-fbdev
In-Reply-To: <CADO5RbhunU1X7mWwGDbVRc1FSPKBaLudAVav0TMkBoQ_1zp0Mw@mail.gmail.com>

Hello Anatolij,

And when I reboot /dev/fb0 disappears again.

What is very strange to me is that when I run links2 -g the error message 
says that /dev/fb0 does not exist, while if I list the file it says that 
it is there ls /dev/fb0 says the file is there.

Strange to me.

David



^ permalink raw reply

* [PATCH v2] x86: Add amilo-rfkill driver for some Fujitsu-Siemens Amilo laptops
From: Ben Hutchings @ 2011-11-13 19:06 UTC (permalink / raw)
  To: Matthew Garrett
  Cc: platform-driver-x86, linux-wireless, Martin Večeřa,
	Alejandro Vidal Mata, Javier Vidal Mata, Tino Schmidt,
	Johannes Berg, 631664

An rfkill driver based on the fsaa1655g and fsam7440 drivers for
Fujitsu-Siemens Amilo A1655 and M7440 models found at:

http://sourceforge.net/projects/fsaa1655g/
http://sourceforge.net/projects/fsam7440/

This adds DMI matching and replaces the procfs files with rfkill
devices.

Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
Changes from v1:
- Remove module parameter and call to rfkill_init_sw_state()
- Correct Martin's name in copyright banner

 drivers/platform/x86/Kconfig        |    7 ++
 drivers/platform/x86/Makefile       |    1 +
 drivers/platform/x86/amilo-rfkill.c |  180 +++++++++++++++++++++++++++++++++++
 3 files changed, 188 insertions(+), 0 deletions(-)
 create mode 100644 drivers/platform/x86/amilo-rfkill.c

diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
index 7f43cf8..cb2c255 100644
--- a/drivers/platform/x86/Kconfig
+++ b/drivers/platform/x86/Kconfig
@@ -143,6 +143,13 @@ config FUJITSU_LAPTOP_DEBUG
 
 	  If you are not sure, say N here.
 
+config AMILO_RFKILL
+	tristate "Fujitsu-Siemens Amilo rfkill support"
+	depends on RFKILL
+	---help---
+	  This is a driver for enabling wifi on some Fujitsu-Siemens Amilo
+	  laptops.
+
 config TC1100_WMI
 	tristate "HP Compaq TC1100 Tablet WMI Extras (EXPERIMENTAL)"
 	depends on !X86_64
diff --git a/drivers/platform/x86/Makefile b/drivers/platform/x86/Makefile
index 293a320..3acbaad 100644
--- a/drivers/platform/x86/Makefile
+++ b/drivers/platform/x86/Makefile
@@ -17,6 +17,7 @@ obj-$(CONFIG_ACER_WMI)		+= acer-wmi.o
 obj-$(CONFIG_ACERHDF)		+= acerhdf.o
 obj-$(CONFIG_HP_ACCEL)		+= hp_accel.o
 obj-$(CONFIG_HP_WMI)		+= hp-wmi.o
+obj-$(CONFIG_AMILO_RFKILL)	+= amilo-rfkill.o
 obj-$(CONFIG_TC1100_WMI)	+= tc1100-wmi.o
 obj-$(CONFIG_SONY_LAPTOP)	+= sony-laptop.o
 obj-$(CONFIG_IDEAPAD_LAPTOP)	+= ideapad-laptop.o
diff --git a/drivers/platform/x86/amilo-rfkill.c b/drivers/platform/x86/amilo-rfkill.c
new file mode 100644
index 0000000..028d3ec
--- /dev/null
+++ b/drivers/platform/x86/amilo-rfkill.c
@@ -0,0 +1,180 @@
+/*
+ * Support for rfkill on some Fujitsu-Siemens Amilo laptops.
+ * Copyright 2011 Ben Hutchings.
+ *
+ * Based in part on the fsam7440 driver, which is:
+ * Copyright 2005 Alejandro Vidal Mata & Javier Vidal Mata.
+ * and on the fsaa1655g driver, which is:
+ * Copyright 2006 Martin Večeřa.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ */
+
+#include <linux/module.h>
+#include <linux/dmi.h>
+#include <linux/io.h>
+#include <linux/moduleparam.h>
+#include <linux/platform_device.h>
+#include <linux/rfkill.h>
+
+/*
+ * These values were obtained from disassembling and debugging the
+ * PM.exe program installed in the Fujitsu-Siemens AMILO A1655G
+ */
+#define A1655_STATE_PORT	0x64
+#define A1655_COMMAND_PORT	0x64
+#define A1655_DATA_PORT		0x60
+#define A1655_WIFI_COMMAND	0xC5
+#define A1655_WIFI_ON		0x25
+#define A1655_WIFI_OFF		0x45
+
+static int amilo_a1655_rfkill_set_block(void *data, bool blocked)
+{
+	u8 val;
+
+	do
+		val = inb(A1655_STATE_PORT);
+	while ((val & 2) == 2);
+	outb(A1655_WIFI_COMMAND, A1655_COMMAND_PORT);
+	do
+		val = inb(A1655_STATE_PORT);
+	while ((val & 2) == 2);
+	outb(blocked ? A1655_WIFI_OFF : A1655_WIFI_ON, A1655_DATA_PORT);
+
+	return 0;
+}
+
+static const struct rfkill_ops amilo_a1655_rfkill_ops = {
+	.set_block = amilo_a1655_rfkill_set_block
+};
+
+/*
+ * These values were obtained from disassembling the PM.exe program
+ * installed in the Fujitsu-Siemens AMILO M 7440
+ */
+#define M7440_PORT1		0x118f
+#define M7440_PORT2		0x118e
+#define M7440_RADIO_ON1		0x12
+#define M7440_RADIO_ON2		0x80
+#define M7440_RADIO_OFF1	0x10
+#define M7440_RADIO_OFF2	0x00
+
+static int amilo_m7440_rfkill_set_block(void *data, bool blocked)
+{
+	u8 val1 = blocked ? M7440_RADIO_OFF1 : M7440_RADIO_ON1;
+	u8 val2 = blocked ? M7440_RADIO_OFF2 : M7440_RADIO_ON2;
+
+	outb(val1, M7440_PORT1);
+	outb(val2, M7440_PORT2);
+
+	/* Check whether the state has changed correctly */
+	if (inb(M7440_PORT1) != val1 || inb(M7440_PORT2) != val2)
+		return -EIO;
+
+	return 0;
+}
+
+static const struct rfkill_ops amilo_m7440_rfkill_ops = {
+	.set_block = amilo_m7440_rfkill_set_block
+};
+
+static const struct dmi_system_id __devinitdata amilo_rfkill_id_table[] = {
+	{
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
+			DMI_MATCH(DMI_BOARD_NAME, "AMILO A1655"),
+		},
+		.driver_data = (void *)&amilo_a1655_rfkill_ops
+	},
+	{
+		.matches = {
+			DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"),
+			DMI_MATCH(DMI_BOARD_NAME, "AMILO M7440"),
+		},
+		.driver_data = (void *)&amilo_m7440_rfkill_ops
+	},
+	{}
+};
+
+static struct platform_device *amilo_rfkill_pdev;
+static struct rfkill *amilo_rfkill_dev;
+
+static int __devinit amilo_rfkill_probe(struct platform_device *device)
+{
+	const struct dmi_system_id *system_id =
+		dmi_first_match(amilo_rfkill_id_table);
+	int rc;
+
+	amilo_rfkill_dev = rfkill_alloc(KBUILD_MODNAME, &device->dev,
+					RFKILL_TYPE_WLAN,
+					system_id->driver_data, NULL);
+	if (!amilo_rfkill_dev)
+		return -ENOMEM;
+
+	rc = rfkill_register(amilo_rfkill_dev);
+	if (rc)
+		goto fail;
+
+	return 0;
+
+fail:
+	rfkill_destroy(amilo_rfkill_dev);
+	return rc;
+}
+
+static int amilo_rfkill_remove(struct platform_device *device)
+{
+	rfkill_unregister(amilo_rfkill_dev);
+	rfkill_destroy(amilo_rfkill_dev);
+	return 0;
+}
+
+static struct platform_driver amilo_rfkill_driver = {
+	.driver = {
+		.name	= KBUILD_MODNAME,
+		.owner	= THIS_MODULE,
+	},
+	.probe	= amilo_rfkill_probe,
+	.remove	= amilo_rfkill_remove,
+};
+
+static int __init amilo_rfkill_init(void)
+{
+	int rc;
+
+	if (dmi_first_match(amilo_rfkill_id_table) == NULL)
+		return -ENODEV;
+
+	rc = platform_driver_register(&amilo_rfkill_driver);
+	if (rc)
+		return rc;
+
+	amilo_rfkill_pdev = platform_device_register_simple(KBUILD_MODNAME, -1,
+							    NULL, 0);
+	if (IS_ERR(amilo_rfkill_pdev)) {
+		rc = PTR_ERR(amilo_rfkill_pdev);
+		goto fail;
+	}
+
+	return 0;
+
+fail:
+	platform_driver_unregister(&amilo_rfkill_driver);
+	return rc;
+}
+
+static void __exit amilo_rfkill_exit(void)
+{
+	platform_device_unregister(amilo_rfkill_pdev);
+	platform_driver_unregister(&amilo_rfkill_driver);
+}
+
+MODULE_AUTHOR("Ben Hutchings <ben@decadent.org.uk>");
+MODULE_LICENSE("GPL");
+MODULE_DEVICE_TABLE(dmi, amilo_rfkill_id_table);
+
+module_init(amilo_rfkill_init);
+module_exit(amilo_rfkill_exit);
-- 
1.7.7.2



^ permalink raw reply related


This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.