Re: schizophrenic G5 ...
Benjamin Herrenschmidt wrote: On Sun, 2008-12-21 at 16:11 -0800, Kevin Diggs wrote: Hi, I have a water cooled dual 2.5 GHz G5 (Powermac7,3). It has YDL 6.0 on it. Using the stock YDL 2.6.23 kernel this machine appears to work fine. After finally getting it to boot under 2.6.27, it will shut itself off if put under any significant load. And it is doing it very quickly. Like within a few seconds of becoming busy. I just discovered it is spitting out messages about temperature way above maximum (from therm_pm72.c). This one has the Panasonic cooling system. I have checked behind the cover and see no evidence of leaks. When put under load under the stock YDL kernel, the cpu fans will speed up for about 2 minutes. Then over the next minute or so they will slow down almost to idle. Thereafter a whirring sound can be heard every 15 to 30 seconds lasting about 5 seconds. Which I am guessing is the pump? The exhaust air barely gets warm? Anyone have any ideas? Could the cooling system NOT be correctly thermally connected to the cpus? I would appreciate it if one of the many people on this list that are way more smarterer than me could tell me something like, If this were true you would have toasted the cpus already! I have approx. the same here taking dust under the desk, I'll give it a spin but i might have to wait a couple of days... If mine works, then we'll have to run some more intensive debugging to see what's going on. Cheers, Ben. Ben, I would appreciate it. I am now kinda afraid to turn the thing on. ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH] powerpc/iseries: Kexec is known not to work on iseries
The non-zero return from the prepare callback is returned by sys_kexec_load() to userspace, indicating that kexec is not supported on the machine. Signed-off-by: Michael Ellerman mich...@ellerman.id.au --- arch/powerpc/platforms/iseries/setup.c | 11 +++ 1 files changed, 11 insertions(+), 0 deletions(-) diff --git a/arch/powerpc/platforms/iseries/setup.c b/arch/powerpc/platforms/iseries/setup.c index 70b688c..24519b9 100644 --- a/arch/powerpc/platforms/iseries/setup.c +++ b/arch/powerpc/platforms/iseries/setup.c @@ -23,6 +23,7 @@ #include linux/string.h #include linux/seq_file.h #include linux/kdev_t.h +#include linux/kexec.h #include linux/major.h #include linux/root_dev.h #include linux/kernel.h @@ -638,6 +639,13 @@ static int __init iseries_probe(void) return 1; } +#ifdef CONFIG_KEXEC +static int iseries_kexec_prepare(struct kimage *image) +{ + return -ENOSYS; +} +#endif + define_machine(iseries) { .name = iSeries, .setup_arch = iSeries_setup_arch, @@ -658,6 +666,9 @@ define_machine(iseries) { .probe = iseries_probe, .ioremap= iseries_ioremap, .iounmap= iseries_iounmap, +#ifdef CONFIG_KEXEC + .machine_kexec_prepare = iseries_kexec_prepare, +#endif /* XXX Implement enable_pmcs for iSeries */ }; -- 1.5.3.7.1.g4e596e ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH RESEND] powerpc: make udbg 16550 boot console configurable for EMBEDDED
The udbg console is currently always enabled for platforms selecting the PPC_UDBG_16550 symbol (needed to create platform devices for 8250 SoC UARTs from DT). Now, the udbg console is nice for debugging as it works so early, but it also has a number of disadvantages: - It doesn't respect console= and still outputs console messages even if console isn't ttySx (E.G. if CONFIG_SILENT_CONSOLE is enabled in U-Boot which sets 'console=' - It's slow (boot is ~0.3s slower on my mpc8347 platform compared to using the 8250 driver right away) - It slightly bloats the kernel (pretty insignificant, around 1K) As that isn't always desirable, add a PPC_UDBG_16550_CONSOLE kconfig symbol to let the user disable it (only visible if CONFIG_EMBEDDED). Signed-off-by: Peter Korsgaard jac...@sunsite.dk --- arch/powerpc/kernel/Makefile|3 ++- arch/powerpc/kernel/legacy_serial.c |4 arch/powerpc/platforms/Kconfig |7 +++ 3 files changed, 13 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile index 92673b4..4651c0b 100644 --- a/arch/powerpc/kernel/Makefile +++ b/arch/powerpc/kernel/Makefile @@ -80,7 +80,8 @@ obj-$(CONFIG_MODULES) += ppc_ksyms.o obj-$(CONFIG_BOOTX_TEXT) += btext.o obj-$(CONFIG_SMP) += smp.o obj-$(CONFIG_KPROBES) += kprobes.o -obj-$(CONFIG_PPC_UDBG_16550) += legacy_serial.o udbg_16550.o +obj-$(CONFIG_PPC_UDBG_16550) += legacy_serial.o +obj-$(CONFIG_PPC_UDBG_16550_CONSOLE) += udbg_16550.o obj-$(CONFIG_STACKTRACE) += stacktrace.o pci64-$(CONFIG_PPC64) += pci_dn.o isa-bridge.o diff --git a/arch/powerpc/kernel/legacy_serial.c b/arch/powerpc/kernel/legacy_serial.c index 9ddfaef..c0e9866 100644 --- a/arch/powerpc/kernel/legacy_serial.c +++ b/arch/powerpc/kernel/legacy_serial.c @@ -279,6 +279,7 @@ static int __init add_legacy_pci_port(struct device_node *np, } #endif +#ifdef CONFIG_PPC_UDBG_16550_CONSOLE static void __init setup_legacy_serial_console(int console) { struct legacy_serial_info *info = @@ -295,6 +296,9 @@ static void __init setup_legacy_serial_console(int console) DBG(default console speed = %d\n, info-speed); udbg_init_uart(addr, info-speed, info-clock); } +#else +#define setup_legacy_serial_console(console) do { } while (0) +#endif /* * This is called very early, as part of setup_system() or eventually diff --git a/arch/powerpc/platforms/Kconfig b/arch/powerpc/platforms/Kconfig index 47e956c..bc3ce47 100644 --- a/arch/powerpc/platforms/Kconfig +++ b/arch/powerpc/platforms/Kconfig @@ -312,4 +312,11 @@ config MPC8xxx_GPIO Say Y here if you're going to use hardware that connects to the MPC831x/834x/837x/8572/8610 GPIOs. +config PPC_UDBG_16550_CONSOLE + bool Boot console on 16550 UDBG if EMBEDDED + depends on PPC_UDBG_16550 + default y + help + Say Y here to use the UDBG infrastructure for early boot messages. + endmenu -- 1.5.6.5 ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: Commits added to powerpc.git next and master branches
Paul == Paul Mackerras pau...@samba.org writes: Hi, I still don't see 'make udbg 16550 boot console configurable for EMBEDDED' (http://patchwork.ozlabs.org/patch/15441/) - Please consider. -- Bye, Peter Korsgaard ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH] ucc_geth: Eliminate the need for forward references
This patch simply reorders some functions to eliminate the need for forward references. No other changes than that. Suggested-by: Timur Tabi ti...@freescale.com Signed-off-by: Anton Vorontsov avoront...@ru.mvista.com --- drivers/net/ucc_geth.c | 81 +++- 1 files changed, 39 insertions(+), 42 deletions(-) diff --git a/drivers/net/ucc_geth.c b/drivers/net/ucc_geth.c index 6c2d074..764d421 100644 --- a/drivers/net/ucc_geth.c +++ b/drivers/net/ucc_geth.c @@ -3072,48 +3072,6 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth) return 0; } -static int ucc_geth_close(struct net_device *dev); -static int ucc_geth_open(struct net_device *dev); - -/* Reopen device. This will reset the MAC and PHY. */ -static void ucc_geth_timeout_work(struct work_struct *work) -{ - struct ucc_geth_private *ugeth; - struct net_device *dev; - - ugeth = container_of(work, struct ucc_geth_private, timeout_work); - dev = ugeth-dev; - - ugeth_vdbg(%s: IN, __func__); - - dev-stats.tx_errors++; - - ugeth_dump_regs(ugeth); - - if (dev-flags IFF_UP) { - /* -* Must reset MAC *and* PHY. This is done by reopening -* the device. -*/ - ucc_geth_close(dev); - ucc_geth_open(dev); - } - - netif_tx_schedule_all(dev); -} - -/* - * ucc_geth_timeout gets called when a packet has not been - * transmitted after a set amount of time. - */ -static void ucc_geth_timeout(struct net_device *dev) -{ - struct ucc_geth_private *ugeth = netdev_priv(dev); - - netif_carrier_off(dev); - schedule_work(ugeth-timeout_work); -} - /* This is called by the kernel when a frame is ready for transmission. */ /* It is pointed to by the dev-hard_start_xmit function pointer */ static int ucc_geth_start_xmit(struct sk_buff *skb, struct net_device *dev) @@ -3526,6 +3484,45 @@ static int ucc_geth_close(struct net_device *dev) return 0; } +/* Reopen device. This will reset the MAC and PHY. */ +static void ucc_geth_timeout_work(struct work_struct *work) +{ + struct ucc_geth_private *ugeth; + struct net_device *dev; + + ugeth = container_of(work, struct ucc_geth_private, timeout_work); + dev = ugeth-dev; + + ugeth_vdbg(%s: IN, __func__); + + dev-stats.tx_errors++; + + ugeth_dump_regs(ugeth); + + if (dev-flags IFF_UP) { + /* +* Must reset MAC *and* PHY. This is done by reopening +* the device. +*/ + ucc_geth_close(dev); + ucc_geth_open(dev); + } + + netif_tx_schedule_all(dev); +} + +/* + * ucc_geth_timeout gets called when a packet has not been + * transmitted after a set amount of time. + */ +static void ucc_geth_timeout(struct net_device *dev) +{ + struct ucc_geth_private *ugeth = netdev_priv(dev); + + netif_carrier_off(dev); + schedule_work(ugeth-timeout_work); +} + static phy_interface_t to_phy_interface(const char *phy_connection_type) { if (strcasecmp(phy_connection_type, mii) == 0) -- 1.5.6.5 ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH] powerpc/qe: Select QE_USB with USB_GADGET_FSL_QE
On Wed, Dec 03, 2008 at 10:33:27PM +0300, Anton Vorontsov wrote: On Sat, Nov 08, 2008 at 08:52:54PM +0300, Anton Vorontsov wrote: Boards should know when QE_USB is used, so that they can configure USB clocks and pins. Another option would be to add 'select QE_USB' into USB_GADGET_FSL_QE, but selects are evil since they don't support dependencies. While at it, also remove 'host' from the symbol description, since the QE_USB code is used to support the gadget driver as well. Signed-off-by: Anton Vorontsov avoront...@ru.mvista.com --- Anything wrong with this one? Without this patch QE UDC won't work (board file won't configure the USB clocks and pins). Thanks, arch/powerpc/sysdev/qe_lib/Kconfig |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/arch/powerpc/sysdev/qe_lib/Kconfig b/arch/powerpc/sysdev/qe_lib/Kconfig index 76ffbc4..41ac3df 100644 --- a/arch/powerpc/sysdev/qe_lib/Kconfig +++ b/arch/powerpc/sysdev/qe_lib/Kconfig @@ -22,5 +22,6 @@ config UCC config QE_USB bool + default y if USB_GADGET_FSL_QE help - QE USB Host Controller support + QE USB Controller support -- 1.5.6.3 -- Anton Vorontsov email: cbouatmai...@gmail.com irc://irc.freenode.net/bd2 ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH RESEND] powerpc: make udbg 16550 boot console configurable for EMBEDDED
Peter Korsgaard wrote: - It doesn't respect console= and still outputs console messages even if console isn't ttySx (E.G. if CONFIG_SILENT_CONSOLE is enabled in U-Boot which sets 'console=' I believe it uses /chosen/linux,stdout-path; u-boot could clear that if silent console is desired. As that isn't always desirable, add a PPC_UDBG_16550_CONSOLE kconfig symbol to let the user disable it (only visible if CONFIG_EMBEDDED). There's an existing CONFIG_PPC_EARLY_DEBUG that it could depend on instead. -Scott ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: cpm2-scc-uart on mpc8265 not working
On Mon, 2008-12-22 at 15:01 -0600, Scott Wood wrote: c...@119c0 { #address-cells = 1; #size-cells = 1; compatible = fsl,mrdig-cpm, fsl,cpm2; reg = 0x119c0 0x30; ranges; mu...@0 { #address-cells = 1; #size-cells = 1; ranges = 0x0 0x0 0x1; d...@0 { compatible = fsl,cpm-muram-data; reg = 0x0 0x2000 0x9800 0x800; }; }; b...@119f0 { compatible = fsl,mrdig-brg, fsl,cpm2-brg, fsl,cpm-brg; reg = 0x119f0 0x10 0x115f0 0x10; }; /* TODO: I believe the SCCs are setup correctly */ /* SCC1 */ ser...@11a00 { device_type = serial; compatible = fsl,mrdig-scc-uart, fsl,cpm2-scc-uart; reg = 0x11a00 0x20 0x8000 0x100; interrupts = 40 8; interrupt-parent = PIC; fsl,cpm-brg = 1; fsl,cpm-command = 0x080; }; /* SCC2 */ ser...@11a20 { device_type = serial; compatible = fsl,mrdig-scc-uart, fsl,cpm2-scc-uart; reg = 0x11a20 0x20 0x8000 0x100; interrupts = 41 8; interrupt-parent = PIC; fsl,cpm-brg = 2; fsl,cpm-command = 0x4a0; }; /* SCC3 - set this up now or later with SDLC? */ ser...@11a40 { device_type = serial; compatible = fsl,mrdig-scc-uart, fsl,cpm2-scc-uart; reg = 0x11a40 0x20 0x8000 0x100; interrupts = 42 8; interrupt-parent = PIC; fsl,cpm-brg = 3; fsl,cpm-command = 0x8c0; }; You're assigning the same DPRAM region to all 3 of these serial ports. SCC2 is 0x8100, and SCC3 is 0x8200. This is likely your problem. I fixed up the DPRAM regions. I also fixed up the muram region which had not been updated for the mpc8265 - it still had the old mpc8272 definitions. The kernel does not hang anymore but I still don't see anything on the serial port. Using an o'scope I can see data on the line, it is just that bit period is about 560uS - way to slow. The bootargs have console=ttyCPMO,115200 and I can see the cpm_uart_console_setup() is trying to set the system to 115kbps. So at the logical level everything appears ok. Here is the latest DTS file. /dts-v1/; / { model = MRDIG 1.1; compatible = mrdig; #address-cells = 1; #size-cells = 1; cpus { #address-cells = 1; #size-cells = 0; PowerPC,8...@0 { device_type = cpu; reg = 0x0; d-cache-line-size = 32; i-cache-line-size = 32; d-cache-size = 16384; i-cache-size = 16384; /* filled by u-boot */ timebase-frequency = 0; bus-frequency = 0; clock-frequency = 0; }; }; memory { device_type = memory; reg = 0x0 0x0; }; local...@f0010100 { compatible = mpc8265-localbus, fsl,pq2-localbus; #address-cells = 2; #size-cells = 1; reg = 0xf0010100 0x40; /* * BR0 flash * BR1 sdram - here or in the /memory * BR2 PCI * BR3 Sysace * BR4 CPLD * BR5 FPGA * BR6 FPGA * BR7 FPGA * BR8 FPGA * BR9 FPGA * BR10 AIS */ /* TODO: Do we list all ranges? * TODO: What are
Re: [PATCH] powerpc/iseries: Kexec is known not to work on iseries
Hi, Michael Ellerman wrote: The non-zero return from the prepare callback is returned by sys_kexec_load() to userspace, indicating that kexec is not supported on the machine. ... @@ -638,6 +639,13 @@ static int __init iseries_probe(void) return 1; } +#ifdef CONFIG_KEXEC +static int iseries_kexec_prepare(struct kimage *image) +{ + return -ENOSYS; +} +#endif + define_machine(iseries) { .name = iSeries, .setup_arch = iSeries_setup_arch, @@ -658,6 +666,9 @@ define_machine(iseries) { .probe = iseries_probe, .ioremap= iseries_ioremap, .iounmap= iseries_iounmap, +#ifdef CONFIG_KEXEC + .machine_kexec_prepare = iseries_kexec_prepare, +#endif /* XXX Implement enable_pmcs for iSeries */ }; But machine_kexec_prepare() already returns -ENOSYS if the platform doesn't have the hook in ppc_md. I must be missing something; what is this patch fixing? ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: cpm2-scc-uart on mpc8265 not working
jeff angielski wrote: I fixed up the DPRAM regions. I also fixed up the muram region which had not been updated for the mpc8265 - it still had the old mpc8272 definitions. The kernel does not hang anymore but I still don't see anything on the serial port. Using an o'scope I can see data on the line, it is just that bit period is about 560uS - way to slow. U-boot needs to fill in the clock-frequency property in the brg node. d...@0 { /* reg = 0x0 0x2000 0x9800 0x800; */ compatible = fsl,cpm-muram-data; reg = 0x0 0x6000 0x8000 0x1000 0xb000 0x1000; This is not correct -- you should only list the DPRAM regions that are usable for arbitrary data. This is 0 0x4000, assuming none of that has been allocated to microcode. -Scott ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH] powerpc/iseries: Kexec is known not to work on iseries
Hi Nathan, On Tue, Dec 23, 2008 at 12:50:51PM -0600, Nathan Lynch wrote: Hi, Michael Ellerman wrote: The non-zero return from the prepare callback is returned by sys_kexec_load() to userspace, indicating that kexec is not supported on the machine. ... @@ -638,6 +639,13 @@ static int __init iseries_probe(void) return 1; } +#ifdef CONFIG_KEXEC +static int iseries_kexec_prepare(struct kimage *image) +{ + return -ENOSYS; +} +#endif + define_machine(iseries) { .name = iSeries, .setup_arch = iSeries_setup_arch, @@ -658,6 +666,9 @@ define_machine(iseries) { .probe = iseries_probe, .ioremap= iseries_ioremap, .iounmap= iseries_iounmap, +#ifdef CONFIG_KEXEC + .machine_kexec_prepare = iseries_kexec_prepare, +#endif /* XXX Implement enable_pmcs for iSeries */ }; But machine_kexec_prepare() already returns -ENOSYS if the platform doesn't have the hook in ppc_md. I must be missing something; Yeah, the kexec discussion, starting from here: http://ozlabs.org/pipermail/linuxppc-dev/2008-December/066321.html The default behaviour has changed. -- Anton Vorontsov email: cbouatmai...@gmail.com irc://irc.freenode.net/bd2 ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH RESEND] powerpc: make udbg 16550 boot console configurable for EMBEDDED
On Tue, 2008-12-23 at 14:11 +0100, Peter Korsgaard wrote: The udbg console is currently always enabled for platforms selecting the PPC_UDBG_16550 symbol (needed to create platform devices for 8250 SoC UARTs from DT). Now, the udbg console is nice for debugging as it works so early, but it also has a number of disadvantages: .../... I don't think that's the right approach. I think a better one is to make a config option that selects whether the udbg console is registered. ie. CONFIG_UDBG_CONSOLE which would affect the calls sites in setup_32/64.c or the register_udbg_console() function itself in udbg.c Ben. ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: schizophrenic G5 ...
I have a very similar problem on my mac at work. I don't know atm how to look up the critical temperature that is fused. My mac reported only 55 degrees for the one cpu. The critical temperature can be read from the device-tree if i remember it correctly. I heard that there exists a bootable CD which contains a tool to refuse the CPU. Dont know where to download it, so my pragmatic solution was to relocate the machine to a room with air conditioning ;-) And I also run the ONE cpu at lowest frequency. The calibration info is in an i2c EEPROM iirc, though we read it's content via the device-tree. Cheers, Ben. ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: schizophrenic G5 ...
Christian Krafft wrote: On Sun, 21 Dec 2008 16:11:43 -0800 Kevin Diggs kev...@hypersurf.com wrote: Hi, I have a water cooled dual 2.5 GHz G5 (Powermac7,3). It has YDL 6.0 on it. Using the stock YDL 2.6.23 kernel this machine appears to work fine. After finally getting it to boot under 2.6.27, it will shut itself off if put under any significant load. And it is doing it very quickly. Like within a few seconds of becoming busy. I just discovered it is spitting out messages about temperature way above maximum (from therm_pm72.c). I have a very similar problem on my mac at work. I don't know atm how to look up the critical temperature that is fused. My mac reported only 55 degrees for the one cpu. The critical temperature can be read from the device-tree if i remember it correctly. I heard that there exists a bootable CD which contains a tool to refuse the CPU. Dont know where to download it, so my pragmatic solution was to relocate the machine to a room with air conditioning ;-) And I also run the ONE cpu at lowest frequency. ck Critical temperature? If it is in the device tree are we sure it isn't (from the 970fx_thermal_diode_an, page 2, second paragraph): In the PowerPC970FX family, the thermal diode is calibrated at a specified calibration temperature, usually around 70C, with no power on the chip, VDD = 0.0V, and 100 micro-amps being driven through the diode. The voltage across the diode is measured; it should be between 0.60V and 0.80V. The measured voltage and temperature is stored in Thermal Diode Calibration fuse bits. A second lower temperature value is used to set the second calibration point, refer to the datasheet for this value. On page 3 it also has: Reading Thermal Diode Calibration Data Via JTAG In order to access the Thermal Diode Calibration data stored in each processor, a sequence of JTAG commands must be issued, usually over the IIC bus. By using JTAG commands, the desired data will appear serially on the PowerPC970FX TDO pin or can be read using IIC. The detailed information on how to perform the read operation of the calibration registers is found in the PowerPC970FX User s Manual. Reading the thermal diode calibration register should be a one-time-only procedure. It is assumed that the Thermal Diode Calibration data stored in each processor will be captured and stored in system ROM for subsequent use. kevin ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH] USB: Driver for Freescale QUICC Engine USB Host Controller
On Wed, 24 Dec 2008 00:03:22 +0300 Anton Vorontsov avoront...@ru.mvista.com wrote: This patch adds support for the FHCI USB controller, as found in the Freescale MPC836x and MPC832x processors. It can support Full or Low speed modes. Quite a lot the hardware is doing by itself (SOF generation, CRC generation and checking), though scheduling and retransmission is on software's shoulders. This controller does not integrate the root hub, so this driver also fakes one-port hub. External hub is required to support more than one device. quick scan Nice-looking driver. But the namespace pollution is tremendous! ... +static int fhci_mem_init(struct fhci_hcd *fhci) +{ + int i; + int error = 0; + + fhci-hc_list = kzalloc(sizeof(*fhci-hc_list), GFP_KERNEL); + if (!fhci-hc_list) + return -ENOMEM; + + INIT_LIST_HEAD(fhci-hc_list-ctrl_list); + INIT_LIST_HEAD(fhci-hc_list-bulk_list); + INIT_LIST_HEAD(fhci-hc_list-iso_list); + INIT_LIST_HEAD(fhci-hc_list-intr_list); + INIT_LIST_HEAD(fhci-hc_list-done_list); + + fhci-vroot_hub = kzalloc(sizeof(*fhci-vroot_hub), GFP_KERNEL); + if (!fhci-vroot_hub) + return -ENOMEM; Did we leak fhci-hc_list? + INIT_LIST_HEAD(fhci-empty_eds); + INIT_LIST_HEAD(fhci-empty_tds); + + /* initialize work queue to handle done list */ + fhci_tasklet.data = (unsigned long)fhci; + fhci-process_done_task = fhci_tasklet; + + for (i = 0; i MAX_TDS; i++) { + struct td *td = kmalloc(sizeof(*td), GFP_KERNEL); + + if (!td) { + error = 1; + break; + } + recycle_empty_td(fhci, td); + } + for (i = 0; i MAX_EDS; i++) { + struct ed *ed = kmalloc(sizeof(*ed), GFP_KERNEL); + + if (!ed) { + error = 1; + break; + } + recycle_empty_ed(fhci, ed); + } + + if (error) { + fhci_mem_free(fhci); + return -ENOMEM; + } + + fhci-active_urbs = 0; + + return error; +} + ... +void config_transceiver(struct fhci_hcd *fhci, enum fhci_port_status status) poorly-chosen global identifier. +{ + fhci_dbg(fhci, - %s: %d\n, __func__, status); + + switch (status) { + case FHCI_PORT_POWER_OFF: + fhci_gpio_set_value(fhci, GPIO_POWER, false); + break; + case FHCI_PORT_DISABLED: + case FHCI_PORT_WAITING: + fhci_gpio_set_value(fhci, GPIO_POWER, true); + break; + case FHCI_PORT_LOW: + fhci_gpio_set_value(fhci, GPIO_SPEED, false); + break; + case FHCI_PORT_FULL: + fhci_gpio_set_value(fhci, GPIO_SPEED, true); + break; + default: + WARN_ON(1); + break; + } + + fhci_dbg(fhci, - %s: %d\n, __func__, status); +} + +/* disable the USB port by clearing the EN bit in the USBMOD register */ +void usb_port_disable(struct fhci_hcd *fhci) another +{ + struct fhci_usb *usb = (struct fhci_usb *)fhci-usb_lld; + enum fhci_port_status port_status; + + fhci_dbg(fhci, - %s\n, __func__); + + fhci_stop_sof_timer(fhci); + + flush_all_transmissions(usb); + + fhci_usb_disable_interrupt((struct fhci_usb *)fhci-usb_lld); + port_status = usb-port_status; + usb-port_status = FHCI_PORT_DISABLED; + + /* Enable IDLE since we want to know if something comes along */ + usb-saved_msk |= USB_E_IDLE_MASK; + out_be16(usb-fhci-regs-usb_mask, usb-saved_msk); + + /* check if during the disconnection process attached new device */ + if (port_status == FHCI_PORT_WAITING) + device_connected_interrupt(fhci); + usb-vroot_hub-port.wPortStatus = ~USB_PORT_STAT_ENABLE; + usb-vroot_hub-port.wPortChange |= USB_PORT_STAT_C_ENABLE; + fhci_usb_enable_interrupt((struct fhci_usb *)fhci-usb_lld); + + fhci_dbg(fhci, - %s\n, __func__); +} + +/* enable the USB port by setting the EN bit in the USBMOD register */ +void usb_port_enable(void *lld) another. Please review all non-static symbols which this driver adds. +{ + struct fhci_usb *usb = (struct fhci_usb *)lld; + struct fhci_hcd *fhci = usb-fhci; + + fhci_dbg(fhci, - %s\n, __func__); + + config_transceiver(fhci, usb-port_status); + + if ((usb-port_status != FHCI_PORT_FULL) + (usb-port_status != FHCI_PORT_LOW)) + fhci_start_sof_timer(fhci); + + usb-vroot_hub-port.wPortStatus |= USB_PORT_STAT_ENABLE; + usb-vroot_hub-port.wPortChange |= USB_PORT_STAT_C_ENABLE; + + fhci_dbg(fhci, - %s\n, __func__); +} + ... +static struct td *get_empty_td(struct fhci_hcd *fhci) +{ + struct td *td; + + if (!list_empty(fhci-empty_tds)) { + td =
Re: [PATCH] USB: Driver for Freescale QUICC Engine USB Host Controller
On Wed, 24 Dec 2008, Anton Vorontsov wrote: This patch adds support for the FHCI USB controller, as found in the Freescale MPC836x and MPC832x processors. It can support Full or Low speed modes. Quite a lot the hardware is doing by itself (SOF generation, CRC generation and checking), though scheduling and retransmission is on software's shoulders. This controller does not integrate the root hub, so this driver also fakes one-port hub. External hub is required to support more than one device. It looks like the kernel this was written for is several versions out of date. The driver is missing some critical calls to functions like usb_hcd_link_urb_to_ep(). Alan Stern ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
[PATCH/RFC] sysfs cache code rewrite
The current code for providing processor cache information in sysfs has the following deficiencies: - several complex functions that are hard to understand - implicit recursion (cache_desc_release - kobject_put - cache_desc_release) - explicit recursion (create_cache_index_info) - use of two per-cpu arrays when one would suffice - duplication of work on systems where CPUs share cache Also, when I looked at implementing support for a shared_cpu_map attribute, it was pretty much impossible to handle hotplug without checking every single online CPU's cache_desc list and fixing things up... not that this is a hot path, but it would have introduced O(n^2)-ish behavior during boot. Addressing this involved rethinking the core data structures used, which didn't lend itself to an incremental approach. This implementation maintains a forest (potentially more than one tree) of cache objects which reflects the system's cache topology. Cache objects are instantiated as needed as CPUs come online. A per-cpu array is used mainly for sysfs-related bookkeeping; the objects in the array just point to the appropriate points in the forest. This maintains compatibility with the existing code and includes some enhancements: - Implement the shared_cpu_map attribute, which is essential for enabling userspace to discover the system's overall cache topology. - Use cache-block-size properties if cache-line-size is not available. I chose to place this implementation in a new file since it would have roughly doubled the size of sysfs.c, which is already kind of messy. Signed-off-by: Nathan Lynch n...@pobox.com --- arch/powerpc/kernel/Makefile|2 +- arch/powerpc/kernel/cacheinfo.c | 837 +++ arch/powerpc/kernel/cacheinfo.h |8 + arch/powerpc/kernel/sysfs.c | 300 +-- 4 files changed, 850 insertions(+), 297 deletions(-) create mode 100644 arch/powerpc/kernel/cacheinfo.c create mode 100644 arch/powerpc/kernel/cacheinfo.h I've tested this on various ppc64 systems, making sure that the cache attributes' output remain unchanged, as well as running cpu hotplug stress tests while concurrently accessing the cpu sysfs hierarchy. diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile index 089209a..330463d 100644 --- a/arch/powerpc/kernel/Makefile +++ b/arch/powerpc/kernel/Makefile @@ -28,7 +28,7 @@ endif obj-y := cputable.o ptrace.o syscalls.o \ irq.o align.o signal_32.o pmc.o vdso.o \ init_task.o process.o systbl.o idle.o \ - signal.o sysfs.o + signal.o sysfs.o cacheinfo.o obj-y += vdso32/ obj-$(CONFIG_PPC64)+= setup_64.o sys_ppc32.o \ signal_64.o ptrace32.o \ diff --git a/arch/powerpc/kernel/cacheinfo.c b/arch/powerpc/kernel/cacheinfo.c new file mode 100644 index 000..f3e3ae3 --- /dev/null +++ b/arch/powerpc/kernel/cacheinfo.c @@ -0,0 +1,837 @@ +/* + * Processor cache information made available to userspace via sysfs; + * intended to be compatible with x86 intel_cacheinfo implementation. + * + * Copyright 2008 IBM Corporation + * Author: Nathan Lynch + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License version + * 2 as published by the Free Software Foundation. + */ + +#include linux/cpu.h +#include linux/cpumask.h +#include linux/init.h +#include linux/kernel.h +#include linux/kobject.h +#include linux/list.h +#include linux/notifier.h +#include linux/of.h +#include linux/percpu.h +#include asm/prom.h + +#include cacheinfo.h + +/* per-cpu object for tracking: + * - a cache kobject for the top-level directory + * - a list of index objects representing the cpu's local cache hierarchy + */ +struct cache_dir { + struct kobject *kobj; /* bare (not embedded) kobject for cache + * directory */ + struct cache_index_dir *index; /* list of index objects */ +}; + +/* index object: each cpu's cache directory has an index + * subdirectory corresponding to a cache object associated with the + * cpu. This object's lifetime is managed via the embedded kobject. + */ +struct cache_index_dir { + struct kobject kobj; + struct cache_index_dir *next; /* next index in parent directory */ + struct cache *cache; +}; + +/* Template for determining which OF properties to query for a given + * cache type */ +struct cache_type_info { + const char *name; + const char *size_prop; + + /* Allow for both [di]-cache-line-size and +* [di]-cache-block-size properties. According to the PowerPC +* Processor binding, -line-size should be provided if it +* differs from the cache block size (that which is operated +* on by cache instructions), so we look for