]> git.ipfire.org Git - people/ms/linux.git/log
people/ms/linux.git
4 years agoregulator: dt-bindings: qcom,smd-rpm: Add PM8909
Stephan Gerhold [Thu, 23 Jun 2022 09:46:13 +0000 (11:46 +0200)] 
regulator: dt-bindings: qcom,smd-rpm: Add PM8909

Document the "qcom,rpm-pm8909-regulators" compatible for describing
the regulators available in the PM8909 PMIC (controlled via the RPM
firmware).

PM8909 is very similar to the existing PM8916 but lacks 3 of the
regulators (s3, s4 and l16).

Signed-off-by: Stephan Gerhold <stephan.gerhold@kernkonzept.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20220623094614.1410180-3-stephan.gerhold@kernkonzept.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoregulator: qcom_smd: Fix pm8916_pldo range
Stephan Gerhold [Thu, 23 Jun 2022 09:46:12 +0000 (11:46 +0200)] 
regulator: qcom_smd: Fix pm8916_pldo range

The PM8916 device specification [1] documents a programmable range of
1.75V to 3.337V with 12.5mV steps for the PMOS LDOs in PM8916. This
range is also used when controlling the regulator directly using the
qcom_spmi-regulator driver ("ult_pldo" there).

However, for some reason the qcom_smd-regulator driver allows a much
larger range for the same hardware component. This could be simply a
typo, since the start of the range is essentially just missing a '1'.

In practice this does not cause any major problems, since the driver
just sends the actual voltage to the RPM firmware instead of making use
of the incorrect voltage selector. Still, having the wrong range there
is confusing and prevents the regulator core from validating requests
correctly.

[1]: https://developer.qualcomm.com/download/sd410/pm8916pm8916-1-power-management-ic-device-specification.pdf

Fixes: 57d6567680ed ("regulator: qcom-smd: Add PM8916 support")
Signed-off-by: Stephan Gerhold <stephan.gerhold@kernkonzept.com>
Link: https://lore.kernel.org/r/20220623094614.1410180-2-stephan.gerhold@kernkonzept.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoregulator: mt6370: Use the correct header for platform_device_id
ChiYuan Huang [Wed, 29 Jun 2022 01:41:01 +0000 (09:41 +0800)] 
regulator: mt6370: Use the correct header for platform_device_id

'platform_device_id' struct is defined in 'mod_devicetable.h'.
Even 'of.h' also includes this header usage. The 'of.h' cannot be removed
due to 'of_match_ptr' function.

Signed-off-by: ChiYuan Huang <cy_huang@richtek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Link: https://lore.kernel.org/r/1656466861-7737-2-git-send-email-u0084500@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agoregulator: mt6370: Use 'fwnode_gpiod_get_index' to fix gpio parsing
ChiYuan Huang [Wed, 29 Jun 2022 01:41:00 +0000 (09:41 +0800)] 
regulator: mt6370: Use 'fwnode_gpiod_get_index' to fix gpio parsing

From the common binding, 'enable-gpio' or 'enable-gpios' are all well
for external 'enable' gpio.

'gpiod_get_from_of_node' only parse the 'enable' property, it need to
add the gpio suffix. It's more convenient to use fwnode_gpiod_get_index.
Although fwnode parsing is not preferred, but 'of_parse_cb' already can
guarantee the callback will only be used by regulator of_node parsing.

Signed-off-by: ChiYuan Huang <cy_huang@richtek.com>
Link: https://lore.kernel.org/r/1656466861-7737-1-git-send-email-u0084500@gmail.com
Signed-off-by: Mark Brown <broonie@kernel.org>
4 years agocoresight: configfs: Fix unload of configurations on module exit
Mike Leach [Tue, 28 Jun 2022 17:30:03 +0000 (18:30 +0100)] 
coresight: configfs: Fix unload of configurations on module exit

Any loaded configurations must be correctly unloaded on coresight module
exit, or issues can arise with nested locking in the configfs directory
code if built with CONFIG_LOCKDEP.

Prior to this patch, the preloaded configuration configfs directory entries
were being unloaded by the recursive code in
configfs_unregister_subsystem().

However, when built with CONFIG_LOCKDEP, this caused a nested lock warning,
which was not mitigated by the LOCKDEP dependent code in fs/configfs/dir.c
designed to prevent this, due to the different directory levels for the
root of the directory being removed.

As the preloaded (and all other) configurations are registered after
configfs_register_subsystem(), we now explicitly unload them before the
call to configfs_unregister_subsystem().

The new routine cscfg_unload_cfgs_on_exit() iterates through the load
owner list to unload any remaining configurations that were not unloaded
by the user before the module exits. This covers both the
CSCFG_OWNER_PRELOAD and CSCFG_OWNER_MODULE owner types, and will be
extended to cover future load owner types for CoreSight configurations.

Fixes: eb2ec49606c2 ("coresight: syscfg: Update load API for config loadable modules")
Reported-by: Suzuki Poulose <suzuki.poulose@arm.com>
Signed-off-by: Mike Leach <mike.leach@linaro.org>
Reviewed-and-tested-by: Suzuki K Poulose <suzuki.poulose@arm.com>
Link: https://lore.kernel.org/r/20220628173004.30002-2-mike.leach@linaro.org
Signed-off-by: Mathieu Poirier <mathieu.poirier@linaro.org>
4 years agogfs2: List traversal in do_promote is safe
Andreas Gruenbacher [Sat, 11 Jun 2022 03:00:23 +0000 (05:00 +0200)] 
gfs2: List traversal in do_promote is safe

In do_promote(), we're never removing the current entry from the list
and so the list traversal is actually safe.  Switch back to
list_for_each_entry().

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
4 years agogfs2: do_promote glock holder stealing fix
Bob Peterson [Fri, 10 Jun 2022 22:53:32 +0000 (00:53 +0200)] 
gfs2: do_promote glock holder stealing fix

In do_promote(), when the glock had no strong holders, we were
accidentally calling demote_incompat_holders() with new_gh == NULL, so
no weak holders were considered incompatible.  Instead, the new holder
should have been passed in.

For doing that, the HIF_HOLDER flag needs to be set in new_gh to prevent
may_grant() from complaining.  This means that the new holder will now
be recognized as a current holder, so skip over it explicitly in
demote_incompat_holders() to prevent it from being dequeued.

To further clarify things, we can now rename new_gh to current_gh in
demote_incompat_holders(); after all, the HIF_HOLDER flag is already set,
which means the new holder is already a current holder.

Signed-off-by: Bob Peterson <rpeterso@redhat.com>
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
4 years agogfs2: Use better variable name
Andreas Gruenbacher [Fri, 10 Jun 2022 22:43:00 +0000 (00:43 +0200)] 
gfs2: Use better variable name

In do_promote() and add_to_queue(), use current_gh as the variable name
for the first strong holder we could find: this matches the variable
name is may_grant(), and more clearly indicates that we're interested in
one (any) of the current strong holders.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
4 years agogfs2: Make go_instantiate take a glock
Andreas Gruenbacher [Fri, 10 Jun 2022 10:06:06 +0000 (12:06 +0200)] 
gfs2: Make go_instantiate take a glock

Make go_instantiate take a glock instead of a glock holder as its argument:
this handler is supposed to instantiate the object associated with the glock.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
4 years agogfs2: Add new go_held glock operation
Andreas Gruenbacher [Fri, 10 Jun 2022 09:42:33 +0000 (11:42 +0200)] 
gfs2: Add new go_held glock operation

Right now, inode_go_instantiate() contains functionality that relates to
how a glock is held rather than the glock itself, like waiting for
pending direct I/O to complete and completing interrupted truncates.
This code is meant to be run each time a holder is acquired, but
go_instantiate is actually only called once, when the glock is
instantiated.

To fix that, introduce a new go_held glock operation that is called each
time a glock holder is acquired.  Move the holder specific code in
inode_go_instantiate() over to inode_go_held().

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
4 years agogfs2: Revert 'Fix "truncate in progress" hang'
Andreas Gruenbacher [Thu, 2 Jun 2022 20:15:02 +0000 (15:15 -0500)] 
gfs2: Revert 'Fix "truncate in progress" hang'

Now that interrupted truncates are completed in the context of the
process taking the glock, there is no need for the glock state engine to
delegate that task to gfs2_quotad or for quotad to perform those
truncates anymore.  Get rid of the obsolete associated infrastructure.

Reverts commit 813e0c46c9e2 ("GFS2: Fix "truncate in progress" hang").

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Bob Peterson <rpeterso@redhat.com>
4 years agogfs2: Instantiate glocks ouside of glock state engine
Andreas Gruenbacher [Sat, 11 Jun 2022 03:04:11 +0000 (05:04 +0200)] 
gfs2: Instantiate glocks ouside of glock state engine

Instantiate glocks outside of the glock state engine: there is no real
reason for instantiating them inside the glock state engine; it only
complicates the code.

Instead, instantiate them in gfs2_glock_wait() and gfs2_glock_async_wait()
using the new gfs2_glock_holder_ready() helper.  On top of that, the only
other place that acquires a glock without using gfs2_glock_wait() or
gfs2_glock_async_wait() is gfs2_upgrade_iopen_glock(), so call
gfs2_glock_holder_ready() there as well.

If a dinode has a pending truncate, the glock-specific instantiate function
for inodes wakes up the truncate function in the quota daemon.  Waiting for
the completion of the truncate was previously done by the glock state
engine, but we now need to wait in inode_go_instantiate().

This also means that gfs2_instantiate() will now no longer return any
"special" error codes.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
4 years agogfs2: Fix up gfs2_glock_async_wait
Andreas Gruenbacher [Thu, 9 Jun 2022 11:39:10 +0000 (13:39 +0200)] 
gfs2: Fix up gfs2_glock_async_wait

Since commit 1fc05c8d8426 ("gfs2: cancel timed-out glock requests"), a
pending locking request can be canceled by calling gfs2_glock_dq() on
the pending holder.  In gfs2_glock_async_wait(), when we time out, use
that to cancel the remaining locking requests and dequeue the locking
requests already granted.  That's simpler as well as more efficient than
waiting for all locking requests to eventually be granted and dequeuing
them then.

In addition, gfs2_glock_async_wait() promises that by the time the
function completes, all glocks are either granted or dequeued, but the
implementation doesn't keep that promise if individual locking requests
fail.  Fix that as well.

Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
4 years agospi support for Exynos Auto v9 SoC
Mark Brown [Wed, 29 Jun 2022 14:43:11 +0000 (15:43 +0100)] 
spi support for Exynos Auto v9 SoC

Merge series from Chanho Park <chanho61.park@samsung.com>:

Add to support Exynos Auto v9 SoC's spi. By supporting USI(Universal
Serial Interface) mode, the SoC can support up to 12 spi ports. Thus, we
need to increase MAX_SPI_PORTS from 6 to 12. The spi of the SoC can
support loopback mode unlike previous exynos SoCs. To separate the
feature, we need to add .has_loopback to the s3c64xx_spi_port_config.
Furthermore, it uses 4 as the default internal clock divider. We also
need to clk_div field of the structure and assign "2" as the default
value to the existing SoC's port config.
Device tree definitions of exynosautov9-spi will be added in separated
patchset to include usi(i2c/uart/spi) nodes all together.

4 years agoASoC: codecs: add WSA883x support
Mark Brown [Wed, 29 Jun 2022 14:43:09 +0000 (15:43 +0100)] 
ASoC: codecs: add WSA883x support

Merge series from Srinivas Kandagatla <srinivas.kandagatla@linaro.org>:

This patchset adds support for WSA883x smart speaker amplifier codec
connected via SoundWire. This codec also has a temperature sensor used
for speaker protection, support for this is not added yet.

Most of the code is derived from Qualcomm downstream msm-5.10 kernel.
Thanks to Patrick Lai's Team.

This codec is tested on SM8450 MTP.

4 years agoblock: simplify disk_set_independent_access_ranges
Christoph Hellwig [Wed, 29 Jun 2022 06:20:13 +0000 (08:20 +0200)] 
block: simplify disk_set_independent_access_ranges

Lift setting disk->ia_ranges from disk_register_independent_access_ranges
into disk_set_independent_access_ranges, and make the behavior the same
for the registered vs non-registered queue cases.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Tested-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Link: https://lore.kernel.org/r/20220629062013.1331068-3-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
4 years agoblock: move ->ia_ranges from the request_queue to the gendisk
Christoph Hellwig [Wed, 29 Jun 2022 06:20:12 +0000 (08:20 +0200)] 
block: move ->ia_ranges from the request_queue to the gendisk

Independent access ranges only matter for file system I/O and are only
valid with a registered gendisk, so move them there.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Tested-by: Damien Le Moal <damien.lemoal@opensource.wdc.com>
Link: https://lore.kernel.org/r/20220629062013.1331068-2-hch@lst.de
Signed-off-by: Jens Axboe <axboe@kernel.dk>
4 years agoblock: remove "select BLK_RQ_IO_DATA_LEN" from BLK_CGROUP_IOCOST dependency
Ying Sun [Wed, 29 Jun 2022 06:24:09 +0000 (14:24 +0800)] 
block: remove "select BLK_RQ_IO_DATA_LEN" from BLK_CGROUP_IOCOST dependency

The configuration item BLK_RQ_IO_DATA_LEN is not declared in the kernel.
Select BLK_RQ_IO_DATA_LEN is meaningless which could be removed.

Signed-off-by: Ying Sun <sunying@nj.iscas.ac.cn>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Link: https://lore.kernel.org/r/20220629062409.19458-1-sunying@nj.iscas.ac.cn
Signed-off-by: Jens Axboe <axboe@kernel.dk>
4 years agomnt_idmapping: align kernel doc and parameter order
Christian Brauner [Wed, 29 Jun 2022 14:31:12 +0000 (16:31 +0200)] 
mnt_idmapping: align kernel doc and parameter order

The kernel documentation added for the new helpers had a few tiny
ordering issues. Fix them.

Signed-off-by: Christian Brauner (Microsoft) <brauner@kernel.org>
4 years agonvme: fix regression when disconnect a recovering ctrl
Ruozhu Li [Thu, 23 Jun 2022 06:45:39 +0000 (14:45 +0800)] 
nvme: fix regression when disconnect a recovering ctrl

We encountered a problem that the disconnect command hangs.
After analyzing the log and stack, we found that the triggering
process is as follows:
CPU0                          CPU1
                                nvme_rdma_error_recovery_work
                                  nvme_rdma_teardown_io_queues
nvme_do_delete_ctrl                 nvme_stop_queues
  nvme_remove_namespaces
  --clear ctrl->namespaces
                                    nvme_start_queues
                                    --no ns in ctrl->namespaces
    nvme_ns_remove                  return(because ctrl is deleting)
      blk_freeze_queue
        blk_mq_freeze_queue_wait
        --wait for ns to unquiesce to clean infligt IO, hang forever

This problem was not found in older kernels because we will flush
err work in nvme_stop_ctrl before nvme_remove_namespaces.It does not
seem to be modified for functional reasons, the patch can be revert
to solve the problem.

Revert commit 794a4cb3d2f7 ("nvme: remove the .stop_ctrl callout")

Signed-off-by: Ruozhu Li <liruozhu@huawei.com>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
4 years agonvme-pci: add NVME_QUIRK_BOGUS_NID for ADATA XPG SX6000LNP (AKA SPECTRIX S40G)
Pablo Greco [Sat, 25 Jun 2022 12:15:02 +0000 (09:15 -0300)] 
nvme-pci: add NVME_QUIRK_BOGUS_NID for ADATA XPG SX6000LNP (AKA SPECTRIX S40G)

ADATA XPG SPECTRIX S40G drives report bogus eui64 values that appear to
be the same across drives in one system. Quirk them out so they are
not marked as "non globally unique" duplicates.

Before:
[    2.258919] nvme nvme1: pci function 0000:06:00.0
[    2.264898] nvme nvme2: pci function 0000:05:00.0
[    2.323235] nvme nvme1: failed to set APST feature (2)
[    2.326153] nvme nvme2: failed to set APST feature (2)
[    2.333935] nvme nvme1: allocated 64 MiB host memory buffer.
[    2.336492] nvme nvme2: allocated 64 MiB host memory buffer.
[    2.339611] nvme nvme1: 7/0/0 default/read/poll queues
[    2.341805] nvme nvme2: 7/0/0 default/read/poll queues
[    2.346114]  nvme1n1: p1
[    2.347197] nvme nvme2: globally duplicate IDs for nsid 1
After:
[    2.427715] nvme nvme1: pci function 0000:06:00.0
[    2.427771] nvme nvme2: pci function 0000:05:00.0
[    2.488154] nvme nvme2: failed to set APST feature (2)
[    2.489895] nvme nvme1: failed to set APST feature (2)
[    2.498773] nvme nvme2: allocated 64 MiB host memory buffer.
[    2.500587] nvme nvme1: allocated 64 MiB host memory buffer.
[    2.504113] nvme nvme2: 7/0/0 default/read/poll queues
[    2.507026] nvme nvme1: 7/0/0 default/read/poll queues
[    2.509467] nvme nvme2: Ignoring bogus Namespace Identifiers
[    2.512804] nvme nvme1: Ignoring bogus Namespace Identifiers
[    2.513698]  nvme1n1: p1

Signed-off-by: Pablo Greco <pgreco@centosproject.org>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Chaitanya Kulkarni <kch@nvidia.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Christoph Hellwig <hch@lst.de>
4 years agonvme-tcp: always fail a request when sending it failed
Sagi Grimberg [Sun, 26 Jun 2022 09:24:51 +0000 (12:24 +0300)] 
nvme-tcp: always fail a request when sending it failed

queue stoppage and inflight requests cancellation is fully fenced from
io_work and thus failing a request from this context. Hence we don't
need to try to guess from the socket retcode if this failure is because
the queue is about to be torn down or not.

We are perfectly safe to just fail it, the request will not be cancelled
later on.

This solves possible very long shutdown delays when the users issues a
'nvme disconnect-all'

Reported-by: Daniel Wagner <dwagner@suse.de>
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
4 years agonvmet-tcp: fix regression in data_digest calculation
Sagi Grimberg [Thu, 23 Jun 2022 21:49:53 +0000 (00:49 +0300)] 
nvmet-tcp: fix regression in data_digest calculation

Data digest calculation iterates over command mapped iovec. However
since commit bac04454ef9f we unmap the iovec before we handle the data
digest, and since commit 69b85e1f1d1d we clear nr_mapped when we unmap
the iov.

Instead of open-coding the command iov traversal, simply call
crypto_ahash_digest with the command sg that is already allocated (we
already do that for the send path). Rename nvmet_tcp_send_ddgst to
nvmet_tcp_calc_ddgst and call it from send and recv paths.

Fixes: 69b85e1f1d1d ("nvmet-tcp: add an helper to free the cmd buffers")
Fixes: bac04454ef9f ("nvmet-tcp: fix kmap leak when data digest in use")
Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Signed-off-by: Christoph Hellwig <hch@lst.de>
4 years agoARM: dts: r9a06g032-rzn1d400-db: Add switch description
Clément Léger [Fri, 24 Jun 2022 14:40:00 +0000 (16:40 +0200)] 
ARM: dts: r9a06g032-rzn1d400-db: Add switch description

Add the description for the switch, GMAC2 and MII converter.  With these
definitions, the switch ports 0 and 1 (MII ports 5 and 4) are working on
the RZ/N1D-DB board.

Signed-off-by: Clément Léger <clement.leger@bootlin.com>
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Link: https://lore.kernel.org/r/20220624144001.95518-16-clement.leger@bootlin.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
4 years agodt-bindings: net: pcs: add bindings for Renesas RZ/N1 MII converter
Clément Léger [Fri, 24 Jun 2022 14:39:49 +0000 (16:39 +0200)] 
dt-bindings: net: pcs: add bindings for Renesas RZ/N1 MII converter

This MII converter can be found on the RZ/N1 processor family. The MII
converter ports are declared as subnodes which are then referenced by
users of the PCS driver such as the switch.

Signed-off-by: Clément Léger <clement.leger@bootlin.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Link: https://lore.kernel.org/r/20220624144001.95518-5-clement.leger@bootlin.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
4 years agoreset: Fix devm bulk optional exclusive control getter
Serge Semin [Fri, 24 Jun 2022 14:18:45 +0000 (17:18 +0300)] 
reset: Fix devm bulk optional exclusive control getter

Most likely due to copy-paste mistake the device managed version of the
denoted reset control getter has been implemented with invalid semantic,
which can be immediately spotted by having "WARN_ON(shared && acquired)"
warning in the system log as soon as the method is called. Anyway let's
fix it by altering the boolean arguments passed to the
__devm_reset_control_bulk_get() method from
- shared = true, optional = false, acquired = true
to
+ shared = false, optional = true, acquired = true
That's what they were supposed to be in the first place (see the non-devm
version of the same method: reset_control_bulk_get_optional_exclusive()).

Fixes: 48d71395896d ("reset: Add reset_control_bulk API")
Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>
Reviewed-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Link: https://lore.kernel.org/r/20220624141853.7417-2-Sergey.Semin@baikalelectronics.ru
4 years agoMAINTAINERS: rectify entry for SYNOPSYS AXS10x RESET CONTROLLER DRIVER
Lukas Bulwahn [Wed, 1 Jun 2022 08:22:39 +0000 (10:22 +0200)] 
MAINTAINERS: rectify entry for SYNOPSYS AXS10x RESET CONTROLLER DRIVER

Commit 820f722c05dd ("dt-bindings: reset: snps,axs10x-reset: Convert to
yaml") converts snps,axs10x-reset.txt to yaml, but misses to adjust its
reference in MAINTAINERS.

Hence, ./scripts/get_maintainer.pl --self-test=patterns complains about a
broken reference.

Repair this file reference in SYNOPSYS AXS10x RESET CONTROLLER DRIVER.

Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Link: https://lore.kernel.org/r/20220601082239.12009-1-lukas.bulwahn@gmail.com
4 years agopinctrl: renesas: r8a779f0: Remove unused POC2
Geert Uytterhoeven [Wed, 15 Jun 2022 13:59:41 +0000 (15:59 +0200)] 
pinctrl: renesas: r8a779f0: Remove unused POC2

The POWER Condition Control Register 2 (POC2) is unused, and the
documentation does not define any valid bits.  Remove it.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/d8a9ea39b49d24e39f4da3f00b64bce34016887d.1655301529.git.geert+renesas@glider.be
4 years agoreset: microchip-sparx5: allow building as a module
Clément Léger [Fri, 17 Jun 2022 10:37:30 +0000 (12:37 +0200)] 
reset: microchip-sparx5: allow building as a module

Set RESET_MCHP_SPARX5 as a tristate and add MODULE_DEVICE_TABLE() to
allow building this driver as a module.

Signed-off-by: Clément Léger <clement.leger@bootlin.com>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Link: https://lore.kernel.org/r/20220617103730.490588-1-clement.leger@bootlin.com
4 years agoARM: dts: r9a06g032: Describe switch
Clément Léger [Fri, 24 Jun 2022 14:39:59 +0000 (16:39 +0200)] 
ARM: dts: r9a06g032: Describe switch

Add the description of the switch that is present on the RZ/N1 SoC. This
description includes ethernet-port descriptions for all the ports that
are present on the switch along with their connection to the MII
converter ports and to the GMAC for the CPU port.

Signed-off-by: Clément Léger <clement.leger@bootlin.com>
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Link: https://lore.kernel.org/r/20220624144001.95518-15-clement.leger@bootlin.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
4 years agoARM: dts: r9a06g032: Describe GMAC2
Clément Léger [Fri, 24 Jun 2022 14:39:58 +0000 (16:39 +0200)] 
ARM: dts: r9a06g032: Describe GMAC2

The RZ/N1 SoC includes two MACs named GMACx that are compatible with the
"snps,dwmac" driver.  GMAC1 is connected directly to the MII converter
port 1.  GMAC2 however can be used as the MAC for the switch CPU
management port or can be muxed to be connected directly to the MII
converter port 2.  This commit adds the description for the GMAC2 which
will be used by the switch description.

Signed-off-by: Clément Léger <clement.leger@bootlin.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Link: https://lore.kernel.org/r/20220624144001.95518-14-clement.leger@bootlin.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
4 years agoARM: dts: r9a06g032: Describe MII converter
Clément Léger [Fri, 24 Jun 2022 14:39:57 +0000 (16:39 +0200)] 
ARM: dts: r9a06g032: Describe MII converter

Add the MII converter node which describes the MII converter that is
present on the RZ/N1 SoC.

Signed-off-by: Clément Léger <clement.leger@bootlin.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
Link: https://lore.kernel.org/r/20220624144001.95518-13-clement.leger@bootlin.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
4 years agodt-bindings: pinctrl: renesas: Remove spaces before #define
Geert Uytterhoeven [Wed, 15 Jun 2022 13:58:40 +0000 (15:58 +0200)] 
dt-bindings: pinctrl: renesas: Remove spaces before #define

Remove spaces at the beginning of lines with #defines.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/5188ef93a911ce3781b16530fdebbf0f0af462b6.1655301264.git.geert+renesas@glider.be
4 years agoarm64: dts: renesas: r9a07g054l2-smarc: Correct SoC name in comment
Chris Paterson [Thu, 23 Jun 2022 10:30:24 +0000 (11:30 +0100)] 
arm64: dts: renesas: r9a07g054l2-smarc: Correct SoC name in comment

This dts is for the RZ/V2L SMARC EVK, not RZ/G2L.

Fixes: f91c4c74796a ("arm64: dts: renesas: Add initial device tree for RZ/V2L SMARC EVK")
Signed-off-by: Chris Paterson <chris.paterson2@renesas.com>
Link: https://lore.kernel.org/r/20220623103024.24222-1-chris.paterson2@renesas.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
4 years agoARM: dts: renesas: Fix DA9063 watchdog subnode names
Geert Uytterhoeven [Tue, 21 Jun 2022 13:33:10 +0000 (15:33 +0200)] 
ARM: dts: renesas: Fix DA9063 watchdog subnode names

make dtbs_check:

    arch/arm/boot/dts/r8a7791-koelsch-single-memory-node.dtb: pmic@58: 'wdt' does not match any of the regexes: 'pinctrl-[0-9]+'
    From schema: Documentation/devicetree/bindings/mfd/dlg,da9063.yaml
    ...

Change the watchdog child node names to match the DA9063 DT bindings and
the Generic Names Recommendation in the Devicetree Specification.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/1dafdce285f7d14bec9e2033ac87fb30135895db.1655818230.git.geert+renesas@glider.be
4 years agoarm64: dts: renesas: r8a779m8: Drop operating points above 1.5 GHz
Geert Uytterhoeven [Fri, 17 Jun 2022 09:36:58 +0000 (11:36 +0200)] 
arm64: dts: renesas: r8a779m8: Drop operating points above 1.5 GHz

The highest-performance mode for the Cortex-A57 CPU cores supported on
R-Car H3Ne (R8A779M8) is the Power Optimized (1.5 GHz) mode.  The Normal
(1.6 GHz) and High Performance (1.7 GHz) modes are not supported.

Hence drop the "turbo-mode" entries from the operating points table
inherited from r8a77951.dtsi.

Fixes: 6e87525d751fac57 ("arm64: dts: renesas: Add Renesas R8A779M8 SoC support")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/aeb4530f7fbac8329b334dcb169382c836a5f32d.1655458564.git.geert+renesas@glider.be
4 years agoMAINTAINERS: Add Renesas SoC DT bindings to Renesas Architecture sections
Geert Uytterhoeven [Fri, 17 Jun 2022 09:04:10 +0000 (11:04 +0200)] 
MAINTAINERS: Add Renesas SoC DT bindings to Renesas Architecture sections

While Renesas SoC DT bindings documents started to appear under
Documentation/devicetree/bindings/soc/renesas, these are not yet covered
by the file and directory patterns in the Renesas ARM/ARM64 Architecture
sections.

Add the missing patterns.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/f99c03a95a103517418f0b23d3da45e0dd0ffb3b.1655456310.git.geert+renesas@glider.be
4 years agoNFC: nxp-nci: don't print header length mismatch on i2c error
Michael Walle [Mon, 27 Jun 2022 17:06:43 +0000 (19:06 +0200)] 
NFC: nxp-nci: don't print header length mismatch on i2c error

Don't print a misleading header length mismatch error if the i2c call
returns an error. Instead just return the error code without any error
message.

Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agoNFC: nxp-nci: Don't issue a zero length i2c_master_read()
Michael Walle [Mon, 27 Jun 2022 17:06:42 +0000 (19:06 +0200)] 
NFC: nxp-nci: Don't issue a zero length i2c_master_read()

There are packets which doesn't have a payload. In that case, the second
i2c_master_read() will have a zero length. But because the NFC
controller doesn't have any data left, it will NACK the I2C read and
-ENXIO will be returned. In case there is no payload, just skip the
second i2c master read.

Fixes: 6be88670fc59 ("NFC: nxp-nci_i2c: Add I2C support to NXP NCI driver")
Signed-off-by: Michael Walle <michael@walle.cc>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet: prestera: acl: add support for 'egress' rules
Maksym Glubokiy [Mon, 27 Jun 2022 09:50:18 +0000 (12:50 +0300)] 
net: prestera: acl: add support for 'egress' rules

The following is now supported:

  $ tc qdisc add PORT clsact
  $ tc filter add dev PORT egress ...

Signed-off-by: Maksym Glubokiy <maksym.glubokiy@plvision.eu>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agoselftests: forwarding: ethtool_extended_state: Convert to busywait
Petr Machata [Tue, 28 Jun 2022 10:37:44 +0000 (12:37 +0200)] 
selftests: forwarding: ethtool_extended_state: Convert to busywait

Currently, this script sets up the test scenario, which is supposed to end
in an inability of the system to negotiate a link. It then waits for a bit,
and verifies that the system can diagnose why the link was not established.

The wait time for the scenario where different link speeds are forced on
the two ends of a loopback cable, was set to 4 seconds, which exactly
covered it. As of a recent mlxsw firmware update, this time gets longer,
and this test starts failing.

The time that selftests currently wait for links to be established is
currently $WAIT_TIMEOUT, or 20 seconds. It seems reasonable that if this is
the time necessary to establish and bring up a link, it should also be
enough to determine that a link cannot be established and why.

Therefore in this patch, convert the sleeps to busywaits, so that if a
failure is established sooner (as is expected), the test runs quicker. And
use $WAIT_TIMEOUT as the time to wait.

Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Amit Cohen <amcohen@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonfp: flower: fix comment typos and formatting
Walter Heymans [Tue, 28 Jun 2022 12:18:02 +0000 (14:18 +0200)] 
nfp: flower: fix comment typos and formatting

A number of spelling and language mistakes in the flower section are
fixed. The spacing between the text inside some comments and the comment
symbols are also updated for consistency.

Signed-off-by: Walter Heymans <walter.heymans@corigine.com>
Reviewed-by: Louis Peens <louis.peens@corigine.com>
Signed-off-by: Simon Horman <simon.horman@corigine.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonfs: Leave pages in the pagecache if readpage failed
Matthew Wilcox (Oracle) [Mon, 16 May 2022 14:30:09 +0000 (10:30 -0400)] 
nfs: Leave pages in the pagecache if readpage failed

The pagecache handles readpage failing by itself; it doesn't want
filesystems to remove pages from under it.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
4 years agobuffer: Remove check for PageError
Matthew Wilcox (Oracle) [Thu, 26 May 2022 20:03:43 +0000 (16:03 -0400)] 
buffer: Remove check for PageError

If a buffer is completed with an error, its uptodate flag will be clear,
so the page_uptodate variable will have been set to 0.  There's no
need to check PageError here.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
4 years agoorangefs: Remove test for folio error
Matthew Wilcox (Oracle) [Fri, 29 Apr 2022 15:12:16 +0000 (11:12 -0400)] 
orangefs: Remove test for folio error

The page cache clears the error bit before calling ->read_folio(),
so this condition could never have been true.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
4 years agoiomap: Remove test for folio error
Matthew Wilcox (Oracle) [Wed, 25 May 2022 04:10:01 +0000 (00:10 -0400)] 
iomap: Remove test for folio error

Just because there has been a read error doesn't mean we should avoid
marking this part of the folio as uptodate.  Indeed, it may overwrite
the error part of the folio and let us mark the entire folio uptodate.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
4 years agojfs: Remove check for PageUptodate
Matthew Wilcox (Oracle) [Wed, 18 May 2022 03:32:34 +0000 (23:32 -0400)] 
jfs: Remove check for PageUptodate

Pages returned from read_mapping_page() are always uptodate, so
this check is unnecessary.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
4 years agoremap_range: Remove check of uptodate flag
Matthew Wilcox (Oracle) [Wed, 18 May 2022 03:29:06 +0000 (23:29 -0400)] 
remap_range: Remove check of uptodate flag

read_mapping_folio() returns an ERR_PTR if the folio is not
uptodate, so this check is simply dead code.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
4 years agoufs: Remove checks for PageError
Matthew Wilcox (Oracle) [Tue, 17 May 2022 22:12:25 +0000 (18:12 -0400)] 
ufs: Remove checks for PageError

If read_mapping_page() encounters an error, it returns an errno, not
a page with PageError set, or a page that is not Uptodate, so this is
dead code.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
4 years agoreiserfs: Remove check for PageError
Matthew Wilcox (Oracle) [Tue, 17 May 2022 22:12:25 +0000 (18:12 -0400)] 
reiserfs: Remove check for PageError

If read_mapping_page() encounters an error, it returns an errno, not a
page with PageError set, so this is dead code.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
4 years agontfs3: Remove check for PageError
Matthew Wilcox (Oracle) [Tue, 17 May 2022 22:12:25 +0000 (18:12 -0400)] 
ntfs3: Remove check for PageError

If read_mapping_page() encounters an error, it returns an errno, not a
page with PageError set, so this is dead code.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
4 years agontfs: Remove check for PageError
Matthew Wilcox (Oracle) [Tue, 17 May 2022 22:12:25 +0000 (18:12 -0400)] 
ntfs: Remove check for PageError

If read_mapping_page() encounters an error, it returns an errno, not a
page with PageError set, so this is dead code.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
4 years agonilfs2: Remove check for PageError
Matthew Wilcox (Oracle) [Tue, 17 May 2022 22:12:25 +0000 (18:12 -0400)] 
nilfs2: Remove check for PageError

If read_mapping_page() encounters an error, it returns an errno, not a
page with PageError set, so this test is not needed.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
4 years agoext2: Remove check for PageError
Matthew Wilcox (Oracle) [Tue, 17 May 2022 22:12:25 +0000 (18:12 -0400)] 
ext2: Remove check for PageError

If read_mapping_page() encounters an error, it returns an errno, not a
page with PageError set, so this test is not needed.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
4 years agontfs: Remove check for PageError
Matthew Wilcox (Oracle) [Tue, 17 May 2022 22:12:25 +0000 (18:12 -0400)] 
ntfs: Remove check for PageError

If read_mapping_page() encounters an error, it returns an errno, not a
page with PageError set, so this is dead code.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
4 years agohfsplus: Remove check for PageError
Matthew Wilcox (Oracle) [Tue, 17 May 2022 22:12:25 +0000 (18:12 -0400)] 
hfsplus: Remove check for PageError

If read_mapping_page() encounters an error, it returns an errno, not a
page with PageError set, so this is dead code.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
4 years agohfs: Remove check for PageError
Matthew Wilcox (Oracle) [Tue, 17 May 2022 22:12:25 +0000 (18:12 -0400)] 
hfs: Remove check for PageError

If read_mapping_page() encounters an error, it returns an errno, not a
page with PageError set, so this is dead code.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
4 years agofreevxfs: Remove check of PageError
Matthew Wilcox (Oracle) [Tue, 17 May 2022 22:12:25 +0000 (18:12 -0400)] 
freevxfs: Remove check of PageError

If read_mapping_page() encounters an error, it returns an errno, not a
page with PageError set, so this is dead code.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
4 years agoafs: Remove check of PageError
Matthew Wilcox (Oracle) [Fri, 13 May 2022 18:53:02 +0000 (14:53 -0400)] 
afs: Remove check of PageError

If read_mapping_page() encounters an error, it returns an errno, not a
page with PageError set, so this is dead code.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
4 years agoblock: Remove check of PageError
Matthew Wilcox (Oracle) [Tue, 17 May 2022 22:12:25 +0000 (18:12 -0400)] 
block: Remove check of PageError

If read_mapping_page() sees a page with PageError set, it returns a
PTR_ERR().  Checking PageError again is simply dead code.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
4 years agodocs: Improve ->read_folio documentation
Matthew Wilcox (Oracle) [Fri, 29 Apr 2022 12:45:43 +0000 (08:45 -0400)] 
docs: Improve ->read_folio documentation

Add information on the use of 'file', whether ->read_folio should be
synchronous, and steer new callers towards calling read_mapping_folio()
instead of calling ->read_folio directly.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
4 years agofilemap: Use filemap_read_folio() in do_read_cache_folio()
Matthew Wilcox (Oracle) [Thu, 12 May 2022 21:37:01 +0000 (17:37 -0400)] 
filemap: Use filemap_read_folio() in do_read_cache_folio()

By passing ->read_folio to filemap_read_folio(), we can use
filemap_read_folio() in do_read_cache_folio().

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
4 years agofilemap: Handle AOP_TRUNCATED_PAGE in do_read_cache_folio()
Matthew Wilcox (Oracle) [Thu, 12 May 2022 21:47:06 +0000 (17:47 -0400)] 
filemap: Handle AOP_TRUNCATED_PAGE in do_read_cache_folio()

If the call to filler() returns AOP_TRUNCATED_PAGE, we need to
retry the page cache lookup.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
4 years agofilemap: Move 'filler' case to the end of do_read_cache_folio()
Matthew Wilcox (Oracle) [Thu, 12 May 2022 21:12:21 +0000 (17:12 -0400)] 
filemap: Move 'filler' case to the end of do_read_cache_folio()

No functionality change intended; this simply moves code around to
disentangle the function a little.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
4 years agonetfs: Remove extern from function prototypes
Matthew Wilcox (Oracle) [Fri, 29 Apr 2022 12:49:28 +0000 (08:49 -0400)] 
netfs: Remove extern from function prototypes

The 'extern' keyword is not necessary and removing it lets us shorten
some lines.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
4 years agofilemap: Remove find_get_pages_range() and associated functions
Matthew Wilcox (Oracle) [Sat, 4 Jun 2022 21:46:02 +0000 (17:46 -0400)] 
filemap: Remove find_get_pages_range() and associated functions

All callers of find_get_pages_range(), pagevec_lookup_range() and
pagevec_lookup() have now been removed.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Acked-by: Christian Brauner (Microsoft) <brauner@kernel.org>
4 years agoshmem: Convert shmem_unlock_mapping() to use filemap_get_folios()
Matthew Wilcox (Oracle) [Sat, 4 Jun 2022 21:40:17 +0000 (17:40 -0400)] 
shmem: Convert shmem_unlock_mapping() to use filemap_get_folios()

This is a straightforward conversion.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Acked-by: Christian Brauner (Microsoft) <brauner@kernel.org>
4 years agovmscan: Add check_move_unevictable_folios()
Matthew Wilcox (Oracle) [Sat, 4 Jun 2022 21:39:09 +0000 (17:39 -0400)] 
vmscan: Add check_move_unevictable_folios()

Change the guts of check_move_unevictable_pages() over to use folios
and add check_move_unevictable_pages() as a wrapper.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Acked-by: Christian Brauner (Microsoft) <brauner@kernel.org>
4 years agonilfs2: Convert nilfs_copy_back_pages() to use filemap_get_folios()
Matthew Wilcox (Oracle) [Sat, 4 Jun 2022 20:40:39 +0000 (16:40 -0400)] 
nilfs2: Convert nilfs_copy_back_pages() to use filemap_get_folios()

Use folios throughout.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Acked-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Acked-by: Christian Brauner (Microsoft) <brauner@kernel.org>
4 years agohugetlbfs: Convert remove_inode_hugepages() to use filemap_get_folios()
Matthew Wilcox (Oracle) [Sat, 4 Jun 2022 20:39:04 +0000 (16:39 -0400)] 
hugetlbfs: Convert remove_inode_hugepages() to use filemap_get_folios()

Use folios throughout this function.  That removes the last caller of
huge_pagevec_release(), so delete that too.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Acked-by: Christian Brauner (Microsoft) <brauner@kernel.org>
4 years agof2fs: Convert f2fs_invalidate_compress_pages() to use filemap_get_folios()
Matthew Wilcox (Oracle) [Sat, 4 Jun 2022 20:27:58 +0000 (16:27 -0400)] 
f2fs: Convert f2fs_invalidate_compress_pages() to use filemap_get_folios()

Convert this function to use folios throughout.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Acked-by: Christian Brauner (Microsoft) <brauner@kernel.org>
Acked-by: Chao Yu <chao@kernel.org>
4 years agoext4: Convert mpage_map_and_submit_buffers() to use filemap_get_folios()
Matthew Wilcox (Oracle) [Sat, 4 Jun 2022 20:26:01 +0000 (16:26 -0400)] 
ext4: Convert mpage_map_and_submit_buffers() to use filemap_get_folios()

The called functions all use pages, so just convert back to a page.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Acked-by: Christian Brauner (Microsoft) <brauner@kernel.org>
4 years agoext4: Convert mpage_release_unused_pages() to use filemap_get_folios()
Matthew Wilcox (Oracle) [Fri, 3 Jun 2022 19:36:49 +0000 (15:36 -0400)] 
ext4: Convert mpage_release_unused_pages() to use filemap_get_folios()

If the folio is large, it may overlap the beginning or end of the
unused range.  If it does, we need to avoid invalidating it.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Acked-by: Christian Brauner (Microsoft) <brauner@kernel.org>
4 years agobuffer: Convert clean_bdev_aliases() to use filemap_get_folios()
Matthew Wilcox (Oracle) [Sat, 4 Jun 2022 20:24:22 +0000 (16:24 -0400)] 
buffer: Convert clean_bdev_aliases() to use filemap_get_folios()

Use a folio throughout this function.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Acked-by: Christian Brauner (Microsoft) <brauner@kernel.org>
4 years agofilemap: Add filemap_get_folios()
Matthew Wilcox (Oracle) [Fri, 3 Jun 2022 19:30:25 +0000 (15:30 -0400)] 
filemap: Add filemap_get_folios()

This is the equivalent of find_get_pages() but fills a folio_batch
instead of an array of pages.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Acked-by: Christian Brauner (Microsoft) <brauner@kernel.org>
4 years agofilemap: Remove add_to_page_cache() and add_to_page_cache_locked()
Matthew Wilcox (Oracle) [Wed, 1 Jun 2022 19:13:59 +0000 (15:13 -0400)] 
filemap: Remove add_to_page_cache() and add_to_page_cache_locked()

These functions have no more users, so delete them.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Acked-by: Mike Kravetz <mike.kravetz@oracle.com>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
4 years agohugetlb: Convert huge_add_to_page_cache() to use a folio
Matthew Wilcox (Oracle) [Wed, 1 Jun 2022 19:11:01 +0000 (15:11 -0400)] 
hugetlb: Convert huge_add_to_page_cache() to use a folio

Remove the last caller of add_to_page_cache()

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
Reviewed-by: Mike Kravetz <mike.kravetz@oracle.com>
Reviewed-by: Muchun Song <songmuchun@bytedance.com>
4 years agompage: Convert do_mpage_readpage() to use a folio
Matthew Wilcox (Oracle) [Sat, 11 Jun 2022 02:58:24 +0000 (22:58 -0400)] 
mpage: Convert do_mpage_readpage() to use a folio

Pass in a folio from mpage_readahead().  Also convert map_buffer_to_page()
to map_buffer_to_folio().  There's still no support for large folios here;
there are numerous places which depend on the folio being PAGE_SIZE.
The VM_BUG_ON prevents anyone from thinking that it will work.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
4 years agomm: Remove __delete_from_page_cache()
Matthew Wilcox (Oracle) [Wed, 29 Jun 2022 00:41:40 +0000 (20:41 -0400)] 
mm: Remove __delete_from_page_cache()

This wrapper is no longer used.  Remove it and all references to it.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
4 years agomm: Account dirty folios properly during splits
Matthew Wilcox (Oracle) [Wed, 29 Jun 2022 00:15:29 +0000 (20:15 -0400)] 
mm: Account dirty folios properly during splits

If the last folio in a file is split as a result of truncation,
we simply clear the dirty bits for the pages we're discarding.
That causes NR_FILE_DIRTY (among other counters) to be thrown off
and eventually Linux will hang in balance_dirty_pages_ratelimited()

Reported-by: Dave Chinner <dchinner@redhat.com>
Tested-by: Dave Chinner <dchinner@redhat.com>
Tested-by: Darrick J. Wong <djwong@kernel.org>
Fixes: d68eccad3706 ("mm/filemap: Allow large folios to be added to the page cache")
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
4 years agonet: tipc: fix possible refcount leak in tipc_sk_create()
Hangyu Hua [Wed, 29 Jun 2022 06:34:18 +0000 (14:34 +0800)] 
net: tipc: fix possible refcount leak in tipc_sk_create()

Free sk in case tipc_sk_insert() fails.

Signed-off-by: Hangyu Hua <hbh25y@gmail.com>
Reviewed-by: Tung Nguyen <tung.q.nguyen@dektech.com.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agoMerge branch 'dsa-microchip-ksz_chip_reg'
David S. Miller [Wed, 29 Jun 2022 12:48:00 +0000 (13:48 +0100)] 
Merge branch 'dsa-microchip-ksz_chip_reg'

Arun Ramadoss says:

====================
net: dsa: microchip: use ksz_chip_reg for

This patch series tries to use the same approach as struct ksz8 for
register which has different address for different switch family. It
moves the struct ksz8 from ksz8.h to struct ksz_chip_reg. Based on the
switch detect, the corresponding mask, reg and shifts are assigned.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet: dsa: microchip: move remaining register offset to ksz_chip_reg
Arun Ramadoss [Tue, 28 Jun 2022 17:13:29 +0000 (22:43 +0530)] 
net: dsa: microchip: move remaining register offset to ksz_chip_reg

This patch moves the broadcast ctrl, multicast ctrl and start control
registers from ksz_chip_dat to ksz_chip_reg.

Signed-off-by: Arun Ramadoss <arun.ramadoss@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet: dsa: microchip: add P_STP_CTRL to ksz_chip_reg
Arun Ramadoss [Tue, 28 Jun 2022 17:13:28 +0000 (22:43 +0530)] 
net: dsa: microchip: add P_STP_CTRL to ksz_chip_reg

This patch moves the stp_ctrl_reg from the ksz_chip_data to ksz_chip_reg
structure.

Signed-off-by: Arun Ramadoss <arun.ramadoss@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet: dsa: microchip: change the size of reg from u8 to u16
Arun Ramadoss [Tue, 28 Jun 2022 17:13:27 +0000 (22:43 +0530)] 
net: dsa: microchip: change the size of reg from u8 to u16

The register size for the ksz8 switches is u8 and for ksz9477 series is
u16.  To have common struct for ksz series switches the size of reg is
increased from u8 to u16.

Signed-off-by: Arun Ramadoss <arun.ramadoss@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet: dsa: microchip: remove the struct ksz8
Arun Ramadoss [Tue, 28 Jun 2022 17:13:26 +0000 (22:43 +0530)] 
net: dsa: microchip: remove the struct ksz8

This patch removes the struct ksz8 from ksz8.h which is no longer
needed. The platform bus specific details are now deferenced through
dev->priv.

Signed-off-by: Arun Ramadoss <arun.ramadoss@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet: dsa: microchip: move ksz8->shifts to ksz_common
Arun Ramadoss [Tue, 28 Jun 2022 17:13:25 +0000 (22:43 +0530)] 
net: dsa: microchip: move ksz8->shifts to ksz_common

This patch moves ksz8->shifts from ksz8795.c to ksz_common.c. The shifts
are dereferenced using dev->info->shifts.

Signed-off-by: Arun Ramadoss <arun.ramadoss@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet: dsa: microchip: move ksz8->masks to ksz_common
Arun Ramadoss [Tue, 28 Jun 2022 17:13:24 +0000 (22:43 +0530)] 
net: dsa: microchip: move ksz8->masks to ksz_common

This patch moves the ksz8->masks from ksz8795.c to ksz_common.c. The
mask will be dereferenced using dev->info->masks.

Signed-off-by: Arun Ramadoss <arun.ramadoss@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet: dsa: microchip: move ksz8->regs to ksz_common
Arun Ramadoss [Tue, 28 Jun 2022 17:13:23 +0000 (22:43 +0530)] 
net: dsa: microchip: move ksz8->regs to ksz_common

This patch moves the ksz8->regs from ksz8795.c to the ksz_common.c. And
the regs is dereferrenced using dev->info->regs.

Signed-off-by: Arun Ramadoss <arun.ramadoss@microchip.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agofirmware: xilinx: Add TF_A_PM_REGISTER_SGI SMC call
Tanmay Shah [Tue, 7 Jun 2022 22:42:54 +0000 (15:42 -0700)] 
firmware: xilinx: Add TF_A_PM_REGISTER_SGI SMC call

SGI interrupt register and reset is performed by EEMI ioctl
IOCTL_REGISTER_SGI. However, this is not correct use of EEMI call.
SGI registration functionality does not qualify as energy management
activity and so shouldn't be mapped to EEMI call.

This new call will replace IOCTL_REGISTER_SGI and will  be handled by TF-A
specific handler in TF-A. To maintain backward compatibility for a while
firmware driver will still use IOCTL_REGISTER_SGI as fallback strategy if
new call fails or is not supported by TF-A.

This new design also helps to make TF-A as pass through layer for EEMI
calls. So we don't have to maintain PM_IOCTL as EEMI API ID in TF-A.

Signed-off-by: Tanmay Shah <tanmay.shah@xilinx.com>
Acked-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/20220607224253.54919-1-tanmay.shah@xilinx.com
Signed-off-by: Michal Simek <michal.simek@amd.com>
4 years agoMerge branch 'mtk-star-emac-features'
David S. Miller [Wed, 29 Jun 2022 12:45:31 +0000 (13:45 +0100)] 
Merge branch 'mtk-star-emac-features'

Biao Huang says:

====================
net: add more features for mtk-star-emac

Changes in v4:
1. correct the usage of spin_lock/__napi_schedule.
2. fix coding style as Jakub's comments.

Changes in v3:
1. refractor driver as Jakub's comments in patch
   "net: ethernet: mtk-star-emac: separate tx/rx handling with two NAPIs".
2. add acked-by as Rob's comments.
3. add a new patch for halp-duplex support in driver.

Changes in v2:
1. fix coding style as Bartosz's comments.
2. add reviewed-by as Bartosz's comments.

This series add more features for mtk-star-emac:
1. add reference clock pad selection for RMII;
2. add simple timing adjustment for RMII;
3. add support for MII;
4. add support for new IC MT8365;
5. separate tx/rx interrupt handling.
====================

Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet: ethernet: mtk-star-emac: enable half duplex hardware support
Biao Huang [Wed, 29 Jun 2022 03:17:43 +0000 (11:17 +0800)] 
net: ethernet: mtk-star-emac: enable half duplex hardware support

Current driver doesn't support half duplex correctly.
This patch enable half duplex capability in hardware.

Signed-off-by: Biao Huang <biao.huang@mediatek.com>
Signed-off-by: Yinghua Pan <ot_yinghua.pan@mediatek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet: ethernet: mtk-star-emac: separate tx/rx handling with two NAPIs
Biao Huang [Wed, 29 Jun 2022 03:17:42 +0000 (11:17 +0800)] 
net: ethernet: mtk-star-emac: separate tx/rx handling with two NAPIs

Current driver may lost tx interrupts under bidirectional test with iperf3,
which leads to some unexpected issues.

This patch let rx/tx interrupt enable/disable separately, and rx/tx are
handled in different NAPIs.

Signed-off-by: Biao Huang <biao.huang@mediatek.com>
Signed-off-by: Yinghua Pan <ot_yinghua.pan@mediatek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet: ethernet: mtk-star-emac: add support for MII interface
Biao Huang [Wed, 29 Jun 2022 03:17:41 +0000 (11:17 +0800)] 
net: ethernet: mtk-star-emac: add support for MII interface

Add support for MII interface.
If user wants to use MII, assign "MII" to "phy-mode" property in dts.

Signed-off-by: Biao Huang <biao.huang@mediatek.com>
Signed-off-by: Yinghua Pan <ot_yinghua.pan@mediatek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agodt-bindings: net: mtk-star-emac: add description for new properties
Biao Huang [Wed, 29 Jun 2022 03:17:40 +0000 (11:17 +0800)] 
dt-bindings: net: mtk-star-emac: add description for new properties

Add description for new properties which will be parsed in driver.

Signed-off-by: Biao Huang <biao.huang@mediatek.com>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet: ethernet: mtk-star-emac: add timing adjustment support
Biao Huang [Wed, 29 Jun 2022 03:17:39 +0000 (11:17 +0800)] 
net: ethernet: mtk-star-emac: add timing adjustment support

Add simple clock inversion for timing adjustment in driver.
Add property "mediatek,txc-inverse" or "mediatek,rxc-inverse" to
device node when necessary.

Signed-off-by: Biao Huang <biao.huang@mediatek.com>
Signed-off-by: Yinghua Pan <ot_yinghua.pan@mediatek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet: ethernet: mtk-star-emac: add clock pad selection for RMII
Biao Huang [Wed, 29 Jun 2022 03:17:38 +0000 (11:17 +0800)] 
net: ethernet: mtk-star-emac: add clock pad selection for RMII

This patch add a new dts property named "mediatek,rmii-rxc" parsing
in driver, which will configure MAC to select which pin the RMII reference
clock is connected to, TXC or RXC.

TXC pad is the default reference clock pin. If user wants to use RXC pad
instead, add "mediatek,rmii-rxc" to corresponding device node.

Signed-off-by: Biao Huang <biao.huang@mediatek.com>
Signed-off-by: Yinghua Pan <ot_yinghua.pan@mediatek.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agodt-bindings: net: mtk-star-emac: add support for MT8365
Biao Huang [Wed, 29 Jun 2022 03:17:37 +0000 (11:17 +0800)] 
dt-bindings: net: mtk-star-emac: add support for MT8365

Add binding document for Ethernet on MT8365.

Signed-off-by: Biao Huang <biao.huang@mediatek.com>
Reviewed-by: Bartosz Golaszewski <brgl@bgdev.pl>
Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet: ethernet: mtk-star-emac: add support for MT8365 SoC
Biao Huang [Wed, 29 Jun 2022 03:17:36 +0000 (11:17 +0800)] 
net: ethernet: mtk-star-emac: add support for MT8365 SoC

Add Ethernet driver support for MT8365 SoC.

Signed-off-by: Biao Huang <biao.huang@mediatek.com>
Signed-off-by: Yinghua Pan <ot_yinghua.pan@mediatek.com>
Signed-off-by: Fabien Parent <fparent@baylibre.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
4 years agonet: ethernet: mtk-star-emac: modify IRQ trigger flags
Biao Huang [Wed, 29 Jun 2022 03:17:35 +0000 (11:17 +0800)] 
net: ethernet: mtk-star-emac: modify IRQ trigger flags

If the flags in request_irq() is IRQF_TRIGGER_NONE, the trigger method
is determined by "interrupt" property in dts.
So, modify the flag from IRQF_TRIGGER_FALLING to IRQF_TRIGGER_NONE.

Signed-off-by: Biao Huang <biao.huang@mediatek.com>
Signed-off-by: Yinghua Pan <ot_yinghua.pan@mediatek.com>
Reviewed-by: Bartosz Golaszewski <brgl@bgdev.pl>
Signed-off-by: David S. Miller <davem@davemloft.net>