Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp2229187rwi; Thu, 3 Nov 2022 14:24:23 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6xxPcboSh3ijLcqecOdtxCJvdFkvk7HoV6cU243aKB3d4Jo2LOiJTZgWXKHBVfDffpRKBF X-Received: by 2002:a17:90b:3c8a:b0:213:e48a:3ac5 with SMTP id pv10-20020a17090b3c8a00b00213e48a3ac5mr24251227pjb.48.1667510663194; Thu, 03 Nov 2022 14:24:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667510663; cv=none; d=google.com; s=arc-20160816; b=vMAV5EoJVm1cfvyPJygFe736b2A3K8gkJPHeM39+TAAwWaao70XUH3+H0T5jgWurH5 2BSzvASyZdvQqXzaod3cwoimLcWliaZ2VxNI9wTo6OaVjWsefYyGOaTXNKlLQIxXGrfe kmX8hA7uU9F8j5/+PE0M6eGfIB3i10rDw6oxVifofAOjNpKJNphLBr+LlXQzs8Kgi6rP KkPs5AY37sXT6nwDK1S0l2OTLuOTpPz2shabl2zPb59mgfYeCwMf4CafDKBZdb4RbHPO gFUMzGSPMFuwxjSmFsVSfPZuO+n+elOFEdQF8uYyq7X23HHBf7ofuQPwigzCVPiw1ZuE 5Ocw== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=qDqLxSxQeh8b6S56qSaP+lxKwU7V25rhv7UQIH3z1Hw=; b=GKNz5Q7iG3aZUMvK7mvoMPylhGVgkF5DDDRUgA8oh/GdTOlG7e5hV4GPNOeNUlJXEN KBERcnkX7+2EP2tkYn4vwkVs6yiGc0mGqi7nC3DVplJsLAaGz9y7dibTXRtvs0FCXzja IQ9h3MNsHJ4ilX2AhChjhR8j4uCs2A6J4pzkURTY6/fdnUx7GipB2cnH4B1N76hnQ01m gHZ4LSkjMlNODcf4ZhvfwyeFKY+hyDxB3CoxApS045XrC4ZH1iphjuedyBnvtjDAppvM 9A2zR32a4hH9cfK21GlXfM/b/912KtoyyjU8MzoV+n7M0D/QlhyDN85D3T3kx1Yz2u0R Uqtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=PyWTvoWW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y9-20020a170902b48900b0017865059c4bsi1671679plr.401.2022.11.03.14.24.11; Thu, 03 Nov 2022 14:24:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=PyWTvoWW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229993AbiKCUct (ORCPT + 97 others); Thu, 3 Nov 2022 16:32:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229461AbiKCUcr (ORCPT ); Thu, 3 Nov 2022 16:32:47 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C32AEB0E; Thu, 3 Nov 2022 13:32:46 -0700 (PDT) Received: from notapiano (unknown [IPv6:2600:4041:5b1a:cd00:524d:e95d:1a9c:492a]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: nfraprado) by madras.collabora.co.uk (Postfix) with ESMTPSA id 9F0FD660295F; Thu, 3 Nov 2022 20:32:42 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1667507565; bh=s7VMS6sqPzrxI8wodWazep6RmdDGQpqaH/k/O9pHKSU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=PyWTvoWWaPdngbDHe6Uw6YzacdFUVXdkGMEna87bwd7WXTwo7FBZlufZIkMHJJLEy GHf4bVNU4VLMlQxhB+3hMwsKv/szkmIh8atjChM7QikeF3pQtpDvUT1TUh1ix3GyTA Gt7Z0cqtZBPgBqcAf9onCOHOEoFlN6S4b/fC75qKhqu9oavCf0T3HMfqEkRisS1odX WsAA1nTCMG5qF0aWuNAnC0fDyeCP9H0TaOEFwOJLFFqxyMdPg5pdbDPEeoavSrKRAQ y1KhleAdaAeC1pxVT7LIbZ9gfHjNfp0eOXLf10t8XwpJhV6d28jeOFloLW1rRwnUKJ RBu8+uxv8tkHA== Date: Thu, 3 Nov 2022 16:32:38 -0400 From: =?utf-8?B?TsOtY29sYXMgRi4gUi4gQS4=?= Prado To: "Nancy.Lin" Cc: Rob Herring , Matthias Brugger , Chun-Kuang Hu , Philipp Zabel , wim@linux-watchdog.org, AngeloGioacchino Del Regno , linux@roeck-us.net, David Airlie , Daniel Vetter , Nathan Chancellor , Nick Desaulniers , "jason-jh . lin" , Yongqiang Niu , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, dri-devel@lists.freedesktop.org, llvm@lists.linux.dev, singo.chang@mediatek.com, Project_Global_Chrome_Upstream_Group@mediatek.com Subject: Re: [PATCH v27 05/11] soc: mediatek: refine code to use mtk_mmsys_update_bits API Message-ID: <20221103203238.fryjwpgjtwccnjwu@notapiano> References: <20221103032512.9144-1-nancy.lin@mediatek.com> <20221103032512.9144-6-nancy.lin@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20221103032512.9144-6-nancy.lin@mediatek.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham 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 Thu, Nov 03, 2022 at 11:25:06AM +0800, Nancy.Lin wrote: [..] > --- a/drivers/soc/mediatek/mtk-mmsys.c > +++ b/drivers/soc/mediatek/mtk-mmsys.c [..] > +static void mtk_mmsys_update_bits(struct mtk_mmsys *mmsys, u32 offset, u32 mask, u32 val) > +{ > + u32 tmp; > + > + tmp = readl_relaxed(mmsys->regs + offset); > + tmp = (tmp & ~mask) | val; You should mask the value before writing to prevent bad values from overwriting bits outside the mask. tmp = (tmp & ~mask) | (val & mask); With that, Reviewed-by: N?colas F. R. A. Prado Thanks, N?colas