arm64: dts: rockchip: fix USB regulator on ROCK64
Subsystems (8)
Sasha Levin
maintainerPATCH 1/12 arm64: dts: rockchip: fix USB regulator on ROCK64
From: Lorenz Brun <[email protected]>
[ Upstream commit 03633c4ef1fb5ee119296dfe0c411656a9b5e04f ]
Currently the ROCK64 device tree specifies two regulators, vcc_host_5v and vcc_host1_5v for USB VBUS on the device. Both of those are however specified with RK_PA2 as the GPIO enabling them, causing the following error when booting:
rockchip-pinctrl pinctrl: pin gpio0-2 already requested by vcc-host-5v-regulator; cannot claim for vcc-host1-5v-regulator rockchip-pinctrl pinctrl: pin-2 (vcc-host1-5v-regulator) status -22
rockchip-pinctrl pinctrl: could not request pin 2 (gpio0-2) from group usb20-host-drv on device rockchip-pinctrl reg-fixed-voltage vcc-host1-5v-regulator: Error applying setting, reverse things back
Looking at the schematic, there are in fact three USB regulators, vcc_host_5v, vcc_host1_5v and vcc_otg_v5. But the enable signal for all three is driven by Q2604 which is in turn driven by GPIO_A2/PA2.
Since these three regulators are not controllable separately, I removed the second one which was causing the error and added labels for all rails to the single regulator.
--- arch/arm64/boot/dts/rockchip/rk3328-rock64.dts | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-)
arch/arm64/boot/dts/rockchip/rk3328-rock64.dts +2 -12
@@ -37,7 +37,8 @@ vcc_sd: sdmmc-regulator { vin-supply = <&vcc_io>; }; - vcc_host_5v: vcc-host-5v-regulator { + /* Common enable line for all of the rails mentioned in the labels */ + vcc_host_5v: vcc_host1_5v: vcc_otg_5v: vcc-host-5v-regulator { compatible = "regulator-fixed"; gpio = <&gpio0 RK_PA2 GPIO_ACTIVE_LOW>; pinctrl-names = "default";
@@ -48,17 +49,6 @@ vcc_host_5v: vcc-host-5v-regulator { vin-supply = <&vcc_sys>; }; - vcc_host1_5v: vcc_otg_5v: vcc-host1-5v-regulator { - compatible = "regulator-fixed"; - gpio = <&gpio0 RK_PA2 GPIO_ACTIVE_LOW>; - pinctrl-names = "default"; - pinctrl-0 = <&usb20_host_drv>; - regulator-name = "vcc_host1_5v"; - regulator-always-on; - regulator-boot-on; - vin-supply = <&vcc_sys>; - }; - vcc_sys: vcc-sys { compatible = "regulator-fixed"; regulator-name = "vcc_sys";
Signature · 7 lines
2.39.2 _______________________________________________ Linux-rockchip mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-rockchip
Sasha Levin
maintainerPATCH 2/12 tracing/user_events: Prevent same name but different args event
From: sunliming <[email protected]>
[ Upstream commit ba470eebc2f6c2f704872955a715b9555328e7d0 ]
User processes register name_args for events. If the same name but different args event are registered. The trace outputs of second event are printed as the first event. This is incorrect.
Return EADDRINUSE back to the user process if the same name but different args event has being registered.
--- kernel/trace/trace_events_user.c | 36 +++++++++++++++---- .../selftests/user_events/ftrace_test.c | 6 ++++ 2 files changed, 36 insertions(+), 6 deletions(-)
kernel/trace/trace_events_user.c +30 -6
@@ -1274,6 +1274,8 @@ static int user_event_parse(struct user_event_group *group, char *name,int index;u32 key;struct user_event *user; +int argc =0 ; +char **argv;/* Prevent dyn_event from racing */ mutex_lock (&event_mutex);
@@ -1281,13 +1283,35 @@ static int user_event_parse(struct user_event_group *group, char *name,mutex_unlock (&event_mutex);if (user) { - *newuser = user; -/* -* Name is allocated by caller, free it since it already exists. -* Caller only worries about failure cases for freeing. -*/ -kfree (name); +if (args) { + argv =argv_split (GFP_KERNEL , args, &argc); +if (!argv) { + ret = -ENOMEM ; + goto error; + } + + ret =user_fields_match (user, argc, (const char **)argv); +argv_free (argv); + + }else + ret =list_empty (&user->fields); + +if (ret) { + *newuser = user; +/* +* Name is allocated by caller, free it since it already exists. +* Caller only worries about failure cases for freeing. +*/ +kfree (name); + }else { + ret = -EADDRINUSE ; + goto error; + } +return 0 ; +error: +refcount_dec (&user->refcnt); +return ret; } index =find_first_zero_bit (group->page_bitmap,MAX_EVENTS );
tools/testing/selftests/user_events/ftrace_test.c +6 -0
@@ -209,6 +209,12 @@ TEST_F(user, register_events) {ASSERT_EQ (0 , reg.write_index);ASSERT_NE (0 , reg.status_bit); +/* Multiple registers to same name but different args should fail */ + reg.enable_bit =29 ; + reg.name_args = (__u64 )"__test_event u32 field1;" ; +ASSERT_EQ (-1 ,ioctl (self->data_fd,DIAG_IOCSREG , ®)); +ASSERT_EQ (EADDRINUSE , errno); +/* Ensure disabled */ self->enable_fd =open (enable_file,O_RDWR );ASSERT_NE (-1 , self->enable_fd);
Signature · 1 line
2.39.2
Sasha Levin
maintainerPATCH 3/12 tracing/user_events: Handle matching arguments that is null from dyn_events
In reply to Sasha LevinFrom: sunliming <[email protected]>
[ Upstream commit cfac4ed7279d056df6167bd665e460787dc9e0c4 ]
When A registering user event from dyn_events has no argments, it will pass the matching check, regardless of whether there is a user event with the same name and arguments. Add the matching check when the arguments of registering user event is null.
--- kernel/trace/trace_events_user.c | 2 ++ 1 file changed, 2 insertions(+)
kernel/trace/trace_events_user.c +2 -0
@@ -1232,6 +1232,8 @@ static bool user_event_match(const char *system, const char *event,if (match && argc >0 ) match =user_fields_match (user, argc, argv); +else if (match && argc ==0 ) + match =list_empty (&user->fields);return match; }
Signature · 1 line
2.39.2
Sasha Levin
maintainerPATCH 4/12 tracing/user_events: Fix the incorrect trace record for empty arguments events
In reply to Sasha LevinFrom: sunliming <[email protected]>
[ Upstream commit 6f05dcabe5c241d066ec472cf38ac8b84f8c9c6f ]
The user_events support events that has empty arguments. But the trace event is discarded and not really committed when the arguments is empty. Fix this by not attempting to copy in zero-length data.
--- kernel/trace/trace_events_user.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/trace/trace_events_user.c +2 -2
@@ -916,7 +916,7 @@ static void user_event_ftrace(struct user_event *user, struct iov_iter *i,if (unlikely (!entry))return ; -if (unlikely (!copy_nofault (entry +1 , i->count, i))) +if (unlikely (i->count !=0 && !copy_nofault (entry +1 , i->count, i))) goto discard; if (!list_empty(&user->validators) &&
@@ -957,7 +957,7 @@ static void user_event_perf(struct user_event *user, struct iov_iter *i,perf_fetch_caller_regs (regs); -if (unlikely (!copy_nofault (perf_entry +1 , i->count, i))) +if (unlikely (i->count !=0 && !copy_nofault (perf_entry +1 , i->count, i))) goto discard; if (!list_empty(&user->validators) &&
Signature · 1 line
2.39.2
Sasha Levin
maintainerPATCH 5/12 ieee802154/adf7242: Add MODULE_FIRMWARE macro
In reply to Sasha LevinFrom: Juerg Haefliger <[email protected]>
[ Upstream commit f593a94b530aee4c7f2511c9e48eb495dff03991 ]
The module loads firmware so add a MODULE_FIRMWARE macro to provide that information via modinfo.
--- drivers/net/ieee802154/adf7242.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/ieee802154/adf7242.c +2 -0
@@ -1349,3 +1349,5 @@ module_spi_driver(adf7242_driver);MODULE_AUTHOR ("Michael Hennerich <[email protected]>" );MODULE_DESCRIPTION ("ADF7242 IEEE802.15.4 Transceiver Driver" );MODULE_LICENSE ("GPL" ); + +MODULE_FIRMWARE (FIRMWARE );
Signature · 1 line
2.39.2
Sasha Levin
maintainerPATCH 6/12 nfc: fdp: Add MODULE_FIRMWARE macros
In reply to Sasha LevinFrom: Juerg Haefliger <[email protected]>
[ Upstream commit eb09fc2d14163c0c217846cfabec3d0cce7c8f8c ]
The module loads firmware so add MODULE_FIRMWARE macros to provide that information via modinfo.
--- drivers/nfc/fdp/fdp.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/nfc/fdp/fdp.c +3 -0
@@ -762,3 +762,6 @@ EXPORT_SYMBOL(fdp_nci_remove);MODULE_LICENSE ("GPL" );MODULE_DESCRIPTION ("NFC NCI driver for Intel Fields Peak NFC controller" );MODULE_AUTHOR ("Robert Dolca <[email protected]>" ); + +MODULE_FIRMWARE (FDP_OTP_PATCH_NAME ); +MODULE_FIRMWARE (FDP_RAM_PATCH_NAME );
Signature · 1 line
2.39.2
Sasha Levin
maintainerPATCH 7/12 ALSA: hda/realtek: Add quirk for ASUS ROG G634Z
In reply to Sasha LevinFrom: "Luke D. Jones" <[email protected]>
[ Upstream commit 555434fd5c6b3589d9511ab6e88faf50346e19da ]
Adds the required quirk to enable the Cirrus amp and correct pins on the ASUS ROG G634Z series.
While this works if the related _DSD properties are made available, these aren't included in the ACPI of these laptops (yet).
--- sound/pci/hda/patch_realtek.c | 1 + 1 file changed, 1 insertion(+)
sound/pci/hda/patch_realtek.c +1 -0
@@ -9552,6 +9552,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {SND_PCI_QUIRK (0x1043 ,0x1c23 ,"Asus X55U" ,ALC269_FIXUP_LIMIT_INT_MIC_BOOST ),SND_PCI_QUIRK (0x1043 ,0x1c62 ,"ASUS GU603" ,ALC289_FIXUP_ASUS_GA401 ),SND_PCI_QUIRK (0x1043 ,0x1c92 ,"ASUS ROG Strix G15" ,ALC285_FIXUP_ASUS_G533Z_PINS ), +SND_PCI_QUIRK (0x1043 ,0x1caf ,"ASUS G634JYR/JZR" ,ALC285_FIXUP_ASUS_HEADSET_MIC ),SND_PCI_QUIRK (0x1043 ,0x1ccd ,"ASUS X555UB" ,ALC256_FIXUP_ASUS_MIC ),SND_PCI_QUIRK (0x1043 ,0x1d42 ,"ASUS Zephyrus G14 2022" ,ALC289_FIXUP_ASUS_GA401 ), SND_PCI_QUIRK(0x1043, 0x1d4e, "ASUS TM420", ALC256_FIXUP_ASUS_HPE),
Signature · 1 line
2.39.2
Sasha Levin
maintainerPATCH 8/12 net: dpaa2-mac: add 25gbase-r support
In reply to Sasha LevinFrom: Josua Mayer <[email protected]>
[ Upstream commit 9a43827e876c9a071826cc81783aa2222b020f1d ]
Layerscape MACs support 25Gbps network speed with dpmac "CAUI" mode. Add the mappings between DPMAC_ETH_IF_* and HY_INTERFACE_MODE_*, as well as the 25000 mac capability.
Tested on SolidRun LX2162a Clearfog, serdes 1 protocol 18.
--- drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/net/ethernet/freescale/dpaa2/dpaa2-mac.c +6 -1
@@ -54,6 +54,9 @@ static int phy_mode(enum dpmac_eth_if eth_if, phy_interface_t *if_mode)case DPMAC_ETH_IF_XFI : *if_mode =PHY_INTERFACE_MODE_10GBASER ;break ; +case DPMAC_ETH_IF_CAUI : + *if_mode =PHY_INTERFACE_MODE_25GBASER ; +break ;default :return -EINVAL ; }
@@ -79,6 +82,8 @@ static enum dpmac_eth_if dpmac_eth_if_mode(phy_interface_t if_mode)return DPMAC_ETH_IF_XFI ;case PHY_INTERFACE_MODE_1000BASEX :return DPMAC_ETH_IF_1000BASEX ; +case PHY_INTERFACE_MODE_25GBASER : +return DPMAC_ETH_IF_CAUI ;default :return DPMAC_ETH_IF_MII ; }
@@ -407,7 +412,7 @@ int dpaa2_mac_connect(struct dpaa2_mac *mac) mac->phylink_config.mac_capabilities =MAC_SYM_PAUSE |MAC_ASYM_PAUSE |MAC_10FD |MAC_100FD |MAC_1000FD |MAC_2500FD |MAC_5000FD | -MAC_10000FD ; +MAC_10000FD |MAC_25000FD ;dpaa2_mac_set_supported_interfaces (mac);
Signature · 1 line
2.39.2
Sasha Levin
maintainerPATCH 9/12 drm: use mgr->dev in drm_dbg_kms in drm_dp_add_payload_part2
In reply to Sasha LevinFrom: Jeff Layton <[email protected]>
[ Upstream commit 54d217406afe250d7a768783baaa79a035f21d38 ]
I've been experiencing some intermittent crashes down in the display driver code. The symptoms are ususally a line like this in dmesg:
amdgpu 0000:30:00.0: [drm] Failed to create MST payload for port 000000006d3a3885: -5
...followed by an Oops due to a NULL pointer dereference.
Switch to using mgr->dev instead of state->dev since "state" can be NULL in some cases.
--- drivers/gpu/drm/display/drm_dp_mst_topology.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/display/drm_dp_mst_topology.c +1 -1
@@ -3404,7 +3404,7 @@ int drm_dp_add_payload_part2(struct drm_dp_mst_topology_mgr *mgr,/* Skip failed payloads */ if (payload->vc_start_slot ==-1 ) { -drm_dbg_kms (state->dev,"Part 1 of payload creation for %s failed, skipping part 2\n" , +drm_dbg_kms (mgr->dev,"Part 1 of payload creation for %s failed, skipping part 2\n" , payload->port->connector->name);return -EIO ; }
Signature · 1 line
2.39.2
Sasha Levin
maintainerPATCH 10/12 netfilter: nf_tables: disallow timeout for anonymous sets
In reply to Sasha LevinFrom: Pablo Neira Ayuso <[email protected]>
[ Upstream commit e26d3009efda338f19016df4175f354a9bd0a4ab ]
Never used from userspace, disallow these parameters.
--- net/netfilter/nf_tables_api.c | 7 +++++++ 1 file changed, 7 insertions(+)
net/netfilter/nf_tables_api.c +7 -0
@@ -4588,6 +4588,9 @@ static int nf_tables_newset(struct sk_buff *skb, const struct nfnl_info *info,if (!(flags &NFT_SET_TIMEOUT ))return -EINVAL ; +if (flags &NFT_SET_ANONYMOUS ) +return -EOPNOTSUPP ; + err =nf_msecs_to_jiffies64 (nla[NFTA_SET_TIMEOUT ], &desc.timeout);if (err)return err;
@@ -4596,6 +4599,10 @@ static int nf_tables_newset(struct sk_buff *skb, const struct nfnl_info *info,if (nla[NFTA_SET_GC_INTERVAL ] !=NULL ) {if (!(flags &NFT_SET_TIMEOUT ))return -EINVAL ; + +if (flags &NFT_SET_ANONYMOUS ) +return -EOPNOTSUPP ; + desc.gc_int =ntohl (nla_get_be32 (nla[NFTA_SET_GC_INTERVAL ])); }
Signature · 1 line
2.39.2
Sasha Levin
maintainerPATCH 11/12 ALSA: hda/realtek: Add quirk for ASUS ROG GV601V
In reply to Sasha LevinFrom: "Luke D. Jones" <[email protected]>
[ Upstream commit 82edd1bd7f98567928871e2a2a317724d35f0085 ]
Adds the required quirk to enable the Cirrus amp and correct pins on the ASUS ROG GV601V series.
While this works if the related _DSD properties are made available, these aren't included in the ACPI of these laptops (yet).
--- sound/pci/hda/patch_realtek.c | 1 + 1 file changed, 1 insertion(+)
sound/pci/hda/patch_realtek.c +1 -0
@@ -9527,6 +9527,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {SND_PCI_QUIRK (0x1043 ,0x1427 ,"Asus Zenbook UX31E" ,ALC269VB_FIXUP_ASUS_ZENBOOK ),SND_PCI_QUIRK (0x1043 ,0x1473 ,"ASUS GU604V" ,ALC285_FIXUP_ASUS_HEADSET_MIC ),SND_PCI_QUIRK (0x1043 ,0x1483 ,"ASUS GU603V" ,ALC285_FIXUP_ASUS_HEADSET_MIC ), +SND_PCI_QUIRK (0x1043 ,0x1493 ,"ASUS GV601V" ,ALC285_FIXUP_ASUS_HEADSET_MIC ),SND_PCI_QUIRK (0x1043 ,0x1517 ,"Asus Zenbook UX31A" ,ALC269VB_FIXUP_ASUS_ZENBOOK_UX31A ),SND_PCI_QUIRK (0x1043 ,0x1662 ,"ASUS GV301QH" ,ALC294_FIXUP_ASUS_DUAL_SPK ), SND_PCI_QUIRK(0x1043, 0x1683, "ASUS UM3402YAR", ALC287_FIXUP_CS35L41_I2C_2),
Signature · 1 line
2.39.2
Sasha Levin
maintainerPATCH 12/12 workqueue: clean up WORK_* constant types, clarify masking
In reply to Sasha LevinFrom: Linus Torvalds <[email protected]>
[ Upstream commit afa4bb778e48d79e4a642ed41e3b4e0de7489a6c ]
Dave Airlie reports that gcc-13.1.1 has started complaining about some of the workqueue code in 32-bit arm builds:
kernel/workqueue.c: In function ‘get_work_pwq’:
kernel/workqueue.c:713:24: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
713 | return (void *)(data & WORK_STRUCT_WQ_DATA_MASK);
| ^[ ... a couple of other cases ... ]
and while it's not immediately clear exactly why gcc started complaining about it now, I suspect it's some C23-induced enum type handlign fixup in gcc-13 is the cause.
Whatever the reason for starting to complain, the code and data types are indeed disgusting enough that the complaint is warranted.
The wq code ends up creating various "helper constants" (like that WORK_STRUCT_WQ_DATA_MASK) using an enum type, which is all kinds of confused. The mask needs to be 'unsigned long', not some unspecified enum type.
To make matters worse, the actual "mask and cast to a pointer" is repeated a couple of times, and the cast isn't even always done to the right pointer, but - as the error case above - to a 'void *' with then the compiler finishing the job.
That's now how we roll in the kernel.
So create the masks using the proper types rather than some ambiguous enumeration, and use a nice helper that actually does the type conversion in one well-defined place.
Incidentally, this magically makes clang generate better code. That, admittedly, is really just a sign of clang having been seriously confused before, and cleaning up the typing unconfuses the compiler too.
--- include/linux/workqueue.h | 15 ++++++++------- kernel/workqueue.c | 13 ++++++++----- 2 files changed, 16 insertions(+), 12 deletions(-)
include/linux/workqueue.h +8 -7
@@ -68,7 +68,6 @@ enum {WORK_OFFQ_FLAG_BASE =WORK_STRUCT_COLOR_SHIFT , __WORK_OFFQ_CANCELING = WORK_OFFQ_FLAG_BASE, - WORK_OFFQ_CANCELING = (1 << __WORK_OFFQ_CANCELING),/* * When a work item is off queue, its high bits point to the last
@@ -79,12 +78,6 @@ enum {WORK_OFFQ_POOL_SHIFT =WORK_OFFQ_FLAG_BASE +WORK_OFFQ_FLAG_BITS ,WORK_OFFQ_LEFT =BITS_PER_LONG -WORK_OFFQ_POOL_SHIFT ,WORK_OFFQ_POOL_BITS =WORK_OFFQ_LEFT <=31 ?WORK_OFFQ_LEFT :31 , -WORK_OFFQ_POOL_NONE = (1LU <<WORK_OFFQ_POOL_BITS ) -1 , - -/* convenience constants */ -WORK_STRUCT_FLAG_MASK = (1UL <<WORK_STRUCT_FLAG_BITS ) -1 , -WORK_STRUCT_WQ_DATA_MASK = ~WORK_STRUCT_FLAG_MASK , -WORK_STRUCT_NO_POOL = (unsigned long )WORK_OFFQ_POOL_NONE <<WORK_OFFQ_POOL_SHIFT ,/* bit mask for work_busy() return values */ WORK_BUSY_PENDING = 1 << 0,
@@ -94,6 +87,14 @@ enum { WORKER_DESC_LEN = 24, }; +/* Convenience constants - of type 'unsigned long', not 'enum'! */ +#define WORK_OFFQ_CANCELING (1ul << __WORK_OFFQ_CANCELING) +#define WORK_OFFQ_POOL_NONE ((1ul << WORK_OFFQ_POOL_BITS) - 1) +#define WORK_STRUCT_NO_POOL (WORK_OFFQ_POOL_NONE << WORK_OFFQ_POOL_SHIFT) + +#define WORK_STRUCT_FLAG_MASK ((1ul << WORK_STRUCT_FLAG_BITS) - 1) +#define WORK_STRUCT_WQ_DATA_MASK (~WORK_STRUCT_FLAG_MASK) +struct work_struct {atomic_long_t data;struct list_head entry;
kernel/workqueue.c +8 -5
@@ -698,12 +698,17 @@ static void clear_work_data(struct work_struct *work)set_work_data (work,WORK_STRUCT_NO_POOL ,0 ); } +static inline struct pool_workqueue *work_struct_pwq (unsigned long data) +{ +return (struct pool_workqueue *)(data &WORK_STRUCT_WQ_DATA_MASK ); +} +static struct pool_workqueue *get_work_pwq (struct work_struct *work) {unsigned long data =atomic_long_read (&work->data);if (data &WORK_STRUCT_PWQ ) -return (void *)(data &WORK_STRUCT_WQ_DATA_MASK ); +return work_struct_pwq (data);else return NULL ; }
@@ -731,8 +736,7 @@ static struct worker_pool *get_work_pool(struct work_struct *work)assert_rcu_or_pool_mutex ();if (data &WORK_STRUCT_PWQ ) -return ((struct pool_workqueue *) - (data &WORK_STRUCT_WQ_DATA_MASK ))->pool; +return work_struct_pwq (data)->pool; pool_id = data >>WORK_OFFQ_POOL_SHIFT ;if (pool_id ==WORK_OFFQ_POOL_NONE )
@@ -753,8 +757,7 @@ static int get_work_pool_id(struct work_struct *work)unsigned long data =atomic_long_read (&work->data);if (data &WORK_STRUCT_PWQ ) -return ((struct pool_workqueue *) - (data &WORK_STRUCT_WQ_DATA_MASK ))->pool->id; +return work_struct_pwq (data)->pool->id;return data >>WORK_OFFQ_POOL_SHIFT ; }
Signature · 1 line
2.39.2