diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-12-06 07:37:11 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-12-06 07:37:11 -0800 |
commit | f1c488a78d9f1a22cdb15648c15e70fd82ed229a (patch) | |
tree | 6d83a51a52cf012a77c3f7b82b020a2374beb917 | |
parent | f30d0a815bb9b8ac1a3ab4d0c333d2379220d91d (diff) | |
download | linux-f1c488a78d9f1a22cdb15648c15e70fd82ed229a.tar.bz2 |
Revert "ath: ath9k: use debugfs_create_devm_seqfile() helper for seq_file entries"
This reverts commit d32394fae95741d733b174ec1446f27765f80233.
It has been reported to cause problems, Jeremiah writes:
On an Acer C720 laptop if a suspend is performed the screen
freezes, the machine locks up, and according to the indicator
lights it does not enter suspend. A hard reset is required to
get it running again.
Reported-by: Jeremiah Mahler <jmmahler@gmail.com>
Cc: Arend van Spriel <arend@broadcom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/net/wireless/ath/ath9k/ahb.c | 1 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/debug.c | 122 | ||||
-rw-r--r-- | drivers/net/wireless/ath/ath9k/pci.c | 1 |
3 files changed, 100 insertions, 24 deletions
diff --git a/drivers/net/wireless/ath/ath9k/ahb.c b/drivers/net/wireless/ath/ath9k/ahb.c index 750a13045458..e000c4c27881 100644 --- a/drivers/net/wireless/ath/ath9k/ahb.c +++ b/drivers/net/wireless/ath/ath9k/ahb.c @@ -126,7 +126,6 @@ static int ath_ahb_probe(struct platform_device *pdev) sc = hw->priv; sc->hw = hw; sc->dev = &pdev->dev; - dev_set_drvdata(sc->dev, sc); sc->mem = mem; sc->irq = irq; diff --git a/drivers/net/wireless/ath/ath9k/debug.c b/drivers/net/wireless/ath/ath9k/debug.c index a1f1614a05c2..e7b709f03b29 100644 --- a/drivers/net/wireless/ath/ath9k/debug.c +++ b/drivers/net/wireless/ath/ath9k/debug.c @@ -403,7 +403,7 @@ static const struct file_operations fops_antenna_diversity = { static int read_file_dma(struct seq_file *file, void *data) { - struct ath_softc *sc = dev_get_drvdata(file->private); + struct ath_softc *sc = file->private; struct ath_hw *ah = sc->sc_ah; u32 val[ATH9K_NUM_DMA_DEBUG_REGS]; int i, qcuOffset = 0, dcuOffset = 0; @@ -470,6 +470,20 @@ static int read_file_dma(struct seq_file *file, void *data) return 0; } +static int open_file_dma(struct inode *inode, struct file *f) +{ + return single_open(f, read_file_dma, inode->i_private); +} + +static const struct file_operations fops_dma = { + .open = open_file_dma, + .read = seq_read, + .owner = THIS_MODULE, + .llseek = seq_lseek, + .release = single_release, +}; + + void ath_debug_stat_interrupt(struct ath_softc *sc, enum ath9k_int status) { if (status) @@ -525,7 +539,7 @@ void ath_debug_stat_interrupt(struct ath_softc *sc, enum ath9k_int status) static int read_file_interrupt(struct seq_file *file, void *data) { - struct ath_softc *sc = dev_get_drvdata(file->private); + struct ath_softc *sc = file->private; #define PR_IS(a, s) \ do { \ @@ -586,9 +600,22 @@ static int read_file_interrupt(struct seq_file *file, void *data) return 0; } +static int open_file_interrupt(struct inode *inode, struct file *f) +{ + return single_open(f, read_file_interrupt, inode->i_private); +} + +static const struct file_operations fops_interrupt = { + .read = seq_read, + .open = open_file_interrupt, + .owner = THIS_MODULE, + .llseek = seq_lseek, + .release = single_release, +}; + static int read_file_xmit(struct seq_file *file, void *data) { - struct ath_softc *sc = dev_get_drvdata(file->private); + struct ath_softc *sc = file->private; seq_printf(file, "%30s %10s%10s%10s\n\n", "BE", "BK", "VI", "VO"); @@ -634,7 +661,7 @@ static void print_queue(struct ath_softc *sc, struct ath_txq *txq, static int read_file_queues(struct seq_file *file, void *data) { - struct ath_softc *sc = dev_get_drvdata(file->private); + struct ath_softc *sc = file->private; struct ath_txq *txq; int i; static const char *qname[4] = { @@ -655,7 +682,7 @@ static int read_file_queues(struct seq_file *file, void *data) static int read_file_misc(struct seq_file *file, void *data) { - struct ath_softc *sc = dev_get_drvdata(file->private); + struct ath_softc *sc = file->private; struct ath_common *common = ath9k_hw_common(sc->sc_ah); struct ath9k_vif_iter_data iter_data; struct ath_chanctx *ctx; @@ -745,7 +772,7 @@ static int read_file_misc(struct seq_file *file, void *data) static int read_file_reset(struct seq_file *file, void *data) { - struct ath_softc *sc = dev_get_drvdata(file->private); + struct ath_softc *sc = file->private; seq_printf(file, "%17s: %2d\n", "Baseband Hang", sc->debug.stats.reset[RESET_TYPE_BB_HANG]); @@ -806,6 +833,58 @@ void ath_debug_stat_tx(struct ath_softc *sc, struct ath_buf *bf, TX_STAT_INC(qnum, delim_underrun); } +static int open_file_xmit(struct inode *inode, struct file *f) +{ + return single_open(f, read_file_xmit, inode->i_private); +} + +static const struct file_operations fops_xmit = { + .read = seq_read, + .open = open_file_xmit, + .owner = THIS_MODULE, + .llseek = seq_lseek, + .release = single_release, +}; + +static int open_file_queues(struct inode *inode, struct file *f) +{ + return single_open(f, read_file_queues, inode->i_private); +} + +static const struct file_operations fops_queues = { + .read = seq_read, + .open = open_file_queues, + .owner = THIS_MODULE, + .llseek = seq_lseek, + .release = single_release, +}; + +static int open_file_misc(struct inode *inode, struct file *f) +{ + return single_open(f, read_file_misc, inode->i_private); +} + +static const struct file_operations fops_misc = { + .read = seq_read, + .open = open_file_misc, + .owner = THIS_MODULE, + .llseek = seq_lseek, + .release = single_release, +}; + +static int open_file_reset(struct inode *inode, struct file *f) +{ + return single_open(f, read_file_reset, inode->i_private); +} + +static const struct file_operations fops_reset = { + .read = seq_read, + .open = open_file_reset, + .owner = THIS_MODULE, + .llseek = seq_lseek, + .release = single_release, +}; + void ath_debug_stat_rx(struct ath_softc *sc, struct ath_rx_status *rs) { ath9k_cmn_debug_stat_rx(&sc->debug.stats.rxstats, rs); @@ -935,7 +1014,7 @@ static const struct file_operations fops_regdump = { static int read_file_dump_nfcal(struct seq_file *file, void *data) { - struct ath_softc *sc = dev_get_drvdata(file->private); + struct ath_softc *sc = file->private; struct ath_hw *ah = sc->sc_ah; struct ath9k_nfcal_hist *h = sc->cur_chan->caldata.nfCalHist; struct ath_common *common = ath9k_hw_common(ah); @@ -1177,14 +1256,14 @@ int ath9k_init_debug(struct ath_hw *ah) ath9k_tx99_init_debug(sc); ath9k_spectral_init_debug(sc); - debugfs_create_devm_seqfile(sc->dev, "dma", sc->debug.debugfs_phy, - read_file_dma); - debugfs_create_devm_seqfile(sc->dev, "interrupt", sc->debug.debugfs_phy, - read_file_interrupt); - debugfs_create_devm_seqfile(sc->dev, "xmit", sc->debug.debugfs_phy, - read_file_xmit); - debugfs_create_devm_seqfile(sc->dev, "queues", sc->debug.debugfs_phy, - read_file_queues); + debugfs_create_file("dma", S_IRUSR, sc->debug.debugfs_phy, sc, + &fops_dma); + debugfs_create_file("interrupt", S_IRUSR, sc->debug.debugfs_phy, sc, + &fops_interrupt); + debugfs_create_file("xmit", S_IRUSR, sc->debug.debugfs_phy, sc, + &fops_xmit); + debugfs_create_file("queues", S_IRUSR, sc->debug.debugfs_phy, sc, + &fops_queues); debugfs_create_u32("qlen_bk", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy, &sc->tx.txq_max_pending[IEEE80211_AC_BK]); debugfs_create_u32("qlen_be", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy, @@ -1193,10 +1272,10 @@ int ath9k_init_debug(struct ath_hw *ah) &sc->tx.txq_max_pending[IEEE80211_AC_VI]); debugfs_create_u32("qlen_vo", S_IRUSR | S_IWUSR, sc->debug.debugfs_phy, &sc->tx.txq_max_pending[IEEE80211_AC_VO]); - debugfs_create_devm_seqfile(sc->dev, "misc", sc->debug.debugfs_phy, - read_file_misc); - debugfs_create_devm_seqfile(sc->dev, "reset", sc->debug.debugfs_phy, - read_file_reset); + debugfs_create_file("misc", S_IRUSR, sc->debug.debugfs_phy, sc, + &fops_misc); + debugfs_create_file("reset", S_IRUSR, sc->debug.debugfs_phy, sc, + &fops_reset); ath9k_cmn_debug_recv(sc->debug.debugfs_phy, &sc->debug.stats.rxstats); ath9k_cmn_debug_phy_err(sc->debug.debugfs_phy, &sc->debug.stats.rxstats); @@ -1218,9 +1297,8 @@ int ath9k_init_debug(struct ath_hw *ah) &ah->config.cwm_ignore_extcca); debugfs_create_file("regdump", S_IRUSR, sc->debug.debugfs_phy, sc, &fops_regdump); - debugfs_create_devm_seqfile(sc->dev, "dump_nfcal", - sc->debug.debugfs_phy, - read_file_dump_nfcal); + debugfs_create_file("dump_nfcal", S_IRUSR, sc->debug.debugfs_phy, sc, + &fops_dump_nfcal); ath9k_cmn_debug_base_eeprom(sc->debug.debugfs_phy, sc->sc_ah); ath9k_cmn_debug_modal_eeprom(sc->debug.debugfs_phy, sc->sc_ah); diff --git a/drivers/net/wireless/ath/ath9k/pci.c b/drivers/net/wireless/ath/ath9k/pci.c index 90c9e3cbf958..c018dea0b2e8 100644 --- a/drivers/net/wireless/ath/ath9k/pci.c +++ b/drivers/net/wireless/ath/ath9k/pci.c @@ -856,7 +856,6 @@ static int ath_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) sc = hw->priv; sc->hw = hw; sc->dev = &pdev->dev; - dev_set_drvdata(sc->dev, sc); sc->mem = pcim_iomap_table(pdev)[0]; sc->driver_data = id->driver_data; |