mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
To: tien.sung.ang@intel.com, mdf@kernel.org, hao.wu@intel.com,
	yilun.xu@intel.com, trix@redhat.com
Cc: linux-fpga@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] fpga: altera-cvp: Truncated bitstream error support
Date: Wed, 18 May 2022 22:54:40 +0200	[thread overview]
Message-ID: <6939d35f-36a0-568e-bfec-4dd2e3a48604@wanadoo.fr> (raw)
In-Reply-To: <20220518064844.2694651-1-tien.sung.ang@intel.com>

Le 18/05/2022 à 08:48, tien.sung.ang@intel.com a écrit :
> From: Ang Tien Sung <tien.sung.ang@intel.com>
> 
> To support the error handling of a truncated bitstream sent.
> The current AIB CvP firmware is not capable of handling a
> data stream smaller than 4096bytes. The firmware's limitation
> causes a hung-up as it's DMA engine waits forever for the
> completion of the instructed 4096bytes.
> To resolve this design limitation, both firmware and CvP
> driver made several changes. At the CvP driver, we just
> have to ensure that anything lesser than 4096bytes are
> padded with extra bytes. The CvP will then, initiate the
> tear-down by clearing the START_XFER and CVP_CONFIG bits.
> We should also check for CVP_ERROR during the CvP completion.
> A send_buf which is always 4096bytes is used to copy the
> data during every transaction.
> 
> Signed-off-by: Ang Tien Sung <tien.sung.ang@intel.com>
> ---
>   drivers/fpga/altera-cvp.c | 24 +++++++++++++++++++-----
>   1 file changed, 19 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/fpga/altera-cvp.c b/drivers/fpga/altera-cvp.c
> index 4ffb9da537d8..80edcfb5e5fc 100644
> --- a/drivers/fpga/altera-cvp.c
> +++ b/drivers/fpga/altera-cvp.c
> @@ -81,6 +81,7 @@ struct altera_cvp_conf {
>   	u8			numclks;
>   	u32			sent_packets;
>   	u32			vsec_offset;
> +	u8			*send_buf;
>   	const struct cvp_priv	*priv;
>   };
>   
> @@ -453,7 +454,11 @@ static int altera_cvp_write(struct fpga_manager *mgr, const char *buf,
>   		}
>   
>   		len = min(conf->priv->block_size, remaining);
> -		altera_cvp_send_block(conf, data, len);
> +		/* Copy the requested host data into the transmit buffer */
> +
> +		memcpy(conf->send_buf, data, len);
> +		altera_cvp_send_block(conf, (const u32 *)conf->send_buf,
> +		conf->priv->block_size);

Nitpicking: this should be aligned with 'conf'.

CJ

>   		data += len / sizeof(u32);
>   		done += len;
>   		remaining -= len;

[...]

  parent reply	other threads:[~2022-05-18 20:54 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-18  6:48 tien.sung.ang
2022-05-18 20:08 ` Tom Rix
2022-05-19  4:34   ` tien.sung.ang
2022-05-28 10:01     ` Xu Yilun
2022-05-28 10:03   ` Xu Yilun
2022-05-18 20:54 ` Christophe JAILLET [this message]
2022-05-19  4:21   ` tien.sung.ang
2022-05-28 10:08     ` Xu Yilun
2022-05-20  1:30   ` [PATCH v2] " tien.sung.ang
2022-05-28  9:59     ` Xu Yilun
2022-05-31  1:53       ` tien.sung.ang
2022-06-03  9:49         ` Xu Yilun
2022-06-07  5:55           ` tien.sung.ang
2022-06-08 10:30             ` Xu Yilun
2022-06-27  7:45               ` tien.sung.ang
2022-06-27  8:52                 ` Xu Yilun
2022-05-18 14:04 [PATCH] fpga: altera-cvp: allow interrupt to continue next time Tom Rix
2022-05-19  9:39 ` [PATCH] fpga: altera-cvp: Truncated bitstream error support tien.sung.ang
2022-05-28 12:05   ` Xu Yilun

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=6939d35f-36a0-568e-bfec-4dd2e3a48604@wanadoo.fr \
    --to=christophe.jaillet@wanadoo.fr \
    --cc=hao.wu@intel.com \
    --cc=linux-fpga@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mdf@kernel.org \
    --cc=tien.sung.ang@intel.com \
    --cc=trix@redhat.com \
    --cc=yilun.xu@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

all inboxes | Powered by JetHome®