-
Notifications
You must be signed in to change notification settings - Fork 911
Madura DPD #3016
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Madura DPD #3016
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looked into the ci output to check sanity. the two new warnings seems to be valid, I highlighted with comments.
There are extra warnings outside touched lines, that would be nice to progressively resolve.
In the files changed tab, action summary page, and log file, you can see the ci warnings
drivers/iio/adc/adrv902x/adrv9025.c
Outdated
|
|
||
| ret = sysfs_create_bin_file(&indio_dev->dev.kobj, &phy->bin); | ||
| if (ret < 0) | ||
| return ret; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From ci: shouldn't this go to the error de-initialization path?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it should, thank you! I will update the function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also do not use the above function. Directly accessing a fundamental thing as kobjects from a driver is a very strong sign of something very odd. Use the device_create_bin_file() wrapper.
drivers/iio/adc/adrv902x/adrv9025.c
Outdated
|
|
||
| ret = sscanf(line, "%hhu %hhu %hhu %hhu %s", &i, &j, &k, &lut, coef); | ||
| if (ret != 5) | ||
| return ret; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From ci: this is never a error code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True. I wonder if an error message should be displayed before returning -EINVAL?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Likely yes 😉
ddd8c1a to
1457283
Compare
|
V2
|
| return 0; | ||
|
|
||
| out_remove_device_bin: | ||
| device_remove_bin_file(&phy->indio_dev->dev, &phy->bin); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't you remove the bin file at the remove method as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Thanks!
drivers/iio/adc/adrv902x/adrv9025.c
Outdated
| !!(phy->cal_mask.calMask & val)); | ||
| break; | ||
| case ADRV9025_CAL_MASK: | ||
| ret = sprintf(buf, "%d\n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This may be outside the scope of this PR as it looks like a minor addition, but sysfs_emit() should be used instead of sprintf() for sysfs attributes (proper bounds checking, preferred kernel way. Just a thought, might be a chance to modernise the sysfs methods of the driver.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi, Vas! You are right, thank you for the observation. However, I used sprintf to keep the current structure of the driver unchanged. I am also not completely sure that we should include this refactoring in this PR, since the current version was tested as it is. From my point of view, DPD is a fairly complex addition to the driver. Do you have any recommendation regarding this @gastmaier , @nunojsa ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I do agree we should modernize it (because copy paste is a fairly common practice for these devices and we do not want to copy old APIs all over).
That said, it needs to be in it's own patch (a precursor patch) and it should be pretty safe to do it even in this PR. I mean, it should be a matter of s/sprintf/sysfs_emit (or using an IDE replace kind of thing).
1457283 to
188092e
Compare
|
V3
|
188092e to
a0111c2
Compare
|
V4
|
a0111c2 to
243ed4c
Compare
|
V5
|
567c271 to
db4f953
Compare
Address CI warnings. No functional change. Signed-off-by: George Mois <[email protected]>
Use sysfs_emit instead of sprintf. Use safe functions for formatting buffers. Signed-off-by: George Mois <[email protected]>
Add Orx to Tx mapping setting functionality. Signed-off-by: George Mois <[email protected]>
Add external path delay initial calibration selection. Signed-off-by: George Mois <[email protected]>
Add an IIO attribute that allows changing the calibration mask. Signed-off-by: George Mois <[email protected]>
Add a bin_attribute for loading the data structure to hold Tx DPD Model initialization parameters, without floats. Signed-off-by: George Mois <[email protected]>
Add IIO attribute for selecting the target Tx channel for DPD. Signed-off-by: George Mois <[email protected]>
Add IIO attribute for resetting DPD. Signed-off-by: George Mois <[email protected]>
Add DEBUGF attribut for getting DPD status on each of the 4 Tx channels. Signed-off-by: George Mois <[email protected]>
Add tracking configuration settings. Signed-off-by: George Mois <[email protected]>
Add IIO attribute for enabling DPD. Signed-off-by: George Mois <[email protected]>
db4f953 to
523346f
Compare
|
V6
|
PR Description
Add DPD functionality to the Madura driver.
PR Type
PR Checklist