Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S263880AbVBCTnX (ORCPT ); Thu, 3 Feb 2005 14:43:23 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S263625AbVBCTTv (ORCPT ); Thu, 3 Feb 2005 14:19:51 -0500 Received: from gateway-1237.mvista.com ([12.44.186.158]:21493 "EHLO av.mvista.com") by vger.kernel.org with ESMTP id S263636AbVBCTMp (ORCPT ); Thu, 3 Feb 2005 14:12:45 -0500 Message-ID: <4202779C.6010304@mvista.com> Date: Thu, 03 Feb 2005 12:12:28 -0700 From: "Mark A. Greer" User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030701 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Alexey Dobriyan CC: Greg KH , phil@netroedge.com, sensors@stimpy.netroedge.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH][I2C] Marvell mv64xxx i2c driver References: <200502020315.14281.adobriyan@mail.ru> <42010D5A.4090302@mvista.com> <200502031556.59319.adobriyan@mail.ru> In-Reply-To: <200502031556.59319.adobriyan@mail.ru> Content-Type: multipart/mixed; boundary="------------000403080908090506040000" Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 32105 Lines: 553 This is a multi-part message in MIME format. --------------000403080908090506040000 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi, Alexey. -- Alexey Dobriyan wrote: >On Wednesday 02 February 2005 19:26, Mark A. Greer wrote: > > > >>How's this (a complete replacement for previous patch)? >> >> > > > >>--- a/drivers/i2c/busses/Kconfig >>+++ b/drivers/i2c/busses/Kconfig >> >> > > > >>+ If you say yes to this option, support will be included for the >>+ built-in I2C interface on the Marvell 64xxx line of host bridges >> >> > >Dot at the end. Should have noticed it earlier... > Gahh, I noticed that too a while back. I thought I'd fixed it... Done. > > >>+ if (drv_data->state == MV64XXX_I2C_STATE_IDLE) { >>+ drv_data->action = MV64XXX_I2C_ACTION_SEND_STOP; >>+ drv_data->state = MV64XXX_I2C_STATE_IDLE; >> >> > >drv_data->state is already MV64XXX_I2C_STATE_IDLE. Gcc will probably optimize >this line away, but... > Done away with. > > >>+ } >>+ else { >> >> > >It should be "} else {" according to CodingStyle. > Done. > > >>+static int >>+mv64xxx_i2c_intr(int irq, void *dev_id, struct pt_regs *regs) >> >> > > > >>+ while (readl(drv_data->reg_base + MV64XXX_I2C_REG_CONTROL) & >>+ MV64XXX_I2C_REG_CONTROL_IFLG) { >>+ status = readl(drv_data->reg_base + MV64XXX_I2C_REG_STATUS); >>+ mv64xxx_i2c_fsm(drv_data, status); >> >> > >It can set drv_data->rc to -ENODEV or -EIO. In both cases ->action goes to >MV64XXX_I2C_ACTION_SEND_STOP and mv64xxx_i2c_do_action() will writel() >something. Is it correct to _not_ check ->rc here? > I think so. It still needs to go into do_action even when rc != 0 (in which case it'll do a STOP condition). > If it isn't then would it be >better to make all functions that set it return -E___ instead and drop >struct mv64xxx_i2c_data.rc altogether? > I may not be understanding what you mean but I think I need something like mv64xxx_i2c_data.rc or a plain old global to hang onto the return code. I need that so when the wait_event_interruptible_timeout() returns, that thread can find out what happened while it was blocked. This is what I mean: - calling thread enters i2c_xfer - eventually the initial i2c action is executed and the thread blocks in wait_event_interruptible_timeout() - other processes run - several interrupts happen, last one causing an error which is stored in mv64xxx_i2c_data.rc - do_action issues a stop on the i2c bus - thread is unblocked and now has to dig out the rc from mv64xxx_i2c_data.rc Or am I not understanding what you mean? >+ >+ if (!time_left <= 0) { > > > >Confusing. You meant "if (time_left)" or "if (time_left > 0)"? > No, I'm blind. I meant "if (time_left <=0)". Should be fixed now. Good catch. > > >>+static struct i2c_algorithm mv64xxx_i2c_algo = { >>+ .name = MV64XXX_I2C_CTLR_NAME "algorithm", >> >> > >MV64XXX_I2C_CTLR_NAME doesn't end with space. " algorithm" here. > Space added. > > >>+ dev_err(dev, "mv64xxx: Can't register intr handler " >>+ "irq: %d\\n", drv_data->irq); >> >> > >You snipped s# \\n # \n # suggestion in my previous email. ;-) > Ah, got it this time. :) This patch is a replacement patch that should address your concerns except maybe the mv64xxx_i2c_data.rc one. Signed-off-by: Mark A. Greer -- --------------000403080908090506040000 Content-Type: text/plain; name="i2c_6.patch" Content-Transfer-Encoding: base64 Content-Disposition: inline; filename="i2c_6.patch" ZGlmZiAtTnJ1IGEvZHJpdmVycy9pMmMvYnVzc2VzL0tjb25maWcgYi9kcml2ZXJzL2kyYy9i dXNzZXMvS2NvbmZpZwotLS0gYS9kcml2ZXJzL2kyYy9idXNzZXMvS2NvbmZpZwkyMDA1LTAy LTAzIDEyOjEwOjM1IC0wNzowMAorKysgYi9kcml2ZXJzL2kyYy9idXNzZXMvS2NvbmZpZwky MDA1LTAyLTAzIDEyOjEwOjM1IC0wNzowMApAQCAtNDc2LDQgKzQ3NiwxNCBAQAogCSAgVGhp cyBkcml2ZXIgY2FuIGFsc28gYmUgYnVpbHQgYXMgYSBtb2R1bGUuICBJZiBzbywgdGhlIG1v ZHVsZQogCSAgd2lsbCBiZSBjYWxsZWQgaTJjLXBjYS1pc2EuCiAKK2NvbmZpZyBJMkNfTVY2 NFhYWAorCXRyaXN0YXRlICJNYXJ2ZWxsIG12NjR4eHggSTJDIENvbnRyb2xsZXIiCisJZGVw ZW5kcyBvbiBJMkMgJiYgTVY2NFg2MCAmJiBFWFBFUklNRU5UQUwKKwloZWxwCisJICBJZiB5 b3Ugc2F5IHllcyB0byB0aGlzIG9wdGlvbiwgc3VwcG9ydCB3aWxsIGJlIGluY2x1ZGVkIGZv ciB0aGUKKwkgIGJ1aWx0LWluIEkyQyBpbnRlcmZhY2Ugb24gdGhlIE1hcnZlbGwgNjR4eHgg bGluZSBvZiBob3N0IGJyaWRnZXMuCisKKwkgIFRoaXMgZHJpdmVyIGNhbiBhbHNvIGJlIGJ1 aWx0IGFzIGEgbW9kdWxlLiAgSWYgc28sIHRoZSBtb2R1bGUKKwkgIHdpbGwgYmUgY2FsbGVk IGkyY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OworCQkJZHJ2X2RhdGEtPmJ5 dGVzX2xlZnQtLTsKKwkJfQorCX0gZWxzZSB7CisJCWRydl9kYXRhLT5hY3Rpb24gPSBNVjY0 WFhYX0kyQ19BQ1RJT05fU0VORF9TVEFSVDsKKwkJZHJ2X2RhdGEtPnN0YXRlID0gTVY2NFhY WF9JMkNfU1RBVEVfV0FJVElOR19GT1JfU1RBUlRfQ09ORDsKKwl9CisKKwlkcnZfZGF0YS0+ YmxvY2sgPSAxOworCW12NjR4eHhfaTJjX2RvX2FjdGlvbihkcnZfZGF0YSk7CisJc3Bpbl91 bmxvY2tfaXJxcmVzdG9yZSgmZHJ2X2RhdGEtPmxvY2ssIGZsYWdzKTsKKworCW12NjR4eHhf aTJjX3dhaXRfZm9yX2NvbXBsZXRpb24oZHJ2X2RhdGEpOworCXJldHVybiBkcnZfZGF0YS0+ cmM7Cit9CisKKy8qCisgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKKyAqCisgKglJMkMgQ29y ZSBTdXBwb3J0IFJvdXRpbmVzIChJbnRlcmZhY2UgdG8gaGlnaGVyIGxldmVsIEkyQyBjb2Rl KQorICoKKyAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKgorICovCitzdGF0aWMgdTMyCittdjY0 eHh4X2kyY19mdW5jdGlvbmFsaXR5KHN0cnVjdCBpMmNfYWRhcHRlciAqYWRhcCkKK3sKKwly ZXR1cm4gSTJDX0ZVTkNfSTJDIHwgSTJDX0ZVTkNfMTBCSVRfQUREUiB8IEkyQ19GVU5DX1NN QlVTX0VNVUw7Cit9CisKK3N0YXRpYyBpbnQKK212NjR4eHhfaTJjX3hmZXIoc3RydWN0IGky Y19hZGFwdGVyICphZGFwLCBzdHJ1Y3QgaTJjX21zZyBtc2dzW10sIGludCBudW0pCit7CisJ c3RydWN0IG12NjR4eHhfaTJjX2RhdGEgKmRydl9kYXRhID0gaTJjX2dldF9hZGFwZGF0YShh ZGFwKTsKKwlpbnQJaSwgcmMgPSAwOworCisJZm9yIChpPTA7IGk8bnVtOyBpKyspCisJCWlm ICgocmMgPSBtdjY0eHh4X2kyY19leGVjdXRlX21zZyhkcnZfZGF0YSwgJm1zZ3NbaV0pKSAh PSAwKQorCQkJYnJlYWs7CisKKwlyZXR1cm4gcmM7Cit9CisKK3N0YXRpYyBzdHJ1Y3QgaTJj X2FsZ29yaXRobSBtdjY0eHh4X2kyY19hbGdvID0geworCS5uYW1lID0gTVY2NFhYWF9JMkNf Q1RMUl9OQU1FICIgYWxnb3JpdGhtIiwKKwkuaWQgPSBJMkNfQUxHT19NVjY0WFhYLAorCS5t YXN0ZXJfeGZlciA9IG12NjR4eHhfaTJjX3hmZXIsCisJLmZ1bmN0aW9uYWxpdHkgPSBtdjY0 eHh4X2kyY19mdW5jdGlvbmFsaXR5LAorfTsKKworLyoKKyAqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKgorICoKKyAqCURyaXZlciBJbnRlcmZhY2UgJiBFYXJseSBJbml0IFJvdXRpbmVzCisg KgorICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqCisgKi8KK3N0YXRpYyB2b2lkIF9fZGV2aW5p dAorbXY2NHh4eF9pMmNfaHdfaW5pdChzdHJ1Y3QgbXY2NHh4eF9pMmNfZGF0YSAqZHJ2X2Rh dGEpCit7CisJd3JpdGVsKDAsIGRydl9kYXRhLT5yZWdfYmFzZSArIE1WNjRYWFhfSTJDX1JF R19TT0ZUX1JFU0VUKTsKKwl3cml0ZWwoKCgoZHJ2X2RhdGEtPmZyZXFfbSAmIDB4ZikgPDwg MykgfCAoZHJ2X2RhdGEtPmZyZXFfbiAmIDB4NykpL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HgxNzAwMDAgLSBVU0IJCSovCisJCQkJCS8qIDB4MTgwMDAwIC0gVmly dHVhbCBidXNlcwkqLworI2RlZmluZSBJMkNfQUxHT19NVjY0WFhYIDB4MTkwMDAwICAgICAg IC8qIE1hcnZlbGwgbXY2NHh4eCBpMmMgY3RscgkqLwogCiAjZGVmaW5lIEkyQ19BTEdPX0VY UAkweDgwMDAwMAkvKiBleHBlcmltZW50YWwJCQkqLwogCkBAIC0zMDUsNSArMzA4LDggQEAK IAogLyogLS0tIE1DUDEwNyBhZGFwdGVyICovCiAjZGVmaW5lIEkyQ19IV19NUEMxMDcgMHgw MAorCisvKiAtLS0gTWFydmVsbCBtdjY0eHh4IGkyYyBhZGFwdGVyICovCisjZGVmaW5lIEky Q19IV19NVjY0WFhYIDB4MDAKIAogI2VuZGlmIC8qIExJTlVYX0kyQ19JRF9IICovCmRpZmYg LU5ydSBhL2luY2x1ZGUvbGludXgvbXY2NDN4eC5oIGIvaW5jbHVkZS9saW51eC9tdjY0M3h4 LmgKLS0tIGEvaW5jbHVkZS9saW51eC9tdjY0M3h4LmgJMjAwNS0wMi0wMyAxMjoxMDozNSAt MDc6MDAKKysrIGIvaW5jbHVkZS9saW51eC9tdjY0M3h4LmgJMjAwNS0wMi0wMyAxMjoxMDoz NSAtMDc6MDAKQEAgLTk3NywxMiArOTc3LDkgQEAKIC8qIEkyQyBSZWdpc3RlcnMgICAgICAg ICAgICAgICAgICAgICAgICAqLwogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKiovCiAKLSNkZWZpbmUgTVY2NDM0MF9JMkNfU0xBVkVfQUREUiAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhjMDAwCi0jZGVmaW5lIE1WNjQzNDBfSTJD X0VYVEVOREVEX1NMQVZFX0FERFIgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4YzAx MAotI2RlZmluZSBNVjY0MzQwX0kyQ19EQVRBICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAweGMwMDQKLSNkZWZpbmUgTVY2NDM0MF9JMkNfQ09OVFJPTCAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMHhjMDA4Ci0jZGVmaW5l IE1WNjQzNDBfSTJDX1NUQVRVU19CQVVERV9SQVRFICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIDB4YzAwQwotI2RlZmluZSBNVjY0MzQwX0kyQ19TT0ZUX1JFU0VUICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAweGMwMWMKKyNkZWZpbmUgTVY2NFhYWF9J MkNfQ1RMUl9OQU1FCQkJCQkibXY2NHh4eCBpMmMiCisjZGVmaW5lIE1WNjRYWFhfSTJDX09G RlNFVCAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDB4YzAwMAor I2RlZmluZSBNVjY0WFhYX0kyQ19SRUdfQkxPQ0tfU0laRSAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAweDAwMjAKIAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKiovCiAvKiBHUFAgSW50ZXJmYWNlIFJlZ2lzdGVycyAgICAgICAgICAgICAg Ki8KQEAgLTEwODMsNiArMTA4MCwxNCBAQAogCXU4CWJyZ19jYW5fdHVuZTsKIAl1OAlicmdf Y2xrX3NyYzsKIAl1MzIJYnJnX2Nsa19mcmVxOworfTsKKworLyogaTJjIFBsYXRmb3JtIERl dmljZSwgRHJpdmVyIERhdGEgKi8KK3N0cnVjdCBtdjY0eHh4X2kyY19wZGF0YSB7CisJdTMy CWZyZXFfbTsKKwl1MzIJZnJlcV9uOworCXUzMgl0aW1lb3V0OwkvKiBJbiBtaWxsaXNlY29u ZHMgKi8KKwl1MzIJcmV0cmllczsKIH07CiAKICNlbmRpZiAvKiBfX0FTTV9NVjY0MzQwX0gg Ki8K --------------000403080908090506040000-- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/