Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

crypto: qat - improve logging of PFVF messages

Improve and simplify logging of PFVF messages.

Signed-off-by: Marco Chiappero <marco.chiappero@intel.com>
Reviewed-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Signed-off-by: Giovanni Cabiddu <giovanni.cabiddu@intel.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Marco Chiappero and committed by
Herbert Xu
8616b628 1d9a915f

+17 -24
+2 -2
drivers/crypto/qat/qat_common/adf_gen2_pfvf.c
··· 183 183 msg = ADF_CSR_RD(pmisc_addr, pfvf_offset); 184 184 if (!(msg & int_bit)) { 185 185 dev_info(&GET_DEV(accel_dev), 186 - "Spurious PFVF interrupt, msg %X. Ignored\n", msg); 186 + "Spurious PFVF interrupt, msg 0x%.8x. Ignored\n", msg); 187 187 return 0; 188 188 } 189 189 190 190 /* Ignore legacy non-system (non-kernel) VF2PF messages */ 191 191 if (!(msg & msg_origin)) { 192 192 dev_dbg(&GET_DEV(accel_dev), 193 - "Ignored non-system message (0x%x);\n", msg); 193 + "Ignored non-system message (0x%.8x);\n", msg); 194 194 return 0; 195 195 } 196 196
+11 -19
drivers/crypto/qat/qat_common/adf_pfvf_pf_proto.c
··· 49 49 u8 compat; 50 50 51 51 dev_dbg(&GET_DEV(accel_dev), 52 - "Compatibility Version Request from VF%d vers=%u\n", 53 - vf_nr, vf_compat_ver); 52 + "VersionRequest received from VF%d (vers %d) to PF (vers %d)\n", 53 + vf_nr, vf_compat_ver, ADF_PFVF_COMPAT_THIS_VERSION); 54 54 55 - if (vf_compat_ver <= ADF_PFVF_COMPAT_THIS_VERSION) { 55 + if (vf_compat_ver <= ADF_PFVF_COMPAT_THIS_VERSION) 56 56 compat = ADF_PF2VF_VF_COMPATIBLE; 57 - dev_dbg(&GET_DEV(accel_dev), 58 - "VF (vers %d) compatible with PF (vers %d)\n", 59 - vf_compat_ver, ADF_PFVF_COMPAT_THIS_VERSION); 60 - } else { 57 + else 61 58 compat = ADF_PF2VF_VF_COMPAT_UNKNOWN; 62 - dev_err(&GET_DEV(accel_dev), 63 - "VF (vers %d) compat with PF (vers %d) unkn.\n", 64 - vf_compat_ver, ADF_PFVF_COMPAT_THIS_VERSION); 65 - } 66 59 67 60 resp = ADF_PF2VF_MSGORIGIN_SYSTEM; 68 61 resp |= ADF_PF2VF_MSGTYPE_VERSION_RESP << ··· 70 77 u8 compat; 71 78 72 79 dev_dbg(&GET_DEV(accel_dev), 73 - "Legacy VersionRequest received from VF%d 0x%x\n", 74 - vf_nr, msg); 80 + "Legacy VersionRequest received from VF%d to PF (vers 1.1)\n", 81 + vf_nr); 75 82 76 83 /* PF always newer than legacy VF */ 77 84 compat = ADF_PF2VF_VF_COMPATIBLE; ··· 88 95 case ADF_VF2PF_MSGTYPE_INIT: 89 96 { 90 97 dev_dbg(&GET_DEV(accel_dev), 91 - "Init message received from VF%d 0x%x\n", 92 - vf_nr, msg); 98 + "Init message received from VF%d\n", vf_nr); 93 99 vf_info->init = true; 94 100 } 95 101 break; 96 102 case ADF_VF2PF_MSGTYPE_SHUTDOWN: 97 103 { 98 104 dev_dbg(&GET_DEV(accel_dev), 99 - "Shutdown message received from VF%d 0x%x\n", 100 - vf_nr, msg); 105 + "Shutdown message received from VF%d\n", vf_nr); 101 106 vf_info->init = false; 102 107 } 103 108 break; 104 109 default: 105 - dev_dbg(&GET_DEV(accel_dev), "Unknown message from VF%d (0x%x)\n", 110 + dev_dbg(&GET_DEV(accel_dev), "Unknown message from VF%d (0x%.8x)\n", 106 111 vf_nr, msg); 107 112 return -ENOMSG; 108 113 } ··· 123 132 return false; 124 133 125 134 if (resp && adf_send_pf2vf_msg(accel_dev, vf_nr, resp)) 126 - dev_err(&GET_DEV(accel_dev), "Failed to send response to VF\n"); 135 + dev_err(&GET_DEV(accel_dev), 136 + "Failed to send response to VF%d\n", vf_nr); 127 137 128 138 return true; 129 139 }
+4 -3
drivers/crypto/qat/qat_common/adf_pfvf_vf_proto.c
··· 90 90 { 91 91 switch ((msg & ADF_PF2VF_MSGTYPE_MASK) >> ADF_PF2VF_MSGTYPE_SHIFT) { 92 92 case ADF_PF2VF_MSGTYPE_RESTARTING: 93 - dev_dbg(&GET_DEV(accel_dev), 94 - "Restarting msg received from PF 0x%x\n", msg); 93 + dev_dbg(&GET_DEV(accel_dev), "Restarting message received from PF\n"); 95 94 96 95 adf_pf2vf_handle_pf_restarting(accel_dev); 97 96 return false; 98 97 case ADF_PF2VF_MSGTYPE_VERSION_RESP: 98 + dev_dbg(&GET_DEV(accel_dev), 99 + "Response message received from PF (0x%.8x)\n", msg); 99 100 accel_dev->vf.response = msg; 100 101 complete(&accel_dev->vf.msg_received); 101 102 return true; 102 103 default: 103 104 dev_err(&GET_DEV(accel_dev), 104 - "Unknown PF2VF message(0x%x)\n", msg); 105 + "Unknown PF2VF message (0x%.8x) from PF\n", msg); 105 106 } 106 107 107 108 return false;