Repository navigation
ASoC: max98363: don't return on success reading revision ID - #4503
Conversation
There was a problem hiding this comment.
@bardliao I'm not sure I follow the first part of your commit message. We are already doing all the remaining steps in case of success, isn't it? In case of error, we need mark last busy and then suspend no?
There was a problem hiding this comment.
@bardliao I'm not sure I follow the first part of your commit message. We are already doing all the remaining steps in case of success, isn't it? In case of error, we need mark last busy and then suspend no?
@ranj063 The existing code return ret on success, and doesn't do the tasks after line 182. I didn't mark last busy before suspend is because it is very likely that there is something wrong with sdw bus when regmap_read return error and I hope the codec can go into suspend immediately and don't access the regmap.
There was a problem hiding this comment.
@bardliao why does that have to prevent marking when the device was last busy?
There was a problem hiding this comment.
@bardliao why does that have to prevent marking when the device was last busy?
It will suspend after 3 sec from last busy, because of pm_runtime_set_autosuspend_delay(dev, 3000);
There was a problem hiding this comment.
@bardliao can you send this upstream when you have a moment? I have too many patches on my plate already :-)
There was a problem hiding this comment.
@bardliao can you send this upstream when you have a moment? I have too many patches on my plate already :-)
Sure
| ret = regmap_read(max98363->regmap, MAX98363_R21FF_REV_ID, ®); | ||
| if (!ret) { | ||
| dev_info(dev, "Revision ID: %X\n", reg); | ||
| } else { |
There was a problem hiding this comment.
need pm_runtime_mark_last_busy(dev); here
or better, add a label and jump to the end of the function.
There was a problem hiding this comment.
I also don't understand what happens if the regmap_read() returns an error, we keep going?
What is the purpose of this check, something does not add up or I need more coffee.
There was a problem hiding this comment.
need pm_runtime_mark_last_busy(dev); here
or better, add a label and jump to the end of the function.
Sure, I will add a lebel.
I also don't understand what happens if the regmap_read() returns an error, we keep going?
What is the purpose of this check, something does not add up or I need more coffee.
Originally, it will keep going only when regmap_read() returns an error, and that was a bug. That is the reason why max98363 keep active.
max98363_io_init needs to keep going when we read revision ID successfully. Fixes: 18c0af9 ("ASoC: max98363: add soundwire amplifier driver") Signed-off-by: Bard Liao <yung-chuan.liao@linux.intel.com>
We need to do remaining tasks when we read revision ID successfully. And we should put runtime pm before return error.
Fixes: 18c0af9 ("ASoC: max98363: add soundwire amplifier driver")