From patchwork Mon Sep 24 14:49:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 147352 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp814305lji; Mon, 24 Sep 2018 07:51:02 -0700 (PDT) X-Google-Smtp-Source: ACcGV60LTuQwrzw3gcI4kBBsz0oCv9qevmLbXqkLvRcbOQ96VxN83HZF3YFLmLBgoVtNwKtVtXHV X-Received: by 2002:a63:f744:: with SMTP id f4-v6mr181333pgk.410.1537800662773; Mon, 24 Sep 2018 07:51:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537800662; cv=none; d=google.com; s=arc-20160816; b=RLxvmLflF+BChdQHMwLymhz6OAUQYmKgZiAbNGI6ig/RHvwievy+Um46Kw7khwKqMU S8aVG3Lm/Bk7cz5Ol/hHKwcE/eMtYjLxXIRwrEPCQWpHQ+SbvxvvmuOF9xJcAu0kiJWO JLrhB8Tj1Iha2aE/e5pZYLlJtVET1njVjU3ZeQNboWEA6pjAxje9nTlFjpDDIVbeSZ8H Sqm7rchDuWLT3/yerlMwCKB0JRQSSBkDhwRoW7nnxAQ5+gnccteWWKgGW/9eAP09EUDp aMcfsR6nYhrweo6ehJ3rBGfsFSix5KolkovDMR7FD7Z1XgDA+kU/PpcQLdWp7nlSs5sR MCmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature; bh=fSDHuxbWfx4RNIhwgREYUBPaQRP4csY3XNOTDIV0s7M=; b=RNLOh5W8DYaXEasSr02fGmD2hi1LXo/RuL2TpomKOCyBvNmB24I9A1fd4MIS5ifJif 7WwCRCyXN9pfwjEbHV7k3W0arcQ362wTG4wilGBWRUHP1hBBd8MjYMKDoJLjxXGiK3xB oLnrJkhFuhZy60/HDU3M3yIhnyGkoXn7w3SNX3b61tQLfKtaRQvG4dKfA9oOycOtEsMQ OAA+7h0AS6dC4vtq/S79VUv/87HIuU4h/5Ea1285ut4dGiqAVOGYP00cA9zTttr+oYgs jQ9Lyp9mRztCPqu0IxiaES6OuEmuqfRS8h4p1EJKnb9Z8sEDPpCEVh8+n2NQ8qrQuWqy 04/g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=e84IHb7f; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r29-v6si37932981pff.24.2018.09.24.07.51.02; Mon, 24 Sep 2018 07:51:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=e84IHb7f; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388722AbeIXUxa (ORCPT + 32 others); Mon, 24 Sep 2018 16:53:30 -0400 Received: from mail-by2nam01on0090.outbound.protection.outlook.com ([104.47.34.90]:36480 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1731755AbeIXUx3 (ORCPT ); Mon, 24 Sep 2018 16:53:29 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=fSDHuxbWfx4RNIhwgREYUBPaQRP4csY3XNOTDIV0s7M=; b=e84IHb7fZ457U1QwLb/NpAWJrQNfODrFExRLlY0oZwhwZlspzCcAkzwUittxOYyNNzA0TOkQ1vEbFB1HPo8uCQnanGS3zHXUgMCupwCPVbKmkz2HonHi3NvzNAqV7jOO4+LpV1bgIseAdo/hTIhrNQEfveUR4Vm2vRTr7Kl4Pms= Received: from CY4PR21MB0776.namprd21.prod.outlook.com (10.173.192.22) by CY4PR21MB0181.namprd21.prod.outlook.com (10.173.193.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1207.3; Mon, 24 Sep 2018 14:50:57 +0000 Received: from CY4PR21MB0776.namprd21.prod.outlook.com ([fe80::54e2:88e0:b622:b36]) by CY4PR21MB0776.namprd21.prod.outlook.com ([fe80::54e2:88e0:b622:b36%5]) with mapi id 15.20.1207.003; Mon, 24 Sep 2018 14:50:57 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Will Deacon , Vineet Gupta , Sasha Levin Subject: [PATCH AUTOSEL 4.9 10/23] ARC: atomics: unbork atomic_fetch_##op() Thread-Topic: [PATCH AUTOSEL 4.9 10/23] ARC: atomics: unbork atomic_fetch_##op() Thread-Index: AQHUVBXMWG25ukAPDUWAHHmI07DtLg== Date: Mon, 24 Sep 2018 14:49:29 +0000 Message-ID: <20180924144919.164617-10-alexander.levin@microsoft.com> References: <20180924144919.164617-1-alexander.levin@microsoft.com> In-Reply-To: <20180924144919.164617-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; CY4PR21MB0181; 6:bKxsq+mbs3pg7Rw7LL4YoNvUl6SGIJ5+JRZg/o+mbX8+0tSp6Bj/SABD313gacqbBeWXBH04Wr/ZfMB16Y3MncDbrgVz+uSXxGjhd9XIdpSKyKY5CkeNVTHXR4Eu8ZzPNQIGVdbOiBKQ+cl3W9so1jeYfHV4WomO0NzQcSvZJMaG9bqKWjVzPQPDYLn/NOFFNsvU7SFPTRRqzRtHaiN2/V4lnREBcSVHKOJrnqYJEVnT4FlIkbrZTyFp0Tn6yVRP1e8KsJYdhG9rp9uuR6b0rnsJt9nmbxhEFkZYomsr9Pyp9n9JqTYkeBpD4ndxWhEeYKmJmBKt9iTOpuNOobz9bAvEexiFFXYfruIm7pr3wV01+K4GjYH5vo/3wJ5XneZIq1sA14eYRC2z4MKZOnjfQ0tPQPUe349XKcZpF6TGYgcDPZlX1/dRT2bkCi3mp7Cy+xjSdLooHqIi7cLOFPICaQ==; 5:bkdUrwspkL/GZKMBnhIPn1/1o8fDmiB9N/IjWZS8Q/O7AO5mzm6bi9HZnW8oKFSxR9Hp9gv0YhlYOFLLlkZNxVtRksFKuHfyYR7ctxJAXA6iRnhxCr7uo2xApR5qUO61m/8yCrxSYOOyuT+OZ/L31S4IQyDg2H0PJoI6n1jwSfQ=; 7:hks9LZ4c2GKYmH2TOQSDFXfDk4ykmGM6gVYaOW8gHbYzeNhFT7bb3Ar3QqVPoZwqdivPOSln2L8mjACalOo2U0a/LYcZvauntVSZ3m2C2Ghh04SCrRpE9bqxrefciKKhIqhqS+LCBH0nPnVxBaq+N8Dwwo9owONyADuYvYNt0MZISWYHR4w10jhJk9EjXYGFQ/1Zjf/Yjsjd6u6cy7DXD27azrMH59EA7CbjiMrEB4WGy60ChWeyiNmdVJkPfVAT x-ms-office365-filtering-correlation-id: 85c5a1dc-fc48-449a-cd56-08d6222d22fd x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534165)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7193020); SRVR:CY4PR21MB0181; x-ms-traffictypediagnostic: CY4PR21MB0181: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(180628864354917)(28532068793085)(89211679590171); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231355)(944501410)(52105095)(2018427008)(10201501046)(93006095)(93001095)(3002001)(6055026)(149066)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123558120)(20161123560045)(20161123562045)(201708071742011)(7699051)(76991041); SRVR:CY4PR21MB0181; BCL:0; PCL:0; RULEID:; SRVR:CY4PR21MB0181; x-forefront-prvs: 0805EC9467 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(366004)(376002)(39860400002)(136003)(346002)(396003)(189003)(54534003)(199004)(10290500003)(6116002)(26005)(102836004)(3846002)(5660300001)(22452003)(110136005)(10090500001)(8676002)(1076002)(54906003)(105586002)(186003)(316002)(106356001)(2501003)(6436002)(97736004)(6486002)(107886003)(7736002)(36756003)(478600001)(72206003)(14454004)(71200400001)(71190400001)(305945005)(256004)(14444005)(5250100002)(217873002)(6666003)(2616005)(68736007)(53936002)(81166006)(81156014)(2900100001)(476003)(86612001)(4326008)(8936002)(486006)(99286004)(6512007)(86362001)(2906002)(25786009)(66066001)(6506007)(11346002)(446003)(76176011); DIR:OUT; SFP:1102; SCL:1; SRVR:CY4PR21MB0181; H:CY4PR21MB0776.namprd21.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: c8YxLTFAxx775f2Zpl+kmNLRuN6GfxHp51kZ38xzJ7Vrt2RqDRec8AXhH72jaQn2HzQBypu1KLL5uHPy6VogbV2aYHnSNq5C5fyr+FRf3DUyVSRMLgqPtVpQ/5x+fLvac8Qq8ZnfouBsbfnBNmADjIuUZmA0rVcapRQp/ZzQU3b+5WWiOuyWy1WPI2aTqB/Tgoicz7baJLX8m6Y7loTXuL9LkcZteD5/Drt80jZ9nS40ctUHQ4XsAtbnwmOctK53ZPqJ6RHr96ZA3AZTIu/eMZAKSh8GQyPqQk+AH4ZoBCYkAeY4heAybTZ/L2UpPvw9I5yo6nlYOJtcpg9ANI1Ry3fUeTv1aoMxIawLh/lKSBM= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 85c5a1dc-fc48-449a-cd56-08d6222d22fd X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Sep 2018 14:49:29.4499 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR21MB0181 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Will Deacon [ Upstream commit 3fcbb8260a87efb691d837e8cd24e81f65b3eb70 ] In 4.19-rc1, Eugeniy reported weird boot and IO errors on ARC HSDK | INFO: task syslogd:77 blocked for more than 10 seconds. | Not tainted 4.19.0-rc1-00007-gf213acea4e88 #40 | "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this | message. | syslogd D 0 77 76 0x00000000 | | Stack Trace: | __switch_to+0x0/0xac | __schedule+0x1b2/0x730 | io_schedule+0x5c/0xc0 | __lock_page+0x98/0xdc | find_lock_entry+0x38/0x100 | shmem_getpage_gfp.isra.3+0x82/0xbfc | shmem_fault+0x46/0x138 | handle_mm_fault+0x5bc/0x924 | do_page_fault+0x100/0x2b8 | ret_from_exception+0x0/0x8 He bisected to 84c6591103db ("locking/atomics, asm-generic/bitops/lock.h: Rewrite using atomic_fetch_*()") This commit however only unmasked the real issue introduced by commit 4aef66c8ae9 ("locking/atomic, arch/arc: Fix build") which missed the retry-if-scond-failed branch in atomic_fetch_##op() macros. The bisected commit started using atomic_fetch_##op() macros for building the rest of atomics. Fixes: 4aef66c8ae9 ("locking/atomic, arch/arc: Fix build") Reported-by: Eugeniy Paltsev Acked-by: Peter Zijlstra (Intel) Signed-off-by: Will Deacon Signed-off-by: Vineet Gupta [vgupta: wrote changelog] Signed-off-by: Sasha Levin --- arch/arc/include/asm/atomic.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 diff --git a/arch/arc/include/asm/atomic.h b/arch/arc/include/asm/atomic.h index 54b54da6384c..49112f76710c 100644 --- a/arch/arc/include/asm/atomic.h +++ b/arch/arc/include/asm/atomic.h @@ -84,7 +84,7 @@ static inline int atomic_fetch_##op(int i, atomic_t *v) \ "1: llock %[orig], [%[ctr]] \n" \ " " #asm_op " %[val], %[orig], %[i] \n" \ " scond %[val], [%[ctr]] \n" \ - " \n" \ + " bnz 1b \n" \ : [val] "=&r" (val), \ [orig] "=&r" (orig) \ : [ctr] "r" (&v->counter), \ From patchwork Mon Sep 24 14:49:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 147355 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp814388lji; Mon, 24 Sep 2018 07:51:08 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYj01ez37pUdDPRY5pSsLttdPTplY9A3PpfRNi4DOqEnODiTEYy3N63Mt4YNTlbBsxs1oZa X-Received: by 2002:a62:6a01:: with SMTP id f1-v6mr10728530pfc.156.1537800667915; Mon, 24 Sep 2018 07:51:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537800667; cv=none; d=google.com; s=arc-20160816; b=lchBJ6zGFdIcz1dGwnUFQwsO+aJpI38JbYMyLcLf04dkhJPGFOPds3bmc4LeLva3yn 9HJSdnjOC923s0o2wRk7TZ1+MYPQ5gAoxwAP/s2b4WptQRmGh8/33EdvWI78ZNmufrZk hjmiyvl3x4+ox3r0DhSVvyknhxKoX+LXS6wItRYwp4VGxoBlHHSPKFqmqWIXmRoFKOtM QoI3FReHU9h9BUi72Bh5/sl/T0aKc/Fo/HYG2H0mu2Vk0jISe9D36olUQFvRvqRcJ8BS DmhJ+G0PXn4m6ITW37mocAeyrUMHVRCZMelJ56Us9LFuVeLObW0Pw0HUGLNcky5ydO5N PCAA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature; bh=2EQvxnxV9Im7I6t3phX96Kh3moA+/lOiAjdKPdhsaGg=; b=R/LmKRWcfct7DiJxkrgRKHpkvwppQCx6tp4V/jjE7bg6qyJyla4mLScg46fi2Wg8Bc mFMwbvIEdoHSDwiZXMOrMKIeACd3/XHd9HKGD/bHOtqThpymUYCzygfxCTLmHJyQIYiM 1IY3RumoX81c5RvvrEIvOktbV7jt+Ip8hsKTJp8uyby1a61RdhAM2Hv+0oNPQJwn8xHE 02SCc7IPpBgt/HEorNY87Q4MXe4TpxBW8KLAvOXv3FMQKc6Nf+YupKAfgnTsDbYdRSg1 Bx6Zown5u6+hXdnURT9MsvC9l1qJBQtjJx7p1YWt431+JIL38UsRwQw4RZgtbVFr1FtK bGRA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=NyfzNu9z; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u1-v6si35962463plb.291.2018.09.24.07.51.07; Mon, 24 Sep 2018 07:51:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b=NyfzNu9z; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388820AbeIXUxf (ORCPT + 32 others); Mon, 24 Sep 2018 16:53:35 -0400 Received: from mail-by2nam03on0094.outbound.protection.outlook.com ([104.47.42.94]:22973 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730084AbeIXUxe (ORCPT ); Mon, 24 Sep 2018 16:53:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2EQvxnxV9Im7I6t3phX96Kh3moA+/lOiAjdKPdhsaGg=; b=NyfzNu9z9QW6BlxQEcJzPn21BoTy2p920KCFPzU0hyLg6SopSzjNkKfAxnRFJYro2PkHvIv65hrkB36dc/Fl/ydFmdohcqCRJEIUNmULvxI/RnZ2fojJWViSRW53JxmJgCJZ4AkviERes9TqWo5sU21U5i6ivwuB4Tc3gBe0I8g= Received: from CY4PR21MB0776.namprd21.prod.outlook.com (10.173.192.22) by CY4PR21MB0181.namprd21.prod.outlook.com (10.173.193.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1207.3; Mon, 24 Sep 2018 14:51:00 +0000 Received: from CY4PR21MB0776.namprd21.prod.outlook.com ([fe80::54e2:88e0:b622:b36]) by CY4PR21MB0776.namprd21.prod.outlook.com ([fe80::54e2:88e0:b622:b36%5]) with mapi id 15.20.1207.003; Mon, 24 Sep 2018 14:51:00 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Masahiro Yamada , Wolfram Sang , Sasha Levin Subject: [PATCH AUTOSEL 4.9 13/23] i2c: uniphier: issue STOP only for last message or I2C_M_STOP Thread-Topic: [PATCH AUTOSEL 4.9 13/23] i2c: uniphier: issue STOP only for last message or I2C_M_STOP Thread-Index: AQHUVBXNV4b8MDE1wEeOVqrfbBzmhw== Date: Mon, 24 Sep 2018 14:49:31 +0000 Message-ID: <20180924144919.164617-13-alexander.levin@microsoft.com> References: <20180924144919.164617-1-alexander.levin@microsoft.com> In-Reply-To: <20180924144919.164617-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; CY4PR21MB0181; 6:pu9f71nQVrCd8m46IbhELCYaOo/2kOngxZuO+oW5EItuxhKsEgQSPEr0Be6jWSRCKMHpQrggbkFrUdv4qUbLeF0ZcJSgYy2Y1dwXDKRD6Xpxnu9OyvEUPxY7TFvh/y7qwI77nELPmnZtGNIkTra0uckwBhk2QB6NlQIXLjdFod0BIy4DVt2P8Ssn+p3kEqk0pT7+AhRpnaFsai1lhjOuQN/lfvX3s6huMCLqFnBlsK7B7n2zyyNccAtTvrx/cQalJh5abrxP5j7jbT9JcFddWYVgUP07q2baTEP5SAoYYT1nCd52OC7CGBbCm+2pN5LX7Ez5cWql8qB0yGRNPXlcTsb47vdgFj1eaVOxq6Sl9ZAH2NvX9IDRhs4C3+aH/Zp9xYOafZBQwNiZKkE+I8u24H1DKP0p++jSWkgOowP/eilS59KPLtztgbbHCdJpO/QdLMYac6TaSEfypkXQo/1x/w==; 5:J5QzRwuPP5uSO1GG7UvCLbxFlYRRFRgs+IWlyEtXL0n7BMiiT+wMDBz6UMQ59YFCKl5uVPGTeaTEVIh4cjeyLehWdzGUQT0ZxM24B6OUEf51LnXaLjRxKUju6SqUfLZYFQNT0JifuX/gILSGFAJpYi2Ig8jUEmPyQB1jOVn8uhc=; 7:tDdMFyJUChkwi8ITpUWwnm/5rJSzlGlRX4lcFp9Ys35x0JQ/1Ed18OF58hOSIWDv8S7rWYdqJhZWuo8UvCCAb6/0krBde6O/j4a9mUVRdKDBxBuPexCZ6yXeBiAGUGs6NVeEZYwpyJZVAaz+KNKLJighwlheho+VRSSrjtNzaSxX4ZH47RLqrXWXdOZWK8zLddE5lKg4nXbI9TEqjklw2c58savHKzgk6ij5NMU9QzBFM5cAgNKZUOg8Syn+XhZQ x-ms-office365-filtering-correlation-id: a734eab0-7706-4062-d0b6-08d6222d24ce x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534165)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7193020); SRVR:CY4PR21MB0181; x-ms-traffictypediagnostic: CY4PR21MB0181: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231355)(944501410)(52105095)(2018427008)(10201501046)(93006095)(93001095)(3002001)(6055026)(149066)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123558120)(20161123560045)(20161123562045)(201708071742011)(7699051)(76991041); SRVR:CY4PR21MB0181; BCL:0; PCL:0; RULEID:; SRVR:CY4PR21MB0181; x-forefront-prvs: 0805EC9467 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(979002)(366004)(376002)(39860400002)(136003)(346002)(396003)(189003)(199004)(10290500003)(6116002)(26005)(102836004)(3846002)(5660300001)(22452003)(110136005)(10090500001)(8676002)(15650500001)(1076002)(54906003)(105586002)(186003)(316002)(106356001)(2501003)(6436002)(97736004)(6486002)(107886003)(7736002)(36756003)(478600001)(72206003)(14454004)(71200400001)(71190400001)(305945005)(256004)(5250100002)(217873002)(6666003)(2616005)(68736007)(53936002)(81166006)(81156014)(2900100001)(476003)(86612001)(4326008)(8936002)(486006)(99286004)(6512007)(86362001)(2906002)(25786009)(66066001)(6506007)(11346002)(446003)(76176011)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1102; SCL:1; SRVR:CY4PR21MB0181; H:CY4PR21MB0776.namprd21.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: Kq+kiPKLjU2/Suc1ALZQdmlcKCxMje6A3lC8DPK8+5BqW7refRXaBTg8d7UoIAYDkO00UebD0QG35mD4MNspRMIL7+twggA2OyMcpRIkcgal695QufBr6+6mG4lRMEqRlzesfkkZIWUXu8WIgU6mxIG1LlGzpxBvhT/fUTju1O+kkl1ABXu7CDdcDjBq2i8aU2vc+tBVrPJbSDLMdbHu96/GEemsE+TkKH4Zb7qQHMGDZYCgRTAu7kGOfJf1fvcu1lhOexyAS4ng3L1eR3PPe01wtZy5wCqs/iYP4H3S7urDFDlS+MPDEqmjZ8tvMXK9MqPNLUchJMtkTF9eJF8B5PhiYoYKCr6y/rXoq3qmc3A= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: a734eab0-7706-4062-d0b6-08d6222d24ce X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Sep 2018 14:49:31.1173 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR21MB0181 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Masahiro Yamada [ Upstream commit 38f5d8d8cbb2ffa2b54315118185332329ec891c ] This driver currently emits a STOP if the next message is not I2C_MD_RD. It should not do it because it disturbs the I2C_RDWR ioctl, where read/write transactions are combined without STOP between. Issue STOP only when the message is the last one _or_ flagged with I2C_M_STOP. Fixes: dd6fd4a32793 ("i2c: uniphier: add UniPhier FIFO-less I2C driver") Signed-off-by: Masahiro Yamada Signed-off-by: Wolfram Sang Signed-off-by: Sasha Levin --- drivers/i2c/busses/i2c-uniphier.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) -- 2.17.1 diff --git a/drivers/i2c/busses/i2c-uniphier.c b/drivers/i2c/busses/i2c-uniphier.c index 56e92af46ddc..fdfcee9230e4 100644 --- a/drivers/i2c/busses/i2c-uniphier.c +++ b/drivers/i2c/busses/i2c-uniphier.c @@ -247,11 +247,8 @@ static int uniphier_i2c_master_xfer(struct i2c_adapter *adap, return ret; for (msg = msgs; msg < emsg; msg++) { - /* If next message is read, skip the stop condition */ - bool stop = !(msg + 1 < emsg && msg[1].flags & I2C_M_RD); - /* but, force it if I2C_M_STOP is set */ - if (msg->flags & I2C_M_STOP) - stop = true; + /* Emit STOP if it is the last message or I2C_M_STOP is set. */ + bool stop = (msg + 1 == emsg) || (msg->flags & I2C_M_STOP); ret = uniphier_i2c_master_xfer_one(adap, msg, stop); if (ret) From patchwork Mon Sep 24 14:49:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 147353 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp814617lji; Mon, 24 Sep 2018 07:51:20 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZJrohvbasrM5MJp0tQq9tLz5rJhJNBD0MIohukIZspXf2UJy+ie7S349qF2EnVsTfMuYYC X-Received: by 2002:a63:9b09:: with SMTP id r9-v6mr5230163pgd.307.1537800680371; Mon, 24 Sep 2018 07:51:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537800680; cv=none; d=google.com; s=arc-20160816; b=WERdFhAZ6il0f6/mw9YzbRKOTCD7MkIpxYRSDcl+MlJ4VDcfc3qy8GyzSa3/zbBWLg XzVXzni91kpesdXiJRIbFpnomilI0W/aiIcWqzt4fgRtT/0xnbVScWesvwq9xPWR+0co JT6YkEdgNlQ/pBXPwOsrZizNAO9Xr9qcU4zehp085OVaQ5PQK6Qc8Ri1PjcmMY0Pvfga f38vtHpNCERFQtp90RqqUvoagdIgxP+pnEcF1nOk1ybhD68HQy9LoN9yNzSf08ZJbYSk YnuAgsIS6Z87QZWfQuogKsMP5S16dgYlU7a3CQ52bfOOqj+4smIvcZR32Dx7BS2ncJH0 Bf0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:content-transfer-encoding :spamdiagnosticmetadata:spamdiagnosticoutput:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:dkim-signature; bh=yUu70jNJEhWhEeJ3iwIIxbBDfI9adUJRG+xb4PSLYwE=; b=aWMuXNBnK0eeHr8rBUpTpUm81wkM7u1yvCsiLeATJ+jU8oT4n1IFQdtFB1KSXUTgw5 HTjBOgzYJ19t+iOkUXy3RQiTHqPZ5iGV6SFxeTgaU9n++3+GyEqrz3vs4GI2me8i+hJr +HeS1zTJOgnHgRPQkIr880ZvCzy6wx6DfVNjayqZngvrMl5/SouPsn6IKgmM5U1uaIr6 5tVwEEp73l0yeDBE/X5ZJtFYUnYXZ+tf4Tyo3YTHH/OpL9IAE3sDR9BI95UPGpOirejI Ca/rHPC1Yb13Kp0yz245v0owAYSZRb6UZLAZWPPp7vhkWERacw3Y7v/PBuIVeyFYAwMo Ft5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b="Eus/aO7L"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m86-v6si37302761pfj.48.2018.09.24.07.51.20; Mon, 24 Sep 2018 07:51:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@microsoft.com header.s=selector1 header.b="Eus/aO7L"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=microsoft.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388955AbeIXUxt (ORCPT + 32 others); Mon, 24 Sep 2018 16:53:49 -0400 Received: from mail-by2nam03on0094.outbound.protection.outlook.com ([104.47.42.94]:22973 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388790AbeIXUxs (ORCPT ); Mon, 24 Sep 2018 16:53:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yUu70jNJEhWhEeJ3iwIIxbBDfI9adUJRG+xb4PSLYwE=; b=Eus/aO7Lk/1cVjbm0gW34AuiW6g2JmJn1Zy3KYR+5+oZfXR4AY++5sZ56dTguCRai1ZkWc5rL/+r9B2lKd1+eJ/JKNQcMvSHLi2eA2bjPzLxpH8GzYnZuKiGKtG8E/h+rIhW8ANqY4eibwgNd2qM76C0HvnJxE8gOiYp/W+Ynu8= Received: from CY4PR21MB0776.namprd21.prod.outlook.com (10.173.192.22) by CY4PR21MB0181.namprd21.prod.outlook.com (10.173.193.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1207.3; Mon, 24 Sep 2018 14:51:00 +0000 Received: from CY4PR21MB0776.namprd21.prod.outlook.com ([fe80::54e2:88e0:b622:b36]) by CY4PR21MB0776.namprd21.prod.outlook.com ([fe80::54e2:88e0:b622:b36%5]) with mapi id 15.20.1207.003; Mon, 24 Sep 2018 14:51:00 +0000 From: Sasha Levin To: "stable@vger.kernel.org" , "linux-kernel@vger.kernel.org" CC: Masahiro Yamada , Wolfram Sang , Sasha Levin Subject: [PATCH AUTOSEL 4.9 14/23] i2c: uniphier-f: issue STOP only for last message or I2C_M_STOP Thread-Topic: [PATCH AUTOSEL 4.9 14/23] i2c: uniphier-f: issue STOP only for last message or I2C_M_STOP Thread-Index: AQHUVBXNsuOXFxGVi06eWb2lP0qCnA== Date: Mon, 24 Sep 2018 14:49:31 +0000 Message-ID: <20180924144919.164617-14-alexander.levin@microsoft.com> References: <20180924144919.164617-1-alexander.levin@microsoft.com> In-Reply-To: <20180924144919.164617-1-alexander.levin@microsoft.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [52.168.54.252] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; CY4PR21MB0181; 6:aT4zBPPMtftBDEUiwVclEKGaPOPFelsgllcDXXzqBv5K1okJCzj3jiNU6dFq0gqRJ4f7BrliA2gcvX9QJHLtRvvjaA3sEu/HHguPpHE7Vu/YAGnGJD+V4TrNENW0OIoGxTpdD7RTNpk6M3nPqDzX7m45hKUo8pMUwXaGPJTG/Ib0RKiYWRs+OlAP7V00dLMe7gp2WnWNSOLDkIZIzXO3T1N43HpV1yAmW1jLAN2RGabiybNQi4N8KIKX832KdAcVhM+mmUneiOCFo85LZuZFvyWBUm3b+c/YE4lKhvITc1FjJoGuFaEDE3Bvl8O5ezlQFtcqdRG+FDm6041QxldIGe5lcvWcxNuh2RwWYfLj9buS9y8OL0reGIW0Kbdp0TVWyf6nDBnXTpk6zfZI6hV6yNzK3dn51IUu5I5UhaTzk5bUpejnf8qfLd3W56/6U48K+sweV4+0T+C3h9kkjZI7zw==; 5:BHLhVAmLPuM5kORVDwnPsyl8YiYy/pWUwFGzQchHTg5GR2TxSzS6ez/yT16Mon2gBZXqGIw3YlTFiNg+gMCLEAskCJrQk9rajXrnVMVxKdb5HpGBkp99eWpiiR//TyZiVNX5iNIn6QUzPilFa/1WKytWCRMKOuWE3XKehNwm3K4=; 7:qre7gIHP8CX7G/D4WqD6EkbTJSHYUx/GQk3rSBpAMSuaaxHyzLOV4cLXPpf4D9N8svQWDR+pHI7anf46ZsMdJzik73wraDuc0Xnn9OCMSha54br54WwXNMCmCMzJs4WH6sCPo49X4vdy9fgJrqwNtWIqWlaNAqdegCXgyNoqDwCeGHJBMwJU7VSAGVEI0TL2T77ZxpWEbgqCZQ026V6N5qEX7kYSBc90GoojBrJdkyrtKHiQTJtlXNWEGTRWuM+9 x-ms-office365-filtering-correlation-id: 9553365f-e2e1-4634-52ea-08d6222d24fc x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534165)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7193020); SRVR:CY4PR21MB0181; x-ms-traffictypediagnostic: CY4PR21MB0181: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Alexander.Levin@microsoft.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(28532068793085)(89211679590171); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3231355)(944501410)(52105095)(2018427008)(10201501046)(93006095)(93001095)(3002001)(6055026)(149066)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123558120)(20161123560045)(20161123562045)(201708071742011)(7699051)(76991041); SRVR:CY4PR21MB0181; BCL:0; PCL:0; RULEID:; SRVR:CY4PR21MB0181; x-forefront-prvs: 0805EC9467 x-forefront-antispam-report: SFV:NSPM; SFS:(10019020)(979002)(366004)(376002)(39860400002)(136003)(346002)(396003)(189003)(199004)(575784001)(10290500003)(6116002)(26005)(102836004)(3846002)(5660300001)(22452003)(110136005)(10090500001)(8676002)(15650500001)(1076002)(54906003)(105586002)(186003)(316002)(106356001)(2501003)(6436002)(97736004)(6486002)(107886003)(7736002)(36756003)(478600001)(72206003)(14454004)(71200400001)(71190400001)(305945005)(256004)(5250100002)(217873002)(6666003)(2616005)(68736007)(53936002)(81166006)(81156014)(2900100001)(476003)(86612001)(4326008)(8936002)(486006)(99286004)(6512007)(86362001)(2906002)(25786009)(66066001)(6506007)(11346002)(446003)(76176011)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1102; SCL:1; SRVR:CY4PR21MB0181; H:CY4PR21MB0776.namprd21.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: prdSeWAYiD1qpj8Mp66u8OBP/8lb434kUoUCkb/j3rihs8XQi5NZed6YZUQHSRCzTfIYTC2B00wjZAFavVp0EEEjmO4y5zyoTCRbryQWyaE0Ytmt/8SWp13aoninK7QTOuQU8XmyftD092zxKdQBhVwJLMogauEV9kZoKuZk2t+s86dSJUcGtmW8qV6FP+vo8iUjkkQ235X+zrVsy2W9kuuv42Eb6YXziPPTCpvA1xXt0gx4XmSylui3R+dN/hnjKNHOBJK6JkI/kZ7ib/T8SA0sUZGhFeJqISM8eOp8CWcTZeo1Kn5qh0RqpEv6kR36lhgFJrK0jRsz1JqwzvcFnTQceeMBmBQ0m60Kfj9AytE= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9553365f-e2e1-4634-52ea-08d6222d24fc X-MS-Exchange-CrossTenant-originalarrivaltime: 24 Sep 2018 14:49:31.6337 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR21MB0181 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Masahiro Yamada [ Upstream commit 4c85609b08c4761eca0a40fd7beb06bc650f252d ] This driver currently emits a STOP if the next message is not I2C_MD_RD. It should not do it because it disturbs the I2C_RDWR ioctl, where read/write transactions are combined without STOP between. Issue STOP only when the message is the last one _or_ flagged with I2C_M_STOP. Fixes: 6a62974b667f ("i2c: uniphier_f: add UniPhier FIFO-builtin I2C driver") Signed-off-by: Masahiro Yamada Signed-off-by: Wolfram Sang Signed-off-by: Sasha Levin --- drivers/i2c/busses/i2c-uniphier-f.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) -- 2.17.1 diff --git a/drivers/i2c/busses/i2c-uniphier-f.c b/drivers/i2c/busses/i2c-uniphier-f.c index db9105e52c79..0da4991dd356 100644 --- a/drivers/i2c/busses/i2c-uniphier-f.c +++ b/drivers/i2c/busses/i2c-uniphier-f.c @@ -400,11 +400,8 @@ static int uniphier_fi2c_master_xfer(struct i2c_adapter *adap, return ret; for (msg = msgs; msg < emsg; msg++) { - /* If next message is read, skip the stop condition */ - bool stop = !(msg + 1 < emsg && msg[1].flags & I2C_M_RD); - /* but, force it if I2C_M_STOP is set */ - if (msg->flags & I2C_M_STOP) - stop = true; + /* Emit STOP if it is the last message or I2C_M_STOP is set. */ + bool stop = (msg + 1 == emsg) || (msg->flags & I2C_M_STOP); ret = uniphier_fi2c_master_xfer_one(adap, msg, stop); if (ret)