Received: by 2002:ac2:464d:0:0:0:0:0 with SMTP id s13csp2001916lfo; Sat, 28 May 2022 13:25:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxVAd2SEYenwmbqDb3p5p5GG5hGGW2RNml6s8ixKv4n6kYT6mUEbxkqzf3Or9Ggl1s0g83y X-Received: by 2002:a63:8043:0:b0:3fb:984f:69b2 with SMTP id j64-20020a638043000000b003fb984f69b2mr9750725pgd.108.1653769523617; Sat, 28 May 2022 13:25:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653769523; cv=none; d=google.com; s=arc-20160816; b=fzFrRSxWvk14pCNCzo/6927TeycIueA0NIk8ENGNEjS1ecCrlzwLuqPRywKQDOGRNu j1Xu2HlOy1ZP4bEhFranWRRRbekClCcgNjakAbsPJPnP/BP9NTLF+JryStDInppa4osM J1UBoTMVAbgqDEq2aB8Q+DAthb5OaEvvVa3FdbhR0HM4Kt3QvuYi9tg4etUFKt+7IpFi 0objQxBYafKqyqxxMKZog0kmQXvEzHYYSfe4HYAdPWjAjePmujenF6PM+YQsmJRESdsz ZiqBqhKq30oPqek7m63dLsENWsXOt5Mj8rG1t4OaVHUuKppMQ/wKnMjrEEnGXqgkr0wb Slqg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=F0WlKat7aSoUO77AjZ+P+rhGJdlCqPP3r6pQfQ/pzcw=; b=Y4vbjXPRdgYIe9N5QdIQUxtTkc2a+wKKXWh3u5nzg/VzmsUuyYblw10y5vW8FnFQGH IFmVuS1Dr2chl/H+H1xmQZnGXWO7ZbqbCGdSE9twpMUMfSCXgdCMGiKCUokXAu6lGs2H 3ksDjV3C/on3JI1OoWXXzQ08lc50qPZd/AyRShdAsvng1kFQ7YdGSf9cHj25a9jAD2J8 F9TN9zOHG7G2ALqCV9sHwwLtySLoKEeCcdn0++gMXx88BSGrocoqAFLBrJIpo/xD+jJe f9qAQVYMoqWiLNtaVXLQioGtDnyjE6CXQflKUpzGaOaUDY1ChtYfAnm6ghyD/cyKiY7Q NwZw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SwRUJPwz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id d123-20020a636881000000b003f62669e1a7si10486524pgc.767.2022.05.28.13.25.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 May 2022 13:25:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SwRUJPwz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9D0101796DD; Sat, 28 May 2022 12:32:47 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344721AbiEZTJD (ORCPT + 99 others); Thu, 26 May 2022 15:09:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35430 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229896AbiEZTJB (ORCPT ); Thu, 26 May 2022 15:09:01 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C797DBA55A; Thu, 26 May 2022 12:09:00 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 8776CB821AA; Thu, 26 May 2022 19:08:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 61EEBC385A9; Thu, 26 May 2022 19:08:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1653592138; bh=Tmtblp5WjlLWc8JQfBqXUxUtQqL2wo/TVVPY6RHiXl4=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=SwRUJPwzs7dNhqM/Hk1X4C/h8vQF9gF7PnGt43HJVqTs22Qf9YK5Lfu3OkFoOfu26 g5t9UZNyASt93JGKMzdT1dtKHulUUUStmmN4ecaVMPSwwg4nbNBROG+Q4MVcV7U8cO pWoW8G+1cWkAQN+7vLaCyleISQfUIJcZEdnRr7+JxH+wrshIiru/7PpzpfNevQjkqz VdTOt6BSoQNp6JkTf5UTDv1tM0OJIJaEVJqXKLowShhUSiUHJcWiJsr3JmdCI6xsHE Nd1q4akU2/72v20a0Xl3ETpIVb+4NFWiYsp6wMpEQ/IN7LutYSllfoUM/iEralcdD9 JjifB4EKOweBw== Message-ID: <3dafa370-cd77-e3ba-a48b-2ca3674432ab@kernel.org> Date: Thu, 26 May 2022 14:08:55 -0500 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: [PATCHv2 1/2] i2c: designware: introduce a custom scl recovery for SoCFPGA platforms Content-Language: en-US To: Andy Shevchenko Cc: jarkko.nikula@linux.intel.com, mika.westerberg@linux.intel.com, robh+dt@kernel.org, krzk+dt@kernel.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org References: <20220524135441.420600-1-dinguyen@kernel.org> From: Dinh Nguyen In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/24/22 11:43, Andy Shevchenko wrote: > On Tue, May 24, 2022 at 08:54:40AM -0500, Dinh Nguyen wrote: >> The I2C pins on the SoCFPGA platforms do not go through a GPIO module, >> thus cannot be recovered by the default method of by doing a GPIO access. >> Only a reset of the I2C IP block can a recovery be successful. > > Better now, but see my additional comments. > > ... > >> + switch (dev->flags & MODEL_MASK) { >> + case MODEL_SOCFPGA: >> + rinfo->recover_bus = i2c_socfpga_scl_recovery; >> + break; >> + default: >> + rinfo->recover_bus = i2c_generic_scl_recovery; >> + break; >> + } > >> + adap->bus_recovery_info = rinfo; > > Usually we do not assign the pointer while data structure is incomplete. > That's said, please leave this line as it was. > > On top of that, why you can't move the above switch to the place where old > function was assigned? > I have to put the switch statement before the call to devm_gpiod_get_optional(), otherwise the recover_bus function pointer will not get set. Dinh