[PATCH 21/29] crypto: talitos - Export common channel and error handling routines
From: Paul Louvel
Date: Thu May 28 2026 - 05:18:52 EST
Remove the static qualifier from flush_channel(), current_desc_hdr(),
report_eu_error(), and talitos_error(); add the talitos_ prefix where
missing; and declare them in talitos.h.
These routines will be called from the upcoming SEC1/SEC2 compilation
units, so they need to be externally visible.
Signed-off-by: Paul Louvel <paul.louvel@xxxxxxxxxxx>
---
drivers/crypto/talitos/talitos.c | 36 +++++++++++++++++++-----------------
drivers/crypto/talitos/talitos.h | 5 +++++
2 files changed, 24 insertions(+), 17 deletions(-)
diff --git a/drivers/crypto/talitos/talitos.c b/drivers/crypto/talitos/talitos.c
index c4a311a8e7fd..827d075ecfaa 100644
--- a/drivers/crypto/talitos/talitos.c
+++ b/drivers/crypto/talitos/talitos.c
@@ -439,7 +439,7 @@ static void sec2_dma_unmap_request(struct device *dev,
/*
* process what was done, notify callback of error if not
*/
-static void flush_channel(struct device *dev, int ch, int error, int reset_ch)
+void talitos_flush_channel(struct device *dev, int ch, int error, int reset_ch)
{
struct talitos_private *priv = dev_get_drvdata(dev);
struct talitos_request *request, saved_req;
@@ -507,13 +507,13 @@ static void talitos1_done_##name(unsigned long data) \
unsigned long flags; \
\
if (ch_done_mask & 0x10000000) \
- flush_channel(dev, 0, 0, 0); \
+ talitos_flush_channel(dev, 0, 0, 0); \
if (ch_done_mask & 0x40000000) \
- flush_channel(dev, 1, 0, 0); \
+ talitos_flush_channel(dev, 1, 0, 0); \
if (ch_done_mask & 0x00010000) \
- flush_channel(dev, 2, 0, 0); \
+ talitos_flush_channel(dev, 2, 0, 0); \
if (ch_done_mask & 0x00040000) \
- flush_channel(dev, 3, 0, 0); \
+ talitos_flush_channel(dev, 3, 0, 0); \
\
/* At this point, all completed channels have been processed */ \
/* Unmask done interrupts for channels completed later on. */ \
@@ -534,13 +534,13 @@ static void talitos2_done_##name(unsigned long data) \
unsigned long flags; \
\
if (ch_done_mask & 1) \
- flush_channel(dev, 0, 0, 0); \
+ talitos_flush_channel(dev, 0, 0, 0); \
if (ch_done_mask & (1 << 2)) \
- flush_channel(dev, 1, 0, 0); \
+ talitos_flush_channel(dev, 1, 0, 0); \
if (ch_done_mask & (1 << 4)) \
- flush_channel(dev, 2, 0, 0); \
+ talitos_flush_channel(dev, 2, 0, 0); \
if (ch_done_mask & (1 << 6)) \
- flush_channel(dev, 3, 0, 0); \
+ talitos_flush_channel(dev, 3, 0, 0); \
\
/* At this point, all completed channels have been processed */ \
/* Unmask done interrupts for channels completed later on. */ \
@@ -585,7 +585,7 @@ static __be32 sec2_search_desc_hdr_in_request(struct talitos_request *request,
/*
* locate current (offending) descriptor
*/
-static __be32 current_desc_hdr(struct device *dev, int ch)
+__be32 talitos_current_desc_hdr(struct device *dev, int ch)
{
struct talitos_private *priv = dev_get_drvdata(dev);
struct talitos_request *request;
@@ -622,7 +622,7 @@ static __be32 current_desc_hdr(struct device *dev, int ch)
/*
* user diagnostics; report root cause of error based on execution unit status
*/
-static void report_eu_error(struct device *dev, int ch, __be32 desc_hdr)
+void talitos_report_eu_error(struct device *dev, int ch, __be32 desc_hdr)
{
struct talitos_private *priv = dev_get_drvdata(dev);
int i;
@@ -719,9 +719,10 @@ static int sec1_talitos_handle_error(struct device *dev, u32 isr, u32 isr_lo)
if (v_lo & TALITOS1_CCPSR_LO_SA)
dev_err(dev, "static assignment error\n");
if (v_lo & TALITOS1_CCPSR_LO_EU)
- report_eu_error(dev, ch, current_desc_hdr(dev, ch));
+ talitos_report_eu_error(
+ dev, ch, talitos_current_desc_hdr(dev, ch));
- flush_channel(dev, ch, error, 1);
+ talitos_flush_channel(dev, ch, error, 1);
priv->ops->reset_channel(dev, ch);
}
@@ -768,7 +769,8 @@ static int sec2_talitos_handle_error(struct device *dev, u32 isr, u32 isr_lo)
if (v_lo & TALITOS2_CCPSR_LO_IEU)
dev_err(dev, "invalid exec unit error\n");
if (v_lo & TALITOS2_CCPSR_LO_EU)
- report_eu_error(dev, ch, current_desc_hdr(dev, ch));
+ talitos_report_eu_error(
+ dev, ch, talitos_current_desc_hdr(dev, ch));
if (v_lo & TALITOS2_CCPSR_LO_GB)
dev_err(dev, "gather boundary error\n");
if (v_lo & TALITOS2_CCPSR_LO_GRL)
@@ -778,7 +780,7 @@ static int sec2_talitos_handle_error(struct device *dev, u32 isr, u32 isr_lo)
if (v_lo & TALITOS2_CCPSR_LO_SRL)
dev_err(dev, "scatter return/length error\n");
- flush_channel(dev, ch, error, reset_ch);
+ talitos_flush_channel(dev, ch, error, reset_ch);
if (reset_ch) {
priv->ops->reset_channel(dev, ch);
@@ -803,7 +805,7 @@ static int sec2_talitos_handle_error(struct device *dev, u32 isr, u32 isr_lo)
/*
* recover from error interrupts
*/
-static void talitos_error(struct device *dev, u32 isr, u32 isr_lo)
+void talitos_error(struct device *dev, u32 isr, u32 isr_lo)
{
struct talitos_private *priv = dev_get_drvdata(dev);
int ch, reset_dev;
@@ -818,7 +820,7 @@ static void talitos_error(struct device *dev, u32 isr, u32 isr_lo)
/* purge request queues */
for (ch = 0; ch < priv->num_channels; ch++)
- flush_channel(dev, ch, -EIO, 1);
+ talitos_flush_channel(dev, ch, -EIO, 1);
/* reset and reinitialize the device */
init_device(dev);
diff --git a/drivers/crypto/talitos/talitos.h b/drivers/crypto/talitos/talitos.h
index 46de1bf1ef27..98b2cb5115f8 100644
--- a/drivers/crypto/talitos/talitos.h
+++ b/drivers/crypto/talitos/talitos.h
@@ -561,6 +561,11 @@ void talitos_cra_exit(struct crypto_tfm *tfm);
int talitos_register_common(struct device *dev,
struct talitos_alg_template *template);
+void talitos_flush_channel(struct device *dev, int ch, int error, int reset_ch);
+__be32 talitos_current_desc_hdr(struct device *dev, int ch);
+void talitos_error(struct device *dev, u32 isr, u32 isr_lo);
+void talitos_report_eu_error(struct device *dev, int ch, __be32 desc_hdr);
+
/* Hardware RNG */
int talitos_register_rng(struct device *dev);
--
2.54.0