From 0ee304d5802dc62746f13f12d4cb4ec4ed285f66 Mon Sep 17 00:00:00 2001 From: Tejun Heo Date: Sat, 25 Feb 2006 13:52:30 +0900 Subject: [PATCH] sata_sil: add board ID for 3512 3512 is slightly different from 3112 errata-wise. Differentiate it. Signed-off-by: Tejun Heo Signed-off-by: Jeff Garzik --- drivers/scsi/sata_sil.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) (limited to 'drivers') diff --git a/drivers/scsi/sata_sil.c b/drivers/scsi/sata_sil.c index 17f74d3c10e7..510c2e0bd90e 100644 --- a/drivers/scsi/sata_sil.c +++ b/drivers/scsi/sata_sil.c @@ -53,7 +53,8 @@ enum { sil_3112 = 0, sil_3112_m15w = 1, - sil_3114 = 2, + sil_3512 = 2, + sil_3114 = 3, SIL_FIFO_R0 = 0x40, SIL_FIFO_W0 = 0x41, @@ -90,7 +91,7 @@ static void sil_post_set_mode (struct ata_port *ap); static const struct pci_device_id sil_pci_tbl[] = { { 0x1095, 0x3112, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sil_3112_m15w }, { 0x1095, 0x0240, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sil_3112_m15w }, - { 0x1095, 0x3512, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sil_3112 }, + { 0x1095, 0x3512, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sil_3512 }, { 0x1095, 0x3114, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sil_3114 }, { 0x1002, 0x436e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sil_3112_m15w }, { 0x1002, 0x4379, PCI_ANY_ID, PCI_ANY_ID, 0, 0, sil_3112_m15w }, @@ -185,7 +186,8 @@ static const struct ata_port_info sil_port_info[] = { .mwdma_mask = 0x07, /* mwdma0-2 */ .udma_mask = 0x3f, /* udma0-5 */ .port_ops = &sil_ops, - }, /* sil_3112_15w - keep it sync'd w/ sil_3112 */ + }, + /* sil_3112_15w - keep it sync'd w/ sil_3112 */ { .sht = &sil_sht, .host_flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | @@ -195,7 +197,18 @@ static const struct ata_port_info sil_port_info[] = { .mwdma_mask = 0x07, /* mwdma0-2 */ .udma_mask = 0x3f, /* udma0-5 */ .port_ops = &sil_ops, - }, /* sil_3114 */ + }, + /* sil_3512 */ + { + .sht = &sil_sht, + .host_flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | + ATA_FLAG_SRST | ATA_FLAG_MMIO, + .pio_mask = 0x1f, /* pio0-4 */ + .mwdma_mask = 0x07, /* mwdma0-2 */ + .udma_mask = 0x3f, /* udma0-5 */ + .port_ops = &sil_ops, + }, + /* sil_3114 */ { .sht = &sil_sht, .host_flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | -- cgit v1.2.3 From e4e10e3e7995f5bd481d2720bf30d3a661d110ca Mon Sep 17 00:00:00 2001 From: Tejun Heo Date: Sat, 25 Feb 2006 13:52:30 +0900 Subject: [PATCH] sata_sil: implement R_ERR on DMA activate FIS errata fix Silicon Image has disclosed a new sil3114/3152 errata and workaround which causes the controller to return R_ERR on DMA activate FIS if the FIS is received while the next PRD is being fetched. This patch implements the workaround. This errata results in lock up and doesn't trigger if m15w workaround is in effect. We stopped applying m15w to 3512 and 3114 in 2.6.14-rc1 which makes 3512/3114 lock up with some drives on all kernel versions since 2.6.14-rc1 upto now (2.6.16-rc4). This patch should fix the regression. Signed-off-by: Tejun Heo Signed-off-by: Jeff Garzik --- drivers/scsi/sata_sil.c | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) (limited to 'drivers') diff --git a/drivers/scsi/sata_sil.c b/drivers/scsi/sata_sil.c index 510c2e0bd90e..9face3c6aa21 100644 --- a/drivers/scsi/sata_sil.c +++ b/drivers/scsi/sata_sil.c @@ -49,6 +49,7 @@ #define DRV_VERSION "0.9" enum { + SIL_FLAG_RERR_ON_DMA_ACT = (1 << 29), SIL_FLAG_MOD15WRITE = (1 << 30), sil_3112 = 0, @@ -202,7 +203,8 @@ static const struct ata_port_info sil_port_info[] = { { .sht = &sil_sht, .host_flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | - ATA_FLAG_SRST | ATA_FLAG_MMIO, + ATA_FLAG_SRST | ATA_FLAG_MMIO | + SIL_FLAG_RERR_ON_DMA_ACT, .pio_mask = 0x1f, /* pio0-4 */ .mwdma_mask = 0x07, /* mwdma0-2 */ .udma_mask = 0x3f, /* udma0-5 */ @@ -212,7 +214,8 @@ static const struct ata_port_info sil_port_info[] = { { .sht = &sil_sht, .host_flags = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY | - ATA_FLAG_SRST | ATA_FLAG_MMIO, + ATA_FLAG_SRST | ATA_FLAG_MMIO | + SIL_FLAG_RERR_ON_DMA_ACT, .pio_mask = 0x1f, /* pio0-4 */ .mwdma_mask = 0x07, /* mwdma0-2 */ .udma_mask = 0x3f, /* udma0-5 */ @@ -229,12 +232,13 @@ static const struct { unsigned long scr; /* SATA control register block */ unsigned long sien; /* SATA Interrupt Enable register */ unsigned long xfer_mode;/* data transfer mode register */ + unsigned long sfis_cfg; /* SATA FIS reception config register */ } sil_port[] = { /* port 0 ... */ - { 0x80, 0x8A, 0x00, 0x100, 0x148, 0xb4 }, - { 0xC0, 0xCA, 0x08, 0x180, 0x1c8, 0xf4 }, - { 0x280, 0x28A, 0x200, 0x300, 0x348, 0x2b4 }, - { 0x2C0, 0x2CA, 0x208, 0x380, 0x3c8, 0x2f4 }, + { 0x80, 0x8A, 0x00, 0x100, 0x148, 0xb4, 0x14c }, + { 0xC0, 0xCA, 0x08, 0x180, 0x1c8, 0xf4, 0x1cc }, + { 0x280, 0x28A, 0x200, 0x300, 0x348, 0x2b4, 0x34c }, + { 0x2C0, 0x2CA, 0x208, 0x380, 0x3c8, 0x2f4, 0x3cc }, /* ... port 3 */ }; @@ -484,6 +488,23 @@ static int sil_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) dev_printk(KERN_WARNING, &pdev->dev, "cache line size not set. Driver may not function\n"); + /* Apply R_ERR on DMA activate FIS errata workaround */ + if (probe_ent->host_flags & SIL_FLAG_RERR_ON_DMA_ACT) { + int cnt; + + for (i = 0, cnt = 0; i < probe_ent->n_ports; i++) { + tmp = readl(mmio_base + sil_port[i].sfis_cfg); + if ((tmp & 0x3) != 0x01) + continue; + if (!cnt) + dev_printk(KERN_INFO, &pdev->dev, + "Applying R_ERR on DMA activate " + "FIS errata fix\n"); + writel(tmp & ~0x3, mmio_base + sil_port[i].sfis_cfg); + cnt++; + } + } + if (ent->driver_data == sil_3114) { irq_mask = SIL_MASK_4PORT; -- cgit v1.2.3 From 7bef4b397874eee4484457040e8a1013361d7758 Mon Sep 17 00:00:00 2001 From: Daniele Venzano Date: Sat, 25 Feb 2006 17:01:09 -0500 Subject: Fix Wake on LAN support in sis900 Fix two bugs in the WoL implementation of sis900. The first causes hangs on some system on driver load, the second causes troubles when disabling WoL support. Both fixes are one liner and really simple. Signed-off-by: Lennert Buytenhek Signed-off-by: Daniele Venzano --- drivers/net/sis900.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/net/sis900.c b/drivers/net/sis900.c index 3d95fa20cd88..7a952fe60be2 100644 --- a/drivers/net/sis900.c +++ b/drivers/net/sis900.c @@ -540,7 +540,7 @@ static int __devinit sis900_probe(struct pci_dev *pci_dev, printk("%2.2x.\n", net_dev->dev_addr[i]); /* Detect Wake on Lan support */ - ret = inl(CFGPMC & PMESP); + ret = (inl(net_dev->base_addr + CFGPMC) & PMESP) >> 27; if (netif_msg_probe(sis_priv) && (ret & PME_D3C) == 0) printk(KERN_INFO "%s: Wake on LAN only available from suspend to RAM.", net_dev->name); @@ -2040,7 +2040,7 @@ static int sis900_set_wol(struct net_device *net_dev, struct ethtool_wolinfo *wo if (wol->wolopts == 0) { pci_read_config_dword(sis_priv->pci_dev, CFGPMCSR, &cfgpmcsr); - cfgpmcsr |= ~PME_EN; + cfgpmcsr &= ~PME_EN; pci_write_config_dword(sis_priv->pci_dev, CFGPMCSR, cfgpmcsr); outl(pmctrl_bits, pmctrl_addr); if (netif_msg_wol(sis_priv)) -- cgit v1.2.3 From d904ffd6e0c3ab7631b07c21c9f9234a2e72d1f3 Mon Sep 17 00:00:00 2001 From: Marc Zyngier Date: Mon, 27 Feb 2006 12:08:00 +0100 Subject: [PATCH] Fix Specialix SX corruption With the latest kernels, I experienced some strange corruption, some '*****' being randomly inserted in the character flow, like this: ashes:~# ashes:~# a*******shes:~# ashes:~# ashes:~# Further investigation shows that the problem was introduced during Alan's "TTY layer buffering revamp" patch, the amount of data to be copied being reduced after buffer allocation. Moving the count fixup around solves the problem. Signed-off-by: Marc Zyngier Approved-by: Rogier Wolff Signed-off-by: Linus Torvalds --- drivers/char/sx.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'drivers') diff --git a/drivers/char/sx.c b/drivers/char/sx.c index 588e75ec1630..a6b4f02bdceb 100644 --- a/drivers/char/sx.c +++ b/drivers/char/sx.c @@ -1095,17 +1095,17 @@ static inline void sx_receive_chars (struct sx_port *port) sx_dprintk (SX_DEBUG_RECEIVE, "rxop=%d, c = %d.\n", rx_op, c); + /* Don't copy past the end of the hardware receive buffer */ + if (rx_op + c > 0x100) c = 0x100 - rx_op; + + sx_dprintk (SX_DEBUG_RECEIVE, "c = %d.\n", c); + /* Don't copy more bytes than there is room for in the buffer */ c = tty_prepare_flip_string(tty, &rp, c); sx_dprintk (SX_DEBUG_RECEIVE, "c = %d.\n", c); - /* Don't copy past the end of the hardware receive buffer */ - if (rx_op + c > 0x100) c = 0x100 - rx_op; - - sx_dprintk (SX_DEBUG_RECEIVE, "c = %d.\n", c); - /* If for one reason or another, we can't copy more data, we're done! */ if (c == 0) break; -- cgit v1.2.3 From 051d3cbd96909b2fe6b5038e7bbe77f41356db05 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Mon, 27 Feb 2006 12:51:27 -0800 Subject: [TG3]: Fix Sun tg3 variant detection. Some Sun parts don't have PCI_VENDOR_ID_SUN in the subsystem vendor ID. So add another fallback test, which is the name of the OBP firmware device tree node. If it's a Sun part we'll get "network", else it will be named "ethernet". Signed-off-by: David S. Miller --- drivers/net/tg3.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'drivers') diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index e7dc653d5bd6..e8e92c853e89 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c @@ -9408,6 +9408,15 @@ static int __devinit tg3_is_sun_570X(struct tg3 *tp) return 0; if (venid == PCI_VENDOR_ID_SUN) return 1; + + /* TG3 chips onboard the SunBlade-2500 don't have the + * subsystem-vendor-id set to PCI_VENDOR_ID_SUN but they + * are distinguishable from non-Sun variants by being + * named "network" by the firmware. Non-Sun cards will + * show up as being named "ethernet". + */ + if (!strcmp(pcp->prom_name, "network")) + return 1; } return 0; } -- cgit v1.2.3 From b3c3e7d7d9795df16012d5c60e5f789e7fade311 Mon Sep 17 00:00:00 2001 From: Francois Romieu Date: Mon, 27 Feb 2006 23:11:08 +0100 Subject: via-velocity: fix memory corruption when changing the mtu velocity_rx_refill() only replenishes the descriptor entries which belong to the CPU. It works great in the Rx path but the driver must ensure that all the descriptors are freed before velocity_rx_refill() is used in velocity_change_mtu(). The patch resets the Rx descriptors in velocity_free_rd_ring(). Signed-off-by: Francois Romieu --- drivers/net/via-velocity.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers') diff --git a/drivers/net/via-velocity.c b/drivers/net/via-velocity.c index c2d5907dc8e0..ed1f837c8fda 100644 --- a/drivers/net/via-velocity.c +++ b/drivers/net/via-velocity.c @@ -1106,6 +1106,9 @@ static void velocity_free_rd_ring(struct velocity_info *vptr) for (i = 0; i < vptr->options.numrx; i++) { struct velocity_rd_info *rd_info = &(vptr->rd_info[i]); + struct rx_desc *rd = vptr->rd_ring + i; + + memset(rd, 0, sizeof(*rd)); if (!rd_info->skb) continue; -- cgit v1.2.3 From 576cfa934e357c44d6259f90c7d065de328a3691 Mon Sep 17 00:00:00 2001 From: Francois Romieu Date: Mon, 27 Feb 2006 23:15:06 +0100 Subject: 8139cp: fix broken suspend/resume - check that the device is up before it is enabled again; - the descriptor ring indexes must be set to zero before cp_init_hw() is issued. Add a nice comment to remember that skb allocation failure is still not handled. Fixes http://bugzilla.kernel.org/show_bug.cgi?id=5681 Signed-off-by: Francois Romieu --- drivers/net/8139cp.c | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) (limited to 'drivers') diff --git a/drivers/net/8139cp.c b/drivers/net/8139cp.c index f822cd3025ff..dd410496aadb 100644 --- a/drivers/net/8139cp.c +++ b/drivers/net/8139cp.c @@ -1118,13 +1118,18 @@ err_out: return -ENOMEM; } +static void cp_init_rings_index (struct cp_private *cp) +{ + cp->rx_tail = 0; + cp->tx_head = cp->tx_tail = 0; +} + static int cp_init_rings (struct cp_private *cp) { memset(cp->tx_ring, 0, sizeof(struct cp_desc) * CP_TX_RING_SIZE); cp->tx_ring[CP_TX_RING_SIZE - 1].opts1 = cpu_to_le32(RingEnd); - cp->rx_tail = 0; - cp->tx_head = cp->tx_tail = 0; + cp_init_rings_index(cp); return cp_refill_rx (cp); } @@ -1886,30 +1891,30 @@ static int cp_suspend (struct pci_dev *pdev, pm_message_t state) spin_unlock_irqrestore (&cp->lock, flags); - if (cp->pdev && cp->wol_enabled) { - pci_save_state (cp->pdev); - cp_set_d3_state (cp); - } + pci_save_state(pdev); + pci_enable_wake(pdev, pci_choose_state(pdev, state), cp->wol_enabled); + pci_set_power_state(pdev, pci_choose_state(pdev, state)); return 0; } static int cp_resume (struct pci_dev *pdev) { - struct net_device *dev; - struct cp_private *cp; + struct net_device *dev = pci_get_drvdata (pdev); + struct cp_private *cp = netdev_priv(dev); unsigned long flags; - dev = pci_get_drvdata (pdev); - cp = netdev_priv(dev); + if (!netif_running(dev)) + return 0; netif_device_attach (dev); - - if (cp->pdev && cp->wol_enabled) { - pci_set_power_state (cp->pdev, PCI_D0); - pci_restore_state (cp->pdev); - } - + + pci_set_power_state(pdev, PCI_D0); + pci_restore_state(pdev); + pci_enable_wake(pdev, PCI_D0, 0); + + /* FIXME: sh*t may happen if the Rx ring buffer is depleted */ + cp_init_rings_index (cp); cp_init_hw (cp); netif_start_queue (dev); -- cgit v1.2.3 From 50e300dead8dadf32e930ebd80d9810d631aa1a0 Mon Sep 17 00:00:00 2001 From: Jes Sorensen Date: Fri, 17 Feb 2006 10:25:39 -0500 Subject: [IA64] show "SN Devices" menu only if CONFIG_SGI_SN Adrian> On architectures like i386, the "Multimedia Capabilities Port Adrian> drivers" menu is visible, but it can't be visited since it Adrian> contains nothing usable for CONFIG_SGI_SN=n. Jes> Thats only a third of the patch, if you want to do that, you should Jes> remove the redundant SGI_SN checks below. Signed-off-by: Tony Luck --- drivers/sn/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/sn/Kconfig b/drivers/sn/Kconfig index d95265b187a3..a34731625877 100644 --- a/drivers/sn/Kconfig +++ b/drivers/sn/Kconfig @@ -3,10 +3,11 @@ # menu "SN Devices" + depends on SGI_SN config SGI_IOC4 tristate "SGI IOC4 Base IO support" - depends on (IA64_GENERIC || IA64_SGI_SN2) && MMTIMER + depends on MMTIMER default m ---help--- This option enables basic support for the SGI IOC4-based Base IO @@ -19,7 +20,6 @@ config SGI_IOC4 config SGI_IOC3 tristate "SGI IOC3 Base IO support" - depends on (IA64_GENERIC || IA64_SGI_SN2) default m ---help--- This option enables basic support for the SGI IOC3-based Base IO -- cgit v1.2.3 From eca7be5e1899626db01ae42b0123458d6fb34930 Mon Sep 17 00:00:00 2001 From: Brian King Date: Tue, 14 Feb 2006 12:42:24 -0600 Subject: [SCSI] sg: Remove aha1542 hack Remove a hack in the sg driver that alters the total buffer length for SG_IO commands to ensure buffers are not odd byte lengths. This breaks on the ipr driver since it requires the request_bufflen to equal the length specified in the cdb. The block layer SG_IO code does not appear to have this hack. Signed-off-by: Douglas Gilbert Signed-off-by: Brian King Signed-off-by: James Bottomley --- drivers/scsi/sg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index 2a547538d444..5a0a19322d01 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c @@ -2162,7 +2162,7 @@ sg_link_reserve(Sg_fd * sfp, Sg_request * srp, int size) srp->res_used = 1; SCSI_LOG_TIMEOUT(4, printk("sg_link_reserve: size=%d\n", size)); - rem = size = (size + 1) & (~1); /* round to even for aha1542 */ + rem = size; for (k = 0; k < rsv_schp->k_use_sg; ++k, ++sg) { num = sg->length; -- cgit v1.2.3 From 8b097a67264ba3e10620b268979de3be6fe5e3cd Mon Sep 17 00:00:00 2001 From: Andrew Vasquez Date: Tue, 14 Feb 2006 14:22:14 -0800 Subject: [SCSI] fc_transport: stop creating duplicate rport entries. Current fc_transport consumers initially register rports with an UNKNOWN role-state and follow-up with a call to fc_remote_port_rolechg(). Modify code in fc_remote_port_add() to scan the fc_host_rport_bindings() array for consistent bindings regardless of role-type. Original code would only scan bindings array for targets, causing duplicate fc_remote_ports/rport-X:Y-Z entries to be created for the yet-to-be-role-changed rports. Signed-off-by: Andrew Vasquez Signed-off-by: James Bottomley --- drivers/scsi/scsi_transport_fc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c index f2c9acf11bd0..929032e370db 100644 --- a/drivers/scsi/scsi_transport_fc.c +++ b/drivers/scsi/scsi_transport_fc.c @@ -1498,8 +1498,7 @@ fc_remote_port_add(struct Scsi_Host *shost, int channel, } /* Search the bindings array */ - if (likely((ids->roles & FC_RPORT_ROLE_FCP_TARGET) && - (fc_host_tgtid_bind_type(shost) != FC_TGTID_BIND_NONE))) { + if (fc_host_tgtid_bind_type(shost) != FC_TGTID_BIND_NONE) { /* search for a matching consistent binding */ -- cgit v1.2.3 From 938050916f57f08e20595b1fa1c1e57c2fbf7243 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Fri, 17 Feb 2006 12:11:29 +0100 Subject: [SCSI] scsi: handle ->slave_configure return value MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When ­>slave_configure fails the scsi midlayer should handle it. Signed-off-by: James Bottomley --- drivers/scsi/scsi_scan.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c index 5acb83ca5ae5..f9ecc3dea7df 100644 --- a/drivers/scsi/scsi_scan.c +++ b/drivers/scsi/scsi_scan.c @@ -752,8 +752,20 @@ static int scsi_add_lun(struct scsi_device *sdev, char *inq_result, int *bflags) transport_configure_device(&sdev->sdev_gendev); - if (sdev->host->hostt->slave_configure) - sdev->host->hostt->slave_configure(sdev); + if (sdev->host->hostt->slave_configure) { + int ret = sdev->host->hostt->slave_configure(sdev); + if (ret) { + /* + * if LLDD reports slave not present, don't clutter + * console with alloc failure messages + */ + if (ret != -ENXIO) { + sdev_printk(KERN_ERR, sdev, + "failed to configure device\n"); + } + return SCSI_SCAN_NO_RESPONSE; + } + } /* * Ok, the device is now all set up, we can -- cgit v1.2.3 From c3c013a2c218cdede2d2e73df01ed4f813538941 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Mon, 27 Feb 2006 22:31:19 -0500 Subject: [libata] Disable FUA Until problems are sorted. --- drivers/scsi/libata-core.c | 4 ++++ drivers/scsi/libata-scsi.c | 2 ++ drivers/scsi/libata.h | 1 + 3 files changed, 7 insertions(+) (limited to 'drivers') diff --git a/drivers/scsi/libata-core.c b/drivers/scsi/libata-core.c index 5f1d7580218d..4f91b0dc572b 100644 --- a/drivers/scsi/libata-core.c +++ b/drivers/scsi/libata-core.c @@ -82,6 +82,10 @@ int atapi_enabled = 0; module_param(atapi_enabled, int, 0444); MODULE_PARM_DESC(atapi_enabled, "Enable discovery of ATAPI devices (0=off, 1=on)"); +int libata_fua = 0; +module_param_named(fua, libata_fua, int, 0444); +MODULE_PARM_DESC(fua, "FUA support (0=off, 1=on)"); + MODULE_AUTHOR("Jeff Garzik"); MODULE_DESCRIPTION("Library module for ATA devices"); MODULE_LICENSE("GPL"); diff --git a/drivers/scsi/libata-scsi.c b/drivers/scsi/libata-scsi.c index 07b1e7cc61df..59503c9ccac9 100644 --- a/drivers/scsi/libata-scsi.c +++ b/drivers/scsi/libata-scsi.c @@ -1708,6 +1708,8 @@ static int ata_dev_supports_fua(u16 *id) { unsigned char model[41], fw[9]; + if (!libata_fua) + return 0; if (!ata_id_has_fua(id)) return 0; diff --git a/drivers/scsi/libata.h b/drivers/scsi/libata.h index e03ce48b7b4b..fddaf479a544 100644 --- a/drivers/scsi/libata.h +++ b/drivers/scsi/libata.h @@ -41,6 +41,7 @@ struct ata_scsi_args { /* libata-core.c */ extern int atapi_enabled; +extern int libata_fua; extern struct ata_queued_cmd *ata_qc_new_init(struct ata_port *ap, struct ata_device *dev); extern int ata_rwcmd_protocol(struct ata_queued_cmd *qc); -- cgit v1.2.3 From 147aab6aa22ce7775be944f8fb9932aa000dda61 Mon Sep 17 00:00:00 2001 From: Christoph Hellwig Date: Fri, 17 Feb 2006 12:13:48 +0100 Subject: [SCSI] megaraid_sas: fix physical disk handling This patch hides the devices completely from the midlayer instead. It requires the patch to handle the slave_configure failure I posted earlier. Signed-off-by: Christoph Hellwig Signed-off-by: James Bottomley --- drivers/scsi/megaraid/megaraid_sas.c | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'drivers') diff --git a/drivers/scsi/megaraid/megaraid_sas.c b/drivers/scsi/megaraid/megaraid_sas.c index 7de267e14458..4f39dd01936d 100644 --- a/drivers/scsi/megaraid/megaraid_sas.c +++ b/drivers/scsi/megaraid/megaraid_sas.c @@ -793,6 +793,20 @@ megasas_queue_command(struct scsi_cmnd *scmd, void (*done) (struct scsi_cmnd *)) return 0; } +static int megasas_slave_configure(struct scsi_device *sdev) +{ + /* + * Don't export physical disk devices to the disk driver. + * + * FIXME: Currently we don't export them to the midlayer at all. + * That will be fixed once LSI engineers have audited the + * firmware for possible issues. + */ + if (sdev->channel < MEGASAS_MAX_PD_CHANNELS && sdev->type == TYPE_DISK) + return -ENXIO; + return 0; +} + /** * megasas_wait_for_outstanding - Wait for all outstanding cmds * @instance: Adapter soft state @@ -943,6 +957,7 @@ static struct scsi_host_template megasas_template = { .module = THIS_MODULE, .name = "LSI Logic SAS based MegaRAID driver", .proc_name = "megaraid_sas", + .slave_configure = megasas_slave_configure, .queuecommand = megasas_queue_command, .eh_device_reset_handler = megasas_reset_device, .eh_bus_reset_handler = megasas_reset_bus_host, @@ -1071,20 +1086,6 @@ megasas_complete_cmd(struct megasas_instance *instance, struct megasas_cmd *cmd, break; } - /* - * Don't export physical disk devices to mid-layer. - */ - if (!MEGASAS_IS_LOGICAL(cmd->scmd) && - (hdr->cmd_status == MFI_STAT_OK) && - (cmd->scmd->cmnd[0] == INQUIRY)) { - - if (((*(u8 *) cmd->scmd->request_buffer) & 0x1F) == - TYPE_DISK) { - cmd->scmd->result = DID_BAD_TARGET << 16; - exception = 1; - } - } - case MFI_CMD_LD_READ: case MFI_CMD_LD_WRITE: -- cgit v1.2.3 From 8884efab1516613215816d48132dd724508970bf Mon Sep 17 00:00:00 2001 From: Brian King Date: Fri, 24 Feb 2006 17:10:04 -0600 Subject: [SCSI] scsi: scsi command retries off by one fix Fix up an off by one error in calculating retries for scsi commands. This bug was discovered when an SG_IO request was sent to scsi core with retries = 0, causing the overall timeout check to go off in scsi_softirq_done. Signed-off-by: Brian King Signed-off-by: James Bottomley --- drivers/scsi/scsi_error.c | 4 ++-- drivers/scsi/scsi_lib.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers') diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index 5cc97b721661..ff82ccfbb106 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c @@ -1308,7 +1308,7 @@ int scsi_decide_disposition(struct scsi_cmnd *scmd) * the request was not marked fast fail. Note that above, * even if the request is marked fast fail, we still requeue * for queue congestion conditions (QUEUE_FULL or BUSY) */ - if ((++scmd->retries) < scmd->allowed + if ((++scmd->retries) <= scmd->allowed && !blk_noretry_request(scmd->request)) { return NEEDS_RETRY; } else { @@ -1433,7 +1433,7 @@ static void scsi_eh_flush_done_q(struct list_head *done_q) list_del_init(&scmd->eh_entry); if (scsi_device_online(scmd->device) && !blk_noretry_request(scmd->request) && - (++scmd->retries < scmd->allowed)) { + (++scmd->retries <= scmd->allowed)) { SCSI_LOG_ERROR_RECOVERY(3, printk("%s: flush" " retry cmd: %p\n", current->comm, diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 4362dcde74af..701a328f7beb 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c @@ -1498,7 +1498,7 @@ static void scsi_kill_request(struct request *req, request_queue_t *q) static void scsi_softirq_done(struct request *rq) { struct scsi_cmnd *cmd = rq->completion_data; - unsigned long wait_for = cmd->allowed * cmd->timeout_per_command; + unsigned long wait_for = (cmd->allowed + 1) * cmd->timeout_per_command; int disposition; INIT_LIST_HEAD(&cmd->eh_entry); -- cgit v1.2.3 From 123fc7fd6f609a000061f586a794c89d1122ede1 Mon Sep 17 00:00:00 2001 From: Ralf Baechle Date: Thu, 9 Feb 2006 11:16:38 -0500 Subject: [SCSI] Delete duplicate driver template. Stuborn as compilers are they don't like duplicate definitions. Signed-off-by: Ralf Baechle Signed-off-by: James Bottomley --- drivers/scsi/jazz_esp.c | 21 --------------------- 1 file changed, 21 deletions(-) (limited to 'drivers') diff --git a/drivers/scsi/jazz_esp.c b/drivers/scsi/jazz_esp.c index 23728d1c980c..fcd304e11c26 100644 --- a/drivers/scsi/jazz_esp.c +++ b/drivers/scsi/jazz_esp.c @@ -65,27 +65,6 @@ static int jazz_esp_release(struct Scsi_Host *shost) return 0; } -static struct scsi_host_template driver_template = { - .proc_name = "jazz_esp", - .proc_info = &esp_proc_info, - .name = "ESP 100/100a/200", - .detect = jazz_esp_detect, - .slave_alloc = esp_slave_alloc, - .slave_destroy = esp_slave_destroy, - .release = jazz_esp_release, - .info = esp_info, - .queuecommand = esp_queue, - .eh_abort_handler = esp_abort, - .eh_bus_reset_handler = esp_reset, - .can_queue = 7, - .this_id = 7, - .sg_tablesize = SG_ALL, - .cmd_per_lun = 1, - .use_clustering = DISABLE_CLUSTERING, -}; - -#include "scsi_module.c" - /***************************************************************** Detection */ static int jazz_esp_detect(struct scsi_host_template *tpnt) { -- cgit v1.2.3 From 23ff51e9fe24f98c1053ac1cdded434012eee342 Mon Sep 17 00:00:00 2001 From: Matthew Wilcox Date: Tue, 28 Feb 2006 06:28:15 -0700 Subject: [SCSI] Fix uninitialised width and speed in sym2 sym2 boards without NVRAM currently negotiate narrow due to this missed initialisation Signed-off-by: Matthew Wilcox Signed-off-by: James Bottomley --- drivers/scsi/sym53c8xx_2/sym_hipd.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers') diff --git a/drivers/scsi/sym53c8xx_2/sym_hipd.c b/drivers/scsi/sym53c8xx_2/sym_hipd.c index f4854c33f48d..2627000ca653 100644 --- a/drivers/scsi/sym53c8xx_2/sym_hipd.c +++ b/drivers/scsi/sym53c8xx_2/sym_hipd.c @@ -919,6 +919,8 @@ static int sym_prepare_setting(struct Scsi_Host *shost, struct sym_hcb *np, stru tp->usrflags |= (SYM_DISC_ENABLED | SYM_TAGS_ENABLED); tp->usrtags = SYM_SETUP_MAX_TAG; + tp->usr_width = np->maxwide; + tp->usr_period = 9; sym_nvram_setup_target(tp, i, nvram); -- cgit v1.2.3 From e2482fa16e9eef88344a4dca1a390d29432d4add Mon Sep 17 00:00:00 2001 From: "Jürgen E. Fischer" Date: Sun, 19 Feb 2006 00:31:51 +0100 Subject: [SCSI] aha152x: fix variable use before initialisation and other bugs - change interface of the reset functions from Scsi_Cmnd to Scsi_Host. - add functions with the original interface and rename the new functions to reflect the new interface. - call these from the pcmcia driver, thereby avoiding the need to construct a (broken) Scsi_Cmnd from a Scsi_Host. - just run the bh if the interrupt is from the controller and if so ensure that it's only called once per interrupt. Signed-off-by: Juergen E. Fischer Signed-off-by: James Bottomley --- drivers/scsi/aha152x.c | 85 +++++++++++++++++++++++--------------- drivers/scsi/aha152x.h | 2 +- drivers/scsi/pcmcia/aha152x_stub.c | 4 +- 3 files changed, 54 insertions(+), 37 deletions(-) (limited to 'drivers') diff --git a/drivers/scsi/aha152x.c b/drivers/scsi/aha152x.c index cb2ee25f213f..531a1f9ceb51 100644 --- a/drivers/scsi/aha152x.c +++ b/drivers/scsi/aha152x.c @@ -1260,16 +1260,15 @@ static void free_hard_reset_SCs(struct Scsi_Host *shpnt, Scsi_Cmnd **SCs) * Reset the bus * */ -static int aha152x_bus_reset(Scsi_Cmnd *SCpnt) +static int aha152x_bus_reset_host(struct Scsi_Host *shpnt) { - struct Scsi_Host *shpnt = SCpnt->device->host; unsigned long flags; DO_LOCK(flags); #if defined(AHA152X_DEBUG) if(HOSTDATA(shpnt)->debug & debug_eh) { - printk(DEBUG_LEAD "aha152x_bus_reset(%p)", CMDINFO(SCpnt), SCpnt); + printk(KERN_DEBUG "scsi%d: bus reset", shpnt->host_no); show_queues(shpnt); } #endif @@ -1277,14 +1276,14 @@ static int aha152x_bus_reset(Scsi_Cmnd *SCpnt) free_hard_reset_SCs(shpnt, &ISSUE_SC); free_hard_reset_SCs(shpnt, &DISCONNECTED_SC); - DPRINTK(debug_eh, DEBUG_LEAD "resetting bus\n", CMDINFO(SCpnt)); + DPRINTK(debug_eh, KERN_DEBUG "scsi%d: resetting bus\n", shpnt->host_no); SETPORT(SCSISEQ, SCSIRSTO); mdelay(256); SETPORT(SCSISEQ, 0); mdelay(DELAY); - DPRINTK(debug_eh, DEBUG_LEAD "bus resetted\n", CMDINFO(SCpnt)); + DPRINTK(debug_eh, KERN_DEBUG "scsi%d: bus resetted\n", shpnt->host_no); setup_expected_interrupts(shpnt); if(HOSTDATA(shpnt)->commands==0) @@ -1295,6 +1294,14 @@ static int aha152x_bus_reset(Scsi_Cmnd *SCpnt) return SUCCESS; } +/* + * Reset the bus + * + */ +static int aha152x_bus_reset(Scsi_Cmnd *SCpnt) +{ + return aha152x_bus_reset_host(SCpnt->device->host); +} /* * Restore default values to the AIC-6260 registers and reset the fifos @@ -1337,22 +1344,27 @@ static void reset_ports(struct Scsi_Host *shpnt) * Reset the host (bus and controller) * */ -int aha152x_host_reset(Scsi_Cmnd * SCpnt) +int aha152x_host_reset_host(struct Scsi_Host *shpnt) { -#if defined(AHA152X_DEBUG) - struct Scsi_Host *shpnt = SCpnt->device->host; -#endif - - DPRINTK(debug_eh, DEBUG_LEAD "aha152x_host_reset(%p)\n", CMDINFO(SCpnt), SCpnt); + DPRINTK(debug_eh, KERN_DEBUG "scsi%d: host reset\n", shpnt->host_no); - aha152x_bus_reset(SCpnt); + aha152x_bus_reset_host(shpnt); - DPRINTK(debug_eh, DEBUG_LEAD "resetting ports\n", CMDINFO(SCpnt)); - reset_ports(SCpnt->device->host); + DPRINTK(debug_eh, KERN_DEBUG "scsi%d: resetting ports\n", shpnt->host_no); + reset_ports(shpnt); return SUCCESS; } +/* + * Reset the host (bus and controller) + * + */ +static int aha152x_host_reset(Scsi_Cmnd *SCpnt) +{ + return aha152x_host_reset_host(SCpnt->device->host); +} + /* * Return the "logical geometry" * @@ -1431,22 +1443,18 @@ static void run(void) { int i; for (i = 0; iservice) { - HOSTDATA(shpnt)->service=0; - is_complete(shpnt); - } + is_complete(aha152x_host[i]); } } /* - * Interrupts handler + * Interrupt handler * */ - static irqreturn_t intr(int irqno, void *dev_id, struct pt_regs *regs) { struct Scsi_Host *shpnt = lookup_irq(irqno); + unsigned long flags; unsigned char rev, dmacntrl0; if (!shpnt) { @@ -1472,23 +1480,23 @@ static irqreturn_t intr(int irqno, void *dev_id, struct pt_regs *regs) if ((rev == 0xFF) && (dmacntrl0 == 0xFF)) return IRQ_NONE; + if( TESTLO(DMASTAT, INTSTAT) ) + return IRQ_NONE; + /* no more interrupts from the controller, while we're busy. INTEN is restored by the BH handler */ CLRBITS(DMACNTRL0, INTEN); -#if 0 - /* check if there is already something to be - serviced; should not happen */ - if(HOSTDATA(shpnt)->service) { - printk(KERN_ERR "aha152x%d: lost interrupt (%d)\n", HOSTNO, HOSTDATA(shpnt)->service); - show_queues(shpnt); + DO_LOCK(flags); + if( HOSTDATA(shpnt)->service==0 ) { + HOSTDATA(shpnt)->service=1; + + /* Poke the BH handler */ + INIT_WORK(&aha152x_tq, (void *) run, NULL); + schedule_work(&aha152x_tq); } -#endif - - /* Poke the BH handler */ - HOSTDATA(shpnt)->service++; - INIT_WORK(&aha152x_tq, (void *) run, NULL); - schedule_work(&aha152x_tq); + DO_UNLOCK(flags); + return IRQ_HANDLED; } @@ -2527,7 +2535,18 @@ static void is_complete(struct Scsi_Host *shpnt) unsigned long flags; int pending; + if(!shpnt) + return; + DO_LOCK(flags); + + if( HOSTDATA(shpnt)->service==0 ) { + DO_UNLOCK(flags); + return; + } + + HOSTDATA(shpnt)->service = 0; + if(HOSTDATA(shpnt)->in_intr) { DO_UNLOCK(flags); /* aha152x_error never returns.. */ diff --git a/drivers/scsi/aha152x.h b/drivers/scsi/aha152x.h index d277613af29b..d2add24d02a3 100644 --- a/drivers/scsi/aha152x.h +++ b/drivers/scsi/aha152x.h @@ -332,6 +332,6 @@ struct aha152x_setup { struct Scsi_Host *aha152x_probe_one(struct aha152x_setup *); void aha152x_release(struct Scsi_Host *); -int aha152x_host_reset(Scsi_Cmnd *); +int aha152x_host_reset_host(struct Scsi_Host *); #endif /* _AHA152X_H */ diff --git a/drivers/scsi/pcmcia/aha152x_stub.c b/drivers/scsi/pcmcia/aha152x_stub.c index 0c9edb7051f4..5609847e254a 100644 --- a/drivers/scsi/pcmcia/aha152x_stub.c +++ b/drivers/scsi/pcmcia/aha152x_stub.c @@ -275,10 +275,8 @@ static int aha152x_resume(struct pcmcia_device *dev) link->state &= ~DEV_SUSPEND; if (link->state & DEV_CONFIG) { - Scsi_Cmnd tmp; pcmcia_request_configuration(link->handle, &link->conf); - tmp.device->host = info->host; - aha152x_host_reset(&tmp); + aha152x_host_reset_host(info->host); } return 0; -- cgit v1.2.3 From 436002e3293472e4a7e47e5025999fc312794c4a Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Tue, 28 Feb 2006 11:55:36 -0800 Subject: [SUNSU]: Fix locking error in sunsu_stop_rx(). The caller takes the UART port lock, so we shouldn't try to take it again. Signed-off-by: David S. Miller --- drivers/serial/sunsu.c | 3 --- 1 file changed, 3 deletions(-) (limited to 'drivers') diff --git a/drivers/serial/sunsu.c b/drivers/serial/sunsu.c index 308704566948..4e453fa966ae 100644 --- a/drivers/serial/sunsu.c +++ b/drivers/serial/sunsu.c @@ -299,13 +299,10 @@ static void sunsu_start_tx(struct uart_port *port) static void sunsu_stop_rx(struct uart_port *port) { struct uart_sunsu_port *up = (struct uart_sunsu_port *) port; - unsigned long flags; - spin_lock_irqsave(&up->port.lock, flags); up->ier &= ~UART_IER_RLSI; up->port.read_status_mask &= ~UART_LSR_DR; serial_out(up, UART_IER, up->ier); - spin_unlock_irqrestore(&up->port.lock, flags); } static void sunsu_enable_ms(struct uart_port *port) -- cgit v1.2.3 From 8c450802a3abf0e8a45238fcb7d22ed9d6f191ce Mon Sep 17 00:00:00 2001 From: David Brownell Date: Fri, 24 Feb 2006 16:55:52 -0800 Subject: [PATCH] USB: fix EHCI BIOS handshake Fix http://bugzilla.kernel.org/show_bug.cgi?id=6128 Finish morphing the "early handoff" version of the EHCI BIOS handshake over to match the previous implementation inside the EHCI driver (except that now we forcibly disable the SMI). The version that had been with the PCI code was surprisingly full of bugs. Signed-off-by: David Brownell Cc: Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/pci-quirks.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'drivers') diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c index 118288d94423..9e81c26313f9 100644 --- a/drivers/usb/host/pci-quirks.c +++ b/drivers/usb/host/pci-quirks.c @@ -260,12 +260,13 @@ static void __devinit quirk_usb_disable_ehci(struct pci_dev *pdev) offset + EHCI_USBLEGCTLSTS, val | EHCI_USBLEGCTLSTS_SOOE); #endif - } - /* always say Linux will own the hardware - * by setting EHCI_USBLEGSUP_OS. - */ - pci_write_config_byte(pdev, offset + 3, 1); + /* some systems get upset if this semaphore is + * set for any other reason than forcing a BIOS + * handoff.. + */ + pci_write_config_byte(pdev, offset + 3, 1); + } /* if boot firmware now owns EHCI, spin till * it hands it over. -- cgit v1.2.3 From e65335ef187c9cbc50bbc56be0fe966b593beb49 Mon Sep 17 00:00:00 2001 From: Andrew Fuller Date: Sat, 25 Feb 2006 09:52:27 -0500 Subject: [PATCH] USB: Wisegroup MP-8866 Dual USB Joypad This patch is for the Dual USB Joypad [0925:8866] from Wisegroup. The HID_QUIRK_NOGET is necessary for it to respond to input, and the HID_QUIRK_MULTI_INPUT is necessary to have two js# nodes appear. Signed-off-by: Andrew Fuller Cc: "Dmitry Torokhov" Signed-off-by: Greg Kroah-Hartman --- drivers/usb/input/hid-core.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers') diff --git a/drivers/usb/input/hid-core.c b/drivers/usb/input/hid-core.c index 772478086bd3..07a012f88772 100644 --- a/drivers/usb/input/hid-core.c +++ b/drivers/usb/input/hid-core.c @@ -1407,6 +1407,7 @@ void hid_init_reports(struct hid_device *hid) #define USB_VENDOR_ID_WISEGROUP 0x0925 #define USB_DEVICE_ID_1_PHIDGETSERVO_20 0x8101 #define USB_DEVICE_ID_4_PHIDGETSERVO_20 0x8104 +#define USB_DEVICE_ID_DUAL_USB_JOYPAD 0x8866 #define USB_VENDOR_ID_CODEMERCS 0x07c0 #define USB_DEVICE_ID_CODEMERCS_IOW40 0x1500 @@ -1577,6 +1578,7 @@ static const struct hid_blacklist { { USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_USBHUB_KB, HID_QUIRK_NOGET}, { USB_VENDOR_ID_HP, USB_DEVICE_ID_HP_USBHUB_KB, HID_QUIRK_NOGET }, { USB_VENDOR_ID_TANGTOP, USB_DEVICE_ID_TANGTOP_USBPS2, HID_QUIRK_NOGET }, + { USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_DUAL_USB_JOYPAD, HID_QUIRK_NOGET | HID_QUIRK_MULTI_INPUT }, { USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_POWERMOUSE, HID_QUIRK_2WHEEL_POWERMOUSE }, { USB_VENDOR_ID_A4TECH, USB_DEVICE_ID_A4TECH_WCP32PU, HID_QUIRK_2WHEEL_MOUSE_HACK_7 }, -- cgit v1.2.3 From 754501b324fc3c42522a46d3ace205e7a6a50e77 Mon Sep 17 00:00:00 2001 From: Alan Stern Date: Thu, 23 Feb 2006 10:19:25 -0500 Subject: [PATCH] USB: unusual_devs entry for Lyra RCA RD1080 This patch (as656) adds an unusual_devs.h entry for the Lyra RCA RD1080 MP3 player. Its card-reader firmware has the common report-one-too-many-sectors bug. This fixes Novell bug #152175. Signed-off-by: Alan Stern Signed-off-by: Greg Kroah-Hartman --- drivers/usb/storage/unusual_devs.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'drivers') diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h index e71c5ca1a07b..31ca92056c27 100644 --- a/drivers/usb/storage/unusual_devs.h +++ b/drivers/usb/storage/unusual_devs.h @@ -753,6 +753,13 @@ UNUSUAL_DEV( 0x0693, 0x0005, 0x0100, 0x0100, "Flashgate", US_SC_SCSI, US_PR_BULK, NULL, 0 ), +/* Reported by David Hamilton */ +UNUSUAL_DEV( 0x069b, 0x3004, 0x0001, 0x0001, + "Thomson Multimedia Inc.", + "RCA RD1080 MP3 Player", + US_SC_DEVICE, US_PR_DEVICE, NULL, + US_FL_FIX_CAPACITY ), + UNUSUAL_DEV( 0x0781, 0x0001, 0x0200, 0x0200, "Sandisk", "ImageMate SDDR-05a", -- cgit v1.2.3 From d5ec33490c67affef93aebf76e1238260c82d377 Mon Sep 17 00:00:00 2001 From: Franck Bui-Huu Date: Thu, 23 Feb 2006 09:35:06 +0100 Subject: [PATCH] USB: lh7a40x gadget driver: Fixed a dead lock There is a dead lock in lh7a40x udc driver. When the driver receive a SET_FEATURE HALT request, the dev lock is taken by the interrupt handler lh7a40x_udc_irq then the handler will call lh7a40x_set_halt function which in its turn will try to acquire the dev lock. Signed-off-by: Franck Bui-Huu Signed-off-by: Greg Kroah-Hartman --- drivers/usb/gadget/lh7a40x_udc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/usb/gadget/lh7a40x_udc.c b/drivers/usb/gadget/lh7a40x_udc.c index e02fea5a5433..1a362c5e7f3d 100644 --- a/drivers/usb/gadget/lh7a40x_udc.c +++ b/drivers/usb/gadget/lh7a40x_udc.c @@ -1062,11 +1062,11 @@ static int lh7a40x_ep_enable(struct usb_ep *_ep, ep->pio_irqs = 0; ep->ep.maxpacket = le16_to_cpu(desc->wMaxPacketSize); + spin_unlock_irqrestore(&ep->dev->lock, flags); + /* Reset halt state (does flush) */ lh7a40x_set_halt(_ep, 0); - spin_unlock_irqrestore(&ep->dev->lock, flags); - DEBUG("%s: enabled %s\n", __FUNCTION__, _ep->name); return 0; } @@ -1775,6 +1775,7 @@ static void lh7a40x_ep0_setup(struct lh7a40x_udc *dev, u32 csr) break; qep = &dev->ep[ep_num]; + spin_unlock(&dev->lock); if (ctrl.bRequest == USB_REQ_SET_FEATURE) { DEBUG_SETUP("SET_FEATURE (%d)\n", ep_num); @@ -1784,6 +1785,7 @@ static void lh7a40x_ep0_setup(struct lh7a40x_udc *dev, u32 csr) ep_num); lh7a40x_set_halt(&qep->ep, 0); } + spin_lock(&dev->lock); usb_set_index(0); /* Reply with a ZLP on next IN token */ -- cgit v1.2.3 From 8763716bfe4d8a16bef28c9947cf9d799b1796a5 Mon Sep 17 00:00:00 2001 From: Shaun Tancheff Date: Wed, 22 Feb 2006 19:47:19 -0800 Subject: [PATCH] USB: Gadget RNDIS fix alloc bug. (buffer overflow) Remote NDIS response to OID_GEN_SUPPORTED_LIST only allocated space for the data attached to the reply, and not the reply structure itself. This caused other kmalloc'd memory to be corrupted. Signed-off-by: Shaun Tancheff Signed-off-by: David Brownell Signed-off-by: Greg Kroah-Hartman --- drivers/usb/gadget/rndis.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'drivers') diff --git a/drivers/usb/gadget/rndis.c b/drivers/usb/gadget/rndis.c index 9689efeb364c..6d6eaad73968 100644 --- a/drivers/usb/gadget/rndis.c +++ b/drivers/usb/gadget/rndis.c @@ -853,11 +853,14 @@ static int rndis_query_response (int configNr, rndis_query_msg_type *buf) // DEBUG("%s: OID = %08X\n", __FUNCTION__, cpu_to_le32(buf->OID)); if (!rndis_per_dev_params [configNr].dev) return -ENOTSUPP; - /* - * we need more memory: - * oid_supported_list is the largest answer + /* + * we need more memory: + * gen_ndis_query_resp expects enough space for + * rndis_query_cmplt_type followed by data. + * oid_supported_list is the largest data reply */ - r = rndis_add_response (configNr, sizeof (oid_supported_list)); + r = rndis_add_response (configNr, + sizeof (oid_supported_list) + sizeof(rndis_query_cmplt_type)); if (!r) return -ENOMEM; resp = (rndis_query_cmplt_type *) r->buf; -- cgit v1.2.3 From 04d52461c6ecfc5b72e688b0eb2ead7b555eca25 Mon Sep 17 00:00:00 2001 From: Hendrik Schweppe Date: Sun, 19 Feb 2006 19:00:04 +0100 Subject: [PATCH] USB: visor.c id for gspda smartphone Added the USB vendorID of GSPDA and the productID of GSPDA's palm smartphone 'xplore m68' to the list of known devices. Signed-off-by: Hendrik Schweppe Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/visor.c | 3 +++ drivers/usb/serial/visor.h | 3 +++ 2 files changed, 6 insertions(+) (limited to 'drivers') diff --git a/drivers/usb/serial/visor.c b/drivers/usb/serial/visor.c index bce3d55affd8..11a48d874752 100644 --- a/drivers/usb/serial/visor.c +++ b/drivers/usb/serial/visor.c @@ -69,6 +69,8 @@ static struct usb_device_id id_table [] = { .driver_info = (kernel_ulong_t)&palm_os_4_probe }, { USB_DEVICE(HANDSPRING_VENDOR_ID, HANDSPRING_TREO600_ID), .driver_info = (kernel_ulong_t)&palm_os_4_probe }, + { USB_DEVICE(GSPDA_VENDOR_ID, GSPDA_XPLORE_M68_ID), + .driver_info = (kernel_ulong_t)&palm_os_4_probe }, { USB_DEVICE(PALM_VENDOR_ID, PALM_M500_ID), .driver_info = (kernel_ulong_t)&palm_os_4_probe }, { USB_DEVICE(PALM_VENDOR_ID, PALM_M505_ID), @@ -139,6 +141,7 @@ static struct usb_device_id id_table_combined [] = { { USB_DEVICE(HANDSPRING_VENDOR_ID, HANDSPRING_VISOR_ID) }, { USB_DEVICE(HANDSPRING_VENDOR_ID, HANDSPRING_TREO_ID) }, { USB_DEVICE(HANDSPRING_VENDOR_ID, HANDSPRING_TREO600_ID) }, + { USB_DEVICE(GSPDA_VENDOR_ID, GSPDA_XPLORE_M68_ID) }, { USB_DEVICE(PALM_VENDOR_ID, PALM_M500_ID) }, { USB_DEVICE(PALM_VENDOR_ID, PALM_M505_ID) }, { USB_DEVICE(PALM_VENDOR_ID, PALM_M515_ID) }, diff --git a/drivers/usb/serial/visor.h b/drivers/usb/serial/visor.h index b84d1cb4c693..765118d83fb6 100644 --- a/drivers/usb/serial/visor.h +++ b/drivers/usb/serial/visor.h @@ -36,6 +36,9 @@ #define PALM_ZIRE_ID 0x0070 #define PALM_M100_ID 0x0080 +#define GSPDA_VENDOR_ID 0x115e +#define GSPDA_XPLORE_M68_ID 0xf100 + #define SONY_VENDOR_ID 0x054C #define SONY_CLIE_3_5_ID 0x0038 #define SONY_CLIE_4_0_ID 0x0066 -- cgit v1.2.3 From 34d1a8aa882df916e1b078dc935e3d2d3792aea2 Mon Sep 17 00:00:00 2001 From: Ian Abbott Date: Mon, 27 Feb 2006 14:05:32 +0000 Subject: [PATCH] USB: ftdi_sio: new microHAM device IDs This patch adds a bunch of new device IDs to the ftdi_sio driver for various devices from microHAM using FTDI chips. Micheal Studer supplied the PID for the USB-Y9 device. I examined the INF file in microHAM's Windows driver package for the USB-KW, USB-YS, USB-IC, USB-DB9 and USB-RS232 devices. Signed-off-by: Ian Abbott Signed-off-by: Greg Kroah-Hartman --- drivers/usb/serial/ftdi_sio.c | 6 ++++++ drivers/usb/serial/ftdi_sio.h | 10 +++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c index f2b4ca8692d8..c145e1ed8429 100644 --- a/drivers/usb/serial/ftdi_sio.c +++ b/drivers/usb/serial/ftdi_sio.c @@ -469,8 +469,14 @@ static struct usb_device_id id_table_combined [] = { { USB_DEVICE(FTDI_VID, XSENS_CONVERTER_7_PID) }, { USB_DEVICE(MOBILITY_VID, MOBILITY_USB_SERIAL_PID) }, { USB_DEVICE(FTDI_VID, FTDI_ACTIVE_ROBOTS_PID) }, + { USB_DEVICE(FTDI_VID, FTDI_MHAM_KW_PID) }, + { USB_DEVICE(FTDI_VID, FTDI_MHAM_YS_PID) }, { USB_DEVICE(FTDI_VID, FTDI_MHAM_Y6_PID) }, { USB_DEVICE(FTDI_VID, FTDI_MHAM_Y8_PID) }, + { USB_DEVICE(FTDI_VID, FTDI_MHAM_IC_PID) }, + { USB_DEVICE(FTDI_VID, FTDI_MHAM_DB9_PID) }, + { USB_DEVICE(FTDI_VID, FTDI_MHAM_RS232_PID) }, + { USB_DEVICE(FTDI_VID, FTDI_MHAM_Y9_PID) }, { USB_DEVICE(FTDI_VID, FTDI_TERATRONIK_VCP_PID) }, { USB_DEVICE(FTDI_VID, FTDI_TERATRONIK_D2XX_PID) }, { USB_DEVICE(EVOLUTION_VID, EVOLUTION_ER1_PID) }, diff --git a/drivers/usb/serial/ftdi_sio.h b/drivers/usb/serial/ftdi_sio.h index ca40f16370f1..bdef3b8c731f 100644 --- a/drivers/usb/serial/ftdi_sio.h +++ b/drivers/usb/serial/ftdi_sio.h @@ -333,10 +333,18 @@ /* * microHAM product IDs (http://www.microham.com). - * Submitted by Justin Burket (KL1RL) . + * Submitted by Justin Burket (KL1RL) + * and Mike Studer (K6EEP) . + * Ian Abbott added a few more from the driver INF file. */ +#define FTDI_MHAM_KW_PID 0xEEE8 /* USB-KW interface */ +#define FTDI_MHAM_YS_PID 0xEEE9 /* USB-YS interface */ #define FTDI_MHAM_Y6_PID 0xEEEA /* USB-Y6 interface */ #define FTDI_MHAM_Y8_PID 0xEEEB /* USB-Y8 interface */ +#define FTDI_MHAM_IC_PID 0xEEEC /* USB-IC interface */ +#define FTDI_MHAM_DB9_PID 0xEEED /* USB-DB9 interface */ +#define FTDI_MHAM_RS232_PID 0xEEEE /* USB-RS232 interface */ +#define FTDI_MHAM_Y9_PID 0xEEEF /* USB-Y9 interface */ /* * Active Robots product ids. -- cgit v1.2.3 From 958ddb75b04b792c701b2b08acdb200d638abf4e Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Mon, 27 Feb 2006 13:13:54 -0800 Subject: [PATCH] sky2: remove MSI support Remove Message Signaled Interrupt support (for 2.6.16). MSI is inherently edge-triggered and that is incompatiable (without more work) with NAPI. In future, will replace with smarter lockless-IRQ handling like tg3.c Signed-off-by: Stephen Hemminger Signed-off-by: Jeff Garzik --- drivers/net/sky2.c | 77 ------------------------------------------------------ drivers/net/sky2.h | 1 - 2 files changed, 78 deletions(-) (limited to 'drivers') diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index ca8160d68229..72c1630977d6 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c @@ -96,10 +96,6 @@ static int copybreak __read_mostly = 256; module_param(copybreak, int, 0); MODULE_PARM_DESC(copybreak, "Receive copy threshold"); -static int disable_msi = 0; -module_param(disable_msi, int, 0); -MODULE_PARM_DESC(disable_msi, "Disable Message Signaled Interrupt (MSI)"); - static const struct pci_device_id sky2_id_table[] = { { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9000) }, { PCI_DEVICE(PCI_VENDOR_ID_SYSKONNECT, 0x9E00) }, @@ -3126,61 +3122,6 @@ static void __devinit sky2_show_addr(struct net_device *dev) dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5]); } -/* Handle software interrupt used during MSI test */ -static irqreturn_t __devinit sky2_test_intr(int irq, void *dev_id, - struct pt_regs *regs) -{ - struct sky2_hw *hw = dev_id; - u32 status = sky2_read32(hw, B0_Y2_SP_ISRC2); - - if (status == 0) - return IRQ_NONE; - - if (status & Y2_IS_IRQ_SW) { - sky2_write8(hw, B0_CTST, CS_CL_SW_IRQ); - hw->msi = 1; - } - sky2_write32(hw, B0_Y2_SP_ICR, 2); - - sky2_read32(hw, B0_IMSK); - return IRQ_HANDLED; -} - -/* Test interrupt path by forcing a a software IRQ */ -static int __devinit sky2_test_msi(struct sky2_hw *hw) -{ - struct pci_dev *pdev = hw->pdev; - int i, err; - - sky2_write32(hw, B0_IMSK, Y2_IS_IRQ_SW); - - err = request_irq(pdev->irq, sky2_test_intr, SA_SHIRQ, DRV_NAME, hw); - if (err) { - printk(KERN_ERR PFX "%s: cannot assign irq %d\n", - pci_name(pdev), pdev->irq); - return err; - } - - sky2_write8(hw, B0_CTST, CS_ST_SW_IRQ); - wmb(); - - for (i = 0; i < 10; i++) { - barrier(); - if (hw->msi) - goto found; - mdelay(1); - } - - err = -EOPNOTSUPP; - sky2_write8(hw, B0_CTST, CS_CL_SW_IRQ); - found: - sky2_write32(hw, B0_IMSK, 0); - - free_irq(pdev->irq, hw); - - return err; -} - static int __devinit sky2_probe(struct pci_dev *pdev, const struct pci_device_id *ent) { @@ -3302,20 +3243,6 @@ static int __devinit sky2_probe(struct pci_dev *pdev, } } - if (!disable_msi && pci_enable_msi(pdev) == 0) { - err = sky2_test_msi(hw); - if (err == -EOPNOTSUPP) { - /* MSI test failed, go back to INTx mode */ - printk(KERN_WARNING PFX "%s: No interrupt was generated using MSI, " - "switching to INTx mode. Please report this failure to " - "the PCI maintainer and include system chipset information.\n", - pci_name(pdev)); - pci_disable_msi(pdev); - } - else if (err) - goto err_out_unregister; - } - err = request_irq(pdev->irq, sky2_intr, SA_SHIRQ | SA_SAMPLE_RANDOM, DRV_NAME, hw); if (err) { @@ -3332,8 +3259,6 @@ static int __devinit sky2_probe(struct pci_dev *pdev, return 0; err_out_unregister: - if (hw->msi) - pci_disable_msi(pdev); if (dev1) { unregister_netdev(dev1); free_netdev(dev1); @@ -3376,8 +3301,6 @@ static void __devexit sky2_remove(struct pci_dev *pdev) sky2_read8(hw, B0_CTST); free_irq(pdev->irq, hw); - if (hw->msi) - pci_disable_msi(pdev); pci_free_consistent(pdev, STATUS_LE_BYTES, hw->st_le, hw->st_dma); pci_release_regions(pdev); pci_disable_device(pdev); diff --git a/drivers/net/sky2.h b/drivers/net/sky2.h index 3edb98075e0a..dce955c76f3c 100644 --- a/drivers/net/sky2.h +++ b/drivers/net/sky2.h @@ -1881,7 +1881,6 @@ struct sky2_hw { u32 intr_mask; int pm_cap; - int msi; u8 chip_id; u8 chip_rev; u8 copper; -- cgit v1.2.3 From a1415ee65500597e19c0ac44872db66105bad0e7 Mon Sep 17 00:00:00 2001 From: Jeff Kirsher Date: Tue, 28 Feb 2006 20:24:07 -0800 Subject: [PATCH] e1000: revert to single descriptor for legacy receive path A recent patch attempted to enable more efficient memory usage by using only 2kB descriptors for jumbo frames. The method used to implement this has since been commented upon as "illegal" and in recent kernels even causes a BUG when receiving ip fragments while using jumbo frames. This patch simply goes back to the way things were. We expect some complaints due to order 3 allocations failing to come back due to this change. Signed-off-by: Jesse Brandeburg --- drivers/net/e1000/e1000.h | 3 -- drivers/net/e1000/e1000_main.c | 119 ++++++++++++++++------------------------- 2 files changed, 46 insertions(+), 76 deletions(-) (limited to 'drivers') diff --git a/drivers/net/e1000/e1000.h b/drivers/net/e1000/e1000.h index 27c77306193b..99baf0e099fc 100644 --- a/drivers/net/e1000/e1000.h +++ b/drivers/net/e1000/e1000.h @@ -225,9 +225,6 @@ struct e1000_rx_ring { struct e1000_ps_page *ps_page; struct e1000_ps_page_dma *ps_page_dma; - struct sk_buff *rx_skb_top; - struct sk_buff *rx_skb_prev; - /* cpu for rx queue */ int cpu; diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index 31e332935e5a..5b7d0f425af2 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c @@ -103,7 +103,7 @@ static char e1000_driver_string[] = "Intel(R) PRO/1000 Network Driver"; #else #define DRIVERNAPI "-NAPI" #endif -#define DRV_VERSION "6.3.9-k2"DRIVERNAPI +#define DRV_VERSION "6.3.9-k4"DRIVERNAPI char e1000_driver_version[] = DRV_VERSION; static char e1000_copyright[] = "Copyright (c) 1999-2005 Intel Corporation."; @@ -1635,8 +1635,6 @@ setup_rx_desc_die: rxdr->next_to_clean = 0; rxdr->next_to_use = 0; - rxdr->rx_skb_top = NULL; - rxdr->rx_skb_prev = NULL; return 0; } @@ -1713,8 +1711,23 @@ e1000_setup_rctl(struct e1000_adapter *adapter) rctl |= adapter->rx_buffer_len << 0x11; } else { rctl &= ~E1000_RCTL_SZ_4096; - rctl &= ~E1000_RCTL_BSEX; - rctl |= E1000_RCTL_SZ_2048; + rctl |= E1000_RCTL_BSEX; + switch (adapter->rx_buffer_len) { + case E1000_RXBUFFER_2048: + default: + rctl |= E1000_RCTL_SZ_2048; + rctl &= ~E1000_RCTL_BSEX; + break; + case E1000_RXBUFFER_4096: + rctl |= E1000_RCTL_SZ_4096; + break; + case E1000_RXBUFFER_8192: + rctl |= E1000_RCTL_SZ_8192; + break; + case E1000_RXBUFFER_16384: + rctl |= E1000_RCTL_SZ_16384; + break; + } } #ifndef CONFIG_E1000_DISABLE_PACKET_SPLIT @@ -2107,16 +2120,6 @@ e1000_clean_rx_ring(struct e1000_adapter *adapter, } } - /* there also may be some cached data in our adapter */ - if (rx_ring->rx_skb_top) { - dev_kfree_skb(rx_ring->rx_skb_top); - - /* rx_skb_prev will be wiped out by rx_skb_top */ - rx_ring->rx_skb_top = NULL; - rx_ring->rx_skb_prev = NULL; - } - - size = sizeof(struct e1000_buffer) * rx_ring->count; memset(rx_ring->buffer_info, 0, size); size = sizeof(struct e1000_ps_page) * rx_ring->count; @@ -3106,24 +3109,27 @@ e1000_change_mtu(struct net_device *netdev, int new_mtu) break; } - /* since the driver code now supports splitting a packet across - * multiple descriptors, most of the fifo related limitations on - * jumbo frame traffic have gone away. - * simply use 2k descriptors for everything. - * - * NOTE: dev_alloc_skb reserves 16 bytes, and typically NET_IP_ALIGN - * means we reserve 2 more, this pushes us to allocate from the next - * larger slab size - * i.e. RXBUFFER_2048 --> size-4096 slab */ - - /* recent hardware supports 1KB granularity */ + if (adapter->hw.mac_type > e1000_82547_rev_2) { - adapter->rx_buffer_len = - ((max_frame < E1000_RXBUFFER_2048) ? - max_frame : E1000_RXBUFFER_2048); + adapter->rx_buffer_len = max_frame; E1000_ROUNDUP(adapter->rx_buffer_len, 1024); - } else - adapter->rx_buffer_len = E1000_RXBUFFER_2048; + } else { + if(unlikely((adapter->hw.mac_type < e1000_82543) && + (max_frame > MAXIMUM_ETHERNET_FRAME_SIZE))) { + DPRINTK(PROBE, ERR, "Jumbo Frames not supported " + "on 82542\n"); + return -EINVAL; + } else { + if(max_frame <= E1000_RXBUFFER_2048) + adapter->rx_buffer_len = E1000_RXBUFFER_2048; + else if(max_frame <= E1000_RXBUFFER_4096) + adapter->rx_buffer_len = E1000_RXBUFFER_4096; + else if(max_frame <= E1000_RXBUFFER_8192) + adapter->rx_buffer_len = E1000_RXBUFFER_8192; + else if(max_frame <= E1000_RXBUFFER_16384) + adapter->rx_buffer_len = E1000_RXBUFFER_16384; + } + } netdev->mtu = new_mtu; @@ -3620,7 +3626,7 @@ e1000_clean_rx_irq(struct e1000_adapter *adapter, uint8_t last_byte; unsigned int i; int cleaned_count = 0; - boolean_t cleaned = FALSE, multi_descriptor = FALSE; + boolean_t cleaned = FALSE; i = rx_ring->next_to_clean; rx_desc = E1000_RX_DESC(*rx_ring, i); @@ -3652,43 +3658,12 @@ e1000_clean_rx_irq(struct e1000_adapter *adapter, length = le16_to_cpu(rx_desc->length); - skb_put(skb, length); - - if (!(status & E1000_RXD_STAT_EOP)) { - if (!rx_ring->rx_skb_top) { - rx_ring->rx_skb_top = skb; - rx_ring->rx_skb_top->len = length; - rx_ring->rx_skb_prev = skb; - } else { - if (skb_shinfo(rx_ring->rx_skb_top)->frag_list) { - rx_ring->rx_skb_prev->next = skb; - skb->prev = rx_ring->rx_skb_prev; - } else { - skb_shinfo(rx_ring->rx_skb_top)->frag_list = skb; - } - rx_ring->rx_skb_prev = skb; - rx_ring->rx_skb_top->data_len += length; - } + if (unlikely(!(status & E1000_RXD_STAT_EOP))) { + /* All receives must fit into a single buffer */ + E1000_DBG("%s: Receive packet consumed multiple" + " buffers\n", netdev->name); + dev_kfree_skb_irq(skb); goto next_desc; - } else { - if (rx_ring->rx_skb_top) { - if (skb_shinfo(rx_ring->rx_skb_top) - ->frag_list) { - rx_ring->rx_skb_prev->next = skb; - skb->prev = rx_ring->rx_skb_prev; - } else - skb_shinfo(rx_ring->rx_skb_top) - ->frag_list = skb; - - rx_ring->rx_skb_top->data_len += length; - rx_ring->rx_skb_top->len += - rx_ring->rx_skb_top->data_len; - - skb = rx_ring->rx_skb_top; - multi_descriptor = TRUE; - rx_ring->rx_skb_top = NULL; - rx_ring->rx_skb_prev = NULL; - } } if (unlikely(rx_desc->errors & E1000_RXD_ERR_FRAME_ERR_MASK)) { @@ -3712,10 +3687,7 @@ e1000_clean_rx_irq(struct e1000_adapter *adapter, * performance for small packets with large amounts * of reassembly being done in the stack */ #define E1000_CB_LENGTH 256 - if ((length < E1000_CB_LENGTH) && - !rx_ring->rx_skb_top && - /* or maybe (status & E1000_RXD_STAT_EOP) && */ - !multi_descriptor) { + if (length < E1000_CB_LENGTH) { struct sk_buff *new_skb = dev_alloc_skb(length + NET_IP_ALIGN); if (new_skb) { @@ -3729,7 +3701,8 @@ e1000_clean_rx_irq(struct e1000_adapter *adapter, skb = new_skb; skb_put(skb, length); } - } + } else + skb_put(skb, length); /* end copybreak code */ -- cgit v1.2.3 From 9cff3372bf665652e9dd71c09b817c20f58f754a Mon Sep 17 00:00:00 2001 From: John Bowler Date: Tue, 28 Feb 2006 16:59:08 -0800 Subject: [PATCH] drivers/mtd/redboot.c: recognise a foreign byte sex partition table The RedBoot boot loader writes flash partition tables containing native byte sex 32 bit values. When booting an opposite byte sex kernel (e.g. an LE kernel from BE RedBoot) the current MTD driver fails to handle the partition table and therefore is unable to generate the correct partition map for the flash. So far as I am aware this problem is ARM specific, because only ARM supports software change of the CPU (memory system) byte sex, however the partition table parsing is in generic MTD code. The patch below has been tested on NSLU2 (an IXP4XX based system) with a patch, 10-ixp4xx-copy-from.patch (submitted to linux-arm-kernel - it's ARM specific) required to make the maps/ixp4xx.c driver work with an LE kernel. Builds of the patched system are in the 'unstable' release of OpenSlug and UcSlugC available from www.nslu2-linux.org. These builds are BE, the archives at www.nslu2-linux.org and www.handhelds.org (see monotone.vanille.de) can be built LE (currently DISTRO targets nslu-ltu.conf for LE thumb uclibc (32 bit kernel) and nslu2-lau.conf, nslu2-lag.conf for LE arm uclibc/glibc) and this patch has been tested extensively will both BE and LE systems on the NSLU2 (including swapping between BE and LE by reflashing from both RedBoot and Linux). The patch recognises that the FIS directory (the partition table) is byte-reversed by examining the partition table size, which is known to be one erase block (this is an assumption made elsewhere in redboot.c). If the size matches the erase block after byte swapping the value then byte-reversal is assumed, if not no further action is taken. The patched code is fail safe; should redboot.c be changed to support a partition table with a modified size field the test will fail and the partition table will be assumed to have the host byte sex. If byte-reversal is detected the patch byte swaps the remainder of the 32 bit fields in the copy of the table; this copy is then used to set up the MTD partition map. Signed-off-by: John Bowler Cc: David Woodhouse Cc: Thomas Gleixner Cc: Martin Michlmayr Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/mtd/redboot.c | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/mtd/redboot.c b/drivers/mtd/redboot.c index 7b7ca5ab5ae4..d01b6a9198e0 100644 --- a/drivers/mtd/redboot.c +++ b/drivers/mtd/redboot.c @@ -89,8 +89,34 @@ static int parse_redboot_partitions(struct mtd_info *master, i = numslots; break; } - if (!memcmp(buf[i].name, "FIS directory", 14)) + if (!memcmp(buf[i].name, "FIS directory", 14)) { + /* This is apparently the FIS directory entry for the + * FIS directory itself. The FIS directory size is + * one erase block, if the buf[i].size field is + * swab32(erasesize) then we know we are looking at + * a byte swapped FIS directory - swap all the entries! + * (NOTE: this is 'size' not 'data_length', size is + * the full size of the entry.) + */ + if (swab32(buf[i].size) == master->erasesize) { + int j; + for (j = 0; j < numslots && buf[j].name[0] != 0xff; ++j) { + /* The unsigned long fields were written with the + * wrong byte sex, name and pad have no byte sex. + */ +# define do_swab32(x) (x) = swab32(x) + do_swab32(buf[j].flash_base); + do_swab32(buf[j].mem_base); + do_swab32(buf[j].size); + do_swab32(buf[j].entry_point); + do_swab32(buf[j].data_length); + do_swab32(buf[j].desc_cksum); + do_swab32(buf[j].file_cksum); +# undef do_swab32 + } + } break; + } } if (i == numslots) { /* Didn't find it */ -- cgit v1.2.3 From 15b370c95cbc1553eec30a99a5ffb3ac3c8d7b81 Mon Sep 17 00:00:00 2001 From: Pat Gefre Date: Tue, 28 Feb 2006 16:59:09 -0800 Subject: [PATCH] Altix: more ioc3 cleanups and locking fixes Some "inline" removing that Andrew suggested, removed some locking on add/remove at this level - we'll let the callees decide. Signed-off-by: Patrick Gefre Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/sn/ioc3.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) (limited to 'drivers') diff --git a/drivers/sn/ioc3.c b/drivers/sn/ioc3.c index 12357e1fa558..93449a1a0065 100644 --- a/drivers/sn/ioc3.c +++ b/drivers/sn/ioc3.c @@ -62,7 +62,7 @@ static int nic_reset(struct ioc3_driver_data *idd) return presence; } -static inline int nic_read_bit(struct ioc3_driver_data *idd) +static int nic_read_bit(struct ioc3_driver_data *idd) { int result; unsigned long flags; @@ -77,7 +77,7 @@ static inline int nic_read_bit(struct ioc3_driver_data *idd) return result; } -static inline void nic_write_bit(struct ioc3_driver_data *idd, int bit) +static void nic_write_bit(struct ioc3_driver_data *idd, int bit) { if (bit) writel(mcr_pack(6, 110), &idd->vma->mcr); @@ -371,8 +371,7 @@ static void probe_nic(struct ioc3_driver_data *idd) /* Interrupts */ -static inline void -write_ireg(struct ioc3_driver_data *idd, uint32_t val, int which) +static void write_ireg(struct ioc3_driver_data *idd, uint32_t val, int which) { unsigned long flags; @@ -735,14 +734,12 @@ static int ioc3_probe(struct pci_dev *pdev, const struct pci_device_id *pci_id) } /* Add this IOC3 to all submodules */ - read_lock(&ioc3_submodules_lock); for(id=0;idprobe) { idd->active[id] = 1; idd->active[id] = !ioc3_submodules[id]->probe (ioc3_submodules[id], idd); } - read_unlock(&ioc3_submodules_lock); printk(KERN_INFO "IOC3 Master Driver loaded for %s\n", pci_name(pdev)); @@ -767,7 +764,6 @@ static void ioc3_remove(struct pci_dev *pdev) idd = pci_get_drvdata(pdev); /* Remove this IOC3 from all submodules */ - read_lock(&ioc3_submodules_lock); for(id=0;idactive[id]) { if(ioc3_submodules[id] && ioc3_submodules[id]->remove) @@ -781,7 +777,6 @@ static void ioc3_remove(struct pci_dev *pdev) pci_name(pdev)); idd->active[id] = 0; } - read_unlock(&ioc3_submodules_lock); /* Clear and disable all IRQs */ write_ireg(idd, ~0, IOC3_W_IEC); -- cgit v1.2.3 From 8b613e1ccf1b7ac9acc73eaa07f5aeffd3c2bb8d Mon Sep 17 00:00:00 2001 From: Adam Belay Date: Tue, 28 Feb 2006 16:59:10 -0800 Subject: [PATCH] pnp bus type fix This is Adam's pnp probing fix. It's been reported to fix hangs on several people's machines. I don't know if it's official or final, and Adam isn't contactable at present. But I'm not aware of the patch causing any regressions. Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/pnp/card.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'drivers') diff --git a/drivers/pnp/card.c b/drivers/pnp/card.c index aaa568a3806e..b68eef251614 100644 --- a/drivers/pnp/card.c +++ b/drivers/pnp/card.c @@ -303,13 +303,11 @@ found: down_write(&dev->dev.bus->subsys.rwsem); dev->card_link = clink; dev->dev.driver = &drv->link.driver; - if (drv->link.driver.probe) { - if (drv->link.driver.probe(&dev->dev)) { - dev->dev.driver = NULL; - dev->card_link = NULL; - up_write(&dev->dev.bus->subsys.rwsem); - return NULL; - } + if (pnp_bus_type.probe(&dev->dev)) { + dev->dev.driver = NULL; + dev->card_link = NULL; + up_write(&dev->dev.bus->subsys.rwsem); + return NULL; } device_bind_driver(&dev->dev); up_write(&dev->dev.bus->subsys.rwsem); -- cgit v1.2.3 From 1f050a19e122100507302a77f1969a014e21650e Mon Sep 17 00:00:00 2001 From: Alexey Dobriyan Date: Tue, 28 Feb 2006 16:59:13 -0800 Subject: [PATCH] video1394: fix "return E;" typo Signed-off-by: Alexey Dobriyan Cc: Ben Collins Cc: Jody McIntyre Cc: Stefan Richter Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/ieee1394/video1394.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/ieee1394/video1394.c b/drivers/ieee1394/video1394.c index 39fb88309e8e..216dbbf1dc8e 100644 --- a/drivers/ieee1394/video1394.c +++ b/drivers/ieee1394/video1394.c @@ -744,7 +744,7 @@ static int __video1394_ioctl(struct file *file, if (i == ISO_CHANNELS) { PRINT(KERN_ERR, ohci->host->id, "No free channel found"); - return EAGAIN; + return -EAGAIN; } if (!(ohci->ISO_channel_usage & mask)) { v.channel = i; -- cgit v1.2.3 From 6af6aab34a88050c8270ef75ddbdefef5c1dca00 Mon Sep 17 00:00:00 2001 From: Paul Fulghum Date: Tue, 28 Feb 2006 16:59:15 -0800 Subject: [PATCH] tty buffering: comment out debug code Comment out debug code in tty receive buffering. For performance reasons (I'll keep it enabled in -mm). Signed-off-by: Paul Fulghum Cc: Alan Cox Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/char/tty_io.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/char/tty_io.c b/drivers/char/tty_io.c index e9bba94fc898..53d3d066554e 100644 --- a/drivers/char/tty_io.c +++ b/drivers/char/tty_io.c @@ -303,7 +303,7 @@ static struct tty_buffer *tty_buffer_find(struct tty_struct *tty, size_t size) t->commit = 0; t->read = 0; /* DEBUG ONLY */ - memset(t->data, '*', size); +/* memset(t->data, '*', size); */ /* printk("Flip recycle %p\n", t); */ return t; } -- cgit v1.2.3 From 2641dfd981e4a3eebf387f21cf10685af06e1641 Mon Sep 17 00:00:00 2001 From: Darren Jenkins Date: Tue, 28 Feb 2006 16:59:20 -0800 Subject: [PATCH] synclink_gt: make ->init_error signed Examples of misuse are 3112 info->init_error = -1; 4440 if ((info->init_error = register_test(info)) < 0) { Signed-off-by: Darren Jenkins Signed-off-by: Alexey Dobriyan Acked-by: Paul Fulghum Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/char/synclink_gt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/char/synclink_gt.c b/drivers/char/synclink_gt.c index a85a60a93deb..b046390cd256 100644 --- a/drivers/char/synclink_gt.c +++ b/drivers/char/synclink_gt.c @@ -306,7 +306,7 @@ struct slgt_info { int tx_active; unsigned char signals; /* serial signal states */ - unsigned int init_error; /* initialization error */ + int init_error; /* initialization error */ unsigned char *tx_buf; int tx_count; -- cgit v1.2.3 From 82d56e6d2e616bee0e712330bad06b634f007a46 Mon Sep 17 00:00:00 2001 From: Dominik Brodowski Date: Fri, 27 Jan 2006 19:15:02 +0100 Subject: [PATCH] pcmcia: properly handle pseudo multi-function devices The second pseudo multi-function device of a PCMCIA card may only be configured once the first one is initialized. Therefore, delay the registration of the second device until the first one is initialized. Signed-off-by: Dominik Brodowski pcmcia_state.device_add_pending) { + s->pcmcia_state.device_add_pending = 1; + schedule_work(&s->device_add); + } + return; +} static int pcmcia_device_probe(struct device * dev) { struct pcmcia_device *p_dev; struct pcmcia_driver *p_drv; + struct pcmcia_device_id *did; struct pcmcia_socket *s; int ret = 0; @@ -392,6 +401,19 @@ static int pcmcia_device_probe(struct device * dev) } ret = p_drv->probe(p_dev); + if (ret) + goto put_module; + + /* handle pseudo multifunction devices: + * there are at most two pseudo multifunction devices. + * if we're matching against the first, schedule a + * call which will then check whether there are two + * pseudo devices, and if not, add the second one. + */ + did = (struct pcmcia_device_id *) p_dev->dev.driver_data; + if ((did->match_flags & PCMCIA_DEV_ID_MATCH_DEVICE_NO) && + (p_dev->socket->device_count == 1) && (p_dev->device_no == 0)) + pcmcia_add_pseudo_device(p_dev->socket); put_module: if (ret) @@ -660,15 +682,6 @@ static void pcmcia_delayed_add_pseudo_device(void *data) s->pcmcia_state.device_add_pending = 0; } -static inline void pcmcia_add_pseudo_device(struct pcmcia_socket *s) -{ - if (!s->pcmcia_state.device_add_pending) { - s->pcmcia_state.device_add_pending = 1; - schedule_work(&s->device_add); - } - return; -} - static int pcmcia_requery(struct device *dev, void * _data) { struct pcmcia_device *p_dev = to_pcmcia_dev(dev); @@ -755,15 +768,6 @@ static inline int pcmcia_devmatch(struct pcmcia_device *dev, } if (did->match_flags & PCMCIA_DEV_ID_MATCH_DEVICE_NO) { - /* handle pseudo multifunction devices: - * there are at most two pseudo multifunction devices. - * if we're matching against the first, schedule a - * call which will then check whether there are two - * pseudo devices, and if not, add the second one. - */ - if (dev->device_no == 0) - pcmcia_add_pseudo_device(dev->socket); - if (dev->device_no != did->device_no) return 0; } -- cgit v1.2.3 From 42935656914b813c99f91cbac421fe677a6f34ab Mon Sep 17 00:00:00 2001 From: David Brownell Date: Wed, 25 Jan 2006 06:36:32 -0800 Subject: [PATCH] pcmcia: add another ide-cs CF card id Add another CF card ID. Signed-off-by: David Brownell Signed-off-by: Dominik Brodowski --- drivers/ide/legacy/ide-cs.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers') diff --git a/drivers/ide/legacy/ide-cs.c b/drivers/ide/legacy/ide-cs.c index 4c2af9020905..6213bd3caee5 100644 --- a/drivers/ide/legacy/ide-cs.c +++ b/drivers/ide/legacy/ide-cs.c @@ -445,6 +445,7 @@ static struct pcmcia_device_id ide_ids[] = { PCMCIA_DEVICE_PROD_ID12("PCMCIA", "PnPIDE", 0x281f1c5d, 0x0c694728), PCMCIA_DEVICE_PROD_ID12("SHUTTLE TECHNOLOGY LTD.", "PCCARD-IDE/ATAPI Adapter", 0x4a3f0ba0, 0x322560e1), PCMCIA_DEVICE_PROD_ID12("TOSHIBA", "MK2001MPL", 0xb4585a1a, 0x3489e003), + PCMCIA_DEVICE_PROD_ID1("TRANSCEND 512M ", 0xd0909443), PCMCIA_DEVICE_PROD_ID12("WIT", "IDE16", 0x244e5994, 0x3e232852), PCMCIA_DEVICE_PROD_ID1("STI Flash", 0xe4a13209), PCMCIA_DEVICE_PROD_ID12("STI", "Flash 5.0", 0xbf2df18d, 0x8cb57a0e), -- cgit v1.2.3 From 40e3cad61197fce63853e778db020f7637d988f2 Mon Sep 17 00:00:00 2001 From: Pavel Roskin Date: Tue, 28 Feb 2006 01:18:31 -0500 Subject: [PATCH] pcmcia: avoid binding hostap_cs to Orinoco cards Don't just use cards with PCMCIA ID 0x0156, 0x0002. Make sure that the vendor string is "Intersil" or "INTERSIL" Signed-off-by: Pavel Roskin Signed-off-by: Dominik Brodowski --- drivers/net/wireless/hostap/hostap_cs.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/net/wireless/hostap/hostap_cs.c b/drivers/net/wireless/hostap/hostap_cs.c index 8bc0b528548f..f8f4503475f9 100644 --- a/drivers/net/wireless/hostap/hostap_cs.c +++ b/drivers/net/wireless/hostap/hostap_cs.c @@ -877,7 +877,6 @@ static struct pcmcia_device_id hostap_cs_ids[] = { PCMCIA_DEVICE_MANF_CARD(0x0101, 0x0777), PCMCIA_DEVICE_MANF_CARD(0x0126, 0x8000), PCMCIA_DEVICE_MANF_CARD(0x0138, 0x0002), - PCMCIA_DEVICE_MANF_CARD(0x0156, 0x0002), PCMCIA_DEVICE_MANF_CARD(0x0250, 0x0002), PCMCIA_DEVICE_MANF_CARD(0x026f, 0x030b), PCMCIA_DEVICE_MANF_CARD(0x0274, 0x1612), @@ -891,6 +890,10 @@ static struct pcmcia_device_id hostap_cs_ids[] = { PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0002), PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0005), PCMCIA_DEVICE_MANF_CARD(0xd601, 0x0010), + PCMCIA_DEVICE_MANF_CARD_PROD_ID1(0x0156, 0x0002, "INTERSIL", + 0x74c5e40d), + PCMCIA_DEVICE_MANF_CARD_PROD_ID1(0x0156, 0x0002, "Intersil", + 0x4b801a17), PCMCIA_MFC_DEVICE_PROD_ID12(0, "SanDisk", "ConnectPlus", 0x7a954bd9, 0x74be00c6), PCMCIA_DEVICE_PROD_ID1234( -- cgit v1.2.3 From 2fe22a8bba0c3a60db58dfdcaa200f8528c057e4 Mon Sep 17 00:00:00 2001 From: Jesse Allen Date: Mon, 20 Feb 2006 22:08:18 -0800 Subject: [PATCH] pcmcia: add id for AMB8110 PC Card The axnet_cs driver can support the AMB8110 PC Card, so add the id for it. In the old pcmcia-cs config file, this card is listed with the comment "not specific enough". The last entry in the axnet_ids has the same comment. They are disabled, and for good reason as it was originally identified by the MANFID, and that is shared with several cards that use both the pcnet_cs driver and axnet_cs driver. I tried my AMB8110 with pcnet_cs, and found that it works fine, and I cannot find a reason for either, except that the old config file recommended axnet_cs. Signed-off-by: Jesse Allen Cc: Jeff Garzik Signed-off-by: Andrew Morton Signed-off-by: Dominik Brodowski --- drivers/net/pcmcia/axnet_cs.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers') diff --git a/drivers/net/pcmcia/axnet_cs.c b/drivers/net/pcmcia/axnet_cs.c index 01ddfc8cce3f..aa5581369399 100644 --- a/drivers/net/pcmcia/axnet_cs.c +++ b/drivers/net/pcmcia/axnet_cs.c @@ -806,6 +806,7 @@ static struct pcmcia_device_id axnet_ids[] = { PCMCIA_DEVICE_MANF_CARD(0x026f, 0x0309), PCMCIA_DEVICE_MANF_CARD(0x0274, 0x1106), PCMCIA_DEVICE_MANF_CARD(0x8a01, 0xc1ab), + PCMCIA_DEVICE_PROD_ID12("AmbiCom,Inc.", "Fast Ethernet PC Card(AMB8110)", 0x49b020a7, 0x119cc9fc), PCMCIA_DEVICE_PROD_ID124("Fast Ethernet", "16-bit PC Card", "AX88190", 0xb4be14e3, 0x9a12eb6a, 0xab9be5ef), PCMCIA_DEVICE_PROD_ID12("ASIX", "AX88190", 0x0959823b, 0xab9be5ef), PCMCIA_DEVICE_PROD_ID12("Billionton", "LNA-100B", 0x552ab682, 0xbc3b87e1), -- cgit v1.2.3 From 67bc620006a30cf5dcbf409dbbd4fd93179ddfb1 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Tue, 14 Feb 2006 09:21:26 +0100 Subject: [PATCH] pcmcia: CM4000, CM4040 Driver fixes Using this patch, Omnikey CardMan 4000 and 4040 devices automatically get their device nodes created by udev. Also, we now check for (and handle) failure of pcmcia_register_driver() Signed-off-by: Harald Welte Signed-off-by: Dominik Brodowski --- drivers/char/pcmcia/cm4000_cs.c | 24 +++++++++++++++++++++--- drivers/char/pcmcia/cm4040_cs.c | 23 ++++++++++++++++++++--- 2 files changed, 41 insertions(+), 6 deletions(-) (limited to 'drivers') diff --git a/drivers/char/pcmcia/cm4000_cs.c b/drivers/char/pcmcia/cm4000_cs.c index 649677b5dc36..5fdf18515433 100644 --- a/drivers/char/pcmcia/cm4000_cs.c +++ b/drivers/char/pcmcia/cm4000_cs.c @@ -13,11 +13,12 @@ * * (C) 2000,2001,2002,2003,2004 Omnikey AG * - * (C) 2005 Harald Welte + * (C) 2005-2006 Harald Welte * - Adhere to Kernel CodingStyle * - Port to 2.6.13 "new" style PCMCIA * - Check for copy_{from,to}_user return values * - Use nonseekable_open() + * - add class interface for udev device creation * * All rights reserved. Licensed under dual BSD/GPL license. */ @@ -56,7 +57,7 @@ module_param(pc_debug, int, 0600); #else #define DEBUGP(n, rdr, x, args...) #endif -static char *version = "cm4000_cs.c v2.4.0gm5 - All bugs added by Harald Welte"; +static char *version = "cm4000_cs.c v2.4.0gm6 - All bugs added by Harald Welte"; #define T_1SEC (HZ) #define T_10MSEC msecs_to_jiffies(10) @@ -156,6 +157,7 @@ struct cm4000_dev { /*queue*/ 4*sizeof(wait_queue_head_t)) static dev_link_t *dev_table[CM4000_MAX_DEV]; +static struct class *cmm_class; /* This table doesn't use spaces after the comma between fields and thus * violates CodingStyle. However, I don't really think wrapping it around will @@ -1937,6 +1939,9 @@ static int cm4000_attach(struct pcmcia_device *p_dev) link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; cm4000_config(link, i); + class_device_create(cmm_class, NULL, MKDEV(major, i), NULL, + "cmm%d", i); + return 0; } @@ -1962,6 +1967,8 @@ static void cm4000_detach(struct pcmcia_device *p_dev) dev_table[devno] = NULL; kfree(dev); + class_device_destroy(cmm_class, MKDEV(major, devno)); + return; } @@ -1995,8 +2002,18 @@ static struct pcmcia_driver cm4000_driver = { static int __init cmm_init(void) { + int rc; + printk(KERN_INFO "%s\n", version); - pcmcia_register_driver(&cm4000_driver); + + cmm_class = class_create(THIS_MODULE, "cardman_4000"); + if (!cmm_class) + return -1; + + rc = pcmcia_register_driver(&cm4000_driver); + if (rc < 0) + return rc; + major = register_chrdev(0, DEVICE_NAME, &cm4000_fops); if (major < 0) { printk(KERN_WARNING MODULE_NAME @@ -2012,6 +2029,7 @@ static void __exit cmm_exit(void) printk(KERN_INFO MODULE_NAME ": unloading\n"); pcmcia_unregister_driver(&cm4000_driver); unregister_chrdev(major, DEVICE_NAME); + class_destroy(cmm_class); }; module_init(cmm_init); diff --git a/drivers/char/pcmcia/cm4040_cs.c b/drivers/char/pcmcia/cm4040_cs.c index 46eb371bf17e..466e33bab029 100644 --- a/drivers/char/pcmcia/cm4040_cs.c +++ b/drivers/char/pcmcia/cm4040_cs.c @@ -3,12 +3,13 @@ * * (c) 2000-2004 Omnikey AG (http://www.omnikey.com/) * - * (C) 2005 Harald Welte + * (C) 2005-2006 Harald Welte * - add support for poll() * - driver cleanup * - add waitqueues * - adhere to linux kernel coding style and policies * - support 2.6.13 "new style" pcmcia interface + * - add class interface for udev device creation * * The device basically is a USB CCID compliant device that has been * attached to an I/O-Mapped FIFO. @@ -53,7 +54,7 @@ module_param(pc_debug, int, 0600); #endif static char *version = -"OMNIKEY CardMan 4040 v1.1.0gm4 - All bugs added by Harald Welte"; +"OMNIKEY CardMan 4040 v1.1.0gm5 - All bugs added by Harald Welte"; #define CCID_DRIVER_BULK_DEFAULT_TIMEOUT (150*HZ) #define CCID_DRIVER_ASYNC_POWERUP_TIMEOUT (35*HZ) @@ -67,6 +68,7 @@ static char *version = static void reader_release(dev_link_t *link); static int major; +static struct class *cmx_class; #define BS_READABLE 0x01 #define BS_WRITABLE 0x02 @@ -696,6 +698,9 @@ static int reader_attach(struct pcmcia_device *p_dev) link->state |= DEV_PRESENT | DEV_CONFIG_PENDING; reader_config(link, i); + class_device_create(cmx_class, NULL, MKDEV(major, i), NULL, + "cmx%d", i); + return 0; } @@ -721,6 +726,8 @@ static void reader_detach(struct pcmcia_device *p_dev) dev_table[devno] = NULL; kfree(dev); + class_device_destroy(cmx_class, MKDEV(major, devno)); + return; } @@ -755,8 +762,17 @@ static struct pcmcia_driver reader_driver = { static int __init cm4040_init(void) { + int rc; + printk(KERN_INFO "%s\n", version); - pcmcia_register_driver(&reader_driver); + cmx_class = class_create(THIS_MODULE, "cardman_4040"); + if (!cmx_class) + return -1; + + rc = pcmcia_register_driver(&reader_driver); + if (rc < 0) + return rc; + major = register_chrdev(0, DEVICE_NAME, &reader_fops); if (major < 0) { printk(KERN_WARNING MODULE_NAME @@ -771,6 +787,7 @@ static void __exit cm4040_exit(void) printk(KERN_INFO MODULE_NAME ": unloading\n"); pcmcia_unregister_driver(&reader_driver); unregister_chrdev(major, DEVICE_NAME); + class_destroy(cmx_class); } module_init(cm4040_init); -- cgit v1.2.3 From 77a3313551afd53c90012e5a87f7f2b2195fc67e Mon Sep 17 00:00:00 2001 From: John Bowler Date: Thu, 2 Mar 2006 02:54:29 -0800 Subject: [PATCH] "drivers/mtd/redboot.c: recognise a foreign byte sex partition table" update Sync up the recent redboot fix with MTD CVS. It uses the correct swab() functions. Cc: John Bowler Cc: David Woodhouse Cc: Thomas Gleixner Cc: Martin Michlmayr Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/mtd/redboot.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'drivers') diff --git a/drivers/mtd/redboot.c b/drivers/mtd/redboot.c index d01b6a9198e0..8815c8dbef2d 100644 --- a/drivers/mtd/redboot.c +++ b/drivers/mtd/redboot.c @@ -1,5 +1,5 @@ /* - * $Id: redboot.c,v 1.18 2005/11/07 11:14:21 gleixner Exp $ + * $Id: redboot.c,v 1.19 2005/12/01 10:03:51 dwmw2 Exp $ * * Parse RedBoot-style Flash Image System (FIS) tables and * produce a Linux partition array to match. @@ -92,10 +92,10 @@ static int parse_redboot_partitions(struct mtd_info *master, if (!memcmp(buf[i].name, "FIS directory", 14)) { /* This is apparently the FIS directory entry for the * FIS directory itself. The FIS directory size is - * one erase block, if the buf[i].size field is + * one erase block; if the buf[i].size field is * swab32(erasesize) then we know we are looking at * a byte swapped FIS directory - swap all the entries! - * (NOTE: this is 'size' not 'data_length', size is + * (NOTE: this is 'size' not 'data_length'; size is * the full size of the entry.) */ if (swab32(buf[i].size) == master->erasesize) { @@ -104,15 +104,13 @@ static int parse_redboot_partitions(struct mtd_info *master, /* The unsigned long fields were written with the * wrong byte sex, name and pad have no byte sex. */ -# define do_swab32(x) (x) = swab32(x) - do_swab32(buf[j].flash_base); - do_swab32(buf[j].mem_base); - do_swab32(buf[j].size); - do_swab32(buf[j].entry_point); - do_swab32(buf[j].data_length); - do_swab32(buf[j].desc_cksum); - do_swab32(buf[j].file_cksum); -# undef do_swab32 + swab32s(&buf[j].flash_base); + swab32s(&buf[j].mem_base); + swab32s(&buf[j].size); + swab32s(&buf[j].entry_point); + swab32s(&buf[j].data_length); + swab32s(&buf[j].desc_cksum); + swab32s(&buf[j].file_cksum); } } break; -- cgit v1.2.3 From b55fafc5a800f27beedfdcf8bd1b6baa47e769a9 Mon Sep 17 00:00:00 2001 From: Benjamin Herrenschmidt Date: Fri, 3 Mar 2006 17:03:21 +1100 Subject: [PATCH] powerpc: Fix old g5 issues with windfarm Some of the windfarm sensor modules can initialize on old machines that don't have full windfarm support like non-dual core desktop G5s. Unfortunately, by doing so, they would trigger a bug in their matching algorithm causing them to attach to the wrong bus, thus triggering issues with the i2c core and breaking the thermal driver. This patch fixes the probing issue (so that they will work when a windfarm port is done to these machines) and also prevents for now windfarm to load at all on these machines that still use therm_pm72 to avoid wasting resources. Signed-off-by: Benjamin Herrenschmidt Signed-off-by: Paul Mackerras --- drivers/macintosh/windfarm_core.c | 7 +++++++ drivers/macintosh/windfarm_cpufreq_clamp.c | 8 ++++++++ drivers/macintosh/windfarm_lm75_sensor.c | 32 +++++++++++++++++++++-------- drivers/macintosh/windfarm_max6690_sensor.c | 25 +++++++++++++++------- drivers/macintosh/windfarm_pm112.c | 2 +- 5 files changed, 57 insertions(+), 17 deletions(-) (limited to 'drivers') diff --git a/drivers/macintosh/windfarm_core.c b/drivers/macintosh/windfarm_core.c index bb8d5efe19bf..6c0ba04bc57a 100644 --- a/drivers/macintosh/windfarm_core.c +++ b/drivers/macintosh/windfarm_core.c @@ -35,6 +35,8 @@ #include #include +#include + #include "windfarm.h" #define VERSION "0.2" @@ -465,6 +467,11 @@ static int __init windfarm_core_init(void) { DBG("wf: core loaded\n"); + /* Don't register on old machines that use therm_pm72 for now */ + if (machine_is_compatible("PowerMac7,2") || + machine_is_compatible("PowerMac7,3") || + machine_is_compatible("RackMac3,1")) + return -ENODEV; platform_device_register(&wf_platform_device); return 0; } diff --git a/drivers/macintosh/windfarm_cpufreq_clamp.c b/drivers/macintosh/windfarm_cpufreq_clamp.c index 607dbaca69c9..81337cd16e80 100644 --- a/drivers/macintosh/windfarm_cpufreq_clamp.c +++ b/drivers/macintosh/windfarm_cpufreq_clamp.c @@ -8,6 +8,8 @@ #include #include +#include + #include "windfarm.h" #define VERSION "0.3" @@ -74,6 +76,12 @@ static int __init wf_cpufreq_clamp_init(void) { struct wf_control *clamp; + /* Don't register on old machines that use therm_pm72 for now */ + if (machine_is_compatible("PowerMac7,2") || + machine_is_compatible("PowerMac7,3") || + machine_is_compatible("RackMac3,1")) + return -ENODEV; + clamp = kmalloc(sizeof(struct wf_control), GFP_KERNEL); if (clamp == NULL) return -ENOMEM; diff --git a/drivers/macintosh/windfarm_lm75_sensor.c b/drivers/macintosh/windfarm_lm75_sensor.c index 906d3ecae6e6..423bfa2432c0 100644 --- a/drivers/macintosh/windfarm_lm75_sensor.c +++ b/drivers/macintosh/windfarm_lm75_sensor.c @@ -25,7 +25,7 @@ #include "windfarm.h" -#define VERSION "0.1" +#define VERSION "0.2" #undef DEBUG @@ -113,6 +113,7 @@ static struct wf_lm75_sensor *wf_lm75_create(struct i2c_adapter *adapter, const char *loc) { struct wf_lm75_sensor *lm; + int rc; DBG("wf_lm75: creating %s device at address 0x%02x\n", ds1775 ? "ds1775" : "lm75", addr); @@ -139,9 +140,11 @@ static struct wf_lm75_sensor *wf_lm75_create(struct i2c_adapter *adapter, lm->i2c.driver = &wf_lm75_driver; strncpy(lm->i2c.name, lm->sens.name, I2C_NAME_SIZE-1); - if (i2c_attach_client(&lm->i2c)) { - printk(KERN_ERR "windfarm: failed to attach %s %s to i2c\n", - ds1775 ? "ds1775" : "lm75", lm->i2c.name); + rc = i2c_attach_client(&lm->i2c); + if (rc) { + printk(KERN_ERR "windfarm: failed to attach %s %s to i2c," + " err %d\n", ds1775 ? "ds1775" : "lm75", + lm->i2c.name, rc); goto fail; } @@ -175,16 +178,22 @@ static int wf_lm75_attach(struct i2c_adapter *adapter) (dev = of_get_next_child(busnode, dev)) != NULL;) { const char *loc = get_property(dev, "hwsensor-location", NULL); - u32 *reg = (u32 *)get_property(dev, "reg", NULL); - DBG(" dev: %s... (loc: %p, reg: %p)\n", dev->name, loc, reg); - if (loc == NULL || reg == NULL) + u8 addr; + + /* We must re-match the adapter in order to properly check + * the channel on multibus setups + */ + if (!pmac_i2c_match_adapter(dev, adapter)) + continue; + addr = pmac_i2c_get_dev_addr(dev); + if (loc == NULL || addr == 0) continue; /* real lm75 */ if (device_is_compatible(dev, "lm75")) - wf_lm75_create(adapter, *reg, 0, loc); + wf_lm75_create(adapter, addr, 0, loc); /* ds1775 (compatible, better resolution */ else if (device_is_compatible(dev, "ds1775")) - wf_lm75_create(adapter, *reg, 1, loc); + wf_lm75_create(adapter, addr, 1, loc); } return 0; } @@ -206,6 +215,11 @@ static int wf_lm75_detach(struct i2c_client *client) static int __init wf_lm75_sensor_init(void) { + /* Don't register on old machines that use therm_pm72 for now */ + if (machine_is_compatible("PowerMac7,2") || + machine_is_compatible("PowerMac7,3") || + machine_is_compatible("RackMac3,1")) + return -ENODEV; return i2c_add_driver(&wf_lm75_driver); } diff --git a/drivers/macintosh/windfarm_max6690_sensor.c b/drivers/macintosh/windfarm_max6690_sensor.c index 5b9ad6ca7cba..8e99d408fddd 100644 --- a/drivers/macintosh/windfarm_max6690_sensor.c +++ b/drivers/macintosh/windfarm_max6690_sensor.c @@ -17,7 +17,7 @@ #include "windfarm.h" -#define VERSION "0.1" +#define VERSION "0.2" /* This currently only exports the external temperature sensor, since that's all the control loops need. */ @@ -81,7 +81,7 @@ static struct wf_sensor_ops wf_max6690_ops = { static void wf_max6690_create(struct i2c_adapter *adapter, u8 addr) { struct wf_6690_sensor *max; - char *name = "u4-temp"; + char *name = "backside-temp"; max = kzalloc(sizeof(struct wf_6690_sensor), GFP_KERNEL); if (max == NULL) { @@ -118,7 +118,6 @@ static int wf_max6690_attach(struct i2c_adapter *adapter) struct device_node *busnode, *dev = NULL; struct pmac_i2c_bus *bus; const char *loc; - u32 *reg; bus = pmac_i2c_adapter_to_bus(adapter); if (bus == NULL) @@ -126,16 +125,23 @@ static int wf_max6690_attach(struct i2c_adapter *adapter) busnode = pmac_i2c_get_bus_node(bus); while ((dev = of_get_next_child(busnode, dev)) != NULL) { + u8 addr; + + /* We must re-match the adapter in order to properly check + * the channel on multibus setups + */ + if (!pmac_i2c_match_adapter(dev, adapter)) + continue; if (!device_is_compatible(dev, "max6690")) continue; + addr = pmac_i2c_get_dev_addr(dev); loc = get_property(dev, "hwsensor-location", NULL); - reg = (u32 *) get_property(dev, "reg", NULL); - if (!loc || !reg) + if (loc == NULL || addr == 0) continue; - printk("found max6690, loc=%s reg=%x\n", loc, *reg); + printk("found max6690, loc=%s addr=0x%02x\n", loc, addr); if (strcmp(loc, "BACKSIDE")) continue; - wf_max6690_create(adapter, *reg); + wf_max6690_create(adapter, addr); } return 0; @@ -153,6 +159,11 @@ static int wf_max6690_detach(struct i2c_client *client) static int __init wf_max6690_sensor_init(void) { + /* Don't register on old machines that use therm_pm72 for now */ + if (machine_is_compatible("PowerMac7,2") || + machine_is_compatible("PowerMac7,3") || + machine_is_compatible("RackMac3,1")) + return -ENODEV; return i2c_add_driver(&wf_max6690_driver); } diff --git a/drivers/macintosh/windfarm_pm112.c b/drivers/macintosh/windfarm_pm112.c index c2a4e689c784..17aec8e7476f 100644 --- a/drivers/macintosh/windfarm_pm112.c +++ b/drivers/macintosh/windfarm_pm112.c @@ -613,7 +613,7 @@ static void pm112_new_sensor(struct wf_sensor *sr) } else if (!strcmp(sr->name, "slots-power")) { if (slots_power == NULL && wf_get_sensor(sr) == 0) slots_power = sr; - } else if (!strcmp(sr->name, "u4-temp")) { + } else if (!strcmp(sr->name, "backside-temp")) { if (u4_temp == NULL && wf_get_sensor(sr) == 0) u4_temp = sr; } else -- cgit v1.2.3 From e2a002b9a731083c69add71b1f5014bac7dc1770 Mon Sep 17 00:00:00 2001 From: Benjamin Herrenschmidt Date: Fri, 3 Mar 2006 17:13:30 +1100 Subject: [PATCH] powerpc: Fix windfarm_pm112 not starting all control loops This adds a couple of printk's to windfarm_pm112 to display which control loops are actually starting and fixes a bug where it would not start all loops. Signed-off-by: Benjamin Herrenschmidt Signed-off-by: Paul Mackerras --- drivers/macintosh/windfarm_pm112.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/macintosh/windfarm_pm112.c b/drivers/macintosh/windfarm_pm112.c index 17aec8e7476f..ef66bf2778ec 100644 --- a/drivers/macintosh/windfarm_pm112.c +++ b/drivers/macintosh/windfarm_pm112.c @@ -358,6 +358,7 @@ static void backside_fan_tick(void) return; if (!backside_tick) { /* first time; initialize things */ + printk(KERN_INFO "windfarm: Backside control loop started.\n"); backside_param.min = backside_fan->ops->get_min(backside_fan); backside_param.max = backside_fan->ops->get_max(backside_fan); wf_pid_init(&backside_pid, &backside_param); @@ -407,6 +408,7 @@ static void drive_bay_fan_tick(void) return; if (!drive_bay_tick) { /* first time; initialize things */ + printk(KERN_INFO "windfarm: Drive bay control loop started.\n"); drive_bay_prm.min = drive_bay_fan->ops->get_min(drive_bay_fan); drive_bay_prm.max = drive_bay_fan->ops->get_max(drive_bay_fan); wf_pid_init(&drive_bay_pid, &drive_bay_prm); @@ -458,6 +460,7 @@ static void slots_fan_tick(void) return; if (!slots_started) { /* first time; initialize things */ + printk(KERN_INFO "windfarm: Slots control loop started.\n"); wf_pid_init(&slots_pid, &slots_param); slots_started = 1; } @@ -504,6 +507,7 @@ static void pm112_tick(void) if (!started) { started = 1; + printk(KERN_INFO "windfarm: CPUs control loops started.\n"); for (i = 0; i < nr_cores; ++i) { if (create_cpu_loop(i) < 0) { failure_state = FAILURE_PERM; @@ -594,8 +598,6 @@ static void pm112_new_sensor(struct wf_sensor *sr) { unsigned int i; - if (have_all_sensors) - return; if (!strncmp(sr->name, "cpu-temp-", 9)) { i = sr->name[9] - '0'; if (sr->name[10] == 0 && i < NR_CORES && -- cgit v1.2.3 From 805e660ca32ef63b81203a556f29fef262b95cc0 Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Mon, 27 Feb 2006 00:07:49 -0300 Subject: V4L/DVB (3337): Drivers/media/dvb/frontends/mt312.c: cleanups This patch contains the following possible cleanups: - update the Kconfig help to mention the VP310 - merge vp310_attach and mt312_attach into a new vp310_mt312_attach to remove some code duplication Signed-off-by: Adrian Bunk Signed-off-by: Michael Krufky Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/b2c2/flexcop-fe-tuner.c | 2 +- drivers/media/dvb/frontends/Kconfig | 2 +- drivers/media/dvb/frontends/mt312.c | 116 ++++++++++++------------------ drivers/media/dvb/frontends/mt312.h | 6 +- 4 files changed, 48 insertions(+), 78 deletions(-) (limited to 'drivers') diff --git a/drivers/media/dvb/b2c2/flexcop-fe-tuner.c b/drivers/media/dvb/b2c2/flexcop-fe-tuner.c index 390cc3a99ce6..9c7f122826e0 100644 --- a/drivers/media/dvb/b2c2/flexcop-fe-tuner.c +++ b/drivers/media/dvb/b2c2/flexcop-fe-tuner.c @@ -526,7 +526,7 @@ int flexcop_frontend_init(struct flexcop_device *fc) info("found the stv0297 at i2c address: 0x%02x",alps_tdee4_stv0297_config.demod_address); } else /* try the sky v2.3 (vp310/Samsung tbdu18132(tsa5059)) */ - if ((fc->fe = vp310_attach(&skystar23_samsung_tbdu18132_config, &fc->i2c_adap)) != NULL) { + if ((fc->fe = vp310_mt312_attach(&skystar23_samsung_tbdu18132_config, &fc->i2c_adap)) != NULL) { ops = fc->fe->ops; ops->diseqc_send_master_cmd = flexcop_diseqc_send_master_cmd; diff --git a/drivers/media/dvb/frontends/Kconfig b/drivers/media/dvb/frontends/Kconfig index 76b6a2aef32f..c676b1e23ab0 100644 --- a/drivers/media/dvb/frontends/Kconfig +++ b/drivers/media/dvb/frontends/Kconfig @@ -29,7 +29,7 @@ config DVB_TDA8083 A DVB-S tuner module. Say Y when you want to support this frontend. config DVB_MT312 - tristate "Zarlink MT312 based" + tristate "Zarlink VP310/MT312 based" depends on DVB_CORE help A DVB-S tuner module. Say Y when you want to support this frontend. diff --git a/drivers/media/dvb/frontends/mt312.c b/drivers/media/dvb/frontends/mt312.c index ec4e641acc64..d3aea83cf218 100644 --- a/drivers/media/dvb/frontends/mt312.c +++ b/drivers/media/dvb/frontends/mt312.c @@ -612,76 +612,6 @@ static void mt312_release(struct dvb_frontend* fe) kfree(state); } -static struct dvb_frontend_ops vp310_mt312_ops; - -struct dvb_frontend* vp310_attach(const struct mt312_config* config, - struct i2c_adapter* i2c) -{ - struct mt312_state* state = NULL; - - /* allocate memory for the internal state */ - state = kmalloc(sizeof(struct mt312_state), GFP_KERNEL); - if (state == NULL) - goto error; - - /* setup the state */ - state->config = config; - state->i2c = i2c; - memcpy(&state->ops, &vp310_mt312_ops, sizeof(struct dvb_frontend_ops)); - strcpy(state->ops.info.name, "Zarlink VP310 DVB-S"); - - /* check if the demod is there */ - if (mt312_readreg(state, ID, &state->id) < 0) - goto error; - if (state->id != ID_VP310) { - goto error; - } - - /* create dvb_frontend */ - state->frequency = 90; - state->frontend.ops = &state->ops; - state->frontend.demodulator_priv = state; - return &state->frontend; - -error: - kfree(state); - return NULL; -} - -struct dvb_frontend* mt312_attach(const struct mt312_config* config, - struct i2c_adapter* i2c) -{ - struct mt312_state* state = NULL; - - /* allocate memory for the internal state */ - state = kmalloc(sizeof(struct mt312_state), GFP_KERNEL); - if (state == NULL) - goto error; - - /* setup the state */ - state->config = config; - state->i2c = i2c; - memcpy(&state->ops, &vp310_mt312_ops, sizeof(struct dvb_frontend_ops)); - strcpy(state->ops.info.name, "Zarlink MT312 DVB-S"); - - /* check if the demod is there */ - if (mt312_readreg(state, ID, &state->id) < 0) - goto error; - if (state->id != ID_MT312) { - goto error; - } - - /* create dvb_frontend */ - state->frequency = 60; - state->frontend.ops = &state->ops; - state->frontend.demodulator_priv = state; - return &state->frontend; - -error: - kfree(state); - return NULL; -} - static struct dvb_frontend_ops vp310_mt312_ops = { .info = { @@ -720,6 +650,49 @@ static struct dvb_frontend_ops vp310_mt312_ops = { .set_voltage = mt312_set_voltage, }; +struct dvb_frontend* vp310_mt312_attach(const struct mt312_config* config, + struct i2c_adapter* i2c) +{ + struct mt312_state* state = NULL; + + /* allocate memory for the internal state */ + state = kmalloc(sizeof(struct mt312_state), GFP_KERNEL); + if (state == NULL) + goto error; + + /* setup the state */ + state->config = config; + state->i2c = i2c; + memcpy(&state->ops, &vp310_mt312_ops, sizeof(struct dvb_frontend_ops)); + + /* check if the demod is there */ + if (mt312_readreg(state, ID, &state->id) < 0) + goto error; + + switch (state->id) { + case ID_VP310: + strcpy(state->ops.info.name, "Zarlink VP310 DVB-S"); + state->frequency = 90; + break; + case ID_MT312: + strcpy(state->ops.info.name, "Zarlink MT312 DVB-S"); + state->frequency = 60; + break; + default: + printk (KERN_WARNING "Only Zarlink VP310/MT312 are supported chips.\n"); + goto error; + } + + /* create dvb_frontend */ + state->frontend.ops = &state->ops; + state->frontend.demodulator_priv = state; + return &state->frontend; + +error: + kfree(state); + return NULL; +} + module_param(debug, int, 0644); MODULE_PARM_DESC(debug, "Turn on/off frontend debugging (default:off)."); @@ -727,5 +700,4 @@ MODULE_DESCRIPTION("Zarlink VP310/MT312 DVB-S Demodulator driver"); MODULE_AUTHOR("Andreas Oberritter "); MODULE_LICENSE("GPL"); -EXPORT_SYMBOL(mt312_attach); -EXPORT_SYMBOL(vp310_attach); +EXPORT_SYMBOL(vp310_mt312_attach); diff --git a/drivers/media/dvb/frontends/mt312.h b/drivers/media/dvb/frontends/mt312.h index b3a53a73a117..074d844f0139 100644 --- a/drivers/media/dvb/frontends/mt312.h +++ b/drivers/media/dvb/frontends/mt312.h @@ -38,10 +38,8 @@ struct mt312_config int (*pll_set)(struct dvb_frontend* fe, struct dvb_frontend_parameters* params); }; -extern struct dvb_frontend* mt312_attach(const struct mt312_config* config, - struct i2c_adapter* i2c); +struct dvb_frontend* vp310_mt312_attach(const struct mt312_config* config, + struct i2c_adapter* i2c); -extern struct dvb_frontend* vp310_attach(const struct mt312_config* config, - struct i2c_adapter* i2c); #endif // MT312_H -- cgit v1.2.3 From 092734b4bb227faddf241b116af14357645d963c Mon Sep 17 00:00:00 2001 From: Manu Abraham Date: Mon, 27 Feb 2006 00:07:52 -0300 Subject: V4L/DVB (3340): Make a struct static Signed-off-by: Manu Abraham Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/bt8xx/bt878.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/media/dvb/bt8xx/bt878.c b/drivers/media/dvb/bt8xx/bt878.c index 34c3189a1a33..356f447ee2ab 100644 --- a/drivers/media/dvb/bt8xx/bt878.c +++ b/drivers/media/dvb/bt8xx/bt878.c @@ -382,7 +382,7 @@ bt878_device_control(struct bt878 *bt, unsigned int cmd, union dst_gpio_packet * EXPORT_SYMBOL(bt878_device_control); -struct cards card_list[] __devinitdata = { +static struct cards card_list[] __devinitdata = { { 0x01010071, BTTV_BOARD_NEBULA_DIGITV, "Nebula Electronics DigiTV" }, { 0x07611461, BTTV_BOARD_AVDVBT_761, "AverMedia AverTV DVB-T 761" }, -- cgit v1.2.3 From f95cdf261b3164c3e7f62551313be422483806c5 Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Mon, 27 Feb 2006 00:07:55 -0300 Subject: V4L/DVB (3341): Upstream sync - make 2 structs static Signed-off-by: Adrian Bunk Acked-by: Manu Abraham Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/bt8xx/dst.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/media/dvb/bt8xx/dst.c b/drivers/media/dvb/bt8xx/dst.c index 3a2ff1cc24b7..0310e3dd07e6 100644 --- a/drivers/media/dvb/bt8xx/dst.c +++ b/drivers/media/dvb/bt8xx/dst.c @@ -602,7 +602,7 @@ static int dst_type_print(u8 type) */ -struct dst_types dst_tlist[] = { +static struct dst_types dst_tlist[] = { { .device_id = "200103A", .offset = 0, -- cgit v1.2.3 From ca659a41373afc40de6276d24d8279bcd547e0a9 Mon Sep 17 00:00:00 2001 From: Karsten Suehring Date: Mon, 27 Feb 2006 00:08:08 -0300 Subject: V4L/DVB (3347): Pinnacle PCTV 40i: add filtered Composite2 input This patch adds another composite input to the Pinnacle PCTV 100i definition which filters the chrominace signal from the luma input. This improves video quality for Composite signals on the S-Video connector of the card. In addition the name string of the card is changed to include PCTV 40i and 50i since these cards are identical. Signed-off-by: Karsten Suehring Signed-off-by: Michael Krufky Signed-off-by: Mauro Carvalho Chehab --- Documentation/video4linux/CARDLIST.saa7134 | 2 +- drivers/media/video/saa7134/saa7134-cards.c | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/Documentation/video4linux/CARDLIST.saa7134 b/Documentation/video4linux/CARDLIST.saa7134 index 8a352597830f..9d48fb372875 100644 --- a/Documentation/video4linux/CARDLIST.saa7134 +++ b/Documentation/video4linux/CARDLIST.saa7134 @@ -75,7 +75,7 @@ 74 -> LifeView FlyTV Platinum Mini2 [14c0:1212] 75 -> AVerMedia AVerTVHD MCE A180 [1461:1044] 76 -> SKNet MonsterTV Mobile [1131:4ee9] - 77 -> Pinnacle PCTV 110i (saa7133) [11bd:002e] + 77 -> Pinnacle PCTV 40i/50i/110i (saa7133) [11bd:002e] 78 -> ASUSTeK P7131 Dual [1043:4862] 79 -> Sedna/MuchTV PC TV Cardbus TV/Radio (ITO25 Rev:2B) 80 -> ASUS Digimatrix TV [1043:0210] diff --git a/drivers/media/video/saa7134/saa7134-cards.c b/drivers/media/video/saa7134/saa7134-cards.c index 5a35d3b6550d..dcffd8cb960c 100644 --- a/drivers/media/video/saa7134/saa7134-cards.c +++ b/drivers/media/video/saa7134/saa7134-cards.c @@ -2392,7 +2392,7 @@ struct saa7134_board saa7134_boards[] = { }}, }, [SAA7134_BOARD_PINNACLE_PCTV_110i] = { - .name = "Pinnacle PCTV 110i (saa7133)", + .name = "Pinnacle PCTV 40i/50i/110i (saa7133)", .audio_clock = 0x00187de7, .tuner_type = TUNER_PHILIPS_TDA8290, .radio_type = UNSET, @@ -2407,6 +2407,10 @@ struct saa7134_board saa7134_boards[] = { },{ .name = name_comp1, .vmux = 1, + .amux = LINE2, + },{ + .name = name_comp2, + .vmux = 0, .amux = LINE2, },{ .name = name_svideo, -- cgit v1.2.3 From ede224159fa0a11f86e416f19729be701ae77e4f Mon Sep 17 00:00:00 2001 From: Ricardo Cerqueira Date: Mon, 27 Feb 2006 00:08:11 -0300 Subject: V4L/DVB (3348): Fixed saa7134 ALSA initialization with multiple cards When multiple cards were installed, only the first card would have audio initialized, because only the first position in the array parameter defaulted to "1" To make things worse, the "enable" parameter wasn't enabled, so there was no workaround. Signed-off-by: Ricardo Cerqueira Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/saa7134/saa7134-alsa.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/media/video/saa7134/saa7134-alsa.c b/drivers/media/video/saa7134/saa7134-alsa.c index a7a6ab9298a9..7df5e0826e12 100644 --- a/drivers/media/video/saa7134/saa7134-alsa.c +++ b/drivers/media/video/saa7134/saa7134-alsa.c @@ -54,10 +54,12 @@ MODULE_PARM_DESC(debug,"enable debug messages [alsa]"); static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; /* Index 0-MAX */ static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; /* ID for this card */ -static int enable[SNDRV_CARDS] = {1, [1 ... (SNDRV_CARDS - 1)] = 0}; +static int enable[SNDRV_CARDS] = {1, [1 ... (SNDRV_CARDS - 1)] = 1}; module_param_array(index, int, NULL, 0444); +module_param_array(enable, int, NULL, 0444); MODULE_PARM_DESC(index, "Index value for SAA7134 capture interface(s)."); +MODULE_PARM_DESC(enable, "Enable (or not) the SAA7134 capture interface(s)."); #define dprintk(fmt, arg...) if (debug) \ printk(KERN_DEBUG "%s/alsa: " fmt, dev->name , ##arg) -- cgit v1.2.3 From 27b547c3a956ec0c04109d150caa5feaee8d80f9 Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Mon, 27 Feb 2006 00:08:17 -0300 Subject: V4L/DVB (3352): Cxusb: fix lgdt3303 naming The following are specific to lgdt3303, and are being renamed to reflect this. - cxusb_lgdt330x_config renamed to cxusb_lgdt3303_config. - cxusb_lgdt330x_frontend_attach renamed to cxusb_lgdt3303_frontend_attach. Signed-off-by: Michael Krufky Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/dvb-usb/cxusb.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers') diff --git a/drivers/media/dvb/dvb-usb/cxusb.c b/drivers/media/dvb/dvb-usb/cxusb.c index f327fac1688e..162f9795cd89 100644 --- a/drivers/media/dvb/dvb-usb/cxusb.c +++ b/drivers/media/dvb/dvb-usb/cxusb.c @@ -282,7 +282,7 @@ static struct cx22702_config cxusb_cx22702_config = { .pll_set = dvb_usb_pll_set_i2c, }; -static struct lgdt330x_config cxusb_lgdt330x_config = { +static struct lgdt330x_config cxusb_lgdt3303_config = { .demod_address = 0x0e, .demod_chip = LGDT3303, .pll_set = dvb_usb_pll_set_i2c, @@ -357,14 +357,14 @@ static int cxusb_cx22702_frontend_attach(struct dvb_usb_device *d) return -EIO; } -static int cxusb_lgdt330x_frontend_attach(struct dvb_usb_device *d) +static int cxusb_lgdt3303_frontend_attach(struct dvb_usb_device *d) { if (usb_set_interface(d->udev,0,7) < 0) err("set interface failed"); cxusb_ctrl_msg(d,CMD_DIGITAL, NULL, 0, NULL, 0); - if ((d->fe = lgdt330x_attach(&cxusb_lgdt330x_config, &d->i2c_adap)) != NULL) + if ((d->fe = lgdt330x_attach(&cxusb_lgdt3303_config, &d->i2c_adap)) != NULL) return 0; return -EIO; @@ -506,7 +506,7 @@ static struct dvb_usb_properties cxusb_bluebird_lgh064f_properties = { .streaming_ctrl = cxusb_streaming_ctrl, .power_ctrl = cxusb_power_ctrl, - .frontend_attach = cxusb_lgdt330x_frontend_attach, + .frontend_attach = cxusb_lgdt3303_frontend_attach, .tuner_attach = cxusb_lgh064f_tuner_attach, .i2c_algo = &cxusb_i2c_algo, -- cgit v1.2.3 From 2175771e154d9faf404b2631be39bf7bd36a035e Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Mon, 27 Feb 2006 00:08:20 -0300 Subject: V4L/DVB (3354): Fix maximum for the saturation and contrast controls. Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/cx25840/cx25840-core.c | 4 ++-- drivers/media/video/saa7115.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers') diff --git a/drivers/media/video/cx25840/cx25840-core.c b/drivers/media/video/cx25840/cx25840-core.c index 08ffd1f325fc..5588b9a5c430 100644 --- a/drivers/media/video/cx25840/cx25840-core.c +++ b/drivers/media/video/cx25840/cx25840-core.c @@ -567,7 +567,7 @@ static struct v4l2_queryctrl cx25840_qctrl[] = { .type = V4L2_CTRL_TYPE_INTEGER, .name = "Contrast", .minimum = 0, - .maximum = 255, + .maximum = 127, .step = 1, .default_value = 64, .flags = 0, @@ -576,7 +576,7 @@ static struct v4l2_queryctrl cx25840_qctrl[] = { .type = V4L2_CTRL_TYPE_INTEGER, .name = "Saturation", .minimum = 0, - .maximum = 255, + .maximum = 127, .step = 1, .default_value = 64, .flags = 0, diff --git a/drivers/media/video/saa7115.c b/drivers/media/video/saa7115.c index 048d000941c7..ffd87ce55556 100644 --- a/drivers/media/video/saa7115.c +++ b/drivers/media/video/saa7115.c @@ -1027,7 +1027,7 @@ static struct v4l2_queryctrl saa7115_qctrl[] = { .type = V4L2_CTRL_TYPE_INTEGER, .name = "Contrast", .minimum = 0, - .maximum = 255, + .maximum = 127, .step = 1, .default_value = 64, .flags = 0, @@ -1036,7 +1036,7 @@ static struct v4l2_queryctrl saa7115_qctrl[] = { .type = V4L2_CTRL_TYPE_INTEGER, .name = "Saturation", .minimum = 0, - .maximum = 255, + .maximum = 127, .step = 1, .default_value = 64, .flags = 0, -- cgit v1.2.3 From 14c255b2b26338fd5cafe62508ba0f0ba798951e Mon Sep 17 00:00:00 2001 From: Hartmut Hackmann Date: Mon, 27 Feb 2006 00:09:11 -0300 Subject: V4L/DVB (3378): Restore power on defaults of tda9887 after tda8290 probe The probing code for tda8290 changes the state of the tda9887 GP ports. The patch assumes that if probing for tda8290 failed, this must be a tda9887 and restores its power on defaults. This should solve the module load order issue with some pinnacle cards. Signed-off-by: Hartmut Hackmann Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/saa7134/saa7134-cards.c | 4 ++-- drivers/media/video/tda8290.c | 8 +++++--- 2 files changed, 7 insertions(+), 5 deletions(-) (limited to 'drivers') diff --git a/drivers/media/video/saa7134/saa7134-cards.c b/drivers/media/video/saa7134/saa7134-cards.c index dcffd8cb960c..cd3788000ff4 100644 --- a/drivers/media/video/saa7134/saa7134-cards.c +++ b/drivers/media/video/saa7134/saa7134-cards.c @@ -2187,7 +2187,7 @@ struct saa7134_board saa7134_boards[] = { .radio_type = UNSET, .tuner_addr = 0x61, .radio_addr = ADDR_UNSET, - .tda9887_conf = TDA9887_PRESENT, + .tda9887_conf = TDA9887_PRESENT | TDA9887_PORT1_ACTIVE, .mpeg = SAA7134_MPEG_DVB, .inputs = {{ .name = name_tv, @@ -2211,7 +2211,7 @@ struct saa7134_board saa7134_boards[] = { .radio_type = UNSET, .tuner_addr = 0x61, .radio_addr = ADDR_UNSET, - .tda9887_conf = TDA9887_PRESENT, + .tda9887_conf = TDA9887_PRESENT | TDA9887_PORT1_ACTIVE, .mpeg = SAA7134_MPEG_DVB, .inputs = {{ .name = name_tv, diff --git a/drivers/media/video/tda8290.c b/drivers/media/video/tda8290.c index 7b4fb282ac82..a796a4e1917c 100644 --- a/drivers/media/video/tda8290.c +++ b/drivers/media/video/tda8290.c @@ -580,9 +580,10 @@ int tda8290_init(struct i2c_client *c) int tda8290_probe(struct i2c_client *c) { - unsigned char soft_reset[] = { 0x00, 0x00 }; - unsigned char easy_mode_b[] = { 0x01, 0x02 }; - unsigned char easy_mode_g[] = { 0x01, 0x04 }; + unsigned char soft_reset[] = { 0x00, 0x00 }; + unsigned char easy_mode_b[] = { 0x01, 0x02 }; + unsigned char easy_mode_g[] = { 0x01, 0x04 }; + unsigned char restore_9886[] = { 0x00, 0xd6, 0x30 }; unsigned char addr_dto_lsb = 0x07; unsigned char data; @@ -599,6 +600,7 @@ int tda8290_probe(struct i2c_client *c) return 0; } } + i2c_master_send(c, restore_9886, 3); return -1; } -- cgit v1.2.3 From 11dc3ffa3b53ba5bfdcc558d7bcd14d67ed0954b Mon Sep 17 00:00:00 2001 From: Johannes Stezenbach Date: Mon, 27 Feb 2006 00:09:20 -0300 Subject: V4L/DVB (3385): Dvb: fix __init/__exit section references in av7110 driver use __devinit/__devexit/__devexit_p() where appropriate Signed-off-by: Johannes Stezenbach Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/ttpci/av7110.c | 7 ++++--- drivers/media/dvb/ttpci/av7110_ir.c | 4 ++-- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'drivers') diff --git a/drivers/media/dvb/ttpci/av7110.c b/drivers/media/dvb/ttpci/av7110.c index d36369e9e88f..cdf7b2c33ad0 100644 --- a/drivers/media/dvb/ttpci/av7110.c +++ b/drivers/media/dvb/ttpci/av7110.c @@ -2477,7 +2477,8 @@ static int frontend_init(struct av7110 *av7110) * The same behaviour of missing VSYNC can be duplicated on budget * cards, by seting DD1_INIT trigger mode 7 in 3rd nibble. */ -static int av7110_attach(struct saa7146_dev* dev, struct saa7146_pci_extension_data *pci_ext) +static int __devinit av7110_attach(struct saa7146_dev* dev, + struct saa7146_pci_extension_data *pci_ext) { const int length = TS_WIDTH * TS_HEIGHT; struct pci_dev *pdev = dev->pci; @@ -2827,7 +2828,7 @@ err_kfree_0: goto out; } -static int av7110_detach(struct saa7146_dev* saa) +static int __devexit av7110_detach(struct saa7146_dev* saa) { struct av7110 *av7110 = saa->ext_priv; dprintk(4, "%p\n", av7110); @@ -2974,7 +2975,7 @@ static struct saa7146_extension av7110_extension = { .module = THIS_MODULE, .pci_tbl = &pci_tbl[0], .attach = av7110_attach, - .detach = av7110_detach, + .detach = __devexit_p(av7110_detach), .irq_mask = MASK_19 | MASK_03 | MASK_10, .irq_func = av7110_irq, diff --git a/drivers/media/dvb/ttpci/av7110_ir.c b/drivers/media/dvb/ttpci/av7110_ir.c index 617e4f6c0ed7..d54bbcdde2cc 100644 --- a/drivers/media/dvb/ttpci/av7110_ir.c +++ b/drivers/media/dvb/ttpci/av7110_ir.c @@ -208,7 +208,7 @@ static void ir_handler(struct av7110 *av7110, u32 ircom) } -int __init av7110_ir_init(struct av7110 *av7110) +int __devinit av7110_ir_init(struct av7110 *av7110) { static struct proc_dir_entry *e; @@ -248,7 +248,7 @@ int __init av7110_ir_init(struct av7110 *av7110) } -void __exit av7110_ir_exit(struct av7110 *av7110) +void __devexit av7110_ir_exit(struct av7110 *av7110) { int i; -- cgit v1.2.3 From 69ca1897317b1fbe73122a5a3bb7d783b2883d88 Mon Sep 17 00:00:00 2001 From: Mattias Nordstrom Date: Mon, 27 Feb 2006 00:09:17 -0300 Subject: V4L/DVB (3382): Fix stv0297 for qam128 on tt c1500 (saa7146) I have a TT C1500 card (saa7146, STV0297) which had problems tuning channels at QAM128 (like the ones in the Finnish HTV / Welho network). A fix which seems to work perfectly so far is to change the delay for QAM128 to the same values as for QAM256 in stv0297_set_frontend(), Signed-off-by: Mattias Nordstrom Signed-off-by: Michael Krufky Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/frontends/stv0297.c | 4 ---- 1 file changed, 4 deletions(-) (limited to 'drivers') diff --git a/drivers/media/dvb/frontends/stv0297.c b/drivers/media/dvb/frontends/stv0297.c index 6122ba754bc5..eb15676d374f 100644 --- a/drivers/media/dvb/frontends/stv0297.c +++ b/drivers/media/dvb/frontends/stv0297.c @@ -393,10 +393,6 @@ static int stv0297_set_frontend(struct dvb_frontend *fe, struct dvb_frontend_par break; case QAM_128: - delay = 150; - sweeprate = 1000; - break; - case QAM_256: delay = 200; sweeprate = 500; -- cgit v1.2.3 From 6ba54abe627577270a9baeb1d984bf84fba8b2e7 Mon Sep 17 00:00:00 2001 From: Michael Krufky Date: Mon, 27 Feb 2006 15:22:49 -0300 Subject: V4L/DVB (3399): ELSA EX-VISION 500TV: fix incorrect PCI subsystem ID - ELSA EX-VISION 500TV was incorrectly programmed to have the same subsystem ID as ELSA EX-VISION 300TV, (1048:226b) - This changeset replaces the incorrect subsystem ID (1048:226b) with the correct one (1048:226a) for the ELSA EX-VISION 500TV. Signed-off-by: Michael Krufky Signed-off-by: Mauro Carvalho Chehab --- Documentation/video4linux/CARDLIST.saa7134 | 2 +- drivers/media/video/saa7134/saa7134-cards.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/Documentation/video4linux/CARDLIST.saa7134 b/Documentation/video4linux/CARDLIST.saa7134 index 9d48fb372875..da4fb890165f 100644 --- a/Documentation/video4linux/CARDLIST.saa7134 +++ b/Documentation/video4linux/CARDLIST.saa7134 @@ -13,7 +13,7 @@ 12 -> Medion 7134 [16be:0003] 13 -> Typhoon TV+Radio 90031 14 -> ELSA EX-VISION 300TV [1048:226b] - 15 -> ELSA EX-VISION 500TV [1048:226b] + 15 -> ELSA EX-VISION 500TV [1048:226a] 16 -> ASUS TV-FM 7134 [1043:4842,1043:4830,1043:4840] 17 -> AOPEN VA1000 POWER [1131:7133] 18 -> BMK MPEX No Tuner diff --git a/drivers/media/video/saa7134/saa7134-cards.c b/drivers/media/video/saa7134/saa7134-cards.c index cd3788000ff4..479b01026717 100644 --- a/drivers/media/video/saa7134/saa7134-cards.c +++ b/drivers/media/video/saa7134/saa7134-cards.c @@ -2749,7 +2749,7 @@ struct pci_device_id saa7134_pci_tbl[] = { .vendor = PCI_VENDOR_ID_PHILIPS, .device = PCI_DEVICE_ID_PHILIPS_SAA7130, .subvendor = 0x1048, - .subdevice = 0x226b, + .subdevice = 0x226a, .driver_data = SAA7134_BOARD_ELSA_500TV, },{ .vendor = PCI_VENDOR_ID_PHILIPS, -- cgit v1.2.3 From be6f655d03d2e166134da2ea3c9360c4fe008744 Mon Sep 17 00:00:00 2001 From: Hartmut Hackmann Date: Fri, 3 Mar 2006 12:09:26 -0300 Subject: V4L/DVB (3395): Fixed Pinnacle 300i DVB-T support - fixed tda9886 port 2 setting - turned remote control receiver off via saa7134 GPIO to avoid i2c hangs - modified tda9886 client calls to direct i2c access to allow proper return to analog mode - allow mode change to V4L2_TUNER_DIGITAL_TV in tuner VIDIOC_S_FREQUENCY client call Signed-off-by: Hartmut Hackmann Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/saa7134/saa7134-cards.c | 9 +++++++-- drivers/media/video/saa7134/saa7134-dvb.c | 12 ++++++++---- drivers/media/video/tuner-core.c | 5 +++-- 3 files changed, 18 insertions(+), 8 deletions(-) (limited to 'drivers') diff --git a/drivers/media/video/saa7134/saa7134-cards.c b/drivers/media/video/saa7134/saa7134-cards.c index 479b01026717..6bc63a4086c1 100644 --- a/drivers/media/video/saa7134/saa7134-cards.c +++ b/drivers/media/video/saa7134/saa7134-cards.c @@ -977,7 +977,7 @@ struct saa7134_board saa7134_boards[] = { .radio_type = UNSET, .tuner_addr = ADDR_UNSET, .radio_addr = ADDR_UNSET, - .tda9887_conf = TDA9887_PRESENT | TDA9887_INTERCARRIER | TDA9887_PORT2_ACTIVE, + .tda9887_conf = TDA9887_PRESENT | TDA9887_INTERCARRIER | TDA9887_PORT2_INACTIVE, .inputs = {{ .name = name_tv, .vmux = 3, @@ -1666,7 +1666,7 @@ struct saa7134_board saa7134_boards[] = { .radio_type = UNSET, .tuner_addr = ADDR_UNSET, .radio_addr = ADDR_UNSET, - .tda9887_conf = TDA9887_PRESENT | TDA9887_INTERCARRIER | TDA9887_PORT2_ACTIVE, + .tda9887_conf = TDA9887_PRESENT | TDA9887_INTERCARRIER | TDA9887_PORT2_INACTIVE, .mpeg = SAA7134_MPEG_DVB, .inputs = {{ .name = name_tv, @@ -3205,6 +3205,11 @@ int saa7134_board_init1(struct saa7134_dev *dev) /* power-up tuner chip */ saa_andorl(SAA7134_GPIO_GPMODE0 >> 2, 0x00040000, 0x00040000); saa_andorl(SAA7134_GPIO_GPSTATUS0 >> 2, 0x00040000, 0x00000000); + case SAA7134_BOARD_PINNACLE_300I_DVBT_PAL: + /* this turns the remote control chip off to work around a bug in it */ + saa_writeb(SAA7134_GPIO_GPMODE1, 0x80); + saa_writeb(SAA7134_GPIO_GPSTATUS1, 0x80); + break; case SAA7134_BOARD_MONSTERTV_MOBILE: /* power-up tuner chip */ saa_andorl(SAA7134_GPIO_GPMODE0 >> 2, 0x00040000, 0x00040000); diff --git a/drivers/media/video/saa7134/saa7134-dvb.c b/drivers/media/video/saa7134/saa7134-dvb.c index 1a536e865277..9db8e13f21c3 100644 --- a/drivers/media/video/saa7134/saa7134-dvb.c +++ b/drivers/media/video/saa7134/saa7134-dvb.c @@ -110,6 +110,7 @@ static int mt352_pinnacle_init(struct dvb_frontend* fe) mt352_write(fe, fsm_ctl_cfg, sizeof(fsm_ctl_cfg)); mt352_write(fe, scan_ctl_cfg, sizeof(scan_ctl_cfg)); mt352_write(fe, irq_cfg, sizeof(irq_cfg)); + return 0; } @@ -117,8 +118,10 @@ static int mt352_pinnacle_pll_set(struct dvb_frontend* fe, struct dvb_frontend_parameters* params, u8* pllbuf) { - static int on = TDA9887_PRESENT | TDA9887_PORT2_INACTIVE; - static int off = TDA9887_PRESENT | TDA9887_PORT2_ACTIVE; + u8 off[] = { 0x00, 0xf1}; + u8 on[] = { 0x00, 0x71}; + struct i2c_msg msg = {.addr=0x43, .flags=0, .buf=off, .len = sizeof(off)}; + struct saa7134_dev *dev = fe->dvb->priv; struct v4l2_frequency f; @@ -126,9 +129,10 @@ static int mt352_pinnacle_pll_set(struct dvb_frontend* fe, f.tuner = 0; f.type = V4L2_TUNER_DIGITAL_TV; f.frequency = params->frequency / 1000 * 16 / 1000; - saa7134_i2c_call_clients(dev,TDA9887_SET_CONFIG,&on); + i2c_transfer(&dev->i2c_adap, &msg, 1); saa7134_i2c_call_clients(dev,VIDIOC_S_FREQUENCY,&f); - saa7134_i2c_call_clients(dev,TDA9887_SET_CONFIG,&off); + msg.buf = on; + i2c_transfer(&dev->i2c_adap, &msg, 1); pinnacle_antenna_pwr(dev, antenna_pwr); diff --git a/drivers/media/video/tuner-core.c b/drivers/media/video/tuner-core.c index e7ee619d62c5..b6101bf446d4 100644 --- a/drivers/media/video/tuner-core.c +++ b/drivers/media/video/tuner-core.c @@ -713,8 +713,9 @@ static int tuner_command(struct i2c_client *client, unsigned int cmd, void *arg) struct v4l2_frequency *f = arg; switch_v4l2(); - if (V4L2_TUNER_RADIO == f->type && - V4L2_TUNER_RADIO != t->mode) { + if ((V4L2_TUNER_RADIO == f->type && V4L2_TUNER_RADIO != t->mode) + || (V4L2_TUNER_DIGITAL_TV == f->type + && V4L2_TUNER_DIGITAL_TV != t->mode)) { if (set_mode (client, t, f->type, "VIDIOC_S_FREQUENCY") == EINVAL) return 0; -- cgit v1.2.3 From 1285b3a0b0aa2391ac6f6939e6737203c8220f68 Mon Sep 17 00:00:00 2001 From: Roland Dreier Date: Fri, 3 Mar 2006 15:47:25 -0800 Subject: IB/srp: Don't send task management commands after target removal Just fail abort and reset requests that come in after we've already decided to remove a target. Signed-off-by: Roland Dreier --- drivers/infiniband/ulp/srp/ib_srp.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'drivers') diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index 2d2d4ac3525a..960dae5c87d1 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c @@ -1155,6 +1155,12 @@ static int srp_send_tsk_mgmt(struct scsi_cmnd *scmnd, u8 func) spin_lock_irq(target->scsi_host->host_lock); + if (target->state == SRP_TARGET_DEAD || + target->state == SRP_TARGET_REMOVED) { + scmnd->result = DID_BAD_TARGET << 16; + goto out; + } + if (scmnd->host_scribble == (void *) -1L) goto out; -- cgit v1.2.3 From 28e02bac9c943ed85a29b41ccb9bf95641b2e263 Mon Sep 17 00:00:00 2001 From: Mark Brown Date: Fri, 3 Mar 2006 21:05:58 -0500 Subject: [PATCH] Add missing ifdef for VIA RNG code Almost all the code for the VIA RNG is guarded with __i386__ #ifdefs, the only exception being the enumeration of RNG types which is used to index into the rng_vector ops array. This patch adds an ifdef around that for consistency and since the guard makes a difference when adding new RNG types on non-i386 hardware. Signed-Off-By: Mark Brown Signed-Off-By: Jeff Garzik --- drivers/char/hw_random.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers') diff --git a/drivers/char/hw_random.c b/drivers/char/hw_random.c index b3bc2e37e616..29dc87e59020 100644 --- a/drivers/char/hw_random.c +++ b/drivers/char/hw_random.c @@ -131,7 +131,9 @@ enum { rng_hw_none, rng_hw_intel, rng_hw_amd, +#ifdef __i386__ rng_hw_via, +#endif rng_hw_geode, }; -- cgit v1.2.3 From a7a80d5ad3735554338199b9d976dfda5c10d3c7 Mon Sep 17 00:00:00 2001 From: Jeff Garzik Date: Sat, 4 Mar 2006 12:06:51 -0500 Subject: s2io: set_multicast_list bug The mac_addr variable doesn't get reset between (re)additions of multicast addresses. One byte of all multicast addresses (except the first) can be incorrect. Signed-off-by: Arthur Kepner Signed-off-by: Jeff Garzik --- drivers/net/s2io.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers') diff --git a/drivers/net/s2io.c b/drivers/net/s2io.c index 49b597cbc19a..b7f00d6eb6a6 100644 --- a/drivers/net/s2io.c +++ b/drivers/net/s2io.c @@ -4092,6 +4092,7 @@ static void s2io_set_multicast(struct net_device *dev) i++, mclist = mclist->next) { memcpy(sp->usr_addrs[i].addr, mclist->dmi_addr, ETH_ALEN); + mac_addr = 0; for (j = 0; j < ETH_ALEN; j++) { mac_addr |= mclist->dmi_addr[j]; mac_addr <<= 8; -- cgit v1.2.3 From b256f9df4a7da248263ed95c2517ddb714f9ca95 Mon Sep 17 00:00:00 2001 From: Martin Michlmayr Date: Sat, 4 Mar 2006 23:01:13 +0000 Subject: [MMC] au1xmmc: Fix compilation error by using platform_driver MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit drivers/mmc/au1xmmc.c currently doesn't compile; it needs to be converted to use platform_driver. I cannot test this change because of lack of hardware but I followed the drivers this one is based on, and the code is certainly not worse than before. drivers/mmc/au1xmmc.c: At top level: drivers/mmc/au1xmmc.c:1002: error: ‘platform_bus_type’ undeclared here (not in a function) make[2]: *** [drivers/mmc/au1xmmc.o] Error 1 Signed-off-by: Martin Michlmayr Acked-by: Jordan Crouse Signed-off-by: Russell King --- drivers/mmc/au1xmmc.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'drivers') diff --git a/drivers/mmc/au1xmmc.c b/drivers/mmc/au1xmmc.c index 227c39a7c1b4..15e12be6bef1 100644 --- a/drivers/mmc/au1xmmc.c +++ b/drivers/mmc/au1xmmc.c @@ -37,7 +37,7 @@ #include #include #include -#include +#include #include #include #include @@ -887,7 +887,7 @@ struct mmc_host_ops au1xmmc_ops = { .set_ios = au1xmmc_set_ios, }; -static int au1xmmc_probe(struct device *dev) +static int __devinit au1xmmc_probe(struct platform_device *pdev) { int i, ret = 0; @@ -904,7 +904,7 @@ static int au1xmmc_probe(struct device *dev) disable_irq(AU1100_SD_IRQ); for(i = 0; i < AU1XMMC_CONTROLLER_COUNT; i++) { - struct mmc_host *mmc = mmc_alloc_host(sizeof(struct au1xmmc_host), dev); + struct mmc_host *mmc = mmc_alloc_host(sizeof(struct au1xmmc_host), &pdev->dev); struct au1xmmc_host *host = 0; if (!mmc) { @@ -967,7 +967,7 @@ static int au1xmmc_probe(struct device *dev) return 0; } -static int au1xmmc_remove(struct device *dev) +static int __devexit au1xmmc_remove(struct platform_device *pdev) { int i; @@ -997,23 +997,24 @@ static int au1xmmc_remove(struct device *dev) return 0; } -static struct device_driver au1xmmc_driver = { - .name = DRIVER_NAME, - .bus = &platform_bus_type, +static struct platform_driver au1xmmc_driver = { .probe = au1xmmc_probe, .remove = au1xmmc_remove, .suspend = NULL, - .resume = NULL + .resume = NULL, + .driver = { + .name = DRIVER_NAME, + }, }; static int __init au1xmmc_init(void) { - return driver_register(&au1xmmc_driver); + return platform_driver_register(&au1xmmc_driver); } static void __exit au1xmmc_exit(void) { - driver_unregister(&au1xmmc_driver); + platform_driver_unregister(&au1xmmc_driver); } module_init(au1xmmc_init); -- cgit v1.2.3 From e142c24cf8f471c2a6cb95a4a26923d9621770ff Mon Sep 17 00:00:00 2001 From: Martin Michlmayr Date: Sat, 4 Mar 2006 23:01:39 +0000 Subject: [MMC] au1xmmc: Fix linking error because mmc_rsp_type doesn't exist MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit drivers/mmc/au1xmmc.c doesn't compile because commit e92251762d02a46177d4105d1744041e3f8bc465 introduced a typo and passes the wrong argument to the mmc_resp_type macro. Error because of the typo: CC drivers/mmc/au1xmmc.o drivers/mmc/au1xmmc.c: In function ‘au1xmmc_send_command’: drivers/mmc/au1xmmc.c:197: warning: implicit declaration of function ‘mmc_rsp_type’ ... LD .tmp_vmlinux1 drivers/built-in.o: In function `au1xmmc_request':au1xmmc.c:(.text+0x89504): undefined reference to `mmc_rsp_type' :au1xmmc.c:(.text+0x8968c): undefined reference to `mmc_rsp_type' make: *** [.tmp_vmlinux1] Error 1 Error because of the wrong argument: CC drivers/mmc/au1xmmc.o drivers/mmc/au1xmmc.c: In function ‘au1xmmc_send_command’: drivers/mmc/au1xmmc.c:197: error: invalid type argument of ‘->’ Signed-off-by: Martin Michlmayr Acked-by: Jordan Crouse Signed-off-by: Russell King --- drivers/mmc/au1xmmc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/mmc/au1xmmc.c b/drivers/mmc/au1xmmc.c index 15e12be6bef1..4e1c61ae536c 100644 --- a/drivers/mmc/au1xmmc.c +++ b/drivers/mmc/au1xmmc.c @@ -194,7 +194,7 @@ static int au1xmmc_send_command(struct au1xmmc_host *host, int wait, u32 mmccmd = (cmd->opcode << SD_CMD_CI_SHIFT); - switch (mmc_rsp_type(cmd->flags)) { + switch (mmc_resp_type(cmd)) { case MMC_RSP_R1: mmccmd |= SD_CMD_RT_1; break; -- cgit v1.2.3 From 732b82886017e9ceccb27c8b69e9210d5305088a Mon Sep 17 00:00:00 2001 From: Martin Michlmayr Date: Sat, 4 Mar 2006 23:02:10 +0000 Subject: [MMC] au1xmmc: Fix a compilation warning ('status' is not used) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fix a trivial compilation warning: CC drivers/mmc/au1xmmc.o drivers/mmc/au1xmmc.c: In function ‘au1xmmc_dma_callback’: drivers/mmc/au1xmmc.c:743: warning: unused variable ‘status’ Signed-off-by: Martin Michlmayr Acked-by: Martin Michlmayr Signed-off-by: Russell King --- drivers/mmc/au1xmmc.c | 1 - 1 file changed, 1 deletion(-) (limited to 'drivers') diff --git a/drivers/mmc/au1xmmc.c b/drivers/mmc/au1xmmc.c index 4e1c61ae536c..8d84b045bc83 100644 --- a/drivers/mmc/au1xmmc.c +++ b/drivers/mmc/au1xmmc.c @@ -740,7 +740,6 @@ static void au1xmmc_set_ios(struct mmc_host* mmc, struct mmc_ios* ios) static void au1xmmc_dma_callback(int irq, void *dev_id, struct pt_regs *regs) { struct au1xmmc_host *host = (struct au1xmmc_host *) dev_id; - u32 status; /* Avoid spurious interrupts */ -- cgit v1.2.3 From c027f5f995d8b6efc934be384085e3e8425638e4 Mon Sep 17 00:00:00 2001 From: Sam Ravnborg Date: Fri, 3 Mar 2006 17:50:37 -0800 Subject: [ATM]: [fore200e] fix section mismatch warnings Signed-off-by: Sam Ravnborg Signed-off-by: Chas Williams Signed-off-by: David S. Miller --- drivers/atm/fore200e.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'drivers') diff --git a/drivers/atm/fore200e.c b/drivers/atm/fore200e.c index 14f6a6201da3..05983a312d50 100644 --- a/drivers/atm/fore200e.c +++ b/drivers/atm/fore200e.c @@ -555,7 +555,7 @@ fore200e_pca_reset(struct fore200e* fore200e) } -static int __init +static int __devinit fore200e_pca_map(struct fore200e* fore200e) { DPRINTK(2, "device %s being mapped in memory\n", fore200e->name); @@ -589,7 +589,7 @@ fore200e_pca_unmap(struct fore200e* fore200e) } -static int __init +static int __devinit fore200e_pca_configure(struct fore200e* fore200e) { struct pci_dev* pci_dev = (struct pci_dev*)fore200e->bus_dev; @@ -2125,7 +2125,7 @@ fore200e_change_qos(struct atm_vcc* vcc,struct atm_qos* qos, int flags) } -static int __init +static int __devinit fore200e_irq_request(struct fore200e* fore200e) { if (request_irq(fore200e->irq, fore200e_interrupt, SA_SHIRQ, fore200e->name, fore200e->atm_dev) < 0) { @@ -2148,7 +2148,7 @@ fore200e_irq_request(struct fore200e* fore200e) } -static int __init +static int __devinit fore200e_get_esi(struct fore200e* fore200e) { struct prom_data* prom = fore200e_kmalloc(sizeof(struct prom_data), GFP_KERNEL | GFP_DMA); @@ -2180,7 +2180,7 @@ fore200e_get_esi(struct fore200e* fore200e) } -static int __init +static int __devinit fore200e_alloc_rx_buf(struct fore200e* fore200e) { int scheme, magn, nbr, size, i; @@ -2245,7 +2245,7 @@ fore200e_alloc_rx_buf(struct fore200e* fore200e) } -static int __init +static int __devinit fore200e_init_bs_queue(struct fore200e* fore200e) { int scheme, magn, i; @@ -2308,7 +2308,7 @@ fore200e_init_bs_queue(struct fore200e* fore200e) } -static int __init +static int __devinit fore200e_init_rx_queue(struct fore200e* fore200e) { struct host_rxq* rxq = &fore200e->host_rxq; @@ -2368,7 +2368,7 @@ fore200e_init_rx_queue(struct fore200e* fore200e) } -static int __init +static int __devinit fore200e_init_tx_queue(struct fore200e* fore200e) { struct host_txq* txq = &fore200e->host_txq; @@ -2431,7 +2431,7 @@ fore200e_init_tx_queue(struct fore200e* fore200e) } -static int __init +static int __devinit fore200e_init_cmd_queue(struct fore200e* fore200e) { struct host_cmdq* cmdq = &fore200e->host_cmdq; @@ -2487,7 +2487,7 @@ fore200e_param_bs_queue(struct fore200e* fore200e, } -static int __init +static int __devinit fore200e_initialize(struct fore200e* fore200e) { struct cp_queues __iomem * cpq; @@ -2539,7 +2539,7 @@ fore200e_initialize(struct fore200e* fore200e) } -static void __init +static void __devinit fore200e_monitor_putc(struct fore200e* fore200e, char c) { struct cp_monitor __iomem * monitor = fore200e->cp_monitor; @@ -2551,7 +2551,7 @@ fore200e_monitor_putc(struct fore200e* fore200e, char c) } -static int __init +static int __devinit fore200e_monitor_getc(struct fore200e* fore200e) { struct cp_monitor __iomem * monitor = fore200e->cp_monitor; @@ -2576,7 +2576,7 @@ fore200e_monitor_getc(struct fore200e* fore200e) } -static void __init +static void __devinit fore200e_monitor_puts(struct fore200e* fore200e, char* str) { while (*str) { @@ -2591,7 +2591,7 @@ fore200e_monitor_puts(struct fore200e* fore200e, char* str) } -static int __init +static int __devinit fore200e_start_fw(struct fore200e* fore200e) { int ok; @@ -2622,7 +2622,7 @@ fore200e_start_fw(struct fore200e* fore200e) } -static int __init +static int __devinit fore200e_load_fw(struct fore200e* fore200e) { u32* fw_data = (u32*) fore200e->bus->fw_data; @@ -2648,7 +2648,7 @@ fore200e_load_fw(struct fore200e* fore200e) } -static int __init +static int __devinit fore200e_register(struct fore200e* fore200e) { struct atm_dev* atm_dev; @@ -2675,7 +2675,7 @@ fore200e_register(struct fore200e* fore200e) } -static int __init +static int __devinit fore200e_init(struct fore200e* fore200e) { if (fore200e_register(fore200e) < 0) @@ -2721,7 +2721,7 @@ fore200e_init(struct fore200e* fore200e) return -EBUSY; fore200e_supply(fore200e); - + /* all done, board initialization is now complete */ fore200e->state = FORE200E_STATE_COMPLETE; return 0; -- cgit v1.2.3 From 7a171cdcb6ce82cc5e4bd7cb8eab172a43395f87 Mon Sep 17 00:00:00 2001 From: Russell King Date: Sun, 5 Mar 2006 00:31:22 +0000 Subject: [SERIAL] Fix two bugs in parport_serial Steinar H. Gunderson reported: - For some reason, it detects the 9845 as a 9735 -- it appears this is simply related to the ordering in parport_serial_pci_tbl[]. If we move the 9845 up above the 9735, it prints out 9710:9845, but no change in behaviour. (We didn't find out why this was the case; we left it alone since it didn't affect our problem.) - The card has no parallel port (at least no physical ones), yet it reports (via its subsystem ID of 0x0014) one parallel port and four serial ports. The probe for the parallel port fails, and the driver just aborts. Thus, it doesn't find the serial ports. Fix the debugging code to use dev_dbg, but don't bother displaying the PCI ID of the detected board (that's accessible via other means.) Also, arrange for parport_register() to return 0 even if it finds no ports. Signed-off-by: Russell King --- drivers/parport/parport_serial.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'drivers') diff --git a/drivers/parport/parport_serial.c b/drivers/parport/parport_serial.c index 166de3507780..10845253c9e0 100644 --- a/drivers/parport/parport_serial.c +++ b/drivers/parport/parport_serial.c @@ -312,8 +312,7 @@ static int __devinit parport_register (struct pci_dev *dev, { struct parport_pc_pci *card; struct parport_serial_private *priv = pci_get_drvdata (dev); - int i = id->driver_data, n; - int success = 0; + int n, success = 0; priv->par = cards[id->driver_data]; card = &priv->par; @@ -344,10 +343,8 @@ static int __devinit parport_register (struct pci_dev *dev, "hi" as an offset (see SYBA def.) */ /* TODO: test if sharing interrupts works */ - printk (KERN_DEBUG "PCI parallel port detected: %04x:%04x, " - "I/O at %#lx(%#lx)\n", - parport_serial_pci_tbl[i].vendor, - parport_serial_pci_tbl[i].device, io_lo, io_hi); + dev_dbg(&dev->dev, "PCI parallel port detected: I/O at " + "%#lx(%#lx)\n", io_lo, io_hi); port = parport_pc_probe_port (io_lo, io_hi, PARPORT_IRQ_NONE, PARPORT_DMA_NONE, dev); if (port) { @@ -359,7 +356,7 @@ static int __devinit parport_register (struct pci_dev *dev, if (card->postinit_hook) card->postinit_hook (dev, card, !success); - return success ? 0 : 1; + return 0; } static int __devinit parport_serial_pci_probe (struct pci_dev *dev, -- cgit v1.2.3 From 2d66806d740eeb410aa785bd7fba3bd24bb082c1 Mon Sep 17 00:00:00 2001 From: Eric Sesterhenn Date: Sun, 5 Mar 2006 01:16:00 +0300 Subject: [PATCH] chelsio: fix kmalloc failure in t1_espi_create memset() is called before check. Signed-off-by: Eric Sesterhenn Signed-off-by: Alexey Dobriyan Signed-off-by: Jeff Garzik --- drivers/net/chelsio/espi.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'drivers') diff --git a/drivers/net/chelsio/espi.c b/drivers/net/chelsio/espi.c index 230642571c92..e824acaf188a 100644 --- a/drivers/net/chelsio/espi.c +++ b/drivers/net/chelsio/espi.c @@ -296,9 +296,7 @@ void t1_espi_destroy(struct peespi *espi) struct peespi *t1_espi_create(adapter_t *adapter) { - struct peespi *espi = kmalloc(sizeof(*espi), GFP_KERNEL); - - memset(espi, 0, sizeof(*espi)); + struct peespi *espi = kzalloc(sizeof(*espi), GFP_KERNEL); if (espi) espi->adapter = adapter; -- cgit v1.2.3 From 91c0bce29e4050a59ee5fdc1192b60bbf8693a6d Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 6 Mar 2006 13:25:52 -0800 Subject: [PATCH] USB Serial: fix use-after-free bug in usb-serial core This fixes a use-after-free bug in the usb-serial core. It is simple to trigger this (open a usb-serial port, then yank the device out before closing the port.) Thanks to Stefan Seyfried for reporting this, and to the slab debugging code which enabled it to be tracked down. Signed-off-by: Greg Kroah-Hartman Signed-off-by: Linus Torvalds --- drivers/usb/serial/usb-serial.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'drivers') diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index 4dd6865d32b0..b5c96e74a903 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c @@ -242,8 +242,10 @@ static void serial_close(struct tty_struct *tty, struct file * filp) down(&port->sem); - if (port->open_count == 0) - goto out; + if (port->open_count == 0) { + up(&port->sem); + return; + } --port->open_count; if (port->open_count == 0) { @@ -260,10 +262,8 @@ static void serial_close(struct tty_struct *tty, struct file * filp) module_put(port->serial->type->driver.owner); } - kref_put(&port->serial->kref, destroy_serial); - -out: up(&port->sem); + kref_put(&port->serial->kref, destroy_serial); } static int serial_write (struct tty_struct * tty, const unsigned char *buf, int count) -- cgit v1.2.3 From f716d8303345698728d9f8ce76a82a795a5be275 Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Mon, 6 Mar 2006 17:41:44 -0800 Subject: Allocate 96 bytes for SCSI sense data reply The SCSI layer uses SCSI_SENSE_BUFFERSIZE (96) for the sense buffer size, even though some other code uses "sizeof(struct request_sense)" (which is 64 bytes). Allocate the buffer using the bigger of the two for safety. Signed-off-by: Linus Torvalds --- drivers/scsi/sr_ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/scsi/sr_ioctl.c b/drivers/scsi/sr_ioctl.c index 5d02ff4db6cc..b65462f76484 100644 --- a/drivers/scsi/sr_ioctl.c +++ b/drivers/scsi/sr_ioctl.c @@ -192,7 +192,7 @@ int sr_do_ioctl(Scsi_CD *cd, struct packet_command *cgc) SDev = cd->device; if (!sense) { - sense = kmalloc(sizeof(*sense), GFP_KERNEL); + sense = kmalloc(SCSI_SENSE_BUFFERSIZE, GFP_KERNEL); if (!sense) { err = -ENOMEM; goto out; -- cgit v1.2.3 From 1e4b27df55166ce3b276f55bab223fa4ae8c5525 Mon Sep 17 00:00:00 2001 From: Karsten Keil Date: Mon, 6 Mar 2006 15:42:37 -0800 Subject: [PATCH] i4l: add new PCI IDs for HFC-S PCI Add new PCI IDs for HFC-S PCI based ISDN TA 'Primux II S0' and 'Primux II S0' from Gerdes AG Signed-off-by: Martin Bachem Signed-off-by: Karsten Keil Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/isdn/hisax/config.c | 2 ++ drivers/isdn/hisax/hfc_pci.c | 2 ++ include/linux/pci_ids.h | 2 ++ 3 files changed, 6 insertions(+) (limited to 'drivers') diff --git a/drivers/isdn/hisax/config.c b/drivers/isdn/hisax/config.c index 8159bcecd0c2..df9d65201819 100644 --- a/drivers/isdn/hisax/config.c +++ b/drivers/isdn/hisax/config.c @@ -1929,6 +1929,8 @@ static struct pci_device_id hisax_pci_tbl[] __initdata = { {PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_B00B, PCI_ANY_ID, PCI_ANY_ID}, {PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_B00C, PCI_ANY_ID, PCI_ANY_ID}, {PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_B100, PCI_ANY_ID, PCI_ANY_ID}, + {PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_B700, PCI_ANY_ID, PCI_ANY_ID}, + {PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_B701, PCI_ANY_ID, PCI_ANY_ID}, {PCI_VENDOR_ID_ABOCOM, PCI_DEVICE_ID_ABOCOM_2BD1, PCI_ANY_ID, PCI_ANY_ID}, {PCI_VENDOR_ID_ASUSTEK, PCI_DEVICE_ID_ASUSTEK_0675, PCI_ANY_ID, PCI_ANY_ID}, {PCI_VENDOR_ID_BERKOM, PCI_DEVICE_ID_BERKOM_T_CONCEPT, PCI_ANY_ID, PCI_ANY_ID}, diff --git a/drivers/isdn/hisax/hfc_pci.c b/drivers/isdn/hisax/hfc_pci.c index 4866fc32d8d9..91d25acb5ede 100644 --- a/drivers/isdn/hisax/hfc_pci.c +++ b/drivers/isdn/hisax/hfc_pci.c @@ -51,6 +51,8 @@ static const PCI_ENTRY id_list[] = {PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_B00B, "Billion", "B00B"}, {PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_B00C, "Billion", "B00C"}, {PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_B100, "Seyeon", "B100"}, + {PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_B700, "Primux II S0", "B700"}, + {PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_B701, "Primux II S0 NT", "B701"}, {PCI_VENDOR_ID_ABOCOM, PCI_DEVICE_ID_ABOCOM_2BD1, "Abocom/Magitek", "2BD1"}, {PCI_VENDOR_ID_ASUSTEK, PCI_DEVICE_ID_ASUSTEK_0675, "Asuscom/Askey", "675"}, {PCI_VENDOR_ID_BERKOM, PCI_DEVICE_ID_BERKOM_T_CONCEPT, "German telekom", "T-Concept"}, diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 82b83da25d77..1709b5009d2e 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h @@ -1752,6 +1752,8 @@ #define PCI_DEVICE_ID_CCD_B00B 0xb00b #define PCI_DEVICE_ID_CCD_B00C 0xb00c #define PCI_DEVICE_ID_CCD_B100 0xb100 +#define PCI_DEVICE_ID_CCD_B700 0xb700 +#define PCI_DEVICE_ID_CCD_B701 0xb701 #define PCI_VENDOR_ID_EXAR 0x13a8 #define PCI_DEVICE_ID_EXAR_XR17C152 0x0152 -- cgit v1.2.3 From 7cb9478f0d5b2424af974646dcbe10ce7c19b550 Mon Sep 17 00:00:00 2001 From: Karsten Keil Date: Mon, 6 Mar 2006 15:42:39 -0800 Subject: [PATCH] i4l: fix refcounting problem with ttyIx devices If the same ttyIx device was opened by two processes the module was not released and so the usage count went never to zero again. This oneliner fixes the issue. Signed-off-by: Oskar Senft Signed-off-by: Karsten Keil Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/isdn/i4l/isdn_tty.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers') diff --git a/drivers/isdn/i4l/isdn_tty.c b/drivers/isdn/i4l/isdn_tty.c index 393633681f49..aeaa1db74bd8 100644 --- a/drivers/isdn/i4l/isdn_tty.c +++ b/drivers/isdn/i4l/isdn_tty.c @@ -1682,6 +1682,7 @@ isdn_tty_close(struct tty_struct *tty, struct file *filp) #ifdef ISDN_DEBUG_MODEM_OPEN printk(KERN_DEBUG "isdn_tty_close after info->count != 0\n"); #endif + module_put(info->owner); return; } info->flags |= ISDN_ASYNC_CLOSING; -- cgit v1.2.3 From b05121b29e8af45ccb424bf71dadc1d04bd23f03 Mon Sep 17 00:00:00 2001 From: Karsten Keil Date: Mon, 6 Mar 2006 15:42:41 -0800 Subject: [PATCH] i4l: fix compatiblity issue with big endian systems This patch fix some compatiblity issues with big endian systems Signed-off-by: Martin Bachem Signed-off-by: Karsten Keil Cc: Al Viro Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/isdn/hisax/hfc_usb.c | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) (limited to 'drivers') diff --git a/drivers/isdn/hisax/hfc_usb.c b/drivers/isdn/hisax/hfc_usb.c index ca5b4a3b683e..262c44127419 100644 --- a/drivers/isdn/hisax/hfc_usb.c +++ b/drivers/isdn/hisax/hfc_usb.c @@ -1,7 +1,7 @@ /* * hfc_usb.c * - * $Id: hfc_usb.c,v 4.36 2005/04/08 09:55:13 martinb1 Exp $ + * $Id: hfc_usb.c,v 2.3.2.13 2006/02/17 17:17:22 mbachem Exp $ * * modular HiSax ISDN driver for Colognechip HFC-S USB chip * @@ -45,7 +45,7 @@ #include "hfc_usb.h" static const char *hfcusb_revision = - "$Revision: 4.36 $ $Date: 2005/04/08 09:55:13 $ "; + "$Revision: 2.3.2.13 $ $Date: 2006/02/17 17:17:22 $ "; /* Hisax debug support * use "modprobe debug=x" where x is bitfield of USB_DBG & ISDN_DBG @@ -219,7 +219,7 @@ symbolic(struct hfcusb_symbolic_list list[], const int num) for (i = 0; list[i].name != NULL; i++) if (list[i].num == num) return (list[i].name); - return ""; + return ""; } @@ -235,9 +235,9 @@ ctrl_start_transfer(hfcusb_data * hfc) hfc->ctrl_urb->transfer_buffer = NULL; hfc->ctrl_urb->transfer_buffer_length = 0; hfc->ctrl_write.wIndex = - hfc->ctrl_buff[hfc->ctrl_out_idx].hfc_reg; + cpu_to_le16(hfc->ctrl_buff[hfc->ctrl_out_idx].hfc_reg); hfc->ctrl_write.wValue = - hfc->ctrl_buff[hfc->ctrl_out_idx].reg_val; + cpu_to_le16(hfc->ctrl_buff[hfc->ctrl_out_idx].reg_val); usb_submit_urb(hfc->ctrl_urb, GFP_ATOMIC); /* start transfer */ } @@ -1282,7 +1282,7 @@ usb_init(hfcusb_data * hfc) /* init the background machinery for control requests */ hfc->ctrl_read.bRequestType = 0xc0; hfc->ctrl_read.bRequest = 1; - hfc->ctrl_read.wLength = 1; + hfc->ctrl_read.wLength = cpu_to_le16(1); hfc->ctrl_write.bRequestType = 0x40; hfc->ctrl_write.bRequest = 0; hfc->ctrl_write.wLength = 0; @@ -1373,9 +1373,8 @@ hfc_usb_probe(struct usb_interface *intf, const struct usb_device_id *id) vend_idx = 0xffff; for (i = 0; hfcusb_idtab[i].idVendor; i++) { - if (dev->descriptor.idVendor == hfcusb_idtab[i].idVendor - && dev->descriptor.idProduct == - hfcusb_idtab[i].idProduct) { + if ((le16_to_cpu(dev->descriptor.idVendor) == hfcusb_idtab[i].idVendor) + && (le16_to_cpu(dev->descriptor.idProduct) == hfcusb_idtab[i].idProduct)) { vend_idx = i; continue; } @@ -1516,8 +1515,7 @@ hfc_usb_probe(struct usb_interface *intf, const struct usb_device_id *id) usb_transfer_mode = USB_INT; packet_size = - ep->desc. - wMaxPacketSize; + le16_to_cpu(ep->desc.wMaxPacketSize); break; case USB_ENDPOINT_XFER_BULK: if (ep_addr & 0x80) @@ -1545,8 +1543,7 @@ hfc_usb_probe(struct usb_interface *intf, const struct usb_device_id *id) usb_transfer_mode = USB_BULK; packet_size = - ep->desc. - wMaxPacketSize; + le16_to_cpu(ep->desc.wMaxPacketSize); break; case USB_ENDPOINT_XFER_ISOC: if (ep_addr & 0x80) @@ -1574,8 +1571,7 @@ hfc_usb_probe(struct usb_interface *intf, const struct usb_device_id *id) usb_transfer_mode = USB_ISOC; iso_packet_size = - ep->desc. - wMaxPacketSize; + le16_to_cpu(ep->desc.wMaxPacketSize); break; default: context-> @@ -1588,10 +1584,8 @@ hfc_usb_probe(struct usb_interface *intf, const struct usb_device_id *id) fifonum = cidx; context->fifos[cidx].hfc = context; - context->fifos[cidx]. - usb_packet_maxlen = - ep->desc. - wMaxPacketSize; + context->fifos[cidx].usb_packet_maxlen = + le16_to_cpu(ep->desc.wMaxPacketSize); context->fifos[cidx]. intervall = ep->desc.bInterval; -- cgit v1.2.3 From cdd440fe9f2e83b1e268148647126440799b71fc Mon Sep 17 00:00:00 2001 From: Benjamin Herrenschmidt Date: Mon, 6 Mar 2006 15:42:59 -0800 Subject: [PATCH] windfarm license fix The Windfarm PID module lacks a licence, it should be GPL, here it is Signed-off-by: Benjamin Herrenschmidt Cc: Paul Mackerras Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/macintosh/windfarm_pid.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'drivers') diff --git a/drivers/macintosh/windfarm_pid.c b/drivers/macintosh/windfarm_pid.c index 0842432e27ad..f10efb28cae4 100644 --- a/drivers/macintosh/windfarm_pid.c +++ b/drivers/macintosh/windfarm_pid.c @@ -143,3 +143,7 @@ s32 wf_cpu_pid_run(struct wf_cpu_pid_state *st, s32 new_power, s32 new_temp) return st->target; } EXPORT_SYMBOL_GPL(wf_cpu_pid_run); + +MODULE_AUTHOR("Benjamin Herrenschmidt "); +MODULE_DESCRIPTION("PID algorithm for PowerMacs thermal control"); +MODULE_LICENSE("GPL"); -- cgit v1.2.3 From 15730ddbf745fbda9001b8bbd71977ac66bf5f41 Mon Sep 17 00:00:00 2001 From: Cornelia Huck Date: Mon, 6 Mar 2006 15:43:02 -0800 Subject: [PATCH] s390: improve response code handling in chsc_enable_facility() Rather than checking for some known failures, check positively for the success response code 0x0001 and return -EIO for unrecognized failure response codes. Signed-off-by: Cornelia Huck Cc: Greg Smith Cc: Heiko Carstens Cc: Martin Schwidefsky Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/s390/cio/chsc.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'drivers') diff --git a/drivers/s390/cio/chsc.c b/drivers/s390/cio/chsc.c index 8cf9905d484b..f4183d660258 100644 --- a/drivers/s390/cio/chsc.c +++ b/drivers/s390/cio/chsc.c @@ -1115,6 +1115,9 @@ chsc_enable_facility(int operation_code) goto out; } switch (sda_area->response.code) { + case 0x0001: /* everything ok */ + ret = 0; + break; case 0x0003: /* invalid request block */ case 0x0007: ret = -EINVAL; @@ -1123,6 +1126,8 @@ chsc_enable_facility(int operation_code) case 0x0101: /* facility not provided */ ret = -EOPNOTSUPP; break; + default: /* something went wrong */ + ret = -EIO; } out: free_page((unsigned long)sda_area); -- cgit v1.2.3 From 72f2afb8a6858edd9335cd158eb21053a0c2c39a Mon Sep 17 00:00:00 2001 From: Michael Chan Date: Mon, 6 Mar 2006 19:28:35 -0800 Subject: [TG3]: Add DMA address workaround Add DMA workaround for chips that do not support full 64-bit DMA addresses. 5714, 5715, and 5780 chips only support DMA addresses less than 40 bits. On 64-bit systems with IOMMU, set the dma_mask to 40-bit so that pci_map_xxx() calls will map the DMA address below 40 bits if necessary. On 64-bit systems without IOMMU, set the dma_mask to 64-bit and check for DMA addresses exceeding the limit in tg3_start_xmit(). 5788 only supports 32-bit DMA so need to set the mask appropriately also. Thanks to Chris Elmquist at SGI for reporting and helping to debug the problem on 5714. Thanks to David Miller for explaining the HIGHMEM and DMA stuff. Signed-off-by: Michael Chan Signed-off-by: David S. Miller --- drivers/net/tg3.c | 87 +++++++++++++++++++++++++++++++++++++------------------ 1 file changed, 59 insertions(+), 28 deletions(-) (limited to 'drivers') diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index e8e92c853e89..15545620ab0e 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c @@ -3532,9 +3532,23 @@ static inline int tg3_4g_overflow_test(dma_addr_t mapping, int len) (base + len + 8 < base)); } +/* Test for DMA addresses > 40-bit */ +static inline int tg3_40bit_overflow_test(struct tg3 *tp, dma_addr_t mapping, + int len) +{ +#if defined(CONFIG_HIGHMEM) && (BITS_PER_LONG == 64) + if (tp->tg3_flags2 & TG3_FLG2_5780_CLASS) + return (((u64) mapping + len) > DMA_40BIT_MASK); + return 0; +#else + return 0; +#endif +} + static void tg3_set_txd(struct tg3 *, int, dma_addr_t, int, u32, u32); -static int tigon3_4gb_hwbug_workaround(struct tg3 *tp, struct sk_buff *skb, +/* Workaround 4GB and 40-bit hardware DMA bugs. */ +static int tigon3_dma_hwbug_workaround(struct tg3 *tp, struct sk_buff *skb, u32 last_plus_one, u32 *start, u32 base_flags, u32 mss) { @@ -3742,6 +3756,9 @@ static int tg3_start_xmit(struct sk_buff *skb, struct net_device *dev) if (tg3_4g_overflow_test(mapping, len)) would_hit_hwbug = 1; + if (tg3_40bit_overflow_test(tp, mapping, len)) + would_hit_hwbug = 1; + if (tp->tg3_flags2 & TG3_FLG2_HW_TSO) tg3_set_txd(tp, entry, mapping, len, base_flags, (i == last)|(mss << 1)); @@ -3763,7 +3780,7 @@ static int tg3_start_xmit(struct sk_buff *skb, struct net_device *dev) /* If the workaround fails due to memory/mapping * failure, silently drop this packet. */ - if (tigon3_4gb_hwbug_workaround(tp, skb, last_plus_one, + if (tigon3_dma_hwbug_workaround(tp, skb, last_plus_one, &start, base_flags, mss)) goto out_unlock; @@ -10608,8 +10625,9 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, unsigned long tg3reg_base, tg3reg_len; struct net_device *dev; struct tg3 *tp; - int i, err, pci_using_dac, pm_cap; + int i, err, pm_cap; char str[40]; + u64 dma_mask, persist_dma_mask; if (tg3_version_printed++ == 0) printk(KERN_INFO "%s", version); @@ -10646,26 +10664,6 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, goto err_out_free_res; } - /* Configure DMA attributes. */ - err = pci_set_dma_mask(pdev, DMA_64BIT_MASK); - if (!err) { - pci_using_dac = 1; - err = pci_set_consistent_dma_mask(pdev, DMA_64BIT_MASK); - if (err < 0) { - printk(KERN_ERR PFX "Unable to obtain 64 bit DMA " - "for consistent allocations\n"); - goto err_out_free_res; - } - } else { - err = pci_set_dma_mask(pdev, DMA_32BIT_MASK); - if (err) { - printk(KERN_ERR PFX "No usable DMA configuration, " - "aborting.\n"); - goto err_out_free_res; - } - pci_using_dac = 0; - } - tg3reg_base = pci_resource_start(pdev, 0); tg3reg_len = pci_resource_len(pdev, 0); @@ -10679,8 +10677,6 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, SET_MODULE_OWNER(dev); SET_NETDEV_DEV(dev, &pdev->dev); - if (pci_using_dac) - dev->features |= NETIF_F_HIGHDMA; dev->features |= NETIF_F_LLTX; #if TG3_VLAN_TAG_USED dev->features |= NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX; @@ -10765,6 +10761,44 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, goto err_out_iounmap; } + /* 5714, 5715 and 5780 cannot support DMA addresses > 40-bit. + * On 64-bit systems with IOMMU, use 40-bit dma_mask. + * On 64-bit systems without IOMMU, use 64-bit dma_mask and + * do DMA address check in tg3_start_xmit(). + */ + if (tp->tg3_flags2 & TG3_FLG2_5780_CLASS) { + persist_dma_mask = dma_mask = DMA_40BIT_MASK; +#ifdef CONFIG_HIGHMEM + dma_mask = DMA_64BIT_MASK; +#endif + } else if (tp->tg3_flags2 & TG3_FLG2_IS_5788) + persist_dma_mask = dma_mask = DMA_32BIT_MASK; + else + persist_dma_mask = dma_mask = DMA_64BIT_MASK; + + /* Configure DMA attributes. */ + if (dma_mask > DMA_32BIT_MASK) { + err = pci_set_dma_mask(pdev, dma_mask); + if (!err) { + dev->features |= NETIF_F_HIGHDMA; + err = pci_set_consistent_dma_mask(pdev, + persist_dma_mask); + if (err < 0) { + printk(KERN_ERR PFX "Unable to obtain 64 bit " + "DMA for consistent allocations\n"); + goto err_out_iounmap; + } + } + } + if (err || dma_mask == DMA_32BIT_MASK) { + err = pci_set_dma_mask(pdev, DMA_32BIT_MASK); + if (err) { + printk(KERN_ERR PFX "No usable DMA configuration, " + "aborting.\n"); + goto err_out_iounmap; + } + } + tg3_init_bufmgr_config(tp); #if TG3_TSO_SUPPORT != 0 @@ -10833,9 +10867,6 @@ static int __devinit tg3_init_one(struct pci_dev *pdev, } else tp->tg3_flags &= ~TG3_FLAG_RX_CHECKSUMS; - if (tp->tg3_flags2 & TG3_FLG2_IS_5788) - dev->features &= ~NETIF_F_HIGHDMA; - /* flow control autonegotiation is default behavior */ tp->tg3_flags |= TG3_FLAG_PAUSE_AUTONEG; -- cgit v1.2.3 From c4432c41b0c74d770ebc5e0a4fc3df3d00dfc131 Mon Sep 17 00:00:00 2001 From: Martin Michlmayr Date: Tue, 7 Mar 2006 21:04:59 +0000 Subject: [SERIAL] ip22zilog: Fix oops on runlevel change with serial console Incorrect uart_write_wakeup() calls cause reference to a NULL tty pointer. This has been fixed in the sunsab and sunzilog serial drivers in October 2005. Update the ip22zilog, which is based on sunzilog, accordingly. Signed-off-by: Martin Michlmayr Signed-off-by: Russell King port.info == NULL) goto ack_tx_int; xmit = &up->port.info->xmit; - if (uart_circ_empty(xmit)) { - uart_write_wakeup(&up->port); + if (uart_circ_empty(xmit)) goto ack_tx_int; - } if (uart_tx_stopped(&up->port)) goto ack_tx_int; -- cgit v1.2.3 From f032f90809ebbbd28feb90f97add2e0a869a42ed Mon Sep 17 00:00:00 2001 From: Bjorn Helgaas Date: Fri, 3 Mar 2006 15:34:34 -0700 Subject: [IA64] SGI SN drivers: don't report !sn2 hardware as an error This stuff is all in the generic ia64 kernel, and the new initcall error reporting complains about them. Signed-off-by: Bjorn Helgaas Signed-off-by: Tony Luck --- drivers/char/mmtimer.c | 2 +- drivers/serial/sn_console.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/char/mmtimer.c b/drivers/char/mmtimer.c index c92378121b4c..1b05fa688996 100644 --- a/drivers/char/mmtimer.c +++ b/drivers/char/mmtimer.c @@ -675,7 +675,7 @@ static int __init mmtimer_init(void) cnodeid_t node, maxn = -1; if (!ia64_platform_is("sn2")) - return -1; + return 0; /* * Sanity check the cycles/sec variable diff --git a/drivers/serial/sn_console.c b/drivers/serial/sn_console.c index 43e67d6c29d4..60ea4a3f0713 100644 --- a/drivers/serial/sn_console.c +++ b/drivers/serial/sn_console.c @@ -820,7 +820,7 @@ static int __init sn_sal_module_init(void) int retval; if (!ia64_platform_is("sn2")) - return -ENODEV; + return 0; printk(KERN_INFO "sn_console: Console driver init\n"); -- cgit v1.2.3 From 05e3beb288183f9176c5fba18fae43d348cc5523 Mon Sep 17 00:00:00 2001 From: Marco Schluessler Date: Fri, 24 Feb 2006 18:53:00 -0300 Subject: V4L/DVB (3403): Workaround to fix initialization for Nexus CA Workaround for Nexus CA: Debi test fails unless first debi write is repeated. Signed-off-by: Marco Schluessler Signed-off-by: Oliver Endriss Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/ttpci/av7110_hw.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers') diff --git a/drivers/media/dvb/ttpci/av7110_hw.c b/drivers/media/dvb/ttpci/av7110_hw.c index b2e63e9fc053..0bb6e74ae7f0 100644 --- a/drivers/media/dvb/ttpci/av7110_hw.c +++ b/drivers/media/dvb/ttpci/av7110_hw.c @@ -245,6 +245,9 @@ int av7110_bootarm(struct av7110 *av7110) /* test DEBI */ iwdebi(av7110, DEBISWAP, DPRAM_BASE, 0x76543210, 4); + /* FIXME: Why does Nexus CA require 2x iwdebi for first init? */ + iwdebi(av7110, DEBISWAP, DPRAM_BASE, 0x76543210, 4); + if ((ret=irdebi(av7110, DEBINOSWAP, DPRAM_BASE, 0, 4)) != 0x10325476) { printk(KERN_ERR "dvb-ttpci: debi test in av7110_bootarm() failed: " "%08x != %08x (check your BIOS 'Plug&Play OS' settings)\n", -- cgit v1.2.3 From 8a59822f68996c1f525a8ed87447a4dbc27ada0b Mon Sep 17 00:00:00 2001 From: Alexey Dobriyan Date: Tue, 7 Mar 2006 22:20:23 -0300 Subject: V4L/DVB (3413): Typos grab bag of the month Typos grab bag of the month. Eyeballed by jmc@ in OpenBSD. Signed-off-by: Alexey Dobriyan Signed-off-by: Oliver Endriss Signed-off-by: Mauro Carvalho Chehab --- drivers/media/dvb/dvb-core/demux.h | 2 +- drivers/media/dvb/dvb-usb/dvb-usb-init.c | 2 +- drivers/media/dvb/dvb-usb/dvb-usb.h | 2 +- drivers/media/dvb/ttpci/av7110.c | 2 +- drivers/media/video/cpia.c | 2 +- drivers/media/video/videocodec.h | 2 +- drivers/media/video/zr36050.c | 2 +- drivers/media/video/zr36060.c | 2 +- drivers/media/video/zr36120_i2c.c | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) (limited to 'drivers') diff --git a/drivers/media/dvb/dvb-core/demux.h b/drivers/media/dvb/dvb-core/demux.h index 9f025825b2d2..0c1d87c5227a 100644 --- a/drivers/media/dvb/dvb-core/demux.h +++ b/drivers/media/dvb/dvb-core/demux.h @@ -216,7 +216,7 @@ struct dmx_frontend { /*--------------------------------------------------------------------------*/ /* - * Flags OR'ed in the capabilites field of struct dmx_demux. + * Flags OR'ed in the capabilities field of struct dmx_demux. */ #define DMX_TS_FILTERING 1 diff --git a/drivers/media/dvb/dvb-usb/dvb-usb-init.c b/drivers/media/dvb/dvb-usb/dvb-usb-init.c index 716f8bf528cd..ce34a55e5c24 100644 --- a/drivers/media/dvb/dvb-usb/dvb-usb-init.c +++ b/drivers/media/dvb/dvb-usb/dvb-usb-init.c @@ -47,7 +47,7 @@ static int dvb_usb_init(struct dvb_usb_device *d) d->state = DVB_USB_STATE_INIT; -/* check the capabilites and set appropriate variables */ +/* check the capabilities and set appropriate variables */ /* speed - when running at FULL speed we need a HW PID filter */ if (d->udev->speed == USB_SPEED_FULL && !(d->props.caps & DVB_USB_HAS_PID_FILTER)) { diff --git a/drivers/media/dvb/dvb-usb/dvb-usb.h b/drivers/media/dvb/dvb-usb/dvb-usb.h index 5e5d21ad93c9..d4909e5c67e0 100644 --- a/drivers/media/dvb/dvb-usb/dvb-usb.h +++ b/drivers/media/dvb/dvb-usb/dvb-usb.h @@ -87,7 +87,7 @@ struct dvb_usb_device; /** * struct dvb_usb_properties - properties of a dvb-usb-device - * @caps: capabilites of the DVB USB device. + * @caps: capabilities of the DVB USB device. * @pid_filter_count: number of PID filter position in the optional hardware * PID-filter. * diff --git a/drivers/media/dvb/ttpci/av7110.c b/drivers/media/dvb/ttpci/av7110.c index cdf7b2c33ad0..7c6ccb96b157 100644 --- a/drivers/media/dvb/ttpci/av7110.c +++ b/drivers/media/dvb/ttpci/av7110.c @@ -1439,7 +1439,7 @@ static int check_firmware(struct av7110* av7110) len = ntohl(*(u32*) ptr); ptr += 4; if (len >= 512) { - printk("dvb-ttpci: dpram file is way to big.\n"); + printk("dvb-ttpci: dpram file is way too big.\n"); return -EINVAL; } if (crc != crc32_le(0, ptr, len)) { diff --git a/drivers/media/video/cpia.c b/drivers/media/video/cpia.c index 9f59541155d9..85d964b5b33c 100644 --- a/drivers/media/video/cpia.c +++ b/drivers/media/video/cpia.c @@ -3369,7 +3369,7 @@ static int cpia_do_ioctl(struct inode *inode, struct file *file, //DBG("cpia_ioctl: %u\n", ioctlnr); switch (ioctlnr) { - /* query capabilites */ + /* query capabilities */ case VIDIOCGCAP: { struct video_capability *b = arg; diff --git a/drivers/media/video/videocodec.h b/drivers/media/video/videocodec.h index 156ae57096fe..b1239ac7f371 100644 --- a/drivers/media/video/videocodec.h +++ b/drivers/media/video/videocodec.h @@ -56,7 +56,7 @@ the slave is bound to it). Otherwise it doesn't need this functions and therfor they may not be initialized. - The other fuctions are just for convenience, as they are for shure used by + The other fuctions are just for convenience, as they are for sure used by most/all of the codecs. The last ones may be ommited, too. See the structure declaration below for more information and which data has diff --git a/drivers/media/video/zr36050.c b/drivers/media/video/zr36050.c index bd0cd28543ca..6699725be605 100644 --- a/drivers/media/video/zr36050.c +++ b/drivers/media/video/zr36050.c @@ -159,7 +159,7 @@ zr36050_wait_end (struct zr36050 *ptr) while (!(zr36050_read_status1(ptr) & 0x4)) { udelay(1); - if (i++ > 200000) { // 200ms, there is for shure something wrong!!! + if (i++ > 200000) { // 200ms, there is for sure something wrong!!! dprintk(1, "%s: timout at wait_end (last status: 0x%02x)\n", ptr->name, ptr->status1); diff --git a/drivers/media/video/zr36060.c b/drivers/media/video/zr36060.c index 28fa31a5f150..d8dd003a7aad 100644 --- a/drivers/media/video/zr36060.c +++ b/drivers/media/video/zr36060.c @@ -161,7 +161,7 @@ zr36060_wait_end (struct zr36060 *ptr) while (zr36060_read_status(ptr) & ZR060_CFSR_Busy) { udelay(1); - if (i++ > 200000) { // 200ms, there is for shure something wrong!!! + if (i++ > 200000) { // 200ms, there is for sure something wrong!!! dprintk(1, "%s: timout at wait_end (last status: 0x%02x)\n", ptr->name, ptr->status); diff --git a/drivers/media/video/zr36120_i2c.c b/drivers/media/video/zr36120_i2c.c index 6bfe84d657f1..21fde43a6aed 100644 --- a/drivers/media/video/zr36120_i2c.c +++ b/drivers/media/video/zr36120_i2c.c @@ -65,7 +65,7 @@ void attach_inform(struct i2c_bus *bus, int id) case I2C_DRIVERID_VIDEODECODER: DEBUG(printk(CARD_INFO "decoder attached\n",CARD)); - /* fetch the capabilites of the decoder */ + /* fetch the capabilities of the decoder */ rv = i2c_control_device(&ztv->i2c, I2C_DRIVERID_VIDEODECODER, DECODER_GET_CAPABILITIES, &dc); if (rv) { DEBUG(printk(CARD_DEBUG "decoder is not V4L aware!\n",CARD)); -- cgit v1.2.3 From d5f735e52fb41e032b0db08aa20c02dbb9cd0db3 Mon Sep 17 00:00:00 2001 From: Pavel Machek Date: Tue, 7 Mar 2006 21:55:20 -0800 Subject: [PATCH] serial core: work around sub-driver bugs We're presently getting oopses because Bluetooth (and possibly other) drivers are calling core functions after things have been shut down. So rather than oopsing, let's drop a warning then take avoiding action, so the machine survives. Once all the sub-drivers are fixed up we can remove the take-avoiding-action part. Signed-off-by: Pavel Machek Cc: Russell King Cc: Marcel Holtmann Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/serial/serial_core.c | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) (limited to 'drivers') diff --git a/drivers/serial/serial_core.c b/drivers/serial/serial_core.c index 95fb4939c675..cc1faa31d124 100644 --- a/drivers/serial/serial_core.c +++ b/drivers/serial/serial_core.c @@ -71,6 +71,11 @@ static void uart_change_pm(struct uart_state *state, int pm_state); void uart_write_wakeup(struct uart_port *port) { struct uart_info *info = port->info; + /* + * This means you called this function _after_ the port was + * closed. No cookie for you. + */ + BUG_ON(!info); tasklet_schedule(&info->tlet); } @@ -471,14 +476,26 @@ static void uart_flush_chars(struct tty_struct *tty) } static int -uart_write(struct tty_struct *tty, const unsigned char * buf, int count) +uart_write(struct tty_struct *tty, const unsigned char *buf, int count) { struct uart_state *state = tty->driver_data; - struct uart_port *port = state->port; - struct circ_buf *circ = &state->info->xmit; + struct uart_port *port; + struct circ_buf *circ; unsigned long flags; int c, ret = 0; + /* + * This means you called this function _after_ the port was + * closed. No cookie for you. + */ + if (!state || !state->info) { + WARN_ON(1); + return -EL3HLT; + } + + port = state->port; + circ = &state->info->xmit; + if (!circ->buf) return 0; @@ -521,6 +538,15 @@ static void uart_flush_buffer(struct tty_struct *tty) struct uart_port *port = state->port; unsigned long flags; + /* + * This means you called this function _after_ the port was + * closed. No cookie for you. + */ + if (!state || !state->info) { + WARN_ON(1); + return; + } + DPRINTK("uart_flush_buffer(%d) called\n", tty->index); spin_lock_irqsave(&port->lock, flags); -- cgit v1.2.3 From fbcae7eafcf7dfb315602de935d7ca85574e5c11 Mon Sep 17 00:00:00 2001 From: Martin Schwidefsky Date: Tue, 7 Mar 2006 21:55:38 -0800 Subject: [PATCH] s390: iucv message limit for smsg The message limit on the iucv connect call for the smsg module is too low. Therefore increase the smsg message limit to 255. Signed-off-by: Martin Schwidefsky Signed-off-by: Heiko Carstens Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/s390/net/smsgiucv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/s390/net/smsgiucv.c b/drivers/s390/net/smsgiucv.c index d6469baa7e16..72118ee68954 100644 --- a/drivers/s390/net/smsgiucv.c +++ b/drivers/s390/net/smsgiucv.c @@ -168,7 +168,7 @@ smsg_init(void) driver_unregister(&smsg_driver); return -EIO; /* better errno ? */ } - rc = iucv_connect (&smsg_pathid, 1, 0, "*MSG ", 0, 0, 0, 0, + rc = iucv_connect (&smsg_pathid, 255, 0, "*MSG ", 0, 0, 0, 0, smsg_handle, 0); if (rc) { printk(KERN_ERR "SMSGIUCV: failed to connect to *MSG"); -- cgit v1.2.3 From 90f0094dc607abe384a412bfb7199fb667ab0735 Mon Sep 17 00:00:00 2001 From: Horst Hummel Date: Tue, 7 Mar 2006 21:55:39 -0800 Subject: [PATCH] s390: dasd partition detection DASD allows to open a device as soon as gendisk is registered, which means the device is a fake device (capacity=0) and we do know nothing about blocksize and partitions at that point of time. In case the device is opened by someone, the bdev and inode creation is done with the fake device info and the following partition detection code is just using the wrong data. To avoid this modify the DASD state machine to make sure that the open is rejected until the device analysis is either finished or an unformatted device was detected. Signed-off-by: Horst Hummel Signed-off-by: Heiko Carstens Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/s390/block/dasd.c | 38 +++++++++++++++++++++++++++++--------- drivers/s390/block/dasd_genhd.c | 2 -- drivers/s390/block/dasd_int.h | 7 ++++--- drivers/s390/block/dasd_proc.c | 3 +++ fs/partitions/ibm.c | 16 ++++++++++------ 5 files changed, 46 insertions(+), 20 deletions(-) (limited to 'drivers') diff --git a/drivers/s390/block/dasd.c b/drivers/s390/block/dasd.c index af1d5b404cee..33157c84d1d3 100644 --- a/drivers/s390/block/dasd.c +++ b/drivers/s390/block/dasd.c @@ -215,9 +215,10 @@ dasd_state_basic_to_known(struct dasd_device * device) * interrupt for this detection ccw uses the kernel event daemon to * trigger the call to dasd_change_state. All this is done in the * discipline code, see dasd_eckd.c. - * After the analysis ccw is done (do_analysis returned 0 or error) - * the block device is setup. Either a fake disk is added to allow - * formatting or a proper device request queue is created. + * After the analysis ccw is done (do_analysis returned 0) the block + * device is setup. + * In case the analysis returns an error, the device setup is stopped + * (a fake disk was already added to allow formatting). */ static inline int dasd_state_basic_to_ready(struct dasd_device * device) @@ -227,13 +228,19 @@ dasd_state_basic_to_ready(struct dasd_device * device) rc = 0; if (device->discipline->do_analysis != NULL) rc = device->discipline->do_analysis(device); - if (rc) + if (rc) { + if (rc != -EAGAIN) + device->state = DASD_STATE_UNFMT; return rc; + } + /* make disk known with correct capacity */ dasd_setup_queue(device); + set_capacity(device->gdp, device->blocks << device->s2b_shift); device->state = DASD_STATE_READY; - if (dasd_scan_partitions(device) != 0) + rc = dasd_scan_partitions(device); + if (rc) device->state = DASD_STATE_BASIC; - return 0; + return rc; } /* @@ -253,6 +260,15 @@ dasd_state_ready_to_basic(struct dasd_device * device) device->state = DASD_STATE_BASIC; } +/* + * Back to basic. + */ +static inline void +dasd_state_unfmt_to_basic(struct dasd_device * device) +{ + device->state = DASD_STATE_BASIC; +} + /* * Make the device online and schedule the bottom half to start * the requeueing of requests from the linux request queue to the @@ -319,8 +335,12 @@ dasd_decrease_state(struct dasd_device *device) if (device->state == DASD_STATE_READY && device->target <= DASD_STATE_BASIC) dasd_state_ready_to_basic(device); - - if (device->state == DASD_STATE_BASIC && + + if (device->state == DASD_STATE_UNFMT && + device->target <= DASD_STATE_BASIC) + dasd_state_unfmt_to_basic(device); + + if (device->state == DASD_STATE_BASIC && device->target <= DASD_STATE_KNOWN) dasd_state_basic_to_known(device); @@ -1722,7 +1742,7 @@ dasd_open(struct inode *inp, struct file *filp) goto out; } - if (device->state < DASD_STATE_BASIC) { + if (device->state <= DASD_STATE_BASIC) { DBF_DEV_EVENT(DBF_ERR, device, " %s", " Cannot open unrecognized device"); rc = -ENODEV; diff --git a/drivers/s390/block/dasd_genhd.c b/drivers/s390/block/dasd_genhd.c index 65dc844b975c..fce2835e7d19 100644 --- a/drivers/s390/block/dasd_genhd.c +++ b/drivers/s390/block/dasd_genhd.c @@ -100,8 +100,6 @@ dasd_scan_partitions(struct dasd_device * device) { struct block_device *bdev; - /* Make the disk known. */ - set_capacity(device->gdp, device->blocks << device->s2b_shift); bdev = bdget_disk(device->gdp, 0); if (!bdev || blkdev_get(bdev, FMODE_READ, 1) < 0) return -ENODEV; diff --git a/drivers/s390/block/dasd_int.h b/drivers/s390/block/dasd_int.h index 0592354cc604..7cb0b9e78a6a 100644 --- a/drivers/s390/block/dasd_int.h +++ b/drivers/s390/block/dasd_int.h @@ -26,7 +26,7 @@ * new: the dasd_device structure is allocated. * known: the discipline for the device is identified. * basic: the device can do basic i/o. - * accept: the device is analysed (format is known). + * unfmt: the device could not be analyzed (format is unknown). * ready: partition detection is done and the device is can do block io. * online: the device accepts requests from the block device queue. * @@ -47,8 +47,9 @@ #define DASD_STATE_NEW 0 #define DASD_STATE_KNOWN 1 #define DASD_STATE_BASIC 2 -#define DASD_STATE_READY 3 -#define DASD_STATE_ONLINE 4 +#define DASD_STATE_UNFMT 3 +#define DASD_STATE_READY 4 +#define DASD_STATE_ONLINE 5 #include #include diff --git a/drivers/s390/block/dasd_proc.c b/drivers/s390/block/dasd_proc.c index 2d5da3c75ca7..4c1acc8daa82 100644 --- a/drivers/s390/block/dasd_proc.c +++ b/drivers/s390/block/dasd_proc.c @@ -93,6 +93,9 @@ dasd_devices_show(struct seq_file *m, void *v) case DASD_STATE_BASIC: seq_printf(m, "basic"); break; + case DASD_STATE_UNFMT: + seq_printf(m, "unnformatted"); + break; case DASD_STATE_READY: case DASD_STATE_ONLINE: seq_printf(m, "active "); diff --git a/fs/partitions/ibm.c b/fs/partitions/ibm.c index 78010ad60e47..1e4a93835fed 100644 --- a/fs/partitions/ibm.c +++ b/fs/partitions/ibm.c @@ -52,6 +52,7 @@ int ibm_partition(struct parsed_partitions *state, struct block_device *bdev) { int blocksize, offset, size; + loff_t i_size; dasd_information_t *info; struct hd_geometry *geo; char type[5] = {0,}; @@ -63,6 +64,13 @@ ibm_partition(struct parsed_partitions *state, struct block_device *bdev) unsigned char *data; Sector sect; + blocksize = bdev_hardsect_size(bdev); + if (blocksize <= 0) + return 0; + i_size = i_size_read(bdev->bd_inode); + if (i_size == 0) + return 0; + if ((info = kmalloc(sizeof(dasd_information_t), GFP_KERNEL)) == NULL) goto out_noinfo; if ((geo = kmalloc(sizeof(struct hd_geometry), GFP_KERNEL)) == NULL) @@ -73,9 +81,6 @@ ibm_partition(struct parsed_partitions *state, struct block_device *bdev) if (ioctl_by_bdev(bdev, BIODASDINFO, (unsigned long)info) != 0 || ioctl_by_bdev(bdev, HDIO_GETGEO, (unsigned long)geo) != 0) goto out_noioctl; - - if ((blocksize = bdev_hardsect_size(bdev)) <= 0) - goto out_badsect; /* * Get volume label, extract name and type. @@ -111,7 +116,7 @@ ibm_partition(struct parsed_partitions *state, struct block_device *bdev) } else { printk("CMS1/%8s:", name); offset = (info->label_block + 1); - size = bdev->bd_inode->i_size >> 9; + size = i_size >> 9; } put_partition(state, 1, offset*(blocksize >> 9), size-offset*(blocksize >> 9)); @@ -168,7 +173,7 @@ ibm_partition(struct parsed_partitions *state, struct block_device *bdev) else printk("(nonl)/%8s:", name); offset = (info->label_block + 1); - size = (bdev->bd_inode->i_size >> 9); + size = i_size >> 9; put_partition(state, 1, offset*(blocksize >> 9), size-offset*(blocksize >> 9)); } @@ -180,7 +185,6 @@ ibm_partition(struct parsed_partitions *state, struct block_device *bdev) return 1; out_readerr: -out_badsect: out_noioctl: kfree(label); out_nolab: -- cgit v1.2.3 From 62287fbb54b4af71dc5a4918350f81a4cd467788 Mon Sep 17 00:00:00 2001 From: Matt Mackall Date: Tue, 7 Mar 2006 21:55:47 -0800 Subject: [PATCH] dac960: add disk entropy in request completions Signed-off-by: Matt Mackall Tested-by: Anders K. Pedersen Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/block/DAC960.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/block/DAC960.c b/drivers/block/DAC960.c index 6ede1f352c29..37b8cda3e8bc 100644 --- a/drivers/block/DAC960.c +++ b/drivers/block/DAC960.c @@ -41,6 +41,7 @@ #include #include #include +#include #include #include #include "DAC960.h" @@ -3463,7 +3464,7 @@ static inline boolean DAC960_ProcessCompletedRequest(DAC960_Command_T *Command, Command->SegmentCount, Command->DmaDirection); if (!end_that_request_first(Request, UpToDate, Command->BlockCount)) { - + add_disk_randomness(Request->rq_disk); end_that_request_last(Request, UpToDate); if (Command->Completion) { -- cgit v1.2.3 From 3f735b76a4e654bee652cbbeb405b9b3ef950316 Mon Sep 17 00:00:00 2001 From: Francois Romieu Date: Wed, 8 Mar 2006 22:41:15 +0100 Subject: de2104x: prevent interrupt before the interrupt handler is registered de_init_hw enables the irq thus it must be issued after request_irq. Signed-off-by: Martin Michlmayr Signed-off-by: Francois Romieu --- drivers/net/tulip/de2104x.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'drivers') diff --git a/drivers/net/tulip/de2104x.c b/drivers/net/tulip/de2104x.c index d7fb3ffe06ac..9e9e1fe92914 100644 --- a/drivers/net/tulip/de2104x.c +++ b/drivers/net/tulip/de2104x.c @@ -1362,7 +1362,6 @@ static int de_open (struct net_device *dev) { struct de_private *de = dev->priv; int rc; - unsigned long flags; if (netif_msg_ifup(de)) printk(KERN_DEBUG "%s: enabling interface\n", dev->name); @@ -1376,18 +1375,20 @@ static int de_open (struct net_device *dev) return rc; } - rc = de_init_hw(de); - if (rc) { - printk(KERN_ERR "%s: h/w init failure, err=%d\n", - dev->name, rc); - goto err_out_free; - } + dw32(IntrMask, 0); rc = request_irq(dev->irq, de_interrupt, SA_SHIRQ, dev->name, dev); if (rc) { printk(KERN_ERR "%s: IRQ %d request failure, err=%d\n", dev->name, dev->irq, rc); - goto err_out_hw; + goto err_out_free; + } + + rc = de_init_hw(de); + if (rc) { + printk(KERN_ERR "%s: h/w init failure, err=%d\n", + dev->name, rc); + goto err_out_free_irq; } netif_start_queue(dev); @@ -1395,11 +1396,8 @@ static int de_open (struct net_device *dev) return 0; -err_out_hw: - spin_lock_irqsave(&de->lock, flags); - de_stop_hw(de); - spin_unlock_irqrestore(&de->lock, flags); - +err_out_free_irq: + free_irq(dev->irq, dev); err_out_free: de_free_rings(de); return rc; -- cgit v1.2.3 From 39bf4295bb4bcb0c108f74b72dd2eb5b9b9dfacc Mon Sep 17 00:00:00 2001 From: Francois Romieu Date: Wed, 8 Mar 2006 22:45:52 +0100 Subject: de2104x: fix the TX watchdog Insert de_init_rings() to reinit the rings before de_init_hw() tries to access them again. Signed-off-by: Francois Romieu --- drivers/net/tulip/de2104x.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers') diff --git a/drivers/net/tulip/de2104x.c b/drivers/net/tulip/de2104x.c index 9e9e1fe92914..2d0cfbceee22 100644 --- a/drivers/net/tulip/de2104x.c +++ b/drivers/net/tulip/de2104x.c @@ -1453,6 +1453,8 @@ static void de_tx_timeout (struct net_device *dev) synchronize_irq(dev->irq); de_clean_rings(de); + de_init_rings(de); + de_init_hw(de); netif_wake_queue(dev); -- cgit v1.2.3 From 28a31860191c0d5710d42f85510daac0a3c26a01 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Tue, 7 Mar 2006 11:06:35 -0800 Subject: sky2: not random enough Don't use sky2 to seed random pool beacause the network packet arrival time will not be truly random due to NAPI and interrupt mitigation. Signed-off-by: Stephen Hemminger --- drivers/net/sky2.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index 72c1630977d6..dc4feaf79be2 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c @@ -3243,8 +3243,7 @@ static int __devinit sky2_probe(struct pci_dev *pdev, } } - err = request_irq(pdev->irq, sky2_intr, SA_SHIRQ | SA_SAMPLE_RANDOM, - DRV_NAME, hw); + err = request_irq(pdev->irq, sky2_intr, SA_SHIRQ, DRV_NAME, hw); if (err) { printk(KERN_ERR PFX "%s: cannot assign irq %d\n", pci_name(pdev), pdev->irq); -- cgit v1.2.3 From b19666d92009ad2aa8e12d25f2cab59fb32421eb Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Tue, 7 Mar 2006 11:06:36 -0800 Subject: sky2: force early transmit interrupts Avoid premature transmit ring full conditions. Force a transmit status interrupt if transmit ring gets nearly full and after a TSO send. Allow more entries in transmit ring to be used if dma_addr is 32 bits Signed-off-by: Stephen Hemminger --- drivers/net/sky2.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'drivers') diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index dc4feaf79be2..1078b7cab076 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c @@ -74,7 +74,7 @@ #define TX_RING_SIZE 512 #define TX_DEF_PENDING (TX_RING_SIZE - 1) #define TX_MIN_PENDING 64 -#define MAX_SKB_TX_LE (4 + 2*MAX_SKB_FRAGS) +#define MAX_SKB_TX_LE (4 + (sizeof(dma_addr_t)/sizeof(u32))*MAX_SKB_FRAGS) #define STATUS_RING_SIZE 2048 /* 2 ports * (TX + 2*RX) */ #define STATUS_LE_BYTES (STATUS_RING_SIZE*sizeof(struct sky2_status_le)) @@ -1145,6 +1145,7 @@ static int sky2_xmit_frame(struct sk_buff *skb, struct net_device *dev) struct sky2_tx_le *le = NULL; struct tx_ring_info *re; unsigned i, len; + int avail; dma_addr_t mapping; u32 addr64; u16 mss; @@ -1287,12 +1288,16 @@ static int sky2_xmit_frame(struct sk_buff *skb, struct net_device *dev) re->idx = sky2->tx_prod; le->ctrl |= EOP; + avail = tx_avail(sky2); + if (mss != 0 || avail < TX_MIN_PENDING) { + le->ctrl |= FRC_STAT; + if (avail <= MAX_SKB_TX_LE) + netif_stop_queue(dev); + } + sky2_put_idx(hw, txqaddr[sky2->port], sky2->tx_prod, &sky2->tx_last_put, TX_RING_SIZE); - if (tx_avail(sky2) <= MAX_SKB_TX_LE) - netif_stop_queue(dev); - out_unlock: spin_unlock(&sky2->tx_lock); -- cgit v1.2.3 From 70f1be4812a833ac856818c3149e432ff6a84c2e Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Tue, 7 Mar 2006 11:06:37 -0800 Subject: sky2: truncate oversize packets Turn on truncation to prevent getting choked by frames larger than expected. Without this fix, driver hangs after receiving an oversize packet. Signed-off-by: Stephen Hemminger --- drivers/net/sky2.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'drivers') diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index 1078b7cab076..73260364cba3 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c @@ -622,8 +622,8 @@ static void sky2_mac_init(struct sky2_hw *hw, unsigned port) /* Configure Rx MAC FIFO */ sky2_write8(hw, SK_REG(port, RX_GMF_CTRL_T), GMF_RST_CLR); - sky2_write16(hw, SK_REG(port, RX_GMF_CTRL_T), - GMF_RX_CTRL_DEF); + sky2_write32(hw, SK_REG(port, RX_GMF_CTRL_T), + GMF_OPER_ON | GMF_RX_F_FL_ON); /* Flush Rx MAC FIFO on any flow control or error */ sky2_write16(hw, SK_REG(port, RX_GMF_FL_MSK), GMR_FS_ANY_ERR); @@ -995,6 +995,10 @@ static int sky2_rx_start(struct sky2_port *sky2) sky2_rx_add(sky2, re->mapaddr); } + /* Truncate oversize frames */ + sky2_write16(hw, SK_REG(sky2->port, RX_GMF_TR_THR), sky2->rx_bufsize - 8); + sky2_write32(hw, SK_REG(sky2->port, RX_GMF_CTRL_T), RX_TRUNC_ON); + /* Tell chip about available buffers */ sky2_write16(hw, Y2_QADDR(rxq, PREF_UNIT_PUT_IDX), sky2->rx_put); sky2->rx_last_put = sky2_read16(hw, Y2_QADDR(rxq, PREF_UNIT_PUT_IDX)); @@ -1712,10 +1716,12 @@ static void sky2_tx_timeout(struct net_device *dev) #define roundup(x, y) ((((x)+((y)-1))/(y))*(y)) -/* Want receive buffer size to be multiple of 64 bits, and incl room for vlan */ +/* Want receive buffer size to be multiple of 64 bits + * and incl room for vlan and truncation + */ static inline unsigned sky2_buf_size(int mtu) { - return roundup(mtu + ETH_HLEN + 4, 8); + return roundup(mtu + ETH_HLEN + VLAN_HLEN, 8) + 8; } static int sky2_change_mtu(struct net_device *dev, int new_mtu) @@ -1798,7 +1804,7 @@ static struct sk_buff *sky2_receive(struct sky2_port *sky2, if (!(status & GMR_FS_RX_OK)) goto resubmit; - if ((status >> 16) != length || length > sky2->rx_bufsize) + if (length > sky2->netdev->mtu + ETH_HLEN) goto oversize; if (length < copybreak) { -- cgit v1.2.3 From 435a80f610b2ac38a4b5334a7ae22672de3f06bd Mon Sep 17 00:00:00 2001 From: Doug Warzecha Date: Thu, 9 Mar 2006 17:33:35 -0800 Subject: [PATCH] dcdbas: dcdbas_pdev referenced after platform_device_unregister on exit smi_data_buf_free() references dcdbas_pdev when calling dma_free_coherent(). In dcdbas_exit(), smi_data_buf_free() is called after platform_device_unregister(dcdbas_pdev). This patch moves platform_device_unregister(dcdbas_pdev) after smi_data_buf_free() in dcdbas_exit(). Signed-off-by: Doug Warzecha Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/firmware/dcdbas.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/firmware/dcdbas.c b/drivers/firmware/dcdbas.c index 8ed6ddbb9c5d..4652512f7d1a 100644 --- a/drivers/firmware/dcdbas.c +++ b/drivers/firmware/dcdbas.c @@ -39,7 +39,7 @@ #include "dcdbas.h" #define DRIVER_NAME "dcdbas" -#define DRIVER_VERSION "5.6.0-1" +#define DRIVER_VERSION "5.6.0-2" #define DRIVER_DESCRIPTION "Dell Systems Management Base Driver" static struct platform_device *dcdbas_pdev; @@ -581,9 +581,13 @@ static int __init dcdbas_init(void) */ static void __exit dcdbas_exit(void) { - platform_device_unregister(dcdbas_pdev); + /* + * make sure functions that use dcdbas_pdev are called + * before platform_device_unregister + */ unregister_reboot_notifier(&dcdbas_reboot_nb); smi_data_buf_free(); + platform_device_unregister(dcdbas_pdev); } module_init(dcdbas_init); -- cgit v1.2.3 From 10ad1b7363090c0eec2b4054a5a3b82d2cc09ee5 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Thu, 9 Mar 2006 17:33:36 -0800 Subject: [PATCH] Fix error handling in backlight drivers ERR_PTR() is supposed to be passed a negative value. Signed-off-by: Jean Delvare Signed-off-by: Adrian Bunk Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/video/backlight/backlight.c | 2 +- drivers/video/backlight/lcd.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/video/backlight/backlight.c b/drivers/video/backlight/backlight.c index bd39bbd88d41..151fda8dded0 100644 --- a/drivers/video/backlight/backlight.c +++ b/drivers/video/backlight/backlight.c @@ -172,7 +172,7 @@ struct backlight_device *backlight_device_register(const char *name, void *devda new_bd = kmalloc(sizeof(struct backlight_device), GFP_KERNEL); if (unlikely(!new_bd)) - return ERR_PTR(ENOMEM); + return ERR_PTR(-ENOMEM); init_MUTEX(&new_bd->sem); new_bd->props = bp; diff --git a/drivers/video/backlight/lcd.c b/drivers/video/backlight/lcd.c index 9e32485ee7bb..86908a60c630 100644 --- a/drivers/video/backlight/lcd.c +++ b/drivers/video/backlight/lcd.c @@ -171,7 +171,7 @@ struct lcd_device *lcd_device_register(const char *name, void *devdata, new_ld = kmalloc(sizeof(struct lcd_device), GFP_KERNEL); if (unlikely(!new_ld)) - return ERR_PTR(ENOMEM); + return ERR_PTR(-ENOMEM); init_MUTEX(&new_ld->sem); new_ld->props = lp; -- cgit v1.2.3 From 04b857f74cec5efc7730e9db47e291310f4708a4 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Thu, 9 Mar 2006 17:33:46 -0800 Subject: [PATCH] md: Fix several raid1 bugs which cause a memory leak - wrong test for 'is this a BARRIER bio' - not freeing on all possible paths. - using r1_bio after freeing it. Signed-off-by: Neil Brown Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/md/raid1.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'drivers') diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c index d39f584cd8b3..5d88329e3c7a 100644 --- a/drivers/md/raid1.c +++ b/drivers/md/raid1.c @@ -306,6 +306,7 @@ static int raid1_end_write_request(struct bio *bio, unsigned int bytes_done, int r1bio_t * r1_bio = (r1bio_t *)(bio->bi_private); int mirror, behind = test_bit(R1BIO_BehindIO, &r1_bio->state); conf_t *conf = mddev_to_conf(r1_bio->mddev); + struct bio *to_put = NULL; if (bio->bi_size) return 1; @@ -323,6 +324,7 @@ static int raid1_end_write_request(struct bio *bio, unsigned int bytes_done, int * this branch is our 'one mirror IO has finished' event handler: */ r1_bio->bios[mirror] = NULL; + to_put = bio; if (!uptodate) { md_error(r1_bio->mddev, conf->mirrors[mirror].rdev); /* an I/O failed, we can't clear the bitmap */ @@ -375,7 +377,7 @@ static int raid1_end_write_request(struct bio *bio, unsigned int bytes_done, int /* Don't dec_pending yet, we want to hold * the reference over the retry */ - return 0; + goto out; } if (test_bit(R1BIO_BehindIO, &r1_bio->state)) { /* free extra copy of the data pages */ @@ -392,10 +394,11 @@ static int raid1_end_write_request(struct bio *bio, unsigned int bytes_done, int raid_end_bio_io(r1_bio); } - if (r1_bio->bios[mirror]==NULL) - bio_put(bio); - rdev_dec_pending(conf->mirrors[mirror].rdev, conf->mddev); + out: + if (to_put) + bio_put(to_put); + return 0; } @@ -857,7 +860,7 @@ static int make_request(request_queue_t *q, struct bio * bio) atomic_set(&r1_bio->remaining, 0); atomic_set(&r1_bio->behind_remaining, 0); - do_barriers = bio->bi_rw & BIO_RW_BARRIER; + do_barriers = bio_barrier(bio); if (do_barriers) set_bit(R1BIO_Barrier, &r1_bio->state); -- cgit v1.2.3 From 6a88231fc7da311e4da4ce2011d1a132c80c145a Mon Sep 17 00:00:00 2001 From: Max Asbock Date: Thu, 9 Mar 2006 17:33:48 -0800 Subject: [PATCH] ibmasm: use after free fix The kobject_put() can free the memory at *cmd, but cmd->lock points to a persistent lock that is not freed with cmd. Signed-off-by: Max Asbock Cc: Vernon Mauery Cc: Srihari Vijayaraghavan Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/misc/ibmasm/ibmasm.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'drivers') diff --git a/drivers/misc/ibmasm/ibmasm.h b/drivers/misc/ibmasm/ibmasm.h index 1cef2387fa65..6aba41954448 100644 --- a/drivers/misc/ibmasm/ibmasm.h +++ b/drivers/misc/ibmasm/ibmasm.h @@ -101,15 +101,16 @@ struct command { static inline void command_put(struct command *cmd) { unsigned long flags; + spinlock_t *lock = cmd->lock; - spin_lock_irqsave(cmd->lock, flags); - kobject_put(&cmd->kobj); - spin_unlock_irqrestore(cmd->lock, flags); + spin_lock_irqsave(lock, flags); + kobject_put(&cmd->kobj); + spin_unlock_irqrestore(lock, flags); } static inline void command_get(struct command *cmd) { - kobject_get(&cmd->kobj); + kobject_get(&cmd->kobj); } -- cgit v1.2.3 From 57c432b54bc34f0afacda7d9da0528ee22e78dec Mon Sep 17 00:00:00 2001 From: Tim Small Date: Thu, 9 Mar 2006 17:33:50 -0800 Subject: [PATCH] edac: mark as experimental EDAC is still causing a few problems and the code is relatively green. Mark it as experimental until thing settle down. Also, provide some documentation pointers in Kconfig help. Signed-off-by: Tim Small Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/edac/Kconfig | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'drivers') diff --git a/drivers/edac/Kconfig b/drivers/edac/Kconfig index 18a455651121..52f3eb45d2b9 100644 --- a/drivers/edac/Kconfig +++ b/drivers/edac/Kconfig @@ -6,17 +6,29 @@ # $Id: Kconfig,v 1.4.2.7 2005/07/08 22:05:38 dsp_llnl Exp $ # -menu 'EDAC - error detection and reporting (RAS)' +menu 'EDAC - error detection and reporting (RAS) (EXPERIMENTAL)' config EDAC - tristate "EDAC core system error reporting" - depends on X86 + tristate "EDAC core system error reporting (EXPERIMENTAL)" + depends on X86 && EXPERIMENTAL help EDAC is designed to report errors in the core system. These are low-level errors that are reported in the CPU or supporting chipset: memory errors, cache errors, PCI errors, thermal throttling, etc.. If unsure, select 'Y'. + If this code is reporting problems on your system, please + see the EDAC project web pages for more information at: + + + + and: + + + + There is also a mailing list for the EDAC project, which can + be found via the sourceforge page. + comment "Reporting subsystems" depends on EDAC -- cgit v1.2.3 From b707dbe6c52e143a9afea06aa8f84103135ca873 Mon Sep 17 00:00:00 2001 From: Horst Hummel Date: Thu, 9 Mar 2006 17:33:52 -0800 Subject: [PATCH] s390: dasd proc interface typo This fixes a typo introduced with 90f0094dc607abe384a412bfb7199fb667ab0735. Signed-off-by: Horst Hummel Signed-off-by: Heiko Carstens Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/s390/block/dasd_proc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/s390/block/dasd_proc.c b/drivers/s390/block/dasd_proc.c index 4c1acc8daa82..1aa3c261718a 100644 --- a/drivers/s390/block/dasd_proc.c +++ b/drivers/s390/block/dasd_proc.c @@ -94,7 +94,7 @@ dasd_devices_show(struct seq_file *m, void *v) seq_printf(m, "basic"); break; case DASD_STATE_UNFMT: - seq_printf(m, "unnformatted"); + seq_printf(m, "unformatted"); break; case DASD_STATE_READY: case DASD_STATE_ONLINE: -- cgit v1.2.3 From 4ceadbf519c6820b236a9a213255260eb825974b Mon Sep 17 00:00:00 2001 From: Hugh Dickins Date: Fri, 10 Mar 2006 21:13:44 +0000 Subject: [PATCH] fix pcmcia_device_probe oops Fix pcmcia_device_probe NULL pointer dereference at startup. Signed-off-by: Hugh Dickins Signed-off-by: Linus Torvalds --- drivers/pcmcia/ds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c index 54ad93daca3c..bb96ce1db08c 100644 --- a/drivers/pcmcia/ds.c +++ b/drivers/pcmcia/ds.c @@ -411,7 +411,7 @@ static int pcmcia_device_probe(struct device * dev) * pseudo devices, and if not, add the second one. */ did = (struct pcmcia_device_id *) p_dev->dev.driver_data; - if ((did->match_flags & PCMCIA_DEV_ID_MATCH_DEVICE_NO) && + if (did && (did->match_flags & PCMCIA_DEV_ID_MATCH_DEVICE_NO) && (p_dev->socket->device_count == 1) && (p_dev->device_no == 0)) pcmcia_add_pseudo_device(p_dev->socket); -- cgit v1.2.3 From 8bd0ee93fef9733c72fef1817330b3ee2b71cf9d Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Sat, 11 Mar 2006 00:23:38 -0500 Subject: [PATCH] Input: psmouse - disable autoresync Automatic resynchronization in psmouse driver causes problems on some hardware so disable it by default for now. People with KVM switches that require resync can still enable it via module parameter or sysfs attribute. Signed-off-by: Dmitry Torokhov Signed-off-by: Linus Torvalds --- drivers/input/mouse/psmouse-base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c index 19b1b0121726..ad6217467676 100644 --- a/drivers/input/mouse/psmouse-base.c +++ b/drivers/input/mouse/psmouse-base.c @@ -58,7 +58,7 @@ static unsigned int psmouse_resetafter = 5; module_param_named(resetafter, psmouse_resetafter, uint, 0644); MODULE_PARM_DESC(resetafter, "Reset device after so many bad packets (0 = never)."); -static unsigned int psmouse_resync_time = 5; +static unsigned int psmouse_resync_time; module_param_named(resync_time, psmouse_resync_time, uint, 0644); MODULE_PARM_DESC(resync_time, "How long can mouse stay idle before forcing resync (in seconds, 0 = never)."); -- cgit v1.2.3 From 4136cabff33d6d73b8daf2f2612670cc0296f844 Mon Sep 17 00:00:00 2001 From: Arjan van de Ven Date: Sat, 11 Mar 2006 03:27:15 -0800 Subject: [PATCH] edac: disable a few sysfs files to avoid them becoming an ABI Disable (via ugly #if 0's) the 3 sysfs files that I think by now we all agree are very much wrong. These files shouldn't become part of the ABI by the 2.6.16 release, so I rather have this minimal patch merged to disable them for now, the real fix can then come during the 2.6.17 devel window. Signed-off-by: Arjan van de Ven Signed-off-by: Greg Kroah-Hartman Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/edac/edac_mc.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'drivers') diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c index b10ee4698b1d..262e44544dc8 100644 --- a/drivers/edac/edac_mc.c +++ b/drivers/edac/edac_mc.c @@ -132,11 +132,13 @@ static struct kobject edac_pci_kobj; * /sys/devices/system/edac/mc; * data structures and methods */ +#if 0 static ssize_t memctrl_string_show(void *ptr, char *buffer) { char *value = (char*) ptr; return sprintf(buffer, "%s\n", value); } +#endif static ssize_t memctrl_int_show(void *ptr, char *buffer) { @@ -207,7 +209,9 @@ struct memctrl_dev_attribute attr_##_name = { \ }; /* cwrow attribute f*/ +#if 0 MEMCTRL_STRING_ATTR(mc_version,EDAC_MC_VERSION,S_IRUGO,memctrl_string_show,NULL); +#endif /* csrow control files */ MEMCTRL_ATTR(panic_on_ue,S_IRUGO|S_IWUSR,memctrl_int_show,memctrl_int_store); @@ -222,7 +226,6 @@ static struct memctrl_dev_attribute *memctrl_attr[] = { &attr_log_ue, &attr_log_ce, &attr_poll_msec, - &attr_mc_version, NULL, }; @@ -309,6 +312,8 @@ struct list_control { int *count; }; + +#if 0 /* Output the list as: vendor_id:device:id<,vendor_id:device_id> */ static ssize_t edac_pci_list_string_show(void *ptr, char *buffer) { @@ -430,6 +435,7 @@ static ssize_t edac_pci_list_string_store(void *ptr, const char *buffer, return count; } +#endif static ssize_t edac_pci_int_show(void *ptr, char *buffer) { int *value = ptr; @@ -498,6 +504,7 @@ struct edac_pci_dev_attribute edac_pci_attr_##_name = { \ .store = _store, \ }; +#if 0 static struct list_control pci_whitelist_control = { .list = pci_whitelist, .count = &pci_whitelist_count @@ -520,6 +527,7 @@ EDAC_PCI_STRING_ATTR(pci_parity_blacklist, S_IRUGO|S_IWUSR, edac_pci_list_string_show, edac_pci_list_string_store); +#endif /* PCI Parity control files */ EDAC_PCI_ATTR(check_pci_parity,S_IRUGO|S_IWUSR,edac_pci_int_show,edac_pci_int_store); @@ -531,8 +539,6 @@ static struct edac_pci_dev_attribute *edac_pci_attr[] = { &edac_pci_attr_check_pci_parity, &edac_pci_attr_panic_on_pci_parity, &edac_pci_attr_pci_parity_count, - &edac_pci_attr_pci_parity_whitelist, - &edac_pci_attr_pci_parity_blacklist, NULL, }; -- cgit v1.2.3 From 27d162e26a873883937b64526445877bd3341d23 Mon Sep 17 00:00:00 2001 From: Pat Gefre Date: Sat, 11 Mar 2006 03:27:17 -0800 Subject: [PATCH] Altix: small ioc4 oversight Get rid of the local 'flip' variable and no need to 'trim' the buffer. Signed-off-by: Patrick Gefre Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/serial/ioc4_serial.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'drivers') diff --git a/drivers/serial/ioc4_serial.c b/drivers/serial/ioc4_serial.c index f3763d2ccb86..a37579ce6d76 100644 --- a/drivers/serial/ioc4_serial.c +++ b/drivers/serial/ioc4_serial.c @@ -2301,7 +2301,6 @@ static void receive_chars(struct uart_port *the_port) int read_count, request_count = IOC4_MAX_CHARS; struct uart_icount *icount; struct uart_info *info = the_port->info; - int flip = 0; unsigned long pflags; /* Make sure all the pointers are "good" ones */ @@ -2313,7 +2312,7 @@ static void receive_chars(struct uart_port *the_port) spin_lock_irqsave(&the_port->lock, pflags); tty = info->tty; - request_count = tty_buffer_request_room(tty, IOC4_MAX_CHARS - 2); + request_count = tty_buffer_request_room(tty, IOC4_MAX_CHARS); if (request_count > 0) { icount = &the_port->icount; @@ -2326,8 +2325,7 @@ static void receive_chars(struct uart_port *the_port) spin_unlock_irqrestore(&the_port->lock, pflags); - if (flip) - tty_flip_buffer_push(tty); + tty_flip_buffer_push(tty); } /** -- cgit v1.2.3 From 6af7ffc414828cda880a4e99e20f4f07880281e7 Mon Sep 17 00:00:00 2001 From: "Antonino A. Daplas" Date: Sat, 11 Mar 2006 03:27:20 -0800 Subject: [PATCH] neofb: Fix uninitialized value Remove insignificant and unitialized variable "waitcycles" from neo2200_sync. Coverity Bug 895 Signed-off-by: Antonino Daplas Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/video/neofb.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'drivers') diff --git a/drivers/video/neofb.c b/drivers/video/neofb.c index a2e201dc40f7..b961d5601bd9 100644 --- a/drivers/video/neofb.c +++ b/drivers/video/neofb.c @@ -486,10 +486,8 @@ static void vgaHWRestore(const struct fb_info *info, static inline int neo2200_sync(struct fb_info *info) { struct neofb_par *par = info->par; - int waitcycles; - while (readl(&par->neo2200->bltStat) & 1) - waitcycles++; + while (readl(&par->neo2200->bltStat) & 1); return 0; } -- cgit v1.2.3 From 604cc999fda36d6ff840e03dbc70244d2d17eee2 Mon Sep 17 00:00:00 2001 From: "Antonino A. Daplas" Date: Sat, 11 Mar 2006 03:27:21 -0800 Subject: [PATCH] arcfb: Fix uninitialized value Remove insignificant and uninitialized variable "count" from arcfb_lcd_update_page. Coverity Bug 894 Signed-off-by: Antonino Daplas Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/video/arcfb.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/video/arcfb.c b/drivers/video/arcfb.c index df8e5667b348..0cf26da75b6d 100644 --- a/drivers/video/arcfb.c +++ b/drivers/video/arcfb.c @@ -253,7 +253,7 @@ static void arcfb_lcd_update_page(struct arcfb_par *par, unsigned int upper, { unsigned char *src; unsigned int xindex, yindex, chipindex, linesize; - int i, count; + int i; unsigned char val; unsigned char bitmask, rightshift; @@ -282,7 +282,6 @@ static void arcfb_lcd_update_page(struct arcfb_par *par, unsigned int upper, } ks108_writeb_data(par, chipindex, val); left++; - count++; if (bitmask == 0x80) { bitmask = 1; src++; -- cgit v1.2.3 From 16afe814a856e271628c5dfb4abbc318ec6b6f5f Mon Sep 17 00:00:00 2001 From: "Antonino A. Daplas" Date: Sat, 11 Mar 2006 03:27:22 -0800 Subject: [PATCH] kyrofb: Fix uninitialized value Initialize Variable 'count' in DisableVGA to zero. Coverity Bug 874 Signed-off-by: Antonino Daplas Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/video/kyro/STG4000VTG.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/video/kyro/STG4000VTG.c b/drivers/video/kyro/STG4000VTG.c index 3690b04190af..bd389709d234 100644 --- a/drivers/video/kyro/STG4000VTG.c +++ b/drivers/video/kyro/STG4000VTG.c @@ -17,7 +17,7 @@ void DisableVGA(volatile STG4000REG __iomem *pSTGReg) { u32 tmp; - volatile u32 count, i; + volatile u32 count = 0, i; /* Reset the VGA registers */ tmp = STG_READ_REG(SoftwareReset); -- cgit v1.2.3 From 939205b27312b7d7c4c55624ba785e554b39ecbb Mon Sep 17 00:00:00 2001 From: "Antonino A. Daplas" Date: Sat, 11 Mar 2006 03:27:23 -0800 Subject: [PATCH] arcfb: Fix dereference before NULL check info->par is dereferenced before info is checked for NULL. Fix. Coverity Bug 833 Signed-off-by: Antonino Daplas Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/video/arcfb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/video/arcfb.c b/drivers/video/arcfb.c index 0cf26da75b6d..466042808daf 100644 --- a/drivers/video/arcfb.c +++ b/drivers/video/arcfb.c @@ -459,11 +459,11 @@ static ssize_t arcfb_write(struct file *file, const char __user *buf, size_t cou inode = file->f_dentry->d_inode; fbidx = iminor(inode); info = registered_fb[fbidx]; - par = info->par; if (!info || !info->screen_base) return -ENODEV; + par = info->par; xres = info->var.xres; fbmemlength = (xres * info->var.yres)/8; -- cgit v1.2.3 From 98365f5eb47e23d6ac1244da556984a74260021e Mon Sep 17 00:00:00 2001 From: "Antonino A. Daplas" Date: Sat, 11 Mar 2006 03:27:23 -0800 Subject: [PATCH] s1d13xxxfb: Fix resource leak struct info may not be released in the driver's error path. Coverity Bug 672 Signed-off-by: Antonino Daplas Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/video/s1d13xxxfb.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/video/s1d13xxxfb.c b/drivers/video/s1d13xxxfb.c index e5d0f92eeae3..feec47bdd479 100644 --- a/drivers/video/s1d13xxxfb.c +++ b/drivers/video/s1d13xxxfb.c @@ -588,6 +588,7 @@ s1d13xxxfb_probe(struct platform_device *pdev) goto bail; } + platform_set_drvdata(pdev, info); default_par = info->par; default_par->regs = ioremap_nocache(pdev->resource[1].start, pdev->resource[1].end - pdev->resource[1].start +1); @@ -638,8 +639,6 @@ s1d13xxxfb_probe(struct platform_device *pdev) goto bail; } - platform_set_drvdata(pdev, info); - printk(KERN_INFO "fb%d: %s frame buffer device\n", info->node, info->fix.id); -- cgit v1.2.3 From 91bc89cf98f8aa83c64e14a8939d4f5d0790cf24 Mon Sep 17 00:00:00 2001 From: "Antonino A. Daplas" Date: Sat, 11 Mar 2006 03:27:24 -0800 Subject: [PATCH] imsttfb: Fix resource leak The struct info and device resource may not be released in the driver's error path. Fix. Coverity Bug 671 Signed-off-by: Antonino Daplas Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/video/imsttfb.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'drivers') diff --git a/drivers/video/imsttfb.c b/drivers/video/imsttfb.c index ad416ae47596..7db42542eb19 100644 --- a/drivers/video/imsttfb.c +++ b/drivers/video/imsttfb.c @@ -1510,6 +1510,8 @@ imsttfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent) default: printk(KERN_INFO "imsttfb: Device 0x%x unknown, " "contact maintainer.\n", pdev->device); + release_mem_region(addr, size); + framebuffer_release(info); return -ENODEV; } -- cgit v1.2.3 From 8d57f2210e72e0168734bd1503b9e52a71f53d65 Mon Sep 17 00:00:00 2001 From: "Antonino A. Daplas" Date: Sat, 11 Mar 2006 03:27:25 -0800 Subject: [PATCH] savagefb: Fix kfree before use par->edid is kfree'd before using in fb_edid_to_monspecs() Signed-off-by: Antonino Daplas Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/video/savage/savagefb_driver.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/video/savage/savagefb_driver.c b/drivers/video/savage/savagefb_driver.c index ab727eaa7f43..10e6b3aab9ea 100644 --- a/drivers/video/savage/savagefb_driver.c +++ b/drivers/video/savage/savagefb_driver.c @@ -2021,8 +2021,8 @@ static int __devinit savagefb_probe (struct pci_dev* dev, #if defined(CONFIG_FB_SAVAGE_I2C) savagefb_create_i2c_busses(info); savagefb_probe_i2c_connector(info, &par->edid); - kfree(par->edid); fb_edid_to_monspecs(par->edid, &info->monspecs); + kfree(par->edid); fb_videomode_to_modelist(info->monspecs.modedb, info->monspecs.modedb_len, &info->modelist); -- cgit v1.2.3 From d301524772be3eef5fae1bcd5ca76fac69bb3b6e Mon Sep 17 00:00:00 2001 From: "Antonino A. Daplas" Date: Sat, 11 Mar 2006 03:27:26 -0800 Subject: [PATCH] intelfb: Fix buffer overrun The pseudo_palette has room only for 16 entries, but intelfb_setcolreg will attempt to write more. Coverity Bug 558 Signed-off-by: Antonino Daplas Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/video/intelfb/intelfbdrv.c | 50 ++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 24 deletions(-) (limited to 'drivers') diff --git a/drivers/video/intelfb/intelfbdrv.c b/drivers/video/intelfb/intelfbdrv.c index 6b8bd3cdf9c0..995b47c165a7 100644 --- a/drivers/video/intelfb/intelfbdrv.c +++ b/drivers/video/intelfb/intelfbdrv.c @@ -1333,33 +1333,35 @@ intelfb_setcolreg(unsigned regno, unsigned red, unsigned green, if (regno > 255) return 1; - switch (dinfo->depth) { - case 8: - { - red >>= 8; - green >>= 8; - blue >>= 8; + if (dinfo->depth == 8) { + red >>= 8; + green >>= 8; + blue >>= 8; + + intelfbhw_setcolreg(dinfo, regno, red, green, blue, + transp); + } - intelfbhw_setcolreg(dinfo, regno, red, green, blue, - transp); + if (regno < 16) { + switch (dinfo->depth) { + case 15: + dinfo->pseudo_palette[regno] = ((red & 0xf800) >> 1) | + ((green & 0xf800) >> 6) | + ((blue & 0xf800) >> 11); + break; + case 16: + dinfo->pseudo_palette[regno] = (red & 0xf800) | + ((green & 0xfc00) >> 5) | + ((blue & 0xf800) >> 11); + break; + case 24: + dinfo->pseudo_palette[regno] = ((red & 0xff00) << 8) | + (green & 0xff00) | + ((blue & 0xff00) >> 8); + break; } - break; - case 15: - dinfo->pseudo_palette[regno] = ((red & 0xf800) >> 1) | - ((green & 0xf800) >> 6) | - ((blue & 0xf800) >> 11); - break; - case 16: - dinfo->pseudo_palette[regno] = (red & 0xf800) | - ((green & 0xfc00) >> 5) | - ((blue & 0xf800) >> 11); - break; - case 24: - dinfo->pseudo_palette[regno] = ((red & 0xff00) << 8) | - (green & 0xff00) | - ((blue & 0xff00) >> 8); - break; } + return 0; } -- cgit v1.2.3 From 54243cefdd3ab8133ebe7d3d705f35ca1d0b59eb Mon Sep 17 00:00:00 2001 From: "Antonino A. Daplas" Date: Sat, 11 Mar 2006 03:27:26 -0800 Subject: [PATCH] tdfxfb: Fix buffer overrun The pseudo_palette has room only for 16 entries, but tdfxfb_setcolreg may attempt to write more. Coverity Bug 557 Signed-off-by: Antonino Daplas Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/video/tdfxfb.c | 42 +++++++++++++++++++++++------------------- 1 file changed, 23 insertions(+), 19 deletions(-) (limited to 'drivers') diff --git a/drivers/video/tdfxfb.c b/drivers/video/tdfxfb.c index 3e7baf4c9fa8..5e5328d682db 100644 --- a/drivers/video/tdfxfb.c +++ b/drivers/video/tdfxfb.c @@ -786,28 +786,32 @@ static int tdfxfb_setcolreg(unsigned regno, unsigned red, unsigned green, if (regno >= info->cmap.len || regno > 255) return 1; switch (info->fix.visual) { - case FB_VISUAL_PSEUDOCOLOR: - rgbcol =(((u32)red & 0xff00) << 8) | - (((u32)green & 0xff00) << 0) | - (((u32)blue & 0xff00) >> 8); - do_setpalentry(par, regno, rgbcol); - break; - /* Truecolor has no hardware color palettes. */ - case FB_VISUAL_TRUECOLOR: + case FB_VISUAL_PSEUDOCOLOR: + rgbcol =(((u32)red & 0xff00) << 8) | + (((u32)green & 0xff00) << 0) | + (((u32)blue & 0xff00) >> 8); + do_setpalentry(par, regno, rgbcol); + break; + /* Truecolor has no hardware color palettes. */ + case FB_VISUAL_TRUECOLOR: + if (regno < 16) { rgbcol = (CNVT_TOHW( red, info->var.red.length) << info->var.red.offset) | - (CNVT_TOHW( green, info->var.green.length) << - info->var.green.offset) | - (CNVT_TOHW( blue, info->var.blue.length) << - info->var.blue.offset) | - (CNVT_TOHW( transp, info->var.transp.length) << - info->var.transp.offset); - par->palette[regno] = rgbcol; - break; - default: - DPRINTK("bad depth %u\n", info->var.bits_per_pixel); - break; + (CNVT_TOHW( green, info->var.green.length) << + info->var.green.offset) | + (CNVT_TOHW( blue, info->var.blue.length) << + info->var.blue.offset) | + (CNVT_TOHW( transp, info->var.transp.length) << + info->var.transp.offset); + par->palette[regno] = rgbcol; + } + + break; + default: + DPRINTK("bad depth %u\n", info->var.bits_per_pixel); + break; } + return 0; } -- cgit v1.2.3 From 8e6509876c5cb079f56dbe334aafaae9a293c886 Mon Sep 17 00:00:00 2001 From: "Antonino A. Daplas" Date: Sat, 11 Mar 2006 03:27:27 -0800 Subject: [PATCH] aty128fb: Fix array overrun Fix static array overrun Coverity Bug 556 Signed-off-by: Antonino Daplas Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/video/aty/aty128fb.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'drivers') diff --git a/drivers/video/aty/aty128fb.c b/drivers/video/aty/aty128fb.c index bfc8a93b2c73..620c9a934e0e 100644 --- a/drivers/video/aty/aty128fb.c +++ b/drivers/video/aty/aty128fb.c @@ -1326,7 +1326,7 @@ static int aty128_var_to_pll(u32 period_in_ps, struct aty128_pll *pll, unsigned char post_dividers[] = {1,2,4,8,3,6,12}; u32 output_freq; u32 vclk; /* in .01 MHz */ - int i; + int i = 0; u32 n, d; vclk = 100000000 / period_in_ps; /* convert units to 10 kHz */ @@ -1340,15 +1340,16 @@ static int aty128_var_to_pll(u32 period_in_ps, struct aty128_pll *pll, /* now, find an acceptable divider */ for (i = 0; i < sizeof(post_dividers); i++) { output_freq = post_dividers[i] * vclk; - if (output_freq >= c.ppll_min && output_freq <= c.ppll_max) + if (output_freq >= c.ppll_min && output_freq <= c.ppll_max) { + pll->post_divider = post_dividers[i]; break; + } } /* calculate feedback divider */ n = c.ref_divider * output_freq; d = c.ref_clk; - pll->post_divider = post_dividers[i]; pll->feedback_divider = round_div(n, d); pll->vclk = vclk; -- cgit v1.2.3 From ed62178589929d248a0aaf4018ca3867e2f96d9d Mon Sep 17 00:00:00 2001 From: "Antonino A. Daplas" Date: Sat, 11 Mar 2006 03:27:28 -0800 Subject: [PATCH] radeonfb: Fix static array overrun radeonfb_parse_monitor_layout() will produce an array overrun if passed with a substring of length higher than 4 (ie, "XXXXX,YYYYYY"). Coverity Bug 494 Signed-off-by: Antonino Daplas Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/video/aty/radeon_monitor.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'drivers') diff --git a/drivers/video/aty/radeon_monitor.c b/drivers/video/aty/radeon_monitor.c index 7f9838dceab5..98c05bc0de44 100644 --- a/drivers/video/aty/radeon_monitor.c +++ b/drivers/video/aty/radeon_monitor.c @@ -396,6 +396,10 @@ static int __devinit radeon_parse_monitor_layout(struct radeonfb_info *rinfo, s1[i] = *s; i++; } + + if (i > 4) + i = 4; + } while (*s++); if (second) s2[i] = 0; -- cgit v1.2.3 From 9e927fb6186b6913d47d33068160088a084d568e Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Fri, 10 Mar 2006 18:08:09 -0800 Subject: [PATCH] Wrong return value corrupts free object in e1000 driver For some reason, E1000's ->hard_start_xmit() routine returns -EFAULT instead of one of the NETDEV_TX_* error codes. In fact, it frees up the SKB before returning this. This makes the queueing layer think the packet should be requeued and subsequently we corrupt a freed object. Signed-off-by: David S. Miller Signed-off-by: Jeff Garzik --- drivers/net/e1000/e1000_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index 5b7d0f425af2..4c4db96d0b7b 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c @@ -2917,7 +2917,7 @@ e1000_xmit_frame(struct sk_buff *skb, struct net_device *netdev) if (!__pskb_pull_tail(skb, pull_size)) { printk(KERN_ERR "__pskb_pull_tail failed.\n"); dev_kfree_skb_any(skb); - return -EFAULT; + return NETDEV_TX_OK; } len = skb->len - skb->data_len; } -- cgit v1.2.3 From 9ee09d9cd4f57bae9cd95ea7ae5f41c29a166361 Mon Sep 17 00:00:00 2001 From: Jon Mason Date: Fri, 10 Mar 2006 15:12:10 -0600 Subject: [PATCH] dl2k: DMA freeing error This patch fixes an error in the dl2k driver's DMA mapping/unmapping. The adapter uses the upper 16bits of the DMA address for the buffer size. However, this is not masked off when referencing the DMA address, and can lead to errors by trying to free a DMA address out of range. Thanks, Jon Signed-off-by: Jon Mason Signed-off-by: Jeff Garzik --- drivers/net/dl2k.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) (limited to 'drivers') diff --git a/drivers/net/dl2k.c b/drivers/net/dl2k.c index 430c628279b3..fb9dae302dcc 100644 --- a/drivers/net/dl2k.c +++ b/drivers/net/dl2k.c @@ -50,8 +50,8 @@ */ #define DRV_NAME "D-Link DL2000-based linux driver" -#define DRV_VERSION "v1.17a" -#define DRV_RELDATE "2002/10/04" +#define DRV_VERSION "v1.17b" +#define DRV_RELDATE "2006/03/10" #include "dl2k.h" static char version[] __devinitdata = @@ -765,7 +765,7 @@ rio_free_tx (struct net_device *dev, int irq) break; skb = np->tx_skbuff[entry]; pci_unmap_single (np->pdev, - np->tx_ring[entry].fraginfo, + np->tx_ring[entry].fraginfo & 0xffffffffffff, skb->len, PCI_DMA_TODEVICE); if (irq) dev_kfree_skb_irq (skb); @@ -892,14 +892,16 @@ receive_packet (struct net_device *dev) /* Small skbuffs for short packets */ if (pkt_len > copy_thresh) { - pci_unmap_single (np->pdev, desc->fraginfo, + pci_unmap_single (np->pdev, + desc->fraginfo & 0xffffffffffff, np->rx_buf_sz, PCI_DMA_FROMDEVICE); skb_put (skb = np->rx_skbuff[entry], pkt_len); np->rx_skbuff[entry] = NULL; } else if ((skb = dev_alloc_skb (pkt_len + 2)) != NULL) { pci_dma_sync_single_for_cpu(np->pdev, - desc->fraginfo, + desc->fraginfo & + 0xffffffffffff, np->rx_buf_sz, PCI_DMA_FROMDEVICE); skb->dev = dev; @@ -910,7 +912,8 @@ receive_packet (struct net_device *dev) pkt_len, 0); skb_put (skb, pkt_len); pci_dma_sync_single_for_device(np->pdev, - desc->fraginfo, + desc->fraginfo & + 0xffffffffffff, np->rx_buf_sz, PCI_DMA_FROMDEVICE); } @@ -1796,8 +1799,9 @@ rio_close (struct net_device *dev) np->rx_ring[i].fraginfo = 0; skb = np->rx_skbuff[i]; if (skb) { - pci_unmap_single (np->pdev, np->rx_ring[i].fraginfo, - skb->len, PCI_DMA_FROMDEVICE); + pci_unmap_single(np->pdev, + np->rx_ring[i].fraginfo & 0xffffffffffff, + skb->len, PCI_DMA_FROMDEVICE); dev_kfree_skb (skb); np->rx_skbuff[i] = NULL; } @@ -1805,8 +1809,9 @@ rio_close (struct net_device *dev) for (i = 0; i < TX_RING_SIZE; i++) { skb = np->tx_skbuff[i]; if (skb) { - pci_unmap_single (np->pdev, np->tx_ring[i].fraginfo, - skb->len, PCI_DMA_TODEVICE); + pci_unmap_single(np->pdev, + np->tx_ring[i].fraginfo & 0xffffffffffff, + skb->len, PCI_DMA_TODEVICE); dev_kfree_skb (skb); np->tx_skbuff[i] = NULL; } -- cgit v1.2.3 From 28beaf651b8620b04bc6dec03e22ed5af8114936 Mon Sep 17 00:00:00 2001 From: Jesper Juhl Date: Wed, 8 Mar 2006 00:06:31 -0800 Subject: [PATCH] NE2000 Kconfig help entry improvement Improve reference to PCI NE2K support in ISA NE2K documentation. Original 2.4 patch From: Ged Haywood Signed-off-by: Jesper Juhl Signed-off-by: Andrew Morton Signed-off-by: Jeff Garzik --- drivers/net/Kconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index e45a8f959719..aa633fa95e64 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig @@ -1087,7 +1087,8 @@ config NE2000 without a specific driver are compatible with NE2000. If you have a PCI NE2000 card however, say N here and Y to "PCI - NE2000 support", above. If you have a NE2000 card and are running on + NE2000 and clone support" under "EISA, VLB, PCI and on board + controllers" below. If you have a NE2000 card and are running on an MCA system (a bus system used on some IBM PS/2 computers and laptops), say N here and Y to "NE/2 (ne2000 MCA version) support", below. -- cgit v1.2.3 From b2cba5b5777123c53852639c6a17e87709e055be Mon Sep 17 00:00:00 2001 From: Sam Ravnborg Date: Wed, 8 Mar 2006 00:06:33 -0800 Subject: [PATCH] de620: fix section mismatch warning In latest -mm de620 gave following warning: WARNING: drivers/net/de620.o - Section mismatch: reference to \ .init.text:de620_probe from .text between 'init_module' (at offset \ 0x1682) and 'cleanup_module' init_module() call de620_probe() which is declared __init. Fix is to declare init_module() __init too. Signed-off-by: Sam Ravnborg Signed-off-by: Andrew Morton Signed-off-by: Jeff Garzik --- drivers/net/de620.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/net/de620.c b/drivers/net/de620.c index 0069f5fa973a..22fc5b869a60 100644 --- a/drivers/net/de620.c +++ b/drivers/net/de620.c @@ -1012,7 +1012,7 @@ static int __init read_eeprom(struct net_device *dev) #ifdef MODULE static struct net_device *de620_dev; -int init_module(void) +int __init init_module(void) { de620_dev = de620_probe(-1); if (IS_ERR(de620_dev)) -- cgit v1.2.3 From 0992a5d029181421877a716eaf99145828ff7eae Mon Sep 17 00:00:00 2001 From: Andrew Morton Date: Wed, 8 Mar 2006 00:06:27 -0800 Subject: [PATCH] 3c509: bus registration fix - Don't call eisa_driver_unregister() if eisa_driver_register() failed. - Properly propagate error values. Signed-off-by: Andrew Morton Signed-off-by: Jeff Garzik --- drivers/net/3c509.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'drivers') diff --git a/drivers/net/3c509.c b/drivers/net/3c509.c index 824e430486c2..830528dce0ca 100644 --- a/drivers/net/3c509.c +++ b/drivers/net/3c509.c @@ -1574,6 +1574,7 @@ MODULE_LICENSE("GPL"); static int __init el3_init_module(void) { + int ret = 0; el3_cards = 0; if (debug >= 0) @@ -1589,14 +1590,16 @@ static int __init el3_init_module(void) } #ifdef CONFIG_EISA - if (eisa_driver_register (&el3_eisa_driver) < 0) { - eisa_driver_unregister (&el3_eisa_driver); - } + ret = eisa_driver_register(&el3_eisa_driver); #endif #ifdef CONFIG_MCA - mca_register_driver(&el3_mca_driver); + { + int err = mca_register_driver(&el3_mca_driver); + if (ret == 0) + ret = err; + } #endif - return 0; + return ret; } static void __exit el3_cleanup_module(void) -- cgit v1.2.3 From 6971ed1fbbc80cae54e082aae153d5b063885d0a Mon Sep 17 00:00:00 2001 From: Tejun Heo Date: Sat, 11 Mar 2006 12:47:54 +0900 Subject: [PATCH] ahci: fix NULL pointer dereference detected by Coverity Fix NULL pointer dereference detected by the Coverity checker. Kill dev -> pdev -> dev conversion while at it. Signed-off-by: Tejun Heo Cc: Adrian Bunk Signed-off-by: Jeff Garzik --- drivers/scsi/ahci.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'drivers') diff --git a/drivers/scsi/ahci.c b/drivers/scsi/ahci.c index a800fb51168b..559ff7aae3f1 100644 --- a/drivers/scsi/ahci.c +++ b/drivers/scsi/ahci.c @@ -742,23 +742,17 @@ static irqreturn_t ahci_interrupt (int irq, void *dev_instance, struct pt_regs * struct ata_queued_cmd *qc; qc = ata_qc_from_tag(ap, ap->active_tag); if (!ahci_host_intr(ap, qc)) - if (ata_ratelimit()) { - struct pci_dev *pdev = - to_pci_dev(ap->host_set->dev); - dev_printk(KERN_WARNING, &pdev->dev, + if (ata_ratelimit()) + dev_printk(KERN_WARNING, host_set->dev, "unhandled interrupt on port %u\n", i); - } VPRINTK("port %u\n", i); } else { VPRINTK("port %u (no irq)\n", i); - if (ata_ratelimit()) { - struct pci_dev *pdev = - to_pci_dev(ap->host_set->dev); - dev_printk(KERN_WARNING, &pdev->dev, + if (ata_ratelimit()) + dev_printk(KERN_WARNING, host_set->dev, "interrupt on disabled port %u\n", i); - } } irq_ack |= (1 << i); -- cgit v1.2.3 From 8f22757ee84da64d4f662f1dd03dae95358a1efe Mon Sep 17 00:00:00 2001 From: Dave Jones Date: Sat, 11 Mar 2006 18:49:13 -0800 Subject: [TUN]: Fix leak in tun_get_user() We're leaking an skb in a failure path in this function. Coverity #632 Signed-off-by: Dave Jones Signed-off-by: David S. Miller --- drivers/net/tun.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 50b8c6754b1e..a1ed2d983740 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -249,8 +249,11 @@ static __inline__ ssize_t tun_get_user(struct tun_struct *tun, struct iovec *iv, if (align) skb_reserve(skb, align); - if (memcpy_fromiovec(skb_put(skb, len), iv, len)) + if (memcpy_fromiovec(skb_put(skb, len), iv, len)) { + tun->stats.rx_dropped++; + kfree_skb(skb); return -EFAULT; + } skb->dev = tun->dev; switch (tun->flags & TUN_TYPE_MASK) { -- cgit v1.2.3 From 0ade309be739eceedc4812798da09d698a59867d Mon Sep 17 00:00:00 2001 From: Adrian Bunk Date: Sat, 11 Mar 2006 18:49:38 -0800 Subject: [TG3] tg3_bus_string(): remove dead code The Coverity checker spotted this dead code (note that (clock_ctrl == 7) is already handled above). Signed-off-by: Adrian Bunk Signed-off-by: David S. Miller --- drivers/net/tg3.c | 2 -- 1 file changed, 2 deletions(-) (limited to 'drivers') diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index 15545620ab0e..b8f1524da557 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c @@ -10543,8 +10543,6 @@ static char * __devinit tg3_bus_string(struct tg3 *tp, char *str) strcat(str, "66MHz"); else if (clock_ctrl == 6) strcat(str, "100MHz"); - else if (clock_ctrl == 7) - strcat(str, "133MHz"); } else { strcpy(str, "PCI:"); if (tp->tg3_flags & TG3_FLAG_PCI_HIGH_SPEED) -- cgit v1.2.3 From 3cb4f09fc2e98bbf26f8c900a94bf3910cd4d823 Mon Sep 17 00:00:00 2001 From: David Brownell Date: Mon, 13 Mar 2006 21:20:40 -0800 Subject: [PATCH] mtd_dataflash, fix block vs page erase Fix a bug in the block-erase optimization for Dataflash; it was using block erase even for smaller segments that need page erase. That wouldn't matter for JFFS2, which never erases less than one block (sometimes several blocks), but for other callers it might. Signed-off-by: David Brownell Acked-by: David Woodhouse Acked-by: Thomas Gleixner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/mtd/devices/mtd_dataflash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/mtd/devices/mtd_dataflash.c b/drivers/mtd/devices/mtd_dataflash.c index 155737e7483f..a19480d07888 100644 --- a/drivers/mtd/devices/mtd_dataflash.c +++ b/drivers/mtd/devices/mtd_dataflash.c @@ -178,7 +178,7 @@ static int dataflash_erase(struct mtd_info *mtd, struct erase_info *instr) * we're at a block boundary and need to erase the whole block. */ pageaddr = instr->addr / priv->page_size; - do_block = (pageaddr & 0x7) == 0 && instr->len <= blocksize; + do_block = (pageaddr & 0x7) == 0 && instr->len >= blocksize; pageaddr = pageaddr << priv->page_offset; command[0] = do_block ? OP_ERASE_BLOCK : OP_ERASE_PAGE; -- cgit v1.2.3 From 6acaba8e22bb355409e06d9e7ce4e7bef1bcaa04 Mon Sep 17 00:00:00 2001 From: Michael Hunold Date: Mon, 13 Mar 2006 21:20:41 -0800 Subject: [PATCH] Restore tuning capabilities in V4L2 MXB driver The behaviour of the all-in-one Video4Linux tuner driver apparently changed. It now wants to know the tv standard, otherwise it refuses to tune. Restore tuning functionality in my driver for the "Multimedia eXtension Board". The all-in-one tuner driver apparently changed its behaviour. Signed-off-by: Michael Hunold Cc: Mauro Carvalho Chehab Cc: Johannes Stezenbach Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/media/video/mxb.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/media/video/mxb.c b/drivers/media/video/mxb.c index 8416ceff524b..41715cacf926 100644 --- a/drivers/media/video/mxb.c +++ b/drivers/media/video/mxb.c @@ -1,7 +1,7 @@ /* mxb - v4l2 driver for the Multimedia eXtension Board - Copyright (C) 1998-2003 Michael Hunold + Copyright (C) 1998-2006 Michael Hunold Visit http://www.mihu.de/linux/saa7146/mxb/ for further details about this card. @@ -327,6 +327,7 @@ static int mxb_init_done(struct saa7146_dev* dev) struct video_decoder_init init; struct i2c_msg msg; struct tuner_setup tun_setup; + v4l2_std_id std = V4L2_STD_PAL_BG; int i = 0, err = 0; struct tea6415c_multiplex vm; @@ -361,6 +362,9 @@ static int mxb_init_done(struct saa7146_dev* dev) mxb->tuner->driver->command(mxb->tuner, VIDIOC_S_FREQUENCY, &mxb->cur_freq); + /* set a default video standard */ + mxb->tuner->driver->command(mxb->tuner, VIDIOC_S_STD, &std); + /* mute audio on tea6420s */ mxb->tea6420_1->driver->command(mxb->tea6420_1,TEA6420_SWITCH, &TEA6420_line[6][0]); mxb->tea6420_2->driver->command(mxb->tea6420_2,TEA6420_SWITCH, &TEA6420_line[6][1]); @@ -921,17 +925,21 @@ static int std_callback(struct saa7146_dev* dev, struct saa7146_standard *std) int one = 1; if(V4L2_STD_PAL_I == std->id ) { + v4l2_std_id std = V4L2_STD_PAL_I; DEB_D(("VIDIOC_S_STD: setting mxb for PAL_I.\n")); /* set the 7146 gpio register -- I don't know what this does exactly */ saa7146_write(dev, GPIO_CTRL, 0x00404050); /* unset the 7111 gpio register -- I don't know what this does exactly */ mxb->saa7111a->driver->command(mxb->saa7111a,DECODER_SET_GPIO, &zero); + mxb->tuner->driver->command(mxb->tuner, VIDIOC_S_STD, &std); } else { + v4l2_std_id std = V4L2_STD_PAL_BG; DEB_D(("VIDIOC_S_STD: setting mxb for PAL/NTSC/SECAM.\n")); /* set the 7146 gpio register -- I don't know what this does exactly */ saa7146_write(dev, GPIO_CTRL, 0x00404050); /* set the 7111 gpio register -- I don't know what this does exactly */ mxb->saa7111a->driver->command(mxb->saa7111a,DECODER_SET_GPIO, &one); + mxb->tuner->driver->command(mxb->tuner, VIDIOC_S_STD, &std); } return 0; } -- cgit v1.2.3 From 63e1fd41c7127650d355e7db7dd92890edf5523b Mon Sep 17 00:00:00 2001 From: Benjamin Herrenschmidt Date: Mon, 13 Mar 2006 21:20:42 -0800 Subject: [PATCH] macintosh: correct AC Power info in /proc/pmu/info Report AC Power present in /proc/pmu/info if there is no battery. Signed-off-by: Olaf Hering Signed-off-by: Benjamin Herrenschmidt , Cc: Paul Mackerras Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/macintosh/via-pmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers') diff --git a/drivers/macintosh/via-pmu.c b/drivers/macintosh/via-pmu.c index 6eb93e45fcd3..4a478eb0e27d 100644 --- a/drivers/macintosh/via-pmu.c +++ b/drivers/macintosh/via-pmu.c @@ -825,7 +825,7 @@ proc_get_info(char *page, char **start, off_t off, p += sprintf(p, "PMU driver version : %d\n", PMU_DRIVER_VERSION); p += sprintf(p, "PMU firmware version : %02x\n", pmu_version); p += sprintf(p, "AC Power : %d\n", - ((pmu_power_flags & PMU_PWR_AC_PRESENT) != 0)); + ((pmu_power_flags & PMU_PWR_AC_PRESENT) != 0) || pmu_battery_count == 0); p += sprintf(p, "Battery count : %d\n", pmu_battery_count); return p - page; -- cgit v1.2.3 From ceb2ca9cb0bfd885127fa9a2c27127b3fe1c8f28 Mon Sep 17 00:00:00 2001 From: Dave Peterson Date: Mon, 13 Mar 2006 21:20:50 -0800 Subject: [PATCH] EDAC: disable sysfs interface - Disable the EDAC sysfs code. The sysfs interface that EDAC presents to user space needs more thought, and is likely to change substantially. Therefore disable it for now so users don't start depending on it in its current form. - Disable the default behavior of calling panic() when an uncorrectible error is detected (since for now, there is no sysfs interface that allows the user to configure this behavior). Signed-off-by: David S. Peterson Cc: Greg KH Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/edac/edac_mc.c | 44 ++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 2 deletions(-) (limited to 'drivers') diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c index 262e44544dc8..9c205274c1cb 100644 --- a/drivers/edac/edac_mc.c +++ b/drivers/edac/edac_mc.c @@ -38,6 +38,12 @@ #define EDAC_MC_VERSION "edac_mc Ver: 2.0.0 " __DATE__ +/* For now, disable the EDAC sysfs code. The sysfs interface that EDAC + * presents to user space needs more thought, and is likely to change + * substantially. + */ +#define DISABLE_EDAC_SYSFS + #ifdef CONFIG_EDAC_DEBUG /* Values of 0 to 4 will generate output */ int edac_debug_level = 1; @@ -47,7 +53,7 @@ EXPORT_SYMBOL(edac_debug_level); /* EDAC Controls, setable by module parameter, and sysfs */ static int log_ue = 1; static int log_ce = 1; -static int panic_on_ue = 1; +static int panic_on_ue; static int poll_msec = 1000; static int check_pci_parity = 0; /* default YES check PCI parity */ @@ -77,6 +83,8 @@ static int pci_whitelist_count ; /* START sysfs data and methods */ +#ifndef DISABLE_EDAC_SYSFS + static const char *mem_types[] = { [MEM_EMPTY] = "Empty", [MEM_RESERVED] = "Reserved", @@ -241,6 +249,7 @@ static struct kobj_type ktype_memctrl = { .default_attrs = (struct attribute **) memctrl_attr, }; +#endif /* DISABLE_EDAC_SYSFS */ /* Initialize the main sysfs entries for edac: * /sys/devices/system/edac @@ -251,6 +260,11 @@ static struct kobj_type ktype_memctrl = { * !0 FAILURE */ static int edac_sysfs_memctrl_setup(void) +#ifdef DISABLE_EDAC_SYSFS +{ + return 0; +} +#else { int err=0; @@ -283,6 +297,7 @@ static int edac_sysfs_memctrl_setup(void) return err; } +#endif /* DISABLE_EDAC_SYSFS */ /* * MC teardown: @@ -290,6 +305,7 @@ static int edac_sysfs_memctrl_setup(void) */ static void edac_sysfs_memctrl_teardown(void) { +#ifndef DISABLE_EDAC_SYSFS debugf0("MC: " __FILE__ ": %s()\n", __func__); /* Unregister the MC's kobject */ @@ -300,8 +316,11 @@ static void edac_sysfs_memctrl_teardown(void) /* Unregister the 'edac' object */ sysdev_class_unregister(&edac_class); +#endif /* DISABLE_EDAC_SYSFS */ } +#ifndef DISABLE_EDAC_SYSFS + /* * /sys/devices/system/edac/pci; * data structures and methods @@ -554,11 +573,18 @@ static struct kobj_type ktype_edac_pci = { .default_attrs = (struct attribute **) edac_pci_attr, }; +#endif /* DISABLE_EDAC_SYSFS */ + /** * edac_sysfs_pci_setup() * */ static int edac_sysfs_pci_setup(void) +#ifdef DISABLE_EDAC_SYSFS +{ + return 0; +} +#else { int err; @@ -582,16 +608,20 @@ static int edac_sysfs_pci_setup(void) } return err; } - +#endif /* DISABLE_EDAC_SYSFS */ static void edac_sysfs_pci_teardown(void) { +#ifndef DISABLE_EDAC_SYSFS debugf0("MC: " __FILE__ ": %s()\n", __func__); kobject_unregister(&edac_pci_kobj); kobject_put(&edac_pci_kobj); +#endif } +#ifndef DISABLE_EDAC_SYSFS + /* EDAC sysfs CSROW data structures and methods */ /* Set of more detailed csrow attribute show/store functions */ @@ -1045,6 +1075,8 @@ static struct kobj_type ktype_mci = { .default_attrs = (struct attribute **) mci_attr, }; +#endif /* DISABLE_EDAC_SYSFS */ + #define EDAC_DEVICE_SYMLINK "device" /* @@ -1056,6 +1088,11 @@ static struct kobj_type ktype_mci = { * !0 Failure */ static int edac_create_sysfs_mci_device(struct mem_ctl_info *mci) +#ifdef DISABLE_EDAC_SYSFS +{ + return 0; +} +#else { int i; int err; @@ -1124,12 +1161,14 @@ fail: return err; } +#endif /* DISABLE_EDAC_SYSFS */ /* * remove a Memory Controller instance */ static void edac_remove_sysfs_mci_device(struct mem_ctl_info *mci) { +#ifndef DISABLE_EDAC_SYSFS int i; debugf0("MC: " __FILE__ ": %s()\n", __func__); @@ -1146,6 +1185,7 @@ static void edac_remove_sysfs_mci_device(struct mem_ctl_info *mci) kobject_unregister(&mci->edac_mci_kobj); kobject_put(&mci->edac_mci_kobj); +#endif /* DISABLE_EDAC_SYSFS */ } /* END OF sysfs data and methods */ -- cgit v1.2.3