Search Linux Wireless

Re: [PATCH v2] ath9k: Gather and report IRQ sync_cause errors.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2012-04-03 at 21:20 -0700, greearb@xxxxxxxxxxxxxxx wrote:
> From: Ben Greear <greearb@xxxxxxxxxxxxxxx>
> 
> Report all defined sync_cause errors in debugfs
> to aid with debugging.

just trivia:

> diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c
[]
> @@ -385,63 +385,130 @@ static ssize_t read_file_interrupt(struct file *file, char __user *user_buf,
>  				   size_t count, loff_t *ppos)
>  {
>  	struct ath_softc *sc = file->private_data;
[]
>  	if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA) {
[]
> +		len += snprintf(buf + len, mxlen - len,
> +			"%21s: %10u\n", "RXLP", sc->debug.stats.istats.rxlp);

Alignment is overrated.

I wouldn't change any of the original block
though perhaps changing the sc pointer to an
istats pointer so these dereferences become
similar to istats->rxlp;

[]

> +	len += snprintf(buf + len, mxlen - len,
> +			"SYNC_CAUSE stats:\n");

But _might_ add the %21s here for the new entries.

> +	len += snprintf(buf + len, mxlen - len,
> +			"%21s: %10u\n", "Sync-All",
> +			sc->debug.stats.istats.sync_cause_all);

[]

> diff --git a/drivers/net/wireless/ath/ath9k/hw.c b/drivers/net/wireless/ath/ath9k/hw.c
[]
> @@ -82,6 +84,53 @@ static void ath9k_hw_ani_cache_ini_regs(struct ath_hw *ah)
>  /* Helper Functions */
>  /********************/
>  
> +#ifdef CONFIG_ATH9K_DEBUGFS
> +
> +void ath9k_debug_sync_cause(struct ath_common *common, u32 sync_cause)
> +{
> +	struct ath_softc *sc = common->priv;
> +	if (sync_cause)
> +		sc->debug.stats.istats.sync_cause_all++;
> +	if (sync_cause & AR_INTR_SYNC_RTC_IRQ)
> +		sc->debug.stats.istats.sync_rtc_irq++;

And nicer here to use a pointer to istats too.

		istats->sync_rtc_irq++;

> +	if (sync_cause & AR_INTR_SYNC_MAC_IRQ)
> +		sc->debug.stats.istats.sync_mac_irq++;

		istats->sync_mac_irq++;

etc.

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


[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux