According to the README.md of ATF code, whose repo is
https://github.com/altera-opensource/arm-trusted-firmware.git.
Random number generation is not supported on Stratix10 platform
But ATF code doesn't process properly and return error value.
So, make the workaround to avoid breaking ATF code.

Signed-off-by: Meng Li <[email protected]>
---
 drivers/crypto/intel_fcs.c | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/drivers/crypto/intel_fcs.c b/drivers/crypto/intel_fcs.c
index b1d0e501a370..832c05133eb3 100644
--- a/drivers/crypto/intel_fcs.c
+++ b/drivers/crypto/intel_fcs.c
@@ -453,6 +453,12 @@ static long fcs_ioctl(struct file *file, unsigned int cmd,
                break;
 
        case INTEL_FCS_DEV_RANDOM_NUMBER_GEN:
+               /*
+                * Random number generation is not supported on Stratix10 
platform
+                */
+               if (of_machine_is_compatible("altr,socfpga-stratix10"))
+                       return -ENOTSUPP;
+
                if (copy_from_user(data, (void __user *)arg, sizeof(*data))) {
                        dev_err(dev, "failure on copy_from_user\n");
                        return -EFAULT;
@@ -2462,6 +2468,16 @@ static int fcs_rng_read(struct hwrng *rng, void *buf, 
size_t max, bool wait)
        int ret = 0;
        size_t size = 0;
 
+       /*
+        * According to the README.md of ATF code, whose repo is
+        * https://github.com/altera-opensource/arm-trusted-firmware.git.
+        * Random number generation is not supported on Stratix10 platform
+        * But ATF code doesn't process properly and return error value.
+        * So, make the workaround to avoid breaking ATF code.
+        */
+       if (of_machine_is_compatible("altr,socfpga-stratix10"))
+               return -ENOTSUPP;
+
        priv = (struct intel_fcs_priv *)rng->priv;
        dev = priv->client.dev;
        msg = &msg_var;
-- 
2.17.1

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#10875): 
https://lists.yoctoproject.org/g/linux-yocto/message/10875
Mute This Topic: https://lists.yoctoproject.org/mt/88692072/21656
Group Owner: [email protected]
Unsubscribe: https://lists.yoctoproject.org/g/linux-yocto/unsub 
[[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to