···4454450x1008 0x07 FN+F8 IBM: toggle screen expand446446 Lenovo: configure UltraNav,447447 or toggle screen expand.448448- On newer platforms (2024+)449449- replaced by 0x131f (see below)448448+ On 2024 platforms replaced by449449+ 0x131f (see below) and on newer450450+ platforms (2025 +) keycode is451451+ replaced by 0x1401 (see below).4504524514530x1009 0x08 FN+F9 -452454···5085065095070x1019 0x18 unknown510508511511-0x131f ... FN+F8 Platform Mode change.509509+0x131f ... FN+F8 Platform Mode change (2024 systems).512510 Implemented in driver.513511512512+0x1401 ... FN+F8 Platform Mode change (2025 + systems).513513+ Implemented in driver.514514... ... ...5155155165160x1020 0x1F unknown
+1-1
Documentation/admin-guide/mm/transhuge.rst
···436436The number of file transparent huge pages mapped to userspace is available437437by reading ShmemPmdMapped and ShmemHugePages fields in ``/proc/meminfo``.438438To identify what applications are mapping file transparent huge pages, it439439-is necessary to read ``/proc/PID/smaps`` and count the FileHugeMapped fields439439+is necessary to read ``/proc/PID/smaps`` and count the FilePmdMapped fields440440for each mapping.441441442442Note that reading the smaps file is expensive and reading it
···8181 List of phandles, each pointing to the power supply for the8282 corresponding pairset named in 'pairset-names'. This property8383 aligns with IEEE 802.3-2022, Section 33.2.3 and 145.2.4.8484- PSE Pinout Alternatives (as per IEEE 802.3-2022 Table 145\u20133)8484+ PSE Pinout Alternatives (as per IEEE 802.3-2022 Table 145-3)8585 |-----------|---------------|---------------|---------------|---------------|8686 | Conductor | Alternative A | Alternative A | Alternative B | Alternative B |8787 | | (MDI-X) | (MDI) | (X) | (S) |
···5151 description: Power supply for AVDD, providing 1.8V.52525353 cpvdd-supply:5454- description: Power supply for CPVDD, providing 3.5V.5454+ description: Power supply for CPVDD, providing 1.8V.55555656 hp-detect-gpios:5757 description:
+31-29
Documentation/netlink/specs/mptcp_pm.yaml
···2222 doc: unused event2323 -2424 name: created2525- doc:2626- token, family, saddr4 | saddr6, daddr4 | daddr6, sport, dport2525+ doc: >-2726 A new MPTCP connection has been created. It is the good time to2827 allocate memory and send ADD_ADDR if needed. Depending on the2928 traffic-patterns it can take a long time until the3029 MPTCP_EVENT_ESTABLISHED is sent.3030+ Attributes: token, family, saddr4 | saddr6, daddr4 | daddr6, sport,3131+ dport, server-side.3132 -3233 name: established3333- doc:3434- token, family, saddr4 | saddr6, daddr4 | daddr6, sport, dport3434+ doc: >-3535 A MPTCP connection is established (can start new subflows).3636+ Attributes: token, family, saddr4 | saddr6, daddr4 | daddr6, sport,3737+ dport, server-side.3638 -3739 name: closed3838- doc:3939- token4040+ doc: >-4041 A MPTCP connection has stopped.4242+ Attribute: token.4143 -4244 name: announced4345 value: 64444- doc:4545- token, rem_id, family, daddr4 | daddr6 [, dport]4646+ doc: >-4647 A new address has been announced by the peer.4848+ Attributes: token, rem_id, family, daddr4 | daddr6 [, dport].4749 -4850 name: removed4949- doc:5050- token, rem_id5151+ doc: >-5152 An address has been lost by the peer.5353+ Attributes: token, rem_id.5254 -5355 name: sub-established5456 value: 105555- doc:5656- token, family, loc_id, rem_id, saddr4 | saddr6, daddr4 | daddr6, sport,5757- dport, backup, if_idx [, error]5757+ doc: >-5858 A new subflow has been established. 'error' should not be set.5959+ Attributes: token, family, loc_id, rem_id, saddr4 | saddr6, daddr4 |6060+ daddr6, sport, dport, backup, if_idx [, error].5961 -6062 name: sub-closed6161- doc:6262- token, family, loc_id, rem_id, saddr4 | saddr6, daddr4 | daddr6, sport,6363- dport, backup, if_idx [, error]6363+ doc: >-6464 A subflow has been closed. An error (copy of sk_err) could be set if an6565 error has been detected for this subflow.6666+ Attributes: token, family, loc_id, rem_id, saddr4 | saddr6, daddr4 |6767+ daddr6, sport, dport, backup, if_idx [, error].6668 -6769 name: sub-priority6870 value: 136969- doc:7070- token, family, loc_id, rem_id, saddr4 | saddr6, daddr4 | daddr6, sport,7171- dport, backup, if_idx [, error]7171+ doc: >-7272 The priority of a subflow has changed. 'error' should not be set.7373+ Attributes: token, family, loc_id, rem_id, saddr4 | saddr6, daddr4 |7474+ daddr6, sport, dport, backup, if_idx [, error].7375 -7476 name: listener-created7577 value: 157676- doc:7777- family, sport, saddr4 | saddr67878+ doc: >-7879 A new PM listener is created.8080+ Attributes: family, sport, saddr4 | saddr6.7981 -8082 name: listener-closed8181- doc:8282- family, sport, saddr4 | saddr68383+ doc: >-8384 A PM listener is closed.8585+ Attributes: family, sport, saddr4 | saddr6.84868587attribute-sets:8688 -···308306 attributes:309307 - addr310308 -311311- name: flush-addrs312312- doc: flush addresses309309+ name: flush-addrs310310+ doc: Flush addresses313311 attribute-set: endpoint314312 dont-validate: [ strict ]315313 flags: [ uns-admin-perm ]···353351 - addr-remote354352 -355353 name: announce356356- doc: announce new sf354354+ doc: Announce new address357355 attribute-set: attr358356 dont-validate: [ strict ]359357 flags: [ uns-admin-perm ]···364362 - token365363 -366364 name: remove367367- doc: announce removal365365+ doc: Announce removal368366 attribute-set: attr369367 dont-validate: [ strict ]370368 flags: [ uns-admin-perm ]···375373 - loc-id376374 -377375 name: subflow-create378378- doc: todo376376+ doc: Create subflow379377 attribute-set: attr380378 dont-validate: [ strict ]381379 flags: [ uns-admin-perm ]···387385 - addr-remote388386 -389387 name: subflow-destroy390390- doc: todo388388+ doc: Destroy subflow391389 attribute-set: attr392390 dont-validate: [ strict ]393391 flags: [ uns-admin-perm ]
+3
Documentation/virt/kvm/api.rst
···19141914 #define KVM_IRQ_ROUTING_HV_SINT 419151915 #define KVM_IRQ_ROUTING_XEN_EVTCHN 51916191619171917+On s390, adding a KVM_IRQ_ROUTING_S390_ADAPTER is rejected on ucontrol VMs with19181918+error -EINVAL.19191919+19171920flags:1918192119191922- KVM_MSI_VALID_DEVID: used along with KVM_IRQ_ROUTING_MSI routing entry
+4
Documentation/virt/kvm/devices/s390_flic.rst
···5858 Enables async page faults for the guest. So in case of a major page fault5959 the host is allowed to handle this async and continues the guest.60606161+ -EINVAL is returned when called on the FLIC of a ucontrol VM.6262+6163 KVM_DEV_FLIC_APF_DISABLE_WAIT6264 Disables async page faults for the guest and waits until already pending6365 async page faults are done. This is necessary to trigger a completion interrupt6466 for every init interrupt before migrating the interrupt list.6767+6868+ -EINVAL is returned when called on the FLIC of a ucontrol VM.65696670 KVM_DEV_FLIC_ADAPTER_REGISTER6771 Register an I/O adapter interrupt source. Takes a kvm_s390_io_adapter
+12-19
MAINTAINERS
···949949M: Shay Agroskin <shayagr@amazon.com>950950M: Arthur Kiyanovski <akiyano@amazon.com>951951R: David Arinzon <darinzon@amazon.com>952952-R: Noam Dagan <ndagan@amazon.com>953952R: Saeed Bishara <saeedb@amazon.com>954953L: netdev@vger.kernel.org955954S: Supported···1796179717971798ARM AND ARM64 SoC SUB-ARCHITECTURES (COMMON PARTS)17981799M: Arnd Bergmann <arnd@arndb.de>17991799-M: Olof Johansson <olof@lixom.net>18001800L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)18011801L: soc@lists.linux.dev18021802S: Maintained···26892691N: atmel2690269226912693ARM/Microchip Sparx5 SoC support26922692-M: Lars Povlsen <lars.povlsen@microchip.com>26932694M: Steen Hegelund <Steen.Hegelund@microchip.com>26942695M: Daniel Machon <daniel.machon@microchip.com>26952696M: UNGLinuxDriver@microchip.com···3605360836063609ATHEROS ATH GENERIC UTILITIES36073610M: Kalle Valo <kvalo@kernel.org>36113611+M: Jeff Johnson <jjohnson@kernel.org>36083612L: linux-wireless@vger.kernel.org36093613S: Supported36103614F: drivers/net/wireless/ath/*···4056405840574059BONDING DRIVER40584060M: Jay Vosburgh <jv@jvosburgh.net>40594059-M: Andy Gospodarek <andy@greyhouse.net>40604061L: netdev@vger.kernel.org40614062S: Maintained40624063F: Documentation/networking/bonding.rst···41284131F: drivers/net/ethernet/netronome/nfp/bpf/4129413241304133BPF JIT for POWERPC (32-BIT AND 64-BIT)41314131-M: Michael Ellerman <mpe@ellerman.id.au>41324134M: Hari Bathini <hbathini@linux.ibm.com>41334135M: Christophe Leroy <christophe.leroy@csgroup.eu>41344136R: Naveen N Rao <naveen@kernel.org>···1263812642F: arch/mips/kvm/12639126431264012644KERNEL VIRTUAL MACHINE FOR POWERPC (KVM/powerpc)1264112641-M: Michael Ellerman <mpe@ellerman.id.au>1264512645+M: Madhavan Srinivasan <maddy@linux.ibm.com>1264212646R: Nicholas Piggin <npiggin@gmail.com>1264312647L: linuxppc-dev@lists.ozlabs.org1264412648L: kvm@vger.kernel.org···1321713221X: drivers/macintosh/via-macii.c13218132221321913223LINUX FOR POWERPC (32-BIT AND 64-BIT)1322413224+M: Madhavan Srinivasan <maddy@linux.ibm.com>1322013225M: Michael Ellerman <mpe@ellerman.id.au>1322113226R: Nicholas Piggin <npiggin@gmail.com>1322213227R: Christophe Leroy <christophe.leroy@csgroup.eu>1322313228R: Naveen N Rao <naveen@kernel.org>1322413224-M: Madhavan Srinivasan <maddy@linux.ibm.com>1322513229L: linuxppc-dev@lists.ozlabs.org1322613230S: Supported1322713231W: https://github.com/linuxppc/wiki/wiki···1457214576MEDIATEK ETHERNET DRIVER1457314577M: Felix Fietkau <nbd@nbd.name>1457414578M: Sean Wang <sean.wang@mediatek.com>1457514575-M: Mark Lee <Mark-MC.Lee@mediatek.com>1457614579M: Lorenzo Bianconi <lorenzo@kernel.org>1457714580L: netdev@vger.kernel.org1457814581S: Maintained···1476114766F: include/soc/mediatek/smi.h14762147671476314768MEDIATEK SWITCH DRIVER1476414764-M: Arınç ÜNAL <arinc.unal@arinc9.com>1476914769+M: Chester A. Unal <chester.a.unal@arinc9.com>1476514770M: Daniel Golle <daniel@makrotopia.org>1476614771M: DENG Qingfang <dqfext@gmail.com>1476714772M: Sean Wang <sean.wang@mediatek.com>···1846518470F: drivers/pinctrl/mediatek/18466184711846718472PIN CONTROLLER - MEDIATEK MIPS1846818468-M: Arınç ÜNAL <arinc.unal@arinc9.com>1847318473+M: Chester A. Unal <chester.a.unal@arinc9.com>1846918474M: Sergio Paracuellos <sergio.paracuellos@gmail.com>1847018475L: linux-mediatek@lists.infradead.org (moderated for non-subscribers)1847118476L: linux-mips@vger.kernel.org···1950919514F: arch/mips/ralink19510195151951119516RALINK MT7621 MIPS ARCHITECTURE1951219512-M: Arınç ÜNAL <arinc.unal@arinc9.com>1951719517+M: Chester A. Unal <chester.a.unal@arinc9.com>1951319518M: Sergio Paracuellos <sergio.paracuellos@gmail.com>1951419519L: linux-mips@vger.kernel.org1951519520S: Maintained···2091220917SCHEDULER - SCHED_EXT2091320918R: Tejun Heo <tj@kernel.org>2091420919R: David Vernet <void@manifault.com>2092020920+R: Andrea Righi <arighi@nvidia.com>2092120921+R: Changwoo Min <changwoo@igalia.com>2091520922L: linux-kernel@vger.kernel.org2091620923S: Maintained2091720924W: https://github.com/sched-ext/scx···2250822511F: drivers/phy/st/phy-stm32-combophy.c22509225122251022513STMMAC ETHERNET DRIVER2251122511-M: Alexandre Torgue <alexandre.torgue@foss.st.com>2251222512-M: Jose Abreu <joabreu@synopsys.com>2251322514L: netdev@vger.kernel.org2251422514-S: Supported2251522515-W: http://www.stlinux.com2251522515+S: Orphan2251622516F: Documentation/networking/device_drivers/ethernet/stmicro/2251722517F: drivers/net/ethernet/stmicro/stmmac/2251822518···2274122747F: drivers/net/ethernet/synopsys/22742227482274322749SYNOPSYS DESIGNWARE ETHERNET XPCS DRIVER2274422744-M: Jose Abreu <Jose.Abreu@synopsys.com>2274522750L: netdev@vger.kernel.org2274622746-S: Supported2275122751+S: Orphan2274722752F: drivers/net/pcs/pcs-xpcs.c2274822753F: drivers/net/pcs/pcs-xpcs.h2274922754F: include/linux/pcs/pcs-xpcs.h···23650236572365123658TIPC NETWORK LAYER2365223659M: Jon Maloy <jmaloy@redhat.com>2365323653-M: Ying Xue <ying.xue@windriver.com>2365423660L: netdev@vger.kernel.org (core kernel code)2365523661L: tipc-discussion@lists.sourceforge.net (user apps, general discussion)2365623662S: Maintained···2425524263F: drivers/usb/isp1760/*24256242642425724265USB LAN78XX ETHERNET DRIVER2425824258-M: Woojung Huh <woojung.huh@microchip.com>2426624266+M: Thangaraj Samynathan <Thangaraj.S@microchip.com>2426724267+M: Rengarajan Sundararajan <Rengarajan.S@microchip.com>2425924268M: UNGLinuxDriver@microchip.com2426024269L: netdev@vger.kernel.org2426124270S: Maintained
···3434#define E500_TLB_BITMAP (1 << 30)3535/* TLB1 entry is mapped by host TLB0 */3636#define E500_TLB_TLB0 (1 << 29)3737+/* entry is writable on the host */3838+#define E500_TLB_WRITABLE (1 << 28)3739/* bits [6-5] MAS2_X1 and MAS2_X0 and [4-0] bits for WIMGE */3840#define E500_TLB_MAS2_ATTR (0x7f)3941
+83-116
arch/powerpc/kvm/e500_mmu_host.c
···4545 return host_tlb_params[1].entries - tlbcam_index - 1;4646}47474848-static inline u32 e500_shadow_mas3_attrib(u32 mas3, int usermode)4848+static inline u32 e500_shadow_mas3_attrib(u32 mas3, bool writable, int usermode)4949{5050 /* Mask off reserved bits. */5151 mas3 &= MAS3_ATTRIB_MASK;5252+5353+ if (!writable)5454+ mas3 &= ~(MAS3_UW|MAS3_SW);52555356#ifndef CONFIG_KVM_BOOKE_HV5457 if (!usermode) {···245242 return tlbe->mas7_3 & (MAS3_SW|MAS3_UW);246243}247244248248-static inline bool kvmppc_e500_ref_setup(struct tlbe_ref *ref,245245+static inline void kvmppc_e500_ref_setup(struct tlbe_ref *ref,249246 struct kvm_book3e_206_tlb_entry *gtlbe,250250- kvm_pfn_t pfn, unsigned int wimg)247247+ kvm_pfn_t pfn, unsigned int wimg,248248+ bool writable)251249{252250 ref->pfn = pfn;253251 ref->flags = E500_TLB_VALID;252252+ if (writable)253253+ ref->flags |= E500_TLB_WRITABLE;254254255255 /* Use guest supplied MAS2_G and MAS2_E */256256 ref->flags |= (gtlbe->mas2 & MAS2_ATTRIB_MASK) | wimg;257257-258258- return tlbe_is_writable(gtlbe);259257}260258261259static inline void kvmppc_e500_ref_release(struct tlbe_ref *ref)···309305{310306 kvm_pfn_t pfn = ref->pfn;311307 u32 pr = vcpu->arch.shared->msr & MSR_PR;308308+ bool writable = !!(ref->flags & E500_TLB_WRITABLE);312309313310 BUG_ON(!(ref->flags & E500_TLB_VALID));314311···317312 stlbe->mas1 = MAS1_TSIZE(tsize) | get_tlb_sts(gtlbe) | MAS1_VALID;318313 stlbe->mas2 = (gvaddr & MAS2_EPN) | (ref->flags & E500_TLB_MAS2_ATTR);319314 stlbe->mas7_3 = ((u64)pfn << PAGE_SHIFT) |320320- e500_shadow_mas3_attrib(gtlbe->mas7_3, pr);315315+ e500_shadow_mas3_attrib(gtlbe->mas7_3, writable, pr);321316}322317323318static inline int kvmppc_e500_shadow_map(struct kvmppc_vcpu_e500 *vcpu_e500,···326321 struct tlbe_ref *ref)327322{328323 struct kvm_memory_slot *slot;329329- unsigned long pfn = 0; /* silence GCC warning */324324+ unsigned int psize;325325+ unsigned long pfn;330326 struct page *page = NULL;331327 unsigned long hva;332332- int pfnmap = 0;333328 int tsize = BOOK3E_PAGESZ_4K;334329 int ret = 0;335330 unsigned long mmu_seq;336331 struct kvm *kvm = vcpu_e500->vcpu.kvm;337337- unsigned long tsize_pages = 0;338332 pte_t *ptep;339333 unsigned int wimg = 0;340334 pgd_t *pgdir;···355351 slot = gfn_to_memslot(vcpu_e500->vcpu.kvm, gfn);356352 hva = gfn_to_hva_memslot(slot, gfn);357353358358- if (tlbsel == 1) {359359- struct vm_area_struct *vma;360360- mmap_read_lock(kvm->mm);361361-362362- vma = find_vma(kvm->mm, hva);363363- if (vma && hva >= vma->vm_start &&364364- (vma->vm_flags & VM_PFNMAP)) {365365- /*366366- * This VMA is a physically contiguous region (e.g.367367- * /dev/mem) that bypasses normal Linux page368368- * management. Find the overlap between the369369- * vma and the memslot.370370- */371371-372372- unsigned long start, end;373373- unsigned long slot_start, slot_end;374374-375375- pfnmap = 1;376376-377377- start = vma->vm_pgoff;378378- end = start +379379- vma_pages(vma);380380-381381- pfn = start + ((hva - vma->vm_start) >> PAGE_SHIFT);382382-383383- slot_start = pfn - (gfn - slot->base_gfn);384384- slot_end = slot_start + slot->npages;385385-386386- if (start < slot_start)387387- start = slot_start;388388- if (end > slot_end)389389- end = slot_end;390390-391391- tsize = (gtlbe->mas1 & MAS1_TSIZE_MASK) >>392392- MAS1_TSIZE_SHIFT;393393-394394- /*395395- * e500 doesn't implement the lowest tsize bit,396396- * or 1K pages.397397- */398398- tsize = max(BOOK3E_PAGESZ_4K, tsize & ~1);399399-400400- /*401401- * Now find the largest tsize (up to what the guest402402- * requested) that will cover gfn, stay within the403403- * range, and for which gfn and pfn are mutually404404- * aligned.405405- */406406-407407- for (; tsize > BOOK3E_PAGESZ_4K; tsize -= 2) {408408- unsigned long gfn_start, gfn_end;409409- tsize_pages = 1UL << (tsize - 2);410410-411411- gfn_start = gfn & ~(tsize_pages - 1);412412- gfn_end = gfn_start + tsize_pages;413413-414414- if (gfn_start + pfn - gfn < start)415415- continue;416416- if (gfn_end + pfn - gfn > end)417417- continue;418418- if ((gfn & (tsize_pages - 1)) !=419419- (pfn & (tsize_pages - 1)))420420- continue;421421-422422- gvaddr &= ~((tsize_pages << PAGE_SHIFT) - 1);423423- pfn &= ~(tsize_pages - 1);424424- break;425425- }426426- } else if (vma && hva >= vma->vm_start &&427427- is_vm_hugetlb_page(vma)) {428428- unsigned long psize = vma_kernel_pagesize(vma);429429-430430- tsize = (gtlbe->mas1 & MAS1_TSIZE_MASK) >>431431- MAS1_TSIZE_SHIFT;432432-433433- /*434434- * Take the largest page size that satisfies both host435435- * and guest mapping436436- */437437- tsize = min(__ilog2(psize) - 10, tsize);438438-439439- /*440440- * e500 doesn't implement the lowest tsize bit,441441- * or 1K pages.442442- */443443- tsize = max(BOOK3E_PAGESZ_4K, tsize & ~1);444444- }445445-446446- mmap_read_unlock(kvm->mm);447447- }448448-449449- if (likely(!pfnmap)) {450450- tsize_pages = 1UL << (tsize + 10 - PAGE_SHIFT);451451- pfn = __kvm_faultin_pfn(slot, gfn, FOLL_WRITE, NULL, &page);452452- if (is_error_noslot_pfn(pfn)) {453453- if (printk_ratelimit())454454- pr_err("%s: real page not found for gfn %lx\n",455455- __func__, (long)gfn);456456- return -EINVAL;457457- }458458-459459- /* Align guest and physical address to page map boundaries */460460- pfn &= ~(tsize_pages - 1);461461- gvaddr &= ~((tsize_pages << PAGE_SHIFT) - 1);354354+ pfn = __kvm_faultin_pfn(slot, gfn, FOLL_WRITE, &writable, &page);355355+ if (is_error_noslot_pfn(pfn)) {356356+ if (printk_ratelimit())357357+ pr_err("%s: real page not found for gfn %lx\n",358358+ __func__, (long)gfn);359359+ return -EINVAL;462360 }463361464362 spin_lock(&kvm->mmu_lock);···378472 * can't run hence pfn won't change.379473 */380474 local_irq_save(flags);381381- ptep = find_linux_pte(pgdir, hva, NULL, NULL);475475+ ptep = find_linux_pte(pgdir, hva, NULL, &psize);382476 if (ptep) {383477 pte_t pte = READ_ONCE(*ptep);384478385479 if (pte_present(pte)) {386480 wimg = (pte_val(pte) >> PTE_WIMGE_SHIFT) &387481 MAS2_WIMGE_MASK;388388- local_irq_restore(flags);389482 } else {390483 local_irq_restore(flags);391484 pr_err_ratelimited("%s: pte not present: gfn %lx,pfn %lx\n",···393488 goto out;394489 }395490 }396396- writable = kvmppc_e500_ref_setup(ref, gtlbe, pfn, wimg);491491+ local_irq_restore(flags);397492493493+ if (psize && tlbsel == 1) {494494+ unsigned long psize_pages, tsize_pages;495495+ unsigned long start, end;496496+ unsigned long slot_start, slot_end;497497+498498+ psize_pages = 1UL << (psize - PAGE_SHIFT);499499+ start = pfn & ~(psize_pages - 1);500500+ end = start + psize_pages;501501+502502+ slot_start = pfn - (gfn - slot->base_gfn);503503+ slot_end = slot_start + slot->npages;504504+505505+ if (start < slot_start)506506+ start = slot_start;507507+ if (end > slot_end)508508+ end = slot_end;509509+510510+ tsize = (gtlbe->mas1 & MAS1_TSIZE_MASK) >>511511+ MAS1_TSIZE_SHIFT;512512+513513+ /*514514+ * Any page size that doesn't satisfy the host mapping515515+ * will fail the start and end tests.516516+ */517517+ tsize = min(psize - PAGE_SHIFT + BOOK3E_PAGESZ_4K, tsize);518518+519519+ /*520520+ * e500 doesn't implement the lowest tsize bit,521521+ * or 1K pages.522522+ */523523+ tsize = max(BOOK3E_PAGESZ_4K, tsize & ~1);524524+525525+ /*526526+ * Now find the largest tsize (up to what the guest527527+ * requested) that will cover gfn, stay within the528528+ * range, and for which gfn and pfn are mutually529529+ * aligned.530530+ */531531+532532+ for (; tsize > BOOK3E_PAGESZ_4K; tsize -= 2) {533533+ unsigned long gfn_start, gfn_end;534534+ tsize_pages = 1UL << (tsize - 2);535535+536536+ gfn_start = gfn & ~(tsize_pages - 1);537537+ gfn_end = gfn_start + tsize_pages;538538+539539+ if (gfn_start + pfn - gfn < start)540540+ continue;541541+ if (gfn_end + pfn - gfn > end)542542+ continue;543543+ if ((gfn & (tsize_pages - 1)) !=544544+ (pfn & (tsize_pages - 1)))545545+ continue;546546+547547+ gvaddr &= ~((tsize_pages << PAGE_SHIFT) - 1);548548+ pfn &= ~(tsize_pages - 1);549549+ break;550550+ }551551+ }552552+553553+ kvmppc_e500_ref_setup(ref, gtlbe, pfn, wimg, writable);398554 kvmppc_e500_setup_stlbe(&vcpu_e500->vcpu, gtlbe, tsize,399555 ref, gvaddr, stlbe);556556+ writable = tlbe_is_writable(stlbe);400557401558 /* Clear i-cache for new pages */402559 kvmppc_mmu_flush_icache(pfn);
+36
arch/powerpc/platforms/book3s/vas-api.c
···464464 return VM_FAULT_SIGBUS;465465}466466467467+/*468468+ * During mmap() paste address, mapping VMA is saved in VAS window469469+ * struct which is used to unmap during migration if the window is470470+ * still open. But the user space can remove this mapping with471471+ * munmap() before closing the window and the VMA address will472472+ * be invalid. Set VAS window VMA to NULL in this function which473473+ * is called before VMA free.474474+ */475475+static void vas_mmap_close(struct vm_area_struct *vma)476476+{477477+ struct file *fp = vma->vm_file;478478+ struct coproc_instance *cp_inst = fp->private_data;479479+ struct vas_window *txwin;480480+481481+ /* Should not happen */482482+ if (!cp_inst || !cp_inst->txwin) {483483+ pr_err("No attached VAS window for the paste address mmap\n");484484+ return;485485+ }486486+487487+ txwin = cp_inst->txwin;488488+ /*489489+ * task_ref.vma is set in coproc_mmap() during mmap paste490490+ * address. So it has to be the same VMA that is getting freed.491491+ */492492+ if (WARN_ON(txwin->task_ref.vma != vma)) {493493+ pr_err("Invalid paste address mmaping\n");494494+ return;495495+ }496496+497497+ mutex_lock(&txwin->task_ref.mmap_mutex);498498+ txwin->task_ref.vma = NULL;499499+ mutex_unlock(&txwin->task_ref.mmap_mutex);500500+}501501+467502static const struct vm_operations_struct vas_vm_ops = {503503+ .close = vas_mmap_close,468504 .fault = vas_mmap_fault,469505};470506
···3333#include <asm/pgtable.h>3434#include <asm/sections.h>3535#include <asm/soc.h>3636+#include <asm/sparsemem.h>3637#include <asm/tlbflush.h>37383839#include "../kernel/head.h"···62616362phys_addr_t phys_ram_base __ro_after_init;6463EXPORT_SYMBOL(phys_ram_base);6464+6565+#ifdef CONFIG_SPARSEMEM_VMEMMAP6666+#define VMEMMAP_ADDR_ALIGN (1ULL << SECTION_SIZE_BITS)6767+6868+unsigned long vmemmap_start_pfn __ro_after_init;6969+EXPORT_SYMBOL(vmemmap_start_pfn);7070+#endif65716672unsigned long empty_zero_page[PAGE_SIZE / sizeof(unsigned long)]6773 __page_aligned_bss;···248240 * Make sure we align the start of the memory on a PMD boundary so that249241 * at worst, we map the linear mapping with PMD mappings.250242 */251251- if (!IS_ENABLED(CONFIG_XIP_KERNEL))243243+ if (!IS_ENABLED(CONFIG_XIP_KERNEL)) {252244 phys_ram_base = memblock_start_of_DRAM() & PMD_MASK;245245+#ifdef CONFIG_SPARSEMEM_VMEMMAP246246+ vmemmap_start_pfn = round_down(phys_ram_base, VMEMMAP_ADDR_ALIGN) >> PAGE_SHIFT;247247+#endif248248+ }253249254250 /*255251 * In 64-bit, any use of __va/__pa before this point is wrong as we···11131101 kernel_map.xiprom_sz = (uintptr_t)(&_exiprom) - (uintptr_t)(&_xiprom);1114110211151103 phys_ram_base = CONFIG_PHYS_RAM_BASE;11041104+#ifdef CONFIG_SPARSEMEM_VMEMMAP11051105+ vmemmap_start_pfn = round_down(phys_ram_base, VMEMMAP_ADDR_ALIGN) >> PAGE_SHIFT;11061106+#endif11161107 kernel_map.phys_addr = (uintptr_t)CONFIG_PHYS_RAM_BASE;11171108 kernel_map.size = (uintptr_t)(&_end) - (uintptr_t)(&_start);11181109
+6
arch/s390/kvm/interrupt.c
···26782678 kvm_s390_clear_float_irqs(dev->kvm);26792679 break;26802680 case KVM_DEV_FLIC_APF_ENABLE:26812681+ if (kvm_is_ucontrol(dev->kvm))26822682+ return -EINVAL;26812683 dev->kvm->arch.gmap->pfault_enabled = 1;26822684 break;26832685 case KVM_DEV_FLIC_APF_DISABLE_WAIT:26862686+ if (kvm_is_ucontrol(dev->kvm))26872687+ return -EINVAL;26842688 dev->kvm->arch.gmap->pfault_enabled = 0;26852689 /*26862690 * Make sure no async faults are in transition when···28982894 switch (ue->type) {28992895 /* we store the userspace addresses instead of the guest addresses */29002896 case KVM_IRQ_ROUTING_S390_ADAPTER:28972897+ if (kvm_is_ucontrol(kvm))28982898+ return -EINVAL;29012899 e->set = set_adapter_int;29022900 uaddr = gmap_translate(kvm->arch.gmap, ue->u.adapter.summary_addr);29032901 if (uaddr == -EFAULT)
···81818282static __ro_after_init bool ibt_fatal = true;83838484+/*8585+ * By definition, all missing-ENDBRANCH #CPs are a result of WFE && !ENDBR.8686+ *8787+ * For the kernel IBT no ENDBR selftest where #CPs are deliberately triggered,8888+ * the WFE state of the interrupted context needs to be cleared to let execution8989+ * continue. Otherwise when the CPU resumes from the instruction that just9090+ * caused the previous #CP, another missing-ENDBRANCH #CP is raised and the CPU9191+ * enters a dead loop.9292+ *9393+ * This is not a problem with IDT because it doesn't preserve WFE and IRET doesn't9494+ * set WFE. But FRED provides space on the entry stack (in an expanded CS area)9595+ * to save and restore the WFE state, thus the WFE state is no longer clobbered,9696+ * so software must clear it.9797+ */9898+static void ibt_clear_fred_wfe(struct pt_regs *regs)9999+{100100+ /*101101+ * No need to do any FRED checks.102102+ *103103+ * For IDT event delivery, the high-order 48 bits of CS are pushed104104+ * as 0s into the stack, and later IRET ignores these bits.105105+ *106106+ * For FRED, a test to check if fred_cs.wfe is set would be dropped107107+ * by compilers.108108+ */109109+ regs->fred_cs.wfe = 0;110110+}111111+84112static void do_kernel_cp_fault(struct pt_regs *regs, unsigned long error_code)85113{86114 if ((error_code & CP_EC) != CP_ENDBR) {···1189011991 if (unlikely(regs->ip == (unsigned long)&ibt_selftest_noendbr)) {12092 regs->ax = 0;9393+ ibt_clear_fred_wfe(regs);12194 return;12295 }12396···12697 if (!ibt_fatal) {12798 printk(KERN_DEFAULT CUT_HERE);12899 __warn(__FILE__, __LINE__, (void *)regs->ip, TAINT_WARN, regs, NULL);100100+ ibt_clear_fred_wfe(regs);129101 return;130102 }131103 BUG();
+2-1
arch/x86/kernel/fpu/regset.c
···190190 struct fpu *fpu = &target->thread.fpu;191191 struct cet_user_state *cetregs;192192193193- if (!cpu_feature_enabled(X86_FEATURE_USER_SHSTK))193193+ if (!cpu_feature_enabled(X86_FEATURE_USER_SHSTK) ||194194+ !ssp_active(target, regset))194195 return -ENODEV;195196196197 sync_fpstate(fpu);
···68446844 if (new_bfqq == waker_bfqq) {68456845 /*68466846 * If waker_bfqq is in the merge chain, and current68476847- * is the only procress.68476847+ * is the only process, waker_bfqq can be freed.68486848 */68496849 if (bfqq_process_refs(waker_bfqq) == 1)68506850 return NULL;68516851- break;68516851+68526852+ return waker_bfqq;68526853 }6853685468546855 new_bfqq = new_bfqq->new_bfqq;68556856 }68576857+68586858+ /*68596859+ * If waker_bfqq is not in the merge chain, and it's procress reference68606860+ * is 0, waker_bfqq can be freed.68616861+ */68626862+ if (bfqq_process_refs(waker_bfqq) == 0)68636863+ return NULL;6856686468576865 return waker_bfqq;68586866}
+21-3
drivers/acpi/resource.c
···441441 },442442 },443443 {444444+ /* Asus Vivobook X1504VAP */445445+ .matches = {446446+ DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),447447+ DMI_MATCH(DMI_BOARD_NAME, "X1504VAP"),448448+ },449449+ },450450+ {444451 /* Asus Vivobook X1704VAP */445452 .matches = {446453 DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."),···653646 DMI_MATCH(DMI_BOARD_NAME, "GMxHGxx"),654647 },655648 },649649+ {650650+ /*651651+ * TongFang GM5HG0A in case of the SKIKK Vanaheim relabel the652652+ * board-name is changed, so check OEM strings instead. Note653653+ * OEM string matches are always exact matches.654654+ * https://bugzilla.kernel.org/show_bug.cgi?id=219614655655+ */656656+ .matches = {657657+ DMI_EXACT_MATCH(DMI_OEM_STRING, "GM5HG0A"),658658+ },659659+ },656660 { }657661};658662···689671 for (i = 0; i < ARRAY_SIZE(override_table); i++) {690672 const struct irq_override_cmp *entry = &override_table[i];691673692692- if (dmi_check_system(entry->system) &&693693- entry->irq == gsi &&674674+ if (entry->irq == gsi &&694675 entry->triggering == triggering &&695676 entry->polarity == polarity &&696696- entry->shareable == shareable)677677+ entry->shareable == shareable &&678678+ dmi_check_system(entry->system))697679 return entry->override;698680 }699681
···11061106 }11071107 }1108110811091109- cd_dbg(CD_OPEN, "all seems well, opening the devicen");11091109+ cd_dbg(CD_OPEN, "all seems well, opening the device\n");1110111011111111 /* all seems well, we can open the device */11121112 ret = cdo->open(cdi, 0); /* open for data */
+2-1
drivers/clk/imx/clk-imx8mp-audiomix.c
···278278279279#else /* !CONFIG_RESET_CONTROLLER */280280281281-static int clk_imx8mp_audiomix_reset_controller_register(struct clk_imx8mp_audiomix_priv *priv)281281+static int clk_imx8mp_audiomix_reset_controller_register(struct device *dev,282282+ struct clk_imx8mp_audiomix_priv *priv)282283{283284 return 0;284285}
···483483 if (stream_status == NULL) {484484 dm_error("Existing stream not found; failed to attach surface!\n");485485 goto out;486486- } else if (stream_status->plane_count == MAX_SURFACE_NUM) {486486+ } else if (stream_status->plane_count == MAX_SURFACES) {487487 dm_error("Surface: can not attach plane_state %p! Maximum is: %d\n",488488- plane_state, MAX_SURFACE_NUM);488488+ plane_state, MAX_SURFACES);489489 goto out;490490 } else if (!otg_master_pipe) {491491 goto out;···600600{601601 int i, old_plane_count;602602 struct dc_stream_status *stream_status = NULL;603603- struct dc_plane_state *del_planes[MAX_SURFACE_NUM] = { 0 };603603+ struct dc_plane_state *del_planes[MAX_SURFACES] = { 0 };604604605605 for (i = 0; i < state->stream_count; i++)606606 if (state->streams[i] == stream) {···875875{876876 int i, old_plane_count;877877 struct dc_stream_status *stream_status = NULL;878878- struct dc_plane_state *del_planes[MAX_SURFACE_NUM] = { 0 };878878+ struct dc_plane_state *del_planes[MAX_SURFACES] = { 0 };879879880880 for (i = 0; i < state->stream_count; i++)881881 if (state->streams[i] == phantom_stream) {
+2-2
drivers/gpu/drm/amd/display/dc/dc.h
···57575858#define DC_VER "3.2.310"59596060-#define MAX_SURFACES 36060+#define MAX_SURFACES 46161#define MAX_PLANES 66262#define MAX_STREAMS 66363#define MIN_VIEWPORT_SIZE 12···13981398 * store current value in plane states so we can still recover13991399 * a valid current state during dc update.14001400 */14011401- struct dc_plane_state plane_states[MAX_SURFACE_NUM];14011401+ struct dc_plane_state plane_states[MAX_SURFACES];1402140214031403 struct dc_stream_state stream_state;14041404};
···12411241 return ret;1242124212431243 ret = adv7511_init_regulators(adv7511);12441244- if (ret)12451245- return dev_err_probe(dev, ret, "failed to init regulators\n");12441244+ if (ret) {12451245+ dev_err_probe(dev, ret, "failed to init regulators\n");12461246+ goto err_of_node_put;12471247+ }1246124812471249 /*12481250 * The power down GPIO is optional. If present, toggle it from active to···13651363 i2c_unregister_device(adv7511->i2c_edid);13661364uninit_regulators:13671365 adv7511_uninit_regulators(adv7511);13661366+err_of_node_put:13671367+ of_node_put(adv7511->host_node);1368136813691369 return ret;13701370}···13741370static void adv7511_remove(struct i2c_client *i2c)13751371{13761372 struct adv7511 *adv7511 = i2c_get_clientdata(i2c);13731373+13741374+ of_node_put(adv7511->host_node);1377137513781376 adv7511_uninit_regulators(adv7511);13791377
···21152115 0, C10_VDR_CTRL_MSGBUS_ACCESS,21162116 MB_WRITE_COMMITTED);2117211721182118- /* Custom width needs to be programmed to 0 for both the phy lanes */21192119- intel_cx0_rmw(encoder, INTEL_CX0_BOTH_LANES, PHY_C10_VDR_CUSTOM_WIDTH,21202120- C10_VDR_CUSTOM_WIDTH_MASK, C10_VDR_CUSTOM_WIDTH_8_10,21212121- MB_WRITE_COMMITTED);21222122- intel_cx0_rmw(encoder, INTEL_CX0_BOTH_LANES, PHY_C10_VDR_CONTROL(1),21232123- 0, C10_VDR_CTRL_UPDATE_CFG,21242124- MB_WRITE_COMMITTED);21252125-21262118 /* Program the pll values only for the master lane */21272119 for (i = 0; i < ARRAY_SIZE(pll_state->pll); i++)21282120 intel_cx0_write(encoder, INTEL_CX0_LANE0, PHY_C10_VDR_PLL(i),···21242132 intel_cx0_write(encoder, INTEL_CX0_LANE0, PHY_C10_VDR_CMN(0), pll_state->cmn, MB_WRITE_COMMITTED);21252133 intel_cx0_write(encoder, INTEL_CX0_LANE0, PHY_C10_VDR_TX(0), pll_state->tx, MB_WRITE_COMMITTED);2126213421352135+ /* Custom width needs to be programmed to 0 for both the phy lanes */21362136+ intel_cx0_rmw(encoder, INTEL_CX0_BOTH_LANES, PHY_C10_VDR_CUSTOM_WIDTH,21372137+ C10_VDR_CUSTOM_WIDTH_MASK, C10_VDR_CUSTOM_WIDTH_8_10,21382138+ MB_WRITE_COMMITTED);21272139 intel_cx0_rmw(encoder, INTEL_CX0_LANE0, PHY_C10_VDR_CONTROL(1),21282140 0, C10_VDR_CTRL_MASTER_LANE | C10_VDR_CTRL_UPDATE_CFG,21292141 MB_WRITE_COMMITTED);
+9-3
drivers/gpu/drm/i915/display/intel_hdcp.c
···11581158 goto out;11591159 }1160116011611161- intel_hdcp_update_value(connector,11621162- DRM_MODE_CONTENT_PROTECTION_DESIRED,11631163- true);11611161+ ret = intel_hdcp1_enable(connector);11621162+ if (ret) {11631163+ drm_err(display->drm, "Failed to enable hdcp (%d)\n", ret);11641164+ intel_hdcp_update_value(connector,11651165+ DRM_MODE_CONTENT_PROTECTION_DESIRED,11661166+ true);11671167+ goto out;11681168+ }11691169+11641170out:11651171 mutex_unlock(&dig_port->hdcp_mutex);11661172 mutex_unlock(&hdcp->mutex);
+1-1
drivers/gpu/drm/i915/gt/intel_rc6.c
···133133 GEN9_MEDIA_PG_ENABLE |134134 GEN11_MEDIA_SAMPLER_PG_ENABLE;135135136136- if (GRAPHICS_VER(gt->i915) >= 12) {136136+ if (GRAPHICS_VER(gt->i915) >= 12 && !IS_DG1(gt->i915)) {137137 for (i = 0; i < I915_MAX_VCS; i++)138138 if (HAS_ENGINE(gt, _VCS(i)))139139 pg_enable |= (VDN_HCP_POWERGATE_ENABLE(i) |
-5
drivers/gpu/drm/mediatek/Kconfig
···1414 select DRM_BRIDGE_CONNECTOR1515 select DRM_MIPI_DSI1616 select DRM_PANEL1717- select MEMORY1818- select MTK_SMI1919- select PHY_MTK_MIPI_DSI2017 select VIDEOMODE_HELPERS2118 help2219 Choose this option if you have a Mediatek SoCs.···2427config DRM_MEDIATEK_DP2528 tristate "DRM DPTX Support for MediaTek SoCs"2629 depends on DRM_MEDIATEK2727- select PHY_MTK_DP2830 select DRM_DISPLAY_HELPER2931 select DRM_DISPLAY_DP_HELPER3032 select DRM_DISPLAY_DP_AUX_BUS···3438 tristate "DRM HDMI Support for Mediatek SoCs"3539 depends on DRM_MEDIATEK3640 select SND_SOC_HDMI_CODEC if SND_SOC3737- select PHY_MTK_HDMI3841 help3942 DRM/KMS HDMI driver for Mediatek SoCs
···724724 new_mem->mem_type == XE_PL_SYSTEM) {725725 long timeout = dma_resv_wait_timeout(ttm_bo->base.resv,726726 DMA_RESV_USAGE_BOOKKEEP,727727- true,727727+ false,728728 MAX_SCHEDULE_TIMEOUT);729729 if (timeout < 0) {730730 ret = timeout;···848848849849out:850850 if ((!ttm_bo->resource || ttm_bo->resource->mem_type == XE_PL_SYSTEM) &&851851- ttm_bo->ttm)851851+ ttm_bo->ttm) {852852+ long timeout = dma_resv_wait_timeout(ttm_bo->base.resv,853853+ DMA_RESV_USAGE_KERNEL,854854+ false,855855+ MAX_SCHEDULE_TIMEOUT);856856+ if (timeout < 0)857857+ ret = timeout;858858+852859 xe_tt_unmap_sg(ttm_bo->ttm);860860+ }853861854862 return ret;855863}
+14-1
drivers/gpu/drm/xe/xe_devcoredump.c
···109109 drm_puts(&p, "\n**** GuC CT ****\n");110110 xe_guc_ct_snapshot_print(ss->guc.ct, &p);111111112112- drm_puts(&p, "\n**** Contexts ****\n");112112+ /*113113+ * Don't add a new section header here because the mesa debug decoder114114+ * tool expects the context information to be in the 'GuC CT' section.115115+ */116116+ /* drm_puts(&p, "\n**** Contexts ****\n"); */113117 xe_guc_exec_queue_snapshot_print(ss->ge, &p);114118115119 drm_puts(&p, "\n**** Job ****\n");···366362 const u32 *blob32 = (const u32 *)blob;367363 char buff[ASCII85_BUFSZ], *line_buff;368364 size_t line_pos = 0;365365+366366+ /*367367+ * Splitting blobs across multiple lines is not compatible with the mesa368368+ * debug decoder tool. Note that even dropping the explicit '\n' below369369+ * doesn't help because the GuC log is so big some underlying implementation370370+ * still splits the lines at 512K characters. So just bail completely for371371+ * the moment.372372+ */373373+ return;369374370375#define DMESG_MAX_LINE_LEN 800371376#define MIN_SPACE (ASCII85_BUFSZ + 2) /* 85 + "\n\0" */
+9
drivers/gpu/drm/xe/xe_exec_queue.c
···88#include <linux/nospec.h>991010#include <drm/drm_device.h>1111+#include <drm/drm_drv.h>1112#include <drm/drm_file.h>1213#include <uapi/drm/xe_drm.h>1314···763762 */764763void xe_exec_queue_update_run_ticks(struct xe_exec_queue *q)765764{765765+ struct xe_device *xe = gt_to_xe(q->gt);766766 struct xe_file *xef;767767 struct xe_lrc *lrc;768768 u32 old_ts, new_ts;769769+ int idx;769770770771 /*771772 * Jobs that are run during driver load may use an exec_queue, but are···775772 * for kernel specific work.776773 */777774 if (!q->vm || !q->vm->xef)775775+ return;776776+777777+ /* Synchronize with unbind while holding the xe file open */778778+ if (!drm_dev_enter(&xe->drm, &idx))778779 return;779780780781 xef = q->vm->xef;···794787 lrc = q->lrc[0];795788 new_ts = xe_lrc_update_timestamp(lrc, &old_ts);796789 xef->run_ticks[q->class] += (new_ts - old_ts) * q->width;790790+791791+ drm_dev_exit(idx);797792}798793799794/**
···221221222222static u32 get_ppgtt_flag(struct xe_sched_job *job)223223{224224- return job->q->vm ? BIT(8) : 0;224224+ if (job->q->vm && !job->ggtt)225225+ return BIT(8);226226+227227+ return 0;225228}226229227230static int emit_copy_timestamp(struct xe_lrc *lrc, u32 *dw, int i)
+2
drivers/gpu/drm/xe/xe_sched_job_types.h
···5656 u32 migrate_flush_flags;5757 /** @ring_ops_flush_tlb: The ring ops need to flush TLB before payload. */5858 bool ring_ops_flush_tlb;5959+ /** @ggtt: mapped in ggtt. */6060+ bool ggtt;5961 /** @ptrs: per instance pointers. */6062 struct xe_job_ptrs ptrs[];6163};
···9393 * @base: pointer to register struct9494 * @dev: device reference9595 * @i2c_clk: clock reference for i2c input clock9696+ * @msg_queue: pointer to the messages requiring sending9697 * @buf: pointer to msg buffer for easier use9798 * @msg_complete: xfer completion object9899 * @adapter: core i2c abstraction99100 * @msg_err: error code for completed message100101 * @bus_clk_rate: current i2c bus clock rate101102 * @isr_status: cached copy of local ISR status103103+ * @total_num: total number of messages to be sent/received104104+ * @current_num: index of the current message being sent/received102105 * @msg_len: number of bytes transferred in msg103106 * @addr: address of the current slave107107+ * @restart_needed: whether or not a repeated start is required after current message104108 */105109struct mchp_corei2c_dev {106110 void __iomem *base;107111 struct device *dev;108112 struct clk *i2c_clk;113113+ struct i2c_msg *msg_queue;109114 u8 *buf;110115 struct completion msg_complete;111116 struct i2c_adapter adapter;112117 int msg_err;118118+ int total_num;119119+ int current_num;113120 u32 bus_clk_rate;114121 u32 isr_status;115122 u16 msg_len;116123 u8 addr;124124+ bool restart_needed;117125};118126119127static void mchp_corei2c_core_disable(struct mchp_corei2c_dev *idev)···230222 return 0;231223}232224225225+static void mchp_corei2c_next_msg(struct mchp_corei2c_dev *idev)226226+{227227+ struct i2c_msg *this_msg;228228+ u8 ctrl;229229+230230+ if (idev->current_num >= idev->total_num) {231231+ complete(&idev->msg_complete);232232+ return;233233+ }234234+235235+ /*236236+ * If there's been an error, the isr needs to return control237237+ * to the "main" part of the driver, so as not to keep sending238238+ * messages once it completes and clears the SI bit.239239+ */240240+ if (idev->msg_err) {241241+ complete(&idev->msg_complete);242242+ return;243243+ }244244+245245+ this_msg = idev->msg_queue++;246246+247247+ if (idev->current_num < (idev->total_num - 1)) {248248+ struct i2c_msg *next_msg = idev->msg_queue;249249+250250+ idev->restart_needed = next_msg->flags & I2C_M_RD;251251+ } else {252252+ idev->restart_needed = false;253253+ }254254+255255+ idev->addr = i2c_8bit_addr_from_msg(this_msg);256256+ idev->msg_len = this_msg->len;257257+ idev->buf = this_msg->buf;258258+259259+ ctrl = readb(idev->base + CORE_I2C_CTRL);260260+ ctrl |= CTRL_STA;261261+ writeb(ctrl, idev->base + CORE_I2C_CTRL);262262+263263+ idev->current_num++;264264+}265265+233266static irqreturn_t mchp_corei2c_handle_isr(struct mchp_corei2c_dev *idev)234267{235268 u32 status = idev->isr_status;···287238 ctrl &= ~CTRL_STA;288239 writeb(idev->addr, idev->base + CORE_I2C_DATA);289240 writeb(ctrl, idev->base + CORE_I2C_CTRL);290290- if (idev->msg_len == 0)291291- finished = true;292241 break;293242 case STATUS_M_ARB_LOST:294243 idev->msg_err = -EAGAIN;···294247 break;295248 case STATUS_M_SLAW_ACK:296249 case STATUS_M_TX_DATA_ACK:297297- if (idev->msg_len > 0)250250+ if (idev->msg_len > 0) {298251 mchp_corei2c_fill_tx(idev);299299- else300300- last_byte = true;252252+ } else {253253+ if (idev->restart_needed)254254+ finished = true;255255+ else256256+ last_byte = true;257257+ }301258 break;302259 case STATUS_M_TX_DATA_NACK:303260 case STATUS_M_SLAR_NACK:···338287 mchp_corei2c_stop(idev);339288340289 if (last_byte || finished)341341- complete(&idev->msg_complete);290290+ mchp_corei2c_next_msg(idev);342291343292 return IRQ_HANDLED;344293}···362311 return ret;363312}364313365365-static int mchp_corei2c_xfer_msg(struct mchp_corei2c_dev *idev,366366- struct i2c_msg *msg)314314+static int mchp_corei2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,315315+ int num)367316{368368- u8 ctrl;317317+ struct mchp_corei2c_dev *idev = i2c_get_adapdata(adap);318318+ struct i2c_msg *this_msg = msgs;369319 unsigned long time_left;370370-371371- idev->addr = i2c_8bit_addr_from_msg(msg);372372- idev->msg_len = msg->len;373373- idev->buf = msg->buf;374374- idev->msg_err = 0;375375-376376- reinit_completion(&idev->msg_complete);320320+ u8 ctrl;377321378322 mchp_corei2c_core_enable(idev);379323324324+ /*325325+ * The isr controls the flow of a transfer, this info needs to be saved326326+ * to a location that it can access the queue information from.327327+ */328328+ idev->restart_needed = false;329329+ idev->msg_queue = msgs;330330+ idev->total_num = num;331331+ idev->current_num = 0;332332+333333+ /*334334+ * But the first entry to the isr is triggered by the start in this335335+ * function, so the first message needs to be "dequeued".336336+ */337337+ idev->addr = i2c_8bit_addr_from_msg(this_msg);338338+ idev->msg_len = this_msg->len;339339+ idev->buf = this_msg->buf;340340+ idev->msg_err = 0;341341+342342+ if (idev->total_num > 1) {343343+ struct i2c_msg *next_msg = msgs + 1;344344+345345+ idev->restart_needed = next_msg->flags & I2C_M_RD;346346+ }347347+348348+ idev->current_num++;349349+ idev->msg_queue++;350350+351351+ reinit_completion(&idev->msg_complete);352352+353353+ /*354354+ * Send the first start to pass control to the isr355355+ */380356 ctrl = readb(idev->base + CORE_I2C_CTRL);381357 ctrl |= CTRL_STA;382358 writeb(ctrl, idev->base + CORE_I2C_CTRL);···413335 if (!time_left)414336 return -ETIMEDOUT;415337416416- return idev->msg_err;417417-}418418-419419-static int mchp_corei2c_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs,420420- int num)421421-{422422- struct mchp_corei2c_dev *idev = i2c_get_adapdata(adap);423423- int i, ret;424424-425425- for (i = 0; i < num; i++) {426426- ret = mchp_corei2c_xfer_msg(idev, msgs++);427427- if (ret)428428- return ret;429429- }338338+ if (idev->msg_err)339339+ return idev->msg_err;430340431341 return num;432342}
+68-30
drivers/iio/adc/ad4695.c
···9191#define AD4695_T_WAKEUP_SW_MS 39292#define AD4695_T_REFBUF_MS 1009393#define AD4695_T_REGCONFIG_NS 209494+#define AD4695_T_SCK_CNV_DELAY_NS 809495#define AD4695_REG_ACCESS_SCLK_HZ (10 * MEGA)95969697/* Max number of voltage input channels. */···133132 unsigned int vref_mv;134133 /* Common mode input pin voltage. */135134 unsigned int com_mv;136136- /* 1 per voltage and temperature chan plus 1 xfer to trigger 1st CNV */137137- struct spi_transfer buf_read_xfer[AD4695_MAX_CHANNELS + 2];135135+ /*136136+ * 2 per voltage and temperature chan plus 1 xfer to trigger 1st137137+ * CNV. Excluding the trigger xfer, every 2nd xfer only serves138138+ * to control CS and add a delay between the last SCLK and next139139+ * CNV rising edges.140140+ */141141+ struct spi_transfer buf_read_xfer[AD4695_MAX_CHANNELS * 2 + 3];138142 struct spi_message buf_read_msg;139143 /* Raw conversion data received. */140144 u8 buf[ALIGN((AD4695_MAX_CHANNELS + 2) * AD4695_MAX_CHANNEL_SIZE,···429423 u8 temp_chan_bit = st->chip_info->num_voltage_inputs;430424 u32 bit, num_xfer, num_slots;431425 u32 temp_en = 0;432432- int ret;426426+ int ret, rx_buf_offset = 0;433427434428 /*435429 * We are using the advanced sequencer since it is the only way to read···455449 iio_for_each_active_channel(indio_dev, bit) {456450 xfer = &st->buf_read_xfer[num_xfer];457451 xfer->bits_per_word = 16;458458- xfer->rx_buf = &st->buf[(num_xfer - 1) * 2];452452+ xfer->rx_buf = &st->buf[rx_buf_offset];459453 xfer->len = 2;460460- xfer->cs_change = 1;461461- xfer->cs_change_delay.value = AD4695_T_CONVERT_NS;462462- xfer->cs_change_delay.unit = SPI_DELAY_UNIT_NSECS;454454+ rx_buf_offset += xfer->len;463455464456 if (bit == temp_chan_bit) {465457 temp_en = 1;···472468 }473469474470 num_xfer++;471471+472472+ /*473473+ * We need to add a blank xfer in data reads, to meet the timing474474+ * requirement of a minimum delay between the last SCLK rising475475+ * edge and the CS deassert.476476+ */477477+ xfer = &st->buf_read_xfer[num_xfer];478478+ xfer->delay.value = AD4695_T_SCK_CNV_DELAY_NS;479479+ xfer->delay.unit = SPI_DELAY_UNIT_NSECS;480480+ xfer->cs_change = 1;481481+ xfer->cs_change_delay.value = AD4695_T_CONVERT_NS;482482+ xfer->cs_change_delay.unit = SPI_DELAY_UNIT_NSECS;483483+484484+ num_xfer++;475485 }476486477487 /*478488 * The advanced sequencer requires that at least 2 slots are enabled.479489 * Since slot 0 is always used for other purposes, we need only 1480480- * enabled voltage channel to meet this requirement. If the temperature481481- * channel is the only enabled channel, we need to add one more slot482482- * in the sequence but not read from it.490490+ * enabled voltage channel to meet this requirement. If the temperature491491+ * channel is the only enabled channel, we need to add one more slot in492492+ * the sequence but not read from it. This is because the temperature493493+ * sensor is sampled at the end of the channel sequence in advanced494494+ * sequencer mode (see datasheet page 38).495495+ *496496+ * From the iio_for_each_active_channel() block above, we now have an497497+ * xfer with data followed by a blank xfer to allow us to meet the498498+ * timing spec, so move both of those up before adding an extra to499499+ * handle the temperature-only case.483500 */484501 if (num_slots < 2) {485485- /* move last xfer so we can insert one more xfer before it */486486- st->buf_read_xfer[num_xfer] = *xfer;502502+ /* Move last two xfers */503503+ st->buf_read_xfer[num_xfer] = st->buf_read_xfer[num_xfer - 1];504504+ st->buf_read_xfer[num_xfer - 1] = st->buf_read_xfer[num_xfer - 2];487505 num_xfer++;488506489489- /* modify 2nd to last xfer for extra slot */507507+ /* Modify inserted xfer for extra slot. */508508+ xfer = &st->buf_read_xfer[num_xfer - 3];490509 memset(xfer, 0, sizeof(*xfer));491510 xfer->cs_change = 1;492511 xfer->delay.value = st->chip_info->t_acq_ns;···526499 return ret;527500528501 num_slots++;502502+503503+ /*504504+ * We still want to point at the last xfer when finished, so505505+ * update the pointer.506506+ */507507+ xfer = &st->buf_read_xfer[num_xfer - 1];529508 }530509531510 /*···616583 */617584static int ad4695_read_one_sample(struct ad4695_state *st, unsigned int address)618585{619619- struct spi_transfer xfer[2] = { };620620- int ret, i = 0;586586+ struct spi_transfer xfers[2] = {587587+ {588588+ .speed_hz = AD4695_REG_ACCESS_SCLK_HZ,589589+ .bits_per_word = 16,590590+ .tx_buf = &st->cnv_cmd,591591+ .len = 2,592592+ },593593+ {594594+ /* Required delay between last SCLK and CNV/CS */595595+ .delay.value = AD4695_T_SCK_CNV_DELAY_NS,596596+ .delay.unit = SPI_DELAY_UNIT_NSECS,597597+ }598598+ };599599+ int ret;621600622601 ret = ad4695_set_single_cycle_mode(st, address);623602 if (ret)···637592638593 /*639594 * Setting the first channel to the temperature channel isn't supported640640- * in single-cycle mode, so we have to do an extra xfer to read the641641- * temperature.595595+ * in single-cycle mode, so we have to do an extra conversion to read596596+ * the temperature.642597 */643598 if (address == AD4695_CMD_TEMP_CHAN) {644644- /* We aren't reading, so we can make this a short xfer. */645645- st->cnv_cmd2 = AD4695_CMD_TEMP_CHAN << 3;646646- xfer[0].tx_buf = &st->cnv_cmd2;647647- xfer[0].len = 1;648648- xfer[0].cs_change = 1;649649- xfer[0].cs_change_delay.value = AD4695_T_CONVERT_NS;650650- xfer[0].cs_change_delay.unit = SPI_DELAY_UNIT_NSECS;599599+ st->cnv_cmd = AD4695_CMD_TEMP_CHAN << 11;651600652652- i = 1;601601+ ret = spi_sync_transfer(st->spi, xfers, ARRAY_SIZE(xfers));602602+ if (ret)603603+ return ret;653604 }654605655606 /* Then read the result and exit conversion mode. */656607 st->cnv_cmd = AD4695_CMD_EXIT_CNV_MODE << 11;657657- xfer[i].bits_per_word = 16;658658- xfer[i].tx_buf = &st->cnv_cmd;659659- xfer[i].rx_buf = &st->raw_data;660660- xfer[i].len = 2;608608+ xfers[0].rx_buf = &st->raw_data;661609662662- return spi_sync_transfer(st->spi, xfer, i + 1);610610+ return spi_sync_transfer(st->spi, xfers, ARRAY_SIZE(xfers));663611}664612665613static int ad4695_read_raw(struct iio_dev *indio_dev,
+3
drivers/iio/adc/ad7124.c
···917917 * set all channels to this default value.918918 */919919 ad7124_set_channel_odr(st, i, 10);920920+921921+ /* Disable all channels to prevent unintended conversions. */922922+ ad_sd_write_reg(&st->sd, AD7124_CHANNEL(i), 2, 0);920923 }921924922925 ret = ad_sd_write_reg(&st->sd, AD7124_ADC_CONTROL, 2, st->adc_control);
···368368 int ret;369369 int i, j = 0;370370371371+ memset(&data, 0, sizeof(data));372372+371373 mutex_lock(&info->lock);372374373375 iio_for_each_active_channel(i_dev, i) {
+8-5
drivers/iio/adc/stm32-dfsdm-adc.c
···691691 return -EINVAL;692692 }693693694694- ret = fwnode_property_read_string(node, "label", &ch->datasheet_name);695695- if (ret < 0) {696696- dev_err(&indio_dev->dev,697697- " Error parsing 'label' for idx %d\n", ch->channel);698698- return ret;694694+ if (fwnode_property_present(node, "label")) {695695+ /* label is optional */696696+ ret = fwnode_property_read_string(node, "label", &ch->datasheet_name);697697+ if (ret < 0) {698698+ dev_err(&indio_dev->dev,699699+ " Error parsing 'label' for idx %d\n", ch->channel);700700+ return ret;701701+ }699702 }700703701704 df_ch = &dfsdm->ch_list[ch->channel];
+3-1
drivers/iio/adc/ti-ads1119.c
···500500 struct iio_dev *indio_dev = pf->indio_dev;501501 struct ads1119_state *st = iio_priv(indio_dev);502502 struct {503503- unsigned int sample;503503+ s16 sample;504504 s64 timestamp __aligned(8);505505 } scan;506506 unsigned int index;507507 int ret;508508+509509+ memset(&scan, 0, sizeof(scan));508510509511 if (!iio_trigger_using_own(indio_dev)) {510512 index = find_first_bit(indio_dev->active_scan_mask,
···4848 int i = 0, j;4949 u16 *data;50505151- data = kmalloc(indio_dev->scan_bytes, GFP_KERNEL);5151+ data = kzalloc(indio_dev->scan_bytes, GFP_KERNEL);5252 if (!data)5353 goto done;5454
+9-2
drivers/iio/gyro/fxas21002c_core.c
···730730 int ret;731731732732 mutex_lock(&data->lock);733733- ret = regmap_bulk_read(data->regmap, FXAS21002C_REG_OUT_X_MSB,734734- data->buffer, CHANNEL_SCAN_MAX * sizeof(s16));733733+ ret = fxas21002c_pm_get(data);735734 if (ret < 0)736735 goto out_unlock;737736737737+ ret = regmap_bulk_read(data->regmap, FXAS21002C_REG_OUT_X_MSB,738738+ data->buffer, CHANNEL_SCAN_MAX * sizeof(s16));739739+ if (ret < 0)740740+ goto out_pm_put;741741+738742 iio_push_to_buffers_with_timestamp(indio_dev, data->buffer,739743 data->timestamp);744744+745745+out_pm_put:746746+ fxas21002c_pm_put(data);740747741748out_unlock:742749 mutex_unlock(&data->lock);
···5959 return -EINVAL;6060 chip = (uintptr_t)match;61616262- regmap = devm_regmap_init_spi(spi, &inv_icm42600_regmap_config);6262+ /* use SPI specific regmap */6363+ regmap = devm_regmap_init_spi(spi, &inv_icm42600_spi_regmap_config);6364 if (IS_ERR(regmap))6465 return PTR_ERR(regmap);6566
+1-1
drivers/iio/imu/kmx61.c
···11931193 struct kmx61_data *data = kmx61_get_data(indio_dev);11941194 int bit, ret, i = 0;11951195 u8 base;11961196- s16 buffer[8];11961196+ s16 buffer[8] = { };1197119711981198 if (indio_dev == data->acc_indio_dev)11991199 base = KMX61_ACC_XOUT_L;
+1-1
drivers/iio/inkern.c
···500500 return_ptr(chans);501501502502error_free_chans:503503- for (i = 0; i < nummaps; i++)503503+ for (i = 0; i < mapind; i++)504504 iio_device_put(chans[i].indio_dev);505505 return ERR_PTR(ret);506506}
+2
drivers/iio/light/bh1745.c
···746746 int i;747747 int j = 0;748748749749+ memset(&scan, 0, sizeof(scan));750750+749751 iio_for_each_active_channel(indio_dev, i) {750752 ret = regmap_bulk_read(data->regmap, BH1745_RED_LSB + 2 * i,751753 &value, 2);
···586586 } sample;587587 int err;588588589589+ memset(&sample, 0, sizeof(sample));590590+589591 if (test_bit(0, indio_dev->active_scan_mask)) {590592 /* Get current pressure from hardware FIFO. */591593 err = zpa2326_dequeue_pressure(indio_dev, &sample.pressure);
+2
drivers/iio/temperature/tmp006.c
···252252 } scan;253253 s32 ret;254254255255+ memset(&scan, 0, sizeof(scan));256256+255257 ret = i2c_smbus_read_word_data(data->client, TMP006_VOBJECT);256258 if (ret < 0)257259 goto err;
+1-1
drivers/iio/test/Kconfig
···5566# Keep in alphabetical order77config IIO_GTS_KUNIT_TEST88- tristate "Test IIO formatting functions" if !KUNIT_ALL_TESTS88+ tristate "Test IIO gain-time-scale helpers" if !KUNIT_ALL_TESTS99 depends on KUNIT1010 select IIO_GTS_HELPER1111 select TEST_KUNIT_DEVICE_HELPERS
+4
drivers/iio/test/iio-test-rescale.c
···652652 int rel_ppm;653653 int ret;654654655655+ KUNIT_ASSERT_NOT_ERR_OR_NULL(test, buff);656656+655657 rescale.numerator = t->numerator;656658 rescale.denominator = t->denominator;657659 rescale.offset = t->offset;···682680 struct rescale rescale;683681 int values[2];684682 int ret;683683+684684+ KUNIT_ASSERT_NOT_ERR_OR_NULL(test, buff_off);685685686686 rescale.numerator = t->numerator;687687 rescale.denominator = t->denominator;
+16
drivers/infiniband/core/cma.c
···690690 int bound_if_index = dev_addr->bound_dev_if;691691 int dev_type = dev_addr->dev_type;692692 struct net_device *ndev = NULL;693693+ struct net_device *pdev = NULL;693694694695 if (!rdma_dev_access_netns(device, id_priv->id.route.addr.dev_addr.net))695696 goto out;···715714716715 rcu_read_lock();717716 ndev = rcu_dereference(sgid_attr->ndev);717717+ if (ndev->ifindex != bound_if_index) {718718+ pdev = dev_get_by_index_rcu(dev_addr->net, bound_if_index);719719+ if (pdev) {720720+ if (is_vlan_dev(pdev)) {721721+ pdev = vlan_dev_real_dev(pdev);722722+ if (ndev->ifindex == pdev->ifindex)723723+ bound_if_index = pdev->ifindex;724724+ }725725+ if (is_vlan_dev(ndev)) {726726+ pdev = vlan_dev_real_dev(ndev);727727+ if (bound_if_index == pdev->ifindex)728728+ bound_if_index = ndev->ifindex;729729+ }730730+ }731731+ }718732 if (!net_eq(dev_net(ndev), dev_addr->net) ||719733 ndev->ifindex != bound_if_index) {720734 rdma_put_gid_attr(sgid_attr);
···114114 u32 size;115115};116116117117-#define BNXT_QPLIB_QP_MAX_SGL 6118117struct bnxt_qplib_swq {119118 u64 wr_id;120119 int next_idx;···153154#define BNXT_QPLIB_SWQE_FLAGS_UC_FENCE BIT(2)154155#define BNXT_QPLIB_SWQE_FLAGS_SOLICIT_EVENT BIT(3)155156#define BNXT_QPLIB_SWQE_FLAGS_INLINE BIT(4)156156- struct bnxt_qplib_sge sg_list[BNXT_QPLIB_QP_MAX_SGL];157157+ struct bnxt_qplib_sge sg_list[BNXT_VAR_MAX_SGE];157158 int num_sge;158159 /* Max inline data is 96 bytes */159160 u32 inline_len;···298299 u32 dest_qpn;299300 u8 smac[6];300301 u16 vlan_id;302302+ u16 port_id;301303 u8 nw_type;302304 struct bnxt_qplib_ah ah;303305
+3-2
drivers/infiniband/hw/bnxt_re/qplib_rcfw.c
···424424425425 /* Prevent posting if f/w is not in a state to process */426426 if (test_bit(ERR_DEVICE_DETACHED, &rcfw->cmdq.flags))427427- return bnxt_qplib_map_rc(opcode);427427+ return -ENXIO;428428+428429 if (test_bit(FIRMWARE_STALL_DETECTED, &cmdq->flags))429430 return -ETIMEDOUT;430431···494493495494 rc = __send_message_basic_sanity(rcfw, msg, opcode);496495 if (rc)497497- return rc;496496+ return rc == -ENXIO ? bnxt_qplib_map_rc(opcode) : rc;498497499498 rc = __send_message(rcfw, msg, opcode);500499 if (rc)
···931931 size_t count; /* max ba numbers */932932 int start; /* start buf offset in this hem */933933 int end; /* end buf offset in this hem */934934+ bool exist_bt;934935};935936936937/* All HEM items are linked in a tree structure */···960959 }961960 }962961962962+ hem->exist_bt = exist_bt;963963 hem->count = count;964964 hem->start = start;965965 hem->end = end;···971969}972970973971static void hem_list_free_item(struct hns_roce_dev *hr_dev,974974- struct hns_roce_hem_item *hem, bool exist_bt)972972+ struct hns_roce_hem_item *hem)975973{976976- if (exist_bt)974974+ if (hem->exist_bt)977975 dma_free_coherent(hr_dev->dev, hem->count * BA_BYTE_LEN,978976 hem->addr, hem->dma_addr);979977 kfree(hem);980978}981979982980static void hem_list_free_all(struct hns_roce_dev *hr_dev,983983- struct list_head *head, bool exist_bt)981981+ struct list_head *head)984982{985983 struct hns_roce_hem_item *hem, *temp_hem;986984987985 list_for_each_entry_safe(hem, temp_hem, head, list) {988986 list_del(&hem->list);989989- hem_list_free_item(hr_dev, hem, exist_bt);987987+ hem_list_free_item(hr_dev, hem);990988 }991989}992990···1086108410871085 for (i = 0; i < region_cnt; i++) {10881086 r = (struct hns_roce_buf_region *)®ions[i];10871087+ /* when r->hopnum = 0, the region should not occupy root_ba. */10881088+ if (!r->hopnum)10891089+ continue;10901090+10891091 if (r->hopnum > 1) {10901092 step = hem_list_calc_ba_range(r->hopnum, 1, unit);10911093 if (step > 0)···1183117711841178err_exit:11851179 for (level = 1; level < hopnum; level++)11861186- hem_list_free_all(hr_dev, &temp_list[level], true);11801180+ hem_list_free_all(hr_dev, &temp_list[level]);1187118111881182 return ret;11891183}···12241218{12251219 struct hns_roce_hem_item *hem;1226122012211221+ /* This is on the has_mtt branch, if r->hopnum12221222+ * is 0, there is no root_ba to reuse for the12231223+ * region's fake hem, so a dma_alloc request is12241224+ * necessary here.12251225+ */12271226 hem = hem_list_alloc_item(hr_dev, r->offset, r->offset + r->count - 1,12281228- r->count, false);12271227+ r->count, !r->hopnum);12291228 if (!hem)12301229 return -ENOMEM;1231123012321232- hem_list_assign_bt(hem, cpu_base, phy_base);12311231+ /* The root_ba can be reused only when r->hopnum > 0. */12321232+ if (r->hopnum)12331233+ hem_list_assign_bt(hem, cpu_base, phy_base);12331234 list_add(&hem->list, branch_head);12341235 list_add(&hem->sibling, leaf_head);1235123612361236- return r->count;12371237+ /* If r->hopnum == 0, 0 is returned,12381238+ * so that the root_bt entry is not occupied.12391239+ */12401240+ return r->hopnum ? r->count : 0;12371241}1238124212391243static int setup_middle_bt(struct hns_roce_dev *hr_dev, void *cpu_base,···12871271 return -ENOMEM;1288127212891273 total = 0;12901290- for (i = 0; i < region_cnt && total < max_ba_num; i++) {12741274+ for (i = 0; i < region_cnt && total <= max_ba_num; i++) {12911275 r = ®ions[i];12921276 if (!r->count)12931277 continue;···13531337 region_cnt);13541338 if (ret) {13551339 for (i = 0; i < region_cnt; i++)13561356- hem_list_free_all(hr_dev, &head.branch[i], false);13401340+ hem_list_free_all(hr_dev, &head.branch[i]);1357134113581358- hem_list_free_all(hr_dev, &head.root, true);13421342+ hem_list_free_all(hr_dev, &head.root);13591343 }1360134413611345 return ret;···1418140214191403 for (i = 0; i < HNS_ROCE_MAX_BT_REGION; i++)14201404 for (j = 0; j < HNS_ROCE_MAX_BT_LEVEL; j++)14211421- hem_list_free_all(hr_dev, &hem_list->mid_bt[i][j],14221422- j != 0);14051405+ hem_list_free_all(hr_dev, &hem_list->mid_bt[i][j]);1423140614241424- hem_list_free_all(hr_dev, &hem_list->root_bt, true);14071407+ hem_list_free_all(hr_dev, &hem_list->root_bt);14251408 INIT_LIST_HEAD(&hem_list->btm_bt);14261409 hem_list->root_ba = 0;14271410}
+9-2
drivers/infiniband/hw/hns/hns_roce_hw_v2.c
···468468 valid_num_sge = calc_wr_sge_num(wr, &msg_len);469469470470 ret = set_ud_opcode(ud_sq_wqe, wr);471471- if (WARN_ON(ret))471471+ if (WARN_ON_ONCE(ret))472472 return ret;473473474474 ud_sq_wqe->msg_len = cpu_to_le32(msg_len);···572572 rc_sq_wqe->msg_len = cpu_to_le32(msg_len);573573574574 ret = set_rc_opcode(hr_dev, rc_sq_wqe, wr);575575- if (WARN_ON(ret))575575+ if (WARN_ON_ONCE(ret))576576 return ret;577577578578 hr_reg_write(rc_sq_wqe, RC_SEND_WQE_SO,···670670#define HNS_ROCE_SL_SHIFT 2671671 struct hns_roce_v2_rc_send_wqe *rc_sq_wqe = wqe;672672673673+ if (unlikely(qp->state == IB_QPS_ERR)) {674674+ flush_cqe(hr_dev, qp);675675+ return;676676+ }673677 /* All kinds of DirectWQE have the same header field layout */674678 hr_reg_enable(rc_sq_wqe, RC_SEND_WQE_FLAG);675679 hr_reg_write(rc_sq_wqe, RC_SEND_WQE_DB_SL_L, qp->sl);···56225618 struct hns_roce_qp *hr_qp)56235619{56245620 struct hns_roce_dip *hr_dip = hr_qp->dip;56215621+56225622+ if (!hr_dip)56235623+ return;5625562456265625 xa_lock(&hr_dev->qp_table.dip_xa);56275626
-5
drivers/infiniband/hw/hns/hns_roce_mr.c
···814814 for (i = 0, mapped_cnt = 0; i < mtr->hem_cfg.region_count &&815815 mapped_cnt < page_cnt; i++) {816816 r = &mtr->hem_cfg.region[i];817817- /* if hopnum is 0, no need to map pages in this region */818818- if (!r->hopnum) {819819- mapped_cnt += r->count;820820- continue;821821- }822817823818 if (r->offset + r->count > page_cnt) {824819 ret = -EINVAL;
+5-3
drivers/infiniband/hw/mlx5/main.c
···28392839 int err;2840284028412841 *num_plane = 0;28422842- if (!MLX5_CAP_GEN(mdev, ib_virt))28422842+ if (!MLX5_CAP_GEN(mdev, ib_virt) || !MLX5_CAP_GEN_2(mdev, multiplane))28432843 return 0;2844284428452845 err = mlx5_query_hca_vport_context(mdev, 0, 1, 0, &vport_ctx);···36393639 list_for_each_entry(mpi, &mlx5_ib_unaffiliated_port_list,36403640 list) {36413641 if (dev->sys_image_guid == mpi->sys_image_guid &&36423642- (mlx5_core_native_port_num(mpi->mdev) - 1) == i) {36423642+ (mlx5_core_native_port_num(mpi->mdev) - 1) == i &&36433643+ mlx5_core_same_coredev_type(dev->mdev, mpi->mdev)) {36433644 bound = mlx5_ib_bind_slave_port(dev, mpi);36443645 }36453646···4786478547874786 mutex_lock(&mlx5_ib_multiport_mutex);47884787 list_for_each_entry(dev, &mlx5_ib_dev_list, ib_dev_list) {47894789- if (dev->sys_image_guid == mpi->sys_image_guid)47884788+ if (dev->sys_image_guid == mpi->sys_image_guid &&47894789+ mlx5_core_same_coredev_type(dev->mdev, mpi->mdev))47904790 bound = mlx5_ib_bind_slave_port(dev, mpi);4791479147924792 if (bound) {
+19-4
drivers/infiniband/sw/rxe/rxe.c
···4040/* initialize rxe device parameters */4141static void rxe_init_device_param(struct rxe_dev *rxe)4242{4343+ struct net_device *ndev;4444+4345 rxe->max_inline_data = RXE_MAX_INLINE_DATA;44464547 rxe->attr.vendor_id = RXE_VENDOR_ID;···7371 rxe->attr.max_fast_reg_page_list_len = RXE_MAX_FMR_PAGE_LIST_LEN;7472 rxe->attr.max_pkeys = RXE_MAX_PKEYS;7573 rxe->attr.local_ca_ack_delay = RXE_LOCAL_CA_ACK_DELAY;7474+7575+ ndev = rxe_ib_device_get_netdev(&rxe->ib_dev);7676+ if (!ndev)7777+ return;7878+7679 addrconf_addr_eui48((unsigned char *)&rxe->attr.sys_image_guid,7777- rxe->ndev->dev_addr);8080+ ndev->dev_addr);8181+8282+ dev_put(ndev);78837984 rxe->max_ucontext = RXE_MAX_UCONTEXT;8085}···118109static void rxe_init_ports(struct rxe_dev *rxe)119110{120111 struct rxe_port *port = &rxe->port;112112+ struct net_device *ndev;121113122114 rxe_init_port_param(port);115115+ ndev = rxe_ib_device_get_netdev(&rxe->ib_dev);116116+ if (!ndev)117117+ return;123118 addrconf_addr_eui48((unsigned char *)&port->port_guid,124124- rxe->ndev->dev_addr);119119+ ndev->dev_addr);120120+ dev_put(ndev);125121 spin_lock_init(&port->port_lock);126122}127123···181167/* called by ifc layer to create new rxe device.182168 * The caller should allocate memory for rxe by calling ib_alloc_device.183169 */184184-int rxe_add(struct rxe_dev *rxe, unsigned int mtu, const char *ibdev_name)170170+int rxe_add(struct rxe_dev *rxe, unsigned int mtu, const char *ibdev_name,171171+ struct net_device *ndev)185172{186173 rxe_init(rxe);187174 rxe_set_mtu(rxe, mtu);188175189189- return rxe_register_device(rxe, ibdev_name);176176+ return rxe_register_device(rxe, ibdev_name, ndev);190177}191178192179static int rxe_newlink(const char *ibdev_name, struct net_device *ndev)
···4646 */4747#define SIW_IRQ_MAXBURST_SQ_ACTIVE 448484949+/* There is always only a port 1 per siw device */5050+#define SIW_PORT 15151+4952struct siw_dev_cap {5053 int max_qp;5154 int max_qp_wr;···72697370struct siw_device {7471 struct ib_device base_dev;7575- struct net_device *netdev;7672 struct siw_dev_cap attrs;77737874 u32 vendor_part_id;7975 int numa_node;8076 char raw_gid[ETH_ALEN];8181-8282- /* physical port state (only one port per device) */8383- enum ib_port_state state;84778578 spinlock_t lock;8679
+21-6
drivers/infiniband/sw/siw/siw_cm.c
···17591759{17601760 struct socket *s;17611761 struct siw_cep *cep = NULL;17621762+ struct net_device *ndev = NULL;17621763 struct siw_device *sdev = to_siw_dev(id->device);17631764 int addr_family = id->local_addr.ss_family;17641765 int rv = 0;···17801779 struct sockaddr_in *laddr = &to_sockaddr_in(id->local_addr);1781178017821781 /* For wildcard addr, limit binding to current device only */17831783- if (ipv4_is_zeronet(laddr->sin_addr.s_addr))17841784- s->sk->sk_bound_dev_if = sdev->netdev->ifindex;17851785-17821782+ if (ipv4_is_zeronet(laddr->sin_addr.s_addr)) {17831783+ ndev = ib_device_get_netdev(id->device, SIW_PORT);17841784+ if (ndev) {17851785+ s->sk->sk_bound_dev_if = ndev->ifindex;17861786+ } else {17871787+ rv = -ENODEV;17881788+ goto error;17891789+ }17901790+ }17861791 rv = s->ops->bind(s, (struct sockaddr *)laddr,17871792 sizeof(struct sockaddr_in));17881793 } else {···18041797 }1805179818061799 /* For wildcard addr, limit binding to current device only */18071807- if (ipv6_addr_any(&laddr->sin6_addr))18081808- s->sk->sk_bound_dev_if = sdev->netdev->ifindex;18091809-18001800+ if (ipv6_addr_any(&laddr->sin6_addr)) {18011801+ ndev = ib_device_get_netdev(id->device, SIW_PORT);18021802+ if (ndev) {18031803+ s->sk->sk_bound_dev_if = ndev->ifindex;18041804+ } else {18051805+ rv = -ENODEV;18061806+ goto error;18071807+ }18081808+ }18101809 rv = s->ops->bind(s, (struct sockaddr *)laddr,18111810 sizeof(struct sockaddr_in6));18121811 }···18731860 }18741861 list_add_tail(&cep->listenq, (struct list_head *)id->provider_data);18751862 cep->state = SIW_EPSTATE_LISTENING;18631863+ dev_put(ndev);1876186418771865 siw_dbg(id->device, "Listen at laddr %pISp\n", &id->local_addr);18781866···18931879 siw_cep_set_free_and_put(cep);18941880 }18951881 sock_release(s);18821882+ dev_put(ndev);1896188318971884 return rv;18981885}
+1-14
drivers/infiniband/sw/siw/siw_main.c
···287287 return NULL;288288289289 base_dev = &sdev->base_dev;290290- sdev->netdev = netdev;291290292291 if (netdev->addr_len) {293292 memcpy(sdev->raw_gid, netdev->dev_addr,···380381381382 switch (event) {382383 case NETDEV_UP:383383- sdev->state = IB_PORT_ACTIVE;384384 siw_port_event(sdev, 1, IB_EVENT_PORT_ACTIVE);385385 break;386386387387 case NETDEV_DOWN:388388- sdev->state = IB_PORT_DOWN;389388 siw_port_event(sdev, 1, IB_EVENT_PORT_ERR);390389 break;391390···404407 siw_port_event(sdev, 1, IB_EVENT_LID_CHANGE);405408 break;406409 /*407407- * Todo: Below netdev events are currently not handled.410410+ * All other events are not handled408411 */409409- case NETDEV_CHANGEMTU:410410- case NETDEV_CHANGE:411411- break;412412-413412 default:414413 break;415414 }···435442 sdev = siw_device_create(netdev);436443 if (sdev) {437444 dev_dbg(&netdev->dev, "siw: new device\n");438438-439439- if (netif_running(netdev) && netif_carrier_ok(netdev))440440- sdev->state = IB_PORT_ACTIVE;441441- else442442- sdev->state = IB_PORT_DOWN;443443-444445 ib_mark_name_assigned_by_user(&sdev->base_dev);445446 rv = siw_device_register(sdev, basedev_name);446447 if (rv)
···18671867 struct sdhci_msm_host *msm_host = sdhci_pltfm_priv(pltfm_host);18681868 union cqhci_crypto_cap_entry cap;1869186918701870+ if (!(cfg->config_enable & CQHCI_CRYPTO_CONFIGURATION_ENABLE))18711871+ return qcom_ice_evict_key(msm_host->ice, slot);18721872+18701873 /* Only AES-256-XTS has been tested so far. */18711874 cap = cq_host->crypto_cap_array[cfg->crypto_cap_idx];18721875 if (cap.algorithm_id != CQHCI_CRYPTO_ALG_AES_XTS ||18731876 cap.key_size != CQHCI_CRYPTO_KEY_SIZE_256)18741877 return -EINVAL;1875187818761876- if (cfg->config_enable & CQHCI_CRYPTO_CONFIGURATION_ENABLE)18771877- return qcom_ice_program_key(msm_host->ice,18781878- QCOM_ICE_CRYPTO_ALG_AES_XTS,18791879- QCOM_ICE_CRYPTO_KEY_SIZE_256,18801880- cfg->crypto_key,18811881- cfg->data_unit_size, slot);18821882- else18831883- return qcom_ice_evict_key(msm_host->ice, slot);18791879+ return qcom_ice_program_key(msm_host->ice,18801880+ QCOM_ICE_CRYPTO_ALG_AES_XTS,18811881+ QCOM_ICE_CRYPTO_KEY_SIZE_256,18821882+ cfg->crypto_key,18831883+ cfg->data_unit_size, slot);18841884}1885188518861886#else /* CONFIG_MMC_CRYPTO */
+9-2
drivers/mtd/nand/raw/arasan-nand-controller.c
···14091409 * case, the "not" chosen CS is assigned to nfc->spare_cs and selected14101410 * whenever a GPIO CS must be asserted.14111411 */14121412- if (nfc->cs_array && nfc->ncs > 2) {14131413- if (!nfc->cs_array[0] && !nfc->cs_array[1]) {14121412+ if (nfc->cs_array) {14131413+ if (nfc->ncs > 2 && !nfc->cs_array[0] && !nfc->cs_array[1]) {14141414 dev_err(nfc->dev,14151415 "Assign a single native CS when using GPIOs\n");14161416 return -EINVAL;···1478147814791479static void anfc_remove(struct platform_device *pdev)14801480{14811481+ int i;14811482 struct arasan_nfc *nfc = platform_get_drvdata(pdev);14831483+14841484+ for (i = 0; i < nfc->ncs; i++) {14851485+ if (nfc->cs_array[i]) {14861486+ gpiod_put(nfc->cs_array[i]);14871487+ }14881488+ }1482148914831490 anfc_chips_cleanup(nfc);14841491}
···254254255255/**256256 * omap_nand_data_in_pref - NAND data in using prefetch engine257257+ * @chip: NAND chip258258+ * @buf: output buffer where NAND data is placed into259259+ * @len: length of transfer260260+ * @force_8bit: force 8-bit transfers257261 */258262static void omap_nand_data_in_pref(struct nand_chip *chip, void *buf,259263 unsigned int len, bool force_8bit)···301297302298/**303299 * omap_nand_data_out_pref - NAND data out using Write Posting engine300300+ * @chip: NAND chip301301+ * @buf: input buffer that is sent to NAND302302+ * @len: length of transfer303303+ * @force_8bit: force 8-bit transfers304304 */305305static void omap_nand_data_out_pref(struct nand_chip *chip,306306 const void *buf, unsigned int len,···448440449441/**450442 * omap_nand_data_in_dma_pref - NAND data in using DMA and Prefetch443443+ * @chip: NAND chip444444+ * @buf: output buffer where NAND data is placed into445445+ * @len: length of transfer446446+ * @force_8bit: force 8-bit transfers451447 */452448static void omap_nand_data_in_dma_pref(struct nand_chip *chip, void *buf,453449 unsigned int len, bool force_8bit)···472460473461/**474462 * omap_nand_data_out_dma_pref - NAND data out using DMA and write posting463463+ * @chip: NAND chip464464+ * @buf: input buffer that is sent to NAND465465+ * @len: length of transfer466466+ * @force_8bit: force 8-bit transfers475467 */476468static void omap_nand_data_out_dma_pref(struct nand_chip *chip,477469 const void *buf, unsigned int len,
+36-11
drivers/net/dsa/microchip/ksz9477.c
···22/*33 * Microchip KSZ9477 switch driver main logic44 *55- * Copyright (C) 2017-2019 Microchip Technology Inc.55+ * Copyright (C) 2017-2024 Microchip Technology Inc.66 */7788#include <linux/kernel.h>···983983int ksz9477_set_ageing_time(struct ksz_device *dev, unsigned int msecs)984984{985985 u32 secs = msecs / 1000;986986- u8 value;987987- u8 data;986986+ u8 data, mult, value;987987+ u32 max_val;988988 int ret;989989990990- value = FIELD_GET(SW_AGE_PERIOD_7_0_M, secs);990990+#define MAX_TIMER_VAL ((1 << 8) - 1)991991992992- ret = ksz_write8(dev, REG_SW_LUE_CTRL_3, value);993993- if (ret < 0)994994- return ret;992992+ /* The aging timer comprises a 3-bit multiplier and an 8-bit second993993+ * value. Either of them cannot be zero. The maximum timer is then994994+ * 7 * 255 = 1785 seconds.995995+ */996996+ if (!secs)997997+ secs = 1;995998996996- data = FIELD_GET(SW_AGE_PERIOD_10_8_M, secs);999999+ /* Return error if too large. */10001000+ else if (secs > 7 * MAX_TIMER_VAL)10011001+ return -EINVAL;99710029981003 ret = ksz_read8(dev, REG_SW_LUE_CTRL_0, &value);9991004 if (ret < 0)10001005 return ret;1001100610021002- value &= ~SW_AGE_CNT_M;10031003- value |= FIELD_PREP(SW_AGE_CNT_M, data);10071007+ /* Check whether there is need to update the multiplier. */10081008+ mult = FIELD_GET(SW_AGE_CNT_M, value);10091009+ max_val = MAX_TIMER_VAL;10101010+ if (mult > 0) {10111011+ /* Try to use the same multiplier already in the register as10121012+ * the hardware default uses multiplier 4 and 75 seconds for10131013+ * 300 seconds.10141014+ */10151015+ max_val = DIV_ROUND_UP(secs, mult);10161016+ if (max_val > MAX_TIMER_VAL || max_val * mult != secs)10171017+ max_val = MAX_TIMER_VAL;10181018+ }1004101910051005- return ksz_write8(dev, REG_SW_LUE_CTRL_0, value);10201020+ data = DIV_ROUND_UP(secs, max_val);10211021+ if (mult != data) {10221022+ value &= ~SW_AGE_CNT_M;10231023+ value |= FIELD_PREP(SW_AGE_CNT_M, data);10241024+ ret = ksz_write8(dev, REG_SW_LUE_CTRL_0, value);10251025+ if (ret < 0)10261026+ return ret;10271027+ }10281028+10291029+ value = DIV_ROUND_UP(secs, data);10301030+ return ksz_write8(dev, REG_SW_LUE_CTRL_3, value);10061031}1007103210081033void ksz9477_port_queue_split(struct ksz_device *dev, int port)
···11// SPDX-License-Identifier: GPL-2.022/* Microchip LAN937X switch driver main logic33- * Copyright (C) 2019-2022 Microchip Technology Inc.33+ * Copyright (C) 2019-2024 Microchip Technology Inc.44 */55#include <linux/kernel.h>66#include <linux/module.h>···461461462462int lan937x_set_ageing_time(struct ksz_device *dev, unsigned int msecs)463463{464464- u32 secs = msecs / 1000;465465- u32 value;464464+ u8 data, mult, value8;465465+ bool in_msec = false;466466+ u32 max_val, value;467467+ u32 secs = msecs;466468 int ret;469469+470470+#define MAX_TIMER_VAL ((1 << 20) - 1)471471+472472+ /* The aging timer comprises a 3-bit multiplier and a 20-bit second473473+ * value. Either of them cannot be zero. The maximum timer is then474474+ * 7 * 1048575 = 7340025 seconds. As this value is too large for475475+ * practical use it can be interpreted as microseconds, making the476476+ * maximum timer 7340 seconds with finer control. This allows for477477+ * maximum 122 minutes compared to 29 minutes in KSZ9477 switch.478478+ */479479+ if (msecs % 1000)480480+ in_msec = true;481481+ else482482+ secs /= 1000;483483+ if (!secs)484484+ secs = 1;485485+486486+ /* Return error if too large. */487487+ else if (secs > 7 * MAX_TIMER_VAL)488488+ return -EINVAL;489489+490490+ /* Configure how to interpret the number value. */491491+ ret = ksz_rmw8(dev, REG_SW_LUE_CTRL_2, SW_AGE_CNT_IN_MICROSEC,492492+ in_msec ? SW_AGE_CNT_IN_MICROSEC : 0);493493+ if (ret < 0)494494+ return ret;495495+496496+ ret = ksz_read8(dev, REG_SW_LUE_CTRL_0, &value8);497497+ if (ret < 0)498498+ return ret;499499+500500+ /* Check whether there is need to update the multiplier. */501501+ mult = FIELD_GET(SW_AGE_CNT_M, value8);502502+ max_val = MAX_TIMER_VAL;503503+ if (mult > 0) {504504+ /* Try to use the same multiplier already in the register as505505+ * the hardware default uses multiplier 4 and 75 seconds for506506+ * 300 seconds.507507+ */508508+ max_val = DIV_ROUND_UP(secs, mult);509509+ if (max_val > MAX_TIMER_VAL || max_val * mult != secs)510510+ max_val = MAX_TIMER_VAL;511511+ }512512+513513+ data = DIV_ROUND_UP(secs, max_val);514514+ if (mult != data) {515515+ value8 &= ~SW_AGE_CNT_M;516516+ value8 |= FIELD_PREP(SW_AGE_CNT_M, data);517517+ ret = ksz_write8(dev, REG_SW_LUE_CTRL_0, value8);518518+ if (ret < 0)519519+ return ret;520520+ }521521+522522+ secs = DIV_ROUND_UP(secs, data);467523468524 value = FIELD_GET(SW_AGE_PERIOD_7_0_M, secs);469525
···6542654265436543 mlx5_core_uplink_netdev_set(mdev, NULL);65446544 mlx5e_dcbnl_delete_app(priv);65456545- unregister_netdev(priv->netdev);65466546- _mlx5e_suspend(adev, false);65456545+ /* When unload driver, the netdev is in registered state65466546+ * if it's from legacy mode. If from switchdev mode, it65476547+ * is already unregistered before changing to NIC profile.65486548+ */65496549+ if (priv->netdev->reg_state == NETREG_REGISTERED) {65506550+ unregister_netdev(priv->netdev);65516551+ _mlx5e_suspend(adev, false);65526552+ } else {65536553+ struct mlx5_core_dev *pos;65546554+ int i;65556555+65566556+ if (test_bit(MLX5E_STATE_DESTROYING, &priv->state))65576557+ mlx5_sd_for_each_dev(i, mdev, pos)65586558+ mlx5e_destroy_mdev_resources(pos);65596559+ else65606560+ _mlx5e_suspend(adev, true);65616561+ }65476562 /* Avoid cleanup if profile rollback failed. */65486563 if (priv->profile)65496564 priv->profile->cleanup(priv);
+15
drivers/net/ethernet/mellanox/mlx5/core/en_rep.c
···1509150915101510 priv = netdev_priv(netdev);1511151115121512+ /* This bit is set when using devlink to change eswitch mode from15131513+ * switchdev to legacy. As need to keep uplink netdev ifindex, we15141514+ * detach uplink representor profile and attach NIC profile only.15151515+ * The netdev will be unregistered later when unload NIC auxiliary15161516+ * driver for this case.15171517+ * We explicitly block devlink eswitch mode change if any IPSec rules15181518+ * offloaded, but can't block other cases, such as driver unload15191519+ * and devlink reload. We have to unregister netdev before profile15201520+ * change for those cases. This is to avoid resource leak because15211521+ * the offloaded rules don't have the chance to be unoffloaded before15221522+ * cleanup which is triggered by detach uplink representor profile.15231523+ */15241524+ if (!(priv->mdev->priv.flags & MLX5_PRIV_FLAGS_SWITCH_LEGACY))15251525+ unregister_netdev(netdev);15261526+15121527 mlx5e_netdev_attach_nic_profile(priv);15131528}15141529
···5353#include "lag/lag.h"5454#include "en/tc/post_meter.h"55555656-#define mlx5_esw_for_each_rep(esw, i, rep) \5757- xa_for_each(&((esw)->offloads.vport_reps), i, rep)5858-5956/* There are two match-all miss flows, one for unicast dst mac and6057 * one for multicast.6158 */···37773780 esw->eswitch_operation_in_progress = true;37783781 up_write(&esw->mode_lock);3779378237833783+ if (mode == DEVLINK_ESWITCH_MODE_LEGACY)37843784+ esw->dev->priv.flags |= MLX5_PRIV_FLAGS_SWITCH_LEGACY;37803785 mlx5_eswitch_disable_locked(esw);37813786 if (mode == DEVLINK_ESWITCH_MODE_SWITCHDEV) {37823787 if (mlx5_devlink_trap_get_num_active(esw->dev)) {
···4747#define FBNIC_LINK_MODE_PAM4 (FBNIC_LINK_50R1)4848#define FBNIC_LINK_MODE_MASK (FBNIC_LINK_AUTO - 1)49495050-enum fbnic_sensor_id {5151- FBNIC_SENSOR_TEMP, /* Temp in millidegrees Centigrade */5252- FBNIC_SENSOR_VOLTAGE, /* Voltage in millivolts */5353-};5454-5550/* This structure defines the interface hooks for the MAC. The MAC hooks5651 * will be configured as a const struct provided with a set of function5752 * pointers.···83888489 void (*link_down)(struct fbnic_dev *fbd);8590 void (*link_up)(struct fbnic_dev *fbd, bool tx_pause, bool rx_pause);8686-8787- int (*get_sensor)(struct fbnic_dev *fbd, int id, long *val);8891};89929093int fbnic_mac_init(struct fbnic_dev *fbd);
-3
drivers/net/ethernet/meta/fbnic/fbnic_pci.c
···296296 /* Capture snapshot of hardware stats so netdev can calculate delta */297297 fbnic_reset_hw_stats(fbd);298298299299- fbnic_hwmon_register(fbd);300300-301299 if (!fbd->dsn) {302300 dev_warn(&pdev->dev, "Reading serial number failed\n");303301 goto init_failure_mode;···358360 fbnic_netdev_free(fbd);359361 }360362361361- fbnic_hwmon_unregister(fbd);362363 fbnic_dbg_fbd_exit(fbd);363364 fbnic_devlink_unregister(fbd);364365 fbnic_fw_disable_mbx(fbd);
···334334 status = read_poll_timeout(rd32, hicr, hicr & WX_MNG_MBOX_CTL_FWRDY, 1000,335335 timeout * 1000, false, wx, WX_MNG_MBOX_CTL);336336337337+ buf[0] = rd32(wx, WX_MNG_MBOX);338338+ if ((buf[0] & 0xff0000) >> 16 == 0x80) {339339+ wx_err(wx, "Unknown FW command: 0x%x\n", buffer[0] & 0xff);340340+ status = -EINVAL;341341+ goto rel_out;342342+ }343343+337344 /* Check command completion */338345 if (status) {339339- wx_dbg(wx, "Command has failed with no status valid.\n");340340-341341- buf[0] = rd32(wx, WX_MNG_MBOX);342342- if ((buffer[0] & 0xff) != (~buf[0] >> 24)) {343343- status = -EINVAL;344344- goto rel_out;345345- }346346- if ((buf[0] & 0xff0000) >> 16 == 0x80) {347347- wx_dbg(wx, "It's unknown cmd.\n");348348- status = -EINVAL;349349- goto rel_out;350350- }351351-346346+ wx_err(wx, "Command has failed with no status valid.\n");352347 wx_dbg(wx, "write value:\n");353348 for (i = 0; i < dword_len; i++)354349 wx_dbg(wx, "%x ", buffer[i]);355350 wx_dbg(wx, "read value:\n");356351 for (i = 0; i < dword_len; i++)357352 wx_dbg(wx, "%x ", buf[i]);353353+ wx_dbg(wx, "\ncheck: %x %x\n", buffer[0] & 0xff, ~buf[0] >> 24);354354+355355+ goto rel_out;358356 }359357360358 if (!return_data)
+5-1
drivers/net/ieee802154/ca8210.c
···30723072 spi_set_drvdata(priv->spi, priv);30733073 if (IS_ENABLED(CONFIG_IEEE802154_CA8210_DEBUGFS)) {30743074 cascoda_api_upstream = ca8210_test_int_driver_write;30753075- ca8210_test_interface_init(priv);30753075+ ret = ca8210_test_interface_init(priv);30763076+ if (ret) {30773077+ dev_crit(&spi_device->dev, "ca8210_test_interface_init failed\n");30783078+ goto error;30793079+ }30763080 } else {30773081 cascoda_api_upstream = NULL;30783082 }
+4
drivers/net/mctp/mctp-i3c.c
···125125126126 xfer.data.in = skb_put(skb, mi->mrl);127127128128+ /* Make sure netif_rx() is read in the same order as i3c. */129129+ mutex_lock(&mi->lock);128130 rc = i3c_device_do_priv_xfers(mi->i3c, &xfer, 1);129131 if (rc < 0)130132 goto err;···168166 stats->rx_dropped++;169167 }170168169169+ mutex_unlock(&mi->lock);171170 return 0;172171err:172172+ mutex_unlock(&mi->lock);173173 kfree_skb(skb);174174 return rc;175175}
+101-13
drivers/net/phy/micrel.c
···432432struct kszphy_priv {433433 struct kszphy_ptp_priv ptp_priv;434434 const struct kszphy_type *type;435435+ struct clk *clk;435436 int led_mode;436437 u16 vct_ctrl1000;437438 bool rmii_ref_clk_sel;438439 bool rmii_ref_clk_sel_val;440440+ bool clk_enable;439441 u64 stats[ARRAY_SIZE(kszphy_hw_stats)];440442};441443···20522050 data[i] = kszphy_get_stat(phydev, i);20532051}2054205220532053+static void kszphy_enable_clk(struct phy_device *phydev)20542054+{20552055+ struct kszphy_priv *priv = phydev->priv;20562056+20572057+ if (!priv->clk_enable && priv->clk) {20582058+ clk_prepare_enable(priv->clk);20592059+ priv->clk_enable = true;20602060+ }20612061+}20622062+20632063+static void kszphy_disable_clk(struct phy_device *phydev)20642064+{20652065+ struct kszphy_priv *priv = phydev->priv;20662066+20672067+ if (priv->clk_enable && priv->clk) {20682068+ clk_disable_unprepare(priv->clk);20692069+ priv->clk_enable = false;20702070+ }20712071+}20722072+20732073+static int kszphy_generic_resume(struct phy_device *phydev)20742074+{20752075+ kszphy_enable_clk(phydev);20762076+20772077+ return genphy_resume(phydev);20782078+}20792079+20802080+static int kszphy_generic_suspend(struct phy_device *phydev)20812081+{20822082+ int ret;20832083+20842084+ ret = genphy_suspend(phydev);20852085+ if (ret)20862086+ return ret;20872087+20882088+ kszphy_disable_clk(phydev);20892089+20902090+ return 0;20912091+}20922092+20552093static int kszphy_suspend(struct phy_device *phydev)20562094{20572095 /* Disable PHY Interrupts */···21012059 phydev->drv->config_intr(phydev);21022060 }2103206121042104- return genphy_suspend(phydev);20622062+ return kszphy_generic_suspend(phydev);21052063}2106206421072065static void kszphy_parse_led_mode(struct phy_device *phydev)···21322090{21332091 int ret;2134209221352135- genphy_resume(phydev);20932093+ ret = kszphy_generic_resume(phydev);20942094+ if (ret)20952095+ return ret;2136209621372097 /* After switching from power-down to normal mode, an internal global21382098 * reset is automatically generated. Wait a minimum of 1 ms before···21522108 if (phydev->drv->config_intr)21532109 phydev->drv->config_intr(phydev);21542110 }21112111+21122112+ return 0;21132113+}21142114+21152115+/* Because of errata DS80000700A, receiver error following software21162116+ * power down. Suspend and resume callbacks only disable and enable21172117+ * external rmii reference clock.21182118+ */21192119+static int ksz8041_resume(struct phy_device *phydev)21202120+{21212121+ kszphy_enable_clk(phydev);21222122+21232123+ return 0;21242124+}21252125+21262126+static int ksz8041_suspend(struct phy_device *phydev)21272127+{21282128+ kszphy_disable_clk(phydev);2155212921562130 return 0;21572131}···22212159 if (!(ret & BMCR_PDOWN))22222160 return 0;2223216122242224- genphy_resume(phydev);21622162+ ret = kszphy_generic_resume(phydev);21632163+ if (ret)21642164+ return ret;21652165+22252166 usleep_range(1000, 2000);2226216722272168 /* Re-program the value after chip is reset. */···22402175 }2241217622422177 return 0;21782178+}21792179+21802180+static int ksz8061_suspend(struct phy_device *phydev)21812181+{21822182+ return kszphy_suspend(phydev);22432183}2244218422452185static int kszphy_probe(struct phy_device *phydev)···22872217 } else if (!clk) {22882218 /* unnamed clock from the generic ethernet-phy binding */22892219 clk = devm_clk_get_optional_enabled(&phydev->mdio.dev, NULL);22902290- if (IS_ERR(clk))22912291- return PTR_ERR(clk);22922220 }22212221+22222222+ if (IS_ERR(clk))22232223+ return PTR_ERR(clk);22242224+22252225+ clk_disable_unprepare(clk);22262226+ priv->clk = clk;2293222722942228 if (ksz8041_fiber_mode(phydev))22952229 phydev->port = PORT_FIBRE;···53645290 return 0;53655291}5366529252935293+static int lan8804_resume(struct phy_device *phydev)52945294+{52955295+ return kszphy_resume(phydev);52965296+}52975297+52985298+static int lan8804_suspend(struct phy_device *phydev)52995299+{53005300+ return kszphy_generic_suspend(phydev);53015301+}53025302+53035303+static int lan8841_resume(struct phy_device *phydev)53045304+{53055305+ return kszphy_generic_resume(phydev);53065306+}53075307+53675308static int lan8841_suspend(struct phy_device *phydev)53685309{53695310 struct kszphy_priv *priv = phydev->priv;···53875298 if (ptp_priv->ptp_clock)53885299 ptp_cancel_worker_sync(ptp_priv->ptp_clock);5389530053905390- return genphy_suspend(phydev);53015301+ return kszphy_generic_suspend(phydev);53915302}5392530353935304static struct phy_driver ksphy_driver[] = {···54475358 .get_sset_count = kszphy_get_sset_count,54485359 .get_strings = kszphy_get_strings,54495360 .get_stats = kszphy_get_stats,54505450- /* No suspend/resume callbacks because of errata DS80000700A,54515451- * receiver error following software power down.54525452- */53615361+ .suspend = ksz8041_suspend,53625362+ .resume = ksz8041_resume,54535363}, {54545364 .phy_id = PHY_ID_KSZ8041RNLI,54555365 .phy_id_mask = MICREL_PHY_ID_MASK,···55245436 .soft_reset = genphy_soft_reset,55255437 .config_intr = kszphy_config_intr,55265438 .handle_interrupt = kszphy_handle_interrupt,55275527- .suspend = kszphy_suspend,54395439+ .suspend = ksz8061_suspend,55285440 .resume = ksz8061_resume,55295441}, {55305442 .phy_id = PHY_ID_KSZ9021,···55955507 .get_sset_count = kszphy_get_sset_count,55965508 .get_strings = kszphy_get_strings,55975509 .get_stats = kszphy_get_stats,55985598- .suspend = genphy_suspend,55995599- .resume = kszphy_resume,55105510+ .suspend = lan8804_suspend,55115511+ .resume = lan8804_resume,56005512 .config_intr = lan8804_config_intr,56015513 .handle_interrupt = lan8804_handle_interrupt,56025514}, {···56145526 .get_strings = kszphy_get_strings,56155527 .get_stats = kszphy_get_stats,56165528 .suspend = lan8841_suspend,56175617- .resume = genphy_resume,55295529+ .resume = lan8841_resume,56185530 .cable_test_start = lan8814_cable_test_start,56195531 .cable_test_get_status = ksz886x_cable_test_get_status,56205532}, {
+4-12
drivers/net/pse-pd/tps23881.c
···6464 if (id >= TPS23881_MAX_CHANS)6565 return -ERANGE;66666767- ret = i2c_smbus_read_word_data(client, TPS23881_REG_PW_STATUS);6868- if (ret < 0)6969- return ret;7070-7167 chan = priv->port[id].chan[0];7268 if (chan < 4)7373- val = (u16)(ret | BIT(chan));6969+ val = BIT(chan);7470 else7575- val = (u16)(ret | BIT(chan + 4));7171+ val = BIT(chan + 4);76727773 if (priv->port[id].is_4p) {7874 chan = priv->port[id].chan[1];···96100 if (id >= TPS23881_MAX_CHANS)97101 return -ERANGE;981029999- ret = i2c_smbus_read_word_data(client, TPS23881_REG_PW_STATUS);100100- if (ret < 0)101101- return ret;102102-103103 chan = priv->port[id].chan[0];104104 if (chan < 4)105105- val = (u16)(ret | BIT(chan + 4));105105+ val = BIT(chan + 4);106106 else107107- val = (u16)(ret | BIT(chan + 8));107107+ val = BIT(chan + 8);108108109109 if (priv->port[id].is_4p) {110110 chan = priv->port[id].chan[1];
···29542954 int idx)29552955{29562956 int i;29572957+ int n_channels = 0;2957295829582959 if (fw_has_api(&mvm->fw->ucode_capa,29592960 IWL_UCODE_TLV_API_SCAN_OFFLOAD_CHANS)) {···2963296229642963 for (i = 0; i < SCAN_OFFLOAD_MATCHING_CHANNELS_LEN * 8; i++)29652964 if (matches[idx].matching_channels[i / 8] & (BIT(i % 8)))29662966- match->channels[match->n_channels++] =29652965+ match->channels[n_channels++] =29672966 mvm->nd_channels[i]->center_freq;29682967 } else {29692968 struct iwl_scan_offload_profile_match_v1 *matches =···2971297029722971 for (i = 0; i < SCAN_OFFLOAD_MATCHING_CHANNELS_LEN_V1 * 8; i++)29732972 if (matches[idx].matching_channels[i / 8] & (BIT(i % 8)))29742974- match->channels[match->n_channels++] =29732973+ match->channels[n_channels++] =29752974 mvm->nd_channels[i]->center_freq;29762975 }29762976+ /* We may have ended up with fewer channels than we allocated. */29772977+ match->n_channels = n_channels;29772978}2978297929792980/**···30563053 GFP_KERNEL);30573054 if (!net_detect || !n_matches)30583055 goto out_report_nd;30563056+ net_detect->n_matches = n_matches;30573057+ n_matches = 0;3059305830603059 for_each_set_bit(i, &matched_profiles, mvm->n_nd_match_sets) {30613060 struct cfg80211_wowlan_nd_match *match;···30713066 GFP_KERNEL);30723067 if (!match)30733068 goto out_report_nd;30693069+ match->n_channels = n_channels;3074307030753075- net_detect->matches[net_detect->n_matches++] = match;30713071+ net_detect->matches[n_matches++] = match;3076307230773073 /* We inverted the order of the SSIDs in the scan30783074 * request, so invert the index here.···3088308230893083 iwl_mvm_query_set_freqs(mvm, d3_data->nd_results, match, i);30903084 }30853085+ /* We may have fewer matches than we allocated. */30863086+ net_detect->n_matches = n_matches;3091308730923088out_report_nd:30933089 wakeup.net_detect = net_detect;
···6060 goto success;6161 }62626363- xa_for_each(&ctrl->subsys->namespaces, idx, ns) {6363+ nvmet_for_each_enabled_ns(&ctrl->subsys->namespaces, idx, ns) {6464 if (ns->pr.enable)6565 WRITE_ONCE(ns->pr.notify_mask, mask);6666 }···10561056 * nvmet_pr_init_ns(), see more details in nvmet_ns_enable().10571057 * So just check ns->pr.enable.10581058 */10591059- xa_for_each(&subsys->namespaces, idx, ns) {10591059+ nvmet_for_each_enabled_ns(&subsys->namespaces, idx, ns) {10601060 if (ns->pr.enable) {10611061 ret = nvmet_pr_alloc_and_insert_pc_ref(ns, ctrl->cntlid,10621062 &ctrl->hostid);···10671067 return 0;1068106810691069free_per_ctrl_refs:10701070- xa_for_each(&subsys->namespaces, idx, ns) {10701070+ nvmet_for_each_enabled_ns(&subsys->namespaces, idx, ns) {10711071 if (ns->pr.enable) {10721072 pc_ref = xa_erase(&ns->pr_per_ctrl_refs, ctrl->cntlid);10731073 if (pc_ref)···10871087 kfifo_free(&ctrl->pr_log_mgr.log_queue);10881088 mutex_destroy(&ctrl->pr_log_mgr.lock);1089108910901090- xa_for_each(&ctrl->subsys->namespaces, idx, ns) {10901090+ nvmet_for_each_enabled_ns(&ctrl->subsys->namespaces, idx, ns) {10911091 if (ns->pr.enable) {10921092 pc_ref = xa_erase(&ns->pr_per_ctrl_refs, ctrl->cntlid);10931093 if (pc_ref)
+5-2
drivers/pci/msi/irqdomain.c
···350350351351 domain = dev_get_msi_domain(&pdev->dev);352352353353- if (!domain || !irq_domain_is_hierarchy(domain))354354- return mode == ALLOW_LEGACY;353353+ if (!domain || !irq_domain_is_hierarchy(domain)) {354354+ if (IS_ENABLED(CONFIG_PCI_MSI_ARCH_FALLBACKS))355355+ return mode == ALLOW_LEGACY;356356+ return false;357357+ }355358356359 if (!irq_domain_is_msi_parent(domain)) {357360 /*
+4
drivers/pci/msi/msi.c
···433433 if (WARN_ON_ONCE(dev->msi_enabled))434434 return -EINVAL;435435436436+ /* Test for the availability of MSI support */437437+ if (!pci_msi_domain_supports(dev, 0, ALLOW_LEGACY))438438+ return -ENOTSUPP;439439+436440 nvec = pci_msi_vec_count(dev);437441 if (nvec < 0)438442 return nvec;
+12-10
drivers/perf/riscv_pmu_sbi.c
···507507{508508 u32 type = event->attr.type;509509 u64 config = event->attr.config;510510- u64 raw_config_val;511511- int ret;510510+ int ret = -ENOENT;512511513512 /*514513 * Ensure we are finished checking standard hardware events for···527528 case PERF_TYPE_RAW:528529 /*529530 * As per SBI specification, the upper 16 bits must be unused530530- * for a raw event.531531+ * for a hardware raw event.531532 * Bits 63:62 are used to distinguish between raw events532533 * 00 - Hardware raw event533534 * 10 - SBI firmware events534535 * 11 - Risc-V platform specific firmware event535536 */536536- raw_config_val = config & RISCV_PMU_RAW_EVENT_MASK;537537+537538 switch (config >> 62) {538539 case 0:539539- ret = RISCV_PMU_RAW_EVENT_IDX;540540- *econfig = raw_config_val;540540+ /* Return error any bits [48-63] is set as it is not allowed by the spec */541541+ if (!(config & ~RISCV_PMU_RAW_EVENT_MASK)) {542542+ *econfig = config & RISCV_PMU_RAW_EVENT_MASK;543543+ ret = RISCV_PMU_RAW_EVENT_IDX;544544+ }541545 break;542546 case 2:543543- ret = (raw_config_val & 0xFFFF) |544544- (SBI_PMU_EVENT_TYPE_FW << 16);547547+ ret = (config & 0xFFFF) | (SBI_PMU_EVENT_TYPE_FW << 16);545548 break;546549 case 3:547550 /*···552551 * Event data - raw event encoding553552 */554553 ret = SBI_PMU_EVENT_TYPE_FW << 16 | RISCV_PLAT_FW_EVENT;555555- *econfig = raw_config_val;554554+ *econfig = config & RISCV_PMU_PLAT_FW_EVENT_MASK;555555+ break;556556+ default:556557 break;557558 }558559 break;559560 default:560560- ret = -ENOENT;561561 break;562562 }563563
+6
drivers/phy/broadcom/phy-brcm-usb-init-synopsys.c
···325325 void __iomem *ctrl = params->regs[BRCM_REGS_CTRL];326326327327 USB_CTRL_UNSET(ctrl, USB_PM, XHC_S2_CLK_SWITCH_EN);328328+329329+ /*330330+ * The PHY might be in a bad state if it is already powered331331+ * up. Toggle the power just in case.332332+ */333333+ USB_CTRL_SET(ctrl, USB_PM, USB_PWRDN);328334 USB_CTRL_UNSET(ctrl, USB_PM, USB_PWRDN);329335330336 /* 1 millisecond - for USB clocks to settle down */
···6565 depends on ARCH_MEDIATEK || COMPILE_TEST6666 depends on COMMON_CLK6767 depends on OF6868+ depends on REGULATOR6869 select GENERIC_PHY6970 help7071 Support HDMI PHY for Mediatek SoCs.
+13-8
drivers/phy/phy-core.c
···145145 return phy_provider;146146147147 for_each_child_of_node(phy_provider->children, child)148148- if (child == node)148148+ if (child == node) {149149+ of_node_put(child);149150 return phy_provider;151151+ }150152 }151153152154 return ERR_PTR(-EPROBE_DEFER);···631629 return ERR_PTR(-ENODEV);632630633631 /* This phy type handled by the usb-phy subsystem for now */634634- if (of_device_is_compatible(args.np, "usb-nop-xceiv"))635635- return ERR_PTR(-ENODEV);632632+ if (of_device_is_compatible(args.np, "usb-nop-xceiv")) {633633+ phy = ERR_PTR(-ENODEV);634634+ goto out_put_node;635635+ }636636637637 mutex_lock(&phy_provider_mutex);638638 phy_provider = of_phy_provider_lookup(args.np);···656652657653out_unlock:658654 mutex_unlock(&phy_provider_mutex);655655+out_put_node:659656 of_node_put(args.np);660657661658 return phy;···742737 if (!phy)743738 return;744739745745- r = devres_destroy(dev, devm_phy_release, devm_phy_match, phy);740740+ r = devres_release(dev, devm_phy_release, devm_phy_match, phy);746741 dev_WARN_ONCE(dev, r, "couldn't find PHY resource\n");747742}748743EXPORT_SYMBOL_GPL(devm_phy_put);···11261121{11271122 int r;1128112311291129- r = devres_destroy(dev, devm_phy_consume, devm_phy_match, phy);11241124+ r = devres_release(dev, devm_phy_consume, devm_phy_match, phy);11301125 dev_WARN_ONCE(dev, r, "couldn't find PHY resource\n");11311126}11321127EXPORT_SYMBOL_GPL(devm_phy_destroy);···12641259 * of_phy_provider_unregister to unregister the phy provider.12651260 */12661261void devm_of_phy_provider_unregister(struct device *dev,12671267- struct phy_provider *phy_provider)12621262+ struct phy_provider *phy_provider)12681263{12691264 int r;1270126512711271- r = devres_destroy(dev, devm_phy_provider_release, devm_phy_match,12721272- phy_provider);12661266+ r = devres_release(dev, devm_phy_provider_release, devm_phy_match,12671267+ phy_provider);12731268 dev_WARN_ONCE(dev, r, "couldn't find PHY provider device resource\n");12741269}12751270EXPORT_SYMBOL_GPL(devm_of_phy_provider_unregister);
···947947{948948 struct amd_pmc_dev *pdev = dev_get_drvdata(dev);949949950950+ /*951951+ * Must be called only from the same set of dev_pm_ops handlers952952+ * as i8042_pm_suspend() is called: currently just from .suspend.953953+ */950954 if (pdev->disable_8042_wakeup && !disable_workarounds) {951955 int rc = amd_pmc_wa_irq1(pdev);952956···963959 return 0;964960}965961966966-static DEFINE_SIMPLE_DEV_PM_OPS(amd_pmc_pm, amd_pmc_suspend_handler, NULL);962962+static const struct dev_pm_ops amd_pmc_pm = {963963+ .suspend = amd_pmc_suspend_handler,964964+};967965968966static const struct pci_device_id pmc_pci_ids[] = {969967 { PCI_DEVICE(PCI_VENDOR_ID_AMD, AMD_CPU_ID_PS) },
+2-2
drivers/platform/x86/hp/hp-wmi.c
···6464 "874A", "8603", "8604", "8748", "886B", "886C", "878A", "878B", "878C",6565 "88C8", "88CB", "8786", "8787", "8788", "88D1", "88D2", "88F4", "88FD",6666 "88F5", "88F6", "88F7", "88FE", "88FF", "8900", "8901", "8902", "8912",6767- "8917", "8918", "8949", "894A", "89EB", "8BAD", "8A42"6767+ "8917", "8918", "8949", "894A", "89EB", "8BAD", "8A42", "8A15"6868};69697070/* DMI Board names of Omen laptops that are specifically set to be thermal···8080 * "balanced" when reaching zero.8181 */8282static const char * const omen_timed_thermal_profile_boards[] = {8383- "8BAD", "8A42"8383+ "8BAD", "8A42", "8A15"8484};85858686/* DMI Board names of Victus laptops */
+4
drivers/platform/x86/intel/pmc/core_ssram.c
···269269 /*270270 * The secondary PMC BARS (which are behind hidden PCI devices)271271 * are read from fixed offsets in MMIO of the primary PMC BAR.272272+ * If a device is not present, the value will be 0.272273 */273274 ssram_base = get_base(tmp_ssram, offset);275275+ if (!ssram_base)276276+ return 0;277277+274278 ssram = ioremap(ssram_base, SSRAM_HDR_SIZE);275279 if (!ssram)276280 return -ENOMEM;
···184184 */185185 TP_HKEY_EV_AMT_TOGGLE = 0x131a, /* Toggle AMT on/off */186186 TP_HKEY_EV_DOUBLETAP_TOGGLE = 0x131c, /* Toggle trackpoint doubletap on/off */187187- TP_HKEY_EV_PROFILE_TOGGLE = 0x131f, /* Toggle platform profile */187187+ TP_HKEY_EV_PROFILE_TOGGLE = 0x131f, /* Toggle platform profile in 2024 systems */188188+ TP_HKEY_EV_PROFILE_TOGGLE2 = 0x1401, /* Toggle platform profile in 2025 + systems */188189189190 /* Reasons for waking up from S3/S4 */190191 TP_HKEY_EV_WKUP_S3_UNDOCK = 0x2304, /* undock requested, S3 */···1120111200 tp_features.trackpoint_doubletap = !tp_features.trackpoint_doubletap;1120211201 return true;1120311202 case TP_HKEY_EV_PROFILE_TOGGLE:1120311203+ case TP_HKEY_EV_PROFILE_TOGGLE2:1120411204 platform_profile_cycle();1120511205 return true;1120611206 }
+6
drivers/pmdomain/core.c
···21422142 return 0;21432143}2144214421452145+static void genpd_provider_release(struct device *dev)21462146+{21472147+ /* nothing to be done here */21482148+}21492149+21452150static int genpd_alloc_data(struct generic_pm_domain *genpd)21462151{21472152 struct genpd_governor_data *gd = NULL;···2178217321792174 genpd->gd = gd;21802175 device_initialize(&genpd->dev);21762176+ genpd->dev.release = genpd_provider_release;2181217721822178 if (!genpd_is_dev_name_fw(genpd)) {21832179 dev_set_name(&genpd->dev, "%s", genpd->name);
+2-2
drivers/pmdomain/imx/gpcv2.c
···14581458 .max_register = SZ_4K,14591459 };14601460 struct device *dev = &pdev->dev;14611461- struct device_node *pgc_np;14611461+ struct device_node *pgc_np __free(device_node) =14621462+ of_get_child_by_name(dev->of_node, "pgc");14621463 struct regmap *regmap;14631464 void __iomem *base;14641465 int ret;1465146614661466- pgc_np = of_get_child_by_name(dev->of_node, "pgc");14671467 if (!pgc_np) {14681468 dev_err(dev, "No power domains specified in DT\n");14691469 return -EINVAL;
+9-3
drivers/power/supply/bq24190_charger.c
···567567568568static int bq24296_set_otg_vbus(struct bq24190_dev_info *bdi, bool enable)569569{570570+ union power_supply_propval val = { .intval = bdi->charge_type };570571 int ret;571572572573 ret = pm_runtime_resume_and_get(bdi->dev);···588587589588 ret = bq24190_write_mask(bdi, BQ24190_REG_POC,590589 BQ24296_REG_POC_OTG_CONFIG_MASK,591591- BQ24296_REG_POC_CHG_CONFIG_SHIFT,590590+ BQ24296_REG_POC_OTG_CONFIG_SHIFT,592591 BQ24296_REG_POC_OTG_CONFIG_OTG);593593- } else592592+ } else {594593 ret = bq24190_write_mask(bdi, BQ24190_REG_POC,595594 BQ24296_REG_POC_OTG_CONFIG_MASK,596596- BQ24296_REG_POC_CHG_CONFIG_SHIFT,595595+ BQ24296_REG_POC_OTG_CONFIG_SHIFT,597596 BQ24296_REG_POC_OTG_CONFIG_DISABLE);597597+ if (ret < 0)598598+ goto out;599599+600600+ ret = bq24190_charger_set_charge_type(bdi, &val);601601+ }598602599603out:600604 pm_runtime_mark_last_busy(bdi->dev);
+27-9
drivers/power/supply/cros_charge-control.c
···77#include <acpi/battery.h>88#include <linux/container_of.h>99#include <linux/dmi.h>1010+#include <linux/lockdep.h>1011#include <linux/mod_devicetable.h>1112#include <linux/module.h>1313+#include <linux/mutex.h>1214#include <linux/platform_data/cros_ec_commands.h>1315#include <linux/platform_data/cros_ec_proto.h>1416#include <linux/platform_device.h>···5149 struct attribute *attributes[_CROS_CHCTL_ATTR_COUNT];5250 struct attribute_group group;53515252+ struct mutex lock; /* protects fields below and cros_ec */5453 enum power_supply_charge_behaviour current_behaviour;5554 u8 current_start_threshold, current_end_threshold;5655};···8784static int cros_chctl_configure_ec(struct cros_chctl_priv *priv)8885{8986 struct ec_params_charge_control req = {};8787+8888+ lockdep_assert_held(&priv->lock);90899190 req.cmd = EC_CHARGE_CONTROL_CMD_SET;9291···139134 return -EINVAL;140135141136 if (is_end_threshold) {142142- if (val <= priv->current_start_threshold)137137+ /* Start threshold is not exposed, use fixed value */138138+ if (priv->cmd_version == 2)139139+ priv->current_start_threshold = val == 100 ? 0 : val;140140+141141+ if (val < priv->current_start_threshold)143142 return -EINVAL;144143 priv->current_end_threshold = val;145144 } else {146146- if (val >= priv->current_end_threshold)145145+ if (val > priv->current_end_threshold)147146 return -EINVAL;148147 priv->current_start_threshold = val;149148 }···168159 struct cros_chctl_priv *priv = cros_chctl_attr_to_priv(&attr->attr,169160 CROS_CHCTL_ATTR_START_THRESHOLD);170161162162+ guard(mutex)(&priv->lock);171163 return sysfs_emit(buf, "%u\n", (unsigned int)priv->current_start_threshold);172164}173165···179169 struct cros_chctl_priv *priv = cros_chctl_attr_to_priv(&attr->attr,180170 CROS_CHCTL_ATTR_START_THRESHOLD);181171172172+ guard(mutex)(&priv->lock);182173 return cros_chctl_store_threshold(dev, priv, 0, buf, count);183174}184175···189178 struct cros_chctl_priv *priv = cros_chctl_attr_to_priv(&attr->attr,190179 CROS_CHCTL_ATTR_END_THRESHOLD);191180181181+ guard(mutex)(&priv->lock);192182 return sysfs_emit(buf, "%u\n", (unsigned int)priv->current_end_threshold);193183}194184···199187 struct cros_chctl_priv *priv = cros_chctl_attr_to_priv(&attr->attr,200188 CROS_CHCTL_ATTR_END_THRESHOLD);201189190190+ guard(mutex)(&priv->lock);202191 return cros_chctl_store_threshold(dev, priv, 1, buf, count);203192}204193···208195 struct cros_chctl_priv *priv = cros_chctl_attr_to_priv(&attr->attr,209196 CROS_CHCTL_ATTR_CHARGE_BEHAVIOUR);210197198198+ guard(mutex)(&priv->lock);211199 return power_supply_charge_behaviour_show(dev, EC_CHARGE_CONTROL_BEHAVIOURS,212200 priv->current_behaviour, buf);213201}···224210 if (ret < 0)225211 return ret;226212213213+ guard(mutex)(&priv->lock);227214 priv->current_behaviour = ret;228215229216 ret = cros_chctl_configure_ec(priv);···238223{239224 struct cros_chctl_priv *priv = cros_chctl_attr_to_priv(attr, n);240225241241- if (priv->cmd_version < 2) {242242- if (n == CROS_CHCTL_ATTR_START_THRESHOLD)243243- return 0;244244- if (n == CROS_CHCTL_ATTR_END_THRESHOLD)245245- return 0;246246- }226226+ if (n == CROS_CHCTL_ATTR_START_THRESHOLD && priv->cmd_version < 3)227227+ return 0;228228+ else if (n == CROS_CHCTL_ATTR_END_THRESHOLD && priv->cmd_version < 2)229229+ return 0;247230248231 return attr->mode;249232}···303290 if (!priv)304291 return -ENOMEM;305292293293+ ret = devm_mutex_init(dev, &priv->lock);294294+ if (ret)295295+ return ret;296296+306297 ret = cros_ec_get_cmd_versions(cros_ec, EC_CMD_CHARGE_CONTROL);307298 if (ret < 0)308299 return ret;···344327 priv->current_end_threshold = 100;345328346329 /* Bring EC into well-known state */347347- ret = cros_chctl_configure_ec(priv);330330+ scoped_guard(mutex, &priv->lock)331331+ ret = cros_chctl_configure_ec(priv);348332 if (ret < 0)349333 return ret;350334
+8
drivers/power/supply/gpio-charger.c
···6767 if (gpio_charger->current_limit_map[i].limit_ua <= val)6868 break;6969 }7070+7171+ /*7272+ * If a valid charge current limit isn't found, default to smallest7373+ * current limitation for safety reasons.7474+ */7575+ if (i >= gpio_charger->current_limit_map_size)7676+ i = gpio_charger->current_limit_map_size - 1;7777+7078 mapping = gpio_charger->current_limit_map[i];71797280 for (i = 0; i < ndescs; i++) {
+6-2
drivers/staging/gpib/Kconfig
···6565 depends on ISA_BUS || PCI || PCMCIA6666 depends on HAS_IOPORT6767 depends on !X86_PAE6868+ depends on PCMCIA || !PCMCIA6969+ depends on HAS_IOPORT_MAP6870 select GPIB_COMMON6971 select GPIB_NEC72107072 help···9189 depends on HAS_IOPORT9290 depends on ISA_BUS || PCI || PCMCIA9391 depends on !X86_PAE9292+ depends on PCMCIA || !PCMCIA9493 select GPIB_COMMON9594 select GPIB_NEC72109695 help···180177config GPIB_INES181178 tristate "INES"182179 depends on PCI || ISA_BUS || PCMCIA180180+ depends on PCMCIA || !PCMCIA183181 depends on HAS_IOPORT184182 depends on !X86_PAE185183 select GPIB_COMMON···203199 called cb7210.204200205201config GPIB_PCMCIA206206- bool "PCMCIA/Cardbus support for NI MC and Ines boards"207207- depends on PCCARD && (GPIB_NI_PCI_ISA || GPIB_CB7210 || GPIB_INES)202202+ def_bool y203203+ depends on PCMCIA && (GPIB_NI_PCI_ISA || GPIB_CB7210 || GPIB_INES)208204 help209205 Enable PCMCIA/CArdbus support for National Instruments,210206 measurement computing boards and Ines boards.
···116116 return 0;117117}118118119119-void writeb_wrapper(unsigned int value, void *address)120120-{121121- writeb(value, address);122122-};123123-EXPORT_SYMBOL(writeb_wrapper);124124-125125-void writew_wrapper(unsigned int value, void *address)126126-{127127- writew(value, address);128128-};129129-EXPORT_SYMBOL(writew_wrapper);130130-131131-unsigned int readb_wrapper(void *address)132132-{133133- return readb(address);134134-};135135-EXPORT_SYMBOL(readb_wrapper);136136-137137-unsigned int readw_wrapper(void *address)138138-{139139- return readw(address);140140-};141141-EXPORT_SYMBOL(readw_wrapper);142142-143143-#ifdef CONFIG_HAS_IOPORT144144-void outb_wrapper(unsigned int value, void *address)145145-{146146- outb(value, (unsigned long)(address));147147-};148148-EXPORT_SYMBOL(outb_wrapper);149149-150150-void outw_wrapper(unsigned int value, void *address)151151-{152152- outw(value, (unsigned long)(address));153153-};154154-EXPORT_SYMBOL(outw_wrapper);155155-156156-unsigned int inb_wrapper(void *address)157157-{158158- return inb((unsigned long)(address));159159-};160160-EXPORT_SYMBOL(inb_wrapper);161161-162162-unsigned int inw_wrapper(void *address)163163-{164164- return inw((unsigned long)(address));165165-};166166-EXPORT_SYMBOL(inw_wrapper);167167-#endif168168-169119/* this is a function instead of a constant because of Suse170120 * defining HZ to be a function call to get_hz()171121 */···486536 return -1;487537 }488538489489- if (pad > MAX_GPIB_PRIMARY_ADDRESS || sad > MAX_GPIB_SECONDARY_ADDRESS) {539539+ if (pad > MAX_GPIB_PRIMARY_ADDRESS || sad > MAX_GPIB_SECONDARY_ADDRESS || sad < -1) {490540 pr_err("gpib: bad address for serial poll");491541 return -1;492542 }···1573162315741624 if (WARN_ON_ONCE(sizeof(void *) > sizeof(base_addr)))15751625 return -EFAULT;15761576- config->ibbase = (void *)(unsigned long)(base_addr);16261626+ config->ibbase = base_addr;1577162715781628 return 0;15791629}
···473473474474static uint8_t hp_82341_read_byte(struct tms9914_priv *priv, unsigned int register_num)475475{476476- return inb((unsigned long)(priv->iobase) + register_num);476476+ return inb(priv->iobase + register_num);477477}478478479479static void hp_82341_write_byte(struct tms9914_priv *priv, uint8_t data, unsigned int register_num)480480{481481- outb(data, (unsigned long)(priv->iobase) + register_num);481481+ outb(data, priv->iobase + register_num);482482}483483484484static int hp_82341_find_isapnp_board(struct pnp_dev **dev)···682682{683683 struct hp_82341_priv *hp_priv;684684 struct tms9914_priv *tms_priv;685685- unsigned long start_addr;686686- void *iobase;685685+ u32 start_addr;686686+ u32 iobase;687687 int irq;688688 int i;689689 int retval;···704704 if (retval < 0)705705 return retval;706706 hp_priv->pnp_dev = dev;707707- iobase = (void *)(pnp_port_start(dev, 0));707707+ iobase = pnp_port_start(dev, 0);708708 irq = pnp_irq(dev, 0);709709 hp_priv->hw_version = HW_VERSION_82341D;710710 hp_priv->io_region_offset = 0x8;···714714 hp_priv->hw_version = HW_VERSION_82341C;715715 hp_priv->io_region_offset = 0x400;716716 }717717- pr_info("hp_82341: base io 0x%p\n", iobase);717717+ pr_info("hp_82341: base io 0x%u\n", iobase);718718 for (i = 0; i < hp_82341_num_io_regions; ++i) {719719- start_addr = (unsigned long)(iobase) + i * hp_priv->io_region_offset;719719+ start_addr = iobase + i * hp_priv->io_region_offset;720720 if (!request_region(start_addr, hp_82341_region_iosize, "hp_82341")) {721721 pr_err("hp_82341: failed to allocate io ports 0x%lx-0x%lx\n",722722 start_addr,···725725 }726726 hp_priv->iobase[i] = start_addr;727727 }728728- tms_priv->iobase = (void *)(hp_priv->iobase[2]);728728+ tms_priv->iobase = hp_priv->iobase[2];729729 if (hp_priv->hw_version == HW_VERSION_82341D) {730730 retval = isapnp_cfg_begin(hp_priv->pnp_dev->card->number,731731 hp_priv->pnp_dev->number);
+1-11
drivers/staging/gpib/include/gpibP.h
···16161717#include <linux/fs.h>1818#include <linux/interrupt.h>1919+#include <linux/io.h>19202021void gpib_register_driver(gpib_interface_t *interface, struct module *mod);2122void gpib_unregister_driver(gpib_interface_t *interface);···3534extern gpib_board_t board_array[GPIB_MAX_NUM_BOARDS];36353736extern struct list_head registered_drivers;3838-3939-#include <linux/io.h>4040-4141-void writeb_wrapper(unsigned int value, void *address);4242-unsigned int readb_wrapper(void *address);4343-void outb_wrapper(unsigned int value, void *address);4444-unsigned int inb_wrapper(void *address);4545-void writew_wrapper(unsigned int value, void *address);4646-unsigned int readw_wrapper(void *address);4747-void outw_wrapper(unsigned int value, void *address);4848-unsigned int inw_wrapper(void *address);49375038#endif // _GPIB_P_H5139
+2-1
drivers/staging/gpib/include/gpib_types.h
···3131 void *init_data;3232 int init_data_length;3333 /* IO base address to use for non-pnp cards (set by core, driver should make local copy) */3434- void *ibbase;3434+ u32 ibbase;3535+ void __iomem *mmibbase;3536 /* IRQ to use for non-pnp cards (set by core, driver should make local copy) */3637 unsigned int ibirq;3738 /* dma channel to use for non-pnp cards (set by core, driver should make local copy) */
+4-1
drivers/staging/gpib/include/nec7210.h
···18181919/* struct used to provide variables local to a nec7210 chip */2020struct nec7210_priv {2121- void *iobase;2121+#ifdef CONFIG_HAS_IOPORT2222+ u32 iobase;2323+#endif2424+ void __iomem *mmiobase;2225 unsigned int offset; // offset between successive nec7210 io addresses2326 unsigned int dma_channel;2427 u8 *dma_buffer;
+4-1
drivers/staging/gpib/include/tms9914.h
···20202121/* struct used to provide variables local to a tms9914 chip */2222struct tms9914_priv {2323- void *iobase;2323+#ifdef CONFIG_HAS_IOPORT2424+ u32 iobase;2525+#endif2626+ void __iomem *mmiobase;2427 unsigned int offset; // offset between successive tms9914 io addresses2528 unsigned int dma_channel;2629 // software copy of bits written to interrupt mask registers
···9999#define USB_GPIB_DEBUG_ON "\nIBDE\xAA\n"100100#define USB_GPIB_SET_LISTEN "\nIBDT0\n"101101#define USB_GPIB_SET_TALK "\nIBDT1\n"102102-#define USB_GPIB_SET_LINES "\nIBDC\n"103103-#define USB_GPIB_SET_DATA "\nIBDM\n"102102+#define USB_GPIB_SET_LINES "\nIBDC.\n"103103+#define USB_GPIB_SET_DATA "\nIBDM.\n"104104#define USB_GPIB_READ_LINES "\nIBD?C\n"105105#define USB_GPIB_READ_DATA "\nIBD?M\n"106106#define USB_GPIB_READ_BUS "\nIBD??\n"···210210 * (unix time in sec and NANOsec)211211 */212212213213-inline int usec_diff(struct timespec64 *a, struct timespec64 *b)213213+static inline int usec_diff(struct timespec64 *a, struct timespec64 *b)214214{215215 return ((a->tv_sec - b->tv_sec) * 1000000 +216216 (a->tv_nsec - b->tv_nsec) / 1000);···436436static int usb_gpib_attach(gpib_board_t *board, const gpib_board_config_t *config)437437{438438 int retval, j;439439- int base = (long)config->ibbase;439439+ u32 base = config->ibbase;440440 char *device_path;441441 int match;442442 struct usb_device *udev;···589589 size_t *bytes_written)590590{591591 int i, retval;592592- char command[6] = "IBc\n";592592+ char command[6] = "IBc.\n";593593594594 DIA_LOG(1, "enter %p\n", board);595595···608608}609609610610/**611611- * disable_eos() - Disable END on eos byte (END on EOI only)611611+ * usb_gpib_disable_eos() - Disable END on eos byte (END on EOI only)612612 *613613 * @board: the gpib_board data area for this gpib interface614614 *···624624}625625626626/**627627- * enable_eos() - Enable END for reads when eos byte is received.627627+ * usb_gpib_enable_eos() - Enable END for reads when eos byte is received.628628 *629629 * @board: the gpib_board data area for this gpib interface630630 * @eos_byte: the 'eos' byte···647647}648648649649/**650650- * go_to_standby() - De-assert ATN650650+ * usb_gpib_go_to_standby() - De-assert ATN651651 *652652 * @board: the gpib_board data area for this gpib interface653653 */···664664}665665666666/**667667- * interface_clear() - Assert or de-assert IFC667667+ * usb_gpib_interface_clear() - Assert or de-assert IFC668668 *669669 * @board: the gpib_board data area for this gpib interface670670 * assert: 1: assert IFC; 0: de-assert IFC
···426426 nec_priv = &pc2_priv->nec7210_priv;427427 nec_priv->offset = pc2_reg_offset;428428429429- if (request_region((unsigned long)config->ibbase, pc2_iosize, "pc2") == 0) {429429+ if (request_region(config->ibbase, pc2_iosize, "pc2") == 0) {430430 pr_err("gpib: ioports are already in use\n");431431 return -1;432432 }···471471 free_irq(pc2_priv->irq, board);472472 if (nec_priv->iobase) {473473 nec7210_board_reset(nec_priv, board);474474- release_region((unsigned long)(nec_priv->iobase), pc2_iosize);474474+ release_region(nec_priv->iobase, pc2_iosize);475475 }476476 if (nec_priv->dma_buffer) {477477 dma_free_coherent(board->dev, nec_priv->dma_buffer_length,···498498 nec_priv = &pc2_priv->nec7210_priv;499499 nec_priv->offset = pc2a_reg_offset;500500501501- switch ((unsigned long)(config->ibbase)) {501501+ switch (config->ibbase) {502502 case 0x02e1:503503 case 0x22e1:504504 case 0x42e1:505505 case 0x62e1:506506 break;507507 default:508508- pr_err("PCIIa base range invalid, must be one of 0x[0246]2e1, but is 0x%p\n",508508+ pr_err("PCIIa base range invalid, must be one of 0x[0246]2e1, but is 0x%d\n",509509 config->ibbase);510510 return -1;511511 }···522522 unsigned int err = 0;523523524524 for (i = 0; i < num_registers; i++) {525525- if (check_region((unsigned long)config->ibbase + i * pc2a_reg_offset, 1))525525+ if (check_region(config->ibbase + i * pc2a_reg_offset, 1))526526 err++;527527 }528528 if (config->ibirq && check_region(pc2a_clear_intr_iobase + config->ibirq, 1))···533533 }534534#endif535535 for (i = 0; i < num_registers; i++) {536536- if (!request_region((unsigned long)config->ibbase +536536+ if (!request_region(config->ibbase +537537 i * pc2a_reg_offset, 1, "pc2a")) {538538 pr_err("gpib: ioports are already in use");539539 for (j = 0; j < i; j++)540540- release_region((unsigned long)(config->ibbase) +540540+ release_region(config->ibbase +541541 j * pc2a_reg_offset, 1);542542 return -1;543543 }···608608 if (nec_priv->iobase) {609609 nec7210_board_reset(nec_priv, board);610610 for (i = 0; i < num_registers; i++)611611- release_region((unsigned long)nec_priv->iobase +611611+ release_region(nec_priv->iobase +612612 i * pc2a_reg_offset, 1);613613 }614614 if (pc2_priv->clear_intr_addr)
···237237 hba->vops->config_scaling_param(hba, p, data);238238}239239240240-static inline void ufshcd_vops_reinit_notify(struct ufs_hba *hba)241241-{242242- if (hba->vops && hba->vops->reinit_notify)243243- hba->vops->reinit_notify(hba);244244-}245245-246240static inline int ufshcd_vops_mcq_config_resource(struct ufs_hba *hba)247241{248242 if (hba->vops && hba->vops->mcq_config_resource)
+6-4
drivers/ufs/core/ufshcd.c
···88588858 ufshcd_device_reset(hba);88598859 ufs_put_device_desc(hba);88608860 ufshcd_hba_stop(hba);88618861- ufshcd_vops_reinit_notify(hba);88628861 ret = ufshcd_hba_enable(hba);88638862 if (ret) {88648863 dev_err(hba->dev, "Host controller enable failed\n");···1059010591 }10591105921059210593 /*1059310593- * Set the default power management level for runtime and system PM.1059410594+ * Set the default power management level for runtime and system PM if1059510595+ * not set by the host controller drivers.1059410596 * Default power saving mode is to keep UFS link in Hibern8 state1059510597 * and UFS device in sleep state.1059610598 */1059710597- hba->rpm_lvl = ufs_get_desired_pm_lvl_for_dev_link_state(1059910599+ if (!hba->rpm_lvl)1060010600+ hba->rpm_lvl = ufs_get_desired_pm_lvl_for_dev_link_state(1059810601 UFS_SLEEP_PWR_MODE,1059910602 UIC_LINK_HIBERN8_STATE);1060010600- hba->spm_lvl = ufs_get_desired_pm_lvl_for_dev_link_state(1060310603+ if (!hba->spm_lvl)1060410604+ hba->spm_lvl = ufs_get_desired_pm_lvl_for_dev_link_state(1060110605 UFS_SLEEP_PWR_MODE,1060210606 UIC_LINK_HIBERN8_STATE);1060310607
···255255 USB_SC_DEVICE, USB_PR_DEVICE, NULL,256256 US_FL_MAX_SECTORS_64 ),257257258258+/* Added by Lubomir Rintel <lkundrak@v3.sk>, a very fine chap */259259+UNUSUAL_DEV( 0x0421, 0x06c2, 0x0000, 0x0406,260260+ "Nokia",261261+ "Nokia 208",262262+ USB_SC_DEVICE, USB_PR_DEVICE, NULL,263263+ US_FL_MAX_SECTORS_64 ),264264+258265#ifdef NO_SDDR09259266UNUSUAL_DEV( 0x0436, 0x0005, 0x0100, 0x0100,260267 "Microtech",
+2-2
drivers/usb/typec/tcpm/maxim_contaminant.c
···135135136136 mv = max_contaminant_read_adc_mv(chip, channel, sleep_msec, raw, true);137137 if (mv < 0)138138- return ret;138138+ return mv;139139140140 /* OVP enable */141141 ret = regmap_update_bits(regmap, TCPC_VENDOR_CC_CTRL2, CCOVPDIS, 0);···157157158158 mv = max_contaminant_read_adc_mv(chip, channel, sleep_msec, raw, true);159159 if (mv < 0)160160- return ret;160160+ return mv;161161 /* Disable current source */162162 ret = regmap_update_bits(regmap, TCPC_VENDOR_CC_CTRL2, SBURPCTRL, 0);163163 if (ret < 0)
+15-10
drivers/usb/typec/tcpm/tcpci.c
···700700701701 tcpci->alert_mask = reg;702702703703- return tcpci_write16(tcpci, TCPC_ALERT_MASK, reg);703703+ return 0;704704}705705706706irqreturn_t tcpci_irq(struct tcpci *tcpci)···923923924924 chip->data.set_orientation = err;925925926926+ chip->tcpci = tcpci_register_port(&client->dev, &chip->data);927927+ if (IS_ERR(chip->tcpci))928928+ return PTR_ERR(chip->tcpci);929929+926930 err = devm_request_threaded_irq(&client->dev, client->irq, NULL,927931 _tcpci_irq,928932 IRQF_SHARED | IRQF_ONESHOT,929933 dev_name(&client->dev), chip);930934 if (err < 0)931931- return err;935935+ goto unregister_port;932936933933- /*934934- * Disable irq while registering port. If irq is configured as an edge935935- * irq this allow to keep track and process the irq as soon as it is enabled.936936- */937937- disable_irq(client->irq);938938- chip->tcpci = tcpci_register_port(&client->dev, &chip->data);939939- enable_irq(client->irq);937937+ /* Enable chip interrupts at last */938938+ err = tcpci_write16(chip->tcpci, TCPC_ALERT_MASK, chip->tcpci->alert_mask);939939+ if (err < 0)940940+ goto unregister_port;940941941941- return PTR_ERR_OR_ZERO(chip->tcpci);942942+ return 0;943943+944944+unregister_port:945945+ tcpci_unregister_port(chip->tcpci);946946+ return err;942947}943948944949static void tcpci_remove(struct i2c_client *client)
+2-2
drivers/usb/typec/ucsi/ucsi_ccg.c
···646646 UCSI_CMD_CONNECTOR_MASK;647647 if (con_index == 0) {648648 ret = -EINVAL;649649- goto unlock;649649+ goto err_put;650650 }651651 con = &uc->ucsi->connector[con_index - 1];652652 ucsi_ccg_update_set_new_cam_cmd(uc, con, &command);···654654655655 ret = ucsi_sync_control_common(ucsi, command);656656657657+err_put:657658 pm_runtime_put_sync(uc->dev);658658-unlock:659659 mutex_unlock(&uc->lock);660660661661 return ret;
+5
drivers/usb/typec/ucsi/ucsi_glink.c
···185185 struct pmic_glink_ucsi *ucsi = ucsi_get_drvdata(con->ucsi);186186 int orientation;187187188188+ if (!UCSI_CONSTAT(con, CONNECTED)) {189189+ typec_set_orientation(con->port, TYPEC_ORIENTATION_NONE);190190+ return;191191+ }192192+188193 if (con->num > PMIC_GLINK_MAX_PORTS ||189194 !ucsi->port_orientation[con->num - 1])190195 return;
+9-8
drivers/vfio/pci/vfio_pci_core.c
···16611661 unsigned long pfn, pgoff = vmf->pgoff - vma->vm_pgoff;16621662 vm_fault_t ret = VM_FAULT_SIGBUS;1663166316641664- if (order && (vmf->address & ((PAGE_SIZE << order) - 1) ||16641664+ pfn = vma_to_pfn(vma) + pgoff;16651665+16661666+ if (order && (pfn & ((1 << order) - 1) ||16671667+ vmf->address & ((PAGE_SIZE << order) - 1) ||16651668 vmf->address + (PAGE_SIZE << order) > vma->vm_end)) {16661669 ret = VM_FAULT_FALLBACK;16671670 goto out;16681671 }16691669-16701670- pfn = vma_to_pfn(vma);1671167216721673 down_read(&vdev->memory_lock);16731674···1677167616781677 switch (order) {16791678 case 0:16801680- ret = vmf_insert_pfn(vma, vmf->address, pfn + pgoff);16791679+ ret = vmf_insert_pfn(vma, vmf->address, pfn);16811680 break;16821681#ifdef CONFIG_ARCH_SUPPORTS_PMD_PFNMAP16831682 case PMD_ORDER:16841684- ret = vmf_insert_pfn_pmd(vmf, __pfn_to_pfn_t(pfn + pgoff,16851685- PFN_DEV), false);16831683+ ret = vmf_insert_pfn_pmd(vmf,16841684+ __pfn_to_pfn_t(pfn, PFN_DEV), false);16861685 break;16871686#endif16881687#ifdef CONFIG_ARCH_SUPPORTS_PUD_PFNMAP16891688 case PUD_ORDER:16901690- ret = vmf_insert_pfn_pud(vmf, __pfn_to_pfn_t(pfn + pgoff,16911691- PFN_DEV), false);16891689+ ret = vmf_insert_pfn_pud(vmf,16901690+ __pfn_to_pfn_t(pfn, PFN_DEV), false);16921691 break;16931692#endif16941693 default:
+1-3
drivers/virt/coco/tdx-guest/tdx-guest.c
···124124 if (!addr)125125 return NULL;126126127127- if (set_memory_decrypted((unsigned long)addr, count)) {128128- free_pages_exact(addr, len);127127+ if (set_memory_decrypted((unsigned long)addr, count))129128 return NULL;130130- }131129132130 return addr;133131}
+1-1
drivers/watchdog/stm32_iwdg.c
···286286 if (!wdt->data->has_early_wakeup)287287 return 0;288288289289- irq = platform_get_irq(pdev, 0);289289+ irq = platform_get_irq_optional(pdev, 0);290290 if (irq <= 0)291291 return 0;292292
+5-1
fs/9p/vfs_addr.c
···5757 int err, len;58585959 len = p9_client_write(fid, subreq->start, &subreq->io_iter, &err);6060+ if (len > 0)6161+ __set_bit(NETFS_SREQ_MADE_PROGRESS, &subreq->flags);6062 netfs_write_subrequest_terminated(subreq, len ?: err, false);6163}6264···8280 if (pos + total >= i_size_read(rreq->inode))8381 __set_bit(NETFS_SREQ_HIT_EOF, &subreq->flags);84828585- if (!err)8383+ if (!err) {8684 subreq->transferred += total;8585+ __set_bit(NETFS_SREQ_MADE_PROGRESS, &subreq->flags);8686+ }87878888 netfs_read_subreq_terminated(subreq, err, false);8989}
+4-2
fs/afs/addr_prefs.c
···413413414414 do {415415 argc = afs_split_string(&buf, argv, ARRAY_SIZE(argv));416416- if (argc < 0)417417- return argc;416416+ if (argc < 0) {417417+ ret = argc;418418+ goto done;419419+ }418420 if (argc < 2)419421 goto inval;420422
+1-1
fs/afs/afs.h
···10101111#include <linux/in.h>12121313-#define AFS_MAXCELLNAME 256 /* Maximum length of a cell name */1313+#define AFS_MAXCELLNAME 253 /* Maximum length of a cell name (DNS limited) */1414#define AFS_MAXVOLNAME 64 /* Maximum length of a volume name */1515#define AFS_MAXNSERVERS 8 /* Maximum servers in a basic volume record */1616#define AFS_NMAXNSERVERS 13 /* Maximum servers in a N/U-class volume record */
+1
fs/afs/afs_vl.h
···1313#define AFS_VL_PORT 7003 /* volume location service port */1414#define VL_SERVICE 52 /* RxRPC service ID for the Volume Location service */1515#define YFS_VL_SERVICE 2503 /* Service ID for AuriStor upgraded VL service */1616+#define YFS_VL_MAXCELLNAME 256 /* Maximum length of a cell name in YFS protocol */16171718enum AFSVL_Operations {1819 VLGETENTRYBYID = 503, /* AFS Get VLDB entry by ID */
···122122#define CACHEFILES_STATE_CHANGED 3 /* T if state changed (poll trigger) */123123#define CACHEFILES_ONDEMAND_MODE 4 /* T if in on-demand read mode */124124 char *rootdirname; /* name of cache root directory */125125- char *secctx; /* LSM security context */126125 char *tag; /* cache binding tag */127126 refcount_t unbind_pincount;/* refcount to do daemon unbind */128127 struct xarray reqs; /* xarray of pending on-demand requests */···129130 struct xarray ondemand_ids; /* xarray for ondemand_id allocation */130131 u32 ondemand_id_next;131132 u32 msg_id_next;133133+ u32 secid; /* LSM security id */134134+ bool have_secid; /* whether "secid" was set */132135};133136134137static inline bool cachefiles_in_ondemand_mode(struct cachefiles_cache *cache)
+3-3
fs/cachefiles/security.c
···1818 struct cred *new;1919 int ret;20202121- _enter("{%s}", cache->secctx);2121+ _enter("{%u}", cache->have_secid ? cache->secid : 0);22222323 new = prepare_kernel_cred(current);2424 if (!new) {···2626 goto error;2727 }28282929- if (cache->secctx) {3030- ret = set_security_override_from_ctx(new, cache->secctx);2929+ if (cache->have_secid) {3030+ ret = set_security_override(new, cache->secid);3131 if (ret < 0) {3232 put_cred(new);3333 pr_err("Security denies permission to nominate security context: error %d\n",
+51-23
fs/debugfs/file.c
···6464}6565EXPORT_SYMBOL_GPL(debugfs_real_fops);66666767-/**6868- * debugfs_file_get - mark the beginning of file data access6969- * @dentry: the dentry object whose data is being accessed.7070- *7171- * Up to a matching call to debugfs_file_put(), any successive call7272- * into the file removing functions debugfs_remove() and7373- * debugfs_remove_recursive() will block. Since associated private7474- * file data may only get freed after a successful return of any of7575- * the removal functions, you may safely access it after a successful7676- * call to debugfs_file_get() without worrying about lifetime issues.7777- *7878- * If -%EIO is returned, the file has already been removed and thus,7979- * it is not safe to access any of its data. If, on the other hand,8080- * it is allowed to access the file data, zero is returned.8181- */8282-int debugfs_file_get(struct dentry *dentry)6767+enum dbgfs_get_mode {6868+ DBGFS_GET_ALREADY,6969+ DBGFS_GET_REGULAR,7070+ DBGFS_GET_SHORT,7171+};7272+7373+static int __debugfs_file_get(struct dentry *dentry, enum dbgfs_get_mode mode)8374{8475 struct debugfs_fsdata *fsd;8576 void *d_fsd;···8796 if (!((unsigned long)d_fsd & DEBUGFS_FSDATA_IS_REAL_FOPS_BIT)) {8897 fsd = d_fsd;8998 } else {9999+ if (WARN_ON(mode == DBGFS_GET_ALREADY))100100+ return -EINVAL;101101+90102 fsd = kmalloc(sizeof(*fsd), GFP_KERNEL);91103 if (!fsd)92104 return -ENOMEM;931059494- if ((unsigned long)d_fsd & DEBUGFS_FSDATA_IS_SHORT_FOPS_BIT) {106106+ if (mode == DBGFS_GET_SHORT) {95107 fsd->real_fops = NULL;96108 fsd->short_fops = (void *)((unsigned long)d_fsd &9797- ~(DEBUGFS_FSDATA_IS_REAL_FOPS_BIT |9898- DEBUGFS_FSDATA_IS_SHORT_FOPS_BIT));109109+ ~DEBUGFS_FSDATA_IS_REAL_FOPS_BIT);99110 } else {100111 fsd->real_fops = (void *)((unsigned long)d_fsd &101112 ~DEBUGFS_FSDATA_IS_REAL_FOPS_BIT);···130137 return -EIO;131138132139 return 0;140140+}141141+142142+/**143143+ * debugfs_file_get - mark the beginning of file data access144144+ * @dentry: the dentry object whose data is being accessed.145145+ *146146+ * Up to a matching call to debugfs_file_put(), any successive call147147+ * into the file removing functions debugfs_remove() and148148+ * debugfs_remove_recursive() will block. Since associated private149149+ * file data may only get freed after a successful return of any of150150+ * the removal functions, you may safely access it after a successful151151+ * call to debugfs_file_get() without worrying about lifetime issues.152152+ *153153+ * If -%EIO is returned, the file has already been removed and thus,154154+ * it is not safe to access any of its data. If, on the other hand,155155+ * it is allowed to access the file data, zero is returned.156156+ */157157+int debugfs_file_get(struct dentry *dentry)158158+{159159+ return __debugfs_file_get(dentry, DBGFS_GET_ALREADY);133160}134161EXPORT_SYMBOL_GPL(debugfs_file_get);135162···280267 const struct file_operations *real_fops = NULL;281268 int r;282269283283- r = debugfs_file_get(dentry);270270+ r = __debugfs_file_get(dentry, DBGFS_GET_REGULAR);284271 if (r)285272 return r == -EIO ? -ENOENT : r;286273···437424 proxy_fops->unlocked_ioctl = full_proxy_unlocked_ioctl;438425}439426440440-static int full_proxy_open(struct inode *inode, struct file *filp)427427+static int full_proxy_open(struct inode *inode, struct file *filp,428428+ enum dbgfs_get_mode mode)441429{442430 struct dentry *dentry = F_DENTRY(filp);443431 const struct file_operations *real_fops;···446432 struct debugfs_fsdata *fsd;447433 int r;448434449449- r = debugfs_file_get(dentry);435435+ r = __debugfs_file_get(dentry, mode);450436 if (r)451437 return r == -EIO ? -ENOENT : r;452438···505491 return r;506492}507493494494+static int full_proxy_open_regular(struct inode *inode, struct file *filp)495495+{496496+ return full_proxy_open(inode, filp, DBGFS_GET_REGULAR);497497+}498498+508499const struct file_operations debugfs_full_proxy_file_operations = {509509- .open = full_proxy_open,500500+ .open = full_proxy_open_regular,501501+};502502+503503+static int full_proxy_open_short(struct inode *inode, struct file *filp)504504+{505505+ return full_proxy_open(inode, filp, DBGFS_GET_SHORT);506506+}507507+508508+const struct file_operations debugfs_full_short_proxy_file_operations = {509509+ .open = full_proxy_open_short,510510};511511512512ssize_t debugfs_attr_read(struct file *file, char __user *buf,
+5-8
fs/debugfs/inode.c
···229229 return;230230231231 /* check it wasn't a dir (no fsdata) or automount (no real_fops) */232232- if (fsd && fsd->real_fops) {232232+ if (fsd && (fsd->real_fops || fsd->short_fops)) {233233 WARN_ON(!list_empty(&fsd->cancellations));234234 mutex_destroy(&fsd->cancellations_mtx);235235 }···455455 const struct file_operations *fops)456456{457457 if (WARN_ON((unsigned long)fops &458458- (DEBUGFS_FSDATA_IS_SHORT_FOPS_BIT |459459- DEBUGFS_FSDATA_IS_REAL_FOPS_BIT)))458458+ DEBUGFS_FSDATA_IS_REAL_FOPS_BIT))460459 return ERR_PTR(-EINVAL);461460462461 return __debugfs_create_file(name, mode, parent, data,···470471 const struct debugfs_short_fops *fops)471472{472473 if (WARN_ON((unsigned long)fops &473473- (DEBUGFS_FSDATA_IS_SHORT_FOPS_BIT |474474- DEBUGFS_FSDATA_IS_REAL_FOPS_BIT)))474474+ DEBUGFS_FSDATA_IS_REAL_FOPS_BIT))475475 return ERR_PTR(-EINVAL);476476477477 return __debugfs_create_file(name, mode, parent, data,478478- fops ? &debugfs_full_proxy_file_operations :478478+ fops ? &debugfs_full_short_proxy_file_operations :479479 &debugfs_noop_file_operations,480480- (const void *)((unsigned long)fops |481481- DEBUGFS_FSDATA_IS_SHORT_FOPS_BIT));480480+ fops);482481}483482EXPORT_SYMBOL_GPL(debugfs_create_file_short);484483
+1-5
fs/debugfs/internal.h
···1515extern const struct file_operations debugfs_noop_file_operations;1616extern const struct file_operations debugfs_open_proxy_file_operations;1717extern const struct file_operations debugfs_full_proxy_file_operations;1818+extern const struct file_operations debugfs_full_short_proxy_file_operations;18191920struct debugfs_fsdata {2021 const struct file_operations *real_fops;···4140 * pointer gets its lowest bit set.4241 */4342#define DEBUGFS_FSDATA_IS_REAL_FOPS_BIT BIT(0)4444-/*4545- * A dentry's ->d_fsdata, when pointing to real fops, is with4646- * short fops instead of full fops.4747- */4848-#define DEBUGFS_FSDATA_IS_SHORT_FOPS_BIT BIT(1)49435044/* Access BITS */5145#define DEBUGFS_ALLOW_API BIT(0)
···216216217217 if (err)218218 goto dec_used_clus;219219+220220+ if (num_clusters >= sbi->num_clusters - EXFAT_FIRST_CLUSTER) {221221+ /*222222+ * The cluster chain includes a loop, scan the223223+ * bitmap to get the number of used clusters.224224+ */225225+ exfat_count_used_clusters(sb, &sbi->used_clusters);226226+227227+ return 0;228228+ }219229 } while (clu != EXFAT_EOF_CLUSTER);220230 }221231
+6
fs/exfat/file.c
···545545 while (pos < new_valid_size) {546546 u32 len;547547 struct folio *folio;548548+ unsigned long off;548549549550 len = PAGE_SIZE - (pos & (PAGE_SIZE - 1));550551 if (pos + len > new_valid_size)···555554 if (err)556555 goto out;557556557557+ off = offset_in_folio(folio, pos);558558+ folio_zero_new_buffers(folio, off, off + len);559559+558560 err = ops->write_end(file, mapping, pos, len, len, folio, NULL);559561 if (err < 0)560562 goto out;···566562 balance_dirty_pages_ratelimited(mapping);567563 cond_resched();568564 }565565+566566+ return 0;569567570568out:571569 return err;
+2-2
fs/exfat/namei.c
···330330331331 while ((dentry = exfat_search_empty_slot(sb, &hint_femp, p_dir,332332 num_entries, es)) < 0) {333333- if (dentry == -EIO)334334- break;333333+ if (dentry != -ENOSPC)334334+ return dentry;335335336336 if (exfat_check_max_dentries(inode))337337 return -ENOSPC;
···16811681 */16821682 if (ff->open_flags & (FOPEN_STREAM | FOPEN_NONSEEKABLE))16831683 nonseekable_open(inode, file);16841684+ if (!(ff->open_flags & FOPEN_KEEP_CACHE))16851685+ invalidate_inode_pages2(inode->i_mapping);16841686 }1685168716861688 return err;
+19-12
fs/fuse/file.c
···15411541 */15421542 struct page **pages = kzalloc(max_pages * sizeof(struct page *),15431543 GFP_KERNEL);15441544- if (!pages)15451545- return -ENOMEM;15441544+ if (!pages) {15451545+ ret = -ENOMEM;15461546+ goto out;15471547+ }1546154815471549 while (nbytes < *nbytesp && nr_pages < max_pages) {15481550 unsigned nfolios, i;···1559155715601558 nbytes += ret;1561155915621562- ret += start;15631563- /* Currently, all folios in FUSE are one page */15641564- nfolios = DIV_ROUND_UP(ret, PAGE_SIZE);15601560+ nfolios = DIV_ROUND_UP(ret + start, PAGE_SIZE);1565156115661566- ap->descs[ap->num_folios].offset = start;15671567- fuse_folio_descs_length_init(ap->descs, ap->num_folios, nfolios);15681568- for (i = 0; i < nfolios; i++)15691569- ap->folios[i + ap->num_folios] = page_folio(pages[i]);15621562+ for (i = 0; i < nfolios; i++) {15631563+ struct folio *folio = page_folio(pages[i]);15641564+ unsigned int offset = start +15651565+ (folio_page_idx(folio, pages[i]) << PAGE_SHIFT);15661566+ unsigned int len = min_t(unsigned int, ret, PAGE_SIZE - start);1570156715711571- ap->num_folios += nfolios;15721572- ap->descs[ap->num_folios - 1].length -=15731573- (PAGE_SIZE - ret) & (PAGE_SIZE - 1);15681568+ ap->descs[ap->num_folios].offset = offset;15691569+ ap->descs[ap->num_folios].length = len;15701570+ ap->folios[ap->num_folios] = folio;15711571+ start = 0;15721572+ ret -= len;15731573+ ap->num_folios++;15741574+ }15751575+15741576 nr_pages += nfolios;15751577 }15761578 kfree(pages);···15901584 else15911585 ap->args.out_pages = true;1592158615871587+out:15931588 *nbytesp = nbytes;1594158915951590 return ret < 0 ? ret : 0;
+3-1
fs/hfs/super.c
···349349 goto bail_no_root;350350 res = hfs_cat_find_brec(sb, HFS_ROOT_CNID, &fd);351351 if (!res) {352352- if (fd.entrylength > sizeof(rec) || fd.entrylength < 0) {352352+ if (fd.entrylength != sizeof(rec.dir)) {353353 res = -EIO;354354 goto bail_hfs_find;355355 }356356 hfs_bnode_read(fd.bnode, &rec, fd.entryoffset, fd.entrylength);357357+ if (rec.type != HFS_CDR_DIR)358358+ res = -EIO;357359 }358360 if (res)359361 goto bail_hfs_find;
+58-10
fs/iomap/buffered-io.c
···11381138 start_byte, end_byte, iomap, punch);1139113911401140 /* move offset to start of next folio in range */11411141- start_byte = folio_next_index(folio) << PAGE_SHIFT;11411141+ start_byte = folio_pos(folio) + folio_size(folio);11421142 folio_unlock(folio);11431143 folio_put(folio);11441144 }···17741774 */17751775static int iomap_add_to_ioend(struct iomap_writepage_ctx *wpc,17761776 struct writeback_control *wbc, struct folio *folio,17771777- struct inode *inode, loff_t pos, unsigned len)17771777+ struct inode *inode, loff_t pos, loff_t end_pos,17781778+ unsigned len)17781779{17791780 struct iomap_folio_state *ifs = folio->private;17801781 size_t poff = offset_in_folio(folio, pos);···1794179317951794 if (ifs)17961795 atomic_add(len, &ifs->write_bytes_pending);17961796+17971797+ /*17981798+ * Clamp io_offset and io_size to the incore EOF so that ondisk17991799+ * file size updates in the ioend completion are byte-accurate.18001800+ * This avoids recovering files with zeroed tail regions when18011801+ * writeback races with appending writes:18021802+ *18031803+ * Thread 1: Thread 2:18041804+ * ------------ -----------18051805+ * write [A, A+B]18061806+ * update inode size to A+B18071807+ * submit I/O [A, A+BS]18081808+ * write [A+B, A+B+C]18091809+ * update inode size to A+B+C18101810+ * <I/O completes, updates disk size to min(A+B+C, A+BS)>18111811+ * <power failure>18121812+ *18131813+ * After reboot:18141814+ * 1) with A+B+C < A+BS, the file has zero padding in range18151815+ * [A+B, A+B+C]18161816+ *18171817+ * |< Block Size (BS) >|18181818+ * |DDDDDDDDDDDD0000000000000|18191819+ * ^ ^ ^18201820+ * A A+B A+B+C18211821+ * (EOF)18221822+ *18231823+ * 2) with A+B+C > A+BS, the file has zero padding in range18241824+ * [A+B, A+BS]18251825+ *18261826+ * |< Block Size (BS) >|< Block Size (BS) >|18271827+ * |DDDDDDDDDDDD0000000000000|00000000000000000000000000|18281828+ * ^ ^ ^ ^18291829+ * A A+B A+BS A+B+C18301830+ * (EOF)18311831+ *18321832+ * D = Valid Data18331833+ * 0 = Zero Padding18341834+ *18351835+ * Note that this defeats the ability to chain the ioends of18361836+ * appending writes.18371837+ */17971838 wpc->ioend->io_size += len;18391839+ if (wpc->ioend->io_offset + wpc->ioend->io_size > end_pos)18401840+ wpc->ioend->io_size = end_pos - wpc->ioend->io_offset;18411841+17981842 wbc_account_cgroup_owner(wbc, folio, len);17991843 return 0;18001844}1801184518021846static int iomap_writepage_map_blocks(struct iomap_writepage_ctx *wpc,18031847 struct writeback_control *wbc, struct folio *folio,18041804- struct inode *inode, u64 pos, unsigned dirty_len,18051805- unsigned *count)18481848+ struct inode *inode, u64 pos, u64 end_pos,18491849+ unsigned dirty_len, unsigned *count)18061850{18071851 int error;18081852···18721826 break;18731827 default:18741828 error = iomap_add_to_ioend(wpc, wbc, folio, inode, pos,18751875- map_len);18291829+ end_pos, map_len);18761830 if (!error)18771831 (*count)++;18781832 break;···19431897 * remaining memory is zeroed when mapped, and writes to that19441898 * region are not written out to the file.19451899 *19461946- * Also adjust the writeback range to skip all blocks entirely19471947- * beyond i_size.19001900+ * Also adjust the end_pos to the end of file and skip writeback19011901+ * for all blocks entirely beyond i_size.19481902 */19491903 folio_zero_segment(folio, poff, folio_size(folio));19501950- *end_pos = round_up(isize, i_blocksize(inode));19041904+ *end_pos = isize;19511905 }1952190619531907 return true;···19601914 struct inode *inode = folio->mapping->host;19611915 u64 pos = folio_pos(folio);19621916 u64 end_pos = pos + folio_size(folio);19171917+ u64 end_aligned = 0;19631918 unsigned count = 0;19641919 int error = 0;19651920 u32 rlen;···20021955 /*20031956 * Walk through the folio to find dirty areas to write back.20041957 */20052005- while ((rlen = iomap_find_dirty_range(folio, &pos, end_pos))) {19581958+ end_aligned = round_up(end_pos, i_blocksize(inode));19591959+ while ((rlen = iomap_find_dirty_range(folio, &pos, end_aligned))) {20061960 error = iomap_writepage_map_blocks(wpc, wbc, folio, inode,20072007- pos, rlen, &count);19611961+ pos, end_pos, rlen, &count);20081962 if (error)20091963 break;20101964 pos += rlen;
+2-2
fs/jbd2/commit.c
···772772 /*773773 * If the journal is not located on the file system device,774774 * then we must flush the file system device before we issue775775- * the commit record775775+ * the commit record and update the journal tail sequence.776776 */777777- if (commit_transaction->t_need_data_flush &&777777+ if ((commit_transaction->t_need_data_flush || update_tail) &&778778 (journal->j_fs_dev != journal->j_dev) &&779779 (journal->j_flags & JBD2_BARRIER))780780 blkdev_issue_flush(journal->j_fs_dev);
···6767 * allocate a sufficiently large bvec array and may shorten the6868 * request.6969 */7070- if (async || user_backed_iter(iter)) {7070+ if (user_backed_iter(iter)) {7171 n = netfs_extract_user_iter(iter, len, &wreq->iter, 0);7272 if (n < 0) {7373 ret = n;···7777 wreq->direct_bv_count = n;7878 wreq->direct_bv_unpin = iov_iter_extract_will_pin(iter);7979 } else {8080+ /* If this is a kernel-generated async DIO request,8181+ * assume that any resources the iterator points to8282+ * (eg. a bio_vec array) will persist till the end of8383+ * the op.8484+ */8085 wreq->iter = *iter;8186 }8287···109104 trace_netfs_rreq(wreq, netfs_rreq_trace_wait_ip);110105 wait_on_bit(&wreq->flags, NETFS_RREQ_IN_PROGRESS,111106 TASK_UNINTERRUPTIBLE);112112- smp_rmb(); /* Read error/transferred after RIP flag */113107 ret = wreq->error;114108 if (ret == 0) {115109 ret = wreq->transferred;
+19-14
fs/netfs/read_collect.c
···6262 } else {6363 trace_netfs_folio(folio, netfs_folio_trace_read_done);6464 }6565+6666+ folioq_clear(folioq, slot);6567 } else {6668 // TODO: Use of PG_private_2 is deprecated.6769 if (test_bit(NETFS_SREQ_COPY_TO_CACHE, &subreq->flags))6870 netfs_pgpriv2_mark_copy_to_cache(subreq, rreq, folioq, slot);7171+ else7272+ folioq_clear(folioq, slot);6973 }70747175 if (!test_bit(NETFS_RREQ_DONT_UNLOCK_FOLIOS, &rreq->flags)) {···8177 folio_unlock(folio);8278 }8379 }8484-8585- folioq_clear(folioq, slot);8680}87818882/*···249247250248 /* Deal with the trickiest case: that this subreq is in the middle of a251249 * folio, not touching either edge, but finishes first. In such a252252- * case, we donate to the previous subreq, if there is one, so that the253253- * donation is only handled when that completes - and remove this254254- * subreq from the list.250250+ * case, we donate to the previous subreq, if there is one and if it is251251+ * contiguous, so that the donation is only handled when that completes252252+ * - and remove this subreq from the list.255253 *256254 * If the previous subreq finished first, we will have acquired their257255 * donation and should be able to unlock folios and/or donate nextwards.258256 */259257 if (!subreq->consumed &&260258 !prev_donated &&261261- !list_is_first(&subreq->rreq_link, &rreq->subrequests)) {259259+ !list_is_first(&subreq->rreq_link, &rreq->subrequests) &&260260+ subreq->start == prev->start + prev->len) {262261 prev = list_prev_entry(subreq, rreq_link);263262 WRITE_ONCE(prev->next_donated, prev->next_donated + subreq->len);264263 subreq->start += subreq->len;···381378 task_io_account_read(rreq->transferred);382379383380 trace_netfs_rreq(rreq, netfs_rreq_trace_wake_ip);384384- clear_bit_unlock(NETFS_RREQ_IN_PROGRESS, &rreq->flags);385385- wake_up_bit(&rreq->flags, NETFS_RREQ_IN_PROGRESS);381381+ clear_and_wake_up_bit(NETFS_RREQ_IN_PROGRESS, &rreq->flags);386382387383 trace_netfs_rreq(rreq, netfs_rreq_trace_done);388384 netfs_clear_subrequests(rreq, false);···440438 rreq->origin == NETFS_READPAGE ||441439 rreq->origin == NETFS_READ_FOR_WRITE)) {442440 netfs_consume_read_data(subreq, was_async);443443- __clear_bit(NETFS_SREQ_NO_PROGRESS, &subreq->flags);441441+ __set_bit(NETFS_SREQ_MADE_PROGRESS, &subreq->flags);444442 }445443}446444EXPORT_SYMBOL(netfs_read_subreq_progress);···499497 rreq->origin == NETFS_READPAGE ||500498 rreq->origin == NETFS_READ_FOR_WRITE)) {501499 netfs_consume_read_data(subreq, was_async);502502- __clear_bit(NETFS_SREQ_NO_PROGRESS, &subreq->flags);500500+ __set_bit(NETFS_SREQ_MADE_PROGRESS, &subreq->flags);503501 }504502 rreq->transferred += subreq->transferred;505503 }···513511 } else {514512 trace_netfs_sreq(subreq, netfs_sreq_trace_short);515513 if (subreq->transferred > subreq->consumed) {516516- __set_bit(NETFS_SREQ_NEED_RETRY, &subreq->flags);517517- __clear_bit(NETFS_SREQ_NO_PROGRESS, &subreq->flags);518518- set_bit(NETFS_RREQ_NEED_RETRY, &rreq->flags);519519- } else if (!__test_and_set_bit(NETFS_SREQ_NO_PROGRESS, &subreq->flags)) {514514+ /* If we didn't read new data, abandon retry. */515515+ if (subreq->retry_count &&516516+ test_bit(NETFS_SREQ_MADE_PROGRESS, &subreq->flags)) {517517+ __set_bit(NETFS_SREQ_NEED_RETRY, &subreq->flags);518518+ set_bit(NETFS_RREQ_NEED_RETRY, &rreq->flags);519519+ }520520+ } else if (test_bit(NETFS_SREQ_MADE_PROGRESS, &subreq->flags)) {520521 __set_bit(NETFS_SREQ_NEED_RETRY, &subreq->flags);521522 set_bit(NETFS_RREQ_NEED_RETRY, &rreq->flags);522523 } else {
+4
fs/netfs/read_pgpriv2.c
···170170171171 trace_netfs_write(wreq, netfs_write_trace_copy_to_cache);172172 netfs_stat(&netfs_n_wh_copy_to_cache);173173+ if (!wreq->io_streams[1].avail) {174174+ netfs_put_request(wreq, false, netfs_rreq_trace_put_return);175175+ goto couldnt_start;176176+ }173177174178 for (;;) {175179 error = netfs_pgpriv2_copy_folio(wreq, folio);
+7-4
fs/netfs/read_retry.c
···4949 * up to the first permanently failed one.5050 */5151 if (!rreq->netfs_ops->prepare_read &&5252- !test_bit(NETFS_RREQ_COPY_TO_CACHE, &rreq->flags)) {5252+ !rreq->cache_resources.ops) {5353 struct netfs_io_subrequest *subreq;54545555 list_for_each_entry(subreq, &rreq->subrequests, rreq_link) {5656 if (test_bit(NETFS_SREQ_FAILED, &subreq->flags))5757 break;5858 if (__test_and_clear_bit(NETFS_SREQ_NEED_RETRY, &subreq->flags)) {5959+ __clear_bit(NETFS_SREQ_MADE_PROGRESS, &subreq->flags);6060+ subreq->retry_count++;5961 netfs_reset_iter(subreq);6062 netfs_reissue_read(rreq, subreq);6163 }···139137 stream0->sreq_max_len = subreq->len;140138141139 __clear_bit(NETFS_SREQ_NEED_RETRY, &subreq->flags);142142- __set_bit(NETFS_SREQ_RETRYING, &subreq->flags);140140+ __clear_bit(NETFS_SREQ_MADE_PROGRESS, &subreq->flags);141141+ subreq->retry_count++;143142144143 spin_lock_bh(&rreq->lock);145144 list_add_tail(&subreq->rreq_link, &rreq->subrequests);···152149 BUG_ON(!len);153150154151 /* Renegotiate max_len (rsize) */155155- if (rreq->netfs_ops->prepare_read(subreq) < 0) {152152+ if (rreq->netfs_ops->prepare_read &&153153+ rreq->netfs_ops->prepare_read(subreq) < 0) {156154 trace_netfs_sreq(subreq, netfs_sreq_trace_reprep_failed);157155 __set_bit(NETFS_SREQ_FAILED, &subreq->flags);158156 }···217213 subreq->error = -ENOMEM;218214 __clear_bit(NETFS_SREQ_FAILED, &subreq->flags);219215 __clear_bit(NETFS_SREQ_NEED_RETRY, &subreq->flags);220220- __clear_bit(NETFS_SREQ_RETRYING, &subreq->flags);221216 }222217 spin_lock_bh(&rreq->lock);223218 list_splice_tail_init(&queue, &rreq->subrequests);
+5-9
fs/netfs/write_collect.c
···179179 struct iov_iter source = subreq->io_iter;180180181181 iov_iter_revert(&source, subreq->len - source.count);182182- __set_bit(NETFS_SREQ_RETRYING, &subreq->flags);183182 netfs_get_subrequest(subreq, netfs_sreq_trace_get_resubmit);184183 netfs_reissue_write(stream, subreq, &source);185184 }···233234 /* Renegotiate max_len (wsize) */234235 trace_netfs_sreq(subreq, netfs_sreq_trace_retry);235236 __clear_bit(NETFS_SREQ_NEED_RETRY, &subreq->flags);236236- __set_bit(NETFS_SREQ_RETRYING, &subreq->flags);237237+ subreq->retry_count++;237238 stream->prepare_write(subreq);238239239240 part = min(len, stream->sreq_max_len);···278279 subreq->start = start;279280 subreq->debug_index = atomic_inc_return(&wreq->subreq_counter);280281 subreq->stream_nr = to->stream_nr;281281- __set_bit(NETFS_SREQ_RETRYING, &subreq->flags);282282+ subreq->retry_count = 1;282283283284 trace_netfs_sreq_ref(wreq->debug_id, subreq->debug_index,284285 refcount_read(&subreq->ref),···500501 goto need_retry;501502 if ((notes & MADE_PROGRESS) && test_bit(NETFS_RREQ_PAUSE, &wreq->flags)) {502503 trace_netfs_rreq(wreq, netfs_rreq_trace_unpause);503503- clear_bit_unlock(NETFS_RREQ_PAUSE, &wreq->flags);504504- wake_up_bit(&wreq->flags, NETFS_RREQ_PAUSE);504504+ clear_and_wake_up_bit(NETFS_RREQ_PAUSE, &wreq->flags);505505 }506506507507 if (notes & NEED_REASSESS) {···603605604606 _debug("finished");605607 trace_netfs_rreq(wreq, netfs_rreq_trace_wake_ip);606606- clear_bit_unlock(NETFS_RREQ_IN_PROGRESS, &wreq->flags);607607- wake_up_bit(&wreq->flags, NETFS_RREQ_IN_PROGRESS);608608+ clear_and_wake_up_bit(NETFS_RREQ_IN_PROGRESS, &wreq->flags);608609609610 if (wreq->iocb) {610611 size_t written = min(wreq->transferred, wreq->len);···711714712715 trace_netfs_sreq(subreq, netfs_sreq_trace_terminated);713716714714- clear_bit_unlock(NETFS_SREQ_IN_PROGRESS, &subreq->flags);715715- wake_up_bit(&subreq->flags, NETFS_SREQ_IN_PROGRESS);717717+ clear_and_wake_up_bit(NETFS_SREQ_IN_PROGRESS, &subreq->flags);716718717719 /* If we are at the head of the queue, wake up the collector,718720 * transferring a ref to it if we were the ones to do so.
···263263static atomic_t nfs_netfs_debug_id;264264static int nfs_netfs_init_request(struct netfs_io_request *rreq, struct file *file)265265{266266+ if (!file) {267267+ if (WARN_ON_ONCE(rreq->origin != NETFS_PGPRIV2_COPY_TO_CACHE))268268+ return -EIO;269269+ return 0;270270+ }271271+266272 rreq->netfs_priv = get_nfs_open_context(nfs_file_open_context(file));267273 rreq->debug_id = atomic_inc_return(&nfs_netfs_debug_id);268274 /* [DEPRECATED] Use PG_private_2 to mark folio being written to the cache. */···280274281275static void nfs_netfs_free_request(struct netfs_io_request *rreq)282276{283283- put_nfs_open_context(rreq->netfs_priv);277277+ if (rreq->netfs_priv)278278+ put_nfs_open_context(rreq->netfs_priv);284279}285280286281static struct nfs_netfs_io_data *nfs_netfs_alloc(struct netfs_io_subrequest *sreq)
···893893 int status = 0;894894895895 trace_ocfs2_get_next_id(from_kqid(&init_user_ns, *qid), type);896896- if (!sb_has_quota_loaded(sb, type)) {896896+ if (!sb_has_quota_active(sb, type)) {897897 status = -ESRCH;898898 goto out;899899 }
···13191319 }1320132013211321 if (rdata->result == -ENODATA) {13221322- __set_bit(NETFS_SREQ_HIT_EOF, &rdata->subreq.flags);13231322 rdata->result = 0;13231323+ __set_bit(NETFS_SREQ_HIT_EOF, &rdata->subreq.flags);13241324 } else {13251325 size_t trans = rdata->subreq.transferred + rdata->got_bytes;13261326 if (trans < rdata->subreq.len &&13271327 rdata->subreq.start + trans == ictx->remote_i_size) {13281328- __set_bit(NETFS_SREQ_HIT_EOF, &rdata->subreq.flags);13291328 rdata->result = 0;13291329+ __set_bit(NETFS_SREQ_HIT_EOF, &rdata->subreq.flags);13301330+ } else if (rdata->got_bytes > 0) {13311331+ __set_bit(NETFS_SREQ_MADE_PROGRESS, &rdata->subreq.flags);13301332 }13311333 }13321334···16721670 if (written > wdata->subreq.len)16731671 written &= 0xFFFF;1674167216751675- if (written < wdata->subreq.len)16731673+ if (written < wdata->subreq.len) {16761674 result = -ENOSPC;16771677- else16751675+ } else {16781676 result = written;16771677+ if (written > 0)16781678+ __set_bit(NETFS_SREQ_MADE_PROGRESS, &wdata->subreq.flags);16791679+ }16791680 break;16801681 case MID_REQUEST_SUBMITTED:16811682 case MID_RETRY_NEEDED:
+5-1
fs/smb/client/file.c
···990990 }991991992992 /* Get the cached handle as SMB2 close is deferred */993993- rc = cifs_get_readable_path(tcon, full_path, &cfile);993993+ if (OPEN_FMODE(file->f_flags) & FMODE_WRITE) {994994+ rc = cifs_get_writable_path(tcon, full_path, FIND_WR_FSUID_ONLY, &cfile);995995+ } else {996996+ rc = cifs_get_readable_path(tcon, full_path, &cfile);997997+ }994998 if (rc == 0) {995999 if (file->f_flags == cfile->f_flags) {9961000 file->private_data = cfile;
+18-1
fs/smb/client/namespace.c
···196196 struct smb3_fs_context tmp;197197 char *full_path;198198 struct vfsmount *mnt;199199+ struct cifs_sb_info *mntpt_sb;200200+ struct cifs_ses *ses;199201200202 if (IS_ROOT(mntpt))201203 return ERR_PTR(-ESTALE);202204203203- cur_ctx = CIFS_SB(mntpt->d_sb)->ctx;205205+ mntpt_sb = CIFS_SB(mntpt->d_sb);206206+ ses = cifs_sb_master_tcon(mntpt_sb)->ses;207207+ cur_ctx = mntpt_sb->ctx;208208+209209+ /*210210+ * At this point, the root session should be in the mntpt sb. We should211211+ * bring the sb context passwords in sync with the root session's212212+ * passwords. This would help prevent unnecessary retries and password213213+ * swaps for automounts.214214+ */215215+ mutex_lock(&ses->session_mutex);216216+ rc = smb3_sync_session_ctx_passwords(mntpt_sb, ses);217217+ mutex_unlock(&ses->session_mutex);218218+219219+ if (rc)220220+ return ERR_PTR(rc);204221205222 fc = fs_context_for_submount(path->mnt->mnt_sb->s_type, mntpt);206223 if (IS_ERR(fc))
···115115#else /* CONFIG_STM32_FIREWALL */116116117117int stm32_firewall_get_firewall(struct device_node *np, struct stm32_firewall *firewall,118118- unsigned int nb_firewall);118118+ unsigned int nb_firewall)119119{120120 return -ENODEV;121121}
+10-3
include/linux/dmaengine.h
···8484 DMA_TRANS_NONE,8585};86868787-/**8787+/*8888 * Interleaved Transfer Request8989 * ----------------------------9090 * A chunk is collection of contiguous bytes to be transferred.···223223};224224225225/**226226- * enum pq_check_flags - result of async_{xor,pq}_zero_sum operations226226+ * enum sum_check_flags - result of async_{xor,pq}_zero_sum operations227227 * @SUM_CHECK_P_RESULT - 1 if xor zero sum error, 0 otherwise228228 * @SUM_CHECK_Q_RESULT - 1 if reed-solomon zero sum error, 0 otherwise229229 */···286286 * pointer to the engine's metadata area287287 * 4. Read out the metadata from the pointer288288 *289289- * Note: the two mode is not compatible and clients must use one mode for a289289+ * Warning: the two modes are not compatible and clients must use one mode for a290290 * descriptor.291291 */292292enum dma_desc_metadata_mode {···594594 * @phys: physical address of the descriptor595595 * @chan: target channel for this operation596596 * @tx_submit: accept the descriptor, assign ordered cookie and mark the597597+ * @desc_free: driver's callback function to free a resusable descriptor598598+ * after completion597599 * descriptor pending. To be pushed on .issue_pending() call598600 * @callback: routine to call after this operation is complete601601+ * @callback_result: error result from a DMA transaction599602 * @callback_param: general parameter to pass to the callback routine603603+ * @unmap: hook for generic DMA unmap data600604 * @desc_metadata_mode: core managed metadata mode to protect mixed use of601605 * DESC_METADATA_CLIENT or DESC_METADATA_ENGINE. Otherwise602606 * DESC_METADATA_NONE···831827 * @device_prep_dma_memset: prepares a memset operation832828 * @device_prep_dma_memset_sg: prepares a memset operation over a scatter list833829 * @device_prep_dma_interrupt: prepares an end of chain interrupt operation830830+ * @device_prep_peripheral_dma_vec: prepares a scatter-gather DMA transfer,831831+ * where the address and size of each segment is located in one entry of832832+ * the dma_vec array.834833 * @device_prep_slave_sg: prepares a slave dma operation835834 * @device_prep_dma_cyclic: prepare a cyclic dma operation suitable for audio.836835 * The function takes a buffer of size buf_len. The callback function will
+13-3
include/linux/if_vlan.h
···585585 * vlan_get_protocol - get protocol EtherType.586586 * @skb: skbuff to query587587 * @type: first vlan protocol588588+ * @mac_offset: MAC offset588589 * @depth: buffer to store length of eth and vlan tags in bytes589590 *590591 * Returns the EtherType of the packet, regardless of whether it is591592 * vlan encapsulated (normal or hardware accelerated) or not.592593 */593593-static inline __be16 __vlan_get_protocol(const struct sk_buff *skb, __be16 type,594594- int *depth)594594+static inline __be16 __vlan_get_protocol_offset(const struct sk_buff *skb,595595+ __be16 type,596596+ int mac_offset,597597+ int *depth)595598{596599 unsigned int vlan_depth = skb->mac_len, parse_depth = VLAN_MAX_DEPTH;597600···613610 do {614611 struct vlan_hdr vhdr, *vh;615612616616- vh = skb_header_pointer(skb, vlan_depth, sizeof(vhdr), &vhdr);613613+ vh = skb_header_pointer(skb, mac_offset + vlan_depth,614614+ sizeof(vhdr), &vhdr);617615 if (unlikely(!vh || !--parse_depth))618616 return 0;619617···627623 *depth = vlan_depth;628624629625 return type;626626+}627627+628628+static inline __be16 __vlan_get_protocol(const struct sk_buff *skb, __be16 type,629629+ int *depth)630630+{631631+ return __vlan_get_protocol_offset(skb, type, 0, depth);630632}631633632634/**
···335335 u16 io_type;336336 u16 io_flags; /* IOMAP_F_* */337337 struct inode *io_inode; /* file being written to */338338- size_t io_size; /* size of the extent */338338+ size_t io_size; /* size of data within eof */339339 loff_t io_offset; /* offset in the file */340340 sector_t io_sector; /* start sector of ioend */341341 struct bio io_bio; /* MUST BE LAST! */
+14
include/linux/memfd.h
···77#ifdef CONFIG_MEMFD_CREATE88extern long memfd_fcntl(struct file *file, unsigned int cmd, unsigned int arg);99struct folio *memfd_alloc_folio(struct file *memfd, pgoff_t idx);1010+unsigned int *memfd_file_seals_ptr(struct file *file);1011#else1112static inline long memfd_fcntl(struct file *f, unsigned int c, unsigned int a)1213{···1716{1817 return ERR_PTR(-EINVAL);1918}1919+2020+static inline unsigned int *memfd_file_seals_ptr(struct file *file)2121+{2222+ return NULL;2323+}2024#endif2525+2626+/* Retrieve memfd seals associated with the file, if any. */2727+static inline unsigned int memfd_file_seals(struct file *file)2828+{2929+ unsigned int *sealsp = memfd_file_seals_ptr(file);3030+3131+ return sealsp ? *sealsp : 0;3232+}21332234#endif /* __LINUX_MEMFD_H */
···31253125 if (!pmd_ptlock_init(ptdesc))31263126 return false;31273127 __folio_set_pgtable(folio);31283128+ ptdesc_pmd_pts_init(ptdesc);31283129 lruvec_stat_add_folio(folio, NR_PAGETABLE);31293130 return true;31303131}···41024101static inline void mem_dump_obj(void *object) {}41034102#endif4104410341044104+static inline bool is_write_sealed(int seals)41054105+{41064106+ return seals & (F_SEAL_WRITE | F_SEAL_FUTURE_WRITE);41074107+}41084108+41094109+/**41104110+ * is_readonly_sealed - Checks whether write-sealed but mapped read-only,41114111+ * in which case writes should be disallowing moving41124112+ * forwards.41134113+ * @seals: the seals to check41144114+ * @vm_flags: the VMA flags to check41154115+ *41164116+ * Returns whether readonly sealed, in which case writess should be disallowed41174117+ * going forward.41184118+ */41194119+static inline bool is_readonly_sealed(int seals, vm_flags_t vm_flags)41204120+{41214121+ /*41224122+ * Since an F_SEAL_[FUTURE_]WRITE sealed memfd can be mapped as41234123+ * MAP_SHARED and read-only, take care to not allow mprotect to41244124+ * revert protections on such mappings. Do this only for shared41254125+ * mappings. For private mappings, don't need to mask41264126+ * VM_MAYWRITE as we still want them to be COW-writable.41274127+ */41284128+ if (is_write_sealed(seals) &&41294129+ ((vm_flags & (VM_SHARED | VM_WRITE)) == VM_SHARED))41304130+ return true;41314131+41324132+ return false;41334133+}41344134+41054135/**41064136 * seal_check_write - Check for F_SEAL_WRITE or F_SEAL_FUTURE_WRITE flags and41074137 * handle them.···41444112 */41454113static inline int seal_check_write(int seals, struct vm_area_struct *vma)41464114{41474147- if (seals & (F_SEAL_WRITE | F_SEAL_FUTURE_WRITE)) {41484148- /*41494149- * New PROT_WRITE and MAP_SHARED mmaps are not allowed when41504150- * write seals are active.41514151- */41524152- if ((vma->vm_flags & VM_SHARED) && (vma->vm_flags & VM_WRITE))41534153- return -EPERM;41154115+ if (!is_write_sealed(seals))41164116+ return 0;4154411741554155- /*41564156- * Since an F_SEAL_[FUTURE_]WRITE sealed memfd can be mapped as41574157- * MAP_SHARED and read-only, take care to not allow mprotect to41584158- * revert protections on such mappings. Do this only for shared41594159- * mappings. For private mappings, don't need to mask41604160- * VM_MAYWRITE as we still want them to be COW-writable.41614161- */41624162- if (vma->vm_flags & VM_SHARED)41634163- vm_flags_clear(vma, VM_MAYWRITE);41644164- }41184118+ /*41194119+ * New PROT_WRITE and MAP_SHARED mmaps are not allowed when41204120+ * write seals are active.41214121+ */41224122+ if ((vma->vm_flags & VM_SHARED) && (vma->vm_flags & VM_WRITE))41234123+ return -EPERM;4165412441664125 return 0;41674126}
+30
include/linux/mm_types.h
···445445 * @pt_index: Used for s390 gmap.446446 * @pt_mm: Used for x86 pgds.447447 * @pt_frag_refcount: For fragmented page table tracking. Powerpc only.448448+ * @pt_share_count: Used for HugeTLB PMD page table share count.448449 * @_pt_pad_2: Padding to ensure proper alignment.449450 * @ptl: Lock for the page table.450451 * @__page_type: Same as page->page_type. Unused for page tables.···472471 pgoff_t pt_index;473472 struct mm_struct *pt_mm;474473 atomic_t pt_frag_refcount;474474+#ifdef CONFIG_HUGETLB_PMD_PAGE_TABLE_SHARING475475+ atomic_t pt_share_count;476476+#endif475477 };476478477479 union {···519515#define page_ptdesc(p) (_Generic((p), \520516 const struct page *: (const struct ptdesc *)(p), \521517 struct page *: (struct ptdesc *)(p)))518518+519519+#ifdef CONFIG_HUGETLB_PMD_PAGE_TABLE_SHARING520520+static inline void ptdesc_pmd_pts_init(struct ptdesc *ptdesc)521521+{522522+ atomic_set(&ptdesc->pt_share_count, 0);523523+}524524+525525+static inline void ptdesc_pmd_pts_inc(struct ptdesc *ptdesc)526526+{527527+ atomic_inc(&ptdesc->pt_share_count);528528+}529529+530530+static inline void ptdesc_pmd_pts_dec(struct ptdesc *ptdesc)531531+{532532+ atomic_dec(&ptdesc->pt_share_count);533533+}534534+535535+static inline int ptdesc_pmd_pts_count(struct ptdesc *ptdesc)536536+{537537+ return atomic_read(&ptdesc->pt_share_count);538538+}539539+#else540540+static inline void ptdesc_pmd_pts_init(struct ptdesc *ptdesc)541541+{542542+}543543+#endif522544523545/*524546 * Used for sizing the vmemmap region on some architectures
···185185 short error; /* 0 or error that occurred */186186 unsigned short debug_index; /* Index in list (for debugging output) */187187 unsigned int nr_segs; /* Number of segs in io_iter */188188+ u8 retry_count; /* The number of retries (0 on initial pass) */188189 enum netfs_io_source source; /* Where to read from/write to */189190 unsigned char stream_nr; /* I/O stream this belongs to */190191 unsigned char curr_folioq_slot; /* Folio currently being read */···195194#define NETFS_SREQ_COPY_TO_CACHE 0 /* Set if should copy the data to the cache */196195#define NETFS_SREQ_CLEAR_TAIL 1 /* Set if the rest of the read should be cleared */197196#define NETFS_SREQ_SEEK_DATA_READ 3 /* Set if ->read() should SEEK_DATA first */198198-#define NETFS_SREQ_NO_PROGRESS 4 /* Set if we didn't manage to read any data */197197+#define NETFS_SREQ_MADE_PROGRESS 4 /* Set if we transferred at least some data */199198#define NETFS_SREQ_ONDEMAND 5 /* Set if it's from on-demand read mode */200199#define NETFS_SREQ_BOUNDARY 6 /* Set if ends on hard boundary (eg. ceph object) */201200#define NETFS_SREQ_HIT_EOF 7 /* Set if short due to EOF */202201#define NETFS_SREQ_IN_PROGRESS 8 /* Unlocked when the subrequest completes */203202#define NETFS_SREQ_NEED_RETRY 9 /* Set if the filesystem requests a retry */204204-#define NETFS_SREQ_RETRYING 10 /* Set if we're retrying */205205-#define NETFS_SREQ_FAILED 11 /* Set if the subreq failed unretryably */203203+#define NETFS_SREQ_FAILED 10 /* Set if the subreq failed unretryably */206204};207205208206enum netfs_io_origin {···269269 size_t prev_donated; /* Fallback for subreq->prev_donated */270270 refcount_t ref;271271 unsigned long flags;272272-#define NETFS_RREQ_COPY_TO_CACHE 1 /* Need to write to the cache */273272#define NETFS_RREQ_NO_UNLOCK_FOLIO 2 /* Don't unlock no_unlock_folio on completion */274273#define NETFS_RREQ_DONT_UNLOCK_FOLIOS 3 /* Don't unlock the folios on completion */275274#define NETFS_RREQ_FAILED 4 /* The request failed */
···2626 * @max_mm_channels: Maximum number of MM DMA channels in each direction2727 * @device_map: DMA slave map2828 * @irq_index: The index of first IRQ2929+ * @dma_dev: The device pointer for dma operations2930 */3031struct qdma_platdata {3132 u32 max_mm_channels;3233 u32 irq_index;3334 struct dma_slave_map *device_map;3535+ struct device *dma_dev;3436};35373638#endif /* _PLATDATA_AMD_QDMA_H */
+12-14
include/linux/poll.h
···25252626struct poll_table_struct;27272828-/* 2828+/*2929 * structures and helpers for f_op->poll implementations3030 */3131typedef void (*poll_queue_proc)(struct file *, wait_queue_head_t *, struct poll_table_struct *);32323333/*3434- * Do not touch the structure directly, use the access functions3535- * poll_does_not_wait() and poll_requested_events() instead.3434+ * Do not touch the structure directly, use the access function3535+ * poll_requested_events() instead.3636 */3737typedef struct poll_table_struct {3838 poll_queue_proc _qproc;···41414242static inline void poll_wait(struct file * filp, wait_queue_head_t * wait_address, poll_table *p)4343{4444- if (p && p->_qproc && wait_address)4444+ if (p && p->_qproc) {4545 p->_qproc(filp, wait_address, p);4646-}4747-4848-/*4949- * Return true if it is guaranteed that poll will not wait. This is the case5050- * if the poll() of another file descriptor in the set got an event, so there5151- * is no need for waiting.5252- */5353-static inline bool poll_does_not_wait(const poll_table *p)5454-{5555- return p == NULL || p->_qproc == NULL;4646+ /*4747+ * This memory barrier is paired in the wq_has_sleeper().4848+ * See the comment above prepare_to_wait(), we need to4949+ * ensure that subsequent tests in this thread can't be5050+ * reordered with __add_wait_queue() in _qproc() paths.5151+ */5252+ smp_mb();5353+ }5654}57555856/*
···16371637 * We're lying here, but rather than expose a completely new task state16381638 * to userspace, we can make this appear as if the task has gone through16391639 * a regular rt_mutex_lock() call.16401640+ * Report frozen tasks as uninterruptible.16401641 */16411641- if (tsk_state & TASK_RTLOCK_WAIT)16421642+ if ((tsk_state & TASK_RTLOCK_WAIT) || (tsk_state & TASK_FROZEN))16421643 state = TASK_UNINTERRUPTIBLE;1643164416441645 return fls(state);
+1-1
include/linux/trace_events.h
···364364 struct list_head list;365365 struct trace_event_class *class;366366 union {367367- char *name;367367+ const char *name;368368 /* Set TRACE_EVENT_FL_TRACEPOINT flag when using "tp" */369369 struct tracepoint *tp;370370 };
···733733/**734734 * struct nft_set_ext - set extensions735735 *736736- * @genmask: generation mask736736+ * @genmask: generation mask, but also flags (see NFT_SET_ELEM_DEAD_BIT)737737 * @offset: offsets of individual extension types738738 * @data: beginning of extension data739739+ *740740+ * This structure must be aligned to word size, otherwise atomic bitops741741+ * on genmask field can cause alignment failure on some archs.739742 */740743struct nft_set_ext {741744 u8 genmask;742745 u8 offset[NFT_SET_EXT_NUM];743746 char data[];744744-};747747+} __aligned(BITS_PER_LONG / 8);745748746749static inline void nft_set_ext_prepare(struct nft_set_ext_tmpl *tmpl)747750{
+7-10
include/net/sock.h
···22972297}2298229822992299/**23002300- * sock_poll_wait - place memory barrier behind the poll_wait call.23002300+ * sock_poll_wait - wrapper for the poll_wait call.23012301 * @filp: file23022302 * @sock: socket to wait on23032303 * @p: poll_table···23072307static inline void sock_poll_wait(struct file *filp, struct socket *sock,23082308 poll_table *p)23092309{23102310- if (!poll_does_not_wait(p)) {23112311- poll_wait(filp, &sock->wq.wait, p);23122312- /* We need to be sure we are in sync with the23132313- * socket flags modification.23142314- *23152315- * This memory barrier is paired in the wq_has_sleeper.23162316- */23172317- smp_mb();23182318- }23102310+ /* Provides a barrier we need to be sure we are in sync23112311+ * with the socket flags modification.23122312+ *23132313+ * This memory barrier is paired in the wq_has_sleeper.23142314+ */23152315+ poll_wait(filp, &sock->wq.wait, p);23192316}2320231723212318static inline void skb_set_hash_from_sk(struct sk_buff *skb, struct sock *sk)
+26-24
include/uapi/linux/mptcp_pm.h
···1212/**1313 * enum mptcp_event_type1414 * @MPTCP_EVENT_UNSPEC: unused event1515- * @MPTCP_EVENT_CREATED: token, family, saddr4 | saddr6, daddr4 | daddr6,1616- * sport, dport A new MPTCP connection has been created. It is the good time1717- * to allocate memory and send ADD_ADDR if needed. Depending on the1515+ * @MPTCP_EVENT_CREATED: A new MPTCP connection has been created. It is the1616+ * good time to allocate memory and send ADD_ADDR if needed. Depending on the1817 * traffic-patterns it can take a long time until the MPTCP_EVENT_ESTABLISHED1919- * is sent.2020- * @MPTCP_EVENT_ESTABLISHED: token, family, saddr4 | saddr6, daddr4 | daddr6,2121- * sport, dport A MPTCP connection is established (can start new subflows).2222- * @MPTCP_EVENT_CLOSED: token A MPTCP connection has stopped.2323- * @MPTCP_EVENT_ANNOUNCED: token, rem_id, family, daddr4 | daddr6 [, dport] A2424- * new address has been announced by the peer.2525- * @MPTCP_EVENT_REMOVED: token, rem_id An address has been lost by the peer.2626- * @MPTCP_EVENT_SUB_ESTABLISHED: token, family, loc_id, rem_id, saddr4 |2727- * saddr6, daddr4 | daddr6, sport, dport, backup, if_idx [, error] A new2828- * subflow has been established. 'error' should not be set.2929- * @MPTCP_EVENT_SUB_CLOSED: token, family, loc_id, rem_id, saddr4 | saddr6,3030- * daddr4 | daddr6, sport, dport, backup, if_idx [, error] A subflow has been3131- * closed. An error (copy of sk_err) could be set if an error has been3232- * detected for this subflow.3333- * @MPTCP_EVENT_SUB_PRIORITY: token, family, loc_id, rem_id, saddr4 | saddr6,3434- * daddr4 | daddr6, sport, dport, backup, if_idx [, error] The priority of a3535- * subflow has changed. 'error' should not be set.3636- * @MPTCP_EVENT_LISTENER_CREATED: family, sport, saddr4 | saddr6 A new PM3737- * listener is created.3838- * @MPTCP_EVENT_LISTENER_CLOSED: family, sport, saddr4 | saddr6 A PM listener3939- * is closed.1818+ * is sent. Attributes: token, family, saddr4 | saddr6, daddr4 | daddr6,1919+ * sport, dport, server-side.2020+ * @MPTCP_EVENT_ESTABLISHED: A MPTCP connection is established (can start new2121+ * subflows). Attributes: token, family, saddr4 | saddr6, daddr4 | daddr6,2222+ * sport, dport, server-side.2323+ * @MPTCP_EVENT_CLOSED: A MPTCP connection has stopped. Attribute: token.2424+ * @MPTCP_EVENT_ANNOUNCED: A new address has been announced by the peer.2525+ * Attributes: token, rem_id, family, daddr4 | daddr6 [, dport].2626+ * @MPTCP_EVENT_REMOVED: An address has been lost by the peer. Attributes:2727+ * token, rem_id.2828+ * @MPTCP_EVENT_SUB_ESTABLISHED: A new subflow has been established. 'error'2929+ * should not be set. Attributes: token, family, loc_id, rem_id, saddr4 |3030+ * saddr6, daddr4 | daddr6, sport, dport, backup, if_idx [, error].3131+ * @MPTCP_EVENT_SUB_CLOSED: A subflow has been closed. An error (copy of3232+ * sk_err) could be set if an error has been detected for this subflow.3333+ * Attributes: token, family, loc_id, rem_id, saddr4 | saddr6, daddr4 |3434+ * daddr6, sport, dport, backup, if_idx [, error].3535+ * @MPTCP_EVENT_SUB_PRIORITY: The priority of a subflow has changed. 'error'3636+ * should not be set. Attributes: token, family, loc_id, rem_id, saddr4 |3737+ * saddr6, daddr4 | daddr6, sport, dport, backup, if_idx [, error].3838+ * @MPTCP_EVENT_LISTENER_CREATED: A new PM listener is created. Attributes:3939+ * family, sport, saddr4 | saddr6.4040+ * @MPTCP_EVENT_LISTENER_CLOSED: A PM listener is closed. Attributes: family,4141+ * sport, saddr4 | saddr6.4042 */4143enum mptcp_event_type {4244 MPTCP_EVENT_UNSPEC,
+10-3
include/uapi/linux/stddef.h
···88#define __always_inline inline99#endif10101111+/* Not all C++ standards support type declarations inside an anonymous union */1212+#ifndef __cplusplus1313+#define __struct_group_tag(TAG) TAG1414+#else1515+#define __struct_group_tag(TAG)1616+#endif1717+1118/**1219 * __struct_group() - Create a mirrored named and anonyomous struct1320 *···2720 * and size: one anonymous and one named. The former's members can be used2821 * normally without sub-struct naming, and the latter can be used to2922 * reason about the start, end, and size of the group of struct members.3030- * The named struct can also be explicitly tagged for layer reuse, as well3131- * as both having struct attributes appended.2323+ * The named struct can also be explicitly tagged for layer reuse (C only),2424+ * as well as both having struct attributes appended.3225 */3326#define __struct_group(TAG, NAME, ATTRS, MEMBERS...) \3427 union { \3528 struct { MEMBERS } ATTRS; \3636- struct TAG { MEMBERS } ATTRS NAME; \2929+ struct __struct_group_tag(TAG) { MEMBERS } ATTRS NAME; \3730 } ATTRS38313932#ifdef __cplusplus
-2
include/ufs/ufshcd.h
···329329 * @program_key: program or evict an inline encryption key330330 * @fill_crypto_prdt: initialize crypto-related fields in the PRDT331331 * @event_notify: called to notify important events332332- * @reinit_notify: called to notify reinit of UFSHCD during max gear switch333332 * @mcq_config_resource: called to configure MCQ platform resources334333 * @get_hba_mac: reports maximum number of outstanding commands supported by335334 * the controller. Should be implemented for UFSHCI 4.0 or later···380381 void *prdt, unsigned int num_segments);381382 void (*event_notify)(struct ufs_hba *hba,382383 enum ufs_event_type evt, void *data);383383- void (*reinit_notify)(struct ufs_hba *);384384 int (*mcq_config_resource)(struct ufs_hba *hba);385385 int (*get_hba_mac)(struct ufs_hba *hba);386386 int (*op_runtime_config)(struct ufs_hba *hba);
···320320 ret |= io_alloc_cache_init(&ctx->rw_cache, IO_ALLOC_CACHE_MAX,321321 sizeof(struct io_async_rw));322322 ret |= io_alloc_cache_init(&ctx->uring_cache, IO_ALLOC_CACHE_MAX,323323- sizeof(struct uring_cache));323323+ sizeof(struct io_uring_cmd_data));324324 spin_lock_init(&ctx->msg_lock);325325 ret |= io_alloc_cache_init(&ctx->msg_cache, IO_ALLOC_CACHE_MAX,326326 sizeof(struct io_kiocb));···1226122612271227 /* SQPOLL doesn't need the task_work added, it'll run it itself */12281228 if (ctx->flags & IORING_SETUP_SQPOLL) {12291229- struct io_sq_data *sqd = ctx->sq_data;12301230-12311231- if (sqd->thread)12321232- __set_notify_signal(sqd->thread);12291229+ __set_notify_signal(tctx->task);12331230 return;12341231 }12351232···2810281328112814 if (unlikely(!ctx->poll_activated))28122815 io_activate_pollwq(ctx);28132813-28142814- poll_wait(file, &ctx->poll_wq, wait);28152816 /*28162816- * synchronizes with barrier from wq_has_sleeper call in28172817- * io_commit_cqring28172817+ * provides mb() which pairs with barrier from wq_has_sleeper28182818+ * call in io_commit_cqring28182819 */28192819- smp_rmb();28202820+ poll_wait(file, &ctx->poll_wq, wait);28212821+28202822 if (!io_sqring_full(ctx))28212823 mask |= EPOLLOUT | EPOLLWRNORM;28222824
+4-3
io_uring/io_uring.h
···125125#if defined(CONFIG_PROVE_LOCKING)126126 lockdep_assert(in_task());127127128128+ if (ctx->flags & IORING_SETUP_DEFER_TASKRUN)129129+ lockdep_assert_held(&ctx->uring_lock);130130+128131 if (ctx->flags & IORING_SETUP_IOPOLL) {129132 lockdep_assert_held(&ctx->uring_lock);130133 } else if (!ctx->task_complete) {···139136 * Not from an SQE, as those cannot be submitted, but via140137 * updating tagged resources.141138 */142142- if (percpu_ref_is_dying(&ctx->refs))143143- lockdep_assert(current_work());144144- else139139+ if (!percpu_ref_is_dying(&ctx->refs))145140 lockdep_assert(current == ctx->submitter_task);146141 }147142#endif
···197197198198/*199199 * There are two global locks guarding cpuset structures - cpuset_mutex and200200- * callback_lock. We also require taking task_lock() when dereferencing a201201- * task's cpuset pointer. See "The task_lock() exception", at the end of this202202- * comment. The cpuset code uses only cpuset_mutex. Other kernel subsystems203203- * can use cpuset_lock()/cpuset_unlock() to prevent change to cpuset200200+ * callback_lock. The cpuset code uses only cpuset_mutex. Other kernel201201+ * subsystems can use cpuset_lock()/cpuset_unlock() to prevent change to cpuset204202 * structures. Note that cpuset_mutex needs to be a mutex as it is used in205203 * paths that rely on priority inheritance (e.g. scheduler - on RT) for206204 * correctness.···227229 * The cpuset_common_seq_show() handlers only hold callback_lock across228230 * small pieces of code, such as when reading out possibly multi-word229231 * cpumasks and nodemasks.230230- *231231- * Accessing a task's cpuset should be done in accordance with the232232- * guidelines for accessing subsystem state in kernel/cgroup.c233232 */234233235234static DEFINE_MUTEX(cpuset_mutex);···885890 */886891 if (cgrpv2) {887892 for (i = 0; i < ndoms; i++) {888888- cpumask_copy(doms[i], csa[i]->effective_cpus);893893+ /*894894+ * The top cpuset may contain some boot time isolated895895+ * CPUs that need to be excluded from the sched domain.896896+ */897897+ if (csa[i] == &top_cpuset)898898+ cpumask_and(doms[i], csa[i]->effective_cpus,899899+ housekeeping_cpumask(HK_TYPE_DOMAIN));900900+ else901901+ cpumask_copy(doms[i], csa[i]->effective_cpus);889902 if (dattr)890903 dattr[i] = SD_ATTR_INIT;891904 }···31243121 int retval = -ENODEV;3125312231263123 buf = strstrip(buf);31273127-31283128- /*31293129- * CPU or memory hotunplug may leave @cs w/o any execution31303130- * resources, in which case the hotplug code asynchronously updates31313131- * configuration and transfers all tasks to the nearest ancestor31323132- * which can execute.31333133- *31343134- * As writes to "cpus" or "mems" may restore @cs's execution31353135- * resources, wait for the previously scheduled operations before31363136- * proceeding, so that we don't end up keep removing tasks added31373137- * after execution capability is restored.31383138- *31393139- * cpuset_handle_hotplug may call back into cgroup core asynchronously31403140- * via cgroup_transfer_tasks() and waiting for it from a cgroupfs31413141- * operation like this one can lead to a deadlock through kernfs31423142- * active_ref protection. Let's break the protection. Losing the31433143- * protection is okay as we check whether @cs is online after31443144- * grabbing cpuset_mutex anyway. This only happens on the legacy31453145- * hierarchies.31463146- */31473147- css_get(&cs->css);31483148- kernfs_break_active_protection(of->kn);31493149-31503124 cpus_read_lock();31513125 mutex_lock(&cpuset_mutex);31523126 if (!is_cpuset_online(cs))···31563176out_unlock:31573177 mutex_unlock(&cpuset_mutex);31583178 cpus_read_unlock();31593159- kernfs_unbreak_active_protection(of->kn);31603160- css_put(&cs->css);31613179 flush_workqueue(cpuset_migrate_mm_wq);31623180 return retval ?: nbytes;31633181}
···89899090# Create archive and try to normalize metadata for reproducibility.9191tar "${KBUILD_BUILD_TIMESTAMP:+--mtime=$KBUILD_BUILD_TIMESTAMP}" \9292+ --exclude=".__afs*" --exclude=".nfs*" \9293 --owner=0 --group=0 --sort=name --numeric-owner --mode=u=rw,go=r,a+X \9394 -I $XZ -cf $tarfile -C $cpio_dir/ . > /dev/null9495
+1-1
kernel/kcov.c
···166166 * Unlike in_serving_softirq(), this function returns false when called during167167 * a hardirq or an NMI that happened in the softirq context.168168 */169169-static inline bool in_softirq_really(void)169169+static __always_inline bool in_softirq_really(void)170170{171171 return in_serving_softirq() && !in_hardirq() && !in_nmi();172172}
+16-2
kernel/locking/rtmutex.c
···12921292 */12931293 get_task_struct(owner);1294129412951295+ preempt_disable();12951296 raw_spin_unlock_irq(&lock->wait_lock);12971297+ /* wake up any tasks on the wake_q before calling rt_mutex_adjust_prio_chain */12981298+ wake_up_q(wake_q);12991299+ wake_q_init(wake_q);13001300+ preempt_enable();13011301+1296130212971303 res = rt_mutex_adjust_prio_chain(owner, chwalk, lock,12981304 next_lock, waiter, task);···16021596 * or TASK_UNINTERRUPTIBLE)16031597 * @timeout: the pre-initialized and started timer, or NULL for none16041598 * @waiter: the pre-initialized rt_mutex_waiter15991599+ * @wake_q: wake_q of tasks to wake when we drop the lock->wait_lock16051600 *16061601 * Must be called with lock->wait_lock held and interrupts disabled16071602 */···16101603 struct ww_acquire_ctx *ww_ctx,16111604 unsigned int state,16121605 struct hrtimer_sleeper *timeout,16131613- struct rt_mutex_waiter *waiter)16061606+ struct rt_mutex_waiter *waiter,16071607+ struct wake_q_head *wake_q)16141608 __releases(&lock->wait_lock) __acquires(&lock->wait_lock)16151609{16161610 struct rt_mutex *rtm = container_of(lock, struct rt_mutex, rtmutex);···16421634 owner = rt_mutex_owner(lock);16431635 else16441636 owner = NULL;16371637+ preempt_disable();16451638 raw_spin_unlock_irq(&lock->wait_lock);16391639+ if (wake_q) {16401640+ wake_up_q(wake_q);16411641+ wake_q_init(wake_q);16421642+ }16431643+ preempt_enable();1646164416471645 if (!owner || !rtmutex_spin_on_owner(lock, waiter, owner))16481646 rt_mutex_schedule();···1722170817231709 ret = task_blocks_on_rt_mutex(lock, waiter, current, ww_ctx, chwalk, wake_q);17241710 if (likely(!ret))17251725- ret = rt_mutex_slowlock_block(lock, ww_ctx, state, NULL, waiter);17111711+ ret = rt_mutex_slowlock_block(lock, ww_ctx, state, NULL, waiter, wake_q);1726171217271713 if (likely(!ret)) {17281714 /* acquired the lock */
+1-1
kernel/locking/rtmutex_api.c
···383383 raw_spin_lock_irq(&lock->wait_lock);384384 /* sleep on the mutex */385385 set_current_state(TASK_INTERRUPTIBLE);386386- ret = rt_mutex_slowlock_block(lock, NULL, TASK_INTERRUPTIBLE, to, waiter);386386+ ret = rt_mutex_slowlock_block(lock, NULL, TASK_INTERRUPTIBLE, to, waiter, NULL);387387 /*388388 * try_to_take_rt_mutex() sets the waiter bit unconditionally. We might389389 * have to fix that up.
+68-21
kernel/sched/ext.c
···27472747{27482748 struct scx_dsp_ctx *dspc = this_cpu_ptr(scx_dsp_ctx);27492749 bool prev_on_scx = prev->sched_class == &ext_sched_class;27502750+ bool prev_on_rq = prev->scx.flags & SCX_TASK_QUEUED;27502751 int nr_loops = SCX_DSP_MAX_LOOPS;2751275227522753 lockdep_assert_rq_held(rq);···27802779 * See scx_ops_disable_workfn() for the explanation on the27812780 * bypassing test.27822781 */27832783- if ((prev->scx.flags & SCX_TASK_QUEUED) &&27842784- prev->scx.slice && !scx_rq_bypassing(rq)) {27822782+ if (prev_on_rq && prev->scx.slice && !scx_rq_bypassing(rq)) {27852783 rq->scx.flags |= SCX_RQ_BAL_KEEP;27862784 goto has_tasks;27872785 }···2813281328142814 flush_dispatch_buf(rq);2815281528162816+ if (prev_on_rq && prev->scx.slice) {28172817+ rq->scx.flags |= SCX_RQ_BAL_KEEP;28182818+ goto has_tasks;28192819+ }28162820 if (rq->scx.local_dsq.nr)28172821 goto has_tasks;28182822 if (consume_global_dsq(rq))···28422838 * Didn't find another task to run. Keep running @prev unless28432839 * %SCX_OPS_ENQ_LAST is in effect.28442840 */28452845- if ((prev->scx.flags & SCX_TASK_QUEUED) &&28462846- (!static_branch_unlikely(&scx_ops_enq_last) ||28412841+ if (prev_on_rq && (!static_branch_unlikely(&scx_ops_enq_last) ||28472842 scx_rq_bypassing(rq))) {28482843 rq->scx.flags |= SCX_RQ_BAL_KEEP;28492844 goto has_tasks;···30373034 */30383035 if (p->scx.slice && !scx_rq_bypassing(rq)) {30393036 dispatch_enqueue(&rq->scx.local_dsq, p, SCX_ENQ_HEAD);30403040- return;30373037+ goto switch_class;30413038 }3042303930433040 /*···30543051 }30553052 }3056305330543054+switch_class:30573055 if (next && next->sched_class != &ext_sched_class)30583056 switch_class(rq, next);30593057}···35903586 cpumask_copy(idle_masks.smt, cpu_online_mask);35913587}3592358835933593-void __scx_update_idle(struct rq *rq, bool idle)35893589+static void update_builtin_idle(int cpu, bool idle)35943590{35953595- int cpu = cpu_of(rq);35963596-35973597- if (SCX_HAS_OP(update_idle) && !scx_rq_bypassing(rq)) {35983598- SCX_CALL_OP(SCX_KF_REST, update_idle, cpu_of(rq), idle);35993599- if (!static_branch_unlikely(&scx_builtin_idle_enabled))36003600- return;36013601- }36023602-36033591 if (idle)36043592 cpumask_set_cpu(cpu, idle_masks.cpu);36053593 else···36163620 }36173621 }36183622#endif36233623+}36243624+36253625+/*36263626+ * Update the idle state of a CPU to @idle.36273627+ *36283628+ * If @do_notify is true, ops.update_idle() is invoked to notify the scx36293629+ * scheduler of an actual idle state transition (idle to busy or vice36303630+ * versa). If @do_notify is false, only the idle state in the idle masks is36313631+ * refreshed without invoking ops.update_idle().36323632+ *36333633+ * This distinction is necessary, because an idle CPU can be "reserved" and36343634+ * awakened via scx_bpf_pick_idle_cpu() + scx_bpf_kick_cpu(), marking it as36353635+ * busy even if no tasks are dispatched. In this case, the CPU may return36363636+ * to idle without a true state transition. Refreshing the idle masks36373637+ * without invoking ops.update_idle() ensures accurate idle state tracking36383638+ * while avoiding unnecessary updates and maintaining balanced state36393639+ * transitions.36403640+ */36413641+void __scx_update_idle(struct rq *rq, bool idle, bool do_notify)36423642+{36433643+ int cpu = cpu_of(rq);36443644+36453645+ lockdep_assert_rq_held(rq);36463646+36473647+ /*36483648+ * Trigger ops.update_idle() only when transitioning from a task to36493649+ * the idle thread and vice versa.36503650+ *36513651+ * Idle transitions are indicated by do_notify being set to true,36523652+ * managed by put_prev_task_idle()/set_next_task_idle().36533653+ */36543654+ if (SCX_HAS_OP(update_idle) && do_notify && !scx_rq_bypassing(rq))36553655+ SCX_CALL_OP(SCX_KF_REST, update_idle, cpu_of(rq), idle);36563656+36573657+ /*36583658+ * Update the idle masks:36593659+ * - for real idle transitions (do_notify == true)36603660+ * - for idle-to-idle transitions (indicated by the previous task36613661+ * being the idle thread, managed by pick_task_idle())36623662+ *36633663+ * Skip updating idle masks if the previous task is not the idle36643664+ * thread, since set_next_task_idle() has already handled it when36653665+ * transitioning from a task to the idle thread (calling this36663666+ * function with do_notify == true).36673667+ *36683668+ * In this way we can avoid updating the idle masks twice,36693669+ * unnecessarily.36703670+ */36713671+ if (static_branch_likely(&scx_builtin_idle_enabled))36723672+ if (do_notify || is_idle_task(rq->curr))36733673+ update_builtin_idle(cpu, idle);36193674}3620367536213676static void handle_hotplug(struct rq *rq, bool online)···47914744 */47924745 for_each_possible_cpu(cpu) {47934746 struct rq *rq = cpu_rq(cpu);47944794- struct rq_flags rf;47954747 struct task_struct *p, *n;4796474847974797- rq_lock(rq, &rf);47494749+ raw_spin_rq_lock(rq);4798475047994751 if (bypass) {48004752 WARN_ON_ONCE(rq->scx.flags & SCX_RQ_BYPASSING);···48094763 * sees scx_rq_bypassing() before moving tasks to SCX.48104764 */48114765 if (!scx_enabled()) {48124812- rq_unlock_irqrestore(rq, &rf);47664766+ raw_spin_rq_unlock(rq);48134767 continue;48144768 }48154769···48294783 sched_enq_and_set_task(&ctx);48304784 }4831478548324832- rq_unlock(rq, &rf);48334833-48344786 /* resched to restore ticks and idle state */48354835- resched_cpu(cpu);47874787+ if (cpu_online(cpu) || cpu == smp_processor_id())47884788+ resched_curr(rq);47894789+47904790+ raw_spin_rq_unlock(rq);48364791 }4837479248384793 atomic_dec(&scx_ops_breather_depth);···70607013 return -ENOENT;7061701470627015 INIT_LIST_HEAD(&kit->cursor.node);70637063- kit->cursor.flags |= SCX_DSQ_LNODE_ITER_CURSOR | flags;70167016+ kit->cursor.flags = SCX_DSQ_LNODE_ITER_CURSOR | flags;70647017 kit->cursor.priv = READ_ONCE(kit->dsq->seq);7065701870667019 return 0;
···50875087 cpumask_var_t tracing_cpumask_new;50885088 int err;5089508950905090+ if (count == 0 || count > KMALLOC_MAX_SIZE)50915091+ return -EINVAL;50925092+50905093 if (!zalloc_cpumask_var(&tracing_cpumask_new, GFP_KERNEL))50915094 return -ENOMEM;50925095
+12
kernel/trace/trace_events.c
···365365 } while (s < e);366366367367 /*368368+ * Check for arrays. If the argument has: foo[REC->val]369369+ * then it is very likely that foo is an array of strings370370+ * that are safe to use.371371+ */372372+ r = strstr(s, "[");373373+ if (r && r < e) {374374+ r = strstr(r, "REC->");375375+ if (r && r < e)376376+ return true;377377+ }378378+379379+ /*368380 * If there's any strings in the argument consider this arg OK as it369381 * could be: REC->field ? "foo" : "bar" and we don't want to get into370382 * verifying that logic here.
+5-3
kernel/trace/trace_kprobe.c
···725725726726static struct notifier_block trace_kprobe_module_nb = {727727 .notifier_call = trace_kprobe_module_callback,728728- .priority = 1 /* Invoked after kprobe module callback */728728+ .priority = 2 /* Invoked after kprobe and jump_label module callback */729729};730730static int trace_kprobe_register_module_notifier(void)731731{···940940 }941941 /* a symbol specified */942942 symbol = kstrdup(argv[1], GFP_KERNEL);943943- if (!symbol)944944- return -ENOMEM;943943+ if (!symbol) {944944+ ret = -ENOMEM;945945+ goto error;946946+ }945947946948 tmp = strchr(symbol, '%');947949 if (tmp) {
+21-9
kernel/workqueue.c
···25082508 return;25092509 }2510251025112511+ WARN_ON_ONCE(cpu != WORK_CPU_UNBOUND && !cpu_online(cpu));25112512 dwork->wq = wq;25122513 dwork->cpu = cpu;25132514 timer->expires = jiffies + delay;···25332532 * @wq: workqueue to use25342533 * @dwork: work to queue25352534 * @delay: number of jiffies to wait before queueing25352535+ *25362536+ * We queue the delayed_work to a specific CPU, for non-zero delays the25372537+ * caller must ensure it is online and can't go away. Callers that fail25382538+ * to ensure this, may get @dwork->timer queued to an offlined CPU and25392539+ * this will prevent queueing of @dwork->work unless the offlined CPU25402540+ * becomes online again.25362541 *25372542 * Return: %false if @work was already on a queue, %true otherwise. If25382543 * @delay is zero and @dwork is idle, it will be scheduled for immediate···36873680 * check_flush_dependency - check for flush dependency sanity36883681 * @target_wq: workqueue being flushed36893682 * @target_work: work item being flushed (NULL for workqueue flushes)36833683+ * @from_cancel: are we called from the work cancel path36903684 *36913685 * %current is trying to flush the whole @target_wq or @target_work on it.36923692- * If @target_wq doesn't have %WQ_MEM_RECLAIM, verify that %current is not36933693- * reclaiming memory or running on a workqueue which doesn't have36943694- * %WQ_MEM_RECLAIM as that can break forward-progress guarantee leading to36953695- * a deadlock.36863686+ * If this is not the cancel path (which implies work being flushed is either36873687+ * already running, or will not be at all), check if @target_wq doesn't have36883688+ * %WQ_MEM_RECLAIM and verify that %current is not reclaiming memory or running36893689+ * on a workqueue which doesn't have %WQ_MEM_RECLAIM as that can break forward-36903690+ * progress guarantee leading to a deadlock.36963691 */36973692static void check_flush_dependency(struct workqueue_struct *target_wq,36983698- struct work_struct *target_work)36933693+ struct work_struct *target_work,36943694+ bool from_cancel)36993695{37003700- work_func_t target_func = target_work ? target_work->func : NULL;36963696+ work_func_t target_func;37013697 struct worker *worker;3702369837033703- if (target_wq->flags & WQ_MEM_RECLAIM)36993699+ if (from_cancel || target_wq->flags & WQ_MEM_RECLAIM)37043700 return;3705370137063702 worker = current_wq_worker();37033703+ target_func = target_work ? target_work->func : NULL;3707370437083705 WARN_ONCE(current->flags & PF_MEMALLOC,37093706 "workqueue: PF_MEMALLOC task %d(%s) is flushing !WQ_MEM_RECLAIM %s:%ps",···39913980 list_add_tail(&this_flusher.list, &wq->flusher_overflow);39923981 }3993398239943994- check_flush_dependency(wq, NULL);39833983+ check_flush_dependency(wq, NULL, false);3995398439963985 mutex_unlock(&wq->mutex);39973986···41664155 }4167415641684157 wq = pwq->wq;41694169- check_flush_dependency(wq, work);41584158+ check_flush_dependency(wq, work, from_cancel);4170415941714160 insert_wq_barrier(pwq, barr, work, worker);41724161 raw_spin_unlock_irq(&pool->lock);···56525641 } while (activated);56535642}5654564356445644+__printf(1, 0)56555645static struct workqueue_struct *__alloc_workqueue(const char *fmt,56565646 unsigned int flags,56575647 int max_active, va_list args)
···170170 return error;171171}172172173173-static unsigned int *memfd_file_seals_ptr(struct file *file)173173+unsigned int *memfd_file_seals_ptr(struct file *file)174174{175175 if (shmem_file(file))176176 return &SHMEM_I(file_inode(file))->seals;
+5-1
mm/mmap.c
···4747#include <linux/oom.h>4848#include <linux/sched/mm.h>4949#include <linux/ksm.h>5050+#include <linux/memfd.h>50515152#include <linux/uaccess.h>5253#include <asm/cacheflush.h>···369368370369 if (file) {371370 struct inode *inode = file_inode(file);371371+ unsigned int seals = memfd_file_seals(file);372372 unsigned long flags_mask;373373374374 if (!file_mmap_ok(file, inode, pgoff, len))···410408 vm_flags |= VM_SHARED | VM_MAYSHARE;411409 if (!(file->f_mode & FMODE_WRITE))412410 vm_flags &= ~(VM_MAYWRITE | VM_SHARED);411411+ else if (is_readonly_sealed(seals, vm_flags))412412+ vm_flags &= ~VM_MAYWRITE;413413 fallthrough;414414 case MAP_PRIVATE:415415 if (!(file->f_mode & FMODE_READ))···892888893889 if (get_area) {894890 addr = get_area(file, addr, len, pgoff, flags);895895- } else if (IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE)891891+ } else if (IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE) && !file896892 && !addr /* no hint */897893 && IS_ALIGNED(len, PMD_SIZE)) {898894 /* Ensures that larger anonymous mappings are THP aligned. */
+5-1
mm/readahead.c
···646646 1UL << order);647647 if (index == expected) {648648 ra->start += ra->size;649649- ra->size = get_next_ra_size(ra, max_pages);649649+ /*650650+ * In the case of MADV_HUGEPAGE, the actual size might exceed651651+ * the readahead window.652652+ */653653+ ra->size = max(ra->size, get_next_ra_size(ra, max_pages));650654 ra->async_size = ra->size;651655 goto readit;652656 }
+4-3
mm/shmem.c
···15351535 !shmem_falloc->waitq &&15361536 index >= shmem_falloc->start &&15371537 index < shmem_falloc->next)15381538- shmem_falloc->nr_unswapped++;15381538+ shmem_falloc->nr_unswapped += nr_pages;15391539 else15401540 shmem_falloc = NULL;15411541 spin_unlock(&inode->i_lock);···16891689 unsigned long mask = READ_ONCE(huge_shmem_orders_always);16901690 unsigned long within_size_orders = READ_ONCE(huge_shmem_orders_within_size);16911691 unsigned long vm_flags = vma ? vma->vm_flags : 0;16921692+ pgoff_t aligned_index;16921693 bool global_huge;16931694 loff_t i_size;16941695 int order;···17241723 /* Allow mTHP that will be fully within i_size. */17251724 order = highest_order(within_size_orders);17261725 while (within_size_orders) {17271727- index = round_up(index + 1, order);17261726+ aligned_index = round_up(index + 1, 1 << order);17281727 i_size = round_up(i_size_read(inode), PAGE_SIZE);17291729- if (i_size >> PAGE_SHIFT >= index) {17281728+ if (i_size >> PAGE_SHIFT >= aligned_index) {17301729 mask |= within_size_orders;17311730 break;17321731 }
+1-6
mm/util.c
···297297{298298 char *p;299299300300- /*301301- * Always use GFP_KERNEL, since copy_from_user() can sleep and302302- * cause pagefault, which makes it pointless to use GFP_NOFS303303- * or GFP_ATOMIC.304304- */305305- p = kmalloc_track_caller(len + 1, GFP_KERNEL);300300+ p = kmem_buckets_alloc_track_caller(user_buckets, len + 1, GFP_USER | __GFP_NOWARN);306301 if (!p)307302 return ERR_PTR(-ENOMEM);308303
+8-1
mm/vmscan.c
···374374 if (can_reclaim_anon_pages(NULL, zone_to_nid(zone), NULL))375375 nr += zone_page_state_snapshot(zone, NR_ZONE_INACTIVE_ANON) +376376 zone_page_state_snapshot(zone, NR_ZONE_ACTIVE_ANON);377377-377377+ /*378378+ * If there are no reclaimable file-backed or anonymous pages,379379+ * ensure zones with sufficient free pages are not skipped.380380+ * This prevents zones like DMA32 from being ignored in reclaim381381+ * scenarios where they can still help alleviate memory pressure.382382+ */383383+ if (nr == 0)384384+ nr = zone_page_state_snapshot(zone, NR_FREE_PAGES);378385 return nr;379386}380387
···5555 goto drop;56565757 rcu_read_lock();5858- proto = find_snap_client(skb_transport_header(skb));5858+ proto = find_snap_client(skb->data);5959 if (proto) {6060 /* Pass the frame on. */6161- skb->transport_header += 5;6261 skb_pull_rcsum(skb, 5);6262+ skb_reset_transport_header(skb);6363 rc = proto->rcvfunc(skb, dev, &snap_packet_type, orig_dev);6464 }6565 rcu_read_unlock();
+6-5
net/bluetooth/hci_sync.c
···1031103110321032static int hci_set_random_addr_sync(struct hci_dev *hdev, bdaddr_t *rpa)10331033{10341034- /* If we're advertising or initiating an LE connection we can't10351035- * go ahead and change the random address at this time. This is10361036- * because the eventual initiator address used for the10341034+ /* If a random_addr has been set we're advertising or initiating an LE10351035+ * connection we can't go ahead and change the random address at this10361036+ * time. This is because the eventual initiator address used for the10371037 * subsequently created connection will be undefined (some10381038 * controllers use the new address and others the one we had10391039 * when the operation started).···10411041 * In this kind of scenario skip the update and let the random10421042 * address be updated at the next cycle.10431043 */10441044- if (hci_dev_test_flag(hdev, HCI_LE_ADV) ||10451045- hci_lookup_le_connect(hdev)) {10441044+ if (bacmp(&hdev->random_addr, BDADDR_ANY) &&10451045+ (hci_dev_test_flag(hdev, HCI_LE_ADV) ||10461046+ hci_lookup_le_connect(hdev))) {10461047 bt_dev_dbg(hdev, "Deferring random address update");10471048 hci_dev_set_flag(hdev, HCI_RPA_EXPIRED);10481049 return 0;
···753753}754754EXPORT_SYMBOL_GPL(dev_fill_forward_path);755755756756+/* must be called under rcu_read_lock(), as we dont take a reference */757757+static struct napi_struct *napi_by_id(unsigned int napi_id)758758+{759759+ unsigned int hash = napi_id % HASH_SIZE(napi_hash);760760+ struct napi_struct *napi;761761+762762+ hlist_for_each_entry_rcu(napi, &napi_hash[hash], napi_hash_node)763763+ if (napi->napi_id == napi_id)764764+ return napi;765765+766766+ return NULL;767767+}768768+769769+/* must be called under rcu_read_lock(), as we dont take a reference */770770+struct napi_struct *netdev_napi_by_id(struct net *net, unsigned int napi_id)771771+{772772+ struct napi_struct *napi;773773+774774+ napi = napi_by_id(napi_id);775775+ if (!napi)776776+ return NULL;777777+778778+ if (WARN_ON_ONCE(!napi->dev))779779+ return NULL;780780+ if (!net_eq(net, dev_net(napi->dev)))781781+ return NULL;782782+783783+ return napi;784784+}785785+756786/**757787 * __dev_get_by_name - find a device by its name758788 * @net: the applicable net namespace···3672364236733643 if (features & (NETIF_F_IP_CSUM | NETIF_F_IPV6_CSUM)) {36743644 if (vlan_get_protocol(skb) == htons(ETH_P_IPV6) &&36753675- skb_network_header_len(skb) != sizeof(struct ipv6hdr))36453645+ skb_network_header_len(skb) != sizeof(struct ipv6hdr) &&36463646+ !ipv6_has_hopopt_jumbo(skb))36763647 goto sw_checksum;36483648+36773649 switch (skb->csum_offset) {36783650 case offsetof(struct tcphdr, check):36793651 case offsetof(struct udphdr, check):···63226290 return ret;63236291}63246292EXPORT_SYMBOL(napi_complete_done);63256325-63266326-/* must be called under rcu_read_lock(), as we dont take a reference */63276327-struct napi_struct *napi_by_id(unsigned int napi_id)63286328-{63296329- unsigned int hash = napi_id % HASH_SIZE(napi_hash);63306330- struct napi_struct *napi;63316331-63326332- hlist_for_each_entry_rcu(napi, &napi_hash[hash], napi_hash_node)63336333- if (napi->napi_id == napi_id)63346334- return napi;63356335-63366336- return NULL;63376337-}6338629363396294static void skb_defer_free_flush(struct softnet_data *sd)63406295{
+2-1
net/core/dev.h
···22222323extern int netdev_flow_limit_table_len;24242525+struct napi_struct *netdev_napi_by_id(struct net *net, unsigned int napi_id);2626+2527#ifdef CONFIG_PROC_FS2628int __init dev_proc_init(void);2729#else···271269static inline void xdp_do_check_flushed(struct napi_struct *napi) { }272270#endif273271274274-struct napi_struct *napi_by_id(unsigned int napi_id);275272void kick_defer_list_purge(struct softnet_data *sd, unsigned int cpu);276273277274#define XMIT_RECURSION_LIMIT 8
+7-3
net/core/link_watch.c
···4242 * first check whether lower is indeed the source of its down state.4343 */4444 if (!netif_carrier_ok(dev)) {4545- int iflink = dev_get_iflink(dev);4645 struct net_device *peer;4646+ int iflink;47474848 /* If called from netdev_run_todo()/linkwatch_sync_dev(),4949 * dev_net(dev) can be already freed, and RTNL is not held.5050 */5151- if (dev->reg_state == NETREG_UNREGISTERED ||5252- iflink == dev->ifindex)5151+ if (dev->reg_state <= NETREG_REGISTERED)5252+ iflink = dev_get_iflink(dev);5353+ else5454+ iflink = dev->ifindex;5555+5656+ if (iflink == dev->ifindex)5357 return IF_OPER_DOWN;54585559 ASSERT_RTNL();
+10-7
net/core/netdev-genl.c
···167167 void *hdr;168168 pid_t pid;169169170170- if (WARN_ON_ONCE(!napi->dev))171171- return -EINVAL;172170 if (!(napi->dev->flags & IFF_UP))173171 return 0;174172···174176 if (!hdr)175177 return -EMSGSIZE;176178177177- if (napi->napi_id >= MIN_NAPI_ID &&178178- nla_put_u32(rsp, NETDEV_A_NAPI_ID, napi->napi_id))179179+ if (nla_put_u32(rsp, NETDEV_A_NAPI_ID, napi->napi_id))179180 goto nla_put_failure;180181181182 if (nla_put_u32(rsp, NETDEV_A_NAPI_IFINDEX, napi->dev->ifindex))···232235 rtnl_lock();233236 rcu_read_lock();234237235235- napi = napi_by_id(napi_id);238238+ napi = netdev_napi_by_id(genl_info_net(info), napi_id);236239 if (napi) {237240 err = netdev_nl_napi_fill_one(rsp, napi, info);238241 } else {···243246 rcu_read_unlock();244247 rtnl_unlock();245248246246- if (err)249249+ if (err) {247250 goto err_free_msg;251251+ } else if (!rsp->len) {252252+ err = -ENOENT;253253+ goto err_free_msg;254254+ }248255249256 return genlmsg_reply(rsp, info);250257···269268 return err;270269271270 list_for_each_entry(napi, &netdev->napi_list, dev_list) {271271+ if (napi->napi_id < MIN_NAPI_ID)272272+ continue;272273 if (ctx->napi_id && napi->napi_id >= ctx->napi_id)273274 continue;274275···353350 rtnl_lock();354351 rcu_read_lock();355352356356- napi = napi_by_id(napi_id);353353+ napi = netdev_napi_by_id(genl_info_net(info), napi_id);357354 if (napi) {358355 err = netdev_nl_napi_set_config(napi, info);359356 } else {
+4-1
net/core/sock.c
···12951295 sk->sk_reuse = (valbool ? SK_CAN_REUSE : SK_NO_REUSE);12961296 break;12971297 case SO_REUSEPORT:12981298- sk->sk_reuseport = valbool;12981298+ if (valbool && !sk_is_inet(sk))12991299+ ret = -EOPNOTSUPP;13001300+ else13011301+ sk->sk_reuseport = valbool;12991302 break;13001303 case SO_DONTROUTE:13011304 sock_valbool_flag(sk, SOCK_LOCALROUTE, valbool);
···102102}103103104104#ifdef CONFIG_SYSCTL105105-static int mptcp_set_scheduler(const struct net *net, const char *name)105105+static int mptcp_set_scheduler(char *scheduler, const char *name)106106{107107- struct mptcp_pernet *pernet = mptcp_get_pernet(net);108107 struct mptcp_sched_ops *sched;109108 int ret = 0;110109111110 rcu_read_lock();112111 sched = mptcp_sched_find(name);113112 if (sched)114114- strscpy(pernet->scheduler, name, MPTCP_SCHED_NAME_MAX);113113+ strscpy(scheduler, name, MPTCP_SCHED_NAME_MAX);115114 else116115 ret = -ENOENT;117116 rcu_read_unlock();···121122static int proc_scheduler(const struct ctl_table *ctl, int write,122123 void *buffer, size_t *lenp, loff_t *ppos)123124{124124- const struct net *net = current->nsproxy->net_ns;125125+ char (*scheduler)[MPTCP_SCHED_NAME_MAX] = ctl->data;125126 char val[MPTCP_SCHED_NAME_MAX];126127 struct ctl_table tbl = {127128 .data = val,···129130 };130131 int ret;131132132132- strscpy(val, mptcp_get_scheduler(net), MPTCP_SCHED_NAME_MAX);133133+ strscpy(val, *scheduler, MPTCP_SCHED_NAME_MAX);133134134135 ret = proc_dostring(&tbl, write, buffer, lenp, ppos);135136 if (write && ret == 0)136136- ret = mptcp_set_scheduler(net, val);137137+ ret = mptcp_set_scheduler(*scheduler, val);137138138139 return ret;139140}···160161 int write, void *buffer, size_t *lenp,161162 loff_t *ppos)162163{163163- struct mptcp_pernet *pernet = mptcp_get_pernet(current->nsproxy->net_ns);164164+ struct mptcp_pernet *pernet = container_of(table->data,165165+ struct mptcp_pernet,166166+ blackhole_timeout);164167 int ret;165168166169 ret = proc_dointvec_minmax(table, write, buffer, lenp, ppos);···229228 {230229 .procname = "available_schedulers",231230 .maxlen = MPTCP_SCHED_BUF_MAX,232232- .mode = 0644,231231+ .mode = 0444,233232 .proc_handler = proc_available_schedulers,234233 },235234 {
+7
net/mptcp/options.c
···667667 &echo, &drop_other_suboptions))668668 return false;669669670670+ /*671671+ * Later on, mptcp_write_options() will enforce mutually exclusion with672672+ * DSS, bail out if such option is set and we can't drop it.673673+ */670674 if (drop_other_suboptions)671675 remaining += opt_size;676676+ else if (opts->suboptions & OPTION_MPTCP_DSS)677677+ return false;678678+672679 len = mptcp_add_addr_len(opts->addr.family, echo, !!opts->addr.port);673680 if (remaining < len)674681 return false;
···519519 impl{T} HasWork<Self> for ClosureWork<T> { self.work }520520}521521522522-// SAFETY: TODO.522522+// SAFETY: The `__enqueue` implementation in RawWorkItem uses a `work_struct` initialized with the523523+// `run` method of this trait as the function pointer because:524524+// - `__enqueue` gets the `work_struct` from the `Work` field, using `T::raw_get_work`.525525+// - The only safe way to create a `Work` object is through `Work::new`.526526+// - `Work::new` makes sure that `T::Pointer::run` is passed to `init_work_with_key`.527527+// - Finally `Work` and `RawWorkItem` guarantee that the correct `Work` field528528+// will be used because of the ID const generic bound. This makes sure that `T::raw_get_work`529529+// uses the correct offset for the `Work` field, and `Work::new` picks the correct530530+// implementation of `WorkItemPointer` for `Arc<T>`.523531unsafe impl<T, const ID: u64> WorkItemPointer<ID> for Arc<T>524532where525533 T: WorkItem<ID, Pointer = Self>,···545537 }546538}547539548548-// SAFETY: TODO.540540+// SAFETY: The `work_struct` raw pointer is guaranteed to be valid for the duration of the call to541541+// the closure because we get it from an `Arc`, which means that the ref count will be at least 1,542542+// and we don't drop the `Arc` ourselves. If `queue_work_on` returns true, it is further guaranteed543543+// to be valid until a call to the function pointer in `work_struct` because we leak the memory it544544+// points to, and only reclaim it if the closure returns false, or in `WorkItemPointer::run`, which545545+// is what the function pointer in the `work_struct` must be pointing to, according to the safety546546+// requirements of `WorkItemPointer`.549547unsafe impl<T, const ID: u64> RawWorkItem<ID> for Arc<T>550548where551549 T: WorkItem<ID, Pointer = Self>,
+2-2
scripts/mksysmap
···2626# (do not forget a space before each pattern)27272828# local symbols for ARM, MIPS, etc.2929-/ \\$/d2929+/ \$/d30303131# local labels, .LBB, .Ltmpxxx, .L__unnamed_xx, .LASANPC, etc.3232/ \.L/d···3939/ __pi_\.L/d40404141# arm64 local symbols in non-VHE KVM namespace4242-/ __kvm_nvhe_\\$/d4242+/ __kvm_nvhe_\$/d4343/ __kvm_nvhe_\.L/d44444545# lld arm/aarch64/mips thunks
+17-19
scripts/mod/file2alias.c
···132132 * based at address m.133133 */134134#define DEF_FIELD(m, devid, f) \135135- typeof(((struct devid *)0)->f) f = TO_NATIVE(*(typeof(f) *)((m) + OFF_##devid##_##f))135135+ typeof(((struct devid *)0)->f) f = \136136+ get_unaligned_native((typeof(f) *)((m) + OFF_##devid##_##f))136137137138/* Define a variable f that holds the address of field f of struct devid138139 * based at address m. Due to the way typeof works, for a field of type···601600static void do_pcmcia_entry(struct module *mod, void *symval)602601{603602 char alias[256] = {};604604- unsigned int i;603603+605604 DEF_FIELD(symval, pcmcia_device_id, match_flags);606605 DEF_FIELD(symval, pcmcia_device_id, manf_id);607606 DEF_FIELD(symval, pcmcia_device_id, card_id);···609608 DEF_FIELD(symval, pcmcia_device_id, function);610609 DEF_FIELD(symval, pcmcia_device_id, device_no);611610 DEF_FIELD_ADDR(symval, pcmcia_device_id, prod_id_hash);612612-613613- for (i=0; i<4; i++) {614614- (*prod_id_hash)[i] = TO_NATIVE((*prod_id_hash)[i]);615615- }616611617612 ADD(alias, "m", match_flags & PCMCIA_DEV_ID_MATCH_MANF_ID,618613 manf_id);···620623 function);621624 ADD(alias, "pfn", match_flags & PCMCIA_DEV_ID_MATCH_DEVICE_NO,622625 device_no);623623- ADD(alias, "pa", match_flags & PCMCIA_DEV_ID_MATCH_PROD_ID1, (*prod_id_hash)[0]);624624- ADD(alias, "pb", match_flags & PCMCIA_DEV_ID_MATCH_PROD_ID2, (*prod_id_hash)[1]);625625- ADD(alias, "pc", match_flags & PCMCIA_DEV_ID_MATCH_PROD_ID3, (*prod_id_hash)[2]);626626- ADD(alias, "pd", match_flags & PCMCIA_DEV_ID_MATCH_PROD_ID4, (*prod_id_hash)[3]);626626+ ADD(alias, "pa", match_flags & PCMCIA_DEV_ID_MATCH_PROD_ID1,627627+ get_unaligned_native(*prod_id_hash + 0));628628+ ADD(alias, "pb", match_flags & PCMCIA_DEV_ID_MATCH_PROD_ID2,629629+ get_unaligned_native(*prod_id_hash + 1));630630+ ADD(alias, "pc", match_flags & PCMCIA_DEV_ID_MATCH_PROD_ID3,631631+ get_unaligned_native(*prod_id_hash + 2));632632+ ADD(alias, "pd", match_flags & PCMCIA_DEV_ID_MATCH_PROD_ID4,633633+ get_unaligned_native(*prod_id_hash + 3));627634628635 module_alias_printf(mod, true, "pcmcia:%s", alias);629636}···655654{656655 unsigned int i;657656658658- for (i = min / BITS_PER_LONG; i < max / BITS_PER_LONG + 1; i++)659659- arr[i] = TO_NATIVE(arr[i]);660660- for (i = min; i < max; i++)661661- if (arr[i / BITS_PER_LONG] & (1ULL << (i%BITS_PER_LONG)))657657+ for (i = min; i <= max; i++)658658+ if (get_unaligned_native(arr + i / BITS_PER_LONG) &659659+ (1ULL << (i % BITS_PER_LONG)))662660 sprintf(alias + strlen(alias), "%X,*", i);663661}664662···812812 * Each byte of the guid will be represented by two hex characters813813 * in the name.814814 */815815-816815static void do_vmbus_entry(struct module *mod, void *symval)817816{818818- int i;819817 DEF_FIELD_ADDR(symval, hv_vmbus_device_id, guid);820820- char guid_name[(sizeof(*guid) + 1) * 2];818818+ char guid_name[sizeof(*guid) * 2 + 1];821819822822- for (i = 0; i < (sizeof(*guid) * 2); i += 2)823823- sprintf(&guid_name[i], "%02x", TO_NATIVE((guid->b)[i/2]));820820+ for (int i = 0; i < sizeof(*guid); i++)821821+ sprintf(&guid_name[i * 2], "%02x", guid->b[i]);824822825823 module_alias_printf(mod, false, "vmbus:%s", guid_name);826824}
···103103104104_package-api-headers() {105105 pkgdesc="Kernel headers sanitized for use in userspace"106106- provides=(linux-api-headers)106106+ provides=(linux-api-headers="${pkgver}")107107 conflicts=(linux-api-headers)108108109109 _prologue
+4-1
scripts/sorttable.h
···110110111111static int orc_sort_cmp(const void *_a, const void *_b)112112{113113- struct orc_entry *orc_a;113113+ struct orc_entry *orc_a, *orc_b;114114 const int *a = g_orc_ip_table + *(int *)_a;115115 const int *b = g_orc_ip_table + *(int *)_b;116116 unsigned long a_val = orc_ip(a);···128128 * whitelisted .o files which didn't get objtool generation.129129 */130130 orc_a = g_orc_table + (a - g_orc_ip_table);131131+ orc_b = g_orc_table + (b - g_orc_ip_table);132132+ if (orc_a->type == ORC_TYPE_UNDEFINED && orc_b->type == ORC_TYPE_UNDEFINED)133133+ return 0;131134 return orc_a->type == ORC_TYPE_UNDEFINED ? -1 : 1;132135}133136
+34-27
security/selinux/avc.c
···174174 * using a linked list for extended_perms_decision lookup because the list is175175 * always small. i.e. less than 5, typically 1176176 */177177-static struct extended_perms_decision *avc_xperms_decision_lookup(u8 driver,178178- struct avc_xperms_node *xp_node)177177+static struct extended_perms_decision *178178+avc_xperms_decision_lookup(u8 driver, u8 base_perm,179179+ struct avc_xperms_node *xp_node)179180{180181 struct avc_xperms_decision_node *xpd_node;181182182183 list_for_each_entry(xpd_node, &xp_node->xpd_head, xpd_list) {183183- if (xpd_node->xpd.driver == driver)184184+ if (xpd_node->xpd.driver == driver &&185185+ xpd_node->xpd.base_perm == base_perm)184186 return &xpd_node->xpd;185187 }186188 return NULL;···207205}208206209207static void avc_xperms_allow_perm(struct avc_xperms_node *xp_node,210210- u8 driver, u8 perm)208208+ u8 driver, u8 base_perm, u8 perm)211209{212210 struct extended_perms_decision *xpd;213211 security_xperm_set(xp_node->xp.drivers.p, driver);214214- xpd = avc_xperms_decision_lookup(driver, xp_node);212212+ xp_node->xp.base_perms |= base_perm;213213+ xpd = avc_xperms_decision_lookup(driver, base_perm, xp_node);215214 if (xpd && xpd->allowed)216215 security_xperm_set(xpd->allowed->p, perm);217216}···248245static void avc_copy_xperms_decision(struct extended_perms_decision *dest,249246 struct extended_perms_decision *src)250247{248248+ dest->base_perm = src->base_perm;251249 dest->driver = src->driver;252250 dest->used = src->used;253251 if (dest->used & XPERMS_ALLOWED)···276272 */277273 u8 i = perm >> 5;278274275275+ dest->base_perm = src->base_perm;279276 dest->used = src->used;280277 if (dest->used & XPERMS_ALLOWED)281278 dest->allowed->p[i] = src->allowed->p[i];···362357363358 memcpy(dest->xp.drivers.p, src->xp.drivers.p, sizeof(dest->xp.drivers.p));364359 dest->xp.len = src->xp.len;360360+ dest->xp.base_perms = src->xp.base_perms;365361366362 /* for each source xpd allocate a destination xpd and copy */367363 list_for_each_entry(src_xpd, &src->xpd_head, xpd_list) {···813807 * @event : Updating event814808 * @perms : Permission mask bits815809 * @driver: xperm driver information810810+ * @base_perm: the base permission associated with the extended permission816811 * @xperm: xperm permissions817812 * @ssid: AVC entry source sid818813 * @tsid: AVC entry target sid···827820 * otherwise, this function updates the AVC entry. The original AVC-entry object828821 * will release later by RCU.829822 */830830-static int avc_update_node(u32 event, u32 perms, u8 driver, u8 xperm, u32 ssid,831831- u32 tsid, u16 tclass, u32 seqno,832832- struct extended_perms_decision *xpd,833833- u32 flags)823823+static int avc_update_node(u32 event, u32 perms, u8 driver, u8 base_perm,824824+ u8 xperm, u32 ssid, u32 tsid, u16 tclass, u32 seqno,825825+ struct extended_perms_decision *xpd, u32 flags)834826{835827 u32 hvalue;836828 int rc = 0;···886880 case AVC_CALLBACK_GRANT:887881 node->ae.avd.allowed |= perms;888882 if (node->ae.xp_node && (flags & AVC_EXTENDED_PERMS))889889- avc_xperms_allow_perm(node->ae.xp_node, driver, xperm);883883+ avc_xperms_allow_perm(node->ae.xp_node, driver, base_perm, xperm);890884 break;891885 case AVC_CALLBACK_TRY_REVOKE:892886 case AVC_CALLBACK_REVOKE:···993987 avc_insert(ssid, tsid, tclass, avd, xp_node);994988}995989996996-static noinline int avc_denied(u32 ssid, u32 tsid,997997- u16 tclass, u32 requested,998998- u8 driver, u8 xperm, unsigned int flags,999999- struct av_decision *avd)990990+static noinline int avc_denied(u32 ssid, u32 tsid, u16 tclass, u32 requested,991991+ u8 driver, u8 base_perm, u8 xperm,992992+ unsigned int flags, struct av_decision *avd)1000993{1001994 if (flags & AVC_STRICT)1002995 return -EACCES;···1004999 !(avd->flags & AVD_FLAGS_PERMISSIVE))10051000 return -EACCES;1006100110071007- avc_update_node(AVC_CALLBACK_GRANT, requested, driver,10021002+ avc_update_node(AVC_CALLBACK_GRANT, requested, driver, base_perm,10081003 xperm, ssid, tsid, tclass, avd->seqno, NULL, flags);10091004 return 0;10101005}···10171012 * driver field is used to specify which set contains the permission.10181013 */10191014int avc_has_extended_perms(u32 ssid, u32 tsid, u16 tclass, u32 requested,10201020- u8 driver, u8 xperm, struct common_audit_data *ad)10151015+ u8 driver, u8 base_perm, u8 xperm,10161016+ struct common_audit_data *ad)10211017{10221018 struct avc_node *node;10231019 struct av_decision avd;···10531047 local_xpd.auditallow = &auditallow;10541048 local_xpd.dontaudit = &dontaudit;1055104910561056- xpd = avc_xperms_decision_lookup(driver, xp_node);10501050+ xpd = avc_xperms_decision_lookup(driver, base_perm, xp_node);10571051 if (unlikely(!xpd)) {10581052 /*10591053 * Compute the extended_perms_decision only if the driver10601060- * is flagged10541054+ * is flagged and the base permission is known.10611055 */10621062- if (!security_xperm_test(xp_node->xp.drivers.p, driver)) {10561056+ if (!security_xperm_test(xp_node->xp.drivers.p, driver) ||10571057+ !(xp_node->xp.base_perms & base_perm)) {10631058 avd.allowed &= ~requested;10641059 goto decision;10651060 }10661061 rcu_read_unlock();10671067- security_compute_xperms_decision(ssid, tsid, tclass,10681068- driver, &local_xpd);10621062+ security_compute_xperms_decision(ssid, tsid, tclass, driver,10631063+ base_perm, &local_xpd);10691064 rcu_read_lock();10701070- avc_update_node(AVC_CALLBACK_ADD_XPERMS, requested,10711071- driver, xperm, ssid, tsid, tclass, avd.seqno,10651065+ avc_update_node(AVC_CALLBACK_ADD_XPERMS, requested, driver,10661066+ base_perm, xperm, ssid, tsid, tclass, avd.seqno,10721067 &local_xpd, 0);10731068 } else {10741069 avc_quick_copy_xperms_decision(xperm, &local_xpd, xpd);···10821075decision:10831076 denied = requested & ~(avd.allowed);10841077 if (unlikely(denied))10851085- rc = avc_denied(ssid, tsid, tclass, requested,10861086- driver, xperm, AVC_EXTENDED_PERMS, &avd);10781078+ rc = avc_denied(ssid, tsid, tclass, requested, driver,10791079+ base_perm, xperm, AVC_EXTENDED_PERMS, &avd);1087108010881081 rcu_read_unlock();10891082···11171110 avc_compute_av(ssid, tsid, tclass, avd, &xp_node);11181111 denied = requested & ~(avd->allowed);11191112 if (unlikely(denied))11201120- return avc_denied(ssid, tsid, tclass, requested, 0, 0,11131113+ return avc_denied(ssid, tsid, tclass, requested, 0, 0, 0,11211114 flags, avd);11221115 return 0;11231116}···11651158 rcu_read_unlock();1166115911671160 if (unlikely(denied))11681168- return avc_denied(ssid, tsid, tclass, requested, 0, 0,11611161+ return avc_denied(ssid, tsid, tclass, requested, 0, 0, 0,11691162 flags, avd);11701163 return 0;11711164}
···239239struct extended_perms_decision {240240 u8 used;241241 u8 driver;242242+ u8 base_perm;242243 struct extended_perms_data *allowed;243244 struct extended_perms_data *auditallow;244245 struct extended_perms_data *dontaudit;···247246248247struct extended_perms {249248 u16 len; /* length associated decision chain */249249+ u8 base_perms; /* which base permissions are covered */250250 struct extended_perms_data drivers; /* flag drivers that are used */251251};252252···259257 struct extended_perms *xperms);260258261259void security_compute_xperms_decision(u32 ssid, u32 tsid, u16 tclass, u8 driver,260260+ u8 base_perm,262261 struct extended_perms_decision *xpermd);263262264263void security_compute_av_user(u32 ssid, u32 tsid, u16 tclass,
+21-7
security/selinux/ss/services.c
···582582}583583584584/*585585- * Flag which drivers have permissions.585585+ * Flag which drivers have permissions and which base permissions are covered.586586 */587587void services_compute_xperms_drivers(588588 struct extended_perms *xperms,···592592593593 switch (node->datum.u.xperms->specified) {594594 case AVTAB_XPERMS_IOCTLDRIVER:595595+ xperms->base_perms |= AVC_EXT_IOCTL;595596 /* if one or more driver has all permissions allowed */596597 for (i = 0; i < ARRAY_SIZE(xperms->drivers.p); i++)597598 xperms->drivers.p[i] |= node->datum.u.xperms->perms.p[i];598599 break;599600 case AVTAB_XPERMS_IOCTLFUNCTION:601601+ xperms->base_perms |= AVC_EXT_IOCTL;602602+ /* if allowing permissions within a driver */603603+ security_xperm_set(xperms->drivers.p,604604+ node->datum.u.xperms->driver);605605+ break;600606 case AVTAB_XPERMS_NLMSG:607607+ xperms->base_perms |= AVC_EXT_NLMSG;601608 /* if allowing permissions within a driver */602609 security_xperm_set(xperms->drivers.p,603610 node->datum.u.xperms->driver);···638631 avd->auditallow = 0;639632 avd->auditdeny = 0xffffffff;640633 if (xperms) {641641- memset(&xperms->drivers, 0, sizeof(xperms->drivers));642642- xperms->len = 0;634634+ memset(xperms, 0, sizeof(*xperms));643635 }644636645637 if (unlikely(!tclass || tclass > policydb->p_classes.nprim)) {···975969{976970 switch (node->datum.u.xperms->specified) {977971 case AVTAB_XPERMS_IOCTLFUNCTION:978978- case AVTAB_XPERMS_NLMSG:979979- if (xpermd->driver != node->datum.u.xperms->driver)972972+ if (xpermd->base_perm != AVC_EXT_IOCTL ||973973+ xpermd->driver != node->datum.u.xperms->driver)980974 return;981975 break;982976 case AVTAB_XPERMS_IOCTLDRIVER:983983- if (!security_xperm_test(node->datum.u.xperms->perms.p,984984- xpermd->driver))977977+ if (xpermd->base_perm != AVC_EXT_IOCTL ||978978+ !security_xperm_test(node->datum.u.xperms->perms.p,979979+ xpermd->driver))980980+ return;981981+ break;982982+ case AVTAB_XPERMS_NLMSG:983983+ if (xpermd->base_perm != AVC_EXT_NLMSG ||984984+ xpermd->driver != node->datum.u.xperms->driver)985985 return;986986 break;987987 default:···10221010 u32 tsid,10231011 u16 orig_tclass,10241012 u8 driver,10131013+ u8 base_perm,10251014 struct extended_perms_decision *xpermd)10261015{10271016 struct selinux_policy *policy;···10361023 struct ebitmap_node *snode, *tnode;10371024 unsigned int i, j;1038102510261026+ xpermd->base_perm = base_perm;10391027 xpermd->driver = driver;10401028 xpermd->used = 0;10411029 memset(xpermd->allowed->p, 0, sizeof(xpermd->allowed->p));
+26-17
sound/core/compress_offload.c
···10251025static int snd_compr_task_new(struct snd_compr_stream *stream, struct snd_compr_task *utask)10261026{10271027 struct snd_compr_task_runtime *task;10281028- int retval;10281028+ int retval, fd_i, fd_o;1029102910301030 if (stream->runtime->total_tasks >= stream->runtime->fragments)10311031 return -EBUSY;···10391039 retval = stream->ops->task_create(stream, task);10401040 if (retval < 0)10411041 goto cleanup;10421042- utask->input_fd = dma_buf_fd(task->input, O_WRONLY|O_CLOEXEC);10431043- if (utask->input_fd < 0) {10441044- retval = utask->input_fd;10421042+ /* similar functionality as in dma_buf_fd(), but ensure that both10431043+ file descriptors are allocated before fd_install() */10441044+ if (!task->input || !task->input->file || !task->output || !task->output->file) {10451045+ retval = -EINVAL;10451046 goto cleanup;10461047 }10471047- utask->output_fd = dma_buf_fd(task->output, O_RDONLY|O_CLOEXEC);10481048- if (utask->output_fd < 0) {10491049- retval = utask->output_fd;10481048+ fd_i = get_unused_fd_flags(O_WRONLY|O_CLOEXEC);10491049+ if (fd_i < 0)10501050+ goto cleanup;10511051+ fd_o = get_unused_fd_flags(O_RDONLY|O_CLOEXEC);10521052+ if (fd_o < 0) {10531053+ put_unused_fd(fd_i);10501054 goto cleanup;10511055 }10521056 /* keep dmabuf reference until freed with task free ioctl */10531053- dma_buf_get(utask->input_fd);10541054- dma_buf_get(utask->output_fd);10571057+ get_dma_buf(task->input);10581058+ get_dma_buf(task->output);10591059+ fd_install(fd_i, task->input->file);10601060+ fd_install(fd_o, task->output->file);10611061+ utask->input_fd = fd_i;10621062+ utask->output_fd = fd_o;10551063 list_add_tail(&task->list, &stream->runtime->tasks);10561064 stream->runtime->total_tasks++;10571065 return 0;···10771069 return -EPERM;10781070 task = memdup_user((void __user *)arg, sizeof(*task));10791071 if (IS_ERR(task))10801080- return PTR_ERR(no_free_ptr(task));10721072+ return PTR_ERR(task);10811073 retval = snd_compr_task_new(stream, task);10821074 if (retval >= 0)10831075 if (copy_to_user((void __user *)arg, task, sizeof(*task)))···11381130 return -EPERM;11391131 task = memdup_user((void __user *)arg, sizeof(*task));11401132 if (IS_ERR(task))11411141- return PTR_ERR(no_free_ptr(task));11331133+ return PTR_ERR(task);11421134 retval = snd_compr_task_start(stream, task);11431135 if (retval >= 0)11441136 if (copy_to_user((void __user *)arg, task, sizeof(*task)))···11821174static int snd_compr_task_seq(struct snd_compr_stream *stream, unsigned long arg,11831175 snd_compr_seq_func_t fcn)11841176{11851185- struct snd_compr_task_runtime *task;11771177+ struct snd_compr_task_runtime *task, *temp;11861178 __u64 seqno;11871179 int retval;1188118011891181 if (stream->runtime->state != SNDRV_PCM_STATE_SETUP)11901182 return -EPERM;11911191- retval = get_user(seqno, (__u64 __user *)arg);11921192- if (retval < 0)11931193- return retval;11831183+ retval = copy_from_user(&seqno, (__u64 __user *)arg, sizeof(seqno));11841184+ if (retval)11851185+ return -EFAULT;11941186 retval = 0;11951187 if (seqno == 0) {11961196- list_for_each_entry_reverse(task, &stream->runtime->tasks, list)11881188+ list_for_each_entry_safe_reverse(task, temp, &stream->runtime->tasks, list)11971189 fcn(stream, task);11981190 } else {11991191 task = snd_compr_find_task(stream, seqno);···12291221 return -EPERM;12301222 status = memdup_user((void __user *)arg, sizeof(*status));12311223 if (IS_ERR(status))12321232- return PTR_ERR(no_free_ptr(status));12241224+ return PTR_ERR(status);12331225 retval = snd_compr_task_status(stream, status);12341226 if (retval >= 0)12351227 if (copy_to_user((void __user *)arg, status, sizeof(*status)))···12551247}12561248EXPORT_SYMBOL_GPL(snd_compr_task_finished);1257124912501250+MODULE_IMPORT_NS("DMA_BUF");12581251#endif /* CONFIG_SND_COMPRESS_ACCEL */1259125212601253static long snd_compr_ioctl(struct file *f, unsigned int cmd, unsigned long arg)
+1-1
sound/core/memalloc.c
···505505 if (!p)506506 return NULL;507507 dmab->addr = dma_map_single(dmab->dev.dev, p, size, DMA_BIDIRECTIONAL);508508- if (dmab->addr == DMA_MAPPING_ERROR) {508508+ if (dma_mapping_error(dmab->dev.dev, dmab->addr)) {509509 do_free_pages(dmab->area, size, true);510510 return NULL;511511 }
···12751275 if (client->type != client_info->type)12761276 return -EINVAL;1277127712781278- /* check validity of midi_version field */12791279- if (client->user_pversion >= SNDRV_PROTOCOL_VERSION(1, 0, 3) &&12801280- client_info->midi_version > SNDRV_SEQ_CLIENT_UMP_MIDI_2_0)12811281- return -EINVAL;12781278+ if (client->user_pversion >= SNDRV_PROTOCOL_VERSION(1, 0, 3)) {12791279+ /* check validity of midi_version field */12801280+ if (client_info->midi_version > SNDRV_SEQ_CLIENT_UMP_MIDI_2_0)12811281+ return -EINVAL;12821282+12831283+ /* check if UMP is supported in kernel */12841284+ if (!IS_ENABLED(CONFIG_SND_SEQ_UMP) &&12851285+ client_info->midi_version > 0)12861286+ return -EINVAL;12871287+ }1282128812831289 /* fill the info fields */12841290 if (client_info->name[0])
+1-1
sound/core/ump.c
···1244124412451245 num = 0;12461246 for (i = 0; i < SNDRV_UMP_MAX_GROUPS; i++)12471247- if ((group_maps & (1U << i)) && ump->groups[i].valid)12471247+ if (group_maps & (1U << i))12481248 ump->legacy_mapping[num++] = i;1249124912501250 return num;
+1
sound/pci/hda/patch_realtek.c
···1100911009 SND_PCI_QUIRK(0xf111, 0x0001, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE),1101011010 SND_PCI_QUIRK(0xf111, 0x0006, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE),1101111011 SND_PCI_QUIRK(0xf111, 0x0009, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE),1101211012+ SND_PCI_QUIRK(0xf111, 0x000c, "Framework Laptop", ALC295_FIXUP_FRAMEWORK_LAPTOP_MIC_NO_PRESENCE),11012110131101311014#if 01101411015 /* Below is a quirk table taken from the old code.
+4
sound/pci/hda/tas2781_hda_i2c.c
···142142 }143143 sub = acpi_get_subsystem_id(ACPI_HANDLE(physdev));144144 if (IS_ERR(sub)) {145145+ /* No subsys id in older tas2563 projects. */146146+ if (!strncmp(hid, "INT8866", sizeof("INT8866")))147147+ goto end_2563;145148 dev_err(p->dev, "Failed to get SUBSYS ID.\n");146149 ret = PTR_ERR(sub);147150 goto err;···167164 p->speaker_id = NULL;168165 }169166167167+end_2563:170168 acpi_dev_free_resource_list(&resources);171169 strscpy(p->dev_name, hid, sizeof(p->dev_name));172170 put_device(physdev);
+1-1
sound/sh/sh_dac_audio.c
···163163 /* channel is not used (interleaved data) */164164 struct snd_sh_dac *chip = snd_pcm_substream_chip(substream);165165166166- if (copy_from_iter(chip->data_buffer + pos, src, count) != count)166166+ if (copy_from_iter(chip->data_buffer + pos, count, src) != count)167167 return -EFAULT;168168 chip->buffer_end = chip->data_buffer + pos + count;169169
+16-1
sound/soc/amd/ps/pci-ps.c
···375375{376376 struct acpi_device *pdm_dev;377377 const union acpi_object *obj;378378+ acpi_handle handle;379379+ acpi_integer dmic_status;378380 u32 config;379381 bool is_dmic_dev = false;380382 bool is_sdw_dev = false;383383+ bool wov_en, dmic_en;381384 int ret;385385+386386+ /* IF WOV entry not found, enable dmic based on acp-audio-device-type entry*/387387+ wov_en = true;388388+ dmic_en = false;382389383390 config = readl(acp_data->acp63_base + ACP_PIN_CONFIG);384391 switch (config) {···419412 if (!acpi_dev_get_property(pdm_dev, "acp-audio-device-type",420413 ACPI_TYPE_INTEGER, &obj) &&421414 obj->integer.value == ACP_DMIC_DEV)422422- is_dmic_dev = true;415415+ dmic_en = true;423416 }417417+418418+ handle = ACPI_HANDLE(&pci->dev);419419+ ret = acpi_evaluate_integer(handle, "_WOV", NULL, &dmic_status);420420+ if (!ACPI_FAILURE(ret))421421+ wov_en = dmic_status;424422 }423423+424424+ if (dmic_en && wov_en)425425+ is_dmic_dev = true;425426426427 if (acp_data->is_sdw_config) {427428 ret = acp_scan_sdw_devices(&pci->dev, ACP63_SDW_ADDR);
+6-1
sound/soc/codecs/rt722-sdca.c
···14681468 0x008d);14691469 /* check HP calibration FSM status */14701470 for (loop_check = 0; loop_check < chk_cnt; loop_check++) {14711471+ usleep_range(10000, 11000);14711472 ret = rt722_sdca_index_read(rt722, RT722_VENDOR_CALI,14721473 RT722_DAC_DC_CALI_CTL3, &calib_status);14731473- if (ret < 0 || loop_check == chk_cnt)14741474+ if (ret < 0)14741475 dev_dbg(&rt722->slave->dev, "calibration failed!, ret=%d\n", ret);14751476 if ((calib_status & 0x0040) == 0x0)14761477 break;14771478 }14791479+14801480+ if (loop_check == chk_cnt)14811481+ dev_dbg(&rt722->slave->dev, "%s, calibration time-out!\n", __func__);14821482+14781483 /* Set ADC09 power entity floating control */14791484 rt722_sdca_index_write(rt722, RT722_VENDOR_HDA_CTL, RT722_ADC0A_08_PDE_FLOAT_CTL,14801485 0x2a12);
···88#define __always_inline __inline__99#endif10101111+/* Not all C++ standards support type declarations inside an anonymous union */1212+#ifndef __cplusplus1313+#define __struct_group_tag(TAG) TAG1414+#else1515+#define __struct_group_tag(TAG)1616+#endif1717+1118/**1219 * __struct_group() - Create a mirrored named and anonyomous struct1320 *···2720 * and size: one anonymous and one named. The former's members can be used2821 * normally without sub-struct naming, and the latter can be used to2922 * reason about the start, end, and size of the group of struct members.3030- * The named struct can also be explicitly tagged for layer reuse, as well3131- * as both having struct attributes appended.2323+ * The named struct can also be explicitly tagged for layer reuse (C only),2424+ * as well as both having struct attributes appended.3225 */3326#define __struct_group(TAG, NAME, ATTRS, MEMBERS...) \3427 union { \3528 struct { MEMBERS } ATTRS; \3636- struct TAG { MEMBERS } ATTRS NAME; \3737- }2929+ struct __struct_group_tag(TAG) { MEMBERS } ATTRS NAME; \3030+ } ATTRS38313932/**4033 * __DECLARE_FLEX_ARRAY() - Declare a flexible array usable in a union
···86868787#8888# If isolated CPUs have been reserved at boot time (as shown in8989-# cpuset.cpus.isolated), these isolated CPUs should be outside of CPUs 0-78989+# cpuset.cpus.isolated), these isolated CPUs should be outside of CPUs 0-89090# that will be used by this script for testing purpose. If not, some of9191-# the tests may fail incorrectly. These isolated CPUs will also be removed9292-# before being compared with the expected results.9191+# the tests may fail incorrectly. These pre-isolated CPUs should stay in9292+# an isolated state throughout the testing process for now.9393#9494BOOT_ISOLCPUS=$(cat $CGROUP2/cpuset.cpus.isolated)9595if [[ -n "$BOOT_ISOLCPUS" ]]9696then9797- [[ $(echo $BOOT_ISOLCPUS | sed -e "s/[,-].*//") -le 7 ]] &&9797+ [[ $(echo $BOOT_ISOLCPUS | sed -e "s/[,-].*//") -le 8 ]] &&9898 skip_test "Pre-isolated CPUs ($BOOT_ISOLCPUS) overlap CPUs to be tested"9999 echo "Pre-isolated CPUs: $BOOT_ISOLCPUS"100100fi···684684 fi685685686686 #687687+ # Appending pre-isolated CPUs688688+ # Even though CPU #8 isn't used for testing, it can't be pre-isolated689689+ # to make appending those CPUs easier.690690+ #691691+ [[ -n "$BOOT_ISOLCPUS" ]] && {692692+ EXPECT_VAL=${EXPECT_VAL:+${EXPECT_VAL},}${BOOT_ISOLCPUS}693693+ EXPECT_VAL2=${EXPECT_VAL2:+${EXPECT_VAL2},}${BOOT_ISOLCPUS}694694+ }695695+696696+ #687697 # Check cpuset.cpus.isolated cpumask688698 #689689- if [[ -z "$BOOT_ISOLCPUS" ]]690690- then691691- ISOLCPUS=$(cat $ISCPUS)692692- else693693- ISOLCPUS=$(cat $ISCPUS | sed -e "s/,*$BOOT_ISOLCPUS//")694694- fi695699 [[ "$EXPECT_VAL2" != "$ISOLCPUS" ]] && {696700 # Take a 50ms pause and try again697701 pause 0.05···735731 fi736732 done737733 [[ "$ISOLCPUS" = *- ]] && ISOLCPUS=${ISOLCPUS}$LASTISOLCPU738738- [[ -n "BOOT_ISOLCPUS" ]] &&739739- ISOLCPUS=$(echo $ISOLCPUS | sed -e "s/,*$BOOT_ISOLCPUS//")740734741735 [[ "$EXPECT_VAL" = "$ISOLCPUS" ]]742736}···838836 # if available839837 [[ -n "$ICPUS" ]] && {840838 check_isolcpus $ICPUS841841- [[ $? -ne 0 ]] && test_fail $I "isolated CPU" \842842- "Expect $ICPUS, get $ISOLCPUS instead"839839+ [[ $? -ne 0 ]] && {840840+ [[ -n "$BOOT_ISOLCPUS" ]] && ICPUS=${ICPUS},${BOOT_ISOLCPUS}841841+ test_fail $I "isolated CPU" \842842+ "Expect $ICPUS, get $ISOLCPUS instead"843843+ }843844 }844845 reset_cgroup_states845846 #
+24-4
tools/testing/selftests/drivers/net/queues.py
···11#!/usr/bin/env python322# SPDX-License-Identifier: GPL-2.03344-from lib.py import ksft_run, ksft_exit, ksft_eq, KsftSkipEx55-from lib.py import EthtoolFamily, NetdevFamily44+from lib.py import ksft_disruptive, ksft_exit, ksft_run55+from lib.py import ksft_eq, ksft_raises, KsftSkipEx66+from lib.py import EthtoolFamily, NetdevFamily, NlError67from lib.py import NetDrvEnv77-from lib.py import cmd88+from lib.py import cmd, defer, ip99+import errno810import glob9111012···6159 ksft_eq(queues, expected)626063616262+@ksft_disruptive6363+def check_down(cfg, nl) -> None:6464+ # Check the NAPI IDs before interface goes down and hides them6565+ napis = nl.napi_get({'ifindex': cfg.ifindex}, dump=True)6666+6767+ ip(f"link set dev {cfg.dev['ifname']} down")6868+ defer(ip, f"link set dev {cfg.dev['ifname']} up")6969+7070+ with ksft_raises(NlError) as cm:7171+ nl.queue_get({'ifindex': cfg.ifindex, 'id': 0, 'type': 'rx'})7272+ ksft_eq(cm.exception.nl_msg.error, -errno.ENOENT)7373+7474+ if napis:7575+ with ksft_raises(NlError) as cm:7676+ nl.napi_get({'id': napis[0]['id']})7777+ ksft_eq(cm.exception.nl_msg.error, -errno.ENOENT)7878+7979+6480def main() -> None:6581 with NetDrvEnv(__file__, queue_count=100) as cfg:6666- ksft_run([get_queues, addremove_queues], args=(cfg, NetdevFamily()))8282+ ksft_run([get_queues, addremove_queues, check_down], args=(cfg, NetdevFamily()))6783 ksft_exit()68846985
···2020 * If we dispatch to a bogus DSQ that will fall back to the2121 * builtin global DSQ, we fail gracefully.2222 */2323- scx_bpf_dispatch_vtime(p, 0xcafef00d, SCX_SLICE_DFL,2323+ scx_bpf_dsq_insert_vtime(p, 0xcafef00d, SCX_SLICE_DFL,2424 p->scx.dsq_vtime, 0);2525 return cpu;2626 }
···22/*33 * A scheduler that validates that enqueue flags are properly stored and44 * applied at dispatch time when a task is directly dispatched from55- * ops.select_cpu(). We validate this by using scx_bpf_dispatch_vtime(), and66- * making the test a very basic vtime scheduler.55+ * ops.select_cpu(). We validate this by using scx_bpf_dsq_insert_vtime(),66+ * and making the test a very basic vtime scheduler.77 *88 * Copyright (c) 2024 Meta Platforms, Inc. and affiliates.99 * Copyright (c) 2024 David Vernet <dvernet@meta.com>···4747 cpu = prev_cpu;4848 scx_bpf_test_and_clear_cpu_idle(cpu);4949ddsp:5050- scx_bpf_dispatch_vtime(p, VTIME_DSQ, SCX_SLICE_DFL, task_vtime(p), 0);5050+ scx_bpf_dsq_insert_vtime(p, VTIME_DSQ, SCX_SLICE_DFL, task_vtime(p), 0);5151 return cpu;5252}53535454void BPF_STRUCT_OPS(select_cpu_vtime_dispatch, s32 cpu, struct task_struct *p)5555{5656- if (scx_bpf_consume(VTIME_DSQ))5656+ if (scx_bpf_dsq_move_to_local(VTIME_DSQ))5757 consumed = true;5858}5959