diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/md/raid5.c | 28 | ||||
-rw-r--r-- | drivers/net/r8169.c | 11 |
2 files changed, 19 insertions, 20 deletions
diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c index 5d400aef8d9b..bb37fb1b2d82 100644 --- a/drivers/md/raid5.c +++ b/drivers/md/raid5.c | |||
@@ -362,7 +362,7 @@ static void raid5_unplug_device(struct request_queue *q); | |||
362 | 362 | ||
363 | static struct stripe_head * | 363 | static struct stripe_head * |
364 | get_active_stripe(raid5_conf_t *conf, sector_t sector, | 364 | get_active_stripe(raid5_conf_t *conf, sector_t sector, |
365 | int previous, int noblock) | 365 | int previous, int noblock, int noquiesce) |
366 | { | 366 | { |
367 | struct stripe_head *sh; | 367 | struct stripe_head *sh; |
368 | 368 | ||
@@ -372,7 +372,7 @@ get_active_stripe(raid5_conf_t *conf, sector_t sector, | |||
372 | 372 | ||
373 | do { | 373 | do { |
374 | wait_event_lock_irq(conf->wait_for_stripe, | 374 | wait_event_lock_irq(conf->wait_for_stripe, |
375 | conf->quiesce == 0, | 375 | conf->quiesce == 0 || noquiesce, |
376 | conf->device_lock, /* nothing */); | 376 | conf->device_lock, /* nothing */); |
377 | sh = __find_stripe(conf, sector, conf->generation - previous); | 377 | sh = __find_stripe(conf, sector, conf->generation - previous); |
378 | if (!sh) { | 378 | if (!sh) { |
@@ -2671,7 +2671,7 @@ static void handle_stripe_expansion(raid5_conf_t *conf, struct stripe_head *sh, | |||
2671 | sector_t bn = compute_blocknr(sh, i, 1); | 2671 | sector_t bn = compute_blocknr(sh, i, 1); |
2672 | sector_t s = raid5_compute_sector(conf, bn, 0, | 2672 | sector_t s = raid5_compute_sector(conf, bn, 0, |
2673 | &dd_idx, NULL); | 2673 | &dd_idx, NULL); |
2674 | sh2 = get_active_stripe(conf, s, 0, 1); | 2674 | sh2 = get_active_stripe(conf, s, 0, 1, 1); |
2675 | if (sh2 == NULL) | 2675 | if (sh2 == NULL) |
2676 | /* so far only the early blocks of this stripe | 2676 | /* so far only the early blocks of this stripe |
2677 | * have been requested. When later blocks | 2677 | * have been requested. When later blocks |
@@ -2944,7 +2944,7 @@ static bool handle_stripe5(struct stripe_head *sh) | |||
2944 | /* Finish reconstruct operations initiated by the expansion process */ | 2944 | /* Finish reconstruct operations initiated by the expansion process */ |
2945 | if (sh->reconstruct_state == reconstruct_state_result) { | 2945 | if (sh->reconstruct_state == reconstruct_state_result) { |
2946 | struct stripe_head *sh2 | 2946 | struct stripe_head *sh2 |
2947 | = get_active_stripe(conf, sh->sector, 1, 1); | 2947 | = get_active_stripe(conf, sh->sector, 1, 1, 1); |
2948 | if (sh2 && test_bit(STRIPE_EXPAND_SOURCE, &sh2->state)) { | 2948 | if (sh2 && test_bit(STRIPE_EXPAND_SOURCE, &sh2->state)) { |
2949 | /* sh cannot be written until sh2 has been read. | 2949 | /* sh cannot be written until sh2 has been read. |
2950 | * so arrange for sh to be delayed a little | 2950 | * so arrange for sh to be delayed a little |
@@ -3189,7 +3189,7 @@ static bool handle_stripe6(struct stripe_head *sh, struct page *tmp_page) | |||
3189 | 3189 | ||
3190 | if (s.expanded && test_bit(STRIPE_EXPANDING, &sh->state)) { | 3190 | if (s.expanded && test_bit(STRIPE_EXPANDING, &sh->state)) { |
3191 | struct stripe_head *sh2 | 3191 | struct stripe_head *sh2 |
3192 | = get_active_stripe(conf, sh->sector, 1, 1); | 3192 | = get_active_stripe(conf, sh->sector, 1, 1, 1); |
3193 | if (sh2 && test_bit(STRIPE_EXPAND_SOURCE, &sh2->state)) { | 3193 | if (sh2 && test_bit(STRIPE_EXPAND_SOURCE, &sh2->state)) { |
3194 | /* sh cannot be written until sh2 has been read. | 3194 | /* sh cannot be written until sh2 has been read. |
3195 | * so arrange for sh to be delayed a little | 3195 | * so arrange for sh to be delayed a little |
@@ -3288,7 +3288,7 @@ static void unplug_slaves(mddev_t *mddev) | |||
3288 | int i; | 3288 | int i; |
3289 | 3289 | ||
3290 | rcu_read_lock(); | 3290 | rcu_read_lock(); |
3291 | for (i=0; i<mddev->raid_disks; i++) { | 3291 | for (i = 0; i < conf->raid_disks; i++) { |
3292 | mdk_rdev_t *rdev = rcu_dereference(conf->disks[i].rdev); | 3292 | mdk_rdev_t *rdev = rcu_dereference(conf->disks[i].rdev); |
3293 | if (rdev && !test_bit(Faulty, &rdev->flags) && atomic_read(&rdev->nr_pending)) { | 3293 | if (rdev && !test_bit(Faulty, &rdev->flags) && atomic_read(&rdev->nr_pending)) { |
3294 | struct request_queue *r_queue = bdev_get_queue(rdev->bdev); | 3294 | struct request_queue *r_queue = bdev_get_queue(rdev->bdev); |
@@ -3675,7 +3675,7 @@ static int make_request(struct request_queue *q, struct bio * bi) | |||
3675 | (unsigned long long)logical_sector); | 3675 | (unsigned long long)logical_sector); |
3676 | 3676 | ||
3677 | sh = get_active_stripe(conf, new_sector, previous, | 3677 | sh = get_active_stripe(conf, new_sector, previous, |
3678 | (bi->bi_rw&RWA_MASK)); | 3678 | (bi->bi_rw&RWA_MASK), 0); |
3679 | if (sh) { | 3679 | if (sh) { |
3680 | if (unlikely(previous)) { | 3680 | if (unlikely(previous)) { |
3681 | /* expansion might have moved on while waiting for a | 3681 | /* expansion might have moved on while waiting for a |
@@ -3873,7 +3873,7 @@ static sector_t reshape_request(mddev_t *mddev, sector_t sector_nr, int *skipped | |||
3873 | for (i = 0; i < reshape_sectors; i += STRIPE_SECTORS) { | 3873 | for (i = 0; i < reshape_sectors; i += STRIPE_SECTORS) { |
3874 | int j; | 3874 | int j; |
3875 | int skipped = 0; | 3875 | int skipped = 0; |
3876 | sh = get_active_stripe(conf, stripe_addr+i, 0, 0); | 3876 | sh = get_active_stripe(conf, stripe_addr+i, 0, 0, 1); |
3877 | set_bit(STRIPE_EXPANDING, &sh->state); | 3877 | set_bit(STRIPE_EXPANDING, &sh->state); |
3878 | atomic_inc(&conf->reshape_stripes); | 3878 | atomic_inc(&conf->reshape_stripes); |
3879 | /* If any of this stripe is beyond the end of the old | 3879 | /* If any of this stripe is beyond the end of the old |
@@ -3916,13 +3916,13 @@ static sector_t reshape_request(mddev_t *mddev, sector_t sector_nr, int *skipped | |||
3916 | raid5_compute_sector(conf, stripe_addr*(new_data_disks), | 3916 | raid5_compute_sector(conf, stripe_addr*(new_data_disks), |
3917 | 1, &dd_idx, NULL); | 3917 | 1, &dd_idx, NULL); |
3918 | last_sector = | 3918 | last_sector = |
3919 | raid5_compute_sector(conf, ((stripe_addr+conf->chunk_size/512) | 3919 | raid5_compute_sector(conf, ((stripe_addr+reshape_sectors) |
3920 | *(new_data_disks) - 1), | 3920 | *(new_data_disks) - 1), |
3921 | 1, &dd_idx, NULL); | 3921 | 1, &dd_idx, NULL); |
3922 | if (last_sector >= mddev->dev_sectors) | 3922 | if (last_sector >= mddev->dev_sectors) |
3923 | last_sector = mddev->dev_sectors - 1; | 3923 | last_sector = mddev->dev_sectors - 1; |
3924 | while (first_sector <= last_sector) { | 3924 | while (first_sector <= last_sector) { |
3925 | sh = get_active_stripe(conf, first_sector, 1, 0); | 3925 | sh = get_active_stripe(conf, first_sector, 1, 0, 1); |
3926 | set_bit(STRIPE_EXPAND_SOURCE, &sh->state); | 3926 | set_bit(STRIPE_EXPAND_SOURCE, &sh->state); |
3927 | set_bit(STRIPE_HANDLE, &sh->state); | 3927 | set_bit(STRIPE_HANDLE, &sh->state); |
3928 | release_stripe(sh); | 3928 | release_stripe(sh); |
@@ -4022,9 +4022,9 @@ static inline sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *ski | |||
4022 | 4022 | ||
4023 | bitmap_cond_end_sync(mddev->bitmap, sector_nr); | 4023 | bitmap_cond_end_sync(mddev->bitmap, sector_nr); |
4024 | 4024 | ||
4025 | sh = get_active_stripe(conf, sector_nr, 0, 1); | 4025 | sh = get_active_stripe(conf, sector_nr, 0, 1, 0); |
4026 | if (sh == NULL) { | 4026 | if (sh == NULL) { |
4027 | sh = get_active_stripe(conf, sector_nr, 0, 0); | 4027 | sh = get_active_stripe(conf, sector_nr, 0, 0, 0); |
4028 | /* make sure we don't swamp the stripe cache if someone else | 4028 | /* make sure we don't swamp the stripe cache if someone else |
4029 | * is trying to get access | 4029 | * is trying to get access |
4030 | */ | 4030 | */ |
@@ -4034,7 +4034,7 @@ static inline sector_t sync_request(mddev_t *mddev, sector_t sector_nr, int *ski | |||
4034 | * We don't need to check the 'failed' flag as when that gets set, | 4034 | * We don't need to check the 'failed' flag as when that gets set, |
4035 | * recovery aborts. | 4035 | * recovery aborts. |
4036 | */ | 4036 | */ |
4037 | for (i=0; i<mddev->raid_disks; i++) | 4037 | for (i = 0; i < conf->raid_disks; i++) |
4038 | if (conf->disks[i].rdev == NULL) | 4038 | if (conf->disks[i].rdev == NULL) |
4039 | still_degraded = 1; | 4039 | still_degraded = 1; |
4040 | 4040 | ||
@@ -4086,7 +4086,7 @@ static int retry_aligned_read(raid5_conf_t *conf, struct bio *raid_bio) | |||
4086 | /* already done this stripe */ | 4086 | /* already done this stripe */ |
4087 | continue; | 4087 | continue; |
4088 | 4088 | ||
4089 | sh = get_active_stripe(conf, sector, 0, 1); | 4089 | sh = get_active_stripe(conf, sector, 0, 1, 0); |
4090 | 4090 | ||
4091 | if (!sh) { | 4091 | if (!sh) { |
4092 | /* failed to get a stripe - must wait */ | 4092 | /* failed to get a stripe - must wait */ |
diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c index 8247a945a1d9..3b19e0ce290f 100644 --- a/drivers/net/r8169.c +++ b/drivers/net/r8169.c | |||
@@ -66,7 +66,6 @@ static const int multicast_filter_limit = 32; | |||
66 | #define RX_DMA_BURST 6 /* Maximum PCI burst, '6' is 1024 */ | 66 | #define RX_DMA_BURST 6 /* Maximum PCI burst, '6' is 1024 */ |
67 | #define TX_DMA_BURST 6 /* Maximum PCI burst, '6' is 1024 */ | 67 | #define TX_DMA_BURST 6 /* Maximum PCI burst, '6' is 1024 */ |
68 | #define EarlyTxThld 0x3F /* 0x3F means NO early transmit */ | 68 | #define EarlyTxThld 0x3F /* 0x3F means NO early transmit */ |
69 | #define RxPacketMaxSize 0x3FE8 /* 16K - 1 - ETH_HLEN - VLAN - CRC... */ | ||
70 | #define SafeMtu 0x1c20 /* ... actually life sucks beyond ~7k */ | 69 | #define SafeMtu 0x1c20 /* ... actually life sucks beyond ~7k */ |
71 | #define InterFrameGap 0x03 /* 3 means InterFrameGap = the shortest one */ | 70 | #define InterFrameGap 0x03 /* 3 means InterFrameGap = the shortest one */ |
72 | 71 | ||
@@ -2357,10 +2356,10 @@ static u16 rtl_rw_cpluscmd(void __iomem *ioaddr) | |||
2357 | return cmd; | 2356 | return cmd; |
2358 | } | 2357 | } |
2359 | 2358 | ||
2360 | static void rtl_set_rx_max_size(void __iomem *ioaddr) | 2359 | static void rtl_set_rx_max_size(void __iomem *ioaddr, unsigned int rx_buf_sz) |
2361 | { | 2360 | { |
2362 | /* Low hurts. Let's disable the filtering. */ | 2361 | /* Low hurts. Let's disable the filtering. */ |
2363 | RTL_W16(RxMaxSize, 16383); | 2362 | RTL_W16(RxMaxSize, rx_buf_sz); |
2364 | } | 2363 | } |
2365 | 2364 | ||
2366 | static void rtl8169_set_magic_reg(void __iomem *ioaddr, unsigned mac_version) | 2365 | static void rtl8169_set_magic_reg(void __iomem *ioaddr, unsigned mac_version) |
@@ -2407,7 +2406,7 @@ static void rtl_hw_start_8169(struct net_device *dev) | |||
2407 | 2406 | ||
2408 | RTL_W8(EarlyTxThres, EarlyTxThld); | 2407 | RTL_W8(EarlyTxThres, EarlyTxThld); |
2409 | 2408 | ||
2410 | rtl_set_rx_max_size(ioaddr); | 2409 | rtl_set_rx_max_size(ioaddr, tp->rx_buf_sz); |
2411 | 2410 | ||
2412 | if ((tp->mac_version == RTL_GIGA_MAC_VER_01) || | 2411 | if ((tp->mac_version == RTL_GIGA_MAC_VER_01) || |
2413 | (tp->mac_version == RTL_GIGA_MAC_VER_02) || | 2412 | (tp->mac_version == RTL_GIGA_MAC_VER_02) || |
@@ -2668,7 +2667,7 @@ static void rtl_hw_start_8168(struct net_device *dev) | |||
2668 | 2667 | ||
2669 | RTL_W8(EarlyTxThres, EarlyTxThld); | 2668 | RTL_W8(EarlyTxThres, EarlyTxThld); |
2670 | 2669 | ||
2671 | rtl_set_rx_max_size(ioaddr); | 2670 | rtl_set_rx_max_size(ioaddr, tp->rx_buf_sz); |
2672 | 2671 | ||
2673 | tp->cp_cmd |= RTL_R16(CPlusCmd) | PktCntrDisable | INTT_1; | 2672 | tp->cp_cmd |= RTL_R16(CPlusCmd) | PktCntrDisable | INTT_1; |
2674 | 2673 | ||
@@ -2846,7 +2845,7 @@ static void rtl_hw_start_8101(struct net_device *dev) | |||
2846 | 2845 | ||
2847 | RTL_W8(EarlyTxThres, EarlyTxThld); | 2846 | RTL_W8(EarlyTxThres, EarlyTxThld); |
2848 | 2847 | ||
2849 | rtl_set_rx_max_size(ioaddr); | 2848 | rtl_set_rx_max_size(ioaddr, tp->rx_buf_sz); |
2850 | 2849 | ||
2851 | tp->cp_cmd |= rtl_rw_cpluscmd(ioaddr) | PCIMulRW; | 2850 | tp->cp_cmd |= rtl_rw_cpluscmd(ioaddr) | PCIMulRW; |
2852 | 2851 | ||