<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/drivers/memory/fsl_ifc.c, branch v4.9.307</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v4.9.307</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v4.9.307'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2021-11-26T10:48:37+00:00</updated>
<entry>
<title>memory: fsl_ifc: fix leak of irq and nand_irq in fsl_ifc_ctrl_probe</title>
<updated>2021-11-26T10:48:37+00:00</updated>
<author>
<name>Dongliang Mu</name>
<email>mudongliangabcd@gmail.com</email>
</author>
<published>2021-09-25T15:14:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b52958eb22d32c49bd97b77fb224c54d6ed808e7'/>
<id>urn:sha1:b52958eb22d32c49bd97b77fb224c54d6ed808e7</id>
<content type='text'>
[ Upstream commit 4ed2f3545c2e5acfbccd7f85fea5b1a82e9862d7 ]

The error handling code of fsl_ifc_ctrl_probe is problematic. When
fsl_ifc_ctrl_init fails or request_irq of fsl_ifc_ctrl_dev-&gt;irq fails,
it forgets to free the irq and nand_irq. Meanwhile, if request_irq of
fsl_ifc_ctrl_dev-&gt;nand_irq fails, it will still free nand_irq even if
the request_irq is not successful.

Fix this by refactoring the error handling code.

Fixes: d2ae2e20fbdd ("driver/memory:Move Freescale IFC driver to a common driver")
Signed-off-by: Dongliang Mu &lt;mudongliangabcd@gmail.com&gt;
Link: https://lore.kernel.org/r/20210925151434.8170-1-mudongliangabcd@gmail.com
Signed-off-by: Krzysztof Kozlowski &lt;krzysztof.kozlowski@canonical.com&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>memory: fsl_ifc: fix leak of private memory on probe failure</title>
<updated>2021-07-20T14:21:15+00:00</updated>
<author>
<name>Krzysztof Kozlowski</name>
<email>krzysztof.kozlowski@canonical.com</email>
</author>
<published>2021-05-27T15:43:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=3b45b8a7d549bd92ec94b5357c2c2c1a7ed107e4'/>
<id>urn:sha1:3b45b8a7d549bd92ec94b5357c2c2c1a7ed107e4</id>
<content type='text'>
[ Upstream commit 8e0d09b1232d0538066c40ed4c13086faccbdff6 ]

On probe error the driver should free the memory allocated for private
structure.  Fix this by using resource-managed allocation.

Fixes: a20cbdeffce2 ("powerpc/fsl: Add support for Integrated Flash Controller")
Signed-off-by: Krzysztof Kozlowski &lt;krzysztof.kozlowski@canonical.com&gt;
Link: https://lore.kernel.org/r/20210527154322.81253-2-krzysztof.kozlowski@canonical.com
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>memory: fsl_ifc: fix leak of IO mapping on probe failure</title>
<updated>2021-07-20T14:21:15+00:00</updated>
<author>
<name>Krzysztof Kozlowski</name>
<email>krzysztof.kozlowski@canonical.com</email>
</author>
<published>2021-05-27T15:43:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d0d04b95e8ed0223844a1d58497c686fe2e4a955'/>
<id>urn:sha1:d0d04b95e8ed0223844a1d58497c686fe2e4a955</id>
<content type='text'>
[ Upstream commit 3b132ab67fc7a358fff35e808fa65d4bea452521 ]

On probe error the driver should unmap the IO memory.  Smatch reports:

  drivers/memory/fsl_ifc.c:298 fsl_ifc_ctrl_probe() warn: 'fsl_ifc_ctrl_dev-&gt;gregs' not released on lines: 298.

Fixes: a20cbdeffce2 ("powerpc/fsl: Add support for Integrated Flash Controller")
Reported-by: kernel test robot &lt;lkp@intel.com&gt;
Reported-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Krzysztof Kozlowski &lt;krzysztof.kozlowski@canonical.com&gt;
Link: https://lore.kernel.org/r/20210527154322.81253-1-krzysztof.kozlowski@canonical.com
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>memory: Update dependency of IFC for Layerscape</title>
<updated>2016-07-14T00:31:10+00:00</updated>
<author>
<name>Raghav Dogra</name>
<email>raghav.dogra@nxp.com</email>
</author>
<published>2016-07-01T16:02:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8ea126bc1ac28be93eb5ae3c82741a3dc8e66ae2'/>
<id>urn:sha1:8ea126bc1ac28be93eb5ae3c82741a3dc8e66ae2</id>
<content type='text'>
This patch enables IFC NAND support on ARM layerscape platform.
It fixes the dependency to enable NAND. The include files are being modified
to ensure complilation for both PowerPC and ARM architectures.

Signed-off-by: Raghav Dogra &lt;raghav.dogra@nxp.com&gt;
Acked-by: Scott Wood &lt;oss@buserror.net&gt;
Signed-off-by: Brian Norris &lt;computersforpeace@gmail.com&gt;
</content>
</entry>
<entry>
<title>mtd/ifc: Add support for IFC controller version 2.0</title>
<updated>2016-04-19T20:04:53+00:00</updated>
<author>
<name>Raghav Dogra</name>
<email>raghav.dogra@nxp.com</email>
</author>
<published>2016-02-17T11:24:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7a654172161c8c9c7d59cbd0054d9e63c7411219'/>
<id>urn:sha1:7a654172161c8c9c7d59cbd0054d9e63c7411219</id>
<content type='text'>
The new IFC controller version 2.0 has a different memory map page.
Upto IFC 1.4 PAGE size is 4 KB and from IFC2.0 PAGE size is 64KB.
This patch segregates the IFC global and runtime registers to appropriate
PAGE sizes.

Signed-off-by: Jaiprakash Singh &lt;b44839@freescale.com&gt;
Signed-off-by: Raghav Dogra &lt;raghav@freescale.com&gt;
Acked-by: Li Yang &lt;leoyang.li@nxp.com&gt;
Signed-off-by: Raghav Dogra &lt;raghav.dogra@nxp.com&gt;
Acked-by: Scott Wood &lt;oss@buserror.net&gt;
Acked-by: Brian Norris &lt;computersforpeace@gmail.com&gt;
Signed-off-by: Boris Brezillon &lt;boris.brezillon@free-electrons.com&gt;
</content>
</entry>
<entry>
<title>driver/memory: Removal of deprecated NO_IRQ</title>
<updated>2016-02-01T18:45:05+00:00</updated>
<author>
<name>Raghav Dogra</name>
<email>raghav@freescale.com</email>
</author>
<published>2015-12-16T10:41:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ed4eeba7338bb123090f1c8b208f64d8184a896d'/>
<id>urn:sha1:ed4eeba7338bb123090f1c8b208f64d8184a896d</id>
<content type='text'>
Replacing the NO_IRQ macro with 0. If there is no interrupt,
returned value will be 0 regardless of what NO_IRQ is defined.

Signed-off-by: Raghav Dogra &lt;raghav@freescale.com&gt;
Signed-off-by: Brian Norris &lt;computersforpeace@gmail.com&gt;
</content>
</entry>
<entry>
<title>fsl-ifc: add missing include on ARM64</title>
<updated>2015-12-15T23:16:58+00:00</updated>
<author>
<name>Lijun Pan</name>
<email>Lijun.Pan@freescale.com</email>
</author>
<published>2015-12-11T19:55:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c4aa1937b7f40adc93e2e0a901314a4bd8991174'/>
<id>urn:sha1:c4aa1937b7f40adc93e2e0a901314a4bd8991174</id>
<content type='text'>
Need to include sched.h to fix the following compilation error
if FSL_IFC is enabled on ARM64 machine.

In file included from include/linux/mmzone.h:9:0,
                 from include/linux/gfp.h:5,
                 from include/linux/kmod.h:22,
                 from include/linux/module.h:13,
                 from drivers/memory/fsl_ifc.c:22:
drivers/memory/fsl_ifc.c: In function ‘check_nand_stat’:
include/linux/wait.h:165:35: error: ‘TASK_NORMAL’ undeclared (first use in this function)
 #define wake_up(x)   __wake_up(x, TASK_NORMAL, 1, NULL)
                                   ^
drivers/memory/fsl_ifc.c:136:3: note: in expansion of macro ‘wake_up’
   wake_up(&amp;ctrl-&gt;nand_wait);
   ^
include/linux/wait.h:165:35: note: each undeclared identifier is reported only once for each function it appears in
 #define wake_up(x)   __wake_up(x, TASK_NORMAL, 1, NULL)
                                   ^
drivers/memory/fsl_ifc.c:136:3: note: in expansion of macro ‘wake_up’
   wake_up(&amp;ctrl-&gt;nand_wait);
   ^

Analysis is as follows:
I put some instrumental code and get the
following .h files inclusion sequence:

In file included from ./arch/arm64/include/asm/compat.h:25:0,
                 from ./arch/arm64/include/asm/stat.h:23,
                 from include/linux/stat.h:5,
                 from include/linux/module.h:10,
                 from drivers/memory/fsl_ifc.c:23:
include/linux/sched.h:113:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘struct’
 struct sched_attr {
 ^

CONFIG_COMPAT=y is enabled while 39 and 48 bit VA is selected.
When 42 bit VA is selected, it does not enable CONFIG_COMPAT=y

In ./arch/arm64/include/asm/stat.h:23, it has
"#ifdef CONFIG_COMPAT"
"#include &lt;asm/compat.h&gt;"
"..."
"#endif"

Since ./arch/arm64/include/asm/stat.h does not
include ./arch/arm64/include/asm/compat.h,
then it will not include include/linux/sched.h
Hence we have to manually add "#include &lt;linux/sched.h&gt;"
in drivers/memory/fsl_ifc.c

Signed-off-by: Lijun Pan &lt;Lijun.Pan@freescale.com&gt;
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
</content>
</entry>
<entry>
<title>fsl_ifc: Change IO accessor based on endianness</title>
<updated>2015-08-08T03:59:34+00:00</updated>
<author>
<name>Jaiprakash Singh</name>
<email>b44839@freescale.com</email>
</author>
<published>2015-05-21T02:17:11+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=cf184dc2dd33847f4b211b01d8c7ec0526e6c5e4'/>
<id>urn:sha1:cf184dc2dd33847f4b211b01d8c7ec0526e6c5e4</id>
<content type='text'>
IFC IO accressor are set at run time based
on IFC IP registers endianness.IFC node in
DTS file contains information about
endianness.

Signed-off-by: Jaiprakash Singh &lt;b44839@freescale.com&gt;
Signed-off-by: Scott Wood &lt;scottwood@freescale.com&gt;
Acked-by: Brian Norris &lt;computersforpeace@gmail.com&gt;
</content>
</entry>
<entry>
<title>fsl_ifc: Support all 8 IFC chip selects</title>
<updated>2014-11-05T22:45:53+00:00</updated>
<author>
<name>Aaron Sierra</name>
<email>asierra@xes-inc.com</email>
</author>
<published>2014-08-26T23:18:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=096916610f415e07cfe71d71a391011c617be5ed'/>
<id>urn:sha1:096916610f415e07cfe71d71a391011c617be5ed</id>
<content type='text'>
Freescale's QorIQ T Series processors support 8 IFC chip selects
within a memory map backward compatible with previous P Series
processors which supported only 4 chip selects.

Signed-off-by: Aaron Sierra &lt;asierra@xes-inc.com&gt;
Signed-off-by: Brian Norris &lt;computersforpeace@gmail.com&gt;
</content>
</entry>
<entry>
<title>driver/memory:Move Freescale IFC driver to a common driver</title>
<updated>2014-02-18T20:20:45+00:00</updated>
<author>
<name>Prabhakar Kushwaha</name>
<email>prabhakar@freescale.com</email>
</author>
<published>2014-01-17T05:45:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=d2ae2e20fbdde5a65f3a5a153044ab1e5c53f7cc'/>
<id>urn:sha1:d2ae2e20fbdde5a65f3a5a153044ab1e5c53f7cc</id>
<content type='text'>
 Freescale IFC controller has been used for mpc8xxx. It will be used
 for ARM-based SoC as well. This patch moves the driver to driver/memory
 and fix the header file includes.

  Also remove module_platform_driver() and  instead call
  platform_driver_register() from subsys_initcall() to make sure this module
  has been loaded before MTD partition parsing starts.

Signed-off-by: Prabhakar Kushwaha &lt;prabhakar@freescale.com&gt;
Acked-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
