From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 43434C433E0 for ; Mon, 3 Aug 2020 16:44:40 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 068D6207DF for ; Mon, 3 Aug 2020 16:44:40 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="nQ7DoBsr"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="RE0QHC4b"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=microchiptechnology.onmicrosoft.com header.i=@microchiptechnology.onmicrosoft.com header.b="uJEOguZU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 068D6207DF Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Content-ID:In-Reply-To:References: Message-ID:Date:Subject:To:From:Reply-To:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=IO1/pWgyzHpFbl68hyCnzvzO4zLl6IviPMEmuveMP7g=; b=nQ7DoBsrgOXNrp8K1vdVeFpP1 R6rCBWYXZFLHrJDQ8EQ+Tq8Jxra63t6hy/aurWRzWjIyM0Yz+iujf7dOR/3G8tgGMdHvNsatfAZu9 10+/95w1F41MEEBwnUqnCsBEm9c/gpn1ozZ/bofukbKMuyoQgSViQG/1AJJo1DosrmwI3Qj4176jP 52ONkmqaImfk5BLRBbNbDWIVp32mGrSvKn+0/O25EQq0NJ6YwEQq8JCtP0a3WeTqeJ6rLM+GQ93+7 M8mSqdmA73LwC1T2u0LTUvJeBXqFg+LWyZXsXCQYxJaDhfmLW/04l2T2U6JLVtWTToF9mK/YN5Bl0 mAf7jaW/g==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k2dYN-0002VB-4M; Mon, 03 Aug 2020 16:43:11 +0000 Received: from esa5.microchip.iphmx.com ([216.71.150.166]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k2dYH-0002Tj-7Q for linux-arm-kernel@lists.infradead.org; Mon, 03 Aug 2020 16:43:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1596472986; x=1628008986; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-id:content-transfer-encoding: mime-version; bh=KgiYpL0kciyHYaWtg0L76VN2MmAncnKbl0VmgLxi/fI=; b=RE0QHC4bEUCKA5g/wA3FyLUKc0spISkEhux84cbPu95SJrsYA5vjSwpJ 4d8uaVj3NAolvJynQTgsK+JRtNKYMBTDZQ876xkh0gaWIOe0TUxvDrqzm q6JERP/Ux4nKcciV3fSxy6JW16e7FAmRt7Aj/7mLykljN46RFcZ/Qnmsi WII++qduoj53a14n2JGLltx/HC3vBeF4Y3/4PoDBOWz6xK/THxFeKYMsI v99pnRW2TCPXEySYzKiSL+pPtEhRE5y8Ev27tHdMD2IwhKDnUkHBbkqBB KaptJROL0ftggBz9LX7p08hRDpUCjefn0Sn9P13uDSL3CIwYCIcz53Kt5 A==; IronPort-SDR: ZKO6SLLoC0IRrSPB/RqWuBg3DzuJHNvBsKxOxgmHsVs52kP2gEnFtC+en0NgMiVXUggObPV2ld s0LuzwVh93zluvRs4pSoYHy/qRFWmOfFN3ITS7izeOIMCdkix2w51p8j2gpeF3cDsIvq8ZAnwy rptilmKc3Sx8x9Dmm2LAVqCGsmsej2aDoWrtXLiiFWOtOz8HJAXHmEoH7TblPT3wifh/Gb7Tp0 QIuN8DKtyDtGwq+KyrokAqGFQ2jrtjMzMMx2QoDHckyIEkspuWkyHWqcv2lF7FhMEjTp/enqR/ AH0= X-IronPort-AV: E=Sophos;i="5.75,430,1589266800"; d="scan'208";a="85667391" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 03 Aug 2020 09:43:04 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Mon, 3 Aug 2020 09:43:01 -0700 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.87.72) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3 via Frontend Transport; Mon, 3 Aug 2020 09:42:57 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gmEj35jo3nBl2hFDXLQUSYiVAe1G5x9efiMFIBqLApm2ABvrc/0EddmoCsjT4abLKOBE4uad5jK/9JMlO5suQi7hM+SdGMVabrQdMQAr6m0B20EUIzp0yN9RB3v/cA6khs8GxBpz6YKJq6QdarZ017b5RfIf+LZQRwpEZXGtTaHvOkBHc1ex6MU7IbezXWrDW2azaRfIt2c70B+rQ9pc20LUHBvrUBpwIvzFUFv+BT5hpB3y0+Q75E5WFvK1vW3wmNdZoC2MqUVZd7x7IK/JEO5SPfv6zrnKyw+9dEV8iPM+4DqK+XymKIvReKA63qUYHomyqRhWebV41tCc1nOOQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KgiYpL0kciyHYaWtg0L76VN2MmAncnKbl0VmgLxi/fI=; b=dw+aEv5feHZnpoWLr4w0LIeeBpNX+e/xuBIlCpODAjGR+R96irVKCMmwuKmhS974R27NqokI40CnitPOP72sYBNkZRHEtLfVSLb0OfVAHcpsbYsJZAOb5TCy9tv8SWo15rD/ooRYZm/G1sWYz9uTEVpOFa5jgExUERip4qwO25Rx+vcFaxVfvkfkC7+EfKr7G5vmRwmpHHeU4av9wliUBGkiumo5duniL0/mcMim//BWN8XBkBtvODE9Dwi9Al4KPHJwlX2eQunUSnI9+HouI+5pWQ88/yO0EC5Bd7+YrX9/qe8YKCqy6PWQuB8xYgvuaPa54BVx8VnyCO7QG7ZddQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=microchip.com; dmarc=pass action=none header.from=microchip.com; dkim=pass header.d=microchip.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector2-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=KgiYpL0kciyHYaWtg0L76VN2MmAncnKbl0VmgLxi/fI=; b=uJEOguZU81pagBKQD5cY4xDhLicVaejsYmGxJ+2Sy2bHYvk4utoCh+/122gDyEWQFNPC++lE/GvI4GnaKonsLSyfsTDeNQ9Lz1IBny2uBg5V7TA0Hs3cAMhUUvrcLi5IVVRaZCBfhtsXoMypRD+JIhJ0HtiCrE4OprlMxTJ4fGI= Received: from SN6PR11MB3504.namprd11.prod.outlook.com (2603:10b6:805:d0::17) by SN6PR11MB2605.namprd11.prod.outlook.com (2603:10b6:805:64::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3239.20; Mon, 3 Aug 2020 16:42:59 +0000 Received: from SN6PR11MB3504.namprd11.prod.outlook.com ([fe80::c83b:2062:4e59:8ebf]) by SN6PR11MB3504.namprd11.prod.outlook.com ([fe80::c83b:2062:4e59:8ebf%7]) with mapi id 15.20.3239.021; Mon, 3 Aug 2020 16:42:59 +0000 From: To: Subject: Re: [RFC PATCH 1/4] dt-binding: i2c: add generic properties for GPIO bus recovery Thread-Topic: [RFC PATCH 1/4] dt-binding: i2c: add generic properties for GPIO bus recovery Thread-Index: AQHWRkS/OBUazr8JiUiilPsVNX+PNqj5l1gAgB3AVoCAABRggIAEDVcAgAABjYCABJhKgIAGoYOAgAApAAA= Date: Mon, 3 Aug 2020 16:42:59 +0000 Message-ID: <765384b9-20dc-1a90-2a2c-89721d6ce5e8@microchip.com> References: <20200619141904.910889-1-codrin.ciubotariu@microchip.com> <20200619141904.910889-2-codrin.ciubotariu@microchip.com> <20200705211918.GB1055@kunai> <20200724193913.GD1227@ninjato> <20200724205209.GC1551@shell.armlinux.org.uk> <20200727105029.GI1551@shell.armlinux.org.uk> <1e788319-c841-d1f1-b65c-d25052f7f90b@microchip.com> <20200803141613.GN1551@shell.armlinux.org.uk> In-Reply-To: <20200803141613.GN1551@shell.armlinux.org.uk> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 authentication-results: armlinux.org.uk; dkim=none (message not signed) header.d=none;armlinux.org.uk; dmarc=none action=none header.from=microchip.com; x-originating-ip: [84.232.220.208] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 6c158e15-da3b-40fe-2af4-08d837cc480e x-ms-traffictypediagnostic: SN6PR11MB2605: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-bypassexternaltag: True x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: S/BGbOP6HbEWtSZe51dMv+fpWZF8rMfyTWfJdYb1DtuT2Of89JA76RTsz234J625TnvVZ+wL/oYvtgNE2rEYuRLAf883eGdJ53wvjI0dSOb4yHpe8swb2pA+JhBpIQr9QP1yhjKMddQy+M7we6VL9aaoe3Hz1nY2URHEHAmjc+QXQs08d1VhUCNmWEld3+N7aA+I2H777qtj6CcswXziXDm2YW5HjiL/lhw0k+IEP9Oq1rJ7Cch0I1YeX2Sdp4OAC9MR9nQo9alKnvU1UN+fjvvq8G8cCjI6wOtJUCYwRedjsfn0hBgotQ4CTUI36kQtQfAuDrFKGBMRjylXVGcb3ivsVLe31NPLVKjmQrFASgmbYnrSaeA0qkCEhJM/pXNAkbqFon2JxCTGhuU82MaCtiComoTQ3IAdWrEEE/Rz4QeBf2s5/IB1rCYwTdnbY69MZl3eJyon5Aw22pJuQ/sZioMTz7v/KLNFOIgcLN8HiKE= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SN6PR11MB3504.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(366004)(39860400002)(376002)(396003)(346002)(136003)(66946007)(6512007)(66556008)(64756008)(66446008)(66476007)(316002)(91956017)(31696002)(6486002)(6916009)(83380400001)(36756003)(4326008)(5660300002)(26005)(2616005)(76116006)(8936002)(8676002)(53546011)(186003)(54906003)(71200400001)(966005)(2906002)(478600001)(86362001)(31686004)(6506007)(41533002)(43740500002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: jfjv3U+rfqK3KEvzvv9dipIg5f9RlskPhhBtjYBDBEM3F17whGBbZf3bB0Hhuj5Xs+1xcsQtu45AOIo9kX5ylT5revpfeCrhFlVuwPz7b2RgksivdxLYnr9CP9gk1kx2SBQdk0DX5kLTgxRIobrc+j6JeYQjeSRbm+dy06YEUGK5NWZbyt7CVtOD4r+y4tGHj1q/d7J0w/Tpy6lkq8iOnI8j6WI0lE/3/xl3up+dqhyJQjm2Dwt8usPBQoB4VhDQiBRgjUWQ9atGOxWcC7a37JNdnqiKI955xXBVIh3/aGRRnuv4/CzYJSHb1VTCKxPGCcmzoopyEUSncYVYJ5jxhwWcoR15cRMPy/WhumwkW3R8YX0u9o9oXTdJdteRMcS2krdfZ8dzd1SIiAeAyHnU7AMpULxWX817EQ0UM8jrNQ/aXSVrGjMbcD2/koqZryZBQt8oPkVPvsR4CXQoreHHyua1QhZCyfr1/MYNe23/aLuFg7y2qlUq4oNZ7muL2Shv8tO+UFKQbSrjg/ahrMZP7NtfrnhLKEGh07QConQBODkBv/aRs2mSwhvBHEYQ2uHqK5ctE/htXxgB9t19fVwffgWJ/5JNy4+pNcA7P0fu9Tr/MkZESM5bVjwL3g9nrY6CXw9At97oO+4Gb29wVaEH1g== Content-ID: <5C2573C86544FC4FA538B903ECE4BF8A@namprd11.prod.outlook.com> MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SN6PR11MB3504.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 6c158e15-da3b-40fe-2af4-08d837cc480e X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Aug 2020 16:42:59.3221 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 2zO5erVai6GSDKQ9xC5Up++nG5YFNpwZ7Pquna7ufvgRwRuchHCMejqKCJEW8oAWnN0VgtG3PfX/DZgf6JpQuszD9qhfQpnvugcWKIQxmhE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR11MB2605 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200803_124305_513359_FC96DD84 X-CRM114-Status: GOOD ( 25.70 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, alexandre.belloni@bootlin.com, kamel.bouhara@bootlin.com, linux-kernel@vger.kernel.org, wsa@kernel.org, Ludovic.Desroches@microchip.com, robh+dt@kernel.org, linux-i2c@vger.kernel.org, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 03.08.2020 17:16, Russell King - ARM Linux admin wrote: > EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe > > On Thu, Jul 30, 2020 at 09:00:36AM +0000, Codrin.Ciubotariu@microchip.com wrote: >> On 27.07.2020 13:50, Russell King - ARM Linux admin wrote: >>> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe >>> >>> On Mon, Jul 27, 2020 at 10:44:57AM +0000, Codrin.Ciubotariu@microchip.com wrote: >>>> On 24.07.2020 23:52, Russell King - ARM Linux admin wrote: >>>>> EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe >>>>> >>>>> On Fri, Jul 24, 2020 at 09:39:13PM +0200, Wolfram Sang wrote: >>>>>> On Sun, Jul 05, 2020 at 11:19:18PM +0200, Wolfram Sang wrote: >>>>>>> >>>>>>>> +- pinctrl >>>>>>>> + add extra pinctrl to configure SCL/SDA pins to GPIO function for bus >>>>>>>> + recovery, call it "gpio" or "recovery" state >>>>>>> >>>>>>> I think we should stick with "gpio" only. That is what at91 and imx have >>>>>>> in their bindings. pxa uses "recovery" as a pinctrl state name but I >>>>>>> can't find any further use or documentation of that. PXA is not fully >>>>>>> converted to the best of my knowledge, so maybe it is no problem for PXA >>>>>>> to switch to "gpio", too? We should ask Russell King (cced). >>>>> >>>>> Fully converted to what? The generic handling where the i2c core layer >>>>> handles everything to do with recovery, including the switch between >>>>> modes? >>>>> >>>>> i2c-pxa _intentionally_ carefully handles the switch between i2c mode and >>>>> GPIO mode, and I don't see a generic driver doing that to avoid causing >>>>> any additional glitches on the bus. Given the use case that this recovery >>>>> is targetted at, avoiding glitches is very important to keep. >>>> >>>> Why is it not possbile to handle glitches in a generic way? I guess it >>>> depends on the pinctl, but we could treat a worst-case scenario to >>>> assure the switch between states is done properly. >>> >>> Please look at how i2c-pxa switches between the two, and decide whether >>> the generic implementation can do the same. >> >> The handling of glitches from initialization looks generic to me. I see >> that there are specific clear/reset routines that are in the >> (un)prepare_recovery() callbacks, but these callbacks are not replaced >> by the generic i2c recovery and will still be used if given by the >> driver. The only thing the generic recovery does is to switch the pinmux >> state. We can discuss whether we want to change the pinmux state first >> or call the (un)preapre_recovery(). > > Right, the key point i2c-pxa does is that on prepare: > - read the current state of the SCL and SDA lines and set the GPIO to > reflect those values. > - then switch the pinmux state. > > That must be preserved, otherwise if SCL is being held low by the I2C > master, and we switch to GPIO mode, SCL will be released. So the > driver needs to be involved before the pinmux state is changed. I understand, and I admit that I didn't see this case. In my mind, the master would always be in (almost) a reset state before calling for SDA recovery, so it won't hold any lines. These steps can't be generic, of course. Also, not all I2C masters have a way to show the state of its lines. For these masters, one idea would be to reset them before calling i2c_recover_bus() > > -- > RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ > FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel