openwrt/target/linux/lantiq/patches-5.15/0302-mtd-cfi_cmdset_0001-Disable-write-buffer-functions-i.patch
John Audia 67d998e25d
kernel: bump 5.15 to 5.15.145
Changelog: https://cdn.kernel.org/pub/linux/kernel/v5.x/ChangeLog-5.15.145

No patches needed a rebase.

 23.05 backport:

    Rebased patch mediatek/100-dts-update-mt7622-rfb1.patch due to
    changes introduced in commit e37aa926447f ("arm64: dts: mediatek:
    mt7622: fix memory node warning check") in version v5.15.143 and we
    jumped over from v5.15.139 directly to v5.15.145.

Build system: x86_64
Build-tested: ramips/tplink_archer-a6-v3
Run-tested: ramips/tplink_archer-a6-v3

 23.05 backport:

  Stijn:
   Compile-tested: ath79/generic, ipq40xx/generic, mvebu/cortexa72, ramips/mt{7621,7620,76x8}, realtek/rtl{838x,930x}, 86/64.
   Run-tested: cortexa72 (RB5009UG+S+IN), mt7621 (EAP615-Wall v1), rtl838x (GS1900-10HP, GS1900-8HP, GS108T v3).

  Petr:
   Compile-tested: ipq807x, mvebu/cortexa9
   Run-tested: turris-omnia, prpl-haze

Tested-by: Stijn Segers <foss@volatilesystems.org> [23.05 testing]
Signed-off-by: John Audia <therealgraysky@proton.me>
Signed-off-by: Petr Štetiar <ynezz@true.cz> [23.05 refresh]
(cherry picked from commit 8de4cc77a6)
2024-01-07 12:57:30 +00:00

63 lines
2.3 KiB
Diff

From 118fe2c88b35482711adeee0d8758bddfe958701 Mon Sep 17 00:00:00 2001
From: Aleksander Jan Bajkowski <olek2@wp.pl>
Date: Sat, 6 May 2023 14:32:00 +0200
Subject: [PATCH] mtd: cfi_cmdset_0001: Disable write buffer functions if
FORCE_WORD_WRITE is 1
Some write buffer functions are not used when FORCE_WORD_WRITE is set to 1.
So the compile warning messages are output if FORCE_WORD_WRITE is 1. To
resolve this disable the write buffer functions if FORCE_WORD_WRITE is 1.
This is similar fix to: 557c759036fc3976a5358cef23e65a263853b93f.
Signed-off-by: Aleksander Jan Bajkowski <olek2@wp.pl>
---
drivers/mtd/chips/cfi_cmdset_0001.c | 6 ++++++
1 file changed, 6 insertions(+)
--- a/drivers/mtd/chips/cfi_cmdset_0001.c
+++ b/drivers/mtd/chips/cfi_cmdset_0001.c
@@ -61,8 +61,10 @@
static int cfi_intelext_read (struct mtd_info *, loff_t, size_t, size_t *, u_char *);
static int cfi_intelext_write_words(struct mtd_info *, loff_t, size_t, size_t *, const u_char *);
+#if !FORCE_WORD_WRITE
static int cfi_intelext_write_buffers(struct mtd_info *, loff_t, size_t, size_t *, const u_char *);
static int cfi_intelext_writev(struct mtd_info *, const struct kvec *, unsigned long, loff_t, size_t *);
+#endif
static int cfi_intelext_erase_varsize(struct mtd_info *, struct erase_info *);
static void cfi_intelext_sync (struct mtd_info *);
static int cfi_intelext_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len);
@@ -304,6 +306,7 @@ static void fixup_use_point(struct mtd_i
}
}
+#if !FORCE_WORD_WRITE
static void fixup_use_write_buffers(struct mtd_info *mtd)
{
struct map_info *map = mtd->priv;
@@ -314,6 +317,7 @@ static void fixup_use_write_buffers(stru
mtd->_writev = cfi_intelext_writev;
}
}
+#endif /* !FORCE_WORD_WRITE */
/*
* Some chips power-up with all sectors locked by default.
@@ -1719,6 +1723,7 @@ static int cfi_intelext_write_words (str
}
+#if !FORCE_WORD_WRITE
static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip,
unsigned long adr, const struct kvec **pvec,
unsigned long *pvec_seek, int len)
@@ -1947,6 +1952,7 @@ static int cfi_intelext_write_buffers (s
return cfi_intelext_writev(mtd, &vec, 1, to, retlen);
}
+#endif /* !FORCE_WORD_WRITE */
static int __xipram do_erase_oneblock(struct map_info *map, struct flchip *chip,
unsigned long adr, int len, void *thunk)