Skip to content

Commit 5973a94

Browse files
MulinChaocarlescufi
authored andcommitted
Revert "driver: uart: npcx: add missing tx/rx interrupt enabled checks"
This reverts commit 271b306. In rare conditions, this commit causes the uart shell mechanism to corrupt on Cros ec system. Revert this commit on upstream repo first to avoid blocking the development. Will dig out why this symptom occurs later. Signed-off-by: Mulin Chao <[email protected]>
1 parent 33b0c0d commit 5973a94

File tree

1 file changed

+2
-19
lines changed

1 file changed

+2
-19
lines changed

drivers/serial/uart_npcx.c

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -194,17 +194,9 @@ static void uart_npcx_irq_tx_disable(const struct device *dev)
194194
inst->UFTCTL &= ~(BIT(NPCX_UFTCTL_TEMPTY_EN));
195195
}
196196

197-
static bool uart_npcx_irq_tx_is_enabled(const struct device *dev)
198-
{
199-
const struct uart_npcx_config *const config = dev->config;
200-
struct uart_reg *const inst = config->inst;
201-
202-
return IS_BIT_SET(inst->UFTCTL, NPCX_UFTCTL_TEMPTY_EN);
203-
}
204-
205197
static int uart_npcx_irq_tx_ready(const struct device *dev)
206198
{
207-
return uart_npcx_tx_fifo_ready(dev) && uart_npcx_irq_tx_is_enabled(dev);
199+
return uart_npcx_tx_fifo_ready(dev);
208200
}
209201

210202
static int uart_npcx_irq_tx_complete(const struct device *dev)
@@ -232,14 +224,6 @@ static void uart_npcx_irq_rx_disable(const struct device *dev)
232224
inst->UFRCTL &= ~(BIT(NPCX_UFRCTL_RNEMPTY_EN));
233225
}
234226

235-
static bool uart_npcx_irq_rx_is_enabled(const struct device *dev)
236-
{
237-
const struct uart_npcx_config *const config = dev->config;
238-
struct uart_reg *const inst = config->inst;
239-
240-
return IS_BIT_SET(inst->UFRCTL, NPCX_UFRCTL_RNEMPTY_EN);
241-
}
242-
243227
static int uart_npcx_irq_rx_ready(const struct device *dev)
244228
{
245229
return uart_npcx_rx_fifo_available(dev);
@@ -263,8 +247,7 @@ static void uart_npcx_irq_err_disable(const struct device *dev)
263247

264248
static int uart_npcx_irq_is_pending(const struct device *dev)
265249
{
266-
return uart_npcx_irq_tx_ready(dev) ||
267-
(uart_npcx_irq_rx_ready(dev) && uart_npcx_irq_rx_is_enabled(dev));
250+
return (uart_npcx_irq_tx_ready(dev) || uart_npcx_irq_rx_ready(dev));
268251
}
269252

270253
static int uart_npcx_irq_update(const struct device *dev)

0 commit comments

Comments
 (0)