[oops] sysdev: Pass the attribute to the low level sysdev show/store function - Kernel

This is a discussion on [oops] sysdev: Pass the attribute to the low level sysdev show/store function - Kernel ; Greetings, Oops below bisects to.. 4a0b2b4dbe1335b8b9886ba3dc85a145d5d938ed is first bad commit commit 4a0b2b4dbe1335b8b9886ba3dc85a145d5d938ed Author: Andi Kleen Date: Tue Jul 1 18:48:41 2008 +0200 sysdev: Pass the attribute to the low level sysdev show/store function [ 85.792961] BUG: unable to handle kernel ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: [oops] sysdev: Pass the attribute to the low level sysdev show/store function

  1. [oops] sysdev: Pass the attribute to the low level sysdev show/store function

    Greetings,

    Oops below bisects to..

    4a0b2b4dbe1335b8b9886ba3dc85a145d5d938ed is first bad commit
    commit 4a0b2b4dbe1335b8b9886ba3dc85a145d5d938ed
    Author: Andi Kleen
    Date: Tue Jul 1 18:48:41 2008 +0200

    sysdev: Pass the attribute to the low level sysdev show/store function

    [ 85.792961] BUG: unable to handle kernel NULL pointer dereference at 0000000000000002
    [ 85.796503] IP: [] sched_mc_power_savings_store+0x13/0x40
    [ 85.796503] PGD 0
    [ 85.796503] Oops: 0000 [1] SMP
    [ 85.796503] CPU 1
    [ 85.796503] Modules linked in: ip6t_LOG xt_tcpudp xt_pkttype xt_limit snd_pcm_oss snd_mixer_oss snd_seq snd_seq_device af_packet ip6t_REJECT nf_conntrack_ipv6 ipt_REJECT xt_state iptable_mangle iptable_nat nf_nat iptable_filter ip6table_mangle nf_conntrack_netbios_ns nf_conntrack_ipv4 nf_conntrack ip_tables cpufreq_conservative cpufreq_userspace cpufreq_powersave acpi_cpufreq ip6table_filter ip6_tables x_tables ipv6 microcode nls_iso8859_1 nls_cp437 vfat fat fuse loop dm_mod tda1004x saa7134_dvb videobuf_dvb dvb_coretda827x tda8290 tuner saa7134 ir_common compat_ioctl32 videodev v4l1_compat snd_hda_intel v4l2_common firewire_ohci snd_pcm videobuf_dma_sg videobuf_core firewire_core snd_timer snd_page_alloc tveeprom crc_itu_t i2c_i801 snd_hwdep usb_storage iTCO_wdt sr_mod e1000e snd rtc_cmos cdrom ohci1394 i2c_core iTCO_vendor_support rtc_core ieee1394 button intel_agp sg soundcore rtc_lib usbhid hid ff_memless ehci_hcd uhci_hcd sd_mod usbcore edd ext3 mbcache jbd fan ahci libata scsi_mod dock thermal processor
    [ 85.796503] Pid: 5514, comm: sched-powersave Not tainted 2.6.27-smp #16
    [ 85.796503] RIP: 0010:[] [] sched_mc_power_savings_store+0x13/0x40
    [ 85.796503] RSP: 0018:ffff8800a69b7e98 EFLAGS: 00010292
    [ 85.796503] RAX: fffffffffffffffb RBX: 0000000000000002 RCX: ffffffffffffffea
    [ 85.796503] RDX: 0000000000000002 RSI: ffff8800a9c18000 RDI: ffffffff80557f90
    [ 85.796503] RBP: ffff8800a69b7ea8 R08: ffffffff8022fe3c R09: ffff8800a9c18000
    [ 85.796503] R10: 000000000009f868 R11: 0000000000000001 R12: ffff8800b11cfba0
    [ 85.796503] R13: ffff8800bf80b730 R14: 00000000ffffffed R15: ffffffff80557fd8
    [ 85.796503] FS: 00007f23d609d6f0(0000) GS:ffff8800bf809480(0000) knlGS:0000000000000000
    [ 85.958513] CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
    [ 85.964251] CR2: 0000000000000002 CR3: 00000000a6947000 CR4: 00000000000006e0
    [ 85.968514] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    [ 85.968514] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
    [ 85.968514] Process sched-powersave (pid: 5514, threadinfo ffff8800a69b6000, task ffff8800bd426820)
    [ 85.998516] Stack: ffff8800a69b7ea8 ffffffff80557a10 ffff8800a69b7eb8 ffffffff8037a533
    [ 86.006589] ffff8800a69b7f08 ffffffff802d7d19 ffff8800a69b7f48 ffff8800b11cfbc0
    [ 86.008516] ffffffff80557a10 0000000000000002 ffff8800a683b600 ffff8800a69b7f48
    [ 86.008516] Call Trace:
    [ 86.008516] [] sysdev_class_store+0x24/0x26
    [ 86.008516] [] sysfs_write_file+0xdf/0x114
    [ 86.008516] [] vfs_write+0xab/0x105
    [ 86.008516] [] sys_write+0x47/0x6f
    [ 86.008516] [] system_call_after_swapgs+0x7b/0x80
    [ 86.008516]
    [ 86.008516]
    [ 86.008516] Code: c7 c7 d0 d8 53 80 89 c3 e8 40 07 1f 00 e8 cf 60 00 00 89 d8 5e 5b c9 c3 55 48 89 e5 53 48 89 cb 48 83 ec 08 48 c7 c1 ea ff ff ff <8a> 12 8d 42 d0 3c 01 77 1d 31 c0 80 fa 31 0f 94 c0 89 05 a6 c4
    [ 86.008516] RIP [] sched_mc_power_savings_store+0x13/0x40
    [ 86.008516] RSP
    [ 86.008516] CR2: 0000000000000002
    [ 86.092212] ---[ end trace 35b0ed9dbfbda663 ]---



  2. Re: [oops] sysdev: Pass the attribute to the low level sysdev show/store function

    On Thu, Jul 24, 2008 at 01:27:24PM +0200, Mike Galbraith wrote:
    > Greetings,
    >
    > Oops below bisects to..


    This patch should fix it.

    -Andi


    commit a2ab909933f8c8623282979dfa64f3e358bdb9fc
    Author: Andi Kleen
    Date: Thu Jul 24 21:57:40 2008 +0200

    Make scheduler sysfs attributes sysdev class devices

    They are really class devices, but were incorrectly declared. This leads
    to crashes with the recent changes that makes non normal sysdevs
    use a different prototype.

    Signed-off-by: Andi Kleen

    diff --git a/kernel/sched.c b/kernel/sched.c
    index 6acf749..24358ca 100644
    --- a/kernel/sched.c
    +++ b/kernel/sched.c
    @@ -7641,34 +7641,34 @@ static ssize_t sched_power_savings_store(const char *buf, size_t count, int smt)
    }

    #ifdef CONFIG_SCHED_MC
    -static ssize_t sched_mc_power_savings_show(struct sys_device *dev,
    - struct sysdev_attribute *attr, char *page)
    +static ssize_t sched_mc_power_savings_show(struct sysdev_class *class,
    + char *page)
    {
    return sprintf(page, "%u\n", sched_mc_power_savings);
    }
    -static ssize_t sched_mc_power_savings_store(struct sys_device *dev,
    - struct sysdev_attribute *attr,
    +static ssize_t sched_mc_power_savings_store(struct sysdev_class *class,
    const char *buf, size_t count)
    {
    return sched_power_savings_store(buf, count, 0);
    }
    -static SYSDEV_ATTR(sched_mc_power_savings, 0644, sched_mc_power_savings_show,
    - sched_mc_power_savings_store);
    +static SYSDEV_CLASS_ATTR(sched_mc_power_savings, 0644,
    + sched_mc_power_savings_show,
    + sched_mc_power_savings_store);
    #endif

    #ifdef CONFIG_SCHED_SMT
    -static ssize_t sched_smt_power_savings_show(struct sys_device *dev,
    - struct sysdev_attribute *attr, char *page)
    +static ssize_t sched_smt_power_savings_show(struct sysdev_class *dev,
    + char *page)
    {
    return sprintf(page, "%u\n", sched_smt_power_savings);
    }
    -static ssize_t sched_smt_power_savings_store(struct sys_device *dev,
    - struct sysdev_attribute *attr,
    +static ssize_t sched_smt_power_savings_store(struct sysdev_class *dev,
    const char *buf, size_t count)
    {
    return sched_power_savings_store(buf, count, 1);
    }
    -static SYSDEV_ATTR(sched_smt_power_savings, 0644, sched_smt_power_savings_show,
    +static SYSDEV_CLASS_ATTR(sched_smt_power_savings, 0644,
    + sched_smt_power_savings_show,
    sched_smt_power_savings_store);
    #endif

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

  3. Re: [oops] sysdev: Pass the attribute to the low level sysdev show/store function

    On Thu, 2008-07-24 at 22:27 +0200, Andi Kleen wrote:
    > On Thu, Jul 24, 2008 at 01:27:24PM +0200, Mike Galbraith wrote:
    > > Greetings,
    > >
    > > Oops below bisects to..

    >
    > This patch should fix it.


    Confirmed, and thanks.

    -Mike

    >
    > -Andi
    >
    >
    > commit a2ab909933f8c8623282979dfa64f3e358bdb9fc
    > Author: Andi Kleen
    > Date: Thu Jul 24 21:57:40 2008 +0200
    >
    > Make scheduler sysfs attributes sysdev class devices
    >
    > They are really class devices, but were incorrectly declared. This leads
    > to crashes with the recent changes that makes non normal sysdevs
    > use a different prototype.
    >
    > Signed-off-by: Andi Kleen
    >
    > diff --git a/kernel/sched.c b/kernel/sched.c
    > index 6acf749..24358ca 100644
    > --- a/kernel/sched.c
    > +++ b/kernel/sched.c
    > @@ -7641,34 +7641,34 @@ static ssize_t sched_power_savings_store(const char *buf, size_t count, int smt)
    > }
    >
    > #ifdef CONFIG_SCHED_MC
    > -static ssize_t sched_mc_power_savings_show(struct sys_device *dev,
    > - struct sysdev_attribute *attr, char *page)
    > +static ssize_t sched_mc_power_savings_show(struct sysdev_class *class,
    > + char *page)
    > {
    > return sprintf(page, "%u\n", sched_mc_power_savings);
    > }
    > -static ssize_t sched_mc_power_savings_store(struct sys_device *dev,
    > - struct sysdev_attribute *attr,
    > +static ssize_t sched_mc_power_savings_store(struct sysdev_class *class,
    > const char *buf, size_t count)
    > {
    > return sched_power_savings_store(buf, count, 0);
    > }
    > -static SYSDEV_ATTR(sched_mc_power_savings, 0644, sched_mc_power_savings_show,
    > - sched_mc_power_savings_store);
    > +static SYSDEV_CLASS_ATTR(sched_mc_power_savings, 0644,
    > + sched_mc_power_savings_show,
    > + sched_mc_power_savings_store);
    > #endif
    >
    > #ifdef CONFIG_SCHED_SMT
    > -static ssize_t sched_smt_power_savings_show(struct sys_device *dev,
    > - struct sysdev_attribute *attr, char *page)
    > +static ssize_t sched_smt_power_savings_show(struct sysdev_class *dev,
    > + char *page)
    > {
    > return sprintf(page, "%u\n", sched_smt_power_savings);
    > }
    > -static ssize_t sched_smt_power_savings_store(struct sys_device *dev,
    > - struct sysdev_attribute *attr,
    > +static ssize_t sched_smt_power_savings_store(struct sysdev_class *dev,
    > const char *buf, size_t count)
    > {
    > return sched_power_savings_store(buf, count, 1);
    > }
    > -static SYSDEV_ATTR(sched_smt_power_savings, 0644, sched_smt_power_savings_show,
    > +static SYSDEV_CLASS_ATTR(sched_smt_power_savings, 0644,
    > + sched_smt_power_savings_show,
    > sched_smt_power_savings_store);
    > #endif
    >


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

+ Reply to Thread