mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-28 03:40:04 +00:00
coresight: catu: Claim device before use
Use the CLAIM protocol to grab the ownership of the component when in use. Cc: Mathieu Poirier <mathieu.poirier@linaro.org> Signed-off-by: Suzuki K Poulose <suzuki.poulose@arm.com> Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
f13d7c0835
commit
f92201b1ab
1 changed files with 6 additions and 0 deletions
|
@ -406,6 +406,7 @@ static inline int catu_wait_for_ready(struct catu_drvdata *drvdata)
|
||||||
|
|
||||||
static int catu_enable_hw(struct catu_drvdata *drvdata, void *data)
|
static int catu_enable_hw(struct catu_drvdata *drvdata, void *data)
|
||||||
{
|
{
|
||||||
|
int rc;
|
||||||
u32 control, mode;
|
u32 control, mode;
|
||||||
struct etr_buf *etr_buf = data;
|
struct etr_buf *etr_buf = data;
|
||||||
|
|
||||||
|
@ -418,6 +419,10 @@ static int catu_enable_hw(struct catu_drvdata *drvdata, void *data)
|
||||||
return -EBUSY;
|
return -EBUSY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rc = coresight_claim_device_unlocked(drvdata->base);
|
||||||
|
if (rc)
|
||||||
|
return rc;
|
||||||
|
|
||||||
control |= BIT(CATU_CONTROL_ENABLE);
|
control |= BIT(CATU_CONTROL_ENABLE);
|
||||||
|
|
||||||
if (etr_buf && etr_buf->mode == ETR_MODE_CATU) {
|
if (etr_buf && etr_buf->mode == ETR_MODE_CATU) {
|
||||||
|
@ -459,6 +464,7 @@ static int catu_disable_hw(struct catu_drvdata *drvdata)
|
||||||
int rc = 0;
|
int rc = 0;
|
||||||
|
|
||||||
catu_write_control(drvdata, 0);
|
catu_write_control(drvdata, 0);
|
||||||
|
coresight_disclaim_device_unlocked(drvdata->base);
|
||||||
if (catu_wait_for_ready(drvdata)) {
|
if (catu_wait_for_ready(drvdata)) {
|
||||||
dev_info(drvdata->dev, "Timeout while waiting for READY\n");
|
dev_info(drvdata->dev, "Timeout while waiting for READY\n");
|
||||||
rc = -EAGAIN;
|
rc = -EAGAIN;
|
||||||
|
|
Loading…
Reference in a new issue