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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A5315C00528 for ; Mon, 31 Jul 2023 16:55:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:References: List-Owner; bh=zTeapp46puv2Kybz4x6tNsSNtuY/lmcYE8ySpk4/RJw=; b=xwv5c5HjQCexEG ZjD6S7mpgm3i5FSqcr1N/2kOKmV225O8X4i/fJqM/26OP+FpiJ/U9fIvHibe2/f0LNHvEoZMglP8Q MGm4N+4b0omP7kK+5LXAZ4PBUW7mfTlwgsDvF1ZfWwCW6pOhn6UtETm9Y5yArGen8SntC1YlQ2/KP 9r/LNhLRIRcH1CfcU1WVpwMpQdegLlAdiklwgWqNzUeIuZbqFUwsp9FARoWmRGXDKO+ue2JbRbaTK SDJ4/fA7gWtZlxYltoh41i4233nwxbyfnLObBd2TvHFWkGubxmzZqeyLKZ8bcudBDRhC9DRvNfPpL olDcWTVl6n/VnW16+3gw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qQWAi-00Gc1w-05; Mon, 31 Jul 2023 16:55:04 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qQWAf-00Gc15-1X for linux-arm-kernel@lists.infradead.org; Mon, 31 Jul 2023 16:55:03 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 71B2161238; Mon, 31 Jul 2023 16:55:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6C182C433C8; Mon, 31 Jul 2023 16:54:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1690822499; bh=P+oZaYwkspIaNJxLa9jftp8BzKB/m6+tOlqYJtPkrv8=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=lZhTM58/UsAB7ghAERsf/f2VKck7rHwk4a29K7eBveq/fkUzLUIxsJzg+nzCl69uF XW7wkrLRDvCuuCPcMGbdN2Rz8illQSPfAc/J0x2h21xWzQbsKFidB5mklaeLONcHi/ f68Hko0+LxX7gglkr8ey32Wt33KU+DLHwa5GUUzG/giKw9AptTvtH1ZRTHQJlmbjQa BOOf1ytXM190mCZTL2VwE+XF7JB6PY1cILASQsnZOvG8j8GMM24lExSYAD/yl76cbc NbwYpr/6wGXNar3QDMX4Cc347Ld6s2c/ryVzxHA4ShnAwNjXA9fB1E4imN0iJTzA2C Uzai8WiNb60ag== Date: Mon, 31 Jul 2023 11:54:57 -0500 From: Bjorn Helgaas To: Frank Li Cc: Manivannan Sadhasivam , lorenzo.pieralisi@arm.com, bhelgaas@google.com, devicetree@vger.kernel.org, gustavo.pimentel@synopsys.com, imx@lists.linux.dev, kw@linux.com, leoyang.li@nxp.com, linux-arm-kernel@lists.infradead.org, linux-imx@nxp.com, linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, mani@kernel.org, minghuan.lian@nxp.com, mingkai.hu@nxp.com, robh+dt@kernel.org, roy.zang@nxp.com, shawnguo@kernel.org, zhiqiang.hou@nxp.com Subject: Re: [PATCH v5 1/2] PCI: dwc: Implement general suspend/resume functionality for L2/L3 transitionse Message-ID: <20230731165457.GA13422@bhelgaas> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230731_095501_580170_99DC690F X-CRM114-Status: GOOD ( 14.45 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Fri, Jul 28, 2023 at 11:49:28AM -0400, Frank Li wrote: > On Fri, Jul 28, 2023 at 09:02:38PM +0530, Manivannan Sadhasivam wrote: > > On Mon, Jul 24, 2023 at 05:58:29PM -0400, Frank Li wrote: > > > Introduced helper function dw_pcie_get_ltssm to retrieve SMLH_LTSS_STATE. > > > Added API pme_turn_off and exit_from_l2 for managing L2/L3 state transitions. > > > ... > > > +static void dw_pcie_set_dstate(struct dw_pcie *pci, pci_power_t dstate) > > > +{ > > > + u8 offset = dw_pcie_find_capability(pci, PCI_CAP_ID_PM); > > > + u16 val; > > > + > > > + val = dw_pcie_readw_dbi(pci, offset + PCI_PM_CTRL); > > > + val &= ~PCI_PM_CTRL_STATE_MASK; > > > + val |= ((u16 __force)dstate) & PCI_PM_CTRL_STATE_MASK; > > > > Why can't just, > > > > val |= dstate; > > fixed a build warning. > > Closes: https://lore.kernel.org/oe-kbuild-all/202307211904.zExw4Q8H-lkp@intel.com/ This is the sparse warning from the lkp URL: sparse warnings: (new ones prefixed by >>) >> drivers/pci/controller/dwc/pcie-designware-host.c:824:13: sparse: sparse: invalid assignment: |= >> drivers/pci/controller/dwc/pcie-designware-host.c:824:13: sparse: left side has type unsigned int >> drivers/pci/controller/dwc/pcie-designware-host.c:824:13: sparse: right side has type restricted pci_power_t We have a zillion of those warnings already (try "make C=2 drivers/pci/"). Personally I think it's better to omit the ugly cast and live with the warning for now. Someday somebody will figure a better way to use pci_power_t that will fix all these warnings at once. I'd rather wait for that fix than clutter all the uses with casts like this. Bjorn _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel