From: Hiromitsu Yamasaki Date: Wed, 5 Sep 2018 08:49:37 +0000 (+0200) Subject: spi: sh-msiof: Fix handling of write value for SISTR register X-Git-Tag: Ubuntu-4.15.0-56.62~1583 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=ce49664c6485dcd5296a0ba4e2e05d63c09f39d6;p=mirror_ubuntu-bionic-kernel.git spi: sh-msiof: Fix handling of write value for SISTR register BugLink: https://bugs.launchpad.net/bugs/1836287 commit 31a5fae4c5a009898da6d177901d5328051641ff upstream. This patch changes writing to the SISTR register according to the H/W user's manual. The TDREQ bit and RDREQ bits of SISTR are read-only, and must be written their initial values of zero. Signed-off-by: Hiromitsu Yamasaki [geert: reword] Signed-off-by: Geert Uytterhoeven Signed-off-by: Mark Brown Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Kamal Mostafa Signed-off-by: Khalid Elmously --- diff --git a/drivers/spi/spi-sh-msiof.c b/drivers/spi/spi-sh-msiof.c index 26fb95dcd444..c6a39fc40cdc 100644 --- a/drivers/spi/spi-sh-msiof.c +++ b/drivers/spi/spi-sh-msiof.c @@ -384,7 +384,8 @@ static void sh_msiof_spi_set_mode_regs(struct sh_msiof_spi_priv *p, static void sh_msiof_reset_str(struct sh_msiof_spi_priv *p) { - sh_msiof_write(p, STR, sh_msiof_read(p, STR)); + sh_msiof_write(p, STR, + sh_msiof_read(p, STR) & ~(STR_TDREQ | STR_RDREQ)); } static void sh_msiof_spi_write_fifo_8(struct sh_msiof_spi_priv *p,