MPC8641 BASED Custom designed Board Linux stucks after Mounting cache hash table entries
Hii All, I am trying to port linux 2.6.34 to mpc8641d based custom designed board but I am facing kernel oops after mounting hash table entries. can anybody was facing this kind of issue while porting or can give me some light on this. Any pointer/direction will be very helpfull. Here I am showing the snapshot of the problem for more understanding this issue.. bootm 160 60 140 ## Booting kernel from Legacy Image at 0160 ... Image Name: Linux-2.6.34 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size:2615699 Bytes = 2.5 MiB Load Address: Entry Point: Verifying Checksum ... OK ## Loading init Ramdisk from Legacy Image at 0060 ... Image Name: rootfs Image Type: PowerPC Linux RAMDisk Image (gzip compressed) Data Size:8043648 Bytes = 7.7 MiB Load Address: Entry Point: Verifying Checksum ... OK ## Flattened Device Tree blob at 0140 Booting using the fdt blob at 0x0140 Uncompressing Kernel Image ... OK Loading Ramdisk to 1f6fb000, end 1fea6c80 ... OK Loading Device Tree to 007fb000, end 007ff919 ... OK Using MPC86xx HPCN machine description Total memory = 512MB; using 1024kB for hash table (at cff0) Linux version 2.6.34 (ashish@ashish-virtual-machine) (gcc version 4.7.2 (GCC) ) #1 Fri Dec 6 10:38:44 IST 2013 Found initrd at 0xdf6fb000:0xdfea6c80 bootconsole [udbg0] enabled setup_arch: bootmem mpc86xx_hpcn_setup_arch() MPC86xx HPCN board from Freescale Semiconductor arch: exit Zone PFN ranges: DMA 0x -> 0x0002 Normal empty HighMem empty Movable zone start PFN for each node early_node_map[1] active PFN ranges 0: 0x -> 0x0002 Built 1 zonelists in Zone order, mobility grouping on. Total pages: 130048 Kernel command line: mem=512m root=/dev/ram console=ttyS0,115200 PID hash table entries: 2048 (order: 1, 8192 bytes) Dentry cache hash table entries: 65536 (order: 6, 262144 bytes) Inode-cache hash table entries: 32768 (order: 5, 131072 bytes) Memory: 505540k/524288k available (4976k kernel code, 18748k reserved, 196k data, 160k bss, 192k init) Kernel virtual memory layout: * 0xfffd..0xf000 : fixmap * 0xff80..0xffc0 : highmem PTEs * 0xff7fe000..0xff80 : early ioremap * 0xe100..0xff7fe000 : vmalloc & ioremap SLUB: Genslabs=13, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1 Hierarchical RCU implementation. NR_IRQS:512 nr_irqs:512 mpic: Setting up MPIC " MPIC " version 1.2 at f804, max 2 CPUs mpic: ISU size: 256, shift: 8, mask: ff mpic: Initializing for 256 sources clocksource: timebase mult[200] shift[22] registered Console: colour dummy device 80x25 Mount-cache hash table entries: 512 Unable to handle kernel paging request for data at address 0x Faulting instruction address: 0xc00179c8 Oops: Kernel access of bad area, sig: 11 [#1] MPC86xx HPCN last sysfs file: Modules linked in: NIP: c00179c8 LR: c00d69ec CTR: 0008 REGS: c0507e40 TRAP: 0300 Not tainted (2.6.34) MSR: 9032 CR: 8428 XER: DAR: , DSISR: 4000 TASK = c04de410[0] 'swapper' THREAD: c0506000 GPR00: c00d6da0 c0507ef0 c04de410 0064 df01d0e0 GPR08: 000d c0503194 4422 f8af 200c9000 GPR16: fbbfdffb 0024 1fea8b08 1fea8d24 GPR24: 1fffa2e4 4000 1ffcd66c dfffed30 df01d080 NIP [c00179c8] strcmp+0x10/0x24 LR [c00d69ec] duplicate_name+0x3c/0x74 Call Trace: [c0507ef0] [c07fc440] 0xc07fc440 (unreliable) [c0507f00] [c00d6da0] proc_device_tree_add_node+0xfc/0x144 [c0507f20] [c00d6ce4] proc_device_tree_add_node+0x40/0x144 [c0507f40] [c00d6ce4] proc_device_tree_add_node+0x40/0x144 [c0507f60] [c00d6ce4] proc_device_tree_add_node+0x40/0x144 [c0507f80] [c00d6ce4] proc_device_tree_add_node+0x40/0x144 [c0507fa0] [c04bdcd4] proc_device_tree_init+0x68/0x94 [c0507fb0] [c04bd6f8] proc_root_init+0xd0/0x108 [c0507fc0] [c04ac728] start_kernel+0x2b4/0x2cc [c0507ff0] [3444] 0x3444 Instruction dump: 2c00 4082fff8 38a5 8c040001 2c00 9c050001 4082fff4 4e800020 38a3 3884 8c650001 2c83 <8c040001> 7c601851 4d860020 4182ffec ---[ end trace 31fd0ba7d8756001 ]--- Kernel panic - not syncing: Attempted to kill the idle task! Rebooting in 180 seconds.. Regards Ashish Kumar Khetan ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
MPC8641 based custom board Kernel stuck at 1000Mhz core clock
Hi, I am using MPC8641-HPCN based custom board and able to boot linux at MPX clock 400Mhz and core clock 800mhz. When I am increasing core frequency ie MPX clock at 400Mhz and core at 1Ghz, kernel stuck. Does any body have faced this kind of issue ? Or any idea how to resolve this? Thanks & Regards A$hi$h ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: MPC8641 based custom board Kernel stuck at 1000Mhz core clock
On Thursday 03 April 2014 08:55 AM, sanjeev sharma wrote: Are you able to capture kernel logs ? Regards Sanjeev Sharma On Thu, Mar 27, 2014 at 10:01 PM, <mailto:valdis.kletni...@vt.edu>> wrote: On Thu, 27 Mar 2014 16:04:37 +0530, Ashish said: > Hi, > > I am using MPC8641-HPCN based custom board and able to boot linux at > MPX clock 400Mhz and core clock 800mhz. When I am increasing core > frequency ie MPX clock at 400Mhz and core at 1Ghz, kernel stuck. Step 0: Prove to us that your core actually runs reliable and stably at 1Ghz. Step 1: Figure out *where* it gets stuck. If you have earlyprintk working on your board, adding 'initcall_debug ignore_loglevel' to the kernel cmdline often helps track down where a kernel hangs during boot. ___ Kernelnewbies mailing list kernelnewb...@kernelnewbies.org <mailto:kernelnewb...@kernelnewbies.org> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies Hi, Does kernel logs means debugging information that kernel prints while booting using printk or it is something else? Here is kernel boot logs that kernel printed while booting... U-Boot 2013.04 (Jan 27 2014 - 11:21:21) Unicore software on multiprocessor system!! To enable mutlticore build define CONFIG_MP CPU: 8641, Version: 2.1, (0x80900021) Core: E600 Core 0, Version: 2.2, (0x80040202) Clock Configuration: CPU:1000 MHz, MPX:400 MHz DDR:200 MHz (400 MT/s data rate), LBC:25 MHz L1:D-cache 32 KB enabled I-cache 32 KB enabled L2:512 KB enabled Board: MPC8641-HPCN I2C: ready DRAM: 512 MiB SDRAM test phase 1: SDRAM test phase 2: SDRAM test passed. Flash: 16 MiB EEPROM: NXID v1 In:serial Out: serial Err: serial Net: eTSEC1, eTSEC2, eTSEC3, eTSEC4 [PRIME] Hit any key to stop autoboot: Speed: 1000, full duplex Using eTSEC4 device TFTP from server 192.168.10.1; our IP address is 192.168.10.2 Filename 'uRamdisk'. Load address: 0x60 Loading: *# # # # # # # # # # # # # # # # # # # # # # # ## 13.1 MiB/s done Bytes transferred = 22680188 (15a127c hex) Speed: 1000, full duplex Using eTSEC4 device TFTP from server 192.168.10.1; our IP address is 192.168.10.2 Filename 'uImage'. Load address: 0x1600 Loading: *# # ### 14 MiB/s done Bytes transferred = 2476304 (25c910 hex) Speed: 1000, full duplex Using eTSEC4 device TFTP from server 192.168.10.1; our IP address is 192.168.10.2 Filename 'mpc8641_hpcn.dtb'. Load address: 0x1400 Loading: *# 2.6 MiB/s done Bytes transferred = 5540 (15a4 hex) ## Booting kernel from Legacy Image at 1600 ... Image Name: Linux-3.13.6 Image Type: PowerPC Linux Kernel Image (gzip compressed) Data Size:2476240 Bytes = 2.4 MiB Load Address: Entry Point: Verifying Checksum ... OK ## Loading init Ramdisk from Legacy Image at 0060 ... Image Name: rootfs Image Type: PowerPC Linux RAMDisk Image (gzip compressed) Data Size:22680124 Bytes = 21.6 MiB Load Address: Entry Point: Verifying Checksum ... OK ## Flattened Device Tree blob at 14
Help:To Add NAND Node in Device Tree
Hi, I am trying to add Nand Node in Device Tree, for My Board(Some what similar to MPC8548_CDS). In Board, Nand is attached to LBC UPM Controller. Currently My NAND Driver working Fine without NAND Device Node in Device Tree. But as Requirement, I have to add NAND Device Node in Device Tree. Can you give me some basic out lines to carry out this task? I know that: 1. I have to make some changes in My NAND Driver to Read Device Tree. 2. Add NAND Node in Device Tree. But Again What property I need for It. Thanks in Advance. With Best Regards Ashish Yadav -- eInfochips Business Disclaimer: This message may contain confidential, proprietary or legally Privileged information. In case you are not the original intended Recipient of the message, you must not, directly or indirectly, use, Disclose,distribute, print, or copy any part of this message and you are requested to delete it and inform the sender. Any views expressed in this message are those of the individual sender unless otherwise stated.Nothing contained in this message shall be construed as an offer or acceptance of any offer by eInfochips Limited and/or eInfochips Inc(“eInfochips”) unless sent with that express intent and with due authority of eInfochips.EInfochips has taken enough precautions to prevent the spread of viruses. However the company accepts no liability for any damage caused by any virus transmitted by this email. ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
PCIE Switch Bringup Problem
Hi, I am using MPC8640D based powerpc board. I am trying to bringup PCIe switch(PES64H16AG2) using linux BSP(Linux-3.14). After Power on reset its unable detect to detect any link on PCIe BUS. While on another bus PCIe link is detected which is not another PCIe device. Any debugging points/link will be really helpful. Regards @$HI$H ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH] mpc85xx: dts: Remove SPI and NAND partition from bsc9131rdb.dtsi
* Run "mtdparts default" on u-boot to create dynamic partitions * Or use dynamic mtd partition with the help of bootargs in u-boot Append bootargs with: "mtdparts=ff80.flash:1m(nand_uboot),512K(nand_dtb),8m(nand_kernel),-(fs);\ spiff707000.0:1m(spi_uboot),4m(spi_kernel),512k(spi_dtb),-(fs)'" Signed-off-by: Ashish Kumar --- arch/powerpc/boot/dts/bsc9131rdb.dtsi | 50 - 1 files changed, 0 insertions(+), 50 deletions(-) diff --git a/arch/powerpc/boot/dts/bsc9131rdb.dtsi b/arch/powerpc/boot/dts/bsc9131rdb.dtsi index 9e6c013..45efcba 100644 --- a/arch/powerpc/boot/dts/bsc9131rdb.dtsi +++ b/arch/powerpc/boot/dts/bsc9131rdb.dtsi @@ -40,31 +40,6 @@ compatible = "fsl,ifc-nand"; reg = <0x0 0x0 0x4000>; - partition@0 { - /* This location must not be altered */ - /* 3MB for u-boot Bootloader Image */ - reg = <0x0 0x0030>; - label = "NAND U-Boot Image"; - read-only; - }; - - partition@30 { - /* 1MB for DTB Image */ - reg = <0x0030 0x0010>; - label = "NAND DTB Image"; - }; - - partition@40 { - /* 8MB for Linux Kernel Image */ - reg = <0x0040 0x0080>; - label = "NAND Linux Kernel Image"; - }; - - partition@c0 { - /* Rest space for Root file System Image */ - reg = <0x00c0 0x0740>; - label = "NAND RFS Image"; - }; }; }; @@ -82,31 +57,6 @@ reg = <0>; spi-max-frequency = <5000>; - /* 512KB for u-boot Bootloader Image */ - partition@0 { - reg = <0x0 0x0008>; - label = "SPI Flash U-Boot Image"; - read-only; - }; - - /* 512KB for DTB Image */ - partition@8 { - reg = <0x0008 0x0008>; - label = "SPI Flash DTB Image"; - }; - - /* 4MB for Linux Kernel Image */ - partition@10 { - reg = <0x0010 0x0040>; - label = "SPI Flash Kernel Image"; - }; - - /*11MB for RFS Image */ - partition@50 { - reg = <0x0050 0x00B0>; - label = "SPI Flash RFS Image"; - }; - }; }; -- 1.7.6.GIT ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
MPC8641 based custom board kernel Bug
Hi, I was trying to port Linux-3.12 for MPC8641 based custom designed board for evaluation purpose. I have been facing a kernel bug at mpic initialization. Is somebody have faced this kind of bugs or can give me any pointer for further steps how to solve kernel bugs will be really helpful. here is the snapshot for the bug that may be helpful to address the bug. Using MPC86xx HPCN machine description Total memory = 512MB; using 1024kB for hash table (at cff0) Linux version 3.12.0 (ashish@ashish-VirtualBox) (gcc version 4.7.2 (GCC) ) #2 We d Dec 25 16:04:36 IST 2013 Found initrd at 0xde975000:0xdfec428a bootconsole [udbg0] enabled setup_arch: bootmem mpc86xx_hpcn_setup_arch() MPC86xx HPCN board from Freescale Semiconductor arch: exit Zone ranges: DMA [mem 0x-0x1fff] Normal empty HighMem empty Movable zone start for each node Early memory node ranges node 0: [mem 0x-0x1fff] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 130048 Kernel command line: root=/dev/ram0 rw rootfs console=ttyS0,115200 PID hash table entries: 2048 (order: 1, 8192 bytes) Dentry cache hash table entries: 65536 (order: 6, 262144 bytes) Inode-cache hash table entries: 32768 (order: 5, 131072 bytes) Sorting __ex_table... Memory: 424980K/524288K available (4172K kernel code, 208K rwdata, 1304K rodata, 196K init, 149K bss, 99308K reserved, 0K highmem) Kernel virtual memory layout: * 0xfffcf000..0xf000 : fixmap * 0xff80..0xffc0 : highmem PTEs * 0xff7fe000..0xff80 : early ioremap * 0xe100..0xff7fe000 : vmalloc & ioremap SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1 NR_IRQS:512 nr_irqs:512 16 [ cut here ] kernel BUG at arch/powerpc/platforms/86xx/pic.c:42! Oops: Exception in kernel mode, sig: 5 [#1] MPC86xx HPCN Modules linked in: CPU: 0 PID: 0 Comm: swapper Not tainted 3.12.0 #2 task: c05903e0 ti: c05b4000 task.ti: c05b4000 NIP: c0567438 LR: c0567430 CTR: c0567400 REGS: c05b5ee0 TRAP: 0700 Not tainted (3.12.0) MSR: 00021032 CR: 2442 XER: 2000 GPR00: c0567430 c05b5f90 c05903e0 c04e4ff8 c051e588 008f 0002 GPR08: c042789c 0001 006f 2248 bebd 11a7b4e5 200c8000 GPR16: ffbe 0024 1fec56f8 1fec59a7 GPR24: 1fff97e8 4000 1ffcc6a0 c0bff080 c05c2490 c05c2628 c0585b60 NIP [c0567438] mpc86xx_init_irq+0x38/0x108 LR [c0567430] mpc86xx_init_irq+0x30/0x108 Call Trace: [c05b5f90] [c0567430] mpc86xx_init_irq+0x30/0x108 (unreliable) [c05b5fb0] [c0562784] init_IRQ+0x24/0x38 [c05b5fc0] [c055fde4] start_kernel+0x1bc/0x2ec [c05b5ff0] [3444] 0x3444 Instruction dump: 3d00c04f 3880 38a01002 38c0 38e00100 39088f8c 3860 90010024 bfa10014 4bffec35 7c690034 5529d97e <0f09> 3fa0c04f 4bfff391 3860 ---[ end trace 31fd0ba7d8756001 ]--- Kernel panic - not syncing: Attempted to kill the idle task! Rebooting in 180 seconds.. Thanks & Regards Ashish Khetan ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: MPC8641 based custom board kernel Bug
dio@520 { #address-cells = <0x1>; #size-cells = <0x0>; compatible = "fsl,gianfar-mdio"; reg = <0x520 0x20>; ethernet-phy@0 { interrupt-parent = <0x1>; interrupts = <0xa 0x1>; reg = <0x0>; device_type = "ethernet-phy"; linux,phandle = <0x3>; }; ethernet-phy@1 { interrupt-parent = <0x1>; interrupts = <0xa 0x1>; reg = <0x1>; device_type = "ethernet-phy"; linux,phandle = <0x5>; }; ethernet-phy@2 { interrupt-parent = <0x1>; interrupts = <0xa 0x1>; reg = <0x2>; device_type = "ethernet-phy"; linux,phandle = <0x7>; }; ethernet-phy@3 { interrupt-parent = <0x1>; interrupts = <0xa 0x1>; reg = <0x3>; device_type = "ethernet-phy"; linux,phandle = <0x9>; }; tbi-phy@11 { reg = <0x11>; device_type = "tbi-phy"; linux,phandle = <0x2>; }; }; }; ethernet@25000 { #address-cells = <0x1>; #size-cells = <0x1>; cell-index = <0x1>; device_type = "network"; model = "TSEC"; compatible = "gianfar"; reg = <0x25000 0x1000>; ranges = <0x0 0x25000 0x1000>; local-mac-address = [00 00 00 00 00 00]; interrupts = <0x23 0x2 0x24 0x2 0x28 0x2>; interrupt-parent = <0x1>; tbi-handle = <0x4>; phy-handle = <0x5>; phy-connection-type = "rgmii-id"; mdio@520 { #address-cells = <0x1>; #size-cells = <0x0>; compatible = "fsl,gianfar-tbi"; reg = <0x520 0x20>; tbi-phy@11 { reg = <0x11>; device_type = "tbi-phy"; linux,phandle = <0x4>; }; }; }; ethernet@26000 { #address-cells = <0x1>; #size-cells = <0x1>; cell-index = <0x2>; device_type = "network"; model = "TSEC"; compatible = "gianfar"; reg = <0x26000 0x1000>; ranges = <0x0 0x26000 0x1000>; local-mac-address = [00 00 00 00 00 00]; interrupts = <0x1f 0x2 0x20 0x2 0x21 0x2>; interrupt-parent = <0x1>; tbi-handle = <0x6>; phy-handle = <0x7>; phy-connection-type = "rgmii-id"; mdio@520 { #address-cells = <0x1>; #size-cells = <0x0>; compatible = "fsl,gianfar-tbi"; reg = <0x520 0x20>; tbi-phy@11 { reg = <0x11>; device_type = "tbi-phy"; linux,phandle = <0x6>; }; }; }; ethernet@27000 { #address-cells = <0x1>; #size-cells = <0x1>; cell-index = <0x3>; device_type = "network"; model = "TSEC"; compatible = "gianfar"; reg = <0x27000 0x1000>; ranges = <0x0 0x27000 0x1000>; local-mac-address = [00 00 00 00 00 00]; interrupts = <0x25 0x2 0x26 0x2 0x27 0x2>; interrupt-parent = <0x1>; tbi-handle = <0x8>; phy-handle = <0x9>; phy-connection-type = "rgmii-id"; mdio@520 { #address-cells = <0x1>; #size-cells = <0x0>; compatible = "fsl,gianfar-tbi"; reg = <0x520 0x20>; tbi-phy@11 { reg = <0x11>; device_type = "tbi-phy"; linux,phandle = <0x8>; }; }; }; serial@4500 { cell-index = <0x0>; device_type = "serial";
Re: MPC8641 based custom board kernel Bug
I am using the defconfig from linux kernel tree and for CCSR in u-boot its F800 so the same i am using in device tree... so my question is - is it unable to parse device tree ? or in device tree some thing need to modify in device tree or in kernel source... please give some light on this... Thanks & Regards Ashish Khetan On Fri, Dec 27, 2013 at 4:21 AM, Sri Ram Vemulpali wrote: > Why do not you use deconfig from linux kernel tree. Modify only base > address of CCSR (soc node) for child nodes of root in device tree. > arch/powerpc/boot/dts/mpc8641_hpcn.dts. > > Sri > > > On Thu, Dec 26, 2013 at 3:48 AM, Ashish Khetan > wrote: > >> i tried to dig more inside mpic_alloc fails. the function >> of_find_matching_node calls inside from mpic_alloc() should return the node >> at which pic is connected but it returns NULL. but why? In device tree i am >> using the following.. may be it will helpful. >> /dts-v1/; >> >> / { >> model = "MPC8641HPCN"; >> compatible = "fsl,mpc8641hpcn"; >> #address-cells = <0x1>; >> #size-cells = <0x1>; >> >> aliases { >> ethernet0 = "/soc8641@f800/ethernet@24000"; >> ethernet1 = "/soc8641@f800/ethernet@25000"; >> ethernet2 = "/soc8641@f800/ethernet@26000"; >> ethernet3 = "/soc8641@f800/ethernet@27000"; >> serial0 = "/soc8641@f800/serial@4500"; >> }; >> >> cpus { >> #address-cells = <0x1>; >> #size-cells = <0x0>; >> >> PowerPC,8641@0 { >> device_type = "cpu"; >> reg = <0x0>; >> d-cache-line-size = <0x20>; >> i-cache-line-size = <0x20>; >> d-cache-size = <0x8000>; >> i-cache-size = <0x8000>; >> timebase-frequency = <0x0>; >> bus-frequency = <0x0>; >> clock-frequency = <0x0>; >> }; >> }; >> >> memory { >> device_type = "memory"; >> reg = <0x0 0x2000>; >> }; >> >> localbus@f8005000 { >> #address-cells = <0x2>; >> #size-cells = <0x1>; >> compatible = "fsl,mpc8641-localbus", "simple-bus"; >> reg = <0xf8005000 0x1000>; >> interrupts = <0x13 0x2>; >> interrupt-parent = <0x1>; >> ranges = <0x0 0x0 0xff00 0x100>; >> >> flash@0,0 { >> compatible = "cfi-flash"; >> reg = <0x0 0x0 0x80>; >> bank-width = <0x2>; >> device-width = <0x2>; >> #address-cells = <0x1>; >> #size-cells = <0x1>; >> }; >> }; >> >> soc8641@f800 { >> #address-cells = <0x1>; >> #size-cells = <0x1>; >> device_type = "soc"; >> compatible = "simple-bus"; >> ranges = <0x0 0xf800 0x10>; >> bus-frequency = <0x0>; >> >> mcm-law@0 { >> compatible = "fsl,mcm-law"; >> reg = <0x0 0x1000>; >> fsl,num-laws = <0xa>; >> }; >> >> mcm@1000 { >> compatible = "fsl,mpc8641-mcm", "fsl,mcm"; >> reg = <0x1000 0x1000>; >> interrupts = <0x11 0x2>; >> interrupt-parent = <0x1>; >> }; >> >> dma@21300 { >> #address-cells = <0x1>; >> #size-cells = <0x1>; >> compatible = "fsl,mpc8641-dma", "fsl,eloplus-dma"; >> reg = <0x21300 0x4>; >> ranges = <0x0 0x21100 0x200>; >> cell-index = <0x0>; >> >> dma-channel@0 { >> compatible = "fsl,mpc8641-dma-channel", >> "fsl,eloplus-dma-channel"; >> reg = <0x0 0x80>; >> cell-index = <0x0>; >> interrupt-parent = <0x1>; >> interrupts = <0x14 0x2>; >> }; >> >> dma-channel@80 { >> compatible = "fsl,mpc8641-dma-channel", >&
[PATCH] B4860qds/B4420qds: Updates to device trees for B4860 for DSP clusters and their L2 caches
B4860 has 1 PPC core cluster and 3 DSP core clusters. Similarly B4420 has 1 PPC core cluster and 1 DSP core cluster. Each DSP core cluster consists of 2 SC3900 cores and a shared L2 cache. 1. Add DSP clusters for B4420 2. Reorganized the L2 cache nodes such that they now appear in only the soc specific dtsi files(b4860si-post.dtsi and b4420si-post.dtsi). Earlier they were shown partly in common b4si-post.dtsi and si specific b4860si-post.dtsi files . Signed-off-by: Ashish Kumar Signed-off-by: Shaveta Leekha --- arch/powerpc/boot/dts/fsl/b4420si-post.dtsi |8 arch/powerpc/boot/dts/fsl/b4420si-pre.dtsi | 23 arch/powerpc/boot/dts/fsl/b4860si-post.dtsi | 18 + arch/powerpc/boot/dts/fsl/b4860si-pre.dtsi | 52 +++ arch/powerpc/boot/dts/fsl/b4si-post.dtsi|5 --- 5 files changed, 101 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/boot/dts/fsl/b4420si-post.dtsi b/arch/powerpc/boot/dts/fsl/b4420si-post.dtsi index 86161ae..c0fe250 100644 --- a/arch/powerpc/boot/dts/fsl/b4420si-post.dtsi +++ b/arch/powerpc/boot/dts/fsl/b4420si-post.dtsi @@ -102,5 +102,13 @@ L2: l2-cache-controller@c2 { compatible = "fsl,b4420-l2-cache-controller"; + reg = <0xc2 0x1000>; + next-level-cache = <&cpc>; + }; +/* Following is DSP L2 cache*/ + L2_2: l2-cache-controller@c6 { + compatible = "fsl,b4420-l2-cache-controller"; + reg = <0xc6 0x1000>; + next-level-cache = <&cpc>; }; }; diff --git a/arch/powerpc/boot/dts/fsl/b4420si-pre.dtsi b/arch/powerpc/boot/dts/fsl/b4420si-pre.dtsi index 338af7e..5fec4ea 100644 --- a/arch/powerpc/boot/dts/fsl/b4420si-pre.dtsi +++ b/arch/powerpc/boot/dts/fsl/b4420si-pre.dtsi @@ -76,4 +76,27 @@ fsl,portid-mapping = <0x8000>; }; }; + + dsp-clusters { + #address-cells = <1>; + #size-cells = <0>; + + dsp-cluster0 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "fsl,sc3900-cluster"; + reg = <0>; + + dsp0: dsp@0 { + compatible = "fsl,sc3900"; + reg = <0>; + next-level-cache = <&L2_2>; + }; + dsp1: dsp@1 { + compatible = "fsl,sc3900"; + reg = <1>; + next-level-cache = <&L2_2>; + }; + }; + }; }; diff --git a/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi b/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi index f35e9e0..19679d3 100644 --- a/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi +++ b/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi @@ -204,5 +204,23 @@ L2: l2-cache-controller@c2 { compatible = "fsl,b4860-l2-cache-controller"; + reg = <0xc2 0x1000>; + next-level-cache = <&cpc>; + }; +/* Following are DSP L2 cache */ + L2_2: l2-cache-controller@c6 { + compatible = "fsl,b4860-l2-cache-controller"; + reg = <0xc6 0x1000>; + next-level-cache = <&cpc>; + }; + L2_3: l2-cache-controller@ca { + compatible = "fsl,b4860-l2-cache-controller"; + reg = <0xca 0x1000>; + next-level-cache = <&cpc>; + }; + L2_4: l2-cache-controller@ce { + compatible = "fsl,b4860-l2-cache-controller"; + reg = <0xce 0x1000>; + next-level-cache = <&cpc>; }; }; diff --git a/arch/powerpc/boot/dts/fsl/b4860si-pre.dtsi b/arch/powerpc/boot/dts/fsl/b4860si-pre.dtsi index 1948f73..2e5dcb6 100644 --- a/arch/powerpc/boot/dts/fsl/b4860si-pre.dtsi +++ b/arch/powerpc/boot/dts/fsl/b4860si-pre.dtsi @@ -90,4 +90,56 @@ fsl,portid-mapping = <0x8000>; }; }; + dsp-clusters { + #address-cells = <1>; + #size-cells = <0>; + dsp-cluster0 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "fsl,sc3900-cluster"; + reg = <0>; + dsp0: dsp@0 { + compatible = "fsl,sc3900"; + reg = <0>; + next-level-ca
RE: [PATCH] B4860qds/B4420qds: Updates to device trees for B4860 for DSP clusters and their L2 caches
Please ignore this mail. Will send another revision. Regards Ashish -Original Message- From: Ashish Kumar [mailto:ashish.ku...@nxp.com] Sent: Thursday, January 28, 2016 1:23 PM To: Scott Wood ; linuxppc-dev@lists.ozlabs.org Cc: Ashish Kumar ; Shaveta Leekha Subject: [PATCH] B4860qds/B4420qds: Updates to device trees for B4860 for DSP clusters and their L2 caches B4860 has 1 PPC core cluster and 3 DSP core clusters. Similarly B4420 has 1 PPC core cluster and 1 DSP core cluster. Each DSP core cluster consists of 2 SC3900 cores and a shared L2 cache. 1. Add DSP clusters for B4420 2. Reorganized the L2 cache nodes such that they now appear in only the soc specific dtsi files(b4860si-post.dtsi and b4420si-post.dtsi). Earlier they were shown partly in common b4si-post.dtsi and si specific b4860si-post.dtsi files . Signed-off-by: Ashish Kumar Signed-off-by: Shaveta Leekha --- arch/powerpc/boot/dts/fsl/b4420si-post.dtsi |8 arch/powerpc/boot/dts/fsl/b4420si-pre.dtsi | 23 arch/powerpc/boot/dts/fsl/b4860si-post.dtsi | 18 + arch/powerpc/boot/dts/fsl/b4860si-pre.dtsi | 52 +++ arch/powerpc/boot/dts/fsl/b4si-post.dtsi|5 --- 5 files changed, 101 insertions(+), 5 deletions(-) diff --git a/arch/powerpc/boot/dts/fsl/b4420si-post.dtsi b/arch/powerpc/boot/dts/fsl/b4420si-post.dtsi index 86161ae..c0fe250 100644 --- a/arch/powerpc/boot/dts/fsl/b4420si-post.dtsi +++ b/arch/powerpc/boot/dts/fsl/b4420si-post.dtsi @@ -102,5 +102,13 @@ L2: l2-cache-controller@c2 { compatible = "fsl,b4420-l2-cache-controller"; + reg = <0xc2 0x1000>; + next-level-cache = <&cpc>; + }; +/* Following is DSP L2 cache*/ + L2_2: l2-cache-controller@c6 { + compatible = "fsl,b4420-l2-cache-controller"; + reg = <0xc6 0x1000>; + next-level-cache = <&cpc>; }; }; diff --git a/arch/powerpc/boot/dts/fsl/b4420si-pre.dtsi b/arch/powerpc/boot/dts/fsl/b4420si-pre.dtsi index 338af7e..5fec4ea 100644 --- a/arch/powerpc/boot/dts/fsl/b4420si-pre.dtsi +++ b/arch/powerpc/boot/dts/fsl/b4420si-pre.dtsi @@ -76,4 +76,27 @@ fsl,portid-mapping = <0x8000>; }; }; + + dsp-clusters { + #address-cells = <1>; + #size-cells = <0>; + + dsp-cluster0 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "fsl,sc3900-cluster"; + reg = <0>; + + dsp0: dsp@0 { + compatible = "fsl,sc3900"; + reg = <0>; + next-level-cache = <&L2_2>; + }; + dsp1: dsp@1 { + compatible = "fsl,sc3900"; + reg = <1>; + next-level-cache = <&L2_2>; + }; + }; + }; }; diff --git a/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi b/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi index f35e9e0..19679d3 100644 --- a/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi +++ b/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi @@ -204,5 +204,23 @@ L2: l2-cache-controller@c2 { compatible = "fsl,b4860-l2-cache-controller"; + reg = <0xc2 0x1000>; + next-level-cache = <&cpc>; + }; +/* Following are DSP L2 cache */ + L2_2: l2-cache-controller@c6 { + compatible = "fsl,b4860-l2-cache-controller"; + reg = <0xc6 0x1000>; + next-level-cache = <&cpc>; + }; + L2_3: l2-cache-controller@ca { + compatible = "fsl,b4860-l2-cache-controller"; + reg = <0xca 0x1000>; + next-level-cache = <&cpc>; + }; + L2_4: l2-cache-controller@ce { + compatible = "fsl,b4860-l2-cache-controller"; + reg = <0xce 0x1000>; + next-level-cache = <&cpc>; }; }; diff --git a/arch/powerpc/boot/dts/fsl/b4860si-pre.dtsi b/arch/powerpc/boot/dts/fsl/b4860si-pre.dtsi index 1948f73..2e5dcb6 100644 --- a/arch/powerpc/boot/dts/fsl/b4860si-pre.dtsi +++ b/arch/powerpc/boot/dts/fsl/b4860si-pre.dtsi @@ -90,4 +90,56 @@ fsl,portid-mapping = <0x8000>; }; }; + dsp-clusters { + #address-cells = <1>; + #size-cells = <0>; + dsp-cluster0 { + #address-cells = <1&g
[PATCH] arch/PPC:B4860qds/B4420qds: Updates to device trees for B4860 for DSP clusters and their L2 caches
B4860 has 1 PPC core cluster and 3 DSP core clusters. Similarly B4420 has 1 PPC core cluster and 1 DSP core cluster. Each DSP core cluster consists of 2 SC3900 cores and a shared L2 cache. Add DSP clusters for B4420 The L2 cache nodes such that they now appear in only the soc specific dtsi files(b4860si-post.dtsi and b4420si-post.dtsi). Signed-off-by: Ashish Kumar Signed-off-by: Shaveta Leekha --- arch/powerpc/boot/dts/fsl/b4420si-post.dtsi |7 +++- arch/powerpc/boot/dts/fsl/b4420si-pre.dtsi | 23 arch/powerpc/boot/dts/fsl/b4860si-post.dtsi | 20 ++- arch/powerpc/boot/dts/fsl/b4860si-pre.dtsi | 52 +++ 4 files changed, 100 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/boot/dts/fsl/b4420si-post.dtsi b/arch/powerpc/boot/dts/fsl/b4420si-post.dtsi index f996cce..cc70adb 100644 --- a/arch/powerpc/boot/dts/fsl/b4420si-post.dtsi +++ b/arch/powerpc/boot/dts/fsl/b4420si-post.dtsi @@ -91,7 +91,12 @@ L2_1: l2-cache-controller@c2 { compatible = "fsl,b4420-l2-cache-controller"; - reg = <0xc2 0x4>; + reg = <0xc2 0x1000>; + next-level-cache = <&cpc>; + }; + L2_2: l2-cache-controller@c6 { + compatible = "fsl,b4420-l2-cache-controller"; + reg = <0xc6 0x1000>; next-level-cache = <&cpc>; }; }; diff --git a/arch/powerpc/boot/dts/fsl/b4420si-pre.dtsi b/arch/powerpc/boot/dts/fsl/b4420si-pre.dtsi index bc3bf93..87c2712 100644 --- a/arch/powerpc/boot/dts/fsl/b4420si-pre.dtsi +++ b/arch/powerpc/boot/dts/fsl/b4420si-pre.dtsi @@ -81,4 +81,27 @@ fsl,portid-mapping = <0x8000>; }; }; + + dsp-clusters { + #address-cells = <1>; + #size-cells = <0>; + + dsp-cluster0 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "fsl,sc3900-cluster"; + reg = <0>; + + dsp0: dsp@0 { + compatible = "fsl,sc3900"; + reg = <0>; + next-level-cache = <&L2_2>; + }; + dsp1: dsp@1 { + compatible = "fsl,sc3900"; + reg = <1>; + next-level-cache = <&L2_2>; + }; + }; + }; }; diff --git a/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi b/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi index 8687198..833d483 100644 --- a/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi +++ b/arch/powerpc/boot/dts/fsl/b4860si-post.dtsi @@ -278,7 +278,25 @@ L2_1: l2-cache-controller@c2 { compatible = "fsl,b4860-l2-cache-controller"; - reg = <0xc2 0x4>; + reg = <0xc2 0x1000>; + next-level-cache = <&cpc>; + }; + + L2_2: l2-cache-controller@c6 { + compatible = "fsl,b4860-l2-cache-controller"; + reg = <0xc6 0x1000>; + next-level-cache = <&cpc>; + }; + + L2_3: l2-cache-controller@ca { + compatible = "fsl,b4860-l2-cache-controller"; + reg = <0xca 0x1000>; + next-level-cache = <&cpc>; + }; + + L2_4: l2-cache-controller@ce { + compatible = "fsl,b4860-l2-cache-controller"; + reg = <0xce 0x1000>; next-level-cache = <&cpc>; }; }; diff --git a/arch/powerpc/boot/dts/fsl/b4860si-pre.dtsi b/arch/powerpc/boot/dts/fsl/b4860si-pre.dtsi index 8797ce1..a45800d 100644 --- a/arch/powerpc/boot/dts/fsl/b4860si-pre.dtsi +++ b/arch/powerpc/boot/dts/fsl/b4860si-pre.dtsi @@ -100,4 +100,56 @@ fsl,portid-mapping = <0x8000>; }; }; + dsp-clusters { + #address-cells = <1>; + #size-cells = <0>; + dsp-cluster0 { + #address-cells = <1>; + #size-cells = <0>; + compatible = "fsl,sc3900-cluster"; + reg = <0>; + dsp0: dsp@0 { + compatible = "fsl,sc3900"; + reg = <0>; + next-level-cache = <&L2_2>; + }; + dsp1: dsp@1 { + compatible = &
[PATCH] sata_fsl: Add asynchronous notification support
Signed-off-by: Ashish Kalra --- drivers/ata/sata_fsl.c | 10 -- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/ata/sata_fsl.c b/drivers/ata/sata_fsl.c index 94eaa43..5751145 100644 --- a/drivers/ata/sata_fsl.c +++ b/drivers/ata/sata_fsl.c @@ -34,7 +34,7 @@ enum { SATA_FSL_HOST_FLAGS = (ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA | - ATA_FLAG_PMP | ATA_FLAG_NCQ), + ATA_FLAG_PMP | ATA_FLAG_NCQ | ATA_FLAG_AN), SATA_FSL_MAX_CMDS = SATA_FSL_QUEUE_DEPTH, SATA_FSL_CMD_HDR_SIZE = 16, /* 4 DWORDS */ @@ -132,7 +132,7 @@ enum { INT_ON_SINGL_DEVICE_ERR = (1 << 1), INT_ON_CMD_COMPLETE = 1, - INT_ON_ERROR = INT_ON_FATAL_ERR | + INT_ON_ERROR = INT_ON_FATAL_ERR | INT_ON_SNOTIFY_UPDATE | INT_ON_PHYRDY_CHG | INT_ON_SINGL_DEVICE_ERR, /* @@ -154,6 +154,7 @@ enum { DEFAULT_PORT_IRQ_ENABLE_MASK = IE_ON_FATAL_ERR | IE_ON_PHYRDY_CHG | IE_ON_SIGNATURE_UPDATE | + IE_ON_SNOTIFY_UPDATE | IE_ON_SINGL_DEVICE_ERR | IE_ON_CMD_COMPLETE, EXT_INDIRECT_SEG_PRD_FLAG = (1 << 31), @@ -1003,6 +1004,11 @@ static void sata_fsl_error_intr(struct ata_port *ap) freeze = 1; } + /* Handle SDB FIS receive & notify update */ + if (hstatus & INT_ON_SNOTIFY_UPDATE) { + sata_async_notification(ap); + } + /* Handle PHYRDY change notification */ if (hstatus & INT_ON_PHYRDY_CHG) { DPRINTK("SATA FSL: PHYRDY change indication\n"); -- 1.6.0 ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[RESEND][PATCH] sata_fsl: hard and soft reset split
Split sata_fsl_softreset() into hard and soft resets to make error-handling more efficient & device and PMP detection more reliable. Also includes fix for PMP support, driver tested with Sil3726, Sil4726 & Exar PMP controllers. Signed-off-by: Ashish Kalra --- drivers/ata/sata_fsl.c | 85 +--- 1 files changed, 44 insertions(+), 41 deletions(-) diff --git a/drivers/ata/sata_fsl.c b/drivers/ata/sata_fsl.c index 5751145..c8e2fad 100644 --- a/drivers/ata/sata_fsl.c +++ b/drivers/ata/sata_fsl.c @@ -708,34 +708,17 @@ static unsigned int sata_fsl_dev_classify(struct ata_port *ap) return ata_dev_classify(&tf); } -static int sata_fsl_prereset(struct ata_link *link, unsigned long deadline) -{ - /* FIXME: Never skip softreset, sata_fsl_softreset() is -* combination of soft and hard resets. sata_fsl_softreset() -* needs to be splitted into soft and hard resets. -*/ - return 0; -} - -static int sata_fsl_softreset(struct ata_link *link, unsigned int *class, +static int sata_fsl_hardreset(struct ata_link *link, unsigned int *class, unsigned long deadline) { struct ata_port *ap = link->ap; - struct sata_fsl_port_priv *pp = ap->private_data; struct sata_fsl_host_priv *host_priv = ap->host->private_data; void __iomem *hcr_base = host_priv->hcr_base; - int pmp = sata_srst_pmp(link); u32 temp; - struct ata_taskfile tf; - u8 *cfis; - u32 Serror; int i = 0; unsigned long start_jiffies; - DPRINTK("in xx_softreset\n"); - - if (pmp != SATA_PMP_CTRL_PORT) - goto issue_srst; + DPRINTK("in xx_hardreset\n"); try_offline_again: /* @@ -750,7 +733,7 @@ try_offline_again: if (temp & ONLINE) { ata_port_printk(ap, KERN_ERR, - "Softreset failed, not off-lined %d\n", i); + "Hardreset failed, not off-lined %d\n", i); /* * Try to offline controller atleast twice @@ -762,7 +745,7 @@ try_offline_again: goto try_offline_again; } - DPRINTK("softreset, controller off-lined\n"); + DPRINTK("hardreset, controller off-lined\n"); VPRINTK("HStatus = 0x%x\n", ioread32(hcr_base + HSTATUS)); VPRINTK("HControl = 0x%x\n", ioread32(hcr_base + HCONTROL)); @@ -787,11 +770,11 @@ try_offline_again: if (!(temp & ONLINE)) { ata_port_printk(ap, KERN_ERR, - "Softreset failed, not on-lined\n"); + "Hardreset failed, not on-lined\n"); goto err; } - DPRINTK("softreset, controller off-lined & on-lined\n"); + DPRINTK("hardreset, controller off-lined & on-lined\n"); VPRINTK("HStatus = 0x%x\n", ioread32(hcr_base + HSTATUS)); VPRINTK("HControl = 0x%x\n", ioread32(hcr_base + HCONTROL)); @@ -807,7 +790,7 @@ try_offline_again: "No Device OR PHYRDY change,Hstatus = 0x%x\n", ioread32(hcr_base + HSTATUS)); *class = ATA_DEV_NONE; - goto out; + return 0; } /* @@ -820,11 +803,44 @@ try_offline_again: if ((temp & 0xFF) != 0x18) { ata_port_printk(ap, KERN_WARNING, "No Signature Update\n"); *class = ATA_DEV_NONE; - goto out; + goto do_followup_srst; } else { ata_port_printk(ap, KERN_INFO, "Signature Update detected @ %d msecs\n", jiffies_to_msecs(jiffies - start_jiffies)); + *class = sata_fsl_dev_classify(ap); + return 0; + } + +do_followup_srst: + /* +* request libATA to perform follow-up softreset +*/ + return -EAGAIN; + +err: + return -EIO; +} + +static int sata_fsl_softreset(struct ata_link *link, unsigned int *class, + unsigned long deadline) +{ + struct ata_port *ap = link->ap; + struct sata_fsl_port_priv *pp = ap->private_data; + struct sata_fsl_host_priv *host_priv = ap->host->private_data; + void __iomem *hcr_base = host_priv->hcr_base; + int pmp = sata_srst_pmp(link); + u32 temp; + struct ata_taskfile tf; + u8 *cfis; + u32 Serror; + + DPRINTK("in xx_softreset\n"); + + if (ata_link_offline(link)) { + DPRINTK("PHY reports no device\n"); + *class = ATA_DEV_NONE; + return 0;
[no subject]
From: Ashish Kalra Date: Fri, 26 Jun 2009 15:46:02 +0530 Subject: [PATCH][v2] sata_fsl: Add asynchronous notification support Enable device hot-plug support on Port multiplier fan-out ports Signed-off-by: Ashish Kalra --- drivers/ata/sata_fsl.c | 10 -- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/ata/sata_fsl.c b/drivers/ata/sata_fsl.c index 94eaa43..5751145 100644 --- a/drivers/ata/sata_fsl.c +++ b/drivers/ata/sata_fsl.c @@ -34,7 +34,7 @@ enum { SATA_FSL_HOST_FLAGS = (ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA | - ATA_FLAG_PMP | ATA_FLAG_NCQ), + ATA_FLAG_PMP | ATA_FLAG_NCQ | ATA_FLAG_AN), SATA_FSL_MAX_CMDS = SATA_FSL_QUEUE_DEPTH, SATA_FSL_CMD_HDR_SIZE = 16, /* 4 DWORDS */ @@ -132,7 +132,7 @@ enum { INT_ON_SINGL_DEVICE_ERR = (1 << 1), INT_ON_CMD_COMPLETE = 1, - INT_ON_ERROR = INT_ON_FATAL_ERR | + INT_ON_ERROR = INT_ON_FATAL_ERR | INT_ON_SNOTIFY_UPDATE | INT_ON_PHYRDY_CHG | INT_ON_SINGL_DEVICE_ERR, /* @@ -154,6 +154,7 @@ enum { DEFAULT_PORT_IRQ_ENABLE_MASK = IE_ON_FATAL_ERR | IE_ON_PHYRDY_CHG | IE_ON_SIGNATURE_UPDATE | + IE_ON_SNOTIFY_UPDATE | IE_ON_SINGL_DEVICE_ERR | IE_ON_CMD_COMPLETE, EXT_INDIRECT_SEG_PRD_FLAG = (1 << 31), @@ -1003,6 +1004,11 @@ static void sata_fsl_error_intr(struct ata_port *ap) freeze = 1; } + /* Handle SDB FIS receive & notify update */ + if (hstatus & INT_ON_SNOTIFY_UPDATE) { + sata_async_notification(ap); + } + /* Handle PHYRDY change notification */ if (hstatus & INT_ON_PHYRDY_CHG) { DPRINTK("SATA FSL: PHYRDY change indication\n"); -- 1.6.0 ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH][v2] sata_fsl: Add asynchronous notification support
Enable device hot-plug support on Port multiplier fan-out ports Signed-off-by: Ashish Kalra --- drivers/ata/sata_fsl.c | 10 -- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/ata/sata_fsl.c b/drivers/ata/sata_fsl.c index 94eaa43..5751145 100644 --- a/drivers/ata/sata_fsl.c +++ b/drivers/ata/sata_fsl.c @@ -34,7 +34,7 @@ enum { SATA_FSL_HOST_FLAGS = (ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA | - ATA_FLAG_PMP | ATA_FLAG_NCQ), + ATA_FLAG_PMP | ATA_FLAG_NCQ | ATA_FLAG_AN), SATA_FSL_MAX_CMDS = SATA_FSL_QUEUE_DEPTH, SATA_FSL_CMD_HDR_SIZE = 16, /* 4 DWORDS */ @@ -132,7 +132,7 @@ enum { INT_ON_SINGL_DEVICE_ERR = (1 << 1), INT_ON_CMD_COMPLETE = 1, - INT_ON_ERROR = INT_ON_FATAL_ERR | + INT_ON_ERROR = INT_ON_FATAL_ERR | INT_ON_SNOTIFY_UPDATE | INT_ON_PHYRDY_CHG | INT_ON_SINGL_DEVICE_ERR, /* @@ -154,6 +154,7 @@ enum { DEFAULT_PORT_IRQ_ENABLE_MASK = IE_ON_FATAL_ERR | IE_ON_PHYRDY_CHG | IE_ON_SIGNATURE_UPDATE | + IE_ON_SNOTIFY_UPDATE | IE_ON_SINGL_DEVICE_ERR | IE_ON_CMD_COMPLETE, EXT_INDIRECT_SEG_PRD_FLAG = (1 << 31), @@ -1003,6 +1004,11 @@ static void sata_fsl_error_intr(struct ata_port *ap) freeze = 1; } + /* Handle SDB FIS receive & notify update */ + if (hstatus & INT_ON_SNOTIFY_UPDATE) { + sata_async_notification(ap); + } + /* Handle PHYRDY change notification */ if (hstatus & INT_ON_PHYRDY_CHG) { DPRINTK("SATA FSL: PHYRDY change indication\n"); -- 1.6.0 ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH][v3] Add asynchronous notification support
Enable device hot-plug support on Port multiplier fan-out ports v3 fixes whitespace/identation issues Signed-off-by: Ashish Kalra --- drivers/ata/sata_fsl.c | 15 ++- 1 files changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/ata/sata_fsl.c b/drivers/ata/sata_fsl.c index 94eaa43..5a88b44 100644 --- a/drivers/ata/sata_fsl.c +++ b/drivers/ata/sata_fsl.c @@ -34,7 +34,7 @@ enum { SATA_FSL_HOST_FLAGS = (ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA | - ATA_FLAG_PMP | ATA_FLAG_NCQ), + ATA_FLAG_PMP | ATA_FLAG_NCQ | ATA_FLAG_AN), SATA_FSL_MAX_CMDS = SATA_FSL_QUEUE_DEPTH, SATA_FSL_CMD_HDR_SIZE = 16, /* 4 DWORDS */ @@ -132,8 +132,8 @@ enum { INT_ON_SINGL_DEVICE_ERR = (1 << 1), INT_ON_CMD_COMPLETE = 1, - INT_ON_ERROR = INT_ON_FATAL_ERR | - INT_ON_PHYRDY_CHG | INT_ON_SINGL_DEVICE_ERR, + INT_ON_ERROR = INT_ON_FATAL_ERR | INT_ON_SNOTIFY_UPDATE | + INT_ON_PHYRDY_CHG | INT_ON_SINGL_DEVICE_ERR, /* * Host Control Register (HControl) bitdefs @@ -153,8 +153,8 @@ enum { IE_ON_CMD_COMPLETE = 1, DEFAULT_PORT_IRQ_ENABLE_MASK = IE_ON_FATAL_ERR | IE_ON_PHYRDY_CHG | - IE_ON_SIGNATURE_UPDATE | - IE_ON_SINGL_DEVICE_ERR | IE_ON_CMD_COMPLETE, + IE_ON_SIGNATURE_UPDATE | IE_ON_SNOTIFY_UPDATE | + IE_ON_SINGL_DEVICE_ERR | IE_ON_CMD_COMPLETE, EXT_INDIRECT_SEG_PRD_FLAG = (1 << 31), DATA_SNOOP_ENABLE = (1 << 22), @@ -1003,6 +1003,11 @@ static void sata_fsl_error_intr(struct ata_port *ap) freeze = 1; } + /* Handle SDB FIS receive & notify update */ + if (hstatus & INT_ON_SNOTIFY_UPDATE) { + sata_async_notification(ap); + } + /* Handle PHYRDY change notification */ if (hstatus & INT_ON_PHYRDY_CHG) { DPRINTK("SATA FSL: PHYRDY change indication\n"); -- 1.6.0 ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH][sata_fsl] Defer non-ncq commands when ncq commands active
From: Ashish Kalra Date: Wed, 29 Jul 2009 21:15:49 +0530 Fix for non-ncq & ncq commands causing timeouts when both are issued simultaneously to the same device. Signed-off-by: Ashish Kalra --- drivers/ata/sata_fsl.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/ata/sata_fsl.c b/drivers/ata/sata_fsl.c index 5a88b44..a33f130 100644 --- a/drivers/ata/sata_fsl.c +++ b/drivers/ata/sata_fsl.c @@ -1262,6 +1262,7 @@ static struct scsi_host_template sata_fsl_sht = { static struct ata_port_operations sata_fsl_ops = { .inherits = &sata_pmp_port_ops, + .qc_defer = ata_std_qc_defer; .qc_prep = sata_fsl_qc_prep, .qc_issue = sata_fsl_qc_issue, .qc_fill_rtf = sata_fsl_qc_fill_rtf, -- 1.6.0 ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
RE: [PATCH] Add port multiplier (PMP) support in sata_fsl driver
Hello Tejun, Thanks for your review comments. Please find my answers below : >> Broke the sata_fsl.c driver in 2.6.26. I know the following patch >> fixes the issue, it clearly also adds port multipler support. I'm not >> sure if you are willing to take that as part of 2.6.26 or not, but the >> current >> 2.6.26 driver is broken. > Would it be possible to break the patch into two pieces? One to fix the problem and the other to add PMP support? Actually, the boot-time hang issue was caused due to my handling of command completion interrupt and detecting the queued commands being completed. I was not finding the correct "active" link and hence causing command completion interrupts not being ack'ed correctly and locking the machine as they remain pending forever. Now the fix I added works for both PMP and direct device attach cases, and is actually part of the PMP patch because I had changed command completion interrupt handling initially for PMP and addition of links in the libata core, and this initial change had introduced the bug which caused hangs in direct device attach cases. Therefore, this fix was added to my initial PMP patch. For the same reason, I would wish to keep this as a single patch. >> @@ -771,7 +803,8 @@ try_offline_again: >> ata_port_printk(ap, KERN_WARNING, >> "No Device OR PHYRDY change,Hstatus = 0x%x\n", >> ioread32(hcr_base + HSTATUS)); >> -goto err; >> +*class = ATA_DEV_NONE; >> +goto out; >> } >> >> /* >> @@ -783,7 +816,8 @@ try_offline_again: >> >> if ((temp & 0xFF) != 0x18) { >> ata_port_printk(ap, KERN_WARNING, "No Signature Update\n"); >> -goto err; >> +*class = ATA_DEV_NONE; >> +goto out; > Is setting class to ATA_DEV_NONE necessary? What happens if you drop the above two chunks? > Also, it looks to me that currently sata_fsl_softreset() does both hard and soft resets. Is it possible to split it into sata_fsl_hardreset() and softreset()? >> /* >> - * We should consider this as non fatal error, and TF must >> - * be updated as done below. >> + * Ignore serror in case of fatal errors as we always want >> + * to do a soft-reset of the FSL SATA controller. Analyzing >> + * serror may cause libata to schedule a hard-reset action, >> + * and hard-reset currently does not do controller >> + * offline/online, causing command timeouts and leads to an >> + * un-recoverable state, hence make libATA ignore >> + * autopsy in case of fatal errors. >> */ >> >> -err_mask |= AC_ERR_DEV; >> -} >> +ehi->flags |= ATA_EHI_NO_AUTOPSY; > This is really fishy. NO_AUTOPSY isn't for stuff like this and libata EH as of the current #usptream and #upstream-fixes default to hardreset, so it will hardreset no > matter what you do. > What do you mean by hardreset does'nt do controller offline/online? Is this PHY sequence in sata_fsl_softreset()? I think what should be done is... > * Separate out PHY diddling from sata_fsl_softreset() into sata_fsl_hardreset(). > * If sata_fsl_hardreset() alone doesn't leave the controller in usable state. Return -EAGAIN from it to request follow-up SRST on success. Both of the above cases ( ATA_DEV_NONE & NO_AUTOPSY ) are basically hacks because as you have mentioned, currently sata_fsl_softreset() does both PHY-reset and softreset handling. This split of sata_fsl_softreset() has been on my list of things to do for some time, and I will work on it next week and send you an updated patch for review. Thanks, Ashish ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Problem while make menuconfig
Hello When I do make menuconfig I get following error :- " *** Unable to find the ncurses libraries or the *** required header files. *** 'make menuconfig' requires the ncurses libraries. *** *** Install ncurses (ncurses-devel) and try again. *** make[1]: *** [scripts/kconfig/dochecklxdialog] Error 1 make: *** [menuconfig] Error 2 " How can I include the libraries. Thanks and Regards Ashish Dudeja Development Engineer, R&D Security & Monitoring Division Barco Electronics System Pvt. Ltd A 38 B & C. Sector 64, Noida *+91 (120) 4020261 Mobile: +91 9313594304 www.barco.com DISCLAIMER: Unless indicated otherwise, the information contained in this message is privileged and confidential, and is intended only for the use of the addressee(s) named above and others who have been specifically authorized to receive it. If you are not the intended recipient, you are hereby notified that any dissemination, distribution or copying of this message and/or attachments is strictly prohibited. The company accepts no liability for any damage caused by any virus transmitted by this email. Furthermore, the company does not warrant a proper and complete transmission of this information, nor does it accept liability for any delays. If you have received this message in error, please contact the sender and delete the message. Thank you. ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
RE: [RESEND][PATCH] sata_fsl: hard and soft reset split
Hello Jeff, I will do the rediff and resubmit the patch. Thanks, Ashish -Original Message- From: Jeff Garzik [mailto:j...@garzik.org] Sent: Friday, September 11, 2009 12:08 PM To: Kalra Ashish-B00888 Cc: linux-...@vger.kernel.org; linuxppc-...@ozlabs.org Subject: Re: [RESEND][PATCH] sata_fsl: hard and soft reset split On 06/29/2009 09:26 AM, ashish kalra wrote: > Split sata_fsl_softreset() into hard and soft resets to make > error-handling more efficient & device and PMP detection more reliable. > > Also includes fix for PMP support, driver tested with Sil3726, Sil4726 > & Exar PMP controllers. > > Signed-off-by: Ashish Kalra can you rediff this and 'AN' support against latest upstream? ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
[PATCH] sata_fsl: hard and soft reset split
Split sata_fsl_softreset() into hard and soft resets to make error-handling more efficient & device and PMP detection more reliable. Also includes fix for PMP support, driver tested with Sil3726, Sil4726 & Exar PMP controllers. Signed-off-by: Ashish Kalra --- drivers/ata/sata_fsl.c | 85 +--- 1 files changed, 44 insertions(+), 41 deletions(-) diff --git a/drivers/ata/sata_fsl.c b/drivers/ata/sata_fsl.c index 5751145..c8e2fad 100644 --- a/drivers/ata/sata_fsl.c +++ b/drivers/ata/sata_fsl.c @@ -708,34 +708,17 @@ static unsigned int sata_fsl_dev_classify(struct ata_port *ap) return ata_dev_classify(&tf); } -static int sata_fsl_prereset(struct ata_link *link, unsigned long deadline) -{ - /* FIXME: Never skip softreset, sata_fsl_softreset() is -* combination of soft and hard resets. sata_fsl_softreset() -* needs to be splitted into soft and hard resets. -*/ - return 0; -} - -static int sata_fsl_softreset(struct ata_link *link, unsigned int *class, +static int sata_fsl_hardreset(struct ata_link *link, unsigned int *class, unsigned long deadline) { struct ata_port *ap = link->ap; - struct sata_fsl_port_priv *pp = ap->private_data; struct sata_fsl_host_priv *host_priv = ap->host->private_data; void __iomem *hcr_base = host_priv->hcr_base; - int pmp = sata_srst_pmp(link); u32 temp; - struct ata_taskfile tf; - u8 *cfis; - u32 Serror; int i = 0; unsigned long start_jiffies; - DPRINTK("in xx_softreset\n"); - - if (pmp != SATA_PMP_CTRL_PORT) - goto issue_srst; + DPRINTK("in xx_hardreset\n"); try_offline_again: /* @@ -750,7 +733,7 @@ try_offline_again: if (temp & ONLINE) { ata_port_printk(ap, KERN_ERR, - "Softreset failed, not off-lined %d\n", i); + "Hardreset failed, not off-lined %d\n", i); /* * Try to offline controller atleast twice @@ -762,7 +745,7 @@ try_offline_again: goto try_offline_again; } - DPRINTK("softreset, controller off-lined\n"); + DPRINTK("hardreset, controller off-lined\n"); VPRINTK("HStatus = 0x%x\n", ioread32(hcr_base + HSTATUS)); VPRINTK("HControl = 0x%x\n", ioread32(hcr_base + HCONTROL)); @@ -787,11 +770,11 @@ try_offline_again: if (!(temp & ONLINE)) { ata_port_printk(ap, KERN_ERR, - "Softreset failed, not on-lined\n"); + "Hardreset failed, not on-lined\n"); goto err; } - DPRINTK("softreset, controller off-lined & on-lined\n"); + DPRINTK("hardreset, controller off-lined & on-lined\n"); VPRINTK("HStatus = 0x%x\n", ioread32(hcr_base + HSTATUS)); VPRINTK("HControl = 0x%x\n", ioread32(hcr_base + HCONTROL)); @@ -807,7 +790,7 @@ try_offline_again: "No Device OR PHYRDY change,Hstatus = 0x%x\n", ioread32(hcr_base + HSTATUS)); *class = ATA_DEV_NONE; - goto out; + return 0; } /* @@ -820,11 +803,44 @@ try_offline_again: if ((temp & 0xFF) != 0x18) { ata_port_printk(ap, KERN_WARNING, "No Signature Update\n"); *class = ATA_DEV_NONE; - goto out; + goto do_followup_srst; } else { ata_port_printk(ap, KERN_INFO, "Signature Update detected @ %d msecs\n", jiffies_to_msecs(jiffies - start_jiffies)); + *class = sata_fsl_dev_classify(ap); + return 0; + } + +do_followup_srst: + /* +* request libATA to perform follow-up softreset +*/ + return -EAGAIN; + +err: + return -EIO; +} + +static int sata_fsl_softreset(struct ata_link *link, unsigned int *class, + unsigned long deadline) +{ + struct ata_port *ap = link->ap; + struct sata_fsl_port_priv *pp = ap->private_data; + struct sata_fsl_host_priv *host_priv = ap->host->private_data; + void __iomem *hcr_base = host_priv->hcr_base; + int pmp = sata_srst_pmp(link); + u32 temp; + struct ata_taskfile tf; + u8 *cfis; + u32 Serror; + + DPRINTK("in xx_softreset\n"); + + if (ata_link_offline(link)) { + DPRINTK("PHY reports no device\n"); + *class = ATA_DEV_NONE; + re
RE: [PATCH][v2] sata_fsl: Add asynchronous notification support
Hello Sergei, It looks like that the email client has added these whitespaces and alignment mess-up, as the original patch file has none of these issues. I will try using another email client and re-post the patch. Thanks, Ashish -Original Message- From: Sergei Shtylyov [mailto:sshtyl...@ru.mvista.com] Sent: Wednesday, July 01, 2009 1:56 PM To: Kalra Ashish-B00888 Cc: linux-...@vger.kernel.org; linuxppc-...@ozlabs.org Subject: Re: [PATCH][v2] sata_fsl: Add asynchronous notification support Hello. ashish kalra wrote: > Enable device hot-plug support on Port multiplier fan-out ports > > Signed-off-by: Ashish Kalra [...] > diff --git a/drivers/ata/sata_fsl.c b/drivers/ata/sata_fsl.c index > 94eaa43..5751145 100644 > --- a/drivers/ata/sata_fsl.c > +++ b/drivers/ata/sata_fsl.c > @@ -34,7 +34,7 @@ enum { > > SATA_FSL_HOST_FLAGS= (ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | > ATA_FLAG_MMIO | ATA_FLAG_PIO_DMA | > -ATA_FLAG_PMP | ATA_FLAG_NCQ), > + ATA_FLAG_PMP | ATA_FLAG_NCQ | ATA_FLAG_AN), Why are you breaking the alignment? There's alos trailing whitespace here... > @@ -132,7 +132,7 @@ enum { > INT_ON_SINGL_DEVICE_ERR = (1 << 1), > INT_ON_CMD_COMPLETE = 1, > > -INT_ON_ERROR = INT_ON_FATAL_ERR | > +INT_ON_ERROR = INT_ON_FATAL_ERR | INT_ON_SNOTIFY_UPDATE | Trailing whitespace. > @@ -154,6 +154,7 @@ enum { > > DEFAULT_PORT_IRQ_ENABLE_MASK = IE_ON_FATAL_ERR | IE_ON_PHYRDY_CHG | > IE_ON_SIGNATURE_UPDATE | > +IE_ON_SNOTIFY_UPDATE | Again. > IE_ON_SINGL_DEVICE_ERR | IE_ON_CMD_COMPLETE, > > EXT_INDIRECT_SEG_PRD_FLAG = (1 << 31), @@ -1003,6 +1004,11 @@ > static void sata_fsl_error_intr(struct ata_port > *ap) > freeze = 1; > } > > +/* Handle SDB FIS receive & notify update */ > +if (hstatus & INT_ON_SNOTIFY_UPDATE) { > +sata_async_notification(ap); > +} And again -- on every line. MBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
RE: [PATCH][sata_fsl] Defer non-ncq commands when ncq commands active
Hello, >> Signed-off-by: Ashish Kalra >> --- >> drivers/ata/sata_fsl.c | 1 + >> 1 files changed, 1 insertions(+), 0 deletions(-) >> >> diff --git a/drivers/ata/sata_fsl.c b/drivers/ata/sata_fsl.c >> index 5a88b44..a33f130 100644 >> --- a/drivers/ata/sata_fsl.c >> +++ b/drivers/ata/sata_fsl.c >> @@ -1262,6 +1262,7 @@ static struct scsi_host_template sata_fsl_sht = { >> static struct ata_port_operations sata_fsl_ops = { >> .inherits = &sata_pmp_port_ops, >> >> + .qc_defer = ata_std_qc_defer; >> .qc_prep = sata_fsl_qc_prep, >> .qc_issue = sata_fsl_qc_issue, >> .qc_fill_rtf = sata_fsl_qc_fill_rtf, > This doesn't look like it should change anything. sata_fsl_ops inherits > from sata_pmp_port_ops, which inherits from sata_port_ops, which already > sets qc_defer to ata_std_qc_defer. Oh, yes. Actually this patch was for older kernels where there inheritence was not there. As you mentioned, this patch is not required now. Thanks, Ashish ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
RE: [PATCH][sata_fsl] Defer non-ncq commands when ncq commands active
Hello Kumar, >> > This doesn't look like it should change anything. sata_fsl_ops >> inherits >> > from sata_pmp_port_ops, which inherits from sata_port_ops, which >> already >> > sets qc_defer to ata_std_qc_defer. >> Oh, yes. Actually this patch was for older kernels where there >> inheritence was not there. As you mentioned, this patch is not >> required now. >> >How old? Should we be asking for this to be applied to some of the >stable kernel series? I believe that the inheritence stuff was added in 2.6.26, thus, this patch is required for quite old kernels ( < 2.6.26 ). Thanks, Ashish ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
RE: [PATCH v2] drivers/ata: add support to Freescale 3.0Gbps SATA Controller
This should be fine, as cd->sfis is allocated in host memory using a _coherent allocator and the SATA-2 controller is DMA'ing the D2H FIS into it. Ashish -Original Message- From: Alan Cox [mailto:[EMAIL PROTECTED] Sent: Friday, October 12, 2007 7:25 PM To: Li Yang-r58472 Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]; linuxppc-dev@ozlabs.org; Kalra Ashish-B00888; Li Yang-r58472 Subject: Re: [PATCH v2] drivers/ata: add support to Freescale 3.0Gbps SATA Controller > + cd = pp->cmdentry + tag; > + > + memcpy(fis, &cd->sfis, 6 * 4); /* should we use memcpy_from_io() */ If cd->sfis points at memory over the PCI bus (eg mmio or memory on the controller card) then you need to use ioread/_io type functions. If cd->sfis points into host memory where the FIS is delivered by DMA from the card you will be fine if it was allocated with an _coherent allocator Alan ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
RE: [PATCH v2] drivers/ata: add support to Freescale 3.0Gbps SATA Controller
Hello Arnd, Thanks for your comments and feedback. Actually, for PowerPC platforms iowrite32/ioread32 internally call writel/readl, which are again mapped to out_le32/in_le32, therefore we will modify our code to use of_iomap() to combine functionalities of both of_address_to_resource() & ioremap(). We will also incorporate your other suggestions and then resubmit the patch. Ashish -Original Message- From: Arnd Bergmann [mailto:[EMAIL PROTECTED] Sent: Friday, October 12, 2007 7:52 PM To: linuxppc-dev@ozlabs.org Cc: Li Yang-r58472; [EMAIL PROTECTED]; [EMAIL PROTECTED]; Kalra Ashish-B00888 Subject: Re: [PATCH v2] drivers/ata: add support to Freescale 3.0Gbps SATA Controller On Friday 12 October 2007, Li Yang wrote: > This patch adds support for Freescale 3.0Gbps SATA Controller > supporting Native Command Queueing(NCQ), device hotplug, and ATAPI. > This controller can be found on MPC8315 and MPC8378. Most of the driver looks really good, but here are a few things that stick out: > +static int sata_fsl_probe(struct of_device *ofdev, > + const struct of_device_id *match) > +{ > + int retval = 0; > + void __iomem *hcr_base = NULL; > + void __iomem *ssr_base = NULL; > + void __iomem *csr_base = NULL; > + struct sata_fsl_host_priv *host_priv = NULL; > + struct resource *r; > + int irq; > + struct ata_host *host; > + > + struct ata_port_info pi = sata_fsl_port_info[0]; > + const struct ata_port_info *ppi[] = { &pi, NULL }; > + > + dev_printk(KERN_INFO, &ofdev->dev, > +"Sata FSL Platform/CSB Driver init\n"); > + > + r = kmalloc(sizeof(struct resource), GFP_KERNEL); > + retval = of_address_to_resource(ofdev->node, 0, r); > + if (retval) > + return -EINVAL; > + > + DPRINTK("start i/o @0x%x\n", r->start); > + > + hcr_base = ioremap(r->start, r->end - r->start + 1); > + if (!hcr_base) > + goto error_exit_with_cleanup; Hmm, I think we should redefine of_iomap to do the right thing for you. currently, it is the combination of of_address_to_resource and ioremap, which you do as well, so your code can be simplified to do that. However, ioremap is meant to be used with readl/writel or in_le32/out_le32 and similar functions, not with ioread32/iowrite32 which you are using. I had planned to do a patch to get that right for some time so you can use of_iomap with ioread in all cases, but I guess you should start using of_iomap even now. > + > +error_exit_with_cleanup: > + > + if (hcr_base) > + iounmap(hcr_base); > + if (host_priv) > + kfree(host_priv); > + > + return retval; > +} Once of_iomap start using devres, we would no longer need to iounmap here. > +static int sata_fsl_remove(struct of_device *ofdev) { > + struct ata_host *host = dev_get_drvdata(&ofdev->dev); > + struct sata_fsl_host_priv *host_priv = host->private_data; > + > + dev_set_drvdata(&ofdev->dev, NULL); > + > + iounmap(host_priv->hcr_base); > + kfree(host_priv); > + > + return 0; > +} Should you also free the irq mapping here? > --- /dev/null > +++ b/drivers/ata/sata_fsl.h > @@ -0,0 +1,92 @@ > +/* > + * drivers/ata/sata_fsl.h > + * > + * Freescale 3.0Gbps SATA device driver The header file is entirely pointless, since all definitions in here are only used in a single file. Please merge the header into the implementation. > +static int sata_fsl_probe(struct of_device *ofdev, > + const struct of_device_id *match); static int > +sata_fsl_remove(struct of_device *ofdev); static int > +sata_fsl_scr_read(struct ata_port *, unsigned int, u32 *); static int > +sata_fsl_scr_write(struct ata_port *, unsigned int, u32); static > +unsigned int sata_fsl_qc_issue(struct ata_queued_cmd *); static > +irqreturn_t sata_fsl_interrupt(int, void *); static void > +sata_fsl_irq_clear(struct ata_port *); static int > +sata_fsl_port_start(struct ata_port *); static void > +sata_fsl_port_stop(struct ata_port *); static void > +sata_fsl_tf_read(struct ata_port *, struct ata_taskfile *); static > +void sata_fsl_qc_prep(struct ata_queued_cmd *); static u8 > +sata_fsl_check_status(struct ata_port *); static void > +sata_fsl_freeze(struct ata_port *); static void sata_fsl_thaw(struct > +ata_port *); static void sata_fsl_error_handler(struct ata_port *); > +static void sata_fsl_post_internal_cmd(struct ata_queued_cmd *); > + > +static inline unsigned int sata_fsl_tag(unsigned int, void __iomem > +*); In particular, get rid of the forward declarations for static functions. All functions in a simple driver should be ordered in a way that you always reference only code that was previously defined. This helps avoid accidental recursions and makes it easier to review. Arnd <>< ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev