linux-crypto.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tadeusz Struk <tadeusz.struk@intel.com>
To: herbert@gondor.apana.org.au
Cc: Pingchao Yang <pingchao.yang@intel.com>,
	linux-crypto@vger.kernel.org, qat-linux@intel.com
Subject: Re: crypto: qat - remove to call get_sram_bar_id for qat_c3xxx
Date: Fri, 15 Jan 2016 10:28:51 -0800	[thread overview]
Message-ID: <56993A63.5060304@intel.com> (raw)
In-Reply-To: <1452074194-115019-1-git-send-email-pingchao.yang@intel.com>

On 01/06/2016 01:56 AM, Pingchao Yang wrote:
> From: Pingchao Yang <pingchao.yang@intel.com>
> 
> Reported-by : Struk, Tadeusz <tadeusz.struk@intel.com>
> Signed-off-by: Yang Pingchao <pingchao.yang@intel.com>
> 
> ---
> drivers/crypto/qat/qat_common/qat_hal.c | 9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/crypto/qat/qat_common/qat_hal.c b/drivers/crypto/qat/qat_common/qat_hal.c
> index 0d0b5ed..bcb39b0 100644
> --- a/drivers/crypto/qat/qat_common/qat_hal.c
> +++ b/drivers/crypto/qat/qat_common/qat_hal.c
> @@ -693,14 +693,12 @@ int qat_hal_init(struct adf_accel_dev *accel_dev)
>  	struct adf_hw_device_data *hw_data = accel_dev->hw_device;
>  	struct adf_bar *misc_bar =
>  			&pci_info->pci_bars[hw_data->get_misc_bar_id(hw_data)];
> -	struct adf_bar *sram_bar =
> -			&pci_info->pci_bars[hw_data->get_sram_bar_id(hw_data)];
> +	struct adf_bar *sram_bar;
>  
>  	handle = kzalloc(sizeof(*handle), GFP_KERNEL);
>  	if (!handle)
>  		return -ENOMEM;
>  
> -	handle->hal_sram_addr_v = sram_bar->virt_addr;
>  	handle->hal_cap_g_ctl_csr_addr_v =
>  		(void __iomem *)((uintptr_t)misc_bar->virt_addr +
>  				 ICP_QAT_CAP_OFFSET);
> @@ -714,6 +712,11 @@ int qat_hal_init(struct adf_accel_dev *accel_dev)
>  		(void __iomem *)((uintptr_t)handle->hal_cap_ae_xfer_csr_addr_v +
>  				 LOCAL_TO_XFER_REG_OFFSET);
>  	handle->pci_dev = pci_info->pci_dev;
> +	if (handle->pci_dev->device != ADF_C3XXX_PCI_DEVICE_ID) {
> +		sram_bar =
> +			&pci_info->pci_bars[hw_data->get_sram_bar_id(hw_data)];
> +		handle->hal_sram_addr_v = sram_bar->virt_addr;
> +	}
>  	handle->fw_auth = (handle->pci_dev->device ==
>  			   ADF_DH895XCC_PCI_DEVICE_ID) ? false : true;
>  	handle->hal_handle = kzalloc(sizeof(*handle->hal_handle), GFP_KERNEL);
> 
Herbert,
This fixes issue related to invalid BAR mapping on C3XXX device,
which leads to memory corruption and kernel oops.
Please include this fix into 4.5.
Thanks,

-- 
TS

  reply	other threads:[~2016-01-15 18:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-06  9:56 [PATCH] crypto: qat - remove to call get_sram_bar_id for qat_c3xxx Yang Pingchao
2016-01-15 18:28 ` Tadeusz Struk [this message]
2016-01-18 15:22   ` Herbert Xu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56993A63.5060304@intel.com \
    --to=tadeusz.struk@intel.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=pingchao.yang@intel.com \
    --cc=qat-linux@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).