Asymmetric systems may not offer the same level of userspace ISA support
across all CPUs, meaning that some applications cannot be executed by
some CPUs. As a concrete example, upcoming arm64 big.LITTLE designs do
not feature support for 32-bit applications on both clusters.
On such a system, we must take care not to migrate a task to an
unsupported CPU when forcefully moving tasks in select_fallback_rq()
in response to a CPU hot-unplug operation.
Introduce a task_cpu_possible_mask() hook which, given a task argument,
allows an architecture to return a cpumask of CPUs that are capable of
executing that task. The default implementation returns the
cpu_possible_mask, since sane machines do not suffer from per-cpu ISA
limitations that affect scheduling. The new mask is used when selecting
the fallback runqueue as a last resort before forcing a migration to the
first active CPU.
Reviewed-by: Quentin Perret <qperret@google.com>
Signed-off-by: Will Deacon <will@kernel.org>
Bug: 178507149
Link: https://lore.kernel.org/linux-arch/20201208132835.6151-7-will@kernel.org/
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: I75985976c196cee7b84043e1a03fcc62f8b6d1c4
Scheduling a 32-bit application on a 64-bit-only CPU is a bad idea.
Ensure that 32-bit applications always take the slow-path when returning
to userspace on a system with mismatched support at EL0, so that we can
avoid trying to run on a 64-bit-only CPU and force a SIGKILL instead.
Signed-off-by: Will Deacon <will@kernel.org>
Bug: 178507149
Link: https://lore.kernel.org/linux-arch/20201208132835.6151-5-will@kernel.org/
[will: Fixed trivial conflict with vendor hook in __switch_to()]
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: I5ae90f3fb63499d7016f93d13e32693e26890f92
When confronted with a mixture of CPUs, some of which support 32-bit
applications and others which don't, we quite sensibly treat the system
as 64-bit only for userspace and prevent execve() of 32-bit binaries.
Unfortunately, some crazy folks have decided to build systems like this
with the intention of running 32-bit applications, so relax our
sanitisation logic to continue to advertise 32-bit support to userspace
on these systems and track the real 32-bit capable cores in a cpumask
instead. For now, the default behaviour remains but will be tied to
a command-line option in a later patch.
Signed-off-by: Will Deacon <will@kernel.org>
Bug: 178507149
Link: https://lore.kernel.org/linux-arch/20201208132835.6151-3-will@kernel.org/
[will: Fix conflict in cpucaps definition, as ARM64_HARDEN_EL2_VECTORS renamed]
Signed-off-by: Will Deacon <willdeacon@google.com>
Change-Id: Ib8d2b8df2f4ce370a518685ee81789be9b2dd6f5
CONFIG_ASYMMETRIC_AARCH32 is about to go away, so remove its entry from
gki_defconfig.
Bug: 178507149
Signed-off-by: Will Deacon <will@kernel.org>
Change-Id: I67dbbd7c31637a4d1ec2aab8bd86d9fac515b9d3
Signed-off-by: Will Deacon <willdeacon@google.com>
The PELT half-life is currently hard-coded to 32ms.
Create cmdline arg to enable switching to a PELT half-life of 8mS.
Bug: 177593580
Change-Id: I9f8cfc3d9554a500eec0f6a1b161f4155c296b4d
Signed-off-by: Shaleen Agrawal <shalagra@codeaurora.org>
With CONFIG_CFI_CLANG, the compiler replaces function pointers with
jump table addresses, which results in __pa_symbol returning the
physical address of the jump table entry. As the jump table contains
an immediate jump to an EL1 virtual address, this typically won't
work as intended. Use __pa_function instead to get the address to
cpu_resume.
Bug: 145210207
Change-Id: Iebcb0950b074c0ed0ddc6ec6cd8c4ff539f00e7c
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
With CONFIG_CFI_CLANG, the compiler replaces function pointers with
jump table addresses, which results in __pa_symbol returning the
physical address of the jump table entry. As the jump table contains
an immediate jump to an EL1 virtual address, this typically won't
work as intended. Use __pa_function instead to get the address of
secondary_entry.
Bug: 178005287
Change-Id: I90aea4cacd66ac224aae5c1a577decda1d922c22
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Add hooks to gather data of kernel fault and summarize it with
other information.
Bug: 177483057
Signed-off-by: Sangmoon Kim <sangmoon.kim@samsung.com>
Change-Id: I527eddf08be22fa842680bee850f1ef1f5a2c0ed
Add hooks to gather data of bad scheduling and summarize it with
other information.
Bug: 177483057
Signed-off-by: Sangmoon Kim <sangmoon.kim@samsung.com>
Change-Id: I08a7097b60dd8eebc5c0205b31c463a36f576121
Add hooks to gather data of unfrozen tasks and summarize it
with other information.
Bug: 177483057
Signed-off-by: Sangmoon Kim <sangmoon.kim@samsung.com>
Change-Id: I6f3ed7320e828a8dd1e7ae5d4449420085a75b17
Add hook to gather data of softlockup and summarize it with
other information.
Bug: 177483057
Signed-off-by: Sangmoon Kim <sangmoon.kim@samsung.com>
Change-Id: I42b906f17ad689176f0cc5a1a46acd0b5971d6c5
Patch 'ANDROID: mm, oom: Avoid killing tasks with negative ADJ scores'
does not handle a special case when oom_evaluate_task is aborted and
sets oc->chosen to -1. Check for this condition to avoid invalid memory
access.
Bug: 179177151
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: Id9a3f1b824c6a81d157782b8cb18115b3c577a50
The speculative page fault path does not sync the
rss in task_struct to mm_struct leading to large
variance in the RSS values observed by userspace
tools and also in the OOM task dump.
Change-Id: Id45f1b9b0a51a9afffbaf8e65f5ef747d409d0d7
Bug: 179217427
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
Leaf changes summary: 2 artifacts changed
Changed leaf types summary: 1 leaf type changed
Removed/Changed/Added functions summary: 0 Removed, 1 Changed, 0 Added function
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable
1 function with some sub-type change:
[C] 'function dma_heap* dma_heap_add(const dma_heap_export_info*)' at dma-heap.c:283:1 has some sub-type changes:
CRC (modversions) changed from 0xeb9fba5f to 0x7708cda
'struct dma_heap_ops at dma-heap.h:23:1' changed:
type size changed from 64 to 128 (in bits)
1 data member insertion:
'long int (dma_heap*)* dma_heap_ops::get_pool_size', at offset 64 (in bits) at dma-heap.h:29:1
5 impacted interfaces
Bug: 167709539
Change-Id: Ie1669843bdf3ae48e31bf30ef61df33ee54c19b7
Signed-off-by: Hridya Valsaraju <hridya@google.com>
A number of systems need the dummy USB host controller driver for
testing, so enable it into the kernel to remove the need to support a
bunch of exported symbols just for that driver.
Bug: 157965270
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I74b3aa819984dd894cccd3a5239d210b9e0d43a5
Leaf changes summary: 76 artifacts changed
Changed leaf types summary: 2 leaf types changed
Removed/Changed/Added functions summary: 0 Removed, 74 Changed, 0 Added function
Removed/Changed/Added variables summary: 0 Removed, 0 Changed, 0 Added variable
74 functions with some sub-type change:
[C] 'function int __ion_device_add_heap(ion_heap*, module*)' at ion.c:312:1 has some sub-type changes:
CRC (modversions) changed from 0x1eddf3a5 to 0x7f958fe0
[C] 'function dma_buf_attachment* dma_buf_attach(dma_buf*, device*)' at dma-buf.h:585:1 has some sub-type changes:
CRC (modversions) changed from 0x1e0bba0e to 0x338ae462
[C] 'function int dma_buf_begin_cpu_access(dma_buf*, dma_data_direction)' at dma-buf.c:1125:1 has some sub-type changes:
CRC (modversions) changed from 0xe447ea92 to 0xca6c466d
... 71 omitted; 74 symbols have only CRC changes
'struct dma_buf at dma-buf.h:394:1' changed:
type size changed from 2048 to 2112 (in bits)
1 data member insertion:
'dma_buf_sysfs_entry* dma_buf::sysfs_entry', at offset 2048 (in bits) at dma-buf.h:426:1
93 impacted interfaces
'struct dma_buf_attachment at dma-buf.h:490:1' changed:
type size changed from 640 to 704 (in bits)
1 data member insertion:
'dma_buf_attach_sysfs_entry* dma_buf_attachment::sysfs_entry', at offset 640 (in bits) at dma-buf.h:506:1
93 impacted interface
Bug: 167709539
Change-Id: I3297a07ef29e63a0c2fda81b2a02cbf95fd3f372
Signed-off-by: Hridya Valsaraju <hridya@google.com>
This patch turns on CONFIG_DMABUF_SYSFS_STATS to enable the DMA-BUF
sysfs statistics.
Bug: 167709539
Change-Id: Idc4cb231edfedcdf672474119238e5d7e545002d
Signed-off-by: Hridya Valsaraju <hridya@google.com>
Though zram pages are movable, they aren't allowed to enter
MIGRATE_CMA pageblocks. zram is not seen to pin pages for
long which can cause an issue. Moreover allowing zram to
pick CMA pages can be helpful in cases seen where zram order
0 alloc fails when there are lots of free cma pages, resulting
in kswapd or direct reclaim not making enough progress.
Signed-off-by: Vinayak Menon <vinmenon@codeaurora.org>
Signed-off-by: Chris Goldsworthy <cgoldswo@codeaurora.org>
Bug: 158645321
Link: https://lore.kernel.org/linux-mm/4c77bb100706b714213ff840d827a48e40ac9177.1604282969.git.cgoldswo@codeaurora.org/
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I406f92a4175367caec38ef8b8eaca7020ae09917
We currently plan to disallow use of filp_open() from drivers in GKI,
however the ZRAM driver still needs it. Add a new GKI-only variant of
filp_open() which only permits a block device to be opened, which can
be exported instead. This keeps ZRAM working but cuts down on drivers
that attempt to open and write files in kernel mode.
Bug: 179220339
Change-Id: Id696b4aaf204b0499ce0a1b6416648670236e570
Signed-off-by: Alistair Delva <adelva@google.com>
Older ATF does not provide SMC call for USB 3.0 phy power on functionality
and therefore initialization of xhci-hcd is failing when older version of
ATF is used. In this case phy_power_on() function returns -EOPNOTSUPP.
[ 3.108467] mvebu-a3700-comphy d0018300.phy: unsupported SMC call, try updating your firmware
[ 3.117250] phy phy-d0018300.phy.0: phy poweron failed --> -95
[ 3.123465] xhci-hcd: probe of d0058000.usb failed with error -95
This patch introduces a new plat_setup callback for xhci platform drivers
which is called prior calling usb_add_hcd() function. This function at its
beginning skips PHY init if hcd->skip_phy_initialization is set.
Current init_quirk callback for xhci platform drivers is called from
xhci_plat_setup() function which is called after chip reset completes.
It happens in the middle of the usb_add_hcd() function and therefore this
callback cannot be used for setting if PHY init should be skipped or not.
For Armada 3720 this patch introduce a new xhci_mvebu_a3700_plat_setup()
function configured as a xhci platform plat_setup callback. This new
function calls phy_power_on() and in case it returns -EOPNOTSUPP then
XHCI_SKIP_PHY_INIT quirk is set to instruct xhci-plat to skip PHY
initialization.
This patch fixes above failure by ignoring 'not supported' error in
xhci-hcd driver. In this case it is expected that phy is already power on.
It fixes initialization of xhci-hcd on Espressobin boards where is older
Marvell's Arm Trusted Firmware without SMC call for USB 3.0 phy power.
This is regression introduced in commit bd3d25b073 ("arm64: dts: marvell:
armada-37xx: link USB hosts with their PHYs") where USB 3.0 phy was defined
and therefore xhci-hcd on Espressobin with older ATF started failing.
Fixes: bd3d25b073 ("arm64: dts: marvell: armada-37xx: link USB hosts with their PHYs")
Cc: <stable@vger.kernel.org> # 5.1+: ea17a0f153: phy: marvell: comphy: Convert internal SMCC firmware return codes to errno
Cc: <stable@vger.kernel.org> # 5.1+: f768e71891: usb: host: xhci-plat: add priv quirk for skip PHY initialization
Tested-by: Tomasz Maciej Nowak <tmn505@gmail.com>
Tested-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> # On R-Car
Reviewed-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com> # xhci-plat
Acked-by: Mathias Nyman <mathias.nyman@linux.intel.com>
Signed-off-by: Pali Rohár <pali@kernel.org>
Link: https://lore.kernel.org/r/20210201150803.7305-1-pali@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 3241929b67https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-linus)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Ib1a7567e31b368eeeb3eab5d6cde0b6354985b09
Leaf changes summary: 450 artifacts changed
Changed leaf types summary: 4 leaf types changed
Removed/Changed/Added functions summary: 0 Removed, 438 Changed, 1 Added function
Removed/Changed/Added variables summary: 0 Removed, 6 Changed, 1 Added variable
1 Added function:
[A] 'function int __traceiter_gpu_mem_total(void*, uint32_t, uint32_t, uint64_t)'
438 functions with some sub-type change:
[C] 'function sk_buff* __alloc_skb(unsigned int, gfp_t, int, int)' at skbuff.c:182:1 has some sub-type changes:
CRC (modversions) changed from 0xfd1708c0 to 0x6e6cd7df
[C] 'function sk_buff* __cfg80211_alloc_event_skb(wiphy*, wireless_dev*, nl80211_commands, nl80211_attrs, unsigned int, int, int, gfp_t)' at nl80211.c:10265:1 has some sub-type changes:
CRC (modversions) changed from 0x3586dfd7 to 0x15664597
[C] 'function sk_buff* __cfg80211_alloc_reply_skb(wiphy*, nl80211_commands, nl80211_attrs, int)' at nl80211.c:13787:1 has some sub-type changes:
CRC (modversions) changed from 0xf3ea1f25 to 0x1925a82
... 435 omitted; 438 symbols have only CRC changes
1 Added variable:
[A] 'tracepoint __tracepoint_gpu_mem_total'
6 Changed variables:
[C] 'net init_net' was changed at net_namespace.c:47:1:
size of symbol changed from 4288 to 4224
CRC (modversions) changed from 0xaab61b00 to 0x163d1189
type of variable changed:
type size changed from 34304 to 33792 (in bits)
1 data member deletion:
'netns_ieee802154_lowpan net::ieee802154_lowpan', at offset 18944 (in bits) at net_namespace.h:131:1
there are data member changes:
10 ('netns_nf net::nf' .. 'netns_bpf net::bpf') offsets changed (by -128 bits)
4 ('netns_xfrm net::xfrm' .. 'sock* net::diag_nlsk') offsets changed (by -512 bits)
272 impacted interfaces
[C] 'pid_namespace init_pid_ns' was changed at pid.c:75:1:
CRC (modversions) changed from 0x486b366 to 0x811ce7fd
[C] 'task_struct init_task' was changed at init_task.c:64:1:
CRC (modversions) changed from 0xb1ab451d to 0xce0185e2
[C] 'task_group root_task_group' was changed at core.c:7251:1:
CRC (modversions) changed from 0x47f714e8 to 0xf59cfaca
... 2 omitted; 5 symbols have only CRC changes
'struct ndisc_options at ndisc.h:111:1' changed:
type size changed from 1408 to 1216 (in bits)
1 data member deletion:
'nd_opt_hdr* ndisc_options::nd_802154_opt_array[3]', at offset 1216 (in bits) at ndisc.h:120:1
272 impacted interfaces
'struct net at net_namespace.h:56:1' changed:
details were reported earlier
'struct typec_partner at class.c:32:1' changed:
type size hasn't changed
1 data member insertion:
'u16 typec_partner::pd_revision', at offset 6304 (in bits) at class.c:40:1
10 impacted interfaces
'struct typec_partner_desc at typec.h:186:1' changed:
type size changed from 128 to 192 (in bits)
1 data member insertion:
'u16 typec_partner_desc::pd_revision', at offset 128 (in bits) at typec.h:200:1
one impacted interface
Bug: 154525079
Signed-off-by: Yiwei Zhang <zzyiwei@google.com>
Change-Id: I3a66320e1178cdbc2b6bd8dfa192f75db2394136
With cgroup v2 hierarchy enabled PSI accounts stalls for each cgroup
separately and aggregates at each level of the hierarchy. That causes
additional overhead since psi_avgs_work would be called for each
cgroup in the hierarchy.
In Android we use PSI only at the system level, therefore this overhead
can be avoided.
Introduce CONFIG_PSI_PER_CGROUP_ACCT that controls per-cgroup PSI
tracking and is disabled by default.
Bug: 178872719
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
Change-Id: I70a418aba76b46a27eb9e66080434aa870496384
This patch allows statistics to be enabled for each DMA-BUF in
sysfs by enabling the config CONFIG_DMABUF_SYSFS_STATS.
The following stats will be exposed by the interface:
/sys/kernel/dmabuf/buffers/<inode_number>/exporter_name
/sys/kernel/dmabuf/buffers/<inode_number>/size
/sys/kernel/dmabuf/buffers/<inode_number>/attachments/<attach_uid>/device
/sys/kernel/dmabuf/buffers/<inode_number>/attachments/<attach_uid>/map_counter
The inode_number is unique for each DMA-BUF and was added earlier [1]
in order to allow userspace to track DMA-BUF usage across different
processes.
Currently, this information is exposed in
/sys/kernel/debug/dma_buf/bufinfo.
However, since debugfs is considered unsafe to be mounted in production,
it is being duplicated in sysfs.
This information will be used to derive DMA-BUF
per-exporter stats and per-device usage stats for Android Bug reports.
The corresponding userspace changes can be found at [2].
Telemetry tools will also capture this information(along with other
memory metrics) periodically as well as on important events like a
foreground app kill (which might have been triggered by Low Memory
Killer). It will also contribute to provide a snapshot of the system
memory usage on other events such as OOM kills and Application Not
Responding events.
A shell script that can be run on a classic Linux environment to read
out the DMA-BUF statistics can be found at [3](suggested by John
Stultz).
The patch contains the following improvements over the previous version:
1) Each attachment is represented by its own directory to allow creating
a symlink to the importing device and to also provide room for future
expansion.
2) The number of distinct mappings of each attachment is exposed in a
separate file.
3) The per-buffer statistics are now in /sys/kernel/dmabuf/buffers
inorder to make the interface expandable in future.
All of the improvements above are based on suggestions/feedback from
Daniel Vetter and Christian König.
[1]: https://lore.kernel.org/patchwork/patch/1088791/
[2]: https://android-review.googlesource.com/q/topic:%22dmabuf-sysfs%22+(status:open%20OR%20status:merged)
[3]: https://android-review.googlesource.com/c/platform/system/memory/libmeminfo/+/1549734
Bug: 167709539
Link: https://lore.kernel.org/linux-media/20210126204240.418297-1-hridya@google.com/
[hridya: minor rebase needed in include/linux/dma-buf.h for backporting]
Signed-off-by: Hridya Valsaraju <hridya@google.com>
Reported-by: kernel test robot <lkp@intel.com>
Change-Id: I8a3342b57f2e21ff349839f5cf665980c97bf849
Receiving the first packet in an AMS sequence signals the
beginning of AMS. Set in_ams flag to true when SRC_CAPS are
received during POWER_NEGOTIATION AMS.
This fixes the failure flagged while running TD.PD.SNK.E9
compliance test.
>From Deterministic PD compliance MOI spec:
TD.PD.SNK.E9. GetSinkCap in Place of Accept
Description:
As Provider, the Tester intentionally sends a GetSinkCap message in place
of Accept message and verifies the UUT will send a SoftReset and recover
from the error.
Steps:
a) Run PROC.PD.E1 Bring-up according to the UUT role.
b) The Tester cycles VBus.
c) The Tester sends a Source Capabilities message to the UUT.
d) Upon receipt of a Request message from the UUT, the Tester replies with
a GoodCRC message.
e) The Tester sends a GetSinkCap message to the UUT.
f) If a SoftReset is not received within 15 ms after the GetSinkCap EOP was
sent, the test fails.
g) If a SoftReset is received timely, the Tester replies with an Accept
message.
h) The Tester sends Source Capabilities message to the UUT repeatedly until
nCapsCount reached or a GoodCRC is received. If nCapsCount reached, the
test fails.
i) If a Request is not received timely within 30 ms after the GoodCRC EOP
corresponding to Source Capabilities message was received, the test
fails.
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Badhri Jagan Sridharan <badhri@google.com>
Link: https://lore.kernel.org/r/20210202033859.258491-1-badhri@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 2b8ff93fd7https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-next)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: I85473f1c21c817a5358afaaf1b620cf29e566cf2
Since we're expecting timers more precisely in short period, add
a vendor hook to calc_index when adding timers. Then we can modify
the index this timer used to make it accurate.
Bug: 178758017
Signed-off-by: Huang Yiwei <hyiwei@codeaurora.org>
Change-Id: Ie0e6493ae7ad53b0cc57eb1bbcf8a0a11f652828
When the android virtual device stays up for long periods of time, the
SLAB sustains everincreasing fragmentation. Contributing to this
fragmentation are the virtio packet buffer allocations which are a
drain on 64Kb compound pages. Eventually these can't be allocated due to
fragmentation.
To enable successful allocations for this packet buffer, the packet
buffer's size needs to be reduced.
To enable a reduction without impacting other partners, this var is
being exposed as a command line param.
Bug: 149494272
Test: atest ManagedProfileLifecycleStressTest#testCreateStartDelete on
local cuttlefish device
Signed-off-by: Ram Muthiah <rammuthiah@google.com>
Change-Id: Ia4f9180025b64d61d9e2b882daa84460b8f08fd2
For implementation of IPI stats, nr_ipi and ipi_desc are useful.
This information helps in getting per cpu IPI count and total
IPI count from vendor module.
Presently, there are no helper functions to get nr_ipi and
ipi_desc on vendor side. And if we do with a new exported symbol
that does kallsyms_lookup_name on each static variable takes
more than 80ms during boot up or for the first access of each
static variable is an overhead.
So lets add helper functions to return nr_ipi and ipi_desc
value to get things done in an efficient way.
Bug: 177393446
Change-Id: I698dbbb0301d4f1529ef7484f25fe7540378008c
Signed-off-by: Prateek Sood <prsood@codeaurora.org>
Signed-off-by: Mukesh Ojha <mojha@codeaurora.org>
The partner's PD revision may be resolved later than the port partner
registration since the port partner creation may take place once
Type-C detects the port has changed state, but before PD communication is
completed.
Add a setter so that the partner's PD revision can be attached to it once
it becomes available.
If the revision is set to a valid version (not 0), the setter will also
refresh the partner's usb_pd flag and notify on "supports_usb_power_delivery"
sysfs property as well.
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Benson Leung <bleung@chromium.org>
Link: https://lore.kernel.org/r/20210129061406.2680146-4-bleung@chromium.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 29b01295a8https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-linus)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: If86d7729107e784fbfecd65185436b97208c97ae
The USB Power Delivery specification Section 6.2.1.1.5 outlines
revision backward compatibility requirements starting from Revision 3.0.
The Port, the Cable Plug, and the Port Partner may support either
revision 2 or revision 3 independently, and communication between ports,
partners, and cables of different revisions are allowed under rules
that the parties agree to communicate between each other using the
lowest common operating revision.
This may mean that Port-to-Partner operating revision comms may be
different than Port-to-CablePlug operating revision comms. For example,
it is possible for a R3.0 port to communicate with a R3.0 partner
using R3.0 messages, while the R3.0 port (in the same session) must
communicate with the R2.0 cable using R2.0 messages only.
Introduce individual revision number properties for cable
and port partner so that the port can track them independently.
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com>
Signed-off-by: Benson Leung <bleung@chromium.org>
Link: https://lore.kernel.org/r/20210129061406.2680146-3-bleung@chromium.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit f5030e2526https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-linus)
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
Change-Id: Iaf6481acb781fad61d86b5eab1fdebcb8ed0a779