Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6
authorLinus Torvalds <torvalds@woody.linux-foundation.org>
Mon, 22 Jan 2007 21:14:16 +0000 (13:14 -0800)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Mon, 22 Jan 2007 21:14:16 +0000 (13:14 -0800)
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/usb-2.6:
  USB: unusual_devs.h entry for nokia 6233
  USB: Fix for typo in ohci-ep93xx.c
  USB: disable USB_MULTITHREAD_PROBE
  USB: add vendor/device id for Option GT Max 3.6 cards
  USB: unusual_devs.h for 0x046b:ff40
  USB: make usbhid ignore Imation Disc Stakka
  USB: rndis_host: fix crash while probing a Nokia S60 mobile
  USB: asix: Detect internal PHY and enable/use accordingly
  usbtouchscreen: make ITM screens report BTN_TOUCH as zero when not touched

16 files changed:
Documentation/DocBook/libata.tmpl
drivers/ata/libata-eh.c
drivers/ata/sata_mv.c
drivers/ata/sata_via.c
drivers/net/8139cp.c
drivers/net/myri10ge/myri10ge.c
drivers/net/sis190.c
drivers/net/ucc_geth.c
drivers/net/ucc_geth_phy.c
drivers/net/wireless/bcm43xx/bcm43xx_main.c
fs/ocfs2/export.c
fs/ocfs2/inode.c
fs/ocfs2/namei.c
fs/ocfs2/ocfs2_fs.h
fs/ocfs2/symlink.c
include/linux/libata.h

index 07a635590b36e8ff8c8a61086adb34e9d907bd65..e2e24b4778d447b8335e3f447f51883b618c306b 100644 (file)
@@ -883,7 +883,7 @@ and other resources, etc.
   </chapter>
 
   <chapter id="ataExceptions">
-     <title>ATA errors &amp; exceptions</title>
+     <title>ATA errors and exceptions</title>
 
   <para>
   This chapter tries to identify what error/exception conditions exist
index 08ad44b3e48fe47c17db93df394890c8aad4b855..56cf59b60ec4595a8cd9d434f3dcc1db3f2fa2fd 100644 (file)
@@ -1979,6 +1979,10 @@ 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);
index 1b8e0eb9e0321a2254b1c8a162f71afca0f4cdea..aae0b5201c1edb109a750ab717416a567126a220 100644 (file)
@@ -523,8 +523,7 @@ static const struct ata_port_info mv_port_info[] = {
        },
        {  /* chip_7042 */
                .sht            = &mv_sht,
-               .flags          = (MV_COMMON_FLAGS | MV_6XXX_FLAGS |
-                                  MV_FLAG_DUAL_HC),
+               .flags          = (MV_COMMON_FLAGS | MV_6XXX_FLAGS),
                .pio_mask       = 0x1f, /* pio0-4 */
                .udma_mask      = 0x7f, /* udma0-6 */
                .port_ops       = &mv_iie_ops,
@@ -545,6 +544,8 @@ static const struct pci_device_id mv_pci_tbl[] = {
 
        { PCI_VDEVICE(ADAPTEC2, 0x0241), chip_604x },
 
+       { PCI_VDEVICE(TTI, 0x2310), chip_7042 },
+
        { }                     /* terminate list */
 };
 
index 1c7f19aecc25f25973e2235ffd78b121026af304..88f0565c88836df0eeaa6cf359ce031029c161c8 100644 (file)
@@ -77,6 +77,7 @@ 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 },
index e2cb19b582a1f2f892c96b266f8b29bfbb132384..6f93a765e56479ec9f0b598faf517468d3cd6ca0 100644 (file)
@@ -765,17 +765,18 @@ 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_irq(&cp->lock);
+       spin_lock_irqsave(&cp->lock, intr_flags);
 
        /* This is a hard error, log it. */
        if (TX_BUFFS_AVAIL(cp) <= (skb_shinfo(skb)->nr_frags + 1)) {
                netif_stop_queue(dev);
-               spin_unlock_irq(&cp->lock);
+               spin_unlock_irqrestore(&cp->lock, intr_flags);
                printk(KERN_ERR PFX "%s: BUG! Tx Ring full when queue awake!\n",
                       dev->name);
                return 1;
@@ -908,7 +909,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_irq(&cp->lock);
+       spin_unlock_irqrestore(&cp->lock, intr_flags);
 
        cpw8(TxPoll, NormalTxPoll);
        dev->trans_start = jiffies;
index 07cf574197e5762239427f27c4d58c61d6d5ed27..61cbd4a604460448bd699664500f1803fb0794e7 100644 (file)
@@ -71,7 +71,7 @@
 #include "myri10ge_mcp.h"
 #include "myri10ge_mcp_gen_header.h"
 
-#define MYRI10GE_VERSION_STR "1.1.0"
+#define MYRI10GE_VERSION_STR "1.2.0"
 
 MODULE_DESCRIPTION("Myricom 10G driver (10GbE)");
 MODULE_AUTHOR("Maintainer: help@myri.com");
@@ -274,6 +274,10 @@ 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)
@@ -1714,7 +1718,7 @@ static int myri10ge_open(struct net_device *dev)
                goto abort_with_irq;
        }
 
-       if (mgp->mtrr >= 0) {
+       if (myri10ge_wcfifo && 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;
@@ -2878,7 +2882,6 @@ 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;
@@ -2888,6 +2891,15 @@ 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);
@@ -2903,8 +2915,9 @@ 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, "%d, tx bndry %d, fw %s, WC %s\n",
-                pdev->irq, mgp->tx.boundary, mgp->fw_name,
+       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,
                 (mgp->mtrr >= 0 ? "Enabled" : "Disabled"));
 
        return 0;
index b70ed79d412157e09a7f2e08438bb031fb42bf35..45d91b1591001f67d0135b31765811345c69f396 100644 (file)
@@ -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)[0] = le16_to_cpu(w);
+               ((u16 *)dev->dev_addr)[i] = le16_to_cpu(w);
        }
 
        sis190_set_rgmii(tp, sis190_read_eeprom(ioaddr, EEPROMInfo));
index 8243150f5b05ec6572cc8cfce779e7674a0b6ef0..7e4b23c7c1bab72dc73174c492ca9df70c326b6b 100644 (file)
@@ -29,6 +29,7 @@
 #include <linux/fsl_devices.h>
 #include <linux/ethtool.h>
 #include <linux/mii.h>
+#include <linux/workqueue.h>
 
 #include <asm/of_platform.h>
 #include <asm/uaccess.h>
@@ -472,7 +473,7 @@ static void put_enet_addr_container(struct enet_addr_container *enet_addr_cont)
        kfree(enet_addr_cont);
 }
 
-static int set_mac_addr(__be16 __iomem *reg, u8 *mac)
+static void set_mac_addr(__be16 __iomem *reg, u8 *mac)
 {
        out_be16(&reg[0], ((u16)mac[5] << 8) | mac[4]);
        out_be16(&reg[1], ((u16)mac[3] << 8) | mac[2]);
@@ -3920,10 +3921,11 @@ 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(void *data)
+static void ugeth_phy_change(struct work_struct *work)
 {
-       struct net_device *dev = (struct net_device *)data;
-       struct ucc_geth_private *ugeth = netdev_priv(dev);
+       struct ucc_geth_private *ugeth =
+               container_of(work, struct ucc_geth_private, tq);
+       struct net_device *dev = ugeth->dev;
        struct ucc_geth *ug_regs;
        int result = 0;
 
@@ -4080,7 +4082,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, dev);
+       INIT_WORK(&ugeth->tq, ugeth_phy_change);
 
        init_timer(&ugeth->phy_info_timer);
        ugeth->phy_info_timer.function = &ugeth_phy_startup_timer;
index 5360ec05eaa331b256f199714caba1df0b2c60e8..3c86592ce03c0d18b8eb6953bbfc7a17981147e9 100644 (file)
@@ -68,8 +68,31 @@ 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);
-u16 phy_read(struct ugeth_mii_info *mii_info, u16 regnum);
-void phy_write(struct ugeth_mii_info *mii_info, u16 regnum, u16 val);
+
+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);
+}
 
 /* Write value to the PHY for this device to the register at regnum, */
 /* waiting until the write is done before it returns.  All PHY */
@@ -184,7 +207,7 @@ static void config_genmii_advert(struct ugeth_mii_info *mii_info)
        advertise = mii_info->advertising;
 
        /* Setup standard advertisement */
-       adv = phy_read(mii_info, MII_ADVERTISE);
+       adv = ucc_geth_phy_read(mii_info, MII_ADVERTISE);
        adv &= ~(ADVERTISE_ALL | ADVERTISE_100BASE4);
        if (advertise & ADVERTISED_10baseT_Half)
                adv |= ADVERTISE_10HALF;
@@ -194,7 +217,7 @@ static void config_genmii_advert(struct ugeth_mii_info *mii_info)
                adv |= ADVERTISE_100HALF;
        if (advertise & ADVERTISED_100baseT_Full)
                adv |= ADVERTISE_100FULL;
-       phy_write(mii_info, MII_ADVERTISE, adv);
+       ucc_geth_phy_write(mii_info, MII_ADVERTISE, adv);
 }
 
 static void genmii_setup_forced(struct ugeth_mii_info *mii_info)
@@ -204,7 +227,7 @@ static void genmii_setup_forced(struct ugeth_mii_info *mii_info)
 
        ugphy_vdbg("%s: IN", __FUNCTION__);
 
-       ctrl = phy_read(mii_info, MII_BMCR);
+       ctrl = ucc_geth_phy_read(mii_info, MII_BMCR);
 
        ctrl &=
            ~(BMCR_FULLDPLX | BMCR_SPEED100 | BMCR_SPEED1000 | BMCR_ANENABLE);
@@ -234,7 +257,7 @@ static void genmii_setup_forced(struct ugeth_mii_info *mii_info)
                break;
        }
 
-       phy_write(mii_info, MII_BMCR, ctrl);
+       ucc_geth_phy_write(mii_info, MII_BMCR, ctrl);
 }
 
 /* Enable and Restart Autonegotiation */
@@ -244,9 +267,9 @@ static void genmii_restart_aneg(struct ugeth_mii_info *mii_info)
 
        ugphy_vdbg("%s: IN", __FUNCTION__);
 
-       ctl = phy_read(mii_info, MII_BMCR);
+       ctl = ucc_geth_phy_read(mii_info, MII_BMCR);
        ctl |= (BMCR_ANENABLE | BMCR_ANRESTART);
-       phy_write(mii_info, MII_BMCR, ctl);
+       ucc_geth_phy_write(mii_info, MII_BMCR, ctl);
 }
 
 static int gbit_config_aneg(struct ugeth_mii_info *mii_info)
@@ -261,14 +284,14 @@ static int gbit_config_aneg(struct ugeth_mii_info *mii_info)
                config_genmii_advert(mii_info);
                advertise = mii_info->advertising;
 
-               adv = phy_read(mii_info, MII_1000BASETCONTROL);
+               adv = ucc_geth_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;
-               phy_write(mii_info, MII_1000BASETCONTROL, adv);
+               ucc_geth_phy_write(mii_info, MII_1000BASETCONTROL, adv);
 
                /* Start/Restart aneg */
                genmii_restart_aneg(mii_info);
@@ -298,10 +321,10 @@ static int genmii_update_link(struct ugeth_mii_info *mii_info)
        ugphy_vdbg("%s: IN", __FUNCTION__);
 
        /* Do a fake read */
-       phy_read(mii_info, MII_BMSR);
+       ucc_geth_phy_read(mii_info, MII_BMSR);
 
        /* Read link and autonegotiation status */
-       status = phy_read(mii_info, MII_BMSR);
+       status = ucc_geth_phy_read(mii_info, MII_BMSR);
        if ((status & BMSR_LSTATUS) == 0)
                mii_info->link = 0;
        else
@@ -329,7 +352,7 @@ static int genmii_read_status(struct ugeth_mii_info *mii_info)
                return err;
 
        if (mii_info->autoneg) {
-               status = phy_read(mii_info, MII_LPA);
+               status = ucc_geth_phy_read(mii_info, MII_LPA);
 
                if (status & (LPA_10FULL | LPA_100FULL))
                        mii_info->duplex = DUPLEX_FULL;
@@ -352,9 +375,9 @@ static int marvell_init(struct ugeth_mii_info *mii_info)
 {
        ugphy_vdbg("%s: IN", __FUNCTION__);
 
-       phy_write(mii_info, 0x14, 0x0cd2);
-       phy_write(mii_info, MII_BMCR,
-                 phy_read(mii_info, MII_BMCR) | BMCR_RESET);
+       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);
        msleep(4000);
 
        return 0;
@@ -367,13 +390,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 */
-       phy_write(mii_info, MII_BMCR, BMCR_RESET);
+       ucc_geth_phy_write(mii_info, MII_BMCR, BMCR_RESET);
 
-       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);
+       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);
 
        gbit_config_aneg(mii_info);
 
@@ -398,7 +421,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 = phy_read(mii_info, MII_M1011_PHY_SPEC_STATUS);
+               status = ucc_geth_phy_read(mii_info, MII_M1011_PHY_SPEC_STATUS);
 
                /* Get the duplexity */
                if (status & MII_M1011_PHY_SPEC_STATUS_FULLDUPLEX)
@@ -430,7 +453,7 @@ static int marvell_ack_interrupt(struct ugeth_mii_info *mii_info)
        ugphy_vdbg("%s: IN", __FUNCTION__);
 
        /* Clear the interrupts by reading the reg */
-       phy_read(mii_info, MII_M1011_IEVENT);
+       ucc_geth_phy_read(mii_info, MII_M1011_IEVENT);
 
        return 0;
 }
@@ -440,9 +463,9 @@ static int marvell_config_intr(struct ugeth_mii_info *mii_info)
        ugphy_vdbg("%s: IN", __FUNCTION__);
 
        if (mii_info->interrupts == MII_INTERRUPT_ENABLED)
-               phy_write(mii_info, MII_M1011_IMASK, MII_M1011_IMASK_INIT);
+               ucc_geth_phy_write(mii_info, MII_M1011_IMASK, MII_M1011_IMASK_INIT);
        else
-               phy_write(mii_info, MII_M1011_IMASK, MII_M1011_IMASK_CLEAR);
+               ucc_geth_phy_write(mii_info, MII_M1011_IMASK, MII_M1011_IMASK_CLEAR);
 
        return 0;
 }
@@ -451,9 +474,9 @@ static int cis820x_init(struct ugeth_mii_info *mii_info)
 {
        ugphy_vdbg("%s: IN", __FUNCTION__);
 
-       phy_write(mii_info, MII_CIS8201_AUX_CONSTAT,
+       ucc_geth_phy_write(mii_info, MII_CIS8201_AUX_CONSTAT,
                  MII_CIS8201_AUXCONSTAT_INIT);
-       phy_write(mii_info, MII_CIS8201_EXT_CON1, MII_CIS8201_EXTCON1_INIT);
+       ucc_geth_phy_write(mii_info, MII_CIS8201_EXT_CON1, MII_CIS8201_EXTCON1_INIT);
 
        return 0;
 }
@@ -477,7 +500,7 @@ static int cis820x_read_status(struct ugeth_mii_info *mii_info)
        if (mii_info->autoneg && mii_info->link) {
                int speed;
 
-               status = phy_read(mii_info, MII_CIS8201_AUX_CONSTAT);
+               status = ucc_geth_phy_read(mii_info, MII_CIS8201_AUX_CONSTAT);
                if (status & MII_CIS8201_AUXCONSTAT_DUPLEX)
                        mii_info->duplex = DUPLEX_FULL;
                else
@@ -505,7 +528,7 @@ static int cis820x_ack_interrupt(struct ugeth_mii_info *mii_info)
 {
        ugphy_vdbg("%s: IN", __FUNCTION__);
 
-       phy_read(mii_info, MII_CIS8201_ISTAT);
+       ucc_geth_phy_read(mii_info, MII_CIS8201_ISTAT);
 
        return 0;
 }
@@ -515,9 +538,9 @@ static int cis820x_config_intr(struct ugeth_mii_info *mii_info)
        ugphy_vdbg("%s: IN", __FUNCTION__);
 
        if (mii_info->interrupts == MII_INTERRUPT_ENABLED)
-               phy_write(mii_info, MII_CIS8201_IMASK, MII_CIS8201_IMASK_MASK);
+               ucc_geth_phy_write(mii_info, MII_CIS8201_IMASK, MII_CIS8201_IMASK_MASK);
        else
-               phy_write(mii_info, MII_CIS8201_IMASK, 0);
+               ucc_geth_phy_write(mii_info, MII_CIS8201_IMASK, 0);
 
        return 0;
 }
@@ -541,7 +564,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 = phy_read(mii_info, MII_DM9161_SCSR);
+               status = ucc_geth_phy_read(mii_info, MII_DM9161_SCSR);
                if (status & (MII_DM9161_SCSR_100F | MII_DM9161_SCSR_100H))
                        mii_info->speed = SPEED_100;
                else
@@ -572,7 +595,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 = phy_read(mii_info, MII_BMSR);
+       u16 status = ucc_geth_phy_read(mii_info, MII_BMSR);
 
        ugphy_vdbg("%s: IN", __FUNCTION__);
 
@@ -599,11 +622,11 @@ static int dm9161_init(struct ugeth_mii_info *mii_info)
        /* Reset is not done yet */
        priv->resetdone = 0;
 
-       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_RESET);
 
-       phy_write(mii_info, MII_BMCR,
-                 phy_read(mii_info, MII_BMCR) & ~BMCR_ISOLATE);
+       ucc_geth_phy_write(mii_info, MII_BMCR,
+                 ucc_geth_phy_read(mii_info, MII_BMCR) & ~BMCR_ISOLATE);
 
        config_genmii_advert(mii_info);
        /* Start/Restart aneg */
@@ -634,7 +657,7 @@ static int dm9161_ack_interrupt(struct ugeth_mii_info *mii_info)
        ugphy_vdbg("%s: IN", __FUNCTION__);
 
        /* Clear the interrupts by reading the reg */
-       phy_read(mii_info, MII_DM9161_INTR);
+       ucc_geth_phy_read(mii_info, MII_DM9161_INTR);
 
 
        return 0;
@@ -645,9 +668,9 @@ static int dm9161_config_intr(struct ugeth_mii_info *mii_info)
        ugphy_vdbg("%s: IN", __FUNCTION__);
 
        if (mii_info->interrupts == MII_INTERRUPT_ENABLED)
-               phy_write(mii_info, MII_DM9161_INTR, MII_DM9161_INTR_INIT);
+               ucc_geth_phy_write(mii_info, MII_DM9161_INTR, MII_DM9161_INTR_INIT);
        else
-               phy_write(mii_info, MII_DM9161_INTR, MII_DM9161_INTR_STOP);
+               ucc_geth_phy_write(mii_info, MII_DM9161_INTR, MII_DM9161_INTR_STOP);
 
        return 0;
 }
@@ -718,31 +741,6 @@ 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
  */
@@ -757,11 +755,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 = phy_read(mii_info, MII_PHYSID1);
+       phy_reg = ucc_geth_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 = phy_read(mii_info, MII_PHYSID2);
+       phy_reg = ucc_geth_phy_read(mii_info, MII_PHYSID2);
        phy_ID |= (phy_reg & 0xffff);
 
        /* loop through all the known PHY types, and find one that */
index 2ec2e5afce67dd67d6e62e235e4ac68db37fb76c..91b752e3d07e104f10673f35fc8aee2aa5199df8 100644 (file)
@@ -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 & 0xFFF0) >> 4;
-               core_rev = (sb_id_hi & 0xF);
+               core_id = (sb_id_hi & 0x8FF0) >> 4;
+               core_rev = ((sb_id_hi & 0xF) | ((sb_id_hi & 0x7000) >> 8));
                core_vendor = (sb_id_hi & 0xFFFF0000) >> 16;
 
                dprintk(KERN_INFO PFX "Core %d: ID 0x%x, rev 0x%x, vendor 0x%x\n",
@@ -2873,7 +2873,10 @@ 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;
-               sbimconfiglow |= 0x32;
+               if (bcm->bustype == BCM43xx_BUSTYPE_PCI)
+                       sbimconfiglow |= 0x32;
+               else
+                       sbimconfiglow |= 0x53;
                bcm43xx_write32(bcm, BCM43xx_CIR_SBIMCONFIGLOW, sbimconfiglow);
        }
 
@@ -3077,7 +3080,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);
index 06be6e774cf943e08c41b616fc2d99ceb17efc11..56e1fefc1205e824cd2f1bef79941f2fdf5b9bed 100644 (file)
@@ -60,14 +60,11 @@ 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)) {
-               mlog_errno(PTR_ERR(inode));
+       if (IS_ERR(inode))
                return (void *)inode;
-       }
 
        if (handle->ih_generation != inode->i_generation) {
                iput(inode);
-               mlog_errno(-ESTALE);
                return ERR_PTR(-ESTALE);
        }
 
index e4d91493d7d74a9efa29e8e55ead977cee06de70..28ab56f2b98c50bf8300140c9002b801060c66a9 100644 (file)
@@ -146,7 +146,6 @@ 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;
        }
 
@@ -155,8 +154,7 @@ bail:
                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;
 }
@@ -247,7 +245,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(ML_ERROR, "Invalid dinode: i_ino=%lu, i_blkno=%llu, "
+               mlog(0, "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,
@@ -478,11 +476,8 @@ 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) {
-               mlog(ML_ERROR, "populate failed! i_blkno=%llu, i_ino=%lu\n",
-                    (unsigned long long)fe->i_blkno, inode->i_ino);
+       if (ocfs2_populate_inode(inode, fe, 0) < 0)
                goto bail;
-       }
 
        BUG_ON(args->fi_blkno != le64_to_cpu(fe->i_blkno));
 
index 9637039c263355676716b72b98eaa9f147867dfb..f3d7803b4b46f18622cbb6156a25f80fa6b89a82 100644 (file)
@@ -932,14 +932,15 @@ static int ocfs2_unlink(struct inode *dir,
                goto leave;
        }
 
-       if (S_ISDIR(inode->i_mode)) {
+       dir->i_ctime = dir->i_mtime = CURRENT_TIME;
+       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);
+
+       status = ocfs2_mark_inode_dirty(handle, dir, parent_node_bh);
+       if (status < 0) {
+               mlog_errno(status);
+               if (S_ISDIR(inode->i_mode))
                        inc_nlink(dir);
-               }
        }
 
 leave:
@@ -1068,6 +1069,7 @@ 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;
@@ -1079,7 +1081,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, new_dir_nlink = new_dir->i_nlink;
+       nlink_t old_dir_nlink = old_dir->i_nlink;
 
        /* At some point it might be nice to break this function up a
         * bit. */
@@ -1139,12 +1141,11 @@ static int ocfs2_rename(struct inode *old_dir,
        }
 
        /*
-        * 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.
+        * 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.
         */
-       status = ocfs2_meta_lock(old_inode, NULL, 1);
+       status = ocfs2_meta_lock(old_inode, &old_inode_bh, 1);
        if (status < 0) {
                if (status != -ENOENT)
                        mlog_errno(status);
@@ -1355,6 +1356,7 @@ 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);
@@ -1384,27 +1386,22 @@ static int ocfs2_rename(struct inode *old_dir,
                }
        }
        mark_inode_dirty(old_dir);
-       if (new_inode)
+       ocfs2_mark_inode_dirty(handle, old_dir, old_dir_bh);
+       if (new_inode) {
                mark_inode_dirty(new_inode);
+               ocfs2_mark_inode_dirty(handle, new_inode, newfe_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 != 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_nlink != old_dir->i_nlink) {
                if (!old_dir_bh) {
@@ -1455,6 +1452,8 @@ bail:
                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)
@@ -1826,6 +1825,13 @@ 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 */
@@ -1848,7 +1854,6 @@ 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;
index b5c68567077ecaab02bfd0dd903d24f12e13eb56..c99e9058c1988940451d7faf21d24818c83e71cc 100644 (file)
@@ -85,7 +85,7 @@
 #define OCFS2_CLEAR_INCOMPAT_FEATURE(sb,mask)                  \
        OCFS2_SB(sb)->s_feature_incompat &= ~(mask)
 
-#define OCFS2_FEATURE_COMPAT_SUPP      0
+#define OCFS2_FEATURE_COMPAT_SUPP      OCFS2_FEATURE_COMPAT_BACKUP_SB
 #define OCFS2_FEATURE_INCOMPAT_SUPP    OCFS2_FEATURE_INCOMPAT_LOCAL_MOUNT
 #define OCFS2_FEATURE_RO_COMPAT_SUPP   0
 
 /* 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
  */
@@ -566,6 +580,20 @@ 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)
 {
@@ -631,6 +659,19 @@ 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__ */
 
 
index 957d6878b03ef4bfa307d91d7f55f6fd0e0c885b..03b0191534d56b1a7ce4e51bb1c9a16c0d83042b 100644 (file)
@@ -158,8 +158,7 @@ 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);
index ab2754830322f96a5e1a80538104fa143a6028b1..e53a13ba7f7833275b54005a237153ac541ee288 100644 (file)
@@ -1143,6 +1143,7 @@ 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;