* Re: [RESEND PATCH v3 05/11] mtd: rawnand: vf610_nfc: add initializer to avoid -Wmaybe-uninitialized
From: Masahiro Yamada @ 2019-05-03 10:36 UTC (permalink / raw)
To: Miquel Raynal
Cc: linux-arch, Arnd Bergmann, linux-s390, Mathieu Malaterre, X86 ML,
Heiko Carstens, linux-mips, Linux Kernel Mailing List,
Ingo Molnar, linux-mtd, Andrew Morton, linuxppc-dev,
linux-arm-kernel
In-Reply-To: <20190502161346.07c15187@xps13>
Hi Miquel,
On Thu, May 2, 2019 at 11:14 PM Miquel Raynal <miquel.raynal@bootlin.com> wrote:
>
> Hi Masahiro,
>
> Masahiro Yamada <yamada.masahiro@socionext.com> wrote on Tue, 23 Apr
> 2019 12:49:53 +0900:
>
> > This prepares to move CONFIG_OPTIMIZE_INLINING from x86 to a common
> > place. We need to eliminate potential issues beforehand.
> >
> > Kbuild test robot has never reported -Wmaybe-uninitialized warning
> > for this probably because vf610_nfc_run() is inlined by the x86
> > compiler's inlining heuristic.
> >
> > If CONFIG_OPTIMIZE_INLINING is enabled for a different architecture
> > and vf610_nfc_run() is not inlined, the following warning is reported:
> >
> > drivers/mtd/nand/raw/vf610_nfc.c: In function ‘vf610_nfc_cmd’:
> > drivers/mtd/nand/raw/vf610_nfc.c:455:3: warning: ‘offset’ may be used uninitialized in this function [-Wmaybe-uninitialized]
> > vf610_nfc_rd_from_sram(instr->ctx.data.buf.in + offset,
> > ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > nfc->regs + NFC_MAIN_AREA(0) + offset,
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > trfr_sz, !nfc->data_access);
> > ~~~~~~~~~~~~~~~~~~~~~~~~~~~
>
> IMHO this patch has no dependencies with this series.
This patch is the prerequisite for 11/11.
https://lore.kernel.org/patchwork/patch/1064959/
Without the correct patch order,
the kbuild test robot reports the warning.
> Would you mind sending it alone with the proper Fixes tag?
I do not think Fixes is necessary.
Nobody has noticed this potential issue before.
Without 11/11, probably we cannot reproduce this warning.
BTW, this series has been for a while in linux-next.
>
> >
> > Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
> > ---
> >
> > Changes in v3: None
> > Changes in v2:
> > - split into a separate patch
> >
> > drivers/mtd/nand/raw/vf610_nfc.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/mtd/nand/raw/vf610_nfc.c b/drivers/mtd/nand/raw/vf610_nfc.c
> > index a662ca1970e5..19792d725ec2 100644
> > --- a/drivers/mtd/nand/raw/vf610_nfc.c
> > +++ b/drivers/mtd/nand/raw/vf610_nfc.c
> > @@ -364,7 +364,7 @@ static int vf610_nfc_cmd(struct nand_chip *chip,
> > {
> > const struct nand_op_instr *instr;
> > struct vf610_nfc *nfc = chip_to_nfc(chip);
> > - int op_id = -1, trfr_sz = 0, offset;
> > + int op_id = -1, trfr_sz = 0, offset = 0;
> > u32 col = 0, row = 0, cmd1 = 0, cmd2 = 0, code = 0;
> > bool force8bit = false;
> >
>
> Thanks,
> Miquèl
>
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/
--
Best Regards
Masahiro Yamada
^ permalink raw reply
* Re: [PATCH 04/15] arm64: switch to generic version of pte allocation
From: Mark Rutland @ 2019-05-03 10:05 UTC (permalink / raw)
To: Mike Rapoport
Cc: Michal Hocko, Catalin Marinas, Palmer Dabbelt, linux-mips,
Guo Ren, linux-hexagon, linux-riscv, linux-arch, Helge Deller,
x86, Russell King, Matthew Wilcox, Geert Uytterhoeven,
Matt Turner, Sam Creasey, Arnd Bergmann, linux-um,
Richard Weinberger, linux-m68k, Greentime Hu, nios2-dev,
Guan Xuetao, linux-arm-kernel, linux-parisc, linux-kernel,
Richard Kuo, Paul Burton, linux-alpha, Ley Foon Tan,
Andrew Morton, linuxppc-dev
In-Reply-To: <1556810922-20248-5-git-send-email-rppt@linux.ibm.com>
Hi,
On Thu, May 02, 2019 at 06:28:31PM +0300, Mike Rapoport wrote:
> The PTE allocations in arm64 are identical to the generic ones modulo the
> GFP flags.
>
> Using the generic pte_alloc_one() functions ensures that the user page
> tables are allocated with __GFP_ACCOUNT set.
>
> The arm64 definition of PGALLOC_GFP is removed and replaced with
> GFP_PGTABLE_USER for p[gum]d_alloc_one() and for KVM memory cache.
>
> The mappings created with create_pgd_mapping() are now using
> GFP_PGTABLE_KERNEL.
>
> The conversion to the generic version of pte_free_kernel() removes the NULL
> check for pte.
>
> The pte_free() version on arm64 is identical to the generic one and
> can be simply dropped.
>
> Signed-off-by: Mike Rapoport <rppt@linux.ibm.com>
> ---
> arch/arm64/include/asm/pgalloc.h | 43 ++++------------------------------------
> arch/arm64/mm/mmu.c | 2 +-
> arch/arm64/mm/pgd.c | 4 ++--
> virt/kvm/arm/mmu.c | 2 +-
> 4 files changed, 8 insertions(+), 43 deletions(-)
[...]
> diff --git a/arch/arm64/mm/pgd.c b/arch/arm64/mm/pgd.c
> index 289f911..2ef1a53 100644
> --- a/arch/arm64/mm/pgd.c
> +++ b/arch/arm64/mm/pgd.c
> @@ -31,9 +31,9 @@ static struct kmem_cache *pgd_cache __ro_after_init;
> pgd_t *pgd_alloc(struct mm_struct *mm)
> {
> if (PGD_SIZE == PAGE_SIZE)
> - return (pgd_t *)__get_free_page(PGALLOC_GFP);
> + return (pgd_t *)__get_free_page(GFP_PGTABLE_USER);
> else
> - return kmem_cache_alloc(pgd_cache, PGALLOC_GFP);
> + return kmem_cache_alloc(pgd_cache, GFP_PGTABLE_USER);
> }
In efi_virtmap_init() we use pgd_alloc() to allocate a pgd for EFI
runtime services, which we map with a special kernel page table.
I'm not sure if accounting that is problematic, as it's allocated in a
kernel thread off the back of an early_initcall.
Just to check, Is that sound, or do we need a pgd_alloc_kernel()?
Thanks,
Mark.
^ permalink raw reply
* Re: [PATCH v2] powerpc/powernv: Restrict OPAL symbol map to only be readable by root
From: Andrew Donnellan @ 2019-05-03 8:50 UTC (permalink / raw)
To: Greg KH; +Cc: linuxppc-dev, stable, Stewart Smith, Jordan Niethe
In-Reply-To: <20190503083529.GA17715@kroah.com>
On 3/5/19 6:35 pm, Greg KH wrote:
>> Are we actually racing against userspace in a subsys initcall?
>
> You can be, if you subsys is a module :)
For various reasons, we don't compile core system firmware interfaces
into modules... that could be an interesting exercise. :D
--
Andrew Donnellan OzLabs, ADL Canberra
ajd@linux.ibm.com IBM Australia Limited
^ permalink raw reply
* Re: [PATCH v2] powerpc/powernv: Restrict OPAL symbol map to only be readable by root
From: Greg KH @ 2019-05-03 8:35 UTC (permalink / raw)
To: Andrew Donnellan; +Cc: linuxppc-dev, stable, Stewart Smith, Jordan Niethe
In-Reply-To: <f584ce91-a49b-ef33-7090-cb0a91b87e82@linux.ibm.com>
On Fri, May 03, 2019 at 06:27:18PM +1000, Andrew Donnellan wrote:
> On 3/5/19 5:59 pm, Greg KH wrote:>> -static BIN_ATTR_RO(symbol_map, 0);
> > > +static struct bin_attribute symbol_map_attr = {
> > > + .attr = {.name = "symbol_map", .mode = 0400},
> > > + .read = symbol_map_read
> > > +};
> >
> > There's no real need to rename the structure, right? Why not just keep
> > the bin_attr_symbol_map name? That would make this patch even smaller.
>
> No real need but it's locally more consistent with the rest of the PPC code.
> (Though perhaps the other cases should use the BIN_ATTR macro...)
>
> Given this is for stable I'm happy to change that if the smaller patch is
> more acceptable.
stable doesn't care, and if this is more consistent, that's fine with
me, I didn't see the larger picture here, just providing unsolicited
patch review :)
> > > static void opal_export_symmap(void)
> > > {
> > > @@ -698,10 +701,10 @@ static void opal_export_symmap(void)
> > > return;
> > > /* Setup attributes */
> > > - bin_attr_symbol_map.private = __va(be64_to_cpu(syms[0]));
> > > - bin_attr_symbol_map.size = be64_to_cpu(syms[1]);
> > > + symbol_map_attr.private = __va(be64_to_cpu(syms[0]));
> > > + symbol_map_attr.size = be64_to_cpu(syms[1]);
> > > - rc = sysfs_create_bin_file(opal_kobj, &bin_attr_symbol_map);
> > > + rc = sysfs_create_bin_file(opal_kobj, &symbol_map_attr);
> >
> > Meta-comment, odds are you are racing userspace when you create this
> > sysfs file, why not add it to the device's default attributes so the
> > driver core creates it for you at the correct time?
>
> I was not previously aware of default attributes...
>
> Are we actually racing against userspace in a subsys initcall?
You can be, if you subsys is a module :)
thanks,
greg k-h
^ permalink raw reply
* Re: [PATCH] powerpc/powernv/ioda2: Add __printf format/argument verification
From: Mathieu Malaterre @ 2019-05-03 8:33 UTC (permalink / raw)
To: Joe Perches; +Cc: Michael Ellerman, Paul Mackerras, linuxppc-dev, LKML
In-Reply-To: <cf6948fb8ab8e395e139a3440f3600a6050c1efa.camel@perches.com>
On Fri, May 3, 2019 at 10:21 AM Joe Perches <joe@perches.com> wrote:
>
> On Fri, 2019-05-03 at 16:59 +1000, Michael Ellerman wrote:
> > On Thu, 2017-03-30 at 10:19:25 UTC, Joe Perches wrote:
> > > Fix fallout too.
> > >
> > > Signed-off-by: Joe Perches <joe@perches.com>
> >
> > Applied to powerpc next, thanks.
> >
> > https://git.kernel.org/powerpc/c/1e496391a8452101308a23b7395cdd49
>
> 2+ years later.
>
>
Can't wait until someone compute stats about largest delta (author
date / committer date)
;)
^ permalink raw reply
* Re: [PATCH v2] powerpc/powernv: Restrict OPAL symbol map to only be readable by root
From: Andrew Donnellan @ 2019-05-03 8:27 UTC (permalink / raw)
To: Greg KH; +Cc: linuxppc-dev, stable, Stewart Smith, Jordan Niethe
In-Reply-To: <20190503075916.GA14960@kroah.com>
On 3/5/19 5:59 pm, Greg KH wrote:>> -static BIN_ATTR_RO(symbol_map, 0);
>> +static struct bin_attribute symbol_map_attr = {
>> + .attr = {.name = "symbol_map", .mode = 0400},
>> + .read = symbol_map_read
>> +};
>
> There's no real need to rename the structure, right? Why not just keep
> the bin_attr_symbol_map name? That would make this patch even smaller.
No real need but it's locally more consistent with the rest of the PPC
code. (Though perhaps the other cases should use the BIN_ATTR macro...)
Given this is for stable I'm happy to change that if the smaller patch
is more acceptable.
>
>> static void opal_export_symmap(void)
>> {
>> @@ -698,10 +701,10 @@ static void opal_export_symmap(void)
>> return;
>>
>> /* Setup attributes */
>> - bin_attr_symbol_map.private = __va(be64_to_cpu(syms[0]));
>> - bin_attr_symbol_map.size = be64_to_cpu(syms[1]);
>> + symbol_map_attr.private = __va(be64_to_cpu(syms[0]));
>> + symbol_map_attr.size = be64_to_cpu(syms[1]);
>>
>> - rc = sysfs_create_bin_file(opal_kobj, &bin_attr_symbol_map);
>> + rc = sysfs_create_bin_file(opal_kobj, &symbol_map_attr);
>
> Meta-comment, odds are you are racing userspace when you create this
> sysfs file, why not add it to the device's default attributes so the
> driver core creates it for you at the correct time?
I was not previously aware of default attributes...
Are we actually racing against userspace in a subsys initcall?
--
Andrew Donnellan OzLabs, ADL Canberra
ajd@linux.ibm.com IBM Australia Limited
^ permalink raw reply
* Re: [PATCH] powerpc/powernv/ioda2: Add __printf format/argument verification
From: Joe Perches @ 2019-05-03 8:12 UTC (permalink / raw)
To: Michael Ellerman, Benjamin Herrenschmidt, Paul Mackerras
Cc: linuxppc-dev, linux-kernel
In-Reply-To: <44wNKc0KZFz9sPd@ozlabs.org>
On Fri, 2019-05-03 at 16:59 +1000, Michael Ellerman wrote:
> On Thu, 2017-03-30 at 10:19:25 UTC, Joe Perches wrote:
> > Fix fallout too.
> >
> > Signed-off-by: Joe Perches <joe@perches.com>
>
> Applied to powerpc next, thanks.
>
> https://git.kernel.org/powerpc/c/1e496391a8452101308a23b7395cdd49
2+ years later.
^ permalink raw reply
* Re: [PATCH v2] powerpc/powernv: Restrict OPAL symbol map to only be readable by root
From: Greg KH @ 2019-05-03 7:59 UTC (permalink / raw)
To: Andrew Donnellan; +Cc: linuxppc-dev, stable, Stewart Smith, Jordan Niethe
In-Reply-To: <20190503075253.22798-1-ajd@linux.ibm.com>
On Fri, May 03, 2019 at 05:52:53PM +1000, Andrew Donnellan wrote:
> Currently the OPAL symbol map is globally readable, which seems bad as it
> contains physical addresses.
>
> Restrict it to root.
>
> Suggested-by: Michael Ellerman <mpe@ellerman.id.au>
> Cc: Jordan Niethe <jniethe5@gmail.com>
> Cc: Stewart Smith <stewart@linux.ibm.com>
> Fixes: c8742f85125d ("powerpc/powernv: Expose OPAL firmware symbol map")
> Cc: stable@vger.kernel.org
> Signed-off-by: Andrew Donnellan <ajd@linux.ibm.com>
>
> ---
>
> v1->v2:
>
> - fix tabs vs spaces (Greg)
> ---
> arch/powerpc/platforms/powernv/opal.c | 11 +++++++----
> 1 file changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/arch/powerpc/platforms/powernv/opal.c b/arch/powerpc/platforms/powernv/opal.c
> index 2b0eca104f86..0582a02623d0 100644
> --- a/arch/powerpc/platforms/powernv/opal.c
> +++ b/arch/powerpc/platforms/powernv/opal.c
> @@ -681,7 +681,10 @@ static ssize_t symbol_map_read(struct file *fp, struct kobject *kobj,
> bin_attr->size);
> }
>
> -static BIN_ATTR_RO(symbol_map, 0);
> +static struct bin_attribute symbol_map_attr = {
> + .attr = {.name = "symbol_map", .mode = 0400},
> + .read = symbol_map_read
> +};
There's no real need to rename the structure, right? Why not just keep
the bin_attr_symbol_map name? That would make this patch even smaller.
> static void opal_export_symmap(void)
> {
> @@ -698,10 +701,10 @@ static void opal_export_symmap(void)
> return;
>
> /* Setup attributes */
> - bin_attr_symbol_map.private = __va(be64_to_cpu(syms[0]));
> - bin_attr_symbol_map.size = be64_to_cpu(syms[1]);
> + symbol_map_attr.private = __va(be64_to_cpu(syms[0]));
> + symbol_map_attr.size = be64_to_cpu(syms[1]);
>
> - rc = sysfs_create_bin_file(opal_kobj, &bin_attr_symbol_map);
> + rc = sysfs_create_bin_file(opal_kobj, &symbol_map_attr);
Meta-comment, odds are you are racing userspace when you create this
sysfs file, why not add it to the device's default attributes so the
driver core creates it for you at the correct time?
thanks,
greg k-h
^ permalink raw reply
* [PATCH v3 10/10] powerpc: tsi108: support of_get_mac_address new ERR_PTR error
From: Petr Štetiar @ 2019-05-03 7:56 UTC (permalink / raw)
To: netdev, devicetree, Benjamin Herrenschmidt, Paul Mackerras,
Michael Ellerman
Cc: Andrew Lunn, Florian Fainelli, Maxime Ripard, linuxppc-dev,
linux-kernel, Srinivas Kandagatla, Petr Štetiar,
Frank Rowand, Heiner Kallweit
In-Reply-To: <1556870168-26864-1-git-send-email-ynezz@true.cz>
There was NVMEM support added to of_get_mac_address, so it could now
return NULL and ERR_PTR encoded error values, so we need to adjust all
current users of of_get_mac_address to this new fact.
Signed-off-by: Petr Štetiar <ynezz@true.cz>
---
arch/powerpc/sysdev/tsi108_dev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/powerpc/sysdev/tsi108_dev.c b/arch/powerpc/sysdev/tsi108_dev.c
index 1f1af12..2e54405 100644
--- a/arch/powerpc/sysdev/tsi108_dev.c
+++ b/arch/powerpc/sysdev/tsi108_dev.c
@@ -105,7 +105,7 @@ static int __init tsi108_eth_of_init(void)
}
mac_addr = of_get_mac_address(np);
- if (mac_addr)
+ if (!IS_ERR_OR_NULL(mac_addr))
memcpy(tsi_eth_data.mac_addr, mac_addr, 6);
ph = of_get_property(np, "mdio-handle", NULL);
--
1.9.1
^ permalink raw reply related
* [PATCH v3 05/10] net: ethernet: support of_get_mac_address new ERR_PTR error
From: Petr Štetiar @ 2019-05-03 7:56 UTC (permalink / raw)
To: netdev, devicetree, Andreas Larsson, Maxime Ripard, Chen-Yu Tsai,
Vince Bridgers, Florian Fainelli, Sunil Goutham, Robert Richter,
Fugang Duan, Madalin Bucur, Pantelis Antoniou, Vitaly Bordug,
Claudiu Manoil, Li Yang, Yisen Zhuang, Salil Mehta,
Sebastian Hesselbarth, Thomas Petazzoni, Mirko Lindner,
Stephen Hemminger, Felix Fietkau, John Crispin, Sean Wang,
Nelson Chang, Matthias Brugger, Vladimir Zapolskiy,
Sylvain Lemieux, Sergei Shtylyov, Byungho An, Girish K S,
Vipul Pandya, Giuseppe Cavallaro, Alexandre Torgue,
Grygorii Strashko, Wingman Kwok, Murali Karicheri, Michal Simek,
Sören Brinkmann, Anirudha Sarangi, John Linn,
David S. Miller
Cc: Andrew Lunn, Maxime Ripard, linuxppc-dev, linux-mediatek,
linux-kernel, linux-renesas-soc, Srinivas Kandagatla, nios2-dev,
Petr Štetiar, linux-omap, Frank Rowand, linux-arm-kernel,
Heiner Kallweit
In-Reply-To: <1556870168-26864-1-git-send-email-ynezz@true.cz>
There was NVMEM support added to of_get_mac_address, so it could now
return NULL and ERR_PTR encoded error values, so we need to adjust all
current users of of_get_mac_address to this new fact.
While at it, remove superfluous is_valid_ether_addr as the MAC address
returned from of_get_mac_address is always valid and checked by
is_valid_ether_addr anyway.
Signed-off-by: Petr Štetiar <ynezz@true.cz>
---
drivers/net/ethernet/aeroflex/greth.c | 2 +-
drivers/net/ethernet/allwinner/sun4i-emac.c | 2 +-
drivers/net/ethernet/altera/altera_tse_main.c | 2 +-
drivers/net/ethernet/arc/emac_main.c | 2 +-
drivers/net/ethernet/aurora/nb8800.c | 2 +-
drivers/net/ethernet/broadcom/bcmsysport.c | 2 +-
drivers/net/ethernet/broadcom/bgmac-bcma.c | 2 +-
drivers/net/ethernet/broadcom/bgmac-platform.c | 2 +-
drivers/net/ethernet/broadcom/genet/bcmgenet.c | 2 +-
drivers/net/ethernet/cavium/octeon/octeon_mgmt.c | 2 +-
drivers/net/ethernet/cavium/thunder/thunder_bgx.c | 2 +-
drivers/net/ethernet/davicom/dm9000.c | 2 +-
drivers/net/ethernet/ethoc.c | 2 +-
drivers/net/ethernet/ezchip/nps_enet.c | 2 +-
drivers/net/ethernet/freescale/fec_main.c | 2 +-
drivers/net/ethernet/freescale/fec_mpc52xx.c | 2 +-
drivers/net/ethernet/freescale/fman/mac.c | 2 +-
drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c | 2 +-
drivers/net/ethernet/freescale/gianfar.c | 2 +-
drivers/net/ethernet/freescale/ucc_geth.c | 2 +-
drivers/net/ethernet/hisilicon/hisi_femac.c | 2 +-
drivers/net/ethernet/hisilicon/hix5hd2_gmac.c | 2 +-
drivers/net/ethernet/lantiq_xrx200.c | 2 +-
drivers/net/ethernet/marvell/mv643xx_eth.c | 2 +-
drivers/net/ethernet/marvell/mvneta.c | 2 +-
drivers/net/ethernet/marvell/pxa168_eth.c | 2 +-
drivers/net/ethernet/marvell/sky2.c | 2 +-
drivers/net/ethernet/mediatek/mtk_eth_soc.c | 2 +-
drivers/net/ethernet/micrel/ks8851.c | 2 +-
drivers/net/ethernet/micrel/ks8851_mll.c | 2 +-
drivers/net/ethernet/microchip/enc28j60.c | 2 +-
drivers/net/ethernet/nxp/lpc_eth.c | 2 +-
drivers/net/ethernet/qualcomm/qca_spi.c | 2 +-
drivers/net/ethernet/qualcomm/qca_uart.c | 2 +-
drivers/net/ethernet/renesas/ravb_main.c | 2 +-
drivers/net/ethernet/renesas/sh_eth.c | 2 +-
drivers/net/ethernet/samsung/sxgbe/sxgbe_platform.c | 2 +-
drivers/net/ethernet/socionext/sni_ave.c | 2 +-
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +-
drivers/net/ethernet/ti/cpsw.c | 2 +-
drivers/net/ethernet/ti/netcp_core.c | 2 +-
drivers/net/ethernet/wiznet/w5100.c | 2 +-
drivers/net/ethernet/xilinx/ll_temac_main.c | 2 +-
drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 2 +-
drivers/net/ethernet/xilinx/xilinx_emaclite.c | 2 +-
net/ethernet/eth.c | 2 +-
46 files changed, 46 insertions(+), 46 deletions(-)
diff --git a/drivers/net/ethernet/aeroflex/greth.c b/drivers/net/ethernet/aeroflex/greth.c
index 47e5984..ce4d2a5 100644
--- a/drivers/net/ethernet/aeroflex/greth.c
+++ b/drivers/net/ethernet/aeroflex/greth.c
@@ -1459,7 +1459,7 @@ static int greth_of_probe(struct platform_device *ofdev)
const u8 *addr;
addr = of_get_mac_address(ofdev->dev.of_node);
- if (addr) {
+ if (!IS_ERR_OR_NULL(addr)) {
for (i = 0; i < 6; i++)
macaddr[i] = (unsigned int) addr[i];
} else {
diff --git a/drivers/net/ethernet/allwinner/sun4i-emac.c b/drivers/net/ethernet/allwinner/sun4i-emac.c
index e1acafa..9708199 100644
--- a/drivers/net/ethernet/allwinner/sun4i-emac.c
+++ b/drivers/net/ethernet/allwinner/sun4i-emac.c
@@ -870,7 +870,7 @@ static int emac_probe(struct platform_device *pdev)
/* Read MAC-address from DT */
mac_addr = of_get_mac_address(np);
- if (mac_addr)
+ if (!IS_ERR_OR_NULL(mac_addr))
memcpy(ndev->dev_addr, mac_addr, ETH_ALEN);
/* Check if the MAC address is valid, if not get a random one */
diff --git a/drivers/net/ethernet/altera/altera_tse_main.c b/drivers/net/ethernet/altera/altera_tse_main.c
index aa1d1f5..99a5149 100644
--- a/drivers/net/ethernet/altera/altera_tse_main.c
+++ b/drivers/net/ethernet/altera/altera_tse_main.c
@@ -1537,7 +1537,7 @@ static int altera_tse_probe(struct platform_device *pdev)
/* get default MAC address from device tree */
macaddr = of_get_mac_address(pdev->dev.of_node);
- if (macaddr)
+ if (!IS_ERR_OR_NULL(macaddr))
ether_addr_copy(ndev->dev_addr, macaddr);
else
eth_hw_addr_random(ndev);
diff --git a/drivers/net/ethernet/arc/emac_main.c b/drivers/net/ethernet/arc/emac_main.c
index ff3d685..b4bf803 100644
--- a/drivers/net/ethernet/arc/emac_main.c
+++ b/drivers/net/ethernet/arc/emac_main.c
@@ -960,7 +960,7 @@ int arc_emac_probe(struct net_device *ndev, int interface)
/* Get MAC address from device tree */
mac_addr = of_get_mac_address(dev->of_node);
- if (mac_addr)
+ if (!IS_ERR_OR_NULL(mac_addr))
memcpy(ndev->dev_addr, mac_addr, ETH_ALEN);
else
eth_hw_addr_random(ndev);
diff --git a/drivers/net/ethernet/aurora/nb8800.c b/drivers/net/ethernet/aurora/nb8800.c
index 6f56276..30af865 100644
--- a/drivers/net/ethernet/aurora/nb8800.c
+++ b/drivers/net/ethernet/aurora/nb8800.c
@@ -1461,7 +1461,7 @@ static int nb8800_probe(struct platform_device *pdev)
dev->irq = irq;
mac = of_get_mac_address(pdev->dev.of_node);
- if (mac)
+ if (!IS_ERR_OR_NULL(mac))
ether_addr_copy(dev->dev_addr, mac);
if (!is_valid_ether_addr(dev->dev_addr))
diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c
index bc3ac36..c0a8c3c 100644
--- a/drivers/net/ethernet/broadcom/bcmsysport.c
+++ b/drivers/net/ethernet/broadcom/bcmsysport.c
@@ -2548,7 +2548,7 @@ static int bcm_sysport_probe(struct platform_device *pdev)
/* Initialize netdevice members */
macaddr = of_get_mac_address(dn);
- if (!macaddr || !is_valid_ether_addr(macaddr)) {
+ if (IS_ERR_OR_NULL(macaddr)) {
dev_warn(&pdev->dev, "using random Ethernet MAC\n");
eth_hw_addr_random(dev);
} else {
diff --git a/drivers/net/ethernet/broadcom/bgmac-bcma.c b/drivers/net/ethernet/broadcom/bgmac-bcma.c
index 6fe074c..34d1830 100644
--- a/drivers/net/ethernet/broadcom/bgmac-bcma.c
+++ b/drivers/net/ethernet/broadcom/bgmac-bcma.c
@@ -132,7 +132,7 @@ static int bgmac_probe(struct bcma_device *core)
mac = of_get_mac_address(bgmac->dev->of_node);
/* If no MAC address assigned via device tree, check SPROM */
- if (!mac) {
+ if (IS_ERR_OR_NULL(mac)) {
switch (core->core_unit) {
case 0:
mac = sprom->et0mac;
diff --git a/drivers/net/ethernet/broadcom/bgmac-platform.c b/drivers/net/ethernet/broadcom/bgmac-platform.c
index 894eda5..2cd7387 100644
--- a/drivers/net/ethernet/broadcom/bgmac-platform.c
+++ b/drivers/net/ethernet/broadcom/bgmac-platform.c
@@ -193,7 +193,7 @@ static int bgmac_probe(struct platform_device *pdev)
bgmac->dma_dev = &pdev->dev;
mac_addr = of_get_mac_address(np);
- if (mac_addr)
+ if (!IS_ERR_OR_NULL(mac_addr))
ether_addr_copy(bgmac->net_dev->dev_addr, mac_addr);
else
dev_warn(&pdev->dev, "MAC address not present in device tree\n");
diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
index 983245c..8f45c6b 100644
--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
+++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
@@ -3476,7 +3476,7 @@ static int bcmgenet_probe(struct platform_device *pdev)
if (dn) {
macaddr = of_get_mac_address(dn);
- if (!macaddr) {
+ if (IS_ERR_OR_NULL(macaddr)) {
dev_err(&pdev->dev, "can't find MAC address\n");
err = -EINVAL;
goto err;
diff --git a/drivers/net/ethernet/cavium/octeon/octeon_mgmt.c b/drivers/net/ethernet/cavium/octeon/octeon_mgmt.c
index 5359c10..5bc2d61 100644
--- a/drivers/net/ethernet/cavium/octeon/octeon_mgmt.c
+++ b/drivers/net/ethernet/cavium/octeon/octeon_mgmt.c
@@ -1503,7 +1503,7 @@ static int octeon_mgmt_probe(struct platform_device *pdev)
mac = of_get_mac_address(pdev->dev.of_node);
- if (mac)
+ if (!IS_ERR_OR_NULL(mac))
memcpy(netdev->dev_addr, mac, ETH_ALEN);
else
eth_hw_addr_random(netdev);
diff --git a/drivers/net/ethernet/cavium/thunder/thunder_bgx.c b/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
index 673c57b..d29ece0 100644
--- a/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
+++ b/drivers/net/ethernet/cavium/thunder/thunder_bgx.c
@@ -1484,7 +1484,7 @@ static int bgx_init_of_phy(struct bgx *bgx)
break;
mac = of_get_mac_address(node);
- if (mac)
+ if (!IS_ERR_OR_NULL(mac))
ether_addr_copy(bgx->lmac[lmac].mac, mac);
SET_NETDEV_DEV(&bgx->lmac[lmac].netdev, &bgx->pdev->dev);
diff --git a/drivers/net/ethernet/davicom/dm9000.c b/drivers/net/ethernet/davicom/dm9000.c
index c2586f4..30945da 100644
--- a/drivers/net/ethernet/davicom/dm9000.c
+++ b/drivers/net/ethernet/davicom/dm9000.c
@@ -1412,7 +1412,7 @@ static struct dm9000_plat_data *dm9000_parse_dt(struct device *dev)
pdata->flags |= DM9000_PLATF_NO_EEPROM;
mac_addr = of_get_mac_address(np);
- if (mac_addr)
+ if (!IS_ERR_OR_NULL(mac_addr))
memcpy(pdata->dev_addr, mac_addr, sizeof(pdata->dev_addr));
return pdata;
diff --git a/drivers/net/ethernet/ethoc.c b/drivers/net/ethernet/ethoc.c
index 0f3e7f2..eaf9377 100644
--- a/drivers/net/ethernet/ethoc.c
+++ b/drivers/net/ethernet/ethoc.c
@@ -1153,7 +1153,7 @@ static int ethoc_probe(struct platform_device *pdev)
const void *mac;
mac = of_get_mac_address(pdev->dev.of_node);
- if (mac)
+ if (!IS_ERR_OR_NULL(mac))
ether_addr_copy(netdev->dev_addr, mac);
priv->phy_id = -1;
}
diff --git a/drivers/net/ethernet/ezchip/nps_enet.c b/drivers/net/ethernet/ezchip/nps_enet.c
index 659f1ad..5ab8c7e 100644
--- a/drivers/net/ethernet/ezchip/nps_enet.c
+++ b/drivers/net/ethernet/ezchip/nps_enet.c
@@ -616,7 +616,7 @@ static s32 nps_enet_probe(struct platform_device *pdev)
/* set kernel MAC address to dev */
mac_addr = of_get_mac_address(dev->of_node);
- if (mac_addr)
+ if (!IS_ERR_OR_NULL(mac_addr))
ether_addr_copy(ndev->dev_addr, mac_addr);
else
eth_hw_addr_random(ndev);
diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
index a96ad20..145c611 100644
--- a/drivers/net/ethernet/freescale/fec_main.c
+++ b/drivers/net/ethernet/freescale/fec_main.c
@@ -1655,7 +1655,7 @@ static void fec_get_mac(struct net_device *ndev)
struct device_node *np = fep->pdev->dev.of_node;
if (np) {
const char *mac = of_get_mac_address(np);
- if (mac)
+ if (!IS_ERR_OR_NULL(mac))
iap = (unsigned char *) mac;
}
}
diff --git a/drivers/net/ethernet/freescale/fec_mpc52xx.c b/drivers/net/ethernet/freescale/fec_mpc52xx.c
index c1968b3..3b323bb 100644
--- a/drivers/net/ethernet/freescale/fec_mpc52xx.c
+++ b/drivers/net/ethernet/freescale/fec_mpc52xx.c
@@ -902,7 +902,7 @@ static int mpc52xx_fec_probe(struct platform_device *op)
* First try to read MAC address from DT
*/
mac_addr = of_get_mac_address(np);
- if (mac_addr) {
+ if (!IS_ERR_OR_NULL(mac_addr)) {
memcpy(ndev->dev_addr, mac_addr, ETH_ALEN);
} else {
struct mpc52xx_fec __iomem *fec = priv->fec;
diff --git a/drivers/net/ethernet/freescale/fman/mac.c b/drivers/net/ethernet/freescale/fman/mac.c
index 3c21486..f7cfe40 100644
--- a/drivers/net/ethernet/freescale/fman/mac.c
+++ b/drivers/net/ethernet/freescale/fman/mac.c
@@ -724,7 +724,7 @@ static int mac_probe(struct platform_device *_of_dev)
/* Get the MAC address */
mac_addr = of_get_mac_address(mac_node);
- if (!mac_addr) {
+ if (IS_ERR_OR_NULL(mac_addr)) {
dev_err(dev, "of_get_mac_address(%pOF) failed\n", mac_node);
err = -EINVAL;
goto _return_of_get_parent;
diff --git a/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c b/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c
index 7c548ed..be70f9e 100644
--- a/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c
+++ b/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c
@@ -1014,7 +1014,7 @@ static int fs_enet_probe(struct platform_device *ofdev)
spin_lock_init(&fep->tx_lock);
mac_addr = of_get_mac_address(ofdev->dev.of_node);
- if (mac_addr)
+ if (!IS_ERR_OR_NULL(mac_addr))
memcpy(ndev->dev_addr, mac_addr, ETH_ALEN);
ret = fep->ops->allocate_bd(ndev);
diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c
index 45fcc96..7e33122 100644
--- a/drivers/net/ethernet/freescale/gianfar.c
+++ b/drivers/net/ethernet/freescale/gianfar.c
@@ -872,7 +872,7 @@ static int gfar_of_init(struct platform_device *ofdev, struct net_device **pdev)
mac_addr = of_get_mac_address(np);
- if (mac_addr)
+ if (!IS_ERR_OR_NULL(mac_addr))
memcpy(dev->dev_addr, mac_addr, ETH_ALEN);
if (model && !strcasecmp(model, "TSEC"))
diff --git a/drivers/net/ethernet/freescale/ucc_geth.c b/drivers/net/ethernet/freescale/ucc_geth.c
index eb3e65e..d125836 100644
--- a/drivers/net/ethernet/freescale/ucc_geth.c
+++ b/drivers/net/ethernet/freescale/ucc_geth.c
@@ -3910,7 +3910,7 @@ static int ucc_geth_probe(struct platform_device* ofdev)
}
mac_addr = of_get_mac_address(np);
- if (mac_addr)
+ if (!IS_ERR_OR_NULL(mac_addr))
memcpy(dev->dev_addr, mac_addr, ETH_ALEN);
ugeth->ug_info = ug_info;
diff --git a/drivers/net/ethernet/hisilicon/hisi_femac.c b/drivers/net/ethernet/hisilicon/hisi_femac.c
index 2c28088..7e46dc9 100644
--- a/drivers/net/ethernet/hisilicon/hisi_femac.c
+++ b/drivers/net/ethernet/hisilicon/hisi_femac.c
@@ -870,7 +870,7 @@ static int hisi_femac_drv_probe(struct platform_device *pdev)
phy_modes(phy->interface));
mac_addr = of_get_mac_address(node);
- if (mac_addr)
+ if (!IS_ERR_OR_NULL(mac_addr))
ether_addr_copy(ndev->dev_addr, mac_addr);
if (!is_valid_ether_addr(ndev->dev_addr)) {
eth_hw_addr_random(ndev);
diff --git a/drivers/net/ethernet/hisilicon/hix5hd2_gmac.c b/drivers/net/ethernet/hisilicon/hix5hd2_gmac.c
index e5d853b..ed4a3d2 100644
--- a/drivers/net/ethernet/hisilicon/hix5hd2_gmac.c
+++ b/drivers/net/ethernet/hisilicon/hix5hd2_gmac.c
@@ -1229,7 +1229,7 @@ static int hix5hd2_dev_probe(struct platform_device *pdev)
}
mac_addr = of_get_mac_address(node);
- if (mac_addr)
+ if (!IS_ERR_OR_NULL(mac_addr))
ether_addr_copy(ndev->dev_addr, mac_addr);
if (!is_valid_ether_addr(ndev->dev_addr)) {
eth_hw_addr_random(ndev);
diff --git a/drivers/net/ethernet/lantiq_xrx200.c b/drivers/net/ethernet/lantiq_xrx200.c
index d29104d..2308479 100644
--- a/drivers/net/ethernet/lantiq_xrx200.c
+++ b/drivers/net/ethernet/lantiq_xrx200.c
@@ -478,7 +478,7 @@ static int xrx200_probe(struct platform_device *pdev)
}
mac = of_get_mac_address(np);
- if (mac && is_valid_ether_addr(mac))
+ if (!IS_ERR_OR_NULL(mac))
ether_addr_copy(net_dev->dev_addr, mac);
else
eth_hw_addr_random(net_dev);
diff --git a/drivers/net/ethernet/marvell/mv643xx_eth.c b/drivers/net/ethernet/marvell/mv643xx_eth.c
index 292a668..aa35f72 100644
--- a/drivers/net/ethernet/marvell/mv643xx_eth.c
+++ b/drivers/net/ethernet/marvell/mv643xx_eth.c
@@ -2749,7 +2749,7 @@ static int mv643xx_eth_shared_of_add_port(struct platform_device *pdev,
}
mac_addr = of_get_mac_address(pnp);
- if (mac_addr)
+ if (!IS_ERR_OR_NULL(mac_addr))
memcpy(ppd.mac_addr, mac_addr, ETH_ALEN);
mv643xx_eth_property(pnp, "tx-queue-size", ppd.tx_queue_size);
diff --git a/drivers/net/ethernet/marvell/mvneta.c b/drivers/net/ethernet/marvell/mvneta.c
index c0a3718..117bcf4 100644
--- a/drivers/net/ethernet/marvell/mvneta.c
+++ b/drivers/net/ethernet/marvell/mvneta.c
@@ -4563,7 +4563,7 @@ static int mvneta_probe(struct platform_device *pdev)
}
dt_mac_addr = of_get_mac_address(dn);
- if (dt_mac_addr) {
+ if (!IS_ERR_OR_NULL(dt_mac_addr)) {
mac_from = "device tree";
memcpy(dev->dev_addr, dt_mac_addr, ETH_ALEN);
} else {
diff --git a/drivers/net/ethernet/marvell/pxa168_eth.c b/drivers/net/ethernet/marvell/pxa168_eth.c
index 35f2142..ce037e8 100644
--- a/drivers/net/ethernet/marvell/pxa168_eth.c
+++ b/drivers/net/ethernet/marvell/pxa168_eth.c
@@ -1461,7 +1461,7 @@ static int pxa168_eth_probe(struct platform_device *pdev)
if (pdev->dev.of_node)
mac_addr = of_get_mac_address(pdev->dev.of_node);
- if (mac_addr && is_valid_ether_addr(mac_addr)) {
+ if (!IS_ERR_OR_NULL(mac_addr)) {
ether_addr_copy(dev->dev_addr, mac_addr);
} else {
/* try reading the mac address, if set by the bootloader */
diff --git a/drivers/net/ethernet/marvell/sky2.c b/drivers/net/ethernet/marvell/sky2.c
index 8b3495e..821177f 100644
--- a/drivers/net/ethernet/marvell/sky2.c
+++ b/drivers/net/ethernet/marvell/sky2.c
@@ -4808,7 +4808,7 @@ static struct net_device *sky2_init_netdev(struct sky2_hw *hw, unsigned port,
* 2) from internal registers set by bootloader
*/
iap = of_get_mac_address(hw->pdev->dev.of_node);
- if (iap)
+ if (!IS_ERR_OR_NULL(iap))
memcpy(dev->dev_addr, iap, ETH_ALEN);
else
memcpy_fromio(dev->dev_addr, hw->regs + B2_MAC_1 + port * 8,
diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.c b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
index 549d364..03cb59a 100644
--- a/drivers/net/ethernet/mediatek/mtk_eth_soc.c
+++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.c
@@ -2027,7 +2027,7 @@ static int __init mtk_init(struct net_device *dev)
const char *mac_addr;
mac_addr = of_get_mac_address(mac->of_node);
- if (mac_addr)
+ if (!IS_ERR_OR_NULL(mac_addr))
ether_addr_copy(dev->dev_addr, mac_addr);
/* If the mac address is invalid, use random mac address */
diff --git a/drivers/net/ethernet/micrel/ks8851.c b/drivers/net/ethernet/micrel/ks8851.c
index 7849119..b1b2896 100644
--- a/drivers/net/ethernet/micrel/ks8851.c
+++ b/drivers/net/ethernet/micrel/ks8851.c
@@ -425,7 +425,7 @@ static void ks8851_init_mac(struct ks8851_net *ks)
const u8 *mac_addr;
mac_addr = of_get_mac_address(ks->spidev->dev.of_node);
- if (mac_addr) {
+ if (!IS_ERR_OR_NULL(mac_addr)) {
memcpy(dev->dev_addr, mac_addr, ETH_ALEN);
ks8851_write_mac_addr(dev);
return;
diff --git a/drivers/net/ethernet/micrel/ks8851_mll.c b/drivers/net/ethernet/micrel/ks8851_mll.c
index c946841..d44a094 100644
--- a/drivers/net/ethernet/micrel/ks8851_mll.c
+++ b/drivers/net/ethernet/micrel/ks8851_mll.c
@@ -1327,7 +1327,7 @@ static int ks8851_probe(struct platform_device *pdev)
/* overwriting the default MAC address */
if (pdev->dev.of_node) {
mac = of_get_mac_address(pdev->dev.of_node);
- if (mac)
+ if (!IS_ERR_OR_NULL(mac))
memcpy(ks->mac_addr, mac, ETH_ALEN);
} else {
struct ks8851_mll_platform_data *pdata;
diff --git a/drivers/net/ethernet/microchip/enc28j60.c b/drivers/net/ethernet/microchip/enc28j60.c
index 8f72587..f8d5fd3 100644
--- a/drivers/net/ethernet/microchip/enc28j60.c
+++ b/drivers/net/ethernet/microchip/enc28j60.c
@@ -1588,7 +1588,7 @@ static int enc28j60_probe(struct spi_device *spi)
}
macaddr = of_get_mac_address(spi->dev.of_node);
- if (macaddr)
+ if (!IS_ERR_OR_NULL(macaddr))
ether_addr_copy(dev->dev_addr, macaddr);
else
eth_hw_addr_random(dev);
diff --git a/drivers/net/ethernet/nxp/lpc_eth.c b/drivers/net/ethernet/nxp/lpc_eth.c
index 89d1739..336b6aa 100644
--- a/drivers/net/ethernet/nxp/lpc_eth.c
+++ b/drivers/net/ethernet/nxp/lpc_eth.c
@@ -1368,7 +1368,7 @@ static int lpc_eth_drv_probe(struct platform_device *pdev)
if (!is_valid_ether_addr(ndev->dev_addr)) {
const char *macaddr = of_get_mac_address(np);
- if (macaddr)
+ if (!IS_ERR_OR_NULL(macaddr))
memcpy(ndev->dev_addr, macaddr, ETH_ALEN);
}
if (!is_valid_ether_addr(ndev->dev_addr))
diff --git a/drivers/net/ethernet/qualcomm/qca_spi.c b/drivers/net/ethernet/qualcomm/qca_spi.c
index 97f9295..def5192 100644
--- a/drivers/net/ethernet/qualcomm/qca_spi.c
+++ b/drivers/net/ethernet/qualcomm/qca_spi.c
@@ -966,7 +966,7 @@
mac = of_get_mac_address(spi->dev.of_node);
- if (mac)
+ if (!IS_ERR_OR_NULL(mac))
ether_addr_copy(qca->net_dev->dev_addr, mac);
if (!is_valid_ether_addr(qca->net_dev->dev_addr)) {
diff --git a/drivers/net/ethernet/qualcomm/qca_uart.c b/drivers/net/ethernet/qualcomm/qca_uart.c
index db6068c..ae78066 100644
--- a/drivers/net/ethernet/qualcomm/qca_uart.c
+++ b/drivers/net/ethernet/qualcomm/qca_uart.c
@@ -351,7 +351,7 @@ static int qca_uart_probe(struct serdev_device *serdev)
mac = of_get_mac_address(serdev->dev.of_node);
- if (mac)
+ if (!IS_ERR_OR_NULL(mac))
ether_addr_copy(qca->net_dev->dev_addr, mac);
if (!is_valid_ether_addr(qca->net_dev->dev_addr)) {
diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
index 8154b38..77e9b02 100644
--- a/drivers/net/ethernet/renesas/ravb_main.c
+++ b/drivers/net/ethernet/renesas/ravb_main.c
@@ -111,7 +111,7 @@ static void ravb_set_buffer_align(struct sk_buff *skb)
*/
static void ravb_read_mac_address(struct net_device *ndev, const u8 *mac)
{
- if (mac) {
+ if (!IS_ERR_OR_NULL(mac)) {
ether_addr_copy(ndev->dev_addr, mac);
} else {
u32 mahr = ravb_read(ndev, MAHR);
diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
index e33af37..e89ba82 100644
--- a/drivers/net/ethernet/renesas/sh_eth.c
+++ b/drivers/net/ethernet/renesas/sh_eth.c
@@ -3193,7 +3193,7 @@ static struct sh_eth_plat_data *sh_eth_parse_dt(struct device *dev)
pdata->phy_interface = ret;
mac_addr = of_get_mac_address(np);
- if (mac_addr)
+ if (!IS_ERR_OR_NULL(mac_addr))
memcpy(pdata->mac_addr, mac_addr, ETH_ALEN);
pdata->no_ether_link =
diff --git a/drivers/net/ethernet/samsung/sxgbe/sxgbe_platform.c b/drivers/net/ethernet/samsung/sxgbe/sxgbe_platform.c
index fbd00cb..d2bc941 100644
--- a/drivers/net/ethernet/samsung/sxgbe/sxgbe_platform.c
+++ b/drivers/net/ethernet/samsung/sxgbe/sxgbe_platform.c
@@ -124,7 +124,7 @@ static int sxgbe_platform_probe(struct platform_device *pdev)
}
/* Get MAC address if available (DT) */
- if (mac)
+ if (!IS_ERR_OR_NULL(mac))
ether_addr_copy(priv->dev->dev_addr, mac);
/* Get the TX/RX IRQ numbers */
diff --git a/drivers/net/ethernet/socionext/sni_ave.c b/drivers/net/ethernet/socionext/sni_ave.c
index bb6d5fb..4194ef7 100644
--- a/drivers/net/ethernet/socionext/sni_ave.c
+++ b/drivers/net/ethernet/socionext/sni_ave.c
@@ -1599,7 +1599,7 @@ static int ave_probe(struct platform_device *pdev)
ndev->max_mtu = AVE_MAX_ETHFRAME - (ETH_HLEN + ETH_FCS_LEN);
mac_addr = of_get_mac_address(np);
- if (mac_addr)
+ if (!IS_ERR_OR_NULL(mac_addr))
ether_addr_copy(ndev->dev_addr, mac_addr);
/* if the mac address is invalid, use random mac address */
diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
index 4871243..d3664e6 100644
--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
@@ -4262,7 +4262,7 @@ int stmmac_dvr_probe(struct device *device,
priv->wol_irq = res->wol_irq;
priv->lpi_irq = res->lpi_irq;
- if (res->mac)
+ if (!IS_ERR_OR_NULL(res->mac))
memcpy(priv->dev->dev_addr, res->mac, ETH_ALEN);
dev_set_drvdata(device, priv->dev);
diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index a591583..6aaacaf 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -3344,7 +3344,7 @@ static int cpsw_probe_dt(struct cpsw_platform_data *data,
no_phy_slave:
mac_addr = of_get_mac_address(slave_node);
- if (mac_addr) {
+ if (!IS_ERR_OR_NULL(mac_addr)) {
memcpy(slave_data->mac_addr, mac_addr, ETH_ALEN);
} else {
ret = ti_cm_get_macid(&pdev->dev, i,
diff --git a/drivers/net/ethernet/ti/netcp_core.c b/drivers/net/ethernet/ti/netcp_core.c
index d847f67..c413637 100644
--- a/drivers/net/ethernet/ti/netcp_core.c
+++ b/drivers/net/ethernet/ti/netcp_core.c
@@ -2045,7 +2045,7 @@ static int netcp_create_interface(struct netcp_device *netcp_device,
devm_release_mem_region(dev, res.start, size);
} else {
mac_addr = of_get_mac_address(node_interface);
- if (mac_addr)
+ if (!IS_ERR_OR_NULL(mac_addr))
ether_addr_copy(ndev->dev_addr, mac_addr);
else
eth_random_addr(ndev->dev_addr);
diff --git a/drivers/net/ethernet/wiznet/w5100.c b/drivers/net/ethernet/wiznet/w5100.c
index d8ba512..b0052933 100644
--- a/drivers/net/ethernet/wiznet/w5100.c
+++ b/drivers/net/ethernet/wiznet/w5100.c
@@ -1164,7 +1164,7 @@ int w5100_probe(struct device *dev, const struct w5100_ops *ops,
INIT_WORK(&priv->setrx_work, w5100_setrx_work);
INIT_WORK(&priv->restart_work, w5100_restart_work);
- if (mac_addr)
+ if (!IS_ERR_OR_NULL(mac_addr))
memcpy(ndev->dev_addr, mac_addr, ETH_ALEN);
else
eth_hw_addr_random(ndev);
diff --git a/drivers/net/ethernet/xilinx/ll_temac_main.c b/drivers/net/ethernet/xilinx/ll_temac_main.c
index 44efffb..937dca0 100644
--- a/drivers/net/ethernet/xilinx/ll_temac_main.c
+++ b/drivers/net/ethernet/xilinx/ll_temac_main.c
@@ -1077,7 +1077,7 @@ static int temac_of_probe(struct platform_device *op)
/* Retrieve the MAC address */
addr = of_get_mac_address(op->dev.of_node);
- if (!addr) {
+ if (IS_ERR_OR_NULL(addr)) {
dev_err(&op->dev, "could not find MAC address\n");
rc = -ENODEV;
goto err_iounmap_2;
diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
index 4041c75..55f9d1b 100644
--- a/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
+++ b/drivers/net/ethernet/xilinx/xilinx_axienet_main.c
@@ -1596,7 +1596,7 @@ static int axienet_probe(struct platform_device *pdev)
/* Retrieve the MAC address */
mac_addr = of_get_mac_address(pdev->dev.of_node);
- if (!mac_addr) {
+ if (IS_ERR_OR_NULL(mac_addr)) {
dev_err(&pdev->dev, "could not find MAC address\n");
goto free_netdev;
}
diff --git a/drivers/net/ethernet/xilinx/xilinx_emaclite.c b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
index b03a417..b7c0058 100644
--- a/drivers/net/ethernet/xilinx/xilinx_emaclite.c
+++ b/drivers/net/ethernet/xilinx/xilinx_emaclite.c
@@ -1143,7 +1143,7 @@ static int xemaclite_of_probe(struct platform_device *ofdev)
lp->rx_ping_pong = get_bool(ofdev, "xlnx,rx-ping-pong");
mac_address = of_get_mac_address(ofdev->dev.of_node);
- if (mac_address) {
+ if (!IS_ERR_OR_NULL(mac_address)) {
/* Set the MAC address. */
memcpy(ndev->dev_addr, mac_address, ETH_ALEN);
} else {
diff --git a/net/ethernet/eth.c b/net/ethernet/eth.c
index f7a3d7a..b8c126c 100644
--- a/net/ethernet/eth.c
+++ b/net/ethernet/eth.c
@@ -554,7 +554,7 @@ int eth_platform_get_mac_address(struct device *dev, u8 *mac_addr)
addr = NULL;
if (dp)
addr = of_get_mac_address(dp);
- if (!addr)
+ if (IS_ERR_OR_NULL(addr))
addr = arch_get_platform_mac_address();
if (!addr)
--
1.9.1
^ permalink raw reply related
* Re: [PATCH] powerpc/powernv: Restrict OPAL symbol map to only be readable by root
From: Andrew Donnellan @ 2019-05-03 7:52 UTC (permalink / raw)
To: Greg KH; +Cc: linuxppc-dev, stable, Stewart Smith, Jordan Niethe
In-Reply-To: <20190503074834.GA27088@kroah.com>
On 3/5/19 5:48 pm, Greg KH wrote:
> no tab?
>
> checkpatch.pl is your friend :)
>
Ughhhhhhhhhh.
Sadly our CI is currently down ;)
Respun.
--
Andrew Donnellan OzLabs, ADL Canberra
ajd@linux.ibm.com IBM Australia Limited
^ permalink raw reply
* [PATCH v2] powerpc/powernv: Restrict OPAL symbol map to only be readable by root
From: Andrew Donnellan @ 2019-05-03 7:52 UTC (permalink / raw)
To: linuxppc-dev; +Cc: stable, Stewart Smith, Jordan Niethe
Currently the OPAL symbol map is globally readable, which seems bad as it
contains physical addresses.
Restrict it to root.
Suggested-by: Michael Ellerman <mpe@ellerman.id.au>
Cc: Jordan Niethe <jniethe5@gmail.com>
Cc: Stewart Smith <stewart@linux.ibm.com>
Fixes: c8742f85125d ("powerpc/powernv: Expose OPAL firmware symbol map")
Cc: stable@vger.kernel.org
Signed-off-by: Andrew Donnellan <ajd@linux.ibm.com>
---
v1->v2:
- fix tabs vs spaces (Greg)
---
arch/powerpc/platforms/powernv/opal.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc/platforms/powernv/opal.c b/arch/powerpc/platforms/powernv/opal.c
index 2b0eca104f86..0582a02623d0 100644
--- a/arch/powerpc/platforms/powernv/opal.c
+++ b/arch/powerpc/platforms/powernv/opal.c
@@ -681,7 +681,10 @@ static ssize_t symbol_map_read(struct file *fp, struct kobject *kobj,
bin_attr->size);
}
-static BIN_ATTR_RO(symbol_map, 0);
+static struct bin_attribute symbol_map_attr = {
+ .attr = {.name = "symbol_map", .mode = 0400},
+ .read = symbol_map_read
+};
static void opal_export_symmap(void)
{
@@ -698,10 +701,10 @@ static void opal_export_symmap(void)
return;
/* Setup attributes */
- bin_attr_symbol_map.private = __va(be64_to_cpu(syms[0]));
- bin_attr_symbol_map.size = be64_to_cpu(syms[1]);
+ symbol_map_attr.private = __va(be64_to_cpu(syms[0]));
+ symbol_map_attr.size = be64_to_cpu(syms[1]);
- rc = sysfs_create_bin_file(opal_kobj, &bin_attr_symbol_map);
+ rc = sysfs_create_bin_file(opal_kobj, &symbol_map_attr);
if (rc)
pr_warn("Error %d creating OPAL symbols file\n", rc);
}
--
2.20.1
^ permalink raw reply related
* Re: [PATCH] powerpc/powernv: Restrict OPAL symbol map to only be readable by root
From: Greg KH @ 2019-05-03 7:48 UTC (permalink / raw)
To: Andrew Donnellan; +Cc: linuxppc-dev, stable, Stewart Smith, Jordan Niethe
In-Reply-To: <20190503074405.20708-1-ajd@linux.ibm.com>
On Fri, May 03, 2019 at 05:44:05PM +1000, Andrew Donnellan wrote:
> Currently the OPAL symbol map is globally readable, which seems bad as it
> contains physical addresses.
>
> Restrict it to root.
>
> Suggested-by: Michael Ellerman <mpe@ellerman.id.au>
> Cc: Jordan Niethe <jniethe5@gmail.com>
> Cc: Stewart Smith <stewart@linux.ibm.com>
> Fixes: c8742f85125d ("powerpc/powernv: Expose OPAL firmware symbol map")
> Cc: stable@vger.kernel.org
> Signed-off-by: Andrew Donnellan <ajd@linux.ibm.com>
> ---
> arch/powerpc/platforms/powernv/opal.c | 11 +++++++----
> 1 file changed, 7 insertions(+), 4 deletions(-)
>
> diff --git a/arch/powerpc/platforms/powernv/opal.c b/arch/powerpc/platforms/powernv/opal.c
> index 2b0eca104f86..505460a72052 100644
> --- a/arch/powerpc/platforms/powernv/opal.c
> +++ b/arch/powerpc/platforms/powernv/opal.c
> @@ -681,7 +681,10 @@ static ssize_t symbol_map_read(struct file *fp, struct kobject *kobj,
> bin_attr->size);
> }
>
> -static BIN_ATTR_RO(symbol_map, 0);
> +static struct bin_attribute symbol_map_attr = {
> + .attr = {.name = "symbol_map", .mode = 0400},
> + .read = symbol_map_read
> +};
>
> static void opal_export_symmap(void)
> {
> @@ -698,10 +701,10 @@ static void opal_export_symmap(void)
> return;
>
> /* Setup attributes */
> - bin_attr_symbol_map.private = __va(be64_to_cpu(syms[0]));
> - bin_attr_symbol_map.size = be64_to_cpu(syms[1]);
> + symbol_map_attr.private = __va(be64_to_cpu(syms[0]));
no tab?
checkpatch.pl is your friend :)
^ permalink raw reply
* [PATCH] powerpc/powernv: Restrict OPAL symbol map to only be readable by root
From: Andrew Donnellan @ 2019-05-03 7:44 UTC (permalink / raw)
To: linuxppc-dev; +Cc: stable, Stewart Smith, Jordan Niethe
Currently the OPAL symbol map is globally readable, which seems bad as it
contains physical addresses.
Restrict it to root.
Suggested-by: Michael Ellerman <mpe@ellerman.id.au>
Cc: Jordan Niethe <jniethe5@gmail.com>
Cc: Stewart Smith <stewart@linux.ibm.com>
Fixes: c8742f85125d ("powerpc/powernv: Expose OPAL firmware symbol map")
Cc: stable@vger.kernel.org
Signed-off-by: Andrew Donnellan <ajd@linux.ibm.com>
---
arch/powerpc/platforms/powernv/opal.c | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/arch/powerpc/platforms/powernv/opal.c b/arch/powerpc/platforms/powernv/opal.c
index 2b0eca104f86..505460a72052 100644
--- a/arch/powerpc/platforms/powernv/opal.c
+++ b/arch/powerpc/platforms/powernv/opal.c
@@ -681,7 +681,10 @@ static ssize_t symbol_map_read(struct file *fp, struct kobject *kobj,
bin_attr->size);
}
-static BIN_ATTR_RO(symbol_map, 0);
+static struct bin_attribute symbol_map_attr = {
+ .attr = {.name = "symbol_map", .mode = 0400},
+ .read = symbol_map_read
+};
static void opal_export_symmap(void)
{
@@ -698,10 +701,10 @@ static void opal_export_symmap(void)
return;
/* Setup attributes */
- bin_attr_symbol_map.private = __va(be64_to_cpu(syms[0]));
- bin_attr_symbol_map.size = be64_to_cpu(syms[1]);
+ symbol_map_attr.private = __va(be64_to_cpu(syms[0]));
+ symbol_map_attr.size = be64_to_cpu(syms[1]);
- rc = sysfs_create_bin_file(opal_kobj, &bin_attr_symbol_map);
+ rc = sysfs_create_bin_file(opal_kobj, &symbol_map_attr);
if (rc)
pr_warn("Error %d creating OPAL symbols file\n", rc);
}
--
2.20.1
^ permalink raw reply related
* Re: [PATCH v11 09/13] powerpc: disable KASAN instrumentation on early/critical files.
From: Christophe Leroy @ 2019-05-03 7:38 UTC (permalink / raw)
To: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman,
Nicholas Piggin, Aneesh Kumar K.V, Andrey Ryabinin,
Alexander Potapenko, Dmitry Vyukov, Daniel Axtens
Cc: linux-mm, linuxppc-dev, linux-kernel, kasan-dev
In-Reply-To: <867c149e77f80e855a9310a490fb15ca03ffd63d.1556295461.git.christophe.leroy@c-s.fr>
Le 26/04/2019 à 18:23, Christophe Leroy a écrit :
> All files containing functions run before kasan_early_init() is called
> must have KASAN instrumentation disabled.
>
> For those file, branch profiling also have to be disabled otherwise
> each if () generates a call to ftrace_likely_update().
>
> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
> ---
> arch/powerpc/kernel/Makefile | 12 ++++++++++++
> arch/powerpc/lib/Makefile | 8 ++++++++
> arch/powerpc/mm/Makefile | 6 ++++++
> arch/powerpc/platforms/powermac/Makefile | 6 ++++++
> arch/powerpc/purgatory/Makefile | 3 +++
> arch/powerpc/xmon/Makefile | 1 +
> 6 files changed, 36 insertions(+)
>
[...]
> diff --git a/arch/powerpc/mm/Makefile b/arch/powerpc/mm/Makefile
> index 3c1bd9fa23cd..dd945ca869b2 100644
> --- a/arch/powerpc/mm/Makefile
> +++ b/arch/powerpc/mm/Makefile
> @@ -7,6 +7,12 @@ ccflags-$(CONFIG_PPC64) := $(NO_MINIMAL_TOC)
>
> CFLAGS_REMOVE_slb.o = $(CC_FLAGS_FTRACE)
>
> +KASAN_SANITIZE_ppc_mmu_32.o := n
> +
> +ifdef CONFIG_KASAN
> +CFLAGS_ppc_mmu_32.o += -DDISABLE_BRANCH_PROFILING
> +endif
> +
The above is missing in powerpc/next (should now be in
arch/powerpc/mm/book3s32/Makefile )
Christophe
^ permalink raw reply
* Re: [PATCH v2] powerpc/32s: fix BATs setting with CONFIG_STRICT_KERNEL_RWX
From: Michael Ellerman @ 2019-05-03 7:05 UTC (permalink / raw)
To: Christophe Leroy, Benjamin Herrenschmidt, Paul Mackerras,
Serge Belyshev, Segher Boessenkool
Cc: linuxppc-dev, linux-kernel
In-Reply-To: <09733bd9d90f2ab9dfee9838442e0bea01df194d.1556640535.git.christophe.leroy@c-s.fr>
On Tue, 2019-04-30 at 16:11:59 UTC, Christophe Leroy wrote:
> Serge reported some crashes with CONFIG_STRICT_KERNEL_RWX enabled
> on a book3s32 machine.
>
> Analysis shows two issues:
> - BATs addresses and sizes are not properly aligned.
> - There is a gap between the last address covered by BATs and the
> first address covered by pages.
>
> Memory mapped with DBATs:
> 0: 0xc0000000-0xc07fffff 0x00000000 Kernel RO coherent
> 1: 0xc0800000-0xc0bfffff 0x00800000 Kernel RO coherent
> 2: 0xc0c00000-0xc13fffff 0x00c00000 Kernel RW coherent
> 3: 0xc1400000-0xc23fffff 0x01400000 Kernel RW coherent
> 4: 0xc2400000-0xc43fffff 0x02400000 Kernel RW coherent
> 5: 0xc4400000-0xc83fffff 0x04400000 Kernel RW coherent
> 6: 0xc8400000-0xd03fffff 0x08400000 Kernel RW coherent
> 7: 0xd0400000-0xe03fffff 0x10400000 Kernel RW coherent
>
> Memory mapped with pages:
> 0xe1000000-0xefffffff 0x21000000 240M rw present dirty accessed
>
> This patch fixes both issues. With the patch, we get the following
> which is as expected:
>
> Memory mapped with DBATs:
> 0: 0xc0000000-0xc07fffff 0x00000000 Kernel RO coherent
> 1: 0xc0800000-0xc0bfffff 0x00800000 Kernel RO coherent
> 2: 0xc0c00000-0xc0ffffff 0x00c00000 Kernel RW coherent
> 3: 0xc1000000-0xc1ffffff 0x01000000 Kernel RW coherent
> 4: 0xc2000000-0xc3ffffff 0x02000000 Kernel RW coherent
> 5: 0xc4000000-0xc7ffffff 0x04000000 Kernel RW coherent
> 6: 0xc8000000-0xcfffffff 0x08000000 Kernel RW coherent
> 7: 0xd0000000-0xdfffffff 0x10000000 Kernel RW coherent
>
> Memory mapped with pages:
> 0xe0000000-0xefffffff 0x20000000 256M rw present dirty accessed
>
> Reported-by: Serge Belyshev <belyshev@depni.sinp.msu.ru>
> Fixes: 63b2bc619565 ("powerpc/mm/32s: Use BATs for STRICT_KERNEL_RWX")
> Cc: stable@vger.kernel.org
> Acked-by: Segher Boessenkool <segher@kernel.crashing.org>
> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>
Applied to powerpc fixes, thanks.
https://git.kernel.org/powerpc/c/12f363511d47f86c49b7766c349989cb
cheers
^ permalink raw reply
* Re: [PATCH] arch: fix without checked-return value with lseek
From: Michael Ellerman @ 2019-05-03 6:59 UTC (permalink / raw)
To: Bo YU, benh, paulus; +Cc: Bo YU, linuxppc-dev, linux-kernel
In-Reply-To: <1540905715-4266-1-git-send-email-tsu.yubo@gmail.com>
On Tue, 2018-10-30 at 13:21:55 UTC, Bo YU wrote:
> lseek should have returned value but we miss it maybe.
> This is detected by Coverity scan:
> CID: 1440481
>
> Signed-off-by: Bo YU <tsu.yubo@gmail.com>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/5d085ec04a000fefb5182d3b03ee46ca
cheers
^ permalink raw reply
* Re: [PATCH] powerpc: Add doorbell tracepoints
From: Michael Ellerman @ 2019-05-03 6:59 UTC (permalink / raw)
To: Anton Blanchard, benh, paulus, npiggin, ruscur; +Cc: linuxppc-dev
In-Reply-To: <20181004062337.14252-1-anton@ozlabs.org>
On Thu, 2018-10-04 at 06:23:37 UTC, Anton Blanchard wrote:
> When analysing sources of OS jitter, I noticed that doorbells cannot be
> traced.
>
> Signed-off-by: Anton Blanchard <anton@ozlabs.org>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/5b2a15296210d3b70e06d0f09a8e701f
cheers
^ permalink raw reply
* Re: [PATCH v2] powerpc/pseries: Track LMB nid instead of using device tree
From: Michael Ellerman @ 2019-05-03 6:59 UTC (permalink / raw)
To: Nathan Fontenot, linuxppc-dev
In-Reply-To: <153849454718.31242.7801365038229982137.stgit@ltcalpine2-lp14.aus.stglabs.ibm.com>
On Tue, 2018-10-02 at 15:35:59 UTC, Nathan Fontenot wrote:
> When removing memory we need to remove the memory from the node
> it was added to instead of looking up the node it should be in
> in the device tree.
>
> During testing we have seen scenarios where the affinity for a
> LMB changes due to a partition migration or PRRN event. In these
> cases the node the LMB exists in may not match the node the device
> tree indicates it belongs in. This can lead to a system crash
> when trying to DLPAR remove the LMB after a migration or PRRN
> event. The current code looks up the node in the device tree to
> remove the LMB from, the crash occurs when we try to offline this
> node and it does not have any data, i.e. node_data[nid] == NULL.
>
> 36:mon> e
> cpu 0x36: Vector: 300 (Data Access) at [c0000001828b7810]
> pc: c00000000036d08c: try_offline_node+0x2c/0x1b0
> lr: c0000000003a14ec: remove_memory+0xbc/0x110
> sp: c0000001828b7a90
> msr: 800000000280b033
> dar: 9a28
> dsisr: 40000000
> current = 0xc0000006329c4c80
> paca = 0xc000000007a55200 softe: 0 irq_happened: 0x01
> pid = 76926, comm = kworker/u320:3
>
> 36:mon> t
> [link register ] c0000000003a14ec remove_memory+0xbc/0x110
> [c0000001828b7a90] c00000000006a1cc arch_remove_memory+0x9c/0xd0 (unreliable)
> [c0000001828b7ad0] c0000000003a14e0 remove_memory+0xb0/0x110
> [c0000001828b7b20] c0000000000c7db4 dlpar_remove_lmb+0x94/0x160
> [c0000001828b7b60] c0000000000c8ef8 dlpar_memory+0x7e8/0xd10
> [c0000001828b7bf0] c0000000000bf828 handle_dlpar_errorlog+0xf8/0x160
> [c0000001828b7c60] c0000000000bf8cc pseries_hp_work_fn+0x3c/0xa0
> [c0000001828b7c90] c000000000128cd8 process_one_work+0x298/0x5a0
> [c0000001828b7d20] c000000000129068 worker_thread+0x88/0x620
> [c0000001828b7dc0] c00000000013223c kthread+0x1ac/0x1c0
> [c0000001828b7e30] c00000000000b45c ret_from_kernel_thread+0x5c/0x80
>
> To resolve this we need to track the node a LMB belongs to when
> it is added to the system so we can remove it from that node instead
> of the node that the device tree indicates it should belong to.
>
> Signed-off-by: Nathan Fontenot <nfont@linux.vnet.ibm.com>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/b2d3b5ee66f2a04a918cc043cec0c9ed
cheers
^ permalink raw reply
* Re: [PATCH] powerpc/powernv/ioda2: Add __printf format/argument verification
From: Michael Ellerman @ 2019-05-03 6:59 UTC (permalink / raw)
To: Joe Perches, Benjamin Herrenschmidt, Paul Mackerras
Cc: linuxppc-dev, linux-kernel
In-Reply-To: <f4003df27f480c533b311dc9515f13fdaa962563.1490869145.git.joe@perches.com>
On Thu, 2017-03-30 at 10:19:25 UTC, Joe Perches wrote:
> Fix fallout too.
>
> Signed-off-by: Joe Perches <joe@perches.com>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/1e496391a8452101308a23b7395cdd49
cheers
^ permalink raw reply
* Re: [PATCH v2 1/2] powerpc/mm/ptdump: Wrap seq_printf() to handle NULL pointers
From: Michael Ellerman @ 2019-05-03 6:59 UTC (permalink / raw)
To: Russell Currey, linuxppc-dev; +Cc: Julia.Lawall, rashmica.g
In-Reply-To: <20190502073947.6481-1-ruscur@russell.cc>
On Thu, 2019-05-02 at 07:39:46 UTC, Russell Currey wrote:
> Lovingly borrowed from the arch/arm64 ptdump code.
>
> This doesn't seem to be an issue in practice, but is necessary for my
> upcoming commit.
>
> Signed-off-by: Russell Currey <ruscur@russell.cc>
Series applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/5f18cbdbdd42b050c51eb9859f8ce43d
cheers
^ permalink raw reply
* Re: [PATCH] MAINTAINERS: Update cxl/ocxl email address
From: Michael Ellerman @ 2019-05-03 6:59 UTC (permalink / raw)
To: Andrew Donnellan, linuxppc-dev; +Cc: fbarrat
In-Reply-To: <20190502060041.794-1-ajd@linux.ibm.com>
On Thu, 2019-05-02 at 06:00:41 UTC, Andrew Donnellan wrote:
> Use my @linux.ibm.com email to avoid a layer of redirection.
>
> Signed-off-by: Andrew Donnellan <ajd@linux.ibm.com>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/4c1bd90477c60618eb6dfba2e92d3a28
cheers
^ permalink raw reply
* Re: [PATCH] powerpc/64: Don't trace code that runs with the soft irq mask unreconciled
From: Michael Ellerman @ 2019-05-03 6:59 UTC (permalink / raw)
To: Nicholas Piggin, linuxppc-dev; +Cc: Nicholas Piggin
In-Reply-To: <20190502052107.24738-1-npiggin@gmail.com>
On Thu, 2019-05-02 at 05:21:07 UTC, Nicholas Piggin wrote:
> "Reconciling" in terms of interrupt handling, is to bring the soft irq
> mask state in to synch with the hardware, after an interrupt causes
> MSR[EE] to be cleared (while the soft mask may be enabled, and hard
> irqs not marked disabled).
>
> General kernel code should not be called while unreconciled, because
> local_irq_disable, etc. manipulations can cause surprising irq traces,
> and it's fragile because the soft irq code does not really expect to
> be called in this situation.
>
> When exiting from an interrupt, MSR[EE] is cleared to prevent races,
> but soft irq state is enabled for the returned-to context, so this is
> now an unreconciled state. restore_math is called in this state, and
> that can be ftraced, and the ftrace subsystem disables local irqs.
>
> Mark restore_math and its callees as notrace. Restore a sanity check
> in the soft irq code that had to be disabled for this case, by commit
> 4da1f79227ad4 ("powerpc/64: Disable irq restore warning for now").
>
> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/e2b36d591720d81741f37e047a6f0047
cheers
^ permalink raw reply
* Re: [PATCH v2] powerpc: remove the __kernel_io_end export
From: Michael Ellerman @ 2019-05-03 6:59 UTC (permalink / raw)
To: Christoph Hellwig, aneesh.kumar; +Cc: linuxppc-dev, linux-kernel
In-Reply-To: <20190430182739.21961-1-hch@lst.de>
On Tue, 2019-04-30 at 18:27:39 UTC, Christoph Hellwig wrote:
> This export was added in this merge window, but without any actual
> user, or justification for a modular user.
>
> Fixes: a35a3c6f6065 ("powerpc/mm/hash64: Add a variable to track the end of IO mapping")
> Signed-off-by: Christoph Hellwig <hch@lst.de>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/c9e0fc33b8be52a7134ed0ee79b6a1e3
cheers
^ permalink raw reply
* Re: [PATCH] powerpc/mm/radix: Fix kernel crash when running subpage protect test
From: Michael Ellerman @ 2019-05-03 6:59 UTC (permalink / raw)
To: Aneesh Kumar K.V, npiggin, paulus
Cc: Sachin Sant, Aneesh Kumar K.V, linuxppc-dev
In-Reply-To: <20190430075907.7701-1-aneesh.kumar@linux.ibm.com>
On Tue, 2019-04-30 at 07:59:07 UTC, "Aneesh Kumar K.V" wrote:
> This patch fixes the below crash by making sure we touch the subpage protection
> related structures only if we know they are allocated on the platform. With
> radix translation we don't allocate hash context at all and trying to access
> subpage_prot_table results in
>
> Faulting instruction address: 0xc00000000008bdb4
> Oops: Kernel access of bad area, sig: 11 [#1]
> LE PAGE_SIZE=64K MMU=Radix MMU=Hash SMP NR_CPUS=2048 NUMA PowerNV
> ....
> NIP [c00000000008bdb4] sys_subpage_prot+0x74/0x590
> LR [c00000000000b688] system_call+0x5c/0x70
> Call Trace:
> [c00020002c6b7d30] [c00020002c6b7d90] 0xc00020002c6b7d90 (unreliable)
> [c00020002c6b7e20] [c00000000000b688] system_call+0x5c/0x70
> Instruction dump:
> fb61ffd8 fb81ffe0 fba1ffe8 fbc1fff0 fbe1fff8 f821ff11 e92d1178 f9210068
> 39200000 e92d0968 ebe90630 e93f03e8 <eb891038> 60000000 3860fffe e9410068
>
> We also move the subpage_prot_table with mmp_sem held to avoid racec
> between two parallel subpage_prot syscall.
>
> Reported-by: Sachin Sant <sachinp@linux.vnet.ibm.com>
> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
> Tested-by: Sachin Sant <sachinp@linux.vnet.ibm.com <mailto:sachinp@linux.vnet.ibm.com>>
Applied to powerpc next, thanks.
https://git.kernel.org/powerpc/c/2c474c03505677cfd987d52e8bf42abe
cheers
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox