* [PATCH net] cxgb4: Add support to catch bits set in INT_CAUSE5
@ 2020-03-25 11:53 Rahul Kundu
2020-03-25 19:22 ` David Miller
0 siblings, 1 reply; 2+ messages in thread
From: Rahul Kundu @ 2020-03-25 11:53 UTC (permalink / raw)
To: netdev, davem; +Cc: nirranjan, dt, Raju Rangoju
This commit adds support to catch any bits set in SGE_INT_CAUSE5 for Parity Errors.
F_ERR_T_RXCRC flag is used to ignore that particular bit as it is not considered as fatal.
So, we clear out the bit before looking for error.
This patch now read and report separately all three registers(Cause1, Cause2, Cause5).
Also, checks for errors if any.
Signed-off-by: Raju Rangoju <rajur@chelsio.com>
Signed-off-by: Rahul Kundu <rahul.kundu@chelsio.com>
---
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c | 32 +++++++++++++++-----
drivers/net/ethernet/chelsio/cxgb4/t4_regs.h | 6 ++++
2 files changed, 30 insertions(+), 8 deletions(-)
diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
index 844fdcf55118..18379602a58d 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/t4_hw.c
@@ -4480,7 +4480,7 @@ static void tp_intr_handler(struct adapter *adapter)
*/
static void sge_intr_handler(struct adapter *adapter)
{
- u64 v;
+ u32 v = 0, perr;
u32 err;
static const struct intr_info sge_intr_info[] = {
@@ -4515,13 +4515,29 @@ static void sge_intr_handler(struct adapter *adapter)
{ 0 }
};
- v = (u64)t4_read_reg(adapter, SGE_INT_CAUSE1_A) |
- ((u64)t4_read_reg(adapter, SGE_INT_CAUSE2_A) << 32);
- if (v) {
- dev_alert(adapter->pdev_dev, "SGE parity error (%#llx)\n",
- (unsigned long long)v);
- t4_write_reg(adapter, SGE_INT_CAUSE1_A, v);
- t4_write_reg(adapter, SGE_INT_CAUSE2_A, v >> 32);
+ perr = t4_read_reg(adapter, SGE_INT_CAUSE1_A);
+ if (perr) {
+ v |= perr;
+ dev_alert(adapter->pdev_dev, "SGE Cause1 Parity Error %#x\n",
+ perr);
+ }
+
+ perr = t4_read_reg(adapter, SGE_INT_CAUSE2_A);
+ if (perr) {
+ v |= perr;
+ dev_alert(adapter->pdev_dev, "SGE Cause2 Parity Error %#x\n",
+ perr);
+ }
+
+ if (CHELSIO_CHIP_VERSION(adapter->params.chip) >= CHELSIO_T5) {
+ perr = t4_read_reg(adapter, SGE_INT_CAUSE5_A);
+ /* Parity error (CRC) for err_T_RxCRC is trivial, ignore it */
+ perr &= ~ERR_T_RXCRC_F;
+ if (perr) {
+ v |= perr;
+ dev_alert(adapter->pdev_dev,
+ "SGE Cause5 Parity Error %#x\n", perr);
+ }
}
v |= t4_handle_intr_status(adapter, SGE_INT_CAUSE3_A, sge_intr_info);
diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4_regs.h b/drivers/net/ethernet/chelsio/cxgb4/t4_regs.h
index a957a6e4d4c4..bb20e50ddb84 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/t4_regs.h
+++ b/drivers/net/ethernet/chelsio/cxgb4/t4_regs.h
@@ -487,6 +487,12 @@
#define ERROR_QID_M 0x1ffffU
#define ERROR_QID_G(x) (((x) >> ERROR_QID_S) & ERROR_QID_M)
+#define SGE_INT_CAUSE5_A 0x110c
+
+#define ERR_T_RXCRC_S 31
+#define ERR_T_RXCRC_V(x) ((x) << ERR_T_RXCRC_S)
+#define ERR_T_RXCRC_F ERR_T_RXCRC_V(1U)
+
#define HP_INT_THRESH_S 28
#define HP_INT_THRESH_M 0xfU
#define HP_INT_THRESH_V(x) ((x) << HP_INT_THRESH_S)
--
2.23.0.256.g4c86140027f4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH net] cxgb4: Add support to catch bits set in INT_CAUSE5
2020-03-25 11:53 [PATCH net] cxgb4: Add support to catch bits set in INT_CAUSE5 Rahul Kundu
@ 2020-03-25 19:22 ` David Miller
0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-03-25 19:22 UTC (permalink / raw)
To: rahul.kundu; +Cc: netdev, nirranjan, dt, rajur
From: Rahul Kundu <rahul.kundu@chelsio.com>
Date: Wed, 25 Mar 2020 04:53:09 -0700
> This commit adds support to catch any bits set in SGE_INT_CAUSE5 for Parity Errors.
> F_ERR_T_RXCRC flag is used to ignore that particular bit as it is not considered as fatal.
> So, we clear out the bit before looking for error.
> This patch now read and report separately all three registers(Cause1, Cause2, Cause5).
> Also, checks for errors if any.
>
> Signed-off-by: Raju Rangoju <rajur@chelsio.com>
> Signed-off-by: Rahul Kundu <rahul.kundu@chelsio.com>
This doesn't seem like a critical bug fix at all so I applied it to net-next,
thank you.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-03-25 19:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-25 11:53 [PATCH net] cxgb4: Add support to catch bits set in INT_CAUSE5 Rahul Kundu
2020-03-25 19:22 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.