Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp547815rdg; Thu, 12 Oct 2023 13:16:39 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG5wMrZuCJi+Ddf+vkx+Kqmn/B3Al+KHG5+z7Bh3/VcyhYzCPOI8aqW/Yry36YADk6dfvtC X-Received: by 2002:a05:6a21:6d87:b0:16c:b95c:6d35 with SMTP id wl7-20020a056a216d8700b0016cb95c6d35mr21437006pzb.50.1697141799450; Thu, 12 Oct 2023 13:16:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697141799; cv=none; d=google.com; s=arc-20160816; b=TcLjR97wBnOdoOsrTOmqL/vYJ19Yv4ceON+mK4SjJqSB80WjSizjtQlYftTnczV1xu lP/DE1b/lMxik+tZKBj1nvWtQSE9GGgeFme7j8Awy/wvx19D9J9nMLWPPaBn47y6+Utk GqZbMgk3E44UP/tbzIsJDOQ4dtSnBgqHCqoNj1rQFAyvD7/tjBzLqoR+lkpFEIJAFe8d m6atY7Jz6y/z2S040HBIP8Y59ib4hdcJ6BNCMFfau9J/FPN5VNWz+ovii11RLtMin9Rx 1cd6TM7pnXh0iY8VWaJSWrJ4otD3uXpBHEC1Xz/oylBdfLqygzCNwUc77HSdrOepe0gF VtVw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=CAzULuCns0IAPFBGXJVw0mISg9eBR26oeFTofdMhwQo=; fh=upJMRRNO6sNgYtpohxBESBs4x04z1o6k4gbVYPIV2bo=; b=NIXSH69gTyYwweXufHLwpQw8OLPjWdmZD3HNgxxvW/2Q9lrpes4Ed1RyvWlXjNWv5v Wuy5OORRnQcuKyNlmUOAhvCyrh0cNsmmZDBFjTf6UzsfTjmD7+ejFTlYSdyFbcTuHLM3 NP9E62GQajdGMpez6szyNb6yVzUYSnEnPE0edsp5fbGpQkeSPtDueNfdj7wkfTAnsPBy c0zTAuuM3R+ICatP0wmvev0TecmSLFSL1s5tZgQqn6zQoN1bHPDo3KSJWYZ1YTohOn7O oqsMBxYrH2gakLEEx2PP6UZyjTvr1YnNR9MoMRMUjiJcIkYxTZ6+kFxDm5pydgxYNGef wrNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=V+oU7ODQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id gt12-20020a17090af2cc00b002680abc3699si2955565pjb.115.2023.10.12.13.16.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Oct 2023 13:16:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=V+oU7ODQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 0818080964EA; Thu, 12 Oct 2023 13:16:07 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442540AbjJLUPt (ORCPT + 99 others); Thu, 12 Oct 2023 16:15:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344131AbjJLUPs (ORCPT ); Thu, 12 Oct 2023 16:15:48 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 65BF0C0; Thu, 12 Oct 2023 13:15:46 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1CEDAC433C8; Thu, 12 Oct 2023 20:15:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1697141746; bh=uxbafwMSKPAuWsobVTD03FL1mfzA+6nOjp0q9wlUssc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=V+oU7ODQy+l57RW4bWyZRK7Ux1uSerl0wn8edtUk8VEVXSI0y/d1sBMe4JG8HGAun pRFHcNn/492mMeowUMSi6Z/PN5t2TtgABuW2wy6nax/4+0mJx9Kz3HTyatldrte+PM 0QEBSPBNda4hF0nY5xPYeOh4FLLljGOPsYupsQ9Hf+FireOhpcJUuzy2WE4Cdx6Got iP8sgPFkYupDDQJsv4icPkmwiTOJWhYOi128RRgytb9SxegDRIOgOBR1iPWzAJ7UVG /n20nEo5EnTugsDaJ25nlluOL3dmQf7+S4wYn+xBvOJeD8CvHtjrOuWcJ2NE7iu0ne un5ziBP4YecrA== Date: Thu, 12 Oct 2023 22:15:41 +0200 From: Andi Shyti To: Chris Packham Cc: gregory.clement@bootlin.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, pierre.gondois@arm.com, linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 3/3] i2c: mv64xxx: add support for FSM based recovery Message-ID: <20231012201541.nzlxyjngm3d5asir@zenone.zhora.eu> References: <20231006003321.2100016-1-chris.packham@alliedtelesis.co.nz> <20231006003321.2100016-4-chris.packham@alliedtelesis.co.nz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231006003321.2100016-4-chris.packham@alliedtelesis.co.nz> X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Thu, 12 Oct 2023 13:16:07 -0700 (PDT) Hi Chris, ... > +static int > +mv64xxx_i2c_recover_bus(struct i2c_adapter *adap) > +{ > + struct mv64xxx_i2c_data *drv_data = i2c_get_adapdata(adap); > + int ret; > + u32 val; > + > + dev_dbg(&adap->dev, "Trying i2c bus recovery\n"); > + writel(MV64XXX_I2C_UNSTUCK_TRIGGER, drv_data->unstuck_reg); > + ret = readl_poll_timeout_atomic(drv_data->unstuck_reg, val, > + !(val & MV64XXX_I2C_UNSTUCK_INPROGRESS), > + 10, 1000); mmmhhh... still a bit skeptical about waiting 100 times 10us in atomic. I'm still of the opinion that this should run in a separate thread. Any different opinion from the network? BTW, first question, considering that you decreased the time considerably... does it work? Andi