From patchwork Wed Jun 20 05:17:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Rosin X-Patchwork-Id: 10476081 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 73709600F6 for ; Wed, 20 Jun 2018 05:23:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 614F328C88 for ; Wed, 20 Jun 2018 05:23:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5530828DD0; Wed, 20 Jun 2018 05:23:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, DKIM_VALID, MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D61C928C88 for ; Wed, 20 Jun 2018 05:23:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=51n6MInxcH9/BhscLRl+ceIaQbHAUmduqVLUp506zXk=; b=ukO9lWbcebzbTK 1+gyXMcZIYPE3sEX5u0j0jcRIpxZr0GhOla+kf2/trTHXNvyJEC8v5e/jTXWwiHE/RsrWNIHh2Z13 xMSb7aPupBeQ3pOb9tUf5y/kv3VBWddjzITXpbkADbvyuLLQd1y3tJgRRx+mSNNH4NHfchLwNLXfp SDuPF2jU+jJzCJK5Ck4FtNxOJkHQUgQsfqy6IYy1jpg4/WHTrie5LYSjh3LM0LflE4ZK0Q7+uOjSp hcTH2MX5AdKW9oOlILiUaucG/S+6O7oZ0rjpj1sr8aen2t+Xyq1YQ8AejU3/zWZFbvEaoV0cRkXXt UgWuGFE3DHz5KijjVSTQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fVVa6-0004Fw-TL; Wed, 20 Jun 2018 05:22:58 +0000 Received: from mail-he1eur01on0132.outbound.protection.outlook.com ([104.47.0.132] helo=EUR01-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fVVW5-0001Ak-QF for linux-arm-kernel@lists.infradead.org; Wed, 20 Jun 2018 05:20:10 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=axentia.se; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TV58Sd8YF+pNU9ABk/utiMotiOqOQ+bGP0pBn0L9C5M=; b=dxlE7mejLoyZfoDyaHF+VUONmt/A3nvZL+GU95Ui1g9YBKc4vbS3TI+7klrzaJBZrP5hCSPir4Wi+l3E1V2WWwglWga/rns1Nc0M5Mi57/JuNYl+lHxJsemfRTOfi0IUdCarm29X+JfPt7STLaEGTqelBab8/kCRkPyGhsWCm7w= Received: from orc.pedanet (85.226.244.23) by AM5PR0201MB2452.eurprd02.prod.outlook.com (2603:10a6:203:35::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.863.20; Wed, 20 Jun 2018 05:18:33 +0000 From: Peter Rosin To: linux-kernel@vger.kernel.org Subject: [PATCH v2 04/10] media: af9013: switch to i2c_lock_bus(..., I2C_LOCK_SEGMENT) Date: Wed, 20 Jun 2018 07:17:57 +0200 Message-Id: <20180620051803.12206-5-peda@axentia.se> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180620051803.12206-1-peda@axentia.se> References: <20180620051803.12206-1-peda@axentia.se> MIME-Version: 1.0 X-Originating-IP: [85.226.244.23] X-ClientProxiedBy: HE1PR05CA0127.eurprd05.prod.outlook.com (2603:10a6:7:28::14) To AM5PR0201MB2452.eurprd02.prod.outlook.com (2603:10a6:203:35::9) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ff8ce800-54e8-4643-1c6b-08d5d66d45ad X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(7021125)(4534165)(7022125)(4603075)(4627221)(201702281549075)(7048125)(7024125)(7027125)(7028125)(7023125)(5600026)(711020)(2017052603328)(7153060)(7193020); SRVR:AM5PR0201MB2452; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0201MB2452; 3:8Q8oRJG6rhuzTrcFW17jBVelo1R6qSqKH8VPEG4acweetib3ZTKNirFc6SrYlj5yV3HYesDKl1PiWVa4uAoRTHj7gqxotxBn7UjuNVBIsB3bP/Kau9HZYr5USE+/iQmiJYdHUabJIokRDkjZbrbabCtSSJDCSqUeJ752EOp5ZQcOKKQJ0LN2VDleOcnhU2SKvCNvmC96AnYKTggvbrOHPe3lHaYrQxlxwiSI+gKkkfHhqdM49ZsSPdOY+PVHNlff; 25:57+KS/Audnw3Dk7jWG5vuaKJr1USnobtu5MJa2EBk0RY3Dc79l9CWzXPhEEIibHNQSU4nEqD5fX3oJP7rM7urwjphgDDew1PeTP71p51EUrFKxEh4GoberwW0ZJwtEaSfNp87us+xjxZIUzNJ7rvwbzc9GFJ8dyKpKqAWQNDns/GF+nbXIx7hHRCnlpoNrk6rjbBFTs97teYDjCPQ7xa+3CnkN2urydP95QSzDKCa25WfdmehqG1um8rGQvYNKIJsw1ugXrjjftWQWtAjTSqJwAvcPrJgZU2A5LS9N4GdIUIDVT8I04+2y1xnjsS1VHdjgs3/Th/LhgzWjHqNgov7g==; 31:UzUyCYkUWwzUjjsMjCoKci1BK0NdGw1v7I45C9LOeZeihlW4Gm5uvKPz0PXOOjW8fI7NcZj5ziywr+kRsUOp4F40tCsFw7XV076UbeO9s06UdfduLutsOi2J/zZwqDZLz5Y+1AVT0WItecy9H1Ue8pkz8L0ycH2LrsyPO6HcuZvBxI9+6YuCSG9WgNCEDMYzBDw0sKlR1IeruqQivz2OeG0Qi7dNIJ36YI5lzjjOaqw= X-MS-TrafficTypeDiagnostic: AM5PR0201MB2452: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=peda@axentia.se; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(8121501046)(5005006)(10201501046)(3002001)(3231254)(944501410)(52105095)(93006095)(93001095)(149027)(150027)(6041310)(2016111802025)(20161123564045)(20161123560045)(20161123562045)(20161123558120)(6072148)(6043046)(201708071742011)(7699016); SRVR:AM5PR0201MB2452; BCL:0; PCL:0; RULEID:; SRVR:AM5PR0201MB2452; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0201MB2452; 4:qwHyw0IdE1UAyBfA3hmrGwbIn7vD6rkQQRoAxAs6mKx6v+XCtwfcqjJfEEOH3eMnMMW3GRna8GEHy/bNh8jmjRtAqRXBGBtLwkj/NeVzdQONFclTMkr2M0wmRhrjEWqpktdxUiLRk971C/6uc6BoIc5lc2eLLA726XJp42N325RFPzLNAcrZydYZ8a/FaZfQhA+wmq5uxCS+czv3Im2y3DpHvBOpBMsaibMqXQHCr9PGE9C1zliPIpQu1gLTRFV/Z69kszwa19tNLgtDbpTwDw== X-Forefront-PRVS: 070912876F X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(1496009)(366004)(396003)(39380400002)(346002)(376002)(39840400004)(189003)(199004)(51416003)(50466002)(7416002)(6116002)(186003)(59450400001)(48376002)(3846002)(26005)(6916009)(53936002)(6666003)(1076002)(7406005)(6512007)(76176011)(15760500003)(2906002)(316002)(386003)(36756003)(478600001)(6506007)(68736007)(86362001)(5660300001)(16586007)(50226002)(52116002)(54906003)(16526019)(2361001)(4326008)(2351001)(47776003)(25786009)(39060400002)(66066001)(8666007)(305945005)(486006)(8676002)(7736002)(97736004)(81166006)(956004)(106356001)(476003)(105586002)(81156014)(6486002)(2616005)(8936002)(74482002)(446003)(11346002)(42262002); DIR:OUT; SFP:1102; SCL:1; SRVR:AM5PR0201MB2452; H:orc.pedanet; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: axentia.se does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM5PR0201MB2452; 23:b2Zr2FCcAyG3huy6AIg58qGUx/3cnMEfJb7eQoK?= =?us-ascii?Q?tbTxNV9Snt61BKfTPOLlSy4c0yn0JAb+HSSXYBkXpCiCHDd3Eiq+U7fCLx8+?= =?us-ascii?Q?6hBdOtn06qTIA2OGvPfpgXkAGhNGTb56hXln2CUypE4PsR7zpa8vUq0wlpOx?= =?us-ascii?Q?MH+EBQXtfJad9V+ZZc5gQoUCtfqKs9fywSo9IOMXpeQZqryyKRPcbmH0BMDJ?= =?us-ascii?Q?86RyG6Ium9B4dIgVwzn9K7AAq97KAjPs7yecH5w3EKfCrbn8ndz7xzzo8WWw?= =?us-ascii?Q?8OTBFJMaT0dHw6kP+3VnbqzOux/6HlwTJT9HzVdn+eLJvSyLPKKAMUD8NL7j?= =?us-ascii?Q?ttPIgzZbsPt7D9RZMioleWq3YRbXac9aPx+BIZCy4MzFHgeTpUWf2WxYe3DW?= =?us-ascii?Q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ZsDcHqcQyeog4BhH3xNYk9sOCQDIl0uiMcBEPd2w==; 5:O2DbC9n0WAFxurqA6aaDJPHXuss1isWA11y8B73mEbDHJLjN8VyUXUOPI8du5iYFBau5UbcWXozzeuLjDPRl+UNKvkB67aK0np9NQ4bzPSyjPRx7GMiycz1QgYZvX15sRl3Xt1qb/b0ty3nL796xfQUHEJTBK4Oh2vEAXgKPMxc=; 24:UU/SsZVbJvEpIr7EEDO8O5I/85tf3eQFV+292c/L4hs/CvgR1ys8Jru6npD9jMKtp2uZiEqHUbcxjQrVvFPzQAjXInnU8jWL/H4Ku+3G+Ts= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM5PR0201MB2452; 7:U8CwjjM00X5u9zOeBdz1b0ZVP1aD0oc3Hzcw8yUpOlP4xh0HXuh1MirVMzsBlrPpEdwBo+dYunxN8XKGARaw5ET69PQESBHwArJ1ous7GQqUg9Wa5h9f0zPkXKVKBf+BmYc1NjUOOa7sX2nhUCVMZ9xIZToa1Sx8ACdyQv4jJe8QPGgNcTX1uVVz9qr8FvcmXd+W6c6xTErzHcpSk8OX0N4cz+QtcffIw5o2qKsy/OMORywgWf5CmmomimxbGKNK X-OriginatorOrg: axentia.se X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Jun 2018 05:18:33.0608 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ff8ce800-54e8-4643-1c6b-08d5d66d45ad X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4ee68585-03e1-4785-942a-df9c1871a234 X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0201MB2452 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180619_221850_046332_C63AD55E X-CRM114-Status: GOOD ( 13.11 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Crt Mori , Wolfram Sang , linux-iio@vger.kernel.org, Sekhar Nori , Jarkko Sakkinen , linux-i2c@vger.kernel.org, Peter Meerwald-Stadler , Peter Huewe , Michael Krufky , Lee Jones , Antti Palosaari , linux-samsung-soc@vger.kernel.org, Florian Fainelli , Kevin Hilman , Chunyan Zhang , Krzysztof Kozlowski , Jason Gunthorpe , Kukjin Kim , bcm-kernel-feedback-list@broadcom.com, linux-input@vger.kernel.org, Orson Zhai , Guenter Roeck , Haavard Skinnemoen , Arnd Bergmann , linux-media@vger.kernel.org, Lars-Peter Clausen , Gregory Fong , Mauro Carvalho Chehab , linux-arm-kernel@lists.infradead.org, Baolin Wang , Greg Kroah-Hartman , Dmitry Torokhov , Hartmut Knaack , linux-integrity@vger.kernel.org, Brian Norris , Peter Rosin , Jonathan Cameron Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Locking the root adapter for __i2c_transfer will deadlock if the device sits behind a mux-locked I2C mux. Switch to the finer-grained i2c_lock_bus with the I2C_LOCK_SEGMENT flag. If the device does not sit behind a mux-locked mux, the two locking variants are equivalent. Signed-off-by: Peter Rosin --- drivers/media/dvb-frontends/af9013.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/media/dvb-frontends/af9013.c b/drivers/media/dvb-frontends/af9013.c index 482bce49819a..99361c113bca 100644 --- a/drivers/media/dvb-frontends/af9013.c +++ b/drivers/media/dvb-frontends/af9013.c @@ -1312,10 +1312,10 @@ static int af9013_wregs(struct i2c_client *client, u8 cmd, u16 reg, memcpy(&buf[3], val, len); if (lock) - i2c_lock_adapter(client->adapter); + i2c_lock_bus(client->adapter, I2C_LOCK_SEGMENT); ret = __i2c_transfer(client->adapter, msg, 1); if (lock) - i2c_unlock_adapter(client->adapter); + i2c_unlock_bus(client->adapter, I2C_LOCK_SEGMENT); if (ret < 0) { goto err; } else if (ret != 1) { @@ -1353,10 +1353,10 @@ static int af9013_rregs(struct i2c_client *client, u8 cmd, u16 reg, buf[2] = cmd; if (lock) - i2c_lock_adapter(client->adapter); + i2c_lock_bus(client->adapter, I2C_LOCK_SEGMENT); ret = __i2c_transfer(client->adapter, msg, 2); if (lock) - i2c_unlock_adapter(client->adapter); + i2c_unlock_bus(client->adapter, I2C_LOCK_SEGMENT); if (ret < 0) { goto err; } else if (ret != 2) {