From patchwork Wed Jul 24 19:19:15 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 169651 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp10701738ilk; Wed, 24 Jul 2019 13:27:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqzHUSPTmwYXFQnMvOy4pEcctQYUyLvTn/clOjFE2UynHtUG2RxfRZou08mlsYspghOj65/y X-Received: by 2002:a17:902:2006:: with SMTP id n6mr89456380pla.232.1564000071496; Wed, 24 Jul 2019 13:27:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564000071; cv=none; d=google.com; s=arc-20160816; b=ja8gYCHPiEmsGW9g4qh8qkNwQrVD/BRywU01R2o2eTSnvA1Rfa659AANuQK1F6wnoE 55zIho9lrTz8qjchotHJmoMUGNms1YvsnToq9TAHsF3Kkdmbp2g7+MyrJneqtHmD2t1U umzOGDJfNbISw3Ko+ZU0Ih/ujyg+RHpTnruR9sMCt9aTlttdL6VctHBq8lMxrgExQLhE peFaHoDokje1Hwa/f3vNMUxMfS6PJT8/hCTtx71Rw9WNlcxQHbagmOGL5hIItJwLwIUj 4P2cfWnvwTwV3biqiZ0irK4w9oawe1q9SxbB8e55iq4gHrCJ0xhWt+FwBycOg4yhy4Kv QgHA== 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=LA43Y+qJpSIwh4EzSlDVS2LeMD9bA7fSDFLTQ2y2EX0=; b=IJn971Z5ata5Ph02gpAZnRvEFHDVuK9x2Z4vQFssJKqcKdyxEvph/0LvDLNY0QsWck kmxIgrLKibyRPDUmggactQl0mB36o9FFPOnPIe5UkY4Th/Vra1RARpflKfy5/Pf4A7u5 g76Jf59nJjhy/t2TQ6zLkkvQdTWHMx0Z1vwe/gBCuewo9tmT6ZHhyv3MofUiaaMKGf8a H67EtZtNVFliRB9SImaFoMZHXntKQXI7BRYgE3aR2bq6tOWWijnfFygaZA8tbyTC9VPo m92H3vGyzANVyRCBd2+CcwxtkEWdkJdkeYiT6aGdlr6mnDl6v3Xjen72nyKcdVWoM9Lb eojg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=BtfoiRHJ; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 u2si14320553pjb.25.2019.07.24.13.27.50; Wed, 24 Jul 2019 13:27:51 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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=BtfoiRHJ; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388365AbfGXU1t (ORCPT + 14 others); Wed, 24 Jul 2019 16:27:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:60262 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389201AbfGXTf0 (ORCPT ); Wed, 24 Jul 2019 15:35:26 -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 C47B421951; Wed, 24 Jul 2019 19:35:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563996925; bh=4g3R6gamTRzQOqVc+zMXK0Qvwcpv4izx9jeryaWRd/k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BtfoiRHJnAizXLZuButMETl0kn7uqbo9V+E4sI2z7iT7Shh815LUz9gSgKhq1WAFp E+GAB8tF4Sl/XHwKwqMEsY9Gc8tZrSd66QOhW5Jjpb+B60z/6K6thYJY2Efovlt+Ne aORVxJVx0VhKhzcQIqGpMKJtmL/TLA5G91zshUhw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Horia Geanta , Iuliana Prodan , Sascha Hauer , Ard Biesheuvel , Herbert Xu Subject: [PATCH 5.2 264/413] crypto: caam - limit output IV to CBC to work around CTR mode DMA issue Date: Wed, 24 Jul 2019 21:19:15 +0200 Message-Id: <20190724191755.063425339@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191735.096702571@linuxfoundation.org> References: <20190724191735.096702571@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Ard Biesheuvel commit ed527b13d800dd515a9e6c582f0a73eca65b2e1b upstream. The CAAM driver currently violates an undocumented and slightly controversial requirement imposed by the crypto stack that a buffer referred to by the request structure via its virtual address may not be modified while any scatterlists passed via the same request structure are mapped for inbound DMA. This may result in errors like alg: aead: decryption failed on test 1 for gcm_base(ctr-aes-caam,ghash-generic): ret=74 alg: aead: Failed to load transform for gcm(aes): -2 on non-cache coherent systems, due to the fact that the GCM driver passes an IV buffer by virtual address which shares a cacheline with the auth_tag buffer passed via a scatterlist, resulting in corruption of the auth_tag when the IV is updated while the DMA mapping is live. Since the IV that is returned to the caller is only valid for CBC mode, and given that the in-kernel users of CBC (such as CTS) don't trigger the same issue as the GCM driver, let's just disable the output IV generation for all modes except CBC for the time being. Fixes: 854b06f76879 ("crypto: caam - properly set IV after {en,de}crypt") Cc: Horia Geanta Cc: Iuliana Prodan Reported-by: Sascha Hauer Cc: Signed-off-by: Ard Biesheuvel Reviewed-by: Horia Geanta Signed-off-by: Herbert Xu Signed-off-by: Greg Kroah-Hartman --- drivers/crypto/caam/caamalg.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) --- a/drivers/crypto/caam/caamalg.c +++ b/drivers/crypto/caam/caamalg.c @@ -999,6 +999,7 @@ static void skcipher_encrypt_done(struct struct skcipher_request *req = context; struct skcipher_edesc *edesc; struct crypto_skcipher *skcipher = crypto_skcipher_reqtfm(req); + struct caam_ctx *ctx = crypto_skcipher_ctx(skcipher); int ivsize = crypto_skcipher_ivsize(skcipher); #ifdef DEBUG @@ -1023,9 +1024,9 @@ static void skcipher_encrypt_done(struct /* * The crypto API expects us to set the IV (req->iv) to the last - * ciphertext block. This is used e.g. by the CTS mode. + * ciphertext block when running in CBC mode. */ - if (ivsize) + if ((ctx->cdata.algtype & OP_ALG_AAI_MASK) == OP_ALG_AAI_CBC) scatterwalk_map_and_copy(req->iv, req->dst, req->cryptlen - ivsize, ivsize, 0); @@ -1843,9 +1844,9 @@ static int skcipher_decrypt(struct skcip /* * The crypto API expects us to set the IV (req->iv) to the last - * ciphertext block. + * ciphertext block when running in CBC mode. */ - if (ivsize) + if ((ctx->cdata.algtype & OP_ALG_AAI_MASK) == OP_ALG_AAI_CBC) scatterwalk_map_and_copy(req->iv, req->src, req->cryptlen - ivsize, ivsize, 0); From patchwork Wed Jul 24 19:20:04 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 169639 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp10654806ilk; Wed, 24 Jul 2019 12:37:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqx16cU2yYDraLYRV5JdX2CC6rIUnLDU/cK2RQurWSiKgdphHjHTQUxeVi3sUgDIzKwJHW3K X-Received: by 2002:a17:90a:9b08:: with SMTP id f8mr89762156pjp.103.1563997079720; Wed, 24 Jul 2019 12:37:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563997079; cv=none; d=google.com; s=arc-20160816; b=uAl4rpd7IAQNeEyblogfjm/x+NBpK3kJjN5jAoMMuZcPhHRGs/r8LjQTa0wgjbe8Gb iy5hCpzPIWoAk8HDHRA0PeEpFqCHljPfID1pTo2mglek53LdoGN3L2IK+vHD6TamR32E gkapz9qc5ag9O6AQGrlaiqpOf7u+dNdXAxeVfzrtrubXX+KcAWZElxE2G6KclJAThhNX F3md+icuit0MlG8ZSX37kzwUrdB6QQkXzVnKzE9cvHS5Q3VyNwQP55cQCpSJCHT53Zhn 6SKNx9rE7p6xPMVyxdnEwIorcEyxByHRpq0eM0h/C9oEC2ZCN66WPYkNinx2xqmgnu57 GFlA== 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=Ddy6K3k8HqEaMTzOLzO91pz39JSMxLZHCmY0NszXBcA=; b=Vn/dqq5U3SiRL1RzAUT5+e3qOGAr9WFeWMhbl3FP0G0DfsolED/am+HcjS2eCfhzKI Qx3z3OF2oj5F1ptA8HsWFixeCVH5XJ3lr+lRpYuWiNFzgWMZHNfZtsplqhcV9e1ta/fN qavX1fWqFYubv5qJHyqO4eWdJ/NiI1ESBumfoanvar16MB5BxajJ8+J416aFy9qYPG7l NlCuwJFBqho60RgTkUoHf+Ve7kmQTMFG7acuooAH5YIlqzhmitnJ6m80jnDGVXCIQzf4 VIYYtGXAoOcjUcjMF7g8z+qx6nfzLilc+b/klHcoZqwXo01fUIctWBfUlFe5Zy+shHn4 dqGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ISsVFTIz; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 z4si14789254pgr.69.2019.07.24.12.37.59; Wed, 24 Jul 2019 12:37:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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=ISsVFTIz; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389527AbfGXTh5 (ORCPT + 14 others); Wed, 24 Jul 2019 15:37:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:38318 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389540AbfGXTh5 (ORCPT ); Wed, 24 Jul 2019 15:37:57 -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 C3418214AF; Wed, 24 Jul 2019 19:37:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563997075; bh=E67kZ8zzzqTQ5J5MynkC3lzm6IEtSSEy1heumXorpFc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ISsVFTIz022oDxhTNmaSzms64zK9liGTAhMVzNSA84z5Zac9jfmfXEaBy/0X08Grq IH/Z4z5nr3BhUU394NYGrOeUC1l+tWyhXiDE1Tl4vGiDNu4YkNOrA5xsxmsSwTJ1Qv EioxYD1kNXbICOgnfas88oO75dD6gdehMrp1eHbg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?utf-8?q?Joonas_Kylm=C3=A4l=C3=A4?= , Masahiro Yamada Subject: [PATCH 5.2 313/413] kconfig: fix missing choice values in auto.conf Date: Wed, 24 Jul 2019 21:20:04 +0200 Message-Id: <20190724191758.196717742@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191735.096702571@linuxfoundation.org> References: <20190724191735.096702571@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Masahiro Yamada commit 8e2442a5f86e1f77b86401fce274a7f622740bc4 upstream. Since commit 00c864f8903d ("kconfig: allow all config targets to write auto.conf if missing"), Kconfig creates include/config/auto.conf in the defconfig stage when it is missing. Joonas Kylmälä reported incorrect auto.conf generation under some circumstances. To reproduce it, apply the following diff: | --- a/arch/arm/configs/imx_v6_v7_defconfig | +++ b/arch/arm/configs/imx_v6_v7_defconfig | @@ -345,14 +345,7 @@ CONFIG_USB_CONFIGFS_F_MIDI=y | CONFIG_USB_CONFIGFS_F_HID=y | CONFIG_USB_CONFIGFS_F_UVC=y | CONFIG_USB_CONFIGFS_F_PRINTER=y | -CONFIG_USB_ZERO=m | -CONFIG_USB_AUDIO=m | -CONFIG_USB_ETH=m | -CONFIG_USB_G_NCM=m | -CONFIG_USB_GADGETFS=m | -CONFIG_USB_FUNCTIONFS=m | -CONFIG_USB_MASS_STORAGE=m | -CONFIG_USB_G_SERIAL=m | +CONFIG_USB_FUNCTIONFS=y | CONFIG_MMC=y | CONFIG_MMC_SDHCI=y | CONFIG_MMC_SDHCI_PLTFM=y And then, run: $ make ARCH=arm mrproper imx_v6_v7_defconfig You will see CONFIG_USB_FUNCTIONFS=y is correctly contained in the .config, but not in the auto.conf. Please note drivers/usb/gadget/legacy/Kconfig is included from a choice block in drivers/usb/gadget/Kconfig. So USB_FUNCTIONFS is a choice value. This is probably a similar situation described in commit beaaddb62540 ("kconfig: tests: test defconfig when two choices interact"). When sym_calc_choice() is called, the choice symbol forgets the SYMBOL_DEF_USER unless all of its choice values are explicitly set by the user. The choice symbol is given just one chance to recall it because set_all_choice_values() is called if SYMBOL_NEED_SET_CHOICE_VALUES is set. When sym_calc_choice() is called again, the choice symbol forgets it forever, since SYMBOL_NEED_SET_CHOICE_VALUES is a one-time aid. Hence, we cannot call sym_clear_all_valid() again and again. It is crazy to repeat set and unset of internal flags. However, we cannot simply get rid of "sym->flags &= flags | ~SYMBOL_DEF_USER;" Doing so would re-introduce the problem solved by commit 5d09598d488f ("kconfig: fix new choices being skipped upon config update"). To work around the issue, conf_write_autoconf() stopped calling sym_clear_all_valid(). conf_write() must be changed accordingly. Currently, it clears SYMBOL_WRITE after the symbol is written into the .config file. This is needed to prevent it from writing the same symbol multiple times in case the symbol is declared in two or more locations. I added the new flag SYMBOL_WRITTEN, to track the symbols that have been written. Anyway, this is a cheesy workaround in order to suppress the issue as far as defconfig is concerned. Handling of choices is totally broken. sym_clear_all_valid() is called every time a user touches a symbol from the GUI interface. To reproduce it, just add a new symbol drivers/usb/gadget/legacy/Kconfig, then touch around unrelated symbols from menuconfig. USB_FUNCTIONFS will disappear from the .config file. I added the Fixes tag since it is more fatal than before. But, this has been broken since long long time before, and still it is. We should take a closer look to fix this correctly somehow. Fixes: 00c864f8903d ("kconfig: allow all config targets to write auto.conf if missing") Cc: linux-stable # 4.19+ Reported-by: Joonas Kylmälä Signed-off-by: Masahiro Yamada Tested-by: Joonas Kylmälä Signed-off-by: Greg Kroah-Hartman --- scripts/kconfig/confdata.c | 7 +++---- scripts/kconfig/expr.h | 1 + 2 files changed, 4 insertions(+), 4 deletions(-) --- a/scripts/kconfig/confdata.c +++ b/scripts/kconfig/confdata.c @@ -914,7 +914,8 @@ int conf_write(const char *name) "# %s\n" "#\n", str); need_newline = false; - } else if (!(sym->flags & SYMBOL_CHOICE)) { + } else if (!(sym->flags & SYMBOL_CHOICE) && + !(sym->flags & SYMBOL_WRITTEN)) { sym_calc_value(sym); if (!(sym->flags & SYMBOL_WRITE)) goto next; @@ -922,7 +923,7 @@ int conf_write(const char *name) fprintf(out, "\n"); need_newline = false; } - sym->flags &= ~SYMBOL_WRITE; + sym->flags |= SYMBOL_WRITTEN; conf_write_symbol(out, sym, &kconfig_printer_cb, NULL); } @@ -1082,8 +1083,6 @@ int conf_write_autoconf(int overwrite) if (!overwrite && is_present(autoconf_name)) return 0; - sym_clear_all_valid(); - conf_write_dep("include/config/auto.conf.cmd"); if (conf_touch_deps()) --- a/scripts/kconfig/expr.h +++ b/scripts/kconfig/expr.h @@ -141,6 +141,7 @@ struct symbol { #define SYMBOL_OPTIONAL 0x0100 /* choice is optional - values can be 'n' */ #define SYMBOL_WRITE 0x0200 /* write symbol to file (KCONFIG_CONFIG) */ #define SYMBOL_CHANGED 0x0400 /* ? */ +#define SYMBOL_WRITTEN 0x0800 /* track info to avoid double-write to .config */ #define SYMBOL_NO_WRITE 0x1000 /* Symbol for internal use only; it will not be written */ #define SYMBOL_CHECKED 0x2000 /* used during dependency checking */ #define SYMBOL_WARNED 0x8000 /* warning has been issued */ From patchwork Wed Jul 24 19:20:35 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 169642 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp10658718ilk; Wed, 24 Jul 2019 12:42:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqy6bzVGZP/hKbv2ZBh2AbkNhPktPib0SurBSpJLIhppslBik2fcUnejUyTDTL07/FOVSqAX X-Received: by 2002:a63:5945:: with SMTP id j5mr82501016pgm.452.1563997281634; Wed, 24 Jul 2019 12:41:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563997281; cv=none; d=google.com; s=arc-20160816; b=fKpxNHPZQITsLJesFZWVTyUNTtTrdTLG068mkOUlxVR09i3lHApxn0KUhqC+Rcol6N 2CCpeuX63Ia/XEG4ai+32nY0xqpc+WI890Jp0368Ru9u0C11RqQnXr3h383a+FEyvGx8 eCjW2uOrEZW4/bauNp6SWUc8+/bNnW0L9JY4MRagH+kLhhCy8nier7uuyPqrauRmAmH5 gZoY5R4z0h+VNmWd4qEPa3EnNtugVg0XtfabWunt6DQZAEGjGCBZxmWsAthuVLeO1YSz gzCYNPpefpbbdwJ0JnxxYrgBtE5pqHBk+hmudmRgr8KaHX3D8LHi7f0+FHaU2tyedHHk NP3A== 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=J1+ZBL9OV9qV915bHuza42D7YMTZ5YpAP3HbsmGPS6o=; b=x2i5fVUEfPa/a7R3A5XmHDrPS0LyQ4EPHNKMTWdke1mFv6a4pjNhV4q/odANq1RVrp sJVPR36Cw2sarJlpUMSzGau/ck+Gfq7Bj4ACE9cohHOceUfhU311nwF3PVWzhxQZIrPD REaBMwx7uChj++LkqdtTfAuUBG0BovmgR6jHzFff1a7oFN7B3zkOVYGM0qfdGwrGvJZe mAB9aU9gVrTgvb3kqj2cJv2dQhpr+xAQfS6BVXy2mS/ZOUTPlvPj+vGKA5fCqEuewvm5 wqRW4ciexmS6rCHINdUgnDj0b9NaFFq3QsXAuR7gdA/U3enY6EP+WYNSqPKsUQTRHscl mLnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NfrCfx0w; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 z62si16393268pgz.143.2019.07.24.12.41.21; Wed, 24 Jul 2019 12:41:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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=NfrCfx0w; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389624AbfGXTlU (ORCPT + 14 others); Wed, 24 Jul 2019 15:41:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:42636 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390162AbfGXTlT (ORCPT ); Wed, 24 Jul 2019 15:41:19 -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 96DF521873; Wed, 24 Jul 2019 19:41:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563997279; bh=umptgDMJtNhneGaoTDOXdRurRf8fDTFuJGUd/2Z2I84=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NfrCfx0wG++WEwXWIcsL9cDWycU5IHP8oU+TSzYw3vHxKasCOkiq8abyBDjJClxXC GkzkczN0+5dj6ViTgPKtxruucS9dl5JclDQ9dKDDzG6MWV4NDmWmsHDj6P4AZh43sA FksTg1mZ5lYA2EXMZFfK2YuX3VA80Ka9EsDsI4M4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Linus Walleij , Olof Johansson Subject: [PATCH 5.2 344/413] ARM: dts: gemini: Set DIR-685 SPI CS as active low Date: Wed, 24 Jul 2019 21:20:35 +0200 Message-Id: <20190724191800.440137342@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191735.096702571@linuxfoundation.org> References: <20190724191735.096702571@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Linus Walleij commit f90b8fda3a9d72a9422ea80ae95843697f94ea4a upstream. The SPI to the display on the DIR-685 is active low, we were just saved by the SPI library enforcing active low on everything before, so set it as active low to avoid ambiguity. Link: https://lore.kernel.org/r/20190715202101.16060-1-linus.walleij@linaro.org Cc: stable@vger.kernel.org Signed-off-by: Linus Walleij Signed-off-by: Olof Johansson Signed-off-by: Greg Kroah-Hartman --- arch/arm/boot/dts/gemini-dlink-dir-685.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/arch/arm/boot/dts/gemini-dlink-dir-685.dts +++ b/arch/arm/boot/dts/gemini-dlink-dir-685.dts @@ -64,7 +64,7 @@ gpio-sck = <&gpio1 5 GPIO_ACTIVE_HIGH>; gpio-miso = <&gpio1 8 GPIO_ACTIVE_HIGH>; gpio-mosi = <&gpio1 7 GPIO_ACTIVE_HIGH>; - cs-gpios = <&gpio0 20 GPIO_ACTIVE_HIGH>; + cs-gpios = <&gpio0 20 GPIO_ACTIVE_LOW>; num-chipselects = <1>; panel: display@0 { From patchwork Wed Jul 24 19:20:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 169640 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp10656980ilk; Wed, 24 Jul 2019 12:40:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqyvniNMBSoMpNNKlSSjOJn7xVL3R6pn9aJY46ZGc+VVIIOZsf5DHOOjy6XYiF3iyp8p47OY X-Received: by 2002:a62:584:: with SMTP id 126mr12996468pff.73.1563997232674; Wed, 24 Jul 2019 12:40:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563997232; cv=none; d=google.com; s=arc-20160816; b=Hplur358Bpzn/v+aLZXRCxN3GgQt3DC6gb7FvemzNu9g8x7jdy7T/ayEqKXmaD54yB AZIOfS/SUPT/HA685faPIzf70L6b3psxx4EiE6PoOFgu7k1oxzceL9jtYJLrCtiuyKQy 04iFnzM26jtB2VyaMgDf/5bLZ9vFpwmZ39b1momZQr9XKkVL8FU/qwR5nzxtKTsA7+3T +SnawCfaPr53vaeemj30LiHNp/mUTOIrAgKA0i5ivMs0P/CcvoOSjnwoGk65MiJ3M7Yw r0XrgeNuoMHUwqKcxS/L5ozU4UdwmE3R25KN1Bf+CVfXebkWCK22KOxU/pQ7HHZ3Uv7Y nTiA== 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=Ki+0q5T6jfoMGjMnsQGlnJ7pr0iqH5Nxbna9Rfk6Y7o=; b=Hurc776JhXumUf4vtUvAMuxYCpI9Lj3YWDLOTR43FXquiNVBo+ciFOJKsE71wloU+y tVTuWycnr9ijHj5vdLypqYgHyx3YGYxXorC1Fw2zi4l8qZNosbKQTXki0HyivF0NoshD 00NRkfV/7qWFA8rdlyU/5u+Tu6POHF6oPRriXcmGwILdw08V0a06XU26FKluLEXJFIL0 W+/ols4bp3LSGmJTZK5LFIDO5ePAdi3u+CPP1vAW7mBbwc0S/yUzk1M7z3PhCJ3Qbvfi rr0eockgY9kGXJgeFJxqIsZjRP7Yi92m2KQMvUx5/TU/gsuc07myNp7370BbLiPK4bfw zcSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xqwklLOx; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 r18si35326736pgl.173.2019.07.24.12.40.32; Wed, 24 Jul 2019 12:40:32 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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=xqwklLOx; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387921AbfGXTkb (ORCPT + 14 others); Wed, 24 Jul 2019 15:40:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:41740 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390010AbfGXTka (ORCPT ); Wed, 24 Jul 2019 15:40:30 -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 BDD1B20665; Wed, 24 Jul 2019 19:40:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563997229; bh=hdPiwWOIh86sapnLw0u7XiSoH7Kj3zi5jtTPZLDP9H0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xqwklLOxfDDk/iHBwunCY4qXfr5pSJ5H8U4s08P2JE5j5ObzASVNwKDQcQE/WGGa0 KjY/AzSP2AhpRO2+LnFJEckupQx2u0TDXCECH5asUCLKUTy3A/VBOoNnLGo9v76TF4 zH7FrK/Sykg3rcEVC8fDrFPcnkG7Img8DXvbdAOg= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Niklas Cassel , Lorenzo Pieralisi , Stanimir Varbanov Subject: [PATCH 5.2 366/413] PCI: qcom: Ensure that PERST is asserted for at least 100 ms Date: Wed, 24 Jul 2019 21:20:57 +0200 Message-Id: <20190724191801.598390481@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191735.096702571@linuxfoundation.org> References: <20190724191735.096702571@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Niklas Cassel commit 64adde31c8e996a6db6f7a1a4131180e363aa9f2 upstream. Currently, there is only a 1 ms sleep after asserting PERST. Reading the datasheets for different endpoints, some require PERST to be asserted for 10 ms in order for the endpoint to perform a reset, others require it to be asserted for 50 ms. Several SoCs using this driver uses PCIe Mini Card, where we don't know what endpoint will be plugged in. The PCI Express Card Electromechanical Specification r2.0, section 2.2, "PERST# Signal" specifies: "On power up, the deassertion of PERST# is delayed 100 ms (TPVPERL) from the power rails achieving specified operating limits." Add a sleep of 100 ms before deasserting PERST, in order to ensure that we are compliant with the spec. Fixes: 82a823833f4e ("PCI: qcom: Add Qualcomm PCIe controller driver") Signed-off-by: Niklas Cassel Signed-off-by: Lorenzo Pieralisi Acked-by: Stanimir Varbanov Cc: stable@vger.kernel.org # 4.5+ Signed-off-by: Greg Kroah-Hartman --- drivers/pci/controller/dwc/pcie-qcom.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/pci/controller/dwc/pcie-qcom.c +++ b/drivers/pci/controller/dwc/pcie-qcom.c @@ -178,6 +178,8 @@ static void qcom_ep_reset_assert(struct static void qcom_ep_reset_deassert(struct qcom_pcie *pcie) { + /* Ensure that PERST has been asserted for at least 100 ms */ + msleep(100); gpiod_set_value_cansleep(pcie->reset, 0); usleep_range(PERST_DELAY_US, PERST_DELAY_US + 500); }