Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

USB: musb: fix CONFIGDATA register read issue

INDEX register has to be set to '0' before reading
CONFIGDATA register which is only present in TI musb
platforms.

Currently the default register access mode is set to
FLAT_MODE thus INDEX register is not getting set
properly with musb_ep_select() which is just a nop
operation in FLAT_MODE.This invalid register read is
causing module reinset failure.

Fixing the issue by moving INDEX register write part to
musb_read_configdata() function itself.

Signed-off-by: Vikram Pandita <vikram.pandita@ti.com>
Signed-off-by: Anand Gadiyar <gadiyar@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
Acked-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Ajay Kumar Gupta and committed by
Greg Kroah-Hartman
2bbff7b7 3a9f5bd8

+1 -1
-1
drivers/usb/musb/musb_core.c
··· 1326 1326 int i; 1327 1327 1328 1328 /* log core options (read using indexed model) */ 1329 - musb_ep_select(mbase, 0); 1330 1329 reg = musb_read_configdata(mbase); 1331 1330 1332 1331 strcpy(aInfo, (reg & MUSB_CONFIGDATA_UTMIDW) ? "UTMI-16" : "UTMI-8");
+1
drivers/usb/musb/musb_regs.h
··· 323 323 324 324 static inline u8 musb_read_configdata(void __iomem *mbase) 325 325 { 326 + musb_writeb(mbase, MUSB_INDEX, 0); 326 327 return musb_readb(mbase, 0x10 + MUSB_CONFIGDATA); 327 328 } 328 329