regmap: fix the offset of register error log
Subsystems (3)
Sasha Levin
maintainerPATCH 1/14 regmap: fix the offset of register error log
From: Jeongtae Park <[email protected]>
[ Upstream commit 1852f5ed358147095297a09cc3c6f160208a676d ]
This patch fixes the offset of register error log
by using regmap_get_offset().
--- drivers/base/regmap/regmap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/base/regmap/regmap.c +1 -1
@@ -1375,7 +1375,7 @@ int _regmap_raw_write(struct regmap *map, unsigned int reg,if (ret) {dev_err (map->dev,"Error in caching of register: %x ret: %d\n" , - reg + i, ret); + reg +regmap_get_offset (map, i), ret);return ret; } }
Signature · 1 line
2.30.2
Sasha Levin
maintainerPATCH 2/14 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; }
@@ -565,6 +582,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 |
@@ -597,6 +618,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/14 power: supply: axp288_fuel_gauge: Report register-address on readb / writeb errors
In reply to Sasha LevinFrom: Hans de Goede <[email protected]>
[ Upstream commit caa534c3ba40c6e8352b42cbbbca9ba481814ac8 ]
When fuel_gauge_reg_readb()/_writeb() fails, report which register we were trying to read / write when the error happened.
Also reword the message a bit:
- Drop the axp288 prefix, dev_err() already prints this
- Switch from telegram / abbreviated style to a normal sentence, aligning the message with those from fuel_gauge_read_*bit_word()
--- drivers/power/supply/axp288_fuel_gauge.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/power/supply/axp288_fuel_gauge.c +2 -2
@@ -169,7 +169,7 @@ static int fuel_gauge_reg_readb(struct axp288_fg_info *info, int reg) }if (ret <0 ) { -dev_err (&info->pdev->dev,"axp288 reg read err:%d\n" , ret); +dev_err (&info->pdev->dev,"Error reading reg 0x%02x err: %d\n" , reg, ret);return ret; }
@@ -183,7 +183,7 @@ static int fuel_gauge_reg_writeb(struct axp288_fg_info *info, int reg, u8 val) ret =regmap_write (info->regmap, reg, (unsigned int )val);if (ret <0 ) -dev_err (&info->pdev->dev,"axp288 reg write err:%d\n" , ret); +dev_err (&info->pdev->dev,"Error writing reg 0x%02x err: %d\n" , reg, ret);return ret; }
Signature · 1 line
2.30.2
Sasha Levin
maintainerPATCH 4/14 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
@@ -1745,7 +1745,7 @@ static void omap_sham_done_task(unsigned long data)if (test_and_clear_bit (FLAGS_OUTPUT_READY , &dd->flags)) 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 5/14 posix-cpu-timers: Force next expiration recalc after itimer reset
In reply to Sasha LevinFrom: Frederic Weisbecker <[email protected]>
[ Upstream commit 406dd42bd1ba0c01babf9cde169bb319e52f6147 ]
When an itimer deactivates a previously armed expiration, it simply doesn't do anything. As a result the process wide cputime counter keeps running and the tick dependency stays set until it reaches the old ghost expiration value.
This can be reproduced with the following snippet:
void trigger_process_counter(void)
{
struct itimerval n = {};
n.it_value.tv_sec = 100;
setitimer(ITIMER_VIRTUAL, &n, NULL);
n.it_value.tv_sec = 0;
setitimer(ITIMER_VIRTUAL, &n, NULL);
}Fix this with resetting the relevant base expiration. This is similar to disarming a timer.
--- kernel/time/posix-cpu-timers.c | 2 -- 1 file changed, 2 deletions(-)
kernel/time/posix-cpu-timers.c +0 -2
@@ -1240,8 +1240,6 @@ void set_process_cpu_timer(struct task_struct *tsk, unsigned int clock_idx, } } -if (!*newval) -return ; *newval += now; }
Signature · 1 line
2.30.2
Sasha Levin
maintainerPATCH 6/14 udf: Check LVID earlier
In reply to Sasha LevinFrom: Jan Kara <[email protected]>
[ Upstream commit 781d2a9a2fc7d0be53a072794dc03ef6de770f3d ]
We were checking validity of LVID entries only when getting implementation use information from LVID in udf_sb_lvidiu(). However if the LVID is suitably corrupted, it can cause problems also to code such as udf_count_free() which doesn't use udf_sb_lvidiu(). So check validity of LVID already when loading it from the disk and just disable LVID altogether when it is not valid.
--- fs/udf/super.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-)
fs/udf/super.c +16 -9
@@ -115,16 +115,10 @@ struct logicalVolIntegrityDescImpUse *udf_sb_lvidiu(struct super_block *sb)return NULL ; lvid = (struct logicalVolIntegrityDesc *)UDF_SB (sb)->s_lvid_bh->b_data; partnum =le32_to_cpu (lvid->numOfPartitions); -if ((sb->s_blocksize -sizeof (struct logicalVolIntegrityDescImpUse ) - - offsetof(struct logicalVolIntegrityDesc , impUse)) / - (2 *sizeof (uint32_t )) < partnum) { -udf_err (sb,"Logical volume integrity descriptor corrupted " -"(numOfPartitions = %u)!\n" , partnum); -return NULL ; - }/* The offset is to skip freeSpaceTable and sizeTable arrays */ offset = partnum *2 *sizeof (uint32_t ); -return (struct logicalVolIntegrityDescImpUse *)&(lvid->impUse[offset]); +return (struct logicalVolIntegrityDescImpUse *) + (((uint8_t *)(lvid +1 )) + offset); }/* UDF filesystem type */
@@ -1571,6 +1565,7 @@ static void udf_load_logicalvolint(struct super_block *sb, struct kernel_extent_struct udf_sb_info *sbi =UDF_SB (sb);struct logicalVolIntegrityDesc *lvid;int indirections =0 ; +u32 parts, impuselen;while (++indirections <=UDF_MAX_LVID_NESTING ) { final_bh =NULL ;
@@ -1597,15 +1592,27 @@ static void udf_load_logicalvolint(struct super_block *sb, struct kernel_extent_ lvid = (struct logicalVolIntegrityDesc *)final_bh->b_data;if (lvid->nextIntegrityExt.extLength ==0 ) -return ; + goto check; loc =leea_to_cpu (lvid->nextIntegrityExt); }udf_warn (sb,"Too many LVID indirections (max %u), ignoring.\n" ,UDF_MAX_LVID_NESTING ); +out_err:brelse (sbi->s_lvid_bh); sbi->s_lvid_bh =NULL ; +return ; +check: + parts =le32_to_cpu (lvid->numOfPartitions); + impuselen =le32_to_cpu (lvid->lengthOfImpUse); +if (parts >= sb->s_blocksize || impuselen >= sb->s_blocksize || +sizeof (struct logicalVolIntegrityDesc ) + impuselen + +2 * parts *sizeof (u32) > sb->s_blocksize) { +udf_warn (sb,"Corrupted LVID (parts=%u, impuselen=%u), " +"ignoring.\n" , parts, impuselen); + goto out_err; + } }
Signature · 1 line
2.30.2
Sasha Levin
maintainerPATCH 7/14 power: supply: max17042_battery: fix typo in MAx17042_TOFF
In reply to Sasha LevinFrom: Sebastian Krzyszkowiak <[email protected]>
[ Upstream commit ed0d0a0506025f06061325cedae1bbebd081620a ]
--- drivers/power/supply/max17042_battery.c | 2 +- include/linux/power/max17042_battery.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/power/supply/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 8/14 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
@@ -6213,7 +6213,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 9/14 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
@@ -101,6 +101,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),
@@ -167,9 +168,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 10/14 crypto: qat - handle both source of interrupt in VF ISR
In reply to Sasha LevinFrom: Giovanni Cabiddu <[email protected]>
[ Upstream commit 0a73c762e1eee33a5e5dc0e3488f1b7cd17249b3 ]
The top half of the VF drivers handled only a source at the time. If an interrupt for PF2VF and bundle occurred at the same time, the ISR scheduled only the bottom half for PF2VF.
This patch fixes the VF top half so that if both sources of interrupt trigger at the same time, both bottom halves are scheduled.
This patch is based on earlier work done by Conor McLoughlin.
--- drivers/crypto/qat/qat_common/adf_vf_isr.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/crypto/qat/qat_common/adf_vf_isr.c +4 -3
@@ -203,6 +203,7 @@ static irqreturn_t adf_isr(int irq, void *privdata)struct adf_bar *pmisc = &GET_BARS (accel_dev)[hw_data->get_misc_bar_id (hw_data)];void __iomem *pmisc_bar_addr = pmisc->virt_addr; +bool handled = false;u32 v_int;/* Read VF INT source CSR to determine the source of VF interrupt */
@@ -215,7 +216,7 @@ static irqreturn_t adf_isr(int irq, void *privdata)/* Schedule tasklet to handle interrupt BH */ tasklet_hi_schedule (&accel_dev->vf.pf2vf_bh_tasklet); -return IRQ_HANDLED ; + handled = true; }/* Check bundle interrupt */
@@ -227,10 +228,10 @@ static irqreturn_t adf_isr(int irq, void *privdata)WRITE_CSR_INT_FLAG_AND_COL (bank->csr_addr, bank->bank_number,0 );tasklet_hi_schedule (&bank->resp_handler); -return IRQ_HANDLED ; + handled = true; } -return IRQ_NONE ; +return handled ?IRQ_HANDLED :IRQ_NONE ; }static int adf_request_msi_irq (struct adf_accel_dev *accel_dev)
Signature · 1 line
2.30.2
Sasha Levin
maintainerPATCH 11/14 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
@@ -361,6 +361,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 12/14 crypto: qat - fix naming for init/shutdown VF to PF notifications
In reply to Sasha LevinFrom: Marco Chiappero <[email protected]>
[ Upstream commit b90c1c4d3fa8cd90f4e8245b13564380fd0bfad1 ]
At start and shutdown, VFs notify the PF about their state. These notifications are carried out through a message exchange using the PFVF protocol.
Function names lead to believe they do perform init or shutdown logic. This is to fix the naming to better reflect their purpose.
--- drivers/crypto/qat/qat_c3xxxvf/adf_c3xxxvf_hw_data.c | 4 ++-- drivers/crypto/qat/qat_c62xvf/adf_c62xvf_hw_data.c | 4 ++-- drivers/crypto/qat/qat_common/adf_common_drv.h | 8 ++++---- drivers/crypto/qat/qat_common/adf_vf2pf_msg.c | 12 ++++++------ .../qat/qat_dh895xccvf/adf_dh895xccvf_hw_data.c | 4 ++-- 5 files changed, 16 insertions(+), 16 deletions(-)
drivers/crypto/qat/qat_c3xxxvf/adf_c3xxxvf_hw_data.c +2 -2
@@ -123,10 +123,10 @@ void adf_init_hw_data_c3xxxiov(struct adf_hw_device_data *hw_data) hw_data->enable_error_correction = adf_vf_void_noop; hw_data->init_admin_comms = adf_vf_int_noop; hw_data->exit_admin_comms = adf_vf_void_noop; - hw_data->send_admin_init = adf_vf2pf_init; + hw_data->send_admin_init = adf_vf2pf_notify_init; hw_data->init_arb = adf_vf_int_noop; hw_data->exit_arb = adf_vf_void_noop; - hw_data->disable_iov = adf_vf2pf_shutdown; + hw_data->disable_iov = adf_vf2pf_notify_shutdown; hw_data->get_accel_mask = get_accel_mask; hw_data->get_ae_mask = get_ae_mask; hw_data->get_num_accels = get_num_accels;
drivers/crypto/qat/qat_c62xvf/adf_c62xvf_hw_data.c +2 -2
@@ -123,10 +123,10 @@ void adf_init_hw_data_c62xiov(struct adf_hw_device_data *hw_data) hw_data->enable_error_correction = adf_vf_void_noop; hw_data->init_admin_comms = adf_vf_int_noop; hw_data->exit_admin_comms = adf_vf_void_noop; - hw_data->send_admin_init = adf_vf2pf_init; + hw_data->send_admin_init = adf_vf2pf_notify_init; hw_data->init_arb = adf_vf_int_noop; hw_data->exit_arb = adf_vf_void_noop; - hw_data->disable_iov = adf_vf2pf_shutdown; + hw_data->disable_iov = adf_vf2pf_notify_shutdown; hw_data->get_accel_mask = get_accel_mask; hw_data->get_ae_mask = get_ae_mask; hw_data->get_num_accels = get_num_accels;
drivers/crypto/qat/qat_common/adf_common_drv.h +4 -4
@@ -239,8 +239,8 @@ void adf_enable_vf2pf_interrupts(struct adf_accel_dev *accel_dev,void adf_enable_pf2vf_interrupts (struct adf_accel_dev *accel_dev);void adf_disable_pf2vf_interrupts (struct adf_accel_dev *accel_dev); -int adf_vf2pf_init (struct adf_accel_dev *accel_dev); -void adf_vf2pf_shutdown (struct adf_accel_dev *accel_dev); +int adf_vf2pf_notify_init (struct adf_accel_dev *accel_dev); +void adf_vf2pf_notify_shutdown (struct adf_accel_dev *accel_dev);int adf_init_pf_wq (void );void adf_exit_pf_wq (void );int adf_init_vf_wq (void );
@@ -263,12 +263,12 @@ static inline void adf_disable_pf2vf_interrupts(struct adf_accel_dev *accel_dev) { } -static inline int adf_vf2pf_init (struct adf_accel_dev *accel_dev) +static inline int adf_vf2pf_notify_init (struct adf_accel_dev *accel_dev) {return 0 ; } -static inline void adf_vf2pf_shutdown (struct adf_accel_dev *accel_dev) +static inline void adf_vf2pf_notify_shutdown (struct adf_accel_dev *accel_dev) { }
drivers/crypto/qat/qat_common/adf_vf2pf_msg.c +6 -6
@@ -49,14 +49,14 @@#include "adf_pf2vf_msg.h" /** -* adf_vf2pf_init() - send init msg to PF +* adf_vf2pf_notify_init() - send init msg to PF * @accel_dev: Pointer to acceleration VF device. * * Function sends an init messge from the VF to a PF * * Return: 0 on success, error code otherwise. */ -int adf_vf2pf_init (struct adf_accel_dev *accel_dev) +int adf_vf2pf_notify_init (struct adf_accel_dev *accel_dev) {u32 msg = (ADF_VF2PF_MSGORIGIN_SYSTEM | (ADF_VF2PF_MSGTYPE_INIT <<ADF_VF2PF_MSGTYPE_SHIFT ));
@@ -69,17 +69,17 @@ int adf_vf2pf_init(struct adf_accel_dev *accel_dev)set_bit (ADF_STATUS_PF_RUNNING , &accel_dev->status);return 0 ; } -EXPORT_SYMBOL_GPL (adf_vf2pf_init); +EXPORT_SYMBOL_GPL (adf_vf2pf_notify_init);/** -* adf_vf2pf_shutdown() - send shutdown msg to PF +* adf_vf2pf_notify_shutdown() - send shutdown msg to PF * @accel_dev: Pointer to acceleration VF device. * * Function sends a shutdown messge from the VF to a PF * * Return: void */ -void adf_vf2pf_shutdown (struct adf_accel_dev *accel_dev) +void adf_vf2pf_notify_shutdown (struct adf_accel_dev *accel_dev) {u32 msg = (ADF_VF2PF_MSGORIGIN_SYSTEM | (ADF_VF2PF_MSGTYPE_SHUTDOWN <<ADF_VF2PF_MSGTYPE_SHIFT ));
@@ -89,4 +89,4 @@ void adf_vf2pf_shutdown(struct adf_accel_dev *accel_dev)dev_err (&GET_DEV (accel_dev),"Failed to send Shutdown event to PF\n" ); } -EXPORT_SYMBOL_GPL (adf_vf2pf_shutdown); +EXPORT_SYMBOL_GPL (adf_vf2pf_notify_shutdown);
drivers/crypto/qat/qat_dh895xccvf/adf_dh895xccvf_hw_data.c +2 -2
@@ -123,10 +123,10 @@ void adf_init_hw_data_dh895xcciov(struct adf_hw_device_data *hw_data) hw_data->enable_error_correction = adf_vf_void_noop; hw_data->init_admin_comms = adf_vf_int_noop; hw_data->exit_admin_comms = adf_vf_void_noop; - hw_data->send_admin_init = adf_vf2pf_init; + hw_data->send_admin_init = adf_vf2pf_notify_init; hw_data->init_arb = adf_vf_int_noop; hw_data->exit_arb = adf_vf_void_noop; - hw_data->disable_iov = adf_vf2pf_shutdown; + hw_data->disable_iov = adf_vf2pf_notify_shutdown; hw_data->get_accel_mask = get_accel_mask; hw_data->get_ae_mask = get_ae_mask; hw_data->get_num_accels = get_num_accels;
Signature · 1 line
2.30.2
Sasha Levin
maintainerPATCH 13/14 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
@@ -231,7 +231,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 14/14 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