Re: 2.3.99-pre8: ht6560b driver bug

From: Mikko Ala-Fossi (malafoss@cc.hut.fi)
Date: Mon May 22 2000 - 03:49:44 EDT

  • Next message: Alexander Viro: "Re: devfs - the missing link"

    On Sun, 21 May 2000, Wolfgang Fritz wrote:

    > The problem is in the function
    > void __init init_ht6560b (void)
    > It calls the function check_region, which finally calls kmalloc. This
    > kmalloc fails because the cache_sizes array is not yet initialized.

    Yes, init_ht6560b(void) is now called too early to use check_region.
    This very same problem should also occur in umc8672 driver.

    Easiest but not so good solution is (of course) removing check_region and
    reserve_region calls. But init_ht6560b(void) and init_umc8672(void) should
    really be called later.

    --- ht6560b.c.alkup Mon May 22 10:20:47 2000
    +++ ht6560b.c Mon May 22 10:26:42 2000
    @@ -309,34 +309,29 @@
     {
             int t;
             
    - if (check_region(HT_CONFIG_PORT,1)) {
    - printk(KERN_ERR "ht6560b: PORT %#x ALREADY IN USE\n", HT_CONFIG_PORT);
    - } else {
    - if (try_to_init_ht6560b()) {
    - request_region(HT_CONFIG_PORT, 1, ide_hwifs[0].name);
    - ide_hwifs[0].chipset = ide_ht6560b;
    - ide_hwifs[1].chipset = ide_ht6560b;
    - ide_hwifs[0].selectproc = &ht6560b_selectproc;
    - ide_hwifs[1].selectproc = &ht6560b_selectproc;
    - ide_hwifs[0].tuneproc = &tune_ht6560b;
    - ide_hwifs[1].tuneproc = &tune_ht6560b;
    - ide_hwifs[0].serialized = 1; /* is this needed? */
    - ide_hwifs[1].serialized = 1; /* is this needed? */
    - ide_hwifs[0].mate = &ide_hwifs[1];
    - ide_hwifs[1].mate = &ide_hwifs[0];
    - ide_hwifs[1].channel = 1;
    -
    - /*
    - * Setting default configurations for drives
    - */
    - t = (HT_CONFIG_DEFAULT << 8);
    - t |= HT_TIMING_DEFAULT;
    - ide_hwifs[0].drives[0].drive_data = t;
    - ide_hwifs[0].drives[1].drive_data = t;
    - t |= (HT_SECONDARY_IF << 8);
    - ide_hwifs[1].drives[0].drive_data = t;
    - ide_hwifs[1].drives[1].drive_data = t;
    - } else
    - printk(KERN_ERR "ht6560b: not found\n");
    - }
    + if (try_to_init_ht6560b()) {
    + ide_hwifs[0].chipset = ide_ht6560b;
    + ide_hwifs[1].chipset = ide_ht6560b;
    + ide_hwifs[0].selectproc = &ht6560b_selectproc;
    + ide_hwifs[1].selectproc = &ht6560b_selectproc;
    + ide_hwifs[0].tuneproc = &tune_ht6560b;
    + ide_hwifs[1].tuneproc = &tune_ht6560b;
    + ide_hwifs[0].serialized = 1; /* is this needed? */
    + ide_hwifs[1].serialized = 1; /* is this needed? */
    + ide_hwifs[0].mate = &ide_hwifs[1];
    + ide_hwifs[1].mate = &ide_hwifs[0];
    + ide_hwifs[1].channel = 1;
    +
    + /*
    + * Setting default configurations for drives
    + */
    + t = (HT_CONFIG_DEFAULT << 8);
    + t |= HT_TIMING_DEFAULT;
    + ide_hwifs[0].drives[0].drive_data = t;
    + ide_hwifs[0].drives[1].drive_data = t;
    + t |= (HT_SECONDARY_IF << 8);
    + ide_hwifs[1].drives[0].drive_data = t;
    + ide_hwifs[1].drives[1].drive_data = t;
    + } else
    + printk(KERN_ERR "ht6560b: not found\n");
     }

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.rutgers.edu
    Please read the FAQ at http://www.tux.org/lkml/



    This archive was generated by hypermail 2b29 : Mon May 22 2000 - 03:53:27 EDT