Commit 1a5fb99de4850cba710d91becfa2c65653048589

Authored by Dmitry Eremin-Solenikov
Committed by Lee Jones
1 parent bde3e706a6

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>

Showing 1 changed file with 12 additions and 1 deletions Side-by-side Diff

drivers/mfd/tc6393xb.c
... ... @@ -263,6 +263,17 @@
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);
... ... @@ -403,7 +414,7 @@
403 414 .num_resources = ARRAY_SIZE(tc6393xb_ohci_resources),
404 415 .resources = tc6393xb_ohci_resources,
405 416 .enable = tc6393xb_ohci_enable,
406   - .suspend = tc6393xb_ohci_disable,
  417 + .suspend = tc6393xb_ohci_suspend,
407 418 .resume = tc6393xb_ohci_enable,
408 419 .disable = tc6393xb_ohci_disable,
409 420 },