linux-fpga.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Pisa <pisa@fel.cvut.cz>
To: gregkh@linuxfoundation.org
Cc: Xu Yilun <yilun.xu@linux.intel.com>,
	jgg@nvidia.com, m.szyprowski@samsung.com, yilun.xu@intel.com,
	linux-fpga@vger.kernel.org, mdf@kernel.org,
	linux-kernel@vger.kernel.org, Michal Simek <michal.simek@amd.com>,
	"Marc Kleine-Budde" <mkl@pengutronix.de>
Subject: Re: [PATCH 1/1] fpga: zynq_fpga: Fix the wrong usage of dma_map_sgtable()
Date: Tue, 19 Aug 2025 00:39:02 +0200	[thread overview]
Message-ID: <202508190039.02454.pisa@fel.cvut.cz> (raw)
In-Reply-To: <20250806070605.1920909-2-yilun.xu@linux.intel.com>

Hello Greg and others,

please, is there some progress/decision about the fix for mainline?

Our daily test of mainline Linux kernel build and test of CAN
communication latency on Zynq system with loaded CTU CAN FD
IP core ends with unresponsive kernel. The last successful
mainline build is from July 29
 
  run-250729-042256-hist+6.16.0-g283564a43383+oaat-kern.json
  https://canbus.pages.fel.cvut.cz/can-latester/

I have analyzed the cause and reported (August 4) that mainline
Zynq runtime FPGA bitstream loading was broken by patch

  37e00703228a ("zynq_fpga: use sgtable-based scatterlist wrappers")

Xu Yilun and others from the FPGA community reacted promptly
with the fix on August 6. The fix has propagated into linux-next.
Is there a plan to accept it for the 6.17 version, or would it be
accepted only for 6.18?

If it is expected that it takes a longer time, or even 6.17
would be released with non-functional Zynq FPGA manager support
then we need to add patching of the broken kernel into our system
because we do not want to lose months of kernel state monitoring
and testing, because more problems could slip in during that time.
We have already caught some problems with the RT variant in the past
thanks to our effort and we have reported quickly even actual
case still during 6.17 merge window. The current breakage
in the mainline test fails our whole series, and we are losing even
RT assessment without changes prepared for the long-term mainline
fails, which is exceptional in our three-year testing effort.

Best wishes,

Pavel


On Wednesday 06 of August 2025 09:06:05 Xu Yilun wrote:
> dma_map_sgtable() returns only 0 or the error code. Read sgt->nents to
> get the number of mapped segments.
>
> CC: stable@vger.kernel.org
> Fixes: 37e00703228a ("zynq_fpga: use sgtable-based scatterlist wrappers")
> Reported-by: Pavel Pisa <pisa@fel.cvut.cz>
> Closes:
> https://lore.kernel.org/linux-fpga/202508041548.22955.pisa@fel.cvut.cz/
> Reviewed-by: Jason Gunthorpe <jgg@nvidia.com>
> Reviewed-by: Marek Szyprowski <m.szyprowski@samsung.com>
> Signed-off-by: Xu Yilun <yilun.xu@linux.intel.com>
> Tested-by: Pavel Pisa <pisa@fel.cvut.cz>
> ---
>  drivers/fpga/zynq-fpga.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/fpga/zynq-fpga.c b/drivers/fpga/zynq-fpga.c
> index 0be0d569589d..b7629a0e4813 100644
> --- a/drivers/fpga/zynq-fpga.c
> +++ b/drivers/fpga/zynq-fpga.c
> @@ -405,12 +405,12 @@ static int zynq_fpga_ops_write(struct fpga_manager
> *mgr, struct sg_table *sgt) }
>  	}
>
> -	priv->dma_nelms =
> -	    dma_map_sgtable(mgr->dev.parent, sgt, DMA_TO_DEVICE, 0);
> -	if (priv->dma_nelms == 0) {
> +	err = dma_map_sgtable(mgr->dev.parent, sgt, DMA_TO_DEVICE, 0);
> +	if (err) {
>  		dev_err(&mgr->dev, "Unable to DMA map (TO_DEVICE)\n");
> -		return -ENOMEM;
> +		return err;
>  	}
> +	priv->dma_nelms = sgt->nents;
>
>  	/* enable clock */
>  	err = clk_enable(priv->clk);


-- 
                Pavel Pisa
    phone:      +420 603531357
    e-mail:     pisa@cmp.felk.cvut.cz
    Department of Control Engineering FEE CVUT
    Karlovo namesti 13, 121 35, Prague 2
    university: http://control.fel.cvut.cz/
    personal:   http://cmp.felk.cvut.cz/~pisa
    social:     https://social.kernel.org/ppisa
    projects:   https://www.openhub.net/accounts/ppisa
    CAN related:http://canbus.pages.fel.cvut.cz/
    RISC-V education: https://comparch.edu.cvut.cz/
    Open Technologies Research Education and Exchange Services
    https://gitlab.fel.cvut.cz/otrees/org/-/wikis/home

  reply	other threads:[~2025-08-18 22:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-06  7:06 [PATCH 0/1] Last minute FPGA fix for v6.17-rc1 Xu Yilun
2025-08-06  7:06 ` [PATCH 1/1] fpga: zynq_fpga: Fix the wrong usage of dma_map_sgtable() Xu Yilun
2025-08-18 22:39   ` Pavel Pisa [this message]
2025-08-19  5:25     ` Greg KH
2025-08-23 18:39       ` Pavel Pisa

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=202508190039.02454.pisa@fel.cvut.cz \
    --to=pisa@fel.cvut.cz \
    --cc=gregkh@linuxfoundation.org \
    --cc=jgg@nvidia.com \
    --cc=linux-fpga@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=mdf@kernel.org \
    --cc=michal.simek@amd.com \
    --cc=mkl@pengutronix.de \
    --cc=yilun.xu@intel.com \
    --cc=yilun.xu@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).