From 76da0e05cf66d1a9eda868f354254a59993c8714 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Fri, 5 Jan 2007 09:17:56 +0100 Subject: [PATCH] --- yaml --- r: 45611 b: refs/heads/master c: 2e45785c529e0c60b1801b4fabacb05e0b8cdf87 h: refs/heads/master i: 45609: 2beae202f6da522597127674098555774737b1fd 45607: 03d68558bc49e199b25a1165d092328e0c98fde7 v: v3 --- [refs] | 2 +- trunk/Documentation/DocBook/libata.tmpl | 2 +- trunk/drivers/ata/libata-eh.c | 4 - trunk/drivers/ata/sata_mv.c | 5 +- trunk/drivers/ata/sata_via.c | 1 - trunk/drivers/net/8139cp.c | 7 +- trunk/drivers/net/myri10ge/myri10ge.c | 23 +-- trunk/drivers/net/sis190.c | 2 +- trunk/drivers/net/ucc_geth.c | 12 +- trunk/drivers/net/ucc_geth_phy.c | 134 +++++++++--------- .../net/wireless/bcm43xx/bcm43xx_main.c | 11 +- trunk/drivers/pci/quirks.c | 5 + trunk/drivers/usb/core/Kconfig | 16 +++ trunk/drivers/usb/core/hub.c | 9 +- trunk/drivers/usb/host/ohci-ep93xx.c | 2 +- trunk/drivers/usb/input/hid-core.c | 4 - trunk/drivers/usb/input/usbtouchscreen.c | 98 +++++-------- trunk/drivers/usb/net/asix.c | 18 +-- trunk/drivers/usb/net/rndis_host.c | 23 ++- trunk/drivers/usb/serial/option.c | 3 - trunk/drivers/usb/storage/unusual_devs.h | 19 --- trunk/fs/ocfs2/export.c | 5 +- trunk/fs/ocfs2/inode.c | 11 +- trunk/fs/ocfs2/namei.c | 69 +++++---- trunk/fs/ocfs2/ocfs2_fs.h | 43 +----- trunk/fs/ocfs2/symlink.c | 3 +- trunk/include/linux/libata.h | 1 - 27 files changed, 220 insertions(+), 312 deletions(-) diff --git a/[refs] b/[refs] index 8a87750db930..460c99d6656b 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 39470bf24d93927bb27929b9f0d52ff5d608cfcb +refs/heads/master: 2e45785c529e0c60b1801b4fabacb05e0b8cdf87 diff --git a/trunk/Documentation/DocBook/libata.tmpl b/trunk/Documentation/DocBook/libata.tmpl index e2e24b4778d4..07a635590b36 100644 --- a/trunk/Documentation/DocBook/libata.tmpl +++ b/trunk/Documentation/DocBook/libata.tmpl @@ -883,7 +883,7 @@ and other resources, etc. - ATA errors and exceptions + ATA errors & exceptions This chapter tries to identify what error/exception conditions exist diff --git a/trunk/drivers/ata/libata-eh.c b/trunk/drivers/ata/libata-eh.c index 56cf59b60ec4..08ad44b3e48f 100644 --- a/trunk/drivers/ata/libata-eh.c +++ b/trunk/drivers/ata/libata-eh.c @@ -1979,10 +1979,6 @@ static int ata_eh_recover(struct ata_port *ap, ata_prereset_fn_t prereset, ehc->tries[dev->devno] = ATA_EH_DEV_TRIES; - /* collect port action mask recorded in dev actions */ - ehc->i.action |= ehc->i.dev_action[i] & ~ATA_EH_PERDEV_MASK; - ehc->i.dev_action[i] &= ATA_EH_PERDEV_MASK; - /* process hotplug request */ if (dev->flags & ATA_DFLAG_DETACH) ata_eh_detach_dev(dev); diff --git a/trunk/drivers/ata/sata_mv.c b/trunk/drivers/ata/sata_mv.c index aae0b5201c1e..1b8e0eb9e032 100644 --- a/trunk/drivers/ata/sata_mv.c +++ b/trunk/drivers/ata/sata_mv.c @@ -523,7 +523,8 @@ static const struct ata_port_info mv_port_info[] = { }, { /* chip_7042 */ .sht = &mv_sht, - .flags = (MV_COMMON_FLAGS | MV_6XXX_FLAGS), + .flags = (MV_COMMON_FLAGS | MV_6XXX_FLAGS | + MV_FLAG_DUAL_HC), .pio_mask = 0x1f, /* pio0-4 */ .udma_mask = 0x7f, /* udma0-6 */ .port_ops = &mv_iie_ops, @@ -544,8 +545,6 @@ static const struct pci_device_id mv_pci_tbl[] = { { PCI_VDEVICE(ADAPTEC2, 0x0241), chip_604x }, - { PCI_VDEVICE(TTI, 0x2310), chip_7042 }, - { } /* terminate list */ }; diff --git a/trunk/drivers/ata/sata_via.c b/trunk/drivers/ata/sata_via.c index 88f0565c8883..1c7f19aecc25 100644 --- a/trunk/drivers/ata/sata_via.c +++ b/trunk/drivers/ata/sata_via.c @@ -77,7 +77,6 @@ static void svia_scr_write (struct ata_port *ap, unsigned int sc_reg, u32 val); static void vt6420_error_handler(struct ata_port *ap); static const struct pci_device_id svia_pci_tbl[] = { - { PCI_VDEVICE(VIA, 0x5337), vt6420 }, { PCI_VDEVICE(VIA, 0x0591), vt6420 }, { PCI_VDEVICE(VIA, 0x3149), vt6420 }, { PCI_VDEVICE(VIA, 0x3249), vt6421 }, diff --git a/trunk/drivers/net/8139cp.c b/trunk/drivers/net/8139cp.c index 6f93a765e564..e2cb19b582a1 100644 --- a/trunk/drivers/net/8139cp.c +++ b/trunk/drivers/net/8139cp.c @@ -765,18 +765,17 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev) struct cp_private *cp = netdev_priv(dev); unsigned entry; u32 eor, flags; - unsigned long intr_flags; #if CP_VLAN_TAG_USED u32 vlan_tag = 0; #endif int mss = 0; - spin_lock_irqsave(&cp->lock, intr_flags); + spin_lock_irq(&cp->lock); /* This is a hard error, log it. */ if (TX_BUFFS_AVAIL(cp) <= (skb_shinfo(skb)->nr_frags + 1)) { netif_stop_queue(dev); - spin_unlock_irqrestore(&cp->lock, intr_flags); + spin_unlock_irq(&cp->lock); printk(KERN_ERR PFX "%s: BUG! Tx Ring full when queue awake!\n", dev->name); return 1; @@ -909,7 +908,7 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev) if (TX_BUFFS_AVAIL(cp) <= (MAX_SKB_FRAGS + 1)) netif_stop_queue(dev); - spin_unlock_irqrestore(&cp->lock, intr_flags); + spin_unlock_irq(&cp->lock); cpw8(TxPoll, NormalTxPoll); dev->trans_start = jiffies; diff --git a/trunk/drivers/net/myri10ge/myri10ge.c b/trunk/drivers/net/myri10ge/myri10ge.c index 61cbd4a60446..07cf574197e5 100644 --- a/trunk/drivers/net/myri10ge/myri10ge.c +++ b/trunk/drivers/net/myri10ge/myri10ge.c @@ -71,7 +71,7 @@ #include "myri10ge_mcp.h" #include "myri10ge_mcp_gen_header.h" -#define MYRI10GE_VERSION_STR "1.2.0" +#define MYRI10GE_VERSION_STR "1.1.0" MODULE_DESCRIPTION("Myricom 10G driver (10GbE)"); MODULE_AUTHOR("Maintainer: help@myri.com"); @@ -274,10 +274,6 @@ static int myri10ge_fill_thresh = 256; module_param(myri10ge_fill_thresh, int, S_IRUGO | S_IWUSR); MODULE_PARM_DESC(myri10ge_fill_thresh, "Number of empty rx slots allowed\n"); -static int myri10ge_wcfifo = 1; -module_param(myri10ge_wcfifo, int, S_IRUGO); -MODULE_PARM_DESC(myri10ge_wcfifo, "Enable WC Fifo when WC is enabled\n"); - #define MYRI10GE_FW_OFFSET 1024*1024 #define MYRI10GE_HIGHPART_TO_U32(X) \ (sizeof (X) == 8) ? ((u32)((u64)(X) >> 32)) : (0) @@ -1718,7 +1714,7 @@ static int myri10ge_open(struct net_device *dev) goto abort_with_irq; } - if (myri10ge_wcfifo && mgp->mtrr >= 0) { + if (mgp->mtrr >= 0) { mgp->tx.wc_fifo = (u8 __iomem *) mgp->sram + MXGEFW_ETH_SEND_4; mgp->rx_small.wc_fifo = (u8 __iomem *) mgp->sram + MXGEFW_ETH_RECV_SMALL; @@ -2882,6 +2878,7 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent) netdev->hard_start_xmit = myri10ge_xmit; netdev->get_stats = myri10ge_get_stats; netdev->base_addr = mgp->iomem_base; + netdev->irq = pdev->irq; netdev->change_mtu = myri10ge_change_mtu; netdev->set_multicast_list = myri10ge_set_multicast_list; netdev->set_mac_address = myri10ge_set_mac_address; @@ -2891,15 +2888,6 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent) netdev->poll = myri10ge_poll; netdev->weight = myri10ge_napi_weight; - /* make sure we can get an irq, and that MSI can be - * setup (if available). Also ensure netdev->irq - * is set to correct value if MSI is enabled */ - status = myri10ge_request_irq(mgp); - if (status != 0) - goto abort_with_firmware; - netdev->irq = pdev->irq; - myri10ge_free_irq(mgp); - /* Save configuration space to be restored if the * nic resets due to a parity error */ pci_save_state(pdev); @@ -2915,9 +2903,8 @@ static int myri10ge_probe(struct pci_dev *pdev, const struct pci_device_id *ent) dev_err(&pdev->dev, "register_netdev failed: %d\n", status); goto abort_with_state; } - dev_info(dev, "%s IRQ %d, tx bndry %d, fw %s, WC %s\n", - (mgp->msi_enabled ? "MSI" : "xPIC"), - netdev->irq, mgp->tx.boundary, mgp->fw_name, + dev_info(dev, "%d, tx bndry %d, fw %s, WC %s\n", + pdev->irq, mgp->tx.boundary, mgp->fw_name, (mgp->mtrr >= 0 ? "Enabled" : "Disabled")); return 0; diff --git a/trunk/drivers/net/sis190.c b/trunk/drivers/net/sis190.c index 45d91b159100..b70ed79d4121 100644 --- a/trunk/drivers/net/sis190.c +++ b/trunk/drivers/net/sis190.c @@ -1562,7 +1562,7 @@ static int __devinit sis190_get_mac_addr_from_eeprom(struct pci_dev *pdev, for (i = 0; i < MAC_ADDR_LEN / 2; i++) { __le16 w = sis190_read_eeprom(ioaddr, EEPROMMACAddr + i); - ((u16 *)dev->dev_addr)[i] = le16_to_cpu(w); + ((u16 *)dev->dev_addr)[0] = le16_to_cpu(w); } sis190_set_rgmii(tp, sis190_read_eeprom(ioaddr, EEPROMInfo)); diff --git a/trunk/drivers/net/ucc_geth.c b/trunk/drivers/net/ucc_geth.c index 7e4b23c7c1ba..8243150f5b05 100644 --- a/trunk/drivers/net/ucc_geth.c +++ b/trunk/drivers/net/ucc_geth.c @@ -29,7 +29,6 @@ #include #include #include -#include #include #include @@ -473,7 +472,7 @@ static void put_enet_addr_container(struct enet_addr_container *enet_addr_cont) kfree(enet_addr_cont); } -static void set_mac_addr(__be16 __iomem *reg, u8 *mac) +static int set_mac_addr(__be16 __iomem *reg, u8 *mac) { out_be16(®[0], ((u16)mac[5] << 8) | mac[4]); out_be16(®[1], ((u16)mac[3] << 8) | mac[2]); @@ -3921,11 +3920,10 @@ static irqreturn_t phy_interrupt(int irq, void *dev_id) } /* Scheduled by the phy_interrupt/timer to handle PHY changes */ -static void ugeth_phy_change(struct work_struct *work) +static void ugeth_phy_change(void *data) { - struct ucc_geth_private *ugeth = - container_of(work, struct ucc_geth_private, tq); - struct net_device *dev = ugeth->dev; + struct net_device *dev = (struct net_device *)data; + struct ucc_geth_private *ugeth = netdev_priv(dev); struct ucc_geth *ug_regs; int result = 0; @@ -4082,7 +4080,7 @@ static int ucc_geth_open(struct net_device *dev) #endif /* CONFIG_UGETH_NAPI */ /* Set up the PHY change work queue */ - INIT_WORK(&ugeth->tq, ugeth_phy_change); + INIT_WORK(&ugeth->tq, ugeth_phy_change, dev); init_timer(&ugeth->phy_info_timer); ugeth->phy_info_timer.function = &ugeth_phy_startup_timer; diff --git a/trunk/drivers/net/ucc_geth_phy.c b/trunk/drivers/net/ucc_geth_phy.c index 3c86592ce03c..5360ec05eaa3 100644 --- a/trunk/drivers/net/ucc_geth_phy.c +++ b/trunk/drivers/net/ucc_geth_phy.c @@ -68,31 +68,8 @@ static int gbit_config_aneg(struct ugeth_mii_info *mii_info); static int genmii_config_aneg(struct ugeth_mii_info *mii_info); static int genmii_update_link(struct ugeth_mii_info *mii_info); static int genmii_read_status(struct ugeth_mii_info *mii_info); - -static u16 ucc_geth_phy_read(struct ugeth_mii_info *mii_info, u16 regnum) -{ - u16 retval; - unsigned long flags; - - ugphy_vdbg("%s: IN", __FUNCTION__); - - spin_lock_irqsave(&mii_info->mdio_lock, flags); - retval = mii_info->mdio_read(mii_info->dev, mii_info->mii_id, regnum); - spin_unlock_irqrestore(&mii_info->mdio_lock, flags); - - return retval; -} - -static void ucc_geth_phy_write(struct ugeth_mii_info *mii_info, u16 regnum, u16 val) -{ - unsigned long flags; - - ugphy_vdbg("%s: IN", __FUNCTION__); - - spin_lock_irqsave(&mii_info->mdio_lock, flags); - mii_info->mdio_write(mii_info->dev, mii_info->mii_id, regnum, val); - spin_unlock_irqrestore(&mii_info->mdio_lock, flags); -} +u16 phy_read(struct ugeth_mii_info *mii_info, u16 regnum); +void phy_write(struct ugeth_mii_info *mii_info, u16 regnum, u16 val); /* Write value to the PHY for this device to the register at regnum, */ /* waiting until the write is done before it returns. All PHY */ @@ -207,7 +184,7 @@ static void config_genmii_advert(struct ugeth_mii_info *mii_info) advertise = mii_info->advertising; /* Setup standard advertisement */ - adv = ucc_geth_phy_read(mii_info, MII_ADVERTISE); + adv = phy_read(mii_info, MII_ADVERTISE); adv &= ~(ADVERTISE_ALL | ADVERTISE_100BASE4); if (advertise & ADVERTISED_10baseT_Half) adv |= ADVERTISE_10HALF; @@ -217,7 +194,7 @@ static void config_genmii_advert(struct ugeth_mii_info *mii_info) adv |= ADVERTISE_100HALF; if (advertise & ADVERTISED_100baseT_Full) adv |= ADVERTISE_100FULL; - ucc_geth_phy_write(mii_info, MII_ADVERTISE, adv); + phy_write(mii_info, MII_ADVERTISE, adv); } static void genmii_setup_forced(struct ugeth_mii_info *mii_info) @@ -227,7 +204,7 @@ static void genmii_setup_forced(struct ugeth_mii_info *mii_info) ugphy_vdbg("%s: IN", __FUNCTION__); - ctrl = ucc_geth_phy_read(mii_info, MII_BMCR); + ctrl = phy_read(mii_info, MII_BMCR); ctrl &= ~(BMCR_FULLDPLX | BMCR_SPEED100 | BMCR_SPEED1000 | BMCR_ANENABLE); @@ -257,7 +234,7 @@ static void genmii_setup_forced(struct ugeth_mii_info *mii_info) break; } - ucc_geth_phy_write(mii_info, MII_BMCR, ctrl); + phy_write(mii_info, MII_BMCR, ctrl); } /* Enable and Restart Autonegotiation */ @@ -267,9 +244,9 @@ static void genmii_restart_aneg(struct ugeth_mii_info *mii_info) ugphy_vdbg("%s: IN", __FUNCTION__); - ctl = ucc_geth_phy_read(mii_info, MII_BMCR); + ctl = phy_read(mii_info, MII_BMCR); ctl |= (BMCR_ANENABLE | BMCR_ANRESTART); - ucc_geth_phy_write(mii_info, MII_BMCR, ctl); + phy_write(mii_info, MII_BMCR, ctl); } static int gbit_config_aneg(struct ugeth_mii_info *mii_info) @@ -284,14 +261,14 @@ static int gbit_config_aneg(struct ugeth_mii_info *mii_info) config_genmii_advert(mii_info); advertise = mii_info->advertising; - adv = ucc_geth_phy_read(mii_info, MII_1000BASETCONTROL); + adv = phy_read(mii_info, MII_1000BASETCONTROL); adv &= ~(MII_1000BASETCONTROL_FULLDUPLEXCAP | MII_1000BASETCONTROL_HALFDUPLEXCAP); if (advertise & SUPPORTED_1000baseT_Half) adv |= MII_1000BASETCONTROL_HALFDUPLEXCAP; if (advertise & SUPPORTED_1000baseT_Full) adv |= MII_1000BASETCONTROL_FULLDUPLEXCAP; - ucc_geth_phy_write(mii_info, MII_1000BASETCONTROL, adv); + phy_write(mii_info, MII_1000BASETCONTROL, adv); /* Start/Restart aneg */ genmii_restart_aneg(mii_info); @@ -321,10 +298,10 @@ static int genmii_update_link(struct ugeth_mii_info *mii_info) ugphy_vdbg("%s: IN", __FUNCTION__); /* Do a fake read */ - ucc_geth_phy_read(mii_info, MII_BMSR); + phy_read(mii_info, MII_BMSR); /* Read link and autonegotiation status */ - status = ucc_geth_phy_read(mii_info, MII_BMSR); + status = phy_read(mii_info, MII_BMSR); if ((status & BMSR_LSTATUS) == 0) mii_info->link = 0; else @@ -352,7 +329,7 @@ static int genmii_read_status(struct ugeth_mii_info *mii_info) return err; if (mii_info->autoneg) { - status = ucc_geth_phy_read(mii_info, MII_LPA); + status = phy_read(mii_info, MII_LPA); if (status & (LPA_10FULL | LPA_100FULL)) mii_info->duplex = DUPLEX_FULL; @@ -375,9 +352,9 @@ static int marvell_init(struct ugeth_mii_info *mii_info) { ugphy_vdbg("%s: IN", __FUNCTION__); - ucc_geth_phy_write(mii_info, 0x14, 0x0cd2); - ucc_geth_phy_write(mii_info, MII_BMCR, - ucc_geth_phy_read(mii_info, MII_BMCR) | BMCR_RESET); + phy_write(mii_info, 0x14, 0x0cd2); + phy_write(mii_info, MII_BMCR, + phy_read(mii_info, MII_BMCR) | BMCR_RESET); msleep(4000); return 0; @@ -390,13 +367,13 @@ static int marvell_config_aneg(struct ugeth_mii_info *mii_info) /* The Marvell PHY has an errata which requires * that certain registers get written in order * to restart autonegotiation */ - ucc_geth_phy_write(mii_info, MII_BMCR, BMCR_RESET); + phy_write(mii_info, MII_BMCR, BMCR_RESET); - ucc_geth_phy_write(mii_info, 0x1d, 0x1f); - ucc_geth_phy_write(mii_info, 0x1e, 0x200c); - ucc_geth_phy_write(mii_info, 0x1d, 0x5); - ucc_geth_phy_write(mii_info, 0x1e, 0); - ucc_geth_phy_write(mii_info, 0x1e, 0x100); + phy_write(mii_info, 0x1d, 0x1f); + phy_write(mii_info, 0x1e, 0x200c); + phy_write(mii_info, 0x1d, 0x5); + phy_write(mii_info, 0x1e, 0); + phy_write(mii_info, 0x1e, 0x100); gbit_config_aneg(mii_info); @@ -421,7 +398,7 @@ static int marvell_read_status(struct ugeth_mii_info *mii_info) * are as set */ if (mii_info->autoneg && mii_info->link) { int speed; - status = ucc_geth_phy_read(mii_info, MII_M1011_PHY_SPEC_STATUS); + status = phy_read(mii_info, MII_M1011_PHY_SPEC_STATUS); /* Get the duplexity */ if (status & MII_M1011_PHY_SPEC_STATUS_FULLDUPLEX) @@ -453,7 +430,7 @@ static int marvell_ack_interrupt(struct ugeth_mii_info *mii_info) ugphy_vdbg("%s: IN", __FUNCTION__); /* Clear the interrupts by reading the reg */ - ucc_geth_phy_read(mii_info, MII_M1011_IEVENT); + phy_read(mii_info, MII_M1011_IEVENT); return 0; } @@ -463,9 +440,9 @@ static int marvell_config_intr(struct ugeth_mii_info *mii_info) ugphy_vdbg("%s: IN", __FUNCTION__); if (mii_info->interrupts == MII_INTERRUPT_ENABLED) - ucc_geth_phy_write(mii_info, MII_M1011_IMASK, MII_M1011_IMASK_INIT); + phy_write(mii_info, MII_M1011_IMASK, MII_M1011_IMASK_INIT); else - ucc_geth_phy_write(mii_info, MII_M1011_IMASK, MII_M1011_IMASK_CLEAR); + phy_write(mii_info, MII_M1011_IMASK, MII_M1011_IMASK_CLEAR); return 0; } @@ -474,9 +451,9 @@ static int cis820x_init(struct ugeth_mii_info *mii_info) { ugphy_vdbg("%s: IN", __FUNCTION__); - ucc_geth_phy_write(mii_info, MII_CIS8201_AUX_CONSTAT, + phy_write(mii_info, MII_CIS8201_AUX_CONSTAT, MII_CIS8201_AUXCONSTAT_INIT); - ucc_geth_phy_write(mii_info, MII_CIS8201_EXT_CON1, MII_CIS8201_EXTCON1_INIT); + phy_write(mii_info, MII_CIS8201_EXT_CON1, MII_CIS8201_EXTCON1_INIT); return 0; } @@ -500,7 +477,7 @@ static int cis820x_read_status(struct ugeth_mii_info *mii_info) if (mii_info->autoneg && mii_info->link) { int speed; - status = ucc_geth_phy_read(mii_info, MII_CIS8201_AUX_CONSTAT); + status = phy_read(mii_info, MII_CIS8201_AUX_CONSTAT); if (status & MII_CIS8201_AUXCONSTAT_DUPLEX) mii_info->duplex = DUPLEX_FULL; else @@ -528,7 +505,7 @@ static int cis820x_ack_interrupt(struct ugeth_mii_info *mii_info) { ugphy_vdbg("%s: IN", __FUNCTION__); - ucc_geth_phy_read(mii_info, MII_CIS8201_ISTAT); + phy_read(mii_info, MII_CIS8201_ISTAT); return 0; } @@ -538,9 +515,9 @@ static int cis820x_config_intr(struct ugeth_mii_info *mii_info) ugphy_vdbg("%s: IN", __FUNCTION__); if (mii_info->interrupts == MII_INTERRUPT_ENABLED) - ucc_geth_phy_write(mii_info, MII_CIS8201_IMASK, MII_CIS8201_IMASK_MASK); + phy_write(mii_info, MII_CIS8201_IMASK, MII_CIS8201_IMASK_MASK); else - ucc_geth_phy_write(mii_info, MII_CIS8201_IMASK, 0); + phy_write(mii_info, MII_CIS8201_IMASK, 0); return 0; } @@ -564,7 +541,7 @@ static int dm9161_read_status(struct ugeth_mii_info *mii_info) /* If we aren't autonegotiating, assume speeds * are as set */ if (mii_info->autoneg && mii_info->link) { - status = ucc_geth_phy_read(mii_info, MII_DM9161_SCSR); + status = phy_read(mii_info, MII_DM9161_SCSR); if (status & (MII_DM9161_SCSR_100F | MII_DM9161_SCSR_100H)) mii_info->speed = SPEED_100; else @@ -595,7 +572,7 @@ static void dm9161_timer(unsigned long data) { struct ugeth_mii_info *mii_info = (struct ugeth_mii_info *)data; struct dm9161_private *priv = mii_info->priv; - u16 status = ucc_geth_phy_read(mii_info, MII_BMSR); + u16 status = phy_read(mii_info, MII_BMSR); ugphy_vdbg("%s: IN", __FUNCTION__); @@ -622,11 +599,11 @@ static int dm9161_init(struct ugeth_mii_info *mii_info) /* Reset is not done yet */ priv->resetdone = 0; - ucc_geth_phy_write(mii_info, MII_BMCR, - ucc_geth_phy_read(mii_info, MII_BMCR) | BMCR_RESET); + phy_write(mii_info, MII_BMCR, + phy_read(mii_info, MII_BMCR) | BMCR_RESET); - ucc_geth_phy_write(mii_info, MII_BMCR, - ucc_geth_phy_read(mii_info, MII_BMCR) & ~BMCR_ISOLATE); + phy_write(mii_info, MII_BMCR, + phy_read(mii_info, MII_BMCR) & ~BMCR_ISOLATE); config_genmii_advert(mii_info); /* Start/Restart aneg */ @@ -657,7 +634,7 @@ static int dm9161_ack_interrupt(struct ugeth_mii_info *mii_info) ugphy_vdbg("%s: IN", __FUNCTION__); /* Clear the interrupts by reading the reg */ - ucc_geth_phy_read(mii_info, MII_DM9161_INTR); + phy_read(mii_info, MII_DM9161_INTR); return 0; @@ -668,9 +645,9 @@ static int dm9161_config_intr(struct ugeth_mii_info *mii_info) ugphy_vdbg("%s: IN", __FUNCTION__); if (mii_info->interrupts == MII_INTERRUPT_ENABLED) - ucc_geth_phy_write(mii_info, MII_DM9161_INTR, MII_DM9161_INTR_INIT); + phy_write(mii_info, MII_DM9161_INTR, MII_DM9161_INTR_INIT); else - ucc_geth_phy_write(mii_info, MII_DM9161_INTR, MII_DM9161_INTR_STOP); + phy_write(mii_info, MII_DM9161_INTR, MII_DM9161_INTR_STOP); return 0; } @@ -741,6 +718,31 @@ static struct phy_info *phy_info[] = { NULL }; +u16 phy_read(struct ugeth_mii_info *mii_info, u16 regnum) +{ + u16 retval; + unsigned long flags; + + ugphy_vdbg("%s: IN", __FUNCTION__); + + spin_lock_irqsave(&mii_info->mdio_lock, flags); + retval = mii_info->mdio_read(mii_info->dev, mii_info->mii_id, regnum); + spin_unlock_irqrestore(&mii_info->mdio_lock, flags); + + return retval; +} + +void phy_write(struct ugeth_mii_info *mii_info, u16 regnum, u16 val) +{ + unsigned long flags; + + ugphy_vdbg("%s: IN", __FUNCTION__); + + spin_lock_irqsave(&mii_info->mdio_lock, flags); + mii_info->mdio_write(mii_info->dev, mii_info->mii_id, regnum, val); + spin_unlock_irqrestore(&mii_info->mdio_lock, flags); +} + /* Use the PHY ID registers to determine what type of PHY is attached * to device dev. return a struct phy_info structure describing that PHY */ @@ -755,11 +757,11 @@ struct phy_info *get_phy_info(struct ugeth_mii_info *mii_info) ugphy_vdbg("%s: IN", __FUNCTION__); /* Grab the bits from PHYIR1, and put them in the upper half */ - phy_reg = ucc_geth_phy_read(mii_info, MII_PHYSID1); + phy_reg = phy_read(mii_info, MII_PHYSID1); phy_ID = (phy_reg & 0xffff) << 16; /* Grab the bits from PHYIR2, and put them in the lower half */ - phy_reg = ucc_geth_phy_read(mii_info, MII_PHYSID2); + phy_reg = phy_read(mii_info, MII_PHYSID2); phy_ID |= (phy_reg & 0xffff); /* loop through all the known PHY types, and find one that */ diff --git a/trunk/drivers/net/wireless/bcm43xx/bcm43xx_main.c b/trunk/drivers/net/wireless/bcm43xx/bcm43xx_main.c index 91b752e3d07e..2ec2e5afce67 100644 --- a/trunk/drivers/net/wireless/bcm43xx/bcm43xx_main.c +++ b/trunk/drivers/net/wireless/bcm43xx/bcm43xx_main.c @@ -2701,8 +2701,8 @@ static int bcm43xx_probe_cores(struct bcm43xx_private *bcm) sb_id_hi = bcm43xx_read32(bcm, BCM43xx_CIR_SB_ID_HI); /* extract core_id, core_rev, core_vendor */ - core_id = (sb_id_hi & 0x8FF0) >> 4; - core_rev = ((sb_id_hi & 0xF) | ((sb_id_hi & 0x7000) >> 8)); + core_id = (sb_id_hi & 0xFFF0) >> 4; + core_rev = (sb_id_hi & 0xF); core_vendor = (sb_id_hi & 0xFFFF0000) >> 16; dprintk(KERN_INFO PFX "Core %d: ID 0x%x, rev 0x%x, vendor 0x%x\n", @@ -2873,10 +2873,7 @@ static int bcm43xx_wireless_core_init(struct bcm43xx_private *bcm, sbimconfiglow = bcm43xx_read32(bcm, BCM43xx_CIR_SBIMCONFIGLOW); sbimconfiglow &= ~ BCM43xx_SBIMCONFIGLOW_REQUEST_TOUT_MASK; sbimconfiglow &= ~ BCM43xx_SBIMCONFIGLOW_SERVICE_TOUT_MASK; - if (bcm->bustype == BCM43xx_BUSTYPE_PCI) - sbimconfiglow |= 0x32; - else - sbimconfiglow |= 0x53; + sbimconfiglow |= 0x32; bcm43xx_write32(bcm, BCM43xx_CIR_SBIMCONFIGLOW, sbimconfiglow); } @@ -3080,7 +3077,7 @@ static int bcm43xx_setup_backplane_pci_connection(struct bcm43xx_private *bcm, if (err) goto out; - if (bcm->current_core->rev < 6 && + if (bcm->current_core->rev < 6 || bcm->current_core->id == BCM43xx_COREID_PCI) { value = bcm43xx_read32(bcm, BCM43xx_CIR_SBINTVEC); value |= (1 << backplane_flag_nr); diff --git a/trunk/drivers/pci/quirks.c b/trunk/drivers/pci/quirks.c index 0a70943f8bb6..ef882a8a094e 100644 --- a/trunk/drivers/pci/quirks.c +++ b/trunk/drivers/pci/quirks.c @@ -1002,6 +1002,11 @@ static void __init asus_hides_smbus_hostbridge(struct pci_dev *dev) case 0x186a: /* M6Ne notebook */ asus_hides_smbus = 1; } + if (dev->device == PCI_DEVICE_ID_INTEL_82865_HB) + switch (dev->subsystem_device) { + case 0x80f2: /* P4P800-X */ + asus_hides_smbus = 1; + } if (dev->device == PCI_DEVICE_ID_INTEL_82915GM_HB) { switch (dev->subsystem_device) { case 0x1882: /* M6V notebook */ diff --git a/trunk/drivers/usb/core/Kconfig b/trunk/drivers/usb/core/Kconfig index 3e66b2a9974a..f8324d8d06ac 100644 --- a/trunk/drivers/usb/core/Kconfig +++ b/trunk/drivers/usb/core/Kconfig @@ -72,6 +72,22 @@ config USB_SUSPEND If you are unsure about this, say N here. +config USB_MULTITHREAD_PROBE + bool "USB Multi-threaded probe (EXPERIMENTAL)" + depends on USB && EXPERIMENTAL + default n + help + Say Y here if you want the USB core to spawn a new thread for + every USB device that is probed. This can cause a small speedup + in boot times on systems with a lot of different USB devices. + + This option should be safe to enable, but if any odd probing + problems are found, please disable it, or dynamically turn it + off in the /sys/module/usbcore/parameters/multithread_probe + file + + When in doubt, say N. + config USB_OTG bool depends on USB && EXPERIMENTAL diff --git a/trunk/drivers/usb/core/hub.c b/trunk/drivers/usb/core/hub.c index 1988224b362b..2651c2e2a89f 100644 --- a/trunk/drivers/usb/core/hub.c +++ b/trunk/drivers/usb/core/hub.c @@ -88,7 +88,14 @@ static DECLARE_WAIT_QUEUE_HEAD(khubd_wait); static struct task_struct *khubd_task; /* multithreaded probe logic */ -static int multithread_probe = 0; +static int multithread_probe = +#ifdef CONFIG_USB_MULTITHREAD_PROBE + 1; +#else + 0; +#endif +module_param(multithread_probe, bool, S_IRUGO); +MODULE_PARM_DESC(multithread_probe, "Run each USB device probe in a new thread"); /* cycle leds on hubs that aren't blinking for attention */ static int blinkenlights = 0; diff --git a/trunk/drivers/usb/host/ohci-ep93xx.c b/trunk/drivers/usb/host/ohci-ep93xx.c index 3348b07f0fe5..43ae696b2ec2 100644 --- a/trunk/drivers/usb/host/ohci-ep93xx.c +++ b/trunk/drivers/usb/host/ohci-ep93xx.c @@ -169,7 +169,7 @@ static int ohci_hcd_ep93xx_drv_remove(struct platform_device *pdev) static int ohci_hcd_ep93xx_drv_suspend(struct platform_device *pdev, pm_message_t state) { struct usb_hcd *hcd = platform_get_drvdata(pdev); - struct ohci_hcd *ohci = hcd_to_ohci(hcd); + struct ochi_hcd *ohci = hcd_to_ohci(hcd); if (time_before(jiffies, ohci->next_statechange)) msleep(5); diff --git a/trunk/drivers/usb/input/hid-core.c b/trunk/drivers/usb/input/hid-core.c index ea3636d96e1b..6e739efee6f7 100644 --- a/trunk/drivers/usb/input/hid-core.c +++ b/trunk/drivers/usb/input/hid-core.c @@ -796,9 +796,6 @@ void usbhid_init_reports(struct hid_device *hid) #define USB_VENDOR_ID_LOGITECH 0x046d #define USB_DEVICE_ID_LOGITECH_USB_RECEIVER 0xc101 -#define USB_VENDOR_ID_IMATION 0x0718 -#define USB_DEVICE_ID_DISC_STAKKA 0xd000 - /* * Alphabetically sorted blacklist by quirk type. */ @@ -886,7 +883,6 @@ static const struct hid_blacklist { { USB_VENDOR_ID_GTCO_IPANEL_1, USB_DEVICE_ID_GTCO_10, HID_QUIRK_IGNORE }, { USB_VENDOR_ID_GTCO_IPANEL_2, USB_DEVICE_ID_GTCO_8, HID_QUIRK_IGNORE }, { USB_VENDOR_ID_GTCO_IPANEL_2, USB_DEVICE_ID_GTCO_d, HID_QUIRK_IGNORE }, - { USB_VENDOR_ID_IMATION, USB_DEVICE_ID_DISC_STAKKA, HID_QUIRK_IGNORE }, { USB_VENDOR_ID_KBGEAR, USB_DEVICE_ID_KBGEAR_JAMSTUDIO, HID_QUIRK_IGNORE }, { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_CASSY, HID_QUIRK_IGNORE }, { USB_VENDOR_ID_LD, USB_DEVICE_ID_LD_POCKETCASSY, HID_QUIRK_IGNORE }, diff --git a/trunk/drivers/usb/input/usbtouchscreen.c b/trunk/drivers/usb/input/usbtouchscreen.c index 86e37a20f8e5..7f3c57da9bc0 100644 --- a/trunk/drivers/usb/input/usbtouchscreen.c +++ b/trunk/drivers/usb/input/usbtouchscreen.c @@ -66,7 +66,7 @@ struct usbtouch_device_info { void (*process_pkt) (struct usbtouch_usb *usbtouch, unsigned char *pkt, int len); int (*get_pkt_len) (unsigned char *pkt, int len); - int (*read_data) (struct usbtouch_usb *usbtouch, unsigned char *pkt); + int (*read_data) (unsigned char *pkt, int *x, int *y, int *touch, int *press); int (*init) (struct usbtouch_usb *usbtouch); }; @@ -85,9 +85,6 @@ struct usbtouch_usb { struct usbtouch_device_info *type; char name[128]; char phys[64]; - - int x, y; - int touch, press; }; @@ -164,14 +161,14 @@ static struct usb_device_id usbtouch_devices[] = { #define EGALAX_PKT_TYPE_REPT 0x80 #define EGALAX_PKT_TYPE_DIAG 0x0A -static int egalax_read_data(struct usbtouch_usb *dev, unsigned char *pkt) +static int egalax_read_data(unsigned char *pkt, int *x, int *y, int *touch, int *press) { if ((pkt[0] & EGALAX_PKT_TYPE_MASK) != EGALAX_PKT_TYPE_REPT) return 0; - dev->x = ((pkt[3] & 0x0F) << 7) | (pkt[4] & 0x7F); - dev->y = ((pkt[1] & 0x0F) << 7) | (pkt[2] & 0x7F); - dev->touch = pkt[0] & 0x01; + *x = ((pkt[3] & 0x0F) << 7) | (pkt[4] & 0x7F); + *y = ((pkt[1] & 0x0F) << 7) | (pkt[2] & 0x7F); + *touch = pkt[0] & 0x01; return 1; } @@ -198,11 +195,11 @@ static int egalax_get_pkt_len(unsigned char *buf, int len) * PanJit Part */ #ifdef CONFIG_USB_TOUCHSCREEN_PANJIT -static int panjit_read_data(struct usbtouch_usb *dev, unsigned char *pkt) +static int panjit_read_data(unsigned char *pkt, int *x, int *y, int *touch, int *press) { - dev->x = ((pkt[2] & 0x0F) << 8) | pkt[1]; - dev->y = ((pkt[4] & 0x0F) << 8) | pkt[3]; - dev->touch = pkt[0] & 0x01; + *x = ((pkt[2] & 0x0F) << 8) | pkt[1]; + *y = ((pkt[4] & 0x0F) << 8) | pkt[3]; + *touch = pkt[0] & 0x01; return 1; } @@ -218,11 +215,11 @@ static int panjit_read_data(struct usbtouch_usb *dev, unsigned char *pkt) #define MTOUCHUSB_RESET 7 #define MTOUCHUSB_REQ_CTRLLR_ID 10 -static int mtouch_read_data(struct usbtouch_usb *dev, unsigned char *pkt) +static int mtouch_read_data(unsigned char *pkt, int *x, int *y, int *touch, int *press) { - dev->x = (pkt[8] << 8) | pkt[7]; - dev->y = (pkt[10] << 8) | pkt[9]; - dev->touch = (pkt[2] & 0x40) ? 1 : 0; + *x = (pkt[8] << 8) | pkt[7]; + *y = (pkt[10] << 8) | pkt[9]; + *touch = (pkt[2] & 0x40) ? 1 : 0; return 1; } @@ -263,32 +260,14 @@ static int mtouch_init(struct usbtouch_usb *usbtouch) * ITM Part */ #ifdef CONFIG_USB_TOUCHSCREEN_ITM -static int itm_read_data(struct usbtouch_usb *dev, unsigned char *pkt) +static int itm_read_data(unsigned char *pkt, int *x, int *y, int *touch, int *press) { - int touch; - /* - * ITM devices report invalid x/y data if not touched. - * if the screen was touched before but is not touched any more - * report touch as 0 with the last valid x/y data once. then stop - * reporting data until touched again. - */ - dev->press = ((pkt[2] & 0x01) << 7) | (pkt[5] & 0x7F); - - touch = ~pkt[7] & 0x20; - if (!touch) { - if (dev->touch) { - dev->touch = 0; - return 1; - } + *x = ((pkt[0] & 0x1F) << 7) | (pkt[3] & 0x7F); + *y = ((pkt[1] & 0x1F) << 7) | (pkt[4] & 0x7F); + *press = ((pkt[2] & 0x01) << 7) | (pkt[5] & 0x7F); + *touch = ~pkt[7] & 0x20; - return 0; - } - - dev->x = ((pkt[0] & 0x1F) << 7) | (pkt[3] & 0x7F); - dev->y = ((pkt[1] & 0x1F) << 7) | (pkt[4] & 0x7F); - dev->touch = touch; - - return 1; + return *touch; } #endif @@ -297,7 +276,7 @@ static int itm_read_data(struct usbtouch_usb *dev, unsigned char *pkt) * eTurboTouch part */ #ifdef CONFIG_USB_TOUCHSCREEN_ETURBO -static int eturbo_read_data(struct usbtouch_usb *dev, unsigned char *pkt) +static int eturbo_read_data(unsigned char *pkt, int *x, int *y, int *touch, int *press) { unsigned int shift; @@ -306,9 +285,9 @@ static int eturbo_read_data(struct usbtouch_usb *dev, unsigned char *pkt) return 0; shift = (6 - (pkt[0] & 0x03)); - dev->x = ((pkt[3] << 7) | pkt[4]) >> shift; - dev->y = ((pkt[1] << 7) | pkt[2]) >> shift; - dev->touch = (pkt[0] & 0x10) ? 1 : 0; + *x = ((pkt[3] << 7) | pkt[4]) >> shift; + *y = ((pkt[1] << 7) | pkt[2]) >> shift; + *touch = (pkt[0] & 0x10) ? 1 : 0; return 1; } @@ -328,14 +307,14 @@ static int eturbo_get_pkt_len(unsigned char *buf, int len) * Gunze part */ #ifdef CONFIG_USB_TOUCHSCREEN_GUNZE -static int gunze_read_data(struct usbtouch_usb *dev, unsigned char *pkt) +static int gunze_read_data(unsigned char *pkt, int *x, int *y, int *touch, int *press) { if (!(pkt[0] & 0x80) || ((pkt[1] | pkt[2] | pkt[3]) & 0x80)) return 0; - dev->x = ((pkt[0] & 0x1F) << 7) | (pkt[2] & 0x7F); - dev->y = ((pkt[1] & 0x1F) << 7) | (pkt[3] & 0x7F); - dev->touch = pkt[0] & 0x20; + *x = ((pkt[0] & 0x1F) << 7) | (pkt[2] & 0x7F); + *y = ((pkt[1] & 0x1F) << 7) | (pkt[3] & 0x7F); + *touch = pkt[0] & 0x20; return 1; } @@ -404,11 +383,11 @@ static int dmc_tsc10_init(struct usbtouch_usb *usbtouch) } -static int dmc_tsc10_read_data(struct usbtouch_usb *dev, unsigned char *pkt) +static int dmc_tsc10_read_data(unsigned char *pkt, int *x, int *y, int *touch, int *press) { - dev->x = ((pkt[2] & 0x03) << 8) | pkt[1]; - dev->y = ((pkt[4] & 0x03) << 8) | pkt[3]; - dev->touch = pkt[0] & 0x01; + *x = ((pkt[2] & 0x03) << 8) | pkt[1]; + *y = ((pkt[4] & 0x03) << 8) | pkt[3]; + *touch = pkt[0] & 0x01; return 1; } @@ -513,22 +492,23 @@ static struct usbtouch_device_info usbtouch_dev_info[] = { static void usbtouch_process_pkt(struct usbtouch_usb *usbtouch, unsigned char *pkt, int len) { + int x, y, touch, press; struct usbtouch_device_info *type = usbtouch->type; - if (!type->read_data(usbtouch, pkt)) + if (!type->read_data(pkt, &x, &y, &touch, &press)) return; - input_report_key(usbtouch->input, BTN_TOUCH, usbtouch->touch); + input_report_key(usbtouch->input, BTN_TOUCH, touch); if (swap_xy) { - input_report_abs(usbtouch->input, ABS_X, usbtouch->y); - input_report_abs(usbtouch->input, ABS_Y, usbtouch->x); + input_report_abs(usbtouch->input, ABS_X, y); + input_report_abs(usbtouch->input, ABS_Y, x); } else { - input_report_abs(usbtouch->input, ABS_X, usbtouch->x); - input_report_abs(usbtouch->input, ABS_Y, usbtouch->y); + input_report_abs(usbtouch->input, ABS_X, x); + input_report_abs(usbtouch->input, ABS_Y, y); } if (type->max_press) - input_report_abs(usbtouch->input, ABS_PRESSURE, usbtouch->press); + input_report_abs(usbtouch->input, ABS_PRESSURE, press); input_sync(usbtouch->input); } diff --git a/trunk/drivers/usb/net/asix.c b/trunk/drivers/usb/net/asix.c index 896449f0cf85..f538013965b0 100644 --- a/trunk/drivers/usb/net/asix.c +++ b/trunk/drivers/usb/net/asix.c @@ -898,7 +898,7 @@ static int ax88772_link_reset(struct usbnet *dev) static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf) { - int ret, embd_phy; + int ret; void *buf; u16 rx_ctl; struct asix_data *data = (struct asix_data *)&dev->data; @@ -919,15 +919,13 @@ static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf) AX_GPIO_RSE | AX_GPIO_GPO_2 | AX_GPIO_GPO2EN, 5)) < 0) goto out2; - /* 0x10 is the phy id of the embedded 10/100 ethernet phy */ - embd_phy = ((asix_get_phy_addr(dev) & 0x1f) == 0x10 ? 1 : 0); if ((ret = asix_write_cmd(dev, AX_CMD_SW_PHY_SELECT, - embd_phy, 0, 0, buf)) < 0) { + 1, 0, 0, buf)) < 0) { dbg("Select PHY #1 failed: %d", ret); goto out2; } - if ((ret = asix_sw_reset(dev, AX_SWRESET_IPPD | AX_SWRESET_PRL)) < 0) + if ((ret = asix_sw_reset(dev, AX_SWRESET_IPPD)) < 0) goto out2; msleep(150); @@ -935,14 +933,8 @@ static int ax88772_bind(struct usbnet *dev, struct usb_interface *intf) goto out2; msleep(150); - if (embd_phy) { - if ((ret = asix_sw_reset(dev, AX_SWRESET_IPRL)) < 0) - goto out2; - } - else { - if ((ret = asix_sw_reset(dev, AX_SWRESET_PRTE)) < 0) - goto out2; - } + if ((ret = asix_sw_reset(dev, AX_SWRESET_IPRL | AX_SWRESET_PRL)) < 0) + goto out2; msleep(150); rx_ctl = asix_read_rx_ctl(dev); diff --git a/trunk/drivers/usb/net/rndis_host.c b/trunk/drivers/usb/net/rndis_host.c index a322a16d9cf8..ea5f44de3de2 100644 --- a/trunk/drivers/usb/net/rndis_host.c +++ b/trunk/drivers/usb/net/rndis_host.c @@ -379,7 +379,6 @@ static int rndis_bind(struct usbnet *dev, struct usb_interface *intf) { int retval; struct net_device *net = dev->net; - struct cdc_state *info = (void *) &dev->data; union { void *buf; struct rndis_msg_hdr *header; @@ -398,7 +397,7 @@ static int rndis_bind(struct usbnet *dev, struct usb_interface *intf) return -ENOMEM; retval = usbnet_generic_cdc_bind(dev, intf); if (retval < 0) - goto fail; + goto done; net->hard_header_len += sizeof (struct rndis_data_hdr); @@ -413,7 +412,10 @@ static int rndis_bind(struct usbnet *dev, struct usb_interface *intf) if (unlikely(retval < 0)) { /* it might not even be an RNDIS device!! */ dev_err(&intf->dev, "RNDIS init failed, %d\n", retval); - goto fail_and_release; +fail: + usb_driver_release_interface(driver_of(intf), + ((struct cdc_state *)&(dev->data))->data); + goto done; } dev->hard_mtu = le32_to_cpu(u.init_c->max_transfer_size); /* REVISIT: peripheral "alignment" request is ignored ... */ @@ -429,7 +431,7 @@ static int rndis_bind(struct usbnet *dev, struct usb_interface *intf) retval = rndis_command(dev, u.header); if (unlikely(retval < 0)) { dev_err(&intf->dev, "rndis get ethaddr, %d\n", retval); - goto fail_and_release; + goto fail; } tmp = le32_to_cpu(u.get_c->offset); if (unlikely((tmp + 8) > (1024 - ETH_ALEN) @@ -437,7 +439,7 @@ static int rndis_bind(struct usbnet *dev, struct usb_interface *intf) dev_err(&intf->dev, "rndis ethaddr off %d len %d ?\n", tmp, le32_to_cpu(u.get_c->len)); retval = -EDOM; - goto fail_and_release; + goto fail; } memcpy(net->dev_addr, tmp + (char *)&u.get_c->request_id, ETH_ALEN); @@ -453,18 +455,11 @@ static int rndis_bind(struct usbnet *dev, struct usb_interface *intf) retval = rndis_command(dev, u.header); if (unlikely(retval < 0)) { dev_err(&intf->dev, "rndis set packet filter, %d\n", retval); - goto fail_and_release; + goto fail; } retval = 0; - - kfree(u.buf); - return retval; - -fail_and_release: - usb_set_intfdata(info->data, NULL); - usb_driver_release_interface(driver_of(intf), info->data); -fail: +done: kfree(u.buf); return retval; } diff --git a/trunk/drivers/usb/serial/option.c b/trunk/drivers/usb/serial/option.c index 0fed43a96871..5ca04e82ea19 100644 --- a/trunk/drivers/usb/serial/option.c +++ b/trunk/drivers/usb/serial/option.c @@ -78,7 +78,6 @@ static int option_send_setup(struct usb_serial_port *port); #define OPTION_PRODUCT_FUSION2 0x6300 #define OPTION_PRODUCT_COBRA 0x6500 #define OPTION_PRODUCT_COBRA2 0x6600 -#define OPTION_PRODUCT_GTMAX36 0x6701 #define HUAWEI_PRODUCT_E600 0x1001 #define HUAWEI_PRODUCT_E220 0x1003 #define AUDIOVOX_PRODUCT_AIRCARD 0x0112 @@ -91,7 +90,6 @@ static struct usb_device_id option_ids[] = { { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_FUSION2) }, { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COBRA) }, { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COBRA2) }, - { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_GTMAX36) }, { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E600) }, { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E220) }, { USB_DEVICE(AUDIOVOX_VENDOR_ID, AUDIOVOX_PRODUCT_AIRCARD) }, @@ -106,7 +104,6 @@ static struct usb_device_id option_ids1[] = { { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_FUSION2) }, { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COBRA) }, { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_COBRA2) }, - { USB_DEVICE(OPTION_VENDOR_ID, OPTION_PRODUCT_GTMAX36) }, { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E600) }, { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E220) }, { USB_DEVICE(AUDIOVOX_VENDOR_ID, AUDIOVOX_PRODUCT_AIRCARD) }, diff --git a/trunk/drivers/usb/storage/unusual_devs.h b/trunk/drivers/usb/storage/unusual_devs.h index b49f2a78189e..cddef3efba0a 100644 --- a/trunk/drivers/usb/storage/unusual_devs.h +++ b/trunk/drivers/usb/storage/unusual_devs.h @@ -197,13 +197,6 @@ UNUSUAL_DEV( 0x0421, 0x047c, 0x0370, 0x0370, US_SC_DEVICE, US_PR_DEVICE, NULL, US_FL_MAX_SECTORS_64 ), -/* Reported by Manuel Osdoba */ -UNUSUAL_DEV( 0x0421, 0x0492, 0x0452, 0x0452, - "Nokia", - "Nokia 6233", - US_SC_DEVICE, US_PR_DEVICE, NULL, - US_FL_MAX_SECTORS_64 ), - /* Reported by Alex Corcoles */ UNUSUAL_DEV( 0x0421, 0x0495, 0x0370, 0x0370, "Nokia", @@ -261,18 +254,6 @@ UNUSUAL_DEV( 0x045a, 0x5210, 0x0101, 0x0101, US_SC_SCSI, US_PR_KARMA, rio_karma_init, 0), #endif -/* - * This virtual floppy is found in Sun equipment (x4600, x4200m2, etc.) - * Reported by Pete Zaitcev - * This device chokes on both version of MODE SENSE which we have, so - * use_10_for_ms is not effective, and we use US_FL_NO_WP_DETECT. - */ -UNUSUAL_DEV( 0x046b, 0xff40, 0x0100, 0x0100, - "AMI", - "Virtual Floppy", - US_SC_DEVICE, US_PR_DEVICE, NULL, - US_FL_NO_WP_DETECT), - /* Patch submitted by Philipp Friedrich */ UNUSUAL_DEV( 0x0482, 0x0100, 0x0100, 0x0100, "Kyocera", diff --git a/trunk/fs/ocfs2/export.c b/trunk/fs/ocfs2/export.c index 56e1fefc1205..06be6e774cf9 100644 --- a/trunk/fs/ocfs2/export.c +++ b/trunk/fs/ocfs2/export.c @@ -60,11 +60,14 @@ static struct dentry *ocfs2_get_dentry(struct super_block *sb, void *vobjp) inode = ocfs2_iget(OCFS2_SB(sb), handle->ih_blkno, 0); - if (IS_ERR(inode)) + if (IS_ERR(inode)) { + mlog_errno(PTR_ERR(inode)); return (void *)inode; + } if (handle->ih_generation != inode->i_generation) { iput(inode); + mlog_errno(-ESTALE); return ERR_PTR(-ESTALE); } diff --git a/trunk/fs/ocfs2/inode.c b/trunk/fs/ocfs2/inode.c index 28ab56f2b98c..e4d91493d7d7 100644 --- a/trunk/fs/ocfs2/inode.c +++ b/trunk/fs/ocfs2/inode.c @@ -146,6 +146,7 @@ struct inode *ocfs2_iget(struct ocfs2_super *osb, u64 blkno, int flags) if (is_bad_inode(inode)) { iput(inode); inode = ERR_PTR(-ESTALE); + mlog_errno(PTR_ERR(inode)); goto bail; } @@ -154,7 +155,8 @@ struct inode *ocfs2_iget(struct ocfs2_super *osb, u64 blkno, int flags) mlog(0, "returning inode with number %llu\n", (unsigned long long)OCFS2_I(inode)->ip_blkno); mlog_exit_ptr(inode); - } + } else + mlog_errno(PTR_ERR(inode)); return inode; } @@ -245,7 +247,7 @@ int ocfs2_populate_inode(struct inode *inode, struct ocfs2_dinode *fe, * today. change if needed. */ if (!OCFS2_IS_VALID_DINODE(fe) || !(fe->i_flags & cpu_to_le32(OCFS2_VALID_FL))) { - mlog(0, "Invalid dinode: i_ino=%lu, i_blkno=%llu, " + mlog(ML_ERROR, "Invalid dinode: i_ino=%lu, i_blkno=%llu, " "signature = %.*s, flags = 0x%x\n", inode->i_ino, (unsigned long long)le64_to_cpu(fe->i_blkno), 7, @@ -476,8 +478,11 @@ static int ocfs2_read_locked_inode(struct inode *inode, S_ISBLK(le16_to_cpu(fe->i_mode))) inode->i_rdev = huge_decode_dev(le64_to_cpu(fe->id1.dev1.i_rdev)); - if (ocfs2_populate_inode(inode, fe, 0) < 0) + if (ocfs2_populate_inode(inode, fe, 0) < 0) { + mlog(ML_ERROR, "populate failed! i_blkno=%llu, i_ino=%lu\n", + (unsigned long long)fe->i_blkno, inode->i_ino); goto bail; + } BUG_ON(args->fi_blkno != le64_to_cpu(fe->i_blkno)); diff --git a/trunk/fs/ocfs2/namei.c b/trunk/fs/ocfs2/namei.c index f3d7803b4b46..9637039c2633 100644 --- a/trunk/fs/ocfs2/namei.c +++ b/trunk/fs/ocfs2/namei.c @@ -932,15 +932,14 @@ static int ocfs2_unlink(struct inode *dir, goto leave; } - dir->i_ctime = dir->i_mtime = CURRENT_TIME; - if (S_ISDIR(inode->i_mode)) + if (S_ISDIR(inode->i_mode)) { drop_nlink(dir); - - status = ocfs2_mark_inode_dirty(handle, dir, parent_node_bh); - if (status < 0) { - mlog_errno(status); - if (S_ISDIR(inode->i_mode)) + status = ocfs2_mark_inode_dirty(handle, dir, + parent_node_bh); + if (status < 0) { + mlog_errno(status); inc_nlink(dir); + } } leave: @@ -1069,7 +1068,6 @@ static int ocfs2_rename(struct inode *old_dir, char orphan_name[OCFS2_ORPHAN_NAMELEN + 1]; struct buffer_head *orphan_entry_bh = NULL; struct buffer_head *newfe_bh = NULL; - struct buffer_head *old_inode_bh = NULL; struct buffer_head *insert_entry_bh = NULL; struct ocfs2_super *osb = NULL; u64 newfe_blkno; @@ -1081,7 +1079,7 @@ static int ocfs2_rename(struct inode *old_dir, struct buffer_head *new_de_bh = NULL, *old_de_bh = NULL; // bhs for above struct buffer_head *old_inode_de_bh = NULL; // if old_dentry is a dir, // this is the 1st dirent bh - nlink_t old_dir_nlink = old_dir->i_nlink; + nlink_t old_dir_nlink = old_dir->i_nlink, new_dir_nlink = new_dir->i_nlink; /* At some point it might be nice to break this function up a * bit. */ @@ -1141,11 +1139,12 @@ static int ocfs2_rename(struct inode *old_dir, } /* - * Aside from allowing a meta data update, the locking here - * also ensures that the vote thread on other nodes won't have - * to concurrently downconvert the inode and the dentry locks. + * Though we don't require an inode meta data update if + * old_inode is not a directory, we lock anyway here to ensure + * the vote thread on other nodes won't have to concurrently + * downconvert the inode and the dentry locks. */ - status = ocfs2_meta_lock(old_inode, &old_inode_bh, 1); + status = ocfs2_meta_lock(old_inode, NULL, 1); if (status < 0) { if (status != -ENOENT) mlog_errno(status); @@ -1356,7 +1355,6 @@ static int ocfs2_rename(struct inode *old_dir, old_inode->i_ctime = CURRENT_TIME; mark_inode_dirty(old_inode); - ocfs2_mark_inode_dirty(handle, old_inode, old_inode_bh); /* now that the name has been added to new_dir, remove the old name */ status = ocfs2_delete_entry(handle, old_dir, old_de, old_de_bh); @@ -1386,22 +1384,27 @@ static int ocfs2_rename(struct inode *old_dir, } } mark_inode_dirty(old_dir); - ocfs2_mark_inode_dirty(handle, old_dir, old_dir_bh); - if (new_inode) { + if (new_inode) mark_inode_dirty(new_inode); - ocfs2_mark_inode_dirty(handle, new_inode, newfe_bh); - } - if (old_dir != new_dir) { - /* Keep the same times on both directories.*/ - new_dir->i_ctime = new_dir->i_mtime = old_dir->i_ctime; - - /* - * This will also pick up the i_nlink change from the - * block above. - */ - ocfs2_mark_inode_dirty(handle, new_dir, new_dir_bh); - } + if (old_dir != new_dir) + if (new_dir_nlink != new_dir->i_nlink) { + if (!new_dir_bh) { + mlog(ML_ERROR, "need to change nlink for new " + "dir %llu from %d to %d but bh is NULL\n", + (unsigned long long)OCFS2_I(new_dir)->ip_blkno, + (int)new_dir_nlink, new_dir->i_nlink); + } else { + struct ocfs2_dinode *fe; + status = ocfs2_journal_access(handle, + new_dir, + new_dir_bh, + OCFS2_JOURNAL_ACCESS_WRITE); + fe = (struct ocfs2_dinode *) new_dir_bh->b_data; + fe->i_links_count = cpu_to_le16(new_dir->i_nlink); + status = ocfs2_journal_dirty(handle, new_dir_bh); + } + } if (old_dir_nlink != old_dir->i_nlink) { if (!old_dir_bh) { @@ -1452,8 +1455,6 @@ static int ocfs2_rename(struct inode *old_dir, iput(new_inode); if (newfe_bh) brelse(newfe_bh); - if (old_inode_bh) - brelse(old_inode_bh); if (old_dir_bh) brelse(old_dir_bh); if (new_dir_bh) @@ -1825,13 +1826,6 @@ static int __ocfs2_add_entry(handle_t *handle, (le16_to_cpu(de->rec_len) >= rec_len)) || (le16_to_cpu(de->rec_len) >= (OCFS2_DIR_REC_LEN(de->name_len) + rec_len))) { - dir->i_mtime = dir->i_ctime = CURRENT_TIME; - retval = ocfs2_mark_inode_dirty(handle, dir, parent_fe_bh); - if (retval < 0) { - mlog_errno(retval); - goto bail; - } - status = ocfs2_journal_access(handle, dir, insert_bh, OCFS2_JOURNAL_ACCESS_WRITE); /* By now the buffer is marked for journaling */ @@ -1854,6 +1848,7 @@ static int __ocfs2_add_entry(handle_t *handle, de->name_len = namelen; memcpy(de->name, name, namelen); + dir->i_mtime = dir->i_ctime = CURRENT_TIME; dir->i_version++; status = ocfs2_journal_dirty(handle, insert_bh); retval = 0; diff --git a/trunk/fs/ocfs2/ocfs2_fs.h b/trunk/fs/ocfs2/ocfs2_fs.h index c99e9058c198..b5c68567077e 100644 --- a/trunk/fs/ocfs2/ocfs2_fs.h +++ b/trunk/fs/ocfs2/ocfs2_fs.h @@ -85,7 +85,7 @@ #define OCFS2_CLEAR_INCOMPAT_FEATURE(sb,mask) \ OCFS2_SB(sb)->s_feature_incompat &= ~(mask) -#define OCFS2_FEATURE_COMPAT_SUPP OCFS2_FEATURE_COMPAT_BACKUP_SB +#define OCFS2_FEATURE_COMPAT_SUPP 0 #define OCFS2_FEATURE_INCOMPAT_SUPP OCFS2_FEATURE_INCOMPAT_LOCAL_MOUNT #define OCFS2_FEATURE_RO_COMPAT_SUPP 0 @@ -109,20 +109,6 @@ /* Support for sparse allocation in b-trees */ #define OCFS2_FEATURE_INCOMPAT_SPARSE_ALLOC 0x0010 -/* - * backup superblock flag is used to indicate that this volume - * has backup superblocks. - */ -#define OCFS2_FEATURE_COMPAT_BACKUP_SB 0x0001 - -/* The byte offset of the first backup block will be 1G. - * The following will be 4G, 16G, 64G, 256G and 1T. - */ -#define OCFS2_BACKUP_SB_START 1 << 30 - -/* the max backup superblock nums */ -#define OCFS2_MAX_BACKUP_SUPERBLOCKS 6 - /* * Flags on ocfs2_dinode.i_flags */ @@ -580,20 +566,6 @@ static inline int ocfs2_truncate_recs_per_inode(struct super_block *sb) return size / sizeof(struct ocfs2_truncate_rec); } - -static inline u64 ocfs2_backup_super_blkno(struct super_block *sb, int index) -{ - u64 offset = OCFS2_BACKUP_SB_START; - - if (index >= 0 && index < OCFS2_MAX_BACKUP_SUPERBLOCKS) { - offset <<= (2 * index); - offset /= sb->s_blocksize; - return offset; - } - - return 0; - -} #else static inline int ocfs2_fast_symlink_chars(int blocksize) { @@ -659,19 +631,6 @@ static inline int ocfs2_truncate_recs_per_inode(int blocksize) return size / sizeof(struct ocfs2_truncate_rec); } - -static inline uint64_t ocfs2_backup_super_blkno(int blocksize, int index) -{ - uint64_t offset = OCFS2_BACKUP_SB_START; - - if (index >= 0 && index < OCFS2_MAX_BACKUP_SUPERBLOCKS) { - offset <<= (2 * index); - offset /= blocksize; - return offset; - } - - return 0; -} #endif /* __KERNEL__ */ diff --git a/trunk/fs/ocfs2/symlink.c b/trunk/fs/ocfs2/symlink.c index 03b0191534d5..957d6878b03e 100644 --- a/trunk/fs/ocfs2/symlink.c +++ b/trunk/fs/ocfs2/symlink.c @@ -158,7 +158,8 @@ static void *ocfs2_follow_link(struct dentry *dentry, } status = vfs_follow_link(nd, link); - + if (status && status != -ENOENT) + mlog_errno(status); bail: if (page) { kunmap(page); diff --git a/trunk/include/linux/libata.h b/trunk/include/linux/libata.h index e53a13ba7f78..ab2754830322 100644 --- a/trunk/include/linux/libata.h +++ b/trunk/include/linux/libata.h @@ -1143,7 +1143,6 @@ static inline void ata_tf_init(struct ata_device *dev, struct ata_taskfile *tf) static inline void ata_qc_reinit(struct ata_queued_cmd *qc) { - qc->dma_dir = DMA_NONE; qc->__sg = NULL; qc->flags = 0; qc->cursect = qc->cursg = qc->cursg_ofs = 0;