ipmi: NPCM7xx KCS BMC: enable interrupt to the host
Subsystems (2)
[email protected]
maintainerv2 cover ipmi: NPCM7xx KCS BMC: enable interrupt to the host
From: Avi Fishman <[email protected]>
Changes since version 1:
Apply code style comments from "Wang, Haiyue" <[email protected]>
Original kcs_bmc_npcm7xx.c was missing enabling to send interrupt to the host on writes to output buffer.
This patch fixes it by setting the bits that enables the generation of IRQn events by hardware control based on the status of the OBF flag.
Avi Fishman (1):
ipmi: NPCM7xx KCS BMC: enable interrupt to the host
drivers/char/ipmi/kcs_bmc_npcm7xx.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-)
Signature · 1 line
2.14.1
[email protected]
maintainerPATCH v2 1/1 ipmi: NPCM7xx KCS BMC: enable interrupt to the host
From: Avi Fishman <[email protected]>
Original kcs_bmc_npcm7xx.c was missing enabling to send interrupt to the host on writes to output buffer.
This patch fixes it by setting the bits that enables the generation of IRQn events by hardware control based on the status of the OBF flag.
--- drivers/char/ipmi/kcs_bmc_npcm7xx.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-)
drivers/char/ipmi/kcs_bmc_npcm7xx.c +14 -3
@@ -39,6 +39,12 @@#define KCS3CTL 0x3C#define KCS_CTL_IBFIE BIT(0) +#define KCS1IE 0x1C +#define KCS2IE 0x2E +#define KCS3IE 0x40 +#define KCS_IE_IRQE BIT(0) +#define KCS_IE_HIRQE BIT(3) +/* * 7.2.4 Core KCS Registers * Registers in this module are 8 bits. An 8-bit register must be accessed
@@ -48,12 +54,14 @@* dob: KCS Channel n Data Out Buffer Register (KCSnDO). * dib: KCS Channel n Data In Buffer Register (KCSnDI). * ctl: KCS Channel n Control Register (KCSnCTL). +* ie : KCS Channel n Interrupt Enable Register (KCSnIE). */ struct npcm7xx_kcs_reg {u32 sts;u32 dob;u32 dib;u32 ctl; +u32 ie; };struct npcm7xx_kcs_bmc {
@@ -63,9 +71,9 @@ struct npcm7xx_kcs_bmc { };static const struct npcm7xx_kcs_reg npcm7xx_kcs_reg_tbl[KCS_CHANNEL_MAX ] = { - { .sts =KCS1ST , .dob =KCS1DO , .dib =KCS1DI , .ctl =KCS1CTL }, - { .sts =KCS2ST , .dob =KCS2DO , .dib =KCS2DI , .ctl =KCS2CTL }, - { .sts =KCS3ST , .dob =KCS3DO , .dib =KCS3DI , .ctl =KCS3CTL }, + { .sts =KCS1ST , .dob =KCS1DO , .dib =KCS1DI , .ctl =KCS1CTL , .ie =KCS1IE }, + { .sts =KCS2ST , .dob =KCS2DO , .dib =KCS2DI , .ctl =KCS2CTL , .ie =KCS2IE }, + { .sts =KCS3ST , .dob =KCS3DO , .dib =KCS3DI , .ctl =KCS3CTL , .ie =KCS3IE }, };static u8 npcm7xx_kcs_inb (struct kcs_bmc *kcs_bmc,u32 reg)
@@ -95,6 +103,9 @@ static void npcm7xx_kcs_enable_channel(struct kcs_bmc *kcs_bmc, bool enable)regmap_update_bits (priv->map, priv->reg->ctl,KCS_CTL_IBFIE , enable ?KCS_CTL_IBFIE :0 ); + +regmap_update_bits (priv->map, priv->reg->ie,KCS_IE_IRQE |KCS_IE_HIRQE , + enable ?KCS_IE_IRQE |KCS_IE_HIRQE :0 ); }static irqreturn_t npcm7xx_kcs_irq (int irq,void *arg)
Signature · 1 line
2.14.1
Quoted 6 lines · On 05/21/2018 07:39 AM, [email protected] wrote:
From: Avi Fishman <[email protected]>
Original
kcs_bmc_npcm7xx.cwas missing enabling to send interrupt to the host on writes to output buffer.
This patch fixes it by setting the bits that enables the generation of IRQn events by hardware control based on the status of the OBF flag.
This look ok, I've added it to my 4.19 queue.
-corey
Quoted 61 lines
Signed-off-by Avi Fishman <[email protected]>Reviewed-by Haiyue Wang <[email protected]>--- drivers/char/ipmi/kcs_bmc_npcm7xx.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-)drivers/char/ipmi/kcs_bmc_npcm7xx.c +14
-3@@ -39,6 +39,12 @@#define KCS3CTL 0x3C#define KCS_CTL_IBFIE BIT(0) +#define KCS1IE 0x1C +#define KCS2IE 0x2E +#define KCS3IE 0x40 +#define KCS_IE_IRQE BIT(0) +#define KCS_IE_HIRQE BIT(3) +/* * 7.2.4 Core KCS Registers * Registers in this module are 8 bits. An 8-bit register must be accessed @@ -48,12 +54,14 @@* dob: KCS Channel n Data Out Buffer Register (KCSnDO). * dib: KCS Channel n Data In Buffer Register (KCSnDI). * ctl: KCS Channel n Control Register (KCSnCTL). +* ie : KCS Channel n Interrupt Enable Register (KCSnIE). */ struct npcm7xx_kcs_reg {u32 sts;u32 dob;u32 dib;u32 ctl; +u32 ie; };struct npcm7xx_kcs_bmc {@@ -63,9 +71,9 @@ struct npcm7xx_kcs_bmc { };static const struct npcm7xx_kcs_reg npcm7xx_kcs_reg_tbl[KCS_CHANNEL_MAX ] = { - { .sts =KCS1ST , .dob =KCS1DO , .dib =KCS1DI , .ctl =KCS1CTL }, - { .sts =KCS2ST , .dob =KCS2DO , .dib =KCS2DI , .ctl =KCS2CTL }, - { .sts =KCS3ST , .dob =KCS3DO , .dib =KCS3DI , .ctl =KCS3CTL }, + { .sts =KCS1ST , .dob =KCS1DO , .dib =KCS1DI , .ctl =KCS1CTL , .ie =KCS1IE }, + { .sts =KCS2ST , .dob =KCS2DO , .dib =KCS2DI , .ctl =KCS2CTL , .ie =KCS2IE }, + { .sts =KCS3ST , .dob =KCS3DO , .dib =KCS3DI , .ctl =KCS3CTL , .ie =KCS3IE }, };static u8 npcm7xx_kcs_inb (struct kcs_bmc *kcs_bmc,u32 reg)@@ -95,6 +103,9 @@ static void npcm7xx_kcs_enable_channel(struct kcs_bmc *kcs_bmc, bool enable)regmap_update_bits (priv->map, priv->reg->ctl,KCS_CTL_IBFIE , enable ?KCS_CTL_IBFIE :0 ); + +regmap_update_bits (priv->map, priv->reg->ie,KCS_IE_IRQE |KCS_IE_HIRQE , + enable ?KCS_IE_IRQE |KCS_IE_HIRQE :0 ); }static irqreturn_t npcm7xx_kcs_irq (int irq,void *arg)
Avi Fishman
maintainerQuoted 11 lines · Corey Minyard
Quoted 7 lines · On 05/21/2018 07:39 AM, [email protected] wrote:
From: Avi Fishman <[email protected]>
Original
kcs_bmc_npcm7xx.cwas missing enabling to send interrupt to the host on writes to output buffer.
This patch fixes it by setting the bits that enables the generation of IRQn events by hardware control based on the status of the OBF flag.This look ok, I've added it to my 4.19 queue.
Thanks Corey,
Since drivers/char/ipmi/kcs_bmc_npcm7xx.c already exists in linux-next (4.18) what not adding it as a fix in 4.18?
-Avi
Quoted 70 lines
-corey
Quoted 63 lines
Signed-off-by Avi Fishman <[email protected]>Reviewed-by Haiyue Wang <[email protected]>--- drivers/char/ipmi/kcs_bmc_npcm7xx.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-)drivers/char/ipmi/kcs_bmc_npcm7xx.c +5
-0@@ -39,6 +39,12 @@#define KCS3CTL 0x3C#define KCS_CTL_IBFIE BIT(0) +#define KCS1IE 0x1C +#define KCS2IE 0x2E +#define KCS3IE 0x40 +#define KCS_IE_IRQE BIT(0) +#define KCS_IE_HIRQE BIT(3) +/* * 7.2.4 Core KCS Registers * Registers in this module are 8 bits. An 8-bit register must be accessed
drivers/char/ipmi/kcs_bmc_npcm7xx.c +5
-3@@ -48,12 +54,14 @@* dob: KCS Channel n Data Out Buffer Register (KCSnDO). * dib: KCS Channel n Data In Buffer Register (KCSnDI). * ctl: KCS Channel n Control Register (KCSnCTL). +* ie : KCS Channel n Interrupt Enable Register (KCSnIE). */ struct npcm7xx_kcs_reg {u32 sts;u32 dob;u32 dib;u32 ctl; +u32 ie; };struct npcm7xx_kcs_bmc {@@ -63,9 +71,9 @@ struct npcm7xx_kcs_bmc { };static const struct npcm7xx_kcs_reg npcm7xx_kcs_reg_tbl[KCS_CHANNEL_MAX ] = { - { .sts =KCS1ST , .dob =KCS1DO , .dib =KCS1DI , .ctl =KCS1CTL }, - { .sts =KCS2ST , .dob =KCS2DO , .dib =KCS2DI , .ctl =KCS2CTL }, - { .sts =KCS3ST , .dob =KCS3DO , .dib =KCS3DI , .ctl =KCS3CTL }, + { .sts =KCS1ST , .dob =KCS1DO , .dib =KCS1DI , .ctl =KCS1CTL , .ie =KCS1IE }, + { .sts =KCS2ST , .dob =KCS2DO , .dib =KCS2DI , .ctl =KCS2CTL , .ie =KCS2IE }, + { .sts =KCS3ST , .dob =KCS3DO , .dib =KCS3DI , .ctl =KCS3CTL , .ie =KCS3IE },}; static u8 npcm7xx_kcs_inb(struct kcs_bmc *kcs_bmc, u32 reg)drivers/char/ipmi/kcs_bmc_npcm7xx.c +3
-0@@ -95,6 +103,9 @@ static void npcm7xx_kcs_enable_channel(struct kcs_bmc *kcs_bmc, bool enable)regmap_update_bits (priv->map, priv->reg->ctl,KCS_CTL_IBFIE , enable ?KCS_CTL_IBFIE :0 ); + +regmap_update_bits (priv->map, priv->reg->ie,KCS_IE_IRQE |KCS_IE_HIRQE , + enable ?KCS_IE_IRQE |KCS_IE_HIRQE :0 ); }static irqreturn_t npcm7xx_kcs_irq (int irq,void *arg)
Quoted 9 lines · Avi Fishman
Quoted 8 lines · Corey Minyard
Quoted 6 lines · On 05/21/2018 07:39 AM, [email protected] wrote:
From: Avi Fishman <[email protected]>
Original
kcs_bmc_npcm7xx.cwas missing enabling to send interrupt to the host on writes to output buffer.
This patch fixes it by setting the bits that enables the generation of IRQn events by hardware control based on the status of the OBF flag.
Quoted 5 lines
Quoted 1 line
This look ok, I've added it to my 4.19 queue.
Thanks Corey,
Since
drivers/char/ipmi/kcs_bmc_npcm7xx.calready exists in linux-next (4.18) what not adding it as a fix in 4.18?
I try not to add new stuff at this stage in the game. I was debating whether this is a bugfix or a new feature. If you have a pressing need to have it in 4.18, I can consider that.
-corey
Quoted 70 lines
-Avi
Quoted 68 lines
-corey
Quoted 63 lines
Signed-off-by Avi Fishman <[email protected]>Reviewed-by Haiyue Wang <[email protected]>--- drivers/char/ipmi/kcs_bmc_npcm7xx.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-)drivers/char/ipmi/kcs_bmc_npcm7xx.c +5
-0@@ -39,6 +39,12 @@#define KCS3CTL 0x3C#define KCS_CTL_IBFIE BIT(0) +#define KCS1IE 0x1C +#define KCS2IE 0x2E +#define KCS3IE 0x40 +#define KCS_IE_IRQE BIT(0) +#define KCS_IE_HIRQE BIT(3) +/* * 7.2.4 Core KCS Registers * Registers in this module are 8 bits. An 8-bit register must be accessed
drivers/char/ipmi/kcs_bmc_npcm7xx.c +5
-3@@ -48,12 +54,14 @@* dob: KCS Channel n Data Out Buffer Register (KCSnDO). * dib: KCS Channel n Data In Buffer Register (KCSnDI). * ctl: KCS Channel n Control Register (KCSnCTL). +* ie : KCS Channel n Interrupt Enable Register (KCSnIE). */ struct npcm7xx_kcs_reg {u32 sts;u32 dob;u32 dib;u32 ctl; +u32 ie; };struct npcm7xx_kcs_bmc {@@ -63,9 +71,9 @@ struct npcm7xx_kcs_bmc { };static const struct npcm7xx_kcs_reg npcm7xx_kcs_reg_tbl[KCS_CHANNEL_MAX ] = { - { .sts =KCS1ST , .dob =KCS1DO , .dib =KCS1DI , .ctl =KCS1CTL }, - { .sts =KCS2ST , .dob =KCS2DO , .dib =KCS2DI , .ctl =KCS2CTL }, - { .sts =KCS3ST , .dob =KCS3DO , .dib =KCS3DI , .ctl =KCS3CTL }, + { .sts =KCS1ST , .dob =KCS1DO , .dib =KCS1DI , .ctl =KCS1CTL , .ie =KCS1IE }, + { .sts =KCS2ST , .dob =KCS2DO , .dib =KCS2DI , .ctl =KCS2CTL , .ie =KCS2IE }, + { .sts =KCS3ST , .dob =KCS3DO , .dib =KCS3DI , .ctl =KCS3CTL , .ie =KCS3IE },}; static u8 npcm7xx_kcs_inb(struct kcs_bmc *kcs_bmc, u32 reg)drivers/char/ipmi/kcs_bmc_npcm7xx.c +3
-0@@ -95,6 +103,9 @@ static void npcm7xx_kcs_enable_channel(struct kcs_bmc *kcs_bmc, bool enable)regmap_update_bits (priv->map, priv->reg->ctl,KCS_CTL_IBFIE , enable ?KCS_CTL_IBFIE :0 ); + +regmap_update_bits (priv->map, priv->reg->ie,KCS_IE_IRQE |KCS_IE_HIRQE , + enable ?KCS_IE_IRQE |KCS_IE_HIRQE :0 ); }static irqreturn_t npcm7xx_kcs_irq (int irq,void *arg)
Avi Fishman
maintainerQuoted 22 lines · Corey Minyard
Quoted 13 lines · Avi Fishman
Quoted 11 lines · Corey Minyard
Quoted 7 lines · On 05/21/2018 07:39 AM, [email protected] wrote:
From: Avi Fishman <[email protected]>
Original
kcs_bmc_npcm7xx.cwas missing enabling to send interrupt to the host on writes to output buffer.
This patch fixes it by setting the bits that enables the generation of IRQn events by hardware control based on the status of the OBF flag.Quoted 6 lines
Quoted 1 line
This look ok, I've added it to my 4.19 queue.
Thanks Corey,
Since
drivers/char/ipmi/kcs_bmc_npcm7xx.calready exists in linux-next (4.18) what not adding it as a fix in 4.18?
Quoted 5 lines
I try not to add new stuff at this stage in the game. I was debating whether this is a bugfix or a new feature. If you have a pressing need to have it in 4.18, I can consider that.
-corey
Without this fix the host is doing polling at a very slow rate, when the host is triggered by an interrupt the response is much more faster.
Note that the same people who tested and approved the original driver reported the performance issue and they tested it with this fix and also approved.
They and I will appriciate if it will be in 4.18 :)
-Avi
Quoted 77 lines
Quoted 76 lines
-Avi
Quoted 72 lines
-corey
Quoted 66 lines
Signed-off-by Avi Fishman <[email protected]>Reviewed-by Haiyue Wang <[email protected]>--- drivers/char/ipmi/kcs_bmc_npcm7xx.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-)drivers/char/ipmi/kcs_bmc_npcm7xx.c +5
-0@@ -39,6 +39,12 @@#define KCS3CTL 0x3C#define KCS_CTL_IBFIE BIT(0) +#define KCS1IE 0x1C +#define KCS2IE 0x2E +#define KCS3IE 0x40 +#define KCS_IE_IRQE BIT(0) +#define KCS_IE_HIRQE BIT(3) +/* * 7.2.4 Core KCS Registers * Registers in this module are 8 bits. An 8-bit register must be accessed
drivers/char/ipmi/kcs_bmc_npcm7xx.c +3
-3@@ -48,12 +54,14 @@* dob: KCS Channel n Data Out Buffer Register (KCSnDO). * dib: KCS Channel n Data In Buffer Register (KCSnDI). * ctl: KCS Channel n Control Register (KCSnCTL). +* ie : KCS Channel n Interrupt Enable Register (KCSnIE). */ struct npcm7xx_kcs_reg {u32 sts;u32 dob;u32 dib;u32 ctl; +u32 ie; };struct npcm7xx_kcs_bmc {@@ -63,9 +71,9 @@ struct npcm7xx_kcs_bmc { };static const struct npcm7xx_kcs_reg npcm7xx_kcs_reg_tbl[KCS_CHANNEL_MAX ] = { - { .sts =KCS1ST , .dob =KCS1DO , .dib =KCS1DI , .ctl =KCS1CTL }, - { .sts =KCS2ST , .dob =KCS2DO , .dib =KCS2DI , .ctl =KCS2CTL }, - { .sts =KCS3ST , .dob =KCS3DO , .dib =KCS3DI , .ctl =KCS3CTL }, + { .sts =KCS1ST , .dob =KCS1DO , .dib =KCS1DI , .ctl =KCS1CTL ,.ie
= KCS1IE },
+ { .sts = KCS2ST, .dob = KCS2DO, .dib = KCS2DI, .ctl = KCS2CTL,
.ie
= KCS2IE },
+ { .sts = KCS3ST, .dob = KCS3DO, .dib = KCS3DI, .ctl = KCS3CTL,
.ie
= KCS3IE },
};
static u8npcm7xx_kcs_inb(struct kcs_bmc *kcs_bmc, u32 reg)drivers/char/ipmi/kcs_bmc_npcm7xx.c +3
-0@@ -95,6 +103,9 @@ static void npcm7xx_kcs_enable_channel(struct kcs_bmc *kcs_bmc, bool enable)regmap_update_bits (priv->map, priv->reg->ctl,KCS_CTL_IBFIE , enable ?KCS_CTL_IBFIE :0 ); + +regmap_update_bits (priv->map, priv->reg->ie,KCS_IE_IRQE |KCS_IE_HIRQE , + enable ?KCS_IE_IRQE |KCS_IE_HIRQE :0 ); }static irqreturn_t npcm7xx_kcs_irq (int irq,void *arg)
Quoted 30 lines · Avi Fishman
Quoted 13 lines · Corey Minyard
Quoted 12 lines · Avi Fishman
Quoted 9 lines · Corey Minyard
Quoted 6 lines · On 05/21/2018 07:39 AM, [email protected] wrote:
From: Avi Fishman <[email protected]>
Original
kcs_bmc_npcm7xx.cwas missing enabling to send interrupt to the host on writes to output buffer.
This patch fixes it by setting the bits that enables the generation of IRQn events by hardware control based on the status of the OBF flag.This look ok, I've added it to my 4.19 queue.
Thanks Corey,
Quoted 8 lines
Quoted 2 lines
Since
drivers/char/ipmi/kcs_bmc_npcm7xx.calready exists in linux-next (4.18) what not adding it as a fix in 4.18?I try not to add new stuff at this stage in the game. I was debating whether this is a bugfix or a new feature. If you have a pressing need to have it in 4.18, I can consider that.
-corey
Without this fix the host is doing polling at a very slow rate, when the host is triggered by an interrupt the response is much more faster.
Note that the same people who tested and approved the original driver reported the performance issue and they tested it with this fix and also approved.
They and I will appriciate if it will be in 4.18 :)
Quoted 1 line
-Avi
Ok, it's in my linux-next queue for 4.18.
-corey
Quoted 74 lines
Quoted 74 lines
Quoted 74 lines
-Avi
Quoted 71 lines
-corey
Quoted 66 lines
Signed-off-by Avi Fishman <[email protected]>Reviewed-by Haiyue Wang <[email protected]>--- drivers/char/ipmi/kcs_bmc_npcm7xx.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-)drivers/char/ipmi/kcs_bmc_npcm7xx.c +5
-0@@ -39,6 +39,12 @@#define KCS3CTL 0x3C#define KCS_CTL_IBFIE BIT(0) +#define KCS1IE 0x1C +#define KCS2IE 0x2E +#define KCS3IE 0x40 +#define KCS_IE_IRQE BIT(0) +#define KCS_IE_HIRQE BIT(3) +/* * 7.2.4 Core KCS Registers * Registers in this module are 8 bits. An 8-bit register must be accessed
drivers/char/ipmi/kcs_bmc_npcm7xx.c +3
-3@@ -48,12 +54,14 @@* dob: KCS Channel n Data Out Buffer Register (KCSnDO). * dib: KCS Channel n Data In Buffer Register (KCSnDI). * ctl: KCS Channel n Control Register (KCSnCTL). +* ie : KCS Channel n Interrupt Enable Register (KCSnIE). */ struct npcm7xx_kcs_reg {u32 sts;u32 dob;u32 dib;u32 ctl; +u32 ie; };struct npcm7xx_kcs_bmc {@@ -63,9 +71,9 @@ struct npcm7xx_kcs_bmc { };static const struct npcm7xx_kcs_reg npcm7xx_kcs_reg_tbl[KCS_CHANNEL_MAX ] = { - { .sts =KCS1ST , .dob =KCS1DO , .dib =KCS1DI , .ctl =KCS1CTL }, - { .sts =KCS2ST , .dob =KCS2DO , .dib =KCS2DI , .ctl =KCS2CTL }, - { .sts =KCS3ST , .dob =KCS3DO , .dib =KCS3DI , .ctl =KCS3CTL }, + { .sts =KCS1ST , .dob =KCS1DO , .dib =KCS1DI , .ctl =KCS1CTL ,.ie
= KCS1IE },
+ { .sts = KCS2ST, .dob = KCS2DO, .dib = KCS2DI, .ctl = KCS2CTL,
.ie
= KCS2IE },
+ { .sts = KCS3ST, .dob = KCS3DO, .dib = KCS3DI, .ctl = KCS3CTL,
.ie
= KCS3IE },
};
static u8npcm7xx_kcs_inb(struct kcs_bmc *kcs_bmc, u32 reg)drivers/char/ipmi/kcs_bmc_npcm7xx.c +3
-0@@ -95,6 +103,9 @@ static void npcm7xx_kcs_enable_channel(struct kcs_bmc *kcs_bmc, bool enable)regmap_update_bits (priv->map, priv->reg->ctl,KCS_CTL_IBFIE , enable ?KCS_CTL_IBFIE :0 ); + +regmap_update_bits (priv->map, priv->reg->ie,KCS_IE_IRQE |KCS_IE_HIRQE , + enable ?KCS_IE_IRQE |KCS_IE_HIRQE :0 ); }static irqreturn_t npcm7xx_kcs_irq (int irq,void *arg)