17 Aug, 2017

2 commits


13 Aug, 2017

1 commit


09 Jun, 2017

1 commit


11 May, 2017

1 commit

  • Pull hw lockdown support from David Howells:
    "Annotation of module parameters that configure hardware resources
    including ioports, iomem addresses, irq lines and dma channels.

    This allows a future patch to prohibit the use of such module
    parameters to prevent that hardware from being abused to gain access
    to the running kernel image as part of locking the kernel down under
    UEFI secure boot conditions.

    Annotations are made by changing:

    module_param(n, t, p)
    module_param_named(n, v, t, p)
    module_param_array(n, t, m, p)

    to:

    module_param_hw(n, t, hwtype, p)
    module_param_hw_named(n, v, t, hwtype, p)
    module_param_hw_array(n, t, hwtype, m, p)

    where the module parameter refers to a hardware setting

    hwtype specifies the type of the resource being configured. This can
    be one of:

    ioport Module parameter configures an I/O port
    iomem Module parameter configures an I/O mem address
    ioport_or_iomem Module parameter could be either (runtime set)
    irq Module parameter configures an I/O port
    dma Module parameter configures a DMA channel
    dma_addr Module parameter configures a DMA buffer address
    other Module parameter configures some other value

    Note that the hwtype is compile checked, but not currently stored (the
    lockdown code probably won't require it). It is, however, there for
    future use.

    A bonus is that the hwtype can also be used for grepping.

    The intention is for the kernel to ignore or reject attempts to set
    annotated module parameters if lockdown is enabled. This applies to
    options passed on the boot command line, passed to insmod/modprobe or
    direct twiddling in /sys/module/ parameter files.

    The module initialisation then needs to handle the parameter not being
    set, by (1) giving an error, (2) probing for a value or (3) using a
    reasonable default.

    What I can't do is just reject a module out of hand because it may
    take a hardware setting in the module parameters. Some important
    modules, some ipmi stuff for instance, both probe for hardware and
    allow hardware to be manually specified; if the driver is aborts with
    any error, you don't get any ipmi hardware.

    Further, trying to do this entirely in the module initialisation code
    doesn't protect against sysfs twiddling.

    [!] Note that in and of itself, this series of patches should have no
    effect on the the size of the kernel or code execution - that is
    left to a patch in the next series to effect. It does mark
    annotated kernel parameters with a KERNEL_PARAM_FL_HWPARAM flag in
    an already existing field"

    * tag 'hwparam-20170420' of git://git.kernel.org/pub/scm/linux/kernel/git/dhowells/linux-fs: (38 commits)
    Annotate hardware config module parameters in sound/pci/
    Annotate hardware config module parameters in sound/oss/
    Annotate hardware config module parameters in sound/isa/
    Annotate hardware config module parameters in sound/drivers/
    Annotate hardware config module parameters in fs/pstore/
    Annotate hardware config module parameters in drivers/watchdog/
    Annotate hardware config module parameters in drivers/video/
    Annotate hardware config module parameters in drivers/tty/
    Annotate hardware config module parameters in drivers/staging/vme/
    Annotate hardware config module parameters in drivers/staging/speakup/
    Annotate hardware config module parameters in drivers/staging/media/
    Annotate hardware config module parameters in drivers/scsi/
    Annotate hardware config module parameters in drivers/pcmcia/
    Annotate hardware config module parameters in drivers/pci/hotplug/
    Annotate hardware config module parameters in drivers/parport/
    Annotate hardware config module parameters in drivers/net/wireless/
    Annotate hardware config module parameters in drivers/net/wan/
    Annotate hardware config module parameters in drivers/net/irda/
    Annotate hardware config module parameters in drivers/net/hamradio/
    Annotate hardware config module parameters in drivers/net/ethernet/
    ...

    Linus Torvalds
     

20 Apr, 2017

1 commit

  • When the kernel is running in secure boot mode, we lock down the kernel to
    prevent userspace from modifying the running kernel image. Whilst this
    includes prohibiting access to things like /dev/mem, it must also prevent
    access by means of configuring driver modules in such a way as to cause a
    device to access or modify the kernel image.

    To this end, annotate module_param* statements that refer to hardware
    configuration and indicate for future reference what type of parameter they
    specify. The parameter parser in the core sees this information and can
    skip such parameters with an error message if the kernel is locked down.
    The module initialisation then runs as normal, but just sees whatever the
    default values for those parameters is.

    Note that we do still need to do the module initialisation because some
    drivers have viable defaults set in case parameters aren't specified and
    some drivers support automatic configuration (e.g. PNP or PCI) in addition
    to manually coded parameters.

    This patch annotates drivers in sound/isa/.

    Suggested-by: Alan Cox
    Signed-off-by: David Howells
    cc: Jaroslav Kysela
    cc: Takashi Iwai
    cc: alsa-devel@alsa-project.org

    David Howells
     

20 Mar, 2017

1 commit


28 Jan, 2015

1 commit


02 Jan, 2015

1 commit

  • snd_es1688_pcm() takes a pointer to a pointer of a PCM where if this
    parameter is provided the newly allocated PCM is stored. This PCM is also
    available from the pcm field of the snd_es1688 struct that got passed to the
    same function. This patch updates all callers which passed a pointer to use
    that field instead and then removes the parameter from the function. This
    makes the code a bit shorter and cleaner.

    Signed-off-by: Lars-Peter Clausen
    Signed-off-by: Takashi Iwai

    Lars-Peter Clausen
     

22 Nov, 2014

1 commit


21 Oct, 2014

1 commit


12 Feb, 2014

1 commit


29 May, 2013

1 commit


07 Dec, 2012

1 commit

  • CONFIG_HOTPLUG is going away as an option. As result the __dev*
    markings will be going away.

    Remove use of __devinit, __devexit_p, __devinitdata, __devinitconst,
    and __devexit.

    Signed-off-by: Bill Pemberton
    Signed-off-by: Takashi Iwai

    Bill Pemberton
     

30 Jul, 2012

1 commit

  • This will fix the following oops:

    [ 6.169981] genirq: Flags mismatch irq 5. 00000000 (ES1688) vs. 00000000 (ES1688)
    [ 6.170851] Pid: 1, comm: swapper Not tainted 3.5.0-00004-gceee0e9 #14
    [ 6.170851] Call Trace:
    [ 6.170851] [] ? __setup_irq+0x3c7/0x420
    [ 6.170851] [] ? request_threaded_irq+0x76/0x140
    [ 6.170851] [] ? snd_es1688_ioctl+0x10/0x10
    [ 6.170851] [] ? request_threaded_irq+0xb2/0x140
    [ 6.170851] [] ? snd_es1688_create+0x96/0x330
    [ 6.170851] [] ? snd_gusextreme_probe+0x18d/0x5a2
    [ 6.170851] [] ? __driver_attach+0x80/0x80
    [ 6.170851] [] ? sysfs_create_link+0xf/0x20
    [ 6.170851] [] ? __driver_attach+0x80/0x80
    [ 6.170851] [] ? isa_bus_probe+0x12/0x20
    [ 6.170851] [] ? driver_probe_device+0x55/0x1c0
    [ 6.170851] [] ? _raw_spin_unlock+0xf/0x30
    [ 6.170851] [] ? klist_next+0x6a/0xe0
    [ 6.170851] [] ? isa_bus_match+0x21/0x40
    [ 6.170851] [] ? bus_for_each_drv+0x34/0x70
    [ 6.170851] [] ? device_attach+0x7b/0x90
    [ 6.170851] [] ? __driver_attach+0x80/0x80
    [ 6.170851] [] ? bus_probe_device+0x5f/0x80
    [ 6.170851] [] ? device_add+0x573/0x620
    [ 6.170851] [] ? complete_all+0x40/0x60
    [ 6.170851] [] ? _raw_spin_unlock_irqrestore+0x1a/0x30
    [ 6.170851] [] ? isa_register_driver+0xb6/0x150
    [ 6.170851] [] ? alsa_card_gusmax_init+0xf/0xf
    [ 6.170851] [] ? do_one_initcall+0x7f/0x12b
    [ 6.170851] [] ? kernel_init+0x112/0x1a9
    [ 6.170851] [] ? do_early_param+0x77/0x77
    [ 6.170851] [] ? do_one_initcall+0x12b/0x12b
    [ 6.170851] [] ? kernel_thread_helper+0x6/0xd
    [ 6.190170] es1688: can't grab IRQ 5
    [ 6.190613] genirq: Flags mismatch irq 5. 00000000 (ES1688) vs. 00000000 (ES1688)
    [ 6.191566] Pid: 1, comm: swapper Not tainted 3.5.0-00004-gceee0e9 #14
    [ 6.192394] Call Trace:
    [ 6.192685] [] ? __setup_irq+0x3c7/0x420
    [ 6.193342] [] ? request_threaded_irq+0x76/0x140
    [ 6.194081] [] ? snd_es1688_ioctl+0x10/0x10
    [ 6.194607] [] ? request_threaded_irq+0xb2/0x140
    [ 6.194607] [] ? snd_es1688_create+0x96/0x330
    [ 6.194607] [] ? snd_gusextreme_probe+0x18d/0x5a2
    [ 6.194607] [] ? __driver_attach+0x80/0x80
    [ 6.194607] [] ? sysfs_create_link+0xf/0x20
    [ 6.194607] [] ? __driver_attach+0x80/0x80
    [ 6.194607] [] ? isa_bus_probe+0x12/0x20
    [ 6.194607] [] ? driver_probe_device+0x55/0x1c0
    [ 6.194607] [] ? _raw_spin_unlock+0xf/0x30
    [ 6.194607] [] ? klist_next+0x6a/0xe0
    [ 6.194607] [] ? isa_bus_match+0x21/0x40
    [ 6.194607] [] ? bus_for_each_drv+0x34/0x70
    [ 6.194607] [] ? device_attach+0x7b/0x90
    [ 6.194607] [] ? __driver_attach+0x80/0x80
    [ 6.194607] [] ? bus_probe_device+0x5f/0x80
    [ 6.194607] [] ? device_add+0x573/0x620
    [ 6.194607] [] ? complete_all+0x40/0x60
    [ 6.194607] [] ? _raw_spin_unlock_irqrestore+0x1a/0x30
    [ 6.194607] [] ? isa_register_driver+0xb6/0x150
    [ 6.194607] [] ? alsa_card_gusmax_init+0xf/0xf
    [ 6.194607] [] ? do_one_initcall+0x7f/0x12b
    [ 6.194607] [] ? kernel_init+0x112/0x1a9
    [ 6.194607] [] ? do_early_param+0x77/0x77
    [ 6.194607] [] ? do_one_initcall+0x12b/0x12b
    [ 6.194607] [] ? kernel_thread_helper+0x6/0xd
    [ 6.210779] es1688: can't grab IRQ 5
    [ 6.211305] gusextreme: probe of gusextreme.0 failed with error -16

    Signed-off-by: Daniel Mack
    Signed-off-by: Fengguang Wu
    Signed-off-by: Takashi Iwai

    Fengguang Wu
     

19 Dec, 2011

1 commit

  • module_param(bool) used to counter-intuitively take an int. In
    fddd5201 (mid-2009) we allowed bool or int/unsigned int using a messy
    trick.

    It's time to remove the int/unsigned int option. For this version
    it'll simply give a warning, but it'll break next kernel version.

    Signed-off-by: Rusty Russell
    Signed-off-by: Takashi Iwai

    Rusty Russell
     

01 Nov, 2011

2 commits


22 Sep, 2011

1 commit

  • Since commit [e58aa3d2: genirq: Run irq handlers with interrupts disabled],
    We run all interrupt handlers with interrupts disabled
    and we even check and yell when an interrupt handler
    returns with interrupts enabled (see commit [b738a50a:
    genirq: Warn when handler enables interrupts]).

    So now this flag is a NOOP and can be removed.

    Signed-off-by: Yong Zhang
    Acked-by: Peter Ujfalusi
    Acked-by: Mark Brown
    Signed-off-by: Takashi Iwai

    Yong Zhang
     

14 Sep, 2011

1 commit

  • The semantics of snd_mpu401_uart_new()'s interrupt parameters are
    somewhat counterintuitive: To prevent the function from allocating its
    own interrupt, either the irq number must be invalid, or the irq_flags
    parameter must be zero. At the same time, the irq parameter being
    invalid specifies that the mpu401 code has to work without an interrupt
    allocated by the caller. This implies that, if there is an interrupt
    and it is allocated by the caller, the irq parameter must be set to
    a valid-looking number which then isn't actually used.

    With the removal of IRQF_DISABLED, zero becomes a valid irq_flags value,
    which forces us to handle the parameters differently.

    This patch introduces a new flag MPU401_INFO_IRQ_HOOK for when the
    device interrupt is handled by the caller, and makes the allocation of
    the interrupt to depend only on the irq parameter. As suggested by
    Takashi, the irq_flags parameter was dropped because, when used, it had
    the constant value IRQF_DISABLED.

    Signed-off-by: Clemens Ladisch
    Signed-off-by: Takashi Iwai

    Clemens Ladisch
     

17 May, 2010

1 commit

  • Smatch complains that if (dev == SNDRV_CARDS) we're one past the end of
    the array. That's unlikely to happen in real life, I suppose.

    Also smatch complains about "strcpy(card->shortname, pcm->name);"
    The "pcm->name" buffer is 80 characters and "card->shortname" is 32
    characters. If you follow the call paths it turns out we never actually
    use more than 16 characters so it's not a problem. But anyway, let's
    make it easy for people auditing this in the future.

    Signed-off-by: Dan Carpenter
    Signed-off-by: Takashi Iwai

    Dan Carpenter
     

10 May, 2010

2 commits

  • The ESS ES968 chip is nothing more then a PnP companion
    for a non-PnP audio chip. It was paired with non-PnP ESS' chips:
    ES688 and ES1688. The ESS' audio chips are handled by the es1688
    driver in native mode. The PnP cards are handled by the ES968
    driver in SB compatible mode.

    Move the ES968 chip handling to the es1688 driver so the driver
    can handle both PnP and non-PnP cards. The es968 is removed.

    Also, a new PnP id is added for the card I acquired (the change
    was tested on this card).

    Signed-off-by: Krzysztof Helt
    Signed-off-by: Takashi Iwai

    Krzysztof Helt
     
  • Allocate the snd_es1688 during the snd_card allocation.
    This allows to remove the card pointer from the snd_es1688 structure.

    Signed-off-by: Krzysztof Helt
    Signed-off-by: Takashi Iwai

    Krzysztof Helt
     

05 Nov, 2009

1 commit

  • To avoid confusion in control names for the standard analog PC Beep generator
    using a small Internal PC Speaker, rename all related "PC Speaker" and "PC
    Beep" controls to "Beep" only. This name is more universal and can be also
    used on more platforms without confusion.

    Introduce also "Internal Speaker" in ControlNames.txt for systems with
    full-featured build-in internal speaker.

    Signed-off-by: Jaroslav Kysela
    Signed-off-by: Takashi Iwai

    Jaroslav Kysela
     

04 Jun, 2009

1 commit


17 Feb, 2009

1 commit


05 Feb, 2009

1 commit


31 Jan, 2009

1 commit


12 Jan, 2009

1 commit


03 Nov, 2008

1 commit


13 Aug, 2008

1 commit


01 Feb, 2008

1 commit

  • This header file exists only for some hacks to adapt alsa-driver
    tree. It's useless for building in the kernel. Let's move a few
    lines in it to sound/core.h and remove it.
    With this patch, sound/driver.h isn't removed but has just a single
    compile warning to include it. This should be really killed in
    future.

    Signed-off-by: Takashi Iwai
    Signed-off-by: Jaroslav Kysela

    Takashi Iwai
     

16 Oct, 2007

1 commit


11 May, 2007

2 commits

  • Seperate out the legacy probing into its own function, improving
    readability.

    Signed-off-by: Rene Herman
    Signed-off-by: Takashi Iwai
    Signed-off-by: Jaroslav Kysela

    Rene Herman
     
  • es1688: port to isa_bus infrastructure. very slight reorganization of
    the auto-probe code to be a bit easier on the eye (if not the senses).

    Signed-off-by: Rene Herman
    Signed-off-by: Takashi Iwai
    Signed-off-by: Jaroslav Kysela

    Rene Herman
     

14 Feb, 2007

1 commit

  • Fix __devinit and __devexit issues with sound drivers.
    Resolves MODPOST warnings similar to:
    WARNING: sound/drivers/snd-dummy.o - Section mismatch: reference to .init.text:snd_dummy_probe from .data.rel.local between 'snd_dummy_driver' (at offset 0x0) and 'snd_dummy_controls'
    WARNING: sound/drivers/snd-mtpav.o - Section mismatch: reference to .init.text:snd_mtpav_probe from .data.rel.local between 'snd_mtpav_driver' (at offset 0x0) and 'snd_mtpav_input'
    WARNING: sound/drivers/snd-virmidi.o - Section mismatch: reference to .init.text:snd_virmidi_probe from .data.rel.local after 'snd_virmidi_driver' (at offset 0x0)

    Signed-off-by: Prarit Bhargava
    Signed-off-by: Takashi Iwai
    Signed-off-by: Jaroslav Kysela

    Prarit Bhargava
     

05 Oct, 2006

1 commit

  • Maintain a per-CPU global "struct pt_regs *" variable which can be used instead
    of passing regs around manually through all ~1800 interrupt handlers in the
    Linux kernel.

    The regs pointer is used in few places, but it potentially costs both stack
    space and code to pass it around. On the FRV arch, removing the regs parameter
    from all the genirq function results in a 20% speed up of the IRQ exit path
    (ie: from leaving timer_interrupt() to leaving do_IRQ()).

    Where appropriate, an arch may override the generic storage facility and do
    something different with the variable. On FRV, for instance, the address is
    maintained in GR28 at all times inside the kernel as part of general exception
    handling.

    Having looked over the code, it appears that the parameter may be handed down
    through up to twenty or so layers of functions. Consider a USB character
    device attached to a USB hub, attached to a USB controller that posts its
    interrupts through a cascaded auxiliary interrupt controller. A character
    device driver may want to pass regs to the sysrq handler through the input
    layer which adds another few layers of parameter passing.

    I've build this code with allyesconfig for x86_64 and i386. I've runtested the
    main part of the code on FRV and i386, though I can't test most of the drivers.
    I've also done partial conversion for powerpc and MIPS - these at least compile
    with minimal configurations.

    This will affect all archs. Mostly the changes should be relatively easy.
    Take do_IRQ(), store the regs pointer at the beginning, saving the old one:

    struct pt_regs *old_regs = set_irq_regs(regs);

    And put the old one back at the end:

    set_irq_regs(old_regs);

    Don't pass regs through to generic_handle_irq() or __do_IRQ().

    In timer_interrupt(), this sort of change will be necessary:

    - update_process_times(user_mode(regs));
    - profile_tick(CPU_PROFILING, regs);
    + update_process_times(user_mode(get_irq_regs()));
    + profile_tick(CPU_PROFILING);

    I'd like to move update_process_times()'s use of get_irq_regs() into itself,
    except that i386, alone of the archs, uses something other than user_mode().

    Some notes on the interrupt handling in the drivers:

    (*) input_dev() is now gone entirely. The regs pointer is no longer stored in
    the input_dev struct.

    (*) finish_unlinks() in drivers/usb/host/ohci-q.c needs checking. It does
    something different depending on whether it's been supplied with a regs
    pointer or not.

    (*) Various IRQ handler function pointers have been moved to type
    irq_handler_t.

    Signed-Off-By: David Howells
    (cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)

    David Howells
     

03 Jul, 2006

1 commit


12 Apr, 2006

2 commits