Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1268531

Re: [PATCH] mmc: dw_mmc: use resource_size_t to store physical address

From Andy Shevchenko <andy.shevchenko@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH] mmc: dw_mmc: use resource_size_t to store physical address
Date 2015-11-13 02:20 +0100
Message-ID <qubbY-8bp-11@gated-at.bofh.it> (permalink)
References <qu12W-1Bf-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Nov 12, 2015 at 4:14 PM, Arnd Bergmann <arnd@arndb.de> wrote:
> The dw_mmc driver stores the physical address of the MMIO registers
> in a pointer, which requires the use of type casts, and is actually
> broken if anyone ever has this device on a 32-bit SoC in registers
> above 4GB. Gcc warns about this possibility when the driver is built
> with ARM LPAE enabled:

> -       host->phy_regs = (void *)(regs->start);
> +       host->phy_regs = regs->start;

>         /* Set external dma config: burst size, burst width */
> -       cfg.dst_addr = (dma_addr_t)(host->phy_regs + fifo_offset);
> +       cfg.dst_addr = host->phy_regs + fifo_offset;

dst_addr is dma_addr_t?

>         /* Registers's physical base address */
> -       void                    *phy_regs;
> +       resource_size_t         phy_regs;

If dst_addr is dma_addr_t wouldn't be a problem when
resource_size_t is defined as 64-bit address, and dma_addr_t as 32-bit?

Btw, for me casting to dma_addr_t looks sane.

-- 
With Best Regards,
Andy Shevchenko
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] mmc: dw_mmc: use resource_size_t to store physical address Arnd Bergmann <arnd@arndb.de> - 2015-11-12 15:30 +0100
  Re: [PATCH] mmc: dw_mmc: use resource_size_t to store physical address Andy Shevchenko <andy.shevchenko@gmail.com> - 2015-11-13 02:20 +0100
    Re: [PATCH] mmc: dw_mmc: use resource_size_t to store physical address Arnd Bergmann <arnd@arndb.de> - 2015-11-13 10:40 +0100

csiph-web