* [PATCH] cxl: Fix error handling
@ 2016-10-30 21:40 Christophe JAILLET
2016-10-31 5:37 ` Michael Ellerman
` (4 more replies)
0 siblings, 5 replies; 11+ messages in thread
From: Christophe JAILLET @ 2016-10-30 21:40 UTC (permalink / raw)
To: imunsie, fbarrat
Cc: linuxppc-dev, linux-kernel, kernel-janitors, Christophe JAILLET
'cxl_dev_context_init()' returns an error pointer in case of error, not
NULL. So test it with IS_ERR.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
un-compiled because I don't have the required cross build environment.
---
drivers/misc/cxl/pci.c | 2 +-
drivers/misc/cxl/phb.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/misc/cxl/pci.c b/drivers/misc/cxl/pci.c
index e96be9ca4e60..80a87ab25b83 100644
--- a/drivers/misc/cxl/pci.c
+++ b/drivers/misc/cxl/pci.c
@@ -1921,7 +1921,7 @@ static pci_ers_result_t cxl_pci_slot_reset(struct pci_dev *pdev)
goto err;
ctx = cxl_dev_context_init(afu_dev);
- if (!ctx)
+ if (IS_ERR(ctx))
goto err;
afu_dev->dev.archdata.cxl_ctx = ctx;
diff --git a/drivers/misc/cxl/phb.c b/drivers/misc/cxl/phb.c
index 0935d44c1770..6ec69ada19f4 100644
--- a/drivers/misc/cxl/phb.c
+++ b/drivers/misc/cxl/phb.c
@@ -20,7 +20,7 @@ bool _cxl_pci_associate_default_context(struct pci_dev *dev, struct cxl_afu *afu
* in the virtual phb, we'll need a default context to attach them to.
*/
ctx = cxl_dev_context_init(dev);
- if (!ctx)
+ if (IS_ERR(ctx))
return false;
dev->dev.archdata.cxl_ctx = ctx;
--
2.9.3
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH] cxl: Fix error handling
2016-10-30 21:40 [PATCH] cxl: Fix error handling Christophe JAILLET
@ 2016-10-31 5:37 ` Michael Ellerman
2016-11-01 23:36 ` Jim Davis
2016-10-31 6:27 ` Andrew Donnellan
` (3 subsequent siblings)
4 siblings, 1 reply; 11+ messages in thread
From: Michael Ellerman @ 2016-10-31 5:37 UTC (permalink / raw)
To: Christophe JAILLET, imunsie, fbarrat
Cc: kernel-janitors, Christophe JAILLET, linuxppc-dev, linux-kernel
Christophe JAILLET <christophe.jaillet@wanadoo.fr> writes:
> 'cxl_dev_context_init()' returns an error pointer in case of error, not
> NULL. So test it with IS_ERR.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
> un-compiled because I don't have the required cross build environment.
Do you run Ubuntu or Fedora? If so it's just a dnf/apt-get away:
$ sudo dnf install gcc-c++-powerpc64-linux-gnu binutils-powerpc64-linux-gnu gcc-powerpc64-linux-gnu
or
$ sudo apt-get install gcc-powerpc64le-linux-gnu gcc-powerpc-linux-gnu libc-dev-powerpc-cross libc-dev-ppc64el-cross
More here:
https://github.com/linuxppc/linux/wiki/Building-powerpc-kernels
cheers
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] cxl: Fix error handling
2016-10-31 5:37 ` Michael Ellerman
@ 2016-11-01 23:36 ` Jim Davis
2016-11-02 11:12 ` Michael Ellerman
0 siblings, 1 reply; 11+ messages in thread
From: Jim Davis @ 2016-11-01 23:36 UTC (permalink / raw)
To: Michael Ellerman
Cc: Christophe JAILLET, imunsie, fbarrat, kernel-janitors,
linuxppc-dev, linux-kernel
On Sun, Oct 30, 2016 at 10:37 PM, Michael Ellerman <mpe@ellerman.id.au> wrote:
> Christophe JAILLET <christophe.jaillet@wanadoo.fr> writes:
>
>> 'cxl_dev_context_init()' returns an error pointer in case of error, not
>> NULL. So test it with IS_ERR.
>>
>> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
>> ---
>> un-compiled because I don't have the required cross build environment.
>
> Do you run Ubuntu or Fedora? If so it's just a dnf/apt-get away:
>
> $ sudo dnf install gcc-c++-powerpc64-linux-gnu binutils-powerpc64-linux-gnu gcc-powerpc64-linux-gnu
> or
> $ sudo apt-get install gcc-powerpc64le-linux-gnu gcc-powerpc-linux-gnu libc-dev-powerpc-cross libc-dev-ppc64el-cross
>
> More here:
>
> https://github.com/linuxppc/linux/wiki/Building-powerpc-kernels
Cool; the little-endian build worked fine, but
jim@krebstar:~/linux-rc$ make ARCH=powerpc
CROSS_COMPILE=powerpc64-linux-gnu- vmlinux
make: powerpc64-linux-gnu-gcc: Command not found
make: powerpc64-linux-gnu-gcc: Command not found
scripts/kconfig/conf --silentoldconfig Kconfig
make: powerpc64-linux-gnu-gcc: Command not found
This is on Ubuntu 16.04; there's a /usr/bin/powerpc64le-linux-gnu-gcc
from installing gcc-powerpc64le-linux-gnu, and a
/usr/bin/powerpc-linux-gnu-gcc from installing gcc-powerpc-linux-gnu,
but no /usr/bin/powerpc64-linux-gnu-gcc.
--
Jim
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] cxl: Fix error handling
2016-11-01 23:36 ` Jim Davis
@ 2016-11-02 11:12 ` Michael Ellerman
2016-11-02 19:01 ` Jim Davis
0 siblings, 1 reply; 11+ messages in thread
From: Michael Ellerman @ 2016-11-02 11:12 UTC (permalink / raw)
To: Jim Davis
Cc: Christophe JAILLET, imunsie, fbarrat, kernel-janitors,
linuxppc-dev, linux-kernel
Jim Davis <jim.epost@gmail.com> writes:
> On Sun, Oct 30, 2016 at 10:37 PM, Michael Ellerman <mpe@ellerman.id.au> wrote:
>> More here:
>>
>> https://github.com/linuxppc/linux/wiki/Building-powerpc-kernels
>
> Cool; the little-endian build worked fine, but
Yay, thanks for trying.
> jim@krebstar:~/linux-rc$ make ARCH=powerpc
> CROSS_COMPILE=powerpc64-linux-gnu- vmlinux
> make: powerpc64-linux-gnu-gcc: Command not found
> make: powerpc64-linux-gnu-gcc: Command not found
> scripts/kconfig/conf --silentoldconfig Kconfig
> make: powerpc64-linux-gnu-gcc: Command not found
Ah sorry.
> This is on Ubuntu 16.04; there's a /usr/bin/powerpc64le-linux-gnu-gcc
> from installing gcc-powerpc64le-linux-gnu, and a
> /usr/bin/powerpc-linux-gnu-gcc from installing gcc-powerpc-linux-gnu,
> but no /usr/bin/powerpc64-linux-gnu-gcc.
It's the powerpc-linux-gnu-gcc one.
That is a 32 and 64-bit compiler, it's 32-bit by default, but the kernel
Makefiles will pass -m64 appropriately.
You can actually build a single compiler that builds 32/64-bit BE, and
64-bit LE, but the distros don't do that for whatever reason.
cheers
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] cxl: Fix error handling
2016-11-02 11:12 ` Michael Ellerman
@ 2016-11-02 19:01 ` Jim Davis
2016-11-03 9:55 ` Michael Ellerman
0 siblings, 1 reply; 11+ messages in thread
From: Jim Davis @ 2016-11-02 19:01 UTC (permalink / raw)
To: Michael Ellerman
Cc: Christophe JAILLET, imunsie, fbarrat, kernel-janitors,
linuxppc-dev, linux-kernel
On Wed, Nov 2, 2016 at 4:12 AM, Michael Ellerman <mpe@ellerman.id.au> wrote:
> Jim Davis <jim.epost@gmail.com> writes:
>
>> On Sun, Oct 30, 2016 at 10:37 PM, Michael Ellerman <mpe@ellerman.id.au> wrote:
>>> More here:
>>>
>>> https://github.com/linuxppc/linux/wiki/Building-powerpc-kernels
>>
>> Cool; the little-endian build worked fine, but
>
> Yay, thanks for trying.
>
>> jim@krebstar:~/linux-rc$ make ARCH=powerpc
>> CROSS_COMPILE=powerpc64-linux-gnu- vmlinux
>> make: powerpc64-linux-gnu-gcc: Command not found
>> make: powerpc64-linux-gnu-gcc: Command not found
>> scripts/kconfig/conf --silentoldconfig Kconfig
>> make: powerpc64-linux-gnu-gcc: Command not found
But I cleverly tried to run the Fedora command on Ubuntu... when I run
the right command for Ubuntu, the build worked just fine. D'oh!
Nit: make distclean missed a few files
jim@krebstar:~/linux-rc$ make distclean; git clean -fdx
CLEAN .
CLEAN drivers/tty/vt
CLEAN drivers/video/logo
CLEAN firmware
CLEAN kernel
CLEAN lib
CLEAN usr
CLEAN .tmp_versions
CLEAN scripts/basic
CLEAN scripts/dtc
CLEAN scripts/genksyms
CLEAN scripts/kconfig
CLEAN scripts/mod
CLEAN scripts
CLEAN include/config include/generated arch/powerpc/include/generated
CLEAN .config .version Module.symvers
Removing arch/powerpc/kernel/systbl_chk.i
Removing arch/powerpc/kernel/vdso32/vdso32.lds
Removing arch/powerpc/kernel/vdso32/vdso32.so
Removing arch/powerpc/kernel/vdso32/vdso32.so.dbg
Removing arch/powerpc/kernel/vdso64/vdso64.lds
Removing arch/powerpc/kernel/vdso64/vdso64.so
Removing arch/powerpc/kernel/vdso64/vdso64.so.dbg
Removing arch/powerpc/kernel/vmlinux.lds
--
Jim
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] cxl: Fix error handling
2016-11-02 19:01 ` Jim Davis
@ 2016-11-03 9:55 ` Michael Ellerman
0 siblings, 0 replies; 11+ messages in thread
From: Michael Ellerman @ 2016-11-03 9:55 UTC (permalink / raw)
To: Jim Davis
Cc: Christophe JAILLET, imunsie, fbarrat, kernel-janitors,
linuxppc-dev, linux-kernel
Jim Davis <jim.epost@gmail.com> writes:
> On Wed, Nov 2, 2016 at 4:12 AM, Michael Ellerman <mpe@ellerman.id.au> wrote:
>> Jim Davis <jim.epost@gmail.com> writes:
>>
>>> On Sun, Oct 30, 2016 at 10:37 PM, Michael Ellerman <mpe@ellerman.id.au> wrote:
>>>> More here:
>>>>
>>>> https://github.com/linuxppc/linux/wiki/Building-powerpc-kernels
>>>
>>> Cool; the little-endian build worked fine, but
>>
>> Yay, thanks for trying.
>>
>>> jim@krebstar:~/linux-rc$ make ARCH=powerpc
>>> CROSS_COMPILE=powerpc64-linux-gnu- vmlinux
>>> make: powerpc64-linux-gnu-gcc: Command not found
>>> make: powerpc64-linux-gnu-gcc: Command not found
>>> scripts/kconfig/conf --silentoldconfig Kconfig
>>> make: powerpc64-linux-gnu-gcc: Command not found
>
> But I cleverly tried to run the Fedora command on Ubuntu... when I run
> the right command for Ubuntu, the build worked just fine. D'oh!
>
> Nit: make distclean missed a few files
Ah thanks. I literally never do that, but it is supposed work. Have
filed a bug for it.
cheers
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] cxl: Fix error handling
2016-10-30 21:40 [PATCH] cxl: Fix error handling Christophe JAILLET
2016-10-31 5:37 ` Michael Ellerman
@ 2016-10-31 6:27 ` Andrew Donnellan
2016-11-02 16:50 ` Frederic Barrat
` (2 subsequent siblings)
4 siblings, 0 replies; 11+ messages in thread
From: Andrew Donnellan @ 2016-10-31 6:27 UTC (permalink / raw)
To: Christophe JAILLET, imunsie, fbarrat
Cc: kernel-janitors, linuxppc-dev, linux-kernel
On 31/10/16 08:40, Christophe JAILLET wrote:
> 'cxl_dev_context_init()' returns an error pointer in case of error, not
> NULL. So test it with IS_ERR.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
> ---
> un-compiled because I don't have the required cross build environment.
Builds for me.
--
Andrew Donnellan OzLabs, ADL Canberra
andrew.donnellan@au1.ibm.com IBM Australia Limited
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] cxl: Fix error handling
2016-10-30 21:40 [PATCH] cxl: Fix error handling Christophe JAILLET
2016-10-31 5:37 ` Michael Ellerman
2016-10-31 6:27 ` Andrew Donnellan
@ 2016-11-02 16:50 ` Frederic Barrat
2016-11-16 1:56 ` Ian Munsie
2016-11-22 0:34 ` Michael Ellerman
4 siblings, 0 replies; 11+ messages in thread
From: Frederic Barrat @ 2016-11-02 16:50 UTC (permalink / raw)
To: Christophe JAILLET, imunsie; +Cc: kernel-janitors, linuxppc-dev, linux-kernel
Le 30/10/2016 à 22:40, Christophe JAILLET a écrit :
> 'cxl_dev_context_init()' returns an error pointer in case of error, not
> NULL. So test it with IS_ERR.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> ---
Thanks for the 3 patches!
Acked-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] cxl: Fix error handling
2016-10-30 21:40 [PATCH] cxl: Fix error handling Christophe JAILLET
` (2 preceding siblings ...)
2016-11-02 16:50 ` Frederic Barrat
@ 2016-11-16 1:56 ` Ian Munsie
2016-11-22 0:34 ` Michael Ellerman
4 siblings, 0 replies; 11+ messages in thread
From: Ian Munsie @ 2016-11-16 1:56 UTC (permalink / raw)
To: Christophe JAILLET; +Cc: fbarrat, linuxppc-dev, linux-kernel, kernel-janitors
Acked-by: Ian Munsie <imunsie@au1.ibm.com>
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: cxl: Fix error handling
2016-10-30 21:40 [PATCH] cxl: Fix error handling Christophe JAILLET
` (3 preceding siblings ...)
2016-11-16 1:56 ` Ian Munsie
@ 2016-11-22 0:34 ` Michael Ellerman
4 siblings, 0 replies; 11+ messages in thread
From: Michael Ellerman @ 2016-11-22 0:34 UTC (permalink / raw)
To: Christophe Jaillet, imunsie, fbarrat
Cc: kernel-janitors, Christophe JAILLET, linuxppc-dev, linux-kernel
On Sun, 2016-10-30 at 21:40:47 UTC, Christophe Jaillet wrote:
> 'cxl_dev_context_init()' returns an error pointer in case of error, not
> NULL. So test it with IS_ERR.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
> Acked-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
> Acked-by: Ian Munsie <imunsie@au1.ibm.com>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/bb81733de28c99e10b61dcaff15921
cheers
^ permalink raw reply [flat|nested] 11+ messages in thread
* [PATCH] cxl: Fix error handling
@ 2016-10-30 21:34 Christophe JAILLET
2016-11-22 0:34 ` Michael Ellerman
0 siblings, 1 reply; 11+ messages in thread
From: Christophe JAILLET @ 2016-10-30 21:34 UTC (permalink / raw)
To: imunsie, fbarrat
Cc: linuxppc-dev, linux-kernel, kernel-janitors, Christophe JAILLET
'cxl_dev_context_init()' returns an error pointer in case of error, not
NULL. So test it with IS_ERR.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
un-compiled because I don't have the required cross build environment.
---
drivers/misc/cxl/api.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/misc/cxl/api.c b/drivers/misc/cxl/api.c
index 2b88ad8a2a89..e2efc6489c6e 100644
--- a/drivers/misc/cxl/api.c
+++ b/drivers/misc/cxl/api.c
@@ -538,7 +538,7 @@ int _cxl_cx4_setup_msi_irqs(struct pci_dev *pdev, int nvec, int type)
if (remaining > 0) {
new_ctx = cxl_dev_context_init(pdev);
- if (!new_ctx) {
+ if (IS_ERR(new_ctx)) {
pr_warn("%s: Failed to allocate enough contexts for MSIs\n", pci_name(pdev));
return -ENOSPC;
}
--
2.9.3
^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: cxl: Fix error handling
2016-10-30 21:34 [PATCH] " Christophe JAILLET
@ 2016-11-22 0:34 ` Michael Ellerman
0 siblings, 0 replies; 11+ messages in thread
From: Michael Ellerman @ 2016-11-22 0:34 UTC (permalink / raw)
To: Christophe Jaillet, imunsie, fbarrat
Cc: kernel-janitors, Christophe JAILLET, linuxppc-dev, linux-kernel
On Sun, 2016-10-30 at 21:34:51 UTC, Christophe Jaillet wrote:
> 'cxl_dev_context_init()' returns an error pointer in case of error, not
> NULL. So test it with IS_ERR.
>
> Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
> Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
> Acked-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com>
> Acked-by: Ian Munsie <imunsie@au1.ibm.com>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/28e323e5a0b21b3665eb6e136ca8bb
cheers
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2016-11-22 0:34 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-30 21:40 [PATCH] cxl: Fix error handling Christophe JAILLET
2016-10-31 5:37 ` Michael Ellerman
2016-11-01 23:36 ` Jim Davis
2016-11-02 11:12 ` Michael Ellerman
2016-11-02 19:01 ` Jim Davis
2016-11-03 9:55 ` Michael Ellerman
2016-10-31 6:27 ` Andrew Donnellan
2016-11-02 16:50 ` Frederic Barrat
2016-11-16 1:56 ` Ian Munsie
2016-11-22 0:34 ` Michael Ellerman
-- strict thread matches above, loose matches on Subject: below --
2016-10-30 21:34 [PATCH] " Christophe JAILLET
2016-11-22 0:34 ` Michael Ellerman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).