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

mfd: tc6393xb: Fail ohci suspend if full state restore is required

Some boards with TC6393XB chip require full state restore during system
resume thanks to chip's VCC being cut off during suspend (Sharp SL-6000
tosa is one of them). Failing to do so would result in ohci Oops on
resume due to internal memory contentes being changed. Fail ohci suspend
on tc6393xb is full state restore is required.

Recommended workaround is to unbind tmio-ohci driver before suspend and
rebind it after resume.

Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: Lee Jones <lee.jones@linaro.org>

authored by

Dmitry Eremin-Solenikov and committed by
Lee Jones
1a5fb99d bde3e706

+12 -1
+12 -1
drivers/mfd/tc6393xb.c
··· 263 263 return 0; 264 264 } 265 265 266 + static int tc6393xb_ohci_suspend(struct platform_device *dev) 267 + { 268 + struct tc6393xb_platform_data *tcpd = dev_get_platdata(dev->dev.parent); 269 + 270 + /* We can't properly store/restore OHCI state, so fail here */ 271 + if (tcpd->resume_restore) 272 + return -EBUSY; 273 + 274 + return tc6393xb_ohci_disable(dev); 275 + } 276 + 266 277 static int tc6393xb_fb_enable(struct platform_device *dev) 267 278 { 268 279 struct tc6393xb *tc6393xb = dev_get_drvdata(dev->dev.parent); ··· 414 403 .num_resources = ARRAY_SIZE(tc6393xb_ohci_resources), 415 404 .resources = tc6393xb_ohci_resources, 416 405 .enable = tc6393xb_ohci_enable, 417 - .suspend = tc6393xb_ohci_disable, 406 + .suspend = tc6393xb_ohci_suspend, 418 407 .resume = tc6393xb_ohci_enable, 419 408 .disable = tc6393xb_ohci_disable, 420 409 },