aboutsummaryrefslogtreecommitdiff
path: root/drivers/crypto/atmel-sha.c
AgeCommit message (Collapse)AuthorFilesLines
2015-12-17crypto: atmel-sha - Removed unused variable "err"Rahul Pathak1-2/+1
Removed unused variable "err" and directly return "0" Reported by coccicheck - ./drivers/crypto/atmel-sha.c:758:5-8: Unneeded variable: "err". Return "0" on line 766 Signed-off-by: Rahul Pathak <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2015-10-14crypto: atmel - use devm_xxx() managed functionLABBE Corentin1-18/+9
Using the devm_xxx() managed function to stripdown the error and remove code. Signed-off-by: LABBE Corentin <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2015-10-08crypto: atmel - Check for clk_prepare_enable() return valueLABBE Corentin1-1/+5
clk_prepare_enable() can fail so add a check for this and return the error code if it fails. Signed-off-by: LABBE Corentin <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2015-04-08crypto: atmel-sha - correct the max burst sizeLeilei Zhao1-8/+2
The maximum source and destination burst size is 16 according to the datasheet of Atmel DMA. And the value is also checked in function at_xdmac_csize of Atmel DMA driver. With the restrict, the value beyond maximum value will not be processed in DMA driver, so SHA384 and SHA512 will not work and the program will wait forever. So here change the max burst size of all the cases to 16 in order to make SHA384 and SHA512 work and keep consistent with DMA driver and datasheet. Signed-off-by: Leilei Zhao <[email protected]> Acked-by: Nicolas Ferre <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2015-04-08crypto: atmel-sha - initialize spinlock in probeLeilei Zhao1-0/+1
Kernel will report "BUG: spinlock lockup suspected on CPU#0" when CONFIG_DEBUG_SPINLOCK is enabled in kernel config and the spinlock is used at the first time. It's caused by uninitialized spinlock, so just initialize it in probe. Signed-off-by: Leilei Zhao <[email protected]> Acked-by: Nicolas Ferre <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2015-04-08crypto: atmel-sha - fix sg list managementLeilei Zhao1-2/+14
Having a zero length sg doesn't mean it is the end of the sg list. This case happens when calculating HMAC of IPSec packet. Signed-off-by: Leilei Zhao <[email protected]> Signed-off-by: Ludovic Desroches <[email protected]> Acked-by: Nicolas Ferre <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2015-04-08crypto: atmel-sha - correct the way data are splitLudovic Desroches1-1/+1
When a hash is requested on data bigger than the buffer allocated by the SHA driver, the way DMA transfers are performed is quite strange: The buffer is filled at each update request. When full, a DMA transfer is done. On next update request, another DMA transfer is done. Then we wait to have a full buffer (or the end of the data) to perform the dma transfer. Such a situation lead sometimes, on SAMA5D4, to a case where dma transfer is finished but the data ready irq never comes. Moreover hash was incorrect in this case. With this patch, dma transfers are only performed when the buffer is full or when there is no more data. So it removes the transfer whose size is equal the update size after the full buffer transmission. Signed-off-by: Ludovic Desroches <[email protected]> Signed-off-by: Leilei Zhao <[email protected]> Acked-by: Nicolas Ferre <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2015-04-08crypto: atmel-sha - add new versionLeilei Zhao1-0/+6
Add new version of atmel-sha available with SAMA5D4 devices. Signed-off-by: Leilei Zhao <[email protected]> Signed-off-by: Ludovic Desroches <[email protected]> Acked-by: Nicolas Ferre <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2015-03-04crypto: atmel - fix typo in dev_err error messageColin Ian King1-1/+1
Fix typo, "intialization" -> "initialization" Signed-off-by: Colin Ian King <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2014-12-22crypto: atmel_sha - remove unused shash fallback instance.Svenning Sørensen1-44/+6
The fallback is never used, so there is no point in having it. The cra_exit routine can also be removed, since all it did was releasing the fallback, along with the stub around cra_init, which just added an unused NULL argument. Signed-off-by: Svenning Soerensen <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2014-10-20crypto: drop owner assignment from platform_driversWolfram Sang1-1/+0
A platform_driver does not need to set an owner, it will be populated by the driver core. Signed-off-by: Wolfram Sang <[email protected]>
2014-08-01crypto: atmel-sha - Switch to managed version of kzallocPramod Gurav1-7/+2
This patch switches data allocation from kzalloc to devm_kzalloc. It also removed some kfree() on data that was earlier allocated using devm_kzalloc(). CC: Herbert Xu <[email protected]> CC: "David S. Miller" <[email protected]> CC: Grant Likely <[email protected]> CC: Rob Herring <[email protected]> CC: Nicolas Ferre <[email protected]> Signed-off-by: Pramod Gurav <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2013-12-12crypto: atmel-sha - add sha information to the logNicolas Ferre1-1/+3
Depending on peripheral capabilities, print SHA information at the end of the probe function. Signed-off-by: Nicolas Ferre <[email protected]> Acked-by: Herbert Xu <[email protected]>
2013-12-12crypto: atmel-sha - add support for Device TreeNicolas Ferre1-24/+75
Add support for Device Tree and use of the DMA DT API to get the channels if needed. Documentation is added for these DT nodes. Initial code by: Nicolas Royer and Eukrea. Signed-off-by: Nicolas Ferre <[email protected]> Acked-by: Herbert Xu <[email protected]>
2013-03-10crypto: atmel-sha - add support for latest release of the IP (0x410)Nicolas Royer1-100/+486
Updates from IP release 0x320 to 0x400: - add DMA support (previous IP revision use PDC) - add DMA double input buffer support - add SHA224 support Update from IP release 0x400 to 0x410: - add SHA384 and SHA512 support Signed-off-by: Nicolas Royer <[email protected]> Acked-by: Nicolas Ferre <[email protected]> Acked-by: Eric Bénard <[email protected]> Tested-by: Eric Bénard <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2013-01-03Drivers: crypto: remove __dev* attributes.Greg Kroah-Hartman1-3/+3
CONFIG_HOTPLUG is going away as an option. As a result, the __dev* markings need to be removed. This change removes the use of __devinit, __devexit_p, __devinitdata, and __devexit from these drivers. Based on patches originally written by Bill Pemberton, but redone by me in order to handle some of the coding style issues better, by hand. Cc: Bill Pemberton <[email protected]> Cc: Herbert Xu <[email protected]> Cc: "David S. Miller" <[email protected]> Cc: Kent Yoder <[email protected]> Cc: Jamie Iles <[email protected]> Cc: Kim Phillips <[email protected]> Cc: Shengzhou Liu <[email protected]> Cc: Alex Porosanu <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2012-09-07crypto: remove duplicated includeWei Yongjun1-5/+0
From: Wei Yongjun <[email protected]> Remove duplicated include. Signed-off-by: Wei Yongjun <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2012-07-11crypto: atmel - add Atmel SHA1/SHA256 driverNicolas Royer1-0/+1112
Signed-off-by: Nicolas Royer <[email protected]> Acked-by: Nicolas Ferre <[email protected]> Acked-by: Eric Bénard <[email protected]> Tested-by: Eric Bénard <[email protected]> Signed-off-by: Herbert Xu <[email protected]>