From patchwork Thu Nov 7 20:16:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 178822 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp1581195ilf; Thu, 7 Nov 2019 12:17:13 -0800 (PST) X-Google-Smtp-Source: APXvYqzUxz6gt6xc+59Gea7W0Ie4B+YyYhYFrn+RL2sdPsesgcWMBtDZtlzQPXW4paEYS8A1fm4l X-Received: by 2002:aa7:d0d4:: with SMTP id u20mr5940593edo.112.1573157833840; Thu, 07 Nov 2019 12:17:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573157833; cv=none; d=google.com; s=arc-20160816; b=KZLpmq9iDi0+AO24KKpWmZA1I/pfbsLKZCQwyZR2lDZfLFxkxhHYpEX7OsrD0YTcFV e5pw/HoVsK8eXEyVYPCGrRgeU3SaNGujG/YMprPPYeIfFBrHc7scaXqHMCl8rSP7mdJp QO+mhVWSj4h7GhUVr+8RJKB5U4cuSw2a5O9qpB1FPXL0q7TuhFql3upqXubBYjtN9yWB CZYgWCHkq7QRReP3Gj7vVRHcklPrjTQprItG1eW+OFCidf8bDyNhB7eV5GqyN6V6BWqQ RwXOJc1DTuWRRI4KiL7H3eSb0wDdznihAX2Z3ImjKVBZUbVrPUbxKev04VJgBSkUQtKv xSgQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=8Eh1A+XBqcPZEFBnh+HgUCyw+82+aoc7YA8bWZyx/XU=; b=OrXPRScu+F7d1Rmuj0NIZSGQfMCXOc1WXN7ZrmliEjlRvsFdurTZFkHpG5iu1jCYjZ TsiYMIj+OvbwxWnLLjrNnKppdTJ3wuf5CEu2nwrfZk8HzhIDV12JbPsXuSXWqZMHuDfv zhx7jvPEVWW8hV5xtpEJcOQLE+yXBJJoqsav6wJSNvNQobsD3N4NWfqiD25PYzrAycjL qHOkC6porsd5UaJRU0Uv3mEopvMVbaoFpFbdK0JJpimoMb4ZdlRiwL7/RaB6+hlmcDoI HzePFmdYTAnd0AzgtKsr3kyK97FhTFj67nCfYdM3ZQ9Ha03mdJN4Qro8dP7r150lqYlf f3Pw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="HdbGDG/b"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g19si2497652edb.280.2019.11.07.12.17.13; Thu, 07 Nov 2019 12:17:13 -0800 (PST) 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=@linaro.org header.s=google header.b="HdbGDG/b"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726019AbfKGURJ (ORCPT + 26 others); Thu, 7 Nov 2019 15:17:09 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:46619 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725785AbfKGURI (ORCPT ); Thu, 7 Nov 2019 15:17:08 -0500 Received: by mail-wr1-f66.google.com with SMTP id b3so4498041wrs.13 for ; Thu, 07 Nov 2019 12:17:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=8Eh1A+XBqcPZEFBnh+HgUCyw+82+aoc7YA8bWZyx/XU=; b=HdbGDG/bD9rfLuXChKqfIL0GLBdwAQkoeEUR08XO5vmvDP4d9n5jwJzBtM5nafVUXy IbxdQZMZkDC143pI38WUWa9gkoPM4Ct8HTsfcpCvJyXbPWy6b1amMm4RNAayLLmuWkCF ot/OuCxCp8MppEtlxsnDIRm0zBzr2Y3olP1hj3Cfuhfe83eyDO1jtOrMhJgItBHinr5L NNo8Jeg3Xsvw+g9kiTxfMp/D1kolWj04wOkYmWlZHv4bo6wUkwhs7rp1K3ce/3oKRlrN cSVTDjamow1Jbjv7k3iY237zJd4PIhhBdAypb7a7ki5+2AsUX8w0g22P+oMjeBuyTZyv 65xA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=8Eh1A+XBqcPZEFBnh+HgUCyw+82+aoc7YA8bWZyx/XU=; b=FOTc12yb3CcdTvk8bsuUsNPcxvI4WAXwnT1IkDenUrbS2HoVVbmd4MciUu95nY98tP g9+ZeSx2abtkHJAr5cs0kby3ywRqMSuVBy/68dRVRGliL1ZeYGc1WTomtQc3JwhnSCmy 0rKGrJbIAXErVh7BIVBdTpJr60J7NsWzp1VracG/4iL78x9K+vQAKCTML3F1gjCxLRmh 5PJbXn2peMsX4XkYoUGCs8aiuKytX29/32JnHf8ItJmNLVnK+9DIpF17WEfbmr8QUS3p uBufcGiE6sdRtS/YLPYhJg8JeDFiq+8AT7nc2z9rp4h8odILqpQZ35QWqHL1It9EyfoC z3Sw== X-Gm-Message-State: APjAAAVsdpAWNfklcyMwQW2V2xGukRzP0OYOQyQW9T/aEVH+jUNA/y45 Inmsg/7RLNoEw6uQKctiq11KtA== X-Received: by 2002:a5d:5262:: with SMTP id l2mr4768386wrc.113.1573157826508; Thu, 07 Nov 2019 12:17:06 -0800 (PST) Received: from localhost.localdomain ([95.147.198.88]) by smtp.gmail.com with ESMTPSA id d11sm3215162wrn.28.2019.11.07.12.17.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Nov 2019 12:17:05 -0800 (PST) From: Lee Jones To: gregkh@google.com Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Yu-Hsuan Hsu , Mark Brown , Sasha Levin , Lee Jones Subject: [PATCH 01/10] ASoC: max98090: remove 24-bit format support if RJ is 0 Date: Thu, 7 Nov 2019 20:16:53 +0000 Message-Id: <20191107201702.27023-1-lee.jones@linaro.org> X-Mailer: git-send-email 2.24.0 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yu-Hsuan Hsu [ Upstream commit 5628c8979642a076f91ee86c3bae5ad251639af0 ] The supported formats are S16_LE and S24_LE now. However, by datasheet of max98090, S24_LE is only supported when it is in the right justified mode. We should remove 24-bit format if it is not in that mode to avoid triggering error. Signed-off-by: Yu-Hsuan Hsu Signed-off-by: Mark Brown Signed-off-by: Sasha Levin Signed-off-by: Lee Jones Change-Id: I68110cd295e9cd1c692bbd3cc3fbc247d92759a0 --- sound/soc/codecs/max98090.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) -- 2.24.0 diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c index 607f68597c21..25565f364af8 100644 --- a/sound/soc/codecs/max98090.c +++ b/sound/soc/codecs/max98090.c @@ -1847,6 +1847,21 @@ static const int dmic_comp[6][6] = { {7, 8, 3, 3, 3, 3} }; +static int max98090_dai_startup(struct snd_pcm_substream *substream, + struct snd_soc_dai *dai) +{ + struct snd_soc_component *component = dai->component; + struct max98090_priv *max98090 = snd_soc_component_get_drvdata(component); + unsigned int fmt = max98090->dai_fmt; + + /* Remove 24-bit format support if it is not in right justified mode. */ + if ((fmt & SND_SOC_DAIFMT_FORMAT_MASK) != SND_SOC_DAIFMT_RIGHT_J) { + substream->runtime->hw.formats = SNDRV_PCM_FMTBIT_S16_LE; + snd_pcm_hw_constraint_msbits(substream->runtime, 0, 16, 16); + } + return 0; +} + static int max98090_dai_hw_params(struct snd_pcm_substream *substream, struct snd_pcm_hw_params *params, struct snd_soc_dai *dai) @@ -2274,6 +2289,7 @@ EXPORT_SYMBOL_GPL(max98090_mic_detect); #define MAX98090_FORMATS (SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S24_LE) static struct snd_soc_dai_ops max98090_dai_ops = { + .startup = max98090_dai_startup, .set_sysclk = max98090_dai_set_sysclk, .set_fmt = max98090_dai_set_fmt, .set_tdm_slot = max98090_set_tdm_slot, From patchwork Thu Nov 7 20:16:54 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 178830 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp1581687ilf; Thu, 7 Nov 2019 12:17:38 -0800 (PST) X-Google-Smtp-Source: APXvYqwDOWjBcAh9Uqd9otJ4t9MYJPojG4qWo9m1btmMJmNUvx3uM5XWlqHvVcx3xR4q36Q9SP4k X-Received: by 2002:a17:907:2078:: with SMTP id qp24mr5016212ejb.157.1573157858565; Thu, 07 Nov 2019 12:17:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573157858; cv=none; d=google.com; s=arc-20160816; b=0BfhwcfiugBIlDCgZmi6UyYi9fPmm2nw1pGZx7gN3iRlHmnsOnHcQZkSVSzHVKJ4xN 2WJWQqv6rM6zXb2hhhuXWieRbbVgwIUKCARqMZgavnxSWYtI5PsubJ2OdVDmAgVPSLel H2K0ix3OjpinCo51u4FTsawXUDcc5pSUWB47FA+RlAiD7m2L7trC9UHxjsxU7ERyTFtt A9+UI8N2yyXWk2AgnA4uHk+4QeCfyGx2mpbtwzXoH57/icTgrrHamqjcDqrDbpTT4eLW bQ8phvNafw7ymh7/9H3D3dYPvJ6CStbVBuyaOwKeFM0Qb8UlH7837T7io60eE9Y4TRQH 4kuw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=qbI1BAgAkPaImSA31avjQBXyIdfFKUwTp+KLI6AEZH0=; b=Q/98EW5UR3+hjko0NjISfUUIa1FDpKFBuc9aWtuV8YXAlezbDyTmzhIaLY49DMbFCe aRGypxLEKE3mMyTCbKdv6OE4c+AU4Gm5XImcTfBymNQfPp0Nbwv231hFsVY3ktyhRc72 uuecAHOmCLmbfcdSY02tgcxmnp501PrEPHQVKzYnNOJZWxrmul1JxZezmC3GsmFG+apA LN5RbH8swbiHojyj3wRRcmGHVePa6dlwGA6FhcXrl1wWAvfyMKoXTOGKol2EawVUm6A6 O+EXnlPBFpjNZTJE45ysRMQm8t/fU/6ECGKqqKmHis1zCzDkWa3r5qWYKuxDZ5AyShNH bvLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="EC/SX8oo"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f3si2137345ejb.49.2019.11.07.12.17.38; Thu, 07 Nov 2019 12:17:38 -0800 (PST) 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=@linaro.org header.s=google header.b="EC/SX8oo"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726612AbfKGURL (ORCPT + 26 others); Thu, 7 Nov 2019 15:17:11 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:37832 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725792AbfKGURJ (ORCPT ); Thu, 7 Nov 2019 15:17:09 -0500 Received: by mail-wr1-f66.google.com with SMTP id t1so4572306wrv.4 for ; Thu, 07 Nov 2019 12:17:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=qbI1BAgAkPaImSA31avjQBXyIdfFKUwTp+KLI6AEZH0=; b=EC/SX8ooYqTxr5pQUlGH6g2yvyeF1kpJrkFWbvWtgr9gM5Iyl2llrDdEp7D0xc/ckc ylpxAJXxfPTRewHYEUFf27rRf6OgKgwfod65R20q3y8PspodxrnnoNVES54RwWuDDEpq SsHlynYxsuBNvn0l2/BMHVk1L0kCIEaI31sdizplPtimHczDVHahZ8j/MIxu3T9GpPTn M5jVzoulmUi+TraL/W6sI7/MBMMzPtNWYjvL46ILMEWPqXx2zbH0RJBFrbBv+JFvYPqr k+PMcl6B7+yLQprGnJqMAS3oiTZ6vHClRRoA7MElF5y2dMfk5TLqZOALfA0c6ZwIhoj/ jyVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qbI1BAgAkPaImSA31avjQBXyIdfFKUwTp+KLI6AEZH0=; b=B3D+k4uwioAG57dLmHH+69lSjGNV65HYfY/8NOR94YxewCRgsCzPW6ooAp6Wiqmgod lYRDYNrn3zAjj/9v5Her1ninK2v9OmPIwBmMaXoe5AsA2hAfekI5KKLVWLlgECIiE8mi gz39nN56T3hmr7KFwLs3WwFohZ7BNXHp+4yCmzjFZ0ZiuG6/BA1dWHPKmp3HhLyH9Hku uDVXkBUd05dLXKXPn1caEyFXT4onqmTtFk1HVzKekHDyLXPwp3tLMBNgG0an8gcKash5 UKw+IFHNnGJW/Lt4m9DRPXn0SaOg0WgvAJkVyCQ3OT6AHnM/XMJEtTPXaoD//6my38DZ 3llA== X-Gm-Message-State: APjAAAXQG0xa70V0ymS24nXfGYkVN3iS8jqKTdZ5RKJsel69+2bLrwyw BdgYaNjtlBHG8vJtb73ECPuoFSsDqpA= X-Received: by 2002:adf:8481:: with SMTP id 1mr5190613wrg.189.1573157827384; Thu, 07 Nov 2019 12:17:07 -0800 (PST) Received: from localhost.localdomain ([95.147.198.88]) by smtp.gmail.com with ESMTPSA id d11sm3215162wrn.28.2019.11.07.12.17.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Nov 2019 12:17:06 -0800 (PST) From: Lee Jones To: gregkh@google.com Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Alexandre Belloni , Sylvain Lemieux , James Grant , Felipe Balbi , Sasha Levin , Lee Jones Subject: [PATCH 02/10] usb: gadget: udc: lpc32xx: allocate descriptor with GFP_ATOMIC Date: Thu, 7 Nov 2019 20:16:54 +0000 Message-Id: <20191107201702.27023-2-lee.jones@linaro.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191107201702.27023-1-lee.jones@linaro.org> References: <20191107201702.27023-1-lee.jones@linaro.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alexandre Belloni [ Upstream commit fbc318afadd6e7ae2252d6158cf7d0c5a2132f7d ] Gadget drivers may queue request in interrupt context. This would lead to a descriptor allocation in that context. In that case we would hit BUG_ON(in_interrupt()) in __get_vm_area_node. Also remove the unnecessary cast. Acked-by: Sylvain Lemieux Tested-by: James Grant Signed-off-by: Alexandre Belloni Signed-off-by: Felipe Balbi Signed-off-by: Sasha Levin Signed-off-by: Lee Jones Change-Id: Iac6fdb2f664de82dde243dfa15b81e4add2198bf --- drivers/usb/gadget/udc/lpc32xx_udc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 2.24.0 diff --git a/drivers/usb/gadget/udc/lpc32xx_udc.c b/drivers/usb/gadget/udc/lpc32xx_udc.c index 23d0475a9136..928e0dd2f2d3 100644 --- a/drivers/usb/gadget/udc/lpc32xx_udc.c +++ b/drivers/usb/gadget/udc/lpc32xx_udc.c @@ -966,8 +966,7 @@ static struct lpc32xx_usbd_dd_gad *udc_dd_alloc(struct lpc32xx_udc *udc) dma_addr_t dma; struct lpc32xx_usbd_dd_gad *dd; - dd = (struct lpc32xx_usbd_dd_gad *) dma_pool_alloc( - udc->dd_cache, (GFP_KERNEL | GFP_DMA), &dma); + dd = dma_pool_alloc(udc->dd_cache, GFP_ATOMIC | GFP_DMA, &dma); if (dd) dd->this_dma = dma; From patchwork Thu Nov 7 20:16:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 178823 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp1581207ilf; Thu, 7 Nov 2019 12:17:14 -0800 (PST) X-Google-Smtp-Source: APXvYqy0rpu59a9vLLu8WO8x7rb8rdu63ZeX32sIfsEYm/ngI6b5+dX6jMqEwpuOf6L1ZxILGguR X-Received: by 2002:a17:906:3285:: with SMTP id 5mr4853570ejw.143.1573157834360; Thu, 07 Nov 2019 12:17:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573157834; cv=none; d=google.com; s=arc-20160816; b=wEZhHjSBnz/xsYgKOSk0J/BQKdu6rQyAJZHESsMEV+gu1UnBxWiZQl4SR+Q2VtWBNK yi6ElSextwSb6YjRqpZfYurlBynatXBFqecxUwnuQrk+MBlkP2eCBqJvRXzxRbZPDFab CtKGIqLoNerolLPVeOKG6I1ZJhvcsyz8xZI2FNwtCd5tPNyMKTHOkYbFScVKdJXBp7hB Ac/A0lFoOBnwD7RqewPUfegU25UOA+SJFp8uZnPtkSzTibtUj1XB4mvRXJ7QYbyZNi+E uwAFaSJUWH8MPKGFKd/jciBmZEd1XGaymtDSRkXIGJC06NpKBW+hTg3o9YzqDv+kz66X U4qQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=XNzt41YFZXyjsZpmoGDLsT4RfyC5Nwv0mUPlwLSX3bc=; b=IdeKUUVMnrghqm/g97FWCCUgwAdgEXKUEBt4Rudm3tUg2iVMGDoL1X7VlHWQWeDg5r gM2sDD+z5qyMI7KUhQSQIZ82AEkEAnI4F9m+wrqy83U6tWg+dmiDU7wIIj593/cIPdm4 T2mp7zY3Bi5ah0Cl0CDqaKvV/0jT7igNFuLWyop/XEZVaDX189Qk73mKyRYMu5UGnsav luC598YYPSP1r3wiKRAuUQ2tb4OrSUPI8/P2vPJOSJ9iUKF3WHzxvp17u4OjOG2eoz78 ifLsB/trYgcQwUPs++Ca10Sb860pOSUR5lOgoCU4H32H9WI/G3TbkPA6nt+QkwB4HJjU Whqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UFalviU5; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g19si2497652edb.280.2019.11.07.12.17.14; Thu, 07 Nov 2019 12:17:14 -0800 (PST) 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=@linaro.org header.s=google header.b=UFalviU5; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726859AbfKGURL (ORCPT + 26 others); Thu, 7 Nov 2019 15:17:11 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:44297 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725785AbfKGURK (ORCPT ); Thu, 7 Nov 2019 15:17:10 -0500 Received: by mail-wr1-f67.google.com with SMTP id f2so4497005wrs.11 for ; Thu, 07 Nov 2019 12:17:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=XNzt41YFZXyjsZpmoGDLsT4RfyC5Nwv0mUPlwLSX3bc=; b=UFalviU5DBTJfeFlbgiXyKOOr8N39C5EfK0S6coDUDS4tX8kAJ82CKlLG4/oQ5o0Oe A4uD60QFotjVwh/qG0AQiBXrmKKUC+gzfywVxe2cD9w8p+emBNbjkwhjc61BM8yX/jfG KsuqDzqfQxw1iuBgreTOxGEqCrhyWycHR/MPWh6qrv5do8cE4PJF5GovN8kTmraQL7sm IlD6Eoun/OExoYx4vk8PzmVZa/pQEdKLfaPXp+Lgpcpoi6pkOy8ZSST+2UT+DcqxA47l hRw5Vv1itAUzv//y28UozrXF4yxXGwHiGOVr1ltN4KIrrHVJNAL7xyUY/Vczkdh8FJ5J VPpQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=XNzt41YFZXyjsZpmoGDLsT4RfyC5Nwv0mUPlwLSX3bc=; b=gQvJCwGfbMC7mR6IvvnOD+SlxbYMu4/+3gFQbokv0WWI/CTMD7vGGqJadfOkzE05qL 91nli1ZKVx8TYMx1n72JaEzAA35DQl8sNF1BDnvAM6aago9BWaQi/G1Mf+MGOqqHG4P5 2rZu9UK5jUQ/PVVUlbWw17ml0cvhvpZPIn3Y+oop/sEL9FB45mA7QP1tk3xnP7YPs1YI nig5Z8LsI61sQfktbo4YTMChMR3A3az/2m3jQ5rZNwai5n1ndGcrmK8vnSYkPgKo0Gyk XkGmkvb78qBwoSe2hYo+3NnatmEJlaGrdk/JOKuzZfxxFAZ0q3aVa+UEFIg8IughdJki biBw== X-Gm-Message-State: APjAAAUWNxKAYSS6vhppSkaCoyg6nLJwtCsUJ7yqRY4A0V3TrbkjsHbd 8U19zO35kYmUHGznZO65CAnFwA== X-Received: by 2002:a5d:6b0e:: with SMTP id v14mr4691904wrw.280.1573157828385; Thu, 07 Nov 2019 12:17:08 -0800 (PST) Received: from localhost.localdomain ([95.147.198.88]) by smtp.gmail.com with ESMTPSA id d11sm3215162wrn.28.2019.11.07.12.17.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Nov 2019 12:17:07 -0800 (PST) From: Lee Jones To: gregkh@google.com Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Thomas Pedersen , Johannes Berg , Sasha Levin , Lee Jones Subject: [PATCH 03/10] mac80211: mesh: fix RCU warning Date: Thu, 7 Nov 2019 20:16:55 +0000 Message-Id: <20191107201702.27023-3-lee.jones@linaro.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191107201702.27023-1-lee.jones@linaro.org> References: <20191107201702.27023-1-lee.jones@linaro.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Thomas Pedersen [ Upstream commit 551842446ed695641a00782cd118cbb064a416a1 ] ifmsh->csa is an RCU-protected pointer. The writer context in ieee80211_mesh_finish_csa() is already mutually exclusive with wdev->sdata.mtx, but the RCU checker did not know this. Use rcu_dereference_protected() to avoid a warning. fixes the following warning: [ 12.519089] ============================= [ 12.520042] WARNING: suspicious RCU usage [ 12.520652] 5.1.0-rc7-wt+ #16 Tainted: G W [ 12.521409] ----------------------------- [ 12.521972] net/mac80211/mesh.c:1223 suspicious rcu_dereference_check() usage! [ 12.522928] other info that might help us debug this: [ 12.523984] rcu_scheduler_active = 2, debug_locks = 1 [ 12.524855] 5 locks held by kworker/u8:2/152: [ 12.525438] #0: 00000000057be08c ((wq_completion)phy0){+.+.}, at: process_one_work+0x1a2/0x620 [ 12.526607] #1: 0000000059c6b07a ((work_completion)(&sdata->csa_finalize_work)){+.+.}, at: process_one_work+0x1a2/0x620 [ 12.528001] #2: 00000000f184ba7d (&wdev->mtx){+.+.}, at: ieee80211_csa_finalize_work+0x2f/0x90 [ 12.529116] #3: 00000000831a1f54 (&local->mtx){+.+.}, at: ieee80211_csa_finalize_work+0x47/0x90 [ 12.530233] #4: 00000000fd06f988 (&local->chanctx_mtx){+.+.}, at: ieee80211_csa_finalize_work+0x51/0x90 Signed-off-by: Thomas Pedersen Signed-off-by: Johannes Berg Signed-off-by: Sasha Levin Signed-off-by: Lee Jones Change-Id: I19313f756382b0078683036d50c6645dd8ab2bee --- net/mac80211/mesh.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) -- 2.24.0 diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c index a70c970a743a..06189c952291 100644 --- a/net/mac80211/mesh.c +++ b/net/mac80211/mesh.c @@ -1062,7 +1062,8 @@ int ieee80211_mesh_finish_csa(struct ieee80211_sub_if_data *sdata) ifmsh->chsw_ttl = 0; /* Remove the CSA and MCSP elements from the beacon */ - tmp_csa_settings = rcu_dereference(ifmsh->csa); + tmp_csa_settings = rcu_dereference_protected(ifmsh->csa, + lockdep_is_held(&sdata->wdev.mtx)); RCU_INIT_POINTER(ifmsh->csa, NULL); if (tmp_csa_settings) kfree_rcu(tmp_csa_settings, rcu_head); @@ -1084,6 +1085,8 @@ int ieee80211_mesh_csa_beacon(struct ieee80211_sub_if_data *sdata, struct mesh_csa_settings *tmp_csa_settings; int ret = 0; + lockdep_assert_held(&sdata->wdev.mtx); + tmp_csa_settings = kmalloc(sizeof(*tmp_csa_settings), GFP_ATOMIC); if (!tmp_csa_settings) From patchwork Thu Nov 7 20:16:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 178831 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp1581769ilf; Thu, 7 Nov 2019 12:17:42 -0800 (PST) X-Google-Smtp-Source: APXvYqzp3NQqI5ZRpdQEl2Q4FWOydwvPywCx1eyFV+mfuFcEhh+YUQZXC+eXmw4RqzWsEUsKWhuM X-Received: by 2002:a17:906:c801:: with SMTP id cx1mr5079841ejb.266.1573157861894; Thu, 07 Nov 2019 12:17:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573157861; cv=none; d=google.com; s=arc-20160816; b=etz2SnF4TBFYnG8OhbB/YwxjQEXW502waiwt6CSnfv6rVO7E/HDj2UWL2PRxzDrhcG 4b5gh8A81H78g29pIpc4ovOQYAYpB7zcV8AQIeydFhYzY9vJGbyzcz6jTfIb70349QZF i9ukDWoGLGktyFQAOC2tSE/Gmk5Int2PfGbnBVVazdelDrZaq4M1V5YH6QZGPdviL8DE 0cwxti2Q3ONf5t6Bt8RMwQODIpR7vmnKqGJ+zy3xy7lacyX+nUP4Ytb/krCh8Wafl8/C prT4Yr8OkV/MsF1e5UKGQd1dSOfzJlxS0d73izziQr0YQx1qrIS5hFA7tEEj7s55PhJM s5fA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=CmH4Sn1DdXunw1TL7f6sfjm3qJQSjiedEKITkUOQrRc=; b=jkmn+IJdSrCvUTPcMJjp/4oXfDhs9MibxF4qpy6wJsCN4UKZa67Ok3Xt6yWR+VmoUJ tDKBk4AQdMZlpN40tUeeWHeMrk2aOIYTy37Cinc75AgDEDBYiZaMyEIed0b6VNUZsKHp 7gtDUqKY3GFIG1gOM8qEhTMB6X8i9+Rqr6vpqCvmlaqnwo86AdYLvbtKLNApePYH9KGg CAFqXn8UvhyiFsAUGyAgk5C4qgs+j5hekWDjY7FCXyPwTzhi9/RCmjKMRXymN/kHt5w+ /fD4Iuw4Oy4rdHn0LEOvlJi+YdOTXwAfDhyej9X+zq8hN8HXt6uPZBfPGA0k7UjStiKN CnVA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=dD3bgNfB; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f3si2137345ejb.49.2019.11.07.12.17.41; Thu, 07 Nov 2019 12:17:41 -0800 (PST) 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=@linaro.org header.s=google header.b=dD3bgNfB; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727493AbfKGURk (ORCPT + 26 others); Thu, 7 Nov 2019 15:17:40 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:36339 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726192AbfKGURL (ORCPT ); Thu, 7 Nov 2019 15:17:11 -0500 Received: by mail-wr1-f65.google.com with SMTP id r10so4580323wrx.3 for ; Thu, 07 Nov 2019 12:17:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=CmH4Sn1DdXunw1TL7f6sfjm3qJQSjiedEKITkUOQrRc=; b=dD3bgNfBay8ldyW/wTKnzuDbWLyYPl9wqdt360DazEyPc+zkaFEvjjAwZyme4xR0of YpzlFpdOVt3HEMliEp/pzdVcFPBNpdytncF4Mnrngda/K/Ld7QSO6/a5msBWe6RUpvYx jrYL9k5TKCXxTFJDavRz87FW6ZKZetilAcNBwA7eLMXLNa6YdAd3voAmhH6N45aBPCV3 HkOLWYaR4oOjExVV56NiTL1VfZtLQwCfqXS2BY5KNyADh4EtxQ4spV73b/174e8p66Ke kggAjzd1S+7PqyV2pUBZZBeJ1sFY+KSFYMRgV+TnSPU79hEDxckUOpSe3KnWRfUacQya mgDg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=CmH4Sn1DdXunw1TL7f6sfjm3qJQSjiedEKITkUOQrRc=; b=SJC2BOTT0QQ3UDsjIcgCb0Mz8VsEFloDiabiFwui7/2Xpe/73CSLd6DOfUlFvfYk46 4nxoMIoUv+vwzbdbit5Fo3U59/LAhvZDGX5m4flivZdv6QI38AKqYIxXhE57UgtJjj2c wKNG1TieIYcUnRmuC1oRBzyq4XiEzvHmvEY+3ZEqtpzHw1VAIPCtCT0Flc0jMQNpw6ug U7VGxLyM9mq9vHBYsHIh/6SQS+kF/Tn5rojZvt8zk7YEY52rdChLLGkL31KT8ZZI+HPq gXUfPcbdupAhh6tbhhMY16wrDM0t9GhyjB0QhNC2tt6uyt6+PHtC6UA0724+6Y1cHjDL 8EPg== X-Gm-Message-State: APjAAAVsQv34gDMzgRK2F/VHPtvT34tFLVaAGoa7HZyMDYNYtW7UCiPF eKgWnix3mTG+9a8quK6Axgy8sA== X-Received: by 2002:adf:8123:: with SMTP id 32mr5012062wrm.300.1573157829246; Thu, 07 Nov 2019 12:17:09 -0800 (PST) Received: from localhost.localdomain ([95.147.198.88]) by smtp.gmail.com with ESMTPSA id d11sm3215162wrn.28.2019.11.07.12.17.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Nov 2019 12:17:08 -0800 (PST) From: Lee Jones To: gregkh@google.com Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Takashi Iwai , Kalle Valo , Sasha Levin , Lee Jones Subject: [PATCH 04/10] mwifiex: Abort at too short BSS descriptor element Date: Thu, 7 Nov 2019 20:16:56 +0000 Message-Id: <20191107201702.27023-4-lee.jones@linaro.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191107201702.27023-1-lee.jones@linaro.org> References: <20191107201702.27023-1-lee.jones@linaro.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Takashi Iwai [ Upstream commit 685c9b7750bfacd6fc1db50d86579980593b7869 ] Currently mwifiex_update_bss_desc_with_ie() implicitly assumes that the source descriptor entries contain the enough size for each type and performs copying without checking the source size. This may lead to read over boundary. Fix this by putting the source size check in appropriate places. Signed-off-by: Takashi Iwai Signed-off-by: Kalle Valo Signed-off-by: Sasha Levin Signed-off-by: Lee Jones Change-Id: I8812db5f71b733e14573cacb6136e8a1a23036df --- drivers/net/wireless/mwifiex/scan.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.24.0 diff --git a/drivers/net/wireless/mwifiex/scan.c b/drivers/net/wireless/mwifiex/scan.c index 81a50d8af370..cff755475bc0 100644 --- a/drivers/net/wireless/mwifiex/scan.c +++ b/drivers/net/wireless/mwifiex/scan.c @@ -1296,6 +1296,9 @@ int mwifiex_update_bss_desc_with_ie(struct mwifiex_adapter *adapter, break; case WLAN_EID_VENDOR_SPECIFIC: + if (element_len + 2 < sizeof(vendor_ie->vend_hdr)) + return -EINVAL; + vendor_ie = (struct ieee_types_vendor_specific *) current_ptr; From patchwork Thu Nov 7 20:16:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 178824 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp1581247ilf; Thu, 7 Nov 2019 12:17:16 -0800 (PST) X-Google-Smtp-Source: APXvYqyjqBbjMli0j2PIXMlzuHzyNyb0PWrpXkKVQ4tFoaauk00mKtDy23AmiMNKjKPWD6ciVSVP X-Received: by 2002:a50:f403:: with SMTP id r3mr1467250edm.275.1573157836147; Thu, 07 Nov 2019 12:17:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573157836; cv=none; d=google.com; s=arc-20160816; b=L1fgynTooCxNS62Ld8HLUY7DSl1F7KZOV1Jc5xJzJqi2z8H+82cEkEI2HfBPAqxCrp usDJdzi1E4ql+nMeKg5c6P+Tap50xGv8BI9AZ/0d9d4iqMTe/KHBEEoQAhzvO8wY7gvq 0t834JHDefxr9R30UvXtkcOKvHQqsXXn20LflXRPdBXXbBo46teEKqtO6bPWjhOTcpz/ 4JTov+DC4ouA1iSzmm0LK3wCR5Cblqz52ioaiYbz0rWtx9sG1AzLQ4UWjm4jPg3bvJLN OxM3hKGGe+We86z73zqIBtFWApbZZBgrHmDsoE7Vk+1UfaTSI/us0cONyUC+XUrtcU2o jGsA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=uRNUCzVHW/hIxF0Wt4MmTdiGKyzYHqRtim9CvhWuCl8=; b=OgFtg8V09PVLt8jsL1lv0B+XNyCsLX9Ggii0PDPbVvNlPZP5d7S+yMN8SgZuZuCIUC PrArD2Qq6ZqNAFKCzp8p1CZHSxJGCgGWBfglvu1kJZTfNktKrvYGK4UXKDA32FiT+Ajz APx9bM28zJ+tXF2oYX3zj7dnUZv7f46STuPSdU/IHMX8T05bgfdybVQMG+euE9pwC09e PBp19PBUNQqN/g9t7zog4uVBZSnLBNbErSXm3vPEzdNyBb4KR8eoh3x53LtJMroItukR uKaCG0Wej5Tnq//IvC9eOEqQRyVnqOoV8DkUca2ss6exnyPqbtl08xodAC1WeNZm6/6x +WIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=b7mVJluO; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g19si2497652edb.280.2019.11.07.12.17.15; Thu, 07 Nov 2019 12:17:16 -0800 (PST) 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=@linaro.org header.s=google header.b=b7mVJluO; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726077AbfKGURO (ORCPT + 26 others); Thu, 7 Nov 2019 15:17:14 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:46627 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726616AbfKGURM (ORCPT ); Thu, 7 Nov 2019 15:17:12 -0500 Received: by mail-wr1-f65.google.com with SMTP id b3so4498228wrs.13 for ; Thu, 07 Nov 2019 12:17:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uRNUCzVHW/hIxF0Wt4MmTdiGKyzYHqRtim9CvhWuCl8=; b=b7mVJluOUKDmGOK+t5dkGpYLWACM0Mxg3I2ksDrXsV1AOUrTp020NCVz230yrSTP/6 DsxSuhNMEy6hu09xnJobHQOLiX5IeSHLjqIJqftr5asuGNcTQl6BHiZcLC3A+sodKArM csxbPNu4j18wVGFbXdDLUuQY33K3NqBaJes9EI8G7L1WEq0Lxy3ROyEs+Yl4joelU2YV l0xDUhDfve2NP6fBEQkmBtGju0TqgZ4axK/N7OkA2nZf6TFqJCdA20qiBiNAzffnaEut kiN5BUcF0+K+4B2bh/VvBBI7cojqw2G/6IO8Tg+NgVm5f+RTTlMDsajo/pLP2YNh9S7Y vHgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uRNUCzVHW/hIxF0Wt4MmTdiGKyzYHqRtim9CvhWuCl8=; b=hh2JQ4bO4YdZD6joN7r4cpyYqZJcpNZx0GyiBcGRkczwbCk7s4njVeammW7Pqq8Mgj 3BgsM2tp1hQut5fy0pIwLg+KnirnkQtqby4uB7VXMBRmcm3Coovrj5h97ZgaUl8YSAUL R4b/cEkd52s+4FywRkPVUtpr5EtQSfs9lHLk86RzKPDYaHZ/WSIrZ4/9aAf9qhDTeBoz K/31gRveW8S2mGKcFUGqqd4vYET9v6DDiglse1K3so4fw6HjM5nrVtBNrUXM8SmVkzhb TM4lsp368vgqCIYUkQk8RAtHOrtJcShOryLIUY65ysKXon96bS+AJEVFh7sriQPV8Ff2 68TA== X-Gm-Message-State: APjAAAXGi1oauH5U49yHjcMjBr+7J7kMBGqvNT4R+jN0CbPd6A3L5NXK GLf0hQLaDc0ypXSoPeCSerDoyA== X-Received: by 2002:a5d:6203:: with SMTP id y3mr4835347wru.142.1573157830378; Thu, 07 Nov 2019 12:17:10 -0800 (PST) Received: from localhost.localdomain ([95.147.198.88]) by smtp.gmail.com with ESMTPSA id d11sm3215162wrn.28.2019.11.07.12.17.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Nov 2019 12:17:09 -0800 (PST) From: Lee Jones To: gregkh@google.com Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Anson Huang , Anson Huang , Dmitry Torokhov , Sasha Levin , Lee Jones Subject: [PATCH 05/10] Input: imx_keypad - make sure keyboard can always wake up system Date: Thu, 7 Nov 2019 20:16:57 +0000 Message-Id: <20191107201702.27023-5-lee.jones@linaro.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191107201702.27023-1-lee.jones@linaro.org> References: <20191107201702.27023-1-lee.jones@linaro.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Anson Huang [ Upstream commit ce9a53eb3dbca89e7ad86673d94ab886e9bea704 ] There are several scenarios that keyboard can NOT wake up system from suspend, e.g., if a keyboard is depressed between system device suspend phase and device noirq suspend phase, the keyboard ISR will be called and both keyboard depress and release interrupts will be disabled, then keyboard will no longer be able to wake up system. Another scenario would be, if a keyboard is kept depressed, and then system goes into suspend, the expected behavior would be when keyboard is released, system will be waked up, but current implementation can NOT achieve that, because both depress and release interrupts are disabled in ISR, and the event check is still in progress. To fix these issues, need to make sure keyboard's depress or release interrupt is enabled after noirq device suspend phase, this patch moves the suspend/resume callback to noirq suspend/resume phase, and enable the corresponding interrupt according to current keyboard status. Signed-off-by: Anson Huang Signed-off-by: Dmitry Torokhov Signed-off-by: Sasha Levin Signed-off-by: Lee Jones Change-Id: I576fa685e1ab2c764703e5f65a3443e794bdafdd --- drivers/input/keyboard/imx_keypad.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) -- 2.24.0 diff --git a/drivers/input/keyboard/imx_keypad.c b/drivers/input/keyboard/imx_keypad.c index 20a99c368d16..a5a4c83f2632 100644 --- a/drivers/input/keyboard/imx_keypad.c +++ b/drivers/input/keyboard/imx_keypad.c @@ -531,11 +531,12 @@ static int imx_keypad_probe(struct platform_device *pdev) return 0; } -static int __maybe_unused imx_kbd_suspend(struct device *dev) +static int __maybe_unused imx_kbd_noirq_suspend(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct imx_keypad *kbd = platform_get_drvdata(pdev); struct input_dev *input_dev = kbd->input_dev; + unsigned short reg_val = readw(kbd->mmio_base + KPSR); /* imx kbd can wake up system even clock is disabled */ mutex_lock(&input_dev->mutex); @@ -545,13 +546,20 @@ static int __maybe_unused imx_kbd_suspend(struct device *dev) mutex_unlock(&input_dev->mutex); - if (device_may_wakeup(&pdev->dev)) + if (device_may_wakeup(&pdev->dev)) { + if (reg_val & KBD_STAT_KPKD) + reg_val |= KBD_STAT_KRIE; + if (reg_val & KBD_STAT_KPKR) + reg_val |= KBD_STAT_KDIE; + writew(reg_val, kbd->mmio_base + KPSR); + enable_irq_wake(kbd->irq); + } return 0; } -static int __maybe_unused imx_kbd_resume(struct device *dev) +static int __maybe_unused imx_kbd_noirq_resume(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); struct imx_keypad *kbd = platform_get_drvdata(pdev); @@ -575,7 +583,9 @@ err_clk: return ret; } -static SIMPLE_DEV_PM_OPS(imx_kbd_pm_ops, imx_kbd_suspend, imx_kbd_resume); +static const struct dev_pm_ops imx_kbd_pm_ops = { + SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(imx_kbd_noirq_suspend, imx_kbd_noirq_resume) +}; static struct platform_driver imx_keypad_driver = { .driver = { From patchwork Thu Nov 7 20:16:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 178825 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp1581284ilf; Thu, 7 Nov 2019 12:17:18 -0800 (PST) X-Google-Smtp-Source: APXvYqyGOSB+HqsPcb+vB/1X4QA0qgGEkaW/mtf/fbJQSSMSG0BCMDyN5h12U9q/CGFu+386ERd7 X-Received: by 2002:a17:906:e297:: with SMTP id gg23mr5093368ejb.41.1573157837984; Thu, 07 Nov 2019 12:17:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573157837; cv=none; d=google.com; s=arc-20160816; b=XL0qG2H4JlfzQFeNhYEm1LbOju6lRGr/1Ihf3dcw3DEopqZ+CzmI4mDcnK05/1zDFO 8Rv6BBBtJrmT+03pc/S/KUJgnEev+MaKqWLXQFeuV5D8htjwy0PT4s33Tak0JmXdTd8k T7C1cwFRybY21fGZdUWmUZtKHTjRQbzQcI2U9Yg0KnuScueiWW0mstxdAgU39HjKwbU4 CgCcpXwa2BEoQFf242oGe1ZLj2ZYpm/xDic6wYjb/d/6FNVs+W+MwWTqpgSL8gyA2cDR rBqm3KeFgBOmMyceymRbg0TOZlhLwhvxn8TsWOWcEt6FrxGu49i7Abhp4XN9SRX0C1dC uIoA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=3uEMTSxEwniG+GI3vykJ+eUgrkWCmr3tUv0pvMyZgIw=; b=K8UCvvNSWyCWEe4JKbvhvclRneJFSiBCKF1f0RcTgyGKRtOmPXkrQe+GlZbSDlj14m Yhanky1TR3v6EY8n0KoZzpMenNM3R1wEyjs41C56fLINHrXGlpxo5RFuZ7ebiTXvvhI6 pFyqcb3O0Np3N155KP3U4wAwF/gWr3p3Esz1ICE8V2x1zk/eYlpyu3HCymq8hGxb4eze 93SQsfz3pMnSu6xNvmp9lwUjJUfx0LtWVKg9j/KMqnZPBBbfU/I4SxTHBRhH5T9L2AMN HOw84wsEJs+6TrpM6LmBlQ3YMV7i86rmuPCFGMRW22n5Wepkq3oXVtrYxL/Z8v502Wa8 pOxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="VMo/N9HX"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g19si2497652edb.280.2019.11.07.12.17.17; Thu, 07 Nov 2019 12:17:17 -0800 (PST) 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=@linaro.org header.s=google header.b="VMo/N9HX"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727161AbfKGURQ (ORCPT + 26 others); Thu, 7 Nov 2019 15:17:16 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:36344 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727023AbfKGURO (ORCPT ); Thu, 7 Nov 2019 15:17:14 -0500 Received: by mail-wr1-f67.google.com with SMTP id r10so4580441wrx.3 for ; Thu, 07 Nov 2019 12:17:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=3uEMTSxEwniG+GI3vykJ+eUgrkWCmr3tUv0pvMyZgIw=; b=VMo/N9HXGvfK31zXdC8J2efmeCXAZkgd9zzvtP9wLfazNjTmQHu5mCxVmhzk+xVbJ2 PElhp2IzkNIWL3VvKbPcnJseKL5qCfNjPwQm+zvKVq3Mqw43lbPrXdw8jX0LMjCJSdlY zr7DvqEbY78cydYhsAj4vHnqc5av7McswfE+2rncbpr8CnTxym0NjhC+hPh4lpcrjicP Ehdk8okBRdiOyQ1GZzVGaO8j6EwKaRwFc9yn7B/GOwQupIpPsWFOIf0Khecen5Z0Cp9m 7ZfCiLf3MJ9u5rViwxfWnhzbMI5yVitvyKlAEWxiaPSGmGbzdVZARRFWKjMqV5Bhn4LA xQmg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3uEMTSxEwniG+GI3vykJ+eUgrkWCmr3tUv0pvMyZgIw=; b=QFM2u1YKVdJWJBrtrNQF9zmGOaEEJT3eMrt4fWww5nvg9+9B1Dz3g9kh7N8pIETNLz 8Rb/Ph9KS6x7wUvQIZbG5X6Bw9djVNNMjOHcPKfDjLgkSlmJvxypctEAdiYVRcQcwaSn WMbMueo1GpS1WoA+mG7K2ymPKb/YlhKZxBBQ68T3ICMI5a9YMQ4DAYWTq+ZrDwk9wbag 3s8cI4PYSdXPnpAFVHsUn3M1CMA4ziYboi+bMeRDUR4yJ4khQkCtCsNlELOiojJlsQ78 kqOqK0C4WnnsSRTkXCtcr+ALNWwn1NhDRoFDOLPPcu8Ek9EwiQSBKFYF2VZKP8HQv1ca 5/KQ== X-Gm-Message-State: APjAAAX5ZiQiaMHNnjjW1BNCJBApJjCoTB1Xk7T9mdQHd5vx0cBQvXfA nHFjx5nfYc4Ehphf0DVWsMhW1A== X-Received: by 2002:adf:e544:: with SMTP id z4mr5081381wrm.6.1573157831475; Thu, 07 Nov 2019 12:17:11 -0800 (PST) Received: from localhost.localdomain ([95.147.198.88]) by smtp.gmail.com with ESMTPSA id d11sm3215162wrn.28.2019.11.07.12.17.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Nov 2019 12:17:10 -0800 (PST) From: Lee Jones To: gregkh@google.com Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski , Linus Walleij , Sekhar Nori , Sasha Levin , Lee Jones Subject: [PATCH 06/10] ARM: davinci: da850-evm: call regulator_has_full_constraints() Date: Thu, 7 Nov 2019 20:16:58 +0000 Message-Id: <20191107201702.27023-6-lee.jones@linaro.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191107201702.27023-1-lee.jones@linaro.org> References: <20191107201702.27023-1-lee.jones@linaro.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bartosz Golaszewski [ Upstream commit 0c0c9b5753cd04601b17de09da1ed2885a3b42fe ] The BB expander at 0x21 i2c bus 1 fails to probe on da850-evm because the board doesn't set has_full_constraints to true in the regulator API. Call regulator_has_full_constraints() at the end of board registration just like we do in da850-lcdk and da830-evm. Reviewed-by: Linus Walleij Signed-off-by: Bartosz Golaszewski Signed-off-by: Sekhar Nori Signed-off-by: Sasha Levin Signed-off-by: Lee Jones Change-Id: I02d04d302a679996b88868ddb289fc5185f53fa4 --- arch/arm/mach-davinci/board-da850-evm.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.24.0 diff --git a/arch/arm/mach-davinci/board-da850-evm.c b/arch/arm/mach-davinci/board-da850-evm.c index 83f579add9e4..85fbf14b956a 100644 --- a/arch/arm/mach-davinci/board-da850-evm.c +++ b/arch/arm/mach-davinci/board-da850-evm.c @@ -1482,6 +1482,8 @@ static __init void da850_evm_init(void) if (ret) pr_warn("%s: dsp/rproc registration failed: %d\n", __func__, ret); + + regulator_has_full_constraints(); } #ifdef CONFIG_SERIAL_8250_CONSOLE From patchwork Thu Nov 7 20:16:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 178826 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp1581362ilf; Thu, 7 Nov 2019 12:17:21 -0800 (PST) X-Google-Smtp-Source: APXvYqzVveaBKuNY9D0/xPKOtjV3OeHydOGvnxh9G9w7aXiC1SxxytAdRnDv7bfjcpLeujqNNnrD X-Received: by 2002:a17:906:79c9:: with SMTP id m9mr4848096ejo.297.1573157841525; Thu, 07 Nov 2019 12:17:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573157841; cv=none; d=google.com; s=arc-20160816; b=QIo9IVtISP6hC0XJzQDR1x9ze93TK/1m7PV41tMfry1mVqBki8AveWwjcUPidOotzW F0aFgPp8L1or8BWbyLGtmOOzxV505O/Ho8dJhDdyIXAW9vcwg52mob4W48dRel668a1R 9w1oi2vTg9aHyeDXSeJyicbkJLOaVnvEEqQD7KjNKiCEYKv1gGyhu8q5vjp2DI7apQZx ZQtNrfs/FjjvgzdL31KyagZXrgYt1o2V3PEAtWAqYzb83OqZ6cUPaf+F2OVpIL2zpiNt C0k61q1fWd/HBRGvEvtSgw8HtySdb/1R9FY7JvK2eeI0EOUXja6464+2g1byzvACXlBT uERA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=E/opqRnW7mjWd271JJZcuLRT2Lb4Wp0fV1/zJUBsf+Y=; b=gnlfTX+ihFWLvoUvdIppv2tLlPIB1uAsDuVyCx6N9WbGoeZse74j1SYE3NXKhreeox Vf8h9yjpCP4TLv8tfaddlV8yZOrsbKhIhT/OrD4x0AQzWdSB8vmd8cv6eB9Hp75fKcks gk2Gq+MF7xNUliOtk+M3T1u3JhdgrZ74OZ2RhDZK1s1D+KjLuq5FBqBINmPPsNc/IFhY a8JxWbH9eUTYaTZfAe5j78AeR+A8G0/AUrA/efl/WQ8DoHSJZm40z4I2Rc0kuT70oV+c WarHsh1fT0nJHNWiofY113X/YTojyrnigIEw8Wv8fM4cYTMx07SPW8hXovrjseQy/i50 HesQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ne9mmSOf; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g19si2497652edb.280.2019.11.07.12.17.21; Thu, 07 Nov 2019 12:17:21 -0800 (PST) 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=@linaro.org header.s=google header.b=ne9mmSOf; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727265AbfKGURU (ORCPT + 26 others); Thu, 7 Nov 2019 15:17:20 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:46629 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726995AbfKGURO (ORCPT ); Thu, 7 Nov 2019 15:17:14 -0500 Received: by mail-wr1-f65.google.com with SMTP id b3so4498324wrs.13 for ; Thu, 07 Nov 2019 12:17:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=E/opqRnW7mjWd271JJZcuLRT2Lb4Wp0fV1/zJUBsf+Y=; b=ne9mmSOfGkk5Y32hWFtONWWsmIM6mTY5QO445acSLVvqUN6Zu/45H+2vjLokJMrQnJ CffvUybm7kU9O1IBsUoR14V1nkNOidakqp4r6dXlXloZv5VmaD0bOGFblQC4hpejoA45 ClKCVPEmxlsGBuzSb4eyipp6TKpjYw/wMQ15udpflXFruBkMjppJC+cseXXN7b64rRBS 7UOGuKbJu288ebTc8duWSW+61vLZ2mEnZI/exCueQWFTr86iGZnA0RBja4FdgAemBU+O lzqFaB8k6yNZA6ZoehgPYTFuG09Belb7Rl1KYo2cEBfdIdsZ9DNxavs3iLIUrphe92Vu 1zQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=E/opqRnW7mjWd271JJZcuLRT2Lb4Wp0fV1/zJUBsf+Y=; b=n9GPCuEuJNTYqDo1kMXCC50skZec0rUOhYNtymrrLcChqFqBq69MJOoJpp/Mld/Hb4 HZdmWULao0iJRg6PIZZecMELcX+ORVqfetIUmCb2jnzOUikBpTifWab9/epFTOGGFxtV zdUf2N+RblQSb5eTUZq4xZ2kwZH5fecHaub/pcOcCmUo2oG4CSiRSr+ZPsEf0nRjehaE ONxXHusFGGyI6Eh0lk9oMwhpcGyfTw6+VpQXpCpBa0BzFj1e91eWg2eg3woT4A2zN8TQ qPjaW7dFMyi+vPzvqRUcaY7Sc/nbMox8yYnvNfACHc+TmNfLphYl2+0mjGdBbCKRtoCv QrnA== X-Gm-Message-State: APjAAAVQJrsK7o0rcmnUVxUJ9EziLcSh5n7wm2qGq9Zz59sKOmLd6bX6 4y/dvE0msTuyB2E2DCl9VXvAHg== X-Received: by 2002:a05:6000:11c4:: with SMTP id i4mr4682337wrx.277.1573157832439; Thu, 07 Nov 2019 12:17:12 -0800 (PST) Received: from localhost.localdomain ([95.147.198.88]) by smtp.gmail.com with ESMTPSA id d11sm3215162wrn.28.2019.11.07.12.17.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Nov 2019 12:17:11 -0800 (PST) From: Lee Jones To: gregkh@google.com Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Mariusz Tkaczyk , Song Liu , Sasha Levin , Lee Jones Subject: [PATCH 07/10] md: fix for divide error in status_resync Date: Thu, 7 Nov 2019 20:16:59 +0000 Message-Id: <20191107201702.27023-7-lee.jones@linaro.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191107201702.27023-1-lee.jones@linaro.org> References: <20191107201702.27023-1-lee.jones@linaro.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mariusz Tkaczyk [ Upstream commit 9642fa73d073527b0cbc337cc17a47d545d82cd2 ] Stopping external metadata arrays during resync/recovery causes retries, loop of interrupting and starting reconstruction, until it hit at good moment to stop completely. While these retries curr_mark_cnt can be small- especially on HDD drives, so subtraction result can be smaller than 0. However it is casted to uint without checking. As a result of it the status bar in /proc/mdstat while stopping is strange (it jumps between 0% and 99%). The real problem occurs here after commit 72deb455b5ec ("block: remove CONFIG_LBDAF"). Sector_div() macro has been changed, now the divisor is casted to uint32. For db = -8 the divisior(db/32-1) becomes 0. Check if db value can be really counted and replace these macro by div64_u64() inline. Signed-off-by: Mariusz Tkaczyk Signed-off-by: Song Liu Signed-off-by: Sasha Levin Signed-off-by: Lee Jones Change-Id: If2744cff07135d0c1fa5f55bcec36ab2137b841e --- drivers/md/md.c | 36 ++++++++++++++++++++++-------------- 1 file changed, 22 insertions(+), 14 deletions(-) -- 2.24.0 diff --git a/drivers/md/md.c b/drivers/md/md.c index ba201db6afce..9a84a74747f8 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c @@ -6701,9 +6701,9 @@ static void status_unused(struct seq_file *seq) static void status_resync(struct seq_file *seq, struct mddev *mddev) { sector_t max_sectors, resync, res; - unsigned long dt, db; - sector_t rt; - int scale; + unsigned long dt, db = 0; + sector_t rt, curr_mark_cnt, resync_mark_cnt; + int scale, recovery_active; unsigned int per_milli; if (mddev->curr_resync <= 3) @@ -6759,22 +6759,30 @@ static void status_resync(struct seq_file *seq, struct mddev *mddev) * db: blocks written from mark until now * rt: remaining time * - * rt is a sector_t, so could be 32bit or 64bit. - * So we divide before multiply in case it is 32bit and close - * to the limit. - * We scale the divisor (db) by 32 to avoid losing precision - * near the end of resync when the number of remaining sectors - * is close to 'db'. - * We then divide rt by 32 after multiplying by db to compensate. - * The '+1' avoids division by zero if db is very small. + * rt is a sector_t, which is always 64bit now. We are keeping + * the original algorithm, but it is not really necessary. + * + * Original algorithm: + * So we divide before multiply in case it is 32bit and close + * to the limit. + * We scale the divisor (db) by 32 to avoid losing precision + * near the end of resync when the number of remaining sectors + * is close to 'db'. + * We then divide rt by 32 after multiplying by db to compensate. + * The '+1' avoids division by zero if db is very small. */ dt = ((jiffies - mddev->resync_mark) / HZ); if (!dt) dt++; - db = (mddev->curr_mark_cnt - atomic_read(&mddev->recovery_active)) - - mddev->resync_mark_cnt; + + curr_mark_cnt = mddev->curr_mark_cnt; + recovery_active = atomic_read(&mddev->recovery_active); + resync_mark_cnt = mddev->resync_mark_cnt; + + if (curr_mark_cnt >= (recovery_active + resync_mark_cnt)) + db = curr_mark_cnt - (recovery_active + resync_mark_cnt); rt = max_sectors - resync; /* number of remaining sectors */ - sector_div(rt, db/32+1); + rt = div64_u64(rt, db/32+1); rt *= dt; rt >>= 5; From patchwork Thu Nov 7 20:17:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 178827 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp1581432ilf; Thu, 7 Nov 2019 12:17:25 -0800 (PST) X-Google-Smtp-Source: APXvYqz5LLXLZ/DagFHY9mJLF0XhZBQDB03NQuaQI5zP4fcVW7b5Jc1bHiwGvsfaFETvy+WbvfVA X-Received: by 2002:aa7:c943:: with SMTP id h3mr5733412edt.207.1573157845177; Thu, 07 Nov 2019 12:17:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573157845; cv=none; d=google.com; s=arc-20160816; b=af3DALwUbwTAi46phXgbwA1EC1oykQuY/DT/6bGv24HarMzAT/HkeIcQf6GqXXAtqN 0yuD0MaEcCdE7nUmEmKtOd412W2q52F11wP36AI4x3JtVU7Xjwpp73j5z7gaFZ7QtZqL LyMNUbOirnwLRYgW7HyzZYFgwlzI/Wuib8VpHQuTAxtVSWFRB9ubgixYUG9wnxm1Hwbs R/SDEwVlu8q1/s2J9eqbZyb8xCf1PiTMS/2/gxXE3Jb0WiqCymP/ourCWaorUKTyrFrH xOoRagq0G5cpctd5Y24TPyf4hLjMl1m7lD/agfXc1NfUEhb5PvrcBcybE3yRycROd08D ZQyQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Qa6zPAo+YKu4/swyBIVIn4JlZMDMbBdI4/pSMmOsjVY=; b=a86L4VBInKmm2X/zX7N4lLGqRbUi+qwwl0kgzMn0cmBbHSww3dBReo3bvhnhhKmb9C RDbngWb/wVATCRXoOedt4vcqvzLb1VRJNKAUK4mBA8ta+X2QnIhodrH9kHMh+i/xHtH0 +JSwpHetQf1KASxvqhBU0HoqDrEpBepWDLnGpzDZJLksOtj1E81due1IL0WbE5yOZBI6 A/VsaGl3txvvsJ1j3VPCB3YuLPImO1E/uG/IX6ONJL3hl04ZA3/uebc+eR1INZxZvqDJ HLZXS0sN7tz6/xX2tt+J/4hAXgMOxEI4AdIneTN4HlZdNEeHu1tUEdPRB7syi9LGbdu1 hZ8Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UYGqinQH; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g19si2497652edb.280.2019.11.07.12.17.24; Thu, 07 Nov 2019 12:17:25 -0800 (PST) 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=@linaro.org header.s=google header.b=UYGqinQH; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727347AbfKGURX (ORCPT + 26 others); Thu, 7 Nov 2019 15:17:23 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:40313 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727059AbfKGURP (ORCPT ); Thu, 7 Nov 2019 15:17:15 -0500 Received: by mail-wr1-f67.google.com with SMTP id i10so4542155wrs.7 for ; Thu, 07 Nov 2019 12:17:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Qa6zPAo+YKu4/swyBIVIn4JlZMDMbBdI4/pSMmOsjVY=; b=UYGqinQHyqZIppvIcVqUyOQCgWCGngK6A/7+UHZglau2c8Oz6o2jzn0pUp/AczP1Ir JdegspDcYdAdzHIIGNKfyq1e0o3xm6PHtc6DyzYMqhCQz9FlSk06ALhiLY0HN9F4pSg5 fVr9dizjSL1GRn4AvPgL71JHOBSG8NWS+y8bL6j63ZHDLGafFgapbMFEuZR3xE1qgekI H5sQGa/mQvD9Yfan4oOqnLq/IonTJazCq19dkJlFFCH6AICdlsy5Jh5vxGqGbhi5zqa6 WR0MMzImLZmxr6M6nfTGO/tgLKV0Ty536p5nbF+igIw0CkFrVeSAY3zEy0lmjOosuCAu D4Cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Qa6zPAo+YKu4/swyBIVIn4JlZMDMbBdI4/pSMmOsjVY=; b=uMgm6H6+c2ckjfc1j0fahuF9xcMkZoooJ3OQKtRDwO87XBy93SHyBOij49OWe2mX0W rcqeLuxbpflkMfcBRv8JrGSAEW/6jhsWODviqWP1kFm20aiQvz/hErRElROZ5bAeTKq0 CN37ZdACBArBKQD8c5va2wB6G7ZIZQOo7J4+xgg2yiRmz0HQwULPaGnhQvvg7QEfdaHh /kEhAHKsm81IbKInnRRetID2bchNLH8gvfSMdXRw4FFnDcS92jJOw8o7yIAsVAyyM9x2 7jFSeoSxesPaXdJSvxjwqr/dCxrljzXGRVQ9PdBnsrSgVj0zz6j4OKPkAljAr8sL/6ik 4fiA== X-Gm-Message-State: APjAAAXQ7H0jcxQ2hvhajkl/ve38c/CQfLypSbNpP6Or4B0F56f0ug/d RUoEeL40O5v8LkxI09RVF3wZlA== X-Received: by 2002:adf:fd4b:: with SMTP id h11mr4595221wrs.191.1573157833238; Thu, 07 Nov 2019 12:17:13 -0800 (PST) Received: from localhost.localdomain ([95.147.198.88]) by smtp.gmail.com with ESMTPSA id d11sm3215162wrn.28.2019.11.07.12.17.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Nov 2019 12:17:12 -0800 (PST) From: Lee Jones To: gregkh@google.com Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, "Mauro S. M. Rodrigues" , Sudarsana Reddy Kalluru , "David S . Miller" , Sasha Levin , Lee Jones Subject: [PATCH 08/10] bnx2x: Check if transceiver implements DDM before access Date: Thu, 7 Nov 2019 20:17:00 +0000 Message-Id: <20191107201702.27023-8-lee.jones@linaro.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191107201702.27023-1-lee.jones@linaro.org> References: <20191107201702.27023-1-lee.jones@linaro.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Mauro S. M. Rodrigues" [ Upstream commit cf18cecca911c0db96b868072665347efe6df46f ] Some transceivers may comply with SFF-8472 even though they do not implement the Digital Diagnostic Monitoring (DDM) interface described in the spec. The existence of such area is specified by the 6th bit of byte 92, set to 1 if implemented. Currently, without checking this bit, bnx2x fails trying to read sfp module's EEPROM with the follow message: ethtool -m enP5p1s0f1 Cannot get Module EEPROM data: Input/output error Because it fails to read the additional 256 bytes in which it is assumed to exist the DDM data. This issue was noticed using a Mellanox Passive DAC PN 01FT738. The EEPROM data was confirmed by Mellanox as correct and similar to other Passive DACs from other manufacturers. Signed-off-by: Mauro S. M. Rodrigues Acked-by: Sudarsana Reddy Kalluru Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Signed-off-by: Lee Jones Change-Id: I4cae3b2ae3a298d6c0a7dd3fbf6fe97c1acba239 --- drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c | 3 ++- drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) -- 2.24.0 diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c index 2a518c998ecc..57014e89a3c6 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_ethtool.c @@ -1531,7 +1531,8 @@ static int bnx2x_get_module_info(struct net_device *dev, } if (!sff8472_comp || - (diag_type & SFP_EEPROM_DIAG_ADDR_CHANGE_REQ)) { + (diag_type & SFP_EEPROM_DIAG_ADDR_CHANGE_REQ) || + !(diag_type & SFP_EEPROM_DDM_IMPLEMENTED)) { modinfo->type = ETH_MODULE_SFF_8079; modinfo->eeprom_len = ETH_MODULE_SFF_8079_LEN; } else { diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h index d9cce4c3899b..e909275ff2af 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.h @@ -60,6 +60,7 @@ #define SFP_EEPROM_DIAG_TYPE_ADDR 0x5c #define SFP_EEPROM_DIAG_TYPE_SIZE 1 #define SFP_EEPROM_DIAG_ADDR_CHANGE_REQ (1<<2) +#define SFP_EEPROM_DDM_IMPLEMENTED (1<<6) #define SFP_EEPROM_SFF_8472_COMP_ADDR 0x5e #define SFP_EEPROM_SFF_8472_COMP_SIZE 1 From patchwork Thu Nov 7 20:17:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 178829 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp1581565ilf; Thu, 7 Nov 2019 12:17:32 -0800 (PST) X-Google-Smtp-Source: APXvYqx5SAlh9ELZ5V5LU2fVcDz+3clXTz3j7CXbRmz+seNGBv6C+FGM76azKxDkvHVtSYegm3Tq X-Received: by 2002:a50:9254:: with SMTP id j20mr6181368eda.0.1573157852707; Thu, 07 Nov 2019 12:17:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573157852; cv=none; d=google.com; s=arc-20160816; b=NeNzlTTmXC05ECJ0gZ9Dxyv634/rkoX1XZwVnCQD4BbhIVdvr7/hPeBj5sMD4xmzPh gNlO/FDgtSP4ADbWS4cGH6+2F+FItDJ3bbhtv1U64oO06HNABGS6ghx1RJB7PF0yzFlF tbzJpE0UMRFe9STSBKtK0FZigSCI5bqgRuXKXscTOksOWKrseY7wKSjJovFwgEdzd/yG 5KR7xI4IJL1V8uAtzpjzF23K7QCFxClzcfZpI44Yq4F0MIb7k0LdrWS7PmQuPU5Nlfxe q5PV5UFgtuLOzrHx1ApikroGoEBEQPO1nV2S1+CCYyxbOxsFhZ9uPB7zXYLKm7tDxFgP +xEw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=T+zsluzS/T4QlV+amlXXzj5zuhGksPk6IuGM8tASFHM=; b=ZkWqMA+aVu59g9H4+3RQC564BGwY8mePQFHoWs3CkWlwvIBmUi+v7MQHENYvHmRgv5 Jmla/JVB3ppq4MhpqfUKcluFE3jkpdTZoQudAXXOZF6tyqrE+dmx8GQRIEJNBUtBsj2a GO89fEW5Yn8lzeoePkfCaBhsu2h58sZoBAnTYt4OMd7mO+/qoM8f0qbECbYPdL31KJlf 4TKxubJUpFy+7i6R6mvxigg3FzsI3NBn0BXJfyAO5QkVa76yW9/e/gTxhMt7Medo49lF g3nqye+NRlh6/yAfttkOFt+fnVd6++CjVOo4J5WIGm0+6pD9lVVVogEjrFoogv7fsyXI e4QA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=J69UedwD; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f3si2137345ejb.49.2019.11.07.12.17.32; Thu, 07 Nov 2019 12:17:32 -0800 (PST) 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=@linaro.org header.s=google header.b=J69UedwD; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727458AbfKGURa (ORCPT + 26 others); Thu, 7 Nov 2019 15:17:30 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:33176 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726616AbfKGURP (ORCPT ); Thu, 7 Nov 2019 15:17:15 -0500 Received: by mail-wm1-f66.google.com with SMTP id a17so4944470wmb.0 for ; Thu, 07 Nov 2019 12:17:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=T+zsluzS/T4QlV+amlXXzj5zuhGksPk6IuGM8tASFHM=; b=J69UedwDH6qm/d/QY5IaFKnLBYOqIVP0y9qtbza0hVQLaDDn7dW1HHq4iXHHLyTBzl JzG4DDQFjUi576WuidaONs8q5hxghV9y8rlC42ZmP9n2OsIwUVPwixWPTssgCO9YMvNy AoesUy4qA7O2zzgNtS25nLDcg1ZDEzqVmwEcYnC2AkDw90FIdravTeMVzm1qhn9Zy+0D y26p6Cw4cEHXgX+8uwo6/w9xkh8XeGuJ89KNrHujCwCo6q0GNXGbht7l32zcYBNKClYn LAVreQ2L6G19/YDVCyUnvStjOXvozavkSHR25B5mQYDeV6Cpt/k5Jlbte9FkaUBo8n5O QoIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=T+zsluzS/T4QlV+amlXXzj5zuhGksPk6IuGM8tASFHM=; b=GvsB+0bthF0azLPug3IM6nkmWItGojnROsxmq2ayqjin+BgL3r8FLwhrXK/+Deuyfz icviSc+PNiuWlg11C3++HJdY9VZGffSSgZZYDe90h9b2vBCLOP5R78wouEwMXFLXMDVI LvJknm2ZA0xp6Ub8VQei74ZZ/r1oAs9UnPnsCW3G13c5sTjkwULjKqWEw6XRqHiJlfnU LbdJ/6jWg1WqXdiUNyDiG2v3cWRX8axGP+Arly2KN+55WkEx96a7oBEWIUg8VI0DEKuU z3d2xL8jgFtphejfSC+C5AqeNqFZ+YEYKGHSRcctzgYVNRV3ESys3v432tkEJ8bzPqFw shVg== X-Gm-Message-State: APjAAAXBHaVxgmzudg1lPeyT/CFl0LctFxD0Gv66iZ+cOs7M5uU/m47i CkZZH/pJeUoOZytAp/VCs1TQGA== X-Received: by 2002:a1c:2155:: with SMTP id h82mr4601632wmh.94.1573157834195; Thu, 07 Nov 2019 12:17:14 -0800 (PST) Received: from localhost.localdomain ([95.147.198.88]) by smtp.gmail.com with ESMTPSA id d11sm3215162wrn.28.2019.11.07.12.17.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Nov 2019 12:17:13 -0800 (PST) From: Lee Jones To: gregkh@google.com Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Bartosz Golaszewski , Sekhar Nori , Sasha Levin , Lee Jones Subject: [PATCH 09/10] ARM: davinci: da8xx: specify dma_coherent_mask for lcdc Date: Thu, 7 Nov 2019 20:17:01 +0000 Message-Id: <20191107201702.27023-9-lee.jones@linaro.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191107201702.27023-1-lee.jones@linaro.org> References: <20191107201702.27023-1-lee.jones@linaro.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Bartosz Golaszewski [ Upstream commit 68f2515bb31a664ba3e2bc1eb78dd9f529b10067 ] The lcdc device is missing the dma_coherent_mask definition causing the following warning on da850-evm: da8xx_lcdc da8xx_lcdc.0: found Sharp_LK043T1DG01 panel ------------[ cut here ]------------ WARNING: CPU: 0 PID: 1 at kernel/dma/mapping.c:247 dma_alloc_attrs+0xc8/0x110 Modules linked in: CPU: 0 PID: 1 Comm: swapper Not tainted 5.2.0-rc3-00077-g16d72dd4891f #18 Hardware name: DaVinci DA850/OMAP-L138/AM18x EVM [] (unwind_backtrace) from [] (show_stack+0x10/0x14) [] (show_stack) from [] (__warn+0xec/0x114) [] (__warn) from [] (warn_slowpath_null+0x3c/0x48) [] (warn_slowpath_null) from [] (dma_alloc_attrs+0xc8/0x110) [] (dma_alloc_attrs) from [] (fb_probe+0x228/0x5a8) [] (fb_probe) from [] (platform_drv_probe+0x48/0x9c) [] (platform_drv_probe) from [] (really_probe+0x1d8/0x2d4) [] (really_probe) from [] (driver_probe_device+0x5c/0x168) [] (driver_probe_device) from [] (device_driver_attach+0x58/0x60) [] (device_driver_attach) from [] (__driver_attach+0x80/0xbc) [] (__driver_attach) from [] (bus_for_each_dev+0x64/0xb4) [] (bus_for_each_dev) from [] (bus_add_driver+0xe4/0x1d8) [] (bus_add_driver) from [] (driver_register+0x78/0x10c) [] (driver_register) from [] (do_one_initcall+0x48/0x1bc) [] (do_one_initcall) from [] (kernel_init_freeable+0x10c/0x1d8) [] (kernel_init_freeable) from [] (kernel_init+0x8/0xf4) [] (kernel_init) from [] (ret_from_fork+0x14/0x34) Exception stack(0xc6837fb0 to 0xc6837ff8) 7fa0: 00000000 00000000 00000000 00000000 7fc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 7fe0: 00000000 00000000 00000000 00000000 00000013 00000000 ---[ end trace 8a8073511be81dd2 ]--- Add a 32-bit mask to the platform device's definition. Signed-off-by: Bartosz Golaszewski Signed-off-by: Sekhar Nori Signed-off-by: Sasha Levin Signed-off-by: Lee Jones Change-Id: I835e72dbeb9ded2ffc7be0561f8f3544c3cc29ed --- arch/arm/mach-davinci/devices-da8xx.c | 3 +++ 1 file changed, 3 insertions(+) -- 2.24.0 diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c index e83874ba6e6d..49716ba0bbb1 100644 --- a/arch/arm/mach-davinci/devices-da8xx.c +++ b/arch/arm/mach-davinci/devices-da8xx.c @@ -626,6 +626,9 @@ static struct platform_device da8xx_lcdc_device = { .id = 0, .num_resources = ARRAY_SIZE(da8xx_lcdc_resources), .resource = da8xx_lcdc_resources, + .dev = { + .coherent_dma_mask = DMA_BIT_MASK(32), + } }; int __init da8xx_register_lcdc(struct da8xx_lcdc_platform_data *pdata) From patchwork Thu Nov 7 20:17:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 178828 Delivered-To: patch@linaro.org Received: by 2002:a92:38d5:0:0:0:0:0 with SMTP id g82csp1581553ilf; Thu, 7 Nov 2019 12:17:32 -0800 (PST) X-Google-Smtp-Source: APXvYqy4X9DMyoLw2QDsDhUiOFsi93yiXWhso0jCWedJlWrdN/CJXikBBlSRxeMlMB6dnG8MFwVm X-Received: by 2002:a17:906:6d8a:: with SMTP id h10mr5043657ejt.224.1573157852062; Thu, 07 Nov 2019 12:17:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573157852; cv=none; d=google.com; s=arc-20160816; b=tNEt2JcrDQksJz5kIf4cHCGsFRerRFl3Qwb/U3c0klDy910459reqikQxJZVF408HR eRwmW1JpXRw08mCvVfx7UbXN6Pb60EzgD4fFcwuCNMaThlt4OR2SHB9dhK8umdLfMqu0 U+q+43FAi5NLveV+qBsTugMx7CYdXeMdUmGiUQ1w0oq1hHqT7+n673Xe+pCDsR9EdJvy tc9x7l/u1lgghRcLc1PEQ/iSYgG59zAM0Vr8xSfHCZvKIv8rhxWRwxzLy229rt3Yaw2A kN69Jla1bEgTon4ty5lM0z4OL1xNXQi8Nibq0LYII92uQgCHISjGq9SNlAshtAx4yhWb Q/dw== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=IfBF8N8O1vGmVN86XMswrU/+wD8KeNGcTXaMDHv5bNc=; b=oAswKPXmjvo1+Pz0bZilBDS+npVFoetn9JNu4TYDB6w6wPvBKGFZ9kgY84lCud3V/y ToVhxFV9IFqV8MZEc3x4xxeT7RbKPQz9afz/2ppoC3KrFyIAXivKbKR/+7Ljc2SAdl0c jaLflbI2i0ObsxjZ4Q0ceFKy/tmMkwr6+wueNp5keObik/qDpJu6/5K/0EdZedUqzNt1 RhMNSaH/FQaWMdbT7Va7JJJvYA2we7xxFpMUrOsbhDjd4qTPb2n6JDObBnDRk1DAp+x3 8O6Aofs6ADqYnXjaYFCr7r9AS2MaTmzegutXYCgGjqDVxrdu35qP6HAT+fBYo1TlHyrA vXig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fChiVLhY; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f3si2137345ejb.49.2019.11.07.12.17.31; Thu, 07 Nov 2019 12:17:32 -0800 (PST) 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=@linaro.org header.s=google header.b=fChiVLhY; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727405AbfKGUR1 (ORCPT + 26 others); Thu, 7 Nov 2019 15:17:27 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:44309 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727129AbfKGURR (ORCPT ); Thu, 7 Nov 2019 15:17:17 -0500 Received: by mail-wr1-f67.google.com with SMTP id f2so4497360wrs.11 for ; Thu, 07 Nov 2019 12:17:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=IfBF8N8O1vGmVN86XMswrU/+wD8KeNGcTXaMDHv5bNc=; b=fChiVLhYdW8MmlavzflarIALwM6oQ0oST9a0xpt5JGB0qZEOMP7X0WdzhndbJXFXKD 6k8LOvZvA/TsBMcho59C3LYvbxjYxz0B/Cy2BlH6plJHiYRj6Q8UZdvSDthBoHwHKpiN lYU4B1emlpo79KIN0NkyazFGkzrtsvMP7v8jmv0bJiIGsicKBClB5c0w9mguUu2YQKrv IfcsibvoqBXkS96uVqk0slcwOz7Ht0tocUPpxc34eo5loD6TpalowitM3JU1+OYEsyIo fkw6xKIKLvF1OZmeSxx5MBOBO2rpemTZADULbrE++JP1JtBSnPL5q5NJuyJ8vihLnp/Y gkKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=IfBF8N8O1vGmVN86XMswrU/+wD8KeNGcTXaMDHv5bNc=; b=blQlkxcLih9+7yptZb9FaHptDo5i08+0jJfpqA1xv60Ht0Xv71cIQKLm3MzOB6BnbQ fP02M/jZE0XkpjrsKOpWSp7VTxBrYufwXT4Z8Q6EzCuTqzPJbkIhG9+Fzo9wiMJomvFw mGVSydYD+cHg4sqJXT4Gp1BxsKXmPVhM71ZqbIG6wfQuJ/Wy0K4KJmZn2COWT+BabcQm TO8Bi+VO32ENBnTInP77yQaPuPFkSYc+5Mlwh1qxybZKXq2IdntudqYQJwQmwUOTKU/H q0byx9z1UUKPsyP5tXO1D+qz18SxHIlJJrScsReRB+rn+8BBlFuLgFYh0GWqglrMaYol QU9A== X-Gm-Message-State: APjAAAWNJCV6xVESldwNpxCstK13X+L48UfCKdYM2UBTQH9HK8UhKbtV lS1PivvBxW/+sMTTbQ+OPIG4hQ== X-Received: by 2002:adf:b686:: with SMTP id j6mr4742254wre.186.1573157834960; Thu, 07 Nov 2019 12:17:14 -0800 (PST) Received: from localhost.localdomain ([95.147.198.88]) by smtp.gmail.com with ESMTPSA id d11sm3215162wrn.28.2019.11.07.12.17.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Nov 2019 12:17:14 -0800 (PST) From: Lee Jones To: gregkh@google.com Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Sean Nyekjaer , Marc Kleine-Budde , Sasha Levin , Lee Jones Subject: [PATCH 10/10] can: mcp251x: add support for mcp25625 Date: Thu, 7 Nov 2019 20:17:02 +0000 Message-Id: <20191107201702.27023-10-lee.jones@linaro.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191107201702.27023-1-lee.jones@linaro.org> References: <20191107201702.27023-1-lee.jones@linaro.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sean Nyekjaer [ Upstream commit 35b7fa4d07c43ad79b88e6462119e7140eae955c ] Fully compatible with mcp2515, the mcp25625 have integrated transceiver. This patch adds support for the mcp25625 to the existing mcp251x driver. Signed-off-by: Sean Nyekjaer Signed-off-by: Marc Kleine-Budde Signed-off-by: Sasha Levin Signed-off-by: Lee Jones Change-Id: I537254af4e09553f04873e3cf6be36dbbfc29c88 --- drivers/net/can/spi/Kconfig | 5 +++-- drivers/net/can/spi/mcp251x.c | 25 ++++++++++++++++--------- 2 files changed, 19 insertions(+), 11 deletions(-) -- 2.24.0 diff --git a/drivers/net/can/spi/Kconfig b/drivers/net/can/spi/Kconfig index 148cae5871a6..249d2db7d600 100644 --- a/drivers/net/can/spi/Kconfig +++ b/drivers/net/can/spi/Kconfig @@ -2,9 +2,10 @@ menu "CAN SPI interfaces" depends on SPI config CAN_MCP251X - tristate "Microchip MCP251x SPI CAN controllers" + tristate "Microchip MCP251x and MCP25625 SPI CAN controllers" depends on HAS_DMA ---help--- - Driver for the Microchip MCP251x SPI CAN controllers. + Driver for the Microchip MCP251x and MCP25625 SPI CAN + controllers. endmenu diff --git a/drivers/net/can/spi/mcp251x.c b/drivers/net/can/spi/mcp251x.c index c66d699640a9..6f86fdf6c9f1 100644 --- a/drivers/net/can/spi/mcp251x.c +++ b/drivers/net/can/spi/mcp251x.c @@ -1,5 +1,5 @@ /* - * CAN bus driver for Microchip 251x CAN Controller with SPI Interface + * CAN bus driver for Microchip 251x/25625 CAN Controller with SPI Interface * * MCP2510 support and bug fixes by Christian Pellegrin * @@ -41,7 +41,7 @@ * static struct spi_board_info spi_board_info[] = { * { * .modalias = "mcp2510", - * // or "mcp2515" depending on your controller + * // "mcp2515" or "mcp25625" depending on your controller * .platform_data = &mcp251x_info, * .irq = IRQ_EINT13, * .max_speed_hz = 2*1000*1000, @@ -237,6 +237,7 @@ static const struct can_bittiming_const mcp251x_bittiming_const = { enum mcp251x_model { CAN_MCP251X_MCP2510 = 0x2510, CAN_MCP251X_MCP2515 = 0x2515, + CAN_MCP251X_MCP25625 = 0x25625, }; struct mcp251x_priv { @@ -279,7 +280,6 @@ static inline int mcp251x_is_##_model(struct spi_device *spi) \ } MCP251X_IS(2510); -MCP251X_IS(2515); static void mcp251x_clean(struct net_device *net) { @@ -639,7 +639,7 @@ static int mcp251x_hw_reset(struct spi_device *spi) /* Wait for oscillator startup timer after reset */ mdelay(MCP251X_OST_DELAY_MS); - + reg = mcp251x_read_reg(spi, CANSTAT); if ((reg & CANCTRL_REQOP_MASK) != CANCTRL_REQOP_CONF) return -ENODEV; @@ -820,9 +820,8 @@ static irqreturn_t mcp251x_can_ist(int irq, void *dev_id) /* receive buffer 0 */ if (intf & CANINTF_RX0IF) { mcp251x_hw_rx(spi, 0); - /* - * Free one buffer ASAP - * (The MCP2515 does this automatically.) + /* Free one buffer ASAP + * (The MCP2515/25625 does this automatically.) */ if (mcp251x_is_2510(spi)) mcp251x_write_bits(spi, CANINTF, CANINTF_RX0IF, 0x00); @@ -831,7 +830,7 @@ static irqreturn_t mcp251x_can_ist(int irq, void *dev_id) /* receive buffer 1 */ if (intf & CANINTF_RX1IF) { mcp251x_hw_rx(spi, 1); - /* the MCP2515 does this automatically */ + /* The MCP2515/25625 does this automatically. */ if (mcp251x_is_2510(spi)) clear_intf |= CANINTF_RX1IF; } @@ -1004,6 +1003,10 @@ static const struct of_device_id mcp251x_of_match[] = { .compatible = "microchip,mcp2515", .data = (void *)CAN_MCP251X_MCP2515, }, + { + .compatible = "microchip,mcp25625", + .data = (void *)CAN_MCP251X_MCP25625, + }, { } }; MODULE_DEVICE_TABLE(of, mcp251x_of_match); @@ -1017,6 +1020,10 @@ static const struct spi_device_id mcp251x_id_table[] = { .name = "mcp2515", .driver_data = (kernel_ulong_t)CAN_MCP251X_MCP2515, }, + { + .name = "mcp25625", + .driver_data = (kernel_ulong_t)CAN_MCP251X_MCP25625, + }, { } }; MODULE_DEVICE_TABLE(spi, mcp251x_id_table); @@ -1254,5 +1261,5 @@ module_spi_driver(mcp251x_can_driver); MODULE_AUTHOR("Chris Elston , " "Christian Pellegrin "); -MODULE_DESCRIPTION("Microchip 251x CAN driver"); +MODULE_DESCRIPTION("Microchip 251x/25625 CAN driver"); MODULE_LICENSE("GPL v2");