Commit graph

6598 commits

Author SHA1 Message Date
Tony Lindgren
2c32e600a0 Merge branch 'omap-for-v6.5/cleanup' into omap-for-v6.6/soc
Merge in non-critical clean-up that was too late for v6.5.

Signed-off-by: Tony Lindgren <tony@atomide.com>
2023-08-02 10:46:07 +03:00
Rob Herring
1047e2142e ARM: omap2: Explicitly include correct DT includes
The DT of_device.h and of_platform.h date back to the separate
of_platform_bus_type before it was merged into the regular platform bus.
As part of that merge prepping Arm DT support 13 years ago, they
"temporarily" include each other. They also include platform_device.h
and of.h. As a result, there's a pretty much random mix of those include
files used throughout the tree. In order to detangle these headers and
replace the implicit includes with struct declarations, users need to
explicitly include the correct includes.

Signed-off-by: Rob Herring <robh@kernel.org>
Message-ID: <20230720172743.2918601-1-robh@kernel.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2023-07-31 09:40:38 +03:00
Linus Torvalds
7b82e90411 asm-generic updates for 6.5
These are cleanups for architecture specific header files:
 
  - the comments in include/linux/syscalls.h have gone out of sync
    and are really pointless, so these get removed
 
  - The asm/bitsperlong.h header no longer needs to be architecture
    specific on modern compilers, so use a generic version for newer
    architectures that use new enough userspace compilers
 
  - A cleanup for virt_to_pfn/virt_to_bus to have proper type
    checking, forcing the use of pointers
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmSl138ACgkQYKtH/8kJ
 UieqWxAA2WjNVfyuieYckglOVE0PZPs2fzCwyzTY5iUTH3gE5cBFWJDWcg2EnouG
 v3X3htEQcowYWaCF9+rypQXaGiSx4WXi2Bjxnz3D/BcreqWPI4eSQ0fpGG5SURTY
 2zYF72GTt4JGR++l+7/R9MZwPbwYDT9BsD5tkel8PxnyVLM6/c5xFvbjzRSKFE8x
 SMN1jGZ62ITLNf/8coAOEPNxBYtDT6yQyu7P2sx5cd65LAQq9yLKjFklnBBovgWT
 OoCIZAdGkhcNwOh1LjyHcdNdpfNJGceKyqKPqty07IhCQuF2jxiyFYFzuBbeyQfE
 S0itN8o/MIfUmxaQl3e8dPAVb1RlNVr1zfQ6y4tUtWNdkNL2WwSnSQSRHrBfHxCQ
 QCF++PMeFcLhGwMYtqdNJ7XGLQ0PsjD74pRf0vo+vjmqDk2BJsJBP57VU+8MJn5r
 SoxqnJ0WxLvm1TfrNKusV7zMNWquc2duJDW40zsOssP4itjYELSI6qa56qmzlqmX
 zKmRx6mxAlx9RRK8FHXFYHbz3p93vv8z9vTOZV3AjIjjED960CLknUAwCC8FoJyz
 9b5wyMXsLQHQjGt8luAvPc6OiU0EiU9a4SPK+feWcv27serFvnjJlRTS/yG2Z3zd
 BYsUgsXHypsdoud+aE7MeCy7fE8n3mhoyMQQRBkOMFJ7RsG6wAE=
 =S/he
 -----END PGP SIGNATURE-----

Merge tag 'asm-generic-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic

Pull asm-generic updates from Arnd Bergmann:
 "These are cleanups for architecture specific header files:

   - the comments in include/linux/syscalls.h have gone out of sync and
     are really pointless, so these get removed

   - The asm/bitsperlong.h header no longer needs to be architecture
     specific on modern compilers, so use a generic version for newer
     architectures that use new enough userspace compilers

   - A cleanup for virt_to_pfn/virt_to_bus to have proper type checking,
     forcing the use of pointers"

* tag 'asm-generic-6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/arnd/asm-generic:
  syscalls: Remove file path comments from headers
  tools arch: Remove uapi bitsperlong.h of hexagon and microblaze
  asm-generic: Unify uapi bitsperlong.h for arm64, riscv and loongarch
  m68k/mm: Make pfn accessors static inlines
  arm64: memory: Make virt_to_pfn() a static inline
  ARM: mm: Make virt_to_pfn() a static inline
  asm-generic/page.h: Make pfn accessors static inlines
  xen/netback: Pass (void *) to virt_to_page()
  netfs: Pass a pointer to virt_to_page()
  cifs: Pass a pointer to virt_to_page() in cifsglob
  cifs: Pass a pointer to virt_to_page()
  riscv: mm: init: Pass a pointer to virt_to_page()
  ARC: init: Pass a pointer to virt_to_pfn() in init
  m68k: Pass a pointer to virt_to_pfn() virt_to_page()
  fs/proc/kcore.c: Pass a pointer to virt_addr_valid()
2023-07-06 10:06:04 -07:00
Linus Walleij
c1d57ee6eb
ARM: omap2: Fix copy/paste bug
I mistyped one of the SD/MMC GPIO lines on the Nokia n810 which
was supposed to be "vio" as "vsd".

Fix it up.

Reported-by: Peter Vasil <petervasil@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Tony Lindgren <tony@atomide.com>
Link: https://lore.kernel.org/r/20230614093032.403982-1-linus.walleij@linaro.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2023-06-22 17:30:09 +02:00
Gustavo A. R. Silva
847fb80cc0 ARM: OMAP2+: Fix -Warray-bounds warning in _pwrdm_state_switch()
If function pwrdm_read_prev_pwrst() returns -EINVAL, we will end
up accessing array pwrdm->state_counter through negative index
-22. This is wrong and the compiler is legitimately warning us
about this potential problem.

Fix this by sanity checking the value stored in variable _prev_
before accessing array pwrdm->state_counter.

Address the following -Warray-bounds warning:
arch/arm/mach-omap2/powerdomain.c:178:45: warning: array subscript -22 is below array bounds of 'unsigned int[4]' [-Warray-bounds]

Link: https://github.com/KSPP/linux/issues/307
Fixes: ba20bb1269 ("OMAP: PM counter infrastructure.")
Cc: stable@vger.kernel.org
Reported-by: kernel test robot <lkp@intel.com>
Link: https://lore.kernel.org/lkml/20230607050639.LzbPn%25lkp@intel.com/
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Message-ID: <ZIFVGwImU3kpaGeH@work>
Acked-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2023-06-14 11:11:17 +03:00
Rob Herring
c63f5b4548 ARM: omap2: Use of_range_to_resource() for "ranges" parsing
"ranges" is a standard property with common parsing functions. Users
shouldn't be implementing their own parsing of it. Use the recently
added of_range_to_resource() function instead for OMAP hwmod.

Signed-off-by: Rob Herring <robh@kernel.org>
Message-ID: <20230609183252.1767487-1-robh@kernel.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2023-06-14 11:04:50 +03:00
Arnd Bergmann
54cb981c29 Clean-up for omaps for v6.5
Two patches for checkpatch warnings, and one change to use pr_err instead
 of printk.
 -----BEGIN PGP SIGNATURE-----
 
 iQJFBAABCAAvFiEEkgNvrZJU/QSQYIcQG9Q+yVyrpXMFAmR9gB4RHHRvbnlAYXRv
 bWlkZS5jb20ACgkQG9Q+yVyrpXOfzRAApeqV9RL/2FoSrPrNll8udyHFHY4rnAYm
 e3wIljWjQEQN0Kar8s2i74cQlUkEWhgScH6SOR0DeHdKS9u/fqJtzYtnJjc2t7xF
 +RIHlZD3YZVV5fQpvLDbraPqKE+zajHPCeV7hXICZKc2WpbWTmQ4rZsAWvkKS7QM
 A6/Fi6fjGVkWLWS3t4jilo/hesP15m8FsPnDnXlR98OdX1xZ6Lt2FtqVbjpCce75
 KKudVMShiftgsO029BNRrQ6q50LEC3cSDo+LER2Q8VqR7UfpbdhEDwCRkCqdbKVD
 IY6wC7XWPEjU5BxUnXP9v8cyNlpPdWJaIP1HwfAt0aYB4kqtM2vDzgY5T31P00er
 5dfkW9zRA5KDUeAwO5eHVQbirz+gfRlrs4qM9Xvkb+7H9RxHy22eWlNUR9sp9ua0
 IUvc5P8y02d6vM/S5yZnRtlVSF2r8ueiALuEhP93zK1uZPmnyz+uDEi6e3g6tAFR
 bIX6UequevcZdjClyA7JI2xGMTKK3WmQ+NTZxvVF0tG4q3DZurLSco+HGnU9Xft9
 WJfCPSzIWk+CT2soCtXr7G5G0XIJi611fLITNSFwbNHr6peilBlzPPP93F0jWVVm
 M8Mzl1bdnKXUKg6KdW/JJHDtGCY8oSno9K6CvmcyGy6ajjo+BiN7I68H7oBk+fo8
 ll5tx9nBVeI=
 =QbGV
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmSAYnAACgkQYKtH/8kJ
 UicAaRAAnpamrXsSgLtxis9822pDBube3Pr0aUnrDbyToRr0Rr0oaC8qw2OJ40A2
 9b06VtS6wMbhh/+MJDJG5kaIwfqpJeaaS4lfOsuwaTQ4VqgzsSBt5tFakmp45gmv
 7mwQbgOVgBZp80gjyGTaancv9h1mBGCXfXDhDHz3pSnNOynHNEqDWfKnz5hWvl4a
 J/wzHmSrUuUpVSpLsgRZ5+kgBJU2l7oD6QFjorMA+knVkobFnObOkFtiTs8FLmj9
 1jX6pzDTcig5rNWivJdEM2Pxhqfp3q1n+mJHVlgj/1EwVKFokLbnMX8itEJT9QoY
 FxNgeljdr0QaMz3v0y6nYIIuegZRduQ5v8ngIEHLyE9LEP0XwFPmxd16Q81RMuo0
 w5lVIMV3SfaBf7GYoR9yQC4bEuurKkDpKEbrbpeIGVOECj3H3A+PQIFxyZ25bfgQ
 FksQ5kQTgrhFtzGIfB82O2U1kpCeAs5stSMshRrx1OWgr1xjyE95beuyByOEboN8
 Pb3szergiAcEWE1N83lZJyvewmaFckcg/i1rG27YWm7xePGYb13ee/vSW72ugmSS
 /qFOUfOZJw4QLo7cTBOpIakRVoqk4XdkEMiYmL3qhLY4N2jzpsqk30MvQbNl5dN3
 9QJqpGMFnDoBXfqScLnH1HdlscVfpM7ipUUnDdX1kbKNdU+0p0M=
 =6THM
 -----END PGP SIGNATURE-----

Merge tag 'omap-for-v6.5/cleanup-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into soc/arm

Clean-up for omaps for v6.5

Two patches for checkpatch warnings, and one change to use pr_err instead
of printk.

* tag 'omap-for-v6.5/cleanup-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
  ARM: omap2: Fix checkpatch issues
  arm: omap1: replace printk() with pr_err macro
  ARM: omap: Fix checkpatch issues

Link: https://lore.kernel.org/r/pull-1685946511-835910@atomide.com
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2023-06-07 12:56:47 +02:00
Franziska Naepelt
937e87229e ARM: omap2: Fix checkpatch issues
The following checkpatch issues have been resolved:

arch/arm/mach-omap2/omap-wakeupgen.c
WARNING: Missing a blank line after declarations

arch/arm/mach-omap2/omap_hwmod_3xxx_data.c
ERROR: space prohibited before that ',' (ctx:WxE)
WARNING: Use lore.kernel.org archive links when possible

arch/arm/mach-omap2/omap_phy_internal.c
WARNING: Block comments should align the * on each line

arch/arm/mach-omap2/sdrc2xxx.c
WARNING: It's generally not useful to have the filename in the file

arch/arm/mach-omap2/ti81xx-restart.c
ERROR: trailing statements should be on next line

Signed-off-by: Franziska Naepelt <franziska.naepelt@gmail.com>
Message-ID: <20230531170427.42199-1-franziska.naepelt@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2023-06-02 12:33:48 +03:00
Franziska Naepelt
b5b2e006c9 ARM: omap: Fix checkpatch issues
This removes the following checkpatch issues:
- ERROR: space required after that ',' (ctx:VxV)
- WARNING: Comparisons should place the constant on the right side of the test

Signed-off-by: Franziska Naepelt <franziska.naepelt@gmail.com>
Message-Id: <20230530182403.35646-1-franziska.naepelt@gmail.com>
[tony@atomide.com: add space also around '-' in addition to ',']
Signed-off-by: Tony Lindgren <tony@atomide.com>
2023-05-31 08:30:43 +03:00
Linus Walleij
a9ff696160 ARM: mm: Make virt_to_pfn() a static inline
Making virt_to_pfn() a static inline taking a strongly typed
(const void *) makes the contract of a passing a pointer of that
type to the function explicit and exposes any misuse of the
macro virt_to_pfn() acting polymorphic and accepting many types
such as (void *), (unitptr_t) or (unsigned long) as arguments
without warnings.

Doing this is a bit intrusive: virt_to_pfn() requires
PHYS_PFN_OFFSET and PAGE_SHIFT to be defined, and this is defined in
<asm/page.h>, so this must be included *before* <asm/memory.h>.

The use of macros were obscuring the unclear inclusion order here,
as the macros would eventually be resolved, but a static inline
like this cannot be compiled with unresolved macros.

The naive solution to include <asm/page.h> at the top of
<asm/memory.h> does not work, because <asm/memory.h> sometimes
includes <asm/page.h> at the end of itself, which would create a
confusing inclusion loop. So instead, take the approach to always
unconditionally include <asm/page.h> at the end of <asm/memory.h>

arch/arm uses <asm/memory.h> explicitly in a lot of places,
however it turns out that if we just unconditionally include
<asm/memory.h> into <asm/page.h> and switch all inclusions of
<asm/memory.h> to <asm/page.h> instead, we enforce the right
order and <asm/memory.h> will always have access to the
definitions.

Put an inclusion guard in place making it impossible to include
<asm/memory.h> explicitly.

Link: https://lore.kernel.org/linux-mm/20220701160004.2ffff4e5ab59a55499f4c736@linux-foundation.org/
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2023-05-29 11:27:08 +02:00
Arnd Bergmann
0b47a62ea6 This removes all usage of global GPIO numbers from
arch/arm/mach-omap[12].
 
 The patches have been reviewed and tested by everyone
 who showed interest which was one person that tested
 on OSK1 and Nokia 770, and we smoked out the bugs and
 also addressed all review comments.
 
 Any remaining problems can certainly be fixed in-tree.
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEElDRnuGcz/wPCXQWMQRCzN7AZXXMFAmRuCyUACgkQQRCzN7AZ
 XXPZKxAAtrTAYiCqR4EuJWh+l1SiilazOJWI3CoR6z2QDW09T8VEpNSfVHkmxyDL
 FnZKmXsXAJl783Ial3hXfxXb7oxIHIRBU88C+aQN+4w4VxA4ujxV3uAoMA1SFFOL
 +wpGZIT9ReUpUf988wK31SitNB7frNygQosA7kOmhbMWxIUkNs5UYynSjNDrVTNJ
 oVf/e7VM2smbOqbZFhwFNfxu35Oe+ak4xREG4gX+00VtUPJfM85WcMqZNiVzVPcC
 5Hw2nfW9w+ZQyoR1B+UQbeZkbw0Ibb4dpTM43Jij6VO0gKBy+9AsD0oeSih6BiIL
 irBlHYeAtvSmwxVLvlBGZmHBdB8o5tkf1DKvztYPVR+qgoRrY/3LCeSViCjJhNUT
 MNLIR1tTjVR/EouBo7SR4s8Xn/H38Fp3D/sCath/pajRH4446hos/Egh/is8N9Lv
 +OX/L4pO8OeKUiYyEgFkvaIH/L31OCX5ihPh5ErvVQEysYQ3MZGtEBLVgz4QMp7p
 U3SncOfy5VdNX46fDJfNUMsFfl+RKYPhihQ7zRkeJb+qAled7dabwaBCf0L+gKn8
 DpN5rpePOlC0yfFpB0tftDsrrNanh0oZAKjRq9h8+/MbnNYUm9dEv1WeMcDJ17uD
 IhfB9gAcHRsDQd/Fc4btDB4GnfPli+CBMxkRWOV1eyMHriBf7Cw=
 =fMmV
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEiK/NIGsWEZVxh/FrYKtH/8kJUicFAmRwuesACgkQYKtH/8kJ
 Uif76g/+LKRH+kW01pbLOo/AVabzH6Jb3QICFN4qeRvTkA3EyuxXMinOQFRvdLW5
 E7MCZtOAio8Wm2Gg7kCSb32t13gPhFmyWZAIRVDuWxcSbBFlRkWF0h/rCv0Nq+Q3
 Szkwbz3nAEZU5so/4sfPdddtN48DTdwVLux+5IeI1H9QRJyyAkH7OoS/Ll/E7Ubx
 MCeT+OuT9yTjvrX0jMt4mYHn09OxV174OIo9r3p66HR5TzqAmbEdrb4Hm9FN+wZd
 j/yNNVBp68As1Qo4u/CZPM9LAp77A3oZoMRGkWHyjxaHoYsCuUf1aPnjeSaYxCQN
 koLx4/3eZOgQk3l7yYlMIaQP0BkgDU4EZ6aLCON9VkanmqYicVPdXKaH1UGgf8xJ
 p2lWdDY1FODmmyAfkpI9hVyFsh5/JjEUMmGcl1tdD42nHOZyf3gLUW7BxhaxLzr5
 XsLd6KQaSEaKYL5+v09FSUah8j9fA4qf42sr4ElX4pkzKvaGc35MLytZjoa4Ldrk
 OCtUVmdYK+C3xM3OO5CAzQaJKgskhPkU9UQLwVE5Vmye0mKqT0YPQitjvYgUrHw4
 u+EekfBLyRme4WDQDPjgYBJQ2d5ufapYI9SZ1Xq1xPPsrjDW8r3if4fzUwB3Sd7Q
 RY4ojBprBsyezPJQJFsyJieVOL3hlZ9G3SnzGG7MJQ6nsypAwnc=
 =pBEM
 -----END PGP SIGNATURE-----

Merge tag 'gpio-omap-descriptors-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio into soc/arm

This removes all usage of global GPIO numbers from
arch/arm/mach-omap[12].

The patches have been reviewed and tested by everyone
who showed interest which was one person that tested
on OSK1 and Nokia 770, and we smoked out the bugs and
also addressed all review comments.

Any remaining problems can certainly be fixed in-tree.

* tag 'gpio-omap-descriptors-v6.5' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio:
  ARM/musb: omap2: Remove global GPIO numbers from TUSB6010
  ARM: omap2: Rewrite WLAN quirk to use GPIO descriptors
  ARM: omap2: Get USB hub reset GPIO from descriptor
  ARM/gpio: Push OMAP2 quirk down into TWL4030 driver
  ARM: omap1: Exorcise the legacy GPIO header
  ARM: omap1: Make serial wakeup GPIOs use descriptors
  ARM: omap1: Fix up the Nokia 770 board device IRQs
  ARM/mmc: Convert old mmci-omap to GPIO descriptors
  Input: ads7846 - Convert to use software nodes
  ARM: omap1: Remove reliance on GPIO numbers from SX1
  ARM: omap1: Remove reliance on GPIO numbers from PalmTE
  ARM: omap1: Drop header on AMS Delta
  ARM/mfd/gpio: Fixup TPS65010 regression on OMAP1 OSK1

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2023-05-26 15:53:46 +02:00
Arnd Bergmann
861bc1d288 ARM: omap2: fix missing tick_broadcast() prototype
omap2 contains a hack to define tick_broadcast() on non-SMP
configurations in place of the normal SMP definition. This one
causes a warning because of a missing prototype:

arch/arm/mach-omap2/board-generic.c:44:6: error: no previous prototype for 'tick_broadcast'

Make sure to always include the header with the declaration.

Fixes: d86ad463d6 ("ARM: OMAP2+: Fix regression for using local timer on non-SMP SoCs")
Acked-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Link: https://lore.kernel.org/r/20230516153109.514251-9-arnd@kernel.org
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2023-05-26 13:33:05 +02:00
Linus Walleij
8e0285ab95 ARM/musb: omap2: Remove global GPIO numbers from TUSB6010
The TUSB6010 (MUSB) device is picking up some GPIO lines
hardcoded by number and passing on to the TUSB6010 device
when registering it.

Instead of nasty workarounds, provide a GPIO descriptor
table and then make the TUSB6010 MUSB glue driver pick up
the GPIO lines directly, convert it to an IRQ and pass down
to the MUSB driver. OMAP2 is the only system using the
TUSB6010.

Stash the GPIO descriptors in the glue layer and use
then to power up and down the TUSB6010 on-demand, instead
of using boardfile callbacks.

Since the OMAP2 boards are the only boards using the
.set_power() and .board_set_power() callbacks, we can
just delete them as the power is now handled directly
in the TUSB6010 glue code.

Cc: Bin Liu <b-liu@ti.com>
Cc: linux-usb@vger.kernel.org
Fixes: 92bf78b33b ("gpio: omap: use dynamic allocation of base")
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2023-05-24 15:01:59 +02:00
Linus Walleij
078dc5194c ARM: omap2: Rewrite WLAN quirk to use GPIO descriptors
The OMAP2 platform data quirk is using the global GPIO numberspace
to obtain two WLAN GPIOs to drive power and xcvr reset GPIO
lines during start-up.

Rewrite the quirk to use a GPIO descriptor table so we avoid using
global GPIO numbers.

This gets rid of the final dependency on the legacy <linux/gpio.h>
header from the OMAP2/3 platforms.

Fixes: 92bf78b33b ("gpio: omap: use dynamic allocation of base")
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2023-05-24 15:01:58 +02:00
Linus Walleij
94075d16be ARM: omap2: Get USB hub reset GPIO from descriptor
This switches the USB hub GPIO reset line handling in the
OMAP2 pdata quirks over to using GPIO descriptors to avoid using
the global GPIO numberspace.

Since the GPIOs are exported and assumedly used by some kind
of userspace we cannot simply use hogs in the device tree.

Fixes: 92bf78b33b ("gpio: omap: use dynamic allocation of base")
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2023-05-24 15:01:57 +02:00
Linus Walleij
d5f4fa60d6 ARM/gpio: Push OMAP2 quirk down into TWL4030 driver
The TWL4030 GPIO driver has a custom platform data .set_up()
callback to call back into the platform and do misc stuff such
as hog and export a GPIO for WLAN PWR on a specific OMAP3 board.

Avoid all the kludgery in the platform data and the boardfile
and just put the quirks right into the driver. Make it
conditional on OMAP3.

I think the exported GPIO is used by some kind of userspace
so ordinary DTS hogs will probably not work.

Fixes: 92bf78b33b ("gpio: omap: use dynamic allocation of base")
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2023-05-24 15:01:55 +02:00
Linus Walleij
e519f0bb64 ARM/mmc: Convert old mmci-omap to GPIO descriptors
A recent change to the OMAP driver making it use a dynamic GPIO
base created problems with some old OMAP1 board files, among
them Nokia 770, SX1 and also the OMAP2 Nokia n8x0.

Fix up all instances of GPIOs being used for the MMC driver
by pushing the handling of power, slot selection and MMC
"cover" into the driver as optional GPIOs.

This is maybe not the most perfect solution as the MMC
framework have some central handlers for some of the
stuff, but it at least makes the situtation better and
solves the immediate issue.

Fixes: 92bf78b33b ("gpio: omap: use dynamic allocation of base")
Acked-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
2023-05-24 15:01:36 +02:00
Linus Torvalds
2c96606a0f gpio updates for v6.4-rc1
New drivers:
 - add a driver for the Loongson GPIO controller
 - add a driver for the fxl6408 I2C GPIO expander
 - add a GPIO module containing code common for Intel Elkhart Lake and
   Merrifield platforms
 - add a driver for the Intel Elkhart Lake platform reusing the code from
   the intel tangier library
 
 GPIOLIB core:
 - GPIO ACPI improvements
 - simplify gpiochip_add_data_with_keys() fwnode handling
 - cleanup header inclusions (remove unneeded ones, order the rest
   alphabetically)
 - remove duplicate code (reuse krealloc() instead of open-coding it, drop
   a duplicated check in gpiod_find_and_request())
 - reshuffle the code to remove unnecessary forward declarations
 - coding style cleanups and improvements
 - add a helper for accessing device fwnodes
 - small updates in docs
 
 Driver improvements:
 - convert all remaining GPIO irqchip drivers to using immutable irqchips
 - drop unnecessary of_match_ptr() macro expansions
 - shrink the code in gpio-merrifield significantly by reusing the code from
   gpio-tangier + minor tweaks to the driver code
 - remove MODULE_LICENSE() from drivers that can only be built-in
 - add device-tree support to gpio-loongson1
 - use new regmap features in gpio-104-dio-48e and gpio-pcie-idio-24
 - minor tweaks and fixes to gpio-xra1403, gpio-sim, gpio-tegra194, gpio-omap,
   gpio-aspeed, gpio-raspberrypi-exp
 - shrink code in gpio-ich and gpio-pxa
 - Kconfig tweak for gpio-pmic-eic-sprd
 -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEFp3rbAvDxGAT0sefEacuoBRx13IFAmRGjBIACgkQEacuoBRx
 13IBMA/+PTEowr87BTJW+Z0Y3EoXPGZSKFzUpnzpbGo7CT5mEO3KBbyikZi3asZ4
 5mVPbHOC7OU8t76KSGYWXwPh0bvskt+jR2wz19f6F65g1W2SnTym52wAPUJDrKvm
 YQofEGcz9ykTIo5KQjAyqADYrrfIOKCOZbN59k8GscXBHkYmGFO3ZhEa5HhzcF+S
 qJBxnJ13Tbg9bszyl062pLqsNYGDeqqSuELrhALQCzSCM3WlJQOaHUEG//mS1Syu
 OHX2pwjw8u3HxBo6pKMK5fa4/aFM+EUAvSdDX59WmVrPnpLCHezyh4K3WQFUSnwG
 OJsW+b/eUDjICQBRvsHIJLuiAr19UouWWY6IZE9dTOjoPO1KWHtbaYX8rHWRZWCM
 +/QVfLavmXbOHW/pS2+NNxCARwu8o8ozcopY3PT6TjC5aN8/IkVT4eSaT3mJYXmh
 8uS/5aY1Th0eyK5GHv7IcNME5Jb+sAHEnqG0Ebns7a9kOGQdEMJwZrnc5IjKWSMd
 PAKNjWYZ49XALtl8vVSar2DYt6d6z+UvGDX67s686FVpCDk15cyUE6VjdtKdGdsd
 mH+OnCaWDt+l89DEqZ4298ZA6kNk2CkHHjIO/TBDkU3jP7/wp/NtU0RTuCXydwjW
 aNjnfHd2JMJ//wQ4l2fQgpzWfVEN34mKZ2pysDotY47bwjpPD7o=
 =X+sP
 -----END PGP SIGNATURE-----

Merge tag 'gpio-updates-for-v6.4' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux

Pull gpio updates from Bartosz Golaszewski:
 "We have some new drivers, significant refactoring of existing intel
  platforms, lots of improvements all around, mass conversion to using
  immutable irqchips by drivers that had not been converted individually
  yet and some changes in the core library code.

  Summary:

  New drivers:
   - add a driver for the Loongson GPIO controller
   - add a driver for the fxl6408 I2C GPIO expander
   - add a GPIO module containing code common for Intel Elkhart Lake and
     Merrifield platforms
   - add a driver for the Intel Elkhart Lake platform reusing the code
     from the intel tangier library

  GPIOLIB core:
   - GPIO ACPI improvements
   - simplify gpiochip_add_data_with_keys() fwnode handling
   - cleanup header inclusions (remove unneeded ones, order the rest
     alphabetically)
   - remove duplicate code (reuse krealloc() instead of open-coding it,
     drop a duplicated check in gpiod_find_and_request())
   - reshuffle the code to remove unnecessary forward declarations
   - coding style cleanups and improvements
   - add a helper for accessing device fwnodes
   - small updates in docs

  Driver improvements:
   - convert all remaining GPIO irqchip drivers to using immutable
     irqchips
   - drop unnecessary of_match_ptr() macro expansions
   - shrink the code in gpio-merrifield significantly by reusing the
     code from gpio-tangier + minor tweaks to the driver code
   - remove MODULE_LICENSE() from drivers that can only be built-in
   - add device-tree support to gpio-loongson1
   - use new regmap features in gpio-104-dio-48e and gpio-pcie-idio-24
   - minor tweaks and fixes to gpio-xra1403, gpio-sim, gpio-tegra194,
     gpio-omap, gpio-aspeed, gpio-raspberrypi-exp
   - shrink code in gpio-ich and gpio-pxa
   - Kconfig tweak for gpio-pmic-eic-sprd"

* tag 'gpio-updates-for-v6.4' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux: (99 commits)
  gpio: gpiolib: Simplify gpiochip_add_data_with_key() fwnode
  gpiolib: Add gpiochip_set_data() helper
  gpiolib: Move gpiochip_get_data() higher in the code
  gpiolib: Check array_info for NULL only once in gpiod_get_array()
  gpiolib: Replace open coded krealloc()
  gpiolib: acpi: Add a ignore wakeup quirk for Clevo NL5xNU
  gpiolib: acpi: Move ACPI device NULL check to acpi_get_driver_gpio_data()
  gpiolib: acpi: use the fwnode in acpi_gpiochip_find()
  gpio: mm-lantiq: Fix typo in the newly added header filename
  sh: mach-x3proto: Add missing #include <linux/gpio/driver.h>
  powerpc/40x: Add missing select OF_GPIO_MM_GPIOCHIP
  gpio: xlp: Convert to immutable irq_chip
  gpio: xilinx: Convert to immutable irq_chip
  gpio: xgs-iproc: Convert to immutable irq_chip
  gpio: visconti: Convert to immutable irq_chip
  gpio: tqmx86: Convert to immutable irq_chip
  gpio: thunderx: Convert to immutable irq_chip
  gpio: stmpe: Convert to immutable irq_chip
  gpio: siox: Convert to immutable irq_chip
  gpio: rda: Convert to immutable irq_chip
  ...
2023-04-25 17:18:18 -07:00
Kenneth Lee
19050da1d1 ARM: OMAP2+: hwmod: Use kzalloc for allocating only one element
Use kzalloc(...) rather than kcalloc(1, ...) because the number of
elements we are specifying in this case is 1, so kzalloc would
accomplish the same thing and we can simplify.

Signed-off-by: Kenneth Lee <klee33@uw.edu>
Message-Id: <20220809072050.1733996-1-klee33@uw.edu>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2023-03-28 08:45:55 +03:00
ye xingchen
89e990559c ARM: OMAP2+: Remove the unneeded result variable
Return the value amx3_common_init() directly instead of storing it in
another redundant variable.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
Message-Id: <20220920065113.215685-1-ye.xingchen@zte.com.cn>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2023-03-28 08:44:28 +03:00
Jilin Yuan
31006a8851 ARM: OMAP2+: fix repeated words in comments
Delete the redundant word 'from'.

Signed-off-by: Jilin Yuan <yuanjilin@cdjrlc.com>
Message-Id: <20220914084315.40165-1-yuanjilin@cdjrlc.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2023-03-28 08:42:15 +03:00
Lukas Bulwahn
977f54705e ARM: OMAP2+: remove obsolete config OMAP3_SDRC_AC_TIMING
Commit d42f265a5d ("ARM: OMAP3: clock: remove un-used core dpll
re-program code") removes arch/arm/mach-omap2/sram34xx.S, which
implemented the effect of the config OMAP3_SDRC_AC_TIMING. Since then, the
OMAP3_SDRC_AC_TIMING config was hanging around without effect.

Remove this obsolete config.

Signed-off-by: Lukas Bulwahn <lukas.bulwahn@gmail.com>
Message-Id: <20230320083806.9545-1-lukas.bulwahn@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2023-03-28 08:41:05 +03:00
Rob Herring
6eaf5d97bb ARM: OMAP2+: Use of_address_to_resource()
Replace open coded parsing of "reg" with of_address_to_resource().

Signed-off-by: Rob Herring <robh@kernel.org>
Message-Id: <20230319163135.225076-1-robh@kernel.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2023-03-27 11:06:09 +03:00
Rob Herring
d26f05931f ARM: OMAP2+: Use of_property_read_bool() for boolean properties
It is preferred to use typed property access functions (i.e.
of_property_read_<type> functions) rather than low-level
of_get_property/of_find_property functions for reading properties.
Convert reading boolean properties to to of_property_read_bool().

Signed-off-by: Rob Herring <robh@kernel.org>
Message-Id: <20230310144655.1540793-1-robh@kernel.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2023-03-27 11:05:57 +03:00
Arnd Bergmann
d74e316633 gpiolib: remove legacy gpio_export()
There are only a handful of users of gpio_export() and
related functions.

As these are just wrappers around the modern gpiod_export()
helper, remove the wrappers and open-code the gpio_to_desc
in all callers to shrink the legacy API.

Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
2023-03-06 12:33:01 +02:00
Linus Torvalds
1f2d9ffc7a Scheduler updates in this cycle are:
- Improve the scalability of the CFS bandwidth unthrottling logic
    with large number of CPUs.
 
  - Fix & rework various cpuidle routines, simplify interaction with
    the generic scheduler code. Add __cpuidle methods as noinstr to
    objtool's noinstr detection and fix boatloads of cpuidle bugs & quirks.
 
  - Add new ABI: introduce MEMBARRIER_CMD_GET_REGISTRATIONS,
    to query previously issued registrations.
 
  - Limit scheduler slice duration to the sysctl_sched_latency period,
    to improve scheduling granularity with a large number of SCHED_IDLE
    tasks.
 
  - Debuggability enhancement on sys_exit(): warn about disabled IRQs,
    but also enable them to prevent a cascade of followup problems and
    repeat warnings.
 
  - Fix the rescheduling logic in prio_changed_dl().
 
  - Micro-optimize cpufreq and sched-util methods.
 
  - Micro-optimize ttwu_runnable()
 
  - Micro-optimize the idle-scanning in update_numa_stats(),
    select_idle_capacity() and steal_cookie_task().
 
  - Update the RSEQ code & self-tests
 
  - Constify various scheduler methods
 
  - Remove unused methods
 
  - Refine __init tags
 
  - Documentation updates
 
  - ... Misc other cleanups, fixes
 
 Signed-off-by: Ingo Molnar <mingo@kernel.org>
 -----BEGIN PGP SIGNATURE-----
 
 iQJFBAABCgAvFiEEBpT5eoXrXCwVQwEKEnMQ0APhK1gFAmPzbJwRHG1pbmdvQGtl
 cm5lbC5vcmcACgkQEnMQ0APhK1iIvA//ZcEaB8Z6ChLRQjM+bsaudKJu3pdLQbPK
 iYbP8Da+LsAfxbEfYuGV3m+jIp0LlBOtsI/EezxQrXV+V7FvNyAX9Y00eEu/zlj8
 7Jn3LMy/DBYTwH7LwVdcU0MyIVI8ZPc6WNnkx0LOtGZn8n+qfHPSDzcP3CW+a5AV
 UvllPYpYyEmsX0Eby7CF4Ue8mSmbViw/xR3rNr8ZSve0c25XzKabw8O9kE3jiHxP
 d/zERJoAYeDyYUEuZqhfn5dTlB4an4IjNEkAfRE5SQ09RA8Gkxsa5Ar8gob9e9M1
 eQsdd4/bdhnrkM8L5qDZczqmgCTZ2bukQrxkBXhRDhLgoFxwAn77b+2ZjmIW3Lae
 AyGqRcDSg1q2oxaYm5ZiuO/t26aDOZu9vPHyHRDGt95EGbZlrp+GgeePyfCigJYz
 UmPdZAAcHdSymnnnlcvdG37WVvaVkpgWZzd8LbtBi23QR+Zc4WQ2IlgnUS5WKNNf
 VOBcAcP6E1IslDotZDQCc2dPFFQoQQEssVooyUc5oMytm7BsvxXLOeHG+Ncu/8uc
 H+U8Qn8jnqTxJbC5hkWQIJlhVKCq2FJrHxxySYTKROfUNcDgCmxboFeAcXTCIU1K
 T0S+sdoTS/CvtLklRkG0j6B8N4N98mOd9cFwUV3tX+/gMLMep3hCQs5L76JagvC5
 skkQXoONNaM=
 =l1nN
 -----END PGP SIGNATURE-----

Merge tag 'sched-core-2023-02-20' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull scheduler updates from Ingo Molnar:

 - Improve the scalability of the CFS bandwidth unthrottling logic with
   large number of CPUs.

 - Fix & rework various cpuidle routines, simplify interaction with the
   generic scheduler code. Add __cpuidle methods as noinstr to objtool's
   noinstr detection and fix boatloads of cpuidle bugs & quirks.

 - Add new ABI: introduce MEMBARRIER_CMD_GET_REGISTRATIONS, to query
   previously issued registrations.

 - Limit scheduler slice duration to the sysctl_sched_latency period, to
   improve scheduling granularity with a large number of SCHED_IDLE
   tasks.

 - Debuggability enhancement on sys_exit(): warn about disabled IRQs,
   but also enable them to prevent a cascade of followup problems and
   repeat warnings.

 - Fix the rescheduling logic in prio_changed_dl().

 - Micro-optimize cpufreq and sched-util methods.

 - Micro-optimize ttwu_runnable()

 - Micro-optimize the idle-scanning in update_numa_stats(),
   select_idle_capacity() and steal_cookie_task().

 - Update the RSEQ code & self-tests

 - Constify various scheduler methods

 - Remove unused methods

 - Refine __init tags

 - Documentation updates

 - Misc other cleanups, fixes

* tag 'sched-core-2023-02-20' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (110 commits)
  sched/rt: pick_next_rt_entity(): check list_entry
  sched/deadline: Add more reschedule cases to prio_changed_dl()
  sched/fair: sanitize vruntime of entity being placed
  sched/fair: Remove capacity inversion detection
  sched/fair: unlink misfit task from cpu overutilized
  objtool: mem*() are not uaccess safe
  cpuidle: Fix poll_idle() noinstr annotation
  sched/clock: Make local_clock() noinstr
  sched/clock/x86: Mark sched_clock() noinstr
  x86/pvclock: Improve atomic update of last_value in pvclock_clocksource_read()
  x86/atomics: Always inline arch_atomic64*()
  cpuidle: tracing, preempt: Squash _rcuidle tracing
  cpuidle: tracing: Warn about !rcu_is_watching()
  cpuidle: lib/bug: Disable rcu_is_watching() during WARN/BUG
  cpuidle: drivers: firmware: psci: Dont instrument suspend code
  KVM: selftests: Fix build of rseq test
  exit: Detect and fix irq disabled state in oops
  cpuidle, arm64: Fix the ARM64 cpuidle logic
  cpuidle: mvebu: Fix duplicate flags assignment
  sched/fair: Limit sched slice duration
  ...
2023-02-20 17:41:08 -08:00
Arnd Bergmann
fc939b172e Clean-up for omaps for v6.3
Non-urgent fixes for missing of_node_put() and clk_put(), drop few
 unnecessary includes, and fix a typo. None of these are urgent and
 can be merged along with other clean-up when suitable.
 -----BEGIN PGP SIGNATURE-----
 
 iQJFBAABCAAvFiEEkgNvrZJU/QSQYIcQG9Q+yVyrpXMFAmPP2k0RHHRvbnlAYXRv
 bWlkZS5jb20ACgkQG9Q+yVyrpXP23BAAjDvc/xh+pdLSWrGLvbfLCtiXTX/VnUyy
 76MIwJshm5tUWYyOLHPh2GwnqnAP9mbmjmwRfbCqOOh7ZtTq/8GQl+IJyh7Z8HSt
 qsjwnDLBq9Hz2V41jUhSr3mlG7UVkETePbJ3s2+hQzry5zAic54+O1BgRXwTrlsj
 UXSCe155Q52FTUxfnScNFYRtJLVVjYTTkRnvkrG/sE7YoyPCnSHyQEyl9QGn7Kfi
 3tkXLLgwnhqap88Gym8QKY4UKXvdmM1cyuhc3dRZFbFc1WKnG8Yl5WT+L6DV9Zu4
 6tk4JsalFTFvbYe0MWwWYXH8EgLUlstIMgWqO7PuwVXZ49TOszpiFPmAf9/ilUi7
 J27uilUGhO7zYi9cyQWWDWmqdh7N5yJE5zbnSyq1GheTv0o+sChN3tuUp5v0JNgE
 nUBloNC/kPoQmc6XulVL05mC5nxXTRT7UnA9sN40llsS7C0BuU8eQCTo3Nn2+eiX
 qW/gJ6JKHcnRx6bPyjGc0ARiWJrn37fblFyk88i/TZrAbSUzNjs6cqpscat7lobH
 HlmbESK+yiG9YeIf/YWnWj5nPMYB8aKqh73nWavRpDfR1giz2nW0Rbwf4fwD6XSt
 f6EsH3gfNuwNFpZlZgGUGQIxOyfYxuX8G54D/B3t36ahdONd32QG9vpEN7GKIIgT
 c9cJUBYrLxo=
 =9VPI
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEEo6/YBQwIrVS28WGKmmx57+YAGNkFAmPQQFEACgkQmmx57+YA
 GNmWDBAAnGa9WEmjkLMbqjt+vFe9OPvcw3g+wZs5jgdMsy7LyBD3tMABC4HZ+5zj
 AvJzisXw7BF2Bjk9ax/OB4cscumKbLTc+BPibtMyIA5DOkJFdIz7g8eos6paAErd
 H0++BMkWd2S2pteisRbpOjbQ5ZhBdC66F3dm1PB/ggLJBJgJQi0m7+c+F71dmhQR
 bKxj5oXWdDQOIi4/Utd6VfHbDyFse6urL+usvkL3qDxUSRzyvmRdrM/XQKNc1gG8
 cezRTCJbi4fXkifHoCYS9tFFnURKgyfZ7KjotU1BaGCfxIPulDsbhdcjoxTwZDMB
 bMb9/aw7IwBPMQVLj+2zhTYOalDlHNTnjPm3b35EcfVOE0O1kC5lvjIH9sMeUiL1
 hwkSKr49R7oDmSjfDB02MIidgJhIARSrutGBtD+7bxqPrxRnOymg1VcQ58sW09B1
 GsHrdgwOO0XHjS0OWVf8B5U3PFSAL2M47iMRXQ5+b2uDQ80Pu6qokpdklTRZ0wCB
 ycTaAP+ouaHbCR40+RaG3rTK8ad+IpDdJERMM0KNg0t/LGrUk2o8BJK014ySWHav
 n0dNnrvk54gtrHtugVG+qZmxVn6djx9FS1D/mj3AyuSUtLCaaEwc71Sl/jynVbUT
 IUYu8OvEPUsrf1QzeZQYcBCVBUa07fe7Ubwy8AIcf/GgSn9gZ8Q=
 =Ib7d
 -----END PGP SIGNATURE-----

Merge tag 'omap-for-v6.3/cleanup-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap into arm/soc

Clean-up for omaps for v6.3

Non-urgent fixes for missing of_node_put() and clk_put(), drop few
unnecessary includes, and fix a typo. None of these are urgent and
can be merged along with other clean-up when suitable.

* tag 'omap-for-v6.3/cleanup-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap:
  ARM: OMAP2+: Fix spelling typos in comment
  ARM: OMAP2+: Remove unneeded #include <linux/pinctrl/machine.h>
  ARM: OMAP2+: Remove unneeded #include <linux/pinctrl/pinmux.h>
  ARM: OMAP2+: Fix memory leak in realtime_counter_init()
  ARM: OMAP2+: omap4-common: Fix refcount leak bug

Link: https://lore.kernel.org/r/pull-1674566471-434733@atomide.com-2
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2023-01-24 21:32:17 +01:00
Nir Levy
5fc1f76a85 ARM: OMAP2+: Fix spelling typos in comment
Fix spelling: adress -> address
Signed-off-by: Nir Levy <bhr166@gmail.com>

Message-Id: <20221123131720.79978-1-bhr166@gmail.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2023-01-19 12:19:39 +02:00
Geert Uytterhoeven
5dbbc9e00c ARM: OMAP2+: Remove unneeded #include <linux/pinctrl/machine.h>
Commit 6f3ab009a1 ("ARM: OMAP2+: Remove unused legacy code for
device init") removed the last user of the pinctrl machine API.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Message-Id: <5dd5e235af9b3def7f4a431edc7bb8504b0681bf.1668001020.git.geert+renesas@glider.be>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2023-01-19 12:16:08 +02:00
Geert Uytterhoeven
4dc6a7170a ARM: OMAP2+: Remove unneeded #include <linux/pinctrl/pinmux.h>
Commit 44c22a2d12 ("ARM: OMAP2+: pm33xx: Add support for rtc+ddr
in self refresh mode") added the include, but no user.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Message-Id: <7f22fb21f76f4d23be2e31a5908bcfa295704ef4.1668000965.git.geert+renesas@glider.be>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2023-01-19 12:15:52 +02:00
Peter Zijlstra
69e26b4f43 cpuidle, arch: Mark all ct_cpuidle_enter() callers __cpuidle
For all cpuidle drivers that use CPUIDLE_FLAG_RCU_IDLE, ensure that
all functions that call ct_cpuidle_enter() are marked __cpuidle.

( due to lack of noinstr validation on these platforms it is entirely
  possible this isn't complete )

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20230112195542.274096325@infradead.org
2023-01-13 11:48:17 +01:00
Peter Zijlstra
db8f50861d cpuidle, ARM: OMAP2+: powerdomain: Remove trace_.*_rcuidle()
OMAP was the one and only user.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Tested-by: Tony Lindgren <tony@atomide.com>
Tested-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Frederic Weisbecker <frederic@kernel.org>
Link: https://lore.kernel.org/r/20230112195541.782536366@infradead.org
2023-01-13 11:48:17 +01:00
Peter Zijlstra
259c95afac arm, OMAP2: Use WFI for omap2_pm_idle()
arch_cpu_idle() is a very simple idle interface and exposes only a
single idle state and is expected to not require RCU and not do any
tracing/instrumentation.

As such, omap2_pm_idle() is not a valid implementation. Replace it
with a simple (shallow) omap2_do_wfi() call.

Omap2 doesn't have a cpuidle driver; but adding one would be the
recourse to (re)gain the other idle states.

Suggested-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Tested-by: Tony Lindgren <tony@atomide.com>
Tested-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Frederic Weisbecker <frederic@kernel.org>
Link: https://lore.kernel.org/r/20230112195541.721697850@infradead.org
2023-01-13 11:48:17 +01:00
Tony Lindgren
a282e5ef29 cpuidle, OMAP4: Push RCU-idle into omap4_enter_lowpower()
OMAP4 uses full SoC suspend modes as idle states, as such it needs the
whole power-domain and clock-domain code from the idle path.

All that code is not suitable to run with RCU disabled, as such push
RCU-idle deeper still.

Signed-off-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Tested-by: Tony Lindgren <tony@atomide.com>
Tested-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Frederic Weisbecker <frederic@kernel.org>
Link: https://lkml.kernel.org/r/Yqcv6crSNKuSWoTu@atomide.com
Link: https://lore.kernel.org/r/20230112195541.660272394@infradead.org
2023-01-13 11:48:17 +01:00
Peter Zijlstra
8c0956aa76 cpuidle, OMAP3: Push RCU-idle into omap_sram_idle()
OMAP3 uses full SoC suspend modes as idle states, as such it needs the
whole power-domain and clock-domain code from the idle path.

All that code is not suitable to run with RCU disabled, as such push
RCU-idle deeper still.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Tested-by: Tony Lindgren <tony@atomide.com>
Tested-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Tony Lindgren <tony@atomide.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Frederic Weisbecker <frederic@kernel.org>
Link: https://lore.kernel.org/r/20230112195541.599561742@infradead.org
2023-01-13 11:48:16 +01:00
Peter Zijlstra
40dbea961a cpuidle, OMAP3: Use WFI for omap3_pm_idle()
arch_cpu_idle() is a very simple idle interface and exposes only a
single idle state and is expected to not require RCU and not do any
tracing/instrumentation.

As such, omap_sram_idle() is not a valid implementation. Replace it
with the simple (shallow) omap3_do_wfi() call. Leaving the more
complicated idle states for the cpuidle driver.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Tested-by: Tony Lindgren <tony@atomide.com>
Tested-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Tony Lindgren <tony@atomide.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Frederic Weisbecker <frederic@kernel.org>
Link: https://lore.kernel.org/r/20230112195541.538053457@infradead.org
2023-01-13 11:48:16 +01:00
Peter Zijlstra
a01353cf18 cpuidle: Fix ct_idle_*() usage
The whole disable-RCU, enable-IRQS dance is very intricate since
changing IRQ state is traced, which depends on RCU.

Add two helpers for the cpuidle case that mirror the entry code:

  ct_cpuidle_enter()
  ct_cpuidle_exit()

And fix all the cases where the enter/exit dance was buggy.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Tested-by: Tony Lindgren <tony@atomide.com>
Tested-by: Ulf Hansson <ulf.hansson@linaro.org>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Acked-by: Frederic Weisbecker <frederic@kernel.org>
Link: https://lore.kernel.org/r/20230112195540.130014793@infradead.org
2023-01-13 11:48:15 +01:00
Peter Zijlstra
c3d42418dc cpuidle, OMAP4: Push RCU-idle into driver
Doing RCU-idle outside the driver, only to then temporarily enable it
again, some *four* times, before going idle is suboptimal.

Notably three times explicitly using RCU_NONIDLE() and once implicitly
through cpu_pm_*().

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Tested-by: Tony Lindgren <tony@atomide.com>
Tested-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
Reviewed-by: Tony Lindgren <tony@atomide.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://lore.kernel.org/r/20230112195540.007918454@infradead.org
2023-01-13 11:47:49 +01:00
Peter Zijlstra
4d1be9e745 cpuidle, OMAP3: Push RCU-idle into driver
Doing RCU-idle outside the driver, only to then teporarily enable it
again before going idle is suboptimal.

Notably the cpu_pm_*() calls implicitly re-enable RCU for a bit.

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Tested-by: Tony Lindgren <tony@atomide.com>
Tested-by: Ulf Hansson <ulf.hansson@linaro.org>
Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
Reviewed-by: Tony Lindgren <tony@atomide.com>
Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://lore.kernel.org/r/20230112195539.883561913@infradead.org
2023-01-13 11:47:19 +01:00
Arnd Bergmann
6aeb51c103 ARM: omap2: make functions static
A number of functions are only called from the file they
are defined in, so remove the extern declarations and
make them local to those files.

Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2023-01-09 17:00:54 +01:00
Arnd Bergmann
d2200da9e6 ARM: omap2: remove unused omap2_pm_init
The omap2420_init_late() and omap2430_init_late() functions
are never called. Removing them also shows that the entire
arch/arm/mach-omap2/pm24xx.c file is unused and can be
removed.

Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2023-01-09 17:00:54 +01:00
Arnd Bergmann
a1080f6165 ARM: omap2: remove unused declarations
These functions were removed at some point in the
past, but the extraneous declarations were left behind.

Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2023-01-09 17:00:54 +01:00
Arnd Bergmann
8e2644fff8 ARM: omap2: remove unused functions
These are a number of individual functions that were either never
used, or that had their last user removed in a prior cleanup.

Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2023-01-09 17:00:54 +01:00
Arnd Bergmann
00a5d41ee1 ARM: omap2: smartreflex: remove on_init control
Nothing calls omap_enable_smartreflex_on_init() any more, so it
does not need to be tracked either.

Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2023-01-09 17:00:54 +01:00
Arnd Bergmann
e1d3cd9451 ARM: omap2: remove APLL control
These functions have no callers and can just be removed.

Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2023-01-09 17:00:54 +01:00
Arnd Bergmann
cbcf78330f ARM: omap2: simplify clock2xxx header
Only one of the functions in clock2xxx.h is used in a file
other than the one it is declared in, so remove the extra
declarations, and make the symbols static.

Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2023-01-09 17:00:54 +01:00
Arnd Bergmann
f2286d2b97 ARM: omap2: remove unused omap_hwmod_reset.c
Since commit 90aa4ed5a4 ("ARM: OMAP2+: Drop legacy platform
data for dra7 rtcss"), this is not used any more and can be
removed.

Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2023-01-09 17:00:54 +01:00
Arnd Bergmann
3af8e972d6 ARM: omap2: remove unused headers
The serial.h and clock3xxx.h headers have no contents that
anything else uses, so these can be removed after the other
files stop including them.

Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2023-01-09 17:00:54 +01:00
Arnd Bergmann
83f73168a8 ARM: omap2: remove unused USB code
Some musb related code is no longer in use after commit 4d62dbda85
("ARM: OMAP3: Remove legacy support for am3517-evm") and can be removed.

Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
2023-01-09 17:00:54 +01:00
Chen Hui
ed8167cbf6 ARM: OMAP2+: Fix memory leak in realtime_counter_init()
The "sys_clk" resource is malloced by clk_get(),
it is not released when the function return.

Fixes: fa6d79d276 ("ARM: OMAP: Add initialisation for the real-time counter.")
Signed-off-by: Chen Hui <judy.chenhui@huawei.com>
Message-Id: <20221108141917.46796-1-judy.chenhui@huawei.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
2022-12-27 07:21:41 +02:00