22 Sep, 2020

1 commit

  • sg_init_table zeroes its first argument, so the allocation of that argument
    doesn't have to.

    the semantic patch that makes this change is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @@
    expression x,n,flags;
    @@

    x =
    - kcalloc
    + kmalloc_array
    (n,sizeof(*x),flags)
    ...
    sg_init_table(x,n)
    //

    Signed-off-by: Julia Lawall
    Link: https://lore.kernel.org/r/1600601186-7420-12-git-send-email-Julia.Lawall@inria.fr
    Signed-off-by: Mark Brown

    Julia Lawall
     

29 Jul, 2020

1 commit

  • Before generic upgrade, both .suspend() and .resume() were invoking
    pci_enable_wake(pci_dev, PCI_D3hot, 0). Hence, disabling wakeup in both
    states. (Normal trend is .suspend() enables and .resume() disables the
    wakeup.)

    This was ambiguous and may be buggy. Instead of replicating the legacy
    behavior, drop the wakeup-disable call.

    Fixes: f185bcc77980 ("spi: spi-topcliff-pch: use generic power management")
    Reported-by: Andy Shevchenko
    Signed-off-by: Vaibhav Gupta
    Reviewed-by: Andy Shevchenko
    Link: https://lore.kernel.org/r/20200727172936.661567-1-vaibhavgupta40@gmail.com
    Signed-off-by: Mark Brown

    Vaibhav Gupta
     

22 Jul, 2020

1 commit

  • Drivers using legacy PM have to manage PCI states and device's PM states
    themselves. They also need to take care of configuration registers.

    With improved and powerful support of generic PM, PCI Core takes care of
    above mentioned, device-independent, jobs.

    This driver makes use of PCI helper functions like
    pci_save/restore_state(), pci_enable/disable_device(), pci_enable_wake()
    and pci_set_power_state() to do required operations. In generic mode, they
    are no longer needed.

    Change function parameter in both .suspend() and .resume() to
    "struct device*" type. Use dev_get_drvdata() to get drv data.

    Compile-tested only.

    Signed-off-by: Vaibhav Gupta
    Link: https://lore.kernel.org/r/20200720155714.714114-1-vaibhavgupta40@gmail.com
    Signed-off-by: Mark Brown

    Vaibhav Gupta
     

17 Jul, 2020

1 commit

  • Fixes the following W=1 kernel build warning(s):

    drivers/spi/spi-topcliff-pch.c:184: warning: Function parameter or member 'io_base_addr' not described in 'pch_spi_data'
    drivers/spi/spi-topcliff-pch.c:184: warning: Function parameter or member 'pkt_tx_buff' not described in 'pch_spi_data'
    drivers/spi/spi-topcliff-pch.c:184: warning: Function parameter or member 'pkt_rx_buff' not described in 'pch_spi_data'
    drivers/spi/spi-topcliff-pch.c:184: warning: Function parameter or member 'dma' not described in 'pch_spi_data'
    drivers/spi/spi-topcliff-pch.c:184: warning: Function parameter or member 'use_dma' not described in 'pch_spi_data'
    drivers/spi/spi-topcliff-pch.c:184: warning: Function parameter or member 'save_total_len' not described in 'pch_spi_data'

    Signed-off-by: Lee Jones
    Link: https://lore.kernel.org/r/20200717135424.2442271-12-lee.jones@linaro.org
    Signed-off-by: Mark Brown

    Lee Jones
     

10 Dec, 2019

1 commit

  • Fixes coccicheck warning:

    drivers/spi/spi-topcliff-pch.c:866:47-48: Unneeded semicolon
    drivers/spi/spi-topcliff-pch.c:881:53-54: Unneeded semicolon

    Reported-by: Hulk Robot
    Signed-off-by: zhengbin
    Link: https://lore.kernel.org/r/1574909512-24260-1-git-send-email-zhengbin13@huawei.com
    Signed-off-by: Mark Brown

    zhengbin
     

15 Oct, 2019

1 commit

  • For many places in the spi drivers, using the new `spi_transfer_delay`
    helper is straightforward.
    It's just replacing:
    ```
    if (t->delay_usecs)
    udelay(t->delay_usecs);
    ```
    with `spi_transfer_delay(t)` which handles both `delay_usecs` and the new
    `delay` field.

    This change replaces in all places (in the spi drivers) where this change
    is simple.

    Signed-off-by: Alexandru Ardelean
    Link: https://lore.kernel.org/r/20190926105147.7839-10-alexandru.ardelean@analog.com
    Signed-off-by: Mark Brown

    Alexandru Ardelean
     

05 Jun, 2019

1 commit

  • Based on 1 normalized pattern(s):

    this program is free software you can redistribute it and or modify
    it under the terms of the gnu general public license as published by
    the free software foundation version 2 of the license this program
    is distributed in the hope that it will be useful but without any
    warranty without even the implied warranty of merchantability or
    fitness for a particular purpose see the gnu general public license
    for more details

    extracted by the scancode license scanner the SPDX license identifier

    GPL-2.0-only

    has been chosen to replace the boilerplate/reference in 100 file(s).

    Signed-off-by: Thomas Gleixner
    Reviewed-by: Alexios Zavras
    Reviewed-by: Allison Randal
    Cc: linux-spdx@vger.kernel.org
    Link: https://lkml.kernel.org/r/20190529141900.918357685@linutronix.de
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

02 May, 2019

1 commit


18 Mar, 2019

1 commit


10 Mar, 2019

1 commit

  • Pull PCI updates from Bjorn Helgaas:

    - Use match_string() instead of reimplementing it (Andy Shevchenko)

    - Enable SERR# forwarding for all bridges (Bharat Kumar Gogada)

    - Use Latency Tolerance Reporting if already enabled by platform (Bjorn
    Helgaas)

    - Save/restore LTR info for suspend/resume (Bjorn Helgaas)

    - Fix DPC use of uninitialized data (Dongdong Liu)

    - Probe bridge window attributes only once at enumeration-time to fix
    device accesses during rescan (Bjorn Helgaas)

    - Return BAR size (not "size -1 ") from pci_size() to simplify code (Du
    Changbin)

    - Use config header type (not class code) identify bridges more
    reliably (Honghui Zhang)

    - Work around Intel Denverton incorrect Trace Hub BAR size reporting
    (Alexander Shishkin)

    - Reorder pciehp cached state/hardware state updates to avoid missed
    interrupts (Mika Westerberg)

    - Turn ibmphp semaphores into completions or mutexes (Arnd Bergmann)

    - Mark expected switch fall-through (Mathieu Malaterre)

    - Use of_node_name_eq() for node name comparisons (Rob Herring)

    - Add ACS and pciehp quirks for HXT SD4800 (Shunyong Yang)

    - Consolidate Rohm Vendor ID definitions (Andy Shevchenko)

    - Use u32 (not __u32) for things not exposed to userspace (Logan
    Gunthorpe)

    - Fix locking semantics of bus and slot reset interfaces (Alex
    Williamson)

    - Update PCIEPORTBUS Kconfig help text (Hou Zhiqiang)

    - Allow portdrv to claim subtractive decode Ports so PCIe services will
    work for them (Honghui Zhang)

    - Report PCIe links that become degraded at run-time (Alexandru
    Gagniuc)

    - Blacklist Gigabyte X299 Root Port power management to fix Thunderbolt
    hotplug (Mika Westerberg)

    - Revert runtime PM suspend/resume callbacks that broke PME on network
    cable plug (Mika Westerberg)

    - Disable Data Link State Changed interrupts to prevent wakeup
    immediately after suspend (Mika Westerberg)

    - Extend altera to support Stratix 10 (Ley Foon Tan)

    - Allow building altera driver on ARM64 (Ley Foon Tan)

    - Replace Douglas with Tom Joseph as Cadence PCI host/endpoint
    maintainer (Lorenzo Pieralisi)

    - Add DT support for R-Car RZ/G2E (R8A774C0) (Fabrizio Castro)

    - Add dra72x/dra74x/dra76x SoC compatible strings (Kishon Vijay Abraham I)

    - Enable x2 mode support for dra72x/dra74x/dra76x SoC (Kishon Vijay
    Abraham I)

    - Configure dra7xx PHY to PCIe mode (Kishon Vijay Abraham I)

    - Simplify dwc (remove unnecessary header includes, name variables
    consistently, reduce inverted logic, etc) (Gustavo Pimentel)

    - Add i.MX8MQ support (Andrey Smirnov)

    - Add message to help debug dwc MSI-X mask bit errors (Gustavo
    Pimentel)

    - Work around imx7d PCIe PLL erratum (Trent Piepho)

    - Don't assert qcom reset GPIO during probe (Bjorn Andersson)

    - Skip dwc MSI init if MSIs have been disabled (Lucas Stach)

    - Use memcpy_fromio()/memcpy_toio() instead of plain memcpy() in PCI
    endpoint framework (Wen Yang)

    - Add interface to discover supported endpoint features to replace a
    bitfield that wasn't flexible enough (Kishon Vijay Abraham I)

    - Implement the new supported-feature interface for designware-plat,
    dra7xx, rockchip, cadence (Kishon Vijay Abraham I)

    - Fix issues with 64-bit BAR in endpoints (Kishon Vijay Abraham I)

    - Add layerscape endpoint mode support (Xiaowei Bao)

    - Remove duplicate struct hv_vp_set in favor of struct hv_vpset (Maya
    Nakamura)

    - Rework hv_irq_unmask() to use cpumask_to_vpset() instead of
    open-coded reimplementation (Maya Nakamura)

    - Align Hyper-V struct retarget_msi_interrupt arguments (Maya Nakamura)

    - Fix mediatek MMIO size computation to enable full size of available
    MMIO space (Honghui Zhang)

    - Fix mediatek DMA window size computation to allow endpoint DMA access
    to full DRAM address range (Honghui Zhang)

    - Fix mvebu prefetchable BAR regression caused by common bridge
    emulation that assumed all bridges had prefetchable windows (Thomas
    Petazzoni)

    - Make advk_pci_bridge_emul_ops static (Wei Yongjun)

    - Configure MPS settings for VMD root ports (Jon Derrick)

    * tag 'pci-v5.1-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci: (92 commits)
    PCI: Update PCIEPORTBUS Kconfig help text
    PCI: Fix "try" semantics of bus and slot reset
    PCI/LINK: Report degraded links via link bandwidth notification
    dt-bindings: PCI: altera: Add altr,pcie-root-port-2.0
    PCI: altera: Enable driver on ARM64
    PCI: altera: Add Stratix 10 PCIe support
    PCI/PME: Fix possible use-after-free on remove
    PCI: aardvark: Make symbol 'advk_pci_bridge_emul_ops' static
    PCI: dwc: skip MSI init if MSIs have been explicitly disabled
    PCI: hv: Refactor hv_irq_unmask() to use cpumask_to_vpset()
    PCI: hv: Replace hv_vp_set with hv_vpset
    PCI: hv: Add __aligned(8) to struct retarget_msi_interrupt
    PCI: mediatek: Enlarge PCIe2AHB window size to support 4GB DRAM
    PCI: mediatek: Fix memory mapped IO range size computation
    PCI: dwc: Remove superfluous shifting in definitions
    PCI: dwc: Make use of GENMASK/FIELD_PREP
    PCI: dwc: Make use of BIT() in constant definitions
    PCI: dwc: Share code for dw_pcie_rd/wr_other_conf()
    PCI: dwc: Make use of IS_ALIGNED()
    PCI: imx6: Add code to request/control "pcie_aux" clock for i.MX8MQ
    ...

    Linus Torvalds
     

02 Feb, 2019

1 commit


23 Jan, 2019

1 commit


18 Jan, 2017

5 commits


22 Nov, 2016

1 commit

  • Since commit 0d35773979b9 ("spi: spi-topcliff-pch: Remove deprecated
    create_singlethread_workqueue"), 'retval' is no more used in this function.

    So some now dead code can be removed.
    Also axe a debug message which looks useless now.

    Signed-off-by: Christophe JAILLET
    Signed-off-by: Mark Brown

    Christophe JAILLET
     

12 Jul, 2016

1 commit

  • The workqueue "wk" serves as a queue for carrying out execution
    of requests. It has a single work item(&drv_data->work) and hence doesn't
    require ordering. Also, it is not being used on a memory reclaim path.
    Hence, the singlethreaded workqueue has been replaced with the use of
    system_wq.

    System workqueues have been able to handle high level of concurrency
    for a long time now and hence it's not required to have a singlethreaded
    workqueue just to gain concurrency. Unlike a dedicated per-cpu workqueue
    created with create_singlethread_workqueue(), system_wq allows multiple
    work items to overlap executions even on the same CPU; however, a
    per-cpu workqueue doesn't have any CPU locality or global ordering
    guarantee unless the target CPU is explicitly specified and thus the
    increase of local concurrency shouldn't make any difference.

    Work item has been flushed in pch_spi_free_resources() to ensure that
    there are no pending tasks while disconnecting the driver.

    Also dropped the label 'err_return' since it's not being used anymore.

    Signed-off-by: Bhaktipriya Shridhar
    Signed-off-by: Mark Brown

    Bhaktipriya Shridhar
     

22 Dec, 2014

1 commit


20 Oct, 2014

1 commit


31 Jul, 2014

1 commit


17 Jul, 2014

1 commit


30 Apr, 2014

1 commit


30 Mar, 2014

1 commit


26 Mar, 2014

1 commit

  • If during a SPI transfer with len larger than PCH_MAX_FIFO_DEPTH and the
    IRQ handler happens to be called when the transmit FIFO is already empty,
    and SPSR_FI_BIT is set consequently, the message
    "spi_master spi32766: pch_spi_handler_sub : Transfer is not completed"
    is spammed to the systemlog, because tx_index has already increased
    further due to the next bytes to be written. This case is uncritical as
    new bytes have already been written.

    Signed-off-by: Alexander Stein
    Signed-off-by: Mark Brown

    Alexander Stein
     

24 Mar, 2014

1 commit


27 Feb, 2014

1 commit

  • If during registering SPI master due to SPI device probing a SPI transfer
    is issued the DMA buffers are not allocated yet.

    This fixes the following oops:
    pch_spi 0000:02:0c.1: enabling device (0000 -> 0002)
    pch_spi 0000:02:0c.1: master is unqueued, this is deprecated
    BUG: unable to handle kernel NULL pointer dereference at (null)
    IP: [] pch_spi_handle_dma+0x15c/0x6f4
    [...]

    Signed-off-by: Alexander Stein
    Signed-off-by: Mark Brown

    Alexander Stein
     

19 Feb, 2014

2 commits


15 Feb, 2014

1 commit

  • Set "master->max_speed_hz = PCH_MAX_BAUDRATE" then we can remove pch_spi_setup.
    In additional, pspi->max_speed_hz will never be 0 because it's default value
    will be set to master->max_speed_hz.

    Also remove list_empty checking in pch_spi_transfer() because the checking is
    done by spi core.

    Signed-off-by: Axel Lin
    Signed-off-by: Mark Brown

    Axel Lin
     

23 Jan, 2014

1 commit


17 Jan, 2014

1 commit


04 Dec, 2013

1 commit


25 Oct, 2013

1 commit


17 Oct, 2013

1 commit

  • User-visible strings are more difficult to grep from sources if they are
    separated to multiple source lines. This is worse than over 80 columns long
    line code style violation.

    Fix this by making those to single-line strings or by breaking them between
    variables.

    While at there, convert if (printk_ratelimit()) dev_warn() to use
    dev_warn_ratelimited in spi-pxa2xx.c.

    Signed-off-by: Jarkko Nikula
    Signed-off-by: Mark Brown

    Jarkko Nikula
     

24 Sep, 2013

1 commit


13 Aug, 2013

1 commit


26 Jun, 2013

2 commits