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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A25E1CD37BB for ; Sat, 16 Sep 2023 10:43:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234283AbjIPKmm (ORCPT ); Sat, 16 Sep 2023 06:42:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50294 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229520AbjIPKmM (ORCPT ); Sat, 16 Sep 2023 06:42:12 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.151]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BA705C7; Sat, 16 Sep 2023 03:42:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1694860927; x=1726396927; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=E1ZWsG3yhjCVQFM0cAQVsfHBzlJHbot5FxPJHCpxOpQ=; b=QznFnuXZI/slRWUOlles9v2LjchQ12XFAZR0c6j//2VcrCnqwrPKaZLE IWAJU3LbLYeFCo1hdbiNzW5V79/NqvedKCU+mn5evebnHJOSqgDk9hfow DS0Pxrrei2KbMsox8KR1eJAMGMq50uSaLDcbDR8zhUj83VdTiBUtCFZ4n CByFAAKo64ZbjU+mczOF9VPHgfTrBQWHk1XzQ8Jghzl1FpkyuIYhHtciD Pz6uUj4XbXJ6yCU7yesEUesDKYsMRbdJscih916rUKpOdmZHTiF9+1QHC wV5nI67UtCv0LynJmSRhlHs1u5QIdr8ktS9CwG+eXaNnTk4P/Pre/LCRn A==; X-IronPort-AV: E=McAfee;i="6600,9927,10834"; a="359653523" X-IronPort-AV: E=Sophos;i="6.02,152,1688454000"; d="scan'208";a="359653523" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Sep 2023 03:42:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10834"; a="780392440" X-IronPort-AV: E=Sophos;i="6.02,152,1688454000"; d="scan'208";a="780392440" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga001.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Sep 2023 03:42:03 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.97-RC0) (envelope-from ) id 1qhSkS-0000000Fdqv-0pXU; Sat, 16 Sep 2023 13:42:00 +0300 Date: Sat, 16 Sep 2023 13:41:59 +0300 From: Andy Shevchenko To: Bjorn Helgaas Cc: linux-pci@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Ryder Lee , Jianjun Wang , Lorenzo Pieralisi , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas , Matthias Brugger , AngeloGioacchino Del Regno , Huacai Chen , kernel test robot Subject: Re: [PATCH v2 1/1] PCI: mediatek: Correct type for virt_to_phys() Message-ID: References: <20230914192324.672997-1-andriy.shevchenko@linux.intel.com> <20230914203146.GA77870@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230914203146.GA77870@bhelgaas> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org On Thu, Sep 14, 2023 at 03:31:46PM -0500, Bjorn Helgaas wrote: > On Thu, Sep 14, 2023 at 10:23:24PM +0300, Andy Shevchenko wrote: ... > > - addr = virt_to_phys(port->base + PCIE_MSI_VECTOR); > > + addr = virt_to_phys((__force void *)port->base + PCIE_MSI_VECTOR); > > Lots of these drivers use either virt_to_phys() or > platform_get_resource_byname() to get a physical address that they > then use as the MSI target. > > But I don't think that's quite right -- the MSI is a DMA transaction > on PCI, and in general there's no guarantee that bus addresses are > identical to CPU physical addresses, so shouldn't we use a dma_addr_t > obtained from the DMA API? > > dw_pcie_msi_host_init() has a complicated version of this that uses > dmam_alloc_coherent(). Fair enough. I leave it to you then to get it fixed properly. Consider this as just a heads up for the old report. -- With Best Regards, Andy Shevchenko