missed bio_endio() in axonram
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d81fec0f97cce4aea36a89340af247523c1263a0 Commit: d81fec0f97cce4aea36a89340af247523c1263a0 Parent: e86908614f2c7fec401827e5cefd7a6ea9407f85 Author: Al Viro [EMAIL PROTECTED] AuthorDate: Fri Oct 12 07:00:19 2007 +0100 Committer: Linus Torvalds [EMAIL PROTECTED] CommitDate: Thu Oct 11 23:04:25 2007 -0700 missed bio_endio() in axonram Signed-off-by: Al Viro [EMAIL PROTECTED] Signed-off-by: Linus Torvalds [EMAIL PROTECTED] --- arch/powerpc/sysdev/axonram.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/sysdev/axonram.c b/arch/powerpc/sysdev/axonram.c index 4d3ba63..5eaf3e3 100644 --- a/arch/powerpc/sysdev/axonram.c +++ b/arch/powerpc/sysdev/axonram.c @@ -117,7 +117,7 @@ axon_ram_make_request(struct request_queue *queue, struct bio *bio) transfered = 0; bio_for_each_segment(vec, bio, idx) { if (unlikely(phys_mem + vec-bv_len phys_end)) { - bio_io_error(bio, bio-bi_size); + bio_io_error(bio); rc = -ERANGE; break; } @@ -131,7 +131,7 @@ axon_ram_make_request(struct request_queue *queue, struct bio *bio) phys_mem += vec-bv_len; transfered += vec-bv_len; } - bio_endio(bio, transfered, 0); + bio_endio(bio, 0); return rc; } - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[SKY2]: ethtool register reserved area blackout
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=295b54c4902c52cd00d7c837d50a86e39e26caec Commit: 295b54c4902c52cd00d7c837d50a86e39e26caec Parent: e86908614f2c7fec401827e5cefd7a6ea9407f85 Author: Stephen Hemminger [EMAIL PROTECTED] AuthorDate: Thu Oct 11 19:47:22 2007 -0700 Committer: David S. Miller [EMAIL PROTECTED] CommitDate: Thu Oct 11 22:17:17 2007 -0700 [SKY2]: ethtool register reserved area blackout Make sure and not dump reserved areas of device space. Touching some of these causes machine check exceptions on boards like D-Link DGE-550SX. Coding note, used a complex switch statement rather than bitmap because it is easier to relate the block values to the documentation rather than looking at a encoded bitmask. Signed-off-by: Stephen Hemminger [EMAIL PROTECTED] Signed-off-by: David S. Miller [EMAIL PROTECTED] --- drivers/net/sky2.c | 62 --- 1 files changed, 53 insertions(+), 9 deletions(-) diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index 0a32034..4832f64 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c @@ -3569,20 +3569,64 @@ static void sky2_get_regs(struct net_device *dev, struct ethtool_regs *regs, { const struct sky2_port *sky2 = netdev_priv(dev); const void __iomem *io = sky2-hw-regs; + unsigned int b; regs-version = 1; - memset(p, 0, regs-len); - memcpy_fromio(p, io, B3_RAM_ADDR); - - /* skip diagnostic ram region */ - memcpy_fromio(p + B3_RI_WTO_R1, io + B3_RI_WTO_R1, 0x2000 - B3_RI_WTO_R1); + for (b = 0; b 128; b++) { + /* This complicated switch statement is to make sure and +* only access regions that are unreserved. +* Some blocks are only valid on dual port cards. +* and block 3 has some special diagnostic registers that +* are poison. +*/ + switch (b) { + case 3: + /* skip diagnostic ram region */ + memcpy_fromio(p + 0x10, io + 0x10, 128 - 0x10); + break; - /* copy GMAC registers */ - memcpy_fromio(p + BASE_GMAC_1, io + BASE_GMAC_1, 0x1000); - if (sky2-hw-ports 1) - memcpy_fromio(p + BASE_GMAC_2, io + BASE_GMAC_2, 0x1000); + /* dual port cards only */ + case 5: /* Tx Arbiter 2 */ + case 9: /* RX2 */ + case 14 ... 15: /* TX2 */ + case 17: case 19: /* Ram Buffer 2 */ + case 22 ... 23: /* Tx Ram Buffer 2 */ + case 25:/* Rx MAC Fifo 1 */ + case 27:/* Tx MAC Fifo 2 */ + case 31:/* GPHY 2 */ + case 40 ... 47: /* Pattern Ram 2 */ + case 52: case 54: /* TCP Segmentation 2 */ + case 112 ... 116: /* GMAC 2 */ + if (sky2-hw-ports == 1) + goto reserved; + /* fall through */ + case 0: /* Control */ + case 2: /* Mac address */ + case 4: /* Tx Arbiter 1 */ + case 7: /* PCI express reg */ + case 8: /* RX1 */ + case 12 ... 13: /* TX1 */ + case 16: case 18:/* Rx Ram Buffer 1 */ + case 20 ... 21: /* Tx Ram Buffer 1 */ + case 24:/* Rx MAC Fifo 1 */ + case 26:/* Tx MAC Fifo 1 */ + case 28 ... 29: /* Descriptor and status unit */ + case 30:/* GPHY 1*/ + case 32 ... 39: /* Pattern Ram 1 */ + case 48: case 50: /* TCP Segmentation 1 */ + case 56 ... 60: /* PCI space */ + case 80 ... 84: /* GMAC 1 */ + memcpy_fromio(p, io, 128); + break; + default: +reserved: + memset(p, 0, 128); + } + p += 128; + io += 128; + } } /* In order to do Jumbo packets on these chips, need to turn off the - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[SKY2]: fix power settings on Yukon XL
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ff35164e72648e0bf0b10ec4410c195e8607e88b Commit: ff35164e72648e0bf0b10ec4410c195e8607e88b Parent: 295b54c4902c52cd00d7c837d50a86e39e26caec Author: Stephen Hemminger [EMAIL PROTECTED] AuthorDate: Thu Oct 11 19:47:44 2007 -0700 Committer: David S. Miller [EMAIL PROTECTED] CommitDate: Thu Oct 11 22:17:18 2007 -0700 [SKY2]: fix power settings on Yukon XL Make sure PCI register for PHY power gets set correctly. Signed-off-by: Stephen Hemminger [EMAIL PROTECTED] Signed-off-by: David S. Miller [EMAIL PROTECTED] --- drivers/net/sky2.c | 13 ++--- 1 files changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index 4832f64..c9ee8a2 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c @@ -606,20 +606,19 @@ static void sky2_phy_power(struct sky2_hw *hw, unsigned port, int onoff) { struct pci_dev *pdev = hw-pdev; u32 reg1; - static const u32 phy_power[] - = { PCI_Y2_PHY1_POWD, PCI_Y2_PHY2_POWD }; - - /* looks like this XL is back asswards .. */ - if (hw-chip_id == CHIP_ID_YUKON_XL hw-chip_rev 1) - onoff = !onoff; + static const u32 phy_power[] = { PCI_Y2_PHY1_POWD, PCI_Y2_PHY2_POWD }; + static const u32 coma_mode[] = { PCI_Y2_PHY1_COMA, PCI_Y2_PHY2_COMA }; pci_read_config_dword(pdev, PCI_DEV_REG1, reg1); + /* Turn on/off phy power saving */ if (onoff) - /* Turn off phy power saving */ reg1 = ~phy_power[port]; else reg1 |= phy_power[port]; + if (onoff hw-chip_id == CHIP_ID_YUKON_XL hw-chip_rev 1) + reg1 |= coma_mode[port]; + pci_write_config_dword(pdev, PCI_DEV_REG1, reg1); pci_read_config_dword(pdev, PCI_DEV_REG1, reg1); - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[SKY2]: fiber advertise bits initialization (trivial)
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=df3fe1f318b226453b8dc48622c2b6eb78d75dbb Commit: df3fe1f318b226453b8dc48622c2b6eb78d75dbb Parent: ff35164e72648e0bf0b10ec4410c195e8607e88b Author: Stephen Hemminger [EMAIL PROTECTED] AuthorDate: Thu Oct 11 19:48:04 2007 -0700 Committer: David S. Miller [EMAIL PROTECTED] CommitDate: Thu Oct 11 22:17:18 2007 -0700 [SKY2]: fiber advertise bits initialization (trivial) Put initialization in sequential order (same as other constants). Signed-off-by: Stephen Hemminger [EMAIL PROTECTED] Signed-off-by: David S. Miller [EMAIL PROTECTED] --- drivers/net/sky2.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index c9ee8a2..55cda58 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c @@ -296,10 +296,10 @@ static const u16 copper_fc_adv[] = { /* flow control to advertise bits when using 1000BaseX */ static const u16 fiber_fc_adv[] = { - [FC_BOTH] = PHY_M_P_BOTH_MD_X, + [FC_NONE] = PHY_M_P_NO_PAUSE_X, [FC_TX] = PHY_M_P_ASYM_MD_X, [FC_RX] = PHY_M_P_SYM_MD_X, - [FC_NONE] = PHY_M_P_NO_PAUSE_X, + [FC_BOTH] = PHY_M_P_BOTH_MD_X, }; /* flow control to GMA disable bits */ - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[SKY2]: use netdevice stats struct
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7138a0f591b0aac3b9117e68db46903606a97b0c Commit: 7138a0f591b0aac3b9117e68db46903606a97b0c Parent: df3fe1f318b226453b8dc48622c2b6eb78d75dbb Author: Stephen Hemminger [EMAIL PROTECTED] AuthorDate: Thu Oct 11 19:48:22 2007 -0700 Committer: David S. Miller [EMAIL PROTECTED] CommitDate: Thu Oct 11 22:17:19 2007 -0700 [SKY2]: use netdevice stats struct Use builtin statistics structure from net device. Signed-off-by: Stephen Hemminger [EMAIL PROTECTED] Signed-off-by: David S. Miller [EMAIL PROTECTED] --- drivers/net/sky2.c | 33 + drivers/net/sky2.h |2 -- 2 files changed, 13 insertions(+), 22 deletions(-) diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index 55cda58..93655ef 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c @@ -1635,8 +1635,8 @@ static void sky2_tx_complete(struct sky2_port *sky2, u16 done) printk(KERN_DEBUG %s: tx done %u\n, dev-name, idx); - sky2-net_stats.tx_packets++; - sky2-net_stats.tx_bytes += re-skb-len; + dev-stats.tx_packets++; + dev-stats.tx_bytes += re-skb-len; dev_kfree_skb_any(re-skb); sky2-tx_next = RING_NEXT(idx, TX_RING_SIZE); @@ -2204,16 +2204,16 @@ resubmit: len_error: /* Truncation of overlength packets causes PHY length to not match MAC length */ - ++sky2-net_stats.rx_length_errors; + ++dev-stats.rx_length_errors; if (netif_msg_rx_err(sky2) net_ratelimit()) pr_info(PFX %s: rx length error: status %#x length %d\n, dev-name, status, length); goto resubmit; error: - ++sky2-net_stats.rx_errors; + ++dev-stats.rx_errors; if (status GMR_FS_RX_FF_OV) { - sky2-net_stats.rx_over_errors++; + dev-stats.rx_over_errors++; goto resubmit; } @@ -,11 +,11 @@ error: dev-name, status, length); if (status (GMR_FS_LONG_ERR | GMR_FS_UN_SIZE)) - sky2-net_stats.rx_length_errors++; + dev-stats.rx_length_errors++; if (status GMR_FS_FRAGMENT) - sky2-net_stats.rx_frame_errors++; + dev-stats.rx_frame_errors++; if (status GMR_FS_CRC_ERR) - sky2-net_stats.rx_crc_errors++; + dev-stats.rx_crc_errors++; goto resubmit; } @@ -2271,7 +2271,7 @@ static int sky2_status_intr(struct sky2_hw *hw, int to_do, u16 idx) ++rx[port]; skb = sky2_receive(dev, length, status); if (unlikely(!skb)) { - sky2-net_stats.rx_dropped++; + dev-stats.rx_dropped++; break; } @@ -2286,8 +2286,8 @@ static int sky2_status_intr(struct sky2_hw *hw, int to_do, u16 idx) } skb-protocol = eth_type_trans(skb, dev); - sky2-net_stats.rx_packets++; - sky2-net_stats.rx_bytes += skb-len; + dev-stats.rx_packets++; + dev-stats.rx_bytes += skb-len; dev-last_rx = jiffies; #ifdef SKY2_VLAN_TAG_USED @@ -2478,12 +2478,12 @@ static void sky2_mac_intr(struct sky2_hw *hw, unsigned port) gma_read16(hw, port, GM_TX_IRQ_SRC); if (status GM_IS_RX_FF_OR) { - ++sky2-net_stats.rx_fifo_errors; + ++dev-stats.rx_fifo_errors; sky2_write8(hw, SK_REG(port, RX_GMF_CTRL_T), GMF_CLI_RX_FO); } if (status GM_IS_TX_FF_UR) { - ++sky2-net_stats.tx_fifo_errors; + ++dev-stats.tx_fifo_errors; sky2_write8(hw, SK_REG(port, TX_GMF_CTRL_T), GMF_CLI_TX_FU); } } @@ -3222,12 +3222,6 @@ static void sky2_get_strings(struct net_device *dev, u32 stringset, u8 * data) } } -static struct net_device_stats *sky2_get_stats(struct net_device *dev) -{ - struct sky2_port *sky2 = netdev_priv(dev); - return sky2-net_stats; -} - static int sky2_set_mac_address(struct net_device *dev, void *p) { struct sky2_port *sky2 = netdev_priv(dev); @@ -3977,7 +3971,6 @@ static __devinit struct net_device *sky2_init_netdev(struct sky2_hw *hw, dev-stop = sky2_down; dev-do_ioctl = sky2_ioctl; dev-hard_start_xmit = sky2_xmit_frame; - dev-get_stats = sky2_get_stats; dev-set_multicast_list = sky2_set_multicast; dev-set_mac_address = sky2_set_mac_address; dev-change_mtu = sky2_change_mtu; diff --git a/drivers/net/sky2.h b/drivers/net/sky2.h
[SKY2]: version 1.19
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a7b850eaa1110b1fcdc09fdfe89e792828e9b7aa Commit: a7b850eaa1110b1fcdc09fdfe89e792828e9b7aa Parent: 7138a0f591b0aac3b9117e68db46903606a97b0c Author: Stephen Hemminger [EMAIL PROTECTED] AuthorDate: Thu Oct 11 19:48:40 2007 -0700 Committer: David S. Miller [EMAIL PROTECTED] CommitDate: Thu Oct 11 22:17:19 2007 -0700 [SKY2]: version 1.19 Update version to keep track of new changes. Signed-off-by: Stephen Hemminger [EMAIL PROTECTED] Signed-off-by: David S. Miller [EMAIL PROTECTED] --- drivers/net/sky2.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index 93655ef..68f728f 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c @@ -52,7 +52,7 @@ #include sky2.h #define DRV_NAME sky2 -#define DRV_VERSION1.18 +#define DRV_VERSION1.19 #define PFXDRV_NAME /* - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[TG3]: Fix APE induced regression
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9ce768ead83216d394175c0a0d72bc527648c7d0 Commit: 9ce768ead83216d394175c0a0d72bc527648c7d0 Parent: a7b850eaa1110b1fcdc09fdfe89e792828e9b7aa Author: Matt Carlson [EMAIL PROTECTED] AuthorDate: Thu Oct 11 19:49:11 2007 -0700 Committer: David S. Miller [EMAIL PROTECTED] CommitDate: Thu Oct 11 22:17:20 2007 -0700 [TG3]: Fix APE induced regression This patch fixes a bug caused by the recent APE support added for 5761 devices. Signed-off-by: Matt Carlson [EMAIL PROTECTED] Signed-off-by: David S. Miller [EMAIL PROTECTED] --- drivers/net/tg3.c |7 --- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c index a402b5c..e795c33 100644 --- a/drivers/net/tg3.c +++ b/drivers/net/tg3.c @@ -6985,9 +6985,10 @@ static int tg3_reset_hw(struct tg3 *tp, int reset_phy) break; }; - /* Write our heartbeat update interval to APE. */ - tg3_ape_write32(tp, TG3_APE_HOST_HEARTBEAT_INT_MS, - APE_HOST_HEARTBEAT_INT_DISABLE); + if (tp-tg3_flags3 TG3_FLG3_ENABLE_APE) + /* Write our heartbeat update interval to APE. */ + tg3_ape_write32(tp, TG3_APE_HOST_HEARTBEAT_INT_MS, + APE_HOST_HEARTBEAT_INT_DISABLE); tg3_write_sig_post_reset(tp, RESET_KIND_INIT); - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Fix up more bio fallout
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=782e3b3b3804c38d5130c7f21d7ec7bf6709023f Commit: 782e3b3b3804c38d5130c7f21d7ec7bf6709023f Parent: cbd09dbbb62096c1da627eca865f988d2ed0a84e Author: Al Viro [EMAIL PROTECTED] AuthorDate: Fri Oct 12 07:17:47 2007 +0100 Committer: Linus Torvalds [EMAIL PROTECTED] CommitDate: Fri Oct 12 00:29:50 2007 -0700 Fix up more bio fallout Signed-off-by: Al Viro [EMAIL PROTECTED] Signed-off-by: Linus Torvalds [EMAIL PROTECTED] --- fs/gfs2/super.c |1 - fs/jfs/jfs_metapage.c|3 --- fs/ocfs2/cluster/heartbeat.c |3 +-- fs/xfs/linux-2.6/xfs_aops.c |3 +-- fs/xfs/linux-2.6/xfs_buf.c |3 +-- 5 files changed, 3 insertions(+), 10 deletions(-) diff --git a/fs/gfs2/super.c b/fs/gfs2/super.c index 2473e2a..a2da76b 100644 --- a/fs/gfs2/super.c +++ b/fs/gfs2/super.c @@ -169,7 +169,6 @@ static void end_bio_io_page(struct bio *bio, int error) else printk(KERN_WARNING gfs2: error %d reading superblock\n, error); unlock_page(page); - return 0; } static void gfs2_sb_in(struct gfs2_sb_host *sb, const void *buf) diff --git a/fs/jfs/jfs_metapage.c b/fs/jfs/jfs_metapage.c index 1332adc..941369c 100644 --- a/fs/jfs/jfs_metapage.c +++ b/fs/jfs/jfs_metapage.c @@ -291,8 +291,6 @@ static void metapage_read_end_io(struct bio *bio, int err) dec_io(page, last_read_complete); bio_put(bio); - - return 0; } static void remove_from_logsync(struct metapage *mp) @@ -349,7 +347,6 @@ static void metapage_write_end_io(struct bio *bio, int err) } dec_io(page, last_write_complete); bio_put(bio); - return 0; } static int metapage_writepage(struct page *page, struct writeback_control *wbc) diff --git a/fs/ocfs2/cluster/heartbeat.c b/fs/ocfs2/cluster/heartbeat.c index da2c2b4..f14b541 100644 --- a/fs/ocfs2/cluster/heartbeat.c +++ b/fs/ocfs2/cluster/heartbeat.c @@ -216,7 +216,7 @@ static void o2hb_wait_on_io(struct o2hb_region *reg, wait_for_completion(wc-wc_io_complete); } -static int o2hb_bio_end_io(struct bio *bio, +static void o2hb_bio_end_io(struct bio *bio, int error) { struct o2hb_bio_wait_ctxt *wc = bio-bi_private; @@ -228,7 +228,6 @@ static int o2hb_bio_end_io(struct bio *bio, o2hb_bio_wait_dec(wc, 1); bio_put(bio); - return 0; } /* Setup a Bio to cover I/O against num_slots slots starting at diff --git a/fs/xfs/linux-2.6/xfs_aops.c b/fs/xfs/linux-2.6/xfs_aops.c index 3f13519..6f4c29e 100644 --- a/fs/xfs/linux-2.6/xfs_aops.c +++ b/fs/xfs/linux-2.6/xfs_aops.c @@ -323,7 +323,7 @@ xfs_iomap_valid( /* * BIO completion handler for buffered IO. */ -STATIC int +STATIC void xfs_end_bio( struct bio *bio, int error) @@ -339,7 +339,6 @@ xfs_end_bio( bio_put(bio); xfs_finish_ioend(ioend, 0); - return 0; } STATIC void diff --git a/fs/xfs/linux-2.6/xfs_buf.c b/fs/xfs/linux-2.6/xfs_buf.c index 6a75f4d..39f44ee 100644 --- a/fs/xfs/linux-2.6/xfs_buf.c +++ b/fs/xfs/linux-2.6/xfs_buf.c @@ -1103,7 +1103,7 @@ _xfs_buf_ioend( } } -STATIC int +STATIC void xfs_buf_bio_end_io( struct bio *bio, int error) @@ -1139,7 +1139,6 @@ xfs_buf_bio_end_io( _xfs_buf_ioend(bp, 1); bio_put(bio); - return 0; } STATIC void - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[S390] cio: remove subchannel_add_files()
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=fbf9772b8e7917f85f35913b30788c74ea34cad5 Commit: fbf9772b8e7917f85f35913b30788c74ea34cad5 Parent: 7c9f4e3aaae020fc674f52393cbac1bdb648bf90 Author: Cornelia Huck [EMAIL PROTECTED] AuthorDate: Fri Oct 12 16:11:14 2007 +0200 Committer: Martin Schwidefsky [EMAIL PROTECTED] CommitDate: Fri Oct 12 16:12:59 2007 +0200 [S390] cio: remove subchannel_add_files() subchannel_add_files() no longer exists, remove from header. Signed-off-by: Cornelia Huck [EMAIL PROTECTED] Signed-off-by: Martin Schwidefsky [EMAIL PROTECTED] Signed-off-by: Heiko Carstens [EMAIL PROTECTED] --- drivers/s390/cio/css.h |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/drivers/s390/cio/css.h b/drivers/s390/cio/css.h index f290c5c..81215ef 100644 --- a/drivers/s390/cio/css.h +++ b/drivers/s390/cio/css.h @@ -191,6 +191,5 @@ int sch_is_pseudo_sch(struct subchannel *); extern struct workqueue_struct *slow_path_wq; -int subchannel_add_files (struct device *); extern struct attribute_group *subch_attr_groups[]; #endif - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[S390] cio: Kerneldoc comments for cmf.
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c02087162af5d8880ff2d688999d71e1bfa16f2f Commit: c02087162af5d8880ff2d688999d71e1bfa16f2f Parent: fc5019c5c7067bcea1e49fe9cd5190285f0c8927 Author: Cornelia Huck [EMAIL PROTECTED] AuthorDate: Fri Oct 12 16:11:16 2007 +0200 Committer: Martin Schwidefsky [EMAIL PROTECTED] CommitDate: Fri Oct 12 16:12:59 2007 +0200 [S390] cio: Kerneldoc comments for cmf. - Fix existing kerneldoc-style comments. - Move descriptions of functions from cmb.h to cmf.c. Signed-off-by: Cornelia Huck [EMAIL PROTECTED] Signed-off-by: Martin Schwidefsky [EMAIL PROTECTED] Signed-off-by: Heiko Carstens [EMAIL PROTECTED] --- drivers/s390/cio/cmf.c | 87 --- include/asm-s390/cmb.h | 65 --- 2 files changed, 89 insertions(+), 63 deletions(-) diff --git a/drivers/s390/cio/cmf.c b/drivers/s390/cio/cmf.c index ff1e442..6ef0ab8 100644 --- a/drivers/s390/cio/cmf.c +++ b/drivers/s390/cio/cmf.c @@ -74,19 +74,20 @@ enum cmb_index { * enum cmb_format - types of supported measurement block formats * * @CMF_BASIC: traditional channel measurement blocks supported - * by all machines that we run on + * by all machines that we run on * @CMF_EXTENDED: improved format that was introduced with the z990 - * machine - * @CMF_AUTODETECT: default: use extended format when running on a z990 - * or later machine, otherwise fall back to basic format - **/ + * machine + * @CMF_AUTODETECT: default: use extended format when running on a machine + * supporting extended format, otherwise fall back to + * basic format + */ enum cmb_format { CMF_BASIC, CMF_EXTENDED, CMF_AUTODETECT = -1, }; -/** +/* * format - actual format for all measurement blocks * * The format module parameter can be set to a value of 0 (zero) @@ -107,6 +108,7 @@ module_param(format, bool, 0444); * either with the help of a special pool or with kmalloc * @free: free memory allocated with @alloc * @set: enable or disable measurement + * @read: read a measurement entry at an index * @readall: read a measurement block in a common format * @reset: clear the data in the associated measurement block and * reset its time stamp @@ -120,7 +122,7 @@ struct cmb_operations { int (*readall)(struct ccw_device *, struct cmbdata *); void (*reset) (struct ccw_device *); void *(*align) (void *); - +/* private: */ struct attribute_group *attr_group; }; static struct cmb_operations *cmbops; @@ -471,6 +473,7 @@ static void cmf_generic_reset(struct ccw_device *cdev) * * @mem: pointer to CMBs (only in basic measurement mode) * @list: contains a linked list of all subchannels + * @num_channels: number of channels to be measured * @lock: protect concurrent access to @mem and @list */ struct cmb_area { @@ -503,10 +506,20 @@ module_param_named(maxchannels, cmb_area.num_channels, uint, 0444); /** * struct cmb - basic channel measurement block + * @ssch_rsch_count: number of ssch and rsch + * @sample_count: number of samples + * @device_connect_time: time of device connect + * @function_pending_time: time of function pending + * @device_disconnect_time: time of device disconnect + * @control_unit_queuing_time: time of control unit queuing + * @device_active_only_time: time of device active only + * @reserved: unused in basic measurement mode + * + * The measurement block as used by the hardware. The fields are described + * further in z/Architecture Principles of Operation, chapter 17. * - * cmb as used by the hardware the fields are described in z/Architecture - * Principles of Operation, chapter 17. - * The area to be a contiguous array and may not be reallocated or freed. + * The cmb area made up from these blocks must be a contiguous array and may + * not be reallocated or freed. * Only one cmb area can be present in the system. */ struct cmb { @@ -804,9 +817,20 @@ static struct cmb_operations cmbops_basic = { /** * struct cmbe - extended channel measurement block + * @ssch_rsch_count: number of ssch and rsch + * @sample_count: number of samples + * @device_connect_time: time of device connect + * @function_pending_time: time of function pending + * @device_disconnect_time: time of device disconnect + * @control_unit_queuing_time: time of control unit queuing + * @device_active_only_time: time of device active only + * @device_busy_time: time of device busy + * @initial_command_response_time: initial command response time + * @reserved: unused * - * cmb as used by the hardware, may be in any 64 bit physical location, - * the fields are described in z/Architecture Principles of Operation, + * The measurement
[S390] cio: Add docbook comments.
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b2ffd8e9a76ec90bd4a509f3d092e35978c568a3 Commit: b2ffd8e9a76ec90bd4a509f3d092e35978c568a3 Parent: c02087162af5d8880ff2d688999d71e1bfa16f2f Author: Cornelia Huck [EMAIL PROTECTED] AuthorDate: Fri Oct 12 16:11:17 2007 +0200 Committer: Martin Schwidefsky [EMAIL PROTECTED] CommitDate: Fri Oct 12 16:12:59 2007 +0200 [S390] cio: Add docbook comments. Comment a bunch of function in docbook style and convert existing comments on structures to docbook. Signed-off-by: Cornelia Huck [EMAIL PROTECTED] Signed-off-by: Martin Schwidefsky [EMAIL PROTECTED] Signed-off-by: Heiko Carstens [EMAIL PROTECTED] --- drivers/s390/cio/ccwgroup.c | 67 +++--- drivers/s390/cio/device.c | 64 -- drivers/s390/cio/device_ops.c | 241 ++- include/asm-s390/ccwdev.h | 75 +-- include/asm-s390/ccwgroup.h | 32 - include/asm-s390/cio.h| 288 - 6 files changed, 575 insertions(+), 192 deletions(-) diff --git a/drivers/s390/cio/ccwgroup.c b/drivers/s390/cio/ccwgroup.c index b0a18f5..9c3b9ea 100644 --- a/drivers/s390/cio/ccwgroup.c +++ b/drivers/s390/cio/ccwgroup.c @@ -152,16 +152,24 @@ __ccwgroup_create_symlinks(struct ccwgroup_device *gdev) return 0; } -/* - * try to add a new ccwgroup device for one driver - * argc and argv[] are a list of bus_id's of devices - * belonging to the driver. +/** + * ccwgroup_create() - create and register a ccw group device + * @root: parent device for the new device + * @creator_id: identifier of creating driver + * @cdrv: ccw driver of slave devices + * @argc: number of slave devices + * @argv: bus ids of slave devices + * + * Create and register a new ccw group device as a child of @root. Slave + * devices are obtained from the list of bus ids given in @argv[] and must all + * belong to @cdrv. + * Returns: + * %0 on success and an error code on failure. + * Context: + * non-atomic */ -int -ccwgroup_create(struct device *root, - unsigned int creator_id, - struct ccw_driver *cdrv, - int argc, char *argv[]) +int ccwgroup_create(struct device *root, unsigned int creator_id, + struct ccw_driver *cdrv, int argc, char *argv[]) { struct ccwgroup_device *gdev; int i; @@ -390,8 +398,13 @@ static struct bus_type ccwgroup_bus_type = { .remove = ccwgroup_remove, }; -int -ccwgroup_driver_register (struct ccwgroup_driver *cdriver) +/** + * ccwgroup_driver_register() - register a ccw group driver + * @cdriver: driver to be registered + * + * This function is mainly a wrapper around driver_register(). + */ +int ccwgroup_driver_register(struct ccwgroup_driver *cdriver) { /* register our new driver with the core */ cdriver-driver.bus = ccwgroup_bus_type; @@ -406,8 +419,13 @@ __ccwgroup_match_all(struct device *dev, void *data) return 1; } -void -ccwgroup_driver_unregister (struct ccwgroup_driver *cdriver) +/** + * ccwgroup_driver_unregister() - deregister a ccw group driver + * @cdriver: driver to be deregistered + * + * This function is mainly a wrapper around driver_unregister(). + */ +void ccwgroup_driver_unregister(struct ccwgroup_driver *cdriver) { struct device *dev; @@ -427,8 +445,16 @@ ccwgroup_driver_unregister (struct ccwgroup_driver *cdriver) driver_unregister(cdriver-driver); } -int -ccwgroup_probe_ccwdev(struct ccw_device *cdev) +/** + * ccwgroup_probe_ccwdev() - probe function for slave devices + * @cdev: ccw device to be probed + * + * This is a dummy probe function for ccw devices that are slave devices in + * a ccw group device. + * Returns: + * always %0 + */ +int ccwgroup_probe_ccwdev(struct ccw_device *cdev) { return 0; } @@ -452,8 +478,15 @@ __ccwgroup_get_gdev_by_cdev(struct ccw_device *cdev) return NULL; } -void -ccwgroup_remove_ccwdev(struct ccw_device *cdev) +/** + * ccwgroup_remove_ccwdev() - remove function for slave devices + * @cdev: ccw device to be removed + * + * This is a remove function for ccw devices that are slave devices in a ccw + * group device. It sets the ccw device offline and also deregisters the + * embedding ccw group device. + */ +void ccwgroup_remove_ccwdev(struct ccw_device *cdev) { struct ccwgroup_device *gdev; diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c index e44d92e..3943a4f 100644 --- a/drivers/s390/cio/device.c +++ b/drivers/s390/cio/device.c @@ -357,8 +357,18 @@ ccw_device_remove_disconnected(struct ccw_device *cdev) cdev-private-dev_id.devno); } -int -ccw_device_set_offline(struct ccw_device *cdev) +/** + * ccw_device_set_offline() - disable a ccw device for I/O + * @cdev: target ccw device + * + * This function calls the driver's set_offline() function for @cdev, if + *
[S390] cio: Add s390-drivers book.
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3a2fbff228f773e3628bc26a688d40b2214af025 Commit: 3a2fbff228f773e3628bc26a688d40b2214af025 Parent: b2ffd8e9a76ec90bd4a509f3d092e35978c568a3 Author: Cornelia Huck [EMAIL PROTECTED] AuthorDate: Fri Oct 12 16:11:18 2007 +0200 Committer: Martin Schwidefsky [EMAIL PROTECTED] CommitDate: Fri Oct 12 16:13:00 2007 +0200 [S390] cio: Add s390-drivers book. s390-drivers is generated using the docbook comments. It should eventually supersede Documentation/s390/cds.txt. Signed-off-by: Cornelia Huck [EMAIL PROTECTED] Signed-off-by: Martin Schwidefsky [EMAIL PROTECTED] Signed-off-by: Heiko Carstens [EMAIL PROTECTED] --- Documentation/DocBook/Makefile |2 +- Documentation/DocBook/s390-drivers.tmpl | 149 +++ 2 files changed, 150 insertions(+), 1 deletions(-) diff --git a/Documentation/DocBook/Makefile b/Documentation/DocBook/Makefile index 08687e4..1a7f530 100644 --- a/Documentation/DocBook/Makefile +++ b/Documentation/DocBook/Makefile @@ -11,7 +11,7 @@ DOCBOOKS := wanbook.xml z8530book.xml mcabook.xml videobook.xml \ procfs-guide.xml writing_usb_driver.xml \ kernel-api.xml filesystems.xml lsm.xml usb.xml \ gadget.xml libata.xml mtdnand.xml librs.xml rapidio.xml \ - genericirq.xml + genericirq.xml s390-drivers.xml ### # The build process is as follows (targets): diff --git a/Documentation/DocBook/s390-drivers.tmpl b/Documentation/DocBook/s390-drivers.tmpl new file mode 100644 index 000..254e769 --- /dev/null +++ b/Documentation/DocBook/s390-drivers.tmpl @@ -0,0 +1,149 @@ +?xml version=1.0 encoding=UTF-8? +!DOCTYPE book PUBLIC -//OASIS//DTD DocBook XML V4.1.2//EN + http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd; [] + +book id=s390drivers + bookinfo + titleWriting s390 channel device drivers/title + + authorgroup + author +firstnameCornelia/firstname +surnameHuck/surname +affiliation + address + email[EMAIL PROTECTED]/email + /address +/affiliation + /author + /authorgroup + + copyright + year2007/year + holderIBM Corp./holder + /copyright + + legalnotice + para + This documentation is free software; you can redistribute + it and/or modify it under the terms of the GNU General Public + License as published by the Free Software Foundation; either + version 2 of the License, or (at your option) any later + version. + /para + + para + This program is distributed in the hope that it will be + useful, but WITHOUT ANY WARRANTY; without even the implied + warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + See the GNU General Public License for more details. + /para + + para + You should have received a copy of the GNU General Public + License along with this program; if not, write to the Free + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, + MA 02111-1307 USA + /para + + para + For more details see the file COPYING in the source + distribution of Linux. + /para + /legalnotice + /bookinfo + +toc/toc + + chapter id=intro + titleIntroduction/title + para +This document describes the interfaces available for device drivers that +drive s390 based channel attached devices. This includes interfaces for +interaction with the hardware and interfaces for interacting with the +common driver core. Those interfaces are provided by the s390 common I/O +layer. + /para + para +The document assumes a familarity with the technical terms associated +with the s390 channel I/O architecture. For a description of this +architecture, please refer to the z/Architecture: Principles of +Operation, IBM publication no. SA22-7832. + /para + para +While most I/O devices on a s390 system are typically driven through the +channel I/O mechanism described here, there are various other methods +(like the diag interface). These are out of the scope of this document. + /para + para +Some additional information can also be found in the kernel source +under Documentation/s390/driver-model.txt. + /para + /chapter + chapter id=ccw + titleThe ccw bus/title + para + The ccw bus typically contains the majority of devices available to + a s390 system. Named after the channel command word (ccw), the basic + command structure used to address its devices, the ccw bus contains + so-called channel attached devices. They are addressed via subchannels, + visible on the css bus. A device driver, however, will never interact + with the subchannel directly, but only via the device on the ccw bus, + the ccw device. + /para +sect1 id=channelIO + titleI/O functions for channel-attached devices/title +para + Some hardware structures have been
[S390] cio: Minor style fixes.
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a0ea22c3d912de6044f83b07dcc26ee006106139 Commit: a0ea22c3d912de6044f83b07dcc26ee006106139 Parent: 3a2fbff228f773e3628bc26a688d40b2214af025 Author: Cornelia Huck [EMAIL PROTECTED] AuthorDate: Fri Oct 12 16:11:19 2007 +0200 Committer: Martin Schwidefsky [EMAIL PROTECTED] CommitDate: Fri Oct 12 16:13:00 2007 +0200 [S390] cio: Minor style fixes. Signed-off-by: Cornelia Huck [EMAIL PROTECTED] Signed-off-by: Martin Schwidefsky [EMAIL PROTECTED] --- drivers/s390/cio/chp.c |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/s390/cio/chp.c b/drivers/s390/cio/chp.c index 8ce4ff9..3d49919 100644 --- a/drivers/s390/cio/chp.c +++ b/drivers/s390/cio/chp.c @@ -14,7 +14,7 @@ #include linux/jiffies.h #include linux/wait.h #include linux/mutex.h -#include asm/errno.h +#include linux/errno.h #include asm/chpid.h #include asm/sclp.h @@ -86,7 +86,7 @@ u8 chp_get_sch_opm(struct subchannel *sch) opm = 0; chp_id_init(chpid); - for (i=0; i 8; i++) { + for (i = 0; i 8; i++) { opm = 1; chpid.id = sch-schib.pmcw.chpid[i]; if (chp_get_status(chpid) != 0) @@ -118,7 +118,7 @@ static int s390_vary_chpid(struct chp_id chpid, int on) sprintf(dbf_text, on?varyon%x.%02x:varyoff%x.%02x, chpid.cssid, chpid.id); - CIO_TRACE_EVENT( 2, dbf_text); + CIO_TRACE_EVENT(2, dbf_text); status = chp_get_status(chpid); if (!on !status) { @@ -353,7 +353,7 @@ static ssize_t chp_shared_show(struct device *dev, static DEVICE_ATTR(shared, 0444, chp_shared_show, NULL); -static struct attribute * chp_attrs[] = { +static struct attribute *chp_attrs[] = { dev_attr_status.attr, dev_attr_configure.attr, dev_attr_type.attr, - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[S390] cio: Disable channel path measurements on shutdown/reboot.
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=a55360df406cca797ac07d722688dd7ec29bf46e Commit: a55360df406cca797ac07d722688dd7ec29bf46e Parent: a0ea22c3d912de6044f83b07dcc26ee006106139 Author: Cornelia Huck [EMAIL PROTECTED] AuthorDate: Fri Oct 12 16:11:20 2007 +0200 Committer: Martin Schwidefsky [EMAIL PROTECTED] CommitDate: Fri Oct 12 16:13:00 2007 +0200 [S390] cio: Disable channel path measurements on shutdown/reboot. Make sure channel path measurements are disabled via a reboot notifier since we cannot rely on userspace to disable it again after enabling it. This is 1. clean and 2. makes sure that channel path measurements do not stay enabled after a reboot not involving a subsystem reset (which would lead to the channel subsystem scribbling onto random memory). Signed-off-by: Cornelia Huck [EMAIL PROTECTED] Signed-off-by: Martin Schwidefsky [EMAIL PROTECTED] --- drivers/s390/cio/css.c | 29 + 1 files changed, 29 insertions(+), 0 deletions(-) diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c index 08f6e7b..5d83dd4 100644 --- a/drivers/s390/cio/css.c +++ b/drivers/s390/cio/css.c @@ -13,6 +13,7 @@ #include linux/slab.h #include linux/errno.h #include linux/list.h +#include linux/reboot.h #include css.h #include cio.h @@ -632,6 +633,29 @@ static int __init setup_css(int nr) return 0; } +static int css_reboot_event(struct notifier_block *this, + unsigned long event, + void *ptr) +{ + int ret, i; + + ret = NOTIFY_DONE; + for (i = 0; i = __MAX_CSSID; i++) { + struct channel_subsystem *css; + + css = channel_subsystems[i]; + if (css-cm_enabled) + if (chsc_secm(css, 0)) + ret = NOTIFY_BAD; + } + + return ret; +} + +static struct notifier_block css_reboot_notifier = { + .notifier_call = css_reboot_event, +}; + /* * Now that the driver core is running, we can setup our channel subsystem. * The struct subchannel's are created during probing (except for the @@ -697,12 +721,17 @@ init_channel_subsystem (void) if (ret) goto out_file; } + ret = register_reboot_notifier(css_reboot_notifier); + if (ret) + goto out_pseudo; css_init_done = 1; ctl_set_bit(6, 28); for_each_subchannel(__init_channel_subsystem, NULL); return 0; +out_pseudo: + device_unregister(channel_subsystems[i]-pseudo_subchannel-dev); out_file: device_remove_file(channel_subsystems[i]-device, dev_attr_cm_enable); - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[S390] cio: Introduce ccw_bus_type.shutdown.
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=958974fb596ad037fb571cf2899f783764a83e1a Commit: 958974fb596ad037fb571cf2899f783764a83e1a Parent: a55360df406cca797ac07d722688dd7ec29bf46e Author: Cornelia Huck [EMAIL PROTECTED] AuthorDate: Fri Oct 12 16:11:21 2007 +0200 Committer: Martin Schwidefsky [EMAIL PROTECTED] CommitDate: Fri Oct 12 16:13:01 2007 +0200 [S390] cio: Introduce ccw_bus_type.shutdown. Introduce a shutdown method for the ccw bus that calls the driver specific shutdown method in struct ccw_driver. Switch zfcp to the new ccw_driver shutdown method. Signed-off-by: Cornelia Huck [EMAIL PROTECTED] Signed-off-by: Martin Schwidefsky [EMAIL PROTECTED] --- drivers/s390/cio/device.c| 10 ++ drivers/s390/scsi/zfcp_ccw.c | 10 -- include/asm-s390/ccwdev.h|2 ++ 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c index 3943a4f..7fb271c 100644 --- a/drivers/s390/cio/device.c +++ b/drivers/s390/cio/device.c @@ -1433,12 +1433,22 @@ ccw_device_remove (struct device *dev) return 0; } +static void ccw_device_shutdown(struct device *dev) +{ + struct ccw_device *cdev; + + cdev = to_ccwdev(dev); + if (cdev-drv cdev-drv-shutdown) + cdev-drv-shutdown(cdev); +} + struct bus_type ccw_bus_type = { .name = ccw, .match = ccw_bus_match, .uevent = ccw_uevent, .probe = ccw_device_probe, .remove = ccw_device_remove, + .shutdown = ccw_device_shutdown, }; /** diff --git a/drivers/s390/scsi/zfcp_ccw.c b/drivers/s390/scsi/zfcp_ccw.c index 1c8f71a..c0d1c0e 100644 --- a/drivers/s390/scsi/zfcp_ccw.c +++ b/drivers/s390/scsi/zfcp_ccw.c @@ -28,7 +28,7 @@ static void zfcp_ccw_remove(struct ccw_device *); static int zfcp_ccw_set_online(struct ccw_device *); static int zfcp_ccw_set_offline(struct ccw_device *); static int zfcp_ccw_notify(struct ccw_device *, int); -static void zfcp_ccw_shutdown(struct device *); +static void zfcp_ccw_shutdown(struct ccw_device *); static struct ccw_device_id zfcp_ccw_device_id[] = { {CCW_DEVICE_DEVTYPE(ZFCP_CONTROL_UNIT_TYPE, @@ -51,9 +51,7 @@ static struct ccw_driver zfcp_ccw_driver = { .set_online = zfcp_ccw_set_online, .set_offline = zfcp_ccw_set_offline, .notify = zfcp_ccw_notify, - .driver = { - .shutdown = zfcp_ccw_shutdown, - }, + .shutdown= zfcp_ccw_shutdown, }; MODULE_DEVICE_TABLE(ccw, zfcp_ccw_device_id); @@ -277,12 +275,12 @@ zfcp_ccw_register(void) * Makes sure that QDIO queues are down when the system gets stopped. */ static void -zfcp_ccw_shutdown(struct device *dev) +zfcp_ccw_shutdown(struct ccw_device *cdev) { struct zfcp_adapter *adapter; down(zfcp_data.config_sema); - adapter = dev_get_drvdata(dev); + adapter = dev_get_drvdata(cdev-dev); zfcp_erp_adapter_shutdown(adapter, 0); zfcp_erp_wait(adapter); up(zfcp_data.config_sema); diff --git a/include/asm-s390/ccwdev.h b/include/asm-s390/ccwdev.h index 8e961aa..066aa70 100644 --- a/include/asm-s390/ccwdev.h +++ b/include/asm-s390/ccwdev.h @@ -102,6 +102,7 @@ struct ccw_device { * @set_online: called when setting device online * @set_offline: called when setting device offline * @notify: notify driver of device state changes + * @shutdown: called at device shutdown * @driver: embedded device driver structure * @name: device driver name */ @@ -113,6 +114,7 @@ struct ccw_driver { int (*set_online) (struct ccw_device *); int (*set_offline) (struct ccw_device *); int (*notify) (struct ccw_device *, int); + void (*shutdown) (struct ccw_device *); struct device_driver driver; char *name; }; - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[S390] cio: Fix device attributes for early devices.
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e103178658f07131fee4e643596982b604cc63a9 Commit: e103178658f07131fee4e643596982b604cc63a9 Parent: 1842f2b1847155805f9cc8c834ef4272198b272b Author: Cornelia Huck [EMAIL PROTECTED] AuthorDate: Fri Oct 12 16:11:23 2007 +0200 Committer: Martin Schwidefsky [EMAIL PROTECTED] CommitDate: Fri Oct 12 16:13:01 2007 +0200 [S390] cio: Fix device attributes for early devices. Don't forget to set dev-groups for early ccw devices like the console device so the default attributes are created. Signed-off-by: Cornelia Huck [EMAIL PROTECTED] Signed-off-by: Martin Schwidefsky [EMAIL PROTECTED] --- drivers/s390/cio/device.c |1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c index eea9b1d..c96380d 100644 --- a/drivers/s390/cio/device.c +++ b/drivers/s390/cio/device.c @@ -1123,6 +1123,7 @@ io_subchannel_probe (struct subchannel *sch) * device, e.g. the console. */ cdev = sch-dev.driver_data; + cdev-dev.groups = ccwdev_attr_groups; device_initialize(cdev-dev); ccw_device_register(cdev); /* - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[S390] cio: Disable channel measurements (cmf) on shutdown/reboot.
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1842f2b1847155805f9cc8c834ef4272198b272b Commit: 1842f2b1847155805f9cc8c834ef4272198b272b Parent: 958974fb596ad037fb571cf2899f783764a83e1a Author: Cornelia Huck [EMAIL PROTECTED] AuthorDate: Fri Oct 12 16:11:22 2007 +0200 Committer: Martin Schwidefsky [EMAIL PROTECTED] CommitDate: Fri Oct 12 16:13:01 2007 +0200 [S390] cio: Disable channel measurements (cmf) on shutdown/reboot. Disable channel measurements for all ccw devices via the ccw bus's shutdown method. Clear residual cmf related information that may be in the schib when setting up a new subchannel. Signed-off-by: Cornelia Huck [EMAIL PROTECTED] Signed-off-by: Martin Schwidefsky [EMAIL PROTECTED] --- drivers/s390/cio/cio.c|5 + drivers/s390/cio/device.c |2 ++ 2 files changed, 7 insertions(+), 0 deletions(-) diff --git a/drivers/s390/cio/cio.c b/drivers/s390/cio/cio.c index f2708d6..4690534 100644 --- a/drivers/s390/cio/cio.c +++ b/drivers/s390/cio/cio.c @@ -619,6 +619,11 @@ cio_validate_subchannel (struct subchannel *sch, struct subchannel_id schid) sch-schib.pmcw.ena = 0; if ((sch-lpm (sch-lpm - 1)) != 0) sch-schib.pmcw.mp = 1; /* multipath mode */ + /* clean up possible residual cmf stuff */ + sch-schib.pmcw.mme = 0; + sch-schib.pmcw.mbfc = 0; + sch-schib.pmcw.mbi = 0; + sch-schib.mba = 0; return 0; out: if (!cio_is_console(schid)) diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c index 7fb271c..eea9b1d 100644 --- a/drivers/s390/cio/device.c +++ b/drivers/s390/cio/device.c @@ -21,6 +21,7 @@ #include asm/ccwdev.h #include asm/cio.h #include asm/param.h /* HZ */ +#include asm/cmb.h #include cio.h #include cio_debug.h @@ -1440,6 +1441,7 @@ static void ccw_device_shutdown(struct device *dev) cdev = to_ccwdev(dev); if (cdev-drv cdev-drv-shutdown) cdev-drv-shutdown(cdev); + disable_cmf(cdev); } struct bus_type ccw_bus_type = { - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[S390] cio: Documentation update.
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3952c8d43aa23862181ad23ecdf72895b4be3143 Commit: 3952c8d43aa23862181ad23ecdf72895b4be3143 Parent: 6920c12a407e073168d6cae164fa820d666af5c6 Author: Cornelia Huck [EMAIL PROTECTED] AuthorDate: Fri Oct 12 16:11:25 2007 +0200 Committer: Martin Schwidefsky [EMAIL PROTECTED] CommitDate: Fri Oct 12 16:13:02 2007 +0200 [S390] cio: Documentation update. Signed-off-by: Cornelia Huck [EMAIL PROTECTED] Signed-off-by: Martin Schwidefsky [EMAIL PROTECTED] --- Documentation/s390/00-INDEX |2 +- Documentation/s390/CommonIO | 51 -- Documentation/s390/cds.txt |8 +++--- 3 files changed, 34 insertions(+), 27 deletions(-) diff --git a/Documentation/s390/00-INDEX b/Documentation/s390/00-INDEX index 93ed471..3a2b963 100644 --- a/Documentation/s390/00-INDEX +++ b/Documentation/s390/00-INDEX @@ -7,7 +7,7 @@ cds.txt - s390 common device support (common I/O layer). CommonIO - - common I/O layer command line parameters and /proc entries + - common I/O layer command line parameters, procfs and debugfs entries config3270.sh - example configuration for 3270 devices. DASD diff --git a/Documentation/s390/CommonIO b/Documentation/s390/CommonIO index 22f82f2..86320aa 100644 --- a/Documentation/s390/CommonIO +++ b/Documentation/s390/CommonIO @@ -1,5 +1,5 @@ -S/390 common I/O-Layer - command line parameters and /proc entries -== +S/390 common I/O-Layer - command line parameters, procfs and debugfs entries + Command line parameters --- @@ -7,9 +7,9 @@ Command line parameters * cio_msg = yes | no Determines whether information on found devices and sensed device - characteristics should be shown during startup, i. e. messages of the types - Detected device 0.0.4711 on subchannel 0.0.0042 and SenseID: Device - 0.0.4711 reports: + characteristics should be shown during startup or when new devices are + found, i. e. messages of the types Detected device 0.0.4711 on subchannel + 0.0.0042 and SenseID: Device 0.0.4711 reports: Default is off. @@ -26,8 +26,10 @@ Command line parameters An ignored device can be un-ignored later; see the /proc entries-section for details. - The devices must be given either as bus ids (0.0.abcd) or as hexadecimal - device numbers (0xabcd or abcd, for 2.4 backward compatibility). + The devices must be given either as bus ids (0.x.abcd) or as hexadecimal + device numbers (0xabcd or abcd, for 2.4 backward compatibility). If you + give a device number 0xabcd, it will be interpreted as 0.0.abcd. + You can use the 'all' keyword to ignore all devices. The '!' operator will cause the I/O-layer to _not_ ignore a device. The command line is parsed from left to right. @@ -81,31 +83,36 @@ Command line parameters will add 0.0.a000-0.0.accc and 0.0.af00-0.0.afff to the list of ignored devices. - The devices can be specified either by bus id (0.0.abcd) or, for 2.4 backward - compatibility, by the device number in hexadecimal (0xabcd or abcd). + The devices can be specified either by bus id (0.x.abcd) or, for 2.4 backward + compatibility, by the device number in hexadecimal (0xabcd or abcd). Device + numbers given as 0xabcd will be interpreted as 0.0.abcd. + +* For some of the information present in the /proc filesystem in 2.4 (namely, + /proc/subchannels and /proc/chpids), see driver-model.txt. + Information formerly in /proc/irq_count is now in /proc/interrupts. + +debugfs entries +--- -* /proc/s390dbf/cio_*/ (S/390 debug feature) +* /sys/kernel/debug/s390dbf/cio_*/ (S/390 debug feature) Some views generated by the debug feature to hold various debug outputs. - - /proc/s390dbf/cio_crw/sprintf + - /sys/kernel/debug/s390dbf/cio_crw/sprintf Messages from the processing of pending channel report words (machine check -handling), which will also show when CONFIG_DEBUG_CRW is defined. +handling). - - /proc/s390dbf/cio_msg/sprintf -Various debug messages from the common I/O-layer; generally, messages which -will also show when CONFIG_DEBUG_IO is defined. + - /sys/kernel/debug/s390dbf/cio_msg/sprintf +Various debug messages from the common I/O-layer, including messages +printed when cio_msg=yes. - - /proc/s390dbf/cio_trace/hex_ascii + - /sys/kernel/debug/s390dbf/cio_trace/hex_ascii Logs the calling of functions in the common I/O-layer and, if applicable, which subchannel they were called for, as well as dumps of some data structures (like irb in an error case). The level of logging can be changed to be more or less verbose by piping to - /proc/s390dbf/cio_*/level a number between 0 and 6; see the documentation on - the
[S390] Add Documentation/s390/00-INDEX.
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6920c12a407e073168d6cae164fa820d666af5c6 Commit: 6920c12a407e073168d6cae164fa820d666af5c6 Parent: e103178658f07131fee4e643596982b604cc63a9 Author: Cornelia Huck [EMAIL PROTECTED] AuthorDate: Fri Oct 12 16:11:24 2007 +0200 Committer: Martin Schwidefsky [EMAIL PROTECTED] CommitDate: Fri Oct 12 16:13:02 2007 +0200 [S390] Add Documentation/s390/00-INDEX. Signed-off-by: Cornelia Huck [EMAIL PROTECTED] Signed-off-by: Martin Schwidefsky [EMAIL PROTECTED] --- Documentation/s390/00-INDEX | 26 ++ 1 files changed, 26 insertions(+), 0 deletions(-) diff --git a/Documentation/s390/00-INDEX b/Documentation/s390/00-INDEX new file mode 100644 index 000..93ed471 --- /dev/null +++ b/Documentation/s390/00-INDEX @@ -0,0 +1,26 @@ +00-INDEX + - this file. +3270.ChangeLog + - ChangeLog for the UTS Global 3270-support patch (outdated). +3270.txt + - how to use the IBM 3270 display system support. +cds.txt + - s390 common device support (common I/O layer). +CommonIO + - common I/O layer command line parameters and /proc entries +config3270.sh + - example configuration for 3270 devices. +DASD + - information on the DASD disk device driver. +Debugging390.txt + - hints for debugging on s390 systems. +driver-model.txt + - information on s390 devices and the driver model. +monreader.txt + - information on accessing the z/VM monitor stream from Linux. +s390dbf.txt + - information on using the s390 debug feature. +TAPE + - information on the driver for channel-attached tapes. +zfcpdump + - information on the s390 SCSI dump tool. - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[S390] cio: Avoid machine check vs. not operational races.
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3f4cf6e72f9f6a0b046b32881acc4f829f3aaa46 Commit: 3f4cf6e72f9f6a0b046b32881acc4f829f3aaa46 Parent: 3952c8d43aa23862181ad23ecdf72895b4be3143 Author: Cornelia Huck [EMAIL PROTECTED] AuthorDate: Fri Oct 12 16:11:26 2007 +0200 Committer: Martin Schwidefsky [EMAIL PROTECTED] CommitDate: Fri Oct 12 16:13:02 2007 +0200 [S390] cio: Avoid machine check vs. not operational races. There was the possibilty that an action like ccw_device_set_offline() triggered by a device gone machine check might trigger a not oper event. Unfortunately, this could lead to the situation that we tried to unregister a subchannel twice: Once from the slow path evaluation, and once via the not oper event. Fix this by always using the same mechanism (css_schedule_eval()) for triggering the unregister. This makes sure that unregistration will only be done once. As an added bonus, it also simplyfies the code. Signed-off-by: Cornelia Huck [EMAIL PROTECTED] Signed-off-by: Martin Schwidefsky [EMAIL PROTECTED] --- drivers/s390/cio/device.c |3 +- drivers/s390/cio/device.h |1 - drivers/s390/cio/device_fsm.c | 144 ++--- 3 files changed, 21 insertions(+), 127 deletions(-) diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c index c96380d..39f02b4 100644 --- a/drivers/s390/cio/device.c +++ b/drivers/s390/cio/device.c @@ -969,8 +969,7 @@ out: wake_up(ccw_device_init_wq); } -void -ccw_device_call_sch_unregister(struct work_struct *work) +static void ccw_device_call_sch_unregister(struct work_struct *work) { struct ccw_device_private *priv; struct ccw_device *cdev; diff --git a/drivers/s390/cio/device.h b/drivers/s390/cio/device.h index b66338b..0d40896 100644 --- a/drivers/s390/cio/device.h +++ b/drivers/s390/cio/device.h @@ -80,7 +80,6 @@ void io_subchannel_recog_done(struct ccw_device *cdev); int ccw_device_cancel_halt_clear(struct ccw_device *); void ccw_device_do_unreg_rereg(struct work_struct *); -void ccw_device_call_sch_unregister(struct work_struct *); void ccw_device_move_to_orphanage(struct work_struct *); int ccw_device_is_orphan(struct ccw_device *); diff --git a/drivers/s390/cio/device_fsm.c b/drivers/s390/cio/device_fsm.c index f772ef0..8867443 100644 --- a/drivers/s390/cio/device_fsm.c +++ b/drivers/s390/cio/device_fsm.c @@ -544,51 +544,6 @@ ccw_device_recog_timeout(struct ccw_device *cdev, enum dev_event dev_event) } -static void -ccw_device_nopath_notify(struct work_struct *work) -{ - struct ccw_device_private *priv; - struct ccw_device *cdev; - struct subchannel *sch; - int ret; - unsigned long flags; - - priv = container_of(work, struct ccw_device_private, kick_work); - cdev = priv-cdev; - spin_lock_irqsave(cdev-ccwlock, flags); - sch = to_subchannel(cdev-dev.parent); - /* Extra sanity. */ - if (sch-lpm) - goto out_unlock; - if (sch-driver sch-driver-notify) { - spin_unlock_irqrestore(cdev-ccwlock, flags); - ret = sch-driver-notify(sch-dev, CIO_NO_PATH); - spin_lock_irqsave(cdev-ccwlock, flags); - } else - ret = 0; - if (!ret) { - if (get_device(sch-dev)) { - /* Driver doesn't want to keep device. */ - cio_disable_subchannel(sch); - if (get_device(cdev-dev)) { - PREPARE_WORK(cdev-private-kick_work, -ccw_device_call_sch_unregister); - queue_work(ccw_device_work, - cdev-private-kick_work); - } else - put_device(sch-dev); - } - } else { - cio_disable_subchannel(sch); - ccw_device_set_timeout(cdev, 0); - cdev-private-flags.fake_irb = 0; - cdev-private-state = DEV_STATE_DISCONNECTED; - wake_up(cdev-private-wait_q); - } -out_unlock: - spin_unlock_irqrestore(cdev-ccwlock, flags); -} - void ccw_device_verify_done(struct ccw_device *cdev, int err) { @@ -632,12 +587,9 @@ ccw_device_verify_done(struct ccw_device *cdev, int err) default: /* Reset oper notify indication after verify error. */ cdev-private-flags.donotify = 0; - if (cdev-online) { - PREPARE_WORK(cdev-private-kick_work, -ccw_device_nopath_notify); - queue_work(ccw_device_notify_work, - cdev-private-kick_work); - } else + if (cdev-online) + dev_fsm_event(cdev,
[S390] zcrypt: make init/exit functions static.
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=731475c92ed587ac0e112c49b47b12de8d0ab609 Commit: 731475c92ed587ac0e112c49b47b12de8d0ab609 Parent: 3f4cf6e72f9f6a0b046b32881acc4f829f3aaa46 Author: Heiko Carstens [EMAIL PROTECTED] AuthorDate: Fri Oct 12 16:11:27 2007 +0200 Committer: Martin Schwidefsky [EMAIL PROTECTED] CommitDate: Fri Oct 12 16:13:03 2007 +0200 [S390] zcrypt: make init/exit functions static. Signed-off-by: Heiko Carstens [EMAIL PROTECTED] Signed-off-by: Martin Schwidefsky [EMAIL PROTECTED] --- drivers/s390/crypto/zcrypt_mono.c |4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/s390/crypto/zcrypt_mono.c b/drivers/s390/crypto/zcrypt_mono.c index 2a9349a..44253fd 100644 --- a/drivers/s390/crypto/zcrypt_mono.c +++ b/drivers/s390/crypto/zcrypt_mono.c @@ -45,7 +45,7 @@ /** * The module initialization code. */ -int __init zcrypt_init(void) +static int __init zcrypt_init(void) { int rc; @@ -86,7 +86,7 @@ out: /** * The module termination code. */ -void __exit zcrypt_exit(void) +static void __exit zcrypt_exit(void) { zcrypt_cex2a_exit(); zcrypt_pcixcc_exit(); - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[S390] zcrypt: remove duplicated struct CPRBX definition
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=16db63fda0c63de7a7feb59c6ca59ce7e2670ffb Commit: 16db63fda0c63de7a7feb59c6ca59ce7e2670ffb Parent: 731475c92ed587ac0e112c49b47b12de8d0ab609 Author: Ralph Wuerthner [EMAIL PROTECTED] AuthorDate: Fri Oct 12 16:11:28 2007 +0200 Committer: Martin Schwidefsky [EMAIL PROTECTED] CommitDate: Fri Oct 12 16:13:04 2007 +0200 [S390] zcrypt: remove duplicated struct CPRBX definition Signed-off-by: Ralph Wuerthner [EMAIL PROTECTED] --- drivers/s390/crypto/zcrypt_pcixcc.c |2 +- drivers/s390/crypto/zcrypt_pcixcc.h | 45 --- include/asm-s390/zcrypt.h |4 +- 3 files changed, 3 insertions(+), 48 deletions(-) diff --git a/drivers/s390/crypto/zcrypt_pcixcc.c b/drivers/s390/crypto/zcrypt_pcixcc.c index 6494878..c283692 100644 --- a/drivers/s390/crypto/zcrypt_pcixcc.c +++ b/drivers/s390/crypto/zcrypt_pcixcc.c @@ -277,7 +277,7 @@ static int XCRB_msg_to_type6CPRB_msgX(struct zcrypt_device *zdev, }; struct { struct type6_hdr hdr; - struct ica_CPRBX cprbx; + struct CPRBX cprbx; } __attribute__((packed)) *msg = ap_msg-message; int rcblen = CEIL4(xcRB-request_control_blk_length); diff --git a/drivers/s390/crypto/zcrypt_pcixcc.h b/drivers/s390/crypto/zcrypt_pcixcc.h index a78ff30..8cb7d7a 100644 --- a/drivers/s390/crypto/zcrypt_pcixcc.h +++ b/drivers/s390/crypto/zcrypt_pcixcc.h @@ -28,51 +28,6 @@ #ifndef _ZCRYPT_PCIXCC_H_ #define _ZCRYPT_PCIXCC_H_ -/** - * CPRBX - * Note that all shorts and ints are big-endian. - * All pointer fields are 16 bytes long, and mean nothing. - * - * A request CPRB is followed by a request_parameter_block. - * - * The request (or reply) parameter block is organized thus: - * function code - * VUD block - * key block - */ -struct CPRBX { - unsigned short cprb_len;/* CPRB length220*/ - unsigned char cprb_ver_id; /* CPRB version id. 0x02 */ - unsigned char pad_000[3]; /* Alignment pad bytes */ - unsigned char func_id[2]; /* function id0x5432 */ - unsigned char cprb_flags[4]; /* Flags */ - unsigned int req_parml; /* request parameter buffer len */ - unsigned int req_datal; /* request data buffer */ - unsigned int rpl_msgbl; /* reply message block length */ - unsigned int rpld_parml; /* replied parameter block len */ - unsigned int rpl_datal; /* reply data block len */ - unsigned int rpld_datal; /* replied data block len*/ - unsigned int req_extbl; /* request extension block len */ - unsigned char pad_001[4]; /* reserved */ - unsigned int rpld_extbl; /* replied extension block len */ - unsigned char req_parmb[16]; /* request parm block 'address' */ - unsigned char req_datab[16]; /* request data block 'address' */ - unsigned char rpl_parmb[16]; /* reply parm block 'address'*/ - unsigned char rpl_datab[16]; /* reply data block 'address'*/ - unsigned char req_extb[16];/* request extension block 'addr'*/ - unsigned char rpl_extb[16];/* reply extension block 'addres'*/ - unsigned short ccp_rtcode; /* server return code*/ - unsigned short ccp_rscode; /* server reason code*/ - unsigned int mac_data_len;/* Mac Data Length */ - unsigned char logon_id[8]; /* Logon Identifier */ - unsigned char mac_value[8];/* Mac Value */ - unsigned char mac_content_flgs;/* Mac content flag byte */ - unsigned char pad_002; /* Alignment */ - unsigned short domain; /* Domain*/ - unsigned char pad_003[12]; /* Domain masks */ - unsigned char pad_004[36]; /* reserved */ -} __attribute__((packed)); - int zcrypt_pcixcc_init(void); void zcrypt_pcixcc_exit(void); diff --git a/include/asm-s390/zcrypt.h b/include/asm-s390/zcrypt.h index b90e558..a5dada6 100644 --- a/include/asm-s390/zcrypt.h +++ b/include/asm-s390/zcrypt.h @@ -91,7 +91,7 @@ struct ica_rsa_modexpo_crt { * VUD block * key block */ -struct ica_CPRBX { +struct CPRBX { unsigned short cprb_len; /* CPRB length220*/ unsigned char cprb_ver_id;/* CPRB version id. 0x02 */ unsigned char pad_000[3]; /* Alignment pad bytes */ @@ -130,7 +130,7 @@ struct ica_CPRBX { unsigned char cntrl_domain[4];/* Control domain*/ unsigned
[S390] zcrypt: fix ap_reset_domain()
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=39aa7cf612cc4e7f688c18f04c35afb51c57472e Commit: 39aa7cf612cc4e7f688c18f04c35afb51c57472e Parent: 16db63fda0c63de7a7feb59c6ca59ce7e2670ffb Author: Ralph Wuerthner [EMAIL PROTECTED] AuthorDate: Fri Oct 12 16:11:29 2007 +0200 Committer: Martin Schwidefsky [EMAIL PROTECTED] CommitDate: Fri Oct 12 16:13:05 2007 +0200 [S390] zcrypt: fix ap_reset_domain() Resetting of a all queues within a domain requires that a domain must be selected first. Signed-off-by: Ralph Wuerthner [EMAIL PROTECTED] Signed-off-by: Martin Schwidefsky [EMAIL PROTECTED] --- drivers/s390/crypto/ap_bus.c |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/s390/crypto/ap_bus.c b/drivers/s390/crypto/ap_bus.c index 90bd220..d334b0f 100644 --- a/drivers/s390/crypto/ap_bus.c +++ b/drivers/s390/crypto/ap_bus.c @@ -1231,8 +1231,9 @@ static void ap_reset_domain(void) { int i; - for (i = 0; i AP_DEVICES; i++) - ap_reset_queue(AP_MKQID(i, ap_domain_index)); + if (ap_domain_index != -1) + for (i = 0; i AP_DEVICES; i++) + ap_reset_queue(AP_MKQID(i, ap_domain_index)); } static void ap_reset_all(void) - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[S390] appldata_base: Misc cpuinit annotations and bugfix
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=11b8bf0107e688434b9e0570fd05e7c715534f3b Commit: 11b8bf0107e688434b9e0570fd05e7c715534f3b Parent: 2af48080e100d66db8f086af70a70713a953a83d Author: Satyam Sharma [EMAIL PROTECTED] AuthorDate: Fri Oct 12 16:11:31 2007 +0200 Committer: Martin Schwidefsky [EMAIL PROTECTED] CommitDate: Fri Oct 12 16:13:05 2007 +0200 [S390] appldata_base: Misc cpuinit annotations and bugfix appldata_offline_cpu() is only called from __cpuinit-marked hotplug notifier callback and from the __exit-marked module_exit function, therefore candidate for __cpuexit. BTW the __exit module_exit function appldata_exit() of this driver fails to unregister_hotcpu_notifier() the notifier_block that was registered by appldata_init() during module startup. This will lead to oops if hotplug notification comes after module has been unloaded. Let's fix this by unregistering the notifier appropriately (before appldata_offline_cpu()'ing the CPUs). Signed-off-by: Satyam Sharma [EMAIL PROTECTED] Cc: Heiko Carstens [EMAIL PROTECTED] Signed-off-by: Andrew Morton [EMAIL PROTECTED] Signed-off-by: Martin Schwidefsky [EMAIL PROTECTED] --- arch/s390/appldata/appldata_base.c | 11 ++- 1 files changed, 6 insertions(+), 5 deletions(-) diff --git a/arch/s390/appldata/appldata_base.c b/arch/s390/appldata/appldata_base.c index 62391fb..a355d81 100644 --- a/arch/s390/appldata/appldata_base.c +++ b/arch/s390/appldata/appldata_base.c @@ -547,8 +547,7 @@ static void __cpuinit appldata_online_cpu(int cpu) spin_unlock(appldata_timer_lock); } -static void -appldata_offline_cpu(int cpu) +static void __cpuexit appldata_offline_cpu(int cpu) { del_virt_timer(per_cpu(appldata_timer, cpu)); if (atomic_dec_and_test(appldata_expire_count)) { @@ -560,9 +559,9 @@ appldata_offline_cpu(int cpu) spin_unlock(appldata_timer_lock); } -static int __cpuinit -appldata_cpu_notify(struct notifier_block *self, - unsigned long action, void *hcpu) +static int __cpuinit appldata_cpu_notify(struct notifier_block *self, +unsigned long action, +void *hcpu) { switch (action) { case CPU_ONLINE: @@ -646,6 +645,8 @@ static void __exit appldata_exit(void) } spin_unlock(appldata_ops_lock); + unregister_hotcpu_notifier(appldata_nb); + for_each_online_cpu(i) appldata_offline_cpu(i); - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[S390] disassembler: Remove redundant variable assignment
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f5360106422302e8eed4d07ea8daf81ec19ca345 Commit: f5360106422302e8eed4d07ea8daf81ec19ca345 Parent: 74ccbdc226cac44bb56cd479917195dc5132d7aa Author: Christian Borntraeger [EMAIL PROTECTED] AuthorDate: Fri Oct 12 16:11:34 2007 +0200 Committer: Martin Schwidefsky [EMAIL PROTECTED] CommitDate: Fri Oct 12 16:13:06 2007 +0200 [S390] disassembler: Remove redundant variable assignment There is no need to assign 0 to hops twice. Remove one assigment. Signed-off-by: Christian Borntraeger [EMAIL PROTECTED] Signed-off-by: Martin Schwidefsky [EMAIL PROTECTED] --- arch/s390/kernel/dis.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/arch/s390/kernel/dis.c b/arch/s390/kernel/dis.c index 5f315af..c14a336 100644 --- a/arch/s390/kernel/dis.c +++ b/arch/s390/kernel/dis.c @@ -1243,7 +1243,6 @@ void show_code(struct pt_regs *regs) } /* Find a starting point for the disassembly. */ while (start 32) { - hops = 0; for (i = 0, hops = 0; start + i 32 hops 3; hops++) { if (!find_insn(code + start + i)) break; - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[S390] disassembler: fix output for insns with 6 operands.
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=74ccbdc226cac44bb56cd479917195dc5132d7aa Commit: 74ccbdc226cac44bb56cd479917195dc5132d7aa Parent: 076fc808ab804c6cfb40fd0caa0b74dd50e0d5de Author: Martin Schwidefsky [EMAIL PROTECTED] AuthorDate: Fri Oct 12 16:11:33 2007 +0200 Committer: Martin Schwidefsky [EMAIL PROTECTED] CommitDate: Fri Oct 12 16:13:06 2007 +0200 [S390] disassembler: fix output for insns with 6 operands. The termination condition of the loop that prints the operands of an instruction doesn't stop after the maximum of 6 operands. It continues with the operands of the next instruction format instead which create really long lines. Signed-off-by: Martin Schwidefsky [EMAIL PROTECTED] --- arch/s390/kernel/dis.c |4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/arch/s390/kernel/dis.c b/arch/s390/kernel/dis.c index 50d2235..5f315af 100644 --- a/arch/s390/kernel/dis.c +++ b/arch/s390/kernel/dis.c @@ -1162,6 +1162,7 @@ static int print_insn(char *buffer, unsigned char *code, unsigned long addr) unsigned int value; char separator; char *ptr; + int i; ptr = buffer; insn = find_insn(code); @@ -1169,7 +1170,8 @@ static int print_insn(char *buffer, unsigned char *code, unsigned long addr) ptr += sprintf(ptr, %.5s\t, insn-name); /* Extract the operands. */ separator = 0; - for (ops = formats[insn-format] + 1; *ops != 0; ops++) { + for (ops = formats[insn-format] + 1, i = 0; +*ops != 0 i 6; ops++, i++) { operand = operands + *ops; value = extract_operand(code, operand); if ((operand-flags OPERAND_INDEX) value == 0) - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[S390] appldata_base: Remove module_exit function and modular stuff
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=076fc808ab804c6cfb40fd0caa0b74dd50e0d5de Commit: 076fc808ab804c6cfb40fd0caa0b74dd50e0d5de Parent: 11b8bf0107e688434b9e0570fd05e7c715534f3b Author: Satyam Sharma [EMAIL PROTECTED] AuthorDate: Fri Oct 12 16:11:32 2007 +0200 Committer: Martin Schwidefsky [EMAIL PROTECTED] CommitDate: Fri Oct 12 16:13:05 2007 +0200 [S390] appldata_base: Remove module_exit function and modular stuff arch/s390/Kconfig tells us that CONFIG_APPLDATA_BASE is bool and hence can never be built modular. Given this, defining appldata_exit() function is pointless (and wasteful, actually). Remove all that. Previous patch annotated appldata_offline_cpu() as __cpuexit, but now with the __exit function appldata_exit() gone, the only callsite that references it is __cpuinit, so this function can also be __cpuinit, thereby saving space when HOTPLUG_CPU=n. Signed-off-by: Satyam Sharma [EMAIL PROTECTED] Cc: Heiko Carstens [EMAIL PROTECTED] Signed-off-by: Andrew Morton [EMAIL PROTECTED] Signed-off-by: Martin Schwidefsky [EMAIL PROTECTED] --- arch/s390/appldata/appldata_base.c | 54 +-- 1 files changed, 2 insertions(+), 52 deletions(-) diff --git a/arch/s390/appldata/appldata_base.c b/arch/s390/appldata/appldata_base.c index a355d81..ac61cf4 100644 --- a/arch/s390/appldata/appldata_base.c +++ b/arch/s390/appldata/appldata_base.c @@ -547,7 +547,7 @@ static void __cpuinit appldata_online_cpu(int cpu) spin_unlock(appldata_timer_lock); } -static void __cpuexit appldata_offline_cpu(int cpu) +static void __cpuinit appldata_offline_cpu(int cpu) { del_virt_timer(per_cpu(appldata_timer, cpu)); if (atomic_dec_and_test(appldata_expire_count)) { @@ -607,65 +607,15 @@ static int __init appldata_init(void) register_hotcpu_notifier(appldata_nb); appldata_sysctl_header = register_sysctl_table(appldata_dir_table); -#ifdef MODULE - appldata_dir_table[0].de-owner = THIS_MODULE; - appldata_table[0].de-owner = THIS_MODULE; - appldata_table[1].de-owner = THIS_MODULE; -#endif P_DEBUG(Base interface initialized.\n); return 0; } -/* - * appldata_exit() - * - * stop timer, unregister /proc entries - */ -static void __exit appldata_exit(void) -{ - struct list_head *lh; - struct appldata_ops *ops; - int rc, i; +__initcall(appldata_init); - P_DEBUG(Unloading module ...\n); - /* -* ops list should be empty, but just in case something went wrong... -*/ - spin_lock(appldata_ops_lock); - list_for_each(lh, appldata_ops_list) { - ops = list_entry(lh, struct appldata_ops, list); - rc = appldata_diag(ops-record_nr, APPLDATA_STOP_REC, - (unsigned long) ops-data, ops-size, - ops-mod_lvl); - if (rc != 0) { - P_ERROR(STOP DIAG 0xDC for %s failed, - return code: %d\n, ops-name, rc); - } - } - spin_unlock(appldata_ops_lock); - - unregister_hotcpu_notifier(appldata_nb); - - for_each_online_cpu(i) - appldata_offline_cpu(i); - - appldata_timer_active = 0; - - unregister_sysctl_table(appldata_sysctl_header); - - destroy_workqueue(appldata_wq); - P_DEBUG(... module unloaded!\n); -} / init / exit END **/ - -module_init(appldata_init); -module_exit(appldata_exit); -MODULE_LICENSE(GPL); -MODULE_AUTHOR(Gerald Schaefer); -MODULE_DESCRIPTION(Linux-VM Monitor Stream, base infrastructure); - EXPORT_SYMBOL_GPL(appldata_register_ops); EXPORT_SYMBOL_GPL(appldata_unregister_ops); EXPORT_SYMBOL_GPL(appldata_diag); - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[S390] qdio: dont cast function pointers and use them to call functions.
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b18a2db416088ad54a4bfb59c0b932be383aee83 Commit: b18a2db416088ad54a4bfb59c0b932be383aee83 Parent: 5a291321d6b7ab40923b9a42b36746f7b5ca0055 Author: Heiko Carstens [EMAIL PROTECTED] AuthorDate: Fri Oct 12 16:11:38 2007 +0200 Committer: Martin Schwidefsky [EMAIL PROTECTED] CommitDate: Fri Oct 12 16:13:07 2007 +0200 [S390] qdio: dont cast function pointers and use them to call functions. According to C99 6.3.2.3 it's undefined what happens if a converted pointer is used to call a function whose type is not compatible with the pointed-to type. That's what the qdio code is doing, so fix it. Signed-off-by: Heiko Carstens [EMAIL PROTECTED] Signed-off-by: Martin Schwidefsky [EMAIL PROTECTED] --- drivers/s390/cio/qdio.c | 37 +++-- 1 files changed, 19 insertions(+), 18 deletions(-) diff --git a/drivers/s390/cio/qdio.c b/drivers/s390/cio/qdio.c index d8d4798..151636c 100644 --- a/drivers/s390/cio/qdio.c +++ b/drivers/s390/cio/qdio.c @@ -1024,9 +1024,9 @@ __qdio_outbound_processing(struct qdio_q *q) } static void -qdio_outbound_processing(struct qdio_q *q) +qdio_outbound_processing(unsigned long q) { - __qdio_outbound_processing(q); + __qdio_outbound_processing((struct qdio_q *) q); } /* INBOUND ROUTINES ***/ @@ -1449,9 +1449,10 @@ out: } static void -tiqdio_inbound_processing(struct qdio_q *q) +tiqdio_inbound_processing(unsigned long q) { - __tiqdio_inbound_processing(q, atomic_read(spare_indicator_usecount)); + __tiqdio_inbound_processing((struct qdio_q *) q, + atomic_read(spare_indicator_usecount)); } static void @@ -1494,9 +1495,9 @@ again: } static void -qdio_inbound_processing(struct qdio_q *q) +qdio_inbound_processing(unsigned long q) { - __qdio_inbound_processing(q); + __qdio_inbound_processing((struct qdio_q *) q); } /* MAIN ROUTINES ***/ @@ -1760,12 +1761,15 @@ qdio_fill_qs(struct qdio_irq *irq_ptr, struct ccw_device *cdev, q-handler=input_handler; q-dev_st_chg_ind=irq_ptr-dev_st_chg_ind; - q-tasklet.data=(unsigned long)q; /* q-is_thinint_q isn't valid at this time, but -* irq_ptr-is_thinint_irq is */ - q-tasklet.func=(void(*)(unsigned long)) - ((irq_ptr-is_thinint_irq)?tiqdio_inbound_processing: -qdio_inbound_processing); +* irq_ptr-is_thinint_irq is +*/ + if (irq_ptr-is_thinint_irq) + tasklet_init(q-tasklet, tiqdio_inbound_processing, +(unsigned long) q); + else + tasklet_init(q-tasklet, qdio_inbound_processing, +(unsigned long) q); /* actually this is not used for inbound queues. yet. */ atomic_set(q-busy_siga_counter,0); @@ -1836,13 +1840,10 @@ qdio_fill_qs(struct qdio_irq *irq_ptr, struct ccw_device *cdev, q-last_move_ftc=0; q-handler=output_handler; - q-tasklet.data=(unsigned long)q; - q-tasklet.func=(void(*)(unsigned long)) - qdio_outbound_processing; - q-timer.function=(void(*)(unsigned long)) - qdio_outbound_processing; - q-timer.data = (long)q; - init_timer(q-timer); + tasklet_init(q-tasklet, qdio_outbound_processing, +(unsigned long) q); + setup_timer(q-timer, qdio_outbound_processing, + (unsigned long) q); atomic_set(q-busy_siga_counter,0); q-timing.busy_start=0; - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[S390] is_power_of_2 in drivers/s390/block/dasd_int.h
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e108cebb21316714de43767e242316c784471740 Commit: e108cebb21316714de43767e242316c784471740 Parent: b18a2db416088ad54a4bfb59c0b932be383aee83 Author: vignesh babu [EMAIL PROTECTED] AuthorDate: Fri Oct 12 16:11:39 2007 +0200 Committer: Martin Schwidefsky [EMAIL PROTECTED] CommitDate: Fri Oct 12 16:13:07 2007 +0200 [S390] is_power_of_2 in drivers/s390/block/dasd_int.h Replacing n (n - 1) for power of 2 check by is_power_of_2(n) Signed-off-by: vignesh babu [EMAIL PROTECTED] Signed-off-by: Martin Schwidefsky [EMAIL PROTECTED] Signed-off-by: Heiko Carstens [EMAIL PROTECTED] --- drivers/s390/block/dasd_int.h |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/s390/block/dasd_int.h b/drivers/s390/block/dasd_int.h index aeda526..d427dae 100644 --- a/drivers/s390/block/dasd_int.h +++ b/drivers/s390/block/dasd_int.h @@ -53,6 +53,7 @@ #include linux/genhd.h #include linux/hdreg.h #include linux/interrupt.h +#include linux/log2.h #include asm/ccwdev.h #include linux/workqueue.h #include asm/debug.h @@ -456,7 +457,7 @@ dasd_free_chunk(struct list_head *chunk_list, void *mem) static inline int dasd_check_blocksize(int bsize) { - if (bsize 512 || bsize 4096 || (bsize (bsize - 1)) != 0) + if (bsize 512 || bsize 4096 || !is_power_of_2(bsize)) return -EMEDIUMTYPE; return 0; } - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[S390] xpram: fix bio_end{_,}io typo
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=146b76a09a24b240563a51d5f9fbea8bd3e1 Commit: 146b76a09a24b240563a51d5f9fbea8bd3e1 Parent: a2e53801971edbdaac4411760d893b8b65646987 Author: Martin Schwidefsky [EMAIL PROTECTED] AuthorDate: Fri Oct 12 16:11:53 2007 +0200 Committer: Martin Schwidefsky [EMAIL PROTECTED] CommitDate: Fri Oct 12 16:13:11 2007 +0200 [S390] xpram: fix bio_end{_,}io typo Signed-off-by: Martin Schwidefsky [EMAIL PROTECTED] --- drivers/s390/block/xpram.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/s390/block/xpram.c b/drivers/s390/block/xpram.c index 0fbacc8..f231bc2 100644 --- a/drivers/s390/block/xpram.c +++ b/drivers/s390/block/xpram.c @@ -230,7 +230,7 @@ static int xpram_make_request(struct request_queue *q, struct bio *bio) } } set_bit(BIO_UPTODATE, bio-bi_flags); - bio_end_io(bio, 0); + bio_endio(bio, 0); return 0; fail: bio_io_error(bio); - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[S390] zcore: fix inline assembly in memcpy_real()
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=53a0868cb4d77dcba8e95e1033361ffdb6e510e2 Commit: 53a0868cb4d77dcba8e95e1033361ffdb6e510e2 Parent: cebe0fe70fbf033a1a6b7c5c8b79eb13060a4ab7 Author: Michael Holzheu [EMAIL PROTECTED] AuthorDate: Fri Oct 12 16:11:44 2007 +0200 Committer: Martin Schwidefsky [EMAIL PROTECTED] CommitDate: Fri Oct 12 16:13:09 2007 +0200 [S390] zcore: fix inline assembly in memcpy_real() memcpy_real uses the mvcle instruction. This instruction alters all used registers (source, destination and 2 x count). Therefore we have to flag those registers as input/output registers (+d). In addition to that, we have to specify, that we read from memory designated by src and write to memory designated by dest. Signed-off-by: Michael Holzheu [EMAIL PROTECTED] Signed-off-by: Martin Schwidefsky [EMAIL PROTECTED] --- drivers/s390/char/zcore.c |7 --- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/s390/char/zcore.c b/drivers/s390/char/zcore.c index 3712ede..7073daf 100644 --- a/drivers/s390/char/zcore.c +++ b/drivers/s390/char/zcore.c @@ -141,15 +141,16 @@ static int memcpy_real(void *dest, unsigned long src, size_t count) if (count == 0) return 0; - flags = __raw_local_irq_stnsm(0xf8); /* switch to real mode */ + flags = __raw_local_irq_stnsm(0xf8UL); /* switch to real mode */ asm volatile ( 0: mvcle %1,%2,0x0\n 1: jo 0b\n lhi %0,0x0\n 2:\n EX_TABLE(1b,2b) - : +d (rc) - : d (_dest), d (_src), d (_len1), d (_len2) + : +d (rc), +d (_dest), +d (_src), +d (_len1), + +d (_len2), =m (*((long*)dest)) + : m (*((long*)src)) : cc, memory); __raw_local_irq_ssm(flags); - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[GFS2] Clean up duplicate includes in fs/gfs2/
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=aa0481e58a9a97a97035725a712920b5fe32f348 Commit: aa0481e58a9a97a97035725a712920b5fe32f348 Parent: 26caee5bc643b318fa2e9bd4f66dace1755ec413 Author: Jesper Juhl [EMAIL PROTECTED] AuthorDate: Sat Jul 21 17:03:22 2007 +0200 Committer: Steven Whitehouse [EMAIL PROTECTED] CommitDate: Wed Oct 10 08:54:44 2007 +0100 [GFS2] Clean up duplicate includes in fs/gfs2/ This patch cleans up duplicate includes in fs/gfs2/ Signed-off-by: Jesper Juhl [EMAIL PROTECTED] Signed-off-by: Steven Whitehouse [EMAIL PROTECTED] --- fs/gfs2/glock.c|2 -- fs/gfs2/locking/dlm/lock_dlm.h |1 - fs/gfs2/locking/nolock/main.c |1 - 3 files changed, 0 insertions(+), 4 deletions(-) diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c index 6b6ae45..d403fd7 100644 --- a/fs/gfs2/glock.c +++ b/fs/gfs2/glock.c @@ -25,8 +25,6 @@ #include asm/uaccess.h #include linux/seq_file.h #include linux/debugfs.h -#include linux/module.h -#include linux/kallsyms.h #include gfs2.h #include incore.h diff --git a/fs/gfs2/locking/dlm/lock_dlm.h b/fs/gfs2/locking/dlm/lock_dlm.h index 24d70f7..9e8265d 100644 --- a/fs/gfs2/locking/dlm/lock_dlm.h +++ b/fs/gfs2/locking/dlm/lock_dlm.h @@ -13,7 +13,6 @@ #include linux/module.h #include linux/slab.h #include linux/spinlock.h -#include linux/module.h #include linux/types.h #include linux/string.h #include linux/list.h diff --git a/fs/gfs2/locking/nolock/main.c b/fs/gfs2/locking/nolock/main.c index 0d149c8..d3b8ce6 100644 --- a/fs/gfs2/locking/nolock/main.c +++ b/fs/gfs2/locking/nolock/main.c @@ -9,7 +9,6 @@ #include linux/module.h #include linux/slab.h -#include linux/module.h #include linux/init.h #include linux/types.h #include linux/fs.h - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[GFS2] Fix calculation of demote state
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=26caee5bc643b318fa2e9bd4f66dace1755ec413 Commit: 26caee5bc643b318fa2e9bd4f66dace1755ec413 Parent: 87124e581bfeaa5864662a435b6ee2a19e91b905 Author: Josef Whiter [EMAIL PROTECTED] AuthorDate: Mon Jul 23 10:02:40 2007 +0100 Committer: Steven Whitehouse [EMAIL PROTECTED] CommitDate: Wed Oct 10 08:54:42 2007 +0100 [GFS2] Fix calculation of demote state If a glock is in the exclusive state and a request for demote to deferred has been received, then further requests for demote to shared are being ignored. This patch fixes that by ensuring that we demote to unlocked in that case. Signed-off-by: Josef Whiter [EMAIL PROTECTED] Signed-off-by: Steven Whitehouse [EMAIL PROTECTED] --- fs/gfs2/glock.c |5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c index 6a3eeba..6b6ae45 100644 --- a/fs/gfs2/glock.c +++ b/fs/gfs2/glock.c @@ -697,8 +697,9 @@ static void handle_callback(struct gfs2_glock *gl, unsigned int state, int remot } return; } - } else if (gl-gl_demote_state != LM_ST_UNLOCKED) { - gl-gl_demote_state = state; + } else if (gl-gl_demote_state != LM_ST_UNLOCKED + gl-gl_demote_state != state) { + gl-gl_demote_state = LM_ST_UNLOCKED; } spin_unlock(gl-gl_spin); } - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[GFS2] Revert part of earlier log.c changes
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=693ddeabbb3e563f192a7ac74ec04168aa92e8d8 Commit: 693ddeabbb3e563f192a7ac74ec04168aa92e8d8 Parent: 905d2aefa9e06ebb995df96920d273a516fcd3f9 Author: Bob Peterson [EMAIL PROTECTED] AuthorDate: Tue Jul 24 14:07:33 2007 -0500 Committer: Steven Whitehouse [EMAIL PROTECTED] CommitDate: Wed Oct 10 08:54:53 2007 +0100 [GFS2] Revert part of earlier log.c changes This is patch 2 of 5 for bug #248176. The list_move code previously concocted in log.c for bug #238162 (see https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=238162#c23) never runs as bh can now never be NULL at this point. Signed-off-by: Bob Peterson [EMAIL PROTECTED] Signed-off-by: Steven Whitehouse [EMAIL PROTECTED] --- fs/gfs2/log.c | 13 ++--- 1 files changed, 2 insertions(+), 11 deletions(-) diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c index f49a12e..f7c0608 100644 --- a/fs/gfs2/log.c +++ b/fs/gfs2/log.c @@ -83,11 +83,6 @@ static void gfs2_ail1_start_one(struct gfs2_sbd *sdp, struct gfs2_ail *ai) gfs2_assert(sdp, bd-bd_ail == ai); - if (!bh){ - list_move(bd-bd_ail_st_list, ai-ai_ail2_list); -continue; -} - if (!buffer_busy(bh)) { if (!buffer_uptodate(bh)) { gfs2_log_unlock(sdp); @@ -130,11 +125,6 @@ static int gfs2_ail1_empty_one(struct gfs2_sbd *sdp, struct gfs2_ail *ai, int fl bd_ail_st_list) { bh = bd-bd_bh; - if (!bh){ - list_move(bd-bd_ail_st_list, ai-ai_ail2_list); - continue; - } - gfs2_assert(sdp, bd-bd_ail == ai); if (buffer_busy(bh)) { @@ -155,13 +145,14 @@ static int gfs2_ail1_empty_one(struct gfs2_sbd *sdp, struct gfs2_ail *ai, int fl static void gfs2_ail1_start(struct gfs2_sbd *sdp, int flags) { - struct list_head *head = sdp-sd_ail1_list; + struct list_head *head; u64 sync_gen; struct list_head *first; struct gfs2_ail *first_ai, *ai, *tmp; int done = 0; gfs2_log_lock(sdp); + head = sdp-sd_ail1_list; if (list_empty(head)) { gfs2_log_unlock(sdp); return; - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[GFS2] use the declaration of gfs2_dops in the header file instead
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=ca5a939b33166a9f5a2556e6c4ec031524852ba2 Commit: ca5a939b33166a9f5a2556e6c4ec031524852ba2 Parent: 4ef290025ccde7c52ba219cf733a4295acd5401f Author: Denis Cheng [EMAIL PROTECTED] AuthorDate: Tue Jul 31 18:31:12 2007 +0800 Committer: Steven Whitehouse [EMAIL PROTECTED] CommitDate: Wed Oct 10 08:55:05 2007 +0100 [GFS2] use the declaration of gfs2_dops in the header file instead Signed-off-by: Denis Cheng [EMAIL PROTECTED] Signed-off-by: Steven Whitehouse [EMAIL PROTECTED] --- fs/gfs2/ops_fstype.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c index cf5aa50..9a5e840 100644 --- a/fs/gfs2/ops_fstype.c +++ b/fs/gfs2/ops_fstype.c @@ -28,6 +28,7 @@ #include lm.h #include mount.h #include ops_fstype.h +#include ops_dentry.h #include ops_super.h #include recovery.h #include rgrp.h @@ -38,8 +39,6 @@ #define DO 0 #define UNDO 1 -extern struct dentry_operations gfs2_dops; - static struct gfs2_sbd *init_sbd(struct super_block *sb) { struct gfs2_sbd *sdp; - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[GFS2] mark struct *_operations const
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4ef290025ccde7c52ba219cf733a4295acd5401f Commit: 4ef290025ccde7c52ba219cf733a4295acd5401f Parent: 0f8468c8bef3d04637c924e7bef20ca53018b319 Author: Denis Cheng [EMAIL PROTECTED] AuthorDate: Tue Jul 31 18:31:11 2007 +0800 Committer: Steven Whitehouse [EMAIL PROTECTED] CommitDate: Wed Oct 10 08:55:03 2007 +0100 [GFS2] mark struct *_operations const these struct *_operations are all method tables, thus should be const. Signed-off-by: Denis Cheng [EMAIL PROTECTED] Signed-off-by: Steven Whitehouse [EMAIL PROTECTED] --- fs/gfs2/eaops.c |8 fs/gfs2/eaops.h |4 ++-- fs/gfs2/glock.c |2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/fs/gfs2/eaops.c b/fs/gfs2/eaops.c index 1ab3e9d..aa8dbf3 100644 --- a/fs/gfs2/eaops.c +++ b/fs/gfs2/eaops.c @@ -200,28 +200,28 @@ static int security_eo_remove(struct gfs2_inode *ip, struct gfs2_ea_request *er) return gfs2_ea_remove_i(ip, er); } -static struct gfs2_eattr_operations gfs2_user_eaops = { +static const struct gfs2_eattr_operations gfs2_user_eaops = { .eo_get = user_eo_get, .eo_set = user_eo_set, .eo_remove = user_eo_remove, .eo_name = user, }; -struct gfs2_eattr_operations gfs2_system_eaops = { +const struct gfs2_eattr_operations gfs2_system_eaops = { .eo_get = system_eo_get, .eo_set = system_eo_set, .eo_remove = system_eo_remove, .eo_name = system, }; -static struct gfs2_eattr_operations gfs2_security_eaops = { +static const struct gfs2_eattr_operations gfs2_security_eaops = { .eo_get = security_eo_get, .eo_set = security_eo_set, .eo_remove = security_eo_remove, .eo_name = security, }; -struct gfs2_eattr_operations *gfs2_ea_ops[] = { +const struct gfs2_eattr_operations *gfs2_ea_ops[] = { NULL, gfs2_user_eaops, gfs2_system_eaops, diff --git a/fs/gfs2/eaops.h b/fs/gfs2/eaops.h index 508b4f7..da2f7fb 100644 --- a/fs/gfs2/eaops.h +++ b/fs/gfs2/eaops.h @@ -22,9 +22,9 @@ struct gfs2_eattr_operations { unsigned int gfs2_ea_name2type(const char *name, const char **truncated_name); -extern struct gfs2_eattr_operations gfs2_system_eaops; +extern const struct gfs2_eattr_operations gfs2_system_eaops; -extern struct gfs2_eattr_operations *gfs2_ea_ops[]; +extern const struct gfs2_eattr_operations *gfs2_ea_ops[]; #endif /* __EAOPS_DOT_H__ */ diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c index e4bc8ae..0054b7d 100644 --- a/fs/gfs2/glock.c +++ b/fs/gfs2/glock.c @@ -2103,7 +2103,7 @@ static int gfs2_glock_seq_show(struct seq_file *file, void *iter_ptr) return 0; } -static struct seq_operations gfs2_glock_seq_ops = { +static const struct seq_operations gfs2_glock_seq_ops = { .start = gfs2_glock_seq_start, .next = gfs2_glock_seq_next, .stop = gfs2_glock_seq_stop, - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[S390] zcrypt: fix PCIXCC/CEX2C error recovery
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2af48080e100d66db8f086af70a70713a953a83d Commit: 2af48080e100d66db8f086af70a70713a953a83d Parent: 39aa7cf612cc4e7f688c18f04c35afb51c57472e Author: Ralph Wuerthner [EMAIL PROTECTED] AuthorDate: Fri Oct 12 16:11:30 2007 +0200 Committer: Martin Schwidefsky [EMAIL PROTECTED] CommitDate: Fri Oct 12 16:13:05 2007 +0200 [S390] zcrypt: fix PCIXCC/CEX2C error recovery Symptom: zcrypt fails by setting all PCIXCC/CEX2C cards offline for a certain type of invalid keys. Problem: zcrypt does not handle rc=12/rs=769 request responses correctly Solution:modify convert_type86_ica() to handle these error codes correctly Signed-off-by: Ralph Wuerthner [EMAIL PROTECTED] Signed-off-by: Martin Schwidefsky [EMAIL PROTECTED] --- drivers/s390/crypto/zcrypt_pcixcc.c |7 +-- 1 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/s390/crypto/zcrypt_pcixcc.c b/drivers/s390/crypto/zcrypt_pcixcc.c index c283692..70b9ddc 100644 --- a/drivers/s390/crypto/zcrypt_pcixcc.c +++ b/drivers/s390/crypto/zcrypt_pcixcc.c @@ -432,14 +432,17 @@ static int convert_type86_ica(struct zcrypt_device *zdev, } if (service_rc == 8 service_rs == 770) { PDEBUG(Invalid key length on PCIXCC/CEX2C\n); - zdev-min_mod_size = PCIXCC_MIN_MOD_SIZE_OLD; - return -EAGAIN; + return -EINVAL; } if (service_rc == 8 service_rs == 783) { PDEBUG(Extended bitlengths not enabled on PCIXCC/CEX2C\n); zdev-min_mod_size = PCIXCC_MIN_MOD_SIZE_OLD; return -EAGAIN; } + if (service_rc == 12 service_rs == 769) { + PDEBUG(Invalid key on PCIXCC/CEX2C\n); + return -EINVAL; + } PRINTK(Unknown service rc/rs (PCIXCC/CEX2C): %d/%d\n, service_rc, service_rs); zdev-online = 0; - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[GFS2] Detach buf data during in-place writeback
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0f8468c8bef3d04637c924e7bef20ca53018b319 Commit: 0f8468c8bef3d04637c924e7bef20ca53018b319 Parent: cee23c79d08c579923703409af3b17518c58 Author: Bob Peterson [EMAIL PROTECTED] AuthorDate: Wed Jul 25 10:06:22 2007 -0500 Committer: Steven Whitehouse [EMAIL PROTECTED] CommitDate: Wed Oct 10 08:55:01 2007 +0100 [GFS2] Detach buf data during in-place writeback This is patch 5 of 5 for bug #248176 Metadata corruption was occurring because page references weren't being removed in all cases. I previously added a function called detach_bufdata, but I discovered there already WAS a function out there to do the job. It's called gfs2_meta_cache_flush. So I added a call to that to remove the page references. Signed-off-by: Bob Peterson [EMAIL PROTECTED] Signed-off-by: Steven Whitehouse [EMAIL PROTECTED] --- fs/gfs2/log.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/fs/gfs2/log.c b/fs/gfs2/log.c index f7c0608..00ab6c0 100644 --- a/fs/gfs2/log.c +++ b/fs/gfs2/log.c @@ -219,6 +219,7 @@ static void gfs2_ail2_empty_one(struct gfs2_sbd *sdp, struct gfs2_ail *ai) { struct list_head *head = ai-ai_ail2_list; struct gfs2_bufdata *bd; + struct gfs2_inode *bh_ip; while (!list_empty(head)) { bd = list_entry(head-prev, struct gfs2_bufdata, @@ -228,6 +229,8 @@ static void gfs2_ail2_empty_one(struct gfs2_sbd *sdp, struct gfs2_ail *ai) list_del(bd-bd_ail_st_list); list_del(bd-bd_ail_gl_list); atomic_dec(bd-bd_gl-gl_ail_count); + bh_ip = GFS2_I(bd-bd_bh-b_page-mapping-host); + gfs2_meta_cache_flush(bh_ip); brelse(bd-bd_bh); } } - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[GFS2] invalid metadata block - REVISED
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5f3eae7546093d845ca8ada1b95714202a136a1a Commit: 5f3eae7546093d845ca8ada1b95714202a136a1a Parent: 8fbbfd214c853102b614f4705c1904ed14f5a808 Author: Bob Peterson [EMAIL PROTECTED] AuthorDate: Wed Aug 8 16:52:09 2007 -0500 Committer: Steven Whitehouse [EMAIL PROTECTED] CommitDate: Wed Oct 10 08:55:10 2007 +0100 [GFS2] invalid metadata block - REVISED This is for bugzilla bug #248176: GFS2: invalid metadata block Patches 1 thru 3 were accepted upstream, but there were problems with 4 and 5. Those issues have been resolved and now the recovery tests are passing without errors. This code has gone through 41 * 3 successful gfs2 recovery tests before it hit an unrelated (openais) problem. This is a complete rewrite of patch 4 for bug #248176. Part of the problem was that inodes were being recycled before their buffers were flushed to the journal logs. Another problem was that the clone bitmaps were being searched for deleted inodes to recycle, but only the real bitmaps should be searched for that purpose. Signed-off-by: Bob Peterson [EMAIL PROTECTED] Signed-off-by: Steven Whitehouse [EMAIL PROTECTED] --- fs/gfs2/rgrp.c |7 ++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/fs/gfs2/rgrp.c b/fs/gfs2/rgrp.c index b93ac45..2d7f7ea 100644 --- a/fs/gfs2/rgrp.c +++ b/fs/gfs2/rgrp.c @@ -865,12 +865,15 @@ static struct inode *try_rgrp_unlink(struct gfs2_rgrpd *rgd, u64 *last_unlinked) struct inode *inode; u32 goal = 0, block; u64 no_addr; + struct gfs2_sbd *sdp = rgd-rd_sbd; for(;;) { if (goal = rgd-rd_data) break; + down_write(sdp-sd_log_flush_lock); block = rgblk_search(rgd, goal, GFS2_BLKST_UNLINKED, GFS2_BLKST_UNLINKED); + up_write(sdp-sd_log_flush_lock); if (block == BFITNOENT) break; /* rgblk_search can return a block goal, so we need to @@ -1295,7 +1298,9 @@ static u32 rgblk_search(struct gfs2_rgrpd *rgd, u32 goal, allocatable block anywhere else, we want to be able wrap around and search in the first part of our first-searched bit block. */ for (x = 0; x = length; x++) { - if (bi-bi_clone) + /* The GFS2_BLKST_UNLINKED state doesn't apply to the clone + bitmaps, so we must search the originals for that. */ + if (old_state != GFS2_BLKST_UNLINKED bi-bi_clone) blk = gfs2_bitfit(rgd, bi-bi_clone + bi-bi_offset, bi-bi_len, goal, old_state); else - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[GFS2] Reduce number of gfs2_scand processes to one
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8fbbfd214c853102b614f4705c1904ed14f5a808 Commit: 8fbbfd214c853102b614f4705c1904ed14f5a808 Parent: ca5a939b33166a9f5a2556e6c4ec031524852ba2 Author: Steven Whitehouse [EMAIL PROTECTED] AuthorDate: Wed Aug 1 13:57:10 2007 +0100 Committer: Steven Whitehouse [EMAIL PROTECTED] CommitDate: Wed Oct 10 08:55:08 2007 +0100 [GFS2] Reduce number of gfs2_scand processes to one We only need a single gfs2_scand process rather than the one per filesystem which we had previously. As a result the parameter determining the frequency of gfs2_scand runs becomes a module parameter rather than a mount parameter as it was before. Signed-off-by: Steven Whitehouse [EMAIL PROTECTED] --- fs/gfs2/daemon.c | 24 --- fs/gfs2/daemon.h |1 - fs/gfs2/glock.c | 63 ++ fs/gfs2/glock.h |4 +- fs/gfs2/incore.h |2 - fs/gfs2/main.c |3 ++ fs/gfs2/ops_fstype.c |9 --- fs/gfs2/ops_super.c |1 - fs/gfs2/super.c |1 - fs/gfs2/sys.c|2 - 10 files changed, 53 insertions(+), 57 deletions(-) diff --git a/fs/gfs2/daemon.c b/fs/gfs2/daemon.c index 3548d9f..3731ab0 100644 --- a/fs/gfs2/daemon.c +++ b/fs/gfs2/daemon.c @@ -35,30 +35,6 @@ The kthread functions used to start these daemons block and flush signals. */ /** - * gfs2_scand - Look for cached glocks and inodes to toss from memory - * @sdp: Pointer to GFS2 superblock - * - * One of these daemons runs, finding candidates to add to sd_reclaim_list. - * See gfs2_glockd() - */ - -int gfs2_scand(void *data) -{ - struct gfs2_sbd *sdp = data; - unsigned long t; - - while (!kthread_should_stop()) { - gfs2_scand_internal(sdp); - t = gfs2_tune_get(sdp, gt_scand_secs) * HZ; - if (freezing(current)) - refrigerator(); - schedule_timeout_interruptible(t); - } - - return 0; -} - -/** * gfs2_glockd - Reclaim unused glock structures * @sdp: Pointer to GFS2 superblock * diff --git a/fs/gfs2/daemon.h b/fs/gfs2/daemon.h index 8010071..0de9b35 100644 --- a/fs/gfs2/daemon.h +++ b/fs/gfs2/daemon.h @@ -10,7 +10,6 @@ #ifndef __DAEMON_DOT_H__ #define __DAEMON_DOT_H__ -int gfs2_scand(void *data); int gfs2_glockd(void *data); int gfs2_recoverd(void *data); int gfs2_logd(void *data); diff --git a/fs/gfs2/glock.c b/fs/gfs2/glock.c index 0054b7d..559937c 100644 --- a/fs/gfs2/glock.c +++ b/fs/gfs2/glock.c @@ -25,6 +25,8 @@ #include asm/uaccess.h #include linux/seq_file.h #include linux/debugfs.h +#include linux/kthread.h +#include linux/freezer.h #include gfs2.h #include incore.h @@ -58,6 +60,8 @@ static void gfs2_glock_xmote_th(struct gfs2_glock *gl, struct gfs2_holder *gh); static void gfs2_glock_drop_th(struct gfs2_glock *gl); static DECLARE_RWSEM(gfs2_umount_flush_sem); static struct dentry *gfs2_root; +static struct task_struct *scand_process; +static unsigned int scand_secs = 5; #define GFS2_GL_HASH_SHIFT 15 #define GFS2_GL_HASH_SIZE (1 GFS2_GL_HASH_SHIFT) @@ -1627,7 +1631,7 @@ static int examine_bucket(glock_examiner examiner, struct gfs2_sbd *sdp, goto out; gl = list_entry(head-first, struct gfs2_glock, gl_list); while(1) { - if (gl-gl_sbd == sdp) { + if (!sdp || gl-gl_sbd == sdp) { gfs2_glock_hold(gl); read_unlock(gl_lock_addr(hash)); if (prev) @@ -1645,6 +1649,7 @@ out: read_unlock(gl_lock_addr(hash)); if (prev) gfs2_glock_put(prev); + cond_resched(); return has_entries; } @@ -1673,20 +1678,6 @@ out_schedule: } /** - * gfs2_scand_internal - Look for glocks and inodes to toss from memory - * @sdp: the filesystem - * - */ - -void gfs2_scand_internal(struct gfs2_sbd *sdp) -{ - unsigned int x; - - for (x = 0; x GFS2_GL_HASH_SIZE; x++) - examine_bucket(scan_glock, sdp, x); -} - -/** * clear_glock - look at a glock and see if we can free it from glock cache * @gl: the glock to look at * @@ -1973,6 +1964,35 @@ static int gfs2_dump_lockstate(struct gfs2_sbd *sdp) return error; } +/** + * gfs2_scand - Look for cached glocks and inodes to toss from memory + * @sdp: Pointer to GFS2 superblock + * + * One of these daemons runs, finding candidates to add to sd_reclaim_list. + * See gfs2_glockd() + */ + +static int gfs2_scand(void *data) +{ + unsigned x; + unsigned delay; + + while (!kthread_should_stop()) { + for (x = 0; x GFS2_GL_HASH_SIZE; x++) + examine_bucket(scan_glock, NULL, x); + if (freezing(current)) + refrigerator(); + delay = scand_secs; + if
[GFS2] Ensure journal file cache is flushed after recovery
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=75be73a8246ef96f7fa3f05a6a1450159fbb7a64 Commit: 75be73a8246ef96f7fa3f05a6a1450159fbb7a64 Parent: 5f3eae7546093d845ca8ada1b95714202a136a1a Author: Bob Peterson [EMAIL PROTECTED] AuthorDate: Wed Aug 8 17:08:14 2007 -0500 Committer: Steven Whitehouse [EMAIL PROTECTED] CommitDate: Wed Oct 10 08:55:12 2007 +0100 [GFS2] Ensure journal file cache is flushed after recovery This is for bugzilla bug #248176: GFS2: invalid metadata block Patches 1 thru 3 were accepted upstream, but there were problems with 4 and 5. Those issues have been resolved and now the recovery tests are passing without errors. This code has gone through 41 * 3 successful gfs2 recovery tests before it hit an unrelated (openais) problem. I'm continuing to test it. This is a complete rewrite of patch 5 for bug #248176, written by Steve Whitehouse. This is referred to in the bugzilla record as new 6 and a different solution. The problem was that the journal inodes, although protected by a glock, were not synched with the other nodes because they don't use the inode glock synch operations (i.e. no glops were defined). Therefore, journal recovery on a journal-recovering node were causing the blocks to get out of sync with the node that was actually trying to use that journal as it comes back up from a reboot. There are two possible solutions: (1) To make the journals use the normal inode glock sync operations, or (2) To make the journal operations take effect immediately (i.e. no caching). Although option 1 works, it turns out to be a lot more code. Steve opted for option 2, which is much simpler and therefore less prone to regression errors. Signed-off-by: Bob Peterson [EMAIL PROTECTED] Signed-off-by: Steven Whitehouse [EMAIL PROTECTED] -- --- fs/gfs2/ops_fstype.c |2 +- fs/gfs2/recovery.c |2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c index 58c730b..f0bcaa2 100644 --- a/fs/gfs2/ops_fstype.c +++ b/fs/gfs2/ops_fstype.c @@ -358,7 +358,7 @@ static int init_journal(struct gfs2_sbd *sdp, int undo) ip = GFS2_I(sdp-sd_jdesc-jd_inode); error = gfs2_glock_nq_init(ip-i_gl, LM_ST_SHARED, - LM_FLAG_NOEXP | GL_EXACT, + LM_FLAG_NOEXP | GL_EXACT | GL_NOCACHE, sdp-sd_jinode_gh); if (error) { fs_err(sdp, can't acquire journal inode glock: %d\n, diff --git a/fs/gfs2/recovery.c b/fs/gfs2/recovery.c index 5ada38c..beb6c7a 100644 --- a/fs/gfs2/recovery.c +++ b/fs/gfs2/recovery.c @@ -469,7 +469,7 @@ int gfs2_recover_journal(struct gfs2_jdesc *jd) }; error = gfs2_glock_nq_init(ip-i_gl, LM_ST_SHARED, - LM_FLAG_NOEXP, ji_gh); + LM_FLAG_NOEXP | GL_NOCACHE, ji_gh); if (error) goto fail_gunlock_j; } else { - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[GFS2] unneeded typecast
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2d3ba1ea97d839e60d742ccf9a6de5bf039c0b53 Commit: 2d3ba1ea97d839e60d742ccf9a6de5bf039c0b53 Parent: adb4ec13cdddb6ab8280e4c7808ba30f46504e1d Author: Denis Cheng [EMAIL PROTECTED] AuthorDate: Sat Aug 11 10:27:08 2007 +0800 Committer: Steven Whitehouse [EMAIL PROTECTED] CommitDate: Wed Oct 10 08:55:17 2007 +0100 [GFS2] unneeded typecast sb-s_fs_info is a void pointer, thus the type cast is not needed. Signed-off-by: Denis Cheng [EMAIL PROTECTED] Signed-off-by: Steven Whitehouse [EMAIL PROTECTED] --- fs/gfs2/ops_fstype.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c index 32b2859..25cfab9 100644 --- a/fs/gfs2/ops_fstype.c +++ b/fs/gfs2/ops_fstype.c @@ -849,7 +849,7 @@ static int gfs2_get_sb_meta(struct file_system_type *fs_type, int flags, error = -ENOENT; goto error; } - sdp = (struct gfs2_sbd*) sb-s_fs_info; + sdp = sb-s_fs_info; if (sdp-sd_vfs_meta) { printk(KERN_WARNING GFS2: gfs2meta mount already exists\n); error = -EBUSY; - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[GFS2] use list_for_each_entry instead
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=adb4ec13cdddb6ab8280e4c7808ba30f46504e1d Commit: adb4ec13cdddb6ab8280e4c7808ba30f46504e1d Parent: 75be73a8246ef96f7fa3f05a6a1450159fbb7a64 Author: Denis Cheng [EMAIL PROTECTED] AuthorDate: Sat Aug 11 10:27:07 2007 +0800 Committer: Steven Whitehouse [EMAIL PROTECTED] CommitDate: Wed Oct 10 08:55:15 2007 +0100 [GFS2] use list_for_each_entry instead Signed-off-by: Denis Cheng [EMAIL PROTECTED] Signed-off-by: Steven Whitehouse [EMAIL PROTECTED] --- fs/gfs2/ops_fstype.c |4 +--- 1 files changed, 1 insertions(+), 3 deletions(-) diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c index f0bcaa2..32b2859 100644 --- a/fs/gfs2/ops_fstype.c +++ b/fs/gfs2/ops_fstype.c @@ -808,7 +808,6 @@ static struct super_block* get_gfs2_sb(const char *dev_name) struct nameidata nd; struct file_system_type *fstype; struct super_block *sb = NULL, *s; - struct list_head *l; int error; error = path_lookup(dev_name, LOOKUP_FOLLOW, nd); @@ -820,8 +819,7 @@ static struct super_block* get_gfs2_sb(const char *dev_name) error = vfs_getattr(nd.mnt, nd.dentry, stat); fstype = get_fs_type(gfs2); - list_for_each(l, fstype-fs_supers) { - s = list_entry(l, struct super_block, s_instances); + list_for_each_entry(s, fstype-fs_supers, s_instances) { if ((S_ISBLK(stat.mode) s-s_dev == stat.rdev) || (S_ISDIR(stat.mode) s == nd.dentry-d_inode-i_sb)) { sb = s; - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[GFS2] Fix quota do_list operation hang
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2d9a4bbf6d28673f4057682cc02d16bf288b4a35 Commit: 2d9a4bbf6d28673f4057682cc02d16bf288b4a35 Parent: 34eaae398e29dadeed95efd30f1eb694e5932b34 Author: Abhijith Das [EMAIL PROTECTED] AuthorDate: Wed Aug 15 11:25:05 2007 -0500 Committer: Steven Whitehouse [EMAIL PROTECTED] CommitDate: Wed Oct 10 08:55:27 2007 +0100 [GFS2] Fix quota do_list operation hang This is the filesystem part of the patches to fix this bz. There are additional userland patches (gfs2_quota, libgfs2) for the complete solution. This patch adds a new field qu_ll_next to the gfs2_quota structure. This field allows us to create linked lists of quotas in the ondisk quota inode. Instead of scanning through the entire sparse quota file for valid quotas, we can now simply walk through the user and group quota linked lists to perform the do_list operation. Signed-off-by: Abhijith Das [EMAIL PROTECTED] Signed-off-by: Steven Whitehouse [EMAIL PROTECTED] --- fs/gfs2/quota.c |3 +++ include/linux/gfs2_ondisk.h | 30 +- 2 files changed, 32 insertions(+), 1 deletions(-) diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c index 5dfa465..addb51e 100644 --- a/fs/gfs2/quota.c +++ b/fs/gfs2/quota.c @@ -70,6 +70,7 @@ struct gfs2_quota_host { u64 qu_limit; u64 qu_warn; s64 qu_value; + u32 qu_ll_next; }; struct gfs2_quota_change_host { @@ -580,6 +581,7 @@ static void gfs2_quota_in(struct gfs2_quota_host *qu, const void *buf) qu-qu_limit = be64_to_cpu(str-qu_limit); qu-qu_warn = be64_to_cpu(str-qu_warn); qu-qu_value = be64_to_cpu(str-qu_value); + qu-qu_ll_next = be32_to_cpu(str-qu_ll_next); } static void gfs2_quota_out(const struct gfs2_quota_host *qu, void *buf) @@ -589,6 +591,7 @@ static void gfs2_quota_out(const struct gfs2_quota_host *qu, void *buf) str-qu_limit = cpu_to_be64(qu-qu_limit); str-qu_warn = cpu_to_be64(qu-qu_warn); str-qu_value = cpu_to_be64(qu-qu_value); + str-qu_ll_next = cpu_to_be32(qu-qu_ll_next); memset(str-qu_reserved, 0, sizeof(str-qu_reserved)); } diff --git a/include/linux/gfs2_ondisk.h b/include/linux/gfs2_ondisk.h index a44a6a0..c3c19f9 100644 --- a/include/linux/gfs2_ondisk.h +++ b/include/linux/gfs2_ondisk.h @@ -170,6 +170,33 @@ struct gfs2_rgrp { }; /* + * quota linked list: user quotas and group quotas form two separate + * singly linked lists. ll_next stores uids or gids of next quotas in the + * linked list. + +Given the uid/gid, how to calculate the quota file offsets for the corresponding +gfs2_quota structures on disk: + +for user quotas, given uid, +offset = uid * sizeof(struct gfs2_quota); + +for group quotas, given gid, +offset = (gid * sizeof(struct gfs2_quota)) + sizeof(struct gfs2_quota); + + + uid:0 gid:0 uid:12 gid:12 uid:17 gid:17 uid:5142 gid:5142 ++---+---++---+---++---+- - - -++- - - -+---+ +| valid | valid | :: | valid | valid | :: | valid | inval | :: | inval | valid | ++---+---++---+---++---+- - - -++- - - -+---+ +next:12 next:12next:17 next:5142next:NULL next:NULL +| || ||-- user quota list | + \__|___/ \__|___/ group quota list --| +|| | + \__/ \___/ + +*/ + +/* * quota structure */ @@ -177,7 +204,8 @@ struct gfs2_quota { __be64 qu_limit; __be64 qu_warn; __be64 qu_value; - __u8 qu_reserved[64]; + __be32 qu_ll_next; /* location of next quota in list */ + __u8 qu_reserved[60]; }; /* - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[GFS2] Add NULL entry to token table
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=9a5ad13856cbd10be429f09517c51277c02530f7 Commit: 9a5ad13856cbd10be429f09517c51277c02530f7 Parent: 382e6e256b0cb1a84a45a520cef75d1b8ff44663 Author: Benjamin Marzinski [EMAIL PROTECTED] AuthorDate: Fri Aug 17 20:22:07 2007 -0500 Committer: Steven Whitehouse [EMAIL PROTECTED] CommitDate: Wed Oct 10 08:55:34 2007 +0100 [GFS2] Add NULL entry to token table match_token() was returning garbage data instead of a fail value. This data happened to match a valid option id for an option that required an argument (in this case, lockproto=%s) For match_token() to correctly fail if the option doesn't match any of the tokens, the token table must end with a NULL entry. This patch adds the NULL entry. Signed-off-by: Benjamin E. Marzinski [EMAIL PROTECTED] Signed-off-by: Steven Whitehouse [EMAIL PROTECTED] --- fs/gfs2/mount.c |5 - 1 files changed, 4 insertions(+), 1 deletions(-) diff --git a/fs/gfs2/mount.c b/fs/gfs2/mount.c index 4864659..b941f9f 100644 --- a/fs/gfs2/mount.c +++ b/fs/gfs2/mount.c @@ -42,6 +42,7 @@ enum { Opt_nosuiddir, Opt_data_writeback, Opt_data_ordered, + Opt_err, }; static match_table_t tokens = { @@ -64,7 +65,8 @@ static match_table_t tokens = { {Opt_suiddir, suiddir}, {Opt_nosuiddir, nosuiddir}, {Opt_data_writeback, data=writeback}, - {Opt_data_ordered, data=ordered} + {Opt_data_ordered, data=ordered}, + {Opt_err, NULL} }; /** @@ -237,6 +239,7 @@ int gfs2_mount_args(struct gfs2_sbd *sdp, char *data_arg, int remount) case Opt_data_ordered: args-ar_data = GFS2_DATA_ORDERED; break; + case Opt_err: default: fs_info(sdp, unknown option: %s\n, o); error = -EINVAL; - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[GFS2] panic after can't parse mount arguments
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d1e2777d4f419a865ddccdb9b3412021d0e4de51 Commit: d1e2777d4f419a865ddccdb9b3412021d0e4de51 Parent: ec217e0ece60f2240772e6f08e0529775846c627 Author: Abhijith Das [EMAIL PROTECTED] AuthorDate: Thu Aug 23 13:33:01 2007 -0500 Committer: Steven Whitehouse [EMAIL PROTECTED] CommitDate: Wed Oct 10 08:55:46 2007 +0100 [GFS2] panic after can't parse mount arguments When you try to mount gfs2 with -o garbage, the mount fails and the gfs2 superblock is deallocated and becomes NULL. The vfs comes around later on and calls gfs2_kill_sb. At this point the hidden gfs2 superblock pointer (sb-s_fs_info) is NULL and dereferencing it through gfs2_meta_syncfs causes the panic. (the other function call to gfs2_delete_debugfs_file() succeeds because this function already checks for a NULL pointer) Signed-off-by: Abhijith Das [EMAIL PROTECTED] Signed-off-by: Steven Whitehouse [EMAIL PROTECTED] --- fs/gfs2/ops_fstype.c |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/gfs2/ops_fstype.c b/fs/gfs2/ops_fstype.c index 9e0e9be..314c113 100644 --- a/fs/gfs2/ops_fstype.c +++ b/fs/gfs2/ops_fstype.c @@ -887,8 +887,10 @@ error: static void gfs2_kill_sb(struct super_block *sb) { - gfs2_delete_debugfs_file(sb-s_fs_info); - gfs2_meta_syncfs(sb-s_fs_info); + if (sb-s_fs_info) { + gfs2_delete_debugfs_file(sb-s_fs_info); + gfs2_meta_syncfs(sb-s_fs_info); + } kill_block_super(sb); } - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[DLM] don't overwrite castparam if it's NULL
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b434eda6fda5bcdcc2dd918e5ffbf7184f2d4e17 Commit: b434eda6fda5bcdcc2dd918e5ffbf7184f2d4e17 Parent: 5a60c532c9224babc172fafccc9e2fec6937af6f Author: Patrick Caulfield [EMAIL PROTECTED] AuthorDate: Mon Oct 1 15:28:42 2007 +0100 Committer: Steven Whitehouse [EMAIL PROTECTED] CommitDate: Wed Oct 10 08:56:36 2007 +0100 [DLM] don't overwrite castparam if it's NULL If the castaddr passed to the userland API is NULL then don't overwrite the existing castparam. This allows a different thread to cancel a lock request and the CANCEL AST gets delivered to the original thread. bz#306391 (for RHEL4) refers. Signed-Off-By: Patrick Caulfield [EMAIL PROTECTED] Signed-off-by: Steven Whitehouse [EMAIL PROTECTED] --- fs/dlm/lock.c |6 -- 1 files changed, 4 insertions(+), 2 deletions(-) diff --git a/fs/dlm/lock.c b/fs/dlm/lock.c index 2082daf..031229f 100644 --- a/fs/dlm/lock.c +++ b/fs/dlm/lock.c @@ -4429,7 +4429,8 @@ int dlm_user_unlock(struct dlm_ls *ls, struct dlm_user_args *ua_tmp, if (lvb_in ua-lksb.sb_lvbptr) memcpy(ua-lksb.sb_lvbptr, lvb_in, DLM_USER_LVB_LEN); - ua-castparam = ua_tmp-castparam; + if (ua_tmp-castparam) + ua-castparam = ua_tmp-castparam; ua-user_lksb = ua_tmp-user_lksb; error = set_unlock_args(flags, ua, args); @@ -4474,7 +4475,8 @@ int dlm_user_cancel(struct dlm_ls *ls, struct dlm_user_args *ua_tmp, goto out; ua = (struct dlm_user_args *)lkb-lkb_astparam; - ua-castparam = ua_tmp-castparam; + if (ua_tmp-castparam) + ua-castparam = ua_tmp-castparam; ua-user_lksb = ua_tmp-user_lksb; error = set_unlock_args(flags, ua, args); - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[BLOCK] s390 xpram typo
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b018fc09498f73da0014b44acbd59ea4a94300b4 Commit: b018fc09498f73da0014b44acbd59ea4a94300b4 Parent: 99874d50481c093adfe74e796436024d88b6a48c Author: Jens Axboe [EMAIL PROTECTED] AuthorDate: Fri Oct 12 12:54:13 2007 +0200 Committer: Jens Axboe [EMAIL PROTECTED] CommitDate: Fri Oct 12 12:54:13 2007 +0200 [BLOCK] s390 xpram typo bio_end_io() should be bio_endio() Signed-off-by: Jens Axboe [EMAIL PROTECTED] --- drivers/s390/block/xpram.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/s390/block/xpram.c b/drivers/s390/block/xpram.c index 0fbacc8..f231bc2 100644 --- a/drivers/s390/block/xpram.c +++ b/drivers/s390/block/xpram.c @@ -230,7 +230,7 @@ static int xpram_make_request(struct request_queue *q, struct bio *bio) } } set_bit(BIO_UPTODATE, bio-bi_flags); - bio_end_io(bio, 0); + bio_endio(bio, 0); return 0; fail: bio_io_error(bio); - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[ISDN] HiSax sedlbauer: move ISAPNP and PCI code into functions of their own
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7da0d9801bd52a1d5e58eae85a3b9508b4a11ffb Commit: 7da0d9801bd52a1d5e58eae85a3b9508b4a11ffb Parent: 1e5d82e18b7204545737a5ef96bc34180a8df844 Author: Jeff Garzik [EMAIL PROTECTED] AuthorDate: Wed Oct 3 15:37:40 2007 -0400 Committer: Jeff Garzik [EMAIL PROTECTED] CommitDate: Fri Oct 12 09:16:49 2007 -0400 [ISDN] HiSax sedlbauer: move ISAPNP and PCI code into functions of their own Prep for hotplug API conversion. Just code movement (+glue). Signed-off-by: Jeff Garzik [EMAIL PROTECTED] --- drivers/isdn/hisax/sedlbauer.c | 276 +++- 1 files changed, 157 insertions(+), 119 deletions(-) diff --git a/drivers/isdn/hisax/sedlbauer.c b/drivers/isdn/hisax/sedlbauer.c index ad06f3c..03dfc32 100644 --- a/drivers/isdn/hisax/sedlbauer.c +++ b/drivers/isdn/hisax/sedlbauer.c @@ -518,8 +518,6 @@ Sedl_card_msg(struct IsdnCardState *cs, int mt, void *arg) return(0); } -static struct pci_dev *dev_sedl __devinitdata = NULL; - #ifdef __ISAPNP__ static struct isapnp_device_id sedl_ids[] __devinitdata = { { ISAPNP_VENDOR('S', 'A', 'G'), ISAPNP_FUNCTION(0x01), @@ -533,15 +531,158 @@ static struct isapnp_device_id sedl_ids[] __devinitdata = { static struct isapnp_device_id *ipid __devinitdata = sedl_ids[0]; static struct pnp_card *pnp_c __devinitdata = NULL; -#endif + +static int __devinit +setup_sedlbauer_isapnp(struct IsdnCard *card, int *bytecnt) +{ + struct IsdnCardState *cs = card-cs; + struct pnp_dev *pnp_d; + + if (!isapnp_present()) + return -1; + + while(ipid-card_vendor) { + if ((pnp_c = pnp_find_card(ipid-card_vendor, + ipid-card_device, pnp_c))) { + pnp_d = NULL; + if ((pnp_d = pnp_find_dev(pnp_c, + ipid-vendor, ipid-function, pnp_d))) { + int err; + + printk(KERN_INFO HiSax: %s detected\n, + (char *)ipid-driver_data); + pnp_disable_dev(pnp_d); + err = pnp_activate_dev(pnp_d); + if (err0) { + printk(KERN_WARNING %s: pnp_activate_dev ret(%d)\n, + __FUNCTION__, err); + return(0); + } + card-para[1] = pnp_port_start(pnp_d, 0); + card-para[0] = pnp_irq(pnp_d, 0); + + if (!card-para[0] || !card-para[1]) { + printk(KERN_ERR Sedlbauer PnP:some resources are missing %ld/%lx\n, + card-para[0], card-para[1]); + pnp_disable_dev(pnp_d); + return(0); + } + cs-hw.sedl.cfg_reg = card-para[1]; + cs-irq = card-para[0]; + if (ipid-function == ISAPNP_FUNCTION(0x2)) { + cs-subtyp = SEDL_SPEED_FAX; + cs-hw.sedl.chip = SEDL_CHIP_ISAC_ISAR; + *bytecnt = 16; + } else { + cs-subtyp = SEDL_SPEED_CARD_WIN; + cs-hw.sedl.chip = SEDL_CHIP_TEST; + } + + return (1); + } else { + printk(KERN_ERR Sedlbauer PnP: PnP error card found, no device\n); + return(0); + } + } + ipid++; + pnp_c = NULL; + } + + printk(KERN_INFO Sedlbauer PnP: no ISAPnP card found\n); + return -1; +} +#else + +static int __devinit +setup_sedlbauer_isapnp(struct IsdnCard *card, int *bytecnt) +{ + return -1; +} +#endif /* __ISAPNP__ */ + +#ifdef CONFIG_PCI +static struct pci_dev *dev_sedl __devinitdata = NULL; + +static int __devinit +setup_sedlbauer_pci(struct IsdnCard *card) +{ + struct IsdnCardState *cs = card-cs; + u16 sub_vendor_id, sub_id; + + if ((dev_sedl = pci_find_device(PCI_VENDOR_ID_TIGERJET, + PCI_DEVICE_ID_TIGERJET_100, dev_sedl))) { + if (pci_enable_device(dev_sedl)) + return(0); + cs-irq = dev_sedl-irq; + if (!cs-irq) { + printk(KERN_WARNING Sedlbauer: No IRQ for PCI card found\n); + return(0); + } + cs-hw.sedl.cfg_reg
[ISDN] HiSax diva: split setup into three smaller functions
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4b5a9b3d8e857249f2670f4419ce764be02e11db Commit: 4b5a9b3d8e857249f2670f4419ce764be02e11db Parent: 7da0d9801bd52a1d5e58eae85a3b9508b4a11ffb Author: Jeff Garzik [EMAIL PROTECTED] AuthorDate: Wed Oct 3 15:47:00 2007 -0400 Committer: Jeff Garzik [EMAIL PROTECTED] CommitDate: Fri Oct 12 09:16:49 2007 -0400 [ISDN] HiSax diva: split setup into three smaller functions Just code movement, and the glue to call the new functions. Preparation for hotplug APIs. Signed-off-by: Jeff Garzik [EMAIL PROTECTED] --- drivers/isdn/hisax/diva.c | 513 ++--- 1 files changed, 294 insertions(+), 219 deletions(-) diff --git a/drivers/isdn/hisax/diva.c b/drivers/isdn/hisax/diva.c index 6eebeb4..8267450 100644 --- a/drivers/isdn/hisax/diva.c +++ b/drivers/isdn/hisax/diva.c @@ -25,8 +25,6 @@ #include linux/pci.h #include linux/isapnp.h -extern const char *CardType[]; - static const char *Diva_revision = $Revision: 1.33.2.6 $; #define byteout(addr,val) outb(val,addr) @@ -906,225 +904,15 @@ Diva_card_msg(struct IsdnCardState *cs, int mt, void *arg) return(0); } -static struct pci_dev *dev_diva __devinitdata = NULL; -static struct pci_dev *dev_diva_u __devinitdata = NULL; -static struct pci_dev *dev_diva201 __devinitdata = NULL; -static struct pci_dev *dev_diva202 __devinitdata = NULL; - -#ifdef __ISAPNP__ -static struct isapnp_device_id diva_ids[] __devinitdata = { - { ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0x51), - ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0x51), - (unsigned long) Diva picola }, - { ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0x51), - ISAPNP_VENDOR('E', 'I', 'C'), ISAPNP_FUNCTION(0x51), - (unsigned long) Diva picola }, - { ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0x71), - ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0x71), - (unsigned long) Diva 2.0 }, - { ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0x71), - ISAPNP_VENDOR('E', 'I', 'C'), ISAPNP_FUNCTION(0x71), - (unsigned long) Diva 2.0 }, - { ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0xA1), - ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0xA1), - (unsigned long) Diva 2.01 }, - { ISAPNP_VENDOR('G', 'D', 'I'), ISAPNP_FUNCTION(0xA1), - ISAPNP_VENDOR('E', 'I', 'C'), ISAPNP_FUNCTION(0xA1), - (unsigned long) Diva 2.01 }, - { 0, } -}; - -static struct isapnp_device_id *ipid __devinitdata = diva_ids[0]; -static struct pnp_card *pnp_c __devinitdata = NULL; -#endif - - -int __devinit -setup_diva(struct IsdnCard *card) +static int __devinit setup_diva_common(struct IsdnCardState *cs) { - int bytecnt = 8; + int bytecnt; u_char val; - struct IsdnCardState *cs = card-cs; - char tmp[64]; - - strcpy(tmp, Diva_revision); - printk(KERN_INFO HiSax: Eicon.Diehl Diva driver Rev. %s\n, HiSax_getrev(tmp)); - if (cs-typ != ISDN_CTYPE_DIEHLDIVA) - return(0); - cs-hw.diva.status = 0; - if (card-para[1]) { - cs-hw.diva.ctrl_reg = 0; - cs-hw.diva.cfg_reg = card-para[1]; - val = readreg(cs-hw.diva.cfg_reg + DIVA_IPAC_ADR, - cs-hw.diva.cfg_reg + DIVA_IPAC_DATA, IPAC_ID); - printk(KERN_INFO Diva: IPAC version %x\n, val); - if ((val == 1) || (val==2)) { - cs-subtyp = DIVA_IPAC_ISA; - cs-hw.diva.ctrl = 0; - cs-hw.diva.isac = card-para[1] + DIVA_IPAC_DATA; - cs-hw.diva.hscx = card-para[1] + DIVA_IPAC_DATA; - cs-hw.diva.isac_adr = card-para[1] + DIVA_IPAC_ADR; - cs-hw.diva.hscx_adr = card-para[1] + DIVA_IPAC_ADR; - test_and_set_bit(HW_IPAC, cs-HW_Flags); - } else { - cs-subtyp = DIVA_ISA; - cs-hw.diva.ctrl = card-para[1] + DIVA_ISA_CTRL; - cs-hw.diva.isac = card-para[1] + DIVA_ISA_ISAC_DATA; - cs-hw.diva.hscx = card-para[1] + DIVA_HSCX_DATA; - cs-hw.diva.isac_adr = card-para[1] + DIVA_ISA_ISAC_ADR; - cs-hw.diva.hscx_adr = card-para[1] + DIVA_HSCX_ADR; - } - cs-irq = card-para[0]; - } else { -#ifdef __ISAPNP__ - if (isapnp_present()) { - struct pnp_dev *pnp_d; - while(ipid-card_vendor) { - if ((pnp_c = pnp_find_card(ipid-card_vendor, - ipid-card_device, pnp_c))) { - pnp_d = NULL; - if ((pnp_d = pnp_find_dev(pnp_c, -
[BNX2]: Refine napi poll loop.
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6dee6421581d3484e9a01d403dbf158161942db6 Commit: 6dee6421581d3484e9a01d403dbf158161942db6 Parent: 4fd7ab5949edfdf99be0ceef206c9d0b7f186318 Author: Michael Chan [EMAIL PROTECTED] AuthorDate: Fri Oct 12 01:40:38 2007 -0700 Committer: David S. Miller [EMAIL PROTECTED] CommitDate: Fri Oct 12 02:01:21 2007 -0700 [BNX2]: Refine napi poll loop. Need to read and store sblk-status_idx before checking for more work. The status idx is later written back to the hardware when enabling interrupts to acknowledge how much work has been processed. If the order is reversed, we can end up acknowledging work we haven't processed. When completing bnx2_poll(), we should always break out of the while loop and return work_done instead of returning 0. Signed-off-by: Michael Chan [EMAIL PROTECTED] Signed-off-by: David S. Miller [EMAIL PROTECTED] --- drivers/net/bnx2.c | 16 ++-- 1 files changed, 10 insertions(+), 6 deletions(-) diff --git a/drivers/net/bnx2.c b/drivers/net/bnx2.c index d68acce..78ed633 100644 --- a/drivers/net/bnx2.c +++ b/drivers/net/bnx2.c @@ -2652,10 +2652,10 @@ static int bnx2_poll_work(struct bnx2 *bp, int work_done, int budget) REG_RD(bp, BNX2_HC_COMMAND); } - if (bp-status_blk-status_tx_quick_consumer_index0 != bp-hw_tx_cons) + if (sblk-status_tx_quick_consumer_index0 != bp-hw_tx_cons) bnx2_tx_int(bp); - if (bp-status_blk-status_rx_quick_consumer_index0 != bp-hw_rx_cons) + if (sblk-status_rx_quick_consumer_index0 != bp-hw_rx_cons) work_done += bnx2_rx_int(bp, budget - work_done); return work_done; @@ -2665,6 +2665,7 @@ static int bnx2_poll(struct napi_struct *napi, int budget) { struct bnx2 *bp = container_of(napi, struct bnx2, napi); int work_done = 0; + struct status_block *sblk = bp-status_blk; while (1) { work_done = bnx2_poll_work(bp, work_done, budget); @@ -2672,16 +2673,19 @@ static int bnx2_poll(struct napi_struct *napi, int budget) if (unlikely(work_done = budget)) break; + /* bp-last_status_idx is used below to tell the hw how +* much work has been processed, so we must read it before +* checking for more work. +*/ + bp-last_status_idx = sblk-status_idx; + rmb(); if (likely(!bnx2_has_work(bp))) { - bp-last_status_idx = bp-status_blk-status_idx; - rmb(); - netif_rx_complete(bp-dev, napi); if (likely(bp-flags USING_MSI_FLAG)) { REG_WR(bp, BNX2_PCICFG_INT_ACK_CMD, BNX2_PCICFG_INT_ACK_CMD_INDEX_VALID | bp-last_status_idx); - return 0; + break; } REG_WR(bp, BNX2_PCICFG_INT_ACK_CMD, BNX2_PCICFG_INT_ACK_CMD_INDEX_VALID | - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
ocfs2: remove mostly unused field from insert structure
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c77534f6fb6d58e27d923b6825ea3b0ef485ab26 Commit: c77534f6fb6d58e27d923b6825ea3b0ef485ab26 Parent: 782e3b3b3804c38d5130c7f21d7ec7bf6709023f Author: Tao Mao [EMAIL PROTECTED] AuthorDate: Tue Aug 28 17:22:33 2007 -0700 Committer: Mark Fasheh [EMAIL PROTECTED] CommitDate: Fri Oct 12 11:54:32 2007 -0700 ocfs2: remove mostly unused field from insert structure ocfs2_insert_type-ins_free_records was only used in one place, and was set incorrectly in most places. We can free up some memory and lose some code by removing this. * Small warning fixup contributed by Andrew Mortom [EMAIL PROTECTED] Signed-off-by: Tao Mao [EMAIL PROTECTED] Signed-off-by: Mark Fasheh [EMAIL PROTECTED] --- fs/ocfs2/alloc.c | 29 ++--- 1 files changed, 6 insertions(+), 23 deletions(-) diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c index 778a850..33d5cab 100644 --- a/fs/ocfs2/alloc.c +++ b/fs/ocfs2/alloc.c @@ -354,7 +354,6 @@ struct ocfs2_insert_type { enum ocfs2_append_type ins_appending; enum ocfs2_contig_type ins_contig; int ins_contig_index; - int ins_free_records; int ins_tree_depth; }; @@ -3593,6 +3592,7 @@ static int ocfs2_figure_insert_type(struct inode *inode, struct buffer_head *di_bh, struct buffer_head **last_eb_bh, struct ocfs2_extent_rec *insert_rec, + int *free_records, struct ocfs2_insert_type *insert) { int ret; @@ -3633,7 +3633,7 @@ static int ocfs2_figure_insert_type(struct inode *inode, * XXX: This test is simplistic, we can search for empty * extent records too. */ - insert-ins_free_records = le16_to_cpu(el-l_count) - + *free_records = le16_to_cpu(el-l_count) - le16_to_cpu(el-l_next_free_rec); if (!insert-ins_tree_depth) { @@ -3730,6 +3730,7 @@ int ocfs2_insert_extent(struct ocfs2_super *osb, struct ocfs2_alloc_context *meta_ac) { int status; + int uninitialized_var(free_records); struct buffer_head *last_eb_bh = NULL; struct ocfs2_insert_type insert = {0, }; struct ocfs2_extent_rec rec; @@ -3752,7 +3753,7 @@ int ocfs2_insert_extent(struct ocfs2_super *osb, rec.e_flags = flags; status = ocfs2_figure_insert_type(inode, fe_bh, last_eb_bh, rec, - insert); + free_records, insert); if (status 0) { mlog_errno(status); goto bail; @@ -3762,9 +3763,9 @@ int ocfs2_insert_extent(struct ocfs2_super *osb, Insert.contig_index: %d, Insert.free_records: %d, Insert.tree_depth: %d\n, insert.ins_appending, insert.ins_contig, insert.ins_contig_index, -insert.ins_free_records, insert.ins_tree_depth); +free_records, insert.ins_tree_depth); - if (insert.ins_contig == CONTIG_NONE insert.ins_free_records == 0) { + if (insert.ins_contig == CONTIG_NONE free_records == 0) { status = ocfs2_grow_tree(inode, handle, fe_bh, insert.ins_tree_depth, last_eb_bh, meta_ac); @@ -3847,26 +3848,17 @@ leftright: if (le16_to_cpu(rightmost_el-l_next_free_rec) == le16_to_cpu(rightmost_el-l_count)) { - int old_depth = depth; - ret = ocfs2_grow_tree(inode, handle, di_bh, depth, last_eb_bh, meta_ac); if (ret) { mlog_errno(ret); goto out; } - - if (old_depth != depth) { - eb = (struct ocfs2_extent_block *)(*last_eb_bh)-b_data; - rightmost_el = eb-h_list; - } } memset(insert, 0, sizeof(struct ocfs2_insert_type)); insert.ins_appending = APPEND_NONE; insert.ins_contig = CONTIG_NONE; - insert.ins_free_records = le16_to_cpu(rightmost_el-l_count) - - le16_to_cpu(rightmost_el-l_next_free_rec); insert.ins_tree_depth = depth; insert_range = le32_to_cpu(split_rec.e_cpos) + @@ -4180,27 +4172,18 @@ static int ocfs2_split_tree(struct inode *inode, struct buffer_head *di_bh, if (le16_to_cpu(rightmost_el-l_next_free_rec) == le16_to_cpu(rightmost_el-l_count)) { - int old_depth = depth; - ret = ocfs2_grow_tree(inode, handle, di_bh, depth, last_eb_bh, meta_ac); if (ret) {
ocfs2: remove unused variable
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=518d7269f3c9129ae51d5f804edff998ab945a40 Commit: 518d7269f3c9129ae51d5f804edff998ab945a40 Parent: c77534f6fb6d58e27d923b6825ea3b0ef485ab26 Author: Tao Mao [EMAIL PROTECTED] AuthorDate: Tue Aug 28 17:25:35 2007 -0700 Committer: Mark Fasheh [EMAIL PROTECTED] CommitDate: Fri Oct 12 11:54:32 2007 -0700 ocfs2: remove unused variable delete_tail_recs in ocfs2_try_to_merge_extent() was only ever set, remove it. Signed-off-by: Tao Mao [EMAIL PROTECTED] Signed-off-by: Mark Fasheh [EMAIL PROTECTED] --- fs/ocfs2/alloc.c | 40 1 files changed, 16 insertions(+), 24 deletions(-) diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c index 33d5cab..c078b3b 100644 --- a/fs/ocfs2/alloc.c +++ b/fs/ocfs2/alloc.c @@ -2807,36 +2807,28 @@ static int ocfs2_try_to_merge_extent(struct inode *inode, struct ocfs2_merge_ctxt *ctxt) { - int ret = 0, delete_tail_recs = 0; + int ret = 0; struct ocfs2_extent_list *el = path_leaf_el(left_path); struct ocfs2_extent_rec *rec = el-l_recs[split_index]; BUG_ON(ctxt-c_contig_type == CONTIG_NONE); - if (ctxt-c_split_covers_rec) { - delete_tail_recs++; - - if (ctxt-c_contig_type == CONTIG_LEFTRIGHT || - ctxt-c_has_empty_extent) - delete_tail_recs++; - - if (ctxt-c_has_empty_extent) { - /* -* The merge code will need to create an empty -* extent to take the place of the newly -* emptied slot. Remove any pre-existing empty -* extents - having more than one in a leaf is -* illegal. -*/ - ret = ocfs2_rotate_tree_left(inode, handle, left_path, -dealloc); - if (ret) { - mlog_errno(ret); - goto out; - } - split_index--; - rec = el-l_recs[split_index]; + if (ctxt-c_split_covers_rec ctxt-c_has_empty_extent) { + /* +* The merge code will need to create an empty +* extent to take the place of the newly +* emptied slot. Remove any pre-existing empty +* extents - having more than one in a leaf is +* illegal. +*/ + ret = ocfs2_rotate_tree_left(inode, handle, left_path, +dealloc); + if (ret) { + mlog_errno(ret); + goto out; } + split_index--; + rec = el-l_recs[split_index]; } if (ctxt-c_contig_type == CONTIG_LEFTRIGHT) { - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
ocfs2: Remove unused structure field
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=015452b15ff6c2d9fa1f82f28d61e7a66e2df86a Commit: 015452b15ff6c2d9fa1f82f28d61e7a66e2df86a Parent: 518d7269f3c9129ae51d5f804edff998ab945a40 Author: Mark Fasheh [EMAIL PROTECTED] AuthorDate: Wed Sep 12 10:21:22 2007 -0700 Committer: Mark Fasheh [EMAIL PROTECTED] CommitDate: Fri Oct 12 11:54:32 2007 -0700 ocfs2: Remove unused structure field c_used_tail_recs in struct ocfs2_merge_ctxt is only ever set, so we can remove it. Signed-off-by: Mark Fasheh [EMAIL PROTECTED] --- fs/ocfs2/alloc.c | 13 +++-- 1 files changed, 3 insertions(+), 10 deletions(-) diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c index c078b3b..c91706f 100644 --- a/fs/ocfs2/alloc.c +++ b/fs/ocfs2/alloc.c @@ -361,7 +361,6 @@ struct ocfs2_merge_ctxt { enum ocfs2_contig_type c_contig_type; int c_has_empty_extent; int c_split_covers_rec; - int c_used_tail_recs; }; /* @@ -3999,11 +3998,6 @@ static int __ocfs2_mark_extent_written(struct inode *inode, } else rightmost_el = path_root_el(path); - ctxt.c_used_tail_recs = le16_to_cpu(rightmost_el-l_next_free_rec); - if (ctxt.c_used_tail_recs 0 - ocfs2_is_empty_extent(rightmost_el-l_recs[0])) - ctxt.c_used_tail_recs--; - if (rec-e_cpos == split_rec-e_cpos rec-e_leaf_clusters == split_rec-e_leaf_clusters) ctxt.c_split_covers_rec = 1; @@ -4012,10 +4006,9 @@ static int __ocfs2_mark_extent_written(struct inode *inode, ctxt.c_has_empty_extent = ocfs2_is_empty_extent(el-l_recs[0]); - mlog(0, index: %d, contig: %u, used_tail_recs: %u, -has_empty: %u, split_covers: %u\n, split_index, -ctxt.c_contig_type, ctxt.c_used_tail_recs, -ctxt.c_has_empty_extent, ctxt.c_split_covers_rec); + mlog(0, index: %d, contig: %u, has_empty: %u, split_covers: %u\n, +split_index, ctxt.c_contig_type, ctxt.c_has_empty_extent, +ctxt.c_split_covers_rec); if (ctxt.c_contig_type == CONTIG_NONE) { if (ctxt.c_split_covers_rec) - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] fs/ocfs2/: removed unneeded initial value and function's return value
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=bddb8eb37f1460fc19e1af16010c9ad4ca3717a6 Commit: bddb8eb37f1460fc19e1af16010c9ad4ca3717a6 Parent: d550071c03f129a60dfad60d23dab73f894129a9 Author: Denis Cheng [EMAIL PROTECTED] AuthorDate: Thu Sep 27 02:10:04 2007 +0800 Committer: Mark Fasheh [EMAIL PROTECTED] CommitDate: Fri Oct 12 11:54:34 2007 -0700 [PATCH] fs/ocfs2/: removed unneeded initial value and function's return value Signed-off-by: Denis Cheng [EMAIL PROTECTED] Signed-off-by: Mark Fasheh [EMAIL PROTECTED] --- fs/ocfs2/super.c | 17 - 1 files changed, 8 insertions(+), 9 deletions(-) diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index e5ac071..0e2a1b4 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c @@ -107,7 +107,7 @@ static int ocfs2_sync_fs(struct super_block *sb, int wait); static int ocfs2_init_global_system_inodes(struct ocfs2_super *osb); static int ocfs2_init_local_system_inodes(struct ocfs2_super *osb); -static int ocfs2_release_system_inodes(struct ocfs2_super *osb); +static void ocfs2_release_system_inodes(struct ocfs2_super *osb); static int ocfs2_fill_local_node_info(struct ocfs2_super *osb); static int ocfs2_check_volume(struct ocfs2_super *osb); static int ocfs2_verify_volume(struct ocfs2_dinode *di, @@ -180,7 +180,7 @@ static void ocfs2_write_super(struct super_block *sb) static int ocfs2_sync_fs(struct super_block *sb, int wait) { - int status = 0; + int status; tid_t target; struct ocfs2_super *osb = OCFS2_SB(sb); @@ -278,9 +278,9 @@ bail: return status; } -static int ocfs2_release_system_inodes(struct ocfs2_super *osb) +static void ocfs2_release_system_inodes(struct ocfs2_super *osb) { - int status = 0, i; + int i; struct inode *inode; mlog_entry_void(); @@ -305,8 +305,7 @@ static int ocfs2_release_system_inodes(struct ocfs2_super *osb) osb-root_inode = NULL; } - mlog_exit(status); - return status; + mlog_exit(0); } /* We're allocating fs objects, use GFP_NOFS */ @@ -456,7 +455,7 @@ static int ocfs2_sb_probe(struct super_block *sb, struct buffer_head **bh, int *sector_size) { - int status = 0, tmpstat; + int status, tmpstat; struct ocfs1_vol_disk_hdr *hdr; struct ocfs2_dinode *di; int blksize; @@ -1314,7 +1313,7 @@ static int ocfs2_initialize_super(struct super_block *sb, struct buffer_head *bh, int sector_size) { - int status = 0; + int status; int i, cbits, bbits; struct ocfs2_dinode *di = (struct ocfs2_dinode *)bh-b_data; struct inode *inode = NULL; @@ -1635,7 +1634,7 @@ static int ocfs2_verify_volume(struct ocfs2_dinode *di, static int ocfs2_check_volume(struct ocfs2_super *osb) { - int status = 0; + int status; int dirty; int local; struct ocfs2_dinode *local_alloc = NULL; /* only used if we - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
ocfs2: Implement show_options()
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d550071c03f129a60dfad60d23dab73f894129a9 Commit: d550071c03f129a60dfad60d23dab73f894129a9 Parent: 19b613d41051296be628581e7e21b847e9eaba80 Author: Sunil Mushran [EMAIL PROTECTED] AuthorDate: Thu Sep 6 13:34:16 2007 -0700 Committer: Mark Fasheh [EMAIL PROTECTED] CommitDate: Fri Oct 12 11:54:33 2007 -0700 ocfs2: Implement show_options() Implement sops-show_options() so as to allow /proc/mounts to show the mount options. Signed-off-by: Sunil Mushran [EMAIL PROTECTED] Signed-off-by: Mark Fasheh [EMAIL PROTECTED] --- fs/ocfs2/super.c | 38 ++ 1 files changed, 38 insertions(+), 0 deletions(-) diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index 19436d1..e5ac071 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c @@ -39,6 +39,7 @@ #include linux/parser.h #include linux/crc32.h #include linux/debugfs.h +#include linux/mount.h #include cluster/nodemanager.h @@ -91,6 +92,7 @@ struct mount_options static int ocfs2_parse_options(struct super_block *sb, char *options, struct mount_options *mopt, int is_remount); +static int ocfs2_show_options(struct seq_file *s, struct vfsmount *mnt); static void ocfs2_put_super(struct super_block *sb); static int ocfs2_mount_volume(struct super_block *sb); static int ocfs2_remount(struct super_block *sb, int *flags, char *data); @@ -133,6 +135,7 @@ static const struct super_operations ocfs2_sops = { .write_super= ocfs2_write_super, .put_super = ocfs2_put_super, .remount_fs = ocfs2_remount, + .show_options = ocfs2_show_options, }; enum { @@ -830,6 +833,41 @@ bail: return status; } +static int ocfs2_show_options(struct seq_file *s, struct vfsmount *mnt) +{ + struct ocfs2_super *osb = OCFS2_SB(mnt-mnt_sb); + unsigned long opts = osb-s_mount_opt; + + if (opts OCFS2_MOUNT_HB_LOCAL) + seq_printf(s, ,_netdev,heartbeat=local); + else + seq_printf(s, ,heartbeat=none); + + if (opts OCFS2_MOUNT_NOINTR) + seq_printf(s, ,nointr); + + if (opts OCFS2_MOUNT_DATA_WRITEBACK) + seq_printf(s, ,data=writeback); + else + seq_printf(s, ,data=ordered); + + if (opts OCFS2_MOUNT_BARRIER) + seq_printf(s, ,barrier=1); + + if (opts OCFS2_MOUNT_ERRORS_PANIC) + seq_printf(s, ,errors=panic); + else + seq_printf(s, ,errors=remount-ro); + + if (osb-preferred_slot != OCFS2_INVALID_SLOT) + seq_printf(s, ,preferred_slot=%d, osb-preferred_slot); + + if (osb-s_atime_quantum != OCFS2_DEFAULT_ATIME_QUANTUM) + seq_printf(s, ,atime_quantum=%u, osb-s_atime_quantum); + + return 0; +} + static int __init ocfs2_init(void) { int status; - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
ocfs2: Sync ocfs2_fs.h with ocfs2-tools
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=92e91ce2a30b2af53ebf077512801dc01e75cca5 Commit: 92e91ce2a30b2af53ebf077512801dc01e75cca5 Parent: bddb8eb37f1460fc19e1af16010c9ad4ca3717a6 Author: Mark Fasheh [EMAIL PROTECTED] AuthorDate: Thu Sep 20 11:19:20 2007 -0700 Committer: Mark Fasheh [EMAIL PROTECTED] CommitDate: Fri Oct 12 11:54:34 2007 -0700 ocfs2: Sync ocfs2_fs.h with ocfs2-tools ocfs2-tools added some on-disk fields and flags which are used by tunefs.ocfs2. Signed-off-by: Mark Fasheh [EMAIL PROTECTED] --- fs/ocfs2/ocfs2_fs.h | 20 ++-- 1 files changed, 18 insertions(+), 2 deletions(-) diff --git a/fs/ocfs2/ocfs2_fs.h b/fs/ocfs2/ocfs2_fs.h index 82f8a75..bf10a54 100644 --- a/fs/ocfs2/ocfs2_fs.h +++ b/fs/ocfs2/ocfs2_fs.h @@ -111,6 +111,17 @@ #define OCFS2_FEATURE_INCOMPAT_SPARSE_ALLOC0x0010 /* + * Tunefs sets this incompat flag before starting an operation which + * would require cleanup on abort. This is done to protect users from + * inadvertently mounting the fs after an aborted run without + * fsck-ing. + * + * s_tunefs_flags on the super block describes precisely which + * operations were in progress. + */ +#define OCFS2_FEATURE_INCOMPAT_TUNEFS_INPROG 0x0020 + +/* * backup superblock flag is used to indicate that this volume * has backup superblocks. */ @@ -130,6 +141,11 @@ #define OCFS2_MAX_BACKUP_SUPERBLOCKS 6 /* + * Flags on ocfs2_super_block.s_tunefs_flags + */ +#define OCFS2_TUNEFS_INPROG_REMOVE_SLOT0x0001 /* Removing slots */ + +/* * Flags on ocfs2_dinode.i_flags */ #define OCFS2_VALID_FL (0x0001)/* Inode is valid */ @@ -447,8 +463,8 @@ struct ocfs2_super_block { __le32 s_clustersize_bits; /* Clustersize for this fs */ /*40*/ __le16 s_max_slots; /* Max number of simultaneous mounts before tunefs required */ - __le16 s_reserved1; - __le32 s_reserved2; + __le16 s_tunefs_flag; + __le32 s_reserved1; __le64 s_first_cluster_group; /* Block offset of 1st cluster * group header */ /*50*/ __u8 s_label[OCFS2_MAX_VOL_LABEL_LEN]; /* Label for mounting, etc. */ - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
ocfs2: move nonsparse hole-filling into ocfs2_write_begin()
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=65ed39d6ca78f07d2958814e08440e4264b6b488 Commit: 65ed39d6ca78f07d2958814e08440e4264b6b488 Parent: 92e91ce2a30b2af53ebf077512801dc01e75cca5 Author: Mark Fasheh [EMAIL PROTECTED] AuthorDate: Tue Aug 28 17:13:23 2007 -0700 Committer: Mark Fasheh [EMAIL PROTECTED] CommitDate: Fri Oct 12 11:54:35 2007 -0700 ocfs2: move nonsparse hole-filling into ocfs2_write_begin() By doing this, we can remove any higher level logic which has to have knowledge of btree functionality - any callers of ocfs2_write_begin() can now expect it to do anything necessary to prepare the inode for new data. Signed-off-by: Mark Fasheh [EMAIL PROTECTED] Reviewed-by: Joel Becker [EMAIL PROTECTED] --- fs/ocfs2/aops.c | 40 +- fs/ocfs2/file.c | 217 --- fs/ocfs2/file.h |2 + 3 files changed, 115 insertions(+), 144 deletions(-) diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c index f37f25c..fae0767 100644 --- a/fs/ocfs2/aops.c +++ b/fs/ocfs2/aops.c @@ -301,12 +301,8 @@ int ocfs2_prepare_write_nolock(struct inode *inode, struct page *page, { int ret; - down_read(OCFS2_I(inode)-ip_alloc_sem); - ret = block_prepare_write(page, from, to, ocfs2_get_block); - up_read(OCFS2_I(inode)-ip_alloc_sem); - return ret; } @@ -1360,6 +1356,36 @@ out: return ret; } +/* + * This function only does anything for file systems which can't + * handle sparse files. + * + * What we want to do here is fill in any hole between the current end + * of allocation and the end of our write. That way the rest of the + * write path can treat it as an non-allocating write, which has no + * special case code for sparse/nonsparse files. + */ +static int ocfs2_expand_nonsparse_inode(struct inode *inode, loff_t pos, + unsigned len, + struct ocfs2_write_ctxt *wc) +{ + int ret; + struct ocfs2_super *osb = OCFS2_SB(inode-i_sb); + loff_t newsize = pos + len; + + if (ocfs2_sparse_alloc(osb)) + return 0; + + if (newsize = i_size_read(inode)) + return 0; + + ret = ocfs2_extend_no_holes(inode, newsize, newsize - len); + if (ret) + mlog_errno(ret); + + return ret; +} + int ocfs2_write_begin_nolock(struct address_space *mapping, loff_t pos, unsigned len, unsigned flags, struct page **pagep, void **fsdata, @@ -1381,6 +1407,12 @@ int ocfs2_write_begin_nolock(struct address_space *mapping, return ret; } + ret = ocfs2_expand_nonsparse_inode(inode, pos, len, wc); + if (ret) { + mlog_errno(ret); + goto out; + } + ret = ocfs2_populate_write_desc(inode, wc, clusters_to_alloc, extents_to_split); if (ret) { diff --git a/fs/ocfs2/file.c b/fs/ocfs2/file.c index f3bc365..781ba6c 100644 --- a/fs/ocfs2/file.c +++ b/fs/ocfs2/file.c @@ -779,25 +779,6 @@ leave: return status; } -static int ocfs2_extend_allocation(struct inode *inode, u32 logical_start, - u32 clusters_to_add, int mark_unwritten) -{ - int ret; - - /* -* The alloc sem blocks peope in read/write from reading our -* allocation until we're done changing it. We depend on -* i_mutex to block other extend/truncate calls while we're -* here. -*/ - down_write(OCFS2_I(inode)-ip_alloc_sem); - ret = __ocfs2_extend_allocation(inode, logical_start, clusters_to_add, - mark_unwritten); - up_write(OCFS2_I(inode)-ip_alloc_sem); - - return ret; -} - /* Some parts of this taken from generic_cont_expand, which turned out * to be too fragile to do exactly what we need without us having to * worry about recursive locking in -prepare_write() and @@ -889,25 +870,47 @@ out: return ret; } -/* - * A tail_to_skip value 0 indicates that we're being called from - * ocfs2_file_aio_write(). This has the following implications: - * - * - we don't want to update i_size - * - di_bh will be NULL, which is fine because it's only used in the - * case where we want to update i_size. - * - ocfs2_zero_extend() will then only be filling the hole created - * between i_size and the start of the write. - */ +int ocfs2_extend_no_holes(struct inode *inode, u64 new_i_size, u64 zero_to) +{ + int ret; + u32 clusters_to_add; + struct ocfs2_inode_info *oi = OCFS2_I(inode); + + clusters_to_add = ocfs2_clusters_for_bytes(inode-i_sb, new_i_size); + if (clusters_to_add oi-ip_clusters) + clusters_to_add = 0; + else + clusters_to_add -= oi-ip_clusters; + +
ocfs2: Clear slot map when umounting a local volume
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=19b613d41051296be628581e7e21b847e9eaba80 Commit: 19b613d41051296be628581e7e21b847e9eaba80 Parent: 015452b15ff6c2d9fa1f82f28d61e7a66e2df86a Author: Mark Fasheh [EMAIL PROTECTED] AuthorDate: Thu Oct 4 14:47:09 2007 -0700 Committer: Mark Fasheh [EMAIL PROTECTED] CommitDate: Fri Oct 12 11:54:33 2007 -0700 ocfs2: Clear slot map when umounting a local volume This is technically harmless (recovery will clean it out later), but leaves a bogus entry in the slot_map which really shouldn't be there. Signed-off-by: Mark Fasheh [EMAIL PROTECTED] --- fs/ocfs2/super.c |7 --- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/fs/ocfs2/super.c b/fs/ocfs2/super.c index c034b51..19436d1 100644 --- a/fs/ocfs2/super.c +++ b/fs/ocfs2/super.c @@ -1209,12 +1209,13 @@ static void ocfs2_dismount_volume(struct super_block *sb, int mnt_err) tmp = ocfs2_request_umount_vote(osb); if (tmp 0) mlog_errno(tmp); + } - if (osb-slot_num != OCFS2_INVALID_SLOT) - ocfs2_put_slot(osb); + if (osb-slot_num != OCFS2_INVALID_SLOT) + ocfs2_put_slot(osb); + if (osb-dlm) ocfs2_super_unlock(osb, 1); - } ocfs2_release_system_inodes(osb); - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[ISDN] HiSax elsa: split huge setup function into four smaller functions
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1e5d82e18b7204545737a5ef96bc34180a8df844 Commit: 1e5d82e18b7204545737a5ef96bc34180a8df844 Parent: 2fbde4c0923f53bca9975a46059b5c481a3551ba Author: Jeff Garzik [EMAIL PROTECTED] AuthorDate: Wed Oct 3 15:27:22 2007 -0400 Committer: Jeff Garzik [EMAIL PROTECTED] CommitDate: Fri Oct 12 09:16:48 2007 -0400 [ISDN] HiSax elsa: split huge setup function into four smaller functions Prep for hotplug API conversion. Just code movement (+glue). Signed-off-by: Jeff Garzik [EMAIL PROTECTED] --- drivers/isdn/hisax/elsa.c | 494 + 1 files changed, 278 insertions(+), 216 deletions(-) diff --git a/drivers/isdn/hisax/elsa.c b/drivers/isdn/hisax/elsa.c index fab3e4e..0c1351b 100644 --- a/drivers/isdn/hisax/elsa.c +++ b/drivers/isdn/hisax/elsa.c @@ -30,8 +30,6 @@ #include linux/serial.h #include linux/serial_reg.h -extern const char *CardType[]; - static const char *Elsa_revision = $Revision: 2.32.2.4 $; static const char *Elsa_Types[] = {None, PC, PCC-8, PCC-16, PCF, PCF-Pro, @@ -832,8 +830,75 @@ probe_elsa(struct IsdnCardState *cs) return (CARD_portlist[i]); } -static struct pci_dev *dev_qs1000 __devinitdata = NULL; -static struct pci_dev *dev_qs3000 __devinitdata = NULL; +static int __devinit +setup_elsa_isa(struct IsdnCard *card) +{ + struct IsdnCardState *cs = card-cs; + u_char val; + + cs-hw.elsa.base = card-para[0]; + printk(KERN_INFO Elsa: Microlink IO probing\n); + if (cs-hw.elsa.base) { + if (!(cs-subtyp = probe_elsa_adr(cs-hw.elsa.base, + cs-typ))) { + printk(KERN_WARNING + Elsa: no Elsa Microlink at %#lx\n, + cs-hw.elsa.base); + return (0); + } + } else + cs-hw.elsa.base = probe_elsa(cs); + + if (!cs-hw.elsa.base) { + printk(KERN_WARNING + No Elsa Microlink found\n); + return (0); + } + + cs-hw.elsa.cfg = cs-hw.elsa.base + ELSA_CONFIG; + cs-hw.elsa.ctrl = cs-hw.elsa.base + ELSA_CONTROL; + cs-hw.elsa.ale = cs-hw.elsa.base + ELSA_ALE; + cs-hw.elsa.isac = cs-hw.elsa.base + ELSA_ISAC; + cs-hw.elsa.itac = cs-hw.elsa.base + ELSA_ITAC; + cs-hw.elsa.hscx = cs-hw.elsa.base + ELSA_HSCX; + cs-hw.elsa.trig = cs-hw.elsa.base + ELSA_TRIG_IRQ; + cs-hw.elsa.timer = cs-hw.elsa.base + ELSA_START_TIMER; + val = bytein(cs-hw.elsa.cfg); + if (cs-subtyp == ELSA_PC) { + const u_char CARD_IrqTab[8] = + {7, 3, 5, 9, 0, 0, 0, 0}; + cs-irq = CARD_IrqTab[(val ELSA_IRQ_IDX_PC) 2]; + } else if (cs-subtyp == ELSA_PCC8) { + const u_char CARD_IrqTab[8] = + {7, 3, 5, 9, 0, 0, 0, 0}; + cs-irq = CARD_IrqTab[(val ELSA_IRQ_IDX_PCC8) 4]; + } else { + const u_char CARD_IrqTab[8] = + {15, 10, 15, 3, 11, 5, 11, 9}; + cs-irq = CARD_IrqTab[(val ELSA_IRQ_IDX) 3]; + } + val = bytein(cs-hw.elsa.ale) ELSA_HW_RELEASE; + if (val 3) + val |= 8; + val += 'A' - 3; + if (val == 'B' || val == 'C') + val ^= 1; + if ((cs-subtyp == ELSA_PCFPRO) (val = 'G')) + val = 'C'; + printk(KERN_INFO + Elsa: %s found at %#lx Rev.:%c IRQ %d\n, + Elsa_Types[cs-subtyp], + cs-hw.elsa.base, + val, cs-irq); + val = bytein(cs-hw.elsa.ale) ELSA_S0_POWER_BAD; + if (val) { + printk(KERN_WARNING + Elsa: Microlink S0 bus power bad\n); + cs-hw.elsa.status |= ELSA_BAD_PWR; + } + + return (1); +} #ifdef __ISAPNP__ static struct isapnp_device_id elsa_ids[] __devinitdata = { @@ -848,233 +913,194 @@ static struct isapnp_device_id elsa_ids[] __devinitdata = { static struct isapnp_device_id *ipid __devinitdata = elsa_ids[0]; static struct pnp_card *pnp_c __devinitdata = NULL; -#endif +#endif /* __ISAPNP__ */ -int __devinit -setup_elsa(struct IsdnCard *card) +static int __devinit +setup_elsa_isapnp(struct IsdnCard *card) { - int bytecnt; - u_char val; struct IsdnCardState *cs = card-cs; - char tmp[64]; - strcpy(tmp, Elsa_revision); - printk(KERN_INFO HiSax: Elsa driver Rev. %s\n, HiSax_getrev(tmp)); - cs-hw.elsa.ctrl_reg = 0; - cs-hw.elsa.status = 0; - cs-hw.elsa.MFlag = 0; - cs-subtyp = 0; - if (cs-typ == ISDN_CTYPE_ELSA) { - cs-hw.elsa.base = card-para[0]; - printk(KERN_INFO Elsa: Microlink IO probing\n); - if (cs-hw.elsa.base) { - if (!(cs-subtyp =
[ISDN] HiSax avm_pci: split setup into three smaller functions
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=2fbde4c0923f53bca9975a46059b5c481a3551ba Commit: 2fbde4c0923f53bca9975a46059b5c481a3551ba Parent: bfc7c89f068bbbc2c48588385529d15c6feef802 Author: Jeff Garzik [EMAIL PROTECTED] AuthorDate: Wed Oct 3 15:23:49 2007 -0400 Committer: Jeff Garzik [EMAIL PROTECTED] CommitDate: Fri Oct 12 09:16:48 2007 -0400 [ISDN] HiSax avm_pci: split setup into three smaller functions Preparation for new ISA/PNP/PCI APIs. Just code movement, and the glue to call the new functions. Signed-off-by: Jeff Garzik [EMAIL PROTECTED] --- drivers/isdn/hisax/avm_pci.c | 224 + 1 files changed, 136 insertions(+), 88 deletions(-) diff --git a/drivers/isdn/hisax/avm_pci.c b/drivers/isdn/hisax/avm_pci.c index b04a178..f8b7978 100644 --- a/drivers/isdn/hisax/avm_pci.c +++ b/drivers/isdn/hisax/avm_pci.c @@ -20,7 +20,6 @@ #include linux/isapnp.h #include linux/interrupt.h -extern const char *CardType[]; static const char *avm_pci_rev = $Revision: 1.29.2.4 $; #define AVM_FRITZ_PCI 1 @@ -726,100 +725,15 @@ AVM_card_msg(struct IsdnCardState *cs, int mt, void *arg) return(0); } -#ifdef CONFIG_PCI -static struct pci_dev *dev_avm __devinitdata = NULL; -#endif -#ifdef __ISAPNP__ -static struct pnp_card *pnp_avm_c __devinitdata = NULL; -#endif - -int __devinit -setup_avm_pcipnp(struct IsdnCard *card) +static int __devinit avm_setup_rest(struct IsdnCardState *cs) { u_int val, ver; - struct IsdnCardState *cs = card-cs; - char tmp[64]; - strcpy(tmp, avm_pci_rev); - printk(KERN_INFO HiSax: AVM PCI driver Rev. %s\n, HiSax_getrev(tmp)); - if (cs-typ != ISDN_CTYPE_FRITZPCI) - return (0); - if (card-para[1]) { - /* old manual method */ - cs-hw.avm.cfg_reg = card-para[1]; - cs-irq = card-para[0]; - cs-subtyp = AVM_FRITZ_PNP; - goto ready; - } -#ifdef __ISAPNP__ - if (isapnp_present()) { - struct pnp_dev *pnp_avm_d = NULL; - if ((pnp_avm_c = pnp_find_card( - ISAPNP_VENDOR('A', 'V', 'M'), - ISAPNP_FUNCTION(0x0900), pnp_avm_c))) { - if ((pnp_avm_d = pnp_find_dev(pnp_avm_c, - ISAPNP_VENDOR('A', 'V', 'M'), - ISAPNP_FUNCTION(0x0900), pnp_avm_d))) { - int err; - - pnp_disable_dev(pnp_avm_d); - err = pnp_activate_dev(pnp_avm_d); - if (err0) { - printk(KERN_WARNING %s: pnp_activate_dev ret(%d)\n, - __FUNCTION__, err); - return(0); - } - cs-hw.avm.cfg_reg = - pnp_port_start(pnp_avm_d, 0); - cs-irq = pnp_irq(pnp_avm_d, 0); - if (!cs-irq) { - printk(KERN_ERR FritzPnP:No IRQ\n); - return(0); - } - if (!cs-hw.avm.cfg_reg) { - printk(KERN_ERR FritzPnP:No IO address\n); - return(0); - } - cs-subtyp = AVM_FRITZ_PNP; - goto ready; - } - } - } else { - printk(KERN_INFO FritzPnP: no ISA PnP present\n); - } -#endif -#ifdef CONFIG_PCI - if ((dev_avm = pci_find_device(PCI_VENDOR_ID_AVM, - PCI_DEVICE_ID_AVM_A1, dev_avm))) { - if (pci_enable_device(dev_avm)) - return(0); - cs-irq = dev_avm-irq; - if (!cs-irq) { - printk(KERN_ERR FritzPCI: No IRQ for PCI card found\n); - return(0); - } - cs-hw.avm.cfg_reg = pci_resource_start(dev_avm, 1); - if (!cs-hw.avm.cfg_reg) { - printk(KERN_ERR FritzPCI: No IO-Adr for PCI card found\n); - return(0); - } - cs-subtyp = AVM_FRITZ_PCI; - } else { - printk(KERN_WARNING FritzPCI: No PCI card found\n); - return(0); - } - cs-irq_flags |= IRQF_SHARED; -#else - printk(KERN_WARNING FritzPCI: NO_PCI_BIOS\n); - return (0); -#endif /* CONFIG_PCI */ -ready: cs-hw.avm.isac = cs-hw.avm.cfg_reg + 0x10; if (!request_region(cs-hw.avm.cfg_reg, 32, (cs-subtyp == AVM_FRITZ_PCI) ? avm PCI : avm
ocfs2: Small refactor of truncate zeroing code
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1d410a6e337a0d2d5543ad1d9bccb670a7a05312 Commit: 1d410a6e337a0d2d5543ad1d9bccb670a7a05312 Parent: 65ed39d6ca78f07d2958814e08440e4264b6b488 Author: Mark Fasheh [EMAIL PROTECTED] AuthorDate: Fri Sep 7 14:20:45 2007 -0700 Committer: Mark Fasheh [EMAIL PROTECTED] CommitDate: Fri Oct 12 11:54:35 2007 -0700 ocfs2: Small refactor of truncate zeroing code We'll want to reuse most of this when pushing inline data back out to an extent. Keeping this part as a seperate patch helps to keep the upcoming changes for write support uncluttered. The core portion of ocfs2_zero_cluster_pages() responsible for making sure a page is mapped and properly dirtied is abstracted out into it's own function, ocfs2_map_and_dirty_page(). Actual functionality doesn't change, though zeroing becomes optional. We also turn part of ocfs2_free_write_ctxt() into a common function for unlocking and freeing a page array. This operation is very common (and uniform) for Ocfs2 cluster sizes greater than page size, so it makes sense to keep the code in one place. Signed-off-by: Mark Fasheh [EMAIL PROTECTED] Reviewed-by: Joel Becker [EMAIL PROTECTED] --- fs/ocfs2/alloc.c | 151 ++ fs/ocfs2/aops.c | 20 --- fs/ocfs2/aops.h |2 + 3 files changed, 86 insertions(+), 87 deletions(-) diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c index c91706f..c81bfdf 100644 --- a/fs/ocfs2/alloc.c +++ b/fs/ocfs2/alloc.c @@ -5633,12 +5633,50 @@ static int ocfs2_ordered_zero_func(handle_t *handle, struct buffer_head *bh) return ocfs2_journal_dirty_data(handle, bh); } +static void ocfs2_map_and_dirty_page(struct inode *inode, handle_t *handle, +unsigned int from, unsigned int to, +struct page *page, int zero, u64 *phys) +{ + int ret, partial = 0; + + ret = ocfs2_map_page_blocks(page, phys, inode, from, to, 0); + if (ret) + mlog_errno(ret); + + if (zero) + zero_user_page(page, from, to - from, KM_USER0); + + /* +* Need to set the buffers we zero'd into uptodate +* here if they aren't - ocfs2_map_page_blocks() +* might've skipped some +*/ + if (ocfs2_should_order_data(inode)) { + ret = walk_page_buffers(handle, + page_buffers(page), + from, to, partial, + ocfs2_ordered_zero_func); + if (ret 0) + mlog_errno(ret); + } else { + ret = walk_page_buffers(handle, page_buffers(page), + from, to, partial, + ocfs2_writeback_zero_func); + if (ret 0) + mlog_errno(ret); + } + + if (!partial) + SetPageUptodate(page); + + flush_dcache_page(page); +} + static void ocfs2_zero_cluster_pages(struct inode *inode, loff_t start, loff_t end, struct page **pages, int numpages, u64 phys, handle_t *handle) { - int i, ret, partial = 0; - void *kaddr; + int i; struct page *page; unsigned int from, to = PAGE_CACHE_SIZE; struct super_block *sb = inode-i_sb; @@ -5659,87 +5697,31 @@ static void ocfs2_zero_cluster_pages(struct inode *inode, loff_t start, BUG_ON(from PAGE_CACHE_SIZE); BUG_ON(to PAGE_CACHE_SIZE); - ret = ocfs2_map_page_blocks(page, phys, inode, from, to, 0); - if (ret) - mlog_errno(ret); - - kaddr = kmap_atomic(page, KM_USER0); - memset(kaddr + from, 0, to - from); - kunmap_atomic(kaddr, KM_USER0); - - /* -* Need to set the buffers we zero'd into uptodate -* here if they aren't - ocfs2_map_page_blocks() -* might've skipped some -*/ - if (ocfs2_should_order_data(inode)) { - ret = walk_page_buffers(handle, - page_buffers(page), - from, to, partial, - ocfs2_ordered_zero_func); - if (ret 0) - mlog_errno(ret); - } else { - ret = walk_page_buffers(handle, page_buffers(page), - from, to, partial, - ocfs2_writeback_zero_func); - if (ret 0) -
[ISDN] Remove CONFIG_PCI ifdefs from 100% PCI source code
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=bfc7c89f068bbbc2c48588385529d15c6feef802 Commit: bfc7c89f068bbbc2c48588385529d15c6feef802 Parent: 782e3b3b3804c38d5130c7f21d7ec7bf6709023f Author: Jeff Garzik [EMAIL PROTECTED] AuthorDate: Thu Aug 2 16:56:22 2007 -0400 Committer: Jeff Garzik [EMAIL PROTECTED] CommitDate: Fri Oct 12 09:16:48 2007 -0400 [ISDN] Remove CONFIG_PCI ifdefs from 100% PCI source code Signed-off-by: Jeff Garzik [EMAIL PROTECTED] --- drivers/isdn/hisax/bkm_a8.c |8 drivers/isdn/hisax/telespci.c |8 ++-- drivers/isdn/hisax/w6692.c|7 +-- 3 files changed, 3 insertions(+), 20 deletions(-) diff --git a/drivers/isdn/hisax/bkm_a8.c b/drivers/isdn/hisax/bkm_a8.c index 6339bb4..99ef3b4 100644 --- a/drivers/isdn/hisax/bkm_a8.c +++ b/drivers/isdn/hisax/bkm_a8.c @@ -20,8 +20,6 @@ #include linux/pci.h #include bkm_ax.h -#ifdef CONFIG_PCI - #defineATTEMPT_PCI_REMAPPING /* Required for PLX rev 1 */ extern const char *CardType[]; @@ -279,12 +277,9 @@ static u_char pci_bus __devinitdata = 0; static u_char pci_device_fn __devinitdata = 0; static u_char pci_irq __devinitdata = 0; -#endif /* CONFIG_PCI */ - int __devinit setup_sct_quadro(struct IsdnCard *card) { -#ifdef CONFIG_PCI struct IsdnCardState *cs = card-cs; char tmp[64]; u_int found = 0; @@ -442,7 +437,4 @@ setup_sct_quadro(struct IsdnCard *card) sct_quadro_subtypes[cs-subtyp], readreg(cs-hw.ax.base, cs-hw.ax.data_adr, IPAC_ID)); return (1); -#else - printk(KERN_ERR HiSax: bkm_a8 only supported on PCI Systems\n); -#endif /* CONFIG_PCI */ } diff --git a/drivers/isdn/hisax/telespci.c b/drivers/isdn/hisax/telespci.c index d09f6d0..4393003 100644 --- a/drivers/isdn/hisax/telespci.c +++ b/drivers/isdn/hisax/telespci.c @@ -295,11 +295,12 @@ setup_telespci(struct IsdnCard *card) #ifdef __BIG_ENDIAN #error not running on big endian machines now #endif + strcpy(tmp, telespci_revision); printk(KERN_INFO HiSax: Teles/PCI driver Rev. %s\n, HiSax_getrev(tmp)); if (cs-typ != ISDN_CTYPE_TELESPCI) return (0); -#ifdef CONFIG_PCI + if ((dev_tel = pci_find_device (PCI_VENDOR_ID_ZORAN, PCI_DEVICE_ID_ZORAN_36120, dev_tel))) { if (pci_enable_device(dev_tel)) return(0); @@ -317,11 +318,6 @@ setup_telespci(struct IsdnCard *card) printk(KERN_WARNING TelesPCI: No PCI card found\n); return(0); } -#else - printk(KERN_WARNING HiSax: Teles/PCI and NO_PCI_BIOS\n); - printk(KERN_WARNING HiSax: Teles/PCI unable to config\n); - return (0); -#endif /* CONFIG_PCI */ /* Initialize Zoran PCI controller */ writel(0x, cs-hw.teles0.membase + 0x28); diff --git a/drivers/isdn/hisax/w6692.c b/drivers/isdn/hisax/w6692.c index 3aeceaf..39129b9 100644 --- a/drivers/isdn/hisax/w6692.c +++ b/drivers/isdn/hisax/w6692.c @@ -1009,7 +1009,7 @@ setup_w6692(struct IsdnCard *card) printk(KERN_INFO HiSax: W6692 driver Rev. %s\n, HiSax_getrev(tmp)); if (cs-typ != ISDN_CTYPE_W6692) return (0); -#ifdef CONFIG_PCI + while (id_list[id_idx].vendor_id) { dev_w6692 = pci_find_device(id_list[id_idx].vendor_id, id_list[id_idx].device_id, @@ -1061,11 +1061,6 @@ setup_w6692(struct IsdnCard *card) cs-hw.w6692.iobase + 255); return (0); } -#else - printk(KERN_WARNING HiSax: W6692 and NO_PCI_BIOS\n); - printk(KERN_WARNING HiSax: W6692 unable to config\n); - return (0); -#endif /* CONFIG_PCI */ printk(KERN_INFO HiSax: %s config irq:%d I/O:%x\n, - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
ocfs2: Pass raw u64 to filldir
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7e8536797d4508ddc790cc3af6a281db1582d485 Commit: 7e8536797d4508ddc790cc3af6a281db1582d485 Parent: b8bc5f4fde376c9eee524a9a2b7e85560e604e85 Author: Mark Fasheh [EMAIL PROTECTED] AuthorDate: Mon Sep 10 17:30:26 2007 -0700 Committer: Mark Fasheh [EMAIL PROTECTED] CommitDate: Fri Oct 12 11:54:37 2007 -0700 ocfs2: Pass raw u64 to filldir filldir_t can take this, so don't turn de-inode into a 32 bit value. Right now this doesn't make a difference since no ocfs2 inodes overflow that, but it could be a nasty surprise later on if some kernel code is calling ocfs2_dir_foreach_blk() and expecting real inode numbers back... Signed-off-by: Mark Fasheh [EMAIL PROTECTED] Reviewed-by: Joel Becker [EMAIL PROTECTED] --- fs/ocfs2/dir.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c index d1f92fd..dbfa6f6 100644 --- a/fs/ocfs2/dir.c +++ b/fs/ocfs2/dir.c @@ -512,7 +512,7 @@ revalidate: error = filldir(priv, de-name, de-name_len, *f_pos, - ino_from_blkno(sb, le64_to_cpu(de-inode)), + le64_to_cpu(de-inode), d_type); if (error) break; - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
ocfs2: Move directory manipulation code into dir.c
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=316f4b9f98a353ac1be93199694fd97272378815 Commit: 316f4b9f98a353ac1be93199694fd97272378815 Parent: 1d410a6e337a0d2d5543ad1d9bccb670a7a05312 Author: Mark Fasheh [EMAIL PROTECTED] AuthorDate: Fri Sep 7 18:21:26 2007 -0700 Committer: Mark Fasheh [EMAIL PROTECTED] CommitDate: Fri Oct 12 11:54:36 2007 -0700 ocfs2: Move directory manipulation code into dir.c The code for adding, removing, deleting directory entries was splattered all over namei.c. I'd rather have this all centralized, so that it's easier to make changes for inline dir data, and eventually indexed directories. None of the code in any of the functions was changed. I only removed the static keyword from some prototypes so that they could be exported. Signed-off-by: Mark Fasheh [EMAIL PROTECTED] Reviewed-by: Joel Becker [EMAIL PROTECTED] --- fs/ocfs2/dir.c | 430 ++- fs/ocfs2/dir.h | 44 +- fs/ocfs2/journal.c |2 +- fs/ocfs2/namei.c | 433 fs/ocfs2/namei.h | 19 --- 5 files changed, 461 insertions(+), 467 deletions(-) diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c index 0d5fdde..8e0ae02 100644 --- a/fs/ocfs2/dir.c +++ b/fs/ocfs2/dir.c @@ -55,10 +55,16 @@ #include journal.h #include namei.h #include suballoc.h +#include super.h #include uptodate.h #include buffer_head_io.h +#define NAMEI_RA_CHUNKS 2 +#define NAMEI_RA_BLOCKS 4 +#define NAMEI_RA_SIZE(NAMEI_RA_CHUNKS * NAMEI_RA_BLOCKS) +#define NAMEI_RA_INDEX(c,b) (((c) * NAMEI_RA_BLOCKS) + (b)) + static unsigned char ocfs2_filetype_table[] = { DT_UNKNOWN, DT_REG, DT_DIR, DT_CHR, DT_BLK, DT_FIFO, DT_SOCK, DT_LNK }; @@ -67,6 +73,347 @@ static int ocfs2_extend_dir(struct ocfs2_super *osb, struct inode *dir, struct buffer_head *parent_fe_bh, struct buffer_head **new_de_bh); +static int ocfs2_do_extend_dir(struct super_block *sb, + handle_t *handle, + struct inode *dir, + struct buffer_head *parent_fe_bh, + struct ocfs2_alloc_context *data_ac, + struct ocfs2_alloc_context *meta_ac, + struct buffer_head **new_bh); + +int ocfs2_check_dir_entry(struct inode * dir, + struct ocfs2_dir_entry * de, + struct buffer_head * bh, + unsigned long offset) +{ + const char *error_msg = NULL; + const int rlen = le16_to_cpu(de-rec_len); + + if (rlen OCFS2_DIR_REC_LEN(1)) + error_msg = rec_len is smaller than minimal; + else if (rlen % 4 != 0) + error_msg = rec_len % 4 != 0; + else if (rlen OCFS2_DIR_REC_LEN(de-name_len)) + error_msg = rec_len is too small for name_len; + else if (((char *) de - bh-b_data) + rlen dir-i_sb-s_blocksize) + error_msg = directory entry across blocks; + + if (error_msg != NULL) + mlog(ML_ERROR, bad entry in directory #%llu: %s - +offset=%lu, inode=%llu, rec_len=%d, name_len=%d\n, +(unsigned long long)OCFS2_I(dir)-ip_blkno, error_msg, +offset, (unsigned long long)le64_to_cpu(de-inode), rlen, +de-name_len); + return error_msg == NULL ? 1 : 0; +} + +static inline int ocfs2_match(int len, + const char * const name, + struct ocfs2_dir_entry *de) +{ + if (len != de-name_len) + return 0; + if (!de-inode) + return 0; + return !memcmp(name, de-name, len); +} + +/* + * Returns 0 if not found, -1 on failure, and 1 on success + */ +static int inline ocfs2_search_dirblock(struct buffer_head *bh, + struct inode *dir, + const char *name, int namelen, + unsigned long offset, + struct ocfs2_dir_entry **res_dir) +{ + struct ocfs2_dir_entry *de; + char *dlimit, *de_buf; + int de_len; + int ret = 0; + + mlog_entry_void(); + + de_buf = bh-b_data; + dlimit = de_buf + dir-i_sb-s_blocksize; + + while (de_buf dlimit) { + /* this code is executed quadratically often */ + /* do minimal checking `by hand' */ + + de = (struct ocfs2_dir_entry *) de_buf; + + if (de_buf + namelen = dlimit + ocfs2_match(namelen, name, de)) { + /* found a match - just to be sure, do a full check */ + if
ocfs2: Implement ocfs2_empty_dir() as a caller of ocfs2_dir_foreach()
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0bfbbf62a8b5a129ba2c689283bfece80a601aba Commit: 0bfbbf62a8b5a129ba2c689283bfece80a601aba Parent: 5eae5b96fc86e6c85f5f90e90fe9e6966f1fec63 Author: Mark Fasheh [EMAIL PROTECTED] AuthorDate: Wed Sep 12 11:19:00 2007 -0700 Committer: Mark Fasheh [EMAIL PROTECTED] CommitDate: Fri Oct 12 11:54:37 2007 -0700 ocfs2: Implement ocfs2_empty_dir() as a caller of ocfs2_dir_foreach() We can preserve the behavior of ocfs2_empty_dir(), while getting rid of the open coded directory walk by just providing a smart filldir callback. This also automatically gets to use the dir readahead code, though in this case any advantage is minor at best. Signed-off-by: Mark Fasheh [EMAIL PROTECTED] Reviewed-by: Joel Becker [EMAIL PROTECTED] --- fs/ocfs2/dir.c | 96 ++- fs/ocfs2/dir.h |2 +- 2 files changed, 46 insertions(+), 52 deletions(-) diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c index a75c340..4bb5440 100644 --- a/fs/ocfs2/dir.c +++ b/fs/ocfs2/dir.c @@ -660,67 +660,61 @@ bail: return ret; } +struct ocfs2_empty_dir_priv { + unsigned seen_dot; + unsigned seen_dot_dot; + unsigned seen_other; +}; +static int ocfs2_empty_dir_filldir(void *priv, const char *name, int name_len, + loff_t pos, u64 ino, unsigned type) +{ + struct ocfs2_empty_dir_priv *p = priv; + + /* +* Check the positions of . and .. records to be sure +* they're in the correct place. +*/ + if (name_len == 1 !strncmp(., name, 1) pos == 0) { + p-seen_dot = 1; + return 0; + } + + if (name_len == 2 !strncmp(.., name, 2) + pos == OCFS2_DIR_REC_LEN(1)) { + p-seen_dot_dot = 1; + return 0; + } + + p-seen_other = 1; + return 1; +} /* * routine to check that the specified directory is empty (for rmdir) + * + * Returns 1 if dir is empty, zero otherwise. */ int ocfs2_empty_dir(struct inode *inode) { - unsigned long offset; - struct buffer_head * bh; - struct ocfs2_dir_entry * de, * de1; - struct super_block * sb; - int err; + int ret; + loff_t start = 0; + struct ocfs2_empty_dir_priv priv; - sb = inode-i_sb; - if ((i_size_read(inode) -(OCFS2_DIR_REC_LEN(1) + OCFS2_DIR_REC_LEN(2))) || - !(bh = ocfs2_bread(inode, 0, err, 0))) { - mlog(ML_ERROR, bad directory (dir #%llu) - no data block\n, -(unsigned long long)OCFS2_I(inode)-ip_blkno); - return 1; - } + memset(priv, 0, sizeof(priv)); - de = (struct ocfs2_dir_entry *) bh-b_data; - de1 = (struct ocfs2_dir_entry *) - ((char *)de + le16_to_cpu(de-rec_len)); - if ((le64_to_cpu(de-inode) != OCFS2_I(inode)-ip_blkno) || - !le64_to_cpu(de1-inode) || - strcmp(., de-name) || - strcmp(.., de1-name)) { - mlog(ML_ERROR, bad directory (dir #%llu) - no `.' or `..'\n, + ret = ocfs2_dir_foreach(inode, start, priv, ocfs2_empty_dir_filldir); + if (ret) + mlog_errno(ret); + + if (!priv.seen_dot || !priv.seen_dot_dot) { + mlog(ML_ERROR, bad directory (dir #%llu) - no `.' or `..'\n, (unsigned long long)OCFS2_I(inode)-ip_blkno); - brelse(bh); + /* +* XXX: Is it really safe to allow an unlink to continue? +*/ return 1; } - offset = le16_to_cpu(de-rec_len) + le16_to_cpu(de1-rec_len); - de = (struct ocfs2_dir_entry *)((char *)de1 + le16_to_cpu(de1-rec_len)); - while (offset i_size_read(inode) ) { - if (!bh || (void *)de = (void *)(bh-b_data + sb-s_blocksize)) { - brelse(bh); - bh = ocfs2_bread(inode, -offset sb-s_blocksize_bits, err, 0); - if (!bh) { - mlog(ML_ERROR, dir %llu has a hole at %lu\n, -(unsigned long long)OCFS2_I(inode)-ip_blkno, offset); - offset += sb-s_blocksize; - continue; - } - de = (struct ocfs2_dir_entry *) bh-b_data; - } - if (!ocfs2_check_dir_entry(inode, de, bh, offset)) { - brelse(bh); - return 1; - } - if (le64_to_cpu(de-inode)) { - brelse(bh); - return 0; - } - offset += le16_to_cpu(de-rec_len); - de = (struct ocfs2_dir_entry
ocfs2: Rename cleanups
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=38760e243249f03b4c6d78ca624dd846a2681b67 Commit: 38760e243249f03b4c6d78ca624dd846a2681b67 Parent: be94d11704ef79030fd2e6a0c41b4a7f65f9e860 Author: Mark Fasheh [EMAIL PROTECTED] AuthorDate: Tue Sep 11 17:21:56 2007 -0700 Committer: Mark Fasheh [EMAIL PROTECTED] CommitDate: Fri Oct 12 11:54:38 2007 -0700 ocfs2: Rename cleanups ocfs2_rename() does direct manipulation of the dirent it's gotten back from a directory search. Wrap this manipulation inside of a function so that we can transparently change directory update behavior in the future. As an added bonus, this gets rid of an ugly macro. Signed-off-by: Mark Fasheh [EMAIL PROTECTED] Reviewed-by: Joel Becker [EMAIL PROTECTED] --- fs/ocfs2/dir.c | 22 ++ fs/ocfs2/dir.h |3 +++ fs/ocfs2/namei.c | 53 ++--- 3 files changed, 47 insertions(+), 31 deletions(-) diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c index 4791683..31db7e3 100644 --- a/fs/ocfs2/dir.c +++ b/fs/ocfs2/dir.c @@ -271,6 +271,28 @@ cleanup_and_exit: return ret; } +int ocfs2_update_entry(struct inode *dir, handle_t *handle, + struct buffer_head *de_bh, struct ocfs2_dir_entry *de, + struct inode *new_entry_inode) +{ + int ret; + + ret = ocfs2_journal_access(handle, dir, de_bh, + OCFS2_JOURNAL_ACCESS_WRITE); + if (ret) { + mlog_errno(ret); + goto out; + } + + de-inode = cpu_to_le64(OCFS2_I(new_entry_inode)-ip_blkno); + ocfs2_set_de_type(de, new_entry_inode-i_mode); + + ocfs2_journal_dirty(handle, de_bh); + +out: + return ret; +} + /* * ocfs2_delete_entry deletes a directory entry by merging it with the * previous entry diff --git a/fs/ocfs2/dir.h b/fs/ocfs2/dir.h index d03eaaa..ce48b90 100644 --- a/fs/ocfs2/dir.h +++ b/fs/ocfs2/dir.h @@ -50,6 +50,9 @@ static inline int ocfs2_add_entry(handle_t *handle, dentry-d_name.name, dentry-d_name.len, inode, blkno, parent_fe_bh, insert_bh); } +int ocfs2_update_entry(struct inode *dir, handle_t *handle, + struct buffer_head *de_bh, struct ocfs2_dir_entry *de, + struct inode *new_entry_inode); int ocfs2_check_dir_for_entry(struct inode *dir, const char *name, diff --git a/fs/ocfs2/namei.c b/fs/ocfs2/namei.c index 98aeebc..d2f0335 100644 --- a/fs/ocfs2/namei.c +++ b/fs/ocfs2/namei.c @@ -933,11 +933,6 @@ static void ocfs2_double_unlock(struct inode *inode1, struct inode *inode2) ocfs2_meta_unlock(inode2, 1); } -#define PARENT_INO(buffer) \ - ((struct ocfs2_dir_entry *) \ -((char *)buffer + \ - le16_to_cpu(((struct ocfs2_dir_entry *)buffer)-rec_len)))-inode - static int ocfs2_rename(struct inode *old_dir, struct dentry *old_dentry, struct inode *new_dir, @@ -959,8 +954,8 @@ static int ocfs2_rename(struct inode *old_dir, handle_t *handle = NULL; struct buffer_head *old_dir_bh = NULL; struct buffer_head *new_dir_bh = NULL; - struct ocfs2_dir_entry *old_de = NULL, *new_de = NULL; // dirent for old_dentry - // and new_dentry + struct ocfs2_dir_entry *old_inode_dot_dot_de = NULL, *old_de = NULL, + *new_de = NULL; struct buffer_head *new_de_bh = NULL, *old_de_bh = NULL; // bhs for above struct buffer_head *old_inode_de_bh = NULL; // if old_dentry is a dir, // this is the 1st dirent bh @@ -1044,19 +1039,26 @@ static int ocfs2_rename(struct inode *old_dir, } if (S_ISDIR(old_inode-i_mode)) { - status = -EIO; - old_inode_de_bh = ocfs2_bread(old_inode, 0, status, 0); - if (!old_inode_de_bh) + u64 old_inode_parent; + + status = ocfs2_find_files_on_disk(.., 2, old_inode_parent, + old_inode, old_inode_de_bh, + old_inode_dot_dot_de); + if (status) { + status = -EIO; goto bail; + } - status = -EIO; - if (le64_to_cpu(PARENT_INO(old_inode_de_bh-b_data)) != - OCFS2_I(old_dir)-ip_blkno) + if (old_inode_parent != OCFS2_I(old_dir)-ip_blkno) { + status = -EIO; goto bail; - status = -EMLINK; - if (!new_inode new_dir!=old_dir - new_dir-i_nlink = OCFS2_LINK_MAX) + } + +
ocfs2: Cleanup dirent size check
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8553cf4f360d6fc4913a0bdd3b22dd7b5bb9a3be Commit: 8553cf4f360d6fc4913a0bdd3b22dd7b5bb9a3be Parent: 38760e243249f03b4c6d78ca624dd846a2681b67 Author: Mark Fasheh [EMAIL PROTECTED] AuthorDate: Thu Sep 13 16:29:01 2007 -0700 Committer: Mark Fasheh [EMAIL PROTECTED] CommitDate: Fri Oct 12 11:54:39 2007 -0700 ocfs2: Cleanup dirent size check The check to see if a new dirent would fit in an old one is pretty ugly, and it's done at least twice. Clean things up by putting this in it's own easier-to-read function. Signed-off-by: Mark Fasheh [EMAIL PROTECTED] Reviewed-by: Joel Becker [EMAIL PROTECTED] --- fs/ocfs2/dir.c | 36 1 files changed, 28 insertions(+), 8 deletions(-) diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c index 31db7e3..f2e2ffb 100644 --- a/fs/ocfs2/dir.c +++ b/fs/ocfs2/dir.c @@ -343,6 +343,31 @@ bail: return status; } +/* + * Check whether 'de' has enough room to hold an entry of + * 'new_rec_len' bytes. + */ +static inline int ocfs2_dirent_would_fit(struct ocfs2_dir_entry *de, +unsigned int new_rec_len) +{ + unsigned int de_really_used; + + /* Check whether this is an empty record with enough space */ + if (le64_to_cpu(de-inode) == 0 + le16_to_cpu(de-rec_len) = new_rec_len) + return 1; + + /* +* Record might have free space at the end which we can +* use. +*/ + de_really_used = OCFS2_DIR_REC_LEN(de-name_len); + if (le16_to_cpu(de-rec_len) = (de_really_used + new_rec_len)) + return 1; + + return 0; +} + /* we don't always have a dentry for what we want to add, so people * like orphan dir can call this instead. * @@ -385,10 +410,8 @@ int __ocfs2_add_entry(handle_t *handle, retval = -EEXIST; goto bail; } - if (((le64_to_cpu(de-inode) == 0) -(le16_to_cpu(de-rec_len) = rec_len)) || - (le16_to_cpu(de-rec_len) = -(OCFS2_DIR_REC_LEN(de-name_len) + rec_len))) { + + if (ocfs2_dirent_would_fit(de, rec_len)) { dir-i_mtime = dir-i_ctime = CURRENT_TIME; retval = ocfs2_mark_inode_dirty(handle, dir, parent_fe_bh); if (retval 0) { @@ -1078,10 +1101,7 @@ int ocfs2_prepare_dir_for_insert(struct ocfs2_super *osb, status = -EEXIST; goto bail; } - if (((le64_to_cpu(de-inode) == 0) -(le16_to_cpu(de-rec_len) = rec_len)) || - (le16_to_cpu(de-rec_len) = -(OCFS2_DIR_REC_LEN(de-name_len) + rec_len))) { + if (ocfs2_dirent_would_fit(de, rec_len)) { /* Ok, we found a spot. Return this bh and let * the caller actually fill it in. */ *ret_de_bh = bh; - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
ocfs2: Read support for inline data
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=6798d35a31c413bbb3f83bbaa844bd2598168ccc Commit: 6798d35a31c413bbb3f83bbaa844bd2598168ccc Parent: 15b1e36bdb487d67ef924a37b0967453143be53a Author: Mark Fasheh [EMAIL PROTECTED] AuthorDate: Fri Sep 7 14:05:51 2007 -0700 Committer: Mark Fasheh [EMAIL PROTECTED] CommitDate: Fri Oct 12 11:54:39 2007 -0700 ocfs2: Read support for inline data This hooks up ocfs2_readpage() to populate a page with data from an inode block. Direct IO reads from inline data are modified to fall back to buffered I/O. Appropriate checks are also placed in the extent map code to avoid reading an extent list when inline data might be stored. Signed-off-by: Mark Fasheh [EMAIL PROTECTED] Reviewed-by: Joel Becker [EMAIL PROTECTED] --- fs/ocfs2/aops.c | 80 ++-- fs/ocfs2/extent_map.c |6 2 files changed, 82 insertions(+), 4 deletions(-) diff --git a/fs/ocfs2/aops.c b/fs/ocfs2/aops.c index 8416e38..fef0186 100644 --- a/fs/ocfs2/aops.c +++ b/fs/ocfs2/aops.c @@ -206,9 +206,70 @@ bail: return err; } +static int ocfs2_read_inline_data(struct inode *inode, struct page *page, + struct buffer_head *di_bh) +{ + void *kaddr; + unsigned int size; + struct ocfs2_dinode *di = (struct ocfs2_dinode *)di_bh-b_data; + + if (!(le16_to_cpu(di-i_dyn_features) OCFS2_INLINE_DATA_FL)) { + ocfs2_error(inode-i_sb, Inode %llu lost inline data flag, + (unsigned long long)OCFS2_I(inode)-ip_blkno); + return -EROFS; + } + + size = i_size_read(inode); + + if (size PAGE_CACHE_SIZE || + size ocfs2_max_inline_data(inode-i_sb)) { + ocfs2_error(inode-i_sb, + Inode %llu has with inline data has bad size: %u, + (unsigned long long)OCFS2_I(inode)-ip_blkno, size); + return -EROFS; + } + + kaddr = kmap_atomic(page, KM_USER0); + if (size) + memcpy(kaddr, di-id2.i_data.id_data, size); + /* Clear the remaining part of the page */ + memset(kaddr + size, 0, PAGE_CACHE_SIZE - size); + flush_dcache_page(page); + kunmap_atomic(kaddr, KM_USER0); + + SetPageUptodate(page); + + return 0; +} + +static int ocfs2_readpage_inline(struct inode *inode, struct page *page) +{ + int ret; + struct buffer_head *di_bh = NULL; + struct ocfs2_super *osb = OCFS2_SB(inode-i_sb); + + BUG_ON(!PageLocked(page)); + BUG_ON(!OCFS2_I(inode)-ip_dyn_features OCFS2_INLINE_DATA_FL); + + ret = ocfs2_read_block(osb, OCFS2_I(inode)-ip_blkno, di_bh, + OCFS2_BH_CACHED, inode); + if (ret) { + mlog_errno(ret); + goto out; + } + + ret = ocfs2_read_inline_data(inode, page, di_bh); +out: + unlock_page(page); + + brelse(di_bh); + return ret; +} + static int ocfs2_readpage(struct file *file, struct page *page) { struct inode *inode = page-mapping-host; + struct ocfs2_inode_info *oi = OCFS2_I(inode); loff_t start = (loff_t)page-index PAGE_CACHE_SHIFT; int ret, unlock = 1; @@ -222,7 +283,7 @@ static int ocfs2_readpage(struct file *file, struct page *page) goto out; } - if (down_read_trylock(OCFS2_I(inode)-ip_alloc_sem) == 0) { + if (down_read_trylock(oi-ip_alloc_sem) == 0) { ret = AOP_TRUNCATED_PAGE; goto out_meta_unlock; } @@ -252,7 +313,10 @@ static int ocfs2_readpage(struct file *file, struct page *page) goto out_alloc; } - ret = block_read_full_page(page, ocfs2_get_block); + if (oi-ip_dyn_features OCFS2_INLINE_DATA_FL) + ret = ocfs2_readpage_inline(inode, page); + else + ret = block_read_full_page(page, ocfs2_get_block); unlock = 0; ocfs2_data_unlock(inode, 0); @@ -397,7 +461,9 @@ static sector_t ocfs2_bmap(struct address_space *mapping, sector_t block) down_read(OCFS2_I(inode)-ip_alloc_sem); } - err = ocfs2_extent_map_get_blocks(inode, block, p_blkno, NULL, NULL); + if (!(OCFS2_I(inode)-ip_dyn_features OCFS2_INLINE_DATA_FL)) + err = ocfs2_extent_map_get_blocks(inode, block, p_blkno, NULL, + NULL); if (!INODE_JOURNAL(inode)) { up_read(OCFS2_I(inode)-ip_alloc_sem); @@ -411,7 +477,6 @@ static sector_t ocfs2_bmap(struct address_space *mapping, sector_t block) goto bail; } - bail: status = err ? 0 : p_blkno; @@ -566,6 +631,13 @@ static ssize_t ocfs2_direct_IO(int rw, mlog_entry_void(); + /* +* Fallback to buffered
ocfs2: Structure updates for inline data
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=15b1e36bdb487d67ef924a37b0967453143be53a Commit: 15b1e36bdb487d67ef924a37b0967453143be53a Parent: 8553cf4f360d6fc4913a0bdd3b22dd7b5bb9a3be Author: Mark Fasheh [EMAIL PROTECTED] AuthorDate: Fri Sep 7 13:58:15 2007 -0700 Committer: Mark Fasheh [EMAIL PROTECTED] CommitDate: Fri Oct 12 11:54:39 2007 -0700 ocfs2: Structure updates for inline data Add the disk, network and memory structures needed to support data in inode. Struct ocfs2_inline_data is defined and embedded in ocfs2_dinode for storing inline data. A new inode field, i_dyn_features, is added to facilitate tracking of dynamic inode state. Since it will be used often, we want to mirror it on ocfs2_inode_info, and transfer it via the meta data lvb. Signed-off-by: Mark Fasheh [EMAIL PROTECTED] Reviewed-by: Joel Becker [EMAIL PROTECTED] --- fs/ocfs2/dlmglue.c |2 ++ fs/ocfs2/dlmglue.h |4 ++-- fs/ocfs2/inode.c|3 +++ fs/ocfs2/inode.h|1 + fs/ocfs2/ocfs2.h|7 +++ fs/ocfs2/ocfs2_fs.h | 44 ++-- 6 files changed, 57 insertions(+), 4 deletions(-) diff --git a/fs/ocfs2/dlmglue.c b/fs/ocfs2/dlmglue.c index f71250e..41c76ff 100644 --- a/fs/ocfs2/dlmglue.c +++ b/fs/ocfs2/dlmglue.c @@ -1482,6 +1482,7 @@ static void __ocfs2_stuff_meta_lvb(struct inode *inode) lvb-lvb_imtime_packed = cpu_to_be64(ocfs2_pack_timespec(inode-i_mtime)); lvb-lvb_iattr= cpu_to_be32(oi-ip_attr); + lvb-lvb_idynfeatures = cpu_to_be16(oi-ip_dyn_features); lvb-lvb_igeneration = cpu_to_be32(inode-i_generation); out: @@ -1515,6 +1516,7 @@ static void ocfs2_refresh_inode_from_lvb(struct inode *inode) i_size_write(inode, be64_to_cpu(lvb-lvb_isize)); oi-ip_attr = be32_to_cpu(lvb-lvb_iattr); + oi-ip_dyn_features = be16_to_cpu(lvb-lvb_idynfeatures); ocfs2_set_inode_flags(inode); /* fast-symlinks are a special case */ diff --git a/fs/ocfs2/dlmglue.h b/fs/ocfs2/dlmglue.h index 492bad3..87a785e 100644 --- a/fs/ocfs2/dlmglue.h +++ b/fs/ocfs2/dlmglue.h @@ -29,12 +29,12 @@ #include dcache.h -#define OCFS2_LVB_VERSION 4 +#define OCFS2_LVB_VERSION 5 struct ocfs2_meta_lvb { __u8 lvb_version; __u8 lvb_reserved0; - __be16 lvb_reserved1; + __be16 lvb_idynfeatures; __be32 lvb_iclusters; __be32 lvb_iuid; __be32 lvb_igid; diff --git a/fs/ocfs2/inode.c b/fs/ocfs2/inode.c index c53a676..c8923ba 100644 --- a/fs/ocfs2/inode.c +++ b/fs/ocfs2/inode.c @@ -241,6 +241,7 @@ int ocfs2_populate_inode(struct inode *inode, struct ocfs2_dinode *fe, OCFS2_I(inode)-ip_clusters = le32_to_cpu(fe-i_clusters); OCFS2_I(inode)-ip_attr = le32_to_cpu(fe-i_attr); + OCFS2_I(inode)-ip_dyn_features = le16_to_cpu(fe-i_dyn_features); inode-i_version = 1; inode-i_generation = le32_to_cpu(fe-i_generation); @@ -1220,6 +1221,7 @@ int ocfs2_mark_inode_dirty(handle_t *handle, fe-i_clusters = cpu_to_le32(OCFS2_I(inode)-ip_clusters); ocfs2_get_inode_flags(OCFS2_I(inode)); fe-i_attr = cpu_to_le32(OCFS2_I(inode)-ip_attr); + fe-i_dyn_features = cpu_to_le16(OCFS2_I(inode)-ip_dyn_features); spin_unlock(OCFS2_I(inode)-ip_lock); fe-i_size = cpu_to_le64(i_size_read(inode)); @@ -1257,6 +1259,7 @@ void ocfs2_refresh_inode(struct inode *inode, OCFS2_I(inode)-ip_clusters = le32_to_cpu(fe-i_clusters); OCFS2_I(inode)-ip_attr = le32_to_cpu(fe-i_attr); + OCFS2_I(inode)-ip_dyn_features = le16_to_cpu(fe-i_dyn_features); ocfs2_set_inode_flags(inode); i_size_write(inode, le64_to_cpu(fe-i_size)); inode-i_nlink = le16_to_cpu(fe-i_links_count); diff --git a/fs/ocfs2/inode.h b/fs/ocfs2/inode.h index a41d081..70e881c 100644 --- a/fs/ocfs2/inode.h +++ b/fs/ocfs2/inode.h @@ -51,6 +51,7 @@ struct ocfs2_inode_info u32 ip_flags; /* see below */ u32 ip_attr; /* inode attributes */ + u16 ip_dyn_features; /* protected by recovery_lock. */ struct inode*ip_next_orphan; diff --git a/fs/ocfs2/ocfs2.h b/fs/ocfs2/ocfs2.h index 5830785..60a23e1 100644 --- a/fs/ocfs2/ocfs2.h +++ b/fs/ocfs2/ocfs2.h @@ -319,6 +319,13 @@ static inline int ocfs2_writes_unwritten_extents(struct ocfs2_super *osb) return 0; } +static inline int ocfs2_supports_inline_data(struct ocfs2_super *osb) +{ + if (osb-s_feature_incompat OCFS2_FEATURE_INCOMPAT_INLINE_DATA) + return 1; + return 0; +} + /* set / clear functions because cluster events can make these happen * in parallel so we want the transitions to be atomic. this also * means that any future flags
ocfs2: Remove open coded readdir()
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5eae5b96fc86e6c85f5f90e90fe9e6966f1fec63 Commit: 5eae5b96fc86e6c85f5f90e90fe9e6966f1fec63 Parent: 7e8536797d4508ddc790cc3af6a281db1582d485 Author: Mark Fasheh [EMAIL PROTECTED] AuthorDate: Mon Sep 10 17:50:51 2007 -0700 Committer: Mark Fasheh [EMAIL PROTECTED] CommitDate: Fri Oct 12 11:54:37 2007 -0700 ocfs2: Remove open coded readdir() ocfs2_queue_orphans() has an open coded readdir loop which can easily just use a directory accessor function. Signed-off-by: Mark Fasheh [EMAIL PROTECTED] Reviewed-by: Joel Becker [EMAIL PROTECTED] --- fs/ocfs2/dir.c | 28 +++-- fs/ocfs2/dir.h |7 +-- fs/ocfs2/journal.c | 118 +++ 3 files changed, 70 insertions(+), 83 deletions(-) diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c index dbfa6f6..a75c340 100644 --- a/fs/ocfs2/dir.c +++ b/fs/ocfs2/dir.c @@ -81,10 +81,10 @@ static int ocfs2_do_extend_dir(struct super_block *sb, struct ocfs2_alloc_context *meta_ac, struct buffer_head **new_bh); -int ocfs2_check_dir_entry(struct inode * dir, - struct ocfs2_dir_entry * de, - struct buffer_head * bh, - unsigned long offset) +static int ocfs2_check_dir_entry(struct inode * dir, +struct ocfs2_dir_entry * de, +struct buffer_head * bh, +unsigned long offset) { const char *error_msg = NULL; const int rlen = le16_to_cpu(de-rec_len); @@ -532,6 +532,26 @@ out: } /* + * This is intended to be called from inside other kernel functions, + * so we fake some arguments. + */ +int ocfs2_dir_foreach(struct inode *inode, loff_t *f_pos, void *priv, + filldir_t filldir) +{ + int ret = 0; + unsigned long version = inode-i_version; + + while (*f_pos i_size_read(inode)) { + ret = ocfs2_dir_foreach_blk(inode, version, f_pos, priv, + filldir); + if (ret) + break; + } + + return 0; +} + +/* * ocfs2_readdir() * */ diff --git a/fs/ocfs2/dir.h b/fs/ocfs2/dir.h index 7bf9c0a..075d0e9 100644 --- a/fs/ocfs2/dir.h +++ b/fs/ocfs2/dir.h @@ -62,6 +62,8 @@ int ocfs2_find_files_on_disk(const char *name, struct buffer_head **dirent_bh, struct ocfs2_dir_entry **dirent); int ocfs2_readdir(struct file *filp, void *dirent, filldir_t filldir); +int ocfs2_dir_foreach(struct inode *inode, loff_t *f_pos, void *priv, + filldir_t filldir); int ocfs2_prepare_dir_for_insert(struct ocfs2_super *osb, struct inode *dir, struct buffer_head *parent_fe_bh, @@ -76,9 +78,4 @@ int ocfs2_fill_new_dir(struct ocfs2_super *osb, struct buffer_head *fe_bh, struct ocfs2_alloc_context *data_ac); -int ocfs2_check_dir_entry(struct inode *dir, - struct ocfs2_dir_entry *de, - struct buffer_head *bh, - unsigned long offset); - #endif /* OCFS2_DIR_H */ diff --git a/fs/ocfs2/journal.c b/fs/ocfs2/journal.c index 8bbfc80..f9d01e2 100644 --- a/fs/ocfs2/journal.c +++ b/fs/ocfs2/journal.c @@ -1213,17 +1213,49 @@ bail: return status; } +struct ocfs2_orphan_filldir_priv { + struct inode*head; + struct ocfs2_super *osb; +}; + +static int ocfs2_orphan_filldir(void *priv, const char *name, int name_len, + loff_t pos, u64 ino, unsigned type) +{ + struct ocfs2_orphan_filldir_priv *p = priv; + struct inode *iter; + + if (name_len == 1 !strncmp(., name, 1)) + return 0; + if (name_len == 2 !strncmp(.., name, 2)) + return 0; + + /* Skip bad inodes so that recovery can continue */ + iter = ocfs2_iget(p-osb, ino, + OCFS2_FI_FLAG_ORPHAN_RECOVERY); + if (IS_ERR(iter)) + return 0; + + mlog(0, queue orphan %llu\n, +(unsigned long long)OCFS2_I(iter)-ip_blkno); + /* No locking is required for the next_orphan queue as there +* is only ever a single process doing orphan recovery. */ + OCFS2_I(iter)-ip_next_orphan = p-head; + p-head = iter; + + return 0; +} + static int ocfs2_queue_orphans(struct ocfs2_super *osb, int slot, struct inode **head) { int status; struct inode *orphan_dir_inode = NULL; - struct inode *iter; - unsigned long offset, blk, local; - struct buffer_head *bh = NULL; - struct
ocfs2: Write support for inline data
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=1afc32b952335f665327a1a9001ba1b44bb76fd9 Commit: 1afc32b952335f665327a1a9001ba1b44bb76fd9 Parent: 6798d35a31c413bbb3f83bbaa844bd2598168ccc Author: Mark Fasheh [EMAIL PROTECTED] AuthorDate: Fri Sep 7 14:46:51 2007 -0700 Committer: Mark Fasheh [EMAIL PROTECTED] CommitDate: Fri Oct 12 11:54:40 2007 -0700 ocfs2: Write support for inline data This fixes up write, truncate, mmap, and RESVSP/UNRESVP to understand inline inode data. For the most part, the changes to the core write code can be relied on to do the heavy lifting. Any code calling ocfs2_write_begin (including shared writeable mmap) can count on it doing the right thing with respect to growing inline data to an extent tree. Size reducing truncates, including UNRESVP can simply zero that portion of the inode block being removed. Size increasing truncatesm, including RESVP have to be a little bit smarter and grow the inode to an extent tree if necessary. Signed-off-by: Mark Fasheh [EMAIL PROTECTED] Reviewed-by: Joel Becker [EMAIL PROTECTED] --- fs/ocfs2/alloc.c | 245 fs/ocfs2/alloc.h |6 ++ fs/ocfs2/aops.c| 173 - fs/ocfs2/aops.h|4 + fs/ocfs2/file.c| 99 -- fs/ocfs2/inode.c |4 + fs/ocfs2/journal.h |3 + 7 files changed, 526 insertions(+), 8 deletions(-) diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c index c81bfdf..72cefe2 100644 --- a/fs/ocfs2/alloc.c +++ b/fs/ocfs2/alloc.c @@ -3726,6 +3726,8 @@ int ocfs2_insert_extent(struct ocfs2_super *osb, struct ocfs2_insert_type insert = {0, }; struct ocfs2_extent_rec rec; + BUG_ON(OCFS2_I(inode)-ip_dyn_features OCFS2_INLINE_DATA_FL); + mlog(0, add %u clusters at position %u to inode %llu\n, new_clusters, cpos, (unsigned long long)OCFS2_I(inode)-ip_blkno); @@ -5826,6 +5828,174 @@ out: return ret; } +static void ocfs2_zero_dinode_id2(struct inode *inode, struct ocfs2_dinode *di) +{ + unsigned int blocksize = 1 inode-i_sb-s_blocksize_bits; + + memset(di-id2, 0, blocksize - offsetof(struct ocfs2_dinode, id2)); +} + +void ocfs2_set_inode_data_inline(struct inode *inode, struct ocfs2_dinode *di) +{ + struct ocfs2_inode_info *oi = OCFS2_I(inode); + struct ocfs2_inline_data *idata = di-id2.i_data; + + spin_lock(oi-ip_lock); + oi-ip_dyn_features |= OCFS2_INLINE_DATA_FL; + di-i_dyn_features = cpu_to_le16(oi-ip_dyn_features); + spin_unlock(oi-ip_lock); + + /* +* We clear the entire i_data structure here so that all +* fields can be properly initialized. +*/ + ocfs2_zero_dinode_id2(inode, di); + + idata-id_count = cpu_to_le16(ocfs2_max_inline_data(inode-i_sb)); +} + +int ocfs2_convert_inline_data_to_extents(struct inode *inode, +struct buffer_head *di_bh) +{ + int ret, i, has_data, num_pages = 0; + handle_t *handle; + u64 uninitialized_var(block); + struct ocfs2_inode_info *oi = OCFS2_I(inode); + struct ocfs2_super *osb = OCFS2_SB(inode-i_sb); + struct ocfs2_dinode *di = (struct ocfs2_dinode *)di_bh-b_data; + struct ocfs2_extent_list *el = di-id2.i_list; + struct ocfs2_alloc_context *data_ac = NULL; + struct page **pages = NULL; + loff_t end = osb-s_clustersize; + + has_data = i_size_read(inode) ? 1 : 0; + + if (has_data) { + pages = kcalloc(ocfs2_pages_per_cluster(osb-sb), + sizeof(struct page *), GFP_NOFS); + if (pages == NULL) { + ret = -ENOMEM; + mlog_errno(ret); + goto out; + } + + ret = ocfs2_reserve_clusters(osb, 1, data_ac); + if (ret) { + mlog_errno(ret); + goto out; + } + } + + handle = ocfs2_start_trans(osb, OCFS2_INLINE_TO_EXTENTS_CREDITS); + if (IS_ERR(handle)) { + ret = PTR_ERR(handle); + mlog_errno(ret); + goto out_unlock; + } + + ret = ocfs2_journal_access(handle, inode, di_bh, + OCFS2_JOURNAL_ACCESS_WRITE); + if (ret) { + mlog_errno(ret); + goto out_commit; + } + + if (has_data) { + u32 bit_off, num; + unsigned int page_end; + u64 phys; + + ret = ocfs2_claim_clusters(osb, handle, data_ac, 1, bit_off, + num); + if (ret) { + mlog_errno(ret); + goto out_commit; + } + + /* +
ocfs2: Abstract out core dir listing functionality
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b8bc5f4fde376c9eee524a9a2b7e85560e604e85 Commit: b8bc5f4fde376c9eee524a9a2b7e85560e604e85 Parent: 316f4b9f98a353ac1be93199694fd97272378815 Author: Mark Fasheh [EMAIL PROTECTED] AuthorDate: Mon Sep 10 17:17:52 2007 -0700 Committer: Mark Fasheh [EMAIL PROTECTED] CommitDate: Fri Oct 12 11:54:36 2007 -0700 ocfs2: Abstract out core dir listing functionality Put this in it's own function so that the functionality can be overridden. Signed-off-by: Mark Fasheh [EMAIL PROTECTED] Reviewed-by: Joel Becker [EMAIL PROTECTED] --- fs/ocfs2/dir.c | 103 ++- 1 files changed, 56 insertions(+), 47 deletions(-) diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c index 8e0ae02..d1f92fd 100644 --- a/fs/ocfs2/dir.c +++ b/fs/ocfs2/dir.c @@ -414,11 +414,8 @@ bail: return retval; } -/* - * ocfs2_readdir() - * - */ -int ocfs2_readdir(struct file * filp, void * dirent, filldir_t filldir) +static int ocfs2_dir_foreach_blk(struct inode *inode, unsigned long *f_version, +loff_t *f_pos, void *priv, filldir_t filldir) { int error = 0; unsigned long offset, blk, last_ra_blk = 0; @@ -426,45 +423,23 @@ int ocfs2_readdir(struct file * filp, void * dirent, filldir_t filldir) struct buffer_head * bh, * tmp; struct ocfs2_dir_entry * de; int err; - struct inode *inode = filp-f_path.dentry-d_inode; struct super_block * sb = inode-i_sb; unsigned int ra_sectors = 16; - int lock_level = 0; - - mlog_entry(dirino=%llu\n, - (unsigned long long)OCFS2_I(inode)-ip_blkno); stored = 0; bh = NULL; - error = ocfs2_meta_lock_atime(inode, filp-f_vfsmnt, lock_level); - if (lock_level error = 0) { - /* We release EX lock which used to update atime -* and get PR lock again to reduce contention -* on commonly accessed directories. */ - ocfs2_meta_unlock(inode, 1); - lock_level = 0; - error = ocfs2_meta_lock(inode, NULL, 0); - } - if (error 0) { - if (error != -ENOENT) - mlog_errno(error); - /* we haven't got any yet, so propagate the error. */ - stored = error; - goto bail_nolock; - } - - offset = filp-f_pos (sb-s_blocksize - 1); + offset = (*f_pos) (sb-s_blocksize - 1); - while (!error !stored filp-f_pos i_size_read(inode)) { - blk = (filp-f_pos) sb-s_blocksize_bits; + while (!error !stored *f_pos i_size_read(inode)) { + blk = (*f_pos) sb-s_blocksize_bits; bh = ocfs2_bread(inode, blk, err, 0); if (!bh) { mlog(ML_ERROR, directory #%llu contains a hole at offset %lld\n, (unsigned long long)OCFS2_I(inode)-ip_blkno, -filp-f_pos); - filp-f_pos += sb-s_blocksize - offset; +*f_pos); + *f_pos += sb-s_blocksize - offset; continue; } @@ -490,7 +465,7 @@ revalidate: * readdir(2), then we might be pointing to an invalid * dirent right now. Scan from the start of the block * to make sure. */ - if (filp-f_version != inode-i_version) { + if (*f_version != inode-i_version) { for (i = 0; i sb-s_blocksize i offset; ) { de = (struct ocfs2_dir_entry *) (bh-b_data + i); /* It's too expensive to do a full @@ -505,21 +480,20 @@ revalidate: i += le16_to_cpu(de-rec_len); } offset = i; - filp-f_pos = (filp-f_pos ~(sb-s_blocksize - 1)) + *f_pos = ((*f_pos) ~(sb-s_blocksize - 1)) | offset; - filp-f_version = inode-i_version; + *f_version = inode-i_version; } - while (!error filp-f_pos i_size_read(inode) + while (!error *f_pos i_size_read(inode) offset sb-s_blocksize) { de = (struct ocfs2_dir_entry *) (bh-b_data + offset); if (!ocfs2_check_dir_entry(inode, de, bh, offset)) { /* On error, skip the f_pos to the next block. */ - filp-f_pos = (filp-f_pos | - (sb-s_blocksize - 1)) + 1; + *f_pos =
ocfs2: Write support for directories with inline data
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5b6a3a2b4a5f071d170f8122038dd647a84810a8 Commit: 5b6a3a2b4a5f071d170f8122038dd647a84810a8 Parent: 23193e513d1cd69411469f028d56fd175d4a6b07 Author: Mark Fasheh [EMAIL PROTECTED] AuthorDate: Thu Sep 13 16:33:54 2007 -0700 Committer: Mark Fasheh [EMAIL PROTECTED] CommitDate: Fri Oct 12 11:54:41 2007 -0700 ocfs2: Write support for directories with inline data Create all new directories with OCFS2_INLINE_DATA_FL and the inline data bytes formatted as an empty directory. Inode size field reflects the actual amount of inline data available, which makes searching for dirent space very similar to the regular directory search. Inline-data directories are automatically pushed out to extents on any insert request which is too large for the available space. Signed-off-by: Mark Fasheh [EMAIL PROTECTED] Reviewed-by: Joel Becker [EMAIL PROTECTED] --- fs/ocfs2/alloc.c | 16 +- fs/ocfs2/alloc.h |1 + fs/ocfs2/dir.c | 618 +++--- fs/ocfs2/namei.c | 57 -- 4 files changed, 594 insertions(+), 98 deletions(-) diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c index 72cefe2..4ba7f0b 100644 --- a/fs/ocfs2/alloc.c +++ b/fs/ocfs2/alloc.c @@ -5835,6 +5835,15 @@ static void ocfs2_zero_dinode_id2(struct inode *inode, struct ocfs2_dinode *di) memset(di-id2, 0, blocksize - offsetof(struct ocfs2_dinode, id2)); } +void ocfs2_dinode_new_extent_list(struct inode *inode, + struct ocfs2_dinode *di) +{ + ocfs2_zero_dinode_id2(inode, di); + di-id2.i_list.l_tree_depth = 0; + di-id2.i_list.l_next_free_rec = 0; + di-id2.i_list.l_count = cpu_to_le16(ocfs2_extent_recs_per_inode(inode-i_sb)); +} + void ocfs2_set_inode_data_inline(struct inode *inode, struct ocfs2_dinode *di) { struct ocfs2_inode_info *oi = OCFS2_I(inode); @@ -5863,7 +5872,6 @@ int ocfs2_convert_inline_data_to_extents(struct inode *inode, struct ocfs2_inode_info *oi = OCFS2_I(inode); struct ocfs2_super *osb = OCFS2_SB(inode-i_sb); struct ocfs2_dinode *di = (struct ocfs2_dinode *)di_bh-b_data; - struct ocfs2_extent_list *el = di-id2.i_list; struct ocfs2_alloc_context *data_ac = NULL; struct page **pages = NULL; loff_t end = osb-s_clustersize; @@ -5956,11 +5964,7 @@ int ocfs2_convert_inline_data_to_extents(struct inode *inode, di-i_dyn_features = cpu_to_le16(oi-ip_dyn_features); spin_unlock(oi-ip_lock); - ocfs2_zero_dinode_id2(inode, di); - - el-l_tree_depth = 0; - el-l_next_free_rec = 0; - el-l_count = cpu_to_le16(ocfs2_extent_recs_per_inode(inode-i_sb)); + ocfs2_dinode_new_extent_list(inode, di); ocfs2_journal_dirty(handle, di_bh); diff --git a/fs/ocfs2/alloc.h b/fs/ocfs2/alloc.h index 826e0a6..42ff94b 100644 --- a/fs/ocfs2/alloc.h +++ b/fs/ocfs2/alloc.h @@ -62,6 +62,7 @@ static inline int ocfs2_extend_meta_needed(struct ocfs2_dinode *fe) return le16_to_cpu(fe-id2.i_list.l_tree_depth) + 2; } +void ocfs2_dinode_new_extent_list(struct inode *inode, struct ocfs2_dinode *di); void ocfs2_set_inode_data_inline(struct inode *inode, struct ocfs2_dinode *di); int ocfs2_convert_inline_data_to_extents(struct inode *inode, struct buffer_head *di_bh); diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c index 8deed89..e153513 100644 --- a/fs/ocfs2/dir.c +++ b/fs/ocfs2/dir.c @@ -72,6 +72,7 @@ static unsigned char ocfs2_filetype_table[] = { static int ocfs2_extend_dir(struct ocfs2_super *osb, struct inode *dir, struct buffer_head *parent_fe_bh, + unsigned int blocks_wanted, struct buffer_head **new_de_bh); static int ocfs2_do_extend_dir(struct super_block *sb, handle_t *handle, @@ -331,12 +332,20 @@ struct buffer_head *ocfs2_find_entry(const char *name, int namelen, return ocfs2_find_entry_el(name, namelen, dir, res_dir); } +/* + * Update inode number and type of a previously found directory entry. + */ int ocfs2_update_entry(struct inode *dir, handle_t *handle, struct buffer_head *de_bh, struct ocfs2_dir_entry *de, struct inode *new_entry_inode) { int ret; + /* +* The same code works fine for both inline-data and extent +* based directories, so no need to split this up. +*/ + ret = ocfs2_journal_access(handle, dir, de_bh, OCFS2_JOURNAL_ACCESS_WRITE); if (ret) { @@ -353,14 +362,10 @@ out: return ret; } -/* - * ocfs2_delete_entry deletes a directory entry by merging it with the - * previous entry - */ -int ocfs2_delete_entry(handle_t *handle, -
ocfs2: Optionally return filldir errors
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e7b34019606ab1dd06196635e931b0c302799228 Commit: e7b34019606ab1dd06196635e931b0c302799228 Parent: 5b6a3a2b4a5f071d170f8122038dd647a84810a8 Author: Mark Fasheh [EMAIL PROTECTED] AuthorDate: Mon Sep 24 14:25:27 2007 -0700 Committer: Mark Fasheh [EMAIL PROTECTED] CommitDate: Fri Oct 12 11:54:41 2007 -0700 ocfs2: Optionally return filldir errors Modify ocfs2_dir_foreach_blk() to optionally return any error from the filldir callback. This way ocfs2_dirforeach() can terminate early, as opposed to always passing through the entire directory. This fixes a bug introduced during a previous code refactor where ocfs2_empty_dir() would loop infinitely. Signed-off-by: Mark Fasheh [EMAIL PROTECTED] --- fs/ocfs2/dir.c | 33 ++--- 1 files changed, 22 insertions(+), 11 deletions(-) diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c index e153513..7453b70 100644 --- a/fs/ocfs2/dir.c +++ b/fs/ocfs2/dir.c @@ -588,7 +588,7 @@ bail: static int ocfs2_dir_foreach_blk_id(struct inode *inode, unsigned long *f_version, loff_t *f_pos, void *priv, - filldir_t filldir) + filldir_t filldir, int *filldir_err) { int ret, i, filldir_ret; unsigned long offset = *f_pos; @@ -659,8 +659,11 @@ revalidate: *f_pos, le64_to_cpu(de-inode), d_type); - if (filldir_ret) + if (filldir_ret) { + if (filldir_err) + *filldir_err = filldir_ret; break; + } if (version != *f_version) goto revalidate; } @@ -676,7 +679,7 @@ out: static int ocfs2_dir_foreach_blk_el(struct inode *inode, unsigned long *f_version, loff_t *f_pos, void *priv, - filldir_t filldir) + filldir_t filldir, int *filldir_err) { int error = 0; unsigned long offset, blk, last_ra_blk = 0; @@ -775,8 +778,11 @@ revalidate: *f_pos, le64_to_cpu(de-inode), d_type); - if (error) + if (error) { + if (filldir_err) + *filldir_err = error; break; + } if (version != *f_version) goto revalidate; stored ++; @@ -793,13 +799,15 @@ out: } static int ocfs2_dir_foreach_blk(struct inode *inode, unsigned long *f_version, -loff_t *f_pos, void *priv, filldir_t filldir) +loff_t *f_pos, void *priv, filldir_t filldir, +int *filldir_err) { if (OCFS2_I(inode)-ip_dyn_features OCFS2_INLINE_DATA_FL) return ocfs2_dir_foreach_blk_id(inode, f_version, f_pos, priv, - filldir); + filldir, filldir_err); - return ocfs2_dir_foreach_blk_el(inode, f_version, f_pos, priv, filldir); + return ocfs2_dir_foreach_blk_el(inode, f_version, f_pos, priv, filldir, + filldir_err); } /* @@ -809,16 +817,19 @@ static int ocfs2_dir_foreach_blk(struct inode *inode, unsigned long *f_version, int ocfs2_dir_foreach(struct inode *inode, loff_t *f_pos, void *priv, filldir_t filldir) { - int ret = 0; + int ret = 0, filldir_err = 0; unsigned long version = inode-i_version; while (*f_pos i_size_read(inode)) { ret = ocfs2_dir_foreach_blk(inode, version, f_pos, priv, - filldir); - if (ret) + filldir, filldir_err); + if (ret || filldir_err) break; } + if (ret 0) + ret = -EIO; + return 0; } @@ -852,7 +863,7 @@ int ocfs2_readdir(struct file * filp, void * dirent, filldir_t filldir) } error = ocfs2_dir_foreach_blk(inode, filp-f_version, filp-f_pos, - dirent, filldir); +
clockevents: Remove unused inline function
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7f8033b76c8eea89dec9f658f4a31bcd4fe84bbb Commit: 7f8033b76c8eea89dec9f658f4a31bcd4fe84bbb Parent: 782e3b3b3804c38d5130c7f21d7ec7bf6709023f Author: Thomas Gleixner [EMAIL PROTECTED] AuthorDate: Fri Oct 12 23:04:05 2007 +0200 Committer: Thomas Gleixner [EMAIL PROTECTED] CommitDate: Fri Oct 12 23:04:05 2007 +0200 clockevents: Remove unused inline function Signed-off-by: Thomas Gleixner [EMAIL PROTECTED] Signed-off-by: Ingo Molnar [EMAIL PROTECTED] Signed-off-by: Arjan van de Ven [EMAIL PROTECTED] --- include/linux/clockchips.h |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h index def5a65..f368a6f 100644 --- a/include/linux/clockchips.h +++ b/include/linux/clockchips.h @@ -130,7 +130,6 @@ extern void clockevents_notify(unsigned long reason, void *arg); #else -static inline void clockevents_resume_events(void) { } #define clockevents_notify(reason, arg) do { } while (0) #endif - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
clockevents: fix periodic broadcast for oneshot devices
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c8a1d398de70a7774359b4720c392891cdd485f9 Commit: c8a1d398de70a7774359b4720c392891cdd485f9 Parent: de68d9b173ee657115dd0e584c2365b7954253a5 Author: Thomas Gleixner [EMAIL PROTECTED] AuthorDate: Fri Oct 12 23:04:06 2007 +0200 Committer: Thomas Gleixner [EMAIL PROTECTED] CommitDate: Fri Oct 12 23:04:06 2007 +0200 clockevents: fix periodic broadcast for oneshot devices The next_event member of the clock event device is used to keep track of the next periodic event. For one shot only devices it is wrong to clear the variable, as the next event will be based on it. Pointed out by Ralf Baechle Signed-off-by: Thomas Gleixner [EMAIL PROTECTED] Signed-off-by: Ingo Molnar [EMAIL PROTECTED] Signed-off-by: Arjan van de Ven [EMAIL PROTECTED] --- kernel/time/tick-broadcast.c |2 -- 1 files changed, 0 insertions(+), 2 deletions(-) diff --git a/kernel/time/tick-broadcast.c b/kernel/time/tick-broadcast.c index 0962e05..acf15b4 100644 --- a/kernel/time/tick-broadcast.c +++ b/kernel/time/tick-broadcast.c @@ -176,8 +176,6 @@ static void tick_do_periodic_broadcast(void) */ static void tick_handle_periodic_broadcast(struct clock_event_device *dev) { - dev-next_event.tv64 = KTIME_MAX; - tick_do_periodic_broadcast(); /* - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
ocfs2: Read support for directories with inline data
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=23193e513d1cd69411469f028d56fd175d4a6b07 Commit: 23193e513d1cd69411469f028d56fd175d4a6b07 Parent: 1afc32b952335f665327a1a9001ba1b44bb76fd9 Author: Mark Fasheh [EMAIL PROTECTED] AuthorDate: Wed Sep 12 13:01:18 2007 -0700 Committer: Mark Fasheh [EMAIL PROTECTED] CommitDate: Fri Oct 12 11:54:40 2007 -0700 ocfs2: Read support for directories with inline data This splits out extent based directory read support and implements inline-data versions of those functions. All knowledge of inline-data versus extent based directories is internalized. For lookups the code uses ocfs2_find_entry_id(), full dir iterations make use of ocfs2_dir_foreach_blk_id(). Signed-off-by: Mark Fasheh [EMAIL PROTECTED] Reviewed-by: Joel Becker [EMAIL PROTECTED] --- fs/ocfs2/dir.c | 176 +--- 1 files changed, 168 insertions(+), 8 deletions(-) diff --git a/fs/ocfs2/dir.c b/fs/ocfs2/dir.c index f2e2ffb..8deed89 100644 --- a/fs/ocfs2/dir.c +++ b/fs/ocfs2/dir.c @@ -81,6 +81,10 @@ static int ocfs2_do_extend_dir(struct super_block *sb, struct ocfs2_alloc_context *meta_ac, struct buffer_head **new_bh); +/* + * bh passed here can be an inode block or a dir data block, depending + * on the inode inline data flag. + */ static int ocfs2_check_dir_entry(struct inode * dir, struct ocfs2_dir_entry * de, struct buffer_head * bh, @@ -125,6 +129,8 @@ static int inline ocfs2_search_dirblock(struct buffer_head *bh, struct inode *dir, const char *name, int namelen, unsigned long offset, + char *first_de, + unsigned int bytes, struct ocfs2_dir_entry **res_dir) { struct ocfs2_dir_entry *de; @@ -134,8 +140,8 @@ static int inline ocfs2_search_dirblock(struct buffer_head *bh, mlog_entry_void(); - de_buf = bh-b_data; - dlimit = de_buf + dir-i_sb-s_blocksize; + de_buf = first_de; + dlimit = de_buf + bytes; while (de_buf dlimit) { /* this code is executed quadratically often */ @@ -171,9 +177,39 @@ bail: return ret; } -struct buffer_head *ocfs2_find_entry(const char *name, int namelen, -struct inode *dir, -struct ocfs2_dir_entry **res_dir) +static struct buffer_head *ocfs2_find_entry_id(const char *name, + int namelen, + struct inode *dir, + struct ocfs2_dir_entry **res_dir) +{ + int ret, found; + struct buffer_head *di_bh = NULL; + struct ocfs2_dinode *di; + struct ocfs2_inline_data *data; + + ret = ocfs2_read_block(OCFS2_SB(dir-i_sb), OCFS2_I(dir)-ip_blkno, + di_bh, OCFS2_BH_CACHED, dir); + if (ret) { + mlog_errno(ret); + goto out; + } + + di = (struct ocfs2_dinode *)di_bh-b_data; + data = di-id2.i_data; + + found = ocfs2_search_dirblock(di_bh, dir, name, namelen, 0, + data-id_data, i_size_read(dir), res_dir); + if (found == 1) + return di_bh; + + brelse(di_bh); +out: + return NULL; +} + +struct buffer_head *ocfs2_find_entry_el(const char *name, int namelen, + struct inode *dir, + struct ocfs2_dir_entry **res_dir) { struct super_block *sb; struct buffer_head *bh_use[NAMEI_RA_SIZE]; @@ -188,7 +224,6 @@ struct buffer_head *ocfs2_find_entry(const char *name, int namelen, mlog_entry_void(); - *res_dir = NULL; sb = dir-i_sb; nblocks = i_size_read(dir) sb-s_blocksize_bits; @@ -236,6 +271,7 @@ restart: } i = ocfs2_search_dirblock(bh, dir, name, namelen, block sb-s_blocksize_bits, + bh-b_data, sb-s_blocksize, res_dir); if (i == 1) { OCFS2_I(dir)-ip_dir_start_lookup = block; @@ -271,6 +307,30 @@ cleanup_and_exit: return ret; } +/* + * Try to find an entry of the provided name within 'dir'. + * + * If nothing was found, NULL is returned. Otherwise, a buffer_head + * and pointer to the dir entry are passed back. + * + * Caller can NOT assume anything about the contents of the + * buffer_head - it is passed back
clockevents: Allow build w/o run-tine usage for migration purposes
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=de68d9b173ee657115dd0e584c2365b7954253a5 Commit: de68d9b173ee657115dd0e584c2365b7954253a5 Parent: 7f8033b76c8eea89dec9f658f4a31bcd4fe84bbb Author: Thomas Gleixner [EMAIL PROTECTED] AuthorDate: Fri Oct 12 23:04:05 2007 +0200 Committer: Thomas Gleixner [EMAIL PROTECTED] CommitDate: Fri Oct 12 23:04:05 2007 +0200 clockevents: Allow build w/o run-tine usage for migration purposes Migration aid to allow preparatory patches which introduce not yet used parts of clock events code. Signed-off-by: Thomas Gleixner [EMAIL PROTECTED] Signed-off-by: Ingo Molnar [EMAIL PROTECTED] Signed-off-by: Arjan van de Ven [EMAIL PROTECTED] --- include/linux/clockchips.h |8 ++-- kernel/time/Kconfig|5 + kernel/time/Makefile |2 +- kernel/time/clockevents.c |3 ++- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h index f368a6f..d2ddea9 100644 --- a/include/linux/clockchips.h +++ b/include/linux/clockchips.h @@ -8,7 +8,7 @@ #ifndef _LINUX_CLOCKCHIPS_H #define _LINUX_CLOCKCHIPS_H -#ifdef CONFIG_GENERIC_CLOCKEVENTS +#ifdef CONFIG_GENERIC_CLOCKEVENTS_BUILD #include linux/clocksource.h #include linux/cpumask.h @@ -126,9 +126,13 @@ extern int clockevents_register_notifier(struct notifier_block *nb); extern int clockevents_program_event(struct clock_event_device *dev, ktime_t expires, ktime_t now); +#ifdef CONFIG_GENERIC_CLOCKEVENTS extern void clockevents_notify(unsigned long reason, void *arg); - #else +# define clockevents_notify(reason, arg) do { } while (0) +#endif + +#else /* CONFIG_GENERIC_CLOCKEVENTS_BUILD */ #define clockevents_notify(reason, arg) do { } while (0) diff --git a/kernel/time/Kconfig b/kernel/time/Kconfig index f663511..8d53106 100644 --- a/kernel/time/Kconfig +++ b/kernel/time/Kconfig @@ -23,3 +23,8 @@ config HIGH_RES_TIMERS hardware is not capable then this option only increases the size of the kernel image. +config GENERIC_CLOCKEVENTS_BUILD + bool + default y + depends on GENERIC_CLOCKEVENTS || GENERIC_CLOCKEVENTS_MIGR + diff --git a/kernel/time/Makefile b/kernel/time/Makefile index 99b6034..905b0b5 100644 --- a/kernel/time/Makefile +++ b/kernel/time/Makefile @@ -1,6 +1,6 @@ obj-y += timekeeping.o ntp.o clocksource.o jiffies.o timer_list.o -obj-$(CONFIG_GENERIC_CLOCKEVENTS) += clockevents.o +obj-$(CONFIG_GENERIC_CLOCKEVENTS_BUILD)+= clockevents.o obj-$(CONFIG_GENERIC_CLOCKEVENTS) += tick-common.o obj-$(CONFIG_GENERIC_CLOCKEVENTS_BROADCAST)+= tick-broadcast.o obj-$(CONFIG_TICK_ONESHOT) += tick-oneshot.o diff --git a/kernel/time/clockevents.c b/kernel/time/clockevents.c index 41dd310..822beeb 100644 --- a/kernel/time/clockevents.c +++ b/kernel/time/clockevents.c @@ -194,6 +194,7 @@ void clockevents_exchange_device(struct clock_event_device *old, local_irq_restore(flags); } +#ifdef CONFIG_GENERIC_CLOCKEVENTS /** * clockevents_notify - notification about relevant events */ @@ -222,4 +223,4 @@ void clockevents_notify(unsigned long reason, void *arg) spin_unlock(clockevents_lock); } EXPORT_SYMBOL_GPL(clockevents_notify); - +#endif - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
x86_64: Select clocksource watchdog in Kconfig
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=89b2bbd69b89b4c5efdc112a88d72419bdeb8dfc Commit: 89b2bbd69b89b4c5efdc112a88d72419bdeb8dfc Parent: 8f36881b3c972ebc019195692849f22488f9c0a3 Author: Thomas Gleixner [EMAIL PROTECTED] AuthorDate: Fri Oct 12 23:04:06 2007 +0200 Committer: Thomas Gleixner [EMAIL PROTECTED] CommitDate: Fri Oct 12 23:04:06 2007 +0200 x86_64: Select clocksource watchdog in Kconfig TSC must be verified by a continous and reliable clocksource to allow high resolution timers and or dynamic ticks. Signed-off-by: Thomas Gleixner [EMAIL PROTECTED] Signed-off-by: Ingo Molnar [EMAIL PROTECTED] Signed-off-by: Arjan van de Ven [EMAIL PROTECTED] --- arch/x86_64/Kconfig |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/arch/x86_64/Kconfig b/arch/x86_64/Kconfig index b1b98e6..520f33b 100644 --- a/arch/x86_64/Kconfig +++ b/arch/x86_64/Kconfig @@ -36,6 +36,10 @@ config GENERIC_CMOS_UPDATE bool default y +config CLOCKSOURCE_WATCHDOG + bool + default y + config ZONE_DMA32 bool default y - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
x86: Geode MFGPT clock event device support
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=8f36881b3c972ebc019195692849f22488f9c0a3 Commit: 8f36881b3c972ebc019195692849f22488f9c0a3 Parent: 83d7384f8d4aa216b49cf9cb286ea743054b119f Author: Andres Salomon [EMAIL PROTECTED] AuthorDate: Fri Oct 12 23:04:06 2007 +0200 Committer: Thomas Gleixner [EMAIL PROTECTED] CommitDate: Fri Oct 12 23:04:06 2007 +0200 x86: Geode MFGPT clock event device support Add support for an MFGPT clock event device; this allows us to use MFGPTs as the basis for high-resolution timers. Signed-off-by: Jordan Crouse [EMAIL PROTECTED] Signed-off-by: Andres Salomon [EMAIL PROTECTED] Cc: Andi Kleen [EMAIL PROTECTED] Cc: Alan Cox [EMAIL PROTECTED] Cc: john stultz [EMAIL PROTECTED] Signed-off-by: Andrew Morton [EMAIL PROTECTED] Signed-off-by: Ingo Molnar [EMAIL PROTECTED] Signed-off-by: Arjan van de Ven [EMAIL PROTECTED] Signed-off-by: Thomas Gleixner [EMAIL PROTECTED] --- Documentation/kernel-parameters.txt |4 + arch/i386/Kconfig | 10 ++ arch/x86/kernel/mfgpt_32.c | 165 +++ 3 files changed, 179 insertions(+), 0 deletions(-) diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index 2128de6..f27cdd7 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt @@ -1009,6 +1009,10 @@ and is between 256 and 4096 characters. It is defined in the file meye.*= [HW] Set MotionEye Camera parameters See Documentation/video4linux/meye.txt. + mfgpt_irq= [IA-32] Specify the IRQ to use for the + Multi-Function General Purpose Timers on AMD Geode + platforms. + mga=[HW,DRM] mousedev.tap_time= diff --git a/arch/i386/Kconfig b/arch/i386/Kconfig index 2d85e4b..6bbbc27 100644 --- a/arch/i386/Kconfig +++ b/arch/i386/Kconfig @@ -1206,6 +1206,16 @@ config SCx200HR_TIMER processor goes idle (as is done by the scheduler). The other workaround is idle=poll boot option. +config GEODE_MFGPT_TIMER + bool Geode Multi-Function General Purpose Timer (MFGPT) events + depends on MGEODE_LX GENERIC_TIME GENERIC_CLOCKEVENTS + default y + help + This driver provides a clock event source based on the MFGPT + timer(s) in the CS5535 and CS5536 companion chip for the geode. + MFGPTs have a better resolution and max interval than the + generic PIT, and are suitable for use as high-res timers. + config K8_NB def_bool y depends on AGP_AMD64 diff --git a/arch/x86/kernel/mfgpt_32.c b/arch/x86/kernel/mfgpt_32.c index 3a63a2d..0ab680f 100644 --- a/arch/x86/kernel/mfgpt_32.c +++ b/arch/x86/kernel/mfgpt_32.c @@ -48,6 +48,12 @@ static struct mfgpt_timer_t { #define MFGPT_HZ (32000 / MFGPT_DIVISOR) #define MFGPT_PERIODIC (MFGPT_HZ / HZ) +#ifdef CONFIG_GEODE_MFGPT_TIMER +static int __init mfgpt_timer_setup(void); +#else +#define mfgpt_timer_setup() (0) +#endif + /* Allow for disabling of MFGPTs */ static int disable; static int __init mfgpt_disable(char *s) @@ -82,6 +88,9 @@ int __init geode_mfgpt_detect(void) } } + /* set up clock event device, if desired */ + i = mfgpt_timer_setup(); + return count; } @@ -195,3 +204,159 @@ int geode_mfgpt_alloc_timer(int timer, int domain, struct module *owner) return -1; } + +#ifdef CONFIG_GEODE_MFGPT_TIMER + +/* + * The MFPGT timers on the CS5536 provide us with suitable timers to use + * as clock event sources - not as good as a HPET or APIC, but certainly + * better then the PIT. This isn't a general purpose MFGPT driver, but + * a simplified one designed specifically to act as a clock event source. + * For full details about the MFGPT, please consult the CS5536 data sheet. + */ + +#include linux/clocksource.h +#include linux/clockchips.h + +static unsigned int mfgpt_tick_mode = CLOCK_EVT_MODE_SHUTDOWN; +static u16 mfgpt_event_clock; + +static int irq = 7; +static int __init mfgpt_setup(char *str) +{ + get_option(str, irq); + return 1; +} +__setup(mfgpt_irq=, mfgpt_setup); + +static inline void mfgpt_disable_timer(u16 clock) +{ + u16 val = geode_mfgpt_read(clock, MFGPT_REG_SETUP); + geode_mfgpt_write(clock, MFGPT_REG_SETUP, val ~MFGPT_SETUP_CNTEN); +} + +static int mfgpt_next_event(unsigned long, struct clock_event_device *); +static void mfgpt_set_mode(enum clock_event_mode, struct clock_event_device *); + +static struct clock_event_device mfgpt_clockevent = { + .name = mfgpt-timer, + .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, + .set_mode = mfgpt_set_mode, + .set_next_event = mfgpt_next_event, + .rating = 250, + .cpumask = CPU_MASK_ALL, + .shift = 32 +}; + +static inline
x86: Geode Multi-Function General Purpose Timers support
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=83d7384f8d4aa216b49cf9cb286ea743054b119f Commit: 83d7384f8d4aa216b49cf9cb286ea743054b119f Parent: 5fa3a246ea2e1be2ffaa01343bc183c8c0bfa472 Author: Andres Salomon [EMAIL PROTECTED] AuthorDate: Fri Oct 12 23:04:06 2007 +0200 Committer: Thomas Gleixner [EMAIL PROTECTED] CommitDate: Fri Oct 12 23:04:06 2007 +0200 x86: Geode Multi-Function General Purpose Timers support This adds support for Multi-Function General Purpose Timers. It detects the available timers during southbridge init, and provides an API for allocating and setting the timers. They're higher resolution than the standard PIT, so the MFGPTs come in handy for quite a few things. Note that we never clobber the timers that the BIOS might have opted to use; we just check for unused timers. Signed-off-by: Jordan Crouse [EMAIL PROTECTED] Signed-off-by: Andres Salomon [EMAIL PROTECTED] Cc: Andi Kleen [EMAIL PROTECTED] Cc: Alan Cox [EMAIL PROTECTED] Signed-off-by: Andrew Morton [EMAIL PROTECTED] Signed-off-by: Ingo Molnar [EMAIL PROTECTED] Signed-off-by: Arjan van de Ven [EMAIL PROTECTED] Signed-off-by: Thomas Gleixner [EMAIL PROTECTED] --- Documentation/kernel-parameters.txt |3 + arch/x86/kernel/Makefile_32 |2 +- arch/x86/kernel/geode_32.c |4 + arch/x86/kernel/mfgpt_32.c | 197 +++ include/asm-x86/geode.h | 50 + 5 files changed, 255 insertions(+), 1 deletions(-) diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt index a57c1f2..2128de6 100644 --- a/Documentation/kernel-parameters.txt +++ b/Documentation/kernel-parameters.txt @@ -1160,6 +1160,9 @@ and is between 256 and 4096 characters. It is defined in the file nomce [X86-32] Machine Check Exception + nomfgpt [X86-32] Disable Multi-Function General Purpose + Timer usage (for AMD Geode machines). + noreplace-paravirt [X86-32,PV_OPS] Don't patch paravirt_ops noreplace-smp [X86-32,SMP] Don't replace SMP instructions diff --git a/arch/x86/kernel/Makefile_32 b/arch/x86/kernel/Makefile_32 index c624193..1035644 100644 --- a/arch/x86/kernel/Makefile_32 +++ b/arch/x86/kernel/Makefile_32 @@ -39,7 +39,7 @@ obj-$(CONFIG_VM86)+= vm86_32.o obj-$(CONFIG_EARLY_PRINTK) += early_printk.o obj-$(CONFIG_HPET_TIMER) += hpet_32.o obj-$(CONFIG_K8_NB)+= k8.o -obj-$(CONFIG_MGEODE_LX)+= geode_32.o +obj-$(CONFIG_MGEODE_LX)+= geode_32.o mfgpt_32.o obj-$(CONFIG_VMI) += vmi_32.o vmiclock_32.o obj-$(CONFIG_PARAVIRT) += paravirt_32.o diff --git a/arch/x86/kernel/geode_32.c b/arch/x86/kernel/geode_32.c index 41e8aec..f12d8c5 100644 --- a/arch/x86/kernel/geode_32.c +++ b/arch/x86/kernel/geode_32.c @@ -145,10 +145,14 @@ EXPORT_SYMBOL_GPL(geode_gpio_setup_event); static int __init geode_southbridge_init(void) { + int timers; + if (!is_geode()) return -ENODEV; init_lbars(); + timers = geode_mfgpt_detect(); + printk(KERN_INFO geode: %d MFGPT timers available.\n, timers); return 0; } diff --git a/arch/x86/kernel/mfgpt_32.c b/arch/x86/kernel/mfgpt_32.c new file mode 100644 index 000..3a63a2d --- /dev/null +++ b/arch/x86/kernel/mfgpt_32.c @@ -0,0 +1,197 @@ +/* + * Driver/API for AMD Geode Multi-Function General Purpose Timers (MFGPT) + * + * Copyright (C) 2006, Advanced Micro Devices, Inc. + * Copyright (C) 2007, Andres Salomon [EMAIL PROTECTED] + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU General Public License + * as published by the Free Software Foundation. + * + * The MFGPTs are documented in AMD Geode CS5536 Companion Device Data Book. + */ + +/* + * We are using the 32Khz input clock - its the only one that has the + * ranges we find desirable. The following table lists the suitable + * divisors and the associated hz, minimum interval + * and the maximum interval: + * + * Divisor Hz Min Delta (S) Max Delta (S) + * 132000 .0005 2.048 + * 216000 .001 4.096 + * 4 8000 .002 8.192 + * 8 4000 .004 16.384 + * 162000 .008 32.768 + * 321000 .016 65.536 + * 64 500 .032131.072 + * 128 250 .064262.144 + * 256 125 .128524.288 + */ + +#include linux/kernel.h +#include linux/interrupt.h +#include linux/module.h +#include asm/geode.h + +#define F_AVAIL0x01 + +static struct mfgpt_timer_t { + int flags; + struct module *owner; +} mfgpt_timers[MFGPT_MAX_TIMERS]; + +/* Selected from the table
x86: block irq balancing for timer
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5fa3a246ea2e1be2ffaa01343bc183c8c0bfa472 Commit: 5fa3a246ea2e1be2ffaa01343bc183c8c0bfa472 Parent: 3c9aea47425885ec8b1f7b0df88c2ebc6f747c9d Author: Venki Pallipadi [EMAIL PROTECTED] AuthorDate: Fri Oct 12 23:04:06 2007 +0200 Committer: Thomas Gleixner [EMAIL PROTECTED] CommitDate: Fri Oct 12 23:04:06 2007 +0200 x86: block irq balancing for timer Disable irq balancing on IRQ0. Several SIS chipsets lock up when you try to change affinity of IRQ #0. Signed-off-by: Venkatesh Pallipadi [EMAIL PROTECTED] Signed-off-by: Andi Kleen [EMAIL PROTECTED] Cc: john stultz [EMAIL PROTECTED] Signed-off-by: Andrew Morton [EMAIL PROTECTED] Signed-off-by: Ingo Molnar [EMAIL PROTECTED] Signed-off-by: Thomas Gleixner [EMAIL PROTECTED] Signed-off-by: Arjan van de Ven [EMAIL PROTECTED] --- arch/x86/kernel/time_64.c |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/arch/x86/kernel/time_64.c b/arch/x86/kernel/time_64.c index 6d48a4e..2db4d69 100644 --- a/arch/x86/kernel/time_64.c +++ b/arch/x86/kernel/time_64.c @@ -360,7 +360,7 @@ void stop_timer_interrupt(void) static struct irqaction irq0 = { .handler= timer_interrupt, - .flags = IRQF_DISABLED | IRQF_IRQPOLL, + .flags = IRQF_DISABLED | IRQF_IRQPOLL | IRQF_NOBALANCING, .mask = CPU_MASK_NONE, .name = timer }; - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
i386: prepare sharing the hpet code with x86_64
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=06a24dec10bc4014fc0974670627efed68f5da27 Commit: 06a24dec10bc4014fc0974670627efed68f5da27 Parent: d371698efd45c3664fd1726780c360f02e1f9580 Author: Thomas Gleixner [EMAIL PROTECTED] AuthorDate: Fri Oct 12 23:04:06 2007 +0200 Committer: Thomas Gleixner [EMAIL PROTECTED] CommitDate: Fri Oct 12 23:04:06 2007 +0200 i386: prepare sharing the hpet code with x86_64 The hpet implementations of i386 and x8664 has been mostly the same before the clock events conversion of i386. The clock events conversion of i386 hpet is already done. So it makes sense to share the code for the x86_64 clock events conversion. Abstract out the mapping functions. Signed-off-by: Thomas Gleixner [EMAIL PROTECTED] Signed-off-by: Chris Wright [EMAIL PROTECTED] Signed-off-by: Ingo Molnar [EMAIL PROTECTED] Signed-off-by: Arjan van de Ven [EMAIL PROTECTED] --- arch/x86/kernel/hpet_32.c | 24 1 files changed, 16 insertions(+), 8 deletions(-) diff --git a/arch/x86/kernel/hpet_32.c b/arch/x86/kernel/hpet_32.c index 533d493..748abf0 100644 --- a/arch/x86/kernel/hpet_32.c +++ b/arch/x86/kernel/hpet_32.c @@ -8,10 +8,9 @@ #include linux/delay.h #include asm/hpet.h +#include asm/i8253.h #include asm/io.h -extern struct clock_event_device *global_clock_event; - #define HPET_MASK CLOCKSOURCE_MASK(32) #define HPET_SHIFT 22 @@ -22,7 +21,7 @@ extern struct clock_event_device *global_clock_event; * HPET address is set in acpi/boot.c, when an ACPI entry exists */ unsigned long hpet_address; -static void __iomem * hpet_virt_address; +static void __iomem *hpet_virt_address; static inline unsigned long hpet_readl(unsigned long a) { @@ -34,6 +33,17 @@ static inline void hpet_writel(unsigned long d, unsigned long a) writel(d, hpet_virt_address + a); } +static inline void hpet_set_mapping(void) +{ + hpet_virt_address = ioremap_nocache(hpet_address, HPET_MMAP_SIZE); +} + +static inline void hpet_clear_mapping(void) +{ + iounmap(hpet_virt_address); + hpet_virt_address = NULL; +} + /* * HPET command line enable / disable */ @@ -83,7 +93,7 @@ static void hpet_reserve_platform_timers(unsigned long id) memset(hd, 0, sizeof (hd)); hd.hd_phys_address = hpet_address; - hd.hd_address = hpet_virt_address; + hd.hd_address = hpet; hd.hd_nirqs = nrtimers; hd.hd_flags = HPET_DATA_PLATFORM; hpet_reserve_timer(hd, 0); @@ -238,7 +248,7 @@ int __init hpet_enable(void) if (!is_hpet_capable()) return 0; - hpet_virt_address = ioremap_nocache(hpet_address, HPET_MMAP_SIZE); + hpet_set_mapping(); /* * Read the period and check for a sane value: @@ -334,13 +344,11 @@ int __init hpet_enable(void) return 0; out_nohpet: - iounmap(hpet_virt_address); - hpet_virt_address = NULL; + hpet_clear_mapping(); boot_hpet_disable = 1; return 0; } - #ifdef CONFIG_HPET_EMULATE_RTC /* HPET in LegacyReplacement Mode eats up RTC interrupt line. When, HPET - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
i386: prepare sharing the hpet code with x86_64
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=28769149c285e0a392d2e601ae0cc71ffc345f7d Commit: 28769149c285e0a392d2e601ae0cc71ffc345f7d Parent: 06a24dec10bc4014fc0974670627efed68f5da27 Author: Thomas Gleixner [EMAIL PROTECTED] AuthorDate: Fri Oct 12 23:04:06 2007 +0200 Committer: Thomas Gleixner [EMAIL PROTECTED] CommitDate: Fri Oct 12 23:04:06 2007 +0200 i386: prepare sharing the hpet code with x86_64 Add the x8664 specific bits (mapping) to share the hpet code later. Move the reserve_platform_timer call to late init. This is necessary for x86_64, as hpet enable() is called before memory is setup. i386 calls it in late_time_init, but it does not hurt to do it later for both. Pull in the x8664 hpet disable command line option as well. Signed-off-by: Thomas Gleixner [EMAIL PROTECTED] Signed-off-by: Ingo Molnar [EMAIL PROTECTED] Signed-off-by: Arjan van de Ven [EMAIL PROTECTED] --- arch/x86/kernel/hpet_32.c | 59 - 1 files changed, 58 insertions(+), 1 deletions(-) diff --git a/arch/x86/kernel/hpet_32.c b/arch/x86/kernel/hpet_32.c index 748abf0..dbe0e1d 100644 --- a/arch/x86/kernel/hpet_32.c +++ b/arch/x86/kernel/hpet_32.c @@ -1,5 +1,6 @@ #include linux/clocksource.h #include linux/clockchips.h +#include linux/delay.h #include linux/errno.h #include linux/hpet.h #include linux/init.h @@ -7,6 +8,7 @@ #include linux/pm.h #include linux/delay.h +#include asm/fixmap.h #include asm/hpet.h #include asm/i8253.h #include asm/io.h @@ -23,6 +25,10 @@ unsigned long hpet_address; static void __iomem *hpet_virt_address; +/* Temporary hack. Cleanup after x86_64 clock events conversion */ +#undef hpet_readl +#undef hpet_writel + static inline unsigned long hpet_readl(unsigned long a) { return readl(hpet_virt_address + a); @@ -33,6 +39,24 @@ static inline void hpet_writel(unsigned long d, unsigned long a) writel(d, hpet_virt_address + a); } +#ifdef CONFIG_X86_64 + +#include asm/pgtable.h + +static inline void hpet_set_mapping(void) +{ + set_fixmap_nocache(FIX_HPET_BASE, hpet_address); + __set_fixmap(VSYSCALL_HPET, hpet_address, PAGE_KERNEL_VSYSCALL_NOCACHE); + hpet_virt_address = (void __iomem *)fix_to_virt(FIX_HPET_BASE); +} + +static inline void hpet_clear_mapping(void) +{ + hpet_virt_address = NULL; +} + +#else + static inline void hpet_set_mapping(void) { hpet_virt_address = ioremap_nocache(hpet_address, HPET_MMAP_SIZE); @@ -43,6 +67,7 @@ static inline void hpet_clear_mapping(void) iounmap(hpet_virt_address); hpet_virt_address = NULL; } +#endif /* * HPET command line enable / disable @@ -59,6 +84,13 @@ static int __init hpet_setup(char* str) } __setup(hpet=, hpet_setup); +static int __init disable_hpet(char *str) +{ + boot_hpet_disable = 1; + return 1; +} +__setup(nohpet, disable_hpet); + static inline int is_hpet_capable(void) { return (!boot_hpet_disable hpet_address); @@ -225,6 +257,13 @@ static cycle_t read_hpet(void) return (cycle_t)hpet_readl(HPET_COUNTER); } +#ifdef CONFIG_X86_64 +static cycle_t __vsyscall_fn vread_hpet(void) +{ + return readl((const void __iomem *)fix_to_virt(VSYSCALL_HPET) + 0xf0); +} +#endif + static struct clocksource clocksource_hpet = { .name = hpet, .rating = 250, @@ -233,6 +272,9 @@ static struct clocksource clocksource_hpet = { .shift = HPET_SHIFT, .flags = CLOCK_SOURCE_IS_CONTINUOUS, .resume = hpet_start_counter, +#ifdef CONFIG_X86_64 + .vread = vread_hpet, +#endif }; /* @@ -331,7 +373,6 @@ int __init hpet_enable(void) if (id HPET_ID_LEGSUP) { hpet_enable_int(); - hpet_reserve_platform_timers(id); /* * Start hpet with the boot cpu mask and make it * global after the IO_APIC has been initialized. @@ -349,6 +390,22 @@ out_nohpet: return 0; } +/* + * Needs to be late, as the reserve_timer code calls kalloc ! + * + * Not a problem on i386 as hpet_enable is called from late_time_init, + * but on x86_64 it is necessary ! + */ +static __init int hpet_late_init(void) +{ + if (!is_hpet_capable()) + return -ENODEV; + + hpet_reserve_platform_timers(hpet_readl(HPET_ID)); + return 0; +} +fs_initcall(hpet_late_init); + #ifdef CONFIG_HPET_EMULATE_RTC /* HPET in LegacyReplacement Mode eats up RTC interrupt line. When, HPET - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
i386: prepare sharing the PIT code
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=f5e0e93faf8421083853b2d7a217267f49e27cc3 Commit: f5e0e93faf8421083853b2d7a217267f49e27cc3 Parent: 28769149c285e0a392d2e601ae0cc71ffc345f7d Author: Thomas Gleixner [EMAIL PROTECTED] AuthorDate: Fri Oct 12 23:04:06 2007 +0200 Committer: Thomas Gleixner [EMAIL PROTECTED] CommitDate: Fri Oct 12 23:04:06 2007 +0200 i386: prepare sharing the PIT code PIT clock events work already and the PIT handling is the same for i386 and x86_64. x86_64 does not support PIT as a clock source, so disable the PIT clocksource for x86_64. Prepare i8253.h to be shared with x8664 Signed-off-by: Thomas Gleixner [EMAIL PROTECTED] Signed-off-by: Chris Wright [EMAIL PROTECTED] Signed-off-by: Ingo Molnar [EMAIL PROTECTED] Signed-off-by: Arjan van de Ven [EMAIL PROTECTED] --- arch/x86/kernel/i8253_32.c |4 +++- include/asm-x86/i8253_32.h |6 -- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/arch/x86/kernel/i8253_32.c b/arch/x86/kernel/i8253_32.c index 6d839f2..ac15e4c 100644 --- a/arch/x86/kernel/i8253_32.c +++ b/arch/x86/kernel/i8253_32.c @@ -13,7 +13,6 @@ #include asm/delay.h #include asm/i8253.h #include asm/io.h -#include asm/timer.h DEFINE_SPINLOCK(i8253_lock); EXPORT_SYMBOL(i8253_lock); @@ -120,6 +119,7 @@ void __init setup_pit_timer(void) global_clock_event = pit_clockevent; } +#ifndef CONFIG_X86_64 /* * Since the PIT overflows every tick, its not very useful * to just read by itself. So use jiffies to emulate a free @@ -204,3 +204,5 @@ static int __init init_pit_clocksource(void) return clocksource_register(clocksource_pit); } arch_initcall(init_pit_clocksource); + +#endif diff --git a/include/asm-x86/i8253_32.h b/include/asm-x86/i8253_32.h index 7577d05..28cf67d 100644 --- a/include/asm-x86/i8253_32.h +++ b/include/asm-x86/i8253_32.h @@ -1,8 +1,6 @@ #ifndef __ASM_I8253_H__ #define __ASM_I8253_H__ -#include linux/clockchips.h - /* i8253A PIT registers */ #define PIT_MODE 0x43 #define PIT_CH00x40 @@ -10,8 +8,12 @@ extern spinlock_t i8253_lock; +#ifdef CONFIG_GENERIC_CLOCKEVENTS + extern struct clock_event_device *global_clock_event; extern void setup_pit_timer(void); +#endif + #endif /* __ASM_I8253_H__ */ - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
x86: remove never used apic_mapped
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7ffeeb1e03c4fc1c7e8434c5496018dd035f8924 Commit: 7ffeeb1e03c4fc1c7e8434c5496018dd035f8924 Parent: 0190dae54de62fbb9ced75d134015266987eb6b8 Author: Yinghai Lu [EMAIL PROTECTED] AuthorDate: Fri Oct 12 23:04:06 2007 +0200 Committer: Thomas Gleixner [EMAIL PROTECTED] CommitDate: Fri Oct 12 23:04:06 2007 +0200 x86: remove never used apic_mapped [ tglx: arch/x86 adaptation ] Signed-off-by: Yinghai Lu [EMAIL PROTECTED] Signed-off-by: Andi Kleen [EMAIL PROTECTED] Cc: Christoph Lameter [EMAIL PROTECTED] Cc: Len Brown [EMAIL PROTECTED] Signed-off-by: Andrew Morton [EMAIL PROTECTED] Signed-off-by: Ingo Molnar [EMAIL PROTECTED] Signed-off-by: Arjan van de Ven [EMAIL PROTECTED] Signed-off-by: Thomas Gleixner [EMAIL PROTECTED] --- arch/x86/kernel/apic_64.c |5 ++--- include/asm-x86/apic_64.h |1 - 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/arch/x86/kernel/apic_64.c b/arch/x86/kernel/apic_64.c index 925758d..48206bb 100644 --- a/arch/x86/kernel/apic_64.c +++ b/arch/x86/kernel/apic_64.c @@ -39,7 +39,6 @@ #include asm/hpet.h #include asm/apic.h -int apic_mapped; int apic_verbosity; int apic_runs_main_timer; int apic_calibrate_pmtmr __initdata; @@ -706,8 +705,8 @@ void __init init_apic_mappings(void) apic_phys = mp_lapic_addr; set_fixmap_nocache(FIX_APIC_BASE, apic_phys); - apic_mapped = 1; - apic_printk(APIC_VERBOSE,mapped APIC to %16lx (%16lx)\n, APIC_BASE, apic_phys); + apic_printk(APIC_VERBOSE, mapped APIC to %16lx (%16lx)\n, + APIC_BASE, apic_phys); /* Put local APIC into the resource map. */ lapic_resource.start = apic_phys; diff --git a/include/asm-x86/apic_64.h b/include/asm-x86/apic_64.h index 85125ef..81335e9 100644 --- a/include/asm-x86/apic_64.h +++ b/include/asm-x86/apic_64.h @@ -19,7 +19,6 @@ extern int apic_verbosity; extern int apic_runs_main_timer; extern int ioapic_force; -extern int apic_mapped; /* * Define the default level of output to be very little - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
i386: prepare sharing the PIT code
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=0190dae54de62fbb9ced75d134015266987eb6b8 Commit: 0190dae54de62fbb9ced75d134015266987eb6b8 Parent: f5e0e93faf8421083853b2d7a217267f49e27cc3 Author: Thomas Gleixner [EMAIL PROTECTED] AuthorDate: Fri Oct 12 23:04:06 2007 +0200 Committer: Thomas Gleixner [EMAIL PROTECTED] CommitDate: Fri Oct 12 23:04:06 2007 +0200 i386: prepare sharing the PIT code PIT clock events work already and the PIT handling is the same for i386 and x86_64. x86_64 does not support PIT as a clock source, so disable the PIT clocksource for x86_64. Use the i386 i8253.h include file for x86_64 as well to share the exports and the PIT constants. Signed-off-by: Thomas Gleixner [EMAIL PROTECTED] Signed-off-by: Chris Wright [EMAIL PROTECTED] Signed-off-by: Ingo Molnar [EMAIL PROTECTED] Signed-off-by: Arjan van de Ven [EMAIL PROTECTED] --- arch/x86/kernel/time_64.c |4 include/asm-x86/i8253.h| 26 ++ include/asm-x86/i8253_32.h | 19 --- include/asm-x86/i8253_64.h |6 -- 4 files changed, 22 insertions(+), 33 deletions(-) diff --git a/arch/x86/kernel/time_64.c b/arch/x86/kernel/time_64.c index e97a3ee..d899216 100644 --- a/arch/x86/kernel/time_64.c +++ b/arch/x86/kernel/time_64.c @@ -32,7 +32,6 @@ #include acpi/achware.h /* for PM timer frequency */ #include acpi/acpi_bus.h #endif -#include asm/8253pit.h #include asm/i8253.h #include asm/pgtable.h #include asm/vsyscall.h @@ -292,9 +291,6 @@ static unsigned int __init tsc_calibrate_cpu_khz(void) return pmc_now * tsc_khz / (tsc_now - tsc_start); } -#define PIT_MODE 0x43 -#define PIT_CH0 0x40 - static void __pit_init(int val, u8 mode) { unsigned long flags; diff --git a/include/asm-x86/i8253.h b/include/asm-x86/i8253.h index b2a4f99..7eff6fd 100644 --- a/include/asm-x86/i8253.h +++ b/include/asm-x86/i8253.h @@ -1,5 +1,23 @@ -#ifdef CONFIG_X86_32 -# include i8253_32.h -#else -# include i8253_64.h +#ifndef __ASM_I8253_H__ +#define __ASM_I8253_H__ + +#ifdef CONFIG_X86_64 +# include asm/8253pit.h #endif + +/* i8253A PIT registers */ +#define PIT_MODE 0x43 +#define PIT_CH00x40 +#define PIT_CH20x42 + +extern spinlock_t i8253_lock; + +#ifdef CONFIG_GENERIC_CLOCKEVENTS + +extern struct clock_event_device *global_clock_event; + +extern void setup_pit_timer(void); + +#endif + +#endif /* __ASM_I8253_H__ */ diff --git a/include/asm-x86/i8253_32.h b/include/asm-x86/i8253_32.h deleted file mode 100644 index 28cf67d..000 --- a/include/asm-x86/i8253_32.h +++ /dev/null @@ -1,19 +0,0 @@ -#ifndef __ASM_I8253_H__ -#define __ASM_I8253_H__ - -/* i8253A PIT registers */ -#define PIT_MODE 0x43 -#define PIT_CH00x40 -#define PIT_CH20x42 - -extern spinlock_t i8253_lock; - -#ifdef CONFIG_GENERIC_CLOCKEVENTS - -extern struct clock_event_device *global_clock_event; - -extern void setup_pit_timer(void); - -#endif - -#endif /* __ASM_I8253_H__ */ diff --git a/include/asm-x86/i8253_64.h b/include/asm-x86/i8253_64.h deleted file mode 100644 index 015d8df..000 --- a/include/asm-x86/i8253_64.h +++ /dev/null @@ -1,6 +0,0 @@ -#ifndef __ASM_I8253_H__ -#define __ASM_I8253_H__ - -extern spinlock_t i8253_lock; - -#endif /* __ASM_I8253_H__ */ - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
x86_64: prepare apic code for clock events
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=801740971af7c6256b7ad2472706d43ed008fd3d Commit: 801740971af7c6256b7ad2472706d43ed008fd3d Parent: 7ffeeb1e03c4fc1c7e8434c5496018dd035f8924 Author: Thomas Gleixner [EMAIL PROTECTED] AuthorDate: Fri Oct 12 23:04:06 2007 +0200 Committer: Thomas Gleixner [EMAIL PROTECTED] CommitDate: Fri Oct 12 23:04:06 2007 +0200 x86_64: prepare apic code for clock events Change __setup_APIC_LVTT so it takes the arguments which are necessary for the later clock events switch. Signed-off-by: Thomas Gleixner [EMAIL PROTECTED] Signed-off-by: Chris Wright [EMAIL PROTECTED] Signed-off-by: Ingo Molnar [EMAIL PROTECTED] Signed-off-by: Arjan van de Ven [EMAIL PROTECTED] --- arch/x86/kernel/apic_64.c | 23 +++ 1 files changed, 15 insertions(+), 8 deletions(-) diff --git a/arch/x86/kernel/apic_64.c b/arch/x86/kernel/apic_64.c index 48206bb..ce2f801 100644 --- a/arch/x86/kernel/apic_64.c +++ b/arch/x86/kernel/apic_64.c @@ -759,14 +759,14 @@ void __init init_apic_mappings(void) #define APIC_DIVISOR 16 -static void __setup_APIC_LVTT(unsigned int clocks) +static void __setup_APIC_LVTT(unsigned int clocks, int oneshot, int irqen) { unsigned int lvtt_value, tmp_value; - int cpu = smp_processor_id(); - - lvtt_value = APIC_LVT_TIMER_PERIODIC | LOCAL_TIMER_VECTOR; - if (cpu_isset(cpu, timer_interrupt_broadcast_ipi_mask)) + lvtt_value = LOCAL_TIMER_VECTOR; + if (!oneshot) + lvtt_value |= APIC_LVT_TIMER_PERIODIC; + if (!irqen) lvtt_value |= APIC_LVT_MASKED; apic_write(APIC_LVTT, lvtt_value); @@ -779,12 +779,14 @@ static void __setup_APIC_LVTT(unsigned int clocks) ~(APIC_TDR_DIV_1 | APIC_TDR_DIV_TMBASE)) | APIC_TDR_DIV_16); - apic_write(APIC_TMICT, clocks/APIC_DIVISOR); + if (!oneshot) + apic_write(APIC_TMICT, clocks/APIC_DIVISOR); } static void setup_APIC_timer(unsigned int clocks) { unsigned long flags; + int irqen; local_irq_save(flags); @@ -805,7 +807,10 @@ static void setup_APIC_timer(unsigned int clocks) c2 |= inb_p(0x40) 8; } while (c2 - c1 300); } - __setup_APIC_LVTT(clocks); + + irqen = ! cpu_isset(smp_processor_id(), + timer_interrupt_broadcast_ipi_mask); + __setup_APIC_LVTT(clocks, 0, irqen); /* Turn off PIT interrupt if we use APIC timer as main timer. Only works with the PM timer right now TBD fix it for HPET too. */ @@ -843,8 +848,10 @@ static int __init calibrate_APIC_clock(void) * Put whatever arbitrary (but long enough) timeout * value into the APIC clock, we just want to get the * counter running for calibration. +* +* No interrupt enable ! */ - __setup_APIC_LVTT(40); + __setup_APIC_LVTT(40, 0, 0); apic_start = apic_read(APIC_TMCCT); #ifdef CONFIG_X86_PM_TIMER - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
x86_64: Move apic calibration code around
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=d03030e917047cf7f475e641cd2d6e83647392b0 Commit: d03030e917047cf7f475e641cd2d6e83647392b0 Parent: 500ff08b76878a45391fffc7a4c972883503050e Author: Thomas Gleixner [EMAIL PROTECTED] AuthorDate: Fri Oct 12 23:04:06 2007 +0200 Committer: Thomas Gleixner [EMAIL PROTECTED] CommitDate: Fri Oct 12 23:04:06 2007 +0200 x86_64: Move apic calibration code around Let the calibration code fill in calibration_result directly and move the variable on top of the file. Fixup a printk w/o log level while at it. Signed-off-by: Thomas Gleixner [EMAIL PROTECTED] Signed-off-by: Chris Wright [EMAIL PROTECTED] Signed-off-by: Ingo Molnar [EMAIL PROTECTED] Signed-off-by: Arjan van de Ven [EMAIL PROTECTED] --- arch/x86/kernel/apic_64.c | 15 ++- 1 files changed, 6 insertions(+), 9 deletions(-) diff --git a/arch/x86/kernel/apic_64.c b/arch/x86/kernel/apic_64.c index a73b443..b08c08e 100644 --- a/arch/x86/kernel/apic_64.c +++ b/arch/x86/kernel/apic_64.c @@ -55,6 +55,8 @@ static struct resource lapic_resource = { .flags = IORESOURCE_MEM | IORESOURCE_BUSY, }; +static unsigned int calibration_result; + /* * cpu_mask that denotes the CPUs that needs timer interrupt coming in as * IPIs in place of local APIC timers @@ -821,7 +823,7 @@ static void setup_APIC_timer(unsigned int clocks) #define TICK_COUNT 1 -static int __init calibrate_APIC_clock(void) +static void __init calibrate_APIC_clock(void) { unsigned apic, apic_start; unsigned long tsc, tsc_start; @@ -855,17 +857,14 @@ static int __init calibrate_APIC_clock(void) result = (apic_start - apic) * 1000L * tsc_khz / (tsc - tsc_start); } - printk(result %d\n, result); - + printk(KERN_DEBUG APIC timer calibration result %d\n, result); printk(KERN_INFO Detected %d.%03d MHz APIC timer.\n, result / 1000 / 1000, result / 1000 % 1000); - return result * APIC_DIVISOR / HZ; + calibration_result = result * APIC_DIVISOR / HZ; } -static unsigned int calibration_result; - void __init setup_boot_APIC_clock (void) { if (disable_apic_timer) { @@ -878,7 +877,7 @@ void __init setup_boot_APIC_clock (void) local_irq_disable(); - calibration_result = calibrate_APIC_clock(); + calibrate_APIC_clock(); /* * Now set up the timer for real. */ @@ -985,8 +984,6 @@ void setup_APIC_extended_lvt(unsigned char lvt_off, unsigned char vector, apic_write(reg, v); } -#undef APIC_DIVISOR - /* * Local timer interrupt handler. It does both profiling and * process statistics/rescheduling. - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
x86_64: remove pit synchronization
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=500ff08b76878a45391fffc7a4c972883503050e Commit: 500ff08b76878a45391fffc7a4c972883503050e Parent: 801740971af7c6256b7ad2472706d43ed008fd3d Author: Thomas Gleixner [EMAIL PROTECTED] AuthorDate: Fri Oct 12 23:04:06 2007 +0200 Committer: Thomas Gleixner [EMAIL PROTECTED] CommitDate: Fri Oct 12 23:04:06 2007 +0200 x86_64: remove pit synchronization The APIC timer setup code synchronizes the local APIC timer to the PIT/HPET. This is pointless as the PIT and the local APIC timer frequency are not correlated and the APIC timer calibration can never be accurate enough to avoid that the local APIC timer and the PIT/HPET drift apart. Simply remove it. Signed-off-by: Thomas Gleixner [EMAIL PROTECTED] Signed-off-by: Chris Wright [EMAIL PROTECTED] Signed-off-by: Ingo Molnar [EMAIL PROTECTED] Signed-off-by: Arjan van de Ven [EMAIL PROTECTED] --- arch/x86/kernel/apic_64.c | 18 -- 1 files changed, 0 insertions(+), 18 deletions(-) diff --git a/arch/x86/kernel/apic_64.c b/arch/x86/kernel/apic_64.c index ce2f801..a73b443 100644 --- a/arch/x86/kernel/apic_64.c +++ b/arch/x86/kernel/apic_64.c @@ -790,24 +790,6 @@ static void setup_APIC_timer(unsigned int clocks) local_irq_save(flags); - /* wait for irq slice */ - if (hpet_address hpet_use_timer) { - u32 trigger = hpet_readl(HPET_T0_CMP); - while (hpet_readl(HPET_T0_CMP) == trigger) - /* do nothing */ ; - } else { - int c1, c2; - outb_p(0x00, 0x43); - c2 = inb_p(0x40); - c2 |= inb_p(0x40) 8; - do { - c1 = c2; - outb_p(0x00, 0x43); - c2 = inb_p(0x40); - c2 |= inb_p(0x40) 8; - } while (c2 - c1 300); - } - irqen = ! cpu_isset(smp_processor_id(), timer_interrupt_broadcast_ipi_mask); __setup_APIC_LVTT(clocks, 0, irqen); - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
x86_64: apic change setup_APIC_timer calling convention
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=abc63fcd3cc61876b2d6f5b0d08021bd1538385c Commit: abc63fcd3cc61876b2d6f5b0d08021bd1538385c Parent: b58eb00df7f7f80b7f456bf8fb740fddf14408ba Author: Thomas Gleixner [EMAIL PROTECTED] AuthorDate: Fri Oct 12 23:04:07 2007 +0200 Committer: Thomas Gleixner [EMAIL PROTECTED] CommitDate: Fri Oct 12 23:04:07 2007 +0200 x86_64: apic change setup_APIC_timer calling convention setup_APIC_timer takes the file global calibration result as an argument. Remove it. Signed-off-by: Thomas Gleixner [EMAIL PROTECTED] Signed-off-by: Chris Wright [EMAIL PROTECTED] Signed-off-by: Ingo Molnar [EMAIL PROTECTED] Signed-off-by: Arjan van de Ven [EMAIL PROTECTED] --- arch/x86/kernel/apic_64.c |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/x86/kernel/apic_64.c b/arch/x86/kernel/apic_64.c index f746f9d..f74b1c2 100644 --- a/arch/x86/kernel/apic_64.c +++ b/arch/x86/kernel/apic_64.c @@ -783,7 +783,7 @@ static void __setup_APIC_LVTT(unsigned int clocks, int oneshot, int irqen) apic_write(APIC_TMICT, clocks); } -static void setup_APIC_timer(unsigned int clocks) +static void setup_APIC_timer(void) { unsigned long flags; int irqen; @@ -792,7 +792,7 @@ static void setup_APIC_timer(unsigned int clocks) irqen = ! cpu_isset(smp_processor_id(), timer_interrupt_broadcast_ipi_mask); - __setup_APIC_LVTT(clocks, 0, irqen); + __setup_APIC_LVTT(calibration_result, 0, irqen); /* Turn off PIT interrupt if we use APIC timer as main timer. Only works with the PM timer right now TBD fix it for HPET too. */ @@ -879,7 +879,7 @@ void __init setup_boot_APIC_clock (void) /* * Now set up the timer for real. */ - setup_APIC_timer(calibration_result); + setup_APIC_timer(); local_irq_enable(); } @@ -887,7 +887,7 @@ void __init setup_boot_APIC_clock (void) void __cpuinit setup_secondary_APIC_clock(void) { local_irq_disable(); /* FIXME: Do we need this? --RR */ - setup_APIC_timer(calibration_result); + setup_APIC_timer(); local_irq_enable(); } - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
x86_64: prepare idle loop for dynamic ticks
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=02290683343391a50f45599710295dafa2ddd018 Commit: 02290683343391a50f45599710295dafa2ddd018 Parent: c4d58cbd158dc9b30c55c0e3881ae7c6b8843d5a Author: Chris Wright [EMAIL PROTECTED] AuthorDate: Fri Oct 12 23:04:07 2007 +0200 Committer: Thomas Gleixner [EMAIL PROTECTED] CommitDate: Fri Oct 12 23:04:07 2007 +0200 x86_64: prepare idle loop for dynamic ticks Add tick_nohz_{stop,restart}_sched_tick to idle loop in prepartion for turning on dynticks. These are just noops until NO_HZ is enabled. Signed-off-by: Chris Wright [EMAIL PROTECTED] Signed-off-by: Ingo Molnar [EMAIL PROTECTED] Signed-off-by: Thomas Gleixner [EMAIL PROTECTED] Signed-off-by: Arjan van de Ven [EMAIL PROTECTED] --- arch/x86/kernel/process_64.c |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c index 9895655..6f9dbbe 100644 --- a/arch/x86/kernel/process_64.c +++ b/arch/x86/kernel/process_64.c @@ -38,6 +38,7 @@ #include linux/notifier.h #include linux/kprobes.h #include linux/kdebug.h +#include linux/tick.h #include asm/uaccess.h #include asm/pgtable.h @@ -208,6 +209,8 @@ void cpu_idle (void) if (__get_cpu_var(cpu_idle_state)) __get_cpu_var(cpu_idle_state) = 0; + tick_nohz_stop_sched_tick(); + rmb(); idle = pm_idle; if (!idle) @@ -228,6 +231,7 @@ void cpu_idle (void) __exit_idle(); } + tick_nohz_restart_sched_tick(); preempt_enable_no_resched(); schedule(); preempt_disable(); - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
x86_64: remove nested irq disables
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c4d58cbd158dc9b30c55c0e3881ae7c6b8843d5a Commit: c4d58cbd158dc9b30c55c0e3881ae7c6b8843d5a Parent: abc63fcd3cc61876b2d6f5b0d08021bd1538385c Author: Thomas Gleixner [EMAIL PROTECTED] AuthorDate: Fri Oct 12 23:04:07 2007 +0200 Committer: Thomas Gleixner [EMAIL PROTECTED] CommitDate: Fri Oct 12 23:04:07 2007 +0200 x86_64: remove nested irq disables setup_APIC_timer disables interrupts anyway. So no need to do the same in setup_boot_APIC_clock and setup_secondary_APIC_clock. Disable interrupts explicit in the calibration code. Signed-off-by: Thomas Gleixner [EMAIL PROTECTED] Signed-off-by: Chris Wright [EMAIL PROTECTED] Signed-off-by: Ingo Molnar [EMAIL PROTECTED] Signed-off-by: Arjan van de Ven [EMAIL PROTECTED] --- arch/x86/kernel/apic_64.c | 12 ++-- 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/x86/kernel/apic_64.c b/arch/x86/kernel/apic_64.c index f74b1c2..40938ef 100644 --- a/arch/x86/kernel/apic_64.c +++ b/arch/x86/kernel/apic_64.c @@ -826,6 +826,9 @@ static void __init calibrate_APIC_clock(void) unsigned apic, apic_start; unsigned long tsc, tsc_start; int result; + + local_irq_disable(); + /* * Put whatever arbitrary (but long enough) timeout * value into the APIC clock, we just want to get the @@ -855,6 +858,9 @@ static void __init calibrate_APIC_clock(void) result = (apic_start - apic) * 1000L * tsc_khz / (tsc - tsc_start); } + + local_irq_enable(); + printk(KERN_DEBUG APIC timer calibration result %d\n, result); printk(KERN_INFO Detected %d.%03d MHz APIC timer.\n, @@ -873,22 +879,16 @@ void __init setup_boot_APIC_clock (void) printk(KERN_INFO Using local APIC timer interrupts.\n); using_apic_timer = 1; - local_irq_disable(); - calibrate_APIC_clock(); /* * Now set up the timer for real. */ setup_APIC_timer(); - - local_irq_enable(); } void __cpuinit setup_secondary_APIC_clock(void) { - local_irq_disable(); /* FIXME: Do we need this? --RR */ setup_APIC_timer(); - local_irq_enable(); } void disable_APIC_timer(void) - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
x86: disable apic timer for AMD C1E enabled CPUs
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=fb79d22e1d4b06385796cc0db0084a2e07beccee Commit: fb79d22e1d4b06385796cc0db0084a2e07beccee Parent: 4e77ae3e105d28aa9410585715d83818f0abe871 Author: Thomas Gleixner [EMAIL PROTECTED] AuthorDate: Fri Oct 12 23:04:07 2007 +0200 Committer: Thomas Gleixner [EMAIL PROTECTED] CommitDate: Fri Oct 12 23:04:07 2007 +0200 x86: disable apic timer for AMD C1E enabled CPUs AMDs C1E enabled CPUs stop the local apic timer, when both cores are idle. This is a hardware feature which breaks highres/dynticks. Add the same quirk as we have for 32 bit already. Signed-off-by: Thomas Gleixner [EMAIL PROTECTED] Signed-off-by: Ingo Molnar [EMAIL PROTECTED] Signed-off-by: Arjan van de Ven [EMAIL PROTECTED] --- arch/x86/kernel/apic_64.c |2 +- arch/x86/kernel/setup_64.c | 34 ++ include/asm-x86/apic_64.h |1 + 3 files changed, 36 insertions(+), 1 deletions(-) diff --git a/arch/x86/kernel/apic_64.c b/arch/x86/kernel/apic_64.c index b0237ca..118830c 100644 --- a/arch/x86/kernel/apic_64.c +++ b/arch/x86/kernel/apic_64.c @@ -44,7 +44,7 @@ int apic_verbosity; int apic_runs_main_timer; int apic_calibrate_pmtmr __initdata; -int disable_apic_timer __initdata; +int disable_apic_timer __cpuinitdata; /* Local APIC timer works in C2? */ int local_apic_timer_c2_ok; diff --git a/arch/x86/kernel/setup_64.c b/arch/x86/kernel/setup_64.c index af838f6..32054bf 100644 --- a/arch/x86/kernel/setup_64.c +++ b/arch/x86/kernel/setup_64.c @@ -546,6 +546,37 @@ static void __init amd_detect_cmp(struct cpuinfo_x86 *c) #endif } +#define ENABLE_C1E_MASK0x1800 +#define CPUID_PROCESSOR_SIGNATURE 1 +#define CPUID_XFAM 0x0ff0 +#define CPUID_XFAM_K8 0x +#define CPUID_XFAM_10H 0x0010 +#define CPUID_XFAM_11H 0x0020 +#define CPUID_XMOD 0x000f +#define CPUID_XMOD_REV_F 0x0004 + +/* AMD systems with C1E don't have a working lAPIC timer. Check for that. */ +static __cpuinit int amd_apic_timer_broken(void) +{ + u32 lo, hi; + u32 eax = cpuid_eax(CPUID_PROCESSOR_SIGNATURE); + switch (eax CPUID_XFAM) { + case CPUID_XFAM_K8: + if ((eax CPUID_XMOD) CPUID_XMOD_REV_F) + break; + case CPUID_XFAM_10H: + case CPUID_XFAM_11H: + rdmsr(MSR_K8_ENABLE_C1E, lo, hi); + if (lo ENABLE_C1E_MASK) + return 1; + break; + default: + /* err on the side of caution */ + return 1; + } + return 0; +} + static void __cpuinit init_amd(struct cpuinfo_x86 *c) { unsigned level; @@ -617,6 +648,9 @@ static void __cpuinit init_amd(struct cpuinfo_x86 *c) /* Family 10 doesn't support C states in MWAIT so don't use it */ if (c-x86 == 0x10 !force_mwait) clear_bit(X86_FEATURE_MWAIT, c-x86_capability); + + if (amd_apic_timer_broken()) + disable_apic_timer = 1; } static void __cpuinit detect_ht(struct cpuinfo_x86 *c) diff --git a/include/asm-x86/apic_64.h b/include/asm-x86/apic_64.h index 81335e9..f32f654 100644 --- a/include/asm-x86/apic_64.h +++ b/include/asm-x86/apic_64.h @@ -19,6 +19,7 @@ extern int apic_verbosity; extern int apic_runs_main_timer; extern int ioapic_force; +extern int disable_apic_timer; /* * Define the default level of output to be very little - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
x86_64: Remove APIC_DIVISOR
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b58eb00df7f7f80b7f456bf8fb740fddf14408ba Commit: b58eb00df7f7f80b7f456bf8fb740fddf14408ba Parent: d03030e917047cf7f475e641cd2d6e83647392b0 Author: Thomas Gleixner [EMAIL PROTECTED] AuthorDate: Fri Oct 12 23:04:06 2007 +0200 Committer: Thomas Gleixner [EMAIL PROTECTED] CommitDate: Fri Oct 12 23:04:06 2007 +0200 x86_64: Remove APIC_DIVISOR APIC_DIVISOR is rather useless. It makes the calibration result more accurate in the first place, but we discard this later when we write the value to the APIC timer by dividing the calibration value by APIC_DIVISOR. Signed-off-by: Thomas Gleixner [EMAIL PROTECTED] Signed-off-by: Chris Wright [EMAIL PROTECTED] Signed-off-by: Ingo Molnar [EMAIL PROTECTED] Signed-off-by: Arjan van de Ven [EMAIL PROTECTED] --- arch/x86/kernel/apic_64.c |8 +++- 1 files changed, 3 insertions(+), 5 deletions(-) diff --git a/arch/x86/kernel/apic_64.c b/arch/x86/kernel/apic_64.c index b08c08e..f746f9d 100644 --- a/arch/x86/kernel/apic_64.c +++ b/arch/x86/kernel/apic_64.c @@ -759,8 +759,6 @@ void __init init_apic_mappings(void) * P5 APIC double write bug. */ -#define APIC_DIVISOR 16 - static void __setup_APIC_LVTT(unsigned int clocks, int oneshot, int irqen) { unsigned int lvtt_value, tmp_value; @@ -782,7 +780,7 @@ static void __setup_APIC_LVTT(unsigned int clocks, int oneshot, int irqen) | APIC_TDR_DIV_16); if (!oneshot) - apic_write(APIC_TMICT, clocks/APIC_DIVISOR); + apic_write(APIC_TMICT, clocks); } static void setup_APIC_timer(unsigned int clocks) @@ -835,7 +833,7 @@ static void __init calibrate_APIC_clock(void) * * No interrupt enable ! */ - __setup_APIC_LVTT(40, 0, 0); + __setup_APIC_LVTT(25000, 0, 0); apic_start = apic_read(APIC_TMCCT); #ifdef CONFIG_X86_PM_TIMER @@ -862,7 +860,7 @@ static void __init calibrate_APIC_clock(void) printk(KERN_INFO Detected %d.%03d MHz APIC timer.\n, result / 1000 / 1000, result / 1000 % 1000); - calibration_result = result * APIC_DIVISOR / HZ; + calibration_result = result / HZ; } void __init setup_boot_APIC_clock (void) - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
x86: Fix irq0 / local apic timer accounting
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4e77ae3e105d28aa9410585715d83818f0abe871 Commit: 4e77ae3e105d28aa9410585715d83818f0abe871 Parent: b8ce33590687888ebb900d09557b8807c4539022 Author: Thomas Gleixner [EMAIL PROTECTED] AuthorDate: Fri Oct 12 23:04:07 2007 +0200 Committer: Thomas Gleixner [EMAIL PROTECTED] CommitDate: Fri Oct 12 23:04:07 2007 +0200 x86: Fix irq0 / local apic timer accounting The clock events merge introduced a change to the nmi watchdog code to handle the not longer increasing local apic timer count in the broadcast mode. This is fine for UP, but on SMP it pampers over a stuck CPU which is not handling the broadcast interrupt due to the unconditional sum up of local apic timer count and irq0 count. To cover all cases we need to keep track on which CPU irq0 is handled. In theory this is CPU#0 due to the explicit disabling of irq balancing for irq0, but there are systems which ignore this on the hardware level. The per cpu irq0 accounting allows us to remove the irq0 to CPU0 binding as well. Add a per cpu counter for irq0 and evaluate this instead of the global irq0 count in the nmi watchdog code. Signed-off-by: Thomas Gleixner [EMAIL PROTECTED] Signed-off-by: Ingo Molnar [EMAIL PROTECTED] Signed-off-by: Arjan van de Ven [EMAIL PROTECTED] --- arch/x86/kernel/nmi_64.c |2 +- arch/x86/kernel/time_64.c |2 ++ include/asm-x86/pda.h |1 + 3 files changed, 4 insertions(+), 1 deletions(-) diff --git a/arch/x86/kernel/nmi_64.c b/arch/x86/kernel/nmi_64.c index 0ec6d2d..e60ac0d 100644 --- a/arch/x86/kernel/nmi_64.c +++ b/arch/x86/kernel/nmi_64.c @@ -329,7 +329,7 @@ int __kprobes nmi_watchdog_tick(struct pt_regs * regs, unsigned reason) touched = 1; } - sum = read_pda(apic_timer_irqs); + sum = read_pda(apic_timer_irqs) + read_pda(irq0_irqs); if (__get_cpu_var(nmi_touch)) { __get_cpu_var(nmi_touch) = 0; touched = 1; diff --git a/arch/x86/kernel/time_64.c b/arch/x86/kernel/time_64.c index 7781df1..16f5888 100644 --- a/arch/x86/kernel/time_64.c +++ b/arch/x86/kernel/time_64.c @@ -194,6 +194,8 @@ static irqreturn_t timer_interrupt(int irq, void *dev_id) static irqreturn_t timer_event_interrupt(int irq, void *dev_id) { + add_pda(irq0_irqs, 1); + global_clock_event-event_handler(global_clock_event); return IRQ_HANDLED; diff --git a/include/asm-x86/pda.h b/include/asm-x86/pda.h index 5642634..fb49f80 100644 --- a/include/asm-x86/pda.h +++ b/include/asm-x86/pda.h @@ -29,6 +29,7 @@ struct x8664_pda { short isidle; struct mm_struct *active_mm; unsigned apic_timer_irqs; + unsigned irq0_irqs; } cacheline_aligned_in_smp; extern struct x8664_pda *_cpu_pda[]; - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
clock events: allow replacement of broadcast timer
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=4a93232dab0a07074bcc5291a0f1f39919916f31 Commit: 4a93232dab0a07074bcc5291a0f1f39919916f31 Parent: 31c435d75e7d15a5f965c5eb0e33fe0e236f49a4 Author: Venki Pallipadi [EMAIL PROTECTED] AuthorDate: Fri Oct 12 23:04:23 2007 +0200 Committer: Thomas Gleixner [EMAIL PROTECTED] CommitDate: Fri Oct 12 23:04:23 2007 +0200 clock events: allow replacement of broadcast timer Change the broadcast timer, if a timer with higher rating becomes available. Signed-off-by: Venkatesh Pallipadi [EMAIL PROTECTED] Cc: Andi Kleen [EMAIL PROTECTED] Cc: john stultz [EMAIL PROTECTED] Cc: Greg KH [EMAIL PROTECTED] Signed-off-by: Andrew Morton [EMAIL PROTECTED] Signed-off-by: Ingo Molnar [EMAIL PROTECTED] Signed-off-by: Arjan van de Ven [EMAIL PROTECTED] Signed-off-by: Thomas Gleixner [EMAIL PROTECTED] --- kernel/time/tick-broadcast.c | 13 ++--- kernel/time/tick-common.c|4 ++-- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/kernel/time/tick-broadcast.c b/kernel/time/tick-broadcast.c index acf15b4..298bc7c 100644 --- a/kernel/time/tick-broadcast.c +++ b/kernel/time/tick-broadcast.c @@ -64,8 +64,9 @@ static void tick_broadcast_start_periodic(struct clock_event_device *bc) */ int tick_check_broadcast_device(struct clock_event_device *dev) { - if (tick_broadcast_device.evtdev || - (dev-features CLOCK_EVT_FEAT_C3STOP)) + if ((tick_broadcast_device.evtdev +tick_broadcast_device.evtdev-rating = dev-rating) || +(dev-features CLOCK_EVT_FEAT_C3STOP)) return 0; clockevents_exchange_device(NULL, dev); @@ -513,11 +514,9 @@ static void tick_broadcast_clear_oneshot(int cpu) */ void tick_broadcast_setup_oneshot(struct clock_event_device *bc) { - if (bc-mode != CLOCK_EVT_MODE_ONESHOT) { - bc-event_handler = tick_handle_oneshot_broadcast; - clockevents_set_mode(bc, CLOCK_EVT_MODE_ONESHOT); - bc-next_event.tv64 = KTIME_MAX; - } + bc-event_handler = tick_handle_oneshot_broadcast; + clockevents_set_mode(bc, CLOCK_EVT_MODE_ONESHOT); + bc-next_event.tv64 = KTIME_MAX; } /* diff --git a/kernel/time/tick-common.c b/kernel/time/tick-common.c index 77a21ab..3f3ae39 100644 --- a/kernel/time/tick-common.c +++ b/kernel/time/tick-common.c @@ -200,7 +200,7 @@ static int tick_check_new_device(struct clock_event_device *newdev) cpu = smp_processor_id(); if (!cpu_isset(cpu, newdev-cpumask)) - goto out; + goto out_bc; td = per_cpu(tick_cpu_device, cpu); curdev = td-evtdev; @@ -265,7 +265,7 @@ out_bc: */ if (tick_check_broadcast_device(newdev)) ret = NOTIFY_STOP; -out: + spin_unlock_irqrestore(tick_device_lock, flags); return ret; - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
x86: HPET restructure hpet code for hpet force enable
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=610bf2f143b9c5cda768a2d428d66d3a16769930 Commit: 610bf2f143b9c5cda768a2d428d66d3a16769930 Parent: 4a93232dab0a07074bcc5291a0f1f39919916f31 Author: Venki Pallipadi [EMAIL PROTECTED] AuthorDate: Fri Oct 12 23:04:23 2007 +0200 Committer: Thomas Gleixner [EMAIL PROTECTED] CommitDate: Fri Oct 12 23:04:23 2007 +0200 x86: HPET restructure hpet code for hpet force enable Restructure and rename legacy replacement mode HPET timer support. Just the code structural changes and should be zero functionality change. Signed-off-by: Venkatesh Pallipadi [EMAIL PROTECTED] Cc: Andi Kleen [EMAIL PROTECTED] Cc: john stultz [EMAIL PROTECTED] Cc: Greg KH [EMAIL PROTECTED] Signed-off-by: Andrew Morton [EMAIL PROTECTED] Signed-off-by: Ingo Molnar [EMAIL PROTECTED] Signed-off-by: Arjan van de Ven [EMAIL PROTECTED] Signed-off-by: Thomas Gleixner [EMAIL PROTECTED] --- arch/x86/kernel/hpet.c | 148 +++- 1 files changed, 83 insertions(+), 65 deletions(-) diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c index 078dbc6..ce3bcc4 100644 --- a/arch/x86/kernel/hpet.c +++ b/arch/x86/kernel/hpet.c @@ -149,9 +149,9 @@ static void hpet_reserve_platform_timers(unsigned long id) { } */ static unsigned long hpet_period; -static void hpet_set_mode(enum clock_event_mode mode, +static void hpet_legacy_set_mode(enum clock_event_mode mode, struct clock_event_device *evt); -static int hpet_next_event(unsigned long delta, +static int hpet_legacy_next_event(unsigned long delta, struct clock_event_device *evt); /* @@ -160,8 +160,8 @@ static int hpet_next_event(unsigned long delta, static struct clock_event_device hpet_clockevent = { .name = hpet, .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, - .set_mode = hpet_set_mode, - .set_next_event = hpet_next_event, + .set_mode = hpet_legacy_set_mode, + .set_next_event = hpet_legacy_next_event, .shift = 32, .irq= 0, }; @@ -178,7 +178,7 @@ static void hpet_start_counter(void) hpet_writel(cfg, HPET_CFG); } -static void hpet_enable_int(void) +static void hpet_enable_legacy_int(void) { unsigned long cfg = hpet_readl(HPET_CFG); @@ -187,7 +187,39 @@ static void hpet_enable_int(void) hpet_legacy_int_enabled = 1; } -static void hpet_set_mode(enum clock_event_mode mode, +static void hpet_legacy_clockevent_register(void) +{ + uint64_t hpet_freq; + + /* Start HPET legacy interrupts */ + hpet_enable_legacy_int(); + + /* +* The period is a femto seconds value. We need to calculate the +* scaled math multiplication factor for nanosecond to hpet tick +* conversion. +*/ + hpet_freq = 1000ULL; + do_div(hpet_freq, hpet_period); + hpet_clockevent.mult = div_sc((unsigned long) hpet_freq, + NSEC_PER_SEC, 32); + /* Calculate the min / max delta */ + hpet_clockevent.max_delta_ns = clockevent_delta2ns(0x7FFF, + hpet_clockevent); + hpet_clockevent.min_delta_ns = clockevent_delta2ns(0x30, + hpet_clockevent); + + /* +* Start hpet with the boot cpu mask and make it +* global after the IO_APIC has been initialized. +*/ + hpet_clockevent.cpumask = cpumask_of_cpu(smp_processor_id()); + clockevents_register_device(hpet_clockevent); + global_clock_event = hpet_clockevent; + printk(KERN_DEBUG hpet clockevent registered\n); +} + +static void hpet_legacy_set_mode(enum clock_event_mode mode, struct clock_event_device *evt) { unsigned long cfg, cmp, now; @@ -228,12 +260,12 @@ static void hpet_set_mode(enum clock_event_mode mode, break; case CLOCK_EVT_MODE_RESUME: - hpet_enable_int(); + hpet_enable_legacy_int(); break; } } -static int hpet_next_event(unsigned long delta, +static int hpet_legacy_next_event(unsigned long delta, struct clock_event_device *evt) { unsigned long cnt; @@ -273,58 +305,11 @@ static struct clocksource clocksource_hpet = { #endif }; -/* - * Try to setup the HPET timer - */ -int __init hpet_enable(void) +static int hpet_clocksource_register(void) { - unsigned long id; - uint64_t hpet_freq; u64 tmp, start, now; cycle_t t1; - if (!is_hpet_capable()) - return 0; - - hpet_set_mapping(); - - /* -* Read the period and check for a sane value: -*/ - hpet_period =
x86: HPET try to activate force detected hpet
Gitweb: http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=59c69f2a51b41e9886b85f61c04e8d0d2a35f37b Commit: 59c69f2a51b41e9886b85f61c04e8d0d2a35f37b Parent: d54bd57d6580250e6551261f3b15c45a9d90c77b Author: Venki Pallipadi [EMAIL PROTECTED] AuthorDate: Fri Oct 12 23:04:23 2007 +0200 Committer: Thomas Gleixner [EMAIL PROTECTED] CommitDate: Fri Oct 12 23:04:23 2007 +0200 x86: HPET try to activate force detected hpet Enable HPET later during boot, after the force detect in PCI quirks. Also add a call to repeat the force enabling at resume time. Signed-off-by: Venkatesh Pallipadi [EMAIL PROTECTED] Cc: Andi Kleen [EMAIL PROTECTED] Cc: john stultz [EMAIL PROTECTED] Cc: Greg KH [EMAIL PROTECTED] Signed-off-by: Andrew Morton [EMAIL PROTECTED] Signed-off-by: Ingo Molnar [EMAIL PROTECTED] Signed-off-by: Arjan van de Ven [EMAIL PROTECTED] Signed-off-by: Thomas Gleixner [EMAIL PROTECTED] --- arch/x86/kernel/hpet.c | 27 +-- include/asm-x86/hpet.h |1 + 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c index ce3bcc4..a6c6891 100644 --- a/arch/x86/kernel/hpet.c +++ b/arch/x86/kernel/hpet.c @@ -164,6 +164,7 @@ static struct clock_event_device hpet_clockevent = { .set_next_event = hpet_legacy_next_event, .shift = 32, .irq= 0, + .rating = 50, }; static void hpet_start_counter(void) @@ -178,6 +179,17 @@ static void hpet_start_counter(void) hpet_writel(cfg, HPET_CFG); } +static void hpet_resume_device(void) +{ + ich_force_hpet_resume(); +} + +static void hpet_restart_counter(void) +{ + hpet_resume_device(); + hpet_start_counter(); +} + static void hpet_enable_legacy_int(void) { unsigned long cfg = hpet_readl(HPET_CFG); @@ -299,7 +311,7 @@ static struct clocksource clocksource_hpet = { .mask = HPET_MASK, .shift = HPET_SHIFT, .flags = CLOCK_SOURCE_IS_CONTINUOUS, - .resume = hpet_start_counter, + .resume = hpet_restart_counter, #ifdef CONFIG_X86_64 .vread = vread_hpet, #endif @@ -412,10 +424,21 @@ out_nohpet: */ static __init int hpet_late_init(void) { - if (!is_hpet_capable()) + if (boot_hpet_disable) return -ENODEV; + if (!hpet_address) { + if (!force_hpet_address) + return -ENODEV; + + hpet_address = force_hpet_address; + hpet_enable(); + if (!hpet_virt_address) + return -ENODEV; + } + hpet_reserve_platform_timers(hpet_readl(HPET_ID)); + return 0; } fs_initcall(hpet_late_init); diff --git a/include/asm-x86/hpet.h b/include/asm-x86/hpet.h index 7c93324..47de4b8 100644 --- a/include/asm-x86/hpet.h +++ b/include/asm-x86/hpet.h @@ -63,6 +63,7 @@ /* hpet memory map physical address */ extern unsigned long hpet_address; +extern unsigned long force_hpet_address; extern int is_hpet_enabled(void); extern int hpet_enable(void); extern unsigned long hpet_readl(unsigned long a); - To unsubscribe from this list: send the line unsubscribe git-commits-head in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html