Re: [PATCH -next] tty: hvc: make hvc_rtas_dev static
On 19. 10. 22, 8:44, ruanjinjie wrote: The symbol is not used outside of the file, so mark it static. Fixes the following warning: drivers/tty/hvc/hvc_rtas.c:29:19: warning: symbol 'hvc_rtas_dev' was not declared. Should it be static? Reviewed-by: Jiri Slaby Signed-off-by: ruanjinjie --- drivers/tty/hvc/hvc_rtas.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/hvc/hvc_rtas.c b/drivers/tty/hvc/hvc_rtas.c index e8b8c645482b..184d325abeed 100644 --- a/drivers/tty/hvc/hvc_rtas.c +++ b/drivers/tty/hvc/hvc_rtas.c @@ -26,7 +26,7 @@ #include "hvc_console.h" #define hvc_rtas_cookie 0x67781e15 -struct hvc_struct *hvc_rtas_dev; +static struct hvc_struct *hvc_rtas_dev; static int rtascons_put_char_token = RTAS_UNKNOWN_SERVICE; static int rtascons_get_char_token = RTAS_UNKNOWN_SERVICE; -- js suse labs
[6.1-rc1] Warning arch/powerpc/kernel/irq_64.c:285
While running powerpc kselftests (mm/stress_code_patching.sh) on a PowerVM LPAR following warning is seen. The test passes. I can reliably recreate it on a Power9 server, not so easily on Power10. # ./stress_code_patching.sh Testing for spurious faults when mapping kernel memory... [ 175.289418] [ cut here ] [ 175.289434] WARNING: CPU: 11 PID: 5436 at arch/powerpc/kernel/irq_64.c:285 arch_local_irq_restore+0x230/0x260 [ 175.289450] Modules linked in: dm_mod(E) nft_fib_inet(E) nft_fib_ipv4(E) nft_fib_ipv6(E) nft_fib(E) nft_reject_inet(E) nf_reject_ipv4(E) nf_reject_ipv6(E) nft_reject(E) nft_ct(E) nft_chain_nat(E) nf_nat(E) nf_conntrack(E) nf_defrag_ipv6(E) nf_defrag_ipv4(E) bonding(E) tls(E) ip_set(E) rfkill(E) nf_tables(E) libcrc32c(E) nfnetlink(E) sunrpc(E) pseries_rng(E) vmx_crypto(E) ext4(E) mbcache(E) jbd2(E) sd_mod(E) t10_pi(E) crc64_rocksoft(E) crc64(E) sg(E) ibmvscsi(E) scsi_transport_srp(E) ibmveth(E) ipmi_devintf(E) ipmi_msghandler(E) fuse(E) [ 175.289582] CPU: 11 PID: 5436 Comm: stress_code_pat Tainted: GE 6.1.0-rc1-00025-gaae703b02f92 #1 [ 175.289591] Hardware name: IBM,8375-42A POWER9 (raw) 0x4e0202 0xf05 of:IBM,FW950.50 (VL950_105) hv:phyp pSeries [ 175.289599] NIP: c003e9a0 LR: c00b16dc CTR: a6a4 [ 175.289607] REGS: c000297b35f0 TRAP: 0700 Tainted: GE (6.1.0-rc1-00025-gaae703b02f92) [ 175.289616] MSR: 8282b033 CR: 4824 XER: [ 175.289654] CFAR: c003e7f4 IRQMASK: 1 [ 175.289654] GPR00: c00b179c c000297b3890 c135e900 [ 175.289654] GPR04: 201760241794 4009287a7705 [ 175.289654] GPR08: 8000 cac27d80 0040 [ 175.289654] GPR12: 2000 c0001ec52700 4000 000101239798 [ 175.289654] GPR16: 000101239724 0001011d8128 000101170370 00010123d568 [ 175.289654] GPR20: 01002f8f5490 0001 0001011eaf18 7fffc1696ab4 [ 175.289654] GPR24: 7fffc1696ab0 c0080018 4be3bca9 [ 175.289654] GPR28: c2a590a0 c35010c0 [ 175.289787] NIP [c003e9a0] arch_local_irq_restore+0x230/0x260 [ 175.289796] LR [c00b16dc] patch_instruction+0x26c/0x340 [ 175.289805] Call Trace: [ 175.289810] [c000297b3890] [c2a590a0] init_mm+0x0/0x5c0 (unreliable) [ 175.289824] [c000297b38c0] [c00b179c] patch_instruction+0x32c/0x340 [ 175.289835] [c000297b3910] [c007ef40] ftrace_make_call+0x220/0x4b0 [ 175.289846] [c000297b39a0] [c02e00a8] __ftrace_replace_code+0x138/0x140 [ 175.289858] [c000297b39f0] [c02e0678] ftrace_replace_code+0xa8/0x140 [ 175.289869] [c000297b3a40] [c02e095c] ftrace_modify_all_code+0x11c/0x240 [ 175.289880] [c000297b3a70] [c007f918] arch_ftrace_update_code+0x18/0x30 [ 175.289891] [c000297b3a90] [c02e0bc8] ftrace_startup_enable+0x68/0xa0 [ 175.289902] [c000297b3ac0] [c02e6618] ftrace_startup+0xf8/0x1c0 [ 175.289913] [c000297b3b00] [c02e672c] register_ftrace_function+0x4c/0xc0 [ 175.289924] [c000297b3b30] [c030c908] function_trace_init+0x88/0x100 [ 175.289936] [c000297b3b60] [c030079c] tracing_set_tracer+0x2ac/0x540 [ 175.289946] [c000297b3c00] [c0300ad4] tracing_set_trace_write+0xa4/0x110 [ 175.289957] [c000297b3cc0] [c0553a00] vfs_write+0x100/0x460 [ 175.289968] [c000297b3d80] [c0553f3c] ksys_write+0x7c/0x140 [ 175.289979] [c000297b3dd0] [c0035160] system_call_exception+0x140/0x350 [ 175.289990] [c000297b3e10] [c000c654] system_call_common+0xf4/0x278 [ 175.290002] --- interrupt: c00 at 0x7fff83c50c34 [ 175.290009] NIP: 7fff83c50c34 LR: 7fff83bc7c74 CTR: [ 175.290016] REGS: c000297b3e80 TRAP: 0c00 Tainted: GE (6.1.0-rc1-00025-gaae703b02f92) [ 175.290025] MSR: 8280f033 CR: 2822 XER: [ 175.290065] IRQMASK: 0 [ 175.290065] GPR00: 0004 7fffc1696890 7fff83d37300 0001 [ 175.290065] GPR04: 01002f8f2bb0 0009 0010 6e6f6974 [ 175.290065] GPR08: [ 175.290065] GPR12: 7fff83e6ae60 4000 000101239798 [ 175.290065] GPR16: 000101239724 0001011d8128 000101170370 00010123d568 [ 175.290065] GPR20: 01002f8f5490 0001 0001011eaf18 7fffc1696ab4 [ 175.290065] GPR24: 7fffc1696ab0 00010123af94 0009 01002f8f2bb0 [ 175.290065] GPR28: 0009 7fff83d31798 01002f8f2bb0 0009 [ 175.290194] NIP
Re: [PATCH v7 0/8] phy: Add support for Lynx 10G SerDes
On 10/19/22 06:11, Sean Anderson wrote: > This adds support for the Lynx 10G SerDes found on the QorIQ T-series > and Layerscape series. Due to limited time and hardware, only support > for the LS1046ARDB is added in this initial series. There is a sketch > for LS1088ARDB support, but it is incomplete. > > Dynamic reconfiguration does not work. That is, the configuration must > match what is set in the RCW. From my testing, SerDes register settings > appear identical. The issue appears to be between the PCS and the MAC. > The link itself comes up at both ends, and a mac loopback succeeds. > However, a PCS loopback results in dropped packets. Perhaps there is > some undocumented register in the PCS? > > I suspect this driver is around 95% complete, but, unfortunately, I no > longer have time to investigate this further. At the very least it is > useful for two cases: > - Although this is untested, it should support 2.5G SGMII as well as > 1000BASE-KX. The latter needs MAC and PCS support, but the former > should work out of the box. > - It allows for clock configurations not supported by the RCW. This is > very useful if you want to use e.g. SRDS_PRTCL_S1=0x and =0x1133 > on the same board. This is because the former setting will use PLL1 > as the 1G reference, but the latter will use PLL1 as the 10G > reference. Because we can reconfigure the PLLs, it is possible to > always use PLL1 as the 1G reference. > > Changes in v7: > - Use double quotes everywhere in yaml > - Break out call order into generic documentation > - Refuse to switch "major" protocols > - Update Kconfig to reflect restrictions > - Remove set/clear of "pcs reset" bit, since it doesn't seem to fix > anything. > > Changes in v6: > - Bump PHY_TYPE_2500BASEX to 13, since PHY_TYPE_USXGMII was added in the > meantime > - fsl,type -> phy-type > - frequence -> frequency > - Update MAINTAINERS to include new files > - Include bitfield.h and slab.h to allow compilation on non-arm64 > arches. > - Depend on COMMON_CLK and either layerscape/ppc > - XGI.9 -> XFI.9 > > Changes in v5: > - Update commit description > - Dual id header > - Remove references to PHY_INTERFACE_MODE_1000BASEKX to allow this > series to be applied directly to linux/master. > - Add fsl,lynx-10g.h to MAINTAINERS > > Changes in v4: > - Add 2500BASE-X and 10GBASE-R phy types > - Use subnodes to describe lane configuration, instead of describing > PCCRs. This is the same style used by phy-cadence-sierra et al. > - Add ids for Lynx 10g PLLs > - Rework all debug statements to remove use of __func__. Additional > information has been provided as necessary. > - Consider alternative parent rates in round_rate and not in set_rate. > Trying to modify out parent's rate in set_rate will deadlock. > - Explicitly perform a stop/reset sequence in set_rate. This way we > always ensure that the PLL is properly stopped. > - Set the power-down bit when disabling the PLL. We can do this now that > enable/disable aren't abused during the set rate sequence. > - Fix typos in QSGMII_OFFSET and XFI_OFFSET > - Rename LNmTECR0_TEQ_TYPE_PRE to LNmTECR0_TEQ_TYPE_POST to better > reflect its function (adding post-cursor equalization). > - Use of_clk_hw_onecell_get instead of a custom function. > - Return struct clks from lynx_clks_init instead of embedding lynx_clk > in lynx_priv. > - Rework PCCR helper functions; T-series SoCs differ from Layerscape SoCs > primarily in the layout and offset of the PCCRs. This will help bring a > cleaner abstraction layer. The caps have been removed, since this handles > the > only current usage. > - Convert to use new binding format. As a result of this, we no longer need to > have protocols for PCIe or SATA. Additionally, modes now live in lynx_group > instead of lynx_priv. > - Remove teq from lynx_proto_params, since it can be determined from > preq_ratio/postq_ratio. > - Fix an early return from lynx_set_mode not releasing serdes->lock. > - Rename lynx_priv.conf to .cfg, since I kept mistyping it. > > Changes in v3: > - Manually expand yaml references > - Add mode configuration to device tree > - Rename remaining references to QorIQ SerDes to Lynx 10G > - Fix PLL enable sequence by waiting for our reset request to be cleared > before continuing. Do the same for the lock, even though it isn't as > critical. Because we will delay for 1.5ms on average, use prepare > instead of enable so we can sleep. > - Document the status of each protocol > - Fix offset of several bitfields in RECR0 > - Take into account PLLRST_B, SDRST_B, and SDEN when considering whether > a PLL is "enabled." > - Only power off unused lanes. > - Split mode lane mask into first/last lane (like group) > - Read modes from device tree > - Use caps to determine whether KX/KR are supported > - Move modes to lynx_priv > - Ensure that the protocol controller is not already in-use when we try > to configure a new mode. This should only occur if
[powerpc:merge] BUILD SUCCESS 7dc2a00fdd44a4d0c3bac9fd10558b3933586a0c
-20221018 i386 randconfig-a013 i386 randconfig-a011 hexagon randconfig-r041-20221018 i386 randconfig-a015 s390 randconfig-r044-20221019 hexagon randconfig-r045-20221019 riscvrandconfig-r042-20221019 hexagon randconfig-r041-20221019 mips mtx1_defconfig arm moxart_defconfig powerpc walnut_defconfig arm hackkit_defconfig mips rm200_defconfig x86_64 allyesconfig powerpc katmai_defconfig arm mxs_defconfig -- 0-DAY CI Kernel Test Service https://01.org/lkp
RE: [PATCH v2] mm, hwpoison: Try to recover from copy-on write faults
> Given there is no use case for the residue value returned by > copy_mc_to_kernel() perhaps just return EHWPOISON directly from > copyuser_highpage_mc() in the short-copy case? I don't think it hurts to keep the return value as residue count. It isn't making that code any more complex and could be useful someday. Other feedback looks good and I have applied ready for next version. Thanks for the review. -Tony
RE: [PATCH] PCI: Remove unnecessary of_irq.h includes
> -Original Message- > From: Bjorn Helgaas > > From: Bjorn Helgaas > > Many host controller drivers #include even though they > don't need it. Remove the unnecessary #includes. > > Signed-off-by: Bjorn Helgaas > --- > drivers/pci/controller/cadence/pci-j721e.c | 1 - > drivers/pci/controller/dwc/pci-layerscape.c | 1 - > drivers/pci/controller/dwc/pcie-armada8k.c | 1 - > drivers/pci/controller/dwc/pcie-tegra194.c | 1 - > drivers/pci/controller/pci-v3-semi.c | 1 - > drivers/pci/controller/pci-xgene-msi.c | 1 - > drivers/pci/controller/pci-xgene.c | 1 - > drivers/pci/controller/pcie-altera-msi.c | 1 - > drivers/pci/controller/pcie-iproc-platform.c | 1 - > drivers/pci/controller/pcie-iproc.c | 1 - > drivers/pci/controller/pcie-microchip-host.c | 1 - > drivers/pci/controller/pcie- > rockchip-host.c | 1 - > drivers/pci/controller/pcie-xilinx-cpm.c | 1 - > drivers/pci/controller/pcie-xilinx-nwl.c | 1 - > 14 files changed, 14 deletions(-) Acked-by: Roy Zang Roy
Re: [PATCH] PCI: Remove unnecessary of_irq.h includes
On Wed, Oct 19, 2022 at 02:54:51PM -0500, Bjorn Helgaas wrote: > From: Bjorn Helgaas > > Many host controller drivers #include even though they > don't need it. Remove the unnecessary #includes. > > Signed-off-by: Bjorn Helgaas > drivers/pci/controller/pcie-microchip-host.c | 1 - LGTM... Acked-by: Conor Dooley
[PATCH] PCI: Remove unnecessary of_irq.h includes
From: Bjorn Helgaas Many host controller drivers #include even though they don't need it. Remove the unnecessary #includes. Signed-off-by: Bjorn Helgaas --- drivers/pci/controller/cadence/pci-j721e.c | 1 - drivers/pci/controller/dwc/pci-layerscape.c | 1 - drivers/pci/controller/dwc/pcie-armada8k.c | 1 - drivers/pci/controller/dwc/pcie-tegra194.c | 1 - drivers/pci/controller/pci-v3-semi.c | 1 - drivers/pci/controller/pci-xgene-msi.c | 1 - drivers/pci/controller/pci-xgene.c | 1 - drivers/pci/controller/pcie-altera-msi.c | 1 - drivers/pci/controller/pcie-iproc-platform.c | 1 - drivers/pci/controller/pcie-iproc.c | 1 - drivers/pci/controller/pcie-microchip-host.c | 1 - drivers/pci/controller/pcie-rockchip-host.c | 1 - drivers/pci/controller/pcie-xilinx-cpm.c | 1 - drivers/pci/controller/pcie-xilinx-nwl.c | 1 - 14 files changed, 14 deletions(-) diff --git a/drivers/pci/controller/cadence/pci-j721e.c b/drivers/pci/controller/cadence/pci-j721e.c index a82f845cc4b5..cc83a8925ce0 100644 --- a/drivers/pci/controller/cadence/pci-j721e.c +++ b/drivers/pci/controller/cadence/pci-j721e.c @@ -15,7 +15,6 @@ #include #include #include -#include #include #include #include diff --git a/drivers/pci/controller/dwc/pci-layerscape.c b/drivers/pci/controller/dwc/pci-layerscape.c index 879b8692f96a..ed5fb492fe08 100644 --- a/drivers/pci/controller/dwc/pci-layerscape.c +++ b/drivers/pci/controller/dwc/pci-layerscape.c @@ -13,7 +13,6 @@ #include #include #include -#include #include #include #include diff --git a/drivers/pci/controller/dwc/pcie-armada8k.c b/drivers/pci/controller/dwc/pcie-armada8k.c index dc469ef8e99b..5c999e15c357 100644 --- a/drivers/pci/controller/dwc/pcie-armada8k.c +++ b/drivers/pci/controller/dwc/pcie-armada8k.c @@ -21,7 +21,6 @@ #include #include #include -#include #include "pcie-designware.h" diff --git a/drivers/pci/controller/dwc/pcie-tegra194.c b/drivers/pci/controller/dwc/pcie-tegra194.c index 1b6b437823d2..02d78a12b6e7 100644 --- a/drivers/pci/controller/dwc/pcie-tegra194.c +++ b/drivers/pci/controller/dwc/pcie-tegra194.c @@ -21,7 +21,6 @@ #include #include #include -#include #include #include #include diff --git a/drivers/pci/controller/pci-v3-semi.c b/drivers/pci/controller/pci-v3-semi.c index 154a5398633c..784fcf35599c 100644 --- a/drivers/pci/controller/pci-v3-semi.c +++ b/drivers/pci/controller/pci-v3-semi.c @@ -22,7 +22,6 @@ #include #include #include -#include #include #include #include diff --git a/drivers/pci/controller/pci-xgene-msi.c b/drivers/pci/controller/pci-xgene-msi.c index bfa259781b69..5efc6e56559f 100644 --- a/drivers/pci/controller/pci-xgene-msi.c +++ b/drivers/pci/controller/pci-xgene-msi.c @@ -10,7 +10,6 @@ #include #include #include -#include #include #include #include diff --git a/drivers/pci/controller/pci-xgene.c b/drivers/pci/controller/pci-xgene.c index 549d3bd6d1c2..887b4941ff32 100644 --- a/drivers/pci/controller/pci-xgene.c +++ b/drivers/pci/controller/pci-xgene.c @@ -14,7 +14,6 @@ #include #include #include -#include #include #include #include diff --git a/drivers/pci/controller/pcie-altera-msi.c b/drivers/pci/controller/pcie-altera-msi.c index 7b1d3ebc34ec..89110b879d5f 100644 --- a/drivers/pci/controller/pcie-altera-msi.c +++ b/drivers/pci/controller/pcie-altera-msi.c @@ -13,7 +13,6 @@ #include #include #include -#include #include #include #include diff --git a/drivers/pci/controller/pcie-iproc-platform.c b/drivers/pci/controller/pcie-iproc-platform.c index 538115246c79..4142a73e611d 100644 --- a/drivers/pci/controller/pcie-iproc-platform.c +++ b/drivers/pci/controller/pcie-iproc-platform.c @@ -12,7 +12,6 @@ #include #include #include -#include #include #include diff --git a/drivers/pci/controller/pcie-iproc.c b/drivers/pci/controller/pcie-iproc.c index 2519201b0e51..83029bdfd884 100644 --- a/drivers/pci/controller/pcie-iproc.c +++ b/drivers/pci/controller/pcie-iproc.c @@ -18,7 +18,6 @@ #include #include #include -#include #include #include diff --git a/drivers/pci/controller/pcie-microchip-host.c b/drivers/pci/controller/pcie-microchip-host.c index 7263d175b5ad..937a79bcfddc 100644 --- a/drivers/pci/controller/pcie-microchip-host.c +++ b/drivers/pci/controller/pcie-microchip-host.c @@ -12,7 +12,6 @@ #include #include #include -#include #include #include #include diff --git a/drivers/pci/controller/pcie-rockchip-host.c b/drivers/pci/controller/pcie-rockchip-host.c index 7352b5ff8d35..c96c0f454570 100644 --- a/drivers/pci/controller/pcie-rockchip-host.c +++ b/drivers/pci/controller/pcie-rockchip-host.c @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include diff --git a/drivers/pci/controller/pcie-xilinx-cpm.c b/drivers/pci/controller/pcie-xilinx-cpm.c index e4ab48041eb6..4a787a941674 100644 ---
RE: [PATCH v2] mm, hwpoison: Try to recover from copy-on write faults
Tony Luck wrote: > If the kernel is copying a page as the result of a copy-on-write > fault and runs into an uncorrectable error, Linux will crash because > it does not have recovery code for this case where poison is consumed > by the kernel. > > It is easy to set up a test case. Just inject an error into a private > page, fork(2), and have the child process write to the page. > > I wrapped that neatly into a test at: > > git://git.kernel.org/pub/scm/linux/kernel/git/aegl/ras-tools.git > > just enable ACPI error injection and run: > > # ./einj_mem-uc -f copy-on-write > > Add a new copy_user_highpage_mc() function that uses copy_mc_to_kernel() > on architectures where that is available (currently x86 and powerpc). > When an error is detected during the page copy, return VM_FAULT_HWPOISON > to caller of wp_page_copy(). This propagates up the call stack. Both x86 > and powerpc have code in their fault handler to deal with this code by > sending a SIGBUS to the application. > > Note that this patch avoids a system crash and signals the process that > triggered the copy-on-write action. It does not take any action for the > memory error that is still in the shared page. To handle that a call to > memory_failure() is needed. But this cannot be done from wp_page_copy() > because it holds mmap_lock(). Perhaps the architecture fault handlers > can deal with this loose end in a subsequent patch? > > On Intel/x86 this loose end will often be handled automatically because > the memory controller provides an additional notification of the h/w > poison in memory, the handler for this will call memory_failure(). This > isn't a 100% solution. If there are multiple errors, not all may be > logged in this way. > > Signed-off-by: Tony Luck Just some minor comments below, but you can add: Reviewed-by: Dan Williams > > --- > Changes in V2: >Naoya Horiguchi: > 1) Use -EHWPOISON error code instead of minus one. > 2) Poison path needs also to deal with old_page >Tony Luck: > Rewrote commit message > Added some powerpc folks to Cc: list > --- > include/linux/highmem.h | 19 +++ > mm/memory.c | 28 +++- > 2 files changed, 38 insertions(+), 9 deletions(-) > > diff --git a/include/linux/highmem.h b/include/linux/highmem.h > index e9912da5441b..5967541fbf0e 100644 > --- a/include/linux/highmem.h > +++ b/include/linux/highmem.h > @@ -319,6 +319,25 @@ static inline void copy_user_highpage(struct page *to, > struct page *from, > > #endif > > +static inline int copy_user_highpage_mc(struct page *to, struct page *from, > + unsigned long vaddr, struct > vm_area_struct *vma) > +{ > + unsigned long ret = 0; > +#ifdef copy_mc_to_kernel > + char *vfrom, *vto; > + > + vfrom = kmap_local_page(from); > + vto = kmap_local_page(to); > + ret = copy_mc_to_kernel(vto, vfrom, PAGE_SIZE); > + kunmap_local(vto); > + kunmap_local(vfrom); > +#else > + copy_user_highpage(to, from, vaddr, vma); > +#endif > + > + return ret; > +} > + There is likely some small benefit of doing this the idiomatic way and let grep see that there are multiple definitions of copy_user_highpage_mc() with an organization like: #ifdef copy_mc_to_kernel static inline int copy_user_highpage_mc(struct page *to, struct page *from, unsigned long vaddr, struct vm_area_struct *vma) { unsigned long ret = 0; char *vfrom, *vto; vfrom = kmap_local_page(from); vto = kmap_local_page(to); ret = copy_mc_to_kernel(vto, vfrom, PAGE_SIZE); kunmap_local(vto); kunmap_local(vfrom); return ret; } #else static inline int copy_user_highpage_mc(struct page *to, struct page *from, unsigned long vaddr, struct vm_area_struct *vma) { copy_user_highpage(to, from, vaddr, vma); return 0; } #endif Per the copy_mc* discussion with Linus I would have called this function copy_mc_to_user_highpage() to clarify that hwpoison is handled from the source buffer of the copy. > #ifndef __HAVE_ARCH_COPY_HIGHPAGE > > static inline void copy_highpage(struct page *to, struct page *from) > diff --git a/mm/memory.c b/mm/memory.c > index f88c351aecd4..a32556c9b689 100644 > --- a/mm/memory.c > +++ b/mm/memory.c > @@ -2848,8 +2848,14 @@ static inline int pte_unmap_same(struct vm_fault *vmf) > return same; > } > > -static inline bool __wp_page_copy_user(struct page *dst, struct page *src, > -struct vm_fault *vmf) > +/* > + * Return: > + * -EHWPOISON: copy failed due to hwpoison in source page > + * 0: copied failed (some other reason) > + * 1: copied succeeded > + */ > +static inline int
[PATCH v2] mm, hwpoison: Try to recover from copy-on write faults
If the kernel is copying a page as the result of a copy-on-write fault and runs into an uncorrectable error, Linux will crash because it does not have recovery code for this case where poison is consumed by the kernel. It is easy to set up a test case. Just inject an error into a private page, fork(2), and have the child process write to the page. I wrapped that neatly into a test at: git://git.kernel.org/pub/scm/linux/kernel/git/aegl/ras-tools.git just enable ACPI error injection and run: # ./einj_mem-uc -f copy-on-write Add a new copy_user_highpage_mc() function that uses copy_mc_to_kernel() on architectures where that is available (currently x86 and powerpc). When an error is detected during the page copy, return VM_FAULT_HWPOISON to caller of wp_page_copy(). This propagates up the call stack. Both x86 and powerpc have code in their fault handler to deal with this code by sending a SIGBUS to the application. Note that this patch avoids a system crash and signals the process that triggered the copy-on-write action. It does not take any action for the memory error that is still in the shared page. To handle that a call to memory_failure() is needed. But this cannot be done from wp_page_copy() because it holds mmap_lock(). Perhaps the architecture fault handlers can deal with this loose end in a subsequent patch? On Intel/x86 this loose end will often be handled automatically because the memory controller provides an additional notification of the h/w poison in memory, the handler for this will call memory_failure(). This isn't a 100% solution. If there are multiple errors, not all may be logged in this way. Signed-off-by: Tony Luck --- Changes in V2: Naoya Horiguchi: 1) Use -EHWPOISON error code instead of minus one. 2) Poison path needs also to deal with old_page Tony Luck: Rewrote commit message Added some powerpc folks to Cc: list --- include/linux/highmem.h | 19 +++ mm/memory.c | 28 +++- 2 files changed, 38 insertions(+), 9 deletions(-) diff --git a/include/linux/highmem.h b/include/linux/highmem.h index e9912da5441b..5967541fbf0e 100644 --- a/include/linux/highmem.h +++ b/include/linux/highmem.h @@ -319,6 +319,25 @@ static inline void copy_user_highpage(struct page *to, struct page *from, #endif +static inline int copy_user_highpage_mc(struct page *to, struct page *from, + unsigned long vaddr, struct vm_area_struct *vma) +{ + unsigned long ret = 0; +#ifdef copy_mc_to_kernel + char *vfrom, *vto; + + vfrom = kmap_local_page(from); + vto = kmap_local_page(to); + ret = copy_mc_to_kernel(vto, vfrom, PAGE_SIZE); + kunmap_local(vto); + kunmap_local(vfrom); +#else + copy_user_highpage(to, from, vaddr, vma); +#endif + + return ret; +} + #ifndef __HAVE_ARCH_COPY_HIGHPAGE static inline void copy_highpage(struct page *to, struct page *from) diff --git a/mm/memory.c b/mm/memory.c index f88c351aecd4..a32556c9b689 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -2848,8 +2848,14 @@ static inline int pte_unmap_same(struct vm_fault *vmf) return same; } -static inline bool __wp_page_copy_user(struct page *dst, struct page *src, - struct vm_fault *vmf) +/* + * Return: + * -EHWPOISON: copy failed due to hwpoison in source page + * 0: copied failed (some other reason) + * 1: copied succeeded + */ +static inline int __wp_page_copy_user(struct page *dst, struct page *src, + struct vm_fault *vmf) { bool ret; void *kaddr; @@ -2860,8 +2866,9 @@ static inline bool __wp_page_copy_user(struct page *dst, struct page *src, unsigned long addr = vmf->address; if (likely(src)) { - copy_user_highpage(dst, src, addr, vma); - return true; + if (copy_user_highpage_mc(dst, src, addr, vma)) + return -EHWPOISON; + return 1; } /* @@ -2888,7 +2895,7 @@ static inline bool __wp_page_copy_user(struct page *dst, struct page *src, * and update local tlb only */ update_mmu_tlb(vma, addr, vmf->pte); - ret = false; + ret = 0; goto pte_unlock; } @@ -2913,7 +2920,7 @@ static inline bool __wp_page_copy_user(struct page *dst, struct page *src, if (!likely(pte_same(*vmf->pte, vmf->orig_pte))) { /* The PTE changed under us, update local tlb */ update_mmu_tlb(vma, addr, vmf->pte); - ret = false; + ret = 0; goto pte_unlock; } @@ -2932,7 +2939,7 @@ static inline bool __wp_page_copy_user(struct
Re: [PATCH printk v2 10/38] tty: hvc: use console_is_enabled()
On Wed, Oct 19, 2022 at 05:01:32PM +0206, John Ogness wrote: > Replace (console->flags & CON_ENABLED) usage with console_is_enabled(). > > Signed-off-by: John Ogness Reviewed-by: Greg Kroah-Hartman
[PATCH printk v2 00/38] reduce console_lock scope
This is v2 of a series to prepare for threaded/atomic printing. It is a rework of patches 6-12 of the v1 [0]. From the v1, patches 1-5 are already mainline and a rework of patches >12 will be posted in a later series. This series focuses on reducing the scope of the BKL console_lock. It achieves this by switching to SRCU and a dedicated mutex for console list iteration and modification, respectively. The console_lock will no longer offer this protection and is completely removed from (un)register_console() and console_stop/start() code. All users of the console_lock for list iteration have been modified. For the call sites where the console_lock is still needed (because of other reasons), I added comments to explain exactly why the console_lock was needed. The base commit for this series is from Paul McKenney's RCU tree and provides an NMI-safe SRCU implementation [1]. Without the NMI-safe SRCU implementation, this series is not less safe than mainline. But we will need the NMI-safe SRCU implementation for atomic consoles anyway, so we might as well get it in now. Especially since it _does_ increase the reliability for mainline in the panic path. Changes since v2: general: - introduce console_is_enabled() to document safe data race on console->flags - switch all "console->flags & CON_ENABLED" code sites to console_is_enabled() - add "for_each_console_srcu" to .clang-format - cleanup/clarify comments relating to console_lock coverage/usage um: - kmsg_dumper: use srcu instead of console_lock for list iteration kgdb/kdb: - configure_kgdboc: keep console_lock for console->device() synchronization, use srcu for list iteration - kgdboc_earlycon_pre_exp_handler: use srcu instead of documenting unsafety for list iteration - kgdboc_earlycon_init: use console_list_lock instead of console_lock to lock list - kdb_msg_write: use srcu instead of documenting unsafety for list iteration tty: - show_cons_active: keep console_lock for console->device() synchronization fbdev: - xen-fbfront: xenfb_probe: use srcu instead of console_lock for list iteration, introduce console_force_preferred() to safely implement hack proc/consoles: - show_console_dev: keep console_lock for console->device() synchronization - c_next: use hlist_entry_safe() instead of hlist_for_each_entry_continue() printk: - remove console_lock from console_stop/start() and (un)register_console() - introduce console_srcu_read_(un)lock() to wrap scru read (un)lock - rename cons_first() macro to console_first() - for_each_console: add lockdep check instead of introducing new for_each_registered_console() - console_list_lock: add warning if in read-side critical section - release srcu read lock on handover - console_flush_all: use srcu instead of relying on console lock for list iteration - console_unblank: use srcu instead of relying on console_lock for list iteration - console_flush_on_panic: use srcu for list iteration and document console->seq race - device: keep console_lock for console->device() synchronization, usr srcu for list iteration - register_console: split list adding logic into the 3 distinct scenarios - register_console: set initial sequence number before adding to list - unregister_console: fix ENODEV return value if the console is not registered - console_stop: synchronize srcu - printk_late_init: use _safe variant of iteration - __pr_flush: use srcu instead of relying on console_lock for list iteration John Ogness [0] https://lore.kernel.org/r/20220924000454.3319186-1-john.ogn...@linutronix.de [1] https://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu.git/log/?h=srcunmisafe.2022.10.18b John Ogness (37): printk: Convert console_drivers list to hlist printk: Prepare for SRCU console list protection printk: introduce console_is_enabled() wrapper printk: use console_is_enabled() tty: nfcon: use console_is_enabled() um: kmsg_dump: use console_is_enabled() efi: earlycon: use console_is_enabled() netconsole: use console_is_enabled() tty: hvc: use console_is_enabled() tty: serial: earlycon: use console_is_enabled() tty: serial: kgdboc: use console_is_enabled() tty: serial: pic32_uart: use console_is_enabled() tty: serial: samsung_tty: use console_is_enabled() tty: serial: serial_core: use console_is_enabled() tty: serial: xilinx_uartps: use console_is_enabled() tty: tty_io: use console_is_enabled() usb: early: xhci-dbc: use console_is_enabled() kdb: kdb_io: use console_is_enabled() um: kmsg_dumper: use srcu console list iterator serial: kgdboc: use srcu console list iterator serial: kgdboc: document console_lock usage tty: tty_io: document console_lock usage xen: fbfront: use srcu console list iterator proc: consoles: document console_lock usage kdb: use srcu console list iterator printk: console_flush_all: use srcu console list iterator printk: console_unblank: use srcu console list iterator
[PATCH printk v2 10/38] tty: hvc: use console_is_enabled()
Replace (console->flags & CON_ENABLED) usage with console_is_enabled(). Signed-off-by: John Ogness --- drivers/tty/hvc/hvc_console.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/hvc/hvc_console.c b/drivers/tty/hvc/hvc_console.c index 4802cfaa107f..6d1d7b72488c 100644 --- a/drivers/tty/hvc/hvc_console.c +++ b/drivers/tty/hvc/hvc_console.c @@ -265,7 +265,7 @@ static void hvc_port_destruct(struct tty_port *port) static void hvc_check_console(int index) { /* Already enabled, bail out */ - if (hvc_console.flags & CON_ENABLED) + if (console_is_enabled(_console)) return; /* If this index is what the user requested, then register -- 2.30.2
[linux-next:master] BUILD REGRESSION a72b55bc981b62f7186600d06d1824f1d0612b27
tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master branch HEAD: a72b55bc981b62f7186600d06d1824f1d0612b27 Add linux-next specific files for 20221019 Error/Warning reports: https://lore.kernel.org/linux-mm/202210090954.ptr6m6rj-...@intel.com https://lore.kernel.org/linux-mm/202210110857.9s0txvnn-...@intel.com https://lore.kernel.org/linux-mm/202210111318.mbufyhps-...@intel.com https://lore.kernel.org/llvm/202210060148.uxbijocs-...@intel.com Error/Warning: (recently discovered and may have been fixed) ERROR: modpost: "devm_ioremap_resource" [drivers/dma/idma64.ko] undefined! ERROR: modpost: "devm_ioremap_resource" [drivers/dma/qcom/hdma.ko] undefined! arch/arm64/kernel/alternative.c:199:6: warning: no previous prototype for 'apply_alternatives_vdso' [-Wmissing-prototypes] arch/arm64/kernel/alternative.c:295:14: warning: no previous prototype for 'alt_cb_patch_nops' [-Wmissing-prototypes] arch/powerpc/mm/nohash/e500.c:314:21: error: no previous prototype for 'relocate_init' [-Werror=missing-prototypes] fs/ext4/super.c:1744:19: warning: 'deprecated_msg' defined but not used [-Wunused-const-variable=] Error/Warning ids grouped by kconfigs: gcc_recent_errors |-- arm64-allyesconfig | |-- arch-arm64-kernel-alternative.c:warning:no-previous-prototype-for-alt_cb_patch_nops | `-- arch-arm64-kernel-alternative.c:warning:no-previous-prototype-for-apply_alternatives_vdso |-- arm64-randconfig-c041-20221019 | |-- arch-arm64-kernel-alternative.c:warning:no-previous-prototype-for-alt_cb_patch_nops | `-- arch-arm64-kernel-alternative.c:warning:no-previous-prototype-for-apply_alternatives_vdso |-- arm64-randconfig-s031-20221019 | |-- arch-arm64-kernel-alternative.c:warning:no-previous-prototype-for-alt_cb_patch_nops | |-- arch-arm64-kernel-alternative.c:warning:no-previous-prototype-for-apply_alternatives_vdso | |-- fs-ext4-fast_commit.c:sparse:sparse:incorrect-type-in-argument-(different-base-types)-expected-int-priv1-got-restricted-__le16-addressable-usertype-fc_len | |-- fs-ext4-fast_commit.c:sparse:sparse:incorrect-type-in-argument-(different-base-types)-expected-int-tag-got-restricted-__le16-addressable-usertype-fc_tag | |-- fs-ext4-fast_commit.c:sparse:sparse:incorrect-type-in-argument-(different-base-types)-expected-unsigned-short-usertype-tag-got-restricted-__le16-addressable-usertype-fc_tag | |-- fs-ext4-fast_commit.c:sparse:sparse:incorrect-type-in-assignment-(different-base-types)-expected-restricted-__le16-usertype-fc_len-got-unsigned-short-usertype | |-- fs-ext4-fast_commit.c:sparse:sparse:incorrect-type-in-assignment-(different-base-types)-expected-restricted-__le16-usertype-fc_tag-got-unsigned-short-usertype | |-- fs-ext4-fast_commit.c:sparse:sparse:incorrect-type-in-initializer-(different-base-types)-expected-int-tag-got-restricted-__le16-usertype-fc_tag | |-- fs-ext4-fast_commit.c:sparse:sparse:restricted-__le16-degrades-to-integer | |-- fs-ntfs3-index.c:sparse:sparse:restricted-__le32-degrades-to-integer | |-- fs-ntfs3-namei.c:sparse:sparse:incorrect-type-in-argument-(different-base-types)-expected-restricted-__le16-const-usertype-s1-got-unsigned-short | `-- fs-ntfs3-namei.c:sparse:sparse:incorrect-type-in-argument-(different-base-types)-expected-restricted-__le16-const-usertype-s2-got-unsigned-short |-- i386-allyesconfig | `-- fs-ext4-super.c:warning:deprecated_msg-defined-but-not-used |-- i386-defconfig | `-- fs-ext4-super.c:warning:deprecated_msg-defined-but-not-used |-- i386-randconfig-a003 | `-- fs-ext4-super.c:warning:deprecated_msg-defined-but-not-used |-- i386-randconfig-a005 | `-- fs-ext4-super.c:warning:deprecated_msg-defined-but-not-used |-- i386-randconfig-a012 | `-- fs-ext4-super.c:warning:deprecated_msg-defined-but-not-used |-- i386-randconfig-a014 | `-- fs-ext4-super.c:warning:deprecated_msg-defined-but-not-used |-- i386-randconfig-a016 | `-- fs-ext4-super.c:warning:deprecated_msg-defined-but-not-used |-- microblaze-randconfig-s033-20221019 | |-- fs-ext4-fast_commit.c:sparse:sparse:incorrect-type-in-argument-(different-base-types)-expected-int-priv1-got-restricted-__le16-addressable-usertype-fc_len | |-- fs-ext4-fast_commit.c:sparse:sparse:incorrect-type-in-argument-(different-base-types)-expected-int-tag-got-restricted-__le16-addressable-usertype-fc_tag | |-- fs-ext4-fast_commit.c:sparse:sparse:incorrect-type-in-argument-(different-base-types)-expected-unsigned-short-usertype-tag-got-restricted-__le16-addressable-usertype-fc_tag | |-- fs-ext4-fast_commit.c:sparse:sparse:incorrect-type-in-assignment-(different-base-types)-expected-restricted-__le16-usertype-fc_len-got-unsigned-short-usertype | |-- fs-ext4-fast_commit.c:sparse:sparse:incorrect-type-in-assignment-(different-base-types)-expected-restricted-__le16-usertype-fc_tag-got-unsigned-short-usertype | |-- fs-ext4-fast_commit.c:sparse:sparse:incorrect-type-in-initializer-(different-base-types)-
Re: [PATCH net-next v7 00/10] net: dpaa: Convert to phylink
Hello: This series was applied to netdev/net-next.git (master) by David S. Miller : On Mon, 17 Oct 2022 16:22:31 -0400 you wrote: > This series converts the DPAA driver to phylink. > > I have tried to maintain backwards compatibility with existing device > trees whereever possible. However, one area where I was unable to > achieve this was with QSGMII. Please refer to patch 2 for details. > > All mac drivers have now been converted. I would greatly appreciate if > anyone has T-series or P-series boards they can test/debug this series > on. I only have an LS1046ARDB. Everything but QSGMII should work without > breakage; QSGMII needs patches 7 and 8. For this reason, the last 4 > patches in this series should be applied together (and should not go > through separate trees). > > [...] Here is the summary with links: - [net-next,v7,01/10] dt-bindings: net: Expand pcs-handle to an array https://git.kernel.org/netdev/net-next/c/76025ee53b7d - [net-next,v7,02/10] dt-bindings: net: Add Lynx PCS binding https://git.kernel.org/netdev/net-next/c/00af103d06b3 - [net-next,v7,03/10] dt-bindings: net: fman: Add additional interface properties https://git.kernel.org/netdev/net-next/c/045d05018a2d - [net-next,v7,04/10] net: phylink: provide phylink_validate_mask_caps() helper (no matching commit) - [net-next,v7,05/10] net: fman: memac: Add serdes support https://git.kernel.org/netdev/net-next/c/0fc83bd79589 - [net-next,v7,06/10] net: fman: memac: Use lynx pcs driver https://git.kernel.org/netdev/net-next/c/a7c2a32e7f22 - [net-next,v7,07/10] net: dpaa: Convert to phylink (no matching commit) - [net-next,v7,08/10] powerpc: dts: t208x: Mark MAC1 and MAC2 as 10G https://git.kernel.org/netdev/net-next/c/36926a7d70c2 - [net-next,v7,09/10] powerpc: dts: qoriq: Add nodes for QSGMII PCSs https://git.kernel.org/netdev/net-next/c/4e31b808fad1 - [net-next,v7,10/10] arm64: dts: layerscape: Add nodes for QSGMII PCSs https://git.kernel.org/netdev/net-next/c/4e748b1bd7c0 You are awesome, thank you! -- Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html
warning from change_protection in 6.1 rc1
Hi, in my first boot with the 6.1 rc1 kernel I have received a couple of warnings from change_protection on Talos II P9 system, see the details below. Nothing like that was noticed in 6.0 or earlier. Thanks, Dan [ 79.229100] [ cut here ] [ 79.229109] WARNING: CPU: 61 PID: 2987 at arch/powerpc/include/asm/book3s/64/tlbflush.h:183 change_protection+0xfd0/0x1610 [ 79.229125] Modules linked in: nft_reject_inet nf_reject_ipv4 nf_reject_ipv6 nft_reject nft_objref nf_conntrack_tftp nft_ct kvm_hv kvm nfsv3 nfs_acl rpcsec_gss_krb5 auth_rpcgss nfsv4 dns_resolver nfs lockd grace sunrpc fscache netfs nf_tables ebtable_nat ebtable_broute ip6table_nat ip6table_mangle ip6table_raw ip6table_security iptable_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 iptable_mangle iptable_raw iptable_security bridge stp llc ip_set nfnetlink rfkill ebtable_filter ebtables ip6table_filter iptable_filter binfmt_misc dm_crypt xfs snd_hda_codec_realtek snd_hda_codec_generic ledtrig_audio snd_hda_codec_hdmi ftdi_sio onboard_usb_hub snd_hda_intel snd_intel_dspcfg snd_hda_codec snd_hda_core snd_hwdep snd_seq snd_seq_device snd_pcm snd_timer ses enclosure ofpart snd soundcore scsi_transport_sas at24 ipmi_powernv ipmi_devintf powernv_flash regmap_i2c opal_prd crct10dif_vpmsum i2c_opal ipmi_msghandler mtd rtc_opal amdgpu raid1 drm_ttm_helper ttm mfd_core gpu_sc hed vmx_crypto [ 79.229258] crc32c_vpmsum drm_buddy nvme drm_display_helper nvme_core tg3 nvme_common aacraid cec ip6_tables ip_tables i2c_dev fuse [ 79.229283] CPU: 61 PID: 2987 Comm: lightdm-gtk-gre Not tainted 6.1.0-0.rc1.15.fc38.ppc64le #1 [ 79.229289] Hardware name: T2P9D01 REV 1.00 POWER9 0x4e1202 opal:skiboot-bc106a0 PowerNV [ 79.229291] NIP: c0495aa0 LR: c0495608 CTR: [ 79.229295] REGS: c00020001766f690 TRAP: 0700 Not tainted (6.1.0-0.rc1.15.fc38.ppc64le) [ 79.229299] MSR: 90029033 CR: 44242420 XER: 0156 [ 79.229316] CFAR: c049562c IRQMASK: 0 GPR00: c0495608 c00020001766f930 c1dd7100 c00020001e4e3700 GPR04: 00015444 c00020004eac3920 84030a73002000c0 88030a73002000c0 GPR08: 0040 0001 0040 0009 GPR12: c00020001795f708 c0002007be1a9700 c0002000554b 00015444 GPR16: c01f9f40 fe7f c2acdbb8 c2a3aef0 GPR20: c00020001766fac8 ff7fefbf 08010080 c00c00080013ab28 GPR24: 0004 c00c00080013ab00 00015460 0001549b GPR28: 88030a73002000c0 c000200054354510 000d c00020004eac3920 [ 79.229377] NIP [c0495aa0] change_protection+0xfd0/0x1610 [ 79.229384] LR [c0495608] change_protection+0xb38/0x1610 [ 79.229390] Call Trace: [ 79.229392] [c00020001766f930] [c0495608] change_protection+0xb38/0x1610 (unreliable) [ 79.229401] [c00020001766faa0] [c04eda5c] change_prot_numa+0x7c/0x120 [ 79.229408] [c00020001766fb70] [c01ad5dc] task_numa_work+0x2cc/0x500 [ 79.229414] [c00020001766fc70] [c0185bb4] task_work_run+0xf4/0x180 [ 79.229421] [c00020001766fcc0] [c00218c4] do_notify_resume+0x434/0x470 [ 79.229429] [c00020001766fd80] [c002c29c] interrupt_exit_user_prepare_main+0x1dc/0x2c0 [ 79.229437] [c00020001766fde0] [c002c618] interrupt_exit_user_prepare+0x58/0xb0 [ 79.229444] [c00020001766fe10] [c000c8f4] interrupt_return_srr_user+0x8/0x138 [ 79.229452] --- interrupt: 900 at 0x7fffa62b7cfc [ 79.229458] NIP: 7fffa62b7cfc LR: 7fffa62b7c48 CTR: 0639 [ 79.229461] REGS: c00020001766fe80 TRAP: 0900 Not tainted (6.1.0-0.rc1.15.fc38.ppc64le) [ 79.229464] MSR: 9280f033 CR: 8824 XER: 0156 [ 79.229484] CFAR: IRQMASK: 0 GPR00: 7fffa62b7c28 7fffc324a3e0 7fffa63f7a00 7ffe5300 GPR04: 7ffe532d7800 7fff594d9610 7fff594d8e90 00b8 GPR08: 7ffe532d7d20 7fff594d7d30 00b9 GPR12: 7fffa611bfd0 7fffa6e58d00 0008 7fffa5d97480 GPR16: 000154958000 000b 0020 0001 GPR20: 027f 000154907000 0001543e9100 GPR24: 0004 04b0 0780 1e00 GPR28: 032c 1e00 7fff594d7810 0001548d71a0 [ 79.229545] NIP [7fffa62b7cfc] 0x7fffa62b7cfc [ 79.229548] LR [7fffa62b7c48] 0x7fffa62b7c48 [ 79.229551] --- interrupt: 900 [ 79.229553] Instruction dump: [ 79.229555] 0fe0 6000 6000 6042 0fe0 6000 6000
[RFC PATCH v5 1/8] mm: Make a place for a common balloon code
The file already contains code that is common along balloon drivers so rename it to reflect its contents. mm/balloon_compaction.c -> mm/balloon.c include/linux/balloon_compaction.h -> include/linux/balloon.h Remove it from files that do not actually use it. Drop externs from function declarations. Signed-off-by: Alexander Atanasov Acked-by: Nadav Amit --- MAINTAINERS | 4 ++-- arch/powerpc/platforms/pseries/cmm.c | 2 +- drivers/misc/vmw_balloon.c| 2 +- drivers/virtio/virtio_balloon.c | 2 +- include/linux/{balloon_compaction.h => balloon.h} | 12 +--- mm/Makefile | 2 +- mm/{balloon_compaction.c => balloon.c}| 4 +--- mm/migrate.c | 1 - mm/vmscan.c | 1 - 9 files changed, 12 insertions(+), 18 deletions(-) rename include/linux/{balloon_compaction.h => balloon.h} (93%) rename mm/{balloon_compaction.c => balloon.c} (99%) diff --git a/MAINTAINERS b/MAINTAINERS index cf0f18502372..3f5a4e409562 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -21744,8 +21744,8 @@ L: virtualizat...@lists.linux-foundation.org S: Maintained F: drivers/virtio/virtio_balloon.c F: include/uapi/linux/virtio_balloon.h -F: include/linux/balloon_compaction.h -F: mm/balloon_compaction.c +F: include/linux/balloon.h +F: mm/balloon.c VIRTIO CRYPTO DRIVER M: Gonglei diff --git a/arch/powerpc/platforms/pseries/cmm.c b/arch/powerpc/platforms/pseries/cmm.c index 5f4037c1d7fe..1d40f6416d6a 100644 --- a/arch/powerpc/platforms/pseries/cmm.c +++ b/arch/powerpc/platforms/pseries/cmm.c @@ -19,7 +19,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/misc/vmw_balloon.c b/drivers/misc/vmw_balloon.c index 61a2be712bf7..91d4d2a285c5 100644 --- a/drivers/misc/vmw_balloon.c +++ b/drivers/misc/vmw_balloon.c @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c index 3f78a3a1eb75..d0c27c680721 100644 --- a/drivers/virtio/virtio_balloon.c +++ b/drivers/virtio/virtio_balloon.c @@ -13,7 +13,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/include/linux/balloon_compaction.h b/include/linux/balloon.h similarity index 93% rename from include/linux/balloon_compaction.h rename to include/linux/balloon.h index 5ca2d5699620..46ac8f61f607 100644 --- a/include/linux/balloon_compaction.h +++ b/include/linux/balloon.h @@ -1,7 +1,5 @@ /* SPDX-License-Identifier: GPL-2.0 */ /* - * include/linux/balloon_compaction.h - * * Common interface definitions for making balloon pages movable by compaction. * * Balloon page migration makes use of the general non-lru movable page @@ -59,13 +57,13 @@ struct balloon_dev_info { struct page *page, enum migrate_mode mode); }; -extern struct page *balloon_page_alloc(void); -extern void balloon_page_enqueue(struct balloon_dev_info *b_dev_info, +struct page *balloon_page_alloc(void); +void balloon_page_enqueue(struct balloon_dev_info *b_dev_info, struct page *page); -extern struct page *balloon_page_dequeue(struct balloon_dev_info *b_dev_info); -extern size_t balloon_page_list_enqueue(struct balloon_dev_info *b_dev_info, +struct page *balloon_page_dequeue(struct balloon_dev_info *b_dev_info); +size_t balloon_page_list_enqueue(struct balloon_dev_info *b_dev_info, struct list_head *pages); -extern size_t balloon_page_list_dequeue(struct balloon_dev_info *b_dev_info, +size_t balloon_page_list_dequeue(struct balloon_dev_info *b_dev_info, struct list_head *pages, size_t n_req_pages); static inline void balloon_devinfo_init(struct balloon_dev_info *balloon) diff --git a/mm/Makefile b/mm/Makefile index 8e105e5b3e29..f73a9b200c91 100644 --- a/mm/Makefile +++ b/mm/Makefile @@ -116,7 +116,7 @@ obj-$(CONFIG_ZSMALLOC) += zsmalloc.o obj-$(CONFIG_Z3FOLD) += z3fold.o obj-$(CONFIG_GENERIC_EARLY_IOREMAP) += early_ioremap.o obj-$(CONFIG_CMA) += cma.o -obj-$(CONFIG_MEMORY_BALLOON) += balloon_compaction.o +obj-$(CONFIG_MEMORY_BALLOON) += balloon.o obj-$(CONFIG_PAGE_EXTENSION) += page_ext.o obj-$(CONFIG_PAGE_TABLE_CHECK) += page_table_check.o obj-$(CONFIG_CMA_DEBUGFS) += cma_debug.o diff --git a/mm/balloon_compaction.c b/mm/balloon.c similarity index 99% rename from mm/balloon_compaction.c rename to mm/balloon.c index 22c96fed70b5..22b3e876bc78 100644 --- a/mm/balloon_compaction.c +++ b/mm/balloon.c @@ -1,7 +1,5 @@ // SPDX-License-Identifier: GPL-2.0-only /* - * mm/balloon_compaction.c - * * Common interface for making balloon pages movable by compaction. * * Copyright
[PATCH 42/44] serial: ucc_uart: Use uart_xmit_advance()
Take advantage of the new uart_xmit_advance() helper. Signed-off-by: Ilpo Järvinen --- drivers/tty/serial/ucc_uart.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/tty/serial/ucc_uart.c b/drivers/tty/serial/ucc_uart.c index 82cf14dd3d43..b09b6496ee3e 100644 --- a/drivers/tty/serial/ucc_uart.c +++ b/drivers/tty/serial/ucc_uart.c @@ -372,8 +372,7 @@ static int qe_uart_tx_pump(struct uart_qe_port *qe_port) p = qe2cpu_addr(be32_to_cpu(bdp->buf), qe_port); while (count < qe_port->tx_fifosize) { *p++ = xmit->buf[xmit->tail]; - xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); - port->icount.tx++; + uart_xmit_advance(port, 1); count++; if (xmit->head == xmit->tail) break; -- 2.30.2
[PATCH 26/44] serial: pmac_zilog: Use uart_xmit_advance()
Take advantage of the new uart_xmit_advance() helper. Signed-off-by: Ilpo Järvinen --- drivers/tty/serial/pmac_zilog.c | 6 ++ 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/tty/serial/pmac_zilog.c b/drivers/tty/serial/pmac_zilog.c index fe2e4ec423f7..13668ffdb1e7 100644 --- a/drivers/tty/serial/pmac_zilog.c +++ b/drivers/tty/serial/pmac_zilog.c @@ -410,8 +410,7 @@ static void pmz_transmit_chars(struct uart_pmac_port *uap) write_zsdata(uap, xmit->buf[xmit->tail]); zssync(uap); - xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); - uap->port.icount.tx++; + uart_xmit_advance(>port, 1); if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) uart_write_wakeup(>port); @@ -627,8 +626,7 @@ static void pmz_start_tx(struct uart_port *port) return; write_zsdata(uap, xmit->buf[xmit->tail]); zssync(uap); - xmit->tail = (xmit->tail + 1) & (UART_XMIT_SIZE - 1); - port->icount.tx++; + uart_xmit_advance(port, 1); if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS) uart_write_wakeup(>port); -- 2.30.2
[PATCH -next] tty: hvc: make hvc_rtas_dev static
The symbol is not used outside of the file, so mark it static. Fixes the following warning: drivers/tty/hvc/hvc_rtas.c:29:19: warning: symbol 'hvc_rtas_dev' was not declared. Should it be static? Signed-off-by: ruanjinjie --- drivers/tty/hvc/hvc_rtas.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/tty/hvc/hvc_rtas.c b/drivers/tty/hvc/hvc_rtas.c index e8b8c645482b..184d325abeed 100644 --- a/drivers/tty/hvc/hvc_rtas.c +++ b/drivers/tty/hvc/hvc_rtas.c @@ -26,7 +26,7 @@ #include "hvc_console.h" #define hvc_rtas_cookie 0x67781e15 -struct hvc_struct *hvc_rtas_dev; +static struct hvc_struct *hvc_rtas_dev; static int rtascons_put_char_token = RTAS_UNKNOWN_SERVICE; static int rtascons_get_char_token = RTAS_UNKNOWN_SERVICE; -- 2.25.1
[PATCH -next v2] powerpc/mpic_msgr: fix cast removes address space of expression warnings
When build Linux kernel, encounter the following warnings: ./arch/powerpc/sysdev/mpic_msgr.c:230:38: warning: cast removes address space '__iomem' of expression ./arch/powerpc/sysdev/mpic_msgr.c:230:27: warning: incorrect type in assignment (different address spaces) The data type of msgr->mer and msgr->base are 'u32 __iomem *', but converted to 'u32 *' and 'u8 *' directly and cause above warnings, now instead of using a type cast, change the size of the pointer offset to fix these warnings. Signed-off-by: ruanjinjie --- v2: - change the macro of MPIC_MSGR_MER_OFFSET to avoid type cast and simplify the fix --- arch/powerpc/sysdev/mpic_msgr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/sysdev/mpic_msgr.c b/arch/powerpc/sysdev/mpic_msgr.c index a439e33eae06..d75064fb7d12 100644 --- a/arch/powerpc/sysdev/mpic_msgr.c +++ b/arch/powerpc/sysdev/mpic_msgr.c @@ -20,7 +20,7 @@ #define MPIC_MSGR_REGISTERS_PER_BLOCK 4 #define MPIC_MSGR_STRIDE 0x10 -#define MPIC_MSGR_MER_OFFSET 0x100 +#define MPIC_MSGR_MER_OFFSET (0x100 / sizeof(u32)) #define MSGR_INUSE 0 #define MSGR_FREE 1 @@ -234,7 +234,7 @@ static int mpic_msgr_probe(struct platform_device *dev) reg_number = block_number * MPIC_MSGR_REGISTERS_PER_BLOCK + i; msgr->base = msgr_block_addr + i * MPIC_MSGR_STRIDE; - msgr->mer = (u32 *)((u8 *)msgr->base + MPIC_MSGR_MER_OFFSET); + msgr->mer = msgr->base + MPIC_MSGR_MER_OFFSET; msgr->in_use = MSGR_FREE; msgr->num = i; raw_spin_lock_init(>lock); -- 2.25.1