1. 14 May, 2024 12 commits
  2. 07 May, 2024 24 commits
  3. 06 May, 2024 4 commits
    • Chen Ni's avatar
      HID: intel-ish-hid: ipc: Add check for pci_alloc_irq_vectors · 6baa4524
      Chen Ni authored
      Add a check for the return value of pci_alloc_irq_vectors() and return
      error if it fails.
      
      [jkosina@suse.com: reworded changelog based on Srinivas' suggestion]
      Fixes: 74fbc7d3 ("HID: intel-ish-hid: add MSI interrupt support")
      Signed-off-by: default avatarChen Ni <nichen@iscas.ac.cn>
      Acked-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.com>
      6baa4524
    • Zhang Lixu's avatar
      HID: intel-ish-hid: handler multiple MNG_RESET_NOTIFY messages · 25247cf6
      Zhang Lixu authored
      This patch enhances the firmware reset handler in the Intel Integrated
      Sensor Hub (ISH) driver. Previously, the ISH firmware would send a
      MNG_RESET_NOTIFY message in response to an empty IPC message from the
      ish_wakeup function. With the introduction of the feature to load ISH
      firmware from the host on the LunarLake platform, the ISH bootloader
      now involves the IPC function. This results in an additional
      MNG_RESET_NOTIFY message being sent by ISH bootloader after power on.
      Consequently, the driver receives two MNG_RESET_NOTIFY messages during
      system boot up. This can disrupt the dev->dev_state during the first
      reset flow due to the subsequent reset notify message.
      
      To address this, the patch modifies the fw_reset_work_fn function to skip
      the execution of ishtp_reset_compl_handler during the first reset flow if
      a reset is pending. The ishtp_reset_compl_handler will then be executed
      during the second reset flow, ensuring the dev->dev_state is not disrupted.
      Signed-off-by: default avatarZhang Lixu <lixu.zhang@intel.com>
      Acked-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.com>
      25247cf6
    • Zhang Lixu's avatar
      HID: intel-ish-hid: Implement loading firmware from host feature · 579a267e
      Zhang Lixu authored
      Starting from the Lunar Lake generation, the ISH firmware has been
      divided into two components for better space optimization and increased
      flexibility. These components include a bootloader that is integrated
      into the BIOS, and a main firmware that is stored within the operating
      system's file system.
      
      Introduce support for loading ISH main firmware from host. This feature is
      applicable for Lunar Lake and later generation.
      
      Current intel-ishtp-loader, is designed for Chrome OS based systems which
      uses core boot and has different firmware loading method. For non chrome
      systems the ISH firmware loading uses different method.
      
      Key differences include:
      1. The new method utilizes ISHTP capability/fixed client to enumerate the
      firmware loader function. It does not require a connection or flow control,
      unlike the method used in Chrome OS, which is enumerated as an ISHTP
      dynamic client driver, necessitating connect/disconnect operations and flow
      control.
      
      2. The new method employs a table to describe firmware fragments, which are
      sent to ISH in a single operation. Conversely, the Chrome OS method sends
      firmware fragments in multiple operations within a loop, sending only one
      fragment at a time.
      
      Additionally, address potential error scenarios to ensure graceful failure
      handling.
      - Firmware Not Found: Triggers if request_firmware() fails, leaving ISH in
        a waiting state.
        Recovery: Re-insmod the ISH drivers to retry.
      
      - DMA Buffer Allocation Failure: Occurs during prepare_dma_bufs(), leading
        to ISH waiting state. Allocated resources are released.
        Recovery: Re-insmod the ISH drivers to retry.
      
      - Incorrect Firmware Image: Causes ISH to refuse loading after three failed
        attempts.
        Recovery: A platform reset is required.
      
      Please refer to the [Documentation](Documentation/hid/intel-ish-hid.rst)
      for the details on flows.
      Signed-off-by: default avatarZhang Lixu <lixu.zhang@intel.com>
      Acked-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.com>
      579a267e
    • Zhang Lixu's avatar
      HID: intel-ish-hid: Add driver_data for specifying the firmware filename · 6b2a374a
      Zhang Lixu authored
      Introduces a new structure, ishtp_driver_data, to hold driver-specific
      data, including the firmware filename for different hardware variants of
      the Intel Integrated Sensor Hub (ISH).
      Signed-off-by: default avatarZhang Lixu <lixu.zhang@intel.com>
      Acked-by: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Signed-off-by: default avatarJiri Kosina <jkosina@suse.com>
      6b2a374a