* Re: [PATCH] * mpc8313erdb.dts: Fixed eTSEC interrupt assignment.
From: Scott Wood @ 2009-10-14 15:27 UTC (permalink / raw)
To: Richard Cochran
Cc: 'linuxppc-dev@lists.ozlabs.org', 'Roland Lezuo'
In-Reply-To: <95DC1AA8EC908B48939B72CF375AA5E30E220693@alice.at.omicron.at>
On Wed, Oct 14, 2009 at 09:41:33AM +0200, Richard Cochran wrote:
> >-----Original Message-----
> >From: linuxppc-dev-bounces On Behalf Of Scott Wood
> >Sent: Wednesday, September 09, 2009 8:22 PM
> >To: Roland Lezuo
> >Cc: linuxppc-dev@lists.ozlabs.org
> >Subject: Re: [PATCH] * mpc8313erdb.dts: Fixed eTSEC interrupt assignment.
> >
> >On Fri, Sep 04, 2009 at 12:31:25PM +0200, Roland Lezuo wrote:
> >> The following patch is needed to correctly assign the IRQs for the
> >> gianfar driver on the MPC8313ERDB-revc boards. ERR and TX are swapped
> >> as well as the interrupt lines for the two devices.
> >
> >And it will incorrectly assign them on older revisions of the chip.
> >
> >We really should have a u-boot fixup based on SVR.
>
> Why not just offer different dts files, one for each board revision?
>
> Something like:
> mpc8313erdb-revA.dts
> mpc8313erdb-revB.dts
> mpc8313erdb-revC.dts
Because that would be three times the device trees to maintain, and a
source of user confusion.
-Scott
^ permalink raw reply
* Re: UBIFS problem on MPC8536DS
From: Felix Radensky @ 2009-10-14 13:21 UTC (permalink / raw)
To: Adrian Hunter; +Cc: linuxppc-dev@ozlabs.org, linux-mtd@lists.infradead.org
In-Reply-To: <4AD5C5B4.3060303@nokia.com>
Adrian Hunter wrote:
> Felix Radensky wrote:
>> Hi,
>>
>> I have a strange problem in linux-2.6.31 running on MPC8536DS board.
>> It is 100% reproducible, by opening a 350MB tar file into ubifs volume
>> on NAND flash, and starting erase of NOR flash partition right after
>> that.
>>
>> If I don't start NOR erase, everything works fine. Also, If I run
>> sync after
>> tar, no problem occurs. The NOR flash is 32MB Spansion, NAND is
>> 4GB Samsung.
>>
>> The error messages are as follows:
>>
>> UBI error: ubi_io_write: error -5 while writing 2048 bytes to PEB
>> 5812:12288, written 0 bytes
>> UBI warning: ubi_eba_write_leb: failed to write data to PEB 5812
>> UBI: recover PEB 5812, move data to PEB 19400
>> UBI error: ubi_io_read: error -74 while reading 512 bytes from PEB
>> 5812:512, read 512 bytes
>> UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB
>> 19400:512, written 0 bytes
>> UBI warning: recover_peb: failed to write to PEB 19400
>> UBI: try again
>> UBI: recover PEB 5812, move data to PEB 19401
>> UBI: run torture test for PEB 19400
>> UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB
>> 19401:512, written 0 bytes
>> UBI warning: recover_peb: failed to write to PEB 19401
>> UBI: try again
>> UBI: recover PEB 5812, move data to PEB 19402
>> UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB
>> 19402:512, written 0 bytes
>> UBI warning: recover_peb: failed to write to PEB 19402
>> UBI: try again
>> UBI: recover PEB 5812, move data to PEB 19403
>> UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB
>> 19403:512, written 0 bytes
>> UBI warning: recover_peb: failed to write to PEB 19403
>> UBI warning: ubi_ro_mode: switch to read-only mode
>> UBIFS error (pid 1149): ubifs_wbuf_write_nolock: cannot write 2522
>> bytes to LEB 389:10240, error -5
>> UBIFS warning (pid 1149): ubifs_ro_mode: switched to read-only mode,
>> error -5
>> UBIFS error (pid 1149): do_writepage: cannot write page 0 of inode
>> 30708, error -5
>> UBIFS error (pid 1149): make_reservation: cannot reserve 858 bytes in
>> jhead 2, error -30
>> UBIFS error (pid 1149): do_writepage: cannot write page 2 of inode
>> 29486, error -30
>> UBIFS error (pid 1149): make_reservation: cannot reserve 721 bytes in
>> jhead 2, error -30
>> UBIFS error (pid 1149): do_writepage: cannot write page 1 of inode
>> 30070, error -30
>> UBI error: ubi_io_write: error -5 while writing 2048 bytes to PEB
>> 5022:88064, written 0 bytes
>> UBI warning: ubi_eba_write_leb: failed to write data to PEB 5022
>> UBI: recover PEB 5022, move data to PEB 19404
>> UBI error: ubi_io_read: error -74 while reading 512 bytes from PEB
>> 5022:512, read 512 bytes
>> UBI error: ubi_io_write: read-only mode
>> UBI warning: recover_peb: failed to write to PEB 19404
>> UBI: try again
>> UBI: recover PEB 5022, move data to PEB 19405
>> UBI error: ubi_io_write: read-only mode
>> UBI warning: recover_peb: failed to write to PEB 19405
>> UBI: try again
>> UBI: recover PEB 5022, move data to PEB 19406
>> UBI error: ubi_io_write: read-only mode
>> UBI warning: recover_peb: failed to write to PEB 19406
>> UBI: try again
>> UBI: recover PEB 5022, move data to PEB 19407
>> UBI error: ubi_io_write: read-only mode
>> UBI warning: recover_peb: failed to write to PEB 19407
>> UBIFS error (pid 1044): ubifs_wbuf_sync_nolock: cannot write 2048
>> bytes to LEB 788:86016
>> UBIFS error (pid 1044): ubifs_bg_wbufs_sync: cannot sync
>> write-buffer, error -30
>> UBIFS warning (pid 1044): ubifs_ro_mode: switched to read-only mode,
>> error -30
>> UBI error: ubi_io_write: error -5 while writing 2048 bytes to PEB
>> 5817:26624, written 0 bytes
>> UBI warning: ubi_eba_write_leb: failed to write data to PEB 5817
>> UBI: recover PEB 5817, move data to PEB 19408
>> UBI error: ubi_io_read: error -74 while reading 512 bytes from PEB
>> 5817:512, read 512 bytes
>> UBI error: ubi_io_write: read-only mode
>> UBI warning: recover_peb: failed to write to PEB 19408
>> UBI: try again
>> UBI: recover PEB 5817, move data to PEB 19409
>> UBI error: ubi_io_write: read-only mode
>> UBI warning: recover_peb: failed to write to PEB 19409
>> UBI: try again
>> UBI: recover PEB 5817, move data to PEB 19410
>> UBI error: ubi_io_write: read-only mode
>> UBI warning: recover_peb: failed to write to PEB 19410
>> UBI: try again
>> UBI: recover PEB 5817, move data to PEB 19411
>> UBI error: ubi_io_write: read-only mode
>> UBI warning: recover_peb: failed to write to PEB 19411
>> UBIFS error (pid 1047): ubifs_wbuf_sync_nolock: cannot write 2048
>> bytes to LEB 385:24576
>> UBIFS error (pid 1047): ubifs_bg_wbufs_sync: cannot sync
>> write-buffer, error -30
>> UBIFS error (pid 1149): make_reservation: cannot reserve 160 bytes in
>> jhead 1, error -30
>> UBIFS error (pid 1149): ubifs_write_inode: can't write inode 30709,
>> error -30
>> UBIFS error (pid 1149): make_reservation: cannot reserve 160 bytes in
>> jhead 1, error -30
>> UBIFS error (pid 1149): ubifs_write_inode: can't write inode 30710,
>> error -30
>> UBIFS error (pid 1149): make_reservation: cannot reserve 160 bytes in
>> jhead 1, error -30
>> UBIFS error (pid 1149): ubifs_write_inode: can't write inode 30698,
>> error -30
>> UBIFS error (pid 1149): make_reservation: cannot reserve 160 bytes in
>> jhead 1, error -30
>> UBIFS error (pid 1149): ubifs_write_inode: can't write inode 30711,
>> error -30
>>
>> I'd appreciate any hints on what can cause this. Is it a hardware
>> problem, mtd layer problem
>> or UBI problem ?
>
> It sounds like you are saying one MTD partition somehow affects another.
> You should check the MTD partitions are set up correctly. Are you using
> tools that make assumptions about which mtd partition is which?
>
> How do you erase the NOR flash? Is the device node (/dev/mtd...)
> correct?
I can also reproduce the problem by reading from NOR, i.e.
dd if=/dev/mtd4 of=/dev/null
Felix.
>
>
>
> ______________________________________________________
> Linux MTD discussion mailing list
> http://lists.infradead.org/mailman/listinfo/linux-mtd/
^ permalink raw reply
* MPC5200B and USB
From: FIXED-TERM Seeh Thomas (BEG/EMS1) @ 2009-10-14 12:57 UTC (permalink / raw)
To: linuxppc-dev@lists.ozlabs.org
[-- Attachment #1: Type: text/plain, Size: 887 bytes --]
Hello everyone,
I'm working on a project to get USB ready on a MPC5200B based board.
On this board I'm not using Linux (but MQX), but my question is not related to Linux.
It's more specific to USB and OHCI.
I will communicate with a Mass Storage Device and therefor the control transfer works fine.
The Mass Storage Device has two endpoints for bulk transfer, one IN (from device to host) and
one OUT (from host to device).
If I want to communicate with the device should I have two endpoints on the host side too?
This would mean one endpoint which is associated with the IN endpoint to the device and one endpoint which
is associated with OUT endpoint to the device. Is that right?
For example I want to send a INQUIRY command to the device. Which endpoint must I use
to send the command and on which endpoint do I receive the question?
Best regards
Thomas
[-- Attachment #2: Type: text/html, Size: 1544 bytes --]
^ permalink raw reply
* Re: UBIFS problem on MPC8536DS
From: Felix Radensky @ 2009-10-14 13:02 UTC (permalink / raw)
To: Adrian Hunter; +Cc: linuxppc-dev@ozlabs.org, linux-mtd@lists.infradead.org
In-Reply-To: <4AD5C5B4.3060303@nokia.com>
Hi, Adrian
Adrian Hunter wrote:
> Felix Radensky wrote:
>> Hi,
>>
>> I have a strange problem in linux-2.6.31 running on MPC8536DS board.
>> It is 100% reproducible, by opening a 350MB tar file into ubifs volume
>> on NAND flash, and starting erase of NOR flash partition right after
>> that.
>>
>> If I don't start NOR erase, everything works fine. Also, If I run
>> sync after
>> tar, no problem occurs. The NOR flash is 32MB Spansion, NAND is
>> 4GB Samsung.
>>
>> The error messages are as follows:
>>
>> UBI error: ubi_io_write: error -5 while writing 2048 bytes to PEB
>> 5812:12288, written 0 bytes
>> UBI warning: ubi_eba_write_leb: failed to write data to PEB 5812
>> UBI: recover PEB 5812, move data to PEB 19400
>> UBI error: ubi_io_read: error -74 while reading 512 bytes from PEB
>> 5812:512, read 512 bytes
>> UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB
>> 19400:512, written 0 bytes
>> UBI warning: recover_peb: failed to write to PEB 19400
>> UBI: try again
>> UBI: recover PEB 5812, move data to PEB 19401
>> UBI: run torture test for PEB 19400
>> UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB
>> 19401:512, written 0 bytes
>> UBI warning: recover_peb: failed to write to PEB 19401
>> UBI: try again
>> UBI: recover PEB 5812, move data to PEB 19402
>> UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB
>> 19402:512, written 0 bytes
>> UBI warning: recover_peb: failed to write to PEB 19402
>> UBI: try again
>> UBI: recover PEB 5812, move data to PEB 19403
>> UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB
>> 19403:512, written 0 bytes
>> UBI warning: recover_peb: failed to write to PEB 19403
>> UBI warning: ubi_ro_mode: switch to read-only mode
>> UBIFS error (pid 1149): ubifs_wbuf_write_nolock: cannot write 2522
>> bytes to LEB 389:10240, error -5
>> UBIFS warning (pid 1149): ubifs_ro_mode: switched to read-only mode,
>> error -5
>> UBIFS error (pid 1149): do_writepage: cannot write page 0 of inode
>> 30708, error -5
>> UBIFS error (pid 1149): make_reservation: cannot reserve 858 bytes in
>> jhead 2, error -30
>> UBIFS error (pid 1149): do_writepage: cannot write page 2 of inode
>> 29486, error -30
>> UBIFS error (pid 1149): make_reservation: cannot reserve 721 bytes in
>> jhead 2, error -30
>> UBIFS error (pid 1149): do_writepage: cannot write page 1 of inode
>> 30070, error -30
>> UBI error: ubi_io_write: error -5 while writing 2048 bytes to PEB
>> 5022:88064, written 0 bytes
>> UBI warning: ubi_eba_write_leb: failed to write data to PEB 5022
>> UBI: recover PEB 5022, move data to PEB 19404
>> UBI error: ubi_io_read: error -74 while reading 512 bytes from PEB
>> 5022:512, read 512 bytes
>> UBI error: ubi_io_write: read-only mode
>> UBI warning: recover_peb: failed to write to PEB 19404
>> UBI: try again
>> UBI: recover PEB 5022, move data to PEB 19405
>> UBI error: ubi_io_write: read-only mode
>> UBI warning: recover_peb: failed to write to PEB 19405
>> UBI: try again
>> UBI: recover PEB 5022, move data to PEB 19406
>> UBI error: ubi_io_write: read-only mode
>> UBI warning: recover_peb: failed to write to PEB 19406
>> UBI: try again
>> UBI: recover PEB 5022, move data to PEB 19407
>> UBI error: ubi_io_write: read-only mode
>> UBI warning: recover_peb: failed to write to PEB 19407
>> UBIFS error (pid 1044): ubifs_wbuf_sync_nolock: cannot write 2048
>> bytes to LEB 788:86016
>> UBIFS error (pid 1044): ubifs_bg_wbufs_sync: cannot sync
>> write-buffer, error -30
>> UBIFS warning (pid 1044): ubifs_ro_mode: switched to read-only mode,
>> error -30
>> UBI error: ubi_io_write: error -5 while writing 2048 bytes to PEB
>> 5817:26624, written 0 bytes
>> UBI warning: ubi_eba_write_leb: failed to write data to PEB 5817
>> UBI: recover PEB 5817, move data to PEB 19408
>> UBI error: ubi_io_read: error -74 while reading 512 bytes from PEB
>> 5817:512, read 512 bytes
>> UBI error: ubi_io_write: read-only mode
>> UBI warning: recover_peb: failed to write to PEB 19408
>> UBI: try again
>> UBI: recover PEB 5817, move data to PEB 19409
>> UBI error: ubi_io_write: read-only mode
>> UBI warning: recover_peb: failed to write to PEB 19409
>> UBI: try again
>> UBI: recover PEB 5817, move data to PEB 19410
>> UBI error: ubi_io_write: read-only mode
>> UBI warning: recover_peb: failed to write to PEB 19410
>> UBI: try again
>> UBI: recover PEB 5817, move data to PEB 19411
>> UBI error: ubi_io_write: read-only mode
>> UBI warning: recover_peb: failed to write to PEB 19411
>> UBIFS error (pid 1047): ubifs_wbuf_sync_nolock: cannot write 2048
>> bytes to LEB 385:24576
>> UBIFS error (pid 1047): ubifs_bg_wbufs_sync: cannot sync
>> write-buffer, error -30
>> UBIFS error (pid 1149): make_reservation: cannot reserve 160 bytes in
>> jhead 1, error -30
>> UBIFS error (pid 1149): ubifs_write_inode: can't write inode 30709,
>> error -30
>> UBIFS error (pid 1149): make_reservation: cannot reserve 160 bytes in
>> jhead 1, error -30
>> UBIFS error (pid 1149): ubifs_write_inode: can't write inode 30710,
>> error -30
>> UBIFS error (pid 1149): make_reservation: cannot reserve 160 bytes in
>> jhead 1, error -30
>> UBIFS error (pid 1149): ubifs_write_inode: can't write inode 30698,
>> error -30
>> UBIFS error (pid 1149): make_reservation: cannot reserve 160 bytes in
>> jhead 1, error -30
>> UBIFS error (pid 1149): ubifs_write_inode: can't write inode 30711,
>> error -30
>>
>> I'd appreciate any hints on what can cause this. Is it a hardware
>> problem, mtd layer problem
>> or UBI problem ?
>
> It sounds like you are saying one MTD partition somehow affects another.
> You should check the MTD partitions are set up correctly. Are you using
> tools that make assumptions about which mtd partition is which?
>
> How do you erase the NOR flash? Is the device node (/dev/mtd...)
> correct?
>
>
I use flash_eraseall /dev/mtd4 to erase NOR. The version of mtd-utils is
from
latest mtd-utils git tree. The device nodes for NOR (mtd4) and NAND (mtd7)
are correct:
crwxr-xr-x 1 root root 90, 8 2005-08-07 13:11 mtd4
crw-r--r-- 1 root root 90, 14 2008-07-16 18:51 mtd7
Felix.
^ permalink raw reply
* Re: UBIFS problem on MPC8536DS
From: Adrian Hunter @ 2009-10-14 12:36 UTC (permalink / raw)
To: Felix Radensky; +Cc: linuxppc-dev@ozlabs.org, linux-mtd@lists.infradead.org
In-Reply-To: <4AD5ADC9.30503@embedded-sol.com>
Felix Radensky wrote:
> Hi,
>
> I have a strange problem in linux-2.6.31 running on MPC8536DS board.
> It is 100% reproducible, by opening a 350MB tar file into ubifs volume
> on NAND flash, and starting erase of NOR flash partition right after that.
>
> If I don't start NOR erase, everything works fine. Also, If I run sync
> after
> tar, no problem occurs. The NOR flash is 32MB Spansion, NAND is
> 4GB Samsung.
>
> The error messages are as follows:
>
> UBI error: ubi_io_write: error -5 while writing 2048 bytes to PEB
> 5812:12288, written 0 bytes
> UBI warning: ubi_eba_write_leb: failed to write data to PEB 5812
> UBI: recover PEB 5812, move data to PEB 19400
> UBI error: ubi_io_read: error -74 while reading 512 bytes from PEB
> 5812:512, read 512 bytes
> UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB
> 19400:512, written 0 bytes
> UBI warning: recover_peb: failed to write to PEB 19400
> UBI: try again
> UBI: recover PEB 5812, move data to PEB 19401
> UBI: run torture test for PEB 19400
> UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB
> 19401:512, written 0 bytes
> UBI warning: recover_peb: failed to write to PEB 19401
> UBI: try again
> UBI: recover PEB 5812, move data to PEB 19402
> UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB
> 19402:512, written 0 bytes
> UBI warning: recover_peb: failed to write to PEB 19402
> UBI: try again
> UBI: recover PEB 5812, move data to PEB 19403
> UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB
> 19403:512, written 0 bytes
> UBI warning: recover_peb: failed to write to PEB 19403
> UBI warning: ubi_ro_mode: switch to read-only mode
> UBIFS error (pid 1149): ubifs_wbuf_write_nolock: cannot write 2522 bytes
> to LEB 389:10240, error -5
> UBIFS warning (pid 1149): ubifs_ro_mode: switched to read-only mode,
> error -5
> UBIFS error (pid 1149): do_writepage: cannot write page 0 of inode
> 30708, error -5
> UBIFS error (pid 1149): make_reservation: cannot reserve 858 bytes in
> jhead 2, error -30
> UBIFS error (pid 1149): do_writepage: cannot write page 2 of inode
> 29486, error -30
> UBIFS error (pid 1149): make_reservation: cannot reserve 721 bytes in
> jhead 2, error -30
> UBIFS error (pid 1149): do_writepage: cannot write page 1 of inode
> 30070, error -30
> UBI error: ubi_io_write: error -5 while writing 2048 bytes to PEB
> 5022:88064, written 0 bytes
> UBI warning: ubi_eba_write_leb: failed to write data to PEB 5022
> UBI: recover PEB 5022, move data to PEB 19404
> UBI error: ubi_io_read: error -74 while reading 512 bytes from PEB
> 5022:512, read 512 bytes
> UBI error: ubi_io_write: read-only mode
> UBI warning: recover_peb: failed to write to PEB 19404
> UBI: try again
> UBI: recover PEB 5022, move data to PEB 19405
> UBI error: ubi_io_write: read-only mode
> UBI warning: recover_peb: failed to write to PEB 19405
> UBI: try again
> UBI: recover PEB 5022, move data to PEB 19406
> UBI error: ubi_io_write: read-only mode
> UBI warning: recover_peb: failed to write to PEB 19406
> UBI: try again
> UBI: recover PEB 5022, move data to PEB 19407
> UBI error: ubi_io_write: read-only mode
> UBI warning: recover_peb: failed to write to PEB 19407
> UBIFS error (pid 1044): ubifs_wbuf_sync_nolock: cannot write 2048 bytes
> to LEB 788:86016
> UBIFS error (pid 1044): ubifs_bg_wbufs_sync: cannot sync write-buffer,
> error -30
> UBIFS warning (pid 1044): ubifs_ro_mode: switched to read-only mode,
> error -30
> UBI error: ubi_io_write: error -5 while writing 2048 bytes to PEB
> 5817:26624, written 0 bytes
> UBI warning: ubi_eba_write_leb: failed to write data to PEB 5817
> UBI: recover PEB 5817, move data to PEB 19408
> UBI error: ubi_io_read: error -74 while reading 512 bytes from PEB
> 5817:512, read 512 bytes
> UBI error: ubi_io_write: read-only mode
> UBI warning: recover_peb: failed to write to PEB 19408
> UBI: try again
> UBI: recover PEB 5817, move data to PEB 19409
> UBI error: ubi_io_write: read-only mode
> UBI warning: recover_peb: failed to write to PEB 19409
> UBI: try again
> UBI: recover PEB 5817, move data to PEB 19410
> UBI error: ubi_io_write: read-only mode
> UBI warning: recover_peb: failed to write to PEB 19410
> UBI: try again
> UBI: recover PEB 5817, move data to PEB 19411
> UBI error: ubi_io_write: read-only mode
> UBI warning: recover_peb: failed to write to PEB 19411
> UBIFS error (pid 1047): ubifs_wbuf_sync_nolock: cannot write 2048 bytes
> to LEB 385:24576
> UBIFS error (pid 1047): ubifs_bg_wbufs_sync: cannot sync write-buffer,
> error -30
> UBIFS error (pid 1149): make_reservation: cannot reserve 160 bytes in
> jhead 1, error -30
> UBIFS error (pid 1149): ubifs_write_inode: can't write inode 30709,
> error -30
> UBIFS error (pid 1149): make_reservation: cannot reserve 160 bytes in
> jhead 1, error -30
> UBIFS error (pid 1149): ubifs_write_inode: can't write inode 30710,
> error -30
> UBIFS error (pid 1149): make_reservation: cannot reserve 160 bytes in
> jhead 1, error -30
> UBIFS error (pid 1149): ubifs_write_inode: can't write inode 30698,
> error -30
> UBIFS error (pid 1149): make_reservation: cannot reserve 160 bytes in
> jhead 1, error -30
> UBIFS error (pid 1149): ubifs_write_inode: can't write inode 30711,
> error -30
>
> I'd appreciate any hints on what can cause this. Is it a hardware
> problem, mtd layer problem
> or UBI problem ?
It sounds like you are saying one MTD partition somehow affects another.
You should check the MTD partitions are set up correctly. Are you using
tools that make assumptions about which mtd partition is which?
How do you erase the NOR flash? Is the device node (/dev/mtd...) correct?
^ permalink raw reply
* Re: [PATCH] Ftrace : fix function_graph tracer OOPS
From: Steven Rostedt @ 2009-10-14 12:12 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev
In-Reply-To: <1255500920.2347.41.camel@pasglop>
On Wed, 2009-10-14 at 17:15 +1100, Benjamin Herrenschmidt wrote:
> On Wed, 2009-10-14 at 11:43 +0530, Sachin Sant wrote:
>
> > Tested both the patches. Works fine.
>
> Thanks !
>
> Stephen, you merge these yourself or you need me to pick them up in
> -powerpc ?
>
Ben,
You can either pull from my repo (I synced with latest Linus), or you
can just suck in the patches. I can also resync with your repo if you
prefer.
Either way is fine with me. Just let me know which you did.
-- Steve
^ permalink raw reply
* [PATCH] powerpc: Prevent unsigned wrap in htab_dt_scan_page_sizes()
From: Roel Kluin @ 2009-10-14 12:12 UTC (permalink / raw)
To: paulus, benh, linuxppc-dev; +Cc: Andrew Morton
Check to prevent unsigned wrap of size before subtraction.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
Is this maybe better or are we certain that size can't wrap?
diff --git a/arch/powerpc/mm/hash_utils_64.c b/arch/powerpc/mm/hash_utils_64.c
index 1ade7eb..dd2d263 100644
--- a/arch/powerpc/mm/hash_utils_64.c
+++ b/arch/powerpc/mm/hash_utils_64.c
@@ -287,7 +287,7 @@ static int __init htab_dt_scan_page_sizes(unsigned long node,
DBG("Page sizes from device-tree:\n");
size /= 4;
cur_cpu_spec->cpu_features &= ~(CPU_FTR_16M_PAGE);
- while(size > 0) {
+ while(size >= 3) {
unsigned int shift = prop[0];
unsigned int slbenc = prop[1];
unsigned int lpnum = prop[2];
@@ -296,7 +296,7 @@ static int __init htab_dt_scan_page_sizes(unsigned long node,
int idx = -1;
size -= 3; prop += 3;
- while(size > 0 && lpnum) {
+ while(size >= 2 && lpnum) {
if (prop[0] == shift)
lpenc = prop[1];
prop += 2; size -= 2;
^ permalink raw reply related
* UBIFS problem on MPC8536DS
From: Felix Radensky @ 2009-10-14 10:54 UTC (permalink / raw)
To: linux-mtd, linuxppc-dev
Hi,
I have a strange problem in linux-2.6.31 running on MPC8536DS board.
It is 100% reproducible, by opening a 350MB tar file into ubifs volume
on NAND flash, and starting erase of NOR flash partition right after that.
If I don't start NOR erase, everything works fine. Also, If I run sync
after
tar, no problem occurs. The NOR flash is 32MB Spansion, NAND is
4GB Samsung.
The error messages are as follows:
UBI error: ubi_io_write: error -5 while writing 2048 bytes to PEB
5812:12288, written 0 bytes
UBI warning: ubi_eba_write_leb: failed to write data to PEB 5812
UBI: recover PEB 5812, move data to PEB 19400
UBI error: ubi_io_read: error -74 while reading 512 bytes from PEB
5812:512, read 512 bytes
UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB
19400:512, written 0 bytes
UBI warning: recover_peb: failed to write to PEB 19400
UBI: try again
UBI: recover PEB 5812, move data to PEB 19401
UBI: run torture test for PEB 19400
UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB
19401:512, written 0 bytes
UBI warning: recover_peb: failed to write to PEB 19401
UBI: try again
UBI: recover PEB 5812, move data to PEB 19402
UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB
19402:512, written 0 bytes
UBI warning: recover_peb: failed to write to PEB 19402
UBI: try again
UBI: recover PEB 5812, move data to PEB 19403
UBI error: ubi_io_write: error -5 while writing 512 bytes to PEB
19403:512, written 0 bytes
UBI warning: recover_peb: failed to write to PEB 19403
UBI warning: ubi_ro_mode: switch to read-only mode
UBIFS error (pid 1149): ubifs_wbuf_write_nolock: cannot write 2522 bytes
to LEB 389:10240, error -5
UBIFS warning (pid 1149): ubifs_ro_mode: switched to read-only mode,
error -5
UBIFS error (pid 1149): do_writepage: cannot write page 0 of inode
30708, error -5
UBIFS error (pid 1149): make_reservation: cannot reserve 858 bytes in
jhead 2, error -30
UBIFS error (pid 1149): do_writepage: cannot write page 2 of inode
29486, error -30
UBIFS error (pid 1149): make_reservation: cannot reserve 721 bytes in
jhead 2, error -30
UBIFS error (pid 1149): do_writepage: cannot write page 1 of inode
30070, error -30
UBI error: ubi_io_write: error -5 while writing 2048 bytes to PEB
5022:88064, written 0 bytes
UBI warning: ubi_eba_write_leb: failed to write data to PEB 5022
UBI: recover PEB 5022, move data to PEB 19404
UBI error: ubi_io_read: error -74 while reading 512 bytes from PEB
5022:512, read 512 bytes
UBI error: ubi_io_write: read-only mode
UBI warning: recover_peb: failed to write to PEB 19404
UBI: try again
UBI: recover PEB 5022, move data to PEB 19405
UBI error: ubi_io_write: read-only mode
UBI warning: recover_peb: failed to write to PEB 19405
UBI: try again
UBI: recover PEB 5022, move data to PEB 19406
UBI error: ubi_io_write: read-only mode
UBI warning: recover_peb: failed to write to PEB 19406
UBI: try again
UBI: recover PEB 5022, move data to PEB 19407
UBI error: ubi_io_write: read-only mode
UBI warning: recover_peb: failed to write to PEB 19407
UBIFS error (pid 1044): ubifs_wbuf_sync_nolock: cannot write 2048 bytes
to LEB 788:86016
UBIFS error (pid 1044): ubifs_bg_wbufs_sync: cannot sync write-buffer,
error -30
UBIFS warning (pid 1044): ubifs_ro_mode: switched to read-only mode,
error -30
UBI error: ubi_io_write: error -5 while writing 2048 bytes to PEB
5817:26624, written 0 bytes
UBI warning: ubi_eba_write_leb: failed to write data to PEB 5817
UBI: recover PEB 5817, move data to PEB 19408
UBI error: ubi_io_read: error -74 while reading 512 bytes from PEB
5817:512, read 512 bytes
UBI error: ubi_io_write: read-only mode
UBI warning: recover_peb: failed to write to PEB 19408
UBI: try again
UBI: recover PEB 5817, move data to PEB 19409
UBI error: ubi_io_write: read-only mode
UBI warning: recover_peb: failed to write to PEB 19409
UBI: try again
UBI: recover PEB 5817, move data to PEB 19410
UBI error: ubi_io_write: read-only mode
UBI warning: recover_peb: failed to write to PEB 19410
UBI: try again
UBI: recover PEB 5817, move data to PEB 19411
UBI error: ubi_io_write: read-only mode
UBI warning: recover_peb: failed to write to PEB 19411
UBIFS error (pid 1047): ubifs_wbuf_sync_nolock: cannot write 2048 bytes
to LEB 385:24576
UBIFS error (pid 1047): ubifs_bg_wbufs_sync: cannot sync write-buffer,
error -30
UBIFS error (pid 1149): make_reservation: cannot reserve 160 bytes in
jhead 1, error -30
UBIFS error (pid 1149): ubifs_write_inode: can't write inode 30709,
error -30
UBIFS error (pid 1149): make_reservation: cannot reserve 160 bytes in
jhead 1, error -30
UBIFS error (pid 1149): ubifs_write_inode: can't write inode 30710,
error -30
UBIFS error (pid 1149): make_reservation: cannot reserve 160 bytes in
jhead 1, error -30
UBIFS error (pid 1149): ubifs_write_inode: can't write inode 30698,
error -30
UBIFS error (pid 1149): make_reservation: cannot reserve 160 bytes in
jhead 1, error -30
UBIFS error (pid 1149): ubifs_write_inode: can't write inode 30711,
error -30
I'd appreciate any hints on what can cause this. Is it a hardware
problem, mtd layer problem
or UBI problem ?
Thanks a lot in advance.
Felix.
^ permalink raw reply
* RE: [PATCH] * mpc8313erdb.dts: Fixed eTSEC interrupt assignment.
From: Richard Cochran @ 2009-10-14 7:41 UTC (permalink / raw)
To: 'Scott Wood', 'Roland Lezuo'
Cc: 'linuxppc-dev@lists.ozlabs.org'
In-Reply-To: <20090909182227.GA8215@b07421-ec1.am.freescale.net>
>-----Original Message-----
>From: linuxppc-dev-bounces On Behalf Of Scott Wood
>Sent: Wednesday, September 09, 2009 8:22 PM
>To: Roland Lezuo
>Cc: linuxppc-dev@lists.ozlabs.org
>Subject: Re: [PATCH] * mpc8313erdb.dts: Fixed eTSEC interrupt assignment.
>
>On Fri, Sep 04, 2009 at 12:31:25PM +0200, Roland Lezuo wrote:
>> The following patch is needed to correctly assign the IRQs for the
>> gianfar driver on the MPC8313ERDB-revc boards. ERR and TX are swapped
>> as well as the interrupt lines for the two devices.
>
>And it will incorrectly assign them on older revisions of the chip.
>
>We really should have a u-boot fixup based on SVR.
Why not just offer different dts files, one for each board revision?
Something like:
mpc8313erdb-revA.dts
mpc8313erdb-revB.dts
mpc8313erdb-revC.dts
Richard
^ permalink raw reply
* Re: [v8 PATCH 2/8]: cpuidle: implement a list based approach to register a set of idle routines.
From: Andi Kleen @ 2009-10-14 7:18 UTC (permalink / raw)
To: Arun R Bharadwaj
Cc: linux-arch, Peter Zijlstra, linux-kernel, linux-acpi, Andi Kleen,
Ingo Molnar, linuxppc-dev, Arjan van de Ven
In-Reply-To: <20091014061727.GA8605@linux.vnet.ibm.com>
> How about something like this..
> If the arch does not enable CONFIG_CPU_IDLE, the cpuidle_idle_call
> which is called from cpu_idle() should call default_idle without
> involving the registering cpuidle steps. This should prevent bloating
> up of the kernel for archs which dont want to use cpuidle.
On x86 some people want small kernel too, so selecting it on a architecture
granuality is not good. Also you can make it default, you just need
to slim it down first.
-Andi
--
ak@linux.intel.com -- Speaking for myself only.
^ permalink raw reply
* [PATCH] Xilinx LL-TEMAC: Add Netpoll controller support
From: santosh shukla @ 2009-10-14 6:39 UTC (permalink / raw)
To: linuxppc-dev
From: Santosh Shukla <sshukla@sh.mvista.com>
Date: Tue, 13 Oct 2009 18:55:57 +0530
Subject: [PATCH] Xilinx LL-TEMAC: Add Netpoll controller support
Adding Netpoll controller support to Xilinx LL-TEMAC ethernet
driver.Replaced Rx, Tx tasklet schedule call with their handlers,
Added correct version of call which can execute interrupt on/off
context i.e. dev_kfree_skb_any().
---
drivers/net/xilinx_lltemac/xlltemac_main.c | 41 +++++++++++++++++++++++++++-
1 files changed, 40 insertions(+), 1 deletions(-)
diff --git a/drivers/net/xilinx_lltemac/xlltemac_main.c b/drivers/net/xilinx_lltemac/xlltemac_main.c
index b245422..697f474 100644
--- a/drivers/net/xilinx_lltemac/xlltemac_main.c
+++ b/drivers/net/xilinx_lltemac/xlltemac_main.c
@@ -87,11 +87,18 @@
#define BUFFER_ALIGNSEND_PERF(adr) ((ALIGNMENT_SEND_PERF - ((u32) adr)) % 32)
#define BUFFER_ALIGNRECV(adr) ((ALIGNMENT_RECV - ((u32) adr)) % 32)
+#ifndef CONFIG_NET_POLL_CONTROLLER
/* Default TX/RX Threshold and waitbound values for SGDMA mode */
#define DFT_TX_THRESHOLD 24
#define DFT_TX_WAITBOUND 254
#define DFT_RX_THRESHOLD 4
#define DFT_RX_WAITBOUND 254
+#else
+#define DFT_TX_THRESHOLD 1
+#define DFT_TX_WAITBOUND 0
+#define DFT_RX_THRESHOLD 1
+#define DFT_RX_WAITBOUND 0
+#endif
#define XTE_AUTOSTRIPPING 1
@@ -1097,7 +1104,11 @@ static irqreturn_t xenet_dma_rx_interrupt(int irq, void *dev_id)
list_add_tail(&lp->rcv, &receivedQueue);
XLlDma_mBdRingIntDisable(&lp->Dma.RxBdRing,
XLLDMA_CR_IRQ_ALL_EN_MASK);
+#ifndef CONFIG_NET_POLL_CONTROLLER
tasklet_schedule(&DmaRecvBH);
+#else
+ DmaRecvHandlerBH(0);
+#endif
}
spin_unlock_irqrestore(&receivedQueueSpin, flags);
}
@@ -1134,7 +1145,11 @@ static irqreturn_t xenet_dma_tx_interrupt(int irq, void *dev_id)
list_add_tail(&lp->xmit, &sentQueue);
XLlDma_mBdRingIntDisable(&lp->Dma.TxBdRing,
XLLDMA_CR_IRQ_ALL_EN_MASK);
+#ifndef CONFIG_NET_POLL_CONTROLLER
tasklet_schedule(&DmaSendBH);
+#else
+ DmaSendHandlerBH(0);
+#endif
}
spin_unlock_irqrestore(&sentQueueSpin, flags);
}
@@ -1711,11 +1726,15 @@ static int xenet_DmaSend(struct sk_buff *skb, struct net_device *dev)
* SgAlloc, SgCommit sequence, which also exists in DmaSendHandlerBH Bottom
* Half, or triggered by other processor in SMP case.
*/
+#ifndef CONFIG_NET_POLL_CONTROLLER
spin_lock_bh(&XTE_tx_spinlock);
+#endif
xenet_DmaSend_internal(skb, dev);
+#ifndef CONFIG_NET_POLL_CONTROLLER
spin_unlock_bh(&XTE_tx_spinlock);
+#endif
return 0;
}
@@ -1764,7 +1783,7 @@ static void DmaSendHandlerBH(unsigned long p)
skb = (struct sk_buff *)
XLlDma_mBdGetId(BdCurPtr);
if (skb)
- dev_kfree_skb(skb);
+ dev_kfree_skb_any(skb);
/* reset BD id */
XLlDma_mBdSetId(BdCurPtr, NULL);
@@ -3220,6 +3239,23 @@ static int detect_phy(struct net_local *lp, char *dev_name)
return 0; /* default to zero */
}
+#ifdef CONFIG_NET_POLL_CONTROLLER
+static void
+lltemac_poll_controller(struct net_device *ndev)
+{
+ struct net_local *lp = netdev_priv(ndev);
+
+ disable_irq(lp->dma_irq_s);
+ disable_irq(lp->dma_irq_r);
+
+ xenet_dma_tx_interrupt(lp->dma_irq_s, ndev);
+ xenet_dma_rx_interrupt(lp->dma_irq_r, ndev);
+
+ enable_irq(lp->dma_irq_s);
+ enable_irq(lp->dma_irq_r);
+}
+#endif
+
static struct net_device_ops xilinx_netdev_ops;
/* From include/linux/ethtool.h */
@@ -3491,6 +3527,9 @@ static struct net_device_ops xilinx_netdev_ops = {
.ndo_change_mtu = xenet_change_mtu,
.ndo_tx_timeout = xenet_tx_timeout,
.ndo_get_stats = xenet_get_stats,
+#ifdef CONFIG_NET_POLL_CONTROLLER
+ .ndo_poll_controller = lltemac_poll_controller,
+#endif
};
static struct of_device_id xtenet_fifo_of_match[] = {
--
1.6.3.3.220.g609a0
^ permalink raw reply related
* Xilinx LL-TEMAC: Add Netpoll controller support
From: santosh shukla @ 2009-10-14 5:53 UTC (permalink / raw)
To: linuxppc-dev; +Cc: Srikanth Krishnakar, john.linn
From: Santosh Shukla <sshukla@sh.mvista.com>
Date: Tue, 13 Oct 2009 18:55:57 +0530
Subject: [PATCH] Xilinx LL-TEMAC: Add Netpoll controller support
Adding Netpoll controller support to Xilinx LL-TEMAC ethernet
driver. Replaced Rx, Tx tasklets schedule call with their handlers,
Added correct version of call which can execute interrupt on/off
context i.e. dev_kfree_skb_any().
---
drivers/net/xilinx_lltemac/xlltemac_main.c | 41 +++++++++++++++++++++++++++-
1 files changed, 40 insertions(+), 1 deletions(-)
diff --git a/drivers/net/xilinx_lltemac/xlltemac_main.c b/drivers/net/xilinx_lltemac/xlltemac_main.c
index b245422..697f474 100644
--- a/drivers/net/xilinx_lltemac/xlltemac_main.c
+++ b/drivers/net/xilinx_lltemac/xlltemac_main.c
@@ -87,11 +87,18 @@
#define BUFFER_ALIGNSEND_PERF(adr) ((ALIGNMENT_SEND_PERF - ((u32) adr)) % 32)
#define BUFFER_ALIGNRECV(adr) ((ALIGNMENT_RECV - ((u32) adr)) % 32)
+#ifndef CONFIG_NET_POLL_CONTROLLER
/* Default TX/RX Threshold and waitbound values for SGDMA mode */
#define DFT_TX_THRESHOLD 24
#define DFT_TX_WAITBOUND 254
#define DFT_RX_THRESHOLD 4
#define DFT_RX_WAITBOUND 254
+#else
+#define DFT_TX_THRESHOLD 1
+#define DFT_TX_WAITBOUND 0
+#define DFT_RX_THRESHOLD 1
+#define DFT_RX_WAITBOUND 0
+#endif
#define XTE_AUTOSTRIPPING 1
@@ -1097,7 +1104,11 @@ static irqreturn_t xenet_dma_rx_interrupt(int irq, void *dev_id)
list_add_tail(&lp->rcv, &receivedQueue);
XLlDma_mBdRingIntDisable(&lp->Dma.RxBdRing,
XLLDMA_CR_IRQ_ALL_EN_MASK);
+#ifndef CONFIG_NET_POLL_CONTROLLER
tasklet_schedule(&DmaRecvBH);
+#else
+ DmaRecvHandlerBH(0);
+#endif
}
spin_unlock_irqrestore(&receivedQueueSpin, flags);
}
@@ -1134,7 +1145,11 @@ static irqreturn_t xenet_dma_tx_interrupt(int irq, void *dev_id)
list_add_tail(&lp->xmit, &sentQueue);
XLlDma_mBdRingIntDisable(&lp->Dma.TxBdRing,
XLLDMA_CR_IRQ_ALL_EN_MASK);
+#ifndef CONFIG_NET_POLL_CONTROLLER
tasklet_schedule(&DmaSendBH);
+#else
+ DmaSendHandlerBH(0);
+#endif
}
spin_unlock_irqrestore(&sentQueueSpin, flags);
}
@@ -1711,11 +1726,15 @@ static int xenet_DmaSend(struct sk_buff *skb, struct net_device *dev)
* SgAlloc, SgCommit sequence, which also exists in DmaSendHandlerBH Bottom
* Half, or triggered by other processor in SMP case.
*/
+#ifndef CONFIG_NET_POLL_CONTROLLER
spin_lock_bh(&XTE_tx_spinlock);
+#endif
xenet_DmaSend_internal(skb, dev);
+#ifndef CONFIG_NET_POLL_CONTROLLER
spin_unlock_bh(&XTE_tx_spinlock);
+#endif
return 0;
}
@@ -1764,7 +1783,7 @@ static void DmaSendHandlerBH(unsigned long p)
skb = (struct sk_buff *)
XLlDma_mBdGetId(BdCurPtr);
if (skb)
- dev_kfree_skb(skb);
+ dev_kfree_skb_any(skb);
/* reset BD id */
XLlDma_mBdSetId(BdCurPtr, NULL);
@@ -3220,6 +3239,23 @@ static int detect_phy(struct net_local *lp, char *dev_name)
return 0; /* default to zero */
}
+#ifdef CONFIG_NET_POLL_CONTROLLER
+static void
+lltemac_poll_controller(struct net_device *ndev)
+{
+ struct net_local *lp = netdev_priv(ndev);
+
+ disable_irq(lp->dma_irq_s);
+ disable_irq(lp->dma_irq_r);
+
+ xenet_dma_tx_interrupt(lp->dma_irq_s, ndev);
+ xenet_dma_rx_interrupt(lp->dma_irq_r, ndev);
+
+ enable_irq(lp->dma_irq_s);
+ enable_irq(lp->dma_irq_r);
+}
+#endif
+
static struct net_device_ops xilinx_netdev_ops;
/* From include/linux/ethtool.h */
@@ -3491,6 +3527,9 @@ static struct net_device_ops xilinx_netdev_ops = {
.ndo_change_mtu = xenet_change_mtu,
.ndo_tx_timeout = xenet_tx_timeout,
.ndo_get_stats = xenet_get_stats,
+#ifdef CONFIG_NET_POLL_CONTROLLER
+ .ndo_poll_controller = lltemac_poll_controller,
+#endif
};
static struct of_device_id xtenet_fifo_of_match[] = {
--
1.6.3.3.220.g609a0
^ permalink raw reply related
* Re: [v8 PATCH 1/8]: cpuidle: cleanup drivers/cpuidle/cpuidle.c
From: Arun R Bharadwaj @ 2009-10-14 6:24 UTC (permalink / raw)
To: Balbir Singh
Cc: linux-arch, Peter Zijlstra, linux-kernel, linux-acpi,
Arun Bharadwaj, Ingo Molnar, linuxppc-dev, Arjan van de Ven
In-Reply-To: <20091012113602.GC3007@balbir.in.ibm.com>
* Balbir Singh <balbir@linux.vnet.ibm.com> [2009-10-12 17:06:02]:
> * Arun R B <arun@linux.vnet.ibm.com> [2009-10-08 15:19:42]:
>
> > * Arun R Bharadwaj <arun@linux.vnet.ibm.com> [2009-10-08 15:18:28]:
> >
> > This patch cleans up drivers/cpuidle/cpuidle.c
> > Earlier cpuidle assumed pm_idle as the default idle loop. Break that
> > assumption and make it more generic. cpuidle_idle_call() which is the
> > main idle loop of cpuidle is to be called by architectures which have
> > registered to cpuidle.
> >
> > Remove routines cpuidle_install/uninstall_idle_handler() which are not
> > needed anymore.
> >
> >
>
> [snip]
>
> /**
> > - * cpuidle_install_idle_handler - installs the cpuidle idle loop handler
> > - */
> > -void cpuidle_install_idle_handler(void)
> > -{
> > - if (enabled_devices && (pm_idle != cpuidle_idle_call)) {
> > - /* Make sure all changes finished before we switch to new idle */
> > - smp_wmb();
> > - pm_idle = cpuidle_idle_call;
> > - }
> > -}
> > -
> > -/**
> > - * cpuidle_uninstall_idle_handler - uninstalls the cpuidle idle loop handler
> > - */
> > -void cpuidle_uninstall_idle_handler(void)
> > -{
> > - if (enabled_devices && pm_idle_old && (pm_idle != pm_idle_old)) {
> > - pm_idle = pm_idle_old;
> > - cpuidle_kick_cpus();
> > - }
> > -}
> > -
>
> I see the routines above being called in from
> cpuidle_pause/resume_and_lock/unlock below and they are entries from
> ACPI on ACPI_PROCESSOR_NOTIFY_POWER and from the hotplug path, could
> you test them to make sure they are not broken. We also seem to be
> missing a cpuidle_kick_cpus() in cpuidle_pause_and_lock()
>
> [snip]
>
Hi Balbir,
yes, we definitely need a cpuidle_kick_cpus() in
cpuidle_pause_and_lock() since this is used while disabling the
cpuidle_device and the cpus need to be kicked out of the idle states.
I will test this modified code and see if it breaks hotplug.
thanks,
arun
> --
> Balbir
^ permalink raw reply
* Re: [PATCH] powerpc: tracing: Add powerpc tracepoints for interrupt entry and exit
From: Benjamin Herrenschmidt @ 2009-10-14 6:17 UTC (permalink / raw)
To: Anton Blanchard
Cc: Frederic Weisbecker, Ingo Molnar, linuxppc-dev, Steven Rostedt
In-Reply-To: <20091006040554.GD16073@kryten>
On Tue, 2009-10-06 at 15:05 +1100, Anton Blanchard wrote:
> This patch adds powerpc specific tracepoints for interrupt entry and exit.
.../....
Breaks 6xx_defconfig:
In file included from /home/benh/linux-powerpc-test/include/linux/device.h:23,
from /home/benh/linux-powerpc-test/arch/powerpc/include/asm/io.h:21,
from /home/benh/linux-powerpc-test/arch/powerpc/include/asm/pgtable-ppc32.h:9,
from /home/benh/linux-powerpc-test/arch/powerpc/include/asm/pgtable.h:25,
from /home/benh/linux-powerpc-test/include/linux/mm.h:39,
from /home/benh/linux-powerpc-test/include/linux/ring_buffer.h:5,
from /home/benh/linux-powerpc-test/include/linux/ftrace_event.h:4,
from /home/benh/linux-powerpc-test/include/trace/ftrace.h:19,
from /home/benh/linux-powerpc-test/include/trace/define_trace.h:61,
from /home/benh/linux-powerpc-test/arch/powerpc/include/asm/trace.h:53,
from /home/benh/linux-powerpc-test/arch/powerpc/kernel/trace-events.c:3:
/home/benh/linux-powerpc-test/include/linux/module.h: In function ‘__module_get’:
/home/benh/linux-powerpc-test/include/linux/module.h:471: error: implicit declaration of function ‘trace_module_get’
Cheers,
Ben.
> While we already have generic irq_handler_entry and irq_handler_exit
> tracepoints there are cases on our virtualised powerpc machines where an
> interrupt is presented to the OS, but subsequently handled by the hypervisor.
> This means no OS interrupt handler is invoked.
>
> Here is an example on a POWER6 machine with the patch below applied:
>
> <idle>-0 [006] 3243.949840744: irq_entry: pt_regs=c0000000ce31fb10
> <idle>-0 [006] 3243.949850520: irq_exit: pt_regs=c0000000ce31fb10
>
> <idle>-0 [007] 3243.950218208: irq_entry: pt_regs=c0000000ce323b10
> <idle>-0 [007] 3243.950224080: irq_exit: pt_regs=c0000000ce323b10
>
> <idle>-0 [000] 3244.021879320: irq_entry: pt_regs=c000000000a63aa0
> <idle>-0 [000] 3244.021883616: irq_handler_entry: irq=87 handler=eth0
> <idle>-0 [000] 3244.021887328: irq_handler_exit: irq=87 return=handled
> <idle>-0 [000] 3244.021897408: irq_exit: pt_regs=c000000000a63aa0
>
> Here we see two phantom interrupts (no handler was invoked), followed
> by a real interrupt for eth0. Without the tracepoints in this patch we
> would have missed the phantom interrupts.
>
> Since these would be the first arch specific tracepoints, I'd like to make
> sure we agree on naming. The tracepoints live in events/powerpc/*, but I'm
> wondering if the tracepoint name should also contain the arch name, eg
> powerpc_irq_entry/powerpc_irq_exit. Thoughts?
>
> Signed-off-by: Anton Blanchard <anton@samba.org>
> --
>
> Index: linux.trees.git/arch/powerpc/include/asm/trace.h
> ===================================================================
> --- /dev/null 1970-01-01 00:00:00.000000000 +0000
> +++ linux.trees.git/arch/powerpc/include/asm/trace.h 2009-10-06 14:54:25.000000000 +1100
> @@ -0,0 +1,53 @@
> +#undef TRACE_SYSTEM
> +#define TRACE_SYSTEM powerpc
> +
> +#if !defined(_TRACE_POWERPC_H) || defined(TRACE_HEADER_MULTI_READ)
> +#define _TRACE_POWERPC_H
> +
> +#include <linux/tracepoint.h>
> +
> +struct pt_regs;
> +
> +TRACE_EVENT(irq_entry,
> +
> + TP_PROTO(struct pt_regs *regs),
> +
> + TP_ARGS(regs),
> +
> + TP_STRUCT__entry(
> + __field(struct pt_regs *, regs)
> + ),
> +
> + TP_fast_assign(
> + __entry->regs = regs;
> + ),
> +
> + TP_printk("pt_regs=%p", __entry->regs)
> +);
> +
> +TRACE_EVENT(irq_exit,
> +
> + TP_PROTO(struct pt_regs *regs),
> +
> + TP_ARGS(regs),
> +
> + TP_STRUCT__entry(
> + __field(struct pt_regs *, regs)
> + ),
> +
> + TP_fast_assign(
> + __entry->regs = regs;
> + ),
> +
> + TP_printk("pt_regs=%p", __entry->regs)
> +);
> +
> +#endif /* _TRACE_POWERPC_H */
> +
> +#undef TRACE_INCLUDE_PATH
> +#undef TRACE_INCLUDE_FILE
> +
> +#define TRACE_INCLUDE_PATH asm
> +#define TRACE_INCLUDE_FILE trace
> +
> +#include <trace/define_trace.h>
> Index: linux.trees.git/arch/powerpc/kernel/Makefile
> ===================================================================
> --- linux.trees.git.orig/arch/powerpc/kernel/Makefile 2009-10-06 14:02:03.000000000 +1100
> +++ linux.trees.git/arch/powerpc/kernel/Makefile 2009-10-06 14:38:51.000000000 +1100
> @@ -115,6 +115,8 @@ ifneq ($(CONFIG_XMON)$(CONFIG_KEXEC),)
> obj-y += ppc_save_regs.o
> endif
>
> +obj-$(CONFIG_TRACEPOINTS) += trace-events.o
> +
> # Disable GCOV in odd or sensitive code
> GCOV_PROFILE_prom_init.o := n
> GCOV_PROFILE_ftrace.o := n
> Index: linux.trees.git/arch/powerpc/kernel/trace-events.c
> ===================================================================
> --- /dev/null 1970-01-01 00:00:00.000000000 +0000
> +++ linux.trees.git/arch/powerpc/kernel/trace-events.c 2009-10-06 14:44:57.000000000 +1100
> @@ -0,0 +1,3 @@
> +#include <linux/slab.h>
> +#define CREATE_TRACE_POINTS
> +#include <asm/trace.h>
> Index: linux.trees.git/arch/powerpc/kernel/irq.c
> ===================================================================
> --- linux.trees.git.orig/arch/powerpc/kernel/irq.c 2009-10-06 14:02:15.000000000 +1100
> +++ linux.trees.git/arch/powerpc/kernel/irq.c 2009-10-06 14:13:08.000000000 +1100
> @@ -54,6 +54,7 @@
> #include <linux/pci.h>
> #include <linux/debugfs.h>
> #include <linux/perf_event.h>
> +#include <asm/trace.h>
>
> #include <asm/uaccess.h>
> #include <asm/system.h>
> @@ -325,6 +326,8 @@ void do_IRQ(struct pt_regs *regs)
> struct pt_regs *old_regs = set_irq_regs(regs);
> unsigned int irq;
>
> + trace_irq_entry(regs);
> +
> irq_enter();
>
> check_stack_overflow();
> @@ -348,6 +351,8 @@ void do_IRQ(struct pt_regs *regs)
> timer_interrupt(regs);
> }
> #endif
> +
> + trace_irq_exit(regs);
> }
>
> void __init init_IRQ(void)
^ permalink raw reply
* Re: [v8 PATCH 2/8]: cpuidle: implement a list based approach to register a set of idle routines.
From: Arun R Bharadwaj @ 2009-10-14 6:17 UTC (permalink / raw)
To: Andi Kleen
Cc: linux-arch, Peter Zijlstra, linux-kernel, linux-acpi,
Arun Bharadwaj, Ingo Molnar, linuxppc-dev, Arjan van de Ven
In-Reply-To: <8763akh4re.fsf@basil.nowhere.org>
* Andi Kleen <andi@firstfloor.org> [2009-10-12 20:00:05]:
> Peter Zijlstra <a.p.zijlstra@chello.nl> writes:
> >
> > So does it make sense to have a set of sets?
> >
> > Why not integrate them all into one set to be ruled by this governor
> > thing?
>
> cpuidle is currently optional, that is why the two level hierarchy
> is there so that you can still have simple idle selection without it.
>
> % size drivers/cpuidle/*.o
> text data bss dec hex filename
> 5514 1416 44 6974 1b3e drivers/cpuidle/built-in.o
>
> Adding it unconditionally would add ~7k to everyone who wants idle functions.
>
> I think making it unconditional would require putting it on a serious
> diet first.
>
Hi Andi,
Yes, this is a valid point.
How about something like this..
If the arch does not enable CONFIG_CPU_IDLE, the cpuidle_idle_call
which is called from cpu_idle() should call default_idle without
involving the registering cpuidle steps. This should prevent bloating
up of the kernel for archs which dont want to use cpuidle.
--arun
> -Andi
> --
> ak@linux.intel.com -- Speaking for myself only.
^ permalink raw reply
* Re: [PATCH] Ftrace : fix function_graph tracer OOPS
From: Benjamin Herrenschmidt @ 2009-10-14 6:15 UTC (permalink / raw)
To: Sachin Sant; +Cc: linuxppc-dev, rostedt
In-Reply-To: <4AD56C05.9030602@in.ibm.com>
On Wed, 2009-10-14 at 11:43 +0530, Sachin Sant wrote:
> Tested both the patches. Works fine.
Thanks !
Stephen, you merge these yourself or you need me to pick them up in
-powerpc ?
Cheers,
Ben.
^ permalink raw reply
* Re: [PATCH] Ftrace : fix function_graph tracer OOPS
From: Sachin Sant @ 2009-10-14 6:13 UTC (permalink / raw)
To: rostedt; +Cc: linuxppc-dev
In-Reply-To: <1255489284.7113.3121.camel@gandalf.stny.rr.com>
Steven Rostedt wrote:
> On Thu, 2009-10-08 at 20:21 +0530, Sachin Sant wrote:
>
>> Switch to LOAD_REG_ADDR().
>>
>> Signed-off-by : Sachin Sant <sachinp@in.ibm.com>
>> ---
>> diff -Naurp old/arch/powerpc/kernel/entry_64.S
>> new/arch/powerpc/kernel/entry_64.S
>> --- old/arch/powerpc/kernel/entry_64.S 2009-10-08 18:37:44.000000000
>> +0530
>> +++ new/arch/powerpc/kernel/entry_64.S 2009-10-08 18:34:33.000000000
>> +0530
>> @@ -1038,8 +1038,8 @@ _GLOBAL(mod_return_to_handler)
>> * We are in a module using the module's TOC.
>> * Switch to our TOC to run inside the core kernel.
>> */
>> - LOAD_REG_IMMEDIATE(r4,ftrace_return_to_handler)
>> - ld r2, 8(r4)
>> + ld r2, PACATOC(r13)
>> + LOAD_REG_ADDR(r4,ftrace_return_to_handler)
>>
>
> Actually, the loading of this register is not needed. The original used
> the loading to get the r2.
>
> I actually wrote a fix for this a month ago. I never sent it out because
> I was distracted by other issues.
>
> I'll send out the two patches I had now.
>
> Could yo test them?
>
Tested both the patches. Works fine.
Thanks
-Sachin
--
---------------------------------
Sachin Sant
IBM Linux Technology Center
India Systems and Technology Labs
Bangalore, India
---------------------------------
^ permalink raw reply
* [PATCH] Xilinx LL-TEMAC: Add Netpoll controller support
From: santosh shukla @ 2009-10-14 6:12 UTC (permalink / raw)
To: Linuxppc-dev; +Cc: John.Linn
From: Santosh Shukla <sshukla@sh.mvista.com>
Date: Tue, 13 Oct 2009 18:55:57 +0530
Subject: [PATCH] Xilinx LL-TEMAC: Add Netpoll controller support
Adding Netpoll controller support to Xilinx LL-TEMAC ethernet
driver.Repaced Rx, Tx tasklet schedule call with their handlers,
Added correct version of call which can execute interrupt on/off
context i.e. dev_kfree_skb_any().
---
drivers/net/xilinx_lltemac/xlltemac_main.c | 41 +++++++++++++++++++++++++++-
1 files changed, 40 insertions(+), 1 deletions(-)
diff --git a/drivers/net/xilinx_lltemac/xlltemac_main.c b/drivers/net/xilinx_lltemac/xlltemac_main.c
index b245422..697f474 100644
--- a/drivers/net/xilinx_lltemac/xlltemac_main.c
+++ b/drivers/net/xilinx_lltemac/xlltemac_main.c
@@ -87,11 +87,18 @@
#define BUFFER_ALIGNSEND_PERF(adr) ((ALIGNMENT_SEND_PERF - ((u32) adr)) % 32)
#define BUFFER_ALIGNRECV(adr) ((ALIGNMENT_RECV - ((u32) adr)) % 32)
+#ifndef CONFIG_NET_POLL_CONTROLLER
/* Default TX/RX Threshold and waitbound values for SGDMA mode */
#define DFT_TX_THRESHOLD 24
#define DFT_TX_WAITBOUND 254
#define DFT_RX_THRESHOLD 4
#define DFT_RX_WAITBOUND 254
+#else
+#define DFT_TX_THRESHOLD 1
+#define DFT_TX_WAITBOUND 0
+#define DFT_RX_THRESHOLD 1
+#define DFT_RX_WAITBOUND 0
+#endif
#define XTE_AUTOSTRIPPING 1
@@ -1097,7 +1104,11 @@ static irqreturn_t xenet_dma_rx_interrupt(int irq, void *dev_id)
list_add_tail(&lp->rcv, &receivedQueue);
XLlDma_mBdRingIntDisable(&lp->Dma.RxBdRing,
XLLDMA_CR_IRQ_ALL_EN_MASK);
+#ifndef CONFIG_NET_POLL_CONTROLLER
tasklet_schedule(&DmaRecvBH);
+#else
+ DmaRecvHandlerBH(0);
+#endif
}
spin_unlock_irqrestore(&receivedQueueSpin, flags);
}
@@ -1134,7 +1145,11 @@ static irqreturn_t xenet_dma_tx_interrupt(int irq, void *dev_id)
list_add_tail(&lp->xmit, &sentQueue);
XLlDma_mBdRingIntDisable(&lp->Dma.TxBdRing,
XLLDMA_CR_IRQ_ALL_EN_MASK);
+#ifndef CONFIG_NET_POLL_CONTROLLER
tasklet_schedule(&DmaSendBH);
+#else
+ DmaSendHandlerBH(0);
+#endif
}
spin_unlock_irqrestore(&sentQueueSpin, flags);
}
@@ -1711,11 +1726,15 @@ static int xenet_DmaSend(struct sk_buff *skb, struct net_device *dev)
* SgAlloc, SgCommit sequence, which also exists in DmaSendHandlerBH Bottom
* Half, or triggered by other processor in SMP case.
*/
+#ifndef CONFIG_NET_POLL_CONTROLLER
spin_lock_bh(&XTE_tx_spinlock);
+#endif
xenet_DmaSend_internal(skb, dev);
+#ifndef CONFIG_NET_POLL_CONTROLLER
spin_unlock_bh(&XTE_tx_spinlock);
+#endif
return 0;
}
@@ -1764,7 +1783,7 @@ static void DmaSendHandlerBH(unsigned long p)
skb = (struct sk_buff *)
XLlDma_mBdGetId(BdCurPtr);
if (skb)
- dev_kfree_skb(skb);
+ dev_kfree_skb_any(skb);
/* reset BD id */
XLlDma_mBdSetId(BdCurPtr, NULL);
@@ -3220,6 +3239,23 @@ static int detect_phy(struct net_local *lp, char *dev_name)
return 0; /* default to zero */
}
+#ifdef CONFIG_NET_POLL_CONTROLLER
+static void
+lltemac_poll_controller(struct net_device *ndev)
+{
+ struct net_local *lp = netdev_priv(ndev);
+
+ disable_irq(lp->dma_irq_s);
+ disable_irq(lp->dma_irq_r);
+
+ xenet_dma_tx_interrupt(lp->dma_irq_s, ndev);
+ xenet_dma_rx_interrupt(lp->dma_irq_r, ndev);
+
+ enable_irq(lp->dma_irq_s);
+ enable_irq(lp->dma_irq_r);
+}
+#endif
+
static struct net_device_ops xilinx_netdev_ops;
/* From include/linux/ethtool.h */
@@ -3491,6 +3527,9 @@ static struct net_device_ops xilinx_netdev_ops = {
.ndo_change_mtu = xenet_change_mtu,
.ndo_tx_timeout = xenet_tx_timeout,
.ndo_get_stats = xenet_get_stats,
+#ifdef CONFIG_NET_POLL_CONTROLLER
+ .ndo_poll_controller = lltemac_poll_controller,
+#endif
};
static struct of_device_id xtenet_fifo_of_match[] = {
--
1.6.3.3.220.g609a0
^ permalink raw reply related
* [PATCH 10/16] percpu: make percpu symbols in powerpc unique
From: Tejun Heo @ 2009-10-14 6:01 UTC (permalink / raw)
To: linux-kernel, rusty, cl, mingo, tglx, akpm, rostedt, hpa, cebbert
Cc: Tejun Heo, Paul Mackerras, linuxppc-dev
In-Reply-To: <1255500125-3210-1-git-send-email-tj@kernel.org>
This patch updates percpu related symbols in powerpc such that percpu
symbols are unique and don't clash with local symbols. This serves
two purposes of decreasing the possibility of global percpu symbol
collision and allowing dropping per_cpu__ prefix from percpu symbols.
* arch/powerpc/kernel/perf_callchain.c: s/callchain/cpu_perf_callchain/
* arch/powerpc/kernel/setup-common.c: s/pvr/cpu_pvr/
* arch/powerpc/platforms/pseries/dtl.c: s/dtl/cpu_dtl/
* arch/powerpc/platforms/cell/interrupt.c: s/iic/cpu_iic/
Partly based on Rusty Russell's "alloc_percpu: rename percpu vars
which cause name clashes" patch.
Signed-off-by: Tejun Heo <tj@kernel.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@ozlabs.org
---
arch/powerpc/include/asm/smp.h | 2 +-
arch/powerpc/kernel/perf_callchain.c | 4 ++--
arch/powerpc/kernel/setup-common.c | 4 ++--
arch/powerpc/kernel/smp.c | 2 +-
arch/powerpc/platforms/cell/interrupt.c | 14 +++++++-------
arch/powerpc/platforms/pseries/dtl.c | 4 ++--
6 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/arch/powerpc/include/asm/smp.h b/arch/powerpc/include/asm/smp.h
index d9ea8d3..1d3b270 100644
--- a/arch/powerpc/include/asm/smp.h
+++ b/arch/powerpc/include/asm/smp.h
@@ -37,7 +37,7 @@ extern void cpu_die(void);
extern void smp_send_debugger_break(int cpu);
extern void smp_message_recv(int);
-DECLARE_PER_CPU(unsigned int, pvr);
+DECLARE_PER_CPU(unsigned int, cpu_pvr);
#ifdef CONFIG_HOTPLUG_CPU
extern void fixup_irqs(cpumask_t map);
diff --git a/arch/powerpc/kernel/perf_callchain.c b/arch/powerpc/kernel/perf_callchain.c
index 0a03cf7..fe59c44 100644
--- a/arch/powerpc/kernel/perf_callchain.c
+++ b/arch/powerpc/kernel/perf_callchain.c
@@ -497,11 +497,11 @@ static void perf_callchain_user_32(struct pt_regs *regs,
* Since we can't get PMU interrupts inside a PMU interrupt handler,
* we don't need separate irq and nmi entries here.
*/
-static DEFINE_PER_CPU(struct perf_callchain_entry, callchain);
+static DEFINE_PER_CPU(struct perf_callchain_entry, cpu_perf_callchain);
struct perf_callchain_entry *perf_callchain(struct pt_regs *regs)
{
- struct perf_callchain_entry *entry = &__get_cpu_var(callchain);
+ struct perf_callchain_entry *entry = &__get_cpu_var(cpu_perf_callchain);
entry->nr = 0;
diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
index 4271f7a..aa5aeb9 100644
--- a/arch/powerpc/kernel/setup-common.c
+++ b/arch/powerpc/kernel/setup-common.c
@@ -157,7 +157,7 @@ extern u32 cpu_temp_both(unsigned long cpu);
#endif /* CONFIG_TAU */
#ifdef CONFIG_SMP
-DEFINE_PER_CPU(unsigned int, pvr);
+DEFINE_PER_CPU(unsigned int, cpu_pvr);
#endif
static int show_cpuinfo(struct seq_file *m, void *v)
@@ -209,7 +209,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
}
#ifdef CONFIG_SMP
- pvr = per_cpu(pvr, cpu_id);
+ pvr = per_cpu(cpu_pvr, cpu_id);
#else
pvr = mfspr(SPRN_PVR);
#endif
diff --git a/arch/powerpc/kernel/smp.c b/arch/powerpc/kernel/smp.c
index 9b86a74..2ebb484 100644
--- a/arch/powerpc/kernel/smp.c
+++ b/arch/powerpc/kernel/smp.c
@@ -232,7 +232,7 @@ struct thread_info *current_set[NR_CPUS];
static void __devinit smp_store_cpu_info(int id)
{
- per_cpu(pvr, id) = mfspr(SPRN_PVR);
+ per_cpu(cpu_pvr, id) = mfspr(SPRN_PVR);
}
static void __init smp_create_idle(unsigned int cpu)
diff --git a/arch/powerpc/platforms/cell/interrupt.c b/arch/powerpc/platforms/cell/interrupt.c
index 882e470..54bad90 100644
--- a/arch/powerpc/platforms/cell/interrupt.c
+++ b/arch/powerpc/platforms/cell/interrupt.c
@@ -54,7 +54,7 @@ struct iic {
struct device_node *node;
};
-static DEFINE_PER_CPU(struct iic, iic);
+static DEFINE_PER_CPU(struct iic, cpu_iic);
#define IIC_NODE_COUNT 2
static struct irq_host *iic_host;
@@ -82,7 +82,7 @@ static void iic_unmask(unsigned int irq)
static void iic_eoi(unsigned int irq)
{
- struct iic *iic = &__get_cpu_var(iic);
+ struct iic *iic = &__get_cpu_var(cpu_iic);
out_be64(&iic->regs->prio, iic->eoi_stack[--iic->eoi_ptr]);
BUG_ON(iic->eoi_ptr < 0);
}
@@ -146,7 +146,7 @@ static unsigned int iic_get_irq(void)
struct iic *iic;
unsigned int virq;
- iic = &__get_cpu_var(iic);
+ iic = &__get_cpu_var(cpu_iic);
*(unsigned long *) &pending =
in_be64((u64 __iomem *) &iic->regs->pending_destr);
if (!(pending.flags & CBE_IIC_IRQ_VALID))
@@ -161,12 +161,12 @@ static unsigned int iic_get_irq(void)
void iic_setup_cpu(void)
{
- out_be64(&__get_cpu_var(iic).regs->prio, 0xff);
+ out_be64(&__get_cpu_var(cpu_iic).regs->prio, 0xff);
}
u8 iic_get_target_id(int cpu)
{
- return per_cpu(iic, cpu).target_id;
+ return per_cpu(cpu_iic, cpu).target_id;
}
EXPORT_SYMBOL_GPL(iic_get_target_id);
@@ -181,7 +181,7 @@ static inline int iic_ipi_to_irq(int ipi)
void iic_cause_IPI(int cpu, int mesg)
{
- out_be64(&per_cpu(iic, cpu).regs->generate, (0xf - mesg) << 4);
+ out_be64(&per_cpu(cpu_iic, cpu).regs->generate, (0xf - mesg) << 4);
}
struct irq_host *iic_get_irq_host(int node)
@@ -348,7 +348,7 @@ static void __init init_one_iic(unsigned int hw_cpu, unsigned long addr,
/* XXX FIXME: should locate the linux CPU number from the HW cpu
* number properly. We are lucky for now
*/
- struct iic *iic = &per_cpu(iic, hw_cpu);
+ struct iic *iic = &per_cpu(cpu_iic, hw_cpu);
iic->regs = ioremap(addr, sizeof(struct cbe_iic_thread_regs));
BUG_ON(iic->regs == NULL);
diff --git a/arch/powerpc/platforms/pseries/dtl.c b/arch/powerpc/platforms/pseries/dtl.c
index 937a544..c5f3116 100644
--- a/arch/powerpc/platforms/pseries/dtl.c
+++ b/arch/powerpc/platforms/pseries/dtl.c
@@ -54,7 +54,7 @@ struct dtl {
int buf_entries;
u64 last_idx;
};
-static DEFINE_PER_CPU(struct dtl, dtl);
+static DEFINE_PER_CPU(struct dtl, cpu_dtl);
/*
* Dispatch trace log event mask:
@@ -261,7 +261,7 @@ static int dtl_init(void)
/* set up the per-cpu log structures */
for_each_possible_cpu(i) {
- struct dtl *dtl = &per_cpu(dtl, i);
+ struct dtl *dtl = &per_cpu(cpu_dtl, i);
dtl->cpu = i;
rc = dtl_setup_file(dtl);
--
1.6.4.2
^ permalink raw reply related
* Re: [PATCH, RFC] powerpc, pci: fix MODPOST warning
From: Benjamin Herrenschmidt @ 2009-10-14 5:47 UTC (permalink / raw)
To: hs; +Cc: linuxppc-dev
In-Reply-To: <4AC99B12.8020005@denx.de>
On Mon, 2009-10-05 at 09:06 +0200, Heiko Schocher wrote:
> Hello,
>
> Heiko Schocher wrote:
> > making a powerpc target with PCI support, shows the
> > following warning:
> >
> > MODPOST vmlinux.o
> > WARNING: vmlinux.o(.text+0x10430): Section mismatch in reference from the function pcibios_allocate_bus_resources() to the function .init.text:reparent_resources()
> > The function pcibios_allocate_bus_resources() references
> > the function __init reparent_resources().
> > This is often because pcibios_allocate_bus_resources lacks a __init
> > annotation or the annotation of reparent_resources is wrong.
> >
> > This patch fix this warning by removing the __init
> > annotation before reparent_resources.
>
> No comments? So, is this fix OK, or unusable?
Nah, just me missing it but it's reference on patchwork. I'll pick
the patch up. We can probably make some of that __devinit instead
of __init though but we can look at it later.
Cheers
Ben.
^ permalink raw reply
* [PATCH 6/6] powerpc: Enable sparse irq_descs on powerpc
From: Michael Ellerman @ 2009-10-14 5:45 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <a6fc612b826ff12628e62601203d565df00c6436.1255499081.git.michael@ellerman.id.au>
Defining CONFIG_SPARSE_IRQ enables generic code that gets rid of the
static irq_desc array, and replaces it with an array of pointers to
irq_descs.
It also allows node local allocation of irq_descs, however we
currently don't have the information available to do that, so we just
allocate them on all on node 0.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
arch/powerpc/Kconfig | 13 ++++++++++++
arch/powerpc/include/asm/irq.h | 3 ++
arch/powerpc/kernel/irq.c | 40 ++++++++++++++++++++++++++++++++------
arch/powerpc/kernel/ppc_ksyms.c | 1 -
arch/powerpc/kernel/setup_64.c | 5 ----
5 files changed, 49 insertions(+), 13 deletions(-)
diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig
index 2230e75..825d889 100644
--- a/arch/powerpc/Kconfig
+++ b/arch/powerpc/Kconfig
@@ -388,6 +388,19 @@ config IRQ_ALL_CPUS
CPU. Generally saying Y is safe, although some problems have been
reported with SMP Power Macintoshes with this option enabled.
+config SPARSE_IRQ
+ bool "Support sparse irq numbering"
+ default y
+ help
+ This enables support for sparse irqs. This is useful for distro
+ kernels that want to define a high CONFIG_NR_CPUS value but still
+ want to have low kernel memory footprint on smaller machines.
+
+ ( Sparse IRQs can also be beneficial on NUMA boxes, as they spread
+ out the irq_desc[] array in a more NUMA-friendly way. )
+
+ If you don't know what to do here, say Y.
+
config NUMA
bool "NUMA support"
depends on PPC64
diff --git a/arch/powerpc/include/asm/irq.h b/arch/powerpc/include/asm/irq.h
index 03dc28c..c85a32f 100644
--- a/arch/powerpc/include/asm/irq.h
+++ b/arch/powerpc/include/asm/irq.h
@@ -38,6 +38,9 @@ extern atomic_t ppc_n_lost_interrupts;
/* Number of irqs reserved for the legacy controller */
#define NUM_ISA_INTERRUPTS 16
+/* Same thing, used by the generic IRQ code */
+#define NR_IRQS_LEGACY NUM_ISA_INTERRUPTS
+
/* This type is the placeholder for a hardware interrupt number. It has to
* be big enough to enclose whatever representation is used by a given
* platform.
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index 63e27d5..eba5392 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -85,7 +85,10 @@ extern int tau_interrupts(int);
#endif /* CONFIG_PPC32 */
#ifdef CONFIG_PPC64
+
+#ifndef CONFIG_SPARSE_IRQ
EXPORT_SYMBOL(irq_desc);
+#endif
int distribute_irqs = 1;
@@ -613,8 +616,16 @@ void irq_set_virq_count(unsigned int count)
static int irq_setup_virq(struct irq_host *host, unsigned int virq,
irq_hw_number_t hwirq)
{
+ struct irq_desc *desc;
+
+ desc = irq_to_desc_alloc_node(virq, 0);
+ if (!desc) {
+ pr_debug("irq: -> allocating desc failed\n");
+ goto error;
+ }
+
/* Clear IRQ_NOREQUEST flag */
- irq_to_desc(virq)->status &= ~IRQ_NOREQUEST;
+ desc->status &= ~IRQ_NOREQUEST;
/* map it */
smp_wmb();
@@ -623,11 +634,14 @@ static int irq_setup_virq(struct irq_host *host, unsigned int virq,
if (host->ops->map(host, virq, hwirq)) {
pr_debug("irq: -> mapping failed, freeing\n");
- irq_free_virt(virq, 1);
- return -1;
+ goto error;
}
return 0;
+
+error:
+ irq_free_virt(virq, 1);
+ return -1;
}
unsigned int irq_create_direct_mapping(struct irq_host *host)
@@ -1008,12 +1022,24 @@ void irq_free_virt(unsigned int virq, unsigned int count)
spin_unlock_irqrestore(&irq_big_lock, flags);
}
-void irq_early_init(void)
+int arch_early_irq_init(void)
{
- unsigned int i;
+ struct irq_desc *desc;
+ int i;
- for (i = 0; i < NR_IRQS; i++)
- irq_to_desc(i)->status |= IRQ_NOREQUEST;
+ for (i = 0; i < NR_IRQS; i++) {
+ desc = irq_to_desc(i);
+ if (desc)
+ desc->status |= IRQ_NOREQUEST;
+ }
+
+ return 0;
+}
+
+int arch_init_chip_data(struct irq_desc *desc, int node)
+{
+ desc->status |= IRQ_NOREQUEST;
+ return 0;
}
/* We need to create the radix trees late */
diff --git a/arch/powerpc/kernel/ppc_ksyms.c b/arch/powerpc/kernel/ppc_ksyms.c
index c8b27bb..07115d6 100644
--- a/arch/powerpc/kernel/ppc_ksyms.c
+++ b/arch/powerpc/kernel/ppc_ksyms.c
@@ -162,7 +162,6 @@ EXPORT_SYMBOL(screen_info);
#ifdef CONFIG_PPC32
EXPORT_SYMBOL(timer_interrupt);
-EXPORT_SYMBOL(irq_desc);
EXPORT_SYMBOL(tb_ticks_per_jiffy);
EXPORT_SYMBOL(cacheable_memcpy);
EXPORT_SYMBOL(cacheable_memzero);
diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
index 797ea95..8e5ec92 100644
--- a/arch/powerpc/kernel/setup_64.c
+++ b/arch/powerpc/kernel/setup_64.c
@@ -357,11 +357,6 @@ void __init setup_system(void)
*/
initialize_cache_info();
- /*
- * Initialize irq remapping subsystem
- */
- irq_early_init();
-
#ifdef CONFIG_PPC_RTAS
/*
* Initialize RTAS if available
--
1.6.2.1
^ permalink raw reply related
* [PATCH 5/6] powerpc: Rearrange and fix show_interrupts() for sparse irq_descs
From: Michael Ellerman @ 2009-10-14 5:45 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <a6fc612b826ff12628e62601203d565df00c6436.1255499081.git.michael@ellerman.id.au>
Move the default case out of the if, ie. when we're just displaying
an irq. And consolidate all the odd cases at the top, ie. printing
the header and footer.
And in the process cope with sparse irq_descs.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
arch/powerpc/kernel/irq.c | 64 ++++++++++++++++++++++++++-------------------
1 files changed, 37 insertions(+), 27 deletions(-)
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index baa49eb..63e27d5 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -187,33 +187,7 @@ int show_interrupts(struct seq_file *p, void *v)
for_each_online_cpu(j)
seq_printf(p, "CPU%d ", j);
seq_putc(p, '\n');
- }
-
- if (i < NR_IRQS) {
- desc = irq_to_desc(i);
- spin_lock_irqsave(&desc->lock, flags);
- action = desc->action;
- if (!action || !action->handler)
- goto skip;
- seq_printf(p, "%3d: ", i);
-#ifdef CONFIG_SMP
- for_each_online_cpu(j)
- seq_printf(p, "%10u ", kstat_irqs_cpu(i, j));
-#else
- seq_printf(p, "%10u ", kstat_irqs(i));
-#endif /* CONFIG_SMP */
- if (desc->chip)
- seq_printf(p, " %s ", desc->chip->typename);
- else
- seq_puts(p, " None ");
- seq_printf(p, "%s", (desc->status & IRQ_LEVEL) ? "Level " : "Edge ");
- seq_printf(p, " %s", action->name);
- for (action = action->next; action; action = action->next)
- seq_printf(p, ", %s", action->name);
- seq_putc(p, '\n');
-skip:
- spin_unlock_irqrestore(&desc->lock, flags);
- } else if (i == NR_IRQS) {
+ } else if (i == nr_irqs) {
#if defined(CONFIG_PPC32) && defined(CONFIG_TAU_INT)
if (tau_initialized){
seq_puts(p, "TAU: ");
@@ -223,7 +197,43 @@ skip:
}
#endif /* CONFIG_PPC32 && CONFIG_TAU_INT*/
seq_printf(p, "BAD: %10u\n", ppc_spurious_interrupts);
+
+ return 0;
}
+
+ desc = irq_to_desc(i);
+ if (!desc)
+ return 0;
+
+ spin_lock_irqsave(&desc->lock, flags);
+
+ action = desc->action;
+ if (!action || !action->handler)
+ goto skip;
+
+ seq_printf(p, "%3d: ", i);
+#ifdef CONFIG_SMP
+ for_each_online_cpu(j)
+ seq_printf(p, "%10u ", kstat_irqs_cpu(i, j));
+#else
+ seq_printf(p, "%10u ", kstat_irqs(i));
+#endif /* CONFIG_SMP */
+
+ if (desc->chip)
+ seq_printf(p, " %s ", desc->chip->typename);
+ else
+ seq_puts(p, " None ");
+
+ seq_printf(p, "%s", (desc->status & IRQ_LEVEL) ? "Level " : "Edge ");
+ seq_printf(p, " %s", action->name);
+
+ for (action = action->next; action; action = action->next)
+ seq_printf(p, ", %s", action->name);
+ seq_putc(p, '\n');
+
+skip:
+ spin_unlock_irqrestore(&desc->lock, flags);
+
return 0;
}
--
1.6.2.1
^ permalink raw reply related
* [PATCH 4/6] powerpc: Make virq_debug_show() cope with sparse irq_descs
From: Michael Ellerman @ 2009-10-14 5:44 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <a6fc612b826ff12628e62601203d565df00c6436.1255499081.git.michael@ellerman.id.au>
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
arch/powerpc/kernel/irq.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index 6563221..baa49eb 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -1065,8 +1065,11 @@ static int virq_debug_show(struct seq_file *m, void *private)
seq_printf(m, "%-5s %-7s %-15s %s\n", "virq", "hwirq",
"chip name", "host name");
- for (i = 1; i < NR_IRQS; i++) {
+ for (i = 1; i < nr_irqs; i++) {
desc = irq_to_desc(i);
+ if (!desc)
+ continue;
+
spin_lock_irqsave(&desc->lock, flags);
if (desc->action && desc->action->handler) {
--
1.6.2.1
^ permalink raw reply related
* [PATCH 3/6] powerpc: Remove get_irq_desc()
From: Michael Ellerman @ 2009-10-14 5:44 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <a6fc612b826ff12628e62601203d565df00c6436.1255499081.git.michael@ellerman.id.au>
get_irq_desc() is a powerpc-specific version of irq_to_desc(). That
is reason enough to remove it, but it also doesn't know about sparse
irq_desc support which irq_to_desc() does (when we enable it).
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
arch/powerpc/include/asm/irq.h | 2 -
arch/powerpc/kernel/crash.c | 2 +-
arch/powerpc/kernel/irq.c | 28 ++++++++++++----------
arch/powerpc/platforms/512x/mpc5121_ads_cpld.c | 2 +-
arch/powerpc/platforms/52xx/media5200.c | 2 +-
arch/powerpc/platforms/82xx/pq2ads-pci-pic.c | 2 +-
arch/powerpc/platforms/85xx/socrates_fpga_pic.c | 2 +-
arch/powerpc/platforms/86xx/gef_pic.c | 2 +-
arch/powerpc/platforms/cell/beat_interrupt.c | 2 +-
arch/powerpc/platforms/cell/spider-pic.c | 4 +-
arch/powerpc/platforms/iseries/irq.c | 2 +-
arch/powerpc/platforms/powermac/pic.c | 8 +++---
arch/powerpc/platforms/pseries/xics.c | 8 +++---
arch/powerpc/sysdev/cpm1.c | 2 +-
arch/powerpc/sysdev/cpm2_pic.c | 10 +++++---
arch/powerpc/sysdev/fsl_msi.c | 2 +-
arch/powerpc/sysdev/i8259.c | 4 +-
arch/powerpc/sysdev/ipic.c | 2 +-
arch/powerpc/sysdev/mpc8xx_pic.c | 2 +-
arch/powerpc/sysdev/mpic.c | 18 +++++++-------
arch/powerpc/sysdev/mv64x60_pic.c | 2 +-
arch/powerpc/sysdev/qe_lib/qe_ic.c | 4 +-
arch/powerpc/sysdev/tsi108_pci.c | 2 +-
arch/powerpc/sysdev/uic.c | 6 ++--
arch/powerpc/sysdev/xilinx_intc.c | 2 +-
25 files changed, 62 insertions(+), 60 deletions(-)
diff --git a/arch/powerpc/include/asm/irq.h b/arch/powerpc/include/asm/irq.h
index b83fcc8..03dc28c 100644
--- a/arch/powerpc/include/asm/irq.h
+++ b/arch/powerpc/include/asm/irq.h
@@ -17,8 +17,6 @@
#include <asm/atomic.h>
-#define get_irq_desc(irq) (&irq_desc[(irq)])
-
/* Define a way to iterate across irqs. */
#define for_each_irq(i) \
for ((i) = 0; (i) < NR_IRQS; ++(i))
diff --git a/arch/powerpc/kernel/crash.c b/arch/powerpc/kernel/crash.c
index 0a8439a..6f4613d 100644
--- a/arch/powerpc/kernel/crash.c
+++ b/arch/powerpc/kernel/crash.c
@@ -373,7 +373,7 @@ void default_machine_crash_shutdown(struct pt_regs *regs)
hard_irq_disable();
for_each_irq(i) {
- struct irq_desc *desc = irq_desc + i;
+ struct irq_desc *desc = irq_to_desc(i);
if (desc->status & IRQ_INPROGRESS)
desc->chip->eoi(i);
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/kernel/irq.c
index e5d1211..6563221 100644
--- a/arch/powerpc/kernel/irq.c
+++ b/arch/powerpc/kernel/irq.c
@@ -190,7 +190,7 @@ int show_interrupts(struct seq_file *p, void *v)
}
if (i < NR_IRQS) {
- desc = get_irq_desc(i);
+ desc = irq_to_desc(i);
spin_lock_irqsave(&desc->lock, flags);
action = desc->action;
if (!action || !action->handler)
@@ -230,23 +230,25 @@ skip:
#ifdef CONFIG_HOTPLUG_CPU
void fixup_irqs(cpumask_t map)
{
+ struct irq_desc *desc;
unsigned int irq;
static int warned;
for_each_irq(irq) {
cpumask_t mask;
- if (irq_desc[irq].status & IRQ_PER_CPU)
+ desc = irq_to_desc(irq);
+ if (desc && desc->status & IRQ_PER_CPU)
continue;
- cpumask_and(&mask, irq_desc[irq].affinity, &map);
+ cpumask_and(&mask, desc->affinity, &map);
if (any_online_cpu(mask) == NR_CPUS) {
printk("Breaking affinity for irq %i\n", irq);
mask = map;
}
- if (irq_desc[irq].chip->set_affinity)
- irq_desc[irq].chip->set_affinity(irq, &mask);
- else if (irq_desc[irq].action && !(warned++))
+ if (desc->chip->set_affinity)
+ desc->chip->set_affinity(irq, &mask);
+ else if (desc->action && !(warned++))
printk("Cannot set affinity for irq %i\n", irq);
}
@@ -273,7 +275,7 @@ static inline void handle_one_irq(unsigned int irq)
return;
}
- desc = irq_desc + irq;
+ desc = irq_to_desc(irq);
saved_sp_limit = current->thread.ksp_limit;
irqtp->task = curtp->task;
@@ -535,7 +537,7 @@ struct irq_host *irq_alloc_host(struct device_node *of_node,
smp_wmb();
/* Clear norequest flags */
- get_irq_desc(i)->status &= ~IRQ_NOREQUEST;
+ irq_to_desc(i)->status &= ~IRQ_NOREQUEST;
/* Legacy flags are left to default at this point,
* one can then use irq_create_mapping() to
@@ -602,7 +604,7 @@ static int irq_setup_virq(struct irq_host *host, unsigned int virq,
irq_hw_number_t hwirq)
{
/* Clear IRQ_NOREQUEST flag */
- get_irq_desc(virq)->status &= ~IRQ_NOREQUEST;
+ irq_to_desc(virq)->status &= ~IRQ_NOREQUEST;
/* map it */
smp_wmb();
@@ -732,7 +734,7 @@ unsigned int irq_create_of_mapping(struct device_node *controller,
/* Set type if specified and different than the current one */
if (type != IRQ_TYPE_NONE &&
- type != (get_irq_desc(virq)->status & IRQF_TRIGGER_MASK))
+ type != (irq_to_desc(virq)->status & IRQF_TRIGGER_MASK))
set_irq_type(virq, type);
return virq;
}
@@ -804,7 +806,7 @@ void irq_dispose_mapping(unsigned int virq)
irq_map[virq].hwirq = host->inval_irq;
/* Set some flags */
- get_irq_desc(virq)->status |= IRQ_NOREQUEST;
+ irq_to_desc(virq)->status |= IRQ_NOREQUEST;
/* Free it */
irq_free_virt(virq, 1);
@@ -1001,7 +1003,7 @@ void irq_early_init(void)
unsigned int i;
for (i = 0; i < NR_IRQS; i++)
- get_irq_desc(i)->status |= IRQ_NOREQUEST;
+ irq_to_desc(i)->status |= IRQ_NOREQUEST;
}
/* We need to create the radix trees late */
@@ -1064,7 +1066,7 @@ static int virq_debug_show(struct seq_file *m, void *private)
"chip name", "host name");
for (i = 1; i < NR_IRQS; i++) {
- desc = get_irq_desc(i);
+ desc = irq_to_desc(i);
spin_lock_irqsave(&desc->lock, flags);
if (desc->action && desc->action->handler) {
diff --git a/arch/powerpc/platforms/512x/mpc5121_ads_cpld.c b/arch/powerpc/platforms/512x/mpc5121_ads_cpld.c
index a6ce805..cd70ee1 100644
--- a/arch/powerpc/platforms/512x/mpc5121_ads_cpld.c
+++ b/arch/powerpc/platforms/512x/mpc5121_ads_cpld.c
@@ -132,7 +132,7 @@ static int
cpld_pic_host_map(struct irq_host *h, unsigned int virq,
irq_hw_number_t hw)
{
- get_irq_desc(virq)->status |= IRQ_LEVEL;
+ irq_to_desc(virq)->status |= IRQ_LEVEL;
set_irq_chip_and_handler(virq, &cpld_pic, handle_level_irq);
return 0;
}
diff --git a/arch/powerpc/platforms/52xx/media5200.c b/arch/powerpc/platforms/52xx/media5200.c
index 68e4f16..4780203 100644
--- a/arch/powerpc/platforms/52xx/media5200.c
+++ b/arch/powerpc/platforms/52xx/media5200.c
@@ -114,7 +114,7 @@ void media5200_irq_cascade(unsigned int virq, struct irq_desc *desc)
static int media5200_irq_map(struct irq_host *h, unsigned int virq,
irq_hw_number_t hw)
{
- struct irq_desc *desc = get_irq_desc(virq);
+ struct irq_desc *desc = irq_to_desc(virq);
pr_debug("%s: h=%p, virq=%i, hwirq=%i\n", __func__, h, virq, (int)hw);
set_irq_chip_data(virq, &media5200_irq);
diff --git a/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c b/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c
index 7ee979f..a682331 100644
--- a/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c
+++ b/arch/powerpc/platforms/82xx/pq2ads-pci-pic.c
@@ -107,7 +107,7 @@ static void pq2ads_pci_irq_demux(unsigned int irq, struct irq_desc *desc)
static int pci_pic_host_map(struct irq_host *h, unsigned int virq,
irq_hw_number_t hw)
{
- get_irq_desc(virq)->status |= IRQ_LEVEL;
+ irq_to_desc(virq)->status |= IRQ_LEVEL;
set_irq_chip_data(virq, h->host_data);
set_irq_chip_and_handler(virq, &pq2ads_pci_ic, handle_level_irq);
return 0;
diff --git a/arch/powerpc/platforms/85xx/socrates_fpga_pic.c b/arch/powerpc/platforms/85xx/socrates_fpga_pic.c
index 60edf63..e59920a 100644
--- a/arch/powerpc/platforms/85xx/socrates_fpga_pic.c
+++ b/arch/powerpc/platforms/85xx/socrates_fpga_pic.c
@@ -245,7 +245,7 @@ static int socrates_fpga_pic_host_map(struct irq_host *h, unsigned int virq,
irq_hw_number_t hwirq)
{
/* All interrupts are LEVEL sensitive */
- get_irq_desc(virq)->status |= IRQ_LEVEL;
+ irq_to_desc(virq)->status |= IRQ_LEVEL;
set_irq_chip_and_handler(virq, &socrates_fpga_pic_chip,
handle_fasteoi_irq);
diff --git a/arch/powerpc/platforms/86xx/gef_pic.c b/arch/powerpc/platforms/86xx/gef_pic.c
index 50d0a2b..978d6cb 100644
--- a/arch/powerpc/platforms/86xx/gef_pic.c
+++ b/arch/powerpc/platforms/86xx/gef_pic.c
@@ -163,7 +163,7 @@ static int gef_pic_host_map(struct irq_host *h, unsigned int virq,
irq_hw_number_t hwirq)
{
/* All interrupts are LEVEL sensitive */
- get_irq_desc(virq)->status |= IRQ_LEVEL;
+ irq_to_desc(virq)->status |= IRQ_LEVEL;
set_irq_chip_and_handler(virq, &gef_pic_chip, handle_level_irq);
return 0;
diff --git a/arch/powerpc/platforms/cell/beat_interrupt.c b/arch/powerpc/platforms/cell/beat_interrupt.c
index 7225484..4a2bbff 100644
--- a/arch/powerpc/platforms/cell/beat_interrupt.c
+++ b/arch/powerpc/platforms/cell/beat_interrupt.c
@@ -136,7 +136,7 @@ static void beatic_pic_host_unmap(struct irq_host *h, unsigned int virq)
static int beatic_pic_host_map(struct irq_host *h, unsigned int virq,
irq_hw_number_t hw)
{
- struct irq_desc *desc = get_irq_desc(virq);
+ struct irq_desc *desc = irq_to_desc(virq);
int64_t err;
err = beat_construct_and_connect_irq_plug(virq, hw);
diff --git a/arch/powerpc/platforms/cell/spider-pic.c b/arch/powerpc/platforms/cell/spider-pic.c
index 4e56556..9dd63c5 100644
--- a/arch/powerpc/platforms/cell/spider-pic.c
+++ b/arch/powerpc/platforms/cell/spider-pic.c
@@ -102,7 +102,7 @@ static void spider_ack_irq(unsigned int virq)
/* Reset edge detection logic if necessary
*/
- if (get_irq_desc(virq)->status & IRQ_LEVEL)
+ if (irq_to_desc(virq)->status & IRQ_LEVEL)
return;
/* Only interrupts 47 to 50 can be set to edge */
@@ -119,7 +119,7 @@ static int spider_set_irq_type(unsigned int virq, unsigned int type)
struct spider_pic *pic = spider_virq_to_pic(virq);
unsigned int hw = irq_map[virq].hwirq;
void __iomem *cfg = spider_get_irq_config(pic, hw);
- struct irq_desc *desc = get_irq_desc(virq);
+ struct irq_desc *desc = irq_to_desc(virq);
u32 old_mask;
u32 ic;
diff --git a/arch/powerpc/platforms/iseries/irq.c b/arch/powerpc/platforms/iseries/irq.c
index 94f4447..f8446ea 100644
--- a/arch/powerpc/platforms/iseries/irq.c
+++ b/arch/powerpc/platforms/iseries/irq.c
@@ -214,7 +214,7 @@ void __init iSeries_activate_IRQs()
unsigned long flags;
for_each_irq (irq) {
- struct irq_desc *desc = get_irq_desc(irq);
+ struct irq_desc *desc = irq_to_desc(irq);
if (desc && desc->chip && desc->chip->startup) {
spin_lock_irqsave(&desc->lock, flags);
diff --git a/arch/powerpc/platforms/powermac/pic.c b/arch/powerpc/platforms/powermac/pic.c
index d212006..484d21e 100644
--- a/arch/powerpc/platforms/powermac/pic.c
+++ b/arch/powerpc/platforms/powermac/pic.c
@@ -152,12 +152,12 @@ static unsigned int pmac_startup_irq(unsigned int virq)
unsigned long bit = 1UL << (src & 0x1f);
int i = src >> 5;
- spin_lock_irqsave(&pmac_pic_lock, flags);
- if ((irq_desc[virq].status & IRQ_LEVEL) == 0)
+ spin_lock_irqsave(&pmac_pic_lock, flags);
+ if ((irq_to_desc(virq)->status & IRQ_LEVEL) == 0)
out_le32(&pmac_irq_hw[i]->ack, bit);
__set_bit(src, ppc_cached_irq_mask);
__pmac_set_irq_mask(src, 0);
- spin_unlock_irqrestore(&pmac_pic_lock, flags);
+ spin_unlock_irqrestore(&pmac_pic_lock, flags);
return 0;
}
@@ -285,7 +285,7 @@ static int pmac_pic_host_match(struct irq_host *h, struct device_node *node)
static int pmac_pic_host_map(struct irq_host *h, unsigned int virq,
irq_hw_number_t hw)
{
- struct irq_desc *desc = get_irq_desc(virq);
+ struct irq_desc *desc = irq_to_desc(virq);
int level;
if (hw >= max_irqs)
diff --git a/arch/powerpc/platforms/pseries/xics.c b/arch/powerpc/platforms/pseries/xics.c
index 419f8a6..75935ae 100644
--- a/arch/powerpc/platforms/pseries/xics.c
+++ b/arch/powerpc/platforms/pseries/xics.c
@@ -156,7 +156,7 @@ static int get_irq_server(unsigned int virq, unsigned int strict_check)
cpumask_t cpumask;
cpumask_t tmp = CPU_MASK_NONE;
- cpumask_copy(&cpumask, irq_desc[virq].affinity);
+ cpumask_copy(&cpumask, irq_to_desc(virq)->affinity);
if (!distribute_irqs)
return default_server;
@@ -419,7 +419,7 @@ static int xics_host_map(struct irq_host *h, unsigned int virq,
/* Insert the interrupt mapping into the radix tree for fast lookup */
irq_radix_revmap_insert(xics_host, virq, hw);
- get_irq_desc(virq)->status |= IRQ_LEVEL;
+ irq_to_desc(virq)->status |= IRQ_LEVEL;
set_irq_chip_and_handler(virq, xics_irq_chip, handle_fasteoi_irq);
return 0;
}
@@ -843,7 +843,7 @@ void xics_migrate_irqs_away(void)
/* We need to get IPIs still. */
if (irq == XICS_IPI || irq == XICS_IRQ_SPURIOUS)
continue;
- desc = get_irq_desc(virq);
+ desc = irq_to_desc(virq);
/* We only need to migrate enabled IRQS */
if (desc == NULL || desc->chip == NULL
@@ -872,7 +872,7 @@ void xics_migrate_irqs_away(void)
virq, cpu);
/* Reset affinity to all cpus */
- cpumask_setall(irq_desc[virq].affinity);
+ cpumask_setall(irq_to_desc(virq)->affinity);
desc->chip->set_affinity(virq, cpu_all_mask);
unlock:
spin_unlock_irqrestore(&desc->lock, flags);
diff --git a/arch/powerpc/sysdev/cpm1.c b/arch/powerpc/sysdev/cpm1.c
index 82424cd..5235373 100644
--- a/arch/powerpc/sysdev/cpm1.c
+++ b/arch/powerpc/sysdev/cpm1.c
@@ -102,7 +102,7 @@ static int cpm_pic_host_map(struct irq_host *h, unsigned int virq,
{
pr_debug("cpm_pic_host_map(%d, 0x%lx)\n", virq, hw);
- get_irq_desc(virq)->status |= IRQ_LEVEL;
+ irq_to_desc(virq)->status |= IRQ_LEVEL;
set_irq_chip_and_handler(virq, &cpm_pic, handle_fasteoi_irq);
return 0;
}
diff --git a/arch/powerpc/sysdev/cpm2_pic.c b/arch/powerpc/sysdev/cpm2_pic.c
index 78f1f7c..722cf72 100644
--- a/arch/powerpc/sysdev/cpm2_pic.c
+++ b/arch/powerpc/sysdev/cpm2_pic.c
@@ -115,11 +115,13 @@ static void cpm2_ack(unsigned int virq)
static void cpm2_end_irq(unsigned int virq)
{
+ struct irq_desc *desc;
int bit, word;
unsigned int irq_nr = virq_to_hw(virq);
- if (!(irq_desc[irq_nr].status & (IRQ_DISABLED|IRQ_INPROGRESS))
- && irq_desc[irq_nr].action) {
+ desc = irq_to_desc(irq_nr);
+ if (!(desc->status & (IRQ_DISABLED|IRQ_INPROGRESS))
+ && desc->action) {
bit = irq_to_siubit[irq_nr];
word = irq_to_siureg[irq_nr];
@@ -138,7 +140,7 @@ static void cpm2_end_irq(unsigned int virq)
static int cpm2_set_irq_type(unsigned int virq, unsigned int flow_type)
{
unsigned int src = virq_to_hw(virq);
- struct irq_desc *desc = get_irq_desc(virq);
+ struct irq_desc *desc = irq_to_desc(virq);
unsigned int vold, vnew, edibit;
if (flow_type == IRQ_TYPE_NONE)
@@ -210,7 +212,7 @@ static int cpm2_pic_host_map(struct irq_host *h, unsigned int virq,
{
pr_debug("cpm2_pic_host_map(%d, 0x%lx)\n", virq, hw);
- get_irq_desc(virq)->status |= IRQ_LEVEL;
+ irq_to_desc(virq)->status |= IRQ_LEVEL;
set_irq_chip_and_handler(virq, &cpm2_pic, handle_level_irq);
return 0;
}
diff --git a/arch/powerpc/sysdev/fsl_msi.c b/arch/powerpc/sysdev/fsl_msi.c
index da38a1f..7174374 100644
--- a/arch/powerpc/sysdev/fsl_msi.c
+++ b/arch/powerpc/sysdev/fsl_msi.c
@@ -55,7 +55,7 @@ static int fsl_msi_host_map(struct irq_host *h, unsigned int virq,
{
struct irq_chip *chip = &fsl_msi_chip;
- get_irq_desc(virq)->status |= IRQ_TYPE_EDGE_FALLING;
+ irq_to_desc(virq)->status |= IRQ_TYPE_EDGE_FALLING;
set_irq_chip_and_handler(virq, chip, handle_edge_irq);
diff --git a/arch/powerpc/sysdev/i8259.c b/arch/powerpc/sysdev/i8259.c
index a96584a..78ed945 100644
--- a/arch/powerpc/sysdev/i8259.c
+++ b/arch/powerpc/sysdev/i8259.c
@@ -175,12 +175,12 @@ static int i8259_host_map(struct irq_host *h, unsigned int virq,
/* We block the internal cascade */
if (hw == 2)
- get_irq_desc(virq)->status |= IRQ_NOREQUEST;
+ irq_to_desc(virq)->status |= IRQ_NOREQUEST;
/* We use the level handler only for now, we might want to
* be more cautious here but that works for now
*/
- get_irq_desc(virq)->status |= IRQ_LEVEL;
+ irq_to_desc(virq)->status |= IRQ_LEVEL;
set_irq_chip_and_handler(virq, &i8259_pic, handle_level_irq);
return 0;
}
diff --git a/arch/powerpc/sysdev/ipic.c b/arch/powerpc/sysdev/ipic.c
index cb7689c..f042c1d 100644
--- a/arch/powerpc/sysdev/ipic.c
+++ b/arch/powerpc/sysdev/ipic.c
@@ -605,7 +605,7 @@ static int ipic_set_irq_type(unsigned int virq, unsigned int flow_type)
{
struct ipic *ipic = ipic_from_irq(virq);
unsigned int src = ipic_irq_to_hw(virq);
- struct irq_desc *desc = get_irq_desc(virq);
+ struct irq_desc *desc = irq_to_desc(virq);
unsigned int vold, vnew, edibit;
if (flow_type == IRQ_TYPE_NONE)
diff --git a/arch/powerpc/sysdev/mpc8xx_pic.c b/arch/powerpc/sysdev/mpc8xx_pic.c
index 5d2d552..0117958 100644
--- a/arch/powerpc/sysdev/mpc8xx_pic.c
+++ b/arch/powerpc/sysdev/mpc8xx_pic.c
@@ -72,7 +72,7 @@ static void mpc8xx_end_irq(unsigned int virq)
static int mpc8xx_set_irq_type(unsigned int virq, unsigned int flow_type)
{
- struct irq_desc *desc = get_irq_desc(virq);
+ struct irq_desc *desc = irq_to_desc(virq);
desc->status &= ~(IRQ_TYPE_SENSE_MASK | IRQ_LEVEL);
desc->status |= flow_type & IRQ_TYPE_SENSE_MASK;
diff --git a/arch/powerpc/sysdev/mpic.c b/arch/powerpc/sysdev/mpic.c
index 30c44e6..4fd57ab 100644
--- a/arch/powerpc/sysdev/mpic.c
+++ b/arch/powerpc/sysdev/mpic.c
@@ -572,7 +572,7 @@ static int irq_choose_cpu(unsigned int virt_irq)
cpumask_t mask;
int cpuid;
- cpumask_copy(&mask, irq_desc[virt_irq].affinity);
+ cpumask_copy(&mask, irq_to_desc(virt_irq)->affinity);
if (cpus_equal(mask, CPU_MASK_ALL)) {
static int irq_rover;
static DEFINE_SPINLOCK(irq_rover_lock);
@@ -621,7 +621,7 @@ static struct mpic *mpic_find(unsigned int irq)
if (irq < NUM_ISA_INTERRUPTS)
return NULL;
- return irq_desc[irq].chip_data;
+ return irq_to_desc(irq)->chip_data;
}
/* Determine if the linux irq is an IPI */
@@ -648,14 +648,14 @@ static inline u32 mpic_physmask(u32 cpumask)
/* Get the mpic structure from the IPI number */
static inline struct mpic * mpic_from_ipi(unsigned int ipi)
{
- return irq_desc[ipi].chip_data;
+ return irq_to_desc(ipi)->chip_data;
}
#endif
/* Get the mpic structure from the irq number */
static inline struct mpic * mpic_from_irq(unsigned int irq)
{
- return irq_desc[irq].chip_data;
+ return irq_to_desc(irq)->chip_data;
}
/* Send an EOI */
@@ -735,7 +735,7 @@ static void mpic_unmask_ht_irq(unsigned int irq)
mpic_unmask_irq(irq);
- if (irq_desc[irq].status & IRQ_LEVEL)
+ if (irq_to_desc(irq)->status & IRQ_LEVEL)
mpic_ht_end_irq(mpic, src);
}
@@ -745,7 +745,7 @@ static unsigned int mpic_startup_ht_irq(unsigned int irq)
unsigned int src = mpic_irq_to_hw(irq);
mpic_unmask_irq(irq);
- mpic_startup_ht_interrupt(mpic, src, irq_desc[irq].status);
+ mpic_startup_ht_interrupt(mpic, src, irq_to_desc(irq)->status);
return 0;
}
@@ -755,7 +755,7 @@ static void mpic_shutdown_ht_irq(unsigned int irq)
struct mpic *mpic = mpic_from_irq(irq);
unsigned int src = mpic_irq_to_hw(irq);
- mpic_shutdown_ht_interrupt(mpic, src, irq_desc[irq].status);
+ mpic_shutdown_ht_interrupt(mpic, src, irq_to_desc(irq)->status);
mpic_mask_irq(irq);
}
@@ -772,7 +772,7 @@ static void mpic_end_ht_irq(unsigned int irq)
* latched another edge interrupt coming in anyway
*/
- if (irq_desc[irq].status & IRQ_LEVEL)
+ if (irq_to_desc(irq)->status & IRQ_LEVEL)
mpic_ht_end_irq(mpic, src);
mpic_eoi(mpic);
}
@@ -856,7 +856,7 @@ int mpic_set_irq_type(unsigned int virq, unsigned int flow_type)
{
struct mpic *mpic = mpic_from_irq(virq);
unsigned int src = mpic_irq_to_hw(virq);
- struct irq_desc *desc = get_irq_desc(virq);
+ struct irq_desc *desc = irq_to_desc(virq);
unsigned int vecpri, vold, vnew;
DBG("mpic: set_irq_type(mpic:@%p,virq:%d,src:0x%x,type:0x%x)\n",
diff --git a/arch/powerpc/sysdev/mv64x60_pic.c b/arch/powerpc/sysdev/mv64x60_pic.c
index 2aa4ed0..485b924 100644
--- a/arch/powerpc/sysdev/mv64x60_pic.c
+++ b/arch/powerpc/sysdev/mv64x60_pic.c
@@ -213,7 +213,7 @@ static int mv64x60_host_map(struct irq_host *h, unsigned int virq,
{
int level1;
- get_irq_desc(virq)->status |= IRQ_LEVEL;
+ irq_to_desc(virq)->status |= IRQ_LEVEL;
level1 = (hwirq & MV64x60_LEVEL1_MASK) >> MV64x60_LEVEL1_OFFSET;
BUG_ON(level1 > MV64x60_LEVEL1_GPP);
diff --git a/arch/powerpc/sysdev/qe_lib/qe_ic.c b/arch/powerpc/sysdev/qe_lib/qe_ic.c
index 3faa42e..fc09874 100644
--- a/arch/powerpc/sysdev/qe_lib/qe_ic.c
+++ b/arch/powerpc/sysdev/qe_lib/qe_ic.c
@@ -189,7 +189,7 @@ static inline void qe_ic_write(volatile __be32 __iomem * base, unsigned int reg
static inline struct qe_ic *qe_ic_from_irq(unsigned int virq)
{
- return irq_desc[virq].chip_data;
+ return irq_to_desc(virq)->chip_data;
}
#define virq_to_hw(virq) ((unsigned int)irq_map[virq].hwirq)
@@ -263,7 +263,7 @@ static int qe_ic_host_map(struct irq_host *h, unsigned int virq,
chip = &qe_ic->hc_irq;
set_irq_chip_data(virq, qe_ic);
- get_irq_desc(virq)->status |= IRQ_LEVEL;
+ irq_to_desc(virq)->status |= IRQ_LEVEL;
set_irq_chip_and_handler(virq, chip, handle_level_irq);
diff --git a/arch/powerpc/sysdev/tsi108_pci.c b/arch/powerpc/sysdev/tsi108_pci.c
index cf244a4..02f6009 100644
--- a/arch/powerpc/sysdev/tsi108_pci.c
+++ b/arch/powerpc/sysdev/tsi108_pci.c
@@ -398,7 +398,7 @@ static int pci_irq_host_map(struct irq_host *h, unsigned int virq,
DBG("%s(%d, 0x%lx)\n", __func__, virq, hw);
if ((virq >= 1) && (virq <= 4)){
irq = virq + IRQ_PCI_INTAD_BASE - 1;
- get_irq_desc(irq)->status |= IRQ_LEVEL;
+ irq_to_desc(irq)->status |= IRQ_LEVEL;
set_irq_chip(irq, &tsi108_pci_irq);
}
return 0;
diff --git a/arch/powerpc/sysdev/uic.c b/arch/powerpc/sysdev/uic.c
index 466ce9a..cf97935 100644
--- a/arch/powerpc/sysdev/uic.c
+++ b/arch/powerpc/sysdev/uic.c
@@ -57,7 +57,7 @@ struct uic {
static void uic_unmask_irq(unsigned int virq)
{
- struct irq_desc *desc = get_irq_desc(virq);
+ struct irq_desc *desc = irq_to_desc(virq);
struct uic *uic = get_irq_chip_data(virq);
unsigned int src = uic_irq_to_hw(virq);
unsigned long flags;
@@ -101,7 +101,7 @@ static void uic_ack_irq(unsigned int virq)
static void uic_mask_ack_irq(unsigned int virq)
{
- struct irq_desc *desc = get_irq_desc(virq);
+ struct irq_desc *desc = irq_to_desc(virq);
struct uic *uic = get_irq_chip_data(virq);
unsigned int src = uic_irq_to_hw(virq);
unsigned long flags;
@@ -129,7 +129,7 @@ static int uic_set_irq_type(unsigned int virq, unsigned int flow_type)
{
struct uic *uic = get_irq_chip_data(virq);
unsigned int src = uic_irq_to_hw(virq);
- struct irq_desc *desc = get_irq_desc(virq);
+ struct irq_desc *desc = irq_to_desc(virq);
unsigned long flags;
int trigger, polarity;
u32 tr, pr, mask;
diff --git a/arch/powerpc/sysdev/xilinx_intc.c b/arch/powerpc/sysdev/xilinx_intc.c
index 40edad5..ab74371 100644
--- a/arch/powerpc/sysdev/xilinx_intc.c
+++ b/arch/powerpc/sysdev/xilinx_intc.c
@@ -79,7 +79,7 @@ static void xilinx_intc_mask(unsigned int virq)
static int xilinx_intc_set_type(unsigned int virq, unsigned int flow_type)
{
- struct irq_desc *desc = get_irq_desc(virq);
+ struct irq_desc *desc = irq_to_desc(virq);
desc->status &= ~(IRQ_TYPE_SENSE_MASK | IRQ_LEVEL);
desc->status |= flow_type & IRQ_TYPE_SENSE_MASK;
--
1.6.2.1
^ permalink raw reply related
* [PATCH 2/6] powerpc/pseries: Use irq_has_action() in eeh_disable_irq()
From: Michael Ellerman @ 2009-10-14 5:44 UTC (permalink / raw)
To: linuxppc-dev
In-Reply-To: <a6fc612b826ff12628e62601203d565df00c6436.1255499081.git.michael@ellerman.id.au>
Rather than open-coding our own check, use irq_has_action()
to check if an irq has an action - ie. is "in use".
irq_has_action() doesn't take the descriptor lock, but it
shouldn't matter - we're just using it as an indicator
that the irq is in use. disable_irq_nosync() will take
the descriptor lock before doing anything also.
Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
arch/powerpc/platforms/pseries/eeh_driver.c | 18 +-----------------
1 files changed, 1 insertions(+), 17 deletions(-)
diff --git a/arch/powerpc/platforms/pseries/eeh_driver.c b/arch/powerpc/platforms/pseries/eeh_driver.c
index 0e8db67..ef8e454 100644
--- a/arch/powerpc/platforms/pseries/eeh_driver.c
+++ b/arch/powerpc/platforms/pseries/eeh_driver.c
@@ -63,22 +63,6 @@ static void print_device_node_tree(struct pci_dn *pdn, int dent)
}
#endif
-/**
- * irq_in_use - return true if this irq is being used
- */
-static int irq_in_use(unsigned int irq)
-{
- int rc = 0;
- unsigned long flags;
- struct irq_desc *desc = irq_desc + irq;
-
- spin_lock_irqsave(&desc->lock, flags);
- if (desc->action)
- rc = 1;
- spin_unlock_irqrestore(&desc->lock, flags);
- return rc;
-}
-
/**
* eeh_disable_irq - disable interrupt for the recovering device
*/
@@ -93,7 +77,7 @@ static void eeh_disable_irq(struct pci_dev *dev)
if (dev->msi_enabled || dev->msix_enabled)
return;
- if (!irq_in_use(dev->irq))
+ if (!irq_has_action(dev->irq))
return;
PCI_DN(dn)->eeh_mode |= EEH_MODE_IRQ_DISABLED;
--
1.6.2.1
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox