Input: goodix - add support for GT1158
Subsystems (16)
Sasha Levin
maintainerPATCH 1/38 Input: goodix - add support for GT1158
From: Ondrej Jirman <[email protected]>
[ Upstream commit 425fe4709c76e35f93f4c0e50240f0b61b2a2e54 ]
This controller is used by PinePhone and PinePhone Pro. Support for the PinePhone Pro will be added in a later patch set.
--- drivers/input/touchscreen/goodix.c | 1 + 1 file changed, 1 insertion(+)
drivers/input/touchscreen/goodix.c +1 -0
@@ -95,6 +95,7 @@ static const struct goodix_chip_data gt9x_chip_data = {static const struct goodix_chip_id goodix_chip_ids[] = { { .id ="1151" , .data = >1x_chip_data }, + { .id ="1158" , .data = >1x_chip_data }, { .id ="5663" , .data = >1x_chip_data }, { .id ="5688" , .data = >1x_chip_data }, { .id ="917S" , .data = >1x_chip_data },
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 2/38 platform/surface: aggregator_registry: Add support for Surface Laptop Go 2
From: Maximilian Luz <[email protected]>
[ Upstream commit 84b8e403435c8fb94b872309673764a447961e00 ]
The Surface Laptop Go 2 seems to have the same SAM client devices as the Surface Laptop Go 1, so re-use its node group.
--- drivers/platform/surface/surface_aggregator_registry.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/platform/surface/surface_aggregator_registry.c +3 -0
@@ -556,6 +556,9 @@ static const struct acpi_device_id ssam_platform_hub_match[] = {/* Surface Laptop Go 1 */ { "MSHW0118", (unsigned long)ssam_node_group_slg1 }, +/* Surface Laptop Go 2 */ + { "MSHW0290", (unsigned long)ssam_node_group_slg1 }, +/* Surface Laptop Studio */ { "MSHW0123", (unsigned long)ssam_node_group_sls },
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 3/38 drm/msm/rd: Fix FIFO-full deadlock
In reply to Sasha LevinFrom: Rob Clark <[email protected]>
[ Upstream commit 174974d8463b77c2b4065e98513adb204e64de7d ]
If the previous thing cat'ing $debugfs/rd left the FIFO full, then subsequent open could deadlock in rd_write() (because open is blocked, not giving a chance for read() to consume any data in the FIFO). Also it is generally a good idea to clear out old data from the FIFO.
Patchwork: https://patchwork.freedesktop.org/patch/496706/
--- drivers/gpu/drm/msm/msm_rd.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/msm/msm_rd.c +3 -0
@@ -196,6 +196,9 @@ static int rd_open(struct inode *inode, struct file *file) file->private_data = rd; rd->open = true; +/* Reset fifo to clear any previously unread data: */ + rd->fifo.head = rd->fifo.tail =0 ; +/* the parsing tools need to know gpu-id to know which * register database to load. *
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 4/38 peci: cpu: Fix use-after-free in adev_release()
In reply to Sasha LevinFrom: Iwona Winiarska <[email protected]>
[ Upstream commit 1c11289b34ab67ed080bbe0f1855c4938362d9cf ]
When auxiliary_device_add() returns an error, auxiliary_device_uninit() is called, which causes refcount for device to be decremented and .release callback will be triggered.
Because adev_release() re-calls auxiliary_device_uninit(), it will cause use-after-free:
[ 1269.455172] WARNING: CPU: 0 PID: 14267 at lib/refcount.c:28 refcount_warn_saturate+0x110/0x15 [ 1269.464007] refcount_t: underflow; use-after-free.
--- drivers/peci/cpu.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/peci/cpu.c +1 -2
@@ -188,8 +188,6 @@ static void adev_release(struct device *dev) {struct auxiliary_device *adev =to_auxiliary_dev (dev); -auxiliary_device_uninit (adev); -kfree (adev->name);kfree (adev); }
@@ -234,6 +232,7 @@ static void unregister_adev(void *_adev)struct auxiliary_device *adev = _adev;auxiliary_device_delete (adev); +auxiliary_device_uninit (adev); }static int devm_adev_add (struct device *dev,int idx)
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 5/38 hwmon: (pmbus) Use dev_err_probe() to filter -EPROBE_DEFER error messages
In reply to Sasha LevinFrom: Christophe JAILLET <[email protected]>
[ Upstream commit 09e52d17b72d3a4bf6951a90ccd8c97fae04e5cf ]
devm_regulator_register() can return -EPROBE_DEFER, so better use dev_err_probe() instead of dev_err(), it is less verbose in such a case.
It is also more informative, which can't hurt.
--- drivers/hwmon/pmbus/pmbus_core.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/hwmon/pmbus/pmbus_core.c +4 -5
@@ -2730,11 +2730,10 @@ static int pmbus_regulator_register(struct pmbus_data *data) rdev =devm_regulator_register (dev, &info->reg_desc[i], &config); -if (IS_ERR (rdev)) { -dev_err (dev,"Failed to register %s regulator\n" , - info->reg_desc[i].name); -return PTR_ERR (rdev); - } +if (IS_ERR (rdev)) +return dev_err_probe (dev,PTR_ERR (rdev), +"Failed to register %s regulator\n" , + info->reg_desc[i].name); }return 0 ;
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 6/38 kvm: x86: mmu: Always flush TLBs when enabling dirty logging
In reply to Sasha LevinFrom: Junaid Shahid <[email protected]>
[ Upstream commit b64d740ea7ddc929d97b28de4c0665f7d5db9e2a ]
When A/D bits are not available, KVM uses a software access tracking mechanism, which involves making the SPTEs inaccessible. However, the clear_young() MMU notifier does not flush TLBs. So it is possible that there may still be stale, potentially writable, TLB entries. This is usually fine, but can be problematic when enabling dirty logging, because it currently only does a TLB flush if any SPTEs were modified. But if all SPTEs are in access-tracked state, then there won't be a TLB flush, which means that the guest could still possibly write to memory and not have it reflected in the dirty bitmap.
So just unconditionally flush the TLBs when enabling dirty logging. As an alternative, KVM could explicitly check the MMU-Writable bit when write-protecting SPTEs to decide if a flush is needed (instead of checking the Writable bit), but given that a flush almost always happens anyway, so just making it unconditional seems simpler.
Message-Id: <[email protected]>
--- arch/x86/kvm/mmu/mmu.c | 45 +++++++---------------------------------- arch/x86/kvm/mmu/spte.h | 14 +++++++++---- arch/x86/kvm/x86.c | 44 ++++++++++++++++++++++++++++++++++++++++ 3 files changed, 61 insertions(+), 42 deletions(-)
arch/x86/kvm/mmu/mmu.c +7 -38
@@ -5907,47 +5907,18 @@ void kvm_mmu_slot_remove_write_access(struct kvm *kvm,const struct kvm_memory_slot *memslot, int start_level) { - bool flush = false; - if (kvm_memslots_have_rmaps(kvm)) { write_lock(&kvm->mmu_lock); - flush =slot_handle_level (kvm, memslot, slot_rmap_write_protect, - start_level,KVM_MAX_HUGEPAGE_LEVEL , - false); +slot_handle_level (kvm, memslot, slot_rmap_write_protect, + start_level,KVM_MAX_HUGEPAGE_LEVEL , false);write_unlock (&kvm->mmu_lock); }if (is_tdp_mmu_enabled (kvm)) {read_lock (&kvm->mmu_lock); - flush |=kvm_tdp_mmu_wrprot_slot (kvm, memslot, start_level); +kvm_tdp_mmu_wrprot_slot (kvm, memslot, start_level);read_unlock (&kvm->mmu_lock); } - -/* -* Flush TLBs if any SPTEs had to be write-protected to ensure that -* guest writes are reflected in the dirty bitmap before the memslot -* update completes, i.e. before enabling dirty logging is visible to -* userspace. -* -* Perform the TLB flush outside the mmu_lock to reduce the amount of -* time the lock is held. However, this does mean that another CPU can -* now grab mmu_lock and encounter a write-protected SPTE while CPUs -* still have a writable mapping for the associated GFN in their TLB. -* -* This is safe but requires KVM to be careful when making decisions -* based on the write-protection status of an SPTE. Specifically, KVM -* also write-protects SPTEs to monitor changes to guest page tables -* during shadow paging, and must guarantee no CPUs can write to those -* page before the lock is dropped. As mentioned in the previous -* paragraph, a write-protected SPTE is no guarantee that CPU cannot -* perform writes. So to determine if a TLB flush is truly required, KVM -* will clear a separate software-only bit (MMU-writable) and skip the -* flush if-and-only-if this bit was already clear. -* -* See is_writable_pte() for more details. -*/ -if (flush) -kvm_arch_flush_remote_tlbs_memslot (kvm, memslot); }/* Must be called with the mmu_lock held in write-mode. */
@@ -6070,32 +6041,30 @@ void kvm_arch_flush_remote_tlbs_memslot(struct kvm *kvm,void kvm_mmu_slot_leaf_clear_dirty (struct kvm *kvm,const struct kvm_memory_slot *memslot) { -bool flush = false; -if (kvm_memslots_have_rmaps (kvm)) {write_lock (&kvm->mmu_lock);/* * Clear dirty bits only on 4k SPTEs since the legacy MMU only * support dirty logging at a 4k granularity. */ - flush =slot_handle_level_4k (kvm, memslot, __rmap_clear_dirty, false); +slot_handle_level_4k (kvm, memslot, __rmap_clear_dirty, false);write_unlock (&kvm->mmu_lock); }if (is_tdp_mmu_enabled (kvm)) {read_lock (&kvm->mmu_lock); - flush |=kvm_tdp_mmu_clear_dirty_slot (kvm, memslot); +kvm_tdp_mmu_clear_dirty_slot (kvm, memslot);read_unlock (&kvm->mmu_lock); }/* +* The caller will flush the TLBs after this function returns. +* * It's also safe to flush TLBs out of mmu lock here as currently this * function is only used for dirty logging, in which case flushing TLB * out of mmu lock also guarantees no dirty pages will be lost in * dirty_bitmap. */ -if (flush) -kvm_arch_flush_remote_tlbs_memslot (kvm, memslot); }void kvm_mmu_zap_all (struct kvm *kvm)
arch/x86/kvm/mmu/spte.h +10 -4
@@ -326,7 +326,7 @@ static __always_inline bool is_rsvd_spte(struct rsvd_bits_validate *rsvd_check, }/* -* An shadow-present leaf SPTE may be non-writable for 3 possible reasons: +* A shadow-present leaf SPTE may be non-writable for 4 possible reasons: * * 1. To intercept writes for dirty logging. KVM write-protects huge pages * so that they can be split be split down into the dirty logging
@@ -344,8 +344,13 @@ static __always_inline bool is_rsvd_spte(struct rsvd_bits_validate *rsvd_check,* read-only memslot or guest memory backed by a read-only VMA. Writes to * such pages are disallowed entirely. * -* To keep track of why a given SPTE is write-protected, KVM uses 2 -* software-only bits in the SPTE: +* 4. To emulate the Accessed bit for SPTEs without A/D bits. Note, in this +* case, the SPTE is access-protected, not just write-protected! +* +* For cases #1 and #4, KVM can safely make such SPTEs writable without taking +* mmu_lock as capturing the Accessed/Dirty state doesn't require taking it. +* To differentiate #1 and #4 from #2 and #3, KVM uses two software-only bits +* in the SPTE: * * shadow_mmu_writable_mask, aka MMU-writable - * Cleared on SPTEs that KVM is currently write-protecting for shadow paging
@@ -374,7 +379,8 @@ static __always_inline bool is_rsvd_spte(struct rsvd_bits_validate *rsvd_check,* shadow page tables between vCPUs. Write-protecting an SPTE for dirty logging * (which does not clear the MMU-writable bit), does not flush TLBs before * dropping the lock, as it only needs to synchronize guest writes with the -* dirty bitmap. +* dirty bitmap. Similarly, making the SPTE inaccessible (and non-writable) for +* access-tracking via the clear_young() MMU notifier also does not flush TLBs. * * So, there is the problem: clearing the MMU-writable bit can encounter a * write-protected SPTE while CPUs still have writable mappings for that SPTE
arch/x86/kvm/x86.c +44 -0
50 lines not on this page · raw message
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 7/38 dt-bindings: iio: gyroscope: bosch,bmg160: correct number of pins
In reply to Sasha LevinFrom: Krzysztof Kozlowski <[email protected]>
[ Upstream commit 767470209cedbe2cc72ba38d77c9f096d2c7694c ]
BMG160 has two interrupt pins to which interrupts can be freely mapped. Correct the schema to express such case and fix warnings like:
qcom/msm8916-alcatel-idol347.dtb: gyroscope@68: interrupts: [[97, 1], [98, 1]] is too long
However the basic issue still persists - the interrupts should come in a defined order.
--- .../devicetree/bindings/iio/gyroscope/bosch,bmg160.yaml | 2 ++ 1 file changed, 2 insertions(+)
Documentation/devicetree/bindings/iio/gyroscope/bosch,bmg160.yaml +2 -0
@@ -24,8 +24,10 @@ properties: interrupts: minItems: 1 + maxItems: 2 description: Should be configured with type IRQ_TYPE_EDGE_RISING. + If two interrupts are provided, expected order is INT1 and INT2. required: - compatible
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 8/38 HID: hidraw: fix memory leak in hidraw_release()
In reply to Sasha LevinFrom: Karthik Alapati <[email protected]>
[ Upstream commit a5623a203cffe2d2b84d2f6c989d9017db1856af ]
Free the buffered reports before deleting the list entry.
BUG: memory leak
unreferenced object 0xffff88810e72f180 (size 32):
comm "softirq", pid 0, jiffies 4294945143 (age 16.080s)
hex dump (first 32 bytes):
64 f3 c6 6a d1 88 07 04 00 00 00 00 00 00 00 00 d..j............
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
backtrace:
[<ffffffff814ac6c3>] kmemdup+0x23/0x50 mm/util.c:128
[<ffffffff8357c1d2>] kmemdup include/linux/fortify-string.h:440 [inline]
[<ffffffff8357c1d2>] hidraw_report_event+0xa2/0x150 drivers/hid/hidraw.c:521
[<ffffffff8356ddad>] hid_report_raw_event+0x27d/0x740 drivers/hid/hid-core.c:1992
[<ffffffff8356e41e>] hid_input_report+0x1ae/0x270 drivers/hid/hid-core.c:2065
[<ffffffff835f0d3f>] hid_irq_in+0x1ff/0x250 drivers/hid/usbhid/hid-core.c:284
[<ffffffff82d3c7f9>] __usb_hcd_giveback_urb+0xf9/0x230 drivers/usb/core/hcd.c:1670
[<ffffffff82d3cc26>] usb_hcd_giveback_urb+0x1b6/0x1d0 drivers/usb/core/hcd.c:1747
[<ffffffff82ef1e14>] dummy_timer+0x8e4/0x14c0 drivers/usb/gadget/udc/dummy_hcd.c:1988
[<ffffffff812f50a8>] call_timer_fn+0x38/0x200 kernel/time/timer.c:1474
[<ffffffff812f5586>] expire_timers kernel/time/timer.c:1519 [inline]
[<ffffffff812f5586>] __run_timers.part.0+0x316/0x430 kernel/time/timer.c:1790
[<ffffffff812f56e4>] __run_timers kernel/time/timer.c:1768 [inline]
[<ffffffff812f56e4>] run_timer_softirq+0x44/0x90 kernel/time/timer.c:1803
[<ffffffff848000e6>] __do_softirq+0xe6/0x2ea kernel/softirq.c:571
[<ffffffff81246db0>] invoke_softirq kernel/softirq.c:445 [inline]
[<ffffffff81246db0>] __irq_exit_rcu kernel/softirq.c:650 [inline]
[<ffffffff81246db0>] irq_exit_rcu+0xc0/0x110 kernel/softirq.c:662
[<ffffffff84574f02>] sysvec_apic_timer_interrupt+0xa2/0xd0 arch/x86/kernel/apic/apic.c:1106
[<ffffffff84600c8b>] asm_sysvec_apic_timer_interrupt+0x1b/0x20 arch/x86/include/asm/idtentry.h:649
[<ffffffff8458a070>] native_safe_halt arch/x86/include/asm/irqflags.h:51 [inline]
[<ffffffff8458a070>] arch_safe_halt arch/x86/include/asm/irqflags.h:89 [inline]
[<ffffffff8458a070>] acpi_safe_halt drivers/acpi/processor_idle.c:111 [inline]
[<ffffffff8458a070>] acpi_idle_do_entry+0xc0/0xd0 drivers/acpi/processor_idle.c:554--- drivers/hid/hidraw.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/hid/hidraw.c +2 -0
@@ -350,6 +350,8 @@ static int hidraw_release(struct inode * inode, struct file * file)down_write (&minors_rwsem);spin_lock_irqsave (&hidraw_table[minor]->list_lock, flags); +for (int i = list->tail; i < list->head; i++) +kfree (list->buffer[i].value);list_del (&list->node);spin_unlock_irqrestore (&hidraw_table[minor]->list_lock, flags);kfree (list);
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 9/38 HID: asus: ROG NKey: Ignore portion of 0x5a report
In reply to Sasha LevinFrom: Josh Kilmer <[email protected]>
[ Upstream commit 1c0cc9d11c665020cbeb80e660fb8929164407f4 ]
On an Asus G513QY, of the 5 bytes in a 0x5a report, only the first byte is a meaningful keycode. The other bytes are zeroed out or hold garbage from the last packet sent to the keyboard.
This patch fixes up the report descriptor for this event so that the general hid code will only process 1 byte for keycodes, avoiding spurious key events and unmapped Asus vendor usagepage code warnings.
--- drivers/hid/hid-asus.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/hid/hid-asus.c +7 -0
@@ -1212,6 +1212,13 @@ static __u8 *asus_report_fixup(struct hid_device *hdev, __u8 *rdesc, rdesc = new_rdesc; } +if (drvdata->quirks &QUIRK_ROG_NKEY_KEYBOARD && + *rsize ==331 && rdesc[190 ] ==0x85 && rdesc[191 ] ==0x5a && + rdesc[204 ] ==0x95 && rdesc[205 ] ==0x05 ) { +hid_info (hdev,"Fixing up Asus N-KEY keyb report descriptor\n" ); + rdesc[205 ] =0x01 ; + } +return rdesc; }
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 10/38 HID: ishtp-hid-clientHID: ishtp-hid-client: Fix comment typo
In reply to Sasha LevinFrom: Jason Wang <[email protected]>
[ Upstream commit 94553f8a218540d676efbf3f7827ed493d1057cf ]
The double `like' is duplicated in the comment, remove one.
--- drivers/hid/intel-ish-hid/ishtp-hid.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hid/intel-ish-hid/ishtp-hid.h +1 -1
@@ -105,7 +105,7 @@ struct report_list {* @multi_packet_cnt: Count of fragmented packet count * * This structure is used to store completion flags and per client data like -* like report description, number of HID devices etc. +* report description, number of HID devices etc. */ struct ishtp_cl_data {/* completion flags */
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 11/38 hid: intel-ish-hid: ishtp: Fix ishtp client sending disordered message
In reply to Sasha LevinFrom: Even Xu <[email protected]>
[ Upstream commit e1fa076706209cc447d7a2abd0843a18277e5ef7 ]
There is a timing issue captured during ishtp client sending stress tests. It was observed during stress tests that ISH firmware is getting out of ordered messages. This is a rare scenario as the current set of ISH client drivers don't send much data to firmware. But this may not be the case going forward.
When message size is bigger than IPC MTU, ishtp splits the message into fragments and uses serialized async method to send message fragments. The call stack:ishtp_cl_send_msg_ipc->ipc_tx_callback(first fregment)-> ishtp_send_msg(with callback)->write_ipc_to_queue-> write_ipc_from_queue->callback->ipc_tx_callback(next fregment)......
When an ipc write complete interrupt is received, driver also calls write_ipc_from_queue->ipc_tx_callback in ISR to start sending of next fragment.
Through ipc_tx_callback uses spin_lock to protect message splitting, as the serialized sending method will call back to ipc_tx_callback again, so it doesn't put sending under spin_lock, it causes driver cannot guarantee all fragments be sent in order.
Considering this scenario:ipc_tx_callback just finished a fragment splitting, and not call ishtp_send_msg yet, there is a write complete interrupt happens, then ISR->write_ipc_from_queue ->ipc_tx_callback->ishtp_send_msg->write_ipc_to_queue......
Because ISR has higher exec priority than normal thread, this causes the new fragment be sent out before previous fragment. This disordered message causes invalid message to firmware.
The solution is, to send fragments synchronously:
Use ishtp_write_message writing fragments into tx queue directly one by one, instead of ishtp_send_msg only writing one fragment with completion callback. As no completion callback be used, so change ipc_tx_callback to ipc_tx_send.
--- drivers/hid/intel-ish-hid/ishtp/client.c | 68 ++++++++++++++---------- 1 file changed, 39 insertions(+), 29 deletions(-)
drivers/hid/intel-ish-hid/ishtp/client.c +39 -29
@@ -626,13 +626,14 @@ static void ishtp_cl_read_complete(struct ishtp_cl_rb *rb) }/** -* ipc_tx_callback() - IPC tx callback function +* ipc_tx_send() - IPC tx send function * @prm: Pointer to client device instance * -* Send message over IPC either first time or on callback on previous message -* completion +* Send message over IPC. Message will be split into fragments +* if message size is bigger than IPC FIFO size, and all +* fragments will be sent one by one. */ -static void ipc_tx_callback (void *prm) +static void ipc_tx_send (void *prm) {struct ishtp_cl *cl = prm;struct ishtp_cl_tx_ring *cl_msg;
@@ -677,32 +678,41 @@ static void ipc_tx_callback(void *prm) list); rem = cl_msg->send_buf.size - cl->tx_offs; - ishtp_hdr.host_addr = cl->host_client_id; - ishtp_hdr.fw_addr = cl->fw_client_id; - ishtp_hdr.reserved =0 ; - pmsg = cl_msg->send_buf.data + cl->tx_offs; +while (rem >0 ) { + ishtp_hdr.host_addr = cl->host_client_id; + ishtp_hdr.fw_addr = cl->fw_client_id; + ishtp_hdr.reserved =0 ; + pmsg = cl_msg->send_buf.data + cl->tx_offs; + +if (rem <= dev->mtu) { +/* Last fragment or only one packet */ + ishtp_hdr.length = rem; + ishtp_hdr.msg_complete =1 ; +/* Submit to IPC queue with no callback */ +ishtp_write_message (dev, &ishtp_hdr, pmsg); + cl->tx_offs =0 ; + cl->sending =0 ; -if (rem <= dev->mtu) { - ishtp_hdr.length = rem; - ishtp_hdr.msg_complete =1 ; - cl->sending =0 ; -list_del_init (&cl_msg->list);/* Must be before write */ -spin_unlock_irqrestore (&cl->tx_list_spinlock, tx_flags); -/* Submit to IPC queue with no callback */ -ishtp_write_message (dev, &ishtp_hdr, pmsg); -spin_lock_irqsave (&cl->tx_free_list_spinlock, tx_free_flags); -list_add_tail (&cl_msg->list, &cl->tx_free_list.list); - ++cl->tx_ring_free_size; -spin_unlock_irqrestore (&cl->tx_free_list_spinlock, - tx_free_flags); - }else { -/* Send IPC fragment */ -spin_unlock_irqrestore (&cl->tx_list_spinlock, tx_flags); - cl->tx_offs += dev->mtu; - ishtp_hdr.length = dev->mtu; - ishtp_hdr.msg_complete =0 ; -ishtp_send_msg (dev, &ishtp_hdr, pmsg, ipc_tx_callback, cl); +break ; + }else { +/* Send ipc fragment */ + ishtp_hdr.length = dev->mtu; + ishtp_hdr.msg_complete =0 ; +/* All fregments submitted to IPC queue with no callback */ +ishtp_write_message (dev, &ishtp_hdr, pmsg); + cl->tx_offs += dev->mtu; + rem = cl_msg->send_buf.size - cl->tx_offs; + } } + +list_del_init (&cl_msg->list); +spin_unlock_irqrestore (&cl->tx_list_spinlock, tx_flags); + +spin_lock_irqsave (&cl->tx_free_list_spinlock, tx_free_flags); +list_add_tail (&cl_msg->list, &cl->tx_free_list.list); + ++cl->tx_ring_free_size; +spin_unlock_irqrestore (&cl->tx_free_list_spinlock, + tx_free_flags); }/**
@@ -720,7 +730,7 @@ static void ishtp_cl_send_msg_ipc(struct ishtp_device *dev,return ; cl->tx_offs =0 ; -ipc_tx_callback (cl); +ipc_tx_send (cl); ++cl->send_msg_cnt_ipc; }
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 12/38 HID: thrustmaster: Add sparco wheel and fix array length
In reply to Sasha LevinFrom: Michael Hübner <[email protected]>
[ Upstream commit d9a17651f3749e69890db57ca66e677dfee70829 ]
Add device id for the Sparco R383 Mod wheel.
Fix wheel info array length to match actual wheel count present in the array.
--- drivers/hid/hid-thrustmaster.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/hid/hid-thrustmaster.c +2 -1
@@ -67,12 +67,13 @@ static const struct tm_wheel_info tm_wheels_infos[] = { {0x0200, 0x0005, "Thrustmaster T300RS (Missing Attachment)"}, {0x0206, 0x0005, "Thrustmaster T300RS"}, {0x0209, 0x0005, "Thrustmaster T300RS (Open Wheel Attachment)"}, + {0x020a, 0x0005, "Thrustmaster T300RS (Sparco R383 Mod)"}, {0x0204, 0x0005, "Thrustmaster T300 Ferrari Alcantara Edition"}, {0x0002, 0x0002, "Thrustmaster T500RS"} //{0x0407, 0x0001, "Thrustmaster TMX"} }; -static const uint8_t tm_wheels_infos_length =4 ; +static const uint8_t tm_wheels_infos_length =7 ;/* * This structs contains (in little endian) the response data
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 13/38 HID: AMD_SFH: Add a DMI quirk entry for Chromebooks
In reply to Sasha LevinFrom: Akihiko Odaki <[email protected]>
[ Upstream commit adada3f4930ac084740ea340bd8e94028eba4f22 ]
Google Chromebooks use Chrome OS Embedded Controller Sensor Hub instead of Sensor Hub Fusion and leaves MP2 uninitialized, which disables all functionalities, even including the registers necessary for feature detections.
The behavior was observed with Lenovo ThinkPad C13 Yoga.
--- drivers/hid/amd-sfh-hid/amd_sfh_pcie.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
drivers/hid/amd-sfh-hid/amd_sfh_pcie.c +18 -0
@@ -285,11 +285,29 @@ static int amd_sfh_irq_init(struct amd_mp2_dev *privdata)return 0 ; } +static const struct dmi_system_id dmi_nodevs[] = { + { +/* +* Google Chromebooks use Chrome OS Embedded Controller Sensor +* Hub instead of Sensor Hub Fusion and leaves MP2 +* uninitialized, which disables all functionalities, even +* including the registers necessary for feature detections. +*/ + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"Google" ), + }, + }, + { } +}; +static int amd_mp2_pci_probe (struct pci_dev *pdev,const struct pci_device_id *id) {struct amd_mp2_dev *privdata;int rc; +if (dmi_first_match (dmi_nodevs)) +return -ENODEV ; + privdata =devm_kzalloc (&pdev->dev,sizeof (*privdata),GFP_KERNEL );if (!privdata)return -ENOMEM ;
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 14/38 HID: add Lenovo Yoga C630 battery quirk
In reply to Sasha LevinFrom: Steev Klimaszewski <[email protected]>
[ Upstream commit 3a47fa7b14c7d9613909a844aba27f99d3c58634 ]
Similar to the Surface Go devices, the Elantech touchscreen/digitizer in the Lenovo Yoga C630 mistakenly reports the battery of the stylus, and always reports an empty battery.
Apply the HID_BATTERY_QUIRK_IGNORE quirk to ignore this battery and prevent the erroneous low battery warnings.
--- drivers/hid/hid-ids.h | 1 + drivers/hid/hid-input.c | 2 ++ 2 files changed, 3 insertions(+)
drivers/hid/hid-ids.h +1 -0
@@ -414,6 +414,7 @@#define USB_DEVICE_ID_ASUS_UX550_TOUCHSCREEN 0x2706#define I2C_DEVICE_ID_SURFACE_GO_TOUCHSCREEN 0x261A#define I2C_DEVICE_ID_SURFACE_GO2_TOUCHSCREEN 0x2A1C +#define I2C_DEVICE_ID_LENOVO_YOGA_C630_TOUCHSCREEN 0x279F#define USB_VENDOR_ID_ELECOM 0x056e#define USB_DEVICE_ID_ELECOM_BM084 0x0061
drivers/hid/hid-input.c +2 -0
@@ -383,6 +383,8 @@ static const struct hid_device_id hid_battery_quirks[] = { HID_BATTERY_QUIRK_IGNORE }, {HID_I2C_DEVICE (USB_VENDOR_ID_ELAN ,I2C_DEVICE_ID_SURFACE_GO2_TOUCHSCREEN ), HID_BATTERY_QUIRK_IGNORE }, + { HID_I2C_DEVICE(USB_VENDOR_ID_ELAN, I2C_DEVICE_ID_LENOVO_YOGA_C630_TOUCHSCREEN), + HID_BATTERY_QUIRK_IGNORE }, {} };
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 15/38 HID: Add Apple Touchbar on T2 Macs in hid_have_special_driver list
In reply to Sasha LevinFrom: Aditya Garg <[email protected]>
[ Upstream commit 750ec977288d96e9a11424e3507ede097af732c4 ]
The touchbar on Apple T2 Macs has 2 modes, one that shows the function keys and other that shows the media controls. The user can use the fn key on his keyboard to switch between the 2 modes.
On Linux, if people were using an external keyboard or mouse, the touchbar failed to change modes on pressing the fn key with the following in dmesg :-
[ 10.661445] apple-ib-als 0003:05AC:8262.0001: : USB HID v1.01 Device [Apple Inc. Ambient Light Sensor] on usb-bce-vhci-3/input0 [ 11.830992] apple-ib-touchbar 0003:05AC:8302.0007: input: USB HID v1.01 Keyboard [Apple Inc. Touch Bar Display] on usb-bce-vhci-6/input0 [ 12.139407] apple-ib-touchbar 0003:05AC:8102.0008: : USB HID v1.01 Device [Apple Inc. Touch Bar Backlight] on usb-bce-vhci-7/input0 [ 12.211824] apple-ib-touchbar 0003:05AC:8102.0009: : USB HID v1.01 Device [Apple Inc. Touch Bar Backlight] on usb-bce-vhci-7/input1 [ 14.219759] apple-ib-touchbar 0003:05AC:8302.0007: tb: Failed to set touch bar mode to 2 (-110) [ 24.395670] apple-ib-touchbar 0003:05AC:8302.0007: tb: Failed to set touch bar mode to 2 (-110) [ 34.635791] apple-ib-touchbar 0003:05AC:8302.0007: tb: Failed to set touch bar mode to 2 (-110) [ 269.579233] apple-ib-touchbar 0003:05AC:8302.0007: tb: Failed to set touch bar mode to 1 (-110)
Add the USB IDs of the touchbar found in T2 Macs to HID have special driver list to fix the issue.
--- drivers/hid/hid-ids.h | 2 ++ drivers/hid/hid-quirks.c | 2 ++ 2 files changed, 4 insertions(+)
drivers/hid/hid-ids.h +2 -0
@@ -185,6 +185,8 @@#define USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2021 0x029c#define USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_FINGERPRINT_2021 0x029a#define USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_NUMPAD_2021 0x029f +#define USB_DEVICE_ID_APPLE_TOUCHBAR_BACKLIGHT 0x8102 +#define USB_DEVICE_ID_APPLE_TOUCHBAR_DISPLAY 0x8302#define USB_VENDOR_ID_ASUS 0x0486#define USB_DEVICE_ID_ASUS_T91MT 0x0185
drivers/hid/hid-quirks.c +2 -0
@@ -314,6 +314,8 @@ static const struct hid_device_id hid_have_special_driver[] = { { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_GEYSER1_TP_ONLY) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_2021) }, { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_MAGIC_KEYBOARD_FINGERPRINT_2021) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_TOUCHBAR_BACKLIGHT) }, + { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_TOUCHBAR_DISPLAY) }, #endif #if IS_ENABLED(CONFIG_HID_APPLEIR) { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_IRCONTROL) },
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 16/38 HID: intel-ish-hid: ipc: Add Meteor Lake PCI device ID
In reply to Sasha LevinFrom: Even Xu <[email protected]>
[ Upstream commit 467249a7dff68451868ca79696aef69764193a8a ]
Add device ID of Meteor Lake P into ishtp support list.
--- drivers/hid/intel-ish-hid/ipc/hw-ish.h | 1 + drivers/hid/intel-ish-hid/ipc/pci-ish.c | 1 + 2 files changed, 2 insertions(+)
drivers/hid/intel-ish-hid/ipc/hw-ish.h +1 -0
@@ -32,6 +32,7 @@#define ADL_P_DEVICE_ID 0x51FC#define ADL_N_DEVICE_ID 0x54FC#define RPL_S_DEVICE_ID 0x7A78 +#define MTL_P_DEVICE_ID 0x7E45#define REVISION_ID_CHT_A0 0x6#define REVISION_ID_CHT_Ax_SI 0x0
drivers/hid/intel-ish-hid/ipc/pci-ish.c +1 -0
@@ -43,6 +43,7 @@ static const struct pci_device_id ish_pci_tbl[] = { {PCI_DEVICE(PCI_VENDOR_ID_INTEL, ADL_P_DEVICE_ID)}, {PCI_DEVICE(PCI_VENDOR_ID_INTEL, ADL_N_DEVICE_ID)}, {PCI_DEVICE(PCI_VENDOR_ID_INTEL, RPL_S_DEVICE_ID)}, + {PCI_DEVICE(PCI_VENDOR_ID_INTEL, MTL_P_DEVICE_ID)}, {0, } };MODULE_DEVICE_TABLE (pci, ish_pci_tbl);
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 17/38 HID: nintendo: fix rumble worker null pointer deref
In reply to Sasha LevinFrom: "Daniel J. Ogorchock" <[email protected]>
[ Upstream commit 1ff89e06c2e5fab30274e4b02360d4241d6e605e ]
We can dereference a null pointer trying to queue work to a destroyed workqueue.
If the device is disconnected, nintendo_hid_remove is called, in which the rumble_queue is destroyed. Avoid using that queue to defer rumble work once the controller state is set to JOYCON_CTLR_STATE_REMOVED.
This eliminates the null pointer dereference.
--- drivers/hid/hid-nintendo.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/hid/hid-nintendo.c +4 -2
@@ -1222,6 +1222,7 @@ static void joycon_parse_report(struct joycon_ctlr *ctlr,spin_lock_irqsave (&ctlr->lock, flags);if (IS_ENABLED (CONFIG_NINTENDO_FF ) && rep->vibrator_report && + ctlr->ctlr_state !=JOYCON_CTLR_STATE_REMOVED && (msecs - ctlr->rumble_msecs) >=JC_RUMBLE_PERIOD_MS && (ctlr->rumble_queue_head != ctlr->rumble_queue_tail || ctlr->rumble_zero_countdown >0 )) {
@@ -1546,12 +1547,13 @@ static int joycon_set_rumble(struct joycon_ctlr *ctlr, u16 amp_r, u16 amp_l, ctlr->rumble_queue_head =0 ;memcpy (ctlr->rumble_data[ctlr->rumble_queue_head], data,JC_RUMBLE_DATA_SIZE ); -spin_unlock_irqrestore (&ctlr->lock, flags);/* don't wait for the periodic send (reduces latency) */ -if (schedule_now) +if (schedule_now && ctlr->ctlr_state !=JOYCON_CTLR_STATE_REMOVED )queue_work (ctlr->rumble_queue, &ctlr->rumble_worker); +spin_unlock_irqrestore (&ctlr->lock, flags); +return 0 ; }
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 18/38 Bluetooth: MGMT: Fix Get Device Flags
In reply to Sasha LevinFrom: Luiz Augusto von Dentz <[email protected]>
[ Upstream commit 23b72814da1a094b4c065e0bb598249f310c5577 ]
Get Device Flags don't check if device does actually use an RPA in which case it shall only set HCI_CONN_FLAG_REMOTE_WAKEUP if LL Privacy is enabled.
--- net/bluetooth/mgmt.c | 71 ++++++++++++++++++++++++++------------------ 1 file changed, 42 insertions(+), 29 deletions(-)
net/bluetooth/mgmt.c +42 -29
@@ -4420,6 +4420,22 @@ static int set_exp_feature(struct sock *sk, struct hci_dev *hdev, MGMT_STATUS_NOT_SUPPORTED); } +static u32 get_params_flags (struct hci_dev *hdev, +struct hci_conn_params *params) +{ +u32 flags = hdev->conn_flags; + +/* Devices using RPAs can only be programmed in the acceptlist if +* LL Privacy has been enable otherwise they cannot mark +* HCI_CONN_FLAG_REMOTE_WAKEUP. +*/ +if ((flags &HCI_CONN_FLAG_REMOTE_WAKEUP ) && !use_ll_privacy (hdev) && +hci_find_irk_by_addr (hdev, ¶ms->addr, params->addr_type)) + flags &= ~HCI_CONN_FLAG_REMOTE_WAKEUP ; + +return flags; +} +static int get_device_flags (struct sock *sk,struct hci_dev *hdev,void *data,u16 data_len) {
@@ -4451,10 +4467,10 @@ static int get_device_flags(struct sock *sk, struct hci_dev *hdev, void *data, }else { params =hci_conn_params_lookup (hdev, &cp->addr.bdaddr,le_addr_type (cp->addr.type)); -if (!params) goto done; + supported_flags =get_params_flags (hdev, params); current_flags = params->flags; }
@@ -4523,38 +4539,35 @@ static int set_device_flags(struct sock *sk, struct hci_dev *hdev, void *data,bt_dev_warn (hdev,"No such BR/EDR device %pMR (0x%x)" , &cp->addr.bdaddr, cp->addr.type); } - }else { - params =hci_conn_params_lookup (hdev, &cp->addr.bdaddr, -le_addr_type (cp->addr.type)); -if (params) { -/* Devices using RPAs can only be programmed in the -* acceptlist LL Privacy has been enable otherwise they -* cannot mark HCI_CONN_FLAG_REMOTE_WAKEUP. -*/ -if ((current_flags &HCI_CONN_FLAG_REMOTE_WAKEUP ) && - !use_ll_privacy (hdev) && -hci_find_irk_by_addr (hdev, ¶ms->addr, - params->addr_type)) { -bt_dev_warn (hdev, -"Cannot set wakeable for RPA" ); - goto unlock; - } - params->flags = current_flags; - status =MGMT_STATUS_SUCCESS ; + goto unlock; + } -/* Update passive scan if HCI_CONN_FLAG_DEVICE_PRIVACY -* has been set. -*/ -if (params->flags &HCI_CONN_FLAG_DEVICE_PRIVACY ) -hci_update_passive_scan (hdev); - }else { -bt_dev_warn (hdev,"No such LE device %pMR (0x%x)" , - &cp->addr.bdaddr, -le_addr_type (cp->addr.type)); - } + params =hci_conn_params_lookup (hdev, &cp->addr.bdaddr, +le_addr_type (cp->addr.type)); +if (!params) { +bt_dev_warn (hdev,"No such LE device %pMR (0x%x)" , + &cp->addr.bdaddr,le_addr_type (cp->addr.type)); + goto unlock; + } + + supported_flags =get_params_flags (hdev, params); + +if ((supported_flags | current_flags) != supported_flags) { +bt_dev_warn (hdev,"Bad flag given (0x%x) vs supported (0x%0x)" , + current_flags, supported_flags); + goto unlock; } + params->flags = current_flags; + status =MGMT_STATUS_SUCCESS ; + +/* Update passive scan if HCI_CONN_FLAG_DEVICE_PRIVACY +* has been set. +*/ +if (params->flags &HCI_CONN_FLAG_DEVICE_PRIVACY ) +hci_update_passive_scan (hdev); + unlock:hci_dev_unlock (hdev);
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 19/38 tg3: Disable tg3 device on system reboot to avoid triggering AER
In reply to Sasha LevinFrom: Kai-Heng Feng <[email protected]>
[ Upstream commit 2ca1c94ce0b65a2ce7512b718f3d8a0fe6224bca ]
Commit d60cd06331a3 ("PM: ACPI: reboot: Use S5 for reboot") caused a reboot hang on one Dell servers so the commit was reverted.
Someone managed to collect the AER log and it's caused by MSI:
[ 148.762067] ACPI: Preparing to enter system sleep state S5
[ 148.794638] {1}[Hardware Error]: Hardware error from APEI Generic Hardware Error Source: 5
[ 148.803731] {1}[Hardware Error]: event severity: recoverable
[ 148.810191] {1}[Hardware Error]: Error 0, type: fatal
[ 148.816088] {1}[Hardware Error]: section_type: PCIe error
[ 148.822391] {1}[Hardware Error]: port_type: 0, PCIe end point
[ 148.829026] {1}[Hardware Error]: version: 3.0
[ 148.834266] {1}[Hardware Error]: command: 0x0006, status: 0x0010
[ 148.841140] {1}[Hardware Error]: device_id: 0000:04:00.0
[ 148.847309] {1}[Hardware Error]: slot: 0
[ 148.852077] {1}[Hardware Error]: secondary_bus: 0x00
[ 148.857876] {1}[Hardware Error]: vendor_id: 0x14e4, device_id: 0x165f
[ 148.865145] {1}[Hardware Error]: class_code: 020000
[ 148.870845] {1}[Hardware Error]: aer_uncor_status: 0x00100000, aer_uncor_mask: 0x00010000
[ 148.879842] {1}[Hardware Error]: aer_uncor_severity: 0x000ef030
[ 148.886575] {1}[Hardware Error]: TLP Header: 40000001 0000030f 90028090 00000000
[ 148.894823] tg3 0000:04:00.0: AER: aer_status: 0x00100000, aer_mask: 0x00010000
[ 148.902795] tg3 0000:04:00.0: AER: [20] UnsupReq (First)
[ 148.910234] tg3 0000:04:00.0: AER: aer_layer=Transaction Layer, aer_agent=Requester ID
[ 148.918806] tg3 0000:04:00.0: AER: aer_uncor_severity: 0x000ef030
[ 148.925558] tg3 0000:04:00.0: AER: TLP Header: 40000001 0000030f 90028090 00000000The MSI is probably raised by incoming packets, so power down the device and disable bus mastering to stop the traffic, as user confirmed this approach works.
In addition to that, be extra safe and cancel reset task if it's running.
--- drivers/net/ethernet/broadcom/tg3.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/net/ethernet/broadcom/tg3.c +6 -2
@@ -18076,16 +18076,20 @@ static void tg3_shutdown(struct pci_dev *pdev)struct net_device *dev =pci_get_drvdata (pdev);struct tg3 *tp =netdev_priv (dev); +tg3_reset_task_cancel (tp); +rtnl_lock (); +netif_device_detach (dev);if (netif_running (dev))dev_close (dev); -if (system_state ==SYSTEM_POWER_OFF ) -tg3_power_down (tp); +tg3_power_down (tp);rtnl_unlock (); + +pci_disable_device (pdev); }/**
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 20/38 r8152: add PID for the Lenovo OneLink+ Dock
In reply to Sasha LevinFrom: Jean-Francois Le Fillatre <[email protected]>
[ Upstream commit 1bd3a383075c64d638e65d263c9267b08ee7733c ]
The Lenovo OneLink+ Dock contains an RTL8153 controller that behaves as a broken CDC device by default. Add the custom Lenovo PID to the r8152 driver to support it properly.
Also, systems compatible with this dock provide a BIOS option to enable MAC address passthrough (as per Lenovo document "ThinkPad Docking Solutions 2017"). Add the custom PID to the MAC passthrough list too.
Tested on a ThinkPad 13 1st gen with the expected results:
passthrough disabled: Invalid header when reading pass-thru MAC addr passthrough enabled: Using pass-thru MAC addr XX:XX:XX:XX:XX:XX
--- drivers/net/usb/cdc_ether.c | 7 +++++++ drivers/net/usb/r8152.c | 3 +++ 2 files changed, 10 insertions(+)
drivers/net/usb/cdc_ether.c +7 -0
@@ -777,6 +777,13 @@ static const struct usb_device_id products[] = { },#endif +/* Lenovo ThinkPad OneLink+ Dock (based on Realtek RTL8153) */ +{ +USB_DEVICE_AND_INTERFACE_INFO (LENOVO_VENDOR_ID ,0x3054 ,USB_CLASS_COMM , + USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE), + .driver_info =0 , +}, + /* ThinkPad USB-C Dock (based on Realtek RTL8153) */ { USB_DEVICE_AND_INTERFACE_INFO(LENOVO_VENDOR_ID, 0x3062, USB_CLASS_COMM,
drivers/net/usb/r8152.c +3 -0
@@ -770,6 +770,7 @@ enum rtl8152_flags { RX_EPROTO, }; +#define DEVICE_ID_THINKPAD_ONELINK_PLUS_DOCK 0x3054#define DEVICE_ID_THINKPAD_THUNDERBOLT3_DOCK_GEN2 0x3082#define DEVICE_ID_THINKPAD_USB_C_DONGLE 0x720c#define DEVICE_ID_THINKPAD_USB_C_DOCK_GEN2 0xa387
@@ -9581,6 +9582,7 @@ static bool rtl8152_supports_lenovo_macpassthru(struct usb_device *udev)if (vendor_id ==VENDOR_ID_LENOVO ) {switch (product_id) { +case DEVICE_ID_THINKPAD_ONELINK_PLUS_DOCK :case DEVICE_ID_THINKPAD_THUNDERBOLT3_DOCK_GEN2 :case DEVICE_ID_THINKPAD_USB_C_DOCK_GEN2 :case DEVICE_ID_THINKPAD_USB_C_DOCK_GEN3 :
@@ -9828,6 +9830,7 @@ static const struct usb_device_id rtl8152_table[] = {REALTEK_USB_DEVICE (VENDOR_ID_MICROSOFT ,0x0927 ),REALTEK_USB_DEVICE (VENDOR_ID_SAMSUNG ,0xa101 ),REALTEK_USB_DEVICE (VENDOR_ID_LENOVO ,0x304f ), +REALTEK_USB_DEVICE (VENDOR_ID_LENOVO ,0x3054 ),REALTEK_USB_DEVICE (VENDOR_ID_LENOVO ,0x3062 ),REALTEK_USB_DEVICE (VENDOR_ID_LENOVO ,0x3069 ), REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x3082),
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 21/38 gpio: mockup: remove gpio debugfs when remove device
In reply to Sasha LevinFrom: Wei Yongjun <[email protected]>
[ Upstream commit 303e6da99429510b1e4edf833afe90ac8542e747 ]
GPIO mockup debugfs is created in gpio_mockup_probe() but forgot to remove when remove device. This patch add a devm managed callback for removing them.
--- drivers/gpio/gpio-mockup.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/gpio/gpio-mockup.c +8 -1
@@ -373,6 +373,13 @@ static void gpio_mockup_debugfs_setup(struct device *dev, } } +static void gpio_mockup_debugfs_cleanup (void *data) +{ +struct gpio_mockup_chip *chip = data; + +debugfs_remove_recursive (chip->dbg_dir); +} +static void gpio_mockup_dispose_mappings (void *data) {struct gpio_mockup_chip *chip = data;
@@ -455,7 +462,7 @@ static int gpio_mockup_probe(struct platform_device *pdev)gpio_mockup_debugfs_setup (dev, chip); -return 0 ; +return devm_add_action_or_reset (dev, gpio_mockup_debugfs_cleanup, chip); }static const struct of_device_id gpio_mockup_of_match[] = {
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 22/38 ieee802154: cc2520: add rc code in cc2520_tx()
In reply to Sasha LevinFrom: Li Qiong <[email protected]>
[ Upstream commit ffd7bdddaab193c38416fd5dd416d065517d266e ]
The rc code is 0 at the error path "status & CC2520_STATUS_TX_UNDERFLOW". Assign rc code with '-EINVAL' at this error path to fix it.
--- drivers/net/ieee802154/cc2520.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ieee802154/cc2520.c +1 -0
@@ -504,6 +504,7 @@ cc2520_tx(struct ieee802154_hw *hw, struct sk_buff *skb) goto err_tx;if (status &CC2520_STATUS_TX_UNDERFLOW ) { + rc = -EINVAL ;dev_err (&priv->spi->dev,"cc2520 tx underflow exception\n" ); goto err_tx; }
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 23/38 Input: iforce - add support for Boeder Force Feedback Wheel
In reply to Sasha LevinFrom: Greg Tulli <[email protected]>
[ Upstream commit 9c9c71168f7979f3798b61c65b4530fbfbcf19d1 ]
Add a new iforce_device entry to support the Boeder Force Feedback Wheel device.
--- Documentation/input/joydev/joystick.rst | 1 + drivers/input/joystick/iforce/iforce-main.c | 1 + 2 files changed, 2 insertions(+)
Documentation/input/joydev/joystick.rst +1 -0
@@ -517,6 +517,7 @@ All I-Force devices are supported by the iforce module. This includes: * AVB Mag Turbo Force * AVB Top Shot Pegasus * AVB Top Shot Force Feedback Racing Wheel +* Boeder Force Feedback Wheel * Logitech WingMan Force * Logitech WingMan Force Wheel * Guillemot Race Leader Force Feedback
drivers/input/joystick/iforce/iforce-main.c +1 -0
@@ -50,6 +50,7 @@ static struct iforce_device iforce_device[] = { { 0x046d, 0xc291, "Logitech WingMan Formula Force", btn_wheel, abs_wheel, ff_iforce }, { 0x05ef, 0x020a, "AVB Top Shot Pegasus", btn_joystick_avb, abs_avb_pegasus, ff_iforce }, { 0x05ef, 0x8884, "AVB Mag Turbo Force", btn_wheel, abs_wheel, ff_iforce }, + { 0x05ef, 0x8886, "Boeder Force Feedback Wheel", btn_wheel, abs_wheel, ff_iforce }, { 0x05ef, 0x8888, "AVB Top Shot Force Feedback Racing Wheel", btn_wheel, abs_wheel, ff_iforce }, //? { 0x061c, 0xc0a4, "ACT LABS Force RS", btn_wheel, abs_wheel, ff_iforce }, //? { 0x061c, 0xc084, "ACT LABS Force RS", btn_wheel, abs_wheel, ff_iforce },
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 24/38 drm/amdgpu: disable FRU access on special SIENNA CICHLID card
In reply to Sasha LevinFrom: Guchun Chen <[email protected]>
[ Upstream commit c8fea9273fd1be308668496badfcbd55183e0dd3 ]
Below driver load error will be printed, not friendly to end user.
amdgpu: ATOM BIOS: 113-D603GLXE-077
[drm] FRU: Failed to get size field
[drm:amdgpu_fru_get_product_info [amdgpu]] *ERROR* Failed to read FRU Manufacturer, ret:-5
--- drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_fru_eeprom.c +7 -2
@@ -66,10 +66,15 @@ static bool is_fru_eeprom_supported(struct amdgpu_device *adev)return true;case CHIP_SIENNA_CICHLID :if (strnstr (atom_ctx->vbios_version,"D603" , +sizeof (atom_ctx->vbios_version))) { +if (strnstr (atom_ctx->vbios_version,"D603GLXE" ,sizeof (atom_ctx->vbios_version))) -return true; -else +return false; +else +return true; + }else {return false; + }default :return false; }
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 25/38 drm/amd/pm: use vbios carried pptable for all SMU13.0.7 SKUs
In reply to Sasha LevinFrom: Evan Quan <[email protected]>
[ Upstream commit b023053592646b1da9477b0b598f2cdd5d3f89d8 ]
For those SMU13.0.7 unsecure SKUs, the vbios carried pptable is ready to go. Use that one instead of hardcoded softpptable.
--- .../drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c | 35 ++++++++++++------- 1 file changed, 22 insertions(+), 13 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c +22 -13
@@ -382,11 +382,27 @@ static int smu_v13_0_7_append_powerplay_table(struct smu_context *smu)return 0 ; } +static int smu_v13_0_7_get_pptable_from_pmfw (struct smu_context *smu, +void **table, +uint32_t *size) +{ +struct smu_table_context *smu_table = &smu->smu_table; +void *combo_pptable = smu_table->combo_pptable; +int ret =0 ; + + ret =smu_cmn_get_combo_pptable (smu); +if (ret) +return ret; + + *table = combo_pptable; + *size =sizeof (struct smu_13_0_7_powerplay_table ); + +return 0 ; +}static int smu_v13_0_7_setup_pptable (struct smu_context *smu) {struct smu_table_context *smu_table = &smu->smu_table; -void *combo_pptable = smu_table->combo_pptable;struct amdgpu_device *adev = smu->adev;int ret =0 ;
@@ -395,18 +411,11 @@ static int smu_v13_0_7_setup_pptable(struct smu_context *smu)* be used directly by driver. To get the raw pptable, we need to * rely on the combo pptable(and its revelant SMU message). */ -if (adev->scpm_enabled) { - ret =smu_cmn_get_combo_pptable (smu); -if (ret) -return ret; - - smu->smu_table.power_play_table = combo_pptable; - smu->smu_table.power_play_table_size =sizeof (struct smu_13_0_7_powerplay_table ); - }else { - ret =smu_v13_0_setup_pptable (smu); -if (ret) -return ret; - } + ret =smu_v13_0_7_get_pptable_from_pmfw (smu, + &smu_table->power_play_table, + &smu_table->power_play_table_size); +if (ret) +return ret; ret =smu_v13_0_7_store_powerplay_table (smu);if (ret)
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 26/38 nvme-pci: add NVME_QUIRK_BOGUS_NID for Lexar NM610
In reply to Sasha LevinFrom: Shyamin Ayesh <[email protected]>
[ Upstream commit 200dccd07df21b504a2168960059f0a971bf415d ]
Lexar NM610 reports bogus eui64 values that appear to be the same across all drives. Quirk them out so they are not marked as "non globally unique" duplicates.
--- drivers/nvme/host/pci.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/nvme/host/pci.c +2 -0
@@ -3517,6 +3517,8 @@ static const struct pci_device_id nvme_id_table[] = { .driver_data = NVME_QUIRK_NO_DEEPEST_PS, }, { PCI_DEVICE(0xc0a9, 0x540a), /* Crucial P2 */ .driver_data = NVME_QUIRK_BOGUS_NID, }, + { PCI_DEVICE(0x1d97, 0x2263), /* Lexar NM610 */ + .driver_data = NVME_QUIRK_BOGUS_NID, }, { PCI_DEVICE(PCI_VENDOR_ID_AMAZON, 0x0061), .driver_data = NVME_QUIRK_DMA_ADDRESS_BITS_48, }, { PCI_DEVICE(PCI_VENDOR_ID_AMAZON, 0x0065),
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 27/38 nvmet-tcp: fix unhandled tcp states in nvmet_tcp_state_change()
In reply to Sasha LevinFrom: Maurizio Lombardi <[email protected]>
[ Upstream commit 478814a5584197fa1fb18377653626e3416e7cd6 ]
TCP_FIN_WAIT2 and TCP_LAST_ACK were not handled, the connection is closing so we can ignore them and avoid printing the "unhandled state" warning message.
[ 1298.852386] nvmet_tcp: queue 2 unhandled state 5 [ 1298.879112] nvmet_tcp: queue 7 unhandled state 5 [ 1298.884253] nvmet_tcp: queue 8 unhandled state 5 [ 1298.889475] nvmet_tcp: queue 9 unhandled state 5
v2: Do not call nvmet_tcp_schedule_release_queue(), just ignore the fin_wait2 and last_ack states.
--- drivers/nvme/target/tcp.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/nvme/target/tcp.c +3 -0
@@ -1506,6 +1506,9 @@ static void nvmet_tcp_state_change(struct sock *sk) goto done;switch (sk->sk_state) { +case TCP_FIN_WAIT2 : +case TCP_LAST_ACK : +break ;case TCP_FIN_WAIT1 :case TCP_CLOSE_WAIT :case TCP_CLOSE :
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 28/38 drm/amd/amdgpu: skip ucode loading if ucode_size == 0
In reply to Sasha LevinFrom: Chengming Gui <[email protected]>
[ Upstream commit 39c84b8e929dbd4f63be7e04bf1a2bcd92b44177 ]
Restrict the ucode loading check to avoid frontdoor loading error.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +1 -1
@@ -2372,7 +2372,7 @@ static int psp_load_smu_fw(struct psp_context *psp)static bool fw_load_skip_check (struct psp_context *psp,struct amdgpu_firmware_info *ucode) { -if (!ucode->fw) +if (!ucode->fw || !ucode->ucode_size)return true; if (ucode->ucode_id == AMDGPU_UCODE_ID_SMC &&
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 29/38 net: dsa: hellcreek: Print warning only once
In reply to Sasha LevinFrom: Kurt Kanzenbach <[email protected]>
[ Upstream commit 52267ce25f60f37ae40ccbca0b21328ebae5ae75 ]
In case the source port cannot be decoded, print the warning only once. This still brings attention to the user and does not spam the logs at the same time.
--- net/dsa/tag_hellcreek.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/dsa/tag_hellcreek.c +1 -1
@@ -45,7 +45,7 @@ static struct sk_buff *hellcreek_rcv(struct sk_buff *skb, skb->dev =dsa_master_find_slave (dev,0 , port);if (!skb->dev) { -netdev_warn (dev,"Failed to get source port: %d\n" , port); +netdev_warn_once (dev,"Failed to get source port: %d\n" , port);return NULL ; }
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 30/38 perf/arm_pmu_platform: fix tests for platform_get_irq() failure
In reply to Sasha LevinFrom: Yu Zhe <[email protected]>
[ Upstream commit 6bb0d64c100091e131cd16710b62fda3319cd0af ]
The platform_get_irq() returns negative error codes. It can't actually return zero.
--- drivers/perf/arm_pmu_platform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/perf/arm_pmu_platform.c +1 -1
@@ -117,7 +117,7 @@ static int pmu_parse_irqs(struct arm_pmu *pmu)if (num_irqs ==1 ) {int irq =platform_get_irq (pdev,0 ); -if (irq &&irq_is_percpu_devid (irq)) +if ((irq >0 ) &&irq_is_percpu_devid (irq))return pmu_parse_percpu_irq (pmu, irq); }
Signature · 7 lines
2.35.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Sasha Levin
maintainerPATCH 31/38 platform/x86: acer-wmi: Acer Aspire One AOD270/Packard Bell Dot keymap fixes
In reply to Sasha LevinFrom: Hans de Goede <[email protected]>
[ Upstream commit c3b82d26bc85f5fc2fef5ec8cce17c89633a55a8 ]
2 keymap fixes for the Acer Aspire One AOD270 and the same hardware rebranded as Packard Bell Dot SC:
1. The F2 key is marked with a big '?' symbol on the Packard Bell Dot SC, this sends WMID_HOTKEY_EVENTs with a scancode of 0x27 add a mapping for this.
2. Scancode 0x61 is KEY_SWITCHVIDEOMODE. Usually this is a duplicate input event with the "Video Bus" input device events. But on these devices the "Video Bus" does not send events for this key. Map 0x61 to KEY_UNKNOWN instead of using KE_IGNORE so that udev/hwdb can override it on these devs.
--- drivers/platform/x86/acer-wmi.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/platform/x86/acer-wmi.c +8 -1
@@ -99,6 +99,7 @@ static const struct key_entry acer_wmi_keymap[] __initconst = { {KE_KEY, 0x22, {KEY_PROG2} }, /* Arcade */ {KE_KEY, 0x23, {KEY_PROG3} }, /* P_Key */ {KE_KEY, 0x24, {KEY_PROG4} }, /* Social networking_Key */ + {KE_KEY, 0x27, {KEY_HELP} }, {KE_KEY, 0x29, {KEY_PROG3} }, /* P_Key for TM8372 */ {KE_IGNORE, 0x41, {KEY_MUTE} }, {KE_IGNORE, 0x42, {KEY_PREVIOUSSONG} },
@@ -112,7 +113,13 @@ static const struct key_entry acer_wmi_keymap[] __initconst = { {KE_IGNORE, 0x48, {KEY_VOLUMEUP} }, {KE_IGNORE, 0x49, {KEY_VOLUMEDOWN} }, {KE_IGNORE, 0x4a, {KEY_VOLUMEDOWN} }, - {KE_IGNORE, 0x61, {KEY_SWITCHVIDEOMODE} }, +/* +* 0x61 is KEY_SWITCHVIDEOMODE. Usually this is a duplicate input event +* with the "Video Bus" input device events. But sometimes it is not +* a dup. Map it to KEY_UNKNOWN instead of using KE_IGNORE so that +* udev/hwdb can override it on systems where it is not a dup. +*/ + {KE_KEY, 0x61, {KEY_UNKNOWN} }, {KE_IGNORE, 0x62, {KEY_BRIGHTNESSUP} }, {KE_IGNORE, 0x63, {KEY_BRIGHTNESSDOWN} }, {KE_KEY, 0x64, {KEY_SWITCHVIDEOMODE} }, /* Display Switch */
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 32/38 usb: storage: Add ASUS <0x0b05:0x1932> to IGNORE_UAS
In reply to Sasha LevinFrom: Hu Xiaoying <[email protected]>
[ Upstream commit c61feaee68b9735be06f162bc046c7f1959efb0c ]
USB external storage device(0x0b05:1932), use gnome-disk-utility tools to test usb write < 30MB/s.
if does not to load module of uas for this device, can increase the write speed from 20MB/s to >40MB/s.
--- drivers/usb/storage/unusual_uas.h | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/usb/storage/unusual_uas.h +7 -0
@@ -62,6 +62,13 @@ UNUSUAL_DEV(0x0984, 0x0301, 0x0128, 0x0128, USB_SC_DEVICE, USB_PR_DEVICE, NULL, US_FL_IGNORE_UAS), +/* Reported-by: Tom Hu <[email protected]> */ +UNUSUAL_DEV (0x0b05 ,0x1932 ,0x0000 ,0x9999 , +"ASUS" , +"External HDD" , +USB_SC_DEVICE ,USB_PR_DEVICE ,NULL , +US_FL_IGNORE_UAS ), +/* Reported-by: David Webb <[email protected]> */ UNUSUAL_DEV(0x0bc2, 0x331a, 0x0000, 0x9999, "Seagate",
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 33/38 misc: fastrpc: increase maximum session count
In reply to Sasha LevinFrom: Johan Hovold <[email protected]>
[ Upstream commit 689a2d9f9332a27b1379ef230396e944f949a72b ]
The SC8280XP platform uses 14 sessions for the compute DSP so increment the maximum session count.
--- drivers/misc/fastrpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/misc/fastrpc.c +1 -1
@@ -25,7 +25,7 @@#define SDSP_DOMAIN_ID (2)#define CDSP_DOMAIN_ID (3)#define FASTRPC_DEV_MAX 4/* adsp, mdsp, slpi, cdsp*/ -#define FASTRPC_MAX_SESSIONS 13/*12 compute, 1 cpz*/ +#define FASTRPC_MAX_SESSIONS 14#define FASTRPC_MAX_VMIDS 16#define FASTRPC_ALIGN 128#define FASTRPC_MAX_FDLIST 16
Signature · 1 line
2.35.1
Re: [PATCH AUTOSEL 5.19 33/38] misc: fastrpc: increase maximum session count
Quoted 11 lines · Sasha Levin
From: Johan Hovold <[email protected]>
[ Upstream commit
689a2d9f9332a27b1379ef230396e944f949a72b]The SC8280XP platform uses 14 sessions for the compute DSP so increment the maximum session count.
Signed-off-by Johan Hovold <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>Signed-off-by Sasha Levin <[email protected]>
SC8280XP was not added until 6.0 so the stable tag was left out on purpose (as usual).
Please drop.
Quoted 9 lines
--- drivers/misc/fastrpc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/misc/fastrpc.c +0
-0
drivers/misc/fastrpc.c line 31
Quoted 8 lines
drivers/misc/fastrpc.c +1
-1@@ -25,7 +25,7 @@#define SDSP_DOMAIN_ID (2)#define CDSP_DOMAIN_ID (3)#define FASTRPC_DEV_MAX 4/* adsp, mdsp, slpi, cdsp*/ -#define FASTRPC_MAX_SESSIONS 13/*12 compute, 1 cpz*/ +#define FASTRPC_MAX_SESSIONS 14#define FASTRPC_MAX_VMIDS 16#define FASTRPC_ALIGN 128#define FASTRPC_MAX_FDLIST 16
Johan
Sasha Levin
maintainerRe: [PATCH AUTOSEL 5.19 33/38] misc: fastrpc: increase maximum session count
Quoted 13 lines · Johan Hovold
Quoted 11 lines · Sasha Levin
From: Johan Hovold <[email protected]>
[ Upstream commit
689a2d9f9332a27b1379ef230396e944f949a72b]The SC8280XP platform uses 14 sessions for the compute DSP so increment the maximum session count.
Signed-off-by Johan Hovold <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>Signed-off-by Sasha Levin <[email protected]>
Quoted 4 lines
SC8280XP was not added until 6.0 so the stable tag was left out on purpose (as usual).
Please drop.
Will do, thanks!
Signature · 2 lines
Thanks, Sasha
Sasha Levin
maintainerPATCH 34/38 platform/x86: asus-wmi: Increase FAN_CURVE_BUF_LEN to 32
In reply to Sasha LevinFrom: "Luke D. Jones" <[email protected]>
[ Upstream commit 5542dfc582f4a925f67bbfaf8f62ca83506032ae ]
Fix for TUF laptops returning with an -ENOSPC on calling asus_wmi_evaluate_method_buf() when fetching default curves. The TUF method requires at least 32 bytes space.
This also moves and changes the pr_debug() in fan_curve_check_present() to pr_warn() in fan_curve_get_factory_default() so that there is at least some indication in logs of why it fails.
--- drivers/platform/x86/asus-wmi.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/platform/x86/asus-wmi.c +4 -5
@@ -107,7 +107,7 @@ module_param(fnlock_default, bool, 0444);#define WMI_EVENT_MASK 0xFFFF#define FAN_CURVE_POINTS 8 -#define FAN_CURVE_BUF_LEN (FAN_CURVE_POINTS * 2) +#define FAN_CURVE_BUF_LEN 32#define FAN_CURVE_DEV_CPU 0x00#define FAN_CURVE_DEV_GPU 0x01/* Mask to determine if setting temperature or percentage */
@@ -2208,8 +2208,10 @@ static int fan_curve_get_factory_default(struct asus_wmi *asus, u32 fan_dev) curves = &asus->custom_fan_curves[fan_idx]; err =asus_wmi_evaluate_method_buf (asus->dsts_id, fan_dev, mode, buf,FAN_CURVE_BUF_LEN ); -if (err) +if (err) { +pr_warn ("%s (0x%08x) failed: %d\n" , __func__, fan_dev, err);return err; + }fan_curve_copy_from_buf (curves, buf); curves->device_id = fan_dev;
@@ -2227,9 +2229,6 @@ static int fan_curve_check_present(struct asus_wmi *asus, bool *available, err =fan_curve_get_factory_default (asus, fan_dev);if (err) { -pr_debug ("fan_curve_get_factory_default(0x%08x) failed: %d\n" , - fan_dev, err); -/* Don't cause probe to fail on devices without fan-curves */ return 0 ; }
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 35/38 LoongArch: Fix section mismatch due to acpi_os_ioremap()
In reply to Sasha LevinFrom: Huacai Chen <[email protected]>
[ Upstream commit e0fba87c854347007fb9fc873e890b686cc61302 ]
Now acpi_os_ioremap() is marked with __init because it calls memblock_ is_memory() which is also marked with __init in the !ARCH_KEEP_MEMBLOCK case. However, acpi_os_ioremap() is called by ordinary functions such as acpi_os_{read, write}_memory() and causes section mismatch warnings:
WARNING: modpost: vmlinux.o: section mismatch in reference: acpi_os_read_memory (section: .text) -> acpi_os_ioremap (section: .init.text)
WARNING: modpost: vmlinux.o: section mismatch in reference: acpi_os_write_memory (section: .text) -> acpi_os_ioremap (section: .init.text)
Fix these warnings by selecting ARCH_KEEP_MEMBLOCK unconditionally and removing the __init modifier of acpi_os_ioremap(). This can also give a chance to track "memory" and "reserved" memblocks after early boot.
--- arch/loongarch/Kconfig | 1 + arch/loongarch/include/asm/acpi.h | 2 +- arch/loongarch/kernel/acpi.c | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-)
arch/loongarch/Kconfig +1 -0
@@ -36,6 +36,7 @@ config LOONGARCH select ARCH_INLINE_SPIN_UNLOCK_BH if !PREEMPTION select ARCH_INLINE_SPIN_UNLOCK_IRQ if !PREEMPTION select ARCH_INLINE_SPIN_UNLOCK_IRQRESTORE if !PREEMPTION + select ARCH_KEEP_MEMBLOCK select ARCH_MIGHT_HAVE_PC_PARPORT select ARCH_MIGHT_HAVE_PC_SERIO select ARCH_SPARSEMEM_ENABLE
arch/loongarch/include/asm/acpi.h +1 -1
@@ -15,7 +15,7 @@ extern int acpi_pci_disabled;extern int acpi_noirq;#define acpi_os_ioremap acpi_os_ioremap -void __init __iomem *acpi_os_ioremap (acpi_physical_address phys,acpi_size size); +void __iomem *acpi_os_ioremap (acpi_physical_address phys,acpi_size size);static inline void disable_acpi (void ) {
arch/loongarch/kernel/acpi.c +1 -1
@@ -113,7 +113,7 @@ void __init __acpi_unmap_table(void __iomem *map, unsigned long size)early_memunmap (map, size); } -void __init __iomem *acpi_os_ioremap (acpi_physical_address phys,acpi_size size) +void __iomem *acpi_os_ioremap (acpi_physical_address phys,acpi_size size) {if (!memblock_is_memory (phys))return ioremap (phys, size);
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 36/38 LoongArch: Fix arch_remove_memory() undefined build error
In reply to Sasha LevinFrom: Yupeng Li <[email protected]>
[ Upstream commit 1a470ce4e9106cc4c3c0edfb2e213dcbb7224dc4 ]
The kernel build error when unslected CONFIG_MEMORY_HOTREMOVE because arch_remove_memory() is needed by mm/memory_hotplug.c but undefined.
Some build error messages like:
LD vmlinux.o
MODPOST vmlinux.symvers
MODINFO modules.builtin.modinfo
GEN modules.builtin
LD .tmp_vmlinux.kallsyms1
loongarch64-linux-gnu-ld: mm/memory_hotplug.o: in function `.L242':
memory_hotplug.c:(.ref.text+0x930): undefined reference to `arch_remove_memory'
make: *** [Makefile:1169:vmlinux] 错误 1
Removed CONFIG_MEMORY_HOTREMOVE requirement and rearrange the file refer to the definitions of other platform architectures.
--- arch/loongarch/mm/init.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-)
arch/loongarch/mm/init.c +10 -12
@@ -131,18 +131,6 @@ int arch_add_memory(int nid, u64 start, u64 size, struct mhp_params *params)return ret; } -#ifdef CONFIG_NUMA -int memory_add_physaddr_to_nid (u64 start) -{ -int nid; - - nid =pa_to_nid (start); -return nid; -} -EXPORT_SYMBOL_GPL (memory_add_physaddr_to_nid); -#endif - -#ifdef CONFIG_MEMORY_HOTREMOVE void arch_remove_memory (u64 start,u64 size,struct vmem_altmap *altmap) {unsigned long start_pfn = start >>PAGE_SHIFT ;
@@ -154,6 +142,16 @@ void arch_remove_memory(u64 start, u64 size, struct vmem_altmap *altmap) page +=vmem_altmap_offset (altmap); __remove_pages(start_pfn, nr_pages, altmap); } + +#ifdef CONFIG_NUMA +int memory_add_physaddr_to_nid (u64 start) +{ +int nid; + + nid =pa_to_nid (start); +return nid; +} +EXPORT_SYMBOL_GPL (memory_add_physaddr_to_nid);#endif #endif
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 37/38 gpio: 104-dio-48e: Make irq_chip immutable
In reply to Sasha LevinFrom: William Breathitt Gray <[email protected]>
[ Upstream commit 35f0aa7727b092520bf91374768a4fdafd4a4fe3 ]
Kernel warns about mutable irq_chips:
"not an immutable chip, please consider fixing!"
Make the struct irq_chip const, flag it as IRQCHIP_IMMUTABLE, add the new helper functions, and call the appropriate gpiolib functions.
--- drivers/gpio/gpio-104-dio-48e.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/gpio/gpio-104-dio-48e.c +7 -3
@@ -271,6 +271,7 @@ static void dio48e_irq_mask(struct irq_data *data) dio48egpio->irq_mask &= ~BIT (0 ); else dio48egpio->irq_mask &= ~BIT(1); +gpiochip_disable_irq (chip, offset);if (!dio48egpio->irq_mask)/* disable interrupts */
@@ -298,6 +299,7 @@ static void dio48e_irq_unmask(struct irq_data *data)iowrite8 (0x00 , dio48egpio->base +0xB ); } +gpiochip_enable_irq (chip, offset);if (offset ==19 ) dio48egpio->irq_mask |=BIT (0 );else
@@ -320,12 +322,14 @@ static int dio48e_irq_set_type(struct irq_data *data, unsigned int flow_type)return 0 ; } -static struct irq_chip dio48e_irqchip = { +static const struct irq_chip dio48e_irqchip = { .name ="104-dio-48e" , .irq_ack = dio48e_irq_ack, .irq_mask = dio48e_irq_mask, .irq_unmask = dio48e_irq_unmask, - .irq_set_type = dio48e_irq_set_type + .irq_set_type = dio48e_irq_set_type, + .flags =IRQCHIP_IMMUTABLE , +GPIOCHIP_IRQ_RESOURCE_HELPERS , };static irqreturn_t dio48e_irq_handler (int irq,void *dev_id)
@@ -414,7 +418,7 @@ static int dio48e_probe(struct device *dev, unsigned int id) dio48egpio->chip.set_multiple = dio48e_gpio_set_multiple; girq = &dio48egpio->chip.irq; - girq->chip = &dio48e_irqchip; +gpio_irq_chip_set_chip (girq, &dio48e_irqchip);/* This will let us handle the parent IRQ in the driver */ girq->parent_handler =NULL ; girq->num_parents =0 ;
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 38/38 gpio: 104-idio-16: Make irq_chip immutable
In reply to Sasha LevinFrom: William Breathitt Gray <[email protected]>
[ Upstream commit 410a5041aa60d91ff66a861560e7c879d664270f ]
Kernel warns about mutable irq_chips:
"not an immutable chip, please consider fixing!"
Make the struct irq_chip const, flag it as IRQCHIP_IMMUTABLE, add the new helper functions, and call the appropriate gpiolib functions.
--- drivers/gpio/gpio-104-idio-16.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-)
drivers/gpio/gpio-104-idio-16.c +11 -7
@@ -150,10 +150,11 @@ static void idio_16_irq_mask(struct irq_data *data) {struct gpio_chip *chip =irq_data_get_irq_chip_data (data);struct idio_16_gpio *const idio16gpio =gpiochip_get_data (chip); -const unsigned long mask =BIT (irqd_to_hwirq (data)); +const unsigned long offset =irqd_to_hwirq (data);unsigned long flags; - idio16gpio->irq_mask &= ~mask; + idio16gpio->irq_mask &= ~BIT (offset); +gpiochip_disable_irq (chip, offset);if (!idio16gpio->irq_mask) {raw_spin_lock_irqsave (&idio16gpio->lock, flags);
@@ -168,11 +169,12 @@ static void idio_16_irq_unmask(struct irq_data *data) {struct gpio_chip *chip =irq_data_get_irq_chip_data (data);struct idio_16_gpio *const idio16gpio =gpiochip_get_data (chip); -const unsigned long mask =BIT (irqd_to_hwirq (data)); +const unsigned long offset =irqd_to_hwirq (data);const unsigned long prev_irq_mask = idio16gpio->irq_mask;unsigned long flags; - idio16gpio->irq_mask |= mask; +gpiochip_enable_irq (chip, offset); + idio16gpio->irq_mask |=BIT (offset);if (!prev_irq_mask) {raw_spin_lock_irqsave (&idio16gpio->lock, flags);
@@ -193,12 +195,14 @@ static int idio_16_irq_set_type(struct irq_data *data, unsigned int flow_type)return 0 ; } -static struct irq_chip idio_16_irqchip = { +static const struct irq_chip idio_16_irqchip = { .name ="104-idio-16" , .irq_ack = idio_16_irq_ack, .irq_mask = idio_16_irq_mask, .irq_unmask = idio_16_irq_unmask, - .irq_set_type = idio_16_irq_set_type + .irq_set_type = idio_16_irq_set_type, + .flags =IRQCHIP_IMMUTABLE , +GPIOCHIP_IRQ_RESOURCE_HELPERS , };static irqreturn_t idio_16_irq_handler (int irq,void *dev_id)
@@ -275,7 +279,7 @@ static int idio_16_probe(struct device *dev, unsigned int id) idio16gpio->out_state =0xFFFF ; girq = &idio16gpio->chip.irq; - girq->chip = &idio_16_irqchip; +gpio_irq_chip_set_chip (girq, &idio_16_irqchip);/* This will let us handle the parent IRQ in the driver */ girq->parent_handler =NULL ; girq->num_parents =0 ;
Signature · 1 line
2.35.1