From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jean Delvare Subject: Re: [Intel-gfx] [PATCH 1/2] Give up on edid retries when i2c tells us that bus is not there Date: Thu, 20 Oct 2011 14:40:43 +0200 Message-ID: <20111020144043.799f81d9@endymion.delvare> References: <1318857150-2117-1-git-send-email-eugeni.dodonov@intel.com> <1318857150-2117-2-git-send-email-eugeni.dodonov@intel.com> <20111018151451.280f8f18@endymion.delvare> <20111020143339.59270702@endymion.delvare> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/u4/jVhfLCWMu.cZGV=_Zgbp" Return-path: Received: from services.gcu-squad.org (zone0.gcu-squad.org [212.85.147.21]) by gabe.freedesktop.org (Postfix) with ESMTP id 30C059E975 for ; Thu, 20 Oct 2011 05:40:53 -0700 (PDT) In-Reply-To: <20111020143339.59270702@endymion.delvare> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: Eugeni Dodonov Cc: Michael Buesch , dri-devel List-Id: dri-devel@lists.freedesktop.org --MP_/u4/jVhfLCWMu.cZGV=_Zgbp Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline Forgot to attach the patch, sorry. Here it is. -- Jean Delvare --MP_/u4/jVhfLCWMu.cZGV=_Zgbp Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=i2c-algo-bit-export-test.patch --- drivers/i2c/algos/i2c-algo-bit.c | 8 ++++++-- include/linux/i2c-algo-bit.h | 3 +++ 2 files changed, 9 insertions(+), 2 deletions(-) --- linux-3.1-rc10.orig/drivers/i2c/algos/i2c-algo-bit.c 2011-10-20 12:03:05.000000000 +0200 +++ linux-3.1-rc10/drivers/i2c/algos/i2c-algo-bit.c 2011-10-20 12:57:20.000000000 +0200 @@ -231,8 +231,11 @@ static int i2c_inb(struct i2c_adapter *i /* * Sanity check for the adapter hardware - check the reaction of * the bus lines only if it seems to be idle. + * Must be called with i2c_adap->bus_lock held if adapter is registered. + * This is done by surrounding the call to i2c_bit_test_bus() with + * i2c_lock_adapter(i2c_adap) and i2c_unlock_adapter(i2c_adap). */ -static int test_bus(struct i2c_adapter *i2c_adap) +int i2c_bit_test_bus(struct i2c_adapter *i2c_adap) { struct i2c_algo_bit_data *adap = i2c_adap->algo_data; const char *name = i2c_adap->name; @@ -320,6 +323,7 @@ bailout: return -ENODEV; } +EXPORT_SYMBOL_GPL(i2c_bit_test_bus); /* ----- Utility functions */ @@ -623,7 +627,7 @@ static int __i2c_bit_add_bus(struct i2c_ int ret; if (bit_test) { - ret = test_bus(adap); + ret = i2c_bit_test_bus(adap); if (ret < 0) return -ENODEV; } --- linux-3.1-rc10.orig/include/linux/i2c-algo-bit.h 2011-07-22 04:17:23.000000000 +0200 +++ linux-3.1-rc10/include/linux/i2c-algo-bit.h 2011-10-20 12:54:33.000000000 +0200 @@ -50,4 +50,7 @@ struct i2c_algo_bit_data { int i2c_bit_add_bus(struct i2c_adapter *); int i2c_bit_add_numbered_bus(struct i2c_adapter *); +/* Must be called with bus_lock held if adapter is registered */ +int i2c_bit_test_bus(struct i2c_adapter *); + #endif /* _LINUX_I2C_ALGO_BIT_H */ --MP_/u4/jVhfLCWMu.cZGV=_Zgbp Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/dri-devel --MP_/u4/jVhfLCWMu.cZGV=_Zgbp--