From patchwork Wed Mar 29 20:17:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Hilman X-Patchwork-Id: 9652481 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D722C60113 for ; Wed, 29 Mar 2017 20:18:05 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C5D5928354 for ; Wed, 29 Mar 2017 20:18:05 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BA8F32845B; Wed, 29 Mar 2017 20:18:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 51DF828354 for ; Wed, 29 Mar 2017 20:18:05 +0000 (UTC) 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:In-Reply-To: Date:References: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=OE52isr07YR7XQPKGbAfpmxKrN9vfWSTFFxStEslUeg=; b=T8KANl1OEqih0f x75R/8zaFewZ8S5xuzy+0YhAbqVLlZd0bVRU3LWnUyGrpcQXIVBKoyTEZIxzB4j2/c6QEJTJT4r3P GFxEo0mPnIZTj3WzRjgAhVoohkk1aYBFo3scPIp+NnQgPz5OCKowq98wi5FnPqQhz4our0Vd70dnI kDSlwxDJzJgZCL4KkYacRqfyAZr79pJDa/H+of3Q49oo1z/L9a9WWX6TpC7N1j9JRd5coBjL/mS/b UL/PasRGApe5VyeOHt01DesnsS/VCFj3N33M0u4EN0TnCkKLXUnDv5pxjA5Yh5cAEDbqyFsDNBVhi YlM/SdejTAcLyH+jupow==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1ctK2Z-00008i-4e; Wed, 29 Mar 2017 20:17:59 +0000 Received: from mail-pg0-x22b.google.com ([2607:f8b0:400e:c05::22b]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1ctK2U-00005X-Vn for linux-amlogic@lists.infradead.org; Wed, 29 Mar 2017 20:17:57 +0000 Received: by mail-pg0-x22b.google.com with SMTP id 81so17370240pgh.2 for ; Wed, 29 Mar 2017 13:17:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:organization:references:date:in-reply-to :message-id:user-agent:mime-version; bh=8ZgRn4xmlNNlkaV4Esz2wS1ofOBBZT6QLeAeS5J9vGg=; b=WGc8oHEB7gqtYHfwQBVy5dnK9Uiq2wEDTqpVS+3QT+nMxl/nBcMDy8F4oTuStdmuzg N50wA8sGxYXYUXBogEFyHfNk7SUpa/ee2XXtHmUHgiO6Hjn+hXEzR0kCRuCkoUhQRaGm Jpd8bVAiYUUPNEKov0uZEcF1H2fx9tBHJE9T3RG0/ZO7/CmJp9ax5Mnz6kh5gj0wRXuO Bar65YOxmcoESHuEu2Wb66YLy3hfRwQXADugBJ0NRGzd/u9HBLpjYYvKIWydAnYbJGFS 0sPHk7fLL7I26OCrouvMcowbnm0gYECNh1lu+KevP0Ii2eQierxWPMw/F/r8e+4OLo0+ a0Sw== 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:organization:references:date :in-reply-to:message-id:user-agent:mime-version; bh=8ZgRn4xmlNNlkaV4Esz2wS1ofOBBZT6QLeAeS5J9vGg=; b=eBMOtguw13ZLn19vFk2AURE6WulGfC7nQcddAydGyBCo+a7+JnR9FSTbC2WeRpr+eP AIvpvapoDW9PRTIlEMDBkm2jXOU+qyFI3aOmmxY9afcgHVEWoVpDkpvIyVCCfuiY8yCB R3liDItor5VoDxrpeJ7WIpmrqDOxpgtOACp5TNESX2xtXupchyyKMV7s7jIrAFcCxvk5 ThgBg9hi4IzwHYbGTpIn00yybSTufffmmUPj5iP8iaycPz1MRNHrdD3akeZtkZ9t3KkN +gczlxsgiesvKdCnAkIaVulSiyPRVFiFjw0BzSlk9xnTENnl+H3qoiwnatt6aNGBFMLR dGXw== X-Gm-Message-State: AFeK/H229/werwLn+abN6jraxvGVYvdmd60BWMYjNumILSrXRIumK+LbiNOeHT80sKHHPbAW X-Received: by 10.99.176.5 with SMTP id h5mr2357304pgf.179.1490818653551; Wed, 29 Mar 2017 13:17:33 -0700 (PDT) Received: from localhost (c-98-203-232-209.hsd1.wa.comcast.net. [98.203.232.209]) by smtp.gmail.com with ESMTPSA id c75sm15153331pga.22.2017.03.29.13.17.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 29 Mar 2017 13:17:33 -0700 (PDT) From: Kevin Hilman To: Heiner Kallweit Subject: Re: [PATCH] mmc: sdio: fix alignment issue in struct sdio_func Organization: BayLibre References: Date: Wed, 29 Mar 2017 13:17:32 -0700 In-Reply-To: (Heiner Kallweit's message of "Wed, 29 Mar 2017 20:54:37 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (darwin) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170329_131755_052667_7F54A721 X-CRM114-Status: GOOD ( 10.40 ) X-BeenThere: linux-amlogic@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-amlogic@lists.infradead.org, Ulf Hansson , "linux-mmc@vger.kernel.org" , Helmut Klein Sender: "linux-amlogic" Errors-To: linux-amlogic-bounces+patchwork-linux-amlogic=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Heiner Kallweit writes: > Certain 64-bit systems (e.g. Amlogic Meson GX) require buffers to be > used for DMA to be 8-byte-aligned. struct sdio_func has an embedded > small DMA buffer not meeting this requirement. > When testing switching to descriptor chain mode in meson-gx driver > SDIO is broken therefore. Fix this by allocating the small DMA buffer > separately as kmalloc ensures that the returned memory area is > properly aligned for every basic data type. > > Signed-off-by: Heiner Kallweit > Tested-by: Helmut Klein This should work too, without the need to do a tiny kmalloc. Kevin diff --git a/include/linux/mmc/sdio_func.h b/include/linux/mmc/sdio_func.h index aab032a6ae61..071addf23931 100644 --- a/include/linux/mmc/sdio_func.h +++ b/include/linux/mmc/sdio_func.h @@ -53,7 +53,7 @@ struct sdio_func { unsigned int state; /* function state */ #define SDIO_STATE_PRESENT (1<<0) /* present in sysfs */ - u8 tmpbuf[4]; /* DMA:able scratch buffer */ + u8 tmpbuf[4] __aligned(8); /* DMA:able scratch buffer */ unsigned num_info; /* number of info strings */ const char **info; /* info strings */