Update to 4.6-rc3
Refresh or drop *many* patches. aufs: Update support patches to aufs4.x-rcN-20160328
This commit is contained in:
parent
95034e0acb
commit
f4701f7d70
|
@ -1,3 +1,12 @@
|
|||
linux (4.6~rc3-1~exp1) UNRELEASED; urgency=medium
|
||||
|
||||
* New upstream release candidate
|
||||
|
||||
[ Ben Hutchings ]
|
||||
* aufs: Update support patches to aufs4.x-rcN-20160328
|
||||
|
||||
-- Ben Hutchings <ben@decadent.org.uk> Thu, 14 Apr 2016 13:44:11 +0100
|
||||
|
||||
linux (4.5.1-1) unstable; urgency=medium
|
||||
|
||||
* New upstream stable update:
|
||||
|
|
|
@ -53,7 +53,7 @@ upstream submission.
|
|||
/* disable MPU */
|
||||
--- a/arch/x86/kernel/cpu/microcode/amd.c
|
||||
+++ b/arch/x86/kernel/cpu/microcode/amd.c
|
||||
@@ -907,10 +907,8 @@ static enum ucode_state request_microcod
|
||||
@@ -900,10 +900,8 @@ static enum ucode_state request_microcod
|
||||
if (c->x86 >= 0x15)
|
||||
snprintf(fw_name, sizeof(fw_name), "amd-ucode/microcode_amd_fam%.2xh.bin", c->x86);
|
||||
|
||||
|
@ -96,7 +96,7 @@ upstream submission.
|
|||
fw_size = firmware->size / sizeof(u32);
|
||||
--- a/drivers/bluetooth/ath3k.c
|
||||
+++ b/drivers/bluetooth/ath3k.c
|
||||
@@ -408,10 +408,8 @@ static int ath3k_load_patch(struct usb_d
|
||||
@@ -416,10 +416,8 @@ static int ath3k_load_patch(struct usb_d
|
||||
le32_to_cpu(fw_version.rom_version));
|
||||
|
||||
ret = request_firmware(&firmware, filename, &udev->dev);
|
||||
|
@ -108,7 +108,7 @@ upstream submission.
|
|||
|
||||
pt_rom_version = get_unaligned_le32(firmware->data +
|
||||
firmware->size - 8);
|
||||
@@ -471,10 +469,8 @@ static int ath3k_load_syscfg(struct usb_
|
||||
@@ -479,10 +477,8 @@ static int ath3k_load_syscfg(struct usb_
|
||||
le32_to_cpu(fw_version.rom_version), clk_value, ".dfu");
|
||||
|
||||
ret = request_firmware(&firmware, filename, &udev->dev);
|
||||
|
@ -233,10 +233,10 @@ upstream submission.
|
|||
where = 0;
|
||||
--- a/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c
|
||||
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/gr/gf100.c
|
||||
@@ -1736,10 +1736,8 @@ gf100_gr_ctor_fw(struct gf100_gr *gr, co
|
||||
@@ -1755,10 +1755,8 @@ gf100_gr_ctor_fw(struct gf100_gr *gr, co
|
||||
int ret;
|
||||
|
||||
snprintf(f, sizeof(f), "nvidia/%s/%s.bin", cname, fwname);
|
||||
ret = request_firmware(&fw, f, device->dev);
|
||||
ret = nvkm_firmware_get(device, fwname, &fw);
|
||||
- if (ret) {
|
||||
- nvkm_error(subdev, "failed to load %s\n", fwname);
|
||||
+ if (ret)
|
||||
|
@ -355,7 +355,7 @@ upstream submission.
|
|||
}
|
||||
--- a/drivers/media/usb/dvb-usb/dib0700_devices.c
|
||||
+++ b/drivers/media/usb/dvb-usb/dib0700_devices.c
|
||||
@@ -2391,12 +2391,9 @@ static int stk9090m_frontend_attach(stru
|
||||
@@ -2410,12 +2410,9 @@ static int stk9090m_frontend_attach(stru
|
||||
|
||||
dib9000_i2c_enumeration(&adap->dev->i2c_adap, 1, 0x10, 0x80);
|
||||
|
||||
|
@ -370,7 +370,7 @@ upstream submission.
|
|||
stk9090m_config.microcode_B_fe_size = state->frontend_firmware->size;
|
||||
stk9090m_config.microcode_B_fe_buffer = state->frontend_firmware->data;
|
||||
|
||||
@@ -2457,12 +2454,9 @@ static int nim9090md_frontend_attach(str
|
||||
@@ -2476,12 +2473,9 @@ static int nim9090md_frontend_attach(str
|
||||
msleep(20);
|
||||
dib0700_set_gpio(adap->dev, GPIO0, GPIO_OUT, 1);
|
||||
|
||||
|
@ -442,7 +442,7 @@ upstream submission.
|
|||
p = kmalloc(fw->size, GFP_KERNEL);
|
||||
--- a/drivers/media/dvb-frontends/af9013.c
|
||||
+++ b/drivers/media/dvb-frontends/af9013.c
|
||||
@@ -1376,16 +1376,8 @@ static int af9013_download_firmware(stru
|
||||
@@ -1380,16 +1380,8 @@ static int af9013_download_firmware(stru
|
||||
|
||||
/* request the firmware, this will block and timeout */
|
||||
ret = request_firmware(&fw, fw_file, state->i2c->dev.parent);
|
||||
|
@ -707,12 +707,12 @@ upstream submission.
|
|||
rc = request_firmware(&fw, fw_filename, coredev->device);
|
||||
- if (rc < 0) {
|
||||
- pr_err("failed to open firmware file '%s'\n", fw_filename);
|
||||
+ if (rc)
|
||||
+ if (rc < 0)
|
||||
return rc;
|
||||
- }
|
||||
pr_debug("read fw %s, buffer size=0x%zx\n", fw_filename, fw->size);
|
||||
fw_buf = kmalloc(ALIGN(fw->size, SMS_ALLOC_ALIGNMENT),
|
||||
GFP_KERNEL | GFP_DMA);
|
||||
fw_buf = kmalloc(ALIGN(fw->size + sizeof(struct sms_firmware),
|
||||
SMS_ALLOC_ALIGNMENT), GFP_KERNEL | GFP_DMA);
|
||||
--- a/drivers/media/pci/ttpci/av7110.c
|
||||
+++ b/drivers/media/pci/ttpci/av7110.c
|
||||
@@ -1531,16 +1531,9 @@ static int get_firmware(struct av7110* a
|
||||
|
@ -1189,7 +1189,7 @@ upstream submission.
|
|||
if (bp->mips_firmware->size < sizeof(*mips_fw) ||
|
||||
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
|
||||
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
|
||||
@@ -13398,11 +13398,8 @@ static int bnx2x_init_firmware(struct bn
|
||||
@@ -13467,11 +13467,8 @@ static int bnx2x_init_firmware(struct bn
|
||||
BNX2X_DEV_INFO("Loading %s\n", fw_file_name);
|
||||
|
||||
rc = request_firmware(&bp->firmware, fw_file_name, &bp->pdev->dev);
|
||||
|
@ -1397,7 +1397,7 @@ upstream submission.
|
|||
fwh = (struct at76_fw_header *)(fwe->fw->data);
|
||||
--- a/drivers/net/wireless/ath/ath9k/hif_usb.c
|
||||
+++ b/drivers/net/wireless/ath/ath9k/hif_usb.c
|
||||
@@ -1158,9 +1158,6 @@ static void ath9k_hif_usb_firmware_cb(co
|
||||
@@ -1160,9 +1160,6 @@ static void ath9k_hif_usb_firmware_cb(co
|
||||
if (!ret)
|
||||
return;
|
||||
|
||||
|
@ -1537,7 +1537,7 @@ upstream submission.
|
|||
else
|
||||
--- a/drivers/net/wireless/intel/iwlwifi/iwl-drv.c
|
||||
+++ b/drivers/net/wireless/intel/iwlwifi/iwl-drv.c
|
||||
@@ -1208,13 +1208,8 @@ static void iwl_req_fw_callback(const st
|
||||
@@ -1219,13 +1219,8 @@ static void iwl_req_fw_callback(const st
|
||||
if (!pieces)
|
||||
return;
|
||||
|
||||
|
@ -1565,7 +1565,7 @@ upstream submission.
|
|||
}
|
||||
--- a/drivers/net/wireless/marvell/mwifiex/main.c
|
||||
+++ b/drivers/net/wireless/marvell/mwifiex/main.c
|
||||
@@ -508,11 +508,8 @@ static void mwifiex_fw_dpc(const struct
|
||||
@@ -515,11 +515,8 @@ static void mwifiex_fw_dpc(const struct
|
||||
bool init_failed = false;
|
||||
struct wireless_dev *wdev;
|
||||
|
||||
|
@ -1580,7 +1580,7 @@ upstream submission.
|
|||
adapter->firmware = firmware;
|
||||
--- a/drivers/net/wireless/marvell/mwl8k.c
|
||||
+++ b/drivers/net/wireless/marvell/mwl8k.c
|
||||
@@ -5712,16 +5712,12 @@ static int mwl8k_firmware_load_success(s
|
||||
@@ -5714,16 +5714,12 @@ static int mwl8k_firmware_load_success(s
|
||||
static void mwl8k_fw_state_machine(const struct firmware *fw, void *context)
|
||||
{
|
||||
struct mwl8k_priv *priv = context;
|
||||
|
@ -1598,7 +1598,7 @@ upstream submission.
|
|||
priv->fw_helper = fw;
|
||||
rc = mwl8k_request_fw(priv, priv->fw_pref, &priv->fw_ucode,
|
||||
true);
|
||||
@@ -5756,11 +5752,8 @@ static void mwl8k_fw_state_machine(const
|
||||
@@ -5758,11 +5754,8 @@ static void mwl8k_fw_state_machine(const
|
||||
break;
|
||||
|
||||
case FW_STATE_LOADING_ALT:
|
||||
|
@ -1611,7 +1611,7 @@ upstream submission.
|
|||
priv->fw_ucode = fw;
|
||||
rc = mwl8k_firmware_load_success(priv);
|
||||
if (rc)
|
||||
@@ -5798,10 +5791,8 @@ retry:
|
||||
@@ -5800,10 +5793,8 @@ retry:
|
||||
|
||||
/* Ask userland hotplug daemon for the device firmware */
|
||||
rc = mwl8k_request_firmware(priv, fw_image, nowait);
|
||||
|
@ -1734,7 +1734,7 @@ upstream submission.
|
|||
rt2x00_err(rt2x00dev, "Failed to read Firmware\n");
|
||||
--- a/drivers/net/wireless/realtek/rtlwifi/core.c
|
||||
+++ b/drivers/net/wireless/realtek/rtlwifi/core.c
|
||||
@@ -115,7 +115,6 @@ static void rtl_fw_do_work(const struct
|
||||
@@ -111,7 +111,6 @@ static void rtl_fw_do_work(const struct
|
||||
if (!err)
|
||||
goto found_alt;
|
||||
}
|
||||
|
@ -1937,7 +1937,7 @@ upstream submission.
|
|||
}
|
||||
--- a/drivers/scsi/qla2xxx/qla_init.c
|
||||
+++ b/drivers/scsi/qla2xxx/qla_init.c
|
||||
@@ -5540,8 +5540,6 @@ qla2x00_load_risc(scsi_qla_host_t *vha,
|
||||
@@ -5637,8 +5637,6 @@ qla2x00_load_risc(scsi_qla_host_t *vha,
|
||||
/* Load firmware blob. */
|
||||
blob = qla2x00_request_firmware(vha);
|
||||
if (!blob) {
|
||||
|
@ -1946,7 +1946,7 @@ upstream submission.
|
|||
ql_log(ql_log_info, vha, 0x0084,
|
||||
"Firmware images can be retrieved from: "QLA_FW_URL ".\n");
|
||||
return QLA_FUNCTION_FAILED;
|
||||
@@ -5643,8 +5641,6 @@ qla24xx_load_risc_blob(scsi_qla_host_t *
|
||||
@@ -5740,8 +5738,6 @@ qla24xx_load_risc_blob(scsi_qla_host_t *
|
||||
/* Load firmware blob. */
|
||||
blob = qla2x00_request_firmware(vha);
|
||||
if (!blob) {
|
||||
|
@ -1972,7 +1972,7 @@ upstream submission.
|
|||
if (qla82xx_validate_firmware_blob(vha,
|
||||
--- a/drivers/scsi/qla2xxx/qla_os.c
|
||||
+++ b/drivers/scsi/qla2xxx/qla_os.c
|
||||
@@ -5529,8 +5529,6 @@ qla2x00_request_firmware(scsi_qla_host_t
|
||||
@@ -5539,8 +5539,6 @@ qla2x00_request_firmware(scsi_qla_host_t
|
||||
goto out;
|
||||
|
||||
if (request_firmware(&blob->fw, blob->name, &ha->pdev->dev)) {
|
||||
|
@ -2093,7 +2093,7 @@ upstream submission.
|
|||
MODULE_FIRMWARE("rtlwifi/rtl8712u.bin");
|
||||
--- a/drivers/staging/slicoss/slicoss.c
|
||||
+++ b/drivers/staging/slicoss/slicoss.c
|
||||
@@ -408,11 +408,8 @@ static int slic_card_download_gbrcv(stru
|
||||
@@ -404,11 +404,8 @@ static int slic_card_download_gbrcv(stru
|
||||
}
|
||||
|
||||
ret = request_firmware(&fw, file, &adapter->pcidev->dev);
|
||||
|
@ -2106,7 +2106,7 @@ upstream submission.
|
|||
|
||||
rcvucodelen = *(u32 *)(fw->data + index);
|
||||
index += 4;
|
||||
@@ -486,11 +483,8 @@ static int slic_card_download(struct ada
|
||||
@@ -482,11 +479,8 @@ static int slic_card_download(struct ada
|
||||
return -ENOENT;
|
||||
}
|
||||
ret = request_firmware(&fw, file, &adapter->pcidev->dev);
|
||||
|
@ -2137,7 +2137,7 @@ upstream submission.
|
|||
if (!buffer)
|
||||
--- a/drivers/tty/cyclades.c
|
||||
+++ b/drivers/tty/cyclades.c
|
||||
@@ -3509,10 +3509,8 @@ static int cyz_load_fw(struct pci_dev *p
|
||||
@@ -3507,10 +3507,8 @@ static int cyz_load_fw(struct pci_dev *p
|
||||
int retval;
|
||||
|
||||
retval = request_firmware(&fw, "cyzfirm.bin", &pdev->dev);
|
||||
|
@ -2208,7 +2208,7 @@ upstream submission.
|
|||
|
||||
--- a/drivers/usb/atm/cxacru.c
|
||||
+++ b/drivers/usb/atm/cxacru.c
|
||||
@@ -1086,8 +1086,6 @@ static int cxacru_find_firmware(struct c
|
||||
@@ -1088,8 +1088,6 @@ static int cxacru_find_firmware(struct c
|
||||
return -ENOENT;
|
||||
}
|
||||
|
||||
|
@ -2402,7 +2402,7 @@ upstream submission.
|
|||
if ((fw_entry->size < 8*1024) || (fw_entry->size > 64*1024)) {
|
||||
--- a/drivers/video/fbdev/metronomefb.c
|
||||
+++ b/drivers/video/fbdev/metronomefb.c
|
||||
@@ -677,10 +677,8 @@ static int metronomefb_probe(struct plat
|
||||
@@ -679,10 +679,8 @@ static int metronomefb_probe(struct plat
|
||||
a) request the waveform file from userspace
|
||||
b) process waveform and decode into metromem */
|
||||
retval = request_firmware(&fw_entry, "metronome.wbf", &dev->dev);
|
||||
|
|
|
@ -23,41 +23,37 @@ format to detect missing firmware.
|
|||
---
|
||||
--- a/drivers/base/firmware_class.c
|
||||
+++ b/drivers/base/firmware_class.c
|
||||
@@ -340,16 +340,19 @@ static int fw_get_filesystem_firmware(st
|
||||
rc = fw_read_file_contents(file, buf);
|
||||
fput(file);
|
||||
if (rc)
|
||||
- dev_warn(device, "firmware, attempted to load %s, but failed with error %d\n",
|
||||
+ dev_dbg(device, "firmware, attempted to load %s, but failed with error %d\n",
|
||||
path, rc);
|
||||
else
|
||||
break;
|
||||
@@ -329,21 +329,22 @@ static int fw_get_filesystem_firmware(st
|
||||
rc = kernel_read_file_from_path(path, &buf->data, &size,
|
||||
INT_MAX, READING_FIRMWARE);
|
||||
if (rc) {
|
||||
- if (rc == -ENOENT)
|
||||
- dev_dbg(device, "loading %s failed with error %d\n",
|
||||
- path, rc);
|
||||
- else
|
||||
- dev_warn(device, "loading %s failed with error %d\n",
|
||||
- path, rc);
|
||||
+ dev_dbg(device, "loading %s failed with error %d\n",
|
||||
+ path, rc);
|
||||
continue;
|
||||
}
|
||||
- dev_dbg(device, "direct-loading %s\n", buf->fw_id);
|
||||
+ dev_info(device, "firmware: direct-loading firmware %s\n",
|
||||
+ buf->fw_id);
|
||||
buf->size = size;
|
||||
fw_finish_direct_load(device, buf);
|
||||
break;
|
||||
}
|
||||
__putname(path);
|
||||
|
||||
- if (!rc) {
|
||||
- dev_dbg(device, "firmware: direct-loading firmware %s\n",
|
||||
- buf->fw_id);
|
||||
+ if (rc) {
|
||||
+ if (rc)
|
||||
+ dev_err(device, "firmware: failed to load %s (%d)\n",
|
||||
+ buf->fw_id, rc);
|
||||
+ } else {
|
||||
+ dev_info(device, "firmware: direct-loading firmware %s\n",
|
||||
+ buf->fw_id);
|
||||
mutex_lock(&fw_lock);
|
||||
set_bit(FW_STATUS_DONE, &buf->status);
|
||||
complete_all(&buf->completion);
|
||||
@@ -1026,7 +1029,8 @@ _request_firmware_prepare(struct firmwar
|
||||
}
|
||||
+
|
||||
return rc;
|
||||
}
|
||||
|
||||
if (fw_get_builtin_firmware(firmware, name)) {
|
||||
- dev_dbg(device, "firmware: using built-in firmware %s\n", name);
|
||||
+ dev_info(device, "firmware: using built-in firmware %s\n",
|
||||
+ name);
|
||||
return 0; /* assigned */
|
||||
}
|
||||
|
||||
@@ -1109,7 +1113,7 @@ _request_firmware(const struct firmware
|
||||
@@ -1114,7 +1115,7 @@ _request_firmware(const struct firmware
|
||||
if (opt_flags & FW_OPT_NOWAIT) {
|
||||
timeout = usermodehelper_read_lock_wait(timeout);
|
||||
if (!timeout) {
|
||||
|
|
|
@ -1,80 +0,0 @@
|
|||
From: Ben Hutchings <ben@decadent.org.uk>
|
||||
Date: Sat, 14 Dec 2013 17:14:39 +0000
|
||||
Subject: firmware_class: Return specific errors from file read
|
||||
Forwarded: no
|
||||
|
||||
Currently several failure cases are not distinguished and are
|
||||
incorrectly reported as -EINVAL or -ENOENT.
|
||||
|
||||
Change fw_file_size() to return an error code on failure and
|
||||
adjust fw_read_file_contents() and fw_get_filesystem_firmware()
|
||||
|
||||
Change _request_firmware() to return the error code from
|
||||
fw_get_filesystem_firmware() if CONFIG_FW_LOADER_USER_HELPER is not
|
||||
enabled. (If it is enabled and also fails, unfortunately we can't
|
||||
tell why.)
|
||||
|
||||
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
---
|
||||
--- a/drivers/base/firmware_class.c
|
||||
+++ b/drivers/base/firmware_class.c
|
||||
@@ -298,7 +298,7 @@ static int fw_read_file_contents(struct
|
||||
int rc;
|
||||
|
||||
if (!S_ISREG(file_inode(file)->i_mode))
|
||||
- return -EINVAL;
|
||||
+ return -ENOTTY;
|
||||
size = i_size_read(file_inode(file));
|
||||
if (size <= 0)
|
||||
return -EINVAL;
|
||||
@@ -307,7 +307,7 @@ static int fw_read_file_contents(struct
|
||||
return -ENOMEM;
|
||||
rc = kernel_read(file, 0, buf, size);
|
||||
if (rc != size) {
|
||||
- if (rc > 0)
|
||||
+ if (rc >= 0)
|
||||
rc = -EIO;
|
||||
goto fail;
|
||||
}
|
||||
@@ -348,8 +348,10 @@ static int fw_get_filesystem_firmware(st
|
||||
}
|
||||
|
||||
file = filp_open(path, O_RDONLY, 0);
|
||||
- if (IS_ERR(file))
|
||||
+ if (IS_ERR(file)) {
|
||||
+ rc = PTR_ERR(file);
|
||||
continue;
|
||||
+ }
|
||||
rc = fw_read_file_contents(file, buf);
|
||||
fput(file);
|
||||
if (rc)
|
||||
@@ -994,13 +996,6 @@ static void kill_requests_without_uevent
|
||||
#endif
|
||||
|
||||
#else /* CONFIG_FW_LOADER_USER_HELPER */
|
||||
-static inline int
|
||||
-fw_load_from_user_helper(struct firmware *firmware, const char *name,
|
||||
- struct device *device, unsigned int opt_flags,
|
||||
- long timeout)
|
||||
-{
|
||||
- return -ENOENT;
|
||||
-}
|
||||
|
||||
/* No abort during direct loading */
|
||||
#define is_fw_load_aborted(buf) false
|
||||
@@ -1152,6 +1147,7 @@ _request_firmware(const struct firmware
|
||||
}
|
||||
|
||||
ret = fw_get_filesystem_firmware(device, fw->priv);
|
||||
+#ifdef CONFIG_FW_LOADER_USER_HELPER
|
||||
if (ret) {
|
||||
if (!(opt_flags & FW_OPT_NO_WARN))
|
||||
dev_warn(device,
|
||||
@@ -1163,6 +1159,7 @@ _request_firmware(const struct firmware
|
||||
opt_flags, timeout);
|
||||
}
|
||||
}
|
||||
+#endif
|
||||
|
||||
if (!ret)
|
||||
ret = assign_firmware_buf(fw, device, opt_flags);
|
|
@ -13,9 +13,9 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
|||
fs/cifs/link.c | 2 ++
|
||||
fs/cifs/smb2transport.c | 2 ++
|
||||
fs/cifs/smbencrypt.c | 2 ++
|
||||
fs/crypto/keyinfo.c | 2 ++
|
||||
fs/ext4/crypto_key.c | 2 ++
|
||||
fs/ext4/super.c | 2 ++
|
||||
fs/f2fs/crypto_key.c | 2 ++
|
||||
fs/f2fs/super.c | 2 ++
|
||||
fs/jbd2/journal.c | 2 ++
|
||||
fs/nfsd/nfs4recover.c | 2 ++
|
||||
|
@ -39,7 +39,7 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
|||
+MODULE_SOFTDEP("pre: crypto-crc32c");
|
||||
--- a/fs/cifs/cifsencrypt.c
|
||||
+++ b/fs/cifs/cifsencrypt.c
|
||||
@@ -865,3 +865,5 @@ cifs_crypto_shash_release(struct TCP_Ser
|
||||
@@ -875,3 +875,5 @@ cifs_crypto_shash_release(struct TCP_Ser
|
||||
kfree(server->secmech.sdescmd5);
|
||||
server->secmech.sdescmd5 = NULL;
|
||||
}
|
||||
|
@ -63,14 +63,14 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
|||
+MODULE_SOFTDEP("pre: crypto-aes crypto-cmac crypto-hmac crypto-sha256");
|
||||
--- a/fs/cifs/smbencrypt.c
|
||||
+++ b/fs/cifs/smbencrypt.c
|
||||
@@ -247,3 +247,5 @@ SMBNTencrypt(unsigned char *passwd, unsi
|
||||
@@ -259,3 +259,5 @@ SMBNTencrypt(unsigned char *passwd, unsi
|
||||
rc = E_P24(p21, c8, p24);
|
||||
return rc;
|
||||
}
|
||||
+
|
||||
+MODULE_SOFTDEP("pre: crypto-des crypto-ecb crypto-md4");
|
||||
--- a/fs/ext4/crypto_key.c
|
||||
+++ b/fs/ext4/crypto_key.c
|
||||
--- a/fs/crypto/keyinfo.c
|
||||
+++ b/fs/crypto/keyinfo.c
|
||||
@@ -10,6 +10,7 @@
|
||||
|
||||
#include <keys/encrypted-type.h>
|
||||
|
@ -79,7 +79,23 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
|||
#include <linux/random.h>
|
||||
#include <linux/scatterlist.h>
|
||||
#include <uapi/linux/keyctl.h>
|
||||
@@ -274,3 +275,5 @@ int ext4_has_encryption_key(struct inode
|
||||
@@ -270,3 +271,5 @@ int fscrypt_get_encryption_info(struct i
|
||||
return 0;
|
||||
}
|
||||
EXPORT_SYMBOL(fscrypt_get_encryption_info);
|
||||
+
|
||||
+MODULE_SOFTDEP("pre: crypto-aes crypto-ecb");
|
||||
--- a/fs/ext4/crypto_key.c
|
||||
+++ b/fs/ext4/crypto_key.c
|
||||
@@ -11,6 +11,7 @@
|
||||
#include <crypto/skcipher.h>
|
||||
#include <keys/encrypted-type.h>
|
||||
#include <keys/user-type.h>
|
||||
+#include <linux/module.h>
|
||||
#include <linux/random.h>
|
||||
#include <linux/scatterlist.h>
|
||||
#include <uapi/linux/keyctl.h>
|
||||
@@ -272,3 +273,5 @@ int ext4_has_encryption_key(struct inode
|
||||
|
||||
return (ei->i_crypt_info != NULL);
|
||||
}
|
||||
|
@ -87,7 +103,7 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
|||
+MODULE_SOFTDEP("pre: crypto-aes crypto-ecb");
|
||||
--- a/fs/ext4/super.c
|
||||
+++ b/fs/ext4/super.c
|
||||
@@ -5404,6 +5404,8 @@ static void __exit ext4_exit_fs(void)
|
||||
@@ -5438,6 +5438,8 @@ static void __exit ext4_exit_fs(void)
|
||||
ext4_exit_es();
|
||||
}
|
||||
|
||||
|
@ -96,25 +112,9 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
|||
MODULE_AUTHOR("Remy Card, Stephen Tweedie, Andrew Morton, Andreas Dilger, Theodore Ts'o and others");
|
||||
MODULE_DESCRIPTION("Fourth Extended Filesystem");
|
||||
MODULE_LICENSE("GPL");
|
||||
--- a/fs/f2fs/crypto_key.c
|
||||
+++ b/fs/f2fs/crypto_key.c
|
||||
@@ -11,6 +11,7 @@
|
||||
*/
|
||||
#include <keys/encrypted-type.h>
|
||||
#include <keys/user-type.h>
|
||||
+#include <linux/module.h>
|
||||
#include <linux/random.h>
|
||||
#include <linux/scatterlist.h>
|
||||
#include <uapi/linux/keyctl.h>
|
||||
@@ -252,3 +253,5 @@ int f2fs_has_encryption_key(struct inode
|
||||
|
||||
return (fi->i_crypt_info != NULL);
|
||||
}
|
||||
+
|
||||
+MODULE_SOFTDEP("pre: crypto-aes crypto-ecb");
|
||||
--- a/fs/f2fs/super.c
|
||||
+++ b/fs/f2fs/super.c
|
||||
@@ -1640,6 +1640,8 @@ static void __exit exit_f2fs_fs(void)
|
||||
@@ -1736,6 +1736,8 @@ static void __exit exit_f2fs_fs(void)
|
||||
f2fs_destroy_trace_ios();
|
||||
}
|
||||
|
||||
|
@ -125,7 +125,7 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
|||
|
||||
--- a/fs/jbd2/journal.c
|
||||
+++ b/fs/jbd2/journal.c
|
||||
@@ -2693,6 +2693,8 @@ static void __exit journal_exit(void)
|
||||
@@ -2715,6 +2715,8 @@ static void __exit journal_exit(void)
|
||||
jbd2_journal_destroy_caches();
|
||||
}
|
||||
|
||||
|
@ -136,7 +136,7 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
|||
module_exit(journal_exit);
|
||||
--- a/fs/nfsd/nfs4recover.c
|
||||
+++ b/fs/nfsd/nfs4recover.c
|
||||
@@ -1553,3 +1553,5 @@ unregister_cld_notifier(void)
|
||||
@@ -1560,3 +1560,5 @@ unregister_cld_notifier(void)
|
||||
{
|
||||
rpc_pipefs_notifier_unregister(&nfsd4_cld_block);
|
||||
}
|
||||
|
|
|
@ -1,94 +0,0 @@
|
|||
From: "David S. Miller" <davem@davemloft.net>
|
||||
Date: Sun, 13 Mar 2016 23:28:00 -0400
|
||||
Subject: ipv4: Don't do expensive useless work during inetdev destroy.
|
||||
Origin: https://git.kernel.org/linus/fbd40ea0180a2d328c5adc61414dc8bab9335ce2
|
||||
|
||||
When an inetdev is destroyed, every address assigned to the interface
|
||||
is removed. And in this scenerio we do two pointless things which can
|
||||
be very expensive if the number of assigned interfaces is large:
|
||||
|
||||
1) Address promotion. We are deleting all addresses, so there is no
|
||||
point in doing this.
|
||||
|
||||
2) A full nf conntrack table purge for every address. We only need to
|
||||
do this once, as is already caught by the existing
|
||||
masq_dev_notifier so masq_inet_event() can skip this.
|
||||
|
||||
Reported-by: Solar Designer <solar@openwall.com>
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
Tested-by: Cyrill Gorcunov <gorcunov@openvz.org>
|
||||
---
|
||||
net/ipv4/devinet.c | 4 ++++
|
||||
net/ipv4/fib_frontend.c | 4 ++++
|
||||
net/ipv4/netfilter/nf_nat_masquerade_ipv4.c | 12 ++++++++++--
|
||||
3 files changed, 18 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
|
||||
index 65e76a48382c..e333bc86bd39 100644
|
||||
--- a/net/ipv4/devinet.c
|
||||
+++ b/net/ipv4/devinet.c
|
||||
@@ -334,6 +334,9 @@ static void __inet_del_ifa(struct in_device *in_dev, struct in_ifaddr **ifap,
|
||||
|
||||
ASSERT_RTNL();
|
||||
|
||||
+ if (in_dev->dead)
|
||||
+ goto no_promotions;
|
||||
+
|
||||
/* 1. Deleting primary ifaddr forces deletion all secondaries
|
||||
* unless alias promotion is set
|
||||
**/
|
||||
@@ -380,6 +383,7 @@ static void __inet_del_ifa(struct in_device *in_dev, struct in_ifaddr **ifap,
|
||||
fib_del_ifaddr(ifa, ifa1);
|
||||
}
|
||||
|
||||
+no_promotions:
|
||||
/* 2. Unlink it */
|
||||
|
||||
*ifap = ifa1->ifa_next;
|
||||
diff --git a/net/ipv4/fib_frontend.c b/net/ipv4/fib_frontend.c
|
||||
index 473447593060..21add552e56a 100644
|
||||
--- a/net/ipv4/fib_frontend.c
|
||||
+++ b/net/ipv4/fib_frontend.c
|
||||
@@ -922,6 +922,9 @@ void fib_del_ifaddr(struct in_ifaddr *ifa, struct in_ifaddr *iprim)
|
||||
subnet = 1;
|
||||
}
|
||||
|
||||
+ if (in_dev->dead)
|
||||
+ goto no_promotions;
|
||||
+
|
||||
/* Deletion is more complicated than add.
|
||||
* We should take care of not to delete too much :-)
|
||||
*
|
||||
@@ -997,6 +1000,7 @@ void fib_del_ifaddr(struct in_ifaddr *ifa, struct in_ifaddr *iprim)
|
||||
}
|
||||
}
|
||||
|
||||
+no_promotions:
|
||||
if (!(ok & BRD_OK))
|
||||
fib_magic(RTM_DELROUTE, RTN_BROADCAST, ifa->ifa_broadcast, 32, prim);
|
||||
if (subnet && ifa->ifa_prefixlen < 31) {
|
||||
diff --git a/net/ipv4/netfilter/nf_nat_masquerade_ipv4.c b/net/ipv4/netfilter/nf_nat_masquerade_ipv4.c
|
||||
index c6eb42100e9a..ea91058b5f6f 100644
|
||||
--- a/net/ipv4/netfilter/nf_nat_masquerade_ipv4.c
|
||||
+++ b/net/ipv4/netfilter/nf_nat_masquerade_ipv4.c
|
||||
@@ -108,10 +108,18 @@ static int masq_inet_event(struct notifier_block *this,
|
||||
unsigned long event,
|
||||
void *ptr)
|
||||
{
|
||||
- struct net_device *dev = ((struct in_ifaddr *)ptr)->ifa_dev->dev;
|
||||
+ struct in_device *idev = ((struct in_ifaddr *)ptr)->ifa_dev;
|
||||
struct netdev_notifier_info info;
|
||||
|
||||
- netdev_notifier_info_init(&info, dev);
|
||||
+ /* The masq_dev_notifier will catch the case of the device going
|
||||
+ * down. So if the inetdev is dead and being destroyed we have
|
||||
+ * no work to do. Otherwise this is an individual address removal
|
||||
+ * and we have to perform the flush.
|
||||
+ */
|
||||
+ if (idev->dead)
|
||||
+ return NOTIFY_DONE;
|
||||
+
|
||||
+ netdev_notifier_info_init(&info, idev->dev);
|
||||
return masq_device_event(this, event, &info);
|
||||
}
|
||||
|
|
@ -8,7 +8,7 @@ sources.
|
|||
|
||||
--- a/scripts/Makefile.build
|
||||
+++ b/scripts/Makefile.build
|
||||
@@ -240,6 +240,11 @@ cmd_record_mcount = \
|
||||
@@ -241,6 +241,11 @@ cmd_record_mcount = \
|
||||
fi;
|
||||
endif
|
||||
|
||||
|
@ -17,6 +17,6 @@ sources.
|
|||
+recordmcount_source :=
|
||||
+endif
|
||||
+
|
||||
define rule_cc_o_c
|
||||
$(call echo-cmd,checksrc) $(cmd_checksrc) \
|
||||
$(call echo-cmd,cc_o_c) $(cmd_cc_o_c); \
|
||||
ifdef CONFIG_STACK_VALIDATION
|
||||
ifneq ($(SKIP_STACK_VALIDATION),1)
|
||||
|
||||
|
|
|
@ -17,18 +17,8 @@ doesn't have substitutes for.
|
|||
#define container_of(ptr, type, member) ({ \
|
||||
--- a/tools/lib/lockdep/uinclude/linux/list.h
|
||||
+++ b/tools/lib/lockdep/uinclude/linux/list.h
|
||||
@@ -1 +1,4 @@
|
||||
@@ -1,1 +1,4 @@
|
||||
#include "../../../include/linux/list.h"
|
||||
+#define hlist_add_head_rcu hlist_add_head
|
||||
+#define hlist_del_rcu hlist_del
|
||||
+#define hlist_for_each_entry_rcu hlist_for_each_entry
|
||||
--- a/tools/lib/lockdep/uinclude/linux/compiler.h
|
||||
+++ b/tools/lib/lockdep/uinclude/linux/compiler.h
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
#define __used __attribute__((__unused__))
|
||||
#define unlikely
|
||||
+#define READ_ONCE(x) (x)
|
||||
#define WRITE_ONCE(x, val) x=(val)
|
||||
#define RCU_INIT_POINTER(p, v) p=(v)
|
||||
|
||||
|
|
|
@ -10,8 +10,8 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
|||
|
||||
do_compile_shared_library = \
|
||||
($(print_shared_lib_compile) \
|
||||
- $(CC) --shared $^ -o $@ -lpthread -ldl -Wl,-soname='"$@"';$(shell ln -s $@ liblockdep.so))
|
||||
+ $(CC) --shared $^ -o $@ -lpthread -ldl -Wl,-soname='"$(@F)"';$(shell ln -s $(@F) $(@D)/liblockdep.so))
|
||||
- $(CC) --shared $^ -o $@ -lpthread -ldl -Wl,-soname='"$@"';$(shell ln -sf $@ liblockdep.so))
|
||||
+ $(CC) --shared $^ -o $@ -lpthread -ldl -Wl,-soname='"$(@F)"';$(shell ln -sf $(@F) $(@D)/liblockdep.so))
|
||||
|
||||
do_build_static_lib = \
|
||||
($(print_static_lib_build) \
|
||||
|
|
|
@ -6,12 +6,12 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
|||
---
|
||||
--- a/tools/lib/lockdep/Makefile
|
||||
+++ b/tools/lib/lockdep/Makefile
|
||||
@@ -98,7 +98,7 @@ build := -f $(srctree)/tools/build/Makef
|
||||
@@ -100,7 +100,7 @@ include $(srctree)/tools/build/Makefile.
|
||||
|
||||
do_compile_shared_library = \
|
||||
($(print_shared_lib_compile) \
|
||||
- $(CC) --shared $^ -o $@ -lpthread -ldl -Wl,-soname='"$(@F)"';$(shell ln -s $(@F) $(@D)/liblockdep.so))
|
||||
+ $(CC) --shared $^ -o $@ -lpthread -ldl -Wl,-soname='$(@F)';$(shell ln -s $(@F) $(@D)/liblockdep.so))
|
||||
- $(CC) --shared $^ -o $@ -lpthread -ldl -Wl,-soname='"$(@F)"';$(shell ln -sf $(@F) $(@D)/liblockdep.so))
|
||||
+ $(CC) --shared $^ -o $@ -lpthread -ldl -Wl,-soname='$(@F)';$(shell ln -sf $(@F) $(@D)/liblockdep.so))
|
||||
|
||||
do_build_static_lib = \
|
||||
($(print_static_lib_build) \
|
||||
|
|
|
@ -1,29 +0,0 @@
|
|||
From: Ben Hutchings <ben@decadent.org.uk>
|
||||
Date: Mon, 24 Jun 2013 05:28:00 +0100
|
||||
Subject: misc/bmp085: Enable building as a module
|
||||
Forwarded: http://thread.gmane.org/gmane.linux.kernel/1514281
|
||||
|
||||
Commit 985087dbcb02 'misc: add support for bmp18x chips to the bmp085
|
||||
driver' changed the BMP085 config symbol to a boolean. I see no
|
||||
reason why the shared code cannot be built as a module, so change it
|
||||
back to tristate.
|
||||
|
||||
Cc: Eric Andersson <eric.andersson@unixphere.com>
|
||||
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
---
|
||||
drivers/misc/Kconfig | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
|
||||
index c002d86..7a68184 100644
|
||||
--- a/drivers/misc/Kconfig
|
||||
+++ b/drivers/misc/Kconfig
|
||||
@@ -451,7 +451,7 @@ config ARM_CHARLCD
|
||||
still useful.
|
||||
|
||||
config BMP085
|
||||
- bool
|
||||
+ tristate
|
||||
depends on SYSFS
|
||||
|
||||
config BMP085_I2C
|
|
@ -1,36 +0,0 @@
|
|||
From: Dan Williams <dan.j.williams@intel.com>
|
||||
Date: Wed, 16 Mar 2016 14:16:28 +1100
|
||||
Subject: mm: ZONE_DEVICE depends on SPARSEMEM_VMEMMAP
|
||||
Origin: http://article.gmane.org/gmane.linux.kernel.mm/147702
|
||||
|
||||
The primary use case for devm_memremap_pages() is to allocate an memmap
|
||||
array from persistent memory. That capabilty requires vmem_altmap which
|
||||
requires SPARSEMEM_VMEMMAP.
|
||||
|
||||
Also, without SPARSEMEM_VMEMMAP the addition of ZONE_DEVICE expands
|
||||
ZONES_WIDTH and triggers the:
|
||||
|
||||
"Unfortunate NUMA and NUMA Balancing config, growing page-frame for
|
||||
last_cpupid."
|
||||
|
||||
...warning in mm/memory.c. SPARSEMEM_VMEMMAP=n && ZONE_DEVICE=y is not
|
||||
a configuration we should worry about supporting.
|
||||
|
||||
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
|
||||
Reported-by: Vlastimil Babka <vbabka@suse.cz>
|
||||
Acked-by: Vlastimil Babka <vbabka@suse.cz>
|
||||
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
|
||||
---
|
||||
mm/Kconfig | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
--- a/mm/Kconfig
|
||||
+++ b/mm/Kconfig
|
||||
@@ -656,6 +656,7 @@ config ZONE_DEVICE
|
||||
depends on !ZONE_DMA
|
||||
depends on MEMORY_HOTPLUG
|
||||
depends on MEMORY_HOTREMOVE
|
||||
+ depends on SPARSEMEM_VMEMMAP
|
||||
depends on X86_64 #arch_add_memory() comprehends device memory
|
||||
|
||||
help
|
|
@ -1,29 +0,0 @@
|
|||
From: Florian Westphal <fw@strlen.de>
|
||||
Date: Thu, 10 Mar 2016 01:56:23 +0100
|
||||
Subject: netfilter: x_tables: check for size overflow
|
||||
Origin: https://git.kernel.org/cgit/linux/kernel/git/pablo/nf-next.git/commit?id=d157bd761585605b7882935ffb86286919f62ea1
|
||||
|
||||
Ben Hawkes says:
|
||||
integer overflow in xt_alloc_table_info, which on 32-bit systems can
|
||||
lead to small structure allocation and a copy_from_user based heap
|
||||
corruption.
|
||||
|
||||
Reported-by: Ben Hawkes <hawkes@google.com>
|
||||
Signed-off-by: Florian Westphal <fw@strlen.de>
|
||||
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
||||
---
|
||||
net/netfilter/x_tables.c | 3 +++
|
||||
1 file changed, 3 insertions(+)
|
||||
|
||||
--- a/net/netfilter/x_tables.c
|
||||
+++ b/net/netfilter/x_tables.c
|
||||
@@ -658,6 +658,9 @@ struct xt_table_info *xt_alloc_table_inf
|
||||
struct xt_table_info *info = NULL;
|
||||
size_t sz = sizeof(*info) + size;
|
||||
|
||||
+ if (sz < sizeof(*info))
|
||||
+ return NULL;
|
||||
+
|
||||
/* Pedantry: prevent them from hitting BUG() in vmalloc.c --RR */
|
||||
if ((SMP_ALIGN(size) >> PAGE_SHIFT) + 2 > totalram_pages)
|
||||
return NULL;
|
|
@ -1,88 +0,0 @@
|
|||
From: Florian Westphal <fw@strlen.de>
|
||||
Date: Tue, 22 Mar 2016 18:02:50 +0100
|
||||
Subject: [2/2] netfilter: x_tables: make sure e->next_offset covers remaining
|
||||
blob size
|
||||
Origin: https://git.kernel.org/linus/6e94e0cfb0887e4013b3b930fa6ab1fe6bb6ba91
|
||||
|
||||
Otherwise this function may read data beyond the ruleset blob.
|
||||
|
||||
Signed-off-by: Florian Westphal <fw@strlen.de>
|
||||
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
||||
---
|
||||
net/ipv4/netfilter/arp_tables.c | 6 ++++--
|
||||
net/ipv4/netfilter/ip_tables.c | 6 ++++--
|
||||
net/ipv6/netfilter/ip6_tables.c | 6 ++++--
|
||||
3 files changed, 12 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/net/ipv4/netfilter/arp_tables.c b/net/ipv4/netfilter/arp_tables.c
|
||||
index 830bbe8ec13d..51d4fe56b807 100644
|
||||
--- a/net/ipv4/netfilter/arp_tables.c
|
||||
+++ b/net/ipv4/netfilter/arp_tables.c
|
||||
@@ -573,7 +573,8 @@ static inline int check_entry_size_and_hooks(struct arpt_entry *e,
|
||||
int err;
|
||||
|
||||
if ((unsigned long)e % __alignof__(struct arpt_entry) != 0 ||
|
||||
- (unsigned char *)e + sizeof(struct arpt_entry) >= limit) {
|
||||
+ (unsigned char *)e + sizeof(struct arpt_entry) >= limit ||
|
||||
+ (unsigned char *)e + e->next_offset > limit) {
|
||||
duprintf("Bad offset %p\n", e);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -1232,7 +1233,8 @@ check_compat_entry_size_and_hooks(struct compat_arpt_entry *e,
|
||||
|
||||
duprintf("check_compat_entry_size_and_hooks %p\n", e);
|
||||
if ((unsigned long)e % __alignof__(struct compat_arpt_entry) != 0 ||
|
||||
- (unsigned char *)e + sizeof(struct compat_arpt_entry) >= limit) {
|
||||
+ (unsigned char *)e + sizeof(struct compat_arpt_entry) >= limit ||
|
||||
+ (unsigned char *)e + e->next_offset > limit) {
|
||||
duprintf("Bad offset %p, limit = %p\n", e, limit);
|
||||
return -EINVAL;
|
||||
}
|
||||
diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c
|
||||
index 1d72a3c4a7e7..fb7694e6663e 100644
|
||||
--- a/net/ipv4/netfilter/ip_tables.c
|
||||
+++ b/net/ipv4/netfilter/ip_tables.c
|
||||
@@ -738,7 +738,8 @@ check_entry_size_and_hooks(struct ipt_entry *e,
|
||||
int err;
|
||||
|
||||
if ((unsigned long)e % __alignof__(struct ipt_entry) != 0 ||
|
||||
- (unsigned char *)e + sizeof(struct ipt_entry) >= limit) {
|
||||
+ (unsigned char *)e + sizeof(struct ipt_entry) >= limit ||
|
||||
+ (unsigned char *)e + e->next_offset > limit) {
|
||||
duprintf("Bad offset %p\n", e);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -1492,7 +1493,8 @@ check_compat_entry_size_and_hooks(struct compat_ipt_entry *e,
|
||||
|
||||
duprintf("check_compat_entry_size_and_hooks %p\n", e);
|
||||
if ((unsigned long)e % __alignof__(struct compat_ipt_entry) != 0 ||
|
||||
- (unsigned char *)e + sizeof(struct compat_ipt_entry) >= limit) {
|
||||
+ (unsigned char *)e + sizeof(struct compat_ipt_entry) >= limit ||
|
||||
+ (unsigned char *)e + e->next_offset > limit) {
|
||||
duprintf("Bad offset %p, limit = %p\n", e, limit);
|
||||
return -EINVAL;
|
||||
}
|
||||
diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c
|
||||
index 26a5ad1cc4fd..b248528f2a17 100644
|
||||
--- a/net/ipv6/netfilter/ip6_tables.c
|
||||
+++ b/net/ipv6/netfilter/ip6_tables.c
|
||||
@@ -750,7 +750,8 @@ check_entry_size_and_hooks(struct ip6t_entry *e,
|
||||
int err;
|
||||
|
||||
if ((unsigned long)e % __alignof__(struct ip6t_entry) != 0 ||
|
||||
- (unsigned char *)e + sizeof(struct ip6t_entry) >= limit) {
|
||||
+ (unsigned char *)e + sizeof(struct ip6t_entry) >= limit ||
|
||||
+ (unsigned char *)e + e->next_offset > limit) {
|
||||
duprintf("Bad offset %p\n", e);
|
||||
return -EINVAL;
|
||||
}
|
||||
@@ -1504,7 +1505,8 @@ check_compat_entry_size_and_hooks(struct compat_ip6t_entry *e,
|
||||
|
||||
duprintf("check_compat_entry_size_and_hooks %p\n", e);
|
||||
if ((unsigned long)e % __alignof__(struct compat_ip6t_entry) != 0 ||
|
||||
- (unsigned char *)e + sizeof(struct compat_ip6t_entry) >= limit) {
|
||||
+ (unsigned char *)e + sizeof(struct compat_ip6t_entry) >= limit ||
|
||||
+ (unsigned char *)e + e->next_offset > limit) {
|
||||
duprintf("Bad offset %p, limit = %p\n", e, limit);
|
||||
return -EINVAL;
|
||||
}
|
|
@ -1,197 +0,0 @@
|
|||
From: Florian Westphal <fw@strlen.de>
|
||||
Date: Tue, 22 Mar 2016 18:02:49 +0100
|
||||
Subject: [1/2] netfilter: x_tables: validate e->target_offset early
|
||||
Origin: https://git.kernel.org/linus/bdf533de6968e9686df777dc178486f600c6e617
|
||||
|
||||
We should check that e->target_offset is sane before
|
||||
mark_source_chains gets called since it will fetch the target entry
|
||||
for loop detection.
|
||||
|
||||
Signed-off-by: Florian Westphal <fw@strlen.de>
|
||||
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
|
||||
---
|
||||
net/ipv4/netfilter/arp_tables.c | 17 ++++++++---------
|
||||
net/ipv4/netfilter/ip_tables.c | 17 ++++++++---------
|
||||
net/ipv6/netfilter/ip6_tables.c | 17 ++++++++---------
|
||||
3 files changed, 24 insertions(+), 27 deletions(-)
|
||||
|
||||
diff --git a/net/ipv4/netfilter/arp_tables.c b/net/ipv4/netfilter/arp_tables.c
|
||||
index bf081927e06b..830bbe8ec13d 100644
|
||||
--- a/net/ipv4/netfilter/arp_tables.c
|
||||
+++ b/net/ipv4/netfilter/arp_tables.c
|
||||
@@ -474,14 +474,12 @@ next:
|
||||
return 1;
|
||||
}
|
||||
|
||||
-static inline int check_entry(const struct arpt_entry *e, const char *name)
|
||||
+static inline int check_entry(const struct arpt_entry *e)
|
||||
{
|
||||
const struct xt_entry_target *t;
|
||||
|
||||
- if (!arp_checkentry(&e->arp)) {
|
||||
- duprintf("arp_tables: arp check failed %p %s.\n", e, name);
|
||||
+ if (!arp_checkentry(&e->arp))
|
||||
return -EINVAL;
|
||||
- }
|
||||
|
||||
if (e->target_offset + sizeof(struct xt_entry_target) > e->next_offset)
|
||||
return -EINVAL;
|
||||
@@ -522,10 +520,6 @@ find_check_entry(struct arpt_entry *e, const char *name, unsigned int size)
|
||||
struct xt_target *target;
|
||||
int ret;
|
||||
|
||||
- ret = check_entry(e, name);
|
||||
- if (ret)
|
||||
- return ret;
|
||||
-
|
||||
e->counters.pcnt = xt_percpu_counter_alloc();
|
||||
if (IS_ERR_VALUE(e->counters.pcnt))
|
||||
return -ENOMEM;
|
||||
@@ -576,6 +570,7 @@ static inline int check_entry_size_and_hooks(struct arpt_entry *e,
|
||||
unsigned int valid_hooks)
|
||||
{
|
||||
unsigned int h;
|
||||
+ int err;
|
||||
|
||||
if ((unsigned long)e % __alignof__(struct arpt_entry) != 0 ||
|
||||
(unsigned char *)e + sizeof(struct arpt_entry) >= limit) {
|
||||
@@ -590,6 +585,10 @@ static inline int check_entry_size_and_hooks(struct arpt_entry *e,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
+ err = check_entry(e);
|
||||
+ if (err)
|
||||
+ return err;
|
||||
+
|
||||
/* Check hooks & underflows */
|
||||
for (h = 0; h < NF_ARP_NUMHOOKS; h++) {
|
||||
if (!(valid_hooks & (1 << h)))
|
||||
@@ -1246,7 +1245,7 @@ check_compat_entry_size_and_hooks(struct compat_arpt_entry *e,
|
||||
}
|
||||
|
||||
/* For purposes of check_entry casting the compat entry is fine */
|
||||
- ret = check_entry((struct arpt_entry *)e, name);
|
||||
+ ret = check_entry((struct arpt_entry *)e);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
diff --git a/net/ipv4/netfilter/ip_tables.c b/net/ipv4/netfilter/ip_tables.c
|
||||
index e53f8d6f326d..1d72a3c4a7e7 100644
|
||||
--- a/net/ipv4/netfilter/ip_tables.c
|
||||
+++ b/net/ipv4/netfilter/ip_tables.c
|
||||
@@ -569,14 +569,12 @@ static void cleanup_match(struct xt_entry_match *m, struct net *net)
|
||||
}
|
||||
|
||||
static int
|
||||
-check_entry(const struct ipt_entry *e, const char *name)
|
||||
+check_entry(const struct ipt_entry *e)
|
||||
{
|
||||
const struct xt_entry_target *t;
|
||||
|
||||
- if (!ip_checkentry(&e->ip)) {
|
||||
- duprintf("ip check failed %p %s.\n", e, name);
|
||||
+ if (!ip_checkentry(&e->ip))
|
||||
return -EINVAL;
|
||||
- }
|
||||
|
||||
if (e->target_offset + sizeof(struct xt_entry_target) >
|
||||
e->next_offset)
|
||||
@@ -666,10 +664,6 @@ find_check_entry(struct ipt_entry *e, struct net *net, const char *name,
|
||||
struct xt_mtchk_param mtpar;
|
||||
struct xt_entry_match *ematch;
|
||||
|
||||
- ret = check_entry(e, name);
|
||||
- if (ret)
|
||||
- return ret;
|
||||
-
|
||||
e->counters.pcnt = xt_percpu_counter_alloc();
|
||||
if (IS_ERR_VALUE(e->counters.pcnt))
|
||||
return -ENOMEM;
|
||||
@@ -741,6 +735,7 @@ check_entry_size_and_hooks(struct ipt_entry *e,
|
||||
unsigned int valid_hooks)
|
||||
{
|
||||
unsigned int h;
|
||||
+ int err;
|
||||
|
||||
if ((unsigned long)e % __alignof__(struct ipt_entry) != 0 ||
|
||||
(unsigned char *)e + sizeof(struct ipt_entry) >= limit) {
|
||||
@@ -755,6 +750,10 @@ check_entry_size_and_hooks(struct ipt_entry *e,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
+ err = check_entry(e);
|
||||
+ if (err)
|
||||
+ return err;
|
||||
+
|
||||
/* Check hooks & underflows */
|
||||
for (h = 0; h < NF_INET_NUMHOOKS; h++) {
|
||||
if (!(valid_hooks & (1 << h)))
|
||||
@@ -1506,7 +1505,7 @@ check_compat_entry_size_and_hooks(struct compat_ipt_entry *e,
|
||||
}
|
||||
|
||||
/* For purposes of check_entry casting the compat entry is fine */
|
||||
- ret = check_entry((struct ipt_entry *)e, name);
|
||||
+ ret = check_entry((struct ipt_entry *)e);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
diff --git a/net/ipv6/netfilter/ip6_tables.c b/net/ipv6/netfilter/ip6_tables.c
|
||||
index 84f9baf7aee8..26a5ad1cc4fd 100644
|
||||
--- a/net/ipv6/netfilter/ip6_tables.c
|
||||
+++ b/net/ipv6/netfilter/ip6_tables.c
|
||||
@@ -581,14 +581,12 @@ static void cleanup_match(struct xt_entry_match *m, struct net *net)
|
||||
}
|
||||
|
||||
static int
|
||||
-check_entry(const struct ip6t_entry *e, const char *name)
|
||||
+check_entry(const struct ip6t_entry *e)
|
||||
{
|
||||
const struct xt_entry_target *t;
|
||||
|
||||
- if (!ip6_checkentry(&e->ipv6)) {
|
||||
- duprintf("ip_tables: ip check failed %p %s.\n", e, name);
|
||||
+ if (!ip6_checkentry(&e->ipv6))
|
||||
return -EINVAL;
|
||||
- }
|
||||
|
||||
if (e->target_offset + sizeof(struct xt_entry_target) >
|
||||
e->next_offset)
|
||||
@@ -679,10 +677,6 @@ find_check_entry(struct ip6t_entry *e, struct net *net, const char *name,
|
||||
struct xt_mtchk_param mtpar;
|
||||
struct xt_entry_match *ematch;
|
||||
|
||||
- ret = check_entry(e, name);
|
||||
- if (ret)
|
||||
- return ret;
|
||||
-
|
||||
e->counters.pcnt = xt_percpu_counter_alloc();
|
||||
if (IS_ERR_VALUE(e->counters.pcnt))
|
||||
return -ENOMEM;
|
||||
@@ -753,6 +747,7 @@ check_entry_size_and_hooks(struct ip6t_entry *e,
|
||||
unsigned int valid_hooks)
|
||||
{
|
||||
unsigned int h;
|
||||
+ int err;
|
||||
|
||||
if ((unsigned long)e % __alignof__(struct ip6t_entry) != 0 ||
|
||||
(unsigned char *)e + sizeof(struct ip6t_entry) >= limit) {
|
||||
@@ -767,6 +762,10 @@ check_entry_size_and_hooks(struct ip6t_entry *e,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
+ err = check_entry(e);
|
||||
+ if (err)
|
||||
+ return err;
|
||||
+
|
||||
/* Check hooks & underflows */
|
||||
for (h = 0; h < NF_INET_NUMHOOKS; h++) {
|
||||
if (!(valid_hooks & (1 << h)))
|
||||
@@ -1518,7 +1517,7 @@ check_compat_entry_size_and_hooks(struct compat_ip6t_entry *e,
|
||||
}
|
||||
|
||||
/* For purposes of check_entry casting the compat entry is fine */
|
||||
- ret = check_entry((struct ip6t_entry *)e, name);
|
||||
+ ret = check_entry((struct ip6t_entry *)e);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
|
@ -1,26 +0,0 @@
|
|||
From: Markus Trippelsdorf <markus@trippelsdorf.de>
|
||||
Subject: Fix misleadingly indented assignment (whitespace)
|
||||
Date: Mon, 14 Dec 2015 16:44:40 +0100
|
||||
Origin: http://article.gmane.org/gmane.linux.kernel/2108042
|
||||
|
||||
Fix misleadingly indented assignment.
|
||||
This is just a simple whitespace fix.
|
||||
|
||||
The issue was pointed out by gcc-6's -Wmisleading-indentation.
|
||||
|
||||
Acked-by: Ingo Molnar <mingo@kernel.org>
|
||||
Signed-off-by: Markus Trippelsdorf <markus@trippelsdorf.de>
|
||||
---
|
||||
diff --git a/tools/perf/util/pmu.c b/tools/perf/util/pmu.c
|
||||
index e4b173dec4b9..c900b664ab8f 100644
|
||||
--- a/tools/perf/util/pmu.c
|
||||
+++ b/tools/perf/util/pmu.c
|
||||
@@ -153,7 +153,7 @@ static int perf_pmu__parse_unit(struct perf_pmu_alias *alias, char *dir, char *n
|
||||
if (fd == -1)
|
||||
return -1;
|
||||
|
||||
- sret = read(fd, alias->unit, UNIT_MAX_LEN);
|
||||
+ sret = read(fd, alias->unit, UNIT_MAX_LEN);
|
||||
if (sret < 0)
|
||||
goto error;
|
||||
|
|
@ -26,7 +26,7 @@ missing, except for the pre-R600 case.
|
|||
---
|
||||
--- a/drivers/gpu/drm/radeon/radeon_drv.c
|
||||
+++ b/drivers/gpu/drm/radeon/radeon_drv.c
|
||||
@@ -42,6 +42,8 @@
|
||||
@@ -44,6 +44,8 @@
|
||||
|
||||
#include "drm_crtc_helper.h"
|
||||
#include "radeon_kfd.h"
|
||||
|
@ -35,7 +35,7 @@ missing, except for the pre-R600 case.
|
|||
|
||||
/*
|
||||
* KMS wrapper.
|
||||
@@ -293,6 +295,29 @@ MODULE_DEVICE_TABLE(pci, pciidlist);
|
||||
@@ -295,6 +297,29 @@ MODULE_DEVICE_TABLE(pci, pciidlist);
|
||||
|
||||
static struct drm_driver kms_driver;
|
||||
|
||||
|
@ -65,9 +65,9 @@ missing, except for the pre-R600 case.
|
|||
static int radeon_kick_out_firmware_fb(struct pci_dev *pdev)
|
||||
{
|
||||
struct apertures_struct *ap;
|
||||
@@ -319,6 +344,12 @@ static int radeon_pci_probe(struct pci_d
|
||||
{
|
||||
int ret;
|
||||
@@ -338,6 +363,12 @@ static int radeon_pci_probe(struct pci_d
|
||||
!vga_switcheroo_handler_flags())
|
||||
return -EPROBE_DEFER;
|
||||
|
||||
+ if ((ent->driver_data & RADEON_FAMILY_MASK) >= CHIP_R600 &&
|
||||
+ !radeon_firmware_installed()) {
|
||||
|
|
|
@ -17,7 +17,7 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
|||
---
|
||||
--- a/scripts/sign-file.c
|
||||
+++ b/scripts/sign-file.c
|
||||
@@ -229,10 +229,14 @@ int main(int argc, char **argv)
|
||||
@@ -174,7 +174,13 @@ static X509 *read_x509(const char *x509_
|
||||
ERR(!b, "%s", x509_name);
|
||||
x509 = d2i_X509_bio(b, NULL); /* Binary encoded X.509 */
|
||||
if (!x509) {
|
||||
|
@ -29,9 +29,6 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
|||
+ */
|
||||
+ drain_openssl_errors();
|
||||
+ ERR(BIO_reset(b) != 0, "%s", x509_name);
|
||||
x509 = PEM_read_bio_X509(b, NULL, NULL, NULL); /* PEM encoded X.509 */
|
||||
- if (x509)
|
||||
- drain_openssl_errors();
|
||||
}
|
||||
BIO_free(b);
|
||||
ERR(!x509, "%s", x509_name);
|
||||
x509 = PEM_read_bio_X509(b, NULL, NULL,
|
||||
NULL); /* PEM encoded X.509 */
|
||||
if (x509)
|
||||
|
|
|
@ -6,12 +6,12 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
|||
---
|
||||
--- a/tools/lib/lockdep/Makefile
|
||||
+++ b/tools/lib/lockdep/Makefile
|
||||
@@ -98,7 +98,7 @@ build := -f $(srctree)/tools/build/Makef
|
||||
@@ -100,7 +100,7 @@ include $(srctree)/tools/build/Makefile.
|
||||
|
||||
do_compile_shared_library = \
|
||||
($(print_shared_lib_compile) \
|
||||
- $(CC) --shared $^ -o $@ -lpthread -ldl -Wl,-soname='$(@F)';$(shell ln -s $(@F) $(@D)/liblockdep.so))
|
||||
+ $(CC) $(LDFLAGS) --shared $^ -o $@ -lpthread -ldl -Wl,-soname='$(@F)';$(shell ln -s $(@F) $(@D)/liblockdep.so))
|
||||
- $(CC) --shared $^ -o $@ -lpthread -ldl -Wl,-soname='$(@F)';$(shell ln -sf $(@F) $(@D)/liblockdep.so))
|
||||
+ $(CC) $(LDFLAGS) --shared $^ -o $@ -lpthread -ldl -Wl,-soname='$(@F)';$(shell ln -sf $(@F) $(@D)/liblockdep.so))
|
||||
|
||||
do_build_static_lib = \
|
||||
($(print_static_lib_build) \
|
||||
|
|
|
@ -1,166 +0,0 @@
|
|||
From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
|
||||
Date: Wed, 23 Mar 2016 21:07:39 -0700
|
||||
Subject: ACPI / processor: Request native thermal interrupt handling via _OSC
|
||||
Origin: https://git.kernel.org/linus/a21211672c9a1d730a39aa65d4a5b3414700adfb
|
||||
Bug-Debian: https://bugs.debian.org/817016
|
||||
|
||||
There are several reports of freeze on enabling HWP (Hardware PStates)
|
||||
feature on Skylake-based systems by the Intel P-states driver. The root
|
||||
cause is identified as the HWP interrupts causing BIOS code to freeze.
|
||||
|
||||
HWP interrupts use the thermal LVT which can be handled by Linux
|
||||
natively, but on the affected Skylake-based systems SMM will respond
|
||||
to it by default. This is a problem for several reasons:
|
||||
- On the affected systems the SMM thermal LVT handler is broken (it
|
||||
will crash when invoked) and a BIOS update is necessary to fix it.
|
||||
- With thermal interrupt handled in SMM we lose all of the reporting
|
||||
features of the arch/x86/kernel/cpu/mcheck/therm_throt driver.
|
||||
- Some thermal drivers like x86-package-temp depend on the thermal
|
||||
threshold interrupts signaled via the thermal LVT.
|
||||
- The HWP interrupts are useful for debugging and tuning
|
||||
performance (if the kernel can handle them).
|
||||
The native handling of thermal interrupts needs to be enabled
|
||||
because of that.
|
||||
|
||||
This requires some way to tell SMM that the OS can handle thermal
|
||||
interrupts. That can be done by using _OSC/_PDC in processor
|
||||
scope very early during ACPI initialization.
|
||||
|
||||
The meaning of _OSC/_PDC bit 12 in processor scope is whether or
|
||||
not the OS supports native handling of interrupts for Collaborative
|
||||
Processor Performance Control (CPPC) notifications. Since on
|
||||
HWP-capable systems CPPC is a firmware interface to HWP, setting
|
||||
this bit effectively tells the firmware that the OS will handle
|
||||
thermal interrupts natively going forward.
|
||||
|
||||
For details on _OSC/_PDC refer to:
|
||||
http://www.intel.com/content/www/us/en/standards/processor-vendor-specific-acpi-specification.html
|
||||
|
||||
To implement the _OSC/_PDC handshake as described, introduce a new
|
||||
function, acpi_early_processor_osc(), that walks the ACPI
|
||||
namespace looking for ACPI processor objects and invokes _OSC for
|
||||
them with bit 12 in the capabilities buffer set and terminates the
|
||||
namespace walk on the first success.
|
||||
|
||||
Also modify intel_thermal_interrupt() to clear HWP status bits in
|
||||
the HWP_STATUS MSR to acknowledge HWP interrupts (which prevents
|
||||
them from firing continuously).
|
||||
|
||||
Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
|
||||
[ rjw: Subject & changelog, function rename ]
|
||||
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
|
||||
---
|
||||
arch/x86/kernel/cpu/mcheck/therm_throt.c | 3 ++
|
||||
drivers/acpi/acpi_processor.c | 52 ++++++++++++++++++++++++++++++++
|
||||
drivers/acpi/bus.c | 3 ++
|
||||
drivers/acpi/internal.h | 6 ++++
|
||||
4 files changed, 64 insertions(+)
|
||||
|
||||
diff --git a/arch/x86/kernel/cpu/mcheck/therm_throt.c b/arch/x86/kernel/cpu/mcheck/therm_throt.c
|
||||
index 2c5aaf8c2e2f..05538582a809 100644
|
||||
--- a/arch/x86/kernel/cpu/mcheck/therm_throt.c
|
||||
+++ b/arch/x86/kernel/cpu/mcheck/therm_throt.c
|
||||
@@ -385,6 +385,9 @@ static void intel_thermal_interrupt(void)
|
||||
{
|
||||
__u64 msr_val;
|
||||
|
||||
+ if (static_cpu_has(X86_FEATURE_HWP))
|
||||
+ wrmsrl_safe(MSR_HWP_STATUS, 0);
|
||||
+
|
||||
rdmsrl(MSR_IA32_THERM_STATUS, msr_val);
|
||||
|
||||
/* Check for violation of core thermal thresholds*/
|
||||
diff --git a/drivers/acpi/acpi_processor.c b/drivers/acpi/acpi_processor.c
|
||||
index b5e54f2da53d..0d92d0f915e9 100644
|
||||
--- a/drivers/acpi/acpi_processor.c
|
||||
+++ b/drivers/acpi/acpi_processor.c
|
||||
@@ -491,6 +491,58 @@ static void acpi_processor_remove(struct acpi_device *device)
|
||||
}
|
||||
#endif /* CONFIG_ACPI_HOTPLUG_CPU */
|
||||
|
||||
+#ifdef CONFIG_X86
|
||||
+static bool acpi_hwp_native_thermal_lvt_set;
|
||||
+static acpi_status __init acpi_hwp_native_thermal_lvt_osc(acpi_handle handle,
|
||||
+ u32 lvl,
|
||||
+ void *context,
|
||||
+ void **rv)
|
||||
+{
|
||||
+ u8 sb_uuid_str[] = "4077A616-290C-47BE-9EBD-D87058713953";
|
||||
+ u32 capbuf[2];
|
||||
+ struct acpi_osc_context osc_context = {
|
||||
+ .uuid_str = sb_uuid_str,
|
||||
+ .rev = 1,
|
||||
+ .cap.length = 8,
|
||||
+ .cap.pointer = capbuf,
|
||||
+ };
|
||||
+
|
||||
+ if (acpi_hwp_native_thermal_lvt_set)
|
||||
+ return AE_CTRL_TERMINATE;
|
||||
+
|
||||
+ capbuf[0] = 0x0000;
|
||||
+ capbuf[1] = 0x1000; /* set bit 12 */
|
||||
+
|
||||
+ if (ACPI_SUCCESS(acpi_run_osc(handle, &osc_context))) {
|
||||
+ if (osc_context.ret.pointer && osc_context.ret.length > 1) {
|
||||
+ u32 *capbuf_ret = osc_context.ret.pointer;
|
||||
+
|
||||
+ if (capbuf_ret[1] & 0x1000) {
|
||||
+ acpi_handle_info(handle,
|
||||
+ "_OSC native thermal LVT Acked\n");
|
||||
+ acpi_hwp_native_thermal_lvt_set = true;
|
||||
+ }
|
||||
+ }
|
||||
+ kfree(osc_context.ret.pointer);
|
||||
+ }
|
||||
+
|
||||
+ return AE_OK;
|
||||
+}
|
||||
+
|
||||
+void __init acpi_early_processor_osc(void)
|
||||
+{
|
||||
+ if (boot_cpu_has(X86_FEATURE_HWP)) {
|
||||
+ acpi_walk_namespace(ACPI_TYPE_PROCESSOR, ACPI_ROOT_OBJECT,
|
||||
+ ACPI_UINT32_MAX,
|
||||
+ acpi_hwp_native_thermal_lvt_osc,
|
||||
+ NULL, NULL, NULL);
|
||||
+ acpi_get_devices(ACPI_PROCESSOR_DEVICE_HID,
|
||||
+ acpi_hwp_native_thermal_lvt_osc,
|
||||
+ NULL, NULL);
|
||||
+ }
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
/*
|
||||
* The following ACPI IDs are known to be suitable for representing as
|
||||
* processor devices.
|
||||
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
|
||||
index 891c42d1cd65..f9081b791b81 100644
|
||||
--- a/drivers/acpi/bus.c
|
||||
+++ b/drivers/acpi/bus.c
|
||||
@@ -1005,6 +1005,9 @@ static int __init acpi_bus_init(void)
|
||||
goto error1;
|
||||
}
|
||||
|
||||
+ /* Set capability bits for _OSC under processor scope */
|
||||
+ acpi_early_processor_osc();
|
||||
+
|
||||
/*
|
||||
* _OSC method may exist in module level code,
|
||||
* so it must be run after ACPI_FULL_INITIALIZATION
|
||||
diff --git a/drivers/acpi/internal.h b/drivers/acpi/internal.h
|
||||
index 1e6833a5cd44..6f41c73f82bb 100644
|
||||
--- a/drivers/acpi/internal.h
|
||||
+++ b/drivers/acpi/internal.h
|
||||
@@ -138,6 +138,12 @@ void acpi_early_processor_set_pdc(void);
|
||||
static inline void acpi_early_processor_set_pdc(void) {}
|
||||
#endif
|
||||
|
||||
+#ifdef CONFIG_X86
|
||||
+void acpi_early_processor_osc(void);
|
||||
+#else
|
||||
+static inline void acpi_early_processor_osc(void) {}
|
||||
+#endif
|
||||
+
|
||||
/* --------------------------------------------------------------------------
|
||||
Embedded Controller
|
||||
-------------------------------------------------------------------------- */
|
|
@ -1,55 +0,0 @@
|
|||
From: Arnd Bergmann <arnd@arndb.de>
|
||||
Date: Mon, 14 Mar 2016 15:53:57 +0100
|
||||
Subject: vmxnet3: fix lock imbalance in vmxnet3_tq_xmit()
|
||||
Origin: https://git.kernel.org/cgit/linux/kernel/git/davem/net.git/commit?id=efc21d95067f658a20e51e24c4c86d68f23b7f7f
|
||||
|
||||
A recent bug fix rearranged the code in vmxnet3_tq_xmit() in a
|
||||
way that left the error handling for oversized headers unlock
|
||||
a lock that had not been taken yet. Gcc warns about the incorrect
|
||||
use of the 'flags' variable because of that:
|
||||
|
||||
drivers/net/vmxnet3/vmxnet3_drv.c: In function 'vmxnet3_tq_xmit.constprop':
|
||||
include/linux/spinlock.h:246:3: error: 'flags' may be used uninitialized in this function [-Werror=maybe-uninitialized]
|
||||
|
||||
This changes the error handling path to 'goto' the end of the function
|
||||
beyond the lock/unlock pair.
|
||||
|
||||
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
|
||||
Fixes: cec05562fb1d ("vmxnet3: avoid calling pskb_may_pull with interrupts disabled")
|
||||
Signed-off-by: David S. Miller <davem@davemloft.net>
|
||||
---
|
||||
drivers/net/vmxnet3/vmxnet3_drv.c | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/drivers/net/vmxnet3/vmxnet3_drv.c b/drivers/net/vmxnet3/vmxnet3_drv.c
|
||||
index fc895d0e85d9..b2348f67b00a 100644
|
||||
--- a/drivers/net/vmxnet3/vmxnet3_drv.c
|
||||
+++ b/drivers/net/vmxnet3/vmxnet3_drv.c
|
||||
@@ -1022,14 +1022,16 @@ vmxnet3_tq_xmit(struct sk_buff *skb, struct vmxnet3_tx_queue *tq,
|
||||
if (ctx.mss) {
|
||||
if (unlikely(ctx.eth_ip_hdr_size + ctx.l4_hdr_size >
|
||||
VMXNET3_MAX_TX_BUF_SIZE)) {
|
||||
- goto hdr_too_big;
|
||||
+ tq->stats.drop_oversized_hdr++;
|
||||
+ goto drop_pkt;
|
||||
}
|
||||
} else {
|
||||
if (skb->ip_summed == CHECKSUM_PARTIAL) {
|
||||
if (unlikely(ctx.eth_ip_hdr_size +
|
||||
skb->csum_offset >
|
||||
VMXNET3_MAX_CSUM_OFFSET)) {
|
||||
- goto hdr_too_big;
|
||||
+ tq->stats.drop_oversized_hdr++;
|
||||
+ goto drop_pkt;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1123,8 +1125,6 @@ vmxnet3_tq_xmit(struct sk_buff *skb, struct vmxnet3_tx_queue *tq,
|
||||
|
||||
return NETDEV_TX_OK;
|
||||
|
||||
-hdr_too_big:
|
||||
- tq->stats.drop_oversized_hdr++;
|
||||
unlock_drop_pkt:
|
||||
spin_unlock_irqrestore(&tq->tx_lock, flags);
|
||||
drop_pkt:
|
|
@ -1,180 +0,0 @@
|
|||
From: Sai Praneeth <sai.praneeth.prakhya@intel.com>
|
||||
Date: Wed, 9 Dec 2015 15:41:08 -0800
|
||||
Subject: x86/efi-bgrt: Fix kernel panic when mapping BGRT data
|
||||
Origin: https://git.kernel.org/cgit/linux/kernel/git/mfleming/efi.git/commit?id=50a0cb565246f20d59cdb161778531e4b19d35ac
|
||||
Bug-Debian: https://bugs.debian.org/815125
|
||||
|
||||
Starting with this commit 35eb8b81edd4 ("x86/efi: Build our own page
|
||||
table structures") efi regions have a separate page directory called
|
||||
"efi_pgd". In order to access any efi region we have to first shift %cr3
|
||||
to this page table. In the bgrt code we are trying to copy bgrt_header
|
||||
and image, but these regions fall under "EFI_BOOT_SERVICES_DATA"
|
||||
and to access these regions we have to shift %cr3 to efi_pgd and not
|
||||
doing so will cause page fault as shown below.
|
||||
|
||||
[ 0.251599] Last level dTLB entries: 4KB 64, 2MB 0, 4MB 0, 1GB 4
|
||||
[ 0.259126] Freeing SMP alternatives memory: 32K (ffffffff8230e000 - ffffffff82316000)
|
||||
[ 0.271803] BUG: unable to handle kernel paging request at fffffffefce35002
|
||||
[ 0.279740] IP: [<ffffffff821bca49>] efi_bgrt_init+0x144/0x1fd
|
||||
[ 0.286383] PGD 300f067 PUD 0
|
||||
[ 0.289879] Oops: 0000 [#1] SMP
|
||||
[ 0.293566] Modules linked in:
|
||||
[ 0.297039] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.4.0-rc1-eywa-eywa-built-in-47041+ #2
|
||||
[ 0.306619] Hardware name: Intel Corporation Skylake Client platform/Skylake Y LPDDR3 RVP3, BIOS SKLSE2R1.R00.B104.B01.1511110114 11/11/2015
|
||||
[ 0.320925] task: ffffffff820134c0 ti: ffffffff82000000 task.ti: ffffffff82000000
|
||||
[ 0.329420] RIP: 0010:[<ffffffff821bca49>] [<ffffffff821bca49>] efi_bgrt_init+0x144/0x1fd
|
||||
[ 0.338821] RSP: 0000:ffffffff82003f18 EFLAGS: 00010246
|
||||
[ 0.344852] RAX: fffffffefce35000 RBX: fffffffefce35000 RCX: fffffffefce2b000
|
||||
[ 0.352952] RDX: 000000008a82b000 RSI: ffffffff8235bb80 RDI: 000000008a835000
|
||||
[ 0.361050] RBP: ffffffff82003f30 R08: 000000008a865000 R09: ffffffffff202850
|
||||
[ 0.369149] R10: ffffffff811ad62f R11: 0000000000000000 R12: 0000000000000000
|
||||
[ 0.377248] R13: ffff88016dbaea40 R14: ffffffff822622c0 R15: ffffffff82003fb0
|
||||
[ 0.385348] FS: 0000000000000000(0000) GS:ffff88016d800000(0000) knlGS:0000000000000000
|
||||
[ 0.394533] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
|
||||
[ 0.401054] CR2: fffffffefce35002 CR3: 000000000300c000 CR4: 00000000003406f0
|
||||
[ 0.409153] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
|
||||
[ 0.417252] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
|
||||
[ 0.425350] Stack:
|
||||
[ 0.427638] ffffffffffffffff ffffffff82256900 ffff88016dbaea40 ffffffff82003f40
|
||||
[ 0.436086] ffffffff821bbce0 ffffffff82003f88 ffffffff8219c0c2 0000000000000000
|
||||
[ 0.444533] ffffffff8219ba4a ffffffff822622c0 0000000000083000 00000000ffffffff
|
||||
[ 0.452978] Call Trace:
|
||||
[ 0.455763] [<ffffffff821bbce0>] efi_late_init+0x9/0xb
|
||||
[ 0.461697] [<ffffffff8219c0c2>] start_kernel+0x463/0x47f
|
||||
[ 0.467928] [<ffffffff8219ba4a>] ? set_init_arg+0x55/0x55
|
||||
[ 0.474159] [<ffffffff8219b120>] ? early_idt_handler_array+0x120/0x120
|
||||
[ 0.481669] [<ffffffff8219b5ee>] x86_64_start_reservations+0x2a/0x2c
|
||||
[ 0.488982] [<ffffffff8219b72d>] x86_64_start_kernel+0x13d/0x14c
|
||||
[ 0.495897] Code: 00 41 b4 01 48 8b 78 28 e8 09 36 01 00 48 85 c0 48 89 c3 75 13 48 c7 c7 f8 ac d3 81 31 c0 e8 d7 3b fb fe e9 b5 00 00 00 45 84 e4 <44> 8b 6b 02 74 0d be 06 00 00 00 48 89 df e8 ae 34 0$
|
||||
[ 0.518151] RIP [<ffffffff821bca49>] efi_bgrt_init+0x144/0x1fd
|
||||
[ 0.524888] RSP <ffffffff82003f18>
|
||||
[ 0.528851] CR2: fffffffefce35002
|
||||
[ 0.532615] ---[ end trace 7b06521e6ebf2aea ]---
|
||||
[ 0.537852] Kernel panic - not syncing: Attempted to kill the idle task!
|
||||
|
||||
As said above one way to fix this bug is to shift %cr3 to efi_pgd but we
|
||||
are not doing that way because it leaks inner details of how we switch
|
||||
to EFI page tables into a new call site and it also adds duplicate code.
|
||||
Instead, we remove the call to efi_lookup_mapped_addr() and always
|
||||
perform early_mem*() instead of early_io*() because we want to remap RAM
|
||||
regions and not I/O regions. We also delete efi_lookup_mapped_addr()
|
||||
because we are no longer using it.
|
||||
|
||||
Signed-off-by: Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>
|
||||
Reported-by: Wendy Wang <wendy.wang@intel.com>
|
||||
Cc: Borislav Petkov <bp@suse.de>
|
||||
Cc: Josh Triplett <josh@joshtriplett.org>
|
||||
Cc: Ricardo Neri <ricardo.neri@intel.com>
|
||||
Cc: Ravi Shankar <ravi.v.shankar@intel.com>
|
||||
Signed-off-by: Matt Fleming <matt@codeblueprint.co.uk>
|
||||
---
|
||||
arch/x86/platform/efi/efi-bgrt.c | 39 ++++++++++++++-------------------------
|
||||
drivers/firmware/efi/efi.c | 32 --------------------------------
|
||||
2 files changed, 14 insertions(+), 57 deletions(-)
|
||||
|
||||
--- a/arch/x86/platform/efi/efi-bgrt.c
|
||||
+++ b/arch/x86/platform/efi/efi-bgrt.c
|
||||
@@ -28,8 +28,7 @@ struct bmp_header {
|
||||
void __init efi_bgrt_init(void)
|
||||
{
|
||||
acpi_status status;
|
||||
- void __iomem *image;
|
||||
- bool ioremapped = false;
|
||||
+ void *image;
|
||||
struct bmp_header bmp_header;
|
||||
|
||||
if (acpi_disabled)
|
||||
@@ -70,20 +69,14 @@ void __init efi_bgrt_init(void)
|
||||
return;
|
||||
}
|
||||
|
||||
- image = efi_lookup_mapped_addr(bgrt_tab->image_address);
|
||||
+ image = early_memremap(bgrt_tab->image_address, sizeof(bmp_header));
|
||||
if (!image) {
|
||||
- image = early_ioremap(bgrt_tab->image_address,
|
||||
- sizeof(bmp_header));
|
||||
- ioremapped = true;
|
||||
- if (!image) {
|
||||
- pr_err("Ignoring BGRT: failed to map image header memory\n");
|
||||
- return;
|
||||
- }
|
||||
+ pr_err("Ignoring BGRT: failed to map image header memory\n");
|
||||
+ return;
|
||||
}
|
||||
|
||||
- memcpy_fromio(&bmp_header, image, sizeof(bmp_header));
|
||||
- if (ioremapped)
|
||||
- early_iounmap(image, sizeof(bmp_header));
|
||||
+ memcpy(&bmp_header, image, sizeof(bmp_header));
|
||||
+ early_memunmap(image, sizeof(bmp_header));
|
||||
bgrt_image_size = bmp_header.size;
|
||||
|
||||
bgrt_image = kmalloc(bgrt_image_size, GFP_KERNEL | __GFP_NOWARN);
|
||||
@@ -93,18 +86,14 @@ void __init efi_bgrt_init(void)
|
||||
return;
|
||||
}
|
||||
|
||||
- if (ioremapped) {
|
||||
- image = early_ioremap(bgrt_tab->image_address,
|
||||
- bmp_header.size);
|
||||
- if (!image) {
|
||||
- pr_err("Ignoring BGRT: failed to map image memory\n");
|
||||
- kfree(bgrt_image);
|
||||
- bgrt_image = NULL;
|
||||
- return;
|
||||
- }
|
||||
+ image = early_memremap(bgrt_tab->image_address, bmp_header.size);
|
||||
+ if (!image) {
|
||||
+ pr_err("Ignoring BGRT: failed to map image memory\n");
|
||||
+ kfree(bgrt_image);
|
||||
+ bgrt_image = NULL;
|
||||
+ return;
|
||||
}
|
||||
|
||||
- memcpy_fromio(bgrt_image, image, bgrt_image_size);
|
||||
- if (ioremapped)
|
||||
- early_iounmap(image, bmp_header.size);
|
||||
+ memcpy(bgrt_image, image, bgrt_image_size);
|
||||
+ early_memunmap(image, bmp_header.size);
|
||||
}
|
||||
--- a/drivers/firmware/efi/efi.c
|
||||
+++ b/drivers/firmware/efi/efi.c
|
||||
@@ -324,38 +324,6 @@ u64 __init efi_mem_desc_end(efi_memory_d
|
||||
return end;
|
||||
}
|
||||
|
||||
-/*
|
||||
- * We can't ioremap data in EFI boot services RAM, because we've already mapped
|
||||
- * it as RAM. So, look it up in the existing EFI memory map instead. Only
|
||||
- * callable after efi_enter_virtual_mode and before efi_free_boot_services.
|
||||
- */
|
||||
-void __iomem *efi_lookup_mapped_addr(u64 phys_addr)
|
||||
-{
|
||||
- struct efi_memory_map *map;
|
||||
- void *p;
|
||||
- map = efi.memmap;
|
||||
- if (!map)
|
||||
- return NULL;
|
||||
- if (WARN_ON(!map->map))
|
||||
- return NULL;
|
||||
- for (p = map->map; p < map->map_end; p += map->desc_size) {
|
||||
- efi_memory_desc_t *md = p;
|
||||
- u64 size = md->num_pages << EFI_PAGE_SHIFT;
|
||||
- u64 end = md->phys_addr + size;
|
||||
- if (!(md->attribute & EFI_MEMORY_RUNTIME) &&
|
||||
- md->type != EFI_BOOT_SERVICES_CODE &&
|
||||
- md->type != EFI_BOOT_SERVICES_DATA)
|
||||
- continue;
|
||||
- if (!md->virt_addr)
|
||||
- continue;
|
||||
- if (phys_addr >= md->phys_addr && phys_addr < end) {
|
||||
- phys_addr += md->virt_addr - md->phys_addr;
|
||||
- return (__force void __iomem *)(unsigned long)phys_addr;
|
||||
- }
|
||||
- }
|
||||
- return NULL;
|
||||
-}
|
||||
-
|
||||
static __initdata efi_config_table_type_t common_tables[] = {
|
||||
{ACPI_20_TABLE_GUID, "ACPI 2.0", &efi.acpi20},
|
||||
{ACPI_TABLE_GUID, "ACPI", &efi.acpi},
|
|
@ -1,92 +0,0 @@
|
|||
From: Matt Fleming <matt@codeblueprint.co.uk>
|
||||
Date: Mon, 21 Dec 2015 14:12:52 +0000
|
||||
Subject: x86/efi-bgrt: Replace early_memremap() with memremap()
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
Origin: https://git.kernel.org/cgit/linux/kernel/git/mfleming/efi.git/commit?id=e2c90dd7e11e3025b46719a79fb4bb1e7a5cef9f
|
||||
Bug-Debian: https://bugs.debian.org/815125
|
||||
|
||||
Môshe reported the following warning triggered on his machine since
|
||||
commit 50a0cb565246 ("x86/efi-bgrt: Fix kernel panic when mapping BGRT
|
||||
data"),
|
||||
|
||||
[ 0.026936] ------------[ cut here ]------------
|
||||
[ 0.026941] WARNING: CPU: 0 PID: 0 at mm/early_ioremap.c:137 __early_ioremap+0x102/0x1bb()
|
||||
[ 0.026941] Modules linked in:
|
||||
[ 0.026944] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.4.0-rc1 #2
|
||||
[ 0.026945] Hardware name: Dell Inc. XPS 13 9343/09K8G1, BIOS A05 07/14/2015
|
||||
[ 0.026946] 0000000000000000 900f03d5a116524d ffffffff81c03e60 ffffffff813a3fff
|
||||
[ 0.026948] 0000000000000000 ffffffff81c03e98 ffffffff810a0852 00000000d7b76000
|
||||
[ 0.026949] 0000000000000000 0000000000000001 0000000000000001 000000000000017c
|
||||
[ 0.026951] Call Trace:
|
||||
[ 0.026955] [<ffffffff813a3fff>] dump_stack+0x44/0x55
|
||||
[ 0.026958] [<ffffffff810a0852>] warn_slowpath_common+0x82/0xc0
|
||||
[ 0.026959] [<ffffffff810a099a>] warn_slowpath_null+0x1a/0x20
|
||||
[ 0.026961] [<ffffffff81d8c395>] __early_ioremap+0x102/0x1bb
|
||||
[ 0.026962] [<ffffffff81d8c602>] early_memremap+0x13/0x15
|
||||
[ 0.026964] [<ffffffff81d78361>] efi_bgrt_init+0x162/0x1ad
|
||||
[ 0.026966] [<ffffffff81d778ec>] efi_late_init+0x9/0xb
|
||||
[ 0.026968] [<ffffffff81d58ff5>] start_kernel+0x46f/0x49f
|
||||
[ 0.026970] [<ffffffff81d58120>] ? early_idt_handler_array+0x120/0x120
|
||||
[ 0.026972] [<ffffffff81d58339>] x86_64_start_reservations+0x2a/0x2c
|
||||
[ 0.026974] [<ffffffff81d58485>] x86_64_start_kernel+0x14a/0x16d
|
||||
[ 0.026977] ---[ end trace f9b3812eb8e24c58 ]---
|
||||
[ 0.026978] efi_bgrt: Ignoring BGRT: failed to map image memory
|
||||
|
||||
early_memremap() has an upper limit on the size of mapping it can
|
||||
handle which is ~200KB. Clearly the BGRT image on Môshe's machine is
|
||||
much larger than that.
|
||||
|
||||
There's actually no reason to restrict ourselves to using the early_*
|
||||
version of memremap() - the ACPI BGRT driver is invoked late enough in
|
||||
boot that we can use the standard version, with the benefit that the
|
||||
late version allows mappings of arbitrary size.
|
||||
|
||||
Reported-by: Môshe van der Sterre <me@moshe.nl>
|
||||
Tested-by: Môshe van der Sterre <me@moshe.nl>
|
||||
Signed-off-by: Matt Fleming <matt@codeblueprint.co.uk>
|
||||
Cc: Josh Triplett <josh@joshtriplett.org>
|
||||
Cc: Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>
|
||||
Cc: Borislav Petkov <bp@suse.de>
|
||||
Link: http://lkml.kernel.org/r/1450707172-12561-1-git-send-email-matt@codeblueprint.co.uk
|
||||
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
|
||||
---
|
||||
arch/x86/platform/efi/efi-bgrt.c | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
--- a/arch/x86/platform/efi/efi-bgrt.c
|
||||
+++ b/arch/x86/platform/efi/efi-bgrt.c
|
||||
@@ -69,14 +69,14 @@ void __init efi_bgrt_init(void)
|
||||
return;
|
||||
}
|
||||
|
||||
- image = early_memremap(bgrt_tab->image_address, sizeof(bmp_header));
|
||||
+ image = memremap(bgrt_tab->image_address, sizeof(bmp_header), MEMREMAP_WB);
|
||||
if (!image) {
|
||||
pr_err("Ignoring BGRT: failed to map image header memory\n");
|
||||
return;
|
||||
}
|
||||
|
||||
memcpy(&bmp_header, image, sizeof(bmp_header));
|
||||
- early_memunmap(image, sizeof(bmp_header));
|
||||
+ memunmap(image);
|
||||
bgrt_image_size = bmp_header.size;
|
||||
|
||||
bgrt_image = kmalloc(bgrt_image_size, GFP_KERNEL | __GFP_NOWARN);
|
||||
@@ -86,7 +86,7 @@ void __init efi_bgrt_init(void)
|
||||
return;
|
||||
}
|
||||
|
||||
- image = early_memremap(bgrt_tab->image_address, bmp_header.size);
|
||||
+ image = memremap(bgrt_tab->image_address, bmp_header.size, MEMREMAP_WB);
|
||||
if (!image) {
|
||||
pr_err("Ignoring BGRT: failed to map image memory\n");
|
||||
kfree(bgrt_image);
|
||||
@@ -95,5 +95,5 @@ void __init efi_bgrt_init(void)
|
||||
}
|
||||
|
||||
memcpy(bgrt_image, image, bgrt_image_size);
|
||||
- early_memunmap(image, bmp_header.size);
|
||||
+ memunmap(image);
|
||||
}
|
|
@ -1,319 +0,0 @@
|
|||
From: Matt Fleming <matt@codeblueprint.co.uk>
|
||||
Date: Fri, 27 Nov 2015 21:09:34 +0000
|
||||
Subject: [5/5] x86/efi: Build our own page table structures
|
||||
Origin: https://git.kernel.org/cgit/linux/kernel/git/mfleming/efi.git/commit?id=67a9108ed4313b85a9c53406d80dc1ae3f8c3e36
|
||||
|
||||
With commit e1a58320a38d ("x86/mm: Warn on W^X mappings") all
|
||||
users booting on 64-bit UEFI machines see the following warning,
|
||||
|
||||
------------[ cut here ]------------
|
||||
WARNING: CPU: 7 PID: 1 at arch/x86/mm/dump_pagetables.c:225 note_page+0x5dc/0x780()
|
||||
x86/mm: Found insecure W+X mapping at address ffff88000005f000/0xffff88000005f000
|
||||
...
|
||||
x86/mm: Checked W+X mappings: FAILED, 165660 W+X pages found.
|
||||
...
|
||||
|
||||
This is caused by mapping EFI regions with RWX permissions.
|
||||
There isn't much we can do to restrict the permissions for these
|
||||
regions due to the way the firmware toolchains mix code and
|
||||
data, but we can at least isolate these mappings so that they do
|
||||
not appear in the regular kernel page tables.
|
||||
|
||||
In commit d2f7cbe7b26a ("x86/efi: Runtime services virtual
|
||||
mapping") we started using 'trampoline_pgd' to map the EFI
|
||||
regions because there was an existing identity mapping there
|
||||
which we use during the SetVirtualAddressMap() call and for
|
||||
broken firmware that accesses those addresses.
|
||||
|
||||
But 'trampoline_pgd' shares some PGD entries with
|
||||
'swapper_pg_dir' and does not provide the isolation we require.
|
||||
Notably the virtual address for __START_KERNEL_map and
|
||||
MODULES_START are mapped by the same PGD entry so we need to be
|
||||
more careful when copying changes over in
|
||||
efi_sync_low_kernel_mappings().
|
||||
|
||||
This patch doesn't go the full mile, we still want to share some
|
||||
PGD entries with 'swapper_pg_dir'. Having completely separate
|
||||
page tables brings its own issues such as synchronising new
|
||||
mappings after memory hotplug and module loading. Sharing also
|
||||
keeps memory usage down.
|
||||
|
||||
Signed-off-by: Matt Fleming <matt@codeblueprint.co.uk>
|
||||
Reviewed-by: Borislav Petkov <bp@suse.de>
|
||||
Acked-by: Borislav Petkov <bp@suse.de>
|
||||
Cc: Andrew Morton <akpm@linux-foundation.org>
|
||||
Cc: Andy Lutomirski <luto@amacapital.net>
|
||||
Cc: Andy Lutomirski <luto@kernel.org>
|
||||
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
|
||||
Cc: Borislav Petkov <bp@alien8.de>
|
||||
Cc: Brian Gerst <brgerst@gmail.com>
|
||||
Cc: Dave Jones <davej@codemonkey.org.uk>
|
||||
Cc: Denys Vlasenko <dvlasenk@redhat.com>
|
||||
Cc: H. Peter Anvin <hpa@zytor.com>
|
||||
Cc: Linus Torvalds <torvalds@linux-foundation.org>
|
||||
Cc: Peter Zijlstra <peterz@infradead.org>
|
||||
Cc: Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>
|
||||
Cc: Stephen Smalley <sds@tycho.nsa.gov>
|
||||
Cc: Thomas Gleixner <tglx@linutronix.de>
|
||||
Cc: Toshi Kani <toshi.kani@hp.com>
|
||||
Cc: linux-efi@vger.kernel.org
|
||||
Link: http://lkml.kernel.org/r/1448658575-17029-6-git-send-email-matt@codeblueprint.co.uk
|
||||
Signed-off-by: Ingo Molnar <mingo@kernel.org>
|
||||
---
|
||||
arch/x86/include/asm/efi.h | 1 +
|
||||
arch/x86/platform/efi/efi.c | 39 ++++++-----------
|
||||
arch/x86/platform/efi/efi_32.c | 5 +++
|
||||
arch/x86/platform/efi/efi_64.c | 97 +++++++++++++++++++++++++++++++++++-------
|
||||
4 files changed, 102 insertions(+), 40 deletions(-)
|
||||
|
||||
diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h
|
||||
index 347eeacb06a8..8fd9e637629a 100644
|
||||
--- a/arch/x86/include/asm/efi.h
|
||||
+++ b/arch/x86/include/asm/efi.h
|
||||
@@ -136,6 +136,7 @@ extern void __init efi_memory_uc(u64 addr, unsigned long size);
|
||||
extern void __init efi_map_region(efi_memory_desc_t *md);
|
||||
extern void __init efi_map_region_fixed(efi_memory_desc_t *md);
|
||||
extern void efi_sync_low_kernel_mappings(void);
|
||||
+extern int __init efi_alloc_page_tables(void);
|
||||
extern int __init efi_setup_page_tables(unsigned long pa_memmap, unsigned num_pages);
|
||||
extern void __init efi_cleanup_page_tables(unsigned long pa_memmap, unsigned num_pages);
|
||||
extern void __init old_map_region(efi_memory_desc_t *md);
|
||||
diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c
|
||||
index ad285404ea7f..3c1f3cd7b2ba 100644
|
||||
--- a/arch/x86/platform/efi/efi.c
|
||||
+++ b/arch/x86/platform/efi/efi.c
|
||||
@@ -869,7 +869,7 @@ static void __init kexec_enter_virtual_mode(void)
|
||||
* This function will switch the EFI runtime services to virtual mode.
|
||||
* Essentially, we look through the EFI memmap and map every region that
|
||||
* has the runtime attribute bit set in its memory descriptor into the
|
||||
- * ->trampoline_pgd page table using a top-down VA allocation scheme.
|
||||
+ * efi_pgd page table.
|
||||
*
|
||||
* The old method which used to update that memory descriptor with the
|
||||
* virtual address obtained from ioremap() is still supported when the
|
||||
@@ -879,8 +879,8 @@ static void __init kexec_enter_virtual_mode(void)
|
||||
*
|
||||
* The new method does a pagetable switch in a preemption-safe manner
|
||||
* so that we're in a different address space when calling a runtime
|
||||
- * function. For function arguments passing we do copy the PGDs of the
|
||||
- * kernel page table into ->trampoline_pgd prior to each call.
|
||||
+ * function. For function arguments passing we do copy the PUDs of the
|
||||
+ * kernel page table into efi_pgd prior to each call.
|
||||
*
|
||||
* Specially for kexec boot, efi runtime maps in previous kernel should
|
||||
* be passed in via setup_data. In that case runtime ranges will be mapped
|
||||
@@ -895,6 +895,12 @@ static void __init __efi_enter_virtual_mode(void)
|
||||
|
||||
efi.systab = NULL;
|
||||
|
||||
+ if (efi_alloc_page_tables()) {
|
||||
+ pr_err("Failed to allocate EFI page tables\n");
|
||||
+ clear_bit(EFI_RUNTIME_SERVICES, &efi.flags);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
efi_merge_regions();
|
||||
new_memmap = efi_map_regions(&count, &pg_shift);
|
||||
if (!new_memmap) {
|
||||
@@ -954,28 +960,11 @@ static void __init __efi_enter_virtual_mode(void)
|
||||
efi_runtime_mkexec();
|
||||
|
||||
/*
|
||||
- * We mapped the descriptor array into the EFI pagetable above but we're
|
||||
- * not unmapping it here. Here's why:
|
||||
- *
|
||||
- * We're copying select PGDs from the kernel page table to the EFI page
|
||||
- * table and when we do so and make changes to those PGDs like unmapping
|
||||
- * stuff from them, those changes appear in the kernel page table and we
|
||||
- * go boom.
|
||||
- *
|
||||
- * From setup_real_mode():
|
||||
- *
|
||||
- * ...
|
||||
- * trampoline_pgd[0] = init_level4_pgt[pgd_index(__PAGE_OFFSET)].pgd;
|
||||
- *
|
||||
- * In this particular case, our allocation is in PGD 0 of the EFI page
|
||||
- * table but we've copied that PGD from PGD[272] of the EFI page table:
|
||||
- *
|
||||
- * pgd_index(__PAGE_OFFSET = 0xffff880000000000) = 272
|
||||
- *
|
||||
- * where the direct memory mapping in kernel space is.
|
||||
- *
|
||||
- * new_memmap's VA comes from that direct mapping and thus clearing it,
|
||||
- * it would get cleared in the kernel page table too.
|
||||
+ * We mapped the descriptor array into the EFI pagetable above
|
||||
+ * but we're not unmapping it here because if we're running in
|
||||
+ * EFI mixed mode we need all of memory to be accessible when
|
||||
+ * we pass parameters to the EFI runtime services in the
|
||||
+ * thunking code.
|
||||
*
|
||||
* efi_cleanup_page_tables(__pa(new_memmap), 1 << pg_shift);
|
||||
*/
|
||||
diff --git a/arch/x86/platform/efi/efi_32.c b/arch/x86/platform/efi/efi_32.c
|
||||
index ed5b67338294..58d669bc8250 100644
|
||||
--- a/arch/x86/platform/efi/efi_32.c
|
||||
+++ b/arch/x86/platform/efi/efi_32.c
|
||||
@@ -38,6 +38,11 @@
|
||||
* say 0 - 3G.
|
||||
*/
|
||||
|
||||
+int __init efi_alloc_page_tables(void)
|
||||
+{
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
void efi_sync_low_kernel_mappings(void) {}
|
||||
void __init efi_dump_pagetable(void) {}
|
||||
int __init efi_setup_page_tables(unsigned long pa_memmap, unsigned num_pages)
|
||||
diff --git a/arch/x86/platform/efi/efi_64.c b/arch/x86/platform/efi/efi_64.c
|
||||
index b19cdac959b2..4897f518760f 100644
|
||||
--- a/arch/x86/platform/efi/efi_64.c
|
||||
+++ b/arch/x86/platform/efi/efi_64.c
|
||||
@@ -40,6 +40,7 @@
|
||||
#include <asm/fixmap.h>
|
||||
#include <asm/realmode.h>
|
||||
#include <asm/time.h>
|
||||
+#include <asm/pgalloc.h>
|
||||
|
||||
/*
|
||||
* We allocate runtime services regions bottom-up, starting from -4G, i.e.
|
||||
@@ -121,22 +122,92 @@ void __init efi_call_phys_epilog(pgd_t *save_pgd)
|
||||
early_code_mapping_set_exec(0);
|
||||
}
|
||||
|
||||
+static pgd_t *efi_pgd;
|
||||
+
|
||||
+/*
|
||||
+ * We need our own copy of the higher levels of the page tables
|
||||
+ * because we want to avoid inserting EFI region mappings (EFI_VA_END
|
||||
+ * to EFI_VA_START) into the standard kernel page tables. Everything
|
||||
+ * else can be shared, see efi_sync_low_kernel_mappings().
|
||||
+ */
|
||||
+int __init efi_alloc_page_tables(void)
|
||||
+{
|
||||
+ pgd_t *pgd;
|
||||
+ pud_t *pud;
|
||||
+ gfp_t gfp_mask;
|
||||
+
|
||||
+ if (efi_enabled(EFI_OLD_MEMMAP))
|
||||
+ return 0;
|
||||
+
|
||||
+ gfp_mask = GFP_KERNEL | __GFP_NOTRACK | __GFP_REPEAT | __GFP_ZERO;
|
||||
+ efi_pgd = (pgd_t *)__get_free_page(gfp_mask);
|
||||
+ if (!efi_pgd)
|
||||
+ return -ENOMEM;
|
||||
+
|
||||
+ pgd = efi_pgd + pgd_index(EFI_VA_END);
|
||||
+
|
||||
+ pud = pud_alloc_one(NULL, 0);
|
||||
+ if (!pud) {
|
||||
+ free_page((unsigned long)efi_pgd);
|
||||
+ return -ENOMEM;
|
||||
+ }
|
||||
+
|
||||
+ pgd_populate(NULL, pgd, pud);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
/*
|
||||
* Add low kernel mappings for passing arguments to EFI functions.
|
||||
*/
|
||||
void efi_sync_low_kernel_mappings(void)
|
||||
{
|
||||
- unsigned num_pgds;
|
||||
- pgd_t *pgd = (pgd_t *)__va(real_mode_header->trampoline_pgd);
|
||||
+ unsigned num_entries;
|
||||
+ pgd_t *pgd_k, *pgd_efi;
|
||||
+ pud_t *pud_k, *pud_efi;
|
||||
|
||||
if (efi_enabled(EFI_OLD_MEMMAP))
|
||||
return;
|
||||
|
||||
- num_pgds = pgd_index(MODULES_END - 1) - pgd_index(PAGE_OFFSET);
|
||||
+ /*
|
||||
+ * We can share all PGD entries apart from the one entry that
|
||||
+ * covers the EFI runtime mapping space.
|
||||
+ *
|
||||
+ * Make sure the EFI runtime region mappings are guaranteed to
|
||||
+ * only span a single PGD entry and that the entry also maps
|
||||
+ * other important kernel regions.
|
||||
+ */
|
||||
+ BUILD_BUG_ON(pgd_index(EFI_VA_END) != pgd_index(MODULES_END));
|
||||
+ BUILD_BUG_ON((EFI_VA_START & PGDIR_MASK) !=
|
||||
+ (EFI_VA_END & PGDIR_MASK));
|
||||
+
|
||||
+ pgd_efi = efi_pgd + pgd_index(PAGE_OFFSET);
|
||||
+ pgd_k = pgd_offset_k(PAGE_OFFSET);
|
||||
+
|
||||
+ num_entries = pgd_index(EFI_VA_END) - pgd_index(PAGE_OFFSET);
|
||||
+ memcpy(pgd_efi, pgd_k, sizeof(pgd_t) * num_entries);
|
||||
|
||||
- memcpy(pgd + pgd_index(PAGE_OFFSET),
|
||||
- init_mm.pgd + pgd_index(PAGE_OFFSET),
|
||||
- sizeof(pgd_t) * num_pgds);
|
||||
+ /*
|
||||
+ * We share all the PUD entries apart from those that map the
|
||||
+ * EFI regions. Copy around them.
|
||||
+ */
|
||||
+ BUILD_BUG_ON((EFI_VA_START & ~PUD_MASK) != 0);
|
||||
+ BUILD_BUG_ON((EFI_VA_END & ~PUD_MASK) != 0);
|
||||
+
|
||||
+ pgd_efi = efi_pgd + pgd_index(EFI_VA_END);
|
||||
+ pud_efi = pud_offset(pgd_efi, 0);
|
||||
+
|
||||
+ pgd_k = pgd_offset_k(EFI_VA_END);
|
||||
+ pud_k = pud_offset(pgd_k, 0);
|
||||
+
|
||||
+ num_entries = pud_index(EFI_VA_END);
|
||||
+ memcpy(pud_efi, pud_k, sizeof(pud_t) * num_entries);
|
||||
+
|
||||
+ pud_efi = pud_offset(pgd_efi, EFI_VA_START);
|
||||
+ pud_k = pud_offset(pgd_k, EFI_VA_START);
|
||||
+
|
||||
+ num_entries = PTRS_PER_PUD - pud_index(EFI_VA_START);
|
||||
+ memcpy(pud_efi, pud_k, sizeof(pud_t) * num_entries);
|
||||
}
|
||||
|
||||
int __init efi_setup_page_tables(unsigned long pa_memmap, unsigned num_pages)
|
||||
@@ -150,8 +221,8 @@ int __init efi_setup_page_tables(unsigned long pa_memmap, unsigned num_pages)
|
||||
if (efi_enabled(EFI_OLD_MEMMAP))
|
||||
return 0;
|
||||
|
||||
- efi_scratch.efi_pgt = (pgd_t *)(unsigned long)real_mode_header->trampoline_pgd;
|
||||
- pgd = __va(efi_scratch.efi_pgt);
|
||||
+ efi_scratch.efi_pgt = (pgd_t *)__pa(efi_pgd);
|
||||
+ pgd = efi_pgd;
|
||||
|
||||
/*
|
||||
* It can happen that the physical address of new_memmap lands in memory
|
||||
@@ -216,16 +287,14 @@ int __init efi_setup_page_tables(unsigned long pa_memmap, unsigned num_pages)
|
||||
|
||||
void __init efi_cleanup_page_tables(unsigned long pa_memmap, unsigned num_pages)
|
||||
{
|
||||
- pgd_t *pgd = (pgd_t *)__va(real_mode_header->trampoline_pgd);
|
||||
-
|
||||
- kernel_unmap_pages_in_pgd(pgd, pa_memmap, num_pages);
|
||||
+ kernel_unmap_pages_in_pgd(efi_pgd, pa_memmap, num_pages);
|
||||
}
|
||||
|
||||
static void __init __map_region(efi_memory_desc_t *md, u64 va)
|
||||
{
|
||||
- pgd_t *pgd = (pgd_t *)__va(real_mode_header->trampoline_pgd);
|
||||
unsigned long flags = 0;
|
||||
unsigned long pfn;
|
||||
+ pgd_t *pgd = efi_pgd;
|
||||
|
||||
if (!(md->attribute & EFI_MEMORY_WB))
|
||||
flags |= _PAGE_PCD;
|
||||
@@ -334,9 +403,7 @@ void __init efi_runtime_mkexec(void)
|
||||
void __init efi_dump_pagetable(void)
|
||||
{
|
||||
#ifdef CONFIG_EFI_PGT_DUMP
|
||||
- pgd_t *pgd = (pgd_t *)__va(real_mode_header->trampoline_pgd);
|
||||
-
|
||||
- ptdump_walk_pgd_level(NULL, pgd);
|
||||
+ ptdump_walk_pgd_level(NULL, efi_pgd);
|
||||
#endif
|
||||
}
|
||||
|
|
@ -1,215 +0,0 @@
|
|||
From: Matt Fleming <matt@codeblueprint.co.uk>
|
||||
Date: Fri, 27 Nov 2015 21:09:33 +0000
|
||||
Subject: [4/5] x86/efi: Hoist page table switching code into efi_call_virt()
|
||||
Origin: https://git.kernel.org/cgit/linux/kernel/git/mfleming/efi.git/commit?id=c9f2a9a65e4855b74d92cdad688f6ee4a1a323ff
|
||||
|
||||
This change is a prerequisite for pending patches that switch to
|
||||
a dedicated EFI page table, instead of using 'trampoline_pgd'
|
||||
which shares PGD entries with 'swapper_pg_dir'. The pending
|
||||
patches make it impossible to dereference the runtime service
|
||||
function pointer without first switching %cr3.
|
||||
|
||||
It's true that we now have duplicated switching code in
|
||||
efi_call_virt() and efi_call_phys_{prolog,epilog}() but we are
|
||||
sacrificing code duplication for a little more clarity and the
|
||||
ease of writing the page table switching code in C instead of
|
||||
asm.
|
||||
|
||||
Signed-off-by: Matt Fleming <matt@codeblueprint.co.uk>
|
||||
Reviewed-by: Borislav Petkov <bp@suse.de>
|
||||
Acked-by: Borislav Petkov <bp@suse.de>
|
||||
Cc: Andrew Morton <akpm@linux-foundation.org>
|
||||
Cc: Andy Lutomirski <luto@amacapital.net>
|
||||
Cc: Andy Lutomirski <luto@kernel.org>
|
||||
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
|
||||
Cc: Borislav Petkov <bp@alien8.de>
|
||||
Cc: Brian Gerst <brgerst@gmail.com>
|
||||
Cc: Dave Jones <davej@codemonkey.org.uk>
|
||||
Cc: Denys Vlasenko <dvlasenk@redhat.com>
|
||||
Cc: H. Peter Anvin <hpa@zytor.com>
|
||||
Cc: Linus Torvalds <torvalds@linux-foundation.org>
|
||||
Cc: Peter Zijlstra <peterz@infradead.org>
|
||||
Cc: Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>
|
||||
Cc: Stephen Smalley <sds@tycho.nsa.gov>
|
||||
Cc: Thomas Gleixner <tglx@linutronix.de>
|
||||
Cc: Toshi Kani <toshi.kani@hp.com>
|
||||
Cc: linux-efi@vger.kernel.org
|
||||
Link: http://lkml.kernel.org/r/1448658575-17029-5-git-send-email-matt@codeblueprint.co.uk
|
||||
Signed-off-by: Ingo Molnar <mingo@kernel.org>
|
||||
---
|
||||
arch/x86/include/asm/efi.h | 25 +++++++++++++++++++++
|
||||
arch/x86/platform/efi/efi_64.c | 24 ++++++++++-----------
|
||||
arch/x86/platform/efi/efi_stub_64.S | 43 -------------------------------------
|
||||
3 files changed, 36 insertions(+), 56 deletions(-)
|
||||
|
||||
diff --git a/arch/x86/include/asm/efi.h b/arch/x86/include/asm/efi.h
|
||||
index 0010c78c4998..347eeacb06a8 100644
|
||||
--- a/arch/x86/include/asm/efi.h
|
||||
+++ b/arch/x86/include/asm/efi.h
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
#include <asm/fpu/api.h>
|
||||
#include <asm/pgtable.h>
|
||||
+#include <asm/tlb.h>
|
||||
|
||||
/*
|
||||
* We map the EFI regions needed for runtime services non-contiguously,
|
||||
@@ -64,6 +65,17 @@ extern u64 asmlinkage efi_call(void *fp, ...);
|
||||
|
||||
#define efi_call_phys(f, args...) efi_call((f), args)
|
||||
|
||||
+/*
|
||||
+ * Scratch space used for switching the pagetable in the EFI stub
|
||||
+ */
|
||||
+struct efi_scratch {
|
||||
+ u64 r15;
|
||||
+ u64 prev_cr3;
|
||||
+ pgd_t *efi_pgt;
|
||||
+ bool use_pgd;
|
||||
+ u64 phys_stack;
|
||||
+} __packed;
|
||||
+
|
||||
#define efi_call_virt(f, ...) \
|
||||
({ \
|
||||
efi_status_t __s; \
|
||||
@@ -71,7 +83,20 @@ extern u64 asmlinkage efi_call(void *fp, ...);
|
||||
efi_sync_low_kernel_mappings(); \
|
||||
preempt_disable(); \
|
||||
__kernel_fpu_begin(); \
|
||||
+ \
|
||||
+ if (efi_scratch.use_pgd) { \
|
||||
+ efi_scratch.prev_cr3 = read_cr3(); \
|
||||
+ write_cr3((unsigned long)efi_scratch.efi_pgt); \
|
||||
+ __flush_tlb_all(); \
|
||||
+ } \
|
||||
+ \
|
||||
__s = efi_call((void *)efi.systab->runtime->f, __VA_ARGS__); \
|
||||
+ \
|
||||
+ if (efi_scratch.use_pgd) { \
|
||||
+ write_cr3(efi_scratch.prev_cr3); \
|
||||
+ __flush_tlb_all(); \
|
||||
+ } \
|
||||
+ \
|
||||
__kernel_fpu_end(); \
|
||||
preempt_enable(); \
|
||||
__s; \
|
||||
diff --git a/arch/x86/platform/efi/efi_64.c b/arch/x86/platform/efi/efi_64.c
|
||||
index 102976dda8c4..b19cdac959b2 100644
|
||||
--- a/arch/x86/platform/efi/efi_64.c
|
||||
+++ b/arch/x86/platform/efi/efi_64.c
|
||||
@@ -47,16 +47,7 @@
|
||||
*/
|
||||
static u64 efi_va = EFI_VA_START;
|
||||
|
||||
-/*
|
||||
- * Scratch space used for switching the pagetable in the EFI stub
|
||||
- */
|
||||
-struct efi_scratch {
|
||||
- u64 r15;
|
||||
- u64 prev_cr3;
|
||||
- pgd_t *efi_pgt;
|
||||
- bool use_pgd;
|
||||
- u64 phys_stack;
|
||||
-} __packed;
|
||||
+struct efi_scratch efi_scratch;
|
||||
|
||||
static void __init early_code_mapping_set_exec(int executable)
|
||||
{
|
||||
@@ -83,8 +74,11 @@ pgd_t * __init efi_call_phys_prolog(void)
|
||||
int pgd;
|
||||
int n_pgds;
|
||||
|
||||
- if (!efi_enabled(EFI_OLD_MEMMAP))
|
||||
- return NULL;
|
||||
+ if (!efi_enabled(EFI_OLD_MEMMAP)) {
|
||||
+ save_pgd = (pgd_t *)read_cr3();
|
||||
+ write_cr3((unsigned long)efi_scratch.efi_pgt);
|
||||
+ goto out;
|
||||
+ }
|
||||
|
||||
early_code_mapping_set_exec(1);
|
||||
|
||||
@@ -96,6 +90,7 @@ pgd_t * __init efi_call_phys_prolog(void)
|
||||
vaddress = (unsigned long)__va(pgd * PGDIR_SIZE);
|
||||
set_pgd(pgd_offset_k(pgd * PGDIR_SIZE), *pgd_offset_k(vaddress));
|
||||
}
|
||||
+out:
|
||||
__flush_tlb_all();
|
||||
|
||||
return save_pgd;
|
||||
@@ -109,8 +104,11 @@ void __init efi_call_phys_epilog(pgd_t *save_pgd)
|
||||
int pgd_idx;
|
||||
int nr_pgds;
|
||||
|
||||
- if (!save_pgd)
|
||||
+ if (!efi_enabled(EFI_OLD_MEMMAP)) {
|
||||
+ write_cr3((unsigned long)save_pgd);
|
||||
+ __flush_tlb_all();
|
||||
return;
|
||||
+ }
|
||||
|
||||
nr_pgds = DIV_ROUND_UP((max_pfn << PAGE_SHIFT) , PGDIR_SIZE);
|
||||
|
||||
diff --git a/arch/x86/platform/efi/efi_stub_64.S b/arch/x86/platform/efi/efi_stub_64.S
|
||||
index 86d0f9e08dd9..32020cb8bb08 100644
|
||||
--- a/arch/x86/platform/efi/efi_stub_64.S
|
||||
+++ b/arch/x86/platform/efi/efi_stub_64.S
|
||||
@@ -38,41 +38,6 @@
|
||||
mov %rsi, %cr0; \
|
||||
mov (%rsp), %rsp
|
||||
|
||||
- /* stolen from gcc */
|
||||
- .macro FLUSH_TLB_ALL
|
||||
- movq %r15, efi_scratch(%rip)
|
||||
- movq %r14, efi_scratch+8(%rip)
|
||||
- movq %cr4, %r15
|
||||
- movq %r15, %r14
|
||||
- andb $0x7f, %r14b
|
||||
- movq %r14, %cr4
|
||||
- movq %r15, %cr4
|
||||
- movq efi_scratch+8(%rip), %r14
|
||||
- movq efi_scratch(%rip), %r15
|
||||
- .endm
|
||||
-
|
||||
- .macro SWITCH_PGT
|
||||
- cmpb $0, efi_scratch+24(%rip)
|
||||
- je 1f
|
||||
- movq %r15, efi_scratch(%rip) # r15
|
||||
- # save previous CR3
|
||||
- movq %cr3, %r15
|
||||
- movq %r15, efi_scratch+8(%rip) # prev_cr3
|
||||
- movq efi_scratch+16(%rip), %r15 # EFI pgt
|
||||
- movq %r15, %cr3
|
||||
- 1:
|
||||
- .endm
|
||||
-
|
||||
- .macro RESTORE_PGT
|
||||
- cmpb $0, efi_scratch+24(%rip)
|
||||
- je 2f
|
||||
- movq efi_scratch+8(%rip), %r15
|
||||
- movq %r15, %cr3
|
||||
- movq efi_scratch(%rip), %r15
|
||||
- FLUSH_TLB_ALL
|
||||
- 2:
|
||||
- .endm
|
||||
-
|
||||
ENTRY(efi_call)
|
||||
SAVE_XMM
|
||||
mov (%rsp), %rax
|
||||
@@ -83,16 +48,8 @@ ENTRY(efi_call)
|
||||
mov %r8, %r9
|
||||
mov %rcx, %r8
|
||||
mov %rsi, %rcx
|
||||
- SWITCH_PGT
|
||||
call *%rdi
|
||||
- RESTORE_PGT
|
||||
addq $48, %rsp
|
||||
RESTORE_XMM
|
||||
ret
|
||||
ENDPROC(efi_call)
|
||||
-
|
||||
- .data
|
||||
-ENTRY(efi_scratch)
|
||||
- .fill 3,8,0
|
||||
- .byte 0
|
||||
- .quad 0
|
|
@ -1,71 +0,0 @@
|
|||
From: Matt Fleming <matt@codeblueprint.co.uk>
|
||||
Date: Fri, 27 Nov 2015 21:09:32 +0000
|
||||
Subject: [3/5] x86/efi: Map RAM into the identity page table for mixed mode
|
||||
Origin: https://git.kernel.org/cgit/linux/kernel/git/mfleming/efi.git/commit?id=b61a76f8850d2979550abc42d7e09154ebb8d785
|
||||
|
||||
We are relying on the pre-existing mappings in 'trampoline_pgd'
|
||||
when accessing function arguments in the EFI mixed mode thunking
|
||||
code.
|
||||
|
||||
Instead let's map memory explicitly so that things will continue
|
||||
to work when we move to a separate page table in the future.
|
||||
|
||||
Signed-off-by: Matt Fleming <matt@codeblueprint.co.uk>
|
||||
Reviewed-by: Borislav Petkov <bp@suse.de>
|
||||
Acked-by: Borislav Petkov <bp@suse.de>
|
||||
Cc: Andy Lutomirski <luto@amacapital.net>
|
||||
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
|
||||
Cc: Borislav Petkov <bp@alien8.de>
|
||||
Cc: Brian Gerst <brgerst@gmail.com>
|
||||
Cc: Denys Vlasenko <dvlasenk@redhat.com>
|
||||
Cc: H. Peter Anvin <hpa@zytor.com>
|
||||
Cc: Linus Torvalds <torvalds@linux-foundation.org>
|
||||
Cc: Peter Zijlstra <peterz@infradead.org>
|
||||
Cc: Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>
|
||||
Cc: Thomas Gleixner <tglx@linutronix.de>
|
||||
Cc: Toshi Kani <toshi.kani@hp.com>
|
||||
Cc: linux-efi@vger.kernel.org
|
||||
Link: http://lkml.kernel.org/r/1448658575-17029-4-git-send-email-matt@codeblueprint.co.uk
|
||||
Signed-off-by: Ingo Molnar <mingo@kernel.org>
|
||||
---
|
||||
arch/x86/platform/efi/efi_64.c | 20 ++++++++++++++++++++
|
||||
1 file changed, 20 insertions(+)
|
||||
|
||||
diff --git a/arch/x86/platform/efi/efi_64.c b/arch/x86/platform/efi/efi_64.c
|
||||
index 5aa186db59e3..102976dda8c4 100644
|
||||
--- a/arch/x86/platform/efi/efi_64.c
|
||||
+++ b/arch/x86/platform/efi/efi_64.c
|
||||
@@ -144,6 +144,7 @@ void efi_sync_low_kernel_mappings(void)
|
||||
int __init efi_setup_page_tables(unsigned long pa_memmap, unsigned num_pages)
|
||||
{
|
||||
unsigned long pfn, text;
|
||||
+ efi_memory_desc_t *md;
|
||||
struct page *page;
|
||||
unsigned npages;
|
||||
pgd_t *pgd;
|
||||
@@ -177,6 +178,25 @@ int __init efi_setup_page_tables(unsigned long pa_memmap, unsigned num_pages)
|
||||
if (!IS_ENABLED(CONFIG_EFI_MIXED))
|
||||
return 0;
|
||||
|
||||
+ /*
|
||||
+ * Map all of RAM so that we can access arguments in the 1:1
|
||||
+ * mapping when making EFI runtime calls.
|
||||
+ */
|
||||
+ for_each_efi_memory_desc(&memmap, md) {
|
||||
+ if (md->type != EFI_CONVENTIONAL_MEMORY &&
|
||||
+ md->type != EFI_LOADER_DATA &&
|
||||
+ md->type != EFI_LOADER_CODE)
|
||||
+ continue;
|
||||
+
|
||||
+ pfn = md->phys_addr >> PAGE_SHIFT;
|
||||
+ npages = md->num_pages;
|
||||
+
|
||||
+ if (kernel_map_pages_in_pgd(pgd, pfn, md->phys_addr, npages, 0)) {
|
||||
+ pr_err("Failed to map 1:1 memory\n");
|
||||
+ return 1;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
page = alloc_page(GFP_KERNEL|__GFP_DMA32);
|
||||
if (!page)
|
||||
panic("Unable to allocate EFI runtime stack < 4GB\n");
|
|
@ -1,83 +0,0 @@
|
|||
From: Matt Fleming <matt@codeblueprint.co.uk>
|
||||
Date: Thu, 21 Jan 2016 14:11:59 +0000
|
||||
Subject: x86/efi: Setup separate EFI page tables in kexec paths
|
||||
Origin: https://git.kernel.org/cgit/linux/kernel/git/mfleming/efi.git/commit?id=753b11ef8e92a1c1bbe97f2a5ec14bdd1ef2e6fe
|
||||
|
||||
The switch to using a new dedicated page table for EFI runtime
|
||||
calls in commit commit 67a9108ed431 ("x86/efi: Build our own
|
||||
page table structures") failed to take into account changes
|
||||
required for the kexec code paths, which are unfortunately
|
||||
duplicated in the EFI code.
|
||||
|
||||
Call the allocation and setup functions in
|
||||
kexec_enter_virtual_mode() just like we do for
|
||||
__efi_enter_virtual_mode() to avoid hitting NULL-pointer
|
||||
dereferences when making EFI runtime calls.
|
||||
|
||||
At the very least, the call to efi_setup_page_tables() should
|
||||
have existed for kexec before the following commit:
|
||||
|
||||
67a9108ed431 ("x86/efi: Build our own page table structures")
|
||||
|
||||
Things just magically worked because we were actually using
|
||||
the kernel's page tables that contained the required mappings.
|
||||
|
||||
Reported-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
|
||||
Tested-by: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
|
||||
Signed-off-by: Matt Fleming <matt@codeblueprint.co.uk>
|
||||
Cc: Andy Lutomirski <luto@amacapital.net>
|
||||
Cc: Borislav Petkov <bp@alien8.de>
|
||||
Cc: Brian Gerst <brgerst@gmail.com>
|
||||
Cc: Dave Young <dyoung@redhat.com>
|
||||
Cc: Denys Vlasenko <dvlasenk@redhat.com>
|
||||
Cc: H. Peter Anvin <hpa@zytor.com>
|
||||
Cc: Linus Torvalds <torvalds@linux-foundation.org>
|
||||
Cc: Peter Zijlstra <peterz@infradead.org>
|
||||
Cc: Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>
|
||||
Cc: Thomas Gleixner <tglx@linutronix.de>
|
||||
Link: http://lkml.kernel.org/r/1453385519-11477-1-git-send-email-matt@codeblueprint.co.uk
|
||||
Signed-off-by: Ingo Molnar <mingo@kernel.org>
|
||||
---
|
||||
arch/x86/platform/efi/efi.c | 15 +++++++++++++++
|
||||
1 file changed, 15 insertions(+)
|
||||
|
||||
diff --git a/arch/x86/platform/efi/efi.c b/arch/x86/platform/efi/efi.c
|
||||
index 3c1f3cd7b2ba..bdd9477f937c 100644
|
||||
--- a/arch/x86/platform/efi/efi.c
|
||||
+++ b/arch/x86/platform/efi/efi.c
|
||||
@@ -815,6 +815,7 @@ static void __init kexec_enter_virtual_mode(void)
|
||||
{
|
||||
#ifdef CONFIG_KEXEC_CORE
|
||||
efi_memory_desc_t *md;
|
||||
+ unsigned int num_pages;
|
||||
void *p;
|
||||
|
||||
efi.systab = NULL;
|
||||
@@ -829,6 +830,12 @@ static void __init kexec_enter_virtual_mode(void)
|
||||
return;
|
||||
}
|
||||
|
||||
+ if (efi_alloc_page_tables()) {
|
||||
+ pr_err("Failed to allocate EFI page tables\n");
|
||||
+ clear_bit(EFI_RUNTIME_SERVICES, &efi.flags);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
/*
|
||||
* Map efi regions which were passed via setup_data. The virt_addr is a
|
||||
* fixed addr which was used in first kernel of a kexec boot.
|
||||
@@ -843,6 +850,14 @@ static void __init kexec_enter_virtual_mode(void)
|
||||
|
||||
BUG_ON(!efi.systab);
|
||||
|
||||
+ num_pages = ALIGN(memmap.nr_map * memmap.desc_size, PAGE_SIZE);
|
||||
+ num_pages >>= PAGE_SHIFT;
|
||||
+
|
||||
+ if (efi_setup_page_tables(memmap.phys_map, num_pages)) {
|
||||
+ clear_bit(EFI_RUNTIME_SERVICES, &efi.flags);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
efi_sync_low_kernel_mappings();
|
||||
|
||||
/*
|
|
@ -1,80 +0,0 @@
|
|||
From: Hector Marco-Gisbert <hecmargi@upv.es>
|
||||
Date: Thu, 10 Mar 2016 20:51:00 +0100
|
||||
Subject: x86/mm/32: Enable full randomization on i386 and X86_32
|
||||
Origin: https://git.kernel.org/linus/8b8addf891de8a00e4d39fc32f93f7c5eb8feceb
|
||||
|
||||
Currently on i386 and on X86_64 when emulating X86_32 in legacy mode, only
|
||||
the stack and the executable are randomized but not other mmapped files
|
||||
(libraries, vDSO, etc.). This patch enables randomization for the
|
||||
libraries, vDSO and mmap requests on i386 and in X86_32 in legacy mode.
|
||||
|
||||
By default on i386 there are 8 bits for the randomization of the libraries,
|
||||
vDSO and mmaps which only uses 1MB of VA.
|
||||
|
||||
This patch preserves the original randomness, using 1MB of VA out of 3GB or
|
||||
4GB. We think that 1MB out of 3GB is not a big cost for having the ASLR.
|
||||
|
||||
The first obvious security benefit is that all objects are randomized (not
|
||||
only the stack and the executable) in legacy mode which highly increases
|
||||
the ASLR effectiveness, otherwise the attackers may use these
|
||||
non-randomized areas. But also sensitive setuid/setgid applications are
|
||||
more secure because currently, attackers can disable the randomization of
|
||||
these applications by setting the ulimit stack to "unlimited". This is a
|
||||
very old and widely known trick to disable the ASLR in i386 which has been
|
||||
allowed for too long.
|
||||
|
||||
Another trick used to disable the ASLR was to set the ADDR_NO_RANDOMIZE
|
||||
personality flag, but fortunately this doesn't work on setuid/setgid
|
||||
applications because there is security checks which clear Security-relevant
|
||||
flags.
|
||||
|
||||
This patch always randomizes the mmap_legacy_base address, removing the
|
||||
possibility to disable the ASLR by setting the stack to "unlimited".
|
||||
|
||||
Signed-off-by: Hector Marco-Gisbert <hecmargi@upv.es>
|
||||
Acked-by: Ismael Ripoll Ripoll <iripoll@upv.es>
|
||||
Acked-by: Kees Cook <keescook@chromium.org>
|
||||
Acked-by: Arjan van de Ven <arjan@linux.intel.com>
|
||||
Cc: Linus Torvalds <torvalds@linux-foundation.org>
|
||||
Cc: Peter Zijlstra <peterz@infradead.org>
|
||||
Cc: Thomas Gleixner <tglx@linutronix.de>
|
||||
Cc: akpm@linux-foundation.org
|
||||
Cc: kees Cook <keescook@chromium.org>
|
||||
Link: http://lkml.kernel.org/r/1457639460-5242-1-git-send-email-hecmargi@upv.es
|
||||
Signed-off-by: Ingo Molnar <mingo@kernel.org>
|
||||
---
|
||||
arch/x86/mm/mmap.c | 14 +-------------
|
||||
1 file changed, 1 insertion(+), 13 deletions(-)
|
||||
|
||||
diff --git a/arch/x86/mm/mmap.c b/arch/x86/mm/mmap.c
|
||||
index 96bd1e2bffaf..389939f74dd5 100644
|
||||
--- a/arch/x86/mm/mmap.c
|
||||
+++ b/arch/x86/mm/mmap.c
|
||||
@@ -94,18 +94,6 @@ static unsigned long mmap_base(unsigned long rnd)
|
||||
}
|
||||
|
||||
/*
|
||||
- * Bottom-up (legacy) layout on X86_32 did not support randomization, X86_64
|
||||
- * does, but not when emulating X86_32
|
||||
- */
|
||||
-static unsigned long mmap_legacy_base(unsigned long rnd)
|
||||
-{
|
||||
- if (mmap_is_ia32())
|
||||
- return TASK_UNMAPPED_BASE;
|
||||
- else
|
||||
- return TASK_UNMAPPED_BASE + rnd;
|
||||
-}
|
||||
-
|
||||
-/*
|
||||
* This function, called very early during the creation of a new
|
||||
* process VM image, sets up which VM layout function to use:
|
||||
*/
|
||||
@@ -116,7 +104,7 @@ void arch_pick_mmap_layout(struct mm_struct *mm)
|
||||
if (current->flags & PF_RANDOMIZE)
|
||||
random_factor = arch_mmap_rnd();
|
||||
|
||||
- mm->mmap_legacy_base = mmap_legacy_base(random_factor);
|
||||
+ mm->mmap_legacy_base = TASK_UNMAPPED_BASE + random_factor;
|
||||
|
||||
if (mmap_is_legacy()) {
|
||||
mm->mmap_base = mm->mmap_legacy_base;
|
|
@ -1,53 +0,0 @@
|
|||
From: Matt Fleming <matt@codeblueprint.co.uk>
|
||||
Date: Fri, 27 Nov 2015 21:09:30 +0000
|
||||
Subject: [1/5] x86/mm: Page align the '_end' symbol to avoid pfn conversion
|
||||
bugs
|
||||
Origin: https://git.kernel.org/cgit/linux/kernel/git/mfleming/efi.git/commit?id=21cdb6b568435738cc0b303b2b3b82742396310c
|
||||
|
||||
Ingo noted that if we can guarantee _end is aligned to PAGE_SIZE
|
||||
we can automatically avoid bugs along the lines of,
|
||||
|
||||
size = _end - _text >> PAGE_SHIFT
|
||||
|
||||
which is missing a call to PFN_ALIGN(). The EFI mixed mode
|
||||
contains this bug, for example.
|
||||
|
||||
_text is already aligned to PAGE_SIZE through the use of
|
||||
LOAD_PHYSICAL_ADDR, and the BSS and BRK sections are explicitly
|
||||
aligned in the linker script, so it makes sense to align _end to
|
||||
match.
|
||||
|
||||
Reported-by: Ingo Molnar <mingo@kernel.org>
|
||||
Signed-off-by: Matt Fleming <matt@codeblueprint.co.uk>
|
||||
Acked-by: Borislav Petkov <bp@suse.de>
|
||||
Cc: Andy Lutomirski <luto@amacapital.net>
|
||||
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
|
||||
Cc: Borislav Petkov <bp@alien8.de>
|
||||
Cc: Brian Gerst <brgerst@gmail.com>
|
||||
Cc: Dave Hansen <dave.hansen@intel.com>
|
||||
Cc: Denys Vlasenko <dvlasenk@redhat.com>
|
||||
Cc: H. Peter Anvin <hpa@zytor.com>
|
||||
Cc: Linus Torvalds <torvalds@linux-foundation.org>
|
||||
Cc: Peter Zijlstra <peterz@infradead.org>
|
||||
Cc: Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>
|
||||
Cc: Thomas Gleixner <tglx@linutronix.de>
|
||||
Cc: Toshi Kani <toshi.kani@hp.com>
|
||||
Cc: linux-efi@vger.kernel.org
|
||||
Link: http://lkml.kernel.org/r/1448658575-17029-2-git-send-email-matt@codeblueprint.co.uk
|
||||
Signed-off-by: Ingo Molnar <mingo@kernel.org>
|
||||
---
|
||||
arch/x86/kernel/vmlinux.lds.S | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S
|
||||
index 74e4bf11f562..4f1994257a18 100644
|
||||
--- a/arch/x86/kernel/vmlinux.lds.S
|
||||
+++ b/arch/x86/kernel/vmlinux.lds.S
|
||||
@@ -325,6 +325,7 @@ SECTIONS
|
||||
__brk_limit = .;
|
||||
}
|
||||
|
||||
+ . = ALIGN(PAGE_SIZE);
|
||||
_end = .;
|
||||
|
||||
STABS_DEBUG
|
|
@ -1,144 +0,0 @@
|
|||
From: Matt Fleming <matt@codeblueprint.co.uk>
|
||||
Date: Fri, 27 Nov 2015 21:09:31 +0000
|
||||
Subject: [2/5] x86/mm/pat: Ensure cpa->pfn only contains page frame numbers
|
||||
Origin: https://git.kernel.org/cgit/linux/kernel/git/mfleming/efi.git/commit?id=edc3b9129cecd0f0857112136f5b8b1bc1d45918
|
||||
|
||||
The x86 pageattr code is confused about the data that is stored
|
||||
in cpa->pfn, sometimes it's treated as a page frame number,
|
||||
sometimes it's treated as an unshifted physical address, and in
|
||||
one place it's treated as a pte.
|
||||
|
||||
The result of this is that the mapping functions do not map the
|
||||
intended physical address.
|
||||
|
||||
This isn't a problem in practice because most of the addresses
|
||||
we're mapping in the EFI code paths are already mapped in
|
||||
'trampoline_pgd' and so the pageattr mapping functions don't
|
||||
actually do anything in this case. But when we move to using a
|
||||
separate page table for the EFI runtime this will be an issue.
|
||||
|
||||
Signed-off-by: Matt Fleming <matt@codeblueprint.co.uk>
|
||||
Reviewed-by: Borislav Petkov <bp@suse.de>
|
||||
Acked-by: Borislav Petkov <bp@suse.de>
|
||||
Cc: Andy Lutomirski <luto@amacapital.net>
|
||||
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
|
||||
Cc: Borislav Petkov <bp@alien8.de>
|
||||
Cc: Brian Gerst <brgerst@gmail.com>
|
||||
Cc: Dave Hansen <dave.hansen@intel.com>
|
||||
Cc: Denys Vlasenko <dvlasenk@redhat.com>
|
||||
Cc: H. Peter Anvin <hpa@zytor.com>
|
||||
Cc: Linus Torvalds <torvalds@linux-foundation.org>
|
||||
Cc: Peter Zijlstra <peterz@infradead.org>
|
||||
Cc: Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com>
|
||||
Cc: Thomas Gleixner <tglx@linutronix.de>
|
||||
Cc: Toshi Kani <toshi.kani@hp.com>
|
||||
Cc: linux-efi@vger.kernel.org
|
||||
Link: http://lkml.kernel.org/r/1448658575-17029-3-git-send-email-matt@codeblueprint.co.uk
|
||||
Signed-off-by: Ingo Molnar <mingo@kernel.org>
|
||||
---
|
||||
arch/x86/mm/pageattr.c | 17 ++++++-----------
|
||||
arch/x86/platform/efi/efi_64.c | 16 ++++++++++------
|
||||
2 files changed, 16 insertions(+), 17 deletions(-)
|
||||
|
||||
diff --git a/arch/x86/mm/pageattr.c b/arch/x86/mm/pageattr.c
|
||||
index a3137a4feed1..c70e42014101 100644
|
||||
--- a/arch/x86/mm/pageattr.c
|
||||
+++ b/arch/x86/mm/pageattr.c
|
||||
@@ -905,15 +905,10 @@ static void populate_pte(struct cpa_data *cpa,
|
||||
pte = pte_offset_kernel(pmd, start);
|
||||
|
||||
while (num_pages-- && start < end) {
|
||||
-
|
||||
- /* deal with the NX bit */
|
||||
- if (!(pgprot_val(pgprot) & _PAGE_NX))
|
||||
- cpa->pfn &= ~_PAGE_NX;
|
||||
-
|
||||
- set_pte(pte, pfn_pte(cpa->pfn >> PAGE_SHIFT, pgprot));
|
||||
+ set_pte(pte, pfn_pte(cpa->pfn, pgprot));
|
||||
|
||||
start += PAGE_SIZE;
|
||||
- cpa->pfn += PAGE_SIZE;
|
||||
+ cpa->pfn++;
|
||||
pte++;
|
||||
}
|
||||
}
|
||||
@@ -969,11 +964,11 @@ static int populate_pmd(struct cpa_data *cpa,
|
||||
|
||||
pmd = pmd_offset(pud, start);
|
||||
|
||||
- set_pmd(pmd, __pmd(cpa->pfn | _PAGE_PSE |
|
||||
+ set_pmd(pmd, __pmd(cpa->pfn << PAGE_SHIFT | _PAGE_PSE |
|
||||
massage_pgprot(pmd_pgprot)));
|
||||
|
||||
start += PMD_SIZE;
|
||||
- cpa->pfn += PMD_SIZE;
|
||||
+ cpa->pfn += PMD_SIZE >> PAGE_SHIFT;
|
||||
cur_pages += PMD_SIZE >> PAGE_SHIFT;
|
||||
}
|
||||
|
||||
@@ -1042,11 +1037,11 @@ static int populate_pud(struct cpa_data *cpa, unsigned long start, pgd_t *pgd,
|
||||
* Map everything starting from the Gb boundary, possibly with 1G pages
|
||||
*/
|
||||
while (end - start >= PUD_SIZE) {
|
||||
- set_pud(pud, __pud(cpa->pfn | _PAGE_PSE |
|
||||
+ set_pud(pud, __pud(cpa->pfn << PAGE_SHIFT | _PAGE_PSE |
|
||||
massage_pgprot(pud_pgprot)));
|
||||
|
||||
start += PUD_SIZE;
|
||||
- cpa->pfn += PUD_SIZE;
|
||||
+ cpa->pfn += PUD_SIZE >> PAGE_SHIFT;
|
||||
cur_pages += PUD_SIZE >> PAGE_SHIFT;
|
||||
pud++;
|
||||
}
|
||||
diff --git a/arch/x86/platform/efi/efi_64.c b/arch/x86/platform/efi/efi_64.c
|
||||
index a0ac0f9c307f..5aa186db59e3 100644
|
||||
--- a/arch/x86/platform/efi/efi_64.c
|
||||
+++ b/arch/x86/platform/efi/efi_64.c
|
||||
@@ -143,7 +143,7 @@ void efi_sync_low_kernel_mappings(void)
|
||||
|
||||
int __init efi_setup_page_tables(unsigned long pa_memmap, unsigned num_pages)
|
||||
{
|
||||
- unsigned long text;
|
||||
+ unsigned long pfn, text;
|
||||
struct page *page;
|
||||
unsigned npages;
|
||||
pgd_t *pgd;
|
||||
@@ -160,7 +160,8 @@ int __init efi_setup_page_tables(unsigned long pa_memmap, unsigned num_pages)
|
||||
* and ident-map those pages containing the map before calling
|
||||
* phys_efi_set_virtual_address_map().
|
||||
*/
|
||||
- if (kernel_map_pages_in_pgd(pgd, pa_memmap, pa_memmap, num_pages, _PAGE_NX)) {
|
||||
+ pfn = pa_memmap >> PAGE_SHIFT;
|
||||
+ if (kernel_map_pages_in_pgd(pgd, pfn, pa_memmap, num_pages, _PAGE_NX)) {
|
||||
pr_err("Error ident-mapping new memmap (0x%lx)!\n", pa_memmap);
|
||||
return 1;
|
||||
}
|
||||
@@ -185,8 +186,9 @@ int __init efi_setup_page_tables(unsigned long pa_memmap, unsigned num_pages)
|
||||
|
||||
npages = (_end - _text) >> PAGE_SHIFT;
|
||||
text = __pa(_text);
|
||||
+ pfn = text >> PAGE_SHIFT;
|
||||
|
||||
- if (kernel_map_pages_in_pgd(pgd, text >> PAGE_SHIFT, text, npages, 0)) {
|
||||
+ if (kernel_map_pages_in_pgd(pgd, pfn, text, npages, 0)) {
|
||||
pr_err("Failed to map kernel text 1:1\n");
|
||||
return 1;
|
||||
}
|
||||
@@ -204,12 +206,14 @@ void __init efi_cleanup_page_tables(unsigned long pa_memmap, unsigned num_pages)
|
||||
static void __init __map_region(efi_memory_desc_t *md, u64 va)
|
||||
{
|
||||
pgd_t *pgd = (pgd_t *)__va(real_mode_header->trampoline_pgd);
|
||||
- unsigned long pf = 0;
|
||||
+ unsigned long flags = 0;
|
||||
+ unsigned long pfn;
|
||||
|
||||
if (!(md->attribute & EFI_MEMORY_WB))
|
||||
- pf |= _PAGE_PCD;
|
||||
+ flags |= _PAGE_PCD;
|
||||
|
||||
- if (kernel_map_pages_in_pgd(pgd, md->phys_addr, va, md->num_pages, pf))
|
||||
+ pfn = md->phys_addr >> PAGE_SHIFT;
|
||||
+ if (kernel_map_pages_in_pgd(pgd, pfn, va, md->num_pages, flags))
|
||||
pr_warn("Error mapping PA 0x%llx -> VA 0x%llx!\n",
|
||||
md->phys_addr, va);
|
||||
}
|
|
@ -1,58 +0,0 @@
|
|||
From: Matt Fleming <matt@codeblueprint.co.uk>
|
||||
Date: Mon, 14 Mar 2016 10:33:01 +0000
|
||||
Subject: x86/mm/pat: Fix boot crash when 1GB pages are not supported by cpu
|
||||
Origin: http://mid.gmane.org/1457951581-27353-2-git-send-email-matt@codeblueprint.co.uk
|
||||
|
||||
Scott reports that with the new separate EFI page tables he's seeing
|
||||
the following error on boot, caused by setting reserved bits in the
|
||||
page table structures (fault code is PF_RSVD | PF_PROT),
|
||||
|
||||
swapper/0: Corrupted page table at address 17b102020
|
||||
PGD 17b0e5063 PUD 1400000e3
|
||||
Bad pagetable: 0009 [#1] SMP
|
||||
|
||||
On first inspection the PUD is using a 1GB page size (_PAGE_PSE) and
|
||||
looks fine but that's only true if support for 1GB PUD pages
|
||||
("pdpe1gb") is present in the cpu.
|
||||
|
||||
Scott's Intel Celeron N2820 does not have that feature and so the
|
||||
_PAGE_PSE bit is reserved. Fix this issue by making the 1GB mapping
|
||||
code in conditional on "cpu_has_gbpages".
|
||||
|
||||
This issue didn't come up in the past because the required mapping for
|
||||
the faulting address (0x17b102020) will already have been setup by the
|
||||
kernel in early boot before we got to efi_map_regions(), but we no
|
||||
longer use the standard kernel page tables during EFI calls.
|
||||
|
||||
Reported-by: Scott Ashcroft <scott.ashcroft@talk21.com>
|
||||
Tested-by: Scott Ashcroft <scott.ashcroft@talk21.com>
|
||||
Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
|
||||
Cc: Ben Hutchings <ben@decadent.org.uk>
|
||||
Cc: Borislav Petkov <bp@alien8.de>
|
||||
Cc: Brian Gerst <brgerst@gmail.com>
|
||||
Cc: Denys Vlasenko <dvlasenk@redhat.com>
|
||||
Cc: "H. Peter Anvin" <hpa@zytor.com>
|
||||
Cc: Linus Torvalds <torvalds@linux-foundation.org>
|
||||
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
|
||||
Cc: Matthew Garrett <mjg59@srcf.ucam.org>
|
||||
Cc: Peter Zijlstra <peterz@infradead.org>
|
||||
Cc: Raphael Hertzog <hertzog@debian.org>
|
||||
Cc: Roger Shimizu <rogershimizu@gmail.com>
|
||||
Cc: Thomas Gleixner <tglx@linutronix.de>
|
||||
Cc: linux-efi@vger.kernel.org
|
||||
Signed-off-by: Matt Fleming <matt@codeblueprint.co.uk>
|
||||
---
|
||||
arch/x86/mm/pageattr.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/arch/x86/mm/pageattr.c
|
||||
+++ b/arch/x86/mm/pageattr.c
|
||||
@@ -1036,7 +1036,7 @@ static int populate_pud(struct cpa_data
|
||||
/*
|
||||
* Map everything starting from the Gb boundary, possibly with 1G pages
|
||||
*/
|
||||
- while (end - start >= PUD_SIZE) {
|
||||
+ while (cpu_has_gbpages && end - start >= PUD_SIZE) {
|
||||
set_pud(pud, __pud(cpa->pfn << PAGE_SHIFT | _PAGE_PSE |
|
||||
massage_pgprot(pud_pgprot)));
|
||||
|
|
@ -14,7 +14,7 @@ use of $(ARCH) needs to be moved after this.
|
|||
|
||||
--- a/Makefile
|
||||
+++ b/Makefile
|
||||
@@ -195,42 +195,6 @@ export KBUILD_BUILDHOST := $(SUBARCH)
|
||||
@@ -251,42 +251,6 @@ SUBARCH := $(shell uname -m | sed -e s/i
|
||||
ARCH ?= $(SUBARCH)
|
||||
CROSS_COMPILE ?= $(CONFIG_CROSS_COMPILE:"%"=%)
|
||||
|
||||
|
@ -57,9 +57,9 @@ use of $(ARCH) needs to be moved after this.
|
|||
KCONFIG_CONFIG ?= .config
|
||||
export KCONFIG_CONFIG
|
||||
|
||||
@@ -349,6 +313,44 @@ CFLAGS_KERNEL =
|
||||
AFLAGS_KERNEL =
|
||||
@@ -367,6 +331,44 @@ AFLAGS_KERNEL =
|
||||
CFLAGS_GCOV = -fprofile-arcs -ftest-coverage
|
||||
CFLAGS_KCOV = -fsanitize-coverage=trace-pc
|
||||
|
||||
+-include $(obj)/.kernelvariables
|
||||
+
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
From: J. R. Okajima <hooanon05@yahoo.co.jp>
|
||||
Date: Wed Mar 16 17:10:20 2016 +0900
|
||||
Subject: aufs4.5 base patch
|
||||
Origin: https://github.com/sfjro/aufs4-standalone/tree/91164538a2f52c72b79a657ca3675cb55152413d
|
||||
Date: Wed Mar 23 20:35:31 2016 +0900
|
||||
Subject: aufs4.x-rcN base patch
|
||||
Origin: https://github.com/sfjro/aufs4-standalone/tree/751023bb49e09b10f7ab4c8742eb4cee234506f4
|
||||
Bug-Debian: https://bugs.debian.org/541828
|
||||
|
||||
Patch headers added by debian/patches/features/all/aufs4/gen-patch
|
||||
|
||||
aufs4.5 base patch
|
||||
aufs4.x-rcN base patch
|
||||
|
||||
diff --git a/MAINTAINERS b/MAINTAINERS
|
||||
index 6ee06ea..3147250 100644
|
||||
index f17159a..532681a 100644
|
||||
--- a/MAINTAINERS
|
||||
+++ b/MAINTAINERS
|
||||
@@ -2082,6 +2082,19 @@ F: include/linux/audit.h
|
||||
@@ -2120,6 +2120,19 @@ F: include/linux/audit.h
|
||||
F: include/uapi/linux/audit.h
|
||||
F: kernel/audit*
|
||||
|
||||
|
@ -62,7 +62,7 @@ index 423f4ca..0b816b2 100644
|
|||
|
||||
static ssize_t loop_attr_show(struct device *dev, char *page,
|
||||
diff --git a/fs/dcache.c b/fs/dcache.c
|
||||
index 2398f9f9..318c329 100644
|
||||
index 32ceae3..bc599d0 100644
|
||||
--- a/fs/dcache.c
|
||||
+++ b/fs/dcache.c
|
||||
@@ -1156,7 +1156,7 @@ enum d_walk_ret {
|
||||
|
@ -97,7 +97,7 @@ index 350a2c8..6f42279 100644
|
|||
return error;
|
||||
|
||||
diff --git a/fs/read_write.c b/fs/read_write.c
|
||||
index dadf24e..c8b5b7a 100644
|
||||
index cf377cf..0ebcdc5 100644
|
||||
--- a/fs/read_write.c
|
||||
+++ b/fs/read_write.c
|
||||
@@ -534,6 +534,28 @@ ssize_t __vfs_write(struct file *file, const char __user *p, size_t count,
|
||||
|
@ -130,10 +130,10 @@ index dadf24e..c8b5b7a 100644
|
|||
{
|
||||
mm_segment_t old_fs;
|
||||
diff --git a/fs/splice.c b/fs/splice.c
|
||||
index 82bc0d6..93aee51 100644
|
||||
index 9947b5c..9037c8c 100644
|
||||
--- a/fs/splice.c
|
||||
+++ b/fs/splice.c
|
||||
@@ -1108,8 +1108,8 @@ EXPORT_SYMBOL(generic_splice_sendpage);
|
||||
@@ -1111,8 +1111,8 @@ EXPORT_SYMBOL(generic_splice_sendpage);
|
||||
/*
|
||||
* Attempt to initiate a splice from pipe to file.
|
||||
*/
|
||||
|
@ -144,7 +144,7 @@ index 82bc0d6..93aee51 100644
|
|||
{
|
||||
ssize_t (*splice_write)(struct pipe_inode_info *, struct file *,
|
||||
loff_t *, size_t, unsigned int);
|
||||
@@ -1125,9 +1125,9 @@ static long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
|
||||
@@ -1128,9 +1128,9 @@ static long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
|
||||
/*
|
||||
* Attempt to initiate a splice from a file to a pipe.
|
||||
*/
|
||||
|
@ -170,10 +170,10 @@ index f87d308..9a290b3 100644
|
|||
static inline void fput_light(struct file *file, int fput_needed)
|
||||
{
|
||||
diff --git a/include/linux/fs.h b/include/linux/fs.h
|
||||
index ae68100..99fc2bd 100644
|
||||
index bb703ef..aff4f16 100644
|
||||
--- a/include/linux/fs.h
|
||||
+++ b/include/linux/fs.h
|
||||
@@ -1260,6 +1260,7 @@ extern void fasync_free(struct fasync_struct *);
|
||||
@@ -1261,6 +1261,7 @@ extern void fasync_free(struct fasync_struct *);
|
||||
/* can be called from interrupts */
|
||||
extern void kill_fasync(struct fasync_struct **, int, int);
|
||||
|
||||
|
@ -181,7 +181,7 @@ index ae68100..99fc2bd 100644
|
|||
extern void __f_setown(struct file *filp, struct pid *, enum pid_type, int force);
|
||||
extern void f_setown(struct file *filp, unsigned long arg, int force);
|
||||
extern void f_delown(struct file *filp);
|
||||
@@ -1646,6 +1647,7 @@ struct file_operations {
|
||||
@@ -1642,6 +1643,7 @@ struct file_operations {
|
||||
ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int);
|
||||
unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long);
|
||||
int (*check_flags)(int);
|
||||
|
@ -189,7 +189,7 @@ index ae68100..99fc2bd 100644
|
|||
int (*flock) (struct file *, int, struct file_lock *);
|
||||
ssize_t (*splice_write)(struct pipe_inode_info *, struct file *, loff_t *, size_t, unsigned int);
|
||||
ssize_t (*splice_read)(struct file *, loff_t *, struct pipe_inode_info *, size_t, unsigned int);
|
||||
@@ -1704,6 +1706,12 @@ ssize_t rw_copy_check_uvector(int type, const struct iovec __user * uvector,
|
||||
@@ -1700,6 +1702,12 @@ ssize_t rw_copy_check_uvector(int type, const struct iovec __user * uvector,
|
||||
struct iovec *fast_pointer,
|
||||
struct iovec **ret_pointer);
|
||||
|
||||
|
|
|
@ -1,18 +1,16 @@
|
|||
From: J. R. Okajima <hooanon05@yahoo.co.jp>
|
||||
Date: Wed Mar 16 17:10:20 2016 +0900
|
||||
Subject: aufs4.5 mmap patch
|
||||
Origin: https://github.com/sfjro/aufs4-standalone/tree/91164538a2f52c72b79a657ca3675cb55152413d
|
||||
Date: Wed Mar 23 20:35:31 2016 +0900
|
||||
Subject: aufs4.x-rcN mmap patch
|
||||
Origin: https://github.com/sfjro/aufs4-standalone/tree/751023bb49e09b10f7ab4c8742eb4cee234506f4
|
||||
Bug-Debian: https://bugs.debian.org/541828
|
||||
|
||||
Patch headers added by debian/patches/features/all/aufs4/gen-patch
|
||||
|
||||
aufs4.5 mmap patch
|
||||
aufs4.x-rcN mmap patch
|
||||
|
||||
diff --git a/fs/proc/base.c b/fs/proc/base.c
|
||||
index 4f764c2..229de5e 100644
|
||||
--- a/fs/proc/base.c
|
||||
+++ b/fs/proc/base.c
|
||||
@@ -1933,7 +1933,7 @@ static int map_files_get_link(struct dentry *dentry, struct path *path)
|
||||
@@ -1933,7 +1933,7 @@ static int map_files_get_link(struct den
|
||||
down_read(&mm->mmap_sem);
|
||||
vma = find_exact_vma(mm, vm_start, vm_end);
|
||||
if (vma && vma->vm_file) {
|
||||
|
@ -21,11 +19,9 @@ index 4f764c2..229de5e 100644
|
|||
path_get(path);
|
||||
rc = 0;
|
||||
}
|
||||
diff --git a/fs/proc/nommu.c b/fs/proc/nommu.c
|
||||
index f8595e8..cb8eda0 100644
|
||||
--- a/fs/proc/nommu.c
|
||||
+++ b/fs/proc/nommu.c
|
||||
@@ -45,7 +45,10 @@ static int nommu_region_show(struct seq_file *m, struct vm_region *region)
|
||||
@@ -45,7 +45,10 @@ static int nommu_region_show(struct seq_
|
||||
file = region->vm_file;
|
||||
|
||||
if (file) {
|
||||
|
@ -37,11 +33,9 @@ index f8595e8..cb8eda0 100644
|
|||
dev = inode->i_sb->s_dev;
|
||||
ino = inode->i_ino;
|
||||
}
|
||||
diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
|
||||
index fa95ab2..d440354 100644
|
||||
--- a/fs/proc/task_mmu.c
|
||||
+++ b/fs/proc/task_mmu.c
|
||||
@@ -298,7 +298,10 @@ show_map_vma(struct seq_file *m, struct vm_area_struct *vma, int is_pid)
|
||||
@@ -298,7 +298,10 @@ show_map_vma(struct seq_file *m, struct
|
||||
const char *name = NULL;
|
||||
|
||||
if (file) {
|
||||
|
@ -53,7 +47,7 @@ index fa95ab2..d440354 100644
|
|||
dev = inode->i_sb->s_dev;
|
||||
ino = inode->i_ino;
|
||||
pgoff = ((loff_t)vma->vm_pgoff) << PAGE_SHIFT;
|
||||
@@ -1576,7 +1579,7 @@ static int show_numa_map(struct seq_file *m, void *v, int is_pid)
|
||||
@@ -1590,7 +1593,7 @@ static int show_numa_map(struct seq_file
|
||||
struct proc_maps_private *proc_priv = &numa_priv->proc_maps;
|
||||
struct vm_area_struct *vma = v;
|
||||
struct numa_maps *md = &numa_priv->md;
|
||||
|
@ -62,11 +56,9 @@ index fa95ab2..d440354 100644
|
|||
struct mm_struct *mm = vma->vm_mm;
|
||||
struct mm_walk walk = {
|
||||
.hugetlb_entry = gather_hugetlb_stats,
|
||||
diff --git a/fs/proc/task_nommu.c b/fs/proc/task_nommu.c
|
||||
index faacb0c..17b43be 100644
|
||||
--- a/fs/proc/task_nommu.c
|
||||
+++ b/fs/proc/task_nommu.c
|
||||
@@ -163,7 +163,10 @@ static int nommu_vma_show(struct seq_file *m, struct vm_area_struct *vma,
|
||||
@@ -163,7 +163,10 @@ static int nommu_vma_show(struct seq_fil
|
||||
file = vma->vm_file;
|
||||
|
||||
if (file) {
|
||||
|
@ -78,11 +70,9 @@ index faacb0c..17b43be 100644
|
|||
dev = inode->i_sb->s_dev;
|
||||
ino = inode->i_ino;
|
||||
pgoff = (loff_t)vma->vm_pgoff << PAGE_SHIFT;
|
||||
diff --git a/include/linux/mm.h b/include/linux/mm.h
|
||||
index 516e149..ddd5454 100644
|
||||
--- a/include/linux/mm.h
|
||||
+++ b/include/linux/mm.h
|
||||
@@ -1217,6 +1217,28 @@ static inline int fixup_user_fault(struct task_struct *tsk,
|
||||
@@ -1238,6 +1238,28 @@ static inline int fixup_user_fault(struc
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -111,8 +101,6 @@ index 516e149..ddd5454 100644
|
|||
extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write);
|
||||
extern int access_remote_vm(struct mm_struct *mm, unsigned long addr,
|
||||
void *buf, int len, int write);
|
||||
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
|
||||
index 624b78b..1be91c5 100644
|
||||
--- a/include/linux/mm_types.h
|
||||
+++ b/include/linux/mm_types.h
|
||||
@@ -269,6 +269,7 @@ struct vm_region {
|
||||
|
@ -125,17 +113,15 @@ index 624b78b..1be91c5 100644
|
|||
bool vm_icache_flushed : 1; /* true if the icache has been flushed for
|
||||
@@ -343,6 +344,7 @@ struct vm_area_struct {
|
||||
unsigned long vm_pgoff; /* Offset (within vm_file) in PAGE_SIZE
|
||||
units, *not* PAGE_CACHE_SIZE */
|
||||
units */
|
||||
struct file * vm_file; /* File we map to (can be NULL). */
|
||||
+ struct file *vm_prfile; /* shadow of vm_file */
|
||||
void * vm_private_data; /* was vm_pte (shared mem) */
|
||||
|
||||
#ifndef CONFIG_MMU
|
||||
diff --git a/kernel/fork.c b/kernel/fork.c
|
||||
index 2e391c7..6c4215c 100644
|
||||
--- a/kernel/fork.c
|
||||
+++ b/kernel/fork.c
|
||||
@@ -464,7 +464,7 @@ static int dup_mmap(struct mm_struct *mm, struct mm_struct *oldmm)
|
||||
@@ -475,7 +475,7 @@ static int dup_mmap(struct mm_struct *mm
|
||||
struct inode *inode = file_inode(file);
|
||||
struct address_space *mapping = file->f_mapping;
|
||||
|
||||
|
@ -144,11 +130,9 @@ index 2e391c7..6c4215c 100644
|
|||
if (tmp->vm_flags & VM_DENYWRITE)
|
||||
atomic_dec(&inode->i_writecount);
|
||||
i_mmap_lock_write(mapping);
|
||||
diff --git a/mm/Makefile b/mm/Makefile
|
||||
index 2ed4319..e3a53f5 100644
|
||||
--- a/mm/Makefile
|
||||
+++ b/mm/Makefile
|
||||
@@ -21,7 +21,7 @@ obj-y := filemap.o mempool.o oom_kill.o \
|
||||
@@ -37,7 +37,7 @@ obj-y := filemap.o mempool.o oom_kill.
|
||||
mm_init.o mmu_context.o percpu.o slab_common.o \
|
||||
compaction.o vmacache.o \
|
||||
interval_tree.o list_lru.o workingset.o \
|
||||
|
@ -157,11 +141,9 @@ index 2ed4319..e3a53f5 100644
|
|||
|
||||
obj-y += init-mm.o
|
||||
|
||||
diff --git a/mm/filemap.c b/mm/filemap.c
|
||||
index da7a35d..f800f87 100644
|
||||
--- a/mm/filemap.c
|
||||
+++ b/mm/filemap.c
|
||||
@@ -2229,7 +2229,7 @@ int filemap_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
|
||||
@@ -2211,7 +2211,7 @@ int filemap_page_mkwrite(struct vm_area_
|
||||
int ret = VM_FAULT_LOCKED;
|
||||
|
||||
sb_start_pagefault(inode->i_sb);
|
||||
|
@ -170,11 +152,9 @@ index da7a35d..f800f87 100644
|
|||
lock_page(page);
|
||||
if (page->mapping != inode->i_mapping) {
|
||||
unlock_page(page);
|
||||
diff --git a/mm/memory.c b/mm/memory.c
|
||||
index 8132787..3f7de66 100644
|
||||
--- a/mm/memory.c
|
||||
+++ b/mm/memory.c
|
||||
@@ -2042,7 +2042,7 @@ static inline int wp_page_reuse(struct mm_struct *mm,
|
||||
@@ -2065,7 +2065,7 @@ static inline int wp_page_reuse(struct m
|
||||
}
|
||||
|
||||
if (!page_mkwrite)
|
||||
|
@ -183,11 +163,9 @@ index 8132787..3f7de66 100644
|
|||
}
|
||||
|
||||
return VM_FAULT_WRITE;
|
||||
diff --git a/mm/mmap.c b/mm/mmap.c
|
||||
index 76d1ec2..fdd163e 100644
|
||||
--- a/mm/mmap.c
|
||||
+++ b/mm/mmap.c
|
||||
@@ -290,7 +290,7 @@ static struct vm_area_struct *remove_vma(struct vm_area_struct *vma)
|
||||
@@ -166,7 +166,7 @@ static struct vm_area_struct *remove_vma
|
||||
if (vma->vm_ops && vma->vm_ops->close)
|
||||
vma->vm_ops->close(vma);
|
||||
if (vma->vm_file)
|
||||
|
@ -196,7 +174,7 @@ index 76d1ec2..fdd163e 100644
|
|||
mpol_put(vma_policy(vma));
|
||||
kmem_cache_free(vm_area_cachep, vma);
|
||||
return next;
|
||||
@@ -909,7 +909,7 @@ again: remove_next = 1 + (end > next->vm_end);
|
||||
@@ -785,7 +785,7 @@ again: remove_next = 1 + (end > next->
|
||||
if (remove_next) {
|
||||
if (file) {
|
||||
uprobe_munmap(next, next->vm_start, next->vm_end);
|
||||
|
@ -205,7 +183,7 @@ index 76d1ec2..fdd163e 100644
|
|||
}
|
||||
if (next->anon_vma)
|
||||
anon_vma_merge(vma, next);
|
||||
@@ -1683,8 +1683,8 @@ out:
|
||||
@@ -1566,8 +1566,8 @@ out:
|
||||
return addr;
|
||||
|
||||
unmap_and_free_vma:
|
||||
|
@ -215,7 +193,7 @@ index 76d1ec2..fdd163e 100644
|
|||
|
||||
/* Undo any partial mapping done by a device driver. */
|
||||
unmap_region(mm, vma, prev, vma->vm_start, vma->vm_end);
|
||||
@@ -2479,7 +2479,7 @@ static int __split_vma(struct mm_struct *mm, struct vm_area_struct *vma,
|
||||
@@ -2362,7 +2362,7 @@ static int __split_vma(struct mm_struct
|
||||
goto out_free_mpol;
|
||||
|
||||
if (new->vm_file)
|
||||
|
@ -224,7 +202,7 @@ index 76d1ec2..fdd163e 100644
|
|||
|
||||
if (new->vm_ops && new->vm_ops->open)
|
||||
new->vm_ops->open(new);
|
||||
@@ -2498,7 +2498,7 @@ static int __split_vma(struct mm_struct *mm, struct vm_area_struct *vma,
|
||||
@@ -2381,7 +2381,7 @@ static int __split_vma(struct mm_struct
|
||||
if (new->vm_ops && new->vm_ops->close)
|
||||
new->vm_ops->close(new);
|
||||
if (new->vm_file)
|
||||
|
@ -233,15 +211,15 @@ index 76d1ec2..fdd163e 100644
|
|||
unlink_anon_vmas(new);
|
||||
out_free_mpol:
|
||||
mpol_put(vma_policy(new));
|
||||
@@ -2640,7 +2640,6 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size,
|
||||
@@ -2523,7 +2523,6 @@ SYSCALL_DEFINE5(remap_file_pages, unsign
|
||||
struct vm_area_struct *vma;
|
||||
unsigned long populate = 0;
|
||||
unsigned long ret = -EINVAL;
|
||||
- struct file *file;
|
||||
|
||||
pr_warn_once("%s (%d) uses deprecated remap_file_pages() syscall. "
|
||||
"See Documentation/vm/remap_file_pages.txt.\n",
|
||||
@@ -2708,10 +2707,10 @@ SYSCALL_DEFINE5(remap_file_pages, unsigned long, start, unsigned long, size,
|
||||
pr_warn_once("%s (%d) uses deprecated remap_file_pages() syscall. See Documentation/vm/remap_file_pages.txt.\n",
|
||||
current->comm, current->pid);
|
||||
@@ -2590,10 +2589,10 @@ SYSCALL_DEFINE5(remap_file_pages, unsign
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -254,7 +232,7 @@ index 76d1ec2..fdd163e 100644
|
|||
out:
|
||||
up_write(&mm->mmap_sem);
|
||||
if (populate)
|
||||
@@ -2982,7 +2981,7 @@ struct vm_area_struct *copy_vma(struct vm_area_struct **vmap,
|
||||
@@ -2864,7 +2863,7 @@ struct vm_area_struct *copy_vma(struct v
|
||||
if (anon_vma_clone(new_vma, vma))
|
||||
goto out_free_mempol;
|
||||
if (new_vma->vm_file)
|
||||
|
@ -263,11 +241,9 @@ index 76d1ec2..fdd163e 100644
|
|||
if (new_vma->vm_ops && new_vma->vm_ops->open)
|
||||
new_vma->vm_ops->open(new_vma);
|
||||
vma_link(mm, new_vma, prev, rb_link, rb_parent);
|
||||
diff --git a/mm/nommu.c b/mm/nommu.c
|
||||
index fbf6f0f1..1a4a06d 100644
|
||||
--- a/mm/nommu.c
|
||||
+++ b/mm/nommu.c
|
||||
@@ -671,7 +671,7 @@ static void __put_nommu_region(struct vm_region *region)
|
||||
@@ -646,7 +646,7 @@ static void __put_nommu_region(struct vm
|
||||
up_write(&nommu_region_sem);
|
||||
|
||||
if (region->vm_file)
|
||||
|
@ -276,7 +252,7 @@ index fbf6f0f1..1a4a06d 100644
|
|||
|
||||
/* IO memory and memory shared directly out of the pagecache
|
||||
* from ramfs/tmpfs mustn't be released here */
|
||||
@@ -829,7 +829,7 @@ static void delete_vma(struct mm_struct *mm, struct vm_area_struct *vma)
|
||||
@@ -804,7 +804,7 @@ static void delete_vma(struct mm_struct
|
||||
if (vma->vm_ops && vma->vm_ops->close)
|
||||
vma->vm_ops->close(vma);
|
||||
if (vma->vm_file)
|
||||
|
@ -285,7 +261,7 @@ index fbf6f0f1..1a4a06d 100644
|
|||
put_nommu_region(vma->vm_region);
|
||||
kmem_cache_free(vm_area_cachep, vma);
|
||||
}
|
||||
@@ -1355,7 +1355,7 @@ unsigned long do_mmap(struct file *file,
|
||||
@@ -1330,7 +1330,7 @@ unsigned long do_mmap(struct file *file,
|
||||
goto error_just_free;
|
||||
}
|
||||
}
|
||||
|
@ -294,7 +270,7 @@ index fbf6f0f1..1a4a06d 100644
|
|||
kmem_cache_free(vm_region_jar, region);
|
||||
region = pregion;
|
||||
result = start;
|
||||
@@ -1430,10 +1430,10 @@ error_just_free:
|
||||
@@ -1405,10 +1405,10 @@ error_just_free:
|
||||
up_write(&nommu_region_sem);
|
||||
error:
|
||||
if (region->vm_file)
|
||||
|
@ -307,9 +283,6 @@ index fbf6f0f1..1a4a06d 100644
|
|||
kmem_cache_free(vm_area_cachep, vma);
|
||||
return ret;
|
||||
|
||||
diff --git a/mm/prfile.c b/mm/prfile.c
|
||||
new file mode 100644
|
||||
index 0000000..b323b8a
|
||||
--- /dev/null
|
||||
+++ b/mm/prfile.c
|
||||
@@ -0,0 +1,86 @@
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
From: J. R. Okajima <hooanon05@yahoo.co.jp>
|
||||
Date: Wed Mar 16 17:10:20 2016 +0900
|
||||
Subject: aufs4.5 standalone patch
|
||||
Origin: https://github.com/sfjro/aufs4-standalone/tree/91164538a2f52c72b79a657ca3675cb55152413d
|
||||
Date: Wed Mar 23 20:35:31 2016 +0900
|
||||
Subject: aufs4.x-rcN standalone patch
|
||||
Origin: https://github.com/sfjro/aufs4-standalone/tree/751023bb49e09b10f7ab4c8742eb4cee234506f4
|
||||
Bug-Debian: https://bugs.debian.org/541828
|
||||
|
||||
Patch headers added by debian/patches/features/all/aufs4/gen-patch
|
||||
|
||||
aufs4.5 standalone patch
|
||||
aufs4.x-rcN standalone patch
|
||||
|
||||
diff --git a/fs/dcache.c b/fs/dcache.c
|
||||
index 318c329..72d3cc8 100644
|
||||
index bc599d0..1b735a9 100644
|
||||
--- a/fs/dcache.c
|
||||
+++ b/fs/dcache.c
|
||||
@@ -1261,6 +1261,7 @@ rename_retry:
|
||||
|
@ -21,10 +21,10 @@ index 318c329..72d3cc8 100644
|
|||
/*
|
||||
* Search for at least 1 mount point in the dentry's subdirs.
|
||||
diff --git a/fs/exec.c b/fs/exec.c
|
||||
index dcd4ac7..09a7818 100644
|
||||
index 9bdf0ed..8c87f6c 100644
|
||||
--- a/fs/exec.c
|
||||
+++ b/fs/exec.c
|
||||
@@ -103,6 +103,7 @@ bool path_noexec(const struct path *path)
|
||||
@@ -104,6 +104,7 @@ bool path_noexec(const struct path *path)
|
||||
return (path->mnt->mnt_flags & MNT_NOEXEC) ||
|
||||
(path->mnt->mnt_sb->s_iflags & SB_I_NOEXEC);
|
||||
}
|
||||
|
@ -193,7 +193,7 @@ index 55bdc75..fd1df73 100644
|
|||
static int do_dentry_open(struct file *f,
|
||||
struct inode *inode,
|
||||
diff --git a/fs/read_write.c b/fs/read_write.c
|
||||
index c8b5b7a..9461d12 100644
|
||||
index 0ebcdc5..0a43d7b 100644
|
||||
--- a/fs/read_write.c
|
||||
+++ b/fs/read_write.c
|
||||
@@ -544,6 +544,7 @@ vfs_readf_t vfs_readf(struct file *file)
|
||||
|
@ -213,10 +213,10 @@ index c8b5b7a..9461d12 100644
|
|||
ssize_t __kernel_write(struct file *file, const char *buf, size_t count, loff_t *pos)
|
||||
{
|
||||
diff --git a/fs/splice.c b/fs/splice.c
|
||||
index 93aee51..52d2f5b 100644
|
||||
index 9037c8c..72cc871 100644
|
||||
--- a/fs/splice.c
|
||||
+++ b/fs/splice.c
|
||||
@@ -1121,6 +1121,7 @@ long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
|
||||
@@ -1124,6 +1124,7 @@ long do_splice_from(struct pipe_inode_info *pipe, struct file *out,
|
||||
|
||||
return splice_write(pipe, out, ppos, len, flags);
|
||||
}
|
||||
|
@ -224,7 +224,7 @@ index 93aee51..52d2f5b 100644
|
|||
|
||||
/*
|
||||
* Attempt to initiate a splice from a file to a pipe.
|
||||
@@ -1147,6 +1148,7 @@ long do_splice_to(struct file *in, loff_t *ppos,
|
||||
@@ -1150,6 +1151,7 @@ long do_splice_to(struct file *in, loff_t *ppos,
|
||||
|
||||
return splice_read(in, ppos, pipe, len, flags);
|
||||
}
|
||||
|
@ -293,7 +293,7 @@ index 03c1652..f88c84b 100644
|
|||
int devcgroup_inode_mknod(int mode, dev_t dev)
|
||||
{
|
||||
diff --git a/security/security.c b/security/security.c
|
||||
index e8ffd92..51fa026 100644
|
||||
index 3644b03..593879b 100644
|
||||
--- a/security/security.c
|
||||
+++ b/security/security.c
|
||||
@@ -433,6 +433,7 @@ int security_path_rmdir(struct path *dir, struct dentry *dentry)
|
||||
|
|
|
@ -13,7 +13,7 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
|||
---
|
||||
--- a/Documentation/kernel-parameters.txt
|
||||
+++ b/Documentation/kernel-parameters.txt
|
||||
@@ -597,8 +597,8 @@ bytes respectively. Such letter suffixes
|
||||
@@ -603,8 +603,8 @@ bytes respectively. Such letter suffixes
|
||||
ccw_timeout_log [S390]
|
||||
See Documentation/s390/CommonIO for details.
|
||||
|
||||
|
@ -26,7 +26,7 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
|||
a single hierarchy
|
||||
--- a/init/Kconfig
|
||||
+++ b/init/Kconfig
|
||||
@@ -945,6 +945,14 @@ config MEMCG
|
||||
@@ -946,6 +946,14 @@ config MEMCG
|
||||
help
|
||||
Provides control over the memory footprint of tasks in a cgroup.
|
||||
|
||||
|
@ -43,19 +43,19 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
|||
depends on MEMCG && SWAP
|
||||
--- a/kernel/cgroup.c
|
||||
+++ b/kernel/cgroup.c
|
||||
@@ -5269,7 +5269,11 @@ int __init cgroup_init_early(void)
|
||||
@@ -5521,7 +5521,11 @@ int __init cgroup_init_early(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
+#ifdef CONFIG_MEMCG_DISABLED
|
||||
+static unsigned long cgroup_disable_mask __initdata = 1 << memory_cgrp_id;
|
||||
+static u16 cgroup_disable_mask __initdata = 1 << memory_cgrp_id;
|
||||
+#else
|
||||
static unsigned long cgroup_disable_mask __initdata;
|
||||
static u16 cgroup_disable_mask __initdata;
|
||||
+#endif
|
||||
|
||||
/**
|
||||
* cgroup_init - cgroup initialization
|
||||
@@ -5729,7 +5733,7 @@ out_free:
|
||||
@@ -6003,7 +6007,7 @@ out_free:
|
||||
kfree(pathbuf);
|
||||
}
|
||||
|
||||
|
@ -64,7 +64,7 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
|||
{
|
||||
struct cgroup_subsys *ss;
|
||||
char *token;
|
||||
@@ -5743,13 +5747,27 @@ static int __init cgroup_disable(char *s
|
||||
@@ -6017,13 +6021,27 @@ static int __init cgroup_disable(char *s
|
||||
if (strcmp(token, ss->name) &&
|
||||
strcmp(token, ss->legacy_name))
|
||||
continue;
|
||||
|
@ -90,6 +90,6 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
|||
+}
|
||||
+__setup("cgroup_enable=", cgroup_enable);
|
||||
+
|
||||
/**
|
||||
* css_tryget_online_from_dir - get corresponding css from a cgroup dentry
|
||||
* @dentry: directory dentry of interest
|
||||
static int __init cgroup_no_v1(char *str)
|
||||
{
|
||||
struct cgroup_subsys *ss;
|
||||
|
|
|
@ -1,115 +0,0 @@
|
|||
From: Dan Williams <dan.j.williams@intel.com>
|
||||
Date: Wed, 16 Mar 2016 14:16:26 +1100
|
||||
Subject: mm: exclude ZONE_DEVICE from GFP_ZONE_TABLE
|
||||
Origin: http://article.gmane.org/gmane.linux.kernel.mm/147399
|
||||
|
||||
ZONE_DEVICE (merged in 4.3) and ZONE_CMA (proposed) are examples of new mm
|
||||
zones that are bumping up against the current maximum limit of 4 zones,
|
||||
i.e. 2 bits in page->flags for the GFP_ZONE_TABLE.
|
||||
|
||||
The GFP_ZONE_TABLE poses an interesting constraint since
|
||||
include/linux/gfp.h gets included by the 32-bit portion of a 64-bit build.
|
||||
We need to be careful to only build the table for zones that have a
|
||||
corresponding gfp_t flag. GFP_ZONES_SHIFT is introduced for this purpose.
|
||||
This patch does not attempt to solve the problem of adding a new zone
|
||||
that also has a corresponding GFP_ flag.
|
||||
|
||||
Vlastimil points out that ZONE_DEVICE, by depending on x86_64 and
|
||||
SPARSEMEM_VMEMMAP implies that SECTIONS_WIDTH is zero. In other words
|
||||
even though ZONE_DEVICE does not fit in GFP_ZONE_TABLE it is free to
|
||||
consume another bit in page->flags (expand ZONES_WIDTH) with room to
|
||||
spare.
|
||||
|
||||
Link: https://bugzilla.kernel.org/show_bug.cgi?id=110931
|
||||
Fixes: 033fbae988fc ("mm: ZONE_DEVICE for "device memory"")
|
||||
Signed-off-by: Dan Williams <dan.j.williams@intel.com>
|
||||
Reported-by: Mark <markk@clara.co.uk>
|
||||
Reported-by: Vlastimil Babka <vbabka@suse.cz>
|
||||
Cc: Mel Gorman <mgorman@suse.de>
|
||||
Cc: Rik van Riel <riel@redhat.com>
|
||||
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
|
||||
Cc: Dave Hansen <dave.hansen@linux.intel.com>
|
||||
Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
|
||||
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
|
||||
---
|
||||
include/linux/gfp.h | 33 ++++++++++++++++++++-------------
|
||||
include/linux/page-flags-layout.h | 2 ++
|
||||
mm/Kconfig | 2 --
|
||||
3 files changed, 22 insertions(+), 15 deletions(-)
|
||||
|
||||
--- a/include/linux/gfp.h
|
||||
+++ b/include/linux/gfp.h
|
||||
@@ -329,22 +329,29 @@ static inline bool gfpflags_allow_blocki
|
||||
* 0xe => BAD (MOVABLE+DMA32+HIGHMEM)
|
||||
* 0xf => BAD (MOVABLE+DMA32+HIGHMEM+DMA)
|
||||
*
|
||||
- * ZONES_SHIFT must be <= 2 on 32 bit platforms.
|
||||
+ * GFP_ZONES_SHIFT must be <= 2 on 32 bit platforms.
|
||||
*/
|
||||
|
||||
-#if 16 * ZONES_SHIFT > BITS_PER_LONG
|
||||
-#error ZONES_SHIFT too large to create GFP_ZONE_TABLE integer
|
||||
+#if defined(CONFIG_ZONE_DEVICE) && (MAX_NR_ZONES-1) <= 4
|
||||
+/* ZONE_DEVICE is not a valid GFP zone specifier */
|
||||
+#define GFP_ZONES_SHIFT 2
|
||||
+#else
|
||||
+#define GFP_ZONES_SHIFT ZONES_SHIFT
|
||||
+#endif
|
||||
+
|
||||
+#if 16 * GFP_ZONES_SHIFT > BITS_PER_LONG
|
||||
+#error GFP_ZONES_SHIFT too large to create GFP_ZONE_TABLE integer
|
||||
#endif
|
||||
|
||||
#define GFP_ZONE_TABLE ( \
|
||||
- (ZONE_NORMAL << 0 * ZONES_SHIFT) \
|
||||
- | (OPT_ZONE_DMA << ___GFP_DMA * ZONES_SHIFT) \
|
||||
- | (OPT_ZONE_HIGHMEM << ___GFP_HIGHMEM * ZONES_SHIFT) \
|
||||
- | (OPT_ZONE_DMA32 << ___GFP_DMA32 * ZONES_SHIFT) \
|
||||
- | (ZONE_NORMAL << ___GFP_MOVABLE * ZONES_SHIFT) \
|
||||
- | (OPT_ZONE_DMA << (___GFP_MOVABLE | ___GFP_DMA) * ZONES_SHIFT) \
|
||||
- | (ZONE_MOVABLE << (___GFP_MOVABLE | ___GFP_HIGHMEM) * ZONES_SHIFT) \
|
||||
- | (OPT_ZONE_DMA32 << (___GFP_MOVABLE | ___GFP_DMA32) * ZONES_SHIFT) \
|
||||
+ (ZONE_NORMAL << 0 * GFP_ZONES_SHIFT) \
|
||||
+ | (OPT_ZONE_DMA << ___GFP_DMA * GFP_ZONES_SHIFT) \
|
||||
+ | (OPT_ZONE_HIGHMEM << ___GFP_HIGHMEM * GFP_ZONES_SHIFT) \
|
||||
+ | (OPT_ZONE_DMA32 << ___GFP_DMA32 * GFP_ZONES_SHIFT) \
|
||||
+ | (ZONE_NORMAL << ___GFP_MOVABLE * GFP_ZONES_SHIFT) \
|
||||
+ | (OPT_ZONE_DMA << (___GFP_MOVABLE | ___GFP_DMA) * GFP_ZONES_SHIFT) \
|
||||
+ | (ZONE_MOVABLE << (___GFP_MOVABLE | ___GFP_HIGHMEM) * GFP_ZONES_SHIFT)\
|
||||
+ | (OPT_ZONE_DMA32 << (___GFP_MOVABLE | ___GFP_DMA32) * GFP_ZONES_SHIFT)\
|
||||
)
|
||||
|
||||
/*
|
||||
@@ -369,8 +376,8 @@ static inline enum zone_type gfp_zone(gf
|
||||
enum zone_type z;
|
||||
int bit = (__force int) (flags & GFP_ZONEMASK);
|
||||
|
||||
- z = (GFP_ZONE_TABLE >> (bit * ZONES_SHIFT)) &
|
||||
- ((1 << ZONES_SHIFT) - 1);
|
||||
+ z = (GFP_ZONE_TABLE >> (bit * GFP_ZONES_SHIFT)) &
|
||||
+ ((1 << GFP_ZONES_SHIFT) - 1);
|
||||
VM_BUG_ON((GFP_ZONE_BAD >> bit) & 1);
|
||||
return z;
|
||||
}
|
||||
--- a/include/linux/page-flags-layout.h
|
||||
+++ b/include/linux/page-flags-layout.h
|
||||
@@ -17,6 +17,8 @@
|
||||
#define ZONES_SHIFT 1
|
||||
#elif MAX_NR_ZONES <= 4
|
||||
#define ZONES_SHIFT 2
|
||||
+#elif MAX_NR_ZONES <= 8
|
||||
+#define ZONES_SHIFT 3
|
||||
#else
|
||||
#error ZONES_SHIFT -- too many zones configured adjust calculation
|
||||
#endif
|
||||
--- a/mm/Kconfig
|
||||
+++ b/mm/Kconfig
|
||||
@@ -652,8 +652,6 @@ config IDLE_PAGE_TRACKING
|
||||
|
||||
config ZONE_DEVICE
|
||||
bool "Device memory (pmem, etc...) hotplug support" if EXPERT
|
||||
- default !ZONE_DMA
|
||||
- depends on !ZONE_DMA
|
||||
depends on MEMORY_HOTPLUG
|
||||
depends on MEMORY_HOTREMOVE
|
||||
depends on SPARSEMEM_VMEMMAP
|
|
@ -1,163 +0,0 @@
|
|||
From: Markus Pargmann <mpa@pengutronix.de>
|
||||
Date: Mon, 27 Jul 2015 07:36:49 +0200
|
||||
Subject: nbd: Create size change events for userspace
|
||||
Origin: https://git.kernel.org/linus/37091fdd831f28a6509008542174ed324dd645bc
|
||||
Bug-Debian: https://bugs.debian.org/812487
|
||||
|
||||
The userspace needs to know when nbd devices are ready for use.
|
||||
Currently no events are created for the userspace which doesn't work for
|
||||
systemd.
|
||||
|
||||
See the discussion here: https://github.com/systemd/systemd/pull/358
|
||||
|
||||
This patch uses a central point to setup the nbd-internal sizes. A ioctl
|
||||
to set a size does not lead to a visible size change. The size of the
|
||||
block device will be kept at 0 until nbd is connected. As soon as it
|
||||
connects, the size will be changed to the real value and a uevent is
|
||||
created. When disconnecting, the blockdevice is set to 0 size and
|
||||
another uevent is generated.
|
||||
|
||||
Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
|
||||
---
|
||||
drivers/block/nbd.c | 79 +++++++++++++++++++++++++++++++++++++++--------------
|
||||
1 file changed, 58 insertions(+), 21 deletions(-)
|
||||
|
||||
--- a/drivers/block/nbd.c
|
||||
+++ b/drivers/block/nbd.c
|
||||
@@ -98,6 +98,11 @@ static inline struct device *nbd_to_dev(
|
||||
return disk_to_dev(nbd->disk);
|
||||
}
|
||||
|
||||
+static bool nbd_is_connected(struct nbd_device *nbd)
|
||||
+{
|
||||
+ return !!nbd->task_recv;
|
||||
+}
|
||||
+
|
||||
static const char *nbdcmd_to_ascii(int cmd)
|
||||
{
|
||||
switch (cmd) {
|
||||
@@ -110,6 +115,42 @@ static const char *nbdcmd_to_ascii(int c
|
||||
return "invalid";
|
||||
}
|
||||
|
||||
+static int nbd_size_clear(struct nbd_device *nbd, struct block_device *bdev)
|
||||
+{
|
||||
+ bdev->bd_inode->i_size = 0;
|
||||
+ set_capacity(nbd->disk, 0);
|
||||
+ kobject_uevent(&nbd_to_dev(nbd)->kobj, KOBJ_CHANGE);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static void nbd_size_update(struct nbd_device *nbd, struct block_device *bdev)
|
||||
+{
|
||||
+ if (!nbd_is_connected(nbd))
|
||||
+ return;
|
||||
+
|
||||
+ bdev->bd_inode->i_size = nbd->bytesize;
|
||||
+ set_capacity(nbd->disk, nbd->bytesize >> 9);
|
||||
+ kobject_uevent(&nbd_to_dev(nbd)->kobj, KOBJ_CHANGE);
|
||||
+}
|
||||
+
|
||||
+static int nbd_size_set(struct nbd_device *nbd, struct block_device *bdev,
|
||||
+ int blocksize, int nr_blocks)
|
||||
+{
|
||||
+ int ret;
|
||||
+
|
||||
+ ret = set_blocksize(bdev, blocksize);
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+
|
||||
+ nbd->blksize = blocksize;
|
||||
+ nbd->bytesize = (loff_t)blocksize * (loff_t)nr_blocks;
|
||||
+
|
||||
+ nbd_size_update(nbd, bdev);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
static void nbd_end_request(struct nbd_device *nbd, struct request *req)
|
||||
{
|
||||
int error = req->errors ? -EIO : 0;
|
||||
@@ -402,7 +443,7 @@ static struct device_attribute pid_attr
|
||||
.show = pid_show,
|
||||
};
|
||||
|
||||
-static int nbd_thread_recv(struct nbd_device *nbd)
|
||||
+static int nbd_thread_recv(struct nbd_device *nbd, struct block_device *bdev)
|
||||
{
|
||||
struct request *req;
|
||||
int ret;
|
||||
@@ -427,6 +468,8 @@ static int nbd_thread_recv(struct nbd_de
|
||||
return ret;
|
||||
}
|
||||
|
||||
+ nbd_size_update(nbd, bdev);
|
||||
+
|
||||
while (1) {
|
||||
req = nbd_read_stat(nbd);
|
||||
if (IS_ERR(req)) {
|
||||
@@ -437,6 +480,8 @@ static int nbd_thread_recv(struct nbd_de
|
||||
nbd_end_request(nbd, req);
|
||||
}
|
||||
|
||||
+ nbd_size_clear(nbd, bdev);
|
||||
+
|
||||
device_remove_file(disk_to_dev(nbd->disk), &pid_attr);
|
||||
|
||||
spin_lock_irqsave(&nbd->tasks_lock, flags);
|
||||
@@ -696,20 +741,19 @@ static int __nbd_ioctl(struct block_devi
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
- case NBD_SET_BLKSIZE:
|
||||
- nbd->blksize = arg;
|
||||
- nbd->bytesize &= ~(nbd->blksize-1);
|
||||
- bdev->bd_inode->i_size = nbd->bytesize;
|
||||
- set_blocksize(bdev, nbd->blksize);
|
||||
- set_capacity(nbd->disk, nbd->bytesize >> 9);
|
||||
- return 0;
|
||||
+ case NBD_SET_BLKSIZE: {
|
||||
+ loff_t bsize = nbd->bytesize;
|
||||
+ do_div(bsize, arg);
|
||||
+
|
||||
+ return nbd_size_set(nbd, bdev, arg, bsize);
|
||||
+ }
|
||||
|
||||
case NBD_SET_SIZE:
|
||||
- nbd->bytesize = arg & ~(nbd->blksize-1);
|
||||
- bdev->bd_inode->i_size = nbd->bytesize;
|
||||
- set_blocksize(bdev, nbd->blksize);
|
||||
- set_capacity(nbd->disk, nbd->bytesize >> 9);
|
||||
- return 0;
|
||||
+ return nbd_size_set(nbd, bdev, nbd->blksize,
|
||||
+ arg / nbd->blksize);
|
||||
+
|
||||
+ case NBD_SET_SIZE_BLOCKS:
|
||||
+ return nbd_size_set(nbd, bdev, nbd->blksize, arg);
|
||||
|
||||
case NBD_SET_TIMEOUT:
|
||||
nbd->xmit_timeout = arg * HZ;
|
||||
@@ -725,13 +769,6 @@ static int __nbd_ioctl(struct block_devi
|
||||
nbd->flags = arg;
|
||||
return 0;
|
||||
|
||||
- case NBD_SET_SIZE_BLOCKS:
|
||||
- nbd->bytesize = ((u64) arg) * nbd->blksize;
|
||||
- bdev->bd_inode->i_size = nbd->bytesize;
|
||||
- set_blocksize(bdev, nbd->blksize);
|
||||
- set_capacity(nbd->disk, nbd->bytesize >> 9);
|
||||
- return 0;
|
||||
-
|
||||
case NBD_DO_IT: {
|
||||
struct task_struct *thread;
|
||||
struct socket *sock;
|
||||
@@ -762,7 +799,7 @@ static int __nbd_ioctl(struct block_devi
|
||||
}
|
||||
|
||||
nbd_dev_dbg_init(nbd);
|
||||
- error = nbd_thread_recv(nbd);
|
||||
+ error = nbd_thread_recv(nbd, bdev);
|
||||
nbd_dev_dbg_close(nbd);
|
||||
kthread_stop(thread);
|
||||
|
|
@ -35,7 +35,7 @@ Signed-off-by: Linn Crosetto <linn@hpe.com>
|
|||
#include "apei-internal.h"
|
||||
@@ -521,6 +522,9 @@ static int einj_error_inject(u32 type, u
|
||||
int rc;
|
||||
unsigned long pfn;
|
||||
u64 base_addr, size;
|
||||
|
||||
+ if (get_securelevel() > 0)
|
||||
+ return -EPERM;
|
||||
|
|
|
@ -21,7 +21,7 @@ Signed-off-by: Matthew Garrett <mjg59@srcf.ucam.org>
|
|||
#include <linux/gfp.h>
|
||||
+#include <linux/security.h>
|
||||
|
||||
#include <asm/processor.h>
|
||||
#include <asm/cpufeature.h>
|
||||
#include <asm/msr.h>
|
||||
@@ -83,6 +84,9 @@ static ssize_t msr_write(struct file *fi
|
||||
int err = 0;
|
||||
|
|
|
@ -1,59 +0,0 @@
|
|||
From: Heinrich Schuchardt <xypron.glpk@gmx.de>
|
||||
Date: Mon, 8 Feb 2016 01:55:08 +0100
|
||||
Subject: [PATCH] ARM: dts: imx6dlq-wandboard-revb1.dts: use unique model id
|
||||
Origin: https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/?id=ee10774a9b48e8785f1426e273059c4ba038a27f
|
||||
Bug-Debian: https://bugs.debian.org/813881
|
||||
|
||||
Downstream packages like Debian flash-kernel use
|
||||
/proc/device-tree/model
|
||||
to determine which dtb file to install.
|
||||
|
||||
Hence each dts in the Linux kernel should provide a unique model
|
||||
identifier.
|
||||
|
||||
Commit 8536239e371f ("ARM: dts: Restructure imx6qdl-wandboard.dtsi for new
|
||||
rev C1 board.")' created new files imx6dl-wandboard-revb1.dts and
|
||||
imx6q-wandboard-revb1.dts but used the same model identifier as in
|
||||
imx6dl-wandboard.dts and imx6q-wandboard.dts.
|
||||
|
||||
This patch provides unique model identifiers for revision B1 of
|
||||
the Wandboard Dual and Wandbaord Quad.
|
||||
|
||||
The patch leaves imx6dl-wandboard.dts and imx6q-wandboard.dts unchanged
|
||||
because it is not foreseeable if the same dts will valid for future
|
||||
board revisions or not. Furthermore we should avoid unnecessary
|
||||
changes.
|
||||
|
||||
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
|
||||
Signed-off-by: Shawn Guo <shawnguo@kernel.org>
|
||||
---
|
||||
arch/arm/boot/dts/imx6dl-wandboard-revb1.dts | 2 +-
|
||||
arch/arm/boot/dts/imx6q-wandboard-revb1.dts | 2 +-
|
||||
2 files changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/arch/arm/boot/dts/imx6dl-wandboard-revb1.dts b/arch/arm/boot/dts/imx6dl-wandboard-revb1.dts
|
||||
index f607d4f1d244..8c314eee4fdd 100644
|
||||
--- a/arch/arm/boot/dts/imx6dl-wandboard-revb1.dts
|
||||
+++ b/arch/arm/boot/dts/imx6dl-wandboard-revb1.dts
|
||||
@@ -13,7 +13,7 @@
|
||||
#include "imx6qdl-wandboard-revb1.dtsi"
|
||||
|
||||
/ {
|
||||
- model = "Wandboard i.MX6 Dual Lite Board";
|
||||
+ model = "Wandboard i.MX6 Dual Lite Board rev B1";
|
||||
compatible = "wand,imx6dl-wandboard", "fsl,imx6dl";
|
||||
|
||||
memory {
|
||||
diff --git a/arch/arm/boot/dts/imx6q-wandboard-revb1.dts b/arch/arm/boot/dts/imx6q-wandboard-revb1.dts
|
||||
index 20bf3c282623..9207d80f9cfb 100644
|
||||
--- a/arch/arm/boot/dts/imx6q-wandboard-revb1.dts
|
||||
+++ b/arch/arm/boot/dts/imx6q-wandboard-revb1.dts
|
||||
@@ -13,7 +13,7 @@
|
||||
#include "imx6qdl-wandboard-revb1.dtsi"
|
||||
|
||||
/ {
|
||||
- model = "Wandboard i.MX6 Quad Board";
|
||||
+ model = "Wandboard i.MX6 Quad Board rev B1";
|
||||
compatible = "wand,imx6q-wandboard", "fsl,imx6q";
|
||||
|
||||
memory {
|
|
@ -1,187 +0,0 @@
|
|||
From: Mario Lange <mario_lange@gmx.net>
|
||||
Date: Tue, 26 Jan 2016 01:44:10 +0900
|
||||
Subject: ARM: dts: kirkwood: add device tree for buffalo linkstation ls-qvl
|
||||
Origin: https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/?id=5dda254d0cc5cbdcc81dbce0985c35b68dd5e3b1
|
||||
|
||||
Add dts file to support Buffalo Linkstation LS-QVL,
|
||||
which is marvell kirkwood based 4-bay 3.5" HDD NAS.
|
||||
Product info:
|
||||
- (JPN) http://buffalo.jp/product/hdd/network/ls-qvl_r5/
|
||||
- (ENG) http://www.buffalotech.com/products/network-storage/home-and-small-office/linkstation-pro-quad
|
||||
|
||||
Signed-off-by: Mario Lange <mario_lange@gmx.net>
|
||||
Signed-off-by: Roger Shimizu <rogershimizu@gmail.com>
|
||||
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
|
||||
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
|
||||
---
|
||||
.../devicetree/bindings/arm/marvell,kirkwood.txt | 1 +
|
||||
arch/arm/boot/dts/Makefile | 1 +
|
||||
arch/arm/boot/dts/kirkwood-linkstation-lsqvl.dts | 135 +++++++++++++++++++++
|
||||
3 files changed, 137 insertions(+)
|
||||
create mode 100644 arch/arm/boot/dts/kirkwood-linkstation-lsqvl.dts
|
||||
|
||||
diff --git a/Documentation/devicetree/bindings/arm/marvell,kirkwood.txt b/Documentation/devicetree/bindings/arm/marvell,kirkwood.txt
|
||||
index 0fc6faa4cddb..7d28fe4bf654 100644
|
||||
--- a/Documentation/devicetree/bindings/arm/marvell,kirkwood.txt
|
||||
+++ b/Documentation/devicetree/bindings/arm/marvell,kirkwood.txt
|
||||
@@ -19,6 +19,7 @@ SoC. Currently known SoC compatibles are:
|
||||
And in addition, the compatible shall be extended with the specific
|
||||
board. Currently known boards are:
|
||||
|
||||
+"buffalo,linkstation-lsqvl"
|
||||
"buffalo,linkstation-lsvl"
|
||||
"buffalo,linkstation-lswsxl"
|
||||
"buffalo,linkstation-lswxl"
|
||||
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
|
||||
index 91833f905aef..30d316dc050f 100644
|
||||
--- a/arch/arm/boot/dts/Makefile
|
||||
+++ b/arch/arm/boot/dts/Makefile
|
||||
@@ -189,6 +189,7 @@ dtb-$(CONFIG_MACH_KIRKWOOD) += \
|
||||
kirkwood-is2.dtb \
|
||||
kirkwood-km_kirkwood.dtb \
|
||||
kirkwood-laplug.dtb \
|
||||
+ kirkwood-linkstation-lsqvl.dtb \
|
||||
kirkwood-linkstation-lsvl.dtb \
|
||||
kirkwood-linkstation-lswsxl.dtb \
|
||||
kirkwood-linkstation-lswvl.dtb \
|
||||
diff --git a/arch/arm/boot/dts/kirkwood-linkstation-lsqvl.dts b/arch/arm/boot/dts/kirkwood-linkstation-lsqvl.dts
|
||||
new file mode 100644
|
||||
index 000000000000..6dc0df2969f0
|
||||
--- /dev/null
|
||||
+++ b/arch/arm/boot/dts/kirkwood-linkstation-lsqvl.dts
|
||||
@@ -0,0 +1,135 @@
|
||||
+/*
|
||||
+ * Device Tree file for Buffalo Linkstation LS-QVL
|
||||
+ *
|
||||
+ * Copyright (C) 2016, Mario Lange <mario_lange@gmx.net>
|
||||
+ *
|
||||
+ * Based on kirkwood-linkstation-lswvl.dts,
|
||||
+ * Copyright (C) 2015, 2016
|
||||
+ * Roger Shimizu <rogershimizu@gmail.com>
|
||||
+ *
|
||||
+ * This file is dual-licensed: you can use it either under the terms
|
||||
+ * of the GPL or the X11 license, at your option. Note that this dual
|
||||
+ * licensing only applies to this file, and not this project as a
|
||||
+ * whole.
|
||||
+ *
|
||||
+ * a) This file is free software; you can redistribute it and/or
|
||||
+ * modify it under the terms of the GNU General Public License as
|
||||
+ * published by the Free Software Foundation; either version 2 of the
|
||||
+ * License, or (at your option) any later version.
|
||||
+ *
|
||||
+ * This file is distributed in the hope that it will be useful
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * Or, alternatively
|
||||
+ *
|
||||
+ * b) Permission is hereby granted, free of charge, to any person
|
||||
+ * obtaining a copy of this software and associated documentation
|
||||
+ * files (the "Software"), to deal in the Software without
|
||||
+ * restriction, including without limitation the rights to use
|
||||
+ * copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
+ * sell copies of the Software, and to permit persons to whom the
|
||||
+ * Software is furnished to do so, subject to the following
|
||||
+ * conditions:
|
||||
+ *
|
||||
+ * The above copyright notice and this permission notice shall be
|
||||
+ * included in all copies or substantial portions of the Software.
|
||||
+ *
|
||||
+ * THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND
|
||||
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
|
||||
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
+ * OTHER DEALINGS IN THE SOFTWARE.
|
||||
+ */
|
||||
+
|
||||
+/dts-v1/;
|
||||
+#include "kirkwood-linkstation-6282.dtsi"
|
||||
+
|
||||
+/ {
|
||||
+ model = "Buffalo Linkstation LS-QVL";
|
||||
+ compatible = "buffalo,lsqvl", "marvell,kirkwood-88f6282", "marvell,kirkwood";
|
||||
+
|
||||
+ memory { /* 256 MB */
|
||||
+ device_type = "memory";
|
||||
+ reg = <0x00000000 0x10000000>;
|
||||
+ };
|
||||
+
|
||||
+ ocp@f1000000 {
|
||||
+ pinctrl: pin-controller@10000 {
|
||||
+ pmx_power_hdd1: pmx-power-hdd1 {
|
||||
+ marvell,pins = "mpp9";
|
||||
+ marvell,function = "gpio";
|
||||
+ };
|
||||
+ pmx_led_hdderr0: pmx-led-hdderr0 {
|
||||
+ marvell,pins = "mpp34";
|
||||
+ marvell,function = "gpio";
|
||||
+ };
|
||||
+ pmx_led_hdderr1: pmx-led-hdderr1 {
|
||||
+ marvell,pins = "mpp35";
|
||||
+ marvell,function = "gpio";
|
||||
+ };
|
||||
+ pmx_led_hdderr2: pmx-led-hdderr2 {
|
||||
+ marvell,pins = "mpp24";
|
||||
+ marvell,function = "gpio";
|
||||
+ };
|
||||
+ pmx_led_hdderr3: pmx-led-hdderr3 {
|
||||
+ marvell,pins = "mpp25";
|
||||
+ marvell,function = "gpio";
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ sata@80000 {
|
||||
+ nr-ports = <2>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ gpio_leds {
|
||||
+ pinctrl-0 = <&pmx_led_function_red &pmx_led_alarm
|
||||
+ &pmx_led_info &pmx_led_power
|
||||
+ &pmx_led_function_blue
|
||||
+ &pmx_led_hdderr0
|
||||
+ &pmx_led_hdderr1
|
||||
+ &pmx_led_hdderr2
|
||||
+ &pmx_led_hdderr3>;
|
||||
+
|
||||
+ red-hdderr0-led {
|
||||
+ label = "linkstation:red:hdderr0";
|
||||
+ gpios = <&gpio1 2 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ red-hdderr1-led {
|
||||
+ label = "linkstation:red:hdderr1";
|
||||
+ gpios = <&gpio1 3 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ red-hdderr2-led {
|
||||
+ label = "linkstation:red:hdderr2";
|
||||
+ gpios = <&gpio0 24 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ red-hdderr3-led {
|
||||
+ label = "linkstation:red:hdderr3";
|
||||
+ gpios = <&gpio0 25 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ regulators {
|
||||
+ pinctrl-0 = <&pmx_power_hdd0 &pmx_power_hdd1 &pmx_usb_vbus>;
|
||||
+
|
||||
+ hdd_power1: regulator@3 {
|
||||
+ compatible = "regulator-fixed";
|
||||
+ reg = <3>;
|
||||
+ regulator-name = "HDD1 Power";
|
||||
+ regulator-min-microvolt = <5000000>;
|
||||
+ regulator-max-microvolt = <5000000>;
|
||||
+ enable-active-high;
|
||||
+ regulator-always-on;
|
||||
+ regulator-boot-on;
|
||||
+ gpio = <&gpio0 9 GPIO_ACTIVE_HIGH>;
|
||||
+ };
|
||||
+ };
|
||||
+};
|
|
@ -1,117 +0,0 @@
|
|||
From: Roger Shimizu <rogershimizu@gmail.com>
|
||||
Date: Thu, 21 Jan 2016 23:38:48 +0900
|
||||
Subject: ARM: dts: kirkwood: relicense dts of ls-wvl/vl and ls-wxl/wsxl under GPLv2/X11
|
||||
Origin: https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/?id=3e2f2db885fb0cb16ae8949d4d2283f1ac272329
|
||||
|
||||
Signed-off-by: Roger Shimizu <rogershimizu@gmail.com>
|
||||
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
|
||||
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
|
||||
---
|
||||
arch/arm/boot/dts/kirkwood-lswvl.dts | 41 ++++++++++++++++++++++++++++++++----
|
||||
arch/arm/boot/dts/kirkwood-lswxl.dts | 41 ++++++++++++++++++++++++++++++++----
|
||||
2 files changed, 74 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/arch/arm/boot/dts/kirkwood-lswvl.dts b/arch/arm/boot/dts/kirkwood-lswvl.dts
|
||||
index 36eec7392ab4..04bdc4f19a9f 100644
|
||||
--- a/arch/arm/boot/dts/kirkwood-lswvl.dts
|
||||
+++ b/arch/arm/boot/dts/kirkwood-lswvl.dts
|
||||
@@ -4,10 +4,43 @@
|
||||
* Copyright (C) 2015, 2016
|
||||
* Roger Shimizu <rogershimizu@gmail.com>
|
||||
*
|
||||
- * This program is free software; you can redistribute it and/or
|
||||
- * modify it under the terms of the GNU General Public License
|
||||
- * as published by the Free Software Foundation; either version
|
||||
- * 2 of the License, or (at your option) any later version.
|
||||
+ * This file is dual-licensed: you can use it either under the terms
|
||||
+ * of the GPL or the X11 license, at your option. Note that this dual
|
||||
+ * licensing only applies to this file, and not this project as a
|
||||
+ * whole.
|
||||
+ *
|
||||
+ * a) This file is free software; you can redistribute it and/or
|
||||
+ * modify it under the terms of the GNU General Public License as
|
||||
+ * published by the Free Software Foundation; either version 2 of the
|
||||
+ * License, or (at your option) any later version.
|
||||
+ *
|
||||
+ * This file is distributed in the hope that it will be useful
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * Or, alternatively
|
||||
+ *
|
||||
+ * b) Permission is hereby granted, free of charge, to any person
|
||||
+ * obtaining a copy of this software and associated documentation
|
||||
+ * files (the "Software"), to deal in the Software without
|
||||
+ * restriction, including without limitation the rights to use
|
||||
+ * copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
+ * sell copies of the Software, and to permit persons to whom the
|
||||
+ * Software is furnished to do so, subject to the following
|
||||
+ * conditions:
|
||||
+ *
|
||||
+ * The above copyright notice and this permission notice shall be
|
||||
+ * included in all copies or substantial portions of the Software.
|
||||
+ *
|
||||
+ * THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND
|
||||
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
|
||||
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
+ * OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
||||
diff --git a/arch/arm/boot/dts/kirkwood-lswxl.dts b/arch/arm/boot/dts/kirkwood-lswxl.dts
|
||||
index b13ec20a7088..930899d13c5d 100644
|
||||
--- a/arch/arm/boot/dts/kirkwood-lswxl.dts
|
||||
+++ b/arch/arm/boot/dts/kirkwood-lswxl.dts
|
||||
@@ -4,10 +4,43 @@
|
||||
* Copyright (C) 2015, 2016
|
||||
* Roger Shimizu <rogershimizu@gmail.com>
|
||||
*
|
||||
- * This program is free software; you can redistribute it and/or
|
||||
- * modify it under the terms of the GNU General Public License
|
||||
- * as published by the Free Software Foundation; either version
|
||||
- * 2 of the License, or (at your option) any later version.
|
||||
+ * This file is dual-licensed: you can use it either under the terms
|
||||
+ * of the GPL or the X11 license, at your option. Note that this dual
|
||||
+ * licensing only applies to this file, and not this project as a
|
||||
+ * whole.
|
||||
+ *
|
||||
+ * a) This file is free software; you can redistribute it and/or
|
||||
+ * modify it under the terms of the GNU General Public License as
|
||||
+ * published by the Free Software Foundation; either version 2 of the
|
||||
+ * License, or (at your option) any later version.
|
||||
+ *
|
||||
+ * This file is distributed in the hope that it will be useful
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * Or, alternatively
|
||||
+ *
|
||||
+ * b) Permission is hereby granted, free of charge, to any person
|
||||
+ * obtaining a copy of this software and associated documentation
|
||||
+ * files (the "Software"), to deal in the Software without
|
||||
+ * restriction, including without limitation the rights to use
|
||||
+ * copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
+ * sell copies of the Software, and to permit persons to whom the
|
||||
+ * Software is furnished to do so, subject to the following
|
||||
+ * conditions:
|
||||
+ *
|
||||
+ * The above copyright notice and this permission notice shall be
|
||||
+ * included in all copies or substantial portions of the Software.
|
||||
+ *
|
||||
+ * THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND
|
||||
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
|
||||
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
+ * OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/dts-v1/;
|
|
@ -1,771 +0,0 @@
|
|||
From: Roger Shimizu <rogershimizu@gmail.com>
|
||||
Date: Thu, 21 Jan 2016 23:38:50 +0900
|
||||
Subject: ARM: dts: kirkwood: split lswvl dts to linkstation lsvl and lswvl
|
||||
Origin: https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/?id=60ff189ca05dedac97af8d9e51c285a44bc9e5a5
|
||||
|
||||
LS-WVL/VL are both kirkwood-6282 based NAS devices, which share
|
||||
many MPP pins. However they are slightly different:
|
||||
- LS-WVL is 2-Bay NAS, and LS-VL is only 1-Bay.
|
||||
- There're two red LED indicator on LS-WVL to show when HDD fails,
|
||||
which is similar to LS-WXL, but there's no such on LS-VL.
|
||||
|
||||
So after the split, common part goes into .dtsi file:
|
||||
- kirkwood-linkstation-6282.dtsi
|
||||
while all rest part goes into device specific .dts file:
|
||||
- kirkwood-linkstation-lsvl.dts
|
||||
- kirkwood-linkstation-lswvl.dts
|
||||
|
||||
Signed-off-by: Roger Shimizu <rogershimizu@gmail.com>
|
||||
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
|
||||
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
|
||||
---
|
||||
.../devicetree/bindings/arm/marvell,kirkwood.txt | 3 +-
|
||||
arch/arm/boot/dts/Makefile | 3 +-
|
||||
arch/arm/boot/dts/kirkwood-linkstation-6282.dtsi | 192 ++++++++++++
|
||||
arch/arm/boot/dts/kirkwood-linkstation-lsvl.dts | 57 ++++
|
||||
arch/arm/boot/dts/kirkwood-linkstation-lswvl.dts | 112 +++++++
|
||||
arch/arm/boot/dts/kirkwood-lswvl.dts | 335 ---------------------
|
||||
6 files changed, 365 insertions(+), 337 deletions(-)
|
||||
create mode 100644 arch/arm/boot/dts/kirkwood-linkstation-6282.dtsi
|
||||
create mode 100644 arch/arm/boot/dts/kirkwood-linkstation-lsvl.dts
|
||||
create mode 100644 arch/arm/boot/dts/kirkwood-linkstation-lswvl.dts
|
||||
delete mode 100644 arch/arm/boot/dts/kirkwood-lswvl.dts
|
||||
|
||||
--- a/Documentation/devicetree/bindings/arm/marvell,kirkwood.txt
|
||||
+++ b/Documentation/devicetree/bindings/arm/marvell,kirkwood.txt
|
||||
@@ -19,10 +19,11 @@ SoC. Currently known SoC compatibles are
|
||||
And in addition, the compatible shall be extended with the specific
|
||||
board. Currently known boards are:
|
||||
|
||||
+"buffalo,linkstation-lsvl"
|
||||
"buffalo,linkstation-lswsxl"
|
||||
"buffalo,linkstation-lswxl"
|
||||
+"buffalo,linkstation-lswvl"
|
||||
"buffalo,lschlv2"
|
||||
-"buffalo,lswvl"
|
||||
"buffalo,lsxhl"
|
||||
"buffalo,lsxl"
|
||||
"cloudengines,pogo02"
|
||||
--- a/arch/arm/boot/dts/Makefile
|
||||
+++ b/arch/arm/boot/dts/Makefile
|
||||
@@ -189,10 +189,11 @@ dtb-$(CONFIG_MACH_KIRKWOOD) += \
|
||||
kirkwood-is2.dtb \
|
||||
kirkwood-km_kirkwood.dtb \
|
||||
kirkwood-laplug.dtb \
|
||||
+ kirkwood-linkstation-lsvl.dtb \
|
||||
kirkwood-linkstation-lswsxl.dtb \
|
||||
+ kirkwood-linkstation-lswvl.dtb \
|
||||
kirkwood-linkstation-lswxl.dtb \
|
||||
kirkwood-lschlv2.dtb \
|
||||
- kirkwood-lswvl.dtb \
|
||||
kirkwood-lsxhl.dtb \
|
||||
kirkwood-mplcec4.dtb \
|
||||
kirkwood-mv88f6281gtw-ge.dtb \
|
||||
--- /dev/null
|
||||
+++ b/arch/arm/boot/dts/kirkwood-linkstation-6282.dtsi
|
||||
@@ -0,0 +1,192 @@
|
||||
+/*
|
||||
+ * Device Tree common file for kirkwood-6282 based Buffalo Linkstation
|
||||
+ *
|
||||
+ * Copyright (C) 2015, 2016
|
||||
+ * Roger Shimizu <rogershimizu@gmail.com>
|
||||
+ *
|
||||
+ * This file is dual-licensed: you can use it either under the terms
|
||||
+ * of the GPL or the X11 license, at your option. Note that this dual
|
||||
+ * licensing only applies to this file, and not this project as a
|
||||
+ * whole.
|
||||
+ *
|
||||
+ * a) This file is free software; you can redistribute it and/or
|
||||
+ * modify it under the terms of the GNU General Public License as
|
||||
+ * published by the Free Software Foundation; either version 2 of the
|
||||
+ * License, or (at your option) any later version.
|
||||
+ *
|
||||
+ * This file is distributed in the hope that it will be useful
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * Or, alternatively
|
||||
+ *
|
||||
+ * b) Permission is hereby granted, free of charge, to any person
|
||||
+ * obtaining a copy of this software and associated documentation
|
||||
+ * files (the "Software"), to deal in the Software without
|
||||
+ * restriction, including without limitation the rights to use
|
||||
+ * copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
+ * sell copies of the Software, and to permit persons to whom the
|
||||
+ * Software is furnished to do so, subject to the following
|
||||
+ * conditions:
|
||||
+ *
|
||||
+ * The above copyright notice and this permission notice shall be
|
||||
+ * included in all copies or substantial portions of the Software.
|
||||
+ *
|
||||
+ * THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND
|
||||
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
|
||||
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
+ * OTHER DEALINGS IN THE SOFTWARE.
|
||||
+ */
|
||||
+
|
||||
+#include "kirkwood.dtsi"
|
||||
+#include "kirkwood-6282.dtsi"
|
||||
+#include "kirkwood-linkstation.dtsi"
|
||||
+
|
||||
+/ {
|
||||
+ ocp@f1000000 {
|
||||
+ pinctrl: pin-controller@10000 {
|
||||
+ pmx_power_hdd0: pmx-power-hdd0 {
|
||||
+ marvell,pins = "mpp8";
|
||||
+ marvell,function = "gpio";
|
||||
+ };
|
||||
+ pmx_usb_vbus: pmx-usb-vbus {
|
||||
+ marvell,pins = "mpp12";
|
||||
+ marvell,function = "gpio";
|
||||
+ };
|
||||
+ pmx_fan_high: pmx-fan-high {
|
||||
+ marvell,pins = "mpp16";
|
||||
+ marvell,function = "gpio";
|
||||
+ };
|
||||
+ pmx_fan_low: pmx-fan-low {
|
||||
+ marvell,pins = "mpp17";
|
||||
+ marvell,function = "gpio";
|
||||
+ };
|
||||
+ pmx_led_alarm: pmx-led-alarm {
|
||||
+ marvell,pins = "mpp36";
|
||||
+ marvell,function = "gpio";
|
||||
+ };
|
||||
+ pmx_led_function_red: pmx-led-function-red {
|
||||
+ marvell,pins = "mpp37";
|
||||
+ marvell,function = "gpio";
|
||||
+ };
|
||||
+ pmx_led_info: pmx-led-info {
|
||||
+ marvell,pins = "mpp38";
|
||||
+ marvell,function = "gpio";
|
||||
+ };
|
||||
+ pmx_led_function_blue: pmx-led-function-blue {
|
||||
+ marvell,pins = "mpp39";
|
||||
+ marvell,function = "gpio";
|
||||
+ };
|
||||
+ pmx_led_power: pmx-led-power {
|
||||
+ marvell,pins = "mpp40";
|
||||
+ marvell,function = "gpio";
|
||||
+ };
|
||||
+ pmx_fan_lock: pmx-fan-lock {
|
||||
+ marvell,pins = "mpp43";
|
||||
+ marvell,function = "gpio";
|
||||
+ };
|
||||
+ pmx_button_function: pmx-button-function {
|
||||
+ marvell,pins = "mpp45";
|
||||
+ marvell,function = "gpio";
|
||||
+ };
|
||||
+ pmx_power_switch: pmx-power-switch {
|
||||
+ marvell,pins = "mpp46";
|
||||
+ marvell,function = "gpio";
|
||||
+ };
|
||||
+ pmx_power_auto_switch: pmx-power-auto-switch {
|
||||
+ marvell,pins = "mpp47";
|
||||
+ marvell,function = "gpio";
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ gpio_keys {
|
||||
+ function-button {
|
||||
+ gpios = <&gpio1 13 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ power-on-switch {
|
||||
+ gpios = <&gpio1 14 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ power-auto-switch {
|
||||
+ gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ gpio_leds {
|
||||
+ red-alarm-led {
|
||||
+ label = "linkstation:red:alarm";
|
||||
+ gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>;
|
||||
+ };
|
||||
+
|
||||
+ red-function-led {
|
||||
+ label = "linkstation:red:function";
|
||||
+ gpios = <&gpio1 5 GPIO_ACTIVE_HIGH>;
|
||||
+ };
|
||||
+
|
||||
+ amber-info-led {
|
||||
+ label = "linkstation:amber:info";
|
||||
+ gpios = <&gpio1 6 GPIO_ACTIVE_HIGH>;
|
||||
+ };
|
||||
+
|
||||
+ blue-function-led {
|
||||
+ label = "linkstation:blue:function";
|
||||
+ gpios = <&gpio1 7 GPIO_ACTIVE_HIGH>;
|
||||
+ };
|
||||
+
|
||||
+ blue-power-led {
|
||||
+ label = "linkstation:blue:power";
|
||||
+ gpios = <&gpio1 8 GPIO_ACTIVE_LOW>;
|
||||
+ default-state = "keep";
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ gpio_fan {
|
||||
+ compatible = "gpio-fan";
|
||||
+ pinctrl-0 = <&pmx_fan_low &pmx_fan_high &pmx_fan_lock>;
|
||||
+ pinctrl-names = "default";
|
||||
+
|
||||
+ gpios = <&gpio0 17 GPIO_ACTIVE_LOW
|
||||
+ &gpio0 16 GPIO_ACTIVE_LOW>;
|
||||
+
|
||||
+ gpio-fan,speed-map = <0 3
|
||||
+ 1500 2
|
||||
+ 3250 1
|
||||
+ 5000 0>;
|
||||
+
|
||||
+ alarm-gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>;
|
||||
+ };
|
||||
+
|
||||
+ regulators {
|
||||
+ usb_power: regulator@1 {
|
||||
+ gpio = <&gpio0 12 GPIO_ACTIVE_HIGH>;
|
||||
+ };
|
||||
+
|
||||
+ hdd_power0: regulator@2 {
|
||||
+ gpio = <&gpio0 8 GPIO_ACTIVE_HIGH>;
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&mdio {
|
||||
+ status = "okay";
|
||||
+
|
||||
+ ethphy0: ethernet-phy@0 {
|
||||
+ device_type = "ethernet-phy";
|
||||
+ reg = <0>;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+ð0 {
|
||||
+ status = "okay";
|
||||
+
|
||||
+ ethernet0-port@0 {
|
||||
+ phy-handle = <ðphy0>;
|
||||
+ };
|
||||
+};
|
||||
--- /dev/null
|
||||
+++ b/arch/arm/boot/dts/kirkwood-linkstation-lsvl.dts
|
||||
@@ -0,0 +1,57 @@
|
||||
+/*
|
||||
+ * Device Tree file for Buffalo Linkstation LS-VL
|
||||
+ *
|
||||
+ * Copyright (C) 2015, 2016
|
||||
+ * Roger Shimizu <rogershimizu@gmail.com>
|
||||
+ *
|
||||
+ * This file is dual-licensed: you can use it either under the terms
|
||||
+ * of the GPL or the X11 license, at your option. Note that this dual
|
||||
+ * licensing only applies to this file, and not this project as a
|
||||
+ * whole.
|
||||
+ *
|
||||
+ * a) This file is free software; you can redistribute it and/or
|
||||
+ * modify it under the terms of the GNU General Public License as
|
||||
+ * published by the Free Software Foundation; either version 2 of the
|
||||
+ * License, or (at your option) any later version.
|
||||
+ *
|
||||
+ * This file is distributed in the hope that it will be useful
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * Or, alternatively
|
||||
+ *
|
||||
+ * b) Permission is hereby granted, free of charge, to any person
|
||||
+ * obtaining a copy of this software and associated documentation
|
||||
+ * files (the "Software"), to deal in the Software without
|
||||
+ * restriction, including without limitation the rights to use
|
||||
+ * copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
+ * sell copies of the Software, and to permit persons to whom the
|
||||
+ * Software is furnished to do so, subject to the following
|
||||
+ * conditions:
|
||||
+ *
|
||||
+ * The above copyright notice and this permission notice shall be
|
||||
+ * included in all copies or substantial portions of the Software.
|
||||
+ *
|
||||
+ * THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND
|
||||
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
|
||||
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
+ * OTHER DEALINGS IN THE SOFTWARE.
|
||||
+ */
|
||||
+
|
||||
+/dts-v1/;
|
||||
+#include "kirkwood-linkstation-6282.dtsi"
|
||||
+
|
||||
+/ {
|
||||
+ model = "Buffalo Linkstation LS-VL";
|
||||
+ compatible = "buffalo,lsvl", "marvell,kirkwood-88f6282", "marvell,kirkwood";
|
||||
+
|
||||
+ memory { /* 256 MB */
|
||||
+ device_type = "memory";
|
||||
+ reg = <0x00000000 0x10000000>;
|
||||
+ };
|
||||
+};
|
||||
--- /dev/null
|
||||
+++ b/arch/arm/boot/dts/kirkwood-linkstation-lswvl.dts
|
||||
@@ -0,0 +1,112 @@
|
||||
+/*
|
||||
+ * Device Tree file for Buffalo Linkstation LS-WVL
|
||||
+ *
|
||||
+ * Copyright (C) 2015, 2016
|
||||
+ * Roger Shimizu <rogershimizu@gmail.com>
|
||||
+ *
|
||||
+ * This file is dual-licensed: you can use it either under the terms
|
||||
+ * of the GPL or the X11 license, at your option. Note that this dual
|
||||
+ * licensing only applies to this file, and not this project as a
|
||||
+ * whole.
|
||||
+ *
|
||||
+ * a) This file is free software; you can redistribute it and/or
|
||||
+ * modify it under the terms of the GNU General Public License as
|
||||
+ * published by the Free Software Foundation; either version 2 of the
|
||||
+ * License, or (at your option) any later version.
|
||||
+ *
|
||||
+ * This file is distributed in the hope that it will be useful
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * Or, alternatively
|
||||
+ *
|
||||
+ * b) Permission is hereby granted, free of charge, to any person
|
||||
+ * obtaining a copy of this software and associated documentation
|
||||
+ * files (the "Software"), to deal in the Software without
|
||||
+ * restriction, including without limitation the rights to use
|
||||
+ * copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
+ * sell copies of the Software, and to permit persons to whom the
|
||||
+ * Software is furnished to do so, subject to the following
|
||||
+ * conditions:
|
||||
+ *
|
||||
+ * The above copyright notice and this permission notice shall be
|
||||
+ * included in all copies or substantial portions of the Software.
|
||||
+ *
|
||||
+ * THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND
|
||||
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
|
||||
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
+ * OTHER DEALINGS IN THE SOFTWARE.
|
||||
+ */
|
||||
+
|
||||
+/dts-v1/;
|
||||
+#include "kirkwood-linkstation-6282.dtsi"
|
||||
+
|
||||
+/ {
|
||||
+ model = "Buffalo Linkstation LS-WVL";
|
||||
+ compatible = "buffalo,lswvl","marvell,kirkwood-88f6282", "marvell,kirkwood";
|
||||
+
|
||||
+ memory { /* 256 MB */
|
||||
+ device_type = "memory";
|
||||
+ reg = <0x00000000 0x10000000>;
|
||||
+ };
|
||||
+
|
||||
+ ocp@f1000000 {
|
||||
+ pinctrl: pin-controller@10000 {
|
||||
+ pmx_power_hdd1: pmx-power-hdd1 {
|
||||
+ marvell,pins = "mpp9";
|
||||
+ marvell,function = "gpio";
|
||||
+ };
|
||||
+ pmx_led_hdderr0: pmx-led-hdderr0 {
|
||||
+ marvell,pins = "mpp34";
|
||||
+ marvell,function = "gpio";
|
||||
+ };
|
||||
+ pmx_led_hdderr1: pmx-led-hdderr1 {
|
||||
+ marvell,pins = "mpp35";
|
||||
+ marvell,function = "gpio";
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ sata@80000 {
|
||||
+ nr-ports = <2>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ gpio_leds {
|
||||
+ pinctrl-0 = <&pmx_led_function_red &pmx_led_alarm
|
||||
+ &pmx_led_info &pmx_led_power
|
||||
+ &pmx_led_function_blue
|
||||
+ &pmx_led_hdderr0
|
||||
+ &pmx_led_hdderr1>;
|
||||
+
|
||||
+ red-hdderr0-led {
|
||||
+ label = "linkstation:red:hdderr0";
|
||||
+ gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>;
|
||||
+ };
|
||||
+
|
||||
+ red-hdderr1-led {
|
||||
+ label = "linkstation:red:hdderr1";
|
||||
+ gpios = <&gpio1 3 GPIO_ACTIVE_HIGH>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ regulators {
|
||||
+ pinctrl-0 = <&pmx_power_hdd0 &pmx_power_hdd1 &pmx_usb_vbus>;
|
||||
+
|
||||
+ hdd_power1: regulator@3 {
|
||||
+ compatible = "regulator-fixed";
|
||||
+ reg = <3>;
|
||||
+ regulator-name = "HDD1 Power";
|
||||
+ regulator-min-microvolt = <5000000>;
|
||||
+ regulator-max-microvolt = <5000000>;
|
||||
+ enable-active-high;
|
||||
+ regulator-always-on;
|
||||
+ regulator-boot-on;
|
||||
+ gpio = <&gpio0 9 GPIO_ACTIVE_HIGH>;
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
--- a/arch/arm/boot/dts/kirkwood-lswvl.dts
|
||||
+++ /dev/null
|
||||
@@ -1,335 +0,0 @@
|
||||
-/*
|
||||
- * Device Tree file for Buffalo Linkstation LS-WVL/VL
|
||||
- *
|
||||
- * Copyright (C) 2015, 2016
|
||||
- * Roger Shimizu <rogershimizu@gmail.com>
|
||||
- *
|
||||
- * This file is dual-licensed: you can use it either under the terms
|
||||
- * of the GPL or the X11 license, at your option. Note that this dual
|
||||
- * licensing only applies to this file, and not this project as a
|
||||
- * whole.
|
||||
- *
|
||||
- * a) This file is free software; you can redistribute it and/or
|
||||
- * modify it under the terms of the GNU General Public License as
|
||||
- * published by the Free Software Foundation; either version 2 of the
|
||||
- * License, or (at your option) any later version.
|
||||
- *
|
||||
- * This file is distributed in the hope that it will be useful
|
||||
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
- * GNU General Public License for more details.
|
||||
- *
|
||||
- * Or, alternatively
|
||||
- *
|
||||
- * b) Permission is hereby granted, free of charge, to any person
|
||||
- * obtaining a copy of this software and associated documentation
|
||||
- * files (the "Software"), to deal in the Software without
|
||||
- * restriction, including without limitation the rights to use
|
||||
- * copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
- * sell copies of the Software, and to permit persons to whom the
|
||||
- * Software is furnished to do so, subject to the following
|
||||
- * conditions:
|
||||
- *
|
||||
- * The above copyright notice and this permission notice shall be
|
||||
- * included in all copies or substantial portions of the Software.
|
||||
- *
|
||||
- * THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND
|
||||
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
|
||||
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
- * OTHER DEALINGS IN THE SOFTWARE.
|
||||
- */
|
||||
-
|
||||
-/dts-v1/;
|
||||
-
|
||||
-#include "kirkwood.dtsi"
|
||||
-#include "kirkwood-6282.dtsi"
|
||||
-
|
||||
-/ {
|
||||
- model = "Buffalo Linkstation LS-WVL/VL";
|
||||
- compatible = "buffalo,lswvl", "buffalo,lsvl", "marvell,kirkwood-88f6282", "marvell,kirkwood";
|
||||
-
|
||||
- memory { /* 256 MB */
|
||||
- device_type = "memory";
|
||||
- reg = <0x00000000 0x10000000>;
|
||||
- };
|
||||
-
|
||||
- chosen {
|
||||
- bootargs = "console=ttyS0,115200n8 earlyprintk";
|
||||
- stdout-path = &uart0;
|
||||
- };
|
||||
-
|
||||
- mbus {
|
||||
- pcie-controller {
|
||||
- status = "okay";
|
||||
- pcie@1,0 {
|
||||
- status = "okay";
|
||||
- };
|
||||
- };
|
||||
- };
|
||||
-
|
||||
- ocp@f1000000 {
|
||||
- pinctrl: pin-controller@10000 {
|
||||
- pmx_power_hdd0: pmx-power-hdd0 {
|
||||
- marvell,pins = "mpp8";
|
||||
- marvell,function = "gpio";
|
||||
- };
|
||||
- pmx_power_hdd1: pmx-power-hdd1 {
|
||||
- marvell,pins = "mpp9";
|
||||
- marvell,function = "gpio";
|
||||
- };
|
||||
- pmx_usb_vbus: pmx-usb-vbus {
|
||||
- marvell,pins = "mpp12";
|
||||
- marvell,function = "gpio";
|
||||
- };
|
||||
- pmx_fan_high: pmx-fan-high {
|
||||
- marvell,pins = "mpp16";
|
||||
- marvell,function = "gpio";
|
||||
- };
|
||||
- pmx_fan_low: pmx-fan-low {
|
||||
- marvell,pins = "mpp17";
|
||||
- marvell,function = "gpio";
|
||||
- };
|
||||
- pmx_led_hdderr0: pmx-led-hdderr0 {
|
||||
- marvell,pins = "mpp34";
|
||||
- marvell,function = "gpio";
|
||||
- };
|
||||
- pmx_led_hdderr1: pmx-led-hdderr1 {
|
||||
- marvell,pins = "mpp35";
|
||||
- marvell,function = "gpio";
|
||||
- };
|
||||
- pmx_led_alarm: pmx-led-alarm {
|
||||
- marvell,pins = "mpp36";
|
||||
- marvell,function = "gpio";
|
||||
- };
|
||||
- pmx_led_function_red: pmx-led-function-red {
|
||||
- marvell,pins = "mpp37";
|
||||
- marvell,function = "gpio";
|
||||
- };
|
||||
- pmx_led_info: pmx-led-info {
|
||||
- marvell,pins = "mpp38";
|
||||
- marvell,function = "gpio";
|
||||
- };
|
||||
- pmx_led_function_blue: pmx-led-function-blue {
|
||||
- marvell,pins = "mpp39";
|
||||
- marvell,function = "gpio";
|
||||
- };
|
||||
- pmx_led_power: pmx-led-power {
|
||||
- marvell,pins = "mpp40";
|
||||
- marvell,function = "gpio";
|
||||
- };
|
||||
- pmx_fan_lock: pmx-fan-lock {
|
||||
- marvell,pins = "mpp43";
|
||||
- marvell,function = "gpio";
|
||||
- };
|
||||
- pmx_button_function: pmx-button-function {
|
||||
- marvell,pins = "mpp45";
|
||||
- marvell,function = "gpio";
|
||||
- };
|
||||
- pmx_power_switch: pmx-power-switch {
|
||||
- marvell,pins = "mpp46";
|
||||
- marvell,function = "gpio";
|
||||
- };
|
||||
- pmx_power_auto_switch: pmx-power-auto-switch {
|
||||
- marvell,pins = "mpp47";
|
||||
- marvell,function = "gpio";
|
||||
- };
|
||||
- };
|
||||
-
|
||||
- serial@12000 {
|
||||
- status = "okay";
|
||||
- };
|
||||
-
|
||||
- sata@80000 {
|
||||
- status = "okay";
|
||||
- nr-ports = <2>;
|
||||
- };
|
||||
-
|
||||
- spi@10600 {
|
||||
- status = "okay";
|
||||
-
|
||||
- m25p40@0 {
|
||||
- #address-cells = <1>;
|
||||
- #size-cells = <1>;
|
||||
- compatible = "st,m25p40", "jedec,spi-nor";
|
||||
- reg = <0>;
|
||||
- spi-max-frequency = <25000000>;
|
||||
- mode = <0>;
|
||||
-
|
||||
- partition@0 {
|
||||
- reg = <0x0 0x60000>;
|
||||
- label = "uboot";
|
||||
- read-only;
|
||||
- };
|
||||
-
|
||||
- partition@60000 {
|
||||
- reg = <0x60000 0x10000>;
|
||||
- label = "dtb";
|
||||
- read-only;
|
||||
- };
|
||||
-
|
||||
- partition@70000 {
|
||||
- reg = <0x70000 0x10000>;
|
||||
- label = "uboot_env";
|
||||
- };
|
||||
- };
|
||||
- };
|
||||
- };
|
||||
-
|
||||
- gpio_keys {
|
||||
- compatible = "gpio-keys";
|
||||
- #address-cells = <1>;
|
||||
- #size-cells = <0>;
|
||||
- pinctrl-0 = <&pmx_button_function &pmx_power_switch
|
||||
- &pmx_power_auto_switch>;
|
||||
- pinctrl-names = "default";
|
||||
-
|
||||
- button@1 {
|
||||
- label = "Function Button";
|
||||
- linux,code = <KEY_OPTION>;
|
||||
- gpios = <&gpio1 13 GPIO_ACTIVE_LOW>;
|
||||
- };
|
||||
-
|
||||
- button@2 {
|
||||
- label = "Power-on Switch";
|
||||
- linux,code = <KEY_RESERVED>;
|
||||
- linux,input-type = <5>;
|
||||
- gpios = <&gpio1 14 GPIO_ACTIVE_LOW>;
|
||||
- };
|
||||
-
|
||||
- button@3 {
|
||||
- label = "Power-auto Switch";
|
||||
- linux,code = <KEY_ESC>;
|
||||
- linux,input-type = <5>;
|
||||
- gpios = <&gpio1 15 GPIO_ACTIVE_LOW>;
|
||||
- };
|
||||
- };
|
||||
-
|
||||
- gpio_leds {
|
||||
- compatible = "gpio-leds";
|
||||
- pinctrl-0 = <&pmx_led_function_red &pmx_led_alarm
|
||||
- &pmx_led_info &pmx_led_power
|
||||
- &pmx_led_function_blue
|
||||
- &pmx_led_hdderr0
|
||||
- &pmx_led_hdderr1>;
|
||||
- pinctrl-names = "default";
|
||||
-
|
||||
- led@1 {
|
||||
- label = "lswvl:red:alarm";
|
||||
- gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>;
|
||||
- };
|
||||
-
|
||||
- led@2 {
|
||||
- label = "lswvl:red:func";
|
||||
- gpios = <&gpio1 5 GPIO_ACTIVE_HIGH>;
|
||||
- };
|
||||
-
|
||||
- led@3 {
|
||||
- label = "lswvl:amber:info";
|
||||
- gpios = <&gpio1 6 GPIO_ACTIVE_HIGH>;
|
||||
- };
|
||||
-
|
||||
- led@4 {
|
||||
- label = "lswvl:blue:func";
|
||||
- gpios = <&gpio1 7 GPIO_ACTIVE_HIGH>;
|
||||
- };
|
||||
-
|
||||
- led@5 {
|
||||
- label = "lswvl:blue:power";
|
||||
- gpios = <&gpio1 8 GPIO_ACTIVE_LOW>;
|
||||
- default-state = "keep";
|
||||
- };
|
||||
-
|
||||
- led@6 {
|
||||
- label = "lswvl:red:hdderr0";
|
||||
- gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>;
|
||||
- };
|
||||
-
|
||||
- led@7 {
|
||||
- label = "lswvl:red:hdderr1";
|
||||
- gpios = <&gpio1 3 GPIO_ACTIVE_HIGH>;
|
||||
- };
|
||||
- };
|
||||
-
|
||||
- gpio_fan {
|
||||
- compatible = "gpio-fan";
|
||||
- pinctrl-0 = <&pmx_fan_low &pmx_fan_high &pmx_fan_lock>;
|
||||
- pinctrl-names = "default";
|
||||
-
|
||||
- gpios = <&gpio0 17 GPIO_ACTIVE_LOW
|
||||
- &gpio0 16 GPIO_ACTIVE_LOW>;
|
||||
-
|
||||
- gpio-fan,speed-map = <0 3
|
||||
- 1500 2
|
||||
- 3250 1
|
||||
- 5000 0>;
|
||||
-
|
||||
- alarm-gpios = <&gpio1 11 GPIO_ACTIVE_HIGH>;
|
||||
- };
|
||||
-
|
||||
- restart_poweroff {
|
||||
- compatible = "restart-poweroff";
|
||||
- };
|
||||
-
|
||||
- regulators {
|
||||
- compatible = "simple-bus";
|
||||
- #address-cells = <1>;
|
||||
- #size-cells = <0>;
|
||||
- pinctrl-0 = <&pmx_power_hdd0 &pmx_power_hdd1 &pmx_usb_vbus>;
|
||||
- pinctrl-names = "default";
|
||||
-
|
||||
- usb_power: regulator@1 {
|
||||
- compatible = "regulator-fixed";
|
||||
- reg = <1>;
|
||||
- regulator-name = "USB Power";
|
||||
- regulator-min-microvolt = <5000000>;
|
||||
- regulator-max-microvolt = <5000000>;
|
||||
- enable-active-high;
|
||||
- regulator-always-on;
|
||||
- regulator-boot-on;
|
||||
- gpio = <&gpio0 12 GPIO_ACTIVE_HIGH>;
|
||||
- };
|
||||
- hdd_power0: regulator@2 {
|
||||
- compatible = "regulator-fixed";
|
||||
- reg = <2>;
|
||||
- regulator-name = "HDD0 Power";
|
||||
- regulator-min-microvolt = <5000000>;
|
||||
- regulator-max-microvolt = <5000000>;
|
||||
- enable-active-high;
|
||||
- regulator-always-on;
|
||||
- regulator-boot-on;
|
||||
- gpio = <&gpio0 8 GPIO_ACTIVE_HIGH>;
|
||||
- };
|
||||
- hdd_power1: regulator@3 {
|
||||
- compatible = "regulator-fixed";
|
||||
- reg = <3>;
|
||||
- regulator-name = "HDD1 Power";
|
||||
- regulator-min-microvolt = <5000000>;
|
||||
- regulator-max-microvolt = <5000000>;
|
||||
- enable-active-high;
|
||||
- regulator-always-on;
|
||||
- regulator-boot-on;
|
||||
- gpio = <&gpio0 9 GPIO_ACTIVE_HIGH>;
|
||||
- };
|
||||
- };
|
||||
-};
|
||||
-
|
||||
-&mdio {
|
||||
- status = "okay";
|
||||
-
|
||||
- ethphy0: ethernet-phy@0 {
|
||||
- device_type = "ethernet-phy";
|
||||
- reg = <0>;
|
||||
- };
|
||||
-};
|
||||
-
|
||||
-ð0 {
|
||||
- status = "okay";
|
||||
-
|
||||
- ethernet0-port@0 {
|
||||
- phy-handle = <ðphy0>;
|
||||
- };
|
||||
-};
|
|
@ -1,975 +0,0 @@
|
|||
From: Roger Shimizu <rogershimizu@gmail.com>
|
||||
Date: Thu, 21 Jan 2016 23:38:49 +0900
|
||||
Subject: ARM: dts: kirkwood: split lswxl dts to linkstation lswsxl and lswxl
|
||||
Origin: https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/?id=b05465ff5b5e90d6d25d3f6c4e8ac6b2b3159435
|
||||
|
||||
LS-WXL/WSXL are both kirkwood-6281 based 2-Bay NAS devices, which share
|
||||
many MPP pins. However they are slightly different:
|
||||
- There're two red LED indicator on LS-WXL to show when HDD fails,
|
||||
but there's no such on LS-WSXL.
|
||||
- There's 4-level speed adjustable FAN on LS-WXL, but not LS-WSXL.
|
||||
|
||||
So after the split, common part goes into .dtsi file:
|
||||
- kirkwood-linkstation.dtsi
|
||||
- kirkwood-linkstation-duo-6281.dtsi
|
||||
while all rest part goes into device specific .dts file:
|
||||
- kirkwood-linkstation-lswsxl.dts
|
||||
- kirkwood-linkstation-lswxl.dts
|
||||
|
||||
Signed-off-by: Roger Shimizu <rogershimizu@gmail.com>
|
||||
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
|
||||
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
|
||||
---
|
||||
.../devicetree/bindings/arm/marvell,kirkwood.txt | 3 +-
|
||||
arch/arm/boot/dts/Makefile | 3 +-
|
||||
.../boot/dts/kirkwood-linkstation-duo-6281.dtsi | 186 ++++++++++++
|
||||
arch/arm/boot/dts/kirkwood-linkstation-lswsxl.dts | 57 ++++
|
||||
arch/arm/boot/dts/kirkwood-linkstation-lswxl.dts | 116 +++++++
|
||||
arch/arm/boot/dts/kirkwood-linkstation.dtsi | 202 +++++++++++++
|
||||
arch/arm/boot/dts/kirkwood-lswxl.dts | 335 ---------------------
|
||||
7 files changed, 565 insertions(+), 337 deletions(-)
|
||||
create mode 100644 arch/arm/boot/dts/kirkwood-linkstation-duo-6281.dtsi
|
||||
create mode 100644 arch/arm/boot/dts/kirkwood-linkstation-lswsxl.dts
|
||||
create mode 100644 arch/arm/boot/dts/kirkwood-linkstation-lswxl.dts
|
||||
create mode 100644 arch/arm/boot/dts/kirkwood-linkstation.dtsi
|
||||
delete mode 100644 arch/arm/boot/dts/kirkwood-lswxl.dts
|
||||
|
||||
--- a/Documentation/devicetree/bindings/arm/marvell,kirkwood.txt
|
||||
+++ b/Documentation/devicetree/bindings/arm/marvell,kirkwood.txt
|
||||
@@ -19,9 +19,10 @@ SoC. Currently known SoC compatibles are
|
||||
And in addition, the compatible shall be extended with the specific
|
||||
board. Currently known boards are:
|
||||
|
||||
+"buffalo,linkstation-lswsxl"
|
||||
+"buffalo,linkstation-lswxl"
|
||||
"buffalo,lschlv2"
|
||||
"buffalo,lswvl"
|
||||
-"buffalo,lswxl"
|
||||
"buffalo,lsxhl"
|
||||
"buffalo,lsxl"
|
||||
"cloudengines,pogo02"
|
||||
--- a/arch/arm/boot/dts/Makefile
|
||||
+++ b/arch/arm/boot/dts/Makefile
|
||||
@@ -189,9 +189,10 @@ dtb-$(CONFIG_MACH_KIRKWOOD) += \
|
||||
kirkwood-is2.dtb \
|
||||
kirkwood-km_kirkwood.dtb \
|
||||
kirkwood-laplug.dtb \
|
||||
+ kirkwood-linkstation-lswsxl.dtb \
|
||||
+ kirkwood-linkstation-lswxl.dtb \
|
||||
kirkwood-lschlv2.dtb \
|
||||
kirkwood-lswvl.dtb \
|
||||
- kirkwood-lswxl.dtb \
|
||||
kirkwood-lsxhl.dtb \
|
||||
kirkwood-mplcec4.dtb \
|
||||
kirkwood-mv88f6281gtw-ge.dtb \
|
||||
--- /dev/null
|
||||
+++ b/arch/arm/boot/dts/kirkwood-linkstation-duo-6281.dtsi
|
||||
@@ -0,0 +1,186 @@
|
||||
+/*
|
||||
+ * Device Tree common file for kirkwood-6281 based 2-Bay Buffalo Linkstation
|
||||
+ *
|
||||
+ * Copyright (C) 2015, 2016
|
||||
+ * Roger Shimizu <rogershimizu@gmail.com>
|
||||
+ *
|
||||
+ * This file is dual-licensed: you can use it either under the terms
|
||||
+ * of the GPL or the X11 license, at your option. Note that this dual
|
||||
+ * licensing only applies to this file, and not this project as a
|
||||
+ * whole.
|
||||
+ *
|
||||
+ * a) This file is free software; you can redistribute it and/or
|
||||
+ * modify it under the terms of the GNU General Public License as
|
||||
+ * published by the Free Software Foundation; either version 2 of the
|
||||
+ * License, or (at your option) any later version.
|
||||
+ *
|
||||
+ * This file is distributed in the hope that it will be useful
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * Or, alternatively
|
||||
+ *
|
||||
+ * b) Permission is hereby granted, free of charge, to any person
|
||||
+ * obtaining a copy of this software and associated documentation
|
||||
+ * files (the "Software"), to deal in the Software without
|
||||
+ * restriction, including without limitation the rights to use
|
||||
+ * copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
+ * sell copies of the Software, and to permit persons to whom the
|
||||
+ * Software is furnished to do so, subject to the following
|
||||
+ * conditions:
|
||||
+ *
|
||||
+ * The above copyright notice and this permission notice shall be
|
||||
+ * included in all copies or substantial portions of the Software.
|
||||
+ *
|
||||
+ * THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND
|
||||
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
|
||||
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
+ * OTHER DEALINGS IN THE SOFTWARE.
|
||||
+ */
|
||||
+
|
||||
+#include "kirkwood.dtsi"
|
||||
+#include "kirkwood-6281.dtsi"
|
||||
+#include "kirkwood-linkstation.dtsi"
|
||||
+
|
||||
+/ {
|
||||
+ ocp@f1000000 {
|
||||
+ pinctrl: pin-controller@10000 {
|
||||
+ pmx_power_hdd0: pmx-power-hdd0 {
|
||||
+ marvell,pins = "mpp28";
|
||||
+ marvell,function = "gpio";
|
||||
+ };
|
||||
+ pmx_power_hdd1: pmx-power-hdd1 {
|
||||
+ marvell,pins = "mpp29";
|
||||
+ marvell,function = "gpio";
|
||||
+ };
|
||||
+ pmx_usb_vbus: pmx-usb-vbus {
|
||||
+ marvell,pins = "mpp37";
|
||||
+ marvell,function = "gpio";
|
||||
+ };
|
||||
+ pmx_led_alarm: pmx-led-alarm {
|
||||
+ marvell,pins = "mpp49";
|
||||
+ marvell,function = "gpio";
|
||||
+ };
|
||||
+ pmx_led_function_red: pmx-led-function-red {
|
||||
+ marvell,pins = "mpp34";
|
||||
+ marvell,function = "gpio";
|
||||
+ };
|
||||
+ pmx_led_function_blue: pmx-led-function-blue {
|
||||
+ marvell,pins = "mpp36";
|
||||
+ marvell,function = "gpio";
|
||||
+ };
|
||||
+ pmx_led_info: pmx-led-info {
|
||||
+ marvell,pins = "mpp38";
|
||||
+ marvell,function = "gpio";
|
||||
+ };
|
||||
+ pmx_led_power: pmx-led-power {
|
||||
+ marvell,pins = "mpp39";
|
||||
+ marvell,function = "gpio";
|
||||
+ };
|
||||
+ pmx_button_function: pmx-button-function {
|
||||
+ marvell,pins = "mpp41";
|
||||
+ marvell,function = "gpio";
|
||||
+ };
|
||||
+ pmx_power_switch: pmx-power-switch {
|
||||
+ marvell,pins = "mpp42";
|
||||
+ marvell,function = "gpio";
|
||||
+ };
|
||||
+ pmx_power_auto_switch: pmx-power-auto-switch {
|
||||
+ marvell,pins = "mpp43";
|
||||
+ marvell,function = "gpio";
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ sata@80000 {
|
||||
+ nr-ports = <2>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ gpio_keys {
|
||||
+ function-button {
|
||||
+ gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ power-on-switch {
|
||||
+ gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ power-auto-switch {
|
||||
+ gpios = <&gpio1 11 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ gpio_leds {
|
||||
+ red-alarm-led {
|
||||
+ label = "linkstation:red:alarm";
|
||||
+ gpios = <&gpio1 17 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ red-function-led {
|
||||
+ label = "linkstation:red:function";
|
||||
+ gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>;
|
||||
+ };
|
||||
+
|
||||
+ amber-info-led {
|
||||
+ label = "linkstation:amber:info";
|
||||
+ gpios = <&gpio1 6 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ blue-function-led {
|
||||
+ label = "linkstation:blue:function";
|
||||
+ gpios = <&gpio1 4 GPIO_ACTIVE_LOW>;
|
||||
+ };
|
||||
+
|
||||
+ blue-power-led {
|
||||
+ label = "linkstation:blue:power";
|
||||
+ gpios = <&gpio1 7 GPIO_ACTIVE_HIGH>;
|
||||
+ default-state = "keep";
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ regulators {
|
||||
+ pinctrl-0 = <&pmx_power_hdd0 &pmx_power_hdd1 &pmx_usb_vbus>;
|
||||
+
|
||||
+ usb_power: regulator@1 {
|
||||
+ gpio = <&gpio1 5 GPIO_ACTIVE_HIGH>;
|
||||
+ };
|
||||
+
|
||||
+ hdd_power0: regulator@2 {
|
||||
+ gpio = <&gpio0 28 GPIO_ACTIVE_HIGH>;
|
||||
+ };
|
||||
+
|
||||
+ hdd_power1: regulator@3 {
|
||||
+ compatible = "regulator-fixed";
|
||||
+ reg = <3>;
|
||||
+ regulator-name = "HDD1 Power";
|
||||
+ regulator-min-microvolt = <5000000>;
|
||||
+ regulator-max-microvolt = <5000000>;
|
||||
+ enable-active-high;
|
||||
+ regulator-always-on;
|
||||
+ regulator-boot-on;
|
||||
+ gpio = <&gpio0 29 GPIO_ACTIVE_HIGH>;
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&mdio {
|
||||
+ status = "okay";
|
||||
+
|
||||
+ ethphy1: ethernet-phy@8 {
|
||||
+ device_type = "ethernet-phy";
|
||||
+ reg = <8>;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+ð1 {
|
||||
+ status = "okay";
|
||||
+
|
||||
+ ethernet1-port@0 {
|
||||
+ phy-handle = <ðphy1>;
|
||||
+ };
|
||||
+};
|
||||
--- /dev/null
|
||||
+++ b/arch/arm/boot/dts/kirkwood-linkstation-lswsxl.dts
|
||||
@@ -0,0 +1,57 @@
|
||||
+/*
|
||||
+ * Device Tree file for Buffalo Linkstation LS-WSXL
|
||||
+ *
|
||||
+ * Copyright (C) 2015, 2016
|
||||
+ * Roger Shimizu <rogershimizu@gmail.com>
|
||||
+ *
|
||||
+ * This file is dual-licensed: you can use it either under the terms
|
||||
+ * of the GPL or the X11 license, at your option. Note that this dual
|
||||
+ * licensing only applies to this file, and not this project as a
|
||||
+ * whole.
|
||||
+ *
|
||||
+ * a) This file is free software; you can redistribute it and/or
|
||||
+ * modify it under the terms of the GNU General Public License as
|
||||
+ * published by the Free Software Foundation; either version 2 of the
|
||||
+ * License, or (at your option) any later version.
|
||||
+ *
|
||||
+ * This file is distributed in the hope that it will be useful
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * Or, alternatively
|
||||
+ *
|
||||
+ * b) Permission is hereby granted, free of charge, to any person
|
||||
+ * obtaining a copy of this software and associated documentation
|
||||
+ * files (the "Software"), to deal in the Software without
|
||||
+ * restriction, including without limitation the rights to use
|
||||
+ * copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
+ * sell copies of the Software, and to permit persons to whom the
|
||||
+ * Software is furnished to do so, subject to the following
|
||||
+ * conditions:
|
||||
+ *
|
||||
+ * The above copyright notice and this permission notice shall be
|
||||
+ * included in all copies or substantial portions of the Software.
|
||||
+ *
|
||||
+ * THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND
|
||||
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
|
||||
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
+ * OTHER DEALINGS IN THE SOFTWARE.
|
||||
+ */
|
||||
+
|
||||
+/dts-v1/;
|
||||
+#include "kirkwood-linkstation-duo-6281.dtsi"
|
||||
+
|
||||
+/ {
|
||||
+ model = "Buffalo Linkstation LS-WSXL";
|
||||
+ compatible = "buffalo,lswsxl", "marvell,kirkwood-88f6281", "marvell,kirkwood";
|
||||
+
|
||||
+ memory { /* 128 MB */
|
||||
+ device_type = "memory";
|
||||
+ reg = <0x00000000 0x8000000>;
|
||||
+ };
|
||||
+};
|
||||
--- /dev/null
|
||||
+++ b/arch/arm/boot/dts/kirkwood-linkstation-lswxl.dts
|
||||
@@ -0,0 +1,116 @@
|
||||
+/*
|
||||
+ * Device Tree file for Buffalo Linkstation LS-WXL
|
||||
+ *
|
||||
+ * Copyright (C) 2015, 2016
|
||||
+ * Roger Shimizu <rogershimizu@gmail.com>
|
||||
+ *
|
||||
+ * This file is dual-licensed: you can use it either under the terms
|
||||
+ * of the GPL or the X11 license, at your option. Note that this dual
|
||||
+ * licensing only applies to this file, and not this project as a
|
||||
+ * whole.
|
||||
+ *
|
||||
+ * a) This file is free software; you can redistribute it and/or
|
||||
+ * modify it under the terms of the GNU General Public License as
|
||||
+ * published by the Free Software Foundation; either version 2 of the
|
||||
+ * License, or (at your option) any later version.
|
||||
+ *
|
||||
+ * This file is distributed in the hope that it will be useful
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * Or, alternatively
|
||||
+ *
|
||||
+ * b) Permission is hereby granted, free of charge, to any person
|
||||
+ * obtaining a copy of this software and associated documentation
|
||||
+ * files (the "Software"), to deal in the Software without
|
||||
+ * restriction, including without limitation the rights to use
|
||||
+ * copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
+ * sell copies of the Software, and to permit persons to whom the
|
||||
+ * Software is furnished to do so, subject to the following
|
||||
+ * conditions:
|
||||
+ *
|
||||
+ * The above copyright notice and this permission notice shall be
|
||||
+ * included in all copies or substantial portions of the Software.
|
||||
+ *
|
||||
+ * THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND
|
||||
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
|
||||
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
+ * OTHER DEALINGS IN THE SOFTWARE.
|
||||
+ */
|
||||
+
|
||||
+/dts-v1/;
|
||||
+#include "kirkwood-linkstation-duo-6281.dtsi"
|
||||
+
|
||||
+/ {
|
||||
+ model = "Buffalo Linkstation LS-WXL";
|
||||
+ compatible = "buffalo,lswxl", "marvell,kirkwood-88f6281", "marvell,kirkwood";
|
||||
+
|
||||
+ memory { /* 128 MB */
|
||||
+ device_type = "memory";
|
||||
+ reg = <0x00000000 0x8000000>;
|
||||
+ };
|
||||
+
|
||||
+ ocp@f1000000 {
|
||||
+ pinctrl: pin-controller@10000 {
|
||||
+ pmx_led_hdderr0: pmx-led-hdderr0 {
|
||||
+ marvell,pins = "mpp8";
|
||||
+ marvell,function = "gpio";
|
||||
+ };
|
||||
+ pmx_led_hdderr1: pmx-led-hdderr1 {
|
||||
+ marvell,pins = "mpp46";
|
||||
+ marvell,function = "gpio";
|
||||
+ };
|
||||
+ pmx_fan_lock: pmx-fan-lock {
|
||||
+ marvell,pins = "mpp40";
|
||||
+ marvell,function = "gpio";
|
||||
+ };
|
||||
+ pmx_fan_high: pmx-fan-high {
|
||||
+ marvell,pins = "mpp47";
|
||||
+ marvell,function = "gpio";
|
||||
+ };
|
||||
+ pmx_fan_low: pmx-fan-low {
|
||||
+ marvell,pins = "mpp48";
|
||||
+ marvell,function = "gpio";
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ gpio_leds {
|
||||
+ pinctrl-0 = <&pmx_led_function_red &pmx_led_alarm
|
||||
+ &pmx_led_info &pmx_led_power
|
||||
+ &pmx_led_function_blue
|
||||
+ &pmx_led_hdderr0
|
||||
+ &pmx_led_hdderr1>;
|
||||
+
|
||||
+ red-hdderr0-led {
|
||||
+ label = "linkstation:red:hdderr0";
|
||||
+ gpios = <&gpio0 8 GPIO_ACTIVE_HIGH>;
|
||||
+ };
|
||||
+
|
||||
+ red-hdderr1-led {
|
||||
+ label = "linkstation:red:hdderr1";
|
||||
+ gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ gpio_fan {
|
||||
+ compatible = "gpio-fan";
|
||||
+ pinctrl-0 = <&pmx_fan_low &pmx_fan_high &pmx_fan_lock>;
|
||||
+ pinctrl-names = "default";
|
||||
+
|
||||
+ gpios = <&gpio1 16 GPIO_ACTIVE_LOW
|
||||
+ &gpio1 15 GPIO_ACTIVE_LOW>;
|
||||
+
|
||||
+ gpio-fan,speed-map = <0 3
|
||||
+ 1500 2
|
||||
+ 3250 1
|
||||
+ 5000 0>;
|
||||
+
|
||||
+ alarm-gpios = <&gpio1 8 GPIO_ACTIVE_HIGH>;
|
||||
+ };
|
||||
+};
|
||||
--- /dev/null
|
||||
+++ b/arch/arm/boot/dts/kirkwood-linkstation.dtsi
|
||||
@@ -0,0 +1,202 @@
|
||||
+/*
|
||||
+ * Device Tree common file for kirkwood based Buffalo Linkstation
|
||||
+ *
|
||||
+ * Copyright (C) 2015, 2016
|
||||
+ * Roger Shimizu <rogershimizu@gmail.com>
|
||||
+ *
|
||||
+ * This file is dual-licensed: you can use it either under the terms
|
||||
+ * of the GPL or the X11 license, at your option. Note that this dual
|
||||
+ * licensing only applies to this file, and not this project as a
|
||||
+ * whole.
|
||||
+ *
|
||||
+ * a) This file is free software; you can redistribute it and/or
|
||||
+ * modify it under the terms of the GNU General Public License as
|
||||
+ * published by the Free Software Foundation; either version 2 of the
|
||||
+ * License, or (at your option) any later version.
|
||||
+ *
|
||||
+ * This file is distributed in the hope that it will be useful
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * Or, alternatively
|
||||
+ *
|
||||
+ * b) Permission is hereby granted, free of charge, to any person
|
||||
+ * obtaining a copy of this software and associated documentation
|
||||
+ * files (the "Software"), to deal in the Software without
|
||||
+ * restriction, including without limitation the rights to use
|
||||
+ * copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
+ * sell copies of the Software, and to permit persons to whom the
|
||||
+ * Software is furnished to do so, subject to the following
|
||||
+ * conditions:
|
||||
+ *
|
||||
+ * The above copyright notice and this permission notice shall be
|
||||
+ * included in all copies or substantial portions of the Software.
|
||||
+ *
|
||||
+ * THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND
|
||||
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
|
||||
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
+ * OTHER DEALINGS IN THE SOFTWARE.
|
||||
+ */
|
||||
+
|
||||
+/ {
|
||||
+ chosen {
|
||||
+ bootargs = "console=ttyS0,115200n8 earlyprintk";
|
||||
+ stdout-path = &uart0;
|
||||
+ };
|
||||
+
|
||||
+ mbus {
|
||||
+ pcie-controller {
|
||||
+ status = "okay";
|
||||
+ pcie@1,0 {
|
||||
+ status = "okay";
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ ocp@f1000000 {
|
||||
+ pinctrl: pin-controller@10000 {
|
||||
+ pmx_power_hdd0: pmx-power-hdd0 {
|
||||
+ marvell,function = "gpio";
|
||||
+ };
|
||||
+ pmx_usb_vbus: pmx-usb-vbus {
|
||||
+ marvell,function = "gpio";
|
||||
+ };
|
||||
+ pmx_led_alarm: pmx-led-alarm {
|
||||
+ marvell,function = "gpio";
|
||||
+ };
|
||||
+ pmx_led_function_red: pmx-led-function-red {
|
||||
+ marvell,function = "gpio";
|
||||
+ };
|
||||
+ pmx_led_function_blue: pmx-led-function-blue {
|
||||
+ marvell,function = "gpio";
|
||||
+ };
|
||||
+ pmx_led_info: pmx-led-info {
|
||||
+ marvell,function = "gpio";
|
||||
+ };
|
||||
+ pmx_led_power: pmx-led-power {
|
||||
+ marvell,function = "gpio";
|
||||
+ };
|
||||
+ pmx_button_function: pmx-button-function {
|
||||
+ marvell,function = "gpio";
|
||||
+ };
|
||||
+ pmx_power_switch: pmx-power-switch {
|
||||
+ marvell,function = "gpio";
|
||||
+ };
|
||||
+ pmx_power_auto_switch: pmx-power-auto-switch {
|
||||
+ marvell,function = "gpio";
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ serial@12000 {
|
||||
+ status = "okay";
|
||||
+ };
|
||||
+
|
||||
+ sata@80000 {
|
||||
+ status = "okay";
|
||||
+ nr-ports = <1>;
|
||||
+ };
|
||||
+
|
||||
+ spi@10600 {
|
||||
+ status = "okay";
|
||||
+
|
||||
+ m25p40@0 {
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <1>;
|
||||
+ compatible = "st,m25p40", "jedec,spi-nor";
|
||||
+ reg = <0>;
|
||||
+ spi-max-frequency = <25000000>;
|
||||
+ mode = <0>;
|
||||
+
|
||||
+ partition@0 {
|
||||
+ reg = <0x0 0x60000>;
|
||||
+ label = "uboot";
|
||||
+ read-only;
|
||||
+ };
|
||||
+
|
||||
+ partition@60000 {
|
||||
+ reg = <0x60000 0x10000>;
|
||||
+ label = "dtb";
|
||||
+ read-only;
|
||||
+ };
|
||||
+
|
||||
+ partition@70000 {
|
||||
+ reg = <0x70000 0x10000>;
|
||||
+ label = "uboot_env";
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ gpio_keys {
|
||||
+ compatible = "gpio-keys";
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <0>;
|
||||
+ pinctrl-0 = <&pmx_button_function &pmx_power_switch
|
||||
+ &pmx_power_auto_switch>;
|
||||
+ pinctrl-names = "default";
|
||||
+
|
||||
+ function-button {
|
||||
+ label = "Function Button";
|
||||
+ linux,code = <KEY_OPTION>;
|
||||
+ };
|
||||
+
|
||||
+ power-on-switch {
|
||||
+ label = "Power-on Switch";
|
||||
+ linux,code = <KEY_RESERVED>;
|
||||
+ linux,input-type = <5>;
|
||||
+ };
|
||||
+
|
||||
+ power-auto-switch {
|
||||
+ label = "Power-auto Switch";
|
||||
+ linux,code = <KEY_ESC>;
|
||||
+ linux,input-type = <5>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ gpio_leds {
|
||||
+ compatible = "gpio-leds";
|
||||
+ pinctrl-0 = <&pmx_led_function_red &pmx_led_alarm
|
||||
+ &pmx_led_info &pmx_led_power
|
||||
+ &pmx_led_function_blue>;
|
||||
+ pinctrl-names = "default";
|
||||
+ };
|
||||
+
|
||||
+ restart_poweroff {
|
||||
+ compatible = "restart-poweroff";
|
||||
+ };
|
||||
+
|
||||
+ regulators {
|
||||
+ compatible = "simple-bus";
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <0>;
|
||||
+ pinctrl-0 = <&pmx_power_hdd0 &pmx_usb_vbus>;
|
||||
+ pinctrl-names = "default";
|
||||
+
|
||||
+ usb_power: regulator@1 {
|
||||
+ compatible = "regulator-fixed";
|
||||
+ reg = <1>;
|
||||
+ regulator-name = "USB Power";
|
||||
+ regulator-min-microvolt = <5000000>;
|
||||
+ regulator-max-microvolt = <5000000>;
|
||||
+ enable-active-high;
|
||||
+ regulator-always-on;
|
||||
+ regulator-boot-on;
|
||||
+ };
|
||||
+
|
||||
+ hdd_power0: regulator@2 {
|
||||
+ compatible = "regulator-fixed";
|
||||
+ reg = <2>;
|
||||
+ regulator-name = "HDD0 Power";
|
||||
+ regulator-min-microvolt = <5000000>;
|
||||
+ regulator-max-microvolt = <5000000>;
|
||||
+ enable-active-high;
|
||||
+ regulator-always-on;
|
||||
+ regulator-boot-on;
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
--- a/arch/arm/boot/dts/kirkwood-lswxl.dts
|
||||
+++ /dev/null
|
||||
@@ -1,335 +0,0 @@
|
||||
-/*
|
||||
- * Device Tree file for Buffalo Linkstation LS-WXL/WSXL
|
||||
- *
|
||||
- * Copyright (C) 2015, 2016
|
||||
- * Roger Shimizu <rogershimizu@gmail.com>
|
||||
- *
|
||||
- * This file is dual-licensed: you can use it either under the terms
|
||||
- * of the GPL or the X11 license, at your option. Note that this dual
|
||||
- * licensing only applies to this file, and not this project as a
|
||||
- * whole.
|
||||
- *
|
||||
- * a) This file is free software; you can redistribute it and/or
|
||||
- * modify it under the terms of the GNU General Public License as
|
||||
- * published by the Free Software Foundation; either version 2 of the
|
||||
- * License, or (at your option) any later version.
|
||||
- *
|
||||
- * This file is distributed in the hope that it will be useful
|
||||
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
- * GNU General Public License for more details.
|
||||
- *
|
||||
- * Or, alternatively
|
||||
- *
|
||||
- * b) Permission is hereby granted, free of charge, to any person
|
||||
- * obtaining a copy of this software and associated documentation
|
||||
- * files (the "Software"), to deal in the Software without
|
||||
- * restriction, including without limitation the rights to use
|
||||
- * copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
- * sell copies of the Software, and to permit persons to whom the
|
||||
- * Software is furnished to do so, subject to the following
|
||||
- * conditions:
|
||||
- *
|
||||
- * The above copyright notice and this permission notice shall be
|
||||
- * included in all copies or substantial portions of the Software.
|
||||
- *
|
||||
- * THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND
|
||||
- * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
- * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
- * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
- * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
|
||||
- * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
- * OTHER DEALINGS IN THE SOFTWARE.
|
||||
- */
|
||||
-
|
||||
-/dts-v1/;
|
||||
-
|
||||
-#include "kirkwood.dtsi"
|
||||
-#include "kirkwood-6281.dtsi"
|
||||
-
|
||||
-/ {
|
||||
- model = "Buffalo Linkstation LS-WXL/WSXL";
|
||||
- compatible = "buffalo,lswxl", "marvell,kirkwood-88f6281", "marvell,kirkwood";
|
||||
-
|
||||
- memory { /* 128 MB */
|
||||
- device_type = "memory";
|
||||
- reg = <0x00000000 0x8000000>;
|
||||
- };
|
||||
-
|
||||
- chosen {
|
||||
- bootargs = "console=ttyS0,115200n8 earlyprintk";
|
||||
- stdout-path = &uart0;
|
||||
- };
|
||||
-
|
||||
- mbus {
|
||||
- pcie-controller {
|
||||
- status = "okay";
|
||||
- pcie@1,0 {
|
||||
- status = "okay";
|
||||
- };
|
||||
- };
|
||||
- };
|
||||
-
|
||||
- ocp@f1000000 {
|
||||
- pinctrl: pin-controller@10000 {
|
||||
- pmx_power_hdd0: pmx-power-hdd0 {
|
||||
- marvell,pins = "mpp28";
|
||||
- marvell,function = "gpio";
|
||||
- };
|
||||
- pmx_power_hdd1: pmx-power-hdd1 {
|
||||
- marvell,pins = "mpp29";
|
||||
- marvell,function = "gpio";
|
||||
- };
|
||||
- pmx_usb_vbus: pmx-usb-vbus {
|
||||
- marvell,pins = "mpp37";
|
||||
- marvell,function = "gpio";
|
||||
- };
|
||||
- pmx_fan_high: pmx-fan-high {
|
||||
- marvell,pins = "mpp47";
|
||||
- marvell,function = "gpio";
|
||||
- };
|
||||
- pmx_fan_low: pmx-fan-low {
|
||||
- marvell,pins = "mpp48";
|
||||
- marvell,function = "gpio";
|
||||
- };
|
||||
- pmx_led_hdderr0: pmx-led-hdderr0 {
|
||||
- marvell,pins = "mpp8";
|
||||
- marvell,function = "gpio";
|
||||
- };
|
||||
- pmx_led_hdderr1: pmx-led-hdderr1 {
|
||||
- marvell,pins = "mpp46";
|
||||
- marvell,function = "gpio";
|
||||
- };
|
||||
- pmx_led_alarm: pmx-led-alarm {
|
||||
- marvell,pins = "mpp49";
|
||||
- marvell,function = "gpio";
|
||||
- };
|
||||
- pmx_led_function_red: pmx-led-function-red {
|
||||
- marvell,pins = "mpp34";
|
||||
- marvell,function = "gpio";
|
||||
- };
|
||||
- pmx_led_function_blue: pmx-led-function-blue {
|
||||
- marvell,pins = "mpp36";
|
||||
- marvell,function = "gpio";
|
||||
- };
|
||||
- pmx_led_info: pmx-led-info {
|
||||
- marvell,pins = "mpp38";
|
||||
- marvell,function = "gpio";
|
||||
- };
|
||||
- pmx_led_power: pmx-led-power {
|
||||
- marvell,pins = "mpp39";
|
||||
- marvell,function = "gpio";
|
||||
- };
|
||||
- pmx_fan_lock: pmx-fan-lock {
|
||||
- marvell,pins = "mpp40";
|
||||
- marvell,function = "gpio";
|
||||
- };
|
||||
- pmx_button_function: pmx-button-function {
|
||||
- marvell,pins = "mpp41";
|
||||
- marvell,function = "gpio";
|
||||
- };
|
||||
- pmx_power_switch: pmx-power-switch {
|
||||
- marvell,pins = "mpp42";
|
||||
- marvell,function = "gpio";
|
||||
- };
|
||||
- pmx_power_auto_switch: pmx-power-auto-switch {
|
||||
- marvell,pins = "mpp43";
|
||||
- marvell,function = "gpio";
|
||||
- };
|
||||
- };
|
||||
-
|
||||
- serial@12000 {
|
||||
- status = "okay";
|
||||
- };
|
||||
-
|
||||
- sata@80000 {
|
||||
- status = "okay";
|
||||
- nr-ports = <2>;
|
||||
- };
|
||||
-
|
||||
- spi@10600 {
|
||||
- status = "okay";
|
||||
-
|
||||
- m25p40@0 {
|
||||
- #address-cells = <1>;
|
||||
- #size-cells = <1>;
|
||||
- compatible = "st,m25p40", "jedec,spi-nor";
|
||||
- reg = <0>;
|
||||
- spi-max-frequency = <25000000>;
|
||||
- mode = <0>;
|
||||
-
|
||||
- partition@0 {
|
||||
- reg = <0x0 0x60000>;
|
||||
- label = "uboot";
|
||||
- read-only;
|
||||
- };
|
||||
-
|
||||
- partition@60000 {
|
||||
- reg = <0x60000 0x10000>;
|
||||
- label = "dtb";
|
||||
- read-only;
|
||||
- };
|
||||
-
|
||||
- partition@70000 {
|
||||
- reg = <0x70000 0x10000>;
|
||||
- label = "uboot_env";
|
||||
- };
|
||||
- };
|
||||
- };
|
||||
- };
|
||||
-
|
||||
- gpio_keys {
|
||||
- compatible = "gpio-keys";
|
||||
- #address-cells = <1>;
|
||||
- #size-cells = <0>;
|
||||
- pinctrl-0 = <&pmx_button_function &pmx_power_switch
|
||||
- &pmx_power_auto_switch>;
|
||||
- pinctrl-names = "default";
|
||||
-
|
||||
- button@1 {
|
||||
- label = "Function Button";
|
||||
- linux,code = <KEY_OPTION>;
|
||||
- gpios = <&gpio1 9 GPIO_ACTIVE_LOW>;
|
||||
- };
|
||||
-
|
||||
- button@2 {
|
||||
- label = "Power-on Switch";
|
||||
- linux,code = <KEY_RESERVED>;
|
||||
- linux,input-type = <5>;
|
||||
- gpios = <&gpio1 10 GPIO_ACTIVE_LOW>;
|
||||
- };
|
||||
-
|
||||
- button@3 {
|
||||
- label = "Power-auto Switch";
|
||||
- linux,code = <KEY_ESC>;
|
||||
- linux,input-type = <5>;
|
||||
- gpios = <&gpio1 11 GPIO_ACTIVE_LOW>;
|
||||
- };
|
||||
- };
|
||||
-
|
||||
- gpio_leds {
|
||||
- compatible = "gpio-leds";
|
||||
- pinctrl-0 = <&pmx_led_function_red &pmx_led_alarm
|
||||
- &pmx_led_info &pmx_led_power
|
||||
- &pmx_led_function_blue
|
||||
- &pmx_led_hdderr0
|
||||
- &pmx_led_hdderr1>;
|
||||
- pinctrl-names = "default";
|
||||
-
|
||||
- led@1 {
|
||||
- label = "lswxl:blue:func";
|
||||
- gpios = <&gpio1 4 GPIO_ACTIVE_LOW>;
|
||||
- };
|
||||
-
|
||||
- led@2 {
|
||||
- label = "lswxl:red:alarm";
|
||||
- gpios = <&gpio1 17 GPIO_ACTIVE_LOW>;
|
||||
- };
|
||||
-
|
||||
- led@3 {
|
||||
- label = "lswxl:amber:info";
|
||||
- gpios = <&gpio1 6 GPIO_ACTIVE_LOW>;
|
||||
- };
|
||||
-
|
||||
- led@4 {
|
||||
- label = "lswxl:blue:power";
|
||||
- gpios = <&gpio1 7 GPIO_ACTIVE_HIGH>;
|
||||
- default-state = "keep";
|
||||
- };
|
||||
-
|
||||
- led@5 {
|
||||
- label = "lswxl:red:func";
|
||||
- gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>;
|
||||
- };
|
||||
-
|
||||
- led@6 {
|
||||
- label = "lswxl:red:hdderr0";
|
||||
- gpios = <&gpio0 8 GPIO_ACTIVE_HIGH>;
|
||||
- };
|
||||
-
|
||||
- led@7 {
|
||||
- label = "lswxl:red:hdderr1";
|
||||
- gpios = <&gpio1 14 GPIO_ACTIVE_HIGH>;
|
||||
- };
|
||||
- };
|
||||
-
|
||||
- gpio_fan {
|
||||
- compatible = "gpio-fan";
|
||||
- pinctrl-0 = <&pmx_fan_low &pmx_fan_high &pmx_fan_lock>;
|
||||
- pinctrl-names = "default";
|
||||
-
|
||||
- gpios = <&gpio1 16 GPIO_ACTIVE_LOW
|
||||
- &gpio1 15 GPIO_ACTIVE_LOW>;
|
||||
-
|
||||
- gpio-fan,speed-map = <0 3
|
||||
- 1500 2
|
||||
- 3250 1
|
||||
- 5000 0>;
|
||||
-
|
||||
- alarm-gpios = <&gpio1 8 GPIO_ACTIVE_HIGH>;
|
||||
- };
|
||||
-
|
||||
- restart_poweroff {
|
||||
- compatible = "restart-poweroff";
|
||||
- };
|
||||
-
|
||||
- regulators {
|
||||
- compatible = "simple-bus";
|
||||
- #address-cells = <1>;
|
||||
- #size-cells = <0>;
|
||||
- pinctrl-0 = <&pmx_power_hdd0 &pmx_power_hdd1 &pmx_usb_vbus>;
|
||||
- pinctrl-names = "default";
|
||||
-
|
||||
- usb_power: regulator@1 {
|
||||
- compatible = "regulator-fixed";
|
||||
- reg = <1>;
|
||||
- regulator-name = "USB Power";
|
||||
- regulator-min-microvolt = <5000000>;
|
||||
- regulator-max-microvolt = <5000000>;
|
||||
- enable-active-high;
|
||||
- regulator-always-on;
|
||||
- regulator-boot-on;
|
||||
- gpio = <&gpio1 5 GPIO_ACTIVE_HIGH>;
|
||||
- };
|
||||
- hdd_power0: regulator@2 {
|
||||
- compatible = "regulator-fixed";
|
||||
- reg = <2>;
|
||||
- regulator-name = "HDD0 Power";
|
||||
- regulator-min-microvolt = <5000000>;
|
||||
- regulator-max-microvolt = <5000000>;
|
||||
- enable-active-high;
|
||||
- regulator-always-on;
|
||||
- regulator-boot-on;
|
||||
- gpio = <&gpio0 28 GPIO_ACTIVE_HIGH>;
|
||||
- };
|
||||
- hdd_power1: regulator@3 {
|
||||
- compatible = "regulator-fixed";
|
||||
- reg = <3>;
|
||||
- regulator-name = "HDD1 Power";
|
||||
- regulator-min-microvolt = <5000000>;
|
||||
- regulator-max-microvolt = <5000000>;
|
||||
- enable-active-high;
|
||||
- regulator-always-on;
|
||||
- regulator-boot-on;
|
||||
- gpio = <&gpio0 29 GPIO_ACTIVE_HIGH>;
|
||||
- };
|
||||
- };
|
||||
-};
|
||||
-
|
||||
-&mdio {
|
||||
- status = "okay";
|
||||
-
|
||||
- ethphy1: ethernet-phy@8 {
|
||||
- device_type = "ethernet-phy";
|
||||
- reg = <8>;
|
||||
- };
|
||||
-};
|
||||
-
|
||||
-ð1 {
|
||||
- status = "okay";
|
||||
-
|
||||
- ethernet1-port@0 {
|
||||
- phy-handle = <ðphy1>;
|
||||
- };
|
||||
-};
|
|
@ -1,132 +0,0 @@
|
|||
From: Roger Shimizu <rogershimizu@gmail.com>
|
||||
Date: Sat, 6 Feb 2016 14:59:53 +0900
|
||||
Subject: ARM: dts: orion5x: add device tree for buffalo linkstation ls-gl
|
||||
Origin: https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/?id=b1742ffa9ddb347a8bcb8e5f7dcf4d3a790f9041
|
||||
|
||||
Add dts file to support Buffalo Linkstation LS-GL
|
||||
(a.k.a Buffalo Linkstation Pro/Live), which is marvell orion5x based
|
||||
3.5" HDD NAS.
|
||||
|
||||
Product info:
|
||||
- (JPN) http://buffalo.jp/products/catalog/item/l/ls-gl/
|
||||
- (ENG) http://www.buffalotech.com/products/network-storage/linkstation/linkstation-pro
|
||||
|
||||
This device tree is based on the board file:
|
||||
arch/arm/mach-orion5x/kurobox_pro-setup.c
|
||||
However, that board file also support Kurobox Pro, which is not supported by
|
||||
device tree yet. So the board file is not removed.
|
||||
|
||||
Signed-off-by: Roger Shimizu <rogershimizu@gmail.com>
|
||||
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
|
||||
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
|
||||
---
|
||||
arch/arm/boot/dts/Makefile | 1 +
|
||||
arch/arm/boot/dts/orion5x-linkstation-lsgl.dts | 87 ++++++++++++++++++++++++++
|
||||
2 files changed, 88 insertions(+)
|
||||
create mode 100644 arch/arm/boot/dts/orion5x-linkstation-lsgl.dts
|
||||
|
||||
diff --git a/arch/arm/boot/dts/Makefile b/arch/arm/boot/dts/Makefile
|
||||
index 30d316dc050f..66f464dd814a 100644
|
||||
--- a/arch/arm/boot/dts/Makefile
|
||||
+++ b/arch/arm/boot/dts/Makefile
|
||||
@@ -517,6 +517,7 @@ dtb-$(CONFIG_SOC_DRA7XX) += \
|
||||
dtb-$(CONFIG_ARCH_ORION5X) += \
|
||||
orion5x-lacie-d2-network.dtb \
|
||||
orion5x-lacie-ethernet-disk-mini-v2.dtb \
|
||||
+ orion5x-linkstation-lsgl.dtb \
|
||||
orion5x-linkstation-lswtgl.dtb \
|
||||
orion5x-lswsgl.dtb \
|
||||
orion5x-maxtor-shared-storage-2.dtb \
|
||||
diff --git a/arch/arm/boot/dts/orion5x-linkstation-lsgl.dts b/arch/arm/boot/dts/orion5x-linkstation-lsgl.dts
|
||||
new file mode 100644
|
||||
index 000000000000..1cf644bfd7ea
|
||||
--- /dev/null
|
||||
+++ b/arch/arm/boot/dts/orion5x-linkstation-lsgl.dts
|
||||
@@ -0,0 +1,87 @@
|
||||
+/*
|
||||
+ * Device Tree file for Buffalo Linkstation LS-GL
|
||||
+ * (also known as Buffalo Linkstation Pro/Live)
|
||||
+ *
|
||||
+ * Copyright (C) 2016
|
||||
+ * Roger Shimizu <rogershimizu@gmail.com>
|
||||
+ *
|
||||
+ * Based on the board file arch/arm/mach-orion5x/kurobox_pro-setup.c
|
||||
+ * Copyright (C) Ronen Shitrit <rshitrit@marvell.com>
|
||||
+ *
|
||||
+ * This file is dual-licensed: you can use it either under the terms
|
||||
+ * of the GPL or the X11 license, at your option. Note that this dual
|
||||
+ * licensing only applies to this file, and not this project as a
|
||||
+ * whole.
|
||||
+ *
|
||||
+ * a) This file is free software; you can redistribute it and/or
|
||||
+ * modify it under the terms of the GNU General Public License as
|
||||
+ * published by the Free Software Foundation; either version 2 of the
|
||||
+ * License, or (at your option) any later version.
|
||||
+ *
|
||||
+ * This file is distributed in the hope that it will be useful
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * Or, alternatively
|
||||
+ *
|
||||
+ * b) Permission is hereby granted, free of charge, to any person
|
||||
+ * obtaining a copy of this software and associated documentation
|
||||
+ * files (the "Software"), to deal in the Software without
|
||||
+ * restriction, including without limitation the rights to use
|
||||
+ * copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
+ * sell copies of the Software, and to permit persons to whom the
|
||||
+ * Software is furnished to do so, subject to the following
|
||||
+ * conditions:
|
||||
+ *
|
||||
+ * The above copyright notice and this permission notice shall be
|
||||
+ * included in all copies or substantial portions of the Software.
|
||||
+ *
|
||||
+ * THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND
|
||||
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
|
||||
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
+ * OTHER DEALINGS IN THE SOFTWARE.
|
||||
+ */
|
||||
+
|
||||
+/dts-v1/;
|
||||
+
|
||||
+#include "orion5x-linkstation.dtsi"
|
||||
+#include <dt-bindings/gpio/gpio.h>
|
||||
+
|
||||
+/ {
|
||||
+ model = "Buffalo Linkstation Pro/Live";
|
||||
+ compatible = "buffalo,lsgl", "marvell,orion5x-88f5182", "marvell,orion5x";
|
||||
+
|
||||
+ memory { /* 128 MB */
|
||||
+ device_type = "memory";
|
||||
+ reg = <0x00000000 0x8000000>;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&pinctrl {
|
||||
+ pmx_power_hdd: pmx-power-hdd {
|
||||
+ marvell,pins = "mpp1";
|
||||
+ marvell,function = "gpio";
|
||||
+ };
|
||||
+
|
||||
+ pmx_power_usb: pmx-power-usb {
|
||||
+ marvell,pins = "mpp9";
|
||||
+ marvell,function = "gpio";
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&hdd_power {
|
||||
+ gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>;
|
||||
+};
|
||||
+
|
||||
+&usb_power {
|
||||
+ gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>;
|
||||
+};
|
||||
+
|
||||
+&ehci1 {
|
||||
+ status = "okay";
|
||||
+};
|
|
@ -1,699 +0,0 @@
|
|||
From: Roger Shimizu <rogershimizu@gmail.com>
|
||||
Date: Sat, 6 Feb 2016 14:59:52 +0900
|
||||
Subject: ARM: dts: orion5x: split linkstation lswtgl into common and device parts
|
||||
Origin: https://git.kernel.org/cgit/linux/kernel/git/next/linux-next.git/commit/?id=305e0b2a7a85e8bd65818cb3636b205f784ed377
|
||||
|
||||
In order to support more linkstation devices, common part of current
|
||||
.dts file goes into .dtsi file. Some .dtsi start with "mvebu-" prefix
|
||||
because other kirkwood based linkstation devices are similar, and
|
||||
will be migrated to use these .dtsi some time later.
|
||||
- orion5x-linkstation.dtsi
|
||||
- mvebu-linkstation-fan.dtsi
|
||||
- mvebu-linkstation-gpio-simple.dtsi
|
||||
while all rest part remains in device specific .dts file:
|
||||
- orion5x-linkstation-lswtgl.dts
|
||||
|
||||
Signed-off-by: Roger Shimizu <rogershimizu@gmail.com>
|
||||
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
|
||||
Signed-off-by: Gregory CLEMENT <gregory.clement@free-electrons.com>
|
||||
---
|
||||
arch/arm/boot/dts/mvebu-linkstation-fan.dtsi | 72 ++++++
|
||||
.../boot/dts/mvebu-linkstation-gpio-simple.dtsi | 105 +++++++++
|
||||
arch/arm/boot/dts/orion5x-linkstation-lswtgl.dts | 243 ++++-----------------
|
||||
arch/arm/boot/dts/orion5x-linkstation.dtsi | 180 +++++++++++++++
|
||||
4 files changed, 402 insertions(+), 198 deletions(-)
|
||||
create mode 100644 arch/arm/boot/dts/mvebu-linkstation-fan.dtsi
|
||||
create mode 100644 arch/arm/boot/dts/mvebu-linkstation-gpio-simple.dtsi
|
||||
create mode 100644 arch/arm/boot/dts/orion5x-linkstation.dtsi
|
||||
|
||||
--- /dev/null
|
||||
+++ b/arch/arm/boot/dts/mvebu-linkstation-fan.dtsi
|
||||
@@ -0,0 +1,72 @@
|
||||
+/*
|
||||
+ * Device Tree common file for gpio-fan on Buffalo Linkstation
|
||||
+ *
|
||||
+ * Copyright (C) 2015, 2016
|
||||
+ * Roger Shimizu <rogershimizu@gmail.com>
|
||||
+ *
|
||||
+ * This file is dual-licensed: you can use it either under the terms
|
||||
+ * of the GPL or the X11 license, at your option. Note that this dual
|
||||
+ * licensing only applies to this file, and not this project as a
|
||||
+ * whole.
|
||||
+ *
|
||||
+ * a) This file is free software; you can redistribute it and/or
|
||||
+ * modify it under the terms of the GNU General Public License as
|
||||
+ * published by the Free Software Foundation; either version 2 of the
|
||||
+ * License, or (at your option) any later version.
|
||||
+ *
|
||||
+ * This file is distributed in the hope that it will be useful
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * Or, alternatively
|
||||
+ *
|
||||
+ * b) Permission is hereby granted, free of charge, to any person
|
||||
+ * obtaining a copy of this software and associated documentation
|
||||
+ * files (the "Software"), to deal in the Software without
|
||||
+ * restriction, including without limitation the rights to use
|
||||
+ * copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
+ * sell copies of the Software, and to permit persons to whom the
|
||||
+ * Software is furnished to do so, subject to the following
|
||||
+ * conditions:
|
||||
+ *
|
||||
+ * The above copyright notice and this permission notice shall be
|
||||
+ * included in all copies or substantial portions of the Software.
|
||||
+ *
|
||||
+ * THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND
|
||||
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
|
||||
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
+ * OTHER DEALINGS IN THE SOFTWARE.
|
||||
+ */
|
||||
+
|
||||
+/ {
|
||||
+ gpio_fan {
|
||||
+ compatible = "gpio-fan";
|
||||
+ pinctrl-0 = <&pmx_fan_low &pmx_fan_high &pmx_fan_lock>;
|
||||
+ pinctrl-names = "default";
|
||||
+
|
||||
+ gpio-fan,speed-map =
|
||||
+ <0 3
|
||||
+ 1500 2
|
||||
+ 3250 1
|
||||
+ 5000 0>;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&pinctrl {
|
||||
+ pmx_fan_low: pmx-fan-low {
|
||||
+ marvell,function = "gpio";
|
||||
+ };
|
||||
+
|
||||
+ pmx_fan_high: pmx-fan-high {
|
||||
+ marvell,function = "gpio";
|
||||
+ };
|
||||
+
|
||||
+ pmx_fan_lock: pmx-fan-lock {
|
||||
+ marvell,function = "gpio";
|
||||
+ };
|
||||
+};
|
||||
--- /dev/null
|
||||
+++ b/arch/arm/boot/dts/mvebu-linkstation-gpio-simple.dtsi
|
||||
@@ -0,0 +1,105 @@
|
||||
+/*
|
||||
+ * Device Tree common file for gpio-{keys,leds} on Buffalo Linkstation
|
||||
+ *
|
||||
+ * Copyright (C) 2015, 2016
|
||||
+ * Roger Shimizu <rogershimizu@gmail.com>
|
||||
+ *
|
||||
+ * This file is dual-licensed: you can use it either under the terms
|
||||
+ * of the GPL or the X11 license, at your option. Note that this dual
|
||||
+ * licensing only applies to this file, and not this project as a
|
||||
+ * whole.
|
||||
+ *
|
||||
+ * a) This file is free software; you can redistribute it and/or
|
||||
+ * modify it under the terms of the GNU General Public License as
|
||||
+ * published by the Free Software Foundation; either version 2 of the
|
||||
+ * License, or (at your option) any later version.
|
||||
+ *
|
||||
+ * This file is distributed in the hope that it will be useful
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * Or, alternatively
|
||||
+ *
|
||||
+ * b) Permission is hereby granted, free of charge, to any person
|
||||
+ * obtaining a copy of this software and associated documentation
|
||||
+ * files (the "Software"), to deal in the Software without
|
||||
+ * restriction, including without limitation the rights to use
|
||||
+ * copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
+ * sell copies of the Software, and to permit persons to whom the
|
||||
+ * Software is furnished to do so, subject to the following
|
||||
+ * conditions:
|
||||
+ *
|
||||
+ * The above copyright notice and this permission notice shall be
|
||||
+ * included in all copies or substantial portions of the Software.
|
||||
+ *
|
||||
+ * THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND
|
||||
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
|
||||
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
+ * OTHER DEALINGS IN THE SOFTWARE.
|
||||
+ */
|
||||
+
|
||||
+#include <dt-bindings/input/input.h>
|
||||
+
|
||||
+/ {
|
||||
+ gpio_keys {
|
||||
+ compatible = "gpio-keys";
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <0>;
|
||||
+ pinctrl-0 = <&pmx_power_switch>;
|
||||
+ pinctrl-names = "default";
|
||||
+
|
||||
+ power-on-switch {
|
||||
+ label = "Power-on Switch";
|
||||
+ linux,code = <KEY_RESERVED>;
|
||||
+ linux,input-type = <5>;
|
||||
+ };
|
||||
+
|
||||
+ power-auto-switch {
|
||||
+ label = "Power-auto Switch";
|
||||
+ linux,code = <KEY_ESC>;
|
||||
+ linux,input-type = <5>;
|
||||
+ };
|
||||
+ };
|
||||
+
|
||||
+ gpio_leds {
|
||||
+ compatible = "gpio-leds";
|
||||
+ pinctrl-0 = <&pmx_led_power &pmx_led_alarm &pmx_led_info>;
|
||||
+ pinctrl-names = "default";
|
||||
+
|
||||
+ blue-power-led {
|
||||
+ label = "linkstation:blue:power";
|
||||
+ default-state = "keep";
|
||||
+ };
|
||||
+
|
||||
+ red-alarm-led {
|
||||
+ label = "linkstation:red:alarm";
|
||||
+ };
|
||||
+
|
||||
+ amber-info-led {
|
||||
+ label = "linkstation:amber:info";
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&pinctrl {
|
||||
+ pmx_power_switch: pmx-power-switch {
|
||||
+ marvell,function = "gpio";
|
||||
+ };
|
||||
+
|
||||
+ pmx_led_power: pmx-leds {
|
||||
+ marvell,function = "gpio";
|
||||
+ };
|
||||
+
|
||||
+ pmx_led_alarm: pmx-leds {
|
||||
+ marvell,function = "gpio";
|
||||
+ };
|
||||
+
|
||||
+ pmx_led_info: pmx-leds {
|
||||
+ marvell,function = "gpio";
|
||||
+ };
|
||||
+};
|
||||
--- a/arch/arm/boot/dts/orion5x-linkstation-lswtgl.dts
|
||||
+++ b/arch/arm/boot/dts/orion5x-linkstation-lswtgl.dts
|
||||
@@ -45,9 +45,10 @@
|
||||
|
||||
/dts-v1/;
|
||||
|
||||
+#include "orion5x-linkstation.dtsi"
|
||||
+#include "mvebu-linkstation-gpio-simple.dtsi"
|
||||
+#include "mvebu-linkstation-fan.dtsi"
|
||||
#include <dt-bindings/gpio/gpio.h>
|
||||
-#include <dt-bindings/input/input.h>
|
||||
-#include "orion5x-mv88f5182.dtsi"
|
||||
|
||||
/ {
|
||||
model = "Buffalo Linkstation LS-WTGL";
|
||||
@@ -58,247 +59,93 @@
|
||||
reg = <0x00000000 0x4000000>;
|
||||
};
|
||||
|
||||
- chosen {
|
||||
- bootargs = "console=ttyS0,115200n8 earlyprintk";
|
||||
- linux,stdout-path = &uart0;
|
||||
- };
|
||||
-
|
||||
- soc {
|
||||
- ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000>,
|
||||
- <MBUS_ID(0x09, 0x00) 0 0xf2200000 0x800>,
|
||||
- <MBUS_ID(0x01, 0x0f) 0 0xf4000000 0x40000>;
|
||||
-
|
||||
- internal-regs {
|
||||
- pinctrl: pinctrl@10000 {
|
||||
- pinctrl-names = "default";
|
||||
-
|
||||
- pmx_led_power: pmx-leds {
|
||||
- marvell,pins = "mpp0";
|
||||
- marvell,function = "gpio";
|
||||
- };
|
||||
-
|
||||
- pmx_led_alarm: pmx-leds {
|
||||
- marvell,pins = "mpp2";
|
||||
- marvell,function = "gpio";
|
||||
- };
|
||||
-
|
||||
- pmx_led_info: pmx-leds {
|
||||
- marvell,pins = "mpp3";
|
||||
- marvell,function = "gpio";
|
||||
- };
|
||||
-
|
||||
- pmx_power_hdd: pmx-power-hdd {
|
||||
- marvell,pins = "mpp1";
|
||||
- marvell,function = "gpio";
|
||||
- };
|
||||
-
|
||||
- pmx_usb_power: pmx-usb-power {
|
||||
- marvell,pins = "mpp9";
|
||||
- marvell,function = "gpio";
|
||||
- };
|
||||
-
|
||||
- pmx_sata0: pmx-sata0 {
|
||||
- marvell,pins = "mpp12";
|
||||
- marvell,function = "sata0";
|
||||
- };
|
||||
-
|
||||
- pmx_sata1: pmx-sata1 {
|
||||
- marvell,pins = "mpp13";
|
||||
- marvell,function = "sata1";
|
||||
- };
|
||||
-
|
||||
- pmx_fan_high: pmx-fan-high {
|
||||
- marvell,pins = "mpp14";
|
||||
- marvell,function = "gpio";
|
||||
- };
|
||||
-
|
||||
- pmx_fan_low: pmx-fan-low {
|
||||
- marvell,pins = "mpp17";
|
||||
- marvell,function = "gpio";
|
||||
- };
|
||||
-
|
||||
- pmx_fan_lock: pmx-fan-lock {
|
||||
- marvell,pins = "mpp6";
|
||||
- marvell,function = "gpio";
|
||||
- };
|
||||
-
|
||||
- pmx_power_switch: pmx-power-switch {
|
||||
- marvell,pins = "mpp8", "mpp10";
|
||||
- marvell,function = "gpio";
|
||||
- };
|
||||
- };
|
||||
- };
|
||||
- };
|
||||
-
|
||||
gpio_keys {
|
||||
- compatible = "gpio-keys";
|
||||
- #address-cells = <1>;
|
||||
- #size-cells = <0>;
|
||||
- pinctrl-0 = <&pmx_power_switch>;
|
||||
- pinctrl-names = "default";
|
||||
-
|
||||
- button@1 {
|
||||
- label = "Power-on Switch";
|
||||
- linux,code = <KEY_RESERVED>;
|
||||
- linux,input-type = <5>;
|
||||
+ power-on-switch {
|
||||
gpios = <&gpio0 8 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
- button@2 {
|
||||
- label = "Power-auto Switch";
|
||||
- linux,code = <KEY_ESC>;
|
||||
- linux,input-type = <5>;
|
||||
+ power-auto-switch {
|
||||
gpios = <&gpio0 10 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
};
|
||||
|
||||
gpio_leds {
|
||||
- compatible = "gpio-leds";
|
||||
- pinctrl-0 = <&pmx_led_power &pmx_led_alarm
|
||||
- &pmx_led_info>;
|
||||
- pinctrl-names = "default";
|
||||
-
|
||||
- led@1 {
|
||||
- label = "lswtgl:blue:power";
|
||||
+ blue-power-led {
|
||||
gpios = <&gpio0 0 GPIO_ACTIVE_LOW>;
|
||||
- default-state = "keep";
|
||||
};
|
||||
|
||||
- led@2 {
|
||||
- label = "lswtgl:red:alarm";
|
||||
+ red-alarm-led {
|
||||
gpios = <&gpio0 2 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
|
||||
- led@3 {
|
||||
- label = "lswtgl:amber:info";
|
||||
+ amber-info-led {
|
||||
gpios = <&gpio0 3 GPIO_ACTIVE_LOW>;
|
||||
};
|
||||
};
|
||||
|
||||
gpio_fan {
|
||||
- compatible = "gpio-fan";
|
||||
- pinctrl-0 = <&pmx_fan_low &pmx_fan_high &pmx_fan_lock>;
|
||||
- pinctrl-names = "default";
|
||||
-
|
||||
gpios = <&gpio0 14 GPIO_ACTIVE_LOW
|
||||
&gpio0 17 GPIO_ACTIVE_LOW>;
|
||||
|
||||
- gpio-fan,speed-map = <0 3
|
||||
- 1500 2
|
||||
- 3250 1
|
||||
- 5000 0>;
|
||||
-
|
||||
alarm-gpios = <&gpio0 6 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
+};
|
||||
|
||||
- restart_poweroff {
|
||||
- compatible = "restart-poweroff";
|
||||
+&pinctrl {
|
||||
+ pmx_led_power: pmx-leds {
|
||||
+ marvell,pins = "mpp0";
|
||||
+ marvell,function = "gpio";
|
||||
};
|
||||
|
||||
- regulators {
|
||||
- compatible = "simple-bus";
|
||||
- #address-cells = <1>;
|
||||
- #size-cells = <0>;
|
||||
- pinctrl-0 = <&pmx_power_hdd &pmx_usb_power>;
|
||||
- pinctrl-names = "default";
|
||||
-
|
||||
- usb_power: regulator@1 {
|
||||
- compatible = "regulator-fixed";
|
||||
- reg = <1>;
|
||||
- regulator-name = "USB Power";
|
||||
- regulator-min-microvolt = <5000000>;
|
||||
- regulator-max-microvolt = <5000000>;
|
||||
- enable-active-high;
|
||||
- regulator-always-on;
|
||||
- regulator-boot-on;
|
||||
- gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>;
|
||||
- };
|
||||
+ pmx_power_hdd: pmx-power-hdd {
|
||||
+ marvell,pins = "mpp1";
|
||||
+ marvell,function = "gpio";
|
||||
+ };
|
||||
|
||||
- hdd_power: regulator@2 {
|
||||
- compatible = "regulator-fixed";
|
||||
- reg = <2>;
|
||||
- regulator-name = "HDD Power";
|
||||
- regulator-min-microvolt = <5000000>;
|
||||
- regulator-max-microvolt = <5000000>;
|
||||
- enable-active-high;
|
||||
- regulator-always-on;
|
||||
- regulator-boot-on;
|
||||
- gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>;
|
||||
- };
|
||||
+ pmx_led_alarm: pmx-leds {
|
||||
+ marvell,pins = "mpp2";
|
||||
+ marvell,function = "gpio";
|
||||
};
|
||||
-};
|
||||
|
||||
-&devbus_bootcs {
|
||||
- status = "okay";
|
||||
- devbus,keep-config;
|
||||
-
|
||||
- flash@0 {
|
||||
- compatible = "jedec-flash";
|
||||
- reg = <0 0x40000>;
|
||||
- bank-width = <1>;
|
||||
-
|
||||
- partitions {
|
||||
- compatible = "fixed-partitions";
|
||||
- #address-cells = <1>;
|
||||
- #size-cells = <1>;
|
||||
-
|
||||
- header@0 {
|
||||
- reg = <0 0x30000>;
|
||||
- read-only;
|
||||
- };
|
||||
-
|
||||
- uboot@30000 {
|
||||
- reg = <0x30000 0xF000>;
|
||||
- read-only;
|
||||
- };
|
||||
-
|
||||
- uboot_env@3F000 {
|
||||
- reg = <0x3F000 0x1000>;
|
||||
- };
|
||||
- };
|
||||
+ pmx_led_info: pmx-leds {
|
||||
+ marvell,pins = "mpp3";
|
||||
+ marvell,function = "gpio";
|
||||
};
|
||||
-};
|
||||
|
||||
-&mdio {
|
||||
- status = "okay";
|
||||
+ pmx_fan_lock: pmx-fan-lock {
|
||||
+ marvell,pins = "mpp6";
|
||||
+ marvell,function = "gpio";
|
||||
+ };
|
||||
|
||||
- ethphy: ethernet-phy {
|
||||
- reg = <8>;
|
||||
+ pmx_power_switch: pmx-power-switch {
|
||||
+ marvell,pins = "mpp8", "mpp10";
|
||||
+ marvell,function = "gpio";
|
||||
};
|
||||
-};
|
||||
|
||||
-ð {
|
||||
- status = "okay";
|
||||
+ pmx_power_usb: pmx-power-usb {
|
||||
+ marvell,pins = "mpp9";
|
||||
+ marvell,function = "gpio";
|
||||
+ };
|
||||
|
||||
- ethernet-port@0 {
|
||||
- phy-handle = <ðphy>;
|
||||
+ pmx_fan_high: pmx-fan-high {
|
||||
+ marvell,pins = "mpp14";
|
||||
+ marvell,function = "gpio";
|
||||
};
|
||||
-};
|
||||
|
||||
-&ehci0 {
|
||||
- status = "okay";
|
||||
+ pmx_fan_low: pmx-fan-low {
|
||||
+ marvell,pins = "mpp17";
|
||||
+ marvell,function = "gpio";
|
||||
+ };
|
||||
};
|
||||
|
||||
-&i2c {
|
||||
- status = "okay";
|
||||
-
|
||||
- rtc {
|
||||
- compatible = "ricoh,rs5c372a";
|
||||
- reg = <0x32>;
|
||||
- };
|
||||
+&hdd_power {
|
||||
+ gpios = <&gpio0 1 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
|
||||
-&wdt {
|
||||
- status = "disabled";
|
||||
+&usb_power {
|
||||
+ gpios = <&gpio0 9 GPIO_ACTIVE_HIGH>;
|
||||
};
|
||||
|
||||
&sata {
|
||||
- pinctrl-0 = <&pmx_sata0 &pmx_sata1>;
|
||||
- pinctrl-names = "default";
|
||||
- status = "okay";
|
||||
nr-ports = <2>;
|
||||
};
|
||||
-
|
||||
-&uart0 {
|
||||
- status = "okay";
|
||||
-};
|
||||
--- /dev/null
|
||||
+++ b/arch/arm/boot/dts/orion5x-linkstation.dtsi
|
||||
@@ -0,0 +1,180 @@
|
||||
+/*
|
||||
+ * Device Tree common file for orion5x based Buffalo Linkstation
|
||||
+ *
|
||||
+ * Copyright (C) 2015, 2016
|
||||
+ * Roger Shimizu <rogershimizu@gmail.com>
|
||||
+ *
|
||||
+ * This file is dual-licensed: you can use it either under the terms
|
||||
+ * of the GPL or the X11 license, at your option. Note that this dual
|
||||
+ * licensing only applies to this file, and not this project as a
|
||||
+ * whole.
|
||||
+ *
|
||||
+ * a) This file is free software; you can redistribute it and/or
|
||||
+ * modify it under the terms of the GNU General Public License as
|
||||
+ * published by the Free Software Foundation; either version 2 of the
|
||||
+ * License, or (at your option) any later version.
|
||||
+ *
|
||||
+ * This file is distributed in the hope that it will be useful
|
||||
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
+ * GNU General Public License for more details.
|
||||
+ *
|
||||
+ * Or, alternatively
|
||||
+ *
|
||||
+ * b) Permission is hereby granted, free of charge, to any person
|
||||
+ * obtaining a copy of this software and associated documentation
|
||||
+ * files (the "Software"), to deal in the Software without
|
||||
+ * restriction, including without limitation the rights to use
|
||||
+ * copy, modify, merge, publish, distribute, sublicense, and/or
|
||||
+ * sell copies of the Software, and to permit persons to whom the
|
||||
+ * Software is furnished to do so, subject to the following
|
||||
+ * conditions:
|
||||
+ *
|
||||
+ * The above copyright notice and this permission notice shall be
|
||||
+ * included in all copies or substantial portions of the Software.
|
||||
+ *
|
||||
+ * THE SOFTWARE IS PROVIDED , WITHOUT WARRANTY OF ANY KIND
|
||||
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
|
||||
+ * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
|
||||
+ * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY
|
||||
+ * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
+ * OTHER DEALINGS IN THE SOFTWARE.
|
||||
+ */
|
||||
+
|
||||
+#include "orion5x-mv88f5182.dtsi"
|
||||
+
|
||||
+/ {
|
||||
+ chosen {
|
||||
+ bootargs = "console=ttyS0,115200n8 earlyprintk";
|
||||
+ linux,stdout-path = &uart0;
|
||||
+ };
|
||||
+
|
||||
+ soc {
|
||||
+ ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000>,
|
||||
+ <MBUS_ID(0x09, 0x00) 0 0xf2200000 0x800>,
|
||||
+ <MBUS_ID(0x01, 0x0f) 0 0xf4000000 0x40000>;
|
||||
+ };
|
||||
+
|
||||
+ restart_poweroff {
|
||||
+ compatible = "restart-poweroff";
|
||||
+ };
|
||||
+
|
||||
+ regulators {
|
||||
+ compatible = "simple-bus";
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <0>;
|
||||
+ pinctrl-0 = <&pmx_power_usb &pmx_power_hdd>;
|
||||
+ pinctrl-names = "default";
|
||||
+
|
||||
+ usb_power: regulator@1 {
|
||||
+ compatible = "regulator-fixed";
|
||||
+ reg = <1>;
|
||||
+ regulator-name = "USB Power";
|
||||
+ regulator-min-microvolt = <5000000>;
|
||||
+ regulator-max-microvolt = <5000000>;
|
||||
+ enable-active-high;
|
||||
+ regulator-always-on;
|
||||
+ regulator-boot-on;
|
||||
+ };
|
||||
+
|
||||
+ hdd_power: regulator@2 {
|
||||
+ compatible = "regulator-fixed";
|
||||
+ reg = <2>;
|
||||
+ regulator-name = "HDD Power";
|
||||
+ regulator-min-microvolt = <5000000>;
|
||||
+ regulator-max-microvolt = <5000000>;
|
||||
+ enable-active-high;
|
||||
+ regulator-always-on;
|
||||
+ regulator-boot-on;
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&pinctrl {
|
||||
+ pmx_power_hdd: pmx-power-hdd {
|
||||
+ marvell,function = "gpio";
|
||||
+ };
|
||||
+
|
||||
+ pmx_power_usb: pmx-power-usb {
|
||||
+ marvell,function = "gpio";
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&devbus_bootcs {
|
||||
+ status = "okay";
|
||||
+ devbus,keep-config;
|
||||
+
|
||||
+ flash@0 {
|
||||
+ compatible = "jedec-flash";
|
||||
+ reg = <0 0x40000>;
|
||||
+ bank-width = <1>;
|
||||
+
|
||||
+ partitions {
|
||||
+ compatible = "fixed-partitions";
|
||||
+ #address-cells = <1>;
|
||||
+ #size-cells = <1>;
|
||||
+
|
||||
+ header@0 {
|
||||
+ reg = <0 0x30000>;
|
||||
+ read-only;
|
||||
+ };
|
||||
+
|
||||
+ uboot@30000 {
|
||||
+ reg = <0x30000 0xF000>;
|
||||
+ read-only;
|
||||
+ };
|
||||
+
|
||||
+ uboot_env@3F000 {
|
||||
+ reg = <0x3F000 0x1000>;
|
||||
+ };
|
||||
+ };
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&mdio {
|
||||
+ status = "okay";
|
||||
+
|
||||
+ ethphy: ethernet-phy {
|
||||
+ reg = <8>;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+ð {
|
||||
+ status = "okay";
|
||||
+
|
||||
+ ethernet-port@0 {
|
||||
+ phy-handle = <ðphy>;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&ehci0 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&i2c {
|
||||
+ status = "okay";
|
||||
+
|
||||
+ rtc {
|
||||
+ compatible = "ricoh,rs5c372a";
|
||||
+ reg = <0x32>;
|
||||
+ };
|
||||
+};
|
||||
+
|
||||
+&wdt {
|
||||
+ status = "disabled";
|
||||
+};
|
||||
+
|
||||
+&sata {
|
||||
+ status = "okay";
|
||||
+ nr-ports = <1>;
|
||||
+};
|
||||
+
|
||||
+&uart0 {
|
||||
+ status = "okay";
|
||||
+};
|
||||
+
|
||||
+&uart1 {
|
||||
+ status = "okay";
|
||||
+};
|
|
@ -1,272 +0,0 @@
|
|||
From: Aleksey Makarov <aleksey.makarov@caviumnetworks.com>
|
||||
Date: Thu, 11 Feb 2016 13:53:08 +0000
|
||||
Subject: libata: support AHCI on OCTEON platform
|
||||
Origin: https://git.kernel.org/linus/a2127e400edd2258fda6d83fe8b10b878a3595d9
|
||||
|
||||
The OCTEON SATA controller is currently found on cn71XX devices.
|
||||
|
||||
Acked-by: Arnd Bergmann <arnd@arndb.de>
|
||||
Acked-by: Hans de Goede <hdegoede@redhat.com>
|
||||
Acked-by: Rob Herring <robh@kernel.org>
|
||||
Signed-off-by: David Daney <david.daney@cavium.com>
|
||||
Signed-off-by: Vinita Gupta <vgupta@caviumnetworks.com>
|
||||
Signed-off-by: Aleksey Makarov <aleksey.makarov@auriga.com>
|
||||
Signed-off-by: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
|
||||
Signed-off-by: Tejun Heo <tj@kernel.org>
|
||||
---
|
||||
.../devicetree/bindings/ata/ahci-platform.txt | 1 +
|
||||
.../devicetree/bindings/mips/cavium/sata-uctl.txt | 42 +++++++++
|
||||
arch/mips/include/asm/octeon/cvmx.h | 9 ++
|
||||
drivers/ata/Kconfig | 9 ++
|
||||
drivers/ata/Makefile | 1 +
|
||||
drivers/ata/ahci_octeon.c | 105 +++++++++++++++++++++
|
||||
drivers/ata/ahci_platform.c | 1 +
|
||||
7 files changed, 168 insertions(+)
|
||||
create mode 100644 Documentation/devicetree/bindings/mips/cavium/sata-uctl.txt
|
||||
create mode 100644 drivers/ata/ahci_octeon.c
|
||||
|
||||
diff --git a/Documentation/devicetree/bindings/ata/ahci-platform.txt b/Documentation/devicetree/bindings/ata/ahci-platform.txt
|
||||
index c2340ee..3d84dca 100644
|
||||
--- a/Documentation/devicetree/bindings/ata/ahci-platform.txt
|
||||
+++ b/Documentation/devicetree/bindings/ata/ahci-platform.txt
|
||||
@@ -11,6 +11,7 @@ Required properties:
|
||||
- compatible : compatible string, one of:
|
||||
- "allwinner,sun4i-a10-ahci"
|
||||
- "hisilicon,hisi-ahci"
|
||||
+ - "cavium,octeon-7130-ahci"
|
||||
- "ibm,476gtr-ahci"
|
||||
- "marvell,armada-380-ahci"
|
||||
- "snps,dwc-ahci"
|
||||
diff --git a/Documentation/devicetree/bindings/mips/cavium/sata-uctl.txt b/Documentation/devicetree/bindings/mips/cavium/sata-uctl.txt
|
||||
new file mode 100644
|
||||
index 0000000..3bd3c2f
|
||||
--- /dev/null
|
||||
+++ b/Documentation/devicetree/bindings/mips/cavium/sata-uctl.txt
|
||||
@@ -0,0 +1,42 @@
|
||||
+* UCTL SATA controller glue
|
||||
+
|
||||
+UCTL is the bridge unit between the I/O interconnect (an internal bus)
|
||||
+and the SATA AHCI host controller (UAHC). It performs the following functions:
|
||||
+ - provides interfaces for the applications to access the UAHC AHCI
|
||||
+ registers on the CN71XX I/O space.
|
||||
+ - provides a bridge for UAHC to fetch AHCI command table entries and data
|
||||
+ buffers from Level 2 Cache.
|
||||
+ - posts interrupts to the CIU.
|
||||
+ - contains registers that:
|
||||
+ - control the behavior of the UAHC
|
||||
+ - control the clock/reset generation to UAHC
|
||||
+ - control endian swapping for all UAHC registers and DMA accesses
|
||||
+
|
||||
+Properties:
|
||||
+
|
||||
+- compatible: "cavium,octeon-7130-sata-uctl"
|
||||
+
|
||||
+ Compatibility with the cn7130 SOC.
|
||||
+
|
||||
+- reg: The base address of the UCTL register bank.
|
||||
+
|
||||
+- #address-cells, #size-cells, ranges and dma-ranges must be present and hold
|
||||
+ suitable values to map all child nodes.
|
||||
+
|
||||
+Example:
|
||||
+
|
||||
+ uctl@118006c000000 {
|
||||
+ compatible = "cavium,octeon-7130-sata-uctl";
|
||||
+ reg = <0x11800 0x6c000000 0x0 0x100>;
|
||||
+ ranges; /* Direct mapping */
|
||||
+ dma-ranges;
|
||||
+ #address-cells = <2>;
|
||||
+ #size-cells = <2>;
|
||||
+
|
||||
+ sata: sata@16c0000000000 {
|
||||
+ compatible = "cavium,octeon-7130-ahci";
|
||||
+ reg = <0x16c00 0x00000000 0x0 0x200>;
|
||||
+ interrupt-parent = <&cibsata>;
|
||||
+ interrupts = <2 4>; /* Bit: 2, level */
|
||||
+ };
|
||||
+ };
|
||||
diff --git a/arch/mips/include/asm/octeon/cvmx.h b/arch/mips/include/asm/octeon/cvmx.h
|
||||
index 774bb45..19e139c 100644
|
||||
--- a/arch/mips/include/asm/octeon/cvmx.h
|
||||
+++ b/arch/mips/include/asm/octeon/cvmx.h
|
||||
@@ -275,6 +275,11 @@ static inline void cvmx_write_csr(uint64_t csr_addr, uint64_t val)
|
||||
cvmx_read64(CVMX_MIO_BOOT_BIST_STAT);
|
||||
}
|
||||
|
||||
+static inline void cvmx_writeq_csr(void __iomem *csr_addr, uint64_t val)
|
||||
+{
|
||||
+ cvmx_write_csr((__force uint64_t)csr_addr, val);
|
||||
+}
|
||||
+
|
||||
static inline void cvmx_write_io(uint64_t io_addr, uint64_t val)
|
||||
{
|
||||
cvmx_write64(io_addr, val);
|
||||
@@ -287,6 +292,10 @@ static inline uint64_t cvmx_read_csr(uint64_t csr_addr)
|
||||
return val;
|
||||
}
|
||||
|
||||
+static inline uint64_t cvmx_readq_csr(void __iomem *csr_addr)
|
||||
+{
|
||||
+ return cvmx_read_csr((__force uint64_t) csr_addr);
|
||||
+}
|
||||
|
||||
static inline void cvmx_send_single(uint64_t data)
|
||||
{
|
||||
diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig
|
||||
index 861643ea..9c15828 100644
|
||||
--- a/drivers/ata/Kconfig
|
||||
+++ b/drivers/ata/Kconfig
|
||||
@@ -151,6 +151,15 @@ config AHCI_MVEBU
|
||||
|
||||
If unsure, say N.
|
||||
|
||||
+config AHCI_OCTEON
|
||||
+ tristate "Cavium Octeon Soc Serial ATA"
|
||||
+ depends on SATA_AHCI_PLATFORM && CAVIUM_OCTEON_SOC
|
||||
+ default y
|
||||
+ help
|
||||
+ This option enables support for Cavium Octeon SoC Serial ATA.
|
||||
+
|
||||
+ If unsure, say N.
|
||||
+
|
||||
config AHCI_SUNXI
|
||||
tristate "Allwinner sunxi AHCI SATA support"
|
||||
depends on ARCH_SUNXI
|
||||
diff --git a/drivers/ata/Makefile b/drivers/ata/Makefile
|
||||
index af45eff..1857952 100644
|
||||
--- a/drivers/ata/Makefile
|
||||
+++ b/drivers/ata/Makefile
|
||||
@@ -15,6 +15,7 @@ obj-$(CONFIG_AHCI_CEVA) += ahci_ceva.o libahci.o libahci_platform.o
|
||||
obj-$(CONFIG_AHCI_DA850) += ahci_da850.o libahci.o libahci_platform.o
|
||||
obj-$(CONFIG_AHCI_IMX) += ahci_imx.o libahci.o libahci_platform.o
|
||||
obj-$(CONFIG_AHCI_MVEBU) += ahci_mvebu.o libahci.o libahci_platform.o
|
||||
+obj-$(CONFIG_AHCI_OCTEON) += ahci_octeon.o
|
||||
obj-$(CONFIG_AHCI_SUNXI) += ahci_sunxi.o libahci.o libahci_platform.o
|
||||
obj-$(CONFIG_AHCI_ST) += ahci_st.o libahci.o libahci_platform.o
|
||||
obj-$(CONFIG_AHCI_TEGRA) += ahci_tegra.o libahci.o libahci_platform.o
|
||||
diff --git a/drivers/ata/ahci_octeon.c b/drivers/ata/ahci_octeon.c
|
||||
new file mode 100644
|
||||
index 0000000..ea865fe
|
||||
--- /dev/null
|
||||
+++ b/drivers/ata/ahci_octeon.c
|
||||
@@ -0,0 +1,105 @@
|
||||
+/*
|
||||
+ * SATA glue for Cavium Octeon III SOCs.
|
||||
+ *
|
||||
+ *
|
||||
+ * This file is subject to the terms and conditions of the GNU General Public
|
||||
+ * License. See the file "COPYING" in the main directory of this archive
|
||||
+ * for more details.
|
||||
+ *
|
||||
+ * Copyright (C) 2010-2015 Cavium Networks
|
||||
+ *
|
||||
+ */
|
||||
+
|
||||
+#include <linux/module.h>
|
||||
+#include <linux/dma-mapping.h>
|
||||
+#include <linux/platform_device.h>
|
||||
+#include <linux/of_platform.h>
|
||||
+
|
||||
+#include <asm/octeon/octeon.h>
|
||||
+#include <asm/bitfield.h>
|
||||
+
|
||||
+#define CVMX_SATA_UCTL_SHIM_CFG 0xE8
|
||||
+
|
||||
+#define SATA_UCTL_ENDIAN_MODE_BIG 1
|
||||
+#define SATA_UCTL_ENDIAN_MODE_LITTLE 0
|
||||
+#define SATA_UCTL_ENDIAN_MODE_MASK 3
|
||||
+
|
||||
+#define SATA_UCTL_DMA_ENDIAN_MODE_SHIFT 8
|
||||
+#define SATA_UCTL_CSR_ENDIAN_MODE_SHIFT 0
|
||||
+#define SATA_UCTL_DMA_READ_CMD_SHIFT 12
|
||||
+
|
||||
+static int ahci_octeon_probe(struct platform_device *pdev)
|
||||
+{
|
||||
+ struct device *dev = &pdev->dev;
|
||||
+ struct device_node *node = dev->of_node;
|
||||
+ struct resource *res;
|
||||
+ void __iomem *base;
|
||||
+ u64 cfg;
|
||||
+ int ret;
|
||||
+
|
||||
+ res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
+ if (!res) {
|
||||
+ dev_err(&pdev->dev, "Platform resource[0] is missing\n");
|
||||
+ return -ENODEV;
|
||||
+ }
|
||||
+
|
||||
+ base = devm_ioremap_resource(&pdev->dev, res);
|
||||
+ if (IS_ERR(base))
|
||||
+ return PTR_ERR(base);
|
||||
+
|
||||
+ cfg = cvmx_readq_csr(base + CVMX_SATA_UCTL_SHIM_CFG);
|
||||
+
|
||||
+ cfg &= ~(SATA_UCTL_ENDIAN_MODE_MASK << SATA_UCTL_DMA_ENDIAN_MODE_SHIFT);
|
||||
+ cfg &= ~(SATA_UCTL_ENDIAN_MODE_MASK << SATA_UCTL_CSR_ENDIAN_MODE_SHIFT);
|
||||
+
|
||||
+#ifdef __BIG_ENDIAN
|
||||
+ cfg |= SATA_UCTL_ENDIAN_MODE_BIG << SATA_UCTL_DMA_ENDIAN_MODE_SHIFT;
|
||||
+ cfg |= SATA_UCTL_ENDIAN_MODE_BIG << SATA_UCTL_CSR_ENDIAN_MODE_SHIFT;
|
||||
+#else
|
||||
+ cfg |= SATA_UCTL_ENDIAN_MODE_LITTLE << SATA_UCTL_DMA_ENDIAN_MODE_SHIFT;
|
||||
+ cfg |= SATA_UCTL_ENDIAN_MODE_LITTLE << SATA_UCTL_CSR_ENDIAN_MODE_SHIFT;
|
||||
+#endif
|
||||
+
|
||||
+ cfg |= 1 << SATA_UCTL_DMA_READ_CMD_SHIFT;
|
||||
+
|
||||
+ cvmx_writeq_csr(base + CVMX_SATA_UCTL_SHIM_CFG, cfg);
|
||||
+
|
||||
+ if (!node) {
|
||||
+ dev_err(dev, "no device node, failed to add octeon sata\n");
|
||||
+ return -ENODEV;
|
||||
+ }
|
||||
+
|
||||
+ ret = of_platform_populate(node, NULL, NULL, dev);
|
||||
+ if (ret) {
|
||||
+ dev_err(dev, "failed to add ahci-platform core\n");
|
||||
+ return ret;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static int ahci_octeon_remove(struct platform_device *pdev)
|
||||
+{
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
+static const struct of_device_id octeon_ahci_match[] = {
|
||||
+ { .compatible = "cavium,octeon-7130-sata-uctl", },
|
||||
+ {},
|
||||
+};
|
||||
+MODULE_DEVICE_TABLE(of, octeon_ahci_match);
|
||||
+
|
||||
+static struct platform_driver ahci_octeon_driver = {
|
||||
+ .probe = ahci_octeon_probe,
|
||||
+ .remove = ahci_octeon_remove,
|
||||
+ .driver = {
|
||||
+ .name = "octeon-ahci",
|
||||
+ .of_match_table = octeon_ahci_match,
|
||||
+ },
|
||||
+};
|
||||
+
|
||||
+module_platform_driver(ahci_octeon_driver);
|
||||
+
|
||||
+MODULE_LICENSE("GPL");
|
||||
+MODULE_AUTHOR("Cavium, Inc. <support@cavium.com>");
|
||||
+MODULE_DESCRIPTION("Cavium Inc. sata config.");
|
||||
diff --git a/drivers/ata/ahci_platform.c b/drivers/ata/ahci_platform.c
|
||||
index 04975b8..4044233 100644
|
||||
--- a/drivers/ata/ahci_platform.c
|
||||
+++ b/drivers/ata/ahci_platform.c
|
||||
@@ -76,6 +76,7 @@ static const struct of_device_id ahci_of_match[] = {
|
||||
{ .compatible = "ibm,476gtr-ahci", },
|
||||
{ .compatible = "snps,dwc-ahci", },
|
||||
{ .compatible = "hisilicon,hisi-ahci", },
|
||||
+ { .compatible = "cavium,octeon-7130-ahci", },
|
||||
{},
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, ahci_of_match);
|
||||
--
|
||||
2.8.0.rc3
|
||||
|
|
@ -1,37 +0,0 @@
|
|||
From: Anatoly Pugachev <matorola@gmail.com>
|
||||
Date: Tue, 26 Jan 2016 00:19:02 +0300
|
||||
Subject: hwrng: n2 - Attach on T5/M5, T7/M7 SPARC CPUs
|
||||
Origin: https://git.kernel.org/cgit/linux/kernel/git/herbert/cryptodev-2.6.git/commit?id=c1e9b3b0eea12899b7749571af21cc60822cf2b6
|
||||
Bug-Debian: https://bugs.debian.org/809815
|
||||
|
||||
n2rng: Attach on T5/M5, T7/M7 SPARC CPUs
|
||||
|
||||
(space to tab fixes after variable names)
|
||||
|
||||
Signed-off-by: Anatoly Pugachev <matorola@gmail.com>
|
||||
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
|
||||
---
|
||||
drivers/char/hw_random/n2-drv.c | 10 ++++++++++
|
||||
1 file changed, 10 insertions(+)
|
||||
|
||||
diff --git a/drivers/char/hw_random/n2-drv.c b/drivers/char/hw_random/n2-drv.c
|
||||
index 843d6f6aee7a..3b06c1d6cfb2 100644
|
||||
--- a/drivers/char/hw_random/n2-drv.c
|
||||
+++ b/drivers/char/hw_random/n2-drv.c
|
||||
@@ -743,6 +743,16 @@ static const struct of_device_id n2rng_match[] = {
|
||||
.compatible = "SUNW,kt-rng",
|
||||
.data = (void *) 1,
|
||||
},
|
||||
+ {
|
||||
+ .name = "random-number-generator",
|
||||
+ .compatible = "ORCL,m4-rng",
|
||||
+ .data = (void *) 1,
|
||||
+ },
|
||||
+ {
|
||||
+ .name = "random-number-generator",
|
||||
+ .compatible = "ORCL,m7-rng",
|
||||
+ .data = (void *) 1,
|
||||
+ },
|
||||
{},
|
||||
};
|
||||
MODULE_DEVICE_TABLE(of, n2rng_match);
|
|
@ -28,7 +28,7 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
|||
|
||||
--- a/Documentation/kernel-parameters.txt
|
||||
+++ b/Documentation/kernel-parameters.txt
|
||||
@@ -3580,6 +3580,10 @@ bytes respectively. Such letter suffixes
|
||||
@@ -3793,6 +3793,10 @@ bytes respectively. Such letter suffixes
|
||||
|
||||
switches= [HW,M68k]
|
||||
|
||||
|
@ -41,7 +41,7 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
|||
on older distributions. When this option is enabled
|
||||
--- a/arch/x86/Kconfig
|
||||
+++ b/arch/x86/Kconfig
|
||||
@@ -2547,6 +2547,14 @@ config X86_X32
|
||||
@@ -2690,6 +2690,14 @@ config X86_X32
|
||||
elf32_x86_64 support enabled to compile a kernel with this
|
||||
option set.
|
||||
|
||||
|
@ -82,7 +82,7 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
|||
# error "The following code assumes __USER32_DS == __USER_DS"
|
||||
--- a/arch/x86/entry/entry_64.S
|
||||
+++ b/arch/x86/entry/entry_64.S
|
||||
@@ -178,8 +178,12 @@ entry_SYSCALL_64_fastpath:
|
||||
@@ -193,8 +193,12 @@ entry_SYSCALL_64_fastpath:
|
||||
#if __SYSCALL_MASK == ~0
|
||||
cmpq $__NR_syscall_max, %rax
|
||||
#else
|
||||
|
@ -97,25 +97,10 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
|||
#endif
|
||||
ja 1f /* return -ENOSYS (already in pt_regs->ax) */
|
||||
movq %r10, %rcx
|
||||
@@ -257,8 +261,12 @@ tracesys_phase2:
|
||||
#if __SYSCALL_MASK == ~0
|
||||
cmpq $__NR_syscall_max, %rax
|
||||
#else
|
||||
- andl $__SYSCALL_MASK, %eax
|
||||
- cmpl $__NR_syscall_max, %eax
|
||||
+.global system_call_trace_compare
|
||||
+.global system_call_trace_compare_end
|
||||
+system_call_trace_compare:
|
||||
+ cmpq $511, %rax /* x32 syscalls start at 512 */
|
||||
+ .byte P6_NOP4
|
||||
+system_call_trace_compare_end:
|
||||
#endif
|
||||
ja 1f /* return -ENOSYS (already in pt_regs->ax) */
|
||||
movq %r10, %rcx /* fixup for C */
|
||||
@@ -410,6 +418,16 @@ opportunistic_sysret_failed:
|
||||
@@ -324,6 +328,16 @@ opportunistic_sysret_failed:
|
||||
jmp restore_c_regs_and_iret
|
||||
END(entry_SYSCALL_64)
|
||||
|
||||
|
||||
+#if __SYSCALL_MASK != ~0
|
||||
+ /* This replaces the usual comparisons if syscall.x32 is set */
|
||||
+.global system_call_mask_compare
|
||||
|
@ -126,9 +111,9 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
|||
+system_call_mask_compare_end:
|
||||
+#endif
|
||||
+
|
||||
.macro FORK_LIKE func
|
||||
ENTRY(stub_\func)
|
||||
SAVE_EXTRA_REGS 8
|
||||
ENTRY(stub_ptregs_64)
|
||||
/*
|
||||
* Syscalls marked as needing ptregs land here.
|
||||
--- a/arch/x86/entry/syscall_64.c
|
||||
+++ b/arch/x86/entry/syscall_64.c
|
||||
@@ -3,8 +3,14 @@
|
||||
|
@ -144,9 +129,9 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
|||
#include <asm/syscall.h>
|
||||
+#include <asm/alternative.h>
|
||||
|
||||
#define __SYSCALL_COMMON(nr, sym, compat) __SYSCALL_64(nr, sym, compat)
|
||||
|
||||
@@ -30,3 +36,40 @@ asmlinkage const sys_call_ptr_t sys_call
|
||||
#define __SYSCALL_64_QUAL_(sym) sym
|
||||
#define __SYSCALL_64_QUAL_ptregs(sym) ptregs_##sym
|
||||
@@ -25,3 +31,36 @@ asmlinkage const sys_call_ptr_t sys_call
|
||||
[0 ... __NR_syscall_max] = &sys_ni_syscall,
|
||||
#include <asm/syscalls_64.h>
|
||||
};
|
||||
|
@ -159,20 +144,16 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
|||
+module_param_named(x32, x32_enabled, bool, 0444);
|
||||
+
|
||||
+extern char system_call_fast_compare_end[], system_call_fast_compare[],
|
||||
+ system_call_trace_compare_end[], system_call_trace_compare[],
|
||||
+ system_call_mask_compare_end[], system_call_mask_compare[];
|
||||
+
|
||||
+static int __init x32_enable(void)
|
||||
+{
|
||||
+ BUG_ON(system_call_fast_compare_end - system_call_fast_compare != 10);
|
||||
+ BUG_ON(system_call_trace_compare_end - system_call_trace_compare != 10);
|
||||
+ BUG_ON(system_call_mask_compare_end - system_call_mask_compare != 10);
|
||||
+
|
||||
+ if (x32_enabled) {
|
||||
+ text_poke_early(system_call_fast_compare,
|
||||
+ system_call_mask_compare, 10);
|
||||
+ text_poke_early(system_call_trace_compare,
|
||||
+ system_call_mask_compare, 10);
|
||||
+#ifdef CONFIG_X86_X32_DISABLED
|
||||
+ pr_info("Enabled x32 syscalls\n");
|
||||
+#endif
|
||||
|
@ -187,3 +168,35 @@ Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
|||
+late_initcall(x32_enable);
|
||||
+
|
||||
+#endif
|
||||
--- a/arch/x86/entry/common.c
|
||||
+++ b/arch/x86/entry/common.c
|
||||
@@ -334,6 +334,7 @@ __visible void do_syscall_64(struct pt_r
|
||||
{
|
||||
struct thread_info *ti = pt_regs_to_thread_info(regs);
|
||||
unsigned long nr = regs->orig_ax;
|
||||
+ unsigned int syscall_mask, nr_syscalls_enabled;
|
||||
|
||||
enter_from_user_mode();
|
||||
local_irq_enable();
|
||||
@@ -346,8 +347,19 @@ __visible void do_syscall_64(struct pt_r
|
||||
* table. The only functional difference is the x32 bit in
|
||||
* regs->orig_ax, which changes the behavior of some syscalls.
|
||||
*/
|
||||
- if (likely((nr & __SYSCALL_MASK) < NR_syscalls)) {
|
||||
- regs->ax = sys_call_table[nr & __SYSCALL_MASK](
|
||||
+ if (__SYSCALL_MASK == ~0U || x32_enabled) {
|
||||
+ syscall_mask = __SYSCALL_MASK;
|
||||
+ nr_syscalls_enabled = NR_syscalls;
|
||||
+ } else {
|
||||
+ /*
|
||||
+ * x32 syscalls present but not enabled. Don't mask out
|
||||
+ * the x32 flag and don't enable any x32-specific calls.
|
||||
+ */
|
||||
+ syscall_mask = ~0U;
|
||||
+ nr_syscalls_enabled = 512;
|
||||
+ }
|
||||
+ if (likely((nr & syscall_mask) < nr_syscalls_enabled)) {
|
||||
+ regs->ax = sys_call_table[nr & syscall_mask](
|
||||
regs->di, regs->si, regs->dx,
|
||||
regs->r10, regs->r8, regs->r9);
|
||||
}
|
||||
|
|
|
@ -14,7 +14,6 @@ debian/tools-perf-install.patch
|
|||
# Fixes/improvements to firmware loading
|
||||
features/all/drivers-media-dvb-usb-af9005-request_firmware.patch
|
||||
debian/iwlwifi-do-not-request-unreleased-firmware.patch
|
||||
bugfix/all/firmware_class-return-specific-errors-from-file-read.patch
|
||||
bugfix/all/firmware_class-log-every-success-and-failure.patch
|
||||
bugfix/all/firmware-remove-redundant-log-messages-from-drivers.patch
|
||||
bugfix/all/radeon-firmware-is-required-for-drm-and-kms-on-r600-onward.patch
|
||||
|
@ -45,40 +44,25 @@ debian/snd-pcsp-disable-autoload.patch
|
|||
bugfix/x86/viafb-autoload-on-olpc-xo1.5-only.patch
|
||||
|
||||
# Arch bug fixes
|
||||
bugfix/x86/vmxnet3-fix-lock-imbalance-in-vmxnet3_tq_xmit.patch
|
||||
bugfix/x86/acpi-processor-request-native-thermal-interrupt-hand.patch
|
||||
|
||||
# Arch features
|
||||
features/mips/MIPS-increase-MAX-PHYSMEM-BITS-on-Loongson-3-only.patch
|
||||
features/mips/MIPS-Loongson-3-Add-Loongson-LS3A-RS780E-1-way-machi.patch
|
||||
features/mips/MIPS-octeon-Add-support-for-the-UBNT-E200-board.patch
|
||||
features/mips/libata-support-AHCI-on-OCTEON-platform.patch
|
||||
features/mips/MIPS-Octeon-Add-Octeon-III-CN7xxx-interface-detection.patch
|
||||
features/x86/x86-memtest-WARN-if-bad-RAM-found.patch
|
||||
features/x86/x86-make-x32-syscall-support-conditional.patch
|
||||
features/sparc/hwrng-n2-attach-on-t5-m5-t7-m7-sparc-cpus.patch
|
||||
features/arm/device-tree/ARM-dts-imx6dlq-wandboard-revb1.dts-use-unique-model-id.patch
|
||||
features/arm/device-tree/ARM-dts-kirkwood-relicense-dts-of-ls-wvl-vl-and-ls-wxl-ws.patch
|
||||
features/arm/device-tree/ARM-dts-kirkwood-split-lswxl-dts-to-linkstation-lswsxl-an.patch
|
||||
features/arm/device-tree/ARM-dts-kirkwood-split-lswvl-dts-to-linkstation-lsvl-and-.patch
|
||||
features/arm/device-tree/ARM-dts-kirkwood-add-for-buffalo-linkstation-ls-qvl.patch
|
||||
features/arm/device-tree/ARM-dts-orion5x-split-linkstation-lswtgl-into-common-and-.patch
|
||||
features/arm/device-tree/ARM-dts-orion5x-add-for-buffalo-linkstation-ls-gl.patch
|
||||
features/arm/device-tree/ARM-dts-kirkwood-add-kirkwood-ds112.dtb-to-Makefile.patch
|
||||
features/arm/device-tree/ARM-dts-kirkwood-add-kirkwood-nsa320.dtb-to-Makefile.patch
|
||||
features/arm/device-tree/ARM-dts-orion5x-add-device-tree-for-kurobox-pro.patch
|
||||
|
||||
# Miscellaneous bug fixes
|
||||
bugfix/all/misc-bmp085-Enable-building-as-a-module.patch
|
||||
bugfix/all/kbuild-use-nostdinc-in-compile-tests.patch
|
||||
bugfix/all/disable-some-marvell-phys.patch
|
||||
bugfix/all/rtsx_usb_ms-use-msleep_interruptible-in-polling-loop.patch
|
||||
bugfix/all/mm-zone_device-depends-on-sparsemem_vmemmap.patch
|
||||
bugfix/all/fs-add-module_softdep-declarations-for-hard-coded-cr.patch
|
||||
|
||||
# Miscellaneous features
|
||||
features/all/mm-exclude-zone_device-from-gfp_zone_table.patch
|
||||
features/all/nbd-create-size-change-events-for-userspace.patch
|
||||
|
||||
# Hardening from grsecurity
|
||||
features/all/grsecurity/grsecurity-kconfig.patch
|
||||
|
@ -108,21 +92,7 @@ features/all/securelevel/enable-cold-boot-attack-mitigation.patch
|
|||
|
||||
# Security fixes
|
||||
bugfix/all/ptrace-being-capable-wrt-a-process-requires-mapped-uids-gids.patch
|
||||
bugfix/x86/x86-mm-page-align-the-_end-symbol-to-avoid-pfn-conve.patch
|
||||
bugfix/x86/x86-mm-pat-ensure-cpa-pfn-only-contains-page-frame-n.patch
|
||||
bugfix/x86/x86-efi-map-ram-into-the-identity-page-table-for-mix.patch
|
||||
bugfix/x86/x86-efi-hoist-page-table-switching-code-into-efi_cal.patch
|
||||
bugfix/x86/x86-efi-build-our-own-page-table-structures.patch
|
||||
bugfix/x86/x86-efi-setup-separate-efi-page-tables-in-kexec-path.patch
|
||||
debian/i386-686-pae-pci-set-pci-nobios-by-default.patch
|
||||
bugfix/x86/x86-efi-bgrt-fix-kernel-panic-when-mapping-bgrt-data.patch
|
||||
bugfix/x86/x86-efi-bgrt-replace-early_memremap-with-memremap.patch
|
||||
bugfix/x86/x86-mm-pat-fix-boot-crash-when-1gb-pages-are-not-supported.patch
|
||||
bugfix/all/netfilter-x_tables-check-for-size-overflow.patch
|
||||
bugfix/all/netfilter-x_tables-validate-e-target_offset-early.patch
|
||||
bugfix/all/netfilter-x_tables-make-sure-e-next_offset-covers-re.patch
|
||||
bugfix/all/ipv4-don-t-do-expensive-useless-work-during-inetdev-.patch
|
||||
bugfix/x86/x86-mm-32-enable-full-randomization-on-i386-and-x86_.patch
|
||||
|
||||
# Tools bug fixes
|
||||
bugfix/all/usbip-document-tcp-wrappers.patch
|
||||
|
@ -137,7 +107,6 @@ bugfix/all/tools-lib-lockdep-use-ldflags.patch
|
|||
bugfix/x86/tools-hv-fix-fortify-format-warning.patch
|
||||
bugfix/x86/revert-perf-build-fix-libunwind-feature-detection-on.patch
|
||||
bugfix/alpha/alpha-uapi-add-support-for-__sane_userspace_types__.patch
|
||||
bugfix/all/perf-fix-misleadingly-indented-assignment-whitespace.patch
|
||||
bugfix/x86/perf-tools-fix-unused-variables-x86_-32-64-_regoffse.patch
|
||||
bugfix/x86/revert-perf-tools-x86-build-perf-on-older-user-space.patch
|
||||
bugfix/all/lockdep-add-missing-macros.patch
|
||||
|
|
Loading…
Reference in New Issue