<feed xmlns='http://www.w3.org/2005/Atom'>
<title>BMC/Intel-BMC/linux.git/drivers/pcmcia/ds.c, branch dev</title>
<subtitle>Intel OpenBMC Linux kernel source tree (mirror)</subtitle>
<id>https://git.radix-linux.su/BMC/Intel-BMC/linux.git/atom?h=dev</id>
<link rel='self' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/atom?h=dev'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/'/>
<updated>2015-06-16T05:29:39+00:00</updated>
<entry>
<title>pcmcia: do not break rsrc_nonstatic when handling anonymous cards</title>
<updated>2015-06-16T05:29:39+00:00</updated>
<author>
<name>Dominik Brodowski</name>
<email>linux@dominikbrodowski.net</email>
</author>
<published>2015-06-14T19:52:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=e8e68fd86d22fa5bd9c7bed16043e27ac86998f8'/>
<id>urn:sha1:e8e68fd86d22fa5bd9c7bed16043e27ac86998f8</id>
<content type='text'>
Patch 1c6c9b1d9d25 caused a regression for rsrc_nonstatic: It relies
on pccard_validate_cis() to determine whether an iomem resource can
be used for PCMCIA cards. This override, however, lead invalid iomem
resources to be accepted -- and lead to a fake CIS being used instead
of the original CIS.

To fix this issue, move the override for anonymous cards to the one
place where it is needed -- when adding a PCMCIA device.

Signed-off-by: Dominik Brodowski &lt;linux@dominikbrodowski.net&gt;
</content>
</entry>
<entry>
<title>pcmcia: Convert dev_printk to dev_&lt;level&gt;</title>
<updated>2015-05-30T14:09:04+00:00</updated>
<author>
<name>Joe Perches</name>
<email>joe@perches.com</email>
</author>
<published>2014-10-10T16:12:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=f2e6cf76751d479874216f989f6bef6da6e80119'/>
<id>urn:sha1:f2e6cf76751d479874216f989f6bef6da6e80119</id>
<content type='text'>
Reduce object size a little by using dev_&lt;level&gt;
calls instead of dev_printk(KERN_&lt;LEVEL&gt;.

Other miscellanea:

o Coalesce formats
o Realign arguments
o Use pr_cont instead of naked printk
  reorder test to use "%s\n"

Signed-off-by: Joe Perches &lt;joe@perches.com&gt;
Signed-off-by: Dominik Brodowski &lt;linux@dominikbrodowski.net&gt;
</content>
</entry>
<entry>
<title>drivers: pcmcia: ds.c fix checkpatch errors</title>
<updated>2015-05-30T13:32:41+00:00</updated>
<author>
<name>Laurent Navet</name>
<email>laurent.navet@gmail.com</email>
</author>
<published>2013-01-21T21:16:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=46f533ccb80d32a08b391fc1c45860e46174b814'/>
<id>urn:sha1:46f533ccb80d32a08b391fc1c45860e46174b814</id>
<content type='text'>
fix these checkpatch errors :
- ERROR: spaces required around that '&lt;' (ctx:VxW)
- ERROR: "foo * bar" should be "foo *bar"
- WARNING: please, no space before tabs

Signed-off-by: Laurent Navet &lt;laurent.navet@gmail.com&gt;
Signed-off-by: Dominik Brodowski &lt;linux@dominikbrodowski.net&gt;
</content>
</entry>
<entry>
<title>pcmcia: Fix requery</title>
<updated>2015-01-12T13:04:12+00:00</updated>
<author>
<name>Alan Cox</name>
<email>alan@linux.intel.com</email>
</author>
<published>2014-12-10T15:06:40+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=8402641b2dc73748dde81e3513ac61c8436be3cb'/>
<id>urn:sha1:8402641b2dc73748dde81e3513ac61c8436be3cb</id>
<content type='text'>
The requery logic goes off and attempts to read the CIS of empty slots. In
most cases this happens not to do any harm - but not all!

Add the missing check and also a WARN() to catch any other offenders.

Signed-off-by: Alan Cox &lt;alan@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>pcmcia: convert bus code to use dev_groups</title>
<updated>2013-10-17T01:36:03+00:00</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2013-10-07T06:55:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=b9b2f36761501c7bda070cacc53d24235f2529de'/>
<id>urn:sha1:b9b2f36761501c7bda070cacc53d24235f2529de</id>
<content type='text'>
The dev_attrs field of struct bus_type is going away soon, dev_groups
should be used instead.  This converts the pcmcia bus code to use the
correct field.

Cc: Bill Pemberton &lt;wfp5p@virginia.edu&gt;
Cc: &lt;linux-pcmcia@lists.infradead.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>pcmcia: remove use of __devinit</title>
<updated>2012-11-28T20:10:16+00:00</updated>
<author>
<name>Bill Pemberton</name>
<email>wfp5p@virginia.edu</email>
</author>
<published>2012-11-19T18:23:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=34cdf25a126f053698d549cc12a9c30e9a8a0bab'/>
<id>urn:sha1:34cdf25a126f053698d549cc12a9c30e9a8a0bab</id>
<content type='text'>
CONFIG_HOTPLUG is going away as an option so __devinit is no longer
needed.

Signed-off-by: Bill Pemberton &lt;wfp5p@virginia.edu&gt;
Cc: Eric Miao &lt;eric.y.miao@gmail.com&gt;
Cc: Russell King &lt;linux@arm.linux.org.uk&gt;
Cc: Haojian Zhuang &lt;haojian.zhuang@gmail.com&gt;
Acked-by: Eric Miao &lt;eric.y.miao@gmail.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>pcmcia: remove CONFIG_HOTPLUG ifdefs</title>
<updated>2012-11-28T20:10:15+00:00</updated>
<author>
<name>Bill Pemberton</name>
<email>wfp5p@virginia.edu</email>
</author>
<published>2012-11-19T18:19:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=13ee2b943c366fc899c860b1aef1c8a2b7a0e546'/>
<id>urn:sha1:13ee2b943c366fc899c860b1aef1c8a2b7a0e546</id>
<content type='text'>
Remove conditional code based on CONFIG_HOTPLUG being false.  It's
always on now in preparation of it going away as an option.

Signed-off-by: Bill Pemberton &lt;wfp5p@virginia.edu&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Merge 3.3-rc6 into driver-core-next</title>
<updated>2012-03-09T20:35:53+00:00</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2012-03-09T20:35:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=263a5c8e16c34199ddf6de3f102e789ffa3ee26e'/>
<id>urn:sha1:263a5c8e16c34199ddf6de3f102e789ffa3ee26e</id>
<content type='text'>
This was done to resolve a conflict in the drivers/base/cpu.c file.

Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>pcmcia: fix socket refcount decrementing on each resume</title>
<updated>2012-02-09T03:03:51+00:00</updated>
<author>
<name>Russell King</name>
<email>rmk+kernel@arm.linux.org.uk</email>
</author>
<published>2012-02-09T01:13:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=025e4ab3db07fcbf62c01e4f30d1012234beb980'/>
<id>urn:sha1:025e4ab3db07fcbf62c01e4f30d1012234beb980</id>
<content type='text'>
This fixes a memory-corrupting bug: not only does it cause the warning,
but as a result of dropping the refcount to zero, it causes the
pcmcia_socket0 device structure to be freed while it still has
references, causing slab caches corruption.  A fatal oops quickly
follows this warning - often even just a 'dmesg' following the warning
causes the kernel to oops.

While testing suspend/resume on an ARM device with PCMCIA support, and a
CF card inserted, I found that after five suspend and resumes, the
kernel would complain, and shortly die after with slab corruption.

  WARNING: at include/linux/kref.h:41 kobject_get+0x28/0x50()

As the message doesn't give a clue about which kobject, and the built-in
debugging in drivers/base/power/main.c happens too late, this was added
right before each get_device():

  printk("%s: %p [%s] %u\n", __func__, dev, kobject_name(&amp;dev-&gt;kobj), atomic_read(&amp;dev-&gt;kobj.kref.refcount));

and on the 3rd s2ram cycle, the following behaviour observed:

On the 3rd suspend/resume cycle:

  dpm_prepare: c1a0d998 [pcmcia_socket0] 3
  dpm_suspend: c1a0d998 [pcmcia_socket0] 3
  dpm_suspend_noirq: c1a0d998 [pcmcia_socket0] 3
  dpm_resume_noirq: c1a0d998 [pcmcia_socket0] 3
  dpm_resume: c1a0d998 [pcmcia_socket0] 3
  dpm_complete: c1a0d998 [pcmcia_socket0] 2

4th:

  dpm_prepare: c1a0d998 [pcmcia_socket0] 2
  dpm_suspend: c1a0d998 [pcmcia_socket0] 2
  dpm_suspend_noirq: c1a0d998 [pcmcia_socket0] 2
  dpm_resume_noirq: c1a0d998 [pcmcia_socket0] 2
  dpm_resume: c1a0d998 [pcmcia_socket0] 2
  dpm_complete: c1a0d998 [pcmcia_socket0] 1

5th:

  dpm_prepare: c1a0d998 [pcmcia_socket0] 1
  dpm_suspend: c1a0d998 [pcmcia_socket0] 1
  dpm_suspend_noirq: c1a0d998 [pcmcia_socket0] 1
  dpm_resume_noirq: c1a0d998 [pcmcia_socket0] 1
  dpm_resume: c1a0d998 [pcmcia_socket0] 1
  dpm_complete: c1a0d998 [pcmcia_socket0] 0
  ------------[ cut here ]------------
  WARNING: at include/linux/kref.h:41 kobject_get+0x28/0x50()
  Modules linked in: ucb1x00_core
  Backtrace:
  [&lt;c0212090&gt;] (dump_backtrace+0x0/0x110) from [&lt;c04799dc&gt;] (dump_stack+0x18/0x1c)
  [&lt;c04799c4&gt;] (dump_stack+0x0/0x1c) from [&lt;c021cba0&gt;] (warn_slowpath_common+0x50/0x68)
  [&lt;c021cb50&gt;] (warn_slowpath_common+0x0/0x68) from [&lt;c021cbdc&gt;] (warn_slowpath_null+0x24/0x28)
  [&lt;c021cbb8&gt;] (warn_slowpath_null+0x0/0x28) from [&lt;c0335374&gt;] (kobject_get+0x28/0x50)
  [&lt;c033534c&gt;] (kobject_get+0x0/0x50) from [&lt;c03804f4&gt;] (get_device+0x1c/0x24)
  [&lt;c0388c90&gt;] (dpm_complete+0x0/0x1a0) from [&lt;c0389cc0&gt;] (dpm_resume_end+0x1c/0x20)
  ...

Looking at commit 7b24e7988263 ("pcmcia: split up central event handler"),
the following change was made to cs.c:

                return 0;
        }
 #endif
-
-       send_event(skt, CS_EVENT_PM_RESUME, CS_EVENT_PRI_LOW);
+       if (!(skt-&gt;state &amp; SOCKET_CARDBUS) &amp;&amp; (skt-&gt;callback))
+               skt-&gt;callback-&gt;early_resume(skt);
        return 0;
 }

And the corresponding change in ds.c is from:

-static int ds_event(struct pcmcia_socket *skt, event_t event, int priority)
-{
-       struct pcmcia_socket *s = pcmcia_get_socket(skt);
...
-       switch (event) {
...
-       case CS_EVENT_PM_RESUME:
-               if (verify_cis_cache(skt) != 0) {
-                       dev_dbg(&amp;skt-&gt;dev, "cis mismatch - different card\n");
-                       /* first, remove the card */
-                       ds_event(skt, CS_EVENT_CARD_REMOVAL, CS_EVENT_PRI_HIGH);
-                       mutex_lock(&amp;s-&gt;ops_mutex);
-                       destroy_cis_cache(skt);
-                       kfree(skt-&gt;fake_cis);
-                       skt-&gt;fake_cis = NULL;
-                       s-&gt;functions = 0;
-                       mutex_unlock(&amp;s-&gt;ops_mutex);
-                       /* now, add the new card */
-                       ds_event(skt, CS_EVENT_CARD_INSERTION,
-                                CS_EVENT_PRI_LOW);
-               }
-               break;
...
-    }

-    pcmcia_put_socket(s);

-    return 0;
-} /* ds_event */

to:

+static int pcmcia_bus_early_resume(struct pcmcia_socket *skt)
+{
+       if (!verify_cis_cache(skt)) {
+               pcmcia_put_socket(skt);
+               return 0;
+       }

+       dev_dbg(&amp;skt-&gt;dev, "cis mismatch - different card\n");

+       /* first, remove the card */
+       pcmcia_bus_remove(skt);
+       mutex_lock(&amp;skt-&gt;ops_mutex);
+       destroy_cis_cache(skt);
+       kfree(skt-&gt;fake_cis);
+       skt-&gt;fake_cis = NULL;
+       skt-&gt;functions = 0;
+       mutex_unlock(&amp;skt-&gt;ops_mutex);

+       /* now, add the new card */
+       pcmcia_bus_add(skt);
+       return 0;
+}

As can be seen, the original function called pcmcia_get_socket() and
pcmcia_put_socket() around the guts, whereas the replacement code
calls pcmcia_put_socket() only in one path.  This creates an imbalance
in the refcounting.

Testing with pcmcia_put_socket() put removed shows that the bug is gone:

  dpm_suspend: c1a10998 [pcmcia_socket0] 5
  dpm_suspend_noirq: c1a10998 [pcmcia_socket0] 5
  dpm_resume_noirq: c1a10998 [pcmcia_socket0] 5
  dpm_resume: c1a10998 [pcmcia_socket0] 5
  dpm_complete: c1a10998 [pcmcia_socket0] 5

Tested-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
Cc: Dominik Brodowski &lt;linux@dominikbrodowski.net&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>USB/PCI/PCMCIA: Clean up new_id and remove_id sysfs attribute routines</title>
<updated>2012-01-27T01:04:39+00:00</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2012-01-24T19:35:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/BMC/Intel-BMC/linux.git/commit/?id=ed283e9f0a2cc0541870828c76c6c6997c51a318'/>
<id>urn:sha1:ed283e9f0a2cc0541870828c76c6c6997c51a318</id>
<content type='text'>
This patch (as1514) cleans up some places where new_id and remove_id
sysfs attributes are created and deleted.  Handling both attributes in
a single routine rather than a pair of routines makes the code
smaller.  It also prevents certain kinds of errors, like one we
currently have in the USB subsystem: The removeid attribute is often
created even when newid isn't (because the driver's no_dynamid_id flag
is set).

In the case of the PCMCIA subsystem, the newid attribute is created
but never explicitly deleted.  The patch adds a deletion routine.

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Acked-by: Jesse Barnes &lt;jbarnes@virtuousgeek.org&gt;
Acked-by: Dominik Brodowski &lt;linux@dominikbrodowski.net&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
</entry>
</feed>
