Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751731AbcDTVzX (ORCPT ); Wed, 20 Apr 2016 17:55:23 -0400 Received: from mail-bl2on0087.outbound.protection.outlook.com ([65.55.169.87]:40992 "EHLO na01-bl2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751179AbcDTVzV (ORCPT ); Wed, 20 Apr 2016 17:55:21 -0400 Authentication-Results: the-dreams.de; dkim=none (message not signed) header.d=none;the-dreams.de; dmarc=none action=none header.from=caviumnetworks.com; Message-ID: <5717FAC3.6010406@caviumnetworks.com> Date: Wed, 20 Apr 2016 14:55:15 -0700 From: David Daney User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130625 Thunderbird/17.0.7 MIME-Version: 1.0 To: Wolfram Sang CC: Jan Glauber , , Subject: Re: [PATCH v6 08/19] i2c: octeon: Enable High-Level Controller References: <34aac0bb7c0ae1c0ef7ca43d087059d04d9d8b09.1460387640.git.jglauber@cavium.com> <20160420214354.GD1546@katana> In-Reply-To: <20160420214354.GD1546@katana> Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [64.2.3.194] X-ClientProxiedBy: SN1PR0701CA0084.namprd07.prod.outlook.com (10.163.126.52) To SN1PR07MB2144.namprd07.prod.outlook.com (10.164.47.14) X-MS-Office365-Filtering-Correlation-Id: 27655b29-5a65-465c-35cd-08d369667698 X-Microsoft-Exchange-Diagnostics: 1;SN1PR07MB2144;2:YOgUFiaypO1JzWUboqpWAHPpq3P3l3abVAWO1fnWKgNcXxSnClKhrrHkZCZuyDctK4xW+q1tMyt51kqV2eIwRJtxW49g4siYGIngDcHNaEDXNsGNYJq+ar5iaFtsVULsKshteCBd4M0UqPOKmXB/PQCap7Dl3Vq2SPSQA1Z+yrt6togbhA4y78YfRGFuRkFQ;3:q4nFDkhBCv83Co90zUe9cSbutP8ll7+iZHBJuVtdUdV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RrPV1/LsRHUXUDHLhASYx6Yr9MI2WOcuZhrF/8ED7slliT+bC/ICK4w6uctLk= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(9101521026)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046);SRVR:SN1PR07MB2144;BCL:0;PCL:0;RULEID:;SRVR:SN1PR07MB2144; X-Microsoft-Exchange-Diagnostics: 1;SN1PR07MB2144;4:To25Mi66Rh9ViCRMSzTWtynAgg+sywJYkMY/smvKgDiBIVL0Ou4AYtu9A8bMPo6jUD6GDAZM/fIJhZO7hjxSa089mndrcAjE2S4y6PbnJOQALcX5CeAVTusUsQiBlJoHXb4xJmb5yJR9VIAUq7Vt5nxSvzScBqDpzEo7YvwSPVjjtyQjGaxVtctqLcyDX2U9oAl1/kEQRVVguLu7Y6NRxFOmbWL3ldjNYoRwo0VNR4mYNDZVTtejPG5Rp8VPA86NQNouU5ZsoevyeOvmh3UHoYZP1S2n1M7W1ldrAMm6lqMIj2QOifeLW/Z9peozBoTw9I2LBNCQW6Gg/H1Je9w/ByHkntnbx0Kr29bRLeBHF+IPk3Ybpuihf9ZDwo2wUHTzuMiHV01alLxChCx5aWSSPg== X-Forefront-PRVS: 0918748D70 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(6009001)(24454002)(377454003)(586003)(81166005)(77096005)(5008740100001)(36756003)(92566002)(189998001)(64126003)(1096002)(5004730100002)(4326007)(50466002)(53416004)(33656002)(47776003)(3846002)(6116002)(2950100001)(110136002)(87266999)(54356999)(76176999)(65816999)(50986999)(65806001)(80316001)(66066001)(2906002)(65956001)(42186005)(4001350100001)(23756003)(230700001);DIR:OUT;SFP:1101;SCL:1;SRVR:SN1PR07MB2144;H:dl.caveonetworks.com;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?iso-8859-1?Q?1;SN1PR07MB2144;23:p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pZM?= =?iso-8859-1?Q?ebKHXYRD8oyhRPQUO0XpdlTmiVPcUwIj3KLmYF/Vhu6tkv2wJlNFcRxBGy?= =?iso-8859-1?Q?wyq6jFc67G50rELsvDrJBuNCxym+DmtvzzkMsE3Is2yqY0HIvHPh+hZWYS?= =?iso-8859-1?Q?Kj3atezlXoVjgxy/CU1OjGwgJjt2JPFl6d0E=3D?= X-Microsoft-Exchange-Diagnostics: 1;SN1PR07MB2144;5:Z9o1YKBOYsMZWe+2L6SWGu1nfIIavqNfFOQxL0xxuYfY1tGoJr1oXnu7Nm0KQAaGlQBqJXugTJ9vsUuqFqOhbjlyW1r6RgUx7mCwrlfg9uY0iqWSaYIflBH7NrUNrSoOgjTFltZQsU1ANfVWXu1H1MT6xZAAsXOkxPSnmvfaQB6VILzRPvq4gCVL17kryjr7;24:qHW1yu2YdSboeFZqK7wViQj2iTR+cd4xUxV3nu8sfPmsz9EK3Aqu2CpLOMj4I2ERak9f1+Dtyo+7RntvmBmS5REW0WE84vOX9mNrBfAitQo=;7:KEEJ/EnZ6JwsseTiMK+D8EIhunmL0rQGvuujqNLIZxwcS7ejd2xG9yszsmxQNKp+yyWyqXCcf3BhfNZJE2Qe/JR6mKmgVBrAuQ21+6w+wejBVYm06c1lxLdKK+Zq5CufRRZX0msazE9eo9s3gSRywvCR3p+ZdQMM1M79HpJAYV8emqKV6lZFth0XEY1b0usdJRU0CzdLZl6RwAFT0NdfqDpuKdSL1Sa4nEPCOpJUTF0= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Apr 2016 21:55:18.3670 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR07MB2144 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1221 Lines: 44 On 04/20/2016 02:43 PM, Wolfram Sang wrote: > On Mon, Apr 11, 2016 at 05:28:39PM +0200, Jan Glauber wrote: [...] >> + */ >> +static int octeon_i2c_hlc_wait(struct octeon_i2c *i2c) >> +{ >> + int time_left; >> + >> + octeon_i2c_hlc_int_enable(i2c); >> + time_left = wait_event_interruptible_timeout(i2c->queue, >> + octeon_i2c_hlc_test_ready(i2c), >> + i2c->adap.timeout); > > Have you tested signal handling thoroughly? Most driver dropped the > _interruptible after a while. Mostly they found out that the state > machine of the interrupt handler couldn't gracefully deal with it and > nobody really needed the interruptible. Just saying. Good point. We know that exiting with a signal leaves us in an undefined state. We will have to think on this point. > >> + octeon_i2c_int_disable(i2c); >> + if (!time_left) { >> + octeon_i2c_hlc_int_clear(i2c); >> + dev_dbg(i2c->dev, "%s: timeout\n", __func__); >> + return -ETIMEDOUT; >> + } >> + >> + if (time_left < 0) { >> + dev_dbg(i2c->dev, "%s: wait interrupted\n", __func__); >> + return time_left; >> + } >> + return 0; >> +} > > Drop the debug messages? > > I can't say much about the HW details, of course. Didn't spot anything > suspicious there. >