dect
/
linux-2.6
Archived
13
0
Fork 0

Merge branch 'master' of /Volumes/CaseSensitiveDisk/linux

This commit is contained in:
Anton Altaparmakov 2012-02-27 09:01:22 +00:00
commit f621c53343
154 changed files with 1224 additions and 661 deletions

View File

@ -269,7 +269,6 @@ S: Orphan
F: drivers/platform/x86/wmi.c F: drivers/platform/x86/wmi.c
AD1889 ALSA SOUND DRIVER AD1889 ALSA SOUND DRIVER
M: Kyle McMartin <kyle@mcmartin.ca>
M: Thibaut Varene <T-Bone@parisc-linux.org> M: Thibaut Varene <T-Bone@parisc-linux.org>
W: http://wiki.parisc-linux.org/AD1889 W: http://wiki.parisc-linux.org/AD1889
L: linux-parisc@vger.kernel.org L: linux-parisc@vger.kernel.org
@ -3047,7 +3046,6 @@ F: drivers/hwspinlock/hwspinlock_*
F: include/linux/hwspinlock.h F: include/linux/hwspinlock.h
HARMONY SOUND DRIVER HARMONY SOUND DRIVER
M: Kyle McMartin <kyle@mcmartin.ca>
L: linux-parisc@vger.kernel.org L: linux-parisc@vger.kernel.org
S: Maintained S: Maintained
F: sound/parisc/harmony.* F: sound/parisc/harmony.*
@ -3782,7 +3780,7 @@ F: Documentation/kdump/
KERNEL AUTOMOUNTER v4 (AUTOFS4) KERNEL AUTOMOUNTER v4 (AUTOFS4)
M: Ian Kent <raven@themaw.net> M: Ian Kent <raven@themaw.net>
L: autofs@linux.kernel.org L: autofs@vger.kernel.org
S: Maintained S: Maintained
F: fs/autofs4/ F: fs/autofs4/
@ -5000,9 +4998,8 @@ F: Documentation/blockdev/paride.txt
F: drivers/block/paride/ F: drivers/block/paride/
PARISC ARCHITECTURE PARISC ARCHITECTURE
M: Kyle McMartin <kyle@mcmartin.ca>
M: Helge Deller <deller@gmx.de>
M: "James E.J. Bottomley" <jejb@parisc-linux.org> M: "James E.J. Bottomley" <jejb@parisc-linux.org>
M: Helge Deller <deller@gmx.de>
L: linux-parisc@vger.kernel.org L: linux-parisc@vger.kernel.org
W: http://www.parisc-linux.org/ W: http://www.parisc-linux.org/
Q: http://patchwork.kernel.org/project/linux-parisc/list/ Q: http://patchwork.kernel.org/project/linux-parisc/list/

View File

@ -1,7 +1,7 @@
VERSION = 3 VERSION = 3
PATCHLEVEL = 3 PATCHLEVEL = 3
SUBLEVEL = 0 SUBLEVEL = 0
EXTRAVERSION = -rc4 EXTRAVERSION = -rc5
NAME = Saber-toothed Squirrel NAME = Saber-toothed Squirrel
# *DOCUMENTATION* # *DOCUMENTATION*

View File

@ -30,6 +30,7 @@
#include <linux/serial_sci.h> #include <linux/serial_sci.h>
#include <linux/smsc911x.h> #include <linux/smsc911x.h>
#include <linux/gpio.h> #include <linux/gpio.h>
#include <linux/videodev2.h>
#include <linux/input.h> #include <linux/input.h>
#include <linux/input/sh_keysc.h> #include <linux/input/sh_keysc.h>
#include <linux/mmc/host.h> #include <linux/mmc/host.h>
@ -37,7 +38,6 @@
#include <linux/mmc/sh_mobile_sdhi.h> #include <linux/mmc/sh_mobile_sdhi.h>
#include <linux/mfd/tmio.h> #include <linux/mfd/tmio.h>
#include <linux/sh_clk.h> #include <linux/sh_clk.h>
#include <linux/dma-mapping.h>
#include <video/sh_mobile_lcdc.h> #include <video/sh_mobile_lcdc.h>
#include <video/sh_mipi_dsi.h> #include <video/sh_mipi_dsi.h>
#include <sound/sh_fsi.h> #include <sound/sh_fsi.h>
@ -159,19 +159,12 @@ static struct resource sh_mmcif_resources[] = {
}, },
}; };
static struct sh_mmcif_dma sh_mmcif_dma = {
.chan_priv_rx = {
.slave_id = SHDMA_SLAVE_MMCIF_RX,
},
.chan_priv_tx = {
.slave_id = SHDMA_SLAVE_MMCIF_TX,
},
};
static struct sh_mmcif_plat_data sh_mmcif_platdata = { static struct sh_mmcif_plat_data sh_mmcif_platdata = {
.sup_pclk = 0, .sup_pclk = 0,
.ocr = MMC_VDD_165_195, .ocr = MMC_VDD_165_195,
.caps = MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE, .caps = MMC_CAP_8_BIT_DATA | MMC_CAP_NONREMOVABLE,
.dma = &sh_mmcif_dma, .slave_id_tx = SHDMA_SLAVE_MMCIF_TX,
.slave_id_rx = SHDMA_SLAVE_MMCIF_RX,
}; };
static struct platform_device mmc_device = { static struct platform_device mmc_device = {
@ -321,12 +314,11 @@ static struct resource mipidsi0_resources[] = {
}, },
}; };
#define DSI0PHYCR 0xe615006c
static int sh_mipi_set_dot_clock(struct platform_device *pdev, static int sh_mipi_set_dot_clock(struct platform_device *pdev,
void __iomem *base, void __iomem *base,
int enable) int enable)
{ {
struct clk *pck; struct clk *pck, *phy;
int ret; int ret;
pck = clk_get(&pdev->dev, "dsip_clk"); pck = clk_get(&pdev->dev, "dsip_clk");
@ -335,18 +327,27 @@ static int sh_mipi_set_dot_clock(struct platform_device *pdev,
goto sh_mipi_set_dot_clock_pck_err; goto sh_mipi_set_dot_clock_pck_err;
} }
phy = clk_get(&pdev->dev, "dsiphy_clk");
if (IS_ERR(phy)) {
ret = PTR_ERR(phy);
goto sh_mipi_set_dot_clock_phy_err;
}
if (enable) { if (enable) {
clk_set_rate(pck, clk_round_rate(pck, 24000000)); clk_set_rate(pck, clk_round_rate(pck, 24000000));
__raw_writel(0x2a809010, DSI0PHYCR); clk_set_rate(phy, clk_round_rate(pck, 510000000));
clk_enable(pck); clk_enable(pck);
clk_enable(phy);
} else { } else {
clk_disable(pck); clk_disable(pck);
clk_disable(phy);
} }
ret = 0; ret = 0;
clk_put(phy);
sh_mipi_set_dot_clock_phy_err:
clk_put(pck); clk_put(pck);
sh_mipi_set_dot_clock_pck_err: sh_mipi_set_dot_clock_pck_err:
return ret; return ret;
} }

View File

@ -295,15 +295,6 @@ static struct resource sh_mmcif_resources[] = {
}, },
}; };
static struct sh_mmcif_dma sh_mmcif_dma = {
.chan_priv_rx = {
.slave_id = SHDMA_SLAVE_MMCIF_RX,
},
.chan_priv_tx = {
.slave_id = SHDMA_SLAVE_MMCIF_TX,
},
};
static struct sh_mmcif_plat_data sh_mmcif_plat = { static struct sh_mmcif_plat_data sh_mmcif_plat = {
.sup_pclk = 0, .sup_pclk = 0,
.ocr = MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34, .ocr = MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34,
@ -311,7 +302,8 @@ static struct sh_mmcif_plat_data sh_mmcif_plat = {
MMC_CAP_8_BIT_DATA | MMC_CAP_8_BIT_DATA |
MMC_CAP_NEEDS_POLL, MMC_CAP_NEEDS_POLL,
.get_cd = slot_cn7_get_cd, .get_cd = slot_cn7_get_cd,
.dma = &sh_mmcif_dma, .slave_id_tx = SHDMA_SLAVE_MMCIF_TX,
.slave_id_rx = SHDMA_SLAVE_MMCIF_RX,
}; };
static struct platform_device sh_mmcif_device = { static struct platform_device sh_mmcif_device = {

View File

@ -143,11 +143,10 @@ static struct gpio_keys_button gpio_buttons[] = {
static struct gpio_keys_platform_data gpio_key_info = { static struct gpio_keys_platform_data gpio_key_info = {
.buttons = gpio_buttons, .buttons = gpio_buttons,
.nbuttons = ARRAY_SIZE(gpio_buttons), .nbuttons = ARRAY_SIZE(gpio_buttons),
.poll_interval = 250, /* polled for now */
}; };
static struct platform_device gpio_keys_device = { static struct platform_device gpio_keys_device = {
.name = "gpio-keys-polled", /* polled for now */ .name = "gpio-keys",
.id = -1, .id = -1,
.dev = { .dev = {
.platform_data = &gpio_key_info, .platform_data = &gpio_key_info,

View File

@ -43,7 +43,6 @@
#include <linux/smsc911x.h> #include <linux/smsc911x.h>
#include <linux/sh_intc.h> #include <linux/sh_intc.h>
#include <linux/tca6416_keypad.h> #include <linux/tca6416_keypad.h>
#include <linux/usb/r8a66597.h>
#include <linux/usb/renesas_usbhs.h> #include <linux/usb/renesas_usbhs.h>
#include <linux/dma-mapping.h> #include <linux/dma-mapping.h>
@ -145,11 +144,6 @@
* 1-2 short | VBUS 5V | Host * 1-2 short | VBUS 5V | Host
* open | external VBUS | Function * open | external VBUS | Function
* *
* *1
* CN31 is used as
* CONFIG_USB_R8A66597_HCD Host
* CONFIG_USB_RENESAS_USBHS Function
*
* CAUTION * CAUTION
* *
* renesas_usbhs driver can use external interrupt mode * renesas_usbhs driver can use external interrupt mode
@ -161,15 +155,6 @@
* mackerel can not use external interrupt (IRQ7-PORT167) mode on "USB0", * mackerel can not use external interrupt (IRQ7-PORT167) mode on "USB0",
* because Touchscreen is using IRQ7-PORT40. * because Touchscreen is using IRQ7-PORT40.
* It is impossible to use IRQ7 demux on this board. * It is impossible to use IRQ7 demux on this board.
*
* We can use external interrupt mode USB-Function on "USB1".
* USB1 can become Host by r8a66597, and become Function by renesas_usbhs.
* But don't select both drivers in same time.
* These uses same IRQ number for request_irq(), and aren't supporting
* IRQF_SHARED / IORESOURCE_IRQ_SHAREABLE.
*
* Actually these are old/new version of USB driver.
* This mean its register will be broken if it supports shared IRQ,
*/ */
/* /*
@ -207,6 +192,16 @@
* *
*/ */
/*
* FSI - AK4642
*
* it needs amixer settings for playing
*
* amixer set "Headphone" on
* amixer set "HPOUTL Mixer DACH" on
* amixer set "HPOUTR Mixer DACH" on
*/
/* /*
* FIXME !! * FIXME !!
* *
@ -676,51 +671,16 @@ static struct platform_device usbhs0_device = {
* Use J30 to select between Host and Function. This setting * Use J30 to select between Host and Function. This setting
* can however not be detected by software. Hotplug of USBHS1 * can however not be detected by software. Hotplug of USBHS1
* is provided via IRQ8. * is provided via IRQ8.
*
* Current USB1 works as "USB Host".
* - set J30 "short"
*
* If you want to use it as "USB gadget",
* - J30 "open"
* - modify usbhs1_get_id() USBHS_HOST -> USBHS_GADGET
* - add .get_vbus = usbhs_get_vbus in usbhs1_private
*/ */
#define IRQ8 evt2irq(0x0300) #define IRQ8 evt2irq(0x0300)
/* USBHS1 USB Host support via r8a66597_hcd */
static void usb1_host_port_power(int port, int power)
{
if (!power) /* only power-on is supported for now */
return;
/* set VBOUT/PWEN and EXTLP1 in DVSTCTR */
__raw_writew(__raw_readw(0xE68B0008) | 0x600, 0xE68B0008);
}
static struct r8a66597_platdata usb1_host_data = {
.on_chip = 1,
.port_power = usb1_host_port_power,
};
static struct resource usb1_host_resources[] = {
[0] = {
.name = "USBHS1",
.start = 0xe68b0000,
.end = 0xe68b00e6 - 1,
.flags = IORESOURCE_MEM,
},
[1] = {
.start = evt2irq(0x1ce0) /* USB1_USB1I0 */,
.flags = IORESOURCE_IRQ,
},
};
static struct platform_device usb1_host_device = {
.name = "r8a66597_hcd",
.id = 1,
.dev = {
.dma_mask = NULL, /* not use dma */
.coherent_dma_mask = 0xffffffff,
.platform_data = &usb1_host_data,
},
.num_resources = ARRAY_SIZE(usb1_host_resources),
.resource = usb1_host_resources,
};
/* USBHS1 USB Function support via renesas_usbhs */
#define USB_PHY_MODE (1 << 4) #define USB_PHY_MODE (1 << 4)
#define USB_PHY_INT_EN ((1 << 3) | (1 << 2)) #define USB_PHY_INT_EN ((1 << 3) | (1 << 2))
#define USB_PHY_ON (1 << 1) #define USB_PHY_ON (1 << 1)
@ -776,7 +736,7 @@ static void usbhs1_hardware_exit(struct platform_device *pdev)
static int usbhs1_get_id(struct platform_device *pdev) static int usbhs1_get_id(struct platform_device *pdev)
{ {
return USBHS_GADGET; return USBHS_HOST;
} }
static u32 usbhs1_pipe_cfg[] = { static u32 usbhs1_pipe_cfg[] = {
@ -807,7 +767,6 @@ static struct usbhs_private usbhs1_private = {
.hardware_exit = usbhs1_hardware_exit, .hardware_exit = usbhs1_hardware_exit,
.get_id = usbhs1_get_id, .get_id = usbhs1_get_id,
.phy_reset = usbhs_phy_reset, .phy_reset = usbhs_phy_reset,
.get_vbus = usbhs_get_vbus,
}, },
.driver_param = { .driver_param = {
.buswait_bwait = 4, .buswait_bwait = 4,
@ -1184,15 +1143,6 @@ static struct resource sh_mmcif_resources[] = {
}, },
}; };
static struct sh_mmcif_dma sh_mmcif_dma = {
.chan_priv_rx = {
.slave_id = SHDMA_SLAVE_MMCIF_RX,
},
.chan_priv_tx = {
.slave_id = SHDMA_SLAVE_MMCIF_TX,
},
};
static struct sh_mmcif_plat_data sh_mmcif_plat = { static struct sh_mmcif_plat_data sh_mmcif_plat = {
.sup_pclk = 0, .sup_pclk = 0,
.ocr = MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34, .ocr = MMC_VDD_165_195 | MMC_VDD_32_33 | MMC_VDD_33_34,
@ -1200,7 +1150,8 @@ static struct sh_mmcif_plat_data sh_mmcif_plat = {
MMC_CAP_8_BIT_DATA | MMC_CAP_8_BIT_DATA |
MMC_CAP_NEEDS_POLL, MMC_CAP_NEEDS_POLL,
.get_cd = slot_cn7_get_cd, .get_cd = slot_cn7_get_cd,
.dma = &sh_mmcif_dma, .slave_id_tx = SHDMA_SLAVE_MMCIF_TX,
.slave_id_rx = SHDMA_SLAVE_MMCIF_RX,
}; };
static struct platform_device sh_mmcif_device = { static struct platform_device sh_mmcif_device = {
@ -1311,7 +1262,6 @@ static struct platform_device *mackerel_devices[] __initdata = {
&nor_flash_device, &nor_flash_device,
&smc911x_device, &smc911x_device,
&lcdc_device, &lcdc_device,
&usb1_host_device,
&usbhs1_device, &usbhs1_device,
&usbhs0_device, &usbhs0_device,
&leds_device, &leds_device,
@ -1473,9 +1423,6 @@ static void __init mackerel_init(void)
gpio_pull_down(GPIO_PORT167CR); /* VBUS0_1 pull down */ gpio_pull_down(GPIO_PORT167CR); /* VBUS0_1 pull down */
gpio_request(GPIO_FN_IDIN_1_113, NULL); gpio_request(GPIO_FN_IDIN_1_113, NULL);
/* USB phy tweak to make the r8a66597_hcd host driver work */
__raw_writew(0x8a0a, 0xe6058130); /* USBCR4 */
/* enable FSI2 port A (ak4643) */ /* enable FSI2 port A (ak4643) */
gpio_request(GPIO_FN_FSIAIBT, NULL); gpio_request(GPIO_FN_FSIAIBT, NULL);
gpio_request(GPIO_FN_FSIAILR, NULL); gpio_request(GPIO_FN_FSIAILR, NULL);

View File

@ -365,6 +365,114 @@ static struct clk div6_clks[DIV6_NR] = {
dsi_parent, ARRAY_SIZE(dsi_parent), 12, 3), dsi_parent, ARRAY_SIZE(dsi_parent), 12, 3),
}; };
/* DSI DIV */
static unsigned long dsiphy_recalc(struct clk *clk)
{
u32 value;
value = __raw_readl(clk->mapping->base);
/* FIXME */
if (!(value & 0x000B8000))
return clk->parent->rate;
value &= 0x3f;
value += 1;
if ((value < 12) ||
(value > 33)) {
pr_err("DSIPHY has wrong value (%d)", value);
return 0;
}
return clk->parent->rate / value;
}
static long dsiphy_round_rate(struct clk *clk, unsigned long rate)
{
return clk_rate_mult_range_round(clk, 12, 33, rate);
}
static void dsiphy_disable(struct clk *clk)
{
u32 value;
value = __raw_readl(clk->mapping->base);
value &= ~0x000B8000;
__raw_writel(value , clk->mapping->base);
}
static int dsiphy_enable(struct clk *clk)
{
u32 value;
int multi;
value = __raw_readl(clk->mapping->base);
multi = (value & 0x3f) + 1;
if ((multi < 12) || (multi > 33))
return -EIO;
__raw_writel(value | 0x000B8000, clk->mapping->base);
return 0;
}
static int dsiphy_set_rate(struct clk *clk, unsigned long rate)
{
u32 value;
int idx;
idx = rate / clk->parent->rate;
if ((idx < 12) || (idx > 33))
return -EINVAL;
idx += -1;
value = __raw_readl(clk->mapping->base);
value = (value & ~0x3f) + idx;
__raw_writel(value, clk->mapping->base);
return 0;
}
static struct clk_ops dsiphy_clk_ops = {
.recalc = dsiphy_recalc,
.round_rate = dsiphy_round_rate,
.set_rate = dsiphy_set_rate,
.enable = dsiphy_enable,
.disable = dsiphy_disable,
};
static struct clk_mapping dsi0phy_clk_mapping = {
.phys = DSI0PHYCR,
.len = 4,
};
static struct clk_mapping dsi1phy_clk_mapping = {
.phys = DSI1PHYCR,
.len = 4,
};
static struct clk dsi0phy_clk = {
.ops = &dsiphy_clk_ops,
.parent = &div6_clks[DIV6_DSI0P], /* late install */
.mapping = &dsi0phy_clk_mapping,
};
static struct clk dsi1phy_clk = {
.ops = &dsiphy_clk_ops,
.parent = &div6_clks[DIV6_DSI1P], /* late install */
.mapping = &dsi1phy_clk_mapping,
};
static struct clk *late_main_clks[] = {
&dsi0phy_clk,
&dsi1phy_clk,
};
enum { MSTP001, enum { MSTP001,
MSTP129, MSTP128, MSTP127, MSTP126, MSTP125, MSTP118, MSTP116, MSTP100, MSTP129, MSTP128, MSTP127, MSTP126, MSTP125, MSTP118, MSTP116, MSTP100,
MSTP219, MSTP219,
@ -429,6 +537,8 @@ static struct clk_lookup lookups[] = {
CLKDEV_ICK_ID("dsit_clk", "sh-mipi-dsi.1", &div6_clks[DIV6_DSIT]), CLKDEV_ICK_ID("dsit_clk", "sh-mipi-dsi.1", &div6_clks[DIV6_DSIT]),
CLKDEV_ICK_ID("dsip_clk", "sh-mipi-dsi.0", &div6_clks[DIV6_DSI0P]), CLKDEV_ICK_ID("dsip_clk", "sh-mipi-dsi.0", &div6_clks[DIV6_DSI0P]),
CLKDEV_ICK_ID("dsip_clk", "sh-mipi-dsi.1", &div6_clks[DIV6_DSI1P]), CLKDEV_ICK_ID("dsip_clk", "sh-mipi-dsi.1", &div6_clks[DIV6_DSI1P]),
CLKDEV_ICK_ID("dsiphy_clk", "sh-mipi-dsi.0", &dsi0phy_clk),
CLKDEV_ICK_ID("dsiphy_clk", "sh-mipi-dsi.1", &dsi1phy_clk),
/* MSTP32 clocks */ /* MSTP32 clocks */
CLKDEV_DEV_ID("i2c-sh_mobile.2", &mstp_clks[MSTP001]), /* I2C2 */ CLKDEV_DEV_ID("i2c-sh_mobile.2", &mstp_clks[MSTP001]), /* I2C2 */
@ -504,6 +614,9 @@ void __init sh73a0_clock_init(void)
if (!ret) if (!ret)
ret = sh_clk_mstp32_register(mstp_clks, MSTP_NR); ret = sh_clk_mstp32_register(mstp_clks, MSTP_NR);
for (k = 0; !ret && (k < ARRAY_SIZE(late_main_clks)); k++)
ret = clk_register(late_main_clks[k]);
clkdev_add_table(lookups, ARRAY_SIZE(lookups)); clkdev_add_table(lookups, ARRAY_SIZE(lookups));
if (!ret) if (!ret)

View File

@ -515,8 +515,8 @@ enum {
SHDMA_SLAVE_MMCIF_RX, SHDMA_SLAVE_MMCIF_RX,
}; };
/* PINT interrupts are located at Linux IRQ 768 and up */ /* PINT interrupts are located at Linux IRQ 800 and up */
#define SH73A0_PINT0_IRQ(irq) ((irq) + 768) #define SH73A0_PINT0_IRQ(irq) ((irq) + 800)
#define SH73A0_PINT1_IRQ(irq) ((irq) + 800) #define SH73A0_PINT1_IRQ(irq) ((irq) + 832)
#endif /* __ASM_SH73A0_H__ */ #endif /* __ASM_SH73A0_H__ */

View File

@ -19,6 +19,7 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/irq.h> #include <linux/irq.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/sh_intc.h> #include <linux/sh_intc.h>
@ -445,6 +446,7 @@ void __init sh73a0_init_irq(void)
setup_irq(gic_spi(1 + k), &sh73a0_irq_pin_cascade[k]); setup_irq(gic_spi(1 + k), &sh73a0_irq_pin_cascade[k]);
n = intcs_evt2irq(to_intc_vect(gic_spi(1 + k))); n = intcs_evt2irq(to_intc_vect(gic_spi(1 + k)));
WARN_ON(irq_alloc_desc_at(n, numa_node_id()) != n);
irq_set_chip_and_handler_name(n, &intca_gic_irq_chip, irq_set_chip_and_handler_name(n, &intca_gic_irq_chip,
handle_level_irq, "level"); handle_level_irq, "level");
set_irq_flags(n, IRQF_VALID); /* yuck */ set_irq_flags(n, IRQF_VALID); /* yuck */

View File

@ -2120,7 +2120,7 @@ static struct pinmux_cfg_reg pinmux_config_regs[] = {
FN_AUDATA3, 0, 0, 0 } FN_AUDATA3, 0, 0, 0 }
}, },
{ PINMUX_CFG_REG_VAR("IPSR4", 0xfffc0030, 32, { PINMUX_CFG_REG_VAR("IPSR4", 0xfffc0030, 32,
3, 1, 1, 1, 1, 1, 1, 3, 3, 1, 3, 1, 1, 1, 1, 1, 1, 3, 3,
1, 1, 1, 1, 1, 1, 3, 3, 3, 2) { 1, 1, 1, 1, 1, 1, 3, 3, 3, 2) {
/* IP4_31_29 [3] */ /* IP4_31_29 [3] */
FN_DU1_DB0, FN_VI2_DATA4_VI2_B4, FN_SCL2_B, FN_SD3_DAT0, FN_DU1_DB0, FN_VI2_DATA4_VI2_B4, FN_SCL2_B, FN_SD3_DAT0,

View File

@ -23,6 +23,7 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/gpio.h> #include <linux/gpio.h>
#include <mach/irqs.h>
#include <mach/sh7372.h> #include <mach/sh7372.h>
#define CPU_ALL_PORT(fn, pfx, sfx) \ #define CPU_ALL_PORT(fn, pfx, sfx) \
@ -1594,6 +1595,43 @@ static struct pinmux_data_reg pinmux_data_regs[] = {
{ }, { },
}; };
#define EXT_IRQ16L(n) evt2irq(0x200 + ((n) << 5))
#define EXT_IRQ16H(n) evt2irq(0x3200 + (((n) - 16) << 5))
static struct pinmux_irq pinmux_irqs[] = {
PINMUX_IRQ(EXT_IRQ16L(0), PORT6_FN0, PORT162_FN0),
PINMUX_IRQ(EXT_IRQ16L(1), PORT12_FN0),
PINMUX_IRQ(EXT_IRQ16L(2), PORT4_FN0, PORT5_FN0),
PINMUX_IRQ(EXT_IRQ16L(3), PORT8_FN0, PORT16_FN0),
PINMUX_IRQ(EXT_IRQ16L(4), PORT17_FN0, PORT163_FN0),
PINMUX_IRQ(EXT_IRQ16L(5), PORT18_FN0),
PINMUX_IRQ(EXT_IRQ16L(6), PORT39_FN0, PORT164_FN0),
PINMUX_IRQ(EXT_IRQ16L(7), PORT40_FN0, PORT167_FN0),
PINMUX_IRQ(EXT_IRQ16L(8), PORT41_FN0, PORT168_FN0),
PINMUX_IRQ(EXT_IRQ16L(9), PORT42_FN0, PORT169_FN0),
PINMUX_IRQ(EXT_IRQ16L(10), PORT65_FN0),
PINMUX_IRQ(EXT_IRQ16L(11), PORT67_FN0),
PINMUX_IRQ(EXT_IRQ16L(12), PORT80_FN0, PORT137_FN0),
PINMUX_IRQ(EXT_IRQ16L(13), PORT81_FN0, PORT145_FN0),
PINMUX_IRQ(EXT_IRQ16L(14), PORT82_FN0, PORT146_FN0),
PINMUX_IRQ(EXT_IRQ16L(15), PORT83_FN0, PORT147_FN0),
PINMUX_IRQ(EXT_IRQ16H(16), PORT84_FN0, PORT170_FN0),
PINMUX_IRQ(EXT_IRQ16H(17), PORT85_FN0),
PINMUX_IRQ(EXT_IRQ16H(18), PORT86_FN0),
PINMUX_IRQ(EXT_IRQ16H(19), PORT87_FN0),
PINMUX_IRQ(EXT_IRQ16H(20), PORT92_FN0),
PINMUX_IRQ(EXT_IRQ16H(21), PORT93_FN0),
PINMUX_IRQ(EXT_IRQ16H(22), PORT94_FN0),
PINMUX_IRQ(EXT_IRQ16H(23), PORT95_FN0),
PINMUX_IRQ(EXT_IRQ16H(24), PORT112_FN0),
PINMUX_IRQ(EXT_IRQ16H(25), PORT119_FN0),
PINMUX_IRQ(EXT_IRQ16H(26), PORT121_FN0, PORT172_FN0),
PINMUX_IRQ(EXT_IRQ16H(27), PORT122_FN0, PORT180_FN0),
PINMUX_IRQ(EXT_IRQ16H(28), PORT123_FN0, PORT181_FN0),
PINMUX_IRQ(EXT_IRQ16H(29), PORT129_FN0, PORT182_FN0),
PINMUX_IRQ(EXT_IRQ16H(30), PORT130_FN0, PORT183_FN0),
PINMUX_IRQ(EXT_IRQ16H(31), PORT138_FN0, PORT184_FN0),
};
static struct pinmux_info sh7372_pinmux_info = { static struct pinmux_info sh7372_pinmux_info = {
.name = "sh7372_pfc", .name = "sh7372_pfc",
.reserved_id = PINMUX_RESERVED, .reserved_id = PINMUX_RESERVED,
@ -1614,6 +1652,9 @@ static struct pinmux_info sh7372_pinmux_info = {
.gpio_data = pinmux_data, .gpio_data = pinmux_data,
.gpio_data_size = ARRAY_SIZE(pinmux_data), .gpio_data_size = ARRAY_SIZE(pinmux_data),
.gpio_irq = pinmux_irqs,
.gpio_irq_size = ARRAY_SIZE(pinmux_irqs),
}; };
void sh7372_pinmux_init(void) void sh7372_pinmux_init(void)

View File

@ -80,7 +80,7 @@ int __cpuinit sh73a0_boot_secondary(unsigned int cpu)
/* enable cache coherency */ /* enable cache coherency */
modify_scu_cpu_psr(0, 3 << (cpu * 8)); modify_scu_cpu_psr(0, 3 << (cpu * 8));
if (((__raw_readw(__io(PSTR)) >> (4 * cpu)) & 3) == 3) if (((__raw_readl(__io(PSTR)) >> (4 * cpu)) & 3) == 3)
__raw_writel(1 << cpu, __io(WUPCR)); /* wake up */ __raw_writel(1 << cpu, __io(WUPCR)); /* wake up */
else else
__raw_writel(1 << cpu, __io(SRESCR)); /* reset */ __raw_writel(1 << cpu, __io(SRESCR)); /* reset */

View File

@ -13,7 +13,7 @@ obj-y += linked_dtb.o
endif endif
$(obj)/%.dtb: $(src)/dts/%.dts FORCE $(obj)/%.dtb: $(src)/dts/%.dts FORCE
$(call cmd,dtc) $(call if_changed_dep,dtc)
quiet_cmd_cp = CP $< $@$2 quiet_cmd_cp = CP $< $@$2
cmd_cp = cat $< >$@$2 || (rm -f $@ && echo false) cmd_cp = cat $< >$@$2 || (rm -f $@ && echo false)

View File

@ -168,6 +168,11 @@ static struct resource sh_eth_giga1_resources[] = {
.start = 0xfee00800, .start = 0xfee00800,
.end = 0xfee00fff, .end = 0xfee00fff,
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM,
}, {
/* TSU */
.start = 0xfee01800,
.end = 0xfee01fff,
.flags = IORESOURCE_MEM,
}, { }, {
.start = 316, .start = 316,
.end = 316, .end = 316,
@ -210,20 +215,13 @@ static struct resource sh_mmcif_resources[] = {
}, },
}; };
static struct sh_mmcif_dma sh7757lcr_mmcif_dma = {
.chan_priv_tx = {
.slave_id = SHDMA_SLAVE_MMCIF_TX,
},
.chan_priv_rx = {
.slave_id = SHDMA_SLAVE_MMCIF_RX,
}
};
static struct sh_mmcif_plat_data sh_mmcif_plat = { static struct sh_mmcif_plat_data sh_mmcif_plat = {
.dma = &sh7757lcr_mmcif_dma,
.sup_pclk = 0x0f, .sup_pclk = 0x0f,
.caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA, .caps = MMC_CAP_4_BIT_DATA | MMC_CAP_8_BIT_DATA |
MMC_CAP_NONREMOVABLE,
.ocr = MMC_VDD_32_33 | MMC_VDD_33_34, .ocr = MMC_VDD_32_33 | MMC_VDD_33_34,
.slave_id_tx = SHDMA_SLAVE_MMCIF_TX,
.slave_id_rx = SHDMA_SLAVE_MMCIF_RX,
}; };
static struct platform_device sh_mmcif_device = { static struct platform_device sh_mmcif_device = {

View File

@ -22,6 +22,7 @@
#include <linux/i2c.h> #include <linux/i2c.h>
#include <linux/smsc911x.h> #include <linux/smsc911x.h>
#include <linux/gpio.h> #include <linux/gpio.h>
#include <linux/videodev2.h>
#include <media/ov772x.h> #include <media/ov772x.h>
#include <media/soc_camera.h> #include <media/soc_camera.h>
#include <media/soc_camera_platform.h> #include <media/soc_camera_platform.h>

View File

@ -29,9 +29,11 @@
#include <linux/input.h> #include <linux/input.h>
#include <linux/input/sh_keysc.h> #include <linux/input/sh_keysc.h>
#include <linux/sh_eth.h> #include <linux/sh_eth.h>
#include <linux/videodev2.h>
#include <video/sh_mobile_lcdc.h> #include <video/sh_mobile_lcdc.h>
#include <sound/sh_fsi.h> #include <sound/sh_fsi.h>
#include <media/sh_mobile_ceu.h> #include <media/sh_mobile_ceu.h>
#include <media/soc_camera.h>
#include <media/tw9910.h> #include <media/tw9910.h>
#include <media/mt9t112.h> #include <media/mt9t112.h>
#include <asm/heartbeat.h> #include <asm/heartbeat.h>

View File

@ -22,6 +22,7 @@
#include <linux/input/sh_keysc.h> #include <linux/input/sh_keysc.h>
#include <linux/i2c.h> #include <linux/i2c.h>
#include <linux/usb/r8a66597.h> #include <linux/usb/r8a66597.h>
#include <linux/videodev2.h>
#include <media/rj54n1cb0c.h> #include <media/rj54n1cb0c.h>
#include <media/soc_camera.h> #include <media/soc_camera.h>
#include <media/sh_mobile_ceu.h> #include <media/sh_mobile_ceu.h>

View File

@ -21,9 +21,11 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/clk.h> #include <linux/clk.h>
#include <linux/gpio.h> #include <linux/gpio.h>
#include <linux/videodev2.h>
#include <video/sh_mobile_lcdc.h> #include <video/sh_mobile_lcdc.h>
#include <media/sh_mobile_ceu.h> #include <media/sh_mobile_ceu.h>
#include <media/ov772x.h> #include <media/ov772x.h>
#include <media/soc_camera.h>
#include <media/tw9910.h> #include <media/tw9910.h>
#include <asm/clock.h> #include <asm/clock.h>
#include <asm/machvec.h> #include <asm/machvec.h>

View File

@ -24,6 +24,7 @@
#include <linux/input/sh_keysc.h> #include <linux/input/sh_keysc.h>
#include <linux/usb/r8a66597.h> #include <linux/usb/r8a66597.h>
#include <linux/sh_eth.h> #include <linux/sh_eth.h>
#include <linux/videodev2.h>
#include <video/sh_mobile_lcdc.h> #include <video/sh_mobile_lcdc.h>
#include <media/sh_mobile_ceu.h> #include <media/sh_mobile_ceu.h>
#include <sound/sh_fsi.h> #include <sound/sh_fsi.h>

View File

@ -74,7 +74,7 @@ struct pci_errors {
{ SH4_PCIINT_MLCK, "master lock error" }, { SH4_PCIINT_MLCK, "master lock error" },
{ SH4_PCIINT_TABT, "target-target abort" }, { SH4_PCIINT_TABT, "target-target abort" },
{ SH4_PCIINT_TRET, "target retry time out" }, { SH4_PCIINT_TRET, "target retry time out" },
{ SH4_PCIINT_MFDE, "master function disable erorr" }, { SH4_PCIINT_MFDE, "master function disable error" },
{ SH4_PCIINT_PRTY, "address parity error" }, { SH4_PCIINT_PRTY, "address parity error" },
{ SH4_PCIINT_SERR, "SERR" }, { SH4_PCIINT_SERR, "SERR" },
{ SH4_PCIINT_TWDP, "data parity error for target write" }, { SH4_PCIINT_TWDP, "data parity error for target write" },

View File

@ -3,9 +3,10 @@
* *
* This file is released under the GPLv2 * This file is released under the GPLv2
*/ */
#ifndef __ASM_SH_DEVICE_H
#define __ASM_SH_DEVICE_H
struct dev_archdata { #include <asm-generic/device.h>
};
struct platform_device; struct platform_device;
/* allocate contiguous memory chunk and fill in struct resource */ /* allocate contiguous memory chunk and fill in struct resource */
@ -14,5 +15,4 @@ int platform_resource_setup_memory(struct platform_device *pdev,
void plat_early_device_setup(void); void plat_early_device_setup(void);
struct pdev_archdata { #endif /* __ASM_SH_DEVICE_H */
};

View File

@ -343,7 +343,7 @@ static struct clk_lookup lookups[] = {
CLKDEV_DEV_ID("sh_mobile_ceu.1", &mstp_clks[HWBLK_CEU1]), CLKDEV_DEV_ID("sh_mobile_ceu.1", &mstp_clks[HWBLK_CEU1]),
CLKDEV_CON_ID("beu1", &mstp_clks[HWBLK_BEU1]), CLKDEV_CON_ID("beu1", &mstp_clks[HWBLK_BEU1]),
CLKDEV_CON_ID("2ddmac0", &mstp_clks[HWBLK_2DDMAC]), CLKDEV_CON_ID("2ddmac0", &mstp_clks[HWBLK_2DDMAC]),
CLKDEV_CON_ID("spu0", &mstp_clks[HWBLK_SPU]), CLKDEV_DEV_ID("sh_fsi.0", &mstp_clks[HWBLK_SPU]),
CLKDEV_CON_ID("jpu0", &mstp_clks[HWBLK_JPU]), CLKDEV_CON_ID("jpu0", &mstp_clks[HWBLK_JPU]),
CLKDEV_DEV_ID("sh-vou.0", &mstp_clks[HWBLK_VOU]), CLKDEV_DEV_ID("sh-vou.0", &mstp_clks[HWBLK_VOU]),
CLKDEV_CON_ID("beu0", &mstp_clks[HWBLK_BEU0]), CLKDEV_CON_ID("beu0", &mstp_clks[HWBLK_BEU0]),

View File

@ -133,7 +133,7 @@ static struct resource spi0_resources[] = {
[0] = { [0] = {
.start = 0xfe002000, .start = 0xfe002000,
.end = 0xfe0020ff, .end = 0xfe0020ff,
.flags = IORESOURCE_MEM, .flags = IORESOURCE_MEM | IORESOURCE_MEM_32BIT,
}, },
[1] = { [1] = {
.start = 86, .start = 86,
@ -661,6 +661,25 @@ static struct platform_device spi0_device = {
.resource = spi0_resources, .resource = spi0_resources,
}; };
static struct resource spi1_resources[] = {
{
.start = 0xffd8ee70,
.end = 0xffd8eeff,
.flags = IORESOURCE_MEM | IORESOURCE_MEM_8BIT,
},
{
.start = 54,
.flags = IORESOURCE_IRQ,
},
};
static struct platform_device spi1_device = {
.name = "sh_spi",
.id = 1,
.num_resources = ARRAY_SIZE(spi1_resources),
.resource = spi1_resources,
};
static struct resource usb_ehci_resources[] = { static struct resource usb_ehci_resources[] = {
[0] = { [0] = {
.start = 0xfe4f1000, .start = 0xfe4f1000,
@ -720,6 +739,7 @@ static struct platform_device *sh7757_devices[] __initdata = {
&dma2_device, &dma2_device,
&dma3_device, &dma3_device,
&spi0_device, &spi0_device,
&spi1_device,
&usb_ehci_device, &usb_ehci_device,
&usb_ohci_device, &usb_ohci_device,
}; };

View File

@ -63,7 +63,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
mp_ops->prepare_cpus(max_cpus); mp_ops->prepare_cpus(max_cpus);
#ifndef CONFIG_HOTPLUG_CPU #ifndef CONFIG_HOTPLUG_CPU
init_cpu_present(&cpu_possible_map); init_cpu_present(cpu_possible_mask);
#endif #endif
} }

View File

@ -27,7 +27,7 @@ static cpumask_t cpu_coregroup_map(unsigned int cpu)
* Presently all SH-X3 SMP cores are multi-cores, so just keep it * Presently all SH-X3 SMP cores are multi-cores, so just keep it
* simple until we have a method for determining topology.. * simple until we have a method for determining topology..
*/ */
return cpu_possible_map; return *cpu_possible_mask;
} }
const struct cpumask *cpu_coregroup_mask(unsigned int cpu) const struct cpumask *cpu_coregroup_mask(unsigned int cpu)

View File

@ -23,6 +23,7 @@
#define MAX_OCACHE_PAGES 32 #define MAX_OCACHE_PAGES 32
#define MAX_ICACHE_PAGES 32 #define MAX_ICACHE_PAGES 32
#ifdef CONFIG_CACHE_WRITEBACK
static void sh2a_flush_oc_line(unsigned long v, int way) static void sh2a_flush_oc_line(unsigned long v, int way)
{ {
unsigned long addr = (v & 0x000007f0) | (way << 11); unsigned long addr = (v & 0x000007f0) | (way << 11);
@ -34,6 +35,7 @@ static void sh2a_flush_oc_line(unsigned long v, int way)
__raw_writel(data, CACHE_OC_ADDRESS_ARRAY | addr); __raw_writel(data, CACHE_OC_ADDRESS_ARRAY | addr);
} }
} }
#endif
static void sh2a_invalidate_line(unsigned long cache_addr, unsigned long v) static void sh2a_invalidate_line(unsigned long cache_addr, unsigned long v)
{ {

View File

@ -1141,7 +1141,9 @@ asmlinkage void __init xen_start_kernel(void)
/* Prevent unwanted bits from being set in PTEs. */ /* Prevent unwanted bits from being set in PTEs. */
__supported_pte_mask &= ~_PAGE_GLOBAL; __supported_pte_mask &= ~_PAGE_GLOBAL;
#if 0
if (!xen_initial_domain()) if (!xen_initial_domain())
#endif
__supported_pte_mask &= ~(_PAGE_PWT | _PAGE_PCD); __supported_pte_mask &= ~(_PAGE_PWT | _PAGE_PCD);
__supported_pte_mask |= _PAGE_IOMAP; __supported_pte_mask |= _PAGE_IOMAP;
@ -1204,10 +1206,6 @@ asmlinkage void __init xen_start_kernel(void)
pgd = (pgd_t *)xen_start_info->pt_base; pgd = (pgd_t *)xen_start_info->pt_base;
if (!xen_initial_domain())
__supported_pte_mask &= ~(_PAGE_PWT | _PAGE_PCD);
__supported_pte_mask |= _PAGE_IOMAP;
/* Don't do the full vcpu_info placement stuff until we have a /* Don't do the full vcpu_info placement stuff until we have a
possible map and a non-dummy shared_info. */ possible map and a non-dummy shared_info. */
per_cpu(xen_vcpu, 0) = &HYPERVISOR_shared_info->vcpu_info[0]; per_cpu(xen_vcpu, 0) = &HYPERVISOR_shared_info->vcpu_info[0];

View File

@ -415,13 +415,13 @@ static pteval_t iomap_pte(pteval_t val)
static pteval_t xen_pte_val(pte_t pte) static pteval_t xen_pte_val(pte_t pte)
{ {
pteval_t pteval = pte.pte; pteval_t pteval = pte.pte;
#if 0
/* If this is a WC pte, convert back from Xen WC to Linux WC */ /* If this is a WC pte, convert back from Xen WC to Linux WC */
if ((pteval & (_PAGE_PAT | _PAGE_PCD | _PAGE_PWT)) == _PAGE_PAT) { if ((pteval & (_PAGE_PAT | _PAGE_PCD | _PAGE_PWT)) == _PAGE_PAT) {
WARN_ON(!pat_enabled); WARN_ON(!pat_enabled);
pteval = (pteval & ~_PAGE_PAT) | _PAGE_PWT; pteval = (pteval & ~_PAGE_PAT) | _PAGE_PWT;
} }
#endif
if (xen_initial_domain() && (pteval & _PAGE_IOMAP)) if (xen_initial_domain() && (pteval & _PAGE_IOMAP))
return pteval; return pteval;
@ -463,7 +463,7 @@ void xen_set_pat(u64 pat)
static pte_t xen_make_pte(pteval_t pte) static pte_t xen_make_pte(pteval_t pte)
{ {
phys_addr_t addr = (pte & PTE_PFN_MASK); phys_addr_t addr = (pte & PTE_PFN_MASK);
#if 0
/* If Linux is trying to set a WC pte, then map to the Xen WC. /* If Linux is trying to set a WC pte, then map to the Xen WC.
* If _PAGE_PAT is set, then it probably means it is really * If _PAGE_PAT is set, then it probably means it is really
* _PAGE_PSE, so avoid fiddling with the PAT mapping and hope * _PAGE_PSE, so avoid fiddling with the PAT mapping and hope
@ -476,7 +476,7 @@ static pte_t xen_make_pte(pteval_t pte)
if ((pte & (_PAGE_PCD | _PAGE_PWT)) == _PAGE_PWT) if ((pte & (_PAGE_PCD | _PAGE_PWT)) == _PAGE_PWT)
pte = (pte & ~(_PAGE_PCD | _PAGE_PWT)) | _PAGE_PAT; pte = (pte & ~(_PAGE_PCD | _PAGE_PWT)) | _PAGE_PAT;
} }
#endif
/* /*
* Unprivileged domains are allowed to do IOMAPpings for * Unprivileged domains are allowed to do IOMAPpings for
* PCI passthrough, but not map ISA space. The ISA * PCI passthrough, but not map ISA space. The ISA

View File

@ -1206,9 +1206,9 @@ static int fpga_probe(struct pci_dev *dev, const struct pci_device_id *id)
out_unmap_both: out_unmap_both:
pci_set_drvdata(dev, NULL); pci_set_drvdata(dev, NULL);
pci_iounmap(dev, card->config_regs);
out_unmap_config:
pci_iounmap(dev, card->buffers); pci_iounmap(dev, card->buffers);
out_unmap_config:
pci_iounmap(dev, card->config_regs);
out_release_regions: out_release_regions:
pci_release_regions(dev); pci_release_regions(dev);
out: out:

View File

@ -102,6 +102,7 @@ static struct usb_device_id btusb_table[] = {
/* Broadcom BCM20702A0 */ /* Broadcom BCM20702A0 */
{ USB_DEVICE(0x0a5c, 0x21e3) }, { USB_DEVICE(0x0a5c, 0x21e3) },
{ USB_DEVICE(0x0a5c, 0x21f3) },
{ USB_DEVICE(0x413c, 0x8197) }, { USB_DEVICE(0x413c, 0x8197) },
{ } /* Terminating entry */ { } /* Terminating entry */
@ -726,9 +727,6 @@ static int btusb_send_frame(struct sk_buff *skb)
usb_fill_bulk_urb(urb, data->udev, pipe, usb_fill_bulk_urb(urb, data->udev, pipe,
skb->data, skb->len, btusb_tx_complete, skb); skb->data, skb->len, btusb_tx_complete, skb);
if (skb->priority >= HCI_PRIO_MAX - 1)
urb->transfer_flags = URB_ISO_ASAP;
hdev->stat.acl_tx++; hdev->stat.acl_tx++;
break; break;

View File

@ -271,7 +271,7 @@ static int ads1015_probe(struct i2c_client *client,
continue; continue;
err = device_create_file(&client->dev, &ads1015_in[k].dev_attr); err = device_create_file(&client->dev, &ads1015_in[k].dev_attr);
if (err) if (err)
goto exit_free; goto exit_remove;
} }
data->hwmon_dev = hwmon_device_register(&client->dev); data->hwmon_dev = hwmon_device_register(&client->dev);
@ -285,7 +285,6 @@ static int ads1015_probe(struct i2c_client *client,
exit_remove: exit_remove:
for (k = 0; k < ADS1015_CHANNELS; ++k) for (k = 0; k < ADS1015_CHANNELS; ++k)
device_remove_file(&client->dev, &ads1015_in[k].dev_attr); device_remove_file(&client->dev, &ads1015_in[k].dev_attr);
exit_free:
kfree(data); kfree(data);
exit: exit:
return err; return err;

View File

@ -340,8 +340,6 @@ static int set_pwm_enable_direct(struct i2c_client *client, int nr, int val)
fanmode |= (1 << F75387_FAN_MANU_MODE(nr)); fanmode |= (1 << F75387_FAN_MANU_MODE(nr));
fanmode |= (1 << F75387_FAN_DUTY_MODE(nr)); fanmode |= (1 << F75387_FAN_DUTY_MODE(nr));
data->pwm[nr] = 255; data->pwm[nr] = 255;
f75375_write8(client, F75375_REG_FAN_PWM_DUTY(nr),
data->pwm[nr]);
break; break;
case 1: /* PWM */ case 1: /* PWM */
fanmode |= (1 << F75387_FAN_MANU_MODE(nr)); fanmode |= (1 << F75387_FAN_MANU_MODE(nr));
@ -361,8 +359,6 @@ static int set_pwm_enable_direct(struct i2c_client *client, int nr, int val)
case 0: /* full speed */ case 0: /* full speed */
fanmode |= (3 << FAN_CTRL_MODE(nr)); fanmode |= (3 << FAN_CTRL_MODE(nr));
data->pwm[nr] = 255; data->pwm[nr] = 255;
f75375_write8(client, F75375_REG_FAN_PWM_DUTY(nr),
data->pwm[nr]);
break; break;
case 1: /* PWM */ case 1: /* PWM */
fanmode |= (3 << FAN_CTRL_MODE(nr)); fanmode |= (3 << FAN_CTRL_MODE(nr));
@ -377,6 +373,9 @@ static int set_pwm_enable_direct(struct i2c_client *client, int nr, int val)
f75375_write8(client, F75375_REG_FAN_TIMER, fanmode); f75375_write8(client, F75375_REG_FAN_TIMER, fanmode);
data->pwm_enable[nr] = val; data->pwm_enable[nr] = val;
if (val == 0)
f75375_write8(client, F75375_REG_FAN_PWM_DUTY(nr),
data->pwm[nr]);
return 0; return 0;
} }

View File

@ -72,8 +72,8 @@ static unsigned short normal_i2c[] = { 0x2c, 0x2e, 0x2f, I2C_CLIENT_END };
static const int rpm_ranges[] = { 2000, 4000, 8000, 16000 }; static const int rpm_ranges[] = { 2000, 4000, 8000, 16000 };
#define FAN_FROM_REG(val, div, rpm_range) ((val) == 0 ? -1 : \ #define FAN_FROM_REG(val, rpm_range) ((val) == 0 || (val) == 255 ? \
(val) == 255 ? 0 : (rpm_ranges[rpm_range] * 30) / ((div + 1) * (val))) 0 : (rpm_ranges[rpm_range] * 30) / (val))
#define TEMP_LIMIT_TO_REG(val) SENSORS_LIMIT((val) / 1000, 0, 255) #define TEMP_LIMIT_TO_REG(val) SENSORS_LIMIT((val) / 1000, 0, 255)
/* /*
@ -333,7 +333,7 @@ static ssize_t show_fan_input(struct device *dev,
return PTR_ERR(data); return PTR_ERR(data);
return sprintf(buf, "%d\n", FAN_FROM_REG(data->fan[attr->index], return sprintf(buf, "%d\n", FAN_FROM_REG(data->fan[attr->index],
data->ppr, data->rpm_range)); data->rpm_range));
} }
static ssize_t show_alarm(struct device *dev, static ssize_t show_alarm(struct device *dev,
@ -429,9 +429,9 @@ static int max6639_init_client(struct i2c_client *client)
struct max6639_data *data = i2c_get_clientdata(client); struct max6639_data *data = i2c_get_clientdata(client);
struct max6639_platform_data *max6639_info = struct max6639_platform_data *max6639_info =
client->dev.platform_data; client->dev.platform_data;
int i = 0; int i;
int rpm_range = 1; /* default: 4000 RPM */ int rpm_range = 1; /* default: 4000 RPM */
int err = 0; int err;
/* Reset chip to default values, see below for GCONFIG setup */ /* Reset chip to default values, see below for GCONFIG setup */
err = i2c_smbus_write_byte_data(client, MAX6639_REG_GCONFIG, err = i2c_smbus_write_byte_data(client, MAX6639_REG_GCONFIG,
@ -446,11 +446,6 @@ static int max6639_init_client(struct i2c_client *client)
else else
data->ppr = 2; data->ppr = 2;
data->ppr -= 1; data->ppr -= 1;
err = i2c_smbus_write_byte_data(client,
MAX6639_REG_FAN_PPR(i),
data->ppr << 5);
if (err)
goto exit;
if (max6639_info) if (max6639_info)
rpm_range = rpm_range_to_reg(max6639_info->rpm_range); rpm_range = rpm_range_to_reg(max6639_info->rpm_range);
@ -458,6 +453,13 @@ static int max6639_init_client(struct i2c_client *client)
for (i = 0; i < 2; i++) { for (i = 0; i < 2; i++) {
/* Set Fan pulse per revolution */
err = i2c_smbus_write_byte_data(client,
MAX6639_REG_FAN_PPR(i),
data->ppr << 6);
if (err)
goto exit;
/* Fans config PWM, RPM */ /* Fans config PWM, RPM */
err = i2c_smbus_write_byte_data(client, err = i2c_smbus_write_byte_data(client,
MAX6639_REG_FAN_CONFIG1(i), MAX6639_REG_FAN_CONFIG1(i),

View File

@ -82,7 +82,7 @@ static int max34440_write_word_data(struct i2c_client *client, int page,
case PMBUS_VIRT_RESET_TEMP_HISTORY: case PMBUS_VIRT_RESET_TEMP_HISTORY:
ret = pmbus_write_word_data(client, page, ret = pmbus_write_word_data(client, page,
MAX34440_MFR_TEMPERATURE_PEAK, MAX34440_MFR_TEMPERATURE_PEAK,
0xffff); 0x8000);
break; break;
default: default:
ret = -ENODATA; ret = -ENODATA;

View File

@ -4,8 +4,8 @@
menu "Texas Instruments WL128x FM driver (ST based)" menu "Texas Instruments WL128x FM driver (ST based)"
config RADIO_WL128X config RADIO_WL128X
tristate "Texas Instruments WL128x FM Radio" tristate "Texas Instruments WL128x FM Radio"
depends on VIDEO_V4L2 && RFKILL depends on VIDEO_V4L2 && RFKILL && GPIOLIB
select TI_ST if NET && GPIOLIB select TI_ST if NET
help help
Choose Y here if you have this FM radio chip. Choose Y here if you have this FM radio chip.

View File

@ -47,7 +47,7 @@
#define MOD_AUTHOR "Jarod Wilson <jarod@wilsonet.com>" #define MOD_AUTHOR "Jarod Wilson <jarod@wilsonet.com>"
#define MOD_DESC "Driver for SoundGraph iMON MultiMedia IR/Display" #define MOD_DESC "Driver for SoundGraph iMON MultiMedia IR/Display"
#define MOD_NAME "imon" #define MOD_NAME "imon"
#define MOD_VERSION "0.9.3" #define MOD_VERSION "0.9.4"
#define DISPLAY_MINOR_BASE 144 #define DISPLAY_MINOR_BASE 144
#define DEVICE_NAME "lcd%d" #define DEVICE_NAME "lcd%d"
@ -1658,9 +1658,17 @@ static void usb_rx_callback_intf0(struct urb *urb)
return; return;
ictx = (struct imon_context *)urb->context; ictx = (struct imon_context *)urb->context;
if (!ictx || !ictx->dev_present_intf0) if (!ictx)
return; return;
/*
* if we get a callback before we're done configuring the hardware, we
* can't yet process the data, as there's nowhere to send it, but we
* still need to submit a new rx URB to avoid wedging the hardware
*/
if (!ictx->dev_present_intf0)
goto out;
switch (urb->status) { switch (urb->status) {
case -ENOENT: /* usbcore unlink successful! */ case -ENOENT: /* usbcore unlink successful! */
return; return;
@ -1678,6 +1686,7 @@ static void usb_rx_callback_intf0(struct urb *urb)
break; break;
} }
out:
usb_submit_urb(ictx->rx_urb_intf0, GFP_ATOMIC); usb_submit_urb(ictx->rx_urb_intf0, GFP_ATOMIC);
} }
@ -1690,9 +1699,17 @@ static void usb_rx_callback_intf1(struct urb *urb)
return; return;
ictx = (struct imon_context *)urb->context; ictx = (struct imon_context *)urb->context;
if (!ictx || !ictx->dev_present_intf1) if (!ictx)
return; return;
/*
* if we get a callback before we're done configuring the hardware, we
* can't yet process the data, as there's nowhere to send it, but we
* still need to submit a new rx URB to avoid wedging the hardware
*/
if (!ictx->dev_present_intf1)
goto out;
switch (urb->status) { switch (urb->status) {
case -ENOENT: /* usbcore unlink successful! */ case -ENOENT: /* usbcore unlink successful! */
return; return;
@ -1710,6 +1727,7 @@ static void usb_rx_callback_intf1(struct urb *urb)
break; break;
} }
out:
usb_submit_urb(ictx->rx_urb_intf1, GFP_ATOMIC); usb_submit_urb(ictx->rx_urb_intf1, GFP_ATOMIC);
} }
@ -2242,7 +2260,7 @@ find_endpoint_failed:
mutex_unlock(&ictx->lock); mutex_unlock(&ictx->lock);
usb_free_urb(rx_urb); usb_free_urb(rx_urb);
rx_urb_alloc_failed: rx_urb_alloc_failed:
dev_err(ictx->dev, "unable to initialize intf0, err %d\n", ret); dev_err(ictx->dev, "unable to initialize intf1, err %d\n", ret);
return NULL; return NULL;
} }

View File

@ -154,10 +154,20 @@ static int device_authorization(struct hdpvr_device *dev)
} }
#endif #endif
v4l2_info(&dev->v4l2_dev, "firmware version 0x%x dated %s\n", dev->fw_ver = dev->usbc_buf[1];
dev->usbc_buf[1], &dev->usbc_buf[2]);
switch (dev->usbc_buf[1]) { v4l2_info(&dev->v4l2_dev, "firmware version 0x%x dated %s\n",
dev->fw_ver, &dev->usbc_buf[2]);
if (dev->fw_ver > 0x15) {
dev->options.brightness = 0x80;
dev->options.contrast = 0x40;
dev->options.hue = 0xf;
dev->options.saturation = 0x40;
dev->options.sharpness = 0x80;
}
switch (dev->fw_ver) {
case HDPVR_FIRMWARE_VERSION: case HDPVR_FIRMWARE_VERSION:
dev->flags &= ~HDPVR_FLAG_AC3_CAP; dev->flags &= ~HDPVR_FLAG_AC3_CAP;
break; break;
@ -169,7 +179,7 @@ static int device_authorization(struct hdpvr_device *dev)
default: default:
v4l2_info(&dev->v4l2_dev, "untested firmware, the driver might" v4l2_info(&dev->v4l2_dev, "untested firmware, the driver might"
" not work.\n"); " not work.\n");
if (dev->usbc_buf[1] >= HDPVR_FIRMWARE_VERSION_AC3) if (dev->fw_ver >= HDPVR_FIRMWARE_VERSION_AC3)
dev->flags |= HDPVR_FLAG_AC3_CAP; dev->flags |= HDPVR_FLAG_AC3_CAP;
else else
dev->flags &= ~HDPVR_FLAG_AC3_CAP; dev->flags &= ~HDPVR_FLAG_AC3_CAP;
@ -270,6 +280,8 @@ static const struct hdpvr_options hdpvr_default_options = {
.bitrate_mode = HDPVR_CONSTANT, .bitrate_mode = HDPVR_CONSTANT,
.gop_mode = HDPVR_SIMPLE_IDR_GOP, .gop_mode = HDPVR_SIMPLE_IDR_GOP,
.audio_codec = V4L2_MPEG_AUDIO_ENCODING_AAC, .audio_codec = V4L2_MPEG_AUDIO_ENCODING_AAC,
/* original picture controls for firmware version <= 0x15 */
/* updated in device_authorization() for newer firmware */
.brightness = 0x86, .brightness = 0x86,
.contrast = 0x80, .contrast = 0x80,
.hue = 0x80, .hue = 0x80,

View File

@ -283,12 +283,13 @@ static int hdpvr_start_streaming(struct hdpvr_device *dev)
hdpvr_config_call(dev, CTRL_START_STREAMING_VALUE, 0x00); hdpvr_config_call(dev, CTRL_START_STREAMING_VALUE, 0x00);
dev->status = STATUS_STREAMING;
INIT_WORK(&dev->worker, hdpvr_transmit_buffers); INIT_WORK(&dev->worker, hdpvr_transmit_buffers);
queue_work(dev->workqueue, &dev->worker); queue_work(dev->workqueue, &dev->worker);
v4l2_dbg(MSG_BUFFER, hdpvr_debug, &dev->v4l2_dev, v4l2_dbg(MSG_BUFFER, hdpvr_debug, &dev->v4l2_dev,
"streaming started\n"); "streaming started\n");
dev->status = STATUS_STREAMING;
return 0; return 0;
} }
@ -722,21 +723,39 @@ static const s32 supported_v4l2_ctrls[] = {
}; };
static int fill_queryctrl(struct hdpvr_options *opt, struct v4l2_queryctrl *qc, static int fill_queryctrl(struct hdpvr_options *opt, struct v4l2_queryctrl *qc,
int ac3) int ac3, int fw_ver)
{ {
int err; int err;
if (fw_ver > 0x15) {
switch (qc->id) {
case V4L2_CID_BRIGHTNESS:
return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80);
case V4L2_CID_CONTRAST:
return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x40);
case V4L2_CID_SATURATION:
return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x40);
case V4L2_CID_HUE:
return v4l2_ctrl_query_fill(qc, 0x0, 0x1e, 1, 0xf);
case V4L2_CID_SHARPNESS:
return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80);
}
} else {
switch (qc->id) {
case V4L2_CID_BRIGHTNESS:
return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x86);
case V4L2_CID_CONTRAST:
return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80);
case V4L2_CID_SATURATION:
return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80);
case V4L2_CID_HUE:
return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80);
case V4L2_CID_SHARPNESS:
return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80);
}
}
switch (qc->id) { switch (qc->id) {
case V4L2_CID_BRIGHTNESS:
return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x86);
case V4L2_CID_CONTRAST:
return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80);
case V4L2_CID_SATURATION:
return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80);
case V4L2_CID_HUE:
return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80);
case V4L2_CID_SHARPNESS:
return v4l2_ctrl_query_fill(qc, 0x0, 0xff, 1, 0x80);
case V4L2_CID_MPEG_AUDIO_ENCODING: case V4L2_CID_MPEG_AUDIO_ENCODING:
return v4l2_ctrl_query_fill( return v4l2_ctrl_query_fill(
qc, V4L2_MPEG_AUDIO_ENCODING_AAC, qc, V4L2_MPEG_AUDIO_ENCODING_AAC,
@ -794,7 +813,8 @@ static int vidioc_queryctrl(struct file *file, void *private_data,
if (qc->id == supported_v4l2_ctrls[i]) if (qc->id == supported_v4l2_ctrls[i])
return fill_queryctrl(&dev->options, qc, return fill_queryctrl(&dev->options, qc,
dev->flags & HDPVR_FLAG_AC3_CAP); dev->flags & HDPVR_FLAG_AC3_CAP,
dev->fw_ver);
if (qc->id < supported_v4l2_ctrls[i]) if (qc->id < supported_v4l2_ctrls[i])
break; break;

View File

@ -113,6 +113,7 @@ struct hdpvr_device {
/* usb control transfer buffer and lock */ /* usb control transfer buffer and lock */
struct mutex usbc_mutex; struct mutex usbc_mutex;
u8 *usbc_buf; u8 *usbc_buf;
u8 fw_ver;
}; };
static inline struct hdpvr_device *to_hdpvr_dev(struct v4l2_device *v4l2_dev) static inline struct hdpvr_device *to_hdpvr_dev(struct v4l2_device *v4l2_dev)

View File

@ -1407,7 +1407,7 @@ static int __ccdc_handle_stopping(struct isp_ccdc_device *ccdc, u32 event)
static void ccdc_hs_vs_isr(struct isp_ccdc_device *ccdc) static void ccdc_hs_vs_isr(struct isp_ccdc_device *ccdc)
{ {
struct isp_pipeline *pipe = to_isp_pipeline(&ccdc->subdev.entity); struct isp_pipeline *pipe = to_isp_pipeline(&ccdc->subdev.entity);
struct video_device *vdev = &ccdc->subdev.devnode; struct video_device *vdev = ccdc->subdev.devnode;
struct v4l2_event event; struct v4l2_event event;
memset(&event, 0, sizeof(event)); memset(&event, 0, sizeof(event));

View File

@ -95,11 +95,16 @@ static void sja1000_write_cmdreg(struct sja1000_priv *priv, u8 val)
spin_unlock_irqrestore(&priv->cmdreg_lock, flags); spin_unlock_irqrestore(&priv->cmdreg_lock, flags);
} }
static int sja1000_is_absent(struct sja1000_priv *priv)
{
return (priv->read_reg(priv, REG_MOD) == 0xFF);
}
static int sja1000_probe_chip(struct net_device *dev) static int sja1000_probe_chip(struct net_device *dev)
{ {
struct sja1000_priv *priv = netdev_priv(dev); struct sja1000_priv *priv = netdev_priv(dev);
if (priv->reg_base && (priv->read_reg(priv, 0) == 0xFF)) { if (priv->reg_base && sja1000_is_absent(priv)) {
printk(KERN_INFO "%s: probing @0x%lX failed\n", printk(KERN_INFO "%s: probing @0x%lX failed\n",
DRV_NAME, dev->base_addr); DRV_NAME, dev->base_addr);
return 0; return 0;
@ -493,6 +498,9 @@ irqreturn_t sja1000_interrupt(int irq, void *dev_id)
while ((isrc = priv->read_reg(priv, REG_IR)) && (n < SJA1000_MAX_IRQ)) { while ((isrc = priv->read_reg(priv, REG_IR)) && (n < SJA1000_MAX_IRQ)) {
n++; n++;
status = priv->read_reg(priv, REG_SR); status = priv->read_reg(priv, REG_SR);
/* check for absent controller due to hw unplug */
if (status == 0xFF && sja1000_is_absent(priv))
return IRQ_NONE;
if (isrc & IRQ_WUI) if (isrc & IRQ_WUI)
dev_warn(dev->dev.parent, "wakeup interrupt\n"); dev_warn(dev->dev.parent, "wakeup interrupt\n");
@ -509,6 +517,9 @@ irqreturn_t sja1000_interrupt(int irq, void *dev_id)
while (status & SR_RBS) { while (status & SR_RBS) {
sja1000_rx(dev); sja1000_rx(dev);
status = priv->read_reg(priv, REG_SR); status = priv->read_reg(priv, REG_SR);
/* check for absent controller */
if (status == 0xFF && sja1000_is_absent(priv))
return IRQ_NONE;
} }
} }
if (isrc & (IRQ_DOI | IRQ_EI | IRQ_BEI | IRQ_EPI | IRQ_ALI)) { if (isrc & (IRQ_DOI | IRQ_EI | IRQ_BEI | IRQ_EPI | IRQ_ALI)) {

View File

@ -2244,10 +2244,6 @@ static netdev_tx_t atl1c_xmit_frame(struct sk_buff *skb,
dev_info(&adapter->pdev->dev, "tx locked\n"); dev_info(&adapter->pdev->dev, "tx locked\n");
return NETDEV_TX_LOCKED; return NETDEV_TX_LOCKED;
} }
if (skb->mark == 0x01)
type = atl1c_trans_high;
else
type = atl1c_trans_normal;
if (atl1c_tpd_avail(adapter, type) < tpd_req) { if (atl1c_tpd_avail(adapter, type) < tpd_req) {
/* no enough descriptor, just stop queue */ /* no enough descriptor, just stop queue */

View File

@ -2339,7 +2339,7 @@ static inline int __init b44_pci_init(void)
return err; return err;
} }
static inline void __exit b44_pci_exit(void) static inline void b44_pci_exit(void)
{ {
#ifdef CONFIG_B44_PCI #ifdef CONFIG_B44_PCI
ssb_pcihost_unregister(&b44_pci_driver); ssb_pcihost_unregister(&b44_pci_driver);

View File

@ -3584,7 +3584,11 @@ static int cnic_get_v6_route(struct sockaddr_in6 *dst_addr,
fl6.flowi6_oif = dst_addr->sin6_scope_id; fl6.flowi6_oif = dst_addr->sin6_scope_id;
*dst = ip6_route_output(&init_net, NULL, &fl6); *dst = ip6_route_output(&init_net, NULL, &fl6);
if (*dst) if ((*dst)->error) {
dst_release(*dst);
*dst = NULL;
return -ENETUNREACH;
} else
return 0; return 0;
#endif #endif

View File

@ -157,7 +157,7 @@ static inline void cq_enet_rq_desc_dec(struct cq_enet_rq_desc *desc,
CQ_ENET_RQ_DESC_FCOE_FC_CRC_OK) ? 1 : 0; CQ_ENET_RQ_DESC_FCOE_FC_CRC_OK) ? 1 : 0;
*fcoe_enc_error = (desc->flags & *fcoe_enc_error = (desc->flags &
CQ_ENET_RQ_DESC_FCOE_ENC_ERROR) ? 1 : 0; CQ_ENET_RQ_DESC_FCOE_ENC_ERROR) ? 1 : 0;
*fcoe_eof = (u8)((desc->checksum_fcoe >> *fcoe_eof = (u8)((le16_to_cpu(desc->checksum_fcoe) >>
CQ_ENET_RQ_DESC_FCOE_EOF_SHIFT) & CQ_ENET_RQ_DESC_FCOE_EOF_SHIFT) &
CQ_ENET_RQ_DESC_FCOE_EOF_MASK); CQ_ENET_RQ_DESC_FCOE_EOF_MASK);
*checksum = 0; *checksum = 0;

View File

@ -72,7 +72,7 @@ static int enic_set_port_profile(struct enic *enic, int vf)
struct enic_port_profile *pp; struct enic_port_profile *pp;
struct vic_provinfo *vp; struct vic_provinfo *vp;
const u8 oui[3] = VIC_PROVINFO_CISCO_OUI; const u8 oui[3] = VIC_PROVINFO_CISCO_OUI;
const u16 os_type = htons(VIC_GENERIC_PROV_OS_TYPE_LINUX); const __be16 os_type = htons(VIC_GENERIC_PROV_OS_TYPE_LINUX);
char uuid_str[38]; char uuid_str[38];
char client_mac_str[18]; char client_mac_str[18];
u8 *client_mac; u8 *client_mac;

View File

@ -2328,19 +2328,11 @@ jme_change_mtu(struct net_device *netdev, int new_mtu)
((new_mtu) < IPV6_MIN_MTU)) ((new_mtu) < IPV6_MIN_MTU))
return -EINVAL; return -EINVAL;
if (new_mtu > 4000) {
jme->reg_rxcs &= ~RXCS_FIFOTHNP;
jme->reg_rxcs |= RXCS_FIFOTHNP_64QW;
jme_restart_rx_engine(jme);
} else {
jme->reg_rxcs &= ~RXCS_FIFOTHNP;
jme->reg_rxcs |= RXCS_FIFOTHNP_128QW;
jme_restart_rx_engine(jme);
}
netdev->mtu = new_mtu; netdev->mtu = new_mtu;
netdev_update_features(netdev); netdev_update_features(netdev);
jme_restart_rx_engine(jme);
jme_reset_link(jme); jme_reset_link(jme);
return 0; return 0;

View File

@ -730,7 +730,7 @@ enum jme_rxcs_values {
RXCS_RETRYCNT_60 = 0x00000F00, RXCS_RETRYCNT_60 = 0x00000F00,
RXCS_DEFAULT = RXCS_FIFOTHTP_128T | RXCS_DEFAULT = RXCS_FIFOTHTP_128T |
RXCS_FIFOTHNP_128QW | RXCS_FIFOTHNP_16QW |
RXCS_DMAREQSZ_128B | RXCS_DMAREQSZ_128B |
RXCS_RETRYGAP_256ns | RXCS_RETRYGAP_256ns |
RXCS_RETRYCNT_32, RXCS_RETRYCNT_32,

View File

@ -1036,7 +1036,7 @@ int mlx4_assign_eq(struct mlx4_dev *dev, char* name, int * vector)
struct mlx4_priv *priv = mlx4_priv(dev); struct mlx4_priv *priv = mlx4_priv(dev);
int vec = 0, err = 0, i; int vec = 0, err = 0, i;
spin_lock(&priv->msix_ctl.pool_lock); mutex_lock(&priv->msix_ctl.pool_lock);
for (i = 0; !vec && i < dev->caps.comp_pool; i++) { for (i = 0; !vec && i < dev->caps.comp_pool; i++) {
if (~priv->msix_ctl.pool_bm & 1ULL << i) { if (~priv->msix_ctl.pool_bm & 1ULL << i) {
priv->msix_ctl.pool_bm |= 1ULL << i; priv->msix_ctl.pool_bm |= 1ULL << i;
@ -1058,7 +1058,7 @@ int mlx4_assign_eq(struct mlx4_dev *dev, char* name, int * vector)
eq_set_ci(&priv->eq_table.eq[vec], 1); eq_set_ci(&priv->eq_table.eq[vec], 1);
} }
} }
spin_unlock(&priv->msix_ctl.pool_lock); mutex_unlock(&priv->msix_ctl.pool_lock);
if (vec) { if (vec) {
*vector = vec; *vector = vec;
@ -1079,13 +1079,13 @@ void mlx4_release_eq(struct mlx4_dev *dev, int vec)
if (likely(i >= 0)) { if (likely(i >= 0)) {
/*sanity check , making sure were not trying to free irq's /*sanity check , making sure were not trying to free irq's
Belonging to a legacy EQ*/ Belonging to a legacy EQ*/
spin_lock(&priv->msix_ctl.pool_lock); mutex_lock(&priv->msix_ctl.pool_lock);
if (priv->msix_ctl.pool_bm & 1ULL << i) { if (priv->msix_ctl.pool_bm & 1ULL << i) {
free_irq(priv->eq_table.eq[vec].irq, free_irq(priv->eq_table.eq[vec].irq,
&priv->eq_table.eq[vec]); &priv->eq_table.eq[vec]);
priv->msix_ctl.pool_bm &= ~(1ULL << i); priv->msix_ctl.pool_bm &= ~(1ULL << i);
} }
spin_unlock(&priv->msix_ctl.pool_lock); mutex_unlock(&priv->msix_ctl.pool_lock);
} }
} }

View File

@ -685,7 +685,7 @@ int mlx4_QUERY_PORT_wrapper(struct mlx4_dev *dev, int slave,
return err; return err;
} }
static int mlx4_QUERY_PORT(struct mlx4_dev *dev, void *ptr, u8 port) int mlx4_QUERY_PORT(struct mlx4_dev *dev, void *ptr, u8 port)
{ {
struct mlx4_cmd_mailbox *outbox = ptr; struct mlx4_cmd_mailbox *outbox = ptr;

View File

@ -531,15 +531,14 @@ int mlx4_change_port_types(struct mlx4_dev *dev,
for (port = 0; port < dev->caps.num_ports; port++) { for (port = 0; port < dev->caps.num_ports; port++) {
/* Change the port type only if the new type is different /* Change the port type only if the new type is different
* from the current, and not set to Auto */ * from the current, and not set to Auto */
if (port_types[port] != dev->caps.port_type[port + 1]) { if (port_types[port] != dev->caps.port_type[port + 1])
change = 1; change = 1;
dev->caps.port_type[port + 1] = port_types[port];
}
} }
if (change) { if (change) {
mlx4_unregister_device(dev); mlx4_unregister_device(dev);
for (port = 1; port <= dev->caps.num_ports; port++) { for (port = 1; port <= dev->caps.num_ports; port++) {
mlx4_CLOSE_PORT(dev, port); mlx4_CLOSE_PORT(dev, port);
dev->caps.port_type[port] = port_types[port - 1];
err = mlx4_SET_PORT(dev, port); err = mlx4_SET_PORT(dev, port);
if (err) { if (err) {
mlx4_err(dev, "Failed to set port %d, " mlx4_err(dev, "Failed to set port %d, "
@ -986,6 +985,9 @@ static int map_bf_area(struct mlx4_dev *dev)
resource_size_t bf_len; resource_size_t bf_len;
int err = 0; int err = 0;
if (!dev->caps.bf_reg_size)
return -ENXIO;
bf_start = pci_resource_start(dev->pdev, 2) + bf_start = pci_resource_start(dev->pdev, 2) +
(dev->caps.num_uars << PAGE_SHIFT); (dev->caps.num_uars << PAGE_SHIFT);
bf_len = pci_resource_len(dev->pdev, 2) - bf_len = pci_resource_len(dev->pdev, 2) -
@ -1825,7 +1827,7 @@ slave_start:
goto err_master_mfunc; goto err_master_mfunc;
priv->msix_ctl.pool_bm = 0; priv->msix_ctl.pool_bm = 0;
spin_lock_init(&priv->msix_ctl.pool_lock); mutex_init(&priv->msix_ctl.pool_lock);
mlx4_enable_msi_x(dev); mlx4_enable_msi_x(dev);
if ((mlx4_is_mfunc(dev)) && if ((mlx4_is_mfunc(dev)) &&

View File

@ -697,7 +697,7 @@ struct mlx4_sense {
struct mlx4_msix_ctl { struct mlx4_msix_ctl {
u64 pool_bm; u64 pool_bm;
spinlock_t pool_lock; struct mutex pool_lock;
}; };
struct mlx4_steer { struct mlx4_steer {

View File

@ -304,7 +304,7 @@ static int mlx4_HW2SW_MPT(struct mlx4_dev *dev, struct mlx4_cmd_mailbox *mailbox
MLX4_CMD_TIME_CLASS_B, MLX4_CMD_WRAPPED); MLX4_CMD_TIME_CLASS_B, MLX4_CMD_WRAPPED);
} }
static int mlx4_mr_reserve_range(struct mlx4_dev *dev, int cnt, int align, int mlx4_mr_reserve_range(struct mlx4_dev *dev, int cnt, int align,
u32 *base_mridx) u32 *base_mridx)
{ {
struct mlx4_priv *priv = mlx4_priv(dev); struct mlx4_priv *priv = mlx4_priv(dev);
@ -320,14 +320,14 @@ static int mlx4_mr_reserve_range(struct mlx4_dev *dev, int cnt, int align,
} }
EXPORT_SYMBOL_GPL(mlx4_mr_reserve_range); EXPORT_SYMBOL_GPL(mlx4_mr_reserve_range);
static void mlx4_mr_release_range(struct mlx4_dev *dev, u32 base_mridx, int cnt) void mlx4_mr_release_range(struct mlx4_dev *dev, u32 base_mridx, int cnt)
{ {
struct mlx4_priv *priv = mlx4_priv(dev); struct mlx4_priv *priv = mlx4_priv(dev);
mlx4_bitmap_free_range(&priv->mr_table.mpt_bitmap, base_mridx, cnt); mlx4_bitmap_free_range(&priv->mr_table.mpt_bitmap, base_mridx, cnt);
} }
EXPORT_SYMBOL_GPL(mlx4_mr_release_range); EXPORT_SYMBOL_GPL(mlx4_mr_release_range);
static int mlx4_mr_alloc_reserved(struct mlx4_dev *dev, u32 mridx, u32 pd, int mlx4_mr_alloc_reserved(struct mlx4_dev *dev, u32 mridx, u32 pd,
u64 iova, u64 size, u32 access, int npages, u64 iova, u64 size, u32 access, int npages,
int page_shift, struct mlx4_mr *mr) int page_shift, struct mlx4_mr *mr)
{ {
@ -457,7 +457,7 @@ int mlx4_mr_alloc(struct mlx4_dev *dev, u32 pd, u64 iova, u64 size, u32 access,
} }
EXPORT_SYMBOL_GPL(mlx4_mr_alloc); EXPORT_SYMBOL_GPL(mlx4_mr_alloc);
static void mlx4_mr_free_reserved(struct mlx4_dev *dev, struct mlx4_mr *mr) void mlx4_mr_free_reserved(struct mlx4_dev *dev, struct mlx4_mr *mr)
{ {
int err; int err;
@ -852,7 +852,7 @@ err_free:
} }
EXPORT_SYMBOL_GPL(mlx4_fmr_alloc); EXPORT_SYMBOL_GPL(mlx4_fmr_alloc);
static int mlx4_fmr_alloc_reserved(struct mlx4_dev *dev, u32 mridx, int mlx4_fmr_alloc_reserved(struct mlx4_dev *dev, u32 mridx,
u32 pd, u32 access, int max_pages, u32 pd, u32 access, int max_pages,
int max_maps, u8 page_shift, struct mlx4_fmr *fmr) int max_maps, u8 page_shift, struct mlx4_fmr *fmr)
{ {
@ -954,7 +954,7 @@ int mlx4_fmr_free(struct mlx4_dev *dev, struct mlx4_fmr *fmr)
} }
EXPORT_SYMBOL_GPL(mlx4_fmr_free); EXPORT_SYMBOL_GPL(mlx4_fmr_free);
static int mlx4_fmr_free_reserved(struct mlx4_dev *dev, struct mlx4_fmr *fmr) int mlx4_fmr_free_reserved(struct mlx4_dev *dev, struct mlx4_fmr *fmr)
{ {
if (fmr->maps) if (fmr->maps)
return -EBUSY; return -EBUSY;

View File

@ -1545,7 +1545,7 @@ static int __devinit ks8851_probe(struct platform_device *pdev)
netdev->irq = platform_get_irq(pdev, 0); netdev->irq = platform_get_irq(pdev, 0);
if (netdev->irq < 0) { if ((int)netdev->irq < 0) {
err = netdev->irq; err = netdev->irq;
goto err_get_irq; goto err_get_irq;
} }

View File

@ -156,11 +156,10 @@ static int efx_init_rx_buffers_skb(struct efx_rx_queue *rx_queue)
if (unlikely(!skb)) if (unlikely(!skb))
return -ENOMEM; return -ENOMEM;
/* Adjust the SKB for padding and checksum */ /* Adjust the SKB for padding */
skb_reserve(skb, NET_IP_ALIGN); skb_reserve(skb, NET_IP_ALIGN);
rx_buf->len = skb_len - NET_IP_ALIGN; rx_buf->len = skb_len - NET_IP_ALIGN;
rx_buf->is_page = false; rx_buf->is_page = false;
skb->ip_summed = CHECKSUM_UNNECESSARY;
rx_buf->dma_addr = pci_map_single(efx->pci_dev, rx_buf->dma_addr = pci_map_single(efx->pci_dev,
skb->data, rx_buf->len, skb->data, rx_buf->len,
@ -496,6 +495,7 @@ static void efx_rx_packet_gro(struct efx_channel *channel,
EFX_BUG_ON_PARANOID(!checksummed); EFX_BUG_ON_PARANOID(!checksummed);
rx_buf->u.skb = NULL; rx_buf->u.skb = NULL;
skb->ip_summed = CHECKSUM_UNNECESSARY;
gro_result = napi_gro_receive(napi, skb); gro_result = napi_gro_receive(napi, skb);
} }

View File

@ -1009,7 +1009,7 @@ static void emac_rx_handler(void *token, int len, int status)
int ret; int ret;
/* free and bail if we are shutting down */ /* free and bail if we are shutting down */
if (unlikely(!netif_running(ndev) || !netif_carrier_ok(ndev))) { if (unlikely(!netif_running(ndev))) {
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
return; return;
} }
@ -1038,7 +1038,9 @@ static void emac_rx_handler(void *token, int len, int status)
recycle: recycle:
ret = cpdma_chan_submit(priv->rxchan, skb, skb->data, ret = cpdma_chan_submit(priv->rxchan, skb, skb->data,
skb_tailroom(skb), GFP_KERNEL); skb_tailroom(skb), GFP_KERNEL);
if (WARN_ON(ret < 0))
WARN_ON(ret == -ENOMEM);
if (unlikely(ret < 0))
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
} }

View File

@ -30,16 +30,16 @@
#include <asm/irq.h> #include <asm/irq.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
MODULE_DESCRIPTION("ICPlus IP175C/IP101A/IC1001 PHY drivers"); MODULE_DESCRIPTION("ICPlus IP175C/IP101A/IP101G/IC1001 PHY drivers");
MODULE_AUTHOR("Michael Barkowski"); MODULE_AUTHOR("Michael Barkowski");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
/* IP101A/IP1001 */ /* IP101A/G - IP1001 */
#define IP10XX_SPEC_CTRL_STATUS 16 /* Spec. Control Register */ #define IP10XX_SPEC_CTRL_STATUS 16 /* Spec. Control Register */
#define IP1001_SPEC_CTRL_STATUS_2 20 /* IP1001 Spec. Control Reg 2 */ #define IP1001_SPEC_CTRL_STATUS_2 20 /* IP1001 Spec. Control Reg 2 */
#define IP1001_PHASE_SEL_MASK 3 /* IP1001 RX/TXPHASE_SEL */ #define IP1001_PHASE_SEL_MASK 3 /* IP1001 RX/TXPHASE_SEL */
#define IP1001_APS_ON 11 /* IP1001 APS Mode bit */ #define IP1001_APS_ON 11 /* IP1001 APS Mode bit */
#define IP101A_APS_ON 2 /* IP101A APS Mode bit */ #define IP101A_G_APS_ON 2 /* IP101A/G APS Mode bit */
static int ip175c_config_init(struct phy_device *phydev) static int ip175c_config_init(struct phy_device *phydev)
{ {
@ -98,20 +98,24 @@ static int ip175c_config_init(struct phy_device *phydev)
static int ip1xx_reset(struct phy_device *phydev) static int ip1xx_reset(struct phy_device *phydev)
{ {
int err, bmcr; int bmcr;
/* Software Reset PHY */ /* Software Reset PHY */
bmcr = phy_read(phydev, MII_BMCR); bmcr = phy_read(phydev, MII_BMCR);
if (bmcr < 0)
return bmcr;
bmcr |= BMCR_RESET; bmcr |= BMCR_RESET;
err = phy_write(phydev, MII_BMCR, bmcr); bmcr = phy_write(phydev, MII_BMCR, bmcr);
if (err < 0) if (bmcr < 0)
return err; return bmcr;
do { do {
bmcr = phy_read(phydev, MII_BMCR); bmcr = phy_read(phydev, MII_BMCR);
if (bmcr < 0)
return bmcr;
} while (bmcr & BMCR_RESET); } while (bmcr & BMCR_RESET);
return err; return 0;
} }
static int ip1001_config_init(struct phy_device *phydev) static int ip1001_config_init(struct phy_device *phydev)
@ -124,7 +128,10 @@ static int ip1001_config_init(struct phy_device *phydev)
/* Enable Auto Power Saving mode */ /* Enable Auto Power Saving mode */
c = phy_read(phydev, IP1001_SPEC_CTRL_STATUS_2); c = phy_read(phydev, IP1001_SPEC_CTRL_STATUS_2);
if (c < 0)
return c;
c |= IP1001_APS_ON; c |= IP1001_APS_ON;
c = phy_write(phydev, IP1001_SPEC_CTRL_STATUS_2, c);
if (c < 0) if (c < 0)
return c; return c;
@ -132,14 +139,19 @@ static int ip1001_config_init(struct phy_device *phydev)
/* Additional delay (2ns) used to adjust RX clock phase /* Additional delay (2ns) used to adjust RX clock phase
* at RGMII interface */ * at RGMII interface */
c = phy_read(phydev, IP10XX_SPEC_CTRL_STATUS); c = phy_read(phydev, IP10XX_SPEC_CTRL_STATUS);
if (c < 0)
return c;
c |= IP1001_PHASE_SEL_MASK; c |= IP1001_PHASE_SEL_MASK;
c = phy_write(phydev, IP10XX_SPEC_CTRL_STATUS, c); c = phy_write(phydev, IP10XX_SPEC_CTRL_STATUS, c);
if (c < 0)
return c;
} }
return c; return 0;
} }
static int ip101a_config_init(struct phy_device *phydev) static int ip101a_g_config_init(struct phy_device *phydev)
{ {
int c; int c;
@ -149,7 +161,7 @@ static int ip101a_config_init(struct phy_device *phydev)
/* Enable Auto Power Saving mode */ /* Enable Auto Power Saving mode */
c = phy_read(phydev, IP10XX_SPEC_CTRL_STATUS); c = phy_read(phydev, IP10XX_SPEC_CTRL_STATUS);
c |= IP101A_APS_ON; c |= IP101A_G_APS_ON;
return c; return c;
} }
@ -191,6 +203,7 @@ static struct phy_driver ip1001_driver = {
.phy_id_mask = 0x0ffffff0, .phy_id_mask = 0x0ffffff0,
.features = PHY_GBIT_FEATURES | SUPPORTED_Pause | .features = PHY_GBIT_FEATURES | SUPPORTED_Pause |
SUPPORTED_Asym_Pause, SUPPORTED_Asym_Pause,
.flags = PHY_HAS_INTERRUPT,
.config_init = &ip1001_config_init, .config_init = &ip1001_config_init,
.config_aneg = &genphy_config_aneg, .config_aneg = &genphy_config_aneg,
.read_status = &genphy_read_status, .read_status = &genphy_read_status,
@ -199,13 +212,14 @@ static struct phy_driver ip1001_driver = {
.driver = { .owner = THIS_MODULE,}, .driver = { .owner = THIS_MODULE,},
}; };
static struct phy_driver ip101a_driver = { static struct phy_driver ip101a_g_driver = {
.phy_id = 0x02430c54, .phy_id = 0x02430c54,
.name = "ICPlus IP101A", .name = "ICPlus IP101A/G",
.phy_id_mask = 0x0ffffff0, .phy_id_mask = 0x0ffffff0,
.features = PHY_BASIC_FEATURES | SUPPORTED_Pause | .features = PHY_BASIC_FEATURES | SUPPORTED_Pause |
SUPPORTED_Asym_Pause, SUPPORTED_Asym_Pause,
.config_init = &ip101a_config_init, .flags = PHY_HAS_INTERRUPT,
.config_init = &ip101a_g_config_init,
.config_aneg = &genphy_config_aneg, .config_aneg = &genphy_config_aneg,
.read_status = &genphy_read_status, .read_status = &genphy_read_status,
.suspend = genphy_suspend, .suspend = genphy_suspend,
@ -221,7 +235,7 @@ static int __init icplus_init(void)
if (ret < 0) if (ret < 0)
return -ENODEV; return -ENODEV;
ret = phy_driver_register(&ip101a_driver); ret = phy_driver_register(&ip101a_g_driver);
if (ret < 0) if (ret < 0)
return -ENODEV; return -ENODEV;
@ -231,7 +245,7 @@ static int __init icplus_init(void)
static void __exit icplus_exit(void) static void __exit icplus_exit(void)
{ {
phy_driver_unregister(&ip1001_driver); phy_driver_unregister(&ip1001_driver);
phy_driver_unregister(&ip101a_driver); phy_driver_unregister(&ip101a_g_driver);
phy_driver_unregister(&ip175c_driver); phy_driver_unregister(&ip175c_driver);
} }
@ -241,6 +255,7 @@ module_exit(icplus_exit);
static struct mdio_device_id __maybe_unused icplus_tbl[] = { static struct mdio_device_id __maybe_unused icplus_tbl[] = {
{ 0x02430d80, 0x0ffffff0 }, { 0x02430d80, 0x0ffffff0 },
{ 0x02430d90, 0x0ffffff0 }, { 0x02430d90, 0x0ffffff0 },
{ 0x02430c54, 0x0ffffff0 },
{ } { }
}; };

View File

@ -2024,14 +2024,22 @@ ppp_mp_reconstruct(struct ppp *ppp)
continue; continue;
} }
if (PPP_MP_CB(p)->sequence != seq) { if (PPP_MP_CB(p)->sequence != seq) {
u32 oldseq;
/* Fragment `seq' is missing. If it is after /* Fragment `seq' is missing. If it is after
minseq, it might arrive later, so stop here. */ minseq, it might arrive later, so stop here. */
if (seq_after(seq, minseq)) if (seq_after(seq, minseq))
break; break;
/* Fragment `seq' is lost, keep going. */ /* Fragment `seq' is lost, keep going. */
lost = 1; lost = 1;
oldseq = seq;
seq = seq_before(minseq, PPP_MP_CB(p)->sequence)? seq = seq_before(minseq, PPP_MP_CB(p)->sequence)?
minseq + 1: PPP_MP_CB(p)->sequence; minseq + 1: PPP_MP_CB(p)->sequence;
if (ppp->debug & 1)
netdev_printk(KERN_DEBUG, ppp->dev,
"lost frag %u..%u\n",
oldseq, seq-1);
goto again; goto again;
} }
@ -2076,6 +2084,10 @@ ppp_mp_reconstruct(struct ppp *ppp)
struct sk_buff *tmp2; struct sk_buff *tmp2;
skb_queue_reverse_walk_from_safe(list, p, tmp2) { skb_queue_reverse_walk_from_safe(list, p, tmp2) {
if (ppp->debug & 1)
netdev_printk(KERN_DEBUG, ppp->dev,
"discarding frag %u\n",
PPP_MP_CB(p)->sequence);
__skb_unlink(p, list); __skb_unlink(p, list);
kfree_skb(p); kfree_skb(p);
} }
@ -2091,6 +2103,17 @@ ppp_mp_reconstruct(struct ppp *ppp)
/* If we have discarded any fragments, /* If we have discarded any fragments,
signal a receive error. */ signal a receive error. */
if (PPP_MP_CB(head)->sequence != ppp->nextseq) { if (PPP_MP_CB(head)->sequence != ppp->nextseq) {
skb_queue_walk_safe(list, p, tmp) {
if (p == head)
break;
if (ppp->debug & 1)
netdev_printk(KERN_DEBUG, ppp->dev,
"discarding frag %u\n",
PPP_MP_CB(p)->sequence);
__skb_unlink(p, list);
kfree_skb(p);
}
if (ppp->debug & 1) if (ppp->debug & 1)
netdev_printk(KERN_DEBUG, ppp->dev, netdev_printk(KERN_DEBUG, ppp->dev,
" missed pkts %u..%u\n", " missed pkts %u..%u\n",

View File

@ -573,6 +573,13 @@ static const struct usb_device_id products [] = {
.driver_info = 0, .driver_info = 0,
}, },
/* Logitech Harmony 900 - uses the pseudo-MDLM (BLAN) driver */
{
USB_DEVICE_AND_INTERFACE_INFO(0x046d, 0xc11f, USB_CLASS_COMM,
USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE),
.driver_info = 0,
},
/* /*
* WHITELIST!!! * WHITELIST!!!
* *

View File

@ -1632,7 +1632,7 @@ static int hso_get_count(struct tty_struct *tty,
struct hso_serial *serial = get_serial_by_tty(tty); struct hso_serial *serial = get_serial_by_tty(tty);
struct hso_tiocmget *tiocmget = serial->tiocmget; struct hso_tiocmget *tiocmget = serial->tiocmget;
memset(&icount, 0, sizeof(struct serial_icounter_struct)); memset(icount, 0, sizeof(struct serial_icounter_struct));
if (!tiocmget) if (!tiocmget)
return -ENOENT; return -ENOENT;

View File

@ -315,6 +315,11 @@ static const struct usb_device_id products [] = {
.idProduct = 0x9031, /* C-750 C-760 */ .idProduct = 0x9031, /* C-750 C-760 */
ZAURUS_MASTER_INTERFACE, ZAURUS_MASTER_INTERFACE,
.driver_info = ZAURUS_PXA_INFO, .driver_info = ZAURUS_PXA_INFO,
}, {
/* C-750/C-760/C-860/SL-C3000 PDA in MDLM mode */
USB_DEVICE_AND_INTERFACE_INFO(0x04DD, 0x9031, USB_CLASS_COMM,
USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE),
.driver_info = (unsigned long) &bogus_mdlm_info,
}, { }, {
.match_flags = USB_DEVICE_ID_MATCH_INT_INFO .match_flags = USB_DEVICE_ID_MATCH_INT_INFO
| USB_DEVICE_ID_MATCH_DEVICE, | USB_DEVICE_ID_MATCH_DEVICE,
@ -349,6 +354,13 @@ static const struct usb_device_id products [] = {
ZAURUS_MASTER_INTERFACE, ZAURUS_MASTER_INTERFACE,
.driver_info = OLYMPUS_MXL_INFO, .driver_info = OLYMPUS_MXL_INFO,
}, },
/* Logitech Harmony 900 - uses the pseudo-MDLM (BLAN) driver */
{
USB_DEVICE_AND_INTERFACE_INFO(0x046d, 0xc11f, USB_CLASS_COMM,
USB_CDC_SUBCLASS_MDLM, USB_CDC_PROTO_NONE),
.driver_info = (unsigned long) &bogus_mdlm_info,
},
{ }, // END { }, // END
}; };
MODULE_DEVICE_TABLE(usb, products); MODULE_DEVICE_TABLE(usb, products);

View File

@ -843,8 +843,8 @@ vmxnet3_parse_and_copy_hdr(struct sk_buff *skb, struct vmxnet3_tx_queue *tq,
/* for simplicity, don't copy L4 headers */ /* for simplicity, don't copy L4 headers */
ctx->l4_hdr_size = 0; ctx->l4_hdr_size = 0;
} }
ctx->copy_size = ctx->eth_ip_hdr_size + ctx->copy_size = min(ctx->eth_ip_hdr_size +
ctx->l4_hdr_size; ctx->l4_hdr_size, skb->len);
} else { } else {
ctx->eth_ip_hdr_size = 0; ctx->eth_ip_hdr_size = 0;
ctx->l4_hdr_size = 0; ctx->l4_hdr_size = 0;

View File

@ -1346,7 +1346,7 @@ static void ath_tx_status(void *priv, struct ieee80211_supported_band *sband,
fc = hdr->frame_control; fc = hdr->frame_control;
for (i = 0; i < sc->hw->max_rates; i++) { for (i = 0; i < sc->hw->max_rates; i++) {
struct ieee80211_tx_rate *rate = &tx_info->status.rates[i]; struct ieee80211_tx_rate *rate = &tx_info->status.rates[i];
if (!rate->count) if (rate->idx < 0 || !rate->count)
break; break;
final_ts_idx = i; final_ts_idx = i;

View File

@ -841,7 +841,12 @@ mwifiex_cfg80211_assoc(struct mwifiex_private *priv, size_t ssid_len, u8 *ssid,
ret = mwifiex_set_rf_channel(priv, channel, ret = mwifiex_set_rf_channel(priv, channel,
priv->adapter->channel_type); priv->adapter->channel_type);
ret = mwifiex_set_encode(priv, NULL, 0, 0, 1); /* Disable keys */ /* As this is new association, clear locally stored
* keys and security related flags */
priv->sec_info.wpa_enabled = false;
priv->sec_info.wpa2_enabled = false;
priv->wep_key_curr_index = 0;
ret = mwifiex_set_encode(priv, NULL, 0, 0, 1);
if (mode == NL80211_IFTYPE_ADHOC) { if (mode == NL80211_IFTYPE_ADHOC) {
/* "privacy" is set only for ad-hoc mode */ /* "privacy" is set only for ad-hoc mode */
@ -886,6 +891,7 @@ mwifiex_cfg80211_assoc(struct mwifiex_private *priv, size_t ssid_len, u8 *ssid,
dev_dbg(priv->adapter->dev, dev_dbg(priv->adapter->dev,
"info: setting wep encryption" "info: setting wep encryption"
" with key len %d\n", sme->key_len); " with key len %d\n", sme->key_len);
priv->wep_key_curr_index = sme->key_idx;
ret = mwifiex_set_encode(priv, sme->key, sme->key_len, ret = mwifiex_set_encode(priv, sme->key, sme->key_len,
sme->key_idx, 0); sme->key_idx, 0);
} }

View File

@ -364,10 +364,7 @@ static void release_controller(struct kref *kref)
struct rdac_controller *ctlr; struct rdac_controller *ctlr;
ctlr = container_of(kref, struct rdac_controller, kref); ctlr = container_of(kref, struct rdac_controller, kref);
flush_workqueue(kmpath_rdacd);
spin_lock(&list_lock);
list_del(&ctlr->node); list_del(&ctlr->node);
spin_unlock(&list_lock);
kfree(ctlr); kfree(ctlr);
} }
@ -376,20 +373,17 @@ static struct rdac_controller *get_controller(int index, char *array_name,
{ {
struct rdac_controller *ctlr, *tmp; struct rdac_controller *ctlr, *tmp;
spin_lock(&list_lock);
list_for_each_entry(tmp, &ctlr_list, node) { list_for_each_entry(tmp, &ctlr_list, node) {
if ((memcmp(tmp->array_id, array_id, UNIQUE_ID_LEN) == 0) && if ((memcmp(tmp->array_id, array_id, UNIQUE_ID_LEN) == 0) &&
(tmp->index == index) && (tmp->index == index) &&
(tmp->host == sdev->host)) { (tmp->host == sdev->host)) {
kref_get(&tmp->kref); kref_get(&tmp->kref);
spin_unlock(&list_lock);
return tmp; return tmp;
} }
} }
ctlr = kmalloc(sizeof(*ctlr), GFP_ATOMIC); ctlr = kmalloc(sizeof(*ctlr), GFP_ATOMIC);
if (!ctlr) if (!ctlr)
goto done; return NULL;
/* initialize fields of controller */ /* initialize fields of controller */
memcpy(ctlr->array_id, array_id, UNIQUE_ID_LEN); memcpy(ctlr->array_id, array_id, UNIQUE_ID_LEN);
@ -405,8 +399,7 @@ static struct rdac_controller *get_controller(int index, char *array_name,
INIT_WORK(&ctlr->ms_work, send_mode_select); INIT_WORK(&ctlr->ms_work, send_mode_select);
INIT_LIST_HEAD(&ctlr->ms_head); INIT_LIST_HEAD(&ctlr->ms_head);
list_add(&ctlr->node, &ctlr_list); list_add(&ctlr->node, &ctlr_list);
done:
spin_unlock(&list_lock);
return ctlr; return ctlr;
} }
@ -517,9 +510,12 @@ static int initialize_controller(struct scsi_device *sdev,
index = 0; index = 0;
else else
index = 1; index = 1;
spin_lock(&list_lock);
h->ctlr = get_controller(index, array_name, array_id, sdev); h->ctlr = get_controller(index, array_name, array_id, sdev);
if (!h->ctlr) if (!h->ctlr)
err = SCSI_DH_RES_TEMP_UNAVAIL; err = SCSI_DH_RES_TEMP_UNAVAIL;
spin_unlock(&list_lock);
} }
return err; return err;
} }
@ -906,7 +902,9 @@ static int rdac_bus_attach(struct scsi_device *sdev)
return 0; return 0;
clean_ctlr: clean_ctlr:
spin_lock(&list_lock);
kref_put(&h->ctlr->kref, release_controller); kref_put(&h->ctlr->kref, release_controller);
spin_unlock(&list_lock);
failed: failed:
kfree(scsi_dh_data); kfree(scsi_dh_data);
@ -921,14 +919,19 @@ static void rdac_bus_detach( struct scsi_device *sdev )
struct rdac_dh_data *h; struct rdac_dh_data *h;
unsigned long flags; unsigned long flags;
spin_lock_irqsave(sdev->request_queue->queue_lock, flags);
scsi_dh_data = sdev->scsi_dh_data; scsi_dh_data = sdev->scsi_dh_data;
h = (struct rdac_dh_data *) scsi_dh_data->buf;
if (h->ctlr && h->ctlr->ms_queued)
flush_workqueue(kmpath_rdacd);
spin_lock_irqsave(sdev->request_queue->queue_lock, flags);
sdev->scsi_dh_data = NULL; sdev->scsi_dh_data = NULL;
spin_unlock_irqrestore(sdev->request_queue->queue_lock, flags); spin_unlock_irqrestore(sdev->request_queue->queue_lock, flags);
h = (struct rdac_dh_data *) scsi_dh_data->buf; spin_lock(&list_lock);
if (h->ctlr) if (h->ctlr)
kref_put(&h->ctlr->kref, release_controller); kref_put(&h->ctlr->kref, release_controller);
spin_unlock(&list_lock);
kfree(scsi_dh_data); kfree(scsi_dh_data);
module_put(THIS_MODULE); module_put(THIS_MODULE);
sdev_printk(KERN_NOTICE, sdev, "%s: Detached\n", RDAC_NAME); sdev_printk(KERN_NOTICE, sdev, "%s: Detached\n", RDAC_NAME);

View File

@ -4613,11 +4613,13 @@ static int __ipr_eh_host_reset(struct scsi_cmnd * scsi_cmd)
ENTER; ENTER;
ioa_cfg = (struct ipr_ioa_cfg *) scsi_cmd->device->host->hostdata; ioa_cfg = (struct ipr_ioa_cfg *) scsi_cmd->device->host->hostdata;
dev_err(&ioa_cfg->pdev->dev, if (!ioa_cfg->in_reset_reload) {
"Adapter being reset as a result of error recovery.\n"); dev_err(&ioa_cfg->pdev->dev,
"Adapter being reset as a result of error recovery.\n");
if (WAIT_FOR_DUMP == ioa_cfg->sdt_state) if (WAIT_FOR_DUMP == ioa_cfg->sdt_state)
ioa_cfg->sdt_state = GET_DUMP; ioa_cfg->sdt_state = GET_DUMP;
}
rc = ipr_reset_reload(ioa_cfg, IPR_SHUTDOWN_ABBREV); rc = ipr_reset_reload(ioa_cfg, IPR_SHUTDOWN_ABBREV);
@ -4907,7 +4909,7 @@ static int ipr_cancel_op(struct scsi_cmnd * scsi_cmd)
struct ipr_ioa_cfg *ioa_cfg; struct ipr_ioa_cfg *ioa_cfg;
struct ipr_resource_entry *res; struct ipr_resource_entry *res;
struct ipr_cmd_pkt *cmd_pkt; struct ipr_cmd_pkt *cmd_pkt;
u32 ioasc; u32 ioasc, int_reg;
int op_found = 0; int op_found = 0;
ENTER; ENTER;
@ -4920,7 +4922,17 @@ static int ipr_cancel_op(struct scsi_cmnd * scsi_cmd)
*/ */
if (ioa_cfg->in_reset_reload || ioa_cfg->ioa_is_dead) if (ioa_cfg->in_reset_reload || ioa_cfg->ioa_is_dead)
return FAILED; return FAILED;
if (!res || !ipr_is_gscsi(res)) if (!res)
return FAILED;
/*
* If we are aborting a timed out op, chances are that the timeout was caused
* by a still not detected EEH error. In such cases, reading a register will
* trigger the EEH recovery infrastructure.
*/
int_reg = readl(ioa_cfg->regs.sense_interrupt_reg);
if (!ipr_is_gscsi(res))
return FAILED; return FAILED;
list_for_each_entry(ipr_cmd, &ioa_cfg->pending_q, queue) { list_for_each_entry(ipr_cmd, &ioa_cfg->pending_q, queue) {

View File

@ -1848,9 +1848,11 @@ static enum sci_status sci_oem_parameters_set(struct isci_host *ihost)
if (state == SCIC_RESET || if (state == SCIC_RESET ||
state == SCIC_INITIALIZING || state == SCIC_INITIALIZING ||
state == SCIC_INITIALIZED) { state == SCIC_INITIALIZED) {
u8 oem_version = pci_info->orom ? pci_info->orom->hdr.version :
ISCI_ROM_VER_1_0;
if (sci_oem_parameters_validate(&ihost->oem_parameters, if (sci_oem_parameters_validate(&ihost->oem_parameters,
pci_info->orom->hdr.version)) oem_version))
return SCI_FAILURE_INVALID_PARAMETER_VALUE; return SCI_FAILURE_INVALID_PARAMETER_VALUE;
return SCI_SUCCESS; return SCI_SUCCESS;

View File

@ -4548,7 +4548,7 @@ mpt2sas_base_hard_reset_handler(struct MPT2SAS_ADAPTER *ioc, int sleep_flag,
printk(MPT2SAS_ERR_FMT "%s: pci error recovery reset\n", printk(MPT2SAS_ERR_FMT "%s: pci error recovery reset\n",
ioc->name, __func__); ioc->name, __func__);
r = 0; r = 0;
goto out; goto out_unlocked;
} }
if (mpt2sas_fwfault_debug) if (mpt2sas_fwfault_debug)
@ -4604,6 +4604,7 @@ mpt2sas_base_hard_reset_handler(struct MPT2SAS_ADAPTER *ioc, int sleep_flag,
spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock, flags); spin_unlock_irqrestore(&ioc->ioc_reset_in_progress_lock, flags);
mutex_unlock(&ioc->reset_in_progress_mutex); mutex_unlock(&ioc->reset_in_progress_mutex);
out_unlocked:
dtmprintk(ioc, printk(MPT2SAS_INFO_FMT "%s: exit\n", ioc->name, dtmprintk(ioc, printk(MPT2SAS_INFO_FMT "%s: exit\n", ioc->name,
__func__)); __func__));
return r; return r;

View File

@ -1036,8 +1036,7 @@ qla2x00_link_state_show(struct device *dev, struct device_attribute *attr,
vha->device_flags & DFLG_NO_CABLE) vha->device_flags & DFLG_NO_CABLE)
len = snprintf(buf, PAGE_SIZE, "Link Down\n"); len = snprintf(buf, PAGE_SIZE, "Link Down\n");
else if (atomic_read(&vha->loop_state) != LOOP_READY || else if (atomic_read(&vha->loop_state) != LOOP_READY ||
test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags) || qla2x00_reset_active(vha))
test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags))
len = snprintf(buf, PAGE_SIZE, "Unknown Link State\n"); len = snprintf(buf, PAGE_SIZE, "Unknown Link State\n");
else { else {
len = snprintf(buf, PAGE_SIZE, "Link Up - "); len = snprintf(buf, PAGE_SIZE, "Link Up - ");
@ -1359,8 +1358,7 @@ qla2x00_thermal_temp_show(struct device *dev,
return snprintf(buf, PAGE_SIZE, "\n"); return snprintf(buf, PAGE_SIZE, "\n");
temp = frac = 0; temp = frac = 0;
if (test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags) || if (qla2x00_reset_active(vha))
test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags))
ql_log(ql_log_warn, vha, 0x707b, ql_log(ql_log_warn, vha, 0x707b,
"ISP reset active.\n"); "ISP reset active.\n");
else if (!vha->hw->flags.eeh_busy) else if (!vha->hw->flags.eeh_busy)
@ -1379,8 +1377,7 @@ qla2x00_fw_state_show(struct device *dev, struct device_attribute *attr,
int rval = QLA_FUNCTION_FAILED; int rval = QLA_FUNCTION_FAILED;
uint16_t state[5]; uint16_t state[5];
if (test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags) || if (qla2x00_reset_active(vha))
test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags))
ql_log(ql_log_warn, vha, 0x707c, ql_log(ql_log_warn, vha, 0x707c,
"ISP reset active.\n"); "ISP reset active.\n");
else if (!vha->hw->flags.eeh_busy) else if (!vha->hw->flags.eeh_busy)
@ -1693,9 +1690,7 @@ qla2x00_get_fc_host_stats(struct Scsi_Host *shost)
if (IS_FWI2_CAPABLE(ha)) { if (IS_FWI2_CAPABLE(ha)) {
rval = qla24xx_get_isp_stats(base_vha, stats, stats_dma); rval = qla24xx_get_isp_stats(base_vha, stats, stats_dma);
} else if (atomic_read(&base_vha->loop_state) == LOOP_READY && } else if (atomic_read(&base_vha->loop_state) == LOOP_READY &&
!test_bit(ABORT_ISP_ACTIVE, &base_vha->dpc_flags) && !qla2x00_reset_active(vha) && !ha->dpc_active) {
!test_bit(ISP_ABORT_NEEDED, &base_vha->dpc_flags) &&
!ha->dpc_active) {
/* Must be in a 'READY' state for statistics retrieval. */ /* Must be in a 'READY' state for statistics retrieval. */
rval = qla2x00_get_link_status(base_vha, base_vha->loop_id, rval = qla2x00_get_link_status(base_vha, base_vha->loop_id,
stats, stats_dma); stats, stats_dma);

View File

@ -108,13 +108,6 @@ qla24xx_proc_fcp_prio_cfg_cmd(struct fc_bsg_job *bsg_job)
goto exit_fcp_prio_cfg; goto exit_fcp_prio_cfg;
} }
if (test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags) ||
test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags) ||
test_bit(ISP_ABORT_RETRY, &vha->dpc_flags)) {
ret = -EBUSY;
goto exit_fcp_prio_cfg;
}
/* Get the sub command */ /* Get the sub command */
oper = bsg_job->request->rqst_data.h_vendor.vendor_cmd[1]; oper = bsg_job->request->rqst_data.h_vendor.vendor_cmd[1];
@ -646,13 +639,6 @@ qla2x00_process_loopback(struct fc_bsg_job *bsg_job)
dma_addr_t rsp_data_dma; dma_addr_t rsp_data_dma;
uint32_t rsp_data_len; uint32_t rsp_data_len;
if (test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags) ||
test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags) ||
test_bit(ISP_ABORT_RETRY, &vha->dpc_flags)) {
ql_log(ql_log_warn, vha, 0x7018, "Abort active or needed.\n");
return -EBUSY;
}
if (!vha->flags.online) { if (!vha->flags.online) {
ql_log(ql_log_warn, vha, 0x7019, "Host is not online.\n"); ql_log(ql_log_warn, vha, 0x7019, "Host is not online.\n");
return -EIO; return -EIO;
@ -874,13 +860,6 @@ qla84xx_reset(struct fc_bsg_job *bsg_job)
int rval = 0; int rval = 0;
uint32_t flag; uint32_t flag;
if (test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags) ||
test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags) ||
test_bit(ISP_ABORT_RETRY, &vha->dpc_flags)) {
ql_log(ql_log_warn, vha, 0x702e, "Abort active or needed.\n");
return -EBUSY;
}
if (!IS_QLA84XX(ha)) { if (!IS_QLA84XX(ha)) {
ql_dbg(ql_dbg_user, vha, 0x702f, "Not 84xx, exiting.\n"); ql_dbg(ql_dbg_user, vha, 0x702f, "Not 84xx, exiting.\n");
return -EINVAL; return -EINVAL;
@ -922,11 +901,6 @@ qla84xx_updatefw(struct fc_bsg_job *bsg_job)
uint32_t flag; uint32_t flag;
uint32_t fw_ver; uint32_t fw_ver;
if (test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags) ||
test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags) ||
test_bit(ISP_ABORT_RETRY, &vha->dpc_flags))
return -EBUSY;
if (!IS_QLA84XX(ha)) { if (!IS_QLA84XX(ha)) {
ql_dbg(ql_dbg_user, vha, 0x7032, ql_dbg(ql_dbg_user, vha, 0x7032,
"Not 84xx, exiting.\n"); "Not 84xx, exiting.\n");
@ -1036,14 +1010,6 @@ qla84xx_mgmt_cmd(struct fc_bsg_job *bsg_job)
uint32_t data_len = 0; uint32_t data_len = 0;
uint32_t dma_direction = DMA_NONE; uint32_t dma_direction = DMA_NONE;
if (test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags) ||
test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags) ||
test_bit(ISP_ABORT_RETRY, &vha->dpc_flags)) {
ql_log(ql_log_warn, vha, 0x7039,
"Abort active or needed.\n");
return -EBUSY;
}
if (!IS_QLA84XX(ha)) { if (!IS_QLA84XX(ha)) {
ql_log(ql_log_warn, vha, 0x703a, ql_log(ql_log_warn, vha, 0x703a,
"Not 84xx, exiting.\n"); "Not 84xx, exiting.\n");
@ -1246,13 +1212,6 @@ qla24xx_iidma(struct fc_bsg_job *bsg_job)
bsg_job->reply->reply_payload_rcv_len = 0; bsg_job->reply->reply_payload_rcv_len = 0;
if (test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags) ||
test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags) ||
test_bit(ISP_ABORT_RETRY, &vha->dpc_flags)) {
ql_log(ql_log_warn, vha, 0x7045, "abort active or needed.\n");
return -EBUSY;
}
if (!IS_IIDMA_CAPABLE(vha->hw)) { if (!IS_IIDMA_CAPABLE(vha->hw)) {
ql_log(ql_log_info, vha, 0x7046, "iiDMA not supported.\n"); ql_log(ql_log_info, vha, 0x7046, "iiDMA not supported.\n");
return -EINVAL; return -EINVAL;
@ -1668,6 +1627,15 @@ qla24xx_bsg_request(struct fc_bsg_job *bsg_job)
vha = shost_priv(host); vha = shost_priv(host);
} }
if (qla2x00_reset_active(vha)) {
ql_dbg(ql_dbg_user, vha, 0x709f,
"BSG: ISP abort active/needed -- cmd=%d.\n",
bsg_job->request->msgcode);
bsg_job->reply->result = (DID_ERROR << 16);
bsg_job->job_done(bsg_job);
return -EBUSY;
}
ql_dbg(ql_dbg_user, vha, 0x7000, ql_dbg(ql_dbg_user, vha, 0x7000,
"Entered %s msgcode=0x%x.\n", __func__, bsg_job->request->msgcode); "Entered %s msgcode=0x%x.\n", __func__, bsg_job->request->msgcode);

View File

@ -19,7 +19,8 @@
* | DPC Thread | 0x401c | | * | DPC Thread | 0x401c | |
* | Async Events | 0x5057 | 0x5052 | * | Async Events | 0x5057 | 0x5052 |
* | Timer Routines | 0x6011 | 0x600e,0x600f | * | Timer Routines | 0x6011 | 0x600e,0x600f |
* | User Space Interactions | 0x709e | | * | User Space Interactions | 0x709e | 0x7018,0x702e |
* | | | 0x7039,0x7045 |
* | Task Management | 0x803c | 0x8025-0x8026 | * | Task Management | 0x803c | 0x8025-0x8026 |
* | | | 0x800b,0x8039 | * | | | 0x800b,0x8039 |
* | AER/EEH | 0x900f | | * | AER/EEH | 0x900f | |

View File

@ -44,6 +44,7 @@
* ISP2100 HBAs. * ISP2100 HBAs.
*/ */
#define MAILBOX_REGISTER_COUNT_2100 8 #define MAILBOX_REGISTER_COUNT_2100 8
#define MAILBOX_REGISTER_COUNT_2200 24
#define MAILBOX_REGISTER_COUNT 32 #define MAILBOX_REGISTER_COUNT 32
#define QLA2200A_RISC_ROM_VER 4 #define QLA2200A_RISC_ROM_VER 4

View File

@ -131,3 +131,16 @@ qla2x00_hba_err_chk_enabled(srb_t *sp)
} }
return 0; return 0;
} }
static inline int
qla2x00_reset_active(scsi_qla_host_t *vha)
{
scsi_qla_host_t *base_vha = pci_get_drvdata(vha->hw->pdev);
/* Test appropriate base-vha and vha flags. */
return test_bit(ISP_ABORT_NEEDED, &base_vha->dpc_flags) ||
test_bit(ABORT_ISP_ACTIVE, &base_vha->dpc_flags) ||
test_bit(ISP_ABORT_RETRY, &base_vha->dpc_flags) ||
test_bit(ISP_ABORT_NEEDED, &vha->dpc_flags) ||
test_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags);
}

View File

@ -2090,7 +2090,6 @@ void qla24xx_process_response_queue(struct scsi_qla_host *vha,
break; break;
case CT_IOCB_TYPE: case CT_IOCB_TYPE:
qla24xx_els_ct_entry(vha, rsp->req, pkt, CT_IOCB_TYPE); qla24xx_els_ct_entry(vha, rsp->req, pkt, CT_IOCB_TYPE);
clear_bit(MBX_INTERRUPT, &vha->hw->mbx_cmd_flags);
break; break;
case ELS_IOCB_TYPE: case ELS_IOCB_TYPE:
qla24xx_els_ct_entry(vha, rsp->req, pkt, ELS_IOCB_TYPE); qla24xx_els_ct_entry(vha, rsp->req, pkt, ELS_IOCB_TYPE);

View File

@ -342,6 +342,8 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp)
set_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags); set_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags);
clear_bit(ISP_ABORT_NEEDED, &vha->dpc_flags); clear_bit(ISP_ABORT_NEEDED, &vha->dpc_flags);
/* Allow next mbx cmd to come in. */
complete(&ha->mbx_cmd_comp);
if (ha->isp_ops->abort_isp(vha)) { if (ha->isp_ops->abort_isp(vha)) {
/* Failed. retry later. */ /* Failed. retry later. */
set_bit(ISP_ABORT_NEEDED, set_bit(ISP_ABORT_NEEDED,
@ -350,6 +352,7 @@ qla2x00_mailbox_command(scsi_qla_host_t *vha, mbx_cmd_t *mcp)
clear_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags); clear_bit(ABORT_ISP_ACTIVE, &vha->dpc_flags);
ql_dbg(ql_dbg_mbx, base_vha, 0x101f, ql_dbg(ql_dbg_mbx, base_vha, 0x101f,
"Finished abort_isp.\n"); "Finished abort_isp.\n");
goto mbx_done;
} }
} }
} }
@ -358,6 +361,7 @@ premature_exit:
/* Allow next mbx cmd to come in. */ /* Allow next mbx cmd to come in. */
complete(&ha->mbx_cmd_comp); complete(&ha->mbx_cmd_comp);
mbx_done:
if (rval) { if (rval) {
ql_dbg(ql_dbg_mbx, base_vha, 0x1020, ql_dbg(ql_dbg_mbx, base_vha, 0x1020,
"**** Failed mbx[0]=%x, mb[1]=%x, mb[2]=%x, cmd=%x ****.\n", "**** Failed mbx[0]=%x, mb[1]=%x, mb[2]=%x, cmd=%x ****.\n",
@ -2581,7 +2585,8 @@ qla2x00_stop_firmware(scsi_qla_host_t *vha)
ql_dbg(ql_dbg_mbx, vha, 0x10a1, "Entered %s.\n", __func__); ql_dbg(ql_dbg_mbx, vha, 0x10a1, "Entered %s.\n", __func__);
mcp->mb[0] = MBC_STOP_FIRMWARE; mcp->mb[0] = MBC_STOP_FIRMWARE;
mcp->out_mb = MBX_0; mcp->mb[1] = 0;
mcp->out_mb = MBX_1|MBX_0;
mcp->in_mb = MBX_0; mcp->in_mb = MBX_0;
mcp->tov = 5; mcp->tov = 5;
mcp->flags = 0; mcp->flags = 0;

View File

@ -1165,19 +1165,6 @@ qla82xx_pinit_from_rom(scsi_qla_host_t *vha)
qla82xx_wr_32(ha, QLA82XX_ROMUSB_GLB_SW_RESET, 0xfeffffff); qla82xx_wr_32(ha, QLA82XX_ROMUSB_GLB_SW_RESET, 0xfeffffff);
else else
qla82xx_wr_32(ha, QLA82XX_ROMUSB_GLB_SW_RESET, 0xffffffff); qla82xx_wr_32(ha, QLA82XX_ROMUSB_GLB_SW_RESET, 0xffffffff);
/* reset ms */
val = qla82xx_rd_32(ha, QLA82XX_CRB_QDR_NET + 0xe4);
val |= (1 << 1);
qla82xx_wr_32(ha, QLA82XX_CRB_QDR_NET + 0xe4, val);
msleep(20);
/* unreset ms */
val = qla82xx_rd_32(ha, QLA82XX_CRB_QDR_NET + 0xe4);
val &= ~(1 << 1);
qla82xx_wr_32(ha, QLA82XX_CRB_QDR_NET + 0xe4, val);
msleep(20);
qla82xx_rom_unlock(ha); qla82xx_rom_unlock(ha);
/* Read the signature value from the flash. /* Read the signature value from the flash.
@ -3392,7 +3379,7 @@ void qla82xx_watchdog(scsi_qla_host_t *vha)
QLA82XX_CRB_PEG_NET_3 + 0x3c), QLA82XX_CRB_PEG_NET_3 + 0x3c),
qla82xx_rd_32(ha, qla82xx_rd_32(ha,
QLA82XX_CRB_PEG_NET_4 + 0x3c)); QLA82XX_CRB_PEG_NET_4 + 0x3c));
if (LSW(MSB(halt_status)) == 0x67) if (((halt_status & 0x1fffff00) >> 8) == 0x67)
ql_log(ql_log_warn, vha, 0xb052, ql_log(ql_log_warn, vha, 0xb052,
"Firmware aborted with " "Firmware aborted with "
"error code 0x00006700. Device is " "error code 0x00006700. Device is "

View File

@ -625,6 +625,12 @@ qla2xxx_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd)
cmd->result = DID_NO_CONNECT << 16; cmd->result = DID_NO_CONNECT << 16;
goto qc24_fail_command; goto qc24_fail_command;
} }
if (!fcport) {
cmd->result = DID_NO_CONNECT << 16;
goto qc24_fail_command;
}
if (atomic_read(&fcport->state) != FCS_ONLINE) { if (atomic_read(&fcport->state) != FCS_ONLINE) {
if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD || if (atomic_read(&fcport->state) == FCS_DEVICE_DEAD ||
atomic_read(&base_vha->loop_state) == LOOP_DEAD) { atomic_read(&base_vha->loop_state) == LOOP_DEAD) {
@ -877,6 +883,7 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
spin_unlock_irqrestore(&ha->hardware_lock, flags); spin_unlock_irqrestore(&ha->hardware_lock, flags);
if (ha->isp_ops->abort_command(sp)) { if (ha->isp_ops->abort_command(sp)) {
ret = FAILED;
ql_dbg(ql_dbg_taskm, vha, 0x8003, ql_dbg(ql_dbg_taskm, vha, 0x8003,
"Abort command mbx failed cmd=%p.\n", cmd); "Abort command mbx failed cmd=%p.\n", cmd);
} else { } else {
@ -1124,7 +1131,6 @@ static int
qla2xxx_eh_host_reset(struct scsi_cmnd *cmd) qla2xxx_eh_host_reset(struct scsi_cmnd *cmd)
{ {
scsi_qla_host_t *vha = shost_priv(cmd->device->host); scsi_qla_host_t *vha = shost_priv(cmd->device->host);
fc_port_t *fcport = (struct fc_port *) cmd->device->hostdata;
struct qla_hw_data *ha = vha->hw; struct qla_hw_data *ha = vha->hw;
int ret = FAILED; int ret = FAILED;
unsigned int id, lun; unsigned int id, lun;
@ -1133,15 +1139,6 @@ qla2xxx_eh_host_reset(struct scsi_cmnd *cmd)
id = cmd->device->id; id = cmd->device->id;
lun = cmd->device->lun; lun = cmd->device->lun;
if (!fcport) {
return ret;
}
ret = fc_block_scsi_eh(cmd);
if (ret != 0)
return ret;
ret = FAILED;
ql_log(ql_log_info, vha, 0x8018, ql_log(ql_log_info, vha, 0x8018,
"ADAPTER RESET ISSUED nexus=%ld:%d:%d.\n", vha->host_no, id, lun); "ADAPTER RESET ISSUED nexus=%ld:%d:%d.\n", vha->host_no, id, lun);
@ -2047,7 +2044,7 @@ qla2x00_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
ha->nvram_data_off = ~0; ha->nvram_data_off = ~0;
ha->isp_ops = &qla2100_isp_ops; ha->isp_ops = &qla2100_isp_ops;
} else if (IS_QLA2200(ha)) { } else if (IS_QLA2200(ha)) {
ha->mbx_count = MAILBOX_REGISTER_COUNT; ha->mbx_count = MAILBOX_REGISTER_COUNT_2200;
req_length = REQUEST_ENTRY_CNT_2200; req_length = REQUEST_ENTRY_CNT_2200;
rsp_length = RESPONSE_ENTRY_CNT_2100; rsp_length = RESPONSE_ENTRY_CNT_2100;
ha->max_loop_id = SNS_LAST_LOOP_ID_2100; ha->max_loop_id = SNS_LAST_LOOP_ID_2100;

View File

@ -7,7 +7,7 @@
/* /*
* Driver version * Driver version
*/ */
#define QLA2XXX_VERSION "8.03.07.12-k" #define QLA2XXX_VERSION "8.03.07.13-k"
#define QLA_DRIVER_MAJOR_VER 8 #define QLA_DRIVER_MAJOR_VER 8
#define QLA_DRIVER_MINOR_VER 3 #define QLA_DRIVER_MINOR_VER 3

View File

@ -7,6 +7,7 @@
#include <linux/pm_runtime.h> #include <linux/pm_runtime.h>
#include <linux/export.h> #include <linux/export.h>
#include <linux/async.h>
#include <scsi/scsi.h> #include <scsi/scsi.h>
#include <scsi/scsi_device.h> #include <scsi/scsi_device.h>
@ -92,6 +93,19 @@ static int scsi_bus_resume_common(struct device *dev)
return err; return err;
} }
static int scsi_bus_prepare(struct device *dev)
{
if (scsi_is_sdev_device(dev)) {
/* sd probing uses async_schedule. Wait until it finishes. */
async_synchronize_full();
} else if (scsi_is_host_device(dev)) {
/* Wait until async scanning is finished */
scsi_complete_async_scans();
}
return 0;
}
static int scsi_bus_suspend(struct device *dev) static int scsi_bus_suspend(struct device *dev)
{ {
return scsi_bus_suspend_common(dev, PMSG_SUSPEND); return scsi_bus_suspend_common(dev, PMSG_SUSPEND);
@ -110,6 +124,7 @@ static int scsi_bus_poweroff(struct device *dev)
#else /* CONFIG_PM_SLEEP */ #else /* CONFIG_PM_SLEEP */
#define scsi_bus_resume_common NULL #define scsi_bus_resume_common NULL
#define scsi_bus_prepare NULL
#define scsi_bus_suspend NULL #define scsi_bus_suspend NULL
#define scsi_bus_freeze NULL #define scsi_bus_freeze NULL
#define scsi_bus_poweroff NULL #define scsi_bus_poweroff NULL
@ -218,6 +233,7 @@ void scsi_autopm_put_host(struct Scsi_Host *shost)
#endif /* CONFIG_PM_RUNTIME */ #endif /* CONFIG_PM_RUNTIME */
const struct dev_pm_ops scsi_bus_pm_ops = { const struct dev_pm_ops scsi_bus_pm_ops = {
.prepare = scsi_bus_prepare,
.suspend = scsi_bus_suspend, .suspend = scsi_bus_suspend,
.resume = scsi_bus_resume_common, .resume = scsi_bus_resume_common,
.freeze = scsi_bus_freeze, .freeze = scsi_bus_freeze,

View File

@ -109,6 +109,7 @@ extern void scsi_exit_procfs(void);
#endif /* CONFIG_PROC_FS */ #endif /* CONFIG_PROC_FS */
/* scsi_scan.c */ /* scsi_scan.c */
extern int scsi_complete_async_scans(void);
extern int scsi_scan_host_selected(struct Scsi_Host *, unsigned int, extern int scsi_scan_host_selected(struct Scsi_Host *, unsigned int,
unsigned int, unsigned int, int); unsigned int, unsigned int, int);
extern void scsi_forget_host(struct Scsi_Host *); extern void scsi_forget_host(struct Scsi_Host *);

View File

@ -1815,6 +1815,7 @@ static void scsi_finish_async_scan(struct async_scan_data *data)
} }
spin_unlock(&async_scan_lock); spin_unlock(&async_scan_lock);
scsi_autopm_put_host(shost);
scsi_host_put(shost); scsi_host_put(shost);
kfree(data); kfree(data);
} }
@ -1841,7 +1842,6 @@ static int do_scan_async(void *_data)
do_scsi_scan_host(shost); do_scsi_scan_host(shost);
scsi_finish_async_scan(data); scsi_finish_async_scan(data);
scsi_autopm_put_host(shost);
return 0; return 0;
} }
@ -1869,7 +1869,7 @@ void scsi_scan_host(struct Scsi_Host *shost)
p = kthread_run(do_scan_async, data, "scsi_scan_%d", shost->host_no); p = kthread_run(do_scan_async, data, "scsi_scan_%d", shost->host_no);
if (IS_ERR(p)) if (IS_ERR(p))
do_scan_async(data); do_scan_async(data);
/* scsi_autopm_put_host(shost) is called in do_scan_async() */ /* scsi_autopm_put_host(shost) is called in scsi_finish_async_scan() */
} }
EXPORT_SYMBOL(scsi_scan_host); EXPORT_SYMBOL(scsi_scan_host);

View File

@ -190,7 +190,7 @@ static int __init sh_clk_init_parent(struct clk *clk)
return -EINVAL; return -EINVAL;
} }
clk->parent = clk->parent_table[val]; clk_reparent(clk, clk->parent_table[val]);
if (!clk->parent) { if (!clk->parent) {
pr_err("sh_clk_init_parent: unable to set parent"); pr_err("sh_clk_init_parent: unable to set parent");
return -EINVAL; return -EINVAL;

View File

@ -1061,7 +1061,7 @@ static struct pvr2_board {
int (*init)(void); int (*init)(void);
void (*exit)(void); void (*exit)(void);
char name[16]; char name[16];
} board_driver[] = { } board_driver[] __refdata = {
#ifdef CONFIG_SH_DREAMCAST #ifdef CONFIG_SH_DREAMCAST
{ pvr2fb_dc_init, pvr2fb_dc_exit, "Sega DC PVR2" }, { pvr2fb_dc_init, pvr2fb_dc_exit, "Sega DC PVR2" },
#endif #endif

View File

@ -110,6 +110,7 @@ struct autofs_sb_info {
int sub_version; int sub_version;
int min_proto; int min_proto;
int max_proto; int max_proto;
int compat_daemon;
unsigned long exp_timeout; unsigned long exp_timeout;
unsigned int type; unsigned int type;
int reghost_enabled; int reghost_enabled;

View File

@ -385,6 +385,7 @@ static int autofs_dev_ioctl_setpipefd(struct file *fp,
sbi->pipefd = pipefd; sbi->pipefd = pipefd;
sbi->pipe = pipe; sbi->pipe = pipe;
sbi->catatonic = 0; sbi->catatonic = 0;
sbi->compat_daemon = is_compat_task();
} }
out: out:
mutex_unlock(&sbi->wq_mutex); mutex_unlock(&sbi->wq_mutex);

View File

@ -19,6 +19,7 @@
#include <linux/parser.h> #include <linux/parser.h>
#include <linux/bitops.h> #include <linux/bitops.h>
#include <linux/magic.h> #include <linux/magic.h>
#include <linux/compat.h>
#include "autofs_i.h" #include "autofs_i.h"
#include <linux/module.h> #include <linux/module.h>
@ -224,6 +225,7 @@ int autofs4_fill_super(struct super_block *s, void *data, int silent)
set_autofs_type_indirect(&sbi->type); set_autofs_type_indirect(&sbi->type);
sbi->min_proto = 0; sbi->min_proto = 0;
sbi->max_proto = 0; sbi->max_proto = 0;
sbi->compat_daemon = is_compat_task();
mutex_init(&sbi->wq_mutex); mutex_init(&sbi->wq_mutex);
mutex_init(&sbi->pipe_mutex); mutex_init(&sbi->pipe_mutex);
spin_lock_init(&sbi->fs_lock); spin_lock_init(&sbi->fs_lock);

View File

@ -91,7 +91,24 @@ static int autofs4_write(struct autofs_sb_info *sbi,
return (bytes > 0); return (bytes > 0);
} }
/*
* The autofs_v5 packet was misdesigned.
*
* The packets are identical on x86-32 and x86-64, but have different
* alignment. Which means that 'sizeof()' will give different results.
* Fix it up for the case of running 32-bit user mode on a 64-bit kernel.
*/
static noinline size_t autofs_v5_packet_size(struct autofs_sb_info *sbi)
{
size_t pktsz = sizeof(struct autofs_v5_packet);
#if defined(CONFIG_X86_64) && defined(CONFIG_COMPAT)
if (sbi->compat_daemon > 0)
pktsz -= 4;
#endif
return pktsz;
}
static void autofs4_notify_daemon(struct autofs_sb_info *sbi, static void autofs4_notify_daemon(struct autofs_sb_info *sbi,
struct autofs_wait_queue *wq, struct autofs_wait_queue *wq,
int type) int type)
@ -155,8 +172,7 @@ static void autofs4_notify_daemon(struct autofs_sb_info *sbi,
{ {
struct autofs_v5_packet *packet = &pkt.v5_pkt.v5_packet; struct autofs_v5_packet *packet = &pkt.v5_pkt.v5_packet;
pktsz = sizeof(*packet); pktsz = autofs_v5_packet_size(sbi);
packet->wait_queue_token = wq->wait_queue_token; packet->wait_queue_token = wq->wait_queue_token;
packet->len = wq->name.len; packet->len = wq->name.len;
memcpy(packet->name, wq->name.name, wq->name.len); memcpy(packet->name, wq->name.name, wq->name.len);

View File

@ -892,6 +892,8 @@ static char *iref_to_path(struct btrfs_root *fs_root, struct btrfs_path *path,
if (eb != eb_in) if (eb != eb_in)
free_extent_buffer(eb); free_extent_buffer(eb);
ret = inode_ref_info(parent, 0, fs_root, path, &found_key); ret = inode_ref_info(parent, 0, fs_root, path, &found_key);
if (ret > 0)
ret = -ENOENT;
if (ret) if (ret)
break; break;
next_inum = found_key.offset; next_inum = found_key.offset;

View File

@ -644,7 +644,7 @@ static struct btrfsic_dev_state *btrfsic_dev_state_hashtable_lookup(
static int btrfsic_process_superblock(struct btrfsic_state *state, static int btrfsic_process_superblock(struct btrfsic_state *state,
struct btrfs_fs_devices *fs_devices) struct btrfs_fs_devices *fs_devices)
{ {
int ret; int ret = 0;
struct btrfs_super_block *selected_super; struct btrfs_super_block *selected_super;
struct list_head *dev_head = &fs_devices->devices; struct list_head *dev_head = &fs_devices->devices;
struct btrfs_device *device; struct btrfs_device *device;

View File

@ -588,6 +588,8 @@ int btrfs_submit_compressed_read(struct inode *inode, struct bio *bio,
page_offset(bio->bi_io_vec->bv_page), page_offset(bio->bi_io_vec->bv_page),
PAGE_CACHE_SIZE); PAGE_CACHE_SIZE);
read_unlock(&em_tree->lock); read_unlock(&em_tree->lock);
if (!em)
return -EIO;
compressed_len = em->block_len; compressed_len = em->block_len;
cb = kmalloc(compressed_bio_size(root, compressed_len), GFP_NOFS); cb = kmalloc(compressed_bio_size(root, compressed_len), GFP_NOFS);

View File

@ -886,7 +886,7 @@ struct btrfs_block_rsv {
u64 reserved; u64 reserved;
struct btrfs_space_info *space_info; struct btrfs_space_info *space_info;
spinlock_t lock; spinlock_t lock;
unsigned int full:1; unsigned int full;
}; };
/* /*

View File

@ -2260,6 +2260,12 @@ int open_ctree(struct super_block *sb,
goto fail_sb_buffer; goto fail_sb_buffer;
} }
if (sectorsize < PAGE_SIZE) {
printk(KERN_WARNING "btrfs: Incompatible sector size "
"found on %s\n", sb->s_id);
goto fail_sb_buffer;
}
mutex_lock(&fs_info->chunk_mutex); mutex_lock(&fs_info->chunk_mutex);
ret = btrfs_read_sys_array(tree_root); ret = btrfs_read_sys_array(tree_root);
mutex_unlock(&fs_info->chunk_mutex); mutex_unlock(&fs_info->chunk_mutex);
@ -2301,6 +2307,12 @@ int open_ctree(struct super_block *sb,
btrfs_close_extra_devices(fs_devices); btrfs_close_extra_devices(fs_devices);
if (!fs_devices->latest_bdev) {
printk(KERN_CRIT "btrfs: failed to read devices on %s\n",
sb->s_id);
goto fail_tree_roots;
}
retry_root_backup: retry_root_backup:
blocksize = btrfs_level_size(tree_root, blocksize = btrfs_level_size(tree_root,
btrfs_super_root_level(disk_super)); btrfs_super_root_level(disk_super));

View File

@ -3312,7 +3312,8 @@ commit_trans:
} }
data_sinfo->bytes_may_use += bytes; data_sinfo->bytes_may_use += bytes;
trace_btrfs_space_reservation(root->fs_info, "space_info", trace_btrfs_space_reservation(root->fs_info, "space_info",
(u64)data_sinfo, bytes, 1); (u64)(unsigned long)data_sinfo,
bytes, 1);
spin_unlock(&data_sinfo->lock); spin_unlock(&data_sinfo->lock);
return 0; return 0;
@ -3333,7 +3334,8 @@ void btrfs_free_reserved_data_space(struct inode *inode, u64 bytes)
spin_lock(&data_sinfo->lock); spin_lock(&data_sinfo->lock);
data_sinfo->bytes_may_use -= bytes; data_sinfo->bytes_may_use -= bytes;
trace_btrfs_space_reservation(root->fs_info, "space_info", trace_btrfs_space_reservation(root->fs_info, "space_info",
(u64)data_sinfo, bytes, 0); (u64)(unsigned long)data_sinfo,
bytes, 0);
spin_unlock(&data_sinfo->lock); spin_unlock(&data_sinfo->lock);
} }
@ -3611,12 +3613,15 @@ static int may_commit_transaction(struct btrfs_root *root,
if (space_info != delayed_rsv->space_info) if (space_info != delayed_rsv->space_info)
return -ENOSPC; return -ENOSPC;
spin_lock(&space_info->lock);
spin_lock(&delayed_rsv->lock); spin_lock(&delayed_rsv->lock);
if (delayed_rsv->size < bytes) { if (space_info->bytes_pinned + delayed_rsv->size < bytes) {
spin_unlock(&delayed_rsv->lock); spin_unlock(&delayed_rsv->lock);
spin_unlock(&space_info->lock);
return -ENOSPC; return -ENOSPC;
} }
spin_unlock(&delayed_rsv->lock); spin_unlock(&delayed_rsv->lock);
spin_unlock(&space_info->lock);
commit: commit:
trans = btrfs_join_transaction(root); trans = btrfs_join_transaction(root);
@ -3695,9 +3700,9 @@ again:
if (used + orig_bytes <= space_info->total_bytes) { if (used + orig_bytes <= space_info->total_bytes) {
space_info->bytes_may_use += orig_bytes; space_info->bytes_may_use += orig_bytes;
trace_btrfs_space_reservation(root->fs_info, trace_btrfs_space_reservation(root->fs_info,
"space_info", "space_info",
(u64)space_info, (u64)(unsigned long)space_info,
orig_bytes, 1); orig_bytes, 1);
ret = 0; ret = 0;
} else { } else {
/* /*
@ -3766,9 +3771,9 @@ again:
if (used + num_bytes < space_info->total_bytes + avail) { if (used + num_bytes < space_info->total_bytes + avail) {
space_info->bytes_may_use += orig_bytes; space_info->bytes_may_use += orig_bytes;
trace_btrfs_space_reservation(root->fs_info, trace_btrfs_space_reservation(root->fs_info,
"space_info", "space_info",
(u64)space_info, (u64)(unsigned long)space_info,
orig_bytes, 1); orig_bytes, 1);
ret = 0; ret = 0;
} else { } else {
wait_ordered = true; wait_ordered = true;
@ -3913,8 +3918,8 @@ static void block_rsv_release_bytes(struct btrfs_fs_info *fs_info,
spin_lock(&space_info->lock); spin_lock(&space_info->lock);
space_info->bytes_may_use -= num_bytes; space_info->bytes_may_use -= num_bytes;
trace_btrfs_space_reservation(fs_info, "space_info", trace_btrfs_space_reservation(fs_info, "space_info",
(u64)space_info, (u64)(unsigned long)space_info,
num_bytes, 0); num_bytes, 0);
space_info->reservation_progress++; space_info->reservation_progress++;
spin_unlock(&space_info->lock); spin_unlock(&space_info->lock);
} }
@ -4105,7 +4110,7 @@ static u64 calc_global_metadata_size(struct btrfs_fs_info *fs_info)
num_bytes += div64_u64(data_used + meta_used, 50); num_bytes += div64_u64(data_used + meta_used, 50);
if (num_bytes * 3 > meta_used) if (num_bytes * 3 > meta_used)
num_bytes = div64_u64(meta_used, 3); num_bytes = div64_u64(meta_used, 3) * 2;
return ALIGN(num_bytes, fs_info->extent_root->leafsize << 10); return ALIGN(num_bytes, fs_info->extent_root->leafsize << 10);
} }
@ -4132,14 +4137,14 @@ static void update_global_block_rsv(struct btrfs_fs_info *fs_info)
block_rsv->reserved += num_bytes; block_rsv->reserved += num_bytes;
sinfo->bytes_may_use += num_bytes; sinfo->bytes_may_use += num_bytes;
trace_btrfs_space_reservation(fs_info, "space_info", trace_btrfs_space_reservation(fs_info, "space_info",
(u64)sinfo, num_bytes, 1); (u64)(unsigned long)sinfo, num_bytes, 1);
} }
if (block_rsv->reserved >= block_rsv->size) { if (block_rsv->reserved >= block_rsv->size) {
num_bytes = block_rsv->reserved - block_rsv->size; num_bytes = block_rsv->reserved - block_rsv->size;
sinfo->bytes_may_use -= num_bytes; sinfo->bytes_may_use -= num_bytes;
trace_btrfs_space_reservation(fs_info, "space_info", trace_btrfs_space_reservation(fs_info, "space_info",
(u64)sinfo, num_bytes, 0); (u64)(unsigned long)sinfo, num_bytes, 0);
sinfo->reservation_progress++; sinfo->reservation_progress++;
block_rsv->reserved = block_rsv->size; block_rsv->reserved = block_rsv->size;
block_rsv->full = 1; block_rsv->full = 1;
@ -4192,7 +4197,8 @@ void btrfs_trans_release_metadata(struct btrfs_trans_handle *trans,
if (!trans->bytes_reserved) if (!trans->bytes_reserved)
return; return;
trace_btrfs_space_reservation(root->fs_info, "transaction", (u64)trans, trace_btrfs_space_reservation(root->fs_info, "transaction",
(u64)(unsigned long)trans,
trans->bytes_reserved, 0); trans->bytes_reserved, 0);
btrfs_block_rsv_release(root, trans->block_rsv, trans->bytes_reserved); btrfs_block_rsv_release(root, trans->block_rsv, trans->bytes_reserved);
trans->bytes_reserved = 0; trans->bytes_reserved = 0;
@ -4710,9 +4716,9 @@ static int btrfs_update_reserved_bytes(struct btrfs_block_group_cache *cache,
space_info->bytes_reserved += num_bytes; space_info->bytes_reserved += num_bytes;
if (reserve == RESERVE_ALLOC) { if (reserve == RESERVE_ALLOC) {
trace_btrfs_space_reservation(cache->fs_info, trace_btrfs_space_reservation(cache->fs_info,
"space_info", "space_info",
(u64)space_info, (u64)(unsigned long)space_info,
num_bytes, 0); num_bytes, 0);
space_info->bytes_may_use -= num_bytes; space_info->bytes_may_use -= num_bytes;
} }
} }
@ -7886,9 +7892,16 @@ int btrfs_trim_fs(struct btrfs_root *root, struct fstrim_range *range)
u64 start; u64 start;
u64 end; u64 end;
u64 trimmed = 0; u64 trimmed = 0;
u64 total_bytes = btrfs_super_total_bytes(fs_info->super_copy);
int ret = 0; int ret = 0;
cache = btrfs_lookup_block_group(fs_info, range->start); /*
* try to trim all FS space, our block group may start from non-zero.
*/
if (range->len == total_bytes)
cache = btrfs_lookup_first_block_group(fs_info, range->start);
else
cache = btrfs_lookup_block_group(fs_info, range->start);
while (cache) { while (cache) {
if (cache->key.objectid >= (range->start + range->len)) { if (cache->key.objectid >= (range->start + range->len)) {

View File

@ -513,6 +513,15 @@ hit_next:
WARN_ON(state->end < start); WARN_ON(state->end < start);
last_end = state->end; last_end = state->end;
if (state->end < end && !need_resched())
next_node = rb_next(&state->rb_node);
else
next_node = NULL;
/* the state doesn't have the wanted bits, go ahead */
if (!(state->state & bits))
goto next;
/* /*
* | ---- desired range ---- | * | ---- desired range ---- |
* | state | or * | state | or
@ -565,20 +574,15 @@ hit_next:
goto out; goto out;
} }
if (state->end < end && prealloc && !need_resched())
next_node = rb_next(&state->rb_node);
else
next_node = NULL;
set |= clear_state_bit(tree, state, &bits, wake); set |= clear_state_bit(tree, state, &bits, wake);
next:
if (last_end == (u64)-1) if (last_end == (u64)-1)
goto out; goto out;
start = last_end + 1; start = last_end + 1;
if (start <= end && next_node) { if (start <= end && next_node) {
state = rb_entry(next_node, struct extent_state, state = rb_entry(next_node, struct extent_state,
rb_node); rb_node);
if (state->start == start) goto hit_next;
goto hit_next;
} }
goto search_again; goto search_again;
@ -961,8 +965,6 @@ hit_next:
set_state_bits(tree, state, &bits); set_state_bits(tree, state, &bits);
clear_state_bit(tree, state, &clear_bits, 0); clear_state_bit(tree, state, &clear_bits, 0);
merge_state(tree, state);
if (last_end == (u64)-1) if (last_end == (u64)-1)
goto out; goto out;
@ -1007,7 +1009,6 @@ hit_next:
if (state->end <= end) { if (state->end <= end) {
set_state_bits(tree, state, &bits); set_state_bits(tree, state, &bits);
clear_state_bit(tree, state, &clear_bits, 0); clear_state_bit(tree, state, &clear_bits, 0);
merge_state(tree, state);
if (last_end == (u64)-1) if (last_end == (u64)-1)
goto out; goto out;
start = last_end + 1; start = last_end + 1;
@ -1068,8 +1069,6 @@ hit_next:
set_state_bits(tree, prealloc, &bits); set_state_bits(tree, prealloc, &bits);
clear_state_bit(tree, prealloc, &clear_bits, 0); clear_state_bit(tree, prealloc, &clear_bits, 0);
merge_state(tree, prealloc);
prealloc = NULL; prealloc = NULL;
goto out; goto out;
} }
@ -2154,13 +2153,46 @@ static int bio_readpage_error(struct bio *failed_bio, struct page *page,
"this_mirror=%d, num_copies=%d, in_validation=%d\n", read_mode, "this_mirror=%d, num_copies=%d, in_validation=%d\n", read_mode,
failrec->this_mirror, num_copies, failrec->in_validation); failrec->this_mirror, num_copies, failrec->in_validation);
tree->ops->submit_bio_hook(inode, read_mode, bio, failrec->this_mirror, ret = tree->ops->submit_bio_hook(inode, read_mode, bio,
failrec->bio_flags, 0); failrec->this_mirror,
return 0; failrec->bio_flags, 0);
return ret;
} }
/* lots and lots of room for performance fixes in the end_bio funcs */ /* lots and lots of room for performance fixes in the end_bio funcs */
int end_extent_writepage(struct page *page, int err, u64 start, u64 end)
{
int uptodate = (err == 0);
struct extent_io_tree *tree;
int ret;
tree = &BTRFS_I(page->mapping->host)->io_tree;
if (tree->ops && tree->ops->writepage_end_io_hook) {
ret = tree->ops->writepage_end_io_hook(page, start,
end, NULL, uptodate);
if (ret)
uptodate = 0;
}
if (!uptodate && tree->ops &&
tree->ops->writepage_io_failed_hook) {
ret = tree->ops->writepage_io_failed_hook(NULL, page,
start, end, NULL);
/* Writeback already completed */
if (ret == 0)
return 1;
}
if (!uptodate) {
clear_extent_uptodate(tree, start, end, NULL, GFP_NOFS);
ClearPageUptodate(page);
SetPageError(page);
}
return 0;
}
/* /*
* after a writepage IO is done, we need to: * after a writepage IO is done, we need to:
* clear the uptodate bits on error * clear the uptodate bits on error
@ -2172,13 +2204,11 @@ static int bio_readpage_error(struct bio *failed_bio, struct page *page,
*/ */
static void end_bio_extent_writepage(struct bio *bio, int err) static void end_bio_extent_writepage(struct bio *bio, int err)
{ {
int uptodate = err == 0;
struct bio_vec *bvec = bio->bi_io_vec + bio->bi_vcnt - 1; struct bio_vec *bvec = bio->bi_io_vec + bio->bi_vcnt - 1;
struct extent_io_tree *tree; struct extent_io_tree *tree;
u64 start; u64 start;
u64 end; u64 end;
int whole_page; int whole_page;
int ret;
do { do {
struct page *page = bvec->bv_page; struct page *page = bvec->bv_page;
@ -2195,28 +2225,9 @@ static void end_bio_extent_writepage(struct bio *bio, int err)
if (--bvec >= bio->bi_io_vec) if (--bvec >= bio->bi_io_vec)
prefetchw(&bvec->bv_page->flags); prefetchw(&bvec->bv_page->flags);
if (tree->ops && tree->ops->writepage_end_io_hook) {
ret = tree->ops->writepage_end_io_hook(page, start,
end, NULL, uptodate);
if (ret)
uptodate = 0;
}
if (!uptodate && tree->ops && if (end_extent_writepage(page, err, start, end))
tree->ops->writepage_io_failed_hook) { continue;
ret = tree->ops->writepage_io_failed_hook(bio, page,
start, end, NULL);
if (ret == 0) {
uptodate = (err == 0);
continue;
}
}
if (!uptodate) {
clear_extent_uptodate(tree, start, end, NULL, GFP_NOFS);
ClearPageUptodate(page);
SetPageError(page);
}
if (whole_page) if (whole_page)
end_page_writeback(page); end_page_writeback(page);
@ -2779,9 +2790,12 @@ static int __extent_writepage(struct page *page, struct writeback_control *wbc,
delalloc_start = delalloc_end + 1; delalloc_start = delalloc_end + 1;
continue; continue;
} }
tree->ops->fill_delalloc(inode, page, delalloc_start, ret = tree->ops->fill_delalloc(inode, page,
delalloc_end, &page_started, delalloc_start,
&nr_written); delalloc_end,
&page_started,
&nr_written);
BUG_ON(ret);
/* /*
* delalloc_end is already one less than the total * delalloc_end is already one less than the total
* length, so we don't subtract one from * length, so we don't subtract one from
@ -2818,8 +2832,12 @@ static int __extent_writepage(struct page *page, struct writeback_control *wbc,
if (tree->ops && tree->ops->writepage_start_hook) { if (tree->ops && tree->ops->writepage_start_hook) {
ret = tree->ops->writepage_start_hook(page, start, ret = tree->ops->writepage_start_hook(page, start,
page_end); page_end);
if (ret == -EAGAIN) { if (ret) {
redirty_page_for_writepage(wbc, page); /* Fixup worker will requeue */
if (ret == -EBUSY)
wbc->pages_skipped++;
else
redirty_page_for_writepage(wbc, page);
update_nr_written(page, wbc, nr_written); update_nr_written(page, wbc, nr_written);
unlock_page(page); unlock_page(page);
ret = 0; ret = 0;
@ -3289,7 +3307,7 @@ int try_release_extent_mapping(struct extent_map_tree *map,
len = end - start + 1; len = end - start + 1;
write_lock(&map->lock); write_lock(&map->lock);
em = lookup_extent_mapping(map, start, len); em = lookup_extent_mapping(map, start, len);
if (IS_ERR_OR_NULL(em)) { if (!em) {
write_unlock(&map->lock); write_unlock(&map->lock);
break; break;
} }
@ -3853,10 +3871,9 @@ int clear_extent_buffer_uptodate(struct extent_io_tree *tree,
num_pages = num_extent_pages(eb->start, eb->len); num_pages = num_extent_pages(eb->start, eb->len);
clear_bit(EXTENT_BUFFER_UPTODATE, &eb->bflags); clear_bit(EXTENT_BUFFER_UPTODATE, &eb->bflags);
if (eb_straddles_pages(eb)) { clear_extent_uptodate(tree, eb->start, eb->start + eb->len - 1,
clear_extent_uptodate(tree, eb->start, eb->start + eb->len - 1, cached_state, GFP_NOFS);
cached_state, GFP_NOFS);
}
for (i = 0; i < num_pages; i++) { for (i = 0; i < num_pages; i++) {
page = extent_buffer_page(eb, i); page = extent_buffer_page(eb, i);
if (page) if (page)

View File

@ -319,4 +319,5 @@ struct btrfs_mapping_tree;
int repair_io_failure(struct btrfs_mapping_tree *map_tree, u64 start, int repair_io_failure(struct btrfs_mapping_tree *map_tree, u64 start,
u64 length, u64 logical, struct page *page, u64 length, u64 logical, struct page *page,
int mirror_num); int mirror_num);
int end_extent_writepage(struct page *page, int err, u64 start, u64 end);
#endif #endif

View File

@ -26,8 +26,8 @@ struct extent_map {
unsigned long flags; unsigned long flags;
struct block_device *bdev; struct block_device *bdev;
atomic_t refs; atomic_t refs;
unsigned int in_tree:1; unsigned int in_tree;
unsigned int compress_type:4; unsigned int compress_type;
}; };
struct extent_map_tree { struct extent_map_tree {

View File

@ -1604,6 +1604,14 @@ static long btrfs_fallocate(struct file *file, int mode,
if (mode & ~FALLOC_FL_KEEP_SIZE) if (mode & ~FALLOC_FL_KEEP_SIZE)
return -EOPNOTSUPP; return -EOPNOTSUPP;
/*
* Make sure we have enough space before we do the
* allocation.
*/
ret = btrfs_check_data_free_space(inode, len);
if (ret)
return ret;
/* /*
* wait for ordered IO before we have any locks. We'll loop again * wait for ordered IO before we have any locks. We'll loop again
* below with the locks held. * below with the locks held.
@ -1667,27 +1675,12 @@ static long btrfs_fallocate(struct file *file, int mode,
if (em->block_start == EXTENT_MAP_HOLE || if (em->block_start == EXTENT_MAP_HOLE ||
(cur_offset >= inode->i_size && (cur_offset >= inode->i_size &&
!test_bit(EXTENT_FLAG_PREALLOC, &em->flags))) { !test_bit(EXTENT_FLAG_PREALLOC, &em->flags))) {
/*
* Make sure we have enough space before we do the
* allocation.
*/
ret = btrfs_check_data_free_space(inode, last_byte -
cur_offset);
if (ret) {
free_extent_map(em);
break;
}
ret = btrfs_prealloc_file_range(inode, mode, cur_offset, ret = btrfs_prealloc_file_range(inode, mode, cur_offset,
last_byte - cur_offset, last_byte - cur_offset,
1 << inode->i_blkbits, 1 << inode->i_blkbits,
offset + len, offset + len,
&alloc_hint); &alloc_hint);
/* Let go of our reservation. */
btrfs_free_reserved_data_space(inode, last_byte -
cur_offset);
if (ret < 0) { if (ret < 0) {
free_extent_map(em); free_extent_map(em);
break; break;
@ -1715,6 +1708,8 @@ static long btrfs_fallocate(struct file *file, int mode,
&cached_state, GFP_NOFS); &cached_state, GFP_NOFS);
out: out:
mutex_unlock(&inode->i_mutex); mutex_unlock(&inode->i_mutex);
/* Let go of our reservation. */
btrfs_free_reserved_data_space(inode, len);
return ret; return ret;
} }
@ -1761,7 +1756,7 @@ static int find_desired_extent(struct inode *inode, loff_t *offset, int origin)
start - root->sectorsize, start - root->sectorsize,
root->sectorsize, 0); root->sectorsize, 0);
if (IS_ERR(em)) { if (IS_ERR(em)) {
ret = -ENXIO; ret = PTR_ERR(em);
goto out; goto out;
} }
last_end = em->start + em->len; last_end = em->start + em->len;
@ -1773,7 +1768,7 @@ static int find_desired_extent(struct inode *inode, loff_t *offset, int origin)
while (1) { while (1) {
em = btrfs_get_extent_fiemap(inode, NULL, 0, start, len, 0); em = btrfs_get_extent_fiemap(inode, NULL, 0, start, len, 0);
if (IS_ERR(em)) { if (IS_ERR(em)) {
ret = -ENXIO; ret = PTR_ERR(em);
break; break;
} }

View File

@ -777,6 +777,7 @@ int load_free_space_cache(struct btrfs_fs_info *fs_info,
spin_lock(&block_group->lock); spin_lock(&block_group->lock);
if (block_group->disk_cache_state != BTRFS_DC_WRITTEN) { if (block_group->disk_cache_state != BTRFS_DC_WRITTEN) {
spin_unlock(&block_group->lock); spin_unlock(&block_group->lock);
btrfs_free_path(path);
goto out; goto out;
} }
spin_unlock(&block_group->lock); spin_unlock(&block_group->lock);

View File

@ -438,7 +438,8 @@ int btrfs_save_ino_cache(struct btrfs_root *root,
trans->bytes_reserved); trans->bytes_reserved);
if (ret) if (ret)
goto out; goto out;
trace_btrfs_space_reservation(root->fs_info, "ino_cache", (u64)trans, trace_btrfs_space_reservation(root->fs_info, "ino_cache",
(u64)(unsigned long)trans,
trans->bytes_reserved, 1); trans->bytes_reserved, 1);
again: again:
inode = lookup_free_ino_inode(root, path); inode = lookup_free_ino_inode(root, path);
@ -500,7 +501,8 @@ again:
out_put: out_put:
iput(inode); iput(inode);
out_release: out_release:
trace_btrfs_space_reservation(root->fs_info, "ino_cache", (u64)trans, trace_btrfs_space_reservation(root->fs_info, "ino_cache",
(u64)(unsigned long)trans,
trans->bytes_reserved, 0); trans->bytes_reserved, 0);
btrfs_block_rsv_release(root, trans->block_rsv, trans->bytes_reserved); btrfs_block_rsv_release(root, trans->block_rsv, trans->bytes_reserved);
out: out:

View File

@ -1555,6 +1555,7 @@ static void btrfs_writepage_fixup_worker(struct btrfs_work *work)
struct inode *inode; struct inode *inode;
u64 page_start; u64 page_start;
u64 page_end; u64 page_end;
int ret;
fixup = container_of(work, struct btrfs_writepage_fixup, work); fixup = container_of(work, struct btrfs_writepage_fixup, work);
page = fixup->page; page = fixup->page;
@ -1582,12 +1583,21 @@ again:
page_end, &cached_state, GFP_NOFS); page_end, &cached_state, GFP_NOFS);
unlock_page(page); unlock_page(page);
btrfs_start_ordered_extent(inode, ordered, 1); btrfs_start_ordered_extent(inode, ordered, 1);
btrfs_put_ordered_extent(ordered);
goto again; goto again;
} }
BUG(); ret = btrfs_delalloc_reserve_space(inode, PAGE_CACHE_SIZE);
if (ret) {
mapping_set_error(page->mapping, ret);
end_extent_writepage(page, ret, page_start, page_end);
ClearPageChecked(page);
goto out;
}
btrfs_set_extent_delalloc(inode, page_start, page_end, &cached_state); btrfs_set_extent_delalloc(inode, page_start, page_end, &cached_state);
ClearPageChecked(page); ClearPageChecked(page);
set_page_dirty(page);
out: out:
unlock_extent_cached(&BTRFS_I(inode)->io_tree, page_start, page_end, unlock_extent_cached(&BTRFS_I(inode)->io_tree, page_start, page_end,
&cached_state, GFP_NOFS); &cached_state, GFP_NOFS);
@ -1630,7 +1640,7 @@ static int btrfs_writepage_start_hook(struct page *page, u64 start, u64 end)
fixup->work.func = btrfs_writepage_fixup_worker; fixup->work.func = btrfs_writepage_fixup_worker;
fixup->page = page; fixup->page = page;
btrfs_queue_worker(&root->fs_info->fixup_workers, &fixup->work); btrfs_queue_worker(&root->fs_info->fixup_workers, &fixup->work);
return -EAGAIN; return -EBUSY;
} }
static int insert_reserved_file_extent(struct btrfs_trans_handle *trans, static int insert_reserved_file_extent(struct btrfs_trans_handle *trans,
@ -4575,7 +4585,8 @@ int btrfs_add_link(struct btrfs_trans_handle *trans,
ret = btrfs_insert_dir_item(trans, root, name, name_len, ret = btrfs_insert_dir_item(trans, root, name, name_len,
parent_inode, &key, parent_inode, &key,
btrfs_inode_type(inode), index); btrfs_inode_type(inode), index);
BUG_ON(ret); if (ret)
goto fail_dir_item;
btrfs_i_size_write(parent_inode, parent_inode->i_size + btrfs_i_size_write(parent_inode, parent_inode->i_size +
name_len * 2); name_len * 2);
@ -4583,6 +4594,23 @@ int btrfs_add_link(struct btrfs_trans_handle *trans,
ret = btrfs_update_inode(trans, root, parent_inode); ret = btrfs_update_inode(trans, root, parent_inode);
} }
return ret; return ret;
fail_dir_item:
if (unlikely(ino == BTRFS_FIRST_FREE_OBJECTID)) {
u64 local_index;
int err;
err = btrfs_del_root_ref(trans, root->fs_info->tree_root,
key.objectid, root->root_key.objectid,
parent_ino, &local_index, name, name_len);
} else if (add_backref) {
u64 local_index;
int err;
err = btrfs_del_inode_ref(trans, root, name, name_len,
ino, parent_ino, &local_index);
}
return ret;
} }
static int btrfs_add_nondir(struct btrfs_trans_handle *trans, static int btrfs_add_nondir(struct btrfs_trans_handle *trans,
@ -6696,8 +6724,10 @@ int btrfs_create_subvol_root(struct btrfs_trans_handle *trans,
int err; int err;
u64 index = 0; u64 index = 0;
inode = btrfs_new_inode(trans, new_root, NULL, "..", 2, new_dirid, inode = btrfs_new_inode(trans, new_root, NULL, "..", 2,
new_dirid, S_IFDIR | 0700, &index); new_dirid, new_dirid,
S_IFDIR | (~current_umask() & S_IRWXUGO),
&index);
if (IS_ERR(inode)) if (IS_ERR(inode))
return PTR_ERR(inode); return PTR_ERR(inode);
inode->i_op = &btrfs_dir_inode_operations; inode->i_op = &btrfs_dir_inode_operations;

Some files were not shown because too many files have changed in this diff Show More