From c701b35b42d50537122486e47006d1c6ce952240 Mon Sep 17 00:00:00 2001 From: pbrook Date: Tue, 1 Jul 2008 23:16:53 +0000 Subject: Fix i2c save/restore. git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@4820 c046a42c-6fe2-441c-8c8c-71466251a162 --- hw/i2c.c | 49 +++++++++++++++++++++++++++---------------------- hw/i2c.h | 3 +-- hw/pxa2xx.c | 8 +++++--- 3 files changed, 33 insertions(+), 27 deletions(-) diff --git a/hw/i2c.c b/hw/i2c.c index e590801af3..5d283fb4cb 100644 --- a/hw/i2c.c +++ b/hw/i2c.c @@ -14,14 +14,38 @@ struct i2c_bus { i2c_slave *current_dev; i2c_slave *dev; + int saved_address; }; +static void i2c_bus_save(QEMUFile *f, void *opaque) +{ + i2c_bus *bus = (i2c_bus *)opaque; + + qemu_put_byte(f, bus->current_dev ? bus->current_dev->address : -1); +} + +static int i2c_bus_load(QEMUFile *f, void *opaque, int version_id) +{ + i2c_bus *bus = (i2c_bus *)opaque; + + if (version_id != 1) + return -EINVAL; + + /* The bus is loaded before attached devices, so load and save the + current device id. Devices will check themselves as loaded. */ + bus->saved_address = qemu_get_be32(f); + bus->current_dev = NULL; + + return 0; +} + /* Create a new I2C bus. */ i2c_bus *i2c_init_bus(void) { i2c_bus *bus; bus = (i2c_bus *)qemu_mallocz(sizeof(i2c_bus)); + register_savevm("i2c_bus", -1, 1, i2c_bus_save, i2c_bus_load, bus); return bus; } @@ -37,6 +61,7 @@ i2c_slave *i2c_slave_init(i2c_bus *bus, int address, int size) dev->address = address; dev->next = bus->dev; bus->dev = dev; + dev->bus = bus; return dev; } @@ -115,28 +140,6 @@ void i2c_nack(i2c_bus *bus) dev->event(dev, I2C_NACK); } -void i2c_bus_save(QEMUFile *f, i2c_bus *bus) -{ - qemu_put_byte(f, bus->current_dev ? bus->current_dev->address : 0x00); -} - -void i2c_bus_load(QEMUFile *f, i2c_bus *bus) -{ - i2c_slave *dev; - uint8_t address = qemu_get_byte(f); - - if (address) { - for (dev = bus->dev; dev; dev = dev->next) - if (dev->address == address) { - bus->current_dev = dev; - return; - } - - fprintf(stderr, "%s: I2C slave with address %02x disappeared\n", - __FUNCTION__, address); - } -} - void i2c_slave_save(QEMUFile *f, i2c_slave *dev) { qemu_put_byte(f, dev->address); @@ -145,4 +148,6 @@ void i2c_slave_save(QEMUFile *f, i2c_slave *dev) void i2c_slave_load(QEMUFile *f, i2c_slave *dev) { dev->address = qemu_get_byte(f); + if (dev->bus->saved_address == dev->address) + dev->bus->current_dev = dev; } diff --git a/hw/i2c.h b/hw/i2c.h index f297237b72..d3e4352b1f 100644 --- a/hw/i2c.h +++ b/hw/i2c.h @@ -30,6 +30,7 @@ struct i2c_slave /* Remaining fields for internal use by the I2C code. */ int address; void *next; + i2c_bus *bus; }; i2c_bus *i2c_init_bus(void); @@ -41,8 +42,6 @@ void i2c_end_transfer(i2c_bus *bus); void i2c_nack(i2c_bus *bus); int i2c_send(i2c_bus *bus, uint8_t data); int i2c_recv(i2c_bus *bus); -void i2c_bus_save(QEMUFile *f, i2c_bus *bus); -void i2c_bus_load(QEMUFile *f, i2c_bus *bus); void i2c_slave_save(QEMUFile *f, i2c_slave *dev); void i2c_slave_load(QEMUFile *f, i2c_slave *dev); diff --git a/hw/pxa2xx.c b/hw/pxa2xx.c index cb6670c354..fd663d9da1 100644 --- a/hw/pxa2xx.c +++ b/hw/pxa2xx.c @@ -1466,7 +1466,6 @@ static void pxa2xx_i2c_save(QEMUFile *f, void *opaque) qemu_put_8s(f, &s->ibmr); qemu_put_8s(f, &s->data); - i2c_bus_save(f, s->bus); i2c_slave_save(f, &s->slave); } @@ -1474,12 +1473,14 @@ static int pxa2xx_i2c_load(QEMUFile *f, void *opaque, int version_id) { struct pxa2xx_i2c_s *s = (struct pxa2xx_i2c_s *) opaque; + if (version_id != 1) + return -EINVAL; + qemu_get_be16s(f, &s->control); qemu_get_be16s(f, &s->status); qemu_get_8s(f, &s->ibmr); qemu_get_8s(f, &s->data); - i2c_bus_load(f, s->bus); i2c_slave_load(f, &s->slave); return 0; } @@ -1488,6 +1489,7 @@ struct pxa2xx_i2c_s *pxa2xx_i2c_init(target_phys_addr_t base, qemu_irq irq, uint32_t page_size) { int iomemtype; + /* FIXME: Should the slave device really be on a separate bus? */ struct pxa2xx_i2c_s *s = (struct pxa2xx_i2c_s *) i2c_slave_init(i2c_init_bus(), 0, sizeof(struct pxa2xx_i2c_s)); @@ -1502,7 +1504,7 @@ struct pxa2xx_i2c_s *pxa2xx_i2c_init(target_phys_addr_t base, pxa2xx_i2c_writefn, s); cpu_register_physical_memory(s->base & ~page_size, page_size, iomemtype); - register_savevm("pxa2xx_i2c", base, 0, + register_savevm("pxa2xx_i2c", base, 1, pxa2xx_i2c_save, pxa2xx_i2c_load, s); return s; -- cgit v1.2.3-55-g7522 pan> | | | variable 'err' is unmodified after initalization, so simply cleans up it and returns 0. Signed-off-by: YueHaibing <yuehaibing@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net> * af_unix: ensure POLLOUT on remote close() for connected dgram socketJason Baron2018-08-041-1/+6 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Applications use -ECONNREFUSED as returned from write() in order to determine that a socket should be closed. However, when using connected dgram unix sockets in a poll/write loop, a final POLLOUT event can be missed when the remote end closes. Thus, the poll is stuck forever: thread 1 (client) thread 2 (server) connect() to server write() returns -EAGAIN unix_dgram_poll() -> unix_recvq_full() is true close() ->unix_release_sock() ->wake_up_interruptible_all() unix_dgram_poll() (due to the wake_up_interruptible_all) -> unix_recvq_full() still is true ->free all skbs Now thread 1 is stuck and will not receive anymore wakeups. In this case, when thread 1 gets the -EAGAIN, it has not queued any skbs otherwise the 'free all skbs' step would in fact cause a wakeup and a POLLOUT return. So the race here is probably fairly rare because it means there are no skbs that thread 1 queued and that thread 1 schedules before the 'free all skbs' step. This issue was reported as a hang when /dev/log is closed. The fix is to signal POLLOUT if the socket is marked as SOCK_DEAD, which means a subsequent write() will get -ECONNREFUSED. Reported-by: Ian Lance Taylor <iant@golang.org> Cc: David Rientjes <rientjes@google.com> Cc: Rainer Weikusat <rweikusat@mobileactivedefense.com> Cc: Eric Dumazet <edumazet@google.com> Signed-off-by: Jason Baron <jbaron@akamai.com> Signed-off-by: David S. Miller <davem@davemloft.net> * ppp: mppe: Remove VLA usageKees Cook2018-08-031-26/+30 | | | | | | | | | | | | | In the quest to remove all stack VLA usage from the kernel[1], this removes the discouraged use of AHASH_REQUEST_ON_STACK (and associated VLA) by switching to shash directly and keeping the associated descriptor allocated with the regular state on the heap. [1] https://lkml.kernel.org/r/CA+55aFzCG-zNmZwX4A2FQpadafLfEzK6CC=qPXydAacU1RqZWA@mail.gmail.com Signed-off-by: Kees Cook <keescook@chromium.org> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: David S. Miller <davem@davemloft.net> * rxrpc: Push iov_iter up from rxrpc_kernel_recv_data() to callerDavid Howells2018-08-033-34/+29Star | | | | | | | | | Push iov_iter up from rxrpc_kernel_recv_data() to its caller to allow non-contiguous iovs to be passed down, thereby permitting file reading to be simplified in the AFS filesystem in a future patch. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net> * Merge branch 'dsa-systemport-WoL'David S. Miller2018-08-034-12/+29 |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Florian Fainelli says: ==================== net: dsa and systemport WoL changes This patch series extracts what was previously submitted as part of the "WAKE_FILTER" Wake-on-LAN patch series into patches that do not. Changes in this series: - properly align the dsa_is_cpu_port() check in first patch ==================== Signed-off-by: David S. Miller <davem@davemloft.net> | * net: systemport: Create helper to set MPDFlorian Fainelli2018-08-031-7/+13 | | | | | | | | | | | | | | | | | | | | Create a helper function to turn on/off MPD, this will be used to avoid duplicating code as we are going to add additional types of wake-up types. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net> | * net: systemport: Do not re-configure upon WoL interruptFlorian Fainelli2018-08-031-3/+1Star | | | | | | | | | | | | | | | | | | We already properly resume from Wake-on-LAN whether such a condition occured or not, no need to process the WoL interrupt for functional changes since that could race with other settings. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> | * net: dsa: bcm_sf2: Disable learning while in WoLFlorian Fainelli2018-08-032-1/+13 | | | | | | | | | | | | | | | | | | | | | | | | | | When we are in Wake-on-LAN, we operate with the host sofware not running a network stack, so we want to the switch to flood packets in order to cause a system wake-up when matching specific filters (unicast or multicast). This was not necessary before since we supported Magic Packet which are targeting a broadcast MAC address which the switch already floods. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net> | * net: dsa: bcm_sf2: Allow targeting CPU ports for CFP rulesFlorian Fainelli2018-08-031-1/+2 |/ | | | | | | | | | ds->enabled_port_mask only contains a bitmask of user-facing enabled ports, we also need to allow programming CFP rules that target CPU ports (e.g: ports 5 and 8). Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net> * Merge branch 'l2tp-mtu'David S. Miller2018-08-037-87/+47Star |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Guillaume Nault says: ==================== l2tp: sanitise MTU handling on sessions Most of the code handling sessions' MTU has no effect. The ->mtu field in struct l2tp_session might be used at session creation time, but neither PPP nor Ethernet pseudo-wires take updates into account. L2TP sessions don't have a concept of MTU, which is the reason why ->mtu is mostly ignored. MTU should remain a network device thing. Therefore this patch set does not try to propagate/update ->mtu to/from the device. That would complicate the code unnecessarily. Instead this field and the associated ioctl commands and netlink attributes are removed. Patch #1 defines l2tp_tunnel_dst_mtu() in order to simplify the following patches. Then patches #2 and #3 remove MTU handling from PPP and Ethernet pseudo-wires respectively. ==================== Signed-off-by: David S. Miller <davem@davemloft.net> | * l2tp: ignore L2TP_ATTR_MTUGuillaume Nault2018-08-036-24/+10Star | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This attribute's handling is broken. It can only be used when creating Ethernet pseudo-wires, in which case its value can be used as the initial MTU for the l2tpeth device. However, when handling update requests, L2TP_ATTR_MTU only modifies session->mtu. This value is never propagated to the l2tpeth device. Dump requests also return the value of session->mtu, which is not synchronised anymore with the device MTU. The same problem occurs if the device MTU is properly updated using the generic IFLA_MTU attribute. In this case, session->mtu is not updated, and L2TP_ATTR_MTU will report an invalid value again when dumping the session. It does not seem worthwhile to complexify l2tp_eth.c to synchronise session->mtu with the device MTU. Even the ip-l2tp manpage advises to use 'ip link' to initialise the MTU of l2tpeth devices (iproute2 does not handle L2TP_ATTR_MTU at all anyway). So let's just ignore it entirely. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr> Signed-off-by: David S. Miller <davem@davemloft.net> | * l2tp: simplify MTU handling in l2tp_pppGuillaume Nault2018-08-031-49/+18Star | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The value of the session's .mtu field, as defined by pppol2tp_connect() or pppol2tp_session_create(), is later overwritten by pppol2tp_session_init() (unless getting the tunnel's socket PMTU fails). This field is then only used when setting the PPP channel's MTU in pppol2tp_connect(). Furthermore, the SIOC[GS]IFMTU ioctls only act on the session's .mtu without propagating this value to the PPP channel, making them useless. This patch initialises the PPP channel's MTU directly and ignores the session's .mtu entirely. MTU is still computed by subtracting the PPPOL2TP_HEADER_OVERHEAD constant. It is not optimal, but that doesn't really matter: po->chan.mtu is only used when the channel is part of a multilink PPP bundle. Running multilink PPP over packet switched networks is certainly not going to be efficient, so not picking the best MTU does not harm (in the worst case, packets will just be fragmented by the underlay). The SIOC[GS]IFMTU ioctls are removed entirely (as opposed to simply ignored), because these ioctls commands are part of the requests that should be handled generically by the socket layer. PX_PROTO_OL2TP was the only socket type abusing these ioctls. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr> Signed-off-by: David S. Miller <davem@davemloft.net> | * l2tp: define l2tp_tunnel_dst_mtu()Guillaume Nault2018-08-033-21/+26 |/ | | | | | | | Consolidate retrieval of tunnel's socket mtu in order to simplify l2tp_eth and l2tp_ppp a bit. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr> Signed-off-by: David S. Miller <davem@davemloft.net> * Merge branch 'hns3-next'David S. Miller2018-08-037-20/+94 |\ | | | | | | | | | | | | | | | | | | | | | | | | Salil Mehta says: ==================== Some important fixes for HNS3 driver This patch presents some important fixes related to MSIX allocation in HNS3 driver. ==================== Signed-off-by: David S. Miller <davem@davemloft.net> | * net: hns3: Refine the MSIX allocation for PFJian Shen2018-08-033-4/+9 | | | | | | | | | | | | | | | | | | | | | | The offset of msix number for roce is different between different revision id. We should get it from firmware, instead of a fix value. This patch refines the msix allocation, make it compatible. Signed-off-by: Jian Shen <shenjian15@huawei.com> Signed-off-by: Peng Li <lipeng321@huawei.com> Signed-off-by: Salil Mehta <salil.mehta@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net> | * net: hns3: Fix MSIX allocation issue for VFJian Shen2018-08-034-16/+85 |/ | | | | | | | | | | | | | The msix number for vf is different, depends on the max vf number. Futherly if the vf supports roce, the offset of msix is not fixed. It's incorrect to fix the msix number to 33. This patch fixes it by querying the msix number from firmware, and adjusting it with roce support. Fixes: e2cb1dec9779 ("net: hns3: Add HNS3 VF HCL(Hardware Compatibility Layer) Support") Signed-off-by: Jian Shen <shenjian15@huawei.com> Signed-off-by: Peng Li <lipeng321@huawei.com> Signed-off-by: Salil Mehta <salil.mehta@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net> * rxrpc: Reuse SKCIPHER_REQUEST_ON_STACK bufferKees Cook2018-08-031-12/+13 | | | | | | | | | | | | | | | | | The use of SKCIPHER_REQUEST_ON_STACK() will trigger FRAME_WARN warnings (when less than 2048) once the VLA is no longer hidden from the check: net/rxrpc/rxkad.c:398:1: warning: the frame size of 1152 bytes is larger than 1024 bytes [-Wframe-larger-than=] net/rxrpc/rxkad.c:242:1: warning: the frame size of 1152 bytes is larger than 1024 bytes [-Wframe-larger-than=] This passes the initial SKCIPHER_REQUEST_ON_STACK allocation to the leaf functions for reuse. Two requests allocated on the stack is not needed when only one is used at a time. Signed-off-by: Kees Cook <keescook@chromium.org> Acked-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: David S. Miller <davem@davemloft.net> * net: sched: fix flush on non-existing chainJiri Pirko2018-08-031-0/+7 | | | | | | | | | | | | | User was able to perform filter flush on chain 0 even if it didn't have any filters in it. With the patch that avoided implicit chain 0 creation, this changed. So in case user wants filter flush on chain which does not exist, just return success. There's no reason for non-0 chains to behave differently than chain 0, so do the same for them. Reported-by: Ido Schimmel <idosch@mellanox.com> Fixes: f71e0ca4db18 ("net: sched: Avoid implicit chain 0 creation") Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net> * bnxt_en: combine 'else if' and 'else' into single branchYueHaibing2018-08-031-2/+6 | | | | | | | | | | | | The else-if branch and else branch set mac_ok to true similarly, so combine the two into single else branch. Also add comments to explain the two conditions, which from Michael Chan and Vasundhara Volam. Signed-off-by: YueHaibing <yuehaibing@huawei.com> Acked-by: Michael Chan <michael.chan@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net> * tools: bpf: fix BTF code added twice to different treesJakub Kicinski2018-08-032-18/+0Star | | | | | | | | | | | | | | commit 38d5d3b3d5db ("bpf: Introduce BPF_ANNOTATE_KV_PAIR") added to the bpf and net trees what commit 92b57121ca79 ("bpf: btf: export btf types and name by offset from lib") has already added to bpf-next/net-next, but in slightly different location. Remove the duplicates (to fix build of libbpf). Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net> * net/socket: remove duplicated init codeMatthieu Baerts2018-08-021-48/+3Star | | | | | | | | | | | | | This refactoring work has been started by David Howells in cdfbabfb2f0c (net: Work around lockdep limitation in sockets that use sockets) but the exact same day in 581319c58600 (net/socket: use per af lockdep classes for sk queues), Paolo Abeni added new classes. This reduces the amount of (nearly) duplicated code and eases the addition of new socket types. Signed-off-by: Matthieu Baerts <matthieu.baerts@tessares.net> Signed-off-by: David S. Miller <davem@davemloft.net> * xen-netback: use true and false for boolean valuesGustavo A. R. Silva2018-08-021-2/+2 | | | | | | | | | | | Return statements in functions returning bool should use true or false instead of an integer value. This issue was detected with the help of Coccinelle. Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com> Acked-by: Wei Liu <wei.liu2@citrix.com> Signed-off-by: David S. Miller <davem@davemloft.net> * net: hns: remove redundant variables 'max_frm' and 'tmp_mac_key'YueHaibing2018-08-022-14/+1Star | | | | | | | | | | | | | | Variables 'max_frm' and 'tmp_mac_key' are being assigned, but are never used,hence they are redundant and can be removed. fix fllowing warning: drivers/net/ethernet/hisilicon/hns/hns_dsaf_mac.c:461:6: warning: variable 'max_frm' set but not used [-Wunused-but-set-variable] drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c:1685:31: warning: variable 'tmp_mac_key' set but not used [-Wunused-but-set-variable] drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c:1855:41: warning: variable 'tmp_mac_key' set but not used [-Wunused-but-set-variable] Signed-off-by: YueHaibing <yuehaibing@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net> * Merge branch 'Add--clock-config-and-pm-support-to-bcm-iProc-mdio-mux'David S. Miller2018-08-024-17/+106 |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Arun Parameswaran says: ==================== Add clock config and pm support to bcm iProc mdio mux The patchset extends the Broadcom iProc mdio mux to add support for suspend/resume and the ability to configure the internal clock divider. The patchset also sets the scan control register to disable external master access. The base address of the mdio-mux-bcm-iproc is modified to point to the start of the mdio block's address space, to be able to access all the mdio's registers. The missing registers are required to configure the internal clock divider registers in some of the Broadcom SoC's. Changes from v3: - Removed 'platform_set_drvdata(pdev, NULL)' call (in patch 5/8) - Fixed the return code handling for the devm_clk_get() call (in patch 7/8) - Added Reviewed-by tag to Patch 8/8 Changes from v2: - Addressed Andrew's comments: - Moved to using devm_mdiobus_alloc. Added this as a separate patch. - Changed to reverse christmas tree order for variable declaration in the clock patch - Addressed Florian's comments: - Removed null checks for the clock before calling unprepare in both clock and pm patches. - Added check for EPROBE_DEFER when fetching the clock in the clock patch. - The patch to use the devm API has been added before the clock & pm patches. This patch is now patch '5' in the series. - Added reviewed-by tags to commit messages of patches which remain unmodified from v2. - Modified PM patch to use platform_get_drvdata() in suspend/resume API's, similar to the recent fix that went in for the remove() api. Changes from v1: - Addressed Andrew's comments. - Reworked the patches to be based on 'net-next' - Removed 'fixes' from the commit messages, the changes are related to the new features being added. - Maintained backward compatibility to older dt-blob's specifying base addresse with an offset. The correction is applied in the driver and a message is printed to update the dt-blob. - Re-worked and re-ordered the last four patches (4-7). - Added setting of the scan control register as a new patch - Added a call to 'clk_prepare_enable()' in the patch that adds the clock config support, removed the debug message when clock is not passed. - Simplified the pm support patch (removed the array used for the save/restore logic). ==================== Signed-off-by: David S. Miller <davem@davemloft.net> | * net: phy: Add pm support to Broadcom iProc mdio mux driverArun Parameswaran2018-08-021-0/+27 | | | | | | | | | | | | | | | | | | Add support for suspend and resume to the Broadcom iProc mdio mux driver. Signed-off-by: Arun Parameswaran <arun.parameswaran@broadcom.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> | * net: phy: Add support to configure clock in Broadcom iProc mdio muxArun Parameswaran2018-08-021-2/+39 | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add support to configure the internal rate adjust register based on the core clock supplied through device tree in the Broadcom iProc mdio mux. The operating frequency of the mdio mux block is 11MHz. This is derrived by dividing the clock to the mdio mux with the rate adjust register. In some SoC's the default values of the rate adjust register do not yield 11MHz. These SoC's are required to specify the clock via the device tree for proper operation. Signed-off-by: Arun Parameswaran <arun.parameswaran@broadcom.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> | * dt-bindings: net: Add clock handle to Broadcom iProc mdio muxArun Parameswaran2018-08-021-0/+3 | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add clock phandle, of the core clock driving the mdio block, as an optional property to the Broadcom iProc mdio mux. The clock, when specified, will be used to setup the rate adjust registers in the mdio to derrive the mdio's operating frequency. Signed-off-by: Arun Parameswaran <arun.parameswaran@broadcom.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net> | * net: phy: Use devm api for mdio bus allocation in bcm iproc mdio muxArun Parameswaran2018-08-021-5/+2Star | | | | | | | | | | | | | | | | | | Use devm_mdiobus_alloc() instead of mdiobus_alloc() in the Broadcom iProc mdio mux driver. Signed-off-by: Arun Parameswaran <arun.parameswaran@broadcom.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> | * net: phy: Disable external master access in bcm mdio mux driverArun Parameswaran2018-08-021-0/+15 | | | | | | | | | | | | | | | | | | | | | | | | | | Configure the scan control register in the Broadcom iProc mdio mux driver to disable access to external master. In some SoC's, the scan control register defaults to an incorrect value. Signed-off-by: Arun Parameswaran <arun.parameswaran@broadcom.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> | * arm64: dts: Fix the base address of the Broadcom iProc mdio muxArun Parameswaran2018-08-022-4/+4 | | | | | | | | | | | | | | | | | | | | Modify the base address of the mdio mux driver to point to the start of the mdio mux block's register address space. Signed-off-by: Arun Parameswaran <arun.parameswaran@broadcom.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> | * net: phy: Fix the register offsets in Broadcom iProc mdio mux driverArun Parameswaran2018-08-021-5/+15 | | | | | | | | | | | | | | | | | | | | | | | | | | | | Modify the register offsets in the Broadcom iProc mdio mux to start from the top of the register address space. Earlier, the base address pointed to the end of the block's register space. The base address will now point to the start of the mdio's address space. The offsets have been fixed to match this. Signed-off-by: Arun Parameswaran <arun.parameswaran@broadcom.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> | * dt-bindings: net: Fix Broadcom iProc mdio mux driver base addressArun Parameswaran2018-08-021-2/+2 |/ | | | | | | | | | | Modify the base address of the Broadcom iProc MDIO mux driver to point to the start of the block's register address space. Signed-off-by: Arun Parameswaran <arun.parameswaran@broadcom.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Reviewed-by: Rob Herring <robh@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net> * Merge ra.kernel.org:/pub/scm/linux/kernel/git/davem/netDavid S. Miller2018-08-02