Saturday, 2020-12-26

*** tpb has joined #litex00:00
*** lf has quit IRC00:28
*** lf_ has joined #litex00:28
somloshorne: thanks, all taken care of; and no, I hadn't seen that particular post before :)00:31
*** _whitelogger has quit IRC00:39
*** _whitelogger has joined #litex00:41
*** futarisIRCcloud has joined #litex02:19
*** _whitelogger has quit IRC02:57
*** _whitelogger has joined #litex02:59
*** _whitelogger has quit IRC03:54
*** _whitelogger has joined #litex03:56
*** Degi has quit IRC04:51
*** Degi has joined #litex04:53
*** Bertl_oO is now known as Bertl_zZ05:15
*** lambda has quit IRC07:40
*** lambda has joined #litex07:41
*** futarisIRCcloud has quit IRC07:49
*** lambda has quit IRC08:55
*** lambda has joined #litex08:58
*** _whitelogger has quit IRC09:27
*** _whitelogger has joined #litex09:29
*** leons has quit IRC10:40
*** leons has joined #litex10:53
*** lkcl has quit IRC11:32
*** lkcl has joined #litex11:45
*** futarisIRCcloud has joined #litex12:20
*** McJ19 has joined #litex13:08
*** McJ19 has quit IRC14:35
*** noziar has joined #litex14:53
*** noziar has quit IRC14:55
*** noziar has joined #litex15:02
*** noziar is now known as noziar215:03
*** noziar2 is now known as noziar15:03
*** noziar has quit IRC15:04
*** noziar has joined #litex15:05
*** noziar is now known as noziar215:06
*** noziar2 is now known as noziar15:06
*** martinraison has joined #litex15:07
*** noziar has quit IRC15:08
*** martinraison has quit IRC15:16
*** martinraison has joined #litex15:20
*** martinraison has quit IRC15:31
*** Bertl_zZ is now known as Bertl15:36
*** peeps[zen] has joined #litex17:19
*** peepsalot has quit IRC17:20
*** martinraison has joined #litex17:28
*** martinraison has quit IRC18:20
*** Dolu has joined #litex21:01
*** peeps[zen] is now known as peepsalot22:03
shornesomlo: great, I for me the changes look good, I will wait to see if any other reviewers pick anything up22:15
somloshorne: thanks! meanwhile, I have one more (small) change lined up for a v5: https://github.com/torvalds/linux/commit/da3fd1ca77e231b1f4d2b919b94e730d204ce51f#diff-e35c5e0b59bc8b9a4520b4b13c00cf8f4ff702786dc5cfc7a525806447867b10R7822:29
somloit's a small extra tightening of litex_set_reg() compared to what's in v4 right now22:30
somlofewer variables, same effect22:30
somloalso, I've been thinking: I'm a bit uncomfortable exposing litex_[get|set]_reg() publicly as-is; would like to rename them to _litex_[get|set]_reg(), and use them internally from within litex_[read|write][8|16|32|64](); For "externally visible" purposes, I'd like the litex_[get|set]_reg() wrappers to check reg_size and throw some sort of error if it's outside the [1,8] interval (inclusive)22:32
somlothis latter thing would be a separate patch, of course22:33
somlojust looking for good examples on how to throw an error (which would have to be run-time, as call sites could pass in any valid "size_t" argument for reg_size...)22:34
shorneAlso, some minor points, usually on each commit we add "Changes since vN:", in the dead space after "---" explained here https://kernelnewbies.org/PatchTipsAndTricks22:34
tpbTitle: PatchTipsAndTricks - Linux Kernel Newbies (at kernelnewbies.org)22:34
shorneoh sorry, I didn't mean to post that22:34
shorneI am sending that on a mail now22:34
somlowhich is also why I don't want to do the error check as part of litex_[read|write][8|16|32|64]() (where the reg_size is a compile-time constant, and guaranteed to be in the right interval) :)22:35
somloah, I've been doing that in the cover letter, but could certainly do it inside each commit as well22:35
shornesomlo: Its not a big thing for me, or since this series is not huge, but for others it may be hard to understand what is changing22:36
somlomakes sense22:36
shorneMaybe move litex_get|set_reg back into the .c file so its not exposed? I guess it could still be inline22:38
somloThey used to be explicitly exported via "EXPORT_SYMBOL_GPL()" for generic/arbitrary width registers22:39
shorneright22:40
somloright now they're not used by any LiteX driver I know of (see https://github.com/torvalds/linux/compare/master...litex-hub:litex-rebase) -- everyone just uses litex_[read|write][8|16|32|64]()22:42
somloso we can explicitly "unpublish" litex_[get|set]_reg() by prefixing them with a _ (iirc that's the convention for "don't call this directly as there's no promise it'll stay the same)22:43
somloso that litex_[read|write][8|16|32|64]() can still use them22:44
shorneyeah, it makes sense22:44
somloand for "public consumption" we either add wrappers with error checking (and those can go into the soc driver file or stay in the header, I don't care much), or we can *not* do that until it becomes necessary :)22:45
shorneI think usually the kernel uses 2 _, so it would be __litex_[get|set]_reg()22:46
shornehave a look around how they do it22:46
somloactually I'm lying, some of the un-"curated" drivers that still only target 8-bit CSR data width do in fact use them directly, so adding wrappers is back on my todo list :)22:47
somloright, the more underscores prefix a thing, the more "mere mortals" are discouraged from using it :)22:48
somloI'll figure out the right amount of underscores for v5 as well22:48
somlosoon as I figure out how to deal with a failed error check on "reg_size" :)22:49
somloI did check-patch and get_maintainer for v1; I'll run another checkpatch before v522:52
somloI've been doing `git send-email -3 -vX --cover-letter --annotate` which is why adding change logs to individual patches wasn't on my radar... guess I'll get back to doing separate git-format-patch commands and tweaking the ascii patch files before sending the emails :)22:54
somloshorne: I guess the canonical way to do error checking would be something like "if (reg_size < 1 || reg_size > 8) { pr_info(...); BUG(); }"23:47
*** lkcl has quit IRC23:48
somlonow trying to figure out the tradeoff between BUG() and WARN(), former feels more appropriate, since we're waaay off the reservation if the condition fails...23:48
daveshahBUG_ON might be even neater?23:52
daveshahUnless you really need the pr_info23:52

Generated by irclog2html.py 2.17.2 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!