Re: [PATCH] 3.12.0-rt1: net: iwlwifi request only a threaded handler for interrupts

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

 



On Tue, 12 Nov 2013 13:16:59 -0600
Clark Williams <williams@xxxxxxxxxx> wrote:

> Sebastian,
> 
> I needed this for my laptop on 3.12, so tweaked it to apply properly. 
> 
> Clark
>

So of course I sent the wrong patch:

commit 49d487614d56bc10969dd0dcbce709825fc06d0e
Author: Clark Williams <clark.williams@xxxxxxxxx>
Date:   Tue Nov 12 12:17:07 2013 -0600

    net: iwlwifi: request only a threaded handler for interrupts
    
    On RT the trans_pcie->irq_lock lock is converted into a sleeping lock
    and can't be used in primary irq handler. The lock is used in mutliple
    places which means turning it into a raw lock could increase the
    latency of the system.
    For now both handlers are moved into the thread.
    
    Signed-off-by: Sebastian Andrzej Siewior <bigeasy@xxxxxxxxxxxxx>
    Signed-off-by: Clark Williams <clark.williams@xxxxxxxxx>

diff --git a/drivers/net/wireless/iwlwifi/pcie/trans.c b/drivers/net/wireless/iwlwifi/pcie/trans.c
index c3f904d..60df2c1 100644
--- a/drivers/net/wireless/iwlwifi/pcie/trans.c
+++ b/drivers/net/wireless/iwlwifi/pcie/trans.c
@@ -1375,6 +1375,20 @@ static const struct iwl_trans_ops trans_ops_pcie = {
        .set_bits_mask = iwl_trans_pcie_set_bits_mask,
 };
 
+#ifdef CONFIG_PREEMPT_RT_BASE
+static irqreturn_t iwl_rt_irq_handler(int irq, void *dev_id)
+{
+       irqreturn_t ret;
+
+       local_bh_disable();
+       ret = iwl_pcie_isr_ict(irq, dev_id);
+       local_bh_enable();
+       if (ret == IRQ_WAKE_THREAD)
+               ret = iwl_pcie_irq_handler(irq, dev_id);
+       return ret;
+}
+#endif
+
 struct iwl_trans *iwl_trans_pcie_alloc(struct pci_dev *pdev,
                                       const struct pci_device_id *ent,
                                       const struct iwl_cfg *cfg)
@@ -1493,9 +1507,15 @@ struct iwl_trans *iwl_trans_pcie_alloc(struct pci_dev *pdev,
        if (iwl_pcie_alloc_ict(trans))
                goto out_free_cmd_pool;
 
+#ifdef CONFIG_PREEMPT_RT_BASE
+       err = request_threaded_irq(pdev->irq, NULL, iwl_rt_irq_handler,
+                                  IRQF_SHARED | IRQF_ONESHOT, 
+                                  DRV_NAME, trans);
+#else
        err = request_threaded_irq(pdev->irq, iwl_pcie_isr_ict,
                                   iwl_pcie_irq_handler,
                                   IRQF_SHARED, DRV_NAME, trans);
+#endif
        if (err) {
                IWL_ERR(trans, "Error allocating IRQ %d\n", pdev->irq);
                goto out_free_ict;

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [RT Stable]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux