30 Dec, 2020

1 commit

  • commit a7b5458ce73b235be027cf2658c39b19b7e58cf2 upstream.

    Don't add platform resources that won't be used. This avoids a
    recently-added warning from the driver core, that can show up on a
    multi-platform kernel when !MACH_IS_MAC.

    ------------[ cut here ]------------
    WARNING: CPU: 0 PID: 0 at drivers/base/platform.c:224 platform_get_irq_optional+0x8e/0xce
    0 is an invalid IRQ number
    Modules linked in:
    CPU: 0 PID: 0 Comm: swapper Not tainted 5.9.0-multi #1
    Stack from 004b3f04:
    004b3f04 00462c2f 00462c2f 004b3f20 0002e128 004754db 004b6ad4 004b3f4c
    0002e19c 004754f7 000000e0 00285ba0 00000009 00000000 004b3f44 ffffffff
    004754db 004b3f64 004b3f74 00285ba0 004754f7 000000e0 00000009 004754db
    004fdf0c 005269e2 004fdf0c 00000000 004b3f88 00285cae 004b6964 00000000
    004fdf0c 004b3fac 0051cc68 004b6964 00000000 004b6964 00000200 00000000
    0051cc3e 0023c18a 004b3fc0 0051cd8a 004fdf0c 00000002 0052b43c 004b3fc8
    Call Trace: [] __warn+0xa6/0xd6
    [] warn_slowpath_fmt+0x44/0x76
    [] platform_get_irq_optional+0x8e/0xce
    [] platform_get_irq_optional+0x8e/0xce
    [] platform_get_irq+0x12/0x4c
    [] pmz_init_port+0x2a/0xa6
    [] pmz_init_port+0x0/0xa6
    [] strlen+0x0/0x22
    [] pmz_probe+0x34/0x88
    [] pmz_console_init+0x8/0x28
    [] console_init+0x1e/0x28
    [] printk+0x0/0x16
    [] start_kernel+0x368/0x4ce
    [] _sinittext+0x4f8/0xc48
    random: get_random_bytes called from print_oops_end_marker+0x56/0x80 with crng_init=0
    ---[ end trace 392d8e82eed68d6c ]---

    Commit a85a6c86c25b ("driver core: platform: Clarify that IRQ 0 is invalid"),
    which introduced the WARNING, suggests that testing for irq == 0 is
    undesirable. Instead of that comparison, just test for resource existence.

    Cc: Michael Ellerman
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Joshua Thompson
    Cc: Greg Kroah-Hartman
    Cc: Jiri Slaby
    Cc: stable@vger.kernel.org # v5.8+
    Reported-by: Laurent Vivier
    Signed-off-by: Finn Thain
    Link: https://lore.kernel.org/r/0c0fe1e4f11ccec202d4df09ea7d9d98155d101a.1606001297.git.fthain@telegraphics.com.au
    Signed-off-by: Geert Uytterhoeven
    Signed-off-by: Greg Kroah-Hartman

    Finn Thain
     

13 Oct, 2020

1 commit

  • Pull m68k updates from Geert Uytterhoeven:

    - Conversion of the Mac IDE driver to a platform driver

    - Minor cleanups and fixes

    * tag 'm68k-for-v5.10-tag1' of git://git.kernel.org/pub/scm/linux/kernel/git/geert/linux-m68k:
    ide/macide: Convert Mac IDE driver to platform driver
    m68k: Replace HTTP links with HTTPS ones
    m68k: mm: Remove superfluous memblock_alloc*() casts
    m68k: mm: Use PAGE_ALIGNED() helper
    m68k: Sort selects in main Kconfig
    m68k: amiga: Clean up Amiga hardware configuration
    m68k: Revive _TIF_* masks
    m68k: Correct some typos in comments
    m68k: Use get_kernel_nofault() in show_registers()
    zorro: Fix address space collision message with RAM expansion boards
    m68k: amiga: Fix Denise detection on OCS

    Linus Torvalds
     

28 Sep, 2020

1 commit

  • Add platform devices for the Mac IDE controller variants. Convert the
    macide module into a platform driver to support two of those variants.
    For the third, use a generic "pata_platform" driver instead.
    This enables automatic loading of the appropriate module and begins
    the process of replacing the driver with libata alternatives.

    Signed-off-by: Finn Thain
    Tested-by: Stan Johnson
    Cc: Bartlomiej Zolnierkiewicz
    Cc: Joshua Thompson
    References: commit 5ed0794cde593 ("m68k/atari: Convert Falcon IDE drivers to platform drivers")
    References: commit 7ad19a99ad431 ("ide: officially deprecated the legacy IDE driver")
    Link: https://lore.kernel.org/r/edd106dad1bbea32500601c6071f37a9f02a8004.1600901284.git.fthain@telegraphics.com.au
    Signed-off-by: Geert Uytterhoeven

    Finn Thain
     

07 Sep, 2020

1 commit

  • Rationale:
    Reduces attack surface on kernel devs opening the links for MITM
    as HTTPS traffic is much harder to manipulate.

    Deterministic algorithm:
    For each file:
    If not .svg:
    For each line:
    If doesn't contain `\bxmlns\b`:
    For each link, `\bhttp://[^# \t\r\n]*(?:\w|/)`:
    If neither `\bgnu\.org/license`, nor `\bmozilla\.org/MPL\b`:
    If both the HTTP and HTTPS versions
    return 200 OK and serve the same content:
    Replace HTTP with HTTPS.

    Signed-off-by: Alexander A. Klimov
    Link: https://lore.kernel.org/r/20200826185212.3139-1-grandmaster@al2klimov.de
    Signed-off-by: Geert Uytterhoeven

    Alexander A. Klimov
     

24 Aug, 2020

1 commit

  • Replace the existing /* fall through */ comments and its variants with
    the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
    fall-through markings when it is the case.

    [1] https://www.kernel.org/doc/html/v5.7/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through

    Signed-off-by: Gustavo A. R. Silva

    Gustavo A. R. Silva
     

13 Jul, 2020

4 commits

  • Always dump the full message and reply. Avoid printing partial lines
    as this output gets mixed up with the output from called functions.
    Don't output the state of idle channels.

    Signed-off-by: Finn Thain
    Tested-by: Stan Johnson
    Cc: Joshua Thompson
    Link: https://lore.kernel.org/r/317909d69244f06581973c5839382f5516cd9a1c.1590880333.git.fthain@telegraphics.com.au
    Signed-off-by: Geert Uytterhoeven

    Finn Thain
     
  • Clear the message reply before calling iop_complete(). This code path is
    not normally executed but should that happen let's arrange for consistent
    behaviour from the IOP.

    Signed-off-by: Finn Thain
    Tested-by: Stan Johnson
    Cc: Joshua Thompson
    Link: https://lore.kernel.org/r/8e35df4d193b082cb6285b1f30c949ff7e30e99e.1590880333.git.fthain@telegraphics.com.au
    Signed-off-by: Geert Uytterhoeven

    Finn Thain
     
  • When writing values to the IOP status/control register make sure those
    values do not have any extraneous bits that will clear interrupt flags.

    To place the SCC IOP into bypass mode would be desirable but this is not
    achieved by writing IOP_DMAINACTIVE | IOP_RUN | IOP_AUTOINC | IOP_BYPASS
    to the control register. Drop this ineffective register write.

    Remove the flawed and unused iop_bypass() function. Make use of the
    unused iop_stop() function.

    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Signed-off-by: Finn Thain
    Tested-by: Stan Johnson
    Cc: Joshua Thompson
    Link: https://lore.kernel.org/r/09bcb7359a1719a18b551ee515da3c4c3cf709e6.1590880333.git.fthain@telegraphics.com.au
    Signed-off-by: Geert Uytterhoeven

    Finn Thain
     
  • In the following sequence of calls, iop_do_send() gets called when the
    "send" channel is not in the IOP_MSG_IDLE state:

    iop_ism_irq()
    iop_handle_send()
    (msg->handler)()
    iop_send_message()
    iop_do_send()

    Avoid this by testing the channel state before calling iop_do_send().

    When sending, and iop_send_queue is empty, call iop_do_send() because
    the channel is idle. If iop_send_queue is not empty, iop_do_send() will
    get called later by iop_handle_send().

    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Signed-off-by: Finn Thain
    Tested-by: Stan Johnson
    Cc: Joshua Thompson
    Link: https://lore.kernel.org/r/6d667c39e53865661fa5a48f16829d18ed8abe54.1590880333.git.fthain@telegraphics.com.au
    Signed-off-by: Geert Uytterhoeven

    Finn Thain
     

10 Jun, 2020

1 commit

  • Patch series "mm: consolidate definitions of page table accessors", v2.

    The low level page table accessors (pXY_index(), pXY_offset()) are
    duplicated across all architectures and sometimes more than once. For
    instance, we have 31 definition of pgd_offset() for 25 supported
    architectures.

    Most of these definitions are actually identical and typically it boils
    down to, e.g.

    static inline unsigned long pmd_index(unsigned long address)
    {
    return (address >> PMD_SHIFT) & (PTRS_PER_PMD - 1);
    }

    static inline pmd_t *pmd_offset(pud_t *pud, unsigned long address)
    {
    return (pmd_t *)pud_page_vaddr(*pud) + pmd_index(address);
    }

    These definitions can be shared among 90% of the arches provided
    XYZ_SHIFT, PTRS_PER_XYZ and xyz_page_vaddr() are defined.

    For architectures that really need a custom version there is always
    possibility to override the generic version with the usual ifdefs magic.

    These patches introduce include/linux/pgtable.h that replaces
    include/asm-generic/pgtable.h and add the definitions of the page table
    accessors to the new header.

    This patch (of 12):

    The linux/mm.h header includes to allow inlining of the
    functions involving page table manipulations, e.g. pte_alloc() and
    pmd_alloc(). So, there is no point to explicitly include
    in the files that include .

    The include statements in such cases are remove with a simple loop:

    for f in $(git grep -l "include ") ; do
    sed -i -e '/include / d' $f
    done

    Signed-off-by: Mike Rapoport
    Signed-off-by: Andrew Morton
    Cc: Arnd Bergmann
    Cc: Borislav Petkov
    Cc: Brian Cain
    Cc: Catalin Marinas
    Cc: Chris Zankel
    Cc: "David S. Miller"
    Cc: Geert Uytterhoeven
    Cc: Greentime Hu
    Cc: Greg Ungerer
    Cc: Guan Xuetao
    Cc: Guo Ren
    Cc: Heiko Carstens
    Cc: Helge Deller
    Cc: Ingo Molnar
    Cc: Ley Foon Tan
    Cc: Mark Salter
    Cc: Matthew Wilcox
    Cc: Matt Turner
    Cc: Max Filippov
    Cc: Michael Ellerman
    Cc: Michal Simek
    Cc: Mike Rapoport
    Cc: Nick Hu
    Cc: Paul Walmsley
    Cc: Richard Weinberger
    Cc: Rich Felker
    Cc: Russell King
    Cc: Stafford Horne
    Cc: Thomas Bogendoerfer
    Cc: Thomas Gleixner
    Cc: Tony Luck
    Cc: Vincent Chen
    Cc: Vineet Gupta
    Cc: Will Deacon
    Cc: Yoshinori Sato
    Link: http://lkml.kernel.org/r/20200514170327.31389-1-rppt@kernel.org
    Link: http://lkml.kernel.org/r/20200514170327.31389-2-rppt@kernel.org
    Signed-off-by: Linus Torvalds

    Mike Rapoport
     

25 May, 2020

3 commits

  • On a Quadra 900/950, the ISM IOP IRQ output pin is connected to an
    edge-triggered input on VIA2. It is theoretically possible that this
    signal could fail to produce the expected VIA2 interrupt.

    The two IOP interrupt flags can be asserted in any order but the logic
    in iop_ism_irq() does not allow for that. In particular, INT0 can be
    asserted right after INT0 is checked and before INT1 is cleared.

    Such an interrupt would produce no new edge and VIA2 would detect no
    further interrupts from the IOP. Avoid this by looping over the INT0/1
    handlers so an edge can be produced.

    Signed-off-by: Finn Thain
    Tested-by: Stan Johnson
    Cc: Joshua Thompson
    Link: https://lore.kernel.org/r/bfbb71db52c5e162d3afa25a28fc5d535ca87138.1589949122.git.fthain@telegraphics.com.au
    Signed-off-by: Geert Uytterhoeven

    Finn Thain
     
  • This code path was tested on a Quadra 950 a long time ago and the
    comment isn't needed.

    Signed-off-by: Finn Thain
    Cc: Joshua Thompson
    Link: https://lore.kernel.org/r/10dff3e7c17d363a4b239aae7b3ebab32bef3547.1589949122.git.fthain@telegraphics.com.au
    Signed-off-by: Geert Uytterhoeven

    Finn Thain
     
  • There is no VIA2 chip on the Mac IIfx, so don't call via_flush_cache().
    This avoids a boot crash which appeared in v5.4.

    printk: console [ttyS0] enabled
    printk: bootconsole [debug0] disabled
    printk: bootconsole [debug0] disabled
    Calibrating delay loop... 9.61 BogoMIPS (lpj=48064)
    pid_max: default: 32768 minimum: 301
    Mount-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
    Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes, linear)
    devtmpfs: initialized
    random: get_random_u32 called from bucket_table_alloc.isra.27+0x68/0x194 with crng_init=0
    clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
    futex hash table entries: 256 (order: -1, 3072 bytes, linear)
    NET: Registered protocol family 16
    Data read fault at 0x00000000 in Super Data (pc=0x8a6a)
    BAD KERNEL BUSERR
    Oops: 00000000
    Modules linked in:
    PC: [] via_flush_cache+0x12/0x2c
    SR: 2700 SP: 01c1fe3c a2: 01c24000
    d0: 00001119 d1: 0000000c d2: 00012000 d3: 0000000f
    d4: 01c06840 d5: 00033b92 a0: 00000000 a1: 00000000
    Process swapper (pid: 1, task=01c24000)
    Frame format=B ssw=0755 isc=0200 isb=fff7 daddr=00000000 dobuf=01c1fed0
    baddr=00008a6e dibuf=0000004e ver=f
    Stack from 01c1fec4:
    01c1fed0 00007d7e 00010080 01c1fedc 0000792e 00000001 01c1fef4 00006b40
    01c80000 00040000 00000006 00000003 01c1ff1c 004a545e 004ff200 00040000
    00000000 00000003 01c06840 00033b92 004a5410 004b6c88 01c1ff84 000021e2
    00000073 00000003 01c06840 00033b92 0038507a 004bb094 004b6ca8 004b6c88
    004b6ca4 004b6c88 000021ae 00020002 00000000 01c0685d 00000000 01c1ffb4
    0049f938 00409c85 01c06840 0045bd40 00000073 00000002 00000002 00000000
    Call Trace: [] mac_cache_card_flush+0x12/0x1c
    [] fix_dnrm+0x2/0x18
    [] cache_push+0x46/0x5a
    [] arch_dma_prep_coherent+0x60/0x6e
    [] switched_to_dl+0x76/0xd0
    [] dma_atomic_pool_init+0x4e/0x188
    [] switched_to_dl+0x76/0xd0
    [] parse_args+0x0/0x370
    [] dma_atomic_pool_init+0x0/0x188
    [] do_one_initcall+0x34/0x1be
    [] parse_args+0x0/0x370
    [] strcpy+0x0/0x1e
    [] do_one_initcall+0x0/0x1be
    [] do_proc_dointvec_conv+0x54/0x74
    [] kernel_init_freeable+0x126/0x190
    [] kernel_init_freeable+0x13a/0x190
    [] dma_atomic_pool_init+0x0/0x188
    [] complete+0x0/0x3c
    [] kfree+0x0/0x20a
    [] schedule+0x0/0xd0
    [] kernel_init+0x0/0xda
    [] kernel_init+0xc/0xda
    [] kernel_init+0x0/0xda
    [] ret_from_kernel_thread+0xc/0x14
    Code: 0000 2079 0048 10da 2279 0048 10c8 d3c8 0200 fff7 1280 d1f9 0048 10c8 1010 0000 0008 1080 4e5e 4e75 4e56 0000 2039
    Disabling lock debugging due to kernel taint
    Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b

    Thanks to Stan Johnson for capturing the console log and running git
    bisect.

    Git bisect said commit 8e3a68fb55e0 ("dma-mapping: make
    dma_atomic_pool_init self-contained") is the first "bad" commit. I don't
    know why. Perhaps mach_l2_flush first became reachable with that commit.

    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Reported-and-tested-by: Stan Johnson
    Signed-off-by: Finn Thain
    Cc: Joshua Thompson
    Link: https://lore.kernel.org/r/b8bbeef197d6b3898e82ed0d231ad08f575a4b34.1589949122.git.fthain@telegraphics.com.au
    Signed-off-by: Geert Uytterhoeven

    Finn Thain
     

19 Aug, 2019

1 commit

  • Rename floppy_type macros to make them more consistent with the scsi_type
    macros, which are named after classes of models with similar memory maps.

    The MAC_FLOPPY_OLD symbol is introduced to change the relevant base
    address from 0x50F00000 to 0x50000000 (consistent with MAC_SCSI_OLD).

    The documentation for LC-class machines has the IO devices at offsets
    from $50F00000. Use these addresses for MAC_FLOPPY_LC (consistent with
    MAC_SCSI_LC) because they may not be aliased elsewhere in the memory map.

    Add comments with controller type information from 'Designing Cards and
    Drivers for the Macintosh Family', relevant Developer Notes and
    http://mess.redump.net/mess/driver_info/mac_technical_notes

    Adopt phys_addr_t to avoid type casts.

    Signed-off-by: Finn Thain
    Tested-by: Stan Johnson
    Acked-by: Laurent Vivier
    Signed-off-by: Geert Uytterhoeven

    Finn Thain
     

12 Jul, 2019

1 commit

  • Pull SCSI updates from James Bottomley:
    "This is mostly update of the usual drivers: qla2xxx, hpsa, lpfc, ufs,
    mpt3sas, ibmvscsi, megaraid_sas, bnx2fc and hisi_sas as well as the
    removal of the osst driver (I heard from Willem privately that he
    would like the driver removed because all his test hardware has
    failed). Plus number of minor changes, spelling fixes and other
    trivia.

    The big merge conflict this time around is the SPDX licence tags.
    Following discussion on linux-next, we believe our version to be more
    accurate than the one in the tree, so the resolution is to take our
    version for all the SPDX conflicts"

    Note on the SPDX license tag conversion conflicts: the SCSI tree had
    done its own SPDX conversion, which in some cases conflicted with the
    treewide ones done by Thomas & co.

    In almost all cases, the conflicts were purely syntactic: the SCSI tree
    used the old-style SPDX tags ("GPL-2.0" and "GPL-2.0+") while the
    treewide conversion had used the new-style ones ("GPL-2.0-only" and
    "GPL-2.0-or-later").

    In these cases I picked the new-style one.

    In a few cases, the SPDX conversion was actually different, though. As
    explained by James above, and in more detail in a pre-pull-request
    thread:

    "The other problem is actually substantive: In the libsas code Luben
    Tuikov originally specified gpl 2.0 only by dint of stating:

    * This file is licensed under GPLv2.

    In all the libsas files, but then muddied the water by quoting GPLv2
    verbatim (which includes the or later than language). So for these
    files Christoph did the conversion to v2 only SPDX tags and Thomas
    converted to v2 or later tags"

    So in those cases, where the spdx tag substantially mattered, I took the
    SCSI tree conversion of it, but then also took the opportunity to turn
    the old-style "GPL-2.0" into a new-style "GPL-2.0-only" tag.

    Similarly, when there were whitespace differences or other differences
    to the comments around the copyright notices, I took the version from
    the SCSI tree as being the more specific conversion.

    Finally, in the spdx conversions that had no conflicts (because the
    treewide ones hadn't been done for those files), I just took the SCSI
    tree version as-is, even if it was old-style. The old-style conversions
    are perfectly valid, even if the "-only" and "-or-later" versions are
    perhaps more descriptive.

    * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (185 commits)
    scsi: qla2xxx: move IO flush to the front of NVME rport unregistration
    scsi: qla2xxx: Fix NVME cmd and LS cmd timeout race condition
    scsi: qla2xxx: on session delete, return nvme cmd
    scsi: qla2xxx: Fix kernel crash after disconnecting NVMe devices
    scsi: megaraid_sas: Update driver version to 07.710.06.00-rc1
    scsi: megaraid_sas: Introduce various Aero performance modes
    scsi: megaraid_sas: Use high IOPS queues based on IO workload
    scsi: megaraid_sas: Set affinity for high IOPS reply queues
    scsi: megaraid_sas: Enable coalescing for high IOPS queues
    scsi: megaraid_sas: Add support for High IOPS queues
    scsi: megaraid_sas: Add support for MPI toolbox commands
    scsi: megaraid_sas: Offload Aero RAID5/6 division calculations to driver
    scsi: megaraid_sas: RAID1 PCI bandwidth limit algorithm is applicable for only Ventura
    scsi: megaraid_sas: megaraid_sas: Add check for count returned by HOST_DEVICE_LIST DCMD
    scsi: megaraid_sas: Handle sequence JBOD map failure at driver level
    scsi: megaraid_sas: Don't send FPIO to RL Bypass queue
    scsi: megaraid_sas: In probe context, retry IOC INIT once if firmware is in fault
    scsi: megaraid_sas: Release Mutex lock before OCR in case of DCMD timeout
    scsi: megaraid_sas: Call disable_irq from process IRQ poll
    scsi: megaraid_sas: Remove few debug counters from IO path
    ...

    Linus Torvalds
     

21 Jun, 2019

1 commit

  • Add support for Apple's custom "SCSI DMA" chip. This patch doesn't make use
    of its DMA capability. Just the PDMA capability is sufficient to improve
    sequential read throughput by a factor of 5.

    Cc: Michael Schmitz
    Cc: Joshua Thompson
    Cc: Geert Uytterhoeven
    Signed-off-by: Finn Thain
    Tested-by: Stan Johnson
    Tested-by: Michael Schmitz
    Acked-by: Geert Uytterhoeven
    Signed-off-by: Martin K. Petersen

    Finn Thain
     

21 May, 2019

2 commits

  • Add SPDX license identifiers to all Make/Kconfig files which:

    - Have no license information of any form

    These files fall under the project license, GPL v2 only. The resulting SPDX
    license identifier is:

    GPL-2.0-only

    Signed-off-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     
  • Add SPDX license identifiers to all files which:

    - Have no license information of any form

    - Have EXPORT_.*_SYMBOL_GPL inside which was used in the
    initial scan/conversion to ignore the file

    These files fall under the project license, GPL v2 only. The resulting SPDX
    license identifier is:

    GPL-2.0-only

    Signed-off-by: Thomas Gleixner
    Signed-off-by: Greg Kroah-Hartman

    Thomas Gleixner
     

25 Mar, 2019

4 commits

  • Add a platform clocksource by adapting the existing arch_gettimeoffset
    implementation.

    Signed-off-by: Finn Thain
    Acked-by: Linus Walleij
    Tested-by: Stan Johnson
    Signed-off-by: Geert Uytterhoeven

    Finn Thain
     
  • The functions that implement arch_gettimeoffset are re-used by
    new clocksource drivers in subsequent patches.

    Signed-off-by: Finn Thain
    Acked-by: Linus Walleij
    Signed-off-by: Geert Uytterhoeven

    Finn Thain
     
  • This resolves some bugs that affect VIA timer counter accesses.
    Avoid lost interrupts caused by reading the counter low byte register.
    Make allowance for the fact that the counter will be decremented to
    0xFFFF before being reloaded.

    Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
    Signed-off-by: Finn Thain
    Signed-off-by: Geert Uytterhoeven

    Finn Thain
     
  • Some platforms execute their timer handler with the interrupt priority
    level set below 6. That means the handler could be interrupted by another
    driver and this could lead to re-entry of the timer core.

    Avoid this by use of local_irq_save/restore for timer interrupt dispatch.
    This provides mutual exclusion around the timer interrupt flag access
    which is needed later in this series for the clocksource conversion.

    Reported-by: Thomas Gleixner
    Link: http://lkml.kernel.org/r/alpine.DEB.2.21.1811131407120.2697@nanos.tec.linutronix.de
    Signed-off-by: Finn Thain
    Signed-off-by: Geert Uytterhoeven

    Finn Thain
     

07 Mar, 2019

1 commit

  • Pull char/misc driver updates from Greg KH:
    "Here is the big char/misc driver patch pull request for 5.1-rc1.

    The largest thing by far is the new habanalabs driver for their AI
    accelerator chip. For now it is in the drivers/misc directory but will
    probably move to a new directory soon along with other drivers of this
    type.

    Other than that, just the usual set of individual driver updates and
    fixes. There's an "odd" merge in here from the DRM tree that they
    asked me to do as the MEI driver is starting to interact with the i915
    driver, and it needed some coordination. All of those patches have
    been properly acked by the relevant subsystem maintainers.

    All of these have been in linux-next with no reported issues, most for
    quite some time"

    * tag 'char-misc-5.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (219 commits)
    habanalabs: adjust Kconfig to fix build errors
    habanalabs: use %px instead of %p in error print
    habanalabs: use do_div for 64-bit divisions
    intel_th: gth: Fix an off-by-one in output unassigning
    habanalabs: fix little-endiancpu conversion warnings
    habanalabs: use NULL to initialize array of pointers
    habanalabs: fix little-endiancpu conversion warnings
    habanalabs: soft-reset device if context-switch fails
    habanalabs: print pointer using %p
    habanalabs: fix memory leak with CBs with unaligned size
    habanalabs: return correct error code on MMU mapping failure
    habanalabs: add comments in uapi/misc/habanalabs.h
    habanalabs: extend QMAN0 job timeout
    habanalabs: set DMA0 completion to SOB 1007
    habanalabs: fix validation of WREG32 to DMA completion
    habanalabs: fix mmu cache registers init
    habanalabs: disable CPU access on timeouts
    habanalabs: add MMU DRAM default page mapping
    habanalabs: Dissociate RAZWI info from event types
    misc/habanalabs: adjust Kconfig to fix build errors
    ...

    Linus Torvalds
     

22 Jan, 2019

4 commits

  • A multi-platform kernel binary has to decide at run-time how to dispatch
    the arch_nvram_ops calls. Add a platform-independent arch_nvram_ops
    struct for this, to replace the atari-specific one.

    Enable CONFIG_HAVE_ARCH_NVRAM_OPS for Macs.

    Acked-by: Geert Uytterhoeven
    Tested-by: Stan Johnson
    Signed-off-by: Finn Thain
    Signed-off-by: Greg Kroah-Hartman

    Finn Thain
     
  • PMU-based m68k Macs pre-date PowerMac-style NVRAM. Use the appropriate
    PMU commands. Also implement the missing XPRAM accessors for VIA-based
    Macs.

    Acked-by: Geert Uytterhoeven
    Tested-by: Stan Johnson
    Signed-off-by: Finn Thain
    Signed-off-by: Greg Kroah-Hartman

    Finn Thain
     
  • This is intended to improve code style and not affect code behaviour.

    Acked-by: Geert Uytterhoeven
    Tested-by: Stan Johnson
    Signed-off-by: Finn Thain
    Signed-off-by: Greg Kroah-Hartman

    Finn Thain
     
  • Adopt the existing *_read_byte and *_write_byte naming convention.
    Rename via_pram_readbyte and via_pram_writebyte to avoid confusion.
    Adjust calling conventions of mac_pram_* functions to match the
    struct nvram_ops methods.

    Acked-by: Geert Uytterhoeven
    Tested-by: Stan Johnson
    Signed-off-by: Finn Thain
    Signed-off-by: Greg Kroah-Hartman

    Finn Thain
     

21 Jan, 2019

3 commits

  • The comment says that calling the ROM routine doesn't work. But testing
    shows that the 68030 fall-back reset method does work, so just use that.

    Tested-by: Stan Johnson
    Signed-off-by: Finn Thain
    Signed-off-by: Geert Uytterhoeven

    Finn Thain
     
  • According to The Guide To Mac Family Hardware, this is the correct way
    to disable the VBL interrupt. The confusing comment here doesn't add any
    value so remove it.

    Signed-off-by: Finn Thain
    Signed-off-by: Geert Uytterhoeven

    Finn Thain
     
  • Those Mac models which don't connect their RTC to VIA1 port B probably
    have something else connected to those pins. Just leave them the way we
    found them. Make the port B setup conditional on via_type, to match the
    RTC accessors in arch/m68k/mac/misc.c.

    Signed-off-by: Finn Thain
    Signed-off-by: Geert Uytterhoeven

    Finn Thain
     

11 Dec, 2018

1 commit

  • Use %ptR instead of open coded variant to print content of
    struct rtc_time in human readable format.

    Cc: Geert Uytterhoeven
    Cc: linux-m68k
    Signed-off-by: Andy Shevchenko
    Reviewed-by: Geert Uytterhoeven
    Acked-by: Geert Uytterhoeven
    Signed-off-by: Alexandre Belloni

    Andy Shevchenko
     

08 Oct, 2018

1 commit

  • Now that the 68k Mac port has adopted the via-pmu driver, the same RTC
    code can be shared between m68k and powerpc. Replace duplicated code in
    arch/powerpc and arch/m68k with common RTC accessors for Cuda and PMU.

    Drop the problematic WARN_ON which was introduced in commit 22db552b50fa
    ("powerpc/powermac: Fix rtc read/write functions").

    Tested-by: Stan Johnson
    Signed-off-by: Finn Thain
    Cc: Geert Uytterhoeven
    Cc: Arnd Bergmann
    Acked-by: Geert Uytterhoeven
    Signed-off-by: Michael Ellerman

    Finn Thain
     

31 Aug, 2018

1 commit

  • Now that the 68k Mac port has adopted the via-pmu driver, it must decode
    the PMU response accordingly otherwise the date and time will be wrong.

    Fixes: ebd722275f9cfc67 ("macintosh/via-pmu: Replace via-pmu68k driver with via-pmu driver")
    Signed-off-by: Finn Thain
    Signed-off-by: Geert Uytterhoeven

    Finn Thain
     

18 Aug, 2018

1 commit

  • Pull powerpc updates from Michael Ellerman:
    "Notable changes:

    - A fix for a bug in our page table fragment allocator, where a page
    table page could be freed and reallocated for something else while
    still in use, leading to memory corruption etc. The fix reuses
    pt_mm in struct page (x86 only) for a powerpc only refcount.

    - Fixes to our pkey support. Several are user-visible changes, but
    bring us in to line with x86 behaviour and/or fix outright bugs.
    Thanks to Florian Weimer for reporting many of these.

    - A series to improve the hvc driver & related OPAL console code,
    which have been seen to cause hardlockups at times. The hvc driver
    changes in particular have been in linux-next for ~month.

    - Increase our MAX_PHYSMEM_BITS to 128TB when SPARSEMEM_VMEMMAP=y.

    - Remove Power8 DD1 and Power9 DD1 support, neither chip should be in
    use anywhere other than as a paper weight.

    - An optimised memcmp implementation using Power7-or-later VMX
    instructions

    - Support for barrier_nospec on some NXP CPUs.

    - Support for flushing the count cache on context switch on some IBM
    CPUs (controlled by firmware), as a Spectre v2 mitigation.

    - A series to enhance the information we print on unhandled signals
    to bring it into line with other arches, including showing the
    offending VMA and dumping the instructions around the fault.

    Thanks to: Aaro Koskinen, Akshay Adiga, Alastair D'Silva, Alexey
    Kardashevskiy, Alexey Spirkov, Alistair Popple, Andrew Donnellan,
    Aneesh Kumar K.V, Anju T Sudhakar, Arnd Bergmann, Bartosz Golaszewski,
    Benjamin Herrenschmidt, Bharat Bhushan, Bjoern Noetel, Boqun Feng,
    Breno Leitao, Bryant G. Ly, Camelia Groza, Christophe Leroy, Christoph
    Hellwig, Cyril Bur, Dan Carpenter, Daniel Klamt, Darren Stevens, Dave
    Young, David Gibson, Diana Craciun, Finn Thain, Florian Weimer,
    Frederic Barrat, Gautham R. Shenoy, Geert Uytterhoeven, Geoff Levand,
    Guenter Roeck, Gustavo Romero, Haren Myneni, Hari Bathini, Joel
    Stanley, Jonathan Neuschäfer, Kees Cook, Madhavan Srinivasan, Mahesh
    Salgaonkar, Markus Elfring, Mathieu Malaterre, Mauro S. M. Rodrigues,
    Michael Hanselmann, Michael Neuling, Michael Schmitz, Mukesh Ojha,
    Murilo Opsfelder Araujo, Nicholas Piggin, Parth Y Shah, Paul
    Mackerras, Paul Menzel, Ram Pai, Randy Dunlap, Rashmica Gupta, Reza
    Arbab, Rodrigo R. Galvao, Russell Currey, Sam Bobroff, Scott Wood,
    Shilpasri G Bhat, Simon Guo, Souptick Joarder, Stan Johnson, Thiago
    Jung Bauermann, Tyrel Datwyler, Vaibhav Jain, Vasant Hegde, Venkat
    Rao, zhong jiang"

    * tag 'powerpc-4.19-1' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: (234 commits)
    powerpc/mm/book3s/radix: Add mapping statistics
    powerpc/uaccess: Enable get_user(u64, *p) on 32-bit
    powerpc/mm/hash: Remove unnecessary do { } while(0) loop
    powerpc/64s: move machine check SLB flushing to mm/slb.c
    powerpc/powernv/idle: Fix build error
    powerpc/mm/tlbflush: update the mmu_gather page size while iterating address range
    powerpc/mm: remove warning about ‘type’ being set
    powerpc/32: Include setup.h header file to fix warnings
    powerpc: Move `path` variable inside DEBUG_PROM
    powerpc/powermac: Make some functions static
    powerpc/powermac: Remove variable x that's never read
    cxl: remove a dead branch
    powerpc/powermac: Add missing include of header pmac.h
    powerpc/kexec: Use common error handling code in setup_new_fdt()
    powerpc/xmon: Add address lookup for percpu symbols
    powerpc/mm: remove huge_pte_offset_and_shift() prototype
    powerpc/lib: Use patch_site to patch copy_32 functions once cache is enabled
    powerpc/pseries: Fix endianness while restoring of r3 in MCE handler.
    powerpc/fadump: merge adjacent memory ranges to reduce PT_LOAD segements
    powerpc/fadump: handle crash memory ranges array index overflow
    ...

    Linus Torvalds
     

31 Jul, 2018

2 commits


29 Jul, 2018

2 commits

  • Commit 397ac99c6cef ("m68k: remove dead timer code") removed set_rtc_mmss()
    because it was unused in 2012. However, this was itself the only user of the
    mach_set_clock_mmss() callback and the many implementations of that callback,
    which are equally unused.

    This removes all of those as well.

    Signed-off-by: Arnd Bergmann
    Acked-by: Greg Ungerer
    Signed-off-by: Geert Uytterhoeven

    Arnd Bergmann
     
  • The real-time clock on m68k (and powerpc) mac systems uses an unsigned
    32-bit value starting in 1904, which overflows in 2040, about two years
    later than everyone else, but this gets wrapped around in the Linux
    code in 2038 already because of the deprecated usage of time_t and/or
    long in the conversion.

    Getting rid of the deprecated interfaces makes it work until 2040 as
    documented, and it could be easily extended by reinterpreting
    the resulting time64_t as a positive number. For the moment, I'm
    adding a WARN_ON() that triggers if we encounter a time before 1970
    or after 2040 (the two are indistinguishable).

    This brings it in line with the corresponding code that we have on
    powerpc macintosh.

    Signed-off-by: Arnd Bergmann
    [fthain: Adopt __u32 for the union in via_read_time(), consistent with
    changes to via_write_time()]
    [fthain: Use lower_32_bits() in via_write_time(), consistent with changes
    to pmu_write_time() and cuda_write_time()]
    [fthain: Have via_read_time() return a time64_t, consistent with changes
    to pmu_read_time() and cuda_read_time()]
    [fthain: Drop the pointless wraparound conditional in via_read_time()]
    Signed-off-by: Finn Thain
    Reviewed-by: Arnd Bergmann
    [geert: Drop WARN_ON(), as it is reported to trigger on powermac]
    Signed-off-by: Geert Uytterhoeven

    Arnd Bergmann
     

23 Jul, 2018

1 commit


22 May, 2018

1 commit