- Aug 11, 2022
-
-
Jason Kridner authored
-
Vaishnav Achath authored
split the rename changes across two separate patches to work around the buildroot apply-patch issue. Signed-off-by:
Vaishnav M A <vaishnav@beagleboard.org>
-
Vaishnav Achath authored
Tested on PocketBeagle + ATUSB + CC1352R SensorTag: debian@beaglebone:~$ uname -a Linux beaglebone 5.8.18-bone23 #1xross PREEMPT Tue Dec 15 15:41:20 IST 2020 armv7l GNU/Linux All drivers probed correctly as per manifest, but a kernel panic occurs after sometime: debian@beaglebone:~$ dmesg [ 218.793223] greybus 1-svc: no primary interface detected on module 2 [ 218.876678] greybus 1-2.2: Interface added (greybus) [ 218.876707] greybus 1-2.2: GMP VID=0x00000126, PID=0x00000126 [ 218.876739] greybus 1-2.2: DDBL1 Manufacturer=0x00000126, Product=0x00000126 [ 219.296368] greybus 1-2.2: excess descriptors in interface manifest [ 220.922786] mikrobus:mikrobus_port_gb_register: mikrobus gb_probe , num cports= 3 [ 220.922793] mikrobus:mikrobus_port_gb_register: protocol added 11 [ 220.922824] mikrobus:mikrobus_port_gb_register: protocol added 3 [ 220.922829] mikrobus:mikrobus_port_gb_register: protocol added 2 [ 220.922896] mikrobus:mikrobus_port_register: registering port mikrobus-1 [ 220.931490] mikrobus_manifest:mikrobus_manifest_attach_device: parsed device 1, driver=bme280, protocol=3, reg=76 [ 220.931526] mikrobus_manifest:mikrobus_manifest_attach_device: parsed device 2, driver=opt3001, protocol=3, reg=44 [ 220.931557] mikrobus_manifest:mikrobus_manifest_parse: Greybus Service Sample Application manifest parsed with 2 devices [ 220.931602] mikrobus mikrobus-1: registering device : bme280 [ 220.937043] mikrobus mikrobus-1: registering device : opt3001 [ 221.628678] bmp280 3-0076: supply vddd not found, using dummy regulator [ 221.628976] bmp280 3-0076: supply vdda not found, using dummy regulator [ 221.630669] opt3001 3-0044: Found TI OPT3001 debian@beaglebone:~$ ls /sys/bus/iio/devices/iio\:device iio:device0/ iio:device1/ iio:device2/ debian@beaglebone:~$ ls /sys/bus/iio/devices/iio\:device1 current_timestamp_clock dev events in_illuminance_input in_illuminance_integration_time integration_time_available name power subsystem uevent debian@beaglebone:~$ ls /sys/bus/iio/devices/iio\:device2 dev in_humidityrelative_input in_humidityrelative_oversampling_ratio in_pressure_input in_pressure_oversampling_ratio in_temp_input in_temp_oversampling_ratio name power subsystem uevent . . . [ 235.947231] 8<--- cut here --- [ 235.951059] Unable to handle kernel NULL pointer dereference at virtual address 00000004 [ 235.964814] pgd = 1f321289 [ 235.970754] [00000004] *pgd=00000000 [ 235.977393] Internal error: Oops: 5 [#1] PREEMPT THUMB2 [ 235.983348] Modules linked in: bmp280_i2c bmp280 opt3001 gb_netlink gb_loopback(C) gb_gpio(C) gb_i2c(C) gb_spi(C) gb_gbphy(C) gb_spilib(C) greybus nhc_udp nhc_routing nhc_ipv6 nhc_mobility nhc_hop nhc_fragment nhc_dest ieee802154_6lowpan 6lowpan evdev usb_f_acm u_serial usb_f_ncm usb_f_mass_storage usb_f_rndis u_ether libcomposite iptable_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 iptable_mangle iptable_filter ip_tables x_tables atusb mac802154 ieee802154 spidev [last unloaded: gb_netlink] [ 236.028629] CPU: 0 PID: 5 Comm: kworker/0:0 Tainted: G C O 5.8.18-bone23 #1xross [ 236.037887] Hardware name: Generic AM33XX (Flattened Device Tree) [ 236.044761] Workqueue: events do_work [greybus] [ 236.050022] PC is at skb_release_data+0x52/0xe4 [ 236.055268] LR is at kfree_skb+0x23/0xa8 [ 236.059903] pc : [<c0857e6a>] lr : [<c0857583>] psr: 400f0033 [ 236.066892] sp : dc139e60 ip : a00f0013 fp : c0f1369c [ 236.072833] r10: da5b5200 r9 : da5b5214 r8 : 00000001 [ 236.078775] r7 : da5b5300 r6 : db633c00 r5 : da5b5300 r4 : 00000000 [ 236.086026] r3 : 00000008 r2 : 00000000 r1 : 00000000 r0 : 00000000 [ 236.093279] Flags: nZcv IRQs on FIQs on Mode SVC_32 ISA Thumb Segment none [ 236.101316] Control: 50c5387d Table: 9b5a4019 DAC: 00000051 [ 236.107785] Process kworker/0:0 (pid: 5, stack limit = 0x39163ebd) [ 236.114689] Stack: (0xdc139e60 to 0xdc13a000) [ 236.119766] 9e60: da5b5200 db633c00 ffffff91 bf9391cd db51c000 c0857583 db633c00 ffffff91 [ 236.128678] 9e80: dae21168 bf9391cd 00000000 00000001 00000000 c0f05288 d64e7ea0 00000000 [ 236.137590] 9ea0: 000007d0 00000cc0 da6b0e00 00000000 00000000 bf90f84d 00000cc0 d64e7ea0 [ 236.146502] 9ec0: 00000000 00000000 00000013 bf90f8b9 d64e7ea0 bf90f94d 00000000 00000cc0 [ 236.155415] 9ee0: d6543d40 db51c400 00000000 dfa07300 00000000 00000000 d6543d44 bf90e973 [ 236.164328] 9f00: 00000000 00000000 000007d0 c0153c45 c0f05288 bf90eb39 00000000 c0f05288 [ 236.173240] 9f20: dfa07305 d6543d40 dc0e5b00 00000000 dfa07300 c01377c7 dc139f50 c0137a53 [ 236.182153] 9f40: dc0e5b00 c0f1365c dc0e5b14 c0f1d060 c0f13670 dc138000 c0f1365c c0137af9 [ 236.191065] 9f60: 00000000 dc0fd080 dc0fd380 dc138000 00000000 c0137a2d dc0e5b00 dc117eb8 [ 236.199979] 9f80: dc0fd0a0 c013ba45 00000000 dc0fd380 c013b955 00000000 00000000 00000000 [ 236.208891] 9fa0: 00000000 00000000 00000000 c0100159 00000000 00000000 00000000 00000000 [ 236.217804] 9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [ 236.226716] 9fe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000 [ 236.235638] [<c0857e6a>] (skb_release_data) from [<c0857583>] (kfree_skb+0x23/0xa8) [ 236.244032] [<c0857583>] (kfree_skb) from [<bf9391cd>] (message_send+0x91/0x12c [gb_netlink]) [ 236.253333] [<bf9391cd>] (message_send [gb_netlink]) from [<bf90f84d>] (gb_operation_request_send+0xad/0xfc [greybus]) [ 236.264799] [<bf90f84d>] (gb_operation_request_send [greybus]) from [<bf90f8b9>] (gb_operation_request_send_sync_timeout+0x1d/0x4c [greybus]) [ 236.278268] [<bf90f8b9>] (gb_operation_request_send_sync_timeout [greybus]) from [<bf90f94d>] (gb_operation_sync_timeout+0x65/0xb0 [greybus]) [ 236.291736] [<bf90f94d>] (gb_operation_sync_timeout [greybus]) from [<bf90e973>] (gb_svc_ping+0x23/0x28 [greybus]) [ 236.302849] [<bf90e973>] (gb_svc_ping [greybus]) from [<bf90eb39>] (do_work+0x19/0xe8 [greybus]) [ 236.312387] [<bf90eb39>] (do_work [greybus]) from [<c01377c7>] (process_one_work+0x127/0x38c) [ 236.321651] [<c01377c7>] (process_one_work) from [<c0137af9>] (worker_thread+0xcd/0x3d0) [ 236.330482] [<c0137af9>] (worker_thread) from [<c013ba45>] (kthread+0xf1/0x124) [ 236.338526] [<c013ba45>] (kthread) from [<c0100159>] (ret_from_fork+0x11/0x38) [ 236.346474] Exception stack(0xdc139fb0 to 0xdc139ff8) [ 236.352244] 9fa0: 00000000 00000000 00000000 00000000 [ 236.361156] 9fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 [ 236.370067] 9fe0: 00000000 00000000 00000000 00000000 00000013 00000000 [ 236.377413] Code: 78bb 42a3 dd1b 6aa8 (6843) 07da [ 236.394147] ---[ end trace dc655e652b764722 ]--- Signed-off-by:
Vaishnav M A <vaishnav@beagleboard.org>
-
Vaishnav Achath authored
add of_find_serdev_controller_by_node to obtain a serdev_controller from the device_node, which can help if the serdev_device is not described over device tree and instantiation of the device happens from a different driver, for the same purpose an option to not delete an empty serdev controller is added. Signed-off-by:
Vaishnav M A <vaishnav@beagleboard.org>
-
Ricardo Ribalda authored
Currently,a serdev device driver can only be used with devices that are nodes of a device tree, or are part of the ACPI table.id_table will be used for devices that are not part of the device tree nor the ACPI table (example: device on greybus gbphy created uart). corresponding modalias field is introduced to name the driver to be used with the device, required device(s) that are neither described by device tree nor ACPI table. serdev_device_uevent is also extended for modalias devices. Signed-off-by:
Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
-
Vaishnav Achath authored
This Patch series is an update to the mikroBUS driver with support for serdev devices and fixed regulator. RFC v1 Patch : https://lkml.org/lkml/2020/7/24/518 . The mikrobus driver is updated to add mikrobus ports from device-tree overlays, the debug interfaces for adding mikrobus ports through sysFS is removed, and the driver considers the extended usage of mikrobus port pins from their standard purposes. change log: v2: support for adding mikroBUS ports from DT overlays, remove debug sysFS interface for adding mikrobus ports, consider extended pin usage/deviations from mikrobus standard specifications, use greybus CPort protocol enum instead of new protcol enums Fix cases of wrong indendation, ignoring return values, freeing allocated resources in case of errors and other style suggestions in v1 review. Signed-off-by:
Vaishnav M A <vaishnav@beagleboard.org>
-
Robert Nelson authored
Reference: v5.10.136 Signed-off-by:
Robert Nelson <robertcnelson@gmail.com>
-
Robert Nelson authored
Signed-off-by:
Robert Nelson <robertcnelson@gmail.com>
-
Robert Nelson authored
Signed-off-by:
Robert Nelson <robertcnelson@gmail.com>
-
Andrew F. Davis authored
This is driver allows user-space to attach a DMA-BUF and receive back its CPU physical address. This is a temporary solution to allow CMEM like functionality from allocated buffers. This is a hack and this will be removed when proper solutions are implemented. Signed-off-by:
Andrew F. Davis <afd@ti.com> Signed-off-by:
Gowtham Tammana <g-tammana@ti.com>
-
- Jul 31, 2022
-
-
Add definition for USXGMII phy type. Signed-off-by:
Swapnil Jakhade <sjakhade@cadence.com> Signed-off-by:
Roger Quadros <rogerq@kernel.org> Signed-off-by:
Vignesh Raghavendra <vigneshr@ti.com>
-
- Jun 14, 2022
-
-
commit b9241f54 upstream. SMII has not been documented in the kernel, but information on this PHY interface mode has been recently found. Document it, and correct the recently introduced phylink handling for this interface mode. Signed-off-by:
Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Reviewed-by:
Andrew Lunn <andrew@lunn.ch> Link: https://lore.kernel.org/r/E1mmfVl-0075nP-14@rmk-PC.armlinux.org.uk Signed-off-by:
Jakub Kicinski <kuba@kernel.org> Signed-off-by:
Vignesh Raghavendra <vigneshr@ti.com>
-
commit f9749365 upstream. Joakim Zhang reports that Wake-on-Lan with the stmmac ethernet driver broke when moving the incorrect handling of mac link state out of mac_config(). This reason this breaks is because the stmmac's WoL is handled by the MAC rather than the PHY, and phylink doesn't cater for that scenario. This patch adds the necessary phylink code to handle suspend/resume events according to whether the MAC still needs a valid link or not. This is the barest minimum for this support. Reported-by:
Joakim Zhang <qiangqing.zhang@nxp.com> Tested-by:
Joakim Zhang <qiangqing.zhang@nxp.com> Signed-off-by:
Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Signed-off-by:
Joakim Zhang <qiangqing.zhang@nxp.com> Signed-off-by:
David S. Miller <davem@davemloft.net> Signed-off-by:
Vignesh Raghavendra <vigneshr@ti.com>
-
commit 25396f68 upstream. Define phylink_fwnode_phy_connect() to connect phy specified by a fwnode to a phylink instance. Signed-off-by:
Calvin Johnson <calvin.johnson@oss.nxp.com> Signed-off-by:
Ioana Ciornei <ioana.ciornei@nxp.com> Acked-by:
Grant Likely <grant.likely@arm.com> Reviewed-by:
Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Signed-off-by:
David S. Miller <davem@davemloft.net> Signed-off-by:
Vignesh Raghavendra <vigneshr@ti.com>
-
commit 34ae2c09 upstream. Add a generic validate() implementation using the supported_interfaces and a bitmask of MAC pause/speed/duplex capabilities. This allows us to entirely eliminate many driver private validate() implementations. We expose the underlying phylink_get_linkmodes() function so that drivers which have special needs can still benefit from conversion. Signed-off-by:
Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Signed-off-by:
David S. Miller <davem@davemloft.net> Signed-off-by:
Vignesh Raghavendra <vigneshr@ti.com>
-
commit 38c310eb upstream. Add a phy_interface_t bitmap so the MAC driver can specifiy which PHY interface modes it supports. Signed-off-by:
Russell King <rmk+kernel@armlinux.org.uk> Signed-off-by:
David S. Miller <davem@davemloft.net> Signed-off-by:
Vignesh Raghavendra <vigneshr@ti.com>
-
commit 114dea60 upstream. Extract phy_id from compatible string. This will be used by fwnode_mdiobus_register_phy() to create phy device using the phy_id. Signed-off-by:
Calvin Johnson <calvin.johnson@oss.nxp.com> Signed-off-by:
Ioana Ciornei <ioana.ciornei@nxp.com> Acked-by:
Grant Likely <grant.likely@arm.com> Signed-off-by:
David S. Miller <davem@davemloft.net> Signed-off-by:
Vignesh Raghavendra <vigneshr@ti.com>
-
commit 425775ed upstream. Define fwnode_phy_find_device() to iterate an mdiobus and find the phy device of the provided phy fwnode. Additionally define device_phy_find_device() to find phy device of provided device. Define fwnode_get_phy_node() to get phy_node using named reference. Signed-off-by:
Calvin Johnson <calvin.johnson@oss.nxp.com> Signed-off-by:
Ioana Ciornei <ioana.ciornei@nxp.com> Acked-by:
Grant Likely <grant.likely@arm.com> Signed-off-by:
David S. Miller <davem@davemloft.net> Signed-off-by:
Vignesh Raghavendra <vigneshr@ti.com>
-
commit 0fb16976 upstream. Define fwnode_mdio_find_device() to get a pointer to the mdio_device from fwnode passed to the function. Refactor of_mdio_find_device() to use fwnode_mdio_find_device(). Signed-off-by:
Calvin Johnson <calvin.johnson@oss.nxp.com> Signed-off-by:
Ioana Ciornei <ioana.ciornei@nxp.com> Acked-by:
Grant Likely <grant.likely@arm.com> Signed-off-by:
David S. Miller <davem@davemloft.net> Signed-off-by:
Vignesh Raghavendra <vigneshr@ti.com>
-
commit 8e20f591 upstream. Add support for a bitmap for phy interface modes, which includes: - a macro to declare the interface bitmap - an inline helper to zero the interface bitmap - an inline helper to detect an empty interface bitmap - inline helpers to do a bitwise AND and OR operations on two interface bitmaps Signed-off-by:
Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Signed-off-by:
David S. Miller <davem@davemloft.net> Signed-off-by:
Vignesh Raghavendra <vigneshr@ti.com>
-
commit a56c2868 upstream. Add 25gbase-r phy interface mode Signed-off-by:
Steen Hegelund <steen.hegelund@microchip.com> Signed-off-by:
Bjarni Jonasson <bjarni.jonasson@microchip.com> Reviewed-by:
Andrew Lunn <andrew@lunn.ch> Reviewed-by:
Russell King (Oracle) <rmk+kernel@armlinux.org.uk> Signed-off-by:
David S. Miller <davem@davemloft.net> Signed-off-by:
Vignesh Raghavendra <vigneshr@ti.com>
-
commit 7331d1d4 upstream. Add 5GBASE-R phy interface mode Signed-off-by:
Pavana Sharma <pavana.sharma@digi.com> Reviewed-by:
Andrew Lunn <andrew@lunn.ch> Reviewed-by:
Florian Fainelli <f.fainelli@gmail.com> Signed-off-by:
Marek Behún <kabel@kernel.org> Signed-off-by:
David S. Miller <davem@davemloft.net> Signed-off-by:
Vignesh Raghavendra <vigneshr@ti.com>
-
commit b1ae3587 upstream. Sparx-5 supports this mode and it is missing in the PHY core. Signed-off-by:
Bjarni Jonasson <bjarni.jonasson@microchip.com> Reviewed-by:
Russell King <rmk+kernel@armlinux.org.uk> Signed-off-by:
Jakub Kicinski <kuba@kernel.org> Signed-off-by:
Vignesh Raghavendra <vigneshr@ti.com>
-
commit c858d436 upstream. The "reverse RMII" protocol name is a personal invention, derived from "reverse MII". Just like MII, RMII is an asymmetric protocol in that a PHY behaves differently than a MAC. In the case of RMII, for example: - the 50 MHz clock signals are either driven by the MAC or by an external oscillator (but never by the PHY). - the PHY can transmit extra in-band control symbols via RXD[1:0] which the MAC is supposed to understand, but a PHY isn't. The "reverse MII" protocol is not standardized either, except for this web document: https://www.eetimes.com/reverse-media-independent-interface-revmii-block-architecture/# In short, it means that the Ethernet controller speaks the 4-bit data parallel protocol from the perspective of a PHY (it acts like a PHY). This might mean that it implements clause 22 compatible registers, although that is optional - the important bit is that its pins can be connected to an MII MAC and it will 'just work'. In this discussion thread: https://lore.kernel.org/netdev/20210201214515.cx6ivvme2tlquge2@skbuf/ we agreed that it would be an abuse of terms to use the "RevMII" name for anything than the 4-bit parallel MII protocol. But since all the same concepts can be applied to the 2-bit Reduced MII protocol as well, here we are introducing a "Reverse RMII" protocol. This means: "behave like an RMII PHY". Signed-off-by:
Vladimir Oltean <vladimir.oltean@nxp.com> Acked-by:
Florian Fainelli <f.fainelli@gmail.com> Signed-off-by:
David S. Miller <davem@davemloft.net> Signed-off-by:
Vignesh Raghavendra <vigneshr@ti.com>
-
- Jun 06, 2022
-
-
Florian Westphal authored
commit 56b14ece upstream. In case the conntrack is clashing, insertion can free skb->_nfct and set skb->_nfct to the already-confirmed entry. This wasn't found before because the conntrack entry and the extension space used to free'd after an rcu grace period, plus the race needs events enabled to trigger. Reported-by:
<syzbot+793a590957d9c1b96620@syzkaller.appspotmail.com> Fixes: 71d8c47f ("netfilter: conntrack: introduce clash resolution on insertion race") Fixes: 2ad9d774 ("netfilter: conntrack: free extension area immediately") Signed-off-by:
Florian Westphal <fw@strlen.de> Signed-off-by:
Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Nicolai Stange authored
commit 074bcd40 upstream. get_random_bytes() usually hasn't full entropy available by the time DRBG instances are first getting seeded from it during boot. Thus, the DRBG implementation registers random_ready_callbacks which would in turn schedule some work for reseeding the DRBGs once get_random_bytes() has sufficient entropy available. For reference, the relevant history around handling DRBG (re)seeding in the context of a not yet fully seeded get_random_bytes() is: commit 16b369a9 ("random: Blocking API for accessing nonblocking_pool") commit 4c787990 ("crypto: drbg - add async seeding operation") commit 205a525c ("random: Add callback API for random pool readiness") commit 57225e67 ("crypto: drbg - Use callback API for random readiness") commit c2719503 ("random: Remove kernel blocking API") However,...
-
Nicolai Stange authored
commit 2bcd2544 upstream. Currently, the DRBG implementation schedules asynchronous works from random_ready_callbacks for reseeding the DRBG instances with output from get_random_bytes() once the latter has sufficient entropy available. However, as the get_random_bytes() initialization state can get queried by means of rng_is_initialized() now, there is no real need for this asynchronous reseeding logic anymore and it's better to keep things simple by doing it synchronously when needed instead, i.e. from drbg_generate() once rng_is_initialized() has flipped to true. Of course, for this to work, drbg_generate() would need some means by which it can tell whether or not rng_is_initialized() has flipped to true since the last seeding from get_random_bytes(). Or equivalently, whether or not the last seed from get_random_bytes() has happened when rng_is_initialized() was still evaluating to false. As it currently stands, enum drbg_seed_state allows for the representation of two different DRBG seeding states: DRBG_SEED_STATE_UNSEEDED and DRBG_SEED_STATE_FULL. The former makes drbg_generate() to invoke a full reseeding operation involving both, the rather expensive jitterentropy as well as the get_random_bytes() randomness sources. The DRBG_SEED_STATE_FULL state on the other hand implies that no reseeding at all is required for a !->pr DRBG variant. Introduce the new DRBG_SEED_STATE_PARTIAL state to enum drbg_seed_state for representing the condition that a DRBG was being seeded when rng_is_initialized() had still been false. In particular, this new state implies that - the given DRBG instance has been fully seeded from the jitterentropy source (if enabled) - and drbg_generate() is supposed to reseed from get_random_bytes() *only* once rng_is_initialized() turns to true. Up to now, the __drbg_seed() helper used to set the given DRBG instance's ->seeded state to constant DRBG_SEED_STATE_FULL. Introduce a new argument allowing for the specification of the to be written ->seeded value instead. Make the first of its two callers, drbg_seed(), determine the appropriate value based on rng_is_initialized(). The remaining caller, drbg_async_seed(), is known to get invoked only once rng_is_initialized() is true, hence let it pass constant DRBG_SEED_STATE_FULL for the new argument to __drbg_seed(). There is no change in behaviour, except for that the pr_devel() in drbg_generate() would now report "unseeded" for ->pr DRBG instances which had last been seeded when rng_is_initialized() was still evaluating to false. Signed-off-by:
Nicolai Stange <nstange@suse.de> Reviewed-by:
Stephan Müller <smueller@chronox.de> Signed-off-by:
Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by:
Jason A. Donenfeld <Jason@zx2c4.com> Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Nicolai Stange authored
commit ce8ce31b upstream. There are two different randomness sources the DRBGs are getting seeded from, namely the jitterentropy source (if enabled) and get_random_bytes(). At initial DRBG seeding time during boot, the latter might not have collected sufficient entropy for seeding itself yet and thus, the DRBG implementation schedules a reseed work from a random_ready_callback once that has happened. This is particularly important for the !->pr DRBG instances, for which (almost) no further reseeds are getting triggered during their lifetime. Because collecting data from the jitterentropy source is a rather expensive operation, the aforementioned asynchronously scheduled reseed work restricts itself to get_random_bytes() only. That is, it in some sense amends the initial DRBG seed derived from jitterentropy output at full (estimated) entropy with fresh randomness obtained from get_random_bytes() once that has been seeded with sufficient entropy itself. With the advent of rng_is_initialized(), there is no real need for doing the reseed operation from an asynchronously scheduled work anymore and a subsequent patch will make it synchronous by moving it next to related logic already present in drbg_generate(). However, for tracking whether a full reseed including the jitterentropy source is required or a "partial" reseed involving only get_random_bytes() would be sufficient already, the boolean struct drbg_state's ->seeded member must become a tristate value. Prepare for this by introducing the new enum drbg_seed_state and change struct drbg_state's ->seeded member's type from bool to that type. For facilitating review, enum drbg_seed_state is made to only contain two members corresponding to the former ->seeded values of false and true resp. at this point: DRBG_SEED_STATE_UNSEEDED and DRBG_SEED_STATE_FULL. A third one for tracking the intermediate state of "seeded from jitterentropy only" will be introduced with a subsequent patch. There is no change in behaviour at this point. Signed-off-by:
Nicolai Stange <nstange@suse.de> Reviewed-by:
Stephan Müller <smueller@chronox.de> Signed-off-by:
Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by:
Jason A. Donenfeld <Jason@zx2c4.com> Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Kuniyuki Iwashima authored
commit f485922d upstream. Patch series "Fix data-races around epoll reported by KCSAN." This series suppresses a false positive KCSAN's message and fixes a real data-race. This patch (of 2): pipe_poll() runs locklessly and assigns 1 to poll_usage. Once poll_usage is set to 1, it never changes in other places. However, concurrent writes of a value trigger KCSAN, so let's make KCSAN happy. BUG: KCSAN: data-race in pipe_poll / pipe_poll write to 0xffff8880042f6678 of 4 bytes by task 174 on cpu 3: pipe_poll (fs/pipe.c:656) ep_item_poll.isra.0 (./include/linux/poll.h:88 fs/eventpoll.c:853) do_epoll_wait (fs/eventpoll.c:1692 fs/eventpoll.c:1806 fs/eventpoll.c:2234) __x64_sys_epoll_wait (fs/eventpoll.c:2246 fs/eventpoll.c:2241 fs/eventpoll.c:2241) do_syscall_64 (arch/x86/entry/common.c:50 arch/x86/entry/common.c:80) entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:113) write to 0xffff8880042f6678 of 4 bytes by task 177 on cpu 1: pipe_poll (fs/pipe.c:656) ep_item_poll.isra.0 (./include/linux/poll.h:88 fs/eventpoll.c:853) do_epoll_wait (fs/eventpoll.c:1692 fs/eventpoll.c:1806 fs/eventpoll.c:2234) __x64_sys_epoll_wait (fs/eventpoll.c:2246 fs/eventpoll.c:2241 fs/eventpoll.c:2241) do_syscall_64 (arch/x86/entry/common.c:50 arch/x86/entry/common.c:80) entry_SYSCALL_64_after_hwframe (arch/x86/entry/entry_64.S:113) Reported by Kernel Concurrency Sanitizer on: CPU: 1 PID: 177 Comm: epoll_race Not tainted 5.17.0-58927-gf443e374ae13 #6 Hardware name: Red Hat KVM, BIOS 1.11.0-2.amzn2 04/01/2014 Link: https://lkml.kernel.org/r/20220322002653.33865-1-kuniyu@amazon.co.jp Link: https://lkml.kernel.org/r/20220322002653.33865-2-kuniyu@amazon.co.jp Fixes: 3b844826 ("pipe: avoid unnecessary EPOLLET wakeups under normal loads") Signed-off-by:
Kuniyuki Iwashima <kuniyu@amazon.co.jp> Cc: Alexander Duyck <alexander.h.duyck@intel.com> Cc: Al Viro <viro@zeniv.linux.org.uk> Cc: Davidlohr Bueso <dave@stgolabs.net> Cc: Kuniyuki Iwashima <kuni1840@gmail.com> Cc: "Soheil Hassas Yeganeh" <soheil@google.com> Cc: "Sridhar Samudrala" <sridhar.samudrala@intel.com> Signed-off-by:
Andrew Morton <akpm@linux-foundation.org> Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
- May 31, 2022
-
-
An ATR is a device that looks similar to an i2c-mux: it has an I2C slave "upstream" port and N master "downstream" ports, and forwards transactions from upstream to the appropriate downstream port. But is is different in that the forwarded transaction has a different slave address. The address used on the upstream bus is called the "alias" and is (potentially) different from the physical slave address of the downstream chip. Add a helper file (just like i2c-mux.c for a mux or switch) to allow implementing ATR features in a device driver. The helper takes care or adapter creation/destruction and translates addresses at each transaction. Signed-off-by:
Luca Ceresoli <luca@lucaceresoli.net> Signed-off-by:
Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Signed-off-by:
Vignesh Raghavendra <vigneshr@ti.com>
-
An adapter might need to know when a new device is about to be added. This will soon bee needed to implement an "I2C address translator" (ATR for short), a device that propagates I2C transactions with a different slave address (an "alias" address). An ATR driver needs to know when a slave is being added to find a suitable alias and program the device translation map. Add an attach/detach callback pair to allow adapter drivers to be notified of clients being added and removed. Signed-off-by:
Luca Ceresoli <luca@lucaceresoli.net> Signed-off-by:
Vignesh Raghavendra <vigneshr@ti.com>
-
Add a subdev capability flag to expose to userspace if a subdev supports multiplexed streams. Signed-off-by:
Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Signed-off-by:
Vignesh Raghavendra <vigneshr@ti.com>
-
Add a helper for verifying routing for the common case of non-overlapping 1-to-1 streams. Signed-off-by:
Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Signed-off-by:
Vignesh Raghavendra <vigneshr@ti.com>
-
v4l2_subdev_set_routing_with_fmt() is the same as v4l2_subdev_set_routing(), but additionally initializes all the streams with the given format. Signed-off-by:
Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Signed-off-by:
Vignesh Raghavendra <vigneshr@ti.com>
-
Add v4l2_subdev_get_fmt() helper function which implements v4l2_subdev_pad_ops.get_fmt using streams. Subdev drivers that do not need to do anything special in their get_fmt op can use this helper directly for v4l2_subdev_pad_ops.get_fmt. Signed-off-by:
Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Signed-off-by:
Vignesh Raghavendra <vigneshr@ti.com>
-
Add two helper functions to make dealing with streams easier: v4l2_state_find_opposite_end - given a routing table and a pad + stream, return the pad + stream on the opposite side of the subdev. v4l2_state_get_opposite_stream_format - return a pointer to the format on the pad + stream on the opposite side from the given pad + stream. Signed-off-by:
Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Signed-off-by:
Vignesh Raghavendra <vigneshr@ti.com>
-
Add support to manage configurations (format, crop, compose) per stream, instead of per pad. This is accomplished with data structures that hold an array of all subdev's stream configurations. The number of streams can vary at runtime based on routing. Every time the routing is changed, the stream configurations need to be re-initialized. Signed-off-by:
Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Signed-off-by:
Vignesh Raghavendra <vigneshr@ti.com>
-
Add a helper function to set the subdev routing. The helper can be used from subdev driver's set_routing op to store the routing table. Signed-off-by:
Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Signed-off-by:
Vignesh Raghavendra <vigneshr@ti.com>
-