regulator: tps65910: Silence deferred probe error
Subsystems (3)
Sasha Levin
maintainerPATCH 1/9 regulator: tps65910: Silence deferred probe error
From: Dmitry Osipenko <[email protected]>
[ Upstream commit e301df76472cc929fa62d923bc3892931f7ad71d ]
The TPS65910 regulator now gets a deferred probe until supply regulator is registered. Silence noisy error message about the deferred probe.
--- drivers/regulator/tps65910-regulator.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
drivers/regulator/tps65910-regulator.c +4 -6
@@ -1208,12 +1208,10 @@ static int tps65910_probe(struct platform_device *pdev) rdev =devm_regulator_register (&pdev->dev, &pmic->desc[i], &config); -if (IS_ERR (rdev)) { -dev_err (tps65910->dev, -"failed to register %s regulator\n" , - pdev->name); -return PTR_ERR (rdev); - } +if (IS_ERR (rdev)) +return dev_err_probe (tps65910->dev,PTR_ERR (rdev), +"failed to register %s regulator\n" , + pdev->name);/* Save regulator for cleanup */ pmic->rdev[i] = rdev;
Signature · 1 line
2.30.2
Sasha Levin
maintainerPATCH 2/9 crypto: mxs-dcp - Check for DMA mapping errors
From: Sean Anderson <[email protected]>
[ Upstream commit df6313d707e575a679ada3313358289af24454c0 ]
After calling dma_map_single(), we must also call dma_mapping_error(). This fixes the following warning when compiling with CONFIG_DMA_API_DEBUG:
[ 311.241478] WARNING: CPU: 0 PID: 428 at kernel/dma/debug.c:1027 check_unmap+0x79c/0x96c [ 311.249547] DMA-API: mxs-dcp 2280000.crypto: device driver failed to check map error[device address=0x00000000860cb080] [size=32 bytes] [mapped as single]
--- drivers/crypto/mxs-dcp.c | 45 +++++++++++++++++++++++++++++++--------- 1 file changed, 35 insertions(+), 10 deletions(-)
drivers/crypto/mxs-dcp.c +35 -10
@@ -167,15 +167,19 @@ static struct dcp *global_sdcp;static int mxs_dcp_start_dma (struct dcp_async_ctx *actx) { +int dma_err;struct dcp *sdcp = global_sdcp;const int chan = actx->chan;uint32_t stat;unsigned long ret;struct dcp_dma_desc *desc = &sdcp->coh->desc[actx->chan]; -dma_addr_t desc_phys =dma_map_single (sdcp->dev, desc,sizeof (*desc),DMA_TO_DEVICE ); + dma_err =dma_mapping_error (sdcp->dev, desc_phys); +if (dma_err) +return dma_err; +reinit_completion (&sdcp->completion[chan]);/* Clear status register. */
@@ -213,18 +217,29 @@ static int mxs_dcp_start_dma(struct dcp_async_ctx *actx)static int mxs_dcp_run_aes (struct dcp_async_ctx *actx,struct ablkcipher_request *req,int init) { +dma_addr_t key_phys, src_phys, dst_phys;struct dcp *sdcp = global_sdcp;struct dcp_dma_desc *desc = &sdcp->coh->desc[actx->chan];struct dcp_aes_req_ctx *rctx =ablkcipher_request_ctx (req);int ret; -dma_addr_t key_phys =dma_map_single (sdcp->dev, sdcp->coh->aes_key, -2 *AES_KEYSIZE_128 , -DMA_TO_DEVICE ); -dma_addr_t src_phys =dma_map_single (sdcp->dev, sdcp->coh->aes_in_buf, -DCP_BUF_SZ ,DMA_TO_DEVICE ); -dma_addr_t dst_phys =dma_map_single (sdcp->dev, sdcp->coh->aes_out_buf, -DCP_BUF_SZ ,DMA_FROM_DEVICE ); + key_phys =dma_map_single (sdcp->dev, sdcp->coh->aes_key, +2 *AES_KEYSIZE_128 ,DMA_TO_DEVICE ); + ret =dma_mapping_error (sdcp->dev, key_phys); +if (ret) +return ret; + + src_phys =dma_map_single (sdcp->dev, sdcp->coh->aes_in_buf, +DCP_BUF_SZ ,DMA_TO_DEVICE ); + ret =dma_mapping_error (sdcp->dev, src_phys); +if (ret) + goto err_src; + + dst_phys =dma_map_single (sdcp->dev, sdcp->coh->aes_out_buf, +DCP_BUF_SZ ,DMA_FROM_DEVICE ); + ret =dma_mapping_error (sdcp->dev, dst_phys); +if (ret) + goto err_dst;if (actx->fill %AES_BLOCK_SIZE ) {dev_err (sdcp->dev,"Invalid block size!\n" );
@@ -262,10 +277,12 @@ static int mxs_dcp_run_aes(struct dcp_async_ctx *actx, ret =mxs_dcp_start_dma (actx); aes_done_run: +dma_unmap_single (sdcp->dev, dst_phys,DCP_BUF_SZ ,DMA_FROM_DEVICE ); +err_dst: +dma_unmap_single (sdcp->dev, src_phys,DCP_BUF_SZ ,DMA_TO_DEVICE ); +err_src:dma_unmap_single (sdcp->dev, key_phys,2 *AES_KEYSIZE_128 ,DMA_TO_DEVICE ); -dma_unmap_single (sdcp->dev, src_phys,DCP_BUF_SZ ,DMA_TO_DEVICE ); -dma_unmap_single (sdcp->dev, dst_phys,DCP_BUF_SZ ,DMA_FROM_DEVICE );return ret; }
@@ -570,6 +587,10 @@ static int mxs_dcp_run_sha(struct ahash_request *req)dma_addr_t buf_phys =dma_map_single (sdcp->dev, sdcp->coh->sha_in_buf,DCP_BUF_SZ ,DMA_TO_DEVICE ); + ret =dma_mapping_error (sdcp->dev, buf_phys); +if (ret) +return ret; +/* Fill in the DMA descriptor. */ desc->control0 =MXS_DCP_CONTROL0_DECR_SEMAPHORE | MXS_DCP_CONTROL0_INTERRUPT |
@@ -602,6 +623,10 @@ static int mxs_dcp_run_sha(struct ahash_request *req)if (rctx->fini) { digest_phys =dma_map_single (sdcp->dev, sdcp->coh->sha_out_buf,DCP_SHA_PAY_SZ ,DMA_FROM_DEVICE ); + ret =dma_mapping_error (sdcp->dev, digest_phys); +if (ret) + goto done_run; + desc->control0 |=MXS_DCP_CONTROL0_HASH_TERM ; desc->payload = digest_phys; }
Signature · 1 line
2.30.2
Sasha Levin
maintainerPATCH 3/9 crypto: omap-sham - clear dma flags only after omap_sham_update_dma_stop()
In reply to Sasha LevinFrom: Tony Lindgren <[email protected]>
[ Upstream commit fe28140b3393b0ba1eb95cc109f974a7e58b26fd ]
We should not clear FLAGS_DMA_ACTIVE before omap_sham_update_dma_stop() is done calling dma_unmap_sg(). We already clear FLAGS_DMA_ACTIVE at the end of omap_sham_update_dma_stop().
The early clearing of FLAGS_DMA_ACTIVE is not causing issues as we do not need to defer anything based on FLAGS_DMA_ACTIVE currently. So this can be applied as clean-up.
--- drivers/crypto/omap-sham.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/crypto/omap-sham.c +1 -1
@@ -1630,7 +1630,7 @@ static void omap_sham_done_task(unsigned long data) goto finish; } }else if (test_bit (FLAGS_DMA_READY , &dd->flags)) { -if (test_and_clear_bit (FLAGS_DMA_ACTIVE , &dd->flags)) { +if (test_bit (FLAGS_DMA_ACTIVE , &dd->flags)) {omap_sham_update_dma_stop (dd);if (dd->err) { err = dd->err;
Signature · 1 line
2.30.2
Sasha Levin
maintainerPATCH 4/9 power: supply: max17042_battery: fix typo in MAx17042_TOFF
In reply to Sasha LevinFrom: Sebastian Krzyszkowiak <[email protected]>
[ Upstream commit ed0d0a0506025f06061325cedae1bbebd081620a ]
--- drivers/power/max17042_battery.c | 2 +- include/linux/power/max17042_battery.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/power/max17042_battery.c +1 -1
@@ -644,7 +644,7 @@ static inline void max17042_override_por_values(struct max17042_chip *chip)struct max17042_config_data *config = chip->pdata->config_data;max17042_override_por (map,MAX17042_TGAIN , config->tgain); -max17042_override_por (map, MAx17042_TOFF, config->toff); +max17042_override_por (map,MAX17042_TOFF , config->toff);max17042_override_por (map,MAX17042_CGAIN , config->cgain);max17042_override_por (map,MAX17042_COFF , config->coff);
include/linux/power/max17042_battery.h +1 -1
@@ -75,7 +75,7 @@ enum max17042_register { MAX17042_RelaxCFG =0x2A , MAX17042_MiscCFG =0x2B ,MAX17042_TGAIN =0x2C , - MAx17042_TOFF =0x2D , +MAX17042_TOFF =0x2D ,MAX17042_CGAIN =0x2E , MAX17042_COFF = 0x2F,
Signature · 1 line
2.30.2
Sasha Levin
maintainerPATCH 5/9 libata: fix ata_host_start()
In reply to Sasha LevinFrom: Damien Le Moal <[email protected]>
[ Upstream commit 355a8031dc174450ccad2a61c513ad7222d87a97 ]
The loop on entry of ata_host_start() may not initialize host->ops to a non NULL value. The test on the host_stop field of host->ops must then be preceded by a check that host->ops is not NULL.
--- drivers/ata/libata-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/ata/libata-core.c +1 -1
@@ -6026,7 +6026,7 @@ int ata_host_start(struct ata_host *host) have_stop =1 ; } -if (host->ops->host_stop) +if (host->ops && host->ops->host_stop) have_stop =1 ;if (have_stop) {
Signature · 1 line
2.30.2
Sasha Levin
maintainerPATCH 6/9 crypto: qat - do not ignore errors from enable_vf2pf_comms()
In reply to Sasha LevinFrom: Giovanni Cabiddu <[email protected]>
[ Upstream commit 5147f0906d50a9d26f2b8698cd06b5680e9867ff ]
The function adf_dev_init() ignores the error code reported by enable_vf2pf_comms(). If the latter fails, e.g. the VF is not compatible with the pf, then the load of the VF driver progresses.
This patch changes adf_dev_init() so that the error code from enable_vf2pf_comms() is returned to the caller.
--- drivers/crypto/qat/qat_common/adf_init.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/crypto/qat/qat_common/adf_init.c +3 -2
@@ -121,6 +121,7 @@ int adf_dev_init(struct adf_accel_dev *accel_dev)struct service_hndl *service;struct list_head *list_itr;struct adf_hw_device_data *hw_data = accel_dev->hw_device; +int ret;if (!hw_data) { dev_err(&GET_DEV(accel_dev),
@@ -187,9 +188,9 @@ int adf_dev_init(struct adf_accel_dev *accel_dev) } hw_data->enable_error_correction (accel_dev); - hw_data->enable_vf2pf_comms (accel_dev); + ret = hw_data->enable_vf2pf_comms (accel_dev); -return 0 ; +return ret; }EXPORT_SYMBOL_GPL (adf_dev_init);
Signature · 1 line
2.30.2
Sasha Levin
maintainerPATCH 7/9 crypto: qat - fix reuse of completion variable
In reply to Sasha LevinFrom: Marco Chiappero <[email protected]>
[ Upstream commit 3d655732b0199562267a05c7ff69ecdd11632939 ]
Use reinit_completion() to set to a clean state a completion variable, used to coordinate the VF to PF request-response flow, before every new VF request.
--- drivers/crypto/qat/qat_common/adf_pf2vf_msg.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/crypto/qat/qat_common/adf_pf2vf_msg.c +2 -0
@@ -384,6 +384,8 @@ static int adf_vf2pf_request_version(struct adf_accel_dev *accel_dev) msg |=ADF_PFVF_COMPATIBILITY_VERSION <<ADF_VF2PF_COMPAT_VER_REQ_SHIFT ;BUILD_BUG_ON (ADF_PFVF_COMPATIBILITY_VERSION >255 ); +reinit_completion (&accel_dev->vf.iov_msg_completion); +/* Send request from VF to PF */ ret =adf_iov_putmsg (accel_dev, msg,0 );if (ret) {
Signature · 1 line
2.30.2
Sasha Levin
maintainerPATCH 8/9 crypto: qat - do not export adf_iov_putmsg()
In reply to Sasha LevinFrom: Giovanni Cabiddu <[email protected]>
[ Upstream commit 645ae0af1840199086c33e4f841892ebee73f615 ]
The function adf_iov_putmsg() is only used inside the intel_qat module therefore should not be exported.
Remove EXPORT_SYMBOL for the function adf_iov_putmsg().
--- drivers/crypto/qat/qat_common/adf_pf2vf_msg.c | 1 - 1 file changed, 1 deletion(-)
drivers/crypto/qat/qat_common/adf_pf2vf_msg.c +0 -1
@@ -254,7 +254,6 @@ int adf_iov_putmsg(struct adf_accel_dev *accel_dev, u32 msg, u8 vf_nr)return ret; } -EXPORT_SYMBOL_GPL (adf_iov_putmsg);void adf_vf2pf_req_hndl (struct adf_accel_vf_info *vf_info) {
Signature · 1 line
2.30.2
Sasha Levin
maintainerPATCH 9/9 udf_get_extendedattr() had no boundary checks.
In reply to Sasha LevinFrom: Stian Skjelstad <[email protected]>
[ Upstream commit 58bc6d1be2f3b0ceecb6027dfa17513ec6aa2abb ]
When parsing the ExtendedAttr data, malicous or corrupt attribute length could cause kernel hangs and buffer overruns in some special cases.
--- fs/udf/misc.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
fs/udf/misc.c +11 -2
@@ -175,13 +175,22 @@ struct genericFormat *udf_get_extendedattr(struct inode *inode, uint32_t type,else offset =le32_to_cpu (eahd->appAttrLocation); -while (offset < iinfo->i_lenEAttr) { +while (offset +sizeof (*gaf) < iinfo->i_lenEAttr) { +uint32_t attrLength; + gaf = (struct genericFormat *)&ea[offset]; + attrLength =le32_to_cpu (gaf->attrLength); + +/* Detect undersized elements and buffer overflows */ +if ((attrLength <sizeof (*gaf)) || + (attrLength > (iinfo->i_lenEAttr - offset))) +break ; +if (le32_to_cpu (gaf->attrType) == type && gaf->attrSubtype == subtype)return gaf;else - offset +=le32_to_cpu (gaf->attrLength); + offset += attrLength; } }
Signature · 1 line
2.30.2