hc
2023-12-11 6778948f9de86c3cfaf36725a7c87dcff9ba247f
kernel/drivers/net/ethernet/chelsio/cxgb/subr.c
....@@ -170,7 +170,7 @@
170170 t1_link_negotiated(adapter, port_id, link_ok, speed, duplex, fc);
171171 }
172172
173
-static bool t1_pci_intr_handler(adapter_t *adapter)
173
+static int t1_pci_intr_handler(adapter_t *adapter)
174174 {
175175 u32 pcix_cause;
176176
....@@ -179,13 +179,9 @@
179179 if (pcix_cause) {
180180 pci_write_config_dword(adapter->pdev, A_PCICFG_INTR_CAUSE,
181181 pcix_cause);
182
- /* PCI errors are fatal */
183
- t1_interrupts_disable(adapter);
184
- adapter->pending_thread_intr |= F_PL_INTR_SGE_ERR;
185
- pr_alert("%s: PCI error encountered.\n", adapter->name);
186
- return true;
182
+ t1_fatal_err(adapter); /* PCI errors are fatal */
187183 }
188
- return false;
184
+ return 0;
189185 }
190186
191187 #ifdef CONFIG_CHELSIO_T1_1G
....@@ -214,16 +210,13 @@
214210 /*
215211 * Slow path interrupt handler for FPGAs.
216212 */
217
-static irqreturn_t fpga_slow_intr(adapter_t *adapter)
213
+static int fpga_slow_intr(adapter_t *adapter)
218214 {
219215 u32 cause = readl(adapter->regs + A_PL_CAUSE);
220
- irqreturn_t ret = IRQ_NONE;
221216
222217 cause &= ~F_PL_INTR_SGE_DATA;
223
- if (cause & F_PL_INTR_SGE_ERR) {
224
- if (t1_sge_intr_error_handler(adapter->sge))
225
- ret = IRQ_WAKE_THREAD;
226
- }
218
+ if (cause & F_PL_INTR_SGE_ERR)
219
+ t1_sge_intr_error_handler(adapter->sge);
227220
228221 if (cause & FPGA_PCIX_INTERRUPT_GMAC)
229222 fpga_phy_intr_handler(adapter);
....@@ -238,19 +231,14 @@
238231 /* Clear TP interrupt */
239232 writel(tp_cause, adapter->regs + FPGA_TP_ADDR_INTERRUPT_CAUSE);
240233 }
241
- if (cause & FPGA_PCIX_INTERRUPT_PCIX) {
242
- if (t1_pci_intr_handler(adapter))
243
- ret = IRQ_WAKE_THREAD;
244
- }
234
+ if (cause & FPGA_PCIX_INTERRUPT_PCIX)
235
+ t1_pci_intr_handler(adapter);
245236
246237 /* Clear the interrupts just processed. */
247238 if (cause)
248239 writel(cause, adapter->regs + A_PL_CAUSE);
249240
250
- if (ret != IRQ_NONE)
251
- return ret;
252
-
253
- return cause == 0 ? IRQ_NONE : IRQ_HANDLED;
241
+ return cause != 0;
254242 }
255243 #endif
256244
....@@ -854,45 +842,31 @@
854842 /*
855843 * Slow path interrupt handler for ASICs.
856844 */
857
-static irqreturn_t asic_slow_intr(adapter_t *adapter)
845
+static int asic_slow_intr(adapter_t *adapter)
858846 {
859847 u32 cause = readl(adapter->regs + A_PL_CAUSE);
860
- irqreturn_t ret = IRQ_HANDLED;
861848
862849 cause &= adapter->slow_intr_mask;
863850 if (!cause)
864
- return IRQ_NONE;
865
- if (cause & F_PL_INTR_SGE_ERR) {
866
- if (t1_sge_intr_error_handler(adapter->sge))
867
- ret = IRQ_WAKE_THREAD;
868
- }
851
+ return 0;
852
+ if (cause & F_PL_INTR_SGE_ERR)
853
+ t1_sge_intr_error_handler(adapter->sge);
869854 if (cause & F_PL_INTR_TP)
870855 t1_tp_intr_handler(adapter->tp);
871856 if (cause & F_PL_INTR_ESPI)
872857 t1_espi_intr_handler(adapter->espi);
873
- if (cause & F_PL_INTR_PCIX) {
874
- if (t1_pci_intr_handler(adapter))
875
- ret = IRQ_WAKE_THREAD;
876
- }
877
- if (cause & F_PL_INTR_EXT) {
878
- /* Wake the threaded interrupt to handle external interrupts as
879
- * we require a process context. We disable EXT interrupts in
880
- * the interim and let the thread reenable them when it's done.
881
- */
882
- adapter->pending_thread_intr |= F_PL_INTR_EXT;
883
- adapter->slow_intr_mask &= ~F_PL_INTR_EXT;
884
- writel(adapter->slow_intr_mask | F_PL_INTR_SGE_DATA,
885
- adapter->regs + A_PL_ENABLE);
886
- ret = IRQ_WAKE_THREAD;
887
- }
858
+ if (cause & F_PL_INTR_PCIX)
859
+ t1_pci_intr_handler(adapter);
860
+ if (cause & F_PL_INTR_EXT)
861
+ t1_elmer0_ext_intr(adapter);
888862
889863 /* Clear the interrupts just processed. */
890864 writel(cause, adapter->regs + A_PL_CAUSE);
891865 readl(adapter->regs + A_PL_CAUSE); /* flush writes */
892
- return ret;
866
+ return 1;
893867 }
894868
895
-irqreturn_t t1_slow_intr_handler(adapter_t *adapter)
869
+int t1_slow_intr_handler(adapter_t *adapter)
896870 {
897871 #ifdef CONFIG_CHELSIO_T1_1G
898872 if (!t1_is_asic(adapter))