Re: [PATCH] dt-bindings: Cleanup standard unit properties
On Thu, Jan 28, 2021 at 12:16:14PM -0800, Guenter Roeck wrote: > On Thu, Jan 28, 2021 at 01:45:15PM -0600, Rob Herring wrote: > > Properties with standard unit suffixes already have a type and don't need > > type definitions. They also default to a single entry, so 'maxItems: 1' > > can be dropped. > > > > adi,ad5758 is an oddball which defined an enum of arrays. While a valid > > schema, it is simpler as a whole to only define scalar constraints. Acked-by: Wolfram Sang # for I2C signature.asc Description: PGP signature
Re: [PATCH v1 2/2] isa: Make the remove callback for isa drivers return void
On Thu, Jan 21, 2021 at 09:48:12PM +0100, Uwe Kleine-König wrote: > The driver core ignores the return value of the remove callback, so > don't give isa drivers the chance to provide a value. > > Adapt all isa_drivers with a remove callbacks accordingly; they all > return 0 unconditionally anyhow. > > Signed-off-by: Uwe Kleine-König Acked-by: Wolfram Sang # for I2C signature.asc Description: PGP signature
[PATCH v2 1/5] dt-bindings: net: renesas,etheravb: Add r8a779a0 support
Document the compatible value for the RAVB block in the Renesas R-Car V3U (R8A779A0) SoC. This variant has no stream buffer, so we only need to add the new compatible and add it to the TX delay block. Reviewed-by: Geert Uytterhoeven Acked-by: Rob Herring Signed-off-by: Wolfram Sang --- Please apply via netdev tree. Change since v1: * add entry to TX delay block * added tags Documentation/devicetree/bindings/net/renesas,etheravb.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/net/renesas,etheravb.yaml b/Documentation/devicetree/bindings/net/renesas,etheravb.yaml index 244befb6402a..c4c441c493ff 100644 --- a/Documentation/devicetree/bindings/net/renesas,etheravb.yaml +++ b/Documentation/devicetree/bindings/net/renesas,etheravb.yaml @@ -40,6 +40,7 @@ properties: - renesas,etheravb-r8a77980 # R-Car V3H - renesas,etheravb-r8a77990 # R-Car E3 - renesas,etheravb-r8a77995 # R-Car D3 + - renesas,etheravb-r8a779a0 # R-Car V3U - const: renesas,etheravb-rcar-gen3 # R-Car Gen3 and RZ/G2 reg: true @@ -169,6 +170,7 @@ allOf: - renesas,etheravb-r8a77965 - renesas,etheravb-r8a77970 - renesas,etheravb-r8a77980 + - renesas,etheravb-r8a779a0 then: required: - tx-internal-delay-ps -- 2.29.2
Re: [PATCH net v2 2/2] sh_eth: Make PHY access aware of Runtime PM to fix reboot crash
On Mon, Jan 18, 2021 at 04:06:56PM +0100, Geert Uytterhoeven wrote: > Wolfram reports that his R-Car H2-based Lager board can no longer be > rebooted in v5.11-rc1, as it crashes with an imprecise external abort. > The issue can be reproduced on other boards (e.g. Koelsch with R-Car > M2-W) too, if CONFIG_IP_PNP is disabled, and the Ethernet interface is > down at reboot time: > > Unhandled fault: imprecise external abort (0x1406) at 0x > pgd = (ptrval) > [] *pgd=422b6835, *pte=, *ppte= > Internal error: : 1406 [#1] ARM > Modules linked in: > CPU: 0 PID: 1105 Comm: init Tainted: GW > 5.10.0-rc1-00402-ge2f016cf7751 #1048 > Hardware name: Generic R-Car Gen2 (Flattened Device Tree) > PC is at sh_mdio_ctrl+0x44/0x60 > LR is at sh_mmd_ctrl+0x20/0x24 > ... > Backtrace: > [] (sh_mdio_ctrl) from [] (sh_mmd_ctrl+0x20/0x24) > r7:001f r6:0020 r5:0002 r4:c22a1dc4 > [] (sh_mmd_ctrl) from [] (mdiobb_cmd+0x38/0xa8) > [] (mdiobb_cmd) from [] (mdiobb_read+0x58/0xdc) > r9:c229f844 r8:c0c329dc r7:c221e000 r6:0001 r5:c22a1dc4 r4:0001 > [] (mdiobb_read) from [] (__mdiobus_read+0x74/0xe0) > r7:001f r6:0001 r5:c221e000 r4:c221e000 > [] (__mdiobus_read) from [] (mdiobus_read+0x40/0x54) > r7:001f r6:0001 r5:c221e000 r4:c221e458 > [] (mdiobus_read) from [] (phy_read+0x1c/0x20) > r7:e000 r6:c221e470 r5:0200 r4:c229f800 > [] (phy_read) from [] (kszphy_config_intr+0x44/0x80) > [] (kszphy_config_intr) from [] > (phy_disable_interrupts+0x44/0x50) > r5:c229f800 r4:c229f800 > [] (phy_disable_interrupts) from [] > (phy_shutdown+0x18/0x1c) > r5:c229f800 r4:c229f804 > [] (phy_shutdown) from [] > (device_shutdown+0x168/0x1f8) > [] (device_shutdown) from [] > (kernel_restart_prepare+0x3c/0x48) > r9:c22d2000 r8:c0100264 r7:c0b0d034 r6: r5:4321fedc r4: > [] (kernel_restart_prepare) from [] > (kernel_restart+0x1c/0x60) > [] (kernel_restart) from [] > (__do_sys_reboot+0x168/0x208) > r5:4321fedc r4:01234567 > [] (__do_sys_reboot) from [] (sys_reboot+0x18/0x1c) > r7:0058 r6: r5: r4: > [] (sys_reboot) from [] (ret_fast_syscall+0x0/0x54) > > As of commit e2f016cf775129c0 ("net: phy: add a shutdown procedure"), > system reboot calls phy_disable_interrupts() during shutdown. As this > happens unconditionally, the PHY registers may be accessed while the > device is suspended, causing undefined behavior, which may crash the > system. > > Fix this by wrapping the PHY bitbang accessors in the sh_eth driver by > wrappers that take care of Runtime PM, to resume the device when needed. > > Reported-by: Wolfram Sang > Suggested-by: Andrew Lunn > Signed-off-by: Geert Uytterhoeven Tested-by: Wolfram Sang Thanks for debugging and fixing this, Geert! signature.asc Description: PGP signature
Re: [PATCH net v2 1/2] mdio-bitbang: Export mdiobb_{read,write}()
On Mon, Jan 18, 2021 at 04:06:55PM +0100, Geert Uytterhoeven wrote: > Export mdiobb_read() and mdiobb_write(), so Ethernet controller drivers > can call them from their MDIO read/write wrappers. > > Signed-off-by: Geert Uytterhoeven Tested-by: Wolfram Sang signature.asc Description: PGP signature
Re: question about i2c_transfer() function (regarding mdio-i2c on RollBall SFPs)
> I thought as much, but maybe there is some driver which can offload > whole i2c_transfer to HW, and has to pass the addresses of the buffers > to the HW, and the HW can have problems if the buffers overlap > somewhere... Well, sure, you can never know what crazy HW is out there :) But that shouldn't prevent us from doing legit I2C transfers. The likeliness of such HW is low enough; They must process the whole transfer in one go (rare) AND have the limitiation with the buffer pointers (at least I don't know one) AND have no possibility of a fallback to a simpler mode where they can handle the transfer per message. If such a controller exists, it would need a new quirk flag, I'd say, and reject the transfer. But that shouldn't stop you from fixing your issue. Thanks for thinking thoroughly about drawbacks! Much appreciated. signature.asc Description: PGP signature
Re: question about i2c_transfer() function (regarding mdio-i2c on RollBall SFPs)
> My question is whether this is allowed, whether the msgs array passed > to the i2c_transfer() function can have multiple msgs pointing to the > same buffer (the one into which the original page is first stored > with first i2c_msg and then restored from it in the last i2c_msg). Sending the messages is serialized, so the buffers won't interfere. At first glance, I think it would work this way. But it's late evening here, so I will have another look again tomorrow. signature.asc Description: PGP signature
[PATCH 0/5] v3u: add support for RAVB
Here is the series to enable RAVB on V3U. I took the DTS patches from the BSP, the rest was developed on mainline tree. Note that only RAVB0 could be tested because the other ones did not have PHYs attached. Also, the last patch is a workaround. 'reset-gpios' cannot be obtained currently which makes the driver fail. The problem is that pinctrl_ready_for_gpio_range() returns EPROBE-DEFER. I hope Geert has an idea because I got lost in the GPIO and V3U pinctrl details there. It seems more of a PFC/CPG/GPIO problem to me. Without the reset-gpio, the driver binds to avb0 and I can ping the host successfully. So, I think at least the first three patches are ready. Let me know your thoughts! All the best, Wolfram Tho Vu (2): arm64: dts: renesas: r8a779a0: Add Ethernet-AVB support arm64: dts: renesas: falcon: Add Ethernet-AVB support Wolfram Sang (3): dt-bindings: net: renesas,etheravb: Add r8a779a0 support clk: renesas: r8a779a0: add clocks for RAVB arm64: dts: r8a779a0: WIP disable reset-gpios for AVB .../bindings/net/renesas,etheravb.yaml| 1 + .../boot/dts/renesas/r8a779a0-falcon.dts | 195 + arch/arm64/boot/dts/renesas/r8a779a0.dtsi | 270 ++ drivers/clk/renesas/r8a779a0-cpg-mssr.c | 6 + 4 files changed, 472 insertions(+) -- 2.29.2
[PATCH 1/5] dt-bindings: net: renesas,etheravb: Add r8a779a0 support
Document the compatible value for the RAVB block in the Renesas R-Car V3U (R8A779A0) SoC. This variant has no stream buffer, so we only need to add the new compatible. Signed-off-by: Wolfram Sang --- Documentation/devicetree/bindings/net/renesas,etheravb.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/net/renesas,etheravb.yaml b/Documentation/devicetree/bindings/net/renesas,etheravb.yaml index 244befb6402a..6e57e4f157f0 100644 --- a/Documentation/devicetree/bindings/net/renesas,etheravb.yaml +++ b/Documentation/devicetree/bindings/net/renesas,etheravb.yaml @@ -40,6 +40,7 @@ properties: - renesas,etheravb-r8a77980 # R-Car V3H - renesas,etheravb-r8a77990 # R-Car E3 - renesas,etheravb-r8a77995 # R-Car D3 + - renesas,etheravb-r8a779a0 # R-Car V3U - const: renesas,etheravb-rcar-gen3 # R-Car Gen3 and RZ/G2 reg: true -- 2.29.2
Re: [PATCH] dma-mapping: move hint unlikely for dma_mapping_error from drivers to core
On Thu, Dec 10, 2020 at 03:47:50PM +0100, Heiner Kallweit wrote: > Zillions of drivers use the unlikely() hint when checking the result of > dma_mapping_error(). This is an inline function anyway, so we can move > the hint into the function and remove it from drivers. > From time to time discussions pop up how effective unlikely() is, > and that it should be used only if something is really very unlikely. > I think that's the case here. > > Patch was created with some help from coccinelle. > > @@ > expression dev, dma_addr; > @@ > > - unlikely(dma_mapping_error(dev, dma_addr)) > + dma_mapping_error(dev, dma_addr) > > Signed-off-by: Heiner Kallweit Acked-by: Wolfram Sang # for I2C signature.asc Description: PGP signature
Re: [trivial PATCH] treewide: Convert switch/case fallthrough; to break;
> diff --git a/drivers/i2c/busses/i2c-i801.c b/drivers/i2c/busses/i2c-i801.c > index e32ef3f01fe8..b13b1cbcac29 100644 > --- a/drivers/i2c/busses/i2c-i801.c > +++ b/drivers/i2c/busses/i2c-i801.c > @@ -1785,7 +1785,7 @@ static int i801_probe(struct pci_dev *dev, const struct > pci_device_id *id) > fallthrough; > case PCI_DEVICE_ID_INTEL_82801CA_3: > priv->features |= FEATURE_HOST_NOTIFY; > - fallthrough; > + break; > case PCI_DEVICE_ID_INTEL_82801BA_2: > case PCI_DEVICE_ID_INTEL_82801AB_3: > case PCI_DEVICE_ID_INTEL_82801AA_3: I am not the maintainer (Jean is) but I suggest to drop this hunk. The code is more complex with multiple 'fallthrough', so this change alone actually makes the code inconsistent. A rework would need a seperate patch. signature.asc Description: PGP signature
Re: [PATCH] dt-bindings: Whitespace clean-ups in schema files
On Wed, Aug 12, 2020 at 02:36:18PM -0600, Rob Herring wrote: > Clean-up incorrect indentation, extra spaces, long lines, and missing > EOF newline in schema files. Most of the clean-ups are for list > indentation which should always be 2 spaces more than the preceding > keyword. > > Found with yamllint (which I plan to integrate into the checks). > > Cc: linux-arm-ker...@lists.infradead.org > Cc: linux-...@vger.kernel.org > Cc: dri-de...@lists.freedesktop.org > Cc: linux-...@vger.kernel.org > Cc: linux-g...@vger.kernel.org > Cc: linux-remotep...@vger.kernel.org > Cc: linux-hw...@vger.kernel.org > Cc: linux-...@vger.kernel.org > Cc: linux-fb...@vger.kernel.org > Cc: linux-...@vger.kernel.org > Cc: linux-in...@vger.kernel.org > Cc: linux...@vger.kernel.org > Cc: linux-me...@vger.kernel.org > Cc: alsa-de...@alsa-project.org > Cc: linux-...@vger.kernel.org > Cc: linux-...@lists.infradead.org > Cc: netdev@vger.kernel.org > Cc: linux-...@vger.kernel.org > Cc: linux-ser...@vger.kernel.org > Cc: linux-...@vger.kernel.org > Signed-off-by: Rob Herring I trust you guys in figuring out the details, so for touching I2C: Acked-by: Wolfram Sang signature.asc Description: PGP signature
Re: [PATCH] can: mscan: mpc5xxx_can: update contact email
On Sat, May 02, 2020 at 04:26:56PM +0200, Wolfram Sang wrote: > The 'pengutronix' address is defunct for years. Use the proper contact > address. > > Signed-off-by: Wolfram Sang Ping? > --- > drivers/net/can/mscan/mpc5xxx_can.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/can/mscan/mpc5xxx_can.c > b/drivers/net/can/mscan/mpc5xxx_can.c > index e4f4b5c9ebd6..e254e04ae257 100644 > --- a/drivers/net/can/mscan/mpc5xxx_can.c > +++ b/drivers/net/can/mscan/mpc5xxx_can.c > @@ -5,7 +5,7 @@ > * Copyright (C) 2004-2005 Andrey Volkov , > * Varma Electronics Oy > * Copyright (C) 2008-2009 Wolfgang Grandegger > - * Copyright (C) 2009 Wolfram Sang, Pengutronix > + * Copyright (C) 2009 Wolfram Sang, Pengutronix > */ > > #include > -- > 2.20.1 > signature.asc Description: PGP signature
Re: [RFC PATCH] iwlwifi: yoyo: don't print failure if debug firmware is missing
On Sun, Jul 26, 2020 at 09:11:25PM +0300, Kalle Valo wrote: > Wolfram Sang writes: > > > On Thu, Jun 25, 2020 at 06:52:10PM +0200, Wolfram Sang wrote: > >> Missing this firmware is not fatal, my wifi card still works. Even more, > >> I couldn't find any documentation what it is or where to get it. So, I > >> don't think the users should be notified if it is missing. If you browse > >> the net, you see the message is present is in quite some logs. Better > >> remove it. > >> > >> Signed-off-by: Wolfram Sang > >> --- > > > > Any input on this? Or people I should add to CC? > > This was discussed on another thread: > > https://lkml.kernel.org/r/87mu3magfp@tynnyri.adurom.net > > Unless Intel folks object I'm planning to take this to > wireless-drivers-next. Cool, thanks for the heads up! signature.asc Description: PGP signature
Re: [RFC PATCH] iwlwifi: yoyo: don't print failure if debug firmware is missing
On Thu, Jun 25, 2020 at 06:52:10PM +0200, Wolfram Sang wrote: > Missing this firmware is not fatal, my wifi card still works. Even more, > I couldn't find any documentation what it is or where to get it. So, I > don't think the users should be notified if it is missing. If you browse > the net, you see the message is present is in quite some logs. Better > remove it. > > Signed-off-by: Wolfram Sang > --- Any input on this? Or people I should add to CC? > > This is only build tested because I wanted to get your opinions first. I > couldn't find any explanation about yoyo, so I am entering unknown > territory here. > > drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c > b/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c > index 7987a288917b..f180db2936e3 100644 > --- a/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c > +++ b/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c > @@ -468,7 +468,7 @@ void iwl_dbg_tlv_load_bin(struct device *dev, struct > iwl_trans *trans) > if (!iwlwifi_mod_params.enable_ini) > return; > > - res = request_firmware(&fw, "iwl-debug-yoyo.bin", dev); > + res = firmware_request_nowarn(&fw, "iwl-debug-yoyo.bin", dev); > if (res) > return; > > -- > 2.20.1 > signature.asc Description: PGP signature
Re: [PATCH 11/20] dt-bindings: i2c: renesas,i2c: Document r8a774e1 support
On Wed, Jul 15, 2020 at 12:09:01PM +0100, Lad Prabhakar wrote: > Document i2c controller for RZ/G2H (R8A774E1) SoC, which is compatible > with R-Car Gen3 SoC family. > > Signed-off-by: Lad Prabhakar > Reviewed-by: Marian-Cristian Rotariu > Applied to for-next, thanks! signature.asc Description: PGP signature
Re: [PATCH 12/20] dt-bindings: i2c: renesas,iic: Document r8a774e1 support
On Wed, Jul 15, 2020 at 12:09:02PM +0100, Lad Prabhakar wrote: > Document IIC controller for RZ/G2H (R8A774E1) SoC, which is compatible > with R-Car Gen3 SoC family. > > Signed-off-by: Lad Prabhakar > Reviewed-by: Marian-Cristian Rotariu > Applied to for-next, thanks! signature.asc Description: PGP signature
Re: [PATCH] Remove handhelds.org links and email addresses
Hi Alexander, thanks for trying to fix this, yet I have some doubts. On Mon, Jun 29, 2020 at 10:31:21PM +0200, Alexander A. Klimov wrote: > Rationale: > https://lore.kernel.org/linux-doc/20200626110706.7b5d4...@lwn.net/ I think we need some text here. Clicking on a link to understand what a patch is about is not comfortable. You can add the link with a Link: tag for additional information. Removing stale email addresses may have some value, but removing... > Compaq's Bootldr + John Dorsey's patch for Assabet support > -(http://www.handhelds.org/Compaq/bootldr.html) ... information like this is not good. 'Wayback machine' still has copies in case someone wants to look at where the infos came from. > - * Copyright 2004-2005 Phil Blundell > + * Copyright 2004-2005 Phil Blundell This is an OK case in my book... > -MODULE_AUTHOR("Phil Blundell "); > +MODULE_AUTHOR("Phil Blundell"); ... same here ... > @@ -435,7 +435,6 @@ > case a PCI bridge (DEC chip 21152). The value of > 'pb' is now only initialized if a de4x5 chip is > present. > - This is kind of a signature and should be kept IMO. > * 2001/07/23: > - * - Hand merge version from handhelds.org CVS tree. See patch > + * - Hand merge version from CVS tree. See patch That information may be useful. > /* SPDX-License-Identifier: GPL-2.0-only */ > /* -*- linux-c -*- > - * > - * (C) 2003 ze...@handhelds.org Removing copyright is a bad idea. Probably some comment blocks are cruft meanwhile and can be removed as a whole. That can be discussed. But removing only the handhelds.org part makes most parts worse IMHO. Thanks and happy hacking, Wolfram signature.asc Description: PGP signature
[RFC PATCH] iwlwifi: yoyo: don't print failure if debug firmware is missing
Missing this firmware is not fatal, my wifi card still works. Even more, I couldn't find any documentation what it is or where to get it. So, I don't think the users should be notified if it is missing. If you browse the net, you see the message is present is in quite some logs. Better remove it. Signed-off-by: Wolfram Sang --- This is only build tested because I wanted to get your opinions first. I couldn't find any explanation about yoyo, so I am entering unknown territory here. drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c b/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c index 7987a288917b..f180db2936e3 100644 --- a/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c +++ b/drivers/net/wireless/intel/iwlwifi/iwl-dbg-tlv.c @@ -468,7 +468,7 @@ void iwl_dbg_tlv_load_bin(struct device *dev, struct iwl_trans *trans) if (!iwlwifi_mod_params.enable_ini) return; - res = request_firmware(&fw, "iwl-debug-yoyo.bin", dev); + res = firmware_request_nowarn(&fw, "iwl-debug-yoyo.bin", dev); if (res) return; -- 2.20.1
Re: [PATCH 03/17] ARM: dts: r8a7742: Add I2C and IIC support
> > According to the Hardware User's Manual Rev. 1.00, the registers do exist > > on all RZ/G1, except for RZ/G1E (see below). > > > >"(automatic transmission can be used as a hardware function, but this is > > not meaningful for actual use cases)." > > > > (whatever that comment may mean?) Strange comment, in deed. Given the paragraph before, I would guess Gen1 maybe had a "fitting" PMIC where SoC/PMIC handled DVFS kind of magically with this automatic transfer feature? And Gen2 has not. > > On R-Car E3 and RZ/G2E, which have a single IIC instance, we > > handled that by: > > > > The r8a77990 (R-Car E3) and r8a774c0 (RZ/G2E) > > controllers are not considered compatible with > > "renesas,rcar-gen3-iic" or "renesas,rmobile-iic" > > due to the absence of automatic transmission registers. From a "describe the HW" point of view, this still makes sense to me. Although, it is unlikely we will add support for the automatic transmission feature (maybe famous last words). > > On R-Car E2 and RZ/G1E, we forgot, and used both SoC-specific and > > family-specific compatible values. Okay, but we can fix DTs when they have bugs, or? signature.asc Description: PGP signature
Re: [PATCH 03/17] ARM: dts: r8a7742: Add I2C and IIC support
Hi Prabhakar, > > Leaves us with a seperate compatible entry for it? > > > Sounds okay to me, how about "renesas,iic-no-dvfs" ? So that this > could be used on all the SoC's which don't support DVFS. Well, the feature missing is used for DVFS, but its name is "automatic transmission". So, I'd rather suggest "-no-auto" as suffix. Also, there are already quite some IIC variants out there, so plain "iic" won't catch them all. My suggestion would be "renesas,rcar-gen2-iic-no-auto". All the best, Wolfram signature.asc Description: PGP signature
Re: [PATCH 17/17] ARM: dts: r8a7742: Add RWDT node
> Its similar to as seen on Rcar-H2 where just the A15 cores are up and > A7 cores fail to boot. Attached is the boot log where reboot works as > expected with all A15 core up. Although I have tested the internal > release based on 3.10 where all the cores are up which used bootarg > apmu=multicluster (https://patchwork.kernel.org/patch/3948791/). So > there is some work involved to get all the A7's up and running. Sounds good enough to me. Thanks for the heads up! signature.asc Description: PGP signature
Re: [PATCH 03/17] ARM: dts: r8a7742: Add I2C and IIC support
> > However, both versions (with and without automatic transmission) are > > described with the same "renesas,iic-r8a7742" compatible. Is it possible > > to detect the reduced variant at runtime somehow? > > > I couldn't find anything the manual that would be useful to detect at runtime. > > > My concern is that the peculiarity of this SoC might be forgotten if we > > describe it like this and ever add "automatic transmissions" somewhen. > > > Agreed. Well, I guess reading from a register which is supposed to not be there on the modified IP core is too hackish. Leaves us with a seperate compatible entry for it? signature.asc Description: PGP signature
Re: [PATCH 17/17] ARM: dts: r8a7742: Add RWDT node
On Fri, May 15, 2020 at 04:08:57PM +0100, Lad Prabhakar wrote: > Add a device node for the Watchdog Timer (RWDT) controller on the Renesas > RZ/G1H (r8a7742) SoC. > > Signed-off-by: Lad Prabhakar > Reviewed-by: Marian-Cristian Rotariu > The DTS change looks fine, I checked it against similar SoCs (like the previous patched). So, for that: Reviewed-by: Wolfram Sang However, just to make sure, have you checked the WDT (especially reboot) with SMP and multiple CPU cores enabled? Some early Gen2 SoCs had issues there. signature.asc Description: PGP signature
Re: [PATCH 16/17] dt-bindings: watchdog: renesas,wdt: Document r8a7742 support
On Fri, May 15, 2020 at 04:08:56PM +0100, Lad Prabhakar wrote: > RZ/G1H (R8A7742) watchdog implementation is compatible with R-Car Gen2, > therefore add relevant documentation. > > Signed-off-by: Lad Prabhakar > Reviewed-by: Marian-Cristian Rotariu > Reviewed-by: Wolfram Sang signature.asc Description: PGP signature
Re: [PATCH 15/17] ARM: dts: r8a7742: Add APMU nodes
On Fri, May 15, 2020 at 04:08:55PM +0100, Lad Prabhakar wrote: > Add DT nodes for the Advanced Power Management Units (APMU), and use the > enable-method to point out that the APMU should be used for SMP support. > > Signed-off-by: Lad Prabhakar > Reviewed-by: Marian-Cristian Rotariu > Reviewed-by: Wolfram Sang signature.asc Description: PGP signature
Re: [PATCH 14/17] dt-bindings: power: renesas,apmu: Document r8a7742 support
On Fri, May 15, 2020 at 04:08:54PM +0100, Lad Prabhakar wrote: > Document APMU and SMP enable method for RZ/G1H (also known as r8a7742) > SoC. > > Signed-off-by: Lad Prabhakar > Reviewed-by: Marian-Cristian Rotariu > Reviewed-by: Wolfram Sang signature.asc Description: PGP signature
Re: [PATCH 13/17] ARM: dts: r8a7742: Add Ether support
On Fri, May 15, 2020 at 04:08:53PM +0100, Lad Prabhakar wrote: > Define the generic R8A7742 part of the Ether device node. > > Signed-off-by: Lad Prabhakar > Reviewed-by: Marian-Cristian Rotariu > Reviewed-by: Wolfram Sang signature.asc Description: PGP signature
Re: [PATCH 12/17] ARM: dts: r8a7742: Add Ethernet AVB support
On Fri, May 15, 2020 at 04:08:52PM +0100, Lad Prabhakar wrote: > Add Ethernet AVB support for R8A7742 SoC. > > Signed-off-by: Lad Prabhakar > Reviewed-by: Marian-Cristian Rotariu > Reviewed-by: Wolfram Sang signature.asc Description: PGP signature
Re: [PATCH 10/17] dt-bindings: net: renesas,ravb: Add support for r8a7742 SoC
On Fri, May 15, 2020 at 04:08:50PM +0100, Lad Prabhakar wrote: > Document RZ/G1H (R8A7742) SoC bindings. > > Signed-off-by: Lad Prabhakar > Reviewed-by: Marian-Cristian Rotariu > Reviewed-by: Wolfram Sang signature.asc Description: PGP signature
Re: [PATCH 11/17] dt-bindings: net: renesas,ether: Document R8A7742 SoC
On Fri, May 15, 2020 at 04:08:51PM +0100, Lad Prabhakar wrote: > Document RZ/G1H (R8A7742) SoC bindings. > > Signed-off-by: Lad Prabhakar > Reviewed-by: Marian-Cristian Rotariu > Reviewed-by: Wolfram Sang signature.asc Description: PGP signature
Re: [PATCH 09/17] ARM: dts: r8a7742: Add sata nodes
On Fri, May 15, 2020 at 04:08:49PM +0100, Lad Prabhakar wrote: > Add the sata devices nodes to the R8A7742 device tree. > > Signed-off-by: Lad Prabhakar > Reviewed-by: Marian-Cristian Rotariu > Reviewed-by: Wolfram Sang signature.asc Description: PGP signature
Re: [PATCH 08/17] dt-bindings: ata: renesas,rcar-sata: Add r8a7742 support
On Fri, May 15, 2020 at 04:08:48PM +0100, Lad Prabhakar wrote: > Document SATA support for the RZ/G1H, which is compatible with > R-Car Gen2 SoC family. > > Signed-off-by: Lad Prabhakar > Reviewed-by: Marian-Cristian Rotariu > Reviewed-by: Wolfram Sang signature.asc Description: PGP signature
Re: [PATCH 07/17] ARM: dts: r8a7742: Add MMC0 node
On Fri, May 15, 2020 at 04:08:47PM +0100, Lad Prabhakar wrote: > Describe MMC0 device node in the R8A7742 device tree. > > Signed-off-by: Lad Prabhakar > Reviewed-by: Marian-Cristian Rotariu > Reviewed-by: Wolfram Sang signature.asc Description: PGP signature
Re: [PATCH 06/17] ARM: dts: r8a7742: Add SDHI nodes
On Fri, May 15, 2020 at 04:08:46PM +0100, Lad Prabhakar wrote: > Add the SDHI devices nodes to the R8A7742 device tree. > > Signed-off-by: Lad Prabhakar > Reviewed-by: Marian-Cristian Rotariu > Reviewed-by: Wolfram Sang signature.asc Description: PGP signature
Re: [PATCH 02/17] dt-bindings: i2c: renesas,iic: Document r8a7742 support
On Fri, May 15, 2020 at 04:08:42PM +0100, Lad Prabhakar wrote: > Document IIC controller for RZ/G1H (R8A7742) SoC, which is compatible > with R-Car Gen2 SoC family. > > Signed-off-by: Lad Prabhakar > Reviewed-by: Marian-Cristian Rotariu > Reviewed-by: Wolfram Sang signature.asc Description: PGP signature
Re: [PATCH 01/17] dt-bindings: i2c: renesas,i2c: Document r8a7742 support
On Fri, May 15, 2020 at 04:08:41PM +0100, Lad Prabhakar wrote: > Document i2c controller for RZ/G1H (R8A7742) SoC, which is compatible > with R-Car Gen2 SoC family. > > Signed-off-by: Lad Prabhakar > Reviewed-by: Marian-Cristian Rotariu > Dunno if patches need to be this fine-grained (e.g. group all simple additions like this in one patch) but still: Reviewed-by: Wolfram Sang signature.asc Description: PGP signature
Re: [PATCH 05/17] mmc: renesas_sdhi_sys_dmac: Add support for r8a7742 SoC
On Fri, May 15, 2020 at 04:08:45PM +0100, Lad Prabhakar wrote: > Add support for r8a7742 SoC. Renesas RZ/G1H (R8A7742) SDHI is identical to > the R-Car Gen2 family. > > Signed-off-by: Lad Prabhakar > Reviewed-by: Marian-Cristian Rotariu > I think we can skip this because of the generic fallback? The other entries come from a time when we had a different policy IIRC. > --- > drivers/mmc/host/renesas_sdhi_sys_dmac.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/mmc/host/renesas_sdhi_sys_dmac.c > b/drivers/mmc/host/renesas_sdhi_sys_dmac.c > index 13ff023..dbfcbc2 100644 > --- a/drivers/mmc/host/renesas_sdhi_sys_dmac.c > +++ b/drivers/mmc/host/renesas_sdhi_sys_dmac.c > @@ -75,6 +75,7 @@ static const struct of_device_id > renesas_sdhi_sys_dmac_of_match[] = { > { .compatible = "renesas,sdhi-r7s72100", .data = &of_rz_compatible, }, > { .compatible = "renesas,sdhi-r8a7778", .data = > &of_rcar_gen1_compatible, }, > { .compatible = "renesas,sdhi-r8a7779", .data = > &of_rcar_gen1_compatible, }, > + { .compatible = "renesas,sdhi-r8a7742", .data = > &of_rcar_gen2_compatible, }, > { .compatible = "renesas,sdhi-r8a7743", .data = > &of_rcar_gen2_compatible, }, > { .compatible = "renesas,sdhi-r8a7745", .data = > &of_rcar_gen2_compatible, }, > { .compatible = "renesas,sdhi-r8a7790", .data = > &of_rcar_gen2_compatible, }, > -- > 2.7.4 > signature.asc Description: PGP signature
Re: [PATCH 04/17] dt-bindings: mmc: renesas,sdhi: Document r8a7742 support
On Fri, May 15, 2020 at 04:08:44PM +0100, Lad Prabhakar wrote: > Document SDHI controller for RZ/G1H (R8A7742) SoC, which is compatible > with R-Car Gen2 SoC family. > > Signed-off-by: Lad Prabhakar > Reviewed-by: Marian-Cristian Rotariu > Reviewed-by: Wolfram Sang signature.asc Description: PGP signature
Re: [PATCH 03/17] ARM: dts: r8a7742: Add I2C and IIC support
On Fri, May 15, 2020 at 04:08:43PM +0100, Lad Prabhakar wrote: > Add the I2C[0-3] and IIC[0-3] devices nodes to the R8A7742 device tree. > > Automatic transmission for PMIC control is not available on IIC3 hence > compatible string "renesas,rcar-gen2-iic" and "renesas,rmobile-iic" is > not added to iic3 node. Makes sense. However, both versions (with and without automatic transmission) are described with the same "renesas,iic-r8a7742" compatible. Is it possible to detect the reduced variant at runtime somehow? My concern is that the peculiarity of this SoC might be forgotten if we describe it like this and ever add "automatic transmissions" somewhen. signature.asc Description: PGP signature
[PATCH] can: mscan: mpc5xxx_can: update contact email
The 'pengutronix' address is defunct for years. Use the proper contact address. Signed-off-by: Wolfram Sang --- drivers/net/can/mscan/mpc5xxx_can.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/can/mscan/mpc5xxx_can.c b/drivers/net/can/mscan/mpc5xxx_can.c index e4f4b5c9ebd6..e254e04ae257 100644 --- a/drivers/net/can/mscan/mpc5xxx_can.c +++ b/drivers/net/can/mscan/mpc5xxx_can.c @@ -5,7 +5,7 @@ * Copyright (C) 2004-2005 Andrey Volkov , * Varma Electronics Oy * Copyright (C) 2008-2009 Wolfgang Grandegger - * Copyright (C) 2009 Wolfram Sang, Pengutronix + * Copyright (C) 2009 Wolfram Sang, Pengutronix */ #include -- 2.20.1
[PATCH 8/9] net: flow_dissector: fix typo 'can by' to 'can be'
Signed-off-by: Wolfram Sang --- include/net/flow_dissector.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/net/flow_dissector.h b/include/net/flow_dissector.h index 9a074776f70b66..d1fcf2442a423b 100644 --- a/include/net/flow_dissector.h +++ b/include/net/flow_dissector.h @@ -251,7 +251,7 @@ extern struct flow_dissector flow_keys_buf_dissector; * This structure is used to hold a digest of the full flow keys. This is a * larger "hash" of a flow to allow definitively matching specific flows where * the 32 bit skb->hash is not large enough. The size is limited to 16 bytes so - * that it can by used in CB of skb (see sch_choke for an example). + * that it can be used in CB of skb (see sch_choke for an example). */ #define FLOW_KEYS_DIGEST_LEN 16 struct flow_keys_digest { -- 2.11.0
[PATCH 0/9] tree-wide: fix typo 'can by' to 'can be'
I found this kind of typo when reading the documentation for device_remove(). So, I checked the tree for it. CCing all the subsystems directly, and I'd think the leftover ones could be picked up by the trivial tree. Or would it be more convenient if trivial would pick up all? I don't mind. Based on v4.17-rc3. Wolfram Sang (9): dt-bindings: i2c: fix typo 'can by' to 'can be' powerpc/watchdog: fix typo 'can by' to 'can be' base: core: fix typo 'can by' to 'can be' hwmon: fschmd: fix typo 'can by' to 'can be' input: ati_remote2: fix typo 'can by' to 'can be' NTB: ntb_hw_idt: fix typo 'can by' to 'can be' reiserfs: journal: fix typo 'can by' to 'can be' net: flow_dissector: fix typo 'can by' to 'can be' objtool: fix typo 'can by' to 'can be' Documentation/devicetree/bindings/i2c/i2c-davinci.txt | 2 +- arch/powerpc/kernel/watchdog.c| 2 +- drivers/base/core.c | 2 +- drivers/hwmon/fschmd.c| 2 +- drivers/input/misc/ati_remote2.c | 2 +- drivers/ntb/hw/idt/ntb_hw_idt.c | 2 +- fs/reiserfs/journal.c | 2 +- include/net/flow_dissector.h | 2 +- tools/objtool/Documentation/stack-validation.txt | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) -- 2.11.0
[PATCH 00/61] tree-wide: simplify getting .drvdata
I got tired of fixing this in Renesas drivers manually, so I took the big hammer. Remove this cumbersome code pattern which got copy-pasted too much already: - struct platform_device *pdev = to_platform_device(dev); - struct ep93xx_keypad *keypad = platform_get_drvdata(pdev); + struct ep93xx_keypad *keypad = dev_get_drvdata(dev); I send this out as one patch per directory per subsystem. I think they should be applied individually. If you prefer a broken out series per subsystem, I can provide this as well. Just mail me. A branch (tested by buildbot; only with all commits squashed into one commit before) can be found here: git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git coccinelle/get_drvdata Open for other comments, suggestions, too, of course. Here is the cocci-script I created (after iterations by manually checking samples): @@ struct device* d; identifier pdev; expression *ptr; @@ ( - struct platform_device *pdev = to_platform_device(d); | - struct platform_device *pdev; ... - pdev = to_platform_device(d); ) <... when != pdev - &pdev->dev + d ...> ptr = - platform_get_drvdata(pdev) + dev_get_drvdata(d) <... when != pdev - &pdev->dev + d ...> Kind regards, Wolfram Wolfram Sang (61): ARM: plat-samsung: simplify getting .drvdata ata: simplify getting .drvdata auxdisplay: simplify getting .drvdata bus: simplify getting .drvdata clk: samsung: simplify getting .drvdata crypto: simplify getting .drvdata dma: simplify getting .drvdata dmaengine: dw: simplify getting .drvdata dmaengine: qcom: simplify getting .drvdata gpio: simplify getting .drvdata gpu: drm: msm: simplify getting .drvdata gpu: drm: msm: adreno: simplify getting .drvdata gpu: drm: msm: disp: mdp5: simplify getting .drvdata gpu: drm: msm: dsi: simplify getting .drvdata gpu: drm: omapdrm: displays: simplify getting .drvdata gpu: drm: vc4: simplify getting .drvdata hid: simplify getting .drvdata iio: common: cros_ec_sensors: simplify getting .drvdata iio: common: hid-sensors: simplify getting .drvdata input: keyboard: simplify getting .drvdata input: misc: simplify getting .drvdata input: mouse: simplify getting .drvdata input: touchscreen: simplify getting .drvdata iommu: simplify getting .drvdata media: platform: am437x: simplify getting .drvdata media: platform: exynos4-is: simplify getting .drvdata media: platform: s5p-mfc: simplify getting .drvdata mmc: host: simplify getting .drvdata mtd: devices: simplify getting .drvdata mtd: nand: onenand: simplify getting .drvdata net: dsa: simplify getting .drvdata net: ethernet: cadence: simplify getting .drvdata net: ethernet: davicom: simplify getting .drvdata net: ethernet: smsc: simplify getting .drvdata net: ethernet: ti: simplify getting .drvdata net: ethernet: wiznet: simplify getting .drvdata perf: simplify getting .drvdata pinctrl: simplify getting .drvdata pinctrl: intel: simplify getting .drvdata platform: x86: simplify getting .drvdata power: supply: simplify getting .drvdata ptp: simplify getting .drvdata pwm: simplify getting .drvdata rtc: simplify getting .drvdata slimbus: simplify getting .drvdata spi: simplify getting .drvdata staging: greybus: simplify getting .drvdata staging: iio: adc: simplify getting .drvdata staging: nvec: simplify getting .drvdata thermal: simplify getting .drvdata thermal: int340x_thermal: simplify getting .drvdata thermal: st: simplify getting .drvdata tty: serial: simplify getting .drvdata uio: simplify getting .drvdata usb: mtu3: simplify getting .drvdata usb: phy: simplify getting .drvdata video: fbdev: simplify getting .drvdata video: fbdev: omap2: omapfb: displays: simplify getting .drvdata watchdog: simplify getting .drvdata net: dsa: simplify getting .drvdata ASoC: atmel: simplify getting .drvdata arch/arm/plat-samsung/adc.c| 3 +- drivers/ata/pata_samsung_cf.c | 8 ++--- drivers/auxdisplay/arm-charlcd.c | 6 ++-- drivers/bus/brcmstb_gisb.c | 12 +++ drivers/clk/samsung/clk-s3c2410-dclk.c | 6 ++-- drivers/crypto/exynos-rng.c| 6 ++-- drivers/crypto/picoxcell_crypto.c | 6 ++-- drivers/dma/at_hdmac.c | 9 ++--- drivers/dma/at_xdmac.c | 9 ++--- drivers/dma/dw/platform.c | 6 ++-- drivers/dma/fsldma.c | 6 ++-- drivers/dma/idma64.c | 6 ++-- drivers/dma/qcom/hidma.c | 3 +- drivers/dma/qcom/hidma_mgmt_sys.c | 6 ++-- drivers/dma/ste_dma40.c| 12 +++ drivers/dma/txx9dmac.c
[PATCH 31/61] net: dsa: simplify getting .drvdata
We should get drvdata from struct device directly. Going via platform_device is an unneeded step back and forth. Signed-off-by: Wolfram Sang --- Build tested only. buildbot is happy. Please apply individually. drivers/net/dsa/bcm_sf2.c | 6 ++ drivers/net/dsa/qca8k.c | 6 ++ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers/net/dsa/bcm_sf2.c index 0378eded31f2..a61b937d1a37 100644 --- a/drivers/net/dsa/bcm_sf2.c +++ b/drivers/net/dsa/bcm_sf2.c @@ -1148,16 +1148,14 @@ static void bcm_sf2_sw_shutdown(struct platform_device *pdev) #ifdef CONFIG_PM_SLEEP static int bcm_sf2_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct bcm_sf2_priv *priv = platform_get_drvdata(pdev); + struct bcm_sf2_priv *priv = dev_get_drvdata(dev); return dsa_switch_suspend(priv->dev->ds); } static int bcm_sf2_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct bcm_sf2_priv *priv = platform_get_drvdata(pdev); + struct bcm_sf2_priv *priv = dev_get_drvdata(dev); return dsa_switch_resume(priv->dev->ds); } diff --git a/drivers/net/dsa/qca8k.c b/drivers/net/dsa/qca8k.c index 600d5ad1fbde..9f503e5db88a 100644 --- a/drivers/net/dsa/qca8k.c +++ b/drivers/net/dsa/qca8k.c @@ -910,8 +910,7 @@ qca8k_set_pm(struct qca8k_priv *priv, int enable) static int qca8k_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct qca8k_priv *priv = platform_get_drvdata(pdev); + struct qca8k_priv *priv = dev_get_drvdata(dev); qca8k_set_pm(priv, 0); @@ -920,8 +919,7 @@ static int qca8k_suspend(struct device *dev) static int qca8k_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct qca8k_priv *priv = platform_get_drvdata(pdev); + struct qca8k_priv *priv = dev_get_drvdata(dev); qca8k_set_pm(priv, 1); -- 2.11.0
[PATCH 33/61] net: ethernet: davicom: simplify getting .drvdata
We should get drvdata from struct device directly. Going via platform_device is an unneeded step back and forth. Signed-off-by: Wolfram Sang --- Build tested only. buildbot is happy. Please apply individually. drivers/net/ethernet/davicom/dm9000.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/davicom/dm9000.c b/drivers/net/ethernet/davicom/dm9000.c index 50222b7b81f3..0a82fcf16d35 100644 --- a/drivers/net/ethernet/davicom/dm9000.c +++ b/drivers/net/ethernet/davicom/dm9000.c @@ -1722,8 +1722,7 @@ dm9000_probe(struct platform_device *pdev) static int dm9000_drv_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct net_device *ndev = platform_get_drvdata(pdev); + struct net_device *ndev = dev_get_drvdata(dev); struct board_info *db; if (ndev) { @@ -1745,8 +1744,7 @@ dm9000_drv_suspend(struct device *dev) static int dm9000_drv_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct net_device *ndev = platform_get_drvdata(pdev); + struct net_device *ndev = dev_get_drvdata(dev); struct board_info *db = netdev_priv(ndev); if (ndev) { -- 2.11.0
[PATCH 32/61] net: ethernet: cadence: simplify getting .drvdata
We should get drvdata from struct device directly. Going via platform_device is an unneeded step back and forth. Signed-off-by: Wolfram Sang --- Build tested only. buildbot is happy. Please apply individually. drivers/net/ethernet/cadence/macb_main.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c index b4c9268100bb..136bfd5d0be9 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -4056,8 +4056,7 @@ static int macb_remove(struct platform_device *pdev) static int __maybe_unused macb_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct net_device *netdev = platform_get_drvdata(pdev); + struct net_device *netdev = dev_get_drvdata(dev); struct macb *bp = netdev_priv(netdev); netif_carrier_off(netdev); @@ -4079,8 +4078,7 @@ static int __maybe_unused macb_suspend(struct device *dev) static int __maybe_unused macb_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct net_device *netdev = platform_get_drvdata(pdev); + struct net_device *netdev = dev_get_drvdata(dev); struct macb *bp = netdev_priv(netdev); if (bp->wol & MACB_WOL_ENABLED) { -- 2.11.0
[PATCH 34/61] net: ethernet: smsc: simplify getting .drvdata
We should get drvdata from struct device directly. Going via platform_device is an unneeded step back and forth. Signed-off-by: Wolfram Sang --- Build tested only. buildbot is happy. Please apply individually. drivers/net/ethernet/smsc/smc91x.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/net/ethernet/smsc/smc91x.c b/drivers/net/ethernet/smsc/smc91x.c index 080428762858..3e84a499fe92 100644 --- a/drivers/net/ethernet/smsc/smc91x.c +++ b/drivers/net/ethernet/smsc/smc91x.c @@ -2453,8 +2453,7 @@ static int smc_drv_remove(struct platform_device *pdev) static int smc_drv_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct net_device *ndev = platform_get_drvdata(pdev); + struct net_device *ndev = dev_get_drvdata(dev); if (ndev) { if (netif_running(ndev)) { -- 2.11.0
[PATCH 35/61] net: ethernet: ti: simplify getting .drvdata
We should get drvdata from struct device directly. Going via platform_device is an unneeded step back and forth. Signed-off-by: Wolfram Sang --- Build tested only. buildbot is happy. Please apply individually. drivers/net/ethernet/ti/cpsw.c | 6 ++ drivers/net/ethernet/ti/davinci_emac.c | 6 ++ 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c index 30371274409d..ef0c88e71a71 100644 --- a/drivers/net/ethernet/ti/cpsw.c +++ b/drivers/net/ethernet/ti/cpsw.c @@ -3300,8 +3300,7 @@ static int cpsw_remove(struct platform_device *pdev) #ifdef CONFIG_PM_SLEEP static int cpsw_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct net_device *ndev = platform_get_drvdata(pdev); + struct net_device *ndev = dev_get_drvdata(dev); struct cpsw_common *cpsw = ndev_to_cpsw(ndev); if (cpsw->data.dual_emac) { @@ -3324,8 +3323,7 @@ static int cpsw_suspend(struct device *dev) static int cpsw_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct net_device *ndev = platform_get_drvdata(pdev); + struct net_device *ndev = dev_get_drvdata(dev); struct cpsw_common *cpsw = ndev_to_cpsw(ndev); /* Select default pin state */ diff --git a/drivers/net/ethernet/ti/davinci_emac.c b/drivers/net/ethernet/ti/davinci_emac.c index abceea802ea1..ef223613114d 100644 --- a/drivers/net/ethernet/ti/davinci_emac.c +++ b/drivers/net/ethernet/ti/davinci_emac.c @@ -1985,8 +1985,7 @@ static int davinci_emac_remove(struct platform_device *pdev) static int davinci_emac_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct net_device *ndev = platform_get_drvdata(pdev); + struct net_device *ndev = dev_get_drvdata(dev); if (netif_running(ndev)) emac_dev_stop(ndev); @@ -1996,8 +1995,7 @@ static int davinci_emac_suspend(struct device *dev) static int davinci_emac_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct net_device *ndev = platform_get_drvdata(pdev); + struct net_device *ndev = dev_get_drvdata(dev); if (netif_running(ndev)) emac_dev_open(ndev); -- 2.11.0
[PATCH 36/61] net: ethernet: wiznet: simplify getting .drvdata
We should get drvdata from struct device directly. Going via platform_device is an unneeded step back and forth. Signed-off-by: Wolfram Sang --- Build tested only. buildbot is happy. Please apply individually. drivers/net/ethernet/wiznet/w5300.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/ethernet/wiznet/w5300.c b/drivers/net/ethernet/wiznet/w5300.c index 56ae573001e8..692fc71d904d 100644 --- a/drivers/net/ethernet/wiznet/w5300.c +++ b/drivers/net/ethernet/wiznet/w5300.c @@ -661,8 +661,7 @@ static int w5300_remove(struct platform_device *pdev) #ifdef CONFIG_PM_SLEEP static int w5300_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct net_device *ndev = platform_get_drvdata(pdev); + struct net_device *ndev = dev_get_drvdata(dev); struct w5300_priv *priv = netdev_priv(ndev); if (netif_running(ndev)) { @@ -676,8 +675,7 @@ static int w5300_suspend(struct device *dev) static int w5300_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct net_device *ndev = platform_get_drvdata(pdev); + struct net_device *ndev = dev_get_drvdata(dev); struct w5300_priv *priv = netdev_priv(ndev); if (!netif_running(ndev)) { -- 2.11.0
[PATCH 42/61] ptp: simplify getting .drvdata
We should get drvdata from struct device directly. Going via platform_device is an unneeded step back and forth. Signed-off-by: Wolfram Sang --- Build tested only. buildbot is happy. Please apply individually. drivers/ptp/ptp_dte.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/ptp/ptp_dte.c b/drivers/ptp/ptp_dte.c index 6edd3b9c7f01..5481a27d4fec 100644 --- a/drivers/ptp/ptp_dte.c +++ b/drivers/ptp/ptp_dte.c @@ -287,8 +287,7 @@ static int ptp_dte_remove(struct platform_device *pdev) #ifdef CONFIG_PM_SLEEP static int ptp_dte_suspend(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct ptp_dte *ptp_dte = platform_get_drvdata(pdev); + struct ptp_dte *ptp_dte = dev_get_drvdata(dev); u8 i; for (i = 0; i < DTE_NUM_REGS_TO_RESTORE; i++) { @@ -304,8 +303,7 @@ static int ptp_dte_suspend(struct device *dev) static int ptp_dte_resume(struct device *dev) { - struct platform_device *pdev = to_platform_device(dev); - struct ptp_dte *ptp_dte = platform_get_drvdata(pdev); + struct ptp_dte *ptp_dte = dev_get_drvdata(dev); u8 i; for (i = 0; i < DTE_NUM_REGS_TO_RESTORE; i++) { -- 2.11.0
[PATCH 60/61] net: dsa: simplify getting .drvdata
We should get drvdata from struct device directly. Going via platform_device is an unneeded step back and forth. Signed-off-by: Wolfram Sang --- Build tested only. buildbot is happy. Please apply individually. net/dsa/legacy.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/net/dsa/legacy.c b/net/dsa/legacy.c index 42a7b85b84e1..f8d6b212328f 100644 --- a/net/dsa/legacy.c +++ b/net/dsa/legacy.c @@ -687,8 +687,7 @@ static void dsa_shutdown(struct platform_device *pdev) #ifdef CONFIG_PM_SLEEP static int dsa_suspend(struct device *d) { - struct platform_device *pdev = to_platform_device(d); - struct dsa_switch_tree *dst = platform_get_drvdata(pdev); + struct dsa_switch_tree *dst = dev_get_drvdata(d); int i, ret = 0; for (i = 0; i < dst->pd->nr_chips; i++) { @@ -703,8 +702,7 @@ static int dsa_suspend(struct device *d) static int dsa_resume(struct device *d) { - struct platform_device *pdev = to_platform_device(d); - struct dsa_switch_tree *dst = platform_get_drvdata(pdev); + struct dsa_switch_tree *dst = dev_get_drvdata(d); int i, ret = 0; for (i = 0; i < dst->pd->nr_chips; i++) { -- 2.11.0
Re: [PATCH/RFC net-next 4/5] ravb: remove undocumented processing
On Tue, Apr 17, 2018 at 10:50:29AM +0200, Simon Horman wrote: > From: Kazuya Mizuguchi > > Signed-off-by: Kazuya Mizuguchi > Signed-off-by: Simon Horman > --- > drivers/net/ethernet/renesas/ravb.h | 5 - > drivers/net/ethernet/renesas/ravb_main.c | 15 --- > 2 files changed, 20 deletions(-) > > diff --git a/drivers/net/ethernet/renesas/ravb.h > b/drivers/net/ethernet/renesas/ravb.h > index 57eea4a77826..fcd04dbc7dde 100644 > --- a/drivers/net/ethernet/renesas/ravb.h > +++ b/drivers/net/ethernet/renesas/ravb.h > @@ -197,15 +197,11 @@ enum ravb_reg { > MAHR= 0x05c0, > MALR= 0x05c8, > TROCR = 0x0700, /* Undocumented? */ Why not this, too? Maybe some background info from HW team for the commit message would be nice to have... signature.asc Description: PGP signature
Re: [PATCH/RFC net-next 1/5] ravb: fix inconsistent lock state at enabling tx timestamp
On Tue, Apr 17, 2018 at 10:50:26AM +0200, Simon Horman wrote: > From: Masaru Nagai > > [ 58.490829] = > [ 58.495205] [ INFO: inconsistent lock state ] > [ 58.499583] 4.9.0-yocto-standard-7-g2ef7caf #57 Not tainted > [ 58.505529] - > [ 58.509904] inconsistent {HARDIRQ-ON-W} -> {IN-HARDIRQ-W} usage. > [ 58.515939] swapper/0/0 [HC1[1]:SC1[1]:HE0:SE0] takes: > [ 58.521099] (&(&list->lock)->rlock#2){?.-...}, at: [] > skb_queue_tail+0x2c/0x68 > {HARDIRQ-ON-W} state was registered at: Maybe add a short text to the log to describe the approach of this fix? signature.asc Description: PGP signature
Re: [PATCH/RFC net-next 2/5] ravb: correct ptp does failure after suspend and resume
> @@ -2302,6 +2305,7 @@ static int __maybe_unused ravb_resume(struct device > *dev) > { > struct net_device *ndev = dev_get_drvdata(dev); > struct ravb_private *priv = netdev_priv(ndev); > + struct platform_device *pdev = priv->pdev; Minor nit: I'd save this line... > + if (priv->chip_id != RCAR_GEN2) > + ravb_ptp_init(ndev, pdev); ... and use ravb_ptp_init(ndev, priv->pdev); here. But well, maybe just bike-shedding... signature.asc Description: PGP signature
Re: [PATCH 0/4] tree-wide: fix comparison to bitshift when dealing with a mask
> I did that too but got no results. Perhaps right shifting constants is > pretty uncommon. I can put that in the complete rule though. Please do. Even if rare, we would want this bug pointed out, right? :) signature.asc Description: PGP signature
Re: [PATCH 0/4] tree-wide: fix comparison to bitshift when dealing with a mask
Hi Julia, > and got the results below. I can make a version for the kernel shortly. It should probably take care of right-shifting, too? Thanks, Wolfram signature.asc Description: PGP signature
[PATCH] can: m_can: change comparison to bitshift when dealing with a mask
Due to a typo, the mask was destroyed by a comparison instead of a bit shift. Reported-by: Geert Uytterhoeven Signed-off-by: Wolfram Sang --- Only build tested. drivers/net/can/m_can/m_can.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c index 2594f7779c6f14..74170b0d23cf1c 100644 --- a/drivers/net/can/m_can/m_can.c +++ b/drivers/net/can/m_can/m_can.c @@ -253,7 +253,7 @@ enum m_can_mram_cfg { /* Rx FIFO 0/1 Configuration (RXF0C/RXF1C) */ #define RXFC_FWM_SHIFT 24 -#define RXFC_FWM_MASK (0x7f < RXFC_FWM_SHIFT) +#define RXFC_FWM_MASK (0x7f << RXFC_FWM_SHIFT) #define RXFC_FS_SHIFT 16 #define RXFC_FS_MASK (0x7f << RXFC_FS_SHIFT) -- 2.11.0
Re: [PATCH 0/4] tree-wide: fix comparison to bitshift when dealing with a mask
> I found two more using "git grep 'define.*0x[0-9a-f]* < '": I added '[0-9]\+' at the end of the regex to reduce the number of false positives... > drivers/net/can/m_can/m_can.c:#define RXFC_FWM_MASK (0x7f < > RXFC_FWM_SHIFT) > drivers/usb/gadget/udc/goku_udc.h:#define INT_EPnNAK(n) > (0x00100 < (n)) /* 0 < n < 4 */ ... but you found those two true positives in there. Nice, thanks! signature.asc Description: PGP signature
[PATCH 4/4] net: amd-xgbe: fix comparison to bitshift when dealing with a mask
Due to a typo, the mask was destroyed by a comparison instead of a bit shift. Signed-off-by: Wolfram Sang --- Only build tested. To be applied individually per subsystem. drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c index 7a3ebfd236f5eb..100adee778dfd6 100644 --- a/drivers/net/ethernet/amd/xgbe/xgbe-drv.c +++ b/drivers/net/ethernet/amd/xgbe/xgbe-drv.c @@ -595,7 +595,7 @@ static void xgbe_isr_task(unsigned long data) reissue_mask = 1 << 0; if (!pdata->per_channel_irq) - reissue_mask |= 0x < 4; + reissue_mask |= 0x << 4; XP_IOWRITE(pdata, XP_INT_REISSUE_EN, reissue_mask); } -- 2.11.0
[PATCH 0/4] tree-wide: fix comparison to bitshift when dealing with a mask
In one Renesas driver, I found a typo which turned an intended bit shift ('<<') into a comparison ('<'). Because this is a subtle issue, I looked tree wide for similar patterns. This small patch series is the outcome. Buildbot and checkpatch are happy. Only compile-tested. To be applied individually per sub-system, I think. I'd think only the net: amd: patch needs to be conisdered for stable, but I leave this to people who actually know this driver. CCing Dan. Maybe he has an idea how to add a test to smatch? In my setup, only cppcheck reported a 'coding style' issue with a low prio. Wolfram Sang (4): v4l: vsp1: fix mask creation for MULT_ALPHA_RATIO drm/exynos: fix comparison to bitshift when dealing with a mask v4l: dvb-frontends: stb0899: fix comparison to bitshift when dealing with a mask net: amd-xgbe: fix comparison to bitshift when dealing with a mask drivers/gpu/drm/exynos/regs-fimc.h| 2 +- drivers/media/dvb-frontends/stb0899_reg.h | 8 drivers/media/platform/vsp1/vsp1_regs.h | 2 +- drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) -- 2.11.0
Re: [v16, 0/7] Fix eSDHC host version register bug
Can you please update your CC list? There is nothing i2c related in this patch series, so you could drop the i2c-list. signature.asc Description: PGP signature
Re: [PATCH] MAINTAINERS: Remove myself from PA Semi entries
> > I was hoping to have Michael merge this since the bulk of the platform is > > under him, > > cc:ing you mostly to be aware that I am orphaning a driver in your > > subsystems. > > Let me answer for Jean since I took over I2C in November 2012 ;) I'd > think the entry can go completely. The last 'F:' tag for the platform > catches the I2C driver anyhow. But in general: To make it crystal clear: I meant the I2C entry for PASEMI could go. signature.asc Description: PGP signature
Re: [PATCH] MAINTAINERS: Remove myself from PA Semi entries
On Tue, Sep 13, 2016 at 02:48:38PM -0700, Olof Johansson wrote: > The platform is old, very few users and I lack bandwidth to keep after > it these days. > > Mark the base platform as well as the drivers as orphans, patches have > been flowing through the fallback maintainers for a while already. > > Signed-off-by: Olof Johansson > --- > > Jean, Dave, > > I was hoping to have Michael merge this since the bulk of the platform is > under him, > cc:ing you mostly to be aware that I am orphaning a driver in your subsystems. Let me answer for Jean since I took over I2C in November 2012 ;) I'd think the entry can go completely. The last 'F:' tag for the platform catches the I2C driver anyhow. But in general: Acked-by: Wolfram Sang Thanks, Wolfram > > > Thanks, > > -Olof > > MAINTAINERS | 9 +++-- > 1 file changed, 3 insertions(+), 6 deletions(-) > > diff --git a/MAINTAINERS b/MAINTAINERS > index d8e81b1..411f4f7 100644 > --- a/MAINTAINERS > +++ b/MAINTAINERS > @@ -7155,9 +7155,8 @@ F: arch/powerpc/platforms/83xx/ > F: arch/powerpc/platforms/85xx/ > > LINUX FOR POWERPC PA SEMI PWRFICIENT > -M: Olof Johansson > L: linuxppc-...@lists.ozlabs.org > -S: Maintained > +S: Orphan > F: arch/powerpc/platforms/pasemi/ > F: drivers/*/*pasemi* > F: drivers/*/*/*pasemi* > @@ -8849,15 +8848,13 @@ S:Maintained > F: drivers/net/wireless/intersil/p54/ > > PA SEMI ETHERNET DRIVER > -M: Olof Johansson > L: netdev@vger.kernel.org > -S: Maintained > +S: Orphan > F: drivers/net/ethernet/pasemi/* > > PA SEMI SMBUS DRIVER > -M: Olof Johansson > L: linux-...@vger.kernel.org > -S: Maintained > +S: Orphan > F: drivers/i2c/busses/i2c-pasemi.c > > PADATA PARALLEL EXECUTION MECHANISM > -- > 2.8.0.rc3.29.gb552ff8 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-i2c" in > the body of a message to majord...@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html signature.asc Description: PGP signature
[PATCH 16/16] net: wireless: realtek: rtlwifi: usb: don't print error when allocating urb fails
kmalloc will print enough information in case of failure. Signed-off-by: Wolfram Sang --- drivers/net/wireless/realtek/rtlwifi/usb.c | 8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/net/wireless/realtek/rtlwifi/usb.c b/drivers/net/wireless/realtek/rtlwifi/usb.c index 41617b7b082260..32aa5c1d070a07 100644 --- a/drivers/net/wireless/realtek/rtlwifi/usb.c +++ b/drivers/net/wireless/realtek/rtlwifi/usb.c @@ -739,11 +739,8 @@ static int _rtl_usb_receive(struct ieee80211_hw *hw) for (i = 0; i < rtlusb->rx_urb_num; i++) { err = -ENOMEM; urb = usb_alloc_urb(0, GFP_KERNEL); - if (!urb) { - RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG, -"Failed to alloc URB!!\n"); + if (!urb) goto err_out; - } err = _rtl_prep_rx_urb(hw, rtlusb, urb, GFP_KERNEL); if (err < 0) { @@ -907,15 +904,12 @@ static void _rtl_tx_complete(struct urb *urb) static struct urb *_rtl_usb_tx_urb_setup(struct ieee80211_hw *hw, struct sk_buff *skb, u32 ep_num) { - struct rtl_priv *rtlpriv = rtl_priv(hw); struct rtl_usb *rtlusb = rtl_usbdev(rtl_usbpriv(hw)); struct urb *_urb; WARN_ON(NULL == skb); _urb = usb_alloc_urb(0, GFP_ATOMIC); if (!_urb) { - RT_TRACE(rtlpriv, COMP_USB, DBG_EMERG, -"Can't allocate URB for bulk out!\n"); kfree_skb(skb); return NULL; } -- 2.8.1
[PATCH 15/16] net: wireless: marvell: mwifiex: usb: don't print error when allocating urb fails
kmalloc will print enough information in case of failure. Signed-off-by: Wolfram Sang --- drivers/net/wireless/marvell/mwifiex/usb.c | 19 --- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/drivers/net/wireless/marvell/mwifiex/usb.c b/drivers/net/wireless/marvell/mwifiex/usb.c index 0857575c5c39fe..3bd04f52f36988 100644 --- a/drivers/net/wireless/marvell/mwifiex/usb.c +++ b/drivers/net/wireless/marvell/mwifiex/usb.c @@ -657,11 +657,8 @@ static int mwifiex_usb_tx_init(struct mwifiex_adapter *adapter) card->tx_cmd.ep = card->tx_cmd_ep; card->tx_cmd.urb = usb_alloc_urb(0, GFP_KERNEL); - if (!card->tx_cmd.urb) { - mwifiex_dbg(adapter, ERROR, - "tx_cmd.urb allocation failed\n"); + if (!card->tx_cmd.urb) return -ENOMEM; - } for (i = 0; i < MWIFIEX_TX_DATA_PORT; i++) { port = &card->port[i]; @@ -677,11 +674,8 @@ static int mwifiex_usb_tx_init(struct mwifiex_adapter *adapter) port->tx_data_list[j].ep = port->tx_data_ep; port->tx_data_list[j].urb = usb_alloc_urb(0, GFP_KERNEL); - if (!port->tx_data_list[j].urb) { - mwifiex_dbg(adapter, ERROR, - "urb allocation failed\n"); + if (!port->tx_data_list[j].urb) return -ENOMEM; - } } } @@ -697,10 +691,8 @@ static int mwifiex_usb_rx_init(struct mwifiex_adapter *adapter) card->rx_cmd.ep = card->rx_cmd_ep; card->rx_cmd.urb = usb_alloc_urb(0, GFP_KERNEL); - if (!card->rx_cmd.urb) { - mwifiex_dbg(adapter, ERROR, "rx_cmd.urb allocation failed\n"); + if (!card->rx_cmd.urb) return -ENOMEM; - } card->rx_cmd.skb = dev_alloc_skb(MWIFIEX_RX_CMD_BUF_SIZE); if (!card->rx_cmd.skb) @@ -714,11 +706,8 @@ static int mwifiex_usb_rx_init(struct mwifiex_adapter *adapter) card->rx_data_list[i].ep = card->rx_data_ep; card->rx_data_list[i].urb = usb_alloc_urb(0, GFP_KERNEL); - if (!card->rx_data_list[i].urb) { - mwifiex_dbg(adapter, ERROR, - "rx_data_list[] urb allocation failed\n"); + if (!card->rx_data_list[i].urb) return -1; - } if (mwifiex_usb_submit_rx_urb(&card->rx_data_list[i], MWIFIEX_RX_DATA_BUF_SIZE)) return -1; -- 2.8.1
[PATCH 14/16] net: wireless: marvell: libertas_tf: if_usb: don't print error when allocating urb fails
kmalloc will print enough information in case of failure. Signed-off-by: Wolfram Sang --- drivers/net/wireless/marvell/libertas_tf/if_usb.c | 12 +++- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/net/wireless/marvell/libertas_tf/if_usb.c b/drivers/net/wireless/marvell/libertas_tf/if_usb.c index 799a2efe579372..e0ade40d9497d7 100644 --- a/drivers/net/wireless/marvell/libertas_tf/if_usb.c +++ b/drivers/net/wireless/marvell/libertas_tf/if_usb.c @@ -198,22 +198,16 @@ static int if_usb_probe(struct usb_interface *intf, } cardp->rx_urb = usb_alloc_urb(0, GFP_KERNEL); - if (!cardp->rx_urb) { - lbtf_deb_usbd(&udev->dev, "Rx URB allocation failed\n"); + if (!cardp->rx_urb) goto dealloc; - } cardp->tx_urb = usb_alloc_urb(0, GFP_KERNEL); - if (!cardp->tx_urb) { - lbtf_deb_usbd(&udev->dev, "Tx URB allocation failed\n"); + if (!cardp->tx_urb) goto dealloc; - } cardp->cmd_urb = usb_alloc_urb(0, GFP_KERNEL); - if (!cardp->cmd_urb) { - lbtf_deb_usbd(&udev->dev, "Cmd URB allocation failed\n"); + if (!cardp->cmd_urb) goto dealloc; - } cardp->ep_out_buf = kmalloc(MRVDRV_ETH_TX_PACKET_BUFFER_SIZE, GFP_KERNEL); -- 2.8.1
[PATCH 07/16] net: usb: hso: don't print error when allocating urb fails
kmalloc will print enough information in case of failure. Signed-off-by: Wolfram Sang --- drivers/net/usb/hso.c | 20 +--- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/drivers/net/usb/hso.c b/drivers/net/usb/hso.c index 4b4458616693f9..c5544d36c54f96 100644 --- a/drivers/net/usb/hso.c +++ b/drivers/net/usb/hso.c @@ -2300,10 +2300,8 @@ static int hso_serial_common_create(struct hso_serial *serial, int num_urbs, serial->rx_data_length = rx_size; for (i = 0; i < serial->num_rx_urbs; i++) { serial->rx_urb[i] = usb_alloc_urb(0, GFP_KERNEL); - if (!serial->rx_urb[i]) { - dev_err(dev, "Could not allocate urb?\n"); + if (!serial->rx_urb[i]) goto exit; - } serial->rx_urb[i]->transfer_buffer = NULL; serial->rx_urb[i]->transfer_buffer_length = 0; serial->rx_data[i] = kzalloc(serial->rx_data_length, @@ -2314,10 +2312,8 @@ static int hso_serial_common_create(struct hso_serial *serial, int num_urbs, /* TX, allocate urb and initialize */ serial->tx_urb = usb_alloc_urb(0, GFP_KERNEL); - if (!serial->tx_urb) { - dev_err(dev, "Could not allocate urb?\n"); + if (!serial->tx_urb) goto exit; - } serial->tx_urb->transfer_buffer = NULL; serial->tx_urb->transfer_buffer_length = 0; /* prepare our TX buffer */ @@ -2555,20 +2551,16 @@ static struct hso_device *hso_create_net_device(struct usb_interface *interface, /* start allocating */ for (i = 0; i < MUX_BULK_RX_BUF_COUNT; i++) { hso_net->mux_bulk_rx_urb_pool[i] = usb_alloc_urb(0, GFP_KERNEL); - if (!hso_net->mux_bulk_rx_urb_pool[i]) { - dev_err(&interface->dev, "Could not allocate rx urb\n"); + if (!hso_net->mux_bulk_rx_urb_pool[i]) goto exit; - } hso_net->mux_bulk_rx_buf_pool[i] = kzalloc(MUX_BULK_RX_BUF_SIZE, GFP_KERNEL); if (!hso_net->mux_bulk_rx_buf_pool[i]) goto exit; } hso_net->mux_bulk_tx_urb = usb_alloc_urb(0, GFP_KERNEL); - if (!hso_net->mux_bulk_tx_urb) { - dev_err(&interface->dev, "Could not allocate tx urb\n"); + if (!hso_net->mux_bulk_tx_urb) goto exit; - } hso_net->mux_bulk_tx_buf = kzalloc(MUX_BULK_TX_BUF_SIZE, GFP_KERNEL); if (!hso_net->mux_bulk_tx_buf) goto exit; @@ -2787,10 +2779,8 @@ struct hso_shared_int *hso_create_shared_int(struct usb_interface *interface) } mux->shared_intr_urb = usb_alloc_urb(0, GFP_KERNEL); - if (!mux->shared_intr_urb) { - dev_err(&interface->dev, "Could not allocate intr urb?\n"); + if (!mux->shared_intr_urb) goto exit; - } mux->shared_intr_buf = kzalloc(le16_to_cpu(mux->intr_endp->wMaxPacketSize), GFP_KERNEL); -- 2.8.1
[PATCH 13/16] net: wireless: intersil: orinoco: orinoco_usb: don't print error when allocating urb fails
kmalloc will print enough information in case of failure. Signed-off-by: Wolfram Sang --- drivers/net/wireless/intersil/orinoco/orinoco_usb.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/wireless/intersil/orinoco/orinoco_usb.c b/drivers/net/wireless/intersil/orinoco/orinoco_usb.c index 56f109bc83945d..bca6935a94db9a 100644 --- a/drivers/net/wireless/intersil/orinoco/orinoco_usb.c +++ b/drivers/net/wireless/intersil/orinoco/orinoco_usb.c @@ -1613,10 +1613,8 @@ static int ezusb_probe(struct usb_interface *interface, } upriv->read_urb = usb_alloc_urb(0, GFP_KERNEL); - if (!upriv->read_urb) { - err("No free urbs available"); + if (!upriv->read_urb) goto error; - } if (le16_to_cpu(ep->wMaxPacketSize) != 64) pr_warn("bulk in: wMaxPacketSize!= 64\n"); if (ep->bEndpointAddress != (2 | USB_DIR_IN)) -- 2.8.1
[PATCH 05/16] net: can: usb: peak_usb: pcan_usb_core: don't print error when allocating urb fails
kmalloc will print enough information in case of failure. Signed-off-by: Wolfram Sang --- drivers/net/can/usb/peak_usb/pcan_usb_core.c | 6 +- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_core.c b/drivers/net/can/usb/peak_usb/pcan_usb_core.c index bfb91d8fa46056..c06382cdfdfee4 100644 --- a/drivers/net/can/usb/peak_usb/pcan_usb_core.c +++ b/drivers/net/can/usb/peak_usb/pcan_usb_core.c @@ -399,7 +399,6 @@ static int peak_usb_start(struct peak_usb_device *dev) /* create a URB, and a buffer for it, to receive usb messages */ urb = usb_alloc_urb(0, GFP_KERNEL); if (!urb) { - netdev_err(netdev, "No memory left for URBs\n"); err = -ENOMEM; break; } @@ -454,7 +453,6 @@ static int peak_usb_start(struct peak_usb_device *dev) /* create a URB and a buffer for it, to transmit usb messages */ urb = usb_alloc_urb(0, GFP_KERNEL); if (!urb) { - netdev_err(netdev, "No memory left for URBs\n"); err = -ENOMEM; break; } @@ -651,10 +649,8 @@ static int peak_usb_restart(struct peak_usb_device *dev) /* first allocate a urb to handle the asynchronous steps */ urb = usb_alloc_urb(0, GFP_ATOMIC); - if (!urb) { - netdev_err(dev->netdev, "no memory left for urb\n"); + if (!urb) return -ENOMEM; - } /* also allocate enough space for the commands to send */ buf = kmalloc(PCAN_USB_MAX_CMD_LEN, GFP_ATOMIC); -- 2.8.1
[PATCH 06/16] net: can: usb: usb_8dev: don't print error when allocating urb fails
kmalloc will print enough information in case of failure. Signed-off-by: Wolfram Sang --- drivers/net/can/usb/usb_8dev.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/net/can/usb/usb_8dev.c b/drivers/net/can/usb/usb_8dev.c index a731720f1d1325..108a30e1509756 100644 --- a/drivers/net/can/usb/usb_8dev.c +++ b/drivers/net/can/usb/usb_8dev.c @@ -623,10 +623,8 @@ static netdev_tx_t usb_8dev_start_xmit(struct sk_buff *skb, /* create a URB, and a buffer for it, and copy the data to the URB */ urb = usb_alloc_urb(0, GFP_ATOMIC); - if (!urb) { - netdev_err(netdev, "No memory left for URBs\n"); + if (!urb) goto nomem; - } buf = usb_alloc_coherent(priv->udev, size, GFP_ATOMIC, &urb->transfer_dma); @@ -748,7 +746,6 @@ static int usb_8dev_start(struct usb_8dev_priv *priv) /* create a URB, and a buffer for it */ urb = usb_alloc_urb(0, GFP_KERNEL); if (!urb) { - netdev_err(netdev, "No memory left for URBs\n"); err = -ENOMEM; break; } -- 2.8.1
[PATCH 02/16] net: can: usb: esd_usb2: don't print error when allocating urb fails
kmalloc will print enough information in case of failure. Signed-off-by: Wolfram Sang --- drivers/net/can/usb/esd_usb2.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/net/can/usb/esd_usb2.c b/drivers/net/can/usb/esd_usb2.c index 784a9002fbb930..be928ce62d32e0 100644 --- a/drivers/net/can/usb/esd_usb2.c +++ b/drivers/net/can/usb/esd_usb2.c @@ -558,8 +558,6 @@ static int esd_usb2_setup_rx_urbs(struct esd_usb2 *dev) /* create a URB, and a buffer for it */ urb = usb_alloc_urb(0, GFP_KERNEL); if (!urb) { - dev_warn(dev->udev->dev.parent, -"No memory left for URBs\n"); err = -ENOMEM; break; } @@ -730,7 +728,6 @@ static netdev_tx_t esd_usb2_start_xmit(struct sk_buff *skb, /* create a URB, and a buffer for it, and copy the data to the URB */ urb = usb_alloc_urb(0, GFP_ATOMIC); if (!urb) { - netdev_err(netdev, "No memory left for URBs\n"); stats->tx_dropped++; dev_kfree_skb(skb); goto nourbmem; -- 2.8.1
[PATCH 09/16] net: usb: usbnet: don't print error when allocating urb fails
kmalloc will print enough information in case of failure. Signed-off-by: Wolfram Sang --- drivers/net/usb/usbnet.c | 5 + 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index 3bfb592093263b..d5071e364d40e1 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c @@ -2062,11 +2062,8 @@ int usbnet_write_cmd_async(struct usbnet *dev, u8 cmd, u8 reqtype, cmd, reqtype, value, index, size); urb = usb_alloc_urb(0, GFP_ATOMIC); - if (!urb) { - netdev_err(dev->net, "Error allocating URB in" - " %s!\n", __func__); + if (!urb) goto fail; - } if (data) { buf = kmemdup(data, size, GFP_ATOMIC); -- 2.8.1
[PATCH 12/16] net: wireless: broadcom: brcm80211: brcmfmac: usb: don't print error when allocating urb fails
kmalloc will print enough information in case of failure. Signed-off-by: Wolfram Sang --- drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c | 8 ++-- 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c index 98b15a9a2779f4..fa26619a7945d9 100644 --- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c +++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c @@ -1099,15 +1099,11 @@ struct brcmf_usbdev *brcmf_usb_attach(struct brcmf_usbdev_info *devinfo, devinfo->tx_freecount = ntxq; devinfo->ctl_urb = usb_alloc_urb(0, GFP_ATOMIC); - if (!devinfo->ctl_urb) { - brcmf_err("usb_alloc_urb (ctl) failed\n"); + if (!devinfo->ctl_urb) goto error; - } devinfo->bulk_urb = usb_alloc_urb(0, GFP_ATOMIC); - if (!devinfo->bulk_urb) { - brcmf_err("usb_alloc_urb (bulk) failed\n"); + if (!devinfo->bulk_urb) goto error; - } return &devinfo->bus_pub; -- 2.8.1
[PATCH 10/16] net: wimax: i2400m: usb-notif: don't print error when allocating urb fails
kmalloc will print enough information in case of failure. Signed-off-by: Wolfram Sang --- drivers/net/wimax/i2400m/usb-notif.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/net/wimax/i2400m/usb-notif.c b/drivers/net/wimax/i2400m/usb-notif.c index fc1355d98bc6ae..5d429f81612546 100644 --- a/drivers/net/wimax/i2400m/usb-notif.c +++ b/drivers/net/wimax/i2400m/usb-notif.c @@ -206,7 +206,6 @@ int i2400mu_notification_setup(struct i2400mu *i2400mu) i2400mu->notif_urb = usb_alloc_urb(0, GFP_KERNEL); if (!i2400mu->notif_urb) { ret = -ENOMEM; - dev_err(dev, "notification: cannot allocate URB\n"); goto error_alloc_urb; } epd = usb_get_epd(i2400mu->usb_iface, -- 2.8.1
[PATCH 11/16] net: wireless: ath: ar5523: ar5523: don't print error when allocating urb fails
kmalloc will print enough information in case of failure. Signed-off-by: Wolfram Sang --- drivers/net/wireless/ath/ar5523/ar5523.c | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/net/wireless/ath/ar5523/ar5523.c b/drivers/net/wireless/ath/ar5523/ar5523.c index 8aded24bcdf49e..7a60d2e652dad6 100644 --- a/drivers/net/wireless/ath/ar5523/ar5523.c +++ b/drivers/net/wireless/ath/ar5523/ar5523.c @@ -706,10 +706,8 @@ static int ar5523_alloc_rx_bufs(struct ar5523 *ar) data->ar = ar; data->urb = usb_alloc_urb(0, GFP_KERNEL); - if (!data->urb) { - ar5523_err(ar, "could not allocate rx data urb\n"); + if (!data->urb) goto err; - } list_add_tail(&data->list, &ar->rx_data_free); atomic_inc(&ar->rx_data_free_cnt); } @@ -824,7 +822,6 @@ static void ar5523_tx_work_locked(struct ar5523 *ar) urb = usb_alloc_urb(0, GFP_KERNEL); if (!urb) { - ar5523_err(ar, "Failed to allocate TX urb\n"); ieee80211_free_txskb(ar->hw, skb); continue; } @@ -949,10 +946,8 @@ static int ar5523_alloc_tx_cmd(struct ar5523 *ar) init_completion(&cmd->done); cmd->urb_tx = usb_alloc_urb(0, GFP_KERNEL); - if (!cmd->urb_tx) { - ar5523_err(ar, "could not allocate urb\n"); + if (!cmd->urb_tx) return -ENOMEM; - } cmd->buf_tx = usb_alloc_coherent(ar->dev, AR5523_MAX_TXCMDSZ, GFP_KERNEL, &cmd->urb_tx->transfer_dma); -- 2.8.1
[PATCH 03/16] net: can: usb: gs_usb: don't print error when allocating urb fails
kmalloc will print enough information in case of failure. Signed-off-by: Wolfram Sang --- drivers/net/can/usb/gs_usb.c | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/net/can/usb/gs_usb.c b/drivers/net/can/usb/gs_usb.c index 6f0cbc38782e68..77e3cc06a30c8c 100644 --- a/drivers/net/can/usb/gs_usb.c +++ b/drivers/net/can/usb/gs_usb.c @@ -493,10 +493,8 @@ static netdev_tx_t gs_can_start_xmit(struct sk_buff *skb, /* create a URB, and a buffer for it */ urb = usb_alloc_urb(0, GFP_ATOMIC); - if (!urb) { - netdev_err(netdev, "No memory left for URB\n"); + if (!urb) goto nomem_urb; - } hf = usb_alloc_coherent(dev->udev, sizeof(*hf), GFP_ATOMIC, &urb->transfer_dma); @@ -600,11 +598,8 @@ static int gs_can_open(struct net_device *netdev) /* alloc rx urb */ urb = usb_alloc_urb(0, GFP_KERNEL); - if (!urb) { - netdev_err(netdev, - "No memory left for URB\n"); + if (!urb) return -ENOMEM; - } /* alloc rx buffer */ buf = usb_alloc_coherent(dev->udev, -- 2.8.1
[PATCH 04/16] net: can: usb: kvaser_usb: don't print error when allocating urb fails
kmalloc will print enough information in case of failure. Signed-off-by: Wolfram Sang --- drivers/net/can/usb/kvaser_usb.c | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/net/can/usb/kvaser_usb.c b/drivers/net/can/usb/kvaser_usb.c index 6f1f3b675ff553..d51e0c401b483c 100644 --- a/drivers/net/can/usb/kvaser_usb.c +++ b/drivers/net/can/usb/kvaser_usb.c @@ -787,10 +787,8 @@ static int kvaser_usb_simple_msg_async(struct kvaser_usb_net_priv *priv, int err; urb = usb_alloc_urb(0, GFP_ATOMIC); - if (!urb) { - netdev_err(netdev, "No memory left for URBs\n"); + if (!urb) return -ENOMEM; - } buf = kmalloc(sizeof(struct kvaser_msg), GFP_ATOMIC); if (!buf) { @@ -1393,8 +1391,6 @@ static int kvaser_usb_setup_rx_urbs(struct kvaser_usb *dev) urb = usb_alloc_urb(0, GFP_KERNEL); if (!urb) { - dev_warn(dev->udev->dev.parent, -"No memory left for URBs\n"); err = -ENOMEM; break; } @@ -1670,7 +1666,6 @@ static netdev_tx_t kvaser_usb_start_xmit(struct sk_buff *skb, urb = usb_alloc_urb(0, GFP_ATOMIC); if (!urb) { - netdev_err(netdev, "No memory left for URBs\n"); stats->tx_dropped++; dev_kfree_skb(skb); return NETDEV_TX_OK; -- 2.8.1
[PATCH 08/16] net: usb: lan78xx: don't print error when allocating urb fails
kmalloc will print enough information in case of failure. Signed-off-by: Wolfram Sang --- drivers/net/usb/lan78xx.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c index 6a9d474b08b21c..432b8a3ae35491 100644 --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c @@ -3002,10 +3002,8 @@ static void lan78xx_tx_bh(struct lan78xx_net *dev) gso_skb: urb = usb_alloc_urb(0, GFP_ATOMIC); - if (!urb) { - netif_dbg(dev, tx_err, dev->net, "no urb\n"); + if (!urb) goto drop; - } entry = (struct skb_data *)skb->cb; entry->urb = urb; -- 2.8.1
[PATCH 01/16] net: can: usb: ems_usb: don't print error when allocating urb fails
kmalloc will print enough information in case of failure. Signed-off-by: Wolfram Sang --- drivers/net/can/usb/ems_usb.c | 9 ++--- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/net/can/usb/ems_usb.c b/drivers/net/can/usb/ems_usb.c index 71f0e791355b9c..b3d02759c226bb 100644 --- a/drivers/net/can/usb/ems_usb.c +++ b/drivers/net/can/usb/ems_usb.c @@ -600,7 +600,6 @@ static int ems_usb_start(struct ems_usb *dev) /* create a URB, and a buffer for it */ urb = usb_alloc_urb(0, GFP_KERNEL); if (!urb) { - netdev_err(netdev, "No memory left for URBs\n"); err = -ENOMEM; break; } @@ -752,10 +751,8 @@ static netdev_tx_t ems_usb_start_xmit(struct sk_buff *skb, struct net_device *ne /* create a URB, and a buffer for it, and copy the data to the URB */ urb = usb_alloc_urb(0, GFP_ATOMIC); - if (!urb) { - netdev_err(netdev, "No memory left for URBs\n"); + if (!urb) goto nomem; - } buf = usb_alloc_coherent(dev->udev, size, GFP_ATOMIC, &urb->transfer_dma); if (!buf) { @@ -1007,10 +1004,8 @@ static int ems_usb_probe(struct usb_interface *intf, dev->tx_contexts[i].echo_index = MAX_TX_URBS; dev->intr_urb = usb_alloc_urb(0, GFP_KERNEL); - if (!dev->intr_urb) { - dev_err(&intf->dev, "Couldn't alloc intr URB\n"); + if (!dev->intr_urb) goto cleanup_candev; - } dev->intr_in_buffer = kzalloc(INTR_IN_BUFFER_SIZE, GFP_KERNEL); if (!dev->intr_in_buffer) -- 2.8.1
[PATCH 00/16] net: don't print error when allocating urb fails
This per-subsystem series is part of a tree wide cleanup. usb_alloc_urb() uses kmalloc which already prints enough information on failure. So, let's simply remove those "allocation failed" messages from drivers like we did already for other -ENOMEM cases. gkh acked this approach when we talked about it at LCJ in Tokyo a few weeks ago. Wolfram Sang (16): net: can: usb: ems_usb: don't print error when allocating urb fails net: can: usb: esd_usb2: don't print error when allocating urb fails net: can: usb: gs_usb: don't print error when allocating urb fails net: can: usb: kvaser_usb: don't print error when allocating urb fails net: can: usb: peak_usb: pcan_usb_core: don't print error when allocating urb fails net: can: usb: usb_8dev: don't print error when allocating urb fails net: usb: hso: don't print error when allocating urb fails net: usb: lan78xx: don't print error when allocating urb fails net: usb: usbnet: don't print error when allocating urb fails net: wimax: i2400m: usb-notif: don't print error when allocating urb fails net: wireless: ath: ar5523: ar5523: don't print error when allocating urb fails net: wireless: broadcom: brcm80211: brcmfmac: usb: don't print error when allocating urb fails net: wireless: intersil: orinoco: orinoco_usb: don't print error when allocating urb fails net: wireless: marvell: libertas_tf: if_usb: don't print error when allocating urb fails net: wireless: marvell: mwifiex: usb: don't print error when allocating urb fails net: wireless: realtek: rtlwifi: usb: don't print error when allocating urb fails drivers/net/can/usb/ems_usb.c| 9 ++--- drivers/net/can/usb/esd_usb2.c | 3 --- drivers/net/can/usb/gs_usb.c | 9 ++--- drivers/net/can/usb/kvaser_usb.c | 7 +-- drivers/net/can/usb/peak_usb/pcan_usb_core.c | 6 +- drivers/net/can/usb/usb_8dev.c | 5 + drivers/net/usb/hso.c| 20 +--- drivers/net/usb/lan78xx.c| 4 +--- drivers/net/usb/usbnet.c | 5 + drivers/net/wimax/i2400m/usb-notif.c | 1 - drivers/net/wireless/ath/ar5523/ar5523.c | 9 ++--- .../net/wireless/broadcom/brcm80211/brcmfmac/usb.c | 8 ++-- drivers/net/wireless/intersil/orinoco/orinoco_usb.c | 4 +--- drivers/net/wireless/marvell/libertas_tf/if_usb.c| 12 +++- drivers/net/wireless/marvell/mwifiex/usb.c | 19 --- drivers/net/wireless/realtek/rtlwifi/usb.c | 8 +--- 16 files changed, 27 insertions(+), 102 deletions(-) -- 2.8.1
[PATCH RESEND] net: ethernet: renesas: ravb_main: test clock rate to avoid division by 0
From: Wolfram Sang The clk API may return 0 on clk_get_rate, so we should check the result before using it as a divisor. Signed-off-by: Wolfram Sang Acked-by: Sergei Shtylyov --- The original patch was marked as "NOT APPLICABLE" in patchwork. I reviewed again and can't see why. So, in case this remains true, please explain. drivers/net/ethernet/renesas/ravb_main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c index 4e1a7dba7c4abb..791930b63991dc 100644 --- a/drivers/net/ethernet/renesas/ravb_main.c +++ b/drivers/net/ethernet/renesas/ravb_main.c @@ -1691,6 +1691,9 @@ static int ravb_set_gti(struct net_device *ndev) rate = clk_get_rate(clk); clk_put(clk); + if (!rate) + return -EINVAL; + inc = 10ULL << 20; do_div(inc, rate); -- 2.7.0
Re: [PATCH 2/6] net: ethernet: renesas: ravb_main: test clock rate to avoid division by 0
On Wed, Mar 02, 2016 at 11:33:33PM +0100, Wolfram Sang wrote: > From: Wolfram Sang > > The clk API may return 0 on clk_get_rate, so we should check the result before > using it as a divisor. > > Signed-off-by: Wolfram Sang Ping. > --- > > Should go individually via subsystem tree. > > drivers/net/ethernet/renesas/ravb_main.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/net/ethernet/renesas/ravb_main.c > b/drivers/net/ethernet/renesas/ravb_main.c > index 88656ceb6e2946..ce1954a6a12726 100644 > --- a/drivers/net/ethernet/renesas/ravb_main.c > +++ b/drivers/net/ethernet/renesas/ravb_main.c > @@ -1691,6 +1691,9 @@ static int ravb_set_gti(struct net_device *ndev) > rate = clk_get_rate(clk); > clk_put(clk); > > + if (!rate) > + return -EINVAL; > + > inc = 10ULL << 20; > do_div(inc, rate); > > -- > 2.7.0 > > signature.asc Description: PGP signature
Re: [v6, 4/5] powerpc/fsl: move mpc85xx.h to include/linux/fsl
On Wed, Mar 09, 2016 at 06:08:50PM +0800, Yangbo Lu wrote: > Move mpc85xx.h to include/linux/fsl and rename it to svr.h as > a common header file. It has been used for mpc85xx and it will > be used for ARM-based SoC as well. > > Signed-off-by: Yangbo Lu From a glimpse, looks like proper refactoring. Thanks! For the I2C part: Acked-by: Wolfram Sang signature.asc Description: PGP signature
[PATCH 2/6] net: ethernet: renesas: ravb_main: test clock rate to avoid division by 0
From: Wolfram Sang The clk API may return 0 on clk_get_rate, so we should check the result before using it as a divisor. Signed-off-by: Wolfram Sang --- Should go individually via subsystem tree. drivers/net/ethernet/renesas/ravb_main.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c index 88656ceb6e2946..ce1954a6a12726 100644 --- a/drivers/net/ethernet/renesas/ravb_main.c +++ b/drivers/net/ethernet/renesas/ravb_main.c @@ -1691,6 +1691,9 @@ static int ravb_set_gti(struct net_device *ndev) rate = clk_get_rate(clk); clk_put(clk); + if (!rate) + return -EINVAL; + inc = 10ULL << 20; do_div(inc, rate); -- 2.7.0
[PATCH 0/6] treewide: test clock rate to avoid division by 0
Here is the outcome of researching if the result of clk_get_rate() was directly used as a divisor without checking if it is 0. Inspired by a Coverity report. Wolfram Sang (6): ide: palm_bk3710: test clock rate to avoid division by 0 net: ethernet: renesas: ravb_main: test clock rate to avoid division by 0 pwm: pwm-img: test clock rate to avoid division by 0 pwm: pwm-lpc18xx-sct: test clock rate to avoid division by 0 watchdog: atlas7_wdt: test clock rate to avoid division by 0 watchdog: tangox_wdt: test clock rate to avoid division by 0 drivers/ide/palm_bk3710.c| 2 ++ drivers/net/ethernet/renesas/ravb_main.c | 3 +++ drivers/pwm/pwm-img.c| 5 + drivers/pwm/pwm-lpc18xx-sct.c| 2 ++ drivers/watchdog/atlas7_wdt.c| 5 + drivers/watchdog/tangox_wdt.c| 2 ++ 6 files changed, 19 insertions(+) -- 2.7.0
Re: [PATCH] net: sh_eth: avoid NULL pointer dereference in ring setup
> >Reported-by: coverity (CID 1056464) > >Signed-off-by: Wolfram Sang > >Will you respin or should I? Please go ahead. You have more knowledge about this driver, so you will be faster. Reported-by: Wolfram Sang signature.asc Description: PGP signature
[PATCH] net: sh_eth: avoid NULL pointer dereference in ring setup
From: Wolfram Sang When allocating an skb fails, rxdesc is still NULL (or the previous ring index on further iterations of the loop). However, this pointer is dereferenced after the loop. So, make sure rxdesc is updated immediately at the beginning of the loop. Reported-by: coverity (CID 1056464) Signed-off-by: Wolfram Sang --- drivers/net/ethernet/renesas/sh_eth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c index a2767336b7c545..d5f13d54099734 100644 --- a/drivers/net/ethernet/renesas/sh_eth.c +++ b/drivers/net/ethernet/renesas/sh_eth.c @@ -1120,6 +1120,7 @@ static void sh_eth_ring_format(struct net_device *ndev) /* build Rx ring buffer */ for (i = 0; i < mdp->num_rx_ring; i++) { + rxdesc = &mdp->rx_ring[i]; /* skb */ mdp->rx_skbuff[i] = NULL; skb = netdev_alloc_skb(ndev, skbuff_size); @@ -1128,7 +1129,6 @@ static void sh_eth_ring_format(struct net_device *ndev) sh_eth_set_receive_align(skb); /* RX descriptor */ - rxdesc = &mdp->rx_ring[i]; /* The size of the buffer is a multiple of 32 bytes. */ buf_len = ALIGN(mdp->rx_buf_sz, 32); rxdesc->len = cpu_to_le32(buf_len << 16); -- 2.7.0
Re: [PATCH 2/2] net: ethernet: renesas: sh_eth: don't open code of_device_get_match_data()
On Wed, Mar 02, 2016 at 10:21:34AM +0900, Simon Horman wrote: > On Tue, Mar 01, 2016 at 05:37:59PM +0100, Wolfram Sang wrote: > > From: Wolfram Sang > > > > This change will also make Coverity happy by avoiding a theoretical NULL > > pointer dereference; yet another reason is to use the above helper function > > to tighten the code and make it more readable. > > > > Signed-off-by: Wolfram Sang > > --- > > > > Tested on a Lager board. > > > > drivers/net/ethernet/renesas/sh_eth.c | 10 +++--- > > 1 file changed, 3 insertions(+), 7 deletions(-) > > > > diff --git a/drivers/net/ethernet/renesas/sh_eth.c > > b/drivers/net/ethernet/renesas/sh_eth.c > > index 0a150b2289146f..8b6c07fe3d407d 100644 > > --- a/drivers/net/ethernet/renesas/sh_eth.c > > +++ b/drivers/net/ethernet/renesas/sh_eth.c > > @@ -3056,15 +3056,11 @@ static int sh_eth_drv_probe(struct platform_device > > *pdev) > > mdp->ether_link_active_low = pd->ether_link_active_low; > > > > /* set cpu data */ > > - if (id) { > > + if (id) > > mdp->cd = (struct sh_eth_cpu_data *)id->driver_data; > > - } else { > > - const struct of_device_id *match; > > + else > > + mdp->cd = (struct sh_eth_cpu_data > > *)of_device_get_match_data(&pdev->dev); > > Is the cast needed here? of_device_get_match_data returns void * The compiler complains about a const mismatch without the cast. To keep things simple, I decided to leave the cast. signature.asc Description: PGP signature
[PATCH 2/2] net: ethernet: renesas: sh_eth: don't open code of_device_get_match_data()
From: Wolfram Sang This change will also make Coverity happy by avoiding a theoretical NULL pointer dereference; yet another reason is to use the above helper function to tighten the code and make it more readable. Signed-off-by: Wolfram Sang --- Tested on a Lager board. drivers/net/ethernet/renesas/sh_eth.c | 10 +++--- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c index 0a150b2289146f..8b6c07fe3d407d 100644 --- a/drivers/net/ethernet/renesas/sh_eth.c +++ b/drivers/net/ethernet/renesas/sh_eth.c @@ -3056,15 +3056,11 @@ static int sh_eth_drv_probe(struct platform_device *pdev) mdp->ether_link_active_low = pd->ether_link_active_low; /* set cpu data */ - if (id) { + if (id) mdp->cd = (struct sh_eth_cpu_data *)id->driver_data; - } else { - const struct of_device_id *match; + else + mdp->cd = (struct sh_eth_cpu_data *)of_device_get_match_data(&pdev->dev); - match = of_match_device(of_match_ptr(sh_eth_match_table), - &pdev->dev); - mdp->cd = (struct sh_eth_cpu_data *)match->data; - } mdp->reg_offset = sh_eth_get_register_offset(mdp->cd->register_type); if (!mdp->reg_offset) { dev_err(&pdev->dev, "Unknown register type (%d)\n", -- 2.7.0
[PATCH 1/2] net: ethernet: renesas: ravb_main: don't open code of_device_get_match_data()
From: Wolfram Sang This change will also make Coverity happy by avoiding a theoretical NULL pointer dereference; yet another reason is to use the above helper function to tighten the code and make it more readable. Signed-off-by: Wolfram Sang --- Compile tested only. I am on the road and don't have acces to my Gen3 board. If someone could test it, that would be much appreciated. Or I'll do it next week. The pattern worked for other drivers I could actually test, though. drivers/net/ethernet/renesas/ravb_main.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c index c936682aae68df..b8613a611a6278 100644 --- a/drivers/net/ethernet/renesas/ravb_main.c +++ b/drivers/net/ethernet/renesas/ravb_main.c @@ -1706,7 +1706,6 @@ static int ravb_set_gti(struct net_device *ndev) static int ravb_probe(struct platform_device *pdev) { struct device_node *np = pdev->dev.of_node; - const struct of_device_id *match; struct ravb_private *priv; enum ravb_chip_id chip_id; struct net_device *ndev; @@ -1738,8 +1737,7 @@ static int ravb_probe(struct platform_device *pdev) ndev->base_addr = res->start; ndev->dma = -1; - match = of_match_device(of_match_ptr(ravb_match_table), &pdev->dev); - chip_id = (enum ravb_chip_id)match->data; + chip_id = (enum ravb_chip_id)of_device_get_match_data(&pdev->dev); if (chip_id == RCAR_GEN3) irq = platform_get_irq_byname(pdev, "ch22"); -- 2.7.0