mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Allen Hubbe" <Allen.Hubbe@emc.com>
To: "'kbuild test robot'" <fengguang.wu@intel.com>,
	"'Xiangliang Yu'" <Xiangliang.Yu@amd.com>
Cc: <kbuild-all@01.org>, <linux-kernel@vger.kernel.org>,
	"'Jon Mason'" <jdmason@kudzu.us>
Subject: RE: drivers/ntb/hw/amd/ntb_hw_amd.c:367:29: sparse: cast removes address space of expression
Date: Mon, 21 Mar 2016 09:15:15 -0400	[thread overview]
Message-ID: <000001d18373$b5c920f0$215b62d0$@emc.com> (raw)
In-Reply-To: <201603192227.ijrPiZDJ%fengguang.wu@intel.com>

> >> drivers/ntb/hw/amd/ntb_hw_amd.c:367:29: sparse: cast removes address space of
> expression
>    drivers/ntb/hw/amd/ntb_hw_amd.c:427:31: sparse: cast removes address space of
> expression

>    360	static int amd_ntb_peer_db_addr(struct ntb_dev *ntb,
>    361					phys_addr_t *db_addr,
>    362					resource_size_t *db_size)
>    363	{
>    364		struct amd_ntb_dev *ndev = ntb_ndev(ntb);
>    365
>    366		if (db_addr)
>  > 367			*db_addr = (phys_addr_t)(ndev->peer_mmio + AMD_DBREQ_OFFSET);

This is a good warning.  The code here does look wrong (both lines 367 and 427).

Instead of peer_mmio, the code here should use pci_resource_start(pcidev, 0) + AMD_PEER_OFFSET.  For comparison, in ntb_hw_intel the offset is based on a physical address stored in peer_addr, not the virtual mapping of that address in peer_mmio.

Look at ntb_hw_amd around lines 1016 where self_mmio and peer_mmio are set up.  The register physical address is never saved in the ndev object, only the virtual address is saved, therefore the physical address would need to be retrieved with pci_resoruce_start wherever it is used in the ntb_hw_amd driver.

Alternatively, the offending functions could be deleted until they are added later, after they have been tested.  Note that the ntb_foo_addr functions are an optional part of the api for drivers to implement.

Allen

      reply	other threads:[~2016-03-21 13:15 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-19 14:58 kbuild test robot
2016-03-21 13:15 ` Allen Hubbe [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='000001d18373$b5c920f0$215b62d0$@emc.com' \
    --to=allen.hubbe@emc.com \
    --cc=Xiangliang.Yu@amd.com \
    --cc=fengguang.wu@intel.com \
    --cc=jdmason@kudzu.us \
    --cc=kbuild-all@01.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®