Commit graph

5068 commits

Author SHA1 Message Date
Veerabhadrarao Badiganti
28f9652f80 mmc: core: Ignore bus resume flags when card removal event is detected
Ignore bus resume flags in the resume path if there is an outstanding card
removal event.

With deferred resume feature enabled, we don't check for card presence
(i.e., mmc_detect_change) in the resume path. This is to improve the resume
latency. If at all card is removed during suspend state, in some cases we
may not detect the card removal immediately but only when a request was
issued to it.

In some scenarios, card removal in suspend state leading to card suspend to
fail (since the card is removed) and which is causing system suspend to
fail. And we don't try to resume card because of deferred resume it
leading to system suspend to fail continuously.

To fix this scenario, ignore the bus resume flag in the resume path only if
there an outstanding card removal event. By doing so, we are ensuring that
the driver would check for card presence (mmc_detect_change) in the resume
path (mmc_pm_notify) and it will mark the card as removed if it finds the
card is no more present.

Change-Id: I7d075c2a5c2aaba1ff92f4072fdd2541bb98aa95
Signed-off-by: Veerabhadrarao Badiganti <vbadigan@codeaurora.org>
2017-08-29 23:27:37 -07:00
Vijay Viswanath
551803c610 mmc: core: enable async suspend of card
Enable the async suspend of the mmc card device. Suspending of card
requires sending various commands and disabling some features especially
in case of eMMC cards. This can take time. So enabling suspending of
card asynchronously will allow other devices to suspend concurrently and
make the system suspend faster.

Change-Id: Id9987d2915cc02e48f74301febaf85a4d458478f
Signed-off-by: Vijay Viswanath <vviswana@codeaurora.org>
2017-08-21 22:16:18 -07:00
Vijay Viswanath
c9e2e4429d mmc: sdhci-msm: Put platform suspend in late suspend list
Since there is no longer a parent child relation between the platform
sdhc device and the sdhc card, there is a possibility that the mmc card
suspend can be executed after sdhc platform suspend is done. This can
happen if async suspend of mmc card is enabled. Suspending of mmc card
requires platform device to be on and platform device suspend should
occur after mmc card suspend. To ensure this ordering in system suspend
case, let the card suspend in the regular suspend phase and make the
platform device suspend in the late suspend phase of system suspend.

Change-Id: I092056bf4099c09fcb4bd12695367f9d02ae9776
Signed-off-by: Vijay Viswanath <vviswana@codeaurora.org>
2017-08-21 22:16:00 -07:00
Gustavo Solaira
eb4ef163c5 mmc: sdhci: Force probe of shdc1 based on boolean property
Force probing the sdhc1 bus even if it is not the boot device
by reading the device tree property qcom,force-sdhc1-probe.
Enables using the primary port for other use cases even when
the board is not using eMMC for boot.

Change-Id: I2a2b9d6a51037641720bdfd3107b2fadf385d7b5
Signed-off-by: Gustavo Solaira <gustavos@codeaurora.org>
2017-08-18 12:52:47 -07:00
Linux Build Service Account
8b13ff9487 Merge "mmc: card: Fix NULL pointer dereference in mmc_blk_ioctl_rpmb_cmd()" 2017-08-04 09:12:20 -07:00
Siba Prasad
dde9e2de48 mmc: card: Fix NULL pointer dereference in mmc_blk_ioctl_rpmb_cmd()
In mmc_blk_ioctl_rpmb_cmd(), if user data copy fails, the card
variable is dereferenced without NULL pointer check.
Adding NULL pointer check in this condition.

Change-Id: If3fd2175946cccaf838768d45de72bc2f5c32f6b
Signed-off-by: Siba Prasad <sibap@codeaurora.org>
2017-08-02 22:44:12 +05:30
San Mehat
4bc0ffd0fd mmc: card: blk: Add support for deferred SD bus resume
Set bus resume polocy for eMMC & SD drivers.

Change-Id: If2e76877fb229a4aba38249c4a1bb2ff8d28ba32
Signed-off-by: San Mehat <san@google.com>
Git-commit: 2c84417a1305da892c8a7d0bf8d0bad50d1688b8
Git-repo: git://git-android.quicinc.com/kernel/msm-3.10
[vbadigan@codeaurora.org: Dropped changes which are already
present in mmc driver as part of other propagations]
Signed-off-by: Veerabhadrarao Badiganti <vbadigan@codeaurora.org>
2017-08-01 04:54:03 -07:00
Linux Build Service Account
b7cd152c17 Merge "mmc: sdhci: Enable CDR for cmdq mode" 2017-07-21 20:15:24 -07:00
Linux Build Service Account
0179cf4d43 Merge "mmc: sdhci-msm: Set dll to good phase while sending cmd13 in tuning" 2017-07-17 05:28:27 -07:00
Sayali Lokhande
cc705faa5b mmc: sdhci: Enable CDR for cmdq mode
From sdm660 onwards, the sdcc core will support
CDR in CMDQ mode, so it needs to be enabled.
This change is to enable CDR for cmdq mode.

Change-Id: I64681a3c94b6bd4191337c5c014171ff32a7d3c1
Signed-off-by: Sayali Lokhande <sayalil@codeaurora.org>
2017-07-17 13:36:58 +05:30
Sayali Lokhande
b52748d7fc mmc: core: Select HS mode in device first and then in the host
While switching from hs400 to hs200 mode, high speed mode
timing should be selected in the device before changing the
clock frequency in the host. But current implementation,
(mmc_hs400_to_hs200) first updates the frequency in the host
and then updates mode in the device. This is a spec violation.
Hence update the sequence to comply with the spec.

Change-Id: I0694edac9dd005ec68add9cc38bbe6fa4245ed48
Signed-off-by: Sayali Lokhande <sayalil@codeaurora.org>
2017-07-10 02:28:00 -07:00
Linux Build Service Account
81b79b39c7 Merge "mmc: core: Use PF_MEMALLOC flag for clock scaling context" 2017-07-06 23:41:17 -07:00
Linux Build Service Account
d3a27d6fc2 Merge "mmc: card: Ratelimit the error log in mmc_blk_cmd_recovery()" 2017-07-05 10:28:40 -07:00
Linux Build Service Account
22a427999d Merge "mmc: host: Capture error states in Trace logs." 2017-07-05 02:57:07 -07:00
Siba Prasad
7b7d464e9a mmc: host: Capture error states in Trace logs.
Upon encountering any error, few important registers are being captured
in trace logs in sdhci_dumpregs(). But without capturing exact error,
it would be tough to determine from which point in driver this dumpregs
has called. So capture the error state as well in Trace logs before
calling sdhci_dumpregs(). Also capture power irq related registers in
Trace logs upon any power irq related errors.

Change-Id: Ide172cdfb88a988cd4220bed03d05b8c6c4f15cb
Signed-off-by: Siba Prasad <sibap@codeaurora.org>
2017-07-04 17:38:07 +05:30
Veerabhadrarao Badiganti
1fbefb5219 mmc: core: Use PF_MEMALLOC flag for clock scaling context
Memory allocations with GFP_KERNEL flag in clock scaling path might
trigger IO transfer. This can cause deadlock since the claim_host
lock which is needed by mmc driver to perform IO is held by clock
scaling context.

Below is the exact call sequence:

mmc_devfreq_set_target() -> mmc_clk_update_freq () ->
mmc_change_bus_speed() -> mmc_select_hs400() -> mmc_select_bus_width()
-> mmc_get_ext_csd() -> kzalloc(512, GFP_KERNEL) -> try_to_free_pages()
-> evict() -> ext4_evict_inode().

To avoid this scenario, use PF_MEMALLOC flag for clock scaling context
so that it can have access to the more reserves of memory. And since
devfreq workitem would run in different kworker threads, restore to
original flags once done with setting clock frequency.

Change-Id: If52f83f6ecae982d8ed709b08fd84545c7ecbc43
Signed-off-by: Veerabhadrarao Badiganti <vbadigan@codeaurora.org>
2017-07-04 13:03:45 +05:30
Siba Prasad
4e6e5956d5 mmc: card: Ratelimit the error log in mmc_blk_cmd_recovery()
Ratelimit the error log in order to avoid flooding the logs in
case of function mmc_blk_cmd_recovery() gets called repeatedly.

Change-Id: Ic72087382fca2e188f1bbd8195a805cd751ed22e
Signed-off-by: Siba Prasad <sibap@codeaurora.org>
2017-07-04 12:35:11 +05:30
Vijay Viswanath
c77576994e mmc: core: Remove unused variable
Removed a local variable in mmc_start_req() which was used to store the
error encountered while starting a new data request. If an error is
encountered while starting a new request, the error
information is stored in the mrq. The error information stored in the
mrq is during error handling. So removing the unused variable.

Change-Id: Ifeedc91433230d5156d286bd332a85fb221188ac
Signed-off-by: Vijay Viswanath <vviswana@codeaurora.org>
2017-07-03 02:10:42 -07:00
Linux Build Service Account
146cbfce78 Merge "mmc: sdhci-msm: Don't turnoff Vcc during initialization" 2017-06-22 14:00:18 -07:00
Linux Build Service Account
4dcf7a50c5 Merge "Merge branch 'android-4.4@6fc0573' into branch 'msm-4.4'" 2017-06-22 07:40:22 -07:00
Veerabhadrarao Badiganti
7ffd15f63d mmc: sdhci-msm: Don't turnoff Vcc during initialization
As per emmc specification, device should be notified either with
power-off or sleep notification before turning off the Vcc.
Failing to do so might affect the device longevity.

In mmc driver initialization phase even before device probing
gets completed, Vcc is getting turned off without these notifications.
Since it can't send commands at this stage, So just ensure that Vcc
is not turned off till initialization gets completed.

Change-Id: I0bbf0077357d66c888147be40a0c5d312b9ce063
Signed-off-by: Veerabhadrarao Badiganti <vbadigan@codeaurora.org>
2017-06-22 10:55:19 +05:30
Blagovest Kolenichev
c5f247dd6d Merge branch 'android-4.4@6fc0573' into branch 'msm-4.4'
* refs/heads/tmp-6fc0573:
  Linux 4.4.71
  xfs: only return -errno or success from attr ->put_listent
  xfs: in _attrlist_by_handle, copy the cursor back to userspace
  xfs: fix unaligned access in xfs_btree_visit_blocks
  xfs: bad assertion for delalloc an extent that start at i_size
  xfs: fix indlen accounting error on partial delalloc conversion
  xfs: wait on new inodes during quotaoff dquot release
  xfs: update ag iterator to support wait on new inodes
  xfs: support ability to wait on new inodes
  xfs: fix up quotacheck buffer list error handling
  xfs: prevent multi-fsb dir readahead from reading random blocks
  xfs: handle array index overrun in xfs_dir2_leaf_readbuf()
  xfs: fix over-copying of getbmap parameters from userspace
  xfs: fix off-by-one on max nr_pages in xfs_find_get_desired_pgoff()
  xfs: Fix missed holes in SEEK_HOLE implementation
  mlock: fix mlock count can not decrease in race condition
  mm/migrate: fix refcount handling when !hugepage_migration_supported()
  drm/gma500/psb: Actually use VBT mode when it is found
  slub/memcg: cure the brainless abuse of sysfs attributes
  ALSA: hda - apply STAC_9200_DELL_M22 quirk for Dell Latitude D430
  pcmcia: remove left-over %Z format
  drm/radeon: Unbreak HPD handling for r600+
  drm/radeon/ci: disable mclk switching for high refresh rates (v2)
  scsi: mpt3sas: Force request partial completion alignment
  HID: wacom: Have wacom_tpc_irq guard against possible NULL dereference
  mmc: sdhci-iproc: suppress spurious interrupt with Multiblock read
  i2c: i2c-tiny-usb: fix buffer not being DMA capable
  vlan: Fix tcp checksum offloads in Q-in-Q vlans
  net: phy: marvell: Limit errata to 88m1101
  netem: fix skb_orphan_partial()
  ipv4: add reference counting to metrics
  sctp: fix ICMP processing if skb is non-linear
  tcp: avoid fastopen API to be used on AF_UNSPEC
  virtio-net: enable TSO/checksum offloads for Q-in-Q vlans
  be2net: Fix offload features for Q-in-Q packets
  ipv6: fix out of bound writes in __ip6_append_data()
  bridge: start hello_timer when enabling KERNEL_STP in br_stp_start
  qmi_wwan: add another Lenovo EM74xx device ID
  bridge: netlink: check vlan_default_pvid range
  ipv6: Check ip6_find_1stfragopt() return value properly.
  ipv6: Prevent overrun when parsing v6 header options
  net: Improve handling of failures on link and route dumps
  tcp: eliminate negative reordering in tcp_clean_rtx_queue
  sctp: do not inherit ipv6_{mc|ac|fl}_list from parent
  sctp: fix src address selection if using secondary addresses for ipv6
  tcp: avoid fragmenting peculiar skbs in SACK
  s390/qeth: avoid null pointer dereference on OSN
  s390/qeth: unbreak OSM and OSN support
  s390/qeth: handle sysfs error during initialization
  ipv6/dccp: do not inherit ipv6_mc_list from parent
  dccp/tcp: do not inherit mc_list from parent
  sparc: Fix -Wstringop-overflow warning
  android: base-cfg: disable CONFIG_NFS_FS and CONFIG_NFSD
  schedstats/eas: guard properly to avoid breaking non-smp schedstats users
  BACKPORT: f2fs: sanity check size of nat and sit cache
  FROMLIST: f2fs: sanity check checkpoint segno and blkoff
  sched/tune: don't use schedtune before it is ready
  sched/fair: use SCHED_CAPACITY_SCALE for energy normalization
  sched/{fair,tune}: use reciprocal_value to compute boost margin
  sched/tune: Initialize raw_spin_lock in boosted_groups
  sched/tune: report when SchedTune has not been initialized
  sched/tune: fix sched_energy_diff tracepoint
  sched/tune: increase group count to 5
  cpufreq/schedutil: use boosted_cpu_util for PELT to match WALT
  sched/fair: Fix sched_group_energy() to support per-cpu capacity states
  sched/fair: discount task contribution to find CPU with lowest utilization
  sched/fair: ensure utilization signals are synchronized before use
  sched/fair: remove task util from own cpu when placing waking task
  trace:sched: Make util_avg in load_avg trace reflect PELT/WALT as used
  sched/fair: Add eas (& cas) specific rq, sd and task stats
  sched/core: Fix PELT jump to max OPP upon util increase
  sched: EAS & 'single cpu per cluster'/cpu hotplug interoperability
  UPSTREAM: sched/core: Fix group_entity's share update
  UPSTREAM: sched/fair: Fix calc_cfs_shares() fixed point arithmetics width confusion
  UPSTREAM: sched/fair: Fix incorrect task group ->load_avg
  UPSTREAM: sched/fair: Fix effective_load() to consistently use smoothed load
  UPSTREAM: sched/fair: Propagate asynchrous detach
  UPSTREAM: sched/fair: Propagate load during synchronous attach/detach
  UPSTREAM: sched/fair: Fix hierarchical order in rq->leaf_cfs_rq_list
  BACKPORT: sched/fair: Factorize PELT update
  UPSTREAM: sched/fair: Factorize attach/detach entity
  UPSTREAM: sched/fair: Improve PELT stuff some more
  UPSTREAM: sched/fair: Apply more PELT fixes
  UPSTREAM: sched/fair: Fix post_init_entity_util_avg() serialization
  BACKPORT: sched/fair: Initiate a new task's util avg to a bounded value
  sched/fair: Simplify idle_idx handling in select_idle_sibling()
  sched/fair: refactor find_best_target() for simplicity
  sched/fair: Change cpu iteration order in find_best_target()
  sched/core: Add first cpu w/ max/min orig capacity to root domain
  sched/core: Remove remnants of commit fd5c98da1a42
  sched: Remove sysctl_sched_is_big_little
  sched/fair: Code !is_big_little path into select_energy_cpu_brute()
  EAS: sched/fair: Re-integrate 'honor sync wakeups' into wakeup path
  Fixup!: sched/fair.c: Set SchedTune specific struct energy_env.task
  sched/fair: Energy-aware wake-up task placement
  sched/fair: Add energy_diff dead-zone margin
  sched/fair: Decommission energy_aware_wake_cpu()
  sched/fair: Do not force want_affine eq. true if EAS is enabled
  arm64: Set SD_ASYM_CPUCAPACITY sched_domain flag on DIE level
  UPSTREAM: sched/fair: Fix incorrect comment for capacity_margin
  UPSTREAM: sched/fair: Avoid pulling tasks from non-overloaded higher capacity groups
  UPSTREAM: sched/fair: Add per-CPU min capacity to sched_group_capacity
  UPSTREAM: sched/fair: Consider spare capacity in find_idlest_group()
  UPSTREAM: sched/fair: Compute task/cpu utilization at wake-up correctly
  UPSTREAM: sched/fair: Let asymmetric CPU configurations balance at wake-up
  UPSTREAM: sched/core: Enable SD_BALANCE_WAKE for asymmetric capacity systems
  UPSTREAM: sched/core: Pass child domain into sd_init()
  UPSTREAM: sched/core: Introduce SD_ASYM_CPUCAPACITY sched_domain topology flag
  UPSTREAM: sched/core: Remove unnecessary NULL-pointer check
  UPSTREAM: sched/fair: Optimize find_idlest_cpu() when there is no choice
  BACKPORT: sched/fair: Make the use of prev_cpu consistent in the wakeup path
  UPSTREAM: sched/core: Fix power to capacity renaming in comment
  Partial Revert: "WIP: sched: Add cpu capacity awareness to wakeup balancing"
  Revert "WIP: sched: Consider spare cpu capacity at task wake-up"
  FROM-LIST: cpufreq: schedutil: Redefine the rate_limit_us tunable
  cpufreq: schedutil: add up/down frequency transition rate limits
  trace/sched: add rq utilization signal for WALT
  sched/cpufreq: make schedutil use WALT signal
  sched: cpufreq: use rt_avg as estimate of required RT CPU capacity
  cpufreq: schedutil: move slow path from workqueue to SCHED_FIFO task
  BACKPORT: kthread: allow to cancel kthread work
  sched/cpufreq: fix tunables for schedfreq governor
  BACKPORT: cpufreq: schedutil: New governor based on scheduler utilization data
  sched: backport cpufreq hooks from 4.9-rc4
  ANDROID: Kconfig: add depends for UID_SYS_STATS
  ANDROID: hid: uhid: implement refcount for open and close
  Revert "ext4: require encryption feature for EXT4_IOC_SET_ENCRYPTION_POLICY"
  ANDROID: mnt: Fix next_descendent

Conflicts:
	include/trace/events/sched.h
	kernel/sched/Makefile
	kernel/sched/core.c
	kernel/sched/fair.c
	kernel/sched/sched.h

Change-Id: I55318828f2c858e192ac7015bcf2bf0ec5c5b2c5
Signed-off-by: Blagovest Kolenichev <bkolenichev@codeaurora.org>
2017-06-19 16:59:55 -07:00
Veerabhadrarao Badiganti
b3c43dda50 mmc: sdhci-msm: Set dll to good phase while sending cmd13 in tuning
Set the dll to last known good phase before sending status command
while executing tuning. This is to ensure that status command won't
fail due to bad phase. Thus we can avoid sending status command
multiple times and reduce tuning latency.

Change-Id: Ib7fa5a8acbbffd9662617a357d221b36494a98b9
Signed-off-by: Veerabhadrarao Badiganti <vbadigan@codeaurora.org>
2017-06-16 23:05:13 +05:30
Veerabhadrarao Badiganti
7fc028dfca mmc: host: sdhci-msm: Don't clear IO_PAD_PWR_SWITCH when faking 3V support
Don't clear io pad power switch setting when 3V support is faked.
This bit has to be cleared for allowing IO pad to switch to 3V when
Vccq is really configured to 3V. But in case of faking 3V where we
configure Vccq to 1.8V only, we shouldn't clear this bit.

Change-Id: Ib1a9a2eb7189e161e22c8baf588453b3f2632eb7
Signed-off-by: Veerabhadrarao Badiganti <vbadigan@codeaurora.org>
2017-06-16 15:23:42 +05:30
Linux Build Service Account
5b1cf77741 Merge "mmc: sdhci-msm: Corrected the '&' operator with '&&' in the 'if' statement" 2017-06-15 16:10:51 -07:00
Bao D. Nguyen
e2ce497a9d mmc: sdhci-msm: Corrected the '&' operator with '&&' in the 'if' statement
Without this fix the MMC may incorrectly set the CAPS for the SD card.

Change-Id: Ia4be2e78453663818cfd18deb9a590ec80423bca
Signed-off-by: Bao D. Nguyen <nguyenb@codeaurora.org>
2017-06-14 14:30:08 -07:00
Linux Build Service Account
621d21a88e Merge "mmc: core: Ignore CRC errors with CMD13 while executing tuning" 2017-06-14 09:57:04 -07:00
Linux Build Service Account
f1126aa337 Merge "mmc: sd: return error information of sd_init_card incase of failure" 2017-06-14 09:57:00 -07:00
Veerabhadrarao Badiganti
3934c37772 mmc: core: Ignore CRC errors with CMD13 while executing tuning
While executing tuning in case CMD19 fails, the driver sends CMD13
multiple times to ensure the card is ready to receive the next tuning
command. If this status command fails with CRC error, it will trigger
tuning. This will result in back to back tuning multiple times.

To avoid this situation, ignore CRCs error generated with CMD13 while
executing tuning.

Change-Id: Ife338768264ebebebc655fe11874e905abdf7482
Signed-off-by: Veerabhadrarao Badiganti <vbadigan@codeaurora.org>
2017-06-09 22:02:34 +05:30
Linux Build Service Account
3dad7f3687 Merge "mmc: core: Fix the issue with clock scaling in resume-scaling" 2017-06-08 05:13:51 -07:00
Linux Build Service Account
9736b785cf Merge "mmc: core: Initialize the devfreq table with default frequencies" 2017-06-08 05:13:50 -07:00
Linux Build Service Account
e3954e1572 Merge "drivers: Warning fixes to disable CC_OPTIMIZE_FOR_SIZE" 2017-06-07 13:13:31 -07:00
Greg Kroah-Hartman
6fc0573f6d This is the 4.4.71 stable release
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEEZH8oZUiU471FcZm+ONu9yGCSaT4FAlk30BwACgkQONu9yGCS
 aT5cmhAAh3etTuZ3xRw2eGW/Y/C8L2F2CjJjmR4vp1ms8P55uZg3xA20r5jNj7Ho
 pwag3WTNzHpVfKFApavfEzToqDszRAtXcvYPPW9uXUPeu8LWyBJyvmN7lSQVKgDc
 M9SWsd+8EGceopaj8KHjLMxNsV2n8j2ckxNf/BL/KgiMtJlgp/1TCDKUVS1k0cA7
 CsuxDhxpRYpQofsIVww1hdrwCxVuntAY7u+/3B19ozXGFSRe/h5GO6xYRcG8pqfT
 lvIgD6btdQJwI55QoSpJCpL96a534zc+akO0dtyaMJ3Q8UWQXD3JF8ZxMiPPrAe8
 CLW390ATranIafmLi9g9DU1vQeEPNFXpeiYfxe65YL7igeAj/uPtVzKp0MvRcKG7
 IBVNxbtsTQa73ig7gKSJ323CnpEfrr/XG73JNVtUQLxHa2poY7SUonRI587MFW2T
 sONl9Pk3TxRC7Rc45si4RFsIj4jEF8ubUDXOPb2CrmDMB7MrM0PHfOW9lLCP92FD
 pn0fM4vwNvm2ILsblqNcBumgeIBQ8ld2TBTbhRbh2FK4Rzxd2TSlWh4KqkcWcXCt
 Lz8conU06AwTvDob1xoht3m6Gj32maopKZKGn5/Wq0YlfjOB/70CXOvPO3ChhKTh
 QGNgA66bYdm+xn55wf7ty7Bq8yO6kcSNPQCXOb9S61nfCLA4KHM=
 =U7IH
 -----END PGP SIGNATURE-----

Merge 4.4.71 into android-4.4

Changes in 4.4.71
	sparc: Fix -Wstringop-overflow warning
	dccp/tcp: do not inherit mc_list from parent
	ipv6/dccp: do not inherit ipv6_mc_list from parent
	s390/qeth: handle sysfs error during initialization
	s390/qeth: unbreak OSM and OSN support
	s390/qeth: avoid null pointer dereference on OSN
	tcp: avoid fragmenting peculiar skbs in SACK
	sctp: fix src address selection if using secondary addresses for ipv6
	sctp: do not inherit ipv6_{mc|ac|fl}_list from parent
	tcp: eliminate negative reordering in tcp_clean_rtx_queue
	net: Improve handling of failures on link and route dumps
	ipv6: Prevent overrun when parsing v6 header options
	ipv6: Check ip6_find_1stfragopt() return value properly.
	bridge: netlink: check vlan_default_pvid range
	qmi_wwan: add another Lenovo EM74xx device ID
	bridge: start hello_timer when enabling KERNEL_STP in br_stp_start
	ipv6: fix out of bound writes in __ip6_append_data()
	be2net: Fix offload features for Q-in-Q packets
	virtio-net: enable TSO/checksum offloads for Q-in-Q vlans
	tcp: avoid fastopen API to be used on AF_UNSPEC
	sctp: fix ICMP processing if skb is non-linear
	ipv4: add reference counting to metrics
	netem: fix skb_orphan_partial()
	net: phy: marvell: Limit errata to 88m1101
	vlan: Fix tcp checksum offloads in Q-in-Q vlans
	i2c: i2c-tiny-usb: fix buffer not being DMA capable
	mmc: sdhci-iproc: suppress spurious interrupt with Multiblock read
	HID: wacom: Have wacom_tpc_irq guard against possible NULL dereference
	scsi: mpt3sas: Force request partial completion alignment
	drm/radeon/ci: disable mclk switching for high refresh rates (v2)
	drm/radeon: Unbreak HPD handling for r600+
	pcmcia: remove left-over %Z format
	ALSA: hda - apply STAC_9200_DELL_M22 quirk for Dell Latitude D430
	slub/memcg: cure the brainless abuse of sysfs attributes
	drm/gma500/psb: Actually use VBT mode when it is found
	mm/migrate: fix refcount handling when !hugepage_migration_supported()
	mlock: fix mlock count can not decrease in race condition
	xfs: Fix missed holes in SEEK_HOLE implementation
	xfs: fix off-by-one on max nr_pages in xfs_find_get_desired_pgoff()
	xfs: fix over-copying of getbmap parameters from userspace
	xfs: handle array index overrun in xfs_dir2_leaf_readbuf()
	xfs: prevent multi-fsb dir readahead from reading random blocks
	xfs: fix up quotacheck buffer list error handling
	xfs: support ability to wait on new inodes
	xfs: update ag iterator to support wait on new inodes
	xfs: wait on new inodes during quotaoff dquot release
	xfs: fix indlen accounting error on partial delalloc conversion
	xfs: bad assertion for delalloc an extent that start at i_size
	xfs: fix unaligned access in xfs_btree_visit_blocks
	xfs: in _attrlist_by_handle, copy the cursor back to userspace
	xfs: only return -errno or success from attr ->put_listent
	Linux 4.4.71

Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
2017-06-07 12:36:01 +02:00
Srinath Mannam
c0fd730b67 mmc: sdhci-iproc: suppress spurious interrupt with Multiblock read
commit f5f968f2371ccdebb8a365487649673c9af68d09 upstream.

The stingray SDHCI hardware supports ACMD12 and automatically
issues after multi block transfer completed.

If ACMD12 in SDHCI is disabled, spurious tx done interrupts are seen
on multi block read command with below error message:

Got data interrupt 0x00000002 even though no data
operation was in progress.

This patch uses SDHCI_QUIRK_MULTIBLOCK_READ_ACMD12 to enable
ACM12 support in SDHCI hardware and suppress spurious interrupt.

Signed-off-by: Srinath Mannam <srinath.mannam@broadcom.com>
Reviewed-by: Ray Jui <ray.jui@broadcom.com>
Reviewed-by: Scott Branden <scott.branden@broadcom.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Fixes: b580c52d58 ("mmc: sdhci-iproc: add IPROC SDHCI driver")
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-06-07 12:06:00 +02:00
Can Guo
20e817d30c mmc: debugfs: fix unclocked register access by force_error
When echo values to debugfs entry force_error, unclocked
register access error would be detected. This change fixes
it by making sure the host is powered up and host clock is
ticking before access force event register for error
interrupt status.

Change-Id: I995523d64de36cd4872209db4a558aa83103fbb3
Signed-off-by: Can Guo <cang@codeaurora.org>
2017-06-06 09:39:30 +08:00
Veerabhadrarao Badiganti
9c123aff46 mmc: core: Fix the issue with clock scaling in resume-scaling
In resume_scaling, the host current clock is compared with max clock
of the card to adjust the current-scaling clock.

If max clock supported by the card is more than the max clock that the
host can support, then the above-mentioned comparison is resulting in
setting the current-scaling clock to scale-down clock frequency even
though current host clock is at the maximum clock. This will lead to
skipping of scaling down to lower clock in low load use-cases. So clock
would remain at max clock till next time clock is scaled up and then
scaled down.

To prevent this scenario, compare the host current clock with max clock
that host can be scaled-up instead of max clock of the card.

Change-Id: Ibbed4bb374f1cbb5aee21cfca4e7e97d8f999d51
Signed-off-by: Veerabhadrarao Badiganti <vbadigan@codeaurora.org>
2017-06-05 20:08:37 +05:30
Veerabhadrarao Badiganti
1cc23bd6d0 mmc: core: Initialize the devfreq table with default frequencies
Initialize the clock scaling frequency table with the platform specific
frequencies while preparing it. So that the frequencies supported by
the card can be compared against the frequencies supported by the
platform and then the table can be updated with the optimal frequencies
to match with both card and platform.

Without resetting these values to default values, this table contains
the frequencies updated for the last used card. These old values would
be used instead of platform-specific values to compare against the
frequencies of the newly inserted card. This can result in limiting
the max frequency to a lower frequency than what actually card can support.
Say if an high-speed card is used first and then a ultra-high-speed card,
the max scaling frequency would get set to the max of high-speed card
instead of max of the ultra-high-speed card.

Change-Id: I09a36e36c189e1d1fc317d798a0e3ff899f4e560
Signed-off-by: Veerabhadrarao Badiganti <vbadigan@codeaurora.org>
2017-06-02 23:20:33 +05:30
Veerabhadrarao Badiganti
70bc2b791f mmc: sdhci-msm: Store clock scaling frequencies in a dedicated table
Use a separate table to store the platform specific clock-scaling
frequencies.

The generic table where these frequencies used to be stored, would
get updated (in some cases) during clock scaling initialization.
But when a new card is inserted (In the case of a removable card),
the frequencies supported by the card should be compared against the
platform specific frequencies.

By storing these values in a separate table, these values would
remain intact and this table can be used for initializing the
generic table during clock-scaling initialization.

Change-Id: I5729f18a975f849bc2965a946473a9cdbd81e94a
Signed-off-by: Veerabhadrarao Badiganti <vbadigan@codeaurora.org>
2017-06-02 23:14:56 +05:30
Prasad Sodagudi
0958ceaaf4 drivers: Warning fixes to disable CC_OPTIMIZE_FOR_SIZE
These are all driver changes needed for disablement of
CONFIG_CC_OPTIMIZE_FOR_SIZE. CONFIG_CC_OPTIMIZE_FOR_PERFORMANCE
is enabled by default once CONFIG_CC_OPTIMIZE_FOR_SIZE is disabled.

Change-Id: Ia46a1f24e8a082a29ea6151e41e6d3a85a05fd4f
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
Signed-off-by: Sridhar Parasuram <sridhar@codeaurora.org>
2017-05-31 16:51:47 -07:00
Linux Build Service Account
18c1ad4d51 Merge "mmc: core: retune after un-gating the clocks" 2017-05-26 00:10:42 -07:00
Linux Build Service Account
12896a6fc6 Merge "mmc: core: extend SDR104 workaround for other paths" 2017-05-26 00:10:37 -07:00
Sahitya Tummala
b8189b1707 mmc: core: extend SDR104 workaround for other paths
UHS-I SD cards support SDR104 mode which runs the SD card interface
clock upto 208 MHz. But we may see repeated CRC errors in SDR104
with some SDCC controllers. If this happens, commit <aafc430b36f3>
("mmc: sd: reduce the bus speed in case of multiple CRC errors") would
reinit the card to lower speed (SDR50) hoping that CRC error
rate would reduce at lower clock speed (100MHz for SDR50). As the error
may happen for any cmd, this change tries to fix several other paths -
clock scaling, mmc_rescan, non-data commands error path.

Change-Id: I8ccbbf7e330cde3862d9660d3be4d67fb00d97ca
Signed-off-by: Sahitya Tummala <stummala@codeaurora.org>
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
Signed-off-by: Veerabhadrarao Badiganti <vbadigan@codeaurora.org>
2017-05-24 15:51:09 +05:30
Veerabhadrarao Badiganti
37b8f42715 mmc: core: retune after un-gating the clocks
We have seen that host controller's clock tuning circuit may go out of sync
if controller clocks are gated. To workaround this issue, we are now
triggering the retuning of tuning circuit once clocks are ungated.

Change-Id: Id2db1cb4829fbb1af4f8c4e463d1e16c0f45e590
Signed-off-by: Veerabhadrarao Badiganti <vbadigan@codeaurora.org>
Signed-off-by: Subhash Jadavani <subhashj@codeaurora.org>
2017-05-22 18:08:13 -07:00
Vijay Viswanath
7b46835e9f mmc: block: Disable clock scaling during shutdown
During shutdown of sdhc drivers, power off notification (PON) is sent
to eMMC device. But it doesn't prevent the clock scaling framework
from kicking in and sending commands to card after PON is sent. So
exit clock scaling framework of sdhc before PON is sent.

Change-Id: Ibfe097732042458965db529f235a7fd28cfabaab
Signed-off-by: Vijay Viswanath <vviswana@codeaurora.org>
2017-05-19 16:31:49 +05:30
Vijay Viswanath
688129aafb mmc: core: Avoid returning error when clok scaling devfreq is removed
When resume clock scaling is not possible because there is no devfreq
framework, it is not an error. So avoid printing an error and return
success. This is necessary in certain scenarios like during shutdown
where we unregister the clock scaling devfreq.

Change-Id: Ib37eabdcdbbb58a336ee87220e5758bb559625af
Signed-off-by: Vijay Viswanath <vviswana@codeaurora.org>
2017-05-19 16:31:28 +05:30
Ritesh Harjani
45eadbbce3 mmc: mmc: Fix mmc_partial_init for HS400 mode
In case of emmc5.0 cards where HS400 mode and CMD5(awake) partial
init is enabled -> mmc_partial_init is broken and gives below errors.
Fix this by adding calibration logic in case of HS400 mode.

NOTE: In HS400 mode tuning is only performed once during bootup (in
HS200 mode).
Post to that it is always DLL calibration which is performed (in
system/runtime resume).
So even for below issue since timing is already changed using
cached_ios, then do the calibration using ->execute_tuning.

<dmesg errors w/o patch>
root@msm8996:/ # [   76.011036] mmc0: mmc_runtime_suspend:
[   77.315903] mmc0: mmc_runtime_resume:
[   77.367866] mmc0: mmc_partial_init: starting partial init
[   77.376225] mmc0: mmc_test_awake_ext_csd: mmc_get_ext_csd failed
(-110)
[   77.382190] mmc0: mmc_partial_init: done partial init (-110)
[   77.387536] mmc0: _mmc_resume: awake failed (-110), fallback to full
init
[   77.394405] mmc0: mmc_init_card:
[   77.402762] mmc0: mmc_init_card: mmc_send_op_cond() fails -110
[   77.407573] mmc0: MMC card re-init failed rc = -110 (retries = 3)
[   77.507261] mmc0: _mmc_resume: awake failed (-110), fallback to full
init
[   77.513293] mmc0: mmc_init_card:

<dmesg with patch>
[   74.002624] mmc0: mmc_runtime_resume:
[   74.056089] mmc0: mmc_partial_init: starting partial init
[   74.067143] mmc0: mmc_partial_init: done partial init (0)

Change-Id: I0e55efb7863b75bd584843c3fc920c845996eb5c
Signed-off-by: Ritesh Harjani <riteshh@codeaurora.org>
2017-05-12 02:08:27 -07:00
Linux Build Service Account
b044376188 Merge "mmc: core: Replacing sprintf() with snprintf()" 2017-05-11 11:48:38 -07:00
Linux Build Service Account
c4a48b7ed2 Merge "mmc: host: sdhci-msm-ice: Initialize local variable in ice_cmdq_cfg()" 2017-05-11 06:48:13 -07:00
Linux Build Service Account
67f2c6d9c8 Merge "mmc: sdhci-msm: make probe as async probe" 2017-05-11 06:47:50 -07:00
Siba Prasad
e14f225493 mmc: core: Replacing sprintf() with snprintf()
While using the sysfs entry for getting the different bit values
of EXT_CSD register, it is returned by sprintf(). But sprintf() has
been deprecated, that's why replace with safe function snprintf().
By using this patch, PAGE_SIZE(4Kb) is the max number of characters
store in a buffer.

Change-Id: Ifb3dc39e8d3728094fff10c7e761dc19fdfaa854
Signed-off-by: Siba Prasad <sibap@codeaurora.org>
2017-05-10 20:17:19 +05:30