Keith Busch
7b11eab041
blk-mq: blk-mq: provide forced completion method
...
Drivers may need to bypass error injection for error recovery. Rename
__blk_mq_complete_request() to blk_mq_force_complete_rq() and export
that function so drivers may skip potential fake timeouts after they've
reclaimed lost requests.
Signed-off-by: Keith Busch <kbusch@kernel.org >
Reviewed-by: Daniel Wagner <dwagner@suse.de >
Signed-off-by: Jens Axboe <axboe@kernel.dk >
2020-05-29 10:21:59 -06:00
Charles Keepax
4832565529
regulator: core: Add regulator bypass trace points
...
Add new trace points for the start and end of enabling bypass on a
regulator, to allow monitoring of when regulators are moved into bypass
and how long that takes.
Signed-off-by: Charles Keepax <ckeepax@opensource.cirrus.com >
Link: https://lore.kernel.org/r/20200529152216.9671-1-ckeepax@opensource.cirrus.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2020-05-29 17:17:02 +01:00
Qiushi Wu
c343bf1ba5
cpuidle: Fix three reference count leaks
...
kobject_init_and_add() takes reference even when it fails.
If this function returns an error, kobject_put() must be called to
properly clean up the memory associated with the object.
Previous commit "b8eb718348b8" fixed a similar problem.
Signed-off-by: Qiushi Wu <wu000273@umn.edu >
[ rjw: Subject ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com >
2020-05-29 18:07:18 +02:00
Jon Derrick
3e5095eebe
PCI: vmd: Filter resource type bits from shadow register
...
Versions of VMD with the Host Physical Address shadow register use this
register to calculate the bus address offset needed to do guest
passthrough of the domain. This register shadows the Host Physical
Address registers including the resource type bits. After calculating
the offset, the extra resource type bits lead to the VMD resources being
over-provisioned at the front and under-provisioned at the back.
Example:
pci 10000:80:02.0: reg 0x10: [mem 0xf801fffc-0xf803fffb 64bit]
Expected:
pci 10000:80:02.0: reg 0x10: [mem 0xf8020000-0xf803ffff 64bit]
If other devices are mapped in the over-provisioned front, it could lead
to resource conflict issues with VMD or those devices.
Link: https://lore.kernel.org/r/20200528030240.16024-3-jonathan.derrick@intel.com
Fixes: a1a3017013 ("PCI: vmd: Fix shadow offsets to reflect spec changes")
Signed-off-by: Jon Derrick <jonathan.derrick@intel.com >
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com >
2020-05-29 17:05:06 +01:00
Rafael J. Wysocki
9a7875461f
PM: runtime: Replace pm_runtime_callbacks_present()
...
The name of pm_runtime_callbacks_present() is confusing, because
it suggests that the device has PM-runtime callbacks if 'true' is
returned by that function, but in fact that may not be the case,
so replace it with pm_runtime_has_no_callbacks() which is not
ambiguous.
No functional impact.
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com >
Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org >
2020-05-29 18:03:12 +02:00
Pierre-Louis Bossart
af89e7dac5
ASoC: SOF: Intel: Baytrail: fix 'defined but not used' warnings
...
With the allmodconfig option, CONFIG_SND_SOC_SOF_BAYTRAIL is disabled
due to mutual exclusion with the legacy driver. This generates
'defined by not used' warnings.
suspend/resume/remove are only supported for Baytrail for now, so move
the code under the CONFIG_SND_SOC_SOF_BAYTRAIL checks.
Fixes: ddcccd543f ("ASoC: SOF: Intel: byt: Add PM callbacks")
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au >
Signed-off-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com >
Link: https://lore.kernel.org/r/20200529150408.17236-1-pierre-louis.bossart@linux.intel.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2020-05-29 16:55:31 +01:00
朱灿灿
68f8043ed1
Subject: [PATCH v2] ASoC: soc-pcm: fix BE dai not hw_free and shutdown during mixer update
...
FE state is SND_SOC_DPCM_STATE_PREPARE now, BE1 is
used by FE.
Later when new BE2 is added to FE by mixer update,
it will call dpcm_run_update_startup() to update
BE2's state, but unfortunately BE2 .prepare() meets
error, it will disconnect all non started BE.
This make BE1 dai skip .hw_free() and .shutdown(),
and the BE1 users will never decrease to zero.
Signed-off-by: zhucancan <zhucancan@vivo.com >
Link: https://lore.kernel.org/r/ALMAWwB5CP9aAcKXCU5FzqqF.1.1590747164172.Hmail.zhucancan@vivo.com
Signed-off-by: Mark Brown <broonie@kernel.org >
2020-05-29 16:55:30 +01:00
Boris Ostrovsky
4969a3a2cd
xen/pci: Get rid of verbose_request and use dev_dbg() instead
...
Information printed under verbose_request is clearly used for debugging
only. Remove it and use dev_dbg() instead.
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com >
Link: https://lore.kernel.org/r/1590719092-8578-1-git-send-email-boris.ostrovsky@oracle.com
Reviewed-by: Juergen Gross <jgross@suse.com >
Signed-off-by: Boris Ostrovsky <boris.ostrovsky@oracle.com >
2020-05-29 10:44:59 -05:00
Rui Salvaterra
b6b15e2042
rt2800: enable MFP support unconditionally
...
This gives us WPA3 support out of the box without having to manually disable
hardware crypto. The driver will fall back to software crypto if the connection
requires management frame protection.
Suggested-by: Stanislaw Gruszka <stf_xl@wp.pl >
Signed-off-by: Rui Salvaterra <rsalvaterra@gmail.com >
Acked-by: Stanislaw Gruszka <stf_xl@wp.pl >
Signed-off-by: Kalle Valo <kvalo@codeaurora.org >
Link: https://lore.kernel.org/r/20200525134906.1672-1-rsalvaterra@gmail.com
2020-05-29 18:42:28 +03:00
Sandeep Maheswaram
96ec7b3142
dt-bindings: usb: qcom,dwc3: Introduce interconnect properties for Qualcomm DWC3 driver
...
Add documentation for the interconnects and interconnect-names
properties for USB.
Reviewed-by: Stephen Boyd <swboyd@chromium.org >
Reviewed-by: Rob Herring <robh@kernel.org >
Signed-off-by: Sandeep Maheswaram <sanm@codeaurora.org >
Signed-off-by: Rob Herring <robh@kernel.org >
2020-05-29 09:39:02 -06:00
Chris Wilson
98b7067a17
drm/i915: Add a few asserts around handling of i915_request_is_active()
...
Let's assert that we only call the execute callbacks on making the
request active, and that we do not execute the request without calling
the callbacks.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk >
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20200529085809.23691-1-chris@chris-wilson.co.uk
2020-05-29 16:24:58 +01:00
Joerg Roedel
736c3333e3
iommu/amd: Remove redundant devid checks
...
Checking the return value of get_device_id() in a code-path which has
already done check_device() is not needed, as check_device() does the
same check and bails out if it fails.
Signed-off-by: Joerg Roedel <jroedel@suse.de >
Reviewed-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com >
Link: https://lore.kernel.org/r/20200527115313.7426-11-joro@8bytes.org
2020-05-29 17:18:08 +02:00
Joerg Roedel
05a0542b45
iommu/amd: Store dev_data as device iommu private data
...
Do not use dev->archdata.iommu anymore and switch to using the private
per-device pointer provided by the IOMMU core code.
Signed-off-by: Joerg Roedel <jroedel@suse.de >
Reviewed-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com >
Link: https://lore.kernel.org/r/20200527115313.7426-10-joro@8bytes.org
2020-05-29 17:18:02 +02:00
Joerg Roedel
786dfe496e
iommu/amd: Merge private header files
...
Merge amd_iommu_proto.h into amd_iommu.h.
Signed-off-by: Joerg Roedel <jroedel@suse.de >
Reviewed-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com >
Link: https://lore.kernel.org/r/20200527115313.7426-9-joro@8bytes.org
2020-05-29 17:17:44 +02:00
Joerg Roedel
e1980df36c
iommu/amd: Remove PD_DMA_OPS_MASK
...
This is covered by IOMMU_DOMAIN_DMA from the IOMMU core code already,
so remove it.
Signed-off-by: Joerg Roedel <jroedel@suse.de >
Reviewed-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com >
Link: https://lore.kernel.org/r/20200527115313.7426-8-joro@8bytes.org
2020-05-29 17:10:47 +02:00
Joerg Roedel
301441a099
iommu/amd: Consolidate domain allocation/freeing
...
Merge the allocation code paths of DMA and UNMANAGED domains and
remove code duplication.
Signed-off-by: Joerg Roedel <jroedel@suse.de >
Reviewed-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com >
Link: https://lore.kernel.org/r/20200527115313.7426-7-joro@8bytes.org
2020-05-29 17:10:43 +02:00
Joerg Roedel
75b2774509
iommu/amd: Free page-table in protection_domain_free()
...
Align release of the page-table with the place where it is allocated.
Signed-off-by: Joerg Roedel <jroedel@suse.de >
Reviewed-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com >
Link: https://lore.kernel.org/r/20200527115313.7426-6-joro@8bytes.org
2020-05-29 17:10:35 +02:00
Joerg Roedel
a71730e225
iommu/amd: Allocate page-table in protection_domain_init()
...
Consolidate the allocation of the domain page-table in one place.
Signed-off-by: Joerg Roedel <jroedel@suse.de >
Reviewed-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com >
Link: https://lore.kernel.org/r/20200527115313.7426-5-joro@8bytes.org
2020-05-29 17:10:31 +02:00
Joerg Roedel
1226c37074
iommu/amd: Let free_pagetable() not rely on domain->pt_root
...
Use 'struct domain_pgtable' instead to free_pagetable(). This solves
the problem that amd_iommu_domain_direct_map() needs to restore
domain->pt_root after the device table has been updated just to make
free_pagetable release the domain page-table.
Signed-off-by: Joerg Roedel <jroedel@suse.de >
Reviewed-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com >
Link: https://lore.kernel.org/r/20200527115313.7426-4-joro@8bytes.org
2020-05-29 17:10:27 +02:00
Joerg Roedel
fb1b6955bb
iommu/amd: Unexport get_dev_data()
...
This function is internal to the AMD IOMMU driver and only exported
because the amd_iommu_v2 modules calls it. But the reason it is called
from there could better be handled by amd_iommu_is_attach_deferred().
So unexport get_dev_data() and use amd_iommu_is_attach_deferred()
instead.
Signed-off-by: Joerg Roedel <jroedel@suse.de >
Reviewed-by: Suravee Suthikulpanit <suravee.suthikulpanit@amd.com >
Link: https://lore.kernel.org/r/20200527115313.7426-3-joro@8bytes.org
2020-05-29 17:10:23 +02:00
Joerg Roedel
4c201d58cf
Merge tag 'v5.7-rc7' into x86/amd
...
Linux 5.7-rc7
2020-05-29 17:10:09 +02:00
Al Viro
87c233b815
vmci_host: get rid of pointless access_ok()
...
get_user_pages_fast() doesn't need the caller to check that.
NB: reachable only from ioctl(2) and only under USER_DS
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk >
2020-05-29 11:06:38 -04:00
Al Viro
fd8ec4dd4a
hfi1: get rid of pointless access_ok()
...
pin_user_pages_fast() doesn't need that from its caller.
NB: only reachable from ->ioctl(), and only under USER_DS
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk >
2020-05-29 11:06:32 -04:00
Al Viro
fe6bb59f4d
usb: get rid of pointless access_ok() calls
...
in all affected cases addresses are passed only to
copy_from()_user or copy_to_user().
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk >
2020-05-29 11:05:58 -04:00
Al Viro
e6c0433e27
lpfc_debugfs: get rid of pointless access_ok()
...
No, you do NOT need to "protect copy from user" that way.
Incidentally, your userland ABI stinks. I understand that you
wanted to accept "reset" and "reset\n" as equivalent, but I suspect
that accepting "reset this, you !@^!@!" had been an accident.
Nothing to do about that now - it is a userland ABI...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk >
2020-05-29 11:05:54 -04:00
Al Viro
d2659e583e
efi_test: get rid of pointless access_ok()
...
really, people - get_user(), copy_from_user(), memdup_user(), etc.
all fail if access_ok() does.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk >
2020-05-29 11:05:54 -04:00
Al Viro
a38547d435
drm_read(): get rid of pointless access_ok()
...
address is passed only to copy_to_user()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk >
2020-05-29 11:05:54 -04:00
Al Viro
d65aca9ff8
via-pmu: don't bother with access_ok()
...
we are using copy_to_user() for actual copying
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk >
2020-05-29 11:05:54 -04:00
Al Viro
835ae3bb53
drivers/crypto/ccp/sev-dev.c: get rid of pointless access_ok()
...
Contrary to the comments, those do *NOT* verify anything about
writability of memory, etc.
In all cases addresses are passed only to copy_to_user().
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk >
2020-05-29 11:05:54 -04:00
Ville Syrjälä
a227569d1f
drm/i915: Replace I915_MODE_FLAG_INHERITED with a boolean
...
There's no reason for I915_MODE_FLAG_INHERITED to exist as a flag
anymore. Just make it a boolean.
v2: Deal with sanitize_watermarks()
CC: Sam Ravnborg <sam@ravnborg.org >
Cc: Daniel Vetter <daniel.vetter@ffwll.ch >
Cc: Emil Velikov <emil.l.velikov@gmail.com >
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20200429103936.11850-1-ville.syrjala@linux.intel.com
2020-05-29 18:05:13 +03:00
Al Viro
9053fc91e3
omapfb: get rid of pointless access_ok() calls
...
address is passed only to copy_to_user()
Acked-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com >
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk >
2020-05-29 11:04:58 -04:00
Al Viro
694b9a7157
amifb: get rid of pointless access_ok() calls
...
addresses passed only to get_user() and put_user()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk >
2020-05-29 11:04:56 -04:00
Al Viro
83a4f2e704
drivers/fpga/dfl-afu-dma-region.c: get rid of pointless access_ok()
...
Address is passed to get_user_pages_fast(), which does access_ok().
NB: this is called only from ->ioctl(), and only under USER_DS.
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk >
2020-05-29 11:04:56 -04:00
Al Viro
c9a4bb4166
drivers/fpga/dfl-fme-pr.c: get rid of pointless access_ok()
...
followed by copy_from_user()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk >
2020-05-29 11:04:56 -04:00
Al Viro
5f599098f7
cm4000_cs.c cmm_ioctl(): get rid of pointless access_ok()
...
copy_to_user()/copy_from_user() for everything
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk >
2020-05-29 11:04:56 -04:00
Al Viro
558cc8f782
nvram: drop useless access_ok()
...
we are using copy_to_user()/memdup_user() anyway
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk >
2020-05-29 11:03:30 -04:00
Al Viro
1a4b8febb6
n_hdlc_tty_read(): remove pointless access_ok()
...
only copy_to_user() is done to the address in question
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk >
2020-05-29 11:03:03 -04:00
Al Viro
00fca6b53a
tomoyo_write_control(): get rid of pointless access_ok()
...
address is passed only to get_user()
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk >
2020-05-29 11:02:29 -04:00
Andreas Gruenbacher
20be493b78
gfs2: Even more gfs2_find_jhead fixes
...
Fix several issues in the previous gfs2_find_jhead fix:
* When updating @blocks_submitted, @block refers to the first block block not
submitted yet, not the last block submitted, so fix an off-by-one error.
* We want to ensure that @blocks_submitted is far enough ahead of @blocks_read
to guarantee that there is in-flight I/O. Otherwise, we'll eventually end up
waiting for pages that haven't been submitted, yet.
* It's much easier to compare the number of blocks added with the number of
blocks submitted to limit the maximum bio size.
* Even with bio chaining, we can keep adding blocks until we reach the maximum
bio size, as long as we stop at a page boundary. This simplifies the logic.
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com >
Reviewed-by: Bob Peterson <rpeterso@redhat.com >
2020-05-29 17:00:24 +02:00
Ville Syrjälä
af157b7611
drm/i915: Stop using mode->private_flags
...
Replace the use of mode->private_flags with a truly private bitmaks
in our own crtc state. We also need a copy in the crtc itself so the
vblank code can get at it. We already have scanline_offset in there
for a similar reason, as well as the vblank->hwmode which is assigned
via drm_calc_timestamping_constants(). Fortunately we now have a
nice place for doing the crtc_state->crtc copy in
intel_crtc_update_active_timings() which gets called both for
modesets and init/resume readout.
The one slightly iffy spot is the INHERITED flag which we want to
preserve until userspace/fb_helper does the first proper commit after
actually calling .detecti() on the connectors. Otherwise we don't have
the full sink capabilities (audio,infoframes,etc.) when .compute_config()
gets called and thus we will fail to enable those features when the
first userspace commit happens. The only internal commit we do prior to
that should be from intel_initial_commit() and there we can simply
preserve the INHERITED flag from the readout.
v2: Deal with INHERITED in sanitize_watermarks() as well
CC: Sam Ravnborg <sam@ravnborg.org >
Cc: Daniel Vetter <daniel.vetter@ffwll.ch >
Cc: Emil Velikov <emil.l.velikov@gmail.com >
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20200429103904.11727-1-ville.syrjala@linux.intel.com
2020-05-29 17:59:21 +03:00
Serge Semin
8378449d1f
spi: dw: Use regset32 DebugFS method to create regdump file
...
DebugFS kernel interface provides a dedicated method to create the
registers dump file. Use it instead of creating a generic DebugFS
file with manually written read callback function.
Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru >
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Cc: Georgy Vlasov <Georgy.Vlasov@baikalelectronics.ru >
Cc: Ramil Zaripov <Ramil.Zaripov@baikalelectronics.ru >
Cc: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru >
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de >
Cc: Arnd Bergmann <arnd@arndb.de >
Cc: Feng Tang <feng.tang@intel.com >
Cc: Rob Herring <robh+dt@kernel.org >
Cc: linux-mips@vger.kernel.org
Cc: devicetree@vger.kernel.org
Link: https://lore.kernel.org/r/20200529131205.31838-16-Sergey.Semin@baikalelectronics.ru
Signed-off-by: Mark Brown <broonie@kernel.org >
2020-05-29 15:55:54 +01:00
Serge Semin
0fdad596d4
spi: dw: Add DMA support to the DW SPI MMIO driver
...
Since the common code in the spi-dw-dma.c driver is ready to be used
by the MMIO driver and now provides a method to generically (on any
DT or ACPI-based platforms) retrieve the Tx/Rx DMA channel handlers,
we can use it and a set of the common DW SPI DMA callbacks to enable
DMA at least for generic "snps,dw-apb-ssi" and "snps,dwc-ssi-1.01a"
devices.
Co-developed-by: Georgy Vlasov <Georgy.Vlasov@baikalelectronics.ru >
Co-developed-by: Ramil Zaripov <Ramil.Zaripov@baikalelectronics.ru >
Signed-off-by: Georgy Vlasov <Georgy.Vlasov@baikalelectronics.ru >
Signed-off-by: Ramil Zaripov <Ramil.Zaripov@baikalelectronics.ru >
Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru >
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Cc: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru >
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de >
Cc: Arnd Bergmann <arnd@arndb.de >
Cc: Feng Tang <feng.tang@intel.com >
Cc: Rob Herring <robh+dt@kernel.org >
Cc: linux-mips@vger.kernel.org
Cc: devicetree@vger.kernel.org
Link: https://lore.kernel.org/r/20200529131205.31838-15-Sergey.Semin@baikalelectronics.ru
Signed-off-by: Mark Brown <broonie@kernel.org >
2020-05-29 15:55:53 +01:00
Serge Semin
5778441172
spi: dw: Cleanup generic DW DMA code namings
...
Since from now the former Intel MID platform layer is used as a generic
DW SPI DMA module, let's alter the internal methods naming to be
DMA-related instead of having the "mid_" prefix.
Co-developed-by: Georgy Vlasov <Georgy.Vlasov@baikalelectronics.ru >
Co-developed-by: Ramil Zaripov <Ramil.Zaripov@baikalelectronics.ru >
Signed-off-by: Georgy Vlasov <Georgy.Vlasov@baikalelectronics.ru >
Signed-off-by: Ramil Zaripov <Ramil.Zaripov@baikalelectronics.ru >
Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru >
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Cc: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru >
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de >
Cc: Arnd Bergmann <arnd@arndb.de >
Cc: Feng Tang <feng.tang@intel.com >
Cc: Rob Herring <robh+dt@kernel.org >
Cc: linux-mips@vger.kernel.org
Cc: devicetree@vger.kernel.org
Link: https://lore.kernel.org/r/20200529131205.31838-14-Sergey.Semin@baikalelectronics.ru
Signed-off-by: Mark Brown <broonie@kernel.org >
2020-05-29 15:55:52 +01:00
Serge Semin
ecb3a67edf
spi: dw: Add DW SPI DMA/PCI/MMIO dependency on the DW SPI core
...
Seeing all of the DW SPI driver components like DW SPI DMA/PCI/MMIO
depend on the DW SPI core code it's better to use the if-endif
conditional kernel config statement to signify that common dependency.
Co-developed-by: Georgy Vlasov <Georgy.Vlasov@baikalelectronics.ru >
Co-developed-by: Ramil Zaripov <Ramil.Zaripov@baikalelectronics.ru >
Signed-off-by: Georgy Vlasov <Georgy.Vlasov@baikalelectronics.ru >
Signed-off-by: Ramil Zaripov <Ramil.Zaripov@baikalelectronics.ru >
Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru >
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Cc: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru >
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de >
Cc: Arnd Bergmann <arnd@arndb.de >
Cc: Feng Tang <feng.tang@intel.com >
Cc: Rob Herring <robh+dt@kernel.org >
Cc: linux-mips@vger.kernel.org
Cc: devicetree@vger.kernel.org
Link: https://lore.kernel.org/r/20200529131205.31838-13-Sergey.Semin@baikalelectronics.ru
Signed-off-by: Mark Brown <broonie@kernel.org >
2020-05-29 15:55:51 +01:00
Serge Semin
06cfadb8c5
spi: dw: Remove DW DMA code dependency from DW_DMAC_PCI
...
Since there is a generic method available to initialize the DW SPI DMA
interface on any DT and ACPI-based platforms, which in general can be
designed with not only DW DMAC but with any DMA engine on board, we can
freely remove the CONFIG_DW_DMAC_PCI config from dependency list of
CONFIG_SPI_DW_DMA. Especially seeing that we don't use anything DW DMAC
specific in the new driver.
Co-developed-by: Georgy Vlasov <Georgy.Vlasov@baikalelectronics.ru >
Co-developed-by: Ramil Zaripov <Ramil.Zaripov@baikalelectronics.ru >
Signed-off-by: Georgy Vlasov <Georgy.Vlasov@baikalelectronics.ru >
Signed-off-by: Ramil Zaripov <Ramil.Zaripov@baikalelectronics.ru >
Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru >
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Cc: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru >
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de >
Cc: Arnd Bergmann <arnd@arndb.de >
Cc: Feng Tang <feng.tang@intel.com >
Cc: Rob Herring <robh+dt@kernel.org >
Cc: linux-mips@vger.kernel.org
Cc: devicetree@vger.kernel.org
Link: https://lore.kernel.org/r/20200529131205.31838-12-Sergey.Semin@baikalelectronics.ru
Signed-off-by: Mark Brown <broonie@kernel.org >
2020-05-29 15:55:51 +01:00
Serge Semin
6c710c0cb6
spi: dw: Move Non-DMA code to the DW PCIe-SPI driver
...
This is a preparation patch before adding the DW DMA support into the
DW SPI MMIO driver. We need to unpin the Non-DMA-specific code from the
intended to be generic DW APB SSI DMA code. This isn't that hard,
since the most part of the spi-dw-mid.c driver in fact implements a
generic DMA interface for the DW SPI controller driver. The only Intel
MID specifics concern getting the max frequency from the MRST Clock
Control Unit and fetching the DMA controller channels from
corresponding PCIe DMA controller. Since first one is related with the
SPI interface configuration we moved it' implementation into the
DW PCIe-SPI driver module. After that former spi-dw-mid.c file
can be just renamed to be the DW SPI DMA module optionally compiled in to
the DW APB SSI core driver.
Co-developed-by: Georgy Vlasov <Georgy.Vlasov@baikalelectronics.ru >
Co-developed-by: Ramil Zaripov <Ramil.Zaripov@baikalelectronics.ru >
Signed-off-by: Georgy Vlasov <Georgy.Vlasov@baikalelectronics.ru >
Signed-off-by: Ramil Zaripov <Ramil.Zaripov@baikalelectronics.ru >
Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru >
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Cc: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru >
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de >
Cc: Arnd Bergmann <arnd@arndb.de >
Cc: Feng Tang <feng.tang@intel.com >
Cc: Rob Herring <robh+dt@kernel.org >
Cc: linux-mips@vger.kernel.org
Cc: devicetree@vger.kernel.org
Link: https://lore.kernel.org/r/20200529131205.31838-11-Sergey.Semin@baikalelectronics.ru
Signed-off-by: Mark Brown <broonie@kernel.org >
2020-05-29 15:55:50 +01:00
Serge Semin
77ccff803d
spi: dw: Add core suffix to the DW APB SSI core source file
...
Generic DMA support is going to be part of the DW APB SSI core object.
In order to preserve the kernel loadable module name as spi-dw.ko, let's
add the "-core" suffix to the object with generic DW APB SSI code and
build it into the target spi-dw.ko driver.
Suggested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru >
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Cc: Georgy Vlasov <Georgy.Vlasov@baikalelectronics.ru >
Cc: Ramil Zaripov <Ramil.Zaripov@baikalelectronics.ru >
Cc: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru >
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de >
Cc: Feng Tang <feng.tang@intel.com >
Cc: Rob Herring <robh+dt@kernel.org >
Cc: Arnd Bergmann <arnd@arndb.de >
Cc: linux-mips@vger.kernel.org
Cc: devicetree@vger.kernel.org
Link: https://lore.kernel.org/r/20200529131205.31838-10-Sergey.Semin@baikalelectronics.ru
Signed-off-by: Mark Brown <broonie@kernel.org >
2020-05-29 15:55:49 +01:00
Serge Semin
46164fde6b
spi: dw: Fix Rx-only DMA transfers
...
Tx-only DMA transfers are working perfectly fine since in this case
the code just ignores the Rx FIFO overflow interrupts. But it turns
out the SPI Rx-only transfers are broken since nothing pushing any
data to the shift registers, so the Rx FIFO is left empty and the
SPI core subsystems just returns a timeout error. Since DW DMAC
driver doesn't support something like cyclic write operations of
a single byte to a device register, the only way to support the
Rx-only SPI transfers is to fake it by using a dummy Tx-buffer.
This is what we intend to fix in this commit by setting the
SPI_CONTROLLER_MUST_TX flag for DMA-capable platform.
Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru >
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Cc: Georgy Vlasov <Georgy.Vlasov@baikalelectronics.ru >
Cc: Ramil Zaripov <Ramil.Zaripov@baikalelectronics.ru >
Cc: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru >
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de >
Cc: Arnd Bergmann <arnd@arndb.de >
Cc: Feng Tang <feng.tang@intel.com >
Cc: Rob Herring <robh+dt@kernel.org >
Cc: linux-mips@vger.kernel.org
Cc: devicetree@vger.kernel.org
Link: https://lore.kernel.org/r/20200529131205.31838-9-Sergey.Semin@baikalelectronics.ru
Signed-off-by: Mark Brown <broonie@kernel.org >
2020-05-29 15:55:48 +01:00
Serge Semin
0b2b66514f
spi: dw: Use DMA max burst to set the request thresholds
...
Each channel of DMA controller may have a limited length of burst
transaction (number of IO operations performed at ones in a single
DMA client request). This parameter can be used to setup the most
optimal DMA Tx/Rx data level values. In order to avoid the Tx buffer
overrun we can set the DMA Tx level to be of FIFO depth minus the
maximum burst transactions length. To prevent the Rx buffer underflow
the DMA Rx level should be set to the maximum burst transactions length.
This commit setups the DMA channels and the DW SPI DMA Tx/Rx levels
in accordance with these rules.
Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru >
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Cc: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru >
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de >
Cc: Arnd Bergmann <arnd@arndb.de >
Cc: Feng Tang <feng.tang@intel.com >
Cc: Rob Herring <robh+dt@kernel.org >
Cc: linux-mips@vger.kernel.org
Cc: devicetree@vger.kernel.org
Link: https://lore.kernel.org/r/20200529131205.31838-8-Sergey.Semin@baikalelectronics.ru
Signed-off-by: Mark Brown <broonie@kernel.org >
2020-05-29 15:55:47 +01:00
Serge Semin
c534df9d62
spi: dw: Parameterize the DMA Rx/Tx burst length
...
It isn't good to have numeric literals in the code especially if there
are multiple of them and they are related. Let's replace the Tx and Rx
burst level literals with the corresponding constants.
Co-developed-by: Georgy Vlasov <Georgy.Vlasov@baikalelectronics.ru >
Co-developed-by: Ramil Zaripov <Ramil.Zaripov@baikalelectronics.ru >
Signed-off-by: Georgy Vlasov <Georgy.Vlasov@baikalelectronics.ru >
Signed-off-by: Ramil Zaripov <Ramil.Zaripov@baikalelectronics.ru >
Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru >
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Cc: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru >
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de >
Cc: Arnd Bergmann <arnd@arndb.de >
Cc: Feng Tang <feng.tang@intel.com >
Cc: Rob Herring <robh+dt@kernel.org >
Cc: linux-mips@vger.kernel.org
Cc: devicetree@vger.kernel.org
Link: https://lore.kernel.org/r/20200529131205.31838-7-Sergey.Semin@baikalelectronics.ru
Signed-off-by: Mark Brown <broonie@kernel.org >
2020-05-29 15:55:46 +01:00