diff mbox series

[RESEND,v3,1/1] i2c: qcom-geni: Disable DMA processing on the Lenovo Yoga C630

Message ID 20190905192412.23116-1-lee.jones@linaro.org
State Accepted
Commit 127068abe85bf3dee50df51cb039a5a987a4a666
Headers show
Series [RESEND,v3,1/1] i2c: qcom-geni: Disable DMA processing on the Lenovo Yoga C630 | expand

Commit Message

Lee Jones Sept. 5, 2019, 7:24 p.m. UTC
We have a production-level laptop (Lenovo Yoga C630) which is exhibiting
a rather horrific bug.  When I2C HID devices are being scanned for at
boot-time the QCom Geni based I2C (Serial Engine) attempts to use DMA.
When it does, the laptop reboots and the user never sees the OS.

Attempts are being made to debug the reason for the spontaneous reboot.
No luck so far, hence the requirement for this hot-fix.  This workaround
will be removed once we have a viable fix.

Signed-off-by: Lee Jones <lee.jones@linaro.org>

---
 drivers/i2c/busses/i2c-qcom-geni.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

-- 
2.17.1

Comments

Lee Jones Sept. 6, 2019, 7:56 a.m. UTC | #1
On Fri, 06 Sep 2019, Wolfram Sang wrote:
> > > This compatible isn't in the 5.3 rc series nor is it in linux-next yet.

> > > Is this "hot-fix" for the next merge window? Or is this compatible

> > > string being generated by firmware somewhere and thus isn't part of the

> > > kernel?

> > 

> > It's on the list and will be in all of the distro v5.3 release kernels.

> > 

> > https://lkml.org/lkml/2019/9/5/695

> 

> And why don't the distro kernels simply pick up this patch, too?


I could send it to them and find out.  They are on kernel-freeze now,
on the lead-up to the release date (next month), but I think they're
still taking bug fixes.

-- 
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
Wolfram Sang Sept. 6, 2019, 10:23 a.m. UTC | #2
On Fri, Sep 06, 2019 at 08:56:00AM +0100, Lee Jones wrote:
> On Fri, 06 Sep 2019, Wolfram Sang wrote:

> > > > This compatible isn't in the 5.3 rc series nor is it in linux-next yet.

> > > > Is this "hot-fix" for the next merge window? Or is this compatible

> > > > string being generated by firmware somewhere and thus isn't part of the

> > > > kernel?

> > > 

> > > It's on the list and will be in all of the distro v5.3 release kernels.

> > > 

> > > https://lkml.org/lkml/2019/9/5/695

> > 

> > And why don't the distro kernels simply pick up this patch, too?

> 

> I could send it to them and find out.  They are on kernel-freeze now,

> on the lead-up to the release date (next month), but I think they're

> still taking bug fixes.


Please do.
Rob Clark Sept. 7, 2019, 5:56 p.m. UTC | #3
On Sat, Sep 7, 2019 at 9:17 AM Wolfram Sang <wsa@the-dreams.de> wrote:
>

>

> > Does this mean you plan to have this merged for v5.4?

>

> Only if the machine DTS is expected to land in 5.4. But Stephen said it

> is not in liunx-next yet?

>


It appears to be in arm-soc for-next:

https://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc.git/log/?h=for-next

BR,
-R
Lee Jones Sept. 14, 2019, 8:57 a.m. UTC | #4
On Fri, 13 Sep 2019, Wolfram Sang wrote:

> 

> > It seems linux-next is now pulling from the soc.git, rather than

> > arm-soc.git, but Arnd is still pushing patches to arm-soc.git.

> 

> Can you ask them to fix this?


Linux next is on vacation for month.

The last tag was next-20190904.

> > Arnd says that the patch will be in v5.4 and I merged Arnd's tree and

> > gave it a spin here and this patch makes it boot. So please merge this

> > patch for v5.4 as well.

> 

> No worries, this is clearly a bugfix. So it will easily go in with the

> same release as the DTS file.


Thanks.  The DTS commit will go in for v5.4.

-- 
Lee Jones [李琼斯]
Linaro Services Technical Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
Arnd Bergmann Sept. 14, 2019, 7:13 p.m. UTC | #5
On Fri, Sep 13, 2019 at 6:13 PM Bjorn Andersson
<bjorn.andersson@linaro.org> wrote:
>

> On Fri 13 Sep 07:28 PDT 2019, Wolfram Sang wrote:

>

> > On Sat, Sep 07, 2019 at 10:56:34AM -0700, Rob Clark wrote:

> > > On Sat, Sep 7, 2019 at 9:17 AM Wolfram Sang <wsa@the-dreams.de> wrote:

> > > >

> > > >

> > > > > Does this mean you plan to have this merged for v5.4?

> > > >

> > > > Only if the machine DTS is expected to land in 5.4. But Stephen said it

> > > > is not in liunx-next yet?

> > > >

> > >

> > > It appears to be in arm-soc for-next:

> > >

> > > https://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc.git/log/?h=for-next

> >

> > Still not in linux-next. Please ping me or resend this patch once it

> > hits linux-next.

> >

>

> It seems linux-next is now pulling from the soc.git, rather than

> arm-soc.git, but Arnd is still pushing patches to arm-soc.git.


I'm still pushing identical contents to both, but plan to remove the old
tree after the merge window.

      Arnd
Wolfram Sang Sept. 28, 2019, 5:48 p.m. UTC | #6
On Thu, Sep 05, 2019 at 08:24:12PM +0100, Lee Jones wrote:
> We have a production-level laptop (Lenovo Yoga C630) which is exhibiting

> a rather horrific bug.  When I2C HID devices are being scanned for at

> boot-time the QCom Geni based I2C (Serial Engine) attempts to use DMA.

> When it does, the laptop reboots and the user never sees the OS.

> 

> Attempts are being made to debug the reason for the spontaneous reboot.

> No luck so far, hence the requirement for this hot-fix.  This workaround

> will be removed once we have a viable fix.

> 

> Signed-off-by: Lee Jones <lee.jones@linaro.org>


Applied to for-current, thanks!
diff mbox series

Patch

diff --git a/drivers/i2c/busses/i2c-qcom-geni.c b/drivers/i2c/busses/i2c-qcom-geni.c
index a89bfce5388e..17abf60c94ae 100644
--- a/drivers/i2c/busses/i2c-qcom-geni.c
+++ b/drivers/i2c/busses/i2c-qcom-geni.c
@@ -355,11 +355,13 @@  static int geni_i2c_rx_one_msg(struct geni_i2c_dev *gi2c, struct i2c_msg *msg,
 {
 	dma_addr_t rx_dma;
 	unsigned long time_left;
-	void *dma_buf;
+	void *dma_buf = NULL;
 	struct geni_se *se = &gi2c->se;
 	size_t len = msg->len;
 
-	dma_buf = i2c_get_dma_safe_msg_buf(msg, 32);
+	if (!of_machine_is_compatible("lenovo,yoga-c630"))
+		dma_buf = i2c_get_dma_safe_msg_buf(msg, 32);
+
 	if (dma_buf)
 		geni_se_select_mode(se, GENI_SE_DMA);
 	else
@@ -394,11 +396,13 @@  static int geni_i2c_tx_one_msg(struct geni_i2c_dev *gi2c, struct i2c_msg *msg,
 {
 	dma_addr_t tx_dma;
 	unsigned long time_left;
-	void *dma_buf;
+	void *dma_buf = NULL;
 	struct geni_se *se = &gi2c->se;
 	size_t len = msg->len;
 
-	dma_buf = i2c_get_dma_safe_msg_buf(msg, 32);
+	if (!of_machine_is_compatible("lenovo,yoga-c630"))
+		dma_buf = i2c_get_dma_safe_msg_buf(msg, 32);
+
 	if (dma_buf)
 		geni_se_select_mode(se, GENI_SE_DMA);
 	else