On Wed 22-11-17 10:09:13, Zi Yan wrote:
>
>
> Michal Hocko wrote:
> > On Wed 22-11-17 09:43:46, Zi Yan wrote:
> >>
> >> Michal Hocko wrote:
[...]
> >>> but why is unsafe to enable the feature on other arches which support
> >>> THP? Is there any plan to do the next step and remove this config
> >>> option?
> >> Because different architectures have their own way of specifying a swap
> >> entry. This means, to support THP migration, each architecture needs to
> >> add its own __pmd_to_swp_entry() and __swp_entry_to_pmd(), which are
> >> used for arch-independent pmd_to_swp_entry() and swp_entry_to_pmd().
> >
> > I understand that part. But this smells like a matter of coding, no?
> > I was suprised to see the note about safety which didn't make much sense
> > to me.
>
> And testing as well. I had powerpc book3s support in my initial patch
> submission, but removed it because I do not have access to the powerpc
> machine any more. I also tried ARM64, which seems working by adding the
> code, but I have no hardware to test it now.
>
> Any suggestions?
Cc arch maintainers and mailing lists?
--
Michal Hocko
SUSE Labs
This is the start of the stable review cycle for the 3.2.96 release.
There are 61 patches in this series, which will be posted as responses
to this one. If anyone has any issues with these being applied, please
let me know.
Responses should be made by Fri Nov 24 20:00:00 UTC 2017.
Anything received after that time might be too late.
A combined patch relative to 3.2.95 will be posted as an additional
response to this. A shortlog and diffstat can be found below.
Ben.
-------------
Aleksandr Bezzubikov (1):
PCI: shpchp: Enable bridge bus mastering if MSI is enabled
[48b79a14505349a29b3e20f03619ada9b33c4b17]
Amir Goldstein (1):
xfs: fix incorrect log_flushed on fsync
[47c7d0b19502583120c3f396c7559e7a77288a68]
Andrey Korolyov (1):
cs5536: add support for IDE controller variant
[591b6bb605785c12a21e8b07a08a277065b655a5]
Andy Lutomirski (1):
x86/fsgsbase/64: Report FSBASE and GSBASE correctly in core dumps
[9584d98bed7a7a904d0702ad06bbcc94703cb5b4]
Arvind Yadav (1):
media: imon: Fix null-ptr-deref in imon_probe
[58fd55e838276a0c13d1dc7c387f90f25063cbf3]
Bart Van Assche (1):
block: Relax a check in blk_start_queue()
[4ddd56b003f251091a67c15ae3fe4a5c5c5e390a]
Ben Hutchings (1):
mac80211: Fix null dereference in ieee80211_key_link()
[not upstream; fixes a regression specific to 3.2-stable]
Benjamin Block (1):
scsi: zfcp: add handling for FCP_RESID_OVER to the fcp ingress path
[a099b7b1fc1f0418ab8d79ecf98153e1e134656e]
Bjørn Mork (1):
net: cdc_ether: fix divide by 0 on bad descriptors
[2cb80187ba065d7decad7c6614e35e07aec8a974]
Brian King (1):
scsi: aacraid: Fix command send race condition
[1ae948fa4f00f3a2823e7cb19a3049ef27dd6947]
Cameron Gutman (2):
Input: xpad - don't depend on endpoint order
[c01b5e7464f0cf20936d7467c7528163c4e2782d]
Input: xpad - validate USB endpoint type during probe
[122d6a347329818419b032c5a1776e6b3866d9b9]
Chad Dupuis (1):
[SCSI] qla2xxx: Add mutex around optrom calls to serialize accesses.
[7a8ab9c840b5dff9bb70328338a86444ed1c2415]
Christophe JAILLET (1):
driver core: bus: Fix a potential double free
[0f9b011d3321ca1079c7a46c18cb1956fbdb7bcb]
Colin Ian King (1):
media: em28xx: calculate left volume level correctly
[801e3659bf2c87c31b7024087d61e89e172b5651]
Dan Carpenter (2):
powerpc/44x: Fix mask and shift to zero bug
[8d046759f6ad75824fdf7b9c9a3da0272ea9ea92]
scsi: qla2xxx: Fix an integer overflow in sysfs code
[e6f77540c067b48dee10f1e33678415bfcc89017]
Dmitry Fleytman (1):
usb: Add device quirk for Logitech HD Pro Webcam C920-C
[a1279ef74eeeb5f627f091c71d80dd7ac766c99d]
Dmitry Torokhov (1):
Input: gtco - fix potential out-of-bound access
[a50829479f58416a013a4ccca791336af3c584c7]
Douglas Anderson (1):
USB: core: Avoid race of async_completed() w/ usbdev_release()
[ed62ca2f4f51c17841ea39d98c0c409cb53a3e10]
Edwin Török (1):
dlm: avoid double-free on error path in dlm_device_{register,unregister}
[55acdd926f6b21a5cdba23da98a48aedf19ac9c3]
Eric Dumazet (1):
ipv6: fix typo in fib6_net_exit()
[32a805baf0fb70b6dbedefcd7249ac7f580f9e3b]
Eric W. Biederman (1):
fcntl: Don't use ambiguous SIG_POLL si_codes
[d08477aa975e97f1dc64c0ae59cebf98520456ce]
Eryu Guan (1):
ext4: validate s_first_meta_bg at mount time
[3a4b77cd47bb837b8557595ec7425f281f2ca1fe]
Finn Thain (1):
scsi: mac_esp: Fix PIO transfers for MESSAGE IN phase
[7640d91d285893a5cf1e62b2cd00f0884c401d93]
Guenter Roeck (1):
media: uvcvideo: Prevent heap overflow when accessing mapped controls
[7e09f7d5c790278ab98e5f2c22307ebe8ad6e8ba]
Guillaume Nault (2):
l2tp: pass tunnel pointer to ->session_create()
[f026bc29a8e093edfbb2a77700454b285c97e8ad]
l2tp: prevent creation of sessions on terminated tunnels
[f3c66d4e144a0904ea9b95d23ed9f8eb38c11bfb]
Guillermo A. Amaral (1):
Input: xpad - add a few new VID/PID combinations
[540602a43ae5fa94064f8fae100f5ca75d4c002b]
Jan H . Schönherr (1):
KVM: SVM: Add a missing 'break' statement
[49a8afca386ee1775519a4aa80f8e121bd227dd4]
Joe Carnuccio (1):
[SCSI] qla2xxx: Corrections to returned sysfs error codes.
[71dfe9e776878d9583d004edade55edc2bdac5eb]
Johan Hovold (2):
USB: serial: console: fix use-after-free after failed setup
[299d7572e46f98534033a9e65973f13ad1ce9047]
[media] cx231xx-cards: fix NULL-deref on missing association descriptor
[6c3b047fa2d2286d5e438bcb470c7b1a49f415f6]
Johannes Berg (1):
mac80211: don't compare TKIP TX MIC key in reinstall prevention
[cfbb0d90a7abb289edc91833d0905931f8805f12]
Jonas Gorski (2):
MIPS: AR7: allow NULL clock for clk_get_rate
[585e0e9d02a690c29932b2fc0789835c7b91d448]
MIPS: BCM63XX: allow NULL clock for clk_get_rate
[1b495faec231980b6c719994b24044ccc04ae06c]
Kai-Heng Feng (2):
Input: i8042 - add Gigabyte P57 to the keyboard reset table
[697c5d8a36768b36729533fb44622b35d56d6ad0]
usb: quirks: add delay init quirk for Corsair Strafe RGB keyboard
[de3af5bf259d7a0bfaac70441c8568ab5998d80c]
Leon Romanovsky (1):
net/mlx4_core: Make explicit conversion to 64bit value
[187782eb58a89ea030731114c6ae37842a4472fe]
Mike Marciniszyn (1):
IB/{qib, hfi1}: Avoid flow control testing for RDMA write operation
[5b0ef650bd0f820e922fcc42f1985d4621ae19cf]
Nisar Sayed (1):
smsc95xx: Configure pause time to 0xffff when tx flow control enabled
[9c0827317f235865ae421293f8aecf6cb327a63e]
Noa Osherovich (1):
IB/core: Fix the validations of a multicast LID in attach or detach operations
[5236333592244557a19694a51337df6ac018f0a7]
Oleg Nesterov (1):
signal: move the "sig < SIGRTMIN" check into siginmask(sig)
[5c8ccefdf46c5f87d87b694c7fbc04941c2c99a5]
Paul Mackerras (1):
powerpc: Correct instruction code for xxlor instruction
[93b2d3cf3733b4060d3623161551f51ea1ab5499]
Rui Teng (1):
powerpc/mm: Fix check of multiple 16G pages from device tree
[23493c121912a39f0262e0dbeb236e1d39efa4d5]
Sabrina Dubroca (1):
ipv6: fix memory leak with multiple tables during netns destruction
[ba1cc08d9488c94cb8d94f545305688b72a2a300]
Sean Young (1):
media: lirc_zilog: driver only sends LIRCCODE
[89d8a2cc51d1f29ea24a0b44dde13253141190a0]
SeongJae Park (1):
mm/vmstat.c: fix wrong comment
[f113e64121ba9f4791332248b315d9f57ee33a6b]
Steffen Maier (6):
scsi: zfcp: fix capping of unsuccessful GPN_FT SAN response trace records
[975171b4461be296a35e83ebd748946b81cf0635]
scsi: zfcp: fix missing trace records for early returns in TMF eh handlers
[1a5d999ebfc7bfe28deb48931bb57faa8e4102b6]
scsi: zfcp: fix passing fsf_req to SCSI trace on TMF to correlate with HBA
[9fe5d2b2fd30aa8c7827ec62cbbe6d30df4fe3e3]
scsi: zfcp: fix payload with full FCP_RSP IU in SCSI trace records
[12c3e5754c8022a4f2fd1e9f00d19e99ee0d3cc1]
scsi: zfcp: fix queuecommand for scsi_eh commands when DIX enabled
[71b8e45da51a7b64a23378221c0a5868bd79da4f]
scsi: zfcp: trace HBA FSF response by default on dismiss or timedout late response
[fdb7cee3b9e3c561502e58137a837341f10cbf8b]
Steven Rostedt (1):
ftrace: Fix selftest goto location on error
[46320a6acc4fb58f04bcf78c4c942cc43b20f986]
Ted Mielczarek (1):
Input: xpad - add support for Xbox One controllers
[1a48ff81b3912be5fadae3fafde6c2f632246a4c]
Theodore Ts'o (1):
ext4: fix fencepost in s_first_meta_bg validation
[2ba3e6e8afc9b6188b471f27cf2b5e3cf34e7af2]
Thomas Gleixner (1):
genirq: Make sparse_irq_lock protect what it should protect
[12ac1d0f6c3e95732d144ffa65c8b20fbd9aa462]
Wanpeng Li (1):
KVM: async_pf: Fix #DF due to inject "Page not Present" and "Page Ready" exceptions simultaneously
[9a6e7c39810e4a8bc7fc95056cefb40583fe07ef]
Xiangliang.Yu (1):
drm/ttm: Fix accounting error when fail to get pages for pool
[9afae2719273fa1d406829bf3498f82dbdba71c7]
Xin Long (1):
sctp: do not peel off an assoc from one netns to another one
[df80cd9b28b9ebaa284a41df611dbf3a2d05ca74]
Makefile | 4 +-
arch/mips/ar7/clock.c | 3 +
arch/mips/bcm63xx/clk.c | 3 +
arch/powerpc/boot/4xx.c | 2 +-
arch/powerpc/include/asm/ppc-opcode.h | 2 +-
arch/powerpc/mm/hash_utils_64.c | 2 +-
arch/x86/include/asm/elf.h | 5 +-
arch/x86/kvm/svm.c | 1 +
arch/x86/kvm/x86.c | 34 ++++-
block/blk-core.c | 2 +-
drivers/ata/pata_amd.c | 1 +
drivers/ata/pata_cs5536.c | 1 +
drivers/base/bus.c | 2 +-
drivers/gpu/drm/ttm/ttm_page_alloc.c | 2 +-
drivers/infiniband/core/verbs.c | 44 +++++-
drivers/infiniband/hw/qib/qib_rc.c | 3 +-
drivers/input/joystick/xpad.c | 218 ++++++++++++++++++++++++----
drivers/input/serio/i8042-x86ia64io.h | 7 +
drivers/input/tablet/gtco.c | 17 ++-
drivers/media/rc/imon.c | 5 +
drivers/media/video/cx231xx/cx231xx-cards.c | 2 +-
drivers/media/video/em28xx/em28xx-audio.c | 2 +-
drivers/media/video/uvc/uvc_ctrl.c | 7 +
drivers/net/ethernet/mellanox/mlx4/fw.c | 2 +-
drivers/net/usb/cdc_ether.c | 5 +-
drivers/net/usb/smsc95xx.c | 11 +-
drivers/pci/hotplug/shpchp_hpc.c | 2 +
drivers/s390/scsi/zfcp_dbf.c | 31 +++-
drivers/s390/scsi/zfcp_dbf.h | 13 +-
drivers/s390/scsi/zfcp_fc.h | 6 +-
drivers/s390/scsi/zfcp_fsf.c | 7 +-
drivers/s390/scsi/zfcp_scsi.c | 16 +-
drivers/scsi/aacraid/aachba.c | 48 +++---
drivers/scsi/mac_esp.c | 35 ++---
drivers/scsi/qla2xxx/qla_attr.c | 71 ++++++---
drivers/scsi/qla2xxx/qla_bsg.c | 12 +-
drivers/scsi/qla2xxx/qla_def.h | 1 +
drivers/scsi/qla2xxx/qla_os.c | 1 +
drivers/staging/media/lirc/lirc_zilog.c | 8 +-
drivers/usb/core/devio.c | 4 +-
drivers/usb/core/quirks.c | 6 +-
drivers/usb/serial/console.c | 1 +
fs/dlm/user.c | 4 +
fs/ext4/super.c | 9 ++
fs/fcntl.c | 13 +-
fs/xfs/xfs_log.c | 7 -
include/asm-generic/siginfo.h | 4 +-
include/linux/pci_ids.h | 1 +
include/linux/signal.h | 24 +--
kernel/irq/irqdesc.c | 24 +--
kernel/trace/trace_selftest.c | 2 +-
mm/vmstat.c | 2 +-
net/ipv6/ip6_fib.c | 17 ++-
net/l2tp/l2tp_core.c | 38 +++--
net/l2tp/l2tp_core.h | 8 +-
net/l2tp/l2tp_eth.c | 11 +-
net/l2tp/l2tp_netlink.c | 8 +-
net/l2tp/l2tp_ppp.c | 19 +--
net/mac80211/key.c | 38 ++++-
net/sctp/socket.c | 5 +
60 files changed, 632 insertions(+), 251 deletions(-)
--
Ben Hutchings
Beware of programmers who carry screwdrivers. - Leonard Brandwein
This is a note to let you know that I've just added the patch titled
mm/pagewalk.c: report holes in hugetlb ranges
to the 4.9-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=sum…
The filename of the patch is:
mm-pagewalk.c-report-holes-in-hugetlb-ranges.patch
and it can be found in the queue-4.9 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable(a)vger.kernel.org> know about it.
>From 373c4557d2aa362702c4c2d41288fb1e54990b7c Mon Sep 17 00:00:00 2001
From: Jann Horn <jannh(a)google.com>
Date: Tue, 14 Nov 2017 01:03:44 +0100
Subject: mm/pagewalk.c: report holes in hugetlb ranges
From: Jann Horn <jannh(a)google.com>
commit 373c4557d2aa362702c4c2d41288fb1e54990b7c upstream.
This matters at least for the mincore syscall, which will otherwise copy
uninitialized memory from the page allocator to userspace. It is
probably also a correctness error for /proc/$pid/pagemap, but I haven't
tested that.
Removing the `walk->hugetlb_entry` condition in walk_hugetlb_range() has
no effect because the caller already checks for that.
This only reports holes in hugetlb ranges to callers who have specified
a hugetlb_entry callback.
This issue was found using an AFL-based fuzzer.
v2:
- don't crash on ->pte_hole==NULL (Andrew Morton)
- add Cc stable (Andrew Morton)
Changed for 4.4/4.9 stable backport:
- fix up conflict in the huge_pte_offset() call
Fixes: 1e25a271c8ac ("mincore: apply page table walker on do_mincore()")
Signed-off-by: Jann Horn <jannh(a)google.com>
Signed-off-by: Linus Torvalds <torvalds(a)linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
mm/pagewalk.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
--- a/mm/pagewalk.c
+++ b/mm/pagewalk.c
@@ -142,8 +142,12 @@ static int walk_hugetlb_range(unsigned l
do {
next = hugetlb_entry_end(h, addr, end);
pte = huge_pte_offset(walk->mm, addr & hmask);
- if (pte && walk->hugetlb_entry)
+
+ if (pte)
err = walk->hugetlb_entry(pte, hmask, addr, next, walk);
+ else if (walk->pte_hole)
+ err = walk->pte_hole(addr, next, walk);
+
if (err)
break;
} while (addr = next, addr != end);
Patches currently in stable-queue which might be from jannh(a)google.com are
queue-4.9/mm-pagewalk.c-report-holes-in-hugetlb-ranges.patch
commit 373c4557d2aa362702c4c2d41288fb1e54990b7c upstream.
This matters at least for the mincore syscall, which will otherwise copy
uninitialized memory from the page allocator to userspace. It is
probably also a correctness error for /proc/$pid/pagemap, but I haven't
tested that.
Removing the `walk->hugetlb_entry` condition in walk_hugetlb_range() has
no effect because the caller already checks for that.
This only reports holes in hugetlb ranges to callers who have specified
a hugetlb_entry callback.
This issue was found using an AFL-based fuzzer.
v2:
- don't crash on ->pte_hole==NULL (Andrew Morton)
- add Cc stable (Andrew Morton)
Changed for 4.4/4.9 stable backport:
- fix up conflict in the huge_pte_offset() call
Fixes: 1e25a271c8ac ("mincore: apply page table walker on do_mincore()")
Signed-off-by: Jann Horn <jannh(a)google.com>
---
Please apply this patch to <=4.9 stable trees instead of the
original patch.
mm/pagewalk.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/mm/pagewalk.c b/mm/pagewalk.c
index 29f2f8b853ae..c2cbd2620169 100644
--- a/mm/pagewalk.c
+++ b/mm/pagewalk.c
@@ -142,8 +142,12 @@ static int walk_hugetlb_range(unsigned long addr, unsigned long end,
do {
next = hugetlb_entry_end(h, addr, end);
pte = huge_pte_offset(walk->mm, addr & hmask);
- if (pte && walk->hugetlb_entry)
+
+ if (pte)
err = walk->hugetlb_entry(pte, hmask, addr, next, walk);
+ else if (walk->pte_hole)
+ err = walk->pte_hole(addr, next, walk);
+
if (err)
break;
} while (addr = next, addr != end);
--
2.15.0.448.gf294e3d99a-goog
This is a note to let you know that I've just added the patch titled
mm/pagewalk.c: report holes in hugetlb ranges
to the 4.4-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=sum…
The filename of the patch is:
mm-pagewalk.c-report-holes-in-hugetlb-ranges.patch
and it can be found in the queue-4.4 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable(a)vger.kernel.org> know about it.
>From 373c4557d2aa362702c4c2d41288fb1e54990b7c Mon Sep 17 00:00:00 2001
From: Jann Horn <jannh(a)google.com>
Date: Tue, 14 Nov 2017 01:03:44 +0100
Subject: mm/pagewalk.c: report holes in hugetlb ranges
From: Jann Horn <jannh(a)google.com>
commit 373c4557d2aa362702c4c2d41288fb1e54990b7c upstream.
This matters at least for the mincore syscall, which will otherwise copy
uninitialized memory from the page allocator to userspace. It is
probably also a correctness error for /proc/$pid/pagemap, but I haven't
tested that.
Removing the `walk->hugetlb_entry` condition in walk_hugetlb_range() has
no effect because the caller already checks for that.
This only reports holes in hugetlb ranges to callers who have specified
a hugetlb_entry callback.
This issue was found using an AFL-based fuzzer.
v2:
- don't crash on ->pte_hole==NULL (Andrew Morton)
- add Cc stable (Andrew Morton)
Changed for 4.4/4.9 stable backport:
- fix up conflict in the huge_pte_offset() call
Fixes: 1e25a271c8ac ("mincore: apply page table walker on do_mincore()")
Signed-off-by: Jann Horn <jannh(a)google.com>
Signed-off-by: Linus Torvalds <torvalds(a)linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
mm/pagewalk.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
--- a/mm/pagewalk.c
+++ b/mm/pagewalk.c
@@ -142,8 +142,12 @@ static int walk_hugetlb_range(unsigned l
do {
next = hugetlb_entry_end(h, addr, end);
pte = huge_pte_offset(walk->mm, addr & hmask);
- if (pte && walk->hugetlb_entry)
+
+ if (pte)
err = walk->hugetlb_entry(pte, hmask, addr, next, walk);
+ else if (walk->pte_hole)
+ err = walk->pte_hole(addr, next, walk);
+
if (err)
break;
} while (addr = next, addr != end);
Patches currently in stable-queue which might be from jannh(a)google.com are
queue-4.4/mm-pagewalk.c-report-holes-in-hugetlb-ranges.patch
On Wed 22-11-17 09:43:46, Zi Yan wrote:
>
>
> Michal Hocko wrote:
> > On Wed 22-11-17 09:54:16, Michal Hocko wrote:
> >> On Mon 20-11-17 21:18:55, Zi Yan wrote:
> > [...]
> >>> diff --git a/include/linux/migrate.h b/include/linux/migrate.h
> >>> index 895ec0c4942e..a2246cf670ba 100644
> >>> --- a/include/linux/migrate.h
> >>> +++ b/include/linux/migrate.h
> >>> @@ -54,7 +54,7 @@ static inline struct page *new_page_nodemask(struct page *page,
> >>> new_page = __alloc_pages_nodemask(gfp_mask, order,
> >>> preferred_nid, nodemask);
> >>>
> >>> - if (new_page && PageTransHuge(page))
> >>> + if (new_page && PageTransHuge(new_page))
> >>> prep_transhuge_page(new_page);
> >> I would keep the two checks consistent. But that leads to a more
> >> interesting question. new_page_nodemask does
> >>
> >> if (thp_migration_supported() && PageTransHuge(page)) {
> >> order = HPAGE_PMD_ORDER;
> >> gfp_mask |= GFP_TRANSHUGE;
> >> }
> >
> > And one more question/note. Why do we need thp_migration_supported
> > in the first place? 9c670ea37947 ("mm: thp: introduce
> > CONFIG_ARCH_ENABLE_THP_MIGRATION") says
> > : Introduce CONFIG_ARCH_ENABLE_THP_MIGRATION to limit thp migration
> > : functionality to x86_64, which should be safer at the first step.
> >
> > but why is unsafe to enable the feature on other arches which support
> > THP? Is there any plan to do the next step and remove this config
> > option?
>
> Because different architectures have their own way of specifying a swap
> entry. This means, to support THP migration, each architecture needs to
> add its own __pmd_to_swp_entry() and __swp_entry_to_pmd(), which are
> used for arch-independent pmd_to_swp_entry() and swp_entry_to_pmd().
I understand that part. But this smells like a matter of coding, no?
I was suprised to see the note about safety which didn't make much sense
to me.
--
Michal Hocko
SUSE Labs
This is a note to let you know that I've just added the patch titled
ipmi: Prefer ACPI system interfaces over SMBIOS ones
to the 4.14-stable tree which can be found at:
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=sum…
The filename of the patch is:
ipmi-prefer-acpi-system-interfaces-over-smbios-ones.patch
and it can be found in the queue-4.14 subdirectory.
If you, or anyone else, feels it should not be added to the stable tree,
please let <stable(a)vger.kernel.org> know about it.
>From 7e030d6dff713250c7dcfb543cad2addaf479b0e Mon Sep 17 00:00:00 2001
From: Corey Minyard <cminyard(a)mvista.com>
Date: Fri, 8 Sep 2017 14:05:58 -0500
Subject: ipmi: Prefer ACPI system interfaces over SMBIOS ones
From: Corey Minyard <cminyard(a)mvista.com>
commit 7e030d6dff713250c7dcfb543cad2addaf479b0e upstream.
The recent changes to add SMBIOS (DMI) IPMI interfaces as platform
devices caused DMI to be selected before ACPI, causing ACPI type
of operations to not work.
Signed-off-by: Corey Minyard <cminyard(a)mvista.com>
Signed-off-by: Greg Kroah-Hartman <gregkh(a)linuxfoundation.org>
---
drivers/char/ipmi/ipmi_si_intf.c | 33 +++++++++++++++++++++++----------
1 file changed, 23 insertions(+), 10 deletions(-)
--- a/drivers/char/ipmi/ipmi_si_intf.c
+++ b/drivers/char/ipmi/ipmi_si_intf.c
@@ -3424,7 +3424,7 @@ static inline void wait_for_timer_and_th
del_timer_sync(&smi_info->si_timer);
}
-static int is_new_interface(struct smi_info *info)
+static struct smi_info *find_dup_si(struct smi_info *info)
{
struct smi_info *e;
@@ -3439,24 +3439,36 @@ static int is_new_interface(struct smi_i
*/
if (info->slave_addr && !e->slave_addr)
e->slave_addr = info->slave_addr;
- return 0;
+ return e;
}
}
- return 1;
+ return NULL;
}
static int add_smi(struct smi_info *new_smi)
{
int rv = 0;
+ struct smi_info *dup;
mutex_lock(&smi_infos_lock);
- if (!is_new_interface(new_smi)) {
- pr_info(PFX "%s-specified %s state machine: duplicate\n",
- ipmi_addr_src_to_str(new_smi->addr_source),
- si_to_str[new_smi->si_type]);
- rv = -EBUSY;
- goto out_err;
+ dup = find_dup_si(new_smi);
+ if (dup) {
+ if (new_smi->addr_source == SI_ACPI &&
+ dup->addr_source == SI_SMBIOS) {
+ /* We prefer ACPI over SMBIOS. */
+ dev_info(dup->dev,
+ "Removing SMBIOS-specified %s state machine in favor of ACPI\n",
+ si_to_str[new_smi->si_type]);
+ cleanup_one_si(dup);
+ } else {
+ dev_info(new_smi->dev,
+ "%s-specified %s state machine: duplicate\n",
+ ipmi_addr_src_to_str(new_smi->addr_source),
+ si_to_str[new_smi->si_type]);
+ rv = -EBUSY;
+ goto out_err;
+ }
}
pr_info(PFX "Adding %s-specified %s state machine\n",
@@ -3865,7 +3877,8 @@ static void cleanup_one_si(struct smi_in
poll(to_clean);
schedule_timeout_uninterruptible(1);
}
- disable_si_irq(to_clean, false);
+ if (to_clean->handlers)
+ disable_si_irq(to_clean, false);
while (to_clean->curr_msg || (to_clean->si_state != SI_NORMAL)) {
poll(to_clean);
schedule_timeout_uninterruptible(1);
Patches currently in stable-queue which might be from cminyard(a)mvista.com are
queue-4.14/ipmi-fix-unsigned-long-underflow.patch
queue-4.14/ipmi-prefer-acpi-system-interfaces-over-smbios-ones.patch
I'm requesting a backport of
7e030d6dff713250c7dcfb543cad2addaf479b0e ipmi: Prefer ACPI system
interfaces over SMBIOS ones
to the 4.14 stable kernel tree only. This was already staged for
Linus in my public tree before Andrew noticed an issue that this
patch fixes, where the system can oops when the ipmi_si module
is removed. Since it fixes an oops that likely can affect people, I'd
like it to be added to the stable tree,
Since this bug was added in 4.13 by:
0944d889a237b6107f9ceeee053fe7221cdd1089 ipmi: Convert DMI handling
over to a platform device
it should only require a backport to 4.14.
Thank you,
-corey