Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp965761ybh; Sun, 19 Jul 2020 04:35:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw2oohfnKrW+FO3Lj/rkRn5BQKMbzsKCrJCE91EZfwcCMWF1Nx2+6sglfYRu1OG1cdlcgA1 X-Received: by 2002:aa7:cdca:: with SMTP id h10mr17640583edw.285.1595158532852; Sun, 19 Jul 2020 04:35:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595158532; cv=none; d=google.com; s=arc-20160816; b=tP729CURcZrFnaMMqtJeODaYk0iVlwMBXR/RGbmlc310jsQHZkXDnNJBFFST5Oa9LL uZWAIv/0kc4vYtFXOAqxjB4ILidr/BrKcXAtxuSN2kzHWV7PvKjEX3eu377dNucRXP36 MZLnHnNmpZvIf5JjzRL7AUNvbMAlBTMSv4MhevgJ4BffjwMwf5mvKORODg4S5pd8Zr/C 2q8w+aMzaELabHJQVDijBE4T0G3KdC5NBZyca4ztERMD1oyMSw+2KBbpvmPAv0Ab+dph rD9wgEbiCx10t7VCMo5QFxkqto5E74JYkGo4LZw50OQdrI4GvkQLojZ6oNe3Bv7Iugrg noTQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=fFFzzJfYA5PwWVc7WjgQdbwm3RUnP3Z8JDNK9IM9pz0=; b=U1PYlNdxVQodChVgugw2VQXrhq0S8P2OH92u9f0N9et/Dbh8cSFzasmjO8aV4rjZZH l57GktuUhFbQAOSZaV6lGa2H3CLxjIOcCOp7xBsNKBZEZ7YdyG7bkhcrMncXBQBw8Qze 0bn1nRkowFgbKX9wZs/0mNbgZNmMcwm401et59Y2L/an8ahLMllE3sq8YfBUZQDrxiJF y+QkIPOwtwWaANZrS1ONJY5CQX7Smxh+8D4bhvOeE0RIxZMtQ8eJwcIXG/ElhNwLvCn4 80F4Q0q+jlr/Y7b5f1K8AH3M0bBV51G6Jwjh2WCcSZZ6ojebhALqJ8hQM77KBxg6f9N5 Ez5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=leDcwIaI; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id me7si8468806ejb.716.2020.07.19.04.35.10; Sun, 19 Jul 2020 04:35:32 -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; dkim=pass header.i=@kernel.org header.s=default header.b=leDcwIaI; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726123AbgGSLex (ORCPT + 99 others); Sun, 19 Jul 2020 07:34:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:45380 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725988AbgGSLex (ORCPT ); Sun, 19 Jul 2020 07:34:53 -0400 Received: from coco.lan (ip5f5ad5c5.dynamic.kabel-deutschland.de [95.90.213.197]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E75B920734; Sun, 19 Jul 2020 11:34:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1595158492; bh=uVWHh1TqjC+xE6xa1USm9QdMA2OAnJSw/OW+SY+sf7w=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=leDcwIaInJFE/EUWPaKZz04R6jjvPKM03rxtvj7Cfb1MtYX61gSqt4Xk7Z7NcI02c 0mcuTuMLTjqyTbbYeKS49HSITMSemNVTaEBlfNPajwJzeqovBPawWCClYbF4nGeym5 XQCF86PWCwpNb/7aCIND+boDi6Gi4hmIpAOVZieI= Date: Sun, 19 Jul 2020 13:34:48 +0200 From: Mauro Carvalho Chehab To: Colin King Cc: Sakari Ailus , linux-media@vger.kernel.org, devel@driverdev.osuosl.org, kernel-janitors@vger.kernel.org, Greg Kroah-Hartman , linux-kernel@vger.kernel.org Subject: Re: [PATCH] media: atomisp: fix mask and shift operation on ISPSSPM0 Message-ID: <20200719133448.481cffc5@coco.lan> In-Reply-To: <20200716145138.1708693-1-colin.king@canonical.com> References: <20200716145138.1708693-1-colin.king@canonical.com> X-Mailer: Claws Mail 3.17.5 (GTK+ 2.24.32; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Thu, 16 Jul 2020 15:51:38 +0100 Colin King escreveu: > From: Colin Ian King > > Currently the check on bits 25:24 on ISPSSPM0 is always 0 because > the mask and shift operations are incorrect. Fix this by shifting > by MRFLD_ISPSSPM0_ISPSSS_OFFSET (24 bits right) and then masking > with RFLD_ISPSSPM0_ISPSSC_MASK (0x03) to get the appropriate 2 bits > to check. > > Addresses-Coverity: ("Operands don't affect result") > Fixes: 0f441fd70b1e ("media: atomisp: simplify the power down/up code") > Signed-off-by: Colin Ian King Thanks! With this patch, we can revert this one too (patch enclosed): d0213061a501 ("media: atomisp: fix mask and shift operation on ISPSSPM0") I tested it already: the IUNIT power on/off code is working properly after both patches. Thanks, Mauro - [PATCH] Revert "media: atomisp: keep the ISP powered on when setting it" changeset d0213061a501 ("media: atomisp: fix mask and shift operation on ISPSSPM0") solved the existing issue with the IUNIT power on code. So, the driver can now use the right code again. This reverts commit 95d1f398c4dc3f55e9007c89452ccc16301205fc. Signed-off-by: Mauro Carvalho Chehab diff --git a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c index e31195816b2d..a000a1e316f7 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_v4l2.c +++ b/drivers/staging/media/atomisp/pci/atomisp_v4l2.c @@ -766,17 +766,13 @@ static int atomisp_mrfld_power(struct atomisp_device *isp, bool enable) /* Workaround for pmu_nc_set_power_state not ready in MRFLD */ int atomisp_mrfld_power_down(struct atomisp_device *isp) { - return 0; -// FIXME: at least with ISP2401, the code below causes the driver to break -// return atomisp_mrfld_power(isp, false); + return atomisp_mrfld_power(isp, false); } /* Workaround for pmu_nc_set_power_state not ready in MRFLD */ int atomisp_mrfld_power_up(struct atomisp_device *isp) { - return 0; -// FIXME: at least with ISP2401, the code below causes the driver to break -// return atomisp_mrfld_power(isp, true); + return atomisp_mrfld_power(isp, true); } int atomisp_runtime_suspend(struct device *dev)