Skip to content

Commit a880bfc

Browse files
authored
Merge pull request #7 from sy-c/master
PDA v11.9.7
2 parents ab0d29e + 4cd69bf commit a880bfc

File tree

6 files changed

+40
-19
lines changed

6 files changed

+40
-19
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
11.8.7
1+
11.9.7

patches/linux_uio/debian/changelog

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
pda-kernel-dkms (0.12.0-1) noble; urgency=medium
2+
3+
* Bugfix: avoid scheduling while atomic
4+
5+
-- Dirk Hutter <[email protected]> Fri, 07 Feb 2025 11:23:28 +0100
6+
17
pda-kernel-dkms (0.11.0-1) noble; urgency=medium
28

39
* Bugfix: correctly initialize kernel memory

patches/linux_uio/dkms.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
PACKAGE_NAME="uio_pci_dma"
2-
PACKAGE_VERSION="0.11.0"
2+
PACKAGE_VERSION="0.12.0"
33
BUILT_MODULE_NAME[0]="uio_pci_dma"
44
DEST_MODULE_LOCATION[0]="/kernel/drivers/uio/"
55
AUTOINSTALL="yes"

patches/linux_uio/make-pda-kadapter-dkms-rpm.sh

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,15 @@
55
66

77

8-
# This is pda GIT tag from https://github.com/cbm-fles/pda
9-
GIT_TAG=11.8.7
8+
# This is pda GIT tag from upstream repository
9+
GIT_REPO=https://github.com/cbm-fles/pda
10+
GIT_TAG=11.9.7
11+
# This is the branch name to take from, if not using the tag. Leave blank to use tag.
12+
GIT_BRANCH=bug_sched_atomic
1013

1114
# This is the base name and version for this dkms package
1215
PKG_NAME=pda-kadapter-dkms
13-
PKG_VERSION=2.1.3
16+
PKG_VERSION=2.1.4
1417

1518
# local build directory
1619
TMPDIR=/tmp/rpm
@@ -47,11 +50,14 @@ mkdir -p ${TMPDIR}/SOURCES ${TMPDIR}/SPECS ${TMPDIR}/BUILD ${TMPDIR}/RPMS ${TMPD
4750
# get source code from upstream
4851
echo "Generating source tarball ${TMPDIR}/SOURCES/${PKG_DIR}.src.tar.gz"
4952
cd ${WDIR}
50-
git clone https://github.com/cbm-fles/pda.git -c advice.detachedHead=false
53+
git clone ${GIT_REPO} -c advice.detachedHead=false
5154
cd pda
5255
git fetch
53-
#git checkout -b fix_sysfs_attr origin/fix_sysfs_attr
54-
git checkout tags/${GIT_TAG}
56+
if [ "$GIT_BRANCH" != "" ]; then
57+
git checkout -b ${GIT_BRANCH} origin/${GIT_BRANCH}
58+
else
59+
git checkout tags/${GIT_TAG}
60+
fi
5561
cd patches/linux_uio
5662

5763
# update source code with local files, if present
@@ -90,25 +96,33 @@ rm -f ${TMPDIR}/SPECS/${SPECFILE}
9096

9197
echo "%define version ${VERSION}" >> ${TMPDIR}/SPECS/${SPECFILE}
9298
echo "%define module ${PKG_NAME}" >> ${TMPDIR}/SPECS/${SPECFILE}
99+
echo "URL: ${GIT_REPO}" >> ${TMPDIR}/SPECS/${SPECFILE}
93100

94101
echo '
95102
Summary: PDA kernel adapter DKMS package
96103
Name: %{module}
97104
Version: %{version}
98105
Release: 0
99106
License: BSD
100-
URL: https://github.com/cbm-fles/pda/
101107
Packager: Sylvain Chapeland <[email protected]>
102108
Group: System Environment/Kernel
103109
BuildArch: noarch
104-
Requires: dkms >= 1.00, kernel-devel, kernel-headers
110+
Requires: dkms >= 1.00, kernel-devel, kernel-headers, kernel-modules
105111
Requires: bash
106112
Source0: %{module}-%{version}.src.tar.gz
107113
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root/
108114
109115
%description
110-
This package contains the PDA kernel adapter wrapped for the DKMS framework.
116+
This package contains the PDA kernel adapter wrapped for the DKMS framework.'\
117+
>> ${TMPDIR}/SPECS/${SPECFILE}
118+
119+
if [ "$GIT_BRANCH" != "" ]; then
120+
echo "Built from repository ${GIT_REPO} branch ${GIT_BRANCH}" >> ${TMPDIR}/SPECS/${SPECFILE}
121+
else
122+
echo "Built from repository ${GIT_REPO} tag ${GIT_TAG}" >> ${TMPDIR}/SPECS/${SPECFILE}
123+
fi
111124

125+
echo '
112126
%prep
113127
%setup
114128

patches/linux_uio/uio_pci_dma.c

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,8 @@ struct uio_pci_dma_device
7171
bool msi_enabled;
7272
};
7373

74-
spinlock_t alloc_free_lock;
74+
DEFINE_MUTEX(alloc_free_lock);
75+
7576
static inline int
7677
uio_pci_dma_allocate_kernel_memory(struct uio_pci_dma_private *priv);
7778

@@ -255,7 +256,7 @@ probe
255256
struct kset *kset;
256257
bool msi_enabled = false;
257258

258-
spin_lock_init(&alloc_free_lock);
259+
mutex_init(&alloc_free_lock);
259260

260261
/* attr_bin_request */
261262
BIN_ATTR_PDA(request, sizeof(struct uio_pci_dma_private), S_IWUSR | S_IWGRP,
@@ -525,7 +526,7 @@ BIN_ATTR_WRITE_CALLBACK( request_buffer_write )
525526
if(count != sizeof(struct uio_pci_dma_private) )
526527
{ UIO_PDA_ERROR("Invalid size of request struct -> aborting!\n", exit); }
527528

528-
spin_lock(&alloc_free_lock);
529+
mutex_lock(&alloc_free_lock);
529530

530531
UIO_DEBUG_PRINTF("MB = %zu are requested\n", (request->size/MB_SIZE) );
531532

@@ -589,7 +590,7 @@ BIN_ATTR_WRITE_CALLBACK( request_buffer_write )
589590

590591
kobject_uevent(&priv->kobj, KOBJ_ADD);
591592

592-
spin_unlock(&alloc_free_lock);
593+
mutex_unlock(&alloc_free_lock);
593594

594595
UIO_DEBUG_RETURN(sizeof(struct uio_pci_dma_private));
595596

@@ -616,7 +617,7 @@ BIN_ATTR_WRITE_CALLBACK( request_buffer_write )
616617
priv = NULL;
617618
}
618619

619-
spin_unlock(&alloc_free_lock);
620+
mutex_unlock(&alloc_free_lock);
620621

621622
UIO_DEBUG_RETURN(-1);
622623
}
@@ -970,7 +971,7 @@ BIN_ATTR_WRITE_CALLBACK( delete_buffer_write )
970971
{
971972
UIO_DEBUG_ENTER();
972973

973-
spin_lock(&alloc_free_lock);
974+
mutex_lock(&alloc_free_lock);
974975

975976
struct bin_attribute attrib;
976977
char tmp_string[UIO_PCI_DMA_BUFFER_NAME_SIZE];
@@ -994,7 +995,7 @@ BIN_ATTR_WRITE_CALLBACK( delete_buffer_write )
994995
else
995996
{ printk(DRIVER_NAME " : freeing of buffer %s failed!\n", tmp_string); }
996997

997-
spin_unlock(&alloc_free_lock);
998+
mutex_unlock(&alloc_free_lock);
998999

9991000
UIO_DEBUG_RETURN(count);
10001001
}

patches/linux_uio/uio_pci_dma.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
#define LINUX_VERSION_CODE KERNEL_VERSION(2,6,35)
4949
*/
5050

51-
#define UIO_PCI_DMA_VERSION "0.11.0"
51+
#define UIO_PCI_DMA_VERSION "0.12.0"
5252
#define UIO_PCI_DMA_MINOR "0"
5353

5454
#define UIO_PCI_DMA_SUCCESS 0

0 commit comments

Comments
 (0)