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: 11233727 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 23DCC139A for ; Thu, 7 Nov 2019 20:17:16 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EF29721D6C for ; Thu, 7 Nov 2019 20:17:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="pDmaD5h+"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="HdbGDG/b" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EF29721D6C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=wQ2Ov79zYtsovQwbRIhurII8DEPiL6in6DB0mT/wbBE=; b=pDmaD5h+b+qMnO 5DBNRiVrdRpxl2u80ohbp7p7QkbIyEfufTIZDhA+2DZgbPQsj0bXS+SjdmroUZr+WMGBfig2vcgOw Dxgy7gQv+/vzSHAOseiMUaHztHLWun/Zv1+TqFCEescwSPbDQFhGJjLy2KFQmOKoW4f46900VLZ0B /4pEozDLHTDGcqbntamfyGzRuCslXQpfDrOW1g+T35u8dao4LBMb+4c4U1h1eQAqO8VP7ECn3xQ50 KQH8qkKhnnQvNrg0RhHQuh9Y9gAf4XDOKp1AlR8pphfYdMKU87VIHHS2iad4RfE32ai/tpMCiuI1Z W92i1i2l5RbHdP/6nWrQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iSoDP-0006Ah-Du; Thu, 07 Nov 2019 20:17:11 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iSoDL-00069W-UE for linux-arm-kernel@lists.infradead.org; Thu, 07 Nov 2019 20:17:09 +0000 Received: by mail-wr1-x444.google.com with SMTP id f2so4496926wrs.11 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=NBxZAGlNLmdPVq5ye1Kpc+HtwOXDKZm20/jXW048HoQJ5ON2NQxQJWWKxnB2GIU2rW 8MHN+vde3AwrRNODQWfqopuXVlMnJ08bWFzrgs/mG3uFUY8q3oLMic/zdDugkZocYOAQ B1pferqnzPsCjkR5+V/PKt6H07CUI0uQiVX8Y1rAdMbbZmptwI25EYPW2V/v40slPUuk DWLLa0Dkw09i5SF92Kbjn2VDW6LBYrUMniDz1l3IxyVQobNPVwsGfVp18+tCUgU7N8un oD26iPBIyGzWjqe2qB/uxw4rW5Ejms5FBoXYSD+vpJH7R4FHoCw/XJRYIhv0PRFG+lEB n6gA== X-Gm-Message-State: APjAAAX6HtuOxIj8gvbNebNU78n0AzcFwfD3B13nxIpAzEoW/gxknLDe zdOHaw/BKjYWA9u+RybijpxnWg== X-Google-Smtp-Source: APXvYqxskYQg9q985hoq9WCm5QC668oyfjuHraw4eT/RktdibeQ6Rb2kp4vLE3njmdl9xUCiiFZ/Nw== 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191107_121708_109123_F6BFC986 X-CRM114-Status: GOOD ( 10.90 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:444 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sasha Levin , linux-kernel@vger.kernel.org, Yu-Hsuan Hsu , Mark Brown , Lee Jones , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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(+) 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: 11233729 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id F0A0B139A for ; Thu, 7 Nov 2019 20:17:23 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B3B2A21882 for ; Thu, 7 Nov 2019 20:17:23 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="qf09LDjt"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="EC/SX8oo" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B3B2A21882 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=pD6XNH8CKo2WL/z0yx4MgMulF0NNsD19RJVwPOjAGR8=; b=qf09LDjtsA+vEG jjjUxSbnELCLAhrN33KN6tg2JMBVceVxrY1NJ0RVTABlvJx1tkxIJoEXREBIH56XWiUfeIX8JsOHP ts+a3PH1jgsSaYapz/QS6WQRv53W0tNfQ2sVUednlKqbOwaLnUbu1uaxVj7eAFAwRSy4WnUp8HxlJ 5PEMXqDkUZETpqiGlh+AN/25GGQfBa1qA9WyyoI+ZBpzZ7Mhd/WIDZ8fLTqbOJOXVMS0lnG4/BZRU /LQIYi5wh6h61htXZHL4Omq2PIJDlkwzgRTWUDLyE6BrOBXo1AiFOyT+q+BmXU+WTWPABhsdV5OCb sTXWYjWj1aPN2KbJsO7A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iSoDa-0006Me-Bs; Thu, 07 Nov 2019 20:17:22 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iSoDM-00069X-IQ for linux-arm-kernel@lists.infradead.org; Thu, 07 Nov 2019 20:17:09 +0000 Received: by mail-wr1-x444.google.com with SMTP id a11so4552892wra.6 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=VBqBxticVG9yvApy+CkvrEXsO/NOe7frgoF9udJPMW0fJpAoET0aqKj4TLVNZJLNwJ Q0sWqzVGUuqPNeHI3/xPzmw98CfMNnYG599L41shiBNEgTn985Ii0I2iwJYjnlw8SlsN pY1XvpJnJDCDYxmN4zc4zy83VzgrqB7aItSTx6Q3Y8g5moswC2KuK7legERNfZi+aP/V LOLhXs9FZ+WHDCIjDphYm3DMdsDxe6kgYFFhfy3DeYkBgLO2UNxcjiybPg8/rowUCBBB iGQj4RpdXEFrJ+k9Rvrkr/FpA1lgXPPXGQsdypd+eh1bMPqxlbhYlvO79bOjTEz5SFQW 2V9w== X-Gm-Message-State: APjAAAV9lutsmwTiqLZRZitmj6eI8J2Mwyz1KyhxpkajHzlgCLwNU18e NM2a+PHB6ZIhX7DtEnPRv/o8mg== X-Google-Smtp-Source: APXvYqwsnkG5W3lQgjzDjrPN3gpk1F2MAlnJ4iiacsTzP9kRpXXiviPWMQMCMjJN24d9pILn7v49QQ== 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191107_121708_605994_FFD0A5FE X-CRM114-Status: GOOD ( 12.67 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:444 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sasha Levin , Alexandre Belloni , Felipe Balbi , linux-kernel@vger.kernel.org, Sylvain Lemieux , Lee Jones , linux-arm-kernel@lists.infradead.org, James Grant Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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(-) 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: 11233731 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 996C414E5 for ; Thu, 7 Nov 2019 20:17:39 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7644821882 for ; Thu, 7 Nov 2019 20:17:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="MzPEG7ga"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="UFalviU5" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7644821882 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=OalmPAtq0MjRl/2pOhm6M3+6Whv2/O0+HDeWHmPPIHg=; b=MzPEG7gad3PHKs fqTBidhgwUOGSBdlHWBGsX+2z/dqO9x04uPxSEaCqdF1sI2ZvvBw/qRS41iR5G6GQPF3HJUO2V1j4 cZRFl0zX82tswaN16pJ7Ek0o/e0aIb2L8H/4oQqpTkkvvlsM/LBvIOf9EnckzbEJg56SVBdg7/5iV /Z3vqqaCTYhgsD543dMlvZKMaANhHhH3B6FmRt50WkZd4EvglQlQxTbiqZOEep9BD8JV0ZJddEboh J+I22TpJHZZS0p6c80w88AVJS5hS0NrvBKOoMMJh5wml4okdLhMYDYexJeaKLgJbyEe89ZuKdBLYP ocYOHBrtL9tEkf1MIzJw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iSoDq-0006cf-Qx; Thu, 07 Nov 2019 20:17:38 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iSoDN-0006A2-Lm for linux-arm-kernel@lists.infradead.org; Thu, 07 Nov 2019 20:17:11 +0000 Received: by mail-wr1-x444.google.com with SMTP id p4so4532683wrm.8 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=uF2w1H/zFif1O7m6UAqH8I0iBBna0To7A2JxfECXORUSh02+FyYXlSjvUBn3xsZAN/ XD/gqMW5+ey3NXcevK02fckVDQ6ZdyV89Xy65ebzhzio3G59j3vJ1KZD/yR5Cv/oc0ff q8CVa7Lpo8DeaZupoTI6KtlRJfX7/O4ozP77HrgHMadkvM0Ih8w8gaedZ+f8Be/PJBhp sv0+GAT3niXqtc/iNBUx9AbFbxjzZF1Y6B3Ey16pSmClzl5gfCMRW5XQAtjPnpv+9pAM 8AzexPMbhL8KTERLYdwLz0crw8nDnJL7cuwQbbhHRzB88aCJ0fS+qZZwY20WerVqvGGx y6dA== X-Gm-Message-State: APjAAAU/5LtXGoOiafM0PRQur+croiiC7QBXVb9IXPD1T+Gsaedfek9O jfzxeOiZrqIZXsRhW9+oNWxEYA== X-Google-Smtp-Source: APXvYqxVUNWlPOOt3bFH9N90uImbfbh5nOhmdyu9PeF7oFMBWFpxonLriEOHbnLlemth0Zl314fKDA== 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191107_121709_707657_920460EA X-CRM114-Status: GOOD ( 12.71 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:444 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sasha Levin , Johannes Berg , linux-kernel@vger.kernel.org, Thomas Pedersen , Lee Jones , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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(-) 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: 11233733 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 76CF714E5 for ; Thu, 7 Nov 2019 20:17:52 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2B6B721D79 for ; Thu, 7 Nov 2019 20:17:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="fp0C6oPg"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="dD3bgNfB" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2B6B721D79 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=yS7WQE2qNkwpW/m8A6ItQOfvX/lqab8L5qtmO6x6whU=; b=fp0C6oPgknTB+H uj6esIY+iakKL2MdFMU5GctxBTy0G4Nq80m9I5OW8kchczfjbghzbPxal/Gh63c4LAorsIst4nzHs TkndVAPgeg3K0yiUycF2+v6PgEPrXlX0Ribbvx79gPE3rP1plkWL/jRZLqwn28a9EuADIZRxcD4sI Xkuqmf6pCsFcjT6IQttuFHddFlzSON9zTpeHNiLlABJuSKzLsysK6PPfC308gRMV4mNsq2JPFdgAy AcknBue4HwayJoQInOpLT3MtypDqYeuwsdObgKkA8PBqpG0+81oKHRzehkdDZLcsBHf8PPucfqsk1 eMGt/Mp3ya7/YEJ76W1g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iSoE1-0006rN-KO; Thu, 07 Nov 2019 20:17:49 +0000 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iSoDO-0006AM-R0 for linux-arm-kernel@lists.infradead.org; Thu, 07 Nov 2019 20:17:12 +0000 Received: by mail-wr1-x443.google.com with SMTP id e6so4605660wrw.1 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=qF2M1/ULLO/GXbghpop34NbLQOpf/o/vXLdlj8uSYeO8RDReYobvIYZNoUklIIOYVz L+EJoPXH/LwD2PhYPqIK0kXRIbkQj8YPpg4zvKDjS5xuCFlAslDtyIT78IWlbFJo6xcR X2XjKsGNOQFGuZRSFUyDtLRIishNHBntiF0BzWqFIQgia7BevfHlht1xUBGHf8VvuBEo bDrWyb9vHp0TskWP8AWOux8tdbLTssx9l3qMgfacvtnGiSuXOyK6jvCSZUqoJkb1nubF jDMv/dbL5tFh9MLPSUVrfzhL9rM3nsEUefMCud8DJm/wESOoslzgQNSA1YQx/T3gpIhz PINQ== X-Gm-Message-State: APjAAAWbi3R1lgGhtcX/HtokbXX3n6Xieis5K4bUaBPGgAC6B1ukW7mu 27BDmN+dQ07wtTvaXABPUhBD3Q== X-Google-Smtp-Source: APXvYqzj4L+0U+5qBm9k8ytHroUi7rJ9GvABgTsk0w/eIsHl2OaCQNODEhgAMGDB5z6jZPEoi9l7ww== 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191107_121710_869148_85B28F1F X-CRM114-Status: UNSURE ( 9.94 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:443 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sasha Levin , Takashi Iwai , linux-kernel@vger.kernel.org, Kalle Valo , Lee Jones , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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(+) 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: 11233735 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DDFC814E5 for ; Thu, 7 Nov 2019 20:18:09 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BB3AA2166E for ; Thu, 7 Nov 2019 20:18:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="mukBp78F"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="b7mVJluO" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BB3AA2166E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=WSNQjxiaZS6/F9V1IFKZrgmez/rAbcq61RMJ/ivvUKY=; b=mukBp78Fnir22R 3f5VAADCaMUIdTLvytYs0BjnLwuRmyxLeIS0akLdYM/3mDiz/2z/Zu/v8yKzIsl9ilzEaDDcAeaiU doINAZ05ewB9J0A796wE7i1Pc9H3IN49kpqWrBDwlQ3auVAmExF3s4gBp6K65QtPZf6ghImMumrdY aWwCy2ql9SO2CYv2bQfFKGTq+iLL936PsTqHKZJjkL/sdKvUmf6eY+1Tr3ttkMrJo4NyBJqkFdqZj qAw5WQjveP6zsU8dJ/bZXTbATL6Z9o5HcG2jkr8vZIM5A2my5KqCaPKMftZfOwZS2ZM5P1HzF4+iP BEzGJwBi9WVKkDfWxmjw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iSoEH-000773-Mt; Thu, 07 Nov 2019 20:18:05 +0000 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iSoDP-0006Ag-VG for linux-arm-kernel@lists.infradead.org; Thu, 07 Nov 2019 20:17:13 +0000 Received: by mail-wr1-x442.google.com with SMTP id n1so4512887wra.10 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=gwNCUs+5MJMSD40A1NT+iFWgZ7ow6LGV10sUMGfkkr0M+XSZ/f34SplyJZ4qknGh9i Kp/IgJQBGpEFJrOSJbgjqHNgUW8Gm6LIgYPq/uJKmXCq+bXkYyWGQYMxZ375PtrauqhV IAzp9cYuAYMwimDlj61MnNpjWYN+rwgRbzOSY1z/gOAqE/yzpK9/QdZ9D9SHuNf9la52 ToQtq67ejKcKk8Hbqjhj8hNkEoZ8oWka/Kf7U8NNNeiRsUOUbvOSZYbGj7tfhTI21Icr QMemfF6Has53tzD+cVVSpn7YoAJGZw9WOAAzl3ZtYjpfW1ffij/MNwIF4zmnPCnWE7J+ 08tA== X-Gm-Message-State: APjAAAWMAtQUj2Kcgm351U466B5iZid3e+MauhKPOOXffYyhp9fXKxhw zzDpXHC1groyWY2iUHx1hmZjxA== X-Google-Smtp-Source: APXvYqyRQPyz/sEvlLIRqSi+f8ccU5mRAvmLwG9ITZbMlr/3R4OPvKN5MHxXdK3a18tbASmtAYi7OQ== 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191107_121712_028317_CEA4993D X-CRM114-Status: GOOD ( 14.64 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:442 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sasha Levin , Anson Huang , Dmitry Torokhov , linux-kernel@vger.kernel.org, Lee Jones , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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(-) 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: 11233737 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 08BE4139A for ; Thu, 7 Nov 2019 20:18:25 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C42672178F for ; Thu, 7 Nov 2019 20:18:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="HGSDW3r2"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="VMo/N9HX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C42672178F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=VpQXalIRCBVToNgzheW8ZkGgrDBz2RpgFjT/H0ZiRWo=; b=HGSDW3r2Ft1aqz MHGQTz45e/BXgPmz8BLJKIorrHLq/dFwmAGCyzKwwaisVa4oqvuse3SJO4uKz0QxmmbJ+/b08ycJj 4XPfyI3zAntyDDMZmdbihfdooQxwunW+XxXSAlRCPjR4iWeM5MY1HqXmtQrIXW7LYHsKUHXcVUidL EvYWbDS+lo+v7BnN3+fW9Si0PXSkv/e5Cs/hyeZPQe2fnD1C3qo+lhXRY/IpPmFA9+Us8HM2v+Jbx kGd6A9gAU5jsRcTa3xDJsXfXlA7dku1fJ9z4t4rjirynpp7x8peQJi5X9d9YcAlu8xXnpsH32arAq i+cdy9R7Kh3VfQU0aa7A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iSoEY-0007QR-Qd; Thu, 07 Nov 2019 20:18:22 +0000 Received: from mail-wr1-x443.google.com ([2a00:1450:4864:20::443]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iSoDQ-0006Bw-SE for linux-arm-kernel@lists.infradead.org; Thu, 07 Nov 2019 20:17:14 +0000 Received: by mail-wr1-x443.google.com with SMTP id w30so4621667wra.0 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=sbTYO2xfoUfMdz7APCNyBiR8Oc7t1ed2SlQxLvM03++9PTz9BdvKBEcQqVFqVtit/X j31Ppk7dvCL8TGvg5lk7cqfIBb1ldpy/MuHRJuWFIMLz2biToAjnGXlAWbeODScD5FCL O0cHDyuKB5IkSpN7/qK+I+xHa/qgNmwvMWe26tlDIRrj/lhoo7FlOyqx/EOzxUYGLRAq 1+wHocfuhi1qhd9lYRBR4B/BSWQUnrSvrwnm8rrbV/gk66AINfivT+Zeuu2wjsMGq/iC 2mUlP0asjECmqzlxBs0J/pAmxSZ/40SIxCdONxPN3a2o4ZHZm3hRvhw9diAYTt6F3IzZ tdRg== X-Gm-Message-State: APjAAAWnYzHRIEhXt9W8EqfQkHBvwCAZD1zJ44ACuhGdsSZYTpvVJf5O FGcDTO8CEzemaqLVn+XRyHj5Kg== X-Google-Smtp-Source: APXvYqzkgWzz7JMVKWkHPJp5xKneWHyHnj7XSWrSU92m+gh5RkyIUCHAYpZ3DNuAFNOu8sHi1U60Ag== 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191107_121712_946762_BBBF4D5E X-CRM114-Status: UNSURE ( 9.46 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:443 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sasha Levin , Linus Walleij , Sekhar Nori , linux-kernel@vger.kernel.org, Bartosz Golaszewski , Lee Jones , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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(+) 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: 11233739 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5B3EE139A for ; Thu, 7 Nov 2019 20:18:39 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 30B242166E for ; Thu, 7 Nov 2019 20:18:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Xx2q/27+"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="ne9mmSOf" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 30B242166E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=LBaLekJOgdnhXy5WtBxyLjheSo4cdZQW6ruy4NyohbI=; b=Xx2q/27+Hr36Tn XbYQrr8VgIn9ypY/sKyOpaLy9BAZ+knCk3+YpPSTrGs/MYUiPi4yFkwCN34tCDEd3tAfUgQ/ivD2P gOkuOpNdA/ZvD2CXOn1zN6ZwCc/s0C5JHQNjxv06YsoDvTyk9sc/Mo5KhgsseKuBZEQnpKNeszhBB whNbcDbl2RR1PyKhi8zVuoiIof/sGfsScmQ46iDl2vfVMDBb0vBAQx6guxY0Ck4mPAlDr3YiF7p6t mv6clfnvzz5ECC0HsJxoK8AzxiQ/Fb1UJAPezXvpZ6wAG+BkgLF61gvkn5MnkHkoh9h1d7b2yWUto AtbjKpTBuNvFoOiBIw6g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iSoEn-0007fn-Lf; Thu, 07 Nov 2019 20:18:37 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iSoDR-0006D4-SN for linux-arm-kernel@lists.infradead.org; Thu, 07 Nov 2019 20:17:15 +0000 Received: by mail-wr1-x444.google.com with SMTP id a11so4553142wra.6 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=MI827RuZGsuQhH1SIXlprF1/A4J5gUy9lsy4ODhG5uNYy2ACbG14JwaaaaDdDPC0/R gOTT8vTbJxEoR6YOg+omyg65W5gVfVMY5KEqt5AuLnOqW1XnCsHscs8pSUq7Im5sgTAN UlU8pj5yKr1JEuNRUkJ0NM742lL459pLf1Uzrf/PepDVdYrEK9Y8jz0bx3bz46+kB5Wk eXh/XugpIJYrGNrzdXb0SslVFvV1ifhM4IBnQAUK245u6VjdCvG05RGA9paweriofNAP cYOOaoHyLu33NcokkuyFfZieBTJLkHM1ilM7U/W9jkAeBlIG0YMvskXWB7V2xaZYXmJq SbgQ== X-Gm-Message-State: APjAAAUZ6HU8XeXLF/uqqXq0BhBksC+CWS+rxVvinHdKEP/YM4oRAKXX HsrLYbwAW9h8UJnd9z+jEYF9bw== X-Google-Smtp-Source: APXvYqyyjcITWBzH0Dzq6p8czJPlGmkRNJ5gNj8J2RJV66DTzp4cH3p+YQPaSfdSy5SCVYQ8JJvrrg== 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191107_121713_932509_C34A75C6 X-CRM114-Status: GOOD ( 16.30 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:444 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sasha Levin , Song Liu , linux-kernel@vger.kernel.org, Mariusz Tkaczyk , Lee Jones , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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(-) 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: 11233741 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C71B0139A for ; Thu, 7 Nov 2019 20:18:56 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 964232178F for ; Thu, 7 Nov 2019 20:18:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="J/xIQg24"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="UYGqinQH" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 964232178F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=5MdAUJa56Xtm7xBWcBVcLuapE8XGs4TgYjrhYrSNfkQ=; b=J/xIQg24Z1/z7T Z2bau0Rx2wGg+kJ7zB2cpfhUd3anzCDnuw/GGWzUXcpBv8oB16oa89OKAmdPMIfZ358nVZfitia+X lt1Fk9COi0PIFza0cXgMhVLH5WGV5Hdbia6rdQ7pvmq6Cys40D2KUZLvjuI7psLYZVWEuYdv46JPm dE11cg29MkUhpCh1DMSKGig6yI3x9arBEKzmVgApXfXSm1Ec6K1/x6WMeekASyQzzSkdZk3fQvN6X nyKs5D12qqrbCHI9ZIyMToA5YAq7Y8daOBTPILt6EQwVFNBegQkvZtGrfc2KS/hkFA/RtGcXmoUYI 5ixQNPtiYDQ9N+tE3yRA==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iSoF1-0007ta-7F; Thu, 07 Nov 2019 20:18:51 +0000 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iSoDS-0006Dm-Lj for linux-arm-kernel@lists.infradead.org; Thu, 07 Nov 2019 20:17:16 +0000 Received: by mail-wr1-x442.google.com with SMTP id e6so4605875wrw.1 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=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=pBGJLxDANcQA4PUGZbJedpPpQqgf4FHmNSL04C2uAuYowgqF8AbYTQmw5AKkrVsLw4 T+EhYrQsy31Yr3s/Gxq62wVRUqhIpo9kSXI+KTHX1QywmyCSS4qWu1EwT820evzMhqcW 7hccDIXfawe8c+h1T5eAMyhGL6zhNA6DbJnXa0dxfQJlaSVpltIJqJ4UJRL4awAiSTJy 19r1OnBpaIZhwoBKA4B+v3wu+jYT6G/NManerK8AvgHQ5otbtioVlVbZAPKBxCLaPJVJ /zrCpnuNsZ77yjX1u2Jyyey/QJtGwUzZTbhdM1d8Uq9Q9ffpuePWtN+dP8G3EGG2+OF6 DYgQ== X-Gm-Message-State: APjAAAXLR8G3Sk5VhkHgRzVbdI+C6EMBxAwuUDOpRbaXo2Yy+jMNwGmU dHNe9z0vmjy5iiCXBv7LDX+RnVB+LOw= X-Google-Smtp-Source: APXvYqyIDYZki3Hcy87XKUSJcJYOnIsQ54TNVpbKrjvGilXExqgL+p8sbIRuF7xsxoxBfxy89BNs+g== 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191107_121714_788921_8BD0600C X-CRM114-Status: GOOD ( 12.09 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:442 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sasha Levin , "Mauro S. M. Rodrigues" , linux-kernel@vger.kernel.org, Sudarsana Reddy Kalluru , Lee Jones , "David S . Miller" , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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(-) 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: 11233743 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7D253139A for ; Thu, 7 Nov 2019 20:19:10 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3A7FC2178F for ; Thu, 7 Nov 2019 20:19:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="nlfHZc3w"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="J69UedwD" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3A7FC2178F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=4clwTdDExy5Ts4fTiY+rpt0HqR/QQCLALNvGfnOuniQ=; b=nlfHZc3wIPGWz8 wlSc2JxTYBWnwVS7/pQ5Ra5S59jiIrQ62U36od4aoygpl7V8wSLIKTKhnxHXG3HYBD/CMfr/5XV82 k9ejNIizAXS2JM6aANh/QgOnI3SVUniHtFOWO2JgqsflKlUxKcUZbnDFlnI91q2jrWOSC7eXsGGh4 /BlXOzTvskeYgHQ7DLQl4WeZBIyZReTuwTeTDI6arEe10GjsxLkZAxA07hFRU3YOVXwPJ51f878/y KsruZRc3lpNpJEmpqS96vwMFaP2kXT/Tw1EfG5fOdIfUHRjy7RhMXUSdKqYmifgXhIdfJ1WR2wRlD ZJNxA62eM9BzfA7w7U5g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iSoFH-00087w-0h; Thu, 07 Nov 2019 20:19:07 +0000 Received: from mail-wm1-x344.google.com ([2a00:1450:4864:20::344]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iSoDU-0006Eo-4a for linux-arm-kernel@lists.infradead.org; Thu, 07 Nov 2019 20:17:18 +0000 Received: by mail-wm1-x344.google.com with SMTP id f3so3899759wmc.5 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=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=ZadmVBq/Qi4cWTUz9IFCgR5wf/JHCShGY/n9YGtLDjIcF/X+Dx5JIBUj+jJt+0hYZQ 9WcTByr81wfauEiiVYQvGdpSsIQchFpW1Jh+K4KoTxsvNpK6nR2hsxziF6uCgFqdtkpd sSLe0rTds+u/VehokNdrKinK06HKCaKPTHIeT9fC8JHF7NCHaLgm4qBCbGQUTKT6b4Y3 O/VPsbqGYRdYz3ibfdmIHH4sAFj1/fjp4LneVgiyVTUNONCDCmCtgrBZ5+XER6qB0oSs EX8xjd266DQMq8sFJaOSPjT8fzgoxVYD1Bav9zov93ywP3wbhe+dEjQl+Uhg+wrBQbK1 206g== X-Gm-Message-State: APjAAAWDQhhYSgozZ1tyNMY7wqbcus0S++MVf29ZxANNdD2caUB14SSe 2erOCkpk12tGgYv9jg5PEmnFog== X-Google-Smtp-Source: APXvYqyK+1+T6i/yZeGbXEMqaSWkBh7UUTFmvC0ZviyeqEbr6Z+uJWb/xiiKwTmnU2t6XRADAYsdzw== 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191107_121716_186206_90879CAF X-CRM114-Status: GOOD ( 12.49 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:344 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sasha Levin , Sekhar Nori , linux-kernel@vger.kernel.org, Bartosz Golaszewski , Lee Jones , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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(+) 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: 11233745 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E4E14139A for ; Thu, 7 Nov 2019 20:19:28 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BAC1D2166E for ; Thu, 7 Nov 2019 20:19:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="F9yUX/Dm"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="fChiVLhY" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BAC1D2166E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=e4yORBI1wY1Ys3VhX3L4bgKDDP3qvmmIzJB1RwQWmn0=; b=F9yUX/DmbOEKsw SNRk26FhTIRmqOXH2Dbabgdgza/suRxaqgiBDXElARIhZG/eG37wLL+gbB1lc5LMb+gYOT4+PBnM2 z3PWZEQrwwKUivyI+sA0DDbRwTBuy+RXkf+gKPRUbnZswX9L+SGbqbrwqcV7SpB8Zh/6U7P0TDfMW z3e8yVApd+zgu/3lQBshjuNG2kr0B70B9/c8ncJwdmtKka/SJA/9CVaQ4z+H0+OzPADZaSjk9074V WJTb/ye8MNvJyQNbaSnKMmshkEugpsIBnZl8l7xmvF2K/YunovhX8Gq5aXHVCCMem4JqPq3NSoOXL m/7CO5A8Tzfvo96F9Q+Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iSoFW-0008Mi-0A; Thu, 07 Nov 2019 20:19:22 +0000 Received: from mail-wr1-x444.google.com ([2a00:1450:4864:20::444]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iSoDU-0006Fp-KN for linux-arm-kernel@lists.infradead.org; Thu, 07 Nov 2019 20:17:18 +0000 Received: by mail-wr1-x444.google.com with SMTP id t1so4572668wrv.4 for ; Thu, 07 Nov 2019 12:17:16 -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=a5pd0CpSCUF/ERf7JfpRAzLLZgTt/fRqbpelfaKZVAgPAcxepVcm8rg8aURJYOLKUb SRg0/7/K5gx1/acX8WvxafYeyyxIt3ub1iseKTW24w2G41IccQUokVJR5QFKGo+XaqSt x5N2qznId2BqkwZLES6WX6tedS0Em3Vuj9jilraYNOfes3k4fSFQVNyRtvv336nDOZWK TZo3bAOuR3uXhTXMqUZSlOAytgGAEs6rYYelrpsP7n5dbhe4/tUMpUwTeYN4inI4/OYa 3sqtGVu8TCTUfugr25cOHdAWO9nsgM64O3vOAUhmRLsUZximV++OboQTHnijxOhJYyHD cGLA== X-Gm-Message-State: APjAAAX8lmLF/QmphNh37rYV1zPy0vsHkJpLxXM+0XFM04d/bIMeP30y wwmBvDy5NASACzn6irEB5KTf051uTfQ= X-Google-Smtp-Source: APXvYqxLeJVGJOzI2ZwJzDDqNvlQyCV/uNdN9GYB084GYIYZxX5OgQ/rW6PhFKY71ZiiT24Rhit05g== 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191107_121716_739040_6EA89735 X-CRM114-Status: GOOD ( 15.29 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2a00:1450:4864:20:0:0:0:444 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sasha Levin , linux-kernel@vger.kernel.org, Marc Kleine-Budde , Sean Nyekjaer , Lee Jones , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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(-) 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");