diff options
author | Ed Tanous <ed.tanous@intel.com> | 2019-05-29 20:29:58 +0300 |
---|---|---|
committer | Ed Tanous <ed.tanous@intel.com> | 2019-06-06 04:30:22 +0300 |
commit | 87a65e63bac789bca0607e0b4ab09d62517b95e7 (patch) | |
tree | 3254b912d6468012543e127a19ba2f1cd13b108f /meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0030-Add-dump-debug-code-into-I2C-drivers.patch | |
parent | 5364646cb66fa75cdcbf148e039e0383cda94f2a (diff) | |
download | openbmc-87a65e63bac789bca0607e0b4ab09d62517b95e7.tar.xz |
Update to internal
Signed-off-by: Ed Tanous <ed.tanous@intel.com>
Diffstat (limited to 'meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0030-Add-dump-debug-code-into-I2C-drivers.patch')
-rw-r--r-- | meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0030-Add-dump-debug-code-into-I2C-drivers.patch | 35 |
1 files changed, 13 insertions, 22 deletions
diff --git a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0030-Add-dump-debug-code-into-I2C-drivers.patch b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0030-Add-dump-debug-code-into-I2C-drivers.patch index b735ab38b..e984623ba 100644 --- a/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0030-Add-dump-debug-code-into-I2C-drivers.patch +++ b/meta-openbmc-mods/meta-common/recipes-kernel/linux/linux-aspeed/0030-Add-dump-debug-code-into-I2C-drivers.patch @@ -1,4 +1,4 @@ -From 577b65960842f4098cdfc85a311261477c051d84 Mon Sep 17 00:00:00 2001 +From f4c13be7b95899d6eca3fa7ae38224bc9c7d7902 Mon Sep 17 00:00:00 2001 From: Jae Hyun Yoo <jae.hyun.yoo@intel.com> Date: Fri, 29 Jun 2018 11:00:02 -0700 Subject: [PATCH] Add dump debug code into I2C drivers @@ -16,11 +16,11 @@ echo 1 > /sys/module/i2c_slave_mqueue/parameters/dump_debug Signed-off-by: Jae Hyun Yoo <jae.hyun.yoo@intel.com> --- drivers/i2c/busses/i2c-aspeed.c | 25 +++++++++++++++++++++++++ - drivers/i2c/i2c-slave-mqueue.c | 24 ++++++++++++++++++++++++ - 2 files changed, 49 insertions(+) + drivers/i2c/i2c-slave-mqueue.c | 22 ++++++++++++++++++++++ + 2 files changed, 47 insertions(+) diff --git a/drivers/i2c/busses/i2c-aspeed.c b/drivers/i2c/busses/i2c-aspeed.c -index d11b2ea97259..506d867b43d9 100644 +index 6c8b38fd6e64..77dbd37b7b51 100644 --- a/drivers/i2c/busses/i2c-aspeed.c +++ b/drivers/i2c/busses/i2c-aspeed.c @@ -166,6 +166,19 @@ struct aspeed_i2c_bus { @@ -44,14 +44,14 @@ index d11b2ea97259..506d867b43d9 100644 static int aspeed_i2c_recover_bus(struct aspeed_i2c_bus *bus) @@ -655,6 +668,7 @@ static int aspeed_i2c_master_xfer(struct i2c_adapter *adap, + { struct aspeed_i2c_bus *bus = i2c_get_adapdata(adap); unsigned long time_left, flags; - int ret; + int i; spin_lock_irqsave(&bus->lock, flags); bus->cmd_err = 0; -@@ -694,6 +708,11 @@ static int aspeed_i2c_master_xfer(struct i2c_adapter *adap, +@@ -697,6 +711,11 @@ static int aspeed_i2c_master_xfer(struct i2c_adapter *adap, return -ETIMEDOUT; } @@ -63,7 +63,7 @@ index d11b2ea97259..506d867b43d9 100644 return bus->master_xfer_result; } -@@ -1061,6 +1080,12 @@ static struct platform_driver aspeed_i2c_bus_driver = { +@@ -1064,6 +1083,12 @@ static struct platform_driver aspeed_i2c_bus_driver = { }; module_platform_driver(aspeed_i2c_bus_driver); @@ -77,7 +77,7 @@ index d11b2ea97259..506d867b43d9 100644 MODULE_DESCRIPTION("Aspeed I2C Bus Driver"); MODULE_LICENSE("GPL v2"); diff --git a/drivers/i2c/i2c-slave-mqueue.c b/drivers/i2c/i2c-slave-mqueue.c -index 6014bca0ff2a..0140c0dc4c03 100644 +index 6014bca0ff2a..4548088e1922 100644 --- a/drivers/i2c/i2c-slave-mqueue.c +++ b/drivers/i2c/i2c-slave-mqueue.c @@ -21,6 +21,7 @@ struct mq_msg { @@ -88,7 +88,7 @@ index 6014bca0ff2a..0140c0dc4c03 100644 spinlock_t lock; /* spinlock for queue index handling */ int in; -@@ -31,6 +32,19 @@ struct mq_queue { +@@ -31,6 +32,18 @@ struct mq_queue { struct mq_msg *queue; }; @@ -99,8 +99,7 @@ index 6014bca0ff2a..0140c0dc4c03 100644 + if (dump_debug && client->adapter->nr == dump_debug_bus_id) { \ + char dump_info[100] = {0,}; \ + snprintf(dump_info, sizeof(dump_info), \ -+ "%s (bus_id:%d, addr:0x%02x): ", \ -+ __func__, client->adapter->nr, client->addr); \ ++ "%s (bus_id:%d): ", __func__, client->adapter->nr); \ + print_hex_dump(KERN_ERR, dump_info, DUMP_PREFIX_NONE, 16, 1, \ + buf, len, true); \ + } @@ -108,15 +107,7 @@ index 6014bca0ff2a..0140c0dc4c03 100644 static int i2c_slave_mqueue_callback(struct i2c_client *client, enum i2c_slave_event event, u8 *val) { -@@ -49,6 +63,7 @@ static int i2c_slave_mqueue_callback(struct i2c_client *client, - case I2C_SLAVE_WRITE_RECEIVED: - if (msg->len < MQ_MSGBUF_SIZE) { - msg->buf[msg->len++] = *val; -+ I2C_HEX_DUMP(client, val, 1); - } else { - dev_err(&client->dev, "message is truncated!\n"); - mq->truncated = 1; -@@ -101,6 +116,7 @@ static ssize_t i2c_slave_mqueue_bin_read(struct file *filp, +@@ -101,6 +114,7 @@ static ssize_t i2c_slave_mqueue_bin_read(struct file *filp, if (msg->len <= count) { ret = msg->len; memcpy(buf, msg->buf, ret); @@ -124,7 +115,7 @@ index 6014bca0ff2a..0140c0dc4c03 100644 } else { ret = -EOVERFLOW; /* Drop this HUGE one. */ } -@@ -131,6 +147,8 @@ static int i2c_slave_mqueue_probe(struct i2c_client *client, +@@ -131,6 +145,8 @@ static int i2c_slave_mqueue_probe(struct i2c_client *client, BUILD_BUG_ON(!is_power_of_2(MQ_QUEUE_SIZE)); @@ -133,7 +124,7 @@ index 6014bca0ff2a..0140c0dc4c03 100644 buf = devm_kmalloc_array(dev, MQ_QUEUE_SIZE, MQ_MSGBUF_SIZE, GFP_KERNEL); if (!buf) -@@ -212,6 +230,12 @@ static struct i2c_driver i2c_slave_mqueue_driver = { +@@ -212,6 +228,12 @@ static struct i2c_driver i2c_slave_mqueue_driver = { }; module_i2c_driver(i2c_slave_mqueue_driver); |