<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/arch/arc/mm/cache.c, branch linux-4.19.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.19.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.19.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2021-09-22T09:48:13Z</updated>
<entry>
<title>ARC: export clear_user_page() for modules</title>
<updated>2021-09-22T09:48:13Z</updated>
<author>
<name>Randy Dunlap</name>
</author>
<published>2021-08-16T21:05:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e91ae87f7e3f4e3e9b4700c498a0b0a4ce82cf1d'/>
<id>urn:sha1:e91ae87f7e3f4e3e9b4700c498a0b0a4ce82cf1d</id>
<content type='text'>
[ Upstream commit 6b5ff0405e4190f23780362ea324b250bc495683 ]

0day bot reports a build error:
  ERROR: modpost: "clear_user_page" [drivers/media/v4l2-core/videobuf-dma-sg.ko] undefined!
so export it in arch/arc/ to fix the build error.

In most ARCHes, clear_user_page() is a macro. OTOH, in a few
ARCHes it is a function and needs to be exported.
PowerPC exported it in 2004. It looks like nds32 and nios2
still need to have it exported.

Fixes: 4102b53392d63 ("ARC: [mm] Aliasing VIPT dcache support 2/4")
Signed-off-by: Randy Dunlap &lt;rdunlap@infradead.org&gt;
Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Cc: Guenter Roeck &lt;linux@roeck-us.net&gt;
Cc: linux-snps-arc@lists.infradead.org
Signed-off-by: Vineet Gupta &lt;vgupta@kernel.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>ARC: IOC: panic if kernel was started with previously enabled IOC</title>
<updated>2019-12-13T07:51:12Z</updated>
<author>
<name>Eugeniy Paltsev</name>
</author>
<published>2018-10-04T13:12:12Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=705d1e733142b188b6b98f707c8e78b3badf13db'/>
<id>urn:sha1:705d1e733142b188b6b98f707c8e78b3badf13db</id>
<content type='text'>
[ Upstream commit 3624379d90ad2b65f9dbb30d7f7ce5498d2fe322 ]

If IOC was already enabled (due to bootloader) it technically needs to
be reconfigured with aperture base,size corresponding to Linux memory map
which will certainly be different than uboot's. But disabling and
reenabling IOC when DMA might be potentially active is tricky business.
To avoid random memory issues later, just panic here and ask user to
upgrade bootloader to one which doesn't enable IOC

This was actually seen as issue on some of the HSDK board with a version
of uboot which enabled IOC. There were random issues later with starting
of X or peripherals etc.

Also while I'm at it, replace hardcoded bits in ARC_REG_IO_COH_PARTIAL
and ARC_REG_IO_COH_ENABLE registers by definitions.

Inspired by: https://lkml.org/lkml/2018/1/19/557
Signed-off-by: Eugeniy Paltsev &lt;Eugeniy.Paltsev@synopsys.com&gt;
Signed-off-by: Vineet Gupta &lt;vgupta@synopsys.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>ARC: IOC: panic if both IOC and ZONE_HIGHMEM enabled</title>
<updated>2018-09-04T20:21:37Z</updated>
<author>
<name>Eugeniy Paltsev</name>
</author>
<published>2018-07-30T16:26:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2b720e99a1297417b979bf4810a0f01d27133c48'/>
<id>urn:sha1:2b720e99a1297417b979bf4810a0f01d27133c48</id>
<content type='text'>
Signed-off-by: Eugeniy Paltsev &lt;Eugeniy.Paltsev@synopsys.com&gt;
Signed-off-by: Vineet Gupta &lt;vgupta@synopsys.com&gt;
</content>
</entry>
<entry>
<title>ARC: dma [IOC] Enable per device io coherency</title>
<updated>2018-09-04T20:21:37Z</updated>
<author>
<name>Eugeniy Paltsev</name>
</author>
<published>2018-07-30T16:26:34Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2820a708d5a321342bef34e459fdc8679c30e20f'/>
<id>urn:sha1:2820a708d5a321342bef34e459fdc8679c30e20f</id>
<content type='text'>
So far the IOC treatment was global on ARC, being turned on (or off)
for all devices in the system. With this patch, this can now be done
per device using the "dma-coherent" DT property; IOW with this patch
we can use both HW-coherent and regular DMA peripherals simultaneously.

The changes involved are too many so enlisting the summary below:

1. common code calls ARC arch_setup_dma_ops() per device.

2. For coherent dma (IOC) it plugs in generic @dma_direct_ops which
   doesn't need any arch specific backend: No need for any explicit
   cache flushes or MMU mappings to provide for uncached access

   - dma_(map|sync)_single* return early as corresponding dma ops callbacks
     are NULL in generic code.
     So arch_sync_dma_*() -&gt; dma_cache_*() need not handle the coherent
     dma case, hence drop ARC __dma_cache_*_ioc() which were no-op anyways

3. For noncoherent dma (non IOC) generic @dma_noncoherent_ops is used
   which in turns calls ARC specific routines

   - arch_dma_alloc() no longer checks for @ioc_enable since this is
     called only for !IOC case.

Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Eugeniy Paltsev &lt;Eugeniy.Paltsev@synopsys.com&gt;
Signed-off-by: Vineet Gupta &lt;vgupta@synopsys.com&gt;
[vgupta: rewrote changelog]
</content>
</entry>
<entry>
<title>arc: fix type warnings in arc/mm/cache.c</title>
<updated>2018-07-30T18:48:50Z</updated>
<author>
<name>Randy Dunlap</name>
</author>
<published>2018-07-27T03:16:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ec837d620c750c0d4996a907c8c4f7febe1bbeee'/>
<id>urn:sha1:ec837d620c750c0d4996a907c8c4f7febe1bbeee</id>
<content type='text'>
Fix type warnings in arch/arc/mm/cache.c.

../arch/arc/mm/cache.c: In function 'flush_anon_page':
../arch/arc/mm/cache.c:1062:55: warning: passing argument 2 of '__flush_dcache_page' makes integer from pointer without a cast [-Wint-conversion]
  __flush_dcache_page((phys_addr_t)page_address(page), page_address(page));
                                                       ^~~~~~~~~~~~~~~~~~
../arch/arc/mm/cache.c:1013:59: note: expected 'long unsigned int' but argument is of type 'void *'
 void __flush_dcache_page(phys_addr_t paddr, unsigned long vaddr)
                                             ~~~~~~~~~~~~~~^~~~~

Signed-off-by: Randy Dunlap &lt;rdunlap@infradead.org&gt;
Cc: Vineet Gupta &lt;vgupta@synopsys.com&gt;
Cc: linux-snps-arc@lists.infradead.org
Cc: Elad Kanfi &lt;eladkan@mellanox.com&gt;
Cc: Leon Romanovsky &lt;leonro@mellanox.com&gt;
Cc: Ofer Levi &lt;oferle@mellanox.com&gt;
Signed-off-by: Vineet Gupta &lt;vgupta@synopsys.com&gt;
</content>
</entry>
<entry>
<title>ARC: add SMP_CACHE_BYTES value validate</title>
<updated>2018-07-30T16:46:19Z</updated>
<author>
<name>Eugeniy Paltsev</name>
</author>
<published>2018-07-26T13:15:44Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=386177da9e601ed176d54c04324d9ebf44c70620'/>
<id>urn:sha1:386177da9e601ed176d54c04324d9ebf44c70620</id>
<content type='text'>
Check that SMP_CACHE_BYTES (and hence ARCH_DMA_MINALIGN) is larger
or equal to any cache line length by comparing it with values
previously read from ARC cache BCR registers.

Signed-off-by: Eugeniy Paltsev &lt;Eugeniy.Paltsev@synopsys.com&gt;
Signed-off-by: Vineet Gupta &lt;vgupta@synopsys.com&gt;
</content>
</entry>
<entry>
<title>mm: fix races between swapoff and flush dcache</title>
<updated>2018-04-06T04:36:26Z</updated>
<author>
<name>Huang Ying</name>
</author>
<published>2018-04-05T23:24:39Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=cb9f753a3731f7fe16447bea45cb6f8e8bb432fb'/>
<id>urn:sha1:cb9f753a3731f7fe16447bea45cb6f8e8bb432fb</id>
<content type='text'>
Thanks to commit 4b3ef9daa4fc ("mm/swap: split swap cache into 64MB
trunks"), after swapoff the address_space associated with the swap
device will be freed.  So page_mapping() users which may touch the
address_space need some kind of mechanism to prevent the address_space
from being freed during accessing.

The dcache flushing functions (flush_dcache_page(), etc) in architecture
specific code may access the address_space of swap device for anonymous
pages in swap cache via page_mapping() function.  But in some cases
there are no mechanisms to prevent the swap device from being swapoff,
for example,

  CPU1					CPU2
  __get_user_pages()			swapoff()
    flush_dcache_page()
      mapping = page_mapping()
        ...				  exit_swap_address_space()
        ...				    kvfree(spaces)
        mapping_mapped(mapping)

The address space may be accessed after being freed.

But from cachetlb.txt and Russell King, flush_dcache_page() only care
about file cache pages, for anonymous pages, flush_anon_page() should be
used.  The implementation of flush_dcache_page() in all architectures
follows this too.  They will check whether page_mapping() is NULL and
whether mapping_mapped() is true to determine whether to flush the
dcache immediately.  And they will use interval tree (mapping-&gt;i_mmap)
to find all user space mappings.  While mapping_mapped() and
mapping-&gt;i_mmap isn't used by anonymous pages in swap cache at all.

So, to fix the race between swapoff and flush dcache, __page_mapping()
is add to return the address_space for file cache pages and NULL
otherwise.  All page_mapping() invoking in flush dcache functions are
replaced with page_mapping_file().

[akpm@linux-foundation.org: simplify page_mapping_file(), per Mike]
Link: http://lkml.kernel.org/r/20180305083634.15174-1-ying.huang@intel.com
Signed-off-by: "Huang, Ying" &lt;ying.huang@intel.com&gt;
Reviewed-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Cc: Minchan Kim &lt;minchan@kernel.org&gt;
Cc: Michal Hocko &lt;mhocko@suse.com&gt;
Cc: Johannes Weiner &lt;hannes@cmpxchg.org&gt;
Cc: Mel Gorman &lt;mgorman@techsingularity.net&gt;
Cc: Dave Hansen &lt;dave.hansen@intel.com&gt;
Cc: Chen Liqin &lt;liqin.linux@gmail.com&gt;
Cc: Russell King &lt;linux@armlinux.org.uk&gt;
Cc: Yoshinori Sato &lt;ysato@users.sourceforge.jp&gt;
Cc: "James E.J. Bottomley" &lt;jejb@parisc-linux.org&gt;
Cc: Guan Xuetao &lt;gxt@mprc.pku.edu.cn&gt;
Cc: "David S. Miller" &lt;davem@davemloft.net&gt;
Cc: Chris Zankel &lt;chris@zankel.net&gt;
Cc: Vineet Gupta &lt;vgupta@synopsys.com&gt;
Cc: Ley Foon Tan &lt;lftan@altera.com&gt;
Cc: Ralf Baechle &lt;ralf@linux-mips.org&gt;
Cc: Andi Kleen &lt;ak@linux.intel.com&gt;
Cc: Mike Rapoport &lt;rppt@linux.vnet.ibm.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>ARCv2: cache: fix slc_entire_op: flush only instead of flush-n-inv</title>
<updated>2018-01-17T20:26:52Z</updated>
<author>
<name>Eugeniy Paltsev</name>
</author>
<published>2018-01-17T13:39:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8bbfbc2df6e9a37bc5c9ee674c496ea277b0bd39'/>
<id>urn:sha1:8bbfbc2df6e9a37bc5c9ee674c496ea277b0bd39</id>
<content type='text'>
slc_entire_op with OP_FLUSH command also invalidates it.

This is a preventive fix as the current use of slc_entire_op is only
with OP_FLUSH_N_INV where the invalidate is required.

Signed-off-by: Eugeniy Paltsev &lt;Eugeniy.Paltsev@synopsys.com&gt;
[vgupta: fixed changelog]
Signed-off-by: Vineet Gupta &lt;vgupta@synopsys.com&gt;
</content>
</entry>
<entry>
<title>ARC: mm: Decouple RAM base address from kernel link address</title>
<updated>2017-09-01T18:26:27Z</updated>
<author>
<name>Eugeniy Paltsev</name>
</author>
<published>2017-08-15T18:13:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=9ed68785f7f2b001a6911d64fbd10cfc6fa49b27'/>
<id>urn:sha1:9ed68785f7f2b001a6911d64fbd10cfc6fa49b27</id>
<content type='text'>
	[Needed for HSDK]

Currently the first page of system (hence RAM base) is assumed to be
@ CONFIG_LINUX_LINK_BASE, where kernel itself is linked.

However is case of HSDK platform, for reasons explained in that patch,
this is not true. kernel needs to be linked @ 0x9000_0000 while DDR
is still wired at 0x8000_0000. To properly account for this 256M of RAM,
we need to introduce a new option and base page frame accountiing off of
it.

Signed-off-by: Eugeniy Paltsev &lt;Eugeniy.Paltsev@synopsys.com&gt;
Signed-off-by: Vineet Gupta &lt;vgupta@synopsys.com&gt;
[vgupta: renamed  CONFIG_KERNEL_RAM_BASE_ADDRESS =&gt; CONFIG_LINUX_RAM_BASE
       : simplified changelog]
</content>
</entry>
<entry>
<title>ARCv2: IOC: Tighten up the contraints (specifically base / size alignment)</title>
<updated>2017-09-01T18:26:26Z</updated>
<author>
<name>Eugeniy Paltsev</name>
</author>
<published>2017-08-15T18:13:53Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=bee91c3a3ce63daf64bb53ae60e6a2fb2961d3d7'/>
<id>urn:sha1:bee91c3a3ce63daf64bb53ae60e6a2fb2961d3d7</id>
<content type='text'>
	[Needed for HSDK]

 - Currently IOC base is hardcoded to 0x8000_0000 which is default value
   of LINUX_LINK_BASE, but may not always be the case

 - IOC programming model imposes the constraint that IOC aperture size
   needs to be aligned to IOC base address, which we were not checking
   so far.

Signed-off-by: Eugeniy Paltsev &lt;Eugeniy.Paltsev@synopsys.com&gt;
Signed-off-by: Vineet Gupta &lt;vgupta@synopsys.com&gt;
[vgupta: reworked the changelog]
</content>
</entry>
</feed>
