aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2020-11-26can: gs_usb: fix endianess problem with candleLight firmwareMarc Kleine-Budde1-61/+70
The firmware on the original USB2CAN by Geschwister Schneider Technologie Entwicklungs- und Vertriebs UG exchanges all data between the host and the device in host byte order. This is done with the struct gs_host_config::byte_order member, which is sent first to indicate the desired byte order. The widely used open source firmware candleLight doesn't support this feature and exchanges the data in little endian byte order. This breaks if a device with candleLight firmware is used on big endianess systems. To fix this problem, all u32 (but not the struct gs_host_frame::echo_id, which is a transparent cookie) are converted to __le32. Cc: Maximilian Schneider <[email protected]> Cc: Hubert Denkmair <[email protected]> Reported-by: Michael Rausch <[email protected]> Link: https://lore.kernel.org/r/[email protected] Tested-by: Oleksij Rempel <[email protected]> Fixes: d08e973a77d1 ("can: gs_usb: Added support for the GS_USB CAN devices") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Marc Kleine-Budde <[email protected]>
2020-11-26MAINTAINERS: Adding help for coresight subsystemMathieu Poirier1-1/+3
With the steady stream of new features coming into the subsystem it has been clear for some time now that help is needed. Suzuki and Leo have worked extensively on various parts of the project and have agreed to help. While at it add the new location for the coresight git tree. Acked-by: Leo Yan <[email protected]> Acked-by : Suzuki K Poulose <[email protected]> Signed-off-by: Mathieu Poirier <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2020-11-26Merge tag 'drm-intel-fixes-2020-11-25' of ↵Dave Airlie7-63/+161
git://anongit.freedesktop.org/drm/drm-intel into drm-fixes - Fix Perf/OA workaround register corruption (Lionel) - Correct a comment statement in GVT (Yan) - Fix GT enable/disable iterrupts, including a race condition that prevented GPU to go idle (Chris) - Free stale request on destroying the virtual engine (Chris) Signed-off-by: Dave Airlie <[email protected]> From: Rodrigo Vivi <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-11-26Merge tag 'amd-drm-fixes-5.10-2020-11-25' of ↵Dave Airlie5-12/+17
git://people.freedesktop.org/~agd5f/linux into drm-fixes amd-drm-fixes-5.10-2020-11-25: amdgpu: - Runtime pm fix - SI UVD suspend/resume fix - HDCP fix for headless cards - Sienna Cichlid golden register update Signed-off-by: Dave Airlie <[email protected]> From: Alex Deucher <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-11-26media: vidtv.rst: add kernel-doc markupsMauro Carvalho Chehab10-32/+70
Fix existing issues at the kernel-doc markups and add them to the vidtv.rst file. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-11-26media: vidtv.rst: update vidtv documentationMauro Carvalho Chehab1-13/+72
Update the vidtv documentation with the relevant changes after the last patches. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-11-26media: vidtv: simplify EIT write functionMauro Carvalho Chehab3-44/+46
- pass struct vidtv_psi_eit_write_args as a pointer; - avoid initializing struct fields multiple times. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-11-26media: vidtv: simplify NIT write functionMauro Carvalho Chehab3-48/+47
- pass struct vidtv_psi_nit_write_args as a pointer; - avoid initializing struct fields multiple times. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-11-26media: vidtv: simplify SDT write functionMauro Carvalho Chehab3-43/+46
- pass struct vidtv_psi_sdt_write_args as a pointer; - avoid initializing struct fields multiple times. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-11-26media: vidtv: cleanup PMT write table functionMauro Carvalho Chehab3-49/+46
- Pass struct vidtv_psi_pmt_write_args as a pointer; - Avoid initializing structs multiple times. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-11-26media: vidtv: cleanup PAT write functionMauro Carvalho Chehab3-29/+32
Avoid initializing the structs multiple times and pass the PAT struct as a pointer, instead of a var. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-11-26media: vidtv: cleanup PSI table header functionMauro Carvalho Chehab1-23/+19
- Pass struct header_write_args as a pointer, instead of passing as a var; - Initialize the psi_args struct only once. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-11-26media: vidtv: cleanup PSI descriptor write functionMauro Carvalho Chehab1-53/+51
This function initializes the psi_args twice, and receives a struct, instead of a pointer to a struct. Clean it up. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-11-26media: vidtv: simplify the crc writing logicMauro Carvalho Chehab1-21/+18
Cleanup the table_section_crc32_write_into() function by initializing struct psi_write_args only once and by passing the args as a pointer. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-11-26media: vidtv: simplify PSI write functionMauro Carvalho Chehab1-67/+63
The function vidtv_psi_ts_psi_write_into() initializes the ts_header fields several times, and receives a struct as argument, instead of using a pointer to struct. Cleanup the function, in order to reduce its stack usage and to avoid initializing the ts_header multiple times. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-11-26media: vidtv: add date to the current eventMauro Carvalho Chehab1-3/+41
The current event is using an undefined date. Instead, it should be the timestamp when the EIT table was generated. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-11-26media: vidtv: fix service_id at SDT tableMauro Carvalho Chehab3-4/+7
The service_id there should be equal to the one used on other tables, otherwise, EIT entries won't be valid. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-11-26media: vidtv: fix service typeMauro Carvalho Chehab2-1/+2
As the service currently broadcasts just audio, change the service type to reflect that. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-11-26media: vidtv: add a PID entry for the NIT tableMauro Carvalho Chehab4-17/+39
On normal TS streams, the NIT table has its own entry at PAT, but not at PMT. While here, properly handle alloc problems when creating PMT entries. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-11-26media: vidtv: properly fill EIT service_idMauro Carvalho Chehab3-4/+7
The EIT header ID field should not contain the network ID, but, instead, the service_id of the program described at EIT. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-11-26media: vidtv: fix the network ID rangeMauro Carvalho Chehab2-2/+2
As defined at ETSI TS 101 162, original network IDs up to 0xfebf are reserved for registration at dvb.org. Let's use, instead, an original network ID at the range 0xff00-0xffff, as this is for private temporary usage. As the same value is also used for the network ID, the range 0xff01-0xffff also fits better, as values lower than that depend if the network is used for satellite, terrestrial, cable of CI. While here, move the TS ID to the bridge code, where it is used, and change its value, as it was identical to the value previously used by network ID. While we could keep the same value, let's change it, just to make easier to check for the new code while reading it with DVB tools like dvbinspector. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-11-26media: vidtv: improve EIT dataMauro Carvalho Chehab1-2/+2
Place some text at EIT data, and use ISO 8859-15 encoding for the German letter "ü" (u mit umlat) letter. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-11-26media: vidtv: cleanup null packet initialization logicMauro Carvalho Chehab1-4/+5
Initialize the destination buffer/size and the initial offset when creating the local var. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-11-26media: vidtv: pre-initialize mux arraysMauro Carvalho Chehab1-20/+26
Instead of first zeroing all fields at the mux structs and then filling, do some initialization for the const data when they're created. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-11-26media: vidtv: remove some unused functionsMauro Carvalho Chehab1-35/+0
Right now, there's no need to access the length of some tables. So, drop the unused functions. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-11-26media: vidtv: do some cleanups at the driverMauro Carvalho Chehab7-191/+182
Do some cleanups at the coding style of the driver: - remove "inline" declarations; - use reverse xmas-tree for local var declarations; - Adjust some indent to avoid breaking 80-cols; - Cleanup some comments. No functional changes. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-11-26drm/nouveau: fix relocations applying logic and a double-freeMatti Hamalainen1-3/+5
Commit 03e0d26fcf79 ("drm/nouveau: slowpath for pushbuf ioctl") included a logic-bug which results in the relocations not actually getting applied at all as the call to nouveau_gem_pushbuf_reloc_apply() is never reached. This causes a regression with graphical corruption, triggered when relocations need to be done (for example after a suspend/resume cycle.) Fix by setting *apply_relocs value only if there were more than 0 relocations. Additionally, the never reached code had a leftover u_free() call, which, after fixing the logic, now got called and resulted in a double-free. Fix by removing one u_free(), moving the other and adding check for errors. Cc: Daniel Vetter <[email protected]> Cc: Ben Skeggs <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Matti Hamalainen <[email protected]> Fixes: 03e0d26fcf79 ("drm/nouveau: slowpath for pushbuf ioctl") References: https://gitlab.freedesktop.org/drm/nouveau/-/issues/11 Signed-off-by: Daniel Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2020-11-26media: vidtv: avoid copying data for PES structsMauro Carvalho Chehab3-108/+102
Minimize the number of data copies and initialization at the code, passing them as pointers instead of duplicating the data. The only case where we're keeping the data copy is at vidtv_pes_write_h(), as it needs a copy of the passed arguments. On such case, we're being more explicit. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-11-26media: vidtv: avoid data copy when initializing the multiplexerMauro Carvalho Chehab3-28/+30
Initialize the fields of the arguments directly when declaring it, and pass the args as a pointer, instead of copying them. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-11-26media: vidtv: fix some notes at the tone generatorMauro Carvalho Chehab1-18/+20
The sheet music used to generate the tones had a few polyphonic notes. Due to that, its conversion to a tones sequence had a few errors. Also, due to a bug at the tone generator, it was missing the pause at the initial compass. Fix them. While here, reduce the compass to 100bpm. The music was converted from a Music XML file using this small script: <snip> my $count = 0; my $silent = 0; my $note; my $octave; print "\t"; while (<>) { $note = $1 if (m,\<step\>(.*)\</step\>,); $octave = "_$1" if (m,\<octave\>(.*)\</octave\>,); if (m,\<alter\>1\</alter\>,) { $note .= "S"; $sharp = 1; } if (m,\<rest/\>,) { $note = "SILENT"; $silent = 1; } if (m,\<duration\>(.*)\</duration\>,) { printf "{ NOTE_${note}${octave}, %d},", $1 * 128 / 480; $count++; if ($silent || $count >= 3) { print "\n\t"; $count = 0; $silent = 0; } else { print " "; print " " if (!$sharp); } $sharp = 0; $note = ""; $octave = ""; }; }; print "\n"; </snip> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-11-26media: vidtv: fix the tone generator logicMauro Carvalho Chehab2-11/+5
The tone generator logic were repeating the song after the first silent. There's also a wrong logic at the note offset calculus, which may create some noise. Fix it. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-11-26media: vidtv: fix the name of the programMauro Carvalho Chehab2-6/+6
While the original plan was to use the first movement of the 5th Symphony, it was opted to use the Für Elise song, instead. Fix it. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-11-26media: vidtv: don't use recursive functionsMauro Carvalho Chehab1-34/+41
The Linux stack is too short. So, using recursive functions is a very bad idea. Convert those into non-recursive ones. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-11-26media: vidtv: add error checksMauro Carvalho Chehab6-67/+289
Currently, there are not checks if something gets bad during memory allocation: it will simply use NULL pointers and crash. Add error path at the logic which allocates memory for the MPEG-TS generator code, propagating the errors up to the vidtv_bridge. Now, if something wents bad, start_streaming will return an error that userspace can detect: ERROR DMX_SET_PES_FILTER failed (PID = 0x2000): 12 Cannot allocate memory and the driver doesn't crash. Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-11-26media: vidtv: reorganize includesMauro Carvalho Chehab18-46/+46
- Place the includes on alphabetical order; - get rid of asm/byteorder.h; - add bug.h at vidtv_s302m.c, as it is needed by inux/fixp-arith.h Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-11-26media: vidtv: psi: fix missing assignments in while loopsDaniel W. S. Almeida1-12/+10
Some variables were only assigned once but were used in while loops as if they had been updated at every iteration. Fix this. Signed-off-by: Daniel W. S. Almeida <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-11-26media: vidtv: Move s302m specific fields into encoder contextDaniel W. S. Almeida3-14/+17
A few fields used only by the tone generator in the s302m encoder are stored in struct vidtv_encoder. Move them into struct vidtv_s302m_ctx instead. While we are at it: fix a checkpatch warning for long lines. Signed-off-by: Daniel W. S. Almeida <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-11-26media: vidtv: psi: extract descriptor chaining code into a helperDaniel W. S. Almeida1-34/+15
The code to append a descriptor to the end of a chain is repeated throughout the psi generator code. Extract it into its own helper function to avoid cluttering. Signed-off-by: Daniel W. S. Almeida <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-11-26media: vidtv: psi: Implement an Event Information Table (EIT)Daniel W. S. Almeida7-9/+523
Implement an Event Information Table (EIT) as per EN 300 468 5.2.4. The EIT provides information in chronological order regarding the events contained within each service. For now only present event information is supported. [[email protected]: removed an extra blank line] Signed-off-by: Daniel W. S. Almeida <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-11-26media: vidtv: psi: add a Network Information Table (NIT)Daniel W. S. Almeida7-12/+545
Add a Network Information Table (NIT) as specified in ETSI EN 300 468. This table conveys information relating to the physical organization of the multiplexes carried via a given network and the characteristics of the network itself. It is conveyed in the output of vidtv as packets with TS PID of 0x0010 [[email protected]: removed an extra blank line] Signed-off-by: Daniel W. S. Almeida <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-11-26media: vidtv: extract the initial CRC value to into a #defineDaniel W. S. Almeida1-3/+4
The same constant (0xffffffff) is used in three different functions. Extract it into a #define to avoid repetition. Signed-off-by: Daniel W. S. Almeida <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
2020-11-25ch_ktls: lock is not freedRohit Maheshwari1-1/+3
Currently lock gets freed only if timeout expires, but missed a case when HW returns failure and goes for cleanup. Fixes: efca3878a5fb ("ch_ktls: Issue if connection offload fails") Signed-off-by: Rohit Maheshwari <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2020-11-25net/tls: Protect from calling tls_dev_del for TLS RX twiceMaxim Mikityanskiy2-1/+10
tls_device_offload_cleanup_rx doesn't clear tls_ctx->netdev after calling tls_dev_del if TLX TX offload is also enabled. Clearing tls_ctx->netdev gets postponed until tls_device_gc_task. It leaves a time frame when tls_device_down may get called and call tls_dev_del for RX one extra time, confusing the driver, which may lead to a crash. This patch corrects this racy behavior by adding a flag to prevent tls_device_down from calling tls_dev_del the second time. Fixes: e8f69799810c ("net/tls: Add generic NIC offload infrastructure") Signed-off-by: Maxim Mikityanskiy <[email protected]> Signed-off-by: Saeed Mahameed <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2020-11-25Merge branch 'devlink-port-attribute-fixes'Jakub Kicinski1-1/+6
Parav Pandit says: ==================== devlink port attribute fixes This patchset contains 2 small fixes for devlink port attributes. Patch summary: Patch-1 synchronize the devlink port attribute reader with net namespace change operation Patch-2 Ensure to return devlink port's netdevice attributes when netdev and devlink instance belong to same net namespace ==================== Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2020-11-25devlink: Make sure devlink instance and port are in same net namespaceParav Pandit1-1/+2
When devlink reload operation is not used, netdev of an Ethernet port may be present in different net namespace than the net namespace of the devlink instance. Ensure that both the devlink instance and devlink port netdev are located in same net namespace. Fixes: 070c63f20f6c ("net: devlink: allow to change namespaces during reload") Signed-off-by: Parav Pandit <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
2020-11-25devlink: Hold rtnl lock while reading netdev attributesParav Pandit1-0/+4
A netdevice of a devlink port can be moved to different net namespace than its parent devlink instance. This scenario occurs when devlink reload is not used. When netdevice is undergoing migration to net namespace, its ifindex and name may change. In such use case, devlink port query may read stale netdev attributes. Fix it by reading them under rtnl lock. Fixes: bfcd3a466172 ("Introduce devlink infrastructure") Signed-off-by: Parav Pandit <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
2020-11-25ptp: clockmatrix: bug fix for idtcm_strverscmpMin Li1-33/+16
Feed kstrtou8 with NULL terminated string. Changes since v1: -Use sscanf to get rid of adhoc string parse. Changes since v2: -Check if sscanf returns 3. Fixes: 7ea5fda2b132 ("ptp: ptp_clockmatrix: update to support 4.8.7 firmware") Signed-off-by: Min Li <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2020-11-25IB/hfi1: Ensure correct mm is used at all timesDennis Dalessandro8-49/+79
Two earlier bug fixes have created a security problem in the hfi1 driver. One fix aimed to solve an issue where current->mm was not valid when closing the hfi1 cdev. It attempted to do this by saving a cached value of the current->mm pointer at file open time. This is a problem if another process with access to the FD calls in via write() or ioctl() to pin pages via the hfi driver. The other fix tried to solve a use after free by taking a reference on the mm. To fix this correctly we use the existing cached value of the mm in the mmu notifier. Now we can check in the insert, evict, etc. routines that current->mm matched what the notifier was registered for. If not, then don't allow access. The register of the mmu notifier will save the mm pointer. Since in do_exit() the exit_mm() is called before exit_files(), which would call our close routine a reference is needed on the mm. We rely on the mmgrab done by the registration of the notifier, whereas before it was explicit. The mmu notifier deregistration happens when the user context is torn down, the creation of which triggered the registration. Also of note is we do not do any explicit work to protect the interval tree notifier. It doesn't seem that this is going to be needed since we aren't actually doing anything with current->mm. The interval tree notifier stuff still has a FIXME noted from a previous commit that will be addressed in a follow on patch. Cc: <[email protected]> Fixes: e0cf75deab81 ("IB/hfi1: Fix mm_struct use after free") Fixes: 3faa3d9a308e ("IB/hfi1: Make use of mm consistent") Link: https://lore.kernel.org/r/[email protected] Suggested-by: Jann Horn <[email protected]> Reported-by: Jason Gunthorpe <[email protected]> Reviewed-by: Ira Weiny <[email protected]> Reviewed-by: Mike Marciniszyn <[email protected]> Signed-off-by: Dennis Dalessandro <[email protected]> Signed-off-by: Jason Gunthorpe <[email protected]>
2020-11-25enetc: Let the hardware auto-advance the taprio base-time of 0Vladimir Oltean1-12/+2
The tc-taprio base time indicates the beginning of the tc-taprio schedule, which is cyclic by definition (where the length of the cycle in nanoseconds is called the cycle time). The base time is a 64-bit PTP time in the TAI domain. Logically, the base-time should be a future time. But that imposes some restrictions to user space, which has to retrieve the current PTP time from the NIC first, then calculate a base time that will still be larger than the base time by the time the kernel driver programs this value into the hardware. Actually ensuring that the programmed base time is in the future is still a problem even if the kernel alone deals with this. Luckily, the enetc hardware already advances a base-time that is in the past into a congruent time in the immediate future, according to the same formula that can be found in the software implementation of taprio (in taprio_get_start_time): /* Schedule the start time for the beginning of the next * cycle. */ n = div64_s64(ktime_sub_ns(now, base), cycle); *start = ktime_add_ns(base, (n + 1) * cycle); There's only one problem: the driver doesn't let the hardware do that. It interferes with the base-time passed from user space, by special-casing the situation when the base-time is zero, and replaces that with the current PTP time. This changes the intended effective base-time of the schedule, which will in the end have a different phase offset than if the base-time of 0.000000000 was to be advanced by an integer multiple of the cycle-time. Fixes: 34c6adf1977b ("enetc: Configure the Time-Aware Scheduler via tc-taprio offload") Signed-off-by: Vladimir Oltean <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2020-11-25gro_cells: reduce number of synchronize_net() callsEric Dumazet1-1/+6
After cited commit, gro_cells_destroy() became damn slow on hosts with a lot of cores. This is because we have one additional synchronize_net() per cpu as stated in the changelog. gro_cells_init() is setting NAPI_STATE_NO_BUSY_POLL, and this was enough to not have one synchronize_net() call per netif_napi_del() We can factorize all the synchronize_net() to a single one, right before freeing per-cpu memory. Fixes: 5198d545dba8 ("net: remove napi_hash_del() from driver-facing API") Signed-off-by: Eric Dumazet <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>