Re: [PATCH v9 02/19] cxl/mem: Read dynamic capacity configuration from the device

2025-05-08 Thread Ira Weiny
Fan Ni wrote: > On Sun, Apr 13, 2025 at 05:52:10PM -0500, Ira Weiny wrote: > > Devices which optionally support Dynamic Capacity (DC) are configured > > via mailbox commands. CXL 3.2 section 9.13.3 requires the host to issue > > the Get DC Configuration command in order to pr

Re: [PATCH v9 01/19] cxl/mbox: Flag support for Dynamic Capacity Devices (DCD)

2025-05-06 Thread Ira Weiny
Fan Ni wrote: > On Mon, Apr 14, 2025 at 03:19:50PM +0100, Jonathan Cameron wrote: > > On Sun, 13 Apr 2025 17:52:09 -0500 > > Ira Weiny wrote: [snip] > > > > > + > > > +static bool cxl_verify_dcd_cmds(struct cxl_memdev_state *mds, unsigned > > >

Re: [PATCH v9 00/19] DCD: Add support for Dynamic Capacity Devices (DCD)

2025-04-14 Thread Ira Weiny
Fan Ni wrote: > On Sun, Apr 13, 2025 at 05:52:08PM -0500, Ira Weiny wrote: > > A git tree of this series can be found here: > > > > https://github.com/weiny2/linux-kernel/tree/dcd-v6-2025-04-13 > > > > This is now based on 6.15-rc2. > > > > Du

[PATCH v9 12/19] cxl/extent: Process dynamic partition events and realize region extents

2025-04-13 Thread Ira Weiny
existing DAX devices as having a 0 tag which makes the most logical sense as a default. Process DCD events and create region devices. Based on an original patch by Navneet Singh. Reviewed-by: Dave Jiang Reviewed-by: Li Ming Reviewed-by: Jonathan Cameron Signed-off-by: Ira Weiny --- Chan

[PATCH v9 18/19] tools/testing/cxl: Make event logs dynamic

2025-04-13 Thread Ira Weiny
. Simplify log processing by using the event log array index as the handle. Add a lock to manage concurrency required when user space is allowed to control DCD extents Reviewed-by: Jonathan Cameron Reviewed-by: Dave Jiang Signed-off-by: Ira Weiny --- Changes: [iweiny: rebase to 6.15-rc1

[PATCH v9 16/19] cxl/region: Read existing extents on region creation

2025-04-13 Thread Ira Weiny
neet Singh. Reviewed-by: Jonathan Cameron Reviewed-by: Fan Ni Signed-off-by: Ira Weiny --- Changes: [0day: fix extent count in GetExtent input payload] [iweiny: minor clean ups] [iweiny: Adjust for partition arch] --- drivers/cxl/core/core.h | 1 + drivers/cxl/core/mbox

[PATCH v9 01/19] cxl/mbox: Flag support for Dynamic Capacity Devices (DCD)

2025-04-13 Thread Ira Weiny
original patch by Navneet Singh. Signed-off-by: Ira Weiny --- Changes: [iweiny: rebased] [iweiny: remove tags] [djbw: remove dcd_cmds bitmask from mds] --- drivers/cxl/core/mbox.c | 44 drivers/cxl/cxlmem.h| 15 +++ 2 files changed, 59

[PATCH v9 00/19] DCD: Add support for Dynamic Capacity Devices (DCD)

2025-04-13 Thread Ira Weiny
pport more than 1 DC partition [1] https://github.com/weiny2/ndctl/tree/dcd-region3-2025-04-13 --- Changes in v9: - djbw: pare down support to only a single DC parition - djbw: adjust to the new core partition processing which aligns with new type2 work. - iweiny: address smaller comments from v

[PATCH v9 04/19] cxl/core: Enforce partition order/simplify partition calls

2025-04-13 Thread Ira Weiny
Device partitions have an implied order which is made more complex by the addition of a dynamic partition. Remove the ram special case information calls in favor of generic calls with a check ahead of time to ensure the preservation of the implied partition order. Signed-off-by: Ira Weiny

[PATCH v9 13/19] cxl/region/extent: Expose region extent information in sysfs

2025-04-13 Thread Ira Weiny
/offset /sys/bus/cxl/devices/dax_regionX/extentX.Y/length /sys/bus/cxl/devices/dax_regionX/extentX.Y/tag Based on an original patch by Navneet Singh. Reviewed-by: Jonathan Cameron Reviewed-by: Fan Ni Tested-by: Fan Ni Signed-off-by: Ira Weiny --- Changes: [iweiny: rebase] [iweiny

[PATCH v9 17/19] cxl/mem: Trace Dynamic capacity Event Record

2025-04-13 Thread Ira Weiny
: Fan Ni Signed-off-by: Ira Weiny --- Changes: [djbw: s/region/partition/] [iweiny: s/tag/uuid/] --- drivers/cxl/core/mbox.c | 4 +++ drivers/cxl/core/trace.h | 65 2 files changed, 69 insertions(+) diff --git a/drivers/cxl/core/mbox.c b/drivers

[PATCH v9 19/19] tools/testing/cxl: Add DC Regions to mock mem data

2025-04-13 Thread Ira Weiny
: Jonathan Cameron Reviewed-by: Dave Jiang Signed-off-by: Ira Weiny --- Changes: [iweiny: rebase] [djbw: s/region/partition/] [iweiny: s/tag/uuid/] --- tools/testing/cxl/test/mem.c | 753 +++ 1 file changed, 753 insertions(+) diff --git a/tools/testing/cxl/test

[PATCH v9 11/19] cxl/core: Return endpoint decoder information from region search

2025-04-13 Thread Ira Weiny
decoder. Return the endpoint decoder found to be used in subsequent DCD code. Reviewed-by: Jonathan Cameron Reviewed-by: Fan Ni Reviewed-by: Dave Jiang Reviewed-by: Li Ming Reviewed-by: Alison Schofield Signed-off-by: Ira Weiny --- Changes: [iweiny: rebase] --- drivers/cxl/core/core.h

[PATCH v9 14/19] dax/bus: Factor out dev dax resize logic

2025-04-13 Thread Ira Weiny
ce for the dax ranges. Future patches will use the same algorithm with individual extent resources as the parent. Reviewed-by: Jonathan Cameron Reviewed-by: Dave Jiang Signed-off-by: Ira Weiny --- drivers/dax/bus.c | 130 +- 1 file changed,

[PATCH v9 15/19] dax/region: Create resources on sparse DAX regions

2025-04-13 Thread Ira Weiny
the DAX region resource tree based on the extents lifetime. Return the status of remove notifications to lower layers such that it can manage the hardware appropriately. Based on an original patch by Navneet Singh. Reviewed-by: Jonathan Cameron Signed-off-by: Ira Weiny --- Changes: [iweiny

[PATCH v9 07/19] cxl/region: Add sparse DAX region support

2025-04-13 Thread Ira Weiny
devices on sparse regions. Interleaving is deferred for now. Add checks. Based on an original patch by Navneet Singh. Signed-off-by: Ira Weiny --- Changes: [iweiny: adjust to new partition mode and new singular dynamic ram partition] --- Documentation/ABI/testing/sysfs-bus-cxl | 22

[PATCH v9 09/19] cxl/pci: Factor out interrupt policy check

2025-04-13 Thread Ira Weiny
. Reviewed-by: Dave Jiang Reviewed-by: Jonathan Cameron Reviewed-by: Fan Ni Reviewed-by: Li Ming Link: https://lore.kernel.org/all/663922b475e50_d54d729...@dwillia2-xfh.jf.intel.com.notmuch/ [1] Suggested-by: Dan Williams Signed-off-by: Ira Weiny --- drivers/cxl/pci.c | 23 --- 1

[PATCH v9 10/19] cxl/mem: Configure dynamic capacity interrupts

2025-04-13 Thread Ira Weiny
meron Reviewed-by: Dave Jiang Reviewed-by: Li Ming Reviewed-by: Fan Ni Signed-off-by: Ira Weiny --- drivers/cxl/cxlmem.h | 2 ++ drivers/cxl/pci.c| 73 ++-- 2 files changed, 62 insertions(+), 13 deletions(-) diff --git a/drivers/cxl/cxlmem.h b/dr

[PATCH v9 08/19] cxl/events: Split event msgnum configuration from irq setup

2025-04-13 Thread Ira Weiny
preparation for separate DCD interrupts configuration. Reviewed-by: Jonathan Cameron Reviewed-by: Fan Ni Reviewed-by: Dave Jiang Reviewed-by: Li Ming Signed-off-by: Ira Weiny --- drivers/cxl/pci.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/drivers

[PATCH v9 06/19] cxl/port: Add 'dynamic_ram_a' to endpoint decoder mode

2025-04-13 Thread Ira Weiny
Endpoints can now support a single dynamic ram partition following the persistent memory partition. Expand the mode to allow a decoder to point to the first dynamic ram partition. Signed-off-by: Ira Weiny --- Changes: [iweiny: completely re-written] --- Documentation/ABI/testing/sysfs-bus-cxl

[PATCH v9 05/19] cxl/mem: Expose dynamic ram A partition in sysfs

2025-04-13 Thread Ira Weiny
To properly configure CXL regions user space will need to know the details of the dynamic ram partition. Expose the first dynamic ram partition through sysfs. Signed-off-by: Ira Weiny --- Changes: [iweiny: Complete rewrite of the old patch.] --- Documentation/ABI/testing/sysfs-bus-cxl | 24

[PATCH v9 03/19] cxl/cdat: Gather DSMAS data for DCD partitions

2025-04-13 Thread Ira Weiny
Additional DCD partition (AKA region) information is contained in the DSMAS CDAT tables, including performance, read only, and shareable attributes. Match DCD partitions with DSMAS tables and store the meta data. Signed-off-by: Ira Weiny --- Changes: [iweiny: Adjust for new perf/partition

[PATCH v9 02/19] cxl/mem: Read dynamic capacity configuration from the device

2025-04-13 Thread Ira Weiny
on an original patch by Navneet Singh. Signed-off-by: Ira Weiny --- Changes: [iweiny: rebase] [iweiny: Update spec references to 3.2] [djbw: Limit to 1 partition] [djbw: Avoid inter-partition skipping] [djbw: s/region/partition/] [djbw: remove cxl_dc_region[partition]_info->name] [iweiny: adjust t

[GIT PULL] NVDIMM for 6.15

2025-04-05 Thread Ira Weiny
. Thanks, Ira Weiny --- The following changes since commit 7eb172143d5508b4da468ed59ee857c6e5e01da6: Linux 6.14-rc5 (2025-03-02 11:48:20 -0800) are available in the Git repository at: g...@gitolite.kernel.org:pub/scm/linux/kernel/git/nvdimm/nvdimm.git tags/libnvdimm-for-6.15 for you to

Re: [PATCH v2] libnvdimm/labels: Fix divide error in nd_label_data_init()

2025-04-05 Thread Ira Weiny
a multiple of max_xfer > size */ > drivers/nvdimm/label.c: read_size = min(DIV_ROUND_UP(read_size, max_xfer) * > max_xfer, > drivers/nvdimm/label.c- config_size); > > Fix this by checking the config size parameter by extending an > existing check. > > Signed-

Re: [PATCH] libnvdimm/labels: Fix divide error in nd_label_data_init()

2025-04-05 Thread Ira Weiny
arently nvdimm_get_config_data() was intended to check for this implicitly but it is too late. Anyway all this side tracked me a bit. I assume this is a broken device which is in the real world? The fix looks fine. But could you re-spin with a clean up of the commit message and I'll queue it up. Reviewed-by: Ira Weiny [snip]

Re: [PATCH 0/2] nvdimm deadcoding

2025-02-20 Thread Ira Weiny
linux@ wrote: > From: "Dr. David Alan Gilbert" > > Hi, > A couple of nvdimm dead coding patches; they just > remove entirely unused functions. > > Signed-off-by: Dr. David Alan Gilbert For the series. I'll pick these up for 6.15. Reviewed-by: Ira Weiny

Re: [PATCH] acpi: nfit: fix narrowing conversion in acpi_nfit_ctl

2025-01-24 Thread Ira Weiny
Murad Masimov wrote: > > > От: Dave Jiang > Отправлено: 24 января 2025 г. 2:43 > Кому: Masimov Murad; Dan Williams > Копия: Vishal Verma; Ira Weiny; Rafael J. Wysocki; Len Brown; > nvd...@lists.linux.dev; linux-a...@vger.kernel

Re: [PATCH] virtio: console: Replace deprecated kmap_atomic with kmap_local_page

2025-01-10 Thread Ira Weiny
David Reaver wrote: > kmap_atomic() is deprecated and should be replaced with kmap_local_page() > [1][2]. kmap_local_page() is faster in kernels with HIGHMEM enabled, can > take page faults, and allows preemption. Thanks for taking these on! It is good to see some progress here. > > According t

Re: [PATCH v6] acpi: nfit: vmalloc-out-of-bounds Read in acpi_nfit_ctl

2024-12-02 Thread Ira Weiny
Suraj Sonawane wrote: > On 11/18/24 21:56, Suraj Sonawane wrote: [snip] > > > > drivers/acpi/nfit/core.c | 7 ++- > > 1 file changed, 6 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/acpi/nfit/core.c b/drivers/acpi/nfit/core.c > > index 5429ec9ef..a5d47819b 100644 > > --- a/dr

[GIT PULL] NVDIMM and DAX for 6.13

2024-11-22 Thread Ira Weiny
Hi Linus, please pull from git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm.git tags/libnvdimm-for-6.13 Changes for the nvdimm tree. Most represent minor cleanups and code removals. One patch fixes potential NULL pointer arithmetic which was benign because the offset of the member

Re: [PATCH v5] acpi: nfit: vmalloc-out-of-bounds Read in acpi_nfit_ctl

2024-11-17 Thread Ira Weiny
Suraj Sonawane wrote: > Fix an issue detected by syzbot with KASAN: > > BUG: KASAN: vmalloc-out-of-bounds in cmd_to_func drivers/acpi/nfit/ > core.c:416 [inline] > BUG: KASAN: vmalloc-out-of-bounds in acpi_nfit_ctl+0x20e8/0x24a0 > drivers/acpi/nfit/core.c:459 > > The issue occurs in cmd_to_func w

Re: [PATCH v4] acpi: nfit: vmalloc-out-of-bounds Read in acpi_nfit_ctl

2024-11-15 Thread Ira Weiny
Suraj Sonawane wrote: > Fix an issue detected by syzbot with KASAN: > > BUG: KASAN: vmalloc-out-of-bounds in cmd_to_func drivers/acpi/nfit/ > core.c:416 [inline] > BUG: KASAN: vmalloc-out-of-bounds in acpi_nfit_ctl+0x20e8/0x24a0 > drivers/acpi/nfit/core.c:459 > > The issue occurs in cmd_to_func w

Re: [PATCH] dax: delete a stale directory pmem

2024-10-18 Thread Ira Weiny
is empty, remove them. > > Fixes: 83762cb5c7c4 ("dax: Kill DEV_DAX_PMEM_COMPAT") > Suggested-by: Vegard Nossum > Signed-off-by: Harshit Mogalapalli Marked for nvdimm-next Thanks! Reviewed-by: Ira Weiny > --- > drivers/dax/pmem/Makefile | 7 --- > drivers/dax

Re: [PATCH 05/35] libnvdimm: Reorganize kerneldoc parameter names

2024-09-30 Thread Ira Weiny
Julia Lawall wrote: > Reorganize kerneldoc parameter names to match the parameter > order in the function header. > > Problems identified using Coccinelle. > > Signed-off-by: Julia Lawall Acked-by: Ira Weiny > > --- > drivers/nvdimm/dimm_devs.c |2 +- >

Re: [PATCH] virtio_pmem: Add freeze/restore callbacks

2024-09-04 Thread Ira Weiny
Philip Chen wrote: > Hi maintainers, > > Can anyone let me know if this patch makes sense? > Any comment/feedback is appreciated. > Thanks in advance! I'm not an expert on virtio but the code looks ok on the surface. I've discussed this with Dan a bit and virtio-pmem is not heavily tested. Base

Re: [PATCH] nvdimm: Use of_property_present() and of_property_read_bool()

2024-09-04 Thread Ira Weiny
Rob Herring wrote: > On Wed, Jul 31, 2024 at 2:14 PM Rob Herring (Arm) wrote: > > > > Use of_property_present() and of_property_read_bool() to test > > property presence and read boolean properties rather than > > of_(find|get)_property(). This is part of a larger effort to remove > > callers of o

Re: [PATCH v2] virtio_pmem: Check device status before requesting flush

2024-08-21 Thread Ira Weiny
Philip Chen wrote: > Hi, > > On Tue, Aug 20, 2024 at 1:01 PM Dave Jiang wrote: > > > > > > > > On 8/20/24 10:22 AM, Philip Chen wrote: > > > If a pmem device is in a bad status, the driver side could wait for > > > host ack forever in virtio_pmem_flush(), causing the system to hang. > > > > > > S

Re: [PATCH v3 2/2] nvdimm: Remove dead code for ENODEV checking in scan_labels()

2024-08-21 Thread Ira Weiny
mespace_pmem() is the only user of > select_pmem_id(), it's safe to remove the 'return -ENODEV' branch. > > Signed-off-by: Li Zhijian Reviewed-by: Ira Weiny > --- > V2: > new patch. > It's found when I'm Reviewing/tracing the return values of

Re: [PATCH v3 1/2] nvdimm: Fix devs leaks in scan_labels()

2024-08-21 Thread Ira Weiny
sync_device_register+0xe/0x50 [libnvdimm] > [<00003f4c52a4>] async_run_entry_fn+0x2e/0x110 > [<e201f4b0>] process_one_work+0x1ee/0x600 > [<6d90d5a9>] worker_thread+0x183/0x350 > > Cc: Dave Jiang > Cc: Ira Weiny > Fixes: 1b40e09a12

Re: [PATCH] virtio_pmem: Check device status before requesting flush

2024-08-20 Thread Ira Weiny
Philip Chen wrote: > On Mon, Aug 19, 2024 at 2:56 PM Ira Weiny wrote: > > > > Philip Chen wrote: > > > If a pmem device is in a bad status, the driver side could wait for > > > host ack forever in virtio_pmem_flush(), causing the system to hang. > > > >

Re: [PATCH] virtio_pmem: Check device status before requesting flush

2024-08-19 Thread Ira Weiny
Philip Chen wrote: > If a pmem device is in a bad status, the driver side could wait for > host ack forever in virtio_pmem_flush(), causing the system to hang. I assume this was supposed to be v2 and you resent this as a proper v2 with a change list from v1? Ira > > Signed-off-by: Philip Chen

Re: [GIT PULL] DAX for 6.11

2024-08-16 Thread Ira Weiny
Ira Weiny wrote: > Hi Linux, please pull from ^ Linus. Apologies, Ira > > https://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm.git/ > tags/libnvdimm-fixes-6.11-rc4 > > To get a fix for filesystem DAX. > > It has been in -next since August 1

[GIT PULL] DAX for 6.11

2024-08-16 Thread Ira Weiny
Hi Linux, please pull from https://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm.git/ tags/libnvdimm-fixes-6.11-rc4 To get a fix for filesystem DAX. It has been in -next since August 12th without any reported issues. Thanks, Ira Weiny --- The following changes since commit

Re: [PATCH v2 1/2] nvdimm: Fix devs leaks in scan_labels()

2024-07-26 Thread Ira Weiny
t; [<391c5a7d>] __device_attach+0xbe/0x1e0 > [<26dabec0>] bus_probe_device+0x94/0xb0 > [<c590d936>] device_add+0x656/0x870 > [<3d69bfaa>] nd_async_device_register+0xe/0x50 [libnvdimm] > [<3f4c52a4>]

[GIT PULL] NVDIMM and DAX for 6.11

2024-07-19 Thread Ira Weiny
) A series of patches to add MODULE_DESCRIPTIONS() to eliminate make W=1 warnings. Erick Archer (1): nvdimm/btt: use sizeof(*pointer) instead of sizeof(type) Ira Weiny (1): testing: nvdimm: Add MODULE_DESCRIPTION() macros

Re: [PATCH] nvdimm: make nd_class constant

2024-06-12 Thread Ira Weiny
r than dynamically create it." > > That works too, want me to resubmit with this, or can I update it when I > commit it to my tree? In that case. Reviewed-by: Ira Weiny > > thanks, > > greg "the changelog is the hardest part" k-h

[PATCH] testing: nvdimm: Add MODULE_DESCRIPTION() macros

2024-06-11 Thread Ira Weiny
drivers. Suggested-by: Jeff Johnson Signed-off-by: Ira Weiny --- Jeff I'm not seeing a patch to cover these cases for the missing module descriptions you have been sending out. If you have an outstanding patch I missed could you point me to it? Otherwise I believe this cleans up the nvdimm

Re: [PATCH RESEND] nvdimm: add missing MODULE_DESCRIPTION() macros

2024-06-10 Thread Ira Weiny
Jeff Johnson wrote: > Fix the 'make W=1' warnings: > WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/nvdimm/libnvdimm.o > WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/nvdimm/nd_pmem.o > WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/nvdimm/nd_btt.o > WARNING: modpo

Re: [PATCH] nvdimm: Fix devs leaks in scan_labels()

2024-06-06 Thread Ira Weiny
Li Zhijian wrote: > Don't allocate devs again when it's valid pointer which has pionted to > the memory allocated above with size (count + 2 * sizeof(dev)). > > A kmemleak reports: > unreferenced object 0x88800dda1980 (size 16): > comm "kworker/u10:5", pid 69, jiffies 4294671781 > hex dump

[GIT PULL] NVDIMM and DAX for 6.10

2024-05-15 Thread Ira Weiny
the current kernel interfaces such as using const for struct device_type and changing the platform remove callback signature. Thank you, Ira Weiny --- The following changes since commit ed30a4a51bb196781c8058073ea720133a65596f: Linux 6.9-rc5 (2024-04-21 12:35:54 -0700) are available in the Git

Re: [PATCH v2] acpi/ghes: Prevent sleeping with spinlock held

2024-02-15 Thread Ira Weiny
Jonathan Cameron wrote: > On Wed, 14 Feb 2024 17:33:18 -0500 > Steven Rostedt wrote: > > > On Wed, 14 Feb 2024 14:19:19 -0800 > > Ira Weiny wrote: > > > > > > > Jonathan Cameron wrote: > > > > > > > > > &g

Re: [PATCH v2] acpi/ghes: Prevent sleeping with spinlock held

2024-02-14 Thread Ira Weiny
Ira Weiny wrote: > Jonathan Cameron wrote: > > On Wed, 14 Feb 2024 10:23:10 -0500 > > Steven Rostedt wrote: > > > > > On Wed, 14 Feb 2024 12:11:53 + > > > Jonathan Cameron wrote: > > > > > > > So I'm thinking this

Re: [PATCH v2] acpi/ghes: Prevent sleeping with spinlock held

2024-02-14 Thread Ira Weiny
Jonathan Cameron wrote: > On Wed, 14 Feb 2024 10:23:10 -0500 > Steven Rostedt wrote: > > > On Wed, 14 Feb 2024 12:11:53 + > > Jonathan Cameron wrote: > > > > > So I'm thinking this is a won't fix - wait for the printk rework to land > > > and > > > assume this will be resolved as well? >

Re: [PATCH v2] acpi/ghes: Prevent sleeping with spinlock held

2024-02-14 Thread Ira Weiny
Jonathan Cameron wrote: > On Wed, 14 Feb 2024 10:23:10 -0500 > Steven Rostedt wrote: > > > On Wed, 14 Feb 2024 12:11:53 + > > Jonathan Cameron wrote: > > > > > So I'm thinking this is a won't fix - wait for the printk rework to land > > > and > > > assume this will be resolved as well? >

Re: [PATCH v2] acpi/ghes: Prevent sleeping with spinlock held

2024-02-14 Thread Ira Weiny
Ira Weiny wrote: > Jonathan Cameron wrote: > > On Tue, 06 Feb 2024 14:15:32 -0800 > > Ira Weiny wrote: > > > > [snip] > > > > diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c > > index 9ff8a439d674..7ee45f22f56f 100644 > > --- a/

Re: [PATCH v2] acpi/ghes: Prevent sleeping with spinlock held

2024-02-14 Thread Ira Weiny
Jonathan Cameron wrote: > On Tue, 06 Feb 2024 14:15:32 -0800 > Ira Weiny wrote: > > > Smatch caught that cxl_cper_post_event() is called with a spinlock held > > or preemption disabled.[1] The callback takes the device lock to > > perform address translation and

[GIT PULL] NVDIMM/NFIT changes for 6.8

2024-01-10 Thread Ira Weiny
Hi Linus, please pull from: git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm.git tags/libnvdimm-for-6.8 ... to get updates to the nvdimm tree. They are a mix of bug fixes and updates to interfaces used by nvdimm. Updates to interfaces include: Use the new scope based manag

Re: [PATCH 3/3] nvdimm/namespace: fix kernel-doc for function params

2023-12-21 Thread Ira Weiny
Randy Dunlap wrote: > > > On 12/21/23 14:32, Ira Weiny wrote: > > Randy Dunlap wrote: > > > > [snip] > > > >> @@ -1656,8 +1664,10 @@ static int select_pmem_id(struct nd_regi > >> /** > >> * create_namespace_pmem - validate interle

Re: [PATCH 2/3] nvdimm/dimm_devs: fix kernel-doc for function params

2023-12-21 Thread Ira Weiny
Ira Weiny wrote: > Randy Dunlap wrote: [snip] > > diff -- a/drivers/nvdimm/dimm_devs.c b/drivers/nvdimm/dimm_devs.c > > --- a/drivers/nvdimm/dimm_devs.c > > +++ b/drivers/nvdimm/dimm_devs.c > > @@ -53,7 +53,10 @@ static int validate_dimm(struct nvdimm_d > > &g

Re: [PATCH 3/3] nvdimm/namespace: fix kernel-doc for function params

2023-12-21 Thread Ira Weiny
t; + * @nd_mapping: container of dpa-resource-root + labels > * @nd_label: target pmem namespace label to evaluate > + * > + * Returns: the created &struct device on success or -errno on error NIT: should this be ERR_PTR(-errno) on error? Generally good to me though. Reviewed-by: Ira

Re: [PATCH 2/3] nvdimm/dimm_devs: fix kernel-doc for function params

2023-12-21 Thread Ira Weiny
dimm' description in > 'nvdimm_allocated_dpa' > dimm_devs.c:844: warning: No description found for return value of > 'nvdimm_allocated_dpa' > > Signed-off-by: Randy Dunlap > Cc: Dan Williams > Cc: Vishal Verma > Cc: Dave Jiang > Cc: Ira Weiny >

Re: [PATCH 1/3] nvdimm/btt: fix btt_blk_cleanup() kernel-doc

2023-12-21 Thread Ira Weiny
on in > 'btt_init' > > Signed-off-by: Randy Dunlap > Cc: Vishal Verma > Cc: Dan Williams > Cc: Dave Jiang > Cc: Ira Weiny Reviewed-by: Ira Weiny > Cc: nvd...@lists.linux.dev > --- > drivers/nvdimm/btt.c |2 +- > 1 file changed, 1 insert

Re: [PATCH v3] ACPI: NFIT: Use cleanup.h helpers instead of devm_*()

2023-12-21 Thread Ira Weiny
Rafael J. Wysocki wrote: > On Wed, Oct 18, 2023 at 6:28 AM Dan Williams wrote: > > > > Michal Wilczynski wrote: > > > The new cleanup.h facilities that arrived in v6.5-rc1 can replace the > > > the usage of devm semantics in acpi_nfit_init_interleave_set(). That > > > routine appears to only be us

Re: [PATCH] [v2] nvdimm-btt: fix several memleaks

2023-12-19 Thread Ira Weiny
dinghao.liu@ wrote: > > Ira Weiny wrote: > > > Dinghao Liu wrote: > > > > [snip] > > > > -static int btt_freelist_init(struct arena_info *arena) > > +static int btt_freelist_init(struct device *dev, struct arena_info *arena) > > > > Bo

Re: [PATCH] [v2] nvdimm-btt: fix several memleaks

2023-12-15 Thread Ira Weiny
Ira Weiny wrote: > Dinghao Liu wrote: [snip] > > > > -static int btt_maplocks_init(struct arena_info *arena) > > +static int btt_maplocks_init(struct device *dev, struct arena_info *arena) > > { > > u32 i; > > > > - arena->map_locks =

Re: [PATCH] [v2] nvdimm-btt: fix several memleaks

2023-12-14 Thread Ira Weiny
Dinghao Liu wrote: > Resources allocated by kcalloc() in btt_freelist_init(), > btt_rtt_init(), and btt_maplocks_init() are not correctly > released in their callers when an error happens. For > example, when an error happens in btt_freelist_init(), its > caller discover_arenas() will directly free

Re: [PATCH] driver core: Add a guard() definition for the device_lock()

2023-12-13 Thread Ira Weiny
prevent new ones from appearing. > > Link: > http://lore.kernel.org/r/657897453dda8_269bd29...@dwillia2-mobl3.amr.corp.intel.com.notmuch > Link: > http://lore.kernel.org/r/6577b0c2a02df_a04c529...@dwillia2-xfh.jf.intel.com.notmuch > Cc: Vishal Verma > Cc: Ira Weiny Reviewed-b

Re: [PATCH v4 2/3] dax/bus: Introduce guard(device) for device_{lock,unlock} flows

2023-12-12 Thread Ira Weiny
these, so change these > where applicable. > > Cc: Joao Martins > Suggested-by: Dan Williams > Signed-off-by: Vishal Verma > Reviewed-by: Ira Weiny

Re: [PATCH] nvdimm-btt: fix a potential memleak in btt_freelist_init

2023-12-08 Thread Ira Weiny
dinghao.liu@ wrote: > > Dave Jiang wrote: [snip] > > That said, this patch does not completely fix freelist from leaking in the > > following error path. > > > > discover_arenas() > > btt_freelist_init() -> ok (memory allocated) > > btt_rtt_init() -> fail > >

Re: [PATCH] nvdimm-btt: fix a potential memleak in btt_freelist_init

2023-12-07 Thread Ira Weiny
Dave Jiang wrote: > [snip] First off thanks for the patch. This code seems to have a few things to clean up. > > On 12/6/23 20:43, Dinghao Liu wrote: > > When an error happens in btt_freelist_init(), its caller > > discover_arenas() will directly free arena, which makes > > arena->freelist al

[GIT PULL] NVDIMM for 6.7

2023-11-01 Thread Ira Weiny
Hi Linus, please pull from: git://git.kernel.org/pub/scm/linux/kernel/git/nvdimm/nvdimm.git tags/libnvdimm-for-6.7 ... to get updates to the nvdimm tree. They are a mix of bug fixes and updates to interfaces used by nvdimm. Bug fixes include: Fix a sleep during spinlock in PREEMPT_RT

Re: [PATCH] testing: nvdimm: make struct class structures constant

2023-10-11 Thread Ira Weiny
> Cc: Dan Williams > Cc: Vishal Verma > Cc: Dave Jiang > Cc: Ira Weiny Tested-by: Ira Weiny Reviewed-by: Ira Weiny > Signed-off-by: Greg Kroah-Hartman > --- > tools/testing/nvdimm/test/ndtest.c | 17 + > tools/testing/nvdimm/test/nfit.c | 14 ++

Re: [PATCH v2] nd_btt: Make BTT lanes preemptible

2023-09-25 Thread Ira Weiny
> Fixes: 5212e11fde4d ("nd_btt: atomic sector updates") > Signed-off-by: Tomas Glozar Thanks for the clarification. Reviewed-by: Ira Weiny

Re: [PATCH] nd_btt: Make BTT lanes preemptible

2023-09-18 Thread Ira Weiny
Tomas Glozar wrote: > čt 14. 9. 2023 v 22:18 odesílatel Ira Weiny napsal: > > Is the bug in 1 of 2 places? > > > > 1) When btt_write_pg()->lock_map() (when the number of lanes is < number > >of cpus) and the lane is acquired is called? > > > >

Re: [PATCH v3] libnvdimm/of_pmem: Use devm_kstrdup instead of kstrdup and check its return value

2023-09-15 Thread Ira Weiny
Chen Ni wrote: > Use devm_kstrdup() instead of kstrdup() and check its return value to > avoid memory leak. > > Fixes: 49bddc73d15c ("libnvdimm/of_pmem: Provide a unique name for bus > provider") > Signed-off-by: Chen Ni Reviewed-by: Ira Weiny > --- > Cha

Re: [PATCH v2 2/2] ACPI: NFIT: use struct_size() helper

2023-09-15 Thread Ira Weiny
Yu Liao wrote: > Make use of the struct_size() helper instead of an open-coded version, > in order to avoid any potential type mistakes or integer overflows that, > in the worst scenario, could lead to heap overflows. > > Signed-off-by: Yu Liao > Reviewed-by: Dave Jiang Revi

Re: [PATCH v2 1/2] ACPI: NFIT: Fix incorrect calculation of idt size

2023-09-15 Thread Ira Weiny
/lkml/2652195.BddDVKsqQX@kreacher/ > > Fixes: 2a5ab99847bd ("ACPICA: struct acpi_nfit_interleave: Replace 1-element > array with flexible array") > Cc: sta...@vger.kernel.org # v6.4+ > Signed-off-by: Yu Liao > Reviewed-by: Dave Jiang Reviewed-by: Ira Weiny > ---

Re: [PATCH] nd_btt: Make BTT lanes preemptible

2023-09-14 Thread Ira Weiny
Tomáš Glozar wrote: > From: Tomas Glozar > > nd_region_acquire_lane uses get_cpu, which disables preemption. This is > an issue on PREEMPT_RT kernels, since btt_write_pg and also > nd_region_acquire_lane itself take a spin lock, resulting in BUG: > sleeping function called from invalid context.

Re: [PATCH v3] libnvdimm/of_pmem: Use devm_kstrdup instead of kstrdup and check its return value

2023-09-14 Thread Ira Weiny
Dave Jiang wrote: > > > On 9/14/23 00:03, Chen Ni wrote: [snip] > > diff --git a/drivers/nvdimm/of_pmem.c b/drivers/nvdimm/of_pmem.c > > index 1b9f5b8a6167..5765674b36f2 100644 > > --- a/drivers/nvdimm/of_pmem.c > > +++ b/drivers/nvdimm/of_pmem.c > > @@ -30,7 +30,13 @@ static int of_pmem_region

Re: [PATCH v2] nvdimm: of_pmem: Check return value and add kfree for kstrdup

2023-08-29 Thread Ira Weiny
Chen Ni wrote: > Check the return value of kstrdup() and add kfree() for kstrdup() to > avoid memory leak. > > Fixes: 49bddc73d15c ("libnvdimm/of_pmem: Provide a unique name for bus > provider") > Signed-off-by: Chen Ni > --- > Changelog: > > v1 -> v2: > > 1.Add a fixes tag. > 2.Update commit

Re: [PATCH v3] libnvdimm/of_pmem: Replace kstrdup with devm_kstrdup and add check

2023-07-10 Thread Ira Weiny
;) > Signed-off-by: Jiasheng Jiang LTGM Reviewed-by: Ira Weiny > --- > Changelog: > > v2 -> v3: > > 1. Correct the usage of devm_kstrdup(). > > v1 -> v2: > > 1. Replace kstrdup() with devm_kstrdup(). > --- > drivers/nvdimm/of_pmem.c | 7 ++- &g

Re: [PATCH] libnvdimm/of_pmem: Add check and kfree for kstrdup

2023-06-23 Thread Ira Weiny
Jiasheng Jiang wrote: > On Wed, Jun 21, 2023 at 00:04:36 +0800, Ira Weiny wrote: > > Ira Weiny wrote: > >> Jiasheng Jiang wrote: [snip] > >> > >> Nice catch! > >> > >> However, this free needs to happen in of_pmem_region_remove() as well.

Re: [PATCH] libnvdimm/of_pmem: Replace kstrdup with devm_kstrdup and add check

2023-06-23 Thread Ira Weiny
Jiasheng Jiang wrote: > Replace kstrdup() with devm_kstrdup() to avoid memory leak and > add check for the return value of the devm_kstrdup() to avoid > NULL pointer dereference > > Fixes: 49bddc73d15c ("libnvdimm/of_pmem: Provide a unique name for bus > provider") > Signed-off-by: Jiasheng Jiang

Re: [PATCH] libnvdimm/of_pmem: Add check and kfree for kstrdup

2023-06-20 Thread Ira Weiny
Ira Weiny wrote: > Jiasheng Jiang wrote: > > Add check for the return value of kstrdup() and return the error > > if it fails in order to avoid NULL pointer dereference. > > Moreover, use kfree() in the later error handling in order to avoid > > memory leak. &

Re: [PATCH] libnvdimm/of_pmem: Add check and kfree for kstrdup

2023-06-20 Thread Ira Weiny
Jiasheng Jiang wrote: > Add check for the return value of kstrdup() and return the error > if it fails in order to avoid NULL pointer dereference. > Moreover, use kfree() in the later error handling in order to avoid > memory leak. > > Fixes: 49bddc73d15c ("libnvdimm/of_pmem: Provide a unique name

Re: [PATCH] dax: include bus.h for definition of run_dax()

2023-06-16 Thread Ira Weiny
Ben Dooks wrote: > The run_dax() prototype is defined in "bus.h" but drivers/dax/super.c > does not include this. Include bus.h to silece the following sparse > warning: > > drivers/dax/super.c:337:6: warning: symbol 'run_dax' was not declared. Should > it be static? A different version of this

Re: [PATCH] nvdimm: make nd_class variable static

2023-06-16 Thread Ira Weiny
Ben Dooks wrote: > The nd_class is not used outside of drivers/nvdimm/bus.c and thus sparse > is generating the following warning. Remove this by making it static: > > drivers/nvdimm/bus.c:28:14: warning: symbol 'nd_class' was not declared. > Should it be static?

[PATCH RFC 4/4] dax/bus: Remove unnecessary reference in alloc_dax_region()

2023-06-02 Thread Ira Weiny
later. Cc: Yongqiang Liu Cc: Dan Williams Cc: Paul Cassella Signed-off-by: Ira Weiny --- drivers/dax/bus.c | 13 ++--- drivers/dax/cxl.c | 4 drivers/dax/hmem/hmem.c | 3 --- drivers/dax/pmem.c | 8 +--- 4 files changed, 7 insertions(+), 21 deletions(-) diff

[PATCH RFC 3/4] dax/cxl: Fix refcount leak in cxl_dax_region_probe()

2023-06-02 Thread Ira Weiny
: 09d09e04d2fc ("cxl/dax: Create dax devices for CXL RAM regions") Cc: Dan Williams Cc: linux-...@vger.kernel.org Signed-off-by: Ira Weiny --- This work was inspired by Yongqiang Liu here: https://lore.kernel.org/all/20221203095858.612027-1-liuyongqian...@huawei.com/ --- drivers/dax/cxl.c |

[PATCH RFC 1/4] dax/bus: Fix leaked reference in alloc_dax_region()

2023-06-02 Thread Ira Weiny
d 'align' attributes") Cc: Dan Williams Signed-off-by: Ira Weiny --- drivers/dax/bus.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/dax/bus.c b/drivers/dax/bus.c index 227800053309..899e29d107b4 100644 --- a/drivers/dax/bus.c +++ b/drivers/d

[PATCH RFC 2/4] dax/hmem: Fix refcount leak in dax_hmem_probe()

2023-06-02 Thread ira . weiny
evice to hmem_register_device") Reviewed-by: Ira Weiny Signed-off-by: Yongqiang Liu --- drivers/dax/hmem/hmem.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/dax/hmem/hmem.c b/drivers/dax/hmem/hmem.c index e5fe8b39fb94..b4831a3d3934 100644 --- a/drivers/dax/h

[PATCH RFC 0/4] dax: Clean up dax_region references

2023-06-02 Thread Ira Weiny
el.org/all/20221203095858.612027-1-liuyongqian...@huawei.com/ Signed-off-by: Ira Weiny --- Ira Weiny (3): dax/bus: Fix leaked reference in alloc_dax_region() dax/cxl: Fix refcount leak in cxl_dax_region_probe() dax/bus: Remove unnecessary reference in alloc_dax_region() Yongqiang Liu (1):

Re: [PATCH] dax/hmem: Fix refcount leak in dax_hmem_probe()

2023-06-02 Thread Ira Weiny
Paul Cassella wrote: > On Fri, 2 Jun 2023, Ira Weiny wrote: > > Paul Cassella wrote: > > > On Sat, 3 Dec 2022, Ira Weiny wrote: > > > > On Sat, Dec 03, 2022 at 09:58:58AM +, Yongqiang Liu wrote: > > > > > > We should always ca

Re: [PATCH] dax/hmem: Fix refcount leak in dax_hmem_probe()

2023-06-02 Thread Ira Weiny
Paul Cassella wrote: > On Sat, 3 Dec 2022, Ira Weiny wrote: > > On Sat, Dec 03, 2022 at 09:58:58AM +, Yongqiang Liu wrote: > > > > We should always call dax_region_put() whenever devm_create_dev_dax() > > > succeed or fail to avoid refcount leak of dax_regio

Re: [PATCH -next] libnvdimm: Fix some kernel-doc comments

2023-02-23 Thread Ira Weiny
s/nvdimm/dimm_devs.c:844: warning: Excess function parameter 'nvdimm' > description in 'nvdimm_allocated_dpa > > Reported-by: Abaci Robot Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4118 Reviewed-by: Ira Weiny > Signed-off-by: Yang Li > --- >

Re: [PATCH] dax/hmem: Fix refcount leak in dax_hmem_probe()

2022-12-03 Thread Ira Weiny
On Sat, Dec 03, 2022 at 09:58:58AM +, Yongqiang Liu wrote: > We should always call dax_region_put() whenever devm_create_dev_dax() > succeed or fail to avoid refcount leak of dax_region. Move the return > value check after dax_region_put(). I think dax_region_put is called from dax_region_unre

Re: [PATCH] dax: Remove usage of the deprecated ida_simple_xxx API

2022-09-26 Thread Ira Weiny
On Sun, Sep 25, 2022 at 09:26:35PM -0400, Bo Liu wrote: > Use ida_alloc_xxx()/ida_free() instead of > ida_simple_get()/ida_simple_remove(). > The latter is deprecated and more verbose. > > Signed-off-by: Bo Liu Reviewed-by: Ira Weiny > --- > drivers/dax/super.c | 6 +++

Re: [PATCH v2] arch/cacheflush: Introduce flush_all_caches()

2022-08-19 Thread Ira Weiny
On Fri, Aug 19, 2022 at 10:10:24AM -0700, Davidlohr Bueso wrote: > With CXL security features, global CPU cache flushing nvdimm requirements > are no longer specific to that subsystem, even beyond the scope of > security_ops. CXL will need such semantics for features not necessarily > limited to pe

Re: [PATCH] dax: Check dev_set_name() return value

2022-08-05 Thread Ira Weiny
On Fri, Aug 05, 2022 at 01:33:19AM -0400, Bo Liu wrote: > It's possible that dev_set_name() returns -ENOMEM, catch and handle this. Did this cause a bug or some other problem when the name was not set? I think it is an ok change but without digging into the code I'm not clear why you did this. I

  1   2   3   4   5   6   7   8   9   10   >