* Re: adding Pegasus IDE quirk for pata_via
From: Olaf Hering @ 2007-08-16 17:00 UTC (permalink / raw)
To: Matt Sealey; +Cc: linuxppc-dev, linux-ide
In-Reply-To: <461A3C10.3050104@genesi-usa.com>
On Mon, Apr 09, Matt Sealey wrote:
> + if (bridge) {
> + u8 iir, irqlist[4] = { 14, 15, 10,
> 11 };
> +
> + pci_read_config_byte(bridge,
> VIA_IDE_STEERING, &iir);
What value has VIA_IDE_STEERING?
Googles only reference is your own posting.
^ permalink raw reply
* Re: [ofa-general] [PATCH 7/7] IB/ehca: Prevent overwriting QP init attributes given by caller
From: Hoang-Nam Nguyen @ 2007-08-16 16:48 UTC (permalink / raw)
To: Roland Dreier
Cc: Joachim Fenkes, linux-kernel, openib-general, Stefan Roscher,
linuxppc-dev, general-bounces
In-Reply-To: <adatzqz1mjx.fsf@cisco.com>
general-bounces@lists.openfabrics.org wrote on 16.08.2007 18:17:22:
> I don't understand this patch. <rdma/ib_verbs.h> says this about
> ib_create_qp():
>
> * @qp_init_attr: A list of initial attributes required to create the
> * QP. If QP creation succeeds, then the attributes are updated to
> * the actual capabilities of the created QP.
>
> So it seems the current code is actually correct and your patch breaks
> it??
Yes. That's absolutely true. Please ignore it.
Thanks!
Nam
^ permalink raw reply
* Re: [PATCH] [POWERPC] Invalid semicolon after if statement
From: Andreas Schwab @ 2007-08-16 16:40 UTC (permalink / raw)
To: Segher Boessenkool; +Cc: Ilpo Järvinen, paulus, linuxppc-dev
In-Reply-To: <fa88c3e5b4b0f896a16688a525bcd744@kernel.crashing.org>
Segher Boessenkool <segher@kernel.crashing.org> writes:
>> Thanks to the frickin compiler for warning us, not.
>
> 4.3: "warning: suggest braces around empty body in an 'if' statement"
>
> 4.1: "warning: empty body in an if-statement"
>
> Your GCC is too old :-)
This warning is only enabled by -Wextra. Only 4.3 has a separate option
for it (-Wempty-body).
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply
* Re: [PATCH v2] powerpc: add setmaskedbits macros
From: Benjamin Herrenschmidt @ 2007-08-16 16:40 UTC (permalink / raw)
To: Timur Tabi; +Cc: linuxppc-dev, paulus
In-Reply-To: <46C46C9A.2000107@freescale.com>
On Thu, 2007-08-16 at 10:26 -0500, Timur Tabi wrote:
> Kumar Gala wrote:
>
> >> setmaskedbits_be32(&uccp->gumr_l,
> >> UCC_SLOW_GUMR_L_MODE_QMC | UCC_SLOW_GUMR_L_TDCR_1 |
> >> UCC_SLOW_GUMR_L_RDCR_16,
> >> UCC_SLOW_GUMR_L_MODE_MASK | UCC_SLOW_GUMR_L_TDCR_MASK |
> >> UCC_SLOW_GUMR_L_RDCR_MASK);
> >>
> >> setmaskedbits_be32(&uccp->gumr_h,
> >> UCC_SLOW_GUMR_H_SUART | UCC_SLOW_GUMR_H_TRX |
> >> UCC_SLOW_GUMR_H_TTX, UCC_SLOW_GUMR_H_RFW);
> >
> > Can you also show what the UCC_SLOW* values look like.
>
> The second example is actually a trick that lets me set some bits and clear
> others in one shot, so for the gumr_h register, all of the above values are
> single bits. I guess that's not a good example.
Such tricks deserve at least a comment.
Ben.
^ permalink raw reply
* Re: [PATCH 1/2] Add scaled time to taskstats based process accounting
From: Linas Vepstas @ 2007-08-16 16:38 UTC (permalink / raw)
To: Michael Neuling
Cc: Andrew Morton, linuxppc-dev, Paul Mackerras, linux-kernel,
Balbir Singh
In-Reply-To: <20070816070922.37B5370074@localhost.localdomain>
On Thu, Aug 16, 2007 at 05:09:22PM +1000, Michael Neuling wrote:
> This adds two items to the taststats struct to account for user and
> system time based on scaling the CPU frequency and instruction issue
> rates.
>
> Adds account_(user|system)_time_scaled callbacks which architectures
> can use to account for time using this mechanism.
There's something simple here that I just don't understand.
> /*
> + * Account scaled user cpu time to a process.
> + * @p: the process that the cpu time gets accounted to
> + * @cputime: the cpu time spent in user space since the last update
> + */
> +void account_user_time_scaled(struct task_struct *p, cputime_t cputime)
> +{
> + p->utimescaled = cputime_add(p->utimescaled, cputime);
> +}
My gut impression (maybe wrong?) is that the scaled time is,
in a certain sense, "more accurate" than the unscaled time.
In fact, the unscaled time gives me the impression of being
rather meaningless, as it has no particular significance
with respect to the wall-clock, and it also doesn't give
any accurate hint of how much cpu resource was actually
consumed.
If one has a cpu with frequency scaling, then when would
one ever be interested in the non-scaled time? If the answer
is "never", then why not just always use the scaled time,
instead of adding more stuff to the kernel structs?
--linas
^ permalink raw reply
* Re: external IRQ's
From: Scott Wood @ 2007-08-16 16:23 UTC (permalink / raw)
To: robert lazarski; +Cc: linuxppc-embedded
In-Reply-To: <f87675ee0708160751u14f96dbcs3ad35a147b70a3f3@mail.gmail.com>
robert lazarski wrote:
> 1) Do I need to define those external IRQ's in both a device tree file
> under arch/powerpc/boot/dts and also in C code under
> arch/powerpc/platforms/85xx ?
Just in the dts.
> 2) I've been told on another list that "External interrupts start at
> zero (internal interrupt numbers have 0x10 added to them), so the
> first cell should correspond to the external IRQ
> number." I'm having a hard time applying that advice to a MDIO node
> and ethernet node in the device tree. For example, the CDS board for
> 8548 has the following:
>
> mdio@24520 {
> #address-cells = <1>;
> #size-cells = <0>;
> device_type = "mdio";
> compatible = "gianfar";
> reg = <24520 20>;
> phy0: ethernet-phy@0 {
> interrupt-parent = <&mpic>;
> interrupts = <35 0>;
> reg = <0>;
> device_type = "ethernet-phy";
> };
> ...
> };
I don't know what version of the dts you're looking at, but the one in
the current Linux tree has <5 1>, not <35 0>.
> I'm also not getting the ethernet interrupts in the above cds example:
>
> interrupts = <d 2 e 2 12 2>;
>
> Why start with 'd' and 'e' ? I noticed many if not all boards do that.
In the current dts, it's <1d 2 1e 2 22 2>.
It appears that the interrupt numbering was changed not too long ago,
and that external interrupts used to be numbered above the internal ones.
-Scott
^ permalink raw reply
* Re: [ofa-general] [PATCH 7/7] IB/ehca: Prevent overwriting QP init attributes given by caller
From: Roland Dreier @ 2007-08-16 16:17 UTC (permalink / raw)
To: Stefan Roscher
Cc: "Hoang-Nam Nguyen" @dyn-9-152-249-53, linuxppc-dev,
fenkes, linux-kernel, openib-general
In-Reply-To: <200708082044.38247.ossrosch@linux.vnet.ibm.com>
I don't understand this patch. <rdma/ib_verbs.h> says this about
ib_create_qp():
* @qp_init_attr: A list of initial attributes required to create the
* QP. If QP creation succeeds, then the attributes are updated to
* the actual capabilities of the created QP.
So it seems the current code is actually correct and your patch breaks
it??
^ permalink raw reply
* BestComm Task enable
From: Pedro Luis D. L. @ 2007-08-16 15:38 UTC (permalink / raw)
To: linuxppc-embedded
Hello,
I=B4m trying to develop an SPI audio driver for a Phytec 5200b tiny platfor=
m. For this purpose, I=B4m reusing a working I2S driver that was working in=
a Lite5200b platform. This I2S driver was developed for 2.6.16 kernel, usi=
ng the PPC arch. The kernel used by the new platform is a 2.6.20 version, u=
sing the powerpc arch.
This kernel does not include the gen_bd files for the BestComm to set up a =
generic task for the DMA, so I had to patch this kernel with the files from=
Sylvain 2.6.20 tree (gen_bd.h, gen_bd.c, sdma_gen_bd_rx_task.c and sdma_ge=
n_bd_tx_task.c) and compile them so now, the functions are available. As it=
was working with the old platform, my main goal is to stablish two interru=
pt routines for the dma to read and copy data from the PSC1 configured as a=
n SPI master device..
The question is: when I enable the sdma task (with sdma_enable() function),=
the system seems to halt for a while and then continue (so I guess it is d=
oing something...) and I have also noticed that the interrupt routines that=
I requested for transmission and reception are not called (a simple printk=
with a character is not printed). May be a problem of setting up the inter=
rupts? I have no clue, but the irq allocation seems to be a success
Any hint will be appreciated.
Here is the Setup function that configures the PSC and the DMA tasks:
static int SPI_setup(void) {
int i;
// CDM
struct mpc52xx_cdm __iomem *cdm;
//=20
// /* GPIO Modification */
struct mpc52xx_gpio __iomem *gpio;
// /* END GPIO Modification */
//=20
cdm =3D ioremap(MPC52xx_PA(MPC52xx_CDM_OFFSET), MPC52xx_CDM_SIZE);
gpio =3D ioremap(MPC52xx_PA(MPC52xx_GPIO_OFFSET), MPC52xx_GPIO_SIZE);
//=20
printk("psc_num %d\n", psc_num);
/* Phytec, PSC1*/
switch(psc_num) {
case 1:
initiator_tx =3D SDMA_INITIATOR_PSC1_TX;
initiator_rx =3D SDMA_INITIATOR_PSC1_RX;
break;
case 2:
initiator_tx =3D SDMA_INITIATOR_PSC2_TX;
initiator_rx =3D SDMA_INITIATOR_PSC2_RX;
break;
default:
panic("snd-SPImgt.o: invalid value for psc_num (%i)\n",psc_num);
break;
};
/* 528MHz/(0x1f+1)=3D16.5 MHz */
cdm->mclken_div_psc1 =3D 0x8001; // Mhz MCLK ( Khz * )
psc->command =3D (MPC52xx_PSC_TX_DISABLE | MPC52xx_PSC_RX_DISABLE);
/* PSC1 CODEC with Master Clock */
printk("GPIO->port_config 0x%08x\n", gpio->port_config);
gpio->port_config |=3D 0x00000007;
printk("GPIO->port_config 0x%08x\n", gpio->port_config);
/* PSC1 clock enable */
cdm->clk_enables |=3D 0x20;
// PSC reset
psc->command =3D MPC52xx_PSC_RST_RX;
psc->command =3D MPC52xx_PSC_RST_TX;
psc->command =3D MPC52xx_PSC_SEL_MODE_REG_1;
psc->command =3D MPC52xx_PSC_RST_ERR_STAT;
// PSC setup SPI
psc->mode =3D 0;
psc->rfalarm =3D RX_ALARM;
psc->tfalarm =3D TX_ALARM;
psc->rfcntl =3D RX_GRAN;
psc->tfcntl =3D TX_GRAN;
psc->mpc52xx_psc_imr =3D 0x0000;
=09
psc->sicr =3D 0x0290E000;
=09
psc->ccr =3D 0x3f00; //LRCK KHz, BitCLK MHz 0x3f05!
psc->command =3D MPC52xx_PSC_RST_RX;
psc->command =3D MPC52xx_PSC_RST_TX;
psc->command =3D MPC52xx_PSC_SEL_MODE_REG_1;
psc->command =3D MPC52xx_PSC_RST_ERR_STAT;
//=20
// // setup the sdma tasks
tx_sdma =3D sdma_alloc(PERIODS_HW+1);
rx_sdma =3D sdma_alloc(PERIODS_HW+1);
if (!tx_sdma || !rx_sdma) {
printk("sdma_alloc failed\n");
return -ENOMEM;
}
//=20
sdma_gen_bd_rx_init(0, rx_sdma, (phys_addr_t)&(psc->rfdata), initiator_rx,=
6, PERIODSIZE_HW);
sdma_gen_bd_tx_init(1, tx_sdma, (phys_addr_t)&(psc->tfdata), initiator_tx,=
6);
printk("txtask is %d rxtask is %d\n", tx_sdma->tasknum, rx_sdma->tasknum);
//=20
// prepare the ring buffers
for(i=3D0;itasknum %d\n", sdma_irq(rx_sdma), MPC52xx_SDMA_IRQ_BASE + rx_sd=
ma->tasknum);
if (request_irq(sdma_irq(rx_sdma), SPI_rx_irq, IRQF_DISABLED, "SPI rx dma"=
, NULL)) {
printk(KERN_ERR "SPI: SDMA rx irq allocation failed\n");
return -EINVAL;
} else printk("SPI: SDA rx irq allocation was a success\n");
if (request_irq(sdma_irq(tx_sdma), SPI_tx_irq, IRQF_DISABLED, "SPI tx dma"=
, NULL)) {
printk(KERN_ERR "SPI: SDMA tx irq allocation failed\n");
return -EINVAL;
} else printk("SPI: SDA tx irq allocation was a success\n");
=09
//=20
// // clear any pending interrupts
sdma_clear_irq(tx_sdma);
sdma_clear_irq(rx_sdma);
//=20
printk("Before activating the tasks\n");
// // activate the tasks
sdma_enable(tx_sdma); /*Halts or gets stucked here for a while */
sdma_enable(rx_sdma); /*Halts or gets stucked here for a while */
//=20
// printk("about to enable SPI psc\n");
udelay(100);
//=20
// // enable transmitter and receiver
psc->command =3D MPC52xx_PSC_TX_ENABLE | MPC52xx_PSC_RX_ENABLE;
return 0;
};
And here the interrupt routines:
static irqreturn_t SPI_tx_irq(int irq, void *dev_id) {
if(psc->mpc52xx_psc_status&0x1800) {
SPI_panic(__FUNCTION__);
return 0;
};
printk("I");
for (;;) {
if (!sdma_buffer_done(tx_sdma)) {
break;
}
sdma_retrieve_buffer(tx_sdma, NULL);
if(snd_SPImgt_running) {
sdma_submit_buffer(tx_sdma, NULL, (void *)(((u32)SPI_tx_bufs.pa) + (SPI_=
play*SAMPLESIZE)), PERIODSIZE_HW);
// printk("Ti %d ",SPI_play);
SPI_play +=3D FPP_HW;
if(SPI_play =3D=3D FPP*PERIODS) SPI_play=3D0;
if(snd_SPImgt_started) {
snd_SPImgt_started--;
}
else {
SPI_pos +=3D FPP_HW;
if(SPI_pos =3D=3D FPP*PERIODS) SPI_pos=3D0;
// snd_pcm_period_elapsed(snd_SPImgt_substream);
};
}
else {
sdma_submit_buffer(tx_sdma, NULL, (void *)SPI_tx_silence.pa, PERIODSIZE_=
HW);
};
};
=09
if(snd_SPImgt_running &&(!snd_SPImgt_started)){
snd_pcm_period_elapsed(snd_SPImgt_substream);
}
return IRQ_HANDLED;
};
static irqreturn_t SPI_rx_irq(int irq, void *dev_id) {
//SPI_print(__FUNCTION__);
if(psc->mpc52xx_psc_status&0x1800) {
SPI_panic(__FUNCTION__);
return 0;
};
printk("R"); =09
for (;;) {
if (!sdma_buffer_done(rx_sdma)) {
break;
}
sdma_retrieve_buffer(rx_sdma, NULL);
sdma_submit_buffer(rx_sdma, NULL, (void *)SPI_rx_bufs.pa, PERIODSIZE_HW);
};
return IRQ_HANDLED;
};
Regards,
Pedro.
_________________________________________________________________
Llama a tus amigos de PC a PC: =A1Es GRATIS!
http://get.live.com/messenger/overview=
^ permalink raw reply
* Re: [PATCH v2] powerpc: add setmaskedbits macros
From: Timur Tabi @ 2007-08-16 15:27 UTC (permalink / raw)
To: michael; +Cc: linuxppc-dev, paulus
In-Reply-To: <1187236548.8375.13.camel@concordia.ozlabs.ibm.com>
Michael Ellerman wrote:
> And if you're going to the trouble of making a macro, why not make it a
> bit more useful and have it check that the value and the mask match, ie:
>
> (v & ~m == 0)
What should I do if it fails this check?
> Final random thought, you could make the size/endian an argument:
>
> #define setmaskedbits(a, v, m, s) out_##s((a), (in_##s(a) & ~(m) | (v))
Hmmm.... the only thing wrong with that is that it would allow be64 on a
32-bit platform (i.e. no __power64__ protection). But that's minor.
--
Timur Tabi
Linux Kernel Developer @ Freescale
^ permalink raw reply
* Re: [PATCH v2] powerpc: add setmaskedbits macros
From: Timur Tabi @ 2007-08-16 15:26 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev, paulus
In-Reply-To: <9CE3D32E-B9C6-43B8-B944-45CE1DCCE8A2@kernel.crashing.org>
Kumar Gala wrote:
>> setmaskedbits_be32(&uccp->gumr_l,
>> UCC_SLOW_GUMR_L_MODE_QMC | UCC_SLOW_GUMR_L_TDCR_1 |
>> UCC_SLOW_GUMR_L_RDCR_16,
>> UCC_SLOW_GUMR_L_MODE_MASK | UCC_SLOW_GUMR_L_TDCR_MASK |
>> UCC_SLOW_GUMR_L_RDCR_MASK);
>>
>> setmaskedbits_be32(&uccp->gumr_h,
>> UCC_SLOW_GUMR_H_SUART | UCC_SLOW_GUMR_H_TRX |
>> UCC_SLOW_GUMR_H_TTX, UCC_SLOW_GUMR_H_RFW);
>
> Can you also show what the UCC_SLOW* values look like.
The second example is actually a trick that lets me set some bits and clear
others in one shot, so for the gumr_h register, all of the above values are
single bits. I guess that's not a good example.
For gumr_l, we have:
#define UCC_SLOW_GUMR_L_TDCR_MASK 0x00030000
#define UCC_SLOW_GUMR_L_TDCR_32 0x00030000
#define UCC_SLOW_GUMR_L_TDCR_16 0x00020000
#define UCC_SLOW_GUMR_L_TDCR_8 0x00010000
#define UCC_SLOW_GUMR_L_TDCR_1 0x00000000
#define UCC_SLOW_GUMR_L_RDCR_MASK 0x0000c000
#define UCC_SLOW_GUMR_L_RDCR_32 0x0000c000
#define UCC_SLOW_GUMR_L_RDCR_16 0x00008000
#define UCC_SLOW_GUMR_L_RDCR_8 0x00004000
#define UCC_SLOW_GUMR_L_RDCR_1 0x00000000
#define UCC_SLOW_GUMR_L_MODE_MASK 0x0000000F
#define UCC_SLOW_GUMR_L_MODE_BISYNC 0x00000008
#define UCC_SLOW_GUMR_L_MODE_AHDLC 0x00000006
#define UCC_SLOW_GUMR_L_MODE_UART 0x00000004
#define UCC_SLOW_GUMR_L_MODE_QMC 0x00000002
So for example, I could not use setbits32 to set UCC_SLOW_GUMR_L_RDCR_16 (10)
if it was currently UCC_SLOW_GUMR_L_RDCR_32 (11).
--
Timur Tabi
Linux Kernel Developer @ Freescale
^ permalink raw reply
* Re: [PATCH v2] powerpc: add setmaskedbits macros
From: Kumar Gala @ 2007-08-16 15:21 UTC (permalink / raw)
To: Timur Tabi; +Cc: linuxppc-dev, paulus
In-Reply-To: <46C46AB7.6070903@freescale.com>
On Aug 16, 2007, at 10:18 AM, Timur Tabi wrote:
> Kumar Gala wrote:
>
>> Can you post a driver that uses this. I'm interested in seeing
>> what the readability is really like using these macros.
>
> I do not yet have any drivers ready, but I can give you an example:
>
> setmaskedbits_be32(&uccp->gumr_l,
> UCC_SLOW_GUMR_L_MODE_QMC | UCC_SLOW_GUMR_L_TDCR_1 |
> UCC_SLOW_GUMR_L_RDCR_16,
> UCC_SLOW_GUMR_L_MODE_MASK |
> UCC_SLOW_GUMR_L_TDCR_MASK |
> UCC_SLOW_GUMR_L_RDCR_MASK);
>
> setmaskedbits_be32(&uccp->gumr_h,
> UCC_SLOW_GUMR_H_SUART | UCC_SLOW_GUMR_H_TRX |
> UCC_SLOW_GUMR_H_TTX, UCC_SLOW_GUMR_H_RFW);
Can you also show what the UCC_SLOW* values look like.
> The alternative to using a macro like this is to do this:
>
> reg = in_be32(p);
> reg &= ~some-mask-bits;
> reg |= some-other-bits;
> out_be32(p, reg);
>
> --
> Timur Tabi
> Linux Kernel Developer @ Freescale
^ permalink raw reply
* Re: [PATCH v2] powerpc: add setmaskedbits macros
From: Timur Tabi @ 2007-08-16 15:18 UTC (permalink / raw)
To: Kumar Gala; +Cc: linuxppc-dev, paulus
In-Reply-To: <2DFE7EFC-6B9F-4149-83AE-5502DD25C14C@kernel.crashing.org>
Kumar Gala wrote:
> Can you post a driver that uses this. I'm interested in seeing what the
> readability is really like using these macros.
I do not yet have any drivers ready, but I can give you an example:
setmaskedbits_be32(&uccp->gumr_l,
UCC_SLOW_GUMR_L_MODE_QMC | UCC_SLOW_GUMR_L_TDCR_1 |
UCC_SLOW_GUMR_L_RDCR_16,
UCC_SLOW_GUMR_L_MODE_MASK | UCC_SLOW_GUMR_L_TDCR_MASK |
UCC_SLOW_GUMR_L_RDCR_MASK);
setmaskedbits_be32(&uccp->gumr_h,
UCC_SLOW_GUMR_H_SUART | UCC_SLOW_GUMR_H_TRX |
UCC_SLOW_GUMR_H_TTX, UCC_SLOW_GUMR_H_RFW);
The alternative to using a macro like this is to do this:
reg = in_be32(p);
reg &= ~some-mask-bits;
reg |= some-other-bits;
out_be32(p, reg);
--
Timur Tabi
Linux Kernel Developer @ Freescale
^ permalink raw reply
* external IRQ's
From: robert lazarski @ 2007-08-16 14:51 UTC (permalink / raw)
To: linuxppc-embedded
Hi all, can someone help me with my external interrupts for the
mpc8548e ? I need to define these interrupts our hardware engineer has
defined:
IRQ0 : PHY 0 - TSEC 1 (P0 of the 88E1121R)
IRQ1 : PHY 1 - TSEC 2 (P1 of the 88E1121R)
IRQ2 : PHY 2 - TSEC 3 (88E1111)
IRQ3 : PHY 3 - TSEC 4 (88E1111)
My questions for kernel 2.6.22 and arch powerpc are:
1) Do I need to define those external IRQ's in both a device tree file
under arch/powerpc/boot/dts and also in C code under
arch/powerpc/platforms/85xx ?
2) I've been told on another list that "External interrupts start at
zero (internal interrupt numbers have 0x10 added to them), so the
first cell should correspond to the external IRQ
number." I'm having a hard time applying that advice to a MDIO node
and ethernet node in the device tree. For example, the CDS board for
8548 has the following:
mdio@24520 {
#address-cells = <1>;
#size-cells = <0>;
device_type = "mdio";
compatible = "gianfar";
reg = <24520 20>;
phy0: ethernet-phy@0 {
interrupt-parent = <&mpic>;
interrupts = <35 0>;
reg = <0>;
device_type = "ethernet-phy";
};
...
};
ethernet@24000 {
#address-cells = <1>;
#size-cells = <0>;
device_type = "network";
model = "eTSEC";
compatible = "gianfar";
reg = <24000 1000>;
local-mac-address = [ 00 E0 0C 00 73 00 ];
interrupts = <d 2 e 2 12 2>;
interrupt-parent = <&mpic>;
phy-handle = <&phy0>;
};
I believe for the 8548 there are 11 external interrupts and 48
software interrupts. So in the mdio example above has the first cell
as '35' - is this a software interrupt?
interrupts = <35 0>;
Can I do the following assuming the same second cell sense and level for PHY0 ?
interrupts = <0 0>;
I'm also not getting the ethernet interrupts in the above cds example:
interrupts = <d 2 e 2 12 2>;
Why start with 'd' and 'e' ? I noticed many if not all boards do that.
3) For the C code in arch/powerpc/platforms/85xx , I see where 0x10
makes sense for internal interrupts. In my case, can I just do:
mpic = mpic_alloc(np, r.start,
MPIC_PRIMARY | MPIC_WANTS_RESET | MPIC_BIG_ENDIAN,
4, 0, " OpenPIC ");
BUG_ON(mpic == NULL);
/* Return the mpic node */
of_node_put(np);
/* External Interrupts */
mpic_assign_isu(mpic, 0, r.start + 0x00000);
mpic_assign_isu(mpic, 1, r.start + 0x00080);
mpic_assign_isu(mpic, 2, r.start + 0x00100);
mpic_assign_isu(mpic, 3, r.start + 0x00180);
Please help!
Robert
^ permalink raw reply
* Re: System crash on boot_e500.S on 2.4Kernel
From: mike zheng @ 2007-08-16 14:37 UTC (permalink / raw)
To: Andy Fleming; +Cc: linuxppc-embedded
In-Reply-To: <8513767D-F467-49EA-816B-48567E13F56D@freescale.com>
[-- Attachment #1: Type: text/plain, Size: 895 bytes --]
On 8/15/07, Andy Fleming <afleming@freescale.com> wrote:
>
>
> On Aug 15, 2007, at 17:46, mike zheng wrote:
>
> > Hi Andy,
> >
> > Here is BDI output of the register value after line 212. The value
> > of R6, R7 is 0x20, 0x160. However the value of SRR0(SPR26), SRR1
> > (SPR27) is 0xfff81300 and 0x00001000. Why are they different from
> > r7 and r6? We just did the mtspr, the value should be the same. The
> > rfi jump to 0xfff81300 is because of the value in SRR0.
>
>
> Yes, it's very strange. But it's also pretty much impossible for the
> mtspr to just fail like that. A more likely scenario is that the BDI
> is getting bad information. Could you take a look at your IVORs?
> I'm very curious to see if fff81300 is an interrupt vector.
Now I know the BDI need debug vector to be set properly. I manually change
the IVPR and IVOR15 for BDI, and will update you the progress.
Andy
>
[-- Attachment #2: Type: text/html, Size: 1401 bytes --]
^ permalink raw reply
* Re: My Kernel hangs after images verification and no boot msgs on Console?
From: Haiying Wang @ 2007-08-16 14:19 UTC (permalink / raw)
To: dnl; +Cc: linuxppc-embedded
In-Reply-To: <F3D55679E1DCFF49A57570501B70475F070D83B5@CL5EXBE04.ad2.softcom.biz>
On Thu, 2007-08-16 at 07:40 -0400, dnl wrote:
>
> 1. i can view the booting messages by "Dumping the printk Log
> Buffer".
> 2. i am passing the "bootargs=console=ttyS0,115200 root=/dev/ram0 rw"
>
> How can i get boot messages on serial console?
>
Set console = ttyS1,115200 instead of ttyS0.
^ permalink raw reply
* Re: [PATCH] [POWERPC] Invalid semicolon after if statement
From: Segher Boessenkool @ 2007-08-16 14:03 UTC (permalink / raw)
To: michael; +Cc: Ilpo Järvinen, linuxppc-dev, paulus
In-Reply-To: <1187251702.8375.43.camel@concordia.ozlabs.ibm.com>
> Thanks to the frickin compiler for warning us, not.
4.3: "warning: suggest braces around empty body in an 'if' statement"
4.1: "warning: empty body in an if-statement"
Your GCC is too old :-)
Segher
^ permalink raw reply
* [PATCH 2/6] powerpc: hash_preload fails to preload under CONFIG_PPC_MM_SLICES
From: Andy Whitcroft @ 2007-08-16 13:18 UTC (permalink / raw)
To: linux-kernel; +Cc: Andrew Morton, linuxppc-dev, Randy Dunlap, Paul Mackerras
In-Reply-To: <exportbomb.1187270320@pinky>
Seems that a trailing ';' has slipped onto the end of the
get_slice_psize checks under CONFIG_PPC_MM_SLICES causing us to
return unconditionally and never preload.
Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@ozlabs.org
---
arch/powerpc/mm/hash_utils_64.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c
index f178957..a47151e 100644
--- a/arch/powerpc/mm/hash_utils_64.c
+++ b/arch/powerpc/mm/hash_utils_64.c
@@ -795,7 +795,7 @@ void hash_preload(struct mm_struct *mm, unsigned long ea,
#ifdef CONFIG_PPC_MM_SLICES
/* We only prefault standard pages for now */
- if (unlikely(get_slice_psize(mm, ea) != mm->context.user_psize));
+ if (unlikely(get_slice_psize(mm, ea) != mm->context.user_psize))
return;
#endif
^ permalink raw reply related
* My Kernel hangs after images verification and no boot msgs on Console?
From: dnl @ 2007-08-16 11:40 UTC (permalink / raw)
To: afleming; +Cc: linuxppc-embedded
In-Reply-To: <8779714.1620021187264042248.JavaMail.nabble@isper.nabble.com>
[-- Attachment #1: Type: text/plain, Size: 409 bytes --]
Hi Andy,
I am using MPC8555CDS board, montavista kernel, and uboot for board bringup...
when i am booting montavista kernel using uboot i didn't get any message on Console...
1. i can view the booting messages by "Dumping the printk Log Buffer".
2. i am passing the "bootargs=console=ttyS0,115200 root=/dev/ram0 rw"
How can i get boot messages on serial console?
Regards,
Saravanan.S
[-- Attachment #2: Type: text/html, Size: 911 bytes --]
^ permalink raw reply
* Re: [PATCH 2/2] [POWERPC] Add scaled time accounting
From: Balbir Singh @ 2007-08-16 9:44 UTC (permalink / raw)
To: Michael Neuling; +Cc: Andrew Morton, linuxppc-dev, Paul Mackerras, linux-kernel
In-Reply-To: <20070816070922.6642E70073@localhost.localdomain>
Michael Neuling wrote:
> This adds POWERPC specific hooks for scaled time accounting.
>
> POWER6 includes a SPURR register. The SPURR is based off the PURR
> register but is scaled based on CPU frequency and issue rates. This
> gives a more accurate account of the instructions used per task. The
> PURR and timebase will be constant relative to the wall clock,
> irrespective of the CPU frequency.
>
> This implementation reads the SPURR register in account_system_vtime
> which is only call called on context witch and hard and soft irq entry
> and exit. The percentage of user and system time is then estimated
> using the ratio of these accounted by the PURR. If the SPURR is not
> present, the PURR read.
>
> An earlier implementation of this patch read the SPURR whenever the
> PURR was read, which included the system call entry and exit path.
> Unfortunately this showed a performance regression on lmbench runs, so
> was re-implemented.
>
> I've included the lmbench results here when run bare metal on POWER6.
> 1st column is the unpatch results. 2nd column is the results using the
> below patch and the 3rd is the % diff of these results from the base.
> 4th and 5th columns are the results and % differnce from the base
> using the older patch (SPURR read in syscall entry/exit path).
>
> Base Scaled-Acct SPURR-in-syscall
> Result Result % diff Result % diff
> Simple syscall: 0.3086 0.3086 0.0000 0.3452 11.8600
> Simple read: 0.4591 0.4671 1.7425 0.5044 9.86713
> Simple write: 0.4364 0.4366 0.0458 0.4731 8.40971
> Simple stat: 2.0055 2.0295 1.1967 2.0669 3.06158
> Simple fstat: 0.5962 0.5876 -1.442 0.6368 6.80979
> Simple open/close: 3.1283 3.1009 -0.875 3.2088 2.57328
> Select on 10 fd's: 0.8554 0.8457 -1.133 0.8667 1.32101
> Select on 100 fd's: 3.5292 3.6329 2.9383 3.6664 3.88756
> Select on 250 fd's: 7.9097 8.1881 3.5197 8.2242 3.97613
> Select on 500 fd's: 15.2659 15.836 3.7357 15.873 3.97814
> Select on 10 tcp fd's: 0.9576 0.9416 -1.670 0.9752 1.83792
> Select on 100 tcp fd's: 7.248 7.2254 -0.311 7.2685 0.28283
> Select on 250 tcp fd's: 17.7742 17.707 -0.375 17.749 -0.1406
> Select on 500 tcp fd's: 35.4258 35.25 -0.496 35.286 -0.3929
> Signal handler installation: 0.6131 0.6075 -0.913 0.647 5.52927
> Signal handler overhead: 2.0919 2.1078 0.7600 2.1831 4.35967
> Protection fault: 0.7345 0.7478 1.8107 0.8031 9.33968
> Pipe latency: 33.006 16.398 -50.31 33.475 1.42368
> AF_UNIX sock stream latency: 14.5093 30.910 113.03 30.715 111.692
> Process fork+exit: 219.8 222.8 1.3648 229.37 4.35623
> Process fork+execve: 876.14 873.28 -0.32 868.66 -0.8533
> Process fork+/bin/sh -c: 2830 2876.5 1.6431 2958 4.52296
> File /var/tmp/XXX write bw: 1193497 1195536 0.1708 118657 -0.5799
> Pagefaults on /var/tmp/XXX: 3.1272 3.2117 2.7020 3.2521 3.99398
>
> Also, kernel compile times show no difference with this patch applied.
>
> Signed-off-by: Michael Neuling <mikey@neuling.org>
>
> ---
>
> arch/powerpc/kernel/asm-offsets.c | 1 +
> arch/powerpc/kernel/time.c | 32 ++++++++++++++++++++++++++++++--
> include/asm-powerpc/paca.h | 3 +++
> 3 files changed, 34 insertions(+), 2 deletions(-)
>
> Index: linux-2.6-ozlabs/arch/powerpc/kernel/asm-offsets.c
> ===================================================================
> --- linux-2.6-ozlabs.orig/arch/powerpc/kernel/asm-offsets.c
> +++ linux-2.6-ozlabs/arch/powerpc/kernel/asm-offsets.c
> @@ -141,6 +141,7 @@ int main(void)
> DEFINE(PACALPPACAPTR, offsetof(struct paca_struct, lppaca_ptr));
> DEFINE(PACAHWCPUID, offsetof(struct paca_struct, hw_cpu_id));
> DEFINE(PACA_STARTPURR, offsetof(struct paca_struct, startpurr));
> + DEFINE(PACA_STARTSPURR, offsetof(struct paca_struct, startspurr));
> 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));
> Index: linux-2.6-ozlabs/arch/powerpc/kernel/time.c
> ===================================================================
> --- linux-2.6-ozlabs.orig/arch/powerpc/kernel/time.c
> +++ linux-2.6-ozlabs/arch/powerpc/kernel/time.c
> @@ -168,23 +168,44 @@ static u64 read_purr(void)
> }
>
> /*
> + * Read the SPURR on systems that have it, otherwise the purr
> + */
> +static u64 read_spurr(void)
> +{
> + if (cpu_has_feature(CPU_FTR_SPURR))
> + return mfspr(SPRN_SPURR);
> + return read_purr();
> +}
> +
> +/*
> * Account time for a transition between system, hard irq
> * or soft irq state.
> */
> void account_system_vtime(struct task_struct *tsk)
> {
> - u64 now, delta;
> + u64 now, nowscaled, delta, deltascaled;
> unsigned long flags;
>
> local_irq_save(flags);
> now = read_purr();
> delta = now - get_paca()->startpurr;
> get_paca()->startpurr = now;
> + nowscaled = read_spurr();
> + deltascaled = nowscaled - get_paca()->startspurr;
> + get_paca()->startspurr = nowscaled;
> if (!in_interrupt()) {
> + /* deltascaled includes both user and system time.
> + * Hence scale it based on the purr ratio to estimate
> + * the system time */
> + deltascaled = deltascaled * get_paca()->system_time /
> + (get_paca()->system_time + get_paca()->user_time);
> delta += get_paca()->system_time;
> get_paca()->system_time = 0;
> }
> account_system_time(tsk, 0, delta);
> + get_paca()->purrdelta = delta;
> + account_system_time_scaled(tsk, deltascaled);
> + get_paca()->spurrdelta = deltascaled;
> local_irq_restore(flags);
> }
>
> @@ -196,11 +217,17 @@ void account_system_vtime(struct task_st
> */
> void account_process_vtime(struct task_struct *tsk)
> {
> - cputime_t utime;
> + cputime_t utime, utimescaled;
>
> utime = get_paca()->user_time;
> get_paca()->user_time = 0;
> account_user_time(tsk, utime);
> +
> + /* Estimate the scaled utime by scaling the real utime based
> + * on the last spurr to purr ratio */
> + utimescaled = utime * get_paca()->spurrdelta / get_paca()->purrdelta;
The assumption is account_process_vtime() is always called after account_system_vtime(),
is my understanding correct?
> + get_paca()->spurrdelta = get_paca()->purrdelta = 0;
> + account_user_time_scaled(tsk, utimescaled);
> }
>
> static void account_process_time(struct pt_regs *regs)
> @@ -222,6 +249,7 @@ struct cpu_purr_data {
> int initialized; /* thread is running */
> u64 tb; /* last TB value read */
> u64 purr; /* last PURR value read */
> + u64 spurr; /* last SPURR value read */
> };
>
> /*
> Index: linux-2.6-ozlabs/include/asm-powerpc/paca.h
> ===================================================================
> --- linux-2.6-ozlabs.orig/include/asm-powerpc/paca.h
> +++ linux-2.6-ozlabs/include/asm-powerpc/paca.h
> @@ -103,6 +103,9 @@ struct paca_struct {
> u64 user_time; /* accumulated usermode TB ticks */
> u64 system_time; /* accumulated system TB ticks */
> u64 startpurr; /* PURR/TB value snapshot */
> + u64 startspurr; /* SPURR value snapshot */
> + u64 purrdelta; /* FIXME: document */
> + u64 spurrdelta; /* FIXME: document */
> };
>
> extern struct paca_struct paca[];
--
Warm Regards,
Balbir Singh
Linux Technology Center
IBM, ISTL
^ permalink raw reply
* Re: [PATCH] [POWERPC] Invalid semicolon after if statement
From: Michael Ellerman @ 2007-08-16 8:08 UTC (permalink / raw)
To: Ilpo Järvinen; +Cc: linuxppc-dev, paulus
In-Reply-To: <Pine.LNX.4.64.0708151644090.15670@kivilampi-30.cs.helsinki.fi>
[-- Attachment #1: Type: text/plain, Size: 1801 bytes --]
On Thu, 2007-08-16 at 01:03 +0300, Ilpo Järvinen wrote:
> A similar fix to netfilter from Eric Dumazet inspired me to
> look around a bit by using some grep/sed stuff as looking for
> this kind of bugs seemed easy to automate. This is one of them
> I found where it looks like this semicolon is not valid.
>
> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
> ---
>
> ...Since I'm not familiar with these parts of the kernel, you might know
> better than I do if this is stuff is valid...
>
> arch/powerpc/mm/hash_utils_64.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c
> index f178957..a47151e 100644
> --- a/arch/powerpc/mm/hash_utils_64.c
> +++ b/arch/powerpc/mm/hash_utils_64.c
> @@ -795,7 +795,7 @@ void hash_preload(struct mm_struct *mm, unsigned long ea,
>
> #ifdef CONFIG_PPC_MM_SLICES
> /* We only prefault standard pages for now */
> - if (unlikely(get_slice_psize(mm, ea) != mm->context.user_psize));
> + if (unlikely(get_slice_psize(mm, ea) != mm->context.user_psize))
> return;
> #endif
Er yeah that's bad. On kernels with MM_SLICES set we never prefault
anything .. oops ..
And testing confirms that's what's happening, with the semicolon gone we
do prefault somethings.
Thanks to the frickin compiler for warning us, not.
This should probably go to stable for 22 IMHO.
Nice catch Ilpo, perhaps someone should hack sparse to check for that
sort of thing.
cheers
--
Michael Ellerman
OzLabs, IBM Australia Development Lab
wwweb: http://michael.ellerman.id.au
phone: +61 2 6212 1183 (tie line 70 21183)
We do not inherit the earth from our ancestors,
we borrow it from our children. - S.M.A.R.T Person
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
^ permalink raw reply
* Re: PS3 improved video mode autodetection for HDMI/DVI
From: Stefan Assmann @ 2007-08-16 8:07 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Linux/PPC Development, Cell Broadband Engine OSS Development,
Ben Collins
In-Reply-To: <Pine.LNX.4.62.0707121029320.12797@pademelon.sonytel.be>
Geert Uytterhoeven schrieb:
> If it fails, please add `#define DEBUG' to drivers/ps3/ps3av.c, send me the
> `Monitor Info' output in the kernel log (dmesg), and tell me which of the
> PS3 video modes (1-13) work and which don't. ps3av has a quirk database for
> monitors that advertise non-working modes, so it can probably be fixed.
> (BTW, even if autodetect works fine, I always welcome this information)
>
Samsung SyncMaster 226BW
The autodetection leaves me with an unsupported resolution. I tried
adding the monitor to the quirk list. Works fine now. Using 720p as
default resolution might be worth a thought. This should work on all HD
screen.
GOOD: 2,3,5,7,8,10,11,12,13
BAD: 1,4,6,9
Monitor Info: size 96
avport: 00
monitor_id: 4c 2d 7f 02 32 32 45 4d 0d 11
monitor_type: 02
monitor_name: SyncMaster
resolution_60: bits: 0000000d native: 00000000
resolution_50: bits: 00000000 native: 00000000
resolution_other: bits: 00000000 native: 00000000
resolution_vesa: bits: 00000001 native: 00000000
color space rgb: 01
color space yuv444: 00
color space yuv422: 00
color info red: X 0293 Y 0155
color info green: X 0125 Y 0269
color info blue: X 009c Y 0051
color info white: X 0141 Y 0151
color info gamma: 000000dc
supported_AI: 00
speaker_info: 00
num of audio: 00
ps3av_hdmi_get_id: Using supported mode 4
btw, I get the following message while booting:
PS3AV_CID_AV_VIDEO_DISABLE_SIG: failed 2 port 10
does this ring a bell? I'm using kernel 2.6.22 with ps3 patches
Stefan
^ permalink raw reply
* Problem getting a webserver running
From: Johan Borkhuis @ 2007-08-16 8:01 UTC (permalink / raw)
To: linuxppc-embedded
Hello,
I am trying to get a webserver on my embedded target box (an MVME3100
PPC board, running ELDK 4.1 with kernel 2.6.14). I can start httpd, but
when I try to connect I do not get any data. The connection is
established (using telnet localhost 80), but I do not get any data back
from the server. I also do not see any entries in the logfile.
Also, when I use appWeb or GoAhead webserver, I see the same problem.
What could be causing this?
Kind regards,
Johan Borkhuis
^ permalink raw reply
* Re: [PATCH 1/2] Add scaled time to taskstats based process accounting
From: Balbir Singh @ 2007-08-16 7:26 UTC (permalink / raw)
To: Michael Neuling; +Cc: Andrew Morton, linuxppc-dev, Paul Mackerras, linux-kernel
In-Reply-To: <20070816070922.37B5370074@localhost.localdomain>
Hi, Michael,
Thanks for doing this, this is really useful.
Michael Neuling wrote:
> This adds two items to the taststats struct to account for user and
> system time based on scaling the CPU frequency and instruction issue
> rates.
>
> Adds account_(user|system)_time_scaled callbacks which architectures
> can use to account for time using this mechanism.
>
> Signed-off-by: Michael Neuling <mikey@neuling.org>
>
> ---
>
> include/linux/kernel_stat.h | 2 ++
> include/linux/sched.h | 2 +-
> include/linux/taskstats.h | 6 +++++-
> kernel/fork.c | 2 ++
> kernel/sched.c | 21 +++++++++++++++++++++
> kernel/timer.c | 7 +++++--
> kernel/tsacct.c | 4 ++++
> 7 files changed, 40 insertions(+), 4 deletions(-)
>
> Index: linux-2.6-ozlabs/include/linux/kernel_stat.h
> ===================================================================
> --- linux-2.6-ozlabs.orig/include/linux/kernel_stat.h
> +++ linux-2.6-ozlabs/include/linux/kernel_stat.h
> @@ -52,7 +52,9 @@ static inline int kstat_irqs(int irq)
> }
>
> extern void account_user_time(struct task_struct *, cputime_t);
> +extern void account_user_time_scaled(struct task_struct *, cputime_t);
> extern void account_system_time(struct task_struct *, int, cputime_t);
> +extern void account_system_time_scaled(struct task_struct *, cputime_t);
> extern void account_steal_time(struct task_struct *, cputime_t);
>
> #endif /* _LINUX_KERNEL_STAT_H */
> Index: linux-2.6-ozlabs/include/linux/sched.h
> ===================================================================
> --- linux-2.6-ozlabs.orig/include/linux/sched.h
> +++ linux-2.6-ozlabs/include/linux/sched.h
> @@ -1020,7 +1020,7 @@ struct task_struct {
> int __user *clear_child_tid; /* CLONE_CHILD_CLEARTID */
>
> unsigned int rt_priority;
> - cputime_t utime, stime;
> + cputime_t utime, stime, utimescaled, stimescaled;
> unsigned long nvcsw, nivcsw; /* context switch counts */
> struct timespec start_time; /* monotonic time */
> struct timespec real_start_time; /* boot based time */
> Index: linux-2.6-ozlabs/include/linux/taskstats.h
> ===================================================================
> --- linux-2.6-ozlabs.orig/include/linux/taskstats.h
> +++ linux-2.6-ozlabs/include/linux/taskstats.h
> @@ -31,7 +31,7 @@
> */
>
>
> -#define TASKSTATS_VERSION 5
> +#define TASKSTATS_VERSION 6
> #define TS_COMM_LEN 32 /* should be >= TASK_COMM_LEN
> * in linux/sched.h */
>
> @@ -142,6 +142,10 @@ struct taskstats {
> __u64 write_char; /* bytes written */
> __u64 read_syscalls; /* read syscalls */
> __u64 write_syscalls; /* write syscalls */
> +
> + /* time accounting for SMT machines */
> + __u64 ac_utimescaled; /* utime scaled on frequency etc */
> + __u64 ac_stimescaled; /* stime scaled on frequency etc */
> /* Extended accounting fields end */
>
I'd also request for you to add a cpu_scaled_run_real_total for use
by delay accounting. cpu_scaled_run_real_total should be similar in
functionality to cpu_run_real_total.
> #define TASKSTATS_HAS_IO_ACCOUNTING
> Index: linux-2.6-ozlabs/kernel/fork.c
> ===================================================================
> --- linux-2.6-ozlabs.orig/kernel/fork.c
> +++ linux-2.6-ozlabs/kernel/fork.c
> @@ -1045,6 +1045,8 @@ static struct task_struct *copy_process(
>
> p->utime = cputime_zero;
> p->stime = cputime_zero;
> + p->utimescaled = cputime_zero;
> + p->stimescaled = cputime_zero;
>
> #ifdef CONFIG_TASK_XACCT
> p->rchar = 0; /* I/O counter: bytes read */
> Index: linux-2.6-ozlabs/kernel/sched.c
> ===================================================================
> --- linux-2.6-ozlabs.orig/kernel/sched.c
> +++ linux-2.6-ozlabs/kernel/sched.c
> @@ -3249,6 +3249,16 @@ void account_user_time(struct task_struc
> }
>
> /*
> + * Account scaled user cpu time to a process.
> + * @p: the process that the cpu time gets accounted to
> + * @cputime: the cpu time spent in user space since the last update
> + */
> +void account_user_time_scaled(struct task_struct *p, cputime_t cputime)
> +{
> + p->utimescaled = cputime_add(p->utimescaled, cputime);
> +}
> +
> +/*
> * Account system cpu time to a process.
> * @p: the process that the cpu time gets accounted to
> * @hardirq_offset: the offset to subtract from hardirq_count()
> @@ -3280,6 +3290,17 @@ void account_system_time(struct task_str
> }
>
> /*
> + * Account scaled system cpu time to a process.
> + * @p: the process that the cpu time gets accounted to
> + * @hardirq_offset: the offset to subtract from hardirq_count()
> + * @cputime: the cpu time spent in kernel space since the last update
> + */
> +void account_system_time_scaled(struct task_struct *p, cputime_t cputime)
> +{
> + p->stimescaled = cputime_add(p->stimescaled, cputime);
> +}
> +
> +/*
> * Account for involuntary wait time.
> * @p: the process from which the cpu time has been stolen
> * @steal: the cpu time spent in involuntary wait
> Index: linux-2.6-ozlabs/kernel/timer.c
> ===================================================================
> --- linux-2.6-ozlabs.orig/kernel/timer.c
> +++ linux-2.6-ozlabs/kernel/timer.c
> @@ -826,10 +826,13 @@ void update_process_times(int user_tick)
> int cpu = smp_processor_id();
>
> /* Note: this timer irq context must be accounted for as well. */
> - if (user_tick)
> + if (user_tick) {
> account_user_time(p, jiffies_to_cputime(1));
> - else
> + account_user_time_scaled(p, jiffies_to_cputime(1));
> + } else {
> account_system_time(p, HARDIRQ_OFFSET, jiffies_to_cputime(1));
> + account_system_time_scaled(p, jiffies_to_cputime(1));
> + }
I am a little confused here, scaled accounting and regular accounting
go hand in hand?
> run_local_timers();
> if (rcu_pending(cpu))
> rcu_check_callbacks(cpu, user_tick);
> Index: linux-2.6-ozlabs/kernel/tsacct.c
> ===================================================================
> --- linux-2.6-ozlabs.orig/kernel/tsacct.c
> +++ linux-2.6-ozlabs/kernel/tsacct.c
> @@ -62,6 +62,10 @@ void bacct_add_tsk(struct taskstats *sta
> rcu_read_unlock();
> stats->ac_utime = cputime_to_msecs(tsk->utime) * USEC_PER_MSEC;
> stats->ac_stime = cputime_to_msecs(tsk->stime) * USEC_PER_MSEC;
> + stats->ac_utimescaled =
> + cputime_to_msecs(tsk->utimescaled) * USEC_PER_MSEC;
> + stats->ac_stimescaled =
> + cputime_to_msecs(tsk->stimescaled) * USEC_PER_MSEC;
> stats->ac_minflt = tsk->min_flt;
> stats->ac_majflt = tsk->maj_flt;
>
--
Warm Regards,
Balbir Singh
Linux Technology Center
IBM, ISTL
^ permalink raw reply
* Re: [PATCH] [POWERPC] Invalid semicolon after if statement
From: Geert Uytterhoeven @ 2007-08-16 7:22 UTC (permalink / raw)
To: Ilpo Järvinen; +Cc: linuxppc-dev, paulus
In-Reply-To: <Pine.LNX.4.64.0708151644090.15670@kivilampi-30.cs.helsinki.fi>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: TEXT/PLAIN; charset=UTF-8, Size: 1810 bytes --]
On Thu, 16 Aug 2007, [ISO-8859-1] Ilpo Järvinen wrote:
> A similar fix to netfilter from Eric Dumazet inspired me to
> look around a bit by using some grep/sed stuff as looking for
> this kind of bugs seemed easy to automate. This is one of them
> I found where it looks like this semicolon is not valid.
>
> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@helsinki.fi>
> ---
>
> ...Since I'm not familiar with these parts of the kernel, you might know
> better than I do if this is stuff is valid...
>
> arch/powerpc/mm/hash_utils_64.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c
> index f178957..a47151e 100644
> --- a/arch/powerpc/mm/hash_utils_64.c
> +++ b/arch/powerpc/mm/hash_utils_64.c
> @@ -795,7 +795,7 @@ void hash_preload(struct mm_struct *mm, unsigned long ea,
>
> #ifdef CONFIG_PPC_MM_SLICES
> /* We only prefault standard pages for now */
> - if (unlikely(get_slice_psize(mm, ea) != mm->context.user_psize));
> + if (unlikely(get_slice_psize(mm, ea) != mm->context.user_psize))
> return;
> #endif
Interestingly the test has `unlikely'. So the bug showed up in the `likely'
case...
With kind regards,
Geert Uytterhoeven
Software Architect
Sony Network and Software Technology Center Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium
Phone: +32 (0)2 700 8453
Fax: +32 (0)2 700 8622
E-mail: Geert.Uytterhoeven@sonycom.com
Internet: http://www.sony-europe.com/
Sony Network and Software Technology Center Europe
A division of Sony Service Centre (Europe) N.V.
Registered office: Technologielaan 7 · B-1840 Londerzeel · Belgium
VAT BE 0413.825.160 · RPR Brussels
Fortis Bank Zaventem · Swift GEBABEBB08A · IBAN BE39001382358619
^ permalink raw reply
* Re: [PATCH v2] powerpc: add setmaskedbits macros
From: Geert Uytterhoeven @ 2007-08-16 7:19 UTC (permalink / raw)
To: Michael Ellerman; +Cc: linuxppc-dev, paulus, Timur Tabi
In-Reply-To: <1187236548.8375.13.camel@concordia.ozlabs.ibm.com>
[-- Attachment #1: Type: TEXT/PLAIN, Size: 1282 bytes --]
On Thu, 16 Aug 2007, Michael Ellerman wrote:
> Can you extract the masking logic, rather than repeating it 7 times:
>
> #define maskbits(a, v, m) ((a) & ~(m) | (v))
>
> And if you're going to the trouble of making a macro, why not make it a
> bit more useful and have it check that the value and the mask match, ie:
>
> (v & ~m == 0)
>
> Final random thought, you could make the size/endian an argument:
>
> #define setmaskedbits(a, v, m, s) out_##s((a), (in_##s(a) & ~(m) | (v))
For readability, you can change the parameter names `v' and `m' to e.g. `set'
and `clear' (or `clr'), so people don't have to look through the actual
definitions to know which one comes first?
With kind regards,
Geert Uytterhoeven
Software Architect
Sony Network and Software Technology Center Europe
The Corporate Village · Da Vincilaan 7-D1 · B-1935 Zaventem · Belgium
Phone: +32 (0)2 700 8453
Fax: +32 (0)2 700 8622
E-mail: Geert.Uytterhoeven@sonycom.com
Internet: http://www.sony-europe.com/
Sony Network and Software Technology Center Europe
A division of Sony Service Centre (Europe) N.V.
Registered office: Technologielaan 7 · B-1840 Londerzeel · Belgium
VAT BE 0413.825.160 · RPR Brussels
Fortis Bank Zaventem · Swift GEBABEBB08A · IBAN BE39001382358619
^ 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