Re: [PATCH 2/9] mtd: add mtd_is_master helper
On 7/1/24 4:53 PM, Marco Felsch wrote: > Provide a simple helper to make it easy to detect an master mtd device. > > Signed-off-by: Marco Felsch > --- > include/linux/mtd/mtd.h | 5 + > 1 file changed, 5 insertions(+) > > diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h > index 8d10d9d2e830..bf3fc2ea7230 100644 > --- a/include/linux/mtd/mtd.h > +++ b/include/linux/mtd/mtd.h > @@ -408,6 +408,11 @@ static inline struct mtd_info *mtd_get_master(struct > mtd_info *mtd) > return mtd; > } > > +static inline bool mtd_is_master(struct mtd_info *mtd) > +{ > + return mtd->parent ? false : true; Perhaps: return !mtd->parent; [...] MBR, Sergey
Re: [PATCH v2 RFC] drivers/usb/host/ehci-fsl: Fix interrupt setup in host mode.
Hello! On 6/25/22 11:41 PM, Darren Stevens wrote: > In patch a1a2b7125e10 (Drop static setup of IRQ resource from DT > core) we stopped platform_get_resource() from returning the IRQ, as all In commit a1a2b7125e10 ("Drop static setup of IRQ resource from DT core") > drivers were supposed to have switched to platform_get_irq() > Unfortunately the Freescale EHCI driver in host mode got missed. Fix > it. Also fix allocation of resources to work with current kernel. The basic rule (especially for the fixes) is "do one thing per patch". > Fixes: a1a2b7125e10 (Drop static setup of IRQ resource from DT core) > Reported-by Christian Zigotzky > Signed-off-by Darren Stevens > --- > v2 - Fixed coding style, removed a couple of unneeded initializations, > cc'd Layerscape maintainers. > > Tested on AmigaOne X5000/20 and X5000/40 not sure if this is entirely > correct fix though. Contains code by Rob Herring (in fsl-mph-dr-of.c) > > diff --git a/drivers/usb/host/ehci-fsl.c b/drivers/usb/host/ehci-fsl.c > index 385be30..8bd258a 100644 > --- a/drivers/usb/host/ehci-fsl.c > +++ b/drivers/usb/host/ehci-fsl.c [...] > @@ -92,15 +89,18 @@ static int fsl_ehci_drv_probe(struct platform_device > *pdev) > goto err1; > } > > - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); > - hcd->regs = devm_ioremap_resource(>dev, res); > + tmp = of_address_to_resource(dn, 0, ); Hm, why? What does this fix? [...] MBR, Sergey
Re: [PATCH 17/30] tracing: Improve panic/die notifiers
Hello! On 4/28/22 1:49 AM, Guilherme G. Piccoli wrote: > Currently the tracing dump_on_oops feature is implemented > through separate notifiers, one for die/oops and the other > for panic. With the addition of panic notifier "id", this > patch makes use of such "id" to unify both functions. > > It also comments the function and changes the priority of the > notifier blocks, in order they run early compared to other > notifiers, to prevent useless trace data (like the callback > names for the other notifiers). Finally, we also removed an > unnecessary header inclusion. > > Signed-off-by: Guilherme G. Piccoli > --- > kernel/trace/trace.c | 57 +--- > 1 file changed, 32 insertions(+), 25 deletions(-) > > diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c > index f4de111fa18f..c1d8a3622ccc 100644 > --- a/kernel/trace/trace.c > +++ b/kernel/trace/trace.c [...] > @@ -9767,38 +9766,46 @@ static __init int tracer_init_tracefs(void) > > fs_initcall(tracer_init_tracefs); > > -static int trace_panic_handler(struct notifier_block *this, > -unsigned long event, void *unused) > +/* > + * The idea is to execute the following die/panic callback early, in order > + * to avoid showing irrelevant information in the trace (like other panic > + * notifier functions); we are the 2nd to run, after hung_task/rcu_stall > + * warnings get disabled (to prevent potential log flooding). > + */ > +static int trace_die_panic_handler(struct notifier_block *self, > + unsigned long ev, void *unused) > { > - if (ftrace_dump_on_oops) > + int do_dump; bool? > + > + if (!ftrace_dump_on_oops) > + return NOTIFY_DONE; > + > + switch (ev) { > + case DIE_OOPS: > + do_dump = 1; > + break; > + case PANIC_NOTIFIER: > + do_dump = 1; > + break; Why not: case DIE_OOPS: case PANIC_NOTIFIER: do_dump = 1; break; > + default: > + do_dump = 0; > + break; > + } > + > + if (do_dump) > ftrace_dump(ftrace_dump_on_oops); > - return NOTIFY_OK; > + > + return NOTIFY_DONE; > } [...] MBR, Sergey
Re: [PATCH 2/4] exec: remove compat_do_execve
On 3/26/21 5:38 PM, Christoph Hellwig wrote: > Just call compat_do_execve instead. compat_do_execveat(), maybe? > Signed-off-by: Christoph Hellwig > --- > fs/exec.c | 17 + > 1 file changed, 1 insertion(+), 16 deletions(-) > > diff --git a/fs/exec.c b/fs/exec.c > index b63fb020909075..06e07278b456fa 100644 > --- a/fs/exec.c > +++ b/fs/exec.c [...] > @@ -2072,7 +2057,7 @@ COMPAT_SYSCALL_DEFINE3(execve, const char __user *, > filename, > const compat_uptr_t __user *, argv, > const compat_uptr_t __user *, envp) > { > - return compat_do_execve(getname(filename), argv, envp); > + return compat_do_execveat(AT_FDCWD, getname(filename), argv, envp, 0); > } > > COMPAT_SYSCALL_DEFINE5(execveat, int, fd, MBR, Sergei
Re: [PATCH 08/10] MIPS: disable CONFIG_IDE in malta*_defconfig
On 3/18/21 7:57 AM, Christoph Hellwig wrote: > Various malta defconfigs enable CONFIG_IDE for the tc86c001 ide driver, > hich is a Toshiba plug in card that does not make much sense to use on ^ which is for > bigsur platforms. For all other ATA cards libata support is already ^ Malta. > enabled. > > Signed-off-by: Christoph Hellwig [...] MBR, Sergei
Re: [PATCH 07/10] MIPS: disable CONFIG_IDE in bigsur_defconfig
Hi! On 3/18/21 7:57 AM, Christoph Hellwig wrote: > bigsur_defconfig enables CONFIG_IDE for the tc86c001 ide driver, which > is a Toshiba plug in card that does not make much sense to use on bigsur ^ for Else that doesn't make much sense. :-) > platforms. For all other ATA cards libata support is already enabled. > > Signed-off-by: Christoph Hellwig [...] MBR, Sergei
Re: [PATCH 02/27] x86/syscalls: fix -Wmissing-prototypes warnings from COND_SYSCALL()
Hello! On 28.01.2021 3:50, Masahiro Yamada wrote: Building kernel/sys_ni.c with W=1 omits tons of -Wmissing-prototypes Emits? warnings. $ make W=1 kernel/sys_ni.o [ snip ] CC kernel/sys_ni.o In file included from kernel/sys_ni.c:10: ./arch/x86/include/asm/syscall_wrapper.h:83:14: warning: no previous prototype for '__x64_sys_io_setup' [-Wmissing-prototypes] 83 | __weak long __##abi##_##name(const struct pt_regs *__unused) \ | ^~ ./arch/x86/include/asm/syscall_wrapper.h:100:2: note: in expansion of macro '__COND_SYSCALL' 100 | __COND_SYSCALL(x64, sys_##name) | ^~ ./arch/x86/include/asm/syscall_wrapper.h:256:2: note: in expansion of macro '__X64_COND_SYSCALL' 256 | __X64_COND_SYSCALL(name) \ | ^~ kernel/sys_ni.c:39:1: note: in expansion of macro 'COND_SYSCALL' 39 | COND_SYSCALL(io_setup); | ^~~~ ./arch/x86/include/asm/syscall_wrapper.h:83:14: warning: no previous prototype for '__ia32_sys_io_setup' [-Wmissing-prototypes] 83 | __weak long __##abi##_##name(const struct pt_regs *__unused) \ | ^~ ./arch/x86/include/asm/syscall_wrapper.h:120:2: note: in expansion of macro '__COND_SYSCALL' 120 | __COND_SYSCALL(ia32, sys_##name) | ^~ ./arch/x86/include/asm/syscall_wrapper.h:257:2: note: in expansion of macro '__IA32_COND_SYSCALL' 257 | __IA32_COND_SYSCALL(name) | ^~~ kernel/sys_ni.c:39:1: note: in expansion of macro 'COND_SYSCALL' 39 | COND_SYSCALL(io_setup); | ^~~~ ... __SYS_STUB0() and __SYS_STUBx() defined a few lines above have forward declarations. Let's do likewise for __COND_SYSCALL() to fix the warnings. Signed-off-by: Masahiro Yamada --- arch/x86/include/asm/syscall_wrapper.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/include/asm/syscall_wrapper.h b/arch/x86/include/asm/syscall_wrapper.h index a84333adeef2..80c08c7d5e72 100644 --- a/arch/x86/include/asm/syscall_wrapper.h +++ b/arch/x86/include/asm/syscall_wrapper.h @@ -80,6 +80,7 @@ extern long __ia32_sys_ni_syscall(const struct pt_regs *regs); } #define __COND_SYSCALL(abi, name) \ + __weak long __##abi##_##name(const struct pt_regs *__unused); \ __weak long __##abi##_##name(const struct pt_regs *__unused)\ Aren't these two lines identical? [...] MBR, Sergei
Re: [PATCH 02/27] x86/syscalls: fix -Wmissing-prototypes warnings from COND_SYSCALL()
On 28.01.2021 10:59, Sergei Shtylyov wrote: [...] Building kernel/sys_ni.c with W=1 omits tons of -Wmissing-prototypes Emits? warnings. $ make W=1 kernel/sys_ni.o [ snip ] CC kernel/sys_ni.o In file included from kernel/sys_ni.c:10: ./arch/x86/include/asm/syscall_wrapper.h:83:14: warning: no previous prototype for '__x64_sys_io_setup' [-Wmissing-prototypes] 83 | __weak long __##abi##_##name(const struct pt_regs *__unused) \ | ^~ ./arch/x86/include/asm/syscall_wrapper.h:100:2: note: in expansion of macro '__COND_SYSCALL' 100 | __COND_SYSCALL(x64, sys_##name) | ^~ ./arch/x86/include/asm/syscall_wrapper.h:256:2: note: in expansion of macro '__X64_COND_SYSCALL' 256 | __X64_COND_SYSCALL(name) \ | ^~ kernel/sys_ni.c:39:1: note: in expansion of macro 'COND_SYSCALL' 39 | COND_SYSCALL(io_setup); | ^~~~ ./arch/x86/include/asm/syscall_wrapper.h:83:14: warning: no previous prototype for '__ia32_sys_io_setup' [-Wmissing-prototypes] 83 | __weak long __##abi##_##name(const struct pt_regs *__unused) \ | ^~ ./arch/x86/include/asm/syscall_wrapper.h:120:2: note: in expansion of macro '__COND_SYSCALL' 120 | __COND_SYSCALL(ia32, sys_##name) | ^~ ./arch/x86/include/asm/syscall_wrapper.h:257:2: note: in expansion of macro '__IA32_COND_SYSCALL' 257 | __IA32_COND_SYSCALL(name) | ^~~ kernel/sys_ni.c:39:1: note: in expansion of macro 'COND_SYSCALL' 39 | COND_SYSCALL(io_setup); | ^~~~ ... __SYS_STUB0() and __SYS_STUBx() defined a few lines above have forward declarations. Let's do likewise for __COND_SYSCALL() to fix the warnings. Signed-off-by: Masahiro Yamada --- arch/x86/include/asm/syscall_wrapper.h | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/x86/include/asm/syscall_wrapper.h b/arch/x86/include/asm/syscall_wrapper.h index a84333adeef2..80c08c7d5e72 100644 --- a/arch/x86/include/asm/syscall_wrapper.h +++ b/arch/x86/include/asm/syscall_wrapper.h @@ -80,6 +80,7 @@ extern long __ia32_sys_ni_syscall(const struct pt_regs *regs); } #define __COND_SYSCALL(abi, name) \ + __weak long __##abi##_##name(const struct pt_regs *__unused); \ __weak long __##abi##_##name(const struct pt_regs *__unused) \ Aren't these two lines identical? Ah, got it! :-) [...] MBR, Sergei
Re: [PATCH 3/6] exec: cleanup the count() function
Hello! On 18.06.2020 17:46, Christoph Hellwig wrote: Remove the max argument as it is hard wired to MAX_ARG_STRINGS, and Technically, argument is what's actually passed to a function, you're removing a function parameter. give the function a slightly less generic name. Signed-off-by: Christoph Hellwig [...] MBR, Sergei
Re: [PATCH] usb: gadget: fsl: Fix a wrong judgment in fsl_udc_probe()
On 10.04.2020 4:58, Tang Bin wrote: If the function "platform_get_irq()" failed, the negative value returned will not be detected here, including "-EPROBE_DEFER", which causes the application to fail to get the correct error message. Thus it must be fixed. platform_get_irq() prints an appropriate error message, the problem is that the current code calls request_irq() with error code instead of IRQ. Signed-off-by: Tang Bin Signed-off-by: Shengju Zhang [...] MBR, Sergei
Re: [PATCH] usb: gadget: fsl: Fix a wrong judgment in fsl_udc_probe()
Hello! On 10.04.2020 4:58, Tang Bin wrote: If the function "platform_get_irq()" failed, the negative value returned will not be detected here, including "-EPROBE_DEFER", which causes the application to fail to get the correct error message. Thus it must be fixed. Signed-off-by: Tang Bin Signed-off-by: Shengju Zhang --- drivers/usb/gadget/udc/fsl_udc_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/gadget/udc/fsl_udc_core.c b/drivers/usb/gadget/udc/fsl_udc_core.c index ec6eda426..60853ad10 100644 --- a/drivers/usb/gadget/udc/fsl_udc_core.c +++ b/drivers/usb/gadget/udc/fsl_udc_core.c @@ -2441,8 +2441,8 @@ static int fsl_udc_probe(struct platform_device *pdev) udc_controller->max_ep = (dccparams & DCCPARAMS_DEN_MASK) * 2; udc_controller->irq = platform_get_irq(pdev, 0); - if (!udc_controller->irq) { This check has always been wrong, doesn't account for real errors and probe deferral... - ret = -ENODEV; + if (udc_controller->irq <= 0) { Note that platfrom_get_irq() no longer returns 0 on error. + ret = udc_controller->irq ? : -ENODEV; goto err_iounmap; } MBR, Sergei
Re: [PATCH 6/8] arm-nommu: call dma_mmap_from_dev_coherent directly
On 08.08.2019 19:00, Christoph Hellwig wrote: Ther is no need to go through dma_common_mmap for the arm-nommu There. :-) dma mmap implementation as the only possible memory not handled above could be that from the per-device coherent pool. Signed-off-by: Christoph Hellwig [...] MBR, Sergei
Re: [PATCH 2/2] MIPS: remove support for DMA_ATTR_WRITE_COMBINE
Hello! On 05.08.2019 11:01, Christoph Hellwig wrote: Mips uses the KSEG1 kernel memory segment do map dma coherent MIPS. s/do/to/? allocations for n on-coherent devices as uncachable, and does not have Uncacheable? any kind of special support for DMA_ATTR_WRITE_COMBINE in the allocation path. Thus supporting DMA_ATTR_WRITE_COMBINE in dma_mmap_attrs will lead to multiple mappings with different caching attributes. Fixes: 8c172467be36 ("MIPS: Add implementation of dma_map_ops.mmap()") Signed-off-by: Christoph Hellwig [...] MBR, Sergei
Re: [PATCH v3 4/7] ata: ahci_sunxi: use xxxsetbitsi_le32 functions
Hello! Typo in the subject: s/xxxsetbitsi/xxxsetbits/. On 24.10.2018 10:35, Corentin Labbe wrote: This patch converts ahci_sunxi to use xxxsetbits_le32 functions Signed-off-by: Corentin Labbe [...] MBR, Sergei
Re: [PATCH 01/25] tty: Change return type to void
Hello! On 9/4/2018 5:44 AM, Jaejoong Kim wrote: Many drivers with tty use the tty_stand_install(). But, there is no need to handle the error, since it always returns 0. So, change the return type of tty_standard_install() and tty_port_install() to void type and remove unnecessary exception handling where we use these functions. Signed-off-by: Jaejoong Kim --- drivers/tty/tty_io.c | 10 ++ drivers/tty/tty_port.c | 4 ++-- include/linux/tty.h| 4 ++-- 3 files changed, 10 insertions(+), 8 deletions(-) [...] diff --git a/include/linux/tty.h b/include/linux/tty.h index c56e397..63cdac1 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h @@ -556,7 +556,7 @@ extern struct tty_struct *tty_init_dev(struct tty_driver *driver, int idx); extern void tty_release_struct(struct tty_struct *tty, int idx); extern int tty_release(struct inode *inode, struct file *filp); extern void tty_init_termios(struct tty_struct *tty); -extern int tty_standard_install(struct tty_driver *driver, +extern void tty_standard_install(struct tty_driver *driver, struct tty_struct *tty); extern struct mutex tty_mutex; @@ -688,7 +688,7 @@ extern int tty_port_close_start(struct tty_port *port, extern void tty_port_close_end(struct tty_port *port, struct tty_struct *tty); extern void tty_port_close(struct tty_port *port, struct tty_struct *tty, struct file *filp); -extern int tty_port_install(struct tty_port *port, struct tty_driver *driver, +extern void tty_port_install(struct tty_port *port, struct tty_driver *driver, struct tty_struct *tty); You need to update all the callers in the same patch -- the kernel must remain buildable after each patch but you seem to have spread that update among a lot of patches.. [...] MBR, Sergei
[PATCH] mpc832x_rdb: fix of_irq_to_resource() error check
of_irq_to_resource() has recently been fixed to return negative error #'s along with 0 in case of failure, however the Freescale MPC832x RDB board code still only regards 0 as as failure indication -- fix it up. Fixes: 7a4228bbff76 ("of: irq: use of_irq_get() in of_irq_to_resource()") Signed-off-by: Sergei Shtylyov <sergei.shtyl...@cogentembedded.com> --- The patch is against the 'master' branch of Scott Wood's 'linux.git' repo (the 'fixes' branch is too much behind). arch/powerpc/platforms/83xx/mpc832x_rdb.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) Index: linux/arch/powerpc/platforms/83xx/mpc832x_rdb.c === --- linux.orig/arch/powerpc/platforms/83xx/mpc832x_rdb.c +++ linux/arch/powerpc/platforms/83xx/mpc832x_rdb.c @@ -89,7 +89,7 @@ static int __init of_fsl_spi_probe(char goto err; ret = of_irq_to_resource(np, 0, [1]); - if (!ret) + if (ret <= 0) goto err; pdev = platform_device_alloc("mpc83xx_spi", i);
Re: [PATCH] net: constify mdiobb_ops structures
Hello! On 01/13/2017 09:02 PM, Bhumika Goyal wrote: Declare mdiobb_ops structures as const as they are only stored in the ops field of mdiobb_ctrl structures. This field is of type const, so mdiobb_ops structures having this property can be declared const too. Done using Coccinelle: [...] Signed-off-by: Bhumika Goyal <bhumi...@gmail.com> [...] diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c index 92d7692..1b0acd1 100644 --- a/drivers/net/ethernet/renesas/ravb_main.c +++ b/drivers/net/ethernet/renesas/ravb_main.c @@ -171,7 +171,7 @@ static int ravb_get_mdio_data(struct mdiobb_ctrl *ctrl) } /* MDIO bus control struct */ -static struct mdiobb_ops bb_ops = { +static const struct mdiobb_ops bb_ops = { .owner = THIS_MODULE, .set_mdc = ravb_set_mdc, .set_mdio_dir = ravb_set_mdio_dir, diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c index 00fafab..6ef5dd8 100644 --- a/drivers/net/ethernet/renesas/sh_eth.c +++ b/drivers/net/ethernet/renesas/sh_eth.c @@ -1052,7 +1052,7 @@ static void sh_mdc_ctrl(struct mdiobb_ctrl *ctrl, int bit) } /* mdio bus control struct */ -static struct mdiobb_ops bb_ops = { +static const struct mdiobb_ops bb_ops = { .owner = THIS_MODULE, .set_mdc = sh_mdc_ctrl, .set_mdio_dir = sh_mmd_ctrl, [...] For the above 2 drivers: Acked-by: Sergei Shtylyov <sergei.shtyl...@cogentembedded.com> MBR, Sergei
Re: [PATCH v1 03/23] ata: sata_dwc_460ex: set dma_boundary to 0x1fff
Hello. On 04/21/2016 09:15 PM, Andy Shevchenko wrote: The original code states: Make sure a LLI block is not created that will span 8K max FIS boundary. If the block spans such a FIS boundary, there is a chance that a DMA burst will cross that boundary -- this results in an error in the host controller. Since we have switched to generic DMAengine API we satisfy above by setting dma_boundary value to 0x1fff. Suggested-by: Mans RullgardSigned-off-by: Andy Shevchenko --- drivers/ata/sata_dwc_460ex.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/ata/sata_dwc_460ex.c b/drivers/ata/sata_dwc_460ex.c index 7f95389..aee8873 100644 --- a/drivers/ata/sata_dwc_460ex.c +++ b/drivers/ata/sata_dwc_460ex.c @@ -1151,7 +1151,13 @@ static struct scsi_host_template sata_dwc_sht = { */ .sg_tablesize = LIBATA_MAX_PRD, /* .can_queue = ATA_MAX_QUEUE, */ - .dma_boundary = ATA_DMA_BOUNDARY, + /* +* Make sure a LLI block is not created that will span 8K max FIS +* boundary. If the block spans such a FIS boundary, there is a chance +* that a DMA burst will cross that boundary -- this results in an +* error in the host controller. +*/ + .dma_boundary = 0x1fff /* ATA_DMA_BOUNDARY */, Not ~0x1fff? [...] MBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH v2 32/32] virtio_ring: use virt_store_mb
Hello. On 12/31/2015 10:09 PM, Michael S. Tsirkin wrote: We need a full barrier after writing out event index, using virt_store_mb there seems better than open-coding. As usual, we need a wrapper to account for strong barriers. It's tempting to use this in vhost as well, for that, we'll need a variant of smp_store_mb that works on __user pointers. Signed-off-by: Michael S. Tsirkin--- include/linux/virtio_ring.h | 12 drivers/virtio/virtio_ring.c | 15 +-- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/include/linux/virtio_ring.h b/include/linux/virtio_ring.h index f3fa55b..3a74d91 100644 --- a/include/linux/virtio_ring.h +++ b/include/linux/virtio_ring.h @@ -45,6 +45,18 @@ static inline void virtio_wmb(bool weak_barriers) wmb(); } +static inline void virtio_store_mb(bool weak_barriers, + __virtio16 *p, __virtio16 v) +{ + if (weak_barriers) + virt_store_mb(*p, v); + else + { The kernel coding style dictates: if (weak_barriers) { virt_store_mb(*p, v); } else { + WRITE_ONCE(*p, v); + mb(); + } +} + [...] MBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH v2 47/48] usb: musb: gadget: add musb_match_ep() function
Hello. On 7/14/2015 12:39 PM, Robert Baldyga wrote: Add 'match_ep' callback to utilize chip-specific knowledge in endpoint matching process. Functions does the same that was done by chip-specific code inside of epautoconf. Now this code can be removed from there to separate generic code from platform specific logic. Signed-off-by: Robert Baldyga r.bald...@samsung.com [...] diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c index 043248a..5f1eb35 100644 --- a/drivers/usb/musb/musb_gadget.c +++ b/drivers/usb/musb/musb_gadget.c @@ -1684,6 +1684,49 @@ static int musb_gadget_pullup(struct usb_gadget *gadget, int is_on) return 0; } +#ifdef CONFIG_BLACKFIN +static struct usb_ep *musb_find_ep(struct usb_gadget *g, + const char *name) +{ + struct usb_ep *ep; + + list_for_each_entry(ep, g-ep_list, ep_list) { + if (0 == strcmp(ep-name, name)) Please make the immediate value the 2nd operand of ==. + return ep; + } + + return NULL; +} + +static struct usb_ep *match_match_ep(struct usb_gadget *g, + struct usb_endpoint_descriptor *desc, + struct usb_ss_ep_comp_descriptor *ep_comp) +{ + struct usb_ep *ep = NULL; + u8 type = usb_endpoint_type(desc); + + if ((USB_ENDPOINT_XFER_BULK == type) || + (USB_ENDPOINT_XFER_ISOC == type)) { Likewise. + if (USB_DIR_IN desc-bEndpointAddress) The same about . + ep = musb_find_ep(g, ep5in); + else + ep = musb_find_ep(g, ep6out); + } else if (USB_ENDPOINT_XFER_INT == type) { Likewise. + if (USB_DIR_IN desc-bEndpointAddress) + ep = musb_find_ep(g, ep1in); + else + ep = musb_find_ep(g, ep2out); + } This string of *if* statements is asking to be *switch* instead. [...] WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH v2 42/48] usb: gadget: epautoconf: use 'ep_match' gadget callback
Hello. On 7/14/2015 12:39 PM, Robert Baldyga wrote: If gadget has set 'ep_match' callback we prefer to call it first to allow UDC driver to find the best matching endpoint basing on chip-specific best usage knowledge. Signed-off-by: Robert Baldyga r.bald...@samsung.com --- drivers/usb/gadget/epautoconf.c | 6 ++ 1 file changed, 6 insertions(+) diff --git a/drivers/usb/gadget/epautoconf.c b/drivers/usb/gadget/epautoconf.c index ee0d4e6..92a1a4c 100644 --- a/drivers/usb/gadget/epautoconf.c +++ b/drivers/usb/gadget/epautoconf.c @@ -165,6 +165,12 @@ struct usb_ep *usb_ep_autoconfig_ss( type = desc-bmAttributes USB_ENDPOINT_XFERTYPE_MASK; + if (gadget-ops-match_ep) { + ep = gadget-ops-match_ep(gadget, desc, ep_comp); + if (ep) + goto found_ep; + } + I think this patch should be merged with the previous one. [...] WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH v2 45/48] usb: gadget: net2280: add net2280_match_ep() function
Hello. On 7/14/2015 12:39 PM, Robert Baldyga wrote: Add 'match_ep' callback to utilize chip-specific knowledge in endpoint matching process. Functions does the same that was done by chip-specific code inside of epautoconf. Now this code can be removed from there to separate generic code from platform specific logic. Signed-off-by: Robert Baldyga r.bald...@samsung.com [...] diff --git a/drivers/usb/gadget/udc/net2280.c b/drivers/usb/gadget/udc/net2280.c index 0295cf7..4933321 100644 --- a/drivers/usb/gadget/udc/net2280.c +++ b/drivers/usb/gadget/udc/net2280.c @@ -1533,6 +1533,49 @@ static int net2280_pullup(struct usb_gadget *_gadget, int is_on) return 0; } +static struct usb_ep *net2280_find_ep(struct usb_gadget *_gadget, + const char *name) Shouldn't this be a generic function as before? +{ + struct usb_ep *ep; + + list_for_each_entry(ep, _gadget-ep_list, ep_list) { + if (0 == strcmp(ep-name, name)) Please make 0 the 2nd operand to ==. + return ep; + } + + return NULL; +} [...] WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH v2 48/48] usb: gadget: epautoconf: cleanup dead code
Hello. On 7/14/2015 12:39 PM, Robert Baldyga wrote: Function find_ep() is no longer needed here, so we can remove it. We also don't use anything from gadget_chips.h header any longer. Signed-off-by: Robert Baldyga r.bald...@samsung.com --- drivers/usb/gadget/epautoconf.c | 14 -- 1 file changed, 14 deletions(-) diff --git a/drivers/usb/gadget/epautoconf.c b/drivers/usb/gadget/epautoconf.c index e9a8682..9a80925 100644 --- a/drivers/usb/gadget/epautoconf.c +++ b/drivers/usb/gadget/epautoconf.c @@ -20,20 +20,6 @@ #include linux/usb/ch9.h #include linux/usb/gadget.h -#include gadget_chips.h - -static struct usb_ep * -find_ep (struct usb_gadget *gadget, const char *name) -{ - struct usb_ep *ep; - - list_for_each_entry (ep, gadget-ep_list, ep_list) { - if (0 == strcmp (ep-name, name)) - return ep; - } - return NULL; -} - I don't think duplicating the function in each driver that needs it is better than turniong this function into public. WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 01/11] linux/time64.h:Introduce the 'struct itimerspec64' for 64bit
Hello. On 4/20/2015 8:57 AM, Baolin Wang wrote: This patch introduces the 'struct itimerspec64' for 64bit to replace itimerspec, and also introduces the conversion methods: itimerspec64_to_itimerspec() and itimerspec_to_itimerspec64(), that makes itimerspec to ready for 2038 year. To not needed here. Signed-off-by: Baolin Wang baolin.w...@linaro.org [...] WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 7/8] isdn: replace CONFIG_8xx by CONFIG_PPC_8xx
Hello. On 03/12/2015 06:24 PM, Christophe Leroy wrote: Two config options exist to define powerpc MPC8xx: * CONFIG_PPC_8xx * CONFIG_8xx In addition, CONFIG_PPC_8xx also defines CONFIG_CPM1 as communication co-processor arch/powerpc/platforms/Kconfig.cputype has contained the following comment about CONFIG_8xx item for some years: # this is temp to handle compat with arch=ppc It looks like not many places still have that old CONFIG_8xx used, so it is likely to be a good time to get rid of it completely ? Signed-off-by: Christophe Leroy christophe.le...@c-s.fr [...] diff --git a/drivers/isdn/hardware/mISDN/Kconfig b/drivers/isdn/hardware/mISDN/Kconfig index 09df54f..ad9deab 100644 --- a/drivers/isdn/hardware/mISDN/Kconfig +++ b/drivers/isdn/hardware/mISDN/Kconfig [...] @@ -28,7 +28,7 @@ config MISDN_HFCMULTI_8xx depends on MISDN depends on MISDN_HFCMULTI depends on 8xx Eh, how about this one? - default 8xx + default PPC_8xx help Enable support for the XHFC embedded solution from Speech Design. WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [RFC 02/11] i2c: add quirk checks to core
Hello. On 01/09/2015 08:21 PM, Wolfram Sang wrote: Let the core do the checks if HW quirks prevent a transfer. Saves code from drivers and adds consistency. Signed-off-by: Wolfram Sang w...@the-dreams.de --- drivers/i2c/i2c-core.c | 53 ++ 1 file changed, 53 insertions(+) diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index 39d25a8cb1ad..7b10a19abf5b 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c @@ -2063,6 +2063,56 @@ module_exit(i2c_exit); * */ +/* Check if val is exceeding the quirk IFF quirk is non 0 */ +#define i2c_quirk_exceeded(val, quirk) ((quirk) ((val) (quirk))) + +static int i2c_quirk_error(struct i2c_adapter *adap, struct i2c_msg *msg, char *err_msg) +{ + dev_err(adap-dev, quirk: %s (addr 0x%04x, size %u)\n, err_msg, msg-addr, msg-len); + return -EOPNOTSUPP; +} Always returning the same value doesn't make much sense. Are you trying to save space on the call sites? [...] @@ -2080,6 +2130,9 @@ int __i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num) unsigned long orig_jiffies; int ret, try; + if (adap-quirks i2c_check_for_quirks(adap, msgs, num)) So, you only check for non-zero result of this function? Perhaps it makes sense to return true/false instead? + return -EOPNOTSUPP; + WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [RFC 02/11] i2c: add quirk checks to core
Hello. On 01/09/2015 11:45 PM, Wolfram Sang wrote: Let the core do the checks if HW quirks prevent a transfer. Saves code from drivers and adds consistency. Signed-off-by: Wolfram Sang w...@the-dreams.de --- drivers/i2c/i2c-core.c | 53 ++ 1 file changed, 53 insertions(+) diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index 39d25a8cb1ad..7b10a19abf5b 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c @@ -2063,6 +2063,56 @@ module_exit(i2c_exit); * */ +/* Check if val is exceeding the quirk IFF quirk is non 0 */ +#define i2c_quirk_exceeded(val, quirk) ((quirk) ((val) (quirk))) + +static int i2c_quirk_error(struct i2c_adapter *adap, struct i2c_msg *msg, char *err_msg) +{ + dev_err(adap-dev, quirk: %s (addr 0x%04x, size %u)\n, err_msg, msg-addr, msg-len); + return -EOPNOTSUPP; +} Always returning the same value doesn't make much sense. Are you trying to save space on the call sites? Please elaborate. I think it does. If a quirk matches, we report that we don't support this transfer. OK, but what's the point of having this function return *int* if it always returns the same value? AFAIU, you're trying to save the code space on the call sites of this function by not having *return* -EOPNOTSUPP there each time? [...] @@ -2080,6 +2130,9 @@ int __i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num) unsigned long orig_jiffies; int ret, try; + if (adap-quirks i2c_check_for_quirks(adap, msgs, num)) So, you only check for non-zero result of this function? Perhaps it makes sense to return true/false instead? Could be done, but what would be the advantage? A lot of functions return errno or 0. It would have been OK if you were actually caring about the result, e.g. returning it from __i2c_transfer(). Since you don't, IMO it would make more sense to return true from i2c_check_for_quirks() (making it *bool*) iff it did find/apply a quirk. WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH v1 09/21] Irq_remapping/MSI: Use MSI chip framework to configure MSI/MSI-X irq
Hello. On 9/5/2014 2:09 PM, Yijing Wang wrote: Use MSI chip framework instead of arch MSI functions to configure MSI/MSI-X irq. So we can manage MSI/MSI-X irq in a unified framework. Signed-off-by: Yijing Wang wangyij...@huawei.com --- drivers/iommu/irq_remapping.c |8 +++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/drivers/iommu/irq_remapping.c b/drivers/iommu/irq_remapping.c index 33c4395..e75026e 100644 --- a/drivers/iommu/irq_remapping.c +++ b/drivers/iommu/irq_remapping.c [...] @@ -165,9 +170,10 @@ static void __init irq_remapping_modify_x86_ops(void) x86_io_apic_ops.set_affinity= set_remapped_irq_affinity; x86_io_apic_ops.setup_entry = setup_ioapic_remapped_entry; x86_io_apic_ops.eoi_ioapic_pin = eoi_ioapic_pin_remapped; - x86_msi.setup_msi_irqs = irq_remapping_setup_msi_irqs; + x86_msi.setup_msi_irqs = irq_remapping_setup_msi_irqs; AFAICS, this change only converts tabs to spaces, so not needed at all. x86_msi.setup_hpet_msi = setup_hpet_msi_remapped; x86_msi.compose_msi_msg = compose_remapped_msi_msg; + x86_msi_chip = remap_msi_chip; Please align = with the rest of assignments. WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH v1 15/21] Powerpc/MSI: Use MSI chip framework to configure MSI/MSI-X irq
Hello. On 9/5/2014 2:10 PM, Yijing Wang wrote: Use MSI chip framework instead of arch MSI functions to configure MSI/MSI-X irq. So we can manage MSI/MSI-X irq in a unified framework. Signed-off-by: Yijing Wang wangyij...@huawei.com --- arch/powerpc/kernel/msi.c | 14 -- 1 files changed, 12 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/msi.c b/arch/powerpc/kernel/msi.c index 71bd161..01781a4 100644 --- a/arch/powerpc/kernel/msi.c +++ b/arch/powerpc/kernel/msi.c [...] @@ -27,7 +27,17 @@ int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) return ppc_md.setup_msi_irqs(dev, nvec, type); } -void arch_teardown_msi_irqs(struct pci_dev *dev) +static void ppc_teardown_msi_irqs(struct pci_dev *dev) Shouldn't this function take IRQ # instead? { ppc_md.teardown_msi_irqs(dev); } + +static struct msi_chip ppc_msi_chip = { + .setup_irqs = ppc_setup_msi_irqs, + .teardown_irqs = ppc_teardown_msi_irqs, +}; + +struct msi_chip *arch_find_msi_chip(struct pci_dev *dev) +{ + return ppc_msi_chip; +} WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH v1 15/21] Powerpc/MSI: Use MSI chip framework to configure MSI/MSI-X irq
On 9/5/2014 3:33 PM, wangyijing wrote: Use MSI chip framework instead of arch MSI functions to configure MSI/MSI-X irq. So we can manage MSI/MSI-X irq in a unified framework. Signed-off-by: Yijing Wang wangyij...@huawei.com --- arch/powerpc/kernel/msi.c | 14 -- 1 files changed, 12 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/msi.c b/arch/powerpc/kernel/msi.c index 71bd161..01781a4 100644 --- a/arch/powerpc/kernel/msi.c +++ b/arch/powerpc/kernel/msi.c [...] @@ -27,7 +27,17 @@ int arch_setup_msi_irqs(struct pci_dev *dev, int nvec, int type) return ppc_md.setup_msi_irqs(dev, nvec, type); } -void arch_teardown_msi_irqs(struct pci_dev *dev) +static void ppc_teardown_msi_irqs(struct pci_dev *dev) Shouldn't this function take IRQ # instead? This function need to teardown all msi irqs of the pci dev, we should pass the pci dev as argument . Ah, I've mixed up the teardown_irqs() method with teardown_irq()! Too similar. :-) Thanks! Yijing. WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [RFC PATCH 6/6] rtc: rtc-isl12057: Change vendor prefix for Intersil Corporation to isil
Hello. On 8/20/2014 12:43 PM, Philipp Zabel wrote: Currently there is a wild mixture of isl, isil, and intersil compatibles in the kernel. At this point, changing the vendor symbol to the most often used variant, which is equal to the NASDAQ symbol, isil, should not hurt, since the isl1208 driver doesn't care either way. Patch 70e123373c05 added this driver with device tree support Please also specify that commit's summary line in parens. using the then documented isl vendor prefix, so we keep that around for backwards compatibility. Signed-off-by: Philipp Zabel p.za...@pengutronix.de WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH v2 1/7] memory-hotplug: add zone_for_memory() for selecting zone for new memory
Hello. On 07/21/2014 07:46 AM, Wang Nan wrote: Some grammar nitpicking. This patch introduces a zone_for_memory function in arch independent code for arch_add_memory() using. s/ using/'s use/. Many arch_add_memory() function simply selects ZONE_HIGHMEM or Plural needed with many. ZONE_NORMAL and add new memory into it. However, with the existance of ZONE_MOVABLE, the selection method should be carefully considered: if new, higher memory is added after ZONE_MOVABLE is setup, the default zone and ZONE_MOVABLE may overlap each other. should_add_memory_movable() checks the status of ZONE_MOVABLE. If it has already contain memory, compare the address of new memory and movable memory. If new memory is higher than movable, it should be added into ZONE_MOVABLE instead of default zone. Signed-off-by: Wang Nan wangn...@huawei.com Cc: Zhang Yanfei zhangyan...@cn.fujitsu.com Cc: Dave Hansen dave.han...@intel.com [...] diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c index 469bbf5..348fda7 100644 --- a/mm/memory_hotplug.c +++ b/mm/memory_hotplug.c @@ -1156,6 +1156,34 @@ static int check_hotplug_memory_range(u64 start, u64 size) return 0; } +/* + * If movable zone has already been setup, newly added memory should be check. Checked. WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 2/2] powerpc: bpf: Fix the broken LD_VLAN_TAG_PRESENT test
Hello. On 06/24/2014 01:59 PM, Denis Kirjanov wrote: We have to return the boolean here if the tag presents or not, not jusr ORing the TCI with the mask which results to: [ 709.412097] test_bpf: #18 LD_VLAN_TAG_PRESENT [ 709.412245] ret 4096 != 1 [ 709.412332] ret 4096 != 1 [ 709.412333] FAIL (2 times) You need to sign off on the patch, else it won't be applied. --- arch/powerpc/net/bpf_jit_comp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/net/bpf_jit_comp.c b/arch/powerpc/net/bpf_jit_comp.c index af0ed4d..a3d8f58 100644 --- a/arch/powerpc/net/bpf_jit_comp.c +++ b/arch/powerpc/net/bpf_jit_comp.c @@ -394,8 +394,10 @@ static int bpf_jit_build_body(struct sk_filter *fp, u32 *image, vlan_tci)); if (code == (BPF_ANC | SKF_AD_VLAN_TAG)) PPC_ANDI(r_A, r_A, ~VLAN_TAG_PRESENT); - else + else { All arms of the *if* statement should have {} if one branch has {}. PPC_ANDI(r_A, r_A, VLAN_TAG_PRESENT); + PPC_SRWI(r_A, r_A, 12); + } break; case BPF_ANC | SKF_AD_QUEUE: BUILD_BUG_ON(FIELD_SIZEOF(struct sk_buff, WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH RESEND net-next 4/9] net: systemport: use the new fixed PHY helpers
Hello. On 05/22/2014 02:02 AM, Florian Fainelli wrote: of_phy_connect_fixed_link() is becoming obsolete, and also required platform code to register the fixed PHYs at the specified addresses for those to be usable. Get rid of it and use the new of_phy_is_fixed_link() plus of_phy_register_fixed_link() helpers to transition over the new scheme. Signed-off-by: Florian Fainelli f.faine...@gmail.com --- drivers/net/ethernet/broadcom/bcmsysport.c | 17 +++-- drivers/net/ethernet/broadcom/bcmsysport.h | 1 + 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c index d40c5b969e9e..dc708a888f80 100644 --- a/drivers/net/ethernet/broadcom/bcmsysport.c +++ b/drivers/net/ethernet/broadcom/bcmsysport.c @@ -1327,8 +1327,8 @@ static int bcm_sysport_open(struct net_device *dev) /* Read CRC forward */ priv-crc_fwd = !!(umac_readl(priv, UMAC_CMD) CMD_CRC_FWD); - priv-phydev = of_phy_connect_fixed_link(dev, bcm_sysport_adj_link, - priv-phy_interface); + priv-phydev = of_phy_connect(dev, priv-phy_dn, bcm_sysport_adj_link, + 0, priv-phy_interface); The continuation line should start on the next character after ( on the above line, according to the networking coding style. Unless I am once again not following the coding style, the patch in patchwork has this correctly, and so does my file locally: http://patchwork.ozlabs.org/patch/351323/ Don't know about your local file but the patchwork still has the indentation wrong. -- you've used only tabs while the last several characters should have been spaces. However, if David himself finds it correct, I guess I just need to shut up. :-) WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH RESEND net-next 1/9] Documentation: devicetree: add old and deprecated 'fixed-link'
Hello. On 05/22/2014 01:38 AM, Florian Fainelli wrote: Update the fixed-link Device Tree binding documentation to contain information about the old and deprecated 5-digit 'fixed-link' property. Signed-off-by: Florian Fainelli f.faine...@gmail.com --- Documentation/devicetree/bindings/net/fixed-link.txt | 12 1 file changed, 12 insertions(+) diff --git a/Documentation/devicetree/bindings/net/fixed-link.txt b/Documentation/devicetree/bindings/net/fixed-link.txt index e956de1be935..34a991eb213f 100644 --- a/Documentation/devicetree/bindings/net/fixed-link.txt +++ b/Documentation/devicetree/bindings/net/fixed-link.txt @@ -18,6 +18,18 @@ properties: * 'asym-pause' (boolean, optional), to indicate that asym_pause should be enabled. +Old, deprecated 'fixed-link' binding: + +* A 'fixed-link' property in the EThernet MAC node, with 5 cells, of the s/EThernet/Ethernet/ + form a b c d e with the following accepted values: + - a: emulated phy id, choose any but but unique to the all specified s/phy id/PHY ID/ +fixed-links, from 0 to 31 + - b: duplex configuration: 0 for half duplex, 1 for full duplex + - c: link speed in Mbits/sec, accepted values are: 10, 100 and 1000 + - d: pause configuration: 0 for no pause, 1 for pause + - e: asymetric pause configuration: 0 for no asymetric pause, 1 for asymetric Asymmetric. WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH RESEND net-next 4/9] net: systemport: use the new fixed PHY helpers
On 05/22/2014 01:38 AM, Florian Fainelli wrote: of_phy_connect_fixed_link() is becoming obsolete, and also required platform code to register the fixed PHYs at the specified addresses for those to be usable. Get rid of it and use the new of_phy_is_fixed_link() plus of_phy_register_fixed_link() helpers to transition over the new scheme. Signed-off-by: Florian Fainelli f.faine...@gmail.com --- drivers/net/ethernet/broadcom/bcmsysport.c | 17 +++-- drivers/net/ethernet/broadcom/bcmsysport.h | 1 + 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c index d40c5b969e9e..dc708a888f80 100644 --- a/drivers/net/ethernet/broadcom/bcmsysport.c +++ b/drivers/net/ethernet/broadcom/bcmsysport.c @@ -1327,8 +1327,8 @@ static int bcm_sysport_open(struct net_device *dev) /* Read CRC forward */ priv-crc_fwd = !!(umac_readl(priv, UMAC_CMD) CMD_CRC_FWD); - priv-phydev = of_phy_connect_fixed_link(dev, bcm_sysport_adj_link, - priv-phy_interface); + priv-phydev = of_phy_connect(dev, priv-phy_dn, bcm_sysport_adj_link, + 0, priv-phy_interface); The continuation line should start on the next character after ( on the above line, according to the networking coding style. [...] WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH RESEND net-next 5/9] fs_enet: use the new fixed PHY helpers
On 05/22/2014 01:38 AM, Florian Fainelli wrote: of_phy_connect_fixed_link() is becoming obsolete, and also required platform code to register the fixed PHYs at the specified addresses for those to be usable. Get rid of it and use the new of_phy_is_fixed_link() plus of_phy_register_fixed_link() helpers to transition over the new scheme. Signed-off-by: Florian Fainelli f.faine...@gmail.com --- drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c | 16 +--- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c b/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c index dc80db41d6b3..d602711e00e9 100644 --- a/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c +++ b/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c [...] @@ -1029,9 +1025,15 @@ static int fs_enet_probe(struct platform_device *ofdev) fpi-use_napi = 1; fpi-napi_weight = 17; fpi-phy_node = of_parse_phandle(ofdev-dev.of_node, phy-handle, 0); - if ((!fpi-phy_node) (!of_get_property(ofdev-dev.of_node, fixed-link, - NULL))) - goto out_free_fpi; + if (!fpi-phy_node) { + if (of_phy_is_fixed_link(ofdev-dev.of_node)) { These two *if* statements could be collapsed, reducing the indentation level below. + err = of_phy_register_fixed_link(ofdev-dev.of_node); + if (err) + goto out_free_fpi; + + fpi-phy_node = ofdev-dev.of_node; + } + } WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH] phy/at8031: enable at8031 to work on interrupt mode
Hello. On 03/28/2014 10:36 AM, qiang.z...@freescale.com wrote: The at8031 can work on polling mode and interrupt mode. Add ack_interrupt and config intr funcs to enable interrupt mode for it. Signed-off-by: Zhao Qiang b45...@freescale.com --- drivers/net/phy/at803x.c | 30 ++ 1 file changed, 30 insertions(+) diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c index bc71947..d034ef5 100644 --- a/drivers/net/phy/at803x.c +++ b/drivers/net/phy/at803x.c [...] @@ -191,6 +194,31 @@ static int at803x_config_init(struct phy_device *phydev) return 0; } +static int at803x_ack_interrupt(struct phy_device *phydev) { + int err; + + err = phy_read(phydev, AT803X_INSR); Could make this an initializer... Thank you very much. However I have no idea about make this an initializer. int err = phy_read(phydev, AT803X_INSR); WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH] phy/at8031: enable at8031 to work on interrupt mode
Hello. On 27-03-2014 10:18, Zhao Qiang wrote: The at8031 can work on polling mode and interrupt mode. Add ack_interrupt and config intr funcs to enable interrupt mode for it. Signed-off-by: Zhao Qiang b45...@freescale.com --- drivers/net/phy/at803x.c | 30 ++ 1 file changed, 30 insertions(+) diff --git a/drivers/net/phy/at803x.c b/drivers/net/phy/at803x.c index bc71947..d034ef5 100644 --- a/drivers/net/phy/at803x.c +++ b/drivers/net/phy/at803x.c [...] @@ -191,6 +194,31 @@ static int at803x_config_init(struct phy_device *phydev) return 0; } +static int at803x_ack_interrupt(struct phy_device *phydev) +{ + int err; + + err = phy_read(phydev, AT803X_INSR); Could make this an initializer... + + return (err 0) ? err : 0; +} + +static int at803x_config_intr(struct phy_device *phydev) +{ + int err; + int value; + + value = phy_read(phydev, AT803X_INER); + + if (phydev-interrupts == PHY_INTERRUPT_ENABLED) + err = phy_write(phydev, AT803X_INER, + (value | AT803X_INER_INIT)); Inner parens not needed. + else + err = phy_write(phydev, AT803X_INER, value); Why are you not clearing the bits here? Why write back what has been read at all? WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 4/8] IBM Akebono: Add support to the OHCI platform driver for PPC476GTR
Hello. On 11/22/2013 05:08 AM, Alistair Popple wrote: The IBM Akebono board uses the PPC476GTR SoC which has a OHCI compliant USB host interface. This patch adds support for it to the OHCI platform driver. As we use device tree to pass platform specific data instead of platform data we remove the check for platform data and instead provide reasonable defaults if no platform data is present. This is similar to what is currently done in ehci-platform.c. Signed-off-by: Alistair Popple alist...@popple.id.au Acked-by: Alan Stern st...@rowland.harvard.edu Cc: linux-...@vger.kernel.org Greg, why this patch hasn't been merged? Because it wasn't addressed to you (but BenH)? The other, ehci-platform.c patch didn't even get posted to linux-usb that time, but this one? WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH v3 0/7] net: use platform_{get,set}_drvdata()
Hello. On 08/16/2013 02:39 AM, David Miller wrote: From: Libo Chen clbchenlibo.c...@huawei.com Date: Thu, 15 Aug 2013 21:01:17 +0800 Use the wrapper functions for getting and setting the driver data using platform_device instead of using dev_{get,set}_drvdata() with pdev-dev, so we can directly pass a struct platform_device. changelog v3: remove modify about dev_set_drvdata() changelog v2: this version add modify record about dev_set_drvdata(). Series applied. Actually, I had to revert, these patches break the build. drivers/net/ethernet/sun/sunhme.c: In function ‘happy_meal_pci_probe’: drivers/net/ethernet/sun/sunhme.c:3114:2: error: implicit declaration of function ‘platform_set_drvdata’ [-Werror=implicit-function-declaration] drivers/net/ethernet/sun/sunhme.c: In function ‘happy_meal_pci_remove’: drivers/net/ethernet/sun/sunhme.c:3162:9: error: implicit declaration of function ‘platform_get_drvdata’ [-Werror=implicit-function-declaration] drivers/net/ethernet/sun/sunhme.c:3162:26: warning: initialization makes pointer from integer without a cast [enabled by default] Hm, patch #5 was clearly defective as it tried to call platform_{get|set}_drvdata() on PCI devices -- I've read the patch but overlooked that. And the driver lacks #include linux/platform_device.h, so I'm not sure it always compiled flawlessly. WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH v3 0/7] net: use platform_{get,set}_drvdata()
On 08/16/2013 02:51 AM, Sergei Shtylyov wrote: From: Libo Chen clbchenlibo.c...@huawei.com Date: Thu, 15 Aug 2013 21:01:17 +0800 Use the wrapper functions for getting and setting the driver data using platform_device instead of using dev_{get,set}_drvdata() with pdev-dev, so we can directly pass a struct platform_device. changelog v3: remove modify about dev_set_drvdata() changelog v2: this version add modify record about dev_set_drvdata(). Series applied. Actually, I had to revert, these patches break the build. drivers/net/ethernet/sun/sunhme.c: In function ‘happy_meal_pci_probe’: drivers/net/ethernet/sun/sunhme.c:3114:2: error: implicit declaration of function ‘platform_set_drvdata’ [-Werror=implicit-function-declaration] drivers/net/ethernet/sun/sunhme.c: In function ‘happy_meal_pci_remove’: drivers/net/ethernet/sun/sunhme.c:3162:9: error: implicit declaration of function ‘platform_get_drvdata’ [-Werror=implicit-function-declaration] drivers/net/ethernet/sun/sunhme.c:3162:26: warning: initialization makes pointer from integer without a cast [enabled by default] Hm, patch #5 was clearly defective as it tried to call platform_{get|set}_drvdata() on PCI devices -- I've read the patch but overlooked that. And the driver lacks #include linux/platform_device.h, so I'm not sure it always compiled flawlessly. Ah, the platform code is protected by #ifdef CONFIG_SBUS... probably some header #include's linux/platform_device.h? WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH RESEND 0/8] use platform_{get,set}_drvdata()
On 08/14/2013 07:36 AM, Libo Chen wrote: We can use the wrapper functions platform_{get,set}_drvdata() instead of dev_{get,set}_drvdata() with pdev-dev, it is convenient for user. Also, unnecessary dev_set_drvdata() is removed, because the driver core clears the driver data to NULL after device_release or on probe failure. Saying also in the changelog is usually a good sign that the patch should be split. WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 4/8] net: fs_enet: use platform_{get,set}_drvdata()
On 08/12/2013 05:24 PM, Libo Chen wrote: Use the wrapper functions for getting and setting the driver data using platform_device instead of using dev_{get,set}_drvdata() with pdev-dev, so we can directly pass a struct platform_device. Signed-off-by: Libo Chen libo.c...@huawei.com --- .../net/ethernet/freescale/fs_enet/fs_enet-main.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c b/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c index 8de53a1..7e3de10 100644 --- a/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c +++ b/drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c @@ -1122,7 +1122,6 @@ static int fs_enet_remove(struct platform_device *ofdev) fep-ops-free_bd(ndev); fep-ops-cleanup_data(ndev); - dev_set_drvdata(fep-dev, NULL); of_node_put(fep-fpi-phy_node); free_netdev(ndev); return 0; Changelog simply doesn't match the patch. WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 07/45] CPU hotplug: Expose the new debug config option
Hello. On 23-06-2013 17:39, Srivatsa S. Bhat wrote: Now that we have all the pieces of the CPU hotplug debug infrastructure in place, expose the feature by growing a new Kconfig option, CONFIG_DEBUG_HOTPLUG_CPU. Cc: Andrew Morton a...@linux-foundation.org Cc: Paul E. McKenney paul.mcken...@linaro.org Cc: Akinobu Mita akinobu.m...@gmail.com Cc: Catalin Marinas catalin.mari...@arm.com Cc: Michel Lespinasse wal...@google.com Signed-off-by: Srivatsa S. Bhat srivatsa.b...@linux.vnet.ibm.com --- lib/Kconfig.debug |9 + 1 file changed, 9 insertions(+) diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 566cf2b..6be1e72 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -512,6 +512,15 @@ config DEBUG_PREEMPT if kernel code uses it in a preemption-unsafe way. Also, the kernel will detect preemption count underflows. +config DEBUG_HOTPLUG_CPU + bool Debug CPU hotplug + depends on HOTPLUG_CPU + default n It's the default default, no need to specify it. WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 2/2] Revert nohz: Fix idle ticks in cpu summary line of /proc/stat (commit 7386cdbf2f57ea8cff3c9fde93f206e58b9fe13f).
Hello. On 04-01-2013 6:58, Srivatsa Vaddagiri wrote: With offline cpus no longer beeing seen in nohz mode (ts-idle_active=0), we don't need the check for cpu_online() introduced in commit 7386cdbf. Offline Please also specify the summary of that commit in parens (or however you like). cpu's idle time as last recorded in its ts-idle_sleeptime will be reported (thus excluding its offline time as part of idle time statistics). Cc: mho...@suse.cz Cc: srivatsa.b...@linux.vnet.ibm.com Signed-off-by: Srivatsa Vaddagiri va...@codeaurora.org WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 2/2] Revert nohz: Fix idle ticks in cpu summary line of /proc/stat (commit 7386cdbf2f57ea8cff3c9fde93f206e58b9fe13f).
Hello. On 01/04/2013 10:29 PM, Srivatsa Vaddagiri wrote: With offline cpus no longer beeing seen in nohz mode (ts-idle_active=0), we don't need the check for cpu_online() introduced in commit 7386cdbf. Offline Please also specify the summary of that commit in parens (or however you like). I had that in Subject line, but yes would be good to include in commit message as well. I will incorporate that change alongwith anything else required in next version of this patch. Ah, that was a revert with atypical subject -- didn't notice. Then there's no need to specify it twice. - vatsa WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH][v3] sata_fsl: add workaround for data length mismatch on freescale V2 controller
Hello. On 10-09-2012 6:53, Xie Shaohui-B21989 wrote: + /* Workaround for data length mismatch errata */ + if (unlikely(hstatus INT_ON_DATA_LENGTH_MISMATCH)) { + for (tag = 0; tag ATA_MAX_QUEUE; tag++) { + qc = ata_qc_from_tag(ap, tag); + if (qc ata_is_atapi(qc-tf.protocol)) { + u32 hcontrol; +#define HCONTROL_CLEAR_ERROR (1 27) shouldn't we have this #define be part of the enum that the other HCONTROL_ bits/flags are part of? [S.H] do you mean this? Apparently not. He said *enum*, not #define. #ifdef SATA_FSL_XXX_ERRATUAM We don't need that at all. #define HCONTROL_CLEAR_ERROR(1 27) #endif MBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH] [v2] sata_fsl: add workaround for data length mismatch on freescale V2 controller
Hello. On 06-09-2012 8:28, Shaohui Xie wrote: The freescale V2 SATA controller checks if the received data length matches the programmed length 'ttl', if not, it assumes that this is an error. In ATAPI, the 'ttl' is based on max allocation length and not the actual data transfer length, controller will raise 'DLM' (Data length Mismatch) error bit in Hstatus register. Along with 'DLM', DE (Device error) and FE (fatal Error) bits are also set in Hstatus register, 'E' (Internal Error) bit is set in Serror register and CE (Command Error) and DE (Device error) registers have the corresponding bit set. In this condition, we need to clear errors in following way: in the service routine, based on 'DLM' flag, HCONTROL[27] operation clears Hstatus, CE and DE registers, clear Serror register. Signed-off-by: Shaohui Xie shaohui@freescale.com Signed-off-by: Anju Bhartiya anju.bhart...@freescale.com --- changes for V2: 1. remove the using of quirk; 2. wrap errata codes in condition; drivers/ata/sata_fsl.c | 40 +++- 1 files changed, 35 insertions(+), 5 deletions(-) diff --git a/drivers/ata/sata_fsl.c b/drivers/ata/sata_fsl.c index d6577b9..6b7b73e 100644 --- a/drivers/ata/sata_fsl.c +++ b/drivers/ata/sata_fsl.c [...] @@ -1180,26 +1181,55 @@ static void sata_fsl_host_intr(struct ata_port *ap) void __iomem *hcr_base = host_priv-hcr_base; u32 hstatus, done_mask = 0; struct ata_queued_cmd *qc; - u32 SError; + u32 SError, tag; + u32 status_mask = INT_ON_ERROR; hstatus = ioread32(hcr_base + HSTATUS); sata_fsl_scr_read(ap-link, SCR_ERROR, SError); + /* Read command completed register */ + done_mask = ioread32(hcr_base + CC); + + /* Workaround for data length mismatch errata */ + if (unlikely(hstatus INT_ON_DATA_LENGTH_MISMATCH)) { + for (tag = 0; tag ATA_MAX_QUEUE; tag++) { + qc = ata_qc_from_tag(ap, tag); + if (qc ata_is_atapi(qc-tf.protocol)) { + u32 Hcontrol; No uppercase in variable names please. Besides, you have 'hstatus' variable already and that would be inconsistent. +#define HCONTROL_CLEAR_ERROR (1 27) + /* Set HControl[27] to clear error registers */ + Hcontrol = ioread32(hcr_base + HCONTROL); + iowrite32(Hcontrol | HCONTROL_CLEAR_ERROR, + hcr_base + HCONTROL); + + /* Clear HControl[27] */ + iowrite32(Hcontrol (~HCONTROL_CLEAR_ERROR), Parens not needed around ~HCONTROL_CLEAR_ERROR. + hcr_base + HCONTROL); MBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH] MIPS: fix bug.h MIPS build regression
Hello. On 20-06-2012 10:27, Yoichi Yuasa wrote: Commit: 3777808873b0c49c5cf27e44c948dfb02675d578 Please also specify the summary of that commit in parens. breaks all MIPS builds. [...] Signed-off-by: Yoichi Yuasayu...@linux-mips.org WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [RFC PATCH] sched/numa: do load balance between remote nodes
Hello. On 06-06-2012 10:52, Alex Shi wrote: commit cb83b629b Please also specify that commit's summary in parens. remove the NODE sched domain and check if the node distance in SLIT table is farther than REMOTE_DISTANCE, if so, it will lose the load balance chance at exec/fork/wake_affine points. But actually, even the node distance is farther than REMOTE_DISTANCE, Modern CPUs also has QPI like connections, that make memory access is Is not needed here. not too slow between nodes. So above losing on NUMA machine make a huge performance regression on benchmark: hackbench, tbench, netperf and oltp etc. This patch will recover the scheduler behavior to old mode on all my Intel platforms: NHM EP/EX, WSM EP, SNB EP/EP4S, and so remove the perfromance regressions. (all of them just has 2 kinds distance, 10 21) Signed-off-by: Alex Shialex@intel.com WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 1/7] Add support hardreset
Hello. On 17-04-2012 12:43, Thang Q. Nguyen wrote: The hardreset operation is currently not supported. This causes sometime the SATA driver does cause kernel crash because of none-determined state.a This patch will fix the issue. Signed-off-by: Thang Q. Nguyentqngu...@apm.com --- drivers/ata/sata_dwc_460ex.c | 24 +++- 1 files changed, 23 insertions(+), 1 deletions(-) diff --git a/drivers/ata/sata_dwc_460ex.c b/drivers/ata/sata_dwc_460ex.c index 69f7cde..ae13ef1 100644 --- a/drivers/ata/sata_dwc_460ex.c +++ b/drivers/ata/sata_dwc_460ex.c @@ -1581,10 +1581,31 @@ static void sata_dwc_qc_prep(struct ata_queued_cmd *qc) static void sata_dwc_error_handler(struct ata_port *ap) { - ap-link.flags |= ATA_LFLAG_NO_HRST; ata_sff_error_handler(ap); } Could eliminate this, switching to the default implementation... MBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 1/1] Add support 2 SATA ports for Maui and change filename from sata_dwc_460ex.c to sata_dwc_4xx.c
Hello. On 10-04-2012 7:46, Thang Nguyen wrote: Hi Sergei, Thanks for your review. On Maui, there are 2 separate SATA controllers but they share the same AHBDMA controller. Each SATA controller is assigned a fixed DMA channel on the AHBDMA (channel 0 is assigned to SATA controller 0 and channel 1 is assigned to SATA controller 1). For the 460EX, there is only 1 SATA controller and it uses channel 0 for transferring data. In my opinion, in the case of Maui, we can use the same DMA information in 2 device nodes as they use the same DMA controller. And in another CPU, if they use different DMA controller, the corresponding information will also be different. No, either the DMA controller should be a separate device node, or both ports and DMA controller should be packed into the single device node. The way you're doing it is incorrect because it creates memory resource conflict between devices when they are instantiated as platfrom devices. Regards, Thang Nguyen - -Original Message- From: Sergei Shtylyov [mailto:sshtyl...@mvista.com] Sent: Monday, April 09, 2012 5:13 PM To: Thang Q. Nguyen Cc: Benjamin Herrenschmidt; Paul Mackerras; Jeff Garzik; Grant Likely; Rob Herring; linuxppc-dev@lists.ozlabs.org; linux-ker...@vger.kernel.org; linux-...@vger.kernel.org; devicetree-disc...@lists.ozlabs.org Subject: Re: [PATCH 1/1] Add support 2 SATA ports for Maui and change filename from sata_dwc_460ex.c to sata_dwc_4xx.c Hello. On 03-04-2012 14:12, Thang Q. Nguyen wrote: Signed-off-by: Thang Q. Nguyentqngu...@apm.com [...] diff --git a/arch/powerpc/boot/dts/bluestone.dts b/arch/powerpc/boot/dts/bluestone.dts index cfa23bf..803fda6 100644 --- a/arch/powerpc/boot/dts/bluestone.dts +++ b/arch/powerpc/boot/dts/bluestone.dts @@ -155,6 +155,27 @@ /*RXDE*/ 0x5 0x4; }; + /* SATA DWC devices */ + SATA0: sata@bffd1000 { + compatible = amcc,sata-apm821xx; + reg =4 0xbffd1000 0x800 /* SATA0 */ + 4 0xbffd0800 0x400; /* AHBDMA */ + dma-channel=0; + interrupt-parent =UIC0; + interrupts =26 4/* SATA0 */ + 25 4; /* AHBDMA */ + }; + + SATA1: sata@bffd1800 { + compatible = amcc,sata-apm821xx; + reg =4 0xbffd1800 0x800 /* SATA1 */ + 4 0xbffd0800 0x400; /* AHBDMA */ + dma-channel=1; + interrupt-parent =UIC0; + interrupts =27 4/* SATA1 */ + 25 4; /* AHBDMA */ + }; + So, this is dual SATA controller, not dual port SATA controller? BTW, it's wrong to have the same AHBDMA resource in two device nodes I think. MBR, Sergei Can you get rid of the following? It looks stupid when you post to the maliing list. CONFIDENTIALITY NOTICE: This e-mail message, including any attachments, is for the sole use of the intended recipient(s) and contains information that is confidential and proprietary to AppliedMicro Corporation or its subsidiaries. It is to be used solely for the purpose of furthering the parties' business relationship. All unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply e-mail and destroy all copies of the original message. WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 1/1] Add support 2 SATA ports for Maui and change filename from sata_dwc_460ex.c to sata_dwc_4xx.c
Hello. On 03-04-2012 14:12, Thang Q. Nguyen wrote: Signed-off-by: Thang Q. Nguyentqngu...@apm.com [...] diff --git a/arch/powerpc/boot/dts/bluestone.dts b/arch/powerpc/boot/dts/bluestone.dts index cfa23bf..803fda6 100644 --- a/arch/powerpc/boot/dts/bluestone.dts +++ b/arch/powerpc/boot/dts/bluestone.dts @@ -155,6 +155,27 @@ /*RXDE*/ 0x5 0x4; }; + /* SATA DWC devices */ + SATA0: sata@bffd1000 { + compatible = amcc,sata-apm821xx; + reg =4 0xbffd1000 0x800 /* SATA0 */ + 4 0xbffd0800 0x400; /* AHBDMA */ + dma-channel=0; + interrupt-parent =UIC0; + interrupts =26 4/* SATA0 */ + 25 4; /* AHBDMA */ + }; + + SATA1: sata@bffd1800 { + compatible = amcc,sata-apm821xx; + reg =4 0xbffd1800 0x800 /* SATA1 */ + 4 0xbffd0800 0x400; /* AHBDMA */ + dma-channel=1; + interrupt-parent =UIC0; + interrupts =27 4/* SATA1 */ + 25 4; /* AHBDMA */ + }; + So, this is dual SATA controller, not dual port SATA controller? BTW, it's wrong to have the same AHBDMA resource in two device nodes I think. MBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 1/1] [v3] Add support 2 SATA ports for Maui and change filename from sata_dwc_460ex.c to sata_dwc_4xx.c
Hello. On 06-04-2012 9:31, Thang Q. Nguyen wrote: Signed-off-by: Thang Q. Nguyentqngu...@apm.com [...] diff --git a/drivers/ata/sata_dwc_460ex.c b/drivers/ata/sata_dwc_4xx.c similarity index 73% rename from drivers/ata/sata_dwc_460ex.c rename to drivers/ata/sata_dwc_4xx.c index 69f7cde..07e9b36 100644 --- a/drivers/ata/sata_dwc_460ex.c +++ b/drivers/ata/sata_dwc_4xx.c [...] @@ -268,22 +276,25 @@ enum { 16) struct sata_dwc_device { struct device *dev; /* generic device struct */ - struct ata_probe_ent*pe;/* ptr to probe-ent */ struct ata_host *host; u8 *reg_base; struct sata_dwc_regs*sata_dwc_regs; /* DW Synopsys SATA specific */ int irq_dma; + u8 *scr_base; Why not 'void __iomem *scr_base'? You have to cast to it anyway everytime. And 'u8 *' is just not the right type. + int dma_channel;/* DWC SATA DMA channel */ + int hostID; }; хюююъ +/* This is used for easier trace back when having DMA channel */ +static struct sata_dwc_device *dwc_dev_list[DMA_NUM_CHANS]; I don't quite understand: isn't this dual channel device? But you declare a device per DMA channel... +/* + * As we have only one DMA controller, this will be set static and global + * for easier to access to not needed here. @@ -372,15 +381,15 @@ static const char *get_dma_dir_descript(int dma_dir) } } -static void sata_dwc_tf_dump(struct ata_taskfile *tf) +static void sata_dwc_tf_dump(struct device *dwc_dev, struct ata_taskfile *tf) { - dev_vdbg(host_pvt.dwc_dev, taskfile cmd: 0x%02x protocol: %s flags: + dev_vdbg(dwc_dev, taskfile cmd: 0x%02x protocol: %s flags: Space missing after colon, BTW. 0x%lx device: %x\n, tf-command, get_prot_descript(tf-protocol), tf-flags, tf-device); [...] /* * Function: dma_request_channel BTW, it would be good if you changed the function comments to the kernel-doc format (in another patch). - * arguments: None + * arguments: ap * returns channel number if available else -1 * This function assigns the next available DMA channel from the list to the * requester */ -static int dma_request_channel(void) +static int dma_request_channel(struct ata_port *ap) { - int i; + struct sata_dwc_device *hsdev = HSDEV_FROM_AP(ap); [...] + /* Check if the channel is not currently in use */ + if (!(in_le32((sata_dma_regs-dma_chan_en.low)) \ \ not needed. () with not needed. + DMA_CHANNEL(hsdev-dma_channel))) + return hsdev-dma_channel; + + dev_err(ap-dev, %s Channel %d is currently in use\n, __func__, + hsdev-dma_channel); return -1; } /* + * Check if the selected DMA channel is currently enabled. + */ +static int sata_dwc_dma_chk_en(int ch) +{ + u32 dma_chan_reg; Empty line here please. + /* Read the DMA channel register */ + dma_chan_reg = in_le32((sata_dma_regs-dma_chan_en.low)); () with not needed. +/* + * Handle DMA transfer complete interrupt. This checks and passes the + * processing to the appropriate ATA port. + */ +static irqreturn_t dma_dwc_handler(int irq, void *hsdev_instance) +{ + u32 tfr_reg, err_reg; + int chan; + + tfr_reg = in_le32((sata_dma_regs-interrupt_status.tfr.low)); + err_reg = in_le32((sata_dma_regs-interrupt_status.error.low)); () with not needed. @@ -471,41 +517,25 @@ static irqreturn_t dma_dwc_interrupt(int irq, void *hsdev_instance) spin_lock_irqsave(host-lock, flags); ap = host-ports[port]; hsdevp = HSDEVP_FROM_AP(ap); - tag = ap-link.active_tag; - tfr_reg = in_le32((host_pvt.sata_dma_regs-interrupt_status.tfr\ + if (ap-link.active_tag != ATA_TAG_POISON) + tag = ap-link.active_tag; + + tfr_reg = in_le32((sata_dma_regs-interrupt_status.tfr\ \ not needed. () with not needed. And the line is too short to break it anyway. .low)); - err_reg = in_le32((host_pvt.sata_dma_regs-interrupt_status.error\ + err_reg = in_le32((sata_dma_regs-interrupt_status.error\ Same coments. + out_le32((sata_dma_regs-interrupt_clear.tfr.low), () with not needed. @@ -516,11 +546,16 @@ static irqreturn_t dma_dwc_interrupt(int irq, void *hsdev_instance) err_reg); /* Clear the interrupt. */ - out_le32((host_pvt.sata_dma_regs-interrupt_clear\ + out_le32((sata_dma_regs-interrupt_clear\ \ not needed. () with not needed. And the line is too short to break it anyway. .error.low), [...] @@ -629,14 +667,22
Re: [PATCH 1/1] [v3] Add support 2 SATA ports for Maui and change filename from sata_dwc_460ex.c to sata_dwc_4xx.c
Hello. On 06-04-2012 9:31, Thang Q. Nguyen wrote: Signed-off-by: Thang Q. Nguyentqngu...@apm.com --- Changes for v2: - Use git rename feature to change the driver to the newname and for easier review. Changes for v3: - Remove materials not related to 2 SATA ports support. They will be added in another patches. drivers/ata/Makefile |2 +- drivers/ata/{sata_dwc_460ex.c = sata_dwc_4xx.c} | 820 +++--- 2 files changed, 430 insertions(+), 392 deletions(-) rename drivers/ata/{sata_dwc_460ex.c = sata_dwc_4xx.c} (73%) diff --git a/drivers/ata/sata_dwc_460ex.c b/drivers/ata/sata_dwc_4xx.c similarity index 73% rename from drivers/ata/sata_dwc_460ex.c rename to drivers/ata/sata_dwc_4xx.c index 69f7cde..07e9b36 100644 --- a/drivers/ata/sata_dwc_460ex.c +++ b/drivers/ata/sata_dwc_4xx.c [...] @@ -16,6 +14,15 @@ * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. + * + * CHANGES: + * - Version 1.4: + * + Change filename from sata_dwc_460ex.c to sata_dwc_4xx.c + * + This driver supports more than one SATA port. Each SATA port has its + * own private attribute. Move sata_dwc_host_priv structure to + * sata_dwc_device and sata_dwc_device_port structures. + * + Change to use ata_bmdma_qc_issue and ata_bmdma_error_handler because + * the ata_sff_qc_issue and ata_sff_error_handler no longer support DMA. This modification looks like a bug fix, and so should be separated and posted before the dual-port patch. I'll try to do more deltailed review on the weekend. MBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 1/1] Add support 2 SATA ports for Maui and change filename from sata_dwc_460ex.c to sata_dwc_4xx.c
Hello. On 03-04-2012 14:12, Thang Q. Nguyen wrote: Signed-off-by: Thang Q. Nguyentqngu...@apm.com --- Changes for v2: - Use git rename feature to change the driver to the newname and for easier review. arch/powerpc/boot/dts/bluestone.dts | 21 + drivers/ata/Makefile |2 +- drivers/ata/{sata_dwc_460ex.c = sata_dwc_4xx.c} | 1371 ++ 3 files changed, 904 insertions(+), 490 deletions(-) rename drivers/ata/{sata_dwc_460ex.c = sata_dwc_4xx.c} (56%) You submitted a magapatch doing several things at once (some even needlessly) and even in two areas of the kernel. This needs proper splitting/description. diff --git a/arch/powerpc/boot/dts/bluestone.dts b/arch/powerpc/boot/dts/bluestone.dts index cfa23bf..803fda6 100644 --- a/arch/powerpc/boot/dts/bluestone.dts +++ b/arch/powerpc/boot/dts/bluestone.dts @@ -155,6 +155,27 @@ /*RXDE*/ 0x5 0x4; }; + /* SATA DWC devices */ + SATA0: sata@bffd1000 { + compatible = amcc,sata-apm821xx; + reg =4 0xbffd1000 0x800 /* SATA0 */ + 4 0xbffd0800 0x400; /* AHBDMA */ + dma-channel=0; + interrupt-parent =UIC0; + interrupts =26 4/* SATA0 */ + 25 4; /* AHBDMA */ + }; + + SATA1: sata@bffd1800 { + compatible = amcc,sata-apm821xx; + reg =4 0xbffd1800 0x800 /* SATA1 */ + 4 0xbffd0800 0x400; /* AHBDMA */ + dma-channel=1; + interrupt-parent =UIC0; + interrupts =27 4/* SATA1 */ + 25 4; /* AHBDMA */ + }; + POB0: opb { compatible = ibm,opb; #address-cells =1; The above should be in a separate patch for PPC people, of course. diff --git a/drivers/ata/sata_dwc_460ex.c b/drivers/ata/sata_dwc_4xx.c similarity index 56% rename from drivers/ata/sata_dwc_460ex.c rename to drivers/ata/sata_dwc_4xx.c index 69f7cde..bdbb35a 100644 --- a/drivers/ata/sata_dwc_460ex.c +++ b/drivers/ata/sata_dwc_4xx.c @@ -1,5 +1,5 @@ /* - * drivers/ata/sata_dwc_460ex.c + * drivers/ata/sata_dwc_4xx.c This line should be removed altogether. * * Synopsys DesignWare Cores (DWC) SATA host driver * [...] @@ -135,13 +146,12 @@ enum { DMA_CTL_LLP_DSTEN = 0x0800, /* Blk chain enable Dst */ }; -#defineDMA_CTL_BLK_TS(size)((size) 0x00FFF) /* Blk Transfer size */ +#define DMA_CTL_BLK_TS(size) ((size) 0x00FFF) /* Blk Transfer size */ Avoid random whitespoace changes. #define DMA_CHANNEL(ch) (0x0001 (ch)) /* Select channel */ /* Enable channel */ -#defineDMA_ENABLE_CHAN(ch) ((0x0001 (ch)) | \ -((0x1 (ch)) 8)) +#defineDMA_ENABLE_CHAN(ch) (0x0101 (ch)) /* Disable channel */ -#defineDMA_DISABLE_CHAN(ch)(0x | ((0x1 (ch)) 8)) +#defineDMA_DISABLE_CHAN(ch)(0x00100 (ch)) /* Transfer Type Flow Controller */ These cleanups are not related to adding support for 2 channels @@ -298,43 +313,32 @@ struct sata_dwc_device_port { #define HSDEV_FROM_QC(qc) ((struct sata_dwc_device *)\ (qc)-ap-host-private_data) #define HSDEV_FROM_HSDEVP(p) ((struct sata_dwc_device *)\ - (hsdevp)-hsdev) + (hsdevp)-hsdev) Avoid random whitespoace changes. +/* + * Globals + */ +static struct sata_dwc_device *dwc_dev_list[2]; +static struct ahb_dma_regs *sata_dma_regs; This assumes that the system only has single controller, doesn't it? /* - * Function: get_burst_length_encode - * arguments: datalength: length in bytes of data - * returns value to be programmed in register corresponding to data length + * Calculate value to be programmed in register corresponding to data length * This value is effectively the log(base 2) of the length */ -static int get_burst_length_encode(int datalength) +static int get_burst_length_encode(int datalength) Is it releated to adding support to 2 ports? { int items = datalength 2; /* div by 4 to get lword count */ @@ -414,152 +416,205 @@ static int get_burst_length_encode(int datalength) return 0; } -static void clear_chan_interrupts(int c) +/* + * Clear channel interrupt. No interrupt for the specified channel + * generated until it is enabled again. + */ +static void clear_chan_interrupts(int c) { -
Re: [PATCH] powerpc/usb: fix bug of kernel hang when initializing usb
Hello. On 16-02-2012 14:02, Shengzhou Liu wrote: If USB UTMI PHY is not enable, writing to portsc register will lead to kernel hang during boot up. Signed-off-by: Shengzhou Liushengzhou@freescale.com [...] diff --git a/drivers/usb/host/ehci-fsl.h b/drivers/usb/host/ehci-fsl.h index bdf43e2..0e400c2 100644 --- a/drivers/usb/host/ehci-fsl.h +++ b/drivers/usb/host/ehci-fsl.h @@ -45,6 +45,7 @@ #define FSL_SOC_USB_PRICTRL 0x40c /* NOTE: big-endian */ #define FSL_SOC_USB_SICTRL0x410 /* NOTE: big-endian */ #define FSL_SOC_USB_CTRL 0x500 /* NOTE: big-endian */ +#define CTRL_UTMI_PHY_EN (19) Please put spaces around like below. #define CTRL_PHY_CLK_VALID(1 17) #define SNOOP_SIZE_2GB0x1e #endif/* _EHCI_FSL_H */ WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 03/14 v2] MIPS: adapt for dma_map_ops changes
Hello. On 13-02-2012 14:35, Marek Szyprowski wrote: From: Andrzej Pietrasiewiczandrze...@samsung.com Adapt core MIPS architecture code for dma_map_ops changes: replace alloc/free_coherent with generic alloc/free methods. Signed-off-by: Andrzej Pietrasiewiczandrze...@samsung.com [added missing changes to arch/mips/cavium-octeon/dma-octeon.c] Signed-off-by: Marek Szyprowskim.szyprow...@samsung.com Signed-off-by: Kyungmin Parkkyungmin.p...@samsung.com [...] diff --git a/arch/mips/include/asm/dma-mapping.h b/arch/mips/include/asm/dma-mapping.h index 7aa37dd..cbd41f5 100644 --- a/arch/mips/include/asm/dma-mapping.h +++ b/arch/mips/include/asm/dma-mapping.h @@ -57,25 +57,31 @@ dma_set_mask(struct device *dev, u64 mask) extern void dma_cache_sync(struct device *dev, void *vaddr, size_t size, enum dma_data_direction direction); -static inline void *dma_alloc_coherent(struct device *dev, size_t size, - dma_addr_t *dma_handle, gfp_t gfp) +#define dma_alloc_coherent(d,s,h,f)dma_alloc_attrs(d,s,h,f,NULL) + +static inline void *dma_alloc_attrs(struct device *dev, size_t size, + dma_addr_t *dma_handle, gfp_t gfp, + struct dma_attrs *attrs) { void *ret; struct dma_map_ops *ops = get_dma_ops(dev); - ret = ops-alloc_coherent(dev, size, dma_handle, gfp); + ret = ops-alloc(dev, size, dma_handle, gfp, NULL); Not 'attrs' instead of NULL? debug_dma_alloc_coherent(dev, size, *dma_handle, ret); return ret; } -static inline void dma_free_coherent(struct device *dev, size_t size, -void *vaddr, dma_addr_t dma_handle) +#define dma_free_coherent(d,s,c,h) dma_free_attrs(d,s,c,h,NULL) + +static inline void dma_free_attrs(struct device *dev, size_t size, + void *vaddr, dma_addr_t dma_handle, + struct dma_attrs *attrs) { struct dma_map_ops *ops = get_dma_ops(dev); - ops-free_coherent(dev, size, vaddr, dma_handle); + ops-free(dev, size, vaddr, dma_handle, NULL); Same here... WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH v2] powerpc/usb: fix issue of CPU halt when missing USB PHY clock
Hello. On 02-02-2012 7:23, Shengzhou Liu wrote: when missing USB PHY clock, kernel booting up will halt during USB initialization. We should check USBGP[PHY_CLK_VALID] bit to avoid CPU hang in this case. Signed-off-by: Shengzhou Liushengzhou@freescale.com [...] diff --git a/drivers/usb/host/ehci-fsl.h b/drivers/usb/host/ehci-fsl.h index 4918062..dd3dc47 100644 --- a/drivers/usb/host/ehci-fsl.h +++ b/drivers/usb/host/ehci-fsl.h @@ -45,5 +45,6 @@ #define FSL_SOC_USB_PRICTRL 0x40c /* NOTE: big-endian */ #define FSL_SOC_USB_SICTRL0x410 /* NOTE: big-endian */ #define FSL_SOC_USB_CTRL 0x500 /* NOTE: big-endian */ +#define CTRL_PHY_CLK_VALID (1 17) Indent the macro value with tabs please. WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH v14 10/10] USB/ppc4xx:Synopsys DWC OTG driver enable gadget support
Hello. On 12-10-2011 2:43, Tirumala Marri wrote: +# dwc_otg builds in ../dwc along with host support +config USB_GADGET_DWC_HDRC + boolean DesignWare USB Peripheral + depends on DWC_OTG_MODE || DWC_DEVICE_ONLY + select USB_GADGET_DUALSPEED + select USB_GADGET_SELECTED + select USB_GADGET_DWC_OTG I don't see where this one is defined... [Tirumala Marri] You mean USB_GADGET_SELECTED ? Ok I will add it. No, I mean USB_GADGET_DWC_OTG. USB_GADGET_SELECTED is already defined. --marri WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH v14 10/10] USB/ppc4xx:Synopsys DWC OTG driver enable gadget support
Hello. On 07-10-2011 6:31, tma...@apm.com wrote: From: Tirumala Marritma...@apm.com Enable gadget support Signed-off-by: Tirumala R Marritma...@apm.com Signed-off-by: Fushen Chenfc...@apm.com Signed-off-by: Mark Miesfeldmmiesf...@apm.com [...] diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig index 5a084b9..5f1f89f 100644 --- a/drivers/usb/gadget/Kconfig +++ b/drivers/usb/gadget/Kconfig @@ -316,6 +316,17 @@ config USB_GADGET_MUSB_HDRC This OTG-capable silicon IP is used in dual designs including the TI DaVinci, OMAP 243x, OMAP 343x, TUSB 6010, and ADI Blackfin +# dwc_otg builds in ../dwc along with host support +config USB_GADGET_DWC_HDRC + boolean DesignWare USB Peripheral + depends on DWC_OTG_MODE || DWC_DEVICE_ONLY + select USB_GADGET_DUALSPEED + select USB_GADGET_SELECTED + select USB_GADGET_DWC_OTG I don't see where this one is defined... WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH] libata: Convert LED disk trigger from IDE to libata
Hello. On 03-10-2011 20:07, Jörg Sommer wrote: This patch converts the trigger for the LED at the front of Apple's iBooks to libata. It's merely a replacement of the string ide by disk. The patch is taken from http://dev.gentoo.org/~josejx/ata.patch. I've asked Joseph Jezak if he intends to send this patch upstream, but as he did not reply I'll do so. The patch needs to be signed off, it cannot be applied otherwise. --- arch/powerpc/configs/pmac32_defconfig |2 +- arch/powerpc/configs/ppc6xx_defconfig |2 +- drivers/ata/libata-core.c |4 ++ drivers/ide/ide-disk.c|2 +- drivers/leds/Kconfig | 10 +++--- drivers/leds/Makefile |2 +- drivers/leds/ledtrig-disk.c | 64 + drivers/leds/ledtrig-ide-disk.c | 64 - drivers/macintosh/Kconfig | 11 +++--- drivers/macintosh/via-pmu-led.c |4 +- include/linux/leds.h |6 ++-- 11 files changed, 87 insertions(+), 84 deletions(-) create mode 100644 drivers/leds/ledtrig-disk.c delete mode 100644 drivers/leds/ledtrig-ide-disk.c You should use -C/-M git options to detect file renames. diff --git a/arch/powerpc/configs/pmac32_defconfig b/arch/powerpc/configs/pmac32_defconfig index f8b394a..cff5d4e 100644 --- a/arch/powerpc/configs/pmac32_defconfig +++ b/arch/powerpc/configs/pmac32_defconfig @@ -180,7 +180,7 @@ CONFIG_ADB=y CONFIG_ADB_CUDA=y CONFIG_ADB_PMU=y CONFIG_ADB_PMU_LED=y -CONFIG_ADB_PMU_LED_IDE=y +CONFIG_ADB_PMU_LED_DISK=y CONFIG_PMAC_APM_EMU=m CONFIG_PMAC_MEDIABAY=y CONFIG_PMAC_BACKLIGHT=y diff --git a/arch/powerpc/configs/ppc6xx_defconfig b/arch/powerpc/configs/ppc6xx_defconfig index 04360f9..c56464d 100644 --- a/arch/powerpc/configs/ppc6xx_defconfig +++ b/arch/powerpc/configs/ppc6xx_defconfig @@ -471,7 +471,7 @@ CONFIG_ADB=y CONFIG_ADB_CUDA=y CONFIG_ADB_PMU=y CONFIG_ADB_PMU_LED=y -CONFIG_ADB_PMU_LED_IDE=y +CONFIG_ADB_PMU_LED_DISK=y CONFIG_PMAC_APM_EMU=y CONFIG_PMAC_MEDIABAY=y CONFIG_PMAC_BACKLIGHT=y Defconfigs should be changed by a separate patch. diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index 4a3a5ae..d37e3a2 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c @@ -66,6 +66,7 @@ #includeasm/byteorder.h #includelinux/cdrom.h #includelinux/ratelimit.h +#includelinux/leds.h #include libata.h #include libata-transport.h @@ -4823,6 +4824,9 @@ void ata_qc_complete(struct ata_queued_cmd *qc) { struct ata_port *ap = qc-ap; + /* Trigger the LED (if available) */ + ledtrig_disk_activity(); + /* XXX: New EH and old EH use different mechanisms to * synchronize EH with regular execution path. * This also seems a material for the separate patch. You should first do a file/function rename and then add support for libata, I think. diff --git a/drivers/ide/ide-disk.c b/drivers/ide/ide-disk.c index 2747980..cb25bd6 100644 --- a/drivers/ide/ide-disk.c +++ b/drivers/ide/ide-disk.c @@ -186,7 +186,7 @@ static ide_startstop_t ide_do_rw_disk(ide_drive_t *drive, struct request *rq, BUG_ON(drive-dev_flags IDE_DFLAG_BLOCKED); BUG_ON(rq-cmd_type != REQ_TYPE_FS); - ledtrig_ide_activity(); + ledtrig_disk_activity(); Hm, the trigger point seems asymmetric to that one you added to libata. Here you trigger before executing a request, and in libata after a command completes; also, in libata you also trigger on ATAPI devices, while here only on ATA devices... WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 12/14] include/linux/usb/gadget.h : include linux/device.h for successful compilation
Hello. On 08/30/2011 03:57 PM, Pratyush Anand wrote: gadget.h uses struct device, which has been declared in linux/device.h. So it must be included. Signed-off-by: Pratyush Anandpratyush.an...@st.com --- include/linux/usb/gadget.h |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h index 006412c..32f7b69 100644 --- a/include/linux/usb/gadget.h +++ b/include/linux/usb/gadget.h @@ -16,6 +16,7 @@ #define __LINUX_USB_GADGET_H #includelinux/slab.h +#includelinux/device.h On what tree are you basing? There have been patches accepted in v3.1-rc1, which added a bunch of #include's to that file (including linux/device.h). WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 11/14] dwc/otg: Driver enable gadget support
Hello. On 08/30/2011 03:57 PM, Pratyush Anand wrote: From: Tirumala Marritma...@apm.com Enable gadget support Signed-off-by: Tirumala R Marritma...@apm.com Signed-off-by: Fushen Chenfc...@apm.com Signed-off-by: Mark Miesfeldmmiesf...@apm.com Signed-off-by: Pratyush Anandpratyush.an...@st.com --- drivers/usb/gadget/gadget_chips.h | 18 +- 1 files changed, 17 insertions(+), 1 deletions(-) diff --git a/drivers/usb/gadget/gadget_chips.h b/drivers/usb/gadget/gadget_chips.h index 0978103..66b8018 100644 --- a/drivers/usb/gadget/gadget_chips.h +++ b/drivers/usb/gadget/gadget_chips.h @@ -148,6 +148,19 @@ #define gadget_is_s3c_hsotg(g)0 #endif +#if defined(CONFIG_DWC_OTG_MODE) || defined(CONFIG_DWC_DEVICE_ONLY) +#define gadget_is_dwc_otg_pcd(g) (!strcmp(dwc_otg_pcd, (g)-name)) +#else +#define gadget_is_dwc_otg_pcd(g) 0 +#endif + +#ifdef CONFIG_USB_GADGET_CI13XXX_MSM +#define gadget_is_ci13xxx_msm(g) (!strcmp(ci13xxx_msm, (g)-name)) +#else +#define gadget_is_ci13xxx_msm(g) 0 +#endif + + Too many newlines. /** * usb_gadget_controller_number - support bcdDevice id convention @@ -208,10 +221,13 @@ static inline int usb_gadget_controller_number(struct usb_gadget *gadget) return 0x26; else if (gadget_is_designware(gadget)) return 0x27; + else if (gadget_is_ci13xxx_msm(gadget)) + return 0x28; + else if (gadget_is_dwc_otg_pcd(gadget)) + return 0x29; Hm, why are you adding 2 gadgets? return -ENOENT; } - Unrelated white space change. /** * gadget_supports_altsettings - return true if altsettings work * @gadget: the gadget in question WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH v12 09/10] USB ppc4xx: Add Synopsys DWC OTG driver kernel configuration and Makefile
Hello. On 02-04-2011 1:56, tma...@apm.com wrote: From: Tirumala Marri tma...@apm.com Add Synopsys DesignWare HS USB OTG driver kernel configuration. Synopsys OTG driver may operate in host only, device only, or OTG mode. The driver also allows user configure the core to use its internal DMA or Slave (PIO) mode. Signed-off-by: Tirumala R Marri tma...@apm.com Signed-off-by: Fushen Chen fc...@apm.com Signed-off-by: Mark Miesfeld mmiesf...@apm.com [...] diff --git a/drivers/usb/dwc/Kconfig b/drivers/usb/dwc/Kconfig new file mode 100644 index 000..a8f22cb --- /dev/null +++ b/drivers/usb/dwc/Kconfig @@ -0,0 +1,88 @@ +# +# USB Dual Role (OTG-ready) Controller Drivers +# for silicon based on Synopsys DesignWare IP +# [...] +# enable peripheral support (including with OTG) +config USB_GADGET_DWC_HDRC + bool + depends on USB_DWC_OTG (DWC_DEVICE_ONLY || USB_DWC_OTG) + I've already told you not to redefine it. WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH v10 03/10] USB/ppc4xx: Add Synopsys DWC OTG Core Interface Layer (CIL)
Hello. Tirumala Marri wrote: +void dwc_otg_core_init(struct core_if *core_if) +{ + u32 i; + ulong global_reg = core_if-core_global_regs; + struct device_if *dev_if = core_if-dev_if; + u32 ahbcfg = 0; + u32 i2cctl = 0; + u32 gusbcfg; Tabify the declarations ; [Marri] When I checked again in my source, I do see the tabs added before declarations. He means that tabs should be between the variable's type and name, but there's no such requirement actually. WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH v11 09/10] USB ppc4xx: Add Synopsys DWC OTG driver kernel configuration and Makefile
tma...@apm.com wrote: From: Tirumala Marri tma...@apm.com Add Synopsys DesignWare HS USB OTG driver kernel configuration. Synopsys OTG driver may operate in host only, device only, or OTG mode. The driver also allows user configure the core to use its internal DMA or Slave (PIO) mode. Signed-off-by: Tirumala R Marri tma...@apm.com Signed-off-by: Fushen Chen fc...@apm.com Signed-off-by: Mark Miesfeld mmiesf...@apm.com [...] diff --git a/drivers/Makefile b/drivers/Makefile index a125e0b..500e08f 100644 --- a/drivers/Makefile +++ b/drivers/Makefile @@ -65,6 +65,7 @@ obj-$(CONFIG_PARIDE) += block/paride/ obj-$(CONFIG_TC) += tc/ obj-$(CONFIG_UWB) += uwb/ obj-$(CONFIG_USB_OTG_UTILS)+= usb/otg/ +obj-$(CONFIG_USB_DWC_OTG) += usb/otg/dwc/ Haven't we recently agreed with Greg on drivers/usb/dwc/? WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH v11 09/10] USB ppc4xx: Add Synopsys DWC OTG driver kernel configuration and Makefile
Hello. On 02-04-2011 1:23, Tirumala Marri wrote: +++ b/drivers/Makefile @@ -65,6 +65,7 @@ obj-$(CONFIG_PARIDE) += block/paride/ obj-$(CONFIG_TC) += tc/ obj-$(CONFIG_UWB) += uwb/ obj-$(CONFIG_USB_OTG_UTILS) += usb/otg/ +obj-$(CONFIG_USB_DWC_OTG) += usb/otg/dwc/ Haven't we recently agreed with Greg on drivers/usb/dwc/? [marri] I did not see Greg's response saying yes. I thought we are still sticking with usb/otg/dwc. Well, it was Greg's suggsestion, it was me who said yes. :-) WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH v10 09/10] USB/ppc4xx:Synopsys DWC OTG driver enable gadget support
Hello. On 28-03-2011 22:28, tma...@apm.com wrote: From: Tirumala Marri tma...@apm.com Enable gadget support Signed-off-by: Tirumala R Marri tma...@apm.com Signed-off-by: Fushen Chen fc...@apm.com Signed-off-by: Mark Miesfeld mmiesf...@apm.com [...] diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig index bc5123c..61aca75 100644 --- a/drivers/usb/gadget/Kconfig +++ b/drivers/usb/gadget/Kconfig @@ -365,6 +365,28 @@ config USB_GADGET_MUSB_HDRC This OTG-capable silicon IP is used in dual designs including the TI DaVinci, OMAP 243x, OMAP 343x, TUSB 6010, and ADI Blackfin +# dwc_otg builds in ../dwc_otg along with host support There's no ../dwc_otg any longer. +config USB_GADGET_DWC_HDRC + boolean DesignWare USB Peripheral + depends on DWC_OTG_MODE || DWC_DEVICE_ONLY + select USB_GADGET_DUALSPEED + select USB_GADGET_SELECTED + select USB_GADGET_DWC_OTG + help + This OTG-capable Designware USB IP + +config USB_GADGET_DWC_OTG + boolean OTG Support + depends on USB_GADGET_DWC_HDRC Not on DWC_OTG_MODE? How this option is different from DWC_OTG_MODE? + help + The most notable feature of USB OTG is support for a + Dual-Role device, which can act as either a device + or a host. The initial role choice can be changed + later, when two dual-role devices talk to each other. + Select this only if your board has a Mini-AB connector. + + + Too many empty lines. config USB_GADGET_M66592 boolean Renesas M66592 USB Peripheral Controller select USB_GADGET_DUALSPEED WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH v10 10/10] USB ppc4xx: Add Synopsys DWC OTG driver kernel configuration and Makefile
Hello. On 28-03-2011 22:28, tma...@apm.com wrote: From: Tirumala Marri tma...@apm.com Add Synopsys DesignWare HS USB OTG driver kernel configuration. Synopsys OTG driver may operate in host only, device only, or OTG mode. The driver also allows user configure the core to use its internal DMA or Slave (PIO) mode. Signed-off-by: Tirumala R Marri tma...@apm.com Signed-off-by: Fushen Chen fc...@apm.com Signed-off-by: Mark Miesfeld mmiesf...@apm.com This patch should precede patch 9 as patch 9 uses config. options defined here. diff --git a/drivers/usb/otg/dwc/Kconfig b/drivers/usb/otg/dwc/Kconfig new file mode 100644 index 000..a8f22cb --- /dev/null +++ b/drivers/usb/otg/dwc/Kconfig @@ -0,0 +1,88 @@ +# +# USB Dual Role (OTG-ready) Controller Drivers +# for silicon based on Synopsys DesignWare IP +# [...] +# enable peripheral support (including with OTG) +config USB_GADGET_DWC_HDRC + bool + depends on USB_DWC_OTG (DWC_DEVICE_ONLY || USB_DWC_OTG) Haven't we just defined this in patch 9? Redefinition of options isn't correct. +config DWC_OTG_REG_LE + bool DWC Little Endian Register This should preferrably be passed via the platform data, I think. + depends on USB_DWC_OTG + default y + help + OTG core register access is Little-Endian. + +config DWC_OTG_FIFO_LE + bool DWC FIFO Little Endian This too. + depends on USB_DWC_OTG + default n default n not needed. + help + OTG core FIFO access is Little-Endian. Little endian registers and big endian FIFO by default? + +config DWC_LIMITED_XFER_SIZE + bool DWC Endpoint Limited Xfer Size + depends on USB_GADGET_DWC_HDRC + default n Not needed. + help + Bit fields in the Device EP Transfer Size Register is 11 bits. WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH V9 10/10] USB ppc4xx: Add Synopsys DWC OTG driver kernel configuration and Makefile
Hello. Tirumala Marri wrote: +config DWC_DEVICE_ONLY + bool DWC Device Only Mode + select USB_GADGET_SELECTED + +endchoice So this is tri-modal driver after all... how come we place it in drivers/usb/otg/dwc/, while the same tri-modal MUSB driver was placed in drivers/usb/musb/? You still have quoting broken in your mailer -- I've fixed it up by hand... [Marri] Initially this was how the patch created. Greg KH, suggested to move under OTG. Well, I know that. So this was a question to Greg... WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH V9 10/10] USB ppc4xx: Add Synopsys DWC OTG driver kernel configuration and Makefile
Hello. Greg KH wrote: +config DWC_DEVICE_ONLY + bool DWC Device Only Mode + select USB_GADGET_SELECTED + +endchoice So this is tri-modal driver after all... how come we place it in drivers/usb/otg/dwc/, while the same tri-modal MUSB driver was placed in drivers/usb/musb/? You still have quoting broken in your mailer -- I've fixed it up by hand... [Marri] Initially this was how the patch created. Greg KH, suggested to move under OTG. Well, I know that. So this was a question to Greg... Well, if that's not the right place to put it, Sergei, where do you suggest that it go? drivers/usb/dwc/ ? Exactly. thanks, greg k-h WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 5/5] xhci: Remove recursive call to xhci_handle_event
Hello. On 25-03-2011 10:44, Matt Evans wrote: Make the caller loop while there are events to handle, instead. Signed-off-by: Matt Evansm...@ozlabs.org --- drivers/usb/host/xhci-ring.c | 16 +--- 1 files changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index b46efd9..97bedd6 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c [...] @@ -2277,7 +2279,7 @@ hw_died: /* FIXME this should be a delayed service routine * that clears the EHB. */ - xhci_handle_event(xhci); + while (xhci_handle_event(xhci)) {}; Semicolon not needed after }. Perhaps the committer could change this... WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 1/1] fsl_qe_udc: send ZLP when zero flag and length % maxpacket == 0
Hello. On 17-03-2011 13:30, Valentin Longchamp wrote: The driver did not take the zero flag in the USB request. If the request length is the same as the endpoint's maxpacket, an additional ZLP with no data has to be transmitted. The method used here is inspired to what is done in fsl_udc_core.c (and pxa27x_udc.c and at91_udc.c) where this is supported. This is the first version of the patch, it may still contain mistakes, but I send it as a RFC since there already was a discussion about this topic with people from Keymile: http://thread.gmane.org/gmane.linux.usb.general/38951 Signed-off-by: Valentin Longchampvalentin.longch...@keymile.com --- drivers/usb/gadget/fsl_qe_udc.c | 28 +++- 1 files changed, 23 insertions(+), 5 deletions(-) diff --git a/drivers/usb/gadget/fsl_qe_udc.c b/drivers/usb/gadget/fsl_qe_udc.c index 8dc15da..08538f5 100644 --- a/drivers/usb/gadget/fsl_qe_udc.c +++ b/drivers/usb/gadget/fsl_qe_udc.c [...] @@ -1158,13 +1164,24 @@ static int txcomplete(struct qe_ep *ep, unsigned char restart) ep-last = 0; } + /* zlp needed when req-re.zero is set */ + if (req-req.zero) { + if (last_len == 0 || + (req-req.length % ep-ep.maxpacket) != 0) + zlp = 0; + else + zlp = 1; + } else + zlp = 0; + /* a request already were transmitted completely */ if ((ep-tx_req-req.length - ep-sent) = 0) { - ep-tx_req-req.actual = (unsigned int)ep-sent; - done(ep, ep-tx_req, 0); - ep-tx_req = NULL; - ep-last = 0; - ep-sent = 0; + if (!zlp) { This *if* could be collapsed into previous *if*, and so the subsequest indentation level not changed. + done(ep, ep-tx_req, 0); + ep-tx_req = NULL; + ep-last = 0; + ep-sent = 0; + } } } WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH V9 09/10] USB/ppc4xx:Synopsys DWC OTG driver enable gadget support
Hello. On 08.02.2011 1:54, tma...@apm.com wrote: From: Tirumala Marritma...@apm.com Enable gadget support Signed-off-by: Tirumala R Marritma...@apm.com Signed-off-by: Fushen Chenfc...@apm.com Signed-off-by: Mark Miesfeldmmiesf...@apm.com --- drivers/usb/gadget/Kconfig| 22 ++ drivers/usb/gadget/gadget_chips.h |9 + 2 files changed, 31 insertions(+), 0 deletions(-) diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig index 5df8a8d..de7c10b 100644 --- a/drivers/usb/gadget/Kconfig +++ b/drivers/usb/gadget/Kconfig @@ -365,6 +365,28 @@ config USB_GADGET_MUSB_HDRC This OTG-capable silicon IP is used in dual designs including the TI DaVinci, OMAP 243x, OMAP 343x, TUSB 6010, and ADI Blackfin +# dwc_otg builds in ../dwc_otg along with host support +config USB_GADGET_DWC_HDRC + boolean DesignWare USB Peripheral + depends on DWC_OTG_MODE || DWC_DEVICE_ONLY Patch 10 should precede this one as it defines DWC_OTG_MODE and DWC_DEVICE_ONLY. + select USB_GADGET_DUALSPEED + select USB_GADGET_SELECTED + select USB_GADGET_DWC_OTG + help + This OTG-capable Designware USB IP + +config USB_GADGET_DWC_OTG + boolean OTG Support + depends on USB_GADGET_DWC_HDRC What's the point of this option if it gets auto-selected by USB_GADGET_DWC_HDRC anyway? WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH V9 10/10] USB ppc4xx: Add Synopsys DWC OTG driver kernel configuration and Makefile
Hello. tma...@apm.com wrote: From: Tirumala Marri tma...@apm.com Add Synopsys DesignWare HS USB OTG driver kernel configuration. Synopsys OTG driver may operate in host only, device only, or OTG mode. The driver also allows user configure the core to use its internal DMA or Slave (PIO) mode. Signed-off-by: Tirumala R Marri tma...@apm.com Signed-off-by: Fushen Chen fc...@apm.com Signed-off-by: Mark Miesfeld mmiesf...@apm.com [...] diff --git a/drivers/Makefile b/drivers/Makefile index 2cbb4b7..3bfc728 100644 --- a/drivers/Makefile +++ b/drivers/Makefile @@ -65,6 +65,7 @@ obj-$(CONFIG_PARIDE) += block/paride/ obj-$(CONFIG_TC) += tc/ obj-$(CONFIG_UWB) += uwb/ obj-$(CONFIG_USB_OTG_UTILS)+= usb/otg/ +obj-$(CONFIG_USB_DWC_OTG) += usb/otg/dwc/ Hardly a good place for this... obj-$(CONFIG_USB) += usb/ obj-$(CONFIG_USB_MUSB_HDRC)+= usb/musb/ obj-$(CONFIG_PCI) += usb/ @@ -105,6 +106,7 @@ obj-$(CONFIG_ARCH_SHMOBILE) += sh/ ifndef CONFIG_ARCH_USES_GETTIMEOFFSET obj-y += clocksource/ endif +obj-$(CONFIG_DMA_ENGINE) += dma/ How is this change related? Moreover, it's already present several lines ago in this file... diff --git a/drivers/usb/Kconfig b/drivers/usb/Kconfig index 41b6e51..887f702 100644 --- a/drivers/usb/Kconfig +++ b/drivers/usb/Kconfig @@ -55,7 +55,6 @@ config USB_ARCH_HAS_OHCI config USB_ARCH_HAS_EHCI boolean default y if PPC_83xx - default y if PPC_MPC512x How is this change related? diff --git a/drivers/usb/otg/dwc/Kconfig b/drivers/usb/otg/dwc/Kconfig new file mode 100644 index 000..4d33d72 --- /dev/null +++ b/drivers/usb/otg/dwc/Kconfig @@ -0,0 +1,96 @@ +# +# USB Dual Role (OTG-ready) Controller Drivers +# for silicon based on Synopsys DesignWare IP +# + +comment Enable Host or Gadget support for DesignWare OTG controller + depends on !USB USB_GADGET=n + +config USB_DWC_OTG + depends on (USB || USB_GADGET) Parens not necessary. + select NOP_USB_XCEIV + select USB_OTG_UTILS + tristate Synopsys DWC OTG Controller tristate should come before depends I think -- at least that's how everybody does... + default USB_GADGET + help + This driver provides USB Device Controller support for the + Synopsys DesignWare USB OTG Core used on the AppliedMicro PowerPC SoC. [...] +choice + prompt DWC Mode Selection + depends on USB_DWC_OTG + default DWC_HOST_ONLY + help + Select the DWC Core in OTG, Host only, or Device only mode. + +config DWC_HOST_ONLY + bool DWC Host Only Mode + +config DWC_OTG_MODE + bool DWC OTG Mode + select USB_GADGET_SELECTED + +config DWC_DEVICE_ONLY + bool DWC Device Only Mode + select USB_GADGET_SELECTED + +endchoice So this is tri-modal driver after all... how come we place it in drivers/usb/otg/dwc/, while the same tri-modal MUSB driver was placed in drivers/usb/musb/? +config USB_OTG_WHITELIST + bool Rely on OTG Targeted Peripherals List + depends on !USB_SUSPEND USB_DWC_OTG + default n + help + This is the same flag as in ../core/Kconfig. + It is here for easy deselect. What?! Option duplication isn't allowed, I think. +config DWC_OTG_REG_LE + depends on USB_DWC_OTG + bool DWC Little Endian Register bool should come before depends, I think. + default y + help + OTG core register access is Little-Endian. + +config DWC_OTG_FIFO_LE + depends on USB_DWC_OTG + bool DWC FIFO Little Endian Same here. + default n + help + OTG core FIFO access is Little-Endian. + +config DWC_LIMITED_XFER_SIZE + depends on USB_GADGET_DWC_HDRC + bool DWC Endpoint Limited Xfer Size ... and here. + default n + help + Bit fields in the Device EP Transfer Size Register is 11 bits. s/is/are/ Also, such things should better be passed via the platform data, I think. WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH] ATA: Add FSL sata v2 controller support
Hello. On 18-01-2011 6:01, Zang Roy-R61911 wrote: In FSL sata v2 block, the snoop bit of PRDT Word3 description information is at bit28 instead of bit22. This patch adds FSL sata v2 probe and resolve this difference. Signed-off-by: Xuleib33...@freescale.com [snip] diff --git a/arch/powerpc/boot/dts/p1022ds.dts b/arch/powerpc/boot/dts/p1022ds.dts index 2bbecbb..9ad41dd 100644 --- a/arch/powerpc/boot/dts/p1022ds.dts +++ b/arch/powerpc/boot/dts/p1022ds.dts @@ -475,14 +475,14 @@ }; sata@18000 { - compatible = fsl,mpc8536-sata, fsl,pq-sata; + compatible = fsl,p1022-sata, fsl,pq-sata-v2; reg =0x18000 0x1000; cell-index =1; interrupts =74 0x2; }; sata@19000 { - compatible = fsl,mpc8536-sata, fsl,pq-sata; + compatible = fsl,p1022-sata, fsl,pq-sata-v2; reg =0x19000 0x1000; cell-index =2; interrupts =41 0x2; Please put this into the separate patch and push thru the PPC tree. I agree to put to them to separate patches, but should we pull in the separate patches to one candidate tree to make the function work? I don't understand. What is candidate tree? Thanks. Roy WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH] ATA: Add FSL sata v2 controller support
Hello. On 18-01-2011 14:43, Zang Roy-R61911 wrote: On 18-01-2011 6:01, Zang Roy-R61911 wrote: In FSL sata v2 block, the snoop bit of PRDT Word3 description information is at bit28 instead of bit22. This patch adds FSL sata v2 probe and resolve this difference. Signed-off-by: Xuleib33...@freescale.com [snip] diff --git a/arch/powerpc/boot/dts/p1022ds.dts b/arch/powerpc/boot/dts/p1022ds.dts index 2bbecbb..9ad41dd 100644 --- a/arch/powerpc/boot/dts/p1022ds.dts +++ b/arch/powerpc/boot/dts/p1022ds.dts @@ -475,14 +475,14 @@ }; sata@18000 { - compatible = fsl,mpc8536-sata, fsl,pq-sata; + compatible = fsl,p1022-sata, fsl,pq-sata-v2; reg =0x18000 0x1000; cell-index =1; interrupts =74 0x2; }; sata@19000 { - compatible = fsl,mpc8536-sata, fsl,pq-sata; + compatible = fsl,p1022-sata, fsl,pq-sata-v2; reg =0x19000 0x1000; cell-index =2; interrupts =41 0x2; Please put this into the separate patch and push thru the PPC tree. I agree to put to them to separate patches, but should we pull in the separate patches to one candidate tree to make the function work? I don't understand. What is candidate tree? Powerpc or ide git repository for upstream to mainline. s/ide/libata/ It is odd that patches for one function in different trees. The libata tree doesn't need to be concerned with PPC board specific device trees. Although it's up to the maintainer... just cross post the patch, and let the corresponding maintainers fogure it out. Thanks. Roy WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH] ATA: Add FSL sata v2 controller support
Hello. On 17-01-2011 10:10, Xulei wrote: In FSL sata v2 block, the snoop bit of PRDT Word3 description information is at bit28 instead of bit22. This patch adds FSL sata v2 probe and resolve this difference. Signed-off-by: Xulei b33...@freescale.com AFAIK, full name is required. Signed-off-by: Roy Zang tie-fei.z...@freescale.com [...] diff --git a/arch/powerpc/boot/dts/p1022ds.dts b/arch/powerpc/boot/dts/p1022ds.dts index 2bbecbb..9ad41dd 100644 --- a/arch/powerpc/boot/dts/p1022ds.dts +++ b/arch/powerpc/boot/dts/p1022ds.dts @@ -475,14 +475,14 @@ }; sata@18000 { - compatible = fsl,mpc8536-sata, fsl,pq-sata; + compatible = fsl,p1022-sata, fsl,pq-sata-v2; reg =0x18000 0x1000; cell-index =1; interrupts =74 0x2; }; sata@19000 { - compatible = fsl,mpc8536-sata, fsl,pq-sata; + compatible = fsl,p1022-sata, fsl,pq-sata-v2; reg =0x19000 0x1000; cell-index =2; interrupts =41 0x2; Please put this into the separate patch and push thru the PPC tree. diff --git a/drivers/ata/sata_fsl.c b/drivers/ata/sata_fsl.c index b0214d0..a56399a 100644 --- a/drivers/ata/sata_fsl.c +++ b/drivers/ata/sata_fsl.c [...] @@ -417,7 +420,8 @@ static void sata_fsl_qc_prep(struct ata_queued_cmd *qc) if (qc-flags ATA_QCFLAG_DMAMAP) num_prde = sata_fsl_fill_sg(qc, (void *)cd, - ttl_dwords, cd_paddr); + ttl_dwords, cd_paddr, + host_priv-data_snoop); Please align these lines uniformly. WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: PowerPC MPC5200B ATA MWDMA regression
Hello. On 03-01-2011 16:59, Tejun Heo wrote: When merging more recent kernel versions, tried that using v2.6.35 and v2.6.36, into our tree (branched at v2.6.34), I detected, that MWDMA2 on the HW listed in the subject does no longer work. So I bisected that using the original, standard kernel tree using a minimum config using git bisect start v2.6.35 v2.6.34 The final result is: 360ff7833098e944e5003618b03894251e937802 is the first bad commit commit 360ff7833098e944e5003618b03894251e937802 Author: Tejun Heot...@kernel.org Date: Mon May 10 21:41:42 2010 +0200 libata-sff: separate out BMDMA qc_issue ... I double checked the failure with the latest torvalds/master as well (b518a64983cbf2ff31), still the same issue. The HW is an own board very close to the original Freescale Lite5200/Lite5200B. The relevant part of the device tree source file contains mwdma-mode =2; inside the ata section. In the bad case the log always shows (the exact drive or drive type doesn't matter, double checked): [1.553501] ata1.00: ATA-5: HEJ423020F9AT00, 00MJA0A0, max UDMA/100 [1.560003] ata1.00: 39070080 sectors, multi 0: LBA [1.581418] ata1.00: configured for MWDMA2 [1.586644] scsi 0:0:0:0: Direct-Access ATA HEJ423020F9AT00 00MJ PQ: 0 ANSI: 5 [1.597831] sd 0:0:0:0: [sda] 39070080 512-byte logical blocks: (20.0 GB/18.6 GiB) [1.606876] sd 0:0:0:0: [sda] Write Protect is off [1.611907] sd 0:0:0:0: [sda] Mode Sense: 00 3a 00 00 [1.617627] sd 0:0:0:0: [sda] Write cache: enabled, read cache: enabled, doesn't support DPO or FUA [1.629423] sda: [1.631702] [ cut here ] [1.636613] Badness at /home/fietze/src/linux-2.6-telemotive/drivers/ata/libata-sff.c:1466 [1.645047] NIP: c01ae650 LR: c01ae624 CTR: c01accbc [1.650115] REGS: c7955b30 TRAP: 0700 Not tainted (2.6.34-rc7-obelix) [1.656948] MSR: 00021032ME,CE,IR,DR CR: 24008084 XER: [1.663452] TASK = c78f2490[784] 'async/0' THREAD: c7954000 [1.668957] GPR00: 0001 c7955be0 c78f2490 0050 c904aa78 0001 [1.677497] GPR08: c034ee50 44008082 1001a7f0 c7955f68 07fb2938 [1.686037] GPR16: c78a8000 07fb2914 07f3f64c c034 c031ed00 c78a8000 c0010adc [1.694577] GPR24: c7842820 0002 c7949428 c7948000 0003 c7948000 c794809c [1.703321] NIP [c01ae650] ata_sff_qc_issue+0x74/0x248 [1.708564] LR [c01ae624] ata_sff_qc_issue+0x48/0x248 [1.713712] Call Trace: [1.716211] [c7955be0] [c01ae624] ata_sff_qc_issue+0x48/0x248 (unreliable) Which driver is it? It's 'pata_mpc52xx' I think. You probably now want to use ata_bmdma_qc_issue() instead of ata_sff_qc_issue() (or inherit from ata_bmdma_port_ops instead of ata_sff_port_ops) as sff doesn't deal with BMDMA anymore. Indeed, the driver inherits from 'ata_sff_port_ops'... The commit you bisected to contains all those conversions too. Take a look at a similar driver and look at how it has been converted recently. Even better, just send the driver upstream. :-) It's already there... Good luck. WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: PowerPC MPC5200B ATA MWDMA regression
Hello. On 03-01-2011 17:33, Tejun Heo wrote: The commit you bisected to contains all those conversions too. Take a look at a similar driver and look at how it has been converted recently. Even better, just send the driver upstream. :-) It's already there... Ouch, did I forget to convert It probably wasn't obvious as this driver had lived in non-BMDMA section of Kconfig before the recent patch: http://marc.info/?l=linux-idem=129303304605907 it or was it a merge timing problem? Anyways, sorry about that. Please go ahead and fix it. :-) WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: PowerPC MPC5200B ATA MWDMA regression
Hello. On 03-01-2011 18:27, Sergei Shtylyov wrote: The commit you bisected to contains all those conversions too. Take a look at a similar driver and look at how it has been converted recently. Even better, just send the driver upstream. :-) It's already there... Ouch, did I forget to convert It probably wasn't obvious as this driver had lived in non-BMDMA section of Kconfig before the recent patch: http://marc.info/?l=linux-idem=129303304605907 it or was it a merge timing problem? Anyways, sorry about that. Please go ahead and fix it. :-) Looks like the commit that added DMA support should be thanked for the mischief: http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6b61e69e7bc1cfe80ab54c6321f19061f9487ed3 WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH V6 09/10] USB/ppc4xx:Synopsys DWC OTG driver enable gadget support
Hello. On 09-12-2010 3:32, tma...@apm.com wrote: From: Tirumala Marritma...@apm.com Enable gadget support Signed-off-by: Tirumala R Marritma...@apm.com Signed-off-by: Fushen Chenfc...@apm.com Signed-off-by: Mark Miesfeldmmiesf...@apm.com [...] diff --git a/drivers/usb/gadget/Kconfig b/drivers/usb/gadget/Kconfig index 747b0d3..b2bcc4e 100644 --- a/drivers/usb/gadget/Kconfig +++ b/drivers/usb/gadget/Kconfig @@ -365,6 +365,28 @@ config USB_GADGET_MUSB_HDRC [...] +config USB_OTG + boolean OTG Support This symbol is already defined in drivers/usb/core/Kconfig. WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [Kgdb-bugreport] [PATCH] kgdb, ppc: Corrected the address using of current-thread.evr register
Hello. On 16-11-2010 15:58, Dongdong Deng wrote: Passing the address of current-thread.evr register to memcpy function. Signed-off-by: Dongdong Dengdongdong.d...@windriver.com CC: Hai Shanshan@windriver.com CC: Milton Millermilt...@bga.com CC: linuxppc-dev@lists.ozlabs.org --- arch/powerpc/kernel/kgdb.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/kgdb.c b/arch/powerpc/kernel/kgdb.c index 7a9db64..781acff 100644 --- a/arch/powerpc/kernel/kgdb.c +++ b/arch/powerpc/kernel/kgdb.c @@ -337,7 +337,7 @@ char *dbg_get_reg(int regno, void *mem, struct pt_regs *regs) /* FP registers 32 - 63 */ #if defined(CONFIG_FSL_BOOKE) defined(CONFIG_SPE) if (current) - memcpy(mem, current-thread.evr[regno-32], + memcpy(mem, (void *)current-thread.evr[regno-32], dbg_reg_def[regno].size); #else /* fp registers not used by kernel, leave zero */ @@ -362,7 +362,7 @@ int dbg_set_reg(int regno, void *mem, struct pt_regs *regs) if (regno= 32 regno 64) { /* FP registers 32 - 63 */ #if defined(CONFIG_FSL_BOOKE) defined(CONFIG_SPE) - memcpy(current-thread.evr[regno-32], mem, + memcpy((void *)current-thread.evr[regno-32], mem, Doesn't any pointer type get converted to 'void *' automatically? These casts are not really needed... WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH v2]460EX on-chip SATA driverresubmisison
Hello. Rupjyoti Sarmah wrote: This patch enables the on-chip DWC SATA controller of the AppliedMicro processor 460EX. Too bad thius has already been applied but here's my (mostly stylistic) comments anyway: Signed-off-by: Rupjyoti Sarmah rsar...@appliedmicro.com Signed-off-by: Mark Miesfeld mmiesf...@appliedmicro.com Signed-off-by: Prodyut Hazarika phazar...@appliedmicro.com [...] diff --git a/drivers/ata/sata_dwc_460ex.c b/drivers/ata/sata_dwc_460ex.c new file mode 100644 index 000..ea24c1e --- /dev/null +++ b/drivers/ata/sata_dwc_460ex.c @@ -0,0 +1,1756 @@ +/* + * drivers/ata/sata_dwc_460ex.c Filenames in the heading comments have long been frowned upon. +#ifdef CONFIG_SATA_DWC_DEBUG I don't see this option defined anywahere. +#define DEBUG +#endif + +#ifdef CONFIG_SATA_DWC_VDEBUG The same about this one. +#define VERBOSE_DEBUG +#define DEBUG_NCQ +#endif [...] +/* SATA DMA driver Globals */ +#define DMA_NUM_CHANS 1 +#define DMA_NUM_CHAN_REGS 8 + +/* SATA DMA Register definitions */ +#define AHB_DMA_BRST_DFLT 64 /* 16 data items burst length*/ Please put a space before */. +struct ahb_dma_regs { + struct dma_chan_regschan_regs[DMA_NUM_CHAN_REGS]; + struct dma_interrupt_regs interrupt_raw;/* Raw Interrupt */ + struct dma_interrupt_regs interrupt_status; /* Interrupt Status */ + struct dma_interrupt_regs interrupt_mask; /* Interrupt Mask */ + struct dma_interrupt_regs interrupt_clear; /* Interrupt Clear */ + struct dmareg statusInt; /* Interrupt combined*/ No camelCase please, rename it to status_int. +#defineDMA_CTL_BLK_TS(size)((size) 0x00FFF) /* Blk Transfer size */ +#define DMA_CHANNEL(ch)(0x0001 (ch)) /* Select channel */ + /* Enable channel */ +#defineDMA_ENABLE_CHAN(ch) ((0x0001 (ch)) | \ +((0x1 (ch)) 8)) + /* Disable channel */ +#defineDMA_DISABLE_CHAN(ch)(0x | ((0x1 (ch)) 8)) What's the point of OR'ing with zero? +/* + * Commonly used DWC SATA driver Macros + */ +#define HSDEV_FROM_HOST(host) ((struct sata_dwc_device *)\ + (host)-private_data) +#define HSDEV_FROM_AP(ap) ((struct sata_dwc_device *)\ + (ap)-host-private_data) +#define HSDEVP_FROM_AP(ap) ((struct sata_dwc_device_port *)\ + (ap)-private_data) +#define HSDEV_FROM_QC(qc) ((struct sata_dwc_device *)\ + (qc)-ap-host-private_data) +#define HSDEV_FROM_HSDEVP(p) ((struct sata_dwc_device *)\ + (hsdevp)-hsdev) Are you sure it's '(hsdevp)', not '(p)'? +struct sata_dwc_host_priv { + void__iomem *scr_addr_sstatus; + u32 sata_dwc_sactive_issued ; + u32 sata_dwc_sactive_queued ; Remove spaces befoer semicolons, please. +static void sata_dwc_tf_dump(struct ata_taskfile *tf) +{ + dev_vdbg(host_pvt.dwc_dev, taskfile cmd: 0x%02x protocol: %s flags: + 0x%lx device: %x\n, tf-command, ata_get_cmd_descript\ There's no need to use \ outside macro defintions. +/* + * Function: get_burst_length_encode + * arguments: datalength: length in bytes of data + * returns value to be programmed in register corrresponding to data length + * This value is effectively the log(base 2) of the length + */ +static int get_burst_length_encode(int datalength) +{ + int items = datalength 2; /* div by 4 to get lword count */ + + if (items = 64) + return 5; + + if (items = 32) + return 4; + + if (items = 16) + return 3; + + if (items = 8) + return 2; + + if (items = 4) + return 1; + + return 0; +} Hmm, there should be a function in the kernel to calculate 2^n order from size, something like get_count_order()... +/* + * Function: dma_dwc_interrupt + * arguments: irq, dev_id, pt_regs + * returns channel number if available else -1 + * Interrupt Handler for DW AHB SATA DMA + */ +static irqreturn_t dma_dwc_interrupt(int irq, void *hsdev_instance) +{ + int chan; + u32 tfr_reg, err_reg; + unsigned long flags; + struct sata_dwc_device *hsdev = + (struct sata_dwc_device *)hsdev_instance; + struct ata_host *host = (struct ata_host *)hsdev-host; + struct ata_port *ap; + struct sata_dwc_device_port *hsdevp; + u8 tag = 0; + unsigned int port = 0; + + spin_lock_irqsave(host-lock, flags); + ap = host-ports[port]; + hsdevp = HSDEVP_FROM_AP(ap); + tag = ap-link.active_tag; + + tfr_reg = in_le32((host_pvt.sata_dma_regs-interrupt_status.tfr\ There's no need to use
Re: [PATCH 1/9] Add Synopsys DesignWare HS USB OTG Controller driver.
Hello. Fushen Chen wrote: The DWC OTG driver module provides the initialization and cleanup entry points for the DWC OTG USB driver. Signed-off-by: Fushen Chen fc...@apm.com Signed-off-by: Mark Miesfeld mmiesf...@apm.com [...] diff --git a/arch/powerpc/boot/dts/kilauea.dts b/arch/powerpc/boot/dts/kilauea.dts index 083e68e..1a141b8 100644 --- a/arch/powerpc/boot/dts/kilauea.dts +++ b/arch/powerpc/boot/dts/kilauea.dts @@ -394,5 +394,20 @@ 0x0 0x0 0x0 0x3 UIC2 0xd 0x4 /* swizzled int C */ 0x0 0x0 0x0 0x4 UIC2 0xe 0x4 /* swizzled int D */; }; + + USBOTG0: usb...@ef6c { + compatible = amcc,dwc-otg; + reg = 0xef6c 0x1; + interrupt-parent = USBOTG0; + interrupts = 0x0 0x1 0x2; + #interrupt-cells = 0x1; + #address-cells = 0x0; + #size-cells = 0x0; + interrupt-map = + 0x0 UIC2 0x1e 0x4 /* USB-OTG */ + 0x1 UIC1 0x1a 0x8 /* HIGH-POWER */ + 0x2 UIC0 0xc 0x4 /* DMA */ ; + interrupt-map-mask = 0x; + }; }; }; Please put this file in a separate patch and push thru the PowerPC tree. WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH]Device tree update for the 460ex DWC SATA
Hello. Rupjyoti Sarmah wrote: Device tree update for the Applied micro processor 460ex on-chip SATA. Signed-off-by: Rupjyoti Sarmah rsar...@appliedmicro.com [...] diff --git a/arch/powerpc/boot/dts/canyonlands.dts b/arch/powerpc/boot/dts/canyonlands.dts index cd56bb5..d3b2c99 100644 --- a/arch/powerpc/boot/dts/canyonlands.dts +++ b/arch/powerpc/boot/dts/canyonlands.dts @@ -163,6 +163,14 @@ interrupts = 0x1e 4; }; + SATA0: s...@bffd1000 { +compatible = amcc,sata-460ex; + reg = 4 0xbffd1000 0x800 4 0xbffd0800 0x400; +interrupt-parent = UIC3; +interrupts = 0x0 0x4 /* SATA */ + 0x5 0x4; /* AHBDMA */ Please indent only using tabs consistently. WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH]460EX on-chip SATA driver Kernel 2.6.33 resubmission
Hello. Rupjyoti Sarmah wrote: This patch enables the on-chip DWC SATA controller of the AppliedMicro processor 460EX. Signed-off-by: Rupjyoti Sarmah rsar...@appliedmicro.com Signed-off-by: Mark Miesfeld mmiesf...@appliedmicro.com Signed-off-by: Prodyut Hazarika phazar...@appliedmicro.com --- arch/powerpc/boot/dts/canyonlands.dts |8 + drivers/ata/Kconfig |9 + drivers/ata/Makefile |1 + drivers/ata/sata_dwc.c| 1827 + 4 files changed, 1845 insertions(+), 0 deletions(-) create mode 100644 drivers/ata/sata_dwc.c diff --git a/arch/powerpc/boot/dts/canyonlands.dts b/arch/powerpc/boot/dts/canyonlands.dts index cd56bb5..d3b2c99 100644 --- a/arch/powerpc/boot/dts/canyonlands.dts +++ b/arch/powerpc/boot/dts/canyonlands.dts @@ -163,6 +163,14 @@ interrupts = 0x1e 4; }; + SATA0: s...@bffd1000 { +compatible = amcc,sata-460ex; + reg = 4 0xbffd1000 0x800 4 0xbffd0800 0x400; +interrupt-parent = UIC3; +interrupts = 0x0 0x4 /* SATA */ + 0x5 0x4; /* AHBDMA */ +}; + POB0: opb { compatible = ibm,opb-460ex, ibm,opb; #address-cells = 1; Please put the device tree update in a separate patch to go thru the PowerPC tree. MBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 21/37] drivers/ata: use .dev.of_node instead of .node in struct of_device
Hello. Grant Likely wrote: .node is being removed Signed-off-by: Grant Likely grant.lik...@secretlab.ca --- drivers/ata/pata_macio.c |2 +- drivers/ata/pata_of_platform.c |2 +- drivers/ide/pmac.c | 10 +- 3 files changed, 7 insertions(+), 7 deletions(-) Should probably have been 2 patches instead of one, as drivers/ata/ and drivers/ide/ are different subsystems... MBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 3/5] powerpc/macio: Rework hotplug media bay support
Hello. Benjamin Herrenschmidt wrote: The hotplug mediabay has tendrils deep into drivers/ide code which makes a libata port reather difficult. In addition it's ugly and could be done better. This reworks the interface between the mediabay and the rest of the world so that: - Any macio_driver can now have a mediabay_event callback which will be called when that driver sits on a mediabay and it's been either plugged or unplugged. The device type is passed as an argument. We can now move all the IDE cruft into the IDE driver itself - A check_media_bay() function can be used to take a peek at the type of device currently in the bay if any, a cleaner variant of the previous function with the same name. - A pair of lock/unlock functions are exposed to allow the IDE driver to block the hotplug callbacks during the initial setup and probing of the bay in order to avoid nasty race conditions. - The mediabay code no longer needs to spin on the status register of the IDE interface when it detects an IDE device, this is done just fine by the IDE code itself Overall, less code, simpler, and allows for another driver than our old drivers/ide based one. Signed-off-by: Benjamin Herrenschmidt b...@kernel.crashing.org Some grammar/style nitpicking... Index: linux-work/arch/powerpc/include/asm/mediabay.h === --- linux-work.orig/arch/powerpc/include/asm/mediabay.h 2009-12-01 17:57:00.0 +1100 +++ linux-work/arch/powerpc/include/asm/mediabay.h 2009-12-01 18:00:28.0 +1100 @@ -17,26 +17,31 @@ #define MB_POWER 6 /* media bay contains a Power device (???) */ #define MB_NO 7 /* media bay contains nothing */ -/* Number of bays in the machine or 0 */ -extern int media_bay_count; +struct macio_dev; -#ifdef CONFIG_BLK_DEV_IDE_PMAC -#include linux/ide.h +#ifdef CONFIG_PMAC_MEDIABAY -int check_media_bay_by_base(unsigned long base, int what); -/* called by IDE PMAC host driver to register IDE controller for media bay */ -int media_bay_set_ide_infos(struct device_node *which_bay, unsigned long base, - int irq, ide_hwif_t *hwif); - -int check_media_bay(struct device_node *which_bay, int what); +/* Check the content type of the bay, returns MB_NO if the bay is still + * transitionning + */ Only transitioning. -int check_media_bay_by_base(unsigned long base, int what) +int check_media_bay(struct macio_dev *baydev) { - int i; + struct media_bay_info* bay; + int id; - for (i=0; imedia_bay_count; i++) - if (media_bays[i].mdev base == (unsigned long) media_bays[i].cd_base) { - if ((what == media_bays[i].content_id) media_bays[i].state == mb_up) - return 0; - media_bays[i].cd_index = -1; - return -EINVAL; - } + if (baydev == NULL) + return MB_NO; - return -ENODEV; + /* This returns an instant snapshot, not locking, sine Only since. Index: linux-work/drivers/block/swim3.c === --- linux-work.orig/drivers/block/swim3.c 2009-12-01 17:57:00.0 +1100 +++ linux-work/drivers/block/swim3.c2009-12-01 18:00:28.0 +1100 [...] @@ -303,14 +303,13 @@ static int swim3_readbit(struct floppy_s static void do_fd_request(struct request_queue * q) { int i; - for(i=0;ifloppy_count;i++) - { -#ifdef CONFIG_PMAC_MEDIABAY - if (floppy_states[i].media_bay - check_media_bay(floppy_states[i].media_bay, MB_FD)) + + for(i=0; ifloppy_count; i++) { You could insert spaces around operators here, while at it... MBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [RESEND][PATCH] sata_fsl: hard and soft reset split
Hello. 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 ashish.ka...@freescale.com [...] 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; Why produce unneeded labels and goto's where you can just use return? :-O MBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
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 ashish.ka...@freescale.com [...] 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: Add power mgmt support
Hello. Kumar Gala wrote: From: Dave Liu dave...@freescale.com Signed-off-by: Dave Liu dave...@freescale.com Signed-off-by: Liu Yu yu@freescale.com Signed-off-by: Kumar Gala ga...@kernel.crashing.org --- drivers/ata/sata_fsl.c | 35 +++ 1 files changed, 35 insertions(+), 0 deletions(-) diff --git a/drivers/ata/sata_fsl.c b/drivers/ata/sata_fsl.c index 36b8629..94eaa43 100644 --- a/drivers/ata/sata_fsl.c +++ b/drivers/ata/sata_fsl.c @@ -1378,6 +1378,37 @@ static int sata_fsl_remove(struct of_device *ofdev) return 0; } +#ifdef CONFIG_PM +static int sata_fsl_suspend(struct of_device *op, pm_message_t state) +{ + struct ata_host *host = dev_get_drvdata(op-dev); + return ata_host_suspend(host, state); +} + +static int sata_fsl_resume(struct of_device *op) +{ + struct ata_host *host = dev_get_drvdata(op-dev); + struct sata_fsl_host_priv *host_priv = host-private_data; + int ret; + void __iomem *hcr_base = host_priv-hcr_base; + struct ata_port *ap = host-ports[0]; + struct sata_fsl_port_priv *pp = ap-private_data; + + ret = sata_fsl_init_controller(host); + if (ret) { + dev_printk(KERN_ERR, op-dev, + Error initialize hardware\n); May be initializing? + return ret; + } + + /* Recovery the CHBA register in host controller cmd register set */ Maybe Recover? + iowrite32(pp-cmdslot_paddr 0x, hcr_base + CHBA); + + ata_host_resume(host); + return 0; +} +#endif MBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH 3/3 v3] Add 4xx SATA dts node documentation
Feng Kan wrote: Signed-off-by: Feng Kan f...@amcc.com [...] diff --git a/Documentation/powerpc/dts-bindings/4xx/sata.txt b/Documentation/powerpc/dts-bindings/4xx/sata.txt new file mode 100644 index 000..3ce00d0 --- /dev/null +++ b/Documentation/powerpc/dts-bindings/4xx/sata.txt @@ -0,0 +1,24 @@ +AMCC SoC SATA Support + +This following is only for the 460ex support for Designware SATA core + +Required properties: +- compatible : amcc,sata-460ex. +- reg : the first set defines SATA controller register, the second set +is for the AHB DMA controller for SATA. +- interrupt-parent: UIC3 +- interrupts: one for SATA and one for the DMA + +Notes: +The SATA is only available when the first PCIe port is disabled. + +Example: + +SATA0: s...@bffd1000 { + compatible = amcc,sata-460ex; +reg = 4 0xbffd1000 0x800 4 0xbffd0800 0x400; Spaces ISO tab. + interrupt-parent = UIC3; + interrupts = 0 4 /* SATA */ + 5 4; /* AHBDMA */ +}; + MBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH 2/9] sl82c105: remove dead code
Hello. Bartlomiej Zolnierkiewicz wrote: CONFIG_LOPEC and CONFIG_SANDPOINT config options are gone. So these are gone with arch/ppc/? That's a pity -- MV has spent a lot of efforts on porting the latter to arch/powerpc/ but somehow it haven't got merged upstream. My patches ot this driver were actually due to it being used on Sandpoint. :-) Signed-off-by: Bartlomiej Zolnierkiewicz bzoln...@gmail.com Acked-by: Sergei Shtylyov sshtyl...@ru.mvista.com MBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH 1/3] radeonfb: Fix 64 bits resources on 32 bits archs
Hello. Benjamin Herrenschmidt wrote: This fixes radeonfb to not truncate 64 bits resources on 32 bits platforms. Unfortunately, there are still issues with addresses returned to userspace via struct fb_fix_screeninfo. This will have to be dealt with separately. Signed-off-by: Benjamin Herrenschmidt b...@kernel.crashing.org I'm seeing that these 3 patch series (dating back to April) still unapplied. Have everybody forgotten about them? I'd like to see them finally applied. --- linux-work.orig/drivers/video/aty/radeon_base.c 2008-04-22 11:04:19.0 +1000 +++ linux-work/drivers/video/aty/radeon_base.c 2008-04-22 11:05:00.0 +1000 @@ -1886,7 +1886,7 @@ static int __devinit radeon_set_fbinfo ( info-screen_size = rinfo-mapped_vram; /* Fill fix common fields */ strlcpy(info-fix.id, rinfo-name, sizeof(info-fix.id)); -info-fix.smem_start = rinfo-fb_base_phys; +info-fix.smem_start = (unsigned long)rinfo-fb_base_phys; info-fix.smem_len = rinfo-video_ram; info-fix.type = FB_TYPE_PACKED_PIXELS; info-fix.visual = FB_VISUAL_PSEUDOCOLOR; @@ -1894,7 +1894,7 @@ static int __devinit radeon_set_fbinfo ( info-fix.ypanstep = 1; info-fix.ywrapstep = 0; info-fix.type_aux = 0; -info-fix.mmio_start = rinfo-mmio_base_phys; +info-fix.mmio_start = (unsigned long)rinfo-mmio_base_phys; info-fix.mmio_len = RADEON_REGSIZE; info-fix.accel = FB_ACCEL_ATI_RADEON; Index: linux-work/drivers/video/aty/radeonfb.h === --- linux-work.orig/drivers/video/aty/radeonfb.h2008-04-22 11:03:17.0 +1000 +++ linux-work/drivers/video/aty/radeonfb.h 2008-04-22 11:03:27.0 +1000 @@ -287,8 +287,8 @@ struct radeonfb_info { char name[DEVICE_NAME_SIZE]; - unsigned long mmio_base_phys; - unsigned long fb_base_phys; + resource_size_t mmio_base_phys; + resource_size_t fb_base_phys; void __iomem *mmio_base; void __iomem*fb_base; WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: [PATCH 1/3] radeonfb: Fix 64 bits resources on 32 bits archs
Hello. Benjamin Herrenschmidt wrote: This fixes radeonfb to not truncate 64 bits resources on 32 bits platforms. Unfortunately, there are still issues with addresses returned to userspace via struct fb_fix_screeninfo. This will have to be dealt with separately. Signed-off-by: Benjamin Herrenschmidt b...@kernel.crashing.org I'm seeing that this 3 patch series (dating back to April) still unapplied. Have everybody forgotten about them? I'd like to see them finally applied. --- linux-work.orig/drivers/video/aty/radeon_base.c 2008-04-22 11:04:19.0 +1000 +++ linux-work/drivers/video/aty/radeon_base.c 2008-04-22 11:05:00.0 +1000 @@ -1886,7 +1886,7 @@ static int __devinit radeon_set_fbinfo ( info-screen_size = rinfo-mapped_vram; /* Fill fix common fields */ strlcpy(info-fix.id, rinfo-name, sizeof(info-fix.id)); -info-fix.smem_start = rinfo-fb_base_phys; +info-fix.smem_start = (unsigned long)rinfo-fb_base_phys; info-fix.smem_len = rinfo-video_ram; info-fix.type = FB_TYPE_PACKED_PIXELS; info-fix.visual = FB_VISUAL_PSEUDOCOLOR; @@ -1894,7 +1894,7 @@ static int __devinit radeon_set_fbinfo ( info-fix.ypanstep = 1; info-fix.ywrapstep = 0; info-fix.type_aux = 0; -info-fix.mmio_start = rinfo-mmio_base_phys; +info-fix.mmio_start = (unsigned long)rinfo-mmio_base_phys; info-fix.mmio_len = RADEON_REGSIZE; info-fix.accel = FB_ACCEL_ATI_RADEON; Index: linux-work/drivers/video/aty/radeonfb.h === --- linux-work.orig/drivers/video/aty/radeonfb.h2008-04-22 11:03:17.0 +1000 +++ linux-work/drivers/video/aty/radeonfb.h 2008-04-22 11:03:27.0 +1000 @@ -287,8 +287,8 @@ struct radeonfb_info { char name[DEVICE_NAME_SIZE]; - unsigned long mmio_base_phys; - unsigned long fb_base_phys; + resource_size_t mmio_base_phys; + resource_size_t fb_base_phys; void __iomem *mmio_base; void __iomem*fb_base; WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: Device Tree
Hello. Sébastien Chrétien wrote: Hello, I have a question about Device Tree. Is Device Tree found only only on Linux Powerpc ? Not only Linux as it's a part of Open Firmware which is also used at least on SPARC. WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev
Re: Device Tree
Hello. Sébastien Chrétien wrote: I have a question about Device Tree. Is Device Tree found only only on Linux Powerpc ? Not only Linux as it's a part of Open Firmware which is also used at least on SPARC. WBR, Sergei ___ Linuxppc-dev mailing list Linuxppc-dev@ozlabs.org https://ozlabs.org/mailman/listinfo/linuxppc-dev