<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/drivers/mmc/core/block.c, branch linux-4.15.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.15.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-4.15.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2018-03-28T16:22:54Z</updated>
<entry>
<title>mmc: block: fix updating ext_csd caches on ioctl call</title>
<updated>2018-03-28T16:22:54Z</updated>
<author>
<name>Bastian Stender</name>
</author>
<published>2018-03-08T14:08:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=40888f31f9cf3b0dee0299533f50539c4953e5e2'/>
<id>urn:sha1:40888f31f9cf3b0dee0299533f50539c4953e5e2</id>
<content type='text'>
commit e74ef2194b41ba5e511fab29fe5ff00e72d2f42a upstream.

PARTITION_CONFIG is cached in mmc_card-&gt;ext_csd.part_config and the
currently active partition in mmc_blk_data-&gt;part_curr. These caches do
not always reflect changes if the ioctl call modifies the
PARTITION_CONFIG registers, e.g. by changing BOOT_PARTITION_ENABLE.

Write the PARTITION_CONFIG value extracted from the ioctl call to the
cache and update the currently active partition accordingly. This
ensures that the user space cannot change the values behind the
kernel's back. The next call to mmc_blk_part_switch() will operate on
the data set by the ioctl and reflect the changes appropriately.

Signed-off-by: Bastian Stender &lt;bst@pengutronix.de&gt;
Signed-off-by: Jan Luebbe &lt;jlu@pengutronix.de&gt;
Cc: stable@vger.kernel.org
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>mmc: block: fix logical error to avoid memory leak</title>
<updated>2018-03-24T10:02:47Z</updated>
<author>
<name>Liu, Changcheng</name>
</author>
<published>2017-12-16T15:15:45Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=176fb28073c945c56c4db0dfacc3d7a5d9bf4bcf'/>
<id>urn:sha1:176fb28073c945c56c4db0dfacc3d7a5d9bf4bcf</id>
<content type='text'>
[ Upstream commit 0be55579a127916ebe39db2a74d906a2dfceed42 ]

If the MMC_DRV_OP_GET_EXT_CSD request completes successfully, then
ext_csd must be freed, but in one case it was not. Fix that.

Signed-off-by: Liu Changcheng &lt;changcheng.liu@intel.com&gt;
Acked-by: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
Acked-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
Signed-off-by: Sasha Levin &lt;alexander.levin@microsoft.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>mmc: block: Ensure that debugfs files are removed</title>
<updated>2017-11-23T13:39:13Z</updated>
<author>
<name>Adrian Hunter</name>
</author>
<published>2017-11-21T13:42:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f9f0da98819503b06b35e61869d18cf3a8cd3323'/>
<id>urn:sha1:f9f0da98819503b06b35e61869d18cf3a8cd3323</id>
<content type='text'>
The card is not necessarily being removed, but the debugfs files must be
removed when the driver is removed, otherwise they will continue to exist
after unbinding the card from the driver. e.g.

  # echo "mmc1:0001" &gt; /sys/bus/mmc/drivers/mmcblk/unbind
  # cat /sys/kernel/debug/mmc1/mmc1\:0001/ext_csd
  [  173.634584] BUG: unable to handle kernel NULL pointer dereference at 0000000000000050
  [  173.643356] IP: mmc_ext_csd_open+0x5e/0x170

A complication is that the debugfs_root may have already been removed, so
check for that too.

Fixes: 627c3ccfb46a ("mmc: debugfs: Move block debugfs into block module")
Signed-off-by: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
Reviewed-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Cc: stable@vger.kernel.org # 4.14+
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
</content>
</entry>
<entry>
<title>mmc: block: Check return value of blk_get_request()</title>
<updated>2017-11-23T13:03:51Z</updated>
<author>
<name>Adrian Hunter</name>
</author>
<published>2017-11-21T13:42:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fb8e456e547ed2c699f64665bd8a3b9bde7b9728'/>
<id>urn:sha1:fb8e456e547ed2c699f64665bd8a3b9bde7b9728</id>
<content type='text'>
blk_get_request() can fail, always check the return value.

Fixes: 0493f6fe5bde ("mmc: block: Move boot partition locking into a driver op")
Fixes: 3ecd8cf23f88 ("mmc: block: move multi-ioctl() to use block layer")
Fixes: 614f0388f580 ("mmc: block: move single ioctl() commands to block requests")
Fixes: 627c3ccfb46a ("mmc: debugfs: Move block debugfs into block module")
Signed-off-by: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
Reviewed-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Cc: stable@vger.kernel.org # 4.13+
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
</content>
</entry>
<entry>
<title>mmc: block: Fix missing blk_put_request()</title>
<updated>2017-11-23T13:00:33Z</updated>
<author>
<name>Adrian Hunter</name>
</author>
<published>2017-11-21T13:42:27Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=34c089e806793a66e450b11bd167db6047399fcd'/>
<id>urn:sha1:34c089e806793a66e450b11bd167db6047399fcd</id>
<content type='text'>
Ensure blk_get_request() is paired with blk_put_request().

Fixes: 0493f6fe5bde ("mmc: block: Move boot partition locking into a driver op")
Fixes: 627c3ccfb46a ("mmc: debugfs: Move block debugfs into block module")
Signed-off-by: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
Reviewed-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Cc: stable@vger.kernel.org # 4.13+
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
</content>
</entry>
<entry>
<title>mmc: block: Prepare CQE data</title>
<updated>2017-10-30T10:45:52Z</updated>
<author>
<name>Adrian Hunter</name>
</author>
<published>2017-09-22T12:36:56Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=93482b3d70c2120aadb0f1d1281a59199866e70a'/>
<id>urn:sha1:93482b3d70c2120aadb0f1d1281a59199866e70a</id>
<content type='text'>
Enhance mmc_blk_data_prep() to support CQE requests. That means adding
some things that for non-CQE requests would be encoded into the command
arguments - such as the block address, reliable-write flag, and data tag
flag. Also the request tag is needed to provide the command queue task id,
and a comment is added to explain the future possibility of defining a
priority.

Signed-off-by: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
Reviewed-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
</content>
</entry>
<entry>
<title>mmc: block: Use local variables in mmc_blk_data_prep()</title>
<updated>2017-10-30T10:45:51Z</updated>
<author>
<name>Adrian Hunter</name>
</author>
<published>2017-09-22T12:36:55Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=d3377c012f4d7a0a822e289f1effba997da3e295'/>
<id>urn:sha1:d3377c012f4d7a0a822e289f1effba997da3e295</id>
<content type='text'>
Use local variables in mmc_blk_data_prep() in preparation for adding CQE
support which doesn't use the output variables.

Signed-off-by: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
Reviewed-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
</content>
</entry>
<entry>
<title>mmc: core: Introduce host claiming by context</title>
<updated>2017-10-30T10:45:49Z</updated>
<author>
<name>Adrian Hunter</name>
</author>
<published>2017-09-22T12:36:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6c0cedd1ef9527ef13e66875746570e76a3188a7'/>
<id>urn:sha1:6c0cedd1ef9527ef13e66875746570e76a3188a7</id>
<content type='text'>
Currently the host can be claimed by a task.  Change this so that the host
can be claimed by a context that may or may not be a task.  This provides
for the host to be claimed by a block driver queue to support blk-mq, while
maintaining compatibility with the existing use of mmc_claim_host().

Signed-off-by: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
</content>
</entry>
<entry>
<title>mmc: block: Fix bug when removing RPMB chardev</title>
<updated>2017-10-30T10:44:49Z</updated>
<author>
<name>Linus Walleij</name>
</author>
<published>2017-10-04T09:10:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1c87f73578497a6c3cc77bcbfd2e5bf15fe753c7'/>
<id>urn:sha1:1c87f73578497a6c3cc77bcbfd2e5bf15fe753c7</id>
<content type='text'>
I forgot to account for the fact that the device core holds a
reference to a device added with device_initialize() that need
to be released with a corresponding put_device() to reach a 0
refcount at the end of the lifecycle.

This led to a NULL pointer reference when freeing the device
when e.g. unbidning the host device in sysfs.

Fix this and use the device .release() callback to free the
IDA and free:ing the memory used by the RPMB device.

Before this patch:

/sys/bus/amba/drivers/mmci-pl18x$ echo 80114000.sdi4_per2 &gt; unbind
[   29.797332] mmc3: card 0001 removed
[   29.810791] Unable to handle kernel NULL pointer dereference at
               virtual address 00000050
[   29.818878] pgd = de70c000
[   29.821624] [00000050] *pgd=1e70a831, *pte=00000000, *ppte=00000000
[   29.827911] Internal error: Oops: 17 [#1] PREEMPT SMP ARM
[   29.833282] Modules linked in:
[   29.836334] CPU: 1 PID: 154 Comm: sh Not tainted
               4.14.0-rc3-00039-g83318e309566-dirty #736
[   29.844604] Hardware name: ST-Ericsson Ux5x0 platform (Device Tree Support)
[   29.851562] task: de572700 task.stack: de742000
[   29.856079] PC is at kernfs_find_ns+0x8/0x100
[   29.860443] LR is at kernfs_find_and_get_ns+0x30/0x48

After this patch:

/sys/bus/amba/drivers/mmci-pl18x$ echo 80005000.sdi4_per2 &gt; unbind
[   20.623382] mmc3: card 0001 removed

Fixes: 97548575bef3 ("mmc: block: Convert RPMB to a character device")
Reported-by: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Acked-by: Adrian Hunter &lt;adrian.hunter@intel.com&gt;
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
</content>
</entry>
<entry>
<title>mmc: block: Delete mmc_access_rpmb()</title>
<updated>2017-10-30T10:40:10Z</updated>
<author>
<name>Linus Walleij</name>
</author>
<published>2017-09-20T08:02:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=14f4ca7e4d2825f9f71e22905ae177b899959f1d'/>
<id>urn:sha1:14f4ca7e4d2825f9f71e22905ae177b899959f1d</id>
<content type='text'>
This function is used by the block layer queue to bail out of
requests if the current request is towards an RPMB
"block device".

This was done to avoid boot time scanning of this "block
device" which was never really a block device, thus duct-taping
over the fact that it was badly engineered.

This problem is now gone as we removed the offending RPMB block
device in another patch and replaced it with a character
device.

Cc: Tomas Winkler &lt;tomas.winkler@intel.com&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Signed-off-by: Ulf Hansson &lt;ulf.hansson@linaro.org&gt;
</content>
</entry>
</feed>
