linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Bhushan Bharat-R65777 <R65777@freescale.com>
To: Bhushan Bharat-R65777 <R65777@freescale.com>,
	"linux-mm@kvack.org" <linux-mm@kvack.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"mingo@elte.hu" <mingo@elte.hu>, "hpa@zytor.com" <hpa@zytor.com>,
	"benh@kernel.crashing.org" <benh@kernel.crashing.org>,
	"torvalds@linux-foundation.org" <torvalds@linux-foundation.org>,
	"yinghai@kernel.org" <yinghai@kernel.org>,
	Wood Scott-B07421 <B07421@freescale.com>
Cc: "agraf@suse.de" <agraf@suse.de>
Subject: RE: memblock_end_of_DRAM()  return end address + 1
Date: Thu, 31 May 2012 13:41:34 +0000	[thread overview]
Message-ID: <6A3DF150A5B70D4F9B66A25E3F7C888D03D5B033@039-SN2MPN1-022.039d.mgd.msft.net> (raw)
In-Reply-To: <6A3DF150A5B70D4F9B66A25E3F7C888D03D5AAE2@039-SN2MPN1-022.039d.mgd.msft.net>

Adding some more gentlemen's.	


> -----Original Message-----
> From: linux-kernel-owner@vger.kernel.org [mailto:linux-kernel-
> owner@vger.kernel.org] On Behalf Of Bhushan Bharat-R65777
> Sent: Thursday, May 31, 2012 4:34 PM
> To: linux-mm@kvack.org; linux-kernel@vger.kernel.org
> Cc: agraf@suse.de
> Subject: memblock_end_of_DRAM() return end address + 1
> 
> Hi All,
> 
> memblock_end_of_DRAM() defined in mm/memblock.c returns base_address + size; So
> this is not returning the end_of_DRAM, it is basically returning the end_of_DRAM
> + 1. The name looks to suggest that this returns end address on DRAM.
> 
> IIUC, it looks like that some code assumes this returns the end address while
> some assumes this returns end address + 1.
> 
> Example:
> 1. arch/powerpc/platforms/85xx/mpc85xx_ds.c
> 
> 
> <cut>
> 
> #ifdef CONFIG_SWIOTLB
>         if (memblock_end_of_DRAM() > max) {
>                 ppc_swiotlb_enable = 1;
>                 set_pci_dma_ops(&swiotlb_dma_ops);
>                 ppc_md.pci_dma_dev_setup = pci_dma_dev_setup_swiotlb;
>         }
> #endif
> 
> <cut>
> <cut>
> 
> 
> Where  max = 0xffffffff; So we assumes that memblock_end_of_DRAM() actually
> returns end address.
> 
> ------
> 2.
> 
> In arch/powerpc/kernel/dma.c
> 
> 
> static int dma_direct_dma_supported(struct device *dev, u64 mask) { #ifdef
> CONFIG_PPC64
>         /* Could be improved so platforms can set the limit in case
>          * they have limited DMA windows
>          */
>         return mask >= get_dma_offset(dev) + (memblock_end_of_DRAM() - 1);
> 
> 
> <cut>
> 
> It looks to that here we assume base + addr + 1;
> 
> -----------
> 
> 
> Thanks
> -Bharat
> 
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the
> body of a message to majordomo@vger.kernel.org More majordomo info at
> http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at  http://www.tux.org/lkml/


--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

      reply	other threads:[~2012-05-31 13:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-31 11:03 Bhushan Bharat-R65777
2012-05-31 13:41 ` Bhushan Bharat-R65777 [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=6A3DF150A5B70D4F9B66A25E3F7C888D03D5B033@039-SN2MPN1-022.039d.mgd.msft.net \
    --to=r65777@freescale.com \
    --cc=B07421@freescale.com \
    --cc=agraf@suse.de \
    --cc=benh@kernel.crashing.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mingo@elte.hu \
    --cc=torvalds@linux-foundation.org \
    --cc=yinghai@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