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

crypto: s5p-sss - Remove useless hash interrupt handler

Beside regular feed control interrupt, the driver requires also hash
interrupt for older SoCs (samsung,s5pv210-secss). However after
requesting it, the interrupt handler isn't doing anything with it, not
even clearing the hash interrupt bit.

Driver does not provide hash functions so it is safe to remove the hash
interrupt related code and to not require the interrupt in Device Tree.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Krzysztof Kozlowski and committed by
Herbert Xu
55124425 07c8fccb

+8 -32
+2 -4
Documentation/devicetree/bindings/crypto/samsung-sss.txt
··· 23 23 - "samsung,exynos4210-secss" for Exynos4210, Exynos4212, Exynos4412, Exynos5250, 24 24 Exynos5260 and Exynos5420 SoCs. 25 25 - reg : Offset and length of the register set for the module 26 - - interrupts : interrupt specifiers of SSS module interrupts, should contain 27 - following entries: 28 - - first : feed control interrupt (required for all variants), 29 - - second : hash interrupt (required only for samsung,s5pv210-secss). 26 + - interrupts : interrupt specifiers of SSS module interrupts (one feed 27 + control interrupt). 30 28 31 29 - clocks : list of clock phandle and specifier pairs for all clocks listed in 32 30 clock-names property.
+6 -28
drivers/crypto/s5p-sss.c
··· 149 149 150 150 /** 151 151 * struct samsung_aes_variant - platform specific SSS driver data 152 - * @has_hash_irq: true if SSS module uses hash interrupt, false otherwise 153 152 * @aes_offset: AES register offset from SSS module's base. 154 153 * 155 154 * Specifies platform specific configuration of SSS module. ··· 156 157 * expansion of its usage. 157 158 */ 158 159 struct samsung_aes_variant { 159 - bool has_hash_irq; 160 160 unsigned int aes_offset; 161 161 }; 162 162 ··· 176 178 struct clk *clk; 177 179 void __iomem *ioaddr; 178 180 void __iomem *aes_ioaddr; 179 - int irq_hash; 180 181 int irq_fc; 181 182 182 183 struct ablkcipher_request *req; ··· 198 201 static struct s5p_aes_dev *s5p_dev; 199 202 200 203 static const struct samsung_aes_variant s5p_aes_data = { 201 - .has_hash_irq = true, 202 204 .aes_offset = 0x4000, 203 205 }; 204 206 205 207 static const struct samsung_aes_variant exynos_aes_data = { 206 - .has_hash_irq = false, 207 208 .aes_offset = 0x200, 208 209 }; 209 210 ··· 416 421 417 422 spin_lock_irqsave(&dev->lock, flags); 418 423 419 - if (irq == dev->irq_fc) { 420 - status = SSS_READ(dev, FCINTSTAT); 421 - if (status & SSS_FCINTSTAT_BRDMAINT) 422 - s5p_aes_rx(dev); 423 - if (status & SSS_FCINTSTAT_BTDMAINT) 424 - s5p_aes_tx(dev); 424 + status = SSS_READ(dev, FCINTSTAT); 425 + if (status & SSS_FCINTSTAT_BRDMAINT) 426 + s5p_aes_rx(dev); 427 + if (status & SSS_FCINTSTAT_BTDMAINT) 428 + s5p_aes_tx(dev); 425 429 426 - SSS_WRITE(dev, FCINTPEND, status); 427 - } 430 + SSS_WRITE(dev, FCINTPEND, status); 428 431 429 432 spin_unlock_irqrestore(&dev->lock, flags); 430 433 ··· 786 793 if (err < 0) { 787 794 dev_warn(dev, "feed control interrupt is not available.\n"); 788 795 goto err_irq; 789 - } 790 - 791 - if (variant->has_hash_irq) { 792 - pdata->irq_hash = platform_get_irq(pdev, 1); 793 - if (pdata->irq_hash < 0) { 794 - err = pdata->irq_hash; 795 - dev_warn(dev, "hash interrupt is not available.\n"); 796 - goto err_irq; 797 - } 798 - err = devm_request_irq(dev, pdata->irq_hash, s5p_aes_interrupt, 799 - IRQF_SHARED, pdev->name, pdev); 800 - if (err < 0) { 801 - dev_warn(dev, "hash interrupt is not available.\n"); 802 - goto err_irq; 803 - } 804 796 } 805 797 806 798 pdata->busy = false;