From patchwork Wed Apr 20 15:18:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Rosin X-Patchwork-Id: 8892191 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id D0366BF29F for ; Wed, 20 Apr 2016 15:36:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E1DC620145 for ; Wed, 20 Apr 2016 15:36:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C417820211 for ; Wed, 20 Apr 2016 15:36:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752331AbcDTPgT (ORCPT ); Wed, 20 Apr 2016 11:36:19 -0400 Received: from mail-db3on0119.outbound.protection.outlook.com ([157.55.234.119]:59727 "EHLO emea01-db3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752046AbcDTPgP (ORCPT ); Wed, 20 Apr 2016 11:36:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axentiatech.onmicrosoft.com; s=selector1-axentia-se; h=From:To:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=p+qWvlPjKwW/eEd4Oiaq+JlokKjirDi4CUpxlZC2d/w=; b=V6V/LpoIHT93puifE5b8o/Cl80LPp4f+7SokxTnPE55YTwrJz/SFtjK//K6cWQj3Iyqhfqlki/YLTqKzhLFBLaDA0W/0nmgVwMfTpBWCLT82KTwaGI0wXCXam1vA333Xo95QjtZOk1mQHchn4mwOuik7m01fxIyYnjoHNTcbbHg= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none; vger.kernel.org; dmarc=none action=none header.from=axentia.se; Received: from localhost.localdomain (217.210.101.82) by VI1PR02MB1312.eurprd02.prod.outlook.com (10.165.231.154) with Microsoft SMTP Server (TLS) id 15.1.466.19; Wed, 20 Apr 2016 15:21:01 +0000 From: Peter Rosin To: CC: Peter Rosin , Wolfram Sang , Jonathan Corbet , Peter Korsgaard , Guenter Roeck , Jonathan Cameron , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald , Antti Palosaari , Mauro Carvalho Chehab , Rob Herring , Frank Rowand , Grant Likely , Andrew Morton , "David S. Miller" , Greg Kroah-Hartman , Kalle Valo , Jiri Slaby , Daniel Baluta , Lucas De Marchi , Adriana Reus , Matt Ranostay , Krzysztof Kozlowski , Hans Verkuil , Terry Heo , Arnd Bergmann , Tommi Rantala , Crestez Dan Leonard , , , , , , Peter Rosin Subject: [PATCH v7 24/24] [media] rtl2832: regmap is aware of lockdep, drop local locking hack Date: Wed, 20 Apr 2016 17:18:04 +0200 Message-ID: <1461165484-2314-25-git-send-email-peda@axentia.se> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1461165484-2314-1-git-send-email-peda@axentia.se> References: <1461165484-2314-1-git-send-email-peda@axentia.se> MIME-Version: 1.0 X-Originating-IP: [217.210.101.82] X-ClientProxiedBy: DB3PR01CA0069.eurprd01.prod.exchangelabs.com (10.242.133.172) To VI1PR02MB1312.eurprd02.prod.outlook.com (10.165.231.154) X-MS-Office365-Filtering-Correlation-Id: a96a6dbd-ecf8-4b93-ab39-08d3692f64b8 X-Microsoft-Exchange-Diagnostics: 1; VI1PR02MB1312; 2:91FuLiD3lPY8aUiOl2w2KaaaldmOa6SndGl169FzY7m2YS02mQeHQW7sG9bo9M+c5deQg2GI8kPHZNzJ3lJKEnPT9ysWEtPlSBJt2nLgWJ10N5wiPE+ZNmdo3D6yCjTFyVkykhVK5CiUWJO1VQS1qDUxXtQMvQ0V0GYBuVvwNi5l0L5+rlCTi4MAZKFxGmdN; 3:l4xhSaq6NizNq/K1i2eiiVmh71ghxjH5hfTcqn8MoSxfv5yJzKgRgkmUi9hrauMTPdyhn/NQzuwd+MzMyWCIaMpsdL6nZUeNcxlAqXo7I34IK+Xu71/o8FSq8iXq1iOZ X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:VI1PR02MB1312; X-Microsoft-Exchange-Diagnostics: 1; VI1PR02MB1312; 25:NHWMWwPdGPMvSKz5sdN37lAthDJbO+JqhSOEt2rt/+rgMXtdxZOIXHqBfUx+Z4wd5aAnEsScRU5NVJ/acbVeH7nwXw8H14Zhh/KaKLSU5mLeLwWXswyFxk85kYwj4Ogp8gjKKKnZ9S01TZshXSmE2nQg8qHvbjnXhn1yFygJpC80nZuh/lwSVsWa9c3xEYhVYlt9gH/817p33NcNtGxYxfFP8TnNlh4AMkA38dmptLdtQn6Bzxkiea0CidyyyK2Nw8xJSG8YCqQ58DBL0f2kQSapqP/To2w1+tyh7BelXoa++4STAUnEw98xH166RSv2OMt8aXJCzemx3/t7US5N49/AG+YS0Ylnom4BSUnAJpC3dTlSd8eJa1PQrEG8uyKZRyJan2OXEW3mfQGfmdtTT/1vfhVMZGxLAgpd0TmZcJsBHZPDGvjGF95lwVRVAT5gwV3WBNuKRIhmTMHg/W+5UBJEQc1dOozqqOmoPSjK/Q+b4aQxHWSmBeOYEPBzEhKMe/W+Myq4zScLVhfAOwE/tentY88B7fllpg9olLf/l6Zl8k1X1sdQYdAMy+WoqqlAe5woUg3vg+Rxdfzjn1uBd88Euddx3NtDwxQeSWPpx9obB73E2qbTQaDyYIdZ6O8KimMcre2MWQRRNOs077VjOA== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(9101521026)(6040130)(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6041046)(6043046); SRVR:VI1PR02MB1312; BCL:0; PCL:0; RULEID:; SRVR:VI1PR02MB1312; X-Microsoft-Exchange-Diagnostics: 1; VI1PR02MB1312; 4:JF9/97lTObIFFsDmcV1nYZGn3mFX/w02Bm1X/Sp+XqB40mQis8sorP1e8r1SwGA7CyzlIkgUX9qEOcqVQBo4sWeyU199s7DvA7Qg6+8Vx5X4FKX/E4zwddmwsclRqIBMlRdV7/FvKHrLIg/ZzMjGz7bYO5o4NRSnsrueg45QBfefuxoAuYP/d6EfCPrWbas69UsUq0IujmmHrop95f19ga0dnQmQsENVIuc3DZz3WVaZ+u/pyimtYsywdU5d/t456+IowW28VQisuRPqO8X3CmIA8Xd+fwCuLY3PuYYC34bgxnkBl0J6jQ1MdbS8bUPS2lCDl9btGTWuTbptvnAMe14/+c81I31f5DHYd5F4dMo7pMblVjkJC3L3dy4h2Q1yK3BbuCaH+U61g8rNQ2c5OTJJ+sg+nJFblzC85bJaLGSJDkHMwY+LCDdg9i85iMVIDIH3O5XPmiRbwYCLytwzIA== X-Forefront-PRVS: 0918748D70 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(6069001)(66066001)(2906002)(19580395003)(19580405001)(110136002)(92566002)(189998001)(5008740100001)(47776003)(42186005)(33646002)(6116002)(3846002)(5003940100001)(586003)(81166005)(48376002)(2950100001)(4326007)(50466002)(76176999)(1096002)(50226001)(77096005)(50986999)(36756003)(86362001)(2351001)(229853001)(74482002)(5004730100002)(7059030)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:VI1PR02MB1312; H:localhost.localdomain; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR02MB1312; 23:pblaUde6O16jdb01563rBrYZP8BlBBE7qul2XAQDy?= =?us-ascii?Q?nb36G5hKwzrgX7g/ZXr/w7ExRS+Miik9LBhLdWECA708iy8UaWZWlgEZZ0+U?= =?us-ascii?Q?xyLeMXAh/PZsbR4rKiahWyvq9nmeGkLgjg5cn0zU5rG8GYGj2ED+qa92Vq/M?= =?us-ascii?Q?X7AD2JguzsrmO0Qa68FPQYSkhjaqZcLZLmqPphIMShmdjhMCJutbQxU7+IYy?= =?us-ascii?Q?W4t3SKk4J533zRV53QNlXNiyjYnp1ao9S4UM41GIg1zG+siagauhPLbQFarG?= =?us-ascii?Q?zEA8RWFKT8ixumVjcpLgjlMtYKOvJkOtI1fGIduym4xnA8bqcwH4fUVSich8?= =?us-ascii?Q?SslD0ByJtcqRgoEOoCr+3HXrGkL2rGMfsjeFksRVg7lDRfj6Kc7cMX9cYzFT?= =?us-ascii?Q?d2jLn+EMZLttQescM0PltchqVHRrav1NHNdULVtsLPkPHar4/CS/BsDJeQxw?= =?us-ascii?Q?bL/SSfTTSCp9GII6cbYzXeLihhHqnVIeqMGNvorvAKGHnyT6YP3FmPapRjgG?= =?us-ascii?Q?RDPWdOemzSmXQv69xqotlxCgoKkoASx0Vf+B9Gozs7SJ5fWK8FM3ZQKqiDhA?= =?us-ascii?Q?5lQmi3jFyQvrS/vAZBySYjBqT6YmJdlZW3R6J9e6Fh1fm337pJ1r33dkCJ9h?= =?us-ascii?Q?gKuRtdzFERaJnC7tAIFiu46GPrDeljE3AyR+a/4t91CB5ihblESWX2f3vSmw?= =?us-ascii?Q?9RZYg7c6rQFepA+tGOavFpWUMPE9EIn+7T9/fVpsyFVJmUlTojXSDze3rfKI?= =?us-ascii?Q?TWVBlOl4VT86/FKcJ4YKpcVHf6k9nf7dj04+2eeuzaPpGaRZ6Avd4Ad3JREI?= =?us-ascii?Q?Za8Xa/8Zo50q2/Z9PNqur5E+QXqugy08TnIrUYOLO0jArkWvZk1EEEcabpFX?= =?us-ascii?Q?sOrGx9rDTEmwY47iMB7pWWcyrLlsuKEfqiFMi/h5z9nH9bAyKFKJFNFu0jJb?= =?us-ascii?Q?8h4IH6h4aEFfE9ifiWQNa6IyDevE1LN8FcklzPE2w=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; VI1PR02MB1312; 5:Sq9rfn5EJlgUnc+yNRtk6h0wrKrBfAiu73obg55AtjIxJSlOdaVJhbtBpMFYWwD0PTXQyVmKTAvKRebmpPi/16FSIqciI2UeJFbS9omG9G5hH0Zw+66CHD8/3yZlh0/bmQQ1Xq8Spi3oIHoBibtADqAB7CR8rXzpprNmiuXBIhhT2WBiUKLfh0U5t7T+Di40; 24:ZQXVx8D2D6UdYKOvmq0/vjofsdHle861w/WDxkW163Bmo7p8A5fuCYeppBHoMWDYFBYvdzItbstbUUedYSKZ7jHXf4z0X6k8c3rdNrjYui4=; 7:/PiUjrFHfexySj5JLtHu5pj83Pez/gmwF0204m9jZumf0K2H6f4A0U3VSgrlOsD/iMaa4UdrwSAJ6o3i2a9VyndeDxDsIPNMG3q2PIynn9xllY9TpkVozWGATwYFYY1fq/ool/8CSYEXfQopTW2hR7LRSTG4jX72Rx3tLEtwwQJRIQ+FPJMizHN4REguFdDn7/2qfgM2nHoQuqm5Z2gGbK9cK4bxUbVD7J+5iS/8sIs= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: axentia.se X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Apr 2016 15:21:01.1698 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR02MB1312 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Reviewed-by: Antti Palosaari Signed-off-by: Peter Rosin --- drivers/media/dvb-frontends/rtl2832.c | 30 ------------------------------ drivers/media/dvb-frontends/rtl2832_priv.h | 1 - 2 files changed, 31 deletions(-) diff --git a/drivers/media/dvb-frontends/rtl2832.c b/drivers/media/dvb-frontends/rtl2832.c index 957523f07f61..bfb6beedd40b 100644 --- a/drivers/media/dvb-frontends/rtl2832.c +++ b/drivers/media/dvb-frontends/rtl2832.c @@ -890,32 +890,6 @@ static bool rtl2832_volatile_reg(struct device *dev, unsigned int reg) return false; } -/* - * FIXME: Hack. Implement own regmap locking in order to silence lockdep - * recursive lock warning. That happens when regmap I2C client calls I2C mux - * adapter, which leads demod I2C repeater enable via demod regmap. Operation - * takes two regmap locks recursively - but those are different regmap instances - * in a two different I2C drivers, so it is not deadlock. Proper fix is to make - * regmap aware of lockdep. - */ -static void rtl2832_regmap_lock(void *__dev) -{ - struct rtl2832_dev *dev = __dev; - struct i2c_client *client = dev->client; - - dev_dbg(&client->dev, "\n"); - mutex_lock(&dev->regmap_mutex); -} - -static void rtl2832_regmap_unlock(void *__dev) -{ - struct rtl2832_dev *dev = __dev; - struct i2c_client *client = dev->client; - - dev_dbg(&client->dev, "\n"); - mutex_unlock(&dev->regmap_mutex); -} - static struct dvb_frontend *rtl2832_get_dvb_frontend(struct i2c_client *client) { struct rtl2832_dev *dev = i2c_get_clientdata(client); @@ -1082,12 +1056,8 @@ static int rtl2832_probe(struct i2c_client *client, dev->sleeping = true; INIT_DELAYED_WORK(&dev->i2c_gate_work, rtl2832_i2c_gate_work); /* create regmap */ - mutex_init(&dev->regmap_mutex); dev->regmap_config.reg_bits = 8, dev->regmap_config.val_bits = 8, - dev->regmap_config.lock = rtl2832_regmap_lock, - dev->regmap_config.unlock = rtl2832_regmap_unlock, - dev->regmap_config.lock_arg = dev, dev->regmap_config.volatile_reg = rtl2832_volatile_reg, dev->regmap_config.max_register = 5 * 0x100, dev->regmap_config.ranges = regmap_range_cfg, diff --git a/drivers/media/dvb-frontends/rtl2832_priv.h b/drivers/media/dvb-frontends/rtl2832_priv.h index d8f97d14f6fd..c1a8a69e9015 100644 --- a/drivers/media/dvb-frontends/rtl2832_priv.h +++ b/drivers/media/dvb-frontends/rtl2832_priv.h @@ -33,7 +33,6 @@ struct rtl2832_dev { struct rtl2832_platform_data *pdata; struct i2c_client *client; - struct mutex regmap_mutex; struct regmap_config regmap_config; struct regmap *regmap; struct i2c_mux_core *muxc;