* Re: [PATCH][RFC] mpc52xx, common: setup port_config and cdm settings through DTS
From: Wolfram Sang @ 2012-03-19 8:37 UTC (permalink / raw)
To: Anatolij Gustschin; +Cc: Heiko Schocher, linuxppc-dev, Wolfgang Denk
In-Reply-To: <20120319002507.275d73ef@wker>
[-- Attachment #1: Type: text/plain, Size: 1159 bytes --]
On Mon, Mar 19, 2012 at 12:25:07AM +0100, Anatolij Gustschin wrote:
> Hi Heiko,
>
> On Tue, 19 Apr 2011 08:04:05 +0200
> Heiko Schocher <hs@denx.de> wrote:
>
> > If firmware does not setup the "GPS Port Configuration Register"
> > and the "CDM 48MHz Fractional Divider Configuration Register",
> > it can be corrected through DTS.
> >
> > Signed-off-by: Heiko Schocher <hs@denx.de>
> > cc: devictree-discuss@lists.ozlabs.org
> > cc: linuxppc-dev@lists.ozlabs.org
> > cc: Grant Likely <glikely@secretlab.ca>
> > cc: Wolfgang Denk <wd@denx.de>
> > ---
> > .../devicetree/bindings/powerpc/fsl/mpc5200.txt | 16 +++++++++++
> > arch/powerpc/platforms/52xx/mpc52xx_common.c | 27 ++++++++++++++++++++
> > 2 files changed, 43 insertions(+), 0 deletions(-)
>
> Applied slightly modified patch to mpc5xxx next.
Given that the patch was sent nearly one year ago and it even got
modified, could please resend it to the list before applying?
Regards,
Wolfram
--
Pengutronix e.K. | Wolfram Sang |
Industrial Linux Solutions | http://www.pengutronix.de/ |
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]
^ permalink raw reply
* [PATCH] powerpc/crypto: caam - add backward compatible string sec4.0
From: Shengzhou Liu @ 2012-03-19 6:19 UTC (permalink / raw)
To: linuxppc-dev, stable; +Cc: Shengzhou Liu
In some device trees of previous version, there were string "fsl,sec4.0".
To be backward compatible with device trees, we have CAAM driver first
check "fsl,sec-v4.0", if it fails, then check for "fsl,sec4.0".
Signed-off-by: Shengzhou Liu <Shengzhou.Liu@freescale.com>
---
drivers/crypto/caam/caamalg.c | 14 ++++++++++----
drivers/crypto/caam/ctrl.c | 16 ++++++++++++++++
2 files changed, 26 insertions(+), 4 deletions(-)
diff --git a/drivers/crypto/caam/caamalg.c b/drivers/crypto/caam/caamalg.c
index e73cf2e..d10d00b 100644
--- a/drivers/crypto/caam/caamalg.c
+++ b/drivers/crypto/caam/caamalg.c
@@ -2152,8 +2152,11 @@ static void __exit caam_algapi_exit(void)
int i, err;
dev_node = of_find_compatible_node(NULL, NULL, "fsl,sec-v4.0");
- if (!dev_node)
- return;
+ if (!dev_node) {
+ dev_node = of_find_compatible_node(NULL, NULL, "fsl,sec4.0");
+ if (!dev_node)
+ return;
+ }
pdev = of_find_device_by_node(dev_node);
if (!pdev)
@@ -2234,8 +2237,11 @@ static int __init caam_algapi_init(void)
int i = 0, err = 0;
dev_node = of_find_compatible_node(NULL, NULL, "fsl,sec-v4.0");
- if (!dev_node)
- return -ENODEV;
+ if (!dev_node) {
+ dev_node = of_find_compatible_node(NULL, NULL, "fsl,sec4.0");
+ if (!dev_node)
+ return -ENODEV;
+ }
pdev = of_find_device_by_node(dev_node);
if (!pdev)
diff --git a/drivers/crypto/caam/ctrl.c b/drivers/crypto/caam/ctrl.c
index 8ae3ba2..f078fa0 100644
--- a/drivers/crypto/caam/ctrl.c
+++ b/drivers/crypto/caam/ctrl.c
@@ -98,6 +98,12 @@ static int caam_probe(struct platform_device *pdev)
rspec = 0;
for_each_compatible_node(np, NULL, "fsl,sec-v4.0-job-ring")
rspec++;
+ if (!rspec) {
+ /* for backward compatible with device trees */
+ for_each_compatible_node(np, NULL, "fsl,sec4.0-job-ring")
+ rspec++;
+ }
+
ctrlpriv->jrdev = kzalloc(sizeof(struct device *) * rspec, GFP_KERNEL);
if (ctrlpriv->jrdev == NULL) {
iounmap(&topregs->ctrl);
@@ -111,6 +117,13 @@ static int caam_probe(struct platform_device *pdev)
ctrlpriv->total_jobrs++;
ring++;
}
+ if (!ring) {
+ for_each_compatible_node(np, NULL, "fsl,sec4.0-job-ring") {
+ caam_jr_probe(pdev, np, ring);
+ ctrlpriv->total_jobrs++;
+ ring++;
+ }
+ }
/* Check to see if QI present. If so, enable */
ctrlpriv->qi_present = !!(rd_reg64(&topregs->ctrl.perfmon.comp_parms) &
@@ -226,6 +239,9 @@ static struct of_device_id caam_match[] = {
{
.compatible = "fsl,sec-v4.0",
},
+ {
+ .compatible = "fsl,sec4.0",
+ },
{},
};
MODULE_DEVICE_TABLE(of, caam_match);
--
1.7.0.4
^ permalink raw reply related
* [PATCH -v11 15/30] PCI, powerpc: Register busn_res for root buses
From: Yinghai Lu @ 2012-03-19 5:42 UTC (permalink / raw)
To: Jesse Barnes, Benjamin Herrenschmidt, Tony Luck, David Miller,
x86
Cc: linux-arch, Greg Kroah-Hartman, linuxppc-dev, linux-kernel,
Dominik Brodowski, Yinghai Lu, linux-pci, Bjorn Helgaas,
Paul Mackerras, Andrew Morton, Linus Torvalds
In-Reply-To: <1332135781-13695-1-git-send-email-yinghai@kernel.org>
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: linuxppc-dev@lists.ozlabs.org
---
arch/powerpc/include/asm/pci-bridge.h | 1 +
arch/powerpc/kernel/pci-common.c | 10 +++++++++-
2 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/arch/powerpc/include/asm/pci-bridge.h b/arch/powerpc/include/asm/pci-bridge.h
index 5d48765..11cebf0 100644
--- a/arch/powerpc/include/asm/pci-bridge.h
+++ b/arch/powerpc/include/asm/pci-bridge.h
@@ -30,6 +30,7 @@ struct pci_controller {
int first_busno;
int last_busno;
int self_busno;
+ struct resource busn;
void __iomem *io_base_virt;
#ifdef CONFIG_PPC64
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index 910b9de..ee8c0c9 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -1648,6 +1648,11 @@ void __devinit pcibios_scan_phb(struct pci_controller *hose)
/* Wire up PHB bus resources */
pcibios_setup_phb_resources(hose, &resources);
+ hose->busn.start = hose->first_busno;
+ hose->busn.end = hose->last_busno;
+ hose->busn.flags = IORESOURCE_BUS;
+ pci_add_resource(&resources, &hose->busn);
+
/* Create an empty bus for the toplevel */
bus = pci_create_root_bus(hose->parent, hose->first_busno,
hose->ops, hose, &resources);
@@ -1670,8 +1675,11 @@ void __devinit pcibios_scan_phb(struct pci_controller *hose)
of_scan_bus(node, bus);
}
- if (mode == PCI_PROBE_NORMAL)
+ if (mode == PCI_PROBE_NORMAL) {
+ pci_bus_update_busn_res_end(bus, 255);
hose->last_busno = bus->subordinate = pci_scan_child_bus(bus);
+ pci_bus_update_busn_res_end(bus, bus->subordinate);
+ }
/* Platform gets a chance to do some global fixups before
* we proceed to resource allocation
--
1.7.7
^ permalink raw reply related
* [PATCH 1/2] [v4] powerpc/44x: Fix PCI MSI support for Maui APM821xx SoC and Bluestone board
From: Mai La @ 2012-03-19 3:59 UTC (permalink / raw)
To: Benjamin Herrenschmidt, Paul Mackerras, Josh Boyer, Matt Porter,
Tirumala R Marri, Grant Likely, Michael Neuling, Kumar Gala,
Anton Blanchard, linuxppc-dev, linux-kernel
Cc: open-source-review, Mai La
This patch consists of:
- Enable PCI MSI as default for Bluestone board
- Change definition of number of MSI interrupts as it depends on SoC
- Fix returning ENODEV as finding MSI node
- Fix MSI physical high and low address
- Keep MSI data logically
Signed-off-by: Mai La <mla@apm.com>
---
v4:
Per Josh Boyer's comment:
* Declare msi_irqs as static
* Handle error if allocation of MSI vitual interrupts fails
* Return ENODEV if counting MSI interrupts fails
v3:
* Use upper_32_bits() / lower_32_bits() consistently as Wolfgang Denk recomments
v2:
* Change definition of number of MSI interrupt from config to count interrupts in device tree
---
arch/powerpc/platforms/44x/Kconfig | 2 +
arch/powerpc/sysdev/ppc4xx_msi.c | 42 ++++++++++++++++++++++++------------
2 files changed, 30 insertions(+), 14 deletions(-)
diff --git a/arch/powerpc/platforms/44x/Kconfig b/arch/powerpc/platforms/44x/Kconfig
index fcf6bf2..9f04ce3 100644
--- a/arch/powerpc/platforms/44x/Kconfig
+++ b/arch/powerpc/platforms/44x/Kconfig
@@ -23,6 +23,8 @@ config BLUESTONE
default n
select PPC44x_SIMPLE
select APM821xx
+ select PCI_MSI
+ select PPC4xx_MSI
select IBM_EMAC_RGMII
help
This option enables support for the APM APM821xx Evaluation board.
diff --git a/arch/powerpc/sysdev/ppc4xx_msi.c b/arch/powerpc/sysdev/ppc4xx_msi.c
index 1c2d7af..cc17f59 100644
--- a/arch/powerpc/sysdev/ppc4xx_msi.c
+++ b/arch/powerpc/sysdev/ppc4xx_msi.c
@@ -28,10 +28,11 @@
#include <linux/of_platform.h>
#include <linux/interrupt.h>
#include <linux/export.h>
+#include <linux/kernel.h>
#include <asm/prom.h>
#include <asm/hw_irq.h>
#include <asm/ppc-pci.h>
-#include <boot/dcr.h>
+#include <asm/dcr.h>
#include <asm/dcr-regs.h>
#include <asm/msi_bitmap.h>
@@ -43,13 +44,14 @@
#define PEIH_FLUSH0 0x30
#define PEIH_FLUSH1 0x38
#define PEIH_CNTRST 0x48
-#define NR_MSI_IRQS 4
+
+static int msi_irqs;
struct ppc4xx_msi {
u32 msi_addr_lo;
u32 msi_addr_hi;
void __iomem *msi_regs;
- int msi_virqs[NR_MSI_IRQS];
+ int *msi_virqs;
struct msi_bitmap bitmap;
struct device_node *msi_dev;
};
@@ -61,7 +63,7 @@ static int ppc4xx_msi_init_allocator(struct platform_device *dev,
{
int err;
- err = msi_bitmap_alloc(&msi_data->bitmap, NR_MSI_IRQS,
+ err = msi_bitmap_alloc(&msi_data->bitmap, msi_irqs,
dev->dev.of_node);
if (err)
return err;
@@ -83,6 +85,11 @@ static int ppc4xx_setup_msi_irqs(struct pci_dev *dev, int nvec, int type)
struct msi_desc *entry;
struct ppc4xx_msi *msi_data = &ppc4xx_msi;
+ msi_data->msi_virqs = kmalloc((msi_irqs) * sizeof(int),
+ GFP_KERNEL);
+ if (!msi_data->msi_virqs)
+ return -ENOMEM;
+
list_for_each_entry(entry, &dev->msi_list, list) {
int_no = msi_bitmap_alloc_hwirqs(&msi_data->bitmap, 1);
if (int_no >= 0)
@@ -150,12 +157,11 @@ static int ppc4xx_setup_pcieh_hw(struct platform_device *dev,
if (!sdr_addr)
return -1;
- SDR0_WRITE(sdr_addr, (u64)res.start >> 32); /*HIGH addr */
- SDR0_WRITE(sdr_addr + 1, res.start & 0xFFFFFFFF); /* Low addr */
-
+ mtdcri(SDR0, *sdr_addr, upper_32_bits(res.start)); /*HIGH addr */
+ mtdcri(SDR0, *sdr_addr + 1, lower_32_bits(res.start)); /* Low addr */
msi->msi_dev = of_find_node_by_name(NULL, "ppc4xx-msi");
- if (msi->msi_dev)
+ if (!msi->msi_dev)
return -ENODEV;
msi->msi_regs = of_iomap(msi->msi_dev, 0);
@@ -167,9 +173,12 @@ static int ppc4xx_setup_pcieh_hw(struct platform_device *dev,
(u32) (msi->msi_regs + PEIH_TERMADH), (u32) (msi->msi_regs));
msi_virt = dma_alloc_coherent(&dev->dev, 64, &msi_phys, GFP_KERNEL);
- msi->msi_addr_hi = 0x0;
- msi->msi_addr_lo = (u32) msi_phys;
- dev_dbg(&dev->dev, "PCIE-MSI: msi address 0x%x\n", msi->msi_addr_lo);
+ if (!msi_virt)
+ return -ENOMEM;
+ msi->msi_addr_hi = (u32)(msi_phys >> 32);
+ msi->msi_addr_lo = (u32)(msi_phys & 0xffffffff);
+ dev_dbg(&dev->dev, "PCIE-MSI: msi address high 0x%x, low 0x%x\n",
+ msi->msi_addr_hi, msi->msi_addr_lo);
/* Progam the Interrupt handler Termination addr registers */
out_be32(msi->msi_regs + PEIH_TERMADH, msi->msi_addr_hi);
@@ -185,6 +194,8 @@ static int ppc4xx_setup_pcieh_hw(struct platform_device *dev,
out_be32(msi->msi_regs + PEIH_MSIED, *msi_data);
out_be32(msi->msi_regs + PEIH_MSIMK, *msi_mask);
+ dma_free_coherent(&dev->dev, 64, msi_virt, msi_phys);
+
return 0;
}
@@ -194,7 +205,7 @@ static int ppc4xx_of_msi_remove(struct platform_device *dev)
int i;
int virq;
- for (i = 0; i < NR_MSI_IRQS; i++) {
+ for (i = 0; i < msi_irqs; i++) {
virq = msi->msi_virqs[i];
if (virq != NO_IRQ)
irq_dispose_mapping(virq);
@@ -215,8 +226,6 @@ static int __devinit ppc4xx_msi_probe(struct platform_device *dev)
struct resource res;
int err = 0;
- msi = &ppc4xx_msi;/*keep the msi data for further use*/
-
dev_dbg(&dev->dev, "PCIE-MSI: Setting up MSI support...\n");
msi = kzalloc(sizeof(struct ppc4xx_msi), GFP_KERNEL);
@@ -234,6 +243,10 @@ static int __devinit ppc4xx_msi_probe(struct platform_device *dev)
goto error_out;
}
+ msi_irqs = of_irq_count(dev->dev.of_node);
+ if (!msi_irqs)
+ return -ENODEV;
+
if (ppc4xx_setup_pcieh_hw(dev, res, msi))
goto error_out;
@@ -242,6 +255,7 @@ static int __devinit ppc4xx_msi_probe(struct platform_device *dev)
dev_err(&dev->dev, "Error allocating MSI bitmap\n");
goto error_out;
}
+ ppc4xx_msi = *msi;
ppc_md.setup_msi_irqs = ppc4xx_setup_msi_irqs;
ppc_md.teardown_msi_irqs = ppc4xx_teardown_msi_irqs;
--
1.7.3.4
^ permalink raw reply related
* RE: fsl pci edac patches
From: Zang Roy-R61911 @ 2012-03-19 2:50 UTC (permalink / raw)
To: Dmitry Eremin-Solenikov, Kumar Gala
Cc: Lan Chunhe-B25806, linuxppc-dev@lists.ozlabs.org list
In-Reply-To: <CALT56yMXbaxJTGhL-8Hg3Dokc=Oi2qVKo912Q6uX3X8OErgB3w@mail.gmail.com>
> -----Original Message-----
> From: linuxppc-dev-bounces+tie-fei.zang=3Dfreescale.com@lists.ozlabs.org
> [mailto:linuxppc-dev-bounces+tie-fei.zang=3Dfreescale.com@lists.ozlabs.or=
g]
> On Behalf Of Dmitry Eremin-Solenikov
> Sent: Sunday, March 18, 2012 1:11 AM
> To: Kumar Gala
> Cc: Lan Chunhe-B25806; linuxppc-dev@lists.ozlabs.org list
> Subject: Re: fsl pci edac patches
>=20
> Hello,
>=20
> On Sat, Mar 17, 2012 at 1:13 AM, Kumar Gala <galak@kernel.crashing.org>
> wrote:
> > Guys,
> >
> > I'm not sure what the state of the EDAC patches and latest kernel are..
> I'm going to mark the ones in patch works as 'dead' and hopefully you guy=
s
> will resend if there is still an interest.
>=20
> I don't have mpc85xx hardware to test at this point, so probably I
> don't care about 85xx EDAC binding right now.
> Strictly speaking I forgot about these patches :(
I do think the patch are still necessary, but need to update to new kernel =
base.
There are some 85xx pcie errata which need to be implemented in the EDAC co=
de.
Thanks.
Roy
^ permalink raw reply
* Re: [PATCH net-next 4/4] gianfar: use netif_tx_queue_stopped instead of __netif_subqueue_stopped
From: Eric Dumazet @ 2012-03-18 23:53 UTC (permalink / raw)
To: Paul Gortmaker; +Cc: netdev, linuxppc-dev, davem, therbert
In-Reply-To: <CAP=VYLpzpbLVAJ6=L1jdoZWcyAWPPKGMFTKBVU=7=HR+qTxwwA@mail.gmail.com>
Le dimanche 18 mars 2012 à 19:24 -0400, Paul Gortmaker a écrit :
> On Sun, Mar 18, 2012 at 5:55 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> > On Sun, 2012-03-18 at 17:39 -0400, Paul Gortmaker wrote:
> >> The __netif_subqueue_stopped() just does the following:
> >>
> >> struct netdev_queue *txq = netdev_get_tx_queue(dev, queue_index);
> >> return netif_tx_queue_stopped(txq);
> >>
> >> and since we already have the txq in scope, we can just call that
> >> directly in this case.
> >>
> >> Suggested-by: Eric Dumazet <eric.dumazet@gmail.com>
> >> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> >> ---
> >> drivers/net/ethernet/freescale/gianfar.c | 2 +-
> >> 1 files changed, 1 insertions(+), 1 deletions(-)
> >>
> >> diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c
> >> index 6e66cc3..d9428f0 100644
> >> --- a/drivers/net/ethernet/freescale/gianfar.c
> >> +++ b/drivers/net/ethernet/freescale/gianfar.c
> >> @@ -2565,7 +2565,7 @@ static int gfar_clean_tx_ring(struct gfar_priv_tx_q *tx_queue)
> >> }
> >>
> >> /* If we freed a buffer, we can restart transmission, if necessary */
> >> - if (__netif_subqueue_stopped(dev, tqi) && tx_queue->num_txbdfree)
> >> + if (netif_tx_queue_stopped(txq) && tx_queue->num_txbdfree)
> >> netif_wake_subqueue(dev, tqi);
> >>
> >> /* Update dirty indicators */
> >
> > Please change netif_wake_subqueue() as well ;)
>
> I looked at this earlier when I added patch #4 but I was concerned about
> the different semantics.
>
> The netif_wake_subqueue() just returns on a netpoll_trap but the other
> netif_tx_wake_queue() actually calls netif_tx_start_queue() for the same
> netpoll_trap instance. Maybe that is OK, but I didn't want to be changing
> the behaviour of subtleties in stuff where I am clearly still learning.
>
I see... commit 7b3d3e4fc68 added a small difference here...
^ permalink raw reply
* Re: [PATCH 4/4] powerpc, mpc5200: add options to mpc5200_defconfig
From: Anatolij Gustschin @ 2012-03-18 23:44 UTC (permalink / raw)
To: Heiko Schocher; +Cc: linuxppc-dev
In-Reply-To: <1308729311-15375-5-git-send-email-hs@denx.de>
On Wed, 22 Jun 2011 09:55:11 +0200
Heiko Schocher <hs@denx.de> wrote:
> Add the following options to the mpc5200_defconfig, needed
> for the a4m072 board support:
>
> CONFIG_AMD_PHY=y
> CONFIG_MTD_PLATRAM=y -> this deletes CONFIG_MTD_RAM=y
> CONFIG_GPIO_SYSFS=y
> CONFIG_SENSORS_LM87=m
> CONFIG_RTC_DRV_PCF8563=m
>
> Signed-off-by: Heiko Schocher <hs@denx.de>
> cc: Wolfgang Denk <wd@denx.de>
> ---
> arch/powerpc/configs/mpc5200_defconfig | 6 +++++-
> 1 files changed, 5 insertions(+), 1 deletions(-)
I squashed both patches (3/4, 4/4) to a single patch when re-basing
and applying.
Thanks,
Anatolij
^ permalink raw reply
* Re: [PATCH v2 2/4] powerpc, mpc52xx: add a4m072 board support
From: Anatolij Gustschin @ 2012-03-18 23:38 UTC (permalink / raw)
To: Heiko Schocher; +Cc: devicetree-discuss, linuxppc-dev
In-Reply-To: <1308739150-31527-1-git-send-email-hs@denx.de>
Hi Heiko,
On Wed, 22 Jun 2011 12:39:10 +0200
Heiko Schocher <hs@denx.de> wrote:
...
> diff --git a/arch/powerpc/boot/dts/a4m072.dts b/arch/powerpc/boot/dts/a4m072.dts
> new file mode 100644
> index 0000000..adb6746
> --- /dev/null
> +++ b/arch/powerpc/boot/dts/a4m072.dts
...
> + cdm@200 {
> + fsl,ext_48mhz_en = <0x0>;
> + fsl,fd_enable = <0x01>;
> + fsl,fd_counters = <0xbbbb>;
When applying this patch I've fixed these properties according to
previously added bindings (fsl,init-*-*), but one question remains:
is fd-counters value really 0xbbbb? Here, the 3rd bit in each nibble
should always be cleared as mentioned in the register description.
...
> + timer@600 {
> + compatible = "fsl,mpc5200b-gpt","fsl,mpc5200-gpt";
> + reg = <0x600 0x80>;
> + interrupts = <1 9 0>;
I've removed above three lines as these are already in the dtsi file.
Thanks,
Anatolij
^ permalink raw reply
* Re: [PATCH][RFC] mpc52xx, common: setup port_config and cdm settings through DTS
From: Anatolij Gustschin @ 2012-03-18 23:25 UTC (permalink / raw)
To: Heiko Schocher; +Cc: linuxppc-dev, Wolfgang Denk
In-Reply-To: <1303193045-20111-1-git-send-email-hs@denx.de>
Hi Heiko,
On Tue, 19 Apr 2011 08:04:05 +0200
Heiko Schocher <hs@denx.de> wrote:
> If firmware does not setup the "GPS Port Configuration Register"
> and the "CDM 48MHz Fractional Divider Configuration Register",
> it can be corrected through DTS.
>
> Signed-off-by: Heiko Schocher <hs@denx.de>
> cc: devictree-discuss@lists.ozlabs.org
> cc: linuxppc-dev@lists.ozlabs.org
> cc: Grant Likely <glikely@secretlab.ca>
> cc: Wolfgang Denk <wd@denx.de>
> ---
> .../devicetree/bindings/powerpc/fsl/mpc5200.txt | 16 +++++++++++
> arch/powerpc/platforms/52xx/mpc52xx_common.c | 27 ++++++++++++++++++++
> 2 files changed, 43 insertions(+), 0 deletions(-)
Applied slightly modified patch to mpc5xxx next.
Thanks,
Anatolij
^ permalink raw reply
* Re: [PATCH net-next 4/4] gianfar: use netif_tx_queue_stopped instead of __netif_subqueue_stopped
From: Paul Gortmaker @ 2012-03-18 23:24 UTC (permalink / raw)
To: Eric Dumazet; +Cc: netdev, linuxppc-dev, davem, therbert
In-Reply-To: <1332107741.9397.27.camel@edumazet-glaptop>
On Sun, Mar 18, 2012 at 5:55 PM, Eric Dumazet <eric.dumazet@gmail.com> wrot=
e:
> On Sun, 2012-03-18 at 17:39 -0400, Paul Gortmaker wrote:
>> The __netif_subqueue_stopped() just does the following:
>>
>> =A0 =A0 =A0 =A0 struct netdev_queue *txq =3D netdev_get_tx_queue(dev, qu=
eue_index);
>> =A0 =A0 =A0 =A0 return netif_tx_queue_stopped(txq);
>>
>> and since we already have the txq in scope, we can just call that
>> directly in this case.
>>
>> Suggested-by: Eric Dumazet <eric.dumazet@gmail.com>
>> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
>> ---
>> =A0drivers/net/ethernet/freescale/gianfar.c | =A0 =A02 +-
>> =A01 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethe=
rnet/freescale/gianfar.c
>> index 6e66cc3..d9428f0 100644
>> --- a/drivers/net/ethernet/freescale/gianfar.c
>> +++ b/drivers/net/ethernet/freescale/gianfar.c
>> @@ -2565,7 +2565,7 @@ static int gfar_clean_tx_ring(struct gfar_priv_tx_=
q *tx_queue)
>> =A0 =A0 =A0 }
>>
>> =A0 =A0 =A0 /* If we freed a buffer, we can restart transmission, if nec=
essary */
>> - =A0 =A0 if (__netif_subqueue_stopped(dev, tqi) && tx_queue->num_txbdfr=
ee)
>> + =A0 =A0 if (netif_tx_queue_stopped(txq) && tx_queue->num_txbdfree)
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 netif_wake_subqueue(dev, tqi);
>>
>> =A0 =A0 =A0 /* Update dirty indicators */
>
> Please change netif_wake_subqueue() as well ;)
I looked at this earlier when I added patch #4 but I was concerned about
the different semantics.
The netif_wake_subqueue() just returns on a netpoll_trap but the other
netif_tx_wake_queue() actually calls netif_tx_start_queue() for the same
netpoll_trap instance. Maybe that is OK, but I didn't want to be changing
the behaviour of subtleties in stuff where I am clearly still learning.
Thanks,
Paul.
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at =A0http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH net-next 4/4] gianfar: use netif_tx_queue_stopped instead of __netif_subqueue_stopped
From: Eric Dumazet @ 2012-03-18 21:55 UTC (permalink / raw)
To: Paul Gortmaker; +Cc: netdev, linuxppc-dev, davem, therbert
In-Reply-To: <1332106761-18293-5-git-send-email-paul.gortmaker@windriver.com>
On Sun, 2012-03-18 at 17:39 -0400, Paul Gortmaker wrote:
> The __netif_subqueue_stopped() just does the following:
>
> struct netdev_queue *txq = netdev_get_tx_queue(dev, queue_index);
> return netif_tx_queue_stopped(txq);
>
> and since we already have the txq in scope, we can just call that
> directly in this case.
>
> Suggested-by: Eric Dumazet <eric.dumazet@gmail.com>
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---
> drivers/net/ethernet/freescale/gianfar.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c
> index 6e66cc3..d9428f0 100644
> --- a/drivers/net/ethernet/freescale/gianfar.c
> +++ b/drivers/net/ethernet/freescale/gianfar.c
> @@ -2565,7 +2565,7 @@ static int gfar_clean_tx_ring(struct gfar_priv_tx_q *tx_queue)
> }
>
> /* If we freed a buffer, we can restart transmission, if necessary */
> - if (__netif_subqueue_stopped(dev, tqi) && tx_queue->num_txbdfree)
> + if (netif_tx_queue_stopped(txq) && tx_queue->num_txbdfree)
> netif_wake_subqueue(dev, tqi);
>
> /* Update dirty indicators */
Please change netif_wake_subqueue() as well ;)
^ permalink raw reply
* [PATCH net-next 4/4] gianfar: use netif_tx_queue_stopped instead of __netif_subqueue_stopped
From: Paul Gortmaker @ 2012-03-18 21:39 UTC (permalink / raw)
To: davem, eric.dumazet, therbert; +Cc: netdev, linuxppc-dev, Paul Gortmaker
In-Reply-To: <1332106761-18293-1-git-send-email-paul.gortmaker@windriver.com>
The __netif_subqueue_stopped() just does the following:
struct netdev_queue *txq = netdev_get_tx_queue(dev, queue_index);
return netif_tx_queue_stopped(txq);
and since we already have the txq in scope, we can just call that
directly in this case.
Suggested-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/net/ethernet/freescale/gianfar.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c
index 6e66cc3..d9428f0 100644
--- a/drivers/net/ethernet/freescale/gianfar.c
+++ b/drivers/net/ethernet/freescale/gianfar.c
@@ -2565,7 +2565,7 @@ static int gfar_clean_tx_ring(struct gfar_priv_tx_q *tx_queue)
}
/* If we freed a buffer, we can restart transmission, if necessary */
- if (__netif_subqueue_stopped(dev, tqi) && tx_queue->num_txbdfree)
+ if (netif_tx_queue_stopped(txq) && tx_queue->num_txbdfree)
netif_wake_subqueue(dev, tqi);
/* Update dirty indicators */
--
1.7.9.1
^ permalink raw reply related
* [PATCH net-next 3/4] gianfar: delete orphaned version strings and dead macros
From: Paul Gortmaker @ 2012-03-18 21:39 UTC (permalink / raw)
To: davem, eric.dumazet, therbert; +Cc: netdev, linuxppc-dev, Paul Gortmaker
In-Reply-To: <1332106761-18293-1-git-send-email-paul.gortmaker@windriver.com>
There were two version strings, and neither one was being used.
Also in the same proximity were some unused #define that were
left over from the past. Delete them all.
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/net/ethernet/freescale/gianfar.c | 3 ---
drivers/net/ethernet/freescale/gianfar.h | 3 ---
2 files changed, 0 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c
index a4c934b..6e66cc3 100644
--- a/drivers/net/ethernet/freescale/gianfar.c
+++ b/drivers/net/ethernet/freescale/gianfar.c
@@ -104,10 +104,7 @@
#include "fsl_pq_mdio.h"
#define TX_TIMEOUT (1*HZ)
-#undef BRIEF_GFAR_ERRORS
-#undef VERBOSE_GFAR_ERRORS
-const char gfar_driver_name[] = "Gianfar Ethernet";
const char gfar_driver_version[] = "1.3";
static int gfar_enet_open(struct net_device *dev);
diff --git a/drivers/net/ethernet/freescale/gianfar.h b/drivers/net/ethernet/freescale/gianfar.h
index 4fe0f34..fc2488a 100644
--- a/drivers/net/ethernet/freescale/gianfar.h
+++ b/drivers/net/ethernet/freescale/gianfar.h
@@ -78,11 +78,8 @@ struct ethtool_rx_list {
#define INCREMENTAL_BUFFER_SIZE 512
#define PHY_INIT_TIMEOUT 100000
-#define GFAR_PHY_CHANGE_TIME 2
-#define DEVICE_NAME "%s: Gianfar Ethernet Controller Version 1.2, "
#define DRV_NAME "gfar-enet"
-extern const char gfar_driver_name[];
extern const char gfar_driver_version[];
/* MAXIMUM NUMBER OF QUEUES SUPPORTED */
--
1.7.9.1
^ permalink raw reply related
* [PATCH net-next 1/4] gianfar: Add support for byte queue limits.
From: Paul Gortmaker @ 2012-03-18 21:39 UTC (permalink / raw)
To: davem, eric.dumazet, therbert; +Cc: netdev, linuxppc-dev, Paul Gortmaker
In-Reply-To: <1332106761-18293-1-git-send-email-paul.gortmaker@windriver.com>
Add support for byte queue limits (BQL), based on the similar
modifications made to intel/igb/igb_main.c from Eric Dumazet
in commit bdbc063129e811264cd6c311d8c2d9b95de01231
"igb: Add support for byte queue limits."
A local variable for tx_queue->qindex was introduced in
gfar_clean_tx_ring, since it is now used often enough to warrant it,
and it cleans up the readability somewhat as well.
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/net/ethernet/freescale/gianfar.c | 19 ++++++++++++++++---
1 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c
index adb0ae4..a4c934b 100644
--- a/drivers/net/ethernet/freescale/gianfar.c
+++ b/drivers/net/ethernet/freescale/gianfar.c
@@ -1755,9 +1755,12 @@ static void free_skb_resources(struct gfar_private *priv)
/* Go through all the buffer descriptors and free their data buffers */
for (i = 0; i < priv->num_tx_queues; i++) {
+ struct netdev_queue *txq;
tx_queue = priv->tx_queue[i];
+ txq = netdev_get_tx_queue(tx_queue->dev, tx_queue->qindex);
if(tx_queue->tx_skbuff)
free_skb_tx_queue(tx_queue);
+ netdev_tx_reset_queue(txq);
}
for (i = 0; i < priv->num_rx_queues; i++) {
@@ -2217,6 +2220,8 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev)
lstatus |= BD_LFLAG(TXBD_CRC | TXBD_READY) | skb_headlen(skb);
}
+ netdev_tx_sent_queue(txq, skb->len);
+
/*
* We can work in parallel with gfar_clean_tx_ring(), except
* when modifying num_txbdfree. Note that we didn't grab the lock
@@ -2460,6 +2465,7 @@ static void gfar_align_skb(struct sk_buff *skb)
static int gfar_clean_tx_ring(struct gfar_priv_tx_q *tx_queue)
{
struct net_device *dev = tx_queue->dev;
+ struct netdev_queue *txq;
struct gfar_private *priv = netdev_priv(dev);
struct gfar_priv_rx_q *rx_queue = NULL;
struct txbd8 *bdp, *next = NULL;
@@ -2471,10 +2477,13 @@ static int gfar_clean_tx_ring(struct gfar_priv_tx_q *tx_queue)
int frags = 0, nr_txbds = 0;
int i;
int howmany = 0;
+ int tqi = tx_queue->qindex;
+ unsigned int bytes_sent = 0;
u32 lstatus;
size_t buflen;
- rx_queue = priv->rx_queue[tx_queue->qindex];
+ rx_queue = priv->rx_queue[tqi];
+ txq = netdev_get_tx_queue(dev, tqi);
bdp = tx_queue->dirty_tx;
skb_dirtytx = tx_queue->skb_dirtytx;
@@ -2533,6 +2542,8 @@ static int gfar_clean_tx_ring(struct gfar_priv_tx_q *tx_queue)
bdp = next_txbd(bdp, base, tx_ring_size);
}
+ bytes_sent += skb->len;
+
/*
* If there's room in the queue (limit it to rx_buffer_size)
* we add this skb back into the pool, if it's the right size
@@ -2557,13 +2568,15 @@ static int gfar_clean_tx_ring(struct gfar_priv_tx_q *tx_queue)
}
/* If we freed a buffer, we can restart transmission, if necessary */
- if (__netif_subqueue_stopped(dev, tx_queue->qindex) && tx_queue->num_txbdfree)
- netif_wake_subqueue(dev, tx_queue->qindex);
+ if (__netif_subqueue_stopped(dev, tqi) && tx_queue->num_txbdfree)
+ netif_wake_subqueue(dev, tqi);
/* Update dirty indicators */
tx_queue->skb_dirtytx = skb_dirtytx;
tx_queue->dirty_tx = bdp;
+ netdev_tx_completed_queue(txq, howmany, bytes_sent);
+
return howmany;
}
--
1.7.9.1
^ permalink raw reply related
* [PATCH net-next 2/4] gianfar: constify giant block of status descriptor strings
From: Paul Gortmaker @ 2012-03-18 21:39 UTC (permalink / raw)
To: davem, eric.dumazet, therbert; +Cc: netdev, linuxppc-dev, Paul Gortmaker
In-Reply-To: <1332106761-18293-1-git-send-email-paul.gortmaker@windriver.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/net/ethernet/freescale/gianfar_ethtool.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/net/ethernet/freescale/gianfar_ethtool.c b/drivers/net/ethernet/freescale/gianfar_ethtool.c
index 5a78d55..8d74efd 100644
--- a/drivers/net/ethernet/freescale/gianfar_ethtool.c
+++ b/drivers/net/ethernet/freescale/gianfar_ethtool.c
@@ -58,7 +58,7 @@ static void gfar_gringparam(struct net_device *dev, struct ethtool_ringparam *rv
static int gfar_sringparam(struct net_device *dev, struct ethtool_ringparam *rvals);
static void gfar_gdrvinfo(struct net_device *dev, struct ethtool_drvinfo *drvinfo);
-static char stat_gstrings[][ETH_GSTRING_LEN] = {
+static const char stat_gstrings[][ETH_GSTRING_LEN] = {
"rx-dropped-by-kernel",
"rx-large-frame-errors",
"rx-short-frame-errors",
--
1.7.9.1
^ permalink raw reply related
* [PATCH v2 net-next 0/4] Gianfar byte queue limits
From: Paul Gortmaker @ 2012-03-18 21:39 UTC (permalink / raw)
To: davem, eric.dumazet, therbert; +Cc: netdev, linuxppc-dev, Paul Gortmaker
In-Reply-To: <1332089787-24086-1-git-send-email-paul.gortmaker@windriver.com>
Identical to v1 but with the additional patch suggested by Eric.
Compile tested. The v1 text follows below the pull request.
Sorry for the near back-to-back sends; I would have liked to have
got this out earlier in the week and not so close to net-next
closing, but that just didn't happen...
Thanks,
Paul
---
The following changes since commit cdf485be3a63d1f34293740fb726088c6840ceea:
ixgbe: dcb: use DCB config values for FCoE traffic class on open (2012-03-14 00:49:10 -0700)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux.git gianfar-bql
for you to fetch changes up to 5407b14c6792d6ff122ecb1a2a6acffad60ef389:
gianfar: use netif_tx_queue_stopped instead of __netif_subqueue_stopped (2012-03-18 17:11:22 -0400)
----------------------------------------------------------------
Paul Gortmaker (4):
gianfar: Add support for byte queue limits.
gianfar: constify giant block of status descriptor strings
gianfar: delete orphaned version strings and dead macros
gianfar: use netif_tx_queue_stopped instead of __netif_subqueue_stopped
drivers/net/ethernet/freescale/gianfar.c | 22 ++++++++++++++++------
drivers/net/ethernet/freescale/gianfar.h | 3 ---
drivers/net/ethernet/freescale/gianfar_ethtool.c | 2 +-
3 files changed, 17 insertions(+), 10 deletions(-)
> The BQL support here is unchanged from what I posted earlier as an
> RFC[1] -- with the exception of the fact that I'm now happier with
> the runtime testing vs. the simple "hey it boots" that I'd done
> for the RFC. Plus I added a couple trivial cleanup patches.
>
> For testing, I made a couple spiders homeless by reviving an ancient
> 10baseT hub. I connected an sbc8349 into that, and connected the
> yellowing hub into a GigE 16port, which was also connected to the
> recipient x86 box.
>
> Gianfar saw the interface as follows:
>
> fsl-gianfar e0024000.ethernet: eth0: mac: 00:a0:1e:a0:26:5a
> fsl-gianfar e0024000.ethernet: eth0: Running with NAPI enabled
> fsl-gianfar e0024000.ethernet: eth0: RX BD ring size for Q[0]: 256
> fsl-gianfar e0024000.ethernet: eth0: TX BD ring size for Q[0]: 256
> PHY: mdio@e0024520:19 - Link is Up - 10/Half
>
> With the sbc8349 being diskless, I simply used an scp of /proc/kcore
> to the connected x86 box as a rudimentary Tx heavy workload.
>
> BQL data was collected by changing into the dir:
>
> /sys/devices/e0000000.soc8349/e0024000.ethernet/net/eth0/queues/tx-0/byte_queue_limits
>
> and running the following:
>
> for i in * ; do echo -n $i": " ; cat $i ; done
>
> Running with the defaults, data like below was typical:
>
> hold_time: 1000
> inflight: 4542
> limit: 3456
> limit_max: 1879048192
> limit_min: 0
>
> hold_time: 1000
> inflight: 4542
> limit: 3378
> limit_max: 1879048192
> limit_min: 0
>
> i.e. 2 or 3 MTU sized packets in flight and the limit value lying
> somewhere between those two values.
>
> The interesting thing is that the interactive speed reported by scp
> seemed somewhat erratic, ranging from ~450 to ~700kB/s. (This was
> the only traffic on the old junk - perhaps expected oscillations such
> as those seen in isolated ARED tests?) Average speed for 100M was:
>
> 104857600 bytes (105 MB) copied, 172.616 s, 607 kB/s
>
> Anyway, back to BQL testing; setting the values as follows:
>
> hold_time: 1000
> inflight: 1514
> limit: 1400
> limit_max: 1400
> limit_min: 1000
>
> had the effect of serializing the interface to a single packet, and
> the crusty old hub seemed much happier with this arrangement, keeping
> a constant speed and achieving the following on a 100MB Tx block:
>
> 104857600 bytes (105 MB) copied, 112.52 s, 932 kB/s
>
> It might be interesting to know more about why the defaults suffer
> the slowdown, but the hub could possibly be ancient spec violating
> trash. Definitely something that nobody would ever use for anything
> today. (aside from contrived tests like this)
>
> But it did give me an example of where I could see the effects of
> changing the BQL settings, and I'm reasonably confident they are
> working as expected.
>
> Paul.
> ---
>
> [1] http://lists.openwall.net/netdev/2012/01/06/64
>
> Paul Gortmaker (3):
> gianfar: Add support for byte queue limits.
> gianfar: constify giant block of status descriptor strings
> gianfar: delete orphaned version strings and dead macros
>
> drivers/net/ethernet/freescale/gianfar.c | 22 ++++++++++++++++------
> drivers/net/ethernet/freescale/gianfar.h | 3 ---
> drivers/net/ethernet/freescale/gianfar_ethtool.c | 2 +-
> 3 files changed, 17 insertions(+), 10 deletions(-)
>
--
1.7.9.1
^ permalink raw reply
* Re: [PATCH 1/4] net, phy: am79c874 support
From: Anatolij Gustschin @ 2012-03-18 21:22 UTC (permalink / raw)
To: Heiko Schocher; +Cc: linuxppc-dev
In-Reply-To: <1308729311-15375-2-git-send-email-hs@denx.de>
Hello Heiko,
some comments below.
On Wed, 22 Jun 2011 09:55:08 +0200
Heiko Schocher <hs@denx.de> wrote:
...
> diff --git a/drivers/net/phy/amd79.c b/drivers/net/phy/amd79.c
> new file mode 100644
> index 0000000..914d696
> --- /dev/null
> +++ b/drivers/net/phy/amd79.c
...
> +#include <linux/kernel.h>
> +#include <linux/string.h>
> +#include <linux/errno.h>
> +#include <linux/unistd.h>
> +#include <linux/interrupt.h>
> +#include <linux/init.h>
> +#include <linux/io.h>
> +#include <linux/delay.h>
> +#include <linux/netdevice.h>
> +#include <linux/etherdevice.h>
> +#include <linux/skbuff.h>
> +#include <linux/spinlock.h>
> +#include <linux/mm.h>
> +#include <linux/module.h>
> +#include <linux/mii.h>
> +#include <linux/ethtool.h>
> +#include <linux/phy.h>
> +#include <linux/uaccess.h>
> +
> +#include <asm/irq.h>
We should remove not needed headers here.
...
> +static int amd79_config_intr(struct phy_device *phydev)
> +{
> + int err;
> +
> + if (phydev->interrupts == PHY_INTERRUPT_ENABLED)
> + err = phy_write(phydev, MII_AMD79_IR_EN_LINK,
> + MII_AMD79_IR_EN_LINK);
> + else
> + err = phy_write(phydev, MII_AMD79_IR_EN_LINK, 0);
Here is an issue, we should write to the interrupt control/status
register, so the 2nd argument of phy_write() should be MII_AMD79_IR.
I've fixed this and resubmitted your patch to the netdev list.
Thanks,
Anatolij
^ permalink raw reply
* Re: [PATCH 1/4] net, phy: am79c874 support
From: Anatolij Gustschin @ 2012-03-18 21:13 UTC (permalink / raw)
To: hs; +Cc: linuxppc-dev
In-Reply-To: <4E2E48A8.6070108@denx.de>
Hello Heiko,
On Tue, 26 Jul 2011 06:55:04 +0200
Heiko Schocher <hs@denx.de> wrote:
> Hello,
>
> Heiko Schocher wrote:
> > Signed-off-by: Heiko Schocher <hs@denx.de>
> > cc: linux-netdev@vger.kernel.org
> > cc: Wolfgang Denk <wd@denx.de>
> > ---
> > drivers/net/phy/Kconfig | 5 ++
> > drivers/net/phy/Makefile | 1 +
> > drivers/net/phy/amd79.c | 109 ++++++++++++++++++++++++++++++++++++++++++++++
> > 3 files changed, 115 insertions(+), 0 deletions(-)
> > create mode 100644 drivers/net/phy/amd79.c
>
> Are there some more comments or is this patch ready for going
> to mainline?
This patch is not ready yet and it seems it didn't reach the netdev
list, probably because of wrong netdev address. I reworked it a bit
and have sent a new version to the netdev list.
Thanks,
Anatolij
^ permalink raw reply
* Re: [PATCH net-next 1/3] gianfar: Add support for byte queue limits.
From: Paul Gortmaker @ 2012-03-18 21:04 UTC (permalink / raw)
To: Eric Dumazet; +Cc: netdev, linuxppc-dev, davem, therbert
In-Reply-To: <1332102032.3722.53.camel@edumazet-laptop>
On Sun, Mar 18, 2012 at 4:20 PM, Eric Dumazet <eric.dumazet@gmail.com> wrot=
e:
> Le dimanche 18 mars 2012 =E0 12:56 -0400, Paul Gortmaker a =E9crit :
>
> ...
>
>> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0* we add this skb back into the pool, if =
it's the right size
>> @@ -2557,13 +2568,15 @@ static int gfar_clean_tx_ring(struct gfar_priv_t=
x_q *tx_queue)
>> =A0 =A0 =A0 }
>>
>> =A0 =A0 =A0 /* If we freed a buffer, we can restart transmission, if nec=
essary */
>> - =A0 =A0 if (__netif_subqueue_stopped(dev, tx_queue->qindex) && tx_queu=
e->num_txbdfree)
>> - =A0 =A0 =A0 =A0 =A0 =A0 netif_wake_subqueue(dev, tx_queue->qindex);
>> + =A0 =A0 if (__netif_subqueue_stopped(dev, tqi) && tx_queue->num_txbdfr=
ee)
>> + =A0 =A0 =A0 =A0 =A0 =A0 netif_wake_subqueue(dev, tqi);
>>
>
> You can use netif_tx_queue_stopped(txq) here instead of
> __netif_subqueue_stopped(dev, tqi)
Yes, and it looks better too. I will do it as a patch #4 since I think
there is some small value in leaving the above patch chunk alone,
since it makes it clear that it was just the introduction of a local
variable and the code was otherwise unchanged here.
Will resend shortly....
Thanks,
Paul.
---
>
>> =A0 =A0 =A0 /* Update dirty indicators */
>> =A0 =A0 =A0 tx_queue->skb_dirtytx =3D skb_dirtytx;
>> =A0 =A0 =A0 tx_queue->dirty_tx =3D bdp;
>>
>> + =A0 =A0 netdev_tx_completed_queue(txq, howmany, bytes_sent);
>> +
>> =A0 =A0 =A0 return howmany;
>> =A0}
>>
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at =A0http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: Problem with framebuffer mmap on platforms with large addressing
From: Benjamin Herrenschmidt @ 2012-03-18 20:49 UTC (permalink / raw)
To: Dmitry Eremin-Solenikov
Cc: linux-fbdev, Florian Tobias Schandinat, Tony Breeds, linuxppc-dev
In-Reply-To: <CALT56yOaxfWYwxvBDbo9dpWo9y37dO0iGge4x6kciZp1oXXHVw@mail.gmail.com>
On Sun, 2012-03-18 at 18:04 +0400, Dmitry Eremin-Solenikov wrote:
> On Sun, Mar 18, 2012 at 4:46 AM, Benjamin Herrenschmidt
> <benh@kernel.crashing.org> wrote:
> > On Sat, 2012-03-17 at 20:04 +0400, Dmitry Eremin-Solenikov wrote:
> >> Hello,
> >>
> >> I'm trying to make framebuffer to work on PPC460EX board (canyonlands).
> >>
> >> The peculiarity of this platform is the fact that it has
> >> sizeof(unsigned long) = 4,
> >> but physical address on it is 36 bits width. It is a common to various pieces
> >> of the code to expect that unsigned long variable is able to contain physical
> >> address. Most of those places are easy to fix.
> >
> > Yes. In fact, Tony (CC) has some patches to fix a lot of the DRM
> > infrastructure (we have radeon KMS working on a similar platform).
>
> That is interesting! Are those patches published or otherwise available
> somewhere? We are also very interested in enabling Canyonlands
> with Radeon KMS!
You will run into additional problems with 460 due to the fact that it's
not cache coherent for DMA. Tony patches don't address that part of the
problem (they were used on a 476 based platform).
> > In fact, we could make the new structure such that it doesn't break
> > userspace compatibility with 64-bit architectures at all, ie, the "new"
> > and "compat" ioctl could remain entirely equivalent on 64-bit.
>
> I remember stuff about compat_ioctl, but I have never used/implemented
> that. Are there any details of requirements for the structures being passed?
In that specific case, I meant something else. IE. The old ioctl could
remain unchanged, and the new ioctl make the same as the old one on
64-bit platforms.
Cheers,
Ben.
^ permalink raw reply
* Re: [PATCH net-next 0/3] Gianfar byte queue limits
From: Paul Gortmaker @ 2012-03-18 20:50 UTC (permalink / raw)
To: Eric Dumazet; +Cc: netdev, linuxppc-dev, davem, therbert
In-Reply-To: <1332102634.3647.1.camel@edumazet-laptop>
On Sun, Mar 18, 2012 at 4:30 PM, Eric Dumazet <eric.dumazet@gmail.com> wrot=
e:
> Le dimanche 18 mars 2012 =E0 12:56 -0400, Paul Gortmaker a =E9crit :
>> The BQL support here is unchanged from what I posted earlier as an
>> RFC[1] -- with the exception of the fact that I'm now happier with
>> the runtime testing vs. the simple "hey it boots" that I'd done
>> for the RFC. =A0Plus I added a couple trivial cleanup patches.
>>
>> For testing, I made a couple spiders homeless by reviving an ancient
>> 10baseT hub. =A0I connected an sbc8349 into that, and connected the
>> yellowing hub into a GigE 16port, which was also connected to the
>> recipient x86 box.
>>
>> Gianfar saw the interface as follows:
>>
>> fsl-gianfar e0024000.ethernet: eth0: mac: 00:a0:1e:a0:26:5a
>> fsl-gianfar e0024000.ethernet: eth0: Running with NAPI enabled
>> fsl-gianfar e0024000.ethernet: eth0: RX BD ring size for Q[0]: 256
>> fsl-gianfar e0024000.ethernet: eth0: TX BD ring size for Q[0]: 256
>> PHY: mdio@e0024520:19 - Link is Up - 10/Half
>>
>> With the sbc8349 being diskless, I simply used an scp of /proc/kcore
>> to the connected x86 box as a rudimentary Tx heavy workload.
>>
>> BQL data was collected by changing into the dir:
>>
>> =A0 /sys/devices/e0000000.soc8349/e0024000.ethernet/net/eth0/queues/tx-0=
/byte_queue_limits
>>
>> and running the following:
>>
>> =A0 for i in * ; do echo -n $i": " ; cat $i ; done
>>
>> Running with the defaults, data like below was typical:
>>
>> hold_time: 1000
>> inflight: 4542
>> limit: 3456
>> limit_max: 1879048192
>> limit_min: 0
>>
>> hold_time: 1000
>> inflight: 4542
>> limit: 3378
>> limit_max: 1879048192
>> limit_min: 0
>>
>> i.e. 2 or 3 MTU sized packets in flight and the limit value lying
>> somewhere between those two values.
>>
>> The interesting thing is that the interactive speed reported by scp
>> seemed somewhat erratic, ranging from ~450 to ~700kB/s. (This was
>> the only traffic on the old junk - perhaps expected oscillations such
>> as those seen in isolated ARED tests?) =A0Average speed for 100M was:
>>
>> 104857600 bytes (105 MB) copied, 172.616 s, 607 kB/s
>>
>
> Still half duplex, or full duplex ?
>
> Limiting to one packet on half duplex might avoid collisions :)
Ah yes. It was even in the text I'd had above!
PHY: mdio@e0024520:19 - Link is Up - 10/Half
Now the slowdown makes sense to me.
Thanks for the review as well.
Paul.
>
>> Anyway, back to BQL testing; setting the values as follows:
>>
>> hold_time: 1000
>> inflight: 1514
>> limit: 1400
>> limit_max: 1400
>> limit_min: 1000
>>
>> had the effect of serializing the interface to a single packet, and
>> the crusty old hub seemed much happier with this arrangement, keeping
>> a constant speed and achieving the following on a 100MB Tx block:
>>
>> 104857600 bytes (105 MB) copied, 112.52 s, 932 kB/s
>>
>> It might be interesting to know more about why the defaults suffer
>> the slowdown, but the hub could possibly be ancient spec violating
>> trash. =A0Definitely something that nobody would ever use for anything
>> today. (aside from contrived tests like this)
>>
>> But it did give me an example of where I could see the effects of
>> changing the BQL settings, and I'm reasonably confident they are
>> working as expected.
>>
>
> Seems pretty good to me !
>
>
> --
> To unsubscribe from this list: send the line "unsubscribe netdev" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at =A0http://vger.kernel.org/majordomo-info.html
^ permalink raw reply
* Re: [PATCH net-next 0/3] Gianfar byte queue limits
From: Eric Dumazet @ 2012-03-18 20:30 UTC (permalink / raw)
To: Paul Gortmaker; +Cc: netdev, linuxppc-dev, davem, therbert
In-Reply-To: <1332089787-24086-1-git-send-email-paul.gortmaker@windriver.com>
Le dimanche 18 mars 2012 à 12:56 -0400, Paul Gortmaker a écrit :
> The BQL support here is unchanged from what I posted earlier as an
> RFC[1] -- with the exception of the fact that I'm now happier with
> the runtime testing vs. the simple "hey it boots" that I'd done
> for the RFC. Plus I added a couple trivial cleanup patches.
>
> For testing, I made a couple spiders homeless by reviving an ancient
> 10baseT hub. I connected an sbc8349 into that, and connected the
> yellowing hub into a GigE 16port, which was also connected to the
> recipient x86 box.
>
> Gianfar saw the interface as follows:
>
> fsl-gianfar e0024000.ethernet: eth0: mac: 00:a0:1e:a0:26:5a
> fsl-gianfar e0024000.ethernet: eth0: Running with NAPI enabled
> fsl-gianfar e0024000.ethernet: eth0: RX BD ring size for Q[0]: 256
> fsl-gianfar e0024000.ethernet: eth0: TX BD ring size for Q[0]: 256
> PHY: mdio@e0024520:19 - Link is Up - 10/Half
>
> With the sbc8349 being diskless, I simply used an scp of /proc/kcore
> to the connected x86 box as a rudimentary Tx heavy workload.
>
> BQL data was collected by changing into the dir:
>
> /sys/devices/e0000000.soc8349/e0024000.ethernet/net/eth0/queues/tx-0/byte_queue_limits
>
> and running the following:
>
> for i in * ; do echo -n $i": " ; cat $i ; done
>
> Running with the defaults, data like below was typical:
>
> hold_time: 1000
> inflight: 4542
> limit: 3456
> limit_max: 1879048192
> limit_min: 0
>
> hold_time: 1000
> inflight: 4542
> limit: 3378
> limit_max: 1879048192
> limit_min: 0
>
> i.e. 2 or 3 MTU sized packets in flight and the limit value lying
> somewhere between those two values.
>
> The interesting thing is that the interactive speed reported by scp
> seemed somewhat erratic, ranging from ~450 to ~700kB/s. (This was
> the only traffic on the old junk - perhaps expected oscillations such
> as those seen in isolated ARED tests?) Average speed for 100M was:
>
> 104857600 bytes (105 MB) copied, 172.616 s, 607 kB/s
>
Still half duplex, or full duplex ?
Limiting to one packet on half duplex might avoid collisions :)
> Anyway, back to BQL testing; setting the values as follows:
>
> hold_time: 1000
> inflight: 1514
> limit: 1400
> limit_max: 1400
> limit_min: 1000
>
> had the effect of serializing the interface to a single packet, and
> the crusty old hub seemed much happier with this arrangement, keeping
> a constant speed and achieving the following on a 100MB Tx block:
>
> 104857600 bytes (105 MB) copied, 112.52 s, 932 kB/s
>
> It might be interesting to know more about why the defaults suffer
> the slowdown, but the hub could possibly be ancient spec violating
> trash. Definitely something that nobody would ever use for anything
> today. (aside from contrived tests like this)
>
> But it did give me an example of where I could see the effects of
> changing the BQL settings, and I'm reasonably confident they are
> working as expected.
>
Seems pretty good to me !
^ permalink raw reply
* Re: [PATCH net-next 1/3] gianfar: Add support for byte queue limits.
From: Eric Dumazet @ 2012-03-18 20:20 UTC (permalink / raw)
To: Paul Gortmaker; +Cc: netdev, linuxppc-dev, davem, therbert
In-Reply-To: <1332089787-24086-2-git-send-email-paul.gortmaker@windriver.com>
Le dimanche 18 mars 2012 à 12:56 -0400, Paul Gortmaker a écrit :
...
> * we add this skb back into the pool, if it's the right size
> @@ -2557,13 +2568,15 @@ static int gfar_clean_tx_ring(struct gfar_priv_tx_q *tx_queue)
> }
>
> /* If we freed a buffer, we can restart transmission, if necessary */
> - if (__netif_subqueue_stopped(dev, tx_queue->qindex) && tx_queue->num_txbdfree)
> - netif_wake_subqueue(dev, tx_queue->qindex);
> + if (__netif_subqueue_stopped(dev, tqi) && tx_queue->num_txbdfree)
> + netif_wake_subqueue(dev, tqi);
>
You can use netif_tx_queue_stopped(txq) here instead of
__netif_subqueue_stopped(dev, tqi)
> /* Update dirty indicators */
> tx_queue->skb_dirtytx = skb_dirtytx;
> tx_queue->dirty_tx = bdp;
>
> + netdev_tx_completed_queue(txq, howmany, bytes_sent);
> +
> return howmany;
> }
>
^ permalink raw reply
* Re: issues calling of_platform_bus_probe() twice
From: Grant Likely @ 2012-03-18 18:22 UTC (permalink / raw)
To: Tabi Timur-B04825
Cc: dbaryshkov@gmail.com, devicetree-discuss@lists.ozlabs.org Discuss,
linuxppc-dev@lists.ozlabs.org list
In-Reply-To: <4F6609DE.2050001@freescale.com>
On Sun, 18 Mar 2012 16:14:23 +0000, Tabi Timur-B04825 <B04825@freescale.com> wrote:
> Grant Likely wrote:
> > That's because you're using it wrong. of_platform_bus_probe() creates
> > platform devices at the starting level and every level below it as
> > described by the bus ids. It is illegal to call of_platform_bus_probe()
> > twice at the same level in the DT.
>
> Well, *I* am not using it wrong. Notice that my patch fixes (or works
> around) the commit that *did* do it wrong:
>
> http://patchwork.ozlabs.org/patch/126289/
Fair enough; I just wanted to point out that there it can only dig as
deep into the tree as is specified by the bus ids. The exact problem
wasn't calling the function twice, but rather trying to call the
function twice from the same level of the tree.
BTW, I also recommend moving to of_platform_populate() for new code.
I think the behaviour is more consistent for fdt platforms and it
is more convenient for devices that are children of the root.
g.
^ permalink raw reply
* [PATCH net-next 3/3] gianfar: delete orphaned version strings and dead macros
From: Paul Gortmaker @ 2012-03-18 16:56 UTC (permalink / raw)
To: davem, eric.dumazet, therbert; +Cc: netdev, linuxppc-dev, Paul Gortmaker
In-Reply-To: <1332089787-24086-1-git-send-email-paul.gortmaker@windriver.com>
There were two version strings, and neither one was being used.
Also in the same proximity were some unused #define that were
left over from the past. Delete them all.
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
---
drivers/net/ethernet/freescale/gianfar.c | 3 ---
drivers/net/ethernet/freescale/gianfar.h | 3 ---
2 files changed, 0 insertions(+), 6 deletions(-)
diff --git a/drivers/net/ethernet/freescale/gianfar.c b/drivers/net/ethernet/freescale/gianfar.c
index a4c934b..6e66cc3 100644
--- a/drivers/net/ethernet/freescale/gianfar.c
+++ b/drivers/net/ethernet/freescale/gianfar.c
@@ -104,10 +104,7 @@
#include "fsl_pq_mdio.h"
#define TX_TIMEOUT (1*HZ)
-#undef BRIEF_GFAR_ERRORS
-#undef VERBOSE_GFAR_ERRORS
-const char gfar_driver_name[] = "Gianfar Ethernet";
const char gfar_driver_version[] = "1.3";
static int gfar_enet_open(struct net_device *dev);
diff --git a/drivers/net/ethernet/freescale/gianfar.h b/drivers/net/ethernet/freescale/gianfar.h
index 4fe0f34..fc2488a 100644
--- a/drivers/net/ethernet/freescale/gianfar.h
+++ b/drivers/net/ethernet/freescale/gianfar.h
@@ -78,11 +78,8 @@ struct ethtool_rx_list {
#define INCREMENTAL_BUFFER_SIZE 512
#define PHY_INIT_TIMEOUT 100000
-#define GFAR_PHY_CHANGE_TIME 2
-#define DEVICE_NAME "%s: Gianfar Ethernet Controller Version 1.2, "
#define DRV_NAME "gfar-enet"
-extern const char gfar_driver_name[];
extern const char gfar_driver_version[];
/* MAXIMUM NUMBER OF QUEUES SUPPORTED */
--
1.7.9.1
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox