id
stringlengths
40
40
instruction
stringlengths
68
308
input
stringlengths
17
33.4k
output
stringlengths
100
30k
9f965f1efc26c8ff65d02473d985852d181dff6a
Analyze and fix the following issue in the Linux kernel code: Staging: rtl8192e: Rename variable NumRecvDataInPeriod
Problem Details: Rename variable NumRecvDataInPeriod to num_recv_data_in_period to fix checkpatch warning Avoid CamelCase. Signed-off-by: Tree Davies <tdavies@darkphysics.net> Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> Link: https://lore.kernel.org/r/20240227044157.407379-3-tdavies@darkphysics.net Sign...
```diff diff --git a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c index 605bce803b5f..de06b0248525 100644 --- a/drivers/staging/rtl8192e/rtl8192e/rtl_core.c +++ b/drivers/staging/rtl8192e/rtl8192e/rtl_core.c @@ -925,7 +925,7 @@ static void _rtl92e_update_rxcounts(struct r8...
d1c4f17f1a1dd1be1a22e198a518e8f682f4013e
Analyze and fix the following issue in the Linux kernel code: Staging: rtl8192e: Rename function rtllib_rx_ADDBAReq()
Problem Details: Rename function rtllib_rx_ADDBAReq to rtllib_rx_add_ba_req to fix checkpatch warning Avoid CamelCase. Signed-off-by: Tree Davies <tdavies@darkphysics.net> Tested-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> Link: https://lore.kernel.org/r/20240227044157.407379-2-tdavies@darkphysics.net Signed-o...
```diff diff --git a/drivers/staging/rtl8192e/rtl819x_BAProc.c b/drivers/staging/rtl8192e/rtl819x_BAProc.c index da7319c124e7..bd1d86e0323d 100644 --- a/drivers/staging/rtl8192e/rtl819x_BAProc.c +++ b/drivers/staging/rtl8192e/rtl819x_BAProc.c @@ -211,7 +211,7 @@ static void rtllib_send_DELBA(struct rtllib_device *ieee,...
9bed49bfd17c8ffa808c250244ea9adf0497dfd6
Analyze and fix the following issue in the Linux kernel code: staging: vme_user: Fix misaligned closing comment */
Problem Details: This patch makes the following change: * Ensures the trailing */ for comments is on the same line as the opening /* Signed-off-by: Jonathan Bergh <bergh.jonathan@gmail.com> Link: https://lore.kernel.org/r/20240303100547.153636-1-bergh.jonathan@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@li...
```diff diff --git a/drivers/staging/vme_user/vme_tsi148.h b/drivers/staging/vme_user/vme_tsi148.h index 4dd224d0b86e..db246cbc54c3 100644 --- a/drivers/staging/vme_user/vme_tsi148.h +++ b/drivers/staging/vme_user/vme_tsi148.h @@ -691,8 +691,7 @@ static const int TSI148_GCSR_MBOX[4] = { TSI148_GCSR_MBOX0, #define TS...
c3a41e11628e0ff7f6252b95c3025676603b6d90
Analyze and fix the following issue in the Linux kernel code: Staging: vc04_services: bcm2835-camera: fix brace code style check
Problem Details: Reformat function parameters to fix checkpatch check: Increase readability and consistency Signed-off-by: "Moritz C. Weber" <mo.c.weber@gmail.com> Link: https://lore.kernel.org/r/20240219112234.8673-3-mo.c.weber@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
```diff diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c index e6ff5ea04471..c3ba490e53cb 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera...
431f02718e1c5d2caa486d023742ec19f14d705c
Analyze and fix the following issue in the Linux kernel code: Staging: vc04_services: bcm2835-camera: fix blank line style check
Problem Details: Remove blank line to fix checkpatch check: Increase readability and consistency Signed-off-by: "Moritz C. Weber" <mo.c.weber@gmail.com> Link: https://lore.kernel.org/r/20240219112234.8673-2-mo.c.weber@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
```diff diff --git a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c index e6e89784d84b..e6ff5ea04471 100644 --- a/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera.c +++ b/drivers/staging/vc04_services/bcm2835-camera/bcm2835-camera...
daf8739c3322a762ce84f240f50e0c39181a41ab
Analyze and fix the following issue in the Linux kernel code: drm/nouveau: fix stale locked mutex in nouveau_gem_ioctl_pushbuf
Problem Details: If VM_BIND is enabled on the client the legacy submission ioctl can't be used, however if a client tries to do so regardless it will return an error. In this case the clients mutex remained unlocked leading to a deadlock inside nouveau_drm_postclose or any other nouveau ioctl call. Fixes: b88baab82871...
```diff diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c index 49c2bcbef129..5a887d67dc0e 100644 --- a/drivers/gpu/drm/nouveau/nouveau_gem.c +++ b/drivers/gpu/drm/nouveau/nouveau_gem.c @@ -764,7 +764,7 @@ nouveau_gem_ioctl_pushbuf(struct drm_device *dev, void *data, return -...
34164202a5827f60a203ca9acaf2d9f7d432aac8
Analyze and fix the following issue in the Linux kernel code: staging: greybus: fix get_channel_from_mode() failure path
Problem Details: The get_channel_from_mode() function is supposed to return the channel which matches the mode. But it has a bug where if it doesn't find a matching channel then it returns the last channel. It should return NULL instead. Also remove an unnecessary NULL check on "channel". Fixes: 2870b52bae4c ("grey...
```diff diff --git a/drivers/staging/greybus/light.c b/drivers/staging/greybus/light.c index 87d36948c610..c6bd86a5335a 100644 --- a/drivers/staging/greybus/light.c +++ b/drivers/staging/greybus/light.c @@ -100,15 +100,15 @@ static struct led_classdev *get_channel_cdev(struct gb_channel *channel) static struct gb_chan...
b234c70fefa7532d34ebee104de64cc16f1b21e4
Analyze and fix the following issue in the Linux kernel code: xhci: Fix failure to detect ring expansion need.
Problem Details: Ring expansion checker may incorrectly assume a completely full ring is empty, missing the need for expansion. This is due to a special empty ring case where the dequeue ends up ahead of the enqueue pointer. This is seen when enqueued TRBs fill up exactly a segment, with enqueue then pointing to the e...
```diff diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index f0d8a607ff21..4f64b814d4aa 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -326,7 +326,13 @@ static unsigned int xhci_ring_expansion_needed(struct xhci_hcd *xhci, struct xhc /* how many trbs will be ...
b037e40a6af2b056f7f15d9aabe7e9a9a7149ff3
Analyze and fix the following issue in the Linux kernel code: docs: perf: Fix build warning of hisi-pcie-pmu.rst
Problem Details: `make htmldocs SPHINXDIRS="admin-guide"` shows below warnings: Documentation/admin-guide/perf/hisi-pcie-pmu.rst:48: ERROR: Unexpected indentation. Documentation/admin-guide/perf/hisi-pcie-pmu.rst:49: WARNING: Block quote ends without a blank line; unexpected unindent. Fix this. Closes: https://lore.k...
```diff diff --git a/Documentation/admin-guide/perf/hisi-pcie-pmu.rst b/Documentation/admin-guide/perf/hisi-pcie-pmu.rst index 678d3865560c..5541ff40e06a 100644 --- a/Documentation/admin-guide/perf/hisi-pcie-pmu.rst +++ b/Documentation/admin-guide/perf/hisi-pcie-pmu.rst @@ -44,6 +44,7 @@ The related events usually used...
3d9319c27ceb35fa3d2c8b15508967f3fc7e5b78
Analyze and fix the following issue in the Linux kernel code: Revert "tty: serial: simplify qcom_geni_serial_send_chunk_fifo()"
Problem Details: This reverts commit 5c7e105cd156fc9adf5294a83623d7a40c15f9b9. As identified by KASAN, the simplification done by the cleanup patch was not legal. >From tracing through the code, it can be seen that we're transmitting from a 4096-byte circular buffer. We copy anywhere from 1-4 bytes from it each time....
```diff diff --git a/drivers/tty/serial/qcom_geni_serial.c b/drivers/tty/serial/qcom_geni_serial.c index e63a8fbe63bd..99e08737f293 100644 --- a/drivers/tty/serial/qcom_geni_serial.c +++ b/drivers/tty/serial/qcom_geni_serial.c @@ -851,19 +851,21 @@ static void qcom_geni_serial_stop_tx(struct uart_port *uport) } sta...
74cb7e0355fae9641f825afa389d3fba3b617714
Analyze and fix the following issue in the Linux kernel code: tty: serial: fsl_lpuart: avoid idle preamble pending if CTS is enabled
Problem Details: If the remote uart device is not connected or not enabled after booting up, the CTS line is high by default. At this time, if we enable the flow control when opening the device(for example, using “stty -F /dev/ttyLP4 crtscts” command), there will be a pending idle preamble(first writing 0 and then writ...
```diff diff --git a/drivers/tty/serial/fsl_lpuart.c b/drivers/tty/serial/fsl_lpuart.c index 5ddf110aedbe..bbcbc91482af 100644 --- a/drivers/tty/serial/fsl_lpuart.c +++ b/drivers/tty/serial/fsl_lpuart.c @@ -2345,9 +2345,12 @@ lpuart32_set_termios(struct uart_port *port, struct ktermios *termios, lpuart32_write(&spo...
801410b26a0e8b8a16f7915b2b55c9528b69ca87
Analyze and fix the following issue in the Linux kernel code: serial: Lock console when calling into driver before registration
Problem Details: During the handoff from earlycon to the real console driver, we have two separate drivers operating on the same device concurrently. In the case of the 8250 driver these concurrent accesses cause problems due to the driver's use of banked registers, controlled by LCR.DLAB. It is possible for the setup(...
```diff diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c index 336a0bd4d172..fc9dd5d45295 100644 --- a/drivers/tty/serial/8250/8250_port.c +++ b/drivers/tty/serial/8250/8250_port.c @@ -1325,9 +1325,6 @@ static void autoconfig_irq(struct uart_8250_port *up) inb_p(ICP); } - if...
7bfb915a597a301abb892f620fe5c283a9fdbd77
Analyze and fix the following issue in the Linux kernel code: serial: core: only stop transmit when HW fifo is empty
Problem Details: If the circular buffer is empty, it just means we fit all characters to send into the HW fifo, but not that the hardware finished transmitting them. So if we immediately call stop_tx() after that, this may abort any pending characters in the HW fifo, and cause dropped characters on the console. Fix t...
```diff diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 55b1f3ba48ac..bb0f2d4ac62f 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h @@ -786,7 +786,8 @@ enum UART_TX_FLAGS { if (pending < WAKEUP_CHARS) { \ uart_write_wakeup(__port); \ ...
87850f6cc20911e35eafcbc1d56b0d649ae9162d
Analyze and fix the following issue in the Linux kernel code: usb: gadget: fsl: Increase size of name buffer for endpoints
Problem Details: This fixes a W=1 warning about sprintf writing up to 16 bytes into a buffer of size 14. There is no practical relevance because there are not more than 32 endpoints. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/6754df25c56aae04f8110594fad2cd2452b1862...
```diff diff --git a/drivers/usb/gadget/udc/fsl_udc_core.c b/drivers/usb/gadget/udc/fsl_udc_core.c index 6f005cee917c..e82d03224f94 100644 --- a/drivers/usb/gadget/udc/fsl_udc_core.c +++ b/drivers/usb/gadget/udc/fsl_udc_core.c @@ -2495,7 +2495,7 @@ static int fsl_udc_probe(struct platform_device *pdev) /* setup the u...
d78ff37567c9391a0938c5d212efec679859029b
Analyze and fix the following issue in the Linux kernel code: usb: dwc3-am62: Fix PHY core voltage selection
Problem Details: TRM information is outdated and design team has confirmed that PHY_CORE_VOLTAGE should be 0 irrespective of VDD_CORE voltage. Signed-off-by: Roger Quadros <rogerq@kernel.org> Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com> Link: https://lore.kernel.org/r/20240227-for-v6-9-am62-usb-errata-3-0-v4-3-0...
```diff diff --git a/drivers/usb/dwc3/dwc3-am62.c b/drivers/usb/dwc3/dwc3-am62.c index ea6e29091c0c..09b1f5a1c4fb 100644 --- a/drivers/usb/dwc3/dwc3-am62.c +++ b/drivers/usb/dwc3/dwc3-am62.c @@ -97,7 +97,8 @@ #define USBSS_VBUS_STAT_SESSVALID BIT(2) #define USBSS_VBUS_STAT_VBUSVALID BIT(0) -/* Mask for PHY PLL REFC...
4ead695e6b3cac06543d7bc7241ab75aee4ea6a6
Analyze and fix the following issue in the Linux kernel code: usb: dwc3-am62: Disable wakeup at remove
Problem Details: Disable wakeup at remove. Fixes the below warnings on module unload and reload. > dwc3-am62 f900000.dwc3-usb: couldn't enable device as a wakeup source: -17 > dwc3-am62 f910000.dwc3-usb: couldn't enable device as a wakeup source: -17 Fixes: 4e3972b589da ("usb: dwc3-am62: Enable as a wakeup source by ...
```diff diff --git a/drivers/usb/dwc3/dwc3-am62.c b/drivers/usb/dwc3/dwc3-am62.c index f85603b7f7c5..ea6e29091c0c 100644 --- a/drivers/usb/dwc3/dwc3-am62.c +++ b/drivers/usb/dwc3/dwc3-am62.c @@ -274,6 +274,7 @@ static void dwc3_ti_remove(struct platform_device *pdev) u32 reg; pm_runtime_get_sync(dev); + device_in...
6661befe41009c210efa2c1bcd16a5cc4cff8a06
Analyze and fix the following issue in the Linux kernel code: usb: dwc3-am62: fix module unload/reload behavior
Problem Details: As runtime PM is enabled, the module can be runtime suspended when .remove() is called. Do a pm_runtime_get_sync() to make sure module is active before doing any register operations. Doing a pm_runtime_put_sync() should disable the refclk so no need to disable it again. Fixes the below warning at mo...
```diff diff --git a/drivers/usb/dwc3/dwc3-am62.c b/drivers/usb/dwc3/dwc3-am62.c index 90a587bc29b7..f85603b7f7c5 100644 --- a/drivers/usb/dwc3/dwc3-am62.c +++ b/drivers/usb/dwc3/dwc3-am62.c @@ -267,21 +267,14 @@ err_pm_disable: return ret; } -static int dwc3_ti_remove_core(struct device *dev, void *c) -{ - struct...
69c63350e573367f9c8594162288cffa8a26d0d1
Analyze and fix the following issue in the Linux kernel code: usb: port: Don't try to peer unused USB ports based on location
Problem Details: Unused USB ports may have bogus location data in ACPI PLD tables. This causes port peering failures as these unused USB2 and USB3 ports location may match. Due to these failures the driver prints a "usb: port power management may be unreliable" warning, and unnecessarily blocks port power off during r...
```diff diff --git a/drivers/usb/core/port.c b/drivers/usb/core/port.c index c628c1abc907..4d63496f98b6 100644 --- a/drivers/usb/core/port.c +++ b/drivers/usb/core/port.c @@ -573,7 +573,7 @@ static int match_location(struct usb_device *peer_hdev, void *p) struct usb_hub *peer_hub = usb_hub_to_struct_hub(peer_hdev); ...
f90ce1e04cbcc76639d6cba0fdbd820cd80b3c70
Analyze and fix the following issue in the Linux kernel code: usb: gadget: ncm: Fix handling of zero block length packets
Problem Details: While connecting to a Linux host with CDC_NCM_NTB_DEF_SIZE_TX set to 65536, it has been observed that we receive short packets, which come at interval of 5-10 seconds sometimes and have block length zero but still contain 1-2 valid datagrams present. According to the NCM spec: "If wBlockLength = 0x00...
```diff diff --git a/drivers/usb/gadget/function/f_ncm.c b/drivers/usb/gadget/function/f_ncm.c index e2a059cfda2c..28f4e6552e84 100644 --- a/drivers/usb/gadget/function/f_ncm.c +++ b/drivers/usb/gadget/function/f_ncm.c @@ -1346,7 +1346,7 @@ parse_ntb: if (to_process == 1 && (*(unsigned char *)(ntb_ptr + block_l...
165376f6b23e9a779850e750fb2eb06622e5a531
Analyze and fix the following issue in the Linux kernel code: usb: typec: altmodes/displayport: create sysfs nodes as driver's default device attribute group
Problem Details: The DisplayPort driver's sysfs nodes may be present to the userspace before typec_altmode_set_drvdata() completes in dp_altmode_probe. This means that a sysfs read can trigger a NULL pointer error by deferencing dp->hpd in hpd_show or dp->lock in pin_assignment_show, as dev_get_drvdata() returns NULL i...
```diff diff --git a/drivers/usb/typec/altmodes/displayport.c b/drivers/usb/typec/altmodes/displayport.c index f81bec0c7b86..f8ea3054be54 100644 --- a/drivers/usb/typec/altmodes/displayport.c +++ b/drivers/usb/typec/altmodes/displayport.c @@ -559,16 +559,21 @@ static ssize_t hpd_show(struct device *dev, struct device_a...
4d0a5a9915793377c0fe1a8d78de6bcd92cea963
Analyze and fix the following issue in the Linux kernel code: usb: typec: ucsi: Clean up UCSI_CABLE_PROP macros
Problem Details: Clean up UCSI_CABLE_PROP macros by fixing a bitmask shifting error for plug type and updating the modal support macro for consistent naming. Fixes: 3cf657f07918 ("usb: typec: ucsi: Remove all bit-fields") Cc: stable@vger.kernel.org Reviewed-by: Benson Leung <bleung@chromium.org> Reviewed-by: Prashant ...
```diff diff --git a/drivers/usb/typec/ucsi/ucsi.h b/drivers/usb/typec/ucsi/ucsi.h index 7e35ffbe0a6f..469a2baf472e 100644 --- a/drivers/usb/typec/ucsi/ucsi.h +++ b/drivers/usb/typec/ucsi/ucsi.h @@ -259,12 +259,12 @@ struct ucsi_cable_property { #define UCSI_CABLE_PROP_FLAG_VBUS_IN_CABLE BIT(0) #define UCSI_CABLE_PRO...
197331b27ac890d0209232d5f669830cd00e8918
Analyze and fix the following issue in the Linux kernel code: usb: typec: tpcm: Fix PORT_RESET behavior for self powered devices
Problem Details: While commit 69f89168b310 ("usb: typec: tpcm: Fix issues with power being removed during reset") fixes the boot issues for bus powered devices such as LibreTech Renegade Elite/Firefly, it trades off the CC pins NOT being Hi-Zed during errory recovery (i.e PORT_RESET) for devices which are NOT bus power...
```diff diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c index 66e532edcece..096597231027 100644 --- a/drivers/usb/typec/tcpm/tcpm.c +++ b/drivers/usb/typec/tcpm/tcpm.c @@ -4873,8 +4873,11 @@ static void run_state_machine(struct tcpm_port *port) break; case PORT_RESET: tcpm_reset_port(...
4a30dcac38c2b34f5b4f358630774bc2c2c104b0
Analyze and fix the following issue in the Linux kernel code: usb: typec: ucsi: fix UCSI on SM8550 & SM8650 Qualcomm devices
Problem Details: On SM8550 and SM8650 Qualcomm platforms a call to UCSI_GET_PDOS for non-PD partners will cause a firmware crash with no easy way to recover from it. Add UCSI_NO_PARTNER_PDOS quirk for those platform until we find a way to properly handle the crash. Signed-off-by: Neil Armstrong <neil.armstrong@linaro...
```diff diff --git a/drivers/usb/typec/ucsi/ucsi_glink.c b/drivers/usb/typec/ucsi/ucsi_glink.c index 53a7ede8556d..faccc942b381 100644 --- a/drivers/usb/typec/ucsi/ucsi_glink.c +++ b/drivers/usb/typec/ucsi/ucsi_glink.c @@ -301,6 +301,7 @@ static const struct of_device_id pmic_glink_ucsi_of_quirks[] = { { .compatible ...
5424a44276ee60d39335ba037c7e142fad4a259a
Analyze and fix the following issue in the Linux kernel code: usb: typec: altmodes/displayport: send configure message on sop'
Problem Details: When the port is setting the pin configuration when no configuration is chosen, the DisplayPort driver will not send Configure to the cable plug if it's available. Add transition to DP_STATE_CONFIGURE_PRIME. Fixes: 71ba4fe56656 ("usb: typec: altmodes/displayport: add SOP' support") Signed-off-by: RD B...
```diff diff --git a/drivers/usb/typec/altmodes/displayport.c b/drivers/usb/typec/altmodes/displayport.c index 5a80776c7255..867f9796f8a8 100644 --- a/drivers/usb/typec/altmodes/displayport.c +++ b/drivers/usb/typec/altmodes/displayport.c @@ -164,7 +164,8 @@ static int dp_altmode_status_update(struct dp_altmode *dp) ...
0e28790195fa65fde41fa127a89e0903388f6285
Analyze and fix the following issue in the Linux kernel code: usb: typec: tcpm: fix SOP' sequences in tcpm_pd_svdm
Problem Details: The Smatch checker flags svdm_version being uninitialized for Discover Identity Messages within tcpm_pd_svdm for the CMDT_INIT case. Cable plugs cannot initialize SVDM commands, however a port partner that isn't allowed to communicate over SOP' could, which would result in the CMDT_INIT block running f...
```diff diff --git a/drivers/usb/typec/tcpm/tcpm.c b/drivers/usb/typec/tcpm/tcpm.c index c9a78f55ca48..b6d7131228f9 100644 --- a/drivers/usb/typec/tcpm/tcpm.c +++ b/drivers/usb/typec/tcpm/tcpm.c @@ -1878,11 +1878,6 @@ static int tcpm_pd_svdm(struct tcpm_port *port, struct typec_altmode *adev, tcpm_log(port, "Rx VDM c...
b1fe686a765e6c0d71811d825b5a1585a202b777
Analyze and fix the following issue in the Linux kernel code: fuse: don't unhash root
Problem Details: The root inode is assumed to be always hashed. Do not unhash the root inode even if it is marked BAD. Fixes: 5d069dbe8aaf ("fuse: fix bad inode") Cc: <stable@vger.kernel.org> # v5.11 Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
```diff diff --git a/fs/fuse/fuse_i.h b/fs/fuse/fuse_i.h index 7bd3552b1e80..4ef6087f0e5c 100644 --- a/fs/fuse/fuse_i.h +++ b/fs/fuse/fuse_i.h @@ -994,7 +994,6 @@ static inline bool fuse_stale_inode(const struct inode *inode, int generation, static inline void fuse_make_bad(struct inode *inode) { - remove_inode_has...
68ca1b49e430f6534d0774a94147a823e3b8b26e
Analyze and fix the following issue in the Linux kernel code: fuse: fix root lookup with nonzero generation
Problem Details: The root inode has a fixed nodeid and generation (1, 0). Prior to the commit 15db16837a35 ("fuse: fix illegal access to inode with reused nodeid") generation number on lookup was ignored. After this commit lookup with the wrong generation number resulted in the inode being unhashed. This is correct ...
```diff diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index ce6a38c56d54..befb7dfe387a 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c @@ -391,6 +391,10 @@ int fuse_lookup_name(struct super_block *sb, u64 nodeid, const struct qstr *name err = -EIO; if (fuse_invalid_attr(&outarg->attr)) goto out_put_forget; + if (out...
82e081aebe4d9c26e196c8260005cc4762b57a5d
Analyze and fix the following issue in the Linux kernel code: fuse: replace remaining make_bad_inode() with fuse_make_bad()
Problem Details: fuse_do_statx() was added with the wrong helper. Fixes: d3045530bdd2 ("fuse: implement statx") Cc: <stable@vger.kernel.org> # v6.6 Signed-off-by: Miklos Szeredi <mszeredi@redhat.com>
```diff diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c index 25c7c97f774b..ce6a38c56d54 100644 --- a/fs/fuse/dir.c +++ b/fs/fuse/dir.c @@ -1214,7 +1214,7 @@ static int fuse_do_statx(struct inode *inode, struct file *file, if (((sx->mask & STATX_SIZE) && !fuse_valid_size(sx->size)) || ((sx->mask & STATX_TYPE) && (!f...
a51ab63b297ce9e26e3ffb9be896018a42d5f32f
Analyze and fix the following issue in the Linux kernel code: ACPI: CPPC: enable AMD CPPC V2 support for family 17h processors
Problem Details: As there are some AMD processors which only support CPPC V2 firmware and BIOS implementation, the amd_pstate driver will be failed to load when system booting with below kernel warning message: [ 0.477523] amd_pstate: the _CPC object is not present in SBIOS or ACPI disabled To make the amd_pstate ...
```diff diff --git a/arch/x86/kernel/acpi/cppc.c b/arch/x86/kernel/acpi/cppc.c index 8d8752b44f11..ff8f25faca3d 100644 --- a/arch/x86/kernel/acpi/cppc.c +++ b/arch/x86/kernel/acpi/cppc.c @@ -20,7 +20,7 @@ bool cpc_supported_by_cpu(void) (boot_cpu_data.x86_model >= 0x20 && boot_cpu_data.x86_model <= 0x2f))) r...
ae5004a40a262d329039b99b62bd3fe7645b66ad
Analyze and fix the following issue in the Linux kernel code: mmc: wmt-sdmmc: remove an incorrect release_mem_region() call in the .remove function
Problem Details: This looks strange to call release_mem_region() in a remove function without any request_mem_region() in the probe or "struct resource" somewhere. So remove the corresponding code. Fixes: 3a96dff0f828 ("mmc: SD/MMC Host Controller for Wondermedia WM8505/WM8650") Signed-off-by: Christophe JAILLET <chr...
```diff diff --git a/drivers/mmc/host/wmt-sdmmc.c b/drivers/mmc/host/wmt-sdmmc.c index 77d5f1d24489..860380931b6c 100644 --- a/drivers/mmc/host/wmt-sdmmc.c +++ b/drivers/mmc/host/wmt-sdmmc.c @@ -883,7 +883,6 @@ static void wmt_mci_remove(struct platform_device *pdev) { struct mmc_host *mmc; struct wmt_mci_priv *pr...
e8d1b41e69d72c62865bebe8f441163ec00b3d44
Analyze and fix the following issue in the Linux kernel code: mmc: tmio: avoid concurrent runs of mmc_request_done()
Problem Details: With the to-be-fixed commit, the reset_work handler cleared 'host->mrq' outside of the spinlock protected critical section. That leaves a small race window during execution of 'tmio_mmc_reset()' where the done_work handler could grab a pointer to the now invalid 'host->mrq'. Both would use it to call m...
```diff diff --git a/drivers/mmc/host/tmio_mmc_core.c b/drivers/mmc/host/tmio_mmc_core.c index be7f18fd4836..c253d176db69 100644 --- a/drivers/mmc/host/tmio_mmc_core.c +++ b/drivers/mmc/host/tmio_mmc_core.c @@ -259,6 +259,8 @@ static void tmio_mmc_reset_work(struct work_struct *work) else mrq->cmd->error = -ETIMED...
e7a7681c859643f3f2476b2a28a494877fd89442
Analyze and fix the following issue in the Linux kernel code: PM: sleep: wakeirq: fix wake irq warning in system suspend
Problem Details: When driver uses pm_runtime_force_suspend() as the system suspend callback function and registers the wake irq with reverse enable ordering, the wake irq will be re-enabled when entering system suspend, triggering an 'Unbalanced enable for IRQ xxx' warning. In this scenario, the call sequence during sy...
```diff diff --git a/drivers/base/power/wakeirq.c b/drivers/base/power/wakeirq.c index 42171f766dcb..5a5a9e978e85 100644 --- a/drivers/base/power/wakeirq.c +++ b/drivers/base/power/wakeirq.c @@ -313,8 +313,10 @@ void dev_pm_enable_wake_irq_complete(struct device *dev) return; if (wirq->status & WAKE_IRQ_DEDICATE...
3a87131e3d72281285d4df7db2d7d3299b1edb18
Analyze and fix the following issue in the Linux kernel code: net: dsa: mt7530: put initialising PCS devices code back to original order
Problem Details: The commit fae463084032 ("net: dsa: mt753x: fix pcs conversion regression") fixes regression caused by cpu_port_config manually calling phylink operations. cpu_port_config was deemed useless and was removed. Therefore, put initialising PCS devices code back to its original order. Signed-off-by: Arınç ...
```diff diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c index e353c03dd1db..5c8ad41ce8cd 100644 --- a/drivers/net/dsa/mt7530.c +++ b/drivers/net/dsa/mt7530.c @@ -2812,17 +2812,9 @@ static int mt753x_setup(struct dsa_switch *ds) { struct mt7530_priv *priv = ds->priv; - int i, ret; - - /* Initialise ...
b2ec429b69280001d85029dc50b5427af41eb641
Analyze and fix the following issue in the Linux kernel code: drm/tidss: Use dev_err_probe() over dev_dbg() when failing to probe the port
Problem Details: This gets logged out to /sys/kernel/debug/devices_deferred in the -EPROBE_DEFER case and as an error otherwise. The message here provides useful information to the user when troubleshooting why their display is not working in either case, so let's make it output appropriately. Signed-off-by: Andrew Ha...
```diff diff --git a/drivers/gpu/drm/tidss/tidss_kms.c b/drivers/gpu/drm/tidss/tidss_kms.c index a0e494c806a9..f371518f8697 100644 --- a/drivers/gpu/drm/tidss/tidss_kms.c +++ b/drivers/gpu/drm/tidss/tidss_kms.c @@ -135,8 +135,7 @@ static int tidss_dispc_modeset_init(struct tidss_device *tidss) dev_dbg(dev, "no pane...
78334c343bef528b911da83a6b041d15a1a72efb
Analyze and fix the following issue in the Linux kernel code: mfd: cs42l43: Fix wrong GPIO_FN_SEL and SPI_CLK_CONFIG1 defaults
Problem Details: Two regs have wrong values in existing fields, change them to match the datasheet. Fixes: ace6d1448138 ("mfd: cs42l43: Add support for cs42l43 core driver") Signed-off-by: Maciej Strozek <mstrozek@opensource.cirrus.com> Reviewed-by: Charles Keepax <ckeepax@opensource.cirrus.com> Link: https://lore.ke...
```diff diff --git a/drivers/mfd/cs42l43.c b/drivers/mfd/cs42l43.c index b458fa19b0f5..a0fb2dc6c3b2 100644 --- a/drivers/mfd/cs42l43.c +++ b/drivers/mfd/cs42l43.c @@ -90,7 +90,7 @@ const struct reg_default cs42l43_reg_default[CS42L43_N_DEFAULTS] = { { CS42L43_DRV_CTRL_5, 0x136C00C0 }, { CS42L43_GPIO_CTRL1, 0x...
0e71862a20d58b6e8d4c39de1d72c8919c4dccd1
Analyze and fix the following issue in the Linux kernel code: net: txgbe: fix to clear interrupt status after handling IRQ
Problem Details: GPIO EOI is not set to clear interrupt status after handling the interrupt. It should be done in irq_chip->irq_ack, but this function is not called in handle_nested_irq(). So executing function txgbe_gpio_irq_ack() manually in txgbe_gpio_irq_handler(). Fixes: aefd013624a1 ("net: txgbe: use irq_domain ...
```diff diff --git a/drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c b/drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c index c112f79b026e..93295916b1d2 100644 --- a/drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c +++ b/drivers/net/ethernet/wangxun/txgbe/txgbe_phy.c @@ -475,8 +475,10 @@ irqreturn_t txgbe_gpio_irq_handler(i...
b4a2496c17ed645f8d51061047c9c249b58c74ba
Analyze and fix the following issue in the Linux kernel code: net: txgbe: fix GPIO interrupt blocking
Problem Details: The register of GPIO interrupt status is masked before MAC IRQ is enabled. This is because of hardware deficiency. So manually clear the interrupt status before using them. Otherwise, GPIO interrupts will never be reported again. There is a workaround for clearing interrupts to set GPIO EOI in txgbe_up...
```diff diff --git a/drivers/net/ethernet/wangxun/txgbe/txgbe_main.c b/drivers/net/ethernet/wangxun/txgbe/txgbe_main.c index e67a21294158..bd4624d14ca0 100644 --- a/drivers/net/ethernet/wangxun/txgbe/txgbe_main.c +++ b/drivers/net/ethernet/wangxun/txgbe/txgbe_main.c @@ -81,6 +81,7 @@ static void txgbe_up_complete(struc...
d4872d70fc6feabfc8e897edad993a81096ade9f
Analyze and fix the following issue in the Linux kernel code: xfrm: fix xfrm child route lookup for packet offload
Problem Details: In current code, xfrm_bundle_create() always uses the matched SA's family type to look up a xfrm child route for the skb. The route returned by xfrm_dst_lookup() will eventually be used in xfrm_output_resume() (skb_dst(skb)->ops->local_out()). If packet offload is used, the above behavior can lead to ...
```diff diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index 7351f32052dc..da6ecc6b3e15 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c @@ -2694,7 +2694,9 @@ static struct dst_entry *xfrm_bundle_create(struct xfrm_policy *policy, if (xfrm[i]->props.smark.v || xfrm[i]->props.smark.m) ...
961ebd120565cb60cebe21cb634fbc456022db4a
Analyze and fix the following issue in the Linux kernel code: fs/aio: Check IOCB_AIO_RW before the struct aio_kiocb conversion
Problem Details: The first kiocb_set_cancel_fn() argument may point at a struct kiocb that is not embedded inside struct aio_kiocb. With the current code, depending on the compiler, the req->ki_ctx read happens either before the IOCB_AIO_RW test or after that test. Move the req->ki_ctx read such that it is guaranteed t...
```diff diff --git a/fs/aio.c b/fs/aio.c index da18dbcfcb22..9cdaa2faa536 100644 --- a/fs/aio.c +++ b/fs/aio.c @@ -589,8 +589,8 @@ static int aio_setup_ring(struct kioctx *ctx, unsigned int nr_events) void kiocb_set_cancel_fn(struct kiocb *iocb, kiocb_cancel_fn *cancel) { - struct aio_kiocb *req = container_of(iocb...
0b385be4c3ccd5636441923d7cad5eda6b4651cb
Analyze and fix the following issue in the Linux kernel code: drm/i915: Don't explode when the dig port we don't have an AUX CH
Problem Details: The icl+ power well code currently assumes that every AUX power well maps to an encoder which is using said power well. That is by no menas guaranteed as we: - only register encoders for ports declared in the VBT - combo PHY HDMI-only encoder no longer get an AUX CH since commit 9856308c94ca ("drm/i9...
```diff diff --git a/drivers/gpu/drm/i915/display/intel_display_power_well.c b/drivers/gpu/drm/i915/display/intel_display_power_well.c index 47cd6bb04366..06900ff307b2 100644 --- a/drivers/gpu/drm/i915/display/intel_display_power_well.c +++ b/drivers/gpu/drm/i915/display/intel_display_power_well.c @@ -246,7 +246,14 @@ ...
0314cebb29be2f961abb37bd0b01cb16899868f2
Analyze and fix the following issue in the Linux kernel code: platform/x86/amd/pmf: Fix missing error code in amd_pmf_init_smart_pc()
Problem Details: On the error path, assign -ENOMEM to ret when memory allocation of "dev->prev_data" fails. Fixes: e70961505808 ("platform/x86/amd/pmf: Fixup error handling for amd_pmf_init_smart_pc()") Signed-off-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com> Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linu...
```diff diff --git a/drivers/platform/x86/amd/pmf/tee-if.c b/drivers/platform/x86/amd/pmf/tee-if.c index 8527dca9cf56..dcbe8f85e122 100644 --- a/drivers/platform/x86/amd/pmf/tee-if.c +++ b/drivers/platform/x86/amd/pmf/tee-if.c @@ -458,8 +458,10 @@ int amd_pmf_init_smart_pc(struct amd_pmf_dev *dev) amd_pmf_hex_dump_pb...
aec7d25b497ce4a8d044e9496de0aa433f7f8f06
Analyze and fix the following issue in the Linux kernel code: platform/x86: p2sb: On Goldmont only cache P2SB and SPI devfn BAR
Problem Details: On Goldmont p2sb_bar() only ever gets called for 2 devices, the actual P2SB devfn 13,0 and the SPI controller which is part of the P2SB, devfn 13,2. But the current p2sb code tries to cache BAR0 info for all of devfn 13,0 to 13,7 . This involves calling pci_scan_single_device() for device 13 functions...
```diff diff --git a/drivers/platform/x86/p2sb.c b/drivers/platform/x86/p2sb.c index 6bd14d0132db..3d66e1d4eb1f 100644 --- a/drivers/platform/x86/p2sb.c +++ b/drivers/platform/x86/p2sb.c @@ -20,9 +20,11 @@ #define P2SBC_HIDE BIT(8) #define P2SB_DEVFN_DEFAULT PCI_DEVFN(31, 1) +#define P2SB_DEVFN_GOLDMONT PCI_DEVFN(...
a17bd44c0146b00fcaa692915789c16bd1fb2a81
Analyze and fix the following issue in the Linux kernel code: ALSA: hda/realtek: fix mute/micmute LEDs for HP EliteBook
Problem Details: The HP EliteBook using ALC236 codec which using 0x02 to control mute LED and 0x01 to control micmute LED. Therefore, add a quirk to make it works. Signed-off-by: Andy Chi <andy.chi@canonical.com> Cc: <stable@vger.kernel.org> Link: https://lore.kernel.org/r/20240304134033.773348-1-andy.chi@canonical.co...
```diff diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index b455e6f704c5..a1facdb98d9a 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c @@ -9996,6 +9996,10 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = { SND_PCI_QUIRK(0x103c, 0x8c70, "HP EliteBook...
28468cbed92ea5eed19e2cbd2d55758c3c7938ca
Analyze and fix the following issue in the Linux kernel code: Revert "fs/aio: Make io_cancel() generate completions again"
Problem Details: Patch "fs/aio: Make io_cancel() generate completions again" is based on the assumption that calling kiocb->ki_cancel() does not complete R/W requests. This is incorrect: the two drivers that call kiocb_set_cancel_fn() callers set a cancellation function that calls usb_ep_dequeue(). According to its doc...
```diff diff --git a/fs/aio.c b/fs/aio.c index 28223f511931..da18dbcfcb22 100644 --- a/fs/aio.c +++ b/fs/aio.c @@ -2165,11 +2165,14 @@ COMPAT_SYSCALL_DEFINE3(io_submit, compat_aio_context_t, ctx_id, #endif /* sys_io_cancel: - * Attempts to cancel an iocb previously passed to io_submit(). If the - * operation is suc...
30654f0eec65c428863f2312cfe0b7f26ae0fab4
Analyze and fix the following issue in the Linux kernel code: igc: fix LEDS_CLASS dependency
Problem Details: When IGC is built-in but LEDS_CLASS is a loadable module, there is a link failure: x86_64-linux-ld: drivers/net/ethernet/intel/igc/igc_leds.o: in function `igc_led_setup': igc_leds.c:(.text+0x75c): undefined reference to `devm_led_classdev_register_ext' Add another dependency that prevents this combi...
```diff diff --git a/drivers/net/ethernet/intel/Kconfig b/drivers/net/ethernet/intel/Kconfig index 767358b60507..639fbb12bd35 100644 --- a/drivers/net/ethernet/intel/Kconfig +++ b/drivers/net/ethernet/intel/Kconfig @@ -372,6 +372,7 @@ config IGC config IGC_LEDS def_bool LEDS_TRIGGER_NETDEV depends on IGC && LEDS_C...
aa9870f5c7ef44c904d35618b6717b9ef7810760
Analyze and fix the following issue in the Linux kernel code: intel: make module parameters readable in sys filesystem
Problem Details: Linux users sometimes need an easy way to check current values of module parameters. For example the module may be manually reloaded with different parameters. Make these visible and readable in the /sys filesystem to allow that. But don't make the "debug" module parameter visible as debugging is enabl...
```diff diff --git a/drivers/net/ethernet/intel/e100.c b/drivers/net/ethernet/intel/e100.c index 01f0f12035ca..3fcb8daaa243 100644 --- a/drivers/net/ethernet/intel/e100.c +++ b/drivers/net/ethernet/intel/e100.c @@ -171,8 +171,8 @@ static int debug = 3; static int eeprom_bad_csum_allow = 0; static int use_io = 0; mod...
345a6e2631c1267221b684e110bba03e4c26ece0
Analyze and fix the following issue in the Linux kernel code: tcp: align tcp_sock_write_rx group
Problem Details: Stephen Rothwell and kernel test robot reported that some arches (parisc, hexagon) and/or compilers would not like blamed commit. Lets make sure tcp_sock_write_rx group does not start with a hole. While we are at it, correct tcp_sock_write_tx CACHELINE_ASSERT_GROUP_SIZE() since after the blamed commi...
```diff diff --git a/include/linux/tcp.h b/include/linux/tcp.h index 988a30ef6bfe..55399ee2a57e 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h @@ -304,7 +304,7 @@ struct tcp_sock { __cacheline_group_end(tcp_sock_write_txrx); /* RX read-write hotpath cache lines */ - __cacheline_group_begin(tcp_sock_wr...
89d72d4125e94aa3c2140fedd97ce07ba9e37674
Analyze and fix the following issue in the Linux kernel code: net: sparx5: Fix use after free inside sparx5_del_mact_entry
Problem Details: Based on the static analyzis of the code it looks like when an entry from the MAC table was removed, the entry was still used after being freed. More precise the vid of the mac_entry was used after calling devm_kfree on the mac_entry. The fix consists in first using the vid of the mac_entry to delete t...
```diff diff --git a/drivers/net/ethernet/microchip/sparx5/sparx5_mactable.c b/drivers/net/ethernet/microchip/sparx5/sparx5_mactable.c index 4af285918ea2..75868b3f548e 100644 --- a/drivers/net/ethernet/microchip/sparx5/sparx5_mactable.c +++ b/drivers/net/ethernet/microchip/sparx5/sparx5_mactable.c @@ -347,10 +347,10 @@...
8f8cd6c0a43ed637e620bbe45a8d0e0c2f4d5130
Analyze and fix the following issue in the Linux kernel code: modules: wait do_free_init correctly
Problem Details: The synchronization here is to ensure the ordering of freeing of a module init so that it happens before W+X checking. It is worth noting it is not that the freeing was not happening, it is just that our sanity checkers raced against the permission checkers which assume init memory is already gone. C...
```diff diff --git a/include/linux/moduleloader.h b/include/linux/moduleloader.h index 001b2ce83832..89b1e0ed9811 100644 --- a/include/linux/moduleloader.h +++ b/include/linux/moduleloader.h @@ -115,6 +115,14 @@ int module_finalize(const Elf_Ehdr *hdr, const Elf_Shdr *sechdrs, struct module *mod); +#ifd...
5dad604809c5acc546ec74057498db1623f1c408
Analyze and fix the following issue in the Linux kernel code: mm/khugepaged: keep mm in mm_slot without MMF_DISABLE_THP check
Problem Details: Previously, we removed the mm from mm_slot and dropped mm_count if the MMF_THP_DISABLE flag was set. However, we didn't re-add the mm back after clearing the MMF_THP_DISABLE flag. Additionally, We add a check for the MMF_THP_DISABLE flag in hugepage_vma_revalidate(). Link: https://lkml.kernel.org/r/20...
```diff diff --git a/mm/khugepaged.c b/mm/khugepaged.c index 2771fc043b3b..1c0073daad82 100644 --- a/mm/khugepaged.c +++ b/mm/khugepaged.c @@ -920,7 +920,7 @@ static int hugepage_vma_revalidate(struct mm_struct *mm, unsigned long address, { struct vm_area_struct *vma; - if (unlikely(hpage_collapse_test_exit(mm))) ...
4c4a52544ae03d84ffd3b5e9593833ffe05485a1
Analyze and fix the following issue in the Linux kernel code: lib/test_vmalloc.c: use unsigned long constant
Problem Details: Use an unsigned long constant instead of an int constant and a cast. This fixes the checkpatch warning WARNING: Unnecessary typecast of c90 int constant - '(unsigned long) 1' could be '1UL' + align = ((unsigned long) 1) << i; Link: https://lkml.kernel.org/r/20240226191159.39509-4-martin@kaiser.c...
```diff diff --git a/lib/test_vmalloc.c b/lib/test_vmalloc.c index d0c0cbe1913d..4ddf769861ff 100644 --- a/lib/test_vmalloc.c +++ b/lib/test_vmalloc.c @@ -117,7 +117,7 @@ static int align_shift_alloc_test(void) int i; for (i = 0; i < BITS_PER_LONG; i++) { - align = ((unsigned long) 1) << i; + align = 1UL << i; ...
44503b97ad9784943afb39d62fce3936580bec6f
Analyze and fix the following issue in the Linux kernel code: lib/test_vmalloc.c: fix typo in function name
Problem Details: Fix a typo and change the function name to init_test_configuration. Both caller and definition have the same typo, so the current code already works. Link: https://lkml.kernel.org/r/20240226191159.39509-2-martin@kaiser.cx Signed-off-by: Martin Kaiser <martin@kaiser.cx> Reviewed-by: Uladzislau Rezki (...
```diff diff --git a/lib/test_vmalloc.c b/lib/test_vmalloc.c index 3718d9886407..191b6bd5dff9 100644 --- a/lib/test_vmalloc.c +++ b/lib/test_vmalloc.c @@ -501,7 +501,7 @@ static int test_func(void *private) } static int -init_test_configurtion(void) +init_test_configuration(void) { /* * A maximum number of wo...
fc4d182316bd5309b4066fd9ef21529ea397a7d4
Analyze and fix the following issue in the Linux kernel code: mm: huge_memory: enable debugfs to split huge pages to any order
Problem Details: It is used to test split_huge_page_to_list_to_order for pagecache THPs. Also add test cases for split_huge_page_to_list_to_order via both debugfs. [ziy@nvidia.com: fix issue discovered with NFS] Link: https://lkml.kernel.org/r/262E4DAA-4A78-4328-B745-1355AE356A07@nvidia.com Link: https://lkml.kerne...
```diff diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 006b192ea6ab..fd745bcc97ff 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -3419,7 +3419,7 @@ static inline bool vma_not_suitable_for_thp_split(struct vm_area_struct *vma) } static int split_huge_pages_pid(int pid, unsigned long vaddr_start, - ...
ff0b5905a9c9712f36fb7f9dd1be17564483b5d4
Analyze and fix the following issue in the Linux kernel code: Docs/mm/damon/design: remove the details for pageout as paddr doesn't use MADV_PAGEOUT
Problem Details: The doc needs a fix. As only in the case of virtual address, we are calling madvise() with MADV_PAGEOUT. But in the case of physical address, we are calling reclaim_pages() directly. MADV_PAGEOUT on virtual address is much more aggresive to reclaim memory compared to reclaim_pages() on paddr region....
```diff diff --git a/Documentation/mm/damon/design.rst b/Documentation/mm/damon/design.rst index 8c89d26f0baa..5620aab9b385 100644 --- a/Documentation/mm/damon/design.rst +++ b/Documentation/mm/damon/design.rst @@ -315,7 +315,7 @@ that supports each action are as below. Supported by ``vaddr`` and ``fvaddr`` operati...
8cc92a67932febc3f84cf6b3c7d08f27a1b2ebc3
Analyze and fix the following issue in the Linux kernel code: kasan: fix a2 allocation and remove explicit cast in atomic tests
Problem Details: Address the additional feedback since 4e76c8cc3378 kasan: add atomic tests (""kasan: add atomic tests") by removing an explicit cast and fixing the size as well as the check of the allocation of `a2`. Link: https://lkml.kernel.org/r/20240224105414.211995-1-paul.heidekrueger@tum.de Link: https://lore.k...
```diff diff --git a/mm/kasan/kasan_test.c b/mm/kasan/kasan_test.c index 2d8ae4fbe63b..7b32be2a3cf0 100644 --- a/mm/kasan/kasan_test.c +++ b/mm/kasan/kasan_test.c @@ -700,7 +700,7 @@ static void kmalloc_uaf3(struct kunit *test) static void kasan_atomics_helper(struct kunit *test, void *unsafe, void *safe) { - int *...
dc24559472a682eb124e869cb110e7a2fd857322
Analyze and fix the following issue in the Linux kernel code: lib/stackdepot: off by one in depot_fetch_stack()
Problem Details: The stack_pools[] array has DEPOT_MAX_POOLS. The "pools_num" tracks the number of pools which are initialized. See depot_init_pool() for more details. If pool_index == pools_num_cached, this will read one element beyond what we want. If not all the pools are initialized, then the pool will be NULL,...
```diff diff --git a/lib/stackdepot.c b/lib/stackdepot.c index 8c795bb20afb..af6cc19a2003 100644 --- a/lib/stackdepot.c +++ b/lib/stackdepot.c @@ -447,7 +447,7 @@ static struct stack_record *depot_fetch_stack(depot_stack_handle_t handle) lockdep_assert_not_held(&pool_lock); - if (pool_index > pools_num_cached) { ...
fd2f556c4f3bcad46f1ddb461a0eb85c11033a13
Analyze and fix the following issue in the Linux kernel code: selftest: damon: fix minor typos in test logs
Problem Details: Patch series "selftests/damon: misc fixes". Misc fixes for DAMON selftets on behalf of the original authors. This patch (of 2): This patch resolves a spelling error in the test log, preventing potential confusion. It is submitted as part of my application to the "Linux Kernel Bug Fixing Spring Unp...
```diff diff --git a/tools/testing/selftests/damon/sysfs_update_schemes_tried_regions_hang.py b/tools/testing/selftests/damon/sysfs_update_schemes_tried_regions_hang.py index 8c690ba1a573..28c887a0108f 100644 --- a/tools/testing/selftests/damon/sysfs_update_schemes_tried_regions_hang.py +++ b/tools/testing/selftests/da...
cd87d9f58439a114f38cec276f3ec1600729c8bf
Analyze and fix the following issue in the Linux kernel code: x86/mm: further clarify switch_mm_irqs_off() documentation
Problem Details: Commit accf6b23d1e5a ("x86/mm: clarify "prev" usage in switch_mm_irqs_off()") attempted to clarify x86's usage of the arguments passed by generic code, specifically the "prev" argument the is unused by x86. However, it could have done a better job with the comment above switch_mm_irqs_off(). Rewrite ...
```diff diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c index bf9605caf24f..b67545baf697 100644 --- a/arch/x86/mm/tlb.c +++ b/arch/x86/mm/tlb.c @@ -493,10 +493,10 @@ static inline void cr4_update_pce_mm(struct mm_struct *mm) { } #endif /* - * The "prev" argument passed by the caller does not always match CR3. Fo...
f5eec03611d9352c8b19134ecd4742a6ebc45282
Analyze and fix the following issue in the Linux kernel code: mm/util.c: add byte count to __vm_enough_memory failure warning
Problem Details: Commit 44b414c8715c5dcf53288 ("mm/util.c: add warning if __vm_enough_memory fails") adds debug information which gives the process id and executable name should __vm_enough_memory() fail. Adding the number of pages to the failure message would benefit application developers and system administrators i...
```diff diff --git a/mm/util.c b/mm/util.c index 5a6a9802583b..6710efaf1802 100644 --- a/mm/util.c +++ b/mm/util.c @@ -942,6 +942,7 @@ EXPORT_SYMBOL_GPL(vm_memory_committed); int __vm_enough_memory(struct mm_struct *mm, long pages, int cap_sys_admin) { long allowed; + unsigned long bytes_failed; vm_acct_memory(...
3fb43636876d98ed995e331782e4b06a00d24aee
Analyze and fix the following issue in the Linux kernel code: sched/numa, mm: do not try to migrate memory to memoryless nodes
Problem Details: Memoryless nodes do not have any memory to migrate to, so, as an optimization, stop trying it. Link: https://lkml.kernel.org/r/20240219041920.1183-1-byungchul@sk.com Link: https://lkml.kernel.org/r/20240216111502.79759-1-byungchul@sk.com Fixes: c574bbe91703 ("NUMA balancing: optimize page placement fo...
```diff diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 533547e3c90a..d8d71ad7f9f8 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -1830,6 +1830,12 @@ bool should_numa_migrate_memory(struct task_struct *p, struct folio *folio, int dst_nid = cpu_to_node(dst_cpu); int last_cpupid, this_cpup...
94ace3fec8477f8a46d08fc57cd1dd5efbd0a32b
Analyze and fix the following issue in the Linux kernel code: mm/zswap: change zswap_pool kref to percpu_ref
Problem Details: All zswap entries will take a reference of zswap_pool when zswap_store(), and drop it when free. Change it to use the percpu_ref is better for scalability performance. Although percpu_ref use a bit more memory which should be ok for our use case, since we almost have only one zswap_pool to be using. ...
```diff diff --git a/mm/zswap.c b/mm/zswap.c index 0141c45a5a6f..da90933c6d20 100644 --- a/mm/zswap.c +++ b/mm/zswap.c @@ -173,7 +173,7 @@ struct crypto_acomp_ctx { struct zswap_pool { struct zpool *zpools[ZSWAP_NR_ZPOOLS]; struct crypto_acomp_ctx __percpu *acomp_ctx; - struct kref kref; + struct percpu_ref ref; ...
f1d088178568a1b6e8bacb3d48e1c51a3b522af8
Analyze and fix the following issue in the Linux kernel code: mailmap: fix Kishon's email
Problem Details: Kishon updated his email in commit e6aa4edd2f5b ("MAINTAINERS: Update Kishon's email address in PCI endpoint subsystem"). However, as he is no longer at TI, his TI email now bounces. Add the same email as he has in MAINTAINERS to a mailmap, so that get_maintainer.pl will not output an email that boun...
```diff diff --git a/.mailmap b/.mailmap index 08f28f2999f0..94597524472e 100644 --- a/.mailmap +++ b/.mailmap @@ -325,6 +325,7 @@ Kenneth W Chen <kenneth.w.chen@intel.com> Kenneth Westfield <quic_kwestfie@quicinc.com> <kwestfie@codeaurora.org> Kiran Gunda <quic_kgunda@quicinc.com> <kgunda@codeaurora.org> Kirill Tkh...
fc0c8f9089c20d198d8fe51ddc28bfa1af588dce
Analyze and fix the following issue in the Linux kernel code: mm, mmap: fix vma_merge() case 7 with vma_ops->close
Problem Details: When debugging issues with a workload using SysV shmem, Michal Hocko has come up with a reproducer that shows how a series of mprotect() operations can result in an elevated shm_nattch and thus leak of the resource. The problem is caused by wrong assumptions in vma_merge() commit 714965ca8252 ("mm/mma...
```diff diff --git a/mm/mmap.c b/mm/mmap.c index d89770eaab6b..3281287771c9 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -954,13 +954,21 @@ static struct vm_area_struct } else if (merge_prev) { /* case 2 */ if (curr) { vma_start_write(curr); - err = dup_anon_vma(prev, curr, &anon_dup); if (end == curr->vm...
d7a08838ab74652f2b53fee9763f0178278c3a4b
Analyze and fix the following issue in the Linux kernel code: mm: userfaultfd: fix unexpected change to src_folio when UFFDIO_MOVE fails
Problem Details: After ptep_clear_flush(), if we find that src_folio is pinned we will fail UFFDIO_MOVE and put src_folio back to src_pte entry, but the change to src_folio->{mapping,index} is not restored in this process. This is not what we expected, so fix it. This can cause the rmap for that page to be invalid, po...
```diff diff --git a/mm/userfaultfd.c b/mm/userfaultfd.c index 7cf7d4384259..313f1c42768a 100644 --- a/mm/userfaultfd.c +++ b/mm/userfaultfd.c @@ -914,9 +914,6 @@ static int move_present_pte(struct mm_struct *mm, goto out; } - folio_move_anon_rmap(src_folio, dst_vma); - WRITE_ONCE(src_folio->index, linear_page_i...
803de9000f334b771afacb6ff3e78622916668b0
Analyze and fix the following issue in the Linux kernel code: mm, vmscan: prevent infinite loop for costly GFP_NOIO | __GFP_RETRY_MAYFAIL allocations
Problem Details: Sven reports an infinite loop in __alloc_pages_slowpath() for costly order __GFP_RETRY_MAYFAIL allocations that are also GFP_NOIO. Such combination can happen in a suspend/resume context where a GFP_KERNEL allocation can have __GFP_IO masked out via gfp_allowed_mask. Quoting Sven: 1. try to do a "co...
```diff diff --git a/include/linux/gfp.h b/include/linux/gfp.h index de292a007138..e2a916cf29c4 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h @@ -353,6 +353,15 @@ static inline bool gfp_has_io_fs(gfp_t gfp) return (gfp & (__GFP_IO | __GFP_FS)) == (__GFP_IO | __GFP_FS); } +/* + * Check if the gfp flags...
7a36d680658ba5a0d350f2ad275b97156b8d4333
Analyze and fix the following issue in the Linux kernel code: KVM: x86/xen: fix recursive deadlock in timer injection
Problem Details: The fast-path timer delivery introduced a recursive locking deadlock when userspace configures a timer which has already expired and is delivered immediately. The call to kvm_xen_inject_timer_irqs() can call to kvm_xen_set_evtchn() which may take kvm->arch.xen.xen_lock, which is already held in kvm_xen...
```diff diff --git a/arch/x86/kvm/xen.c b/arch/x86/kvm/xen.c index 54c4ced96b69..f65b35a05d91 100644 --- a/arch/x86/kvm/xen.c +++ b/arch/x86/kvm/xen.c @@ -1862,8 +1862,6 @@ static int kvm_xen_set_evtchn(struct kvm_xen_evtchn *xe, struct kvm *kvm) mm_borrowed = true; } - mutex_lock(&kvm->arch.xen.xen_lock); - /...
6addfcf27139da1356493f2a440af1252b5b7dbe
Analyze and fix the following issue in the Linux kernel code: KVM: pfncache: simplify locking and make more self-contained
Problem Details: The locking on the gfn_to_pfn_cache is... interesting. And awful. There is a rwlock in ->lock which readers take to ensure protection against concurrent changes. But __kvm_gpc_refresh() makes assumptions that certain fields will not change even while it drops the write lock and performs MM operations ...
```diff diff --git a/virt/kvm/pfncache.c b/virt/kvm/pfncache.c index 9ac8c9da4eda..4e07112a24c2 100644 --- a/virt/kvm/pfncache.c +++ b/virt/kvm/pfncache.c @@ -256,12 +256,7 @@ static int __kvm_gpc_refresh(struct gfn_to_pfn_cache *gpc, gpa_t gpa, unsigned l if (page_offset + len > PAGE_SIZE) return -EINVAL; - /* ...
66e3cf729b1ea017cad643415ade319556862b68
Analyze and fix the following issue in the Linux kernel code: KVM: x86/xen: remove WARN_ON_ONCE() with false positives in evtchn delivery
Problem Details: The kvm_xen_inject_vcpu_vector() function has a comment saying "the fast version will always work for physical unicast", justifying its use of kvm_irq_delivery_to_apic_fast() and the WARN_ON_ONCE() when that fails. In fact that assumption isn't true if X2APIC isn't in use by the guest and there is (8-...
```diff diff --git a/arch/x86/kvm/xen.c b/arch/x86/kvm/xen.c index 5c24c92588cf..54c4ced96b69 100644 --- a/arch/x86/kvm/xen.c +++ b/arch/x86/kvm/xen.c @@ -10,7 +10,7 @@ #include "x86.h" #include "xen.h" #include "hyperv.h" -#include "lapic.h" +#include "irq.h" #include <linux/eventfd.h> #include <linux/kvm_host....
8e62bf2bfa46367e14d0ffdcde5aada08759497c
Analyze and fix the following issue in the Linux kernel code: KVM: x86/xen: inject vCPU upcall vector when local APIC is enabled
Problem Details: Linux guests since commit b1c3497e604d ("x86/xen: Add support for HVMOP_set_evtchn_upcall_vector") in v6.0 onwards will use the per-vCPU upcall vector when it's advertised in the Xen CPUID leaves. This upcall is injected through the guest's local APIC as an MSI, unlike the older system vector which wa...
```diff diff --git a/arch/x86/kvm/lapic.c b/arch/x86/kvm/lapic.c index 3242f3da2457..75bc7d3f0022 100644 --- a/arch/x86/kvm/lapic.c +++ b/arch/x86/kvm/lapic.c @@ -41,6 +41,7 @@ #include "ioapic.h" #include "trace.h" #include "x86.h" +#include "xen.h" #include "cpuid.h" #include "hyperv.h" #include "smm.h" @@ -499...
451a707813aee24b4a734f28d1d414be0360862b
Analyze and fix the following issue in the Linux kernel code: KVM: x86/xen: improve accuracy of Xen timers
Problem Details: A test program such as http://david.woodhou.se/timerlat.c confirms user reports that timers are increasingly inaccurate as the lifetime of a guest increases. Reporting the actual delay observed when asking for 100µs of sleep, it starts off OK on a newly-launched guest but gets worse over time, giving i...
```diff diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 2911e6383fef..89815a887e4d 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c @@ -2862,7 +2862,11 @@ static inline u64 vgettsc(struct pvclock_clock *clock, u64 *tsc_timestamp, return v * clock->mult; } -static int do_monotonic_raw(s64 *t, u64...
8ede3db5061bb1fe28e2c9683329aafa89d2b1b4
Analyze and fix the following issue in the Linux kernel code: io_uring/net: fix overflow check in io_recvmsg_mshot_prep()
Problem Details: The "controllen" variable is type size_t (unsigned long). Casting it to int could lead to an integer underflow. The check_add_overflow() function considers the type of the destination which is type int. If we add two positive values and the result cannot fit in an integer then that's counted as an o...
```diff diff --git a/io_uring/net.c b/io_uring/net.c index 40d4542bfe2a..1640e985cd08 100644 --- a/io_uring/net.c +++ b/io_uring/net.c @@ -559,10 +559,10 @@ static int io_recvmsg_mshot_prep(struct io_kiocb *req, if (unlikely(namelen < 0)) return -EOVERFLOW; - if (check_add_overflow((int)sizeof(struct io_uring...
86bcacc957fc2d0403aa0e652757eec59a5fd7ca
Analyze and fix the following issue in the Linux kernel code: io_uring/net: correct the type of variable
Problem Details: The namelen is of type int. It shouldn't be made size_t which is unsigned. The signed number is needed for error checking before use. Fixes: c55978024d12 ("io_uring/net: move receive multishot out of the generic msghdr path") Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com> Link: https:...
```diff diff --git a/io_uring/net.c b/io_uring/net.c index 8b9a9f5bbd14..40d4542bfe2a 100644 --- a/io_uring/net.c +++ b/io_uring/net.c @@ -551,7 +551,7 @@ int io_send(struct io_kiocb *req, unsigned int issue_flags) static int io_recvmsg_mshot_prep(struct io_kiocb *req, struct io_async_msghdr *iomsg, - size...
ad8ee969d7e34dd310a618d798cc6d8fe4f04464
Analyze and fix the following issue in the Linux kernel code: of: make for_each_property_of_node() available to to !OF
Problem Details: for_each_property_of_node() is a macro and so doesn't have a stub inline function for !OF. Move it out of the relevant #ifdef to make it available to all users. Fixes: 611cad720148 ("dt: add of_alias_scan and of_alias_get_id") Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> Link: h...
```diff diff --git a/include/linux/of.h b/include/linux/of.h index 6a9ddf20e79a..a3e8e429ad7f 100644 --- a/include/linux/of.h +++ b/include/linux/of.h @@ -362,9 +362,6 @@ extern struct device_node *of_get_cpu_state_node(struct device_node *cpu_node, int index); extern u64 of_get_cpu_hwid(struct device_node *cp...
f317c5e583516fcf8ad93e2bab2d0a4ed4efe60b
Analyze and fix the following issue in the Linux kernel code: drm/amdgpu/pm: Fix the error of pwm1_enable setting
Problem Details: Fix the pwm_mode value error which used for pwm1_enable setting Signed-off-by: Ma Jun <Jun.Ma2@amd.com> Reviewed-by: Lijo Lazar <lijo.lazar@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
```diff diff --git a/drivers/gpu/drm/amd/pm/amdgpu_pm.c b/drivers/gpu/drm/amd/pm/amdgpu_pm.c index 9e70c41ad98f..40df1db63ccd 100644 --- a/drivers/gpu/drm/amd/pm/amdgpu_pm.c +++ b/drivers/gpu/drm/amd/pm/amdgpu_pm.c @@ -2581,6 +2581,7 @@ static ssize_t amdgpu_hwmon_set_pwm1_enable(struct device *dev, { struct amdgpu_...
b8f67b9ddf4f8fe6dd536590712b5912ad78f99c
Analyze and fix the following issue in the Linux kernel code: drm/amdgpu: change vm->task_info handling
Problem Details: This patch changes the handling and lifecycle of vm->task_info object. The major changes are: - vm->task_info is a dynamically allocated ptr now, and its uasge is reference counted. - introducing two new helper funcs for task_info lifecycle management - amdgpu_vm_get_task_info: reference counts u...
```diff diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c index 1afbb2e932c6..f5d0fa207a88 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_debugfs.c @@ -1782,9 +1782,14 @@ static int amdgpu_debugfs_vm_info_show(struct ...
feb13f52c8547a8198045077d6aa9c3f2400ba11
Analyze and fix the following issue in the Linux kernel code: Revert "drm/amdgpu: remove vm sanity check from amdgpu_vm_make_compute" for Raven
Problem Details: fix the issue: "amdgpu: Failed to create process VM object". [Why]when amdgpu initialized, seq64 do mampping and update bo mapping in vm page table. But when clifo run. It also initializes a vm for a process device through the function kfd_process_device_init_vm and ensure the root PD is clean through...
```diff diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index ed4a8c5d26d7..d004ace79536 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c @@ -1385,10 +1385,6 @@ int amdgpu_vm_clear_freed(struct amdgpu_device *adev, struct a...
177862317a98adde284233aee074fc6e6a51cf95
Analyze and fix the following issue in the Linux kernel code: ASoC: cs-amp-lib: Add KUnit test for calibration helpers
Problem Details: Add a KUnit test for the cs-amp-lib library. This has test cases for cs_amp_get_efi_calibration_data() and cs_amp_write_cal_coeffs(). A KUNIT_STATIC_STUB_REDIRECT() has been added to cs_amp_get_efi_variable() and cs_amp_write_cal_coeff() so that the KUnit test can redirect these to test harness functi...
```diff diff --git a/include/sound/cs-amp-lib.h b/include/sound/cs-amp-lib.h index 077fe36885b5..f481148735e1 100644 --- a/include/sound/cs-amp-lib.h +++ b/include/sound/cs-amp-lib.h @@ -49,4 +49,18 @@ int cs_amp_write_cal_coeffs(struct cs_dsp *dsp, const struct cirrus_amp_cal_data *data); int cs_amp_get_efi_c...
41c58a36e2c0496abebb1cb3100b38e32f49f80f
Analyze and fix the following issue in the Linux kernel code: dm vdo indexer: fix use after free
Problem Details: Fixes: b46d79bdb82a ("dm vdo: add deduplication index storage interface") Reported-by: Harshit Mogalapalli <harshit.m.mogalapalli@oracle.com> Signed-off-by: Matthew Sakai <msakai@redhat.com> Signed-off-by: Mike Snitzer <snitzer@kernel.org>
```diff diff --git a/drivers/md/dm-vdo/indexer/index-layout.c b/drivers/md/dm-vdo/indexer/index-layout.c index 349b3022f1e1..74fd44c20e5c 100644 --- a/drivers/md/dm-vdo/indexer/index-layout.c +++ b/drivers/md/dm-vdo/indexer/index-layout.c @@ -1561,10 +1561,11 @@ static int __must_check load_index_save(struct index_save...
6c43cf24882e3a8ed8f918e92d5f5bed935a580b
Analyze and fix the following issue in the Linux kernel code: dm vdo int-map: return VDO_SUCCESS on success
Problem Details: Update all callers to check for VDO_SUCCESS (most already did). Also fix whitespace for update_mapping() parameters. Signed-off-by: Mike Snitzer <snitzer@kernel.org> Signed-off-by: Matthew Sakai <msakai@redhat.com>
```diff diff --git a/drivers/md/dm-vdo/block-map.c b/drivers/md/dm-vdo/block-map.c index c4719fb30f86..320e76527e2b 100644 --- a/drivers/md/dm-vdo/block-map.c +++ b/drivers/md/dm-vdo/block-map.c @@ -231,7 +231,7 @@ static int __must_check allocate_cache_components(struct vdo_page_cache *cache) return result; res...
8f89115efc1e8f34dd3182e2f3f7064225b52762
Analyze and fix the following issue in the Linux kernel code: dm vdo memory-alloc: rename vdo_do_allocation to __vdo_do_allocation
Problem Details: __vdo_do_allocation shouldn't be used outside of memory-alloc.h, so add hidden prefix. Also, tabify the vdo_allocate_extended macro. Signed-off-by: Mike Snitzer <snitzer@kernel.org> Signed-off-by: Matthew Sakai <msakai@redhat.com>
```diff diff --git a/drivers/md/dm-vdo/memory-alloc.h b/drivers/md/dm-vdo/memory-alloc.h index 3f27dd722a2d..1401843db5e0 100644 --- a/drivers/md/dm-vdo/memory-alloc.h +++ b/drivers/md/dm-vdo/memory-alloc.h @@ -37,8 +37,8 @@ int __must_check vdo_allocate_memory(size_t size, size_t align, const char *what * * Return...
bbe434d94e007d3db258cfbc16336290af39d0bc
Analyze and fix the following issue in the Linux kernel code: dm vdo indexer delta-index: fix typos in comments
Problem Details: Signed-off-by: Matthew Sakai <msakai@redhat.com> Signed-off-by: Mike Snitzer <snitzer@kernel.org>
```diff diff --git a/drivers/md/dm-vdo/indexer/delta-index.c b/drivers/md/dm-vdo/indexer/delta-index.c index 4aace707545a..6a85f93bbcb1 100644 --- a/drivers/md/dm-vdo/indexer/delta-index.c +++ b/drivers/md/dm-vdo/indexer/delta-index.c @@ -35,7 +35,7 @@ * * Each delta list is stored as a bit stream. Within the delta...
eebd4e163024944ed53b6ad6d147e49df24dba32
Analyze and fix the following issue in the Linux kernel code: dm vdo: fix various function names referenced in comment blocks
Problem Details: No functional modification involved. Reported-by: Abaci Robot <abaci@linux.alibaba.com> Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com> Signed-off-by: Matthew Sakai <msakai@redhat.com> Signed-off-by: Mike Snitzer <snitzer@kernel.org>
```diff diff --git a/drivers/md/dm-vdo/admin-state.c b/drivers/md/dm-vdo/admin-state.c index 94533a802edb..1423f4cebb8a 100644 --- a/drivers/md/dm-vdo/admin-state.c +++ b/drivers/md/dm-vdo/admin-state.c @@ -300,7 +300,7 @@ static bool check_code(bool valid, const struct admin_state_code *code, const ch } /** - * vd...
444d3f0bfd436cf28348a0a20d0b8ad0cdbb8be3
Analyze and fix the following issue in the Linux kernel code: dm vdo indexer-volume: fix missing mutex_lock in process_entry
Problem Details: Must mutex_lock after dm_bufio_read, before dm_bufio_read error handling, otherwise process_entry error path will return without volume->read_threads_mutex held. This fixes potential double mutex_unlock. Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Signed-off-by: Mike Snitzer <snitzer@kernel....
```diff diff --git a/drivers/md/dm-vdo/volume.c b/drivers/md/dm-vdo/volume.c index 37c2ef0777e5..60416dc8a9d7 100644 --- a/drivers/md/dm-vdo/volume.c +++ b/drivers/md/dm-vdo/volume.c @@ -556,6 +556,7 @@ static int process_entry(struct volume *volume, struct queued_read *entry) mutex_unlock(&volume->read_threads_mut...
af1e0a7d39f98c0dea1b186a76fcee7da6a5f7bc
Analyze and fix the following issue in the Linux kernel code: firmware: microchip: Fix over-requested allocation size
Problem Details: cocci warnings: (new ones prefixed by >>) >> drivers/firmware/microchip/mpfs-auto-update.c:387:72-78: ERROR: application of sizeof to pointer drivers/firmware/microchip/mpfs-auto-update.c:170:72-78: ERROR: application of sizeof to pointer response_msg is a pointer to u32, so the size of eleme...
```diff diff --git a/drivers/firmware/microchip/mpfs-auto-update.c b/drivers/firmware/microchip/mpfs-auto-update.c index 81f5f62e34fc..32394c24b37d 100644 --- a/drivers/firmware/microchip/mpfs-auto-update.c +++ b/drivers/firmware/microchip/mpfs-auto-update.c @@ -384,7 +384,8 @@ static int mpfs_auto_update_available(str...
979c2c049fbea107ce9f8d31f3ba9dba83ddb0a2
Analyze and fix the following issue in the Linux kernel code: ice: cleanup line splitting for context set functions
Problem Details: The indentation for ice_set_ctx and ice_write_rxq_ctx breaks the function name after the return type. This style of breaking is used a lot throughout the ice driver, even in cases where its not actually helpful for readability. We no longer prefer this style of line splitting in the driver, and new cod...
```diff diff --git a/drivers/net/ethernet/intel/ice/ice_common.c b/drivers/net/ethernet/intel/ice/ice_common.c index e9e4a8ef7904..7d9315ffae57 100644 --- a/drivers/net/ethernet/intel/ice/ice_common.c +++ b/drivers/net/ethernet/intel/ice/ice_common.c @@ -1399,9 +1399,8 @@ static const struct ice_ctx_ele ice_rlan_ctx_in...
1260b45dbe2dbc415f3bc1e841c6c098083bcfb8
Analyze and fix the following issue in the Linux kernel code: ice: rename ice_write_* functions to ice_pack_ctx_*
Problem Details: In ice_common.c there are 4 functions used for converting the unpacked software Tx and Rx context structure data into the packed format used by hardware. These functions have extremely generic names: * ice_write_byte * ice_write_word * ice_write_dword * ice_write_qword When I saw these function n...
```diff diff --git a/drivers/net/ethernet/intel/ice/ice_common.c b/drivers/net/ethernet/intel/ice/ice_common.c index 9266f25a9978..3622079cb506 100644 --- a/drivers/net/ethernet/intel/ice/ice_common.c +++ b/drivers/net/ethernet/intel/ice/ice_common.c @@ -4362,13 +4362,13 @@ ice_aq_add_rdma_qsets(struct ice_hw *hw, u8 n...
22af1b8c31cbf7daf235a4fcb975089ad8c07fbe
Analyze and fix the following issue in the Linux kernel code: f2fs: fix to check return value of f2fs_gc_range
Problem Details: f2fs_gc_range may return error, so its caller f2fs_allocate_pinning_section should determine whether to do retry based on ist return value. Also just do f2fs_gc_range when f2fs_allocate_new_section return -EAGAIN, and check cp error case in f2fs_gc_range. Signed-off-by: Zhiguo Niu <zhiguo.niu@unisoc....
```diff diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c index e435e1f58cd5..c60b7472475b 100644 --- a/fs/f2fs/gc.c +++ b/fs/f2fs/gc.c @@ -1986,6 +1986,9 @@ int f2fs_gc_range(struct f2fs_sb_info *sbi, unsigned int segno; unsigned int gc_secs = dry_run_sections; + if (unlikely(f2fs_cp_error(sbi))) + return -EIO; + for ...
28f66cc654039edff3e34200c3357d92a7c4d272
Analyze and fix the following issue in the Linux kernel code: f2fs: fix to check return value __allocate_new_segment
Problem Details: __allocate_new_segment may return error when get_new_segment fails, so its caller should check its return value. Signed-off-by: Zhiguo Niu <zhiguo.niu@unisoc.com> Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
```diff diff --git a/fs/f2fs/f2fs.h b/fs/f2fs/f2fs.h index db05fd02350a..433101223e7a 100644 --- a/fs/f2fs/f2fs.h +++ b/fs/f2fs/f2fs.h @@ -3705,7 +3705,7 @@ void f2fs_allocate_segment_for_resize(struct f2fs_sb_info *sbi, int type, unsigned int start, unsigned int end); int f2fs_allocate_new_section(struct f2fs_s...
36959d18c3cf09b3c12157c6950e18652067de77
Analyze and fix the following issue in the Linux kernel code: f2fs: fix to do sanity check in update_sit_entry
Problem Details: If GET_SEGNO return NULL_SEGNO for some unecpected case, update_sit_entry will access invalid memory address, cause system crash. It is better to do sanity check about GET_SEGNO just like update_segment_mtime & locate_dirty_segment. Also remove some redundant judgment code. Signed-off-by: Zhiguo Niu ...
```diff diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index fa395801137b..0d21ce615cec 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -2413,6 +2413,8 @@ static void update_sit_entry(struct f2fs_sb_info *sbi, block_t blkaddr, int del) #endif segno = GET_SEGNO(sbi, blkaddr); + if (segno == NULL_SEGNO...
42a80aacb76bed85f453b10f662877ed60d37164
Analyze and fix the following issue in the Linux kernel code: f2fs: fix to reset fields for unloaded curseg
Problem Details: In f2fs_allocate_data_block(), before skip allocating new segment for DATA_PINNED log header, it needs to tag log header as unloaded one to avoid skipping logic in locate_dirty_segment() and __f2fs_save_inmem_curseg(). Signed-off-by: Chao Yu <chao@kernel.org> Reviewed-by: Daeho Jeong <daehojeong@googl...
```diff diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index c88897db1e44..fa395801137b 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -3108,12 +3108,16 @@ static int __allocate_new_segment(struct f2fs_sb_info *sbi, int type, struct curseg_info *curseg = CURSEG_I(sbi, type); unsigned int old_segno; ...
8249aac1b05c28f3b35363b844b5b0194f838052
Analyze and fix the following issue in the Linux kernel code: f2fs: fix blkofs_end correctly in f2fs_migrate_blocks()
Problem Details: In f2fs_migrate_blocks(), when traversing blocks in last section, blkofs_end should be (start_blk + blkcnt - 1) % blk_per_sec, fix it. Signed-off-by: Chao Yu <chao@kernel.org> Reviewed-by: Daeho Jeong <daehojeong@google.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
```diff diff --git a/fs/f2fs/data.c b/fs/f2fs/data.c index c21b92f18463..0c728e82d936 100644 --- a/fs/f2fs/data.c +++ b/fs/f2fs/data.c @@ -3841,13 +3841,14 @@ static int f2fs_migrate_blocks(struct inode *inode, block_t start_blk, struct f2fs_sb_info *sbi = F2FS_I_SB(inode); unsigned int blkofs; unsigned int blk_p...
4b99ecd304290c4ef55666a62c89dfb2dbf0b2cd
Analyze and fix the following issue in the Linux kernel code: f2fs: ro: compress: fix to avoid caching unaligned extent
Problem Details: Mapping info from dump.f2fs: i_addr[0x2d] cluster flag [0xfffffffe : 4294967294] i_addr[0x2e] [0x 10428 : 66600] i_addr[0x2f] [0x 10429 : 66601] i_addr[0x30] [0x 1042a : 66602] f2fs_io fiemap 37 1 /mnt/f2fs/disk-58390c8c.raw Previsouly,...
```diff diff --git a/fs/f2fs/compress.c b/fs/f2fs/compress.c index 3dc488ce882b..8892c8262141 100644 --- a/fs/f2fs/compress.c +++ b/fs/f2fs/compress.c @@ -1817,16 +1817,18 @@ void f2fs_put_page_dic(struct page *page, bool in_task) * check whether cluster blocks are contiguous, and add extent cache entry * only if c...
2fc2bcc8d39945ac9e26114280d2b6d1e624825c
Analyze and fix the following issue in the Linux kernel code: f2fs: fix to check return value in f2fs_insert_range()
Problem Details: In f2fs_insert_range(), it missed to check return value of filemap_write_and_wait_range(), fix it. Meanwhile, just return error number once __exchange_data_block() fails. Signed-off-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
```diff diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index 1c044fb19c87..4ca6c693b33a 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -1679,10 +1679,12 @@ static int f2fs_insert_range(struct inode *inode, loff_t offset, loff_t len) } filemap_invalidate_unlock(mapping); f2fs_up_write(&F2FS_I(inode)->i_gc_rwsem...
7324858237829733dec9c670170df2377c5ca6e2
Analyze and fix the following issue in the Linux kernel code: f2fs: fix to use correct segment type in f2fs_allocate_data_block()
Problem Details: @type in f2fs_allocate_data_block() indicates log header's type, it can be CURSEG_COLD_DATA_PINNED or CURSEG_ALL_DATA_ATGC, rather than type of data/node, however IS_DATASEG()/IS_NODESEG() only accept later one, fix it. Fixes: 093749e296e2 ("f2fs: support age threshold based garbage collection") Signe...
```diff diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 7a060219da85..3b8aed8ca7d4 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -3540,12 +3540,12 @@ skip_new_segment: locate_dirty_segment(sbi, GET_SEGNO(sbi, old_blkaddr)); locate_dirty_segment(sbi, GET_SEGNO(sbi, *new_blkaddr)); - if (IS_DAT...
4f5126a075c415044d36e9e6948a8a3a43e97ad0
Analyze and fix the following issue in the Linux kernel code: idpf: fix minor controlq issues
Problem Details: While we're here improving virtchnl we can include two minor fixes for the lower level ctrlq flow. This adds a memory barrier to idpf_post_rx_buffs before we update tail on the controlq. We should make sure our writes have had a chance to finish before we tell HW it can touch them. This also removes...
```diff diff --git a/drivers/net/ethernet/intel/idpf/idpf_controlq.c b/drivers/net/ethernet/intel/idpf/idpf_controlq.c index c7f43d2fcd13..4849590a5591 100644 --- a/drivers/net/ethernet/intel/idpf/idpf_controlq.c +++ b/drivers/net/ethernet/intel/idpf/idpf_controlq.c @@ -516,6 +516,8 @@ post_buffs_out: /* Wrap to en...
14696ed173af247a2d80b779c2f0cb08c94dfb4d
Analyze and fix the following issue in the Linux kernel code: idpf: prevent deinit uninitialized virtchnl core
Problem Details: In idpf_remove we need to tear down the virtchnl core with idpf_vc_core_deinit so we can free up resources and leave things in a good state. However, in the case where we failed to establish VC communications we may not have ever actually successfully initialized the virtchnl core. This fixes it by se...
```diff diff --git a/drivers/net/ethernet/intel/idpf/idpf.h b/drivers/net/ethernet/intel/idpf/idpf.h index 5ed08be1dbc0..e7a036538246 100644 --- a/drivers/net/ethernet/intel/idpf/idpf.h +++ b/drivers/net/ethernet/intel/idpf/idpf.h @@ -83,6 +83,7 @@ enum idpf_state { * @IDPF_HR_RESET_IN_PROG: Reset in progress * @ID...
3b85b7bcccf45f674d35c0bf65aa84153397380d
Analyze and fix the following issue in the Linux kernel code: drm/xe: Fix display runtime_pm handling
Problem Details: i915's intel_runtime_pm_get_if_in_use actually calls the pm_runtime_get_if_active() with ign_usage_count = false, but Xe was erroneously calling it with true because of the mem_access cases. This can lead to unnecessary references getting hold here and device never getting into the runtime suspended s...
```diff diff --git a/drivers/gpu/drm/xe/compat-i915-headers/i915_drv.h b/drivers/gpu/drm/xe/compat-i915-headers/i915_drv.h index 420eba0e4be0..ad5864d1dd74 100644 --- a/drivers/gpu/drm/xe/compat-i915-headers/i915_drv.h +++ b/drivers/gpu/drm/xe/compat-i915-headers/i915_drv.h @@ -177,7 +177,7 @@ static inline intel_waker...
cbae1a350e3ceff38242a4905805c80ccbcfbba5
Analyze and fix the following issue in the Linux kernel code: ASoC: rcar: adg: correct TIMSEL setting for SSI9
Problem Details: Timing select registers for SRC and CMD are by default referring to the corresponding SSI word select. The calculation rule from HW spec skips SSI8, which has no clock connection. >From section 43.2.18 CMD Output Timing Select Register (CMDOUT_TIMSEL), of R-Car Series, 3rd Generation Hardware User’s M...
```diff diff --git a/sound/soc/sh/rcar/adg.c b/sound/soc/sh/rcar/adg.c index 230c48648af3..afd69c6eb654 100644 --- a/sound/soc/sh/rcar/adg.c +++ b/sound/soc/sh/rcar/adg.c @@ -111,6 +111,13 @@ static u32 rsnd_adg_ssi_ws_timing_gen2(struct rsnd_dai_stream *io) ws = 7; break; } + } else { + /* + * SSI8 is no...
e635b7eb7062b464bbd9795308b1a80eac0b01f5
Analyze and fix the following issue in the Linux kernel code: drm/panel-edp: Add prepare_to_enable to 200ms for MNC207QS1-1
Problem Details: For MNC207QS1-1 panel, Splash screen occur when switch from VT1 to VT2. The BL_EN signal does not conform to the VESA protocol. BL_EN signal needs to be pulled high after video signal. So add prepare_to_enable to 200ms. [ dianders: Adjusted subject prefix and added Fixes tag ] Fixes: 0547692ac146 ("d...
```diff diff --git a/drivers/gpu/drm/panel/panel-edp.c b/drivers/gpu/drm/panel/panel-edp.c index d58f90bc48fb..745f3e48f02a 100644 --- a/drivers/gpu/drm/panel/panel-edp.c +++ b/drivers/gpu/drm/panel/panel-edp.c @@ -1865,6 +1865,13 @@ static const struct panel_delay delay_200_500_e50 = { .enable = 50, }; +static co...
9dfc46c87cdc8f5a42a71de247a744a6b8188980
Analyze and fix the following issue in the Linux kernel code: drm/panel: boe-tv101wum-nl6: Fine tune Himax83102-j02 panel HFP and HBP (again)
Problem Details: The current measured frame rate is 59.95Hz, which does not meet the requirements of touch-stylus and stylus cannot work normally. After adjustment, the actual measurement is 60.001Hz. Now this panel looks like it's only used by me on the MTK platform, so let's change this set of parameters. [ dianders...
```diff diff --git a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c index c4c0f08e9202..4945a1e787eb 100644 --- a/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c +++ b/drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c @@ -1768,11 +1768,11 @@ static const struct panel_desc st...