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,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, 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 43B5BC433E1 for ; Thu, 6 Aug 2020 18:42:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8BD90221E3 for ; Thu, 6 Aug 2020 18:42:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MyRZbQfG" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728472AbgHFSmg (ORCPT ); Thu, 6 Aug 2020 14:42:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57104 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727939AbgHFSUB (ORCPT ); Thu, 6 Aug 2020 14:20:01 -0400 Received: from mail-lf1-x141.google.com (mail-lf1-x141.google.com [IPv6:2a00:1450:4864:20::141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B82DC0617A2; Thu, 6 Aug 2020 11:18:39 -0700 (PDT) Received: by mail-lf1-x141.google.com with SMTP id b30so26611445lfj.12; Thu, 06 Aug 2020 11:18:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=zyDgQ58yfMwWuCC3duccdkOno3vWVcRNh6nKRXhidek=; b=MyRZbQfGm1TKcB+zBssqDMtxcidwjYO7hE4TlnATgTe0SqNa0BctoPeiVmFPhWxaxw 9HgsPi+ytgS6C+dLS5cbg0t0zGUI60l7w7qf/X76752INI/nDLHSPBvwvEwIxHkg72yr t1fYK9Exm0UHawEzsVglsQvCFsKhh/WbzOc/0g23Wo7JMNB/zosNweCHyQ2LegAovw05 WJ3fpKjmLSt7TgLgMRKQU3ArR+P/c9OM3aRMi98LMDd/HJX3vg5qP+/AzIuUBlYSNOkA oQyNWVqpRJlY7P35stTlbYDVn/6G4U4AAhKrSI/lKFSErmYn1AgtYwJ6iTmw+k9jSvsP 9WdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=zyDgQ58yfMwWuCC3duccdkOno3vWVcRNh6nKRXhidek=; b=FhyP0Nfzr24jUSUFQ8fqTltCvBNEe8LZsNSLvoewUNY6us5ZV+uc4+4yoFMEKQNjDB 9GljJU84S5p+pAUZBWt5bJnl6TebTu+TgcRXHxhWPdVvJz/R6wtAvBRFwBk5J3IGWGy4 T533yTqL5lkDKBneHhlMwgd0bndgCKkCHWEKNs5JOQSUqPR6/LJuGPsZmW+vMEi3HnDm RZwxmocv6A0sMC7sc8+VmDQLVlc+k2pMQ2+3Iz93vUWvoJOcdyoklMGBZxJRdizQ6vSn MoqA3zqBJja5TNDX1OkIPuw052LzSe8VEUx+y488bnJuMIekgleSIceyokd43z+xOvLJ +b3A== X-Gm-Message-State: AOAM530qLF2xi/+NlrRlTq0Pd+RyCpcAKc0S3CbFxTui5x4WomIuD8WU VUvazRwHhNA1LM+T2k8PBu1D1lEA X-Google-Smtp-Source: ABdhPJwsXrrzhKIHd4U+0mxTpUSDS+7zShPN2F0Yc4n/A8sv96yqeEPFnojDg1v3UbYpBfNORZD/4A== X-Received: by 2002:ac2:5e2c:: with SMTP id o12mr4378022lfg.71.1596737916355; Thu, 06 Aug 2020 11:18:36 -0700 (PDT) Received: from [192.168.2.145] (94-29-41-50.dynamic.spd-mgts.ru. [94.29.41.50]) by smtp.googlemail.com with ESMTPSA id 1sm2751561ljr.6.2020.08.06.11.18.34 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 06 Aug 2020 11:18:35 -0700 (PDT) Subject: Re: [PATCH v8 08/10] gpu: host1x: mipi: Keep MIPI clock enabled till calibration is done To: Sowjanya Komatineni , Thierry Reding Cc: jonathanh@nvidia.com, frankc@nvidia.com, hverkuil@xs4all.nl, sakari.ailus@iki.fi, robh+dt@kernel.org, helen.koike@collabora.com, gregkh@linuxfoundation.org, linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org References: <1596469346-937-1-git-send-email-skomatineni@nvidia.com> <6eede805-80fd-016f-22f8-b6d25f6587af@nvidia.com> <1c12e40e-de7f-0599-a941-82760b4c7668@gmail.com> <9ef0b875-e826-43e2-207e-168d2081ff6a@nvidia.com> <4689cfe9-e7c4-48bf-217f-3a31b59b8bda@nvidia.com> <0e78c5ca-c529-1e98-891d-30351c9aae81@gmail.com> <309e3b66-9288-91ef-71b4-be73eacbbd62@nvidia.com> <4025a458-fa78-924d-c84f-166f82df0f8e@gmail.com> <4f15d655-3d62-cf9f-82da-eae379d60fa6@nvidia.com> <412f8c53-1aca-db31-99a1-a0ecb2081ca5@nvidia.com> <61275bd6-58e7-887f-aa7d-8e60895e7b2b@nvidia.com> <6ff57c38-9847-42b0-643b-0d167c13779f@gmail.com> <26ed2841-db5d-aeb0-11c7-cbe2ddd1d76b@gmail.com> From: Dmitry Osipenko Message-ID: Date: Thu, 6 Aug 2020 21:18:34 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-tegra-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-tegra@vger.kernel.org 06.08.2020 21:07, Sowjanya Komatineni пишет: > > On 8/6/20 11:01 AM, Dmitry Osipenko wrote: >> 06.08.2020 20:52, Sowjanya Komatineni пишет: >> ... >>> Right mutex_unlock should happen at end of finish_calibration. >>> >>> With keeping mutex locked in start, we dont have to check for active to >>> be 0 to issue start as mutex will keep it locked and other pads >>> calibration can only go thru when current one is done. >>> >>> So instead of below sequence, its simpler to do this way? >>> >>> start_calibration() >>> >>> - mutex_lock >>> >>> - wait for 72uS after start >>> >>> finish_calibration() >>> >>> - keep check for ACTIVE = 0 and DONE = 1 >> I think only the DONE bits which correspond to the mipi_device->pads >> bitmask should be awaited. > > As next START can't be triggered when auto cal is ACTIVE, we should keep > this in finish. > > As we do mutex_unlock only at end of finish, other pads calibrations > dont go thru till the one in process is finished. > > So in this case ACTIVE applies to current selected pads that are under > calibration. Should be better to check only the relevant bits in order to catch bugs, otherwise you may get a DONE status from the irrelevant pads. >>> - mutex_unlock() >> Perhaps the start_calibration() also needs to be changed to not touch >> the MIPI_CAL_CONFIG bits of the unrelated pads? > Driver already takes care of programming corresponding pads config only. It writes 0 to the config of the unrelated pads, which probably isn't nice if some pads use periodic auto-calibration. https://elixir.bootlin.com/linux/v5.8/source/drivers/gpu/host1x/mipi.c#L350 Although looks like auto-calibration isn't supported by the current driver.