[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200701150007.GA2141@sultan-book.localdomain>
Date: Wed, 1 Jul 2020 08:00:07 -0700
From: Sultan Alsawaf <sultan@...neltoast.com>
To: Jarkko Nikula <jarkko.nikula@...ux.intel.com>
Cc: aaron.ma@...onical.com, admin@...ma.net,
andriy.shevchenko@...ux.intel.com, benjamin.tissoires@...hat.com,
hdegoede@...hat.com, hn.chen@...dahitech.com, jikos@...nel.org,
kai.heng.feng@...onical.com, linux-i2c@...r.kernel.org,
linux-input@...r.kernel.org, linux-kernel@...r.kernel.org,
mika.westerberg@...ux.intel.com, vicamo.yang@...onical.com,
wsa@...nel.org
Subject: Re: [PATCH v2] HID: i2c-hid: Use block reads when possible to save
power
On Wed, Jul 01, 2020 at 11:04:01AM +0300, Jarkko Nikula wrote:
> On 6/29/20 8:43 PM, Sultan Alsawaf wrote:
> > Hmm, for some reason in 5.8 I get the same problem, but 5.7 is fine. Could you
> > try this on 5.7 and see if it works?
> >
> > In the meantime I'll bisect 5.8 to see why it's causing problems for me...
> >
> I see the same issue on top of v5.7:
Try reverting my "i2c: designware: Only check the first byte for SMBus block
read length" patch and apply the following change instead:
--- a/drivers/i2c/busses/i2c-designware-master.c
+++ b/drivers/i2c/busses/i2c-designware-master.c
@@ -394,10 +394,12 @@ i2c_dw_read(struct dw_i2c_dev *dev)
u32 flags = msgs[dev->msg_read_idx].flags;
*buf = dw_readl(dev, DW_IC_DATA_CMD);
- /* Ensure length byte is a valid value */
- if (flags & I2C_M_RECV_LEN &&
- *buf <= I2C_SMBUS_BLOCK_MAX && *buf > 0) {
- len = i2c_dw_recv_len(dev, *buf);
+ if (flags & I2C_M_RECV_LEN) {
+ /* Ensure length byte is a valid value */
+ if (*buf <= I2C_SMBUS_BLOCK_MAX && *buf > 0)
+ len = i2c_dw_recv_len(dev, *buf);
+ else
+ len = i2c_dw_recv_len(dev, len);
}
buf++;
dev->rx_outstanding--;
Powered by blists - more mailing lists