aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/ntb/hw/idt/ntb_hw_idt.c41
-rw-r--r--drivers/ntb/hw/idt/ntb_hw_idt.h5
2 files changed, 3 insertions, 43 deletions
diff --git a/drivers/ntb/hw/idt/ntb_hw_idt.c b/drivers/ntb/hw/idt/ntb_hw_idt.c
index 19425a2c60cd..c4594a708b48 100644
--- a/drivers/ntb/hw/idt/ntb_hw_idt.c
+++ b/drivers/ntb/hw/idt/ntb_hw_idt.c
@@ -2075,38 +2075,6 @@ static struct attribute *idt_temp_attrs[] = {
2075ATTRIBUTE_GROUPS(idt_temp); 2075ATTRIBUTE_GROUPS(idt_temp);
2076 2076
2077/* 2077/*
2078 * idt_temp_isr() - temperature sensor alarm events ISR
2079 * @ndev: IDT NTB hardware driver descriptor
2080 * @ntint_sts: NT-function interrupt status
2081 *
2082 * It handles events of temperature crossing alarm thresholds. Since reading
2083 * of TMPALARM register clears it up, the function doesn't analyze the
2084 * read value, instead the current temperature value just warningly printed to
2085 * log.
2086 * The method is called from PCIe ISR bottom-half routine.
2087 */
2088static void idt_temp_isr(struct idt_ntb_dev *ndev, u32 ntint_sts)
2089{
2090 unsigned long mdeg;
2091
2092 /* Read the current temperature value */
2093 idt_read_temp(ndev, IDT_TEMP_CUR, &mdeg);
2094
2095 /* Read the temperature alarm to clean the alarm status out */
2096 /*(void)idt_sw_read(ndev, IDT_SW_TMPALARM);*/
2097
2098 /* Clean the corresponding interrupt bit */
2099 idt_nt_write(ndev, IDT_NT_NTINTSTS, IDT_NTINTSTS_TMPSENSOR);
2100
2101 dev_dbg(&ndev->ntb.pdev->dev,
2102 "Temp sensor IRQ detected %#08x", ntint_sts);
2103
2104 /* Print temperature value to log */
2105 dev_warn(&ndev->ntb.pdev->dev, "Temperature %hhd.%hhuC",
2106 idt_get_deg(mdeg), idt_get_deg_frac(mdeg));
2107}
2108
2109/*
2110 * idt_init_temp() - initialize temperature sensor interface 2078 * idt_init_temp() - initialize temperature sensor interface
2111 * @ndev: IDT NTB hardware driver descriptor 2079 * @ndev: IDT NTB hardware driver descriptor
2112 * 2080 *
@@ -2188,7 +2156,7 @@ static int idt_init_isr(struct idt_ntb_dev *ndev)
2188 goto err_free_vectors; 2156 goto err_free_vectors;
2189 } 2157 }
2190 2158
2191 /* Unmask Message/Doorbell/SE/Temperature interrupts */ 2159 /* Unmask Message/Doorbell/SE interrupts */
2192 ntint_mask = idt_nt_read(ndev, IDT_NT_NTINTMSK) & ~IDT_NTINTMSK_ALL; 2160 ntint_mask = idt_nt_read(ndev, IDT_NT_NTINTMSK) & ~IDT_NTINTMSK_ALL;
2193 idt_nt_write(ndev, IDT_NT_NTINTMSK, ntint_mask); 2161 idt_nt_write(ndev, IDT_NT_NTINTMSK, ntint_mask);
2194 2162
@@ -2203,7 +2171,6 @@ err_free_vectors:
2203 return ret; 2171 return ret;
2204} 2172}
2205 2173
2206
2207/* 2174/*
2208 * idt_deinit_ist() - deinitialize PCIe interrupt handler 2175 * idt_deinit_ist() - deinitialize PCIe interrupt handler
2209 * @ndev: IDT NTB hardware driver descriptor 2176 * @ndev: IDT NTB hardware driver descriptor
@@ -2264,12 +2231,6 @@ static irqreturn_t idt_thread_isr(int irq, void *devid)
2264 handled = true; 2231 handled = true;
2265 } 2232 }
2266 2233
2267 /* Handle temperature sensor interrupt */
2268 if (ntint_sts & IDT_NTINTSTS_TMPSENSOR) {
2269 idt_temp_isr(ndev, ntint_sts);
2270 handled = true;
2271 }
2272
2273 dev_dbg(&ndev->ntb.pdev->dev, "IDT IRQs 0x%08x handled", ntint_sts); 2234 dev_dbg(&ndev->ntb.pdev->dev, "IDT IRQs 0x%08x handled", ntint_sts);
2274 2235
2275 return handled ? IRQ_HANDLED : IRQ_NONE; 2236 return handled ? IRQ_HANDLED : IRQ_NONE;
diff --git a/drivers/ntb/hw/idt/ntb_hw_idt.h b/drivers/ntb/hw/idt/ntb_hw_idt.h
index 032f81cb4d44..3517cd2e2baa 100644
--- a/drivers/ntb/hw/idt/ntb_hw_idt.h
+++ b/drivers/ntb/hw/idt/ntb_hw_idt.h
@@ -688,15 +688,14 @@
688 * @IDT_NTINTMSK_DBELL: Doorbell interrupt mask bit 688 * @IDT_NTINTMSK_DBELL: Doorbell interrupt mask bit
689 * @IDT_NTINTMSK_SEVENT: Switch Event interrupt mask bit 689 * @IDT_NTINTMSK_SEVENT: Switch Event interrupt mask bit
690 * @IDT_NTINTMSK_TMPSENSOR: Temperature sensor interrupt mask bit 690 * @IDT_NTINTMSK_TMPSENSOR: Temperature sensor interrupt mask bit
691 * @IDT_NTINTMSK_ALL: All the useful interrupts mask 691 * @IDT_NTINTMSK_ALL: NTB-related interrupts mask
692 */ 692 */
693#define IDT_NTINTMSK_MSG 0x00000001U 693#define IDT_NTINTMSK_MSG 0x00000001U
694#define IDT_NTINTMSK_DBELL 0x00000002U 694#define IDT_NTINTMSK_DBELL 0x00000002U
695#define IDT_NTINTMSK_SEVENT 0x00000008U 695#define IDT_NTINTMSK_SEVENT 0x00000008U
696#define IDT_NTINTMSK_TMPSENSOR 0x00000080U 696#define IDT_NTINTMSK_TMPSENSOR 0x00000080U
697#define IDT_NTINTMSK_ALL \ 697#define IDT_NTINTMSK_ALL \
698 (IDT_NTINTMSK_MSG | IDT_NTINTMSK_DBELL | \ 698 (IDT_NTINTMSK_MSG | IDT_NTINTMSK_DBELL | IDT_NTINTMSK_SEVENT)
699 IDT_NTINTMSK_SEVENT | IDT_NTINTMSK_TMPSENSOR)
700 699
701/* 700/*
702 * NTGSIGNAL register fields related constants 701 * NTGSIGNAL register fields related constants