Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2888197pxb; Mon, 18 Oct 2021 04:10:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw29uCzOKVg6mYgE6SQfiCEbeProC8F+LEHZWxircWbD9PQDJHdMpwhYSAz/RvhjIoJI6/T X-Received: by 2002:a05:6a00:b8f:b0:44c:6220:3396 with SMTP id g15-20020a056a000b8f00b0044c62203396mr27966656pfj.58.1634555405785; Mon, 18 Oct 2021 04:10:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634555405; cv=none; d=google.com; s=arc-20160816; b=VBM+q2NEqyOHcZTzBAExl02SLFeCuoczvV+YyhEHQVn3XeDzD3m4Ya3qdF0Ac/T9uo pYbgnNvOyXtXGjHZ19Pd9tzwH/cA0ChIUif6VGuxQLSX23S7SjPW2xqzDX4tzj0sHXAU Ara1130xLGh8xB2ghQStrx3Ve0k6BVRq3QKvvsHTpnVuaBfI+S+IVVVgQZRSN+as8QvD suejZ31CzrBRmEzQncJbzLIP+t6pxC6NfQ5WV5h52FqqjIRmxwI3L6/kwZxolYbX/BxF 7hiKHXHODl7NcIDuZTLPNbTn1J8BVw8PQ9Qx/vIK2X3WyIpMbJH87V/KSnybZPN++S5M RxKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=QOgC8pxmjF9aepOHP0H3P1eXLaQdqp/dZOE0JxtP14E=; b=nyOH/985N3Q1FbivKmriaT1Q/SKM3d+LDFLOttrF4x2dpY6CsPfwolZPaCk0UMimUR 4nBZ0Q2xhNF96hIzChc1Q/YIeqj7yGA2FTMhRyTKmQj7gq1+uTkbPfGZ6D2bKBaeUCds mpj14eFp0MG1RZM+O/khcqswc1MmMVv++1AHtftyKv9TECohdqRcG09YZPHkIqRL/t0X L3nzxJyTTFFkSCa5f8O5nJomg9okfdoAi+NQGTocuI8+ewdhfJPdOeZRL7kp5EYg/dly Yj+xxiBu0Ij9fHE8W0bTXhrC27VZlYWh3W4cqUYDLkP3p+heJQ4k+tkIoSEgquFtg9et t6eg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d6si20159669pls.271.2021.10.18.04.09.53; Mon, 18 Oct 2021 04:10:05 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229644AbhJRLKn (ORCPT + 99 others); Mon, 18 Oct 2021 07:10:43 -0400 Received: from mga17.intel.com ([192.55.52.151]:57548 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229473AbhJRLKm (ORCPT ); Mon, 18 Oct 2021 07:10:42 -0400 X-IronPort-AV: E=McAfee;i="6200,9189,10140"; a="209018329" X-IronPort-AV: E=Sophos;i="5.85,381,1624345200"; d="scan'208";a="209018329" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Oct 2021 04:08:24 -0700 X-IronPort-AV: E=Sophos;i="5.85,381,1624345200"; d="scan'208";a="444014675" Received: from smile.fi.intel.com (HELO smile) ([10.237.72.159]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Oct 2021 04:08:18 -0700 Received: from andy by smile with local (Exim 4.95) (envelope-from ) id 1mcQUp-00027p-P4; Mon, 18 Oct 2021 14:07:59 +0300 Date: Mon, 18 Oct 2021 14:07:59 +0300 From: Andy Shevchenko To: Tsuchiya Yuto Cc: Hans de Goede , Patrik Gfeller , Mauro Carvalho Chehab , Sakari Ailus , Greg Kroah-Hartman , Hans Verkuil , Aline Santana Cordeiro , Yang Yingliang , Dinghao Liu , Alan , linux-media@vger.kernel.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH 02/17] media: atomisp: pci: fix punit_ddr_dvfs_enable() argument for mrfld_power up case Message-ID: References: <20211017161958.44351-1-kitakar@gmail.com> <20211017161958.44351-3-kitakar@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211017161958.44351-3-kitakar@gmail.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 18, 2021 at 01:19:42AM +0900, Tsuchiya Yuto wrote: > When comparing with intel-aero atomisp [1], it looks like > punit_ddr_dvfs_enable() should take `false` as an argument on mrfld_power > up case. > > Code from the intel-aero kernel [1]: > > int atomisp_mrfld_power_down(struct atomisp_device *isp) > { > [...] > /*WA:Enable DVFS*/ > if (IS_CHT) > punit_ddr_dvfs_enable(true); > > int atomisp_mrfld_power_up(struct atomisp_device *isp) > { > [...] > /*WA for PUNIT, if DVFS enabled, ISP timeout observed*/ > if (IS_CHT) > punit_ddr_dvfs_enable(false); > > This patch fixes the inverted argument as per the intel-aero code, as > well as its comment. While here, fix space issues for comments in > atomisp_mrfld_power(). > > Note that it does not seem to be possible to unify the up/down cases for > punit_ddr_dvfs_enable(), i.e., we can't do something like the following: > > if (IS_CHT) > punit_ddr_dvfs_enable(!enable); > > because according to the intel-aero code [1], the DVFS is disabled > before "writing 0x0 to ISPSSPM0 bit[1:0]" and the DVFS is enabled after > "writing 0x3 to ISPSSPM0 bit[1:0]". > > [1] https://github.com/intel-aero/linux-kernel/blob/a1b673258feb915268377275130c5c5df0eafc82/drivers/media/pci/atomisp/atomisp_driver/atomisp_v4l2.c#L431-L514 > > Fixes: 0f441fd70b1e ("media: atomisp: simplify the power down/up code") > Signed-off-by: Tsuchiya Yuto > --- > drivers/staging/media/atomisp/pci/atomisp_v4l2.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c > index 0511c454e769..f5362554638e 100644 > --- a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c > +++ b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c > @@ -711,15 +711,15 @@ static int atomisp_mrfld_power(struct atomisp_device *isp, bool enable) > > dev_dbg(isp->dev, "IUNIT power-%s.\n", enable ? "on" : "off"); > > - /*WA:Enable DVFS*/ > + /* WA for PUNIT, if DVFS enabled, ISP timeout observed */ P-Unit > if (IS_CHT && enable) > - punit_ddr_dvfs_enable(true); > + punit_ddr_dvfs_enable(false); > > /* > * FIXME:WA for ECS28A, with this sleep, CTS > * android.hardware.camera2.cts.CameraDeviceTest#testCameraDeviceAbort > * PASS, no impact on other platforms > - */ > + */ > if (IS_BYT && enable) > msleep(10); > > @@ -727,7 +727,7 @@ static int atomisp_mrfld_power(struct atomisp_device *isp, bool enable) > iosf_mbi_modify(BT_MBI_UNIT_PMC, MBI_REG_READ, MRFLD_ISPSSPM0, > val, MRFLD_ISPSSPM0_ISPSSC_MASK); > > - /*WA:Enable DVFS*/ > + /* WA:Enable DVFS */ > if (IS_CHT && !enable) > punit_ddr_dvfs_enable(true); > > -- > 2.33.1 > > -- With Best Regards, Andy Shevchenko