* [PATCH AUTOSEL 6.1 17/18] platform/chrome: kunit: initialize lock for fake ec_dev
[not found] <20231107121104.3757943-1-sashal@kernel.org>
@ 2023-11-07 12:10 ` Sasha Levin
0 siblings, 0 replies; only message in thread
From: Sasha Levin @ 2023-11-07 12:10 UTC (permalink / raw)
To: linux-kernel, stable
Cc: Tzung-Bi Shih, Guenter Roeck, Sasha Levin, bleung,
chrome-platform
From: Tzung-Bi Shih <tzungbi@kernel.org>
[ Upstream commit e410b4ade83d06a046f6e32b5085997502ba0559 ]
cros_ec_cmd_xfer() uses ec_dev->lock. Initialize it.
Otherwise, dmesg shows the following:
> DEBUG_LOCKS_WARN_ON(lock->magic != lock)
> ...
> Call Trace:
> ? __mutex_lock
> ? __warn
> ? __mutex_lock
> ...
> ? cros_ec_cmd_xfer
Reviewed-by: Guenter Roeck <groeck@chromium.org>
Link: https://lore.kernel.org/r/20231003080504.4011337-1-tzungbi@kernel.org
Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
drivers/platform/chrome/cros_ec_proto_test.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/platform/chrome/cros_ec_proto_test.c b/drivers/platform/chrome/cros_ec_proto_test.c
index c6a83df91ae1e..b46a8bc2196fe 100644
--- a/drivers/platform/chrome/cros_ec_proto_test.c
+++ b/drivers/platform/chrome/cros_ec_proto_test.c
@@ -2667,6 +2667,7 @@ static int cros_ec_proto_test_init(struct kunit *test)
ec_dev->dev->release = cros_ec_proto_test_release;
ec_dev->cmd_xfer = cros_kunit_ec_xfer_mock;
ec_dev->pkt_xfer = cros_kunit_ec_xfer_mock;
+ mutex_init(&ec_dev->lock);
priv->msg = (struct cros_ec_command *)priv->_msg;
--
2.42.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2023-11-07 12:11 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20231107121104.3757943-1-sashal@kernel.org>
2023-11-07 12:10 ` [PATCH AUTOSEL 6.1 17/18] platform/chrome: kunit: initialize lock for fake ec_dev Sasha Levin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox