aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
AgeCommit message (Collapse)AuthorFilesLines
2022-02-04cfg80211/mac80211: assume CHECKSUM_COMPLETE includes SNAPJohannes Berg1-0/+3
There's currently only one driver that reports CHECKSUM_COMPLETE, that is iwlwifi. The current hardware there calculates checksum after the SNAP header, but only RFC 1042 (and some other cases, but replicating the exact hardware logic for corner cases in the driver seemed awkward.) Newer generations of hardware will checksum _including_ the SNAP, which makes things easier. To handle that, simply always assume the checksum _includes_ the SNAP header, which this patch does, requiring to first add it for older iwlwifi hardware, and then remove it again later on conversion. Alternatively, we could have: 1) Always assumed the checksum starts _after_ the SNAP header; the problem with this is that we'd have to replace the exact "what is the SNAP" check in iwlwifi that cfg80211 has. 2) Made it configurable with some flag, but that seemed like too much complexity. Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Luca Coelho <luciano.coelho@intel.com> Link: https://lore.kernel.org/r/iwlwifi.20220202104617.230736e19e0e.I3e6745873585ad943c152fab9e23b5221f17a95f@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
2022-02-04usb: gadget: f_uac2: Neaten and reduce size of afunc_validate_optsJoe Perches1-48/+33
Remove the repetition and reduce the object size a bit. $ size drivers/usb/gadget/function/f_uac2.o* (x86-64 defconfig with gadget) text data bss dec hex filename 24515 3136 16 27667 6c13 drivers/usb/gadget/function/f_uac2.o.new 24817 3136 16 27969 6d41 drivers/usb/gadget/function/f_uac2.o.old Signed-off-by: Joe Perches <joe@perches.com> Link: https://lore.kernel.org/r/2132d97ca8d4dd5ac9426cc23af95e819079b02c.camel@perches.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-04usb: gadget: f_uac2: change maxpctksize/maxpcktsize to wMaxPacketSizeColin Ian King1-2/+2
The spelling of maxpctksize and maxpcktsize is inconsistent, rename them both to wMaxPacketSize instead. Signed-off-by: Colin Ian King <colin.i.king@gmail.com> Link: https://lore.kernel.org/r/20220202104058.590312-1-colin.i.king@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-04mux: Fix struct mux_state kernel-doc commentYang Li1-1/+1
A warning is reported because a colon was dropped, it is found by running scripts/kernel-doc, which is caused by using 'make W=1'. drivers/mux/core.c:44: warning: Function parameter or member 'state' not described in 'mux_state' Reported-by: Abaci Robot <abaci@linux.alibaba.com> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com> Signed-off-by: Peter Rosin <peda@axentia.se> Link: https://lore.kernel.org/r/a9a970fc-63f9-5ab9-4983-fba5b01bebe2@axentia.se Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-04mux: fix grammar, missing "is".Peter Rosin1-1/+1
This makes it easier to parse. Signed-off-by: Peter Rosin <peda@axentia.se> Link: https://lore.kernel.org/r/75067db8-0264-c49c-daa8-d7a877932711@axentia.se Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-04mux: add missing mux_state_getPeter Rosin1-11/+29
And implement devm_mux_state_get in terms of the new function. Now we have both mux_state_get and mux_state_put as convenient functions ready to be exported should someone ever need unmanaged interfaces. Tested-by: Aswath Govindraju <a-govindraju@ti.com> Signed-off-by: Peter Rosin <peda@axentia.se> Link: https://lore.kernel.org/r/6f8cfdfd-9fa6-40d1-09b3-0c9fc50835ac@axentia.se Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-04mux: Add support for reading mux state from consumer DT nodeAswath Govindraju1-21/+198
In some cases, we might need to provide the state of the mux to be set for the operation of a given peripheral. Therefore, pass this information using mux-states property. Link: https://lore.kernel.org/lkml/20211123081222.27979-1-a-govindraju@ti.com Signed-off-by: Aswath Govindraju <a-govindraju@ti.com> Signed-off-by: Peter Rosin <peda@axentia.se> (minor edits) Link: https://lore.kernel.org/r/aac25be8-9515-a980-f7cb-709938c84822@axentia.se Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-04block: pass a block_device to bio_clone_fastChristoph Hellwig14-54/+53
Pass a block_device to bio_clone_fast and __bio_clone_fast and give the functions more suitable names. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Mike Snitzer <snitzer@redhat.com> Link: https://lore.kernel.org/r/20220202160109.108149-14-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-02-04block: initialize the target bio in __bio_clone_fastChristoph Hellwig2-2/+0
All callers of __bio_clone_fast initialize the bio first. Move that initialization into __bio_clone_fast instead. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Mike Snitzer <snitzer@redhat.com> Link: https://lore.kernel.org/r/20220202160109.108149-13-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-02-04dm: use bio_clone_fast in alloc_io/alloc_tioChristoph Hellwig1-9/+3
Replace open coded bio_clone_fast implementations with the actual helper. Note that the bio allocated as part of the dm_io structure in alloc_io will only actually be used later in alloc_tio, making this earlier cloning of the information safe. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Mike Snitzer <snitzer@redhat.com> Link: https://lore.kernel.org/r/20220202160109.108149-12-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-02-04block: clone crypto and integrity data in __bio_clone_fastChristoph Hellwig3-29/+8
__bio_clone_fast should also clone integrity and crypto data, as a clone without those is incomplete. Right now the only caller that can actually support crypto and integrity data (dm) does it manually for the one callchain that supports these, but we better do it properly in the core. Note that all callers except for the above mentioned one also don't need to handle failure at all, given that the integrity and crypto clones are based on mempool allocations that won't fail for sleeping allocations. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Mike Snitzer <snitzer@redhat.com> Link: https://lore.kernel.org/r/20220202160109.108149-11-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-02-04dm-cache: remove __remap_to_origin_clear_discardChristoph Hellwig1-16/+8
Fold __remap_to_origin_clear_discard into the two callers to prepare for bio cloning refactoring. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Mike Snitzer <snitzer@redhat.com> Link: https://lore.kernel.org/r/20220202160109.108149-10-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-02-04dm: simplify the single bio fast path in __send_duplicate_biosChristoph Hellwig1-12/+14
Most targets just need a single flush bio. Open code that case in __send_duplicate_bios without the need to add the bio to a list. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Mike Snitzer <snitzer@redhat.com> Link: https://lore.kernel.org/r/20220202160109.108149-9-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-02-04dm: retun the clone bio from alloc_tioChristoph Hellwig1-20/+19
Return the clone bio embedded into the tio as that is what the callers actually want. Similar for the free side. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Mike Snitzer <snitzer@redhat.com> Link: https://lore.kernel.org/r/20220202160109.108149-8-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-02-04dm: pass the bio instead of tio to __map_bioChristoph Hellwig1-6/+4
This simplifies the callers a bit. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Mike Snitzer <snitzer@redhat.com> Link: https://lore.kernel.org/r/20220202160109.108149-7-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-02-04dm: move cloning the bio into alloc_tioChristoph Hellwig1-12/+10
Move the call to __bio_clone_fast and the assignment of ->len_ptr from the callers into alloc_tio to prepare for changes to the bio clone API. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Mike Snitzer <snitzer@redhat.com> Link: https://lore.kernel.org/r/20220202160109.108149-6-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-02-04dm: fold __send_duplicate_bios into __clone_and_map_simple_bioChristoph Hellwig1-16/+11
Fold __send_duplicate_bios into its only caller to prepare for refactoring. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Mike Snitzer <snitzer@redhat.com> Link: https://lore.kernel.org/r/20220202160109.108149-5-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-02-04dm: fold clone_bio into __clone_and_map_data_bioChristoph Hellwig1-26/+17
Fold clone_bio into its only caller to prepare for refactoring. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Mike Snitzer <snitzer@redhat.com> Link: https://lore.kernel.org/r/20220202160109.108149-4-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-02-04dm: add a clone_to_tio helperChristoph Hellwig1-19/+15
Add a helper to stop open coding the container_of operations to get from the clone bio to the tio structure. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Mike Snitzer <snitzer@redhat.com> Link: https://lore.kernel.org/r/20220202160109.108149-3-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-02-04drbd: set ->bi_bdev in drbd_req_newChristoph Hellwig1-2/+1
Make sure the newly allocated bio has the correct bi_bdev set from the start. Signed-off-by: Christoph Hellwig <hch@lst.de> Reviewed-by: Mike Snitzer <snitzer@redhat.com> Link: https://lore.kernel.org/r/20220202160109.108149-2-hch@lst.de Signed-off-by: Jens Axboe <axboe@kernel.dk>
2022-02-04amiserial: Drop duplicate NULL check in shutdown()Andy Shevchenko1-4/+2
The free_page(addr), which becomes free_pages(addr, 0) checks addr against 0. No need to repeat this check in the caller. Acked-by: Jiri Slaby <jirislaby@kernel.org> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Link: https://lore.kernel.org/r/20220202165655.5647-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-04drivers/android: remove redundant ret variableMinghao Chi1-6/+2
Return value from list_lru_count() directly instead of taking this in another redundant variable. Reported-by: Zeal Robot <zealci@zte.com.cn> Signed-off-by: Minghao Chi <chi.minghao@zte.com.cn> Signed-off-by: CGEL ZTE <cgel.zte@gmail.com> Link: https://lore.kernel.org/r/20220104113500.602158-1-chi.minghao@zte.com.cn Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-04devtmpfs: drop redundant fs parameters from internal fsAnthony Iliopoulos1-2/+0
The internal_fs_type is mounted via vfs_kernel_mount() and is never registered as a filesystem, thus specifying the parameters is redundant as those params will not be validated by fs_validate_description(). Both {shmem,ramfs}_fs_parameters are anyway validated when those respective filesystems are first registered, so there is no reason to pass them to devtmpfs too, drop them. Reviewed-by: Christoph Hellwig <hch@lst.de> Acked-by: Christian Brauner <christian.brauner@ubuntu.com> Signed-off-by: Anthony Iliopoulos <ailiop@suse.com> Link: https://lore.kernel.org/r/20220119220248.32225-1-ailiop@suse.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-04vt_ioctl: add array_index_nospec to VT_ACTIVATEJakob Koschel1-0/+1
in vt_setactivate an almost identical code path has been patched with array_index_nospec. In the VT_ACTIVATE path the user input is from a system call argument instead of a usercopy. For consistency both code paths should have the same mitigations applied. Kasper Acknowledgements: Jakob Koschel, Brian Johannesmeyer, Kaveh Razavi, Herbert Bos, Cristiano Giuffrida from the VUSec group at VU Amsterdam. Co-developed-by: Brian Johannesmeyer <bjohannesmeyer@gmail.com> Signed-off-by: Brian Johannesmeyer <bjohannesmeyer@gmail.com> Signed-off-by: Jakob Koschel <jakobkoschel@gmail.com> Link: https://lore.kernel.org/r/20220127144406.3589293-2-jakobkoschel@gmail.com Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-04vt_ioctl: fix array_index_nospec in vt_setactivateJakob Koschel1-1/+1
array_index_nospec ensures that an out-of-bounds value is set to zero on the transient path. Decreasing the value by one afterwards causes a transient integer underflow. vsa.console should be decreased first and then sanitized with array_index_nospec. Kasper Acknowledgements: Jakob Koschel, Brian Johannesmeyer, Kaveh Razavi, Herbert Bos, Cristiano Giuffrida from the VUSec group at VU Amsterdam. Co-developed-by: Brian Johannesmeyer <bjohannesmeyer@gmail.com> Signed-off-by: Brian Johannesmeyer <bjohannesmeyer@gmail.com> Signed-off-by: Jakob Koschel <jakobkoschel@gmail.com> Link: https://lore.kernel.org/r/20220127144406.3589293-1-jakobkoschel@gmail.com Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-04pps: clients: gpio: Propagate return value from pps_gpio_probeRobert Hancock1-1/+1
If the pps-gpio driver was probed prior to the GPIO device it uses, the devm_gpiod_get call returned an -EPROBE_DEFER error, but pps_gpio_probe replaced that error code with -EINVAL, causing the pps-gpio probe to fail and not be retried later. Propagate the error return value so that deferred probe works properly. Fixes: 161520451dfa (pps: new client driver using GPIO) Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Acked-by: Rodolfo Giometti <giometti@enneenne.com> Signed-off-by: Robert Hancock <robert.hancock@calian.com> Signed-off-by: Rodolfo Giometti <giometti@enneenne.com> Link: https://lore.kernel.org/r/20220112205214.2060954-1-robert.hancock@calian.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-04serial: 8250_pericom: Revert "Re-enable higher baud rates"Andy Shevchenko1-1/+1
UPF_MAGIC_MULTIPLIER is userspace available bit and can be changed at any time. There is no sense to rely on it to be always present. This reverts commit b4ccaf5aa2d795ee7f47a6eeb209f3de981e1929. Note, that code was not reliably worked before, hence it implies no functional change. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Fixes: b4ccaf5aa2d7 ("serial: 8250_pericom: Re-enable higher baud rates") Link: https://lore.kernel.org/r/20220203150026.19087-1-andriy.shevchenko@linux.intel.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-04greybus: svc: clean up link configuration hack at helloJohan Hovold1-5/+8
Commit ee2f2074fdb2 ("greybus: svc: reconfig APBridgeA-Switch link to handle required load") added a temporary hack which reconfigures the link at HELLO by abusing the deferred request processing mechanism. Restructure the HELLO request processing so that the link-configuration work is queued before creating the debugfs files and add a comment explaining why it's there. Signed-off-by: Johan Hovold <johan@kernel.org> Link: https://lore.kernel.org/r/20220202113347.1288-4-johan@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-04greybus: svc: clean up hello error pathJohan Hovold1-2/+3
While currently safe, it is unnecessary (and confusing) to try to destroy the watchdog when watchdog creation fails. Change the corresponding error path to only deregister the svc. Signed-off-by: Johan Hovold <johan@kernel.org> Link: https://lore.kernel.org/r/20220202113347.1288-3-johan@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-04greybus: svc: fix an error handling bug in gb_svc_hello()Dan Carpenter1-1/+7
Cleanup if gb_svc_queue_deferred_request() fails. Link: https://lore.kernel.org/r/20220202072016.GA6748@kili Fixes: ee2f2074fdb2 ("greybus: svc: reconfig APBridgeA-Switch link to handle required load") Cc: stable@vger.kernel.org # 4.9 [johan: fix commit summary prefix and rename label ] Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Johan Hovold <johan@kernel.org> Link: https://lore.kernel.org/r/20220202113347.1288-2-johan@kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-04staging: r8188eu: remove constant variable eRFPathMartin Kaiser1-3/+2
In the _PHY_SwChnl8192C function, eRFPath is always zero. Remove the variable and use 0 in the code. Replace (enum rf_radio_path)0 with RF_PATH_A. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220204090941.309900-5-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-04staging: r8188eu: remove constant parameter of odm_ConfigRFReg_8188EMartin Kaiser1-4/+3
The only caller of odm_ConfigRFReg_8188E sets RF_PATH to RF_PATH_A. Remove this parameter and use RF_PATH_A inside the function. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220204090941.309900-4-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-04staging: r8188eu: remove dead code for tx power trackingMartin Kaiser1-70/+2
The odm_TXPowerTrackingCallback_ThermalMeter_8188E contains code for OFDM paths A and B. It seems that path B is not used, is2t is always false. Remove resulting dead code. Without the path B code, the ele_A and ele_C variables are set but not used. They can be removed. With ele_A and ele_C gone, X and Y are now set but no longer used. Remove them as well. Reported-by: kernel test robot <lkp@intel.com> Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220204090941.309900-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-04staging: r8188eu: remove constant parameter of phy_LCCalibrate_8188EMartin Kaiser1-15/+3
The only caller of phy_LCCalibrate_8188E sets is2t to false. Remove this parameter and resulting dead code. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220204090941.309900-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-04staging: pi433: add debugfs interfacePaulo Miguel Almeida3-1/+78
This adds debugfs interface that can be used for debugging possible hardware/software issues. It currently exposes the following debugfs entries for each SPI device probed: /sys/kernel/debug/pi433/<DEVICE>/regs ... The 'regs' file contains all rf69 uC registers values that are useful for troubleshooting misconfigurations between 2 devices. It contains one register per line so it should be easy to use normal filtering tools to find the registers of interest if needed. Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Paulo Miguel Almeida <paulo.miguel.almeida.rodenas@gmail.com> Link: https://lore.kernel.org/r/YfzeEHJcd+qvYGZ8@mail.google.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-04staging: r8188eu: simplify error handling in phy_BB8188E_Config_ParaFileMartin Kaiser1-8/+3
Simplify error handling in phy_BB8188E_Config_ParaFile. Exit immediately when there's an error, do not jump to the end of the function. We do not have anything to clean up before we return. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220203201745.251826-3-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-04staging: r8188eu: remove unnecessary error checkMartin Kaiser1-3/+0
Remove an unnecessary error check in phy_BB8188E_Config_ParaFile. There's no need to goto phy_BB8190_Config_ParaFile_Fail, this label is in the following line. Signed-off-by: Martin Kaiser <martin@kaiser.cx> Link: https://lore.kernel.org/r/20220203201745.251826-2-martin@kaiser.cx Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-04staging: vt6656: Fix crash when WLAN is turned offPhilipp Hortmann1-1/+3
Stop submitting urbs before calling usb_kill_urb() and usb_free_urb(). Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> Link: https://lore.kernel.org/r/20220203192201.GA18509@matrix-ESPRIMO-P710 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-04staging: r8188eu: move struct rt_firmware_hdr to rtw_fw.hMichael Straube2-35/+35
The structure rt_firmware_hdr is firmware related. Move it to the rtw_fw.h header. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220202075051.21266-1-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-04staging: r8188eu: remove UsbRxAggPage* from struct hal_data_8188eMichael Straube2-10/+6
UsbRxAggPageCount and UsbRxAggPageTimeout in struct hal_data_8188e are set and never changed. Define these constants and remove the variables from the hal_data_8188e structure. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220201084259.7497-10-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-04staging: r8188eu: remove UsbRxAggBlock* from struct hal_data_8188eMichael Straube2-6/+0
UsbRxAggBlockCount and UsbRxAggBlockTimeout in struct hal_data_8188e are set but not used. Remove them. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220201084259.7497-9-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-04staging: r8188eu: remove UsbRxAggMode from struct hal_data_8188eMichael Straube3-61/+7
UsbRxAggMode in struct hal_data_8188e is set to USB_RX_AGG_DMA and never changed. Remove UsbRxAggMode from the hal_data_8188e structure and remove related dead code. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220201084259.7497-8-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-04staging: r8188eu: remove UsbTxAggMode from struct hal_data_8188eMichael Straube2-13/+6
UsbTxAggMode in struct hal_data_r8188e is only used in a single if statement. Remove UsbTxAggMode from the hal_data_8188e structure and adjust the if statement. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220201084259.7497-7-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-04staging: r8188eu: remove UsbTxAggDescNum from struct hal_data_8188eMichael Straube4-4/+4
UsbTxAggDescNum in struct hal_data_8188e is set to 0x6 and never changed. Define this constant and remove UsbTxAggDescNum from the hal_data_8188e structure. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220201084259.7497-6-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-04staging: r8188eu: BasicRateSet is set but never usedMichael Straube2-3/+0
The varaible BasicRateSet in struct hal_data_8188e is set but never used. Remove it. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220201084259.7497-5-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-04staging: r8188eu: remove ReceiveConfig from struct hal_data_8188eMichael Straube2-8/+5
The ReceiveConfig variable in struct hal_data_8188e is only used to store a local value. Use a local variable instead and remove ReceiveConfig from struct hal_data_8188e. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220201084259.7497-4-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-04staging: r8188eu: remove PGMaxGroup from struct hal_data_8188eMichael Straube3-3/+1
the variable PGMaxGroup in struct hal_data_8188e is set to 13 and never changed. We can use the already defined constant MAX_PG_GROUP, which is 13, and remove PGMaxGroup from struct hal_data_8188e. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220201084259.7497-3-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-04staging: r8188eu: ExternalPA is read-onlyMichael Straube2-4/+0
The variable ExternalPA in struct hal_data_8188e is never set. It stays at the default value 0. Remove it and remove related dead code. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20220201084259.7497-2-straube.linux@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-04staging: r8188eu: Silence out-of-bounds warning in HT_caps_handler()Gustavo A. R. Silva1-1/+1
Silence the following out-of-bounds warning (caught with -Warray-bounds=2): drivers/staging/r8188eu/core/rtw_wlan_util.c: In function ‘HT_caps_handler’: drivers/staging/r8188eu/core/rtw_wlan_util.c:719:54: error: array subscript 2 is above array bounds of ‘u8[1]’ {aka ‘unsigned char[1]’} [-Werror=array-bounds] 719 | pIE->data[i] & 0x3); | ~~~~~~~~~^~~ ./include/linux/minmax.h:32:39: note: in definition of macro ‘__cmp_once’ 32 | typeof(y) unique_y = (y); \ | ^ ./include/linux/minmax.h:45:25: note: in expansion of macro ‘__careful_cmp’ 45 | #define min(x, y) __careful_cmp(x, y, <) | ^~~~~~~~~~~~~ drivers/staging/r8188eu/core/rtw_wlan_util.c:718:41: note: in expansion of macro ‘min’ 718 | max_AMPDU_len = min(pmlmeinfo->HT_caps.u.HT_cap_element.AMPDU_para & 0x3, | ^~~ In file included from drivers/staging/r8188eu/core/../include/drv_types.h:16, from drivers/staging/r8188eu/core/rtw_wlan_util.c:7: drivers/staging/r8188eu/core/../include/wlan_bssdef.h:64:13: note: while referencing ‘data’ 64 | u8 data[1]; | ^~~~ by transforming one-element array into a flexible-array member in struct ndis_802_11_var_ie This is part of the ongoing efforts to globally enable -Warray-bounds. Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org> Link: https://lore.kernel.org/r/20220202070906.GA274379@embeddedor Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2022-02-04iommu/amd: Fix loop timeout issue in iommu_ga_log_enable()Joerg Roedel1-0/+2
The polling loop for the register change in iommu_ga_log_enable() needs to have a udelay() in it. Otherwise the CPU might be faster than the IOMMU hardware and wrongly trigger the WARN_ON() further down the code stream. Use a 10us for udelay(), has there is some hardware where activation of the GA log can take more than a 100ms. A future optimization should move the activation check of the GA log to the point where it gets used for the first time. But that is a bigger change and not suitable for a fix. Fixes: 8bda0cfbdc1a ("iommu/amd: Detect and initialize guest vAPIC log") Signed-off-by: Joerg Roedel <jroedel@suse.de> Link: https://lore.kernel.org/r/20220204115537.3894-1-joro@8bytes.org