All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mattijs Korpershoek <mkorpershoek@baylibre.com>
To: Caleb Connolly <caleb.connolly@linaro.org>,
	Tom Rini <trini@konsulko.com>,
	Caleb Connolly <caleb.connolly@linaro.org>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Sumit Garg <sumit.garg@linaro.org>,
	Lukasz Majewski <lukma@denx.de>,
	Sean Anderson <seanga2@gmail.com>
Cc: u-boot@lists.denx.de
Subject: Re: [PATCH v5 16/16] usb: gadget: UMS: fix 64-bit division on ARM32
Date: Tue, 02 Apr 2024 09:24:31 +0200	[thread overview]
Message-ID: <87edbogrbk.fsf@baylibre.com> (raw)
In-Reply-To: <20240328-b4-qcom-livetree-v5-16-4e98228b3d03@linaro.org>

Hi Caleb,

Thank you for the patch.

On jeu., mars 28, 2024 at 17:59, Caleb Connolly <caleb.connolly@linaro.org> wrote:

> The patch introducing support for dynamic sector sizes changed the types
> used in some divisions, resulting in the compiler attempting to use
> libgcc helpers (__aeabi_ldivmod). Replace these divisions with calls to
> lldiv() to handle this correctly.
>
> Fixes: 74e56e0c5065 ("usb: gadget: UMS: support multiple sector sizes")
> Signed-off-by: Caleb Connolly <caleb.connolly@linaro.org>

I believe I applied this already via [1]

I plan to send your work to Tom this week.

Sorry for the delay!

[1] https://lore.kernel.org/r/87a5mqei67.fsf@baylibre.com

> ---
> Cc: Mattijs Korpershoek <mkorpershoek@baylibre.com>
> ---
>  drivers/usb/gadget/f_mass_storage.c | 13 +++++++------
>  1 file changed, 7 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/usb/gadget/f_mass_storage.c b/drivers/usb/gadget/f_mass_storage.c
> index d880928044f4..ef90c7ec7fb5 100644
> --- a/drivers/usb/gadget/f_mass_storage.c
> +++ b/drivers/usb/gadget/f_mass_storage.c
> @@ -239,8 +239,9 @@
>  /* #define VERBOSE_DEBUG */
>  /* #define DUMP_MSGS */
>  
>  #include <config.h>
> +#include <div64.h>
>  #include <hexdump.h>
>  #include <log.h>
>  #include <malloc.h>
>  #include <common.h>
> @@ -768,10 +769,10 @@ static int do_read(struct fsg_common *common)
>  		}
>  
>  		/* Perform the read */
>  		rc = ums[common->lun].read_sector(&ums[common->lun],
> -				      file_offset / curlun->blksize,
> -				      amount / curlun->blksize,
> +				      lldiv(file_offset, curlun->blksize),
> +				      lldiv(amount, curlun->blksize),
>  				      (char __user *)bh->buf);
>  		if (!rc)
>  			return -EIO;
>  
> @@ -942,10 +943,10 @@ static int do_write(struct fsg_common *common)
>  			amount = bh->outreq->actual;
>  
>  			/* Perform the write */
>  			rc = ums[common->lun].write_sector(&ums[common->lun],
> -					       file_offset / curlun->blksize,
> -					       amount / curlun->blksize,
> +					       lldiv(file_offset, curlun->blksize),
> +					       lldiv(amount, curlun->blksize),
>  					       (char __user *)bh->buf);
>  			if (!rc)
>  				return -EIO;
>  			nwritten = rc * curlun->blksize;
> @@ -1058,10 +1059,10 @@ static int do_verify(struct fsg_common *common)
>  		}
>  
>  		/* Perform the read */
>  		rc = ums[common->lun].read_sector(&ums[common->lun],
> -				      file_offset / curlun->blksize,
> -				      amount / curlun->blksize,
> +				      lldiv(file_offset, curlun->blksize),
> +				      lldiv(amount, curlun->blksize),
>  				      (char __user *)bh->buf);
>  		if (!rc)
>  			return -EIO;
>  		nread = rc * curlun->blksize;
>
> -- 
> 2.44.0

  reply	other threads:[~2024-04-02  7:24 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-28 17:59 [PATCH v5 00/16] Qualcomm platform USB support Caleb Connolly
2024-03-28 17:59 ` [PATCH v5 01/16] mailmap: update Bhupesh's email address Caleb Connolly
2024-03-28 17:59 ` [PATCH v5 02/16] phy: qcom: add Qualcomm QUSB2 USB PHY driver Caleb Connolly
2024-04-01  4:42   ` Sumit Garg
2024-03-28 17:59 ` [PATCH v5 03/16] phy: qcom: Add SNPS femto v2 USB HS phy Caleb Connolly
2024-04-01  4:46   ` Sumit Garg
2024-04-02 10:07     ` Caleb Connolly
2024-04-03  4:47       ` Sumit Garg
2024-03-28 17:59 ` [PATCH v5 04/16] mach-snapdragon: disable power-domains for pre-reloc drivers Caleb Connolly
2024-03-28 17:59 ` [PATCH v5 05/16] clk/qcom: use offsets for RCG registers Caleb Connolly
2024-03-28 17:59 ` [PATCH v5 06/16] clk/qcom: sdm845: add gdscs Caleb Connolly
2024-03-28 17:59 ` [PATCH v5 07/16] clk/qcom: sdm845: add USB clocks Caleb Connolly
2024-03-28 17:59 ` [PATCH v5 08/16] gpio: msm_gpio: add .set_flags op Caleb Connolly
2024-03-28 17:59 ` [PATCH v5 09/16] serial: msm-geni: support livetree Caleb Connolly
2024-03-28 17:59 ` [PATCH v5 10/16] mach-snapdragon: fixup USB nodes Caleb Connolly
2024-04-01  4:47   ` Sumit Garg
2024-04-02  8:31   ` Neil Armstrong
2024-03-28 17:59 ` [PATCH v5 11/16] mach-snapdragon: fixup power-domains Caleb Connolly
2024-04-01  4:47   ` Sumit Garg
2024-04-02  8:32   ` Neil Armstrong
2024-03-28 17:59 ` [PATCH v5 12/16] mach-snapdragon: call regulators_enable_boot_on() Caleb Connolly
2024-04-01  4:48   ` Sumit Garg
2024-04-02  8:32   ` Neil Armstrong
2024-03-28 17:59 ` [PATCH v5 13/16] dts: sdm845-db845c: add u-boot fixups Caleb Connolly
2024-04-01  4:49   ` Sumit Garg
2024-04-02  8:32   ` Neil Armstrong
2024-03-28 17:59 ` [PATCH v5 14/16] qcom_defconfig: enable livetree Caleb Connolly
2024-04-01  4:49   ` Sumit Garg
2024-03-28 17:59 ` [PATCH v5 15/16] qcom_defconfig: enable USB Caleb Connolly
2024-04-01  4:50   ` Sumit Garg
2024-03-28 17:59 ` [PATCH v5 16/16] usb: gadget: UMS: fix 64-bit division on ARM32 Caleb Connolly
2024-04-02  7:24   ` Mattijs Korpershoek [this message]
2024-04-02  9:33     ` Caleb Connolly

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=87edbogrbk.fsf@baylibre.com \
    --to=mkorpershoek@baylibre.com \
    --cc=caleb.connolly@linaro.org \
    --cc=lukma@denx.de \
    --cc=neil.armstrong@linaro.org \
    --cc=seanga2@gmail.com \
    --cc=sumit.garg@linaro.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.