Re: [PATCH v2 0/2] eeprom: at25: SPI transfer improvements

From: Geert Uytterhoeven
Date: Wed Jan 23 2019 - 13:11:13 EST


Hi Boris,

On Fri, Jan 18, 2019 at 11:07 PM Boris Brezillon <bbrezillon@xxxxxxxxxx> wrote:
> On Fri, 18 Jan 2019 15:05:23 +0100
> Geert Uytterhoeven <geert+renesas@xxxxxxxxx> wrote:
> > This patch series contains two improvements for the AT25 SPI EEPROM
> > driver, related to SPI transfers.
> >
> > Changes compared to v1:
> > - Merge "off" and "offset" into a single variable instead of just
> > killing the cast, as suggested by Arnd,
> > - Add Acked-by,
> > - Dropped "[PATCH 3/3] eeprom: at25: Split writes in two SPI transfers
> > to optimize DMA", as this is better implemented in the SPI
> > controller driver (cfr. e.g. "[v2 PATCH 2/2] spi: sh-msiof: Use DMA
> > if possible",
> > https://lore.kernel.org/linux-renesas-soc/1547803771-9564-2-git-send-email-na-hoan@xxxxxxxxxxx/)
> >
> > Tested on a Renesas Ebisu development board with R-Car E3 using MSIOF
> > and a 25LC040 EEPROM.
>
> Did you consider converting this driver to spimem? Looks like the
> protocol used to communicate with the memory resembles the one used on
> SPI NANDs/NORs and fits pretty well in the spi_mem_op representation.

No, I hadn't considered doing that ;-)

> By doing this conversion you'd allow people to connect an AT25 EEPROM
> to an advanced SPI controller that does not support regular SPI
> transfers and you wouldn't have to forge SPI messages manually.
>
> Here is a patch (only compile tested) doing that. The diffstat is not in
> favor of this conversion, but I find the resulting code cleaner and more
> future proof.

Thanks, will give it a try, eventually...

Gr{oetje,eeting}s,

Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds