From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mailapp01.imgtec.com ([195.59.15.196]:54608 "EHLO imgpgp01.kl.imgtec.org" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750910AbbG2MWZ (ORCPT ); Wed, 29 Jul 2015 08:22:25 -0400 Message-ID: <55B8C56A.7050102@imgtec.com> Date: Wed, 29 Jul 2015 13:22:02 +0100 From: James Hogan MIME-Version: 1.0 To: Sifan Naeem , Wolfram Sang , CC: "Stable kernel (v3.19+)" Subject: Re: [PATCH 7/8] i2c: img-scb: improve transaction complete handle References: <1437997641-32575-1-git-send-email-sifan.naeem@imgtec.com> <1437997641-32575-8-git-send-email-sifan.naeem@imgtec.com> In-Reply-To: <1437997641-32575-8-git-send-email-sifan.naeem@imgtec.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="38110gI8hgluvErkHAfFjgdAk8DTg7BRO" Sender: stable-owner@vger.kernel.org List-ID: --38110gI8hgluvErkHAfFjgdAk8DTg7BRO Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Hi Sifan, On 27/07/15 12:47, Sifan Naeem wrote: > Clear line status and all interrupts when transaction is complete, > as not doing so might leave unserviced interrupts that might be Do you have a specific example of when this might happen, and whether it could occur after img_i2c_complete_transaction()? I'm just wondering if it would be better to do this before starting every new message instead of after handling the last irq that is of interest (maybe somewhere in img_i2c_xfer). > handled in the context of a new transfer. Soft reset if the the > transfer failed to bring back the i2c block to a reset state. >=20 > Fixes: 27bce4 ("i2c: img-scb: Add Imagination Technologies I2C SCB driv= er") > Signed-off-by: Sifan Naeem > Cc: Stable kernel (v3.19+) > --- > drivers/i2c/busses/i2c-img-scb.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) >=20 > diff --git a/drivers/i2c/busses/i2c-img-scb.c b/drivers/i2c/busses/i2c-= img-scb.c > index 341130e..bbfee33 100644 > --- a/drivers/i2c/busses/i2c-img-scb.c > +++ b/drivers/i2c/busses/i2c-img-scb.c > @@ -626,7 +626,10 @@ static void img_i2c_complete_transaction(struct im= g_i2c *i2c, int status) > img_i2c_switch_mode(i2c, MODE_INACTIVE); > if (status) { > i2c->msg_status =3D status; > - img_i2c_transaction_halt(i2c, false); > + img_i2c_soft_reset(i2c); This seems like overkill. This will only happen in a couple of cases: (1) an automatic mode ack error, which is completely recoverable. (2) a fatal error (clock low timeout), which switches mode to MODE_FATAL anyway, preventing further transactions. Cheers James > + } else { > + img_i2c_writel(i2c, SCB_INT_CLEAR_REG, ~0); > + img_i2c_writel(i2c, SCB_CLEAR_REG, ~0); > } > complete(&i2c->msg_complete); > } >=20 --38110gI8hgluvErkHAfFjgdAk8DTg7BRO Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQIcBAEBAgAGBQJVuMVqAAoJEGwLaZPeOHZ6tIoP/2BoGTkFCESmoKV0I9Gq7OnC 4doQiR6h4RumBvBM99ZPOb2N3l3HE++/T0ii9bMXevyF+WMMgbloSn2q7iVnay5E slrjBlZgY13FoACQApNF1xBPObD9GgQMzn0XDzu7o2uLT2hSjbQCJOTI4cXymLhU ei4Y8EnGguFqMzvufd0IsSVDQZ33JtPFqCZYVmhWXVA1V6ANBKvpc7SHfW4SY6vg p5Mtpzz1k9ia3R/SoBbdYunPeyqyx7o9bK0uTc4ZDUj9JrGJKAMFYvYP/MWf1qx1 FOSq1b3PMONf04EbBFRq52Cx9tCli7R9M1y8iwPlIWwABP6kczOuwGDWaeutYYag LtlNlE6LPwOUx+V4ZhLExkmB1Kp84TIOZ/72qIZrnyrCHrZVJ0z/0DtHNx+Ya6DI notZkiytZl6waPFkJuarQBOAYLF929eNSanXgmM2n3Y2Ul0PcmDM9zMOBUpQBvjv ZFb3K331qzHMpb0VWt+BwObYUOi8gXZLbVO9WpXer7Dj8eGUXmCGMoVUU6XFT4f8 YjCsg14jHjDGlVNXM3199QzJi2+Ws6B+9tCbr/j+HG95PxWfimC7wEQgTi8TzgqA bSwMMGNGSBQPua88lZ8hxoyj5Qp/5G4fP17mExqbXnw22q8gqCR8cifKtTLiiiAN b57FJ9xbO/GE0nHf1NA0 =EJfV -----END PGP SIGNATURE----- --38110gI8hgluvErkHAfFjgdAk8DTg7BRO--