From patchwork Tue Apr 30 11:38:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 163105 Delivered-To: patch@linaro.org Received: by 2002:a92:7e86:0:0:0:0:0 with SMTP id q6csp3118827ill; Tue, 30 Apr 2019 04:49:56 -0700 (PDT) X-Google-Smtp-Source: APXvYqxnh8tWzt2bINcKAz6dtvjV1CU21T0tJR0WV7WD6HR0fbnYEN/vywkt0d65DmDLm8gSNsyT X-Received: by 2002:a17:902:9a48:: with SMTP id x8mr21722393plv.133.1556624996382; Tue, 30 Apr 2019 04:49:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556624996; cv=none; d=google.com; s=arc-20160816; b=vdI4Q+Lg2AzipI2Yy0LMLDKxBiykF2caOpwBPRe5Em69FLJuWfMpe96erWJUT6cE7m v9yktn7FULbkLCsTnWzTAulnlfi05/zSs2cLTU3OrywQSz0IytwMFgIdizf8ol2cpvV5 kjomtVgtNU8rQ1ttcFXd4bsEXTyml94shDaW0x2PXn6cCxzNyV2iluoPWUxqaxXcQhTF fMtz0B8WWTds3mJhYSkLoHAboZWkvEi/vkyoeMz/Hahn6WQ9lABuAkPbFF++jTpRftFA I1V6DPwSM/1B1ToEfFl5k9N9c3ncO14SNmAOW8EyFRp2t9QQLz9lB4RB/anahlhYhywV ESpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Ot9GoE7PN3Xcsagv3xwuybkfXyuAjhkc1TmwYKFneSY=; b=rnh0fzxm3C5xjvb0w4Ij/H5f5iSzFrzpZNCfHiDNMgKCrn94s0lwwTCNqd0oxzSFks 4XIsK4ONA8gV2+yY+RzZi7iDY2xqu3GmNw5YZwjUBQ3clEgKWC8vymzUd0CWaSny55fZ pbGHWr2I0cjzOXTsxCKGKkqv51Wt92egcgaVpUFFqOO7aFVrsomKTrxzHMjfQWqeBklG Fzk1tvSxSWINSPwGmP3vXcGon5Q05hVKKaQEbbockxvs9OOZ7J4/KZAnSDlqXQ8edVTA If51N+UP7e6xNswWoVSmWZ1pRUuNibyU6EvKxzBcTt8z8Wkrz8yw+sapakjfh+xaO96X 7s5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yekqfFra; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l3si34122056pgj.136.2019.04.30.04.49.56; Tue, 30 Apr 2019 04:49:56 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yekqfFra; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731087AbfD3Lty (ORCPT + 30 others); Tue, 30 Apr 2019 07:49:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:36510 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731078AbfD3Ltw (ORCPT ); Tue, 30 Apr 2019 07:49:52 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 2D2BF2173E; Tue, 30 Apr 2019 11:49:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556624991; bh=TsZdpmCy1pcPB5gfC6C686aDfKiW4WLiHwcWOX4x58w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yekqfFra68Hqp5thEvG9aDcnnJAEhjuGjn4ZAIY3jp5txFBQtelGuaBdm9Z4mCWuu +66MSHflMMj1n5LFfe22fw/c3Qn1zrcpHA8oB5OkGdaE+Iy4aSSt+wOnE8fdEy5uYB Egl9lrtqt0D1f2kLIRd7G2cPxYG8kMPWGua9hsmQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Baolin Wang , Linus Walleij Subject: [PATCH 5.0 15/89] gpio: eic: sprd: Fix incorrect irq type setting for the sync EIC Date: Tue, 30 Apr 2019 13:38:06 +0200 Message-Id: <20190430113610.404625881@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190430113609.741196396@linuxfoundation.org> References: <20190430113609.741196396@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Baolin Wang commit 102bbe34b31c9159e714432afd64458f6f3876d7 upstream. When setting sync EIC as IRQ_TYPE_EDGE_BOTH type, we missed to set the SPRD_EIC_SYNC_INTMODE register to 0, which means detecting edge signals. Thus this patch fixes the issue. Fixes: 25518e024e3a ("gpio: Add Spreadtrum EIC driver support") Cc: Signed-off-by: Baolin Wang Signed-off-by: Linus Walleij Signed-off-by: Greg Kroah-Hartman --- drivers/gpio/gpio-eic-sprd.c | 1 + 1 file changed, 1 insertion(+) --- a/drivers/gpio/gpio-eic-sprd.c +++ b/drivers/gpio/gpio-eic-sprd.c @@ -414,6 +414,7 @@ static int sprd_eic_irq_set_type(struct irq_set_handler_locked(data, handle_edge_irq); break; case IRQ_TYPE_EDGE_BOTH: + sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTMODE, 0); sprd_eic_update(chip, offset, SPRD_EIC_SYNC_INTBOTH, 1); irq_set_handler_locked(data, handle_edge_irq); break; From patchwork Tue Apr 30 11:38:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 163108 Delivered-To: patch@linaro.org Received: by 2002:a92:7e86:0:0:0:0:0 with SMTP id q6csp3125061ill; Tue, 30 Apr 2019 04:56:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqytIMZ17olFibv8ZPwEKmFErDjll6QFUl3LoXH+jTfjUVyntY62q5fEDhdLOhQM2d3e6Fd4 X-Received: by 2002:a63:d709:: with SMTP id d9mr23879417pgg.38.1556625404235; Tue, 30 Apr 2019 04:56:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556625404; cv=none; d=google.com; s=arc-20160816; b=MldKzIlmeIxqlie8N9DyNQU1txOB9Skd0NTVGtLo4HapEc+gaykGM2OFl6xabqPOaF 5FD7H/2qXAfDUgLsKqNIUc7lpQk9E9VIFSaDhxvX3Irj4k1gHX1LUUHm1jJCLSPcTfHp 6X/NMmPuB2GPGGBkrawb6Lv95m5Lv5mTlCU6UKGddNypb+XEfUngSePIhnV+nrSgq2zV 1EkU4+4sueVsa5PoHPzShpdHpNlY6hiBSqClklokB2C8uSVtHv19zW4hf69xvsEwdXM6 9gSHeOIcGxUzYYGHnVtzLNaxNjjwQIG2DtTKCZE2gfpw/j1+yYLgF+qTraHIhbJnSlmd mWOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=8ymL4F1REAmxCrveF1TsJGM/pieulMMUoOWbdJpTs3k=; b=KrGwjm7Z1700zpa6TAPWlXEDGtnkXxkkxUb9xJOTrYq7FX9gLjK6JP3eFlMrA6O22V 4H6E3qcNGdeNOUa6SMY4+PVBDthJK6s79aPx5zAFECy4ANIb2pCuO6XnMVWZTVCJHWQn 1D6TfG5SSDJKFjGPcIo4fe/JeOuVyuDw+81GKwKCcgFGXmgc8RF7d3aabHdWwfeR4IE+ BgG54/EwOK7CCDJ55lv2CjHPIEnLUxCZFTRoIj9cX9pFZaSZYwiYBZbPSqHSY/hlK1PJ qAgmat+YOMr3c2fDc/FaBwMwZkoVL8hG6PohJ2X6UyXlMaAPkv9/xTJwrScjY7lTEpZV c8PQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aG2XUpM6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n3si38105443plb.148.2019.04.30.04.56.43; Tue, 30 Apr 2019 04:56:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aG2XUpM6; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727215AbfD3L4m (ORCPT + 30 others); Tue, 30 Apr 2019 07:56:42 -0400 Received: from mail.kernel.org ([198.145.29.99]:34788 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730875AbfD3Lsg (ORCPT ); Tue, 30 Apr 2019 07:48:36 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3FFC520449; Tue, 30 Apr 2019 11:48:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556624915; bh=ZjSnPPE3GJxDV7BkqDZlz1xwMuO9b69kcF0NnUB0768=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aG2XUpM6BO/3Txynx4zXmYTbE0uvEiEDlXpaThnyxPiZ5IL3NIFd8IGyJWF7sCD9v KXQSUSM5Oyfh0Vaj/htIwsDvUcH7tsL3B9wW8hVmzP/vzrITlgTUa23kRKzHT9Fz+T fOZohROoE3KYCy3SmTjlxM1Xm6d5npzyzjyrYcn4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Will Deacon , Bjorn Andersson , Catalin Marinas Subject: [PATCH 5.0 21/89] arm64: mm: Ensure tail of unaligned initrd is reserved Date: Tue, 30 Apr 2019 13:38:12 +0200 Message-Id: <20190430113611.059391513@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190430113609.741196396@linuxfoundation.org> References: <20190430113609.741196396@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bjorn Andersson commit d4d18e3ec6091843f607e8929a56723e28f393a6 upstream. In the event that the start address of the initrd is not aligned, but has an aligned size, the base + size will not cover the entire initrd image and there is a chance that the kernel will corrupt the tail of the image. By aligning the end of the initrd to a page boundary and then subtracting the adjusted start address the memblock reservation will cover all pages that contains the initrd. Fixes: c756c592e442 ("arm64: Utilize phys_initrd_start/phys_initrd_size") Cc: stable@vger.kernel.org Acked-by: Will Deacon Signed-off-by: Bjorn Andersson Signed-off-by: Catalin Marinas Signed-off-by: Greg Kroah-Hartman --- arch/arm64/mm/init.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/arm64/mm/init.c +++ b/arch/arm64/mm/init.c @@ -406,7 +406,7 @@ void __init arm64_memblock_init(void) * Otherwise, this is a no-op */ u64 base = phys_initrd_start & PAGE_MASK; - u64 size = PAGE_ALIGN(phys_initrd_size); + u64 size = PAGE_ALIGN(phys_initrd_start + phys_initrd_size) - base; /* * We can only add back the initrd memory if we don't end up From patchwork Tue Apr 30 11:38:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 163104 Delivered-To: patch@linaro.org Received: by 2002:a92:7e86:0:0:0:0:0 with SMTP id q6csp3118564ill; Tue, 30 Apr 2019 04:49:37 -0700 (PDT) X-Google-Smtp-Source: APXvYqxP/D4C/z9uqnN7OaekCKtu6HmOpldE9QDr5BcAl3rflq3kXs7Tvvh9B/P3AD6h1ydMjDRh X-Received: by 2002:a63:2c06:: with SMTP id s6mr66024456pgs.245.1556624977913; Tue, 30 Apr 2019 04:49:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556624977; cv=none; d=google.com; s=arc-20160816; b=lgz2jVU3L2iP7JdVgroCuOVJtxKtrfLDGK2kmE7Kx4TuESet3FWxODAwiTD7fL5Quv c0YKxRlNeRZbg6KmdDuvEXU6HEMJLqobuVhvhmTACDdkuTMtpKRV6cWAq92S2s6s1pNA sAbzG70kxvDoT6iXqdbTsxC1+e/JNcv1k66tLrCAEweQVSYDpxgqyKrpz+vFM86BsUce fmMEk6yWHqGibYdrV4GfFo6TsGuSAgG3BHgJuxKmAErR7OZVFh4nM5BA6Jpjgf+eWYSi 7Waz8btv+EiYJVFBHzOn3tWp5smVz9GxvHHQ54uKOtcEUtjAPn8sJPYg5wIn9sWQyISR 5sPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=8TRkLvBA98VYvbFo+K1En4i1cTrCXVSWbu/kS90xncw=; b=M/711PNlo8Qd+4q3MpfqR2RwVOrGUu7zjBFHwPRDcQTnUi8KBxl00BZq76DDM/8riS 8cpETYF2n/DD+weyoZ3nBI0KaNxCgZonEgronaWy7bGBF3QRDhtcuBXgGl564qZDefuV bzcRj8fV9UpidU7m1VneSYM3cKj1VQoBhgGw4VLCJbfq/ga2qXCvZEymOvoscDHMLbTZ tJ/Vn2VeDMKf2HZkc9WdUH1SHlZWjL5zgQizirpyUn5gN92ZeFWYJRN6FA2/LPeja5qn CbVeUt8Ty/a3h1LxRqY32ZzJEih5U/VNifQpdcr40JOYaatdyuRi9j9xwBfC2AOiDk0l GPSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ApLgYCaU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h126si35209237pgc.508.2019.04.30.04.49.37; Tue, 30 Apr 2019 04:49:37 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ApLgYCaU; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731018AbfD3Ltf (ORCPT + 30 others); Tue, 30 Apr 2019 07:49:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:36080 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730709AbfD3Ltb (ORCPT ); Tue, 30 Apr 2019 07:49:31 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4F84921734; Tue, 30 Apr 2019 11:49:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556624970; bh=9wjh8KhDFWxat4RFS8FnsuU4lCY2MRrx7waCkkCQFj8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ApLgYCaUFnLhuRsBl3zlGbpDChZLk2FFww1ChjRkBjFJiTy9tmiMtEWJ1dm/nfFfz fJ3gFYYRChYK/PSRCKOF9jmbv9eJJcSeItrh+ygEUNqsfon+EUoiz1jGfA9HKFZtpp OPh/8J9OqgV3Ap6Qh3loMKEw1/WD08CAwDQLUHLg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Marc Zyngier , Ard Biesheuvel , Russell King Subject: [PATCH 5.0 40/89] ARM: 8857/1: efi: enable CP15 DMB instructions before cleaning the cache Date: Tue, 30 Apr 2019 13:38:31 +0200 Message-Id: <20190430113611.689521185@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190430113609.741196396@linuxfoundation.org> References: <20190430113609.741196396@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ard Biesheuvel commit e17b1af96b2afc38e684aa2f1033387e2ed10029 upstream. The EFI stub is entered with the caches and MMU enabled by the firmware, and once the stub is ready to hand over to the decompressor, we clean and disable the caches. The cache clean routines use CP15 barrier instructions, which can be disabled via SCTLR. Normally, when using the provided cache handling routines to enable the caches and MMU, this bit is enabled as well. However, but since we entered the stub with the caches already enabled, this routine is not executed before we call the cache clean routines, resulting in undefined instruction exceptions if the firmware never enabled this bit. So set the bit explicitly in the EFI entry code, but do so in a way that guarantees that the resulting code can still run on v6 cores as well (which are guaranteed to have CP15 barriers enabled) Cc: # v4.9+ Acked-by: Marc Zyngier Signed-off-by: Ard Biesheuvel Signed-off-by: Russell King Signed-off-by: Greg Kroah-Hartman --- arch/arm/boot/compressed/head.S | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) --- a/arch/arm/boot/compressed/head.S +++ b/arch/arm/boot/compressed/head.S @@ -1438,7 +1438,21 @@ ENTRY(efi_stub_entry) @ Preserve return value of efi_entry() in r4 mov r4, r0 - bl cache_clean_flush + + @ our cache maintenance code relies on CP15 barrier instructions + @ but since we arrived here with the MMU and caches configured + @ by UEFI, we must check that the CP15BEN bit is set in SCTLR. + @ Note that this bit is RAO/WI on v6 and earlier, so the ISB in + @ the enable path will be executed on v7+ only. + mrc p15, 0, r1, c1, c0, 0 @ read SCTLR + tst r1, #(1 << 5) @ CP15BEN bit set? + bne 0f + orr r1, r1, #(1 << 5) @ CP15 barrier instructions + mcr p15, 0, r1, c1, c0, 0 @ write SCTLR + ARM( .inst 0xf57ff06f @ v7+ isb ) + THUMB( isb ) + +0: bl cache_clean_flush bl cache_off @ Set parameters for booting zImage according to boot protocol From patchwork Tue Apr 30 11:39:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 163107 Delivered-To: patch@linaro.org Received: by 2002:a92:7e86:0:0:0:0:0 with SMTP id q6csp3121668ill; Tue, 30 Apr 2019 04:53:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqygyBzgu9cV5zP/QqLrQrZ2IEFGU5x3F2iZ32WW2sdCjX1/vyCrr5BrQAdsq4T/sit6G/yE X-Received: by 2002:a63:4b20:: with SMTP id y32mr66026932pga.244.1556625180346; Tue, 30 Apr 2019 04:53:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556625180; cv=none; d=google.com; s=arc-20160816; b=PzxaLalcUIPvBk4cNFWYmwZj4M0bqMJqp0pM5qEtWMclIzj97J6RjG/Oq+G/Wt7c4m 3xfIbGozRodlalCqHbaSY+3R2GvhzvdgFV0UhR3lkrE/pqm8ol0ctrrEuHQmYof1r40K X83fTKh+oiY7eqhwsDfV4THDLKIHvgAP97Pe0gYyCVlfaMcb4cruCtVOkZhiCY5d5K/x SKlcJ/3DyXPeHr/k1GSepqKKP8NUFi9lm2KndulnRsxSxFYJD6p8Itp7lkm0QV20MFEU jxG245Ug919m7vv8RpxufJoFMHNhtlL5O0Hi7S5KfKq5DZGfRzhXbSWS6ooHHU2lb/xK Rb+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=QcpAQVUFQNvbLGN+oPB/j9+mloKut8jPG6E7qDOVtGw=; b=gOZLsrzJBcCJkI3dMNjLy3li3e1cWXHHCeMnaSOh7aH0XYxszK5yxrUBmpdSNWjjsx fGF2XguCqF8It2Zwd6QquPTxm6bev2NVx3n+twRwXZTWUxqJKofUMjNJsix3vx948pcQ IG/oMUXZ4LzYG3cDNQfeJC9avMoGlQqVyPYoyqXjKpF5YtYUdK4p6QIdMDNHpcfq5HJf 2647T9vuQtuIRcFo4Vsbs4oxsXsCJLkgeYs3y91m3BagW0gfwc5lmFJvFd43nP3ypIou tz55rZ5pflZfQ91NSI5ursqRhMb9cs4GPvbXS8sj50pA/2RJxY/lzMTx0kAVDLJk3STw gNwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=auu5QSDg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x23si22566740plr.48.2019.04.30.04.53.00; Tue, 30 Apr 2019 04:53:00 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=auu5QSDg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731355AbfD3LvO (ORCPT + 30 others); Tue, 30 Apr 2019 07:51:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:38646 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731341AbfD3LvJ (ORCPT ); Tue, 30 Apr 2019 07:51:09 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AE76420449; Tue, 30 Apr 2019 11:51:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556625069; bh=vek708XiY9jinTBwmhYxGV6IqDP7VclEldcAHu22gA0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=auu5QSDgz7vDfdbkQCFO1EoGZ/UuULiIwfb1ButX0JH2dFlL0YEf8FFi0QP3x1Ipb L4BwuxqNBFnf3K0Q2H672O6h8BBW7nbw7m96jos1WhG/n8f6IqhPb+mZjvADI8/teA OE5BKH8vE0YttJSxwnBbkjLNiD96ObWtCL+qgI+E= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Xiaofei Shen , Sneh Shah , Vinod Koul , Andrew Lunn , "David S. Miller" Subject: [PATCH 5.0 78/89] net: stmmac: move stmmac_check_ether_addr() to driver probe Date: Tue, 30 Apr 2019 13:39:09 +0200 Message-Id: <20190430113613.428250383@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190430113609.741196396@linuxfoundation.org> References: <20190430113609.741196396@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Vinod Koul [ Upstream commit b561af36b1841088552464cdc3f6371d92f17710 ] stmmac_check_ether_addr() checks the MAC address and assigns one in driver open(). In many cases when we create slave netdevice, the dev addr is inherited from master but the master dev addr maybe NULL at that time, so move this call to driver probe so that address is always valid. Signed-off-by: Xiaofei Shen Tested-by: Xiaofei Shen Signed-off-by: Sneh Shah Signed-off-by: Vinod Koul Reviewed-by: Andrew Lunn Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c @@ -2590,8 +2590,6 @@ static int stmmac_open(struct net_device u32 chan; int ret; - stmmac_check_ether_addr(priv); - if (priv->hw->pcs != STMMAC_PCS_RGMII && priv->hw->pcs != STMMAC_PCS_TBI && priv->hw->pcs != STMMAC_PCS_RTBI) { @@ -4265,6 +4263,8 @@ int stmmac_dvr_probe(struct device *devi if (ret) goto error_hw_init; + stmmac_check_ether_addr(priv); + /* Configure real RX and TX queues */ netif_set_real_num_rx_queues(ndev, priv->plat->rx_queues_to_use); netif_set_real_num_tx_queues(ndev, priv->plat->tx_queues_to_use); From patchwork Tue Apr 30 11:39:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 163106 Delivered-To: patch@linaro.org Received: by 2002:a92:7e86:0:0:0:0:0 with SMTP id q6csp3121573ill; Tue, 30 Apr 2019 04:52:55 -0700 (PDT) X-Google-Smtp-Source: APXvYqzdJ+wbG+mhDNszGgOGpDuljs2T4GgX4w4umytQeuONI3quN5aGnFnVKf0dVE+SA3zUfSUe X-Received: by 2002:a62:5915:: with SMTP id n21mr14389629pfb.180.1556625175015; Tue, 30 Apr 2019 04:52:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1556625175; cv=none; d=google.com; s=arc-20160816; b=E3hUmW3UgVbdqpjXF1TML3gkyf8PoSp/vKsX9ncDHC03qMdSkPhjPHqTG7o/mXSWlv YzCb24ExVSpQvomNfDKPUqb6WAZ5xo3errIEKBDG3P8bx0gnLDole8t2gcG9xnE7Dcdj YnTP+g1JQcIsUH7i/rCZ1Hjv4UOkMs+imL3IdF2kioNFa457i2Dgnogaz6VEEZiHYpHG SOQnAHE1NGfP/PIHNHPiBwneljtCNLx0hSkD/SZvJeyDiXrsGC7tZSWXlPPcQ76rTiAd N6eUArDLIK+ZJZM3HKakzULZ7qJrsCxQmPpFOj9dtj8UGAAa/y6GRZP/VSThlviMUVCT EiKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=zEDVWTkwDSxYB5kNdE46oB6IXcb24SH0GPT312r5pDo=; b=h7wKZCbN4foc4M3v3q0Nbxe9rFT5zQRMWLnI3JP1bsIz+GiCIl1lcDt5i5qfRvhDZa 6GBt4SMQLqbXwGKhnQ2ZIBwcbqX4Px8Ru4PWllpW/yYHretFBk6yRzkhQOpTF3e7ie5T O5/XgcRAUD151V6nwOX4TAqvHXiyVZlMiNrNMyhyih/c+vxYVHWUb5Tx1m34KlOUNU8T pP2B6PBQlHoKXfWp4KkzP1GXVj39fwLDzI8390lqc4gybAl79g9N2xKqCFFEsyi73Kth VikEgd755W/31Co4H6iFYn0yZ70idPlQ/LYlautTjFddiznKOHYUcYXImuRiTUzTh1zJ dGZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="pOk/Yf7l"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n6si29534665pgv.458.2019.04.30.04.52.54; Tue, 30 Apr 2019 04:52:55 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="pOk/Yf7l"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730969AbfD3Lwx (ORCPT + 30 others); Tue, 30 Apr 2019 07:52:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:38994 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731361AbfD3LvU (ORCPT ); Tue, 30 Apr 2019 07:51:20 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 504362054F; Tue, 30 Apr 2019 11:51:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1556625079; bh=OdYzluc1D8RkQFvapLx5SNZPZ7XFPmP5OcuUtZr9ZEw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pOk/Yf7l7iPUV3L2N3K6NAL+H1o4F3Kl/dT7Lb/5vfQCeJSu+Qxq8vbCB4yrFe2JU VQ06Ti1Pvjmnc8ZTdTQu2otQ1/Z7Tlofmb2ZEP3vrbm1YanHWmb0l9rP705ie3KtjQ Es4Nj8bM6tAeJXnM2VcmkkSSsvSERvEsuyiETiR0= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ard Biesheuvel , Jassi Brar , Ilias Apalodimas , "David S. Miller" Subject: [PATCH 5.0 82/89] net: socionext: replace napi_alloc_frag with the netdev variant on init Date: Tue, 30 Apr 2019 13:39:13 +0200 Message-Id: <20190430113613.629688800@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190430113609.741196396@linuxfoundation.org> References: <20190430113609.741196396@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ilias Apalodimas [ Upstream commit ffbf9870dcf1342592a1a26f4cf70bda39046134 ] The netdev variant is usable on any context since it disables interrupts. The napi variant of the call should only be used within softirq context. Replace napi_alloc_frag on driver init with the correct netdev_alloc_frag call Changes since v1: - Adjusted commit message Acked-by: Ard Biesheuvel Acked-by: Jassi Brar Fixes: 4acb20b46214 ("net: socionext: different approach on DMA") Signed-off-by: Ilias Apalodimas Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/socionext/netsec.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) --- a/drivers/net/ethernet/socionext/netsec.c +++ b/drivers/net/ethernet/socionext/netsec.c @@ -673,7 +673,8 @@ static void netsec_process_tx(struct net } static void *netsec_alloc_rx_data(struct netsec_priv *priv, - dma_addr_t *dma_handle, u16 *desc_len) + dma_addr_t *dma_handle, u16 *desc_len, + bool napi) { size_t total_len = SKB_DATA_ALIGN(sizeof(struct skb_shared_info)); size_t payload_len = NETSEC_RX_BUF_SZ; @@ -682,7 +683,7 @@ static void *netsec_alloc_rx_data(struct total_len += SKB_DATA_ALIGN(payload_len + NETSEC_SKB_PAD); - buf = napi_alloc_frag(total_len); + buf = napi ? napi_alloc_frag(total_len) : netdev_alloc_frag(total_len); if (!buf) return NULL; @@ -765,7 +766,8 @@ static int netsec_process_rx(struct nets /* allocate a fresh buffer and map it to the hardware. * This will eventually replace the old buffer in the hardware */ - buf_addr = netsec_alloc_rx_data(priv, &dma_handle, &desc_len); + buf_addr = netsec_alloc_rx_data(priv, &dma_handle, &desc_len, + true); if (unlikely(!buf_addr)) break; @@ -1069,7 +1071,8 @@ static int netsec_setup_rx_dring(struct void *buf; u16 len; - buf = netsec_alloc_rx_data(priv, &dma_handle, &len); + buf = netsec_alloc_rx_data(priv, &dma_handle, &len, + false); if (!buf) { netsec_uninit_pkt_dring(priv, NETSEC_RING_RX); goto err_out;