Commit Graph

115995 Commits

Author SHA1 Message Date
Marcelo Araujo
2ae0afa8ee Add the capability to refresh the gpart(8) label without need a reboot.
gpart(8) has functionality to change the label of an GPT partition.
This functionality works like it should, however, after a label change
the /dev/gpt/ entries remain unchanged. glabel(8) status output remains
unchanged. The change only takes effect after a reboot.

PR:		162690
Submitted by:	sub.mesa@gmail, Ben RUBSON <ben.rubson@gmail.com>, ae
Reviewed by:	allanjude, bapt, bcr
MFC after:	6 weeks.
Differential Revision:	https://reviews.freebsd.org/D9935
2017-03-12 04:15:56 +00:00
Emmanuel Vadot
aa6b345634 Remove i915drm and radeondrm from NOTES and conf.
This unbreak LINT kernel.

Reported by:	lwhsu
2017-03-12 00:52:16 +00:00
Ian Lepore
bf8bdd6762 Extend the pl011 small-fifos fix to other SoCs that indicate rev 5
hardware but lack the larger fifos rev 5 hardware should have.

The linux world (where our FDT data comes from) solved this by adding
a new property to pl011 nodes, "arm,primecell-periphid".  When this
property is present, its values override the values in the hardware
periphid registers.  For pl011 rev 5 hardware with small fifos, they
override the id so that it appears to be rev 4 hardware.

The driver now uses the new property when present.  It also continues
to check the device compat string, to handle older fdt data that may
still be in use on existing systems (on RPi systems it is common to
update system software without updating fdt data which is part of the
boot firmware).

Reviewed by:	imp
2017-03-11 22:34:02 +00:00
Alan Cox
e383e820d3 Simplify the control flow and tidy up a comment in map_insert.
In collaboration with:	kib
MFC after:	1 week
2017-03-11 18:57:13 +00:00
Alexander Motin
b1303ffeb2 Increase device openings to tagged maximum.
Some SIMs report much less untagged device openings then tagged ones.
Target mode devices are not handled by regular probing routines, and so
there is nothing to increase queue size for them to the SIM's maximum.
To fix that resize the queue explicitly on ctl periph registration.
This radically improves performance of mpt(4) in target mode.

Also fetch and report device queue statistics in `ctladm dumpstructs`,
since regular way of `camcontrol tags` is not usable in target mode.

MFC after:	2 weeks
2017-03-11 18:46:46 +00:00
Andriy Gapon
f0985602f2 aacraid: fix build with AACRAID_DEBUG=2
MFC after:	10 days
2017-03-11 18:40:39 +00:00
Alexander Motin
2ef6e7aea8 Allow XPT_GDEV_STATS for UNCONFIGURED devices.
Queue statistics has nothing to do with presence or absence of INQUIRY
data, etc.  Target mode devices are never configured, but have queues.

MFC after:	2 weeks
2017-03-11 18:23:05 +00:00
Andriy Gapon
57223e9994 uma: fix pages <-> items conversions at several places
Those places were not taking into account uk_ppera.
At present one allocation is always used by one slab, so uk_ppera must
be used to convert between pages and slabs.
uk_ipers is used to convert between slabs and items.

MFC after:	1 month (if ever)
2017-03-11 16:43:38 +00:00
Andriy Gapon
a55ebb7cd5 uma: eliminate uk_slabsize field
The field was not used beyond the initial keg setup stage anyway.

MFC after:	1 month (if ever)
2017-03-11 16:35:36 +00:00
Andriy Gapon
520758a51d zfs: provide a special vptocnp method for the .zfs vnode
vop_stdvptocnp() doesn't work properly if .zfs directory is hidden.

Reported by:	swills, des
Tested by:	des
MFC after:	1 week
MFC with:	r314048
2017-03-11 16:00:49 +00:00
Andriy Gapon
28ef18b8c1 trace thread running state when a thread is run for the first time
This applies to both KTR_SCHED and DTrace sched:::on-cpu tracing.

MFC after:	10 days
2017-03-11 15:57:36 +00:00
Andriy Gapon
6c9271a918 actually implement proc:::lwp-exit probe
MFC after:	4 days
2017-03-11 15:47:27 +00:00
Andriy Gapon
595a52b771 revert r314862, use of GCC_MS_EXTENSIONS in qlxgbe
Commit r278913 made explicit use of GCC_MS_EXTENSIONS  unnecessary.

Requested by:	glebius
2017-03-11 15:16:55 +00:00
Alexander Motin
67445003fb Partially fix target task management requests handling.
- XPT_NOTIFY_ACKNOWLEDGE was not handled, causing stuck requests.
 - XPT_ABORT was not even trying to abort active ATIOs/INOTs.
 - Initiator's tag was not stored and not used where needed.
 - List of TM request types needed update.
 - mpt_scsi_tgt_status() missed some useful debugging.

After this change global TM requests, such as reset, should work properly.
ABORT TASK (ABTS) requests are still not passes to CTL, that is not good
and should be fixed.

MFC after:	2 weeks
2017-03-11 14:25:14 +00:00
Bruce Evans
b8188f52eb Fix the attribute for scteken_clear() (change it back from the user
user default normal attribute to the current attribute).

This change only fixes a logic error.  scterm_clear() used to be
used for terminal reset, but teken uses a general fill function for
that, leaving scterm_clear() only used for initialization and mode
change, when using the user default attribute is correct.  It is not
really a terminal function, but needs to sync its changes with the
terminal layer.  Syncing of the attribute is currently broken for
terminal reset, but works for initialization and mode change.
2017-03-11 13:56:06 +00:00
Bruce Evans
ad530aa98b Add a scteken_set_cursor() (sc to teken) method and use it to fix
some cases of initialization and resetting of the teken cursor position.
(This bad name is consistent with others, but it is too easy to confuse
with scteken_cursor() which goes in the opposite direction.)

The following cases were broken:
- for booting without a syscons console, the teken and sc positions for
  ttyv0 were (0, 0), but are supposed to be somewhere in the middle of
  the screen (after carefully preserved BIOS and loader messages) (at
  least if there is no mode switch that loses the messages).
- after mode switches, the screen is cleared and the cursor is supposed to
  be moved to (0, 0), but it was only moved there for sc.

The following case was hacked to work:
- for booting with a syscons console, it was arranged that scteken_init()
  for the console could see a nonzero cursor position and adjust, although
  this broke the sc seeing it in the non-console case above.
2017-03-11 11:31:06 +00:00
Michal Meloun
ffeeb2ab3f Split overbloated machep.c to multiple files and do basic cleanup
of these fragments.
2017-03-11 07:07:41 +00:00
Andrey V. Elsukov
719498102c Fix the L2 address printed in the "arp: %s moved from %*D" message.
In the r292978 struct llentry was changed and the ll_addr field become
the pointer.

PR:		217667
MFC after:	1 week
2017-03-11 04:57:52 +00:00
Emmanuel Vadot
4d5bf0bb88 drm(old): Remove i915 and radeon drivers
They cannot be used anymore with the userland bits we provide.
Furthermore, their KMS versions support the same hardware.

Submitted by:	dumbbell
Reviewed by:	emaste, manu
Sponsored by:	AsiaBSDCon
Differential Revision:	https://reviews.freebsd.org/D5614
2017-03-11 03:01:18 +00:00
Oleksandr Tymoshenko
5faab58bd0 [fdt] Make DTBs generated by make_dtb.sh overlay-ready
Generate symbols node when compiling dts files so they can be modified
during boot-time by applying overlays.
2017-03-10 22:45:07 +00:00
Alexander Motin
ad0f05e629 Abort all ATIOs and INOTs queued to SIM on LUN disable.
Some SIMs may not abort them implicitly, that either fail the LUN disable
request or just make us wait for those CCBs forever.  With this change
I can successfully disable LUNs on mpt(4).  For isp(4), which aborts them
implicitly, this change should be irrelevant.

MFC after:	2 weeks
2017-03-10 21:09:33 +00:00
Alexander Motin
832529c5bd Switch work_queue from TAILQ to STAILQ.
It is mostly FIFO and we don't need random removal there.

MFC after:	2 weeks
2017-03-10 20:20:00 +00:00
Alexander Motin
45400376e0 Request change of SIM target role only when it is different.
Separate WWNs change into separate request to know what actually failed.

MFC after:	2 weeks
2017-03-10 19:43:45 +00:00
Oleksandr Tymoshenko
947d877109 [loader][fdt] Fix applying overlays without __local_fixups__ node
Do not return error if __local_fixups__ node is missing in DTB overlay
because local fixup data is optional.

Reported by:	Manuel Stuhn
MFC after:	1 week
2017-03-10 19:15:57 +00:00
Sean Bruno
09dced1093 r314948 seems to be missing a variable or two that will break
TFTP/MFSRoot booting via PXE.  For the TFTP_LOADER case, go ahead and
fire off the old bootp() request to ensure that whatever is missing is
populated.

Sponsored by:	Limelight Networks
2017-03-10 17:14:08 +00:00
Alexander Motin
ead3ad6b5c Add PIM_EXTLUNS support to mpt(4).
Target mode is still limited to 256 LUNs due to the way driver is written,
but initiator can now use full 8 byte LUN space.

MFC after:	2 weeks
2017-03-10 14:44:59 +00:00
Bruce Evans
eeb7d30e06 Rename scteken_revattr() to scteken_sc_to_te_attr(). scteken_revattr()
looked like it might handle reverse attributes, but it actually handles
conversion of attributes in the direction indicated by the new name.
Reverse attributes are just broken.

Rename scteken_attr() to scteken_te_to_sc_attr().  scteken_attr() looked
like it might give teken attributes, but it actually gives sc attributes.

Change scteken_te_to_sc_attr() to return int instead of unsigned int.
u_char would be enough, and it promotes to int, and syscons uses int
or u_short for its attributes everywhere else (u_short holds a shifted
form and it promotes to int too).
2017-03-10 14:25:38 +00:00
Alexander Motin
501b16854f Improve residuals reporting in target mode.
MFC after:	2 weeks
2017-03-10 13:39:16 +00:00
Alexander Motin
4461a4a5ed Fix panic on wildcard target LUN disable.
MFC after:	2 weeks
2017-03-10 13:14:06 +00:00
Bruce Evans
8f2cc27067 Start fixing some bugs in attribute handling.
This change just does cleanups missed in r56043 17 years ago.  The
default attributes were still stored in structs for the purpose of
changing them and passing around pointers to the defaults, but r56043
added another layer that made the defaults invariant and only used for
initialization and reset.  Just use the defaults directly.  This was
already done for the kernel defaults.  The defaults for reverse
attributes aren't actually used, but are ignored in layers that no
longer support them.
2017-03-10 11:44:09 +00:00
Alexander Motin
93612a52c7 Fix FC target mode in mpt(4), broken in multiple ways.
- Not set BufferLength caused receive of empty ATIOs.
 - CDB length guessing was broken at least for RC16.
 - mpt_req_untimeout() was called with wrong req parameter.
 - Sense data reporting was broken in several ways.

With this change my LSI7204EP-LC can pass at least basic tests as target.
The code is still far from perfect, but finally I found second hw/driver
after isp(4) that really can work in CAM target mode.

MFC after:	2 weeks
2017-03-10 10:35:52 +00:00
Bruce Evans
1b835e81ca Fix compilation on sparc64. The frame buffer address is in a field that
is unavailable on sparc64 only.  This makes the new ec_putc() a non-op
on sparc64 but still calls it.  On other non-x86 arches, it should
compile but might not work.

Reported by:	gjb
2017-03-10 10:25:48 +00:00
Mahdi Mokhtari
32a1fb0d3d Fix NULL pointer dereference and panic with shm file pread/pwrite.
PR:		217429
Reported by:	Tim Newsham <tim.newsham@nccgroup.trust>
Reviewed by:	kib
Approved by:	dchagin
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D9844
2017-03-10 10:09:44 +00:00
Hans Petter Selasky
f73286645f Fix implementation of the DECLARE_WORK() macro in the LinuxKPI to fully
initialize the declared work structure and not only the function callback
pointer.

MFC after:		1 week
Sponsored by:		Mellanox Technologies
2017-03-09 18:37:17 +00:00
Hans Petter Selasky
9760ac0a3e Implement support for mutexes with deadlock avoidance in the LinuxKPI.
When locking a mutex and deadlock is detected the first mutex lock
call that sees the deadlock will return -EDEADLK .

MFC after:		1 week
Sponsored by:		Mellanox Technologies
2017-03-09 18:33:40 +00:00
Alexander Motin
471f963d40 Report some more data in XPT_PATH_INQ.
I am not sure they are used anywhere, but why not.

MFC after:	2 weeks
2017-03-09 17:53:37 +00:00
Alexander Motin
555dbebf3d Add support for XPT_GET_SIM_KNOB in FC mode.
MFC after:	2 weeks
2017-03-09 17:35:35 +00:00
Alexander Motin
4f38902fba Report FC link speed.
MFC after:	2 weeks
2017-03-09 17:06:34 +00:00
Hans Petter Selasky
4f688d19fb Cleanup the LinuxKPI mutex wrappers.
Add support for using mutexes during KDB and shutdown. This is also
required for doing mode-switching during panic for drm-next.

Add new mutex functions mutex_init_witness() and mutex_destroy()
allowing LinuxKPI mutexes to be tracked by witness.

Declare mutex_is_locked() and mutex_is_owned() like inline functions
to get cleaner warnings. These functions are used inside WARN_ON()
statements which might look a bit odd if these functions get fully
expanded.

Give mutexes better debug names through the mutex_name() macro when
WITNESS_ALL is defined. The mutex_name() macro can prefix parts of the
filename and line number before the mutex name.

MFC after:		1 week
Sponsored by:		Mellanox Technologies
2017-03-09 17:01:00 +00:00
Dexuan Cui
1ec5ec7351 loader.efi: only include the machine/ header files on x86
The 2 files may not exist on other archs like aarch64 and hence we
can have a build failure there.

Reported by:	lwhsu
MFC after:	2 weeks
Sponsored by:	Microsoft
2017-03-09 15:44:25 +00:00
Konstantin Belousov
15feda9eb0 Fix typo in comment.
Sponsored by:	The FreeBSD Foundation
MFC after:	3 days
2017-03-09 13:41:57 +00:00
Dexuan Cui
047ff56626 loader.efi: only reduce the size of the staging area on Hyper-V
Doing this on physical hosts turns out to be problematic, e.g. see comment
24 and 28 in https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=211746.

To fix the real underlying issue correctly & thoroughly, IMO we need
a relocatable kernel, but that would require a lot of complicated long
term work:  https://reviews.freebsd.org/D9686?id=25414#inline-56969

For now, let's only apply efi_verify_staging_size() to VMs running on
Hyper-V, and restore the old behavior on physical machines since that
has been working for people for a long period of time, though that's
potentially unsafe...

MFC after:	2 weeks
Sponsored by:	Microsoft
2017-03-09 12:09:07 +00:00
Maxim Konovalov
f621c2cd39 o Typo in the comment fixed.
PR:		217617
Submitted by:	lutz
2017-03-09 09:54:23 +00:00
Hans Petter Selasky
c23b6e238f Don't create any threads before SI_SUB_INIT_IF in the LinuxKPI. Else
kthread_add() will assert it is called too soon. This fixes a startup
issue when COMPAT_LINUXKPI is in enabled the kernel configuration
file.

Reported by:		Michael Butler <imb@protected-networks.net>
MFC after:		1 week
Sponsored by:		Mellanox Technologies
2017-03-09 09:17:43 +00:00
Alexander Motin
aacbef6cc1 Fix unused variable when built without INVARIANT_SUPPORT.
MFC after:	2 weeks
2017-03-09 07:55:58 +00:00
Mariusz Zaborski
4cd385d9e9 Try to extract the RFC1048 data from PXE. If we get enough info we can skip
the bootp(). It removes unnecessary DHCP request from pxeloader.

Submitted by:	kczekirda
Sponsored by:	Oktawave
Initiated by:	Matthew Dillon
Reviewed by:	smh, gnn, bapt, oshogbo
MFC after:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D9847
2017-03-09 06:01:24 +00:00
Mariusz Zaborski
ecb76386c8 Some style(9) fixes. No functional changes.
Submitted by:	kczekirda
Sponsored by:	Oktawave
MFC after:	3 weeks
Differential Revision:	https://reviews.freebsd.org/D9395
2017-03-09 05:13:07 +00:00
Eric van Gyzen
38ef0279a4 Validate values read from the RTC before trying BCD decoding
Submitted by:	cem
Reported by:	Michael Gmelin <freebsd@grem.de>
Tested by:	Oleksandr Tymoshenko <gonzo@bluezbox.com>
Sponsored by:	Dell EMC
2017-03-09 02:19:30 +00:00
Oleksandr Tymoshenko
09285d1436 [spigen] Add spigen module
spigen provides userland API to SPI bus. Make it available as a loadable
module so people using official ARM images can enabled it on devices like
BBB or RPi without re-building kernel

MFC after:	1 week
2017-03-09 01:21:28 +00:00
Oleksandr Tymoshenko
50868fa68b [spigen] make spigen device ready to be compiled as a module
- Add flag to indicate that device is opened by userland
- Replace "always fail" detach method with proper detach implementation

MFC after:	1 week
2017-03-09 01:00:27 +00:00