* Re: [PATCH 1/2]: powerpc/cell spidernet bottom half
From: Linas Vepstas @ 2006-08-16 20:30 UTC (permalink / raw)
To: Jeff Garzik
Cc: akpm, Arnd Bergmann, netdev, James K Lewis, linux-kernel,
linuxppc-dev, Jens Osterkamp
In-Reply-To: <44E34825.2020105@garzik.org>
On Wed, Aug 16, 2006 at 12:30:29PM -0400, Jeff Garzik wrote:
> Linas Vepstas wrote:
> >
> >The recent set of low-waterark patches for the spider result in a
>
> Let's not reinvented NAPI, shall we...
??
I was under the impression that NAPI was for the receive side only.
This round of patches were for the transmit queue.
Let me describe the technical problem; perhaps there's some other
solution for it?
The default socket size seems to be 128KB; (cat
/proc/sys/net/core/wmem_default) if a user application
writes more than 128 KB to a socket, the app is blocked by the
kernel till there's room in the socket for more. At gigabit speeds,
a network card can drain 128KB in about a millisecond, or about
four times a jiffy (assuming HZ=250). If the network card isn't
generaing interrupts, (and there are no other interrupts flying
around) then the tcp stack only wakes up once a jiffy, and so
the user app is scheduled only once a jiffy. Thus, the max
bandwidth that the app can see is (HZ * wmem_default) bytes per
second, or about 250 Mbits/sec for my system. Disappointing
for a gigabit adapter.
There's three ways out of this:
(1) tell the sysadmin to
"echo 1234567 > /proc/sys/net/core/wmem_default" which
violates all the rules.
(2) Poll more frequently than once-a-jiffy. Arnd Bergmann and I
got this working, using hrtimers. It worked pretty well,
but seemed like a hack to me.
(3) Generate transmit queue low-watermark interrupts,
which is an admitedly olde-fashioned but common
engineering practice. This round of patches implement
this.
--linas
^ permalink raw reply
* [PATCH] powerpc: Make RTAS console init generic
From: Michael Neuling @ 2006-08-16 19:42 UTC (permalink / raw)
To: paulus; +Cc: linuxppc-dev, anton
The rtas console doesn't have to be Cell specific. If we get both
rtas tokens, we should just enabled the console then and there.
Signed-off-by: Michael Neuling <mikey@neuling.org>
---
Updated Kconfig so we can enable it.
arch/powerpc/Kconfig | 2 +-
arch/powerpc/kernel/rtas.c | 5 +++++
arch/powerpc/platforms/cell/setup.c | 4 ----
3 files changed, 6 insertions(+), 5 deletions(-)
Index: linux-2.6-ozlabs/arch/powerpc/Kconfig
===================================================================
--- linux-2.6-ozlabs.orig/arch/powerpc/Kconfig
+++ linux-2.6-ozlabs/arch/powerpc/Kconfig
@@ -426,7 +426,7 @@ config PPC_IBM_CELL_BLADE
select UDBG_RTAS_CONSOLE
config UDBG_RTAS_CONSOLE
- bool
+ bool "RTAS based debug console"
default n
config XICS
Index: linux-2.6-ozlabs/arch/powerpc/kernel/rtas.c
===================================================================
--- linux-2.6-ozlabs.orig/arch/powerpc/kernel/rtas.c
+++ linux-2.6-ozlabs/arch/powerpc/kernel/rtas.c
@@ -910,6 +910,11 @@ int __init early_init_dt_scan_rtas(unsig
basep = of_get_flat_dt_prop(node, "get-term-char", NULL);
if (basep)
rtas_getchar_token = *basep;
+
+ if (rtas_putchar_token != RTAS_UNKNOWN_SERVICE &&
+ rtas_getchar_token != RTAS_UNKNOWN_SERVICE)
+ udbg_init_rtas_console();
+
#endif
/* break now */
Index: linux-2.6-ozlabs/arch/powerpc/platforms/cell/setup.c
===================================================================
--- linux-2.6-ozlabs.orig/arch/powerpc/platforms/cell/setup.c
+++ linux-2.6-ozlabs/arch/powerpc/platforms/cell/setup.c
@@ -150,10 +150,6 @@ static int __init cell_probe(void)
!of_flat_dt_is_compatible(root, "IBM,CPBW-1.0"))
return 0;
-#ifdef CONFIG_UDBG_RTAS_CONSOLE
- udbg_init_rtas_console();
-#endif
-
hpte_init_native();
return 1;
^ permalink raw reply
* Re: [PATCH 7/7] ehea: Makefile & Kconfig
From: Michael Neuling @ 2006-08-16 19:27 UTC (permalink / raw)
To: Jan-Bernd Themann
Cc: Thomas Klein, Jan-Bernd Themann, netdev, linux-kernel,
Thomas Klein, linux-ppc, Christoph Raisch, Marcus Eder
In-Reply-To: <44E0A580.9020507@de.ibm.com>
This patch is still being white space munged so it doesn't apply.
The context is being shifted over 1 column. All your other patches add
new files so there is no context and hence they apply.
Mikey
In message <44E0A580.9020507@de.ibm.com> you wrote:
> Signed-off-by: Jan-Bernd Themann <themann@de.ibm.com>
>
>
> drivers/net/Kconfig | 6 ++++++
> drivers/net/Makefile | 1 +
> 2 files changed, 7 insertions(+)
>
>
>
> diff -Nurp -X dontdiff linux-2.6.18-rc4/drivers/net/Kconfig patched_kernel/dr
ivers/net/Kconfig
> --- linux-2.6.18-rc4/drivers/net/Kconfig 2006-08-06 11:20:11.000000000 -
0700
> +++ patched_kernel/drivers/net/Kconfig 2006-08-08 03:00:49.526421944 -
0700
> @@ -2277,6 +2277,12 @@ config CHELSIO_T1
> To compile this driver as a module, choose M here: the module
> will be called cxgb.
>
> +config EHEA
> + tristate "eHEA Ethernet support"
> + depends on IBMEBUS
> + ---help---
> + This driver supports the IBM pSeries ethernet adapter
> +
> config IXGB
> tristate "Intel(R) PRO/10GbE support"
> depends on PCI
> diff -Nurp -X dontdiff linux-2.6.18-rc4/drivers/net/Makefile patched_kernel/d
rivers/net/Makefile
> --- linux-2.6.18-rc4/drivers/net/Makefile 2006-08-06 11:20:11.000000000 -
0700
> +++ patched_kernel/drivers/net/Makefile 2006-08-08 03:00:30.061451584 -
0700
> @@ -10,6 +10,7 @@ obj-$(CONFIG_E1000) += e1000/
> obj-$(CONFIG_IBM_EMAC) += ibm_emac/
> obj-$(CONFIG_IXGB) += ixgb/
> obj-$(CONFIG_CHELSIO_T1) += chelsio/
> +obj-$(CONFIG_EHEA) += ehea/
> obj-$(CONFIG_BONDING) += bonding/
> obj-$(CONFIG_GIANFAR) += gianfar_driver.o
>
>
>
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
>
^ permalink raw reply
* Re: PowerPC paxtest results w/ gcc-4.1
From: Segher Boessenkool @ 2006-08-16 17:49 UTC (permalink / raw)
To: Gabriel Paubert
Cc: 'Albert Cahalan', linuxppc-dev, debian-powerpc,
Paul Mackerras
In-Reply-To: <20060816105925.GB21865@iram.es>
> I never understood why PTE entries waste 4 bits (WIMG)
> for effectively very few valid combinations.
The only invalid combinations are WI=11 -- if you know of
a way to fit 12 combinations in fewer than 4 bits, let us
know :-)
Not all of those 12 are very useful, of course.
Segher
^ permalink raw reply
* Re: [PATCH 1/2]: powerpc/cell spidernet bottom half
From: Jeff Garzik @ 2006-08-16 16:30 UTC (permalink / raw)
To: Linas Vepstas
Cc: akpm, Arnd Bergmann, netdev, James K Lewis, linux-kernel,
linuxppc-dev, Jens Osterkamp
In-Reply-To: <20060816161856.GD20551@austin.ibm.com>
Linas Vepstas wrote:
> Please apply and forward upstream. This patch requires the previous
> sequence of 4 spidernet patches to be applied.
>
> --linas
>
>
> The recent set of low-waterark patches for the spider result in a
> significant amount of computing being done in an interrupt context.
> This patch moves this to a "bottom half" aka work queue, so that
> the code runs in a normal kernel context. Curiously, this seems to
> result in a performance boost of about 5% for large packets.
>
> Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
> Cc: Utz Bacher <utz.bacher@de.ibm.com>
> Cc: Jens Osterkamp <Jens.Osterkamp@de.ibm.com>
Let's not reinvented NAPI, shall we...
Jeff
^ permalink raw reply
* [PATCH 2/2]: powerpc/cell spidernet refine locking
From: Linas Vepstas @ 2006-08-16 16:23 UTC (permalink / raw)
To: netdev, linux-kernel, linuxppc-dev
Cc: akpm, , Arnd Bergmann, jeff, Jens Osterkamp, James K Lewis, wq
In-Reply-To: <20060811170337.GH10638@austin.ibm.com>
Please apply and forward upstream. This patch requires the
pervious set of four spidernet patches to be applied.
--linas
The transmit side of the spider ethernet driver currently
places locks around some very large chunks of code. This
results in a fair amount of lock contention is some cases.
This patch makes the locks much more fine-grained, protecting
only the cirtical sections (the queue head and tail pointers,
and the queue low-watermark location).
This, with the previous patches, result in the following
performance, using netperf, averaged over 5 minute runs:
pkt size rate
======== ====
1500 804 Mbits/sec
800 701 Mbits/sec
600 600 Mbits/sec
300 280 Mbits/sec
60 60 Mbits/sec
Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Cc: Utz Bacher <utz.bacher@de.ibm.com>
Cc: Jens Osterkamp <Jens.Osterkamp@de.ibm.com>
----
drivers/net/spider_net.c | 77 ++++++++++++++++++++---------------------------
drivers/net/spider_net.h | 2 -
2 files changed, 35 insertions(+), 44 deletions(-)
Index: linux-2.6.18-rc3-mm2/drivers/net/spider_net.c
===================================================================
--- linux-2.6.18-rc3-mm2.orig/drivers/net/spider_net.c 2006-08-15 14:28:56.000000000 -0500
+++ linux-2.6.18-rc3-mm2/drivers/net/spider_net.c 2006-08-15 14:29:36.000000000 -0500
@@ -644,8 +644,9 @@ static int
spider_net_prepare_tx_descr(struct spider_net_card *card,
struct sk_buff *skb)
{
- struct spider_net_descr *descr = card->tx_chain.head;
+ struct spider_net_descr *descr;
dma_addr_t buf;
+ unsigned long flags;
buf = pci_map_single(card->pdev, skb->data, skb->len, PCI_DMA_TODEVICE);
if (buf == DMA_ERROR_CODE) {
@@ -655,6 +656,10 @@ spider_net_prepare_tx_descr(struct spide
return -ENOMEM;
}
+ spin_lock_irqsave(&card->tx_chain.lock, flags);
+ descr = card->tx_chain.head;
+ card->tx_chain.head = card->tx_chain.head->next;
+
descr->buf_addr = buf;
descr->buf_size = skb->len;
descr->next_descr_addr = 0;
@@ -663,6 +668,8 @@ spider_net_prepare_tx_descr(struct spide
descr->dmac_cmd_status =
SPIDER_NET_DESCR_CARDOWNED | SPIDER_NET_DMAC_NOCS;
+ spin_unlock_irqrestore(&card->tx_chain.lock, flags);
+
if (skb->protocol == htons(ETH_P_IP))
switch (skb->nh.iph->protocol) {
case IPPROTO_TCP:
@@ -673,37 +680,16 @@ spider_net_prepare_tx_descr(struct spide
break;
}
+ /* Chain the bus address, so that the DMA engine finds this descr. */
descr->prev->next_descr_addr = descr->bus_addr;
return 0;
}
-/**
- * spider_net_release_tx_descr - processes a used tx descriptor
- * @card: card structure
- * @descr: descriptor to release
- *
- * releases a used tx descriptor (unmapping, freeing of skb)
- */
-static inline void
-spider_net_release_tx_descr(struct spider_net_card *card)
-{
- struct spider_net_descr *descr = card->tx_chain.tail;
- struct sk_buff *skb;
-
- card->tx_chain.tail = card->tx_chain.tail->next;
- descr->dmac_cmd_status |= SPIDER_NET_DESCR_NOT_IN_USE;
-
- /* unmap the skb */
- skb = descr->skb;
- pci_unmap_single(card->pdev, descr->buf_addr, skb->len,
- PCI_DMA_TODEVICE);
- dev_kfree_skb_any(skb);
-}
-
static void
spider_net_set_low_watermark(struct spider_net_card *card)
{
+ unsigned long flags;
int status;
int cnt=0;
int i;
@@ -727,11 +713,13 @@ spider_net_set_low_watermark(struct spid
descr = descr->next;
/* Set the new watermark, clear the old wtermark */
+ spin_lock_irqsave(&card->tx_chain.lock, flags);
descr->dmac_cmd_status |= SPIDER_NET_DESCR_TXDESFLG;
if (card->low_watermark && card->low_watermark != descr)
card->low_watermark->dmac_cmd_status =
card->low_watermark->dmac_cmd_status & ~SPIDER_NET_DESCR_TXDESFLG;
card->low_watermark = descr;
+ spin_unlock_irqrestore(&card->tx_chain.lock, flags);
}
/**
@@ -750,22 +738,30 @@ static int
spider_net_release_tx_chain(struct spider_net_card *card, int brutal)
{
struct spider_net_descr_chain *chain = &card->tx_chain;
+ struct spider_net_descr *descr;
+ struct sk_buff *skb;
+ u32 buf_addr;
+ unsigned long flags;
int status;
int rc=0;
spider_net_read_reg(card, SPIDER_NET_GDTDMACCNTR);
while (chain->tail != chain->head) {
- status = spider_net_get_descr_status(chain->tail);
+ spin_lock_irqsave(&chain->lock, flags);
+ descr = chain->tail;
+
+ status = spider_net_get_descr_status(descr);
switch (status) {
case SPIDER_NET_DESCR_COMPLETE:
card->netdev_stats.tx_packets++;
- card->netdev_stats.tx_bytes += chain->tail->skb->len;
+ card->netdev_stats.tx_bytes += descr->skb->len;
break;
case SPIDER_NET_DESCR_CARDOWNED:
if (!brutal) {
rc = 1;
+ spin_unlock_irqrestore(&chain->lock, flags);
goto done;
}
/* fallthrough, if we release the descriptors
@@ -785,9 +781,19 @@ spider_net_release_tx_chain(struct spide
default:
card->netdev_stats.tx_dropped++;
rc = 1;
+ spin_unlock_irqrestore(&chain->lock, flags);
goto done;
}
- spider_net_release_tx_descr(card);
+
+ chain->tail = chain->tail->next;
+ descr->dmac_cmd_status |= SPIDER_NET_DESCR_NOT_IN_USE;
+ skb = descr->skb;
+ buf_addr = descr->buf_addr;
+ spin_unlock_irqrestore(&chain->lock, flags);
+
+ /* unmap the skb */
+ pci_unmap_single(card->pdev, buf_addr, skb->len, PCI_DMA_TODEVICE);
+ dev_kfree_skb_any(skb);
}
done:
if (rc == 1)
@@ -844,11 +850,8 @@ spider_net_xmit(struct sk_buff *skb, str
struct spider_net_card *card = netdev_priv(netdev);
struct spider_net_descr_chain *chain = &card->tx_chain;
struct spider_net_descr *descr = chain->head;
- unsigned long flags;
int result;
:
- spin_lock_irqsave(&chain->lock, flags);
-
spider_net_release_tx_chain(card, 0);
if (chain->head->next == chain->tail->prev) {
@@ -869,12 +872,9 @@ spider_net_xmit(struct sk_buff *skb, str
}
result = NETDEV_TX_OK;
-
spider_net_kick_tx_dma(card);
- card->tx_chain.head = card->tx_chain.head->next;
out:
- spin_unlock_irqrestore(&chain->lock, flags);
netif_wake_queue(netdev);
return result;
}
@@ -891,17 +891,11 @@ out:
static void
spider_net_cleanup_tx_ring(struct spider_net_card *card)
{
- unsigned long flags;
-
- spin_lock_irqsave(&card->tx_chain.lock, flags);
-
if ((spider_net_release_tx_chain(card, 0) != 0) &&
(card->netdev->flags & IFF_UP)) {
spider_net_kick_tx_dma(card);
netif_wake_queue(card->netdev);
}
-
- spin_unlock_irqrestore(&card->tx_chain.lock, flags);
}
static void
@@ -1932,10 +1926,7 @@ spider_net_stop(struct net_device *netde
spider_net_disable_rxdmac(card);
/* release chains */
- if (spin_trylock(&card->tx_chain.lock)) {
- spider_net_release_tx_chain(card, 1);
- spin_unlock(&card->tx_chain.lock);
- }
+ spider_net_release_tx_chain(card, 1);
spider_net_free_chain(card, &card->tx_chain);
spider_net_free_chain(card, &card->rx_chain);
Index: linux-2.6.18-rc3-mm2/drivers/net/spider_net.h
===================================================================
--- linux-2.6.18-rc3-mm2.orig/drivers/net/spider_net.h 2006-08-15 14:28:56.000000000 -0500
+++ linux-2.6.18-rc3-mm2/drivers/net/spider_net.h 2006-08-15 14:29:36.000000000 -0500
@@ -24,7 +24,7 @@
#ifndef _SPIDER_NET_H
#define _SPIDER_NET_H
-#define VERSION "1.1 B"
+#define VERSION "1.1 C"
#include "sungem_phy.h"
^ permalink raw reply
* [PATCH 1/2]: powerpc/cell spidernet bottom half
From: Linas Vepstas @ 2006-08-16 16:18 UTC (permalink / raw)
To: netdev, linux-kernel, linuxppc-dev
Cc: akpm, Jens Osterkamp, James K Lewis, jeff, Arnd Bergmann
In-Reply-To: <20060811170337.GH10638@austin.ibm.com>
Please apply and forward upstream. This patch requires the previous
sequence of 4 spidernet patches to be applied.
--linas
The recent set of low-waterark patches for the spider result in a
significant amount of computing being done in an interrupt context.
This patch moves this to a "bottom half" aka work queue, so that
the code runs in a normal kernel context. Curiously, this seems to
result in a performance boost of about 5% for large packets.
Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Cc: Utz Bacher <utz.bacher@de.ibm.com>
Cc: Jens Osterkamp <Jens.Osterkamp@de.ibm.com>
----
drivers/net/spider_net.c | 21 +++++++++++++++------
drivers/net/spider_net.h | 4 +++-
2 files changed, 18 insertions(+), 7 deletions(-)
Index: linux-2.6.18-rc3-mm2/drivers/net/spider_net.c
===================================================================
--- linux-2.6.18-rc3-mm2.orig/drivers/net/spider_net.c 2006-08-15 14:25:50.000000000 -0500
+++ linux-2.6.18-rc3-mm2/drivers/net/spider_net.c 2006-08-15 14:28:56.000000000 -0500
@@ -883,9 +883,10 @@ out:
* spider_net_cleanup_tx_ring - cleans up the TX ring
* @card: card structure
*
- * spider_net_cleanup_tx_ring is called by the tx_timer (as we don't use
- * interrupts to cleanup our TX ring) and returns sent packets to the stack
- * by freeing them
+ * spider_net_cleanup_tx_ring is called by either the tx_timer
+ * or from a work-queue scheduled by the tx-empty interrupt.
+ * This routine releases resources associted with transmitted
+ * packets, including updating the queue tail pointer.
*/
static void
spider_net_cleanup_tx_ring(struct spider_net_card *card)
@@ -895,12 +896,20 @@ spider_net_cleanup_tx_ring(struct spider
spin_lock_irqsave(&card->tx_chain.lock, flags);
if ((spider_net_release_tx_chain(card, 0) != 0) &&
- (card->netdev->flags & IFF_UP))
+ (card->netdev->flags & IFF_UP)) {
spider_net_kick_tx_dma(card);
+ netif_wake_queue(card->netdev);
+ }
spin_unlock_irqrestore(&card->tx_chain.lock, flags);
}
+static void
+spider_net_tx_cleanup_task(void * data)
+{
+ spider_net_cleanup_tx_ring((struct spider_net_card *) data);
+}
+
/**
* spider_net_do_ioctl - called for device ioctls
* @netdev: interface device structure
@@ -1499,8 +1508,7 @@ spider_net_interrupt(int irq, void *ptr,
netif_rx_schedule(netdev);
}
if (status_reg & SPIDER_NET_TXINT ) {
- spider_net_cleanup_tx_ring(card);
- netif_wake_queue(netdev);
+ schedule_work(&card->tx_cleanup_task);
}
if (status_reg & SPIDER_NET_ERRINT )
@@ -2117,6 +2125,7 @@ spider_net_alloc_card(void)
card->netdev = netdev;
card->msg_enable = SPIDER_NET_DEFAULT_MSG;
INIT_WORK(&card->tx_timeout_task, spider_net_tx_timeout_task, netdev);
+ INIT_WORK(&card->tx_cleanup_task, spider_net_tx_cleanup_task, card);
init_waitqueue_head(&card->waitq);
atomic_set(&card->tx_timeout_task_counter, 0);
Index: linux-2.6.18-rc3-mm2/drivers/net/spider_net.h
===================================================================
--- linux-2.6.18-rc3-mm2.orig/drivers/net/spider_net.h 2006-08-15 14:25:50.000000000 -0500
+++ linux-2.6.18-rc3-mm2/drivers/net/spider_net.h 2006-08-15 14:28:56.000000000 -0500
@@ -24,7 +24,7 @@
#ifndef _SPIDER_NET_H
#define _SPIDER_NET_H
-#define VERSION "1.1 A"
+#define VERSION "1.1 B"
#include "sungem_phy.h"
@@ -441,6 +441,8 @@ struct spider_net_card {
atomic_t tx_timeout_task_counter;
wait_queue_head_t waitq;
+ struct work_struct tx_cleanup_task;
+
/* for ethtool */
int msg_enable;
^ permalink raw reply
* [PATCH] powerpc: Instrument Hypervisor Calls
From: Mike Kravetz @ 2006-08-16 16:04 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev
Add instrumentation for hypervisor calls on pseries. Call statistics
include number of calls, wall time and cpu cycles (if available) and
are made available via debugfs. Instrumentation code is behind the
HCALL_STATS config option and has no impact if not enabled.
--
Signed-off-by: Mike Kravetz <kravetz@us.ibm.com>
diff -Naupr powerpc2/arch/powerpc/Kconfig.debug powerpc2.work/arch/powerpc/Kconfig.debug
--- powerpc2/arch/powerpc/Kconfig.debug 2006-08-14 18:00:45.000000000 +0000
+++ powerpc2.work/arch/powerpc/Kconfig.debug 2006-08-15 18:45:57.000000000 +0000
@@ -18,6 +18,20 @@ config DEBUG_STACK_USAGE
This option will slow down process creation somewhat.
+config HCALL_STATS
+ bool "Hypervisor call instrumentation"
+ depends on PPC_PSERIES && DEBUG_FS
+ help
+ Adds code to keep track of the number of hypervisor calls made and
+ the amount of time spent in hypervisor callsr. Wall time spent in
+ each call is always calculated, and if available CPU cycles spent
+ are also calculated. A directory named hcall_inst is added at the
+ root of the debugfs filesystem. Within the hcall_inst directory
+ are files that contain CPU specific call statistics.
+
+ This option will add a small amount of overhead to all hypervisor
+ calls.
+
config DEBUGGER
bool "Enable debugger hooks"
depends on DEBUG_KERNEL
diff -Naupr powerpc2/arch/powerpc/kernel/asm-offsets.c powerpc2.work/arch/powerpc/kernel/asm-offsets.c
--- powerpc2/arch/powerpc/kernel/asm-offsets.c 2006-08-14 18:00:46.000000000 +0000
+++ powerpc2.work/arch/powerpc/kernel/asm-offsets.c 2006-08-14 22:22:49.000000000 +0000
@@ -136,6 +136,7 @@ int main(void)
DEFINE(PACA_USER_TIME, offsetof(struct paca_struct, user_time));
DEFINE(PACA_SYSTEM_TIME, offsetof(struct paca_struct, system_time));
DEFINE(PACA_SLBSHADOWPTR, offsetof(struct paca_struct, slb_shadow_ptr));
+ DEFINE(PACA_DATA_OFFSET, offsetof(struct paca_struct, data_offset));
DEFINE(LPPACASRR0, offsetof(struct lppaca, saved_srr0));
DEFINE(LPPACASRR1, offsetof(struct lppaca, saved_srr1));
@@ -160,6 +161,12 @@ int main(void)
/* Create extra stack space for SRR0 and SRR1 when calling prom/rtas. */
DEFINE(PROM_FRAME_SIZE, STACK_FRAME_OVERHEAD + sizeof(struct pt_regs) + 16);
DEFINE(RTAS_FRAME_SIZE, STACK_FRAME_OVERHEAD + sizeof(struct pt_regs) + 16);
+
+ /* hcall statistics */
+ DEFINE(HCALL_STAT_SIZE, sizeof(struct hcall_stats));
+ DEFINE(HCALL_STAT_CALLS, offsetof(struct hcall_stats, num_calls));
+ DEFINE(HCALL_STAT_TB, offsetof(struct hcall_stats, tb_total));
+ DEFINE(HCALL_STAT_PURR, offsetof(struct hcall_stats, purr_total));
#endif /* CONFIG_PPC64 */
DEFINE(GPR0, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[0]));
DEFINE(GPR1, STACK_FRAME_OVERHEAD+offsetof(struct pt_regs, gpr[1]));
diff -Naupr powerpc2/arch/powerpc/platforms/pseries/Makefile powerpc2.work/arch/powerpc/platforms/pseries/Makefile
--- powerpc2/arch/powerpc/platforms/pseries/Makefile 2006-08-14 18:00:55.000000000 +0000
+++ powerpc2.work/arch/powerpc/platforms/pseries/Makefile 2006-08-14 21:31:45.000000000 +0000
@@ -12,3 +12,4 @@ obj-$(CONFIG_EEH) += eeh.o eeh_cache.o e
obj-$(CONFIG_HVC_CONSOLE) += hvconsole.o
obj-$(CONFIG_HVCS) += hvcserver.o
+obj-$(CONFIG_HCALL_STATS) += hvCall_inst.o
diff -Naupr powerpc2/arch/powerpc/platforms/pseries/hvCall.S powerpc2.work/arch/powerpc/platforms/pseries/hvCall.S
--- powerpc2/arch/powerpc/platforms/pseries/hvCall.S 2006-08-14 18:00:55.000000000 +0000
+++ powerpc2.work/arch/powerpc/platforms/pseries/hvCall.S 2006-08-15 19:06:10.000000000 +0000
@@ -10,9 +10,67 @@
#include <asm/hvcall.h>
#include <asm/processor.h>
#include <asm/ppc_asm.h>
+#include <asm/asm-offsets.h>
#define STK_PARM(i) (48 + ((i)-3)*8)
+#ifdef CONFIG_HCALL_STATS
+/*
+ * precall must preserve all registers. use unused STK_PARM()
+ * areas to save snapshots and opcode.
+ */
+#define HCALL_INST_PRECALL \
+ std r3,STK_PARM(r3)(r1); /* save opcode */ \
+ mftb r3; /* get timebase and */ \
+ std r3,STK_PARM(r5)(r1); /* save for later */ \
+BEGIN_FTR_SECTION; \
+ mfspr r3,SPRN_PURR; /* get PURR and */ \
+ std r3,STK_PARM(r6)(r1); /* save for later */ \
+END_FTR_SECTION_IFSET(CPU_FTR_PURR); \
+ ld r3,STK_PARM(r3)(r1); /* opcode back in r3 */
+
+/*
+ * postcall is performed immediately before function return which
+ * allows liberal use of volital registers.
+ */
+#define HCALL_INST_POSTCALL \
+ /* get time and PURR snapshots after hcall */ \
+ mftb r7; /* timebase after */ \
+BEGIN_FTR_SECTION; \
+ mfspr r8,SPRN_PURR; /* PURR after */ \
+ ld r6,STK_PARM(r6)(r1); /* PURR before */ \
+ subf r6,r6,r8; /* delta */ \
+END_FTR_SECTION_IFSET(CPU_FTR_PURR); \
+ \
+ ld r5,STK_PARM(r5)(r1); /* timebase before */ \
+ subf r5,r5,r7; /* time delta */ \
+ \
+ /* calculate address of stat structure */ \
+ ld r4,STK_PARM(r3)(r1); /* use opcode as */ \
+ rldicl r4,r4,62,2; /* index into array */ \
+ mulli r4,r4,HCALL_STAT_SIZE; \
+ LOAD_REG_ADDR(r7, per_cpu__hcall_stats); \
+ add r4,r4,r7; \
+ ld r7,PACA_DATA_OFFSET(r13); /* per cpu offset */ \
+ add r4,r4,r7; \
+ \
+ /* update stats */ \
+ ld r7,HCALL_STAT_CALLS(r4); /* count */ \
+ addi r7,r7,1; \
+ std r7,HCALL_STAT_CALLS(r4); \
+ ld r7,HCALL_STAT_TB(r4); /* timebase */ \
+ add r7,r7,r5; \
+ std r7,HCALL_STAT_TB(r4); \
+BEGIN_FTR_SECTION; \
+ ld r7,HCALL_STAT_PURR(r4); /* PURR */ \
+ add r7,r7,r6; \
+ std r7,HCALL_STAT_PURR(r4); \
+END_FTR_SECTION_IFSET(CPU_FTR_PURR);
+#else
+#define HCALL_INST_PRECALL
+#define HCALL_INST_POSTCALL
+#endif
+
.text
_GLOBAL(plpar_hcall_norets)
@@ -21,8 +79,12 @@ _GLOBAL(plpar_hcall_norets)
mfcr r0
stw r0,8(r1)
+ HCALL_INST_PRECALL
+
HVSC /* invoke the hypervisor */
+ HCALL_INST_POSTCALL
+
lwz r0,8(r1)
mtcrf 0xff,r0
blr /* return r3 = status */
@@ -33,6 +95,8 @@ _GLOBAL(plpar_hcall)
mfcr r0
stw r0,8(r1)
+ HCALL_INST_PRECALL
+
std r4,STK_PARM(r4)(r1) /* Save ret buffer */
mr r4,r5
@@ -50,6 +114,8 @@ _GLOBAL(plpar_hcall)
std r6, 16(r12)
std r7, 24(r12)
+ HCALL_INST_POSTCALL
+
lwz r0,8(r1)
mtcrf 0xff,r0
@@ -61,6 +127,8 @@ _GLOBAL(plpar_hcall9)
mfcr r0
stw r0,8(r1)
+ HCALL_INST_PRECALL
+
std r4,STK_PARM(r4)(r1) /* Save ret buffer */
mr r4,r5
@@ -86,6 +154,8 @@ _GLOBAL(plpar_hcall9)
std r11,56(r12)
std r12,64(r12)
+ HCALL_INST_POSTCALL
+
lwz r0,8(r1)
mtcrf 0xff,r0
diff -Naupr powerpc2/arch/powerpc/platforms/pseries/hvCall_inst.c powerpc2.work/arch/powerpc/platforms/pseries/hvCall_inst.c
--- powerpc2/arch/powerpc/platforms/pseries/hvCall_inst.c 1970-01-01 00:00:00.000000000 +0000
+++ powerpc2.work/arch/powerpc/platforms/pseries/hvCall_inst.c 2006-08-15 21:41:17.000000000 +0000
@@ -0,0 +1,129 @@
+/*
+ * Copyright (C) 2006 Mike Kravetz IBM Corporation
+ *
+ * Hypervisor Call Instrumentation
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <linux/kernel.h>
+#include <linux/percpu.h>
+#include <linux/debugfs.h>
+#include <linux/seq_file.h>
+#include <linux/cpumask.h>
+#include <asm/hvcall.h>
+#include <asm/firmware.h>
+#include <asm/cputable.h>
+
+DEFINE_PER_CPU(struct hcall_stats[MAX_HCALL_OPCODES+1], hcall_stats);
+
+/*
+ * Routines for displaying the statistics in debugfs
+ */
+static void *hc_start(struct seq_file *m, loff_t *pos)
+{
+ if ((int)*pos < (MAX_HCALL_OPCODES + 1))
+ return (void *)(unsigned long)(*pos + 1);
+
+ return NULL;
+}
+
+static void *hc_next(struct seq_file *m, void *p, loff_t * pos)
+{
+ ++*pos;
+
+ return hc_start(m, pos);
+}
+
+static void hc_stop(struct seq_file *m, void *p)
+{
+}
+
+static int hc_show(struct seq_file *m, void *p)
+{
+ unsigned long h_num = (unsigned long)p;
+ struct hcall_stats *hs = (struct hcall_stats *)m->private;
+
+ if (hs[h_num].num_calls) {
+ if (cpu_has_feature(CPU_FTR_PURR))
+ seq_printf(m, "%lu %lu %lu %lu\n", h_num<<2,
+ hs[h_num].num_calls,
+ hs[h_num].tb_total,
+ hs[h_num].purr_total);
+ else
+ seq_printf(m, "%lu %lu %lu\n", h_num<<2,
+ hs[h_num].num_calls,
+ hs[h_num].tb_total);
+ }
+
+ return 0;
+}
+
+static struct seq_operations hcall_inst_seq_ops = {
+ .start = hc_start,
+ .next = hc_next,
+ .stop = hc_stop,
+ .show = hc_show
+};
+
+static int hcall_inst_seq_open(struct inode *inode, struct file *file)
+{
+ int rc;
+ struct seq_file *seq;
+
+ rc = seq_open(file, &hcall_inst_seq_ops);
+ seq = file->private_data;
+ seq->private = file->f_dentry->d_inode->u.generic_ip;
+
+ return rc;
+}
+
+static struct file_operations hcall_inst_seq_fops = {
+ .open = hcall_inst_seq_open,
+ .read = seq_read,
+ .llseek = seq_lseek,
+ .release = seq_release,
+};
+
+#define HCALL_ROOT_DIR "hcall_inst"
+#define CPU_NAME_BUF_SIZE 32
+
+static int __init hcall_inst_init(void)
+{
+ struct dentry *hcall_root;
+ struct dentry *hcall_file;
+ char cpu_name_buf[CPU_NAME_BUF_SIZE];
+ int cpu;
+
+ if (!firmware_has_feature(FW_FEATURE_LPAR))
+ return 0;
+
+ hcall_root = debugfs_create_dir(HCALL_ROOT_DIR, NULL);
+ if (!hcall_root)
+ return -ENOMEM;
+
+ for_each_possible_cpu(cpu) {
+ snprintf(cpu_name_buf, CPU_NAME_BUF_SIZE, "cpu%d", cpu);
+ hcall_file = debugfs_create_file(cpu_name_buf, S_IRUGO,
+ hcall_root,
+ per_cpu(hcall_stats, cpu),
+ &hcall_inst_seq_fops);
+ if (!hcall_file)
+ return -ENOMEM;
+ }
+
+ return 0;
+}
+__initcall(hcall_inst_init);
diff -Naupr powerpc2/include/asm-powerpc/hvcall.h powerpc2.work/include/asm-powerpc/hvcall.h
--- powerpc2/include/asm-powerpc/hvcall.h 2006-08-14 18:05:16.000000000 +0000
+++ powerpc2.work/include/asm-powerpc/hvcall.h 2006-08-14 21:31:45.000000000 +0000
@@ -246,6 +246,15 @@ long plpar_hcall(unsigned long opcode, u
#define PLPAR_HCALL9_BUFSIZE 9
long plpar_hcall9(unsigned long opcode, unsigned long *retbuf, ...);
+/* For hcall instrumentation. One structure per-hcall, per-CPU */
+struct hcall_stats {
+ unsigned long num_calls; /* number of calls (on this CPU) */
+ unsigned long tb_total; /* total wall time (mftb) of calls. */
+ unsigned long purr_total; /* total cpu time (PURR) of calls. */
+};
+void update_hcall_stats(unsigned long opcode, unsigned long tb_delta,
+ unsigned long purr_delta);
+
#endif /* __ASSEMBLY__ */
#endif /* __KERNEL__ */
#endif /* _ASM_POWERPC_HVCALL_H */
^ permalink raw reply
* Re: CPM2 UARTs: Won't work under low (<= 1200BD) baudrates?
From: Dan Malek @ 2006-08-16 15:42 UTC (permalink / raw)
To: David Tao; +Cc: linuxppc-embedded
In-Reply-To: <20060815195203.37918.qmail@web32106.mail.mud.yahoo.com>
On Aug 15, 2006, at 3:52 PM, David Tao wrote:
> Under 2400 baud or above the UARTs work fine, but once the baudrate
> set to 1200 or below, there is NO data can be sent out or received
> even programed to do so.
It doesn't look like we check the baud rate and
add the preceding divide-by-16 clock for the
low baud rates like we did on the original CPM.
You can add this, test it, and submit a patch if
you like :-)
Thanks.
-- Dan
^ permalink raw reply
* Re: [PATCH] powerpc: Make RTAS console init generic
From: Michael Neuling @ 2006-08-16 15:22 UTC (permalink / raw)
To: michael; +Cc: linuxppc-dev, paulus, anton
In-Reply-To: <1155705695.12715.7.camel@localhost.localdomain>
In message <1155705695.12715.7.camel@localhost.localdomain> you wrote:
>
> --=-PNKyW5KJv4630LcmkXVt
> Content-Type: text/plain
> Content-Transfer-Encoding: quoted-printable
>
> On Tue, 2006-08-15 at 23:00 -0500, Michael Neuling wrote:
> > The RTAS console doesn't have to be Cell specific. If we have both
> > the put and get char RTAS functions, init the rtas console.
> >=20
> > Index: linux-2.6-ozlabs/arch/powerpc/kernel/rtas.c
> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> > --- linux-2.6-ozlabs.orig/arch/powerpc/kernel/rtas.c
> > +++ linux-2.6-ozlabs/arch/powerpc/kernel/rtas.c
> > @@ -910,6 +910,11 @@ int __init early_init_dt_scan_rtas(unsig
> > basep =3D of_get_flat_dt_prop(node, "get-term-char", NULL);
> > if (basep)
> > rtas_getchar_token =3D *basep;
> > +
> > + if (rtas_putchar_token !=3D RTAS_UNKNOWN_SERVICE &&
> > + rtas_getchar_token !=3D RTAS_UNKNOWN_SERVICE)
> > + udbg_init_rtas_console();
> > +
> > #endif
> > =20
> > /* break now */
> > Index: linux-2.6-ozlabs/arch/powerpc/platforms/cell/setup.c
> > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> > --- linux-2.6-ozlabs.orig/arch/powerpc/platforms/cell/setup.c
> > +++ linux-2.6-ozlabs/arch/powerpc/platforms/cell/setup.c
> > @@ -150,10 +150,6 @@ static int __init cell_probe(void)
> > !of_flat_dt_is_compatible(root, "IBM,CPBW-1.0"))
> > return 0;
> > =20
> > -#ifdef CONFIG_UDBG_RTAS_CONSOLE
> > - udbg_init_rtas_console();
> > -#endif
> > -
>
> I'd like to see it still guarded by UDBG_RTAS_CONSOLE, otherwise there's
> no way to select a different type of early console on a machine which
> has those tokens in the device tree.
Agreed but that section in rtas.c is already guarded by
UDBG_RTAS_CONSOLE. After applying the patch, it looks like:
#ifdef CONFIG_UDBG_RTAS_CONSOLE
basep = of_get_flat_dt_prop(node, "put-term-char", NULL);
if (basep)
rtas_putchar_token = *basep;
basep = of_get_flat_dt_prop(node, "get-term-char", NULL);
if (basep)
rtas_getchar_token = *basep;
if (rtas_putchar_token != RTAS_UNKNOWN_SERVICE &&
rtas_getchar_token != RTAS_UNKNOWN_SERVICE)
udbg_init_rtas_console();
#endif
Mikey
^ permalink raw reply
* Re: 2.6.18-rc3->rc4 hugetlbfs regression
From: Adam Litke @ 2006-08-16 15:00 UTC (permalink / raw)
To: Dave Hansen
Cc: Suzuki Kp, PPC External List, Linux Kernel Mailing List, linux-mm,
Yao Fei Zhu, lge, Nishanth Aravamudan
In-Reply-To: <1155655344.12700.45.camel@localhost.localdomain>
On Tue, 2006-08-15 at 08:22 -0700, Dave Hansen wrote:
> kernel BUG in cache_free_debugcheck at mm/slab.c:2748!
Alright, this one is only triggered when slab debugging is enabled. The slabs
are assumed to be aligned on a HUGEPTE_TABLE_SIZE boundary. The free path
makes use of this assumption and uses the lowest nibble to pass around an index
into an array of kmem_cache pointers. With slab debugging turned on, the slab
is still aligned, but the "working" object pointer is not. This would break
the assumption above that a full nibble is available for the PGF_CACHENUM_MASK.
The following patch reduces PGF_CACHENUM_MASK to cover only the two least
significant bits, which is enough to cover the current number of 4 pgtable
cache types. Then use this constant to mask out the appropriate part of the
huge pte pointer.
Signed-off-by: Adam Litke <agl@us.ibm.com>
---
arch/powerpc/mm/hugetlbpage.c | 2 +-
include/asm-powerpc/pgalloc.h | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff -upN reference/arch/powerpc/mm/hugetlbpage.c current/arch/powerpc/mm/hugetlbpage.c
--- reference/arch/powerpc/mm/hugetlbpage.c
+++ current/arch/powerpc/mm/hugetlbpage.c
@@ -153,7 +153,7 @@ static void free_hugepte_range(struct mm
hpdp->pd = 0;
tlb->need_flush = 1;
pgtable_free_tlb(tlb, pgtable_free_cache(hugepte, HUGEPTE_CACHE_NUM,
- HUGEPTE_TABLE_SIZE-1));
+ PGF_CACHENUM_MASK));
}
#ifdef CONFIG_PPC_64K_PAGES
diff -upN reference/include/asm-powerpc/pgalloc.h current/include/asm-powerpc/pgalloc.h
--- reference/include/asm-powerpc/pgalloc.h
+++ current/include/asm-powerpc/pgalloc.h
@@ -117,7 +117,7 @@ static inline void pte_free(struct page
pte_free_kernel(page_address(ptepage));
}
-#define PGF_CACHENUM_MASK 0xf
+#define PGF_CACHENUM_MASK 0x3
typedef struct pgtable_free {
unsigned long val;
--
Adam Litke - (agl at us.ibm.com)
IBM Linux Technology Center
^ permalink raw reply
* Re: PowerPC paxtest results w/ gcc-4.1
From: Albert Cahalan @ 2006-08-16 14:43 UTC (permalink / raw)
To: Paul Mackerras; +Cc: debian-powerpc, linuxppc-dev
In-Reply-To: <17634.64640.709200.871907@cargo.ozlabs.ibm.com>
On 8/16/06, Paul Mackerras <paulus@samba.org> wrote:
> Gabriel Paubert writes:
> > BTW, there is one way to make pages non executable: mark
> > them as guarded, but it will have a significant cost in
> > terms of performance.
>
> Indeed. I guess we could do that as a config option for machines that
> really want maximum security at the expense of performance, but I
> don't think all users would want that.
On the other hand, if you want to squeeze some performance
out of the chip, turn off coherency. (probably not for SMP)
I've done it before, with a non-Linux OS. It does help.
Other tricks are to map userspace via BATs and, on the 7410
at least, to map half or all of the outermost cache memory as
a special block of high-speed memory.
^ permalink raw reply
* Re: Problems dynamically linking busybox with ppc libs.
From: Ben Warren @ 2006-08-16 14:13 UTC (permalink / raw)
To: Keith Redfern; +Cc: linuxppc-embedded
In-Reply-To: <367F3B3911959C4DA9991C00166F620C1DE208@EUDUCEX2.europe.ad.flextronics.com>
Keith,
On Wed, 2006-08-16 at 10:53 +0200, Keith Redfern wrote:
> I am trying to dynamically link busybox with the correct libraries but
> run into problems with directory paths and CC/LD flags.
>
> I am using the toolchain supplied with ELDK and my target board is
> ppc_8xx based. The busybox version that I am using is 1.1.3.
>
<snip>
>
> Is this the correct place to make modifications?
>
> Has anyone already figured the changes required to get this to work
> with ELDK toolchain?
>
> Any insight would be useful.
>
>
>
> ...…Keith
I have busybox 1.2 building under ELDK 4.0, and didn't mess at all with
the Make system, and am building for a ppc_6xx- target. I realize this
isn't quite your setup, but is pretty close.
As long as you have the tools listed in your PATH (in my
case /opt/tools/eldk4.0/usr/bin:/opt/tools/eldk4.0/bin), you should be
able to build fine using 'make menuconfig'. Just go to 'Busybox
Settings->Build Options' and select 'Do you want to build BusyBox with a
Cross Compiler?', in your case entering 'ppc_8xx-' or whatever the
prefix is for your CPU.
regards,
Ben
^ permalink raw reply
* Re: *** PROBABLY SPAM *** No Clock on SPI
From: Laurent Pinchart @ 2006-08-16 13:22 UTC (permalink / raw)
To: linuxppc-embedded; +Cc: GSM909
In-Reply-To: <20060815164521.230780@gmx.net>
Hi Fred,
> I=C2=B4m writing a Driver for SPI. That is not working now.
> I have a MPC8260 using Linux 2.6.14 (rheap patch).
>
> Did someone else write a driver for SPI on this =C2=B5C or an other drive=
r? So I
> can see what i did wrong?
I'm working on an SPI driver for the MPC8248. I'll try to send a patch in a=
=20
few days.
> My SPCOM[STR] flag isn=C2=B4t cleared automatically after one clock cycle.
> What here going wrong ? ( I know this register is write only)
> There is also no Clock on my SPICLK.
Make sure you programmed the SPMODE register correctly.
> How I have to allocate the Memory for the BD=C2=B4s and the buffer for th=
e BD=C2=B4s?
The buffer descriptors should be allocated from CPM DPRAM using cpm_dpalloc=
().=20
The buffers can be allocated from any DMA-able memory (all system memory).
> Is there something special when I allocate Memory for my Parameter Ram?
You don't need to allocate memory for the parameter RAM. I declared PROFF_S=
PI=20
equal to 192 (I2C parameter RAM is at 128) in include/asm-ppc/cpm2.h:
#define PROFF_SMC1 (0)
#define PROFF_SMC2 (64)
#define PROFF_I2C (128)
#define PROFF_SPI (192)
Don't forget to set CPM_DATAONLY_BASE to 256 instead of 128 in the same fil=
e.
Then, set
*(u16 *)(&immap->im_dprambase[PROFF_SPI_BASE]) =3D PROFF_SPI;
in your driver code, and set the SPI pram resource to
=2Ename =3D "pram",
=2Estart =3D 0x00c0,
=2Eend =3D 0x00ff,
=2Eflags =3D IORESOURCE_MEM,
in arch/ppc/syslib/pq2_devices.c
> Is something wrong with the 2.6 Kernel so i have to use the 2.4 Kernel ?
You should not use 2.4. 2.6 is the way to go.
Laurent Pinchart
^ permalink raw reply
* Re: [POWERPC] iseries: remove some gcc 4.1 warnings
From: Arnd Bergmann @ 2006-08-16 13:15 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Stephen Rothwell, paulus
In-Reply-To: <20060816152032.2407a832.sfr@canb.auug.org.au>
On Wednesday 16 August 2006 07:20, Stephen Rothwell wrote:
> gcc 4.1 produces some warnings that it is ignoring the packed attribute
> on some structure elements, so just remove them.
>
Wouldn't it be nicer to just specify the packed attribute on the
structure instead of each of the members? My reading of the
gcc documentation is that this is functionally the same, but
it makes the source more readable, aside from avoiding this warning.
Arnd <><
^ permalink raw reply
* Re: Did someone have a working SPI Driver for Linux 2.6
From: Laurent Pinchart @ 2006-08-16 13:09 UTC (permalink / raw)
To: linuxppc-embedded; +Cc: Keinen Namen
In-Reply-To: <20060816125228.98000@gmx.net>
> Did someone have a working SPI Driver for Linux 2.6 and the MPC82xx from
> Freescale?
I'm working on such a driver. I will try to send a patch in a few days. The
driver is being tested on an MMC device, so basic functionalities should be
there, but things are far from being finished.
Laurent Pinchart
^ permalink raw reply
* Did someone have a working SPI Driver for Linux 2.6
From: Keinen Namen @ 2006-08-16 12:52 UTC (permalink / raw)
To: linuxppc-embedded
Hi
Did someone have a working SPI Driver for Linux 2.6 and the MPC82xx from Freescale?
Regards
Fred
--
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer
^ permalink raw reply
* help
From: Hemanth KumarBS @ 2006-08-16 12:46 UTC (permalink / raw)
To: linuxppc-embedded
[-- Attachment #1: Type: text/plain, Size: 101 bytes --]
Hi,
I am working on PPC-8248. Is montavista has driver for DMA based SPI
driver ?
Regards
Hemanth
[-- Attachment #2: Type: text/html, Size: 277 bytes --]
^ permalink raw reply
* [PATCH] Add a helper for calculating RTAS "config_addr" parameters
From: Michael Ellerman @ 2006-08-16 12:04 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev
Several RTAS calls take a "config_addr" parameter, which is a particular
way of specifying a PCI busno, devfn and register number into a 32-bit word.
Currently these are open-coded, and I'll be adding another soon, replace
them with a helper that encapsulates the logic. Be more strict about masking
the busno too, just in case.
Booted on P5 LPAR.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
arch/powerpc/kernel/rtas_pci.c | 6 ++----
include/asm-powerpc/rtas.h | 16 ++++++++++++++++
2 files changed, 18 insertions(+), 4 deletions(-)
Index: git/arch/powerpc/kernel/rtas_pci.c
===================================================================
--- git.orig/arch/powerpc/kernel/rtas_pci.c
+++ git/arch/powerpc/kernel/rtas_pci.c
@@ -81,8 +81,7 @@ int rtas_read_config(struct pci_dn *pdn,
if (!config_access_valid(pdn, where))
return PCIBIOS_BAD_REGISTER_NUMBER;
- addr = ((where & 0xf00) << 20) | (pdn->busno << 16) |
- (pdn->devfn << 8) | (where & 0xff);
+ addr = rtas_config_addr(pdn->busno, pdn->devfn, where);
buid = pdn->phb->buid;
if (buid) {
ret = rtas_call(ibm_read_pci_config, 4, 2, &returnval,
@@ -134,8 +133,7 @@ int rtas_write_config(struct pci_dn *pdn
if (!config_access_valid(pdn, where))
return PCIBIOS_BAD_REGISTER_NUMBER;
- addr = ((where & 0xf00) << 20) | (pdn->busno << 16) |
- (pdn->devfn << 8) | (where & 0xff);
+ addr = rtas_config_addr(pdn->busno, pdn->devfn, where);
buid = pdn->phb->buid;
if (buid) {
ret = rtas_call(ibm_write_pci_config, 5, 1, NULL, addr,
Index: git/include/asm-powerpc/rtas.h
===================================================================
--- git.orig/include/asm-powerpc/rtas.h
+++ git/include/asm-powerpc/rtas.h
@@ -230,5 +230,21 @@ extern unsigned long rtas_rmo_buf;
#define GLOBAL_INTERRUPT_QUEUE 9005
+/**
+ * rtas_config_addr - Format a busno, devfn and reg for RTAS.
+ * @busno: The bus number.
+ * @devfn: The device and function number as encoded by PCI_DEVFN().
+ * @reg: The register number.
+ *
+ * This function encodes the given busno, devfn and register number as
+ * required for RTAS calls that take a "config_addr" parameter.
+ * See PAPR requirement 7.3.4-1 for more info.
+ */
+static inline u32 rtas_config_addr(int busno, int devfn, int reg)
+{
+ return ((reg & 0xf00) << 20) | ((busno & 0xff) << 16) |
+ (devfn << 8) | (reg & 0xff);
+}
+
#endif /* __KERNEL__ */
#endif /* _POWERPC_RTAS_H */
^ permalink raw reply
* Re: Who cares about PReP?
From: Paul Mackerras @ 2006-08-16 11:57 UTC (permalink / raw)
To: Gabriel Paubert, linuxppc-dev
In-Reply-To: <17634.65529.252720.646039@cargo.ozlabs.ibm.com>
I wrote:
> If you (and anyone else who is interested) could send me the contents
> of /proc/residual, /proc/iomem, /proc/ioports and /proc/interrupts
> from your systems (one of each different type) that could be helpful.
And /proc/cpuinfo would be interesting too.
Paul.
^ permalink raw reply
* Re: Who cares about PReP?
From: Paul Mackerras @ 2006-08-16 11:22 UTC (permalink / raw)
To: Gabriel Paubert; +Cc: linuxppc-dev
In-Reply-To: <20060816101527.GA21865@iram.es>
Gabriel Paubert writes:
> We are using 20+ MVME boards here so I am interested,
> MVME2400/2600/2700 to be precise.
If you (and anyone else who is interested) could send me the contents
of /proc/residual, /proc/iomem, /proc/ioports and /proc/interrupts
from your systems (one of each different type) that could be helpful.
Thanks,
Paul.
^ permalink raw reply
* Re: PowerPC paxtest results w/ gcc-4.1
From: Paul Mackerras @ 2006-08-16 11:07 UTC (permalink / raw)
To: Gabriel Paubert; +Cc: 'Albert Cahalan', debian-powerpc, linuxppc-dev
In-Reply-To: <20060816105925.GB21865@iram.es>
Gabriel Paubert writes:
> I agree, but I don't know why you believe it would cause
> a machine check (0x200): from my docs, it is an ISI (0x400).
I don't believe it would cause a machine check either, but that is
what Matt Sealey was saying. I don't know where he got that idea.
> BTW, there is one way to make pages non executable: mark
> them as guarded, but it will have a significant cost in
> terms of performance.
Indeed. I guess we could do that as a config option for machines that
really want maximum security at the expense of performance, but I
don't think all users would want that.
Paul.
^ permalink raw reply
* Re: PowerPC paxtest results w/ gcc-4.1
From: Gabriel Paubert @ 2006-08-16 10:59 UTC (permalink / raw)
To: Paul Mackerras; +Cc: 'Albert Cahalan', debian-powerpc, linuxppc-dev
In-Reply-To: <17633.18057.778991.483461@cargo.ozlabs.ibm.com>
On Tue, Aug 15, 2006 at 01:59:05PM +1000, Paul Mackerras wrote:
> Matt Sealey writes:
>
> > Book I compatible PowerPC's have had a "no-executable" bit in
> > the page protection flags since the dark ages.. see page 7-38
> > and 7-39 of the 'Programming Environments Manual for 32-Bit
> > Microprocessors'.. this document predates even the G3.
>
> What are you referring to? I have a copy of the PEM from pre-G3 days,
> and a copy that I downloaded just now, and neither of them have an N
> bit in the PTE (and yes I just looked carefully through pages 7-38 and
> 7-39).
>
> There is an N bit in the segment register format, and that's what
> Albert is using.
>
> > As far as the documentation goes, you can make the page
> > readable and writable to the LSU, but the N bit causes the
> > instruction fetch to cause a machine check. That's pretty
> > "not-executable" to me at least :)
>
> A machine check is nasty, because it may not be recoverable...
I agree, but I don't know why you believe it would cause
a machine check (0x200): from my docs, it is an ISI (0x400).
BTW, there is one way to make pages non executable: mark
them as guarded, but it will have a significant cost in
terms of performance.
I never understood why PTE entries waste 4 bits (WIMG)
for effectively very few valid combinations.
Regards,
Gabriel
^ permalink raw reply
* Re: Who cares about PReP?
From: Gabriel Paubert @ 2006-08-16 10:15 UTC (permalink / raw)
To: Paul Mackerras; +Cc: linuxppc-dev
In-Reply-To: <17622.58559.879330.496619@cargo.ozlabs.ibm.com>
On Mon, Aug 07, 2006 at 04:59:11PM +1000, Paul Mackerras wrote:
> I started looking at moving the PReP code over to arch/powerpc. I am
> struck by how many ifdefs there are in there to set things up for
> particular individual PReP implementations. We can do better than
> that, I'm sure,
hopefully.
> but the issue becomes one of testing. The only PReP I
> have here is an RS/6000 43p-140.
>
> Who else has a PReP system and would be willing to do some testing and
> debugging? If so, what sort of PReP is it?
We are using 20+ MVME boards here so I am interested,
MVME2400/2600/2700 to be precise.
Right now I can test patches and not much more, I'm really
short of time and fighting other issues. Among them my PB
G4 from last December just completely failed (and Apple
told me to bring it to a shop in this city that is closed
for holidays until ... September 4th).
Regards,
Gabriel
^ permalink raw reply
* [PATCH] Gunzip call fix for PPC kernel images >4MB
From: Benjamin Heyne @ 2006-08-16 9:31 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Tom Rini, Paul Mackerras, Milton Miller
If Kernel images for PPC grow >4MB inflating of the kernel fails.
Increasing the link/load address doesn't help. Problem is
solved by replacing the fixed address of the gunzip() call in
misc-embedded.c with CONFIG_BOOT_LOAD.
Signed-off-by: Benjamin Heyne <benjamin.heyne@uni-dortmund.de>
---
--- arch/ppc/boot/simple/misc-embedded.c.orig 2006-08-16 10:56:10.000000000 +0200
+++ arch/ppc/boot/simple/misc-embedded.c 2006-08-16 10:56:55.000000000 +0200
@@ -213,7 +213,7 @@ load_kernel(unsigned long load_addr, int
*cp = 0;
puts("\nUncompressing Linux...");
- gunzip(0, 0x400000, zimage_start, &zimage_size);
+ gunzip(0, CONFIG_BOOT_LOAD, zimage_start, &zimage_size);
flush_instruction_cache();
puts("done.\n");
{
--
Benjamin Heyne
=======================================================
Arbeitsgebiet Datentechnik, Universitaet Dortmund
Information Processing Lab, University of Dortmund
Otto-Hahn-Strasse 4, 44227 Dortmund, Germany
Fon: +49 231 755 7017, Fax: +49 231 755 7019
www.dt.e-technik.uni-dortmund.de, Raum/Room P1-04-217
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox