linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 3.16 074/202] MIPS: OCTEON: don't set octeon_dma_bar_type if PCI is disabled
       [not found] <lsq.1556377988.384060557@decadent.org.uk>
  2019-04-27 15:13 ` [PATCH 3.16 099/202] MIPS: Remove function size check in get_frame_info() Ben Hutchings
@ 2019-04-27 15:13 ` Ben Hutchings
  2019-04-27 15:13 ` [PATCH 3.16 029/202] Disable MSI also when pcie-octeon.pcie_disable on Ben Hutchings
  2 siblings, 0 replies; 3+ messages in thread
From: Ben Hutchings @ 2019-04-27 15:13 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: akpm, Denis Kirjanov, Paul Burton, linux-mips, Aaro Koskinen

3.16.66-rc1 review patch.  If anyone has any objections, please let me know.

------------------

From: Aaro Koskinen <aaro.koskinen@iki.fi>

commit dcf300a69ac307053dfb35c2e33972e754a98bce upstream.

Don't set octeon_dma_bar_type if PCI is disabled. This avoids creation
of the MSI irqchip later on, and saves a bit of memory.

Signed-off-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Paul Burton <paul.burton@mips.com>
Fixes: a214720cbf50 ("Disable MSI also when pcie-octeon.pcie_disable on")
Cc: linux-mips@vger.kernel.org
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 arch/mips/pci/pci-octeon.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

--- a/arch/mips/pci/pci-octeon.c
+++ b/arch/mips/pci/pci-octeon.c
@@ -575,6 +575,11 @@ static int __init octeon_pci_setup(void)
 	if (octeon_has_feature(OCTEON_FEATURE_PCIE))
 		return 0;
 
+	if (!octeon_is_pci_host()) {
+		pr_notice("Not in host mode, PCI Controller not initialized\n");
+		return 0;
+	}
+
 	/* Point pcibios_map_irq() to the PCI version of it */
 	octeon_pcibios_map_irq = octeon_pci_pcibios_map_irq;
 
@@ -586,11 +591,6 @@ static int __init octeon_pci_setup(void)
 	else
 		octeon_dma_bar_type = OCTEON_DMA_BAR_TYPE_BIG;
 
-	if (!octeon_is_pci_host()) {
-		pr_notice("Not in host mode, PCI Controller not initialized\n");
-		return 0;
-	}
-
 	/* PCI I/O and PCI MEM values */
 	set_io_port_base(OCTEON_PCI_IOSPACE_BASE);
 	ioport_resource.start = 0;


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 3.16 099/202] MIPS: Remove function size check in get_frame_info()
       [not found] <lsq.1556377988.384060557@decadent.org.uk>
@ 2019-04-27 15:13 ` Ben Hutchings
  2019-04-27 15:13 ` [PATCH 3.16 074/202] MIPS: OCTEON: don't set octeon_dma_bar_type if PCI is disabled Ben Hutchings
  2019-04-27 15:13 ` [PATCH 3.16 029/202] Disable MSI also when pcie-octeon.pcie_disable on Ben Hutchings
  2 siblings, 0 replies; 3+ messages in thread
From: Ben Hutchings @ 2019-04-27 15:13 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: akpm, Denis Kirjanov, yamada.masahiro, linux-mips, peterz, mingo,
	jhogan, Paul Burton, Tony Wu, ralf, macro, Jun-Ru Chang

3.16.66-rc1 review patch.  If anyone has any objections, please let me know.

------------------

From: Jun-Ru Chang <jrjang@realtek.com>

commit 2b424cfc69728224fcb5fad138ea7260728e0901 upstream.

Patch (b6c7a324df37b "MIPS: Fix get_frame_info() handling of
microMIPS function size.") introduces additional function size
check for microMIPS by only checking insn between ip and ip + func_size.
However, func_size in get_frame_info() is always 0 if KALLSYMS is not
enabled. This causes get_frame_info() to return immediately without
calculating correct frame_size, which in turn causes "Can't analyze
schedule() prologue" warning messages at boot time.

This patch removes func_size check, and let the frame_size check run
up to 128 insns for both MIPS and microMIPS.

Signed-off-by: Jun-Ru Chang <jrjang@realtek.com>
Signed-off-by: Tony Wu <tonywu@realtek.com>
Signed-off-by: Paul Burton <paul.burton@mips.com>
Fixes: b6c7a324df37b ("MIPS: Fix get_frame_info() handling of microMIPS function size.")
Cc: <ralf@linux-mips.org>
Cc: <jhogan@kernel.org>
Cc: <macro@mips.com>
Cc: <yamada.masahiro@socionext.com>
Cc: <peterz@infradead.org>
Cc: <mingo@kernel.org>
Cc: <linux-mips@vger.kernel.org>
Cc: <linux-kernel@vger.kernel.org>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 arch/mips/kernel/process.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

--- a/arch/mips/kernel/process.c
+++ b/arch/mips/kernel/process.c
@@ -373,7 +373,7 @@ static inline int is_sp_move_ins(union m
 static int get_frame_info(struct mips_frame_info *info)
 {
 	bool is_mmips = IS_ENABLED(CONFIG_CPU_MICROMIPS);
-	union mips_instruction insn, *ip, *ip_end;
+	union mips_instruction insn, *ip;
 	const unsigned int max_insns = 128;
 	unsigned int last_insn_size = 0;
 	unsigned int i;
@@ -385,10 +385,9 @@ static int get_frame_info(struct mips_fr
 	if (!ip)
 		goto err;
 
-	ip_end = (void *)ip + info->func_size;
-
-	for (i = 0; i < max_insns && ip < ip_end; i++) {
+	for (i = 0; i < max_insns; i++) {
 		ip = (void *)ip + last_insn_size;
+
 		if (is_mmips && mm_insn_16bit(ip->halfword[0])) {
 			insn.word = ip->halfword[0] << 16;
 			last_insn_size = 2;


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH 3.16 029/202] Disable MSI also when pcie-octeon.pcie_disable on
       [not found] <lsq.1556377988.384060557@decadent.org.uk>
  2019-04-27 15:13 ` [PATCH 3.16 099/202] MIPS: Remove function size check in get_frame_info() Ben Hutchings
  2019-04-27 15:13 ` [PATCH 3.16 074/202] MIPS: OCTEON: don't set octeon_dma_bar_type if PCI is disabled Ben Hutchings
@ 2019-04-27 15:13 ` Ben Hutchings
  2 siblings, 0 replies; 3+ messages in thread
From: Ben Hutchings @ 2019-04-27 15:13 UTC (permalink / raw)
  To: linux-kernel, stable
  Cc: akpm, Denis Kirjanov, Paul Burton, linux-mips, YunQiang Su,
	aaro.koskinen, pburton

3.16.66-rc1 review patch.  If anyone has any objections, please let me know.

------------------

From: YunQiang Su <ysu@wavecomp.com>

commit a214720cbf50cd8c3f76bbb9c3f5c283910e9d33 upstream.

Octeon has an boot-time option to disable pcie.

Since MSI depends on PCI-E, we should also disable MSI also with
this option is on in order to avoid inadvertently accessing PCIe
registers.

Signed-off-by: YunQiang Su <ysu@wavecomp.com>
Signed-off-by: Paul Burton <paul.burton@mips.com>
Cc: pburton@wavecomp.com
Cc: linux-mips@vger.kernel.org
Cc: aaro.koskinen@iki.fi
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 arch/mips/pci/msi-octeon.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

--- a/arch/mips/pci/msi-octeon.c
+++ b/arch/mips/pci/msi-octeon.c
@@ -371,7 +371,9 @@ int __init octeon_msi_initialize(void)
 	int irq;
 	struct irq_chip *msi;
 
-	if (octeon_dma_bar_type == OCTEON_DMA_BAR_TYPE_PCIE) {
+	if (octeon_dma_bar_type == OCTEON_DMA_BAR_TYPE_INVALID) {
+		return 0;
+	} else if (octeon_dma_bar_type == OCTEON_DMA_BAR_TYPE_PCIE) {
 		msi_rcv_reg[0] = CVMX_PEXP_NPEI_MSI_RCV0;
 		msi_rcv_reg[1] = CVMX_PEXP_NPEI_MSI_RCV1;
 		msi_rcv_reg[2] = CVMX_PEXP_NPEI_MSI_RCV2;


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-04-27 15:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <lsq.1556377988.384060557@decadent.org.uk>
2019-04-27 15:13 ` [PATCH 3.16 099/202] MIPS: Remove function size check in get_frame_info() Ben Hutchings
2019-04-27 15:13 ` [PATCH 3.16 074/202] MIPS: OCTEON: don't set octeon_dma_bar_type if PCI is disabled Ben Hutchings
2019-04-27 15:13 ` [PATCH 3.16 029/202] Disable MSI also when pcie-octeon.pcie_disable on Ben Hutchings

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).