* [PATCH 1/2] dt-bindings: Document the hi3660 clock bindings
From: Rob Herring @ 2016-12-19 22:15 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1481781493-6188-2-git-send-email-zhangfei.gao@linaro.org>
On Thu, Dec 15, 2016 at 01:58:12PM +0800, Zhangfei Gao wrote:
> Add DT bindings documentation for hi3660 SoC clock.
>
> Signed-off-by: Zhangfei Gao <zhangfei.gao@linaro.org>
> ---
> .../devicetree/bindings/clock/hi3660-clock.txt | 42 ++++++++++++++++++++++
> 1 file changed, 42 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/clock/hi3660-clock.txt
>
> diff --git a/Documentation/devicetree/bindings/clock/hi3660-clock.txt b/Documentation/devicetree/bindings/clock/hi3660-clock.txt
> new file mode 100644
> index 0000000..7296fd7
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/clock/hi3660-clock.txt
> @@ -0,0 +1,42 @@
> +* Hisilicon Hi3660 Clock Controller
> +
> +The Hi3660 clock controller generates and supplies clock to various
> +controllers within the Hi3660 SoC.
> +
> +Required Properties:
> +
> +- compatible: the compatible should be one of the following strings to
> + indicate the clock controller functionality.
> +
> + - "hisilicon,hi3660-crgctrl"
> + - "hisilicon,hi3660-pctrl"
> + - "hisilicon,hi3660-pmuctrl"
> + - "hisilicon,hi3660-sctrl"
> + - "hisilicon,hi3660-iomcu"
> +
> +- reg: physical base address of the controller and length of memory mapped
> + region.
> +
> +- #clock-cells: should be 1.
> +
> +Each clock is assigned an identifier and client nodes use this identifier
> +to specify the clock which they consume.
> +
> +All these identifier could be found in <dt-bindings/clock/hi3660-clock.h>.
> +
> +Examples:
> + crg_ctrl: crg_ctrl at fff35000 {
clock-controller at ...
> + compatible = "hisilicon,hi3660-crgctrl", "syscon";
> + reg = <0x0 0xfff35000 0x0 0x1000>;
> + #clock-cells = <1>;
> + };
> +
> + uart0: uart at fdf02000 {
serial at ...
> + compatible = "arm,pl011", "arm,primecell";
> + reg = <0x0 0xfdf02000 0x0 0x1000>;
> + interrupts = <GIC_SPI 74 IRQ_TYPE_LEVEL_HIGH>;
> + clocks = <&crg_ctrl HI3660_CLK_MUX_UART0>,
> + <&crg_ctrl HI3660_PCLK>;
> + clock-names = "uartclk", "apb_pclk";
> + status = "disabled";
> + };
> --
> 2.7.4
>
^ permalink raw reply
* [PATCH pci/host-iproc] PCI: iproc: Allow more than slot 0 on PAXC
From: Andy Gospodarek @ 2016-12-19 22:15 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <fdd96c8d-93ae-81e8-57e7-457a5d7f21a6@broadcom.com>
On Mon, Dec 19, 2016 at 02:01:59PM -0800, Ray Jui wrote:
>
>
> On 12/19/2016 1:30 PM, Andy Gospodarek wrote:
> > On Mon, Dec 19, 2016 at 10:54:15AM -0800, Ray Jui wrote:
> >>
> >>
> >> On 12/8/2016 1:30 PM, Andy Gospodarek wrote:
> >>> The iproc host driver limits the number of slots that are available on
> >>> PAXC devices. Enforcing this limit prevents VFs from being created
> >>> beyond the first port. After this change it is possible to create VFs
> >>> associated with all four devices.
> >>>
> >>> The first four devices below are the PFs and the next four are the newly
> >>> created VFs:
> >>>
> >>> 0008:01:00.0 Ethernet controller: Broadcom Limited Device 16cd
> >>> 0008:01:00.1 Ethernet controller: Broadcom Limited Device 16cd
> >>> 0008:01:00.2 Ethernet controller: Broadcom Limited Device 16cd
> >>> 0008:01:00.3 Ethernet controller: Broadcom Limited Device 16cd
> >>> 0008:01:00.4 Ethernet controller: Broadcom Limited BCM57304 NetXtreme-C Ethernet Virtual Function
> >>> 0008:01:01.0 Ethernet controller: Broadcom Limited BCM57304 NetXtreme-C Ethernet Virtual Function
> >>> 0008:01:01.4 Ethernet controller: Broadcom Limited BCM57304 NetXtreme-C Ethernet Virtual Function
> >>> 0008:01:02.0 Ethernet controller: Broadcom Limited BCM57304 NetXtreme-C Ethernet Virtual Function
> >>>
> >>> Based on the git history around 923c6bb1f641 ("PCI: iproc: Allow multiple
> >>> devices except on PAXC") and 943ebae781f5 ("PCI: iproc: Add PAXC interface
> >>> support") I expect there may be an unmentioned or unknown-to-me reason why this
> >>> code exists. I certainly cannot create and use VFs without some kind of change
> >>> around this space, so I would like to see the current limitation simply removed.
> >>>
> >>> Fixes: 923c6bb1f641 ("PCI: iproc: Allow multiple devices except on PAXC")
> >>
> >>> Signed-off-by: Andy Gospodarek <gospo@broadcom.com>
> >>> ---
> >>> drivers/pci/host/pcie-iproc.c | 8 --------
> >>> 1 file changed, 8 deletions(-)
> >>>
> >>> diff --git a/drivers/pci/host/pcie-iproc.c b/drivers/pci/host/pcie-iproc.c
> >>> index 3ebc025..9311826 100644
> >>> --- a/drivers/pci/host/pcie-iproc.c
> >>> +++ b/drivers/pci/host/pcie-iproc.c
> >>> @@ -477,14 +477,6 @@ static void __iomem *iproc_pcie_map_cfg_bus(struct pci_bus *bus,
> >>> return (pcie->base + offset);
> >>> }
> >>>
> >>> - /*
> >>> - * PAXC is connected to an internally emulated EP within the SoC. It
> >>> - * allows only one device.
> >>> - */
> >>> - if (pcie->ep_is_internal)
> >>> - if (slot > 0)
> >>> - return NULL;
> >>> -
> >>> /* EP device access */
> >>> val = (busno << CFG_ADDR_BUS_NUM_SHIFT) |
> >>> (slot << CFG_ADDR_DEV_NUM_SHIFT) |
> >>>
> >>
> >> With this change, standard v4.9 kernel would crash on a NS2 SVK with the
> >> log shown below. This is inline with my previous observation and
> >> therefore slot number has been limited to only zero for the PAXC
> >> interface. Does it require more than just this change in order for the
> >> kernel to boot to complete?
> >>
> >> [ 2.190515] OF: PCI: host bridge /pcie at 60c00000 ranges:
> >> [ 2.196400] OF: PCI: MEM 0x60000000..0x60bfffff -> 0x00000000
> >> [ 2.203135] iproc-pcie 60c00000.pcie: PCI host bridge to bus 0008:00
> >> [ 2.210289] pci_bus 0008:00: root bus resource [bus 00-01]
> >> [ 2.216349] pci_bus 0008:00: root bus resource [mem
> >> 0x60000000-0x60bfffff] (bus address [0x00000000-0x00bfffff])
> >> [ 2.227769] iproc-pcie 60c00000.pcie: not using iProc MSI
> >> [ 2.234050] pci 0008:00:00.0: bridge configuration invalid ([bus
> >> 00-00]), reconfiguring
> >> [ 2.244285] Bad mode in Error handler detected on CPU1, code
> >> 0xbf000002 -- SError
> >> [ 2.252661] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 4.9.0+ #24
> >> [ 2.259430] Hardware name: Broadcom NS2 SVK (DT)
> >> [ 2.264550] task: ffff8000fb488000 task.stack: ffff8000fb490000
> >> [ 2.271161] PC is at pci_generic_config_read32+0x74/0xa0
> >> [ 2.277043] LR is at pci_generic_config_read32+0x28/0xa0
> >> [ 2.283005] pc : [<ffff00000839d984>] lr : [<ffff00000839d938>]
> >> pstate: 200000c5
> >> [ 2.291225] sp : ffff8000fb4937f0
> >> [ 2.294937] x29: ffff8000fb4937f0 x28: ffff8000fadb9000
> >> [ 2.300884] x27: ffff8000faf27098 x26: 0000000000000000
> >> [ 2.306803] x25: 0000000000000000 x24: ffff8000fadb9400
> >> [ 2.312757] x23: 0000000000000040 x22: ffff0000089c55d8
> >> [ 2.318730] x21: 0000000000000010 x20: ffff8000fb49391c
> >> [ 2.324666] x19: 0000000000000000 x18: 000000000000077f
> >> [ 2.330594] x17: ffffffffffffffff x16: ffff000008a49fff
> >> [ 2.336539] x15: ffff000008a49fff x14: 0000000000000000
> >> [ 2.342502] x13: 0000000000000007 x12: 0000000000000018
> >> [ 2.348456] x11: 0101010101010101 x10: 7f7f7f7f7f7f7f7f
> >> [ 2.354392] x9 : 0000000000000000 x8 : ffff8000fa80e680
> >> [ 2.360355] x7 : 000000000000ffff x6 : ffff8000faf0ca98
> >> [ 2.366300] x5 : 0000000000000002 x4 : ffff8000fb49389c
> >> [ 2.372290] x3 : 0000000000000004 x2 : 0000000000100001
> >> [ 2.378209] x1 : ffff000008a49000 x0 : 0000000000000000
> >> [ 2.384145]
> >> [ 2.385807] Internal error: Oops - bad mode: 0 [#1] PREEMPT SMP
> >> [ 2.392351] Modules linked in:
> >> [ 2.395770] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 4.9.0+ #24
> >> [ 2.402529] Hardware name: Broadcom NS2 SVK (DT)
> >> [ 2.407693] task: ffff8000fb488000 task.stack: ffff8000fb490000
> >> [ 2.414301] PC is at pci_generic_config_read32+0x74/0xa0
> >> [ 2.420299] LR is at pci_generic_config_read32+0x28/0xa0
> >> [ 2.426279] pc : [<ffff00000839d984>] lr : [<ffff00000839d938>]
> >> pstate: 200000c5
> >> [ 2.434552] sp : ffff8000fb4937f0
> >> [ 2.438246] x29: ffff8000fb4937f0 x28: ffff8000fadb9000
> >> [ 2.444209] x27: ffff8000faf27098 x26: 0000000000000000
> >> [ 2.450137] x25: 0000000000000000 x24: ffff8000fadb9400
> >> [ 2.456091] x23: 0000000000000040 x22: ffff0000089c55d8
> >> [ 2.462037] x21: 0000000000000010 x20: ffff8000fb49391c
> >> [ 2.467947] x19: 0000000000000000 x18: 000000000000077f
> >> [ 2.473945] x17: ffffffffffffffff x16: ffff000008a49fff
> >> [ 2.479881] x15: ffff000008a49fff x14: 0000000000000000
> >> [ 2.485826] x13: 0000000000000007 x12: 0000000000000018
> >> [ 2.491798] x11: 0101010101010101 x10: 7f7f7f7f7f7f7f7f
> >> [ 2.497752] x9 : 0000000000000000 x8 : ffff8000fa80e680
> >> [ 2.503689] x7 : 000000000000ffff x6 : ffff8000faf0ca98
> >> [ 2.509643] x5 : 0000000000000002 x4 : ffff8000fb49389c
> >> [ 2.515561] x3 : 0000000000000004 x2 : 0000000000100001
> >> [ 2.521453] x1 : ffff000008a49000 x0 : 0000000000000000
> >> [ 2.527388]
> >> [ 2.529058] Process swapper/0 (pid: 1, stack limit = 0xffff8000fb490020)
> >> [ 2.536607] Stack: (0xffff8000fb4937f0 to 0xffff8000fb494000)
> >> [ 2.543044] 37e0: ffff8000fb493820
> >> ffff0000083b65cc
> >> [ 2.551830] 3800: ffff8000fadb9400 ffff00000867606c 0000000000000004
> >> ffff8000fb49389c
> >> [ 2.560481] 3820: ffff8000fb493840 ffff00000839dcc8 ffff8000fadb9400
> >> ffff00000839dce0
> >> [ 2.569158] 3840: ffff8000fb4938a0 ffff00000839fcb8 0000000000000000
> >> ffff8000fb49391c
> >> [ 2.577915] 3860: 000000000000ea60 0000000000000001 0000000000000010
> >> 0000000000000000
> >> [ 2.586718] 3880: ffff8000faef9000 0000000000000000 ffff8000fb4938b0
> >> 00000000083a94d8
> >> [ 2.595548] 38a0: ffff8000fb4938e0 ffff0000083a1380 0000000000000000
> >> ffff8000fadb9400
> >> [ 2.604359] 38c0: 0000000000000010 0000000000000001 ffff0000087fb000
> >> ffff8000fadb9528
> >> [ 2.613180] 38e0: ffff8000fb493920 ffff0000083a1444 ffff8000fadb9400
> >> ffff8000fadb9400
> >> [ 2.621938] 3900: 0000000000000010 0000000000000004 ffff8000fb493960
> >> fffffffffb493960
> >> [ 2.630767] 3920: ffff8000fb493960 ffff0000083a237c 0000000000000018
> >> ffff8000fadb9400
> >> [ 2.639543] 3940: 0000000000000001 0000000000000000 ffff8000fadb9000
> >> 0000000000000007
> >> [ 2.648355] 3960: ffff8000fb4939b0 ffff0000083a20d8 ffff8000faf27000
> >> ffff8000fadb9400
> >> [ 2.657166] 3980: 0000000000000001 0000000000000000 0000000000000000
> >> 0000000000000001
> >> [ 2.665960] 39a0: 0000000000000000 0000000000000018 ffff8000fb493a30
> >> ffff0000083a23d8
> >> [ 2.674789] 39c0: ffff8000faf27000 ffff8000fadb9000 ffff8000fadb9028
> >> 0000000000000000
> >> [ 2.683547] 39e0: ffff0000087fb000 ffff8000fadb9128 0000000000000001
> >> ffff0000088c0460
> >> [ 2.692341] 3a00: ffff0000089a4000 ffff0000088f8b60 ffff8000fb49396c
> >> 0000000000000000
> >> [ 2.701117] 3a20: 0000000000000000 00ff010000000000 ffff8000fb493a80
> >> ffff0000083b731c
> >> [ 2.709910] 3a40: ffff8000faf0e218 ffff8000fffe7748 ffff8000fb63f410
> >> ffff8000fadb9000
> >> [ 2.718695] 3a60: ffff0000086e9000 ffff8000fffe1e00 ffff0000088f8bc0
> >> 6c6071652c6c3175
> >> [ 2.727489] 3a80: ffff8000fb493bc0 ffff0000083b8774 0000000000000000
> >> ffff8000faf0e218
> >> [ 2.736291] 3aa0: ffff8000fb63f410 ffff8000fb493c10 ffff8000fffe1e00
> >> ffff8000fb63f400
> >> [ 2.745058] 3ac0: ffff0000088f8bc0 ffff0000088c0460 ffff0000089a4000
> >> ffff0000088f8b60
> >> [ 2.753816] 3ae0: ffff8000fb493b20 ffff00000858b7b0 ffff8000fb493c08
> >> ffff000008855f08
> >> [ 2.762583] 3b00: ffff0000089b6000 ffff8000fb493c10 ffff8000fffe1e00
> >> 0000000060000000
> >> [ 2.771376] 3b20: ffff8000fb493bc0 ffff0000083b8744 0000000000000000
> >> ffff8000faf0e218
> >> [ 2.780125] 3b40: ffff8000fb63f410 ffff8000fb493c10 ffff8000fffe1e00
> >> ffff8000fb63f400
> >> [ 2.788937] 3b60: ffff8000fffe1e00 0000000000000000 ffff0000004d454d
> >> 0000000200000007
> >> [ 2.797731] 3b80: ffff7dfffe8009dc ffff7dfffe8009dc 0000000200000007
> >> ffff000000000083
> >> [ 2.806533] 3ba0: 0000000000000000 0000000060000000 0000000000c00000
> >> 0000000000000200
> >> [ 2.815372] 3bc0: ffff8000fb493c60 ffff000008414ef8 ffff000008962258
> >> ffff8000fb63f410
> >> [ 2.824121] 3be0: 0000000000000000 ffff000008962280 0000000000000000
> >> ffff0000089a4000
> >> [ 2.832950] 3c00: ffff8000fb493c40 ffffffffffffffff ffff8000fb493c10
> >> ffff8000fb493c10
> >> [ 2.841717] 3c20: 0000000060c00000 0000000060c00fff ffff8000fffe1ea8
> >> 0000000000000200
> >> [ 2.850529] 3c40: 0000000000000000 0000000000000000 0000000000000000
> >> 0000000000000000
> >> [ 2.859358] 3c60: ffff8000fb493c80 ffff000008413688 ffff8000fb63f410
> >> ffff0000089c8000
> >> [ 2.868161] 3c80: ffff8000fb493cc0 ffff0000084137c0 ffff8000fb63f410
> >> ffff000008962280
> >> [ 2.876919] 3ca0: ffff8000fb63f470 ffff00000896cd30 ffff00000896c000
> >> ffff00000841190c
> >> [ 2.885677] 3cc0: ffff8000fb493cf0 ffff000008411900 0000000000000000
> >> ffff000008962280
> >> [ 2.894497] 3ce0: ffff000008413720 ffff8000fb493d40 ffff8000fb493d30
> >> ffff000008413124
> >> [ 2.903308] 3d00: ffff000008962280 ffff8000faf0e100 0000000000000000
> >> ffff00000867606c
> >> [ 2.912058] 3d20: ffff8000fb43eca8 ffff8000fb625b68 ffff8000fb493d40
> >> ffff000008412d84
> >> [ 2.920815] 3d40: ffff8000fb493d80 ffff000008413eb4 ffff000008962280
> >> ffff0000088e1438
> >> [ 2.929591] 3d60: 0000000000000000 ffff0000088f8b30 ffff0000088aba00
> >> ffff0000089c5000
> >> [ 2.938358] 3d80: ffff8000fb493db0 ffff000008414eb8 ffff8000fb490000
> >> ffff0000088e1438
> >> [ 2.947134] 3da0: 0000000000000000 0000000000000000 ffff8000fb493dc0
> >> ffff0000088e1450
> >> [ 2.955936] 3dc0: ffff8000fb493dd0 ffff000008083144 ffff8000fb493e40
> >> ffff0000088c0c98
> >> [ 2.964658] 3de0: ffff000008907240 0000000000000006 00000000000000e7
> >> ffff0000088f8b30
> >> [ 2.973506] 3e00: ffff8000fb493e00 ffff0000087f42c8 ffff8000fb493e20
> >> ffff0000087f3ae8
> >> [ 2.982326] 3e20: 0000000600000006 0000000000000000 0000000000000000
> >> ffff0000088aba00
> >> [ 2.991129] 3e40: ffff8000fb493ea0 ffff000008678154 ffff000008678144
> >> 0000000000000000
> >> [ 2.999922] 3e60: 0000000000000000 0000000000000000 0000000000000000
> >> 0000000000000000
> >> [ 3.008671] 3e80: 0000000000000000 0000000000000000 0000000000000000
> >> 0000000000000000
> >> [ 3.017500] 3ea0: 0000000000000000 ffff000008082e80 ffff000008678144
> >> 0000000000000000
> >> [ 3.026294] 3ec0: 0000000000000000 0000000000000000 0000000000000000
> >> 0000000000000000
> >> [ 3.035043] 3ee0: 0000000000000000 0000000000000000 0000000000000000
> >> 0000000000000000
> >> [ 3.043818] 3f00: 0000000000000000 0000000000000000 0000000000000000
> >> 0000000000000000
> >> [ 3.052639] 3f20: 0000000000000000 0000000000000000 0000000000000000
> >> 0000000000000000
> >> [ 3.061432] 3f40: 0000000000000000 0000000000000000 0000000000000000
> >> 0000000000000000
> >> [ 3.070207] 3f60: 0000000000000000 0000000000000000 0000000000000000
> >> 0000000000000000
> >> [ 3.079036] 3f80: 0000000000000000 0000000000000000 0000000000000000
> >> 0000000000000000
> >> [ 3.087820] 3fa0: 0000000000000000 0000000000000000 0000000000000000
> >> 0000000000000000
> >> [ 3.096623] 3fc0: 0000000000000000 0000000000000005 0000000000000000
> >> 0000000000000000
> >> [ 3.105398] 3fe0: 0000000000000000 0000000000000000 000000017b493ff0
> >> 000000017b493ff8
> >> [ 3.114173] Call trace:
> >> [ 3.116920] [<ffff00000839d984>] pci_generic_config_read32+0x74/0xa0
> >> [ 3.124039] [<ffff0000083b65cc>] iproc_pcie_config_read32+0x2c/0xe0
> >> [ 3.131041] [<ffff00000839dcc8>] pci_bus_read_config_dword+0x80/0xb0
> >> [ 3.138143] [<ffff00000839fcb8>] pci_bus_read_dev_vendor_id+0x30/0x104
> >> [ 3.145459] [<ffff0000083a1380>] pci_scan_single_device+0x50/0xc4
> >> [ 3.152345] [<ffff0000083a1444>] pci_scan_slot+0x50/0xf0
> >> [ 3.158334] [<ffff0000083a237c>] pci_scan_child_bus+0x50/0x164
> >> [ 3.164798] [<ffff0000083a20d8>] pci_scan_bridge+0x2c0/0x514
> >> [ 3.171154] [<ffff0000083a23d8>] pci_scan_child_bus+0xac/0x164
> >> [ 3.177690] [<ffff0000083b731c>] iproc_pcie_setup+0x71c/0xc78
> >> [ 3.184172] [<ffff0000083b8774>] iproc_pcie_pltfm_probe+0x170/0x260
> >> [ 3.191176] [<ffff000008414ef8>] platform_drv_probe+0x38/0x7c
> >> [ 3.197640] [<ffff000008413688>] really_probe+0x1b0/0x248
> >> [ 3.203701] [<ffff0000084137c0>] __driver_attach+0xa0/0xb0
> >> [ 3.209878] [<ffff000008411900>] bus_for_each_dev+0x58/0x98
> >> [ 3.216110] [<ffff000008413124>] driver_attach+0x20/0x28
> >> [ 3.222063] [<ffff000008412d84>] bus_add_driver+0x1c8/0x22c
> >> [ 3.228285] [<ffff000008413eb4>] driver_register+0x68/0x108
> >> [ 3.234517] [<ffff000008414eb8>] __platform_driver_register+0x4c/0x54
> >> [ 3.241772] [<ffff0000088e1450>] iproc_pcie_pltfm_driver_init+0x18/0x20
> >> [ 3.249224] [<ffff000008083144>] do_one_initcall+0x38/0x128
> >> [ 3.255466] [<ffff0000088c0c98>] kernel_init_freeable+0x14c/0x1ec
> >> [ 3.262344] [<ffff000008678154>] kernel_init+0x10/0xfc
> >> [ 3.268118] [<ffff000008082e80>] ret_from_fork+0x10/0x50
> >> [ 3.274108] Code: 52800000 f9400bf3 a8c37bfd d65f03c0 (b9000080)
> >> [ 3.280984] ---[ end trace d90bb74924ac9e8e ]---
> >> [ 3.286202] note: swapper/0[1] exited with preempt_count 1
> >> [ 3.292340] Kernel panic - not syncing: Attempted to kill init!
> >> exitcode=0x0000000b
> >> [ 3.292340]
> >>
> >
> > I originally tested this patch with the following DT change to enable
> > that PCI slot on the host-iproc branch (uname reports it as 4.9.0-rc1+).
> > I also just tested it again to be sure and I do not see the same crash
> > you see. I'll test Linus' tree and see if I can reproduce what you are
> > seeing. We can also share configs offline if needed.
> >
>
> Does this require a certain version of Chimp firmware to run on Nitro
> for it to work properly?
It _may_. I've been testing with 0.0.7.0 -- which version are you using?
^ permalink raw reply
* [PATCH 6/6] watchdog: ts4600: add driver for TS-4600 watchdog
From: Rob Herring @ 2016-12-19 22:13 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20161214231237.17496-7-sebastien.bourdelin@savoirfairelinux.com>
On Wed, Dec 14, 2016 at 06:12:36PM -0500, Sebastien Bourdelin wrote:
> This watchdog is instantiated in a FPGA and can only be access using a
> GPIOs bit-banged bus, called the NBUS by Technologic Systems.
> The watchdog is made of only one register, called the feed register.
> Writing to this register will re-arm the watchdog for a given time (and
> enable it if it was disable). It can be disabled by writing a special
> value into it.
>
> Signed-off-by: Sebastien Bourdelin <sebastien.bourdelin@savoirfairelinux.com>
> ---
> .../devicetree/bindings/watchdog/ts4600-wdt.txt | 16 ++
> arch/arm/boot/dts/imx28-ts4600-common.dtsi | 5 +
Acked-by: Rob Herring <robh@kernel.org>
> drivers/watchdog/Kconfig | 10 +
> drivers/watchdog/Makefile | 1 +
> drivers/watchdog/ts4600_wdt.c | 213 +++++++++++++++++++++
> 5 files changed, 245 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/watchdog/ts4600-wdt.txt
> create mode 100644 drivers/watchdog/ts4600_wdt.c
^ permalink raw reply
* [PATCH 3/6] dt-bindings: bus: Add documentation for the Technologic Systems NBUS
From: Rob Herring @ 2016-12-19 22:12 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20161214231237.17496-4-sebastien.bourdelin@savoirfairelinux.com>
On Wed, Dec 14, 2016 at 06:12:33PM -0500, Sebastien Bourdelin wrote:
> Add binding documentation for the Technologic Systems NBUS that is used
> to interface with peripherals in the FPGA of the TS-4600 SoM.
>
> Signed-off-by: Sebastien Bourdelin <sebastien.bourdelin@savoirfairelinux.com>
> ---
> Documentation/devicetree/bindings/bus/ts-nbus.txt | 50 +++++++++++++++++++++++
> 1 file changed, 50 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/bus/ts-nbus.txt
>
> diff --git a/Documentation/devicetree/bindings/bus/ts-nbus.txt b/Documentation/devicetree/bindings/bus/ts-nbus.txt
> new file mode 100644
> index 0000000..2f777ee
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/bus/ts-nbus.txt
> @@ -0,0 +1,50 @@
> +Technologic Systems NBUS
> +
> +The NBUS is a bus used to interface with peripherals in the Technologic
> +Systems FPGA on the TS-4600 SoM.
> +
> +Required properties :
> + - compatible : "technologic,ts-nbus", "simple-bus"
> + - #address-cells : must be 1
> + - #size-cells : must be 0
> + - pws : The PWM pin connected to the clock line on the FPGA
Using PWM binding?
> + - data-gpios : The GPIO pin connected to the data line on the FPGA
> + - csn-gpios : The GPIO pin connected to the csn line on the FPGA
> + - txrx-gpios : The GPIO pin connected to the txrx line on the FPGA
> + - strobe-gpios : The GPIO pin connected to the stobe line on the FPGA
> + - ale-gpios : The GPIO pin connected to the ale line on the FPGA
> + - rdy-gpios : The GPIO pin connected to the rdy line on the FPGA
These all need vendor prefix.
This is not any sort of standard bus?
> +
> +Child nodes:
> +
> +The NBUS node can contain zero or more child nodes representing peripherals
> +on the bus.
> +
> +Example:
> +
> + nbus {
> + compatible = "technologic,ts-nbus", "simple-bus";
I don't think simple-bus is really valid here. Don't you need the nbus
driver before the devices are usable?
> + pinctrl-0 = <&nbus_pins>;
> + #address-cells = <1>;
> + #size-cells = <0>;
> + pwms = <&pwm 2 83>;
> + data-gpios = <&gpio0 0 GPIO_ACTIVE_HIGH
> + &gpio0 1 GPIO_ACTIVE_HIGH
> + &gpio0 2 GPIO_ACTIVE_HIGH
> + &gpio0 3 GPIO_ACTIVE_HIGH
> + &gpio0 4 GPIO_ACTIVE_HIGH
> + &gpio0 5 GPIO_ACTIVE_HIGH
> + &gpio0 6 GPIO_ACTIVE_HIGH
> + &gpio0 7 GPIO_ACTIVE_HIGH>;
> + csn-gpios = <&gpio0 16 GPIO_ACTIVE_HIGH>;
> + txrx-gpios = <&gpio0 24 GPIO_ACTIVE_HIGH>;
> + strobe-gpios = <&gpio0 25 GPIO_ACTIVE_HIGH>;
> + ale-gpios = <&gpio0 26 GPIO_ACTIVE_HIGH>;
> + rdy-gpios = <&gpio0 21 GPIO_ACTIVE_HIGH>;
> +
> + wdt at 2a {
watchdog at ...
> + compatible = "...";
> +
> + /* ... */
> + };
> + };
> --
> 2.10.2
>
> --
> To unsubscribe from this list: send the line "unsubscribe devicetree" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* [PATCH 1/6] of: documentation: add bindings documentation for TS-4600
From: Rob Herring @ 2016-12-19 22:05 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20161214231237.17496-2-sebastien.bourdelin@savoirfairelinux.com>
On Wed, Dec 14, 2016 at 06:12:31PM -0500, Sebastien Bourdelin wrote:
> This adds the documentation for the TS-4600 by Technologic Systems.
>
> Signed-off-by: Sebastien Bourdelin <sebastien.bourdelin@savoirfairelinux.com>
> ---
> Documentation/devicetree/bindings/arm/technologic.txt | 5 +++++
> 1 file changed, 5 insertions(+)
Acked-by: Rob Herring <robh@kernel.org>
^ permalink raw reply
* [PATCH pci/host-iproc] PCI: iproc: Allow more than slot 0 on PAXC
From: Ray Jui @ 2016-12-19 22:01 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20161219213042.GA2862@C02RW35GFVH8>
On 12/19/2016 1:30 PM, Andy Gospodarek wrote:
> On Mon, Dec 19, 2016 at 10:54:15AM -0800, Ray Jui wrote:
>>
>>
>> On 12/8/2016 1:30 PM, Andy Gospodarek wrote:
>>> The iproc host driver limits the number of slots that are available on
>>> PAXC devices. Enforcing this limit prevents VFs from being created
>>> beyond the first port. After this change it is possible to create VFs
>>> associated with all four devices.
>>>
>>> The first four devices below are the PFs and the next four are the newly
>>> created VFs:
>>>
>>> 0008:01:00.0 Ethernet controller: Broadcom Limited Device 16cd
>>> 0008:01:00.1 Ethernet controller: Broadcom Limited Device 16cd
>>> 0008:01:00.2 Ethernet controller: Broadcom Limited Device 16cd
>>> 0008:01:00.3 Ethernet controller: Broadcom Limited Device 16cd
>>> 0008:01:00.4 Ethernet controller: Broadcom Limited BCM57304 NetXtreme-C Ethernet Virtual Function
>>> 0008:01:01.0 Ethernet controller: Broadcom Limited BCM57304 NetXtreme-C Ethernet Virtual Function
>>> 0008:01:01.4 Ethernet controller: Broadcom Limited BCM57304 NetXtreme-C Ethernet Virtual Function
>>> 0008:01:02.0 Ethernet controller: Broadcom Limited BCM57304 NetXtreme-C Ethernet Virtual Function
>>>
>>> Based on the git history around 923c6bb1f641 ("PCI: iproc: Allow multiple
>>> devices except on PAXC") and 943ebae781f5 ("PCI: iproc: Add PAXC interface
>>> support") I expect there may be an unmentioned or unknown-to-me reason why this
>>> code exists. I certainly cannot create and use VFs without some kind of change
>>> around this space, so I would like to see the current limitation simply removed.
>>>
>>> Fixes: 923c6bb1f641 ("PCI: iproc: Allow multiple devices except on PAXC")
>>
>>> Signed-off-by: Andy Gospodarek <gospo@broadcom.com>
>>> ---
>>> drivers/pci/host/pcie-iproc.c | 8 --------
>>> 1 file changed, 8 deletions(-)
>>>
>>> diff --git a/drivers/pci/host/pcie-iproc.c b/drivers/pci/host/pcie-iproc.c
>>> index 3ebc025..9311826 100644
>>> --- a/drivers/pci/host/pcie-iproc.c
>>> +++ b/drivers/pci/host/pcie-iproc.c
>>> @@ -477,14 +477,6 @@ static void __iomem *iproc_pcie_map_cfg_bus(struct pci_bus *bus,
>>> return (pcie->base + offset);
>>> }
>>>
>>> - /*
>>> - * PAXC is connected to an internally emulated EP within the SoC. It
>>> - * allows only one device.
>>> - */
>>> - if (pcie->ep_is_internal)
>>> - if (slot > 0)
>>> - return NULL;
>>> -
>>> /* EP device access */
>>> val = (busno << CFG_ADDR_BUS_NUM_SHIFT) |
>>> (slot << CFG_ADDR_DEV_NUM_SHIFT) |
>>>
>>
>> With this change, standard v4.9 kernel would crash on a NS2 SVK with the
>> log shown below. This is inline with my previous observation and
>> therefore slot number has been limited to only zero for the PAXC
>> interface. Does it require more than just this change in order for the
>> kernel to boot to complete?
>>
>> [ 2.190515] OF: PCI: host bridge /pcie at 60c00000 ranges:
>> [ 2.196400] OF: PCI: MEM 0x60000000..0x60bfffff -> 0x00000000
>> [ 2.203135] iproc-pcie 60c00000.pcie: PCI host bridge to bus 0008:00
>> [ 2.210289] pci_bus 0008:00: root bus resource [bus 00-01]
>> [ 2.216349] pci_bus 0008:00: root bus resource [mem
>> 0x60000000-0x60bfffff] (bus address [0x00000000-0x00bfffff])
>> [ 2.227769] iproc-pcie 60c00000.pcie: not using iProc MSI
>> [ 2.234050] pci 0008:00:00.0: bridge configuration invalid ([bus
>> 00-00]), reconfiguring
>> [ 2.244285] Bad mode in Error handler detected on CPU1, code
>> 0xbf000002 -- SError
>> [ 2.252661] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 4.9.0+ #24
>> [ 2.259430] Hardware name: Broadcom NS2 SVK (DT)
>> [ 2.264550] task: ffff8000fb488000 task.stack: ffff8000fb490000
>> [ 2.271161] PC is at pci_generic_config_read32+0x74/0xa0
>> [ 2.277043] LR is at pci_generic_config_read32+0x28/0xa0
>> [ 2.283005] pc : [<ffff00000839d984>] lr : [<ffff00000839d938>]
>> pstate: 200000c5
>> [ 2.291225] sp : ffff8000fb4937f0
>> [ 2.294937] x29: ffff8000fb4937f0 x28: ffff8000fadb9000
>> [ 2.300884] x27: ffff8000faf27098 x26: 0000000000000000
>> [ 2.306803] x25: 0000000000000000 x24: ffff8000fadb9400
>> [ 2.312757] x23: 0000000000000040 x22: ffff0000089c55d8
>> [ 2.318730] x21: 0000000000000010 x20: ffff8000fb49391c
>> [ 2.324666] x19: 0000000000000000 x18: 000000000000077f
>> [ 2.330594] x17: ffffffffffffffff x16: ffff000008a49fff
>> [ 2.336539] x15: ffff000008a49fff x14: 0000000000000000
>> [ 2.342502] x13: 0000000000000007 x12: 0000000000000018
>> [ 2.348456] x11: 0101010101010101 x10: 7f7f7f7f7f7f7f7f
>> [ 2.354392] x9 : 0000000000000000 x8 : ffff8000fa80e680
>> [ 2.360355] x7 : 000000000000ffff x6 : ffff8000faf0ca98
>> [ 2.366300] x5 : 0000000000000002 x4 : ffff8000fb49389c
>> [ 2.372290] x3 : 0000000000000004 x2 : 0000000000100001
>> [ 2.378209] x1 : ffff000008a49000 x0 : 0000000000000000
>> [ 2.384145]
>> [ 2.385807] Internal error: Oops - bad mode: 0 [#1] PREEMPT SMP
>> [ 2.392351] Modules linked in:
>> [ 2.395770] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 4.9.0+ #24
>> [ 2.402529] Hardware name: Broadcom NS2 SVK (DT)
>> [ 2.407693] task: ffff8000fb488000 task.stack: ffff8000fb490000
>> [ 2.414301] PC is at pci_generic_config_read32+0x74/0xa0
>> [ 2.420299] LR is at pci_generic_config_read32+0x28/0xa0
>> [ 2.426279] pc : [<ffff00000839d984>] lr : [<ffff00000839d938>]
>> pstate: 200000c5
>> [ 2.434552] sp : ffff8000fb4937f0
>> [ 2.438246] x29: ffff8000fb4937f0 x28: ffff8000fadb9000
>> [ 2.444209] x27: ffff8000faf27098 x26: 0000000000000000
>> [ 2.450137] x25: 0000000000000000 x24: ffff8000fadb9400
>> [ 2.456091] x23: 0000000000000040 x22: ffff0000089c55d8
>> [ 2.462037] x21: 0000000000000010 x20: ffff8000fb49391c
>> [ 2.467947] x19: 0000000000000000 x18: 000000000000077f
>> [ 2.473945] x17: ffffffffffffffff x16: ffff000008a49fff
>> [ 2.479881] x15: ffff000008a49fff x14: 0000000000000000
>> [ 2.485826] x13: 0000000000000007 x12: 0000000000000018
>> [ 2.491798] x11: 0101010101010101 x10: 7f7f7f7f7f7f7f7f
>> [ 2.497752] x9 : 0000000000000000 x8 : ffff8000fa80e680
>> [ 2.503689] x7 : 000000000000ffff x6 : ffff8000faf0ca98
>> [ 2.509643] x5 : 0000000000000002 x4 : ffff8000fb49389c
>> [ 2.515561] x3 : 0000000000000004 x2 : 0000000000100001
>> [ 2.521453] x1 : ffff000008a49000 x0 : 0000000000000000
>> [ 2.527388]
>> [ 2.529058] Process swapper/0 (pid: 1, stack limit = 0xffff8000fb490020)
>> [ 2.536607] Stack: (0xffff8000fb4937f0 to 0xffff8000fb494000)
>> [ 2.543044] 37e0: ffff8000fb493820
>> ffff0000083b65cc
>> [ 2.551830] 3800: ffff8000fadb9400 ffff00000867606c 0000000000000004
>> ffff8000fb49389c
>> [ 2.560481] 3820: ffff8000fb493840 ffff00000839dcc8 ffff8000fadb9400
>> ffff00000839dce0
>> [ 2.569158] 3840: ffff8000fb4938a0 ffff00000839fcb8 0000000000000000
>> ffff8000fb49391c
>> [ 2.577915] 3860: 000000000000ea60 0000000000000001 0000000000000010
>> 0000000000000000
>> [ 2.586718] 3880: ffff8000faef9000 0000000000000000 ffff8000fb4938b0
>> 00000000083a94d8
>> [ 2.595548] 38a0: ffff8000fb4938e0 ffff0000083a1380 0000000000000000
>> ffff8000fadb9400
>> [ 2.604359] 38c0: 0000000000000010 0000000000000001 ffff0000087fb000
>> ffff8000fadb9528
>> [ 2.613180] 38e0: ffff8000fb493920 ffff0000083a1444 ffff8000fadb9400
>> ffff8000fadb9400
>> [ 2.621938] 3900: 0000000000000010 0000000000000004 ffff8000fb493960
>> fffffffffb493960
>> [ 2.630767] 3920: ffff8000fb493960 ffff0000083a237c 0000000000000018
>> ffff8000fadb9400
>> [ 2.639543] 3940: 0000000000000001 0000000000000000 ffff8000fadb9000
>> 0000000000000007
>> [ 2.648355] 3960: ffff8000fb4939b0 ffff0000083a20d8 ffff8000faf27000
>> ffff8000fadb9400
>> [ 2.657166] 3980: 0000000000000001 0000000000000000 0000000000000000
>> 0000000000000001
>> [ 2.665960] 39a0: 0000000000000000 0000000000000018 ffff8000fb493a30
>> ffff0000083a23d8
>> [ 2.674789] 39c0: ffff8000faf27000 ffff8000fadb9000 ffff8000fadb9028
>> 0000000000000000
>> [ 2.683547] 39e0: ffff0000087fb000 ffff8000fadb9128 0000000000000001
>> ffff0000088c0460
>> [ 2.692341] 3a00: ffff0000089a4000 ffff0000088f8b60 ffff8000fb49396c
>> 0000000000000000
>> [ 2.701117] 3a20: 0000000000000000 00ff010000000000 ffff8000fb493a80
>> ffff0000083b731c
>> [ 2.709910] 3a40: ffff8000faf0e218 ffff8000fffe7748 ffff8000fb63f410
>> ffff8000fadb9000
>> [ 2.718695] 3a60: ffff0000086e9000 ffff8000fffe1e00 ffff0000088f8bc0
>> 6c6071652c6c3175
>> [ 2.727489] 3a80: ffff8000fb493bc0 ffff0000083b8774 0000000000000000
>> ffff8000faf0e218
>> [ 2.736291] 3aa0: ffff8000fb63f410 ffff8000fb493c10 ffff8000fffe1e00
>> ffff8000fb63f400
>> [ 2.745058] 3ac0: ffff0000088f8bc0 ffff0000088c0460 ffff0000089a4000
>> ffff0000088f8b60
>> [ 2.753816] 3ae0: ffff8000fb493b20 ffff00000858b7b0 ffff8000fb493c08
>> ffff000008855f08
>> [ 2.762583] 3b00: ffff0000089b6000 ffff8000fb493c10 ffff8000fffe1e00
>> 0000000060000000
>> [ 2.771376] 3b20: ffff8000fb493bc0 ffff0000083b8744 0000000000000000
>> ffff8000faf0e218
>> [ 2.780125] 3b40: ffff8000fb63f410 ffff8000fb493c10 ffff8000fffe1e00
>> ffff8000fb63f400
>> [ 2.788937] 3b60: ffff8000fffe1e00 0000000000000000 ffff0000004d454d
>> 0000000200000007
>> [ 2.797731] 3b80: ffff7dfffe8009dc ffff7dfffe8009dc 0000000200000007
>> ffff000000000083
>> [ 2.806533] 3ba0: 0000000000000000 0000000060000000 0000000000c00000
>> 0000000000000200
>> [ 2.815372] 3bc0: ffff8000fb493c60 ffff000008414ef8 ffff000008962258
>> ffff8000fb63f410
>> [ 2.824121] 3be0: 0000000000000000 ffff000008962280 0000000000000000
>> ffff0000089a4000
>> [ 2.832950] 3c00: ffff8000fb493c40 ffffffffffffffff ffff8000fb493c10
>> ffff8000fb493c10
>> [ 2.841717] 3c20: 0000000060c00000 0000000060c00fff ffff8000fffe1ea8
>> 0000000000000200
>> [ 2.850529] 3c40: 0000000000000000 0000000000000000 0000000000000000
>> 0000000000000000
>> [ 2.859358] 3c60: ffff8000fb493c80 ffff000008413688 ffff8000fb63f410
>> ffff0000089c8000
>> [ 2.868161] 3c80: ffff8000fb493cc0 ffff0000084137c0 ffff8000fb63f410
>> ffff000008962280
>> [ 2.876919] 3ca0: ffff8000fb63f470 ffff00000896cd30 ffff00000896c000
>> ffff00000841190c
>> [ 2.885677] 3cc0: ffff8000fb493cf0 ffff000008411900 0000000000000000
>> ffff000008962280
>> [ 2.894497] 3ce0: ffff000008413720 ffff8000fb493d40 ffff8000fb493d30
>> ffff000008413124
>> [ 2.903308] 3d00: ffff000008962280 ffff8000faf0e100 0000000000000000
>> ffff00000867606c
>> [ 2.912058] 3d20: ffff8000fb43eca8 ffff8000fb625b68 ffff8000fb493d40
>> ffff000008412d84
>> [ 2.920815] 3d40: ffff8000fb493d80 ffff000008413eb4 ffff000008962280
>> ffff0000088e1438
>> [ 2.929591] 3d60: 0000000000000000 ffff0000088f8b30 ffff0000088aba00
>> ffff0000089c5000
>> [ 2.938358] 3d80: ffff8000fb493db0 ffff000008414eb8 ffff8000fb490000
>> ffff0000088e1438
>> [ 2.947134] 3da0: 0000000000000000 0000000000000000 ffff8000fb493dc0
>> ffff0000088e1450
>> [ 2.955936] 3dc0: ffff8000fb493dd0 ffff000008083144 ffff8000fb493e40
>> ffff0000088c0c98
>> [ 2.964658] 3de0: ffff000008907240 0000000000000006 00000000000000e7
>> ffff0000088f8b30
>> [ 2.973506] 3e00: ffff8000fb493e00 ffff0000087f42c8 ffff8000fb493e20
>> ffff0000087f3ae8
>> [ 2.982326] 3e20: 0000000600000006 0000000000000000 0000000000000000
>> ffff0000088aba00
>> [ 2.991129] 3e40: ffff8000fb493ea0 ffff000008678154 ffff000008678144
>> 0000000000000000
>> [ 2.999922] 3e60: 0000000000000000 0000000000000000 0000000000000000
>> 0000000000000000
>> [ 3.008671] 3e80: 0000000000000000 0000000000000000 0000000000000000
>> 0000000000000000
>> [ 3.017500] 3ea0: 0000000000000000 ffff000008082e80 ffff000008678144
>> 0000000000000000
>> [ 3.026294] 3ec0: 0000000000000000 0000000000000000 0000000000000000
>> 0000000000000000
>> [ 3.035043] 3ee0: 0000000000000000 0000000000000000 0000000000000000
>> 0000000000000000
>> [ 3.043818] 3f00: 0000000000000000 0000000000000000 0000000000000000
>> 0000000000000000
>> [ 3.052639] 3f20: 0000000000000000 0000000000000000 0000000000000000
>> 0000000000000000
>> [ 3.061432] 3f40: 0000000000000000 0000000000000000 0000000000000000
>> 0000000000000000
>> [ 3.070207] 3f60: 0000000000000000 0000000000000000 0000000000000000
>> 0000000000000000
>> [ 3.079036] 3f80: 0000000000000000 0000000000000000 0000000000000000
>> 0000000000000000
>> [ 3.087820] 3fa0: 0000000000000000 0000000000000000 0000000000000000
>> 0000000000000000
>> [ 3.096623] 3fc0: 0000000000000000 0000000000000005 0000000000000000
>> 0000000000000000
>> [ 3.105398] 3fe0: 0000000000000000 0000000000000000 000000017b493ff0
>> 000000017b493ff8
>> [ 3.114173] Call trace:
>> [ 3.116920] [<ffff00000839d984>] pci_generic_config_read32+0x74/0xa0
>> [ 3.124039] [<ffff0000083b65cc>] iproc_pcie_config_read32+0x2c/0xe0
>> [ 3.131041] [<ffff00000839dcc8>] pci_bus_read_config_dword+0x80/0xb0
>> [ 3.138143] [<ffff00000839fcb8>] pci_bus_read_dev_vendor_id+0x30/0x104
>> [ 3.145459] [<ffff0000083a1380>] pci_scan_single_device+0x50/0xc4
>> [ 3.152345] [<ffff0000083a1444>] pci_scan_slot+0x50/0xf0
>> [ 3.158334] [<ffff0000083a237c>] pci_scan_child_bus+0x50/0x164
>> [ 3.164798] [<ffff0000083a20d8>] pci_scan_bridge+0x2c0/0x514
>> [ 3.171154] [<ffff0000083a23d8>] pci_scan_child_bus+0xac/0x164
>> [ 3.177690] [<ffff0000083b731c>] iproc_pcie_setup+0x71c/0xc78
>> [ 3.184172] [<ffff0000083b8774>] iproc_pcie_pltfm_probe+0x170/0x260
>> [ 3.191176] [<ffff000008414ef8>] platform_drv_probe+0x38/0x7c
>> [ 3.197640] [<ffff000008413688>] really_probe+0x1b0/0x248
>> [ 3.203701] [<ffff0000084137c0>] __driver_attach+0xa0/0xb0
>> [ 3.209878] [<ffff000008411900>] bus_for_each_dev+0x58/0x98
>> [ 3.216110] [<ffff000008413124>] driver_attach+0x20/0x28
>> [ 3.222063] [<ffff000008412d84>] bus_add_driver+0x1c8/0x22c
>> [ 3.228285] [<ffff000008413eb4>] driver_register+0x68/0x108
>> [ 3.234517] [<ffff000008414eb8>] __platform_driver_register+0x4c/0x54
>> [ 3.241772] [<ffff0000088e1450>] iproc_pcie_pltfm_driver_init+0x18/0x20
>> [ 3.249224] [<ffff000008083144>] do_one_initcall+0x38/0x128
>> [ 3.255466] [<ffff0000088c0c98>] kernel_init_freeable+0x14c/0x1ec
>> [ 3.262344] [<ffff000008678154>] kernel_init+0x10/0xfc
>> [ 3.268118] [<ffff000008082e80>] ret_from_fork+0x10/0x50
>> [ 3.274108] Code: 52800000 f9400bf3 a8c37bfd d65f03c0 (b9000080)
>> [ 3.280984] ---[ end trace d90bb74924ac9e8e ]---
>> [ 3.286202] note: swapper/0[1] exited with preempt_count 1
>> [ 3.292340] Kernel panic - not syncing: Attempted to kill init!
>> exitcode=0x0000000b
>> [ 3.292340]
>>
>
> I originally tested this patch with the following DT change to enable
> that PCI slot on the host-iproc branch (uname reports it as 4.9.0-rc1+).
> I also just tested it again to be sure and I do not see the same crash
> you see. I'll test Linus' tree and see if I can reproduce what you are
> seeing. We can also share configs offline if needed.
>
Does this require a certain version of Chimp firmware to run on Nitro
for it to work properly?
Thanks,
Ray
^ permalink raw reply
* [PATCH] ARM: dts: imx: Pass an empty 'chosen' node
From: Uwe Kleine-König @ 2016-12-19 21:53 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <CAOMZO5Be3f4YmGO0FJbeGZO55CJd9P9QO28SfhPLYuivtSHk7w@mail.gmail.com>
On Mon, Dec 19, 2016 at 07:30:25PM -0200, Fabio Estevam wrote:
> Hi Uwe,
>
> On Mon, Dec 19, 2016 at 4:41 PM, Uwe Kleine-K?nig
> <u.kleine-koenig@pengutronix.de> wrote:
>
> > wouldn't it be better to fix the decompressor code to eventually create
> > the /chosen node when it doesn't exist?
>
> Thanks for the suggestion.
>
> I don't have a Barebox setup handy, but would the following change fix
> it as you propose?
>
> --- a/arch/arm/boot/compressed/atags_to_fdt.c
> +++ b/arch/arm/boot/compressed/atags_to_fdt.c
> @@ -66,13 +66,21 @@ static uint32_t get_cell_size(const void *fdt)
> return cell_size;
> }
>
> -static void merge_fdt_bootargs(void *fdt, const char *fdt_cmdline)
> +static int merge_fdt_bootargs(void *fdt, const char *fdt_cmdline)
> {
> char cmdline[COMMAND_LINE_SIZE];
> const char *fdt_bootargs;
> char *ptr = cmdline;
> + int chosen_off;
> int len = 0;
>
> + /* find or add chosen node */
> + chosen_off = fdt_path_offset(fdt, "/chosen");
> + if (chosen_off == -FDT_ERR_NOTFOUND)
> + chosen_off = fdt_add_subnode(fdt, 0, "chosen");
> + if (chosen_off < 0)
> + return chosen_off;
I would have done:
ret = fdt_add_subnode(fdt, 0, "chosen")
if (ret < 0 && ret != -FDT_ERR_EXISTS)
return -ESOMETHING;
but I don't have the right machine@hand. Will check tomorrow.
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-K?nig |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply
* [PATCH] ARM: dts: imx: Pass an empty 'chosen' node
From: Javier Martinez Canillas @ 2016-12-19 21:44 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <CAOMZO5Be3f4YmGO0FJbeGZO55CJd9P9QO28SfhPLYuivtSHk7w@mail.gmail.com>
[adding Pali who first reported this issue]
Hello Pali,
On 12/19/2016 06:30 PM, Fabio Estevam wrote:
> Hi Uwe,
>
> On Mon, Dec 19, 2016 at 4:41 PM, Uwe Kleine-K?nig
> <u.kleine-koenig@pengutronix.de> wrote:
>
>> wouldn't it be better to fix the decompressor code to eventually create
>> the /chosen node when it doesn't exist?
>
> Thanks for the suggestion.
>
> I don't have a Barebox setup handy, but would the following change fix
> it as you propose?
>
Could you test Fabio's patch with NoLo to see if it fixes your issue?
I also think it makes more sense for Linux to create the "chosen" node
if not present since this is a requirement due a Linux implementation
detail.
Forcing to have a "chosen" node in dts leaks this implementation detail
since the ePAPR document says that the "chosen" node should be optional.
> --- a/arch/arm/boot/compressed/atags_to_fdt.c
> +++ b/arch/arm/boot/compressed/atags_to_fdt.c
> @@ -66,13 +66,21 @@ static uint32_t get_cell_size(const void *fdt)
> return cell_size;
> }
>
> -static void merge_fdt_bootargs(void *fdt, const char *fdt_cmdline)
> +static int merge_fdt_bootargs(void *fdt, const char *fdt_cmdline)
> {
> char cmdline[COMMAND_LINE_SIZE];
> const char *fdt_bootargs;
> char *ptr = cmdline;
> + int chosen_off;
> int len = 0;
>
> + /* find or add chosen node */
> + chosen_off = fdt_path_offset(fdt, "/chosen");
> + if (chosen_off == -FDT_ERR_NOTFOUND)
> + chosen_off = fdt_add_subnode(fdt, 0, "chosen");
> + if (chosen_off < 0)
> + return chosen_off;
> +
> /* copy the fdt command line into the buffer */
> fdt_bootargs = getprop(fdt, "/chosen", "bootargs", &len);
> if (fdt_bootargs)
>
Best regards,
--
Javier Martinez Canillas
Open Source Group
Samsung Research America
^ permalink raw reply
* [PATCH v2] efi/libstub: arm*: Pass latest memory map to the kernel
From: Matt Fleming @ 2016-12-19 21:38 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20161219142419.16780-1-james.morse@arm.com>
On Mon, 19 Dec, at 02:24:19PM, James Morse wrote:
> From: Ard Biesheuvel <ard.biesheuvel@linaro.org>
>
> As reported by James, the current libstub code involving the annotated
> memory map only works somewhat correctly by accident, due to the fact
> that a pool allocation happens to be reused immediately, retaining its
> former contents.
>
> Instead of juggling memory maps, which makes the code more complex than
> it needs to be, simply put a placholder value into the FDT, and only
> write the actual value after ExitBootServices() has been called.
>
> Reported-by: James Morse <james.morse@arm.com>
> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
> [Update mmap-size too, remove updated_fdt()s unused params and header entry]
> Signed-off-by: James Morse <james.morse@arm.com>
> ---
> Hi Ard,
>
> This is a v2 of your patch that updates the mmap-size too. This solves the
> truncated memmap problem I saw with v1 on Seattle.
>
> The original patch was CC-stable, so I think this should also have:
> Cc: <stable@vger.kernel.org>
> Fixes: ed9cc156c42f ("efi/libstub: Use efi_exit_boot_services() in FDT")
>
>
> Thanks,
>
> James
>
> drivers/firmware/efi/libstub/efistub.h | 8 ----
> drivers/firmware/efi/libstub/fdt.c | 75 +++++++++++++++++++++-------------
> 2 files changed, 47 insertions(+), 36 deletions(-)
Thanks James. I've queued this one up in the 'urgent' queue and tagged
it for stable. I'll send it to tip before the end of the week.
^ permalink raw reply
* [PATCH pci/host-iproc] PCI: iproc: Allow more than slot 0 on PAXC
From: Andy Gospodarek @ 2016-12-19 21:30 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <f370a4d0-c8e8-1c71-8eca-f6ac48eb30d3@broadcom.com>
On Mon, Dec 19, 2016 at 10:54:15AM -0800, Ray Jui wrote:
>
>
> On 12/8/2016 1:30 PM, Andy Gospodarek wrote:
> > The iproc host driver limits the number of slots that are available on
> > PAXC devices. Enforcing this limit prevents VFs from being created
> > beyond the first port. After this change it is possible to create VFs
> > associated with all four devices.
> >
> > The first four devices below are the PFs and the next four are the newly
> > created VFs:
> >
> > 0008:01:00.0 Ethernet controller: Broadcom Limited Device 16cd
> > 0008:01:00.1 Ethernet controller: Broadcom Limited Device 16cd
> > 0008:01:00.2 Ethernet controller: Broadcom Limited Device 16cd
> > 0008:01:00.3 Ethernet controller: Broadcom Limited Device 16cd
> > 0008:01:00.4 Ethernet controller: Broadcom Limited BCM57304 NetXtreme-C Ethernet Virtual Function
> > 0008:01:01.0 Ethernet controller: Broadcom Limited BCM57304 NetXtreme-C Ethernet Virtual Function
> > 0008:01:01.4 Ethernet controller: Broadcom Limited BCM57304 NetXtreme-C Ethernet Virtual Function
> > 0008:01:02.0 Ethernet controller: Broadcom Limited BCM57304 NetXtreme-C Ethernet Virtual Function
> >
> > Based on the git history around 923c6bb1f641 ("PCI: iproc: Allow multiple
> > devices except on PAXC") and 943ebae781f5 ("PCI: iproc: Add PAXC interface
> > support") I expect there may be an unmentioned or unknown-to-me reason why this
> > code exists. I certainly cannot create and use VFs without some kind of change
> > around this space, so I would like to see the current limitation simply removed.
> >
> > Fixes: 923c6bb1f641 ("PCI: iproc: Allow multiple devices except on PAXC")
>
> > Signed-off-by: Andy Gospodarek <gospo@broadcom.com>
> > ---
> > drivers/pci/host/pcie-iproc.c | 8 --------
> > 1 file changed, 8 deletions(-)
> >
> > diff --git a/drivers/pci/host/pcie-iproc.c b/drivers/pci/host/pcie-iproc.c
> > index 3ebc025..9311826 100644
> > --- a/drivers/pci/host/pcie-iproc.c
> > +++ b/drivers/pci/host/pcie-iproc.c
> > @@ -477,14 +477,6 @@ static void __iomem *iproc_pcie_map_cfg_bus(struct pci_bus *bus,
> > return (pcie->base + offset);
> > }
> >
> > - /*
> > - * PAXC is connected to an internally emulated EP within the SoC. It
> > - * allows only one device.
> > - */
> > - if (pcie->ep_is_internal)
> > - if (slot > 0)
> > - return NULL;
> > -
> > /* EP device access */
> > val = (busno << CFG_ADDR_BUS_NUM_SHIFT) |
> > (slot << CFG_ADDR_DEV_NUM_SHIFT) |
> >
>
> With this change, standard v4.9 kernel would crash on a NS2 SVK with the
> log shown below. This is inline with my previous observation and
> therefore slot number has been limited to only zero for the PAXC
> interface. Does it require more than just this change in order for the
> kernel to boot to complete?
>
> [ 2.190515] OF: PCI: host bridge /pcie at 60c00000 ranges:
> [ 2.196400] OF: PCI: MEM 0x60000000..0x60bfffff -> 0x00000000
> [ 2.203135] iproc-pcie 60c00000.pcie: PCI host bridge to bus 0008:00
> [ 2.210289] pci_bus 0008:00: root bus resource [bus 00-01]
> [ 2.216349] pci_bus 0008:00: root bus resource [mem
> 0x60000000-0x60bfffff] (bus address [0x00000000-0x00bfffff])
> [ 2.227769] iproc-pcie 60c00000.pcie: not using iProc MSI
> [ 2.234050] pci 0008:00:00.0: bridge configuration invalid ([bus
> 00-00]), reconfiguring
> [ 2.244285] Bad mode in Error handler detected on CPU1, code
> 0xbf000002 -- SError
> [ 2.252661] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 4.9.0+ #24
> [ 2.259430] Hardware name: Broadcom NS2 SVK (DT)
> [ 2.264550] task: ffff8000fb488000 task.stack: ffff8000fb490000
> [ 2.271161] PC is at pci_generic_config_read32+0x74/0xa0
> [ 2.277043] LR is at pci_generic_config_read32+0x28/0xa0
> [ 2.283005] pc : [<ffff00000839d984>] lr : [<ffff00000839d938>]
> pstate: 200000c5
> [ 2.291225] sp : ffff8000fb4937f0
> [ 2.294937] x29: ffff8000fb4937f0 x28: ffff8000fadb9000
> [ 2.300884] x27: ffff8000faf27098 x26: 0000000000000000
> [ 2.306803] x25: 0000000000000000 x24: ffff8000fadb9400
> [ 2.312757] x23: 0000000000000040 x22: ffff0000089c55d8
> [ 2.318730] x21: 0000000000000010 x20: ffff8000fb49391c
> [ 2.324666] x19: 0000000000000000 x18: 000000000000077f
> [ 2.330594] x17: ffffffffffffffff x16: ffff000008a49fff
> [ 2.336539] x15: ffff000008a49fff x14: 0000000000000000
> [ 2.342502] x13: 0000000000000007 x12: 0000000000000018
> [ 2.348456] x11: 0101010101010101 x10: 7f7f7f7f7f7f7f7f
> [ 2.354392] x9 : 0000000000000000 x8 : ffff8000fa80e680
> [ 2.360355] x7 : 000000000000ffff x6 : ffff8000faf0ca98
> [ 2.366300] x5 : 0000000000000002 x4 : ffff8000fb49389c
> [ 2.372290] x3 : 0000000000000004 x2 : 0000000000100001
> [ 2.378209] x1 : ffff000008a49000 x0 : 0000000000000000
> [ 2.384145]
> [ 2.385807] Internal error: Oops - bad mode: 0 [#1] PREEMPT SMP
> [ 2.392351] Modules linked in:
> [ 2.395770] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 4.9.0+ #24
> [ 2.402529] Hardware name: Broadcom NS2 SVK (DT)
> [ 2.407693] task: ffff8000fb488000 task.stack: ffff8000fb490000
> [ 2.414301] PC is at pci_generic_config_read32+0x74/0xa0
> [ 2.420299] LR is at pci_generic_config_read32+0x28/0xa0
> [ 2.426279] pc : [<ffff00000839d984>] lr : [<ffff00000839d938>]
> pstate: 200000c5
> [ 2.434552] sp : ffff8000fb4937f0
> [ 2.438246] x29: ffff8000fb4937f0 x28: ffff8000fadb9000
> [ 2.444209] x27: ffff8000faf27098 x26: 0000000000000000
> [ 2.450137] x25: 0000000000000000 x24: ffff8000fadb9400
> [ 2.456091] x23: 0000000000000040 x22: ffff0000089c55d8
> [ 2.462037] x21: 0000000000000010 x20: ffff8000fb49391c
> [ 2.467947] x19: 0000000000000000 x18: 000000000000077f
> [ 2.473945] x17: ffffffffffffffff x16: ffff000008a49fff
> [ 2.479881] x15: ffff000008a49fff x14: 0000000000000000
> [ 2.485826] x13: 0000000000000007 x12: 0000000000000018
> [ 2.491798] x11: 0101010101010101 x10: 7f7f7f7f7f7f7f7f
> [ 2.497752] x9 : 0000000000000000 x8 : ffff8000fa80e680
> [ 2.503689] x7 : 000000000000ffff x6 : ffff8000faf0ca98
> [ 2.509643] x5 : 0000000000000002 x4 : ffff8000fb49389c
> [ 2.515561] x3 : 0000000000000004 x2 : 0000000000100001
> [ 2.521453] x1 : ffff000008a49000 x0 : 0000000000000000
> [ 2.527388]
> [ 2.529058] Process swapper/0 (pid: 1, stack limit = 0xffff8000fb490020)
> [ 2.536607] Stack: (0xffff8000fb4937f0 to 0xffff8000fb494000)
> [ 2.543044] 37e0: ffff8000fb493820
> ffff0000083b65cc
> [ 2.551830] 3800: ffff8000fadb9400 ffff00000867606c 0000000000000004
> ffff8000fb49389c
> [ 2.560481] 3820: ffff8000fb493840 ffff00000839dcc8 ffff8000fadb9400
> ffff00000839dce0
> [ 2.569158] 3840: ffff8000fb4938a0 ffff00000839fcb8 0000000000000000
> ffff8000fb49391c
> [ 2.577915] 3860: 000000000000ea60 0000000000000001 0000000000000010
> 0000000000000000
> [ 2.586718] 3880: ffff8000faef9000 0000000000000000 ffff8000fb4938b0
> 00000000083a94d8
> [ 2.595548] 38a0: ffff8000fb4938e0 ffff0000083a1380 0000000000000000
> ffff8000fadb9400
> [ 2.604359] 38c0: 0000000000000010 0000000000000001 ffff0000087fb000
> ffff8000fadb9528
> [ 2.613180] 38e0: ffff8000fb493920 ffff0000083a1444 ffff8000fadb9400
> ffff8000fadb9400
> [ 2.621938] 3900: 0000000000000010 0000000000000004 ffff8000fb493960
> fffffffffb493960
> [ 2.630767] 3920: ffff8000fb493960 ffff0000083a237c 0000000000000018
> ffff8000fadb9400
> [ 2.639543] 3940: 0000000000000001 0000000000000000 ffff8000fadb9000
> 0000000000000007
> [ 2.648355] 3960: ffff8000fb4939b0 ffff0000083a20d8 ffff8000faf27000
> ffff8000fadb9400
> [ 2.657166] 3980: 0000000000000001 0000000000000000 0000000000000000
> 0000000000000001
> [ 2.665960] 39a0: 0000000000000000 0000000000000018 ffff8000fb493a30
> ffff0000083a23d8
> [ 2.674789] 39c0: ffff8000faf27000 ffff8000fadb9000 ffff8000fadb9028
> 0000000000000000
> [ 2.683547] 39e0: ffff0000087fb000 ffff8000fadb9128 0000000000000001
> ffff0000088c0460
> [ 2.692341] 3a00: ffff0000089a4000 ffff0000088f8b60 ffff8000fb49396c
> 0000000000000000
> [ 2.701117] 3a20: 0000000000000000 00ff010000000000 ffff8000fb493a80
> ffff0000083b731c
> [ 2.709910] 3a40: ffff8000faf0e218 ffff8000fffe7748 ffff8000fb63f410
> ffff8000fadb9000
> [ 2.718695] 3a60: ffff0000086e9000 ffff8000fffe1e00 ffff0000088f8bc0
> 6c6071652c6c3175
> [ 2.727489] 3a80: ffff8000fb493bc0 ffff0000083b8774 0000000000000000
> ffff8000faf0e218
> [ 2.736291] 3aa0: ffff8000fb63f410 ffff8000fb493c10 ffff8000fffe1e00
> ffff8000fb63f400
> [ 2.745058] 3ac0: ffff0000088f8bc0 ffff0000088c0460 ffff0000089a4000
> ffff0000088f8b60
> [ 2.753816] 3ae0: ffff8000fb493b20 ffff00000858b7b0 ffff8000fb493c08
> ffff000008855f08
> [ 2.762583] 3b00: ffff0000089b6000 ffff8000fb493c10 ffff8000fffe1e00
> 0000000060000000
> [ 2.771376] 3b20: ffff8000fb493bc0 ffff0000083b8744 0000000000000000
> ffff8000faf0e218
> [ 2.780125] 3b40: ffff8000fb63f410 ffff8000fb493c10 ffff8000fffe1e00
> ffff8000fb63f400
> [ 2.788937] 3b60: ffff8000fffe1e00 0000000000000000 ffff0000004d454d
> 0000000200000007
> [ 2.797731] 3b80: ffff7dfffe8009dc ffff7dfffe8009dc 0000000200000007
> ffff000000000083
> [ 2.806533] 3ba0: 0000000000000000 0000000060000000 0000000000c00000
> 0000000000000200
> [ 2.815372] 3bc0: ffff8000fb493c60 ffff000008414ef8 ffff000008962258
> ffff8000fb63f410
> [ 2.824121] 3be0: 0000000000000000 ffff000008962280 0000000000000000
> ffff0000089a4000
> [ 2.832950] 3c00: ffff8000fb493c40 ffffffffffffffff ffff8000fb493c10
> ffff8000fb493c10
> [ 2.841717] 3c20: 0000000060c00000 0000000060c00fff ffff8000fffe1ea8
> 0000000000000200
> [ 2.850529] 3c40: 0000000000000000 0000000000000000 0000000000000000
> 0000000000000000
> [ 2.859358] 3c60: ffff8000fb493c80 ffff000008413688 ffff8000fb63f410
> ffff0000089c8000
> [ 2.868161] 3c80: ffff8000fb493cc0 ffff0000084137c0 ffff8000fb63f410
> ffff000008962280
> [ 2.876919] 3ca0: ffff8000fb63f470 ffff00000896cd30 ffff00000896c000
> ffff00000841190c
> [ 2.885677] 3cc0: ffff8000fb493cf0 ffff000008411900 0000000000000000
> ffff000008962280
> [ 2.894497] 3ce0: ffff000008413720 ffff8000fb493d40 ffff8000fb493d30
> ffff000008413124
> [ 2.903308] 3d00: ffff000008962280 ffff8000faf0e100 0000000000000000
> ffff00000867606c
> [ 2.912058] 3d20: ffff8000fb43eca8 ffff8000fb625b68 ffff8000fb493d40
> ffff000008412d84
> [ 2.920815] 3d40: ffff8000fb493d80 ffff000008413eb4 ffff000008962280
> ffff0000088e1438
> [ 2.929591] 3d60: 0000000000000000 ffff0000088f8b30 ffff0000088aba00
> ffff0000089c5000
> [ 2.938358] 3d80: ffff8000fb493db0 ffff000008414eb8 ffff8000fb490000
> ffff0000088e1438
> [ 2.947134] 3da0: 0000000000000000 0000000000000000 ffff8000fb493dc0
> ffff0000088e1450
> [ 2.955936] 3dc0: ffff8000fb493dd0 ffff000008083144 ffff8000fb493e40
> ffff0000088c0c98
> [ 2.964658] 3de0: ffff000008907240 0000000000000006 00000000000000e7
> ffff0000088f8b30
> [ 2.973506] 3e00: ffff8000fb493e00 ffff0000087f42c8 ffff8000fb493e20
> ffff0000087f3ae8
> [ 2.982326] 3e20: 0000000600000006 0000000000000000 0000000000000000
> ffff0000088aba00
> [ 2.991129] 3e40: ffff8000fb493ea0 ffff000008678154 ffff000008678144
> 0000000000000000
> [ 2.999922] 3e60: 0000000000000000 0000000000000000 0000000000000000
> 0000000000000000
> [ 3.008671] 3e80: 0000000000000000 0000000000000000 0000000000000000
> 0000000000000000
> [ 3.017500] 3ea0: 0000000000000000 ffff000008082e80 ffff000008678144
> 0000000000000000
> [ 3.026294] 3ec0: 0000000000000000 0000000000000000 0000000000000000
> 0000000000000000
> [ 3.035043] 3ee0: 0000000000000000 0000000000000000 0000000000000000
> 0000000000000000
> [ 3.043818] 3f00: 0000000000000000 0000000000000000 0000000000000000
> 0000000000000000
> [ 3.052639] 3f20: 0000000000000000 0000000000000000 0000000000000000
> 0000000000000000
> [ 3.061432] 3f40: 0000000000000000 0000000000000000 0000000000000000
> 0000000000000000
> [ 3.070207] 3f60: 0000000000000000 0000000000000000 0000000000000000
> 0000000000000000
> [ 3.079036] 3f80: 0000000000000000 0000000000000000 0000000000000000
> 0000000000000000
> [ 3.087820] 3fa0: 0000000000000000 0000000000000000 0000000000000000
> 0000000000000000
> [ 3.096623] 3fc0: 0000000000000000 0000000000000005 0000000000000000
> 0000000000000000
> [ 3.105398] 3fe0: 0000000000000000 0000000000000000 000000017b493ff0
> 000000017b493ff8
> [ 3.114173] Call trace:
> [ 3.116920] [<ffff00000839d984>] pci_generic_config_read32+0x74/0xa0
> [ 3.124039] [<ffff0000083b65cc>] iproc_pcie_config_read32+0x2c/0xe0
> [ 3.131041] [<ffff00000839dcc8>] pci_bus_read_config_dword+0x80/0xb0
> [ 3.138143] [<ffff00000839fcb8>] pci_bus_read_dev_vendor_id+0x30/0x104
> [ 3.145459] [<ffff0000083a1380>] pci_scan_single_device+0x50/0xc4
> [ 3.152345] [<ffff0000083a1444>] pci_scan_slot+0x50/0xf0
> [ 3.158334] [<ffff0000083a237c>] pci_scan_child_bus+0x50/0x164
> [ 3.164798] [<ffff0000083a20d8>] pci_scan_bridge+0x2c0/0x514
> [ 3.171154] [<ffff0000083a23d8>] pci_scan_child_bus+0xac/0x164
> [ 3.177690] [<ffff0000083b731c>] iproc_pcie_setup+0x71c/0xc78
> [ 3.184172] [<ffff0000083b8774>] iproc_pcie_pltfm_probe+0x170/0x260
> [ 3.191176] [<ffff000008414ef8>] platform_drv_probe+0x38/0x7c
> [ 3.197640] [<ffff000008413688>] really_probe+0x1b0/0x248
> [ 3.203701] [<ffff0000084137c0>] __driver_attach+0xa0/0xb0
> [ 3.209878] [<ffff000008411900>] bus_for_each_dev+0x58/0x98
> [ 3.216110] [<ffff000008413124>] driver_attach+0x20/0x28
> [ 3.222063] [<ffff000008412d84>] bus_add_driver+0x1c8/0x22c
> [ 3.228285] [<ffff000008413eb4>] driver_register+0x68/0x108
> [ 3.234517] [<ffff000008414eb8>] __platform_driver_register+0x4c/0x54
> [ 3.241772] [<ffff0000088e1450>] iproc_pcie_pltfm_driver_init+0x18/0x20
> [ 3.249224] [<ffff000008083144>] do_one_initcall+0x38/0x128
> [ 3.255466] [<ffff0000088c0c98>] kernel_init_freeable+0x14c/0x1ec
> [ 3.262344] [<ffff000008678154>] kernel_init+0x10/0xfc
> [ 3.268118] [<ffff000008082e80>] ret_from_fork+0x10/0x50
> [ 3.274108] Code: 52800000 f9400bf3 a8c37bfd d65f03c0 (b9000080)
> [ 3.280984] ---[ end trace d90bb74924ac9e8e ]---
> [ 3.286202] note: swapper/0[1] exited with preempt_count 1
> [ 3.292340] Kernel panic - not syncing: Attempted to kill init!
> exitcode=0x0000000b
> [ 3.292340]
>
I originally tested this patch with the following DT change to enable
that PCI slot on the host-iproc branch (uname reports it as 4.9.0-rc1+).
I also just tested it again to be sure and I do not see the same crash
you see. I'll test Linus' tree and see if I can reproduce what you are
seeing. We can also share configs offline if needed.
diff --git a/arch/arm64/boot/dts/broadcom/ns2-svk.dts b/arch/arm64/boot/dts/broadcom/ns2-svk.dts
index 2d7872a..23e7f15 100644
--- a/arch/arm64/boot/dts/broadcom/ns2-svk.dts
+++ b/arch/arm64/boot/dts/broadcom/ns2-svk.dts
@@ -72,6 +72,10 @@
status = "ok";
};
+&pcie8 {
+ status = "ok";
+};
+
&i2c0 {
status = "ok";
};
diff --git a/arch/arm64/boot/dts/broadcom/ns2.dtsi b/arch/arm64/boot/dts/broadcom/ns2.dtsi
index 7ade88f..0dc4a67 100644
--- a/arch/arm64/boot/dts/broadcom/ns2.dtsi
+++ b/arch/arm64/boot/dts/broadcom/ns2.dtsi
@@ -133,6 +133,9 @@
status = "disabled";
+ phys = <&pci_phy0>;
+ phy-names = "pcie-phy";
+
msi-parent = <&msi0>;
msi0: msi at 20020000 {
compatible = "brcm,iproc-msi";
@@ -171,6 +174,9 @@
status = "disabled";
+ phys = <&pci_phy1>;
+ phy-names = "pcie-phy";
+
msi-parent = <&msi4>;
msi4: msi at 50020000 {
compatible = "brcm,iproc-msi";
@@ -183,6 +189,34 @@
};
};
+ pcie8: pcie at 60c00000 {
+ compatible = "brcm,iproc-pcie-paxc";
+ reg = <0 0x60c00000 0 0x1000>;
+ dma-coherent;
+ linux,pci-domain = <8>;
+
+ bus-range = <0x0 0x1>;
+
+ #address-cells = <3>;
+ #size-cells = <2>;
+ device_type = "pci";
+ ranges = <0x83000000 0 0x00000000 0 0x60000000 0 0x00c00000>;
+
+ status = "disabled";
+
+ msi-parent = <&msi8>;
+ msi8: msi at 60c00000 {
+ msi-controller;
+ interrupt-parent = <&gic>;
+ interrupts = <GIC_SPI 439 IRQ_TYPE_NONE>,
+ <GIC_SPI 440 IRQ_TYPE_NONE>,
+ <GIC_SPI 441 IRQ_TYPE_NONE>,
+ <GIC_SPI 442 IRQ_TYPE_NONE>;
+ brcm,num-eq-region = <4>;
+ brcm,num-msi-msg-region = <4>;
+ };
+ };
+
soc: soc {
compatible = "simple-bus";
#address-cells = <1>;
^ permalink raw reply related
* [PATCH] ARM: dts: imx: Pass an empty 'chosen' node
From: Fabio Estevam @ 2016-12-19 21:30 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20161219184130.o2dpr7lie256hq76@pengutronix.de>
Hi Uwe,
On Mon, Dec 19, 2016 at 4:41 PM, Uwe Kleine-K?nig
<u.kleine-koenig@pengutronix.de> wrote:
> wouldn't it be better to fix the decompressor code to eventually create
> the /chosen node when it doesn't exist?
Thanks for the suggestion.
I don't have a Barebox setup handy, but would the following change fix
it as you propose?
--- a/arch/arm/boot/compressed/atags_to_fdt.c
+++ b/arch/arm/boot/compressed/atags_to_fdt.c
@@ -66,13 +66,21 @@ static uint32_t get_cell_size(const void *fdt)
return cell_size;
}
-static void merge_fdt_bootargs(void *fdt, const char *fdt_cmdline)
+static int merge_fdt_bootargs(void *fdt, const char *fdt_cmdline)
{
char cmdline[COMMAND_LINE_SIZE];
const char *fdt_bootargs;
char *ptr = cmdline;
+ int chosen_off;
int len = 0;
+ /* find or add chosen node */
+ chosen_off = fdt_path_offset(fdt, "/chosen");
+ if (chosen_off == -FDT_ERR_NOTFOUND)
+ chosen_off = fdt_add_subnode(fdt, 0, "chosen");
+ if (chosen_off < 0)
+ return chosen_off;
+
/* copy the fdt command line into the buffer */
fdt_bootargs = getprop(fdt, "/chosen", "bootargs", &len);
if (fdt_bootargs)
^ permalink raw reply
* [PATCH 2/2] mfd: mc13xxx: Pass the IRQF_TRIGGER_HIGH flag.
From: Magnus Lilja @ 2016-12-19 21:28 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1482182934-18559-1-git-send-email-lilja.magnus@gmail.com>
All supported mc13xxx devices have active high interrupt outputs. Make sure
to configure the interrupt as active high by passing the IRQF_TRIGGER_HIGH
flag. This is required at least on the i.MX31 PDK board.
Signed-off-by: Magnus Lilja <lilja.magnus@gmail.com>
---
drivers/mfd/mc13xxx-core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mfd/mc13xxx-core.c b/drivers/mfd/mc13xxx-core.c
index d7f54e4..4cbe6b7 100644
--- a/drivers/mfd/mc13xxx-core.c
+++ b/drivers/mfd/mc13xxx-core.c
@@ -440,7 +440,7 @@ int mc13xxx_common_init(struct device *dev)
mc13xxx->irq_chip.irqs = mc13xxx->irqs;
mc13xxx->irq_chip.num_irqs = ARRAY_SIZE(mc13xxx->irqs);
- ret = regmap_add_irq_chip(mc13xxx->regmap, mc13xxx->irq, IRQF_ONESHOT,
+ ret = regmap_add_irq_chip(mc13xxx->regmap, mc13xxx->irq, IRQF_ONESHOT | IRQF_TRIGGER_HIGH,
0, &mc13xxx->irq_chip, &mc13xxx->irq_data);
if (ret)
return ret;
--
2.7.4
^ permalink raw reply related
* [PATCH 1/2] i.MX31: ipu: Make sure the interrupt routine checks all interrupts.
From: Magnus Lilja @ 2016-12-19 21:28 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1482182934-18559-1-git-send-email-lilja.magnus@gmail.com>
Commit 3d8cc00073d6750ffe883685e49b2e4a0f596370 consolidated the two
interrupts routines into one, but the remaining interrupt routine only
checks the status of the error interrupts, not the normal interrupts.
This patch fixes that problem (tested on i.MX31 PDK board).
Signed-off-by: Magnus Lilja <lilja.magnus@gmail.com>
---
drivers/dma/ipu/ipu_irq.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/dma/ipu/ipu_irq.c b/drivers/dma/ipu/ipu_irq.c
index dd184b5..2846278 100644
--- a/drivers/dma/ipu/ipu_irq.c
+++ b/drivers/dma/ipu/ipu_irq.c
@@ -272,7 +272,7 @@ static void ipu_irq_handler(struct irq_desc *desc)
u32 status;
int i, line;
- for (i = IPU_IRQ_NR_FN_BANKS; i < IPU_IRQ_NR_BANKS; i++) {
+ for (i = 0; i < IPU_IRQ_NR_BANKS; i++) {
struct ipu_irq_bank *bank = irq_bank + i;
raw_spin_lock(&bank_lock);
--
2.7.4
^ permalink raw reply related
* [PATCH 0/2] Patches to make i.MX31 PDK board boot again
From: Magnus Lilja @ 2016-12-19 21:28 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
I've been working on getting the current kernel (v4.9) as well as the stable
kernels to boot on the i.MX31 PDK board. The following is my summary of
which patches/changes are required for each kernel series. Some patches
have been posted on the mailing lists, one is in the v4.9 kernel and then
there are two new patches in this series.
On all kernels the standard imx_v6_v7_defconfig was used.
The patches in this series applies on v4.9 as well as the imx-soc/for-next
tree as of today.
Kernel 4.9:
[RESERVE-PATCH] [IMX-WDT-PATCH] [IPU-IRQ-PATCH] [MC13xxx-PATCH]
Kernel 4.8.x:
[RESERVE-PATCH] [IMX-WDT-PATCH] [IPU-IRQ-PATCH] [MC13xxx-PATCH]
[IMX-SPI-PATCH]
Kernel 4.4.x:
[RESERVE-PATCH] [IMX-WDT-PATCH] [IPU-IRQ-PATCH] [MC13xxx-PATCH]
Kernel 4.1.x:
[RESERVE-PATCH] [IMX-WDT-PATCH] [IPU-IRQ-PATCH] [MC13xxx-PATCH]
Kernel 3.18.x:
[RESERVE-PATCH] [MC13xxx-PATCH]
Kernel 3.16.x:
[RESERVE-PATCH]
Kernel 3.14.x, 3.12.x, 3.10..x, 3.4.x, 3.2.x:
No changes needed.
[RESERVE-PATCH] https://marc.info/?l=linux-arm-kernel&m=148168166012794&w=2
[IMX-WDT-PATCH] https://marc.info/?l=linux-arm-kernel&m=148141853206440&w=2
[IPU-IRQ-PATCH] Patch 1 in my series
[MC13xxx-PATCH] Patch 2 in my series
[IMX-SPI-PATCH] Commit 2636ba8fa39915c7b8d73166961ebbb4c14251cd
Regards, Magnus
Magnus Lilja (2):
i.MX31: ipu: Make sure the interrupt routine checks all interrupts.
mfd: mc13xxx: Pass the IRQF_TRIGGER_HIGH flag.
drivers/dma/ipu/ipu_irq.c | 2 +-
drivers/mfd/mc13xxx-core.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
--
2.7.4
^ permalink raw reply
* [PATCH 2/3] arm64: Work around Falkor erratum 1003
From: Christopher Covington @ 2016-12-19 21:27 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <20161208103115.GF33075@MBP.local>
Hi Catalin,
On 12/08/2016 05:31 AM, Catalin Marinas wrote:
> On Wed, Dec 07, 2016 at 03:00:26PM -0500, Christopher Covington wrote:
>> From: Shanker Donthineni <shankerd@codeaurora.org>
>>
>> On the Qualcomm Datacenter Technologies Falkor v1 CPU, memory accesses may
>> allocate TLB entries using an incorrect ASID when TTBRx_EL1 is being
>> updated. Changing the TTBRx_EL1[ASID] and TTBRx_EL1[BADDR] fields
>> separately using a reserved ASID will ensure that there are no TLB entries
>> with incorrect ASID after changing the the ASID.
>>
>> Pseudo code:
>> write TTBRx_EL1[ASID] to a reserved value
>> ISB
>> write TTBRx_EL1[BADDR] to a desired value
>> ISB
>> write TTBRx_EL1[ASID] to a desired value
>> ISB
>
> While the new ASID probably won't have incorrect TLB entries, the
> reserved ASID will have random entries from all over the place. That's
> because in step 1 you change the ASID to the reserved one while leaving
> the old BADDR in place. There is a brief time before changing the ASID
> when speculative page table walks will populate the TLB with entries
> tagged with the reserved ASID. Such entries are never removed during TLB
> shoot-down for the real ASID, so, depending on how this CPU implements
> the walk cache, you could end up with intermediate level entries still
> active and pointing to freed/reused pages. It will eventually hit an
> entry that looks global with weird consequences.
>
> We've been bitten by this in the past on arm32: 52af9c6cd863 ("ARM:
> 6943/1: mm: use TTBR1 instead of reserved context ID").
Thanks for bringing this up, but I'm told the scenario you describe won't
happen on the Falkor 1.0 CPU.
Thanks,
Cov
--
Qualcomm Datacenter Technologies, Inc. as an affiliate of Qualcomm
Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code
Aurora Forum, a Linux Foundation Collaborative Project.
^ permalink raw reply
* [PATCH] iommu/arm-smmu-v3: prevent corruption of ste stage-1 context ptr
From: Nate Watterson @ 2016-12-19 20:38 UTC (permalink / raw)
To: linux-arm-kernel
To ensure that the stage-1 context ptr for an ste points to the
intended context descriptor, this patch adds code to clear away
the stale context ptr value prior to or'ing in the new one.
Signed-off-by: Nate Watterson <nwatters@codeaurora.org>
---
drivers/iommu/arm-smmu-v3.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
index 4d6ec44..093f9f1 100644
--- a/drivers/iommu/arm-smmu-v3.c
+++ b/drivers/iommu/arm-smmu-v3.c
@@ -1080,6 +1080,8 @@ static void arm_smmu_write_strtab_ent(struct arm_smmu_device *smmu, u32 sid,
if (smmu->features & ARM_SMMU_FEAT_STALLS)
dst[1] |= cpu_to_le64(STRTAB_STE_1_S1STALLD);
+ val &= ~(STRTAB_STE_0_S1CTXPTR_MASK <<
+ STRTAB_STE_0_S1CTXPTR_SHIFT);
val |= (ste->s1_cfg->cdptr_dma & STRTAB_STE_0_S1CTXPTR_MASK
<< STRTAB_STE_0_S1CTXPTR_SHIFT) |
STRTAB_STE_0_CFG_S1_TRANS;
--
Qualcomm Datacenter Technologies, Inc. on behalf of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux
Foundation Collaborative Project.
^ permalink raw reply related
* [PATCH] iommu/arm-smmu-v3: avoid over allocating for l2 stream tables
From: Nate Watterson @ 2016-12-19 20:26 UTC (permalink / raw)
To: linux-arm-kernel
Currently, all l2 stream tables are being allocated with space for
(1<<split) stes without regard to the number of sid bits the smmu
physically supports. To avoid allocating memory for inaccessible
stes, this patch limits the span of an l2 table to be no larger
than the sid size of the smmu to which it belongs.
Signed-off-by: Nate Watterson <nwatters@codeaurora.org>
---
drivers/iommu/arm-smmu-v3.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/iommu/arm-smmu-v3.c b/drivers/iommu/arm-smmu-v3.c
index 4d6ec44..5dca671 100644
--- a/drivers/iommu/arm-smmu-v3.c
+++ b/drivers/iommu/arm-smmu-v3.c
@@ -1129,6 +1129,7 @@ static void arm_smmu_init_bypass_stes(u64 *strtab, unsigned int nent)
static int arm_smmu_init_l2_strtab(struct arm_smmu_device *smmu, u32 sid)
{
+ u8 span;
size_t size;
void *strtab;
struct arm_smmu_strtab_cfg *cfg = &smmu->strtab_cfg;
@@ -1137,10 +1138,11 @@ static int arm_smmu_init_l2_strtab(struct arm_smmu_device *smmu, u32 sid)
if (desc->l2ptr)
return 0;
- size = 1 << (STRTAB_SPLIT + ilog2(STRTAB_STE_DWORDS) + 3);
+ span = (smmu->sid_bits < STRTAB_SPLIT) ? smmu->sid_bits : STRTAB_SPLIT;
+ size = 1 << (span + ilog2(STRTAB_STE_DWORDS) + 3);
strtab = &cfg->strtab[(sid >> STRTAB_SPLIT) * STRTAB_L1_DESC_DWORDS];
- desc->span = STRTAB_SPLIT + 1;
+ desc->span = span + 1;
desc->l2ptr = dmam_alloc_coherent(smmu->dev, size, &desc->l2ptr_dma,
GFP_KERNEL | __GFP_ZERO);
if (!desc->l2ptr) {
@@ -1150,7 +1152,7 @@ static int arm_smmu_init_l2_strtab(struct arm_smmu_device *smmu, u32 sid)
return -ENOMEM;
}
- arm_smmu_init_bypass_stes(desc->l2ptr, 1 << STRTAB_SPLIT);
+ arm_smmu_init_bypass_stes(desc->l2ptr, 1 << span);
arm_smmu_write_strtab_l1_desc(strtab, desc);
return 0;
}
@@ -2001,6 +2003,8 @@ static int arm_smmu_init_strtab_2lvl(struct arm_smmu_device *smmu)
dev_warn(smmu->dev,
"2-level strtab only covers %u/%u bits of SID\n",
size, smmu->sid_bits);
+ else if (smmu->sid_bits < size)
+ size = smmu->sid_bits;
l1size = cfg->num_l1_ents * (STRTAB_L1_DESC_DWORDS << 3);
strtab = dmam_alloc_coherent(smmu->dev, l1size, &cfg->strtab_dma,
--
Qualcomm Datacenter Technologies, Inc. on behalf of Qualcomm Technologies, Inc.
Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux
Foundation Collaborative Project.
^ permalink raw reply related
* [PATCH v10 0/8] power: add power sequence library
From: Krzysztof Kozlowski @ 2016-12-19 19:15 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1479087359-7547-1-git-send-email-peter.chen@nxp.com>
On Mon, Nov 14, 2016 at 09:35:51AM +0800, Peter Chen wrote:
> Hi all,
>
> This is a follow-up for my last power sequence framework patch set [1].
> According to Rob Herring and Ulf Hansson's comments[2]. The kinds of
> power sequence instances will be added at postcore_initcall, the match
> criteria is compatible string first, if the compatible string is not
> matched between dts and library, it will try to use generic power sequence.
>
> The host driver just needs to call of_pwrseq_on/of_pwrseq_off
> if only one power sequence instance is needed, for more power sequences
> are used, using of_pwrseq_on_list/of_pwrseq_off_list instead (eg, USB hub driver).
>
> In future, if there are special power sequence requirements, the special
> power sequence library can be created.
>
> This patch set is tested on i.mx6 sabresx evk using a dts change, I use
> two hot-plug devices to simulate this use case, the related binding
> change is updated at patch [1/6], The udoo board changes were tested
> using my last power sequence patch set.[3]
>
> Except for hard-wired MMC and USB devices, I find the USB ULPI PHY also
> need to power on itself before it can be found by ULPI bus.
>
> [1] http://www.spinics.net/lists/linux-usb/msg142755.html
> [2] http://www.spinics.net/lists/linux-usb/msg143106.html
> [3] http://www.spinics.net/lists/linux-usb/msg142815.html
>
> Changes for v10:
> - Improve the kernel-doc for power sequence core, including exported APIs and
> main structure. [Patch 2/8]
> - Change Kconfig, and let the user choose power sequence. [Patch 2/8]
> - Delete EXPORT_SYMBOL and change related APIs as local, these APIs do not
> be intended to export currently. [Patch 2/8]
> - Selete POWER_SEQUENCE at USB core's Kconfig. [Patch 4/8]
Hi Peter,
It is great that you continued the work on this.
I saw (in some previous mails) your repo mentioned:
https://git.kernel.org/cgit/linux/kernel/git/peter.chen/usb.git/
Does it contain the recent version of this patchset?
I want to build on top of it fixes for usb3503 on Odroid U3 board.
Best regards,
Krzysztof
>
> Changes for v9:
> - Add Vaibhav Hiremath's reviewed-by [Patch 4/8]
> - Rebase to v4.9-rc1
>
> Changes for v8:
> - Allocate one extra pwrseq instance if pwrseq_get has succeed, it can avoid
> preallocate instances problem which the number of instance is decided at
> compile time, thanks for Heiko Stuebner's suggestion [Patch 2/8]
> - Delete pwrseq_compatible_sample.c which is the demo purpose to show compatible
> match method. [Patch 2/8]
> - Add Maciej S. Szmigiero's tested-by. [Patch 7/8]
>
> Changes for v7:
> - Create kinds of power sequence instance at postcore_initcall, and match
> the instance with node using compatible string, the beneit of this is
> the host driver doesn't need to consider which pwrseq instance needs
> to be used, and pwrseq core will match it, however, it eats some memories
> if less power sequence instances are used. [Patch 2/8]
> - Add pwrseq_compatible_sample.c to test match pwrseq using device_id. [Patch 2/8]
> - Fix the comments Vaibhav Hiremath adds for error path for clock and do not
> use device_node for parameters at pwrseq_on. [Patch 2/8]
> - Simplify the caller to use power sequence, follows Alan's commnets [Patch 4/8]
> - Tested three pwrseq instances together using both specific compatible string and
> generic libraries.
>
> Changes for v6:
> - Add Matthias Kaehlcke's Reviewed-by and Tested-by. (patch [2/6])
> - Change chipidea core of_node assignment for coming user. (patch [5/6])
> - Applies Joshua Clayton's three dts changes for two boards,
> the USB device's reg has only #address-cells, but without #size-cells.
>
> Changes for v5:
> - Delete pwrseq_register/pwrseq_unregister, which is useless currently
> - Fix the linker error when the pwrseq user is compiled as module
>
> Changes for v4:
> - Create the patch on next-20160722
> - Fix the of_node is not NULL after chipidea driver is unbinded [Patch 5/6]
> - Using more friendly wait method for reset gpio [Patch 2/6]
> - Support multiple input clocks [Patch 2/6]
> - Add Rob Herring's ack for DT changes
> - Add Joshua Clayton's Tested-by
>
> Changes for v3:
> - Delete "power-sequence" property at binding-doc, and change related code
> at both library and user code.
> - Change binding-doc example node name with Rob's comments
> - of_get_named_gpio_flags only gets the gpio, but without setting gpio flags,
> add additional code request gpio with proper gpio flags
> - Add Philipp Zabel's Ack and MAINTAINER's entry
>
> Changes for v2:
> - Delete "pwrseq" prefix and clock-names for properties at dt binding
> - Should use structure not but its pointer for kzalloc
> - Since chipidea core has no of_node, let core's of_node equals glue
> layer's at core's probe
>
> Joshua Clayton (2):
> ARM: dts: imx6qdl: Enable usb node children with <reg>
> ARM: dts: imx6q-evi: Fix onboard hub reset line
>
> Peter Chen (6):
> binding-doc: power: pwrseq-generic: add binding doc for generic power
> sequence library
> power: add power sequence library
> binding-doc: usb: usb-device: add optional properties for power
> sequence
> usb: core: add power sequence handling for USB devices
> usb: chipidea: let chipidea core device of_node equal's glue layer
> device of_node
> ARM: dts: imx6qdl-udoo.dtsi: fix onboard USB HUB property
>
> .../bindings/power/pwrseq/pwrseq-generic.txt | 48 +++++
> .../devicetree/bindings/usb/usb-device.txt | 10 +-
> MAINTAINERS | 9 +
> arch/arm/boot/dts/imx6q-evi.dts | 25 +--
> arch/arm/boot/dts/imx6qdl-udoo.dtsi | 26 ++-
> arch/arm/boot/dts/imx6qdl.dtsi | 6 +
> drivers/power/Kconfig | 1 +
> drivers/power/Makefile | 1 +
> drivers/power/pwrseq/Kconfig | 21 ++
> drivers/power/pwrseq/Makefile | 2 +
> drivers/power/pwrseq/core.c | 237 +++++++++++++++++++++
> drivers/power/pwrseq/pwrseq_generic.c | 183 ++++++++++++++++
> drivers/usb/Kconfig | 1 +
> drivers/usb/chipidea/core.c | 27 ++-
> drivers/usb/core/hub.c | 41 +++-
> drivers/usb/core/hub.h | 1 +
> include/linux/power/pwrseq.h | 60 ++++++
> 17 files changed, 658 insertions(+), 41 deletions(-)
> create mode 100644 Documentation/devicetree/bindings/power/pwrseq/pwrseq-generic.txt
> create mode 100644 drivers/power/pwrseq/Kconfig
> create mode 100644 drivers/power/pwrseq/Makefile
> create mode 100644 drivers/power/pwrseq/core.c
> create mode 100644 drivers/power/pwrseq/pwrseq_generic.c
> create mode 100644 include/linux/power/pwrseq.h
>
> --
> 2.7.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe devicetree" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* [PATCH pci/host-iproc] PCI: iproc: Allow more than slot 0 on PAXC
From: Ray Jui @ 2016-12-19 18:54 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1481232618-10614-1-git-send-email-gospo@broadcom.com>
On 12/8/2016 1:30 PM, Andy Gospodarek wrote:
> The iproc host driver limits the number of slots that are available on
> PAXC devices. Enforcing this limit prevents VFs from being created
> beyond the first port. After this change it is possible to create VFs
> associated with all four devices.
>
> The first four devices below are the PFs and the next four are the newly
> created VFs:
>
> 0008:01:00.0 Ethernet controller: Broadcom Limited Device 16cd
> 0008:01:00.1 Ethernet controller: Broadcom Limited Device 16cd
> 0008:01:00.2 Ethernet controller: Broadcom Limited Device 16cd
> 0008:01:00.3 Ethernet controller: Broadcom Limited Device 16cd
> 0008:01:00.4 Ethernet controller: Broadcom Limited BCM57304 NetXtreme-C Ethernet Virtual Function
> 0008:01:01.0 Ethernet controller: Broadcom Limited BCM57304 NetXtreme-C Ethernet Virtual Function
> 0008:01:01.4 Ethernet controller: Broadcom Limited BCM57304 NetXtreme-C Ethernet Virtual Function
> 0008:01:02.0 Ethernet controller: Broadcom Limited BCM57304 NetXtreme-C Ethernet Virtual Function
>
> Based on the git history around 923c6bb1f641 ("PCI: iproc: Allow multiple
> devices except on PAXC") and 943ebae781f5 ("PCI: iproc: Add PAXC interface
> support") I expect there may be an unmentioned or unknown-to-me reason why this
> code exists. I certainly cannot create and use VFs without some kind of change
> around this space, so I would like to see the current limitation simply removed.
>
> Fixes: 923c6bb1f641 ("PCI: iproc: Allow multiple devices except on PAXC")
> Signed-off-by: Andy Gospodarek <gospo@broadcom.com>
> ---
> drivers/pci/host/pcie-iproc.c | 8 --------
> 1 file changed, 8 deletions(-)
>
> diff --git a/drivers/pci/host/pcie-iproc.c b/drivers/pci/host/pcie-iproc.c
> index 3ebc025..9311826 100644
> --- a/drivers/pci/host/pcie-iproc.c
> +++ b/drivers/pci/host/pcie-iproc.c
> @@ -477,14 +477,6 @@ static void __iomem *iproc_pcie_map_cfg_bus(struct pci_bus *bus,
> return (pcie->base + offset);
> }
>
> - /*
> - * PAXC is connected to an internally emulated EP within the SoC. It
> - * allows only one device.
> - */
> - if (pcie->ep_is_internal)
> - if (slot > 0)
> - return NULL;
> -
> /* EP device access */
> val = (busno << CFG_ADDR_BUS_NUM_SHIFT) |
> (slot << CFG_ADDR_DEV_NUM_SHIFT) |
>
With this change, standard v4.9 kernel would crash on a NS2 SVK with the
log shown below. This is inline with my previous observation and
therefore slot number has been limited to only zero for the PAXC
interface. Does it require more than just this change in order for the
kernel to boot to complete?
[ 2.190515] OF: PCI: host bridge /pcie at 60c00000 ranges:
[ 2.196400] OF: PCI: MEM 0x60000000..0x60bfffff -> 0x00000000
[ 2.203135] iproc-pcie 60c00000.pcie: PCI host bridge to bus 0008:00
[ 2.210289] pci_bus 0008:00: root bus resource [bus 00-01]
[ 2.216349] pci_bus 0008:00: root bus resource [mem
0x60000000-0x60bfffff] (bus address [0x00000000-0x00bfffff])
[ 2.227769] iproc-pcie 60c00000.pcie: not using iProc MSI
[ 2.234050] pci 0008:00:00.0: bridge configuration invalid ([bus
00-00]), reconfiguring
[ 2.244285] Bad mode in Error handler detected on CPU1, code
0xbf000002 -- SError
[ 2.252661] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 4.9.0+ #24
[ 2.259430] Hardware name: Broadcom NS2 SVK (DT)
[ 2.264550] task: ffff8000fb488000 task.stack: ffff8000fb490000
[ 2.271161] PC is at pci_generic_config_read32+0x74/0xa0
[ 2.277043] LR is at pci_generic_config_read32+0x28/0xa0
[ 2.283005] pc : [<ffff00000839d984>] lr : [<ffff00000839d938>]
pstate: 200000c5
[ 2.291225] sp : ffff8000fb4937f0
[ 2.294937] x29: ffff8000fb4937f0 x28: ffff8000fadb9000
[ 2.300884] x27: ffff8000faf27098 x26: 0000000000000000
[ 2.306803] x25: 0000000000000000 x24: ffff8000fadb9400
[ 2.312757] x23: 0000000000000040 x22: ffff0000089c55d8
[ 2.318730] x21: 0000000000000010 x20: ffff8000fb49391c
[ 2.324666] x19: 0000000000000000 x18: 000000000000077f
[ 2.330594] x17: ffffffffffffffff x16: ffff000008a49fff
[ 2.336539] x15: ffff000008a49fff x14: 0000000000000000
[ 2.342502] x13: 0000000000000007 x12: 0000000000000018
[ 2.348456] x11: 0101010101010101 x10: 7f7f7f7f7f7f7f7f
[ 2.354392] x9 : 0000000000000000 x8 : ffff8000fa80e680
[ 2.360355] x7 : 000000000000ffff x6 : ffff8000faf0ca98
[ 2.366300] x5 : 0000000000000002 x4 : ffff8000fb49389c
[ 2.372290] x3 : 0000000000000004 x2 : 0000000000100001
[ 2.378209] x1 : ffff000008a49000 x0 : 0000000000000000
[ 2.384145]
[ 2.385807] Internal error: Oops - bad mode: 0 [#1] PREEMPT SMP
[ 2.392351] Modules linked in:
[ 2.395770] CPU: 1 PID: 1 Comm: swapper/0 Not tainted 4.9.0+ #24
[ 2.402529] Hardware name: Broadcom NS2 SVK (DT)
[ 2.407693] task: ffff8000fb488000 task.stack: ffff8000fb490000
[ 2.414301] PC is at pci_generic_config_read32+0x74/0xa0
[ 2.420299] LR is at pci_generic_config_read32+0x28/0xa0
[ 2.426279] pc : [<ffff00000839d984>] lr : [<ffff00000839d938>]
pstate: 200000c5
[ 2.434552] sp : ffff8000fb4937f0
[ 2.438246] x29: ffff8000fb4937f0 x28: ffff8000fadb9000
[ 2.444209] x27: ffff8000faf27098 x26: 0000000000000000
[ 2.450137] x25: 0000000000000000 x24: ffff8000fadb9400
[ 2.456091] x23: 0000000000000040 x22: ffff0000089c55d8
[ 2.462037] x21: 0000000000000010 x20: ffff8000fb49391c
[ 2.467947] x19: 0000000000000000 x18: 000000000000077f
[ 2.473945] x17: ffffffffffffffff x16: ffff000008a49fff
[ 2.479881] x15: ffff000008a49fff x14: 0000000000000000
[ 2.485826] x13: 0000000000000007 x12: 0000000000000018
[ 2.491798] x11: 0101010101010101 x10: 7f7f7f7f7f7f7f7f
[ 2.497752] x9 : 0000000000000000 x8 : ffff8000fa80e680
[ 2.503689] x7 : 000000000000ffff x6 : ffff8000faf0ca98
[ 2.509643] x5 : 0000000000000002 x4 : ffff8000fb49389c
[ 2.515561] x3 : 0000000000000004 x2 : 0000000000100001
[ 2.521453] x1 : ffff000008a49000 x0 : 0000000000000000
[ 2.527388]
[ 2.529058] Process swapper/0 (pid: 1, stack limit = 0xffff8000fb490020)
[ 2.536607] Stack: (0xffff8000fb4937f0 to 0xffff8000fb494000)
[ 2.543044] 37e0: ffff8000fb493820
ffff0000083b65cc
[ 2.551830] 3800: ffff8000fadb9400 ffff00000867606c 0000000000000004
ffff8000fb49389c
[ 2.560481] 3820: ffff8000fb493840 ffff00000839dcc8 ffff8000fadb9400
ffff00000839dce0
[ 2.569158] 3840: ffff8000fb4938a0 ffff00000839fcb8 0000000000000000
ffff8000fb49391c
[ 2.577915] 3860: 000000000000ea60 0000000000000001 0000000000000010
0000000000000000
[ 2.586718] 3880: ffff8000faef9000 0000000000000000 ffff8000fb4938b0
00000000083a94d8
[ 2.595548] 38a0: ffff8000fb4938e0 ffff0000083a1380 0000000000000000
ffff8000fadb9400
[ 2.604359] 38c0: 0000000000000010 0000000000000001 ffff0000087fb000
ffff8000fadb9528
[ 2.613180] 38e0: ffff8000fb493920 ffff0000083a1444 ffff8000fadb9400
ffff8000fadb9400
[ 2.621938] 3900: 0000000000000010 0000000000000004 ffff8000fb493960
fffffffffb493960
[ 2.630767] 3920: ffff8000fb493960 ffff0000083a237c 0000000000000018
ffff8000fadb9400
[ 2.639543] 3940: 0000000000000001 0000000000000000 ffff8000fadb9000
0000000000000007
[ 2.648355] 3960: ffff8000fb4939b0 ffff0000083a20d8 ffff8000faf27000
ffff8000fadb9400
[ 2.657166] 3980: 0000000000000001 0000000000000000 0000000000000000
0000000000000001
[ 2.665960] 39a0: 0000000000000000 0000000000000018 ffff8000fb493a30
ffff0000083a23d8
[ 2.674789] 39c0: ffff8000faf27000 ffff8000fadb9000 ffff8000fadb9028
0000000000000000
[ 2.683547] 39e0: ffff0000087fb000 ffff8000fadb9128 0000000000000001
ffff0000088c0460
[ 2.692341] 3a00: ffff0000089a4000 ffff0000088f8b60 ffff8000fb49396c
0000000000000000
[ 2.701117] 3a20: 0000000000000000 00ff010000000000 ffff8000fb493a80
ffff0000083b731c
[ 2.709910] 3a40: ffff8000faf0e218 ffff8000fffe7748 ffff8000fb63f410
ffff8000fadb9000
[ 2.718695] 3a60: ffff0000086e9000 ffff8000fffe1e00 ffff0000088f8bc0
6c6071652c6c3175
[ 2.727489] 3a80: ffff8000fb493bc0 ffff0000083b8774 0000000000000000
ffff8000faf0e218
[ 2.736291] 3aa0: ffff8000fb63f410 ffff8000fb493c10 ffff8000fffe1e00
ffff8000fb63f400
[ 2.745058] 3ac0: ffff0000088f8bc0 ffff0000088c0460 ffff0000089a4000
ffff0000088f8b60
[ 2.753816] 3ae0: ffff8000fb493b20 ffff00000858b7b0 ffff8000fb493c08
ffff000008855f08
[ 2.762583] 3b00: ffff0000089b6000 ffff8000fb493c10 ffff8000fffe1e00
0000000060000000
[ 2.771376] 3b20: ffff8000fb493bc0 ffff0000083b8744 0000000000000000
ffff8000faf0e218
[ 2.780125] 3b40: ffff8000fb63f410 ffff8000fb493c10 ffff8000fffe1e00
ffff8000fb63f400
[ 2.788937] 3b60: ffff8000fffe1e00 0000000000000000 ffff0000004d454d
0000000200000007
[ 2.797731] 3b80: ffff7dfffe8009dc ffff7dfffe8009dc 0000000200000007
ffff000000000083
[ 2.806533] 3ba0: 0000000000000000 0000000060000000 0000000000c00000
0000000000000200
[ 2.815372] 3bc0: ffff8000fb493c60 ffff000008414ef8 ffff000008962258
ffff8000fb63f410
[ 2.824121] 3be0: 0000000000000000 ffff000008962280 0000000000000000
ffff0000089a4000
[ 2.832950] 3c00: ffff8000fb493c40 ffffffffffffffff ffff8000fb493c10
ffff8000fb493c10
[ 2.841717] 3c20: 0000000060c00000 0000000060c00fff ffff8000fffe1ea8
0000000000000200
[ 2.850529] 3c40: 0000000000000000 0000000000000000 0000000000000000
0000000000000000
[ 2.859358] 3c60: ffff8000fb493c80 ffff000008413688 ffff8000fb63f410
ffff0000089c8000
[ 2.868161] 3c80: ffff8000fb493cc0 ffff0000084137c0 ffff8000fb63f410
ffff000008962280
[ 2.876919] 3ca0: ffff8000fb63f470 ffff00000896cd30 ffff00000896c000
ffff00000841190c
[ 2.885677] 3cc0: ffff8000fb493cf0 ffff000008411900 0000000000000000
ffff000008962280
[ 2.894497] 3ce0: ffff000008413720 ffff8000fb493d40 ffff8000fb493d30
ffff000008413124
[ 2.903308] 3d00: ffff000008962280 ffff8000faf0e100 0000000000000000
ffff00000867606c
[ 2.912058] 3d20: ffff8000fb43eca8 ffff8000fb625b68 ffff8000fb493d40
ffff000008412d84
[ 2.920815] 3d40: ffff8000fb493d80 ffff000008413eb4 ffff000008962280
ffff0000088e1438
[ 2.929591] 3d60: 0000000000000000 ffff0000088f8b30 ffff0000088aba00
ffff0000089c5000
[ 2.938358] 3d80: ffff8000fb493db0 ffff000008414eb8 ffff8000fb490000
ffff0000088e1438
[ 2.947134] 3da0: 0000000000000000 0000000000000000 ffff8000fb493dc0
ffff0000088e1450
[ 2.955936] 3dc0: ffff8000fb493dd0 ffff000008083144 ffff8000fb493e40
ffff0000088c0c98
[ 2.964658] 3de0: ffff000008907240 0000000000000006 00000000000000e7
ffff0000088f8b30
[ 2.973506] 3e00: ffff8000fb493e00 ffff0000087f42c8 ffff8000fb493e20
ffff0000087f3ae8
[ 2.982326] 3e20: 0000000600000006 0000000000000000 0000000000000000
ffff0000088aba00
[ 2.991129] 3e40: ffff8000fb493ea0 ffff000008678154 ffff000008678144
0000000000000000
[ 2.999922] 3e60: 0000000000000000 0000000000000000 0000000000000000
0000000000000000
[ 3.008671] 3e80: 0000000000000000 0000000000000000 0000000000000000
0000000000000000
[ 3.017500] 3ea0: 0000000000000000 ffff000008082e80 ffff000008678144
0000000000000000
[ 3.026294] 3ec0: 0000000000000000 0000000000000000 0000000000000000
0000000000000000
[ 3.035043] 3ee0: 0000000000000000 0000000000000000 0000000000000000
0000000000000000
[ 3.043818] 3f00: 0000000000000000 0000000000000000 0000000000000000
0000000000000000
[ 3.052639] 3f20: 0000000000000000 0000000000000000 0000000000000000
0000000000000000
[ 3.061432] 3f40: 0000000000000000 0000000000000000 0000000000000000
0000000000000000
[ 3.070207] 3f60: 0000000000000000 0000000000000000 0000000000000000
0000000000000000
[ 3.079036] 3f80: 0000000000000000 0000000000000000 0000000000000000
0000000000000000
[ 3.087820] 3fa0: 0000000000000000 0000000000000000 0000000000000000
0000000000000000
[ 3.096623] 3fc0: 0000000000000000 0000000000000005 0000000000000000
0000000000000000
[ 3.105398] 3fe0: 0000000000000000 0000000000000000 000000017b493ff0
000000017b493ff8
[ 3.114173] Call trace:
[ 3.116920] [<ffff00000839d984>] pci_generic_config_read32+0x74/0xa0
[ 3.124039] [<ffff0000083b65cc>] iproc_pcie_config_read32+0x2c/0xe0
[ 3.131041] [<ffff00000839dcc8>] pci_bus_read_config_dword+0x80/0xb0
[ 3.138143] [<ffff00000839fcb8>] pci_bus_read_dev_vendor_id+0x30/0x104
[ 3.145459] [<ffff0000083a1380>] pci_scan_single_device+0x50/0xc4
[ 3.152345] [<ffff0000083a1444>] pci_scan_slot+0x50/0xf0
[ 3.158334] [<ffff0000083a237c>] pci_scan_child_bus+0x50/0x164
[ 3.164798] [<ffff0000083a20d8>] pci_scan_bridge+0x2c0/0x514
[ 3.171154] [<ffff0000083a23d8>] pci_scan_child_bus+0xac/0x164
[ 3.177690] [<ffff0000083b731c>] iproc_pcie_setup+0x71c/0xc78
[ 3.184172] [<ffff0000083b8774>] iproc_pcie_pltfm_probe+0x170/0x260
[ 3.191176] [<ffff000008414ef8>] platform_drv_probe+0x38/0x7c
[ 3.197640] [<ffff000008413688>] really_probe+0x1b0/0x248
[ 3.203701] [<ffff0000084137c0>] __driver_attach+0xa0/0xb0
[ 3.209878] [<ffff000008411900>] bus_for_each_dev+0x58/0x98
[ 3.216110] [<ffff000008413124>] driver_attach+0x20/0x28
[ 3.222063] [<ffff000008412d84>] bus_add_driver+0x1c8/0x22c
[ 3.228285] [<ffff000008413eb4>] driver_register+0x68/0x108
[ 3.234517] [<ffff000008414eb8>] __platform_driver_register+0x4c/0x54
[ 3.241772] [<ffff0000088e1450>] iproc_pcie_pltfm_driver_init+0x18/0x20
[ 3.249224] [<ffff000008083144>] do_one_initcall+0x38/0x128
[ 3.255466] [<ffff0000088c0c98>] kernel_init_freeable+0x14c/0x1ec
[ 3.262344] [<ffff000008678154>] kernel_init+0x10/0xfc
[ 3.268118] [<ffff000008082e80>] ret_from_fork+0x10/0x50
[ 3.274108] Code: 52800000 f9400bf3 a8c37bfd d65f03c0 (b9000080)
[ 3.280984] ---[ end trace d90bb74924ac9e8e ]---
[ 3.286202] note: swapper/0[1] exited with preempt_count 1
[ 3.292340] Kernel panic - not syncing: Attempted to kill init!
exitcode=0x0000000b
[ 3.292340]
^ permalink raw reply
* [PATCH v8 04/16] MSI-X: update GSI routing after changed MSI-X configuration
From: Andre Przywara @ 2016-12-19 18:44 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <da4e554a-ebd1-fa59-3e94-0e0190ddade3@arm.com>
Hi,
On 09/12/16 17:13, Marc Zyngier wrote:
> On 04/11/16 17:31, Andre Przywara wrote:
>> When we set up GSI routing to map MSIs to KVM's GSI numbers, we
>> write the current device's MSI setup into the kernel routing table.
>> However the device driver in the guest can use PCI configuration space
>> accesses to change the MSI configuration (address and/or payload data).
>> Whenever this happens after we have setup the routing table already,
>> we must amend the previously sent data.
>> So when MSI-X PCI config space accesses write address or payload,
>> find the associated GSI number and the matching routing table entry
>> and update the kernel routing table (only if the data has changed).
>>
>> This fixes vhost-net, where the queue's IRQFD was setup before the
>> MSI vectors.
>>
>> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
>> ---
>> include/kvm/irq.h | 1 +
>> irq.c | 31 +++++++++++++++++++++++++++++++
>> virtio/pci.c | 36 +++++++++++++++++++++++++++++++++---
>> 3 files changed, 65 insertions(+), 3 deletions(-)
>>
>> diff --git a/include/kvm/irq.h b/include/kvm/irq.h
>> index bb71521..f35eb7e 100644
>> --- a/include/kvm/irq.h
>> +++ b/include/kvm/irq.h
>> @@ -21,5 +21,6 @@ int irq__exit(struct kvm *kvm);
>>
>> int irq__allocate_routing_entry(void);
>> int irq__add_msix_route(struct kvm *kvm, struct msi_msg *msg);
>> +void irq__update_msix_route(struct kvm *kvm, u32 gsi, struct msi_msg *msg);
>>
>> #endif
>> diff --git a/irq.c b/irq.c
>> index a742aa2..895e5eb 100644
>> --- a/irq.c
>> +++ b/irq.c
>> @@ -93,6 +93,37 @@ int irq__add_msix_route(struct kvm *kvm, struct msi_msg *msg)
>> return next_gsi++;
>> }
>>
>> +static bool update_data(u32 *ptr, u32 newdata)
>> +{
>> + if (*ptr == newdata)
>> + return false;
>> +
>> + *ptr = newdata;
>> + return true;
>> +}
>> +
>> +void irq__update_msix_route(struct kvm *kvm, u32 gsi, struct msi_msg *msg)
>> +{
>> + struct kvm_irq_routing_msi *entry;
>> + unsigned int i;
>> + bool changed;
>> +
>> + for (i = 0; i < irq_routing->nr; i++)
>> + if (gsi == irq_routing->entries[i].gsi)
>> + break;
>> + if (i == irq_routing->nr)
>> + return;
>> +
>> + entry = &irq_routing->entries[i].u.msi;
>> +
>> + changed = update_data(&entry->address_hi, msg->address_hi);
>> + changed |= update_data(&entry->address_lo, msg->address_lo);
>> + changed |= update_data(&entry->data, msg->data);
>> +
>> + if (changed)
>> + ioctl(kvm->vm_fd, KVM_SET_GSI_ROUTING, irq_routing);
>
> Check the return value and let the caller know if something has failed?
As the caller is a void function and the call chain for this originates
in an MMIO access triggered by the guest (update MSI information in the
PCI config space), I guess again die() would be the appropriate action here?
>
>> +}
>> +
>> int __attribute__((weak)) irq__exit(struct kvm *kvm)
>> {
>> free(irq_routing);
>> diff --git a/virtio/pci.c b/virtio/pci.c
>> index 072e5b7..b3b4aac 100644
>> --- a/virtio/pci.c
>> +++ b/virtio/pci.c
>> @@ -152,6 +152,30 @@ static bool virtio_pci__io_in(struct ioport *ioport, struct kvm_cpu *vcpu, u16 p
>> return ret;
>> }
>>
>> +static void update_msix_map(struct virtio_pci *vpci,
>> + struct msix_table *msix_entry, u32 vecnum)
>> +{
>> + u32 gsi, i;
>> +
>> + /* Find the GSI number used for that vector */
>> + if (vecnum == vpci->config_vector) {
>> + gsi = vpci->config_gsi;
>> + } else {
>> + for (i = 0; i < VIRTIO_PCI_MAX_VQ; i++)
>> + if (vpci->vq_vector[i] == vecnum)
>> + break;
>> + if (i == VIRTIO_PCI_MAX_VQ)
>> + return;
>> + gsi = vpci->gsis[i];
>> + }
>> +
>> + if (gsi == 0)
>> + return;
>> +
>> + msix_entry = &msix_entry[vecnum];
>> + irq__update_msix_route(vpci->kvm, gsi, &msix_entry->msg);
>> +}
>> +
>> static bool virtio_pci__specific_io_out(struct kvm *kvm, struct virtio_device *vdev, u16 port,
>> void *data, int size, int offset)
>> {
>> @@ -270,10 +294,16 @@ static void virtio_pci__msix_mmio_callback(struct kvm_cpu *vcpu,
>> offset = vpci->msix_io_block;
>> }
>>
>> - if (is_write)
>> - memcpy(table + addr - offset, data, len);
>> - else
>> + if (!is_write) {
>> memcpy(data, table + addr - offset, len);
>> + return;
>> + }
>> +
>> + memcpy(table + addr - offset, data, len);
>> +
>> + /* Did we just update the address or payload? */
>> + if (addr % 0x10 < 0xc)
>> + update_msix_map(vpci, table, (addr - offset) / 16);
>
> Where are these constants coming from? Please stick to either decimal or
> hex...
Sure, seems to be a leftover from my initial hacking approach. Thanks
for spotting that.
Cheers,
Andre.
>
>> }
>>
>> static void virtio_pci__signal_msi(struct kvm *kvm, struct virtio_pci *vpci, int vec)
>>
>
> Thanks,
>
> M.
>
^ permalink raw reply
* [PATCH v8 01/16] FDT: introduce global phandle allocation
From: Andre Przywara @ 2016-12-19 18:43 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <d1dc4e68-66e1-85d1-f5d1-5743e5172409@arm.com>
Hi Marc,
On 09/12/16 12:03, Marc Zyngier wrote:
> On 04/11/16 17:31, Andre Przywara wrote:
>> Allocating an FDT phandle (a unique identifier) using a static
>> variable in a static inline function defined in a header file works
>> only if all users are in the same source file. So trying to allocate
>> a handle from two different compilation units fails.
>> Introduce global phandle allocation and reference code to properly
>> allocate unique phandles.
>>
>> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
>> ---
>> Makefile | 1 +
>> arm/fdt.c | 2 +-
>> arm/gic.c | 2 +-
>> include/kvm/fdt.h | 10 +++++-----
>> kvm-fdt.c | 26 ++++++++++++++++++++++++++
>> 5 files changed, 34 insertions(+), 7 deletions(-)
>> create mode 100644 kvm-fdt.c
>>
>> diff --git a/Makefile b/Makefile
>> index 1f0196f..e4a4002 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -98,6 +98,7 @@ OBJS += kvm-ipc.o
>> OBJS += builtin-sandbox.o
>> OBJS += virtio/mmio.o
>> OBJS += hw/i8042.o
>> +OBJS += kvm-fdt.o
>>
>> # Translate uname -m into ARCH string
>> ARCH ?= $(shell uname -m | sed -e s/i.86/i386/ -e s/ppc.*/powerpc/ \
>> diff --git a/arm/fdt.c b/arm/fdt.c
>> index 381d48f..8bcfffb 100644
>> --- a/arm/fdt.c
>> +++ b/arm/fdt.c
>> @@ -114,7 +114,7 @@ static int setup_fdt(struct kvm *kvm)
>> {
>> struct device_header *dev_hdr;
>> u8 staging_fdt[FDT_MAX_SIZE];
>> - u32 gic_phandle = fdt__alloc_phandle();
>> + u32 gic_phandle = fdt__get_phandle(PHANDLE_GIC);
>> u64 mem_reg_prop[] = {
>> cpu_to_fdt64(kvm->arch.memory_guest_start),
>> cpu_to_fdt64(kvm->ram_size),
>> diff --git a/arm/gic.c b/arm/gic.c
>> index d6d6dd0..b60437e 100644
>> --- a/arm/gic.c
>> +++ b/arm/gic.c
>> @@ -222,7 +222,7 @@ void gic__generate_fdt_nodes(void *fdt, u32 phandle, enum irqchip_type type)
>> _FDT(fdt_property_cell(fdt, "#interrupt-cells", GIC_FDT_IRQ_NUM_CELLS));
>> _FDT(fdt_property(fdt, "interrupt-controller", NULL, 0));
>> _FDT(fdt_property(fdt, "reg", reg_prop, sizeof(reg_prop)));
>> - _FDT(fdt_property_cell(fdt, "phandle", phandle));
>> + _FDT(fdt_property_cell(fdt, "phandle", fdt__get_phandle(PHANDLE_GIC)));
>> _FDT(fdt_end_node(fdt));
>> }
>>
>> diff --git a/include/kvm/fdt.h b/include/kvm/fdt.h
>> index 53d85a4..cd2bb72 100644
>> --- a/include/kvm/fdt.h
>> +++ b/include/kvm/fdt.h
>> @@ -8,6 +8,10 @@
>> #include <linux/types.h>
>>
>> #define FDT_MAX_SIZE 0x10000
>> +#define FDT_INVALID_PHANDLE 0
>> +#define FDT_IS_VALID_PHANDLE(phandle) ((phandle) != FDT_INVALID_PHANDLE)
>> +
>> +enum phandles {PHANDLE_GIC, PHANDLES_MAX};
>
> Another nit here: PHANDLE_GIC is pretty much ARM-specific, while FDT is
> supposed to be generic. Can't we move the enum to be architecture
> specific and not put this in an architecture agnostic one?
Yes, that indeed makes sense.
This requires an include file for every architecture, but well ...
Cheers,
Andre.
^ permalink raw reply
* [PATCH v8 01/16] FDT: introduce global phandle allocation
From: Andre Przywara @ 2016-12-19 18:43 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <be44a9ad-f820-9a62-9a5d-682867674e91@arm.com>
Hi Marc,
On 09/12/16 11:55, Marc Zyngier wrote:
> Hi Andre,
>
> On 04/11/16 17:31, Andre Przywara wrote:
>> Allocating an FDT phandle (a unique identifier) using a static
>> variable in a static inline function defined in a header file works
>> only if all users are in the same source file. So trying to allocate
>> a handle from two different compilation units fails.
>> Introduce global phandle allocation and reference code to properly
>> allocate unique phandles.
>>
>> Signed-off-by: Andre Przywara <andre.przywara@arm.com>
>> ---
>> Makefile | 1 +
>> arm/fdt.c | 2 +-
>> arm/gic.c | 2 +-
>> include/kvm/fdt.h | 10 +++++-----
>> kvm-fdt.c | 26 ++++++++++++++++++++++++++
>> 5 files changed, 34 insertions(+), 7 deletions(-)
>> create mode 100644 kvm-fdt.c
>>
>> diff --git a/Makefile b/Makefile
>> index 1f0196f..e4a4002 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -98,6 +98,7 @@ OBJS += kvm-ipc.o
>> OBJS += builtin-sandbox.o
>> OBJS += virtio/mmio.o
>> OBJS += hw/i8042.o
>> +OBJS += kvm-fdt.o
>>
>> # Translate uname -m into ARCH string
>> ARCH ?= $(shell uname -m | sed -e s/i.86/i386/ -e s/ppc.*/powerpc/ \
>> diff --git a/arm/fdt.c b/arm/fdt.c
>> index 381d48f..8bcfffb 100644
>> --- a/arm/fdt.c
>> +++ b/arm/fdt.c
>> @@ -114,7 +114,7 @@ static int setup_fdt(struct kvm *kvm)
>> {
>> struct device_header *dev_hdr;
>> u8 staging_fdt[FDT_MAX_SIZE];
>> - u32 gic_phandle = fdt__alloc_phandle();
>> + u32 gic_phandle = fdt__get_phandle(PHANDLE_GIC);
>> u64 mem_reg_prop[] = {
>> cpu_to_fdt64(kvm->arch.memory_guest_start),
>> cpu_to_fdt64(kvm->ram_size),
>> diff --git a/arm/gic.c b/arm/gic.c
>> index d6d6dd0..b60437e 100644
>> --- a/arm/gic.c
>> +++ b/arm/gic.c
>> @@ -222,7 +222,7 @@ void gic__generate_fdt_nodes(void *fdt, u32 phandle, enum irqchip_type type)
>> _FDT(fdt_property_cell(fdt, "#interrupt-cells", GIC_FDT_IRQ_NUM_CELLS));
>> _FDT(fdt_property(fdt, "interrupt-controller", NULL, 0));
>> _FDT(fdt_property(fdt, "reg", reg_prop, sizeof(reg_prop)));
>> - _FDT(fdt_property_cell(fdt, "phandle", phandle));
>> + _FDT(fdt_property_cell(fdt, "phandle", fdt__get_phandle(PHANDLE_GIC)));
>> _FDT(fdt_end_node(fdt));
>> }
>>
>> diff --git a/include/kvm/fdt.h b/include/kvm/fdt.h
>> index 53d85a4..cd2bb72 100644
>> --- a/include/kvm/fdt.h
>> +++ b/include/kvm/fdt.h
>> @@ -8,6 +8,10 @@
>> #include <linux/types.h>
>>
>> #define FDT_MAX_SIZE 0x10000
>> +#define FDT_INVALID_PHANDLE 0
>> +#define FDT_IS_VALID_PHANDLE(phandle) ((phandle) != FDT_INVALID_PHANDLE)
>> +
>> +enum phandles {PHANDLE_GIC, PHANDLES_MAX};
>>
>> /* Those definitions are generic FDT values for specifying IRQ
>> * types and are used in the Linux kernel internally as well as in
>> @@ -33,10 +37,6 @@ enum irq_type {
>> } \
>> } while (0)
>>
>> -static inline u32 fdt__alloc_phandle(void)
>> -{
>> - static u32 phandle = 0;
>> - return ++phandle;
>> -}
>> +u32 fdt__get_phandle(enum phandles phandle);
>>
>> #endif /* KVM__FDT_H */
>> diff --git a/kvm-fdt.c b/kvm-fdt.c
>> new file mode 100644
>> index 0000000..d05f3fe
>> --- /dev/null
>> +++ b/kvm-fdt.c
>> @@ -0,0 +1,26 @@
>> +/*
>> + * Commonly used FDT functions.
>> + */
>> +
>> +#include <stdio.h>
>> +#include "kvm/fdt.h"
>> +#include "kvm/util.h"
>> +
>> +u32 phandles[PHANDLES_MAX] = {};
>
> It is a bit weird that you're initializing this to zero...
>
>> +u32 next_phandle = 1;
>> +
>> +u32 fdt__get_phandle(enum phandles phandle)
>> +{
>> + u32 ret;
>> +
>> + if (phandle >= PHANDLES_MAX)
>> + return FDT_INVALID_PHANDLE;
>> +
>> + ret = phandles[phandle];
>> + if (ret == FDT_INVALID_PHANDLE) {
>
> and yet test against a #define that isn't the initializer.
Well, yes. The problem is that AFAIK you cannot initialize an array
easily with all the values getting set to something other than zero.
So I could write
u32 phandles[PHANDLES_MAX] = {FDT_INVALID_PHANDLE};
above, but as that would only set the first member to
FDT_INVALID_PHANDLE (and all the others to 0), so it would rely on the
define actually being zero to work reliably. So my thought was to avoid
readers falling into this trap by not specifying the reset value
explicitly. Also that's the reason that 0 is the invalid value, which I
don't like too much, tbh.
So shall I make this a comment then?
Or do I miss something here?
> Also, given that fdt__get_phandle() can now fail by returning
> FDT_INVALID_HANDLE, maybe we should abort instead of returning something
> that is definitely wrong and use it blindly (which is going to be fun to
> debug...).
Yes, good point. Given that this hints at an internal error, die() seems
to be the appropriate action here.
Cheers,
Andre.
>
>
>> + ret = next_phandle++;
>> + phandles[phandle] = ret;
>> + }
>> +
>> + return ret;
>> +}
>>
>
> Thanks,
>
> M.
>
^ permalink raw reply
* [PATCH] ARM: dts: imx: Pass an empty 'chosen' node
From: Uwe Kleine-König @ 2016-12-19 18:41 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <1482161298-32624-1-git-send-email-fabio.estevam@nxp.com>
Hello,
On Mon, Dec 19, 2016 at 01:28:18PM -0200, Fabio Estevam wrote:
> Commit 7f107887d199 ("ARM: dts: imx: Remove skeleton.dtsi") causes boot
> issues when the bootloader does not create a 'chosen' node if such node
> is not present in the dtb.
>
> The reason for the boot failure is well explained by Javier Martinez
> Canillas: "the decompressor relies on a pre-existing chosen node to be
> available to insert the command line and merge other ATAGS info."
>
> , so pass an empty 'chosen' node to fix the boot problem.
>
> This issue has been seen in the kernelci reports with Barebox as
> bootloader.
wouldn't it be better to fix the decompressor code to eventually create
the /chosen node when it doesn't exist?
Best regards
Uwe
--
Pengutronix e.K. | Uwe Kleine-K?nig |
Industrial Linux Solutions | http://www.pengutronix.de/ |
^ permalink raw reply
* [PATCH v8 1/8] soc: samsung: add exynos chipid driver support
From: Krzysztof Kozlowski @ 2016-12-19 18:03 UTC (permalink / raw)
To: linux-arm-kernel
In-Reply-To: <9b64f5c0-e289-9091-c784-ae4bfad3caf5@samsung.com>
On Mon, Dec 19, 2016 at 3:29 PM, pankaj.dubey <pankaj.dubey@samsung.com> wrote:
>
> Hi Markus,
>
> On Monday 19 December 2016 05:29 PM, Markus Reichl wrote:
> > Hi Pankaj,
> >
> > tested your patches 1/8 and 2/8 + Javiers diff for verbose output:
> > https://www.spinics.net/lists/linux-samsung-soc/msg56576.html
> >
> > on Odroid U3:
> > [ 0.080178] Exynos: CPU[UNKNOWN] CPU_REV[0x20] PKG_ID[0x602d058] AUX_INFO[0x0]
> > on Odroid X:
> > [ 0.080169] Exynos: CPU[UNKNOWN] CPU_REV[0x11] PKG_ID[0x1b0f6008] AUX_INFO[0x0]
Hmm.... this needs fixes.
Best regards,
Krzysztof
^ permalink raw reply
* [PATCH] clocksource: arm_arch_timer: print timer value at init time
From: Olof Johansson @ 2016-12-19 17:47 UTC (permalink / raw)
To: linux-arm-kernel
This is useful to get an indication of how much time we spent in firmware.
It's not guaranteed that the timer started at 0 on reset, so it's just
an approximation, and might very well be invalid on some systems. But
it's still a useful metric to have access to.
Signed-off-by: Olof Johansson <olof@lixom.net>
---
drivers/clocksource/arm_arch_timer.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c
index 02fef68..c26078b 100644
--- a/drivers/clocksource/arm_arch_timer.c
+++ b/drivers/clocksource/arm_arch_timer.c
@@ -521,6 +521,8 @@ arch_timer_detect_rate(void __iomem *cntbase, struct device_node *np)
static void arch_timer_banner(unsigned type)
{
+ unsigned long cnt = arch_timer_read_counter();
+
pr_info("Architected %s%s%s timer(s) running at %lu.%02luMHz (%s%s%s).\n",
type & ARCH_CP15_TIMER ? "cp15" : "",
type == (ARCH_CP15_TIMER | ARCH_MEM_TIMER) ? " and " : "",
@@ -534,6 +536,8 @@ static void arch_timer_banner(unsigned type)
type & ARCH_MEM_TIMER ?
arch_timer_mem_use_virtual ? "virt" : "phys" :
"");
+ pr_info("Initial timer value: 0x%lx: %ld.%02lds\n",
+ cnt, cnt/arch_timer_rate, (cnt/(arch_timer_rate/100)) % 100);
}
u32 arch_timer_get_rate(void)
--
2.8.0.rc3.29.gb552ff8
^ permalink raw reply related
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